Revision: 201017
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 14 May 2010 16:22:35 +0300
changeset 16 43d09473c595
parent 14 80975da52420
child 22 128eb6a32b84
Revision: 201017 Kit: 201019
khronosfws/openmax_al/bwins/openmaxalu.def
khronosfws/openmax_al/data/openmaxal.cfg
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/inc/profileutilmacro.h
khronosfws/openmax_al/rom/openmax_al.iby
khronosfws/openmax_al/sis/openmax_al.pkg
khronosfws/openmax_al/sis/openmax_al_udeb.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/adptcommon/xaadptbasectx.c
khronosfws/openmax_al/src/adptcommon/xaadptbasectx.h
khronosfws/openmax_al/src/adptcommon/xacapabilitiesmgr.c
khronosfws/openmax_al/src/adptcommon/xacapabilitiesmgr.h
khronosfws/openmax_al/src/adptcommon/xaframeworkmgr.c
khronosfws/openmax_al/src/adptcommon/xaframeworkmgr.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/xadynamicsourceitf.c
khronosfws/openmax_al/src/common/xadynamicsourceitf.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/xanlinearvolumeitf.h
khronosfws/openmax_al/src/common/xanokialinearvolume_iid.c
khronosfws/openmax_al/src/common/xanokialinearvolumeitf.c
khronosfws/openmax_al/src/common/xanokiavolumeext_iid.c
khronosfws/openmax_al/src/common/xanokiavolumeextitf.c
khronosfws/openmax_al/src/common/xanvolumeextitf.h
khronosfws/openmax_al/src/common/xaobjectitf.c
khronosfws/openmax_al/src/common/xaobjectitf.h
khronosfws/openmax_al/src/common/xaobjects.h
khronosfws/openmax_al/src/common/xastreaminformationitf.c
khronosfws/openmax_al/src/common/xastreaminformationitf.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/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/xaimageencodercapabilitiesitf.c
khronosfws/openmax_al/src/engine/xavideodecodercapabilitiesitf.c
khronosfws/openmax_al/src/engine/xavideoencodercapabilitiesitf.c
khronosfws/openmax_al/src/gst_adaptation/xaadaptationgst.c
khronosfws/openmax_al/src/gst_adaptation/xaadaptationgst.h
khronosfws/openmax_al/src/gst_adaptation/xaaudioencoderitfadaptation.c
khronosfws/openmax_al/src/gst_adaptation/xaaudioencoderitfadaptation.h
khronosfws/openmax_al/src/gst_adaptation/xacameraadaptctx.c
khronosfws/openmax_al/src/gst_adaptation/xacameraadaptctx.h
khronosfws/openmax_al/src/gst_adaptation/xacameraitfadaptation.c
khronosfws/openmax_al/src/gst_adaptation/xacameraitfadaptation.h
khronosfws/openmax_al/src/gst_adaptation/xadevicevolumeitfadaptation.c
khronosfws/openmax_al/src/gst_adaptation/xadevicevolumeitfadaptation.h
khronosfws/openmax_al/src/gst_adaptation/xadynamicsourceitfadaptation.c
khronosfws/openmax_al/src/gst_adaptation/xadynamicsourceitfadaptation.h
khronosfws/openmax_al/src/gst_adaptation/xaengineadaptctx.c
khronosfws/openmax_al/src/gst_adaptation/xaengineadaptctx.h
khronosfws/openmax_al/src/gst_adaptation/xaequalizeritfadaptation.c
khronosfws/openmax_al/src/gst_adaptation/xaequalizeritfadaptation.h
khronosfws/openmax_al/src/gst_adaptation/xagstcapabilitiesmgr.c
khronosfws/openmax_al/src/gst_adaptation/xagstcapabilitiesmgr.h
khronosfws/openmax_al/src/gst_adaptation/xaimagecontrolsitfadaptation.c
khronosfws/openmax_al/src/gst_adaptation/xaimagecontrolsitfadaptation.h
khronosfws/openmax_al/src/gst_adaptation/xaimageeffectsitfadaptation.c
khronosfws/openmax_al/src/gst_adaptation/xaimageeffectsitfadaptation.h
khronosfws/openmax_al/src/gst_adaptation/xaimageencoderitfadaptation.c
khronosfws/openmax_al/src/gst_adaptation/xaimageencoderitfadaptation.h
khronosfws/openmax_al/src/gst_adaptation/xaledarrayadaptctx.c
khronosfws/openmax_al/src/gst_adaptation/xaledarrayadaptctx.h
khronosfws/openmax_al/src/gst_adaptation/xaledarrayitfadaptation.c
khronosfws/openmax_al/src/gst_adaptation/xaledarrayitfadaptation.h
khronosfws/openmax_al/src/gst_adaptation/xamediaplayeradaptctx.c
khronosfws/openmax_al/src/gst_adaptation/xamediaplayeradaptctx.h
khronosfws/openmax_al/src/gst_adaptation/xamediarecorderadaptctx.c
khronosfws/openmax_al/src/gst_adaptation/xamediarecorderadaptctx.h
khronosfws/openmax_al/src/gst_adaptation/xametadataadaptation.c
khronosfws/openmax_al/src/gst_adaptation/xametadataadaptation.h
khronosfws/openmax_al/src/gst_adaptation/xametadataadaptctx.c
khronosfws/openmax_al/src/gst_adaptation/xametadataadaptctx.h
khronosfws/openmax_al/src/gst_adaptation/xaoutputmixadaptctx.c
khronosfws/openmax_al/src/gst_adaptation/xaoutputmixadaptctx.h
khronosfws/openmax_al/src/gst_adaptation/xaoutputmixitfadaptation.c
khronosfws/openmax_al/src/gst_adaptation/xaoutputmixitfadaptation.h
khronosfws/openmax_al/src/gst_adaptation/xaplaybackrateitfadaptation.c
khronosfws/openmax_al/src/gst_adaptation/xaplaybackrateitfadaptation.h
khronosfws/openmax_al/src/gst_adaptation/xaplayitfadaptation.c
khronosfws/openmax_al/src/gst_adaptation/xaplayitfadaptation.h
khronosfws/openmax_al/src/gst_adaptation/xaradioadaptctx.c
khronosfws/openmax_al/src/gst_adaptation/xaradioadaptctx.h
khronosfws/openmax_al/src/gst_adaptation/xaradioitfadaptation.c
khronosfws/openmax_al/src/gst_adaptation/xaradioitfadaptation.h
khronosfws/openmax_al/src/gst_adaptation/xardsitfadaptation.c
khronosfws/openmax_al/src/gst_adaptation/xardsitfadaptation.h
khronosfws/openmax_al/src/gst_adaptation/xarecorditfadaptation.c
khronosfws/openmax_al/src/gst_adaptation/xarecorditfadaptation.h
khronosfws/openmax_al/src/gst_adaptation/xaseekitfadaptation.c
khronosfws/openmax_al/src/gst_adaptation/xaseekitfadaptation.h
khronosfws/openmax_al/src/gst_adaptation/xasnapshotitfadaptation.c
khronosfws/openmax_al/src/gst_adaptation/xasnapshotitfadaptation.h
khronosfws/openmax_al/src/gst_adaptation/xastaticcameracapsadaptation.c
khronosfws/openmax_al/src/gst_adaptation/xastaticcameracapsadaptation.h
khronosfws/openmax_al/src/gst_adaptation/xastreaminformationitfadaptation.c
khronosfws/openmax_al/src/gst_adaptation/xastreaminformationitfadaptation.h
khronosfws/openmax_al/src/gst_adaptation/xavibraadaptctx.c
khronosfws/openmax_al/src/gst_adaptation/xavibraadaptctx.h
khronosfws/openmax_al/src/gst_adaptation/xavibraitfadaptation.c
khronosfws/openmax_al/src/gst_adaptation/xavibraitfadaptation.h
khronosfws/openmax_al/src/gst_adaptation/xavideoencoderitfadaptation.c
khronosfws/openmax_al/src/gst_adaptation/xavideoencoderitfadaptation.h
khronosfws/openmax_al/src/gst_adaptation/xavideopostprosessingitfadaptation.c
khronosfws/openmax_al/src/gst_adaptation/xavideopostprosessingitfadaptation.h
khronosfws/openmax_al/src/gst_adaptation/xavolumeitfadaptation.c
khronosfws/openmax_al/src/gst_adaptation/xavolumeitfadaptation.h
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/cmetadatautilityitf.cpp
khronosfws/openmax_al/src/mmf_adaptation/cmetadatautilityitf.h
khronosfws/openmax_al/src/mmf_adaptation/cmmfbackendengine.cpp
khronosfws/openmax_al/src/mmf_adaptation/cmmfbackendengine.h
khronosfws/openmax_al/src/mmf_adaptation/markerpositiontimer.cpp
khronosfws/openmax_al/src/mmf_adaptation/markerpositiontimer.h
khronosfws/openmax_al/src/mmf_adaptation/positionupdatetimer.cpp
khronosfws/openmax_al/src/mmf_adaptation/positionupdatetimer.h
khronosfws/openmax_al/src/mmf_adaptation/xaadaptationcontextbasemmf.c
khronosfws/openmax_al/src/mmf_adaptation/xaadaptationcontextbasemmf.h
khronosfws/openmax_al/src/mmf_adaptation/xaadaptationmmf.c
khronosfws/openmax_al/src/mmf_adaptation/xaadaptationmmf.h
khronosfws/openmax_al/src/mmf_adaptation/xadynamicsourceitfadaptationmmf.c
khronosfws/openmax_al/src/mmf_adaptation/xadynamicsourceitfadaptationmmf.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/xametadataadaptctxmmf.c
khronosfws/openmax_al/src/mmf_adaptation/xametadataadaptctxmmf.h
khronosfws/openmax_al/src/mmf_adaptation/xammfcapabilitiesmgr.c
khronosfws/openmax_al/src/mmf_adaptation/xammfcapabilitiesmgr.h
khronosfws/openmax_al/src/mmf_adaptation/xangavideosink.cpp
khronosfws/openmax_al/src/mmf_adaptation/xangavideosink.h
khronosfws/openmax_al/src/mmf_adaptation/xanokialinearvolumeitfadaptationmmf.c
khronosfws/openmax_al/src/mmf_adaptation/xanokialinearvolumeitfadaptationmmf.h
khronosfws/openmax_al/src/mmf_adaptation/xanokiavolumeextitfadaptationmmf.c
khronosfws/openmax_al/src/mmf_adaptation/xanokiavolumeextitfadaptationmmf.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/mmf_adaptation/xaseekitfadaptationmmf.c
khronosfws/openmax_al/src/mmf_adaptation/xaseekitfadaptationmmf.h
khronosfws/openmax_al/src/mmf_adaptation/xastreaminformationitfadaptationmmf.c
khronosfws/openmax_al/src/mmf_adaptation/xastreaminformationitfadaptationmmf.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
mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/AdvancedAudioController/Src/AdvancedAudioPlayController.cpp
mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/AdvancedAudioControllerUtility/Src/MP3AudioControllerUtility.cpp
mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/aacaudioplaycontroller/Src/AACAudioPlayControllerPlugin.cpp
mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/amraudioplaycontroller/Src/AMRAudioPlayControllerPlugin.cpp
mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/awbaudioplaycontroller/Src/AWBAudioPlayControllerPlugin.cpp
mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/mp3audioplaycontroller/Src/MP3AudioPlayControllerPlugin.cpp
mmfenh/enhancedmediaclient/Client/EABI/EnhancedMediaClient.def
mmfenh/enhancedmediaclient/Client/group/EnhancedMediaClient.mmp
mmfenh/enhancedmediaclient/Client/src/Components/ClientProgDLSource/ClientProgDLSource.cpp
mmfenh/enhancedmediaclient/Client/src/Components/ClientProgDLSource/ClientProgDLSource.h
mmfenh/enhancedmediaclient/Client/src/Components/ClientProgDLSource/DownloadGateway.cpp
mmfenh/enhancedmediaclient/Client/src/Components/ClientProgDLSource/DownloadGateway.h
mmfenh/enhancedmediaclient/Client/src/Components/ClientProgDLSource/EventAO.cpp
mmfenh/enhancedmediaclient/Client/src/Components/ClientProgDLSource/EventAO.h
mmfenh/enhancedmediaclient/Client/src/Components/ControlFactory/ControlFactoryImpl.cpp
mmfenh/enhancedmediaclient/Client/src/Components/ControlFactory/ControlFactoryImpl.h
mmfenh/enhancedmediaclient/Client/src/Components/StreamControl/ClientStreamControl.cpp
mmfenh/enhancedmediaclient/Client/src/Components/StreamControl/ClientUtility.cpp
mmfenh/enhancedmediaclient/Plugins/FileSource/group/FileSource.mmp
mmfenh/enhancedmediaclient/Plugins/MultimediaDataSource/DataSourceFactory/group/MultimediaDataSourceFactory.mmp
mmfenh/enhancedmediaclient/Plugins/MultimediaDataSource/DataSourceFactory/src/MultimediaDataSourceFactory.cpp
mmfenh/enhancedmediaclient/Plugins/ProgDLSource/bwins/ProgDLSource.def
mmfenh/enhancedmediaclient/Plugins/ProgDLSource/data/10207B45.rss
mmfenh/enhancedmediaclient/Plugins/ProgDLSource/eabi/ProgDLSource.def
mmfenh/enhancedmediaclient/Plugins/ProgDLSource/group/ProgDLSource.mmp
mmfenh/enhancedmediaclient/Plugins/ProgDLSource/group/bld.inf
mmfenh/enhancedmediaclient/Plugins/ProgDLSource/inc/MmfFile.h
mmfenh/enhancedmediaclient/Plugins/ProgDLSource/inc/ProgDLDataSource.h
mmfenh/enhancedmediaclient/Plugins/ProgDLSource/inc/ProgDLMultimediaSource.h
mmfenh/enhancedmediaclient/Plugins/ProgDLSource/inc/ProgDLSourceCustomCommands.h
mmfenh/enhancedmediaclient/Plugins/ProgDLSource/inc/ProgDLSourceUid.h
mmfenh/enhancedmediaclient/Plugins/ProgDLSource/inc/ProgDLSourceUid.hrh
mmfenh/enhancedmediaclient/Plugins/ProgDLSource/src/FileAccess.h
mmfenh/enhancedmediaclient/Plugins/ProgDLSource/src/Main.cpp
mmfenh/enhancedmediaclient/Plugins/ProgDLSource/src/MmffilePriv.h
mmfenh/enhancedmediaclient/Plugins/ProgDLSource/src/ProgDLSource.cpp
mmfenh/enhancedmediaclient/Plugins/ProgDLSource/src/SinkQueueItem.cpp
mmfenh/enhancedmediaclient/Plugins/ProgDLSource/src/SinkQueueItem.h
mmfenh/enhancedmediaclient/Plugins/ProgDLSource/src/fileaccess.cpp
mmfenh/enhancedmediaclient/Plugins/TransferRateMonitor/BWINS/TransferRateMonitor.def
mmfenh/enhancedmediaclient/Plugins/TransferRateMonitor/EABI/TransferRateMonitor.def
mmfenh/enhancedmediaclient/Plugins/TransferRateMonitor/group/TransferRateMonitor.mmp
mmfenh/enhancedmediaclient/Plugins/TransferRateMonitor/group/bld.inf
mmfenh/enhancedmediaclient/Plugins/TransferRateMonitor/inc/TransferRateMonitor.h
mmfenh/enhancedmediaclient/Plugins/TransferRateMonitor/src/TransferRateMonitor.cpp
mmfenh/enhancedmediaclient/group/bld.inf
mmfenh/enhancedmediaclient/rom/EnhancedMediaClient.iby
mmfenh/group/bld.inf
mmfenh/progressivedownload/Data/Create_ProgressiveDownload_STUB_SIS.bat
mmfenh/progressivedownload/Data/ProgressiveDownload_Stub.SIS
mmfenh/progressivedownload/Data/ProgressiveDownload_Stub.pkg
mmfenh/progressivedownload/ProgressiveDownloadSource/BWINS/PROGRESSIVEDOWNLOADSOURCE.def
mmfenh/progressivedownload/ProgressiveDownloadSource/data/10207a7b.rss
mmfenh/progressivedownload/ProgressiveDownloadSource/group/ProgressiveDownloadSource.mmp
mmfenh/progressivedownload/ProgressiveDownloadSource/group/bld.inf
mmfenh/progressivedownload/ProgressiveDownloadSource/src/FileAccess.h
mmfenh/progressivedownload/ProgressiveDownloadSource/src/MmffilePriv.h
mmfenh/progressivedownload/ProgressiveDownloadSource/src/ProgressiveDownloadSource.cpp
mmfenh/progressivedownload/ProgressiveDownloadSource/src/ProgressiveDownloadSource.h
mmfenh/progressivedownload/ProgressiveDownloadSource/src/ProgressiveDownloadSourceUIDs.hrh
mmfenh/progressivedownload/ProgressiveDownloadSource/src/fileaccess.cpp
mmfenh/progressivedownload/ProgressiveDownloadUtility/BWINS/PDProperties.def
mmfenh/progressivedownload/ProgressiveDownloadUtility/BWINS/ProgressiveDownloadUtility.def
mmfenh/progressivedownload/ProgressiveDownloadUtility/EABI/PDProperties.def
mmfenh/progressivedownload/ProgressiveDownloadUtility/EABI/ProgressiveDownloadUtility.def
mmfenh/progressivedownload/ProgressiveDownloadUtility/group/PDProperties.mmp
mmfenh/progressivedownload/ProgressiveDownloadUtility/group/ProgressiveDownloadUtility.mmp
mmfenh/progressivedownload/ProgressiveDownloadUtility/group/bld.inf
mmfenh/progressivedownload/ProgressiveDownloadUtility/src/AudioPdPlayUtility.cpp
mmfenh/progressivedownload/ProgressiveDownloadUtility/src/AudioPdPlayUtility.h
mmfenh/progressivedownload/ProgressiveDownloadUtility/src/AudioPdProperties.h
mmfenh/progressivedownload/ProgressiveDownloadUtility/src/BufferEmptiedEventAO.cpp
mmfenh/progressivedownload/ProgressiveDownloadUtility/src/BufferEmptiedEventAO.h
mmfenh/progressivedownload/ProgressiveDownloadUtility/src/ContentFile.cpp
mmfenh/progressivedownload/ProgressiveDownloadUtility/src/ContentFile.h
mmfenh/progressivedownload/ProgressiveDownloadUtility/src/EMCPdPlayUtility.cpp
mmfenh/progressivedownload/ProgressiveDownloadUtility/src/EMCPdPlayUtility.h
mmfenh/progressivedownload/ProgressiveDownloadUtility/src/EMCPdProperties.h
mmfenh/progressivedownload/ProgressiveDownloadUtility/src/PDProperties.cpp
mmfenh/progressivedownload/ProgressiveDownloadUtility/src/PdProperties.h
mmfenh/progressivedownload/ProgressiveDownloadUtility/src/ProgressiveDownloadUtility.cpp
mmfenh/progressivedownload/ProgressiveDownloadUtility/src/mmfclientutility.cpp
mmfenh/progressivedownload/ProgressiveDownloadUtility/src/mmfclientutility.h
mmfenh/progressivedownload/group/bld.inf
mmfenh/progressivedownload/rom/progressivedownload.iby
mmmw_plat/audio_metadata_reader_api/inc/MetaDataField.hrh
mmmw_plat/audio_output_control_utility_api/tsrc/AudioOutputControlTestClass/inc/AudioOutputControlTestClass.h
mmmw_plat/emc_progressive_download_source_api/emc_progressive_download_source_api.metaxml
mmmw_plat/emc_progressive_download_source_api/group/bld.inf
mmmw_plat/emc_progressive_download_source_api/inc/ProgDLSource.h
mmmw_plat/enhanced_media_client_api/tsrc/Conf/EnhanMediaTestClass.cfg
mmmw_plat/enhanced_media_client_api/tsrc/EnhanMediaTestClass/EABI/EnhanMediaTestClassu.def
mmmw_plat/enhanced_media_client_api/tsrc/EnhanMediaTestClass/inc/EnhanMediaTestClass.h
mmmw_plat/enhanced_media_client_api/tsrc/EnhanMediaTestClass/src/EnhanMediaTestCallbacks.cpp
mmmw_plat/enhanced_media_client_api/tsrc/EnhanMediaTestClass/src/EnhanMediaTestClassBlocks.cpp
mmmw_plat/equalizer_ui_api/equalizer_ui_api.metaxml
mmmw_plat/equalizer_ui_api/group/bld.inf
mmmw_plat/equalizer_ui_api/inc/EqualizerConstants.h
mmmw_plat/equalizer_ui_api/inc/EqualizerPresetsDialog.h
mmmw_plat/equalizer_ui_api/tsrc/conf/tcequalizertest.cfg
mmmw_plat/equalizer_ui_api/tsrc/conf/ui_equalizertest.cfg
mmmw_plat/equalizer_ui_api/tsrc/group/bld.inf
mmmw_plat/equalizer_ui_api/tsrc/init/TestFramework.ini
mmmw_plat/equalizer_ui_api/tsrc/ui_equalizertest/Bmarm/ui_equalizertestU.DEF
mmmw_plat/equalizer_ui_api/tsrc/ui_equalizertest/Bwins/ui_equalizertestU.DEF
mmmw_plat/equalizer_ui_api/tsrc/ui_equalizertest/EABI/ui_equalizertestU.def
mmmw_plat/equalizer_ui_api/tsrc/ui_equalizertest/group/bld.inf
mmmw_plat/equalizer_ui_api/tsrc/ui_equalizertest/group/ui_equalizertest.mmp
mmmw_plat/equalizer_ui_api/tsrc/ui_equalizertest/group/ui_equalizertest.pkg
mmmw_plat/equalizer_ui_api/tsrc/ui_equalizertest/inc/EdwinTestControl.h
mmmw_plat/equalizer_ui_api/tsrc/ui_equalizertest/inc/ui_equalizertest.h
mmmw_plat/equalizer_ui_api/tsrc/ui_equalizertest/src/EdwinTestControl.cpp
mmmw_plat/equalizer_ui_api/tsrc/ui_equalizertest/src/ui_equalizertest.cpp
mmmw_plat/equalizer_ui_api/tsrc/ui_equalizertest/src/ui_equalizertestBlocks.cpp
mmmw_plat/group/bld.inf
mmmw_plat/openmax_al_api/openmax_al_api.metaxml
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_common.cfg
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_common_dynsrcitf.cfg
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_common_noklinvolitf.cfg
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_common_nokvolextitf.cfg
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_common_volumeitf.cfg
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_engine_aiodcitf.cfg
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_engine_audenccapitf.cfg
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_engine_engineitf.cfg
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_global.cfg
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_mo.cfg
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_mo_mdextractionitf.cfg
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_mp.cfg
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_mp_mdextractionitf.cfg
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_mp_objectitf.cfg
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_mp_playitf.cfg
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_mp_preemption.cfg
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_mp_seekitf.cfg
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_mp_strminfoitf.cfg
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_mp_variousformats.cfg
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_mr.cfg
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_mr_audioencoderitf.cfg
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_mr_mdinsertionitf.cfg
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_mr_recorditf.cfg
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_objectitf.cfg
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_ro_audioencoderitf.cfg
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_ro_mdinsertionitf.cfg
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_ro_recorditf.cfg
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/data/c/omxaltestdata/JapJap.mp3
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/data/c/omxaltestdata/readme.txt
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/data/c/omxaltestdata/test.3gp
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/data/c/omxaltestdata/test.mp3
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/data/c/omxaltestdata/testmp4.mp4
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/group/bld.inf
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/group/openmaxaltestmodule.mmp
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/group/openmaxaltestmodule.pkg
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/inc/TimeoutController.h
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/inc/openmaxaltestmodule.h
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/inc/profileutilmacro.h
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/init/testframework.ini
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/TimeoutController.cpp
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxalcommontests.cpp
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxaldynitfmgmtitftests.cpp
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxaldynsrcitftests.cpp
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxalnokialinearvolumeitftests.cpp
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxalnokiavolumeextitftests.cpp
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxalobjectcallbacks.cpp
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxalobjectitftests.cpp
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxalstrminfoitftests.cpp
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxaltestmodule.cpp
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxaltestmoduleblocks.cpp
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxalvolumeitftests.cpp
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/engine/openmaxalengineitftests.cpp
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/metadata/openmaxalmetadataextractionitftests.cpp
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/player/openmaxalplayitftests.cpp
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/player/openmaxalseekitftests.cpp
mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/recorder/openmaxalaudioencoderitftests.cpp
mmmw_plat/openmax_al_ext_api/group/bld.inf
mmmw_plat/openmax_al_ext_api/inc/xanokialinearvolumeitf.h
mmmw_plat/openmax_al_ext_api/inc/xanokiavolumeextitf.h
mmmw_plat/openmax_al_ext_api/openmax_al_ext_api.metaxml
mmmw_plat/openmax_al_ext_api/readme_ext.txt
mmmw_plat/progressive_download_api/group/bld.inf
mmmw_plat/progressive_download_api/inc/MAudioPdPlayUtility.h
mmmw_plat/progressive_download_api/inc/MAudioPlayUtility.h
mmmw_plat/progressive_download_api/inc/MProgressiveDownloadUtility.h
mmmw_plat/progressive_download_api/inc/ProgressiveDownloadUtility.h
mmmw_plat/progressive_download_api/progressive_download_api.metaxml
mmmw_plat/system_tone_service_api/inc/systemtoneservice.h
mmmw_plat/system_tone_service_api/system_tone_service_api.metaxml
mmmw_plat/system_tone_service_api/tsrc/conf/systemtoneservicestif.cfg
mmmw_plat/system_tone_service_api/tsrc/conf/systemtoneservicestif_calendaralarm.cfg
mmmw_plat/system_tone_service_api/tsrc/conf/systemtoneservicestif_common.cfg
mmmw_plat/system_tone_service_api/tsrc/group/systemtoneservicestif.mmp
mmmw_plat/system_tone_service_api/tsrc/inc/systemtoneservicestif.h
mmmw_plat/system_tone_service_api/tsrc/src/systemtoneservicestifblocks.cpp
mmmw_plat/telephony_multimedia_service_api/inc/tmssource.h
mmmw_plat/telephony_multimedia_service_api/tsrc/Conf/TMSAudioServicesTestClass.cfg
mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/inc/TMSAudioServicesTestClass.h
mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/sis/TmsAudioServicesTestClass.sis
mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/sis/TmsAudioServicesTestClass.sisx
mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/sis/create_sis.bat
mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/src/TmsAudioServicesTestClassBlocks.cpp
mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/src/TmsAudioServicesTestClassBlocksCallbacks.cpp
mmserv/audioeffectsui/equalizer/bwinscw/EqualizerU.DEF
mmserv/audioeffectsui/equalizer/data/Equalizer.rss
mmserv/audioeffectsui/equalizer/eabi/EqualizerU.DEF
mmserv/audioeffectsui/equalizer/group/Equalizer.mmp
mmserv/audioeffectsui/equalizer/group/EqualizerIcons.txt
mmserv/audioeffectsui/equalizer/group/EqualizerIcons2.txt
mmserv/audioeffectsui/equalizer/group/bld.inf
mmserv/audioeffectsui/equalizer/group/icons.mk
mmserv/audioeffectsui/equalizer/group/icons_dc.mk
mmserv/audioeffectsui/equalizer/help/data/xhtml.zip
mmserv/audioeffectsui/equalizer/help/group/bld.inf
mmserv/audioeffectsui/equalizer/help/inc/eq.hlp.hrh
mmserv/audioeffectsui/equalizer/help/rom/equalizerhelps_variant.iby
mmserv/audioeffectsui/equalizer/inc/Equalizer.hrh
mmserv/audioeffectsui/equalizer/inc/Equalizer.rh
mmserv/audioeffectsui/equalizer/inc/EqualizerEditingDialog.h
mmserv/audioeffectsui/equalizer/inc/EqualizerFreqBand.h
mmserv/audioeffectsui/equalizer/inc/EqualizerFreqBandContainer.h
mmserv/audioeffectsui/equalizer/inc/EqualizerPresetListArray.h
mmserv/audioeffectsui/equalizer/inc/EqualizerPrivateConstants.h
mmserv/audioeffectsui/equalizer/inc/eq.hlp.hrh
mmserv/audioeffectsui/equalizer/loc/equalizer.loc
mmserv/audioeffectsui/equalizer/rom/Equalizer.iby
mmserv/audioeffectsui/equalizer/rom/EqualizerResources.iby
mmserv/audioeffectsui/equalizer/src/EqualizerEditingDialog.cpp
mmserv/audioeffectsui/equalizer/src/EqualizerFreqBand.cpp
mmserv/audioeffectsui/equalizer/src/EqualizerFreqBandContainer.cpp
mmserv/audioeffectsui/equalizer/src/EqualizerMain.cpp
mmserv/audioeffectsui/equalizer/src/EqualizerPresetListArray.cpp
mmserv/audioeffectsui/equalizer/src/EqualizerPresetsDialog.cpp
mmserv/audioeffectsui/group/bld.inf
mmserv/audioeffectsui/inc/audioeffectsuibldvariant.hrh
mmserv/group/bld.inf
mmserv/metadatautility/Src/MetaDataParser.cpp
mmserv/metadatautility/Src/MetaDataParser.h
mmserv/metadatautility/Src/MetaDataUtilityBody.cpp
mmserv/radioutility/radio_utility/group/Radio_Utility.mmp
mmserv/radioutility/radio_utility/inc/trace.h
mmserv/radioutility/radio_utility/inc/traceconfiguration.hrh
mmserv/radioutility/radio_utility/src/RadioFmTunerUtility.cpp
mmserv/radioutility/radio_utility/src/RadioFmTunerUtilityBody.cpp
mmserv/radioutility/radio_utility/src/RadioFmTunerUtilityBody.h
mmserv/radioutility/radio_utility/src/RadioMonitor.cpp
mmserv/radioutility/radio_utility/src/RadioMonitorBody.cpp
mmserv/radioutility/radio_utility/src/RadioMonitorBody.h
mmserv/radioutility/radio_utility/src/RadioPlayerUtility.cpp
mmserv/radioutility/radio_utility/src/RadioPlayerUtilityBody.cpp
mmserv/radioutility/radio_utility/src/RadioPlayerUtilityBody.h
mmserv/radioutility/radio_utility/src/RadioRdsUtility.cpp
mmserv/radioutility/radio_utility/src/RadioRdsUtilityBody.cpp
mmserv/radioutility/radio_utility/src/RadioRdsUtilityBody.h
mmserv/radioutility/radio_utility/src/RadioUtility.cpp
mmserv/radioutility/radio_utility/src/RadioUtilityBody.cpp
mmserv/radioutility/radioserver/Server/Src/RadioServer.cpp
mmserv/radioutility/radioserver/Server/Src/RadioServerShutdown.cpp
mmserv/radioutility/radioserver/Server/Src/RadioServerShutdown.h
mmserv/sts/bwins/systemtoneservice.def
mmserv/sts/eabi/systemtoneservice.def
mmserv/sts/inc/sts.h
mmserv/sts/inc/stsclientservercommon.h
mmserv/sts/inc/stsimplementation.h
mmserv/sts/inc/stsplayer.h
mmserv/sts/src/systemtoneservice.cpp
mmserv/sts/stsimplementation/src/rstssession.cpp
mmserv/sts/stsimplementation/src/rstssession.h
mmserv/sts/stsimplementation/src/stsimplementation.cpp
mmserv/sts/stsplayer/src/sts.cpp
mmserv/sts/stsplayer/src/stsplayer.cpp
mmserv/sts/stsserver/src/stsserver.cpp
mmserv/sts/stsserver/src/stsserver.h
mmserv/sts/stsserver/src/stsserverexe.cpp
mmserv/sts/stsserver/src/stsserversession.cpp
mmserv/sts/stsserver/src/stsserversession.h
mmserv/sts/tsrc/ststester/sis/ststester.pkg
mmserv/sts/tsrc/ststester/src/ststester.cpp
mmserv/sts/tsrc/ststester/src/ststester.h
mmserv/thumbnailengine/TneAPISrc/HXTneserver.cpp
mmserv/tms/inc/tmsbufferimpl.h
mmserv/tms/inc/tmseffectimpl.h
mmserv/tms/inc/tmsformatimpl.h
mmserv/tms/inc/tmssinkimpl.h
mmserv/tms/tmscallserver/inc/tmscsdownlink.h
mmserv/tms/tmscallserver/inc/tmscsuplink.h
mmserv/tms/tmscallserver/src/tmscallcsadpt.cpp
mmserv/tms/tmsimpl/eabi/tmsimpl.def
mmserv/tms/tmsimpl/src/tmsbufferimpl.cpp
mmserv/tms/tmsimpl/src/tmseffectimpl.cpp
mmserv/tms/tmsimpl/src/tmsformatimpl.cpp
mmserv/tms/tmsimpl/src/tmssinkimpl.cpp
mmserv/tms/tmsimpl/src/tmssourceimpl.cpp
mmserv/tms/tmsserver/inc/tmsaudioinbandtoneplayer.h
mmserv/tms/tmsserver/inc/tmsaudiotoneutility.h
mmserv/tms/tmsserver/src/tmsaudioinbandtoneplayer.cpp
mmserv/tms/tmsserver/src/tmsaudiotoneutilityimpl.cpp
mmserv/tms/tmsserver/src/tmsserver.cpp
tsrc/group/bld.inf
--- a/khronosfws/openmax_al/bwins/openmaxalu.def	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/bwins/openmaxalu.def	Fri May 14 16:22:35 2010 +0300
@@ -42,4 +42,6 @@
 	XA_IID_VIDEOENCODERCAPABILITIES @ 41 NONAME
 	XA_IID_VIDEOPOSTPROCESSING @ 42 NONAME
 	XA_IID_VOLUME @ 43 NONAME
+	XA_IID_NOKIALINEARVOLUME @ 44 NONAME
+	XA_IID_NOKIAVOLUMEEXT @ 45 NONAME
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/data/openmaxal.cfg	Fri May 14 16:22:35 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: 
+#*
+#*/
+#============================================================================>|
+# Must not exceed 80 chars each line=========================================>|
+#============================================================================>|
+<mediaplayer>
+<mmf>
+<urischeme>
+# Num of entries followed by actual entries all ending with a comma
+3,file,http,rtsp,
+</urischeme>
+<fileext>
+15,3gp,wma,wmv,wav,amr,mp3,mp4,rm,ra,avi,mkv,aac,mid,awb,3g2,
+</fileext>
+</mmf>
+
+<gst>
+<urischeme>
+# Num of entries followed by actual entries all ending with a comma
+0,
+</urischeme>
+<fileext>
+0,
+</fileext>
+</gst>
+</mediaplayer>
+
+<mediarecorder>
+#<mmf>
+#<urischeme>
+# Num of entries followed by actual entries all ending with a comma
+#1,file,
+#</urischeme>
+#<fileext>
+#2,amr,mp4,
+#</fileext>
+#</mmf>
+
+<gst>
+<urischeme>
+# Num of entries followed by actual entries all ending with a comma
+1,file,
+</urischeme>
+<fileext>
+3,wav,amr,mp4,
+</fileext>
+</gst>
+</mediarecorder>
\ No newline at end of file
--- a/khronosfws/openmax_al/eabi/openmaxalu.def	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/eabi/openmaxalu.def	Fri May 14 16:22:35 2010 +0300
@@ -42,4 +42,6 @@
 	XA_IID_VIDEOENCODERCAPABILITIES @ 41 NONAME DATA 4
 	XA_IID_VIDEOPOSTPROCESSING @ 42 NONAME DATA 4
 	XA_IID_VOLUME @ 43 NONAME DATA 4
+	XA_IID_NOKIALINEARVOLUME @ 44 NONAME DATA 4
+	XA_IID_NOKIAVOLUMEEXT @ 45 NONAME DATA 4
 
--- a/khronosfws/openmax_al/group/bld.inf	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/group/bld.inf	Fri May 14 16:22:35 2010 +0300
@@ -26,6 +26,8 @@
 #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)
+../data/openmaxal.cfg       /epoc32/winscw/c/openmaxal/openmaxal.cfg
+
 #endif
 
 PRJ_MMPFILES
--- a/khronosfws/openmax_al/group/openmaxal.mmp	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/group/openmaxal.mmp	Fri May 14 16:22:35 2010 +0300
@@ -31,47 +31,53 @@
 CAPABILITY ALL -TCB
 
 MACRO   USE_NGA_SURFACES
-//MACRO   _GSTREAMER_BACKEND_
+//MACRO 	MARKERPOSITIONTIMERLOG
+//MACRO		POSITIONUPDATETIMERLOG
+//MACRO 	USE_LOCAL_WINDOW_RESOURCES
+//MACRO           PROFILE_TIME
+//MACRO           PRINT_TO_CONSOLE_TIME_DIFF
 
-#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/gst_adaptation
+SOURCE	        xaadaptationgst.c
+SOURCE 	        xagstcapabilitiesmgr.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	        xavibraadaptctx.c
+SOURCE	        xavibraitfadaptation.c
+SOURCE	        xavideoencoderitfadaptation.c
+SOURCE	        xavideopostprosessingitfadaptation.c
+SOURCE	        xavolumeitfadaptation.c
+SOURCE 	        xastreaminformationitfadaptation.c
+
+SOURCEPATH ../src/adptcommon
+SOURCE 	        xaframeworkmgr.c
+SOURCE 	        xacapabilitiesmgr.c
+SOURCE 	        xaadptbasectx.c
 
 SOURCEPATH      ../src/camera
 SOURCE          xacameradevice.c
@@ -93,6 +99,11 @@
 SOURCE          xathreadsafety.c
 SOURCE          xavideopostprocessingitf.c
 SOURCE          xavolumeitf.c
+SOURCE 		xastreaminformationitf.c
+SOURCE          xanokialinearvolume_iid.c
+SOURCE          xanokiavolumeext_iid.c
+SOURCE          xanokialinearvolumeitf.c
+SOURCE          xanokiavolumeextitf.c
 
 SOURCEPATH      ../src/engine
 SOURCE          xaaudiodecodercapabilitiesitf.c
@@ -133,34 +144,45 @@
 
 SOURCEPATH      ../src/outputmix
 SOURCE          xaoutputmix.c
-SOURCE		    xaoutputmixitf.c
+SOURCE		xaoutputmixitf.c
 
 SOURCEPATH      ../src/radio
 SOURCE          xaradiodevice.c
-SOURCE		    xaradioitf.c
-SOURCE		    xardsitf.c
+SOURCE		xaradioitf.c
+SOURCE		xardsitf.c
 
 SOURCEPATH      ../src/vibra
 SOURCE          xavibradevice.c
-SOURCE		    xavibraitf.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
+//	Removing below file since currently there is no Engine related
+// 	mmf adaptation
+//SOURCE          xaengineadaptctxmmf.c
+SOURCE	        xamediaplayeradaptctxmmf.c
+SOURCE	        xaplayitfadaptationmmf.c
+SOURCE	        xaadaptationmmf.c
+SOURCE          cmmfbackendengine.cpp
+SOURCE          xamediarecorderadaptctxmmf.c
+SOURCE          xarecorditfadaptationmmf.c
+SOURCE 	        sfmrlocaltimer.cpp
+SOURCE          xanokialinearvolumeitfadaptationmmf.c
+SOURCE          xanokiavolumeextitfadaptationmmf.c
+SOURCE 	        xammfcapabilitiesmgr.c
+//SOURCE          xangavideosink.cpp
+SOURCE          markerpositiontimer.cpp
+SOURCE          positionupdatetimer.cpp 
+SOURCE          xaseekitfadaptationmmf.c
+SOURCE          xadynamicsourceitfadaptationmmf.c
+SOURCE 	        xastreaminformationitfadaptationmmf.c
+SOURCE  	cmetadatautilityitf.cpp
+SOURCE		xametadataadaptctxmmf.c
 
 USERINCLUDE     ../inc
 USERINCLUDE     ../src
 USERINCLUDE     ../src/khronos
 USERINCLUDE     ../src/mmf_adaptation
-#ifdef _GSTREAMER_BACKEND_
-USERINCLUDE     ../Src/adaptation
-#endif
+USERINCLUDE     ../src/gst_adaptation
 USERINCLUDE     ../src/camera
 USERINCLUDE     ../src/common
 USERINCLUDE     ../src/engine
@@ -170,19 +192,18 @@
 USERINCLUDE     ../src/outputmix
 USERINCLUDE     ../src/radio
 USERINCLUDE     ../src/vibra
+USERINCLUDE	../src/adptcommon
 
 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
@@ -191,23 +212,21 @@
 
 LIBRARY         mediaclientvideodisplay.lib
 LIBRARY         ws32.lib
-LIBRARY			inetprotutil.lib
+LIBRARY		inetprotutil.lib
 LIBRARY         mediaclientaudio.lib
 LIBRARY         MMFControllerFramework.lib
 LIBRARY         mediaclientvideo.lib
-
-#ifdef _GSTREAMER_BACKEND_
+LIBRARY         AudioInputRouting.lib
 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 
+LIBRARY		libgstphotography.lib
+LIBRARY 	libgstinterfaces.lib 
+LIBRARY		libgstvideo.lib
+LIBRARY 	libgstbase.lib
+LIBRARY 	libgstcoreelements.lib
+LIBRARY		libgstcoreindexers.lib
+LIBRARY 	MetaDataUtility.lib
+STATICLIBRARY   hxmetadatautil.lib
 
-
-
--- a/khronosfws/openmax_al/inc/openmaxalwrapper.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/inc/openmaxalwrapper.h	Fri May 14 16:22:35 2010 +0300
@@ -23,5 +23,7 @@
 #define XA_API __declspec(dllexport)
  
 #include <OpenMAXAL.h>
+#include <xanokiavolumeextitf.h>
+#include <xanokialinearvolumeitf.h>
 
 #endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/inc/profileutilmacro.h	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,132 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 PROFILEUTILMACRO_H
+#define PROFILEUTILMACRO_H
+/*
+// MACROS to be defined to use profiling
+PROFILE_TIME
+PROFILE_RAM_USAGE
+PROFILE_HEAP_USAGE
+PRINT_TO_CONSOLE_TIME_DIFF
+PRINT_TO_CONSOLE_RAM_DIFF
+PRINT_TO_CONSOLE_HEAP_DIFF
+*/
+
+#if defined(PROFILE_TIME) || defined(PROFILE_RAM_USAGE) || defined(PROFILE_HEAP_USAGE)
+#include <e32debug.h>
+#include <hal.h>
+#endif
+
+#ifdef PROFILE_TIME
+#define TAG_TIME_PROFILING_BEGIN \
+    TTime beginProfilingTime; \
+    beginProfilingTime.HomeTime()
+
+#define TAG_TIME_PROFILING_BEGIN_NO_VAR_DEF \
+    beginProfilingTime.HomeTime()
+
+#define TAG_TIME_PROFILING_END \
+    TTime endProfilingTime; \
+    endProfilingTime.HomeTime(); \
+    TTimeIntervalMicroSeconds diffInMicroSecs = endProfilingTime.MicroSecondsFrom(beginProfilingTime)
+
+#define TAG_TIME_PROFILING_END_NO_VAR_DEF \
+    endProfilingTime.HomeTime(); \
+    diffInMicroSecs = endProfilingTime.MicroSecondsFrom(beginProfilingTime)
+
+#define PRINT_TO_CONSOLE_TIME_DIFF \
+    RDebug::Printf("VPROFILEDAT: %s : Time taken[%u]microseconds ", __PRETTY_FUNCTION__, diffInMicroSecs.Int64())
+
+#define PRINT_TO_CONSOLE_HOME_TIME \
+    TTime homeTime; \
+    homeTime.HomeTime(); \
+    RDebug::Printf("VPROFILEDAT: %s : Home Time [%u]microseconds ", __PRETTY_FUNCTION__, homeTime.Int64())
+
+#define PRINT_TO_CONSOLE_HOME_TIME_NO_VAR_DEF \
+    homeTime.HomeTime(); \
+    RDebug::Printf("VPROFILEDAT: %s : Home Time [%u]microseconds ", __PRETTY_FUNCTION__, homeTime.Int64())
+
+#else /* Empty macros */
+#define TAG_TIME_PROFILING_BEGIN
+#define TAG_TIME_PROFILING_BEGIN_NO_VAR_DEF
+#define TAG_TIME_PROFILING_END
+#define TAG_TIME_PROFILING_END_NO_VAR_DEF
+#define PRINT_TO_CONSOLE_TIME_DIFF
+#define PRINT_TO_CONSOLE_HOME_TIME
+#define PRINT_TO_CONSOLE_HOME_TIME_NO_VAR_DEF
+#endif /*PROFILE_TIME*/
+
+#ifdef PROFILE_RAM_USAGE
+#define TAG_RAM_PROFILING_BEGIN \
+    TInt beginProfilingRAM; \
+    TInt err1 = HAL::Get(HALData::EMemoryRAMFree, beginProfilingRAM)
+
+#define TAG_RAM_PROFILING_END \
+    TInt endProfilingRAM; \
+    TInt err2 = HAL::Get(HALData::EMemoryRAMFree, endProfilingRAM)
+
+#define PRINT_TO_CONSOLE_RAM_DIFF \
+    if ((err1 == KErrNone) && (err2 == KErrNone)) \
+        { \
+        TInt diffRAM = (beginProfilingRAM - endProfilingRAM); \
+        if ( diffRAM > 0 ) \
+            { \
+            RDebug::Printf("VPROFILEDAT: %s : RAM used[%u]bytes ", __PRETTY_FUNCTION__, diffRAM); \
+            } \
+        else \
+            { \
+            RDebug::Printf("VPROFILEDAT: %s : RAM freed[%u]bytes ", __PRETTY_FUNCTION__, (-diffRAM)); \
+            } \
+        } \
+    else \
+        { \
+        RDebug::Printf("VPROFILEDAT: %s : Error1[%d] Error2[%d] ", __PRETTY_FUNCTION__, err1, err2); \
+        }
+
+#else /* Empty macros */
+#define TAG_RAM_PROFILING_BEGIN
+#define TAG_RAM_PROFILING_END
+#define PRINT_TO_CONSOLE_RAM_DIFF
+#endif /*PROFILE_RAM_USAGE*/
+
+#ifdef PROFILE_HEAP_USAGE
+#define TAG_DEFAULT_HEAP_PROFILING_BEGIN \
+    TInt beginProfilingHEAPBiggestBlock; \
+    TInt beginProfilingHEAP = User::Available(beginProfilingHEAPBiggestBlock) \
+
+#define TAG_DEFAULT_HEAP_PROFILING_END \
+    TInt endProfilingHEAPBiggestBlock; \
+    TInt endProfilingHEAP = User::Available(endProfilingHEAPBiggestBlock) \
+
+#define PRINT_TO_CONSOLE_HEAP_DIFF \
+    TInt diffHEAP = beginProfilingHEAP - endProfilingHEAP; \
+    if ( diffHEAP > 0 ) \
+        { \
+        RDebug::Printf("VPROFILEDAT: %s : HEAP used[%u]bytes ", __PRETTY_FUNCTION__, diffHEAP); \
+        } \
+    else \
+        { \
+        RDebug::Printf("VPROFILEDAT: %s : HEAP freed[%u]bytes ", __PRETTY_FUNCTION__, (-diffHEAP)); \
+        }
+#else /* Empty macros */
+#define TAG_DEFAULT_HEAP_PROFILING_BEGIN
+#define TAG_DEFAULT_HEAP_PROFILING_END
+#define PRINT_TO_CONSOLE_HEAP_DIFF
+#endif /*PROFILE_HEAP_USAGE*/
+
+#endif /* PROFILEUTILMACRO_H */
--- a/khronosfws/openmax_al/rom/openmax_al.iby	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/rom/openmax_al.iby	Fri May 14 16:22:35 2010 +0300
@@ -29,6 +29,7 @@
 
 //OpenMAX_AL_Stub
 data=ZSYSTEM/install/openmax_al_stub.sis         System/Install/openmax_al_stub.sis
+data=/epoc32/winscw/c/openmaxal/openmaxal.cfg           openmaxal/openmaxal.cfg
 
 #endif //FF_OPENMAX_AL
 
--- a/khronosfws/openmax_al/sis/openmax_al.pkg	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/sis/openmax_al.pkg	Fri May 14 16:22:35 2010 +0300
@@ -11,7 +11,7 @@
 ;
 ; Contributors:
 ;
-; Description: OpenMAX AL - UDEB build
+; Description: OpenMAX AL - UREL build
 ;
 ;File: openmax_al.pkg
 
@@ -31,5 +31,6 @@
 :"Nokia"
 
 ;Files To Copy...<src> <destination>
-"/epoc32/release/armv5/udeb/openmaxal.dll"         -"!:/sys/bin/openmaxal.dll"
+"/epoc32/release/armv5/urel/openmaxal.dll"         -"!:/sys/bin/openmaxal.dll"
+"../data/openmaxal.cfg"                             -   "c:/openmaxal/openmaxal.cfg"
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/sis/openmax_al_udeb.pkg	Fri May 14 16:22:35 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: 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"
+"../data/openmaxal.cfg"                             -   "c:/openmaxal/openmaxal.cfg"
+
--- a/khronosfws/openmax_al/sis/openmax_al_urel.pkg	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-;
-; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-; All rights reserved.
-; This component and the accompanying materials are made available
-; under the terms of "Eclipse Public License v1.0"
-; which accompanies this distribution, and is available
-; at the URL "http://www.eclipse.org/legal/epl-v10.html".
-;
-; Initial Contributors:
-; Nokia Corporation - initial contribution.
-;
-; Contributors:
-;
-; Description: 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"
-
--- a/khronosfws/openmax_al/src/adaptation/xaadaptation.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,490 +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: 
-*
-*/
-
-#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_ */
--- a/khronosfws/openmax_al/src/adaptation/xaadaptationcontextbase.c	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1924 +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: 
-*
-*/
-
-#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;
-
-}
--- a/khronosfws/openmax_al/src/adaptation/xaadaptationcontextbase.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,105 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-
-#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*/
-
--- a/khronosfws/openmax_al/src/adaptation/xaaudioencoderitfadaptation.c	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +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: 
-*
-*/
-
-#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;
-}
--- a/khronosfws/openmax_al/src/adaptation/xaaudioencoderitfadaptation.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +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: 
-*
-*/
-
-#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 */
--- a/khronosfws/openmax_al/src/adaptation/xacameraadaptctx.c	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,283 +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: 
-*
-*/
-
-#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");
-}
-
--- a/khronosfws/openmax_al/src/adaptation/xacameraadaptctx.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +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: 
-*
-*/
-
-#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 */
--- a/khronosfws/openmax_al/src/adaptation/xacameraitfadaptation.c	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,429 +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: 
-*
-*/
-
-#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;
-}
--- a/khronosfws/openmax_al/src/adaptation/xacameraitfadaptation.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +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: 
-*
-*/
-
-#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_ */
--- a/khronosfws/openmax_al/src/adaptation/xadevicevolumeitfadaptation.c	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,144 +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: 
-*
-*/
-
-#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;
-}
--- a/khronosfws/openmax_al/src/adaptation/xadevicevolumeitfadaptation.h	Mon May 03 12:59:52 2010 +0300
+++ /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: 
-*
-*/
-
-#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_ */
--- a/khronosfws/openmax_al/src/adaptation/xadynamicsourceitfadaptation.c	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +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: 
-*
-*/
-
-#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;
-}
--- a/khronosfws/openmax_al/src/adaptation/xadynamicsourceitfadaptation.h	Mon May 03 12:59:52 2010 +0300
+++ /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: 
-*
-*/
-
-#ifndef XADYNAMICSOURCEITFADAPTATION_H
-#define XADYNAMICSOURCEITFADAPTATION_H
-
-#include "XAAdaptationContextBase.h"
-#include "XADebug.h"
-
-/* FUNCTIONS */
-
-XAresult XADynamicSourceItfAdapt_SetSource(XAAdaptationBaseCtx *bCtx, XADataSource *pDataSource);
-
-#endif /* XADYNAMICSOURCEITFADAPTATION_H */
--- a/khronosfws/openmax_al/src/adaptation/xaengineadaptctx.c	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,178 +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: 
-*
-*/
-
-#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");
-}
--- a/khronosfws/openmax_al/src/adaptation/xaengineadaptctx.h	Mon May 03 12:59:52 2010 +0300
+++ /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: 
-*
-*/
-
-#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_ */
--- a/khronosfws/openmax_al/src/adaptation/xaequalizeritfadaptation.c	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,336 +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: 
-*
-*/
-
-#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;
-}
--- a/khronosfws/openmax_al/src/adaptation/xaequalizeritfadaptation.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +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: 
-*
-*/
-
-#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 */
--- a/khronosfws/openmax_al/src/adaptation/xaimagecontrolsitfadaptation.c	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,393 +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: 
-*
-*/
-
-#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;
-}
--- a/khronosfws/openmax_al/src/adaptation/xaimagecontrolsitfadaptation.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +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: 
-*
-*/
-
-#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 */
--- a/khronosfws/openmax_al/src/adaptation/xaimageeffectsitfadaptation.c	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,729 +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: 
-*
-*/
-
-
-#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;
-}
--- a/khronosfws/openmax_al/src/adaptation/xaimageeffectsitfadaptation.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +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: 
-*
-*/
-
-#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 */
--- a/khronosfws/openmax_al/src/adaptation/xaimageencoderitfadaptation.c	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +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: 
-*
-*/
-
-#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;
-}
--- a/khronosfws/openmax_al/src/adaptation/xaimageencoderitfadaptation.h	Mon May 03 12:59:52 2010 +0300
+++ /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: 
-*
-*/
-
-#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 */
--- a/khronosfws/openmax_al/src/adaptation/xaledarrayadaptctx.c	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,104 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-
-#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");
-}
--- a/khronosfws/openmax_al/src/adaptation/xaledarrayadaptctx.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +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: 
-*
-*/
-
-#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 */
--- a/khronosfws/openmax_al/src/adaptation/xaledarrayitfadaptation.c	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-
-#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;
-}
--- a/khronosfws/openmax_al/src/adaptation/xaledarrayitfadaptation.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +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: 
-*
-*/
-
-#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_ */
--- a/khronosfws/openmax_al/src/adaptation/xamediaplayeradaptctx.c	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1253 +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: 
-*
-*/
-
-#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;
-}
--- a/khronosfws/openmax_al/src/adaptation/xamediaplayeradaptctx.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +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: 
-*
-*/
-
-#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*/
-
--- a/khronosfws/openmax_al/src/adaptation/xamediarecorderadaptctx.c	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1766 +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: 
-*
-*/
-
-#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;
-        }
--- a/khronosfws/openmax_al/src/adaptation/xamediarecorderadaptctx.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +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: 
-*
-*/
-
-#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_ */
--- a/khronosfws/openmax_al/src/adaptation/xametadataadaptation.c	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1202 +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: 
-*
-*/
-
-#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;
-}
--- a/khronosfws/openmax_al/src/adaptation/xametadataadaptation.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +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: 
-*
-*/
-
-#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 */
--- a/khronosfws/openmax_al/src/adaptation/xametadataadaptctx.c	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +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: 
-*
-*/
-
-#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);
-}
--- a/khronosfws/openmax_al/src/adaptation/xametadataadaptctx.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-
-#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 */
--- a/khronosfws/openmax_al/src/adaptation/xangavideosink.cpp	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,160 +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: 
-*
-*/
-/*
-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);
-    }
-
-}
--- a/khronosfws/openmax_al/src/adaptation/xangavideosink.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,100 +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: 
-*
-*/
-/*
-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
--- a/khronosfws/openmax_al/src/adaptation/xaoutputmixadaptctx.c	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,229 +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: 
-*
-*/
-
-#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;
-}
-
--- a/khronosfws/openmax_al/src/adaptation/xaoutputmixadaptctx.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +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: 
-*
-*/
-
-#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 */
--- a/khronosfws/openmax_al/src/adaptation/xaoutputmixitfadaptation.c	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,203 +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: 
-*
-*/
-
-#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;
-}
-
-
--- a/khronosfws/openmax_al/src/adaptation/xaoutputmixitfadaptation.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +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: 
-*
-*/
-
-#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_ */
--- a/khronosfws/openmax_al/src/adaptation/xaplaybackrateitfadaptation.c	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,209 +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: 
-*
-*/
-
-#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;
-}
-
--- a/khronosfws/openmax_al/src/adaptation/xaplaybackrateitfadaptation.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +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: 
-*
-*/
-
-#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 */
--- a/khronosfws/openmax_al/src/adaptation/xaplayitfadaptation.c	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,495 +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: 
-*
-*/
-
-#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;
-}
-
--- a/khronosfws/openmax_al/src/adaptation/xaplayitfadaptation.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +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: 
-*
-*/
-
-#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 */
--- a/khronosfws/openmax_al/src/adaptation/xaradioadaptctx.c	Mon May 03 12:59:52 2010 +0300
+++ /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: 
-*
-*/
-
-#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");
-}
--- a/khronosfws/openmax_al/src/adaptation/xaradioadaptctx.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +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: 
-*
-*/
-
-#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 */
--- a/khronosfws/openmax_al/src/adaptation/xaradioitfadaptation.c	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,796 +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: 
-*
-*/
-
-#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");
-}
--- a/khronosfws/openmax_al/src/adaptation/xaradioitfadaptation.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +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: 
-*
-*/
-
-#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 */
--- a/khronosfws/openmax_al/src/adaptation/xardsitfadaptation.c	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,875 +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: 
-*
-*/
-
-#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");
-}
--- a/khronosfws/openmax_al/src/adaptation/xardsitfadaptation.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +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: 
-*
-*/
-
-#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 */
--- a/khronosfws/openmax_al/src/adaptation/xarecorditfadaptation.c	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,418 +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: 
-*
-*/
-
-#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;
-}
-
--- a/khronosfws/openmax_al/src/adaptation/xarecorditfadaptation.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +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: 
-*
-*/
-
-#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 */
--- a/khronosfws/openmax_al/src/adaptation/xaseekitfadaptation.c	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,153 +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: 
-*
-*/
-
-#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;
-}
--- a/khronosfws/openmax_al/src/adaptation/xaseekitfadaptation.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +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: 
-*
-*/
-
-#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 */
--- a/khronosfws/openmax_al/src/adaptation/xasnapshotitfadaptation.c	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,890 +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: 
-*
-*/
-
-#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);
-    }
-}
--- a/khronosfws/openmax_al/src/adaptation/xasnapshotitfadaptation.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +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: 
-*
-*/
-
-#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 */
--- a/khronosfws/openmax_al/src/adaptation/xastaticcameracapsadaptation.c	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,562 +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: 
-*
-*/
-
-#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;
-}
--- a/khronosfws/openmax_al/src/adaptation/xastaticcameracapsadaptation.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +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: 
-*
-*/
-
-#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 */
--- a/khronosfws/openmax_al/src/adaptation/xastaticcapsadaptation.c	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,769 +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: 
-*
-*/
-
-#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;
-}
-
--- a/khronosfws/openmax_al/src/adaptation/xastaticcapsadaptation.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,111 +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: 
-*
-*/
-
-#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 */
--- a/khronosfws/openmax_al/src/adaptation/xavibraadaptctx.c	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +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: 
-*
-*/
-
-#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");
-}
--- a/khronosfws/openmax_al/src/adaptation/xavibraadaptctx.h	Mon May 03 12:59:52 2010 +0300
+++ /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: 
-*
-*/
-
-#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 */
--- a/khronosfws/openmax_al/src/adaptation/xavibraitfadaptation.c	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +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: 
-*
-*/
-
-#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;
-}
--- a/khronosfws/openmax_al/src/adaptation/xavibraitfadaptation.h	Mon May 03 12:59:52 2010 +0300
+++ /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: 
-*
-*/
-
-#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_ */
--- a/khronosfws/openmax_al/src/adaptation/xavideoencoderitfadaptation.c	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-
-#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;
-}
--- a/khronosfws/openmax_al/src/adaptation/xavideoencoderitfadaptation.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +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: 
-*
-*/
-
-#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 */
--- a/khronosfws/openmax_al/src/adaptation/xavideopostprosessingitfadaptation.c	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,916 +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: 
-*
-*/
-
-#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;
-}
--- a/khronosfws/openmax_al/src/adaptation/xavideopostprosessingitfadaptation.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +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: 
-*
-*/
-
-#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 */
--- a/khronosfws/openmax_al/src/adaptation/xavolumeitfadaptation.c	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,566 +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: 
-*
-*/
-
-#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;
-}
--- a/khronosfws/openmax_al/src/adaptation/xavolumeitfadaptation.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +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: 
-*
-*/
-
-#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/adptcommon/xaadptbasectx.c	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,260 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "xaadptbasectx.h"
+#include "xathreadsafety.h"
+
+/*
+ * 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 )
+    {
+    if(!pSelf->evtHdlrs)
+        {
+        pSelf->evtHdlrs = g_array_new (FALSE, FALSE, sizeof (XAAdaptEvtHdlr));
+        if(!pSelf->evtHdlrs)
+            {
+            DEBUG_ERR("Memory allocation failure in Base Ctx.")
+            return XA_RESULT_MEMORY_FAILURE;
+            }
+        }
+    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 XAAdaptationBase_PostInit( XAAdaptationBaseCtx* 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 XAAdaptationBase_Free( XAAdaptationBaseCtx* ctx )
+{
+    g_array_free(ctx->evtHdlrs, TRUE);
+    ctx->evtHdlrs = NULL;
+    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;
+}
+
+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);
+        }
+    }
+}
+
+/*
+ * XAresult XAEqualizerItfAdapt_ThreadEntry(XAAdaptationGstCtx *adapCtx)
+ * Description: Safety thread entry
+ */
+XAresult XAAdaptationBase_ThreadEntry(XAAdaptationBaseCtx *adaptCtx)
+{
+    XAresult res = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAAdaptationBase_ThreadEntry");
+    if(!adaptCtx )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAAdaptationBase_ThreadEntry");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+
+    }
+    
+    switch(adaptCtx->ctxId)
+        {
+        case XAMediaPlayerAdaptation:
+            XA_IMPL_THREAD_SAFETY_ENTRY(XATSMediaPlayer);
+            break;
+        case XAMediaRecorderAdaptation:
+            XA_IMPL_THREAD_SAFETY_ENTRY(XATSMediaRecorder);
+            break;
+        case XARadioAdaptation:
+            XA_IMPL_THREAD_SAFETY_ENTRY(XATSRadio);
+            break;
+        case XACameraAdaptation:
+            XA_IMPL_THREAD_SAFETY_ENTRY(XATSCamera);
+            break;
+        case XAOutputMixAdaptation:
+            XA_IMPL_THREAD_SAFETY_ENTRY(XATSOutputMix);
+            break;
+        case XAVibraAdaptation:
+            XA_IMPL_THREAD_SAFETY_ENTRY(XATSVibra);
+            break;
+        case XALedArrayAdaptation:
+            XA_IMPL_THREAD_SAFETY_ENTRY(XATSLEDArray);
+            break;
+        case XAMDAdaptation:
+            XA_IMPL_THREAD_SAFETY_ENTRY(XATSMetaDataExtractor);
+            break;
+        case XAEngineAdaptation:
+            XA_IMPL_THREAD_SAFETY_ENTRY(XATSEngine);
+            break;
+        default:
+            DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+            /* invalid parameter */
+            res = XA_RESULT_PARAMETER_INVALID;
+            break;
+        }
+
+    DEBUG_API("<-XAAdaptationBase_ThreadEntry");
+    return res;
+}
+/*
+ * XAresult XAEqualizerItfAdapt_ThreadExit(XAAdaptationGstCtx *adaptCtx)
+ * Description: Safety thread exit
+ */
+XAresult XAAdaptationBase_ThreadExit(XAAdaptationBaseCtx *adaptCtx)
+{
+    XAresult res = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAAdaptationBase_ThreadExit");
+    if(!adaptCtx )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAAdaptationBase_ThreadExit");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+
+    }
+
+    switch(adaptCtx->ctxId)
+        {
+        case XAMediaPlayerAdaptation:
+            XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaPlayer);
+            break;
+        case XAMediaRecorderAdaptation:
+            XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaRecorder);
+            break;
+        case XARadioAdaptation:
+            XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
+            break;
+        case XACameraAdaptation:
+            XA_IMPL_THREAD_SAFETY_EXIT(XATSCamera);
+            break;
+        case XAOutputMixAdaptation:
+            XA_IMPL_THREAD_SAFETY_EXIT(XATSOutputMix);
+            break;
+        case XAVibraAdaptation:
+            XA_IMPL_THREAD_SAFETY_EXIT(XATSVibra);
+            break;
+        case XALedArrayAdaptation:
+            XA_IMPL_THREAD_SAFETY_EXIT(XATSLEDArray);
+            break;
+        case XAMDAdaptation:
+            XA_IMPL_THREAD_SAFETY_EXIT(XATSMetaDataExtractor);
+            break;
+        case XAEngineAdaptation:
+            XA_IMPL_THREAD_SAFETY_EXIT(XATSEngine);
+            break;
+        default:
+            DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+            /* invalid parameter */
+            res = XA_RESULT_PARAMETER_INVALID;
+            break;
+        }
+
+    DEBUG_API("<-XAAdaptationBase_ThreadExit");
+    return res;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adptcommon/xaadptbasectx.h	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,168 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef XAADPTBASECTX_H_
+#define XAADPTBASECTX_H_
+
+#include <glib.h>
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+#include "xaframeworkmgr.h"
+#include "xacapabilitiesmgr.h"
+#include "xaplatform.h"
+/* ENUMERATIONS */
+
+/**
+GLOBAL ENUMERATIONS
+ */
+
+typedef enum {
+    XAMediaPlayerAdaptation = 0,
+    XAMediaRecorderAdaptation,
+    XARadioAdaptation,
+    XACameraAdaptation,
+    XAOutputMixAdaptation,
+    XAVibraAdaptation,
+    XALedArrayAdaptation,
+    XAMDAdaptation,
+    XAEngineAdaptation
+}AdaptationContextIDS;
+
+#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
+
+
+/* TYPEDEFS */
+
+/* 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_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
+
+#define XA_ADAPTID_UNINITED 0
+
+#define XA_ADAPT_VOLUME_VOLUME_CHANGED          0xfb			 /* volume changed */
+#define XA_ADAPT_VOLUME_MUTE_CHANGED            0xfc         	/* mute changed */
+#define XA_ADAPT_VULOME_STEREOPOSITION_CHANGED  0xfd
+
+/* 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;
+
+/* Forward declaration of adaptation basecontext */
+typedef struct XAAdaptationBaseCtx_ XAAdaptationBaseCtx;
+
+/*
+ * Structure that holds all common variables for every
+ * Gst-Adaptation context structures.
+ */
+typedef struct XAAdaptationBaseCtx_
+{
+/*     Common Variables for all adaptation elements */
+    XAuint32        ctxId;
+    GArray*         evtHdlrs;     /*array of event handlers */
+    FrameworkMap*   fwkmapper;
+    FWMgrFwType     fwtype;
+    XACapabilities* capslist;
+    
+} XAAdaptationBaseCtx_;
+
+
+/* Adaptation event callback */
+typedef void (*xaAdaptEventHandler) ( void *pHandlerCtx, XAAdaptEvent* event );
+
+typedef struct XAAdaptEvtHdlr_
+{
+    xaAdaptEventHandler handlerfunc;    /* function handling the callback */
+    void               *handlercontext; /* context of handler */
+    XAuint32            eventtypes;     /* what kind of events this handles */
+} XAAdaptEvtHdlr;
+
+
+
+
+/* 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_SendAdaptEvents(XAAdaptationBaseCtx* ctx, XAAdaptEvent* event);
+XAresult XAAdaptationBase_ThreadEntry(XAAdaptationBaseCtx *adaptCtx);
+XAresult XAAdaptationBase_ThreadExit(XAAdaptationBaseCtx *adaptCtx);
+void XAAdaptationBase_Free( XAAdaptationBaseCtx* ctx );
+
+#endif /* XAADPTBASE_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adptcommon/xacapabilitiesmgr.c	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,525 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "xacapabilitiesmgr.h"
+#include "xammfcapabilitiesmgr.h"
+#include "xagstcapabilitiesmgr.h"
+#include <stdio.h>
+#include <string.h>
+
+static XAresult XACapabilitiesMgr_GetAudioInputDeviceCapabilities(XACapabilities **ppNode);
+static XAresult XACapabilitiesMgr_GetAudioOutputDeviceCapabilities(XACapabilities **ppNode);
+
+/* XAresult XAGSTCapabilitiesMgr_UpdateAudioIOCapabilitieList
+ * Description: Update the capabilities list supported by GStreamer framework.
+ */
+XAresult XACapabilitiesMgr_UpdateAudioIOCapabilitieList(
+                FrameworkMap *frameworkMap,
+                XACapabilities **ppListHead)
+
+{
+    XAresult res = XA_RESULT_SUCCESS;
+    XACapabilities *lastNode;
+    XACapabilities *firstNode ;
+    XACapabilities *newNode = NULL;
+    
+    if(!frameworkMap || !ppListHead)
+    {
+        res = XA_RESULT_PARAMETER_INVALID;
+        return res;
+    }
+    
+     lastNode = *ppListHead;
+     firstNode = *ppListHead;
+     
+
+    DEBUG_API("->XACapabilitiesMgr_UpdateAudioIOCapabilitieList");
+
+
+
+    /* traverse and point to the last node in the list */
+    while(lastNode && lastNode->next)
+    {
+        lastNode = lastNode->next;
+    }
+
+    /* If no input devices are supported, the function returns
+     * XA_RESULT_SUCCESS and newNode will be NULL*/
+    newNode = NULL;
+    res = XACapabilitiesMgr_GetAudioInputDeviceCapabilities(&newNode);
+    if (res != XA_RESULT_SUCCESS)
+        {
+        return res;
+        }
+    
+    if (lastNode)
+    {
+        lastNode->next = newNode;
+    }
+    if (newNode)
+    { /* if a new node is created move lastNode to the new item */
+        if (!firstNode)
+            firstNode = newNode;
+        lastNode = newNode;
+    }
+    
+    /* If no input devices are supported, the function returns
+     * XA_RESULT_SUCCESS and newNode will be NULL*/
+    newNode = NULL;
+    res = XACapabilitiesMgr_GetAudioOutputDeviceCapabilities(&newNode);
+    if (res != XA_RESULT_SUCCESS)
+        {
+        return res;
+        }
+    
+    if (lastNode)
+    {
+        lastNode->next = newNode;
+    }
+    if (newNode)
+    { /* if a new node is created move lastNode to the new item */
+        if (!firstNode)
+            firstNode = newNode;
+        lastNode = newNode;
+    }
+    /* if empty list, then append first node as the head */
+    if (!(*ppListHead))
+        {
+        *ppListHead = firstNode;
+        }
+    DEBUG_API("<-XACapabilitiesMgr_UpdateAudioIOCapabilitieList");
+    return res;
+}
+
+XAresult XACapabilitiesMgr_CreateCapabilitieList(
+            FrameworkMap* frameworkMap,
+            XACapabilities** ppListHead)
+{
+    XACapabilities* list = NULL;
+    XAresult res = XA_RESULT_SUCCESS;
+    if(!ppListHead)
+    {
+        res = XA_RESULT_PARAMETER_INVALID;
+        return res;
+    }
+
+    *ppListHead = NULL;
+
+    res = XACapabilitiesMgr_UpdateAudioIOCapabilitieList(frameworkMap, &list);
+    if (res != XA_RESULT_SUCCESS)
+    {
+        XACapabilitiesMgr_DeleteCapabilitieList(&list);
+        return res;
+    }
+    
+    res = XAGSTCapabilitiesMgr_UpdateCapabilitieList(frameworkMap, &list);
+    if (res != XA_RESULT_SUCCESS)
+    {
+        XACapabilitiesMgr_DeleteCapabilitieList(&list);
+        return res;
+    }
+
+    res = XAMMFCapabilitiesMgr_UpdateCapabilitieList(frameworkMap, &list);
+    if (res != XA_RESULT_SUCCESS)
+    {
+        XACapabilitiesMgr_DeleteCapabilitieList(&list);
+        return res;
+    }
+
+    *ppListHead = list;
+    return res;
+}
+
+XAresult XACapabilitiesMgr_DeleteCapabilitieList(XACapabilities** ppListHead)
+{
+    XACapabilities* currNode = NULL;
+    XACapabilities* nextNode = NULL;
+    XAresult res = XA_RESULT_SUCCESS;
+    
+    if(!ppListHead)
+    {
+        res = XA_RESULT_PARAMETER_INVALID;
+        return res;
+    }
+
+    currNode = *ppListHead;
+    while (currNode)
+    {
+        if (currNode->capsType == AUD_I)
+        {
+            XAAudioInputDescriptor* entries = (XAAudioInputDescriptor*)currNode->pEntry;
+            XAint32 i;
+            for(i=0;i< currNode->noOfEntries;i++)
+            {
+                free(entries[i].samplingRatesSupported);
+                free(entries[i].deviceName);
+            }
+            free(entries);
+        }
+        else if (currNode->capsType == AUD_O)
+        {
+            XAAudioOutputDescriptor* entries = (XAAudioOutputDescriptor*)currNode->pEntry;
+            XAint32 i;
+            for(i=0;i< currNode->noOfEntries;i++)
+            {
+                free(entries[i].samplingRatesSupported);
+                free(entries[i].pDeviceName);
+            }
+            free(entries);
+        }
+        else if (currNode->capsType == AUD_E)
+        {
+            XAAudioCodecDescriptor* entries = (XAAudioCodecDescriptor*)currNode->pEntry;
+            XAint32 i;
+            for(i=0;i< currNode->noOfEntries;i++)
+            {
+                free(entries[i].pSampleRatesSupported);
+                free(entries[i].pBitratesSupported);
+            }
+            free(entries);
+
+        }
+
+        if(currNode->adaptId)
+            {
+            free(currNode->adaptId);
+            }
+        
+        nextNode = currNode->next;
+        free(currNode);
+        currNode = nextNode;
+    }
+
+    *ppListHead = NULL;
+    return res;
+}
+
+
+/* XAresult XACapabilitiesMgr_GetCapsCount
+ * Description: Count capabilities of certain type. Filter is specified by
+ *              bitmasking XACapsType values.
+ */
+XAresult XACapabilitiesMgr_GetCapsCount(XACapabilities* pListHead, XACapsType filter, XAuint32* count)
+{
+    XAresult res = XA_RESULT_SUCCESS;
+    XACapabilities* currNode = pListHead;
+
+    DEBUG_API("->XACapabilitiesMgr_GetCapsCount");
+    if(!currNode || !count)
+    {
+        res = XA_RESULT_PARAMETER_INVALID;
+        return res;
+    }
+
+    (*count)=0;
+    while (currNode)
+    {
+        if ( (currNode->capsType & filter) == filter )
+        {
+            (*count)++;
+        }
+        currNode = currNode->next;
+    }
+
+    DEBUG_API("<-XACapabilitiesMgr_GetCapsCount");
+    return res;
+}
+
+/* XAresult XACapabilitiesMgr_GetCapsById
+ * Description: Get capabilities of type XACapsType and matching id
+ */
+XAresult XACapabilitiesMgr_GetCapsById(XACapabilities* pListHead, XACapsType filter, XAuint32 maxId, XACapabilities* data)
+{
+    XAresult res = XA_RESULT_SUCCESS;
+    XACapabilities* currNode = pListHead;
+    XAboolean found = XA_BOOLEAN_FALSE;
+
+    DEBUG_API("->XACapabilitiesMgr_GetCapsById");
+
+    if(!currNode)
+    {
+        res = XA_RESULT_PARAMETER_INVALID;
+        return res;
+    }
+
+    while (currNode)
+    {
+        if (((currNode->capsType & filter) == filter ) && (maxId==currNode->xaid))
+        {
+            memcpy(data, currNode, sizeof(XACapabilities));
+            found = XA_BOOLEAN_TRUE;
+            break;
+        }
+        currNode = currNode->next;
+    }
+
+    if(!found)
+    {
+       res = XA_RESULT_FEATURE_UNSUPPORTED;
+       return res;
+    }
+
+    DEBUG_API("<-XACapabilitiesMgr_GetCapsById");
+    return res;
+}
+
+/* XAresult XACapabilitiesMgr_GetCapsByIdx
+ * Description: Get n'th capabilities of type XACapsType
+ */
+XAresult XACapabilitiesMgr_GetCapsByIdx(XACapabilities* pListHead, XACapsType filter, XAuint32 idx, XACapabilities* data)
+{
+    XAresult res = XA_RESULT_SUCCESS;
+    XACapabilities* currNode = pListHead;
+    XAboolean found = XA_BOOLEAN_FALSE;
+    XAuint32 j = 0;
+
+
+    DEBUG_API("->XACapabilitiesMgr_GetCapsByIdx");
+
+    if(!currNode)
+    {
+        res = XA_RESULT_PARAMETER_INVALID;
+        return res;
+    }
+
+
+    while (currNode)
+    {
+        if ((currNode->capsType & filter) == filter )
+        {
+            if( idx == j++ )
+            {
+                memcpy(data, currNode, sizeof(XACapabilities));
+                found = XA_BOOLEAN_TRUE;
+                break;
+            }
+        }
+        currNode = currNode->next;
+    }
+
+    if(!found)
+    {
+       res = XA_RESULT_PARAMETER_INVALID;
+       return res;
+    }
+
+    DEBUG_API("<-XACapabilitiesMgr_GetCapsByIdx");
+    return res;
+}
+
+/* XAresult XACapabilitiesMgr_QueryColorFormats
+ * Description: Get color formats associated with the XA_IMAGECODEC_RAW codec.
+ */
+XAresult XACapabilitiesMgr_QueryColorFormats(XACapabilities* pListHead, XAuint32* pIndex, XAuint32* pColorFormats)
+{
+    XAresult res = XA_RESULT_SUCCESS;
+    XACapabilities temp;
+
+    DEBUG_API("->XACapabilitiesMgr_QueryColorFormats");
+
+    if( !pIndex )
+    {
+        DEBUG_ERR("illegal NULL parameter");
+        res = XA_RESULT_PARAMETER_INVALID;
+        return res;
+    }
+
+    res = XACapabilitiesMgr_GetCapsById(pListHead, (XACapsType)((XACapsType)(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("<-XACapabilitiesMgr_QueryColorFormats");
+    return res;
+}
+
+/* Add AudioInputDeviceCaps */
+XAresult XACapabilitiesMgr_GetAudioInputDeviceCapabilities(XACapabilities** ppNode)
+{
+    XAresult res = XA_RESULT_SUCCESS;
+    XACapabilities *newNode = NULL;
+    XAAudioInputDescriptor *entries = NULL;
+/*    XAAudioInputDescriptor *entries = NULL;*/
+    XAchar micDeviceName[] = "Default Mic";
+    int strLen = 0;
+
+    newNode = (XACapabilities *)calloc(1, sizeof(XACapabilities));
+    if (!newNode)
+    {
+        res = XA_RESULT_MEMORY_FAILURE;
+        return res;
+    }
+
+    newNode->capsType = AUD_I;
+    newNode->xaid = 0xAD7E5001;
+    newNode->noOfEntries = 1;
+
+    /* Allocate array */
+    entries = (XAAudioInputDescriptor*) calloc(1 , sizeof(XAAudioInputDescriptor));
+    if (!entries)
+    {
+        res = XA_RESULT_MEMORY_FAILURE;
+        XACapabilitiesMgr_DeleteCapabilitieList(&newNode);
+        return res;
+    }
+
+    newNode->pEntry = (void*)entries;
+ 
+    strLen = strlen((char*)micDeviceName);
+    entries->deviceName = (XAchar *)calloc(strLen + 1, sizeof(XAchar));
+    if (!entries->deviceName)
+    {
+        res = XA_RESULT_MEMORY_FAILURE;
+        XACapabilitiesMgr_DeleteCapabilitieList(&newNode);
+        return res;
+    }
+
+    strncpy((char*)entries->deviceName, (char*)micDeviceName, strLen);
+    entries->deviceName[strLen] = '\0'; /*Null terminate it*/
+    entries->deviceConnection = XA_DEVCONNECTION_INTEGRATED;
+    entries->deviceScope = XA_DEVSCOPE_ENVIRONMENT;
+    entries->deviceLocation = XA_DEVLOCATION_HANDSET;
+    entries->isForTelephony = XA_BOOLEAN_FALSE;
+    entries->minSampleRate=8000000; /* milliHz */
+    entries->maxSampleRate = 96000000; /* milliHz */
+    entries->isFreqRangeContinuous=XA_BOOLEAN_FALSE;
+    entries->numOfSamplingRatesSupported = 12;
+    entries->samplingRatesSupported = (XAmilliHertz*)calloc(entries->numOfSamplingRatesSupported, sizeof(XAmilliHertz));
+    if (!entries->samplingRatesSupported)
+    {
+        res = XA_RESULT_MEMORY_FAILURE;
+        XACapabilitiesMgr_DeleteCapabilitieList(&newNode);
+        return res;
+    }
+    /* entries in milliHz */
+    entries->samplingRatesSupported[0] = 8000000;
+    entries->samplingRatesSupported[1] = 11025000;
+    entries->samplingRatesSupported[2] = 12000000;
+    entries->samplingRatesSupported[3] = 16000000;
+    entries->samplingRatesSupported[4] = 22050000;
+    entries->samplingRatesSupported[5] = 24000000;
+    entries->samplingRatesSupported[6] = 32000000;
+    entries->samplingRatesSupported[7] = 44100000;
+    entries->samplingRatesSupported[8] = 48000000;
+    entries->samplingRatesSupported[9] = 64000000;
+    entries->samplingRatesSupported[10] = 88200000;
+    entries->samplingRatesSupported[11] = 96000000;
+    entries->maxChannels = 2;
+
+    newNode->pEntry = (void*)entries;
+
+    *ppNode = newNode;
+    return res;
+}
+
+XAresult XACapabilitiesMgr_GetAudioOutputDeviceCapabilities(XACapabilities **ppNode)
+{
+    XAresult res = XA_RESULT_SUCCESS;
+    XACapabilities *newNode = NULL;
+    XAAudioOutputDescriptor *entries = NULL;
+/*    XAAudioOutputDescriptor *entries = NULL;*/
+    XAchar outputDeviceName[] = "Default Speaker";
+    int strLen = 0;
+
+    newNode = (XACapabilities *)calloc(1, sizeof(XACapabilities));
+    if (!newNode)
+    {
+        res = XA_RESULT_MEMORY_FAILURE;
+        return res;
+    }
+
+    newNode->capsType = AUD_O;
+    newNode->xaid = 0xAD7E5002;
+    newNode->noOfEntries = 1;
+
+    /* Allocate array */
+    entries = (XAAudioOutputDescriptor*)calloc(1, sizeof(XAAudioOutputDescriptor));
+    if (!entries)
+    {
+        res = XA_RESULT_MEMORY_FAILURE;
+        XACapabilitiesMgr_DeleteCapabilitieList(&newNode);
+        return res;
+    }
+
+    newNode->pEntry = (void*)entries;
+
+    strLen = strlen((char*)outputDeviceName);
+    entries->pDeviceName = (XAchar *)calloc(strLen + 1, sizeof(XAchar));
+    if (!entries->pDeviceName)
+    {
+        res = XA_RESULT_MEMORY_FAILURE;
+        XACapabilitiesMgr_DeleteCapabilitieList(&newNode);
+        return res;
+    }
+    strncpy((char*)entries->pDeviceName, (char*)outputDeviceName, strLen);
+    entries->pDeviceName[strLen] = '\0'; /*Null terminate it*/
+    entries->deviceConnection = XA_DEVCONNECTION_INTEGRATED;
+    entries->deviceScope = XA_DEVSCOPE_ENVIRONMENT;
+    entries->deviceLocation = XA_DEVLOCATION_HANDSET;
+    entries->isForTelephony = XA_BOOLEAN_FALSE;
+    entries->minSampleRate = 8000000; /* milliHz */
+    entries->maxSampleRate = 96000000; /* milliHz */
+    entries->isFreqRangeContinuous = XA_BOOLEAN_FALSE;
+    entries->numOfSamplingRatesSupported = 12;
+    entries->samplingRatesSupported = (XAmilliHertz*)calloc(entries->numOfSamplingRatesSupported, sizeof(XAmilliHertz));
+    if (!entries->samplingRatesSupported)
+    {
+        res = XA_RESULT_MEMORY_FAILURE;
+        XACapabilitiesMgr_DeleteCapabilitieList(&newNode);
+        return res;
+    }
+    /* entries in milliHz */
+    entries->samplingRatesSupported[0] = 8000000;
+    entries->samplingRatesSupported[1] = 11025000;
+    entries->samplingRatesSupported[2] = 12000000;
+    entries->samplingRatesSupported[3] = 16000000;
+    entries->samplingRatesSupported[4] = 22050000;
+    entries->samplingRatesSupported[5] = 24000000;
+    entries->samplingRatesSupported[6] = 32000000;
+    entries->samplingRatesSupported[7] = 44100000;
+    entries->samplingRatesSupported[8] = 48000000;
+    entries->samplingRatesSupported[9] = 64000000;
+    entries->samplingRatesSupported[10] = 88200000;
+    entries->samplingRatesSupported[11] = 96000000;
+    entries->maxChannels = 2;
+
+    newNode->pEntry = (void*)entries;
+
+    *ppNode = newNode;
+    return res;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adptcommon/xacapabilitiesmgr.h	Fri May 14 16:22:35 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 XACAPABILITIESMGR_H
+#define XACAPABILITIESMGR_H
+
+#include "xaframeworkmgr.h"
+#include "openmaxalwrapper.h"
+#include "xaglobals.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 ((XACapsType)(XACAP_ENCODER|XACAP_VIDEO))
+#define IMG_D (XACAP_DECODER|XACAP_IMAGE)
+#define IMG_E ((XACapsType)(XACAP_ENCODER|XACAP_IMAGE))
+#define AUD_O ((XACapsType)(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
+
+/* Structure to hold commonly used capabilities of codec/device.
+ */
+typedef struct XACapabilities_ XACapabilities;
+
+struct XACapabilities_
+{
+    XAuint32    capsType;
+    XAuint32    xaid;       /* OpenMAX id (e.g. XA_VIDEOCODEC macro) */
+    XAchar*    adaptId;    /* TODO fill this */
+    /* TODO Do we need a flag for default device id? */
+    XAuint32    noOfEntries;
+    void*       pEntry;
+
+    /*add if/when needed*/
+    XACapabilities* next;
+};
+
+
+XAresult XACapabilitiesMgr_CreateCapabilitieList(
+            FrameworkMap* frameworkMap,
+            XACapabilities** ppListHead);
+
+XAresult XACapabilitiesMgr_DeleteCapabilitieList(XACapabilities** ppListHead);
+
+XAresult XACapabilitiesMgr_GetCapsCount(
+                XACapabilities* pListHead,
+                XACapsType filter,
+                XAuint32* count);
+
+XAresult XACapabilitiesMgr_GetCapsById(
+                XACapabilities* pListHead,
+                XACapsType filter,
+                XAuint32 maxId,
+                XACapabilities* data);
+
+XAresult XACapabilitiesMgr_GetCapsByIdx(
+                XACapabilities* pListHead,
+                XACapsType filter,
+                XAuint32 idx,
+                XACapabilities* data);
+
+XAresult XACapabilitiesMgr_QueryColorFormats(
+                XACapabilities* pListHead,
+                XAuint32* pIndex,
+                XAuint32* pColorFormats);
+
+#endif /* XACAPABILITIESMGR_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adptcommon/xaframeworkmgr.c	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,579 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "xaframeworkmgr.h"
+#include <stdio.h>
+#include <string.h>
+
+/* Default line width permitted in the cfg file + 2 to hold "\r\n"*/
+#define LINEWIDTH 82
+
+typedef enum
+{
+    FWMgrTagNone,
+    FWMgrTagURIScheme,
+    FWMgrTagFileExt
+} FWMgrTagType;
+
+
+/* Config file location */
+const char configFileLocation[] = "c:/openmaxal/openmaxal.cfg";
+
+/* Tags used for parsing */
+const char mediaPlayerBeginTag[] = "<mediaplayer>";
+const char mediaPlayerEndTag[] = "</mediaplayer>";
+const char mediaRecorderBeginTag[] = "<mediarecorder>";
+const char mediaRecorderEndTag[] = "</mediarecorder>";
+const char mediaFrameworkMmfBeginTag[] = "<mmf>";
+const char mediaFrameworkMmfEndTag[] = "</mmf>";
+const char mediaFrameworkGstBeginTag[] = "<gst>";
+const char uriSchemeBeginTag[] = "<urischeme>";
+const char uriSchemeEndTag[] = "</urischeme>";
+const char mediaFrameworkGstEndTag[] = "</gst>";
+const char fileExtBeginTag[] = "<fileext>";
+const char fileExtEndTag[] = "</fileext>";
+
+/* Local function definitions */
+/* returns FWMgrTrue if processed successfully */
+static FWMgrBool processConfigEntry(
+        const char* buffer,
+        FWMgrMOType *mediaType,
+        FWMgrFwType *frameworkType,
+        FWMgrTagType *tagType,
+        FWMgrBool *newNode,
+        FrameworkMap **node);
+
+/* returns FWMgrTrue if processed successfully */
+static FWMgrBool processTagType(
+        const char* buffer,
+        FWMgrFwType *frameworkType,
+        FWMgrTagType *tagType,
+        FrameworkMap **node);
+
+/* returns FWMgrTrue if processed successfully */
+static FWMgrBool tokenizeTag(FWMgrTagType tagType, const char* buffer, FrameworkMap **node);
+
+/* Crates a default rules config file */
+static int createDefaultRules(const char * filename);
+
+/* Global functions from header file */
+
+/* FrameworkMap* XAFrameworkMgr_CreateFrameworkMap
+ * Description: Creates a list of framework and use-case map.
+ */
+FrameworkMap* XAFrameworkMgr_CreateFrameworkMap()
+{
+    char buffer[LINEWIDTH];
+    int readSize;
+    int lineNumber = 0;
+    FWMgrBool processedEntry = FWMgrTrue;
+    FWMgrMOType currentMediaType = FWMgrMOUnknown;
+    FWMgrFwType currentFrameworkType = FWMgrFWUknown;
+    FWMgrTagType currentTagType = FWMgrTagNone;
+    FrameworkMap *curNode = NULL;
+    FWMgrBool newNode;
+    FrameworkMap *frameworkMap = NULL;
+    FILE* fp = fopen(configFileLocation, "r");
+    
+    if (fp == NULL)
+        {
+        createDefaultRules(configFileLocation);
+        }
+
+    fp = fopen(configFileLocation, "r");
+    if (fp != NULL)
+    {
+        while((fgets(buffer, LINEWIDTH, fp) != NULL) && processedEntry)
+        {
+            /* keep looping until NULL pointer OR error... */
+            lineNumber++;
+            readSize = strlen(buffer);
+            /* Ignore comments line */
+            if (buffer[0] == '#')
+                continue;
+
+            /* Ignore replace "\r\n" with '\0' */
+            if ((readSize >= 2) && (buffer[readSize-2]=='\r') && (buffer[readSize-1]=='\n'))
+                buffer[readSize-2]='\0';
+
+            /* Ignore new line... */
+            if (readSize == 2)
+                continue;
+
+            processedEntry = processConfigEntry(
+                                buffer,
+                                &currentMediaType,
+                                &currentFrameworkType,
+                                &currentTagType,
+                                &newNode,
+                                &curNode);
+            if (newNode)
+            {
+                /*Just link to the last element in the chain*/
+                if (!frameworkMap)
+                {
+                    frameworkMap = curNode;
+                }
+                else
+                {
+                    FrameworkMap *lastNode = frameworkMap;
+                    while (lastNode->next)
+                    {
+                        lastNode = lastNode->next;
+                    }
+                    lastNode->next = curNode;
+                }
+            }
+        }
+        fclose(fp);
+    }
+    else
+    {
+        printf("unable to open config file!\n");
+    }
+    return frameworkMap;
+}
+
+#ifdef _DEBUG
+/* void XAFrameworkMgr_DumpFrameworkMap
+ * Description: Prints map to std console.
+ */
+void XAFrameworkMgr_DumpFrameworkMap(FrameworkMap *map)
+{
+    FrameworkMap *node = map;
+    int i;
+    int loopIndex = 0;
+    while (node)
+    {
+        loopIndex++;
+        printf("%d>", loopIndex);
+        if (node->moType == FWMgrMOPlayer)
+            printf("MediaPlayer-");
+        else if (node->moType == FWMgrMORecorder)
+            printf("MediaRecrdr-");
+        else
+            printf("UKNOWN-");
+        if (node->fwType == FWMgrFWMMF)
+            printf("MMF-");
+        else if (node->fwType == FWMgrFWGST)
+            printf("GST-");
+        else
+            printf("UKNOWN-");
+        printf("Scheme[");
+        for(i=0;i<node->uriSchemeCount;i++)
+            printf(" %s", node->uriSchemes[i]);
+        printf("]FileExt[");
+        for(i=0;i<node->fileExtCount;i++)
+            printf(" %s", node->fileExts[i]);
+        printf("]\n");
+        node = node->next;
+    }
+}
+#endif
+
+/* void XAFrameworkMgr_DeleteFrameworkMap
+ * Description: Deletes the list of framework and use-case map.
+ */
+void XAFrameworkMgr_DeleteFrameworkMap(FrameworkMap **map)
+{
+    FrameworkMap *node = *map;
+    FrameworkMap *nextNode = NULL;
+    int i;
+    while (node)
+    {
+        for(i=0;i<node->uriSchemeCount;i++)
+            free (node->uriSchemes[i]);
+        free (node->uriSchemes);
+
+        for(i=0;i<node->fileExtCount;i++)
+            free (node->fileExts[i]);
+        free (node->fileExts);
+
+        nextNode = node->next;
+        free (node);
+        node = nextNode;
+    }
+    *map = NULL;
+}
+
+/* FWMgrFwType XAFrameworkMgr_GetFramework
+ * Description: Returns the framework enum that handles uri.
+ */
+FWMgrFwType XAFrameworkMgr_GetFramework(
+                    FrameworkMap *map,
+                    const char *uri,
+                    FWMgrMOType mediaObject)
+{
+    FWMgrFwType retVal = FWMgrFWUknown;
+    char fileScheme[] = "file";
+    char *uriScheme = NULL;
+    char *fileExt = NULL;
+    FrameworkMap *node = map;
+    FWMgrBool uriMatchFound = FWMgrFalse;
+    FWMgrBool fileExtMatchFound = FWMgrFalse;
+    int i = 0;
+    int copyLen = 0;
+
+    if (!map || !uri)
+    {
+        /* TODO Log invalid uri */
+        return retVal;
+    }
+
+    /* Get uri scheme */
+    uriScheme = strchr(uri, ':');
+    if ( uriScheme == NULL)
+    {
+        /* TODO Log invalid uri */
+        return retVal;
+    }
+
+    copyLen = (uriScheme - uri);
+    uriScheme = (char*)calloc(copyLen + 1, sizeof(char));
+    strncpy(uriScheme, uri, copyLen);
+    uriScheme[copyLen] = '\0'; /*Null terminate it*/
+
+    if (strcasecmp(uriScheme, fileScheme) == 0)
+    {
+        /* Get uri extension */
+        char* dotLoc = strrchr(uri, '.');
+        if ( dotLoc == NULL)
+        {
+            /* TODO Log invalid uri */
+            free(uriScheme);
+            return retVal;
+        }
+        /* We need to add 1 to exclude '.'*/
+        copyLen = strlen(uri) - (dotLoc + 1 - uri);
+        fileExt = (char*)calloc(copyLen + 1, sizeof(char));
+        strncpy(fileExt, dotLoc + 1, copyLen);
+        fileExt[copyLen] = '\0'; /*Null terminate it*/
+    }
+
+    while (node)
+    {
+        if (mediaObject == node->moType)
+            {
+            uriMatchFound = FWMgrFalse;
+            fileExtMatchFound = FWMgrFalse;
+            /* Match for uri*/
+            for(i = 0; i < node->uriSchemeCount; i++)
+            {
+                if (strcasecmp(uriScheme, node->uriSchemes[i]) == 0)
+                    {
+                        uriMatchFound = FWMgrTrue;
+                        break;
+                    }
+            }
+            /* if uri scheme is not file, we only need to check for uri */
+            if (!fileExt)
+            {
+                fileExtMatchFound = FWMgrTrue;
+            }
+            else
+            {
+                for(i = 0; i < node->fileExtCount; i++)
+                {
+                    if (strcasecmp(fileExt, node->fileExts[i]) == 0)
+                    {
+                        fileExtMatchFound = FWMgrTrue;
+                        break;
+                    }
+                }
+            }
+
+            if ((uriMatchFound == FWMgrTrue) &&
+                (fileExtMatchFound == FWMgrTrue))
+                {
+                    retVal = node->fwType;
+                    break;
+                }
+            }
+        node = node->next;
+    }
+    free(uriScheme);
+    free(fileExt);
+    return retVal;
+}
+
+/* Local functions */
+
+/* FWMgrBool processConfigEntry
+ * Description: Processes a single line entry from the config file.
+ */
+FWMgrBool processConfigEntry(
+        const char* buffer,
+        FWMgrMOType *mediaType,
+        FWMgrFwType *frameworkType,
+        FWMgrTagType *tagType,
+        FWMgrBool *newNode,
+        FrameworkMap **node)
+{
+    FWMgrBool processedSuccessfully = FWMgrTrue;
+    *newNode = FWMgrFalse;
+    switch (*mediaType)
+    {
+        case FWMgrMOUnknown:
+        {
+            if (strcmp(buffer, mediaPlayerBeginTag) == 0)
+            {
+                *mediaType = FWMgrMOPlayer;
+                *frameworkType = FWMgrFWUknown;
+                *tagType = FWMgrTagNone;
+                *node = NULL;
+            }
+            else if (strcmp(buffer, mediaRecorderBeginTag) == 0)
+            {
+                *mediaType = FWMgrMORecorder;
+                *frameworkType = FWMgrFWUknown;
+                *tagType = FWMgrTagNone;
+                *node = NULL;
+            }
+        }
+            break;
+        case FWMgrMOPlayer:
+        case FWMgrMORecorder:
+        {
+            switch (*frameworkType)
+            {
+                case FWMgrFWUknown:
+                {
+                    if ((*mediaType == FWMgrMOPlayer) && (strcmp(buffer, mediaPlayerEndTag) == 0))
+                        *mediaType = FWMgrMOUnknown;
+                    else if ((*mediaType == FWMgrMORecorder) && (strcmp(buffer, mediaRecorderEndTag) == 0))
+                        *mediaType = FWMgrMOUnknown;
+                    else if ( (strcmp(buffer, mediaFrameworkMmfBeginTag) == 0) ||
+                              (strcmp(buffer, mediaFrameworkGstBeginTag) == 0) )
+                    {
+                        *frameworkType = FWMgrFWMMF;
+                        if (strcmp(buffer, mediaFrameworkGstBeginTag) == 0)
+                            *frameworkType = FWMgrFWGST;
+                        if (*node)
+                        {
+                            printf("Fatal error error. Entry already exists and creating another one!!!");
+                            return FWMgrFalse;
+                        }
+                        *node = (FrameworkMap*)calloc(1, sizeof(FrameworkMap));
+                        if (!(*node))
+                        {
+                            printf("Fatal error. No memory to create an Entry!!!");
+                            return FWMgrFalse;
+                        }
+                        *newNode = FWMgrTrue;
+                        (*node)->moType = *mediaType;
+                        (*node)->fwType = *frameworkType;
+                    }
+                }
+                    break;
+                case FWMgrFWMMF:
+                {
+                    processedSuccessfully = processTagType(
+                                                buffer,
+                                                frameworkType,
+                                                tagType,
+                                                node);
+                }
+                    break;
+                case FWMgrFWGST:
+                {
+                    processedSuccessfully = processTagType(
+                                                buffer,
+                                                frameworkType,
+                                                tagType,
+                                                node);
+                }
+                    break;
+                default:
+                    processedSuccessfully = FWMgrFalse;
+                    break;
+            };
+        }
+            break;
+        default:
+            processedSuccessfully = FWMgrFalse;
+            break;
+    };
+    return processedSuccessfully;
+}
+
+/* FWMgrBool processTagType
+ * Description: Processes a framework type, uri, file tags entry from the config file.
+ */
+FWMgrBool processTagType(const char* buffer,
+        FWMgrFwType *frameworkType,
+        FWMgrTagType *tagType,
+        FrameworkMap **node)
+{
+    FWMgrBool processedSuccessfully = FWMgrTrue;
+    switch (*tagType)
+    {
+        case FWMgrTagNone:
+        {
+            if (((*frameworkType == FWMgrFWMMF) && (strcmp(buffer, mediaFrameworkMmfEndTag) == 0)) ||
+                ((*frameworkType == FWMgrFWGST) && (strcmp(buffer, mediaFrameworkGstEndTag) == 0)))
+            {
+                *node = NULL;
+                *frameworkType = FWMgrFWUknown;
+            }
+            else if (strcmp(buffer, uriSchemeBeginTag) == 0)
+                *tagType = FWMgrTagURIScheme;
+            else if (strcmp(buffer, fileExtBeginTag) == 0)
+                *tagType = FWMgrTagFileExt;
+        }
+            break;
+        case FWMgrTagURIScheme:
+        {
+            if (strcmp(buffer, uriSchemeEndTag) == 0)
+                *tagType = FWMgrTagNone;
+            else
+            {
+                processedSuccessfully = FWMgrFalse;
+                if (*node)
+                    processedSuccessfully = tokenizeTag(FWMgrTagURIScheme, buffer, node);
+            }
+        }
+            break;
+        case FWMgrTagFileExt:
+        {
+            if (strcmp(buffer, fileExtEndTag) == 0)
+                *tagType = FWMgrTagNone;
+            else
+            {
+                processedSuccessfully = FWMgrFalse;
+                if (*node)
+                    processedSuccessfully = tokenizeTag(FWMgrTagFileExt, buffer, node);
+            }
+        }
+            break;
+        default:
+            break;
+    };
+    return processedSuccessfully;
+}
+
+/* FWMgrBool processTagType
+ * Description: Processes a framework type, uri, file tags entry from the config file.
+ */
+FWMgrBool tokenizeTag(FWMgrTagType tagType, const char* buffer, FrameworkMap **node)
+{
+    char* tempStartPtr = /*const_cast<char*>*/(char*)(buffer);
+    char* tempEndPtr = /*const_cast<char*>*/(char*)(buffer);
+    int index = 0;
+    int strLen = 0;
+
+    if (tagType == FWMgrTagURIScheme)
+    {
+        (*node)->uriSchemeCount = atoi(buffer);
+        (*node)->uriSchemes =  (char**)calloc((*node)->uriSchemeCount,  sizeof (*((*node)->uriSchemes)));
+        if (!(*node)->uriSchemes)
+        {
+            printf("Fatal error. No memory to create an Entry!!!");
+            return FWMgrFalse;
+        }
+    }
+    else if (tagType == FWMgrTagFileExt)
+    {
+        (*node)->fileExtCount = atoi(buffer);
+        (*node)->fileExts =  (char**)calloc((*node)->fileExtCount,  sizeof (*((*node)->fileExts)));
+        if (!(*node)->fileExts)
+        {
+            printf("Fatal error. No memory to create an Entry!!!");
+            return FWMgrFalse;
+        }
+    }
+    else
+        return FWMgrFalse;
+
+    /*Find the index of :*/
+    tempStartPtr = strchr(tempStartPtr, ',');
+    index = 0;
+    while (tempStartPtr && (strlen(tempStartPtr) > 1))
+    {
+        tempStartPtr++; /* Ignore separator ','*/
+        tempEndPtr = strchr(tempStartPtr, ',');
+        strLen = (tempEndPtr - tempStartPtr) + 1; /* To hold null terminator */
+        if (strLen > 0)
+        {
+            if (tagType == FWMgrTagURIScheme)
+            {
+                (*node)->uriSchemes[index] = (char*)calloc(strLen, sizeof(char));
+                strncpy((*node)->uriSchemes[index], tempStartPtr, strLen);
+                (*node)->uriSchemes[index][strLen-1] = '\0'; /*Null terminate it*/
+                index++;
+            }
+            else if (tagType == FWMgrTagFileExt)
+            {
+                (*node)->fileExts[index] = (char*)calloc(strLen, sizeof(char));
+                strncpy((*node)->fileExts[index], tempStartPtr, strLen);
+                (*node)->fileExts[index][strLen-1] = '\0'; /*Null terminate it*/
+                index++;
+            }
+        }
+        tempStartPtr = tempEndPtr;
+    }
+    return FWMgrTrue;
+}
+
+int createDefaultRules(const char * filename)
+{
+    FILE* fp = fopen(filename, "w");
+    if (fp == NULL)
+        return /*KErrAccessDenied*/-21;
+    fputs("#/*\r\n", fp);
+    fputs("#* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).\r\n", fp);
+    fputs("#* All rights reserved.\r\n", fp);
+    fputs("#* This component and the accompanying materials are made available\r\n", fp);
+    fputs("#* under the terms of \"Eclipse Public License v1.0\"\r\n", fp);
+    fputs("#* which accompanies this distribution, and is available\r\n", fp);
+    fputs("#* at the URL \"http://www.eclipse.org/legal/epl-v10.html\".\r\n", fp);
+    fputs("#*\r\n", fp);
+    fputs("#* Initial Contributors:\r\n", fp);
+    fputs("#* Nokia Corporation - initial contribution.\r\n", fp);
+    fputs("#*\r\n", fp);
+    fputs("#* Contributors:\r\n", fp);
+    fputs("#*\r\n", fp);
+    fputs("#* Description:\r\n", fp); 
+    fputs("#*\r\n", fp);
+    fputs("#*/\r\n", fp);
+    fputs("#============================================================================>|\r\n", fp);
+    fputs("# Must not exceed 80 chars each line=========================================>|\r\n", fp);
+    fputs("#============================================================================>|\r\n", fp);
+    fputs("<mediaplayer>\r\n", fp);
+    fputs("<mmf>\r\n", fp);
+    fputs("<urischeme>\r\n", fp);
+    fputs("# Num of entries followed by actual entries all ending with a comma\r\n", fp);
+    fputs("3,file,http,rtsp,\r\n", fp);
+    fputs("</urischeme>\r\n", fp);
+    fputs("<fileext>\r\n", fp);
+    fputs("15,3gp,wma,wmv,wav,amr,mp3,mp4,rm,ra,avi,mkv,aac,mid,awb,3g2,\r\n", fp);
+    fputs("</fileext>\r\n", fp);
+    fputs("</mmf>\r\n", fp);
+    fputs("</mediaplayer>\r\n", fp);
+    fputs("<mediarecorder>\r\n", fp);
+    fputs("<gst>\r\n", fp);
+    fputs("<urischeme>\r\n", fp);
+    fputs("# Num of entries followed by actual entries all ending with a comma\r\n", fp);
+    fputs("1,file,\r\n", fp);
+    fputs("</urischeme>\r\n", fp);
+    fputs("<fileext>\r\n", fp);
+    fputs("3,wav,amr,mp4,\r\n", fp);
+    fputs("</fileext>\r\n", fp);
+    fputs("</gst>\r\n", fp);
+    fputs("</mediarecorder>\r\n", fp);
+    fclose(fp);
+    return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/adptcommon/xaframeworkmgr.h	Fri May 14 16:22:35 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 XAFRAMEWORKMANAGER_H
+#define XAFRAMEWORKMANAGER_H
+
+#include <stdlib.h>
+
+typedef enum
+{
+    FWMgrMOUnknown,
+    FWMgrMOPlayer,
+    FWMgrMORecorder
+} FWMgrMOType;
+
+typedef enum
+{
+    FWMgrFWUknown,
+    FWMgrFWMMF,
+    FWMgrFWGST
+} FWMgrFwType;
+
+typedef enum
+{
+    FWMgrFalse,
+    FWMgrTrue
+} FWMgrBool;
+
+typedef struct FrameworkMap_ FrameworkMap;
+
+struct FrameworkMap_
+{
+    FWMgrMOType moType;
+    int uriSchemeCount;
+    char **uriSchemes;
+    int fileExtCount;
+    char **fileExts;
+    FWMgrFwType fwType;
+    FrameworkMap *next;
+};
+
+
+FrameworkMap* XAFrameworkMgr_CreateFrameworkMap(void);
+#ifdef _DEBUG
+void XAFrameworkMgr_DumpFrameworkMap(FrameworkMap *map);
+#endif
+void XAFrameworkMgr_DeleteFrameworkMap(FrameworkMap **map);
+
+FWMgrFwType XAFrameworkMgr_GetFramework(
+                    FrameworkMap *map,
+                    const char *uri,
+                    FWMgrMOType mediaObject);
+
+#endif //XAFRAMEWORKMANAGER_H
--- a/khronosfws/openmax_al/src/camera/xacameradevice.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/camera/xacameradevice.c	Fri May 14 16:22:35 2010 +0300
@@ -26,6 +26,9 @@
 #include "xaimageeffectsitf.h"
 #include "xavideopostprocessingitf.h"
 #include "xathreadsafety.h"
+#include "xaframeworkmgr.h"
+#include "xacameraadaptctx.h"
+#include "xacapabilitiesmgr.h"
 
 /* Static mapping of enumeration XACameraDeviceInterfaces to interface iids */
 static const XAInterfaceID* XACameraDeviceItfIIDs[CAMERA_ITFCOUNT]=
@@ -47,7 +50,9 @@
 /* XAResult XACameraDeviceImpl_Create
  * Description: Create object
  */
-XAresult XACameraDeviceImpl_CreateCameraDevice(XAObjectItf* pDevice,
+XAresult XACameraDeviceImpl_CreateCameraDevice(FrameworkMap* mapper,
+                                                XACapabilities* capabilities,   
+                                               XAObjectItf* pDevice,
                                                XAuint32 deviceID,
                                                XAuint32 numInterfaces,
                                                const XAInterfaceID * pInterfaceIds,
@@ -130,34 +135,26 @@
     /* 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;    
+    return XA_RESULT_FEATURE_UNSUPPORTED;
     /*************************************************/
-
     
-    
-    
-    /* Set ObjectItf to point to newly created object */
-/*
+/*     Initialize XACameraDeviceImpl variables 
+    pImpl->deviceID = deviceID;
+
+    pImpl->adaptationCtx = XACameraAdapt_Create(pImpl->deviceID);
+
+     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;
-*/
+    return XA_RESULT_SUCCESS;*/
 }
 
 /* XAResult XACameraDeviceImpl_QueryNumSupportedInterfaces
@@ -234,9 +231,9 @@
         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);
@@ -264,7 +261,7 @@
                                 XACameraDeviceImpl_DoRemoveItf);
                     }
                     break;
-#ifdef _GSTREAMER_BACKEND_   
+  
                 case CAMERA_CAMERAITF:
                     pItf = XACameraItfImpl_Create( pObjImpl->adaptationCtx );
                     break;
@@ -280,7 +277,7 @@
                 case CAMERA_VIDEOPOSTPROCESSINGITF:
                      pItf = XAVideoPostProcessingItfImpl_Create( pObjImpl->adaptationCtx );
                      break;
-#endif                     
+                  
                 default:
                     break;
             }
@@ -323,12 +320,12 @@
 {
     XAObjectItfImpl* pObj = (XAObjectItfImpl*)(*self);
     XAuint8 itfIdx = 0;
+    XACameraDeviceImpl* pImpl = (XACameraDeviceImpl*)(*self);
+    assert( pObj && pImpl && pObj == pObj->self );
     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 */
@@ -363,13 +360,13 @@
             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;
@@ -384,10 +381,10 @@
  */
 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)
@@ -395,9 +392,7 @@
         switch( mapEntry->mapIdx )
         {
         case CAMERA_IMAGEEFFECTSITF:
-#ifdef _GSTREAMER_BACKEND_   
             mapEntry->pItf = XAImageEffectsItfImpl_Create( pImpl->adaptationCtx );
-#endif
             break;
         default:
             DEBUG_ERR("XACameraDeviceImpl_DoAddItf unknown id");
--- a/khronosfws/openmax_al/src/camera/xacameradevice.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/camera/xacameradevice.h	Fri May 14 16:22:35 2010 +0300
@@ -21,9 +21,7 @@
 #include "openmaxalwrapper.h"
 #include "xaobjectitf.h"
 #include "xaglobals.h"
-#ifdef _GSTREAMER_BACKEND_
-#include "../adaptation/XACameraAdaptCtx.h"
-#endif
+#include "xaadptbasectx.h"
 /** MACROS **/
 
 
@@ -53,9 +51,9 @@
 
     /* variables */
     XAuint32 deviceID;
-#ifdef _GSTREAMER_BACKEND_
+
     XAAdaptationBaseCtx* adaptationCtx;
-#endif    
+  
 } XACameraDeviceImpl;
 
 
--- a/khronosfws/openmax_al/src/camera/xacameraitf.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/camera/xacameraitf.c	Fri May 14 16:22:35 2010 +0300
@@ -19,9 +19,9 @@
 #include <stdlib.h>
 #include <assert.h>
 #include "xacameraitf.h"
-#ifdef _GSTREAMER_BACKEND_
-#include "XACameraItfAdaptation.h"
-#endif
+
+#include "xacameraitfadaptation.h"
+
 #include "xathreadsafety.h"
 
 /* XACameraItfImpl* GetImpl(XACameraItf self)
@@ -98,10 +98,16 @@
     /* check is flash mode changed */
     if( impl->flashMode != flashMode )
     {
-#ifdef _GSTREAMER_BACKEND_    
-        ret = XACameraItfAdapt_SetFlashMode( impl->adapCtx, flashMode );
-#endif        
-        if ( ret == XA_RESULT_SUCCESS )
+    if(impl->adapCtx->fwtype == FWMgrFWGST)
+        {
+        ret = XACameraItfAdapt_SetFlashMode( (XAAdaptationGstCtx*)impl->adapCtx, flashMode );
+        }
+    else
+        {
+        DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED");
+        ret = XA_RESULT_FEATURE_UNSUPPORTED;
+        }    
+    if ( ret == XA_RESULT_SUCCESS )
         {
             impl->flashMode = flashMode;
         }
@@ -189,10 +195,16 @@
     /* 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 )
+    if(impl->adapCtx->fwtype == FWMgrFWGST)
+        {
+        ret = XACameraItfAdapt_SetFocusMode( (XAAdaptationGstCtx*)impl->adapCtx, focusMode, manualSetting, macroEnabled  );
+        }
+    else
+        {
+        DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED");
+        ret = XA_RESULT_FEATURE_UNSUPPORTED;
+        }    
+    if ( ret == XA_RESULT_SUCCESS )
         {
             impl->focusMode = focusMode;
             impl->focusManualSetting = manualSetting;
@@ -271,10 +283,16 @@
     /* 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)
+    if(impl->adapCtx->fwtype == FWMgrFWGST)
+        {
+        ret = XACameraItfAdapt_SetFocusRegionPattern( (XAAdaptationGstCtx*)impl->adapCtx, focusPattern, activePoints1, activePoints2 );
+        }
+    else
+        {
+        DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED");
+        ret = XA_RESULT_FEATURE_UNSUPPORTED;
+        }     
+    if (ret == XA_RESULT_SUCCESS)
         {
             impl->focusPattern = focusPattern;
             if( !(impl->focusMode & XA_CAMERA_FOCUSMODE_MANUAL) )
@@ -349,11 +367,16 @@
         /* invalid parameter */
         return XA_RESULT_PARAMETER_INVALID;
     }
-
-#ifdef _GSTREAMER_BACKEND_       
-    ret = XACameraItfAdapt_GetFocusRegionPositions( impl->adapCtx, pNumPositionEntries,
-                                                    pFocusPosition );
-#endif
+    if(impl->adapCtx->fwtype == FWMgrFWGST)
+        {
+        ret = XACameraItfAdapt_GetFocusRegionPositions( (XAAdaptationGstCtx*)impl->adapCtx, pNumPositionEntries,
+                                                            pFocusPosition );
+        }
+    else
+        {
+        DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED");
+        ret = XA_RESULT_FEATURE_UNSUPPORTED;
+        }  
     DEBUG_API("<-XACameraItfImpl_GetFocusRegionPositions");
     return ret;
 }
@@ -407,9 +430,15 @@
         DEBUG_API("<-XACameraItfImpl_SetMeteringMode");
         return XA_RESULT_PARAMETER_INVALID;
     }
-#ifdef _GSTREAMER_BACKEND_   
-    ret = XACameraItfAdapt_SetMeteringMode( impl->adapCtx, meteringMode );
-#endif
+    if(impl->adapCtx->fwtype == FWMgrFWGST)
+        {
+        ret = XACameraItfAdapt_SetMeteringMode( (XAAdaptationGstCtx*)impl->adapCtx, meteringMode );
+        }
+    else
+        {
+        DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED");
+        ret = XA_RESULT_FEATURE_UNSUPPORTED;
+        }    
     if ( ret == XA_RESULT_SUCCESS )
     {
         impl->meteringMode = meteringMode;
@@ -470,10 +499,16 @@
     /* 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 )
+    if(impl->adapCtx->fwtype == FWMgrFWGST)
+        {
+        ret = XACameraItfAdapt_SetExposureMode( (XAAdaptationGstCtx*)impl->adapCtx, exposure, exposure );
+        }
+    else
+        {
+        DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED");
+        ret = XA_RESULT_FEATURE_UNSUPPORTED;
+        }
+    if ( ret == XA_RESULT_SUCCESS )
         {
             impl->exposureMode = exposure;
             impl->compensation = compensation;
@@ -539,10 +574,16 @@
     /* 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 )
+    if(impl->adapCtx->fwtype == FWMgrFWGST)
+        {
+        ret = XACameraItfAdapt_SetISOSensitivity((XAAdaptationGstCtx*)impl->adapCtx, isoSensitivity, manualSetting );
+        }
+    else
+        {
+        DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED");
+        ret = XA_RESULT_FEATURE_UNSUPPORTED;
+        }
+    if ( ret == XA_RESULT_SUCCESS )
         {
             impl->isoSensitivity = isoSensitivity;
             impl->isoManualSetting = manualSetting;
@@ -616,10 +657,16 @@
     /* 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 )
+    if(impl->adapCtx->fwtype == FWMgrFWGST)
+        {
+        ret = XACameraItfAdapt_SetAperture( (XAAdaptationGstCtx*)impl->adapCtx, aperture, manualSetting );
+        }
+    else
+        {
+        DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED");
+        ret = XA_RESULT_FEATURE_UNSUPPORTED;
+        }
+    if ( ret == XA_RESULT_SUCCESS )
         {
             impl->aperture = aperture;
             impl->apertureManualSetting = manualSetting;
@@ -689,10 +736,15 @@
         DEBUG_API("<-XACameraItfImpl_SetShutterSpeed");
         return XA_RESULT_PARAMETER_INVALID;
     }
-
-#ifdef _GSTREAMER_BACKEND_   
-    ret = XACameraItfAdapt_SetShutterSpeed( impl->adapCtx, shutterSpeed, manualSetting );
-#endif
+    if(impl->adapCtx->fwtype == FWMgrFWGST)
+        {
+        ret = XACameraItfAdapt_SetShutterSpeed( (XAAdaptationGstCtx*)impl->adapCtx, shutterSpeed, manualSetting );
+        }
+    else
+        {
+        DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED");
+        ret = XA_RESULT_FEATURE_UNSUPPORTED;
+        }
     if ( ret == XA_RESULT_SUCCESS )
     {
         impl->shutterManualSetting = manualSetting;
@@ -766,10 +818,16 @@
     /* 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 )
+    if(impl->adapCtx->fwtype == FWMgrFWGST)
+        {
+        ret = XACameraItfAdapt_SetWhiteBalance( (XAAdaptationGstCtx*)impl->adapCtx, whiteBalance, manualSetting );
+        }
+    else
+        {
+        DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED");
+        ret = XA_RESULT_FEATURE_UNSUPPORTED;
+        }
+    if ( ret == XA_RESULT_SUCCESS )
         {
             impl->whiteBalance = whiteBalance;
             impl->whiteBalManualSetting = manualSetting;
@@ -836,9 +894,17 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_   
-    ret = XACameraItfAdapt_SetAutoLocks( impl->adapCtx, locks );
-#endif
+    if(impl->adapCtx->fwtype == FWMgrFWGST)
+        {
+        ret = XACameraItfAdapt_SetAutoLocks( (XAAdaptationGstCtx*)impl->adapCtx, locks );
+
+        }
+    else
+        {
+        DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED");
+        ret = XA_RESULT_FEATURE_UNSUPPORTED;
+        }
+    
     if ( ret == XA_RESULT_SUCCESS )
     {
         impl->locks = locks;
@@ -899,10 +965,17 @@
         DEBUG_API("<-XACameraItfImpl_SetZoom");
         return XA_RESULT_PARAMETER_INVALID;
     }
+    if(impl->adapCtx->fwtype == FWMgrFWGST)
+        {
+        ret = XACameraItfAdapt_SetZoom( (XAAdaptationGstCtx*)impl->adapCtx, zoom, digitalEnabled, speed, async );
 
-#ifdef _GSTREAMER_BACKEND_   
-    ret = XACameraItfAdapt_SetZoom( impl->adapCtx, zoom, digitalEnabled, speed, async );
-#endif
+        }
+    else
+        {
+        DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED");
+        ret = XA_RESULT_FEATURE_UNSUPPORTED;
+        }
+    
     if ( ret == XA_RESULT_SUCCESS )
     {
         impl->zoom = zoom;
@@ -952,7 +1025,6 @@
 /* XACameraItfImpl* XACameraItfImpl_Create()
  * Description: Allocate and initialize CameraItfImpl
  */
-#ifdef _GSTREAMER_BACKEND_   
 
 XACameraItfImpl* XACameraItfImpl_Create( XAAdaptationBaseCtx *adapCtx )
 {
@@ -994,9 +1066,7 @@
         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;
     }
 
@@ -1004,7 +1074,7 @@
     return self;
 }
 
-#endif
+
 /* void XACameraItfImpl_Free(XACameraItfImpl* self)
  * Description: Free all resources reserved at XACameraItfImpl_Create
  */
@@ -1012,14 +1082,11 @@
 {
     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
@@ -1070,4 +1137,3 @@
     DEBUG_API("<-XACameraItfImp_AdaptCb");
 }
 
-#endif
--- a/khronosfws/openmax_al/src/camera/xacameraitf.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/camera/xacameraitf.h	Fri May 14 16:22:35 2010 +0300
@@ -18,11 +18,7 @@
 #ifndef XACAMERAITF_H
 #define XACAMERAITF_H
 
-#include "openmaxalwrapper.h"
-#include "xaglobals.h"
-#ifdef _GSTREAMER_BACKEND_
-#include "XAAdaptationContextBase.h"
-#endif
+#include "xaadptbasectx.h"
 /** MACROS **/
 
 /** TYPES **/
@@ -69,10 +65,8 @@
     void                *context;
     XACameraItf         cbPtrToSelf;
 
-#ifdef _GSTREAMER_BACKEND_
     /*Adaptation variables*/
     XAAdaptationBaseCtx *adapCtx;
-#endif
 } XACameraItfImpl;
 
 /** METHODS **/
@@ -163,11 +157,9 @@
 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 */
--- a/khronosfws/openmax_al/src/common/openmaxal.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/common/openmaxal.c	Fri May 14 16:22:35 2010 +0300
@@ -21,8 +21,8 @@
 
 #include "openmaxalwrapper.h"
 #include "openmaxal_iid.c"
-#include "common/xaglobals.h"
-
+#include "xaglobals.h"
+#include "xaobjects.h"
 
 EXPORT_C XAresult XAAPIENTRY xaCreateEngine(XAObjectItf *pEngine, XAuint32 numOptions,
                                    const XAEngineOption *pEngineOptions,
--- a/khronosfws/openmax_al/src/common/xacommon.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/common/xacommon.c	Fri May 14 16:22:35 2010 +0300
@@ -120,15 +120,15 @@
                 {
                     /* try to parse mimetype first */
                     mime = ((XADataFormat_MIME*)(source->pFormat))->mimeType;
-                    if(strncmp((char*)mime,"audio",5)==0)
+                    if(mime && (strncmp((char*)mime,"audio",5)==0))
                     {
                         *type = XA_MEDIATYPE_AUDIO;
                     }
-                    else if(strncmp((char*)mime,"video",5)==0)
+                    else if(mime && (strncmp((char*)mime,"video",5)==0))
                     {
                         *type = XA_MEDIATYPE_VIDEO;
                     }
-                    else if(strncmp((char*)mime,"image",5)==0)
+                    else if(mime && (strncmp((char*)mime,"image",5)==0))
                     {
                         *type = XA_MEDIATYPE_IMAGE;
                     }
--- a/khronosfws/openmax_al/src/common/xaconfigextensionsitf.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/common/xaconfigextensionsitf.c	Fri May 14 16:22:35 2010 +0300
@@ -76,13 +76,13 @@
         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);
+/*                res = XAAdaptationBase_SetCPConfiguration(impl->ctx,impl->testbufferconf);*/
             }
-#endif
+
         }
     }
     else
@@ -129,7 +129,7 @@
     return res;
 }
 
-#ifdef _GSTREAMER_BACKEND_   
+ 
 XAresult XAConfigExtensionsItfImpl_SetContext(XAConfigExtensionsItfImpl* self,XAAdaptationBaseCtx* adptctx)
     {
     XAresult res = XA_RESULT_SUCCESS;
@@ -147,7 +147,7 @@
     DEBUG_API("<-XAConfigExtensionsItfImpl_SetContext");
     return res;
     }
-#endif
+
 /**
  * XAConfigExtensionsItfImpl -specific methods
  **/
--- a/khronosfws/openmax_al/src/common/xaconfigextensionsitf.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/common/xaconfigextensionsitf.h	Fri May 14 16:22:35 2010 +0300
@@ -18,11 +18,7 @@
 #ifndef XACONFIGEXTENSIONSITF_H
 #define XACONFIGEXTENSIONSITF_H
 
-#ifdef _GSTREAMER_BACKEND_
-#include "XAAdaptationContextBase.h"
-#endif
-#include "openmaxalwrapper.h"
-#include "xaglobals.h"
+#include "xaadptbasectx.h"
 
 /** MACROS **/
 
@@ -40,10 +36,10 @@
     struct XAConfigExtensionsItfImpl_* self;
     /* variables */
     XAuint8 testbufferconf;
-#ifdef _GSTREAMER_BACKEND_    
+   
     /*Adaptation variables*/
     XAAdaptationBaseCtx *ctx;
-#endif    
+  
 } XAConfigExtensionsItfImpl;
 
 /* Base interface XAConfigExtensionsItf implementation */
@@ -58,9 +54,9 @@
                             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);
--- a/khronosfws/openmax_al/src/common/xadynamicsourceitf.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/common/xadynamicsourceitf.c	Fri May 14 16:22:35 2010 +0300
@@ -19,10 +19,10 @@
 #include <stdlib.h>
 #include <assert.h>
 #include "xadynamicsourceitf.h"
-#ifdef _GSTREAMER_BACKEND_   
-#include "XAAdaptationContextBase.h"
-#include "XADynamicSourceItfAdaptation.h"
-#endif
+ 
+#include "xadynamicsourceitfadaptation.h"
+#include "xadynamicsourceitfadaptationmmf.h"
+
 
 /*****************************************************************************
  * Base interface XADynamicSourceItf implementation
@@ -44,7 +44,7 @@
         DEBUG_API("<-XADynamicSourceItfImpl_SetSource");
         return XA_RESULT_PARAMETER_INVALID;
     }
-#ifdef _GSTREAMER_BACKEND_   
+ 
     if( !impl->adaptCtx )
     {
         DEBUG_ERR("Adaptation not ready!!");
@@ -57,10 +57,17 @@
         res = XACommon_CheckDataSource(pDataSource,NULL);
         if(res==XA_RESULT_SUCCESS)
         {
-            res = XADynamicSourceItfAdapt_SetSource(impl->adaptCtx, pDataSource );
+            if(impl->adaptCtx->fwtype == FWMgrFWGST)
+                {
+                res = XADynamicSourceItfAdapt_SetSource((XAAdaptationGstCtx*)impl->adaptCtx, pDataSource );
+                }
+            else
+                {
+                res = XADynamicSourceItfAdaptMMF_SetSource((XAAdaptationMMFCtx*)impl->adaptCtx, pDataSource );
+                }
         }
     }
-#endif
+
     DEBUG_API("<-XADynamicSourceItfImpl_SetSource");
     return res;
 }
@@ -68,7 +75,6 @@
 /*****************************************************************************
  * XADynamicSourceItfImpl -specific methods
  *****************************************************************************/
-#ifdef _GSTREAMER_BACKEND_   
 
 /* XADynamicSourceItfImpl* XADynamicSourceItfImpl_Create()
  * Description: Allocate and initialize DynamicSourceItfImpl
@@ -77,6 +83,7 @@
 {
     XADynamicSourceItfImpl* self = (XADynamicSourceItfImpl*)
         calloc(1,sizeof(XADynamicSourceItfImpl));
+    
     DEBUG_API("->XADynamicSourceItfImpl_Create");
     if( self )
     {
@@ -89,7 +96,7 @@
     DEBUG_API("<-XADynamicSourceItfImpl_Create");
     return self;
 }
-#endif
+
 /* void XADynamicSourceItfImpl_Free(XADynamicSourceItfImpl* self)
  * Description: Free all resources reserved at XADynamicSourceItfImpl_Create
  */
--- a/khronosfws/openmax_al/src/common/xadynamicsourceitf.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/common/xadynamicsourceitf.h	Fri May 14 16:22:35 2010 +0300
@@ -18,11 +18,8 @@
 #ifndef XADYNAMICSOURCEITF_H
 #define XADYNAMICSOURCEITF_H
 
-#include "openmaxalwrapper.h"
-#include "xaglobals.h"
-#ifdef _GSTREAMER_BACKEND_   
-#include "XAAdaptationContextBase.h"
-#endif
+#include "xaadptbasectx.h"
+
 /** MACROS **/
 
 /** TYPES **/
@@ -37,10 +34,9 @@
     struct XADynamicSourceItf_ itf;
     /* pointer to self */
     struct XADynamicSourceItfImpl_* self;
-#ifdef _GSTREAMER_BACKEND_   
     /* variables */
     XAAdaptationBaseCtx *adaptCtx;
-#endif
+
 } XADynamicSourceItfImpl;
 
 /** METHODS **/
@@ -51,10 +47,8 @@
 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 */
--- a/khronosfws/openmax_al/src/common/xaequalizeritf.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/common/xaequalizeritf.c	Fri May 14 16:22:35 2010 +0300
@@ -19,9 +19,9 @@
 #include <stdlib.h>
 #include <assert.h>
 #include "xaequalizeritf.h"
-#ifdef _GSTREAMER_BACKEND_  
-#include "XAEqualizerItfAdaptation.h"
-#endif
+
+#include "xaequalizeritfadaptation.h"
+
 static const XAuint16 equalizerNumOfPresets = 0;
 
 /**
@@ -53,7 +53,7 @@
 {
     XAresult ret = XA_RESULT_SUCCESS;
     XAEqualizerItfImpl* impl = GetImpl(self);
-    
+    XAuint16 index = 0;
     DEBUG_API("->XAEqualizerItfImpl_SetEnabled");
 
     if(!impl)
@@ -63,15 +63,15 @@
         /* 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]);
+                ret = XAEqualizerItfAdapt_SetBandLevel((XAAdaptationGstCtx*)impl->adapCtx, index, impl->levels[index]);
 
                 if(XA_RESULT_SUCCESS == ret)
                 {
@@ -84,7 +84,7 @@
     {
         for(index = 0; index < EQUALIZER_NUM_OF_BANDS; index++)
         {
-            ret = XAEqualizerItfAdapt_SetBandLevel(impl->adapCtx, index, EQUALIZER_DEFAULT_BAND_LEVEL);
+            ret = XAEqualizerItfAdapt_SetBandLevel((XAAdaptationGstCtx*)impl->adapCtx, index, EQUALIZER_DEFAULT_BAND_LEVEL);
 
             if(XA_RESULT_SUCCESS == ret)
             {
@@ -96,7 +96,7 @@
     {
         /* do nothing */
     }
-#endif
+
     if(ret == XA_RESULT_SUCCESS)
     {
         impl->enabled = enabled;
@@ -152,9 +152,9 @@
         /* invalid parameter */
         return XA_RESULT_PARAMETER_INVALID;
     }
-#ifdef _GSTREAMER_BACKEND_  
+
     *pNumBands = EQUALIZER_NUM_OF_BANDS;
-#endif
+
     DEBUG_API("<-XAEqualizerItfImpl_GetNumberOfBands");
     return ret;
 }
@@ -180,16 +180,16 @@
         /* invalid parameter */
         return XA_RESULT_PARAMETER_INVALID;
     }
-#ifdef _GSTREAMER_BACKEND_  
-    ret = XAEqualizerItfAdapt_ThreadEntry(impl->adapCtx);
+
+    ret = XAAdaptationBase_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
+    ret = XAEqualizerItfAdapt_GetBandLevelRange((XAAdaptationGstCtx*)impl->adapCtx, pMin, pMax);
+    XAAdaptationBase_ThreadExit(impl->adapCtx);
+
     DEBUG_API("<-XAEqualizerItfImpl_GetBandLevelRange");
     return ret;
 }
@@ -236,8 +236,8 @@
         /* invalid parameter */
         return XA_RESULT_PARAMETER_INVALID;
     }
-#ifdef _GSTREAMER_BACKEND_  
-    ret = XAEqualizerItfAdapt_ThreadEntry(impl->adapCtx);
+ 
+    ret = XAAdaptationBase_ThreadEntry(impl->adapCtx);
     if( ret == XA_RESULT_PARAMETER_INVALID  || ret == XA_RESULT_PRECONDITIONS_VIOLATED )
     {
         DEBUG_API("<-XAEqualizerItfImpl_SetBandLevel");
@@ -246,7 +246,7 @@
 
     if(impl->enabled)
     {
-        ret = XAEqualizerItfAdapt_SetBandLevel(impl->adapCtx, band, level);
+        ret = XAEqualizerItfAdapt_SetBandLevel((XAAdaptationGstCtx*)impl->adapCtx, band, level);
         if(XA_RESULT_SUCCESS == ret)
         {
             impl->levels[band] = level;
@@ -258,8 +258,8 @@
         impl->levels[band] = level;
     }
 
-    XAEqualizerItfAdapt_ThreadExit(impl->adapCtx);
-#endif    
+    XAAdaptationBase_ThreadExit(impl->adapCtx);
+
     DEBUG_API("<-XAEqualizerItfImpl_SetBandLevel");
     return ret;
 }
@@ -273,9 +273,10 @@
                                          XAmillibel *pLevel)
 {
     XAresult ret = XA_RESULT_SUCCESS;
+    
+    XAEqualizerItfImpl* impl = GetImpl(self);
     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");
@@ -285,7 +286,6 @@
     }
 
     *pLevel = impl->levels[band];
-#endif
     DEBUG_API("<-XAEqualizerItfImpl_GetBandLevel");
     return ret;
 }
@@ -309,17 +309,17 @@
         /* invalid parameter */
         return XA_RESULT_PARAMETER_INVALID;
     }
-#ifdef _GSTREAMER_BACKEND_  
-    ret = XAEqualizerItfAdapt_ThreadEntry(impl->adapCtx);
+
+    ret = XAAdaptationBase_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);
+    ret = XAEqualizerItfAdapt_GetCenterFreq((XAAdaptationGstCtx*)impl->adapCtx, band, pCenter);
 
-    XAEqualizerItfAdapt_ThreadExit(impl->adapCtx);
-#endif
+    XAAdaptationBase_ThreadExit(impl->adapCtx);
+
     DEBUG_API("<-XAEqualizerItfImpl_GetCenterFreq");
     return ret;
 }
@@ -356,17 +356,17 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_  
-    ret = XAEqualizerItfAdapt_ThreadEntry(impl->adapCtx);
+ 
+    ret = XAAdaptationBase_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);
+    ret = XAEqualizerItfAdapt_GetBandFreqRange((XAAdaptationGstCtx*)impl->adapCtx, band, pMin, pMax);
 
-    XAEqualizerItfAdapt_ThreadExit(impl->adapCtx);
-#endif    
+    XAAdaptationBase_ThreadExit(impl->adapCtx);
+  
     DEBUG_API("<-XAEqualizerItfImpl_GetBandFreqRange");
     return ret;
 }
@@ -392,17 +392,17 @@
         /* invalid parameter */
         return XA_RESULT_PARAMETER_INVALID;
     }
-#ifdef _GSTREAMER_BACKEND_  
-    ret = XAEqualizerItfAdapt_ThreadEntry(impl->adapCtx);
+  
+    ret = XAAdaptationBase_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);
+    ret = XAEqualizerItfAdapt_GetBand((XAAdaptationGstCtx*)impl->adapCtx, frequency, pBand);
 
-    XAEqualizerItfAdapt_ThreadExit(impl->adapCtx);
-#endif
+    XAAdaptationBase_ThreadExit(impl->adapCtx);
+
     DEBUG_API("<-XAEqualizerItfImpl_GetBand");
     return ret;
 }
@@ -541,7 +541,7 @@
 /**
  * XAEqualizerItfImpl -specific methods
  **/
-#ifdef _GSTREAMER_BACKEND_  
+ 
 
 /**
  * XAEqualizerItfImplImpl* XAEqualizerItfImpl_Create()
@@ -591,7 +591,7 @@
     DEBUG_API("<-XAEqualizerItfImpl_Create");
     return self;
 }
-#endif
+
 /**
  * void XAEqualizerItfImpl_Free(XAEqualizerItfImpl* self)
  * @param  XAEqualizerItfImpl* self -
--- a/khronosfws/openmax_al/src/common/xaequalizeritf.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/common/xaequalizeritf.h	Fri May 14 16:22:35 2010 +0300
@@ -18,12 +18,9 @@
 #ifndef XAEQUALIZERITF_H
 #define XAEQUALIZERITF_H
 
-#include "openmaxalwrapper.h"
-#include "xaglobals.h"
-#ifdef _GSTREAMER_BACKEND_   
-#include "XAAdaptationContextBase.h"
-#include "XAEqualizerItfAdaptation.h"
-#endif
+#include "xaadptbasectx.h"
+#include "xaequalizeritfadaptation.h"
+
 /** MACROS **/
 /** TYPES **/
 
@@ -41,12 +38,12 @@
     /* 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 **/
@@ -90,10 +87,10 @@
 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 */
--- a/khronosfws/openmax_al/src/common/xaglobals.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/common/xaglobals.h	Fri May 14 16:22:35 2010 +0300
@@ -40,29 +40,24 @@
     XA_RADIOITFEVENTS = 0x80,
     XA_RDSITFEVENTS = 0x100,
     XA_METADATAEVENTS = 0x200,
-    XA_ADDMORETYPES  = 0x400
+    XA_VOLUMEITFEVENTS = 0x400,
+    XA_NOKIALINEARVOLITFEVENTS = 0x800,
+    XA_NOKIAEXTVOLITFEVENTS = 0x1000,        
+    XA_ADDMORETYPES  = 0x2000    
 }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 */
+typedef enum
+{
+    XACAP_DECODER  = 0x1,
+    XACAP_ENCODER  = 0x2,
+    XACAP_DEVSNK   = 0x4,
+    XACAP_DEVSRC   = 0x8,
 
-#define RADIO_DEFAULT_FREQ_RANGE XA_FREQRANGE_FMEUROAMERICA
-#define RADIO_DEFAULT_FREQ 88000000
+    XACAP_AUDIO    = 0x10,
+    XACAP_VIDEO    = 0x20,
+    XACAP_IMAGE    = 0x40
+} XACapsType;
 
 
 typedef enum
@@ -83,143 +78,32 @@
 } XAMediaType;
 
 #define CPCONFIGKEY "TestAppPipeConfig"
+
+#define XA_RECMODE_STREAM 1
+#define XA_RECMODE_STILL 2
+
+#define XA_IMPL_SUPPORTED_AUDIO_OUT_NUM 3
+#define XA_IMPL_OMIX_MAX_CONNECTED_MEDIAPLAYERS 10
+
+/* Max volume level is implementation-dependent but must be at least 0mB
+ * now used max volume 10 mB
+ */
+#define MAX_PERCENTAGE_VOLUME 100
+#define MIN_VOLUME_LEVEL 0
+#define MAX_SUPPORT_VOLUME_LEVEL 9000
+
+/* 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
+
 /**
  * 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
--- a/khronosfws/openmax_al/src/common/xaimagecontrolsitf.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/common/xaimagecontrolsitf.c	Fri May 14 16:22:35 2010 +0300
@@ -19,9 +19,8 @@
 #include <stdlib.h>
 #include <assert.h>
 #include "xaimagecontrolsitf.h"
-#ifdef _GSTREAMER_BACKEND_  
-#include "XAImageControlsItfAdaptation.h"
-#endif
+#include "xaimagecontrolsitfadaptation.h"
+
 /**
  * XAImageControlsItfImpl* GetImpl(XAVolumeItf self)
  * Description: Validated interface pointer and cast it to implementations pointer.
@@ -63,22 +62,22 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_  
-    ret = XAImageControlsItfAdapt_ThreadEntry(impl->adapCtx);
+
+    ret = XAAdaptationBase_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);
+    ret = XAImageControlsItfAdapt_SetBrightness((XAAdaptationGstCtx*)impl->adapCtx, brightness);
 
     if(ret == XA_RESULT_SUCCESS)
     {
         impl->brightness = brightness;
     }
 
-    XAImageControlsItfAdapt_ThreadExit(impl->adapCtx);
-#endif
+    XAAdaptationBase_ThreadExit(impl->adapCtx);
+
     DEBUG_API("<-XAImageControlsItfImpl_SetBrightness");
     return ret;
 }
@@ -129,22 +128,22 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_  
-    ret = XAImageControlsItfAdapt_ThreadEntry(impl->adapCtx);
+
+    ret = XAAdaptationBase_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);
+    ret = XAImageControlsItfAdapt_SetContrast((XAAdaptationGstCtx*)impl->adapCtx, contrast);
 
     if(ret == XA_RESULT_SUCCESS)
     {
         impl->contrast = contrast;
     }
 
-    XAImageControlsItfAdapt_ThreadExit(impl->adapCtx);
-#endif    
+    XAAdaptationBase_ThreadExit(impl->adapCtx);
+   
     DEBUG_API("<-XAImageControlsItfImpl_SetContrast");
     return ret;
 }
@@ -203,22 +202,22 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_  
-    ret = XAImageControlsItfAdapt_ThreadEntry(impl->adapCtx);
+
+    ret = XAAdaptationBase_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);
+    ret = XAImageControlsItfAdapt_SetGamma((XAAdaptationGstCtx*)impl->adapCtx, gamma);
 
     if(ret == XA_RESULT_SUCCESS)
     {
         impl->gamma = gamma;
     }
 
-    XAImageControlsItfAdapt_ThreadExit(impl->adapCtx);
-#endif
+    XAAdaptationBase_ThreadExit(impl->adapCtx);
+
     DEBUG_API("<-XAImageControlsItfImpl_SetGamma");
     return ret;
 }
@@ -275,8 +274,8 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_  
-    ret = XAImageControlsItfAdapt_ThreadEntry(impl->adapCtx);
+ 
+    ret = XAAdaptationBase_ThreadEntry(impl->adapCtx);
     if( ret == XA_RESULT_PARAMETER_INVALID || ret == XA_RESULT_PRECONDITIONS_VIOLATED )
     {
         DEBUG_API("<-XAImageControlsItfImpl_GetSupportedGammaSettings");
@@ -288,20 +287,20 @@
     if( ppSettings && pNumSettings != 0 )
     {
         /* solve array of supported gamma settings */
-        ret = XAImageControlsItfAdapt_GetSupportedGammaSettings(impl->adapCtx,
+        ret = XAImageControlsItfAdapt_GetSupportedGammaSettings((XAAdaptationGstCtx*)impl->adapCtx,
                                                                 pMinValue, pMaxValue,
                                                                 pNumSettings, ppSettings);
     }
     else
     {
         /* Solve min and max values and numSettings */
-        ret = XAImageControlsItfAdapt_GetSupportedGammaSettings(impl->adapCtx,
+        ret = XAImageControlsItfAdapt_GetSupportedGammaSettings((XAAdaptationGstCtx*)impl->adapCtx,
                                                                 pMinValue, pMaxValue,
                                                                 pNumSettings, NULL);
     }
 
-    XAImageControlsItfAdapt_ThreadExit(impl->adapCtx);
-#endif
+    XAAdaptationBase_ThreadExit(impl->adapCtx);
+
     DEBUG_API("<-XAImageControlsItfImpl_GetSupportedGammaSettings");
     return ret;
 }
@@ -309,7 +308,6 @@
 /**
  * XAImageControlsItfImpl -specific methods
  **/
-#ifdef _GSTREAMER_BACKEND_  
 
 /**
  * XAImageControlsItfImplImpl* XAImageControlsItfImpl_Create()
@@ -344,7 +342,7 @@
     DEBUG_API("<-XAImageControlsItfImpl_Create");
     return self;
 }
-#endif
+
 /**
  * void XAImageControlsItfImpl_Free(XAImageControlsItfImpl* self)
  * @param  XAImageControlsItfImpl* self -
--- a/khronosfws/openmax_al/src/common/xaimagecontrolsitf.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/common/xaimagecontrolsitf.h	Fri May 14 16:22:35 2010 +0300
@@ -18,11 +18,8 @@
 #ifndef XAIMAGECONTROLSITF_H
 #define XAIMAGECONTROLSITF_H
 
-#include "openmaxalwrapper.h"
-#include "xaglobals.h"
-#ifdef _GSTREAMER_BACKEND_
-#include "XAAdaptationContextBase.h"
-#endif
+#include "xaadptbasectx.h"
+
 
 /** MACROS **/
 #define DEFAULT_BRIGHTNESS_VALUE    50
@@ -49,10 +46,10 @@
     XAuint32    brightness;
     XAint32     contrast;
     XApermille  gamma;
-#ifdef _GSTREAMER_BACKEND_
+
     /*Adaptation variables*/
     XAAdaptationBaseCtx *adapCtx;
-#endif    
+   
 
 } XAImageControlsItfImpl;
 
@@ -81,10 +78,9 @@
                                                           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 */
--- a/khronosfws/openmax_al/src/common/xaimageeffectsitf.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/common/xaimageeffectsitf.c	Fri May 14 16:22:35 2010 +0300
@@ -19,9 +19,9 @@
 #include <stdlib.h>
 #include <assert.h>
 #include "xaimageeffectsitf.h"
-#ifdef _GSTREAMER_BACKEND_  
-#include "XAImageEffectsItfAdaptation.h"
-#endif
+
+#include "xaimageeffectsitfadaptation.h"
+
 static XAImageEffectsItfImpl* GetImpl(XAImageEffectsItf self)
 {
     if(self)
@@ -60,15 +60,15 @@
         DEBUG_API("<-XAImageEffectsItfImpl_QuerySupportedImageEffects");
         return XA_RESULT_PARAMETER_INVALID;
     }
-#ifdef _GSTREAMER_BACKEND_  
-    ret = XAImageEffectsItfAdapt_ThreadEntry(impl->adapCtx);
+
+    ret = XAAdaptationBase_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,
+    ret = XAImageEffectsItfAdapt_QuerySupportedImageEffects((XAAdaptationGstCtx*)impl->adapCtx, index,
                                                             pImageEffectId);
 
     if( ret == XA_RESULT_SUCCESS )
@@ -76,8 +76,8 @@
         impl->index = index;
     }
 
-    XAImageEffectsItfAdapt_ThreadExit(impl->adapCtx);
-#endif
+    XAAdaptationBase_ThreadExit(impl->adapCtx);
+
     DEBUG_API("<-XAImageEffectsItfImpl_QuerySupportedImageEffects");
     return ret;
 }
@@ -102,23 +102,23 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_  
-    ret = XAImageEffectsItfAdapt_ThreadEntry(impl->adapCtx);
+ 
+    ret = XAAdaptationBase_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);
+    ret = XAImageEffectsItfAdapt_EnableImageEffect((XAAdaptationGstCtx*)impl->adapCtx, imageEffectID);
 
     if( ret == XA_RESULT_SUCCESS )
     {
         impl->imageEffectID = imageEffectID;
     }
 
-    XAImageEffectsItfAdapt_ThreadExit(impl->adapCtx);
-#endif
+    XAAdaptationBase_ThreadExit(impl->adapCtx);
+
     DEBUG_API("<-XAImageEffectsItfImpl_EnableImageEffect");
     return ret;
 }
@@ -143,23 +143,23 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_  
-    ret = XAImageEffectsItfAdapt_ThreadEntry(impl->adapCtx);
+
+    ret = XAAdaptationBase_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);
+    ret = XAImageEffectsItfAdapt_DisableImageEffect((XAAdaptationGstCtx*)impl->adapCtx, imageEffectID);
 
     if( ret == XA_RESULT_SUCCESS )
     {
         impl->imageEffectID = NO_IMAGE_EFFECTS;
     }
 
-    XAImageEffectsItfAdapt_ThreadExit(impl->adapCtx);
-#endif
+    XAAdaptationBase_ThreadExit(impl->adapCtx);
+
     DEBUG_API("<-XAImageEffectsItfImpl_DisableImageEffect");
     return ret;
 }
@@ -186,19 +186,19 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_  
-    ret = XAImageEffectsItfAdapt_ThreadEntry(impl->adapCtx);
+
+    ret = XAAdaptationBase_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,
+    ret = XAImageEffectsItfAdapt_IsImageEffectEnabled((XAAdaptationGstCtx*)impl->adapCtx, imageEffectID,
                                                       pEnabled);
 
-    XAImageEffectsItfAdapt_ThreadExit(impl->adapCtx);
-#endif
+    XAAdaptationBase_ThreadExit(impl->adapCtx);
+
     DEBUG_API("<-XAImageEffectsItfImpl_IsImageEffectEnabled");
     return ret;
 }
@@ -206,7 +206,6 @@
 /**
  * XAImageEffectsItfImpl -specific methods
  **/
-#ifdef _GSTREAMER_BACKEND_  
 
 /**
  * XAImageEffectsItfImplImpl* XAImageEffectsItfImpl_Create()
@@ -236,7 +235,7 @@
     DEBUG_API("<-XAImageEffectsItfImpl_Create");
     return self;
 }
-#endif
+
 /**
  * void XAImageEffectsItfImpl_Free(XAImageEffectsItfImpl* self)
  * @param  XAImageEffectsItfImpl* self -
--- a/khronosfws/openmax_al/src/common/xaimageeffectsitf.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/common/xaimageeffectsitf.h	Fri May 14 16:22:35 2010 +0300
@@ -18,11 +18,8 @@
 #ifndef XAIMAGEEFFECTSITF_H
 #define XAIMAGEEFFECTSITF_H
 
-#include "openmaxalwrapper.h"
-#include "xaglobals.h"
-#ifdef _GSTREAMER_BACKEND_   
-#include "XAAdaptationContextBase.h"
-#endif
+#include "xaadptbasectx.h"
+
 /** MACROS **/
 #define NO_IMAGE_EFFECTS 0
 
@@ -43,10 +40,10 @@
     XAuint32    index;
     XAboolean   enabled;
     XAuint32    imageEffectID;
-#ifdef _GSTREAMER_BACKEND_   
+
     /*Adaptation variables*/
     XAAdaptationBaseCtx *adapCtx;
-#endif
+
 
 } XAImageEffectsItfImpl;
 
@@ -67,10 +64,8 @@
                                                     XAuint32 imageEffectID,
                                                     XAboolean *pEnabled);
 
-#ifdef _GSTREAMER_BACKEND_   
+   
 /* XAImageEffectsItfImpl -specific methods */
 XAImageEffectsItfImpl* XAImageEffectsItfImpl_Create(XAAdaptationBaseCtx *adapCtx);
-#endif
-
 void XAImageEffectsItfImpl_Free(XAImageEffectsItfImpl* self);
 #endif /* XAIMAGEEFFECTSITF_H */
--- a/khronosfws/openmax_al/src/common/xametadataextractionitf.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/common/xametadataextractionitf.c	Fri May 14 16:22:35 2010 +0300
@@ -22,9 +22,14 @@
 
 #include "xametadataextractionitf.h"
 #include "xadebug.h"
-#ifdef _GSTREAMER_BACKEND_  
-#include "XAMetadataAdaptation.h"
-#endif
+
+#include "xametadataadaptation.h"
+
+#include "xaadaptationmmf.h"
+#include "xametadataadaptctxmmf.h"
+#include "xamediaplayeradaptctxmmf.h"
+#include "cmetadatautilityitf.h"
+
 /* XAMetadataExtractionItfImpl* GetImpl(XAMetadataExtractionItf self)
  * Description: Validate interface pointer and cast it to implementation pointer.
  **/
@@ -41,6 +46,20 @@
     return NULL;
 }
 
+static void* GetMetadataUtilityContext(XAAdaptationMMFCtx* adaptCtx)
+{
+	switch(adaptCtx->baseObj.ctxId)
+	{
+		case XAMediaPlayerAdaptation:
+	          return ((XAMediaPlayerAdaptationMMFCtx*)adaptCtx)->mmfMetadataContext;
+		case XAMDAdaptation:
+	          return ((XAMetadataAdaptationMMFCtx*)adaptCtx)->mmfContext;
+		default:
+			break;
+	}
+
+	return NULL;
+}
 /*****************************************************************************
  * Base interface XAMetadataExtractionItf implementation
  *****************************************************************************/
@@ -66,24 +85,40 @@
     }
     else
     {
-#ifdef _GSTREAMER_BACKEND_  
+ 
         if( impl->adaptCtx )
         {
-            if(impl->filteringOn)
-            {
-                *pItemCount = impl->filteredcount;
-            }
-            else
-            {
-                *pItemCount = impl->currentTags.itemcount;
-            }
-            res = XA_RESULT_SUCCESS;
+        	
+			if(impl->adaptCtx->fwtype == FWMgrFWMMF)
+			{
+				void *mmfCtx = GetMetadataUtilityContext((XAAdaptationMMFCtx*)impl->adaptCtx);
+				if(mmfCtx)
+				{
+					res = mmf_get_item_count(mmfCtx, pItemCount);
+				}
+				else
+				{
+					res = XA_RESULT_PARAMETER_INVALID;
+				}
+			}
+			else
+			{
+            	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);
     }
 
@@ -117,17 +152,32 @@
     }
     *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
+	if(impl->adaptCtx && impl->adaptCtx->fwtype == FWMgrFWMMF)
+	{
+		void *mmfCtx = GetMetadataUtilityContext((XAAdaptationMMFCtx*)impl->adaptCtx);
+		if(mmfCtx)
+		{
+			res = mmf_get_key_size(mmfCtx, index, pKeySize);
+		}
+		else
+		{
+			res = XA_RESULT_PARAMETER_INVALID;
+		}
+	}
+	else
+	{
+	    /* 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;
+	    }
+ 
+	    /* size = size of struct + size of data - 1 (struct size already includes one char) */
+    	*pKeySize = sizeof(XAMetadataInfo) + impl->currentTags.mdeKeys[newidx]->size - 1;
+	}
+
     DEBUG_API_A1("<-XAMetadataExtractionItfImpl_GetKeySize (%d)", (int)res);
     return res;
 }
@@ -149,9 +199,9 @@
     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");
 
@@ -163,35 +213,52 @@
         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);
+	
+	if(impl->adaptCtx && impl->adaptCtx->fwtype == FWMgrFWMMF)
+	{
+		void *mmfCtx = GetMetadataUtilityContext((XAAdaptationMMFCtx*)impl->adaptCtx);
+		if(mmfCtx)
+		{
+			res = mmf_get_key(mmfCtx, index, keySize, pKey);
+		}
+		else
+		{
+			res = XA_RESULT_PARAMETER_INVALID;
+		}
+	}
+	else
+	{
 
-    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;
+	    /* 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;
+	    }
+
+	    
+	    /* 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 */
+	    
+	    memset(pKey->data+newdatasize-1,0,1);
+	    pKey->size = newdatasize;
+	}
 
     DEBUG_API_A1("<-XAMetadataExtractionItfImpl_GetKey (%d)", (int)res);
     return res;
@@ -223,17 +290,32 @@
     }
     *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
+	if(impl->adaptCtx && impl->adaptCtx->fwtype == FWMgrFWMMF)
+	{
+		void *mmfCtx = GetMetadataUtilityContext((XAAdaptationMMFCtx*)impl->adaptCtx);
+		if(mmfCtx)
+		{
+			res = mmf_get_value_size(mmfCtx, index,pValueSize);
+		}
+		else
+		{
+			res = XA_RESULT_PARAMETER_INVALID;
+		}
+	}
+	else
+	{
+	    /* 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;
+	    }
+	 
+	    /* size = size of struct + size of data - 1 (struct size already includes one char) */
+	    *pValueSize = sizeof(XAMetadataInfo) + impl->currentTags.mdeValues[newidx]->size - 1;
+	}
+
     DEBUG_API_A1("<-XAMetadataExtractionItfImpl_GetValueSize (%d)", (int)res);
     return res;
 }
@@ -255,9 +337,9 @@
     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");
 
@@ -269,36 +351,51 @@
         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);
 
-    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);
+	if(impl->adaptCtx && impl->adaptCtx->fwtype == FWMgrFWMMF)
+	{
+		void *mmfCtx = GetMetadataUtilityContext((XAAdaptationMMFCtx*)impl->adaptCtx);
+		if(mmfCtx)
+		{
+			res = mmf_get_value(mmfCtx, index, valueSize, pValue);
+		}
+		else
+		{
+			res = XA_RESULT_PARAMETER_INVALID;
+		}
+	}
+	else
+	{
+	    /* 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;
+	    }
 
-    pValue->size = newdatasize;
+	    /* 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 */
+
+	    memset(pValue->data+newdatasize-1,0,1);
+
+	    pValue->size = newdatasize;
+	}
 
     DEBUG_API_A1("<-XAMetadataExtractionItfImpl_GetValue (%d)",(int)res);
     return res;
@@ -330,17 +427,18 @@
 {
     XAresult res = XA_RESULT_SUCCESS;
     
+    XAuint32 idx = 0;
+    XAuint8 matchMask = 0;
     
-#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");
@@ -349,51 +447,59 @@
     }
     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;
-        }
+    
+		if(impl->adaptCtx && impl->adaptCtx->fwtype == FWMgrFWMMF)
+		{
+			DEBUG_API("<-XAMetadataExtractionItfImpl_AddKeyFilter Not Supported in MMF");
+			res = 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;
  }
@@ -405,9 +511,9 @@
 {
     XAMetadataExtractionItfImpl *impl = NULL;
     XAresult res = XA_RESULT_SUCCESS;
-#ifdef _GSTREAMER_BACKEND_  
+ 
     XAuint32 idx = 0;
-#endif
+
     DEBUG_API("->XAMetadataExtractionItfImpl_ClearKeyFilter");
     impl = GetImpl(self);
     if( !impl )
@@ -417,17 +523,26 @@
     }
     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;
+    
+		if(impl->adaptCtx && impl->adaptCtx->fwtype == FWMgrFWMMF)
+		{
+			DEBUG_API("<-XAMetadataExtractionItfImpl_ClearKeyFilter Not Supported in MMF");
+			res = XA_RESULT_PARAMETER_INVALID;
+		}
+		else
+		{
+	        if(impl->tagmatchesfilter)
+	        {
+	 
+	            for(idx=0; idx < impl->currentTags.itemcount; idx++)
+	            {
+	                impl->tagmatchesfilter[idx] = XA_BOOLEAN_FALSE;
+	            }
+
+	        }
+	        impl->filteredcount = 0;
+	        impl->filteringOn = XA_BOOLEAN_FALSE;
+	    }
     }
 
     DEBUG_API_A1("<-XAMetadataExtractionItfImpl_ClearKeyFilter (%d)", (int)res);
@@ -437,7 +552,7 @@
 /*****************************************************************************
  * XAMetadataExtractionItfImpl -specific methods
  *****************************************************************************/
-#ifdef _GSTREAMER_BACKEND_  
+
 /* XAMetadataExtractionItfImpl* XAMetadataExtractionItfImpl_Create()
  * Description: Allocate and initialize XAMetadataExtractionItfImpl
  */
@@ -464,7 +579,11 @@
         self->filteringOn = XA_BOOLEAN_FALSE;
 
         self->adaptCtx = adaptCtx;
-        XAAdaptationBase_AddEventHandler( adaptCtx, &XAMetadataExtractionItfImp_AdaptCb, XA_METADATAEVENTS, self );
+
+		if(self->adaptCtx->fwtype != FWMgrFWMMF)
+		{
+	        XAAdaptationBase_AddEventHandler( adaptCtx, &XAMetadataExtractionItfImp_AdaptCb, XA_METADATAEVENTS, self );
+		}
 
         self->self = self;
     }
@@ -472,7 +591,7 @@
     DEBUG_API("<-XAMetadataExtractionItfImpl_Create");
     return self;
 }
-#endif
+
 /* void XAMetadataExtractionItfImpl_Free(XAMetadataExtractionItfImpl* self)
  * Description: Free all resources reserved at XAMetadataExtractionItfImpl_Create
  */
@@ -480,19 +599,23 @@
 {
     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);
-    }
+ 
+	 if(self->adaptCtx->fwtype != FWMgrFWMMF)
+	 {
+    	XAAdaptationBase_RemoveEventHandler( self->adaptCtx, &XAMetadataExtractionItfImp_AdaptCb );
+	    XAMetadataAdapt_FreeImplTagList(&(self->currentTags), XA_BOOLEAN_TRUE);
+		
+		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...)
  */
@@ -510,7 +633,7 @@
     if( event && event->eventid == XA_ADAPT_MDE_TAGS_AVAILABLE )
     {
         /* get the tag list */
-        XAMetadataExtractionItfAdapt_FillTagList( impl->adaptCtx, &(impl->currentTags) );
+        XAMetadataExtractionItfAdapt_FillTagList( (XAAdaptationGstCtx*)impl->adaptCtx, &(impl->currentTags) );
         if(impl->tagmatchesfilter)
         {
             free(impl->tagmatchesfilter);
@@ -525,14 +648,14 @@
     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;
@@ -568,7 +691,7 @@
         }
         *newidx=oldidx;
     }
-#endif
+
     DEBUG_API("<-CheckAndUnfilterIndex");
     return XA_RESULT_SUCCESS;
 }
--- a/khronosfws/openmax_al/src/common/xametadataextractionitf.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/common/xametadataextractionitf.h	Fri May 14 16:22:35 2010 +0300
@@ -18,11 +18,9 @@
 #ifndef XAMETADATAEXTRACTIONITF_H
 #define XAMETADATAEXTRACTIONITF_H
 
-#include "openmaxalwrapper.h"
-#ifdef _GSTREAMER_BACKEND_  
-#include "XAAdaptationContextBase.h"
-#include "XAMetadataAdaptation.h"
-#endif
+#include "xaadptbasectx.h"
+#include "xametadataadaptation.h"
+
 /** MACROS **/
 
 /** TYPES **/
@@ -42,11 +40,11 @@
     XAuint32                filteredcount;
     XAboolean*              tagmatchesfilter;
     XAboolean               filteringOn;
-#ifdef _GSTREAMER_BACKEND_  
+  
     XAMetadataImplTagList   currentTags;
 
     XAAdaptationBaseCtx *adaptCtx;
-#endif
+
 } XAMetadataExtractionItfImpl;
 
 /** METHODS **/
@@ -83,11 +81,10 @@
 
 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 */
--- a/khronosfws/openmax_al/src/common/xametadatatraversalitf.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/common/xametadatatraversalitf.c	Fri May 14 16:22:35 2010 +0300
@@ -20,9 +20,9 @@
 #include <assert.h>
 
 #include "xametadatatraversalitf.h"
-#ifdef _GSTREAMER_BACKEND_  
-#include "XAMetadataAdaptation.h"
-#endif
+
+#include "xametadataadaptation.h"
+
 /* XAMetadataTraversalImpl* GetImpl(XAMetadataTraversalItf self)
  * Description: Validate interface pointer and cast it to implementation pointer.
  */
@@ -64,9 +64,9 @@
     }
     else if(impl->traversemode != mode)
     {
-#ifdef _GSTREAMER_BACKEND_  
-        res =XAMetadataTraversalItfAdapt_SetMode(impl->adaptCtx, mode);
-#endif
+
+        res =XAMetadataTraversalItfAdapt_SetMode((XAAdaptationGstCtx*)impl->adaptCtx, mode);
+
         if( res == XA_RESULT_SUCCESS )
         {
             impl->traversemode = mode;
@@ -107,9 +107,9 @@
         }
         else
         {
-#ifdef _GSTREAMER_BACKEND_  
-            res = XAMetadataTraversalItfAdapt_GetChildCount(impl->adaptCtx, pCount);
-#endif
+
+            res = XAMetadataTraversalItfAdapt_GetChildCount((XAAdaptationGstCtx*)impl->adaptCtx, pCount);
+
         }
     }
 
@@ -125,9 +125,9 @@
                                                          XAuint32 *pSize)
 {
     XAMetadataTraversalImpl *impl = NULL;
-#ifdef _GSTREAMER_BACKEND_  
+
     XAuint32 chCount = 0;
-#endif    
+  
     XAresult res = XA_RESULT_SUCCESS;
 
     DEBUG_API("->XAMetadataTraversalItfImpl_GetChildMIMETypeSize");
@@ -140,15 +140,15 @@
     }
     else
     {
-#ifdef _GSTREAMER_BACKEND_  
-        res = XAMetadataTraversalItfAdapt_GetChildCount(impl->adaptCtx, &chCount);
+
+        res = XAMetadataTraversalItfAdapt_GetChildCount((XAAdaptationGstCtx*)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
+        res = XAMetadataTraversalItfAdapt_GetChildMIMETypeSize((XAAdaptationGstCtx*)impl->adaptCtx, index, pSize);
+
     }
 
     DEBUG_API("<-XAMetadataTraversalItfImpl_GetChildMIMETypeSize");
@@ -166,9 +166,9 @@
                                                  XAchar *pMimeType)
 {
     XAMetadataTraversalImpl *impl = NULL;
-#ifdef _GSTREAMER_BACKEND_  
+
     XAuint32 chCount = 0;
-#endif
+
     XAresult res = XA_RESULT_SUCCESS;
 
     DEBUG_API("->XAMetadataTraversalItfImpl_GetChildInfo");
@@ -180,8 +180,8 @@
     }
     else
     {
-#ifdef _GSTREAMER_BACKEND_  
-        res = XAMetadataTraversalItfAdapt_GetChildCount(impl->adaptCtx, &chCount);
+
+        res = XAMetadataTraversalItfAdapt_GetChildCount((XAAdaptationGstCtx*)impl->adaptCtx, &chCount);
         if(index >= chCount || res != XA_RESULT_SUCCESS)
         {
             /* out of bounds */
@@ -189,9 +189,9 @@
             DEBUG_API("<-XAMetadataTraversalItfImpl_GetChildInfo");
             return XA_RESULT_PARAMETER_INVALID;
         }
-        res = XAMetadataTraversalItfAdapt_GetChildInfo(impl->adaptCtx, index,
+        res = XAMetadataTraversalItfAdapt_GetChildInfo((XAAdaptationGstCtx*)impl->adaptCtx, index,
                                                 pNodeID, pType, size, pMimeType);
-#endif
+
     }
 
     DEBUG_API("<-XAMetadataTraversalItfImpl_GetChildInfo");
@@ -205,9 +205,9 @@
                                                   XAuint32 index)
 {
     XAMetadataTraversalImpl *impl = NULL;
-#ifdef _GSTREAMER_BACKEND_  
+
     XAuint32 chCount = 0;
-#endif
+
     XAresult res = XA_RESULT_SUCCESS;
 
     DEBUG_API("->XAMetadataTraversalItfImpl_SetActiveNode");
@@ -219,8 +219,8 @@
     }
     else
     {
-#ifdef _GSTREAMER_BACKEND_  
-        res = XAMetadataTraversalItfAdapt_GetChildCount(impl->adaptCtx, &chCount);
+
+        res = XAMetadataTraversalItfAdapt_GetChildCount((XAAdaptationGstCtx*)impl->adaptCtx, &chCount);
         if( res == XA_RESULT_SUCCESS )
         {
             if((impl->nodedepth==0 && index==XA_NODE_PARENT) ||
@@ -232,7 +232,7 @@
             else
             {
                 /* update node and childs */
-                res = XAMetadataTraversalItfAdapt_SetActiveNode(impl->adaptCtx, index);
+                res = XAMetadataTraversalItfAdapt_SetActiveNode((XAAdaptationGstCtx*)impl->adaptCtx, index);
                 if( res == XA_RESULT_SUCCESS )
                 {
                     if(index==XA_NODE_PARENT)
@@ -252,7 +252,7 @@
             DEBUG_API("<-XAMetadataTraversalItfImpl_SetActiveNode");
             return XA_RESULT_INTERNAL_ERROR;
         }
-#endif        
+      
     }
 
     DEBUG_API("<-XAMetadataTraversalItfImpl_SetActiveNode");
@@ -262,7 +262,6 @@
 /*****************************************************************************
  * XAMetadataTraversalImpl -specific methods
  *****************************************************************************/
-#ifdef _GSTREAMER_BACKEND_  
 
 /* XAMetadataTraversalImpl* XAMetadataTraversalItfImpl_Create()
  * Description: Allocate and initialize XAMetadataTraversalImpl
@@ -291,7 +290,7 @@
     DEBUG_API("<-XAMetadataTraversalItfImpl_Create");
     return self;
 }
-#endif
+
 /* void XAMetadataTraversalItfImpl_Free(XAMetadataTraversalImpl* self)
  * Description: Free all resources reserved at XAMetadataTraversalItfImpl_Create
  */
--- a/khronosfws/openmax_al/src/common/xametadatatraversalitf.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/common/xametadatatraversalitf.h	Fri May 14 16:22:35 2010 +0300
@@ -18,11 +18,8 @@
 #ifndef XAMETADATATRAVERSALITF_H
 #define XAMETADATATRAVERSALITF_H
 
-#include "openmaxalwrapper.h"
-#include "xaglobals.h"
-#ifdef _GSTREAMER_BACKEND_  
-#include "XAAdaptationContextBase.h"
-#endif
+#include "xaadptbasectx.h"
+
 /** MACROS **/
 
 /** TYPES **/
@@ -43,9 +40,9 @@
     XAuint32 index;
     XAuint32 nodedepth;
 
-#ifdef _GSTREAMER_BACKEND_  
+
     XAAdaptationBaseCtx *adaptCtx;
-#endif
+
 } XAMetadataTraversalImpl;
 
 /** METHODS **/
@@ -71,10 +68,9 @@
 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/xanlinearvolumeitf.h	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,70 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef XANLINEARVOLUMEITF_H
+#define XANLINEARVOLUMEITF_H
+
+#include "openmaxalwrapper.h"
+#include "xaadaptationmmf.h"
+
+/** MACROS **/
+
+/** TYPES **/
+
+/** ENUMERATIONS **/
+
+/** STRUCTURES **/
+/* Definition of XANokiaLinearVolumeItf implementation */
+typedef struct XANokiaLinearVolumeItfImpl_
+{
+    /* parent interface */
+    struct XANokiaLinearVolumeItf_ itf;
+    /* pointer to self */
+    struct XANokiaLinearVolumeItfImpl_* self;
+
+    XAmillibel volumeLevel;
+    XAuint32 eventFlags;
+    
+    XANokiaLinearVolumeItf         cbPtrToSelf;
+    xaNokiaLinearVolumeCallback    callback;
+    void               *context; 
+ 
+    /*Adaptation variables*/
+    XAAdaptationBaseCtx *adapCtx;
+
+} XANokiaLinearVolumeItfImpl;
+
+/** METHODS **/
+
+/* Base interface XANokiaLinearVolumeItf implementation */
+XAresult XANokiaLinearVolumeItfImpl_SetVolumeLevel(XANokiaLinearVolumeItf self, XAuint32 *percentage);
+
+XAresult XANokiaLinearVolumeItfImpl_GetVolumeLevel(XANokiaLinearVolumeItf self, XAuint32 *percentage);
+
+XAresult XANokiaLinearVolumeItfImpl_GetStepCount(XANokiaLinearVolumeItf self, XAuint32 *pStepCount);
+
+XAresult XANokiaLinearVolumeItfImpl_RegisterVolumeCallback(XANokiaLinearVolumeItf self,
+                                              xaNokiaLinearVolumeCallback callback,
+                                              void * pContext);
+XAresult XANokiaLinearVolumeItfImpl_SetCallbackEventsMask(XANokiaLinearVolumeItf self, XAuint32 eventFlags );
+XAresult XANokiaLinearVolumeItfImpl_GetCallbackEventsMask(XANokiaLinearVolumeItf self, XAuint32 * pEventFlags);
+/* XANokiaLinearVolumeItfImpl -specific methods */
+XANokiaLinearVolumeItfImpl* XANokiaLinearVolumeItfImpl_Create(XAAdaptationBaseCtx *adapCtx);
+void XANokiaLinearVolumeItfImpl_Free(XANokiaLinearVolumeItfImpl* self);
+void XANokiaLinearVolumeItfImpl_AdaptCb( void *pHandlerCtx, XAAdaptEvent *event );
+
+#endif /* XANLINEARVOLUMEITF_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/common/xanokialinearvolume_iid.c	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,15 @@
+/*
+ * Copyright goes here.
+ *
+ */
+
+
+#include "openmaxalwrapper.h"
+
+/*****************************************************************************/
+/* Interface IDs                                                             */
+/*****************************************************************************/
+/*866fa480-2610-11df-b13f-0002a5d5c51b*/
+static const struct XAInterfaceID_ XA_IID_NOKIALINEARVOLUME_ = { 0x866fa480, 0x2610, 0x11df, 0xb13f, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } };
+XA_API const XAInterfaceID XA_IID_NOKIALINEARVOLUME = &XA_IID_NOKIALINEARVOLUME_;
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/common/xanokialinearvolumeitf.c	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,296 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "xanlinearvolumeitf.h"
+#include "xanokialinearvolumeitfadaptationmmf.h"
+
+/**
+ * XANokiaLinearVolumeItfImpl* GetImpl(XANokiaLinearVolumeItf self)
+ * Description: Validated interface pointer and cast it to implementations pointer.
+ **/
+static XANokiaLinearVolumeItfImpl* GetImpl(XANokiaLinearVolumeItf self)
+{
+    if(self)
+    {
+        XANokiaLinearVolumeItfImpl* impl = (XANokiaLinearVolumeItfImpl*)(*self);
+        if(impl && impl == impl->self)
+        {
+            return impl;
+        }
+    }
+    return NULL;
+}
+
+/**
+ * XAresult XANokiaLinearVolumeItfImpl_RegisterVolumeCallback(XANokiaLinearVolumeItf self,
+ *                                               xaNokiaLinearVolumeCallback callback,
+ *                                               void * pContext)
+ * Description: Sets or clears the xaVolumeCallback.
+ **/
+XAresult XANokiaLinearVolumeItfImpl_RegisterVolumeCallback(XANokiaLinearVolumeItf self,
+                                              xaNokiaLinearVolumeCallback callback,
+                                              void * pContext)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XANokiaLinearVolumeItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XANokiaLinearVolumeItfImpl_RegisterVolumeCallback");
+
+    if(!impl)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XANokiaLinearVolumeItfImpl_RegisterVolumeCallback");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    impl->callback = callback;
+    impl->context = pContext;
+    impl->cbPtrToSelf = self;
+
+    DEBUG_API("<-XANokiaLinearVolumeItfImpl_RegisterVolumeCallback");
+    return ret;
+}
+
+/**
+ * Base interface XANokiaLinearVolumeItf implementation
+ */
+
+/**
+ * XAresult XANokiaLinearVolumeItfImpl_SetVolumeLevel(XANokiaLinearVolumeItf self, XAuint32 percentage)
+ * Description: Sets the object's volume level.
+ **/
+XAresult XANokiaLinearVolumeItfImpl_SetVolumeLevel(XANokiaLinearVolumeItf self, XAuint32 *percentage)
+{
+    XANokiaLinearVolumeItfImpl *impl = GetImpl(self);
+    XAresult ret = XA_RESULT_SUCCESS;     
+    XAuint32 vol = *percentage;
+    
+    DEBUG_API("->XANokiaLinearVolumeItfImpl_SetVolumeLevel");
+
+  
+    if((!impl) || (vol > MAX_PERCENTAGE_VOLUME))
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XANokiaLinearVolumeItfImpl_SetVolumeLevel");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    ret = XAAdaptationBase_ThreadEntry(impl->adapCtx);
+    if( ret == XA_RESULT_PARAMETER_INVALID || ret == XA_RESULT_PRECONDITIONS_VIOLATED )
+    {
+        DEBUG_API("<-XANokiaLinearVolumeItfImpl_SetVolumeLevel");
+        return ret;
+    }
+    if(impl->adapCtx->fwtype == FWMgrFWMMF)
+        {
+        ret = XANokiaLinearVolumeItfAdapt_SetVolumeLevel((XAAdaptationMMFCtx*)impl->adapCtx,  vol);
+        }
+
+    if(ret == XA_RESULT_SUCCESS)
+    {
+        impl->volumeLevel = vol;
+    }
+
+    XAAdaptationBase_ThreadExit(impl->adapCtx);
+    DEBUG_API("<-XANokiaLinearVolumeItfImpl_SetVolumeLevel");
+    return ret ;
+}
+
+/**
+ * XAresult XANokiaLinearVolumeItfImpl_GetVolumeLevel(XANokiaLinearVolumeItf self, XAmillibel *pLevel)
+ * Description: Gets the object’s volume level.
+ **/
+XAresult XANokiaLinearVolumeItfImpl_GetVolumeLevel(XANokiaLinearVolumeItf self, XAuint32 *percentage)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XANokiaLinearVolumeItfImpl *impl = GetImpl(self);
+    DEBUG_API("->XANokiaLinearVolumeItfImpl_GetVolumeLevel");
+
+    if(!impl || !percentage)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XANokiaLinearVolumeItfImpl_GetVolumeLevel");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *percentage = impl->volumeLevel;
+
+    DEBUG_API("<-XANokiaLinearVolumeItfImpl_GetVolumeLevel");
+    return ret;
+}
+
+/**
+ * XAresult XANokiaLinearVolumeItfImpl_GetMaxVolumeLevel(XANokiaLinearVolumeItf  self, XAmillibel *pMaxLevel)
+ * Description: Gets the maximum supported level.
+ **/
+XAresult XANokiaLinearVolumeItfImpl_GetStepCount(XANokiaLinearVolumeItf  self, XAuint32 *pStepCount)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XANokiaLinearVolumeItfImpl *impl = GetImpl(self);
+    DEBUG_API("->XANokiaLinearVolumeItfImpl_GetVolumeLevel");
+
+    if(!impl || !pStepCount)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XANokiaLinearVolumeItfImpl_GetMaxVolumeLevel");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    ret = XAAdaptationBase_ThreadEntry(impl->adapCtx);
+    if( ret == XA_RESULT_PARAMETER_INVALID || ret == XA_RESULT_PRECONDITIONS_VIOLATED )
+    {
+        DEBUG_API("<-XANokiaLinearVolumeItfImpl_GetMaxVolumeLevel");
+        return ret;
+    }
+    if(impl->adapCtx->fwtype == FWMgrFWMMF)
+        {
+        ret = XANokiaLinearVolumeItfAdapt_GetStepCount((XAAdaptationMMFCtx*)impl->adapCtx, pStepCount);
+        }
+
+    XAAdaptationBase_ThreadExit(impl->adapCtx);
+    DEBUG_API("<-XANokiaLinearVolumeItfImpl_GetMaxVolumeLevel");
+    return ret;
+}
+
+XAresult XANokiaLinearVolumeItfImpl_SetCallbackEventsMask(XANokiaLinearVolumeItf self, XAuint32 eventFlags )
+    {
+    XAresult ret = XA_RESULT_SUCCESS;
+    XANokiaLinearVolumeItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XANokiaLinearVolumeItfImpl_SetCallbackEventsMask");
+
+    if(!impl)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XANokiaLinearVolumeItfImpl_SetCallbackEventsMask");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    impl->eventFlags = eventFlags;
+
+    DEBUG_API("<-XANokiaLinearVolumeItfImpl_SetCallbackEventsMask");
+    return ret;    
+    }
+
+XAresult XANokiaLinearVolumeItfImpl_GetCallbackEventsMask(XANokiaLinearVolumeItf self, XAuint32 * pEventFlags)
+    {
+    XAresult ret = XA_RESULT_SUCCESS;
+    XANokiaLinearVolumeItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XANokiaLinearVolumeItfImpl_GetCallbackEventsMask");
+
+    if(!impl || !pEventFlags)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XANokiaLinearVolumeItfImpl_GetCallbackEventsMask");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pEventFlags = impl->eventFlags;
+
+    DEBUG_API("<-XANokiaLinearVolumeItfImpl_GetCallbackEventsMask");
+    return ret;    
+    }
+
+/**
+ * XANokiaLinearVolumeItfImpl -specific methods
+ **/
+
+/**
+ * XANokiaLinearVolumeItfImpl* XANokiaLinearVolumeItfImpl_Create()
+ * Description: Allocate and initialize VolumeItfImpl
+ **/
+XANokiaLinearVolumeItfImpl* XANokiaLinearVolumeItfImpl_Create(XAAdaptationBaseCtx *adapCtx )
+{
+    XANokiaLinearVolumeItfImpl *self = (XANokiaLinearVolumeItfImpl*)
+        calloc(1,sizeof(XANokiaLinearVolumeItfImpl));
+    DEBUG_API("->XANokiaLinearVolumeItfImpl_Create");
+
+    if(self)
+    {
+        /* init itf default implementation */
+        self->itf.GetStepCount = XANokiaLinearVolumeItfImpl_GetStepCount;
+        self->itf.GetVolumeLevel = XANokiaLinearVolumeItfImpl_GetVolumeLevel;
+        self->itf.SetVolumeLevel = XANokiaLinearVolumeItfImpl_SetVolumeLevel;
+       	self->itf.RegisterVolumeCallback = XANokiaLinearVolumeItfImpl_RegisterVolumeCallback;        
+       	self->itf.SetCallbackEventsMask = XANokiaLinearVolumeItfImpl_SetCallbackEventsMask;
+       	self->itf.GetCallbackEventsMask = XANokiaLinearVolumeItfImpl_GetCallbackEventsMask;
+        /* init variables */
+        self->volumeLevel = 0;
+
+        self->adapCtx = adapCtx;
+
+        XAAdaptationBase_AddEventHandler( adapCtx, &XANokiaLinearVolumeItfImpl_AdaptCb, XA_NOKIALINEARVOLITFEVENTS, self );
+        
+        self->self = self;
+    }
+
+    DEBUG_API("<-XANokiaLinearVolumeItfImpl_Create");
+    return self;
+}
+
+/**
+ * void XANokiaLinearVolumeItfImpl_Free(XANokiaLinearVolumeItfImpl* self)
+ * Description: Free all resources reserved at XANokiaLinearVolumeItfImpl_Create
+ **/
+void XANokiaLinearVolumeItfImpl_Free(XANokiaLinearVolumeItfImpl* self)
+{
+    DEBUG_API("->XANokiaLinearVolumeItfImpl_Free");
+    assert(self==self->self);
+    free(self);
+    DEBUG_API("<-XANokiaLinearVolumeItfImpl_Free");
+}
+
+/* void XANokiaLinearVolumeItfimpl_AdaptCb( void *pHandlerCtx, XAAdaptEvent *event )
+ * Description: Event handler for adaptation events
+ */
+void XANokiaLinearVolumeItfImpl_AdaptCb( void *pHandlerCtx, XAAdaptEvent *event )
+{
+    XANokiaLinearVolumeItfImpl* impl =(XANokiaLinearVolumeItfImpl*)pHandlerCtx;
+    XAboolean eventBoolean = XA_BOOLEAN_FALSE;
+    
+    DEBUG_API("->XANokiaLinearVolumeItfimpl_AdaptCb");
+
+    if(!impl)
+    {
+        DEBUG_ERR("XANokiaLinearVolumeItfImpl_AdaptCb, invalid context pointer!");
+        DEBUG_API("<-XANokiaLinearVolumeItfImpl_AdaptCb");
+        return;
+    }
+    assert(event);
+
+    if( event->eventid == XA_ADAPT_VOLUME_VOLUME_CHANGED && impl->callback )
+    {
+        if(XA_NOKIALINEARVOLUME_EVENT_VOLUME_CHANGED & impl->eventFlags)
+            {
+            DEBUG_API("Volume level changed in adaptation"); 
+            impl->callback( impl->cbPtrToSelf, impl->context, XA_NOKIALINEARVOLUME_EVENT_VOLUME_CHANGED, eventBoolean );
+            }
+    }       
+    else
+    {
+        /* do nothing */
+    }
+    DEBUG_API("<-XANokiaLinearVolumeItfimpl_AdaptCb");
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/common/xanokiavolumeext_iid.c	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,15 @@
+/*
+ * Copyright goes here.
+ *
+ */
+
+
+#include "openmaxalwrapper.h"
+
+/*****************************************************************************/
+/* Interface IDs                                                             */
+/*****************************************************************************/
+/*ca2193c0-260e-11df-a99f-0002a5d5c51b*/
+static const struct XAInterfaceID_ XA_IID_NOKIAVOLUMEEXT_ = { 0xca2193c0, 0x260e, 0x11df, 0xa99f, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } };
+XA_API const XAInterfaceID XA_IID_NOKIAVOLUMEEXT = &XA_IID_NOKIAVOLUMEEXT_;
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/common/xanokiavolumeextitf.c	Fri May 14 16:22:35 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 "xanvolumeextitf.h"
+#include "xanokiavolumeextitfadaptationmmf.h"
+
+/**
+ * XANokiaVolumeExtItfImpl* GetImpl(XANokiaVolumeExtItf self)
+ * Description: Validated interface pointer and cast it to implementations pointer.
+ **/
+static XANokiaVolumeExtItfImpl* GetImpl(XANokiaVolumeExtItf self)
+{
+    if(self)
+    {
+        XANokiaVolumeExtItfImpl* impl = (XANokiaVolumeExtItfImpl*)(*self);
+        if(impl && impl == impl->self)
+        {
+            return impl;
+        }
+    }
+    return NULL;
+}
+
+/**
+ * XAresult XANokiaVolumeExtItfImpl_RegisterVolumeCallback(XANokiaVolumeExtItf self,
+ *                                               xaNokiaVolumeExtCallback callback,
+ *                                               void * pContext)
+ * Description: Sets or clears the xaVolumeCallback.
+ **/
+XAresult XANokiaVolumeExtItfImpl_RegisterVolumeCallback(XANokiaVolumeExtItf self,
+                                              xaNokiaVolumeExtCallback callback,
+                                              void * pContext)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XANokiaVolumeExtItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XANokiaVolumeExtItfImpl_RegisterVolumeCallback");
+
+    if(!impl)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XANokiaVolumeExtItfImpl_RegisterVolumeCallback");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    impl->callback = callback;
+    impl->context = pContext;
+    impl->cbPtrToSelf = self;
+
+    DEBUG_API("<-XANokiaVolumeExtItfImpl_RegisterVolumeCallback");
+    return ret;
+}
+
+/**
+ * Base interface XANokiaVolumeExtItf implementation
+ */
+
+/**
+ * XAresult XANokiaVolumeExtItfImpl_SetVolumeLevel(XANokiaVolumeExtItf self, XAmillibel level)
+ * Description: Sets the object's volume level.
+ **/
+XAresult XANokiaVolumeExtItfImpl_SetVolumeLevel(XANokiaVolumeExtItf self, XAmillibel level)
+{
+    XANokiaVolumeExtItfImpl *impl = GetImpl(self);
+    XAresult ret = XA_RESULT_SUCCESS;
+
+    XAmillibel maximumLevel = 0; 
+ 
+    DEBUG_API("->XANokiaVolumeExtItfImpl_SetVolumeLevel");
+
+    /* check maximum volume level */
+  	if(XANokiaVolumeExtItfImpl_GetMaxVolumeLevel(self, &maximumLevel) != XA_RESULT_SUCCESS)
+   	{
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XANokiaVolumeExtItfImpl_SetVolumeLevel");
+        /* cannot solve maximum volume level */
+        return XA_RESULT_PARAMETER_INVALID;
+   	}
+    
+    if(!impl || level > maximumLevel)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XANokiaVolumeExtItfImpl_SetVolumeLevel");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    impl->volumeLevel = level;
+
+    DEBUG_API("<-XANokiaVolumeExtItfImpl_SetVolumeLevel");
+    return ret ;
+}
+
+/**
+ * XAresult XANokiaVolumeExtItfImpl_GetVolumeLevel(XANokiaVolumeExtItf self, XAmillibel *pLevel)
+ * Description: Gets the object’s volume level.
+ **/
+XAresult XANokiaVolumeExtItfImpl_GetVolumeLevel(XANokiaVolumeExtItf self, XAmillibel *pLevel)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XANokiaVolumeExtItfImpl *impl = GetImpl(self);
+    DEBUG_API("->XANokiaVolumeExtItfImpl_GetVolumeLevel");
+
+    if(!impl || !pLevel)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XANokiaVolumeExtItfImpl_GetVolumeLevel");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pLevel = impl->volumeLevel;
+
+    DEBUG_API("<-XANokiaVolumeExtItfImpl_GetVolumeLevel");
+    return ret;
+}
+
+/**
+ * XAresult XANokiaVolumeExtItfImpl_GetMaxVolumeLevel(XANokiaVolumeExtItf  self, XAmillibel *pMaxLevel)
+ * Description: Gets the maximum supported level.
+ **/
+XAresult XANokiaVolumeExtItfImpl_GetMaxVolumeLevel(XANokiaVolumeExtItf  self, XAmillibel *pMaxLevel)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XANokiaVolumeExtItfImpl *impl = GetImpl(self);
+    DEBUG_API("->XANokiaVolumeExtItfImpl_GetVolumeLevel");
+
+    if(!impl || !pMaxLevel)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XANokiaVolumeExtItfImpl_GetMaxVolumeLevel");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pMaxLevel = MAX_SUPPORT_VOLUME_LEVEL;
+    
+    DEBUG_API("<-XANokiaVolumeExtItfImpl_GetMaxVolumeLevel");
+    return ret;
+}
+
+/**
+ * XAresult XANokiaVolumeExtItfImpl_SetMute(XANokiaVolumeExtItf self, XAboolean mute)
+ * Description: Mutes or unmutes the object.
+ **/
+XAresult XANokiaVolumeExtItfImpl_SetMute(XANokiaVolumeExtItf self, XAboolean mute)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XANokiaVolumeExtItfImpl *impl = GetImpl(self);
+    DEBUG_API("->XANokiaVolumeExtItfImpl_SetMute");
+
+    if(!impl)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XANokiaVolumeExtItfImpl_SetMute");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    ret = XAAdaptationBase_ThreadEntry(impl->adapCtx);
+    if( ret == XA_RESULT_PARAMETER_INVALID || ret == XA_RESULT_PRECONDITIONS_VIOLATED )
+    {
+        DEBUG_API("<-XANokiaVolumeExtItfImpl_SetMute");
+        return ret;
+    }
+    /* check is mute state changed */
+    if(mute != impl->mute)
+    {
+        if(impl->adapCtx->fwtype == FWMgrFWMMF)
+        {
+        ret = XANokiaVolumeExtItfAdapt_SetMute((XAAdaptationMMFCtx*)impl->adapCtx,  mute);
+        }
+
+        if(ret == XA_RESULT_SUCCESS)
+        {
+            impl->mute = mute;
+        }
+    }
+
+    XAAdaptationBase_ThreadExit(impl->adapCtx);
+    DEBUG_API("<-XANokiaVolumeExtItfImpl_SetMute");
+    return ret;
+}
+
+/**
+ * XAresult XANokiaVolumeExtItfImpl_GetMute(XANokiaVolumeExtItf self, XAboolean *pMute)
+ * Description: Retrieves the object's state.
+ **/
+XAresult XANokiaVolumeExtItfImpl_GetMute(XANokiaVolumeExtItf self, XAboolean *pMute)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XANokiaVolumeExtItfImpl *impl = GetImpl(self);
+    DEBUG_API("->XANokiaVolumeExtItfImpl_GetMute");
+
+    if(!impl || !pMute)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XANokiaVolumeExtItfImpl_GetMute");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pMute = impl->mute;
+
+    DEBUG_API("<-XANokiaVolumeExtItfImpl_GetMute");
+    return ret;
+}
+
+/**
+ * XAresult XANokiaVolumeExtItfImpl_EnableStereoPosition(XANokiaVolumeExtItf self, XAboolean enable)
+ * Description: Enables or disables the stereo positioning effect.
+ **/
+XAresult XANokiaVolumeExtItfImpl_EnableStereoPosition(XANokiaVolumeExtItf self, XAboolean enable)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XANokiaVolumeExtItfImpl *impl = GetImpl(self);
+    DEBUG_API("->XANokiaVolumeExtItfImpl_EnableStereoPosition");
+
+    if(!impl)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XANokiaVolumeExtItfImpl_EnableStereoPosition");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    ret = XAAdaptationBase_ThreadEntry(impl->adapCtx);
+    if( ret == XA_RESULT_PARAMETER_INVALID || ret == XA_RESULT_PRECONDITIONS_VIOLATED )
+    {
+        DEBUG_API("<-XANokiaVolumeExtItfImpl_EnableStereoPosition");
+        return ret;
+    }
+    /* Check is stereo position state changed */
+    if(enable != impl->enableStereoPos)
+    {
+        if(impl->adapCtx->fwtype == FWMgrFWMMF)
+        {
+        ret = XANokiaVolumeExtItfAdapt_EnableStereoPosition((XAAdaptationMMFCtx*)impl->adapCtx,
+                                                    enable);
+        }
+
+        if(ret == XA_RESULT_SUCCESS)
+        {
+            impl->enableStereoPos = enable;
+        }
+    }
+
+    XAAdaptationBase_ThreadExit(impl->adapCtx);
+    DEBUG_API("<-XANokiaVolumeExtItfImpl_EnableStereoPosition");
+    return ret;
+}
+
+/**
+ * XAresult XANokiaVolumeExtItfImpl_IsEnabledStereoPosition(XANokiaVolumeExtItf self,
+ *                                                  XAboolean *pEnable)
+ * Description: Returns the enabled state of the stereo positioning effect.
+ **/
+XAresult XANokiaVolumeExtItfImpl_IsEnabledStereoPosition(XANokiaVolumeExtItf self,
+                                                 XAboolean *pEnable)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XANokiaVolumeExtItfImpl *impl = GetImpl(self);
+    DEBUG_API("->XANokiaVolumeExtItfImpl_IsEnabledStereoPosition");
+
+    if(!impl || !pEnable)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XANokiaVolumeExtItfImpl_IsEnabledStereoPosition");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pEnable = impl->enableStereoPos;
+
+    DEBUG_API("<-XANokiaVolumeExtItfImpl_IsEnabledStereoPosition");
+    return ret;
+}
+
+/**
+ * XAresult XANokiaVolumeExtItfImpl_SetStereoPosition(XANokiaVolumeExtItf self,
+ *                                            XApermille stereoPosition)
+ * Description: Sets the stereo position of the object.
+ **/
+XAresult XANokiaVolumeExtItfImpl_SetStereoPosition(XANokiaVolumeExtItf self,
+                                           XApermille stereoPosition)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XANokiaVolumeExtItfImpl *impl = GetImpl(self);
+    DEBUG_API("->XANokiaVolumeExtItfImpl_SetStereoPosition");
+
+    if(!impl || (stereoPosition < STEREO_POSITION_LEFT) ||
+        (stereoPosition > STEREO_POSITION_RIGHT))
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XANokiaVolumeExtItfImpl_SetStereoPosition");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    impl->stereoPosition = stereoPosition;
+
+    ret = XAAdaptationBase_ThreadEntry(impl->adapCtx);
+    if( ret == XA_RESULT_PARAMETER_INVALID || ret == XA_RESULT_PRECONDITIONS_VIOLATED )
+    {
+        DEBUG_API("<-XANokiaVolumeExtItfImpl_SetStereoPosition");
+        return ret;
+    }
+    /* check is stereo position effect enabled if is then handle effect */
+    if(impl->enableStereoPos)
+    {
+    if(impl->adapCtx->fwtype == FWMgrFWMMF)
+        {
+        ret = XANokiaVolumeExtItfAdapt_SetStereoPosition((XAAdaptationMMFCtx*)impl->adapCtx,
+                                                 stereoPosition);
+        
+        }
+    }
+
+    XAAdaptationBase_ThreadExit(impl->adapCtx);
+    DEBUG_API("<-XANokiaVolumeExtItfImpl_SetStereoPosition");
+    return ret;
+}
+
+/**
+ * XAresult XANokiaVolumeExtItfImpl_GetStereoPosition(XANokiaVolumeExtItf self,
+ *                                            XApermille *pStereoPosition)
+ * Description: Gets the object’s stereo position setting.
+ **/
+XAresult XANokiaVolumeExtItfImpl_GetStereoPosition(XANokiaVolumeExtItf self,
+                                           XApermille *pStereoPosition)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XANokiaVolumeExtItfImpl *impl = GetImpl(self);
+    DEBUG_API("->XANokiaVolumeExtItfImpl_GetStereoPosition");
+
+    if(!impl || !pStereoPosition)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XANokiaVolumeExtItfImpl_GetStereoPosition");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pStereoPosition = impl->stereoPosition;
+
+    DEBUG_API("<-XANokiaVolumeExtItfImpl_GetStereoPosition");
+    return ret;
+}
+
+XAresult XANokiaVolumeExtItfImpl_SetCallbackEventsMask(XANokiaVolumeExtItf self, XAuint32 eventFlags )
+    {
+    XAresult ret = XA_RESULT_SUCCESS;
+    XANokiaVolumeExtItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XANokiaVolumeExtItfImpl_SetCallbackEventsMask");
+
+    if(!impl)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XANokiaVolumeExtItfImpl_SetCallbackEventsMask");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    impl->eventFlags = eventFlags;
+
+    DEBUG_API("<-XANokiaVolumeExtItfImpl_SetCallbackEventsMask");
+    return ret;    
+    }
+
+XAresult XANokiaVolumeExtItfImpl_GetCallbackEventsMask(XANokiaVolumeExtItf self, XAuint32 * pEventFlags)
+    {
+    XAresult ret = XA_RESULT_SUCCESS;
+    XANokiaVolumeExtItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XANokiaVolumeExtItfImpl_GetCallbackEventsMask");
+
+    if(!impl || !pEventFlags)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        DEBUG_API("<-XANokiaVolumeExtItfImpl_GetCallbackEventsMask");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    *pEventFlags = impl->eventFlags;
+
+    DEBUG_API("<-XANokiaVolumeExtItfImpl_GetCallbackEventsMask");
+    return ret;    
+    }
+
+
+/**
+ * XANokiaVolumeExtItfImpl -specific methods
+ **/
+
+/**
+ * XANokiaVolumeExtItfImpl* XANokiaVolumeExtItfImpl_Create()
+ * Description: Allocate and initialize VolumeItfImpl
+ **/
+XANokiaVolumeExtItfImpl* XANokiaVolumeExtItfImpl_Create(XAAdaptationBaseCtx *adapCtx )
+{
+    XANokiaVolumeExtItfImpl *self = (XANokiaVolumeExtItfImpl*)
+        calloc(1,sizeof(XANokiaVolumeExtItfImpl));
+    DEBUG_API("->XANokiaVolumeExtItfImpl_Create");
+
+    if(self)
+    {
+        /* init itf default implementation */
+        self->itf.EnableStereoPosition = XANokiaVolumeExtItfImpl_EnableStereoPosition;
+        self->itf.GetMaxVolumeLevel = XANokiaVolumeExtItfImpl_GetMaxVolumeLevel;
+        self->itf.GetMute = XANokiaVolumeExtItfImpl_GetMute;
+        self->itf.GetStereoPosition = XANokiaVolumeExtItfImpl_GetStereoPosition;
+        self->itf.GetVolumeLevel = XANokiaVolumeExtItfImpl_GetVolumeLevel;
+        self->itf.IsEnabledStereoPosition = XANokiaVolumeExtItfImpl_IsEnabledStereoPosition;
+        self->itf.SetMute = XANokiaVolumeExtItfImpl_SetMute;
+        self->itf.SetStereoPosition = XANokiaVolumeExtItfImpl_SetStereoPosition;
+        self->itf.SetVolumeLevel = XANokiaVolumeExtItfImpl_SetVolumeLevel;
+       	self->itf.RegisterVolumeCallback = XANokiaVolumeExtItfImpl_RegisterVolumeCallback;
+       	self->itf.SetCallbackEventsMask = XANokiaVolumeExtItfImpl_SetCallbackEventsMask;
+       	self->itf.GetCallbackEventsMask = XANokiaVolumeExtItfImpl_GetCallbackEventsMask;
+
+        /* init variables */
+        self->volumeLevel = 0;
+        self->mute = XA_BOOLEAN_FALSE;
+        self->enableStereoPos = XA_BOOLEAN_FALSE;
+        self->stereoPosition = STEREO_POSITION_CENTER;
+
+        self->adapCtx = adapCtx;
+
+        XAAdaptationBase_AddEventHandler(adapCtx, &XANokiaVolumeExtItfImpl_AdaptCb, XA_NOKIAEXTVOLITFEVENTS, self );
+        
+        self->self = self;
+    }
+
+    DEBUG_API("<-XANokiaVolumeExtItfImpl_Create");
+    return self;
+}
+
+/**
+ * void XANokiaVolumeExtItfImpl_Free(XANokiaVolumeExtItfImpl* self)
+ * Description: Free all resources reserved at XANokiaVolumeExtItfImpl_Create
+ **/
+void XANokiaVolumeExtItfImpl_Free(XANokiaVolumeExtItfImpl* self)
+{
+    DEBUG_API("->XANokiaVolumeExtItfImpl_Free");
+    assert(self==self->self);
+    free(self);
+    DEBUG_API("<-XANokiaVolumeExtItfImpl_Free");
+}
+
+/* void XANokiaVolumeExtItfimpl_AdaptCb( void *pHandlerCtx, XAAdaptEvent *event )
+ * Description: Event handler for adaptation events
+ */
+void XANokiaVolumeExtItfImpl_AdaptCb( void *pHandlerCtx, XAAdaptEvent *event )
+{
+    XANokiaVolumeExtItfImpl* impl =(XANokiaVolumeExtItfImpl*)pHandlerCtx;
+    XAboolean eventBoolean = XA_BOOLEAN_FALSE;
+    
+    DEBUG_API("->XANokiaVolumeExtItfimpl_AdaptCb");
+
+    if(!impl)
+    {
+        DEBUG_ERR("XANokiaVolumeExtItfImpl_AdaptCb, invalid context pointer!");
+        DEBUG_API("<-XANokiaVolumeExtItfImpl_AdaptCb");
+        return;
+    }
+    assert(event);
+    
+    if( event->eventid == XA_ADAPT_VOLUME_MUTE_CHANGED && impl->callback )
+    {
+        if(impl->eventFlags & XA_NOKIAVOLUMEEXT_EVENT_MUTE_CHANGED)
+            {
+            DEBUG_API("Mute Status  changed in adaptation");
+            eventBoolean = *(XAboolean*)event->data;    
+            impl->callback( impl->cbPtrToSelf, impl->context, XA_NOKIAVOLUMEEXT_EVENT_MUTE_CHANGED, eventBoolean  );
+            }
+    }
+       
+    else if (event->eventid == XA_ADAPT_VOLUME_VOLUME_CHANGED)
+    {
+        if(impl->eventFlags & XA_NOKIAVOLUMEEXT_EVENT_VOLUME_CHANGED)
+            {
+            DEBUG_API("Volume Status  changed in adaptation");
+            eventBoolean = *(XAboolean*)event->data;    
+            impl->callback( impl->cbPtrToSelf, impl->context, XA_NOKIAVOLUMEEXT_EVENT_VOLUME_CHANGED, eventBoolean  );
+            }
+    }
+    else if (event->eventid == XA_ADAPT_VULOME_STEREOPOSITION_CHANGED)
+    {
+        if(impl->eventFlags & XA_NOKIAVOLUMEEXT_EVENT_STEREO_POSITION_CHANGED)
+            {
+            DEBUG_API("StereoPosituin Status  changed in adaptation");
+            eventBoolean = *(XAboolean*)event->data;    
+            impl->callback( impl->cbPtrToSelf, impl->context, XA_NOKIAVOLUMEEXT_EVENT_STEREO_POSITION_CHANGED, eventBoolean  );
+            }
+    }
+    
+    DEBUG_API("<-XANokiaVolumeExtItfimpl_AdaptCb");
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/common/xanvolumeextitf.h	Fri May 14 16:22:35 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: 
+*
+*/
+
+#ifndef XANVOLUMEEXTITF_H
+#define XANVOLUMEEXTITF_H
+
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+#include "xaadptbasectx.h"
+
+/** 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
+
+/** TYPES **/
+
+/** ENUMERATIONS **/
+
+/** STRUCTURES **/
+/* Definition of XANokiaVolumeExtItf implementation */
+typedef struct XANokiaVolumeExtItfImpl_
+{
+    /* parent interface */
+    struct XANokiaVolumeExtItf_ itf;
+    /* pointer to self */
+    struct XANokiaVolumeExtItfImpl_* self;
+
+    XAmillibel volumeLevel;
+    XAboolean mute;
+    XAboolean enableStereoPos;
+    XApermille stereoPosition;
+    XAuint32   eventFlags;
+    XANokiaVolumeExtItf         cbPtrToSelf;
+    xaNokiaVolumeExtCallback    callback;
+    void               *context; 
+ 
+    /*Adaptation variables*/
+    XAAdaptationBaseCtx *adapCtx;
+
+} XANokiaVolumeExtItfImpl;
+
+/** METHODS **/
+
+/* Base interface XANokiaVolumeExtItf implementation */
+XAresult XANokiaVolumeExtItfImpl_SetVolumeLevel(XANokiaVolumeExtItf self, XAmillibel level);
+
+XAresult XANokiaVolumeExtItfImpl_GetVolumeLevel(XANokiaVolumeExtItf self, XAmillibel *pLevel);
+
+XAresult XANokiaVolumeExtItfImpl_GetMaxVolumeLevel(XANokiaVolumeExtItf self, XAmillibel *pMaxLevel);
+
+XAresult XANokiaVolumeExtItfImpl_SetMute(XANokiaVolumeExtItf self, XAboolean mute);
+
+XAresult XANokiaVolumeExtItfImpl_GetMute(XANokiaVolumeExtItf self, XAboolean *pMute);
+
+XAresult XANokiaVolumeExtItfImpl_EnableStereoPosition(XANokiaVolumeExtItf self, XAboolean enable);
+
+XAresult XANokiaVolumeExtItfImpl_IsEnabledStereoPosition(XANokiaVolumeExtItf self, XAboolean *pEnable);
+
+XAresult XANokiaVolumeExtItfImpl_SetStereoPosition(XANokiaVolumeExtItf self, XApermille stereoPosition);
+
+XAresult XANokiaVolumeExtItfImpl_GetStereoPosition(XANokiaVolumeExtItf self, XApermille *pStereoPosition);
+
+XAresult XANokiaVolumeExtItfImpl_RegisterVolumeCallback(XANokiaVolumeExtItf self,
+                                              xaNokiaVolumeExtCallback callback,
+                                              void * pContext);
+XAresult XANokiaVolumeExtItfImpl_SetCallbackEventsMask(XANokiaVolumeExtItf self, XAuint32 eventFlags );
+XAresult XANokiaVolumeExtItfImpl_GetCallbackEventsMask(XANokiaVolumeExtItf self, XAuint32 * pEventFlags);
+
+/* XANokiaVolumeExtItfImpl -specific methods */
+XANokiaVolumeExtItfImpl* XANokiaVolumeExtItfImpl_Create(XAAdaptationBaseCtx *adapCtx);
+void XANokiaVolumeExtItfImpl_Free(XANokiaVolumeExtItfImpl* self);
+void XANokiaVolumeExtItfImpl_AdaptCb( void *pHandlerCtx, XAAdaptEvent *event );
+
+#endif /* XANVOLUMEEXTITF_H */
--- a/khronosfws/openmax_al/src/common/xaobjectitf.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/common/xaobjectitf.c	Fri May 14 16:22:35 2010 +0300
@@ -482,25 +482,6 @@
     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)
 {
--- a/khronosfws/openmax_al/src/common/xaobjectitf.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/common/xaobjectitf.h	Fri May 14 16:22:35 2010 +0300
@@ -120,7 +120,6 @@
 /* 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);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/common/xaobjects.h	Fri May 14 16:22:35 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: 
+*
+*/
+/*All global definitions and declarations here */
+
+#ifndef XAOBJECTS_H
+#define XAOBJECTS_H
+
+#include "openmaxalwrapper.h"
+#include "xaframeworkmgr.h"
+#include "xaglobals.h"
+#include "xacapabilitiesmgr.h"
+
+/**
+ * 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(   FrameworkMap* mapper,
+                                                XACapabilities* capabilities,
+                                                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(    FrameworkMap* mapper,
+                                            XACapabilities* capabilities,
+                                            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(    FrameworkMap* mapper,
+                                        XACapabilities* capabilities,
+                                        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(FrameworkMap* mapper,
+                                                 XACapabilities* capabilities,
+                                                 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( FrameworkMap* mapper,
+                                                XACapabilities* capabilities,
+                                                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(   FrameworkMap* mapper,
+                                                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(   FrameworkMap* mapper,
+                                                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( FrameworkMap* mapper,
+                                                    XAObjectItf* pDevice,
+                                                    XAuint32 deviceID,
+                                                    XAuint32 numInterfaces,
+                                                    const XAInterfaceID * pInterfaceIds,
+                                                    const XAboolean * pInterfaceRequired);
+
+XAresult XALEDArrayDeviceImpl_QueryNumSupportedInterfaces(XAuint32 *pNumSupportedInterfaces);
+
+XAresult XALEDArrayDeviceImpl_QuerySupportedInterfaces(XAuint32 index,
+                                                    XAInterfaceID *pInterfaceId);
+
+
+#endif /*XAOBJECTS_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/common/xastreaminformationitf.c	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,439 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "xastreaminformationitf.h"
+#include "xastreaminformationitfadaptation.h"
+#include "xastreaminformationitfadaptationmmf.h"
+
+/* XAStreamInformationItfImpl* GetImpl
+ * Description: Validate interface pointer and cast it to implementation pointer.
+ */
+static XAStreamInformationItfImpl* GetImpl(XAStreamInformationItf self)
+{
+    if(self)
+    {
+        XAStreamInformationItfImpl* impl = (XAStreamInformationItfImpl*)(*self);
+        if(impl && impl == impl->self)
+        {
+            return impl;
+        }
+    }
+    return NULL;
+}
+
+/**
+ * Base interface XAPlayItf implementation
+ */
+
+
+XAresult XAStreamInformationItfImpl_QueryMediaContainerInformation(
+                XAStreamInformationItf self,
+                XAMediaContainerInformation * info)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAStreamInformationItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XAStreamInformationItfImpl_QueryMediaContainerInformation");
+    if(!impl || !info)
+    {
+        /* invalid parameter */
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("-<XAStreamInformationItfImpl_QueryMediaContainerInformation");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+
+    if(impl->adapCtx->fwtype == FWMgrFWGST)
+        {
+        ret = XAAdaptationBase_ThreadEntry(impl->adapCtx);
+        if( ret == XA_RESULT_PARAMETER_INVALID )
+        {
+            DEBUG_API("<-XAStreamInformationItfImpl_QueryMediaContainerInformation");
+            return ret;
+        }
+        ret = XAStreamInformationItfAdapt_QueryMediaContainerInformation(
+                    impl->adapCtx,
+                    &(info->containerType),
+                    &(info->mediaDuration),
+                    &(info->numStreams));
+        XAAdaptationBase_ThreadExit(impl->adapCtx);
+        }
+    else
+        {
+        ret = XAAdaptationBase_ThreadEntry(impl->adapCtx);
+        if( ret == XA_RESULT_PARAMETER_INVALID )
+        {
+            DEBUG_API("<-XAStreamInformationItfImpl_QueryMediaContainerInformation");
+            return ret;
+        }
+        ret = XAStreamInformationItfAdaptMMF_QueryMediaContainerInformation(
+                    impl->adapCtx,
+                    &(info->containerType),
+                    &(info->mediaDuration),
+                    &(info->numStreams));
+        XAAdaptationBase_ThreadExit(impl->adapCtx);;
+        }
+
+    DEBUG_API("-<XAStreamInformationItfImpl_QueryMediaContainerInformation");
+    return ret;
+}
+
+XAresult XAStreamInformationItfImpl_QueryStreamType(
+                XAStreamInformationItf self,
+                XAuint32 streamIndex, 
+                XAuint32 *domain)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAStreamInformationItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XAStreamInformationItfImpl_QueryStreamType");
+    if(!impl || !domain || (streamIndex == 0))
+    {
+        /* invalid parameter */
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("-<XAStreamInformationItfImpl_QueryStreamType");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    if(impl->adapCtx->fwtype == FWMgrFWGST)
+        {
+        ret = XAAdaptationBase_ThreadEntry(impl->adapCtx);
+        if( ret == XA_RESULT_PARAMETER_INVALID )
+        {
+            DEBUG_API("<-XAStreamInformationItfImpl_QueryStreamType");
+            return ret;
+        }
+    
+        ret = XAStreamInformationItfAdapt_QueryStreamType(
+                    impl->adapCtx,
+                    streamIndex,
+                    domain);
+    
+        XAAdaptationBase_ThreadExit(impl->adapCtx);
+        }
+    else
+        {
+        ret = XAAdaptationBase_ThreadEntry(impl->adapCtx);
+        if( ret == XA_RESULT_PARAMETER_INVALID )
+        {
+            DEBUG_API("<-XAStreamInformationItfImpl_QueryStreamType");
+            return ret;
+        }
+    
+        ret = XAStreamInformationItfAdaptMMF_QueryStreamType(
+                    impl->adapCtx,
+                    streamIndex,
+                    domain);
+    
+        XAAdaptationBase_ThreadExit(impl->adapCtx);;
+        }
+    DEBUG_API("-<XAStreamInformationItfImpl_QueryStreamType");
+    return ret;
+}
+
+XAresult XAStreamInformationItfImpl_QueryStreamInformation(
+                XAStreamInformationItf self, 
+                XAuint32 streamIndex,
+                void * info)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAStreamInformationItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XAStreamInformationItfImpl_QueryStreamInformation");
+    if(!impl || !info || (streamIndex == 0))
+    {
+        /* invalid parameter */
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("-<XAStreamInformationItfImpl_QueryStreamInformation");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if(impl->adapCtx->fwtype == FWMgrFWGST)
+        {
+        ret = XAAdaptationBase_ThreadEntry(impl->adapCtx);
+        if( ret == XA_RESULT_PARAMETER_INVALID )
+        {
+            DEBUG_API("<-XAStreamInformationItfImpl_QueryStreamInformation");
+            return ret;
+        }
+    
+        ret = XAStreamInformationItfAdapt_QueryStreamInformation(
+                    impl->adapCtx,
+                    streamIndex,
+                    info);
+    
+        XAAdaptationBase_ThreadExit(impl->adapCtx);
+        }
+    else
+        {
+        ret = XAAdaptationBase_ThreadEntry(impl->adapCtx);
+        if( ret == XA_RESULT_PARAMETER_INVALID )
+        {
+            DEBUG_API("<-XAStreamInformationItfImpl_QueryStreamInformation");
+            return ret;
+        }
+    
+        ret = XAStreamInformationItfAdaptMMF_QueryStreamInformation(
+                    impl->adapCtx,
+                    streamIndex,
+                    info);
+    
+        XAAdaptationBase_ThreadExit(impl->adapCtx);;
+        }
+
+    DEBUG_API("-<XAStreamInformationItfImpl_QueryStreamInformation");
+    return ret;
+}
+
+XAresult XAStreamInformationItfImpl_QueryStreamName(
+                XAStreamInformationItf self, 
+                XAuint32 streamIndex, 
+                XAuint16 * pNameSize,
+                XAchar * pName)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAStreamInformationItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XAStreamInformationItfImpl_QueryStreamName");
+    if(!impl || (streamIndex == 0) || !pNameSize)
+    {
+        /* invalid parameter */
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("-<XAStreamInformationItfImpl_QueryStreamName");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if(impl->adapCtx->fwtype == FWMgrFWGST)
+        {
+        ret = XAAdaptationBase_ThreadEntry(impl->adapCtx);
+        if( ret == XA_RESULT_PARAMETER_INVALID )
+        {
+            DEBUG_API("<-XAStreamInformationItfImpl_QueryStreamName");
+            return ret;
+        }
+    
+        ret = XAStreamInformationItfAdapt_QueryStreamName(
+                    impl->adapCtx,
+                    streamIndex,
+                    pNameSize,
+                    pName);
+    
+        XAAdaptationBase_ThreadExit(impl->adapCtx);
+        }
+    else
+        {
+        ret = XAAdaptationBase_ThreadEntry(impl->adapCtx);
+        if( ret == XA_RESULT_PARAMETER_INVALID )
+        {
+            DEBUG_API("<-XAStreamInformationItfImpl_QueryStreamName");
+            return ret;
+        }
+    
+        ret = XAStreamInformationItfAdaptMMF_QueryStreamName(
+                    impl->adapCtx,
+                    streamIndex,
+                    pNameSize,
+                    pName);
+    
+        XAAdaptationBase_ThreadExit(impl->adapCtx);;
+        }
+    DEBUG_API("-<XAStreamInformationItfImpl_QueryStreamName");
+    return ret;
+}
+
+XAresult XAStreamInformationItfImpl_RegisterStreamChangeCallback(
+                XAStreamInformationItf self,
+                xaStreamEventChangeCallback callback,
+                void * pContext)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAStreamInformationItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XAStreamInformationItfImpl_RegisterStreamChangeCallback");
+    if(!impl)
+    {
+        /* invalid parameter */
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("-<XAStreamInformationItfImpl_RegisterStreamChangeCallback");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* callback may be NULL (to remove callback) */
+    impl->callback = callback;
+    impl->cbcontext = pContext;
+    impl->cbPtrToSelf = self;
+
+    DEBUG_API("-<XAStreamInformationItfImpl_RegisterStreamChangeCallback");
+    return ret;
+}
+
+XAresult XAStreamInformationItfImpl_QueryActiveStreams(
+                XAStreamInformationItf self,
+                XAuint32 *numStreams,
+                XAboolean *activeStreams)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAStreamInformationItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XAStreamInformationItfImpl_QueryActiveStreams");
+    if(!impl || !numStreams)
+    {
+        /* invalid parameter */
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("-<XAStreamInformationItfImpl_QueryActiveStreams");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if(impl->adapCtx->fwtype == FWMgrFWGST)
+        {    
+        ret = XAAdaptationBase_ThreadEntry(impl->adapCtx);
+        if( ret == XA_RESULT_PARAMETER_INVALID )
+        {
+            DEBUG_API("<-XAStreamInformationItfImpl_QueryActiveStreams");
+            return ret;
+        }
+    
+        ret = XAStreamInformationItfAdapt_QueryActiveStreams(
+                    impl->adapCtx,
+                    numStreams,
+                    activeStreams);
+    
+        XAAdaptationBase_ThreadExit(impl->adapCtx);
+        }
+    else
+        {
+        ret = XAAdaptationBase_ThreadEntry(impl->adapCtx);
+        if( ret == XA_RESULT_PARAMETER_INVALID )
+        {
+            DEBUG_API("<-XAStreamInformationItfImpl_QueryActiveStreams");
+            return ret;
+        }
+    
+        ret = XAStreamInformationItfAdaptMMF_QueryActiveStreams(
+                    impl->adapCtx,
+                    numStreams,
+                    activeStreams);
+    
+        XAAdaptationBase_ThreadExit(impl->adapCtx);;
+        }
+
+    DEBUG_API("-<XAStreamInformationItfImpl_QueryActiveStreams");
+    return ret;
+}
+
+XAresult XAStreamInformationItfImpl_SetActiveStream(
+                XAStreamInformationItf self, 
+                XAuint32 streamNum,
+                XAboolean active, 
+                XAboolean commitNow)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAStreamInformationItfImpl* impl = GetImpl(self);
+    DEBUG_API("->XAStreamInformationItfImpl_SetActiveStream");
+    if(!impl)
+    {
+        /* invalid parameter */
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("-<XAStreamInformationItfImpl_SetActiveStream");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if(impl->adapCtx->fwtype == FWMgrFWGST)
+        {      
+        ret = XAAdaptationBase_ThreadEntry(impl->adapCtx);
+        if( ret == XA_RESULT_PARAMETER_INVALID )
+        {
+            DEBUG_API("<-XAStreamInformationItfImpl_SetActiveStream");
+            return ret;
+        }
+    
+        ret = XAStreamInformationItfAdapt_SetActiveStream(
+                    impl->adapCtx,
+                    streamNum,
+                    active, 
+                    commitNow);
+    
+        XAAdaptationBase_ThreadExit(impl->adapCtx);
+        }
+    else
+        {
+        ret = XAAdaptationBase_ThreadEntry(impl->adapCtx);
+        if( ret == XA_RESULT_PARAMETER_INVALID )
+        {
+            DEBUG_API("<-XAStreamInformationItfImpl_SetActiveStream");
+            return ret;
+        }
+    
+        ret = XAStreamInformationItfAdaptMMF_SetActiveStream(
+                    impl->adapCtx,
+                    streamNum,
+                    active, 
+                    commitNow);
+    
+        XAAdaptationBase_ThreadExit(impl->adapCtx);;
+        }
+
+    DEBUG_API("-<XAStreamInformationItfImpl_SetActiveStream");
+    return ret;
+}
+
+/**
+ * XAStreamInformationItfImpl -specific methods
+ **/
+
+/**
+ * XAStreamInformationItfImpl* XAStreamInformationItfImpl_Create()
+ * Description: Allocate and initialize PlayItfImpl
+ **/
+XAStreamInformationItfImpl* XAStreamInformationItfImpl_Create( XAAdaptationBaseCtx *adapCtx )
+{
+    XAStreamInformationItfImpl *self;
+
+    DEBUG_API("->XAStreamInformationItfImpl_Create");
+    self = (XAStreamInformationItfImpl*)calloc(1,sizeof(XAStreamInformationItfImpl));
+    if(self)
+    {
+        /* init itf default implementation */
+        self->itf.QueryMediaContainerInformation = XAStreamInformationItfImpl_QueryMediaContainerInformation;
+        self->itf.QueryStreamType = XAStreamInformationItfImpl_QueryStreamType;
+        self->itf.QueryStreamInformation = XAStreamInformationItfImpl_QueryStreamInformation;
+        self->itf.QueryStreamName = XAStreamInformationItfImpl_QueryStreamName;
+        self->itf.RegisterStreamChangeCallback = XAStreamInformationItfImpl_RegisterStreamChangeCallback;
+        self->itf.QueryActiveStreams = XAStreamInformationItfImpl_QueryActiveStreams;
+        self->itf.SetActiveStream = XAStreamInformationItfImpl_SetActiveStream;
+
+        /* init variables */
+        self->cbPtrToSelf = NULL;
+        self->callback = NULL;
+        self->cbcontext = NULL;
+        self->adapCtx = adapCtx;
+
+        self->self = self;
+    }
+
+    DEBUG_API("<-XAStreamInformationItfImpl_Create");
+    return self;
+}
+
+/* void XAStreamInformationItfImpl_Free(XAStreamInformationItfImpl* self)
+ * Description: Free all resources reserved at XAStreamInformationItfImpl_Create
+ */
+void XAStreamInformationItfImpl_Free(XAStreamInformationItfImpl* self)
+{
+    DEBUG_API("->XAStreamInformationItfImpl_Free");
+    assert(self==self->self);
+    free(self);
+    DEBUG_API("<-XAStreamInformationItfImpl_Free");
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/common/xastreaminformationitf.h	Fri May 14 16:22:35 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: 
+*
+*/
+
+
+#ifndef XASTREAMINFORMATIONITF_H
+#define XASTREAMINFORMATIONITF_H
+
+#include "openmaxalwrapper.h"
+#include "xaadptbasectx.h"
+
+/** MACROS **/
+
+/** TYPES **/
+
+/** ENUMERATIONS **/
+
+/** STRUCTURES **/
+/* Definition of XAStreamInformationItf implementation */
+typedef struct XAStreamInformationItfImpl_
+{
+    /* parent interface */
+    struct XAStreamInformationItf_ itf;
+    /* pointer to self */
+    struct XAStreamInformationItfImpl_* self;
+
+    /*Adaptation variables*/
+
+    XAStreamInformationItf cbPtrToSelf;
+    xaStreamEventChangeCallback  callback;
+    void *cbcontext;
+    XAAdaptationBaseCtx *adapCtx;
+
+} XAStreamInformationItfImpl;
+
+/** METHODS **/
+
+/* Base interface XAStreamInformationItf implementation */
+XAresult XAStreamInformationItfImpl_QueryMediaContainerInformation(
+                XAStreamInformationItf self,
+                XAMediaContainerInformation * info);
+
+XAresult XAStreamInformationItfImpl_QueryStreamType(
+                XAStreamInformationItf self,
+                XAuint32 streamIndex, 
+                XAuint32 *domain);
+
+XAresult XAStreamInformationItfImpl_QueryStreamInformation(
+                XAStreamInformationItf self, 
+                XAuint32 streamIndex,
+                void * info);
+
+XAresult XAStreamInformationItfImpl_QueryStreamName(
+                XAStreamInformationItf self, 
+                XAuint32 streamIndex, 
+                XAuint16 * pNameSize,
+                XAchar * pName);
+
+XAresult XAStreamInformationItfImpl_RegisterStreamChangeCallback(
+                XAStreamInformationItf self,
+                xaStreamEventChangeCallback callback,
+                void * pContext);
+
+XAresult XAStreamInformationItfImpl_QueryActiveStreams(
+                XAStreamInformationItf self,
+                XAuint32 *numStreams,
+                XAboolean *activeStreams);
+
+XAresult XAStreamInformationItfImpl_SetActiveStream(
+                XAStreamInformationItf self, 
+                XAuint32 streamNum,
+                XAboolean active, 
+                XAboolean commitNow);
+
+/* XAStreamInformationItfImpl -specific methods */
+XAStreamInformationItfImpl* XAStreamInformationItfImpl_Create(XAAdaptationBaseCtx *adapCtx);
+void XAStreamInformationItfImpl_Free(XAStreamInformationItfImpl* self);
+
+#endif /* XASTREAMINFORMATIONITF_H */
--- a/khronosfws/openmax_al/src/common/xavideopostprocessingitf.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/common/xavideopostprocessingitf.c	Fri May 14 16:22:35 2010 +0300
@@ -19,9 +19,9 @@
 #include <stdlib.h>
 #include <assert.h>
 #include "xavideopostprocessingitf.h"
-#ifdef _GSTREAMER_BACKEND_  
-#include "XAVideoPostProsessingItfAdaptation.h"
-#endif
+ 
+#include "xavideopostprosessingitfadaptation.h"
+
 /**
  * XAVideoPostProcessingItfImpl* GetImpl(XAVideoPostProcessingItf self)
  * Description: Validated interface pointer and cast it to implementations pointer.
@@ -106,15 +106,15 @@
         /* invalid parameter */
         return XA_RESULT_PARAMETER_INVALID;
     }
-#ifdef _GSTREAMER_BACKEND_  
-    ret = XAVideoPostProcessingItfAdapt_ThreadEntry(impl->adapCtx);
+ 
+    ret = XAAdaptationBase_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,
+    ret = XAVideoPostProcessingItfAdapt_IsArbitraryRotationSupported((XAAdaptationGstCtx*)impl->adapCtx,
                                                                      pSupported);
 
     if(ret == XA_RESULT_SUCCESS)
@@ -122,8 +122,8 @@
         impl->supported = *pSupported;
     }
 
-    XAVideoPostProcessingItfAdapt_ThreadExit(impl->adapCtx);
-#endif
+    XAAdaptationBase_ThreadExit(impl->adapCtx);
+
     DEBUG_API("<-XAVideoPostProcessingItfImpl_IsArbitraryRotationSupported");
     return ret;
 }
@@ -264,15 +264,15 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_  
-    ret = XAVideoPostProcessingItfAdapt_ThreadEntry(impl->adapCtx);
+ 
+    ret = XAAdaptationBase_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,
+    ret = XAVideoPostProcessingItfAdapt_Commit((XAAdaptationGstCtx*)impl->adapCtx,
                                                impl->rotation,
                                                impl->scaleOptions,
                                                impl->backgroundColor,
@@ -295,8 +295,8 @@
 		impl->isScaleOptions = XA_BOOLEAN_FALSE;
     }
 
-    XAVideoPostProcessingItfAdapt_ThreadExit(impl->adapCtx);
-#endif    
+    XAAdaptationBase_ThreadExit(impl->adapCtx);
+  
     DEBUG_API("<-XAVideoPostProcessingItfImpl_Commit");
     return ret;
 }
@@ -304,8 +304,6 @@
 /**
  * XAVideoPostProcessingItfImpl -specific methods
  **/
-#ifdef _GSTREAMER_BACKEND_  
-
 /**
  * XAVideoPostProcessingItfImpl* XAVideoPostProcessingItfImpl_Create()
  * @return  XAVideoPostProcessingItfImpl* - Pointer to  VideoPostProcessingItf interface implementation
@@ -347,7 +345,7 @@
     DEBUG_API("<-XAVideoPostProcessingItfImpl_Create");
     return self;
 }
-#endif
+
 /**
  * void XAVideoPostProcessingItfImpl_Free(XAVideoPostProcessingItfImpl* self);
  * @param  XAVideoPostProcessingItfImpl* self -
--- a/khronosfws/openmax_al/src/common/xavideopostprocessingitf.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/common/xavideopostprocessingitf.h	Fri May 14 16:22:35 2010 +0300
@@ -18,11 +18,8 @@
 #ifndef XAVIDEOPOSTPROCESSINGITF_H
 #define XAVIDEOPOSTPROCESSINGITF_H
 
-#include "openmaxalwrapper.h"
-#include "xaglobals.h"
-#ifdef _GSTREAMER_BACKEND_   
-#include "XAAdaptationContextBase.h"
-#endif
+#include "xaadptbasectx.h"
+
 /** MACROS **/
 
 /** TYPES **/
@@ -52,10 +49,10 @@
     XAboolean		isDestRect;
     XAboolean		isSrcRect;
     XAboolean		isScaleOptions;
-#ifdef _GSTREAMER_BACKEND_   
+
     /*Adaptation variables*/
     XAAdaptationBaseCtx *adapCtx;
-#endif
+
 } XAVideoPostProcessingItfImpl;
 
 /** METHODS **/
@@ -82,12 +79,9 @@
                                                 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 */
--- a/khronosfws/openmax_al/src/common/xavolumeitf.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/common/xavolumeitf.c	Fri May 14 16:22:35 2010 +0300
@@ -20,9 +20,9 @@
 #include <assert.h>
 
 #include "xavolumeitf.h"
-#ifdef _GSTREAMER_BACKEND_  
-#include "XAVolumeItfAdaptation.h"
-#endif
+ 
+#include "xavolumeitfadaptation.h"
+#include "xanokiavolumeextitfadaptationmmf.h"
 /**
  * XAVolumeItfImpl* GetImpl(XAVolumeItf self)
  * Description: Validated interface pointer and cast it to implementations pointer.
@@ -73,23 +73,29 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_  
-    ret = XAVolumeItfAdapt_ThreadEntry(impl->adapCtx);
+ 
+    ret = XAAdaptationBase_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(impl->adapCtx->fwtype == FWMgrFWGST)
+        {
+        ret = XAVolumeItfAdapt_SetVolumeLevel((XAAdaptationGstCtx*)impl->adapCtx,  level);
+        }
+    else
+        {
+        impl->volumeLevel = level;
+        }
+    
     if(ret == XA_RESULT_SUCCESS)
     {
         impl->volumeLevel = level;
     }
 
-    XAVolumeItfAdapt_ThreadExit(impl->adapCtx);
-#endif
+    XAAdaptationBase_ThreadExit(impl->adapCtx);
+
     DEBUG_API("<-XAVolumeItfImpl_SetVolumeLevel");
     return ret ;
 }
@@ -136,18 +142,25 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_  
-    ret = XAVolumeItfAdapt_ThreadEntry(impl->adapCtx);
+ 
+    ret = XAAdaptationBase_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);
+    if(impl->adapCtx->fwtype == FWMgrFWGST)
+        {
+        ret = XAVolumeItfAdapt_GetMaxVolumeLevel((XAAdaptationGstCtx*)impl->adapCtx,
+                                                 pMaxLevel);
+        }
+    else
+        {
+        *pMaxLevel = MAX_SUPPORT_VOLUME_LEVEL;
+        }
 
-    XAVolumeItfAdapt_ThreadExit(impl->adapCtx);
-#endif
+    XAAdaptationBase_ThreadExit(impl->adapCtx);
+
     DEBUG_API("<-XAVolumeItfImpl_GetMaxVolumeLevel");
     return ret;
 }
@@ -170,8 +183,8 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_  
-    ret = XAVolumeItfAdapt_ThreadEntry(impl->adapCtx);
+ 
+    ret = XAAdaptationBase_ThreadEntry(impl->adapCtx);
     if( ret == XA_RESULT_PARAMETER_INVALID || ret == XA_RESULT_PRECONDITIONS_VIOLATED )
     {
         DEBUG_API("<-XAVolumeItfImpl_SetMute");
@@ -180,7 +193,14 @@
     /* check is mute state changed */
     if(mute != impl->mute)
     {
-        ret = XAVolumeItfAdapt_SetMute(impl->adapCtx,  mute);
+        if(impl->adapCtx->fwtype == FWMgrFWMMF)
+            {
+            ret = XANokiaVolumeExtItfAdapt_SetMute((XAAdaptationMMFCtx*)impl->adapCtx,  mute);
+            }
+        else
+            {
+            ret = XAVolumeItfAdapt_SetMute((XAAdaptationGstCtx*)impl->adapCtx,  mute);
+            }
 
         if(ret == XA_RESULT_SUCCESS)
         {
@@ -188,8 +208,8 @@
         }
     }
 
-    XAVolumeItfAdapt_ThreadExit(impl->adapCtx);
-#endif
+    XAAdaptationBase_ThreadExit(impl->adapCtx);
+
     DEBUG_API("<-XAVolumeItfImpl_SetMute");
     return ret;
 }
@@ -236,8 +256,8 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_  
-    ret = XAVolumeItfAdapt_ThreadEntry(impl->adapCtx);
+ 
+    ret = XAAdaptationBase_ThreadEntry(impl->adapCtx);
     if( ret == XA_RESULT_PARAMETER_INVALID || ret == XA_RESULT_PRECONDITIONS_VIOLATED )
     {
         DEBUG_API("<-XAVolumeItfImpl_EnableStereoPosition");
@@ -246,17 +266,24 @@
     /* Check is stereo position state changed */
     if(enable != impl->enableStereoPos)
     {
-        ret = XAVolumeItfAdapt_EnableStereoPosition(impl->adapCtx,
+    if(impl->adapCtx->fwtype == FWMgrFWGST)
+        {
+        ret = XAVolumeItfAdapt_EnableStereoPosition((XAAdaptationGstCtx*)impl->adapCtx,
                                                     enable);
-
+        }
+    else
+        {
+        ret = XANokiaVolumeExtItfAdapt_EnableStereoPosition((XAAdaptationMMFCtx*)impl->adapCtx,
+                                                    enable);    
+        }
         if(ret == XA_RESULT_SUCCESS)
         {
             impl->enableStereoPos = enable;
         }
     }
 
-    XAVolumeItfAdapt_ThreadExit(impl->adapCtx);
-#endif
+    XAAdaptationBase_ThreadExit(impl->adapCtx);
+
     DEBUG_API("<-XAVolumeItfImpl_EnableStereoPosition");
     return ret;
 }
@@ -310,8 +337,8 @@
 
     impl->stereoPosition = stereoPosition;
 
-#ifdef _GSTREAMER_BACKEND_  
-    ret = XAVolumeItfAdapt_ThreadEntry(impl->adapCtx);
+ 
+    ret = XAAdaptationBase_ThreadEntry(impl->adapCtx);
     if( ret == XA_RESULT_PARAMETER_INVALID || ret == XA_RESULT_PRECONDITIONS_VIOLATED )
     {
         DEBUG_API("<-XAVolumeItfImpl_SetStereoPosition");
@@ -320,12 +347,20 @@
     /* check is stereo position effect enabled if is then handle effect */
     if(impl->enableStereoPos)
     {
-        ret = XAVolumeItfAdapt_SetStereoPosition(impl->adapCtx,
+    if(impl->adapCtx->fwtype == FWMgrFWGST)
+        {
+        ret = XAVolumeItfAdapt_SetStereoPosition((XAAdaptationGstCtx*)impl->adapCtx,
                                                  stereoPosition);
+        }
+    else
+        {
+        ret = XANokiaVolumeExtItfAdapt_SetStereoPosition((XAAdaptationMMFCtx*)impl->adapCtx,
+                                                 stereoPosition);    
+        }
     }
 
-    XAVolumeItfAdapt_ThreadExit(impl->adapCtx);
-#endif
+    XAAdaptationBase_ThreadExit(impl->adapCtx);
+
     DEBUG_API("<-XAVolumeItfImpl_SetStereoPosition");
     return ret;
 }
@@ -359,7 +394,7 @@
 /**
  * XAVolumeItfImpl -specific methods
  **/
-#ifdef _GSTREAMER_BACKEND_  
+
 
 /**
  * XAVolumeItfImpl* XAVolumeItfImpl_Create()
@@ -398,7 +433,7 @@
     DEBUG_API("<-XAVolumeItfImpl_Create");
     return self;
 }
-#endif
+
 /**
  * void XAVolumeItfImpl_Free(XAVolumeItfImpl* self)
  * Description: Free all resources reserved at XAVolumeItfImpl_Create
--- a/khronosfws/openmax_al/src/common/xavolumeitf.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/common/xavolumeitf.h	Fri May 14 16:22:35 2010 +0300
@@ -18,24 +18,9 @@
 #ifndef XAVOLUMEITF_H
 #define XAVOLUMEITF_H
 
-#include "openmaxalwrapper.h"
-#include "xaglobals.h"
-#ifdef _GSTREAMER_BACKEND_  
-#include "XAAdaptationContextBase.h"
-#endif
-/** MACROS **/
+#include "xaadptbasectx.h"
 
-/* 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
+/** MACROS **/
 
 /** TYPES **/
 
@@ -54,10 +39,8 @@
     XAboolean mute;
     XAboolean enableStereoPos;
     XApermille stereoPosition;
-#ifdef _GSTREAMER_BACKEND_  
     /*Adaptation variables*/
     XAAdaptationBaseCtx *adapCtx;
-#endif
 } XAVolumeItfImpl;
 
 /** METHODS **/
@@ -81,10 +64,9 @@
 
 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 */
--- a/khronosfws/openmax_al/src/engine/xaaudiodecodercapabilitiesitf.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/engine/xaaudiodecodercapabilitiesitf.c	Fri May 14 16:22:35 2010 +0300
@@ -21,10 +21,9 @@
 #include <string.h>
 
 #include "xaglobals.h"
+#include "xaadptbasectx.h"
 #include "xaaudiodecodercapabilitiesitf.h"
-#ifdef _GSTREAMER_BACKEND_  
-#include "XAStaticCapsAdaptation.h"
-#endif
+#include "xacapabilitiesmgr.h"
 /* XAAudioDecoderCapabilitiesItfImpl* GetImpl
  * Description: Validate interface pointer and cast it to implementation pointer.
  */
@@ -74,16 +73,16 @@
             }
             else
             {
-#ifdef _GSTREAMER_BACKEND_  
+ 
             XAuint32 i = 0;
-            XAStaticCapsData temp;
+            XACapabilities temp;
                 for( i=0; i<impl->numCodecs; i++ )
                 {
                     /* query decoder id from adaptation using index value */
-                    XAStaticCapsAdapt_GetCapsByIdx(XACAP_DECODER|XACAP_AUDIO, i, &temp);
+                    XACapabilitiesMgr_GetCapsByIdx(NULL, (XACapsType)(XACAP_DECODER|XACAP_AUDIO), i, &temp);
                     pDecoderIds[i] = temp.xaid;
                 }
-#endif
+
             }
         }
         /* return number of decoders */
@@ -127,30 +126,31 @@
             }
             else
             {
-#ifdef _GSTREAMER_BACKEND_  
+ 
                 /* query capabilities from adaptation using codec id */
-                XAStaticCapsData temp;
+                XACapabilities temp;
                 memset(pDescriptor,0,sizeof(XAAudioCodecDescriptor));
-                res = XAStaticCapsAdapt_GetCapsById(XACAP_DECODER|XACAP_AUDIO, decoderId, &temp);
+                res = XACapabilitiesMgr_GetCapsById(NULL, (XACapsType)(XACAP_DECODER|XACAP_AUDIO), decoderId, &temp);
                 if( res == XA_RESULT_SUCCESS )
                 {
+                    XAAudioCodecDescriptor* desc = ((XAAudioCodecDescriptor*)(temp.pEntry));
                     /* map applicable values to XAAudioCodecCapabilities */
-                    pDescriptor->maxChannels=temp.maxCh;
-                    pDescriptor->minSampleRate=temp.minSR*1000; /* milliHz */
-                    if (temp.maxSR < (0xFFFFFFFF / 1000))
+                    pDescriptor->maxChannels = desc->maxChannels;
+                    pDescriptor->minSampleRate= desc->minSampleRate*1000; /* milliHz */
+                    if (desc->maxSampleRate < (0xFFFFFFFF / 1000))
                     {
-                        pDescriptor->maxSampleRate = temp.maxSR*1000;
+                        pDescriptor->maxSampleRate = desc->maxSampleRate*1000;
                     }
                     else
                     {
                         pDescriptor->maxSampleRate = 0xFFFFFFFF;
                     }
-                    pDescriptor->minBitsPerSample=temp.minBPS;
-                    pDescriptor->maxBitsPerSample=temp.maxBPS;
+                    pDescriptor->minBitsPerSample=desc->minBitsPerSample;
+                    pDescriptor->maxBitsPerSample=desc->maxBitsPerSample;
                     pDescriptor->isFreqRangeContinuous=XA_BOOLEAN_TRUE;
-                    pDescriptor->minBitRate=temp.minBR;
-                    pDescriptor->maxBitRate=temp.maxBR;
-                    pDescriptor->numBitratesSupported = temp.numBitrates;
+                    pDescriptor->minBitRate=desc->minBitRate;
+                    pDescriptor->maxBitRate=desc->maxBitRate;
+                    pDescriptor->numBitratesSupported = desc->numBitratesSupported;
                     pDescriptor->isBitrateRangeContinuous=XA_BOOLEAN_TRUE;
                     if (temp.xaid == XA_AUDIOCODEC_PCM )
                     {
@@ -159,7 +159,7 @@
                     }
                     else if (temp.xaid == XA_ADAPTID_VORBIS) /* for ogg */
                     {
-                        if (temp.maxCh == 1)
+                        if (desc->maxChannels == 1)
                         {
                             pDescriptor->profileSetting=XA_AUDIOPROFILE_MPEG1_L3;
                             pDescriptor->modeSetting=XA_AUDIOCHANMODE_MP3_MONO;
@@ -176,7 +176,7 @@
                     }
                     /*other caps undefined*/
                 }
-#endif                
+                
             }
         }
     }
@@ -209,10 +209,10 @@
             XAAudioDecoderCapabilitiesItfImpl_GetAudioDecoderCapabilities;
 
         /* init variables */
-#ifdef _GSTREAMER_BACKEND_  
-        assert( XAStaticCapsAdapt_GetCapsCount( XACAP_DECODER|XACAP_AUDIO,
+ 
+        assert( XACapabilitiesMgr_GetCapsCount(NULL, (XACapsType)(XACAP_DECODER|XACAP_AUDIO),
                                   &(self->numCodecs) ) == XA_RESULT_SUCCESS );
-#endif
+
         self->self = self;
     }
     DEBUG_API("<-XAAudioDecoderCapabilitiesItfImpl_Create");
--- a/khronosfws/openmax_al/src/engine/xaaudioencodercapabilitiesitf.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/engine/xaaudioencodercapabilitiesitf.c	Fri May 14 16:22:35 2010 +0300
@@ -21,10 +21,10 @@
 #include <string.h>
 
 #include "xaglobals.h"
+#include "xaadptbasectx.h"
 #include "xaaudioencodercapabilitiesitf.h"
-#ifdef _GSTREAMER_BACKEND_  
-#include "XAStaticCapsAdaptation.h"
-#endif
+#include "xacapabilitiesmgr.h"
+
 /* XAAudioEncoderCapabilitiesItfImpl* GetImpl
  * Description: Validate interface pointer and cast it to implementation pointer.
  */
@@ -73,16 +73,16 @@
             }
             else
             {
-#ifdef _GSTREAMER_BACKEND_  
+  
                 XAuint32 i = 0;
-                XAStaticCapsData temp;
+                XACapabilities temp;
                 for( i=0; i<impl->numCodecs; i++ )
                 {
                     /* query encoder id from adaptation using index value */
-                    XAStaticCapsAdapt_GetCapsByIdx(XACAP_ENCODER|XACAP_AUDIO, i, &temp);
+                    XACapabilitiesMgr_GetCapsByIdx(impl->capslist, (XACapsType)(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;
@@ -108,9 +108,9 @@
     XAAudioEncoderCapabilitiesItfImpl* impl = GetImpl(self);
     XAresult res = XA_RESULT_SUCCESS;
 
-#ifdef _GSTREAMER_BACKEND_  
-    XAStaticCapsData temp;
-#endif
+  
+    XACapabilities temp;
+
     DEBUG_API("->XAAudioEncoderCapabilitiesItfImpl_GetAudioEncoderCapabilities");
 
     /*if( !impl || !pIndex || !pDescriptor )*/
@@ -236,53 +236,54 @@
         }
     
     
-#ifdef _GSTREAMER_BACKEND_  
-    res = XAStaticCapsAdapt_GetCapsById(XACAP_ENCODER|XACAP_AUDIO, encoderId, &temp);
+  
+    res = XACapabilitiesMgr_GetCapsById(impl->capslist, (XACapsType)(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))
+      XAAudioCodecDescriptor* desc = ((XAAudioCodecDescriptor*)(temp.pEntry));
+      /* map applicable values to XAAudioCodecCapabilities */
+      pDescriptor->maxChannels = desc->maxChannels;
+      pDescriptor->minSampleRate= desc->minSampleRate*1000; /* milliHz */
+      if (desc->maxSampleRate < (0xFFFFFFFF / 1000))
       {
-      	pDescriptor->maxSampleRate = temp.maxSR*1000;
+          pDescriptor->maxSampleRate = desc->maxSampleRate*1000;
       }
       else
       {
-    		pDescriptor->maxSampleRate = 0xFFFFFFFF;
-   		}
-      pDescriptor->minBitsPerSample=temp.minBPS;
-      pDescriptor->maxBitsPerSample=temp.maxBPS;
+          pDescriptor->maxSampleRate = 0xFFFFFFFF;
+      }
+      pDescriptor->minBitsPerSample=desc->minBitsPerSample;
+      pDescriptor->maxBitsPerSample=desc->maxBitsPerSample;
       pDescriptor->isFreqRangeContinuous=XA_BOOLEAN_TRUE;
-      pDescriptor->minBitRate=temp.minBR;
-    	pDescriptor->maxBitRate=temp.maxBR;
-      pDescriptor->numBitratesSupported = temp.numBitrates;
+      pDescriptor->minBitRate=desc->minBitRate;
+      pDescriptor->maxBitRate=desc->maxBitRate;
+      pDescriptor->numBitratesSupported = desc->numBitratesSupported;
       pDescriptor->isBitrateRangeContinuous=XA_BOOLEAN_TRUE;
-      
       if (temp.xaid == XA_AUDIOCODEC_PCM )
       {
-     		pDescriptor->profileSetting=XA_AUDIOPROFILE_PCM;
-        pDescriptor->modeSetting=0;
+          pDescriptor->profileSetting=XA_AUDIOPROFILE_PCM;
+          pDescriptor->modeSetting=0; /* no chanmode for pcm defined */
       }
-    	else if (temp.xaid == XA_ADAPTID_VORBIS) /* for ogg */
+      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;
-        }
+          if (desc->maxChannels == 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 */
+          /* do nothing */
       }
+      
     }
-#endif   	
+   	
     DEBUG_API("<-XAAudioEncoderCapabilitiesItfImpl_GetAudioEncoderCapabilities");
     return res;
 }
@@ -295,7 +296,7 @@
 /* XAAudioEncoderCapabilitiesItfImpl_Create
  * Description: Allocate and initialize XAAudioEncoderCapabilitiesItfImpl
  */
-XAAudioEncoderCapabilitiesItfImpl* XAAudioEncoderCapabilitiesItfImpl_Create()
+XAAudioEncoderCapabilitiesItfImpl* XAAudioEncoderCapabilitiesItfImpl_Create(XACapabilities* caps)
 {
     XAAudioEncoderCapabilitiesItfImpl* self = (XAAudioEncoderCapabilitiesItfImpl*)
         calloc(1,sizeof(XAAudioEncoderCapabilitiesItfImpl));
@@ -309,12 +310,12 @@
             XAAudioEncoderCapabilitiesItfImpl_GetAudioEncoders;
         self->itf.GetAudioEncoderCapabilities =
             XAAudioEncoderCapabilitiesItfImpl_GetAudioEncoderCapabilities;
-
-#ifdef _GSTREAMER_BACKEND_  
+        self->capslist = caps;
+  
         /* init variables */
-        assert( XAStaticCapsAdapt_GetCapsCount( XACAP_ENCODER|XACAP_AUDIO,
+        assert( XACapabilitiesMgr_GetCapsCount( caps, (XACapsType)((XACapsType)(XACAP_ENCODER|XACAP_AUDIO)),
                                   &(self->numCodecs) ) == XA_RESULT_SUCCESS );
-#endif
+
         /*self->mmfEngine = (void*)mmf_capability_engine_init();*/
         self->numCodecs = 3;
         self->self = self;
--- a/khronosfws/openmax_al/src/engine/xaaudioencodercapabilitiesitf.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/engine/xaaudioencodercapabilitiesitf.h	Fri May 14 16:22:35 2010 +0300
@@ -20,7 +20,7 @@
 
 #include "openmaxalwrapper.h"
 #include "xaglobals.h"
-
+#include "xacapabilitiesmgr.h"
 /** MACROS **/
 
 /** TYPES **/
@@ -40,6 +40,7 @@
     XAmilliHertz sampleRateArray[10];
     XAuint32 bitRateArray[10];
     void* mmfEngine;
+    XACapabilities* capslist;
 } XAAudioEncoderCapabilitiesItfImpl;
 
 /* Base interface XAAudioEncoderCapabilitiesItf implementation */
@@ -55,7 +56,7 @@
                             XAAudioCodecDescriptor* pCapabilities);
 
 /* XAAudioEncoderCapabilitiesItfImpl -specific methods */
-XAAudioEncoderCapabilitiesItfImpl* XAAudioEncoderCapabilitiesItfImpl_Create(void);
+XAAudioEncoderCapabilitiesItfImpl* XAAudioEncoderCapabilitiesItfImpl_Create(XACapabilities* caps);
 void XAAudioEncoderCapabilitiesItfImpl_Free(XAAudioEncoderCapabilitiesItfImpl* self);
 
 #endif /* XAAUDIOENCODERCAPABILITIESITF_H */
--- a/khronosfws/openmax_al/src/engine/xaaudioiodevicecapabilitiesitf.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/engine/xaaudioiodevicecapabilitiesitf.c	Fri May 14 16:22:35 2010 +0300
@@ -22,9 +22,8 @@
 
 #include "xaglobals.h"
 #include "xaaudioiodevicecapabilitiesitf.h"
-#ifdef _GSTREAMER_BACKEND_
-#include "XAStaticCapsAdaptation.h"
-#endif
+#include "xacapabilitiesmgr.h"
+
 
 static XAchar deviceName1[] = "Default Mic";
 
@@ -76,17 +75,15 @@
             }
             else
             {
-
-#ifdef _GSTREAMER_BACKEND_
                 XAuint32 i;
-                XAStaticCapsData temp;
+                XACapabilities 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);
+                    res = XACapabilitiesMgr_GetCapsByIdx(impl->capslist, (XACapsType)(XACAP_DEVSRC|XACAP_AUDIO), i, &temp);
                     pInputDeviceIDs[i] = temp.xaid;
                 }
-#endif
+
                 pInputDeviceIDs[0] = 0xAD7E5001;
             }
         }
@@ -105,6 +102,7 @@
                                             XAAudioInputDescriptor* pDescriptor)
 {
     XAAudIODevCapaItfImpl* impl = GetImpl(self);
+    XACapabilities temp;
     XAresult res = XA_RESULT_SUCCESS;
     DEBUG_API("->XAAudIODevCapaItfImpl_QueryAudioInputCapabilities");
 
@@ -116,19 +114,20 @@
     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);
+        res = XACapabilitiesMgr_GetCapsById(impl->capslist, (XACapsType)(XACAP_DEVSRC|XACAP_AUDIO), deviceId, &temp);
         if( res == XA_RESULT_SUCCESS )
         {
+            XAAudioInputDescriptor* desc = ((XAAudioInputDescriptor*)(temp.pEntry));
             /* map applicable values to XAAudioCodecCapabilities */
-            pDescriptor->maxChannels=temp.maxCh;
-            pDescriptor->minSampleRate=temp.minSR*1000; /* milliHz */
-            if (temp.maxSR < (0xFFFFFFFF / 1000))
+            pDescriptor->maxChannels=desc->maxChannels;
+            pDescriptor->minSampleRate=desc->minSampleRate*1000; /* milliHz */
+            if (desc->maxSampleRate < (0xFFFFFFFF / 1000))
             {
-                pDescriptor->maxSampleRate = temp.maxSR*1000;
+                pDescriptor->maxSampleRate = desc->maxSampleRate*1000;
             }
             else
             {
@@ -141,7 +140,7 @@
             pDescriptor->deviceName = temp.adaptId;
             /* other caps undefined */
         }
-#endif
+
         switch (deviceId)
                 {
                 case 0xAD7E5001:
@@ -242,16 +241,16 @@
             else
             {
 
-#ifdef _GSTREAMER_BACKEND_
+
                 XAuint32 i = 0;
-                XAStaticCapsData temp;
+                XACapabilities 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);
+                    res = XACapabilitiesMgr_GetCapsByIdx(impl->capslist, (XACapsType)(XACAP_DEVSNK|XACAP_AUDIO), i, &temp);
                     pOutputDeviceIDs[i] = temp.xaid;
                 }
-#endif
+
                 pOutputDeviceIDs[0] = 0xAD7E5002;
             }
         }
@@ -272,6 +271,7 @@
 
     XAAudIODevCapaItfImpl* impl = GetImpl(self);
     XAresult res = XA_RESULT_SUCCESS;
+    XACapabilities temp;
     DEBUG_API("->XAAudIODevCapaItfImpl_QueryAudioOutputCapabilities");
 
     if( !impl || !pDescriptor )
@@ -283,18 +283,19 @@
     {
         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);
+        
+
+        res = XACapabilitiesMgr_GetCapsById(impl->capslist, (XACapsType)(XACAP_DEVSNK|XACAP_AUDIO), deviceId, &temp);
         if( res == XA_RESULT_SUCCESS )
         {
+            XAAudioOutputDescriptor* desc = ((XAAudioOutputDescriptor*)(temp.pEntry));
             /* map applicable values to XAAudioCodecCapabilities */
-            pDescriptor->maxChannels=temp.maxCh;
-            pDescriptor->minSampleRate=temp.minSR*1000; /* milliHz */
-            if (temp.maxSR < (0xFFFFFFFF / 1000))
+            pDescriptor->maxChannels=desc->maxChannels;
+            pDescriptor->minSampleRate=desc->minSampleRate*1000; /* milliHz */
+            if (desc->maxSampleRate < (0xFFFFFFFF / 1000))
             {
-                pDescriptor->maxSampleRate = temp.maxSR*1000;
+                pDescriptor->maxSampleRate = desc->maxSampleRate*1000;
             }
             else
             {
@@ -307,7 +308,7 @@
             pDescriptor->pDeviceName = temp.adaptId;
             /* other caps undefined */
         }
-#endif
+
 
         switch (deviceId)
                 {
@@ -427,15 +428,15 @@
     }
     else
     {
-#ifdef _GSTREAMER_BACKEND_
-        XAStaticCapsData temp;
+
+        XACapabilities 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);
+            res = XACapabilitiesMgr_GetCapsByIdx(impl->capslist, (XACapsType)(XACAP_DEVSRC|XACAP_AUDIO), i, &temp);
             if (temp.xaid != deviceId)
             {
                 associatedCount++;
@@ -454,7 +455,7 @@
             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);
+                res = XACapabilitiesMgr_GetCapsByIdx(impl->capslist, (XACapsType)(XACAP_DEVSRC|XACAP_AUDIO), i, &temp);
                 if (temp.xaid != deviceId)
                 {
                     pAudioInputDeviceIDs[associatedCount++] = temp.xaid;
@@ -463,7 +464,7 @@
         }
 
         *pNumAudioInputs = associatedCount;
-#endif
+
 
     if(!pAudioInputDeviceIDs)
         {
@@ -523,15 +524,15 @@
     }
     else
     {
-#ifdef _GSTREAMER_BACKEND_
-        XAStaticCapsData temp;
+
+        XACapabilities 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);
+            res = XACapabilitiesMgr_GetCapsByIdx(impl->capslist, (XACapsType)(XACAP_DEVSNK|XACAP_AUDIO), i, &temp);
             if (temp.xaid != deviceId)
             {
                 associatedCount++;
@@ -550,7 +551,7 @@
             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);
+                res = XACapabilitiesMgr_GetCapsByIdx(impl->capslist, (XACapsType)(XACAP_DEVSNK|XACAP_AUDIO), i, &temp);
                 if (temp.xaid != deviceId)
                 {
                     pAudioOutputDeviceIDs[associatedCount++] = temp.xaid;
@@ -559,7 +560,7 @@
         }
 
         *pNumAudioOutputs = associatedCount;
-#endif
+
 
         if(!pAudioOutputDeviceIDs)
             {
@@ -674,18 +675,19 @@
     }
     else
     {
-#ifdef _GSTREAMER_BACKEND_
-        XAStaticCapsData temp;
-        res = XAStaticCapsAdapt_GetCapsById(XACAP_DEVSNK|XACAP_AUDIO,
+
+/*        XACapabilities temp;
+        res = XACapabilitiesMgr_GetCapsById(NULL, (XACapsType)(XACAP_DEVSNK|XACAP_AUDIO),
                                             deviceId, &temp);
-        /* deviceid can be either input or output*/
+         deviceid can be either input or output
         if( res == XA_RESULT_FEATURE_UNSUPPORTED )
         {
-            res = XAStaticCapsAdapt_GetCapsById(XACAP_DEVSRC|XACAP_AUDIO,
+            res = XACapabilitiesMgr_GetCapsById(NULL, (XACapsType)(XACAP_DEVSRC|XACAP_AUDIO),
                                                 deviceId, &temp);
         }
         if( res == XA_RESULT_SUCCESS )
         {
+            XAAudioOutputDescriptor* desc = ((XAAudioOutputDescriptor*)(temp.pEntry));
             XAuint32 count = 0, i = 0;
             for (i=0; i < sizeof(temp.pcmProfilesSupported)*8; i++)
                 count+=temp.pcmProfilesSupported>>i&0x1;
@@ -714,8 +716,8 @@
                 }
             }
             *pNumOfSampleFormats = count;
-        }
-#endif
+        }*/
+
 
     if(!pSampleFormats)
         {
@@ -739,7 +741,7 @@
 /* XAAudIODevCapaItfImpl_Create
  * Description: Allocate and initialize XAAudIODevCapaItfImpl
  */
-XAAudIODevCapaItfImpl* XAAudIODevCapaItfImpl_Create()
+XAAudIODevCapaItfImpl* XAAudIODevCapaItfImpl_Create(XACapabilities* caps)
 {
     XAAudIODevCapaItfImpl* self = (XAAudIODevCapaItfImpl*)
         calloc(1,sizeof(XAAudIODevCapaItfImpl));
@@ -770,13 +772,16 @@
             XAAudIODevCapaItfImpl_RegisterAvailableAudioOutputsChangedCallback;
         self->itf.RegisterDefaultDeviceIDMapChangedCallback =
             XAAudIODevCapaItfImpl_RegisterDefaultDeviceIDMapChangedCallback;
-#ifdef _GSTREAMER_BACKEND_
+        self->capslist = caps;
         /* 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
+        XACapabilitiesMgr_GetCapsCount( caps, (XACapsType)(XACAP_DEVSNK|XACAP_AUDIO),
+                                  &(self->numOutputDevices) );
+        XACapabilitiesMgr_GetCapsCount( caps, (XACapsType)(XACAP_DEVSRC|XACAP_AUDIO),
+                                  &(self->numInputDevices) );
+        
+        /*TODO: Remove this later*/
+        XACapabilitiesMgr_QueryColorFormats(caps, NULL, NULL);
+
         self->inputCbPtrToSelf = NULL;
         self->outputCbPtrToSelf = NULL;
         self->deviceMapCbPtrToSelf = NULL;
--- a/khronosfws/openmax_al/src/engine/xaaudioiodevicecapabilitiesitf.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/engine/xaaudioiodevicecapabilitiesitf.h	Fri May 14 16:22:35 2010 +0300
@@ -20,7 +20,7 @@
 
 #include "openmaxalwrapper.h"
 #include "xaglobals.h"
-
+#include "xacapabilitiesmgr.h"
 /** MACROS **/
 
 /** TYPES **/
@@ -50,6 +50,7 @@
     XAuint32 numInputDevices;
     XAuint32 numOutputDevices;
     XAmilliHertz sampleRateArray[12];
+    XACapabilities* capslist;
     
 } XAAudIODevCapaItfImpl;
 
@@ -104,7 +105,7 @@
                                                            XAint32* pNumOfSampleFormats);
 
 /* XAAudIODevCapaItfImpl -specific methods */
-XAAudIODevCapaItfImpl* XAAudIODevCapaItfImpl_Create(void);
+XAAudIODevCapaItfImpl* XAAudIODevCapaItfImpl_Create(XACapabilities* caps);
 void XAAudIODevCapaItfImpl_Free(XAAudIODevCapaItfImpl* self);
 
 #endif /* XAAUDIOIODEVICECAPABILITIESITF_H */
--- a/khronosfws/openmax_al/src/engine/xacameracapabilitiesitf.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/engine/xacameracapabilitiesitf.c	Fri May 14 16:22:35 2010 +0300
@@ -20,10 +20,10 @@
 #include <assert.h>
 #include "xaglobals.h"
 #include "xacameracapabilitiesitf.h"
-#ifdef _GSTREAMER_BACKEND_  
-#include "XAStaticCapsAdaptation.h"
-#include "XAStaticCameraCapsAdaptation.h"
-#endif
+  
+
+#include "xastaticcameracapsadaptation.h"
+
 
 static XACameraCapabilitiesItfImpl* GetImpl(XACameraCapabilitiesItf self)
 {
@@ -57,9 +57,9 @@
         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;
 }
@@ -83,10 +83,10 @@
         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;
 }
@@ -108,10 +108,10 @@
         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;
 }
@@ -136,10 +136,10 @@
         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;
 }
@@ -163,10 +163,10 @@
         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;
 }
@@ -190,10 +190,10 @@
         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;
 }
@@ -217,10 +217,10 @@
         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;
 }
@@ -244,10 +244,10 @@
         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;
 }
@@ -273,20 +273,20 @@
         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* XACameraCapabilitiesItfImpl_Create(void)
 {
     XACameraCapabilitiesItfImpl* self = (XACameraCapabilitiesItfImpl*)
         calloc(1,sizeof(XACameraCapabilitiesItfImpl));
@@ -327,4 +327,4 @@
     free(self);
     DEBUG_API("<-XACameraCapabilitiesItfImpl_Free");
 }
-#endif
+
--- a/khronosfws/openmax_al/src/engine/xacameracapabilitiesitf.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/engine/xacameracapabilitiesitf.h	Fri May 14 16:22:35 2010 +0300
@@ -109,9 +109,9 @@
                         XAuint32* pNumSettings,
                         XApermille** ppSettings,
                         XAboolean* pSpeedSupported);
-#ifdef _GSTREAMER_BACKEND_  
+ 
 /* XACameraCapabilitiesItfImpl -specific methods */
-XACameraCapabilitiesItfImpl* XACameraCapabilitiesItfImpl_Create();
+XACameraCapabilitiesItfImpl* XACameraCapabilitiesItfImpl_Create(void);
 void XACameraCapabilitiesItfImpl_Free(XACameraCapabilitiesItfImpl* self);
-#endif
+
 #endif /* XACAMERACAPABILITIESITF_H */
--- a/khronosfws/openmax_al/src/engine/xadevicevolumeitf.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/engine/xadevicevolumeitf.c	Fri May 14 16:22:35 2010 +0300
@@ -20,9 +20,9 @@
 #include <assert.h>
 #include "xaglobals.h"
 #include "xadevicevolumeitf.h"
-#ifdef _GSTREAMER_BACKEND_  
-#include "XADeviceVolumeItfAdaptation.h"
-#endif
+  
+#include "xadevicevolumeitfadaptation.h"
+
 
 static XADeviceVolumeItfImpl* GetImpl(XADeviceVolumeItf self)
 {
@@ -65,9 +65,9 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_  
-    ret = XADeviceVolumeItfAdapt_IsDeviceIDSupported(impl->adapCtx, deviceID, &supported);
-#endif
+  
+    ret = XADeviceVolumeItfAdapt_IsDeviceIDSupported((XAAdaptationGstCtx*)impl->adapCtx, deviceID, &supported);
+
     if( ret != XA_RESULT_SUCCESS || supported != XA_BOOLEAN_TRUE )
     {
         DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
@@ -94,9 +94,9 @@
 {
     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 )
@@ -106,8 +106,8 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_  
-    ret = XADeviceVolumeItfAdapt_IsDeviceIDSupported(impl->adapCtx, deviceID, &supported);
+  
+    ret = XADeviceVolumeItfAdapt_IsDeviceIDSupported((XAAdaptationGstCtx*)impl->adapCtx, deviceID, &supported);
     if( ret != XA_RESULT_SUCCESS || supported != XA_BOOLEAN_TRUE )
     {
         DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
@@ -115,13 +115,13 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-    ret = XADeviceVolumeItfAdapt_SetVolume(impl->adapCtx, deviceID, volume);
+    ret = XADeviceVolumeItfAdapt_SetVolume((XAAdaptationGstCtx*)impl->adapCtx, deviceID, volume);
 
     if( ret == XA_RESULT_SUCCESS )
     {
         impl->curVolume = volume;
     }
-#endif
+
     DEBUG_API("<-XADeviceVolumeItfImpl_SetVolume");
     return ret;
 }
@@ -147,9 +147,9 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_  
-    ret = XADeviceVolumeItfAdapt_IsDeviceIDSupported(impl->adapCtx, deviceID, &supported);
-#endif
+  
+    ret = XADeviceVolumeItfAdapt_IsDeviceIDSupported((XAAdaptationGstCtx*)impl->adapCtx, deviceID, &supported);
+
     if( ret != XA_RESULT_SUCCESS || supported != XA_BOOLEAN_TRUE )
     {
         DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
@@ -164,7 +164,7 @@
 /**
  * XADeviceVolumeItfImpl -specific methods
  **/
-#ifdef _GSTREAMER_BACKEND_  
+  
 /**
  * XADeviceVolumeItfImpl* XADeviceVolumeItfImpl_Create(XAAdaptationBaseCtx *adapCtx)
  * Description: Allocate and initialize DeviceVolumeImpl
@@ -198,7 +198,7 @@
     DEBUG_API("<-XADeviceVolumeItfImpl_Create");
     return self;
 }
-#endif
+
 /* void XADeviceVolumeItfImpl_Free(XADeviceVolumeItfImpl* self)
  * Description: Free all resources reserved at XADeviceVolumeItfImpl_Create
  */
--- a/khronosfws/openmax_al/src/engine/xadevicevolumeitf.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/engine/xadevicevolumeitf.h	Fri May 14 16:22:35 2010 +0300
@@ -18,11 +18,8 @@
 #ifndef XADEVICEVOLUMEITF_H
 #define XADEVICEVOLUMEITF_H
 
-#include "openmaxalwrapper.h"
-#include "xaglobals.h"
-#ifdef _GSTREAMER_BACKEND_  
-#include "XAAdaptationContextBase.h"
-#endif
+#include "xaadptbasectx.h"
+
 /** MACROS **/
 #define DEFAULTDEVICEVOLUME 5
 #define DEFAULTDEVICEMINVOLUME 0
@@ -47,10 +44,10 @@
     XAint32 minVolume;
     XAint32 maxVolume;
     XAboolean ismBscale;
-#ifdef _GSTREAMER_BACKEND_  
+ 
     /*Adaptation variables*/
     XAAdaptationBaseCtx *adapCtx;
-#endif
+
 } XADeviceVolumeItfImpl;
 
 /* Base interface XADeviceVolumeItf implementation */
@@ -68,10 +65,10 @@
                         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 */
--- a/khronosfws/openmax_al/src/engine/xaengine.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/engine/xaengine.c	Fri May 14 16:22:35 2010 +0300
@@ -35,25 +35,28 @@
 #include "xadevicevolumeitf.h"
 #include "xaconfigextensionsitf.h"
 #include "xathreadsafety.h"
-#ifdef _GSTREAMER_BACKEND_  
-#include "XAStaticCameraCapsAdaptation.h"
-#endif
+#include "xaframeworkmgr.h"  
+#include "xastaticcameracapsadaptation.h"
+
+
 /* 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_CONFIGEXTENSION,*/
+/*    &XA_IID_DEVICEVOLUME,*/
     &XA_IID_AUDIOIODEVICECAPABILITIES,
-    &XA_IID_AUDIODECODERCAPABILITIES,
-    &XA_IID_AUDIOENCODERCAPABILITIES,
+/*    &XA_IID_AUDIODECODERCAPABILITIES,*/
+    &XA_IID_AUDIOENCODERCAPABILITIES
+/*
     &XA_IID_CAMERACAPABILITIES,
     &XA_IID_IMAGEDECODERCAPABILITIES,
     &XA_IID_IMAGEENCODERCAPABILITIES,
     &XA_IID_VIDEODECODERCAPABILITIES,
     &XA_IID_VIDEOENCODERCAPABILITIES
+*/
 };
 
 /*****************************************************************************
@@ -173,9 +176,11 @@
         }
     }
 
-#ifdef _GSTREAMER_BACKEND_  
+/*
+  
     pImpl->adaptationCtx = XAEngineAdapt_Create();
-#endif
+
+*/
     /* Set ObjectItf to point to newly created object */
     *pEngine = ((XAObjectItf)&(pBaseObj->self));
 
@@ -257,23 +262,26 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_  
-    ret = XAEngineAdapt_PostInit( pObjImpl->adaptationCtx );
-#endif
-    if( ret != XA_RESULT_SUCCESS )
+   
+    /* Table containing use-case framework map */
+    pObjImpl->frameworkMap = XAFrameworkMgr_CreateFrameworkMap();
+    if (pObjImpl->frameworkMap == NULL)
     {
-        DEBUG_ERR_A1("Engine postinit failed - %d", ret);
+        DEBUG_ERR("XA_RESULT_MEMORY_FAILURE");
         DEBUG_API("<-XAEngineImpl_DoRealize");
-        return ret;
+        /* memory allocation failed */
+        return XA_RESULT_MEMORY_FAILURE;
     }
 
-    ret = XAEngineAdaptMMF_PostInit( pObjImpl->adaptationMmfCtx );
-    if( ret != XA_RESULT_SUCCESS )
-    {
-        DEBUG_ERR_A1("Engine postinit failed (MMF) - %d", ret);
-        DEBUG_API("<-XAEngineImpl_DoRealize");
+
+    /* Create capabilities list */
+    ret = XACapabilitiesMgr_CreateCapabilitieList(pObjImpl->frameworkMap, &(pObjImpl->capabilities));
+    if (ret != XA_RESULT_SUCCESS)
+        {
         return ret;
-    }
+        }
+
+
     /* Realize all implicit and explicitly wanted interfaces */
     for(itfIdx=0; itfIdx<ENGINE_ITFCOUNT; itfIdx++)
     {
@@ -284,7 +292,7 @@
             switch(itfIdx)
             {
                 case ENGINE_ENGINEITF:
-                    pItf = XAEngineItfImpl_Create();
+                    pItf = XAEngineItfImpl_Create(pObjImpl->frameworkMap, pObjImpl->capabilities);
                     break;
                 case ENGINE_THREADSYNCITF:
                     pItf = XAThreadSyncItfImpl_Create();
@@ -293,11 +301,12 @@
                     pItf = XADIMItfImpl_Create();
                     break;
                 case ENGINE_AUDIOIODEVICECAPAITF:
-                    pItf = XAAudIODevCapaItfImpl_Create();
+                    pItf = XAAudIODevCapaItfImpl_Create(pObjImpl->capabilities);
                     break;
                 case ENGINE_AUDIOENCODERCAPAITF:
-                    pItf = XAAudioEncoderCapabilitiesItfImpl_Create();
+                    pItf = XAAudioEncoderCapabilitiesItfImpl_Create(pObjImpl->capabilities);
                     break;
+/*
                 case ENGINE_AUDIODECODERCAPAITF:
                     pItf = XAAudioDecoderCapabilitiesItfImpl_Create();
                     break;
@@ -305,15 +314,13 @@
                     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();
@@ -327,6 +334,7 @@
                 case ENGINE_VIDEOENCODERCAPAITF:
                     pItf = XAVideoEncoderCapabilitiesItfImpl_Create();
                     break;
+*/
                 default:
                     break;
             }
@@ -394,6 +402,7 @@
                 case ENGINE_AUDIOENCODERCAPAITF:
                     XAAudioEncoderCapabilitiesItfImpl_Free(pItf);
                     break;
+/*
                 case ENGINE_AUDIODECODERCAPAITF:
                     XAAudioDecoderCapabilitiesItfImpl_Free(pItf);
                     break;
@@ -404,9 +413,9 @@
                     XADeviceVolumeItfImpl_Free(pItf);
                     break;
                 case ENGINE_CAMERACAPAITF:
-#ifdef _GSTREAMER_BACKEND_
+
                     XACameraCapabilitiesItfImpl_Free(pItf);
-#endif                    
+                    
                     break;
                 case ENGINE_IMAGEDECODERCAPAITF:
                     XAImageDecoderCapabilitiesItfImpl_Free(pItf);
@@ -420,6 +429,7 @@
                 case ENGINE_VIDEOENCODERCAPAITF:
                     XAVideoEncoderCapabilitiesItfImpl_Free(pItf);
                     break;
+*/
                 default:
                     break;
             }
@@ -428,20 +438,25 @@
     }
 
     /* 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();
+    }*/
+    /* free framework map */
+    XAFrameworkMgr_DeleteFrameworkMap(&pImpl->frameworkMap);
+    
+    /* TODO free capabilities list */
+    XACapabilitiesMgr_DeleteCapabilitieList(&pImpl->capabilities);
+    
+     XAThreadSafety_Destroy();
 
     DEBUG_API("<-XAEngineImpl_FreeResources");
     return;
--- a/khronosfws/openmax_al/src/engine/xaengine.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/engine/xaengine.h	Fri May 14 16:22:35 2010 +0300
@@ -21,10 +21,11 @@
 #include "openmaxalwrapper.h"
 #include "xaglobals.h"
 #include "xaobjectitf.h"
-#ifdef _GSTREAMER_BACKEND_   
-#include "XAEngineAdaptCtx.h"
-#endif
+#include "xaengineadaptctx.h"
+
 #include "xaengineadaptctxmmf.h"
+#include "xaframeworkmgr.h"
+#include "xacapabilitiesmgr.h"
 
 /** MACROS **/
 
@@ -40,16 +41,20 @@
     ENGINE_ENGINEITF,
     ENGINE_DIMITF,
     ENGINE_THREADSYNCITF,
+/*
     ENGINE_CONFIGEXTENSIONSITF,
     ENGINE_DEVICEVOLUMEITF,
+*/
     ENGINE_AUDIOIODEVICECAPAITF,
-    ENGINE_AUDIODECODERCAPAITF,
+/*    ENGINE_AUDIODECODERCAPAITF,*/
     ENGINE_AUDIOENCODERCAPAITF,
+/*
     ENGINE_CAMERACAPAITF,
     ENGINE_IMAGEDECODERCAPAITF,
     ENGINE_IMAGEENCODERCAPAITF,
     ENGINE_VIDEODECODERCAPAITF,
     ENGINE_VIDEOENCODERCAPAITF,
+*/
     ENGINE_ITFCOUNT
 } XAEngineInterfaces;
 
@@ -65,8 +70,11 @@
     XAboolean isThreadSafe;
 
     //actual adpatation context can point to either MMF or GST implementations
-    void* adaptationGstCtx;
-    void* adaptationMmfCtx;
+    FrameworkMap *frameworkMap;
+    XACapabilities* capabilities;
+   
+/*    void* adaptationGstCtx;
+    void* adaptationMmfCtx;*/
 } XAEngineImpl;
 
 /** METHODS **/
--- a/khronosfws/openmax_al/src/engine/xaengineitf.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/engine/xaengineitf.c	Fri May 14 16:22:35 2010 +0300
@@ -21,13 +21,26 @@
 #include "xaengineitf.h"
 #include "xavibraitf.h"
 #include "xaledarrayitf.h"
-#ifdef _GSTREAMER_BACKEND_  
-#include "XAStaticCapsAdaptation.h"
-#endif
-
+#include "xaobjects.h"
+#include "xacapabilitiesmgr.h"
 /*static XAchar implementationText[] = "Implementation does not conform to AL Spec";*/
 
-
+/**
+ * XAEngineItfImpl* GetImpl(XAEngineItf self)
+ * Description: Validate interface pointer and cast it to implementation pointer.
+ **/
+static XAEngineItfImpl* GetImpl(XAEngineItf self)
+{
+    if( self )
+    {
+        XAEngineItfImpl* impl = (XAEngineItfImpl*)(*self);
+        if( impl && (impl == impl->self) )
+        {
+            return impl;
+        }
+    }
+    return NULL;
+}
 /**
  * Base interface XAEngineItf implementation
  */
@@ -38,8 +51,10 @@
                                             const XAInterfaceID *pInterfaceIds,
                                             const XAboolean *pInterfaceRequired)
 {
-    return XACameraDeviceImpl_CreateCameraDevice( pDevice, deviceID,numInterfaces,
-                                                  pInterfaceIds, pInterfaceRequired );
+    XAEngineItfImpl* impl = GetImpl(self);
+    return XACameraDeviceImpl_CreateCameraDevice( impl->mapper,impl->capabilities,
+                                                    pDevice, deviceID,numInterfaces,
+                                                    pInterfaceIds, pInterfaceRequired );
 }
 
 XAresult XAEngineItfImpl_CreateRadioDevice(XAEngineItf self,
@@ -48,7 +63,8 @@
                                             const XAInterfaceID *pInterfaceIds,
                                             const XAboolean *pInterfaceRequired)
 {
-    return XARadioDeviceImpl_CreateRadioDevice( pDevice, numInterfaces,
+    return XARadioDeviceImpl_CreateRadioDevice( ((XAEngineItfImpl*)self)->mapper,
+                                                pDevice, numInterfaces,
                                                 pInterfaceIds, pInterfaceRequired );
 }
 
@@ -59,8 +75,9 @@
                                          const XAInterfaceID *pInterfaceIds,
                                          const XAboolean *pInterfaceRequired)
 {
-    return XALEDArrayDeviceImpl_CreateLEDArrayDevice( pDevice, deviceID, numInterfaces,
-                                                      pInterfaceIds, pInterfaceRequired );
+    return XALEDArrayDeviceImpl_CreateLEDArrayDevice( ((XAEngineItfImpl*)self)->mapper,
+                                                        pDevice, deviceID, numInterfaces,
+                                                        pInterfaceIds, pInterfaceRequired );
 }
 
 XAresult XAEngineItfImpl_CreateVibraDevice(XAEngineItf self,
@@ -70,7 +87,8 @@
                                            const XAInterfaceID *pInterfaceIds,
                                            const XAboolean *pInterfaceRequired)
 {
-    return XAVibraDeviceImpl_CreateVibraDevice( pDevice, deviceID, numInterfaces,
+    return XAVibraDeviceImpl_CreateVibraDevice( ((XAEngineItfImpl*)self)->mapper,
+                                                pDevice, deviceID, numInterfaces,
                                                 pInterfaceIds, pInterfaceRequired);
 }
 
@@ -86,7 +104,9 @@
                                            const XAInterfaceID *pInterfaceIds,
                                            const XAboolean *pInterfaceRequired)
 {
-    return XAMediaPlayerImpl_CreateMediaPlayer(pPlayer, pDataSrc, pBankSrc, pAudioSnk,
+    XAEngineItfImpl* impl = GetImpl(self);
+    return XAMediaPlayerImpl_CreateMediaPlayer(impl->mapper,impl->capabilities, pPlayer, 
+                                             pDataSrc, pBankSrc, pAudioSnk,
                                              pImageVideoSnk, pVibra, pLEDArray,
                                              numInterfaces, pInterfaceIds, pInterfaceRequired);
 }
@@ -99,9 +119,17 @@
                                              XAuint32 numInterfaces,
                                              const XAInterfaceID * pInterfaceIds,
                                              const XAboolean * pInterfaceRequired)
-{
-    return XAMediaRecorderImpl_CreateMediaRecorder(pRecorder, pAudioSrc, pImageVideoSrc, pDataSnk,
-                                                   numInterfaces, pInterfaceIds, pInterfaceRequired);
+{    
+    XAEngineItfImpl* impl = GetImpl(self);
+    return XAMediaRecorderImpl_CreateMediaRecorder(impl->mapper,
+                                                   impl->capabilities,
+                                                   pRecorder,
+                                                   pAudioSrc,
+                                                   pImageVideoSrc,
+                                                   pDataSnk,
+                                                   numInterfaces,
+                                                   pInterfaceIds,
+                                                   pInterfaceRequired);
 }
 
 XAresult XAEngineItfImpl_CreateOutputMix(XAEngineItf self,
@@ -110,8 +138,10 @@
                                          const XAInterfaceID *pInterfaceIds,
                                          const XAboolean *pInterfaceRequired)
 {
-    return XAOMixImpl_CreateOutputMix(pMix, numInterfaces,
-                                      pInterfaceIds, pInterfaceRequired);
+    XAEngineItfImpl* impl = GetImpl(self);
+    return XAOMixImpl_CreateOutputMix(impl->mapper,impl->capabilities,
+                                        pMix, numInterfaces,
+                                        pInterfaceIds, pInterfaceRequired);
 }
 
 XAresult XAEngineItfImpl_CreateMetadataExtractor(XAEngineItf self,
@@ -121,8 +151,10 @@
                                                  const XAInterfaceID *pInterfaceIds,
                                                  const XAboolean *pInterfaceRequired)
 {
-    return XAMetadataExtractorImpl_Create(pMetadataExtractor, pDataSource,
-                                          numInterfaces, pInterfaceIds, pInterfaceRequired);
+    XAEngineItfImpl* impl = GetImpl(self);
+    return XAMetadataExtractorImpl_Create(impl->mapper, impl->capabilities,
+                                            pMetadataExtractor, pDataSource,
+                                            numInterfaces, pInterfaceIds, pInterfaceRequired);
 }
 
 XAresult XAEngineItfImpl_CreateExtensionObject(XAEngineItf self,
@@ -312,9 +344,9 @@
                                               XAuint32 *pLEDDeviceID,
                                               XALEDDescriptor *pDescriptor)
 {
-#ifdef _GSTREAMER_BACKEND_  
+  
     XALEDDescriptor descriptor;
-#endif    
+    
     DEBUG_API("->XAEngineItfImpl_QueryLEDCapabilities");
 
     if( !pDescriptor )
@@ -330,7 +362,7 @@
     }
     else
     {   
-#ifdef _GSTREAMER_BACKEND_  
+  
         /* query device capabilities */
         if( pIndex )
         {
@@ -359,7 +391,7 @@
             descriptor.primaryLED = PRIMARY_LED;
             *pDescriptor = descriptor;
         }
-#endif        
+        
     }
     DEBUG_API("<-XAEngineItfImpl_QueryLEDCapabilities");
     return XA_RESULT_SUCCESS;
@@ -370,9 +402,9 @@
                                                 XAuint32 *pVibraDeviceID,
                                                 XAVibraDescriptor *pDescriptor)
 {
-#ifdef _GSTREAMER_BACKEND_  
+  
     XAVibraDescriptor descriptor;
-#endif
+
     DEBUG_API("->XAEngineItfImpl_QueryVibraCapabilities");
 
     if( !pDescriptor  )
@@ -388,7 +420,7 @@
     }
     else
     {   
-#ifdef _GSTREAMER_BACKEND_  
+  
         /* query device capabilities */
         if( pIndex )
         {
@@ -419,7 +451,7 @@
             descriptor.supportsIntensity = XA_BOOLEAN_TRUE;
             *pDescriptor = descriptor;
         }
-#endif        
+        
     }
 
     DEBUG_API("<-XAEngineItfImpl_QueryVibraCapabilities");
@@ -474,7 +506,7 @@
 /**
  * XAEngineItfImpl -specific methods
  **/
-XAEngineItfImpl* XAEngineItfImpl_Create()
+XAEngineItfImpl* XAEngineItfImpl_Create(FrameworkMap* fwkmapper, XACapabilities* capabilities)
 {
     XAEngineItfImpl* self = (XAEngineItfImpl*)
         calloc(1,sizeof(XAEngineItfImpl));
@@ -501,6 +533,9 @@
         self->itf.QueryNumSupportedExtensions = XAEngineItfImpl_QueryNumSupportedExtensions;
         self->itf.QuerySupportedExtension = XAEngineItfImpl_QuerySupportedExtension;
         self->itf.IsExtensionSupported = XAEngineItfImpl_IsExtensionSupported;
+        self->mapper = fwkmapper;
+        self->capabilities = capabilities;
+        self->xyz = 50;
         self->self = self;
     }
     DEBUG_API("<-XAEngineItfImpl_Create");
--- a/khronosfws/openmax_al/src/engine/xaengineitf.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/engine/xaengineitf.h	Fri May 14 16:22:35 2010 +0300
@@ -20,7 +20,8 @@
 
 #include "openmaxalwrapper.h"
 #include "xaglobals.h"
-
+#include "xaframeworkmgr.h"
+#include "xacapabilitiesmgr.h"
 /** MACROS **/
 
 /** TYPES **/
@@ -36,6 +37,13 @@
     /* pointer to self */
     struct XAEngineItfImpl_* self;
     /* variables */
+    /*Not Owned*/
+    struct FrameworkMap_* mapper;
+    /*Not Owned*/
+    struct XACapabilities_* capabilities;
+    
+    int xyz;
+    
 } XAEngineItfImpl;
 
 /** METHODS **/
@@ -152,7 +160,7 @@
                                               XAboolean *pSupported);
 
 /* XAEngineItfImpl -specific methods */
-XAEngineItfImpl* XAEngineItfImpl_Create(void);
+XAEngineItfImpl* XAEngineItfImpl_Create(FrameworkMap* fwkmapper, XACapabilities* capabilities);
 void XAEngineItfImpl_Free(XAEngineItfImpl *self);
 
 #endif /* XAENGINEITF_H */
--- a/khronosfws/openmax_al/src/engine/xaimagedecodercapabilitiesitf.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/engine/xaimagedecodercapabilitiesitf.c	Fri May 14 16:22:35 2010 +0300
@@ -22,9 +22,9 @@
 
 #include "xaglobals.h"
 #include "xaimagedecodercapabilitiesitf.h"
-#ifdef _GSTREAMER_BACKEND_  
-#include "XAStaticCapsAdaptation.h"
-#endif
+  
+#include "xacapabilitiesmgr.h"
+
 /* XAImageDecoderCapabilitiesItfImpl* GetImpl
  * Description: Validate interface pointer and cast it to implementation pointer.
  */
@@ -72,19 +72,20 @@
         else
         {
             /* query capabilities from adaptation using codec id */
-#ifdef _GSTREAMER_BACKEND_  
-            XAStaticCapsData temp;
+  
+            XACapabilities temp;
             memset(pDescriptor,0,sizeof(XAImageCodecDescriptor));
             /* here pEncoderId refers to index rather than codec id */
-            res = XAStaticCapsAdapt_GetCapsByIdx(XACAP_DECODER|XACAP_IMAGE, *pDecoderId, &temp);
+            res = XACapabilitiesMgr_GetCapsByIdx(NULL, (XACapsType)(XACAP_DECODER|XACAP_IMAGE), *pDecoderId, &temp);
             if( res == XA_RESULT_SUCCESS )
             {
+                XAImageCodecDescriptor* desc = (XAImageCodecDescriptor*)(&temp.pEntry);
                 /* map applicable values to XAAudioCodecCapabilities */
                 pDescriptor->codecId = temp.xaid;
-                pDescriptor->maxWidth = temp.maxW;
-                pDescriptor->maxHeight = temp.maxH;
+                pDescriptor->maxWidth = desc->maxWidth;
+                pDescriptor->maxHeight = desc->maxHeight;
             }
-#endif
+
         }
     }
 
@@ -112,9 +113,9 @@
     }
     else
     {
-#ifdef _GSTREAMER_BACKEND_
-        res = XAStaticCapsAdapt_QueryColorFormats(pIndex, pColorFormats);
-#endif        
+
+        res = XACapabilitiesMgr_QueryColorFormats(NULL, pIndex, pColorFormats);
+        
     }
     DEBUG_API("<-XAImageDecoderCapabilitiesItfImpl_QueryColorFormats");
     return res;
@@ -141,11 +142,11 @@
         self->itf.QueryColorFormats =
             XAImageDecoderCapabilitiesItfImpl_QueryColorFormats;
 
-#ifdef _GSTREAMER_BACKEND_  
+  
         /* init variables */
-        assert( XAStaticCapsAdapt_GetCapsCount( XACAP_DECODER|XACAP_IMAGE,
+        assert( XACapabilitiesMgr_GetCapsCount( NULL, (XACapsType)(XACAP_DECODER|XACAP_IMAGE),
                                   &(self->numCodecs) ) == XA_RESULT_SUCCESS );
-#endif
+
         self->self = self;
     }
     DEBUG_API("<-XAImageDecoderCapabilitiesItfImpl_Create");
--- a/khronosfws/openmax_al/src/engine/xaimageencodercapabilitiesitf.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/engine/xaimageencodercapabilitiesitf.c	Fri May 14 16:22:35 2010 +0300
@@ -21,9 +21,7 @@
 #include <string.h>
 #include "xaglobals.h"
 #include "xaimageencodercapabilitiesitf.h"
-#ifdef _GSTREAMER_BACKEND_  
-#include "XAStaticCapsAdaptation.h"
-#endif
+#include "xacapabilitiesmgr.h"  
 /* XAImageEncoderCapabilitiesItfImpl* GetImpl
  * Description: Validate interface pointer and cast it to implementation pointer.
  */
@@ -72,19 +70,20 @@
         else
         {
             /* query capabilities from adaptation using codec id */
-#ifdef _GSTREAMER_BACKEND_  
-            XAStaticCapsData temp;
+  
+            XACapabilities temp;
             memset(pDescriptor,0,sizeof(XAImageCodecDescriptor));
             /* here pEncoderId refers to index rather than codec id */
-            res = XAStaticCapsAdapt_GetCapsByIdx(XACAP_ENCODER|XACAP_IMAGE, *pEncoderId, &temp);
+            res = XACapabilitiesMgr_GetCapsByIdx(NULL, (XACapsType)(XACAP_ENCODER|XACAP_IMAGE), *pEncoderId, &temp);
             if( res == XA_RESULT_SUCCESS )
             {
+                XAImageCodecDescriptor* desc = (XAImageCodecDescriptor*)(&temp.pEntry);
                 /* map applicable values to XAAudioCodecCapabilities */
                 pDescriptor->codecId = temp.xaid;
-                pDescriptor->maxWidth = temp.maxW;
-                pDescriptor->maxHeight = temp.maxH;
+                pDescriptor->maxWidth = desc->maxWidth;
+                pDescriptor->maxHeight = desc->maxHeight;
             }
-#endif
+
         }
     }
 
@@ -113,9 +112,9 @@
     }
     else
     {
-#ifdef _GSTREAMER_BACKEND_
-        res = XAStaticCapsAdapt_QueryColorFormats(pIndex, pColorFormats);
-#endif        
+
+        res = XACapabilitiesMgr_QueryColorFormats(NULL, pIndex, pColorFormats);
+        
     }
     DEBUG_API("<-XAImageEncoderCapabilitiesItfImpl_QueryColorFormats");
     return res;
@@ -142,11 +141,11 @@
         self->itf.QueryColorFormats =
             XAImageEncoderCapabilitiesItfImpl_QueryColorFormats;
 
-#ifdef _GSTREAMER_BACKEND_  
+  
         /* init variables */
-        assert( XAStaticCapsAdapt_GetCapsCount( XACAP_ENCODER|XACAP_IMAGE,
+        assert( XACapabilitiesMgr_GetCapsCount( NULL, (XACapsType)(XACAP_ENCODER|XACAP_IMAGE),
                                   &(self->numCodecs) ) == XA_RESULT_SUCCESS );
-#endif
+
         self->self = self;
     }
     DEBUG_API("<-XAImageEncoderCapabilitiesItfImpl_Create");
--- a/khronosfws/openmax_al/src/engine/xavideodecodercapabilitiesitf.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/engine/xavideodecodercapabilitiesitf.c	Fri May 14 16:22:35 2010 +0300
@@ -23,9 +23,9 @@
 
 #include "xaglobals.h"
 #include "xavideodecodercapabilitiesitf.h"
-#ifdef _GSTREAMER_BACKEND_  
-#include "XAStaticCapsAdaptation.h"
-#endif
+#include "xacapabilitiesmgr.h"   
+
+
 /* XAVideoDecoderCapabilitiesItfImpl* GetImpl
  * Description: Validate interface pointer and cast it to implementation pointer.
  */
@@ -77,16 +77,16 @@
             else
             {
                 
-#ifdef _GSTREAMER_BACKEND_  
+  
                 XAuint32 i = 0;
-                XAStaticCapsData temp;
+                XACapabilities temp;
                 for( i=0; i<impl->numCodecs; i++ )
                 {
                     /* query decoder id from adaptation using index value */
-                    XAStaticCapsAdapt_GetCapsByIdx(XACAP_DECODER|XACAP_VIDEO, i, &temp);
+                    XACapabilitiesMgr_GetCapsByIdx(NULL, (XACapsType)(XACAP_DECODER|XACAP_VIDEO), i, &temp);
                     pDecoderIds[i] = temp.xaid;
                 }
-#endif
+
             }
         }
         /* return number of decoders */
@@ -132,24 +132,25 @@
             else
             {
                 /* query capabilities from adaptation using codec id */
-#ifdef _GSTREAMER_BACKEND_  
-                XAStaticCapsData temp;
+  
+                XACapabilities temp;
                 memset(pDescriptor,0,sizeof(XAVideoCodecDescriptor));
-                res = XAStaticCapsAdapt_GetCapsById(XACAP_DECODER|XACAP_VIDEO, decoderId, &temp);
+                res = XACapabilitiesMgr_GetCapsById(NULL, (XACapsType)(XACAP_DECODER|XACAP_VIDEO), decoderId, &temp);
                 if( res == XA_RESULT_SUCCESS )
                 {
+                    XAVideoCodecDescriptor* desc = (XAVideoCodecDescriptor*)(&temp.pEntry);
                     /* 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;
+                    pDescriptor->maxWidth = desc->maxWidth;
+                    pDescriptor->maxHeight = desc->maxHeight;
+                    pDescriptor->maxFrameRate = (desc->maxFrameRate & 0xffff)<<16;
+                    pDescriptor->maxBitRate = desc->maxBitRate;
                     /*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
+
             }
         }
     }
@@ -179,11 +180,11 @@
         self->itf.GetVideoDecoderCapabilities =
             XAVideoDecoderCapabilitiesItfImpl_GetVideoDecoderCapabilities;
 
-#ifdef _GSTREAMER_BACKEND_  
+  
         /* init variables */
-        assert( XAStaticCapsAdapt_GetCapsCount( XACAP_DECODER|XACAP_VIDEO,
+        assert( XACapabilitiesMgr_GetCapsCount( NULL, (XACapsType)(XACAP_DECODER|XACAP_VIDEO),
                                   &(self->numCodecs) ) == XA_RESULT_SUCCESS );
-#endif
+
         self->self = self;
     }
     DEBUG_API("<-XAVideoDecoderCapabilitiesItfImpl_Create");
--- a/khronosfws/openmax_al/src/engine/xavideoencodercapabilitiesitf.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/engine/xavideoencodercapabilitiesitf.c	Fri May 14 16:22:35 2010 +0300
@@ -22,9 +22,9 @@
 
 #include "xaglobals.h"
 #include "xavideoencodercapabilitiesitf.h"
-#ifdef _GSTREAMER_BACKEND_  
-#include "XAStaticCapsAdaptation.h"
-#endif
+
+#include "xacapabilitiesmgr.h"
+
 /* XAVideoEncoderCapabilitiesItfImpl* GetImpl
  * Description: Validate interface pointer and cast it to implementation pointer.
  */
@@ -74,16 +74,16 @@
             else
             {
                 
-#ifdef _GSTREAMER_BACKEND_  
+  
                 XAuint32 i = 0;
-                XAStaticCapsData temp;
+                XACapabilities temp;
                 for( i=0; i<impl->numCodecs; i++ )
                 {
                     /* query encoder id from adaptation using index value */
-                    XAStaticCapsAdapt_GetCapsByIdx(XACAP_ENCODER|XACAP_VIDEO, i, &temp);
+                    XACapabilitiesMgr_GetCapsByIdx(NULL, (XACapsType)(XACAP_ENCODER|XACAP_VIDEO), i, &temp);
                     pEncoderIds[i] = temp.xaid;
                 }
-#endif
+
             }
         }
         /* return number of encoders */
@@ -128,25 +128,26 @@
             }
             else
             {
-#ifdef _GSTREAMER_BACKEND_  
+  
                 /* query capabilities from adaptation using codec id */
-                XAStaticCapsData temp;
+                XACapabilities temp;
                 memset(pDescriptor,0,sizeof(XAVideoCodecDescriptor));
-                res = XAStaticCapsAdapt_GetCapsById(XACAP_ENCODER|XACAP_VIDEO, encoderId, &temp);
+                res = XACapabilitiesMgr_GetCapsById(NULL, (XACapsType)(XACAP_ENCODER|XACAP_VIDEO), encoderId, &temp);
                 if( res == XA_RESULT_SUCCESS )
                 {
-                    /* map applicable values to XAAudioCodecCapabilities */
+                    XAVideoCodecDescriptor* desc = (XAVideoCodecDescriptor*)(&temp.pEntry);
+                    /* 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;
+                    pDescriptor->maxWidth = desc->maxWidth;
+                    pDescriptor->maxHeight = desc->maxHeight;
+                    pDescriptor->maxFrameRate = (desc->maxFrameRate & 0xffff)<<16;
+                    pDescriptor->maxBitRate = desc->maxBitRate;
                     /*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            
+            
             }
         }
     }
@@ -176,11 +177,11 @@
         self->itf.GetVideoEncoderCapabilities =
             XAVideoEncoderCapabilitiesItfImpl_GetVideoEncoderCapabilities;
 
-#ifdef _GSTREAMER_BACKEND_  
+  
         /* init variables */
-        assert( XAStaticCapsAdapt_GetCapsCount( XACAP_ENCODER|XACAP_VIDEO,
+        assert( XACapabilitiesMgr_GetCapsCount( NULL, (XACapsType)(XACAP_ENCODER|XACAP_VIDEO),
                                   &(self->numCodecs) ) == XA_RESULT_SUCCESS );
-#endif
+
         self->self = self;
     }
     DEBUG_API("<-XAVideoEncoderCapabilitiesItfImpl_Create");
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/gst_adaptation/xaadaptationgst.c	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,1470 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "xaobjectitf.h"
+#include "xacameradevice.h"
+#include "xaradiodevice.h"
+#include "xaoutputmix.h"
+#include "xamediaplayeradaptctx.h"
+#include "xacameraadaptctx.h"
+#include <stdlib.h>
+extern XAboolean cameraRealized;
+extern XACameraAdaptationCtx_* cameraCtx;
+/*
+ * XAAdaptationGstCtx* XAAdaptationGst_Create()
+ * 1st phase initialization function for Adaptation Base context structure.
+ * Reserves memory for base context and initializes GStreamer FW.
+ */
+XAresult XAAdaptationGst_Init( XAAdaptationGstCtx* pSelf, XAuint32 ctxId )
+{
+    DEBUG_API("->XAAdaptationGst_Init");
+
+    if ( pSelf )
+    {
+        if(XAAdaptationBase_Init(&(pSelf->baseObj), ctxId) != XA_RESULT_SUCCESS)
+            {
+            DEBUG_ERR("Failed to init base context!!!");
+            free(pSelf);
+            pSelf = NULL;
+            }
+        else
+            {
+            GError* gerror = 0;
+    
+    /*         Add default handler for Gst-bus messages */
+            pSelf->busCb = XAAdaptationGst_GstBusCb;
+    
+            // VASU MOD BEGINS
+            pSelf->cond_mutx_inited = XA_BOOLEAN_FALSE;
+            // VASU MOD ENDS
+    
+            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 Gst Base Context.")
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    DEBUG_API("<-XAAdaptationGst_Init");
+    return XA_RESULT_SUCCESS;
+}
+
+/*
+ * XAresult XAAdaptationGst_PostInit()
+ * 2nd phase initialization for Adaptation Base.
+ */
+XAresult XAAdaptationGst_PostInit( XAAdaptationGstCtx* ctx )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAAdaptationGst_PostInit");
+    // VASU MOD BEGINS
+    XAAdaptationBase_PostInit(&ctx->baseObj);
+    
+    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("<-XAAdaptationGst_PostInit");
+    return ret;
+}
+
+/*
+ * void XAAdaptationGst_Free( XAAdaptationGstCtx* ctx )
+ * Frees all Base context variables .
+ */
+void XAAdaptationGst_Free( XAAdaptationGstCtx* ctx )
+{
+	GstElement* fakesink = NULL;
+    DEBUG_API("->XAAdaptationGst_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));
+
+    XAAdaptationGst_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
+    XAAdaptationBase_Free(&ctx->baseObj);
+    
+    DEBUG_API("<-XAAdaptationGst_Free");
+}
+
+
+/*
+ * gboolean XAAdaptationBase_GstBusCb( GstBus *bus, GstMessage *message, gpointer data )
+ * Default Gst-bus message handler (Callback)
+ */
+gboolean XAAdaptationGst_GstBusCb( GstBus *bus, GstMessage *message, gpointer data )
+{
+    GError *error;
+    gchar *debug;
+    DEBUG_API("->XAAdaptationGst_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("<-XAAdaptationGst_GstBusCb");
+    return TRUE;
+}
+
+XAresult XAAdaptationGst_InitGstListener(XAAdaptationGstCtx* ctx)
+{
+    int ret;
+    DEBUG_API("->XAAdaptationGst_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, (XAAdaptationGst_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("<-XAAdaptationGst_InitGstListener");
+    return XA_RESULT_SUCCESS;
+}
+
+void * XAAdaptationGst_LaunchGstListener(void* args)
+{
+    XAAdaptationGstCtx* ctx = (XAAdaptationGstCtx*)args;
+    DEBUG_API("->XAAdaptationGst_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("<-XAAdaptationGst_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("<-XAAdaptationGst_LaunchGstListener");
+        pthread_exit(NULL);
+    }
+   return NULL;
+}
+
+void XAAdaptationGst_StopGstListener(XAAdaptationGstCtx* ctx)
+{
+    DEBUG_API("->XAAdaptationGst_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("<-XAAdaptationGst_StopGstListener");
+}
+
+/*
+ * ASynchronous operation managing
+ **/
+
+/* NOTE: This should NOT be called from gst callbacks - danger of deadlock!!
+ */
+void XAAdaptationGst_PrepareAsyncWait(XAAdaptationGstCtx* ctx)
+{
+    DEBUG_API("->XAAdaptationGst_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("<-XAAdaptationGst_PrepareAsyncWait");
+}
+
+void XAAdaptationGst_StartAsyncWait(XAAdaptationGstCtx* ctx)
+{
+    DEBUG_API("->XAAdaptationGst_StartAsyncWait");
+
+    /* timeout to try to avoid gst freeze in rollup */
+    ctx->asynctimer = g_timeout_add(XA_ADAPT_ASYNC_TIMEOUT,
+                                    XAAdaptationGst_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("<-XAAdaptationGst_StartAsyncWait");
+}
+
+/* async operation timeout callback*/
+gboolean XAAdaptationGst_CancelAsyncWait(gpointer ctx)
+{
+    XAAdaptationGstCtx* bCtx = (XAAdaptationGstCtx*)ctx;
+    DEBUG_API("->XAAdaptationGst_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("<-XAAdaptationGst_CancelAsyncWait");
+    /* return false to remove timer */
+    return FALSE;
+}
+
+void XAAdaptationGst_CompleteAsyncWait(XAAdaptationGstCtx* ctx)
+{
+    DEBUG_API("->XAAdaptationGst_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("<-XAAdaptationGst_CompleteAsyncWait");
+}
+
+/**
+ * GstElement* XAAdaptationGst_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* XAAdaptationGst_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("->XAAdaptationGst_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:///", 8) == 0)
+                    {
+                    fname = (char *)&((uri->URI)[8]);
+                    }
+                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);
+                        /*TODO we had to remove this line below since adaptationCtx
+                         * was  not a member of structure*/
+
+                        gstSrc = GST_ELEMENT(((XAAdaptationGstCtx*)(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(((XAAdaptationGstCtx*)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.");
+                    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.")
+            break;
+    }
+
+    if ( gstSrc )
+    {
+        DEBUG_INFO_A1("Created gstreamer source element at %x", gstSrc);
+    }
+
+    DEBUG_API("<-XAAdaptationGst_CreateGstSource");
+    return gstSrc;
+}
+
+
+/**
+ * GstElement* XAAdaptationGst_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* XAAdaptationGst_CreateGstSink( XADataSink* xaSnk, const char *name, XAboolean *isobj )
+{
+    XAuint32 locType = 0;
+    GstElement* gstSnk = NULL;
+    XADataLocator_URI* uri = NULL;
+    DEBUG_API("->XAAdaptationGst_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:///", 8) == 0)
+                    {
+                        fname = &((uri->URI)[8]);
+                    }
+                    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)
+                        {
+                            /*TODO we had to remove this line below since adaptationCtx
+                             * was  not a member of structure*/
+                        
+                            /*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.")
+                break;
+        }
+    }
+    if (gstSnk )
+    {
+        DEBUG_INFO_A1("Created gstreamer sink element at %x", gstSnk);
+    }
+    DEBUG_API("<-XAAdaptationGst_CreateGstSink");
+    return gstSnk;
+}
+
+/**
+ * GstElement* XAAdaptationGst_CreateVideoPP( )
+ * @return GstElement* - return newly created gst pipeline element
+ * Description: Create video processing pipeline
+ */
+GstElement* XAAdaptationGst_CreateVideoPP( )
+{
+    GstElement *vpp;
+    DEBUG_API("->XAAdaptationGst_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("<-XAAdaptationGst_CreateVideoPP");
+    return vpp;
+}
+
+/**
+ * GstElement* XAAdaptationGst_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* XAAdaptationGst_CreateFixedSizeVideoPP( )
+{
+    GstElement *vpp;
+    DEBUG_API("->XAAdaptationGst_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("<-XAAdaptationGst_CreateFixedSizeVideoPP");
+    return vpp;
+}
+
+
+
+/**
+ * GstElement* XAAdaptationGst_CreateVideoPPBlackScr( )
+ * @return GstElement* - return newly created gst pipeline element
+ * Description: Create video processing pipeline for black screen
+ */
+GstElement* XAAdaptationGst_CreateVideoPPBlackScr( )
+{
+    GstElement *vppBScr;
+    DEBUG_API("->XAAdaptationGst_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("<-XAAdaptationGst_CreateVideoPPBlackScr");
+    return vppBScr;
+}
+
+/**
+ * GstElement* XAAdaptationGst_CreateInputSelector( )
+ * @return GstElement* - return newly created input selector
+ * Description: Create input selector to processing between black screen and video screen
+ */
+GstElement* XAAdaptationGst_CreateInputSelector( )
+{
+    GstElement *inputSelector;
+    DEBUG_API("->XAAdaptationGst_CreateInputSelector");
+    inputSelector = gst_element_factory_make("input-selector", "input-selector");
+    if( inputSelector )
+    {
+        g_object_set(G_OBJECT(inputSelector), "select-all", TRUE, NULL);
+    }
+    DEBUG_API("<-XAAdaptationGst_CreateInputSelector");
+    return inputSelector;
+}
+
+/**
+ * GstElement* XAAdaptationGst_CreateAudioPP( )
+ * @return GstElement* - return newly created gst pipeline element
+ * Description: Create video processing pipeline
+ */
+GstElement* XAAdaptationGst_CreateAudioPP( )
+{
+    GstElement *app;
+    gboolean ok = TRUE;
+    DEBUG_API("->XAAdaptationGst_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("<-XAAdaptationGst_CreateAudioPP");
+    return app;
+}
+
+/* called when pad is actually blocking/ gets unblocked*/
+void XAAdaptationGst_PadBlockCb(GstPad *pad, gboolean blocked, gpointer user_data)
+{
+    DEBUG_API_A2("->XAAdaptationGst_PadBlockCb   pad \"%s\" of \"%s\" ",
+                        GST_OBJECT_NAME(pad),
+                        GST_OBJECT_NAME(gst_pad_get_parent_element(pad)) );
+    DEBUG_API_A1("<-XAAdaptationGst_PadBlockCb   blocked:%d",blocked);
+}
+
+/* utility to set same fields for all media types in caps */
+void XAAdaptationGst_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);
+    }
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/gst_adaptation/xaadaptationgst.h	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,168 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef XAADAPTATIONGST_H_
+#define XAADAPTATIONGST_H_
+
+#include <pthread.h>
+#include <semaphore.h>
+#include <string.h>
+#include <unistd.h>
+#include "openmaxalwrapper.h"
+#include "xaglobals.h"
+#include <gst.h>
+#include <gstappsrc.h>
+#include <gstappsink.h>
+#include <gstappbuffer.h>
+#include "xaplatform.h"
+#include "xaadptbasectx.h"
+#include <stdlib.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 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;*/
+
+
+/* STRUCTURES */
+
+/* Forward declaration of adaptation basecontext */
+typedef struct XAAdaptationGstCtx_ XAAdaptationGstCtx;
+
+/*
+ * Structure that holds all common variables for every
+ * Gst-Adaptation context structures.
+ */
+typedef struct XAAdaptationGstCtx_
+{
+    /* Common Variables for all adaptation elements */
+    XAAdaptationBaseCtx baseObj;
+
+    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*/
+
+    XAboolean       waitingasyncop;
+    sem_t           semAsyncWait;
+    guint           asynctimer;
+
+#ifdef XA_IMPL_MEASURE_GST_DELAY
+    clock_t     startTime;
+    clock_t     endTime;
+    double      diff;
+#endif /*XA_IMPL_MEASURE_GST_DELAY*/
+
+    XAboolean thread_launched;
+    pthread_mutex_t ds_mutex;
+    pthread_cond_t ds_condition;
+    XAboolean cond_mutx_inited;
+    /* FUNCTIONS*/
+
+} XAAdaptationGstCtx_;
+
+/* 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.
+ */
+ 
+XAresult XAAdaptationGst_Init( XAAdaptationGstCtx* pSelf, XAuint32 ctxId );
+XAresult XAAdaptationGst_PostInit( XAAdaptationGstCtx* ctx );
+void XAAdaptationGst_Free( XAAdaptationGstCtx* ctx );
+
+ 
+gboolean XAAdaptationGst_GstBusCb( GstBus *bus, GstMessage *message, gpointer data );
+
+XAresult XAAdaptationGst_InitGstListener(XAAdaptationGstCtx* ctx);
+void* XAAdaptationGst_LaunchGstListener(void* args);
+void XAAdaptationGst_StopGstListener(XAAdaptationGstCtx* ctx);
+
+void XAAdaptationGst_PrepareAsyncWait(XAAdaptationGstCtx* ctx);
+void XAAdaptationGst_StartAsyncWait(XAAdaptationGstCtx* ctx);
+gboolean XAAdaptationGst_CancelAsyncWait(gpointer ctx);
+void XAAdaptationGst_CompleteAsyncWait(XAAdaptationGstCtx* ctx);
+
+GstElement* XAAdaptationGst_CreateGstSource( XADataSource* xaSrc, const char *name, XAboolean *isobj, XAboolean *isPCM, XAboolean *isRawImage );
+GstElement* XAAdaptationGst_CreateGstSink( XADataSink* xaSrc, const char *name, XAboolean *isobj );
+GstElement* XAAdaptationGst_CreateVideoPP(void);
+
+GstElement* XAAdaptationGst_CreateVideoPPBlackScr(void);
+GstElement* XAAdaptationGst_CreateInputSelector(void);
+GstElement* XAAdaptationGst_CreateAudioPP(void);
+void XAAdaptationGst_PadBlockCb(GstPad *pad, gboolean blocked, gpointer user_data);
+void XAAdaptationGst_SetAllCaps (GstCaps * caps, char *field, ...);
+
+
+
+/*XAresult XAMetadataAdapt_TryWriteTags(XAAdaptationGstCtx* mCtx, GstBin* binToWriteTo);*/
+
+#endif /* XAADAPTATIONGST_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/gst_adaptation/xaaudioencoderitfadaptation.c	Fri May 14 16:22:35 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 "xaadaptationgst.h"
+//#include "XAStaticCapsAdaptation.h"
+
+/*
+ * XAresult XAAudioEncoderItfAdapt_SetEncoderSettings( XAAdaptationGstCtx *ctx,
+ *                                                     XAAudioEncoderSettings *pSettings )
+ * @param XAAdaptationGstCtx *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/gst_adaptation/xaaudioencoderitfadaptation.h	Fri May 14 16:22:35 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 XAAUDIOENCODERITFADAPTATION_H
+#define XAAUDIOENCODERITFADAPTATION_H
+
+#include "xaadptbasectx.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/gst_adaptation/xacameraadaptctx.c	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,294 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "xaadaptationgst.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 */
+            XAAdaptationGst_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.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;
+}
+
+/*
+ * XAAdaptationGstCtx* 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 = (XACameraAdaptationCtx*) calloc(1, sizeof(XACameraAdaptationCtx));
+    DEBUG_API("->XACameraAdapt_Create");
+    if ( pSelf)
+    {
+        if( XAAdaptationGst_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->baseObj;
+}
+
+/*
+ * 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;
+    }
+
+    XAAdaptationGst_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 = XAAdaptationGst_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 = XAAdaptationGst_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 */
+        if (! gst_element_link( linkedelement, cameraPP ))
+            {
+                 DEBUG_ERR("Could not link VideoPP to Camera bin!!");
+                 return XA_RESULT_INTERNAL_ERROR;
+            }
+
+        /* 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 );
+        if(! gst_element_link( cameraPP, camfilter ))
+            {
+                 DEBUG_ERR("Could not link camera bin  to camerafilter!!");
+                 return XA_RESULT_INTERNAL_ERROR;
+            }
+
+        /* Add tee element into camerabin */
+        tee = gst_element_factory_make( "tee", "CamTee");
+        gst_bin_add( GST_BIN(ctx->baseObj.bin), tee);
+        if (! gst_element_link( camfilter, tee ))
+            {
+                 DEBUG_ERR("Could not link camera filter  to tee element!!");
+                 return XA_RESULT_INTERNAL_ERROR;
+            }
+		/* 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;
+
+    XAAdaptationGst_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/gst_adaptation/xacameraadaptctx.h	Fri May 14 16:22:35 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 XACAMERAADAPTCTX_H
+#define XACAMERAADAPTCTX_H
+
+#include "xaadaptationgst.h"
+#include <photography.h>
+/* TYPEDEFS */
+
+typedef struct XACameraAdaptationCtx_ XACameraAdaptationCtx;
+
+/*
+ * Structure for Camera specific gst-adaptation variables
+ */
+typedef struct XACameraAdaptationCtx_ {
+
+    /* Parent*/
+    XAAdaptationGstCtx_ baseObj;
+
+    /* OMX-AL Variables */
+    XAuint32        deviceID;
+    XAuint32        imageEffectID;
+    XAmillidegree   curRotation;
+    XAuint32        curMirror;
+
+    /* GST Variables */
+    GstFocusStatus focusStatus;
+
+    /* Internals */
+    XAboolean       recording;
+    XAboolean       playing;
+    XAboolean       snapshotting;
+} 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/gst_adaptation/xacameraitfadaptation.c	Fri May 14 16:22:35 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 "xaadaptationgst.h"
+
+
+/*
+ * XAresult XACameraItfAdapt_SetFlashMode( XAAdaptationGstCtx *bCtx, XAuint32 flashMode );
+ */
+XAresult XACameraItfAdapt_SetFlashMode( XAAdaptationGstCtx *bCtx, XAuint32 flashMode )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAAdaptEvent event = {XA_CAMERAITFEVENTS,XA_CAMERACBEVENT_FLASHREADY,0,0};
+    GstFlashMode gstFlashmode;
+
+    DEBUG_API_A1("->XACameraItfAdapt_SetFlashMode 0x%x",(int)flashMode);
+    if(!bCtx || bCtx->baseObj.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!");
+             ret = XA_RESULT_PARAMETER_INVALID;
+             break;
+    }
+
+    if(ret == XA_RESULT_SUCCESS && 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->baseObj, &event );
+    }
+
+    DEBUG_API("<-XACameraItfAdapt_SetFlashMode");
+    return ret;
+}
+
+/*
+ * XAresult XACameraItfAdapt_SetFocusMode( XAAdaptationGstCtx *bCtx, XAuint32 focusMode,
+ *                                              XAmillimeter manualSetting,
+ *                                              XAboolean macroEnabled )
+ */
+XAresult XACameraItfAdapt_SetFocusMode( XAAdaptationGstCtx *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->baseObj.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->baseObj, &event );
+    }
+
+    DEBUG_API("<-XACameraItfAdapt_SetFocusMode");
+    return ret;
+}
+
+/*
+ * XAresult XACameraItfAdapt_SetFocusRegionPattern( XAAdaptationGstCtx *bCtx,
+ *                                                  XAuint32 focusPattern,
+ *                                                  XAuint32 activePoints1,
+ *                                                  XAuint32 activePoints2 )
+ */
+XAresult XACameraItfAdapt_SetFocusRegionPattern( XAAdaptationGstCtx *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( XAAdaptationGstCtx *bCtx, XAuint32 *pNumPositionEntries,
+ *                                                    XAFocusPointPosition *pFocusPosition )
+ */
+XAresult XACameraItfAdapt_GetFocusRegionPositions( XAAdaptationGstCtx *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( XAAdaptationGstCtx *bCtx, XAuint32 meteringMode )
+ */
+XAresult XACameraItfAdapt_SetMeteringMode( XAAdaptationGstCtx *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( XAAdaptationGstCtx *bCtx, XAuint32 exposure, XAuint32 compensation )
+ */
+XAresult XACameraItfAdapt_SetExposureMode( XAAdaptationGstCtx *bCtx, XAuint32 exposure, XAuint32 compensation )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAAdaptEvent event = {XA_CAMERAITFEVENTS,XA_CAMERACBEVENT_EXPOSURESTATUS,1,NULL};
+    GstSceneMode expmode = GST_PHOTOGRAPHY_SCENE_MODE_AUTO;
+
+    DEBUG_API_A2("->XACameraItfAdapt_SetExposureMode - exposure:%d, compensation:%d",
+                (int)exposure, (int)compensation);
+    if(!bCtx || bCtx->baseObj.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->baseObj, &event );
+    }
+
+    DEBUG_API("<-XACameraItfAdapt_SetExposureMode");
+    return ret;
+}
+
+/*
+ * XAresult XACameraItfAdapt_SetISOSensitivity( XAAdaptationGstCtx *bCtx, XAuint32 isoSensitivity, XAuint32 manualSetting )
+ */
+XAresult XACameraItfAdapt_SetISOSensitivity( XAAdaptationGstCtx *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->baseObj.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( XAAdaptationGstCtx *bCtx, XAuint32 aperture, XAuint32 manualSetting )
+ */
+XAresult XACameraItfAdapt_SetAperture( XAAdaptationGstCtx *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->baseObj.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( XAAdaptationGstCtx *bCtx, XAuint32 shutterSpeed, XAmicrosecond manualSetting )
+ */
+XAresult XACameraItfAdapt_SetShutterSpeed( XAAdaptationGstCtx *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( XAAdaptationGstCtx *bCtx, XAuint32 whiteBalance, XAuint32 manualSetting )
+ */
+XAresult XACameraItfAdapt_SetWhiteBalance( XAAdaptationGstCtx *bCtx, XAuint32 whiteBalance, XAuint32 manualSetting )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    GstWhiteBalanceMode gstWbMode = GST_PHOTOGRAPHY_WB_MODE_AUTO;
+
+    DEBUG_API_A2("->XACameraItfAdapt_SetWhiteBalance - whiteBalance:%d, manualSetting:%d",
+                (int)whiteBalance, (int)manualSetting);
+    if(!bCtx || bCtx->baseObj.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!");
+        ret = XA_RESULT_FEATURE_UNSUPPORTED;
+        break;
+    default:
+        break;
+    }
+
+    if(ret == XA_RESULT_SUCCESS && 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( XAAdaptationGstCtx *bCtx, XAuint32 locks )
+ */
+XAresult XACameraItfAdapt_SetAutoLocks( XAAdaptationGstCtx *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( XAAdaptationGstCtx *bCtx, XAuint32 zoom, XAboolean digitalEnabled, XAuint32 speed, XAboolean async )
+ */
+XAresult XACameraItfAdapt_SetZoom( XAAdaptationGstCtx *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->baseObj.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->baseObj, &event );
+    }
+
+    DEBUG_API("<-XACameraItfAdapt_SetZoom");
+    return ret;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/gst_adaptation/xacameraitfadaptation.h	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "xaadaptationgst.h"
+
+#define MAX_ZOOM 1000;
+
+/* FUNCTIONS */
+
+XAresult XACameraItfAdapt_SetFlashMode( XAAdaptationGstCtx *bCtx, XAuint32 flashMode );
+XAresult XACameraItfAdapt_SetFocusMode( XAAdaptationGstCtx *bCtx, XAuint32 focusMode, XAmillimeter manualSetting, XAboolean macroEnabled );
+XAresult XACameraItfAdapt_SetFocusRegionPattern( XAAdaptationGstCtx *bCtx, XAuint32 focusPattern, XAuint32 activePoints1, XAuint32 activePoints2 );
+XAresult XACameraItfAdapt_GetFocusRegionPositions( XAAdaptationGstCtx *bCtx, XAuint32 *pNumPositionEntries, XAFocusPointPosition *pFocusPosition );
+XAresult XACameraItfAdapt_SetMeteringMode( XAAdaptationGstCtx *bCtx, XAuint32 meteringMode );
+XAresult XACameraItfAdapt_SetExposureMode( XAAdaptationGstCtx *bCtx, XAuint32 exposure, XAuint32 compensation );
+XAresult XACameraItfAdapt_SetISOSensitivity( XAAdaptationGstCtx *bCtx, XAuint32 isoSensitivity, XAuint32 manualSetting );
+XAresult XACameraItfAdapt_SetAperture( XAAdaptationGstCtx *bCtx, XAuint32 aperture, XAuint32 manualSetting );
+XAresult XACameraItfAdapt_SetShutterSpeed( XAAdaptationGstCtx *bCtx, XAuint32 shutterSpeed, XAmicrosecond manualSetting );
+XAresult XACameraItfAdapt_SetWhiteBalance( XAAdaptationGstCtx *bCtx, XAuint32 whiteBalance, XAuint32 manualSetting );
+XAresult XACameraItfAdapt_SetAutoLocks( XAAdaptationGstCtx *bCtx, XAuint32 locks );
+XAresult XACameraItfAdapt_SetZoom( XAAdaptationGstCtx *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/gst_adaptation/xadevicevolumeitfadaptation.c	Fri May 14 16:22:35 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 "xaadaptationgst.h"
+//#include "XAStaticCapsAdaptation.h"
+
+
+/* XAresult XADeviceVolumeItfAdapt_SetVolume
+ * Description: Sets the device's volume.
+ */
+XAresult XADeviceVolumeItfAdapt_SetVolume(XAAdaptationGstCtx *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 = (gint*) 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(XAAdaptationGstCtx *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/gst_adaptation/xadevicevolumeitfadaptation.h	Fri May 14 16:22:35 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 XADEVICEVOLUMEITFADAPTATION_H_
+#define XADEVICEVOLUMEITFADAPTATION_H_
+
+#include "xaadaptationgst.h"
+
+
+/* FUNCTIONS */
+XAresult XADeviceVolumeItfAdapt_SetVolume( XAAdaptationGstCtx *bCtx, XAuint32 deviceID, XAint32 volume);
+XAresult XADeviceVolumeItfAdapt_IsDeviceIDSupported(XAAdaptationGstCtx *bCtx, XAuint32 deviceID, XAboolean *isSupported);
+#endif /* XADEVICEVOLUMEITFADAPTATION_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/gst_adaptation/xadynamicsourceitfadaptation.c	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,107 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "xaadaptationgst.h"
+#include "xamediaplayeradaptctx.h"
+#include "xadynamicsourceitfadaptation.h"
+
+/*
+ * XAresult XADynamicSourceItfAdapt_SetSource(XAAdaptationGstCtx *bCtx, XADataSource *pDataSource)
+ * @param XAAdaptationGstCtx *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(XAAdaptationGstCtx *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->baseObj.ctxId == XAMediaPlayerAdaptation || bCtx->baseObj.ctxId == XAMDAdaptation )
+    {
+        XAMediaPlayerAdaptationCtx* mCtx = (XAMediaPlayerAdaptationCtx*) bCtx;
+        GstStateChangeReturn gret;
+        GstState origState;
+        GstElement* newSource = XAAdaptationGst_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;
+        XAAdaptationGst_PrepareAsyncWait(bCtx);
+        gret = gst_element_set_state( GST_ELEMENT(bCtx->bin), bCtx->binWantedState);
+        if( gret == GST_STATE_CHANGE_ASYNC )
+        {
+            DEBUG_INFO("Wait for unroll");
+            XAAdaptationGst_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);
+        if(! gst_element_link(mCtx->source, mCtx->codecbin))
+            {
+                DEBUG_ERR("Could not link source to codecbin!!");
+                return XA_RESULT_INTERNAL_ERROR;
+            }
+        mCtx->xaSource = pDataSource;
+
+        /* restore pipeline state */
+        bCtx->binWantedState = origState;
+        DEBUG_INFO_A1("Changing pipeline back to state %s",gst_element_state_get_name(origState));
+        XAAdaptationGst_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");
+            XAAdaptationGst_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->baseObj, &event );
+        }
+    }
+    DEBUG_API("<-XADynamicSourceItfAdapt_SetSource");
+    return ret;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/gst_adaptation/xadynamicsourceitfadaptation.h	Fri May 14 16:22:35 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 "xaadaptationgst.h"
+
+
+/* FUNCTIONS */
+
+XAresult XADynamicSourceItfAdapt_SetSource(XAAdaptationGstCtx *bCtx, XADataSource *pDataSource);
+
+#endif /* XADYNAMICSOURCEITFADAPTATION_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/gst_adaptation/xaengineadaptctx.c	Fri May 14 16:22:35 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 "xaadaptationgst.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;
+}
+
+/*
+ * XAAdaptationGstCtx* XAEngineAdapt_Create()
+ * Allocates memory for Engine Adaptation Context and makes 1st phase initialization
+ * @returns XAEngineAdaptationCtx* - Pointer to created context
+ */
+XAAdaptationGstCtx* XAEngineAdapt_Create()
+{
+    XAEngineAdaptationCtx *pSelf = NULL;
+    DEBUG_API("->XAEngineAdapt_Create");
+
+    pSelf = (XAEngineAdaptationCtx*)calloc(1, sizeof(XAEngineAdaptationCtx));
+    if ( pSelf)
+    {
+        if( XAAdaptationBase_Init(&(pSelf->baseObj.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 (XAAdaptationGstCtx*)pSelf;
+}
+
+/*
+ * XAresult XAEngineAdapt_PostInit()
+ * 2nd phase initialization of engine Adaptation Context
+ */
+XAresult XAEngineAdapt_PostInit(XAAdaptationGstCtx* bCtx)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    GstStateChangeReturn gret = GST_STATE_CHANGE_SUCCESS;
+    XAEngineAdaptationCtx* ctx = NULL;
+
+    DEBUG_API("->XAEngineAdapt_PostInit");
+    if( !bCtx || bCtx->baseObj.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.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 = XAAdaptationGst_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;
+    XAAdaptationGst_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");
+        XAAdaptationGst_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(XAAdaptationGstCtx* bCtx)
+{
+	XAEngineAdaptationCtx* ctx = NULL;
+
+	DEBUG_API("->XAEngineAdapt_Destroy");
+	if( !bCtx || bCtx->baseObj.ctxId != XAEngineAdaptation )
+	{
+		DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+		DEBUG_API("<-XAEngineAdapt_Destroy");
+		return;
+	}
+	ctx = (XAEngineAdaptationCtx*)bCtx;
+
+    XAAdaptationBase_Free(&(ctx->baseObj.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/gst_adaptation/xaengineadaptctx.h	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "xaadaptationgst.h"
+//#include "XAStaticCapsAdaptation.h"
+
+/* TYPEDEFS */
+
+typedef struct XAEngineAdaptationCtx_ XAEngineAdaptationCtx;
+
+typedef struct XAEngineAdaptationCtx_
+{
+    /* Parent*/
+    XAAdaptationGstCtx_    baseObj;
+
+} XAEngineAdaptationCtx_;
+
+/* FUNCTIONS */
+XAAdaptationGstCtx* XAEngineAdapt_Create(void);
+XAresult XAEngineAdapt_PostInit(XAAdaptationGstCtx* bCtx);
+void XAEngineAdapt_Destroy(XAAdaptationGstCtx* bCtx);
+
+#endif /* XAENGINEADAPTCTX_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/gst_adaptation/xaequalizeritfadaptation.c	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,268 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#include <gst.h>
+#include "xaadaptationgst.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(XAAdaptationGstCtx *bCtx,
+ *                                                XAmillibel *pMin,
+ *                                                XAmillibel *pMax)
+ */
+XAresult XAEqualizerItfAdapt_GetBandLevelRange(XAAdaptationGstCtx *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(XAAdaptationGstCtx *bCtx,
+ *                                           XAuint16 band,
+ *                                           XAmillibel level)
+ */
+XAresult XAEqualizerItfAdapt_SetBandLevel(XAAdaptationGstCtx *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->baseObj.ctxId == XAMediaPlayerAdaptation || bCtx->baseObj.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->baseObj.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->baseObj.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(XAAdaptationGstCtx *bCtx,
+ *                                            XAuint16 band,
+ *                                            XAmilliHertz *pCenter)
+ */
+
+XAresult XAEqualizerItfAdapt_GetCenterFreq(XAAdaptationGstCtx *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(XAAdaptationGstCtx *bCtx,
+ *                                               XAuint16 band,
+ *                                               XAmilliHertz *pMin,
+ *                                               XAmilliHerts *pMax)
+ */
+XAresult XAEqualizerItfAdapt_GetBandFreqRange(XAAdaptationGstCtx *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(XAAdaptationGstCtx *bCtx,
+ *                                      XAmilliHertz frequency,
+ *                                      XAuint16 *pBand)
+ */
+XAresult XAEqualizerItfAdapt_GetBand(XAAdaptationGstCtx *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(XAAdaptationGstCtx *bCtx,
+ *                                           XAuint16 band,
+ *                                           XAmillibel *pLevel)
+ */
+XAresult XAEqualizerItfAdapt_GetDefaultBandLevel(XAAdaptationGstCtx *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;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/gst_adaptation/xaequalizeritfadaptation.h	Fri May 14 16:22:35 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 XAEQUALIZERITFADAPTATION_H
+#define XAEQUALIZERITFADAPTATION_H
+
+#include "xaadaptationgst.h"
+#include "xathreadsafety.h"
+
+/* MACROS */
+#define EQUALIZER_NUM_OF_BANDS 10
+#define EQUALIZER_DEFAULT_BAND_LEVEL 0
+
+/* FUNCTIONS */
+XAresult XAEqualizerItfAdapt_GetBandLevelRange(XAAdaptationGstCtx *bCtx,
+                                               XAmillibel *pMin,
+                                               XAmillibel *pMax);
+
+XAresult XAEqualizerItfAdapt_SetBandLevel(XAAdaptationGstCtx *bCtx,
+                                          XAuint16 band,
+                                          XAmillibel level);
+
+XAresult XAEqualizerItfAdapt_GetCenterFreq(XAAdaptationGstCtx *bCtx,
+                                           XAuint16 band,
+                                           XAmilliHertz *pCenter);
+
+XAresult XAEqualizerItfAdapt_GetBandFreqRange(XAAdaptationGstCtx *bCtx,
+                                              XAuint16 band,
+                                              XAmilliHertz *pMin,
+                                              XAmilliHertz *pMax);
+
+XAresult XAEqualizerItfAdapt_GetBand(XAAdaptationGstCtx *bCtx,
+                                     XAmilliHertz frequency,
+                                     XAuint16 *pBand);
+
+XAresult XAEqualizerItfAdapt_GetDefaultBandLevel(XAAdaptationGstCtx *bCtx,
+                                                 XAuint16 index,
+                                                 XAint16 *pLevel);
+
+#endif /* XAEQUALIZERITFADAPTATION_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/gst_adaptation/xagstcapabilitiesmgr.c	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,370 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "xagstcapabilitiesmgr.h"
+#include <stdio.h>
+#include <string.h>
+
+static XAresult XAGSTCapabilitiesMgr_GetAudioAACEncoderCapabilities(XACapabilities **ppNode);
+static XAresult XAGSTCapabilitiesMgr_GetAudioAMREncoderCapabilities(XACapabilities **ppNode);
+static XAresult XAGSTCapabilitiesMgr_GetAudioPCMEncoderCapabilities(XACapabilities **ppNode);
+
+/* XAresult XAGSTCapabilitiesMgr_UpdateCapabilitieList
+ * Description: Update the capabilities list supported by GStreamer framework.
+ */
+XAresult XAGSTCapabilitiesMgr_UpdateCapabilitieList(
+                FrameworkMap *frameworkMap,
+                XACapabilities **ppListHead)
+
+{
+    XAresult res = XA_RESULT_SUCCESS;
+    XACapabilities *newNode = NULL;
+    FWMgrFwType fwtype = FWMgrFWUknown;
+    char *uri = NULL;
+    XACapabilities *lastNode;
+    XACapabilities *firstNode;
+
+    DEBUG_API("->XAGSTCapabilitiesMgr_UpdateCapabilitieList");
+
+    if(!frameworkMap || !ppListHead)
+    {
+        res = XA_RESULT_PARAMETER_INVALID;
+        return res;
+    }
+    
+    lastNode = firstNode = *ppListHead;
+    
+    /* traverse and point to the last node in the list */
+    while(lastNode && lastNode->next)
+    {
+        lastNode = lastNode->next;
+    }
+
+
+    uri = "file:///c:/test.mp4";
+    fwtype = XAFrameworkMgr_GetFramework(
+            frameworkMap,
+            uri,
+            FWMgrMORecorder);
+    
+    if(fwtype == FWMgrFWGST)
+    {
+	    /* Add codec capabilities */
+	    newNode = NULL;
+	    res = XAGSTCapabilitiesMgr_GetAudioAACEncoderCapabilities(&newNode);
+	    if (res != XA_RESULT_SUCCESS)
+	        {
+	        return res;
+	        }
+	    if (lastNode)
+	    {
+	        lastNode->next = newNode;
+	    }
+	    if (newNode)
+	    { /* if a new node is created move lastNode to the new item */
+	        if (!firstNode)
+	            firstNode = newNode;
+	        lastNode = newNode;
+	    }
+    }
+    
+
+    uri = "file:///c:/test.amr";
+    fwtype = XAFrameworkMgr_GetFramework(
+            frameworkMap,
+            uri,
+            FWMgrMORecorder);
+    
+    if(fwtype == FWMgrFWGST)
+    {
+	    newNode = NULL;
+	    res = XAGSTCapabilitiesMgr_GetAudioAMREncoderCapabilities(&newNode);
+	    if (res != XA_RESULT_SUCCESS)
+	        {
+	        return res;
+	        }
+	    if (lastNode)
+	    {
+	        lastNode->next = newNode;
+	    }
+	    if (newNode)
+	    { /* if a new node is created move lastNode to the new item */
+	        if (!firstNode)
+	            firstNode = newNode;
+	        lastNode = newNode;
+	    }
+    }
+
+    uri = "file:///c:/test.wav";
+    fwtype = XAFrameworkMgr_GetFramework(
+            frameworkMap,
+            uri,
+            FWMgrMORecorder);
+    
+    if(fwtype == FWMgrFWGST)
+    {
+	    newNode = NULL;
+	    res = XAGSTCapabilitiesMgr_GetAudioPCMEncoderCapabilities(&newNode);
+	    if (res != XA_RESULT_SUCCESS)
+	        {
+	        return res;
+	        }
+	    if (lastNode)
+	    {
+	        lastNode->next = newNode;
+	    }
+	    if (newNode)
+	    { /* if a new node is created move lastNode to the new item */
+	        if (!firstNode)
+	            firstNode = newNode;
+	        lastNode = newNode;
+	    }
+    }
+    /* if empty list, then append first node as the head */
+    if (!(*ppListHead))
+        {
+        *ppListHead = firstNode;
+        }
+    DEBUG_API("<-XAGSTCapabilitiesMgr_UpdateCapabilitieList");
+    return res;
+}
+
+XAresult XAGSTCapabilitiesMgr_GetAudioAACEncoderCapabilities(XACapabilities **ppNode)
+{
+    XAresult res = XA_RESULT_SUCCESS;
+    XACapabilities *newNode = NULL;
+    XAAudioCodecDescriptor *entries = NULL;
+    XAchar aacencelement[] = "nokiaaacenc";
+    int strLen = 0;
+    
+    newNode = (XACapabilities *)calloc(1, sizeof(XACapabilities));
+    if (!newNode)
+    {
+        res = XA_RESULT_MEMORY_FAILURE;
+        return res;
+    }
+
+    newNode->capsType = AUD_E;
+    newNode->xaid = XA_AUDIOCODEC_AAC;
+    newNode->noOfEntries = 1;
+    
+    
+    strLen = strlen((char*)aacencelement);
+    newNode->adaptId = (XAchar *)calloc(strLen + 1, sizeof(XAchar));    
+    if (!newNode->adaptId)
+    {
+        res = XA_RESULT_MEMORY_FAILURE;
+        XACapabilitiesMgr_DeleteCapabilitieList(&newNode);
+        return res;
+    }
+
+    strncpy((char*)newNode->adaptId, (char*)aacencelement, strLen);
+    newNode->adaptId[strLen] = '\0'; /*Null terminate it*/
+    
+    /* Allocate array */
+    entries = (XAAudioCodecDescriptor*)calloc(1, sizeof(XAAudioCodecDescriptor));
+    if (!entries)
+    {
+        res = XA_RESULT_MEMORY_FAILURE;
+        XACapabilitiesMgr_DeleteCapabilitieList(&newNode);
+        return res;
+    }
+
+    newNode->pEntry = (void*)entries;
+ 
+    entries->maxChannels = 2;
+    entries->minBitsPerSample = 16;
+    entries->maxBitsPerSample = 16;
+    entries->minSampleRate = 8000000;  /*milliHz*/
+    entries->maxSampleRate = 48000000;
+    entries->isFreqRangeContinuous=XA_BOOLEAN_FALSE;
+    entries->numSampleRatesSupported = 7;
+    entries->pSampleRatesSupported = (XAmilliHertz*)calloc(entries->numSampleRatesSupported, sizeof(XAmilliHertz));
+    if (!entries->pSampleRatesSupported)
+    {
+        res = XA_RESULT_MEMORY_FAILURE;
+        XACapabilitiesMgr_DeleteCapabilitieList(&newNode);
+        return res;
+    }
+    /* entries in milliHz */
+    entries->pSampleRatesSupported[0] = 8000000;
+    entries->pSampleRatesSupported[1] = 11025000;
+    entries->pSampleRatesSupported[2] = 16000000;
+    entries->pSampleRatesSupported[3] = 22050000;
+    entries->pSampleRatesSupported[4] = 32000000;
+    entries->pSampleRatesSupported[5] = 44100000;
+    entries->pSampleRatesSupported[6] = 48000000;
+
+    entries->minBitRate = 32000;
+    entries->maxBitRate = 256000;
+    entries->isBitrateRangeContinuous = XA_BOOLEAN_FALSE;
+    entries->numBitratesSupported = 8;
+    entries->pBitratesSupported = (XAuint32*)calloc(entries->numBitratesSupported, sizeof(XAuint32));
+    if (!entries->pBitratesSupported)
+    {
+        res = XA_RESULT_MEMORY_FAILURE;
+        XACapabilitiesMgr_DeleteCapabilitieList(&newNode);
+        return res;
+    }
+    (entries->pBitratesSupported)[0] = 32000;
+    (entries->pBitratesSupported)[1] = 64000;
+    (entries->pBitratesSupported)[2] = 96000;
+    (entries->pBitratesSupported)[3] = 128000;
+    (entries->pBitratesSupported)[4] = 160000;
+    (entries->pBitratesSupported)[5] = 192000;
+    (entries->pBitratesSupported)[6] = 224000;
+    (entries->pBitratesSupported)[7] = 256000;
+
+    entries->profileSetting = XA_AUDIOPROFILE_AAC_AAC;
+    entries->modeSetting = XA_AUDIOMODE_AAC_LC;
+
+    newNode->pEntry = (void*)entries;
+
+    *ppNode = newNode;
+    return res;
+}
+
+XAresult XAGSTCapabilitiesMgr_GetAudioAMREncoderCapabilities(XACapabilities **ppNode)
+{
+    XAresult res = XA_RESULT_SUCCESS;
+    XACapabilities *newNode = NULL;
+    XAAudioCodecDescriptor *entries = NULL;
+ 
+    newNode = (XACapabilities *)calloc(1, sizeof(XACapabilities));
+    if (!newNode)
+    {
+        res = XA_RESULT_MEMORY_FAILURE;
+        return res;
+    }
+
+    newNode->capsType = AUD_E;
+    newNode->xaid = XA_AUDIOCODEC_AMR;
+    newNode->noOfEntries = 1;
+
+    /* Allocate array */
+    entries = (XAAudioCodecDescriptor*)calloc(1, sizeof(XAAudioCodecDescriptor));
+    if (!entries)
+    {
+        res = XA_RESULT_MEMORY_FAILURE;
+        XACapabilitiesMgr_DeleteCapabilitieList(&newNode);
+        return res;
+    }
+
+    newNode->pEntry = (void*)entries;
+ 
+    entries->maxChannels = 1;
+    entries->minBitsPerSample = 8;
+    entries->maxBitsPerSample = 8;
+    entries->minSampleRate = 8000000;  /*milliHz*/
+    entries->maxSampleRate = 8000000;
+    entries->isFreqRangeContinuous=XA_BOOLEAN_TRUE;
+    entries->numSampleRatesSupported = 1;
+    entries->minBitRate=4750;
+    entries->maxBitRate=12200;
+    entries->isBitrateRangeContinuous=XA_BOOLEAN_FALSE;
+    entries->numBitratesSupported = 8;
+    entries->pBitratesSupported = (XAuint32*)calloc(entries->numBitratesSupported, sizeof(XAuint32));
+    if (!entries->pBitratesSupported)
+    {
+        res = XA_RESULT_MEMORY_FAILURE;
+        XACapabilitiesMgr_DeleteCapabilitieList(&newNode);
+        return res;
+    }
+    (entries->pBitratesSupported)[0] = 4750;
+    (entries->pBitratesSupported)[1] = 5150;
+    (entries->pBitratesSupported)[2] = 5900;
+    (entries->pBitratesSupported)[3] = 6700;
+    (entries->pBitratesSupported)[4] = 7400;
+    (entries->pBitratesSupported)[5] = 7950;
+    (entries->pBitratesSupported)[6] = 10200;
+    (entries->pBitratesSupported)[7] = 12200;
+
+    entries->profileSetting = XA_AUDIOPROFILE_AMR;
+    entries->modeSetting = 0;
+
+    newNode->pEntry = (void*)entries;
+
+    *ppNode = newNode;
+    return res;
+}
+
+XAresult XAGSTCapabilitiesMgr_GetAudioPCMEncoderCapabilities(XACapabilities **ppNode)
+{
+    XAresult res = XA_RESULT_SUCCESS;
+    XACapabilities *newNode = NULL;
+    XAAudioCodecDescriptor *entries = NULL;
+
+    newNode = (XACapabilities *)calloc(1, sizeof(XACapabilities));
+    if (!newNode)
+    {
+        res = XA_RESULT_MEMORY_FAILURE;
+        return res;
+    }
+
+    newNode->capsType = AUD_E;
+    newNode->xaid = XA_AUDIOCODEC_PCM;
+    newNode->noOfEntries = 1;
+
+    /* Allocate array */
+    entries = (XAAudioCodecDescriptor*)calloc(1, sizeof(XAAudioCodecDescriptor));
+    if (!entries)
+    {
+        res = XA_RESULT_MEMORY_FAILURE;
+        XACapabilitiesMgr_DeleteCapabilitieList(&newNode);
+        return res;
+    }
+
+    newNode->pEntry = (void*)entries;
+
+    entries->maxChannels = 2;
+    entries->minBitsPerSample = 16;
+    entries->maxBitsPerSample = 16;
+    entries->minSampleRate = 8000000;  /*milliHz*/
+    entries->maxSampleRate = 96000000;
+    entries->isFreqRangeContinuous=XA_BOOLEAN_FALSE;
+    entries->numSampleRatesSupported = 10;
+    entries->pSampleRatesSupported = (XAmilliHertz*)calloc(entries->numSampleRatesSupported, sizeof(XAmilliHertz));
+    if (!entries->pSampleRatesSupported)
+    {
+        res = XA_RESULT_MEMORY_FAILURE;
+        XACapabilitiesMgr_DeleteCapabilitieList(&newNode);
+        return res;
+    }
+    /* entries in milliHz */
+    entries->pSampleRatesSupported[0] = 12000000;
+    entries->pSampleRatesSupported[1] = 16000000;
+    entries->pSampleRatesSupported[2] = 22050000;
+    entries->pSampleRatesSupported[3] = 24000000;
+    entries->pSampleRatesSupported[4] = 32000000;
+    entries->pSampleRatesSupported[5] = 44100000;
+    entries->pSampleRatesSupported[6] = 48000000;
+    entries->pSampleRatesSupported[7] = 64000000;
+    entries->pSampleRatesSupported[8] = 88200000;
+    entries->pSampleRatesSupported[9] = 96000000;
+
+    entries->minBitRate = 0;
+    entries->maxBitRate = 0;
+    entries->isBitrateRangeContinuous = XA_BOOLEAN_FALSE;
+    entries->pBitratesSupported = NULL;
+    entries->numBitratesSupported = 0;
+    entries->profileSetting = XA_AUDIOPROFILE_PCM;
+    entries->modeSetting = 0;
+
+    newNode->pEntry = (void*)entries;
+
+    *ppNode = newNode;
+    return res;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/gst_adaptation/xagstcapabilitiesmgr.h	Fri May 14 16:22:35 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 XAGSTCAPABILITIESMGR_H
+#define XAGSTCAPABILITIESMGR_H
+
+#include "openmaxalwrapper.h"
+#include "xaframeworkmgr.h"
+#include "xacapabilitiesmgr.h"
+
+XAresult XAGSTCapabilitiesMgr_UpdateCapabilitieList(
+                FrameworkMap *frameworkMap,
+                XACapabilities** ppListHead);
+
+#endif /* XAGSTCAPABILITIESMGR_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/gst_adaptation/xaimagecontrolsitfadaptation.c	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,325 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "xaadaptationgst.h"
+#include "xamediaplayeradaptctx.h"
+#include "xamediarecorderadaptctx.h"
+#include "xacameraadaptctx.h"
+#include "xaimagecontrolsitfadaptation.h"
+
+/*
+ * XAresult XAImageControlsItfAdapt_SetBrightness(XAAdaptationGstCtx *bCtx,
+ *                                                XAuint32 brightness)
+ */
+XAresult XAImageControlsItfAdapt_SetBrightness(XAAdaptationGstCtx *bCtx,
+                                               XAuint32 brightness)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+
+    gdouble gstBrightness = 0;
+    XAint32 tempBrightness = 0;
+    GstElement *balanceElement = NULL;
+    DEBUG_API("->XAImageControlsItfAdapt_SetBrightness")
+
+    if(!bCtx || (bCtx->baseObj.ctxId != XAMediaPlayerAdaptation && bCtx->baseObj.ctxId != XAMediaRecorderAdaptation
+       && bCtx->baseObj.ctxId != XACameraAdaptation))
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAImageControlsItfAdapt_SetBrightness")
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if( bCtx->baseObj.ctxId == XAMediaRecorderAdaptation )
+    {
+        XAMediaRecorderAdaptationCtx* ctx = (XAMediaRecorderAdaptationCtx*) bCtx;
+
+        balanceElement = gst_bin_get_by_name( GST_BIN(ctx->baseObj.bin), "pp_balance");
+    }
+    if( bCtx->baseObj.ctxId == XAMediaPlayerAdaptation )
+    {
+        XAMediaPlayerAdaptationCtx* ctx = (XAMediaPlayerAdaptationCtx*) bCtx;
+
+        balanceElement = gst_bin_get_by_name( GST_BIN(ctx->baseObj.bin), "pp_balance");
+    }
+    if( bCtx->baseObj.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->baseObj.ctxId == XAMediaPlayerAdaptation)
+        {
+            ret = XAImageControlsItfAdapt_HandleImageType(bCtx);
+        }
+    }
+
+	if ( balanceElement )
+	{
+        gst_object_unref(balanceElement);
+	}
+
+    DEBUG_API("<-XAImageControlsItfAdapt_SetBrightness")
+    return ret;
+}
+
+/*
+ * XAresult XAImageControlsItfAdapt_SetContrast(XAAdaptationGstCtx *bCtx,
+ *                                              XAuint32 contrast)
+ */
+XAresult XAImageControlsItfAdapt_SetContrast(XAAdaptationGstCtx *bCtx,
+                                             XAint32 contrast)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+
+    gdouble gstContrast = 1;
+    GstElement *balanceElement = NULL;
+    DEBUG_API("->XAImageControlsItfAdapt_SetContrast")
+
+    if(!bCtx || (bCtx->baseObj.ctxId != XAMediaPlayerAdaptation && bCtx->baseObj.ctxId != XAMediaRecorderAdaptation
+       && bCtx->baseObj.ctxId != XACameraAdaptation))
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAImageControlsItfAdapt_SetContrast")
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if( bCtx->baseObj.ctxId == XAMediaPlayerAdaptation )
+    {
+        XAMediaPlayerAdaptationCtx* ctx = (XAMediaPlayerAdaptationCtx*) bCtx;
+
+        balanceElement = gst_bin_get_by_name( GST_BIN(ctx->baseObj.bin), "pp_balance");
+    }
+    if( bCtx->baseObj.ctxId == XAMediaRecorderAdaptation )
+    {
+        XAMediaRecorderAdaptationCtx* ctx = (XAMediaRecorderAdaptationCtx*) bCtx;
+
+        balanceElement = gst_bin_get_by_name( GST_BIN(ctx->baseObj.bin), "pp_balance");
+    }
+    if( bCtx->baseObj.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->baseObj.ctxId == XAMediaPlayerAdaptation)
+        {
+            ret = XAImageControlsItfAdapt_HandleImageType(bCtx);
+        }
+    }
+
+	if ( balanceElement )
+	{
+        gst_object_unref(balanceElement);
+	}
+
+    DEBUG_API("<-XAImageControlsItfAdapt_SetContrast")
+    return ret;
+}
+
+/*
+ * XAresult XAImageControlsItfAdapt_SetGamma(XAAdaptationGstCtx *bCtx,
+ *                                           XApermille gamma)
+ */
+XAresult XAImageControlsItfAdapt_SetGamma(XAAdaptationGstCtx *bCtx,
+                                          XApermille gamma)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+
+    gdouble gstGamma=0;
+    GstElement *gammaElement = NULL;
+    DEBUG_API("->XAImageControlsItfAdapt_SetGamma")
+
+    if(!bCtx || (bCtx->baseObj.ctxId != XAMediaPlayerAdaptation && bCtx->baseObj.ctxId != XAMediaRecorderAdaptation
+       && bCtx->baseObj.ctxId != XACameraAdaptation))
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAImageControlsItfAdapt_SetGamma")
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if( bCtx->baseObj.ctxId == XAMediaPlayerAdaptation )
+    {
+        XAMediaPlayerAdaptationCtx* ctx = (XAMediaPlayerAdaptationCtx*) bCtx;
+
+        gammaElement = gst_bin_get_by_name( GST_BIN(ctx->baseObj.bin), "pp_gamma");
+    }
+
+    if( bCtx->baseObj.ctxId == XAMediaRecorderAdaptation )
+    {
+        XAMediaRecorderAdaptationCtx* ctx = (XAMediaRecorderAdaptationCtx*) bCtx;
+
+        gammaElement = gst_bin_get_by_name( GST_BIN(ctx->baseObj.bin), "pp_gamma");
+    }
+
+    if( bCtx->baseObj.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->baseObj.ctxId == XAMediaPlayerAdaptation)
+        {
+            ret = XAImageControlsItfAdapt_HandleImageType(bCtx);
+        }
+    }
+
+	if ( gammaElement )
+	{
+        gst_object_unref(gammaElement);
+	}
+
+    DEBUG_API("<-XAImageControlsItfAdapt_SetGamma")
+    return ret;
+}
+
+/*
+ * XAresult XAImageControlsItfAdapt_GetSupportedGammaSettings(XAAdaptationGstCtx *bCtx,
+ *                                                            XApermille *pMinValue,
+ *                                                            XApermille *pMaxValue,
+ *                                                            XAuint32 *pNumSettings,
+ *                                                            XApermille **ppSettings)
+ */
+XAresult XAImageControlsItfAdapt_GetSupportedGammaSettings(XAAdaptationGstCtx *bCtx,
+                                                           XApermille *pMinValue,
+                                                           XApermille *pMaxValue,
+                                                           XAuint32 *pNumSettings,
+                                                           XApermille **ppSettings)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAImageControlsItfAdapt_GetSupportedGammaSettings")
+
+    if(!bCtx || (bCtx->baseObj.ctxId != XAMediaPlayerAdaptation && bCtx->baseObj.ctxId != XAMediaRecorderAdaptation
+       && bCtx->baseObj.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_HandleImageType(XAAdaptationGstCtx *bCtx)
+ * Description: this run gstreamer for image type
+ *
+ */
+XAresult XAImageControlsItfAdapt_HandleImageType(XAAdaptationGstCtx *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->baseObj.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);
+            if(gstRet == GST_STATE_CHANGE_SUCCESS && gstTmpState == GST_STATE_READY)
+                {
+                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/gst_adaptation/xaimagecontrolsitfadaptation.h	Fri May 14 16:22:35 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: 
+*
+*/
+
+#ifndef XAIMAGECONTROLSITFADAPTATION_H
+#define XAIMAGECONTROLSITFADAPTATION_H
+
+#include "xaadaptationgst.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(XAAdaptationGstCtx *bCtx,
+                                               XAuint32 brightness);
+
+XAresult XAImageControlsItfAdapt_SetContrast(XAAdaptationGstCtx *bCtx,
+                                             XAint32 contrast);
+
+XAresult XAImageControlsItfAdapt_SetGamma(XAAdaptationGstCtx *bCtx,
+                                          XApermille gamma);
+
+XAresult XAImageControlsItfAdapt_GetSupportedGammaSettings(XAAdaptationGstCtx *bCtx,
+                                                           XApermille *pMinValue,
+                                                           XApermille *pMaxValue,
+                                                           XAuint32 *pNumSettings,
+                                                           XApermille **ppSettings);
+
+XAresult XAImageControlsItfAdapt_HandleImageType(XAAdaptationGstCtx *bCtx);
+#endif /* XAIMAGECONTROLSITFADAPTATION_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/gst_adaptation/xaimageeffectsitfadaptation.c	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,661 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "xaadaptationgst.h"
+#include "xamediaplayeradaptctx.h"
+#include "xamediarecorderadaptctx.h"
+#include "xacameraadaptctx.h"
+#include "xaimageeffectsitfadaptation.h"
+
+/*
+ * XAresult XAImageEffectsItfAdapt_QuerySupportedImageEffects(XAAdaptationGstCtx *bCtx,
+ *                                                            XAuint32 index,
+ *                                                            XAuint32 *pImageEffectId)
+ */
+XAresult XAImageEffectsItfAdapt_QuerySupportedImageEffects(XAAdaptationGstCtx *bCtx,
+                                                           XAuint32 index,
+                                                           XAuint32 *pImageEffectId)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAImageEffectsItfAdapt_QuerySupportedImageEffects")
+
+    if(!bCtx || (bCtx->baseObj.ctxId != XAMediaPlayerAdaptation && bCtx->baseObj.ctxId != XAMediaRecorderAdaptation
+       && bCtx->baseObj.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->baseObj.ctxId == XAMediaPlayerAdaptation || bCtx->baseObj.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->baseObj.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(XAAdaptationGstCtx *bCtx,
+ *                                                   XAuint32 imageEffectID)
+ */
+XAresult XAImageEffectsItfAdapt_EnableImageEffect(XAAdaptationGstCtx *bCtx,
+                                                  XAuint32 imageEffectID)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    gdouble tempImageEffect = 0;
+    GstElement *balanceElement = NULL;
+    DEBUG_API("->XAImageEffectsItfAdapt_EnableImageEffect")
+
+    if(!bCtx || (bCtx->baseObj.ctxId != XAMediaPlayerAdaptation && bCtx->baseObj.ctxId != XAMediaRecorderAdaptation
+       && bCtx->baseObj.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->baseObj.ctxId == XAMediaPlayerAdaptation || bCtx->baseObj.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->baseObj.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->baseObj.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->baseObj.ctxId == XACameraAdaptation )
+    {
+        XACameraAdaptationCtx* mCtx = (XACameraAdaptationCtx*) bCtx;
+        GstColourToneMode 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(XAAdaptationGstCtx *bCtx,
+ *                                                    XAuint32 imageEffectID)
+ */
+XAresult XAImageEffectsItfAdapt_DisableImageEffect(XAAdaptationGstCtx *bCtx,
+                                                   XAuint32 imageEffectID)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAuint32 tempImageEffect = 0;
+    GstElement *balanceElement = NULL;
+    DEBUG_API("->XAImageEffectsItfAdapt_DisableImageEffect")
+
+    if(!bCtx || (bCtx->baseObj.ctxId != XAMediaPlayerAdaptation && bCtx->baseObj.ctxId != XAMediaRecorderAdaptation
+       && bCtx->baseObj.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->baseObj.ctxId == XAMediaPlayerAdaptation || bCtx->baseObj.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->baseObj.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->baseObj.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->baseObj.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(XAAdaptationGstCtx *bCtx,
+ *                                                      XAuint32 imageEffectID,
+ *                                                      XAboolean *pEnabled)
+ */
+XAresult XAImageEffectsItfAdapt_IsImageEffectEnabled(XAAdaptationGstCtx *bCtx,
+                                                     XAuint32 imageEffectID,
+                                                     XAboolean *pEnabled)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAuint32 tempImageEffect = 0;
+    DEBUG_API("->XAImageEffectsItfAdapt_IsImageEffectEnabled")
+
+    if(!bCtx || (bCtx->baseObj.ctxId != XAMediaPlayerAdaptation && bCtx->baseObj.ctxId != XAMediaRecorderAdaptation
+       && bCtx->baseObj.ctxId != XACameraAdaptation) || !pEnabled)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAImageEffectsItfAdapt_IsImageEffectEnabled")
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if(bCtx->baseObj.ctxId == XAMediaPlayerAdaptation)
+    {
+        XAMediaPlayerAdaptationCtx* mCtx = (XAMediaPlayerAdaptationCtx*) bCtx;
+        tempImageEffect = mCtx->imageEffectID;
+    }
+
+    if(bCtx->baseObj.ctxId == XAMediaRecorderAdaptation)
+    {
+        XAMediaRecorderAdaptationCtx* mCtx = (XAMediaRecorderAdaptationCtx*) bCtx;
+        tempImageEffect = mCtx->imageEffectID;
+    }
+
+    /* check is effect enabled for player and recorder */
+    if(bCtx->baseObj.ctxId == XAMediaPlayerAdaptation || bCtx->baseObj.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->baseObj.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_HandleImageType(XAAdaptationGstCtx *bCtx)
+ * Description: this run gstreamer for image type
+ *
+ */
+XAresult XAImageEffectsItfAdapt_HandleImageType(XAAdaptationGstCtx *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->baseObj.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);
+            if(gstRet == GST_STATE_CHANGE_SUCCESS && gstTmpState == GST_STATE_READY)
+                {
+                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/gst_adaptation/xaimageeffectsitfadaptation.h	Fri May 14 16:22:35 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: 
+*
+*/
+
+#ifndef XAIMAGEEFFECTSITFADAPTATION_H
+#define XAIMAGEEFFECTSITFADAPTATION_H
+
+#include "xaadaptationgst.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(XAAdaptationGstCtx *bCtx,
+                                                           XAuint32 index,
+                                                           XAuint32 *pImageEffectId);
+
+XAresult XAImageEffectsItfAdapt_EnableImageEffect(XAAdaptationGstCtx *bCtx,
+                                                  XAuint32 imageEffectID);
+
+XAresult XAImageEffectsItfAdapt_DisableImageEffect(XAAdaptationGstCtx *bCtx,
+                                                   XAuint32 imageEffectID);
+
+XAresult XAImageEffectsItfAdapt_IsImageEffectEnabled(XAAdaptationGstCtx *bCtx,
+                                                     XAuint32 imageEffectID,
+                                                     XAboolean *pEnabled);
+
+XAresult XAImageEffectsItfAdapt_HandleImageType(XAAdaptationGstCtx *bCtx);
+#endif /* XAIMAGEEFFECTSITFADAPTATION_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/gst_adaptation/xaimageencoderitfadaptation.c	Fri May 14 16:22:35 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 "xamediarecorderadaptctx.h"
+#include "xaimageencoderitfadaptation.h"
+#include "xacapabilitiesmgr.h"
+
+
+/*
+ * XAresult XAImageEncoderItfAdapt_SetImageSettings( XAAdaptationGstCtx *bCtx,
+ *                                                   XAImageSettings *pSettings )
+ * @param XAAdaptationGstCtx *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( XAAdaptationGstCtx *bCtx,
+                                                  const XAImageSettings *pSettings )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAMediaRecorderAdaptationCtx* mCtx = NULL;
+    XACapabilities temp;
+
+    DEBUG_API("->XAImageEncoderAdapt_SetImageSettings");
+
+    if( !bCtx || (bCtx->baseObj.ctxId != XAMediaRecorderAdaptation) || !pSettings )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    mCtx = (XAMediaRecorderAdaptationCtx*) bCtx;
+    if(XACapabilitiesMgr_GetCapsById(NULL, (XACapsType)(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( XAAdaptationGstCtx *bCtx,
+                                                  XAImageSettings *pSettings )
+{
+    XAMediaRecorderAdaptationCtx* mCtx = NULL;
+    XAresult ret = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XAImageEncoderItfAdapt_GetImageSettings");
+    if( !bCtx || (bCtx->baseObj.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/gst_adaptation/xaimageencoderitfadaptation.h	Fri May 14 16:22:35 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 "xaadaptationgst.h"
+
+/* FUNCTIONS */
+XAresult XAImageEncoderItfAdapt_SetImageSettings(XAAdaptationGstCtx *bCtx,
+                                                 const XAImageSettings *pSettings);
+XAresult XAImageEncoderItfAdapt_GetImageSettings(XAAdaptationGstCtx *bCtx,
+                                                 XAImageSettings *pSettings);
+#endif /* XAIMAGEENCODERITFADAPTATION_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/gst_adaptation/xaledarrayadaptctx.c	Fri May 14 16:22:35 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 "xaadaptationgst.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 = (XALEDArrayAdaptationCtx *)calloc(1, sizeof(XALEDArrayAdaptationCtx));
+    DEBUG_API("->XALEDArrayAdapt_Create");
+
+    if ( pSelf)
+    {
+        if( XAAdaptationBase_Init(&(pSelf->baseObj.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->baseObj;
+}
+
+/*
+ * XAresult XALEDArrayAdapt_PostInit()
+ * 2nd phase initialization of LEDArray Adaptation Context
+ */
+XAresult XALEDArrayAdapt_PostInit(XAAdaptationGstCtx* bCtx)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XALEDArrayAdaptationCtx* ctx = NULL;
+    DEBUG_API("->XALEDArrayAdapt_PostInit");
+    if(bCtx == NULL || bCtx->baseObj.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.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(XAAdaptationGstCtx* bCtx)
+{
+    XALEDArrayAdaptationCtx* ctx = NULL;
+    DEBUG_API("->XALEDArrayAdapt_Destroy");
+    if(bCtx == NULL || bCtx->baseObj.ctxId != XALedArrayAdaptation )
+    {
+        DEBUG_ERR("Invalid parameter!!");
+        DEBUG_API("<-XALEDArrayAdapt_Destroy");
+        return;
+    }
+    ctx = (XALEDArrayAdaptationCtx*)bCtx;
+    DEBUG_API("->XALEDArrayAdapt_Destroy");
+
+    XAAdaptationBase_Free(&(ctx->baseObj.baseObj));
+
+
+    free(ctx);
+    ctx = NULL;
+
+    DEBUG_API("<-XALEDArrayAdapt_Destroy");
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/gst_adaptation/xaledarrayadaptctx.h	Fri May 14 16:22:35 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 XALEDARRAYADAPTCTX_H
+#define XALEDARRAYADAPTCTX_H
+
+#include "xaadaptationgst.h"
+
+/* TYPEDEFS */
+
+typedef struct XALEDArrayAdaptationCtx_ XALEDArrayAdaptationCtx;
+
+/*
+ * Structure for Ledarray specific gst-adaptation variables
+ */
+typedef struct XALEDArrayAdaptationCtx_ {
+
+    /* Parent*/
+    XAAdaptationGstCtx_ baseObj;
+
+    /* OMX-AL Variables */
+    XAuint32    deviceID;
+
+    /* GST Variables */
+
+} XALedarrayAdaptationCtx_;
+
+/* FUNCTIONS */
+XAAdaptationBaseCtx* XALEDArrayAdapt_Create(XAuint32 deviceID);
+XAresult XALEDArrayAdapt_PostInit(XAAdaptationGstCtx* bCtx);
+void XALEDArrayAdapt_Destroy(XAAdaptationGstCtx* bCtx);
+
+#endif /* XALEDARRAYADAPTCTX_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/gst_adaptation/xaledarrayitfadaptation.c	Fri May 14 16:22:35 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 "xaadaptationgst.h"
+
+/*
+ * XAresult XALEDArrayItfAdapt_ActivateLEDArray ( XAAdaptationGstCtx *bCtx, XAuint32 lightMask )
+ */
+XAresult XALEDArrayItfAdapt_ActivateLEDArray ( XAAdaptationGstCtx *bCtx, XAuint32 lightMask )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API_A1("->XALEDArrayItfAdapt_ActivateLEDArray %ld", lightMask);
+
+    if(!bCtx || bCtx->baseObj.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 ( XAAdaptationGstCtx *bCtx, XAuint8 index, const XAHSL * pColor )
+ */
+XAresult XALEDArrayItfAdapt_SetColor ( XAAdaptationGstCtx *bCtx, XAuint8 index, const XAHSL * pColor )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XALEDArrayItfAdapt_SetColor");
+
+    if(!bCtx || bCtx->baseObj.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/gst_adaptation/xaledarrayitfadaptation.h	Fri May 14 16:22:35 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 XALEDARRAYITFADAPTATION_H_
+#define XALEDARRAYITFADAPTATION_H_
+
+#include "xaadaptationgst.h"
+
+
+/* FUNCTIONS */
+XAresult XALEDArrayItfAdapt_ActivateLEDArray ( XAAdaptationGstCtx *bCtx, XAuint32 lightMask );
+XAresult XALEDArrayItfAdapt_SetColor ( XAAdaptationGstCtx *bCtx, XAuint8 index, const XAHSL * pColor );
+#endif /* XALEDARRAYITFADAPTATION_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/gst_adaptation/xamediaplayeradaptctx.c	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,1114 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "xaadaptationgst.h"
+#include "xaobjectitf.h"
+#include "xacameradevice.h"
+#include "xaoutputmix.h"
+#include "xametadataadaptation.h"
+/*#include "xangavideosink.h"*/
+#include "xacameraadaptctx.h"
+#include "xaoutputmixadaptctx.h"
+
+/* 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");
+}
+
+
+/*
+ * gboolean XAMediaPlayerAdapt_GstBusCb( GstBus *bus, GstMessage *message, gpointer data )
+ * MediaPlayer Gst-bus message handler (Callback)
+ */
+gboolean XAMediaPlayerAdapt_GstBusCb( GstBus *bus, GstMessage *message, gpointer data )
+{
+    XAAdaptationGstCtx* bCtx = (XAAdaptationGstCtx*)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, (GstSeekFlags)(GST_SEEK_FLAG_FLUSH|GST_SEEK_FLAG_ACCURATE),
+                                      GST_SEEK_TYPE_SET, mCtx->loopstart,
+                                      GST_SEEK_TYPE_NONE, (gint64)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->baseObj, &event );
+                    }
+                }
+                else
+                {
+                /* stop position tracking */
+                if(mCtx->runpositiontimer > 0)
+                {
+                    g_source_remove(mCtx->runpositiontimer);
+                    mCtx->runpositiontimer=0;
+                }
+
+                /* complete any ongoing client async operations */
+                XAAdaptationGst_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->baseObj, &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->baseObj, &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 */
+                XAAdaptationGst_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 */
+                XAAdaptationGst_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->baseObj, &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;
+    
+    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.baseObj),XAMediaPlayerAdaptation)
+            != XA_RESULT_SUCCESS )
+        {
+            DEBUG_ERR("Failed to init base context!!!");
+            free(pSelf);
+            pSelf = NULL;
+            return 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 = (gint64)GST_CLOCK_TIME_NONE;
+            pSelf->playrate = 1.0;
+            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;
+/*            if(pImageVideoSnk && 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.baseObj);
+					free(pSelf);
+					pSelf = NULL;
+				}
+			}
+		}
+    }
+
+    DEBUG_API("<-XAMediaPlayerAdapt_Create");
+    return (XAAdaptationBaseCtx*)(&pSelf->baseObj);
+}
+
+
+
+/*
+ * 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( XAAdaptationGstCtx* bCtx )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    GstStateChangeReturn gret;
+
+	XAMediaPlayerAdaptationCtx* ctx = NULL;
+	GstElement *videotest=NULL;
+
+    DEBUG_API("->XAMediaPlayerAdapt_PostInit");
+    if(bCtx == NULL || bCtx->baseObj.ctxId != XAMediaPlayerAdaptation )
+    {
+        DEBUG_ERR("Invalid parameter!!");
+        DEBUG_API("<-XAMediaPlayerAdapt_PostInit");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    ctx = (XAMediaPlayerAdaptationCtx*)bCtx;
+    assert(ctx);
+    ret = XAAdaptationBase_PostInit( &bCtx->baseObj );
+    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 = XAAdaptationGst_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;
+    }
+
+#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;
+
+    XAAdaptationGst_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");
+        XAAdaptationGst_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");
+    }
+
+#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( XAAdaptationGstCtx* bCtx )
+{
+    XAMediaPlayerAdaptationCtx* ctx = NULL;
+
+    DEBUG_API("->XAMediaPlayerAdapt_Destroy");
+    if(bCtx == NULL || bCtx->baseObj.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->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((XAAdaptationGstCtx*)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 );
+    }
+    XAAdaptationGst_CancelAsyncWait(bCtx);
+
+    if( ctx->runpositiontimer )
+    {
+        g_source_remove(ctx->runpositiontimer);
+    }
+    XAMetadataAdapt_FreeVars(ctx->metadatavars);
+    XAAdaptationBase_Free( &bCtx->baseObj );
+    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 = NULL;
+    DEBUG_API("->XAMediaPlayerAdapt_CreatePipeline");
+
+    /* create and add data source */
+    XACommon_CheckDataSource(ctx->xaSource, &mediatype);
+    ctx->source = XAAdaptationGst_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);
+			if(gret == GST_STATE_CHANGE_SUCCESS)
+			    {
+                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, XAAdaptationGst_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 = XAAdaptationGst_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 = XAAdaptationGst_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 = XAAdaptationGst_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 = XAAdaptationGst_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 = XAAdaptationGst_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((XAAdaptationGstCtx*)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));
+
+    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)
+{
+    XAAdaptationGstCtx *bCtx = (XAAdaptationGstCtx*) 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->baseObj, &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, (GstSeekFlags)(GST_SEEK_FLAG_FLUSH|GST_SEEK_FLAG_ACCURATE),
+                              GST_SEEK_TYPE_SET, mCtx->loopstart,
+                              GST_SEEK_TYPE_NONE, (gint64)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->baseObj, &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/gst_adaptation/xamediaplayeradaptctx.h	Fri May 14 16:22:35 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 XAMEDIAPLAYERADAPTCTX_H
+#define XAMEDIAPLAYERADAPTCTX_H
+
+#include "xaadaptationgst.h"
+#include "xametadataadaptation.h"
+/* TYPEDEFS */
+
+typedef struct XAMediaPlayerAdaptationCtx_ XAMediaPlayerAdaptationCtx;
+
+/*
+ * Structure for Media Player specific gst-adaptation.
+ */
+typedef struct XAMediaPlayerAdaptationCtx_
+{
+    /* Parent*/
+    XAAdaptationGstCtx_    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_;
+
+
+/* FUNCTIONS */
+XAAdaptationBaseCtx* XAMediaPlayerAdapt_Create( XADataSource *pDataSrc, XADataSource *pBankSrc,
+                                                       XADataSink *pAudioSnk, XADataSink *pImageVideoSnk,
+                                                       XADataSink *pVibra, XADataSink *pLEDArray);
+XAresult XAMediaPlayerAdapt_PostInit( XAAdaptationGstCtx* bCtx );
+void XAMediaPlayerAdapt_Destroy( XAAdaptationGstCtx* bCtx );
+XAresult XAMediaPlayerAdapt_UpdatePositionCbTimer(XAMediaPlayerAdaptationCtx_* mCtx);
+
+XAresult XAMediaPlayerAdapt_InitContentPipeSrc(XAMediaPlayerAdaptationCtx* ctx);
+#endif /*XAMEDIAPLAYERADAPTCTX_H*/
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/gst_adaptation/xamediarecorderadaptctx.c	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,1807 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "xacapabilitiesmgr.h"
+#include "xamediarecorderadaptctx.h"
+#include "xacameraadaptctx.h"
+
+
+extern XAboolean cameraRealized;
+extern XACameraAdaptationCtx_* cameraCtx;
+
+/*forward declarations*/
+GstElement* XAMediaRecorderAdapt_CreateEncodeBin(
+        XAMediaRecorderAdaptationCtx* ctx);
+XAresult XAMediaRecorderAdapt_CreatePipeline(
+        XAMediaRecorderAdaptationCtx* ctx);
+void XAMediaRecorderAdapt_BufferAvailable(GstElement* sink,
+        gpointer user_data);
+/** Creates the caps gst element */
+static XAresult XAMediaRecorderAdapt_CreateCapsFilter( XAMediaRecorderAdaptationCtx* ctx );
+
+/*
+ * gboolean XAMediaRecorderAdapt_GstBusCb( GstBus *bus, GstMessage *message, gpointer data )
+ * MediaPlayer Gst-bus message handler (Callback)
+ */
+gboolean XAMediaRecorderAdapt_GstBusCb(GstBus *bus, GstMessage *message,
+        gpointer data)
+    {
+    XAAdaptationGstCtx* bCtx = (XAAdaptationGstCtx*) 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 */
+                XAAdaptationGst_CompleteAsyncWait(bCtx);
+
+                /* send needed events */
+                {
+                    XAAdaptEvent event = {XA_RECORDITFEVENTS, XA_RECORDEVENT_HEADATLIMIT, 0, NULL };
+                    XAAdaptationBase_SendAdaptEvents(&bCtx->baseObj, &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->baseObj, &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 */
+                XAAdaptationGst_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 */
+                XAAdaptationGst_CompleteAsyncWait(bCtx);
+                break;
+            }
+            case GST_MESSAGE_WARNING:
+            {
+                GError* error;
+                gchar* debug;
+                gst_message_parse_warning(message, &error, &debug);
+                DEBUG_ERR_A1("Gst reports warning \"%s\"", debug);
+                /* stop waiting any ongoing async operations */
+                XAAdaptationGst_CompleteAsyncWait(bCtx);
+                break;
+            }
+            default:
+                break;
+        }
+    DEBUG_API("<-XAMediaRecorderAdapt_GstBusCb");
+    }
+    return TRUE;
+    }
+
+/*
+ * XAAdaptationGstCtx* 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 = (XAMediaRecorderAdaptationCtx*)calloc(1, sizeof(XAMediaRecorderAdaptationCtx));
+    if (pSelf)
+        {
+        if (XAAdaptationGst_Init(&(pSelf->baseObj),
+                XAMediaRecorderAdaptation) != XA_RESULT_SUCCESS)
+            {
+            DEBUG_ERR("Failed to init base context!!!");
+            free(pSelf);
+            pSelf = NULL;
+            DEBUG_API("<-XAMediaRecorderAdapt_Create");
+            return NULL;
+            }
+        else
+            {
+            pSelf->baseObj.baseObj.fwtype = FWMgrFWGST;
+            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.baseObj);
+                    free(pSelf);
+                    pSelf = NULL;
+                    DEBUG_API("<-XAMediaRecorderAdapt_Create");
+                    return NULL;
+                    }
+                }
+            }
+        }
+
+    DEBUG_API("<-XAMediaRecorderAdapt_Create");
+    return (XAAdaptationBaseCtx*) &pSelf->baseObj;
+    }
+
+/*
+ * XAresult XAMediaRecorderAdapt_PostInit()
+ * 2nd phase initialization of Media Recorder Adaptation Context
+ * @param XAAdaptationGstCtx* ctx - pointer to Media Recorder adaptation context
+ * @return XAresult - Success value
+ */
+XAresult XAMediaRecorderAdapt_PostInit(XAAdaptationGstCtx* bCtx)
+    {
+    GstStateChangeReturn gret;
+
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAMediaRecorderAdaptationCtx* ctx = NULL;
+    DEBUG_API("->XAMediaRecorderAdapt_PostInit");
+    if (bCtx == NULL || bCtx->baseObj.ctxId != XAMediaRecorderAdaptation)
+        {
+        DEBUG_ERR("Invalid parameter!!");DEBUG_API("<-XAMediaRecorderAdapt_PostInit");
+        return XA_RESULT_PARAMETER_INVALID;
+        }
+    ctx = (XAMediaRecorderAdaptationCtx*) bCtx;
+
+    ret = XAAdaptationGst_PostInit(bCtx);
+    if (ret != XA_RESULT_SUCCESS)
+        {
+        DEBUG_ERR("Gst context postinit failed!!");
+        return ret;
+        }
+
+    /* top level bin for media recorder */
+    bCtx->bin = gst_pipeline_new("media_recorder");
+
+    /* Create Gst bus listener. */
+    ret = XAAdaptationGst_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);
+    if (ret != XA_RESULT_SUCCESS)
+        {
+        DEBUG_ERR("Failed to create recorder pipeline");
+        return XA_RESULT_INTERNAL_ERROR;
+        }
+
+#ifdef XA_IMPL_MEASURE_GST_DELAY
+    bCtx->startTime = clock();
+#endif /* XA_IMPL_MEASURE_GST_DELAY */
+    /* roll up bin */
+    bCtx->binWantedState = GST_STATE_PAUSED;
+    XAAdaptationGst_PrepareAsyncWait(bCtx);
+    gret = gst_element_set_state(GST_ELEMENT(bCtx->bin), bCtx->binWantedState);
+    if (gret == GST_STATE_CHANGE_ASYNC)
+        {
+        DEBUG_INFO("Wait for preroll");
+        XAAdaptationGst_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( XAAdaptationGstCtx* bCtx )
+ * Destroys Media Recorder Adaptation Context
+ * @param ctx - Media Recorder Adaptation context to be destroyed
+ */
+void XAMediaRecorderAdapt_Destroy(XAAdaptationGstCtx* bCtx)
+    {
+    XAMediaRecorderAdaptationCtx* ctx = NULL;
+    char* fname = NULL;
+    DEBUG_API("->XAMediaRecorderAdapt_Destroy");
+
+    if (bCtx == NULL || bCtx->baseObj.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:///", 8) == 0)
+                {
+                fname
+                        = (char *) &(((XADataLocator_URI*) (ctx->xaSink->pLocator))->URI[8]);
+                }
+            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);
+        }
+    XAAdaptationGst_CancelAsyncWait(bCtx);
+
+    if (ctx->runpositiontimer)
+        {
+        g_source_remove(ctx->runpositiontimer);
+        }
+    
+    XAAdaptationGst_Free(bCtx);
+
+    free(ctx);
+    ctx = NULL;
+
+    DEBUG_API("<-XAMediaRecorderAdapt_Destroy");
+    }
+
+/***************** INTERNAL FUNCTIONS *******************************/
+
+    /*
+     * void XAMediaRecorderAdapt_CreatePipeline( XAMediaRecorderAdaptationCtx* ctx );
+     */
+XAresult XAMediaRecorderAdapt_CreatePipeline(
+        XAMediaRecorderAdaptationCtx* ctx)
+    {
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAMediaRecorderAdapt_CreatePipeline");
+
+    /* Create the audio src */
+    if ( ctx->xaAudioSource )
+        {
+        /* create audio pipe source */
+        ctx->audiosource = XAAdaptationGst_CreateGstSource( ctx->xaAudioSource, "audiosource",
+                &(ctx->isobjasrc), NULL, NULL );
+    
+        if( ctx->audiosource )
+            {
+            if (gst_bin_add(GST_BIN(ctx->baseObj.bin), ctx->audiosource))
+                {
+                DEBUG_API("Added audiosource to bin");
+                }
+            else
+                {
+                DEBUG_API("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 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 = XAAdaptationGst_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);
+                if(gret == GST_STATE_CHANGE_SUCCESS)
+                    {
+                    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, XAAdaptationGst_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 = XAAdaptationGst_CreateFixedSizeVideoPP( );
+#else
+        ctx->videoppbin = XAAdaptationGst_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->audiosource )
+        {
+#ifdef USE_AUDIO_PP
+        /* create audio processing pipeline */
+        ctx->audioppbin = XAAdaptationGst_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;
+            }
+#endif //USE_AUDIO_PP
+        
+        /* create audio filter for audio encoder settings */
+        ret = XAMediaRecorderAdapt_CreateCapsFilter(ctx);
+        if ( XA_RESULT_SUCCESS != ret )
+        {
+            DEBUG_ERR("cannot create caps filter");
+            return ret;
+        }
+        
+        /*LINK : audiosource -> audiofilter */
+        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;
+            }
+*/
+#ifdef USE_AUDIO_PP
+            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
+        if(!gst_element_link(ctx->audiofilter, ctx->codecbin ))
+            {
+            DEBUG_ERR("Could not link audiosource to codecbin!!");
+            return XA_RESULT_INTERNAL_ERROR;
+            }
+        else
+            {
+            DEBUG_INFO("Warning: link audiosource to codecbin is successfull with muxcaps!!");
+            }
+#endif // USE_AUDIO_PP
+        }
+    else
+        {
+        DEBUG_INFO("No audio input");
+        }
+
+    /* create and add data sink */
+    ctx->datasink = XAAdaptationGst_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;
+        XACapabilities temp;
+
+        DEBUG_API("->XAMediaRecorderAdapt_CheckCodec");
+
+        /*first, check if codec supported at all*/
+        ret = XACapabilitiesMgr_GetCapsById(mCtx->baseObj.baseObj.capslist,(XACapsType)(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;
+    XAAdaptationGstCtx* 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");
+                XAAdaptationGst_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;
+    XACapabilities 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(XACapabilitiesMgr_GetCapsById(NULL, (XACapsType)(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(XACapabilitiesMgr_GetCapsById(NULL, (XACapsType)(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(XACapabilitiesMgr_GetCapsById(NULL, (XACapsType)(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(XACapabilitiesMgr_GetCapsById(NULL, (XACapsType)(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);
+                                        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");
+                                        }
+                                    }
+                                if(strncmp((char *)mime->mimeType, "video", 5) == 0 && ctx->xaVideoSource)
+                                    {
+                                    if(XACapabilitiesMgr_GetCapsById(NULL, (XACapsType)(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);
+                                        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
+                            {
+                            DEBUG_INFO("No support for requested mime/container type.");
+                            ret = XA_RESULT_CONTENT_UNSUPPORTED;
+                            }
+                        break;
+                        case XA_CONTAINERTYPE_MOBILE_DLS:
+                        case XA_CONTAINERTYPE_MP4:
+                        DEBUG_INFO("XA_CONTAINERTYPE_MP4");
+                        mux = gst_element_factory_make("mp4mux", "mp4mux");
+                        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(XACapabilitiesMgr_GetCapsById(ctx->baseObj.baseObj.capslist, (XACapsType)(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_AAC;
+                        if(ctx->xaAudioSource)
+                            {
+                            if(XACapabilitiesMgr_GetCapsById(ctx->baseObj.baseObj.capslist, (XACapsType)(XACAP_ENCODER|XACAP_AUDIO), ctx->audioEncSettings.encoderId, &temp) == XA_RESULT_SUCCESS)
+                                {
+                                if(temp.adaptId)
+                                    {
+                                    audioenc = gst_element_factory_make((char*)temp.adaptId, "nokiaaacenc");
+                                    }
+                                }
+                            if(audioenc)
+                                {
+                                GstCaps* caps = gst_caps_new_simple((const char*)mime->mimeType,
+                                        "mpegversion", G_TYPE_INT, 4,
+                                        "channels", G_TYPE_INT, 1,
+                                        "rate", G_TYPE_INT, 16000,
+                                        NULL);
+                                gst_bin_add(GST_BIN(codecbin), audioenc);
+                                if(!gst_element_link_filtered(audioenc, mux,caps))
+                                    {
+                                    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_AMR:
+                            DEBUG_INFO("XA_CONTAINERTYPE_AMR");
+                            if(ctx->audioEncSettings.encoderId == XA_ADAPTID_UNINITED)
+                                ctx->audioEncSettings.encoderId = XA_AUDIOCODEC_AMR;
+                             mux = gst_element_factory_make("amrmux", "mux");
+                             if(mux)
+                                 {
+                                 if (gst_bin_add(GST_BIN(codecbin), mux))
+                                     {
+                                     DEBUG_INFO("Added mux to codecbin");
+                                     /*Setting the buffer size on src since amr generates 
+                                      * small amounts of data */
+                                     g_object_set (G_OBJECT (ctx->audiosource),
+                                               "blocksize", 1280,
+                                                NULL);                                         
+                                     }
+                                 else
+                                     {
+                                     DEBUG_ERR("Could not add mux to codecbin");
+                                     return NULL;
+                                     }
+                                 /*use this as linkpoint*/
+                                 ghostsrc = gst_element_get_static_pad(mux,"src");
+                                 }
+                             /*set audio defaults*/
+                             if(ctx->xaAudioSource)
+                                 {
+                                 /*no audio codec but audio source = PCM case, explicity request audio pad*/
+                                 ghostaudiosink = gst_element_get_static_pad(mux,"sink");
+                                 }
+                             break;                                
+                        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.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");
+    }
+
+/*
+ * 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;
+        XAAdaptationGst_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.");
+            XAAdaptationGst_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;
+    }
+
+XAresult XAMediaRecorderAdapt_CreateCapsFilter( XAMediaRecorderAdaptationCtx* ctx )
+{
+
+    GstCaps* encSrcCaps = NULL;
+    XADataFormat_MIME *pMime = 0;
+    
+    if (!ctx )
+        return XA_RESULT_PARAMETER_INVALID;
+
+    DEBUG_INFO("create capsfilter");
+    ctx->audiofilter = gst_element_factory_make("capsfilter", "audiofilter");
+    if( !ctx->audiofilter )
+    {
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+    //   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;
+    }
+    
+    pMime = (XADataFormat_MIME*) ctx->xaSink->pFormat;
+    if(!strcmp((const char*)pMime->mimeType, "audio/amr"))
+        {
+        encSrcCaps = gst_caps_new_simple ("audio/amr",
+                   "width", G_TYPE_INT, 8,
+                   "depth", G_TYPE_INT, 8,
+                   "signed",G_TYPE_BOOLEAN, TRUE,
+                   "endianness",G_TYPE_INT, G_BYTE_ORDER,
+                   "rate", G_TYPE_INT,  8000,
+                   "channels", G_TYPE_INT, 1, NULL);
+        }
+    else
+        {
+        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);
+
+    gst_caps_unref(encSrcCaps);
+    return XA_RESULT_SUCCESS;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/gst_adaptation/xamediarecorderadaptctx.h	Fri May 14 16:22:35 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: 
+*
+*/
+
+#ifndef XAMEDIARECORDERADAPTCTX_H_
+#define XAMEDIARECORDERADAPTCTX_H_
+
+#include "xaadaptationgst.h"
+#include "xametadataadaptation.h"
+
+/* TYPEDEFS */
+
+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;
+
+/* context to track buffer insufficient event */
+typedef struct recordItfCtx_{
+    XAImplSemHandle bufInsufficientSem;
+    XAboolean buffer_insufficient;
+}recodtItfCtx;
+
+typedef struct XAMediaRecorderAdaptationCtx_ XAMediaRecorderAdaptationCtx;
+
+typedef struct XAMediaRecorderAdaptationCtx_
+{
+    /* Parent*/
+    XAAdaptationGstCtx_ 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_;
+
+/* FUNCTIONS */
+XAAdaptationBaseCtx* XAMediaRecorderAdapt_Create(  XADataSource* pAudioSrc, XADataSource* pImageVideoSrc, XADataSink* pDataSnk, XAuint8 recModes );
+XAresult XAMediaRecorderAdapt_PostInit( XAAdaptationGstCtx* bCtx );
+void XAMediaRecorderAdapt_Destroy( XAAdaptationGstCtx* bCtx );
+/*XAresult XAMediaRecorderAdapt_InitContentPipeSink(XAMediaRecorderAdaptationCtx* ctx);*/
+XAresult XAMediaRecorderAdapt_ChangeEncoders( XAMediaRecorderAdaptationCtx_* mCtx );
+XAresult XAMediaRecorderAdapt_CheckCodec( XAMediaRecorderAdaptationCtx_* mCtx, XACapsType encType, XAuint32 encoderId );
+
+void*  XAMediaRecorderAdapt_RecordEventThr(void* ctx);
+
+#endif /* XAMEDIARECORDERADAPTCTX_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/gst_adaptation/xametadataadaptation.c	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,1200 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "xaadaptationgst.h"
+#include "xametadataadaptctx.h"
+#include "xamediaplayeradaptctx.h"
+#include "xamediarecorderadaptctx.h"
+#include "xametadataadaptation.h"
+
+/* forward declarations of internal methods */
+XAMetadataAdaptVars* XAMetadataAdapt_GetMetadataVars(XAAdaptationGstCtx *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(XAAdaptationGstCtx *bCtx)
+ * Initialize values needed before preroll
+ * @return XAresult ret - Success value
+ */
+XAresult XAMetadataAdapt_PreInit(XAAdaptationGstCtx *bCtx)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAMetadataAdaptVars* mdv;
+    DEBUG_API("->XAMetadataAdapt_PreInit");
+    if( bCtx->baseObj.ctxId == XAMDAdaptation ||
+        bCtx->baseObj.ctxId == XAMediaPlayerAdaptation )
+    {
+        mdv = (XAMetadataAdaptVars*) calloc(1, sizeof(XAMetadataAdaptVars));
+        mdv->currentchild = &(mdv->generaltags);
+        mdv->traversemode=XA_METADATATRAVERSALMODE_NODE;
+        ((XAMediaPlayerAdaptationCtx*)bCtx)->metadatavars = mdv;
+
+    }
+    else if ( bCtx->baseObj.ctxId == XAMediaRecorderAdaptation )
+    {
+        mdv = (XAMetadataAdaptVars*) 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(XAAdaptationGstCtx *bCtx)
+ * Initialize values after preroll
+ * @return XAresult ret - Success value
+ */
+XAresult XAMetadataAdapt_PostInit(XAAdaptationGstCtx *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->baseObj.ctxId == XAMDAdaptation ||
+        bCtx->baseObj.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->baseObj, &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(XAAdaptationGstCtx *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 = (XAMetadataInfo**)calloc(newcount,sizeof(XAMetadataInfo*));
+        tagList->mdeValues = (XAMetadataInfo**)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(XAAdaptationGstCtx *bCtx, XAuint32 mode)
+ */
+XAresult XAMetadataTraversalItfAdapt_SetMode(XAAdaptationGstCtx *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->baseObj, &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(XAAdaptationGstCtx *bCtx, XAuint32 *pCount)
+ */
+XAresult XAMetadataTraversalItfAdapt_GetChildCount(XAAdaptationGstCtx *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(XAAdaptationGstCtx *bCtx,
+ *                                                         XAuint32 index,
+ *                                                         XAuint32 *pSize)
+ */
+XAresult XAMetadataTraversalItfAdapt_GetChildMIMETypeSize(XAAdaptationGstCtx *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(XAAdaptationGstCtx *bCtx,
+ *                                                  XAuint32 index,
+ *                                                 XAint32 *pNodeID,
+ *                                                 XAuint32 *pType,
+ *                                                 XAuint32 size,
+ *                                                 XAchar *pMimeType)
+ */
+XAresult XAMetadataTraversalItfAdapt_GetChildInfo(XAAdaptationGstCtx *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(XAAdaptationGstCtx *bCtx,
+ *                                                  XAuint32 index)
+ */
+XAresult XAMetadataTraversalItfAdapt_SetActiveNode(XAAdaptationGstCtx *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(XAAdaptationGstCtx *bCtx,
+ *                                                   XAint32 parentNodeID,
+ *                                                   XAuint32 type,
+ *                                                   XAchar *mimeType,
+ *                                                   XAint32 *pChildNodeID)
+ */
+XAresult XAMetadataInsertionItfAdapt_CreateChildNode(XAAdaptationGstCtx *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->baseObj.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(XAAdaptationGstCtx *bCtx,
+ *                                                         XAint32 nodeID,
+ *                                                         XAboolean *pFreeKeys,
+ *                                                         XAuint32 *pKeyCount,
+ *                                                         XAuint32 *pEncodingCount)
+ */
+XAresult XAMetadataInsertionItfAdapt_GetSupportedKeysCount(XAAdaptationGstCtx *bCtx,
+                                                          XAint32 nodeID,
+                                                          XAboolean *pFreeKeys,
+                                                          XAuint32 *pKeyCount,
+                                                          XAuint32 *pEncodingCount)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XAMetadataInsertionItfAdapt_GetSupportedKeysCount");
+    if(bCtx && bCtx->baseObj.ctxId == XAMediaRecorderAdaptation)
+    {
+        *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(XAAdaptationGstCtx *bCtx,
+ *                                              XAint32 nodeID,
+ *                                              XAuint32 keyIndex,
+ *                                              XAuint32 *pKeySize)
+ */
+XAresult XAMetadataInsertionItfAdapt_GetKeySize(XAAdaptationGstCtx *bCtx,
+                                               XAint32 nodeID,
+                                               XAuint32 keyIndex,
+                                               XAuint32 *pKeySize)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XAMetadataInsertionItfAdapt_GetKeySize");
+    if(bCtx && bCtx->baseObj.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(XAAdaptationGstCtx *bCtx,
+ *                                          XAint32 nodeID,
+ *                                          XAuint32 keyIndex,
+ *                                          XAuint32 keySize,
+ *                                          XAMetadataInfo *pKey)
+ */
+XAresult XAMetadataInsertionItfAdapt_GetKey(XAAdaptationGstCtx *bCtx,
+                                           XAint32 nodeID,
+                                           XAuint32 keyIndex,
+                                           XAuint32 keySize,
+                                           XAMetadataInfo *pKey)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAuint32 datasize, neededsize;
+
+    DEBUG_API("->XAMetadataInsertionItfAdapt_GetKey");
+    if(bCtx && bCtx->baseObj.ctxId == XAMediaRecorderAdaptation)
+    {
+        memset(pKey,0,keySize);
+        if(xaMetadataAdaptSupportedKeys[keyIndex] && (keySize > sizeof(XAMetadataInfo)))
+        {
+            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(XAAdaptationGstCtx *bCtx,
+ *                                                       XAint32 nodeID,
+ *                                                       XAuint32 encodingIndex,
+ *                                                       XAuint32 *pEncoding)
+ */
+XAresult XAMetadataInsertionItfAdapt_GetFreeKeysEncoding(XAAdaptationGstCtx *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(XAAdaptationGstCtx *bCtx,
+ *                                                      XAint32 nodeID,
+ *                                                      XAMetadataInfo *pKey,
+ *                                                      XAMetadataInfo *pValue,
+ *                                                      XAboolean overwrite)
+ */
+XAresult XAMetadataInsertionItfAdapt_InsertMetadataItem(XAAdaptationGstCtx *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->baseObj.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->baseObj, &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(XAAdaptationGstCtx *bCtx)
+ * Return metadata variables from different types of context
+ */
+XAMetadataAdaptVars* XAMetadataAdapt_GetMetadataVars(XAAdaptationGstCtx *bCtx)
+{
+    if( bCtx->baseObj.ctxId == XAMDAdaptation ||
+        bCtx->baseObj.ctxId == XAMediaPlayerAdaptation )
+    {
+        return ((XAMediaPlayerAdaptationCtx*)bCtx)->metadatavars;
+    }
+    else if( bCtx->baseObj.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] = (XAMetadataInfo*)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] = (XAMetadataInfo*)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] = (XAMetadataInfo*)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] = (XAMetadataInfo*)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;
+    XAAdaptationGstCtx* bCtx;
+    GstTagMergeMode mode;
+
+    bCtx = (XAAdaptationGstCtx*)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->baseObj.ctxId == XAMDAdaptation ||
+            bCtx->baseObj.ctxId == XAMediaPlayerAdaptation )
+        {
+            old_tags = &((XAMediaPlayerAdaptationCtx*)bCtx)->metadatavars->generaltags;
+            mode = GST_TAG_MERGE_REPLACE;
+        }
+        else if( bCtx->baseObj.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->baseObj, &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(XAAdaptationGstCtx* bCtx, GstBin* binToWriteTo)
+ */
+XAresult XAMetadataAdapt_TryWriteTags(XAAdaptationGstCtx* 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->baseObj.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->baseObj, &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/gst_adaptation/xametadataadaptation.h	Fri May 14 16:22:35 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: 
+*
+*/
+
+#ifndef XAMETADATAADAPTATION_H
+#define XAMETADATAADAPTATION_H
+
+#include "xaadaptationgst.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;
+
+
+typedef struct XAMetadataAdaptVars_
+{
+
+    XAuint32        childcount;
+    XAuint32        nodedepth;
+    XAuint32        traversemode;
+
+    GstTagList*     generaltags;
+    GstStructure*   audiotags;
+    GstStructure*   videotags;
+    GstStructure**   currentchild; /*points to one of previous 3*/
+
+} XAMetadataAdaptVars;
+
+XAresult XAMetadataAdapt_PreInit(XAAdaptationGstCtx *bCtx);
+XAresult XAMetadataAdapt_PostInit(XAAdaptationGstCtx *bCtx);
+const XAchar* XAMetadataAdapt_ParseKhronosKey(const XAchar* KKey);
+void XAMetadataAdapt_FreeImplTagList(XAMetadataImplTagList *list, XAboolean freeItems);
+void XAMetadataAdapt_FreeVars(XAMetadataAdaptVars *vars);
+XAresult XAMetadataAdapt_TryWriteTags(XAAdaptationGstCtx* bCtx, GstBin* binToWriteTo);
+
+XAresult XAMetadataExtractionItfAdapt_FillTagList(XAAdaptationGstCtx *bCtx,
+                                                  XAMetadataImplTagList* tagList);
+
+
+XAresult XAMetadataTraversalItfAdapt_SetMode(XAAdaptationGstCtx *bCtx, XAuint32 mode);
+XAresult XAMetadataTraversalItfAdapt_GetChildCount(XAAdaptationGstCtx *bCtx, XAuint32 *pCount);
+XAresult XAMetadataTraversalItfAdapt_GetChildMIMETypeSize(XAAdaptationGstCtx *bCtx,
+                                                          XAuint32 index,
+                                                          XAuint32 *pSize);
+XAresult XAMetadataTraversalItfAdapt_GetChildInfo(XAAdaptationGstCtx *bCtx,
+                                                  XAuint32 index,
+                                                  XAint32 *pNodeID,
+                                                  XAuint32 *pType,
+                                                  XAuint32 size,
+                                                  XAchar *pMimeType);
+XAresult XAMetadataTraversalItfAdapt_SetActiveNode(XAAdaptationGstCtx *bCtx,
+                                                   XAuint32 index);
+
+XAresult XAMetadataInsertionItfAdapt_CreateChildNode(XAAdaptationGstCtx *bCtx,
+                                                    XAint32 parentNodeID,
+                                                    XAuint32 type,
+                                                    XAchar *mimeType,
+                                                    XAint32 *pChildNodeID);
+XAresult XAMetadataInsertionItfAdapt_GetSupportedKeysCount(XAAdaptationGstCtx *bCtx,
+                                                          XAint32 nodeID,
+                                                          XAboolean *pFreeKeys,
+                                                          XAuint32 *pKeyCount,
+                                                          XAuint32 *pEncodingCount);
+XAresult XAMetadataInsertionItfAdapt_GetKeySize(XAAdaptationGstCtx *bCtx,
+                                               XAint32 nodeID,
+                                               XAuint32 keyIndex,
+                                               XAuint32 *pKeySize);
+XAresult XAMetadataInsertionItfAdapt_GetKey(XAAdaptationGstCtx *bCtx,
+                                           XAint32 nodeID,
+                                           XAuint32 keyIndex,
+                                           XAuint32 keySize,
+                                           XAMetadataInfo *pKey);
+XAresult XAMetadataInsertionItfAdapt_GetFreeKeysEncoding(XAAdaptationGstCtx *bCtx,
+                                                        XAint32 nodeID,
+                                                        XAuint32 encodingIndex,
+                                                        XAuint32 *pEncoding);
+XAresult XAMetadataInsertionItfAdapt_InsertMetadataItem(XAAdaptationGstCtx *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/gst_adaptation/xametadataadaptctx.c	Fri May 14 16:22:35 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 "xaadaptationgst.h"
+
+/*
+ * XAAdaptationGstCtx* 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(XAAdaptationGstCtx* 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(XAAdaptationGstCtx* bCtx)
+{
+    /* pipe to media player adaptation */
+    XAMediaPlayerAdapt_Destroy(bCtx);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/gst_adaptation/xametadataadaptctx.h	Fri May 14 16:22:35 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 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(XAAdaptationGstCtx* bCtx);
+void XAMetadataAdaptCtx_Destroy(XAAdaptationGstCtx* bCtx);
+
+
+#endif /* XAMETADATAADAPTCTX_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/gst_adaptation/xaoutputmixadaptctx.c	Fri May 14 16:22:35 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 <gst.h>
+#include "xaoutputmixadaptctx.h"
+#include "xaadaptationgst.h"
+#include "xacapabilitiesmgr.h"
+
+
+/*
+ * XAAdaptationGstCtx* 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 = (XAOutputMixAdaptationCtx*)calloc(1, sizeof(XAOutputMixAdaptationCtx));
+
+    DEBUG_API("->XAOutputMixAdapt_Create");
+    if ( pSelf)
+    {
+        if( XAAdaptationBase_Init(&(pSelf->baseObj.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->baseObj;
+}
+
+/*
+ * XAresult XAOutputMixAdapt_PostInit(XAAdaptationGstCtx* bCtx)
+ * 2nd phase initialization of Output Mix Adaptation Context
+ */
+XAresult XAOutputMixAdapt_PostInit(XAAdaptationGstCtx* bCtx)
+{
+    DEBUG_API("->XAOutputMixAdapt_PostInit");
+    if(bCtx == NULL || bCtx->baseObj.ctxId != XAOutputMixAdaptation )
+    {
+        DEBUG_ERR("Invalid parameter!!");
+        DEBUG_API("<-XAOutputMixAdapt_PostInit");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* check and add devices to pSelf->availableDevices if such detection can be done */
+    DEBUG_API("<-XAOutputMixAdapt_PostInit");
+    return XA_RESULT_SUCCESS;
+}
+
+/*
+ * void XAOutputMixAdapt_Destroy(XAAdaptationGstCtx* bCtx)
+ * Destroys Output Mix Adaptation Context
+ * @param ctx - Output Mix Adaptation context to be destroyed
+ */
+void XAOutputMixAdapt_Destroy(XAAdaptationGstCtx* bCtx)
+{
+    XAOutputMixAdaptationCtx* ctx = NULL;
+    DEBUG_API("->XAOutputMixAdapt_Destroy");
+    if(bCtx == NULL || bCtx->baseObj.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.baseObj) );
+    free(ctx);
+    DEBUG_API("<-XAOutputMixAdapt_Destroy");
+}
+
+/*
+ * GstElement* XAOutputMixAdapt_GetSink(XAAdaptationGstCtx* bCtx)
+ */
+GstElement* XAOutputMixAdapt_GetSink(XAAdaptationGstCtx* bCtx)
+{
+    XAOutputMixAdaptationCtx* mixCtx = NULL;
+    /* create sink for current routing */
+    GstElement* newsink=NULL;
+    XACapabilities temp;
+
+    DEBUG_API("->XAOutputMixAdapt_GetSink");
+    if(bCtx == NULL || bCtx->baseObj.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 ==
+            XACapabilitiesMgr_GetCapsById(NULL, (XACapsType)((XACapsType)(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(XAAdaptationGstCtx* omCtx, XAAdaptationGstCtx* bCtx, GstElement* usedMix)
+ */
+XAresult XAOutputMixAdapt_ConnectObject(XAAdaptationGstCtx* omCtx, XAAdaptationGstCtx* bCtx, GstElement* usedMix)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAuint32 i=0;
+    XAOutputMixAdaptationCtx* mixCtx =NULL;
+    DEBUG_API("->XAOutputMixAdapt_ConnectObject");
+    if( !omCtx || omCtx->baseObj.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(XAAdaptationGstCtx* omCtx, XAAdaptationGstCtx* bCtx)
+ */
+XAresult XAOutputMixAdapt_DisconnectObject(XAAdaptationGstCtx* omCtx, XAAdaptationGstCtx* bCtx)
+{
+    XAuint32 i=0;
+    XAOutputMixAdaptationCtx* mixCtx =NULL;
+    DEBUG_API("->XAOutputMixAdapt_DisconnectObject");
+
+    if( !omCtx || omCtx->baseObj.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/gst_adaptation/xaoutputmixadaptctx.h	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef XAOUTPUTMIXADAPTCTX_H
+#define XAOUTPUTMIXADAPTCTX_H
+
+#include "xaadaptationgst.h"
+
+/* TYPEDEFS */
+
+typedef struct XAOutputMixAdaptationCtx_ XAOutputMixAdaptationCtx;
+
+typedef struct XAOutputMixAdaptationCtx_
+{
+    /* Parent*/
+    XAAdaptationGstCtx_ baseObj;
+    /* Internal variables */
+    XAboolean   isStereoPosition;
+    XAboolean   mute;
+
+    XAuint32    currentrouting;
+
+    GArray*     availableDevices;
+    GArray*     connectedObjects;
+} XAOutputMixAdaptationCtx_;
+
+typedef struct XAOMixAdaptConnObj_
+{
+    /*pointer to connected context*/
+    XAAdaptationGstCtx* ctx;
+    /*pointer to sink currently used by connected ctx*/
+    GstElement* currentSink;
+} XAOMixAdaptConnObj;
+
+/* FUNCTIONS */
+XAAdaptationBaseCtx* XAOutputMixAdapt_Create(void);
+XAresult XAOutputMixAdapt_PostInit(XAAdaptationGstCtx* bCtx);
+void XAOutputMixAdapt_Destroy(XAAdaptationGstCtx* bCtx);
+
+
+GstElement* XAOutputMixAdapt_GetSink(XAAdaptationGstCtx* bCtx);
+XAresult XAOutputMixAdapt_ConnectObject(XAAdaptationGstCtx* omCtx, XAAdaptationGstCtx* bCtx, GstElement* usedMix);
+XAresult XAOutputMixAdapt_DisconnectObject(XAAdaptationGstCtx* omCtx, XAAdaptationGstCtx* bCtx);
+
+#endif /* XAOUTPUTMIXADAPTCTX_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/gst_adaptation/xaoutputmixitfadaptation.c	Fri May 14 16:22:35 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 "xaadaptationgst.h"
+#include "xacapabilitiesmgr.h"
+
+/*
+ * XAresult XAOutputMixItfAdapt_GetDestinationOutputDeviceIDs( XAAdaptationGstCtx *bCtx,
+ *                                                              XAint32 * pNumDevices,
+ *                                                              XAuint32 * pDeviceIDs )
+ * @param XAAdaptationGstCtx *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( XAAdaptationGstCtx *bCtx, XAint32 * pNumDevices, XAuint32 * pDeviceIDs )
+{
+    XAOutputMixAdaptationCtx* mCtx = NULL;
+    XAint32 iterator = 0;
+    DEBUG_API_A1("->XAOutputMixItfAdapt_GetDestinationOutputDeviceIDs pNumDevices:%ld",*pNumDevices);
+    if(!bCtx || bCtx->baseObj.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( XAAdaptationGstCtx *bCtx,
+ *                                       XAint32 numOutputDevices,
+ *                                       XAuint32 * pOutputDeviceIDs)
+ * @param XAAdaptationGstCtx *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( XAAdaptationGstCtx *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;
+    XACapabilities temp;
+
+    DEBUG_API_A1("->XAOutputMixItfAdapt_ReRoute numOutputDevices:%ld",numOutputDevices);
+    if(!bCtx ||
+        bCtx->baseObj.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 ==
+            XACapabilitiesMgr_GetCapsById(NULL, (XACapsType)(XACAP_DEVSNK|XACAP_AUDIO), devId, &temp) )
+        {
+            XAAdaptationGstCtx* 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,XAAdaptationGst_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,XAAdaptationGst_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/gst_adaptation/xaoutputmixitfadaptation.h	Fri May 14 16:22:35 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 "xaadaptationgst.h"
+
+
+XAresult XAOutputMixItfAdapt_GetDestinationOutputDeviceIDs( XAAdaptationGstCtx *bCtx, XAint32 * pNumDevices, XAuint32 * pDeviceIDs );
+XAresult XAOutputMixItfAdapt_ReRoute( XAAdaptationGstCtx *bCtx, XAint32 numOutputDevices, XAuint32 * pOutputDeviceIDs);
+
+#endif /* OUTPUTMIXITFADAPTATION_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/gst_adaptation/xaplaybackrateitfadaptation.c	Fri May 14 16:22:35 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 "xaadaptationgst.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(XAAdaptationGstCtx *bCtx, XApermille rate)
+ * @param XAAdaptationGstCtx *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(XAAdaptationGstCtx *bCtx, XApermille rate)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAMediaPlayerAdaptationCtx* mCtx = (XAMediaPlayerAdaptationCtx*) bCtx;
+    DEBUG_API_A1("->XAPlaybackRateItfAdapt_SetRate %d permilles", rate);
+
+    if( !bCtx || bCtx->baseObj.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 */
+            XAAdaptationGst_PrepareAsyncWait(bCtx);
+            DEBUG_INFO_A1("Apply new playrate %f.", mCtx->playrate);
+            if(!gst_element_seek( bCtx->bin, mCtx->playrate, GST_FORMAT_TIME,
+                                (GstSeekFlags)(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 */
+            XAAdaptationGst_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");
+            XAPlayItfAdaptGST_SetPlayState((XAAdaptationBaseCtx *)bCtx, XA_PLAYSTATE_PAUSED);
+        }
+
+    }
+
+    DEBUG_API("<-XAPlaybackRateItfAdapt_SetRate");
+    return ret;
+}
+
+/*
+ * XAresult XAPlaybackRateItfAdapt_SetPropertyConstraints(XAAdaptationGstCtx *bCtx,
+ *                                                       XAuint32 constraints)
+ */
+XAresult XAPlaybackRateItfAdapt_SetPropertyConstraints(XAAdaptationGstCtx *bCtx,
+                                                       XAuint32 constraints)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAMediaPlayerAdaptationCtx* mCtx = NULL;
+    DEBUG_API("->XAPlaybackRateItfAdapt_SetPropertyConstraints");
+
+    if( !bCtx || bCtx->baseObj.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(XAAdaptationGstCtx *bCtx,
+ *                                              XAuint32 *pProperties)
+ */
+XAresult XAPlaybackRateItfAdapt_GetProperties(XAAdaptationGstCtx *bCtx,
+                                               XAuint32 *pProperties)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAMediaPlayerAdaptationCtx* mCtx = NULL;
+    DEBUG_API("->XAPlaybackRateItfAdapt_GetProperties");
+
+    if( !bCtx || bCtx->baseObj.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(XAAdaptationGstCtx *bCtx,
+                                                       XApermille rate,
+                                                       XAuint32 *pCapabilities)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    
+    DEBUG_API("->XAPlaybackRateItfAdapt_GetCapabilitiesOfRate");
+    if( !bCtx || bCtx->baseObj.ctxId != XAMediaPlayerAdaptation )
+    {
+        DEBUG_ERR("Invalid context!");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    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(XAAdaptationGstCtx *bCtx,
+                                             XAuint8 index,
+                                             XApermille *pMinRate,
+                                             XApermille *pMaxRate,
+                                             XApermille *pStepSize,
+                                             XAuint32 *pCapabilities)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XAPlaybackRateItfAdapt_GetRateRange");
+
+    if( !bCtx || bCtx->baseObj.ctxId != XAMediaPlayerAdaptation )
+    {
+        DEBUG_ERR("Invalid context!");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* 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/gst_adaptation/xaplaybackrateitfadaptation.h	Fri May 14 16:22:35 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 "xaadaptationgst.h"
+
+
+/* FUNCTIONS */
+
+XAresult XAPlaybackRateItfAdapt_SetRate(XAAdaptationGstCtx *bCtx, XApermille rate);
+
+XAresult XAPlaybackRateItfAdapt_SetPropertyConstraints(XAAdaptationGstCtx *bCtx,
+                                                        XAuint32 constraints);
+
+XAresult XAPlaybackRateItfAdapt_GetProperties(XAAdaptationGstCtx *bCtx,
+                                               XAuint32 *pProperties);
+
+XAresult XAPlaybackRateItfAdapt_GetCapabilitiesOfRate(XAAdaptationGstCtx *bCtx,
+                                                       XApermille rate,
+                                                       XAuint32 *pCapabilities);
+
+XAresult XAPlaybackRateItfAdapt_GetRateRange(XAAdaptationGstCtx *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/gst_adaptation/xaplayitfadaptation.c	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,499 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "xaadaptationgst.h"
+#include "xacameraadaptctx.h"
+
+extern XAboolean cameraRealized;
+extern XACameraAdaptationCtx_* cameraCtx;
+
+/*forward declaration of position updater callback*/
+gboolean XAPlayItfAdapt_PositionUpdate(gpointer ctx);
+
+/*
+ * XAresult XAPlayItfAdaptGST_SetPlayState(XAAdaptationGstCtx *bCtx, XAuint32 state)
+ * Sets play state to GStreamer.
+ * @param XAAdaptationGstCtx *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 XAPlayItfAdaptGST_SetPlayState(XAAdaptationBaseCtx *ctx, 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;
+    XADataLocator_Address *address = NULL;
+    XAboolean playing = XA_BOOLEAN_FALSE;
+    XAAdaptationGstCtx *bCtx = (XAAdaptationGstCtx *)ctx;
+
+    DEBUG_API_A1("->XAPlayItfAdaptGST_SetPlayState %s",PLAYSTATENAME(state));
+
+    
+    if(!bCtx || bCtx->baseObj.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 );
+						if(gret == GST_STATE_CHANGE_SUCCESS)
+						    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;
+                XAAdaptationGst_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));
+                        XAAdaptationGst_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;
+                DEBUG_INFO_A1("Setted gst-bin to state %s", gst_element_state_get_name(GST_STATE(bCtx->bin)));
+
+                DEBUG_INFO_A1("Restoring gst-bin state to state %s", gst_element_state_get_name(gstOrigState));
+                bCtx->binWantedState = gstOrigState;
+                XAAdaptationGst_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));
+                        XAAdaptationGst_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 );
+						if(gret == GST_STATE_CHANGE_SUCCESS)
+						    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 = XAAdaptationGst_CreateGstSink( mCtx->xaVideoSink, "videosink", &(mCtx->isobjvsink) );
+					gst_bin_add(GST_BIN(mCtx->baseObj.bin), mCtx->videosink);
+					if (! gst_element_link(mCtx->filter, mCtx->videosink))
+			               {
+			                    DEBUG_ERR("Could not link Filter to videosink!!");
+			                    return XA_RESULT_INTERNAL_ERROR;
+			               }
+				}
+        	}
+
+/*            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, &XAAdaptationGst_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*/
+                XAAdaptationGst_PrepareAsyncWait(bCtx);
+                DEBUG_INFO_A1("Apply new playrate %f.", mCtx->playrate);
+                if(!gst_element_seek( bCtx->bin, mCtx->playrate, GST_FORMAT_TIME,
+                                    (GstSeekFlags)(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 */
+                XAAdaptationGst_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 )
+    {
+        XAAdaptationGst_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));
+                XAAdaptationGst_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, XAAdaptationGst_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 );
+			if(gret == GST_STATE_CHANGE_SUCCESS)
+			    gret = gst_element_get_state( GST_ELEMENT(mCtx->source), NULL,NULL, XA_ADAPT_ASYNC_TIMEOUT_SHORT_NSEC );
+		}
+    }
+    DEBUG_API("<-XAPlayItfAdaptGST_SetPlayState");
+    return ret;
+}
+
+/*
+ * XAresult XAPlayItfAdaptGST_GetDuration(XAAdaptationGstCtx *bCtx, XAmillisecond *pMsec)
+ * @param XAAdaptationGstCtx *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 XAPlayItfAdaptGST_GetDuration(XAAdaptationGstCtx *bCtx, XAmillisecond *pMsec)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    GstFormat format = GST_FORMAT_TIME;
+    gint64 duration;
+    DEBUG_API("->XAPlayItfAdaptGST_GetDuration");
+
+    if(!bCtx || bCtx->baseObj.ctxId != XAMediaPlayerAdaptation || !pMsec)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    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("<-XAPlayItfAdaptGST_GetDuration");
+    return ret;
+}
+
+/*
+ * XAresult XAPlayItfAdaptGST_GetPosition(XAAdaptationGstCtx *bCtx, XAmillisecond *pMsec)
+ * @param XAAdaptationGstCtx *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 XAPlayItfAdaptGST_GetPosition(XAAdaptationGstCtx *bCtx, XAmillisecond *pMsec)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    gint64 position;
+    GstFormat format = GST_FORMAT_TIME;
+    DEBUG_API("->XAPlayItfAdapGSTt_GetPosition");
+
+    if(!bCtx || bCtx->baseObj.ctxId != XAMediaPlayerAdaptation)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    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("<-XAPlayItfAdaptGST_GetPosition");
+    return ret;
+}
+
+/*
+ * XAresult XAPlayItfAdapt_EnablePositionTracking
+ * Enable/disable periodic position tracking callbacks
+ */
+XAresult XAPlayItfAdapt_EnablePositionTracking(XAAdaptationGstCtx *bCtx, XAboolean enable)
+{
+    XAMediaPlayerAdaptationCtx* mCtx;
+
+    DEBUG_API_A1("->XAPlayItfAdapt_EnablePositionTracking (enable: %d)", (int)enable);
+    if(!bCtx || bCtx->baseObj.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/gst_adaptation/xaplayitfadaptation.h	Fri May 14 16:22:35 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 XAPLAYITFADAPTATION_H
+#define XAPLAYITFADAPTATION_H
+
+#include "xaadaptationgst.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 XAPlayItfAdaptGST_SetPlayState(XAAdaptationBaseCtx *bCtx, XAuint32 state);
+XAresult XAPlayItfAdaptGST_GetDuration(XAAdaptationGstCtx *bCtx, XAmillisecond *pMsec);
+XAresult XAPlayItfAdaptGST_GetPosition(XAAdaptationGstCtx *bCtx, XAmillisecond *pMsec);
+XAresult XAPlayItfAdapt_EnablePositionTracking(XAAdaptationGstCtx *bCtx, XAboolean enable);
+
+
+#endif /* XAPLAYITFADAPTATION_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/gst_adaptation/xaradioadaptctx.c	Fri May 14 16:22:35 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 "xaadaptationgst.h"
+#include "assert.h"
+
+
+/*
+ * XAAdaptationGstCtx* XARadioAdapt_Create()
+ * Allocates memory for Radio Adaptation Context and makes 1st phase initialization
+ * @returns XARadioAdaptationCtx* - Pointer to created context
+ */
+XAAdaptationBaseCtx* XARadioAdapt_Create()
+{
+    XARadioAdaptationCtx *pSelf = (XARadioAdaptationCtx*)calloc(1, sizeof(XARadioAdaptationCtx));
+    DEBUG_API("->XARadioAdapt_Create");
+
+    if ( pSelf)
+    {
+        if( XAAdaptationBase_Init(&(pSelf->baseObj.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->baseObj;
+}
+
+/*
+ * 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.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(XAAdaptationGstCtx* 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.baseObj));
+
+    free(ctx);
+
+    DEBUG_API("<-XARadioAdapt_Destroy");
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/gst_adaptation/xaradioadaptctx.h	Fri May 14 16:22:35 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 XARADIOADAPTCTX_H
+#define XARADIOADAPTCTX_H
+
+#include "xaadaptationgst.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;
+
+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;
+
+#define RADIO_DEFAULT_FREQ_RANGE XA_FREQRANGE_FMEUROAMERICA
+#define RADIO_DEFAULT_FREQ 88000000
+
+/* TYPEDEFS */
+typedef struct XARadioAdaptationCtx_ XARadioAdaptationCtx;
+
+/*
+ * Structure for Camera specific gst-adaptation variables
+ */
+typedef struct XARadioAdaptationCtx_ {
+
+    /* Parent*/
+    XAAdaptationGstCtx_ baseObj;
+
+    /* OMX-AL Variables */
+    XAuint32 frequency;
+    XAuint8 range;
+
+    pthread_t emulationThread;
+    pthread_t rdsEmulationThread;
+    XARadioRDSState rdsState;
+    XARadioState state;
+
+    /* GST Variables */
+} XARadioAdaptationCtx_;
+
+/* FUNCTIONS */
+XAAdaptationBaseCtx* XARadioAdapt_Create(void);
+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/gst_adaptation/xaradioitfadaptation.c	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,797 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "xaadaptationgst.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
+{
+    XAAdaptationGstCtx *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(XAAdaptationGstCtx *bCtx, XAuint8 range);
+void * XARadioItfAdapt_AsyncSetFrequency(void* args);
+XAresult XARadioItfAdapt_SyncSetFrequency(XAAdaptationGstCtx *bCtx, XAuint32 freq);
+void * XARadioItfAdapt_AsyncSeek(void* args);
+
+/*
+ * XAresult XARadioItfAdapt_SetFreqRange(XAAdaptationGstCtx *bCtx, XAuint8 range)
+ */
+XAresult XARadioItfAdapt_SetFreqRange(XAAdaptationGstCtx *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 = (ThreadArgs*)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->baseObj, &event );
+    }
+    mCtx->state = XA_RADIO_IDLE;
+
+    free(args);
+    asyncdata = NULL;
+    DEBUG_API("<-XARadioItfAdapt_AsyncSetFrequencyRange");
+    pthread_exit(NULL);
+    return NULL;
+}
+
+/*
+ * XAresult XARadioItfAdapt_SyncSetFrequencyRange(XAAdaptationGstCtx *bCtx, XAuint8 range)
+ */
+XAresult XARadioItfAdapt_SyncSetFrequencyRange(XAAdaptationGstCtx *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(XAAdaptationGstCtx *bCtx,
+ *                                       XAuint8 * pFreqRange)
+ */
+XAresult XARadioItfAdapt_GetFreqRange(XAAdaptationGstCtx *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(XAAdaptationGstCtx *bCtx,
+ *                                                XAuint8 range,
+ *                                                XAboolean * pSupported)
+ */
+XAresult XARadioItfAdapt_IsFreqRangeSupported(XAAdaptationGstCtx *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(XAAdaptationGstCtx *bCtx,
+ *                                                 XAuint8 range,
+ *                                                 XAuint32 * pMinFreq,
+ *                                                 XAuint32 * pMaxFreq,
+ *                                                 XAuint32 * pFreqInterval)
+ */
+XAresult XARadioItfAdapt_GetFreqRangeProperties(XAAdaptationGstCtx *bCtx,
+                                               XAuint8 range,
+                                               XAuint32 * pMinFreq,
+                                               XAuint32 * pMaxFreq,
+                                               XAuint32 * pFreqInterval)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    
+    XAuint16 index=0;
+    DEBUG_API("->XARadioItfAdapt_GetFreqRangeProperties");
+
+    if(!bCtx)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARadioItfAdapt_GetFreqRangeProperties");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    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(XAAdaptationGstCtx *bCtx, XAuint32 freq)
+ */
+XAresult XARadioItfAdapt_SetFrequency(XAAdaptationGstCtx *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 = (ThreadArgs*)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->baseObj, &event );
+    }
+    mCtx->state = XA_RADIO_IDLE;
+
+    free(args);
+    asyncdata = NULL;
+    DEBUG_API("<-XARadioItfAdapt_AsyncSetFrequency");
+    pthread_exit(NULL);
+    return NULL;
+}
+
+/*
+ * XAresult XARadioItfAdapt_SyncSetFrequency(XAAdaptationGstCtx *bCtx, XAuint32 freq)
+ */
+XAresult XARadioItfAdapt_SyncSetFrequency(XAAdaptationGstCtx *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(XAAdaptationGstCtx *bCtx,
+ *                                       XAuint32 * pFrequency)
+ */
+XAresult XARadioItfAdapt_GetFrequency(XAAdaptationGstCtx *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(XAAdaptationGstCtx *bCtx)
+ */
+XAresult XARadioItfAdapt_CancelSetFrequency(XAAdaptationGstCtx *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(XAAdaptationGstCtx *bCtx, XAboolean squelch)
+ */
+XAresult XARadioItfAdapt_SetSquelch(XAAdaptationGstCtx *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(XAAdaptationGstCtx *bCtx, XAuint32 mode)
+ */
+XAresult XARadioItfAdapt_SetStereoMode(XAAdaptationGstCtx *bCtx, XAuint32 mode)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XARadioItfAdapt_SetStereoMode");
+
+    if(!bCtx || 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(XAAdaptationGstCtx *bCtx, XAuint32 * pStrength)
+ */
+XAresult XARadioItfAdapt_GetSignalStrength(XAAdaptationGstCtx *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(XAAdaptationGstCtx *bCtx, XAboolean upwards)
+ */
+XAresult XARadioItfAdapt_Seek(XAAdaptationGstCtx *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;
+
+    XAAdaptationGstCtx *bCtx = (XAAdaptationGstCtx*)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->baseObj, &event );
+    }
+    mCtx->state = XA_RADIO_IDLE;
+
+    pthread_exit(NULL);
+    return NULL;
+}
+
+/*
+ * XAresult XARadioItfAdapt_StopSeeking(XAAdaptationGstCtx *bCtx)
+ */
+XAresult XARadioItfAdapt_StopSeeking(XAAdaptationGstCtx *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(XAAdaptationGstCtx *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/gst_adaptation/xaradioitfadaptation.h	Fri May 14 16:22:35 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 "xaadaptationgst.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(XAAdaptationGstCtx *bCtx, XAuint8 range);
+
+XAresult XARadioItfAdapt_GetFreqRange(XAAdaptationGstCtx *bCtx,
+                                      XAuint8 * pFreqRange);
+
+XAresult XARadioItfAdapt_IsFreqRangeSupported(XAAdaptationGstCtx *bCtx,
+                                             XAuint8 range,
+                                             XAboolean * pSupported);
+
+XAresult XARadioItfAdapt_GetFreqRangeProperties(XAAdaptationGstCtx *bCtx,
+                                               XAuint8 range,
+                                               XAuint32 * pMinFreq,
+                                               XAuint32 * pMaxFreq,
+                                               XAuint32 * pFreqInterval);
+
+XAresult XARadioItfAdapt_SetFrequency(XAAdaptationGstCtx *bCtx, XAuint32 freq);
+
+XAresult XARadioItfAdapt_GetFrequency(XAAdaptationGstCtx *bCtx,
+                                      XAuint32 * pFrequency);
+
+XAresult XARadioItfAdapt_CancelSetFrequency(XAAdaptationGstCtx *bCtx);
+
+XAresult XARadioItfAdapt_SetSquelch(XAAdaptationGstCtx *bCtx, XAboolean squelch);
+
+XAresult XARadioItfAdapt_SetStereoMode(XAAdaptationGstCtx *bCtx, XAuint32 mode);
+
+XAresult XARadioItfAdapt_GetSignalStrength(XAAdaptationGstCtx *bCtx, XAuint32 * pStrength);
+
+XAresult XARadioItfAdapt_Seek(XAAdaptationGstCtx *bCtx, XAboolean upwards);
+
+XAresult XARadioItfAdapt_StopSeeking(XAAdaptationGstCtx *bCtx);
+
+void XARadioItfAdapt_Free(XAAdaptationBaseCtx *bCtx);
+
+#endif /* XARADIOITFADAPTATION_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/gst_adaptation/xardsitfadaptation.c	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,877 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "xaadaptationgst.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( XAAdaptationGstCtx *bCtx );
+void * XARDSItfAdapt_AsyncSeek(void* args);
+void * XARDSItfAdapt_AsyncGetODAGroup(void* args);
+
+/* exposing radio itf adaptation internal function here */
+XAresult XARadioItfAdapt_SyncSetFrequency(XAAdaptationGstCtx *bCtx, XAuint32 freq);
+
+
+/*
+ * XAresult XARDSItfAdapt_QueryRDSSignal(XAAdaptationGstCtx *bCtx, XAboolean * isSignal)
+ */
+XAresult XARDSItfAdapt_QueryRDSSignal(XAAdaptationGstCtx *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(XAAdaptationGstCtx *bCtx, XAchar * ps)
+ */
+XAresult XARDSItfAdapt_GetProgrammeServiceName(XAAdaptationGstCtx *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(XAAdaptationGstCtx *bCtx, XAchar * rt)
+ */
+XAresult XARDSItfAdapt_GetRadioText(XAAdaptationGstCtx *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(XAAdaptationGstCtx *bCtx,
+ *                                         XAuint8 contentType,
+ *                                         XAchar * informationElement,
+ *                                         XAchar * descriptor,
+ *                                         XAuint8 * descriptorContentType)
+ */
+XAresult XARDSItfAdapt_GetRadioTextPlus(XAAdaptationGstCtx *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(XAAdaptationGstCtx *bCtx, XAuint32 * pty)
+ */
+XAresult XARDSItfAdapt_GetProgrammeType(XAAdaptationGstCtx *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(XAAdaptationGstCtx *bCtx,
+ *                                               XAboolean isLengthMax16,
+ *                                               XAchar * pty)
+ *
+ */
+XAresult XARDSItfAdapt_GetProgrammeTypeString(XAAdaptationGstCtx *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(XAAdaptationGstCtx *bCtx, XAint16 * pi)
+ */
+XAresult XARDSItfAdapt_GetProgrammeIdentificationCode(XAAdaptationGstCtx *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(XAAdaptationGstCtx *bCtx, XAtime * dateAndTime)
+ */
+XAresult XARDSItfAdapt_GetClockTime(XAAdaptationGstCtx *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(XAAdaptationGstCtx *bCtx, XAboolean * ta)
+ */
+XAresult XARDSItfAdapt_GetTrafficAnnouncement(XAAdaptationGstCtx *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(XAAdaptationGstCtx *bCtx, XAboolean * tp)
+ */
+XAresult XARDSItfAdapt_GetTrafficProgramme(XAAdaptationGstCtx *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(XAAdaptationGstCtx *bCtx,
+ *                                            XAuint32 pty,
+ *                                            XAboolean upwards)
+ */
+XAresult XARDSItfAdapt_SeekByProgrammeType(XAAdaptationGstCtx *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(XAAdaptationGstCtx *bCtx, XAboolean upwards)
+ */
+XAresult XARDSItfAdapt_SeekTrafficAnnouncement(XAAdaptationGstCtx *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(XAAdaptationGstCtx *bCtx, XAboolean upwards)
+ */
+XAresult XARDSItfAdapt_SeekTrafficProgramme(XAAdaptationGstCtx *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;
+    XAAdaptationGstCtx *bCtx = (XAAdaptationGstCtx*)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->baseObj, &event );
+    }
+    mCtx->state = XA_RADIO_IDLE;
+
+    DEBUG_API("<-XARDSItfAdapt_AsyncSeek");
+    pthread_exit(NULL);
+    return NULL;
+}
+
+/*
+ * XAresult XARDSItfAdapt_SetAutomaticSwitching(XAAdaptationGstCtx *bCtx, XAboolean automatic)
+ */
+XAresult XARDSItfAdapt_SetAutomaticSwitching(XAAdaptationGstCtx *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(XAAdaptationGstCtx *bCtx, XAboolean * automatic)
+ */
+XAresult XARDSItfAdapt_GetAutomaticSwitching(XAAdaptationGstCtx *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(XAAdaptationGstCtx *bCtx, XAboolean automatic)
+ */
+XAresult XARDSItfAdapt_SetAutomaticTrafficAnnouncement(XAAdaptationGstCtx *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(XAAdaptationGstCtx *bCtx, XAboolean * automatic)
+ */
+XAresult XARDSItfAdapt_GetAutomaticTrafficAnnouncement(XAAdaptationGstCtx *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(XAAdaptationGstCtx *bCtx,
+ *                                    XAint16 AID)
+ */
+XAresult XARDSItfAdapt_GetODAGroup(XAAdaptationGstCtx *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);
+    return NULL;
+}
+
+/*
+ * XAresult XARDSItfAdapt_SubscribeODAGroup(XAAdaptationGstCtx *bCtx,
+ *                                          XAint16 group,
+ *                                          XAboolean useErrorCorrection)
+ */
+XAresult XARDSItfAdapt_SubscribeODAGroup(XAAdaptationGstCtx *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(XAAdaptationGstCtx *bCtx, XAint16 group)
+ */
+XAresult XARDSItfAdapt_UnsubscribeODAGroup(XAAdaptationGstCtx *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(XAAdaptationGstCtx *bCtx,
+ *                                                  XAint16* pGroups,
+ *                                                  XAuint32* pLength)
+ */
+XAresult XARDSItfAdapt_ListODAGroupSubscriptions(XAAdaptationGstCtx *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( XAAdaptationGstCtx *bCtx )
+ */
+const RDSData* GetCurrentRdsData( XAAdaptationGstCtx *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(XAAdaptationGstCtx *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/gst_adaptation/xardsitfadaptation.h	Fri May 14 16:22:35 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 "xaadaptationgst.h"
+#include "xadebug.h"
+
+/* MACROS */
+
+/* FUNCTIONS */
+
+XAresult XARDSItfAdapt_QueryRDSSignal(XAAdaptationGstCtx *bCtx, XAboolean * isSignal);
+
+XAresult XARDSItfAdapt_GetProgrammeServiceName(XAAdaptationGstCtx *bCtx, XAchar * ps);
+
+XAresult XARDSItfAdapt_GetRadioText(XAAdaptationGstCtx *bCtx, XAchar * rt);
+
+XAresult XARDSItfAdapt_GetRadioTextPlus(XAAdaptationGstCtx *bCtx,
+                                       XAuint8 contentType,
+                                       XAchar * informationElement,
+                                       XAchar * descriptor,
+                                       XAuint8 * descriptorContentType);
+
+XAresult XARDSItfAdapt_GetProgrammeType(XAAdaptationGstCtx *bCtx, XAuint32 * pty);
+
+XAresult XARDSItfAdapt_GetProgrammeTypeString(XAAdaptationGstCtx *bCtx,
+                                             XAboolean isLengthMax16,
+                                             XAchar * pty);
+
+XAresult XARDSItfAdapt_GetProgrammeIdentificationCode(XAAdaptationGstCtx *bCtx, XAint16 * pi);
+
+XAresult XARDSItfAdapt_GetClockTime(XAAdaptationGstCtx *bCtx, XAtime * dateAndTime);
+
+XAresult XARDSItfAdapt_GetTrafficAnnouncement(XAAdaptationGstCtx *bCtx, XAboolean * ta);
+
+XAresult XARDSItfAdapt_GetTrafficProgramme(XAAdaptationGstCtx *bCtx, XAboolean * tp);
+
+XAresult XARDSItfAdapt_SeekByProgrammeType(XAAdaptationGstCtx *bCtx,
+                                          XAuint32 pty,
+                                          XAboolean upwards);
+
+XAresult XARDSItfAdapt_SeekTrafficAnnouncement(XAAdaptationGstCtx *bCtx, XAboolean upwards);
+
+XAresult XARDSItfAdapt_SeekTrafficProgramme(XAAdaptationGstCtx *bCtx, XAboolean upwards);
+
+XAresult XARDSItfAdapt_SetAutomaticSwitching(XAAdaptationGstCtx *bCtx, XAboolean automatic);
+
+XAresult XARDSItfAdapt_GetAutomaticSwitching(XAAdaptationGstCtx *bCtx, XAboolean * automatic);
+
+XAresult XARDSItfAdapt_SetAutomaticTrafficAnnouncement(XAAdaptationGstCtx *bCtx, XAboolean automatic);
+
+XAresult XARDSItfAdapt_GetAutomaticTrafficAnnouncement(XAAdaptationGstCtx *bCtx, XAboolean * automatic);
+
+XAresult XARDSItfAdapt_GetODAGroup(XAAdaptationGstCtx *bCtx, XAint16 AID);
+
+XAresult XARDSItfAdapt_SubscribeODAGroup(XAAdaptationGstCtx *bCtx,
+                                        XAint16 group,
+                                        XAboolean useErrorCorrection);
+
+XAresult XARDSItfAdapt_UnsubscribeODAGroup(XAAdaptationGstCtx *bCtx, XAint16 group);
+
+XAresult XARDSItfAdapt_ListODAGroupSubscriptions(XAAdaptationGstCtx *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/gst_adaptation/xarecorditfadaptation.c	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,402 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "xaadaptationgst.h"
+#include "xacameraadaptctx.h"
+
+/*forward declaration of position updater callback*/
+gboolean XARecordItfAdapt_PositionUpdate(gpointer ctx);
+
+extern XAboolean cameraRealized;
+extern XACameraAdaptationCtx_* cameraCtx;
+
+/*
+ * XAresult XARecordItfAdapt_SetRecordState(XAAdaptationGstCtx *ctx, XAuint32 state)
+ * Sets record state to GStreamer.
+ * @param XAAdaptationGstCtx *ctx - Adaptation context
+ * XAuint32 state - Record state to be set
+ * @return XAresult ret - Success value
+ */
+XAresult XARecordItfAdapt_SetRecordState(XAAdaptationGstCtx *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->baseObj.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:
+        {
+                // Audio sourse should be stopped 
+                if ( mCtx->audiosource )
+                {
+                   if ( gst_element_send_event (mCtx->audiosource, gst_event_new_eos ()) == TRUE )
+                   {
+                       DEBUG_INFO ("posted eos");
+                   }
+                   else
+                       {
+                        DEBUG_ERR("FAIL : post eos");
+                       }
+                }
+        
+        	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 );
+	        			if(gret == GST_STATE_CHANGE_SUCCESS)
+	        			    gret = gst_element_get_state( GST_ELEMENT(mCtx->videosource), NULL,NULL, XA_ADAPT_ASYNC_TIMEOUT_SHORT_NSEC );
+	            	}
+	            }
+			}
+
+            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 );
+						if(gret == GST_STATE_CHANGE_SUCCESS)
+						    gret = gst_element_get_state( GST_ELEMENT(mCtx->videosource), NULL,NULL, XA_ADAPT_ASYNC_TIMEOUT_SHORT_NSEC );
+					}
+				}
+			}
+
+            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(mCtx->xaRecordState==XA_RECORDSTATE_STOPPED && (mCtx->encodingchanged))
+            {
+                XAMediaRecorderAdapt_ChangeEncoders( mCtx );
+                mCtx->encodingchanged = XA_BOOLEAN_FALSE;
+            }
+
+            if ( mCtx->recThrCtx.bufInsufficientSem )
+            {
+                /* Recording to address and recording thread semaphora is created */
+                if(! XAImpl_StartThread(&(mCtx->recordingEventThr),NULL, &XAMediaRecorderAdapt_RecordEventThr, (void*)mCtx ))
+                    {
+                        DEBUG_ERR("Start thread Failed");
+						return XA_RESULT_INTERNAL_ERROR;
+                    }
+            }
+
+            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 )
+    {
+        XAAdaptationGst_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);
+                XAAdaptationGst_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, XAAdaptationGst_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 );
+			if(gret == GST_STATE_CHANGE_SUCCESS)
+			    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(XAAdaptationGstCtx *bCtx, XAuint32 *state)
+ * Description: Return record state
+ */
+XAresult XARecordItfAdapt_GetRecordState(XAAdaptationGstCtx *bCtx, XAuint32 *state)
+{
+    XAMediaRecorderAdaptationCtx* mCtx = NULL;
+    DEBUG_API("->XARecordItfAdapt_GetRecordState");
+
+    if(!bCtx || bCtx->baseObj.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(XAAdaptationGstCtx *ctx, AdaptationContextIDS ctxIDs, XAmillisecond *pMsec)
+ * @param XAAdaptationGstCtx *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(XAAdaptationGstCtx *bCtx, XAmillisecond *pMsec)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    
+    gint64 position=0;
+    GstFormat format = GST_FORMAT_TIME;
+    DEBUG_API("->XARecordItfAdapt_GetPosition");
+
+    if(!bCtx || bCtx->baseObj.ctxId != XAMediaRecorderAdaptation)
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XARecordItfAdapt_GetPosition");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    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)
+{
+    XAAdaptationGstCtx *bCtx = (XAAdaptationGstCtx*) 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->baseObj, &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 );
+    }
+    return FALSE;
+}
+
+/*
+ * XAresult XARecordItfAdapt_EnablePositionTracking
+ * Enable/disable periodic position tracking callbacks
+ */
+XAresult XARecordItfAdapt_EnablePositionTracking(XAAdaptationGstCtx *bCtx, XAboolean enable)
+{
+    XAMediaRecorderAdaptationCtx* mCtx = (XAMediaRecorderAdaptationCtx*) bCtx;
+    DEBUG_API_A1("->XARecordItfAdapt_EnablePositionTracking (enable: %lu)", enable);
+
+    if(!bCtx || bCtx->baseObj.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/gst_adaptation/xarecorditfadaptation.h	Fri May 14 16:22:35 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 "xaadaptationgst.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(XAAdaptationGstCtx *ctx, XAuint32 state );
+XAresult XARecordItfAdapt_SetDurationLimit( XAAdaptationGstCtx *ctx, XAmillisecond msec );
+XAresult XARecordItfAdapt_GetPosition( XAAdaptationGstCtx *ctx, XAmillisecond *pMsec );
+XAresult XARecordItfAdapt_EnablePositionTracking(XAAdaptationGstCtx *ctx, XAboolean enable);
+XAresult XARecordItfAdapt_GetRecordState(XAAdaptationGstCtx *bCtx, XAuint32 *state);
+
+#endif /* XARECORDITFADAPTATION_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/gst_adaptation/xaseekitfadaptation.c	Fri May 14 16:22:35 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 "xaadaptationgst.h"
+#include "xamediaplayeradaptctx.h"
+#include "xaseekitfadaptation.h"
+
+/*
+ * XAresult XASeekItfAdapt_SetPosition(XAAdaptationGstCtx *bCtx, XAmillisecond pos, XAuint32 seekMode)
+ * @param XAAdaptationGstCtx *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(XAAdaptationGstCtx *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->baseObj.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;
+    }
+
+    XAAdaptationGst_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, (gint64)GST_CLOCK_TIME_NONE ) )
+    {
+        DEBUG_ERR("WARN: gst reports seek not handled");
+    }
+    /* flushed seeks always asynchronous */
+    XAAdaptationGst_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->baseObj, &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 XAAdaptationGstCtx *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(XAAdaptationGstCtx *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->baseObj.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 = (gint64)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 = (gint64)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/gst_adaptation/xaseekitfadaptation.h	Fri May 14 16:22:35 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 "xaadaptationgst.h"
+#include "xadebug.h"
+
+/* FUNCTIONS */
+
+XAresult XASeekItfAdapt_SetPosition(XAAdaptationGstCtx *ctx, XAmillisecond pos,
+                                        XAuint32 seekMode);
+
+XAresult XASeekItfAdapt_SetLoop(XAAdaptationGstCtx *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/gst_adaptation/xasnapshotitfadaptation.c	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,891 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "xaadaptationgst.h"
+#include "xasnapshotitfadaptation.h"
+#include "xamediarecorderadaptctx.h"
+#include "xametadataadaptation.h"
+#include "xacameraadaptctx.h"
+#include "xacapabilitiesmgr.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(XAAdaptationGstCtx* bCtx);
+XAresult XASnapshotItfAdaptation_FreeSnapshot(XAAdaptationGstCtx* bCtx);
+const char* XASnapshotItfAdaptation_GetFileSuffix(XADataFormat_MIME* format);
+void XASnapshotItfAdaptation_AllocNextFilename(char** fname, const char* template);
+void XASnapshotItfAdaptation_StopSnapshotting(XAAdaptationGstCtx* 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(XAAdaptationGstCtx* bCtx,
+ *                                                 XAuint32 numberOfPictures,
+ *                                                 XAuint32 fps,
+ *                                                 XAboolean freezeViewFinder,
+ *                                                 XADataSink* sink)
+ */
+XAresult XASnapshotItfAdaptation_InitiateSnapshot(XAAdaptationGstCtx* 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 = (char*)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(XAAdaptationGstCtx* bCtx)
+ */
+XAresult XASnapshotItfAdaptation_TakeSnapshot(XAAdaptationGstCtx* bCtx)
+{
+    XAMediaRecorderAdaptationCtx* mCtx = NULL;
+
+    DEBUG_API("->XASnapshotItfAdaptation_TakeSnapshot");
+    if(!bCtx || bCtx->baseObj.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, XAAdaptationGst_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, XAAdaptationGst_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(XAAdaptationGstCtx* bCtx)
+ */
+XAresult XASnapshotItfAdaptation_CancelSnapshot(XAAdaptationGstCtx* bCtx)
+{
+    DEBUG_API("->XASnapshotItfAdaptation_CancelSnapshot");
+    if(!bCtx || bCtx->baseObj.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(XAAdaptationGstCtx* bCtx,
+ *                                              XAuint32 *maxNumberOfPictures)
+ */
+XAresult XASnapshotItfAdaptation_GetMaxPicsPerBurst(XAAdaptationGstCtx* bCtx,
+                                              XAuint32 *maxNumberOfPictures)
+{
+    DEBUG_API("->XASnapshotItfAdaptation_GetMaxPicsPerBurst");
+    if(!bCtx || bCtx->baseObj.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(XAAdaptationGstCtx* bCtx,
+ *                                            XAuint32 *minFPS,
+ *                                           XAuint32 *maxFPS)
+ */
+XAresult XASnapshotItfAdaptation_GetBurstFPSRange(XAAdaptationGstCtx* bCtx,
+                                            XAuint32 *minFPS,
+                                            XAuint32 *maxFPS)
+{
+    DEBUG_API("->XASnapshotItfAdaptation_GetBurstFPSRange");
+    if(!bCtx || bCtx->baseObj.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(XAAdaptationGstCtx* bCtx,
+ *                                              XAboolean enabled)
+ */
+XAresult XASnapshotItfAdaptation_SetShutterFeedback(XAAdaptationGstCtx* bCtx,
+                                              XAboolean enabled)
+{
+    DEBUG_API("->XASnapshotItfAdaptation_SetShutterFeedback");
+    if(!bCtx || bCtx->baseObj.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(XAAdaptationGstCtx* bCtx)
+ */
+void XASnapshotItfAdaptation_StopSnapshotting(XAAdaptationGstCtx* 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(XAAdaptationGstCtx* bCtx)
+ */
+XAresult XASnapshotItfAdaptation_FreeSnapshot(XAAdaptationGstCtx* bCtx)
+{
+    XAMediaRecorderAdaptationCtx* mCtx = NULL;
+    DEBUG_API("->XASnapshotItfAdaptation_FreeSnapshot");
+    if(!bCtx || bCtx->baseObj.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(XAAdaptationGstCtx* bCtx)
+ */
+XAresult XASnapshotItfAdaptation_CreateSnapshotPipeline(XAAdaptationGstCtx* bCtx)
+{
+    XAMediaRecorderAdaptationCtx* mCtx = NULL;
+
+    XACapabilities temp;
+    GstCaps *imageCaps=NULL;
+
+    DEBUG_API("->XASnapshotItfAdaptation_CreateSnapshotPipeline");
+    if(!bCtx || bCtx->baseObj.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(XACapabilitiesMgr_GetCapsById(NULL, (XACapsType)(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;
+            }
+        }
+        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 = (XADataSink*)calloc(1, sizeof(XADataSink));
+                        pullSinkLoc = (XADataLocator_Address*)calloc(1, sizeof(XADataLocator_Address));
+                        pullSinkLoc->length = pullBuffer->size;
+                        pullSinkLoc->pAddress = (XADataLocator_Address*)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.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.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.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 = (char*)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/gst_adaptation/xasnapshotitfadaptation.h	Fri May 14 16:22:35 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 "xaadaptationgst.h"
+
+
+/* DEFINES*/
+
+/* MACROS */
+
+/* FUNCTIONS */
+
+XAresult XASnapshotItfAdaptation_InitiateSnapshot(XAAdaptationGstCtx* ctx,
+                                            XAuint32 numberOfPictures,
+                                            XAuint32 fps,
+                                            XAboolean freezeViewFinder,
+                                            XADataSink* sink);
+
+XAresult XASnapshotItfAdaptation_TakeSnapshot(XAAdaptationGstCtx* ctx);
+
+XAresult XASnapshotItfAdaptation_CancelSnapshot(XAAdaptationGstCtx* ctx);
+
+XAresult XASnapshotItfAdaptation_GetMaxPicsPerBurst(XAAdaptationGstCtx* ctx,
+                                              XAuint32 *maxNumberOfPictures);
+
+XAresult XASnapshotItfAdaptation_GetBurstFPSRange(XAAdaptationGstCtx* ctx,
+                                            XAuint32 *minFPS,
+                                            XAuint32 *maxFPS);
+
+XAresult XASnapshotItfAdaptation_SetShutterFeedback(XAAdaptationGstCtx* ctx,
+                                              XAboolean enabled);
+#endif /* XSNAPSHOTITFADAPTATION_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/gst_adaptation/xastaticcameracapsadaptation.c	Fri May 14 16:22:35 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 "xaadptbasectx.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/gst_adaptation/xastaticcameracapsadaptation.h	Fri May 14 16:22:35 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(void);
+
+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/gst_adaptation/xastreaminformationitfadaptation.c	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,901 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "xadebug.h"
+#include "xathreadsafety.h"
+#include "xaadaptationgst.h"
+#include "xamediaplayeradaptctx.h"
+#include "xastreaminformationitfadaptation.h"
+#include "xaplayitfadaptation.h"
+
+/* local functions */
+XAresult GetDomainTypeFromCodecBinSrcPads(
+                    GList *sourcePads,
+                    XAuint32 containerType,
+                    XAuint32 streamIndex,
+                    XAuint32 *domain);
+
+XAresult GetAudioStreamInfoFromPads(
+                    GstPad *srcPad,
+                    XAuint32 *channels,
+                    XAuint32 *sampleRate,
+                    XAuint32 *bitRate);
+
+XAresult GetVideoStreamInfoFromPads(
+                    GstPad *srcPad,
+                    XAuint32 *width,
+                    XAuint32 *height,
+                    XAuint32 *frameRate,
+                    XAuint32 *bitRate);
+
+XAresult GetImageStreamInfoFromPads(
+                    GstPad *srcPad,
+                    XAuint32 *width,
+                    XAuint32 *height);
+
+/*
+ * XAStreamInformationItfAdapt_QueryMediaContainerInformation(
+ *   XAAdaptationBaseCtx *adaptCtx,
+ *   XAMediaContainerInformation *info);
+ * Description: Obtains media container information
+ */
+XAresult  XAStreamInformationItfAdapt_QueryMediaContainerInformation(
+    XAAdaptationBaseCtx *adaptCtx,
+    XAuint32 *containerType,
+    XAmillisecond *mediaDuration,
+    XAuint32 *numStreams)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XADataSource *xaDataSource = NULL;
+    GstElement *codecbin = NULL;
+
+    DEBUG_API("->XAStreamInformationItfAdapt_QueryMediaContainerInformation");
+    /* Both Media Player and Metadata Extractor objec uses the same ctxId */
+    if( !adaptCtx ||
+        (adaptCtx->ctxId != XAMediaPlayerAdaptation) )
+/*        !((adaptCtx->ctxId == XAMediaPlayerAdaptation) ||
+         (adaptCtx->ctxId == XAMDAdaptation) ) )
+*/
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("-<XAStreamInformationItfAdapt_QueryMediaContainerInformation");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* Get media container type */
+    DEBUG_INFO_A2("Adaptation Context- ID is [%u] Extended ID[%u]",
+                (unsigned int)adaptCtx->ctxId,
+                (unsigned int)((XAMediaPlayerAdaptationCtx*) adaptCtx)->extendedCtxId);
+
+    /* Initialize to unspecified */
+    *containerType = XA_CONTAINERTYPE_UNSPECIFIED;
+    xaDataSource = ((XAMediaPlayerAdaptationCtx*) adaptCtx)->xaSource;
+/*    DEBUG_INFO("Obtained handle to xaDataSource");*/
+    if ( xaDataSource &&
+         xaDataSource->pFormat &&
+         ( (*(XAuint32*)xaDataSource->pFormat ) == XA_DATAFORMAT_MIME) )
+    {
+        *containerType = ((XADataFormat_MIME*)(xaDataSource->pFormat))->containerType;
+        DEBUG_INFO_A1("Container type obtained from xaDataSource->pFormat is [%u]", (unsigned int)(*containerType));
+    }
+    else
+    {
+        DEBUG_INFO("Container type unspecified");
+    }
+
+    /* Get media duration */
+    ret = XAPlayItfAdaptGST_GetDuration((XAAdaptationGstCtx*)adaptCtx, mediaDuration);
+    if ( ret != XA_RESULT_SUCCESS )
+        return ret;
+
+    /* Determine number of streams */
+    codecbin = ((XAMediaPlayerAdaptationCtx*) adaptCtx)->codecbin;
+    if ( codecbin == NULL )
+    {
+        DEBUG_ERR("XA_RESULT_INTERNAL_ERROR");
+        DEBUG_API("-<XAStreamInformationItfAdapt_QueryMediaContainerInformation");
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+    *numStreams = codecbin->numsrcpads;
+
+    DEBUG_API("-<XAStreamInformationItfAdapt_QueryMediaContainerInformation");
+    return XA_RESULT_SUCCESS;
+}
+
+/*
+ * XAresult XAStreamInformationItfAdapt_QueryStreamType(
+ *               XAAdaptationBaseCtx *adaptCtx,
+ *               XAuint32 streamIndex,
+ *               XAuint32 *domain)
+ * Description: Obtains stream type information
+ */
+XAresult XAStreamInformationItfAdapt_QueryStreamType(
+                XAAdaptationBaseCtx *adaptCtx,
+                XAuint32 streamIndex,
+                XAuint32 *domain)
+{
+    XAresult ret;
+    XAuint32 containerType;
+    XAmillisecond mediaDuration;
+    XAuint32 numStreams;
+    XADataSource *xaDataSource = NULL;
+
+
+    DEBUG_API("->XAStreamInformationItfAdapt_QueryStreamType");
+
+    ret = XAStreamInformationItfAdapt_QueryMediaContainerInformation(
+            adaptCtx, &containerType, &mediaDuration, &numStreams);
+    if (ret != XA_RESULT_SUCCESS)
+    {
+        DEBUG_ERR_A1("XA_RESULT_[0x%x]", (unsigned int)ret);
+        DEBUG_API("-<XAStreamInformationItfAdapt_QueryStreamType");
+        return ret;
+    }
+
+    /* validate stream index */
+    if ( streamIndex > numStreams )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("-<XAStreamInformationItfAdapt_QueryStreamType");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* if format type is raw image */
+    xaDataSource = ((XAMediaPlayerAdaptationCtx*) adaptCtx)->xaSource;
+    if( xaDataSource->pFormat &&
+      ( (*(XAuint32*)xaDataSource->pFormat ) == XA_DATAFORMAT_RAWIMAGE) )
+    {
+        *domain = XA_DOMAINTYPE_IMAGE;
+        return XA_RESULT_SUCCESS;
+    }
+    else
+    {
+        GstElement *codecbin = ((XAMediaPlayerAdaptationCtx*) adaptCtx)->codecbin;
+        if ( codecbin == NULL )
+        {
+            DEBUG_ERR("XA_RESULT_INTERNAL_ERROR");
+            DEBUG_API("-<XAStreamInformationItfAdapt_QueryStreamType");
+            return XA_RESULT_INTERNAL_ERROR;
+        }
+
+        GST_OBJECT_LOCK( codecbin );
+        ret = GetDomainTypeFromCodecBinSrcPads(
+                    codecbin->srcpads,
+                    containerType,
+                    streamIndex,
+                    domain);
+        GST_OBJECT_UNLOCK( codecbin );
+    }
+
+    DEBUG_API("-<XAStreamInformationItfAdapt_QueryStreamType");
+    return ret;
+}
+
+/*
+ * XAresult XAStreamInformationItfAdapt_QueryStreamInformation(
+ *               XAAdaptationBaseCtx *adaptCtx,
+ *               XAuint32 streamIndex,
+ *               void * info)
+ * Description: Obtains stream information
+ */
+XAresult XAStreamInformationItfAdapt_QueryStreamInformation(
+                XAAdaptationBaseCtx *adaptCtx,
+                XAuint32 streamIndex,
+                void * info)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAuint32 domain;
+    XAuint32 codecId = 0;
+    XAuint32 channels;
+    XAmilliHertz sampleRate;
+    XAuint32 bitRate;
+    XAmillisecond duration;
+    XAuint32 width;
+    XAuint32 height;
+    XAuint32 frameRate;
+    /*TODO fix this call below in capabilitymgr*/
+    /*XACapsType filter;*/
+    GstElement *codecbin = NULL;
+
+    DEBUG_API("->XAStreamInformationItfAdapt_QueryStreamInformation");
+
+    /* stream index is validated in XAStreamInformationItfAdapt_QueryStreamType */
+    ret = XAStreamInformationItfAdapt_QueryStreamType(
+            adaptCtx, streamIndex, &domain);
+
+    if (ret != XA_RESULT_SUCCESS)
+    {
+        DEBUG_ERR_A1("XA_RESULT_[0x%x]", (unsigned int)ret);
+        DEBUG_API("-<XAStreamInformationItfAdapt_QueryStreamInformation");
+        return ret;
+    }
+    if ( domain == XA_DOMAINTYPE_UNKNOWN )
+    {
+        DEBUG_ERR("XA_RESULT_CONTENT_UNSUPPORTED");
+        DEBUG_API("-<XAStreamInformationItfAdapt_QueryStreamInformation");
+        return XA_RESULT_CONTENT_UNSUPPORTED;
+    }
+
+    codecbin = ((XAMediaPlayerAdaptationCtx*) adaptCtx)->codecbin;
+    if ( codecbin == NULL )
+    {
+        DEBUG_ERR("XA_RESULT_INTERNAL_ERROR");
+        DEBUG_API("-<XAStreamInformationItfAdapt_QueryStreamInformation");
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+
+    /* For midi none of the properties can be queried from gstreamer */
+    if ( domain != XA_DOMAINTYPE_MIDI )
+    {
+        GstPad* srcPad = NULL;
+        gchar* codecbinFactoryName = NULL;
+
+        GST_OBJECT_LOCK( codecbin );
+        srcPad = (GstPad*) g_list_nth_data(codecbin->srcpads, (streamIndex -1 ));
+        DEBUG_INFO_A1("Obtaining SrcPad%u from Decode bin", (unsigned int)(streamIndex-1));
+        if (srcPad == NULL)
+        {
+            GST_OBJECT_UNLOCK( codecbin );
+            DEBUG_ERR("XA_RESULT_INTERNAL_ERROR");
+            DEBUG_API("-<QueryStreamInformation");
+            return XA_RESULT_INTERNAL_ERROR;
+        }
+        switch (domain)
+        {
+            /*TODO fix this call below in capabilitymgr*/
+            /*case XA_DOMAINTYPE_AUDIO:
+                filter = XACAP_AUDIO;
+                break;
+            case XA_DOMAINTYPE_VIDEO:
+                filter = XACAP_VIDEO;
+                break;
+            case XA_DOMAINTYPE_IMAGE:
+                filter = XACAP_IMAGE;
+                break;*/
+        };
+
+        codecbinFactoryName = gst_element_get_name(gst_element_get_factory (codecbin));
+        /* decode bin has the sink pads ghosted from targetPad.
+        So retreive the name of the original decoder element*/
+        if ( strcmp(codecbinFactoryName, "decodebin") == 0 )
+        {
+            GstPad* targetPad = NULL;
+            gchar* decoderElementName = NULL; /* for retreiving codec id*/
+
+            DEBUG_INFO("Decodebin: Obtaining target pad of SrcPad");
+            targetPad = gst_ghost_pad_get_target ((GstGhostPad*)srcPad);
+            decoderElementName = gst_element_get_name(gst_element_get_factory (gst_pad_get_parent_element(targetPad)));
+            /*TODO fix this call below in capabilitymgr*/
+            /*
+            ret = XAStaticCapsAdapt_GetCodecIDByPluginName(
+                        filter,
+                        (XAchar*)decoderElementName,
+                        &codecId);
+             */
+            gst_object_unref(targetPad);
+            g_free(decoderElementName);
+        }
+        else /* for identity, audioparse and videoparse elements */
+        {
+            DEBUG_INFO("Not decode bin, but a passthru element");
+            /*TODO fix this call below in capabilitymgr*/
+/*            ret = XAStaticCapsAdapt_GetCodecIDByPluginName(
+                        filter,
+                        (XAchar*)codecbinFactoryName,
+                        &codecId);*/
+        }
+        g_free(codecbinFactoryName);
+        if ( ret == XA_RESULT_SUCCESS )
+        {
+            /* retreive srcPad properties before releasing lock on codecbin */
+            switch(domain)
+            {
+                case XA_DOMAINTYPE_AUDIO:
+                    DEBUG_INFO("Getting Audio Stream Info from SrcPad");
+                    ret = GetAudioStreamInfoFromPads(
+                                srcPad,
+                                &channels,
+                                &sampleRate,
+                                &bitRate);
+                    break;
+                case XA_DOMAINTYPE_VIDEO:
+                    DEBUG_INFO("Getting Video Stream Info from SrcPad");
+                    ret = GetVideoStreamInfoFromPads(
+                                srcPad,
+                                &width,
+                                &height,
+                                &frameRate,
+                                &bitRate);
+                    break;
+                case XA_DOMAINTYPE_IMAGE:
+                    DEBUG_INFO("Getting Image Stream Info from SrcPad");
+                    ret = GetImageStreamInfoFromPads(
+                                srcPad,
+                                &width,
+                                &height
+                                );
+                    break;
+                default:
+                    break;
+            };
+        }
+        /* Now unlock the bin */
+        GST_OBJECT_UNLOCK( codecbin );
+    }    /*if ( domain != XA_DOMAIN_TYPE_MIDI )*/
+
+    if ( ret == XA_RESULT_SUCCESS)
+    {
+        DEBUG_INFO("Getting media duration");
+        ret = XAPlayItfAdaptGST_GetDuration((XAAdaptationGstCtx*)adaptCtx, &duration);
+    }
+
+    /* Now assign properties to data structure */
+    if ( ret == XA_RESULT_SUCCESS)
+    {
+        switch(domain)
+        {
+            case XA_DOMAINTYPE_AUDIO:
+            {
+                XAAudioStreamInformation* streamInfo = (XAAudioStreamInformation*)info;
+                DEBUG_INFO("Assigning values for XAAudioStreamInformation");
+                streamInfo->codecId = codecId;
+                streamInfo->channels = channels;
+                streamInfo->sampleRate = sampleRate;
+                streamInfo->bitRate = bitRate;
+                streamInfo->langCountry[0] = '\0';
+                streamInfo->duration = duration;
+            }
+                break;
+            case XA_DOMAINTYPE_MIDI:
+            {
+                XAMIDIStreamInformation* streamInfo = (XAMIDIStreamInformation*)info;
+                DEBUG_INFO("Assigning values for XAMIDIStreamInformation");
+                /*currently there is no way to get these information from gstreamer*/
+                streamInfo->channels = XA_MIDI_UNKNOWN;
+                streamInfo->tracks = XA_MIDI_UNKNOWN;
+                streamInfo->bankType = XA_MIDIBANK_DEVICE;
+                /*streamInfo->bitRate = 0;*/
+                streamInfo->langCountry[0] = '\0';
+                streamInfo->duration = duration;
+            }
+                break;
+            case XA_DOMAINTYPE_VIDEO:
+            {
+                XAVideoStreamInformation* streamInfo = (XAVideoStreamInformation*)info;
+                DEBUG_INFO("Assigning values for XAVideoStreamInformation");
+                streamInfo->codecId = codecId;
+                streamInfo->width = width;
+                streamInfo->height = height;
+                streamInfo->bitRate = bitRate;
+                streamInfo->duration = duration;
+            }
+                break;
+            case XA_DOMAINTYPE_IMAGE:
+            {
+                XAImageStreamInformation* streamInfo = (XAImageStreamInformation*)info;
+                DEBUG_INFO("Assigning values for XAImageStreamInformation");
+                streamInfo->codecId = codecId;
+                streamInfo->width = width;
+                streamInfo->height = height;
+                streamInfo->presentationDuration = duration;
+            }
+                break;
+            default:
+                break;
+        };
+    } /*if ( ret == XA_RESULT_SUCCESS)*/
+
+    DEBUG_API("-<XAStreamInformationItfAdapt_QueryStreamInformation");
+    return ret;
+}
+
+/*
+ * XAresult XAStreamInformationItfAdapt_QueryStreamName(
+ *               XAAdaptationBaseCtx *adaptCtx,
+ *               XAuint32 streamIndex,
+ *               XAuint16 * pNameSize,
+ *               XAchar * pName)
+ * Description: Obtains stream name
+ */
+XAresult XAStreamInformationItfAdapt_QueryStreamName(
+                XAAdaptationBaseCtx *adaptCtx,
+                XAuint32 streamIndex,
+                XAuint16 * pNameSize,
+                XAchar * pName)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAuint32 numStreams;
+    GstElement *codecbin = NULL;
+
+    DEBUG_API("->XAStreamInformationItfAdapt_QueryStreamName");
+    /* Both Media Player and Metadata Extractor objec uses the same ctxId */
+    if( !adaptCtx ||
+        (adaptCtx->ctxId != XAMediaPlayerAdaptation) )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("-<XAStreamInformationItfAdapt_QueryStreamName");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* validate stream index */
+    codecbin = ((XAMediaPlayerAdaptationCtx*) adaptCtx)->codecbin;
+    if ( codecbin == NULL )
+    {
+        DEBUG_INFO("Unable to get codec bin");
+        DEBUG_ERR("XA_RESULT_INTERNAL_ERROR");
+        DEBUG_API("-<XAStreamInformationItfAdapt_QueryStreamName");
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+    numStreams = codecbin->numsrcpads;
+
+    /* validate stream index */
+    if ( streamIndex > numStreams )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("-<XAStreamInformationItfAdapt_QueryStreamName");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* TODO there is no straight way to retreive stream name from gstreamer*/
+    /*XAuint16 inputNameSize = *pNameSize;*/
+    *pNameSize = 0; /* Replace this with actual size*/
+    if ( pName )
+    {
+        /* TODO copy stream name into pName taking into account inputNameSize */
+    }
+
+    DEBUG_API("-<XAStreamInformationItfAdapt_QueryStreamName");
+    return ret;
+}
+
+/*
+ * XAresult XAStreamInformationItfAdapt_QueryActiveStreams(
+ *               XAAdaptationBaseCtx *adaptCtx,
+ *               XAuint32 *numStreams,
+ *               XAboolean *activeStreams);
+ * Description: Obtains active stream information
+ */
+ XAresult XAStreamInformationItfAdapt_QueryActiveStreams(
+                XAAdaptationBaseCtx *adaptCtx,
+                XAuint32 *numStreams,
+                XAboolean *activeStreams)
+{
+    XAuint32 inputNumStreams;
+    GstElement *codecbin;
+
+    DEBUG_API("->XAStreamInformationItfAdapt_QueryActiveStreams");
+
+    /* Both Media Player and Metadata Extractor objec uses the same ctxId */
+    if( !adaptCtx ||
+        (adaptCtx->ctxId != XAMediaPlayerAdaptation) )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("-<XAStreamInformationItfAdapt_QueryActiveStreams");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if( adaptCtx->ctxId ==  XAMDAdaptation)
+    {
+        DEBUG_ERR("XA_RESULT_PRECONDITIONS_VIOLATED");
+        DEBUG_API("-<XAStreamInformationItfAdapt_QueryActiveStreams");
+        return XA_RESULT_PRECONDITIONS_VIOLATED;
+    }
+
+    inputNumStreams = *numStreams;
+
+    /* Determine number of streams */
+    codecbin = ((XAMediaPlayerAdaptationCtx*) adaptCtx)->codecbin;
+    if ( codecbin == NULL )
+    {
+        DEBUG_INFO("Unable to get codec bin");
+        DEBUG_ERR("XA_RESULT_INTERNAL_ERROR");
+        DEBUG_API("-<XAStreamInformationItfAdapt_QueryActiveStreams");
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+    *numStreams = codecbin->numsrcpads;
+
+    if ( activeStreams )
+    {
+        XAuint32 loopIndex;
+        if (inputNumStreams < *numStreams )
+        {
+            DEBUG_INFO("numStreams param value is smaller than number of streams");
+            DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+            DEBUG_API("-<XAStreamInformationItfAdapt_QueryActiveStreams");
+            return XA_RESULT_PARAMETER_INVALID;
+        }
+        for (loopIndex = 0; loopIndex < *numStreams; loopIndex++)
+        {
+            /* TODO currently gstreamer doesn't allow multiple dynamic streams
+             * all streams are active streams */
+            activeStreams[loopIndex] = XA_BOOLEAN_TRUE;
+        }
+    }
+
+    DEBUG_API("->XAStreamInformationItfAdapt_QueryActiveStreams");
+    return XA_RESULT_SUCCESS;
+}
+
+XAresult XAStreamInformationItfAdapt_SetActiveStream(
+                XAAdaptationBaseCtx *adaptCtx,
+                XAuint32 streamNum,
+                XAboolean active,
+                XAboolean commitNow)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAuint32 numStreams;
+    GstElement *codecbin;
+
+    DEBUG_API("->XAStreamInformationItfAdapt_SetActiveStream");
+
+    /* Both Media Player and Metadata Extractor objec uses the same ctxId */
+    if( !adaptCtx ||
+        (adaptCtx->ctxId != XAMediaPlayerAdaptation) )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("-<XAStreamInformationItfAdapt_SetActiveStream");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if( adaptCtx->ctxId ==  XAMDAdaptation)
+    {
+        DEBUG_ERR("XA_RESULT_PRECONDITIONS_VIOLATED");
+        DEBUG_API("-<XAStreamInformationItfAdapt_SetActiveStream");
+        return XA_RESULT_PRECONDITIONS_VIOLATED;
+    }
+
+    /* Determine number of streams */
+    codecbin = ((XAMediaPlayerAdaptationCtx*) adaptCtx)->codecbin;
+    if ( codecbin == NULL )
+    {
+        DEBUG_INFO("Unable to get codec bin");
+        DEBUG_ERR("XA_RESULT_INTERNAL_ERROR");
+        DEBUG_API("-<XAStreamInformationItfAdapt_SetActiveStream");
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+    numStreams = codecbin->numsrcpads;
+
+    /* validate stream index */
+    if ( streamNum > numStreams )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("-<XAStreamInformationItfAdapt_SetActiveStream");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    ret = XA_RESULT_FEATURE_UNSUPPORTED;
+
+    DEBUG_API("->XAStreamInformationItfAdapt_SetActiveStream");
+    return ret;
+}
+
+/* local functions */
+
+XAresult GetDomainTypeFromCodecBinSrcPads(
+                    GList *sourcePads,
+                    XAuint32 containerType,
+                    XAuint32 streamIndex,
+                    XAuint32 *domain)
+{
+    GstPad* srcPad;
+    GstCaps* negotiatedCaps;
+    const GstStructure* gstStruct;
+    const gchar *mime;
+
+    DEBUG_API("->GetDomainTypeFromCodecBinSrcPads");
+
+
+    srcPad = (GstPad*) g_list_nth_data(sourcePads, (streamIndex -1 ));
+    if (srcPad == NULL)
+    {
+        DEBUG_INFO_A1("Error obtaining SrcPad%u", (unsigned int)streamIndex);
+        DEBUG_ERR("XA_RESULT_INTERNAL_ERROR");
+        DEBUG_API("-<GetDomainTypeFromCodecBinSrcPads");
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+    DEBUG_INFO_A1("Obtained SrcPad%u from SrcPads list", (unsigned int)(streamIndex-1));
+
+    negotiatedCaps = gst_pad_get_negotiated_caps(srcPad);
+    if ( negotiatedCaps == NULL )
+    {
+        DEBUG_INFO("Obtaining allowed caps from SrcPad.");
+        negotiatedCaps = gst_pad_get_allowed_caps (srcPad);
+    }
+
+    if ( negotiatedCaps == NULL )
+    {
+        DEBUG_INFO("Unable to obtain negotiated and allowed caps from SrcPad");
+        DEBUG_ERR("XA_RESULT_INTERNAL_ERROR");
+        DEBUG_API("-<GetDomainTypeFromCodecBinSrcPads");
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+
+    DEBUG_INFO("Obtained negotiated/allowed GstCaps from SrcPad");
+
+    gstStruct = gst_caps_get_structure (negotiatedCaps, 0);
+    if ( gstStruct == NULL )
+    {
+        gst_object_unref (negotiatedCaps);
+        DEBUG_INFO("Error getting GstStructure from GstCaps");
+        DEBUG_ERR("XA_RESULT_INTERNAL_ERROR");
+        DEBUG_API("-<GetDomainTypeFromCodecBinSrcPads");
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+    DEBUG_INFO("Obtained GstStructure from GstCaps");
+
+    mime = gst_structure_get_name (gstStruct);
+
+    DEBUG_INFO_A1("MimeType associated with SrcPad is [%s]", mime);
+
+    *domain = XA_DOMAINTYPE_UNKNOWN;
+    if (strncmp (mime, "audio", 5) == 0)
+    {
+        gchar* elementFactoryName = NULL;
+
+        *domain = XA_DOMAINTYPE_AUDIO;
+
+        /*check if it is midi or not by checking the sink pad's mime-type*/
+        /* this should done by checking the sinkpad's mime-type of parent element */
+        elementFactoryName = gst_element_get_name(gst_element_get_factory (gst_pad_get_parent_element(srcPad)));
+
+        /*printf("Element factory name [%s]\n", elementFactoryName);*/
+
+        /* decode bin has the sink pads ghosted from targetPad.
+        So retreive the name of the original decoder element*/
+        if ( strcmp(elementFactoryName, "decodebin") == 0 )
+        {
+            GstPad* targetPad = NULL;
+            gchar* decoderElementName = NULL;
+
+            DEBUG_INFO("Decodebin: Obtaining target pad of SrcPad");
+            targetPad = gst_ghost_pad_get_target ((GstGhostPad*)srcPad);
+
+            decoderElementName = gst_element_get_name (gst_element_get_factory (gst_pad_get_parent_element (targetPad)));
+            /* better solution would be to get mime-type from decoder and decide based on that */
+            /* currently we cannot retrieive sinkpad's caps. Perhaps a bug in gstreamer. We need */
+            /* to revisit this when we move to newer version of gstreamer */
+            if ( strcmp(decoderElementName, "wildmidi") == 0 )
+            {
+                *domain = XA_DOMAINTYPE_MIDI;
+            }
+            g_free(decoderElementName);
+            gst_object_unref(targetPad);
+        }
+        g_free(elementFactoryName);
+
+    }
+    else if (strncmp (mime, "video", 5) == 0)
+    {
+        switch(containerType)
+        {
+            case XA_CONTAINERTYPE_BMP:
+            case XA_CONTAINERTYPE_JPG:
+            case XA_CONTAINERTYPE_JPG2000:
+                *domain = XA_DOMAINTYPE_IMAGE;
+                break;
+            default:
+                *domain = XA_DOMAINTYPE_VIDEO;
+                break;
+        };
+    }
+    /* TODO find out why this causes assertion failure */
+    /*gst_object_unref (negotiatedCaps);*/
+
+    DEBUG_API("-<GetDomainTypeFromCodecBinSrcPads");
+
+    return XA_RESULT_SUCCESS;
+}
+
+XAresult GetAudioStreamInfoFromPads(
+                    GstPad *srcPad,
+                    XAuint32 *channels,
+                    XAuint32 *sampleRate,
+                    XAuint32 *bitRate)
+{
+    GstCaps* negotiatedCaps;
+    const GstStructure* gstStruct;
+    gint negotiated_sampleRate;
+    gint negotiated_channels;
+    gint negotiated_bitRate;
+
+    DEBUG_API("->GetAudioStreamInfoFromPads");
+
+    negotiatedCaps = gst_pad_get_negotiated_caps(srcPad);
+    if ( negotiatedCaps == NULL )
+    {
+        DEBUG_INFO("Obtaining allowed caps from SrcPad.");
+        negotiatedCaps = gst_pad_get_allowed_caps (srcPad);
+    }
+
+    if ( negotiatedCaps == NULL )
+    {
+        DEBUG_INFO("Unable to obtain negotiated and allowed caps from SrcPad");
+        DEBUG_ERR("XA_RESULT_INTERNAL_ERROR");
+        DEBUG_API("-<GetAudioStreamInfoFromPads");
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+
+    DEBUG_INFO("Obtained negotiated/allowed GstCaps from SrcPad");
+
+    gstStruct = gst_caps_get_structure (negotiatedCaps, 0);
+    if ( gstStruct == NULL )
+    {
+        gst_object_unref (negotiatedCaps);
+        DEBUG_INFO("Error getting GstStructure from GstCaps");
+        DEBUG_ERR("XA_RESULT_INTERNAL_ERROR");
+        DEBUG_API("-<GetAudioStreamInfoFromPads");
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+    DEBUG_INFO("Obtained GstStructure from GstCaps");
+
+    *channels = 0;
+    *sampleRate = 0;
+    *bitRate = 0;
+
+    gst_structure_get_int (gstStruct, "channels", &negotiated_channels);
+    gst_structure_get_int (gstStruct, "rate", &negotiated_sampleRate);
+    gst_structure_get_int (gstStruct, "bitrate", &negotiated_bitRate);
+
+    *channels = negotiated_channels;
+    *sampleRate = (XAmilliHertz) negotiated_sampleRate * 1000;
+    *bitRate = negotiated_bitRate;
+
+    DEBUG_INFO_A1("channels[%u]", (unsigned int)*channels);
+    DEBUG_INFO_A1("sampleRate[%u]", (unsigned int)*sampleRate);
+    DEBUG_INFO_A1("bitRate[%u]", (unsigned int)*bitRate);
+    /* TODO find out why this is causing assertion failure
+    gst_object_unref (negotiatedCaps);*/
+
+    DEBUG_API("-<GetAudioStreamInfoFromPads");
+
+    return XA_RESULT_SUCCESS;
+}
+
+XAresult GetVideoStreamInfoFromPads(
+                    GstPad *srcPad,
+                    XAuint32 *width,
+                    XAuint32 *height,
+                    XAuint32 *frameRate,
+                    XAuint32 *bitRate)
+{
+    GstCaps* negotiatedCaps;
+    const GstStructure* gstStruct;
+    gint negotiated_width;
+    gint negotiated_height;
+    gint negotiated_frameRate_numerator;
+    gint negotiated_frameRate_denominator;
+    gint negotiated_bitRate;
+
+    DEBUG_API("->GetVideoStreamInfoFromPads");
+
+    negotiatedCaps = gst_pad_get_negotiated_caps(srcPad);
+    if ( negotiatedCaps == NULL )
+    {
+        DEBUG_INFO("Obtaining allowed caps from SrcPad.");
+        negotiatedCaps = gst_pad_get_allowed_caps (srcPad);
+    }
+
+    if ( negotiatedCaps == NULL )
+    {
+        DEBUG_INFO("Unable to obtain negotiated and allowed caps from SrcPad");
+        DEBUG_ERR("XA_RESULT_INTERNAL_ERROR");
+        DEBUG_API("-<GetVideoStreamInfoFromPads");
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+
+    DEBUG_INFO("Obtained negotiated/allowed GstCaps from SrcPad");
+
+    gstStruct = gst_caps_get_structure (negotiatedCaps, 0);
+    if ( gstStruct == NULL )
+    {
+        gst_object_unref (negotiatedCaps);
+        DEBUG_INFO("Error getting GstStructure from GstCaps");
+        DEBUG_ERR("XA_RESULT_INTERNAL_ERROR");
+        DEBUG_API("-<GetVideoStreamInfoFromPads");
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+    DEBUG_INFO("Obtained GstStructure from GstCaps");
+
+    *width = 0;
+    *height = 0;
+    *frameRate = 0;
+    *bitRate = 0;
+
+    gst_structure_get_int (gstStruct, "width", &negotiated_width);
+    gst_structure_get_int (gstStruct, "height", &negotiated_height);
+    gst_structure_get_fraction (gstStruct, "framerate",
+                                    &negotiated_frameRate_numerator,
+                                    &negotiated_frameRate_denominator);
+    gst_structure_get_int (gstStruct, "bitrate", &negotiated_bitRate);
+
+    *width = negotiated_width;
+    *height = negotiated_height;
+    *bitRate = negotiated_bitRate;
+
+    DEBUG_INFO_A1("width[%u]", (unsigned int)*width);
+    DEBUG_INFO_A1("height[%u]", (unsigned int)*height);
+    DEBUG_INFO_A2("framerate[%u/%u]", (unsigned int)negotiated_frameRate_numerator, (unsigned int)negotiated_frameRate_denominator);
+    DEBUG_INFO_A1("bitrate[%u]", (unsigned int)*bitRate);
+    /* TODO find out why this is causing assertion failure
+    gst_object_unref (negotiatedCaps);*/
+
+    DEBUG_API("-<GetVideoStreamInfoFromPads");
+
+    return XA_RESULT_SUCCESS;
+}
+
+
+XAresult GetImageStreamInfoFromPads(
+                    GstPad *srcPad,
+                    XAuint32 *width,
+                    XAuint32 *height)
+{
+    GstCaps* negotiatedCaps;
+    const GstStructure* gstStruct;
+    gint negotiated_width;
+    gint negotiated_height;
+
+    DEBUG_API("->GetImageStreamInfoFromPads");
+
+    negotiatedCaps = gst_pad_get_negotiated_caps(srcPad);
+    if ( negotiatedCaps == NULL )
+    {
+        DEBUG_INFO("Obtaining allowed caps from SrcPad.");
+        negotiatedCaps = gst_pad_get_allowed_caps (srcPad);
+    }
+
+    if ( negotiatedCaps == NULL )
+    {
+        DEBUG_INFO("Unable to obtain negotiated and allowed caps from SrcPad");
+        DEBUG_ERR("XA_RESULT_INTERNAL_ERROR");
+        DEBUG_API("-<GetImageStreamInfoFromPads");
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+
+    DEBUG_INFO("Obtained negotiated/allowed GstCaps from SrcPad");
+
+    gstStruct = gst_caps_get_structure (negotiatedCaps, 0);
+    if ( gstStruct == NULL )
+    {
+        gst_object_unref (negotiatedCaps);
+        DEBUG_INFO("Error getting GstStructure from GstCaps");
+        DEBUG_ERR("XA_RESULT_INTERNAL_ERROR");
+        DEBUG_API("-<GetImageStreamInfoFromPads");
+        return XA_RESULT_INTERNAL_ERROR;
+    }
+    DEBUG_INFO("Obtained GstStructure from GstCaps");
+
+    *width = 0;
+    *height = 0;
+
+    gst_structure_get_int (gstStruct, "width", &negotiated_width);
+    gst_structure_get_int (gstStruct, "height", &negotiated_height);
+
+    *width = negotiated_width;
+    *height = negotiated_height;
+
+    DEBUG_INFO_A1("width[%u]", (unsigned int)*width);
+    DEBUG_INFO_A1("height[%u]", (unsigned int)*height);
+    /* TODO find out why this is causing assertion failure
+    gst_object_unref (negotiatedCaps);*/
+
+    DEBUG_API("-<GetImageStreamInfoFromPads");
+
+    return XA_RESULT_SUCCESS;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/gst_adaptation/xastreaminformationitfadaptation.h	Fri May 14 16:22:35 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 XASTREAMINFORMATIONITFADAPTATION_H
+#define XASTREAMINFORMATIONITFADAPTATION_H
+
+#include "openmaxalwrapper.h"
+#include "xaadptbasectx.h"
+/* MACROS */
+
+/* FUNCTIONS */
+XAresult XAStreamInformationItfAdapt_QueryMediaContainerInformation(
+    XAAdaptationBaseCtx *adaptCtx,
+    XAuint32 *containerType,
+    XAmillisecond *mediaDuration,
+    XAuint32 *numStreams);
+
+XAresult XAStreamInformationItfAdapt_QueryStreamType(
+                XAAdaptationBaseCtx *adaptCtx,
+                XAuint32 streamIndex, 
+                XAuint32 *domain);
+
+XAresult XAStreamInformationItfAdapt_QueryStreamInformation(
+                XAAdaptationBaseCtx *adaptCtx, 
+                XAuint32 streamIndex,
+                void * info);
+
+XAresult XAStreamInformationItfAdapt_QueryStreamName(
+                XAAdaptationBaseCtx *adaptCtx, 
+                XAuint32 streamIndex,
+                XAuint16 * pNameSize,
+                XAchar * pName);
+
+XAresult XAStreamInformationItfAdapt_QueryActiveStreams(
+                XAAdaptationBaseCtx *adaptCtx, 
+                XAuint32 *numStreams,
+                XAboolean *activeStreams);
+
+XAresult XAStreamInformationItfAdapt_SetActiveStream(
+                XAAdaptationBaseCtx *adaptCtx, 
+                XAuint32 streamNum,
+                XAboolean active, 
+                XAboolean commitNow);
+
+
+#endif /* XASTREAMINFORMATIONITFADAPTATION_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/gst_adaptation/xavibraadaptctx.c	Fri May 14 16:22:35 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 "xaadaptationgst.h"
+
+/*
+ * XAAdaptationGstCtx* 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 = (XAVibraAdaptationCtx*)calloc(1, sizeof(XAVibraAdaptationCtx));
+    DEBUG_API("->XAVibraAdapt_Create");
+    if ( pSelf)
+    {
+        if( XAAdaptationBase_Init(&(pSelf->baseObj.baseObj),XAVibraAdaptation)
+                    != XA_RESULT_SUCCESS )
+        {
+        DEBUG_ERR("Failed to init base context!!!");
+        free(pSelf);
+        pSelf = NULL;
+        }
+    }
+
+    DEBUG_API("<-XAVibraAdapt_Create");
+    return (XAAdaptationBaseCtx*)&pSelf->baseObj;
+}
+
+/*
+ * 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.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.baseObj));
+
+    free(ctx);
+    ctx = NULL;
+
+    DEBUG_API("<-XAVibraAdapt_Destroy");
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/gst_adaptation/xavibraadaptctx.h	Fri May 14 16:22:35 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 XAVIBRAADAPTCTX_H
+#define XAVIBRAADAPTCTX_H
+
+#include "xaadaptationgst.h"
+
+/* TYPEDEFS */
+
+typedef struct XAVibraAdaptationCtx_ XAVibraAdaptationCtx;
+
+/*
+ * Structure for Vibra specific gst-adaptation variables
+ */
+typedef struct XAVibraAdaptationCtx_ {
+
+    /* Parent*/
+    XAAdaptationGstCtx_ baseObj;
+
+    /* OMX-AL Variables */
+    XAuint32    deviceID;
+
+    /* GST Variables */
+} 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/gst_adaptation/xavibraitfadaptation.c	Fri May 14 16:22:35 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 "xaadaptationgst.h"
+
+/*
+ * XAresult XAVibraItfAdapt_Vibrate( XAAdaptationGstCtx *bCtx, XAboolean vibrate );
+ */
+XAresult XAVibraItfAdapt_Vibrate( XAAdaptationGstCtx *bCtx, XAboolean vibrate )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    if(vibrate)
+    {
+        DEBUG_API("->XAVibraItfAdapt_Vibrate: ON");
+    }
+    else
+        DEBUG_API("->XAVibraItfAdapt_Vibrate: OFF");
+
+
+    if(!bCtx || bCtx->baseObj.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 ( XAAdaptationGstCtx *bCtx,   XAmilliHertz frequency );
+ */
+XAresult XAVibraItfAdapt_SetFrequency ( XAAdaptationGstCtx *bCtx,  XAmilliHertz frequency )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API_A1("->XAVibraItfAdapt_SetFrequency %ld", frequency);
+
+    if(!bCtx || bCtx->baseObj.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 ( XAAdaptationGstCtx *bCtx,   XApermille intensity );
+ */
+XAresult XAVibraItfAdapt_SetIntensity ( XAAdaptationGstCtx *bCtx,  XApermille intensity )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API_A1("->XAVibraItfAdapt_SetIntensity %d", intensity);
+
+    if(!bCtx || bCtx->baseObj.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/gst_adaptation/xavibraitfadaptation.h	Fri May 14 16:22:35 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 XAVibraItfADAPTATION_H_
+#define XAVibraItfADAPTATION_H_
+
+#include "xaadaptationgst.h"
+
+/* FUNCTIONS */
+XAresult XAVibraItfAdapt_Vibrate( XAAdaptationGstCtx *bCtx, XAboolean vibrate );
+XAresult XAVibraItfAdapt_SetFrequency ( XAAdaptationGstCtx *bCtx,  XAmilliHertz frequency );
+XAresult XAVibraItfAdapt_SetIntensity ( XAAdaptationGstCtx *bCtx,  XApermille intensity );
+#endif /* XAVIBRAITFADAPTATION_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/gst_adaptation/xavideoencoderitfadaptation.c	Fri May 14 16:22:35 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 "xaadaptationgst.h"
+
+
+/*
+ * XAresult XAVideoEncoderITfAdapt_SetVideoSettings( XAAdaptationGstCtx *bCtx,
+ *                                                   XAVideoSettings *pSettings )
+ * @param XAAdaptationGstCtx *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( XAAdaptationGstCtx *bCtx,
+                                                  XAVideoSettings *pSettings )
+{
+    XAMediaRecorderAdaptationCtx* mCtx = NULL;
+    XAresult ret = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XAVideoEncoderAdapt_SetVideoSettings");
+    if( !bCtx || (bCtx->baseObj.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( XAAdaptationGstCtx *bCtx, XAVideoSettings *pSettings )
+ */
+XAresult XAVideoEncoderItfAdapt_GetVideoSettings( XAAdaptationGstCtx *bCtx,
+                                                  XAVideoSettings *pSettings )
+{
+    XAMediaRecorderAdaptationCtx* mCtx = NULL;
+    XAresult ret = XA_RESULT_SUCCESS;
+
+    DEBUG_API("->XAVideoEncoderItfAdapt_GetVideoSettings");
+
+    if( !bCtx || (bCtx->baseObj.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/gst_adaptation/xavideoencoderitfadaptation.h	Fri May 14 16:22:35 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 "xaadaptationgst.h"
+
+
+/* FUNCTIONS */
+XAresult XAVideoEncoderItfAdapt_SetVideoSettings(XAAdaptationGstCtx *bCtx,
+                                                 XAVideoSettings *pSettings  );
+XAresult XAVideoEncoderItfAdapt_GetVideoSettings( XAAdaptationGstCtx *bCtx,
+                                                  XAVideoSettings *pSettings );
+#endif /* XAVIDEOENCODERITFADAPTATION_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/gst_adaptation/xavideopostprosessingitfadaptation.c	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,863 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "xaadaptationgst.h"
+#include "xamediaplayeradaptctx.h"
+#include "xamediarecorderadaptctx.h"
+#include "xacameraadaptctx.h"
+#include "xavideopostprosessingitfadaptation.h"
+#include "xastaticcameracapsadaptation.h"
+
+/*
+ * XAresult XAVideoPostProcessingItfAdapt_IsArbitraryRotationSupported(XAAdaptationGstCtx *bCtx,
+ *                                                                     XAboolean *pSupported)
+ */
+XAresult XAVideoPostProcessingItfAdapt_IsArbitraryRotationSupported(XAAdaptationGstCtx *bCtx,
+                                                                    XAboolean *pSupported)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAVideoPostProcessingItfAdapt_IsArbitraryRotationSupported");
+
+    if(!bCtx || (bCtx->baseObj.ctxId != XAMediaPlayerAdaptation && bCtx->baseObj.ctxId != XAMediaRecorderAdaptation
+            && bCtx->baseObj.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(XAAdaptationGstCtx *bCtx)
+ */
+XAresult XAVideoPostProcessingItfAdapt_Commit(XAAdaptationGstCtx *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;
+*/
+    gint            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->baseObj.ctxId != XAMediaPlayerAdaptation && bCtx->baseObj.ctxId != XAMediaRecorderAdaptation
+        && bCtx->baseObj.ctxId != XACameraAdaptation))
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVideoPostProcessingItfAdapt_Commit");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if( bCtx->baseObj.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->baseObj.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->baseObj.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->baseObj.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->baseObj.ctxId == XAMediaPlayerAdaptation )
+        {
+            XAMediaPlayerAdaptationCtx* ctx = (XAMediaPlayerAdaptationCtx*) bCtx;
+            ctx->curRotation = newRotation;
+        }
+        if( bCtx->baseObj.ctxId == XAMediaRecorderAdaptation )
+        {
+            XAMediaRecorderAdaptationCtx* ctx = (XAMediaRecorderAdaptationCtx*) bCtx;
+            ctx->curRotation = newRotation;
+        }
+        if( bCtx->baseObj.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->baseObj.ctxId == XAMediaPlayerAdaptation )
+        {
+            XAMediaPlayerAdaptationCtx* ctx = (XAMediaPlayerAdaptationCtx*) bCtx;
+            ctx->curMirror = newMirror;
+        }
+        if( bCtx->baseObj.ctxId == XAMediaRecorderAdaptation )
+        {
+            XAMediaRecorderAdaptationCtx* ctx = (XAMediaRecorderAdaptationCtx*) bCtx;
+            ctx->curMirror = newMirror;
+        }
+        if( bCtx->baseObj.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->baseObj.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->baseObj.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;
+		}
+    }
+
+    
+    /*TODO The Code below does nothing. just set the variable which are never used.
+     * commenting the code below. */
+/*    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);
+            
+            if(gstRet == GST_STATE_CHANGE_SUCCESS && gstTmpState == GST_STATE_READY)
+            {
+            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;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/gst_adaptation/xavideopostprosessingitfadaptation.h	Fri May 14 16:22:35 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 XAVIDEOPOSTPROSESSINGITFADAPTATION_H
+#define XAVIDEOPOSTPROSESSINGITFADAPTATION_H
+
+#include "xaadaptationgst.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(XAAdaptationGstCtx *bCtx,
+                                                                    XAboolean *pSupported);
+
+XAresult XAVideoPostProcessingItfAdapt_Commit(XAAdaptationGstCtx *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
+                                              );
+
+#endif /* XAVIDEOPOSTPROSESSINGITFADAPTATION_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/gst_adaptation/xavolumeitfadaptation.c	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,502 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "xaadaptationgst.h"
+#include "xavolumeitfadaptation.h"
+#include "xamediaplayeradaptctx.h"
+
+#include "xaoutputmixadaptctx.h"
+#include "xamediarecorderadaptctx.h"
+
+/*
+ * XAresult XAVolumeItfAdapt_FlushBin(XAAdaptationGstCtx *ctx)
+ */
+XAresult XAVolumeItfAdapt_FlushBin(XAAdaptationGstCtx *ctx)
+{
+    DEBUG_API("->XAVolumeItfAdapt_FlushBin");
+    if(!ctx || ( ctx->baseObj.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;
+
+        if (! gst_element_query_position( GST_ELEMENT(ctx->bin), &format, &position  ))
+            {
+                DEBUG_ERR("Gst: Failed to get position");
+				return XA_RESULT_INTERNAL_ERROR;
+            }
+        XAAdaptationGst_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,
+                            (GstSeekFlags)(GST_SEEK_FLAG_FLUSH|GST_SEEK_FLAG_ACCURATE),
+                            GST_SEEK_TYPE_SET, position,
+                            GST_SEEK_TYPE_NONE, (gint64)GST_CLOCK_TIME_NONE))
+        {
+            DEBUG_ERR("WARN: gst reports seek not handled");
+        }
+        /* flushed seeks always asynchronous */
+        XAAdaptationGst_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->baseObj.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(XAAdaptationGstCtx *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->baseObj.ctxId != XAMediaPlayerAdaptation &&
+                 ctx->baseObj.ctxId != XAMediaRecorderAdaptation &&
+                 ctx->baseObj.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->baseObj.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->baseObj.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->baseObj.ctxId == XAOutputMixAdaptation )
+    {
+        XAOutputMixAdaptationCtx* context = (XAOutputMixAdaptationCtx*) ctx;
+        guint iterator = 0;
+        for ( iterator = 0; iterator < context->connectedObjects->len; iterator++ )
+        {
+            GstBin* basebin = NULL;
+            XAAdaptationGstCtx* 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->baseObj.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->baseObj.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(XAAdaptationGstCtx *ctx, XAmillibel *pMaxLevel)
+{
+    DEBUG_API("->XAVolumeItfAdapt_GetMaxVolumeLevel");
+
+    if(!ctx || ( ctx->baseObj.ctxId != XAMediaPlayerAdaptation &&
+                 ctx->baseObj.ctxId != XAMediaRecorderAdaptation &&
+                 ctx->baseObj.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->baseObj.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->baseObj.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(XAAdaptationGstCtx *ctx, XAboolean mute)
+{
+    GstElement *vol=NULL, *audiopp=NULL;
+    gboolean gmute = 0;
+
+    DEBUG_API("->XAVolumeItfAdapt_SetMute");
+    if(!ctx || ( ctx->baseObj.ctxId != XAMediaPlayerAdaptation &&
+                 ctx->baseObj.ctxId != XAMediaRecorderAdaptation &&
+                 ctx->baseObj.ctxId != XAOutputMixAdaptation ) )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVolumeItfAdapt_SetMute");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if ( ctx->baseObj.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->baseObj.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->baseObj.ctxId == XAOutputMixAdaptation )
+    {
+        XAOutputMixAdaptationCtx* context = (XAOutputMixAdaptationCtx*) ctx;
+        guint iterator = 0;
+        context->mute = mute;
+        for ( iterator = 0; iterator < context->connectedObjects->len; iterator++ )
+        {
+            GstBin* basebin = NULL;
+            XAAdaptationGstCtx* 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(XAAdaptationGstCtx *ctx, XAboolean enable)
+ * @param XAAdaptationGstCtx *ctx - Adaptation context
+ * @param XAboolean enable - Enable Stereo Position
+ * @return XAresult - Success value
+ */
+XAresult XAVolumeItfAdapt_EnableStereoPosition(XAAdaptationGstCtx *ctx, XAboolean enable)
+{
+    DEBUG_API("->XAVolumeItfAdapt_EnableStereoPosition");
+
+    if(!ctx || ( ctx->baseObj.ctxId != XAMediaPlayerAdaptation &&
+                 ctx->baseObj.ctxId != XAMediaRecorderAdaptation &&
+                 ctx->baseObj.ctxId != XAOutputMixAdaptation ) )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAVolumeItfAdapt_EnableStereoPosition");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if ( ctx->baseObj.ctxId == XAMediaPlayerAdaptation  )
+    {
+        XAMediaPlayerAdaptationCtx* context = (XAMediaPlayerAdaptationCtx*) ctx;
+        context->isStereoPosition = enable;
+    }
+    else if ( ctx->baseObj.ctxId == XAMediaRecorderAdaptation  )
+    {
+        XAMediaRecorderAdaptationCtx* context = (XAMediaRecorderAdaptationCtx*) ctx;
+        context->isStereoPosition = enable;
+    }
+    else if ( ctx->baseObj.ctxId == XAOutputMixAdaptation  )
+    {
+        XAOutputMixAdaptationCtx* context = (XAOutputMixAdaptationCtx*) ctx;
+        context->isStereoPosition = enable;
+    }
+
+    DEBUG_API("<-XAVolumeItfAdapt_EnableStereoPosition");
+    return XA_RESULT_SUCCESS;
+}
+
+/*
+ * XAresult XAVolumeItfAdapt_SetStereoPosition(XAAdaptationGstCtx *ctx, XApermille stereoPosition)
+ * @param XAAdaptationGstCtx *ctx - Adaptation context
+ * @param XApermille stereoPosition - Stereo Position to be set
+ * @return XAresult - Success value
+ */
+XAresult XAVolumeItfAdapt_SetStereoPosition(XAAdaptationGstCtx *ctx,
+                                            XApermille stereoPosition)
+{
+    GstElement *audiopp = NULL, *pan = NULL;
+    gfloat gstPosition = 0.0;
+
+    DEBUG_API("->XAVolumeItfAdapt_SetStereoPosition");
+    if(!ctx || ( ctx->baseObj.ctxId != XAMediaPlayerAdaptation &&
+                 ctx->baseObj.ctxId != XAMediaRecorderAdaptation &&
+                 ctx->baseObj.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->baseObj.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->baseObj.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->baseObj.ctxId == XAOutputMixAdaptation )
+    {
+        XAOutputMixAdaptationCtx* context = (XAOutputMixAdaptationCtx*) ctx;
+        guint iterator = 0;
+        for ( iterator = 0; iterator < context->connectedObjects->len; iterator++ )
+        {
+            GstBin* basebin = NULL;
+            XAAdaptationGstCtx* 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;
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/gst_adaptation/xavolumeitfadaptation.h	Fri May 14 16:22:35 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 XAVOLUMEITFADAPTATION_H
+#define XAVOLUMEITFADAPTATION_H
+
+#include "xaadaptationgst.h"
+#include "xathreadsafety.h"
+
+/* MACROS */
+#define STEREO_POSITION_RATIO    1000
+#define MIN_SUPPORT_VOLUME_LEVEL -1000
+#define VOLUME_LEVEL_RATIO       1000
+
+/* FUNCTIONS */
+
+XAresult XAVolumeItfAdapt_SetVolumeLevel(XAAdaptationGstCtx *ctx,
+                                         XAmillibel level);
+
+XAresult XAVolumeItfAdapt_GetMaxVolumeLevel(XAAdaptationGstCtx *ctx,
+                                            XAmillibel *pMaxLevel);
+
+XAresult XAVolumeItfAdapt_SetMute(XAAdaptationGstCtx *ctx,  XAboolean mute);
+
+XAresult XAVolumeItfAdapt_EnableStereoPosition(XAAdaptationGstCtx *ctx,
+                                               XAboolean enable);
+
+XAresult XAVolumeItfAdapt_SetStereoPosition(XAAdaptationGstCtx *ctx,
+                                            XApermille stereoPosition);
+
+#endif /* XAVOLUMEITFADAPTATION_H */
--- a/khronosfws/openmax_al/src/ledarray/xaledarraydevice.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/ledarray/xaledarraydevice.c	Fri May 14 16:22:35 2010 +0300
@@ -23,7 +23,7 @@
 #include "xaconfigextensionsitf.h"
 #include "xadynintmgmtitf.h"
 #include "xathreadsafety.h"
-
+#include "xaledarrayadaptctx.h"
 
 /* Static mapping of enumeration XALEDArrayDeviceInterfaces to interface iids */
 static const XAInterfaceID* XALEDArrayDeviceItfIIDs[LEDARRAY_ITFCOUNT]=
@@ -42,7 +42,8 @@
 /* XAResult XALEDArrayDeviceImpl_Create
  * Description: Create object
  */
-XAresult XALEDArrayDeviceImpl_CreateLEDArrayDevice(XAObjectItf* pDevice,
+XAresult XALEDArrayDeviceImpl_CreateLEDArrayDevice(FrameworkMap* mapper,
+                                                   XAObjectItf* pDevice,
                                                    XAuint32 deviceID,
                                                    XAuint32 numInterfaces,
                                                    const XAInterfaceID * pInterfaceIds,
@@ -127,11 +128,6 @@
         }
     }
 
-    /* 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*/
     /*************************************************/
@@ -140,15 +136,17 @@
     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 */
-/*
+/*    // Initialize XALEDArrayDeviceImpl variables 
+    pImpl->deviceID = deviceID;
+    pImpl->adaptationCtx = XALEDArrayAdapt_Create(pImpl->deviceID);
+    
+    // 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;
-*/
+    return XA_RESULT_SUCCESS;*/
 }
 
 /* XAResult XALEDArrayDeviceImpl_QueryNumSupportedInterfaces
@@ -159,9 +157,9 @@
     DEBUG_API("->XALEDArrayDeviceImpl_QueryNumSupportedInterfaces");
     if( pNumSupportedInterfaces )
     {
-#ifdef _GSTREAMER_BACKEND_  
+  
         *pNumSupportedInterfaces = LEDARRAY_ITFCOUNT;
-#endif
+
         DEBUG_API_A1("<-XALEDArrayDeviceImpl_QueryNumSupportedInterfaces - %ld", *pNumSupportedInterfaces );
         return XA_RESULT_SUCCESS;
     }
@@ -180,7 +178,7 @@
 {
     DEBUG_API("->XALEDArrayDeviceImpl_QuerySupportedInterfaces");
 
-#ifdef _GSTREAMER_BACKEND_  
+  
     if( index >= LEDARRAY_ITFCOUNT || !pInterfaceId )
     {
         DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
@@ -190,12 +188,12 @@
     else
     {
         *pInterfaceId = *(XALEDArrayDeviceItfIIDs[index]);
-#endif
+
         DEBUG_API("<-XALEDArrayDeviceImpl_QuerySupportedInterfaces");
         return XA_RESULT_SUCCESS;
-#ifdef _GSTREAMER_BACKEND_  
+  
     }
-#endif    
+    
 }
 
 
@@ -210,7 +208,7 @@
  */
 XAresult XALEDArrayDeviceImpl_DoRealize( XAObjectItf self )
 {
-#ifdef _GSTREAMER_BACKEND_
+
     XAObjectItfImpl* pObj = (XAObjectItfImpl*)(*self);
     XAuint8 itfIdx = 0;
     XALEDArrayDeviceImpl* pObjImpl = (XALEDArrayDeviceImpl*)(pObj);
@@ -229,7 +227,7 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-    ret = XALEDArrayAdapt_PostInit( pObjImpl->adaptationCtx );
+    ret = XALEDArrayAdapt_PostInit( (XAAdaptationGstCtx*)pObjImpl->adaptationCtx );
     if( ret != XA_RESULT_SUCCESS )
     {
         XA_IMPL_THREAD_SAFETY_EXIT(XATSLEDArray);
@@ -276,7 +274,7 @@
 
     pObj->state = XA_OBJECT_STATE_REALIZED;
     XA_IMPL_THREAD_SAFETY_EXIT(XATSLEDArray);
-#endif    
+    
     DEBUG_API("<-XALEDArrayDeviceImpl_DoRealize");
     return XA_RESULT_SUCCESS;
 }
@@ -297,7 +295,7 @@
  */
 void XALEDArrayDeviceImpl_FreeResources(XAObjectItf self)
 {
-#ifdef _GSTREAMER_BACKEND_  
+  
     XAObjectItfImpl* pObj = (XAObjectItfImpl*)(*self);
     XALEDArrayDeviceImpl* pImpl = (XALEDArrayDeviceImpl*)(*self);
     XAuint8 itfIdx = 0;
@@ -307,7 +305,7 @@
 
     if ( pImpl->adaptationCtx != NULL )
     {
-        XALEDArrayAdapt_Destroy( pImpl->adaptationCtx );
+        XALEDArrayAdapt_Destroy( (XAAdaptationGstCtx*)pImpl->adaptationCtx );
         pImpl->adaptationCtx = NULL;
     }
 
@@ -338,13 +336,13 @@
 
     if ( pImpl->adaptationCtx != NULL )
     {
-        XALEDArrayAdapt_Destroy( pImpl->adaptationCtx );
+        XALEDArrayAdapt_Destroy( (XAAdaptationGstCtx*)pImpl->adaptationCtx );
         pImpl->adaptationCtx = NULL;
     }
 
     XA_IMPL_THREAD_SAFETY_EXIT_FOR_VOID_FUNCTIONS(XATSLEDArray);
     DEBUG_API("<-XALEDArrayDeviceImpl_FreeResources");
-#endif    
+    
     return;
 }
 /* END OF FILE */
--- a/khronosfws/openmax_al/src/ledarray/xaledarraydevice.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/ledarray/xaledarraydevice.h	Fri May 14 16:22:35 2010 +0300
@@ -21,9 +21,8 @@
 #include "openmaxalwrapper.h"
 #include "xaobjectitf.h"
 #include "xaglobals.h"
-#ifdef _GSTREAMER_BACKEND_  
-#include "../adaptation/XALEDArrayAdaptCtx.h"
-#endif
+
+#include "xaadptbasectx.h"
 /** MACROS **/
 
 
@@ -51,9 +50,8 @@
     /* variables */
     XAuint32 deviceID;
 
-#ifdef _GSTREAMER_BACKEND_
     XAAdaptationBaseCtx* adaptationCtx;
-#endif
+
 } XALEDArrayDeviceImpl;
 
 
--- a/khronosfws/openmax_al/src/ledarray/xaledarrayitf.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/ledarray/xaledarrayitf.c	Fri May 14 16:22:35 2010 +0300
@@ -19,9 +19,9 @@
 #include <stdlib.h>
 #include <assert.h>
 #include "xaledarrayitf.h"
-#ifdef _GSTREAMER_BACKEND_  
-#include "XALEDArrayItfAdaptation.h"
-#endif
+  
+#include "xaledarrayitfadaptation.h"
+
 #include "xathreadsafety.h"
 
 /* XALEDArrayItfImpl* GetImpl(XALEDArrayItf self)
@@ -69,9 +69,9 @@
     /* check is ligtMask mode changed */
     if( impl->lightMask != lightMask )
     {
-#ifdef _GSTREAMER_BACKEND_  
-        ret = XALEDArrayItfAdapt_ActivateLEDArray( impl->adapCtx, lightMask );
-#endif
+  
+        ret = XALEDArrayItfAdapt_ActivateLEDArray( (XAAdaptationGstCtx*)impl->adapCtx, lightMask );
+
         if ( ret == XA_RESULT_SUCCESS )
         {
             impl->lightMask = lightMask;
@@ -152,9 +152,9 @@
     }
     else
     {
-#ifdef _GSTREAMER_BACKEND_  
-        ret = XALEDArrayItfAdapt_SetColor( impl->adapCtx, index, pColor);
-#endif
+  
+        ret = XALEDArrayItfAdapt_SetColor( (XAAdaptationGstCtx*)impl->adapCtx, index, pColor);
+
         if ( ret == XA_RESULT_SUCCESS )
         {
             impl->color = *pColor;
@@ -208,7 +208,7 @@
 /*****************************************************************************
  * XALEDArrayItfImpl -specific methods
  *****************************************************************************/
-#ifdef _GSTREAMER_BACKEND_  
+  
 
 /* XALEDArrayItfImpl* XALEDArrayItfImpl_Create()
  * Description: Allocate and initialize LEDArrayItfImpl
@@ -239,7 +239,7 @@
     DEBUG_API("<-XALEDArrayItfImpl_Create");
     return self;
 }
-#endif
+
 /* void XALEDArrayItfImpl_Free(XALEDArrayItfImpl* self)
  * Description: Free all resources reserved at XALEDArrayItfImpl_Create
  */
--- a/khronosfws/openmax_al/src/ledarray/xaledarrayitf.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/ledarray/xaledarrayitf.h	Fri May 14 16:22:35 2010 +0300
@@ -18,11 +18,8 @@
 #ifndef XALEDARRAYITF_H
 #define XALEDARRAYITF_H
 
-#include "openmaxalwrapper.h"
-#include "xaglobals.h"
-#ifdef _GSTREAMER_BACKEND_  
-#include "XAAdaptationContextBase.h"
-#endif
+#include "xaadptbasectx.h"
+
 /** MACROS **/
 #define LED_COUNT 1
 #define PRIMARY_LED 0
@@ -45,10 +42,10 @@
     XAuint32    lightMask;
     XAHSL       color;
 
-#ifdef _GSTREAMER_BACKEND_  
+ 
     /*Adaptation variables*/
     XAAdaptationBaseCtx *adapCtx;
-#endif
+
 } XALEDArrayItfImpl;
 
 /** METHODS **/
@@ -61,9 +58,9 @@
 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 */
--- a/khronosfws/openmax_al/src/mediaplayer/xamediaplayer.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/mediaplayer/xamediaplayer.c	Fri May 14 16:22:35 2010 +0300
@@ -34,11 +34,12 @@
 #include "xavideopostprocessingitf.h"
 #include "xaconfigextensionsitf.h"
 #include "xathreadsafety.h"
-#ifdef _GSTREAMER_BACKEND_  
-#include "XAMetadataAdaptation.h"
-#endif
+#include "xametadataadaptation.h"
+#include "xacapabilitiesmgr.h"
 #include "xadynamicsourceitf.h"
-
+#include "xastreaminformationitf.h"
+#include "xanlinearvolumeitf.h"
+#include "xanvolumeextitf.h"
 
 extern void* vfHandle;
 
@@ -59,7 +60,10 @@
     &XA_IID_METADATAEXTRACTION,
     &XA_IID_METADATATRAVERSAL,
     &XA_IID_PLAYBACKRATE,
-    &XA_IID_VIDEOPOSTPROCESSING
+    &XA_IID_VIDEOPOSTPROCESSING,
+    &XA_IID_NOKIAVOLUMEEXT,
+    &XA_IID_NOKIALINEARVOLUME,
+    &XA_IID_STREAMINFORMATION
 };
 
 /* Global methods */
@@ -67,7 +71,9 @@
 /* XAResult XAMediaPlayerImpl_CreateMediaPlayer
  * Create object
  */
-XAresult XAMediaPlayerImpl_CreateMediaPlayer(XAObjectItf *pPlayer,
+XAresult XAMediaPlayerImpl_CreateMediaPlayer(FrameworkMap* mapper,
+                                            XACapabilities* capabilities,   
+                                             XAObjectItf *pPlayer,
                                              XADataSource *pDataSrc,
                                              XADataSource *pBankSrc,
                                              XADataSink *pAudioSnk,
@@ -81,11 +87,13 @@
     XAuint8 itfIdx = 0;
     XAMediaType mediaType = XA_MEDIATYPE_UNKNOWN;
     XAMediaPlayerImpl* pPlayerImpl = NULL;
+    FWMgrFwType fwType;
     XAObjectItfImpl* pBaseObj = NULL;
+    const char *uri = NULL;
     XAresult ret = XA_RESULT_SUCCESS;
-    XADataLocator_URI* tmpUri;
+    
+    DEBUG_API("->XAMediaPlayerImpl_CreateMediaPlayer");
 
-    DEBUG_API("->XAMediaPlayerImpl_CreateMediaPlayer");
     XA_IMPL_THREAD_SAFETY_ENTRY(XATSMediaPlayer);
 
     if(!pPlayer || !pDataSrc)
@@ -199,11 +207,11 @@
     pBaseObj->interfaceMap[MP_METADATATRAVERSALITF].isDynamic = XA_BOOLEAN_TRUE;
     pBaseObj->interfaceMap[MP_PLAYBACKRATEITF].isDynamic = XA_BOOLEAN_TRUE;
 
-
-    /* Set ObjectItf to point to newly created object */
+    
+    /*Set ObjectItf to point to newly created object*/ 
     *pPlayer = (XAObjectItf)&(pBaseObj->self);
 
-    /* initialize XAPlayerImpl variables */
+    /*initialize XAPlayerImpl variables */
 
     pPlayerImpl->dataSrc = pDataSrc;
     pPlayerImpl->bankSrc = pBankSrc;
@@ -211,43 +219,61 @@
     pPlayerImpl->imageVideoSnk = pImageVideoSnk;
     pPlayerImpl->vibra = pVibra;
     pPlayerImpl->LEDArray = pLEDArray;
-    
-    tmpUri = (XADataLocator_URI*)(pPlayerImpl->dataSrc->pLocator);
-    XAMediaPlayerImpl_DeterminePlaybackEngine(*pPlayer, tmpUri);
+
+    /* Determine framework type that can handle recording */
+    fwType = (FWMgrFwType)FWMgrMOUnknown;
+    /**/
+    if (pDataSrc->pLocator)
+    {
+        XADataLocator_URI* dataLoc = (XADataLocator_URI*)pDataSrc->pLocator;
+        if (dataLoc->locatorType == XA_DATALOCATOR_URI)
+            {
+            uri = (char*)dataLoc->URI;
+            }
+    }
+    fwType = XAFrameworkMgr_GetFramework(
+                        mapper,
+                        uri,
+                        FWMgrMOPlayer);
+
+    if (fwType == FWMgrMOUnknown)
+        {
+        ret = XA_RESULT_CONTENT_UNSUPPORTED;
+        XAObjectItfImpl_Destroy((XAObjectItf)&(pBaseObj));
+        XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
+        DEBUG_API("<-XAMediaPlayerImpl_CreateMediaPlayer");
+        return ret;
+        }
     
-    /* 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)
-    {
+    if(fwType == FWMgrFWMMF)
+    {    
         pPlayerImpl->adaptationCtxMMF = XAMediaPlayerAdaptMMF_Create(pPlayerImpl->dataSrc,
                                                                pPlayerImpl->bankSrc,
                                                                pPlayerImpl->audioSnk,
                                                                pPlayerImpl->imageVideoSnk,
                                                                pPlayerImpl->vibra,
                                                                pPlayerImpl->LEDArray);
-    
+        
+        pPlayerImpl->curAdaptCtx = pPlayerImpl->adaptationCtxMMF;    
     }
     else
     {
-#ifdef _GSTREAMER_BACKEND_  
-       pPlayerImpl->adaptationCtx = XAMediaPlayerAdapt_Create(pPlayerImpl->dataSrc,
+       pPlayerImpl->adaptationCtxGst = XAMediaPlayerAdapt_Create(pPlayerImpl->dataSrc,
                                                            pPlayerImpl->bankSrc,
                                                            pPlayerImpl->audioSnk,
                                                            pPlayerImpl->imageVideoSnk,
                                                            pPlayerImpl->vibra,
                                                            pPlayerImpl->LEDArray);
-#endif
+       
+       pPlayerImpl->curAdaptCtx = pPlayerImpl->adaptationCtxGst;
     }
+    
+    pPlayerImpl->curAdaptCtx->capslist = capabilities;
+    pPlayerImpl->curAdaptCtx->fwtype = fwType;
+    
     XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
     DEBUG_API("<-XAMediaPlayerImpl_CreateMediaPlayer");
-    return XA_RESULT_SUCCESS;*/
+    return XA_RESULT_SUCCESS;
 }
 
 /* XAResult XAMediaPlayerImpl_QueryNumSupportedInterfaces
@@ -282,9 +308,9 @@
     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;
@@ -307,7 +333,6 @@
     XAuint8 itfIdx = 0;
     void *pItf = NULL;
     XAresult ret = XA_RESULT_SUCCESS;
-    XADataLocator_URI* tmpUri;
 
     DEBUG_API("->XAMediaPlayerImpl_DoRealize");
     XA_IMPL_THREAD_SAFETY_ENTRY( XATSMediaPlayer );
@@ -340,11 +365,7 @@
                     }
                     break;
                 case MP_PLAYITF:
-                    pItf = XAPlayItfImpl_Create(
-#ifdef _GSTREAMER_BACKEND_
-                            pImpl->adaptationCtx,
-#endif
-                            pImpl->adaptationCtxMMF);
+                    pItf = XAPlayItfImpl_Create(pImpl);
                     if ( pImpl->dataSrc )
                     {
                 		XAuint32 locType = *((XAuint32*)(pImpl->dataSrc->pLocator));
@@ -357,11 +378,6 @@
                 				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
                 		    {
                 		
@@ -369,44 +385,51 @@
                     }
                     break;
                 case MP_VOLUMEITF:
-#ifdef _GSTREAMER_BACKEND_  
-                    pItf = XAVolumeItfImpl_Create(pImpl->adaptationCtx);
+                    pItf = XAVolumeItfImpl_Create(pImpl->curAdaptCtx);
                     break;
                 case MP_SEEKITF:
-                    pItf = XASeekItfImpl_Create(pImpl->adaptationCtx);
+                    pItf = XASeekItfImpl_Create(pImpl);
                     break;
                 case MP_PREFETCHSTATUSITF:
-                    pItf = XAPrefetchStatusItfImpl_Create( pImpl->adaptationCtx );
+                    pItf = XAPrefetchStatusItfImpl_Create( pImpl );
                     break;
                 case MP_METADATAEXTRACTIONITF:
-                    pItf = XAMetadataExtractionItfImpl_Create( pImpl->adaptationCtx );
+                    pItf = XAMetadataExtractionItfImpl_Create( pImpl->curAdaptCtx );
                     break;
                 case MP_METADATATRAVERSALITF:
-                    pItf = XAMetadataTraversalItfImpl_Create( pImpl->adaptationCtx );
+                    pItf = XAMetadataTraversalItfImpl_Create( pImpl->curAdaptCtx );
                     break;
                 case MP_PLAYBACKRATEITF:
-                    pItf = XAPlaybackRateItfImpl_Create(pImpl->adaptationCtx);
+                    pItf = XAPlaybackRateItfImpl_Create(pImpl);
                     break;
                 case MP_CONFIGEXTENSIONITF:
                     pItf = XAConfigExtensionsItfImpl_Create();
-                    XAConfigExtensionsItfImpl_SetContext( pItf, pImpl->adaptationCtx);
+                    XAConfigExtensionsItfImpl_SetContext( pItf, pImpl->curAdaptCtx);
                     break;
                 case MP_DYNAMICSOURCEITF:
-                    pItf = XADynamicSourceItfImpl_Create(pImpl->adaptationCtx);
+                    pItf = XADynamicSourceItfImpl_Create(pImpl->curAdaptCtx);
                     break;
                 case MP_EQUALIZERITF:
-                    pItf = XAEqualizerItfImpl_Create(pImpl->adaptationCtx);
+                    pItf = XAEqualizerItfImpl_Create(pImpl->curAdaptCtx);
                     break;
                 case MP_IMAGECONTROLSITF:
-                    pItf = XAImageControlsItfImpl_Create(pImpl->adaptationCtx);
+                    pItf = XAImageControlsItfImpl_Create(pImpl->curAdaptCtx);
                     break;
                 case MP_IMAGEEFFECTSITF:
-                    pItf = XAImageEffectsItfImpl_Create(pImpl->adaptationCtx);
+                    pItf = XAImageEffectsItfImpl_Create(pImpl->curAdaptCtx);
                     break;
                 case MP_VIDEOPOSTPROCESSINGITF:
-                    pItf = XAVideoPostProcessingItfImpl_Create(pImpl->adaptationCtx);
-#endif
+                    pItf = XAVideoPostProcessingItfImpl_Create(pImpl->curAdaptCtx);
+                    break;
+               case MP_NOKIAVOLUMEEXT:
+                    pItf = XANokiaVolumeExtItfImpl_Create(pImpl->curAdaptCtx);
                     break;
+               case MP_NOKIALINEARVOLUME:
+                    pItf = XANokiaLinearVolumeItfImpl_Create(pImpl->curAdaptCtx);
+                    break;                                        
+                case MP_STREAMINFORMATIONITF:
+                    pItf = XAStreamInformationItfImpl_Create(pImpl->curAdaptCtx);
+                    break;                    
                 default:
                     break;
             }
@@ -425,15 +448,13 @@
         }
     }
     /* init adaptation */
-    if(pImpl->isMMFPlayback)
+    if(pImpl->curAdaptCtx->fwtype == FWMgrFWMMF)
     {
-       ret = XAMediaPlayerAdaptMMF_PostInit( pImpl->adaptationCtxMMF );
+       ret = XAMediaPlayerAdaptMMF_PostInit( (XAAdaptationMMFCtx*)pImpl->adaptationCtxMMF );
     }
     else
     {
-#ifdef _GSTREAMER_BACKEND_
-       ret = XAMediaPlayerAdapt_PostInit( pImpl->adaptationCtx );
-#endif
+       ret = XAMediaPlayerAdapt_PostInit( (XAAdaptationGstCtx*)pImpl->adaptationCtxGst );
     }
     if ( ret != XA_RESULT_SUCCESS )
     {
@@ -469,16 +490,11 @@
 {
     XAObjectItfImpl* pObj = (XAObjectItfImpl*)(*self);
     XAuint8 itfIdx = 0;
-
+    XAMediaPlayerImpl* pImpl = (XAMediaPlayerImpl*)pObj;
     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;
@@ -528,17 +544,33 @@
                 case MP_VIDEOPOSTPROCESSINGITF:
                     XAVideoPostProcessingItfImpl_Free(pItf);
                     break;
+                case MP_NOKIAVOLUMEEXT:
+                    XANokiaVolumeExtItfImpl_Free(pItf);
+                    break;
+                case MP_NOKIALINEARVOLUME:
+                    XANokiaLinearVolumeItfImpl_Free(pItf);
+                    break;                                        
+                case MP_STREAMINFORMATIONITF:
+                    XAStreamInformationItfImpl_Free(pItf);
+                    break;
+                    
             }
             pObj->interfaceMap[itfIdx].pItf = NULL;
         }
     }
-#ifdef _GSTREAMER_BACKEND_
-    if ( pImpl->adaptationCtx != NULL )
-    {
-        XAMediaPlayerAdapt_Destroy( pImpl->adaptationCtx );
-        pImpl->adaptationCtx = NULL;
-    }
-#endif
+    
+    if(pImpl->curAdaptCtx)
+        {
+        if(pImpl->curAdaptCtx->fwtype == FWMgrFWMMF)
+            {
+            XAMediaPlayerAdaptMMF_Destroy( (XAAdaptationMMFCtx*)pImpl->adaptationCtxMMF );
+            }
+        else
+            {
+            XAMediaPlayerAdapt_Destroy( (XAAdaptationGstCtx*)pImpl->adaptationCtxGst );
+            }
+        }
+
     XA_IMPL_THREAD_SAFETY_EXIT_FOR_VOID_FUNCTIONS( XATSMediaPlayer );
     DEBUG_API("<-XAMediaPlayerImpl_FreeResources");
     return;
@@ -549,10 +581,10 @@
  */
 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");
 
@@ -560,23 +592,23 @@
     {
         switch( mapEntry->mapIdx )
             {
-#ifdef _GSTREAMER_BACKEND_  
+  
             case MP_METADATAEXTRACTIONITF:
-                mapEntry->pItf = XAMetadataExtractionItfImpl_Create( pImpl->adaptationCtx );
+                mapEntry->pItf = XAMetadataExtractionItfImpl_Create( pImpl->curAdaptCtx );
                 break;
             case MP_METADATATRAVERSALITF:
-                mapEntry->pItf = XAMetadataTraversalItfImpl_Create( pImpl->adaptationCtx );
+                mapEntry->pItf = XAMetadataTraversalItfImpl_Create( pImpl->curAdaptCtx );
                 break;
             case MP_PLAYBACKRATEITF:
-                mapEntry->pItf = XAPlaybackRateItfImpl_Create(pImpl->adaptationCtx);
+                mapEntry->pItf = XAPlaybackRateItfImpl_Create(pImpl);
                 break;
             case MP_EQUALIZERITF:
-                mapEntry->pItf = XAEqualizerItfImpl_Create( pImpl->adaptationCtx );
+                mapEntry->pItf = XAEqualizerItfImpl_Create( pImpl->curAdaptCtx );
                 break;
             case MP_IMAGEEFFECTSITF:
-                mapEntry->pItf = XAImageEffectsItfImpl_Create( pImpl->adaptationCtx );
+                mapEntry->pItf = XAImageEffectsItfImpl_Create( pImpl->curAdaptCtx );
                 break;
-#endif
+
             default:
                 DEBUG_ERR("XAMediaPlayerImpl_DoAddItf unknown id");
                 ret = XA_RESULT_FEATURE_UNSUPPORTED;
@@ -653,30 +685,4 @@
     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;  
-  
-}
--- a/khronosfws/openmax_al/src/mediaplayer/xamediaplayer.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/mediaplayer/xamediaplayer.h	Fri May 14 16:22:35 2010 +0300
@@ -21,11 +21,9 @@
 #include "openmaxalwrapper.h"
 #include "xaglobals.h"
 #include "xaobjectitf.h"
-#ifdef _GSTREAMER_BACKEND_
-#include "XAMediaPlayerAdaptCtx.h"
-#endif
+#include "xamediaplayeradaptctx.h"
 #include "xamediaplayeradaptctxmmf.h"
-
+#include "xacapabilitiesmgr.h"
 /** MACROS **/
 
 
@@ -51,6 +49,9 @@
     MP_METADATATRAVERSALITF,
     MP_PLAYBACKRATEITF,
     MP_VIDEOPOSTPROCESSINGITF,
+    MP_NOKIAVOLUMEEXT,
+    MP_NOKIALINEARVOLUME,
+    MP_STREAMINFORMATIONITF,
     MP_ITFCOUNT
 } MPInterfaces;
 
@@ -71,11 +72,10 @@
     XAuint32 numRequiredInterfaces;
     XAInterfaceID *requiredItfIds;
 
-#ifdef _GSTREAMER_BACKEND_
-    XAAdaptationBaseCtx* adaptationCtx;
-#endif
-    XAAdaptationBaseMMFCtx* adaptationCtxMMF;
-    XAboolean isMMFPlayback;
+    XAAdaptationBaseCtx* curAdaptCtx;
+    XAAdaptationBaseCtx* adaptationCtxGst;
+    XAAdaptationBaseCtx* adaptationCtxMMF;
+
 } XAMediaPlayerImpl;
 
 
@@ -86,8 +86,6 @@
 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 );
--- a/khronosfws/openmax_al/src/mediaplayer/xaplaybackrateitf.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/mediaplayer/xaplaybackrateitf.c	Fri May 14 16:22:35 2010 +0300
@@ -19,9 +19,9 @@
 #include <stdlib.h>
 #include <assert.h>
 #include "xaplaybackrateitf.h"
-#ifdef _GSTREAMER_BACKEND_  
-#include "XAPlaybackRateItfAdaptation.h"
-#endif
+
+#include "xaplaybackrateitfadaptation.h"
+
 #include "xathreadsafety.h"
 
 static XAPlaybackRateItfImpl* GetImpl(XAPlaybackRateItf self)
@@ -56,9 +56,16 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
-    res = XAPlaybackRateItfAdapt_SetRate(impl->adaptCtx, rate);
-#endif
+    if(impl->adaptCtx->fwtype == FWMgrFWGST)
+        {
+        res = XAPlaybackRateItfAdapt_SetRate((XAAdaptationGstCtx*)impl->adaptCtx, rate);
+        }
+    else
+        {
+        DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED");
+        res = XA_RESULT_FEATURE_UNSUPPORTED;          
+        }
+    
     if(res == XA_RESULT_SUCCESS)
     {
         impl->currentRate = rate;
@@ -81,7 +88,15 @@
         DEBUG_API("<-XAPlaybackRateItfImpl_GetRate");
         return XA_RESULT_PARAMETER_INVALID;
     }
-    *pRate = impl->currentRate;
+    if(impl->adaptCtx->fwtype == FWMgrFWGST)
+        {
+        *pRate = impl->currentRate;
+        }
+    else
+        {
+        DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED");
+        res = XA_RESULT_FEATURE_UNSUPPORTED;          
+        }
 
     DEBUG_API("<-XAPlaybackRateItfImpl_GetRate");
     return res;
@@ -103,10 +118,17 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
     
-#ifdef _GSTREAMER_BACKEND_
-    /* set to adaptation */
-    res = XAPlaybackRateItfAdapt_SetPropertyConstraints(impl->adaptCtx, constraints);
-#endif
+    if(impl->adaptCtx->fwtype == FWMgrFWGST)
+        {
+        /* set to adaptation */
+        res = XAPlaybackRateItfAdapt_SetPropertyConstraints((XAAdaptationGstCtx*)impl->adaptCtx, constraints);
+        }
+    else
+        {
+        DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED");
+        res = XA_RESULT_FEATURE_UNSUPPORTED;          
+        }
+    
     XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
     DEBUG_API("<-XAPlaybackRateItfImpl_SetPropertyConstraints");
     return res;
@@ -126,10 +148,17 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
    
-#ifdef _GSTREAMER_BACKEND_
-    /* needs to be queried from adaptation */
-    res = XAPlaybackRateItfAdapt_GetProperties(impl->adaptCtx, pProperties);
-#endif
+    if(impl->adaptCtx->fwtype == FWMgrFWGST)
+        {
+        /* needs to be queried from adaptation */
+        res = XAPlaybackRateItfAdapt_GetProperties((XAAdaptationGstCtx*)impl->adaptCtx, pProperties);
+        }
+    else
+        {
+        DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED");
+        res = XA_RESULT_FEATURE_UNSUPPORTED;          
+        }
+    
     DEBUG_API("<-XAPlaybackRateItfImpl_GetProperties");
     return res;
 }
@@ -152,10 +181,17 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
     
-#ifdef _GSTREAMER_BACKEND_
-    /* needs to be queried from adaptation */
-    res = XAPlaybackRateItfAdapt_GetCapabilitiesOfRate(impl->adaptCtx, rate, pCapabilities);
-#endif
+    if(impl->adaptCtx->fwtype == FWMgrFWGST)
+        {
+        /* needs to be queried from adaptation */
+        res = XAPlaybackRateItfAdapt_GetCapabilitiesOfRate((XAAdaptationGstCtx*)impl->adaptCtx, rate, pCapabilities);
+        }
+    else
+        {
+        DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED");
+        res = XA_RESULT_FEATURE_UNSUPPORTED;          
+        }
+
     XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
     DEBUG_API("<-XAPlaybackRateItfImpl_GetCapabilitiesOfRate");
     return res;
@@ -180,12 +216,18 @@
         DEBUG_API("<-XAPlaybackRateItfImpl_GetRateRange");
         return XA_RESULT_PARAMETER_INVALID;
     }
+    if(impl->adaptCtx->fwtype == FWMgrFWGST)
+        {
+        /* needs to be queried from adaptation */
+        res = XAPlaybackRateItfAdapt_GetRateRange((XAAdaptationGstCtx*)impl->adaptCtx, index, pMinRate,
+                                                  pMaxRate,pStepSize, pCapabilities);
+        }
+    else
+        {
+        DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED");
+        res = XA_RESULT_FEATURE_UNSUPPORTED;          
+        }
     
-#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;
@@ -194,13 +236,11 @@
 /**
  * XAPlaybackRateItfImpl -specific methods
  **/
-#ifdef _GSTREAMER_BACKEND_
-
 /**
  * XAPlaybackRateItfImpl* XAPlaybackRateItfImpl_Create();
  * @return  XAPlaybackRateItfImpl* - Pointer to  PlaybackRateItf interface implementation
  **/
-XAPlaybackRateItfImpl* XAPlaybackRateItfImpl_Create( XAAdaptationBaseCtx *adaptCtx )
+XAPlaybackRateItfImpl* XAPlaybackRateItfImpl_Create( XAMediaPlayerImpl *impl )
 {
     XAPlaybackRateItfImpl *self = (XAPlaybackRateItfImpl*)
         calloc(1,sizeof(XAPlaybackRateItfImpl));
@@ -217,7 +257,7 @@
         self->itf.SetRate = XAPlaybackRateItfImpl_SetRate;
 
         /* init variables */
-        self->adaptCtx = adaptCtx;
+        self->adaptCtx = impl->curAdaptCtx;
         self->currentRate = 1000;
         self->self = self;
     }
@@ -225,7 +265,7 @@
     DEBUG_API("<-XAPlaybackRateItfImpl_Create");
     return self;
 }
-#endif
+
 /**
  * void XAPlaybackRateItfImpl_Free(XAPlaybackRateItfImpl* self);
  * @param  XAPlaybackRateItfImpl* self -
--- a/khronosfws/openmax_al/src/mediaplayer/xaplaybackrateitf.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/mediaplayer/xaplaybackrateitf.h	Fri May 14 16:22:35 2010 +0300
@@ -18,11 +18,7 @@
 #ifndef XAPLAYBACKRATEITF_H
 #define XAPLAYBACKRATEITF_H
 
-#include "openmaxalwrapper.h"
-#include "xaglobals.h"
-#ifdef _GSTREAMER_BACKEND_
-#include "XAAdaptationContextBase.h"
-#endif
+#include "xamediaplayer.h"
 /** MACROS **/
 
 /** TYPES **/
@@ -38,10 +34,8 @@
     /* pointer to self */
     struct XAPlaybackRateItfImpl_* self;
 
-#ifdef _GSTREAMER_BACKEND_
     /* variables */
     XAAdaptationBaseCtx *adaptCtx;
-#endif
     XApermille currentRate;
 
 } XAPlaybackRateItfImpl;
@@ -70,11 +64,9 @@
                                               XApermille *pStepSize,
                                               XAuint32 *pCapabilities);
 
-#ifdef _GSTREAMER_BACKEND_
 
 /* XAPlaybackRateItfImpl -specific methods */
-XAPlaybackRateItfImpl* XAPlaybackRateItfImpl_Create( XAAdaptationBaseCtx *adaptCtx );
-#endif
+XAPlaybackRateItfImpl* XAPlaybackRateItfImpl_Create( XAMediaPlayerImpl *impl );
 void XAPlaybackRateItfImpl_Free(XAPlaybackRateItfImpl* self);
 
 #endif /* XAPLAYBACKRATEITF_H */
--- a/khronosfws/openmax_al/src/mediaplayer/xaplayitf.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/mediaplayer/xaplayitf.c	Fri May 14 16:22:35 2010 +0300
@@ -20,9 +20,9 @@
 #include <assert.h>
 
 #include "xaplayitf.h"
-#ifdef _GSTREAMER_BACKEND_  
-#include "XAPlayItfAdaptation.h"
-#endif
+
+#include "xaplayitfadaptation.h"
+
 #include "xaplayitfadaptationmmf.h"
 #include "xathreadsafety.h"
 #include <string.h>
@@ -58,46 +58,43 @@
     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)
+    XA_IMPL_THREAD_SAFETY_ENTRY( XATSMediaPlayer );
+
+    if(impl->pObjImpl->curAdaptCtx->fwtype == FWMgrFWMMF)
     {
-        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        
-        }
+        ret = XAPlayItfAdaptMMF_SetPlayState(impl->pObjImpl->curAdaptCtx, state);
+        XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
+        DEBUG_API("<-XAPlayItfImpl_SetPlayState");
+        return ret;		    
+    }
 
-        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;
-            }
-        }
+	/* check is play state changed, if not do nothing */
+    if(state != impl->playbackState)
+	{
+    	if(state == XA_PLAYSTATE_PLAYING)
+    	{
+        	XAPlayItfAdaptGST_GetPosition((XAAdaptationGstCtx*)impl->adapCtx, &(impl->lastPosition));
+    	}
+		ret = XAPlayItfAdaptGST_SetPlayState(impl->adapCtx, state);
+
+		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 );
@@ -113,6 +110,7 @@
 {
     XAresult ret = XA_RESULT_SUCCESS;
     XAPlayItfImpl* impl = GetImpl(self);
+
     DEBUG_API("->XAPlayItfImpl_GetPlayState");
 
     if(!impl || !pState)
@@ -123,7 +121,18 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-    *pState = impl->playbackState;
+    XA_IMPL_THREAD_SAFETY_ENTRY( XATSMediaPlayer );
+
+    if(impl->pObjImpl->curAdaptCtx->fwtype == FWMgrFWMMF)
+    {
+        ret = XAPlayItfAdaptMMF_GetPlayState(impl->pObjImpl->curAdaptCtx, pState);    
+    }
+    else
+    {
+        *pState = impl->playbackState;
+    }
+
+    XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
 
     DEBUG_API_A1("<-XAPlayItfImpl_GetPlayState: %s",PLAYSTATENAME(impl->playbackState));
     return ret;
@@ -138,20 +147,28 @@
     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_ENTRY( XATSMediaPlayer );
+
+    if(impl->pObjImpl->curAdaptCtx->fwtype == FWMgrFWMMF)
+    {
+        ret = XAPlayItfAdaptMMF_GetDuration(impl->pObjImpl->curAdaptCtx, pMsec);
+    }
+    else
+    {
+        ret = XAPlayItfAdaptGST_GetDuration((XAAdaptationGstCtx*)impl->adapCtx, pMsec);
+    }
+    
     XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
+
     DEBUG_API("<-XAPlayItfImpl_GetDuration");
     return ret;
 }
@@ -165,27 +182,36 @@
 {
     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 )
+    XA_IMPL_THREAD_SAFETY_ENTRY( XATSMediaPlayer );
+
+    if(impl->pObjImpl->curAdaptCtx->fwtype == FWMgrFWMMF)
+    {
+        ret = XAPlayItfAdaptMMF_GetPosition(impl->pObjImpl->curAdaptCtx, pMsec);
+    }
+    else
     {
-    	*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
+
+        if ( impl->playbackState == XA_PLAYSTATE_STOPPED )
+        {
+    	    *pMsec = 0;
+    	    DEBUG_API("<-XAPlayItfImpl_GetPosition");
+            XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );    	
+    	    return XA_RESULT_SUCCESS;
+        }
+        ret = XAPlayItfAdaptGST_GetPosition((XAAdaptationGstCtx*)impl->adapCtx, pMsec);
+	}
+
     XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
     DEBUG_API("<-XAPlayItfImpl_GetPosition");
     return ret;
@@ -216,6 +242,15 @@
     impl->cbcontext = pContext;
     impl->cbPtrToSelf = self;
 
+    XA_IMPL_THREAD_SAFETY_ENTRY( XATSMediaPlayer );
+
+    if(impl->pObjImpl->curAdaptCtx->fwtype == FWMgrFWMMF)
+    {
+        ret = XAPlayItfAdaptMMF_RegisterCallback(impl->pObjImpl->curAdaptCtx, callback);
+    }
+
+    XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
+
     DEBUG_API("<-XAPlayItfImpl_RegisterCallback");
     return ret;
 }
@@ -230,25 +265,34 @@
     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;
     }
 
+    XA_IMPL_THREAD_SAFETY_ENTRY( XATSMediaPlayer );
+
     impl->eventFlags = eventFlags;
-#ifdef _GSTREAMER_BACKEND_
+
+    if(impl->pObjImpl->curAdaptCtx->fwtype == FWMgrFWMMF)
+    {
+        ret = XAPlayItfAdaptMMF_SetCallbackEventsMask(impl->pObjImpl->curAdaptCtx, eventFlags);
+
+	    XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
+	    DEBUG_API("<-XAPlayItfImpl_SetCallbackEventsMask");
+	    return ret;
+    }
+
     /* 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);
+        {
+        ret = XAPlayItfAdapt_EnablePositionTracking((XAAdaptationGstCtx*)impl->adapCtx, XA_BOOLEAN_TRUE);
         if( ret == XA_RESULT_SUCCESS )
         {
             impl->positionupdateOn = XA_BOOLEAN_TRUE;
@@ -257,13 +301,13 @@
     else if( !(eventFlags & (XA_PLAYEVENT_HEADATMARKER | XA_PLAYEVENT_HEADATNEWPOS))
             &&  impl->adapCtx && impl->positionupdateOn)
     {
-        ret = XAPlayItfAdapt_EnablePositionTracking(impl->adapCtx, XA_BOOLEAN_FALSE);
+        ret = XAPlayItfAdapt_EnablePositionTracking((XAAdaptationGstCtx*)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;
@@ -301,10 +345,10 @@
 {
     XAresult ret = XA_RESULT_SUCCESS;
     XAmillisecond duration = 0;
-    XAPlayItfImpl* impl = NULL;
-
+    XAPlayItfImpl* impl = GetImpl(self);
 
     DEBUG_API_A1("->XAPlayItfImpl_SetMarkerPosition: %lu ms", mSec);
+
     /* Get duration of the content */
     if(XAPlayItfImpl_GetDuration(self, &duration) != XA_RESULT_SUCCESS)
     {
@@ -314,7 +358,6 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-    impl = GetImpl(self);
 
     if(!impl || mSec > duration)
     {
@@ -323,9 +366,19 @@
         /* invalid parameter */
         return XA_RESULT_PARAMETER_INVALID;
     }
+
     impl->markerPosition = mSec;
     impl->isMarkerPosCbSend = XA_BOOLEAN_FALSE;
 
+    XA_IMPL_THREAD_SAFETY_ENTRY( XATSMediaPlayer );
+
+    if(impl->pObjImpl->curAdaptCtx->fwtype == FWMgrFWMMF)
+    {
+        ret = XAPlayItfAdaptMMF_SetMarkerPosition(impl->pObjImpl->curAdaptCtx, mSec);
+    }
+
+    XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
+
     DEBUG_API("<-XAPlayItfImpl_SetMarkerPosition");
     return ret;
 }
@@ -347,9 +400,19 @@
         /* invalid parameter */
         return XA_RESULT_PARAMETER_INVALID;
     }
+
     impl->isMarkerPosCbSend = XA_BOOLEAN_FALSE;
     impl->markerPosition = NO_POSITION;
 
+    XA_IMPL_THREAD_SAFETY_ENTRY( XATSMediaPlayer );
+
+    if(impl->pObjImpl->curAdaptCtx->fwtype == FWMgrFWMMF)
+    {
+        ret = XAPlayItfAdaptMMF_ClearMarkerPosition(impl->pObjImpl->curAdaptCtx);
+    }
+
+    XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
+
     DEBUG_API("<-XAPlayItfImpl_ClearMarkerPosition");
     return ret;
 }
@@ -405,6 +468,15 @@
     }
     impl->positionUpdatePeriod = mSec;
 
+    XA_IMPL_THREAD_SAFETY_ENTRY( XATSMediaPlayer );
+
+    if(impl->pObjImpl->curAdaptCtx->fwtype == FWMgrFWMMF)
+    {
+        ret = XAPlayItfAdaptMMF_SetPositionUpdatePeriod(impl->pObjImpl->curAdaptCtx, mSec);
+    }
+
+    XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
+
     DEBUG_API("<-XAPlayItfImpl_SetPositionUpdatePeriod");
     return ret;
 }
@@ -442,11 +514,7 @@
  * XAPlayItfImpl* XAPlayItfImpl_Create()
  * Description: Allocate and initialize PlayItfImpl
  **/
-XAPlayItfImpl* XAPlayItfImpl_Create( 
-#ifdef _GSTREAMER_BACKEND_
-        XAAdaptationBaseCtx *adapCtx,
-#endif        
-        XAAdaptationBaseMMFCtx *adaptationCtxMMF )
+XAPlayItfImpl* XAPlayItfImpl_Create( XAMediaPlayerImpl *impl )
 {
     XAPlayItfImpl *self;
 
@@ -476,16 +544,13 @@
         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->adapCtx = impl->curAdaptCtx;*/
+        self->pObjImpl = impl;
         self->cbPtrToSelf = NULL;
         self->isMarkerPosCbSend = XA_BOOLEAN_FALSE;
-
-#ifdef _GSTREAMER_BACKEND_  
-        XAAdaptationBase_AddEventHandler( adapCtx, &XAPlayItfImpl_AdaptCb, XA_PLAYITFEVENTS, self );
-#endif
+        
+/*        XAAdaptationBase_AddEventHandler( self->adapCtx, &XAPlayItfImpl_AdaptCb, XA_PLAYITFEVENTS, self );*/
+        XAAdaptationBase_AddEventHandler( self->pObjImpl->curAdaptCtx, &XAPlayItfImpl_AdaptCb, XA_PLAYITFEVENTS, self );
 
         self->self = self;
     }
@@ -501,15 +566,12 @@
 {
     DEBUG_API("->XAPlayItfImpl_Free");
     assert(self==self->self);
-#ifdef _GSTREAMER_BACKEND_   
-    XAAdaptationBase_RemoveEventHandler( self->adapCtx, &XAPlayItfImpl_AdaptCb );
-#endif    
+/*    XAAdaptationBase_RemoveEventHandler( self->adapCtx, &XAPlayItfImpl_AdaptCb );*/
+    XAAdaptationBase_RemoveEventHandler( self->pObjImpl->curAdaptCtx, &XAPlayItfImpl_AdaptCb );
     free(self);
     DEBUG_API("<-XAPlayItfImpl_Free");
 }
 
-#ifdef _GSTREAMER_BACKEND_  
-
 /* void XAPlayItfImpl_AdaptCb
  * Description: Listen changes in adaptation
  */
@@ -528,6 +590,15 @@
         return;
     }
     assert(event);
+
+    if(impl->pObjImpl->curAdaptCtx->fwtype == FWMgrFWMMF)
+    {
+        impl->callback(impl->cbPtrToSelf, impl->cbcontext, event->eventid);
+        DEBUG_API("<-XAPlayItfImpl_AdaptCb");
+        XA_IMPL_THREAD_SAFETY_EXIT_FOR_VOID_FUNCTIONS( XATSMediaPlayer );
+        return;
+    }
+
     /* check position update events */
     if( event->eventid == XA_ADAPT_POSITION_UPDATE_EVT )
     {
@@ -592,7 +663,14 @@
     else if( event->eventid == XA_PLAYEVENT_HEADSTALLED )
     {
         impl->playbackState = XA_PLAYSTATE_PAUSED;
-        XAPlayItfAdapt_GetPosition(impl->adapCtx, &(impl->lastPosition));
+        if(impl->adapCtx->fwtype == FWMgrFWMMF)
+            {
+            //XAPlayItfAdaptMMF_GetPosition((XAAdaptationGstCtx*)impl->adapCtx, &(impl->lastPosition));
+            }
+        else
+            {
+            XAPlayItfAdaptGST_GetPosition((XAAdaptationGstCtx*)impl->adapCtx, &(impl->lastPosition));
+            }        
         /* send callback if needed */
         if( (XA_PLAYEVENT_HEADSTALLED & impl->eventFlags) && impl->callback )
         {
@@ -616,32 +694,4 @@
     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");
-}
--- a/khronosfws/openmax_al/src/mediaplayer/xaplayitf.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/mediaplayer/xaplayitf.h	Fri May 14 16:22:35 2010 +0300
@@ -18,12 +18,7 @@
 #ifndef XAPLAYITF_H
 #define XAPLAYITF_H
 
-#include "openmaxalwrapper.h"
-#include "xaglobals.h"
-#ifdef _GSTREAMER_BACKEND_
-#include "XAAdaptationContextBase.h"
-#endif
-#include "xaadaptationcontextbasemmf.h"
+#include "xaadptbasectx.h"
 #include "xamediaplayer.h"
 
 
@@ -47,7 +42,10 @@
 
     /* variables */
     XAPlayItf cbPtrToSelf;
+    /* TODO : This is no longer needed we need to get state from XAMediaPlayerImpl
+     * Delete this.*/
     XAuint32 playbackState;
+
     xaPlayCallback callback;
     void *cbcontext;
     XAuint32 eventFlags;
@@ -57,12 +55,12 @@
     XAmillisecond lastPosition;
     XAboolean isMarkerPosCbSend;
 
-#ifdef _GSTREAMER_BACKEND_
     /*Adaptation variables*/
+    /* TODO : This is no longer needed since we have access to XAMediaPlayerImpl
+     * Delete this.*/
     XAAdaptationBaseCtx *adapCtx;
-#endif
-    XAAdaptationBaseMMFCtx *adaptCtxMMF;
-    XAboolean isMMFPlayback;
+    
+    XAMediaPlayerImpl* pObjImpl;
 
 } XAPlayItfImpl;
 
@@ -98,15 +96,8 @@
 /*
  * implementation-specific methods
  */
-XAPlayItfImpl* XAPlayItfImpl_Create(
-#ifdef _GSTREAMER_BACKEND_
-        XAAdaptationBaseCtx *adapCtx,
-#endif
-        XAAdaptationBaseMMFCtx *adaptationCtxMMF );
-#ifdef _GSTREAMER_BACKEND_
+XAPlayItfImpl* XAPlayItfImpl_Create( XAMediaPlayerImpl *impl );
 void XAPlayItfImpl_AdaptCb( void *pHandlerCtx, XAAdaptEvent *event );
-#endif
-XAresult XAPlayItfImpl_DeterminePlaybackEngine(XAPlayItf self, XADataLocator_URI *uri);
 void XAPlayItfImpl_Free(XAPlayItfImpl* self);
 
 
--- a/khronosfws/openmax_al/src/mediaplayer/xaprefetchstatusitf.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/mediaplayer/xaprefetchstatusitf.c	Fri May 14 16:22:35 2010 +0300
@@ -20,9 +20,9 @@
 #include <assert.h>
 
 #include "xaprefetchstatusitf.h"
-#ifdef _GSTREAMER_BACKEND_
-#include "XAAdaptationContextBase.h"
-#endif
+
+#include "xaadaptationgst.h"
+
 
 static XAPrefetchStatusItfImpl* GetImpl(XAPrefetchStatusItf self)
 {
@@ -188,12 +188,10 @@
     return ret;
 }
 
-#ifdef _GSTREAMER_BACKEND_
-
 /*
  * implementation-specific methods
  */
-XAPrefetchStatusItfImpl* XAPrefetchStatusItfImpl_Create( XAAdaptationBaseCtx* adaptationCtx )
+XAPrefetchStatusItfImpl* XAPrefetchStatusItfImpl_Create( XAMediaPlayerImpl* impl )
 {
     XAPrefetchStatusItfImpl *self = (XAPrefetchStatusItfImpl*)
         calloc(1,sizeof(XAPrefetchStatusItfImpl));
@@ -215,10 +213,10 @@
         self->eventFlags = 0;
         self->fillUpdatePeriod = PREFETCHSTATUSITF_DEFAULT_UPDATE_PERIOD;
         self->pStatus = XA_PREFETCHSTATUS_SUFFICIENTDATA;
-        self->adaptationCtx = adaptationCtx;
+        self->adaptationCtx = impl->curAdaptCtx;
         self->cbPtrToSelf = NULL;
 
-        XAAdaptationBase_AddEventHandler( adaptationCtx, &XAPrefetchStatusItfImpl_AdaptCb, XA_PREFETCHITFEVENTS, self );
+        XAAdaptationBase_AddEventHandler( self->adaptationCtx, &XAPrefetchStatusItfImpl_AdaptCb, XA_PREFETCHITFEVENTS, self );
 
         self->self = self;
     }
@@ -226,21 +224,17 @@
     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
  */
@@ -272,5 +266,4 @@
 
     DEBUG_API("<-XAPrefetchStatusItfImpl_AdaptCb");
 }
-#endif
 
--- a/khronosfws/openmax_al/src/mediaplayer/xaprefetchstatusitf.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/mediaplayer/xaprefetchstatusitf.h	Fri May 14 16:22:35 2010 +0300
@@ -20,9 +20,9 @@
 
 #include "openmaxalwrapper.h"
 #include "xaglobals.h"
-#ifdef _GSTREAMER_BACKEND_
-#include "XAMediaPlayerAdaptCtx.h"
-#endif
+#include "xaadptbasectx.h"
+#include "xamediaplayer.h"
+
 #define PREFETCHSTATUSITF_DEFAULT_UPDATE_PERIOD 100
 
 /*
@@ -45,9 +45,7 @@
     void                *cbcontext;
     XAuint32            eventFlags;
     XApermille          fillUpdatePeriod;
-#ifdef _GSTREAMER_BACKEND_
     XAAdaptationBaseCtx* adaptationCtx;
-#endif
 }XAPrefetchStatusItfImpl;
 
 /**
@@ -75,15 +73,13 @@
 XAresult XAPrefetchStatusItfImpl_GetFillUpdatePeriod(XAPrefetchStatusItf self,
                                                        XApermille *pPeriod);
 
-#ifdef _GSTREAMER_BACKEND_
+
 
 /*
  * implementation-specific methods
  */
-XAPrefetchStatusItfImpl* XAPrefetchStatusItfImpl_Create( XAAdaptationBaseCtx* adaptationCtx);
+XAPrefetchStatusItfImpl* XAPrefetchStatusItfImpl_Create(  XAMediaPlayerImpl* impl );
 void XAPrefetchStatusItfImpl_AdaptCb( void *pHandlerCtx, XAAdaptEvent *event );
-#endif
-
 void XAPrefetchStatusItfImpl_Free(XAPrefetchStatusItfImpl* self);
 
 #endif /* XAPREFETCHSTATUSITF_H_ */
--- a/khronosfws/openmax_al/src/mediaplayer/xaseekitf.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/mediaplayer/xaseekitf.c	Fri May 14 16:22:35 2010 +0300
@@ -21,13 +21,11 @@
 
 #include "xaseekitf.h"
 
-#ifdef _GSTREAMER_BACKEND_
-#include "XASeekItfAdaptation.h"
-#include "XAPlayItfAdaptation.h"
-#endif
+#include "xaseekitfadaptation.h"
+#include "xaplayitfadaptation.h"
 #include "xathreadsafety.h"
-
-
+#include "xaplayitfadaptationmmf.h"
+#include "xaseekitfadaptationmmf.h"
 /**
  * XASeekItfImpl* GetImpl(XASeekItf self)
  * Description: Validate interface pointer and cast it to implementation pointer.
@@ -72,44 +70,80 @@
         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(impl->adapCtx->fwtype == FWMgrFWMMF)
+        {
+        /* Get duration of the content */
+        if(XAPlayItfAdaptMMF_GetDuration((XAAdaptationBaseCtx*)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;
+            }
+        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;
+            }
     
-    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;
-    }
+        ret = XASeekItfAdaptMMF_SetPosition(impl->adapCtx, pos, seekMode);
+        if(ret == XA_RESULT_SUCCESS)
+            {
+            impl->playbackPosition = pos;
+            impl->seekMode = seekMode;
+            }
+        }
+    else
+        {
+        /* Get duration of the content */
+        if(XAPlayItfAdaptGST_GetDuration((XAAdaptationGstCtx*)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;
+            }
+        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;
+            }
+    
+        ret = XASeekItfAdapt_SetPosition((XAAdaptationGstCtx*)impl->adapCtx, pos, seekMode);
+        if(ret == XA_RESULT_SUCCESS)
+            {
+            impl->playbackPosition = pos;
+            impl->seekMode = seekMode;
+            }
+    
+        }
 
     XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
     DEBUG_API("<-XASeekItfImpl_SetPosition");
@@ -139,35 +173,63 @@
         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;
-    }
+    if(impl->adapCtx->fwtype == FWMgrFWMMF)
+        {
+        /* Get duration of the content */
+        if(XAPlayItfAdaptMMF_GetDuration((XAAdaptationBaseCtx*)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;
+            }
+        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;
+            }
+    
+        ret = XASeekItfAdaptMMF_SetLoop(impl->adapCtx, loopEnable, startPos, endPos);
+        if(ret == XA_RESULT_SUCCESS)
+            {
+            impl->loopEnable = loopEnable;
+            impl->startPos = startPos;
+            impl->endPos = endPos;
+            }    
+        }
+    else
+        {
+        /* Get duration of the content */
+        if(XAPlayItfAdaptGST_GetDuration((XAAdaptationGstCtx*)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;
+            }
+        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;
+            }
+    
+        ret = XASeekItfAdapt_SetLoop((XAAdaptationGstCtx*)impl->adapCtx, loopEnable, startPos, endPos);
+        if(ret == XA_RESULT_SUCCESS)
+            {
+            impl->loopEnable = loopEnable;
+            impl->startPos = startPos;
+            impl->endPos = endPos;
+            }
+    
+        }
 
     XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
     DEBUG_API("<-XASeekItfImpl_SetLoop");
@@ -208,13 +270,12 @@
 /**
  * XASeekItfImpl -specific methods
  **/
-#ifdef _GSTREAMER_BACKEND_
 
 /**
  * XASeekItfImpl* XASeekItfImpl_Create()
  * Description: Allocate and initialize SeekItfImpl.
  **/
-XASeekItfImpl* XASeekItfImpl_Create( XAAdaptationBaseCtx *adapCtx )
+XASeekItfImpl* XASeekItfImpl_Create(  XAMediaPlayerImpl* impl )
 {
     XASeekItfImpl *self = (XASeekItfImpl*)
         calloc(1,sizeof(XASeekItfImpl));
@@ -233,14 +294,14 @@
         self->startPos = 0;
         self->endPos = 0;
 
-        self->adapCtx = adapCtx;
+        self->adapCtx = impl->curAdaptCtx;
 
         self->self = self;
     }
     DEBUG_API("<-XASeekItfImpl_Create");
     return self;
 }
-#endif
+
 /**
  * void XASeekItfImpl_Free(XASeekItfImpl* self)
  * Description: Free all resources reserved at XASeekItfImpl_Create.
--- a/khronosfws/openmax_al/src/mediaplayer/xaseekitf.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/mediaplayer/xaseekitf.h	Fri May 14 16:22:35 2010 +0300
@@ -18,11 +18,7 @@
 #ifndef XASEEKITF_H
 #define XASEEKITF_H
 
-#include "openmaxalwrapper.h"
-#include "xaglobals.h"
-#ifdef _GSTREAMER_BACKEND_
-#include "XAAdaptationContextBase.h"
-#endif
+#include "xamediaplayer.h"
 /** MACROS **/
 
 /** TYPES **/
@@ -45,10 +41,8 @@
     XAmillisecond startPos;
     XAmillisecond endPos;
 
-#ifdef _GSTREAMER_BACKEND_
     /*Adaptation variables*/
     XAAdaptationBaseCtx *adapCtx;
-#endif
 }XASeekItfImpl;
 
 /** METHODS **/
@@ -65,10 +59,8 @@
                                XAmillisecond *pStartPos,
                                XAmillisecond *pEndPos);
 
-#ifdef _GSTREAMER_BACKEND_
 /* XASeekItfImpl -specific methods */
-XASeekItfImpl* XASeekItfImpl_Create( XAAdaptationBaseCtx *adapCtx );
-#endif
+XASeekItfImpl* XASeekItfImpl_Create( XAMediaPlayerImpl* impl );
 void XASeekItfImpl_Free(XASeekItfImpl* self);
 
 #endif /* XASEEKITF_H */
--- a/khronosfws/openmax_al/src/mediarecorder/xaaudioencoderitf.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/mediarecorder/xaaudioencoderitf.c	Fri May 14 16:22:35 2010 +0300
@@ -15,19 +15,14 @@
 *
 */
 
-#include <stdio.h>
-#include <stdlib.h>
 #include <assert.h>
-#include <string.h>
+#include "xamediarecorderadaptctxmmf.h"
 #include "xaaudioencoderitf.h"
-#ifdef _GSTREAMER_BACKEND_
-#include "XAAudioEncoderItfAdaptation.h"
-#include "XAStaticCapsAdaptation.h"
-#include "XARecordItfAdaptation.h"
-#endif
+#include "xaaudioencoderitfadaptation.h"
+#include "xarecorditfadaptation.h"
 #include "xathreadsafety.h"
-#include "xaadaptationmmf.h"
 #include "cmmfbackendengine.h"
+#include "xacapabilitiesmgr.h"
 
 /* XAAudioEncoderItfImpl* GetImpl(XAAudioEncoderItf self)
  * Description: Validate interface pointer and cast it to implementation pointer.
@@ -57,11 +52,11 @@
 XAresult XAAudioEncoderItfImpl_SetEncoderSettings(XAAudioEncoderItf self,
                                                   XAAudioEncoderSettings *pSettings)
 {
+    XAMediaRecorderAdaptationMMFCtx* mCtx;
     XAresult ret = XA_RESULT_SUCCESS;
     XAuint32 recState = XA_RECORDSTATE_STOPPED;
+    XAAudioEncoderSettings currentSettings;
     XAAudioEncoderItfImpl *impl = GetImpl(self);
-    XAMediaRecorderAdaptationMMFCtx* mCtx;
-    XAAudioEncoderSettings currentSettings;
 
     DEBUG_API("->XAAudioEncoderItfImpl_SetEncoderSettings");
     XA_IMPL_THREAD_SAFETY_ENTRY( XATSMediaRecorder );
@@ -75,18 +70,18 @@
         return XA_RESULT_PARAMETER_INVALID;
         }
 
-    mCtx = (XAMediaRecorderAdaptationMMFCtx*) impl->pObjImpl->adaptationCtxMMF;
-    
-    if(mCtx->xaRecordState != recState)
+    if(impl->adapCtx->fwtype == FWMgrFWMMF)
         {
-        XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaRecorder );
-        DEBUG_ERR("XA_RESULT_PRECONDITIONS_VIOLATED");
-        DEBUG_API("<-XAAudioEncoderItfImpl_SetEncoderSettings");
-        return XA_RESULT_PRECONDITIONS_VIOLATED;
-        }
+        mCtx = (XAMediaRecorderAdaptationMMFCtx*) impl->pObjImpl->adaptationCtx;
+        
+        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)
             {
@@ -146,13 +141,12 @@
         }
     else
         {
-#ifdef _GSTREAMER_BACKEND_
-        XAStaticCapsData temp;
+        XACapabilities temp;
     
-        ret = XAStaticCapsAdapt_GetCapsById(XACAP_ENCODER|XACAP_AUDIO, pSettings->encoderId, &temp);
+        ret = XACapabilitiesMgr_GetCapsById(impl->pObjImpl->adaptationCtx->capslist, (XACapsType)(XACAP_ENCODER|XACAP_AUDIO), pSettings->encoderId, &temp);
         if( ret == XA_RESULT_SUCCESS )
             {
-            ret = XARecordItfAdapt_GetRecordState( impl->adapCtx, &recState );
+            ret = XARecordItfAdapt_GetRecordState( (XAAdaptationGstCtx*)impl->adapCtx, &recState );
             if( ret == XA_RESULT_SUCCESS )
                 {
                 if( XA_RECORDSTATE_STOPPED == recState )
@@ -173,7 +167,6 @@
             DEBUG_API("<-XAAudioEncoderItfImpl_SetEncoderSettings");
             return XA_RESULT_FEATURE_UNSUPPORTED;
             }
-#endif
         }    
     
     XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaRecorder );
@@ -207,13 +200,13 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-    mCtx = (XAMediaRecorderAdaptationMMFCtx*) (impl->pObjImpl->adaptationCtxMMF);
+    mCtx = (XAMediaRecorderAdaptationMMFCtx*) (impl->pObjImpl->adaptationCtx);
     
 
 
-    if(impl->pObjImpl->isMMFRecord)
+    if(impl->adapCtx->fwtype == FWMgrFWMMF)
         {
-        mmf_get_encoder_id(mCtx->mmfContext, &encoderId);
+        mmf_get_codec_id(mCtx->mmfContext, &encoderId);
         
         switch(encoderId)
             {
@@ -240,13 +233,13 @@
                 break;
             }
         
-        mmf_get_destination_channels(mCtx->mmfContext, &channelsIn);
+        mmf_get_channels(mCtx->mmfContext, &channelsIn);
         pSettings->channelsIn =  channelsIn;
-        mmf_get_destination_channels(mCtx->mmfContext, &channelsOut);
+        mmf_get_channels(mCtx->mmfContext, &channelsOut);
         pSettings->channelsOut = channelsOut;
-        mmf_get_destination_samplerate(mCtx->mmfContext, &sampleRate);
+        mmf_get_samplerate(mCtx->mmfContext, &sampleRate);
         pSettings->sampleRate = sampleRate;
-        mmf_get_destination_bitrate(mCtx->mmfContext, &bitRate);
+        mmf_get_bitrate(mCtx->mmfContext, &bitRate);
         pSettings->bitRate = bitRate;
         pSettings->rateControl = XA_RATECONTROLMODE_CONSTANTBITRATE;
         pSettings->channelMode = 0;
@@ -255,9 +248,7 @@
         }
     else
         {
-#ifdef _GSTREAMER_BACKEND_
         ret = XAAudioEncoderItfAdapt_GetEncoderSettings(impl->adapCtx, pSettings);
-#endif    
         }
     DEBUG_API("<-XAAudioEncoderItfImpl_GetEncoderSettings");
     return ret;
@@ -270,26 +261,25 @@
 /* XAAudioEncoderItfImpl* XAAudioEncoderItfImpl_Create()
  * Description: Allocate and initialize XAAudioEncoderItfImpl
  */
-XAAudioEncoderItfImpl* XAAudioEncoderItfImpl_Create(
-#ifdef _GSTREAMER_BACKEND_
-        XAAdaptationBaseCtx *adapCtx,
-#endif
-        XAMediaRecorderImpl* impl
-        )
+XAAudioEncoderItfImpl* XAAudioEncoderItfImpl_Create( XAMediaRecorderImpl* impl )
 {
     XAAudioEncoderItfImpl* self = (XAAudioEncoderItfImpl*)
         calloc(1,sizeof(XAAudioEncoderItfImpl));
+    //XAMediaRecorderAdaptationCtx* mCtx = (XAMediaRecorderAdaptationCtx*)(impl->adaptationCtx);
+    
     DEBUG_API("->XAAudioEncoderItfImpl_Create");
     if( self )
     {
-        /* init itf default implementation */
-        self->itf.GetEncoderSettings = XAAudioEncoderItfImpl_GetEncoderSettings;
-        self->itf.SetEncoderSettings = XAAudioEncoderItfImpl_SetEncoderSettings;
+        //if(mCtx->fwtype == FWMgrFWMMF)
+            {
+            /* 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->adapCtx = impl->adaptationCtx;
 
         self->self = self;
     }
--- a/khronosfws/openmax_al/src/mediarecorder/xaaudioencoderitf.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/mediarecorder/xaaudioencoderitf.h	Fri May 14 16:22:35 2010 +0300
@@ -18,12 +18,6 @@
 #ifndef XAAUDIOENCODERITF_H
 #define XAAUDIOENCODERITF_H
 
-#include "openmaxalwrapper.h"
-#include "xaglobals.h"
-#ifdef _GSTREAMER_BACKEND_
-#include "XAAdaptationContextBase.h"
-#endif
-
 #include "xamediarecorder.h"
 
 /** MACROS **/
@@ -43,10 +37,9 @@
     
     XAMediaRecorderImpl* pObjImpl;
     
-#ifdef _GSTREAMER_BACKEND_
     /* variables */
     XAAdaptationBaseCtx    *adapCtx;
-#endif
+
 } XAAudioEncoderItfImpl;
 
 /** METHODS **/
@@ -61,12 +54,7 @@
                                                    XAAudioEncoderSettings *pSettings );
 
 /* XAAudioEncoderItfImpl -specific methods */
-XAAudioEncoderItfImpl* XAAudioEncoderItfImpl_Create( 
-#ifdef _GSTREAMER_BACKEND_
-        XAAdaptationBaseCtx *adapCtx, 
-#endif
-        XAMediaRecorderImpl* impl 
-        );
+XAAudioEncoderItfImpl* XAAudioEncoderItfImpl_Create( XAMediaRecorderImpl* impl );
 void XAAudioEncoderItfImpl_Free( XAAudioEncoderItfImpl* self );
 
 #endif /* XAAUDIOENCODERITF_H */
--- a/khronosfws/openmax_al/src/mediarecorder/xaimageencoderitf.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/mediarecorder/xaimageencoderitf.c	Fri May 14 16:22:35 2010 +0300
@@ -20,12 +20,11 @@
 #include <assert.h>
 #include <string.h>
 #include "xaimageencoderitf.h"
-#ifdef _GSTREAMER_BACKEND_
-#include "XAImageEncoderItfAdaptation.h"
-#include "XARecordItfAdaptation.h"
-#include "XAStaticCapsAdaptation.h"
-#endif
+
+#include "xaimageencoderitfadaptation.h"
+#include "xarecorditfadaptation.h"
 #include "xathreadsafety.h"
+#include "xacapabilitiesmgr.h"
 
 #define APPROX_MAXRATIO (90/100)
 
@@ -56,8 +55,7 @@
                                                 const XAImageSettings *pSettings)
 {
     XAresult res = XA_RESULT_SUCCESS;
-#ifdef _GSTREAMER_BACKEND_
-    XAStaticCapsData temp;
+    XACapabilities temp;
     XAImageEncoderItfImpl *impl = GetImpl(self);
 
     DEBUG_API("->XAImageEncoderItfImpl_SetImageSettings");
@@ -71,19 +69,22 @@
         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;
-    }
+    if(impl->adaptCtx->fwtype == FWMgrFWGST)
+        {
+        res = XACapabilitiesMgr_GetCapsById(NULL, (XACapsType)(XACAP_ENCODER|XACAP_IMAGE), pSettings->encoderId, &temp);
+        if( res == XA_RESULT_SUCCESS )
+            {
+            res = XAImageEncoderItfAdapt_SetImageSettings((XAAdaptationGstCtx*)impl->adaptCtx, pSettings);
+            }
+        else
+            {
+            DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED");
+            res = XA_RESULT_FEATURE_UNSUPPORTED;
+            }
+        }
+    
     XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaRecorder );
-#endif
+
     DEBUG_API("<-XAImageEncoderItfImpl_SetImageSettings");
     return res;
 }
@@ -105,9 +106,17 @@
         /* invalid parameter */
         return XA_RESULT_PARAMETER_INVALID;
     }
-#ifdef _GSTREAMER_BACKEND_
-    res = XAImageEncoderItfAdapt_GetImageSettings(impl->adaptCtx, pSettings);
-#endif
+    if(impl->adaptCtx->fwtype == FWMgrFWGST)
+        {
+        res = XAImageEncoderItfAdapt_GetImageSettings((XAAdaptationGstCtx*)impl->adaptCtx, pSettings);
+        }
+    else
+        {
+        DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED");
+        DEBUG_API("<-XAImageEncoderItfImpl_GetImageSettings");
+        return XA_RESULT_FEATURE_UNSUPPORTED;    
+        }
+
     DEBUG_API("<-XAImageEncoderItfImpl_GetImageSettings");
     return res;
 }
@@ -133,9 +142,17 @@
     }
     /* calculate size estimate */
 
-#ifdef _GSTREAMER_BACKEND_
-    XAImageEncoderItfAdapt_GetImageSettings(impl->adaptCtx, &curSettings);
-#endif
+    if(impl->adaptCtx->fwtype == FWMgrFWGST)
+        {
+        XAImageEncoderItfAdapt_GetImageSettings((XAAdaptationGstCtx*)impl->adaptCtx, &curSettings);
+        }
+    else
+        {
+        DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED");
+        DEBUG_API("<-XAImageEncoderItfImpl_GetSizeEstimate");
+        return XA_RESULT_FEATURE_UNSUPPORTED;   
+        }
+    
     switch(curSettings.colorFormat)
     {
         case XA_COLORFORMAT_MONOCHROME:
@@ -221,26 +238,25 @@
 /* XAImageEncoderItfImpl* XAImageEncoderItfImpl_Create()
  * Description: Allocate and initialize ImageEncoderItfImpl
  */
-XAImageEncoderItfImpl* XAImageEncoderItfImpl_Create(
-#ifdef _GSTREAMER_BACKEND_
-        XAAdaptationBaseCtx *adaptCtx
-#endif
-        )
+XAImageEncoderItfImpl* XAImageEncoderItfImpl_Create(XAMediaRecorderImpl* impl)
 {
     XAImageEncoderItfImpl* self = (XAImageEncoderItfImpl*)
         calloc(1,sizeof(XAImageEncoderItfImpl));
+    //XAMediaRecorderAdaptationCtx* mCtx = (XAMediaRecorderAdaptationCtx*)(impl->adaptationCtx);
+    
     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;
+        //if(mCtx->fwtype == FWMgrFWGST)
+            {
+            /* 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->adaptCtx = impl->adaptationCtx;
         
         self->self = self;
     }
--- a/khronosfws/openmax_al/src/mediarecorder/xaimageencoderitf.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/mediarecorder/xaimageencoderitf.h	Fri May 14 16:22:35 2010 +0300
@@ -18,11 +18,7 @@
 #ifndef XAIMAGEENCODERITF_H
 #define XAIMAGEENCODERITF_H
 
-#include "openmaxalwrapper.h"
-#include "xaglobals.h"
-#ifdef _GSTREAMER_BACKEND_
-#include "XAAdaptationContextBase.h"
-#endif
+#include "xamediarecorder.h"
 /** MACROS **/
 
 /** TYPES **/
@@ -37,10 +33,9 @@
     struct XAImageEncoderItf_ itf;
     /* pointer to self */
     struct XAImageEncoderItfImpl_* self;
-#ifdef _GSTREAMER_BACKEND_
     /* variables */
     XAAdaptationBaseCtx *adaptCtx;
-#endif
+
 } XAImageEncoderItfImpl;
 
 /** METHODS **/
@@ -59,13 +54,7 @@
 
 
 /* XAImageEncoderItfImpl -specific methods */
-XAImageEncoderItfImpl* XAImageEncoderItfImpl_Create(
-#ifdef _GSTREAMER_BACKEND_
-        XAAdaptationBaseCtx *adaptCtx,
-#endif
-        void
-        );
-
+XAImageEncoderItfImpl* XAImageEncoderItfImpl_Create(XAMediaRecorderImpl* impl);
 void XAImageEncoderItfImpl_Free(XAImageEncoderItfImpl* self);
 
 #endif /* XAIMAGEENCODERITF_H */
--- a/khronosfws/openmax_al/src/mediarecorder/xamediarecorder.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/mediarecorder/xamediarecorder.c	Fri May 14 16:22:35 2010 +0300
@@ -36,6 +36,9 @@
 #include "xametadatatraversalitf.h"
 #include "xathreadsafety.h"
 #include <string.h>
+#include "xacapabilitiesmgr.h"
+#include "xamediarecorderadaptctxmmf.h"
+#include "xamediarecorderadaptctx.h"
 /* Static mapping of enumeration XAMediaRecorderInterfaces to interface iids */
 static const XAInterfaceID* xaMediaRecorderItfIIDs[MR_ITFCOUNT]=
 {
@@ -62,7 +65,9 @@
 /* XAResult XAMediaRecorderImpl_Create
  * Create object
  */
-XAresult XAMediaRecorderImpl_CreateMediaRecorder(XAObjectItf* pRecorder,
+XAresult XAMediaRecorderImpl_CreateMediaRecorder(FrameworkMap* mapper,
+                                                 XACapabilities* capabilities,
+                                                 XAObjectItf* pRecorder,
                                                  XADataSource* pAudioSrc,
                                                  XADataSource* pImageVideoSrc,
                                                  XADataSink* pDataSnk,
@@ -72,11 +77,12 @@
 {
     XAMediaRecorderImpl* pImpl = NULL;
     XAObjectItfImpl* pBaseObj = NULL;
+    FWMgrFwType fwType;
     XAuint8 itfIdx;
     XAMediaType mediaType = XA_MEDIATYPE_UNKNOWN;
     XAresult ret=XA_RESULT_SUCCESS;
-    XADataLocator_URI* tmpUri;
-
+    const char *uri = NULL;
+    
     DEBUG_API("->XAMediaRecorderImpl_CreateMediaRecorder");
     XA_IMPL_THREAD_SAFETY_ENTRY( XATSMediaRecorder );
 
@@ -240,34 +246,63 @@
     pImpl->audioSrc = pAudioSrc;
     pImpl->dataSnk = pDataSnk;
     pImpl->imageVideoSrc = pImageVideoSrc;
+    /* Determine framework type that can handle recording */
+    fwType = (FWMgrFwType)FWMgrMOUnknown;
+    /**/
+    if (pDataSnk->pLocator)
+    {
+        XADataLocator_URI* dataLoc = (XADataLocator_URI*)pDataSnk->pLocator;
+        if (dataLoc->locatorType == XA_DATALOCATOR_URI)
+            {
+            uri = (char*)dataLoc->URI;
+            }
+    }
+    fwType = XAFrameworkMgr_GetFramework(
+                        mapper,
+                        uri,
+                        FWMgrMORecorder);
+
+    if (fwType == FWMgrMOUnknown)
+        {
+        ret = XA_RESULT_CONTENT_UNSUPPORTED;
+        XAObjectItfImpl_Destroy((XAObjectItf)&(pBaseObj));
+        XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaRecorder );
+        DEBUG_API("<-XAMediaRecorderImpl_CreateMediaRecorder");
+        return ret;
+        }
     
     /* 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)
+    if(fwType == FWMgrFWMMF)
     {    
         
-       pImpl->adaptationCtxMMF = XAMediaRecorderAdaptMMF_Create(pImpl->audioSrc,
-                                                             pImpl->imageVideoSrc,
-                                                             pImpl->dataSnk,
-                                                             pImpl->recModes);      
+       pImpl->adaptationCtx = 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
     }
 
-
+    if(pImpl->adaptationCtx)
+        {
+        pImpl->adaptationCtx->capslist = capabilities;
+        pImpl->adaptationCtx->fwtype = fwType;
+        }
+    else
+        {
+        ret = XA_RESULT_MEMORY_FAILURE;
+        XAObjectItfImpl_Destroy((XAObjectItf)&(pBaseObj));
+        XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaRecorder );
+        DEBUG_API("<-XAMediaRecorderImpl_CreateMediaRecorder");
+        return ret;
+        }
+    
     XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaRecorder );
     DEBUG_API("<-XAMediaRecorderImpl_CreateMediaRecorder");
     return XA_RESULT_SUCCESS;
@@ -328,7 +363,7 @@
     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 );
@@ -343,15 +378,13 @@
     }
 
     /* init adaptation */
-    if(pObjImpl->isMMFRecord)
+    if(pObjImpl->adaptationCtx->fwtype == FWMgrFWMMF)
     {
-       ret = XAMediaRecorderAdaptMMF_PostInit( pObjImpl->adaptationCtxMMF );
+       ret = XAMediaRecorderAdaptMMF_PostInit( (XAAdaptationMMFCtx*)pObjImpl->adaptationCtx );
     }
     else
     {
-#ifdef _GSTREAMER_BACKEND_
-       ret = XAMediaRecorderAdapt_PostInit( pObjImpl->adaptationCtx );
-#endif
+       ret = XAMediaRecorderAdapt_PostInit( (XAAdaptationGstCtx*)pObjImpl->adaptationCtx );
     }
 
     if( ret != XA_RESULT_SUCCESS )
@@ -381,48 +414,23 @@
                     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
-                            );
+                    pItf = XAAudioEncoderItfImpl_Create(pObjImpl);
                     break;
                 case MR_SNAPSHOTITF:
-                    pItf = XASnapshotItfImpl_Create(
-#ifdef _GSTREAMER_BACKEND_
-                            pObjImpl->adaptationCtx
-#endif
-                            );
+                    pItf = XASnapshotItfImpl_Create(pObjImpl);
                     break;
                 case MR_VIDEOENCODER:
-                    pItf = XAVideoEncoderItfImpl_Create(
-#ifdef _GSTREAMER_BACKEND_
-                            pObjImpl->adaptationCtx
-#endif
-                            );
+                    pItf = XAVideoEncoderItfImpl_Create(pObjImpl);
                     break;  
                 case MR_IMAGEENCODERITF:
-                    pItf = XAImageEncoderItfImpl_Create(
-#ifdef _GSTREAMER_BACKEND_
-                            pObjImpl->adaptationCtx
-#endif
-                            );
+                    pItf = XAImageEncoderItfImpl_Create(pObjImpl);
                     break; 
                 case MR_METADATAINSERTIONITF:
-                    pItf = XAMetadataInsertionItfImpl_Create(
-#ifdef _GSTREAMER_BACKEND_
-                            pObjImpl->adaptationCtx
-#endif
-                            );
+                    pItf = XAMetadataInsertionItfImpl_Create(pObjImpl);
                     break;                    
-#ifdef _GSTREAMER_BACKEND_
+
                     case MR_CONFIGEXTENSIONITF:
                     pItf = XAConfigExtensionsItfImpl_Create();
                     XAConfigExtensionsItfImpl_SetContext( pItf, pObjImpl->adaptationCtx);
@@ -448,7 +456,7 @@
                 case MR_METADATATRAVERSALITF:
                     pItf = XAMetadataTraversalItfImpl_Create( pObjImpl->adaptationCtx );
                     break;
-#endif                    
+                    
                 default:
                     break;
             }
@@ -491,13 +499,11 @@
     XAObjectItfImpl* pObj = (XAObjectItfImpl*)(*self);
     XAMediaRecorderImpl* pObjImpl = (XAMediaRecorderImpl*)(pObj);
     XAuint8 itfIdx;
-
+    XAMediaRecorderImpl* pImpl = (XAMediaRecorderImpl*)(*self);
     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++)
     {
@@ -558,14 +564,19 @@
         }
     }
 
-#ifdef _GSTREAMER_BACKEND_
     if ( pImpl->adaptationCtx != NULL )
     {
-        XAMediaRecorderAdapt_Destroy( pImpl->adaptationCtx );
+        if(pImpl->adaptationCtx->fwtype == FWMgrFWMMF)
+            {
+            XAMediaRecorderAdaptMMF_Destroy( (XAAdaptationMMFCtx*)pObjImpl->adaptationCtx );
+            }
+        else
+            {
+            XAMediaRecorderAdapt_Destroy( (XAAdaptationGstCtx*)pImpl->adaptationCtx );
+            }
         pImpl->adaptationCtx = NULL;
     }
-#endif
-    XAMediaRecorderAdaptMMF_Destroy( pObjImpl->adaptationCtxMMF );
+
     /* free all other allocated resources*/
 
     DEBUG_API("<-XAMediaRecorderImpl_FreeResources");
@@ -582,10 +593,10 @@
  */
 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");
@@ -597,20 +608,15 @@
         {
 
         case MR_METADATAINSERTIONITF:
-            mapEntry->pItf = XAMetadataInsertionItfImpl_Create(
-#ifdef _GSTREAMER_BACKEND_
-                    pImpl->adaptationCtx
-#endif
-                    );
+            mapEntry->pItf = XAMetadataInsertionItfImpl_Create(pImpl);
             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;
@@ -686,36 +692,5 @@
     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 */
--- a/khronosfws/openmax_al/src/mediarecorder/xamediarecorder.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/mediarecorder/xamediarecorder.h	Fri May 14 16:22:35 2010 +0300
@@ -21,10 +21,8 @@
 #include "openmaxalwrapper.h"
 #include "xaglobals.h"
 #include "xaobjectitf.h"
-#ifdef _GSTREAMER_BACKEND_
-#include "XAMediaRecorderAdaptCtx.h"
-#endif
-#include "xamediarecorderadaptctxmmf.h"
+#include "xaadptbasectx.h"
+#include "xacapabilitiesmgr.h"
 
 /** MACROS **/
 
@@ -67,12 +65,7 @@
     XADataSource *imageVideoSrc;
     XADataSink *dataSnk;
     XAuint8 recModes;
-    XAboolean isMMFRecord;    
-
-#ifdef _GSTREAMER_BACKEND_
     XAAdaptationBaseCtx* adaptationCtx;
-#endif
-    XAAdaptationBaseMMFCtx* adaptationCtxMMF;    
 
 } XAMediaRecorderImpl;
 
@@ -85,8 +78,6 @@
 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  );
--- a/khronosfws/openmax_al/src/mediarecorder/xametadatainsertionitf.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/mediarecorder/xametadatainsertionitf.c	Fri May 14 16:22:35 2010 +0300
@@ -19,9 +19,9 @@
 #include <stdlib.h>
 #include <assert.h>
 #include "xametadatainsertionitf.h"
-#ifdef _GSTREAMER_BACKEND_
-#include "XAMetadataAdaptation.h"
-#endif
+
+#include "xametadataadaptation.h"
+
 #define MAX_TAGS 255
 /* XAMetadataInsertionItfImpl* GetImpl(XAMetadataInsertionItf self)
  * Description: Validate interface pointer and cast it to implementation pointer.
@@ -65,22 +65,26 @@
     }
     else
     {
-#ifdef _GSTREAMER_BACKEND_
-        if( impl->adaptCtx )
-        {
-            ret = XAMetadataInsertionItfAdapt_CreateChildNode(
-                    impl->adaptCtx,parentNodeID,type,mimeType,pChildNodeID);
-        }
-        else
+
+    if(impl->adaptCtx && impl->adaptCtx->fwtype == FWMgrFWGST)
         {
-            ret = XA_RESULT_INTERNAL_ERROR;
+        if(impl->adaptCtx)
+            {
+                ret = XAMetadataInsertionItfAdapt_CreateChildNode(
+                        (XAAdaptationGstCtx*)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;    
+    else
+        {
+        DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED");
+        DEBUG_API("<-XAMetadataInsertionItfImpl_CreateChildNode");
+        return XA_RESULT_FEATURE_UNSUPPORTED; 
+        }
     }
     DEBUG_API("<-XAMetadataInsertionItfImpl_CreateChildNode");
     return ret;
@@ -109,23 +113,24 @@
     }
     else
     {
-#ifdef _GSTREAMER_BACKEND_
+    if(impl->adaptCtx && impl->adaptCtx->fwtype == FWMgrFWGST)
+        {
         if( impl->adaptCtx )
-        {
+            {
             ret = XAMetadataInsertionItfAdapt_GetSupportedKeysCount(
-                    impl->adaptCtx,nodeID,pFreeKeys,pKeyCount,pEncodingCount);
-        }
+                    (XAAdaptationGstCtx*)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;     
+    else
+        {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAMetadataInsertionItfImpl_GetSupportedKeysCount");
+        return XA_RESULT_PARAMETER_INVALID;     
+        }
     }
     DEBUG_API("<-XAMetadataInsertionItfImpl_GetSupportedKeysCount");
     return ret;
@@ -153,23 +158,25 @@
     }
     else
     {
-#ifdef _GSTREAMER_BACKEND_
+    if(impl->adaptCtx && impl->adaptCtx->fwtype == FWMgrFWGST)
+        {
+
         if( impl->adaptCtx )
-        {
+            {
             ret = XAMetadataInsertionItfAdapt_GetKeySize(
-                        impl->adaptCtx, nodeID, keyIndex, pKeySize);
-        }
+                    (XAAdaptationGstCtx*)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;          
+    else
+        {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAMetadataInsertionItfImpl_GetKeySize");
+        return XA_RESULT_PARAMETER_INVALID;   
+        }
     }
     DEBUG_API("<-XAMetadataInsertionItfImpl_GetKeySize");
     return ret;
@@ -198,23 +205,26 @@
     }
     else
     {
-#ifdef _GSTREAMER_BACKEND_
+    if(impl->adaptCtx && impl->adaptCtx->fwtype == FWMgrFWGST)
+        {
+
         if( impl->adaptCtx )
-        {
+            {
             ret = XAMetadataInsertionItfAdapt_GetKey(
-                    impl->adaptCtx,nodeID,keyIndex,keySize,pKey);
-        }
+                    (XAAdaptationGstCtx*)impl->adaptCtx,nodeID,keyIndex,keySize,pKey);
+            }
         else
-        {
+            {
             ret = XA_RESULT_INTERNAL_ERROR;
+            }
         }
-#endif
-    /*******************************************/
-    /****This is being done since mmf does not 
-     * support metadata Insertion
-     *******************************************/
+    else
+        {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAMetadataInsertionItfImpl_GetKey");
+        return XA_RESULT_PARAMETER_INVALID;   
+        }    
 
-    ret = XA_RESULT_PARAMETER_INVALID;         
     }
     DEBUG_API("<-XAMetadataInsertionItfImpl_GetKey");
     return ret;
@@ -242,23 +252,25 @@
     }
     else
     {
-#ifdef _GSTREAMER_BACKEND_
+    if(impl->adaptCtx && impl->adaptCtx->fwtype == FWMgrFWGST)
+        {
+
         if( impl->adaptCtx )
-        {
+            {
             ret = XAMetadataInsertionItfAdapt_GetFreeKeysEncoding(
-                    impl->adaptCtx,nodeID,encodingIndex,pEncoding);
-        }
+                    (XAAdaptationGstCtx*)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;         
+    else
+        {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XAMetadataInsertionItfImpl_GetFreeKeysEncoding");
+        return XA_RESULT_PARAMETER_INVALID;   
+        }        
     }
     DEBUG_API("<-XAMetadataInsertionItfImpl_GetFreeKeysEncoding");
     return ret;
@@ -286,27 +298,28 @@
     }
     else
     {
-#ifdef _GSTREAMER_BACKEND_
-        if( impl->adaptCtx )
+    if(impl->adaptCtx && impl->adaptCtx->fwtype == FWMgrFWGST)
         {
+
+        if( impl->adaptCtx )
+            {
             ret = XAMetadataInsertionItfAdapt_InsertMetadataItem(
-                    impl->adaptCtx,nodeID,pKey,pValue,overwrite);
-            /*store pointers for callback*/
+                    (XAAdaptationGstCtx*)impl->adaptCtx,nodeID,pKey,pValue,overwrite);
             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;         
+    else
+        {
+        DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED");
+        DEBUG_API("<-XAMetadataInsertionItfImpl_GetFreeKeysEncoding");
+        return XA_RESULT_FEATURE_UNSUPPORTED;   
+        }            
     }
     DEBUG_API("<-XAMetadataInsertionItfImpl_InsertMetadataItem");
     return ret;
@@ -331,20 +344,19 @@
         /* invalid parameter */
         return XA_RESULT_PARAMETER_INVALID;
     }
-#ifdef _GSTREAMER_BACKEND_
+
     if(callback)
     {
         XAAdaptationBase_AddEventHandler( impl->adaptCtx, &XAMetadataInsertionItfImpl_AdaptCb,
                                           XA_METADATAEVENTS, impl );
+        impl->callback = callback;
+        impl->cbcontext  = pContext;
+        impl->cbPtrToSelf = self;
     }
     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;
@@ -358,36 +370,35 @@
 /* XAMetadataInsertionItfImpl* XAMetadataInsertionItfImpl_Create()
  * Description: Allocate and initialize MetadataInsertionItfImpl
  */
-XAMetadataInsertionItfImpl* XAMetadataInsertionItfImpl_Create(
-#ifdef _GSTREAMER_BACKEND_
-        XAAdaptationBaseCtx *adaptCtx
-#endif
-        )
+XAMetadataInsertionItfImpl* XAMetadataInsertionItfImpl_Create(XAMediaRecorderImpl* impl)
 {
     XAMetadataInsertionItfImpl* self = (XAMetadataInsertionItfImpl*)
         calloc(1,sizeof(XAMetadataInsertionItfImpl));
+    //XAMediaRecorderAdaptationCtx* mCtx = (XAMediaRecorderAdaptationCtx*)(impl->adaptationCtx);
+    
     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;
+        //if(mCtx->fwtype == FWMgrFWGST)
+            {
+            /* 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->adaptCtx = impl->adaptationCtx;
         self->currentTags.mdeKeys = calloc(MAX_TAGS,sizeof(XAMetadataInfo*));
         self->currentTags.mdeValues = calloc(MAX_TAGS,sizeof(XAMetadataInfo*));
-#endif
         self->self = self;
 
     }
@@ -404,17 +415,13 @@
     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 )
@@ -460,4 +467,3 @@
     DEBUG_API("<-XAMetadataInsertionItfImpl_AdaptCb");
 }
 
-#endif
--- a/khronosfws/openmax_al/src/mediarecorder/xametadatainsertionitf.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/mediarecorder/xametadatainsertionitf.h	Fri May 14 16:22:35 2010 +0300
@@ -18,12 +18,9 @@
 #ifndef XAMETADATAINSERTIONITF_H
 #define XAMETADATAINSERTIONITF_H
 
-#include "openmaxalwrapper.h"
-#include "xaglobals.h"
-#ifdef _GSTREAMER_BACKEND_
-#include "XAAdaptationContextBase.h"
-#include "XAMetadataAdaptation.h"
-#endif
+
+#include "xametadataadaptation.h"
+#include "xamediarecorder.h"
 /** MACROS **/
 
 /** TYPES **/
@@ -39,11 +36,10 @@
     /* pointer to self */
     struct XAMetadataInsertionItfImpl_* self;
 
-#ifdef _GSTREAMER_BACKEND_
     /* variables */
     XAAdaptationBaseCtx *adaptCtx;
     XAMetadataImplTagList   currentTags;
-#endif
+
     /*Callback*/
     xaMetadataInsertionCallback callback;
     void    *cbcontext;
@@ -93,16 +89,8 @@
                                                      void *pContext);
 
 /* XAMetadataInsertionItfImpl -specific methods */
-XAMetadataInsertionItfImpl* XAMetadataInsertionItfImpl_Create(
-#ifdef _GSTREAMER_BACKEND_
-        XAAdaptationBaseCtx *adaptCtx,
-#else
-        void
-#endif
-        );
-#ifdef _GSTREAMER_BACKEND_
+XAMetadataInsertionItfImpl* XAMetadataInsertionItfImpl_Create(XAMediaRecorderImpl* impl);
 void XAMetadataInsertionItfImpl_AdaptCb( void *pHandlerCtx, XAAdaptEvent *event );
-#endif
 void XAMetadataInsertionItfImpl_Free(XAMetadataInsertionItfImpl* self);
 
 #endif /* XAMETADATAINSERTIONITF_H */
--- a/khronosfws/openmax_al/src/mediarecorder/xarecorditf.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/mediarecorder/xarecorditf.c	Fri May 14 16:22:35 2010 +0300
@@ -19,9 +19,9 @@
 #include <stdlib.h>
 #include <assert.h>
 #include "xarecorditf.h"
-#ifdef _GSTREAMER_BACKEND_
-#include "XARecordItfAdaptation.h"
-#endif
+
+#include "xarecorditfadaptation.h"
+
 #include "xarecorditfadaptationmmf.h"
 #include "xathreadsafety.h"
 #include <string.h>
@@ -69,15 +69,13 @@
     /* check is play state changed, if not do nothing */
     if(state != impl->recordState)
     {
-        if(impl->isMMFRecord)
+        if(impl->adapCtx->fwtype == FWMgrFWMMF)
         {
-           ret = XARecordItfAdaptMMF_SetRecordState(impl->adaptCtxMMF, state);
+           ret = XARecordItfAdaptMMF_SetRecordState((XAAdaptationMMFCtx*)impl->adapCtx, state);
         }
         else
         {
-#ifdef _GSTREAMER_BACKEND_
-           ret = XARecordItfAdapt_SetRecordState(impl->adapCtx, state);
-#endif
+           ret = XARecordItfAdapt_SetRecordState((XAAdaptationGstCtx*)impl->adapCtx, state);
         }
 
         if(ret == XA_RESULT_SUCCESS)
@@ -139,15 +137,13 @@
 
     impl->durationLimitSetted = 1;
     impl->durationLimit = msec;
-    if(!(impl->isMMFRecord))
+    if(impl->adapCtx->fwtype == FWMgrFWGST)
     {
-#ifdef _GSTREAMER_BACKEND_
-       ret = XARecordItfAdapt_EnablePositionTracking( impl->adapCtx, 1 );
-#endif
+       ret = XARecordItfAdapt_EnablePositionTracking( (XAAdaptationGstCtx*)impl->adapCtx, 1 );
     }
     else
     {
-    ret = XARecordItfAdaptMMF_EnablePositionTracking( impl->adaptCtxMMF, 1 );
+    ret = XARecordItfAdaptMMF_EnablePositionTracking( (XAAdaptationMMFCtx*)impl->adapCtx, 1 );
     }
 
 
@@ -179,16 +175,13 @@
     }
 
     
-    if(!(impl->isMMFRecord))
+    if(impl->adapCtx->fwtype == FWMgrFWGST)
     {
-    
-#ifdef _GSTREAMER_BACKEND_
-    ret = XARecordItfAdapt_GetPosition(impl->adapCtx, pMsec);
-#endif
+    ret = XARecordItfAdapt_GetPosition((XAAdaptationGstCtx*)impl->adapCtx, pMsec);
     }
     else
     {
-    ret = XARecordItfAdaptMMF_GetPosition(impl->adaptCtxMMF, pMsec);
+    ret = XARecordItfAdaptMMF_GetPosition((XAAdaptationMMFCtx*)impl->adapCtx, pMsec);
     }
 
     XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaRecorder);
@@ -259,14 +252,13 @@
 
     impl->eventFlags = eventFlags;
     
-    if(!(impl->isMMFRecord))
+    if(impl->adapCtx->fwtype == FWMgrFWGST)
         {
-#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);
+                ret = XARecordItfAdapt_EnablePositionTracking((XAAdaptationGstCtx*)impl->adapCtx, XA_BOOLEAN_TRUE);
                 if( ret == XA_RESULT_SUCCESS )
                 {
                     impl->positionupdateOn = XA_BOOLEAN_TRUE;
@@ -275,30 +267,29 @@
             else if( !(eventFlags & (XA_RECORDEVENT_HEADATMARKER | XA_RECORDEVENT_HEADATNEWPOS))
                     &&  impl->adapCtx && impl->positionupdateOn)
             {
-                ret = XARecordItfAdapt_EnablePositionTracking(impl->adapCtx, XA_BOOLEAN_FALSE);
+                ret = XARecordItfAdapt_EnablePositionTracking((XAAdaptationGstCtx*)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)
+                &&  impl->adapCtx && !impl->positionupdateOn)
             {
-                ret = XARecordItfAdaptMMF_EnablePositionTracking(impl->adaptCtxMMF, XA_BOOLEAN_TRUE);
+                ret = XARecordItfAdaptMMF_EnablePositionTracking((XAAdaptationMMFCtx*)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->adaptCtxMMF && impl->positionupdateOn)
+                    &&  impl->adapCtx && impl->positionupdateOn)
             {
-                ret = XARecordItfAdaptMMF_EnablePositionTracking(impl->adaptCtxMMF, XA_BOOLEAN_FALSE);
+                ret = XARecordItfAdaptMMF_EnablePositionTracking((XAAdaptationMMFCtx*)impl->adapCtx, XA_BOOLEAN_FALSE);
                 if( ret == XA_RESULT_SUCCESS )
                 {
                     impl->positionupdateOn = XA_BOOLEAN_FALSE;
@@ -478,14 +469,12 @@
  * XARecordItfImpl* XARecordItfImpl_Create()
  * Description: Allocate and initialize XARecordItfImpl
  **/
-XARecordItfImpl* XARecordItfImpl_Create( 
-#ifdef _GSTREAMER_BACKEND_
-        XAAdaptationBaseCtx *adapCtx,
-#endif
-        XAMediaRecorderImpl* impl )
+XARecordItfImpl* XARecordItfImpl_Create( XAMediaRecorderImpl* impl )
 {
     XARecordItfImpl* self = (XARecordItfImpl*)
         calloc(1,sizeof(XARecordItfImpl));
+    
+    
     DEBUG_API("->XARecordItfImpl_Create");
     if( self )
     {
@@ -513,14 +502,10 @@
         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->adapCtx = impl->adaptationCtx;
+        XAAdaptationBase_AddEventHandler( impl->adaptationCtx, &XARecordItfImpl_AdaptCb, XA_RECORDITFEVENTS, self );
         self->self = self;
     }
     DEBUG_API("<-XARecordItfImpl_Create");
@@ -535,15 +520,11 @@
 {
     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
  */
@@ -594,9 +575,9 @@
         /* Check have we reached record duration limit */
         if ( impl->durationLimitSetted)
         {
-            if ( impl->lastPosition >= impl->durationLimit )
+            if ( impl->callback && (impl->lastPosition >= impl->durationLimit ))
             {
-                XARecordItfImpl_SetRecordState( impl->cbPtrToSelf,XA_RECORDSTATE_STOPPED );
+                impl->itf.SetRecordState(impl->cbPtrToSelf,XA_RECORDSTATE_STOPPED);
                 impl->callback(impl->cbPtrToSelf, impl->cbcontext, XA_RECORDEVENT_HEADATLIMIT);
             }
         }
@@ -635,129 +616,4 @@
 
     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");
-}
--- a/khronosfws/openmax_al/src/mediarecorder/xarecorditf.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/mediarecorder/xarecorditf.h	Fri May 14 16:22:35 2010 +0300
@@ -20,10 +20,7 @@
 
 #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
@@ -60,12 +57,8 @@
     void*            context;
     XARecordItf      cbPtrToSelf;
 
-#ifdef _GSTREAMER_BACKEND_
     /*Adaptation variables*/
     XAAdaptationBaseCtx *adapCtx;
-#endif
-    XAAdaptationBaseMMFCtx *adaptCtxMMF;
-    XAboolean isMMFRecord;    
 
 } XARecordItfImpl;
 
@@ -111,15 +104,9 @@
                                                   XAmillisecond *pMsec );
 
 /* XARecordItfImpl -specific methods */
-XARecordItfImpl* XARecordItfImpl_Create( 
-#ifdef _GSTREAMER_BACKEND_
-        XAAdaptationBaseCtx *adapCtx,
+XARecordItfImpl* XARecordItfImpl_Create( XAMediaRecorderImpl* impl );
+void XARecordItfImpl_Free( XARecordItfImpl* self );
+void XARecordItfImpl_AdaptCb( void *pHandlerCtx, XAAdaptEvent *event );
+
 #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 */
+ /* XARECORDITF_H */
--- a/khronosfws/openmax_al/src/mediarecorder/xasnapshotitf.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/mediarecorder/xasnapshotitf.c	Fri May 14 16:22:35 2010 +0300
@@ -19,9 +19,9 @@
 #include <stdlib.h>
 #include <assert.h>
 #include "xasnapshotitf.h"
-#ifdef _GSTREAMER_BACKEND_
-#include "XASnapShotItfAdaptation.h"
-#endif
+
+#include "xasnapshotitfadaptation.h"
+
 #include "xathreadsafety.h"
 #include "xaplayitf.h"
 #include "xaglobals.h"
@@ -84,65 +84,73 @@
         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)");
+    if(impl->adapCtx && impl->adapCtx->fwtype == FWMgrFWGST)
+        {
+        XASnapshotItfAdaptation_GetBurstFPSRange((XAAdaptationGstCtx*)impl->adapCtx,&minF,&maxF);
+        XASnapshotItfAdaptation_GetMaxPicsPerBurst((XAAdaptationGstCtx*)impl->adapCtx,&maxP);
+    
+        /*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;
+    
+    
+        if( impl->initongoing ||
+            impl->initialized ||
+            impl->snapshotongoing )
+        {
+            res = XASnapshotItfAdaptation_CancelSnapshot((XAAdaptationGstCtx*)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((XAAdaptationGstCtx*)impl->adapCtx,
+                                                           numberOfPictures,
+                                                           fps,
+                                                           freezeViewFinder,
+                                                           &sink);
+            }
+        else
+            {
+            res = XA_RESULT_INTERNAL_ERROR;
+            }
+    
+        }
+    else
+        {
+        DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED");
         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;
-    }
+        res = XA_RESULT_FEATURE_UNSUPPORTED;      
+        }
 
-    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;
@@ -169,45 +177,53 @@
         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 )
+    if(impl->adapCtx && impl->adapCtx->fwtype == FWMgrFWGST)
         {
-            impl->takencallback(impl->cbPtrToSelf, impl->usercontext,
-                                impl->numberofpictures, NULL);
+        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;
+            }
+        /*Inform adaptation to take snapshot*/
+        else if( impl->adapCtx )
+            {
+            impl->snapshotongoing = XA_BOOLEAN_TRUE;
+            res = XASnapshotItfAdaptation_TakeSnapshot((XAAdaptationGstCtx*)impl->adapCtx);
+            if( res!=XA_RESULT_SUCCESS )
+                {
+                DEBUG_ERR_A1("Adaptation returns error %d taking snapshot!", (int)res);
+                impl->snapshotongoing = XA_BOOLEAN_FALSE;
+                }
+            }
+        else
+            {
+            res = XA_RESULT_INTERNAL_ERROR;
+            DEBUG_ERR("XASnapshotItfImpl_TakeSnapshot"
+                    "-XA_RESULT_INTERNAL_ERROR ");
+            }
+    
         }
-        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 )
+    else
         {
-            DEBUG_ERR_A1("Adaptation returns error %d taking snapshot!", (int)res);
-            impl->snapshotongoing = XA_BOOLEAN_FALSE;
+        DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED");
+        DEBUG_API("<-XASnapshotItfImpl_TakeSnapshot");
+        res = XA_RESULT_FEATURE_UNSUPPORTED;      
         }
-    }
-#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");
@@ -235,26 +251,33 @@
         /* invalid parameter */
         res = XA_RESULT_PARAMETER_INVALID;
     }
-
-    if( impl->initongoing ||
-        impl->snapshotongoing ||
-        impl->initialized )
-    {
-#ifdef _GSTREAMER_BACKEND_
-        if( impl->adapCtx )
+    if(impl->adapCtx && impl->adapCtx->fwtype == FWMgrFWGST)
         {
-            res = XASnapshotItfAdaptation_CancelSnapshot(impl->adapCtx);
+        if( impl->initongoing ||
+            impl->snapshotongoing ||
+            impl->initialized )
+            {
+            if( impl->adapCtx )
+                {
+                res = XASnapshotItfAdaptation_CancelSnapshot((XAAdaptationGstCtx*)impl->adapCtx);
+                }
+            else
+                {
+                DEBUG_ERR("No adaptation context!!");
+                res = XA_RESULT_INTERNAL_ERROR;
+                }
+            impl->initongoing = XA_BOOLEAN_FALSE;
+            impl->snapshotongoing = XA_BOOLEAN_FALSE;
+            impl->initialized = XA_BOOLEAN_FALSE;
+            }
+    
         }
-        else
+    else
         {
-            DEBUG_ERR("No adaptation context!!");
-            res = XA_RESULT_INTERNAL_ERROR;
+        DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED");
+        DEBUG_API("<-XASnapshotItfImpl_CancelSnapshot");
+        res = XA_RESULT_FEATURE_UNSUPPORTED;         
         }
-#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);
@@ -277,24 +300,34 @@
         /* invalid parameter */
         res =  XA_RESULT_PARAMETER_INVALID;
     }
-    if( image && (image->pLocator) &&
+    if(impl->adapCtx && impl->adapCtx->fwtype == FWMgrFWGST)
+        {
+        if( image && (image->pLocator) &&
         *((XAuint32*)(image->pLocator)) == XA_DATALOCATOR_ADDRESS )
-    {
-        if( ((XADataLocator_Address*)(image->pLocator))->pAddress )
-        {
-            free(((XADataLocator_Address*)(image->pLocator))->pAddress);
+            {
+            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;
+            }
         }
-        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_ERR("XA_RESULT_FEATURE_UNSUPPORTED");
+        DEBUG_API("<-XASnapshotItfImpl_ReleaseBuffers");
+        res = XA_RESULT_FEATURE_UNSUPPORTED;     
+        }
+    
     DEBUG_API("<-XASnapshotItfImpl_ReleaseBuffers");
     return res;
 }
@@ -319,19 +352,26 @@
         DEBUG_API("<-XASnapshotItfImpl_GetMaxPicsPerBurst");
         return XA_RESULT_PARAMETER_INVALID;
     }
-
-#ifdef _GSTREAMER_BACKEND_
-    if( impl->adapCtx )
-    {
-        res = XASnapshotItfAdaptation_GetMaxPicsPerBurst(impl->adapCtx, maxNumberOfPictures);
-    }
+    if(impl->adapCtx && impl->adapCtx->fwtype == FWMgrFWGST)
+        {
+        if( impl->adapCtx )
+            {
+            res = XASnapshotItfAdaptation_GetMaxPicsPerBurst((XAAdaptationGstCtx*)impl->adapCtx, maxNumberOfPictures);
+            }
+        else
+            {
+            XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaRecorder);
+            DEBUG_API("<-XASnapshotItfImpl_GetMaxPicsPerBurst");
+            return XA_RESULT_INTERNAL_ERROR;
+            }
+        }
     else
-    {
-        XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaRecorder);
+        {
+        DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED");
         DEBUG_API("<-XASnapshotItfImpl_GetMaxPicsPerBurst");
-        return XA_RESULT_INTERNAL_ERROR;
-    }
-#endif
+        res = XA_RESULT_FEATURE_UNSUPPORTED;     
+        }
+    
     XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaRecorder);
     DEBUG_API("<-XASnapshotItfImpl_GetMaxPicsPerBurst");
     return res;
@@ -361,18 +401,25 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
-    if( impl->adapCtx )
-    {
-        res = XASnapshotItfAdaptation_GetBurstFPSRange(impl->adapCtx,minFPS,maxFPS);
-    }
+    if(impl->adapCtx && impl->adapCtx->fwtype == FWMgrFWGST)
+        {
+        if( impl->adapCtx )
+            {
+            res = XASnapshotItfAdaptation_GetBurstFPSRange((XAAdaptationGstCtx*)impl->adapCtx,minFPS,maxFPS);
+            }
+        else
+            {
+            XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaRecorder);
+            DEBUG_API("<-XASnapshotItfImpl_GetBurstFPSRange");
+            return XA_RESULT_INTERNAL_ERROR;
+            }
+        }
     else
-    {
-        XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaRecorder);
+        {
+        DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED");
         DEBUG_API("<-XASnapshotItfImpl_GetBurstFPSRange");
-        return XA_RESULT_INTERNAL_ERROR;
-    }
-#endif
+        res = XA_RESULT_FEATURE_UNSUPPORTED; 
+        }
     XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaRecorder);
     DEBUG_API("<-XASnapshotItfImpl_GetBurstFPSRange");
     return res;
@@ -397,14 +444,21 @@
         res = XA_RESULT_PARAMETER_INVALID;
     }
     impl->shutterfeedback = enabled;
+    if(impl->adapCtx && impl->adapCtx->fwtype == FWMgrFWGST)
+        {
+        if( impl->adapCtx )
+            {
+            /*Inform adaptation about shutter feedback */
+            res = XASnapshotItfAdaptation_SetShutterFeedback((XAAdaptationGstCtx*)impl->adapCtx, enabled);
+            }           
+        }
+    else
+        {
+        DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED");
+        DEBUG_API("<-XASnapshotItfImpl_GetBurstFPSRange");
+        res = XA_RESULT_FEATURE_UNSUPPORTED; 
+        }
     
-#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;
@@ -441,14 +495,12 @@
  * XASnapshotItfImpl* XASnapshotItfImpl_Create()
  * Description: Allocate and initialize SnapshotItfImpl
  **/
-XASnapshotItfImpl* XASnapshotItfImpl_Create(
-#ifdef _GSTREAMER_BACKEND_
-        XAAdaptationBaseCtx *adaptCtx
-#endif
-        )
+XASnapshotItfImpl* XASnapshotItfImpl_Create(XAMediaRecorderImpl* impl)
 {
     XASnapshotItfImpl* self = (XASnapshotItfImpl*)
         calloc(1,sizeof(XASnapshotItfImpl));
+    
+   
     DEBUG_API("->XASnapshotItfImpl_Create");
     if( self )
     {
@@ -463,17 +515,13 @@
         self->itf.TakeSnapshot = XASnapshotItfImpl_TakeSnapshot;
 
         /* init variables */
-#ifdef _GSTREAMER_BACKEND_
-        self->adapCtx = adapCtx;
-#endif
+        self->adapCtx = impl->adaptationCtx;
         self->self = self;
         self->cbPtrToSelf = NULL;
     }
 
-#ifdef _GSTREAMER_BACKEND_
     /* Add call back function to eventhandler. */
-    XAAdaptationBase_AddEventHandler( adapCtx, &XASnapshotItfImpl_AdaptCb, XA_SNAPSHOTITFEVENTS, self );
-#endif
+    XAAdaptationBase_AddEventHandler( impl->adaptationCtx, &XASnapshotItfImpl_AdaptCb, XA_SNAPSHOTITFEVENTS, self );
     DEBUG_API("<-XASnapshotItfImpl_Create");
     return self;
 }
@@ -489,17 +537,12 @@
     /*
      * Free all resources reserved at XASnapshotItfImpl_Create
      */
-#ifdef _GSTREAMER_BACKEND_
-    if( self->adapCtx )
-    {
-        XASnapshotItfAdaptation_CancelSnapshot(self->adapCtx);
-    }
+    self->itf.CancelSnapshot(self->cbPtrToSelf);
     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
@@ -551,5 +594,4 @@
     }
     DEBUG_API("<-XASnapshotItfImpl_AdaptCb");
 }
-#endif
 /*End of file*/
--- a/khronosfws/openmax_al/src/mediarecorder/xasnapshotitf.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/mediarecorder/xasnapshotitf.h	Fri May 14 16:22:35 2010 +0300
@@ -19,11 +19,9 @@
 #define XASNAPSHOTITF_H
 
 #include <semaphore.h>
-#include "openmaxalwrapper.h"
-#include "xaglobals.h"
-#ifdef _GSTREAMER_BACKEND_
-#include "XAAdaptationContextBase.h"
-#endif
+
+#include "xamediarecorder.h"
+
 /** MACROS **/
 
 /** TYPES **/
@@ -52,9 +50,9 @@
     void* usercontext;
     XASnapshotItf cbPtrToSelf;
 
-#ifdef _GSTREAMER_BACKEND_
+
     XAAdaptationBaseCtx *adapCtx;
-#endif
+
     XAboolean           snapshotongoing;
     XAboolean           initongoing;
     XAboolean           initialized;
@@ -95,16 +93,8 @@
                                               XAboolean *enabled);
 
 /* XASnapshotItfImpl -specific methods */
-XASnapshotItfImpl* XASnapshotItfImpl_Create(
-#ifdef _GSTREAMER_BACKEND_
-        XAAdaptationBaseCtx *adaptCtx,
-#else
-        void
-#endif
-        );
-#ifdef _GSTREAMER_BACKEND_
+XASnapshotItfImpl* XASnapshotItfImpl_Create(XAMediaRecorderImpl* impl);
 void XASnapshotItfImpl_AdaptCb( void *pHandlerCtx, XAAdaptEvent *event );
-#endif
 void XASnapshotItfImpl_Free(XASnapshotItfImpl* self);
 
 #endif /* XASNAPSHOTITF_H */
--- a/khronosfws/openmax_al/src/mediarecorder/xavideoencoderitf.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/mediarecorder/xavideoencoderitf.c	Fri May 14 16:22:35 2010 +0300
@@ -20,11 +20,10 @@
 #include <assert.h>
 #include <string.h>
 #include "xavideoencoderitf.h"
-#ifdef _GSTREAMER_BACKEND_
-#include "XAVideoEncoderItfAdaptation.h"
-#include "XAStaticCapsAdaptation.h"
-#include "XARecordItfAdaptation.h"
-#endif
+
+#include "xavideoencoderitfadaptation.h"
+#include "xarecorditfadaptation.h"
+#include "xacapabilitiesmgr.h"
 #include "xathreadsafety.h"
 
 
@@ -55,8 +54,7 @@
                                                 XAVideoSettings *pSettings)
 {
     XAresult res = XA_RESULT_SUCCESS;
-#ifdef _GSTREAMER_BACKEND_
-    XAStaticCapsData temp;
+    XACapabilities temp;
     XAuint32 recState = XA_RECORDSTATE_STOPPED;
     XAVideoEncoderItfImpl *impl = GetImpl(self);
     DEBUG_API("->XAVideoEncoderItfImpl_SetVideoSettings");
@@ -70,34 +68,40 @@
         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(impl->adaptCtx->fwtype == FWMgrFWGST)
+        {
+        res = XACapabilitiesMgr_GetCapsById(NULL, (XACapsType)(XACAP_ENCODER|XACAP_VIDEO), pSettings->encoderId, &temp);
         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;
+            res = XARecordItfAdapt_GetRecordState( (XAAdaptationGstCtx*)impl->adaptCtx, &recState );
+            if( res == XA_RESULT_SUCCESS )
+                {
+                if( XA_RECORDSTATE_STOPPED == recState )
+                    {
+                    res = XAVideoEncoderItfAdapt_SetVideoSettings((XAAdaptationGstCtx*)impl->adaptCtx, pSettings);
+                    }
+                else
+                    {
+                    DEBUG_ERR("XA_RESULT_PRECONDITIONS_VIOLATED");
+                    res = XA_RESULT_PRECONDITIONS_VIOLATED;
+                    }
+                }
             }
+        else
+            {
+            DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED");
+            res = XA_RESULT_FEATURE_UNSUPPORTED;
+            }
+    
         }
-    }
     else
-    {
+        {
         DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED");
-        DEBUG_API("<-XAVideoEncoderItfImpl_SetVideoSettings");
-        return XA_RESULT_FEATURE_UNSUPPORTED;
-    }
+        res = XA_RESULT_FEATURE_UNSUPPORTED;     
+        }
 
     XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaRecorder);
-#endif
+
     DEBUG_API("<-XAVideoEncoderItfImpl_SetVideoSettings");
     return res;
 }
@@ -118,9 +122,16 @@
         /* invalid parameter */
         return XA_RESULT_PARAMETER_INVALID;
     }
-#ifdef _GSTREAMER_BACKEND_
-    res = XAVideoEncoderItfAdapt_GetVideoSettings(impl->adaptCtx, pSettings);
-#endif
+    if(impl->adaptCtx->fwtype == FWMgrFWGST)
+        {
+        res = XAVideoEncoderItfAdapt_GetVideoSettings((XAAdaptationGstCtx*)impl->adaptCtx, pSettings);
+        }
+    else
+        {
+        DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED");
+        res = XA_RESULT_FEATURE_UNSUPPORTED;      
+        }
+
     DEBUG_API("<-XAVideoEncoderItfImpl_GetVideoSettings");
     return res;
 }
@@ -133,11 +144,7 @@
 /* XAVideoEncoderItfImpl* XAVideoEncoderItfImpl_Create()
  * Description: Allocate and initialize VideoEncoderItfImpl
  */
-XAVideoEncoderItfImpl* XAVideoEncoderItfImpl_Create(
-#ifdef _GSTREAMER_BACKEND_
-        XAAdaptationBaseCtx *adaptCtx
-#endif
-        )
+XAVideoEncoderItfImpl* XAVideoEncoderItfImpl_Create( XAMediaRecorderImpl* impl )
 {
     XAVideoEncoderItfImpl* self = (XAVideoEncoderItfImpl*)
         calloc(1,sizeof(XAVideoEncoderItfImpl));
@@ -149,10 +156,8 @@
         self->itf.GetVideoSettings = XAVideoEncoderItfImpl_GetVideoSettings;
         self->itf.SetVideoSettings = XAVideoEncoderItfImpl_SetVideoSettings;
 
-#ifdef _GSTREAMER_BACKEND_
         /* init variables */
-        self->adaptCtx = adaptCtx;
-#endif
+        self->adaptCtx = impl->adaptationCtx;
         self->self = self;
     }
     DEBUG_API("<-XAVideoEncoderItfImpl_Create");
--- a/khronosfws/openmax_al/src/mediarecorder/xavideoencoderitf.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/mediarecorder/xavideoencoderitf.h	Fri May 14 16:22:35 2010 +0300
@@ -18,11 +18,8 @@
 #ifndef XAVIDEOENCODERITF_H
 #define XAVIDEOENCODERITF_H
 
-#include "openmaxalwrapper.h"
-#include "xaglobals.h"
-#ifdef _GSTREAMER_BACKEND_
-#include "XAAdaptationContextBase.h"
-#endif
+
+#include "xamediarecorder.h"
 /** MACROS **/
 
 /** TYPES **/
@@ -37,10 +34,10 @@
     struct XAVideoEncoderItf_ itf;
     /* pointer to self */
     struct XAVideoEncoderItfImpl_* self;
-#ifdef _GSTREAMER_BACKEND_
+
     /* variables */
     XAAdaptationBaseCtx *adaptCtx;
-#endif
+
 } XAVideoEncoderItfImpl;
 
 /** METHODS **/
@@ -56,14 +53,7 @@
 
 
 /* XAVideoEncoderItfImpl -specific methods */
-XAVideoEncoderItfImpl* XAVideoEncoderItfImpl_Create(
-#ifdef _GSTREAMER_BACKEND_
-        XAAdaptationBaseCtx *adaptCtx,
-#else
-        void
-#endif
-        );
-
+XAVideoEncoderItfImpl* XAVideoEncoderItfImpl_Create( XAMediaRecorderImpl* impl );
 void XAVideoEncoderItfImpl_Free(XAVideoEncoderItfImpl* self);
 
 #endif /* XAVIDEOENCODERITF_H */
--- a/khronosfws/openmax_al/src/metadataextractor/xametadataextractor.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/metadataextractor/xametadataextractor.c	Fri May 14 16:22:35 2010 +0300
@@ -24,11 +24,15 @@
 #include "xametadataextractionitf.h"
 #include "xametadatatraversalitf.h"
 #include "xaconfigextensionsitf.h"
-#ifdef _GSTREAMER_BACKEND_
-#include "XAMetadataAdaptCtx.h"
-#endif
+
+#include "xametadataadaptctx.h"
+#include "xacapabilitiesmgr.h"
 #include "xathreadsafety.h"
 
+#include "xaadaptationmmf.h"
+#include "xametadataadaptctxmmf.h"
+
+
 /* Static mapping of enumeration XAMetadataInterfaces to interface iids */
 static const XAInterfaceID* xaMetadataExtractorItfIIDs[MDE_ITFCOUNT]=
 {
@@ -49,7 +53,9 @@
  * Description: Create object
  * Add this method to XAGlobals.h
  */
-XAresult XAMetadataExtractorImpl_Create(XAObjectItf *pMetadataExtractor,
+XAresult XAMetadataExtractorImpl_Create(FrameworkMap* mapper,
+                                        XACapabilities* capabilities,
+                                        XAObjectItf *pMetadataExtractor,
                                         XADataSource *pDataSource,
                                         XAuint32 numInterfaces,
                                         const XAInterfaceID * pInterfaceIds,
@@ -58,6 +64,8 @@
     XAMetadataExtractorImpl* pImpl = NULL;
     XAObjectItfImpl* pBaseObj = NULL;
     XAuint8 itfIndex = 0;
+    FWMgrFwType fwType;
+    const char *uri = NULL;    
     XAresult res = XA_RESULT_SUCCESS;
 
     DEBUG_API("->XAMetadataExtractorImpl_Create");
@@ -139,29 +147,55 @@
         }
     }
 
-    /* Mark interfaces that can be handled dynamically */
+   
+    // Mark interfaces that can be handled dynamically 
     pBaseObj->interfaceMap[MDE_CONFIGEXTENSIONITF].isDynamic = XA_BOOLEAN_TRUE;
 
-    /* Set ObjectItf to point to newly created object */
+     //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
+	//store member variables
+	pImpl->dataSrc = pDataSource;
+
+	/* Determine framework type that can handle recording */
+    fwType = (FWMgrFwType)FWMgrMOUnknown;
+    /**/
+    if (pDataSource->pLocator)
+    {
+        XADataLocator_URI* dataLoc = (XADataLocator_URI*)pDataSource->pLocator;
+        if (dataLoc->locatorType == XA_DATALOCATOR_URI)
+        {
+            uri = (char*)dataLoc->URI;
+        }
+    }
+	
+    fwType = XAFrameworkMgr_GetFramework(mapper, uri, FWMgrMOPlayer);
+
+    if (fwType == FWMgrMOUnknown)
+    {
+        XAObjectItfImpl_Destroy((XAObjectItf)&(pBaseObj));
+        XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer );
+        DEBUG_API("<-XAMetadataExtractorImpl_Create");
+        return XA_RESULT_CONTENT_UNSUPPORTED;
+    }
     
-    /* This code is put here to return Feature Not Supported since adaptation is not present*/
-    /*************************************************/
-    XAObjectItfImpl_Destroy((XAObjectItf)&(pBaseObj));
+    if(fwType == FWMgrFWMMF)
+    {    
+        pImpl->adaptationCtxMMF = XAMetadataAdaptCtxMMF_Create(pDataSource);
+        
+        pImpl->curAdaptCtx = pImpl->adaptationCtxMMF;    
+    }
+    else
+    {
+		// Create metadata adaptation context 
+		pImpl->adaptationCtxGst = XAMetadataAdaptCtx_Create(pDataSource);
+       
+       	pImpl->curAdaptCtx   = pImpl->adaptationCtxGst;
+    }
+
     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;*/
+    return XA_RESULT_SUCCESS;
 }
 
 /* XAResult XAMetadataExtractorImpl_QueryNumSupportedInterfaces
@@ -258,21 +292,21 @@
                                       XAMetadataExtractorImpl_DoRemoveItf);
                     }
                     break;
-#ifdef _GSTREAMER_BACKEND_
+
                 case MDE_METADATAEXTRACTIONITF:
-                    pItf = XAMetadataExtractionItfImpl_Create( pObjImpl->adaptationCtx );
+                    pItf = XAMetadataExtractionItfImpl_Create( pObjImpl->curAdaptCtx );
                     break;
                 case MDE_METADATATRAVERSALITF:
-                    pItf = XAMetadataTraversalItfImpl_Create( pObjImpl->adaptationCtx );
+                    pItf = XAMetadataTraversalItfImpl_Create( pObjImpl->curAdaptCtx );
                     break;
                 case MDE_CONFIGEXTENSIONITF:
                     pItf = XAConfigExtensionsItfImpl_Create();
-                    XAConfigExtensionsItfImpl_SetContext( pItf, pObjImpl->adaptationCtx );
+                    XAConfigExtensionsItfImpl_SetContext( pItf, pObjImpl->curAdaptCtx );
                     break;
                 case MDE_DYNAMICSOURCEITF:
-                    pItf = XADynamicSourceItfImpl_Create( pObjImpl->adaptationCtx );
+                    pItf = XADynamicSourceItfImpl_Create( pObjImpl->curAdaptCtx );
                     break;
-#endif
+
                 default:
                     break;
             }
@@ -292,9 +326,16 @@
     }
     /*Initialize adaptation context*/
     /* init adaptation */
-#ifdef _GSTREAMER_BACKEND_
-    ret = XAMetadataAdaptCtx_PostInit( pObjImpl->adaptationCtx );
-#endif
+
+    if(pObjImpl->curAdaptCtx->fwtype == FWMgrFWMMF)
+    {
+       ret = XAMetadataAdaptCtxMMF_PostInit( (XAAdaptationMMFCtx*)pObjImpl->adaptationCtxMMF );
+    }
+    else
+    {
+	    ret = XAMetadataAdaptCtx_PostInit( (XAAdaptationGstCtx*)pObjImpl->adaptationCtxGst );
+    }
+
     if ( ret != XA_RESULT_SUCCESS )
     {
         XA_IMPL_THREAD_SAFETY_EXIT(XATSMediaPlayer);
@@ -328,12 +369,13 @@
     
     XAuint8 itfIdx = 0;
     void *pItf = NULL;
+    XAMetadataExtractorImpl* pImpl = (XAMetadataExtractorImpl*)(*self);
     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;
@@ -360,13 +402,23 @@
             pObj->interfaceMap[itfIdx].pItf = NULL;
         }
     }
-#ifdef _GSTREAMER_BACKEND_
-    if ( pImpl->adaptationCtx != NULL )
-    {
-        XAMetadataAdaptCtx_Destroy( pImpl->adaptationCtx );
-        pImpl->adaptationCtx = NULL;
-    }
-#endif
+	
+	if(pImpl->curAdaptCtx)
+	{
+		if(pImpl->curAdaptCtx->fwtype == FWMgrFWMMF)
+		{
+			XAMetadataAdaptCtxMMF_Destroy( (XAAdaptationMMFCtx*)pImpl->adaptationCtxMMF );
+			pImpl->adaptationCtxMMF = NULL;
+		}
+		else
+		{
+			XAMetadataAdaptCtx_Destroy( (XAAdaptationGstCtx*)pImpl->adaptationCtxGst );
+			pImpl->adaptationCtxGst = NULL;
+		}
+	}
+	
+	pImpl->curAdaptCtx = NULL;
+
     XA_IMPL_THREAD_SAFETY_EXIT_FOR_VOID_FUNCTIONS(XATSMediaPlayer);
     DEBUG_API("<-XAMetadataExtractorImpl_FreeResources");
     return;
@@ -381,10 +433,10 @@
  */
 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");
 
@@ -394,9 +446,9 @@
         {
             case MDE_CONFIGEXTENSIONITF:
                 mapEntry->pItf = XAConfigExtensionsItfImpl_Create();
-#ifdef _GSTREAMER_BACKEND_
-                XAConfigExtensionsItfImpl_SetContext( mapEntry->pItf, pImpl->adaptationCtx);
-#endif
+
+                XAConfigExtensionsItfImpl_SetContext( mapEntry->pItf, pImpl->adaptationCtxGst);
+
                 break;
             default:
                 DEBUG_ERR("XAMetadataExtractorImpl_DoAddItf unknown id");
--- a/khronosfws/openmax_al/src/metadataextractor/xametadataextractor.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/metadataextractor/xametadataextractor.h	Fri May 14 16:22:35 2010 +0300
@@ -21,9 +21,8 @@
 #include "openmaxalwrapper.h"
 #include "xaobjectitf.h"
 #include "xaglobals.h"
-#ifdef _GSTREAMER_BACKEND_
-#include "XAMetadataAdaptCtx.h"
-#endif
+#include "xaadptbasectx.h"
+
 
 /** MACROS **/
 
@@ -52,10 +51,13 @@
     /* Parent for XAMetadataExtractorImpl */
     XAObjectItfImpl baseObj; /* <-keep this first */
 
-#ifdef _GSTREAMER_BACKEND_
     /* variables */
-    XAAdaptationBaseCtx* adaptationCtx;
-#endif
+    XADataSource *dataSrc;
+	
+    XAAdaptationBaseCtx* curAdaptCtx;
+    XAAdaptationBaseCtx* adaptationCtxGst;
+    XAAdaptationBaseCtx* adaptationCtxMMF;
+
 } XAMetadataExtractorImpl;
 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mmf_adaptation/cmetadatautilityitf.cpp	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,996 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "cmetadatautilityitf.h"
+#include <OpenMAXAL.h>
+#include <string.h>
+#include <ctype.h>
+#include <uri8.h>
+#include "profileutilmacro.h"
+
+CMetadataUtilityItf::CMetadataUtilityItf():m_pS60Util(NULL), m_pHXUtil(NULL)
+{
+}
+
+CMetadataUtilityItf::~CMetadataUtilityItf()
+{
+	if(m_pS60Util)
+	{
+		delete m_pS60Util;
+	}
+
+	if(m_pHXUtil)
+	{
+		delete m_pHXUtil;
+	}
+}
+
+
+CMetadataUtilityItf* CMetadataUtilityItf::New(char* uri)
+{
+	CMetadataUtilityItf* p_mdutilitf = new CMetadataUtilityItf;
+	
+	TInt ret = p_mdutilitf->ParseSource(uri);
+
+	if(ret == KErrNone)
+	{
+		return p_mdutilitf; 
+	}
+
+	delete p_mdutilitf;
+	return NULL;
+}
+
+TInt CMetadataUtilityItf::OpenSource(char* pOrigUri)
+{
+    //Make a local copy for uri
+    if ( !pOrigUri )
+        return XA_RESULT_PARAMETER_INVALID;
+    
+    int uriLen = strlen(pOrigUri);
+    char* uri = new char[uriLen+1];
+    if (! uri )
+        {
+        return XA_RESULT_MEMORY_FAILURE;
+        }
+    strncpy(uri, pOrigUri, uriLen);
+    uri[uriLen] = '\0';
+    //
+
+    _LIT8(KFileSlash,"file://");
+    TInt fileslashlen = KFileSlash().Length();
+
+    TPtr8 fileuri((TUint8*)uri, strlen(uri),strlen(uri));
+    TPtr8 filepath = fileuri.RightTPtr(strlen(uri)-fileslashlen);
+ 
+    TInt pos = filepath.LocateReverse(':');
+    if(pos != KErrNotFound)
+    {
+        fileuri.Delete(fileslashlen+pos,1);
+    }
+
+    TUriParser8 localfileUri;
+    TInt ret = localfileUri.Parse(fileuri);
+    if(ret == KErrNone)
+    {    
+        HBufC* file = NULL;
+        TRAP(ret,file = localfileUri.GetFileNameL());  
+        if(ret == KErrNone)
+        {
+        	if(m_pS60Util)
+        	{
+            	ret = m_pS60Util->ParseSource(*file);
+        	}
+			else if(m_pHXUtil)
+			{
+				ret = m_pHXUtil->ParseSource(*file);
+			}
+			else
+			{
+				ret = KErrNotFound;
+			}
+        }
+        
+        delete file;
+    }
+    
+    if(uri)
+    {
+        delete []uri;
+    }
+    
+	return ret;
+}
+
+TInt CMetadataUtilityItf::ExtractUCS2(TDesC& inDes, char* outPtr,TInt maxLen)
+{
+	TPtrC tempPtr = inDes.Left((maxLen/2)-1); //save last one for null terminator
+	TInt outLen = tempPtr.Length() + 1;
+	
+	TPtr16 outDes((unsigned short*)outPtr, outLen);
+	outDes.Copy(tempPtr);
+	outDes.ZeroTerminate();
+
+	return outLen * 2; //return size
+}
+
+TInt CMetadataUtilityItf::CalculateNumMetadataItems(TUint*numItems)
+{
+	if(m_pS60Util)
+	{
+		return m_pS60Util->CalculateNumMetadataItems(numItems);
+	}
+	else
+	{
+		return m_pHXUtil->CalculateNumMetadataItems(numItems);
+	}
+}
+
+char* CMetadataUtilityItf::GetKey(TInt index)
+{
+	if(m_pS60Util)
+	{
+		return m_pS60Util->GetKey(index);
+	}
+	else
+	{
+		return m_pHXUtil->GetKey(index);
+	}
+}
+
+TInt CMetadataUtilityItf::GetValueSize(TInt index)
+{
+	if(m_pS60Util)
+	{
+		return m_pS60Util->GetValueSize(index);
+	}
+	else
+	{
+		return m_pHXUtil->GetValueSize(index);
+	}
+}
+
+TInt CMetadataUtilityItf::GetValue(TInt index, char* data, TInt maxLength, TInt* outSize, TInt* encodingType)
+{
+	if(m_pS60Util)
+	{
+		return m_pS60Util->GetValue(index, data, maxLength, outSize, encodingType);
+	}
+	else
+	{
+		return m_pHXUtil->GetValue(index, data, maxLength, outSize, encodingType);
+	}
+}
+
+TInt CMetadataUtilityItf::ParseSource(char* uri)
+{
+	char* tempPtr = NULL;
+ 	char extension[MAX_EXTENSION_SIZE] = { 0 };
+  
+	tempPtr = strchr(uri, (int)'.');
+	strncpy(extension,tempPtr,sizeof(tempPtr));
+	
+  	for(unsigned int i=0;i<sizeof(extension);i++)
+  	{
+      	extension[i] = tolower(extension[i]);
+  	}
+
+	//if s60 util in use
+	if(m_pS60Util)
+	{
+		//reset existing instace
+		TInt ret = m_pS60Util->Reset();
+		if(!CS60MetadataUtilityItf::IsSupportedExtension(extension))
+		{
+			delete m_pS60Util;
+			m_pS60Util = NULL;
+		}
+	}
+
+	if(m_pHXUtil)
+	{
+		//reset existing instace
+		TInt ret = m_pHXUtil->Reset();
+		if(CS60MetadataUtilityItf::IsSupportedExtension(extension))
+		{
+			delete m_pHXUtil;
+			m_pHXUtil = NULL;
+		}
+	}
+
+	if(!m_pS60Util && !m_pHXUtil)
+	{
+		
+		if(CS60MetadataUtilityItf::IsSupportedExtension(extension))
+		{
+			m_pS60Util = CS60MetadataUtilityItf::New(); 
+		}
+		else
+		{
+			m_pHXUtil = CHXMetadataUtilityItf::New();
+		}
+	}
+
+	return OpenSource(uri);
+}
+
+
+bool CS60MetadataUtilityItf::IsSupportedExtension(char *extn)
+{
+	if(	(!strcasecmp(extn, ".mp3"))	|| 
+		(!strcasecmp(extn, ".wma"))	|| 
+		(!strcasecmp(extn, ".aac")) ||
+		(!strcasecmp(extn, ".wav")) ||
+		(!strcasecmp(extn, ".m4a")))
+	{
+		return true;
+	}
+
+	return false;
+}
+
+CS60MetadataUtilityItf* CS60MetadataUtilityItf::New()
+{
+	CS60MetadataUtilityItf* self = new CS60MetadataUtilityItf();
+	
+	TInt err = KErrGeneral;
+	TRAP(err, self->ConstructL());
+
+	if(err == KErrNone)
+	{
+		return self;
+	}
+
+	delete self;
+	return NULL;
+}
+
+CS60MetadataUtilityItf::CS60MetadataUtilityItf():pMetaDataUtility(NULL)
+{
+}
+
+void CS60MetadataUtilityItf::ConstructL()
+{
+	TAG_TIME_PROFILING_BEGIN;
+	pMetaDataUtility = CMetaDataUtility::NewL();
+	TAG_TIME_PROFILING_END;
+	PRINT_TO_CONSOLE_TIME_DIFF;
+}
+    
+CS60MetadataUtilityItf::~CS60MetadataUtilityItf()
+{
+	if(pMetaDataUtility)
+	{		
+		TInt err = KErrGeneral;
+		
+		TAG_TIME_PROFILING_BEGIN;
+		TRAP(err, pMetaDataUtility->ResetL());
+		delete pMetaDataUtility;
+		TAG_TIME_PROFILING_END;
+		PRINT_TO_CONSOLE_TIME_DIFF;
+	}
+
+	pMetaDataUtility = NULL;
+}
+
+TInt CS60MetadataUtilityItf::ParseSource(TDesC& fileName)
+{
+	TInt err = KErrGeneral;
+
+	if(pMetaDataUtility)
+	{
+	
+		TAG_TIME_PROFILING_BEGIN;
+		//open with the file handle
+		TRAP(err, pMetaDataUtility->OpenFileL(fileName));
+		TAG_TIME_PROFILING_END;
+		PRINT_TO_CONSOLE_TIME_DIFF;
+
+		if(err == KErrNone)
+		{
+			uNumMetadataItems = pMetaDataUtility->MetaDataCount();
+		}
+	}
+
+	return err;
+}
+
+TInt CS60MetadataUtilityItf::CalculateNumMetadataItems(TUint* numItems)
+{
+	TInt err = KErrGeneral;
+
+	if(pMetaDataUtility && numItems)
+	{
+		*numItems = uNumMetadataItems;
+		err = KErrNone;
+	}
+
+	return err;
+}
+
+char* CS60MetadataUtilityItf::KeyMapping(TMetaDataFieldId fldID)
+{
+	switch(fldID)
+	{
+	
+		case EMetaDataSongTitle:
+		{
+			return "KhronosTitle";
+		}
+		case EMetaDataArtist:
+		{
+			return "KhronosArtist";
+		}
+		case EMetaDataAlbum:
+		{
+			return "KhronosAlbum";
+		}
+		case EMetaDataYear:
+		{
+			return "KhronosYear";
+		}
+		case EMetaDataComment:
+		{
+			return "KhronosComment";
+		}
+		case EMetaDataAlbumTrack:
+		{
+			return "KhronosTrackNumber";
+		}
+		case EMetaDataGenre:
+		{
+			return "KhronosGenre";
+		}
+		case EMetaDataComposer:
+		{
+			return "Composer"; //Non Standard
+		}
+		case EMetaDataCopyright:
+		{
+			return "KhronosCopyright";
+		}
+		case EMetaDataOriginalArtist:
+		{
+			return "Original Artist"; //Non Standard
+		}
+		case EMetaDataUserUrl:
+		case EMetaDataUrl:	   
+		{
+			return "KhronosContentURL";
+		}
+		case EMetaDataJpeg:
+		{
+			return "attachedpicture";//"KhronosAlbumArtJPEG";
+		}
+		case EMetaDataVendor:
+		{
+			return "Vendor"; //Non Standard
+		}
+		case EMetaDataRating:
+		{
+			return "KhronosRating";			
+		}
+		case EMetaDataDuration:
+		{
+			return "Duration"; //Non Standard
+		}
+		default:
+		{
+		}
+	} 
+
+	return NULL;
+}
+
+TInt CS60MetadataUtilityItf::ValueEncoding(TMetaDataFieldId fldID)
+{
+	switch(fldID)
+	{
+		case EMetaDataJpeg:
+		{
+			return CMetadataUtilityItf::EBinaryEncoding;
+		}
+		
+		case EMetaDataSongTitle:
+		case EMetaDataArtist:
+		case EMetaDataAlbum:
+		case EMetaDataYear:
+		case EMetaDataComment:
+		case EMetaDataAlbumTrack:
+		case EMetaDataGenre:
+		case EMetaDataComposer:
+		case EMetaDataCopyright:
+		case EMetaDataOriginalArtist:
+		case EMetaDataUserUrl:
+		case EMetaDataUrl:
+		case EMetaDataVendor:
+		case EMetaDataRating:
+		case EMetaDataDuration:
+		default:
+		{
+			return CMetadataUtilityItf::EUnicodeEncoding;
+		}
+	}
+	
+}
+char* CS60MetadataUtilityItf::GetKey(TInt index)
+{
+
+	if(pMetaDataUtility && index < uNumMetadataItems)
+	{
+		
+        TMetaDataFieldId fieldId; 
+		
+		TAG_TIME_PROFILING_BEGIN;
+		TInt err = KErrGeneral;
+		TRAP(err, pMetaDataUtility->MetaDataFieldsL().FieldIdAt( index, fieldId ));
+		TAG_TIME_PROFILING_END;
+		PRINT_TO_CONSOLE_TIME_DIFF;
+		
+		if((err == KErrNone) && (fieldId != EUnknownMetaDataField))
+		{
+			return KeyMapping(fieldId);
+		}
+	}
+	return NULL;
+}
+
+TInt CS60MetadataUtilityItf::GetValueSize(TInt index)
+{
+	if(pMetaDataUtility && index < uNumMetadataItems)
+	{
+		
+        TMetaDataFieldId fieldId; 
+		TInt err = KErrGeneral;
+		TRAP(err, pMetaDataUtility->MetaDataFieldsL().FieldIdAt( index, fieldId ));
+
+		if((err == KErrNone) && (fieldId != EUnknownMetaDataField))
+		{
+			const CMetaDataFieldContainer* iContainer = NULL;
+			TRAP(err, iContainer  = &pMetaDataUtility->MetaDataFieldsL());
+			if(err == KErrNone)
+			{
+				if(ValueEncoding(fieldId) == CMetadataUtilityItf::EUnicodeEncoding)
+				{
+					TPtrC field = iContainer->Field( fieldId ); 
+					if(field != KNullDesC)
+					{
+						return field.Size() + 2; //additional character (two bytes) for null terminator
+					}
+				}	
+				else //Binary
+				{
+					TPtrC8 field8 = iContainer->Field8( fieldId );
+					if(field8 != KNullDesC8)
+					{
+						return field8.Size();
+					}
+		        }
+			}
+		}
+	}
+
+	return 0;
+}
+	
+TInt CS60MetadataUtilityItf::GetValue(TInt index, char* data, TInt maxLength,  //in params
+										TInt* outSize, TInt* encodingType) //out params
+{
+
+	TInt retValueSize = 0;
+	*encodingType= CMetadataUtilityItf::EUnknownEncoding;
+
+	if(pMetaDataUtility && index < uNumMetadataItems)
+	{
+		
+        TMetaDataFieldId fieldId; 
+		TInt err = KErrGeneral;
+		TRAP(err, pMetaDataUtility->MetaDataFieldsL().FieldIdAt( index, fieldId )); 
+		
+		
+		if((err==KErrNone) && (fieldId != EUnknownMetaDataField))
+		{
+		
+			const CMetaDataFieldContainer* iContainer = NULL;
+			TRAP(err, iContainer  = &pMetaDataUtility->MetaDataFieldsL());
+			if(err == KErrNone)
+			{
+				*encodingType = ValueEncoding(fieldId);
+				if(*encodingType == CMetadataUtilityItf::EUnicodeEncoding)
+				{
+				
+					
+					TAG_TIME_PROFILING_BEGIN;
+					TPtrC field = iContainer->Field( fieldId ); 
+					TAG_TIME_PROFILING_END;
+					PRINT_TO_CONSOLE_TIME_DIFF;
+					if(field != KNullDesC)
+					{
+						*outSize = CMetadataUtilityItf::ExtractUCS2(field, data, maxLength);
+						retValueSize = field.Size() + 2; //actual size
+					}
+				}	
+				else //Binary
+				{
+					
+					TAG_TIME_PROFILING_BEGIN;
+					TPtrC8 field8 = iContainer->Field8( fieldId ); 
+					TAG_TIME_PROFILING_END;
+					PRINT_TO_CONSOLE_TIME_DIFF;
+					if(field8 != KNullDesC8)
+					{
+						*outSize = (maxLength > field8.Size())?field8.Size():maxLength;					
+						memcpy(data, field8.Ptr(), *outSize);
+						retValueSize = field8.Size();					
+					}
+				}
+			}
+		}
+	}
+
+	return	 retValueSize;
+}
+
+TInt CS60MetadataUtilityItf::Reset()
+{
+	TInt err = KErrNone;	
+	if(pMetaDataUtility)
+	{		
+		TRAP(err, pMetaDataUtility->ResetL());
+	}
+
+	return err;
+}
+
+
+CHXMetadataUtilityItf::CHXMetadataUtilityItf():pHXMetaDataUtility(NULL)
+{
+}
+
+void CHXMetadataUtilityItf::ConstructL()
+{
+	TAG_TIME_PROFILING_BEGIN;
+	pHXMetaDataUtility = CHXMetaDataUtility::NewL();
+	TAG_TIME_PROFILING_END;
+	PRINT_TO_CONSOLE_TIME_DIFF;
+}
+
+   
+CHXMetadataUtilityItf* CHXMetadataUtilityItf::New()
+{
+	CHXMetadataUtilityItf* self = new CHXMetadataUtilityItf();
+
+	if(self)
+	{
+		TInt err = KErrGeneral;
+		TRAP(err, self->ConstructL());
+   
+		if(err != KErrNone)
+		{
+			delete self;
+			self = NULL;
+		}
+	}
+   
+	return self;
+}
+   
+CHXMetadataUtilityItf::~CHXMetadataUtilityItf()
+{
+	if(pHXMetaDataUtility)
+	{		
+		TInt err = KErrGeneral;
+		
+		TAG_TIME_PROFILING_BEGIN;
+		TRAP(err, pHXMetaDataUtility->ResetL());
+		delete pHXMetaDataUtility;
+		TAG_TIME_PROFILING_END;
+		PRINT_TO_CONSOLE_TIME_DIFF;
+	}
+
+	pHXMetaDataUtility = NULL;
+}
+
+TInt CHXMetadataUtilityItf::Reset()
+{
+	TInt err = KErrNone;	
+	if(pHXMetaDataUtility)
+	{		
+		TRAP(err, pHXMetaDataUtility->ResetL());
+	}
+
+	return err;
+}
+
+
+
+TInt CHXMetadataUtilityItf::ParseSource(TDesC& fileName)
+{
+	TInt err = KErrGeneral;
+
+	if(pHXMetaDataUtility)
+	{
+		//open with the file handle
+		TAG_TIME_PROFILING_BEGIN;
+		TRAP(err, pHXMetaDataUtility->OpenFileL(fileName));
+		TAG_TIME_PROFILING_END;
+		PRINT_TO_CONSOLE_TIME_DIFF;
+
+		if(err == KErrNone)
+		{
+			 return pHXMetaDataUtility->GetMetaDataCount(uNumMetadataItems);
+		}
+	}
+
+	return err;
+}
+
+TInt CHXMetadataUtilityItf::CalculateNumMetadataItems(TUint* numItems)
+{
+	TInt err = KErrGeneral;
+
+	if(pHXMetaDataUtility && numItems)
+	{
+		*numItems = uNumMetadataItems;
+		err = KErrNone;
+	}
+
+	return err;
+}
+
+char* CHXMetadataUtilityItf::KeyMapping(HXMetaDataKeys::EHXMetaDataId fldID)
+{
+        
+	switch(fldID)
+	{
+	
+		case HXMetaDataKeys::EHXTitle:
+		{
+			return "KhronosTitle";
+		}
+		case HXMetaDataKeys::EHXPerformer:
+		{
+			return "KhronosArtist";
+		}
+		case HXMetaDataKeys::EHXDescription:
+		{
+			return "KhronosComment";
+		}
+		case HXMetaDataKeys::EHXGenre:
+		{
+			return "KhronosGenre";
+		}
+		case HXMetaDataKeys::EHXAuthor:
+		{
+			return "Composer"; //Non Standard
+		}
+		case HXMetaDataKeys::EHXCopyright:
+		{
+			return "KhronosCopyright";
+		}
+		case HXMetaDataKeys::EHXContentURI:	   
+		{
+			return "KhronosContentURL";
+		}
+		case HXMetaDataKeys::EHXDuration:
+		{
+			return "Duration"; //Non Standard
+		}
+		case HXMetaDataKeys::EHXClipBitRate:
+		{
+			return "ClipBitRate"; //non-standard
+		}
+		case HXMetaDataKeys::EHXVideoBitRate:
+		{
+			return "VideoBitRate"; // non-standard
+		}
+		case HXMetaDataKeys::EHXAudioBitRate:
+		{
+			return "AudioBitRate";
+		}
+		case HXMetaDataKeys::EHXCodec:
+		{
+			return "Codec";
+		}
+		case HXMetaDataKeys::EHXFrameSize:
+		{
+			return "Resolution";
+		}
+		case HXMetaDataKeys::EHXFramesPerSecond:
+		{
+			return "FrameRate";
+		}
+		case HXMetaDataKeys::EHXStreamCount:
+		{
+			return "Stream Count";
+		}
+		case HXMetaDataKeys::EHXLiveStream:
+		{
+			return "Live Stream";
+		}
+        case HXMetaDataKeys::EHXSeekable:
+		{
+			return "Seekable";
+		}
+        case HXMetaDataKeys::EHXContentType:
+  		{
+			return "Content Type";
+		}
+		case HXMetaDataKeys::EHXFormat:
+		{
+			return "Format";
+		}
+        case HXMetaDataKeys::EHXQuality:
+		{
+			return "Quality";
+		}
+        case HXMetaDataKeys::EHXAbstract:
+		{
+			return "Abstract";
+		}
+		case HXMetaDataKeys::EHXMimeType:
+		{
+			return "MimeType";
+		}
+		case HXMetaDataKeys::EHXIconURI:
+		{
+			return "Icon URI";
+		}
+        case HXMetaDataKeys::EHXEPreviewURI:
+		{
+			return "Preview URI";
+		}
+        case HXMetaDataKeys::EHXContentID:
+		{
+			return "Content ID";
+		}
+        case HXMetaDataKeys::EHXInfoURL:
+		{
+			return "Info URL";
+		}
+		default:
+		{
+		}
+	} 
+
+	return NULL;
+}
+
+TInt CHXMetadataUtilityItf::ValueEncoding(HXMetaDataKeys::EHXMetaDataId fldID)
+{
+	switch(fldID)
+	{
+		default:
+		{
+			return CMetadataUtilityItf::EUnicodeEncoding;
+		}
+	}
+	
+}
+char* CHXMetadataUtilityItf::GetKey(TInt index)
+{
+
+	if(pHXMetaDataUtility && index < uNumMetadataItems)
+	{
+		HXMetaDataKeys::EHXMetaDataId id;
+		HBufC* pDes;
+		
+		TAG_TIME_PROFILING_BEGIN;
+        TInt err = pHXMetaDataUtility->GetMetaDataAt(index, id, pDes); 
+		TAG_TIME_PROFILING_END;
+		PRINT_TO_CONSOLE_TIME_DIFF;
+		
+		if(err == KErrNone)
+		{
+			return KeyMapping(id);
+		}
+	}
+	return NULL;
+}
+
+TInt CHXMetadataUtilityItf::GetValueSize(TInt index)
+{
+	if(pHXMetaDataUtility && index < uNumMetadataItems)
+	{
+		HXMetaDataKeys::EHXMetaDataId id;
+		HBufC* pDes;
+		
+        TInt err =  pHXMetaDataUtility->GetMetaDataAt(index, id, pDes); 
+		
+		if(err == KErrNone)
+		{
+			if(ValueEncoding(id) == CMetadataUtilityItf::EUnicodeEncoding)
+			{
+				return pDes->Size() + 2; //additional character (two bytes) for null terminator
+			}	
+			else //Binary
+			{
+				//no support
+	        }
+		}
+	}
+
+	return 0;
+}
+	
+TInt CHXMetadataUtilityItf::GetValue(TInt index, char* data, TInt maxLength,  //in params
+										TInt* outSize, TInt* encodingType) //out params
+{
+
+	TInt retValueSize = 0;
+	*encodingType= CMetadataUtilityItf::EUnknownEncoding;
+
+	if(pHXMetaDataUtility && index < uNumMetadataItems)
+	{
+		HXMetaDataKeys::EHXMetaDataId id;
+		HBufC* pDes;
+
+		
+		TAG_TIME_PROFILING_BEGIN;
+        TInt err =  pHXMetaDataUtility->GetMetaDataAt(index, id, pDes); 
+		TAG_TIME_PROFILING_END;
+		PRINT_TO_CONSOLE_TIME_DIFF;
+		
+		*encodingType = ValueEncoding(id);
+		
+		if(err == KErrNone)
+		{
+			if(*encodingType == CMetadataUtilityItf::EUnicodeEncoding)
+			{
+				*outSize = CMetadataUtilityItf::ExtractUCS2(*pDes, data, maxLength);
+				retValueSize = pDes->Size() + 2; //actual Size	
+			}	
+			else //Binary
+			{
+				//no support
+			}
+		}
+	}
+
+	return	 retValueSize;
+}
+
+
+extern "C" {
+
+    void* mmf_metadata_utility_init(char* uri)
+	{
+		return CMetadataUtilityItf::New(uri);
+	}
+
+    void mmf_metadata_utility_destroy(void* context)
+	{
+		delete ((CMetadataUtilityItf*)context);
+	}
+
+	XAresult mmf_metadata_utility_parse_source(void* context, char* uri)
+	{
+		TInt err = ((CMetadataUtilityItf*)context)->ParseSource(uri);
+		
+		if(err == KErrNone)
+		{
+			return XA_RESULT_SUCCESS;
+		}
+		
+		return XA_RESULT_PARAMETER_INVALID;
+	}
+
+
+	XAresult  mmf_get_item_count(void* context, XAuint32* itemCount)
+	{
+		if(itemCount)
+		{
+			TInt err = ((CMetadataUtilityItf*)(context))->CalculateNumMetadataItems((TUint *)itemCount);
+			if(err == KErrNone)
+			{
+				return XA_RESULT_SUCCESS;
+			}
+		}
+
+		return XA_RESULT_PARAMETER_INVALID;
+	}
+	
+	XAresult  mmf_get_key_size(void* context, XAuint32 keyIndex, XAuint32* keySize)
+	{
+		char* key = ((CMetadataUtilityItf*)(context))->GetKey(keyIndex);
+		if(key && keySize)
+		{
+			*keySize = (strlen(key) + sizeof(XAMetadataInfo));
+			
+			return XA_RESULT_SUCCESS;
+		}
+		
+		return XA_RESULT_PARAMETER_INVALID;		
+	}
+	
+
+	XAresult  mmf_get_key(void* context, XAuint32 index,XAuint32 keySize, XAMetadataInfo *pKey)
+	{
+		XAresult ret = XA_RESULT_PARAMETER_INVALID;
+		
+		TInt keyDataSize = keySize - sizeof(XAMetadataInfo) + 1;
+		char* ascKey = ((CMetadataUtilityItf*)(context))->GetKey(index);
+
+		if(ascKey && keyDataSize)
+		{
+			TInt ascKeySize = strlen(ascKey);
+			TInt outSize = (ascKeySize >= keyDataSize) ? (keyDataSize - 1) : ascKeySize;
+			
+			pKey->size = outSize + 1;
+			pKey->encoding = XA_CHARACTERENCODING_ASCII;
+			strcpy((char *)(pKey->langCountry), "en-us");
+			strncpy((char *)(pKey->data), ascKey, outSize);
+			pKey->data[outSize] = '\0';
+
+			if(ascKeySize >= keyDataSize)
+			{
+				ret = XA_RESULT_BUFFER_INSUFFICIENT;
+			}
+			else
+			{
+				ret = XA_RESULT_SUCCESS;
+			}
+		}
+
+		ret = XA_RESULT_SUCCESS;
+		return ret;		
+	}
+
+	XAresult  mmf_get_value_size(void* context, XAuint32 index, XAuint32 *pValueSize)
+	{
+		if(pValueSize)
+		{
+			*pValueSize = ((CMetadataUtilityItf*)(context))->GetValueSize(index) + sizeof(XAMetadataInfo) - 1; //XAMetadataInfo already includes one byte for Data
+			
+			return XA_RESULT_SUCCESS;
+		}
+
+		return XA_RESULT_PARAMETER_INVALID;		
+	}
+
+	XAresult  mmf_get_value(void* context, XAuint32 index, XAuint32 valueSize, XAMetadataInfo *pValue)
+	{
+		XAresult ret = XA_RESULT_PARAMETER_INVALID;
+		TInt dataSize = valueSize - sizeof(XAMetadataInfo) + 1;
+		TInt outLen = 0, encodingType = CMetadataUtilityItf::EUnknownEncoding;
+
+		if(dataSize > 0)
+		{
+		
+			TInt actualDataSize = ((CMetadataUtilityItf*)(context))->GetValue(index, (char*)pValue->data, dataSize, &outLen, &encodingType);
+
+			pValue->size = outLen;
+			pValue->encoding = (encodingType == CMetadataUtilityItf::EUnicodeEncoding) ? XA_CHARACTERENCODING_UTF16LE : XA_CHARACTERENCODING_BINARY;
+			strcpy((char *)(pValue->langCountry), "en-us");
+
+			if(!actualDataSize)
+			{
+				return XA_RESULT_INTERNAL_ERROR;
+			}
+			if(actualDataSize > dataSize)
+			{
+				ret = XA_RESULT_BUFFER_INSUFFICIENT;
+			}
+			else
+			{
+				ret = XA_RESULT_SUCCESS;
+			}
+		}
+			
+		return ret; 
+	}
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mmf_adaptation/cmetadatautilityitf.h	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,149 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 CMETADATA_UTILITY_ITF_H
+#define CMETADATA_UTILITY_ITF_H
+
+
+#ifdef __cplusplus
+
+#include <e32base.h>
+#include <e32std.h>
+#include <e32hashtab.h>
+#include <OpenMAXAL.h>
+
+#include <Hxmetadatautil.h>
+#include <MetaDataUtility.h>
+#include <MetaDataFieldContainer.h>
+#include <MetaDataField.hrh>
+
+
+#define MAX_EXTENSION_SIZE 10
+#define uint32 unsigned int
+
+class CS60MetadataUtilityItf;
+class CHXMetadataUtilityItf;
+
+NONSHARABLE_CLASS(CMetadataUtilityItf)
+{
+public:
+
+	enum TValueEncodingType
+	{
+		EUnknownEncoding,
+		EAsciiEncoding,
+		EUnicodeEncoding,
+		EBinaryEncoding,	
+	};
+	
+	static CMetadataUtilityItf* New(char* uri);
+
+	CMetadataUtilityItf();
+	virtual ~CMetadataUtilityItf();
+	TInt ParseSource(char* uri);
+	TInt OpenSource(char* uri);	
+	TInt CalculateNumMetadataItems(TUint*);
+	char* GetKey(TInt index);
+	TInt GetValueSize(TInt index);
+	TInt GetValue(TInt index, char* data, TInt maxLength, TInt* outSize, TInt* encodingType);
+
+	//helper function
+	//extracts left part of input descriptor upto (maxLen-1) and copies content in outPtr
+	//append a null terminator
+	static TInt ExtractUCS2(TDesC& inDes, char* outPtr,TInt maxLen);
+
+private:
+	CS60MetadataUtilityItf* m_pS60Util;
+	CHXMetadataUtilityItf*  m_pHXUtil;
+};
+
+
+NONSHARABLE_CLASS(CS60MetadataUtilityItf)
+{
+public:
+
+	static CS60MetadataUtilityItf* New();
+  	~CS60MetadataUtilityItf();
+
+	TInt CalculateNumMetadataItems(TUint*);
+	
+	char* GetKey(TInt index);
+	TInt  GetValueSize(TInt index);
+	TInt  GetValue(TInt index, char* data, TInt maxLength, TInt* outSize, TInt* encodingType);
+
+	TInt 	ParseSource(TDesC&);
+
+	char* KeyMapping(TMetaDataFieldId);
+	TInt  ValueEncoding(TMetaDataFieldId);
+
+	static bool IsSupportedExtension(char* extn);
+
+	TInt Reset();
+
+private:
+	
+    CS60MetadataUtilityItf();
+    void ConstructL();
+	
+   	CMetaDataUtility* pMetaDataUtility; //S60MetadataUtility
+   	
+	TUint 		uNumMetadataItems;		
+		
+};
+
+NONSHARABLE_CLASS(CHXMetadataUtilityItf)
+{
+public:
+
+	static CHXMetadataUtilityItf* New();
+  ~CHXMetadataUtilityItf();
+
+	TInt CalculateNumMetadataItems(TUint*);
+	
+	char* GetKey(TInt index);
+	
+	TInt ValueEncoding(HXMetaDataKeys::EHXMetaDataId fldID);
+	TInt  GetValueSize(TInt index);
+	TInt  GetValue(TInt index, char* data, TInt maxLength, TInt* outSize, TInt* encodingType);
+	
+	TInt 	ParseSource(TDesC&);
+	char* KeyMapping(HXMetaDataKeys::EHXMetaDataId);
+	
+	TInt Reset();
+
+private:
+	CHXMetadataUtilityItf();
+    void ConstructL();
+   	
+  CHXMetaDataUtility *pHXMetaDataUtility;
+  
+  TUint 	  uNumMetadataItems;	  
+};
+
+
+#else
+
+extern void* mmf_metadata_utility_init(char*);
+extern void  mmf_metadata_utility_destroy(void* context);
+extern XAresult mmf_metadata_utility_parse_source(void* , char*);
+extern XAresult  mmf_get_item_count(void* context, XAuint32* itemCount);
+extern XAresult  mmf_get_key_size(void* context, XAuint32 keyIndex, XAuint32* keySize);
+extern XAresult  mmf_get_key(void* context, XAuint32 index,XAuint32 keySize, XAMetadataInfo *pKey);
+extern XAresult  mmf_get_value_size(void* context, XAuint32 index, XAuint32 *pValueSize);
+extern XAresult  mmf_get_value(void* context, XAuint32 index, XAuint32 valueSize, XAMetadataInfo *pValue);
+#endif //__cplusplus
+
+#endif
--- a/khronosfws/openmax_al/src/mmf_adaptation/cmmfbackendengine.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/mmf_adaptation/cmmfbackendengine.cpp	Fri May 14 16:22:35 2010 +0300
@@ -11,328 +11,374 @@
 *
 * Contributors:
 *
-* Description: 
+* Description:
 *
 */
-/*
-Media Helper Class for handling surface events
-
-Shy Ward
-*/
 
 #include "cmmfbackendengine.h"
 #include <string.h>
 #include <ctype.h>
 #include <uri8.h>
+#include <uri16.h>
+#include "markerpositiontimer.h"
+#include "positionupdatetimer.h"
+#include "profileutilmacro.h"
 
 extern "C" {
 #include "xaadaptationmmf.h"
 }
 
+#define RET_IF_ERR(res, val) if (res != KErrNone) return val
 
-#define ENABLE_GRAPHICS_SURFACE_INTEGRATION_NOT_NOW
+const XAuint32 XA_PLAYSTATE_PLAYERUNINITIALIZED = 0;
 
 CMMFBackendEngine* CMMFBackendEngine::NewL()
     {
     CMMFBackendEngine* self = new (ELeave) CMMFBackendEngine();
+    CleanupStack::PushL(self);
     self->ConstructL();
+    CleanupStack::Pop(self);
     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);   
+    Close();
+    Destroy();
     }
 
-void CMMFBackendEngine::CreateAndConfigureWindowL()
+CMMFBackendEngine::CMMFBackendEngine()
+:iPositionUpdatePeriod(1000), /* default is 1000 millisec */
+ iUriPtr(NULL,0)
     {
-#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     
-    
+/*    m_bWindowReferencePassed = FALSE;*/
+    iRecordState = ERecorderNotReady;
+    iPositionUpdateTimer = NULL;
+    iMediaPlayerState = XA_PLAYSTATE_PLAYERUNINITIALIZED;
+    iMMFPlayerState = EPlayerClosed;
     }
 
 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;
-    } 
+    iAPIBeingUsed = ENoUtility;
+    iBaseAudioRecorder = CMdaAudioRecorderUtility::NewL(*this);
+    iAudioRecorder = (CMdaAudioRecorderUtility*)iBaseAudioRecorder;
+    iActiveSchedulerWait = new (ELeave) CActiveSchedulerWait;
+    }
+
+void CMMFBackendEngine::InitAudioPlayerUtilityL()
+    {
+    if (!iAudioPlayer)
+        {
+        iBaseAudioPlayer = CMdaAudioPlayerUtility::NewL(*this);
+        iAudioPlayer = (CMdaAudioPlayerUtility*)iBaseAudioPlayer;
+        }
+    InitPlayerTimersL();
+    }
+
+void CMMFBackendEngine::InitVideoPlayerUtilityL()
+    {
+    if (!iVideoPlayer)
+        {
+        iBaseVideoPlayer = CVideoPlayerUtility2::NewL(*this, EMdaPriorityNormal, EMdaPriorityPreferenceTimeAndQuality);
+        iVideoPlayer = (CVideoPlayerUtility2*)iBaseVideoPlayer;
+        iVideoPlayer->RegisterForVideoLoadingNotification(*this);
+        }
+    InitPlayerTimersL();
+    }
+
+void CMMFBackendEngine::InitPlayerTimersL()
+    {
+    if (!iMarkerPositionTimer)
+        {
+        iMarkerPositionTimer = CMarkerPositionTimer::NewL(iAudioPlayer, iVideoPlayer);
+        iMarkerPositionTimer->SetContext(iAdaptContext);
+        }
+    if (!iPlayItfPositionUpdateTimer)
+        {
+        iPlayItfPositionUpdateTimer = CPositionUpdateTimer::NewL(iAudioPlayer, iVideoPlayer);
+        iPlayItfPositionUpdateTimer->SetContext(iAdaptContext);
+        }
+    iMarkerPositionTimer->Stop();
+    iPlayItfPositionUpdateTimer->Stop();
+    }
 
 TInt CMMFBackendEngine::SetFileName(char* uri, XAuint32 format, TFuncInUse func)
     {
     TInt err(KErrNone);
     _LIT8(KFileSlash,"file:///");
     TInt fileslashlen = KFileSlash().Length();
-    if(func == ERecord)
+    if (func == ERecord)
         {
-        if(iRecordState == ERecorderNotReady)
+        if (iRecordState == ERecorderNotReady)
             {
             iFileFormat = format;
-            iAPIBeingUsed = DetermineAPIToUse(uri, ERecord);
+            iAPIBeingUsed = EAudioRecorderUtility;
             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)
                 {
-                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));
+                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 (!err)
+                { /* Wait until we receive moscostatechanged callback */
                 if(!iActiveSchedulerWait->IsStarted())
                     {
                     iActiveSchedulerWait->Start();
                     }
+                err = iErrorCode;
                 }
            }
         }
     else
         {
-        if(iPlayerState == EPlayerClosed)
+        /* The second one is needed for dynamic source interface */
+        if ((iMediaPlayerState == XA_PLAYSTATE_PLAYERUNINITIALIZED) ||
+                (iMediaPlayerState == XA_PLAYSTATE_STOPPED))
             {
             iFileFormat = format;
-            iAPIBeingUsed = DetermineAPIToUse(uri,EPlay);
-            TPtr8 fileuri((TUint8*)uri, strlen(uri),strlen(uri));
-            
-            if(iAPIBeingUsed == EAudioPlayerUtility)
+            iAPIBeingUsed = DetermineAPIToUse(uri, EPlay);
+            err = XA_RESULT_INTERNAL_ERROR;
+            if (iAPIBeingUsed == EAudioPlayerUtility)
+                {
+                /* Initialize URI as needed by MMF utilities */
+                err = InitializeURIForMMFUtil(uri);
+                RET_IF_ERR(err, XA_RESULT_INTERNAL_ERROR);
+                /* Initalize Player related objects */
+                TRAP(err, InitAudioPlayerUtilityL());
+                RET_IF_ERR(err, XA_RESULT_INTERNAL_ERROR);
+
+                TAG_TIME_PROFILING_BEGIN;
+                TRAP(err, iAudioPlayer->OpenFileL(iUriPtr));
+                RET_IF_ERR(err, XA_RESULT_INTERNAL_ERROR);
+                TAG_TIME_PROFILING_END;
+                PRINT_TO_CONSOLE_TIME_DIFF;
+
+                /* Wait until we receive mapc init complete */
+                PRINT_TO_CONSOLE_HOME_TIME;
+                if (!iActiveSchedulerWait->IsStarted())
+                    {
+                    iActiveSchedulerWait->Start();
+                    }
+                RET_IF_ERR(iErrorCode, XA_RESULT_INTERNAL_ERROR);
+                }
+            else if (iAPIBeingUsed == EVideoPlayerUtility)
                 {
-                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;
+                /* Initialize URI as needed by MMF utilities */
+                err = InitializeURIForMMFUtil(uri);
+                RET_IF_ERR(err, XA_RESULT_INTERNAL_ERROR);
+                /* Initalize Player related objects */
+                TRAP(err, InitVideoPlayerUtilityL());
+                RET_IF_ERR(err, XA_RESULT_INTERNAL_ERROR);
+
+                /* Open file */
+                TAG_TIME_PROFILING_BEGIN;
+                TRAP(err, iVideoPlayer->OpenFileL(iUriPtr));
+                RET_IF_ERR(err, XA_RESULT_INTERNAL_ERROR);
+                TAG_TIME_PROFILING_END;
+                PRINT_TO_CONSOLE_TIME_DIFF;
+
+                /* Wait until we receive  MvpuoOpenComplete */
+                PRINT_TO_CONSOLE_HOME_TIME;
+                if (!iActiveSchedulerWait->IsStarted())
+                    {
+                    iActiveSchedulerWait->Start();
+                    }
+                RET_IF_ERR(iErrorCode, XA_RESULT_INTERNAL_ERROR);
+
+                /* Prepare utility */
+                TAG_TIME_PROFILING_BEGIN_NO_VAR_DEF;
+                iVideoPlayer->Prepare();
+                TAG_TIME_PROFILING_END_NO_VAR_DEF;
+                PRINT_TO_CONSOLE_TIME_DIFF;
+
+                /* Wait until we receive  MvpuoPrepareComplete */
+                PRINT_TO_CONSOLE_HOME_TIME_NO_VAR_DEF;
+                if (!iActiveSchedulerWait->IsStarted())
+                    {
+                    iActiveSchedulerWait->Start();
+                    }
+                RET_IF_ERR(iErrorCode, XA_RESULT_INTERNAL_ERROR);
                 }
            }
         }
+    if (err != KErrNone)
+        {
+        err = XA_RESULT_INTERNAL_ERROR;
+        }
     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++)
+    char* dotPtr = NULL;
+    char ext[MAX_EXTENSION_SIZE] = { 0 };
+    int extLen;
+
+    dotPtr = strrchr(uri, (int)'.');
+    if (!dotPtr)
         {
-        extension[i] = tolower(extension[i]);
+        return KErrNotFound;
         }
-    
-    if(aFunc == ERecord)
+
+    strncpy(ext, dotPtr,strlen(dotPtr));
+    /*Null terminate the string*/
+    ext[strlen(dotPtr)] = '\0';
+    extLen = sizeof(ext);
+    for(unsigned int i=0; i < extLen; i++)
         {
-        return EAudioPlayerUtility; 
+        ext[i] = tolower(ext[i]);
+        }
+
+    if (aFunc == ERecord)
+        {
+        return EAudioRecorderUtility;
         }
     else
         {
-        if(!strcmp(extension, ".mp3") || (!strcmp(extension, ".amr")) || (!strcmp(extension, ".aac")) || (!strcmp(extension, ".mid")) ||
-                  (!strcmp(extension, ".awb")))
+        if (!strcasecmp(ext, ".mp3") ||
+           !strcasecmp(ext, ".amr") ||
+           !strcasecmp(ext, ".aac") ||
+           !strcasecmp(ext, ".mid") ||
+		   !strcasecmp(ext, ".wav") ||
+           !strcasecmp(ext, ".awb"))
             {
-            return EAudioPlayerUtility; 
+            return EAudioPlayerUtility;
             }
-          else 
+          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)
+    PRINT_TO_CONSOLE_HOME_TIME;
+
+    iErrorCode = aError;
+    if (iErrorCode == KErrNone)
+        {
+        iMMFPlayerState = EPlayerOpened;
+        }
+    if (iActiveSchedulerWait->IsStarted())
         {
-        //Issue the command to Play the file
-        TRAPD (error, iVideoPlayer->Prepare());
-        if (error == KErrNone)
+        iActiveSchedulerWait->AsyncStop();
+        }
+    }
+
+void CMMFBackendEngine::MvpuoPrepareComplete(TInt aError)
+    {
+    PRINT_TO_CONSOLE_HOME_TIME;
+
+    TAutoScaleType autoScale = EAutoScaleBestFit;
+    iErrorCode = aError;
+    iMediaPlayerState = XA_PLAYSTATE_PLAYERUNINITIALIZED;
+    iMediaDuration = 0;
+    iMarkerPositionTimer->ResetPlayer();
+    iPlayItfPositionUpdateTimer->ResetPlayer();
+    if (iErrorCode == KErrNone)
+        {
+        iMMFPlayerState = EPlayerPrepared;
+        TAG_TIME_PROFILING_BEGIN;
+        TRAP(iErrorCode, iMediaDuration = iVideoPlayer->DurationL());
+        TAG_TIME_PROFILING_END;
+        PRINT_TO_CONSOLE_TIME_DIFF;
+        if (iErrorCode == KErrNone)
             {
-                //prepare success
+            iPlaybackHead = 0;
+            iMediaPlayerState = XA_PLAYSTATE_STOPPED;
+            iMarkerPositionTimer->UseVideoPlayer();
+            iPlayItfPositionUpdateTimer->UseVideoPlayer();
+            if (m_pWs && m_pScr && m_pWindow)
+                {
+                TRect videoExtent = TRect(m_pWindow->Size());
+                TRect clipRect = TRect(m_pWindow->Size());        
+                TAG_TIME_PROFILING_BEGIN;
+                TRAP_IGNORE(iVideoPlayer->AddDisplayWindowL(*m_pWs, *m_pScr, *m_pWindow, videoExtent, clipRect));
+                TRAP_IGNORE(iVideoPlayer->SetAutoScaleL(*m_pWindow, autoScale));
+                TAG_TIME_PROFILING_END;
+                PRINT_TO_CONSOLE_TIME_DIFF;
+                }
             }
-        else
-            {
-                //prepare failed
-            }
+        }
+    if (iActiveSchedulerWait->IsStarted())
+        {
+        iActiveSchedulerWait->AsyncStop();
+        }
+    }
+
+void CMMFBackendEngine::MvpuoFrameReady(CFbsBitmap& /*aFrame*/,TInt /*aError*/)
+    {
+
+    }
+void CMMFBackendEngine::MvpuoPlayComplete(TInt aError)
+    {
+    iErrorCode = aError;
+    if (iErrorCode == KErrNone)
+        {
+        iPlaybackHead = iMediaDuration;
+        /* Per OpenMAX AL Spec, when playback is completed, media player stays in
+         * paused state with playhead at the end of the media clip */
+        iMediaPlayerState = XA_PLAYSTATE_PAUSED;
+        DoPostEvent(XA_PLAYEVENT_HEADATEND);
         }
     else
         {
-        //could not open file
+        iPlaybackHead = 0;
+        iMediaPlayerState = XA_PLAYSTATE_STOPPED;
+        XAAdaptEvent event = {XA_PLAYITFEVENTS, XA_OBJECT_EVENT_RESOURCES_LOST, 0, NULL};
+        XAAdaptationBase_SendAdaptEvents((XAAdaptationBaseCtx*)iAdaptContext, &event );
         }
-    }
-
-
-
-void CMMFBackendEngine::MvpuoFrameReady(CFbsBitmap& /*aFrame*/,TInt /*aError*/)
-    {
-    
+    iMMFPlayerState = EPlayerPrepared;
+    iMarkerPositionTimer->Stop();
+    iPlayItfPositionUpdateTimer->Stop();
     }
 
-
-
-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);
+    //RDebug::Print(_L("CMMFBackendEngine::MvpuoEvent (0x%x %d)"), event.iEventType, event.iErrorCode);
 
     if (event.iEventType == KMMFEventCategoryVideoPlayerGeneralError &&
         event.iErrorCode == KErrHardwareNotAvailable)
         {
-        //audio device taken
-        //handle this case
+        //RDebug::Print(_L("CMMFBackendEngine::MvpuoEvent: Hardware Not Available"));
         }
 
-	else if (event.iEventType == KMMFEventCategoryVideoPlayerGeneralError &&
-			 event.iErrorCode == KErrMMPartialPlayback)
+    else if (event.iEventType == KMMFEventCategoryVideoPlayerGeneralError &&
+             event.iErrorCode == KErrMMPartialPlayback)
         {
-        //Partial Playback
-        } 
-    
+        //RDebug::Print(_L("CMMFBackendEngine::MvpuoEvent: Partial playback"));
+        }    
+    if (event.iEventType == KMMFEventCategoryVideoPlayerGeneralError &&
+        event.iErrorCode == -12014)
+        {
+        //RDebug::Print(_L("CMMFBackendEngine::MvpuoEvent: Audio Device taken"));
+        PausePlayback();
+        XAAdaptEvent event = {XA_PLAYITFEVENTS, XA_OBJECT_EVENT_RESOURCES_LOST, 0, NULL};
+        XAAdaptationBase_SendAdaptEvents((XAAdaptationBaseCtx*)iAdaptContext, &event );
+        }
     else if (event.iEventType == KMMFRefreshMetaData)
         {
-       //entry = iVideoPlayer->MetaDataEntryL( event.iErrorCode );
+        //RDebug::Print(_L("CMMFBackendEngine::MvpuoEvent: EventType == KMMFRefreshMetaData"));
         }
     else
         {
-    
+        //RDebug::Print(_L("CMMFBackendEngine::MvpuoEvent: Unhandled event"));
         }
-    
-}
-
-
 
-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
@@ -340,9 +386,6 @@
     {
     }
 
-
-
-
 void CMMFBackendEngine::MvloLoadingComplete()
     {
     //file playing
@@ -350,50 +393,90 @@
 
 //MMdaAudioPlayerCallback
 void CMMFBackendEngine::MapcInitComplete(TInt aError,
-										  const TTimeIntervalMicroSeconds& /* aDuration */)
+                                          const TTimeIntervalMicroSeconds& aDuration)
     {
-    if (aError == KErrNone)
+    PRINT_TO_CONSOLE_HOME_TIME;
+
+    iErrorCode = aError;
+    iMediaPlayerState = XA_PLAYSTATE_PLAYERUNINITIALIZED;
+    iMMFPlayerState = EPlayerClosed;
+    iMediaDuration = 0;
+    iMarkerPositionTimer->ResetPlayer();
+    iPlayItfPositionUpdateTimer->ResetPlayer();
+    if (iErrorCode == KErrNone)
         {
-        iAudioPlayer->Play();
-        iPlayerState = EPlayerPlaying;
+        iMediaDuration = aDuration;
+        iPlaybackHead = 0;
+        iMediaPlayerState = XA_PLAYSTATE_STOPPED;
+        iMMFPlayerState = EPlayerOpened;
+        iMarkerPositionTimer->UseAudioPlayer();
+        iPlayItfPositionUpdateTimer->UseAudioPlayer();
         }
-    else
+    if (iActiveSchedulerWait->IsStarted())
         {
-        //init failed
+        iActiveSchedulerWait->AsyncStop();
         }
     }
 
 
-void CMMFBackendEngine::MapcPlayComplete(TInt /* aError */)
+void CMMFBackendEngine::MapcPlayComplete(TInt aError)
     {
-    //audio playback complete
+    iErrorCode = aError;
+    if (iErrorCode == KErrNone)
+        {
+        /* Now we should have better value. Start using that */
+        iAudioPlayer->Duration(iMediaDuration);
+        iPlaybackHead = iMediaDuration;
+        /* Per OpenMAX AL Spec, when playback is completed, media player stays in
+         * paused state with playhead at the end of the media clip */
+        iMediaPlayerState = XA_PLAYSTATE_PAUSED;
+        DoPostEvent(XA_PLAYEVENT_HEADATEND);
+        iMMFPlayerState = EPlayerOpened;
+        }
+    else
+        {
+        iAudioPlayer->GetPosition(iPlaybackHead);
+        iMediaPlayerState = XA_PLAYSTATE_PAUSED;
+        iMMFPlayerState = EPlayerPaused;
+        XAAdaptEvent event = {XA_PLAYITFEVENTS, XA_OBJECT_EVENT_RESOURCES_LOST, 0, NULL};
+        XAAdaptationBase_SendAdaptEvents((XAAdaptationBaseCtx*)iAdaptContext, &event );
+        }
+    iMarkerPositionTimer->Stop();
+    iPlayItfPositionUpdateTimer->Stop();
     }
 
 // from MMdaObjectStateChangeObserver
 void CMMFBackendEngine::MoscoStateChangeEvent(CBase* /*aObject*/, TInt aPreviousState, TInt aCurrentState, TInt aErrorCode)
     {
+    TInt err(KErrNone);
     iPreviousRecordState = aPreviousState;
     iCurrentRecordState = aCurrentState;
     iErrorCode = aErrorCode;
-    RDebug::Print(_L("CMMFBackendEngine::MoscoStateChangeEvent 1 Error[%d]"),aErrorCode);  
-    if(iCurrentRecordState == CMdaAudioClipUtility::EOpen)  //EOpen
+    //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 (iErrorCode == KErrNone)
             {
             if (iPreviousRecordState == CMdaAudioClipUtility::ENotReady)
                 {
-                RDebug::Print(_L("CMMFBackendEngine::MoscoStateChangeEvent 2"));    
+                //RDebug::Print(_L("CMMFBackendEngine::MoscoStateChangeEvent 2"));
+                TRAP(err,iaudioInputRecord = CAudioInput::NewL( *iAudioRecorder ));
+                RArray<CAudioInput::TAudioInputPreference> inputArray;
+                inputArray.Append( CAudioInput::EDefaultMic );
+                // Set Audio Input
+                iaudioInputRecord->SetAudioInputL( inputArray.Array( ) );
+                inputArray.Close();
                 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)
+                //RDebug::Print(_L("CMMFBackendEngine::MoscoStateChangeEvent 3 [%d]"),ret);
+                if (ret != KErrNone && iFileFormat == XA_CONTAINERTYPE_MP4)
                     {
                     iPauseSupportMP4 = FALSE;
                     }
-                if(iActiveSchedulerWait->IsStarted())
+                if (iActiveSchedulerWait->IsStarted())
                     {
                     iActiveSchedulerWait->AsyncStop();
                     }
@@ -401,21 +484,21 @@
             }
         else
             {
-            XAAdaptEventMMF event = {XA_RECORDITFEVENTS, XA_OBJECT_EVENT_RESOURCES_LOST, 0, NULL};
-            XAAdaptationBaseMMF_SendAdaptEvents((XAAdaptationBaseMMFCtx*)iAdaptContext, &event );
+            XAAdaptEvent event = {XA_RECORDITFEVENTS, XA_OBJECT_EVENT_RESOURCES_LOST, 0, NULL};
+            XAAdaptationBase_SendAdaptEvents((XAAdaptationBaseCtx*)iAdaptContext, &event );
             }
         }
-    else if(iCurrentRecordState == CMdaAudioClipUtility::ERecording)  //ERecording
+    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 );
+        XAAdaptEvent event = {XA_RECORDITFEVENTS, XA_RECORDEVENT_HEADMOVING, 0, NULL};
+        XAAdaptationBase_SendAdaptEvents((XAAdaptationBaseCtx*)iAdaptContext, &event );
         }
     else   //ENotReady
         {
         //outputfile is not open
-        iRecordState = CMMFBackendEngine::ERecorderNotReady;   
+        iRecordState = CMMFBackendEngine::ERecorderNotReady;
         }
     }
 
@@ -429,13 +512,13 @@
             iRecordState = ERecorderNotReady;
             break;
         case ERecorderOpen:
-            if(iFileFormat == XA_CONTAINERTYPE_MP4 && !iPauseSupportMP4 && !stopCalled)
+            if (iFileFormat == XA_CONTAINERTYPE_MP4 && !iPauseSupportMP4 && !stopCalled)
                 {
                 err = KErrNotSupported;
                 return err;
-                }            
+                }
             iPositionUpdateTimer->Stop();
-            iAudioRecorder->Stop(); 
+            iAudioRecorder->Stop();
             iRecordState = ERecorderOpen;
             break;
         case ERecorderRecording:
@@ -445,123 +528,50 @@
     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()
+void CMMFBackendEngine::Close()
     {
-	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 (iMarkerPositionTimer)
         {
-        if(iAPIBeingUsed == EAudioPlayerUtility)
-            {
-            iAudioPlayer->Play();  
-            }
-        else
-            {
-            iVideoPlayer->Play();
-            }
-        iPlayerState = EPlayerPlaying;
+        iMarkerPositionTimer->Stop();
         }
-    }
-
-void CMMFBackendEngine::PausePlayback()
-    {
-    if(iAPIBeingUsed == EAudioPlayerUtility)
-        {
-        AudioPause();
-        }
-    else
+    if (iPlayItfPositionUpdateTimer)
         {
-        TRAPD(err, iVideoPlayer->PauseL());
-        if(err != KErrNone)
-            {
-            
-            }
-        } 
-    iPlayerState = EPlayerPaused;
-    }
+        iPlayItfPositionUpdateTimer->Stop();
+        }
 
-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;
+        switch(iMMFPlayerState)
+            {
+            case EPlayerPlaying:
+            case EPlayerPaused:
+            case EPlayerPrepared:
+                iVideoPlayer->Stop();
+            case EPlayerOpened:
+            if (m_pWs && m_pScr && m_pWindow)
+                {
+                iVideoPlayer->RemoveDisplayWindow(*m_pWindow);
+                }
+                iVideoPlayer->Close();
+            case EPlayerClosed:
+            default:
+                break;
+            };
         }
-    
+
     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;
+        iPositionUpdateTimer->Stop();
         }
 
     if(iActiveSchedulerWait)
@@ -570,35 +580,49 @@
             {
             iActiveSchedulerWait->AsyncStop();
             }
-        delete iActiveSchedulerWait;
-        iActiveSchedulerWait = NULL;
-        } 
+        }
     }
 
-void CMMFBackendEngine::SetNativeDisplayInformation(void* display_info)
+void CMMFBackendEngine::Destroy()
     {
-	//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)
+
+    if (iBaseAudioRecorder)
+        {
+        iAudioRecorder->Close();
+        }
+
+    if (iActiveSchedulerWait && iActiveSchedulerWait->IsStarted())
         {
-        m_pScr->Construct();
+        iActiveSchedulerWait->AsyncStop();
         }
+
+    delete iPositionUpdateTimer;
+    iPositionUpdateTimer = NULL;
+    delete iUri;
+    iUri = NULL;
+    delete iMarkerPositionTimer;
+    iMarkerPositionTimer = NULL;
+    delete iPlayItfPositionUpdateTimer;
+    iPlayItfPositionUpdateTimer = NULL;
+    delete iBaseVideoPlayer;
+    iBaseVideoPlayer = NULL;
+    iVideoPlayer = NULL;
+    if (iaudioInputRecord)
+        {
+        delete iaudioInputRecord;
+        iaudioInputRecord = NULL;
+        }
+		
+    delete iBaseAudioPlayer;
+    iBaseAudioPlayer = NULL;
+    iAudioPlayer = NULL;
+    delete iBaseAudioRecorder;
+    iBaseAudioRecorder = NULL;
+    iAudioRecorder = NULL;
+    delete iActiveSchedulerWait;
+    iActiveSchedulerWait = NULL;
+    delete m_pScr;
+    m_pScr = NULL;
     }
 
 TInt CMMFBackendEngine::GetRecordPosition(XAuint64* position)
@@ -620,68 +644,140 @@
     TInt err(KErrNone);
     iAdaptContext = adaptcontext;
     TRAP(err, iPositionUpdateTimer = new (ELeave) LocalTimer(this, iAdaptContext));
-    if(!err)
+    if (!err)
         {
         iPositionUpdateTimer->PostInit();
         }
     return err;
     }
 
-TInt CMMFBackendEngine::GetEncoderId(XAuint32* encoderId)
+TInt CMMFBackendEngine::GetCodecId(XAuint32* codecid)
     {
     TInt err(KErrNone);
-    if(iRecordState == CMMFBackendEngine::ERecorderOpen)
+
+    if(iAPIBeingUsed == EAudioRecorderUtility)
         {
-        TFourCC dest;
-        TRAP(err, dest = iAudioRecorder->DestinationDataTypeL());
-        if(err == KErrNone)
+        if(iRecordState != CMMFBackendEngine::ERecorderNotReady)
             {
-            *encoderId = dest.FourCC();
+            TFourCC dest;
+            TRAP(err, dest = iAudioRecorder->DestinationDataTypeL());
+            if(err == KErrNone)
+                {
+                *codecid = dest.FourCC();
+                }
+            }
+        }
+    else if(iAPIBeingUsed == EAudioPlayerUtility)
+        {
+        if(iMediaPlayerState != XA_PLAYSTATE_PLAYERUNINITIALIZED)
+            {
+            TMMFMessageDestinationPckg pckg(KUidInterfaceMMFAudioController);
+            TPckgBuf<TMMFAudioConfig> configPackage;
+            TInt err =  iAudioPlayer->CustomCommandSync(pckg,
+                                                        EMMFAudioControllerGetSourceDataType,
+                                                        KNullDesC8,
+                                                        KNullDesC8,
+                                                        configPackage);
+            if(err == KErrNone)
+                {
+                *codecid = configPackage().iSourceDataTypeCode.FourCC();
+                }
             }
         }
     return err;
     }
 
-TInt CMMFBackendEngine::GetDestinationBitRate(XAuint32* bitrate)
+TInt CMMFBackendEngine::GetBitRate(XAuint32* bitrate)
     {
     TInt err(KErrNone);
     TUint br(0);
-    if(iRecordState == CMMFBackendEngine::ERecorderOpen)
+    if(iAPIBeingUsed == EAudioRecorderUtility)
         {
-        TRAP(err, br = iAudioRecorder->DestinationBitRateL());
-        if(err == KErrNone)
+        if(iRecordState != CMMFBackendEngine::ERecorderNotReady)
             {
+            TRAP(err, br = iAudioRecorder->DestinationBitRateL());
+            if(err == KErrNone)
+                {
+                *bitrate = br;
+                }
+            }
+        }
+    else if(iAPIBeingUsed == EAudioPlayerUtility)
+        {
+        if(iMediaPlayerState != XA_PLAYSTATE_PLAYERUNINITIALIZED)
+            {
+            TInt err =  iAudioPlayer->GetBitRate(br);
             *bitrate = br;
             }
         }
     return err;
     }
 
-TInt CMMFBackendEngine::GetDestinationSampleRate(XAmilliHertz* samplerate)
+TInt CMMFBackendEngine::GetSampleRate(XAmilliHertz* samplerate)
     {
     TInt err(KErrNone);
     TUint sr(0);
-    if(iRecordState == CMMFBackendEngine::ERecorderOpen)
+    if(iAPIBeingUsed == EAudioRecorderUtility)
+        {
+        if(iRecordState != CMMFBackendEngine::ERecorderNotReady)
+            {
+            TRAP(err, sr = iAudioRecorder->DestinationSampleRateL());
+            if(err == KErrNone)
+                {
+                *samplerate = sr;
+                }
+            }
+        }
+    else if(iAPIBeingUsed == EAudioPlayerUtility)
         {
-        TRAP(err, sr = iAudioRecorder->DestinationSampleRateL());
-        if(err == KErrNone)
+        if(iMediaPlayerState != XA_PLAYSTATE_PLAYERUNINITIALIZED)
             {
-            *samplerate = sr;
+            TMMFMessageDestinationPckg pckg(KUidInterfaceMMFAudioController);
+            TPckgBuf<TMMFAudioConfig> configPackage;
+            TInt err =  iAudioPlayer->CustomCommandSync(pckg,
+                                                        EMMFAudioControllerGetSourceSampleRate,
+                                                        KNullDesC8,
+                                                        KNullDesC8,
+                                                        configPackage);
+            if(err == KErrNone)
+                {
+                *samplerate = configPackage().iSampleRate;
+                }
             }
         }
     return err;
     }
 
-TInt CMMFBackendEngine::GetDestinationChannels(XAuint32* channels)
+TInt CMMFBackendEngine::GetChannels(XAuint32* channels)
     {
     TInt err(KErrNone);
     TUint ch(0);
-    if(iRecordState == CMMFBackendEngine::ERecorderOpen)
+    if(iAPIBeingUsed == EAudioRecorderUtility)
+        {
+        if(iRecordState != CMMFBackendEngine::ERecorderNotReady)
+            {
+            TRAP(err,ch = iAudioRecorder->DestinationNumberOfChannelsL());
+            if(err == KErrNone)
+                {
+                *channels = ch;
+                }
+            }
+        }
+    else if(iAPIBeingUsed == EAudioPlayerUtility)
         {
-        TRAP(err,ch = iAudioRecorder->DestinationNumberOfChannelsL());
-        if(err == KErrNone)
+        if(iMediaPlayerState != XA_PLAYSTATE_PLAYERUNINITIALIZED)
             {
-            *channels = ch;
+            TMMFMessageDestinationPckg pckg(KUidInterfaceMMFAudioController);
+            TPckgBuf<TMMFAudioConfig> configPackage;
+            TInt err =  iAudioPlayer->CustomCommandSync(  pckg,
+                                                        EMMFAudioControllerGetSourceNumChannels,
+                                                        KNullDesC8,
+                                                        KNullDesC8,
+                                                        configPackage   );
+            if(err == KErrNone)
+                {
+                *channels = configPackage().iChannels;
+                }
             }
         }
     return err;
@@ -718,10 +814,10 @@
 TInt CMMFBackendEngine::SetDestinationChannels(XAuint32* channels)
     {
     TInt err(KErrNone);
-    if(iRecordState == CMMFBackendEngine::ERecorderOpen)
+    if (iRecordState == CMMFBackendEngine::ERecorderOpen)
         {
         TRAP(err,iAudioRecorder->SetDestinationNumberOfChannelsL(*channels));
-        if(err != KErrNone)
+        if (err != KErrNone)
             {
             return XA_RESULT_PARAMETER_INVALID;
             }
@@ -729,103 +825,811 @@
     return err;
     }
 
+/*
+XAresult 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;
+    return XA_RESULT_SUCCESS;
+    }
+
+*/
+XAresult CMMFBackendEngine::CreateAndConfigureWindowL()
+    {
+#ifdef USE_LOCAL_WINDOW_RESOURCES
+    // 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 /* USE_LOCAL_WINDOW_RESOURCES */
+
+    return XA_RESULT_SUCCESS;
+    }
+
+XAresult CMMFBackendEngine::SetNativeDisplayInformation(void* display_info)
+    {
+    XAresult retVal(XA_RESULT_SUCCESS);
+    //display_info is of type XADataSink
+    //display_info.pLocator is of type XADataLocator_NativeDisplay
+    XADataLocator_NativeDisplay* nativeDisplay;
+    XADataSink* videoSink = (XADataSink*)display_info;
+
+    if (videoSink)
+        {
+        nativeDisplay = (XADataLocator_NativeDisplay*) (videoSink->pLocator);
+        m_pWindow = ((RWindow*)(nativeDisplay->hWindow));
+        m_pWs = ((RWsSession*)(nativeDisplay->hDisplay));
+    /*
+        m_cropRegion = TRect(m_pWindow->Size());
+        m_videoExtent = TRect(m_pWindow->Size());
+        m_cropRect = TRect(m_pWindow->Size());
+        m_clipRect = TRect(m_pWindow->Size());
+        m_cropRegion = TRect(m_pWindow->Size());
+    */
+        if (m_pWs)
+            {
+            delete m_pScr;
+            m_pScr = NULL;
+            TRAPD(err, m_pScr = new CWsScreenDevice(*m_pWs));
+            RET_IF_ERR(err, XA_RESULT_MEMORY_FAILURE);
+            m_pScr->Construct();
+            }
+        }
+    return retVal;
+    }
+
+XAresult CMMFBackendEngine::ResumePlayback()
+    {
+    XAresult retVal(XA_RESULT_SUCCESS);
+    TBool postHeadMovingEvent(EFalse);
+    switch (iMediaPlayerState)
+        {
+        case XA_PLAYSTATE_STOPPED:
+        case XA_PLAYSTATE_PAUSED:
+            /* If we are already at the end of clip, do nothing
+             * check ::MapcPlayComplete for documentation */
+            if ((iPlaybackHead < iMediaDuration) &&
+                    ((iAPIBeingUsed == EAudioPlayerUtility) ||
+                     (iAPIBeingUsed == EVideoPlayerUtility)) )
+                {
+                if (iAPIBeingUsed == EAudioPlayerUtility)
+                    {
+                    TAG_TIME_PROFILING_BEGIN;
+                    iAudioPlayer->Play();
+                    TAG_TIME_PROFILING_END;
+                    PRINT_TO_CONSOLE_TIME_DIFF;                    
+                    }
+                else if (iAPIBeingUsed == EVideoPlayerUtility)
+                    {
+                    TAG_TIME_PROFILING_BEGIN;
+                    //iVideoPlayer->Play( iPlaybackHead, iMediaDuration);
+                    iVideoPlayer->Play();
+                    TAG_TIME_PROFILING_END;
+                    PRINT_TO_CONSOLE_TIME_DIFF;
+                    }
+                postHeadMovingEvent = ETrue;
+                iMediaPlayerState = XA_PLAYSTATE_PLAYING;
+                iMMFPlayerState = EPlayerPlaying;
+                iMarkerPositionTimer->Start();
+                iPlayItfPositionUpdateTimer->Start();
+                }
+            break;
+        case XA_PLAYSTATE_PLAYING:
+            break;
+        case XA_PLAYSTATE_PLAYERUNINITIALIZED:
+        default:
+            retVal = XA_RESULT_INTERNAL_ERROR;
+            break;
+        }
+
+    if (postHeadMovingEvent)
+        {
+        DoPostEvent(XA_PLAYEVENT_HEADMOVING);
+        }
+    return retVal;
+    }
+
+XAresult CMMFBackendEngine::PausePlayback()
+    {
+    XAresult retVal(XA_RESULT_SUCCESS);
+    switch (iMediaPlayerState)
+        {
+        case XA_PLAYSTATE_PLAYING:
+        case XA_PLAYSTATE_STOPPED:
+            if ((iAPIBeingUsed == EAudioPlayerUtility) ||
+                (iAPIBeingUsed == EVideoPlayerUtility) )
+                {
+                TInt pauseOpRes(KErrNone);
+                if (iAPIBeingUsed == EAudioPlayerUtility)
+                    {
+                    TAG_TIME_PROFILING_BEGIN;
+                    pauseOpRes = iAudioPlayer->Pause();
+                    TAG_TIME_PROFILING_END;
+                    PRINT_TO_CONSOLE_TIME_DIFF;
+                    }
+                else if (iAPIBeingUsed == EVideoPlayerUtility)
+                    {
+                    TAG_TIME_PROFILING_BEGIN;
+                    TRAP(pauseOpRes, iVideoPlayer->PauseL());
+                    if (pauseOpRes == KErrNone)
+                        {
+                        TRAPD(err, iPlaybackHead = iVideoPlayer->PositionL());
+                        if (err != KErrNone)
+                            {
+                            iPlaybackHead = 0;
+                            }
+                        }
+                    TAG_TIME_PROFILING_END;
+                    PRINT_TO_CONSOLE_TIME_DIFF;
+                    }
+                if ( pauseOpRes == KErrNone)
+                    {
+                    iMediaPlayerState = XA_PLAYSTATE_PAUSED;
+                    iMMFPlayerState = EPlayerPaused;
+                    iMarkerPositionTimer->Stop();
+                    iPlayItfPositionUpdateTimer->Stop();
+                    }
+                }
+            break;
+        case XA_PLAYSTATE_PAUSED:
+            break;
+        case XA_PLAYSTATE_PLAYERUNINITIALIZED:
+        default:
+            retVal = XA_RESULT_INTERNAL_ERROR;
+            break;
+        }
+    return retVal;
+    }
+
+XAresult CMMFBackendEngine::StopPlayback()
+    {
+    XAresult retVal(XA_RESULT_SUCCESS);
+    switch (iMediaPlayerState)
+        {
+        case XA_PLAYSTATE_PAUSED:
+        case XA_PLAYSTATE_PLAYING:
+            if ((iAPIBeingUsed == EAudioPlayerUtility) ||
+                (iAPIBeingUsed == EVideoPlayerUtility) )
+                {
+                if (iAPIBeingUsed == EAudioPlayerUtility)
+                    {
+                    TAG_TIME_PROFILING_BEGIN;
+                    iAudioPlayer->Stop();
+                    TAG_TIME_PROFILING_END;
+                    PRINT_TO_CONSOLE_TIME_DIFF;
+
+                    iMMFPlayerState = EPlayerOpened;
+                    }
+                else if (iAPIBeingUsed == EVideoPlayerUtility)
+                    {
+                    TAG_TIME_PROFILING_BEGIN;
+                    iVideoPlayer->Stop();
+                    TAG_TIME_PROFILING_END;
+                    PRINT_TO_CONSOLE_TIME_DIFF;
+                    
+                    iMMFPlayerState = EPlayerPrepared;
+                    }
+                iMediaPlayerState = XA_PLAYSTATE_STOPPED;
+                iPlaybackHead = 0;
+                iMarkerPositionTimer->Stop();
+                iPlayItfPositionUpdateTimer->Stop();
+                }
+            break;
+        case XA_PLAYSTATE_STOPPED:
+            break;
+        case XA_PLAYSTATE_PLAYERUNINITIALIZED:
+        default:
+            retVal = XA_RESULT_INTERNAL_ERROR;
+            break;
+        }
+    return retVal;
+    }
+XAresult CMMFBackendEngine::GetPlayState(XAuint32 *pState)
+    {
+    XAresult retVal(XA_RESULT_INTERNAL_ERROR);
+    switch (iMediaPlayerState)
+        {
+        case XA_PLAYSTATE_STOPPED:
+        case XA_PLAYSTATE_PAUSED:
+        case XA_PLAYSTATE_PLAYING:
+            *pState = iMediaPlayerState;
+            retVal = XA_RESULT_SUCCESS;
+            break;
+        case XA_PLAYSTATE_PLAYERUNINITIALIZED:
+        default:
+            break;
+        }
+    return retVal;
+    }
+
+XAresult CMMFBackendEngine::GetDuration(XAmillisecond *pMsec)
+    {
+    XAresult retVal(XA_RESULT_INTERNAL_ERROR);
+    /* to convert from microseconds to milliseconds */
+    TInt64 divider(1000);
+    switch (iMediaPlayerState)
+        {
+        case XA_PLAYSTATE_STOPPED:
+        case XA_PLAYSTATE_PAUSED:
+        case XA_PLAYSTATE_PLAYING:
+            /* TODO Check if we query from MMF*/
+            *pMsec = iMediaDuration.Int64() / divider;
+            retVal = XA_RESULT_SUCCESS;
+            break;
+        case XA_PLAYSTATE_PLAYERUNINITIALIZED:
+        default:
+            break;
+        }
+    return retVal;
+    }
+
+XAresult CMMFBackendEngine::GetPosition(XAmillisecond *pMsec)
+    {
+    XAresult retVal(XA_RESULT_INTERNAL_ERROR);
+    TInt64 divider(1000);
+    TTimeIntervalMicroSeconds pos;
+    switch (iMediaPlayerState)
+        {
+        case XA_PLAYSTATE_STOPPED:
+        case XA_PLAYSTATE_PAUSED:
+        case XA_PLAYSTATE_PLAYING:
+            if (iAPIBeingUsed == EAudioPlayerUtility)
+                {
+                if (iAudioPlayer->GetPosition(pos) == KErrNone)
+                    {
+                    *pMsec = pos.Int64() / divider;
+                    retVal = XA_RESULT_SUCCESS;
+                    }
+                }
+            else if (iAPIBeingUsed == EVideoPlayerUtility)
+                {
+                TInt err(KErrNone);
+                TRAP(err, pos = iVideoPlayer->PositionL());
+                if (err == KErrNone)
+                    {
+                    *pMsec = pos.Int64() / divider; 
+                    retVal = XA_RESULT_SUCCESS;
+                    }
+                }
+            break;
+        case XA_PLAYSTATE_PLAYERUNINITIALIZED:
+        default:
+            break;
+        }
+    return retVal;
+    }
+
+XAresult CMMFBackendEngine::SetPosition(XAmillisecond pMsec)
+    {
+    XAresult retVal(XA_RESULT_INTERNAL_ERROR);
+    TInt64 multiplier(1000);
+    TTimeIntervalMicroSeconds pos;
+    switch (iMediaPlayerState)
+        {
+        case XA_PLAYSTATE_STOPPED:
+        case XA_PLAYSTATE_PAUSED:
+        case XA_PLAYSTATE_PLAYING:
+            if(iAPIBeingUsed == EAudioPlayerUtility)
+                {
+                pos = pMsec * multiplier;
+                TAG_TIME_PROFILING_BEGIN;
+                iAudioPlayer->SetPosition(pos);
+                TAG_TIME_PROFILING_END;
+                PRINT_TO_CONSOLE_TIME_DIFF;
+
+                retVal = XA_RESULT_SUCCESS;
+                }
+            else if (iAPIBeingUsed == EVideoPlayerUtility)
+                {
+                pos = pMsec * multiplier;
+                TAG_TIME_PROFILING_BEGIN;
+                TRAPD(err, iVideoPlayer->SetPositionL(pos));
+                TAG_TIME_PROFILING_END;
+                PRINT_TO_CONSOLE_TIME_DIFF;
+                if (err == KErrNone)
+                    {
+                    retVal = XA_RESULT_SUCCESS;
+                    }
+                }
+            break;
+        case XA_PLAYSTATE_PLAYERUNINITIALIZED:
+        default:
+            break;
+        }
+    return retVal;
+    }
+
+XAresult CMMFBackendEngine::SetRepeats(XAboolean repeat)
+    {
+    XAresult retVal(XA_RESULT_INTERNAL_ERROR);
+    TInt numRepeats(0);
+    switch (iMediaPlayerState)
+        {
+        case XA_PLAYSTATE_STOPPED:
+        case XA_PLAYSTATE_PAUSED:
+        case XA_PLAYSTATE_PLAYING:
+            if(iAPIBeingUsed == EAudioPlayerUtility)
+                {
+                numRepeats = repeat ? -2 : 0;
+                iAudioPlayer->SetRepeats(numRepeats, 0);
+                retVal = XA_RESULT_SUCCESS;
+                }
+            else
+                {
+                }
+            break;
+        case XA_PLAYSTATE_PLAYERUNINITIALIZED:
+        default:
+            break;
+        }
+    return retVal;
+    }
+
+XAresult CMMFBackendEngine::SetPlayWindow(XAmillisecond start, XAmillisecond end)
+    {
+    XAresult retVal(XA_RESULT_INTERNAL_ERROR);
+    TInt64 multiplier(1000);
+    TTimeIntervalMicroSeconds startpos(0);
+    TTimeIntervalMicroSeconds endpos(0);
+
+    switch (iMediaPlayerState)
+        {
+        case XA_PLAYSTATE_STOPPED:
+        case XA_PLAYSTATE_PAUSED:
+        case XA_PLAYSTATE_PLAYING:
+            if(iAPIBeingUsed == EAudioPlayerUtility)
+                {
+                startpos = start * multiplier;
+                endpos = end * multiplier;
+                retVal = iAudioPlayer->SetPlayWindow(startpos,endpos);
+                }
+            else
+                {
+                }
+            break;
+        case XA_PLAYSTATE_PLAYERUNINITIALIZED:
+        default:
+            break;
+        }
+    return retVal;
+    }
+
+XAresult CMMFBackendEngine::SetPlayAdaptContext(void * adaptcontext)
+    {
+    XAresult retVal(XA_RESULT_SUCCESS);
+
+    iAdaptContext = adaptcontext;
+
+    return retVal;
+    }
+
+XAresult CMMFBackendEngine::RegisterCallback(xaPlayCallback cbFunction)
+    {
+    iPlayItfCBFunction = cbFunction;
+    return DoHandlePlayItfAttributesChanged();
+    }
+
+XAresult CMMFBackendEngine::SetCallbackEventsMask(XAuint32 eventflags)
+    {
+    iPlayItfEventFlags = eventflags;
+    return DoHandlePlayItfAttributesChanged();
+    }
+
+XAresult CMMFBackendEngine::SetMarkerPosition(XAmillisecond mSec)
+    {
+    iMarkerPosition = mSec;
+    return DoHandlePlayItfAttributesChanged();
+    }
+
+XAresult CMMFBackendEngine::ClearMarkerPosition()
+    {
+    iMarkerPosition = XA_TIME_UNKNOWN;
+    DoHandlePlayItfAttributesChanged();
+    return XA_RESULT_SUCCESS;
+    }
+
+XAresult CMMFBackendEngine::SetPositionUpdatePeriod(XAmillisecond mSec)
+    {
+    iPositionUpdatePeriod = mSec;
+    DoHandlePlayItfAttributesChanged();
+    return XA_RESULT_SUCCESS;
+    }
+
+XAresult CMMFBackendEngine::DoHandlePlayItfAttributesChanged()
+    {
+    XAresult retVal(XA_RESULT_SUCCESS);
+
+    iMarkerPositionTimer->SetCallbackEventMask(iPlayItfEventFlags);
+    iMarkerPositionTimer->RegisterCallback(iPlayItfCBFunction);
+    iMarkerPositionTimer->SetMarkerPosition(iMarkerPosition);
+
+    iPlayItfPositionUpdateTimer->SetCallbackEventMask(iPlayItfEventFlags);
+    iPlayItfPositionUpdateTimer->RegisterCallback(iPlayItfCBFunction);
+    iPlayItfPositionUpdateTimer->SetPositionUpdatePeriod(iPositionUpdatePeriod);
+
+    switch (iMediaPlayerState)
+        {
+        case XA_PLAYSTATE_STOPPED:
+        case XA_PLAYSTATE_PAUSED:
+            break;
+        case XA_PLAYSTATE_PLAYING:
+            iMarkerPositionTimer->Start();
+            iPlayItfPositionUpdateTimer->Start();
+            break;
+        case XA_PLAYSTATE_PLAYERUNINITIALIZED:
+        default:
+            break;
+        }
+    return retVal;
+    }
+
+void CMMFBackendEngine::DoPostEvent(XAuint32 event)
+    {
+    if ((iPlayItfEventFlags & event) &&
+        (iPlayItfCBFunction != NULL))
+        {
+        XAAdaptEvent xaevent = {XA_PLAYITFEVENTS, event, 0, 0 };
+        XAAdaptationBase_SendAdaptEvents((XAAdaptationBaseCtx*)iAdaptContext, &xaevent );
+        }
+    }
+
+XAresult CMMFBackendEngine::GetNumStreams(XAuint32* numstreams)
+    {
+    XAresult retVal(XA_RESULT_SUCCESS);
+    TInt bitRate(0);
+    TInt numS(0);
+    if(iAPIBeingUsed == EAudioPlayerUtility)
+        {
+        numS = 1;
+        *numstreams = numS;
+        }
+    else if (iAPIBeingUsed == EVideoPlayerUtility)
+        {
+        TRAPD(err, bitRate = iVideoPlayer->VideoBitRateL());
+        if(!err && bitRate)
+            {
+            numS++;
+            *numstreams = numS;
+            }
+        
+        bitRate = 0;
+        TRAP(err, bitRate = iVideoPlayer->AudioBitRateL());
+        if(!err && bitRate)
+            {
+            numS++;
+            *numstreams = numS;
+            }
+        }
+    return retVal;
+    }
+
+XAresult CMMFBackendEngine::GetStreamInfo(XAuint32 streamindex, XAuint32* streamtype)
+    {
+    XAresult retVal(XA_RESULT_SUCCESS);
+    if(iAPIBeingUsed == EAudioPlayerUtility)
+        {
+        *streamtype = XA_DOMAINTYPE_AUDIO;
+        }
+    else if (iAPIBeingUsed == EVideoPlayerUtility)
+        {
+        switch(streamindex)
+            {
+            case 1:
+                *streamtype = XA_DOMAINTYPE_VIDEO;
+                break;
+            case 2:
+                *streamtype = XA_DOMAINTYPE_AUDIO;
+                break;
+            default:
+                retVal = XA_RESULT_PARAMETER_INVALID;
+                break;
+            }
+        }
+    return retVal;
+    }
+
+
+XAresult CMMFBackendEngine::GetVideoFrameSize(XAuint32* height, XAuint32* width, XAuint32* frameRate)
+    {
+    XAresult retVal(XA_RESULT_SUCCESS);
+    if(iAPIBeingUsed == EVideoPlayerUtility)
+        {
+        if(iMediaPlayerState != XA_PLAYSTATE_PLAYERUNINITIALIZED)
+            {
+            TSize size;
+            TReal32 framerate(0);
+            TRAPD(err, iVideoPlayer->VideoFrameSizeL(size));
+            if(!err)
+                {
+                *height = size.iHeight;
+                *width = size.iWidth;
+                }
+            else
+                {
+                retVal = err;
+                }
+
+            TRAP(err, framerate = iVideoPlayer->VideoFrameRateL());
+            if(!err)
+                {
+                *frameRate = framerate;
+                }
+            }
+        else
+            {
+            retVal = XA_RESULT_PRECONDITIONS_VIOLATED;
+            }
+        }
+    else
+        {
+        retVal = XA_RESULT_FEATURE_UNSUPPORTED;
+        }
+    return retVal;
+    }
+
+XAresult CMMFBackendEngine::SetActiveState(XAuint32 streamindex, XAboolean active)
+    {
+    XAresult retVal(XA_RESULT_SUCCESS);
+    TInt err(KErrNone);
+    if(iAPIBeingUsed == EAudioPlayerUtility)
+        {
+        retVal = XA_RESULT_FEATURE_UNSUPPORTED;
+        }
+    else if (iAPIBeingUsed == EVideoPlayerUtility)
+        {
+        switch(streamindex)
+            {
+            case 1:
+                TRAP(err, iVideoPlayer->SetVideoEnabledL(active));
+                retVal = err;
+                break;
+            case 2:
+                TRAP(err, iVideoPlayer->SetAudioEnabledL(active));
+                retVal = err;
+                break;
+            default:
+                retVal = XA_RESULT_PARAMETER_INVALID;
+                break;
+            }
+        }
+    return retVal;
+    }
+
+TInt CMMFBackendEngine::InitializeURIForMMFUtil(char *uri)
+    {
+    /* Initializes and save uri param into iUri structure */
+    TInt err(KErrNone);
+    TInt uriLen;
+    
+    if (!uri)
+        return KErrArgument;
+
+    if (iUri)
+        {
+        delete iUri;
+        iUri = NULL;
+        }
+    
+    uriLen = strlen(uri);
+    TPtr8 uriParam((TUint8*)uri, uriLen, uriLen);
+    
+    TRAP(err, iUri = HBufC::NewL(uriLen));
+    if (err != KErrNone)
+        return err;
+
+    iUriPtr.Set(iUri->Des());
+    iUriPtr.Copy(uriParam); /* Copy data*/
+    iUriPtr.LowerCase();
+
+    /* For file scheme convert from file:///c:/folder/file.ext
+     * format to c:\\folder\\file.ext using TUriParser. */
+    _LIT(KFileScheme,"file:///");
+    if (iUriPtr.Find(KFileScheme) >= 0)
+        {
+        TPtr tmp(const_cast<TUint16 *>(iUriPtr.Ptr()) + KFileScheme().Length(),
+                iUriPtr.Length(),
+                iUriPtr.Length());
+        /* Convert from c:/folder/file.ext format to
+         * c:\\folder\\file.ext using TUriParser.
+         * TUriParser8 accepts uri in format file:///c/folder/file.ext,
+         * so get rid of ':' after drive letter (if any) */
+        TInt pos = tmp.Find(_L(":"));
+        if (pos != KErrNotFound)
+            {
+            iUriPtr.Delete(KFileScheme().Length() + pos, 1);
+            }
+
+        TUriParser16 uriParser;
+        err = uriParser.Parse(iUriPtr);
+        if (err != KErrNone)
+            return err;
+
+        HBufC* file = NULL;
+        TRAP(err, file = uriParser.GetFileNameL());
+        if (err != KErrNone)
+            return err;
+
+        iUriPtr.Copy(file->Des());
+        delete file;
+        file = NULL;
+
+        }
+    return err;
+    }
+
+
+XAresult CMMFBackendEngine::SetVolume(XAuint32 volume)
+    {
+    XAresult retVal(XA_RESULT_SUCCESS);
+    TInt err(KErrNone);
+    if(iAPIBeingUsed == EAudioPlayerUtility)
+        {
+        retVal = iAudioPlayer->SetVolume(volume);
+        }
+    else if (iAPIBeingUsed == EVideoPlayerUtility)
+        {
+        TRAP(err, iVideoPlayer->SetVolumeL(volume));
+        retVal = err;
+        }
+    else if(iAPIBeingUsed == EAudioRecorderUtility)
+        {
+        retVal = iAudioRecorder->SetVolume(volume);
+        }
+    return retVal;    
+    }
+
+XAresult CMMFBackendEngine::GetMaxVolume(XAuint32* maxvolume)
+    {
+    XAresult retVal(XA_RESULT_SUCCESS);
+    if(iAPIBeingUsed == EAudioPlayerUtility)
+        {
+        *maxvolume = iAudioPlayer->MaxVolume();
+        }
+    else if (iAPIBeingUsed == EVideoPlayerUtility)
+        {
+        *maxvolume = iVideoPlayer->MaxVolume();
+        }
+    else if(iAPIBeingUsed == EAudioRecorderUtility)
+        {
+        *maxvolume = iAudioRecorder->MaxVolume();
+        }
+    return retVal;     
+    }
+
+XAresult CMMFBackendEngine::GetVolume(XAuint32* volume)
+    {
+    XAresult retVal(XA_RESULT_SUCCESS);
+    TInt mmfvolume(0);
+    if(iAPIBeingUsed == EAudioPlayerUtility)
+        {
+        retVal = iAudioPlayer->GetVolume(mmfvolume);
+        if(retVal == XA_RESULT_SUCCESS)
+            {
+            *volume = mmfvolume;
+            }
+        }
+    else if (iAPIBeingUsed == EVideoPlayerUtility)
+        {
+        *volume = iVideoPlayer->Volume();
+        }
+    else if(iAPIBeingUsed == EAudioRecorderUtility)
+        {
+        retVal = iAudioRecorder->GetVolume(mmfvolume);
+        if(retVal == XA_RESULT_SUCCESS)
+            {
+            *volume = mmfvolume;
+            }
+        }
+    return retVal;     
+    }
+
 extern "C" {
 
     int mmf_backend_engine_init(void** engine)
-    { 
+    {
         TRAPD(err, *engine = CMMFBackendEngine::NewL());
         return err;
-        /*int err = CreateEngine(engine);
-        return err;*/
     }
-        
+
+    void mmf_backend_engine_deinit(void* engine)
+    {
+        delete ((CMMFBackendEngine*)engine);
+    }
+
     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)
+    void mmf_close(void* context)
     {
-        ((CMMFBackendEngine*)(context))->PausePlayback();      
+        ((CMMFBackendEngine*)context)->Close();
     }
 
-    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); 
+        return ((CMMFBackendEngine*)(context))->SetRecorderState(CMMFBackendEngine::ERecorderRecording,FALSE);
     }
-    
+
     int mmf_stop_recording(void* context, XAboolean stopCalled )
     {
-        return ((CMMFBackendEngine*)(context))->SetRecorderState(CMMFBackendEngine::ERecorderOpen, 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)
+    }
+
+    int mmf_get_codec_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);
+        return ((CMMFBackendEngine*)(context))->GetCodecId(encoderId);
     }
 
-    int mmf_get_destination_bitrate(void* context, XAuint32* bitRate)
+    int mmf_get_channels(void* context, XAuint32* channelsIn)
+    {
+        return ((CMMFBackendEngine*)(context))->GetChannels(channelsIn);
+    }
+
+    int mmf_get_samplerate(void* context, XAmilliHertz* sampleRate)
     {
-        return ((CMMFBackendEngine*)(context))->GetDestinationBitRate(bitRate);
+        return ((CMMFBackendEngine*)(context))->GetSampleRate(sampleRate);
+    }
+
+    int mmf_get_bitrate(void* context, XAuint32* bitRate)
+    {
+        return ((CMMFBackendEngine*)(context))->GetBitRate(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);
@@ -835,5 +1639,135 @@
     {
         return ((CMMFBackendEngine*)(context))->SetDestinationBitRate(bitRate);
     }
+
+    XAresult mmf_set_play_adapt_context(void * context, void * adaptcontext)
+    {
+        return ((CMMFBackendEngine *)(context))->SetPlayAdaptContext(adaptcontext);
+    }
+
+    XAresult mmf_set_player_uri(void * context, char * uri, XAuint32 format)
+    {
+        return ((CMMFBackendEngine *)(context))->SetFileName(uri,format,CMMFBackendEngine::EPlay);
+    }
+
+/*
+    XAresult mmf_set_window_handle(void * context, void *  display_info)
+    {
+        return ((CMMFBackendEngine *)(context))->SetWindowHandle(display_info);
+    }
+
+*/
+    XAresult mmf_setup_native_display(void * context, void * display_info)
+    {
+        return ((CMMFBackendEngine *)(context))->SetNativeDisplayInformation(display_info);
+    }
+
+    XAresult mmf_playitf_resume_playback(void * context)
+    {
+        return ((CMMFBackendEngine *)(context))->ResumePlayback();
+    }
+
+    XAresult mmf_playitf_pause_playback(void * context)
+    {
+        return ((CMMFBackendEngine *)(context))->PausePlayback();
+    }
+
+    XAresult mmf_playitf_stop_playback(void * context)
+    {
+        return ((CMMFBackendEngine *)(context))->StopPlayback();
+    }
+
+    XAresult mmf_playitf_get_play_state(void * context, XAuint32 * pState)
+    {
+        return ((CMMFBackendEngine *)(context))->GetPlayState(pState);
+    }
+
+    XAresult mmf_playitf_get_duration(void * context, XAmillisecond * pMsec)
+    {
+        return ((CMMFBackendEngine *)(context))->GetDuration(pMsec);
+    }
+
+    XAresult mmf_playitf_get_position(void * context, XAmillisecond * pMsec)
+    {
+        return ((CMMFBackendEngine *)(context))->GetPosition(pMsec);
+    }
+
+    XAresult mmf_playitf_register_callback(void * context, xaPlayCallback callback)
+    {
+        return ((CMMFBackendEngine *)(context))->RegisterCallback(callback);
+    }
+
+    XAresult mmf_playitf_set_callback_events_mask(void * context, XAuint32 eventflags)
+    {
+        return ((CMMFBackendEngine *)(context))->SetCallbackEventsMask(eventflags);
+    }
+
+    XAresult mmf_playitf_set_marker_position(void * context, XAmillisecond mSec)
+    {
+        return ((CMMFBackendEngine *)(context))->SetMarkerPosition(mSec);
+    }
+
+    XAresult mmf_playitf_clear_marker_position(void * context)
+    {
+        return ((CMMFBackendEngine *)(context))->ClearMarkerPosition();
+
+    }
+
+    XAresult mmf_playitf_set_position_update_period(void * context, XAmillisecond mSec)
+    {
+        return ((CMMFBackendEngine *)(context))->SetPositionUpdatePeriod(mSec);
+    }
+
+    XAresult mmf_seekitf_set_position(void * context, XAmillisecond pMsec)
+    {
+        return ((CMMFBackendEngine *)(context))->SetPosition(pMsec);
+    }
+
+    XAresult mmf_seekitf_set_playwindow(void * context, XAmillisecond start, XAmillisecond end)
+    {
+        return ((CMMFBackendEngine *)(context))->SetPlayWindow(start,end);
+    }
+
+    XAresult mmf_seekitf_set_repeats(void * context, XAboolean repeat)
+    {
+        return ((CMMFBackendEngine *)(context))->SetRepeats(repeat);
+    }
+
+    XAresult mmf_streaminformationitf_get_streaminfo(void * context, XAuint32 streamindex,
+                                                                    XAuint32* streamtype)
+    {
+        return ((CMMFBackendEngine *)(context))->GetStreamInfo(streamindex, streamtype);
+    }
+
+    XAresult mmf_streaminformationitf_get_numstreams(void * context, XAuint32* numstreams)
+    {
+        return ((CMMFBackendEngine *)(context))->GetNumStreams(numstreams);
+    }
+
+    XAresult mmf_streaminformationitf_get_videoframesize(void * context, XAuint32* height,
+                                                        XAuint32* width, XAuint32* frameRate)
+    {
+        return ((CMMFBackendEngine *)(context))->GetVideoFrameSize(height,width,frameRate);
+    }
+
+    XAresult mmf_streaminformationitf_set_activestream(void * context, XAuint32 streamindex,
+                                                                    XAboolean active)
+    {
+        return ((CMMFBackendEngine *)(context))->SetActiveState(streamindex, active);
+    }
     
+    XAresult mmf_volumeitf_set_volume(void * context, XAuint32 volume)
+    {
+        return ((CMMFBackendEngine *)(context))->SetVolume(volume);
+    }    
+
+    XAresult mmf_volumeitf_get_maxvolume(void * context, XAuint32* volume)
+    {
+        return ((CMMFBackendEngine *)(context))->GetMaxVolume(volume);
+    }    
+    
+    XAresult mmf_volumeitf_get_volume(void * context, XAuint32* volume)
+    {
+        return ((CMMFBackendEngine *)(context))->GetVolume(volume);
+    }     
 }
--- a/khronosfws/openmax_al/src/mmf_adaptation/cmmfbackendengine.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/mmf_adaptation/cmmfbackendengine.h	Fri May 14 16:22:35 2010 +0300
@@ -14,11 +14,6 @@
 * Description: 
 *
 */
-/*
-Media Helper Class for handling surface events
-
-Shy Ward
-*/
 
 #ifndef XA_CMMFBackendEngine_H
 #define XA_CMMFBackendEngine_H
@@ -38,12 +33,14 @@
 #include <mmf/common/mmferrors.h>
 #include <mmf/common/Mmfbase.h>
 #include <MMFMetadataEventConfigConstants.h>
+#include <mmf/common/mmfstandardcustomcommands.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 <AudioInput.h>
 #include "sfmrlocaltimer.h"
 #endif
 
@@ -52,11 +49,13 @@
 
 #define MAX_EXTENSION_SIZE 10
 
+class CMarkerPositionTimer;
+class CPositionUpdateTimer;
 NONSHARABLE_CLASS(CMMFBackendEngine) : public CBase,
                           public MVideoPlayerUtilityObserver,
                           public MVideoLoadingObserver,
-						              public MMdaAudioPlayerCallback,
-						              public MMdaObjectStateChangeObserver
+                          public MMdaAudioPlayerCallback,
+                          public MMdaObjectStateChangeObserver
     {
 public:      
       enum TFuncInUse
@@ -65,19 +64,13 @@
           ERecord
           };
       
-	enum TPlayerInUse
-	{
-		EVideoPlayerUtility = 0,
-		EAudioPlayerUtility,
-	};
-	
-	enum TPlayerState
-	{
-	  EPlayerClosed,
-		EPlayerPaused,
-		EPlayerPlaying,
-		EPlayerError
-	};
+	enum TMMFUtiltyInUse
+	    {
+        ENoUtility,
+        EVideoPlayerUtility,
+        EAudioPlayerUtility,
+        EAudioRecorderUtility
+	    };
 	
 	enum TRecorderState
 	{
@@ -91,95 +84,123 @@
     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);
+    void Close();
+    void Destroy();
     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 GetCodecId(XAuint32* encoderId);
+    TInt GetBitRate(XAuint32* bitrate);
+    TInt GetSampleRate(XAmilliHertz* samplerate);
+    TInt GetChannels(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);
+/*    XAresult SetWindowHandle(void* display_info);*/
+    XAresult CreateAndConfigureWindowL();
+    XAresult SetNativeDisplayInformation(void* display_info);
+    XAresult ResumePlayback();
+    XAresult PausePlayback();    
+    XAresult StopPlayback();
+    XAresult GetPlayState(XAuint32 *pState);
+    XAresult GetDuration(XAmillisecond *pMsec);
+    XAresult GetPosition(XAmillisecond *pMsec);
+    XAresult SetPlayAdaptContext(void * adaptcontext);
+    XAresult RegisterCallback(xaPlayCallback cbFunction);
+    XAresult SetCallbackEventsMask(XAuint32 eventflags);
+    XAresult SetMarkerPosition(XAmillisecond mSec);
+    XAresult ClearMarkerPosition();
+    XAresult SetPositionUpdatePeriod(XAmillisecond mSec);
 
+    XAresult SetPosition(XAmillisecond pMsec);
+    XAresult SetRepeats(XAboolean repeat);
+    XAresult SetPlayWindow(XAmillisecond start, XAmillisecond end);
+	
+    XAresult GetNumStreams(XAuint32* numstreams);
+    XAresult GetStreamInfo(XAuint32 streamindex, XAuint32* streamtype);
+    XAresult GetVideoFrameSize(XAuint32* height, XAuint32* width, XAuint32* frameRate);
+    XAresult SetActiveState(XAuint32 streamindex, XAboolean active);
+	
+    XAresult SetVolume(XAuint32 volume);
+    XAresult GetVolume(XAuint32* volume);
+    XAresult GetMaxVolume(XAuint32* maxvolume);
 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:
+    // MMdaObjectStateChangeObserver
+    void MoscoStateChangeEvent(
+            CBase* aObject,
+            TInt aPreviousState,
+            TInt aCurrentState,
+            TInt aErrorcCode);
 
-		// From MRebufferCallback
-		void MvloLoadingStarted();
-		void MvloLoadingComplete();		
+    //MMdaAudioPlayerCallback
+    void MapcInitComplete(
+            TInt aError,
+            const TTimeIntervalMicroSeconds& aDuration);
+    void MapcPlayComplete(TInt aError);
+    
+    //From MVidePlayerUtilityObserver
+    void MvpuoOpenComplete(TInt aError);
+    void MvpuoPrepareComplete(TInt aError);
+    void MvpuoFrameReady(CFbsBitmap& aFrame, TInt aError);
+    void MvpuoPlayComplete(TInt aError);
+    void MvpuoEvent(const TMMFEvent& aEvent);
 
-private:
-    //audio player methods
-    void AudioOpenFile();
-    void AudioClose();
-    void AudioStop();
-    void AudioPause();
-    
-    //video player methods
+    // From MRebufferCallback
+    void MvloLoadingStarted();
+    void MvloLoadingComplete();     
+
+private:  
+    enum TPlayerState
+    {
+      EPlayerClosed,
+      EPlayerOpened,
+      EPlayerPrepared,
+      EPlayerPaused,
+      EPlayerPlaying,
+    };
     
 private:
     CMMFBackendEngine();
     void ConstructL();
+    void InitAudioPlayerUtilityL();
+    void InitVideoPlayerUtilityL();
+    void InitPlayerTimersL();
     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
+    XAresult DoHandlePlayItfAttributesChanged();
+    void DoPostEvent(XAuint32 event);
+    TInt InitializeURIForMMFUtil(char *uri);
+
+private:
+    CVideoPlayerUtility2*       iVideoPlayer;
+    CBase*		                iBaseVideoPlayer;
+    CMdaAudioPlayerUtility*     iAudioPlayer;  
+    CBase*                      iBaseAudioPlayer; 
+    CMdaAudioRecorderUtility*   iAudioRecorder;
+    CBase*                      iBaseAudioRecorder;
+    TFileName                   iFileName;
+    TInt                        iAPIBeingUsed;		
+    TInt                        iPreviousRecordState;
+    TInt                        iCurrentRecordState;
+    TInt                        iErrorCode;
+    TRecorderState              iRecordState;
+    LocalTimer*                 iPositionUpdateTimer;
+    TUint64                     iTimerDelay;
+    void*                       iAdaptContext;
+    XAuint32                    iFileFormat;
+    TInt                        iPauseSupportMP4;
+    CActiveSchedulerWait*       iActiveSchedulerWait;
+		CAudioInput*              iaudioInputRecord;
+#ifdef USE_LOCAL_WINDOW_RESOURCES
     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;
@@ -188,33 +209,51 @@
     TInt m_horizPos;
     TInt m_vertPos; 
     TInt m_displayId;   
-    TBool m_bWindowReferencePassed;
+    /*TBool m_bWindowReferencePassed;*/
+    RWsSession m_ws;
+#endif /* USE_LOCAL_WINDOW_RESOURCES */
+
+    /* Holds duration of the media clip opend for playback */
+    TTimeIntervalMicroSeconds iMediaDuration;
+    /* Holds the playback position to be used for next play command */
+    TTimeIntervalMicroSeconds iPlaybackHead;
+    /* Holds current XA state of media player object */
+    XAuint32 iMediaPlayerState;
+    /* Owns */
+    CMarkerPositionTimer* iMarkerPositionTimer;
+    CPositionUpdateTimer* iPlayItfPositionUpdateTimer;
+    /* Owns */
     CWsScreenDevice* m_pScr;
-    RWsSession m_ws;
+    /* Holds mmf state of media player object */
+    TPlayerState iMMFPlayerState;
+
+    /* Property set by client */
+    XAuint32 iPlayItfEventFlags;
+    /* Property set by client */
+    xaPlayCallback iPlayItfCBFunction;
+    /* Property set by client */
+    XAmillisecond iMarkerPosition;
+    /* Property set by client */
+    XAmillisecond iPositionUpdatePeriod;
+    /* Property set by client (for file without file:///) */
+    HBufC* iUri; /* owns */
+    TPtr iUriPtr;
+    /* Property set by client */
     RWsSession* m_pWs;
+    /* Property set by client */
+    RWindow* m_pWindow;   
+    };
 
-#endif /*ENABLE_GRAPHICS_SURFACE_INTEGRATION*/    
-    };
 #else  /* __cplusplus */
 
 
 extern int mmf_backend_engine_init(void** engine);
+extern int mmf_backend_engine_deinit(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);
 
@@ -226,14 +265,47 @@
 
 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_get_codec_id(void* context, XAuint32* encoderId);
+extern int mmf_get_channels(void* context, XAuint32* channelsIn);
+extern int mmf_get_samplerate(void* context, XAmilliHertz* sampleRate);
+extern int mmf_get_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);
 
+extern XAresult mmf_set_play_adapt_context(void * context, void * adaptcontext);
+extern XAresult mmf_set_player_uri(void * context, char * uri, XAuint32 format);
+/*extern XAresult mmf_set_window_handle(void * context, void * display_infos);*/
+extern XAresult mmf_setup_native_display(void * context, void * display_info);
+
+/*Functions for XAPlayItf*/
+extern XAresult mmf_playitf_resume_playback(void * context);
+extern XAresult mmf_playitf_pause_playback(void * context);
+extern XAresult mmf_playitf_stop_playback(void * context);
+extern XAresult mmf_playitf_get_play_state(void * context, XAuint32 * pState);
+extern XAresult mmf_playitf_get_duration(void * context, XAmillisecond * pMsec);
+extern XAresult mmf_playitf_get_position(void * context, XAmillisecond * pMsec);
+extern XAresult mmf_playitf_register_callback(void * context, xaPlayCallback callback);
+extern XAresult mmf_playitf_set_callback_events_mask(void * context, XAuint32 eventflags);
+extern XAresult mmf_playitf_set_marker_position(void * context, XAmillisecond mSec);
+extern XAresult mmf_playitf_clear_marker_position(void * context);
+extern XAresult mmf_playitf_set_position_update_period(void * context, XAmillisecond mSec);
+
+extern XAresult mmf_seekitf_set_position(void * context, XAmillisecond mSec);
+extern XAresult mmf_seekitf_set_playwindow(void * context, XAmillisecond start, XAmillisecond end);
+extern XAresult mmf_seekitf_set_repeats(void * context, XAboolean repeat);
+
+extern XAresult mmf_streaminformationitf_get_numstreams(void * context, XAuint32* numstreams);
+extern XAresult mmf_streaminformationitf_get_streaminfo(void * context, XAuint32 streamindex,
+                                                                XAuint32* streamtype);
+extern XAresult mmf_streaminformationitf_get_videoframesize(void * context, XAuint32* height,
+                                                            XAuint32* width, XAuint32* frameRate);
+extern XAresult mmf_streaminformationitf_set_activestream(void * context, XAuint32 streamindex,
+                                                                XAboolean active);
+
+extern XAresult mmf_volumeitf_set_volume(void * context, XAuint32 volume);
+extern XAresult mmf_volumeitf_get_volume(void * context, XAuint32* volume);
+extern XAresult mmf_volumeitf_get_maxvolume(void * context, XAuint32* volume);
 #endif /* __cplusplus */
 
 #endif /* XA_CMMFBackendEngine_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mmf_adaptation/markerpositiontimer.cpp	Fri May 14 16:22:35 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: Handles marker timer implementation 
+*
+*/
+
+#include "markerpositiontimer.h"
+#include <mdaaudiosampleplayer.h>
+#include <videoplayer2.h>
+#include <e32math.h>
+
+extern "C" {
+#include "xarecorditfadaptationmmf.h"
+}
+
+#define RET_ERR_IF_ERR(s) if (s!=KErrNone) return s;
+#define RET_IF_ERR(s) if (s!=KErrNone) return;
+
+CMarkerPositionTimer::CMarkerPositionTimer(
+        CMdaAudioPlayerUtility* aAudioPlayer,
+        CVideoPlayerUtility2* aVideoPlayer)
+:CActive(CActive::EPriorityStandard),
+ iAudioPlayer(aAudioPlayer),
+ iVideoPlayer(aVideoPlayer)
+    {
+    CActiveScheduler::Add(this);
+    }
+
+CMarkerPositionTimer::~CMarkerPositionTimer()
+    {
+    Cancel();
+    iTimer.Close();
+    }
+
+CMarkerPositionTimer* CMarkerPositionTimer::NewL(
+        CMdaAudioPlayerUtility* aAudioPlayer,
+        CVideoPlayerUtility2* aVideoPlayer)
+    {
+    CMarkerPositionTimer* self = new (ELeave)CMarkerPositionTimer(aAudioPlayer, aVideoPlayer);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+void CMarkerPositionTimer::ConstructL()
+    {
+    User::LeaveIfError(iTimer.CreateLocal());    
+    }
+
+void CMarkerPositionTimer::SetContext(TAny* aCtx)
+    {
+    iCtx = aCtx;    
+    }
+
+void CMarkerPositionTimer::SetMarkerPosition(XAmillisecond aMarkerPos)
+    {
+    iMarkerPosition = aMarkerPos;
+    }
+
+void CMarkerPositionTimer::SetCallbackEventMask(XAuint32 aMask)
+    {
+    iCallbackEventMask = aMask;
+    }
+
+void CMarkerPositionTimer::RegisterCallback(xaPlayCallback aCallback)
+    {
+    iCallback = aCallback;
+    }
+
+void CMarkerPositionTimer::UseAudioPlayer()
+    {
+    iPlayerToUse = static_cast<CBase*>(iAudioPlayer);
+    }
+void CMarkerPositionTimer::UseVideoPlayer()
+    {
+    iPlayerToUse = static_cast<CBase*>(iVideoPlayer);
+    }
+
+void CMarkerPositionTimer::ResetPlayer()
+    {
+    iPlayerToUse = NULL;
+    }
+
+TInt CMarkerPositionTimer::Start()
+    {
+    TInt retVal(KErrNone);
+    if (IsActive())
+        {
+        Cancel();
+        }
+    if ((iMarkerPosition != XA_TIME_UNKNOWN) &&
+        (iCallbackEventMask & XA_PLAYEVENT_HEADATMARKER) &&
+        iCallback &&
+        iPlayerToUse)
+        {
+        TTimeIntervalMicroSeconds32 delay;
+        /* Convert milli to micro */
+        TTimeIntervalMicroSeconds markerPos(iMarkerPosition * 1000);
+        TReal res;
+        TReal p;
+        TReal q(markerPos.Int64());
+
+        iSyncToPlayHead = ETrue;
+
+        retVal = GetCurrentPlayPosition(iSyncToPlayHeadStartPos);
+        RET_ERR_IF_ERR(retVal);
+
+        p = iSyncToPlayHeadStartPos.Int64();
+        /* Adjust delay based on current play position
+         * user may call this in the middle of playback */
+        retVal = Math::Mod(res, p, q);
+        RET_ERR_IF_ERR(retVal);
+
+        /* Let the timer go off early and then re-adjust 
+         * the remaining time based on then current position */
+        delay = (markerPos.Int64() - res) / 2;
+#ifdef MARKERPOSITIONTIMERLOG
+        // Keep this block for debugging purposes
+        RDebug::Print(_L("CMarkerPositionTimer::RunL:SyncPlayHead[%u]Delay Reset[%u]microSec"),
+                iSyncToPlayHeadStartPos.Int64(),
+                delay.Int());
+#endif /* MARKERPOSITIONTIMERLOG */
+        if ( delay >= TTimeIntervalMicroSeconds32(0))
+            {
+            iStatus = KRequestPending;
+            iTimer.After(iStatus, delay);
+            SetActive();
+            }
+        }
+    return retVal;
+    }
+
+void CMarkerPositionTimer::Stop()
+    {
+    Cancel();
+    }
+
+void CMarkerPositionTimer::RunL()
+    {
+    TInt retVal(KErrNone);
+    /* Make sure some of the attributes are not unset */
+    if ((iStatus == KErrNone) &&
+            iCtx &&
+            (iMarkerPosition != XA_TIME_UNKNOWN) &&
+            (iCallbackEventMask & XA_PLAYEVENT_HEADATMARKER) &&
+            iCallback &&
+            iPlayerToUse)
+        {
+        TTimeIntervalMicroSeconds curPlayPos;
+        if (iSyncToPlayHead)
+            {
+            retVal = GetCurrentPlayPosition(curPlayPos);
+            RET_IF_ERR(retVal);
+
+            /* If the play head hasn't moved, re-start all over again */
+            if (curPlayPos == iSyncToPlayHeadStartPos)
+                {
+#ifdef MARKERPOSITIONTIMERLOG
+            RDebug::Print(_L("CMarkerPositionTimer::RunL:CurPlayPos[%u]SyncPlayHead[%u]microSec. Restart"),
+                    iSyncToPlayHeadStartPos.Int64(),
+                    curPlayPos.Int64());
+#endif /* MARKERPOSITIONTIMERLOG */
+                Start();
+                return;
+                }
+            /* Play head has moved. calculate remaining time and set the timer */
+            /* Convert milli to micro */
+            TTimeIntervalMicroSeconds markerPos(iMarkerPosition * 1000);
+            TReal res;
+            TReal p;
+            TReal q(markerPos.Int64());
+
+            p = curPlayPos.Int64();
+            iSyncToPlayHead = EFalse;
+
+            retVal = Math::Mod(res, p, q);
+            RET_IF_ERR(retVal);
+
+            TTimeIntervalMicroSeconds32 delay = (markerPos.Int64() - res);
+#ifdef MARKERPOSITIONTIMERLOG
+            RDebug::Print(_L("CMarkerPositionTimer::RunL:CurPlayPos[%u]SyncPlayHead[%u]Delay Reset[%u]microSec"),
+                    iSyncToPlayHeadStartPos.Int64(),
+                    curPlayPos.Int64(),
+                    delay.Int());
+#endif /* MARKERPOSITIONTIMERLOG */
+            if ( delay >= TTimeIntervalMicroSeconds32(0))
+                {
+                iStatus = KRequestPending;
+                iTimer.After(iStatus, delay);
+                SetActive();
+                }
+            return;
+            } /* of if (iSyncToPlayHead) */
+
+#ifdef MARKERPOSITIONTIMERLOG
+        retVal = GetCurrentPlayPosition(curPlayPos);
+        RDebug::Print(_L("CMarkerPositionTimer::RunL:CurPlayPos[%u]microSec. Posting XA_PLAYEVENT_HEADATMARKER."), curPlayPos.Int64());
+#endif /* MARKERPOSITIONTIMERLOG */
+        XAAdaptEvent xaevent = {XA_PLAYITFEVENTS, XA_PLAYEVENT_HEADATMARKER, 0, 0 };
+        XAAdaptationBase_SendAdaptEvents((XAAdaptationBaseCtx*)iCtx, &xaevent );
+        }
+    }
+
+void CMarkerPositionTimer::DoCancel()
+    {
+    iTimer.Cancel();
+    }
+
+TInt CMarkerPositionTimer::RunError(TInt /*aError*/)
+    {
+    return KErrNone;
+    }
+
+TInt CMarkerPositionTimer::GetCurrentPlayPosition(TTimeIntervalMicroSeconds& aPos)
+    {
+    TTimeIntervalMicroSeconds pos;
+    TInt err(KErrNone);
+    if (iPlayerToUse == iAudioPlayer)
+        {
+        iAudioPlayer->GetPosition(aPos);
+        }
+    else if (iPlayerToUse == iVideoPlayer)
+        {
+        TRAP(err, aPos = iVideoPlayer->PositionL());
+        }
+    return err;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mmf_adaptation/markerpositiontimer.h	Fri May 14 16:22:35 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: Handles marker timer implementation 
+*
+*/
+
+#ifndef CMARKERPOSITIONTIMER_H
+#define CMARKERPOSITIONTIMER_H
+
+#include <e32base.h>
+#include "openmaxalwrapper.h"
+
+class CMdaAudioPlayerUtility;
+class CVideoPlayerUtility2;
+
+NONSHARABLE_CLASS(CMarkerPositionTimer) : public CActive
+    {
+public:
+    // Construct/destruct
+    static CMarkerPositionTimer* NewL(CMdaAudioPlayerUtility* aAudioPlayer,
+                            CVideoPlayerUtility2* aVideoPlayer);
+    ~CMarkerPositionTimer();
+
+public:
+    void SetContext(TAny* aCtx);
+    void SetMarkerPosition(XAmillisecond aMarkerPos);
+    void SetCallbackEventMask(XAuint32 aMask);
+    void RegisterCallback(xaPlayCallback aCallback);
+    void UseAudioPlayer();
+    void UseVideoPlayer();
+    void ResetPlayer();
+    TInt Start();
+    void Stop();
+
+protected:
+    // From CActive
+    void RunL();
+    void DoCancel();
+    TInt RunError(TInt aError);
+
+private:
+    CMarkerPositionTimer(CMdaAudioPlayerUtility* aAudioPlayer,
+            CVideoPlayerUtility2* aVideoPlayer);
+    void ConstructL();
+    TInt GetCurrentPlayPosition(TTimeIntervalMicroSeconds& aPos);
+
+private:
+    RTimer iTimer;      // Has
+    TAny* iCtx;
+    CMdaAudioPlayerUtility* iAudioPlayer;
+    CVideoPlayerUtility2* iVideoPlayer;
+    CBase* iPlayerToUse;
+    XAmillisecond iMarkerPosition;
+    XAuint32 iCallbackEventMask;
+    xaPlayCallback iCallback;
+    TBool iSyncToPlayHead;
+    TTimeIntervalMicroSeconds iSyncToPlayHeadStartPos;
+    };
+
+#endif /* CMARKERPOSITIONTIMER_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mmf_adaptation/positionupdatetimer.cpp	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,243 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Handles new position timer implementation 
+*
+*/
+
+#include "positionupdatetimer.h"
+#include <mdaaudiosampleplayer.h>
+#include <videoplayer2.h>
+#include <e32math.h>
+
+extern "C" {
+#include "xarecorditfadaptationmmf.h"
+}
+
+#define RET_ERR_IF_ERR(s) if (s!=KErrNone) return s;
+#define RET_IF_ERR(s) if (s!=KErrNone) return;
+
+CPositionUpdateTimer::CPositionUpdateTimer(
+        CMdaAudioPlayerUtility* aAudioPlayer,
+        CVideoPlayerUtility2* aVideoPlayer)
+:CActive(CActive::EPriorityStandard),
+ iAudioPlayer(aAudioPlayer),
+ iVideoPlayer(aVideoPlayer)
+    {
+    CActiveScheduler::Add(this);
+    }
+
+CPositionUpdateTimer::~CPositionUpdateTimer()
+    {
+    Cancel();
+    iTimer.Close();
+    }
+
+CPositionUpdateTimer* CPositionUpdateTimer::NewL(
+        CMdaAudioPlayerUtility* aAudioPlayer,
+        CVideoPlayerUtility2* aVideoPlayer)
+    {
+    CPositionUpdateTimer* self = new (ELeave)CPositionUpdateTimer(aAudioPlayer, aVideoPlayer);
+    CleanupStack::PushL(self);
+    self->CostructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+void CPositionUpdateTimer::CostructL()
+    {
+    User::LeaveIfError(iTimer.CreateLocal());    
+    }
+
+void CPositionUpdateTimer::SetContext(TAny* aCtx)
+    {
+    iCtx = aCtx;    
+    }
+
+void CPositionUpdateTimer::SetPositionUpdatePeriod(XAmillisecond aPos)
+    {
+    iPositionUpdatePeriod = aPos;
+    iDelay = TTimeIntervalMicroSeconds32(aPos*1000);
+    }
+
+void CPositionUpdateTimer::SetCallbackEventMask(XAuint32 aMask)
+    {
+    iCallbackEventMask = aMask;
+    }
+
+void CPositionUpdateTimer::RegisterCallback(xaPlayCallback aCallback)
+    {
+    iCallback = aCallback;
+    }
+
+void CPositionUpdateTimer::UseAudioPlayer()
+    {
+    iPlayerToUse = static_cast<CBase*>(iAudioPlayer);
+    }
+void CPositionUpdateTimer::UseVideoPlayer()
+    {
+    iPlayerToUse = static_cast<CBase*>(iVideoPlayer);
+    }
+
+void CPositionUpdateTimer::ResetPlayer()
+    {
+    iPlayerToUse = NULL;
+    }
+
+TInt CPositionUpdateTimer::Start()
+    {
+    TInt retVal(KErrNone);
+    if (IsActive())
+        {
+        Cancel();
+        }
+    if ((iCallbackEventMask & XA_PLAYEVENT_HEADATNEWPOS) &&
+        iCallback &&
+        iPlayerToUse)
+        {
+        TTimeIntervalMicroSeconds curPlayPos;
+        /* Convert milli to micro */
+        TTimeIntervalMicroSeconds posUpdatePeriod(iPositionUpdatePeriod * 1000);
+        TTimeIntervalMicroSeconds32 delay;
+        /* Convert milli to micro */
+        TReal res;
+        TReal p;
+        TReal q(posUpdatePeriod.Int64());
+
+        iSyncToPlayHead = ETrue;
+
+        retVal = GetCurrentPlayPosition(iSyncToPlayHeadStartPos);
+        RET_ERR_IF_ERR(retVal);
+
+        p = iSyncToPlayHeadStartPos.Int64();
+        /* Adjust delay based on current play position
+         * user may call this in the middle of playback */
+        retVal = Math::Mod(res, p, q);
+        RET_ERR_IF_ERR(retVal);
+
+        /* Let the timer go off early and then re-adjust 
+         * the remaining time based on then current position */
+        delay = (posUpdatePeriod.Int64() - res) / 2;
+#ifdef POSITIONUPDATETIMERLOG
+        // Keep this block for debugging purposes
+        RDebug::Print(_L("CPositionUpdateTimer::RunL:SyncPlayHead[%u]Delay Reset[%u]microSec"),
+                iSyncToPlayHeadStartPos.Int64(),
+                delay.Int());
+#endif /* POSITIONUPDATETIMERLOG */
+        if ( delay >= TTimeIntervalMicroSeconds32(0))
+            {
+            iStatus = KRequestPending;
+            iTimer.After(iStatus, delay);
+            SetActive();
+            }
+        }
+    return retVal;
+    }
+
+void CPositionUpdateTimer::Stop()
+    {
+    Cancel();
+    }
+
+void CPositionUpdateTimer::RunL()
+    {
+    TInt retVal(KErrNone);
+    /* Make sure some of the attributes are not unset */
+    if ((iStatus == KErrNone) &&
+            iCtx &&
+            (iCallbackEventMask & XA_PLAYEVENT_HEADATNEWPOS) &&
+            iCallback &&
+            iPlayerToUse)
+        {
+        TTimeIntervalMicroSeconds curPlayPos;
+        if (iSyncToPlayHead)
+            {
+            retVal = GetCurrentPlayPosition(curPlayPos);
+            RET_IF_ERR(retVal);
+
+            /* If the play head hasn't moved, re-start all over again */
+            if (curPlayPos == iSyncToPlayHeadStartPos)
+                {
+#ifdef POSITIONUPDATETIMERLOG
+            RDebug::Print(_L("CPositionUpdateTimer::RunL:CurPlayPos[%u]SyncPlayHead[%u]microSec. Restart"),
+                    iSyncToPlayHeadStartPos.Int64(),
+                    curPlayPos.Int64());
+#endif /* POSITIONUPDATETIMERLOG */
+                Start();
+                return;
+                }
+            /* Play head has moved. calculate remaining time and set the timer */
+            /* Convert milli to micro */
+            TTimeIntervalMicroSeconds posUpdatePeriod(iPositionUpdatePeriod * 1000);
+            TReal res;
+            TReal p;
+            TReal q(posUpdatePeriod.Int64());
+
+            p = curPlayPos.Int64();
+            iSyncToPlayHead = EFalse;
+
+            retVal = Math::Mod(res, p, q);
+            RET_IF_ERR(retVal);
+
+            TTimeIntervalMicroSeconds32 delay = (posUpdatePeriod.Int64() - res);
+#ifdef POSITIONUPDATETIMERLOG
+            RDebug::Print(_L("CPositionUpdateTimer::RunL:CurPlayPos[%u]SyncPlayHead[%u]Delay Reset[%u]microSec"),
+                    iSyncToPlayHeadStartPos.Int64(),
+                    curPlayPos.Int64(),
+                    delay.Int());
+#endif /* POSITIONUPDATETIMERLOG */
+            if ( delay >= TTimeIntervalMicroSeconds32(0))
+                {
+                iStatus = KRequestPending;
+                iTimer.After(iStatus, delay);
+                SetActive();
+                }
+            return;
+            } /* of if (iSyncToPlayHead) */
+
+#ifdef POSITIONUPDATETIMERLOG
+        retVal = GetCurrentPlayPosition(curPlayPos);
+        RDebug::Print(_L("CPositionUpdateTimer::RunL:CurPlayPos[%u]microSec. Posting XA_PLAYEVENT_HEADATNEWPOS."), curPlayPos.Int64());
+#endif /* POSITIONUPDATETIMERLOG */
+        XAAdaptEvent xaevent = {XA_PLAYITFEVENTS, XA_PLAYEVENT_HEADATNEWPOS, 0, 0 };
+        XAAdaptationBase_SendAdaptEvents((XAAdaptationBaseCtx*)iCtx, &xaevent );
+        iStatus = KRequestPending;
+        iTimer.After(iStatus, iDelay);
+        SetActive();
+        }
+    }
+
+void CPositionUpdateTimer::DoCancel()
+    {
+    iTimer.Cancel();
+    }
+
+TInt CPositionUpdateTimer::RunError(TInt /*aError*/)
+    {
+    return KErrNone;
+    }
+
+TInt CPositionUpdateTimer::GetCurrentPlayPosition(TTimeIntervalMicroSeconds& aPos)
+    {
+    TTimeIntervalMicroSeconds pos;
+    TInt err(KErrNone);
+    if (iPlayerToUse == iAudioPlayer)
+        {
+        iAudioPlayer->GetPosition(aPos);
+        }
+    else if (iPlayerToUse == iVideoPlayer)
+        {
+        TRAP(err, aPos = iVideoPlayer->PositionL());
+        }
+    return err;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mmf_adaptation/positionupdatetimer.h	Fri May 14 16:22:35 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: Handles marker timer implementation 
+*
+*/
+
+#ifndef CPOSITIONUPDATETIMER_H
+#define CPOSITIONUPDATETIMER_H
+
+#include <e32base.h>
+#include "openmaxalwrapper.h"
+
+class CMdaAudioPlayerUtility;
+class CVideoPlayerUtility2;
+
+NONSHARABLE_CLASS(CPositionUpdateTimer) : public CActive
+    {
+public:
+    // Construct/destruct
+    static CPositionUpdateTimer* NewL(CMdaAudioPlayerUtility* aAudioPlayer,
+                            CVideoPlayerUtility2* aVideoPlayer);
+    ~CPositionUpdateTimer();
+
+public:
+    void SetContext(TAny* aCtx);
+    void SetPositionUpdatePeriod(XAmillisecond aPos);
+    void SetCallbackEventMask(XAuint32 aMask);
+    void RegisterCallback(xaPlayCallback aCallback);
+    void UseAudioPlayer();
+    void UseVideoPlayer();
+    void ResetPlayer();
+    TInt Start();
+    void Stop();
+
+protected:
+    // From CActive
+    void RunL();
+    void DoCancel();
+    TInt RunError(TInt aError);
+
+private:
+    CPositionUpdateTimer(CMdaAudioPlayerUtility* aAudioPlayer,
+            CVideoPlayerUtility2* aVideoPlayer);
+    void CostructL();
+    TInt GetCurrentPlayPosition(TTimeIntervalMicroSeconds& aPos);
+
+private:
+    RTimer iTimer;      // Has
+    TAny* iCtx;
+    CMdaAudioPlayerUtility* iAudioPlayer;
+    CVideoPlayerUtility2* iVideoPlayer;
+    CBase* iPlayerToUse;
+    XAmillisecond iPositionUpdatePeriod;
+    XAuint32 iCallbackEventMask;
+    xaPlayCallback iCallback;
+    TTimeIntervalMicroSeconds32 iDelay;
+	TBool iSyncToPlayHead;
+	TTimeIntervalMicroSeconds iSyncToPlayHeadStartPos;
+    };
+
+#endif /* CPOSITIONUPDATETIMER_H */
--- a/khronosfws/openmax_al/src/mmf_adaptation/xaadaptationcontextbasemmf.c	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,143 +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: 
-*
-*/
-
-#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);
-        }
-    }
-}
--- a/khronosfws/openmax_al/src/mmf_adaptation/xaadaptationcontextbasemmf.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +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: 
-*
-*/
-
-#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.c	Fri May 14 16:22:35 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 <assert.h>
+#include <string.h>
+#include "xaadaptationmmf.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( XAAdaptationMMFCtx* pSelf, XAuint32 ctxId )
+{
+    DEBUG_API("->XAAdaptationBase_Init");
+
+    if ( pSelf )
+    {
+    if(XAAdaptationBase_Init(&(pSelf->baseObj), ctxId) != XA_RESULT_SUCCESS)
+        {
+        DEBUG_ERR("Failed to init base context!!!");
+        free(pSelf);
+        pSelf = NULL;
+        }
+    }
+    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( XAAdaptationMMFCtx* ctx )
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    DEBUG_API("->XAAdaptationBase_PostInit");
+
+   XAAdaptationBase_PostInit(&ctx->baseObj);
+
+    DEBUG_API("<-XAAdaptationBase_PostInit");
+    return ret;
+}
+
+/*
+ * void XAAdaptationBase_Free( XAAdaptationBaseCtx* ctx )
+ * Frees all Base context variables .
+ */
+void XAAdaptationBaseMMF_Free( XAAdaptationMMFCtx* ctx )
+{
+    DEBUG_API("->XAAdaptationBaseMMF_Free");
+    XAAdaptationBase_Free(&ctx->baseObj);
+    DEBUG_API("<-XAAdaptationBaseMMF_Free");
+}
+
+
--- a/khronosfws/openmax_al/src/mmf_adaptation/xaadaptationmmf.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/mmf_adaptation/xaadaptationmmf.h	Fri May 14 16:22:35 2010 +0300
@@ -15,8 +15,8 @@
 *
 */
 
-#ifndef XAADAPTATION_H_
-#define XAADAPTATION_H_
+#ifndef XAADAPTATIONMMF_H_
+#define XAADAPTATIONMMF_H_
 
 #include <pthread.h>
 #include <semaphore.h>
@@ -24,11 +24,10 @@
 #include <string.h>
 #include <unistd.h>
 #include "openmaxalwrapper.h"
-#include "xaadaptationcontextbasemmf.h"
 #include "xaglobals.h"
 //#include "OpenMAXAL_ContentPipe.h"
 #include "xaplatform.h"
-
+#include "xaadptbasectx.h"
 #ifdef XA_IMPL_MEASURE_GST_DELAY
 #include <time.h>
 #endif /* XA_IMPL_MEASURE_GST_DELAY */
@@ -43,25 +42,25 @@
 
 /* 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 */
+    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 */
+    XA_NUM_OF_VIDEOENCODERS  Do not move this line 
 } XAVideoEnc;
 
 typedef enum CP_STATE
@@ -77,31 +76,25 @@
 	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;
+/* Forward declaration of adaptation basecontext */
+typedef struct XAAdaptationMMFCtx_ XAAdaptationMMFCtx;
 
 /*
  * Structure that holds all common variables for every
  * mmf-Adaptation context structures.
  */
-typedef struct XAAdaptationBaseMMFCtx_
+typedef struct XAAdaptationMMFCtx_
 {
-    /* Common Variables for all adaptation elements */
-    GArray*         evtHdlrs;    /* array of event handlers */
-    XAuint32        ctxId;
-    XAboolean       placeholder;
+XAAdaptationBaseCtx baseObj;
 
-} XAAdaptationBaseMMFCtx_;
+} XAAdaptationMMFCtx_;
 
 typedef struct XAEngineAdaptationMMFCtx_
 {
     /* Parent*/
-    XAAdaptationBaseMMFCtx_    baseObj;
+    XAAdaptationMMFCtx_    baseObj;
 
 } XAEngineAdaptationMMFCtx_;
 
@@ -111,7 +104,7 @@
 typedef struct XAMediaPlayerAdaptationMMFCtx_
 {
     /* Parent*/
-    XAAdaptationBaseMMFCtx_    baseObj;
+    XAAdaptationMMFCtx_    baseObj;
 
     /* OMX-AL Variables */
     XADataSource            *xaSource, *xaBankSrc;
@@ -124,65 +117,36 @@
     XAboolean               isobjvsink;   /*is video sink another XA object?*/
 
     XAboolean               mute;
+    XAuint32                premutevol;
     XAuint32                imageEffectID;
     XAboolean               isStereoPosition;
     XAmillidegree           curRotation;
     XAuint32                curMirror;
-
     XAint32                 buffering;
 
     /* internals */
     XAboolean               trackpositionenabled;
-
-
     XAboolean               loopingenabled;
-
-    XAboolean		            cameraSinkSynced;
+    XAboolean		        cameraSinkSynced;
     void*                   mmfContext;
-
+	void* 					mmfMetadataContext;
+/*
+    XAuint32                playerState;
+*/
 
 } XAMediaPlayerAdaptationMMFCtx_;
 
-typedef struct XAMediaRecorderAdaptationMMFCtx_
+
+typedef struct XAMetadataAdaptationMMFCtx_
 {
     /* Parent*/
-    XAAdaptationBaseMMFCtx_ baseObj;
+    XAAdaptationMMFCtx_    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;
+    XADataSource            *xaSource;
 
-    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_;
-
+} XAMetadataAdaptationMMFCtx_;
 
 /* FUNCTIONS */
 /*
@@ -191,31 +155,8 @@
  * 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 XAAdaptationBaseMMF_Init( XAAdaptationMMFCtx* pSelf, XAuint32 ctxId );
+XAresult XAAdaptationBaseMMF_PostInit( XAAdaptationMMFCtx* ctx );
+void XAAdaptationBaseMMF_Free( XAAdaptationMMFCtx* ctx );
 
-//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_ */
+#endif /* XAADAPTATIONMMF_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mmf_adaptation/xadynamicsourceitfadaptationmmf.c	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,88 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "xamediaplayeradaptctxmmf.h"
+#include "xametadataadaptctxmmf.h"
+#include "xadynamicsourceitfadaptationmmf.h"
+#include "xaplayitfadaptationmmf.h"
+#include "cmmfbackendengine.h"
+#include "cmetadatautilityitf.h"
+
+/*
+ * XAresult XADynamicSourceItfAdaptMMF_SetSource(XAAdaptationGstCtx *bCtx, XADataSource *pDataSource)
+ * @param XAAdaptationGstCtx *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 XADynamicSourceItfAdaptMMF_SetSource(XAAdaptationMMFCtx *bCtx, XADataSource *pDataSource)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAuint32 origstate;
+    DEBUG_API("->XADynamicSourceItfAdaptMMF_SetSource");
+    if( !bCtx || !pDataSource || !pDataSource->pLocator )
+    {
+        DEBUG_ERR("Invalid NULL parameter");
+        ret = XA_RESULT_PARAMETER_INVALID;
+    }
+    else if(bCtx->baseObj.ctxId == XAMediaPlayerAdaptation)
+    {
+        XADataLocator_URI* tempUri = (XADataLocator_URI*)(pDataSource->pLocator);
+        XADataFormat_MIME* tempFormat = (XADataFormat_MIME*)(pDataSource->pFormat);
+        XAMediaPlayerAdaptationMMFCtx* mCtx = (XAMediaPlayerAdaptationMMFCtx*) bCtx;
+
+        ret = XAPlayItfAdaptMMF_GetPlayState(&bCtx->baseObj, &origstate);
+        
+        ret = XAPlayItfAdaptMMF_SetPlayState(&bCtx->baseObj, XA_PLAYSTATE_STOPPED);
+        
+        mmf_close(mCtx->mmfContext);
+        mCtx->xaSource = pDataSource;
+        ret = mmf_set_player_uri(mCtx->mmfContext, (char *)(tempUri->URI), tempFormat->containerType);
+        if(mCtx->xaVideoSink)
+          {
+            ret = mmf_setup_native_display(mCtx->mmfContext, mCtx->xaVideoSink);
+          }
+        if(ret == XA_RESULT_SUCCESS)
+            {
+			ret = XAPlayItfAdaptMMF_SetPlayState(&bCtx->baseObj, origstate);
+			}
+		else
+			{
+			DEBUG_ERR("Set Play state failed");
+	        ret = XA_RESULT_INTERNAL_ERROR;
+			}
+		if(ret == XA_RESULT_SUCCESS)
+		{
+			if(mCtx->mmfMetadataContext)
+			{
+				ret = mmf_metadata_utility_parse_source(mCtx->mmfMetadataContext, (char *)(tempUri->URI));
+			}
+		}
+    }
+	else if(bCtx->baseObj.ctxId == XAMDAdaptation)
+	{
+		
+        XAMetadataAdaptationMMFCtx* mCtx = (XAMetadataAdaptationMMFCtx*) bCtx;
+		if(mCtx->mmfContext)
+		{
+			mCtx->xaSource = pDataSource;
+			ret = mmf_metadata_utility_parse_source(mCtx->mmfContext, (char *)(( (XADataLocator_URI*)(pDataSource->pLocator))->URI));
+		}
+	}
+    DEBUG_API("<-XADynamicSourceItfAdaptMMF_SetSource");
+    return ret;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mmf_adaptation/xadynamicsourceitfadaptationmmf.h	Fri May 14 16:22:35 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 XADYNAMICSOURCEITFADAPTATIONMMF_H
+#define XADYNAMICSOURCEITFADAPTATIONMMF_H
+
+#include "xaadaptationmmf.h"
+
+
+/* FUNCTIONS */
+
+XAresult XADynamicSourceItfAdaptMMF_SetSource(XAAdaptationMMFCtx *bCtx, XADataSource *pDataSource);
+
+#endif /* XADYNAMICSOURCEITFADAPTATION_H */
--- a/khronosfws/openmax_al/src/mmf_adaptation/xaengineadaptctxmmf.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/mmf_adaptation/xaengineadaptctxmmf.c	Fri May 14 16:22:35 2010 +0300
@@ -24,15 +24,15 @@
  * Allocates memory for Engine Adaptation Context and makes 1st phase initialization
  * @returns XAEngineAdaptationCtx* - Pointer to created context
  */
-XAAdaptationBaseMMFCtx* XAEngineAdaptMMF_Create()
+XAAdaptationMMFCtx* XAEngineAdaptMMF_Create()
 {
     XAEngineAdaptationMMFCtx *pSelf = NULL;
     DEBUG_API("->XAEngineAdaptMMF_Create");
 
-    pSelf = calloc(1, sizeof(XAEngineAdaptationMMFCtx));
+    pSelf = (XAEngineAdaptationMMFCtx*)calloc(1, sizeof(XAEngineAdaptationMMFCtx));
     if ( pSelf)
     {
-        if( XAAdaptationBaseMMF_Init(&(pSelf->baseObj),XAEngineAdaptationMMF)
+        if( XAAdaptationBaseMMF_Init(&(pSelf->baseObj),XAEngineAdaptation)
                     != XA_RESULT_SUCCESS )
             {
                 DEBUG_ERR("Failed to init base context!!!");
@@ -46,14 +46,14 @@
     }
 
     DEBUG_API("<-XAEngineAdaptMMF_Create");
-    return (XAAdaptationBaseMMFCtx*)pSelf;
+    return (XAAdaptationMMFCtx*)pSelf;
 }
 
 /*
  * XAresult XAEngineAdaptMMF_PostInit()
  * 2nd phase initialization of engine Adaptation Context
  */
-XAresult XAEngineAdaptMMF_PostInit(XAAdaptationBaseMMFCtx* bCtx)
+XAresult XAEngineAdaptMMF_PostInit(XAAdaptationMMFCtx* bCtx)
 {
     XAresult ret = XA_RESULT_SUCCESS;
 
@@ -66,7 +66,7 @@
  * Destroys Engine Adaptation Context
  * @param ctx - Engine Adaptation context to be destroyed
  */
-void XAEngineAdaptMMF_Destroy(XAAdaptationBaseMMFCtx* bCtx)
+void XAEngineAdaptMMF_Destroy(XAAdaptationMMFCtx* bCtx)
 {
 	XAEngineAdaptationMMFCtx* ctx = NULL;
 
--- a/khronosfws/openmax_al/src/mmf_adaptation/xaengineadaptctxmmf.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/mmf_adaptation/xaengineadaptctxmmf.h	Fri May 14 16:22:35 2010 +0300
@@ -18,16 +18,16 @@
 #ifndef XAENGINEADAPTCTXMMF_H_
 #define XAENGINEADAPTCTXMMF_H_
 
-#include "xaadaptationcontextbasemmf.h"
-//#include "XAStaticCapsAdaptation.h"
+#include "xaadaptationmmf.h"
+
 
 /* TYPEDEFS */
 
 typedef struct XAEngineAdaptationMMFCtx_ XAEngineAdaptationMMFCtx;
 
 /* FUNCTIONS */
-XAAdaptationBaseMMFCtx* XAEngineAdaptMMF_Create(void);
-XAresult XAEngineAdaptMMF_PostInit(XAAdaptationBaseMMFCtx* bCtx);
-void XAEngineAdaptMMF_Destroy(XAAdaptationBaseMMFCtx* bCtx);
+XAAdaptationMMFCtx* XAEngineAdaptMMF_Create(void);
+XAresult XAEngineAdaptMMF_PostInit(XAAdaptationMMFCtx* bCtx);
+void XAEngineAdaptMMF_Destroy(XAAdaptationMMFCtx* bCtx);
 
 #endif /* XAENGINEADAPTCTXMMF_H_ */
--- a/khronosfws/openmax_al/src/mmf_adaptation/xamediaplayeradaptctxmmf.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/mmf_adaptation/xamediaplayeradaptctxmmf.c	Fri May 14 16:22:35 2010 +0300
@@ -22,6 +22,9 @@
 #include "xaobjectitf.h"
 #include "cmmfbackendengine.h"
 
+#include "cmetadatautilityitf.h"
+
+
 
 /*
  * XAMediaPlayerAdaptationMMFCtx* XAMediaPlayerAdapt_Create()
@@ -32,7 +35,7 @@
  * @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,
+XAAdaptationBaseCtx* XAMediaPlayerAdaptMMF_Create(XADataSource *pDataSrc, XADataSource *pBankSrc,
                                                       XADataSink *pAudioSnk, XADataSink *pImageVideoSnk,
                                                       XADataSink *pVibra, XADataSink *pLEDArray)
 {
@@ -44,8 +47,8 @@
     pSelf = calloc(1, sizeof(XAMediaPlayerAdaptationMMFCtx));
     if ( pSelf)
     {
-#ifdef _GSTREAMER_BACKEND_          
-        if( XAAdaptationBaseMMF_Init(&(pSelf->baseObj),0)
+          
+        if( XAAdaptationBaseMMF_Init(&(pSelf->baseObj),XAMediaPlayerAdaptation)
             != XA_RESULT_SUCCESS )
         {
             DEBUG_ERR("Failed to init base context!!!");
@@ -53,8 +56,9 @@
             pSelf = NULL;
         }
         else
-#endif            
+            
         {
+            pSelf->baseObj.baseObj.fwtype = FWMgrFWMMF;
             pSelf->xaSource = pDataSrc;
             pSelf->xaBankSrc = pBankSrc;
             pSelf->xaAudioSink = pAudioSnk;
@@ -79,31 +83,41 @@
 		}
     }
     
+    else
+        {
+        DEBUG_ERR("Failed to create XAMediaPlayerAdaptationMMFCtx !!!");
+        return NULL;
+        }
     if(pSelf)
+    {
+	    res = mmf_backend_engine_init(&(pSelf->mmfContext));
+        if(!(pSelf->mmfContext) || (res != XA_RESULT_SUCCESS))
         {
-        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; 
-            }
+            /* TODO Check to make sure there is no undeleted MMF objects here*/
+            DEBUG_ERR("Failed to init mmf context!!!");
+            free(pSelf);
+            pSelf = NULL;
+            return NULL;
         }
+		res = mmf_set_play_adapt_context(pSelf->mmfContext, &(pSelf->baseObj));
+		if(pDataSrc)
+		    {
+             pSelf->mmfMetadataContext = mmf_metadata_utility_init((char *)(( (XADataLocator_URI*)(pDataSrc->pLocator))->URI));
+             if(!pSelf->mmfMetadataContext)
+                {
+                    DEBUG_ERR("Failed to init mmf metadata context!!!");
+                    pSelf->mmfMetadataContext = NULL;			
+                }
+		    }
+		else
+        	{
+        	DEBUG_ERR("Failed to create XAMediaPlayerAdaptationMMFCtx !!!");
+        	return NULL;
+        	}	
+    }
 
     DEBUG_API("<-XAMediaPlayerAdaptMMF_Create");
-    return (XAAdaptationBaseMMFCtx*)pSelf;
+    return (XAAdaptationBaseCtx*)(&pSelf->baseObj.baseObj);
 }
 
 
@@ -114,9 +128,29 @@
  * @param XAMediaPlayerAdaptationMMFCtx* ctx - pointer to Media Player adaptation context
  * @return XAresult - Success value
  */
-XAresult XAMediaPlayerAdaptMMF_PostInit( XAAdaptationBaseMMFCtx* bCtx )
+XAresult XAMediaPlayerAdaptMMF_PostInit( XAAdaptationMMFCtx* bCtx )
 {
-  XAresult ret = XA_RESULT_SUCCESS;
+    XAresult ret = XA_RESULT_PRECONDITIONS_VIOLATED;
+    XAMediaPlayerAdaptationMMFCtx *pSelf = (XAMediaPlayerAdaptationMMFCtx*)bCtx;
+
+    DEBUG_API("->XAMediaPlayerAdaptMMF_PostInit");
+    
+    XAAdaptationBaseMMF_PostInit(bCtx);
+    
+    if(pSelf->mmfContext)
+    {
+        XADataLocator_URI* tempUri = (XADataLocator_URI*)(pSelf->xaSource->pLocator);
+        XADataFormat_MIME* tempFormat = (XADataFormat_MIME*)(pSelf->xaSource->pFormat);
+        ret = XA_RESULT_SUCCESS;
+        if(pSelf->xaVideoSink)
+          {
+          ret = mmf_setup_native_display(pSelf->mmfContext, pSelf->xaVideoSink);
+          }
+        if (ret == XA_RESULT_SUCCESS)
+        {
+            ret = mmf_set_player_uri(pSelf->mmfContext, (char *)(tempUri->URI), tempFormat->containerType);
+        }
+    }
     DEBUG_API("<-XAMediaPlayerAdaptMMF_PostInit");
     return ret;
 }
@@ -126,7 +160,7 @@
  * Destroys Media Player Adaptation Context
  * @param ctx - Media Player Adaptation context to be destroyed
  */
-void XAMediaPlayerAdaptMMF_Destroy( XAAdaptationBaseMMFCtx* bCtx )
+void XAMediaPlayerAdaptMMF_Destroy( XAAdaptationMMFCtx* bCtx )
 {
     XAMediaPlayerAdaptationMMFCtx* ctx = NULL;
 
@@ -140,9 +174,18 @@
     }
     ctx = (XAMediaPlayerAdaptationMMFCtx*)bCtx;
 
-#ifdef _GSTREAMER_BACKEND_  
-    XAAdaptationBase_Free( bCtx );
-#endif    
+    if(ctx->mmfContext)
+        {
+        mmf_backend_engine_deinit(ctx->mmfContext);
+        }
+
+	if(ctx->mmfMetadataContext)
+	{
+		mmf_metadata_utility_destroy(ctx->mmfMetadataContext);		
+	}
+	
+    XAAdaptationBaseMMF_Free( bCtx );
+    
     free(ctx);
     ctx = NULL;
 
--- a/khronosfws/openmax_al/src/mmf_adaptation/xamediaplayeradaptctxmmf.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/mmf_adaptation/xamediaplayeradaptctxmmf.h	Fri May 14 16:22:35 2010 +0300
@@ -18,18 +18,18 @@
 #ifndef XAMEDIAPLAYERADAPTCTXMMF_H
 #define XAMEDIAPLAYERADAPTCTXMMF_H
 
-#include "xaadaptationcontextbasemmf.h"
+#include "xaadaptationmmf.h"
 
 /* TYPEDEFS */
 
 typedef struct XAMediaPlayerAdaptationMMFCtx_ XAMediaPlayerAdaptationMMFCtx;
 
 /* FUNCTIONS */
-XAAdaptationBaseMMFCtx* XAMediaPlayerAdaptMMF_Create( XADataSource *pDataSrc, XADataSource *pBankSrc,
+XAAdaptationBaseCtx* 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 XAMediaPlayerAdaptMMF_PostInit( XAAdaptationMMFCtx* bCtx );
+void XAMediaPlayerAdaptMMF_Destroy( XAAdaptationMMFCtx* bCtx );
 
 //XAresult XAMediaPlayerAdapt_InitContentPipeSrc(XAMediaPlayerAdaptationCtx* ctx);
 #endif /*XAMEDIAPLAYERADAPTCTXMMF_H*/
--- a/khronosfws/openmax_al/src/mmf_adaptation/xamediarecorderadaptctxmmf.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/mmf_adaptation/xamediarecorderadaptctxmmf.c	Fri May 14 16:22:35 2010 +0300
@@ -20,14 +20,13 @@
 #include "xamediarecorderadaptctxmmf.h"
 #include "xaadaptationmmf.h"
 #include "cmmfbackendengine.h"
+#include "xaadptbasectx.h"
 //#include "XAMetadataAdaptation.h"
 //#include "XAStaticCapsAdaptation.h"
 
 
-#define XA_ADAPTID_UNINITED 0
-#ifdef _GSTREAMER_BACKEND_ 
 extern XAboolean cameraRealized;
-#endif
+
 //extern XACameraAdaptationCtx_* cameraCtx;
 
 
@@ -40,7 +39,7 @@
  * @param XADataSink *pDataSnk - pointer to OMX-AL sink
  * @returns XAMediaRecorderAdaptationMMFCtx* - Pointer to created context, NULL if error occurs.
  */
-XAAdaptationBaseMMFCtx* XAMediaRecorderAdaptMMF_Create(XADataSource* pAudioSrc,
+XAAdaptationBaseCtx* XAMediaRecorderAdaptMMF_Create(XADataSource* pAudioSrc,
         XADataSource* pImageVideoSrc, XADataSink* pDataSnk, XAuint8 recModes)
     {
     XAMediaRecorderAdaptationMMFCtx *pSelf = NULL;
@@ -49,11 +48,11 @@
     XADataLocator_IODevice *ioDevice;
     DEBUG_API("->XAMediaRecorderAdaptMMF_Create");
 
-    pSelf = calloc(1, sizeof(XAMediaRecorderAdaptationMMFCtx));
+    pSelf = (XAMediaRecorderAdaptationMMFCtx*)calloc(1, sizeof(XAMediaRecorderAdaptationMMFCtx));
     if (pSelf)
         {            
         if (XAAdaptationBaseMMF_Init(&(pSelf->baseObj),
-                XAMediaRecorderAdaptationMMF) != XA_RESULT_SUCCESS)
+                XAMediaRecorderAdaptation) != XA_RESULT_SUCCESS)
             {
             DEBUG_ERR("Failed to init base context!!!");
             free(pSelf);
@@ -97,9 +96,9 @@
                 ioDevice
                         = (XADataLocator_IODevice*) (pImageVideoSrc->pLocator);
                 if (ioDevice->deviceType == XA_IODEVICE_CAMERA
-#ifdef _GSTREAMER_BACKEND_ 
+ 
                         && !cameraRealized
-#endif                        
+                        
                         )
                     {
                     DEBUG_ERR("Preconditions violated - Camera object not realized");
@@ -123,7 +122,7 @@
         }
     
     DEBUG_API("<-XAMediaRecorderAdaptMMF_Create");
-    return (XAAdaptationBaseMMFCtx*) pSelf;
+    return (XAAdaptationBaseCtx*) (&pSelf->baseObj.baseObj);
     }
 
 /*
@@ -132,7 +131,7 @@
  * @param XAAdaptationBaseCtx* ctx - pointer to Media Recorder adaptation context
  * @return XAresult - Success value
  */
-XAresult XAMediaRecorderAdaptMMF_PostInit(XAAdaptationBaseMMFCtx* bCtx)
+XAresult XAMediaRecorderAdaptMMF_PostInit(XAAdaptationMMFCtx* bCtx)
     {
 
     XAresult ret = XA_RESULT_SUCCESS;
@@ -153,11 +152,11 @@
     }
 
 /*
- * void XAMediaRecorderAdaptMMF_Destroy( XAAdaptationBaseMMFCtx* bCtx )
+ * void XAMediaRecorderAdaptMMF_Destroy( XAAdaptationMMFCtx* bCtx )
  * Destroys Media Recorder Adaptation Context
  * @param ctx - Media Recorder Adaptation context to be destroyed
  */
-void XAMediaRecorderAdaptMMF_Destroy(XAAdaptationBaseMMFCtx* bCtx)
+void XAMediaRecorderAdaptMMF_Destroy(XAAdaptationMMFCtx* bCtx)
     {
     XAMediaRecorderAdaptationMMFCtx* ctx = NULL;
     
@@ -172,7 +171,7 @@
 
     if(ctx->mmfContext)
         {
-        mmf_close(ctx->mmfContext);
+        mmf_backend_engine_deinit(ctx->mmfContext);
         }
     XAAdaptationBaseMMF_Free(bCtx);
 
--- a/khronosfws/openmax_al/src/mmf_adaptation/xamediarecorderadaptctxmmf.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/mmf_adaptation/xamediarecorderadaptctxmmf.h	Fri May 14 16:22:35 2010 +0300
@@ -18,19 +18,58 @@
 #ifndef XAMEDIARECORDERADAPTCTXMMF_H_
 #define XAMEDIARECORDERADAPTCTXMMF_H_
 
-#include "xaadaptationcontextbasemmf.h"
+#include "xaadaptationmmf.h"
 
 
 /* TYPEDEFS */
-#define XA_RECMODE_STREAM 1
-#define XA_RECMODE_STILL 2
-
 typedef struct XAMediaRecorderAdaptationMMFCtx_ XAMediaRecorderAdaptationMMFCtx;
 
+typedef struct XAMediaRecorderAdaptationMMFCtx_
+{
+    /* Parent*/
+    XAAdaptationMMFCtx_ 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                premutevol;
+    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 */
-XAAdaptationBaseMMFCtx* XAMediaRecorderAdaptMMF_Create(  XADataSource* pAudioSrc, XADataSource* pImageVideoSrc, XADataSink* pDataSnk, XAuint8 recModes );
-XAresult XAMediaRecorderAdaptMMF_PostInit( XAAdaptationBaseMMFCtx* bCtx );
-void XAMediaRecorderAdaptMMF_Destroy( XAAdaptationBaseMMFCtx* bCtx );
+XAAdaptationBaseCtx* XAMediaRecorderAdaptMMF_Create(  XADataSource* pAudioSrc,
+                            XADataSource* pImageVideoSrc, XADataSink* pDataSnk, XAuint8 recModes );
+XAresult XAMediaRecorderAdaptMMF_PostInit( XAAdaptationMMFCtx* bCtx );
+void XAMediaRecorderAdaptMMF_Destroy( XAAdaptationMMFCtx* bCtx );
 
 
 #endif /* XAMEDIARECORDERADAPTCTXMMF_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mmf_adaptation/xametadataadaptctxmmf.c	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,106 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+#include <assert.h>
+#include <stdlib.h>
+#include "xametadataadaptctxmmf.h"
+#include "xaobjectitf.h"
+#include "cmetadatautilityitf.h"
+
+XAAdaptationBaseCtx* XAMetadataAdaptCtxMMF_Create(XADataSource * pDataSrc)
+{
+
+    XAMetadataAdaptationMMFCtx *pSelf = NULL;
+    DEBUG_API("->XAMetadataAdaptCtxMMF_Create");
+    
+    pSelf = calloc(1, sizeof(XAMetadataAdaptationMMFCtx));
+    if ( pSelf)
+    {
+          
+        if( XAAdaptationBaseMMF_Init(&(pSelf->baseObj),XAMDAdaptation)
+            != XA_RESULT_SUCCESS )
+        {
+            DEBUG_ERR("Failed to init base context!!!");
+            free(pSelf);
+            pSelf = NULL;
+        }
+        else
+            
+        {
+            pSelf->baseObj.baseObj.fwtype = FWMgrFWMMF;
+            pSelf->xaSource = pDataSrc;
+        }
+
+		if(pDataSrc)
+		{
+			pSelf->mmfContext = mmf_metadata_utility_init((char *)(( (XADataLocator_URI*)(pDataSrc->pLocator))->URI));
+			if(!pSelf->mmfContext)
+            {
+	            DEBUG_ERR("Failed to init mmf context!!!");
+    	        free(pSelf);
+        	    pSelf = NULL;           
+            }
+		}
+
+    }
+
+    DEBUG_API("<- XAMetadataAdaptCtxMMF_Create");
+    return (XAAdaptationBaseCtx*)(&pSelf->baseObj.baseObj);
+}
+
+
+/*
+ * 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 XAMetadataAdaptCtxMMF_PostInit( XAAdaptationMMFCtx* bCtx )
+{
+ 	XAresult ret = XA_RESULT_SUCCESS;
+ 
+  DEBUG_API("<-XAMetadataAdaptCtxMMF_PostInit");
+  return ret;
+}
+
+/*
+ * void XAMediaPlayerAdaptMMF_Destroy( XAMediaPlayerAdaptationMMFCtx* ctx )
+ * Destroys Media Player Adaptation Context
+ * @param ctx - Media Player Adaptation context to be destroyed
+ */
+void XAMetadataAdaptCtxMMF_Destroy( XAAdaptationMMFCtx* bCtx )
+{
+    DEBUG_API("->XAMetadataAdaptCtxMMF_Destroy");
+    if(bCtx == NULL)
+    {
+        DEBUG_ERR("Invalid parameter!!");
+        DEBUG_API("<-XAMetadataAdaptCtxMMF_Destroy");
+        return;
+    }
+	
+    if(((XAMetadataAdaptationMMFCtx*)bCtx)->mmfContext)
+    {
+        mmf_metadata_utility_destroy(((XAMetadataAdaptationMMFCtx*)bCtx)->mmfContext);
+    }
+
+    XAAdaptationBase_Free( &bCtx->baseObj );
+    free(bCtx);
+    bCtx = NULL;
+
+    DEBUG_API("<-XAMetadataExtractorAdaptMMF_Destroy");
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mmf_adaptation/xametadataadaptctxmmf.h	Fri May 14 16:22:35 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 XAMETADATAADAPTCTXMMF_H
+#define XAMETADATAADAPTCTXMMF_H
+
+#include "xaadaptationmmf.h"
+
+/* TYPEDEFS */
+
+typedef struct XAMetadataAdaptationMMFCtx_ XAMetadataAdaptationMMFCtx;
+
+/* FUNCTIONS */
+XAAdaptationBaseCtx* XAMetadataAdaptCtxMMF_Create( XADataSource *pDataSrc );
+XAresult XAMetadataAdaptCtxMMF_PostInit( XAAdaptationMMFCtx* bCtx );
+void XAMetadataAdaptCtxMMF_Destroy( XAAdaptationMMFCtx* bCtx );
+#endif /*XAMETADATAADAPTCTXMMF_H*/
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mmf_adaptation/xammfcapabilitiesmgr.c	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,354 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#include "xammfcapabilitiesmgr.h"
+#include <stdio.h>
+#include <string.h>
+
+static XAresult XAMMFCapabilitiesMgr_GetAudioAACEncoderCapabilities(XACapabilities **ppNode);
+static XAresult XAMMFCapabilitiesMgr_GetAudioAMREncoderCapabilities(XACapabilities **ppNode);
+static XAresult XAMMFCapabilitiesMgr_GetAudioPCMEncoderCapabilities(XACapabilities **ppNode);
+
+/* XAresult XAMMFCapabilitiesMgr_UpdateCapabilitieList
+ * Description: Update the capabilities list supported by GStreamer framework.
+ */
+XAresult XAMMFCapabilitiesMgr_UpdateCapabilitieList(
+                FrameworkMap *frameworkMap,
+                XACapabilities **ppListHead)
+
+{
+    XAresult res = XA_RESULT_SUCCESS;
+    XACapabilities *lastNode;
+    XACapabilities *firstNode;
+    XACapabilities *newNode = NULL;
+    FWMgrFwType fwtype = FWMgrFWUknown;
+    char *uri = NULL;
+    DEBUG_API("->XAGSTCapabilitiesMgr_UpdateCapabilitieList");
+
+    if(!frameworkMap || !ppListHead)
+    {
+        res = XA_RESULT_PARAMETER_INVALID;
+        return res;
+    }
+
+    lastNode = firstNode = *ppListHead;
+    
+    /* traverse and point to the last node in the list */
+    while(lastNode && lastNode->next)
+    {
+        lastNode = lastNode->next;
+    }
+
+    uri = "file:///c:/test.mp4";
+    fwtype = XAFrameworkMgr_GetFramework(
+            frameworkMap,
+            uri,
+            FWMgrMORecorder);
+    
+    if(fwtype == FWMgrFWMMF)
+    {
+        /* Add codec capabilities */
+        newNode = NULL;
+        res = XAMMFCapabilitiesMgr_GetAudioAACEncoderCapabilities(&newNode);
+        if (res != XA_RESULT_SUCCESS)
+            {
+            return res;
+            }
+        if (lastNode)
+        {
+            lastNode->next = newNode;
+        }
+        if (newNode)
+        { /* if a new node is created move lastNode to the new item */
+            if (!firstNode)
+                firstNode = newNode;
+            lastNode = newNode;
+        }
+    }
+    
+
+    uri = "file:///c:/test.amr";
+    fwtype = XAFrameworkMgr_GetFramework(
+            frameworkMap,
+            uri,
+            FWMgrMORecorder);
+    
+    if(fwtype == FWMgrFWMMF)
+    {
+        newNode = NULL;
+        res = XAMMFCapabilitiesMgr_GetAudioAMREncoderCapabilities(&newNode);
+        if (res != XA_RESULT_SUCCESS)
+            {
+            return res;
+            }
+        if (lastNode)
+        {
+            lastNode->next = newNode;
+        }
+        if (newNode)
+        { /* if a new node is created move lastNode to the new item */
+            if (!firstNode)
+                firstNode = newNode;
+            lastNode = newNode;
+        }
+    }
+
+    uri = "file:///c:/test.wav";
+    fwtype = XAFrameworkMgr_GetFramework(
+            frameworkMap,
+            uri,
+            FWMgrMORecorder);
+    
+    if(fwtype == FWMgrFWMMF)
+    {
+        newNode = NULL;
+        res = XAMMFCapabilitiesMgr_GetAudioPCMEncoderCapabilities(&newNode);
+        if (res != XA_RESULT_SUCCESS)
+            {
+            return res;
+            }
+        if (lastNode)
+        {
+            lastNode->next = newNode;
+        }
+        if (newNode)
+        { /* if a new node is created move lastNode to the new item */
+            if (!firstNode)
+                firstNode = newNode;
+            lastNode = newNode;
+        }
+    }
+    /* if empty list, then append first node as the head */
+    if (!(*ppListHead))
+        {
+        *ppListHead = firstNode;
+        }
+    DEBUG_API("<-XAGSTCapabilitiesMgr_UpdateCapabilitieList");
+    return res;
+}
+
+
+XAresult XAMMFCapabilitiesMgr_GetAudioAACEncoderCapabilities(XACapabilities **ppNode)
+{
+    XAresult res = XA_RESULT_SUCCESS;
+    XACapabilities *newNode = NULL;
+    XAAudioCodecDescriptor *entries = NULL;
+
+    newNode = (XACapabilities *)calloc(1, sizeof(XACapabilities));
+    if (!newNode)
+    {
+        res = XA_RESULT_MEMORY_FAILURE;
+        return res;
+    }
+
+    newNode->capsType = AUD_E;
+    newNode->xaid = XA_AUDIOCODEC_AAC;
+    newNode->noOfEntries = 1;
+
+    /* Allocate array */
+    entries = (XAAudioCodecDescriptor*)calloc(1, sizeof(XAAudioCodecDescriptor));
+    if (!entries)
+    {
+        res = XA_RESULT_MEMORY_FAILURE;
+        XACapabilitiesMgr_DeleteCapabilitieList(&newNode);
+        return res;
+    }
+
+    newNode->pEntry = (void*)entries;
+ 
+    entries->maxChannels = 2;
+    entries->minBitsPerSample = 16;
+    entries->maxBitsPerSample = 16;
+    entries->minSampleRate = 8000000;  /*milliHz*/
+    entries->maxSampleRate = 48000000;
+    entries->isFreqRangeContinuous=XA_BOOLEAN_FALSE;
+    entries->numSampleRatesSupported = 7;
+    entries->pSampleRatesSupported = (XAmilliHertz*)calloc(entries->numSampleRatesSupported, sizeof(XAmilliHertz));
+    if (!entries->pSampleRatesSupported)
+    {
+        res = XA_RESULT_MEMORY_FAILURE;
+        XACapabilitiesMgr_DeleteCapabilitieList(&newNode);
+        return res;
+    }
+    /* entries in milliHz */
+    entries->pSampleRatesSupported[0] = 8000000;
+    entries->pSampleRatesSupported[1] = 11025000;
+    entries->pSampleRatesSupported[2] = 16000000;
+    entries->pSampleRatesSupported[3] = 22050000;
+    entries->pSampleRatesSupported[4] = 32000000;
+    entries->pSampleRatesSupported[5] = 44100000;
+    entries->pSampleRatesSupported[6] = 48000000;
+
+    entries->minBitRate = 32000;
+    entries->maxBitRate = 256000;
+    entries->isBitrateRangeContinuous = XA_BOOLEAN_FALSE;
+    entries->numBitratesSupported = 8;
+    entries->pBitratesSupported = (XAuint32*)calloc(entries->numBitratesSupported, sizeof(XAuint32));
+    if (!entries->pBitratesSupported)
+    {
+        res = XA_RESULT_MEMORY_FAILURE;
+        XACapabilitiesMgr_DeleteCapabilitieList(&newNode);
+        return res;
+    }
+    (entries->pBitratesSupported)[0] = 32000;
+    (entries->pBitratesSupported)[1] = 64000;
+    (entries->pBitratesSupported)[2] = 96000;
+    (entries->pBitratesSupported)[3] = 128000;
+    (entries->pBitratesSupported)[4] = 160000;
+    (entries->pBitratesSupported)[5] = 192000;
+    (entries->pBitratesSupported)[6] = 224000;
+    (entries->pBitratesSupported)[7] = 256000;
+
+    entries->profileSetting = XA_AUDIOPROFILE_AAC_AAC;
+    entries->modeSetting = XA_AUDIOMODE_AAC_LC;
+
+    newNode->pEntry = (void*)entries;
+
+    *ppNode = newNode;
+    return res;
+}
+
+XAresult XAMMFCapabilitiesMgr_GetAudioAMREncoderCapabilities(XACapabilities **ppNode)
+{
+    XAresult res = XA_RESULT_SUCCESS;
+    XACapabilities *newNode = NULL;
+    XAAudioCodecDescriptor *entries = NULL;
+ 
+    newNode = (XACapabilities *)calloc(1, sizeof(XACapabilities));
+    if (!newNode)
+    {
+        res = XA_RESULT_MEMORY_FAILURE;
+        return res;
+    }
+
+    newNode->capsType = AUD_E;
+    newNode->xaid = XA_AUDIOCODEC_AMR;
+    newNode->noOfEntries = 1;
+
+    /* Allocate array */
+    entries = (XAAudioCodecDescriptor*)calloc(1, sizeof(XAAudioCodecDescriptor));
+    if (!entries)
+    {
+        res = XA_RESULT_MEMORY_FAILURE;
+        XACapabilitiesMgr_DeleteCapabilitieList(&newNode);
+        return res;
+    }
+
+    newNode->pEntry = (void*)entries;
+ 
+    entries->maxChannels = 1;
+    entries->minBitsPerSample = 8;
+    entries->maxBitsPerSample = 8;
+    entries->minSampleRate = 8000000;  /*milliHz*/
+    entries->maxSampleRate = 8000000;
+    entries->isFreqRangeContinuous=XA_BOOLEAN_TRUE;
+    entries->numSampleRatesSupported = 1;
+    entries->minBitRate=4750;
+    entries->maxBitRate=12200;
+    entries->isBitrateRangeContinuous=XA_BOOLEAN_FALSE;
+    entries->numBitratesSupported = 8;
+    entries->pBitratesSupported = (XAuint32*)calloc(entries->numBitratesSupported, sizeof(XAuint32));
+    if (!entries->pBitratesSupported)
+    {
+        res = XA_RESULT_MEMORY_FAILURE;
+        XACapabilitiesMgr_DeleteCapabilitieList(&newNode);
+        return res;
+    }
+    (entries->pBitratesSupported)[0] = 4750;
+    (entries->pBitratesSupported)[1] = 5150;
+    (entries->pBitratesSupported)[2] = 5900;
+    (entries->pBitratesSupported)[3] = 6700;
+    (entries->pBitratesSupported)[4] = 7400;
+    (entries->pBitratesSupported)[5] = 7950;
+    (entries->pBitratesSupported)[6] = 10200;
+    (entries->pBitratesSupported)[7] = 12200;
+
+    entries->profileSetting = XA_AUDIOPROFILE_AMR;
+    entries->modeSetting = 0;
+
+    newNode->pEntry = (void*)entries;
+
+    *ppNode = newNode;
+    return res;
+}
+
+XAresult XAMMFCapabilitiesMgr_GetAudioPCMEncoderCapabilities(XACapabilities **ppNode)
+{
+    XAresult res = XA_RESULT_SUCCESS;
+    XACapabilities *newNode = NULL;
+    XAAudioCodecDescriptor *entries = NULL;
+
+    newNode = (XACapabilities *)calloc(1, sizeof(XACapabilities));
+    if (!newNode)
+    {
+        res = XA_RESULT_MEMORY_FAILURE;
+        return res;
+    }
+
+    newNode->capsType = AUD_E;
+    newNode->xaid = XA_AUDIOCODEC_PCM;
+    newNode->noOfEntries = 1;
+
+    /* Allocate array */
+    entries = (XAAudioCodecDescriptor*)calloc(1, sizeof(XAAudioCodecDescriptor));
+    if (!entries)
+    {
+        res = XA_RESULT_MEMORY_FAILURE;
+        XACapabilitiesMgr_DeleteCapabilitieList(&newNode);
+        return res;
+    }
+
+    newNode->pEntry = (void*)entries;
+
+    entries->maxChannels = 2;
+    entries->minBitsPerSample = 16;
+    entries->maxBitsPerSample = 16;
+    entries->minSampleRate = 8000000;  /*milliHz*/
+    entries->maxSampleRate = 96000000;
+    entries->isFreqRangeContinuous=XA_BOOLEAN_FALSE;
+    entries->numSampleRatesSupported = 10;
+    entries->pSampleRatesSupported = (XAmilliHertz*)calloc(entries->numSampleRatesSupported, sizeof(XAmilliHertz));
+    if (!entries->pSampleRatesSupported)
+    {
+        res = XA_RESULT_MEMORY_FAILURE;
+        XACapabilitiesMgr_DeleteCapabilitieList(&newNode);
+        return res;
+    }
+    /* entries in milliHz */
+    entries->pSampleRatesSupported[0] = 12000000;
+    entries->pSampleRatesSupported[1] = 16000000;
+    entries->pSampleRatesSupported[2] = 22050000;
+    entries->pSampleRatesSupported[3] = 24000000;
+    entries->pSampleRatesSupported[4] = 32000000;
+    entries->pSampleRatesSupported[5] = 44100000;
+    entries->pSampleRatesSupported[6] = 48000000;
+    entries->pSampleRatesSupported[7] = 64000000;
+    entries->pSampleRatesSupported[8] = 88200000;
+    entries->pSampleRatesSupported[9] = 96000000;
+
+    entries->minBitRate = 0;
+    entries->maxBitRate = 0;
+    entries->isBitrateRangeContinuous = XA_BOOLEAN_FALSE;
+    entries->pBitratesSupported = NULL;
+    entries->numBitratesSupported = 0;
+    entries->profileSetting = XA_AUDIOPROFILE_PCM;
+    entries->modeSetting = 0;
+
+    newNode->pEntry = (void*)entries;
+
+    *ppNode = newNode;
+    return res;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mmf_adaptation/xammfcapabilitiesmgr.h	Fri May 14 16:22:35 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 XAMMFCAPABILITIESMGR_H
+#define XAMMFCAPABILITIESMGR_H
+
+#include "openmaxalwrapper.h"
+#include "xaframeworkmgr.h"
+#include "xacapabilitiesmgr.h"
+
+XAresult XAMMFCapabilitiesMgr_UpdateCapabilitieList(
+                FrameworkMap *frameworkMap,
+                XACapabilities** ppListHead);
+
+#endif /* XAGSTCAPABILITIESMGR_H */
--- a/khronosfws/openmax_al/src/mmf_adaptation/xangavideosink.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/mmf_adaptation/xangavideosink.cpp	Fri May 14 16:22:35 2010 +0300
@@ -20,7 +20,7 @@
 Shy Ward
 */
 
-#include "XANGAVideoSink.h"
+#include "xangavideosink.h"
 #include "openmaxalwrapper.h"
 
 
@@ -33,14 +33,20 @@
 
 CNgaVideoSink::~CNgaVideoSink()
 {
-	iMediaClientVideoDisplay->RemoveDisplayWindow(*m_pWindow);
-	delete iMediaClientVideoDisplay;
-  if(IsActive())
-  {
-     Cancel();
-  }	
+    RemoveWindow();
+    
+    delete iMediaClientVideoDisplay;
+    if(IsActive())
+    {
+    Cancel();
+    }	
 }
     
+void CNgaVideoSink::RemoveWindow()
+    {
+    iMediaClientVideoDisplay->RemoveDisplayWindow(*m_pWindow);
+    }
+
 CNgaVideoSink::CNgaVideoSink()
                   :CActive(EPriorityStandard)
 {
@@ -133,8 +139,8 @@
   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);  
+  TRAPD(err, iMediaClientVideoDisplay->AddDisplayWindowL(m_pWindow, m_clipRect, m_cropRegion, m_videoExtent, m_scaleWidth, m_scaleHeight,
+                                               m_rotation, EAutoScaleBestFit, m_horizPos, m_vertPos, m_pWindow));  
 
 }
 
--- a/khronosfws/openmax_al/src/mmf_adaptation/xangavideosink.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/mmf_adaptation/xangavideosink.h	Fri May 14 16:22:35 2010 +0300
@@ -35,7 +35,7 @@
 #include <mediaclientvideodisplay.h>
 #endif
 
-class CNgaVideoSink : public CBase,
+NONSHARABLE_CLASS(CNgaVideoSink) : public CBase,
                       public CActive
     {
 public:
@@ -50,7 +50,7 @@
     virtual void RunL();
     virtual void DoCancel();
     void Activate();
-
+    void RemoveWindow();
     void CompleteRequest(TInt status = KErrNone);    
     
 private:
@@ -97,4 +97,4 @@
 
 #endif /* __cplusplus */
 
-#endif /* XA_CNGAVIDEOSINK_H */
\ No newline at end of file
+#endif /* XA_CNGAVIDEOSINK_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mmf_adaptation/xanokialinearvolumeitfadaptationmmf.c	Fri May 14 16:22:35 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: 
+*
+*/
+
+
+//#include <mixer.h>
+#include "xaadaptationmmf.h"
+#include "xanokialinearvolumeitfadaptationmmf.h"
+#include "xamediaplayeradaptctxmmf.h"
+#include "cmmfbackendengine.h"
+/*
+ * XAresult XANokiaLinearVolumeItfAdapt_SetVolumeLevel(void *ctx, AdaptationContextIDS ctx->baseObj.ctxId,
+ *                                          XAuint32 percentage)
+ * @param void *ctx - Adaptation context, this will be casted to correct type regarding to contextID
+ * XAuint32 percentage - Requested volume level, in between MIN_VOLUME_LEVEL and MAX_VOLUME_LEVEL
+ * @return XAresult ret - Success value
+ */
+XAresult XANokiaLinearVolumeItfAdapt_SetVolumeLevel(XAAdaptationMMFCtx *ctx, XAuint32 percentage)
+{
+    XAresult res = XA_RESULT_SUCCESS;
+    XAuint32 maxvol;
+    XAuint32 vol;
+    DEBUG_API_A1("->XANokiaLinearVolumeItfAdapt_SetVolumeLevel to: %d", percentage);
+    if(!ctx || ( ctx->baseObj.ctxId != XAMediaPlayerAdaptation &&
+                 ctx->baseObj.ctxId != XAMediaRecorderAdaptation &&
+                 ctx->baseObj.ctxId != XARadioAdaptation) )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XANokiaLinearVolumeItfAdapt_SetVolumeLevel");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+    
+    if(ctx->baseObj.ctxId == XAMediaPlayerAdaptation)
+        {
+        mmf_volumeitf_get_maxvolume(((XAMediaPlayerAdaptationMMFCtx*)ctx)->mmfContext,
+                                        &maxvol); 
+        
+        vol = (percentage * maxvol) / MAX_PERCENTAGE_VOLUME;
+        
+        mmf_volumeitf_set_volume(((XAMediaPlayerAdaptationMMFCtx*)ctx)->mmfContext,
+                                    vol);
+        }
+    DEBUG_API("<-XANokiaLinearVolumeItfAdapt_SetVolumeLevel");
+    return res;
+}
+
+XAresult XANokiaLinearVolumeItfAdapt_GetStepCount(XAAdaptationMMFCtx *ctx,
+                                                    XAuint32* stepcount)
+    {
+    XAresult res = XA_RESULT_SUCCESS;
+    DEBUG_API_A1("->XANokiaLinearVolumeItfAdapt_SetVolumeLevel to: %d",
+                                                            percentage);
+    if(!ctx || ( ctx->baseObj.ctxId != XAMediaPlayerAdaptation &&
+                 ctx->baseObj.ctxId != XAMediaRecorderAdaptation &&
+                 ctx->baseObj.ctxId != XARadioAdaptation) )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XANokiaLinearVolumeItfAdapt_SetVolumeLevel");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if(ctx->baseObj.ctxId == XAMediaPlayerAdaptation)
+        {
+        mmf_volumeitf_get_maxvolume(((XAMediaPlayerAdaptationMMFCtx*)ctx)->mmfContext,
+                                        stepcount);
+        }
+    
+    DEBUG_API("<-XANokiaLinearVolumeItfAdapt_SetVolumeLevel");
+    return res;    
+    }
+
+void XANokiaLinearVolumeItfAdapt_VolumeChange(XAAdaptationBaseCtx *ctx, TInt aVolume)
+{
+   	XAAdaptEvent event = {XA_NOKIALINEARVOLITFEVENTS, XA_ADAPT_VOLUME_VOLUME_CHANGED,1,0};    	
+    if (ctx)
+ 		{
+ 			event.data = &aVolume;    
+ 			XAAdaptationBase_SendAdaptEvents(ctx, &event );
+   	}   
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mmf_adaptation/xanokialinearvolumeitfadaptationmmf.h	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 XANOKIALINEARVOLUMEITFADAPTATIONMMF_H
+#define XANOKIALINEARVOLUMEITFADAPTATIONMMF_H
+
+#include "xaadaptationmmf.h"
+#include "xadebug.h"
+#include "xathreadsafety.h"
+
+/* MACROS */
+
+/* FUNCTIONS */
+
+XAresult XANokiaLinearVolumeItfAdapt_SetVolumeLevel(XAAdaptationMMFCtx *ctx,
+                                         XAuint32 percentage);
+XAresult XANokiaLinearVolumeItfAdapt_GetMaxVolumeLevel(XAAdaptationMMFCtx *ctx,                                         
+                                                        XAuint32 * pPercentage);
+ 
+XAresult XANokiaLinearVolumeItfAdapt_GetStepCount(XAAdaptationMMFCtx *ctx,
+        											XAuint32 * pStepCount);
+
+void XANokiaLinearVolumeItfAdapt_VolumeChange(XAAdaptationBaseCtx *ctx, TInt volume);
+
+#endif /* XANOKIALINEARVOLUMEITFADAPTATIONMMF_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mmf_adaptation/xanokiavolumeextitfadaptationmmf.c	Fri May 14 16:22:35 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: 
+*
+*/
+
+#include "xanokiavolumeextitfadaptationmmf.h"
+#include "xamediaplayeradaptctxmmf.h"
+#include "xamediarecorderadaptctxmmf.h"
+#include "cmmfbackendengine.h"
+
+/*
+ * XAresult XANokiaVolumeExtItfAdapt_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 XANokiaVolumeExtItfAdapt_SetMute(XAAdaptationMMFCtx *ctx, XAboolean mute)
+{    
+    XAuint32 volume;
+    DEBUG_API("->XANokiaVolumeExtItfAdapt_SetMute");
+    if(!ctx || ( ctx->baseObj.ctxId != XAMediaPlayerAdaptation &&
+                 ctx->baseObj.ctxId != XAMediaRecorderAdaptation &&
+                 ctx->baseObj.ctxId != XARadioAdaptation ) )  
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XANokiaVolumeExtItfAdapt_SetMute");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if ( ctx->baseObj.ctxId == XAMediaPlayerAdaptation )
+    {
+    if(mute)
+        {
+        
+        mmf_volumeitf_get_volume(((XAMediaPlayerAdaptationMMFCtx*)ctx)->mmfContext,
+                                    &volume);
+        ((XAMediaPlayerAdaptationMMFCtx*)ctx)->premutevol = volume;
+        mmf_volumeitf_set_volume(((XAMediaPlayerAdaptationMMFCtx*)ctx)->mmfContext,
+                                    0);
+        }
+    else
+        {
+        mmf_volumeitf_set_volume(((XAMediaPlayerAdaptationMMFCtx*)ctx)->mmfContext,
+                                    ((XAMediaPlayerAdaptationMMFCtx*)ctx)->premutevol);
+        }
+    }
+    else if ( ctx->baseObj.ctxId == XAMediaRecorderAdaptation )
+    {
+    if(mute)
+        {
+        
+        mmf_volumeitf_get_volume(((XAMediaRecorderAdaptationMMFCtx*)ctx)->mmfContext,
+                                    &volume);
+        ((XAMediaRecorderAdaptationMMFCtx*)ctx)->premutevol = volume;
+        mmf_volumeitf_set_volume(((XAMediaRecorderAdaptationMMFCtx*)ctx)->mmfContext,
+                                    0);
+        }
+    else
+        {
+        mmf_volumeitf_set_volume(((XAMediaRecorderAdaptationMMFCtx*)ctx)->mmfContext,
+                                    ((XAMediaRecorderAdaptationMMFCtx*)ctx)->premutevol);
+        } 
+    }
+   	else if ( ctx->baseObj.ctxId == XARadioAdaptation )
+    {
+   			
+    }
+        
+    DEBUG_API("<-XANokiaVolumeExtItfAdapt_SetMute");
+    return XA_RESULT_SUCCESS;
+}
+
+/*
+ * XAresult XANokiaVolumeExtItfAdapt_EnableStereoPosition(XAAdaptationBaseCtx *ctx, XAboolean enable)
+ * @param XAAdaptationBaseCtx *ctx - Adaptation context
+ * @param XAboolean enable - Enable Stereo Position
+ * @return XAresult - Success value
+ */
+XAresult XANokiaVolumeExtItfAdapt_EnableStereoPosition(XAAdaptationMMFCtx *ctx, XAboolean enable)
+{
+    DEBUG_API("->XANokiaVolumeExtItfAdapt_EnableStereoPosition");
+
+    if(!ctx || ( ctx->baseObj.ctxId != XAMediaPlayerAdaptation &&
+                 ctx->baseObj.ctxId != XAMediaRecorderAdaptation ) )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XANokiaVolumeExtItfAdapt_EnableStereoPosition");
+        /* invalid parameter */
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if ( ctx->baseObj.ctxId == XAMediaPlayerAdaptation  )
+    {
+
+    }
+    else if ( ctx->baseObj.ctxId == XAMediaRecorderAdaptation )
+    {
+ 
+    }
+
+    DEBUG_API("<-XANokiaVolumeExtItfAdapt_EnableStereoPosition");
+    return XA_RESULT_SUCCESS;
+}
+
+/*
+ * XAresult XANokiaVolumeExtItfAdapt_SetStereoPosition(XAAdaptationMMFCtx *ctx, XApermille stereoPosition)
+ * @param XAAdaptationBaseCtx *ctx - Adaptation context
+ * @param XApermille stereoPosition - Stereo Position to be set
+ * @return XAresult - Success value
+ */
+XAresult XANokiaVolumeExtItfAdapt_SetStereoPosition(XAAdaptationMMFCtx *ctx,
+                                            XApermille stereoPosition)
+{
+    DEBUG_API("->XANokiaVolumeExtItfAdapt_SetStereoPosition");
+    
+    if(!ctx || ( ctx->baseObj.ctxId != XAMediaPlayerAdaptation &&
+                 ctx->baseObj.ctxId != XAMediaRecorderAdaptation ) )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("<-XANokiaVolumeExtItfAdapt_SetStereoPosition");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if ( ctx->baseObj.ctxId == XAMediaPlayerAdaptation  )
+    {
+
+    }
+    else if ( ctx->baseObj.ctxId == XAMediaRecorderAdaptation )
+    {
+
+    }
+
+    DEBUG_API("<-XANokiaVolumeExtItfAdapt_SetStereoPosition");
+    return XA_RESULT_SUCCESS;
+}
+
+void XANokiaVolumeExtItfAdapt_MuteChange(XAAdaptationBaseCtx* ctx, XAboolean aMute)
+{
+   	XAAdaptEvent event = {XA_NOKIAEXTVOLITFEVENTS, XA_ADAPT_VOLUME_MUTE_CHANGED,1,0};    	
+    if (ctx)
+ 		{
+ 			event.data = &aMute;
+ 			XAAdaptationBase_SendAdaptEvents(ctx, &event );
+   	}   
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mmf_adaptation/xanokiavolumeextitfadaptationmmf.h	Fri May 14 16:22:35 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 XANOKIAVOLUMEEXTITFADAPTATIONMMF_H
+#define XANOKIAVOLUMEEXTITFADAPTATIONMMF_H
+
+#include "xaadaptationmmf.h"
+#include "xadebug.h"
+#include "xathreadsafety.h"
+
+/* MACROS */
+
+/* DEFINES */
+
+/* FUNCTIONS */
+
+XAresult XANokiaVolumeExtItfAdapt_SetMute(XAAdaptationMMFCtx *ctx,  XAboolean mute);
+
+XAresult XANokiaVolumeExtItfAdapt_EnableStereoPosition(XAAdaptationMMFCtx *ctx,
+                                               XAboolean enable);
+
+XAresult XANokiaVolumeExtItfAdapt_SetStereoPosition(XAAdaptationMMFCtx *ctx,
+                                            XApermille stereoPosition);
+
+void XANokiaVolumeExtItfAdapt_MuteChange(XAAdaptationBaseCtx* ctx, XAboolean aMute);
+
+#endif /* XANOKIAVOLUMEEXTITFADAPTATIONMMF_H */
--- a/khronosfws/openmax_al/src/mmf_adaptation/xaplayitfadaptationmmf.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/mmf_adaptation/xaplayitfadaptationmmf.c	Fri May 14 16:22:35 2010 +0300
@@ -11,7 +11,7 @@
 *
 * Contributors:
 *
-* Description: 
+* Description:
 *
 */
 
@@ -28,43 +28,34 @@
 gboolean XAPlayItfAdapt_PositionUpdate(gpointer ctx);
 
 /*
- * XAresult XAPlayItfAdapt_SetPlayState(XAAdaptationBaseCtx *bCtx, XAuint32 state)
+ * XAresult XAPlayItfAdaptMMF_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 XAPlayItfAdaptMMF_SetPlayState(XAAdaptationBaseCtx *bCtx, XAuint32 state)
 {
     XAresult ret = XA_RESULT_SUCCESS;
-    
-    XAMediaPlayerAdaptationMMFCtx* mCtx = NULL;
-
-
-    
-    DEBUG_API_A1("->XAPlayItfAdapt_SetPlayState %s",PLAYSTATENAME(state));
+    XAMediaPlayerAdaptationMMFCtx* mCtx = (XAMediaPlayerAdaptationMMFCtx*) bCtx;
 
-    if(!bCtx)
-    {
-        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
-        return XA_RESULT_PARAMETER_INVALID;
-    }
+    DEBUG_API_A1("->XAPlayItfAdaptMMF_SetPlayState %s",PLAYSTATENAME(state));
 
-    mCtx = (XAMediaPlayerAdaptationMMFCtx*) bCtx;
+    /* bCtx and parameter pointer validation happens in the calling function.
+     * We don't need to repeat it here*/
     switch ( state )
     {
         case XA_PLAYSTATE_STOPPED:
         {
-            mmf_stop_playback(mCtx->mmfContext);
-            mmf_close(mCtx->mmfContext);
+            ret = mmf_playitf_stop_playback(mCtx->mmfContext);
             break;
         }
         case XA_PLAYSTATE_PAUSED:
-            mmf_pause_playback(mCtx->mmfContext);
+            ret = mmf_playitf_pause_playback(mCtx->mmfContext);
             break;
         case XA_PLAYSTATE_PLAYING:
         {
-            mmf_resume_playback(mCtx->mmfContext);
+            ret = mmf_playitf_resume_playback(mCtx->mmfContext);
             break;
         }
         default:
@@ -72,72 +63,151 @@
             break;
     }
 
-   DEBUG_API("<-XAPlayItfAdapt_SetPlayState");
+    DEBUG_API("<-XAPlayItfAdaptMMF_SetPlayState");
     return ret;
 }
 
 /*
- * XAresult XAPlayItfAdapt_GetDuration(XAAdaptationBaseCtx *bCtx, XAmillisecond *pMsec)
+ * XAresult XAPlayItfAdaptMMF_GetPlayState(XAAdaptationBaseCtx *bCtx, XAuint32 *pState)
+ * @param XAAdaptationBaseCtx *bCtx - Adaptation context, this will be casted to correct type regarding to contextID
+ * XAuint32 *state - XAmillisecond *pMsec - Pointer where to store play state
+ * @return XAresult ret - Success value
+ */
+XAresult XAPlayItfAdaptMMF_GetPlayState(XAAdaptationBaseCtx *bCtx, XAuint32 *pState)
+    {
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAMediaPlayerAdaptationMMFCtx* mCtx = (XAMediaPlayerAdaptationMMFCtx*) bCtx;
+
+    DEBUG_API("->XAPlayItfAdaptMMF_GetPlayState");
+
+    /* If playhead reaches eof, state will transition to paused.
+     * This object does not have visibility to callback*/
+    ret = mmf_playitf_get_play_state(mCtx->mmfContext, pState);
+
+    DEBUG_API("<-XAPlayItfAdaptMMF_GetPlayState");
+    return ret;
+
+    }
+
+/*
+ * XAresult XAPlayItfAdaptMMF_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 XAPlayItfAdaptMMF_GetDuration(XAAdaptationBaseCtx *bCtx, XAmillisecond *pMsec)
 {
     XAresult ret = XA_RESULT_SUCCESS;
+    XAMediaPlayerAdaptationMMFCtx* mCtx = (XAMediaPlayerAdaptationMMFCtx*) bCtx;
 
-    DEBUG_API("->XAPlayItfAdapt_GetDuration");
+    DEBUG_API("->XAPlayItfAdaptMMF_GetDuration");
 
-    if(!bCtx)
-    {
-        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
-        /* invalid parameter */
-        return XA_RESULT_PARAMETER_INVALID;
-    }
+    ret = mmf_playitf_get_duration(mCtx->mmfContext, pMsec);
 
-
-    DEBUG_API("<-XAPlayItfAdapt_GetDuration");
+    DEBUG_API("<-XAPlayItfAdaptMMF_GetDuration");
     return ret;
 }
 
 /*
- * XAresult XAPlayItfAdapt_GetPosition(XAAdaptationBaseCtx *bCtx, XAmillisecond *pMsec)
+ * XAresult XAPlayItfAdaptMMF_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 XAPlayItfAdaptMMF_GetPosition(XAAdaptationBaseCtx *bCtx, XAmillisecond *pMsec)
 {
     XAresult ret = XA_RESULT_SUCCESS;
-    
-    DEBUG_API("->XAPlayItfAdapt_GetPosition");
+    XAMediaPlayerAdaptationMMFCtx* mCtx = (XAMediaPlayerAdaptationMMFCtx*) bCtx;
+
+    DEBUG_API("->XAPlayItfAdaptMMF_GetPosition");
 
-    if(!bCtx)
-    {
-        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
-        /* invalid parameter */
-        return XA_RESULT_PARAMETER_INVALID;
-    }
-    
-    DEBUG_API("<-XAPlayItfAdapt_GetPosition");
+    ret = mmf_playitf_get_position(mCtx->mmfContext, pMsec);
+
+    DEBUG_API("<-XAPlayItfAdaptMMF_GetPosition");
     return ret;
 }
 
 /*
- * XAresult XAPlayItfAdapt_EnablePositionTracking
- * Enable/disable periodic position tracking callbacks
+ * XAresult XAPlayItfAdaptMMF_RegisterCallback(XAAdaptationBaseCtx *bCtx, xaPlayCallback callback)
+ * Description: Sets the playback callback function.
  */
-XAresult XAPlayItfAdaptMMF_EnablePositionTracking(XAAdaptationBaseMMFCtx *bCtx, XAboolean enable)
+XAresult XAPlayItfAdaptMMF_RegisterCallback(XAAdaptationBaseCtx *bCtx, xaPlayCallback callback)
 {
-    DEBUG_API_A1("->XAPlayItfAdapt_EnablePositionTracking (enable: %d)", (int)enable);
-    if(!bCtx)
-    {
-        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
-        /* invalid parameter */
-        return XA_RESULT_PARAMETER_INVALID;
-    }
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAMediaPlayerAdaptationMMFCtx* mCtx = (XAMediaPlayerAdaptationMMFCtx*) bCtx;
+
+    DEBUG_API("->XAPlayItfAdaptMMF_RegisterCallback");
+
+    ret = mmf_playitf_register_callback(mCtx->mmfContext, callback);
+
+    DEBUG_API("<-XAPlayItfAdaptMMF_RegisterCallback");
+    return ret;
+}
 
-    DEBUG_API("<-XAPlayItfAdapt_EnablePositionTracking");
-    return XA_RESULT_SUCCESS;
+/**
+ * XAresult XAPlayItfAdaptMMF_SetCallbackEventsMask(XAAdaptationBaseCtx *bCtx, XAuint32 eventFlags)
+ * Description: Enables/disables notification of playback events.
+ **/
+XAresult XAPlayItfAdaptMMF_SetCallbackEventsMask(XAAdaptationBaseCtx *bCtx, XAuint32 eventFlags)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAMediaPlayerAdaptationMMFCtx* mCtx = (XAMediaPlayerAdaptationMMFCtx*) bCtx;
+
+    DEBUG_API("->XAPlayItfAdaptMMF_SetCallbackEventsMask");
+
+    ret = mmf_playitf_set_callback_events_mask(mCtx->mmfContext, eventFlags);
+
+    DEBUG_API("<-XAPlayItfAdaptMMF_SetCallbackEventsMask");
+    return ret;
 }
 
+/**
+ * XAresult XAPlayItfAdaptMMF_SetMarkerPosition(XAAdaptationBaseCtx *bCtx, XAmillisecond mSec)
+ * Description: Sets marker position.
+ **/
+XAresult XAPlayItfAdaptMMF_SetMarkerPosition(XAAdaptationBaseCtx *bCtx, XAmillisecond mSec)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAMediaPlayerAdaptationMMFCtx* mCtx = (XAMediaPlayerAdaptationMMFCtx*) bCtx;
+
+    DEBUG_API("->XAPlayItfAdaptMMF_SetMarkerPosition");
+
+    ret = mmf_playitf_set_marker_position(mCtx->mmfContext, mSec);
+
+    DEBUG_API("<-XAPlayItfAdaptMMF_SetMarkerPosition");
+    return ret;
+}
+
+/**
+ * XAresult XAPlayItfAdaptMMF_SetCallbackEventsMask(XAAdaptationBaseCtx *bCtx, XAuint32 eventFlags)
+ * Description: Clears marker position.
+ **/
+XAresult XAPlayItfAdaptMMF_ClearMarkerPosition(XAAdaptationBaseCtx *bCtx)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAMediaPlayerAdaptationMMFCtx* mCtx = (XAMediaPlayerAdaptationMMFCtx*) bCtx;
+
+    DEBUG_API("->XAPlayItfAdaptMMF_ClearMarkerPosition");
+
+    ret = mmf_playitf_clear_marker_position(mCtx->mmfContext);
+
+    DEBUG_API("<-XAPlayItfAdaptMMF_ClearMarkerPosition");
+    return ret;
+}
+
+/**
+ * XAPlayItfAdaptMMF_SetPositionUpdatePeriod(XAAdaptationBaseCtx *bCtx, XAmillisecond mSec)
+ * Description: Sets position update period.
+ **/
+XAresult XAPlayItfAdaptMMF_SetPositionUpdatePeriod(XAAdaptationBaseCtx *bCtx, XAmillisecond mSec)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAMediaPlayerAdaptationMMFCtx* mCtx = (XAMediaPlayerAdaptationMMFCtx*) bCtx;
+
+    DEBUG_API("->XAPlayItfAdaptMMF_SetPositionUpdatePeriod");
+
+    ret = mmf_playitf_set_position_update_period(mCtx->mmfContext, mSec);
+
+    DEBUG_API("<-XAPlayItfAdaptMMF_SetPositionUpdatePeriod");
+    return ret;
+}
--- a/khronosfws/openmax_al/src/mmf_adaptation/xaplayitfadaptationmmf.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/mmf_adaptation/xaplayitfadaptationmmf.h	Fri May 14 16:22:35 2010 +0300
@@ -18,8 +18,8 @@
 #ifndef XAPLAYITFADAPTATIONMMF_H
 #define XAPLAYITFADAPTATIONMMF_H
 
-#include "xaadaptationcontextbasemmf.h"
-#include "xadebug.h"
+#include "xaadaptationmmf.h"
+
 
 #ifdef _DEBUG
 /*parse state names for debug prints*/
@@ -35,10 +35,14 @@
 
 /* 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);
-
+XAresult XAPlayItfAdaptMMF_SetPlayState(XAAdaptationBaseCtx *bCtx, XAuint32 state);
+XAresult XAPlayItfAdaptMMF_GetPlayState(XAAdaptationBaseCtx *bCtx, XAuint32 *pState);
+XAresult XAPlayItfAdaptMMF_GetDuration(XAAdaptationBaseCtx *bCtx, XAmillisecond *pMsec);
+XAresult XAPlayItfAdaptMMF_GetPosition(XAAdaptationBaseCtx *bCtx, XAmillisecond *pMsec);
+XAresult XAPlayItfAdaptMMF_RegisterCallback(XAAdaptationBaseCtx *bCtx, xaPlayCallback callback);
+XAresult XAPlayItfAdaptMMF_SetCallbackEventsMask(XAAdaptationBaseCtx *bCtx, XAuint32 eventFlags);
+XAresult XAPlayItfAdaptMMF_SetMarkerPosition(XAAdaptationBaseCtx *bCtx, XAmillisecond mSec);
+XAresult XAPlayItfAdaptMMF_ClearMarkerPosition(XAAdaptationBaseCtx *bCtx);
+XAresult XAPlayItfAdaptMMF_SetPositionUpdatePeriod(XAAdaptationBaseCtx *bCtx, XAmillisecond mSec);
 
 #endif /* XAPLAYITFADAPTATIONMMF_H */
--- a/khronosfws/openmax_al/src/mmf_adaptation/xarecorditfadaptationmmf.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/mmf_adaptation/xarecorditfadaptationmmf.c	Fri May 14 16:22:35 2010 +0300
@@ -19,19 +19,20 @@
 #include "xarecorditfadaptationmmf.h"
 #include "cmmfbackendengine.h"
 #include "xaadaptationmmf.h"
+#include "xaadptbasectx.h"
 
 /*
- * XAresult XARecordItfAdaptMMF_SetRecordState(XAAdaptationBaseMMFCtx *ctx, XAuint32 state)
+ * XAresult XARecordItfAdaptMMF_SetRecordState(XAAdaptationMMFCtx *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 XARecordItfAdaptMMF_SetRecordState(XAAdaptationMMFCtx *bCtx, XAuint32 state)
 {
     XAresult ret = XA_RESULT_SUCCESS;
     int mmfretCode;
-    XAAdaptEventMMF stalledevent = {XA_RECORDITFEVENTS, XA_RECORDEVENT_HEADSTALLED, 0, NULL};
+    XAAdaptEvent stalledevent = {XA_RECORDITFEVENTS, XA_RECORDEVENT_HEADSTALLED, 0, NULL};
     XAMediaRecorderAdaptationMMFCtx* mCtx = NULL;
     DEBUG_API_A1("->XARecordItfAdaptMMF_SetRecordState %s",RECORDSTATENAME(state));
     if(!bCtx)
@@ -65,7 +66,7 @@
                 }
             else
                 {
-                XAAdaptationBaseMMF_SendAdaptEvents(bCtx, &stalledevent );
+                XAAdaptationBase_SendAdaptEvents(&bCtx->baseObj, &stalledevent );
                 }
             break;
         }
@@ -98,7 +99,7 @@
  * XAresult XARecordItfAdapt_GetRecordState(XAAdaptationBaseCtx *bCtx, XAuint32 *state)
  * Description: Return record state
  */
-XAresult XARecordItfAdaptMMF_GetRecordState(XAAdaptationBaseMMFCtx *bCtx, XAuint32 *state)
+XAresult XARecordItfAdaptMMF_GetRecordState(XAAdaptationMMFCtx *bCtx, XAuint32 *state)
 {
     XAMediaRecorderAdaptationMMFCtx* mCtx = NULL;
     DEBUG_API("->XARecordItfAdaptMMF_GetRecordState");
@@ -124,7 +125,7 @@
  * XAmillisecond *pMsec - Pointer where to store current position in stream.
  * @return XAresult ret - Success value
  */
-XAresult XARecordItfAdaptMMF_GetPosition(XAAdaptationBaseMMFCtx *bCtx, XAmillisecond *pMsec)
+XAresult XARecordItfAdaptMMF_GetPosition(XAAdaptationMMFCtx *bCtx, XAmillisecond *pMsec)
 {
     XAresult ret = XA_RESULT_SUCCESS;
     XAuint64 position;
@@ -155,9 +156,9 @@
  */
 gboolean XARecordItfAdaptMMF_PositionUpdate(gpointer ctx, XAuint64 position)
 {
-    XAAdaptationBaseMMFCtx *bCtx = (XAAdaptationBaseMMFCtx*) ctx;
+    XAAdaptationMMFCtx *bCtx = (XAAdaptationMMFCtx*) ctx;
     XAMediaRecorderAdaptationMMFCtx* mCtx = (XAMediaRecorderAdaptationMMFCtx*) ctx;
-    XAAdaptEventMMF event = {XA_RECORDITFEVENTS, XA_ADAPT_POSITION_UPDATE_EVT, 1, NULL};
+    XAAdaptEvent event = {XA_RECORDITFEVENTS, XA_ADAPT_POSITION_UPDATE_EVT, 1, NULL};
     DEBUG_API("->XARecordItfAdapt_PositionUpdate");
 
     if( mCtx && mCtx->trackpositionenabled )
@@ -167,7 +168,7 @@
             XARecordItfAdaptMMF_GetPosition(bCtx , &posInMsec);
             event.data = &posInMsec;
             DEBUG_API_A1("XARecordItfAdapt_PositionUpdate: pos %lu ms", posInMsec);
-            XAAdaptationBaseMMF_SendAdaptEvents(bCtx, &event );
+            XAAdaptationBase_SendAdaptEvents(&bCtx->baseObj, &event );
         }
     DEBUG_API_A1("<-XARecordItfAdapt_PositionUpdate: %d", mCtx->runpositiontimer);
     return( mCtx->runpositiontimer );
@@ -180,12 +181,12 @@
  * XAresult XARecordItfAdapt_EnablePositionTracking
  * Enable/disable periodic position tracking callbacks
  */
-XAresult XARecordItfAdaptMMF_EnablePositionTracking(XAAdaptationBaseMMFCtx *bCtx, XAboolean enable)
+XAresult XARecordItfAdaptMMF_EnablePositionTracking(XAAdaptationMMFCtx *bCtx, XAboolean enable)
 {
     XAMediaRecorderAdaptationMMFCtx* mCtx = (XAMediaRecorderAdaptationMMFCtx*) bCtx;
     DEBUG_API_A1("->XARecordItfAdapt_EnablePositionTracking (enable: %lu)", enable);
 
-    if(!bCtx || bCtx->ctxId != XAMediaRecorderAdaptationMMF)
+    if(!bCtx || bCtx->baseObj.ctxId != XAMediaRecorderAdaptation)
     {
         DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
         DEBUG_API("<-XARecordItfAdapt_EnablePositionTracking");
@@ -214,12 +215,12 @@
     return XA_RESULT_SUCCESS;
 }
 
-XAresult XARecordItfAdaptMMF_SetPositionUpdatePeriod(XAAdaptationBaseMMFCtx *bCtx, XAmillisecond pMsec)
+XAresult XARecordItfAdaptMMF_SetPositionUpdatePeriod(XAAdaptationMMFCtx *bCtx, XAmillisecond pMsec)
     {
     XAMediaRecorderAdaptationMMFCtx* mCtx = (XAMediaRecorderAdaptationMMFCtx*) bCtx;
     DEBUG_API_A1("->XARecordItfAdaptMMF_SetPositionUpdatePeriod (pMsec: %lu)", pMsec);
 
-    if(!bCtx || bCtx->ctxId != XAMediaRecorderAdaptationMMF)
+    if(!bCtx || bCtx->baseObj.ctxId != XAMediaRecorderAdaptation)
         {
             DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
             DEBUG_API("<-XARecordItfAdapt_EnablePositionTracking");
--- a/khronosfws/openmax_al/src/mmf_adaptation/xarecorditfadaptationmmf.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/mmf_adaptation/xarecorditfadaptationmmf.h	Fri May 14 16:22:35 2010 +0300
@@ -18,7 +18,7 @@
 #ifndef XARECORDITFADAPTATIONMMF_H
 #define XARECORDITFADAPTATIONMMF_H
 
-#include "xaadaptationcontextbasemmf.h"
+#include "xaadaptationmmf.h"
 #include "xadebug.h"
 #include <glib.h>
 
@@ -40,10 +40,10 @@
 
 /* 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);
+XAresult XARecordItfAdaptMMF_SetRecordState(XAAdaptationMMFCtx *ctx, XAuint32 state );
+XAresult XARecordItfAdaptMMF_GetPosition( XAAdaptationMMFCtx *ctx, XAmillisecond *pMsec );
+XAresult XARecordItfAdaptMMF_GetRecordState(XAAdaptationMMFCtx *bCtx, XAuint32 *state);
+XAresult XARecordItfAdaptMMF_EnablePositionTracking(XAAdaptationMMFCtx *ctx, XAboolean enable);
+XAresult XARecordItfAdaptMMF_SetPositionUpdatePeriod(XAAdaptationMMFCtx *ctx, XAmillisecond pMsec);
 
 #endif /* XARECORDITFADAPTATIONMMF_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mmf_adaptation/xaseekitfadaptationmmf.c	Fri May 14 16:22:35 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:
+*
+*/
+
+#include "unistd.h"
+#include "xamediaplayeradaptctxmmf.h"
+#include "xaseekitfadaptationmmf.h"
+#include "cmmfbackendengine.h"
+#include <glib.h>
+
+/*
+ * XAresult XAPlayItfAdaptMMF_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 XASeekItfAdaptMMF_SetPosition(XAAdaptationBaseCtx *bCtx, XAmillisecond pos, XAuint32 seekMode)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAMediaPlayerAdaptationMMFCtx* mCtx = (XAMediaPlayerAdaptationMMFCtx*) bCtx;
+
+    DEBUG_API("->XASeekItfAdaptMMF_SetPosition ");
+    ret = mmf_seekitf_set_position(mCtx->mmfContext, pos);
+    /* bCtx and parameter pointer validation happens in the calling function.
+     * We don't need to repeat it here*/
+
+    DEBUG_API("<-XASeekItfAdaptMMF_SetPosition");
+    return ret;
+}
+
+XAresult XASeekItfAdaptMMF_SetLoop(XAAdaptationBaseCtx *bCtx, XAboolean loopEnable,
+                                    XAmillisecond startPos, XAmillisecond endPos)
+    {
+        XAresult ret = XA_RESULT_SUCCESS;
+        XAMediaPlayerAdaptationMMFCtx* mCtx = (XAMediaPlayerAdaptationMMFCtx*) bCtx;
+
+        DEBUG_API("->XASeekItfAdaptMMF_SetLoop ");
+
+        /* bCtx and parameter pointer validation happens in the calling function.
+         * We don't need to repeat it here*/
+        ret = mmf_seekitf_set_repeats(mCtx->mmfContext, loopEnable);
+        
+        ret = mmf_seekitf_set_playwindow(mCtx->mmfContext, startPos, endPos);
+        
+        
+        
+        DEBUG_API("<-XASeekItfAdaptMMF_SetLoop");
+        return ret;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mmf_adaptation/xaseekitfadaptationmmf.h	Fri May 14 16:22:35 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 XASEEKITFADAPTATIONMMF_H
+#define XASEEKITFADAPTATIONMMF_H
+
+#include "xaadaptationmmf.h"
+
+
+/* FUNCTIONS */
+
+XAresult XASeekItfAdaptMMF_SetPosition(XAAdaptationBaseCtx *bCtx, XAmillisecond pos, XAuint32 seekMode);
+XAresult XASeekItfAdaptMMF_SetLoop(XAAdaptationBaseCtx *bCtx, XAboolean loopEnable,
+                                    XAmillisecond startPos, XAmillisecond endPos);
+
+#endif /* XASEEKITFADAPTATIONMMF_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mmf_adaptation/xastreaminformationitfadaptationmmf.c	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,452 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "xadebug.h"
+#include "xathreadsafety.h"
+#include "xamediaplayeradaptctxmmf.h"
+#include "xastreaminformationitfadaptationmmf.h"
+#include "xaplayitfadaptationmmf.h"
+#include "cmmfbackendengine.h"
+/*
+ * XAStreamInformationItfAdaptMMF_QueryMediaContainerInformation(
+ *   XAAdaptationBaseCtx *adaptCtx,
+ *   XAMediaContainerInformation *info);
+ * Description: Obtains media container information
+ */
+XAresult  XAStreamInformationItfAdaptMMF_QueryMediaContainerInformation(
+    XAAdaptationBaseCtx *adaptCtx,
+    XAuint32 *containerType,
+    XAmillisecond *mediaDuration,
+    XAuint32 *numStreams)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XADataSource *xaDataSource = NULL;
+
+    DEBUG_API("->XAStreamInformationItfAdaptMMF_QueryMediaContainerInformation");
+    /* Both Media Player and Metadata Extractor objec uses the same ctxId */
+    if( !adaptCtx ||
+        (adaptCtx->ctxId != XAMediaPlayerAdaptation) )
+/*        !((adaptCtx->ctxId == XAMediaPlayerAdaptation) ||
+         (adaptCtx->ctxId == XAMDAdaptation) ) )
+*/
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("-<XAStreamInformationItfAdaptMMF_QueryMediaContainerInformation");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* Initialize to unspecified */
+    *containerType = XA_CONTAINERTYPE_UNSPECIFIED;
+    xaDataSource = ((XAMediaPlayerAdaptationMMFCtx*) adaptCtx)->xaSource;
+/*    DEBUG_INFO("Obtained handle to xaDataSource");*/
+    if ( xaDataSource &&
+         xaDataSource->pFormat &&
+         ( (*(XAuint32*)xaDataSource->pFormat ) == XA_DATAFORMAT_MIME) )
+    {
+        *containerType = ((XADataFormat_MIME*)(xaDataSource->pFormat))->containerType;
+        DEBUG_INFO_A1("Container type obtained from xaDataSource->pFormat is [%u]", (unsigned int)(*containerType));
+    }
+    else
+    {
+        DEBUG_INFO("Container type unspecified");
+    }
+
+    /* Get media duration */
+    ret = XAPlayItfAdaptMMF_GetDuration(adaptCtx, mediaDuration);
+    if ( ret != XA_RESULT_SUCCESS )
+        return ret;
+
+    ret = mmf_streaminformationitf_get_numstreams(((XAMediaPlayerAdaptationMMFCtx*)adaptCtx)->mmfContext,
+                                                    numStreams);
+
+    DEBUG_API("-<XAStreamInformationItfAdaptMMF_QueryMediaContainerInformation");
+    return ret;
+}
+
+/*
+ * XAresult XAStreamInformationItfAdaptMMF_QueryStreamType(
+ *               XAAdaptationBaseCtx *adaptCtx,
+ *               XAuint32 streamIndex,
+ *               XAuint32 *domain)
+ * Description: Obtains stream type information
+ */
+XAresult XAStreamInformationItfAdaptMMF_QueryStreamType(
+                XAAdaptationBaseCtx *adaptCtx,
+                XAuint32 streamIndex,
+                XAuint32 *domain)
+{
+    XAresult ret;
+    XAuint32 numStreams;
+    XADataSource *xaDataSource = NULL;
+
+
+    DEBUG_API("->XAStreamInformationItfAdaptMMF_QueryStreamType");
+
+    ret = mmf_streaminformationitf_get_numstreams(((XAMediaPlayerAdaptationMMFCtx*)adaptCtx)->mmfContext,
+                                                    &numStreams);
+    if (ret != XA_RESULT_SUCCESS)
+    {
+        DEBUG_ERR_A1("XA_RESULT_[0x%x]", (unsigned int)ret);
+        DEBUG_API("-<XAStreamInformationItfAdaptMMF_QueryStreamType");
+        return ret;
+    }
+
+    /* validate stream index */
+    if ( streamIndex > numStreams )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("-<XAStreamInformationItfAdaptMMF_QueryStreamType");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* if format type is raw image */
+    xaDataSource = ((XAMediaPlayerAdaptationMMFCtx*) adaptCtx)->xaSource;
+    if( xaDataSource->pFormat &&
+      ( (*(XAuint32*)xaDataSource->pFormat ) == XA_DATAFORMAT_RAWIMAGE) )
+    {
+        *domain = XA_DOMAINTYPE_IMAGE;
+        return XA_RESULT_SUCCESS;
+    }
+    else
+    {
+    ret = mmf_streaminformationitf_get_streaminfo(((XAMediaPlayerAdaptationMMFCtx*)adaptCtx)->mmfContext,
+                                                    streamIndex,domain);
+    }
+
+    DEBUG_API("-<XAStreamInformationItfAdaptMMF_QueryStreamType");
+    return ret;
+}
+
+/*
+ * XAresult XAStreamInformationItfAdaptMMF_QueryStreamInformation(
+ *               XAAdaptationBaseCtx *adaptCtx,
+ *               XAuint32 streamIndex,
+ *               void * info)
+ * Description: Obtains stream information
+ */
+XAresult XAStreamInformationItfAdaptMMF_QueryStreamInformation(
+                XAAdaptationBaseCtx *adaptCtx,
+                XAuint32 streamIndex,
+                void * info)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAuint32 domain;
+    XAuint32 codecId;
+    XAuint32 channels;
+    XAmilliHertz sampleRate;
+    XAuint32 bitRate;
+    XAmillisecond duration;
+    XAuint32 width;
+    XAuint32 height;
+    XAuint32 frameRate;
+    void* mmfctx;
+    
+    mmfctx = ((XAMediaPlayerAdaptationMMFCtx*)adaptCtx)->mmfContext;
+/*    GstElement *codecbin = NULL;*/
+
+    DEBUG_API("->XAStreamInformationItfAdaptMMF_QueryStreamInformation");
+
+    /* stream index is validated in XAStreamInformationItfAdaptMMF_QueryStreamType */
+    ret = XAStreamInformationItfAdaptMMF_QueryStreamType(
+            adaptCtx, streamIndex, &domain);
+
+    if (ret != XA_RESULT_SUCCESS)
+    {
+        DEBUG_ERR_A1("XA_RESULT_[0x%x]", (unsigned int)ret);
+        DEBUG_API("-<XAStreamInformationItfAdaptMMF_QueryStreamInformation");
+        return ret;
+    }
+    if ( domain == XA_DOMAINTYPE_UNKNOWN )
+    {
+        DEBUG_ERR("XA_RESULT_CONTENT_UNSUPPORTED");
+        DEBUG_API("-<XAStreamInformationItfAdaptMMF_QueryStreamInformation");
+        return XA_RESULT_CONTENT_UNSUPPORTED;
+    }
+
+    switch(domain)
+    {
+        case XA_DOMAINTYPE_AUDIO:
+            DEBUG_INFO("Getting Audio Stream Info from Backend Engine");
+            ret = mmf_get_channels(mmfctx, &channels);
+            ret = mmf_get_samplerate(mmfctx, &sampleRate);
+            ret = mmf_get_bitrate(mmfctx, &bitRate);
+            ret = mmf_get_codec_id(mmfctx, &codecId);
+            break;
+        case XA_DOMAINTYPE_VIDEO:
+            DEBUG_INFO("Getting Video Stream Info from Backend Engine");
+            ret = mmf_get_bitrate(mmfctx, &bitRate);
+            ret = mmf_get_codec_id(mmfctx, &codecId);   
+            ret = mmf_streaminformationitf_get_videoframesize(mmfctx, &height, &width, &frameRate);
+            break;
+        case XA_DOMAINTYPE_IMAGE:
+            DEBUG_INFO("Getting Image Stream Info from SrcPad");
+            break;
+        default:
+            break;
+    };
+
+
+    if ( ret == XA_RESULT_SUCCESS)
+    {
+        DEBUG_INFO("Getting media duration");
+        ret = XAPlayItfAdaptMMF_GetDuration(adaptCtx, &duration);
+    }
+
+    /* Now assign properties to data structure */
+    if ( ret == XA_RESULT_SUCCESS)
+    {
+        switch(domain)
+        {
+            case XA_DOMAINTYPE_AUDIO:
+            {
+                XAAudioStreamInformation* streamInfo = (XAAudioStreamInformation*)info;
+                DEBUG_INFO("Assigning values for XAAudioStreamInformation");
+                streamInfo->codecId = codecId;
+                streamInfo->channels = channels;
+                streamInfo->sampleRate = sampleRate;
+                streamInfo->bitRate = bitRate;
+                streamInfo->langCountry[0] = '\0';
+                streamInfo->duration = duration;
+            }
+                break;
+            case XA_DOMAINTYPE_MIDI:
+            {
+                XAMIDIStreamInformation* streamInfo = (XAMIDIStreamInformation*)info;
+                DEBUG_INFO("Assigning values for XAMIDIStreamInformation");
+                /*currently there is no way to get these information from gstreamer*/
+                streamInfo->channels = XA_MIDI_UNKNOWN;
+                streamInfo->tracks = XA_MIDI_UNKNOWN;
+                streamInfo->bankType = XA_MIDIBANK_DEVICE;
+                /*streamInfo->bitRate = 0;*/
+                streamInfo->langCountry[0] = '\0';
+                streamInfo->duration = duration;
+            }
+                break;
+            case XA_DOMAINTYPE_VIDEO:
+            {
+                XAVideoStreamInformation* streamInfo = (XAVideoStreamInformation*)info;
+                DEBUG_INFO("Assigning values for XAVideoStreamInformation");
+                streamInfo->codecId = codecId;
+                streamInfo->width = width;
+                streamInfo->height = height;
+                streamInfo->bitRate = bitRate;
+                streamInfo->duration = duration;
+                streamInfo->frameRate = frameRate;
+            }
+                break;
+            case XA_DOMAINTYPE_IMAGE:
+            {
+                XAImageStreamInformation* streamInfo = (XAImageStreamInformation*)info;
+                DEBUG_INFO("Assigning values for XAImageStreamInformation");
+                streamInfo->codecId = codecId;
+                streamInfo->width = width;
+                streamInfo->height = height;
+                streamInfo->presentationDuration = duration;
+            }
+                break;
+            default:
+                break;
+        };
+    } /*if ( ret == XA_RESULT_SUCCESS)*/
+
+    DEBUG_API("-<XAStreamInformationItfAdaptMMF_QueryStreamInformation");
+    return ret;
+}
+
+/*
+ * XAresult XAStreamInformationItfAdaptMMF_QueryStreamName(
+ *               XAAdaptationBaseCtx *adaptCtx,
+ *               XAuint32 streamIndex,
+ *               XAuint16 * pNameSize,
+ *               XAchar * pName)
+ * Description: Obtains stream name
+ */
+XAresult XAStreamInformationItfAdaptMMF_QueryStreamName(
+                XAAdaptationBaseCtx *adaptCtx,
+                XAuint32 streamIndex,
+                XAuint16 * pNameSize,
+                XAchar * pName)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAuint32 numStreams;
+
+    DEBUG_API("->XAStreamInformationItfAdaptMMF_QueryStreamName");
+    /* Both Media Player and Metadata Extractor objec uses the same ctxId */
+    if( !adaptCtx ||
+        (adaptCtx->ctxId != XAMediaPlayerAdaptation) )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("-<XAStreamInformationItfAdaptMMF_QueryStreamName");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* validate stream index */
+    ret = mmf_streaminformationitf_get_numstreams(((XAMediaPlayerAdaptationMMFCtx*)adaptCtx)->mmfContext,
+                                                    &numStreams);
+    if (ret != XA_RESULT_SUCCESS)
+    {
+        DEBUG_ERR_A1("XA_RESULT_[0x%x]", (unsigned int)ret);
+        DEBUG_API("-<XAStreamInformationItfAdaptMMF_QueryStreamName");
+        return ret;
+    }
+
+    /* validate stream index */
+    if ( streamIndex > numStreams )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("-<XAStreamInformationItfAdaptMMF_QueryStreamName");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    /* TODO there is no straight way to retreive stream name from mmf*/
+    /*XAuint16 inputNameSize = *pNameSize;*/
+    *pNameSize = 0; /* Replace this with actual size*/
+    if ( pName )
+    {
+    /* TODO copy stream name into pName taking into account inputNameSize */
+    }
+
+    DEBUG_API("-<XAStreamInformationItfAdaptMMF_QueryStreamName");
+    return ret;
+}
+
+/*
+ * XAresult XAStreamInformationItfAdaptMMF_QueryActiveStreams(
+ *               XAAdaptationBaseCtx *adaptCtx,
+ *               XAuint32 *numStreams,
+ *               XAboolean *activeStreams);
+ * Description: Obtains active stream information
+ */
+ XAresult XAStreamInformationItfAdaptMMF_QueryActiveStreams(
+                XAAdaptationBaseCtx *adaptCtx,
+                XAuint32 *numStreams,
+                XAboolean *activeStreams)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAuint32 inputNumStreams;
+
+    DEBUG_API("->XAStreamInformationItfAdaptMMF_QueryActiveStreams");
+
+    /* Both Media Player and Metadata Extractor objec uses the same ctxId */
+    if( !adaptCtx ||
+        (adaptCtx->ctxId != XAMediaPlayerAdaptation) )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("-<XAStreamInformationItfAdaptMMF_QueryActiveStreams");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if( adaptCtx->ctxId ==  XAMDAdaptation)
+    {
+        DEBUG_ERR("XA_RESULT_PRECONDITIONS_VIOLATED");
+        DEBUG_API("-<XAStreamInformationItfAdaptMMF_QueryActiveStreams");
+        return XA_RESULT_PRECONDITIONS_VIOLATED;
+    }
+
+    /* Determine number of streams */
+    ret = mmf_streaminformationitf_get_numstreams(((XAMediaPlayerAdaptationMMFCtx*)adaptCtx)->mmfContext,
+                                                    &inputNumStreams);
+    if (ret != XA_RESULT_SUCCESS)
+    {
+        DEBUG_ERR_A1("XA_RESULT_[0x%x]", (unsigned int)ret);
+        DEBUG_API("-<XAStreamInformationItfAdaptMMF_QueryActiveStreams");
+        return ret;
+    }
+
+    if ( activeStreams )
+    {
+        XAuint32 loopIndex;
+        if (*numStreams < inputNumStreams)
+        {
+            DEBUG_INFO("numStreams param value is smaller than number of streams");
+            DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+            DEBUG_API("-<XAStreamInformationItfAdaptMMF_QueryActiveStreams");
+            return XA_RESULT_PARAMETER_INVALID;
+        }
+        for (loopIndex = 0; loopIndex < inputNumStreams; loopIndex++)
+        {
+            /* TODO currently gstreamer doesn't allow multiple dynamic streams
+             * all streams are active streams */
+            activeStreams[loopIndex] = XA_BOOLEAN_TRUE;
+        }
+    }
+    else
+        {
+        *numStreams = inputNumStreams;
+        }
+
+    DEBUG_API("->XAStreamInformationItfAdaptMMF_QueryActiveStreams");
+    return XA_RESULT_SUCCESS;
+}
+
+XAresult XAStreamInformationItfAdaptMMF_SetActiveStream(
+                XAAdaptationBaseCtx *adaptCtx,
+                XAuint32 streamNum,
+                XAboolean active,
+                XAboolean commitNow)
+{
+    XAresult ret = XA_RESULT_SUCCESS;
+    XAuint32 numStreams;
+
+    DEBUG_API("->XAStreamInformationItfAdaptMMF_SetActiveStream");
+
+    /* Both Media Player and Metadata Extractor objec uses the same ctxId */
+    if( !adaptCtx ||
+        (adaptCtx->ctxId != XAMediaPlayerAdaptation) )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("-<XAStreamInformationItfAdaptMMF_SetActiveStream");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if( adaptCtx->ctxId ==  XAMDAdaptation)
+    {
+        DEBUG_ERR("XA_RESULT_PRECONDITIONS_VIOLATED");
+        DEBUG_API("-<XAStreamInformationItfAdaptMMF_SetActiveStream");
+        return XA_RESULT_PRECONDITIONS_VIOLATED;
+    }
+
+    /* Determine number of streams */
+    ret = mmf_streaminformationitf_get_numstreams(((XAMediaPlayerAdaptationMMFCtx*)adaptCtx)->mmfContext,
+                                                    &numStreams);
+    if (ret != XA_RESULT_SUCCESS)
+    {
+        DEBUG_ERR_A1("XA_RESULT_[0x%x]", (unsigned int)ret);
+        DEBUG_API("-<XAStreamInformationItfAdaptMMF_QueryActiveStreams");
+        return ret;
+    }
+
+    /* validate stream index */
+    if ( streamNum > numStreams )
+    {
+        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
+        DEBUG_API("-<XAStreamInformationItfAdaptMMF_SetActiveStream");
+        return XA_RESULT_PARAMETER_INVALID;
+    }
+
+    if(commitNow)
+        {
+        ret = mmf_streaminformationitf_set_activestream(((XAMediaPlayerAdaptationMMFCtx*)adaptCtx)->mmfContext,
+                                                            streamNum, active);
+        }
+
+    DEBUG_API("->XAStreamInformationItfAdaptMMF_SetActiveStream");
+    return ret;
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/khronosfws/openmax_al/src/mmf_adaptation/xastreaminformationitfadaptationmmf.h	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef XASTREAMINFORMATIONITFADAPTATIONMMF_H
+#define XASTREAMINFORMATIONITFADAPTATIONMMF_H
+
+#include "openmaxalwrapper.h"
+#include "xaadptbasectx.h"
+/* MACROS */
+
+/* FUNCTIONS */
+XAresult XAStreamInformationItfAdaptMMF_QueryMediaContainerInformation(
+    XAAdaptationBaseCtx *adaptCtx,
+    XAuint32 *containerType,
+    XAmillisecond *mediaDuration,
+    XAuint32 *numStreams);
+
+XAresult XAStreamInformationItfAdaptMMF_QueryStreamType(
+                XAAdaptationBaseCtx *adaptCtx,
+                XAuint32 streamIndex, 
+                XAuint32 *domain);
+
+XAresult XAStreamInformationItfAdaptMMF_QueryStreamInformation(
+                XAAdaptationBaseCtx *adaptCtx, 
+                XAuint32 streamIndex,
+                void * info);
+
+XAresult XAStreamInformationItfAdaptMMF_QueryStreamName(
+                XAAdaptationBaseCtx *adaptCtx, 
+                XAuint32 streamIndex,
+                XAuint16 * pNameSize,
+                XAchar * pName);
+
+XAresult XAStreamInformationItfAdaptMMF_QueryActiveStreams(
+                XAAdaptationBaseCtx *adaptCtx, 
+                XAuint32 *numStreams,
+                XAboolean *activeStreams);
+
+XAresult XAStreamInformationItfAdaptMMF_SetActiveStream(
+                XAAdaptationBaseCtx *adaptCtx, 
+                XAuint32 streamNum,
+                XAboolean active, 
+                XAboolean commitNow);
+
+#endif /* XASTREAMINFORMATIONITFADAPTATION_H */
--- a/khronosfws/openmax_al/src/outputmix/xaoutputmix.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/outputmix/xaoutputmix.c	Fri May 14 16:22:35 2010 +0300
@@ -27,6 +27,8 @@
 #include "xavolumeitf.h"
 #include "xaoutputmixitf.h"
 #include "xathreadsafety.h"
+#include "xaoutputmixadaptctx.h"
+#include "xacapabilitiesmgr.h"
 
 /* Static mapping of enumeration XAOMixInterfaces to interface iids */
 static const XAInterfaceID* xaOMixItfIIDs[OMIX_ITFCOUNT]={
@@ -50,7 +52,9 @@
  *                                   const XAboolean *pInterfaceRequired)
  * Description: Create object
  */
-XAresult XAOMixImpl_CreateOutputMix(XAObjectItf *pMix,
+XAresult XAOMixImpl_CreateOutputMix(FrameworkMap* mapper,
+                                    XACapabilities* capabilities,
+                                    XAObjectItf *pMix,
                                     XAuint32 numInterfaces,
                                     const XAInterfaceID *pInterfaceIds,
                                     const XAboolean *pInterfaceRequired)
@@ -61,6 +65,9 @@
     XAuint32 itfIdx = 0;
     DEBUG_API("->XAOMixImpl_CreateOutputMix");
     XA_IMPL_THREAD_SAFETY_ENTRY(XATSOutputMix);
+
+    
+    
     if(!pMix)
     {
         XA_IMPL_THREAD_SAFETY_EXIT(XATSOutputMix);
@@ -126,28 +133,25 @@
     }
     /* 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 */
-/*
+/*    // Create outputmix adaptation context 
+    pImpl->adaptationCtx = XAOutputMixAdapt_Create();
+ 
+     //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;
-*/
+    return XA_RESULT_SUCCESS;*/
 }
 
 /*
@@ -187,9 +191,9 @@
     }
     else
     {
-#ifdef _GSTREAMER_BACKEND_
+
         *pInterfaceId = *(xaOMixItfIIDs[index]);
-#endif
+
         DEBUG_API("<-XAOMixImpl_QuerySupportedInterfaces");
         return XA_RESULT_SUCCESS;
     }
@@ -206,12 +210,12 @@
  */
 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;
+    DEBUG_API("->XAOMixImpl_DoRealize");
     XA_IMPL_THREAD_SAFETY_ENTRY(XATSOutputMix);
 
     /* check casting from correct pointer type */
@@ -225,7 +229,7 @@
     }
 
     /* Initialize adaptation */
-    ret = XAOutputMixAdapt_PostInit( pMixImpl->adaptationCtx );
+    ret = XAOutputMixAdapt_PostInit( (XAAdaptationGstCtx*)pMixImpl->adaptationCtx );
     if( ret != XA_RESULT_SUCCESS )
     {
         XA_IMPL_THREAD_SAFETY_EXIT(XATSOutputMix);
@@ -283,7 +287,7 @@
 
     pObj->state = XA_OBJECT_STATE_REALIZED;
     XA_IMPL_THREAD_SAFETY_EXIT(XATSOutputMix);
-#endif    
+    
     DEBUG_API("<-XAOMixImpl_DoRealize");
     return XA_RESULT_SUCCESS;
 }
@@ -306,7 +310,7 @@
  */
 void XAOMixImpl_FreeResources(XAObjectItf self)
 {
-#ifdef _GSTREAMER_BACKEND_
+
     XAObjectItfImpl* pObj = (XAObjectItfImpl*)(*self);
     XAOMixImpl* pImpl = (XAOMixImpl*)(*self);
     XAuint8 itfIdx = 0;
@@ -316,7 +320,7 @@
 
     if ( pImpl->adaptationCtx != NULL )
     {
-        XAOutputMixAdapt_Destroy( pImpl->adaptationCtx );
+        XAOutputMixAdapt_Destroy( (XAAdaptationGstCtx*)pImpl->adaptationCtx );
         pImpl->adaptationCtx = NULL;
     }
 
@@ -352,12 +356,12 @@
 
     if ( pImpl->adaptationCtx != NULL )
     {
-        XAOutputMixAdapt_Destroy( pImpl->adaptationCtx );
+        XAOutputMixAdapt_Destroy( (XAAdaptationGstCtx*)pImpl->adaptationCtx );
         pImpl->adaptationCtx = NULL;
     }
 
     XA_IMPL_THREAD_SAFETY_EXIT_FOR_VOID_FUNCTIONS(XATSOutputMix);
-#endif    
+    
     DEBUG_API("<-XAOMixImpl_FreeResources");
 }
 
@@ -370,10 +374,10 @@
  */
 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)
@@ -381,9 +385,9 @@
         switch( mapEntry->mapIdx )
         {
         case OMIX_EQUALIZERITF:
-#ifdef _GSTREAMER_BACKEND_
+
             mapEntry->pItf = XAEqualizerItfImpl_Create( pImpl->adaptationCtx );
-#endif
+
             break;
         default:
             DEBUG_ERR("XAOMixImpl_DoAddItf unknown id");
--- a/khronosfws/openmax_al/src/outputmix/xaoutputmix.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/outputmix/xaoutputmix.h	Fri May 14 16:22:35 2010 +0300
@@ -21,9 +21,8 @@
 #include "openmaxalwrapper.h"
 #include "xaobjectitf.h"
 #include "xaglobals.h"
-#ifdef _GSTREAMER_BACKEND_
-#include "../adaptation/XAOutputMixAdaptCtx.h"
-#endif
+#include "xaadptbasectx.h"
+
 /** MACROS **/
 
 
@@ -51,10 +50,9 @@
     /* Parent for XAMediaPlayerImpl */
     XAObjectItfImpl baseObj;
 
-#ifdef _GSTREAMER_BACKEND_
     /* variables */
     XAAdaptationBaseCtx* adaptationCtx;
-#endif
+
 } XAOMixImpl;
 
 
--- a/khronosfws/openmax_al/src/outputmix/xaoutputmixitf.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/outputmix/xaoutputmixitf.c	Fri May 14 16:22:35 2010 +0300
@@ -16,9 +16,9 @@
 */
 
 #include "xaoutputmixitf.h"
-#ifdef _GSTREAMER_BACKEND_
-#include "XAOutputMixItfAdaptation.h"
-#endif
+
+#include "xaoutputmixitfadaptation.h"
+
 #include <assert.h>
 #include "xathreadsafety.h"
 #include "e32def.h"
@@ -65,9 +65,9 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
-    ret = XAOutputMixItfAdapt_GetDestinationOutputDeviceIDs(impl->adapCtx, pNumDevices, pDeviceIDs );
-#endif
+
+    ret = XAOutputMixItfAdapt_GetDestinationOutputDeviceIDs((XAAdaptationGstCtx*)impl->adapCtx, pNumDevices, pDeviceIDs );
+
     XA_IMPL_THREAD_SAFETY_EXIT(XATSOutputMix);
     DEBUG_API_A1("<-XAOutputMixItfImpl_GetDestinationOutputDeviceIDs - pNumDevices %ld",*pNumDevices);
     return ret;
@@ -97,7 +97,7 @@
    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 );
@@ -106,7 +106,7 @@
    {   /* stop listening */
        XAAdaptationBase_RemoveEventHandler( impl->adapCtx, &XAOutputMixItfImpl_AdaptCb );
    }
-#endif
+
 
    DEBUG_API("<-XAOutputMixItfImpl_RegisterDeviceChangeCallback");
    return ret;
@@ -135,9 +135,9 @@
        return XA_RESULT_PARAMETER_INVALID;
    }
 
-#ifdef _GSTREAMER_BACKEND_
-   ret = XAOutputMixItfAdapt_ReRoute(impl->adapCtx, numOutputDevices, pOutputDeviceIDs );
-#endif
+
+   ret = XAOutputMixItfAdapt_ReRoute((XAAdaptationGstCtx*)impl->adapCtx, numOutputDevices, pOutputDeviceIDs );
+
 
    XA_IMPL_THREAD_SAFETY_EXIT(XATSOutputMix);
    DEBUG_API("<-XAOutputMixItfImpl_ReRoute");
@@ -148,7 +148,7 @@
 /**
  * XAVolumeItfImpl -specific methods
  **/
-#ifdef _GSTREAMER_BACKEND_
+
 
 /*
  * XAOutputMixItfImpl* XAOutputMixItfImpl_Create(XAAdaptationBaseCtx *adapCtx)
@@ -223,4 +223,4 @@
 
      DEBUG_API("<-XAOutputMixItfImpl_AdaptCb");
 }
-#endif
+
--- a/khronosfws/openmax_al/src/outputmix/xaoutputmixitf.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/outputmix/xaoutputmixitf.h	Fri May 14 16:22:35 2010 +0300
@@ -18,11 +18,8 @@
 #ifndef XAOUTPUTMIXITF_H_
 #define XAOUTPUTMIXITF_H_
 
-#include "openmaxalwrapper.h"
-#include "xaglobals.h"
-#ifdef _GSTREAMER_BACKEND_
-#include "XAAdaptationContextBase.h"
-#endif
+#include "xaadptbasectx.h"
+
 /** MACROS **/
 
 /** TYPES **/
@@ -40,10 +37,9 @@
 
     /* Variables */
 
-#ifdef _GSTREAMER_BACKEND_
     /*Adaptation variables*/
     XAAdaptationBaseCtx *adapCtx;
-#endif
+
     XAuint32 eventFlags;
     xaMixDeviceChangeCallback callback;
     void    *cbContext;
@@ -58,11 +54,11 @@
 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_ */
--- a/khronosfws/openmax_al/src/radio/xaradiodevice.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/radio/xaradiodevice.c	Fri May 14 16:22:35 2010 +0300
@@ -24,7 +24,7 @@
 #include "xadynintmgmtitf.h"
 #include "xardsitf.h"
 #include "xathreadsafety.h"
-
+#include "xaradioadaptctx.h"
 /* Static mapping of enumeration XARadioDeviceInterfaces to interface iids */
 static const XAInterfaceID* XARadioDeviceItfIIDs[RADIO_ITFCOUNT]=
 {
@@ -42,7 +42,8 @@
 /* XAResult XARadioDeviceImpl_Create
  * Description: Create object
  */
-XAresult XARadioDeviceImpl_CreateRadioDevice(XAObjectItf* pDevice,
+XAresult XARadioDeviceImpl_CreateRadioDevice(FrameworkMap* mapper,
+                                             XAObjectItf* pDevice,
                                              XAuint32 numInterfaces,
                                              const XAInterfaceID * pInterfaceIds,
                                              const XAboolean * pInterfaceRequired)
@@ -53,6 +54,7 @@
 
     DEBUG_API("->XARadioDeviceImpl_Create");
     XA_IMPL_THREAD_SAFETY_ENTRY(XATSRadio);
+   
     if( !pDevice )
     {
         XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
@@ -118,23 +120,21 @@
             }
         }
     }
-#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*/
     /*************************************************/
+    DEBUG_ERR("Required interface not found - abort 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;  
     /*************************************************/
     
-    
-    /* Set ObjectItf to point to newly created object */
-/*    *pDevice = (XAObjectItf)&(pBaseObj->self);
+/*    // Initialize XARadioDeviceImpl variables 
+    pImpl->adaptationCtx = XARadioAdapt_Create();
+
+     //Set ObjectItf to point to newly created object 
+    *pDevice = (XAObjectItf)&(pBaseObj->self);
 
     XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
     DEBUG_API("<-XARadioDeviceImpl_Create");
@@ -215,9 +215,9 @@
         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);
@@ -235,9 +235,9 @@
             switch( itfIdx )
             {
                 case RADIO_RADIOITF:
-#ifdef _GSTREAMER_BACKEND_
+
                     pItf = XARadioItfImpl_Create( pObjImpl->adaptationCtx );
-#endif
+
                     break;
                 case RADIO_CONFIGEXTENSIONITF:
                     pItf = XAConfigExtensionsItfImpl_Create();
@@ -246,9 +246,9 @@
                     pItf = XADIMItfImpl_Create();
                     break;
                 case RADIO_RDSITF:
-#ifdef _GSTREAMER_BACKEND_
+
                    pItf = XARDSItfImpl_Create( pObjImpl->adaptationCtx );
-#endif
+
                    break;
                 default:
                     break;
@@ -291,14 +291,14 @@
 void XARadioDeviceImpl_FreeResources(XAObjectItf self)
 {
     XAObjectItfImpl* pObj = (XAObjectItfImpl*)(*self);
-    
+    XARadioDeviceImpl* pImpl = (XARadioDeviceImpl*)(*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++)
@@ -327,13 +327,13 @@
         }
     }
 
-#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;
--- a/khronosfws/openmax_al/src/radio/xaradiodevice.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/radio/xaradiodevice.h	Fri May 14 16:22:35 2010 +0300
@@ -21,9 +21,8 @@
 #include "openmaxalwrapper.h"
 #include "xaobjectitf.h"
 #include "xaglobals.h"
-#ifdef _GSTREAMER_BACKEND_
-#include "../adaptation/XARadioAdaptCtx.h"
-#endif
+
+#include "xaadptbasectx.h"
 /** MACROS **/
 
 
@@ -51,9 +50,7 @@
 
     /* variables */
 
-#ifdef _GSTREAMER_BACKEND_
     XAAdaptationBaseCtx* adaptationCtx;
-#endif
 } XARadioDeviceImpl;
 
 
--- a/khronosfws/openmax_al/src/radio/xaradioitf.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/radio/xaradioitf.c	Fri May 14 16:22:35 2010 +0300
@@ -20,9 +20,9 @@
 #include <assert.h>
 #include <string.h>
 #include "xaradioitf.h"
-#ifdef _GSTREAMER_BACKEND_
-#include "XARadioItfAdaptation.h"
-#endif
+
+#include "xaradioitfadaptation.h"
+
 #include "xathreadsafety.h"
 
 /**
@@ -54,9 +54,9 @@
 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");
@@ -72,14 +72,14 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
-    ret = XARadioItfAdapt_IsFreqRangeSupported(impl->adapCtx, range, &isSupported);
+
+    ret = XARadioItfAdapt_IsFreqRangeSupported((XAAdaptationGstCtx*)impl->adapCtx, range, &isSupported);
 
     if ( ret == XA_RESULT_SUCCESS && isSupported == XA_BOOLEAN_TRUE )
     {
-        ret = XARadioItfAdapt_SetFreqRange(impl->adapCtx, range);
+        ret = XARadioItfAdapt_SetFreqRange((XAAdaptationGstCtx*)impl->adapCtx, range);
     }
-#endif
+
     
     XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
     DEBUG_API("<-XARadioItfImpl_SetFreqRange");
@@ -106,9 +106,9 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
-    ret = XARadioItfAdapt_GetFreqRange( impl->adapCtx, pRange);
-#endif
+
+    ret = XARadioItfAdapt_GetFreqRange( (XAAdaptationGstCtx*)impl->adapCtx, pRange);
+
     XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
     DEBUG_API("<-XARadioItfImpl_GetFreqRange");
     return ret;
@@ -138,9 +138,9 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
-    ret = XARadioItfAdapt_IsFreqRangeSupported( impl->adapCtx, range, pSupported );
-#endif
+
+    ret = XARadioItfAdapt_IsFreqRangeSupported( (XAAdaptationGstCtx*)impl->adapCtx, range, pSupported );
+
     XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
     DEBUG_API("<-XARadioItfImpl_IsFreqRangeSupported");
     return ret;
@@ -176,9 +176,9 @@
         DEBUG_API("<-XARadioItfImpl_GetFreqRangeProperties");
         return XA_RESULT_PARAMETER_INVALID;
     }
-#ifdef _GSTREAMER_BACKEND_
-    ret = XARadioItfAdapt_IsFreqRangeSupported( impl->adapCtx, range, &isSupported );
-#endif
+
+    ret = XARadioItfAdapt_IsFreqRangeSupported( (XAAdaptationGstCtx*)impl->adapCtx, range, &isSupported );
+
     if (isSupported != XA_BOOLEAN_TRUE || ret != XA_RESULT_SUCCESS)
     {
         XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
@@ -188,10 +188,10 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
-    ret = XARadioItfAdapt_GetFreqRangeProperties( impl->adapCtx,
+
+    ret = XARadioItfAdapt_GetFreqRangeProperties( (XAAdaptationGstCtx*)impl->adapCtx,
             range, pMinFreq, pMaxFreq, pFreqInterval );
-#endif
+
     XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
     DEBUG_API("<-XARadioItfImpl_GetFreqRangeProperties");
     return ret;
@@ -220,9 +220,9 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
-    ret = XARadioItfAdapt_SetFrequency( impl->adapCtx, freq );
-#endif
+
+    ret = XARadioItfAdapt_SetFrequency( (XAAdaptationGstCtx*)impl->adapCtx, freq );
+
     XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
     DEBUG_API("<-XARadioItfImpl_SetFrequency");
     return ret;
@@ -251,9 +251,9 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
-    ret = XARadioItfAdapt_CancelSetFrequency( impl->adapCtx );
-#endif
+
+    ret = XARadioItfAdapt_CancelSetFrequency( (XAAdaptationGstCtx*)impl->adapCtx );
+
     XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
     DEBUG_API("<-XARadioItfImpl_CancelSetFrequency");
     return ret;
@@ -279,9 +279,9 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
-    ret = XARadioItfAdapt_GetFrequency( impl->adapCtx, pFreq);
-#endif
+
+    ret = XARadioItfAdapt_GetFrequency( (XAAdaptationGstCtx*)impl->adapCtx, pFreq);
+
     XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
     DEBUG_API("<-XARadioItfImpl_GetFrequency");
     return ret;
@@ -309,9 +309,9 @@
 
     if (impl->squelch != squelch)
     {
-#ifdef _GSTREAMER_BACKEND_
-        ret = XARadioItfAdapt_SetSquelch( impl->adapCtx, squelch );
-#endif
+
+        ret = XARadioItfAdapt_SetSquelch( (XAAdaptationGstCtx*)impl->adapCtx, squelch );
+
         if ( ret == XA_RESULT_SUCCESS )
         {
             impl->squelch = squelch;
@@ -368,9 +368,9 @@
 
     if ( impl->stereoMode != mode)
     {
-#ifdef _GSTREAMER_BACKEND_
-        ret = XARadioItfAdapt_SetStereoMode( impl->adapCtx, mode );
-#endif
+
+        ret = XARadioItfAdapt_SetStereoMode( (XAAdaptationGstCtx*)impl->adapCtx, mode );
+
         if ( ret == XA_RESULT_SUCCESS )
         {
             impl->stereoMode = mode;
@@ -426,9 +426,9 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
-    ret = XARadioItfAdapt_GetSignalStrength( impl->adapCtx, pStrength );
-#endif
+
+    ret = XARadioItfAdapt_GetSignalStrength( (XAAdaptationGstCtx*)impl->adapCtx, pStrength );
+
     XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
     DEBUG_API("<-XARadioItfImpl_GetSignalStrength");
     return ret;
@@ -458,9 +458,9 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
-    ret = XARadioItfAdapt_Seek( impl->adapCtx, upwards );
-#endif
+
+    ret = XARadioItfAdapt_Seek( (XAAdaptationGstCtx*)impl->adapCtx, upwards );
+
     XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
     DEBUG_API("<-XARadioItfImpl_Seek");
     return ret;
@@ -488,9 +488,9 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
-    ret = XARadioItfAdapt_StopSeeking( impl->adapCtx );
-#endif
+
+    ret = XARadioItfAdapt_StopSeeking( (XAAdaptationGstCtx*)impl->adapCtx );
+
     XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
     DEBUG_API("<-XARadioItfImpl_StopSeeking");
     return ret;
@@ -579,7 +579,7 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
+
     
     free(impl->presets[preset].name);
 
@@ -588,7 +588,7 @@
     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;
 }
@@ -633,7 +633,7 @@
             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;
@@ -646,7 +646,7 @@
         {
             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;
@@ -688,7 +688,6 @@
 /**
  * XARadioItfImpl -specific methods
  **/
-#ifdef _GSTREAMER_BACKEND_
 
 /**
  * XARadioItfImplImpl* XARadioItfImpl_Create()
@@ -756,18 +755,18 @@
     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)
 {
-    
+    XAuint16 index = 0;
     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);
@@ -776,14 +775,14 @@
     {
         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
  */
@@ -821,5 +820,5 @@
     }
     DEBUG_API("<-XARadioItfimpl_AdaptCb");
 }
-#endif
 
+
--- a/khronosfws/openmax_al/src/radio/xaradioitf.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/radio/xaradioitf.h	Fri May 14 16:22:35 2010 +0300
@@ -18,12 +18,9 @@
 #ifndef XARADIOITF_H
 #define XARADIOITF_H
 
-#include "openmaxalwrapper.h"
-#include "xaglobals.h"
-#ifdef _GSTREAMER_BACKEND_
-#include "XAAdaptationContextBase.h"
-#include "XARadioItfAdaptation.h"
-#endif
+#include "xaadptbasectx.h"
+#include "xaradioitfadaptation.h"
+
 /** MACROS **/
 #define RADIO_PRESET_NAME_MAX_LENGTH 20
 
@@ -57,17 +54,14 @@
     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 **/
@@ -127,12 +121,11 @@
 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 */
--- a/khronosfws/openmax_al/src/radio/xardsitf.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/radio/xardsitf.c	Fri May 14 16:22:35 2010 +0300
@@ -19,9 +19,9 @@
 #include <stdlib.h>
 #include <assert.h>
 #include "xardsitf.h"
-/*#include "XARDSItfAdaptation.h"*/
+#include "xardsitfadaptation.h"
 #include "xathreadsafety.h"
-
+#include "xaadaptationgst.h"
 /**
  * XARDSItfImpl* GetImpl(XARDSItf self)
  * Description: Validated interface pointer and cast it to implementations pointer.
@@ -62,9 +62,9 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
-    ret = XARDSItfAdapt_QueryRDSSignal(impl->adapCtx, isSignal);
-#endif
+
+    ret = XARDSItfAdapt_QueryRDSSignal((XAAdaptationGstCtx*)impl->adapCtx, isSignal);
+
     XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
     DEBUG_API("<-XARDSItfImpl_QueryRDSSignal");
     return ret;
@@ -87,9 +87,9 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
-    ret = XARDSItfAdapt_GetProgrammeServiceName(impl->adapCtx, ps);
-#endif
+
+    ret = XARDSItfAdapt_GetProgrammeServiceName((XAAdaptationGstCtx*)impl->adapCtx, ps);
+
     DEBUG_API("<-XARDSItfImpl_GetProgrammeServiceName");
     return ret;
 }
@@ -114,9 +114,9 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
-    ret = XARDSItfAdapt_GetRadioText(impl->adapCtx, rt);
-#endif
+
+    ret = XARDSItfAdapt_GetRadioText((XAAdaptationGstCtx*)impl->adapCtx, rt);
+
     XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
     DEBUG_API("<-XARDSItfImpl_GetRadioText");
     return ret;
@@ -152,10 +152,10 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
-    ret = XARDSItfAdapt_GetRadioTextPlus(impl->adapCtx, contentType, informationElement,
+
+    ret = XARDSItfAdapt_GetRadioTextPlus((XAAdaptationGstCtx*)impl->adapCtx, contentType, informationElement,
                                         descriptor, descriptorContentType);
-#endif
+
     XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
     DEBUG_API("<-XARDSItfImpl_GetRadioTextPlus");
     return ret;
@@ -182,9 +182,9 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
-    ret = XARDSItfAdapt_GetProgrammeType(impl->adapCtx, pty);
-#endif
+
+    ret = XARDSItfAdapt_GetProgrammeType((XAAdaptationGstCtx*)impl->adapCtx, pty);
+
     DEBUG_API("<-XARDSItfImpl_GetProgrammeType");
     return ret;
 }
@@ -216,9 +216,9 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
-    ret = XARDSItfAdapt_GetProgrammeTypeString(impl->adapCtx, isLengthMax16, pty);
-#endif
+
+    ret = XARDSItfAdapt_GetProgrammeTypeString((XAAdaptationGstCtx*)impl->adapCtx, isLengthMax16, pty);
+
     XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
     DEBUG_API("<-XARDSItfImpl_GetProgrammeTypeString");
     return ret;
@@ -247,9 +247,9 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
-    ret = XARDSItfAdapt_GetProgrammeIdentificationCode(impl->adapCtx, pi);
-#endif
+
+    ret = XARDSItfAdapt_GetProgrammeIdentificationCode((XAAdaptationGstCtx*)impl->adapCtx, pi);
+
     XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
     DEBUG_API("<-XARDSItfImpl_GetProgrammeIdentificationCode");
     return ret;
@@ -275,9 +275,9 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
-    ret = XARDSItfAdapt_GetClockTime(impl->adapCtx, dateAndTime);
-#endif
+
+    ret = XARDSItfAdapt_GetClockTime((XAAdaptationGstCtx*)impl->adapCtx, dateAndTime);
+
     XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
     DEBUG_API("<-XARDSItfImpl_GetClockTime");
     return ret;
@@ -303,9 +303,9 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
-    ret = XARDSItfAdapt_GetTrafficAnnouncement(impl->adapCtx, ta);
-#endif
+
+    ret = XARDSItfAdapt_GetTrafficAnnouncement((XAAdaptationGstCtx*)impl->adapCtx, ta);
+
     XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
     DEBUG_API("<-XARDSItfImpl_GetTrafficAnnouncement");
     return ret;
@@ -331,9 +331,9 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
-    ret = XARDSItfAdapt_GetTrafficProgramme(impl->adapCtx, tp);
-#endif
+
+    ret = XARDSItfAdapt_GetTrafficProgramme((XAAdaptationGstCtx*)impl->adapCtx, tp);
+
     XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
     DEBUG_API("<-XARDSItfImpl_GetTrafficProgramme");
     return ret;
@@ -368,9 +368,9 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
-    ret = XARDSItfAdapt_SeekByProgrammeType(impl->adapCtx, pty, upwards);
-#endif
+
+    ret = XARDSItfAdapt_SeekByProgrammeType((XAAdaptationGstCtx*)impl->adapCtx, pty, upwards);
+
     XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
     DEBUG_API("<-XARDSItfImpl_SeekByProgrammeType");
     return ret;
@@ -401,9 +401,9 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
-    ret = XARDSItfAdapt_SeekTrafficAnnouncement(impl->adapCtx, upwards);
-#endif
+
+    ret = XARDSItfAdapt_SeekTrafficAnnouncement((XAAdaptationGstCtx*)impl->adapCtx, upwards);
+
     XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
     DEBUG_API("<-XARDSItfImpl_SeekTrafficAnnouncement");
     return ret;
@@ -434,9 +434,9 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
-    ret = XARDSItfAdapt_SeekTrafficProgramme(impl->adapCtx, upwards);
-#endif
+
+    ret = XARDSItfAdapt_SeekTrafficProgramme((XAAdaptationGstCtx*)impl->adapCtx, upwards);
+
     XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
     DEBUG_API("<-XARDSItfImpl_SeekTrafficProgramme");
     return ret;
@@ -464,9 +464,9 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
-    ret = XARDSItfAdapt_SetAutomaticSwitching(impl->adapCtx, automatic);
-#endif
+
+    ret = XARDSItfAdapt_SetAutomaticSwitching((XAAdaptationGstCtx*)impl->adapCtx, automatic);
+
     XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
     DEBUG_API("<-XARDSItfImpl_SetAutomaticSwitching");
     return ret;
@@ -492,9 +492,9 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
-    ret = XARDSItfAdapt_GetAutomaticSwitching(impl->adapCtx, automatic);
-#endif
+
+    ret = XARDSItfAdapt_GetAutomaticSwitching((XAAdaptationGstCtx*)impl->adapCtx, automatic);
+
     XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
     DEBUG_API("<-XARDSItfImpl_GetAutomaticSwitching");
     return ret;
@@ -521,9 +521,9 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
-    ret = XARDSItfAdapt_SetAutomaticTrafficAnnouncement(impl->adapCtx, automatic);
-#endif
+
+    ret = XARDSItfAdapt_SetAutomaticTrafficAnnouncement((XAAdaptationGstCtx*)impl->adapCtx, automatic);
+
     XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
     DEBUG_API("<-XARDSItfImpl_SetAutomaticTrafficAnnouncement");
     return ret;
@@ -551,9 +551,9 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
-    ret = XARDSItfAdapt_GetAutomaticTrafficAnnouncement(impl->adapCtx, automatic);
-#endif
+
+    ret = XARDSItfAdapt_GetAutomaticTrafficAnnouncement((XAAdaptationGstCtx*)impl->adapCtx, automatic);
+
     XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
     DEBUG_API("<-XARDSItfImpl_GetAutomaticTrafficAnnouncement");
     return ret;
@@ -596,9 +596,9 @@
 
     if (callback)
     {
-#ifdef _GSTREAMER_BACKEND_
-        ret = XARDSItfAdapt_GetODAGroup(impl->adapCtx, AID);
-#endif
+
+        ret = XARDSItfAdapt_GetODAGroup((XAAdaptationGstCtx*)impl->adapCtx, AID);
+
     }
 
     XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
@@ -634,9 +634,9 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
-    ret = XARDSItfAdapt_SubscribeODAGroup(impl->adapCtx, group, useErrorCorrection);
-#endif
+
+    ret = XARDSItfAdapt_SubscribeODAGroup((XAAdaptationGstCtx*)impl->adapCtx, group, useErrorCorrection);
+
     XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
     DEBUG_API("<-XARDSItfImpl_SubscribeODAGroup");
     return ret;
@@ -666,9 +666,9 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
-    ret = XARDSItfAdapt_UnsubscribeODAGroup(impl->adapCtx, group);
-#endif
+
+    ret = XARDSItfAdapt_UnsubscribeODAGroup((XAAdaptationGstCtx*)impl->adapCtx, group);
+
     XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
     DEBUG_API("<-XARDSItfImpl_UnsubscribeODAGroup");
     return ret;
@@ -698,9 +698,9 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
-    XARDSItfAdapt_ListODAGroupSubscriptions(impl->adapCtx, pGroups, pLength);
-#endif
+
+    XARDSItfAdapt_ListODAGroupSubscriptions((XAAdaptationGstCtx*)impl->adapCtx, pGroups, pLength);
+
     XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
     DEBUG_API("<-XARDSItfImpl_ListODAGroupSubscriptions");
     return ret;
@@ -772,7 +772,7 @@
 /**
  * XARDSItfImpl -specific methods
  **/
-#ifdef _GSTREAMER_BACKEND_
+
 
 /**
  * XARDSItfImplImpl* XARDSItfImpl_Create()
@@ -859,7 +859,7 @@
     }
     DEBUG_API("<-XARDSItfImpl_AdaptCb");
 }
-#endif
+
 /**
  * void XARDSItfImpl_Free(XARDSItfImpl* self)
  * @param  XARDSItfImpl* self -
@@ -869,11 +869,11 @@
     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");
--- a/khronosfws/openmax_al/src/radio/xardsitf.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/radio/xardsitf.h	Fri May 14 16:22:35 2010 +0300
@@ -18,12 +18,7 @@
 #ifndef XARDSITF_H
 #define XARDSITF_H
 
-#include "openmaxalwrapper.h"
-#include "xaglobals.h"
-#ifdef _GSTREAMER_BACKEND_
-#include "XAAdaptationContextBase.h"
-#include "XARDSItfAdaptation.h"
-#endif
+#include "xaadptbasectx.h"
 /** MACROS **/
 /** TYPES **/
 
@@ -52,10 +47,8 @@
     void                   *odaDataContext;
     XARDSItf               odaDataCbPtrToSelf;
 
-#ifdef _GSTREAMER_BACKEND_
     /*Adaptation variables*/
     XAAdaptationBaseCtx *adapCtx;
-#endif
 } XARDSItfImpl;
 
 /** METHODS **/
@@ -126,13 +119,12 @@
 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 */
--- a/khronosfws/openmax_al/src/vibra/xavibradevice.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/vibra/xavibradevice.c	Fri May 14 16:22:35 2010 +0300
@@ -22,7 +22,7 @@
 #include "xavibraitf.h"
 #include "xaconfigextensionsitf.h"
 #include "xadynintmgmtitf.h"
-
+#include "xavibraadaptctx.h"
 
 /* Static mapping of enumeration XAVibraDeviceInterfaces to interface iids */
 static const XAInterfaceID* XAVibraDeviceItfIIDs[VIBRA_ITFCOUNT]=
@@ -41,7 +41,8 @@
  * XAresult XAVibraDeviceImpl_CreateVibraDevice
  * Description: Create object
  */
-XAresult XAVibraDeviceImpl_CreateVibraDevice(XAObjectItf* pDevice,
+XAresult XAVibraDeviceImpl_CreateVibraDevice(FrameworkMap* mapper,
+                                             XAObjectItf* pDevice,
                                              XAuint32 deviceID,
                                              XAuint32 numInterfaces,
                                              const XAInterfaceID * pInterfaceIds,
@@ -116,23 +117,22 @@
         }
     }
 
-    /* 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*/
     /*************************************************/
+    DEBUG_ERR("Required interface not found - abort creation!");
     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);
+/*    // Initialize XAVibraDeviceImpl variables 
+    pImpl->deviceID = deviceID;
+
+
+    pImpl->adaptationCtx = XAVibraAdapt_Create(pImpl->deviceID);
+
+     //Set ObjectItf to point to newly created object 
+    *pDevice = (XAObjectItf)&(pBaseObj->self);
 
     DEBUG_API("<-XAVibraDeviceImpl_Create");
     return XA_RESULT_SUCCESS;*/
@@ -205,9 +205,9 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
+
     ret = XAVibraAdapt_PostInit( pObjImpl->adaptationCtx );
-#endif
+
     if( ret != XA_RESULT_SUCCESS )
     {
         DEBUG_API("<-XAVibraDeviceImpl_DoRealize");
@@ -224,9 +224,9 @@
             switch( itfIdx )
             {
                 case VIBRA_VIBRAITF:
-#ifdef _GSTREAMER_BACKEND_
+
                     pItf = XAVibraItfImpl_Create(pObjImpl->adaptationCtx);
-#endif
+
                     break;
                 case VIBRA_CONFIGEXTENSIONITF:
                     pItf = XAConfigExtensionsItfImpl_Create();
@@ -272,18 +272,18 @@
 void XAVibraDeviceImpl_FreeResources(XAObjectItf self)
 {
     XAObjectItfImpl* pObj = (XAObjectItfImpl*) (*self);
-    
+    XAVibraDeviceImpl* pImpl = (XAVibraDeviceImpl*) (*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++)
     {
--- a/khronosfws/openmax_al/src/vibra/xavibradevice.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/vibra/xavibradevice.h	Fri May 14 16:22:35 2010 +0300
@@ -18,12 +18,8 @@
 #ifndef XAVIBRADEVICE_H
 #define XAVIBRADEVICE_H
 
-#include "openmaxalwrapper.h"
 #include "xaobjectitf.h"
-#include "xaglobals.h"
-#ifdef _GSTREAMER_BACKEND_
-#include "../adaptation/XAVibraAdaptCtx.h"
-#endif
+#include "xaadptbasectx.h"
 /** MACROS **/
 
 
@@ -51,9 +47,8 @@
     /* variables */
     XAuint32 deviceID;
 
-#ifdef _GSTREAMER_BACKEND_
     XAAdaptationBaseCtx* adaptationCtx;
-#endif
+
 } XAVibraDeviceImpl;
 
 /** METHODS **/
--- a/khronosfws/openmax_al/src/vibra/xavibraitf.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/vibra/xavibraitf.c	Fri May 14 16:22:35 2010 +0300
@@ -19,9 +19,9 @@
 #include <stdlib.h>
 #include <assert.h>
 #include "xavibraitf.h"
-#ifdef _GSTREAMER_BACKEND_
-#include "XAVibraItfAdaptation.h"
-#endif
+
+#include "xavibraitfadaptation.h"
+
 #include "xathreadsafety.h"
 /* XAVibraItfImpl* GetImpl(XAVibraItf self)
  * Description: Validate interface pointer and cast it to implementation pointer.
@@ -66,9 +66,9 @@
     /* check is vibrate mode changed */
     if( impl->vibrate != vibrate )
     {
-#ifdef _GSTREAMER_BACKEND_
-        ret = XAVibraItfAdapt_Vibrate( impl->adapCtx, vibrate );
-#endif
+
+        ret = XAVibraItfAdapt_Vibrate( (XAAdaptationGstCtx*)impl->adapCtx, vibrate );
+
         if ( ret == XA_RESULT_SUCCESS )
         {
             impl->vibrate = vibrate;
@@ -135,9 +135,9 @@
     /* check is vibration frequency changed */
     if( impl->frequency != frequency )
     {
-#ifdef _GSTREAMER_BACKEND_
-        ret = XAVibraItfAdapt_SetFrequency( impl->adapCtx, frequency );
-#endif
+
+        ret = XAVibraItfAdapt_SetFrequency( (XAAdaptationGstCtx*)impl->adapCtx, frequency );
+
         if( ret == XA_RESULT_SUCCESS )
         {
             impl->frequency = frequency;
@@ -194,9 +194,9 @@
     /* check is vibration intensity changed */
     if( impl->intensity != intensity )
     {
-#ifdef _GSTREAMER_BACKEND_
-        ret = XAVibraItfAdapt_SetIntensity( impl->adapCtx, intensity );
-#endif
+
+        ret = XAVibraItfAdapt_SetIntensity( (XAAdaptationGstCtx*)impl->adapCtx, intensity );
+
         if( ret == XA_RESULT_SUCCESS )
         {
             impl->intensity = intensity;
@@ -232,7 +232,7 @@
     return ret;
 }
 
-#ifdef _GSTREAMER_BACKEND_
+
 
 /*****************************************************************************
  * XAVibraItfImpl -specific methods
@@ -266,7 +266,7 @@
     DEBUG_API("<-XAVibraItfImpl_Create");
     return self;
 }
-#endif
+
 /* void XAVibraItfImpl_Free(XAVibraItfImpl* self)
  * Description: Free all resources reserved at XAVibraItfImpl_Create
  */
--- a/khronosfws/openmax_al/src/vibra/xavibraitf.h	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/vibra/xavibraitf.h	Fri May 14 16:22:35 2010 +0300
@@ -18,11 +18,8 @@
 #ifndef XAVIBRAITF_H
 #define XAVIBRAITF_H
 
-#include "openmaxalwrapper.h"
-#include "xaglobals.h"
-#ifdef _GSTREAMER_BACKEND_  
-#include "XAAdaptationContextBase.h"
-#endif
+#include "xaadptbasectx.h"
+
 /** MACROS **/
 #define MIN_INTENSITY 0
 #define MAX_INTENSITY 1000
@@ -47,10 +44,9 @@
     XAmilliHertz    frequency;
     XApermille      intensity;
 
-#ifdef _GSTREAMER_BACKEND_  
     /*Adaptation variables*/
     XAAdaptationBaseCtx *adapCtx;
-#endif
+
 } XAVibraItfImpl;
 
 /** METHODS **/
@@ -65,9 +61,9 @@
 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/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/AdvancedAudioController/Src/AdvancedAudioPlayController.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/AdvancedAudioController/Src/AdvancedAudioPlayController.cpp	Fri May 14 16:22:35 2010 +0300
@@ -841,17 +841,6 @@
 
     // 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()))
         {
--- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/AdvancedAudioControllerUtility/Src/MP3AudioControllerUtility.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/AdvancedAudioControllerUtility/Src/MP3AudioControllerUtility.cpp	Fri May 14 16:22:35 2010 +0300
@@ -175,6 +175,8 @@
 	TInt frameBytes = 0;
 	TInt avgFrameLen = 0;
 	TInt frames = 0;
+	TInt scaling=0;
+	TInt round=0;
 	// We could have used the bitrate found above for CBR MP3 content and not continue to average
 	// the bitrate. However, some users can manipulated the file and append other bitrate content.
 	// Since it is not too difficult, we can update the bitrate above with an averaged bitrate.
@@ -203,6 +205,12 @@
 			frames++;    	        	
 			}	
 		avgFrameLen = frameBytes / frames; // frames is always non-zero here
+		scaling = frameBytes*10/frames;
+		round = scaling%10;
+		if(round > 5)
+		    {
+		     ++avgFrameLen;
+		    }
 		}
 	iBitRate = (avgFrameLen * 8 * iSamplingRate) / iSamplesPerFrame;
 	}
--- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/aacaudioplaycontroller/Src/AACAudioPlayControllerPlugin.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/aacaudioplaycontroller/Src/AACAudioPlayControllerPlugin.cpp	Fri May 14 16:22:35 2010 +0300
@@ -111,6 +111,18 @@
 void CAACAudioPlayControllerPlugin::DoAddDataSourceL()
     {
     DP0(_L("CAACAudioPlayControllerPlugin::DoAddDataSourceL"));
+        // ou1cimx1#205863
+    if (iSourceType != KUidMmfFileSource) 
+    	{
+	    DP0(_L("CAACAudioPlayControllerPlugin::DoAddDataSourceL not file source"));        
+	    if (iSharedBufferMaxNum <= 2)
+	        {
+	        	iSharedBufferMaxNum = 3;
+	        }
+		 iSharedBufferMaxSize = iSharedBufferMaxSizeForNonSeekableSrc;
+	    DP2(_L("CAACAudioPlayControllerPlugin::DoAddDataSourceL new iSharedBufferMaxNum[%d] iSharedBufferMaxSize[%d]"), iSharedBufferMaxNum, iSharedBufferMaxSize);
+    	}
+
 	}
 
 // -----------------------------------------------------------------------------
--- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/amraudioplaycontroller/Src/AMRAudioPlayControllerPlugin.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/amraudioplaycontroller/Src/AMRAudioPlayControllerPlugin.cpp	Fri May 14 16:22:35 2010 +0300
@@ -104,6 +104,18 @@
 void CAMRAudioPlayControllerPlugin::DoAddDataSourceL()
     {
     DP0(_L("CAMRAudioPlayControllerPlugin::DoAddDataSourceL"));
+        // ou1cimx1#205863
+    if (iSourceType != KUidMmfFileSource) 
+    	{
+	    DP0(_L("CAMRAudioPlayControllerPlugin::DoAddDataSourceL not file source"));        
+	    if (iSharedBufferMaxNum <= 2)
+	        {
+	        	iSharedBufferMaxNum = 3;
+	        }
+		 iSharedBufferMaxSize = iSharedBufferMaxSizeForNonSeekableSrc;
+	    DP2(_L("CAMRAudioPlayControllerPlugin::DoAddDataSourceL new iSharedBufferMaxNum[%d] iSharedBufferMaxSize[%d]"), iSharedBufferMaxNum, iSharedBufferMaxSize);
+    	}
+
     }
 
 // -----------------------------------------------------------------------------
--- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/awbaudioplaycontroller/Src/AWBAudioPlayControllerPlugin.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/awbaudioplaycontroller/Src/AWBAudioPlayControllerPlugin.cpp	Fri May 14 16:22:35 2010 +0300
@@ -103,6 +103,18 @@
 void CAWBAudioPlayControllerPlugin::DoAddDataSourceL()
     {
 DP0(_L("CAWBAudioPlayControllerPlugin::DoAddDataSourceL"));
+    // ou1cimx1#205863
+    if (iSourceType != KUidMmfFileSource) 
+    	{
+	    DP0(_L("CAWBAudioPlayControllerPlugin::DoAddDataSourceL not file source"));        
+	    if (iSharedBufferMaxNum <= 2)
+	        {
+	        	iSharedBufferMaxNum = 3;
+	        }
+		 iSharedBufferMaxSize = iSharedBufferMaxSizeForNonSeekableSrc;
+	    DP2(_L("CAWBAudioPlayControllerPlugin::DoAddDataSourceL new iSharedBufferMaxNum[%d] iSharedBufferMaxSize[%d]"), iSharedBufferMaxNum, iSharedBufferMaxSize);
+    	}
+
     }
 
 // -----------------------------------------------------------------------------
--- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/mp3audioplaycontroller/Src/MP3AudioPlayControllerPlugin.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/mp3audioplaycontroller/Src/MP3AudioPlayControllerPlugin.cpp	Fri May 14 16:22:35 2010 +0300
@@ -102,6 +102,18 @@
 void CMP3AudioPlayControllerPlugin::DoAddDataSourceL()
     {
     DP0(_L("CMP3AudioPlayControllerPlugin::DoAddDataSourceL"));
+    // ou1cimx1#205863
+    if (iSourceType != KUidMmfFileSource) 
+    	{
+	    DP0(_L("CMP3AudioPlayControllerPlugin::DoAddDataSourceL not file source"));        
+	    if (iSharedBufferMaxNum <= 2)
+	        {
+	        	iSharedBufferMaxNum = 3;
+	        }
+		 iSharedBufferMaxSize = iSharedBufferMaxSizeForNonSeekableSrc;
+	    DP2(_L("CMP3AudioPlayControllerPlugin::DoAddDataSourceL new iSharedBufferMaxNum[%d] iSharedBufferMaxSize[%d]"), iSharedBufferMaxNum, iSharedBufferMaxSize);
+    	}
+
     }
 
 // -----------------------------------------------------------------------------
--- a/mmfenh/enhancedmediaclient/Client/EABI/EnhancedMediaClient.def	Mon May 03 12:59:52 2010 +0300
+++ b/mmfenh/enhancedmediaclient/Client/EABI/EnhancedMediaClient.def	Fri May 14 16:22:35 2010 +0300
@@ -12,92 +12,86 @@
 	_ZN10multimedia18CMultimediaFactory19DeleteStreamControlERPNS_14MStreamControlE @ 11 NONAME
 	_ZN10multimedia18CMultimediaFactoryD1Ev @ 12 NONAME
 	_ZN10multimedia18CMultimediaFactoryD2Ev @ 13 NONAME
-	_ZTIN10multimedia10CErrorCodeE @ 14 NONAME ; #<TI>#
-	_ZTIN10multimedia10CEventBaseE @ 15 NONAME ; #<TI>#
-	_ZTIN10multimedia11CSourceBaseE @ 16 NONAME ; #<TI>#
-	_ZTIN10multimedia13CVolumeEffectE @ 17 NONAME ; #<TI>#
-	_ZTIN10multimedia14CEventNotifierE @ 18 NONAME ; #<TI>#
-	_ZTIN10multimedia14CStreamControlE @ 19 NONAME ; #<TI>#
-	_ZTIN10multimedia15CEventQueueItemE @ 20 NONAME ; #<TI>#
-	_ZTIN10multimedia15CMCustomCommandE @ 21 NONAME ; #<TI>#
-	_ZTIN10multimedia16CDownloadGatewayE @ 22 NONAME ; #<TI>#
-	_ZTIN10multimedia16CObserverManagerE @ 23 NONAME ; #<TI>#
-	_ZTIN10multimedia17CClientDataBufferE @ 24 NONAME ; #<TI>#
-	_ZTIN10multimedia18CBufTypeSupEventAOE @ 25 NONAME ; #<TI>#
-	_ZTIN10multimedia18CEffectControlBaseE @ 26 NONAME ; #<TI>#
-	_ZTIN10multimedia18CStateChangedEventE @ 27 NONAME ; #<TI>#
-	_ZTIN10multimedia19CClientProgDLSourceE @ 28 NONAME ; #<TI>#
-	_ZTIN10multimedia19CMmfAudioOutputSinkE @ 29 NONAME ; #<TI>#
-	_ZTIN10multimedia20CDataBufferQueueItemE @ 30 NONAME ; #<TI>#
-	_ZTIN10multimedia22CEffectControlBaseImplE @ 31 NONAME ; #<TI>#
-	_ZTIN10multimedia22CMultimediaFactoryImplE @ 32 NONAME ; #<TI>#
-	_ZTIN10multimedia23CClientDataBufferSourceE @ 33 NONAME ; #<TI>#
-	_ZTIN10multimedia25CDataBufferProcessedEventE @ 34 NONAME ; #<TI>#
-	_ZTIN10multimedia25CMMFFindAndOpenController7CConfigE @ 35 NONAME ; #<TI>#
-	_ZTIN10multimedia8CEventAOE @ 36 NONAME ; #<TI>#
-	_ZTIN10multimedia9CSinkBaseE @ 37 NONAME ; #<TI>#
-	_ZTVN10multimedia10CErrorCodeE @ 38 NONAME ; #<VT>#
-	_ZTVN10multimedia10CEventBaseE @ 39 NONAME ; #<VT>#
-	_ZTVN10multimedia11CSourceBaseE @ 40 NONAME ; #<VT>#
-	_ZTVN10multimedia13CVolumeEffectE @ 41 NONAME ; #<VT>#
-	_ZTVN10multimedia14CEventNotifierE @ 42 NONAME ; #<VT>#
-	_ZTVN10multimedia14CStreamControlE @ 43 NONAME ; #<VT>#
-	_ZTVN10multimedia15CEventQueueItemE @ 44 NONAME ; #<VT>#
-	_ZTVN10multimedia15CMCustomCommandE @ 45 NONAME ; #<VT>#
-	_ZTVN10multimedia16CDownloadGatewayE @ 46 NONAME ; #<VT>#
-	_ZTVN10multimedia16CObserverManagerE @ 47 NONAME ; #<VT>#
-	_ZTVN10multimedia17CClientDataBufferE @ 48 NONAME ; #<VT>#
-	_ZTVN10multimedia18CBufTypeSupEventAOE @ 49 NONAME ; #<VT>#
-	_ZTVN10multimedia18CEffectControlBaseE @ 50 NONAME ; #<VT>#
-	_ZTVN10multimedia18CStateChangedEventE @ 51 NONAME ; #<VT>#
-	_ZTVN10multimedia19CClientProgDLSourceE @ 52 NONAME ; #<VT>#
-	_ZTVN10multimedia19CMmfAudioOutputSinkE @ 53 NONAME ; #<VT>#
-	_ZTVN10multimedia20CDataBufferQueueItemE @ 54 NONAME ; #<VT>#
-	_ZTVN10multimedia22CEffectControlBaseImplE @ 55 NONAME ; #<VT>#
-	_ZTVN10multimedia22CMultimediaFactoryImplE @ 56 NONAME ; #<VT>#
-	_ZTVN10multimedia23CClientDataBufferSourceE @ 57 NONAME ; #<VT>#
-	_ZTVN10multimedia25CDataBufferProcessedEventE @ 58 NONAME ; #<VT>#
-	_ZTVN10multimedia25CMMFFindAndOpenController7CConfigE @ 59 NONAME ; #<VT>#
-	_ZTVN10multimedia8CEventAOE @ 60 NONAME ; #<VT>#
-	_ZTVN10multimedia9CSinkBaseE @ 61 NONAME ; #<VT>#
-	_ZTIN10multimedia17CClientFileSourceE @ 62 NONAME ; #<TI>#
-	_ZTIN10multimedia23CClientDescriptorSourceE @ 63 NONAME ; #<TI>#
-	_ZTIN10multimedia8CAsyncAOE @ 64 NONAME ; #<TI>#
-	_ZTVN10multimedia17CClientFileSourceE @ 65 NONAME ; #<VT>#
-	_ZTVN10multimedia23CClientDescriptorSourceE @ 66 NONAME ; #<VT>#
-	_ZTVN10multimedia8CAsyncAOE @ 67 NONAME ; #<VT>#
-	_ZTI11CChildIntfc @ 68 NONAME ; #<TI>#
-	_ZTI12CParentIntfc @ 69 NONAME ; #<TI>#
-	_ZTI19CDRMConfigIntcfImpl @ 70 NONAME ; #<TI>#
-	_ZTV11CChildIntfc @ 71 NONAME ; #<VT>#
-	_ZTV12CParentIntfc @ 72 NONAME ; #<VT>#
-	_ZTV19CDRMConfigIntcfImpl @ 73 NONAME ; #<VT>#
-	_ZTIN10multimedia13CReverbEffectE @ 74 NONAME ; #<TI>#
-	_ZTIN10multimedia15CLoudnessEffectE @ 75 NONAME ; #<TI>#
-	_ZTIN10multimedia16CBassBoostEffectE @ 76 NONAME ; #<TI>#
-	_ZTIN10multimedia16CEqualizerEffectE @ 77 NONAME ; #<TI>#
-	_ZTIN10multimedia16CRoomLevelEffectE @ 78 NONAME ; #<TI>#
-	_ZTIN10multimedia20CSourceDopplerEffectE @ 79 NONAME ; #<TI>#
-	_ZTIN10multimedia21CSourceLocationEffectE @ 80 NONAME ; #<TI>#
-	_ZTIN10multimedia21CStereoWideningEffectE @ 81 NONAME ; #<TI>#
-	_ZTIN10multimedia22CListenerDopplerEffectE @ 82 NONAME ; #<TI>#
-	_ZTIN10multimedia23CListenerLocationEffectE @ 83 NONAME ; #<TI>#
-	_ZTIN10multimedia24CSourceOrientationEffectE @ 84 NONAME ; #<TI>#
-	_ZTIN10multimedia26CDistanceAttenuationEffectE @ 85 NONAME ; #<TI>#
-	_ZTIN10multimedia26CListenerOrientationEffectE @ 86 NONAME ; #<TI>#
-	_ZTVN10multimedia13CReverbEffectE @ 87 NONAME ; #<VT>#
-	_ZTVN10multimedia15CLoudnessEffectE @ 88 NONAME ; #<VT>#
-	_ZTVN10multimedia16CBassBoostEffectE @ 89 NONAME ; #<VT>#
-	_ZTVN10multimedia16CEqualizerEffectE @ 90 NONAME ; #<VT>#
-	_ZTVN10multimedia16CRoomLevelEffectE @ 91 NONAME ; #<VT>#
-	_ZTVN10multimedia20CSourceDopplerEffectE @ 92 NONAME ; #<VT>#
-	_ZTVN10multimedia21CSourceLocationEffectE @ 93 NONAME ; #<VT>#
-	_ZTVN10multimedia21CStereoWideningEffectE @ 94 NONAME ; #<VT>#
-	_ZTVN10multimedia22CListenerDopplerEffectE @ 95 NONAME ; #<VT>#
-	_ZTVN10multimedia23CListenerLocationEffectE @ 96 NONAME ; #<VT>#
-	_ZTVN10multimedia24CSourceOrientationEffectE @ 97 NONAME ; #<VT>#
-	_ZTVN10multimedia26CDistanceAttenuationEffectE @ 98 NONAME ; #<VT>#
-	_ZTVN10multimedia26CListenerOrientationEffectE @ 99 NONAME ; #<VT>#
-	_ZTIN10multimedia14CBalanceEffectE @ 100 NONAME
-	_ZTVN10multimedia14CBalanceEffectE @ 101 NONAME
+	_ZTI11CChildIntfc @ 14 NONAME
+	_ZTI12CParentIntfc @ 15 NONAME
+	_ZTI19CDRMConfigIntcfImpl @ 16 NONAME
+	_ZTIN10multimedia10CErrorCodeE @ 17 NONAME
+	_ZTIN10multimedia10CEventBaseE @ 18 NONAME
+	_ZTIN10multimedia11CSourceBaseE @ 19 NONAME
+	_ZTIN10multimedia13CReverbEffectE @ 20 NONAME
+	_ZTIN10multimedia13CVolumeEffectE @ 21 NONAME
+	_ZTIN10multimedia14CBalanceEffectE @ 22 NONAME
+	_ZTIN10multimedia14CEventNotifierE @ 23 NONAME
+	_ZTIN10multimedia14CStreamControlE @ 24 NONAME
+	_ZTIN10multimedia15CEventQueueItemE @ 25 NONAME
+	_ZTIN10multimedia15CLoudnessEffectE @ 26 NONAME
+	_ZTIN10multimedia15CMCustomCommandE @ 27 NONAME
+	_ZTIN10multimedia16CBassBoostEffectE @ 28 NONAME
+	_ZTIN10multimedia16CEqualizerEffectE @ 29 NONAME
+	_ZTIN10multimedia16CObserverManagerE @ 30 NONAME
+	_ZTIN10multimedia16CRoomLevelEffectE @ 31 NONAME
+	_ZTIN10multimedia17CClientDataBufferE @ 32 NONAME
+	_ZTIN10multimedia17CClientFileSourceE @ 33 NONAME
+	_ZTIN10multimedia18CBufTypeSupEventAOE @ 34 NONAME
+	_ZTIN10multimedia18CEffectControlBaseE @ 35 NONAME
+	_ZTIN10multimedia18CStateChangedEventE @ 36 NONAME
+	_ZTIN10multimedia19CMmfAudioOutputSinkE @ 37 NONAME
+	_ZTIN10multimedia20CDataBufferQueueItemE @ 38 NONAME
+	_ZTIN10multimedia20CSourceDopplerEffectE @ 39 NONAME
+	_ZTIN10multimedia21CSourceLocationEffectE @ 40 NONAME
+	_ZTIN10multimedia21CStereoWideningEffectE @ 41 NONAME
+	_ZTIN10multimedia22CEffectControlBaseImplE @ 42 NONAME
+	_ZTIN10multimedia22CListenerDopplerEffectE @ 43 NONAME
+	_ZTIN10multimedia22CMultimediaFactoryImplE @ 44 NONAME
+	_ZTIN10multimedia23CClientDataBufferSourceE @ 45 NONAME
+	_ZTIN10multimedia23CClientDescriptorSourceE @ 46 NONAME
+	_ZTIN10multimedia23CListenerLocationEffectE @ 47 NONAME
+	_ZTIN10multimedia24CSourceOrientationEffectE @ 48 NONAME
+	_ZTIN10multimedia25CDataBufferProcessedEventE @ 49 NONAME
+	_ZTIN10multimedia25CMMFFindAndOpenController7CConfigE @ 50 NONAME
+	_ZTIN10multimedia26CDistanceAttenuationEffectE @ 51 NONAME
+	_ZTIN10multimedia26CListenerOrientationEffectE @ 52 NONAME
+	_ZTIN10multimedia8CAsyncAOE @ 53 NONAME
+	_ZTIN10multimedia9CSinkBaseE @ 54 NONAME
+	_ZTV11CChildIntfc @ 55 NONAME
+	_ZTV12CParentIntfc @ 56 NONAME
+	_ZTV19CDRMConfigIntcfImpl @ 57 NONAME
+	_ZTVN10multimedia10CErrorCodeE @ 58 NONAME
+	_ZTVN10multimedia10CEventBaseE @ 59 NONAME
+	_ZTVN10multimedia11CSourceBaseE @ 60 NONAME
+	_ZTVN10multimedia13CReverbEffectE @ 61 NONAME
+	_ZTVN10multimedia13CVolumeEffectE @ 62 NONAME
+	_ZTVN10multimedia14CBalanceEffectE @ 63 NONAME
+	_ZTVN10multimedia14CEventNotifierE @ 64 NONAME
+	_ZTVN10multimedia14CStreamControlE @ 65 NONAME
+	_ZTVN10multimedia15CEventQueueItemE @ 66 NONAME
+	_ZTVN10multimedia15CLoudnessEffectE @ 67 NONAME
+	_ZTVN10multimedia15CMCustomCommandE @ 68 NONAME
+	_ZTVN10multimedia16CBassBoostEffectE @ 69 NONAME
+	_ZTVN10multimedia16CEqualizerEffectE @ 70 NONAME
+	_ZTVN10multimedia16CObserverManagerE @ 71 NONAME
+	_ZTVN10multimedia16CRoomLevelEffectE @ 72 NONAME
+	_ZTVN10multimedia17CClientDataBufferE @ 73 NONAME
+	_ZTVN10multimedia17CClientFileSourceE @ 74 NONAME
+	_ZTVN10multimedia18CBufTypeSupEventAOE @ 75 NONAME
+	_ZTVN10multimedia18CEffectControlBaseE @ 76 NONAME
+	_ZTVN10multimedia18CStateChangedEventE @ 77 NONAME
+	_ZTVN10multimedia19CMmfAudioOutputSinkE @ 78 NONAME
+	_ZTVN10multimedia20CDataBufferQueueItemE @ 79 NONAME
+	_ZTVN10multimedia20CSourceDopplerEffectE @ 80 NONAME
+	_ZTVN10multimedia21CSourceLocationEffectE @ 81 NONAME
+	_ZTVN10multimedia21CStereoWideningEffectE @ 82 NONAME
+	_ZTVN10multimedia22CEffectControlBaseImplE @ 83 NONAME
+	_ZTVN10multimedia22CListenerDopplerEffectE @ 84 NONAME
+	_ZTVN10multimedia22CMultimediaFactoryImplE @ 85 NONAME
+	_ZTVN10multimedia23CClientDataBufferSourceE @ 86 NONAME
+	_ZTVN10multimedia23CClientDescriptorSourceE @ 87 NONAME
+	_ZTVN10multimedia23CListenerLocationEffectE @ 88 NONAME
+	_ZTVN10multimedia24CSourceOrientationEffectE @ 89 NONAME
+	_ZTVN10multimedia25CDataBufferProcessedEventE @ 90 NONAME
+	_ZTVN10multimedia25CMMFFindAndOpenController7CConfigE @ 91 NONAME
+	_ZTVN10multimedia26CDistanceAttenuationEffectE @ 92 NONAME
+	_ZTVN10multimedia26CListenerOrientationEffectE @ 93 NONAME
+	_ZTVN10multimedia8CAsyncAOE @ 94 NONAME
+	_ZTVN10multimedia9CSinkBaseE @ 95 NONAME
 
--- a/mmfenh/enhancedmediaclient/Client/group/EnhancedMediaClient.mmp	Mon May 03 12:59:52 2010 +0300
+++ b/mmfenh/enhancedmediaclient/Client/group/EnhancedMediaClient.mmp	Fri May 14 16:22:35 2010 +0300
@@ -13,7 +13,7 @@
 *
 * Description:  Project file for EnhancedMediaClient Utility
 *
-*  Version     : %version: bh1mmcf#10.1.7 %
+*  Version     : %version: 10.1.8 %
 */
 
 
@@ -48,11 +48,6 @@
 SOURCE          DRMConfigIntfcImpl.cpp
 SOURCE          ParentChildIntfc.cpp
 
-SOURCEPATH      ../src/Components/ClientProgDLSource
-SOURCE          EventAO.cpp
-SOURCE          ClientProgDLSource.cpp
-SOURCE          DownloadGateway.cpp
-
 SOURCEPATH      ../src/Components/CMMFAudioOutputSink
 SOURCE          CMMFAudioOutputSink.cpp
 
@@ -105,7 +100,6 @@
 USERINCLUDE     ../src/Components/StreamControl
 USERINCLUDE     ../src/Components/EventNotifier
 USERINCLUDE     ../src/Components/ClientDataBufferSource
-USERINCLUDE     ../src/Components/ClientProgDLSource
 USERINCLUDE     ../src/Components/ClientFileSource
 USERINCLUDE     ../src/Components/ClientDescriptorSource
 USERINCLUDE     ../src/Components/CMMFAudioOutputSink
@@ -113,12 +107,10 @@
 USERINCLUDE     ../src/Components/SinkBase
 USERINCLUDE     ../src/Components/SourceBase
 USERINCLUDE     ../../Plugins/DataBufferSource/inc
-USERINCLUDE     ../../Plugins/ProgDLSource/inc
 USERINCLUDE     ../src/Components/EffectBase
 USERINCLUDE     ../src/Components/VolumeEffect
 USERINCLUDE		../src/Components/BalanceEffect
 USERINCLUDE     ../src/Components/AudioEffects
-USERINCLUDE     ../../Plugins/TransferRateMonitor/inc
 USERINCLUDE     ../../../../inc
 USERINCLUDE     ../../inc
 USERINCLUDE     ../../Plugins/DescriptorSource/inc
@@ -138,8 +130,6 @@
 LIBRARY         cafutils.lib
 LIBRARY         ecom.lib
 LIBRARY         StreamControlCustomCommands.lib
-LIBRARY			downloadmgr.lib
-LIBRARY			transferratemonitor.lib
 LIBRARY         mmfstandardcustomcommands.lib
 
 LIBRARY			AudioEqualizerProxy.lib
--- a/mmfenh/enhancedmediaclient/Client/src/Components/ClientProgDLSource/ClientProgDLSource.cpp	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,569 +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:  Implementation of the ClientProgDLSource class.
-*
-*/
-
-
-#include <e32std.h>
-#include <MCustomCommand.h>
-#include <SourceControlObserver.h>
-#include "ClientProgDLSource.h"
-#include "EventNotifier.h"
-#include "EventAO.h"
-#include "ErrorCode.h"
-#include "ProgDLSourceUid.h"
-
-#define RETURN_IF_ERROR(x) if(x != KErrNone) return x
-
-// CONSTANTS
-const TInt KLocalFile = -1;
-const TInt KTranferRateMonitorFrequency = 2;
-const TInt KFileSizeChangeDelta = 10000;
-const TInt KNofityAfterPercentage = 5;
-
-using namespace multimedia;
-
-CClientProgDLSource::CClientProgDLSource()
-    {
-    iSourceState = CMultimediaDataSource::ECLOSED;
-    isDownloadComplete = false;
-    iProgressiveMode = false;
-    }
-
-CClientProgDLSource::~CClientProgDLSource()
-    {
-    delete iEventNotifier;
-    delete iMonitor;
-    delete iFileName;
-    
-    if(iStateEvent->IsActive())
-        {
-        iStateEvent->Cancel();
-        }
-    
-    delete iStateEvent;
-    }
-
-TInt CClientProgDLSource::PostConstructor()
-    {
-    TInt status(KErrNone);
-    // Make sure this doesn't get called second time around.
-    if ( !iEventNotifier )
-        {
-        TRAP(status, iEventNotifier = CEventNotifier::NewL());
-        }
-    
-    RETURN_IF_ERROR(status);
-    
-    TRAP(status, iStateEvent  = CEventAO::NewL(*this)); 
-    
-    return status;
-    }
-
-TInt CClientProgDLSource::AddObserver( MControlObserver& aObserver )
-    {
-    return iEventNotifier->AddObserver( aObserver );
-    }
-
-TInt CClientProgDLSource::RemoveObserver( MControlObserver& aObserver )
-    {
-    return iEventNotifier->RemoveObserver( aObserver );
-    }
-
-TUid CClientProgDLSource::Type()
-    {
-    return KProgDLSourceControl;
-    }
-
-TControlType CClientProgDLSource::ControlType()
-    {
-	return ESourceControl;
-    }
-    
-TInt CClientProgDLSource::GetSize( TUint& aSize )
-    {
-    TInt status(KErrNone);
-    aSize = iSourceSize;
-    return status;
-    }
-
-TInt CClientProgDLSource::GetMimeType( TDes8& aMimeType )
-    {
-    TInt status = iDownloadGateway->GetMimeType(iDownloadId,aMimeType);
-    return status;
-    }
-
-TInt CClientProgDLSource::Close()
-    {
-    TInt status(KErrNone);
-    if(iMonitor)
-        {
-        iMonitor->Stop();
-        }
-    // Reset the Progressive Mode flag always
-    iDownloadGateway->SetProgressiveMode(iDownloadId,EFalse);
-    iProgressiveMode = EFalse;
-    iDownloadId = 0;
-    iCurrentBytes = 0;
-    isDownloadPaused = EFalse;
-    isDownloadComplete = EFalse;
-    iCurrentSize = 0;
-    iSourceSize = 0;
-    iServerSourceExists = EFalse;
-    return status;
-    }
-
-TInt CClientProgDLSource::SetDownloadGateway(CDownloadGateway* aDownloadGateway)
-    {
-    iDownloadGateway = aDownloadGateway;
-    return KErrNone;
-    }
-
-
-TInt CClientProgDLSource::Open(const TDesC& aFileName,TInt32 aDLTxId )
-    {
-    TInt status(KErrNone);
-    if(aDLTxId != KLocalFile)
-        {
-        status = iDownloadGateway->ConnectToDownload(aDLTxId,*this,KNullUid);
-        if(status == KErrNone)
-        	{
-		    iDownloadId = aDLTxId;
-		    isDownloadComplete = EFalse;
-	        //Gets current downloaded size
-	        status = iDownloadGateway->GetDownloadSize(iDownloadId,iSourceSize);
-	        RETURN_IF_ERROR(status);
-	    	}
-	    else
-	    	{
-	    	iDownloadId = 0;	
-	    	return status;	
-	    	}	
-        }
-    else
-        {
-        isDownloadComplete = ETrue;
-        }        
-    
-    if(iFileName)
-        {
-        delete iFileName;
-        iFileName = NULL;
-        }
-
-    TRAP(status,iFileName = HBufC::NewL(aFileName.Size()));
-	
-	if(!status)
-	    {
-	    TPtr des = iFileName->Des();
-	    des.Copy(aFileName);
-	    }    
-    
-    return status;
-    }
-
-TInt CClientProgDLSource::MoveFile(const TDesC& aDestFileName )
-    {
-    TInt status(KErrNone);
-    iDestFileName.Copy(aDestFileName);
-    status = iDownloadGateway->MoveFile(iDownloadId,aDestFileName);
-    return status;
-    }
-
-TInt CClientProgDLSource::IsDownloadComplete(TBool& aBool)
-    {
-    TInt status(KErrNone);
-    
-    TDownloadStatus dlStatus;
-    status = iDownloadGateway->GetDownloadStatus(iDownloadId,dlStatus);
-    if(dlStatus == ECompleted)
-        {
-        aBool = true;
-        }
-    else
-        {
-        aBool = false;
-        }
-            
-    return status;
-    }
-
-TInt CClientProgDLSource::GetPercentageDownloaded(TUint& aPercent)
-    {
-    TInt status(KErrNone);
-    TUint curSize;
-    TUint fullSize;
-    if(!isDownloadComplete)
-        {
-        status = iDownloadGateway->GetCurrentSize(iDownloadId,curSize);
-        RETURN_IF_ERROR(status);
-        status = iDownloadGateway->GetDownloadSize(iDownloadId,fullSize);    
-        RETURN_IF_ERROR(status);
-        }
-    else
-        {
-        curSize = iCurrentSize;
-        fullSize = iSourceSize;
-        }
-    
-    if(fullSize)
-        {
-        aPercent = (curSize*100/fullSize);
-        }
-    else
-        {
-        aPercent = 0;
-        }        
-    return status;
-    }
-
-TInt CClientProgDLSource::GetDownloadingRate(TUint& aRate)
-    {
-    TInt status(KErrNone);
-    if(iMonitor)
-        {
-        aRate = iMonitor->TransferRate();
-        }
-    else
-        {
-        status = KErrNotFound;
-        }
-    return status;
-    }    
-
-TInt CClientProgDLSource::GetCurrentFileSize( TUint& aSize )
-    {
-    TInt status(KErrNotFound);
-    if(!isDownloadComplete)
-        {
-        status = iDownloadGateway->GetCurrentSize(iDownloadId,aSize);
-        }
-    else
-        {
-        iCurrentSize = iSourceSize;
-        status = KErrNone;
-        }
-    return status;
-    }
-     
-TInt CClientProgDLSource::GetExpectedFileSize( TUint& aSize )
-    {
-    TInt status(KErrNotFound);
-    if(!isDownloadComplete)
-        {
-        status = iDownloadGateway->GetDownloadSize(iDownloadId,aSize);
-        }
-    else
-        {
-        aSize = iSourceSize;
-        status = KErrNone;
-        }
-    return status;
-    }
-    
-MProgDLSource::TDownloadStatus CClientProgDLSource::GetDownloadStatus()
-    {
-    MProgDLSource::TDownloadStatus dlStatus;
-    iDownloadGateway->GetDownloadStatus(iDownloadId,dlStatus);
-    return dlStatus;
-    }
-    
-
-TInt CClientProgDLSource::GetPercentageBuffered(TUint& aPercent)
-    {
-    //Source Custom Command
-    TPckgBuf<TUint> pckg;
-    if(iServerSourceExists)
-        {
-        iCustomCommand->CustomCommandSync( iSourceHandle, EGetPercentageBuffered, KNullDesC8, KNullDesC8, pckg );
-        aPercent = pckg();
-        return KErrNone;
-        }
-    else
-        {
-        aPercent = 0;
-        return KErrNotFound;    
-        }
-    }            
-
-TInt CClientProgDLSource::GetBitRate(TUint& aRate)
-    {
-    //Source Custom Command
-    TPckgBuf<TUint> pckg;
-    if(iServerSourceExists)
-        {
-        iCustomCommand->CustomCommandSync( iSourceHandle, EGetBitRate, KNullDesC8, KNullDesC8, pckg );
-        aRate = pckg();
-        return KErrNone;
-        }
-    else
-        {
-        aRate = 0;
-        return KErrNotFound;
-        }
-    }
-
-TInt CClientProgDLSource::FileName(TPtr& aFileName)
-    {
-    TInt status(KErrNone);
-    aFileName.Set(iFileName->Des());
-    return status;
-    }
-
-
-TInt CClientProgDLSource::CancelDownload()
-    {
-    TInt status(KErrNone);
-    status = iDownloadGateway->DeleteDownload(iDownloadId);
-    return status;
-    }
-
-TInt CClientProgDLSource::ResumeDownload()
-    {
-    TInt status(KErrNone);
-    if(isDownloadPaused)
-        {
-        iDownloadGateway->ResumeDownload(iDownloadId);
-        }
-    return status;
-    }    
-
-void CClientProgDLSource::ServerSourceCreated( MCustomCommand& aCustomCommand,
-                                                   TMMFMessageDestination& aSourceHandle )
-    {
-    iServerSourceExists = ETrue;
-    iCustomCommand = &aCustomCommand;
-    iSourceHandle = aSourceHandle;
-    
-    if(!isDownloadComplete)
-        {
-        TRAPD(err1,iMonitor = CTransferRateMonitor::NewL(*this, KTranferRateMonitorFrequency, KFileSizeChangeDelta));
-        if(!err1)
-    	    {
-    		iMonitor->Start();
-    		}
-    	
-        // Send data to server source
-        TPckgBuf<TInt> pckg(iSourceSize);
-        iCustomCommand->CustomCommandSync( iSourceHandle, ESetActualSize, pckg, KNullDesC8 );
-        
-        iStateEvent->SetActive();
-        iStatePckg() = iSourceState;	  
-        iCustomCommand->CustomCommandAsync(
-            iSourceHandle,
-            (TInt)EGetSourceState,
-            iStatePckg,
-            KNullDesC8,
-            iStatePckg,
-            iStateEvent->iStatus);
-            
-         }
-     else
-        {
-        iCustomCommand->CustomCommandSync( iSourceHandle, ESetDownloadState, KNullDesC8, KNullDesC8 );        
-        }
-    }
-
-void CClientProgDLSource::ServerSourceDeleted()
-    {
-#ifdef _DEBUG
-    RDebug::Print(_L("CClientProgDLSource::ServerSourceDeleted()"));    
-#endif    
-    iServerSourceExists = EFalse;
-    iCustomCommand = NULL;
-    
-    if(iMonitor)
-        {
-        iMonitor->Stop();
-        }
-    }
-
-TBool CClientProgDLSource::IsEncrypted()
-    {
-    return EFalse;
-    }
-    
-TUid CClientProgDLSource::GetSourceUid()
-    {
-    return KMmfProgDLSource;
-    }
-    
-TInt CClientProgDLSource::GetHeaderData(TPtr& /*aPtr*/)
-    {
-    return KErrNotSupported;
-    }
-    
-void CClientProgDLSource::MoveFileComplete(TInt aError)
-    {
-    if(iServerSourceExists)
-        {
-        TPtr des = iFileName->Des();
-        if(aError == KErrNone)
-            {
-    	    des.Copy(iDestFileName);
-            }
-	    else
-            {
-            iDownloadGateway->GetLocalFileName(iDownloadId,des);
-            }
-        TPckgBuf<TFileName> pckg(iDestFileName);
-        iCustomCommand->CustomCommandSync( iSourceHandle, ESetUpdateFileName, pckg, KNullDesC8 );
-        }
-    
-    CErrorCode* event1 = new CErrorCode( aError );       
-    iEventNotifier->Event(this,MSourceControlObserver::KFileMoveCompleteEvent,event1);
-    }
-
-void CClientProgDLSource::Event(TDownloadStatus aStatus)
-    {   
-#ifdef _DEBUG
-    RDebug::Print(_L("CClientProgDLSource::Event DownloadStatus[%d]"),aStatus);
-#endif            
-
-    switch(aStatus)
-        {
-            case ECompleted:
-                {
-                if(iMonitor)
-                    {
-                    iMonitor->Stop();	
-                    }
-                TUint size(0);
-                GetCurrentFileSize(size);
-                TInt value = size;
-                TPckgBuf<TInt> pckg(value);
-				if(iServerSourceExists)
-				{
-                	if (iSourceState != CMultimediaDataSource::ESTOPPED)
-                    	{
-	                    iCustomCommand->CustomCommandSync( iSourceHandle, ESetDownloadSize, pckg, KNullDesC8 );
-    	                }
-        	        iCustomCommand->CustomCommandSync( iSourceHandle, ESetDownloadState, KNullDesC8, KNullDesC8 );
-				}
-                isDownloadComplete = ETrue;               
-                break;                    
-                }
-            case EStarted:
-                {
-                isDownloadPaused = EFalse;    
-                break;
-                }
-            case EPaused:
-                {
-                isDownloadPaused = ETrue;
-                break;    
-                }
-            case EDeleted:
-                {
-                if(iMonitor)
-                    {
-                    iMonitor->Stop();
-                    }
-                break;
-                }
-
-            case EUnknown:
-                break;
-                
-        }
-        //Send only Known Events
-        if(aStatus != EUnknown)
-            {
-            CErrorCode* event1 = new CErrorCode( KErrNone );       
-            iEventNotifier->Event(this,MSourceControlObserver::KDownloadStatusChangedEvent,event1); 
-            }
-    }
-
-TInt CClientProgDLSource::GetCurrentSize( TUint& aCurrentSize )
-    {
-    //RDebug::Print(_L("CClientProgDLSource::GetCurrentSize"));			
-    TUint value(0);
-    GetExpectedFileSize(value);
-    
-    GetCurrentFileSize(aCurrentSize);
-    
-    if(aCurrentSize - iCurrentBytes > ((KNofityAfterPercentage/100) * value)) //Currently checking for 5%
-        {
-            iCurrentBytes = aCurrentSize;
-            CErrorCode* event1 = new CErrorCode( KErrNone );       
-            iEventNotifier->Event(this,MSourceControlObserver::KPercentageDownloadedChangedEvent,event1);
-        }
-    
-    iCurrentSize = aCurrentSize;
-    
-    if ( iServerSourceExists && iSourceState != CMultimediaDataSource::ESTOPPED)
-        {
-        // Send data to server source
-        
-        TPckgBuf<TInt> pckg(iCurrentSize);
-        iCustomCommand->CustomCommandSync( iSourceHandle, ESetDownloadSize, pckg, KNullDesC8 );
-        
-        }			
-#ifdef _DEBUG
-    RDebug::Print(_L("CClientProgDLSource::GetCurrentSize:[%d]"), aCurrentSize);	
-#endif    
-    
-    return KErrNone;			
-    }
-
-void CClientProgDLSource::TransferRateChanged()
-    {
-#ifdef _DEBUG    
-    RDebug::Print(_L("CClientProgDLSource::TransferRateChanged:[%d]"), iMonitor->TransferRate());
-#endif    
-    if ( iServerSourceExists  && !isDownloadComplete && iSourceState != CMultimediaDataSource::ESTOPPED)
-        {
-        // Send data to server source
-        
-        TPckgBuf<TUint> pckg1(iMonitor->TransferRate());
-        iCustomCommand->CustomCommandSync( iSourceHandle, EDownloadRate, pckg1, KNullDesC8 );
-        
-        }			
-    }
-
-void CClientProgDLSource::SourceStateChanged()		
-    {
-#ifdef _DEBUG
-    RDebug::Print(_L("CClientProgDLSource::SourceStateChanged() :PrevState[%d] NewState[%d]"), iSourceState,iStatePckg());
-#endif    
-    iSourceState = iStatePckg();
-    
-    if(iSourceState == CMultimediaDataSource::ESTOPPED || iSourceState == CMultimediaDataSource::ECLOSED)        
-        {
-        //iDownloadGateway->SetProgressiveMode(iDownloadId,EFalse);
-        iProgressiveMode = EFalse;
-        }
-    else if(!iProgressiveMode && !isDownloadComplete)
-        {
-        iDownloadGateway->SetProgressiveMode(iDownloadId,ETrue);
-        TPtr ptrFileName = iFileName->Des();
-        iDownloadGateway->SetLocalFileName( iDownloadId, ptrFileName );
-        iProgressiveMode = ETrue;
-        }
-    
-        
-    if(iStateEvent->Error() != KErrDied && iServerSourceExists)
-        {
-        iStateEvent->SetActive();	    
-        iCustomCommand->CustomCommandAsync(
-            iSourceHandle,
-            (TInt)EGetSourceState,
-            iStatePckg,
-            KNullDesC8,
-            iStatePckg,
-            iStateEvent->iStatus);    
-        }                               
-    }
-// End of file
--- a/mmfenh/enhancedmediaclient/Client/src/Components/ClientProgDLSource/ClientProgDLSource.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,383 +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:  Definition of the ClientProgDLSource class.
-*
-*/
-
-
-#ifndef C_CCLIENTAUDIOPROGDLSOURCE_H
-#define C_CCLIENTAUDIOPROGDLSOURCE_H
-
-#include <e32base.h>
-#include <ProgDLSource.h>
-#include <downloadmgrclient.h>
-#include <mmfcontrollerframework.h>
-#include <MultimediaDataSource.h>
-
-#include "SourceBase.h"
-#include "TransferRateMonitor.h"
-#include "ProgDLSourceCustomCommands.h"
-#include "EventAO.h"
-#include "DownloadGateway.h"
-
-
-class MCustomCommand;
-
-namespace multimedia
-    {
-    
-    class CEventNotifier;
-
-    class MTransferRateMonitor;
-    
-    /**
-    *  Implements the ClientSide Source for the ProgDL Source.
-    *  Provides functionality to the Clients to query attributes
-    *  from the ServerSide source
-    *  @lib EnhancedMediaClient.lib
-    *  @since S60 v3.2
-    */    
-    class CClientProgDLSource : public CSourceBase,
-                                public MProgDLSource,
-                                public MDownloadGatewayObserver,
-                                public MTransferRateObserver,
-                                public MSourceStateObserver
-        {
-        public:
-            /**
-            * Function to Create the Object.
-            */
-            CClientProgDLSource();
-            /**
-            * Destructor.
-            */
-            ~CClientProgDLSource();
-            /**
-            * Post Contructor. This is to Support the new type of Construction
-            * of the Object. Notice there is no Two phased Constructor in this class
-            */
-            TInt PostConstructor();
-            
-            /**
-            * Associates the DownloadGateway with the Progressive Download Source.
-            * This Gateway class sends all the Browser Events to the Source.
-            */
-            TInt SetDownloadGateway(CDownloadGateway* aDownloadGateway);
-            
-            // From MControl begins
-            /**
-            * From MControl.
-            * Adds the Observer to this Object
-            * @since S60 v3.2
-            * @param aObserver Client which set the Observer.             
-            */            
-            TInt AddObserver( MControlObserver& aObserver );
-            /**
-            * From MControl.
-            * Removes the Observer to this Object
-            * @since S60 v3.2
-            * @param aObserver Client which set the Observer.             
-            */            
-            TInt RemoveObserver( MControlObserver& aObserver );
-            /**
-            * From MControl.
-            * Returns the Type of this Object.
-            * request and that it is now outstanding 
-            * @since S60 v3.2
-            */            
-            TUid Type();
-            /**
-            * From MControl.
-            * Returns the Control Type of this Object.
-            *
-            * @since S60 v3.2
-            */            
-            TControlType ControlType();
-            // From MControl ends
-            
-            // From MSourceControl begins
-            /**
-            * From MSourceControl.
-            * Returns the Size in Bytes of the Source.
-            * Since this is ProgDL Source, the size represents
-            * the file size which will be passed by the Client
-            *  to the Source
-            * @since S60 v3.2
-            * @param aSize Size returned by the Source.             
-            */            
-            TInt GetSize( TUint& aSize );
-            /**
-            * From MSourceControl.
-            * Returns the Mime Type of the Data for which
-            * the Source is initialized.
-            * @since S60 v3.2
-            * @param aMimeType MimeType returned by the Source.             
-            */            
-            TInt GetMimeType( TDes8& aMimeType );
-            /**
-            * From MSourceControl.
-            * Closes the Source.
-            *
-            * @since S60 v3.2
-            */            
-            TInt Close();
-            // From MSourceControl ends
-            
-            // From MProgDLSource begins
-            /**
-            * From MProgDLSource.
-            * Opens the Source with the FileName and TransactionID
-            * Here it connects to the Browser and attaches to the 
-            * download corresponding to the TransactionID
-            *
-            * @since S60 v3.2
-            * @param aFileName      FileName to be Opened by the Source
-            * @param aDLTxId        TransactionID to connect to the Browser
-            */            
-            TInt Open( const TDesC& aFileName,TInt32 aDLTxId );
-            /**
-            * From MProgDLSource.
-            * Moves the Finished Download to the new Location. This is done
-            * by calling the browser which is invoked through the Gateway.
-            *
-            * @since S60 v3.2
-            * @param aFileName      FileName to be Opened by the Source
-            */            
-            TInt MoveFile(const TDesC& aDestFileName );
-            /**
-            * From MProgDLSource.
-            * Cancels the Ongoing Download
-            *
-            * @since S60 v3.2
-            */            
-            TInt CancelDownload();
-            /**
-            * From MProgDLSource.
-            * Resumes the Paused download
-            *
-            * @since S60 v3.2
-            */            
-            TInt ResumeDownload();
-            /**
-            * From MProgDLSource.
-            * Gets the Current FileSize from the Browser which is getting 
-            * Downloaded
-            *
-            * @since S60 v3.2
-            * @param aSize  Size of the File already downloaded
-            */            
-            TInt GetCurrentFileSize( TUint& aSize );
-            /**
-            * From MProgDLSource.
-            * Gets the Expected FileSize from the Browser which is getting 
-            * Downloaded
-            *
-            * @since S60 v3.2
-            * @param aSize  Final Size of the File
-            */            
-            TInt GetExpectedFileSize( TUint& aSize );
-            /**
-            * From MProgDLSource.
-            * Return the Current Download Status of the Download
-            *
-            * @since S60 v3.2
-            */            
-            TDownloadStatus GetDownloadStatus();
-            /**
-            * From MProgDLSource.
-            * Queries if the Download is Complete from the Gateway
-            *
-            * @since S60 v3.2
-            * @param aBool      Download Complete Status
-            */            
-            TInt IsDownloadComplete(TBool& aBool);
-            /**
-            * From MProgDLSource.
-            * Gets the Percentage of the File already Downloaded
-            *
-            * @since S60 v3.2
-            * @param aPercent   Percentage of the File downloaded
-            */            
-            TInt GetPercentageDownloaded(TUint& aPercent);
-            /**
-            * From MProgDLSource.
-            * Gets the Percentage of the File Buffered before Playback starts.
-            * This query is to the ServerSide Source which is in Buffering State
-            *   
-            * @since S60 v3.2
-            * @param aPercent      Percentage of Data Buffered before Playback starts.
-            */            
-            TInt GetPercentageBuffered(TUint& aPercent);            
-            /**
-            * From MProgDLSource.
-            * This is the DownloadRate that tells you how fast data is downloaded
-            * by the Download Manager
-            *
-            * @since S60 v3.2
-            * @param aRate  Rate at which Data is Downloaded.
-            */            
-            TInt GetDownloadingRate(TUint& aRate);
-            /**
-            * From MProgDLSource.
-            * Returns the BitRate of the Data played from the Source
-            *
-            * @since S60 v3.2
-            * @param aRate  BitRate of the Data Played from the Source
-            */            
-            TInt GetBitRate(TUint& aRate); 
-            /**
-            * From MProgDLSource.
-            * Returns the FileName associated with the Download.
-            * This value is set by the Client when it calls Open().
-            *
-            * @since S60 v3.2
-            * @param aFileName  FileName to be Opened by the Source
-            */            
-            TInt FileName(TPtr& aFileName);
-            // From MProgDLSource ends
-            
-            // From MDownloadGatewayObserver
-            /**
-            * From MDownloadGatewayObserver.
-            * The Gateway Observer sends event which it receives from the
-            * Download Manager.
-            *
-            * @since S60 v3.2
-            * @param aStatus  Current Download Status
-            */            
-            void Event(TDownloadStatus aStatus);
-            /**
-            * From MDownloadGatewayObserver.
-            * Notifies the Client that the Move of the File Complete
-            * with an ErrorCode returned.
-            *
-            * @since S60 v3.2
-            * @param aError  Move Complete with this ErrorCode.
-            */            
-            void MoveFileComplete(TInt aError);
-            // MDownloadGatewayObserver Ends
-            
-            
-            // From CSourceBase begins
-            /**
-            * From CSourceBase.
-            * Callback from the StreamControl when the Source is Created
-            *
-            * @since S60 v3.2
-            * @param aCustomCommand    Custom Command handle to send message to the Source             
-            * @param aSourceHandle     Handle Identifying the Source             
-            */            
-            void ServerSourceCreated( MCustomCommand& aCustomCommand,
-                                    TMMFMessageDestination& aSourceHandle );
-            /**
-            * From CSourceBase.
-            * Callback from the StreamControl when the ServerSource is Deleted
-            *
-            * @since S60 v3.2
-            */            
-            void ServerSourceDeleted();
-            /**
-            * From CSourceBase.
-            * Returns the Content Protection information to the Stream Control
-            * Currently returns KErrNotSupported 
-            * @since S60 v3.2
-            */            
-            TBool IsEncrypted();
-            /**
-            * From CSourceBase.
-            * Returns the SourceUID
-            *
-            * @since S60 v3.2
-            */            
-            TUid GetSourceUid();
-            /**
-            * From CSourceBase.
-            * Returns the Header Data passed when the Client calls Open
-            *  Currently return KErrNotSupported
-            * @since S60 v3.2
-            */            
-            TInt GetHeaderData(TPtr& aPtr);
-            // From CSourceBase ends
-            
-            //MTransferRateObserver begins
-            /**
-            * From MTransferRateObserver.
-            * Callback from the TransferRate Monitor that the Rate Changed
-            * @since S60 v3.2
-            */            
-            void TransferRateChanged();
-            /**
-            * From MTransferRateObserver
-            * Method from the Transfer Rate Monitor to query CurrentFile Size.
-            * @since S60 v3.2
-            * @param aCurrentSize Current File Size returned to the Caller             
-            */            
-            TInt GetCurrentSize( TUint& aCurrentSize );
-            // MTransferRateObserver ends
-            
-            // MSourceStateObserver begins
-            /**
-            * From MSourceStateObserver.
-            * Callback from the Active Object that the Source State changed.
-            * @since S60 v3.2
-            */            
-            void SourceStateChanged();    
-            // MSourceStateObserver ends		
-            
-        private:
-            // Variable to determine if the ServerSource exists
-            TBool iServerSourceExists;
-
-            // FileSize from the Client
-            TUint iSourceSize;
-            // Current Size from the Browser
-            TInt iCurrentSize;
-            // Destination File Name            
-            TFileName iDestFileName;
-
-            // Handle to send messages to the Server Side Source
-            MCustomCommand* iCustomCommand;
-            // Handle Identifying the Server Side Source
-            TMMFMessageDestination iSourceHandle;
-            
-            // Current State of the Source
-            TPckgBuf<CMultimediaDataSource::TState> iStatePckg;
-            // Observer monitoring the State change event
-            CEventAO* iStateEvent;
-            // Current State of the Source
-            CMultimediaDataSource::TState iSourceState;
-            // Event Notifier to notify Clients
-            CEventNotifier* iEventNotifier;
-            // Storing the Download Complete Status
-            TBool isDownloadComplete;
-            // Storing the Download Paused status
-            TBool isDownloadPaused;
-            // Storing the DownloadID/Transaction ID
-            TInt32 iDownloadId;
-            // FileName passed to Open the Source
-            HBufC* iFileName;
-            // Gateway Attached to this Source to talk to Browser
-            CDownloadGateway* iDownloadGateway;
-            // Transfer Rate monitor
-            CTransferRateMonitor* iMonitor;
-            // Current Size of the File in Bytes.
-            TUint iCurrentBytes;
-            // Is the Playback in Progressive Mode
-            TBool iProgressiveMode;
-        };
-    } // namespace multimedia
-
-#endif // CLIENTAUDIOPROGDLSOURCE_H
-
-// End of file
--- a/mmfenh/enhancedmediaclient/Client/src/Components/ClientProgDLSource/DownloadGateway.cpp	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,273 +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:  Implementation of DownloadGateway class.
-*
-*/
-
-
-#include "DownloadGateway.h"
-#include <e32std.h>
-
-#define RETURN_IF_ERROR(x) if(x != KErrNone) return x
-
-using namespace multimedia;
-
-// CONSTANTS
-CDownloadGateway::CDownloadGateway()
-    {
-    iDMgrConnected = EFalse;
-    iDownload = NULL;
-    iDownloadId = 0;
-    }
-
-CDownloadGateway::~CDownloadGateway()
-    {
-    if ( iDMgrConnected )
-        {
-        iDownloadMgr.Close();
-        }
-    }
-
-TInt CDownloadGateway::Initialize(TUid aClientUid)
-    {
-    TInt status(KErrNone);
-    if ( !iDMgrConnected )
-        {
-        TRAP(status,iDownloadMgr.ConnectL( aClientUid, *this, EFalse ));
-        if(!status)
-            {
-            iDMgrConnected = ETrue;
-            }
-        }
-    return status;
-    }
-
-TInt CDownloadGateway::MoveFile( TInt aId, const TDesC& aDestFileName )
-    {
-    TInt status(KErrNotFound);
-    // Check here if the download is complete and the Source is in Stopped State
-    if(iDownloadId == aId && iDownload)
-        {
-        status = iDownload->SetStringAttribute( EDlAttrDestFilename, aDestFileName );
-        if(!status)
-            {
-            iDownload->Move();
-            }
-        }
-    return status;
-    }
-
-TInt CDownloadGateway::ConnectToDownload(TInt aId, MDownloadGatewayObserver& aObserver, TUid /*aAppUid*/)
-    {
-    TInt status(KErrNotFound);
-    TRAP(status, iDownload = &(iDownloadMgr.AttachToDownloadL( aId )));
-    if(status == KErrNone)
-    	{
-	    iObserver = &aObserver;
-	    iDownloadId = aId;
-    	}
-	else
-		{
-		iDownload = NULL;	
-		}    	
-    return status;
-    }
-
-TInt CDownloadGateway::DisconnectFromDownload(TInt aId)
-    {
-    TInt status(KErrNotFound);
-    if(iDownloadId == aId && iDownload)
-        {
-        iDownload = NULL;
-        iDownloadId = 0;
-        status = KErrNone;
-        }
-    return status;
-    }
-
-TInt CDownloadGateway::GetMimeType(TInt aId, TDes8& aMimeType)
-    {
-    TInt status(KErrNotFound);
-    if(iDownloadId == aId && iDownload)
-        {
-        status = iDownload->GetStringAttribute( EDlAttrContentType, aMimeType  );
-        }
-    return status;
-    }
-
-TInt CDownloadGateway::GetCurrentSize(  TInt aId, TUint& aSize )
-    {
-    TInt status(KErrNotFound);
-    TInt32 value(0);
-    if(iDownloadId == aId && iDownload)
-        {
-         status = iDownload->GetIntAttribute( EDlAttrDownloadedSize, value );
-         if(!status)
-            {
-            aSize = value;
-            }
-        }
-    return status;
-    }
-
-TInt CDownloadGateway::GetDownloadSize( TInt aId, TUint& aSize )
-    {
-    TInt status(KErrNotFound);
-    TInt32 value(0);
-    if(iDownloadId == aId && iDownload)
-        {
-        status = iDownload->GetIntAttribute( EDlAttrLength, value );
-        if(status == KErrNone)
-            {
-            aSize = value;
-            }
-        }
-    return status;
-    }
-
-TInt CDownloadGateway::GetDownloadStatus(TInt aId, MProgDLSource::TDownloadStatus& aStatus)
-    {
-    TInt status(KErrNotFound);
-    if(iDownloadId == aId && iDownload)
-        {
-        aStatus = iDownloadStatus;
-        }
-    return status;
-    }
-
-TInt CDownloadGateway::DeleteDownload(TInt aId)
-    {
-    TInt status(KErrNotFound);
-    if(iDownloadId == aId && iDownload)
-        {
-        status = iDownload->Delete();
-        }
-    return status;
-    }
-
-TInt CDownloadGateway::ResumeDownload(TInt aId)
-    {
-    TInt status(KErrNotFound);
-    if(iDownloadId == aId && iDownload)
-        {
-        status = iDownload->Start();
-        }
-    return status;
-    }
-
-TInt CDownloadGateway::SetProgressiveMode(TInt aId, TBool aMode)
-    {
-    TInt status(KErrNotFound);
-    if(iDownloadId == aId && iDownloadStatus != MProgDLSource::EDeleted && iDownload)
-        {
-        status = iDownload->SetBoolAttribute( EDlAttrProgressive, aMode );
-        }
-    return status;
-    }
-
-TInt CDownloadGateway::SetLocalFileName( TInt aId, TDesC& aFilName )
-    {
-    TInt status(KErrNotFound);
-    if( iDownloadId == aId  && iDownload)
-        {
-        status = iDownload->SetStringAttribute( EDlAttrLocalFileName, aFilName );
-        }
-    return status;
-    }
-
-TInt CDownloadGateway::GetLocalFileName( TInt aId, TDes& aFileName )
-    {
-    TInt status(KErrNotFound);
-    if( iDownloadId == aId  && iDownload)
-        {
-        status = iDownload->GetStringAttribute( EDlAttrDestFilename, aFileName );
-        }
-    return status;
-    }
-
-void CDownloadGateway::HandleDMgrEventL( RHttpDownload& /*aDownload*/, THttpDownloadEvent aEvent )
-    {
-#ifdef _DEBUG
-        RDebug::Print(_L("CDownloadGateway::HandleDMgrEventL DownloadState[%d] ProgressState[%d]"),aEvent.iDownloadState,aEvent.iProgressState);
-#endif        
-        MProgDLSource::TDownloadStatus status;
-
-        // When the new evnet is different in one of the states 
-        // then the current event 
-        if(iPrevEvent.iDownloadState != aEvent.iDownloadState)
-            {
-                switch(aEvent.iDownloadState)
-                {
-                    case EHttpDlCreated:
-                            status = MProgDLSource::EConnecting;
-                            break;
-                    case EHttpDlInprogress:
-                            status = MProgDLSource::EStarted;
-                            break;
-                    case EHttpDlPaused:
-                            status = MProgDLSource::EPaused;
-                            break;
-                    case EHttpDlCompleted:
-                            status = MProgDLSource::ECompleted;
-                            break;
-                    case EHttpDlFailed:
-                            status = MProgDLSource::EFailed;
-                            break;
-                    case EHttpDlDeleting:
-                            status = MProgDLSource::EDeleted;
-                            break;                        
-                    default:
-                            status = MProgDLSource::EUnknown;
-                            break;
-                };
-                
-                iDownloadStatus = status;
-                iObserver->Event(status);
-            }
-        
-        if(iPrevEvent.iProgressState != aEvent.iProgressState)
-            {
-                switch(aEvent.iProgressState)
-                {
-                    
-                    case EHttpProgContentFileMoved:
-                            {
-                            TInt32 value(0);
-                            TInt err = iDownload->GetIntAttribute( EDlAttrErrorId, value );
-#ifdef _DEBUG
-                            RDebug::Print(_L("Delete File Code 2[%d][%d]"),err,value);
-#endif                            
-                            if(!err)
-                                {
-                                iObserver->MoveFileComplete(value);
-                                }
-                            }
-                            break;
-                   case EHttpProgCodLoadEnd:
-                            // Case for COD download complete
-                            iDownloadStatus = MProgDLSource::ECompleted;
-                            iObserver->Event(MProgDLSource::ECompleted);
-                            break;
-                    case EHttpProgContentFileMovedAndDestFNChanged:
-                            {
-                            iObserver->MoveFileComplete(KErrAlreadyExists);
-                            break;
-                            }
-                };
-            }
-        
-        iPrevEvent = aEvent;
-    }
-
-// End of file
--- a/mmfenh/enhancedmediaclient/Client/src/Components/ClientProgDLSource/DownloadGateway.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,182 +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:  Header of DownloadGateway class.
-*
-*/
-
-
-#ifndef DOWNLOADGATEWAY_H
-#define DOWNLOADGATEWAY_H
-
-#include <e32base.h>
-#include <downloadmgrclientapiext.h>
-#include <ProgDLSource.h>
-
-namespace multimedia
-    {
-    
-    /**
-     *  Observer that sends browser events to the Client
-     *  @lib EnhancedMediaClient.lib
-     *  @since S60 v3.2
-     */    
-    class MDownloadGatewayObserver
-        {
-        public:
-            virtual void Event(MProgDLSource::TDownloadStatus aStatus) = 0;
-            virtual void MoveFileComplete(TInt aError) = 0;
-        };
-
-    /**
-    *  Implements the Gateway from which the Clients talk to the DownloadMgr.
-    *  Provides functionality to the Clients to query attributes
-    *  from the Browser
-    *  @lib EnhancedMediaClient.lib
-    *  @since S60 v3.2
-    */    
-    class CDownloadGateway : public MHttpDownloadMgrObserver
-        {
-        public:
-            /**
-            * Function to Create the Object.
-            */
-            CDownloadGateway();
-            /**
-            * Destructor.
-            */
-            ~CDownloadGateway();
-
-            /**
-            * Initialize the Gateway with the Client UID.
-            * Here it connect to the DownloadMgr Server.
-            * @since S60 v3.2
-            * @param aClientUid Client which wants to connect.             
-            */            
-            TInt Initialize(TUid aClientUid);
-            /**
-            * Calls Move on the DownloadMgr for the TransactionID
-            * @since S60 v3.2
-            * @param aId TransactionID for which the File has to be moved.             
-            * @param aDestFileName Full Pathname where the file needs to be moved.             
-            */            
-            TInt MoveFile( TInt aId, const TDesC& aDestFileName );
-            /**
-            * Called by the Client which wants to Connect to the Download
-            * @since S60 v3.2
-            * @param aId TransactionID for which the File has to be moved.             
-            * @param aObserver Observer where the Client wants the Callbacks             
-            * @param aAppUid UID for the App which Connects.             
-            */            
-            TInt ConnectToDownload(TInt aId, MDownloadGatewayObserver& aObserver, TUid aAppUid);
-            /**
-            * Disconnect from the Download
-            * Here it connect to the DownloadMgr Server.
-            * @since S60 v3.2
-            * @param aId DownloadID from which the Client wants to Disconnect.             
-            */            
-            TInt DisconnectFromDownload(TInt aId);
-            /**
-            * Gets the Current Downloaded Size of the Download
-            * @since S60 v3.2
-            * @param aId TransactionID of the Download which the FileSize is queried.             
-            * @param aSize Size of the Download returned             
-            */            
-            TInt GetCurrentSize(  TInt aId, TUint& aSize );
-            /**
-            * Total Size of the File which is being downloaded
-            * Here it connect to the DownloadMgr Server.
-            * @since S60 v3.2
-            * @param aId TransactionID of the Download which the FileSize is queried.             
-            * @param aSize Total Size of the File being Downloaded returned             
-            */            
-            TInt GetDownloadSize( TInt aId, TUint& aSize );
-            /**
-            * Gets the Download Status for a particular Download
-            * @since S60 v3.2
-            * @param aId TransactionID of the Download which the FileSize is queried.             
-            * @param aStatus Download Status for the Download           
-            */            
-            TInt GetDownloadStatus(TInt aTxId, MProgDLSource::TDownloadStatus& aStatus);
-            /**
-            * Cancelling a Particular Download
-            * @since S60 v3.2
-            * @param aId TransactionID of the Download to be deleted             
-            */            
-            TInt DeleteDownload(TInt aId);
-            /**
-            * Resuming a Paused Download
-            * @since S60 v3.2
-            * @param aId TransactionID of the Download to be Resumed
-            */            
-            TInt ResumeDownload(TInt aId);
-            /**
-            * Queries the MimeType of the File from the DownloadMgr
-            * @since S60 v3.2
-            * @param aId TransactionID of the Download to be queried
-            * @param aMimeType MimeType returned from the Browser.           
-            */            
-            TInt GetMimeType(TInt aId, TDes8& aMimeType);
-            /**
-            * Tells the Browser if the Download is being Progressively Played
-            * @since S60 v3.2
-            * @param aId TransactionID of the Dowload to be Resumed
-            * @param aMode Whether the Mode is True or False.            
-            */            
-            TInt SetProgressiveMode(TInt aId, TBool aMode);
-            /**
-            * Before Calling Move we need to Call this to set the Local FileName
-            * @since S60 v3.2
-            * @param aId TransactionID of the Dowload for setting the FileName
-            * @param aFileName Name to be Set
-            */            
-            TInt SetLocalFileName( TInt aId, TDesC& aFileName );
-            /**
-            * Gets the Local FileName from the DownloadMgr
-            * @since S60 v3.2
-            * @param aId TransactionID of the Dowload to be Resumed
-            * @param aFileName Gets the FileName from the DownloadMgr
-            */            
-            TInt GetLocalFileName(TInt aId, TDes& aFileName );
-            // From MhttpDownloadMgrObserver
-            /**
-            * From MhttpDownloadMgrObserver.
-            * Callback from the DownloadManager notifying Client Events.
-            * @since S60 v3.2
-            * @param aDownload Download for which the Event is meant             
-            * @param aEvent Actual Event             
-            */            
-            void HandleDMgrEventL( RHttpDownload& aDownload, THttpDownloadEvent aEvent );
-            // MhttpDownloadMgrObserver Ends
-
-        private:
-            // The Observer where we need to forward the Browser events
-            MDownloadGatewayObserver* iObserver;
-            // Download Manager instance to which we connect
-            RHttpDownloadMgrApiExt  iDownloadMgr;
-            // Download for which we connect
-            RHttpDownload* iDownload;
-            // Status if we are connected
-            TBool iDMgrConnected;
-            // Previous DLMgr Event
-            THttpDownloadEvent iPrevEvent;
-            // Current Download ID
-            TInt iDownloadId;
-            // Current Download Status
-            MProgDLSource::TDownloadStatus iDownloadStatus;
-        };
-    } // namespace multimedia
-
-#endif // DOWNLOADGATEWAY_H
-
-// End of file
--- a/mmfenh/enhancedmediaclient/Client/src/Components/ClientProgDLSource/EventAO.cpp	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +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:  Implementation of EventAO class.
-*
-*/
-
-
-#include "EventAO.h"
-
-using namespace multimedia;
-
-CEventAO::CEventAO(MSourceStateObserver& aObserver )
-: CActive(CActive::EPriorityStandard),
-iObserver(aObserver),
-iError(KErrNone)
-    {
-    CActiveScheduler::Add(this);
-    }
-
-CEventAO::~CEventAO()
-    {
-    Cancel();
-    }
-
-CEventAO* CEventAO::NewL( MSourceStateObserver& aObserver )
-    {
-    CEventAO* self = new (ELeave)CEventAO( aObserver );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-void CEventAO::ConstructL()
-    {
-    }
-
-void CEventAO::SetActive()
-    {
-    if (!IsActive())
-        {
-        CActive::SetActive();
-        }
-    }
-
-TInt CEventAO::Error()
-    {
-    return iError;
-    }
-
-// From CActive
-void CEventAO::RunL()
-    {
-    // Save the error code
-    iError = iStatus.Int();
-    // Signal the observer that this request is serviced
-    iObserver.SourceStateChanged();
-    }
-
-void CEventAO::DoCancel()
-    {
-    if(iStatus.Int() != 0)
-        {
-        TRequestStatus* status = &iStatus;
-        User::RequestComplete(status,KErrCancel);
-        }
-    }
-
-TInt CEventAO::RunError( TInt /*aError*/ )
-    {
-    return KErrNone;
-    }
-
-// End of File
--- a/mmfenh/enhancedmediaclient/Client/src/Components/ClientProgDLSource/EventAO.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +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:  header of EventAO class.
-*
-*/
-
-
-#ifndef C_CEVENTAO_H
-#define C_CEVENTAO_H
-
-//  INCLUDES
-#include <e32base.h>
-
-namespace multimedia
-    {
-    
-    // Observer
-    /**
-     *  Observer that monitors the Source State changes
-     *  @lib EnhancedMediaClient.lib
-     *  @since S60 v3.2
-     */    
-    class MSourceStateObserver
-        {
-        public:
-            virtual void SourceStateChanged() = 0;
-        };
-    
-    /**
-     *  Active Object that monitors the Source State Change
-     *  Event from the Source Side
-     *  @lib EnhancedMediaClient.lib
-     *  @since S60 v3.2
-     */    
-   class CEventAO : public CActive
-        {
-        public:  // Constructors and destructor
-            /**
-             * Function to Create the Object.
-             * @param aObserver Observer to callback the Event.
-             */
-            static CEventAO* NewL(MSourceStateObserver& aObserver);
-            /**
-            * Destructor.
-            */
-            virtual ~CEventAO();
-            
-            /**
-             * From CActive.
-             * Indicates that this active object has issued a
-             * request and that it is now outstanding 
-             *
-             * @since S60 v3.2
-             */            
-            void SetActive();
-
-            /**
-             * From CEventAO.
-             * Returns the Error Stoted on Completion of the Request
-             *
-             * @since S60 v3.2
-             */            
-            TInt Error();
-            
-        protected:
-            // From CActive
-            void RunL();
-            void DoCancel();
-            TInt RunError( TInt aError );
-            
-        private:
-            CEventAO( MSourceStateObserver& aObserver );
-            void ConstructL();
-            
-        private:
-            /**
-            * Observer stored to Callback
-            */
-            MSourceStateObserver& iObserver;
-            /**
-            * Error Stored upon Request Completion
-            */
-            TInt iError;
-        };
-    
-    } // namespace multimedia
-
-#endif // C_CEVENTAO_H
-
-// End of File
--- a/mmfenh/enhancedmediaclient/Client/src/Components/ControlFactory/ControlFactoryImpl.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmfenh/enhancedmediaclient/Client/src/Components/ControlFactory/ControlFactoryImpl.cpp	Fri May 14 16:22:35 2010 +0300
@@ -24,11 +24,9 @@
 #include "ControlFactoryImpl.h"
 #include "ClientStreamControl.h"
 #include "ClientDataBufferSource.h"
-#include "ClientProgDLSource.h"
 #include "ClientFileSource.h"
 #include "ClientDescriptorSource.h"
 #include "ClientDataBuffer.h"
-#include "DownloadGateway.h"
 #include "VolumeEffectImpl.h"
 #include "BalanceEffectImpl.h"
 #include "CMMFAudioOutputSink.h"
@@ -66,19 +64,10 @@
 void CMultimediaFactoryImpl::ConstructL()
     {
     // No impl
-    if(iGateway)
-        {
-        delete iGateway;
-        iGateway = NULL;        
-        }    
     }
 
 CMultimediaFactoryImpl::~CMultimediaFactoryImpl()
     {
-    if(iGateway)
-        {
-        delete iGateway;
-        }
     }
     
 TInt CMultimediaFactoryImpl::CreateStreamControl( TUid aType, MStreamControl*& aControl )
@@ -140,39 +129,6 @@
             }
         }
     
-    if(aType == KProgDLSourceControl)
-        {
-        if(!iGateway)
-            {
-            iGateway = new CDownloadGateway;
-            TInt status = iGateway->Initialize(TUid::Uid(0));
-            if(status != KErrNone)
-                {
-                return status;    
-                }
-            }
-            
-        CClientProgDLSource* srcControl = new CClientProgDLSource;
-        if ( !srcControl )
-            {
-            status = KErrNoMemory;
-            }
-        else
-            {
-            status = srcControl->PostConstructor();
-            }
-
-        if ( status == KErrNone )
-            {
-            srcControl->SetDownloadGateway(iGateway);
-            aControl = srcControl;
-            }
-        else
-            {
-            delete srcControl;
-            }
-        }
-    
     if(aType == KFileSourceControl)
         {
         CClientFileSource* srcControl = new CClientFileSource;
--- a/mmfenh/enhancedmediaclient/Client/src/Components/ControlFactory/ControlFactoryImpl.h	Mon May 03 12:59:52 2010 +0300
+++ b/mmfenh/enhancedmediaclient/Client/src/Components/ControlFactory/ControlFactoryImpl.h	Fri May 14 16:22:35 2010 +0300
@@ -30,7 +30,6 @@
     class MDataBuffer;
     class MSinkControl;
     class CMultimediaFactoryImpl;
-    class CDownloadGateway;
     
     /**
     *  Implements the MultimediaFactor Implementation
@@ -131,10 +130,6 @@
             CMultimediaFactoryImpl();
             void ConstructL();
                 
-        private:
-            // Pointer to the Download Gateway.
-            CDownloadGateway* iGateway;
-                        
         };
     } // namespace multimedia
 
--- a/mmfenh/enhancedmediaclient/Client/src/Components/StreamControl/ClientStreamControl.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmfenh/enhancedmediaclient/Client/src/Components/StreamControl/ClientStreamControl.cpp	Fri May 14 16:22:35 2010 +0300
@@ -22,7 +22,6 @@
 #include <EffectControl.h>
 #include <SinkControl.h>
 #include <SourceControl.h>
-#include <ProgDLSource.h>
 #include <FileSource.h>
 #include <DescriptorSource.h>
 #include <SCCustomInterfaceUIDs.h>
@@ -778,53 +777,6 @@
                 }
             }
         }
-    else
-        if (iSourceControl->Type() == KProgDLSourceControl)
-            {
-            MProgDLSource* progDLSource =
-                    static_cast<MProgDLSource*>(iSourceControl);
-            HBufC* fileName = HBufC::NewLC(KMaxPath);
-            TPtr fileNamePtr = fileName->Des();
-
-            TInt err = progDLSource->FileName(fileNamePtr);
-
-            HBufC8* mimeType = HBufC8::NewLC(KMaxMimeLength);
-            TPtr8 mimeTypePtr = mimeType->Des();
-
-            status = iSourceControl->GetMimeType(mimeTypePtr);
-
-            iFindAndOpenController->ConfigureSourceSink(
-                    TMMFileSource(fileNamePtr,
-                            ContentAccess::KDefaultContentObject,
-                            ContentAccess::EPlay),
-                    CMMFFindAndOpenController::TSourceSink(/*KUidMmfAudioOutput*/sinkUID/*,fileHandle*/));
-
-            TMMFileSource source(fileNamePtr,
-                    ContentAccess::KDefaultContentObject,
-                    ContentAccess::EPlay);
-
-            // This Flag is defined so that if the Helix Controller Supports
-            // the playback of Local Media for WMA, then the Progressive Download
-            //  for WMA still goes through the Old WMA Controller( AdvancedAudioController)
-            // We are launching the Old WMA Controller using the UID.                
-
-#ifdef __WINDOWS_MEDIA        
-#ifndef RD_PD_FOR_AUDIO_CONTENT_VIA_HELIX_ENGINE       
-            if(!mimeTypePtr.Compare(KWMAMimeType()))
-                {
-                iFindAndOpenController->OpenByControllerUid(TUid::Uid(0x10207A9B),KNullUid);
-                }
-            else
-#endif        
-#endif
-                {
-                iFindAndOpenController->OpenByFileSource(source);
-                }
-
-            CleanupStack::PopAndDestroy(mimeType); // mimeType
-            CleanupStack::PopAndDestroy(fileName); // fileName
-            //fileHandle.Close();
-            }
 
     if (iSourceControl->Type() == KFileSourceControl)
         {
--- a/mmfenh/enhancedmediaclient/Client/src/Components/StreamControl/ClientUtility.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmfenh/enhancedmediaclient/Client/src/Components/StreamControl/ClientUtility.cpp	Fri May 14 16:22:35 2010 +0300
@@ -12,7 +12,7 @@
 * Contributors:
 *
 * Description:  Definition of the ClientUtility class.
-*  Version     : %version: bh1mmcf#11 %
+*  Version     : %version: 12 %
 *
 */
 
@@ -27,7 +27,6 @@
 #include <StreamControlCustomCommands.h>
 #include <mmf/server/mmfdrmpluginserverproxy.h>
 #include "../../../Plugins/FileSource/inc/FileDataSourceUid.hrh"
-#include "../../../Plugins/ProgDLSource/inc/ProgDLSourceUid.hrh"
 using namespace ContentAccess;
 using namespace multimedia;
 
@@ -2296,7 +2295,7 @@
     //need to proceed only in case of local playback mode
     TUid sourceUid = iCurrentConfig->iSource->SourceSinkUid();
     TBool localPlaybackMode;
-	if( mode == EPlayback && ( sourceUid.iUid == KFileDataSourcePlugin || sourceUid.iUid == KMmfProgDLSourceUid ) )
+	if( mode == EPlayback && ( sourceUid.iUid == KFileDataSourcePlugin ) )
 		{
 		localPlaybackMode = ETrue;
 		}
--- a/mmfenh/enhancedmediaclient/Plugins/FileSource/group/FileSource.mmp	Mon May 03 12:59:52 2010 +0300
+++ b/mmfenh/enhancedmediaclient/Plugins/FileSource/group/FileSource.mmp	Fri May 14 16:22:35 2010 +0300
@@ -58,7 +58,6 @@
 LIBRARY         mmfserverbaseclasses.lib
 LIBRARY         caf.lib
 LIBRARY	        cafutils.lib
-LIBRARY         TransferRateMonitor.lib
 LIBRARY         centralrepository.lib
 
 DEFFILE         FileSource.def
--- a/mmfenh/enhancedmediaclient/Plugins/MultimediaDataSource/DataSourceFactory/group/MultimediaDataSourceFactory.mmp	Mon May 03 12:59:52 2010 +0300
+++ b/mmfenh/enhancedmediaclient/Plugins/MultimediaDataSource/DataSourceFactory/group/MultimediaDataSourceFactory.mmp	Fri May 14 16:22:35 2010 +0300
@@ -31,7 +31,6 @@
 
 USERINCLUDE     ../inc
 USERINCLUDE	    ../../../../../../inc
-USERINCLUDE     ../../../ProgDLSource/inc
 USERINCLUDE     ../../../MultimediaDataSource/inc
 USERINCLUDE     ../../../DataBufferSource/inc
 USERINCLUDE     ../../../FileSource/inc
@@ -52,7 +51,6 @@
 LIBRARY         DataBufferSource.lib
 LIBRARY         DescriptorDataSource.lib
 LIBRARY         FileSource.lib
-LIBRARY         ProgDLSource.lib
 
 DEFFILE         MMDataSourceFactory.def
 NOSTRICTDEF
--- a/mmfenh/enhancedmediaclient/Plugins/MultimediaDataSource/DataSourceFactory/src/MultimediaDataSourceFactory.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmfenh/enhancedmediaclient/Plugins/MultimediaDataSource/DataSourceFactory/src/MultimediaDataSourceFactory.cpp	Fri May 14 16:22:35 2010 +0300
@@ -18,9 +18,7 @@
 
 #include <MultimediaDataSourceFactory.h>
 #include "DataBufferSourceUid.h"
-#include "ProgDLSourceUid.h"
 #include "DataBufferDataSource.h"
-#include "ProgDLMultimediaSource.h"  
 #include "FileDataSource.h"
 #include "DescriptorDataSource.h"
 #include "CacheSource.h"
@@ -39,10 +37,6 @@
         {
         TRAP(status,aMultimediaDataSource  = CDataBufferMultimediaSource::NewL(aMDataSource));
         }
-    else if ( aMDataSource.DataSourceType() == KMmfProgDLSource )
-        {
-        TRAP(status,aMultimediaDataSource  = CProgDLMultimediaSource::NewL(aMDataSource));
-        }        
     else if ( aMDataSource.DataSourceType() == KFileDataSourcePlugin )
         {
         TRAP(status,aMultimediaDataSource  = CFileMultimediaSource::NewL(aMDataSource));
@@ -71,15 +65,6 @@
         	TRAP(status,aMultimediaDataSource = CCacheSource::NewL(dataBufferSource,config));
         	}
         } 
-    else if ( aMDataSource.DataSourceType() == KMmfProgDLSource )
-        {
-        aMultimediaDataSource  = CProgDLMultimediaSource::NewL(aMDataSource);
-        TRAP(status,config =  CDataSourceConfigIntfcImpl::NewL());           
-		if(status == KErrNone)	        
-	        {
-        	aDataSourceConfigIntfc = config;
-	        }
-        } 
     return status;
     }
 // End of file
--- a/mmfenh/enhancedmediaclient/Plugins/ProgDLSource/bwins/ProgDLSource.def	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-EXPORTS
-	?ImplementationGroupProxy@@YAPBUTImplementationProxy@@AAH@Z @ 1 NONAME ; struct TImplementationProxy const * ImplementationGroupProxy(int &)
-	?NewL@CProgDLMultimediaSource@@SAPAV1@AAVMDataSource@@@Z @ 2 NONAME ; class CProgDLMultimediaSource * CProgDLMultimediaSource::NewL(class MDataSource &)
-
--- a/mmfenh/enhancedmediaclient/Plugins/ProgDLSource/data/10207B45.rss	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
-* Copyright (c) 1020 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Resource file of ProgDLSource.
-*
-*/
-
-
-#include "ProgDLSourceUid.hrh"
-#include <mmfplugininterfaceuids.hrh>
-#include <registryinfo.rh>
-
-
-RESOURCE REGISTRY_INFO theInfo
-    {
-    dll_uid = 0x10207B45; //The DLL's 3rd UID.
-    interfaces = 
-        {
-        INTERFACE_INFO
-            {
-            interface_uid = KMmfUidPluginInterfaceDataSource; //ECOM UID for a Transport Adapter plug-in
-            implementations = 
-                {
-                // This DLL contains only a single adapter implementation.
-                IMPLEMENTATION_INFO
-                    {
-                    implementation_uid = KMmfProgDLSourceUid; //UID for this Adapter
-                    version_no = 1;
-                    display_name = "Progressive Download Source"; //Human readable string for UI purposes.
-                    default_data = ""; //Not used.
-                    opaque_data = ""; //Not used.
-                    }
-                };
-            }
-        };
-    }
-
--- a/mmfenh/enhancedmediaclient/Plugins/ProgDLSource/eabi/ProgDLSource.def	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-EXPORTS
-	_Z24ImplementationGroupProxyRi @ 1 NONAME
-	_ZN23CProgDLMultimediaSource4NewLER11MDataSource @ 2 NONAME
-	_ZTI12CContentFile @ 3 NONAME ; #<TI>#
-	_ZTI12CReadRequest @ 4 NONAME ; #<TI>#
-	_ZTI13CProgDLSource @ 5 NONAME ; #<TI>#
-	_ZTI14CSinkQueueItem @ 6 NONAME ; #<TI>#
-	_ZTI17CReadWriteRequest @ 7 NONAME ; #<TI>#
-	_ZTI23CProgDLMultimediaSource @ 8 NONAME ; #<TI>#
-	_ZTI8CF32File @ 9 NONAME ; #<TI>#
-	_ZTV12CContentFile @ 10 NONAME ; #<VT>#
-	_ZTV12CReadRequest @ 11 NONAME ; #<VT>#
-	_ZTV13CProgDLSource @ 12 NONAME ; #<VT>#
-	_ZTV14CSinkQueueItem @ 13 NONAME ; #<VT>#
-	_ZTV17CReadWriteRequest @ 14 NONAME ; #<VT>#
-	_ZTV23CProgDLMultimediaSource @ 15 NONAME ; #<VT>#
-	_ZTV8CF32File @ 16 NONAME ; #<VT>#
-
--- a/mmfenh/enhancedmediaclient/Plugins/ProgDLSource/group/ProgDLSource.mmp	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +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:  Project file for EnhancedMediaClient Utility
-*
-*/
-
-
-#include <data_caging_paths.hrh>
-#include <platform_paths.hrh>
-
-TARGET          ProgDLSource.dll
-TARGETTYPE      PLUGIN
-UID             0x10009D8D 0x10207B45
-
-CAPABILITY      CAP_ECOM_PLUGIN
-VENDORID        VID_DEFAULT
-
-TARGETPATH      /System/Libs/Plugins
-
-USERINCLUDE     ../inc
-USERINCLUDE      ../src
-USERINCLUDE	    ../../../../../inc
-
-MW_LAYER_SYSTEMINCLUDE
-SYSTEMINCLUDE   /epoc32/include/ecom
-SYSTEMINCLUDE   /epoc32/include/mmf/common
-SYSTEMINCLUDE   /epoc32/include/mmf/server
-
-SOURCEPATH      ../src
-
-SOURCE          Main.cpp
-SOURCE          fileaccess.cpp
-SOURCE          ProgDLSource.cpp
-SOURCE          SinkQueueItem.cpp
-
-SOURCEPATH      ../data
-
-START RESOURCE  10207B45.rss
-TARGET ProgDLSource.rsc
-END
-
-LIBRARY         euser.lib 
-LIBRARY         ecom.lib
-LIBRARY         efsrv.lib
-LIBRARY         mmfcontrollerframework.lib
-LIBRARY         estor.lib
-LIBRARY         mmfserverbaseclasses.lib
-LIBRARY         caf.lib
-LIBRARY	        cafutils.lib
-LIBRARY         TransferRateMonitor.lib
-LIBRARY         centralrepository.lib
-
-DEFFILE         ProgDLSource.def
-NOSTRICTDEF
--- a/mmfenh/enhancedmediaclient/Plugins/ProgDLSource/group/bld.inf	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +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:  Blf.inf file for the ProgDLSource Project
-*
-*/
-
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_EXPORTS
-
-PRJ_MMPFILES
-ProgDLSource.mmp
--- a/mmfenh/enhancedmediaclient/Plugins/ProgDLSource/inc/MmfFile.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,275 +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:  Header of ProgDLSource.
-*
-*/
-
-#ifndef __MMFFILE_H_
-#define __MMFFILE_H_
-
-#include <f32file.h>
-
-#include <mmf/server/mmfclip.h>
-#include <mmf/server/mmfdatabuffer.h>
-#include <mmf/common/mmcaf.h>
-
-class CReadWriteRequest;
-class CTransferBufferCopy;
-class MGenericFile;
-
-/**
-@publishedAll
-@released
-
-  Provides the filename and path of file. 
-  
-    Used by CMMFFile::ConstructL().
-*/
-class TMMFFileParams
-    {
-    public:
-    /**
-    Filename and path of file. 
-        */
-        TFileName iPath ; // Filename and path of file.
-    private:
-    /**
-    This member is internal and not intended for use.
-        */
-        TInt iReserved1;
-    };
-
-    /**
-    @internalTechnology	
-*/
-const TUid KFileHandleUid = {0x101FFA19};
-const TUid KMMFileSourceUid = {0x101F7DA9};
-const TUid KMMFileHandleSourceUid = {0x101F7DAA};
-
-/**
-@publishedAll
-@released
-
-  Provides a pointer to the file handle 
-  
-    Used by CMMFFile::ConstructL().
-*/
-class TMMFFileHandleParams
-    {
-    public:
-        TMMFFileHandleParams(RFile* aFile) : iUid(KFileHandleUid), iFile(aFile) {}
-        TMMFFileHandleParams() : iUid(KFileHandleUid) {}
-        
-        TUid iUid;
-        /**
-        Handle of file 
-        */
-        RFile* iFile;
-    private:
-    /**
-    This member is internal and not intended for use.
-        */
-        TInt iReserved1;
-    };
-
-
-
-
-    /**
-    @publishedAll
-    @released
-*/
-typedef TPckgBuf<TMMFFileParams>  TMMFFileConfig ;
-
-/**
-@publishedAll
-@released
-*/
-typedef TPckgBuf<TMMFFileHandleParams>  TMMFFileHandleConfig ;
-
-
-/**
-@publishedAll
-@released
-
-  This details how big the iTransferBufferCopies array of CMMFFile may
-  become before we start looking to free entries.
-*/
-const TInt KAcceptableTransferBufferCopiesSize = 5;
-
-/**
-@publishedAll
-@released
-
-  This details how big the iTransferBufferCopies array of CMMFFile may
-  become before we start looking to free entries.
-*/
-const TInt KMaximumTransferBufferCopiesSize = 100;
-
-
-/**
-@publishedAll
-@released
-
-  MultiMedia framework class.  Represents a physical file.
-  
-    This may be source file from which data is read or destination to which data is written.
-    
-      Intended to be used by controller plugin developers for source and sink plugins.
-*/
-class CMMFFile : public CMMFClip
-    {
-    public:
-        // From MDataSource
-        virtual TFourCC SourceDataTypeCode(TMediaId aMediaId) ;
-        virtual void FillBufferL( CMMFBuffer* aBuffer, MDataSink* aConsumer, TMediaId aMediaId ) ;
-        virtual void BufferEmptiedL( CMMFBuffer* aBuffer ) ;
-        virtual TBool CanCreateSourceBuffer() ;
-        virtual CMMFBuffer* CreateSourceBufferL( TMediaId aMediaId, TBool &aReference ) ;
-        virtual TInt SourceThreadLogon(MAsyncEventHandler& aEventHandler) ;
-        virtual void SourceThreadLogoff();
-        virtual void SourcePrimeL();
-        virtual void SourceStopL();
-        
-        // From MDataSink
-        virtual TFourCC SinkDataTypeCode(TMediaId aMediaId) ; //used by data path MDataSource/Sink for codec matching
-        virtual void EmptyBufferL( CMMFBuffer* aBuffer, MDataSource* aSupplier, TMediaId aMediaId ) ;
-        virtual void BufferFilledL( CMMFBuffer* aBuffer ) ;
-        virtual TBool CanCreateSinkBuffer() ;
-        virtual CMMFBuffer* CreateSinkBufferL( TMediaId aMediaId , TBool &aReference) ;
-        virtual TInt SinkThreadLogon(MAsyncEventHandler& aEventHandler) ;
-        virtual void SinkThreadLogoff();
-        virtual void SinkPrimeL();
-        virtual void SinkStopL();
-        
-        // From CMMFClip
-        virtual void ReadBufferL( TInt aLength, CMMFBuffer* aBuffer, TInt aPosition, MDataSink* aConsumer);
-        virtual void WriteBufferL( TInt aLength, CMMFBuffer* aBuffer, TInt aPosition, MDataSource* aSupplier);
-        virtual void ReadBufferL( CMMFBuffer* aBuffer, TInt aPosition, MDataSink* aConsumer) ;
-        virtual void WriteBufferL( CMMFBuffer* aBuffer, TInt aPosition, MDataSource* aSupplier) ;
-        virtual void ReadBufferL( CMMFBuffer* aBuffer, TInt aPosition ) ;
-        virtual void WriteBufferL( CMMFBuffer* aBuffer, TInt aPosition ) ;
-        virtual TInt64 BytesFree() ;  // amount of space available for the clip
-        virtual TInt Size() ;
-        virtual TInt Delete();
-        virtual TInt SetSize(TInt aSize);
-        
-        // New Functions
-        virtual const TDesC& FileName() const ;
-        virtual const TDesC& Extension() const ;
-        virtual const TDesC& FilePath() const ;
-        virtual const TDesC& FileDrive() const ;
-        virtual const TFileName FullName() const;
-        virtual RFile& FileL() ;
-        
-    public :
-        virtual ~CMMFFile() ;
-        static MDataSource* NewSourceL() ;
-        static MDataSink* NewSinkL() ;
-        
-        void SetTransferBuffer (TBool aTBuffer) ;
-        TBool CanUseTransferBuffer () ;
-        virtual TBool SinkStopped();
-        
-    protected:
-    /**
-    Indicates for which purpose the object instance is being created
-        */
-        enum TMMFileMode
-            {
-            /** The object is created for being a source */
-            ESourceMode,
-                /** The object is created for being a sink */
-                ESinkMode
-            };
-        virtual void ConstructSourceL( const TDesC8& aInitData ) ;
-        virtual void ConstructSinkL( const TDesC8& aInitData ) ;
-        void ConstructL(const TDesC8& aInitData, TMMFileMode aFileMode) ;
-        CMMFFile() ;
-        
-        void StoreRequestL( CReadWriteRequest* aRequest ) ;
-        void CancelRequests();
-        
-        
-        CTransferBufferCopy* ObtainCopyOfTransferBufferL(TInt aMaxLength);
-        
-    public:
-        // Additional virtuals for DRM Intent
-        virtual TInt ExecuteIntent(ContentAccess::TIntent aIntent);
-        virtual TInt EvaluateIntent(ContentAccess::TIntent aIntent) const;
-        virtual TBool IsProtectedL() const;
-        
-        virtual TInt SetAgentProperty(ContentAccess::TAgentProperty aProperty, TInt aValue); 
-        virtual const TDesC& UniqueId() const;
-        
-    private:
-        class CMMFFileAsyncEventHandler : public MAsyncEventHandler
-            {
-            public:
-                CMMFFileAsyncEventHandler(CMMFFile* aParent);
-                virtual ~CMMFFileAsyncEventHandler();
-            public:
-                virtual TInt SendEventToClient(const TMMFEvent& aEvent);
-            private:
-                CMMFFile* iParent;
-            };
-        
-        class CCAFParameters : public CBase
-            {
-            public:
-                CCAFParameters() : iUniqueId(NULL), iEnableUI(EFalse) {}
-                ~CCAFParameters() {	delete iUniqueId;	}
-            public:
-                HBufC* iUniqueId;
-                TBool iEnableUI;
-            };
-        
-            private:
-                MGenericFile* iFile;
-                RFs iFsSession;
-                
-                TBool iFileHandle;
-                RFile iHandle;
-                TBool iReserved;
-                
-                TBool iSinkNotStopped;
-                
-                TFileName iFullFileName ;
-                HBufC* iFileName ;
-                HBufC* iFileExt ;
-                HBufC* iFilePath ;
-                HBufC* iFileDrive ;
-                CCAFParameters* iCAFParameters;
-                TInt iFileSize; //holds the cached file size
-                
-                //Keeps track of the read position within the file. Needed in order to enable passing of the
-                //read position to the CReadRequest to manage the LastBuffer flag.
-                //NB: Continuous reads once EOF has been reached will result in iPosition going > iFileSize,
-                //but this causes no ill effects
-                TUint iPosition;
-                
-                TFourCC  iSinkFourCC ;
-                TFourCC  iSourceFourCC ;
-                
-                
-                RPointerArray<CReadWriteRequest> iRequests;
-                
-                MAsyncEventHandler *iEventHandler;
-                CMMFFileAsyncEventHandler* iMmfFileEventHandler;
-                
-                RPointerArray<CTransferBufferCopy> iTransferBufferCopies;
-                friend class CMMFFileAsyncEventHandler;
-    };
-    
-#endif
--- a/mmfenh/enhancedmediaclient/Plugins/ProgDLSource/inc/ProgDLDataSource.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,155 +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:  Header of ProgDLSource.
-*
-*/
-
-
-#ifndef __PROGDLDATASOURCE_H_
-#define __PROGDLDATASOURCE_H_
-
-
-#include <mmf/server/mmfdatasource.h> 
-#include <MultimediaDataSource.h> 
-#include <DataBufferSource.h> 
-
-class CSinkQueueItem;
-using multimedia::TBufferingConfig;
-/**
-@publishedAll
-@released
-
-Provides the filename and path of file. 
-
-Used by CProgDLMultimediaSource::ConstructL().
-*/
-class TMMFFileParams
-    {
-    public:
-    /**
-    Filename and path of file. 
-        */
-        TFileName iPath ; // Filename and path of file.
-    private:
-    /**
-    This member is internal and not intended for use.
-        */
-        TInt iReserved1;
-    };
-
-    /**
-    @internalTechnology	
-*/
-const TUid KFileHandleUid = {0x101FFA19};
-const TUid KMMFileSourceUid = {0x101F7DA9};
-const TUid KMMFileHandleSourceUid = {0x101F7DAA};
-
-/**
-@publishedAll
-@released
-
-  Provides a pointer to the file handle 
-  
-    Used by CProgDLMultimediaSource::ConstructL().
-*/
-class TMMFFileHandleParams
-    {
-    public:
-        TMMFFileHandleParams(RFile* aFile) : iUid(KFileHandleUid), iFile(aFile) {}
-        TMMFFileHandleParams() : iUid(KFileHandleUid) {}
-        
-        TUid iUid;
-        /**
-        Handle of file 
-        */
-        RFile* iFile;
-    private:
-    /**
-    This member is internal and not intended for use.
-        */
-        TInt iReserved1;
-    };
-
-
-
-
-    /**
-    @publishedAll
-    @released
-*/
-typedef TPckgBuf<TMMFFileParams>  TMMFFileConfig ;
-
-/**
-@publishedAll
-@released
-*/
-typedef TPckgBuf<TMMFFileHandleParams>  TMMFFileHandleConfig ;
-
-
-/**
-@publishedAll
-@released
-
-  This details how big the iTransferBufferCopies array of CProgDLMultimediaSource may
-  become before we start looking to free entries.
-*/
-const TInt KAcceptableTransferBufferCopiesSize = 5;
-
-/**
-@publishedAll
-@released
-
-  This details how big the iTransferBufferCopies array of CProgDLMultimediaSource may
-  become before we start looking to free entries.
-*/
-const TInt KMaximumTransferBufferCopiesSize = 100;
-
-class CProgDLMultimediaSource;
-
-class CProgDLSource : public MDataSource
-    {
-    public:
-        static CProgDLSource* NewL( TUid aType );
-		~CProgDLSource(void);        
-        // From MDataSource begins
-        TFourCC SourceDataTypeCode(TMediaId aMediaId) ;
-        void FillBufferL( CMMFBuffer* aBuffer, MDataSink* aConsumer, TMediaId aMediaId ) ;
-        void BufferEmptiedL( CMMFBuffer* aBuffer ) ;
-        TBool CanCreateSourceBuffer() ;
-        CMMFBuffer* CreateSourceBufferL( TMediaId aMediaId, TBool &aReference ) ;
-        TInt SourceThreadLogon(MAsyncEventHandler& aEventHandler) ;
-        void SourceThreadLogoff();
-        void SourcePrimeL();
-        void SourcePlayL();
-        void SourceStopL();
-        void SourceCustomCommand(TMMFMessage& aMessage);
-        void ConstructSourceL(const TDesC8 &aInitData);
-        TUid DataSourceType() const;
-        TInt SetSourceDataTypeCode(TFourCC aSourceFourCC, TMediaId /*aMediaId*/ );
-         // From MDataSource ends
-        
-        void SetMultimediaSource(CProgDLMultimediaSource& aMultimediaSource);
-        TDesC8& GetInitData();
-    private:
-        CProgDLSource(TUid aType);
-        
-        void ConstructL (void);
-    private:
-        //Data
-        CProgDLMultimediaSource* iMultiMediaSource; 
-        HBufC8* iInitData;       
- 
-    }; 
-    
-#endif
--- a/mmfenh/enhancedmediaclient/Plugins/ProgDLSource/inc/ProgDLMultimediaSource.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,223 +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:  Header of ProgDLMultimediaSource.
-*
-*/
-
-
-
-
-#ifndef __PROGDLMULTIMEDIASOURCE_H_
-#define __PROGDLMULTIMEDIASOURCE_H_
-
-
-#include <centralrepository.h>  
-
-class CReadWriteRequest;
-class CTransferBufferCopy;
-class MGenericFile;
-
-
-
-
-/**
-@publishedAll
-@released
-
-MultiMedia framework class.  Represents a physical file.
-This may be source file from which data is read or destination to which data is written.
-Intended to be used by controller plugin developers for source and sink plugins.*/
-
-class CProgDLMultimediaSource : public CMultimediaDataSource
-    {
-    public:
-        // From MDataSource
-        IMPORT_C static CProgDLMultimediaSource* NewL(MDataSource& aDataSource);
-        
-        // From CMultimediaDataSource begins
-        TInt SetObserver( MMultimediaDataSourceObserver& aObserver );
-        TInt GetObserver( MMultimediaDataSourceObserver*& aObserver );
-        void Event( TUid aEvent );
-        TInt SetDataTypeCode(TFourCC aSourceFourCC );
-        TInt GetDataTypeCode(TFourCC& aSourceFourCC );
-        TInt GetSize( TUint& aSize );
-        TInt Open();
-        TInt Close();
-        TInt Prime();
-        TInt Play();
-        TInt Stop();
-        TInt FillBuffer( CMMFBuffer* aBuffer);
-        TInt Seek( TUint aPosInBytes );
-        TInt GetSeekingSupport( TBool& aSeekSupport );
-        TInt GetRandomSeekingSupport( TBool& aSeekSupport );
-        // From CMultimediaDataSource ends
-        
-        TInt GetDRMProtection( TBool& aIsProtected );
-        TInt EvaluateIntent( ContentAccess::TIntent aIntent ) const;
-        TInt ExecuteIntent( ContentAccess::TIntent aIntent );
-        TInt SetAgentProperty( ContentAccess::TAgentProperty aProperty,
-            TInt aValue);
-        const TDesC& UniqueId() const;
-        // From MCustomInterface
-        TAny* CustomInterface( TUid aInterfaceUid );
-        void SourceCustomCommand(TMMFMessage& aMessage);
-
-        void FillBufferL( CMMFBuffer* aBuffer, MDataSink* aConsumer, TMediaId aMediaId ) ;
-        
-       
-    public :
-        virtual ~CProgDLMultimediaSource() ;
-        //	static MDataSource* NewSourceL(/*TUid aType*/) ;
-        
-        void SetTransferBuffer (TBool aTBuffer) ;
-        TBool CanUseTransferBuffer () ;
-        TInt ReadRequestStatus(CReadWriteRequest* aRequest,TRequestStatus& aStatus);
-        
-    protected:
-    /**
-    Indicates for which purpose the object instance is being created
-        */
-        enum TMMFileMode
-            {
-            /** The object is created for being a source */
-            ESourceMode,
-                /** The object is created for being a sink */
-                ESinkMode
-            };
-
-        void ConstructL(const TDesC8& aInitData, TMMFileMode aFileMode) ;
-        void ConstructL();
-        CProgDLMultimediaSource(MDataSource& aDataSource);
-        
-        void StoreRequestL( CReadWriteRequest* aRequest ) ;
-        void CancelRequests();
-        
-        TInt EmptySinkQueue();
-        CTransferBufferCopy* ObtainCopyOfTransferBufferL(TInt aMaxLength);
-        
-        // Calculate BufferedDataSize
-        void CalculateBufferedDataSize();
-        void StateChanged(TState newState);
-        
-        // A common function that implements FillBuffer requests
-        TInt AppendBufferToSinkQueue( CMMFBuffer* aBuffer,
-            MMultimediaDataSourceObserver* aObserver,
-            MDataSink* aConsumer,TBool aTop);
-
-        TInt ServiceFillBuffer();
-    private:
-        
-        // New Functions
-        const TDesC& FileName() const ;
-        const TDesC& Extension() const ;
-        const TDesC& FilePath() const ;
-        const TDesC& FileDrive() const ;
-        const TFileName FullName() const;
-        RFile& FileL() ;
-        
-    private:
-        class CProgDLMultimediaSourceAsyncEventHandler : public MAsyncEventHandler
-            {
-            public:
-                CProgDLMultimediaSourceAsyncEventHandler(CProgDLMultimediaSource* aParent);
-                virtual ~CProgDLMultimediaSourceAsyncEventHandler();
-            public:
-                virtual TInt SendEventToClient(const TMMFEvent& aEvent);
-            private:
-                CProgDLMultimediaSource* iParent;
-            };
-        
-        class CCAFParameters : public CBase
-            {
-            public:
-                CCAFParameters() : iUniqueId(NULL), iEnableUI(EFalse) {}
-                ~CCAFParameters() {	delete iUniqueId;	}
-            public:
-                HBufC* iUniqueId;
-                TBool iEnableUI;
-            };
-        
-        void GetAudioConfiguration();
-        TInt ReOpenCAF();
-        
-    private:
-        MGenericFile* iFile;
-        RFs iFsSession;
-        
-        TBool iFileHandle;
-        RFile iHandle;
-        TBool iReserved;
-        
-        TFileName iFullFileName ;
-        HBufC* iFileName ;
-        HBufC* iFileExt ;
-        HBufC* iFilePath ;
-        HBufC* iFileDrive ;
-        CCAFParameters* iCAFParameters;
-        
-        
-        
-        
-        
-        TFourCC  iSinkFourCC ;
-        TFourCC  iSourceFourCC ;
-        
-        // Queue of buffers from controller
-        TSglQue<CSinkQueueItem>* iSinkQueue;
-        //MDataSink* iConsumer;
-        // Sink item Counter
-        TInt iSnkItemsCount;
-        // Observer bit rate in bps
-        //Keeps track of the read position within the file. Needed in order to enable passing of the
-        //read position to the CReadRequest to manage the LastBuffer flag.
-        //NB: Continuous reads once EOF has been reached will result in iPosition going > iDLFileSize,
-        //but this causes no ill effects
-        TUint iSnkBytes;
-        
-        TInt iDownloadSize;
-        
-        // Transfer bit rate in bps
-        TUint   iTransferRate;  
-        
-        TUint   iObserverBitRate;
-        
-        // Buffering size in bytes
-        TUint   iBufferedDataSize;
-        
-        TInt iDLFileSize; //holds the cached file size
-        TMMFMessage* iMessage;
-        
-        MMultimediaDataSourceObserver* iObserver;
-        RPointerArray<CReadWriteRequest> iRequests;
-        
-        MAsyncEventHandler *iEventHandler;
-        
-        RPointerArray<CTransferBufferCopy> iTransferBufferCopies;
-        TBool   isDownloadComplete;
-        
-        TBool iReOpenCAF;
-        
-        TInt iFileSize;
-
-        // Pointer to the Preset Repository
-		CRepository* iAudioConfigRepository;
-        TBufferingConfig iPrimaryBufferingConfig;
-        TBufferingConfig iSecondaryBufferingConfig;
-        TUint iInitialBufferingPercentage;
-        TInt iReadRequestPending;
-        MDataSource* iParentDataSource;
-        HBufC8* iInitData;           
-    };
-    
-#endif
--- a/mmfenh/enhancedmediaclient/Plugins/ProgDLSource/inc/ProgDLSourceCustomCommands.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +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:  Definition of the S60 ProgDL custom command msg codes.
-*
-*/
-
-
-#ifndef PROGDLSOURCECUSTOMCOMMANDS_H
-#define PROGDLSOURCECUSTOMCOMMANDS_H
-
-enum TProgDLSourceCC
-    {
-        EDownloadRate = 1,
-        ESetDownloadSize,
-        ESetActualSize,
-        EGetSourceState,
-        ESetDownloadState,
-        EGetBitRate,
-        EGetPercentageBuffered,
-        ESetUpdateFileName
-    };
-
-#endif // PROGDLSOURCECUSTOMCOMMANDS_H
-
-//  End of File
--- a/mmfenh/enhancedmediaclient/Plugins/ProgDLSource/inc/ProgDLSourceUid.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +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:  Contains the SourceUid for ProgDL Source
-*
-*/
-
-
-#ifndef PROGDLSOURCEUID_H
-#define PROGDLSOURCEUID_H
-
-#include "ProgDLSourceUid.hrh"
-
-// This is the ECOM Interface UID for the streaming source and DataSourceType
-// for Streaming Data Source.
-
-const TUid KMmfProgDLSource = {KMmfProgDLSourceUid};
-
-#endif // PROGDLSOURCEUID_H
-
-// End of file
--- a/mmfenh/enhancedmediaclient/Plugins/ProgDLSource/inc/ProgDLSourceUid.hrh	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +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:  Contains the SourceUid for ProgDL Source
-*
-*/
-
-
-#ifndef PROGDLSOURCEUID_HRH
-#define PROGDLSOURCEUID_HRH
-
-
-// These are the ECOM Interface UIDs for the prog dl source
-
-#define KMmfProgDLSourceUid                   0x10207B46
-
-#endif // PROGDLSOURCEUID_HRH
-
-// End of file
--- a/mmfenh/enhancedmediaclient/Plugins/ProgDLSource/src/FileAccess.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,143 +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:  Header of FileAccess Classes.
-*
-*/
-
-#ifndef __FILE_ACCESS_H__
-#define __FILE_ACCESS_H__
-
-#include <caf/content.h>
-#include <caf/data.h>
-#include <mmf/common/mmcaf.h>
-
-// Abstract class providing generic file access
-class MGenericFile
-    {
-    public:
-        virtual ~MGenericFile();
-        
-        virtual TInt Seek(TSeek aSeekMode, TInt aPosition)=0;
-        virtual TInt Read(TDes8& aDes,TInt aLength)=0;
-        virtual void Read(TDes8& aDes, TInt aLength, TRequestStatus& aStatus)=0;
-        
-        virtual TInt Write(const TDesC8& aDes,TInt aLength)=0;
-        virtual void Write(const TDesC8& aDes, TInt aLength, TRequestStatus& aStatus)=0;
-        
-        virtual TInt Size(TInt& aSize)=0;
-        virtual TInt SetSize(TInt aSize)=0;
-        
-        virtual TInt EvaluateIntent(const ContentAccess::TIntent aIntent) const = 0;
-        virtual TInt ExecuteIntent(const ContentAccess::TIntent aIntent) = 0;
-        virtual TBool IsProtected()const = 0;
-        
-        // legacy file support
-        virtual RFile& FileL()=0;
-        
-        virtual TInt SetAgentProperty(ContentAccess::TAgentProperty aProperty, TInt aValue) = 0;
-        
-    };
-
-// Provide RFile based file access
-class CF32File : public CBase, public MGenericFile
-    {
-    public:
-        static CF32File* NewL(RFs& aSession, TDesC& aPath, TUint aMode);	
-        static CF32File* NewL(RFile& aFile);	
-        void ConstructL(RFile& aFile);
-        void ConstructL(RFs& aSession, TDesC& aPath, TUint aMode);
-        
-        virtual ~CF32File();
-        
-        // from MGenericFile
-        virtual TInt Seek(TSeek aSeekMode, TInt aPosition);
-        virtual TInt Read(TDes8& aDes,TInt aLength);
-        virtual void Read(TDes8& aDes, TInt aLength, TRequestStatus& aStatus);
-        virtual TInt Write(const TDesC8& aDes,TInt aLength);
-        virtual void Write(const TDesC8& aDes, TInt aLength, TRequestStatus& aStatus);
-        virtual TInt Size(TInt& aSize);
-        virtual TInt SetSize(TInt aSize);
-        virtual TInt EvaluateIntent(const ContentAccess::TIntent aIntent) const;
-        virtual TInt ExecuteIntent(const ContentAccess::TIntent aIntent);
-        virtual TBool IsProtected() const;
-        virtual RFile& FileL();
-        
-        virtual TInt SetAgentProperty(ContentAccess::TAgentProperty, TInt aValue);
-        
-    private:
-        CF32File();
-        
-    private:
-        RFs* iSession;	// not owned
-        HBufC* iFilePath;
-        RFile iFile;
-        
-        TBool iFileHandle;
-        TInt iFileSize;
-    };
-
-// Provides content access framework based file access
-class CContentFile : public CBase, public MGenericFile
-    {
-    public:
-        static CContentFile* NewL(RFs& aSession, const TDesC& aPath, const TDesC& aUniqueId, TUint aMode, TBool aEnableUI);
-        void ConstructL(RFs& aSession, const TDesC& aPath, const TDesC& aUniqueId, TUint aMode, TBool aEnableUI);
-        
-        static CContentFile* NewL(RFile& aFile, const TDesC& aUniqueId, TBool aEnableUI);
-        void ConstructL(RFile& aFile, const TDesC& aUniqueId, TBool aEnableUI);
-        
-        virtual ~CContentFile();
-        
-        // from MGenericFile
-        virtual TInt Seek(TSeek aSeekMode, TInt aPosition);
-        virtual TInt Read(TDes8& aDes,TInt aLength);
-        virtual void Read(TDes8& aDes, TInt aLength, TRequestStatus& aStatus);
-        virtual TInt Write(const TDesC8& aDes,TInt aLength);
-        virtual void Write(const TDesC8& aDes, TInt aLength, TRequestStatus& aStatus);
-        virtual TInt Size(TInt& aSize);
-        virtual TInt SetSize(TInt aSize);
-        virtual TInt EvaluateIntent(const ContentAccess::TIntent aIntent) const;
-        virtual TInt ExecuteIntent(const ContentAccess::TIntent aIntent);
-        virtual TBool IsProtected() const;
-        virtual RFile& FileL();
-        
-        virtual TInt SetAgentProperty(ContentAccess::TAgentProperty, TInt aValue);
-        
-    private:
-        CContentFile();
-        
-        
-    private:
-        RFs* iSession; // not owned
-        HBufC* iFilePath;
-        ContentAccess::CData* iData;
-        
-        RFile iLegacyFile;
-        TBool iLegacyFileOpen;
-    };
-
-
-inline CF32File::CF32File() 
-    {
-    }
-
-inline CContentFile::CContentFile() 
-    {
-    }
-
-inline MGenericFile::~MGenericFile()
-    {
-    }
-
-#endif //__FILE_ACCESS_H__
--- a/mmfenh/enhancedmediaclient/Plugins/ProgDLSource/src/Main.cpp	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +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:  Implementation of ProgDLSource.
-*
-*/
-
-
-#include <implementationproxy.h> // ECom
-#include "ProgDLDataSource.h"
-#include "ProgDLSourceUid.h"
-
-// __________________________________________________________________________
-// Exported proxy for instantiation method resolution
-// Define the interface UIDs
-
-
-const TImplementationProxy ImplementationTable[] =
-    {
-    IMPLEMENTATION_PROXY_ENTRY(KMmfProgDLSourceUid, CProgDLSource::NewL)
-    };
-
-EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
-    {
-    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
-    
-    return ImplementationTable;
-    }
-
-// End of file
--- a/mmfenh/enhancedmediaclient/Plugins/ProgDLSource/src/MmffilePriv.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,172 +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:  Header of TransferBuffer.
-*
-*/
-
-
-#ifndef __MMFFILEPRIV_H_
-#define __MMFFILEPRIV_H_
-
-#include <f32file.h>
-
-#include <mmf/server/mmfclip.h>
-#include <mmf/server/mmfdatabuffer.h>
-
-/**
-*  @publishedAll
-*
-*  Represents a copy of a KUidMmfTransferBuffer used for reading/writting to the file server
-*/
-
-class CTransferBufferCopy : public CBase
-    {
-    public:
-        static CTransferBufferCopy* NewL(TInt aMaxLength);
-        
-        virtual ~CTransferBufferCopy()
-            {delete iBuffer;}
-        
-        
-        TDes8& Des() {return iBufferDes;}
-        
-        TInt MaxLength() {return iBufferDes.MaxLength();}
-        
-        void ReUse(TInt aMaxLength) {iBufferDes.Set(iBuffer,0, Min(aMaxLength, iMaxLength));}
-        
-        TBool InUse() {return iInUse;}
-        
-        void SetInUse(TBool aInUse) {iInUse=aInUse;}
-        
-    private:
-        CTransferBufferCopy(TInt aMaxLength) : CBase(), iMaxLength(aMaxLength), iBufferDes(0,0,0), iInUse(EFalse){}
-        
-        void ConstructL();
-        
-    private:
-        TUint8*	iBuffer;
-        
-        //Holds the original MaxLength when class constructed. 
-        //May be larger than MaxLength of iBufferDes
-        TInt	iMaxLength;
-        
-        TPtr8	iBufferDes;
-        
-        TBool	iInUse;
-    };
-
-
-
-
-    /**
-    * @internalComponent
-    *
-    * A request is created when an external object requests or supplies data.  Calls to the File Server are
-    * made asynchronously and a CReadWriteRequest created to notify the caller on completion.
-    *
-    * CReadWriteRequest is an abstract class.  Concrete instances are of CReadRequest & CWriteRequest.
-    * Concrete instances need to know whether to call MDataSink::BufferFilledL() or MDataSource::BufferEmptiedL()
-*/
-class CReadWriteRequest : public CActive
-    {
-    public:
-        CReadWriteRequest(TAny* aSinkOrSource, CMMFBuffer* aBuffer,TBool aSourceType)
-            : CActive(EPriorityStandard),
-            iSinkOrSource(aSinkOrSource), 
-            iBuffer(aBuffer),
-            iSourceType(aSourceType)
-            {
-            CActiveScheduler::Add( this );
-            }
-        
-        CReadWriteRequest(TAny* aSinkOrSource, CMMFBuffer* aBuffer, CTransferBufferCopy* aOptionalDataBuffer,TBool aSourceType)
-            : CActive(EPriorityStandard),
-            iSinkOrSource(aSinkOrSource), 
-            iBuffer(aBuffer),
-            iSourceType(aSourceType),
-            iTransferBufferCopy(aOptionalDataBuffer)
-            {
-            CActiveScheduler::Add( this );
-            iTransferBufferCopy->SetInUse(ETrue);
-            }
-        
-        CReadWriteRequest(CReadWriteRequest& aRequest)
-            : CActive(EPriorityStandard),
-            iSinkOrSource(aRequest.iSinkOrSource),
-            iBuffer(aRequest.iBuffer),
-            iSourceType(aRequest.iSourceType),
-            iTransferBufferCopy(aRequest.iTransferBufferCopy)
-            {
-            CActiveScheduler::Add( this );
-            iTransferBufferCopy->SetInUse(ETrue);
-            }
-        
-        
-        TBool Completed() ;
-        TInt SetStatus(TBool aStatus);
-        TDes8& BufferDes() ;
-        TBool SourceType();
-        const TDesC8& BufferDesC() ;
-        CMMFBuffer* Buffer();
-        TAny* GetSinkOrSource();
-        ~CReadWriteRequest() ;
-        
-        
-        // CActive functions.
-        // 
-        void SetActive() ;
-        void DoCancel() ;
-        virtual void RunL() = 0 ;
-        virtual TInt RunError( TInt aError ) ;
-        
-        
-    protected :
-        TAny* iSinkOrSource;
-        CMMFBuffer* iBuffer;
-        TBool iSourceType;
-        CTransferBufferCopy* iTransferBufferCopy;
-        
-        TBool iCompleted ;
-        TDes8* iBufferDes ;
-        TInt iError ;
-        TBool iUseTransferBuffer ;
-        void SetTransferBuffer (TBool aTBuffer) ;
-        TBool CanUseTransferBuffer () ;
-    } ;
-
-    /**
-    * @internalComponent
-*/
-class CReadRequest : public CReadWriteRequest
-    {
-    public :
-        CReadRequest(TAny* aParent,TAny* aSinkOrSource, CMMFBuffer* aBuffer, TUint aPosition, TUint aFileSize,TBool aSourceType)
-            : CReadWriteRequest(aSinkOrSource, aBuffer,aSourceType),
-            iPosition(aPosition), iFileSize(aFileSize),iParent(aParent)
-            { } 
-        
-        CReadRequest(TAny* aParent,TAny* aSinkOrSource, CMMFBuffer* aBuffer, CTransferBufferCopy* aOptionalDataBuffer, TUint aPosition, TUint aFileSize,TBool aSourceType)
-            : CReadWriteRequest(aSinkOrSource, aBuffer, aOptionalDataBuffer,aSourceType),
-            iPosition(aPosition), iFileSize(aFileSize),iParent(aParent)
-            { } 
-        
-        void RunL();
-    private:
-        TUint iPosition;
-        TUint iFileSize;
-        TAny* iParent;
-    };
-
-#endif
-
--- a/mmfenh/enhancedmediaclient/Plugins/ProgDLSource/src/ProgDLSource.cpp	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1803 +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:  Implementation of ProgDLSource.
-*
-*/
-
-
-#include <f32file.h>
-#include <e32std.h>
-#include <mmfdatabuffer.h>
-#include <mmfutilities.h>
-#include <mmf/common/mmfcontroller.h>
-#include <mmfpaniccodes.h>
-#include "ProgDLDataSource.h"
-#include "ProgDLMultimediaSource.h"
-#include "MmffilePriv.h"
-#include "FileAccess.h"
-#include "SinkQueueItem.h"
-#include "ProgDLSourceCustomCommands.h"
-#include <MultimediaDataSourceEvents.h>
-#include "ProgDLSourceUid.h"
-#include "AudioConfigurationPrivateCRKeys.h"
-
-#ifdef _DEBUG
-#define DEBPRN1(str)        RDebug::Print(str);
-#define DEBPRN2(str, val1)   RDebug::Print(str, val1);
-#define DEBPRN3(str, val1, val2)   RDebug::Print(str, val1, val2);
-#define DEBPRN4(str, val1, val2, val3)   RDebug::Print(str, val1, val2, val3);
-#define DEBPRN5(str, val1, val2, val3, val4)   RDebug::Print(str, val1, val2, val3, val4);
-#else
-#define DEBPRN1(str)
-#define DEBPRN2(str, val1)
-#define DEBPRN3(str, val1, val2)
-#define DEBPRN4(str, val1, val2, val3)
-#define DEBPRN5(str, val1, val2, val3, val4)
-#endif // _DEBUG
-
-const TUint KMinPlaybackDuration = 15; // 15 second
-
-void Panic(TMMFFilePanicCode aPanicCode)
-    {
-    _LIT(KMMFFilePanicCategory, "MMFFile");
-    User::Panic(KMMFFilePanicCategory, aPanicCode);
-    }
-
-    /**
-    * Constructs a CTransferBufferCopy
-    *
-    * @return CTransferBufferCopy*
-*/
-CTransferBufferCopy* CTransferBufferCopy::NewL(TInt aMaxLength)
-    {
-    CTransferBufferCopy* self = new (ELeave) CTransferBufferCopy(aMaxLength);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-    /**
-    * Second phase constructor for CTransferBufferCopy
-    *
-    * @return void
-*/
-void CTransferBufferCopy::ConstructL()
-    {
-    iBuffer = static_cast<TUint8*>(User::AllocL(iMaxLength));
-    iBufferDes.Set(iBuffer,0,iMaxLength);
-    }
-
-/************************/
-CProgDLSource* CProgDLSource::NewL(TUid aType )
-    {
-    DEBPRN1(_L("CProgDLSource::NewL"));
-    CProgDLSource* self = new (ELeave) CProgDLSource(aType);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-CProgDLSource::CProgDLSource(TUid aType)
-: MDataSource(aType)
-    {
-    iInitData = NULL;
-    }
-
-CProgDLSource::~CProgDLSource(void)
-    {
-    delete iInitData;
-    iInitData = NULL;        
-    }
-
-void CProgDLSource::ConstructL (void)
-    {
-    }
-
-// From MDataSource begins
-TUid CProgDLSource::DataSourceType() const
-    {
-    return KMmfProgDLSource;
-    }
-
-
-TFourCC CProgDLSource::SourceDataTypeCode(TMediaId /*aMediaId*/ )
-    {
-    TFourCC fourCC;        
-    return iMultiMediaSource->GetDataTypeCode(fourCC);
-    }
-
-TInt CProgDLSource::SetSourceDataTypeCode(TFourCC aSourceFourCC,
-                                                  TMediaId /*aMediaId*/ )
-    {
-    iMultiMediaSource->SetDataTypeCode(aSourceFourCC);
-    return KErrNone;
-    }
-
-void CProgDLSource::FillBufferL(CMMFBuffer* aBuffer,
-                                        MDataSink* aConsumer,
-                                        TMediaId aMediaId )
-    {
-    iMultiMediaSource->FillBufferL(aBuffer,aConsumer,aMediaId);
-    }
-
-void CProgDLSource::BufferEmptiedL(CMMFBuffer* /*aBuffer*/ )
-    {
-    User::Leave(KErrUnknown);
-    }
-
-TBool CProgDLSource::CanCreateSourceBuffer()
-    {
-    return EFalse;
-    }
-
-CMMFBuffer* CProgDLSource::CreateSourceBufferL(TMediaId /*aMediaId*/,
-                                                       TBool &/*aReference*/ )
-    {
-    return NULL;
-    }
-
-TInt CProgDLSource::SourceThreadLogon( MAsyncEventHandler& /*aEventHandler*/ )
-    {
-    return iMultiMediaSource->Open();
-    }
-
-void CProgDLSource::SourceThreadLogoff()
-    {
-    iMultiMediaSource->Close();
-    }
-
-void CProgDLSource::SourcePrimeL()
-    {
-    DEBPRN1(_L("CProgDLSource::SourcePrimeL"));
-    User::LeaveIfError(iMultiMediaSource->Prime());
-    }
-
-void CProgDLSource::SourcePlayL()
-    {
-    DEBPRN1(_L("CProgDLSource::SourcePlayL"));
-    User::LeaveIfError(iMultiMediaSource->Play());
-    }
-
-void CProgDLSource::SourceStopL()
-    {
-    DEBPRN1(_L("CProgDLSource::SourceStopL"));
-    User::LeaveIfError(iMultiMediaSource->Stop());
-    }
-
-
-void CProgDLSource::ConstructSourceL(const TDesC8& aInitData )
-    {
-    if(iInitData)
-        {
-        delete iInitData;
-        iInitData = NULL;        
-        }
-    iInitData = aInitData.AllocL();        
-    }
-
-void CProgDLSource::SourceCustomCommand(TMMFMessage& aMessage)
-    {
-    iMultiMediaSource->SourceCustomCommand(aMessage);        
-    }
-
-void CProgDLSource::SetMultimediaSource(CProgDLMultimediaSource& aMultimediaSource)
-    {
-    iMultiMediaSource = &aMultimediaSource;   
-    }
-
-TDesC8& CProgDLSource::GetInitData()
-    {
-    return *iInitData;    
-    }
-/****************************/
-
-
-EXPORT_C CProgDLMultimediaSource* CProgDLMultimediaSource::NewL(MDataSource& aDataSource)
-    {
-    DEBPRN1(_L("CProgDLMultimediaSource::NewL"));
-    CProgDLMultimediaSource* self = new (ELeave) CProgDLMultimediaSource(aDataSource);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-    /**
-    Destructor.
-*/
-CProgDLMultimediaSource::~CProgDLMultimediaSource() 
-    {
-    DEBPRN1(_L("CProgDLMultimediaSource::~CProgDLMultimediaSource() "));    
-    delete iInitData;
-    delete iFile;
-    EmptySinkQueue();
-    iHandle.Close();
-    iFsSession.Close();
-    delete iFileName;
-    delete iFileExt;
-    delete iFilePath;
-    delete iFileDrive;
-    
-    
-    delete iCAFParameters;
-    delete iSinkQueue;
-    delete iAudioConfigRepository;
-    
-    if(iMessage)
-        {
-        if(!iMessage->IsCompleted())
-            {
-            iMessage->Complete(KErrDied);
-            delete iMessage;
-            iMessage = NULL;
-            }
-        }
-    // Get rid of everything in RArray's & close them.
-    iRequests.ResetAndDestroy();
-    iTransferBufferCopies.ResetAndDestroy();
-    DEBPRN1(_L("CProgDLMultimediaSource::~CProgDLMultimediaSource() exit"));   
-    }
-
-    /**
-    Protected constructor.
-    
-      The default implementation is empty.
-*/
-CProgDLMultimediaSource::CProgDLMultimediaSource(MDataSource& aDataSource)
-                                       : iSnkItemsCount(0),
-                                       iSnkBytes(0),
-                                       iDownloadSize(0),
-                                       iTransferRate(0),
-                                       //iConsumer(NULL),
-                                       iBufferedDataSize(0),
-                                       iDLFileSize(0),
-                                       isDownloadComplete(EFalse),
-                                       iFileSize(0),
-                                       iParentDataSource(&aDataSource)
-    {
-    iMessage = NULL;
-    iFile = NULL;
-    iState = ECLOSED;
-    iObserver = NULL;
-    iReadRequestPending = 0;
-    iReOpenCAF = EFalse;
-    iObserverBitRate = 0;
-    }
-
-    /**
-    Constructs an CProgDLMultimediaSource MDataSource.
-    
-      @return A pointer to the new CProgDLMultimediaSource data source.
-*/
-/*MDataSource* CProgDLMultimediaSource::NewSourceL() 
-{
-CProgDLMultimediaSource* self = new (ELeave) CProgDLMultimediaSource( KMmfProgDLSource ) ;
-return STATIC_CAST( MDataSource*, self ) ;
-    }*/
-
-
-    /**
-    Perform source construction dependant on the source construction
-    initialisation data aInitData.
-    
-      @param  aInitData
-      The TPckg<TMMFFileParams> descriptor package containing the file name and full path.
-*/
-void CProgDLMultimediaSource::ConstructL() 
-    {
-    CProgDLSource* progDLSource = static_cast<CProgDLSource*>(iParentDataSource);    
-    iInitData = (progDLSource->GetInitData()).AllocL();
-    progDLSource->SetMultimediaSource(*this);
-    ConstructL(*iInitData, ESourceMode);
-    iSinkQueue = new(ELeave) TSglQue<CSinkQueueItem>(_FOFF(CSinkQueueItem, iLink));
-    }
-
-
-    /**
-    Protected constructor.
-    
-      Extracts the initialisation data provided by the calling functions: ConstructSourceL() and 
-      ConstructSinkL(). Creates a file server session and sets up file name. If there is a file name and 
-      it cannot be found this function leaves. If there is no file name the function leaves. Does not 
-      attempt to open the file or check whether the file exists.
-      
-        If aInitData contains a TMMFFileHandleParams instead of TMMFFileParams, the source/sink is constructed from 
-        the file handle provided by the caller
-        
-          @param  aInitData
-          Initialisation data packaged in a TMMFFileParams or in a TMMFFileHandleParams (File Handle)
-*/
-void CProgDLMultimediaSource::ConstructL(const TDesC8& aInitData,TMMFileMode aFileMode)
-    {
-    User::LeaveIfError(iFsSession.Connect());
-    // on IPCv2 we auto attach
-    User::LeaveIfError(iFsSession.ShareAuto());
-    
-    User::LeaveIfError(iFsSession.ShareProtected());
-    
-    TBool fileInit = EFalse;
-    HBufC* filename = NULL; 
-    TBool filenamePushed = EFalse;
-    
-    iCAFParameters = new (ELeave) CCAFParameters;
-    TBool drmContent = EFalse;
-    RDesReadStream stream(aInitData);
-    CleanupClosePushL(stream);
-
-    iAudioConfigRepository = CRepository::NewL(KCRUidAudioConfiguration);
-
-    // From Central Repository
-    GetAudioConfiguration();
-    
-    TUid initUid;
-    
-    initUid = TUid::Uid(stream.ReadInt32L());
-    
-    if (initUid == KMMFileHandleSourceUid)
-        {
-        TPckgBuf<RFile*> fileptr;
-        stream.ReadL(fileptr);
-        
-        iHandle.Duplicate(*fileptr());
-        
-        TInt length;
-        length = stream.ReadInt32L();
-        if (length>0)
-            {
-            iCAFParameters->iUniqueId = HBufC::NewL(length);
-            TPtr16 ptr = iCAFParameters->iUniqueId->Des();
-            stream.ReadL(ptr, length);
-            }
-        iFileHandle = ETrue;
-        filename = HBufC::NewMaxL(KMaxFileName);
-        TPtr ptr = filename->Des();
-        iHandle.Name(ptr);
-        fileInit = ETrue;
-        drmContent = ETrue;
-        
-        iCAFParameters->iEnableUI = stream.ReadInt32L();
-        }
-    
-    else if (initUid == KMMFileSourceUid)
-        {
-        TInt length;
-        length = stream.ReadInt32L();
-        filename = HBufC::NewMaxLC(length);
-        TPtr ptr = filename->Des();
-        stream.ReadL(ptr, length);
-        
-        length = stream.ReadInt32L();
-        if (length>0)
-            {
-            iCAFParameters->iUniqueId = HBufC::NewMaxL(length);
-            ptr.Set(iCAFParameters->iUniqueId->Des());
-            stream.ReadL(ptr, length);
-            }
-        CleanupStack::Pop(filename);
-        
-        fileInit = ETrue;
-        drmContent = ETrue;
-        iFileHandle = EFalse; 
-        iCAFParameters->iEnableUI = stream.ReadInt32L();
-        }
-    else
-        {
-        //		TODO If the UID is unknown we should reject, but  currently
-        //		code also used for older calls that just supply filename.
-        //		User::Leave(KErrNotSupported);
-        }
-    
-    CleanupStack::PopAndDestroy(&stream);
-    
-    if (!fileInit && aInitData.Length() == sizeof(TMMFFileHandleParams))
-        {
-        TMMFFileHandleParams params;
-        TPckgC<TMMFFileHandleParams> config(params);
-        config.Set(aInitData);
-        params = config();
-        
-        
-        if (params.iUid == KFileHandleUid)
-            {
-            fileInit = ETrue;
-            User::LeaveIfError(iHandle.Duplicate(*params.iFile));
-            TInt pos = 0;
-            // make sure the duplicate handle is at the start of the file - the usage of the file handle really requires this
-            User::LeaveIfError(iHandle.Seek(ESeekStart, pos));
-            iFileHandle = ETrue;
-            filename = HBufC::NewMaxLC(KMaxFileName);
-            filenamePushed = ETrue;
-            TPtr ptr = filename->Des();
-            User::LeaveIfError(iHandle.Name(ptr));
-            }
-        }
-    
-    if (!fileInit) // do old case as last resort
-        {
-        TMMFFileParams params;
-        TPckgC<TMMFFileParams> config(params);
-        config.Set(aInitData);
-        params = config();
-        
-        filename = params.iPath.AllocL();
-        fileInit = ETrue;
-        }
-    
-    if (!filenamePushed)
-        {
-        // from now on it is assumed pushed.
-        CleanupStack::PushL(filename);
-        }
-    
-    TParse parser ;
-    User::LeaveIfError(parser.Set(*filename, NULL, NULL));
-    CleanupStack::PopAndDestroy(filename);
-    if ( !( parser.NamePresent() ) && !( parser.ExtPresent() ) )
-        User::Leave( KErrBadName ) ;
-    
-    iFullFileName.Copy( parser.FullName() ) ;	
-    iFileName = parser.Name().AllocL() ;
-    iFileExt = parser.Ext().AllocL() ;
-    iFilePath = parser.Path().AllocL() ;
-    iFileDrive = parser.Drive().AllocL() ;
-    
-    // in order to simulate old behaviour we are not passing error out
-    // but will try to create Content again during PrimeL()
-    if (fileInit && drmContent && aFileMode==ESourceMode)
-        {
-        TInt contentError;
-        if (iFileHandle)
-            {
-            TRAP(contentError, 
-                iFile = CContentFile::NewL(iHandle, UniqueId(), iCAFParameters->iEnableUI);
-            );
-            }
-        else
-            {
-            // Open for read-only access
-            TRAP(contentError,
-                iFile = CContentFile::NewL(iFsSession, iFullFileName, UniqueId(), EFileShareAny, iCAFParameters->iEnableUI);
-            );
-            }
-        }
-    }
-    
-    
-/**
-@deprecated
-
-Returns an RFile handle to the current file.
-
-If there is no current file, one is created. If the file exists then it is opened with read access 
-if it is read only, write access otherwise. If the file does not exist then it is opened with
-write access.
-
-@leave KErrNotReady
-The file is not open.
-
-@return A handle to the current file.
-*/
-RFile& CProgDLMultimediaSource::FileL()
-    {
-    if (!iFile)
-        User::Leave(KErrNotReady);
-    if (iFileHandle)
-        return iHandle;
-    else
-        return iFile->FileL();
-    }
-            
-/** 
-Returns the file name of the current file.
-
-  Note: This will give the wrong answer if the file is renamed!
-  
-    @return The FileName (without extension).
-*/
-const TDesC& CProgDLMultimediaSource::FileName() const
-    {
-    return *iFileName ;
-    }
-            
-/**
-Returns the extension of the current file.
-
-Note: This will give the wrong answer if the file is renamed!
-
-@return The File Extension.
-*/
-const TDesC& CProgDLMultimediaSource::Extension() const 
-    {
-    return *iFileExt ;
-    }
-            
-/** 
-Returns the path of the current file.
-
-Note: This will give the wrong answer if the file is renamed!
-
-@return The FilePath (without filename and extension)
-*/
-const TDesC& CProgDLMultimediaSource::FilePath() const 
-    {
-    return *iFilePath ;
-    }
-
-/** 
-Returns the drive on which the current file is located.
-
-Note: This will give the wrong answer if the file is renamed!
-
-@return The FileDrive (drive letter only, without path, filename and extension).
-*/
-const TDesC& CProgDLMultimediaSource::FileDrive() const 
-    {
-    return *iFileDrive ;
-    }
-
-/** 
-Returns the full name of the current file.
-
-Note: This will give the wrong answer if the file is renamed!
-
-@return The file name (full filename including drive letter, without path, filename and extension).
-*/
-const TFileName CProgDLMultimediaSource::FullName() const
-    {
-    return iFullFileName;
-    }
-            
-/** 
-Returns the uniqueID associated with this content. If no uniqueID has been provided, a null
-descriptor will be provided
-
-@return The UniqueID
-*/
-const TDesC& CProgDLMultimediaSource::UniqueId() const
-    {
-    if (iCAFParameters->iUniqueId)
-        return *(iCAFParameters->iUniqueId);
-    else
-        return KNullDesC;
-    }
-            
-/**
-Obtains a CTransferBufferCopy from iTransferBufferCopies that is
-at least as big as that required.
-
-There is no need to put the pointer returned by this method onto the CleanupStack
-as it will have already been placed into iTransferBufferCopies.
-
-@param  aMaxLength
-The size required.
-
-@return A pointer to a valid CTransferBufferCopy.
-*/
-CTransferBufferCopy* CProgDLMultimediaSource::ObtainCopyOfTransferBufferL(TInt aMaxLength)
-    {
-    //find a free transfer buffer copy of the right size
-    TInt firstFree = -1;
-    CTransferBufferCopy* transBufCopyToUse = NULL;
-    
-    for(TInt cnt=0; cnt < iTransferBufferCopies.Count(); cnt++)
-        {
-        if(!iTransferBufferCopies[cnt]->InUse())
-            {
-            //record the first free entry, we may remove this
-            //if entries in iTransferBufferCopies > KAcceptableTransferBufferCopiesSize
-            if(firstFree == -1) 
-                firstFree = cnt;
-            
-            if(iTransferBufferCopies[cnt]->MaxLength() >= aMaxLength)
-                {
-                transBufCopyToUse = iTransferBufferCopies[cnt];
-                
-                //Set the MaxLength. This will ensure that the copy acts the same as
-                //the original Transfer buffer, eg. file server will throw KErrOverflow
-                transBufCopyToUse->ReUse(aMaxLength);
-                break;
-                }
-            }
-        }
-    
-    //If we failed to find a suitable entry, we need to create a new one
-    if(!transBufCopyToUse)
-        {
-        //Firstly, should we re-cycle an existing entry?
-        //There must be entries in the array, a free entry must have been found,
-        //the size of the array must be beyond the water mark where we want to start
-        //cycling free entries.
-        if((iTransferBufferCopies.Count() > 0) &&
-            (firstFree != -1) &&
-            (iTransferBufferCopies.Count() > KAcceptableTransferBufferCopiesSize))
-            {
-            delete iTransferBufferCopies[firstFree];
-            iTransferBufferCopies.Remove(firstFree);
-            
-            transBufCopyToUse = CTransferBufferCopy::NewL(aMaxLength);
-            CleanupStack::PushL(transBufCopyToUse);
-            User::LeaveIfError(iTransferBufferCopies.Insert(transBufCopyToUse,firstFree));
-            
-            CleanupStack::Pop();
-            }
-        else
-            {
-    #ifdef _DEBUG
-            if(iTransferBufferCopies.Count() > KMaximumTransferBufferCopiesSize)
-                {
-                User::Panic(_L("iTransferBufferCopies grew too large in CProgDLMultimediaSource"),KErrTooBig);
-                }
-    #endif
-            
-            transBufCopyToUse = CTransferBufferCopy::NewL(aMaxLength);
-            CleanupStack::PushL(transBufCopyToUse);
-            User::LeaveIfError(iTransferBufferCopies.Append(transBufCopyToUse));
-            
-            CleanupStack::Pop();
-            }
-        }
-    
-    return transBufCopyToUse;
-    }
-            
-            
-            
-/** 
-Loads aBuffer from iFile.
-
-The file must already be open for reading. File read is asynchronous. CReadRequest is created to 
-respond to completion.
-
-@param  aBuffer
-The buffer to be filled from the file.
-@param  aConsumer
-The data sink consumer of the buffer.
-*/
-void CProgDLMultimediaSource::FillBufferL( CMMFBuffer* aBuffer, MDataSink* aConsumer, TMediaId /*aMediaId*/ )
-    {
-    // Requires that iFile is open for read.
-    // Reads data from iFile into aBuffer
-    TInt status(KErrNone);
-    DEBPRN2(_L("CProgDLMultimediaSource::FillBuffer[%x]]"), aBuffer );
-    if ((!aConsumer) || (!aBuffer))
-        User::Leave(KErrArgument);
-    
-    if (!iFile)
-        User::Leave(KErrNotReady);
-    
-    AppendBufferToSinkQueue(aBuffer,NULL,aConsumer,EFalse);
-    DEBPRN4(_L("CProgDLMultimediaSource::FillBuffer DLComplete[%d] ReOpenCAF[%d] RequestPending[%d]"), isDownloadComplete,iReOpenCAF,iReadRequestPending );
-    if(isDownloadComplete && !iReOpenCAF) 
-        {
-        if(!iReadRequestPending)
-            {
-            ReOpenCAF();
-            status = ServiceFillBuffer();
-            if(status == KErrUnderflow)
-                {
-                StateChanged(EBUFFERING);
-                }
-            }
-        }
-    else
-        {
-        status = ServiceFillBuffer();
-        
-        if(status == KErrUnderflow)
-            {
-            StateChanged(EBUFFERING);
-            }
-        }        
-    }
-            
-/**
-Stores a request in an array.
-
-CReadWriteRequests are stored in the array iRequests.
-This function takes ownership and places the request in the array.
-It also checks the array for completed requests and removes them.
-
-@param  aRequest
-The request to store.
-*/
-void CProgDLMultimediaSource::StoreRequestL( CReadWriteRequest* aRequest )
-    {
-    // add aRequest to iRequests
-    User::LeaveIfError( iRequests.Append( aRequest ) ) ;
-    
-    // Clear out any completed requests
-    for ( TInt ii = 0 ; ii < iRequests.Count() ; ii++ )
-        {
-        if (iRequests[ii]->Completed())
-            {
-            CReadWriteRequest* request = iRequests[ii];
-            delete request;
-            
-            iRequests.Remove(ii);
-            ii--;
-            }
-        }
-    }
-
-
-/**
-Cancels outstanding requests.
-
-CReadWriteRequests are stored in the array iRequests.
-This function cancels any outstanding requests and removes them
-from iRequests.
-*/
-void CProgDLMultimediaSource::CancelRequests()
-    {
-    // Clear out any completed requests
-    for ( TInt ii = 0 ; ii < iRequests.Count() ; ii++ )
-        {
-        CReadWriteRequest* request = iRequests[ii];
-        delete request;
-        iRequests.Remove(ii);
-        ii--;
-        }
-    }
-
-            
-/**
-Evaluates a given intent against the rights associated with the file.
-
-The rights are not updated by this function call.
-
-@param  aIntent
-The intent to evaluate.
-
-  @return An error code indicating if the function call was successful. KErrNone on success, otherwise
-  another of the system-wide error codes.
-*/
-TInt CProgDLMultimediaSource::EvaluateIntent(ContentAccess::TIntent aIntent) const
-    {
-    if (!iFile)
-        {
-        return KErrNotReady;
-        }
-    
-    return iFile->EvaluateIntent(aIntent);
-    }
-            
-/**
-Evaluates and executes a given intent against the rights associated with the file.
-
-The rights object is updated after calling this function.
-
-@param  aIntent
-The intent to evaluate.
-
-@return An error code indicating if the function call was successful. KErrNone on success, otherwise
-another of the system-wide error codes.
-*/
-TInt CProgDLMultimediaSource::ExecuteIntent(ContentAccess::TIntent aIntent)
-    {
-    if (!iFile)
-        {
-        return KErrNotReady;
-        }
-    
-    return iFile->ExecuteIntent(aIntent);
-    }
-            
-/**
-Returns whether the file is protected.
-
-@return A boolean indicating if the file is protected. ETrue if the file is protected.
-*/
-TInt CProgDLMultimediaSource::GetDRMProtection(TBool& aIsProtected)
-    {
-    TInt err(KErrNone);	
-    if (!iFile)
-        {
-        return KErrNotReady;
-        }
-    
-    TRAP(err,aIsProtected = iFile->IsProtected());
-    return err;
-    }
-            
-TInt CProgDLMultimediaSource::SetAgentProperty(ContentAccess::TAgentProperty aProperty, TInt aValue)
-    {
-    if (!iFile)
-        {
-        return KErrNotReady;
-        }
-    
-    return iFile->SetAgentProperty(aProperty, aValue);
-    }
-            
-/*
-*	Returns ETrue if the request can safely be deleted.
-*/
-TBool CReadWriteRequest::Completed() 
-    {
-    return iCompleted ;
-    }
-            
-TInt CReadWriteRequest::SetStatus(TBool aStatus)
-    {
-    iCompleted = aStatus;
-    return KErrNone;
-    }
-
-TBool CReadWriteRequest::SourceType() 
-    {
-    return iSourceType ;
-    }
-
-
-/*
-*	Returns the data member of CMMFDataBuffer or CMMFTransferBuffer (as TPtr8)
-*  
-*/
-TDes8& CReadWriteRequest::BufferDes()
-    {
-    if(iTransferBufferCopy)
-        return iTransferBufferCopy->Des();
-    else
-        {
-        //reset iBufferDes in case iBuffer has changed...
-        iBufferDes = &(STATIC_CAST(CMMFDataBuffer*, iBuffer)->Data());
-        return *iBufferDes;
-        }
-    }
-
-const TDesC8& CReadWriteRequest::BufferDesC()
-    {
-    if(iTransferBufferCopy)
-        return iTransferBufferCopy->Des();
-    else
-        return BufferDes();
-    }
-
-CMMFBuffer* CReadWriteRequest::Buffer()
-    {
-    return iBuffer;
-    }
-
-TAny* CReadWriteRequest::GetSinkOrSource()
-    {
-    return iSinkOrSource;
-    }
-
-/*
-*	Destructor.
-*/
-CReadWriteRequest::~CReadWriteRequest() 
-    {
-    Cancel();
-    if(iTransferBufferCopy)
-        iTransferBufferCopy->SetInUse(EFalse);
-    }
-
-/*
-*	Allows owning class access to SetActive()
-*/
-void CReadWriteRequest::SetActive() 
-    {
-    CActive::SetActive() ;
-    }
-        
-/*
-*  For the moment at least...    Canceled requests may be deleted
-*/
-void CReadWriteRequest::DoCancel() 
-    {
-    iCompleted = ETrue ;
-    }
-            
-/*
-*	Called when errors in RunL force Leave.  For the moment just mark the request deletable
-*/
-TInt CReadWriteRequest::RunError( TInt aError ) 
-    {
-    //RunL can leave.
-    iCompleted = ETrue ;
-    iError = aError; //keep this error internally for now
-    return KErrNone ;
-    }
-        
-/*
-*	On completion of read request call back to the MDataSink
-*/
-void CReadRequest::RunL() 
-    {
-    //Copy the data from the normal buffer into the Transfer buffer
-    if(iTransferBufferCopy)
-        {
-        //must specify the size here as the dest may be smaller than the source.
-        TDes8& destDesc = STATIC_CAST(CMMFDataBuffer*, iBuffer)->Data();
-        destDesc.Copy(iTransferBufferCopy->Des().Left(destDesc.MaxLength()));
-    
-        iTransferBufferCopy->SetInUse(EFalse);
-        }
-
-        STATIC_CAST(CProgDLMultimediaSource*,iParent)->ReadRequestStatus(STATIC_CAST(CReadWriteRequest*,this),iStatus);
-    }
-
-        // From CMultimediaDataSource begins
-TInt CProgDLMultimediaSource::SetObserver( MMultimediaDataSourceObserver& aObserver )
-    {
-    TInt status(KErrNone);
-    iObserver = &aObserver;
-    return status;
-    }
-        
-TInt CProgDLMultimediaSource::GetObserver( MMultimediaDataSourceObserver*& aObserver )
-    {
-    TInt status(KErrNone);
-    aObserver = iObserver;
-    return status;
-    }
-        
-void CProgDLMultimediaSource::Event( TUid aEvent )
-    {
-    if( aEvent == KMultimediaDataSourceEventBitRateChanged )
-        {
-        
-        if(iObserver)
-            {
-                iObserver->GetBitRate( iObserverBitRate ); 
-                if(iState == EBUFFERING)
-                    CalculateBufferedDataSize();
-            }
-        }    
-    
-    }
-        
-TInt CProgDLMultimediaSource::SetDataTypeCode(TFourCC aSourceFourCC )
-    {
-    TInt status(KErrNone);
-    iSourceFourCC = aSourceFourCC;
-    return status;
-    }
-        
-TInt CProgDLMultimediaSource::GetDataTypeCode(TFourCC& aSourceFourCC )
-    {
-    TInt status(KErrNone);
-    aSourceFourCC = iSourceFourCC;
-    return status;
-    }
-
-TInt CProgDLMultimediaSource::GetSize( TUint& aSize )
-    {
-    TInt err = KErrNone;
-    if (iDLFileSize >=0)
-    	{
-    	aSize = iDLFileSize;
-    	}
-    else
-    	{
-    	aSize = 0;
-    	}
-    return err;
-    }
-
-TInt CProgDLMultimediaSource::Open()
-    {
-    TInt status(KErrNotReady);
-    DEBPRN1(_L("CProgDLMultimediaSource::Open"));
-    switch ( iState )
-        {
-        case ECLOSED:
-            StateChanged(ESTOPPED);
-            status = KErrNone;
-            break;
-        case ESTOPPED:
-        case EPRIMED:
-        case EEXECUTING:
-        case EBUFFERING:
-        default:
-            DEBPRN2(_L("CProgDLMultimediaSource::Open[Illegal cmd on state[%d]]"), iState );
-            break;
-        };
-    return status;
-    }
-
-TInt CProgDLMultimediaSource::Close()
-    {
-    TInt status(KErrNone);
-    iHandle.Close();
-    iFsSession.Close();
-
-    StateChanged(ECLOSED);
-    // Clear app buffers
-    EmptySinkQueue();
-    iSnkBytes = 0;
-    // Clear observer buffers
-    return status;
-    }
-
-TInt CProgDLMultimediaSource::Prime()
-    {
-    TInt status(KErrNotReady);
-    DEBPRN1(_L("CProgDLMultimediaSource::Prime"));
-    switch ( iState )
-        {
-        case ESTOPPED:
-            
-            // don't reopen file if already open
-            if (!iFile)
-                {
-                if (iFileHandle)
-                    {
-                    TRAPD(err,iFile = CContentFile::NewL(iHandle, UniqueId(), iCAFParameters->iEnableUI));
-                    if(err)
-                        return err;
-                    }
-                else
-                    {
-                    // Open for read-only access
-                    TRAPD(err,iFile = CContentFile::NewL(iFsSession, iFullFileName, UniqueId(), EFileShareAny, iCAFParameters->iEnableUI));
-                    if(err)
-                        return err;                    
-                    }
-                }
-            
-            if(iFile)
-                {
-                if(iFile->IsProtected())
-                    iFile->Size(iFileSize);
-                else
-                    iFileSize = iDLFileSize;		          
-                }												
-            
-            StateChanged(EPRIMED);
-            status = KErrNone;
-            break;
-        case EPRIMED:
-            status = KErrNone;
-            break;
-        case ECLOSED:
-        case EEXECUTING:
-        case EBUFFERING:
-        default:
-            DEBPRN2(_L("CProgDLMultimediaSource::Prime[Illegal cmd on state[%d]]"), iState );
-            break;
-        }
-    return status;
-    }
-
-TInt CProgDLMultimediaSource::Play()
-    {
-    TInt status(KErrNotReady);
-    DEBPRN1(_L("CProgDLMultimediaSource::Play"));
-    switch ( iState )
-        {
-        case EPRIMED:
-            CalculateBufferedDataSize();
-            StateChanged(EEXECUTING);
-            
-            while ( !iSinkQueue->IsEmpty() )
-                {
-                status = ServiceFillBuffer();
-                }
-            
-            if(status == KErrUnderflow)
-                {
-                StateChanged(EBUFFERING);
-                }
-            
-            status = KErrNone;	
-            break;
-        case EEXECUTING:
-        case EBUFFERING:
-            status = KErrNone;
-            // No op
-            break;
-        case ECLOSED:
-        case ESTOPPED:
-        default:
-            DEBPRN2(_L("CProgDLMultimediaSource::Play[Illegal cmd on state[%d]]"), iState );
-            break;
-        };
-    return status;
-    }
-        
-TInt CProgDLMultimediaSource::Stop()
-    {
-    TInt status(KErrNotReady);
-    DEBPRN1(_L("CProgDLMultimediaSource::Stop"));
-    switch ( iState )
-        {
-        case EPRIMED:
-        case EEXECUTING:
-        case EBUFFERING:
-            {
-            TInt pos = 0;
-            CancelRequests();
-            delete iFile;
-            iFile = NULL;
-            //iDLFileSize = -1;
-            iSnkBytes=pos;
-            iBufferedDataSize = 0;
-            EmptySinkQueue();
-            StateChanged(ESTOPPED);
-            status = KErrNone;
-            }
-            break;
-        case ECLOSED:
-        default:
-            DEBPRN2(_L("CProgDLMultimediaSource::Stop[Illegal cmd on state[%d]]"), iState );
-            break;
-        };
-    return status;
-    }
-    
-    
-TInt CProgDLMultimediaSource::FillBuffer( CMMFBuffer* aBuffer )
-    {
-    // Requires that iFile is open for read.
-    // Reads data from iFile into aBuffer
-    
-    TInt status(KErrNone);
-    DEBPRN2(_L("CProgDLMultimediaSource::FillBuffer[%x]]"), aBuffer );
-    if (!aBuffer)
-        return KErrArgument;
-    
-    if (!iFile)
-        return KErrNotReady;
-    
-    AppendBufferToSinkQueue(aBuffer,iObserver,NULL,EFalse);
-    
-    DEBPRN4(_L("CProgDLMultimediaSource::FillBuffer DLComplete[%d] ReOpenCAF[%d] RequestPending[%d]"), isDownloadComplete,iReOpenCAF,iReadRequestPending );
-    if(isDownloadComplete && !iReOpenCAF) 
-        {
-        if(!iReadRequestPending)
-            {
-            ReOpenCAF();                        
-            status = ServiceFillBuffer();
-            if(status == KErrUnderflow)
-                {
-                StateChanged(EBUFFERING);
-                }
-            }
-        }
-    else
-        {
-        status = ServiceFillBuffer();
-        
-        if(status == KErrUnderflow)
-            {
-            StateChanged(EBUFFERING);
-            }
-        }        
-    return status; 	
-    }
-
-    
-TAny* CProgDLMultimediaSource::CustomInterface( TUid /*aInterfaceUid*/ )
-    {
-    return NULL;
-    }
-    
-TInt CProgDLMultimediaSource::AppendBufferToSinkQueue( CMMFBuffer* aBuffer,
-                                                    MMultimediaDataSourceObserver* aObserver,
-                                                    MDataSink* aConsumer,TBool aTop )  
-    {
-    TInt status(KErrNone);
-    
-    DEBPRN2(_L("CProgDLMultimediaSource::AppendBufferToSinkQueue() Buffer[%x]"), aBuffer );				    
-    // Add observer buffer to queue
-    CMMFDataBuffer* dest = static_cast<CMMFDataBuffer*>( aBuffer );
-    TDes8& destBufferDes = dest->Data();
-    
-    CSinkQueueItem* request(NULL);
-    
-    TRAP( status, request = CSinkQueueItem::NewL( aBuffer, aObserver,aConsumer) );
-    if ( status == KErrNone )
-        {
-        if(aTop)
-            iSinkQueue->AddFirst(*request);
-        else  
-            iSinkQueue->AddLast(*request);
-        
-        iSnkItemsCount++;
-        
-        DEBPRN3(_L("CProgDLMultimediaSource::AppendBufferToQueue[ReqSize[%d]SnkItems[%d]]"), \
-            aBuffer->RequestSize(), iSnkItemsCount );
-        }
-    return status;
-    }
-    
-void CProgDLMultimediaSource::SourceCustomCommand(TMMFMessage& aMessage)
-    {
-    TInt err(KErrNone);
-    switch ( aMessage.Function() )
-        {
-        
-        case ESetUpdateFileName:
-            {
-            // Read size info
-            TPckgBuf<TFileName> sizePckg;
-            err = aMessage.ReadData1FromClient(sizePckg);
-            if ( err == KErrNone )
-                {
-                iFullFileName = sizePckg();
-                }
-            aMessage.Complete(KErrNone);			            
-            
-            }   
-            break;
-
-        case EDownloadRate:
-            {
-            
-            // Read size info
-            TPckgBuf<TUint> sizePckg;
-            err = aMessage.ReadData1FromClient(sizePckg);
-            if ( err == KErrNone )
-                {
-                iTransferRate = sizePckg();
-                }
-            aMessage.Complete(KErrNone);			            
-            DEBPRN2(_L("CProgDLMultimediaSource::SourceCustomCommand EDownloadRate[%u] "),iTransferRate);
-            if(iState == EBUFFERING /*&& !iSinkQueue->IsEmpty()*/)
-                { 
-                CalculateBufferedDataSize();
-                }
-            }   
-            break;
-        case ESetDownloadState:
-            {
-            isDownloadComplete = ETrue;    
-            if(iFile)
-                iFile->Size(iFileSize);
-            
-            if(iFileSize != iDLFileSize)
-                iDLFileSize = iFileSize;
-            
-            iDownloadSize =  iFileSize;
-            iBufferedDataSize = 0;
-            aMessage.Complete(KErrNone);
-    
-            if(iObserver)
-                iObserver->Event(KMultimediaDataSourceEventRandomSeekingSupportChanged);	
-            
-            if(iState == EBUFFERING )
-                {
-                if((iDownloadSize - iSnkBytes) > iBufferedDataSize)
-                    {
-                    StateChanged(EEXECUTING);
-                    while ( !iSinkQueue->IsEmpty() )
-                        {
-                        err = ServiceFillBuffer();
-                        if(err == KErrUnderflow)
-                            {
-                            StateChanged(EBUFFERING);
-                            break;
-                            }
-                        }
-                    }
-                }
-            }
-            break;
-            
-        case ESetDownloadSize:
-            {
-            // Read size info
-            TPckgBuf<TInt> sizePckg;
-            err = aMessage.ReadData1FromClient(sizePckg);
-            if ( err == KErrNone )
-                {
-                iDownloadSize = sizePckg();
-                }
-            aMessage.Complete(KErrNone);			
-            TInt size = 0;
-
-            if(iFile)
-                iFile->Size(size);
-            
-            DEBPRN4(_L("CProgDLMultimediaSource::SourceCustomCommand ********BufferedDataSize[%u] DownloadSize[%d] iSnkbytes[%d]"), iBufferedDataSize ,iDownloadSize, iSnkBytes ); 		            
-            DEBPRN4(_L("CProgDLMultimediaSource::SourceCustomCommand ********iDLFileSize[%d] iFileSize[%d]ActualSize[%d]"), iDLFileSize,iFileSize,size); 		            
-            if(iState == EBUFFERING )
-                {
-                if((iDownloadSize - iSnkBytes) > iBufferedDataSize)
-                    {
-                    StateChanged(EEXECUTING);
-                    while ( !iSinkQueue->IsEmpty() )
-                        {
-                        err = ServiceFillBuffer();
-                        if(err == KErrUnderflow)
-                            {
-                            StateChanged(EBUFFERING);
-                            break;
-                            }
-                        }
-                    }
-                }			
-            }
-            break;
-                
-        case ESetActualSize:
-            {
-            // Read size info
-            TPckgBuf<TInt> sizePckg;
-            err = aMessage.ReadData1FromClient(sizePckg);
-            if ( err == KErrNone )
-                {
-                iDLFileSize = sizePckg();
-                }
-            aMessage.Complete(KErrNone);
-            
-            if(iFile)
-                {
-                if(iFile->IsProtected())
-                    iFile->Size(iFileSize);
-                else
-                    iFileSize = iDLFileSize;		          
-                }
-            DEBPRN3(_L("CProgDLMultimediaSource::SourceCustomCommand ActualSize********iDLFileSize[%d] iFileSize[%d]"), iDLFileSize,iFileSize); 		            
-            
-            if(iObserver)
-                iObserver->Event(KMultimediaDataSourceObserverEventSourceSizeChanged);
-            
-            }
-            break;   
-                
-        case EGetSourceState:
-            {
-            TPckgBuf<TState> statePckg;	
-            aMessage.ReadData1FromClient(statePckg);
-            DEBPRN3(_L("CProgDLMultimediaSource::SourceCustomCommand() Client State[%d] SourceState[%d]"), statePckg(), iState);
-            
-            if(iState != statePckg())
-                {
-                statePckg() = iState;	
-                aMessage.WriteDataToClient(statePckg);
-                aMessage.Complete(KErrNone);
-                }
-            else
-                iMessage = new(ELeave) TMMFMessage(aMessage);
-             }   
-            break;   
-
-        case EGetBitRate:
-            {
-            TPckgBuf<TUint> bitRatePckg;	 
-            DEBPRN2(_L("CProgDLMultimediaSource::SourceCustomCommand() Client BitRateFromS[%d]"),iObserverBitRate);
-            bitRatePckg() = iObserverBitRate ;	
-            aMessage.WriteDataToClient(bitRatePckg);
-            aMessage.Complete(KErrNone);
-            }            
-            break;   
-
-        case EGetPercentageBuffered:
-            {
-            TPckgBuf<TUint> perBufPckg; 
-            TUint perBuf = 0;
-            if(iState == EBUFFERING && iBufferedDataSize != 0)
-                {
-                CalculateBufferedDataSize();                    
-                if ( iBufferedDataSize == 0 ) 
-                    {
-                    perBuf = 0; 
-                    }
-                else
-                    {
-                    perBuf = (iDownloadSize - iSnkBytes) * 100 / iBufferedDataSize;
-                    }
-                }
-            
-            RDebug::Print(_L(" Percentage Buffered [%d]"),perBuf);
-            perBufPckg() = perBuf;
-            aMessage.WriteDataToClient(perBufPckg);
-            aMessage.Complete(KErrNone);
-            }
-            break;   
-                
-        default:
-            err = KErrArgument;
-            break;
-        }
-    }        
-
-TInt CProgDLMultimediaSource::ServiceFillBuffer()
-    {
-    
-    DEBPRN3(_L("CProgDLMultimediaSource::ServiceFillBuffer() state[%d] Download Size[%d]"), iState ,iDownloadSize );
-    
-    TInt status(KErrNone);
-    if ( iSinkQueue->IsEmpty() )
-        return KErrNone;
-    
-    CSinkQueueItem* tempsnkItem = iSinkQueue->First();
-    CMMFBuffer* tempbuffer = tempsnkItem->Buffer();
-    
-    TInt bufSize = tempbuffer->RequestSize();
-    
-    DEBPRN5(_L("CProgDLMultimediaSource::ServiceFillBuffer() ********BufferedDataSize[%u] DownloadSize[%d] iSnkbytes[%d] BufSize[%d]"), iBufferedDataSize ,iDownloadSize, iSnkBytes,bufSize ); 		            				
-    if((((iDownloadSize - iSnkBytes) > bufSize) && 
-        iState == EEXECUTING && 
-        iDownloadSize > iBufferedDataSize && ((iReadRequestPending + 1)*bufSize < (iDownloadSize - iSnkBytes))) || (iFileSize == iDownloadSize))
-        {
-        iReadRequestPending++;
-        CSinkQueueItem* snkItem = iSinkQueue->First();
-        iSinkQueue->Remove(*snkItem);
-        iSnkItemsCount--;
-        CMMFBuffer* buffer = snkItem->Buffer();
-        DEBPRN2(_L("CProgDLMultimediaSource::ServiceFillBuffer() Buffer[%x]"), buffer );				    
-        MMultimediaDataSourceObserver* observer = snkItem->Observer();
-        MDataSink* consumer = snkItem->Consumer();
-        delete snkItem;
-        
-        if (CMMFBuffer::IsSupportedDataBuffer(buffer->Type()))
-            {
-            CTransferBufferCopy* transBufCopy = NULL;
-            CReadRequest* request = NULL;
-            
-            TDes8& bufferDes = STATIC_CAST( CMMFDataBuffer*, buffer )->Data();
-            
-            TInt requestSize;
-            if(buffer->RequestSize())
-                requestSize = buffer->RequestSize();
-            else
-                requestSize = bufferDes.MaxLength();
-            
-            //check whether buffer is safe to send to file server
-            //if not, eg for a transfer buffer, then it needs to be copied
-            if (!CMMFBuffer::IsFileServerSafe(buffer->Type()))
-                {
-                //NB: failure in this method will NOT cause transBufCopy to leak as it will be 
-                //inserted into iTransferBufferCopies by ObtainCopyOfTransferBufferL.
-                TRAP(status,transBufCopy = ObtainCopyOfTransferBufferL(bufferDes.MaxLength()));
-                
-                if(consumer && !observer)
-                    request = new(ELeave) CReadRequest(this,STATIC_CAST(TAny*, consumer), buffer, transBufCopy, iSnkBytes, iDownloadSize, ETrue);
-                else
-                    request = new(ELeave) CReadRequest(this,STATIC_CAST(TAny*, observer), buffer, transBufCopy, iSnkBytes, iDownloadSize, EFalse);					
-                
-                }
-            else
-                {
-                if(consumer && !observer)
-                    request = new(ELeave) CReadRequest(this,STATIC_CAST(TAny*, consumer), buffer, iSnkBytes, iDownloadSize, ETrue);
-                else
-                    request = new(ELeave) CReadRequest(this,STATIC_CAST(TAny*, observer), buffer, iSnkBytes, iDownloadSize, EFalse);					
-                }
-            
-            CleanupStack::PushL( request );
-            
-            TRAP_IGNORE(StoreRequestL(request)); // transfers ownership
-            CleanupStack::Pop() ; // request
-            
-            request->SetActive();
-            
-            //	iSnkBytes += requestSize;
-            
-            if ((iSnkBytes + request->Buffer()->RequestSize()) >= iDownloadSize && isDownloadComplete)
-                {
-    	              request->Buffer()->SetLastBuffer(ETrue);
-                      DEBPRN1(_L("CProgDLMultimediaSource::ServiceFillBuffer() LastBuffer$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"));
-                }
-            
-            iFile->Read(request->BufferDes(), requestSize, request->iStatus);
-            
-            }
-        else // if (CMMFBuffer::IsSupportedDataBuffer(buffer->Type()))
-            return KErrNotSupported;
-        }
-        /*else if(iDownloadSize == iSnkBytes)
-        {
-        Stop();
-    }*/
-    else
-        {
-        
-        //StateChanged(EBUFFERING);
-        return KErrUnderflow;
-        }
-    return status;
-    }
-
-TInt CProgDLMultimediaSource::EmptySinkQueue()
-    {
-    TInt status(KErrNone);
-    // Empty sink queue
-    CSinkQueueItem* snkItem;
-    while ( !iSinkQueue->IsEmpty() )
-        {
-        snkItem = iSinkQueue->First();
-        iSinkQueue->Remove(*snkItem);
-        delete snkItem;
-        }
-    
-    iSnkItemsCount = 0;
-    return status;
-    }
-
-void CProgDLMultimediaSource::CalculateBufferedDataSize()
-    {
-    DEBPRN1(_L("CProgDLMultimediaSource::CalculateBufferedDataSize()"));
-    iBufferedDataSize = 0;
-    
-    // Get the bit rate from observer
-    if(iObserver)
-        iObserver->GetBitRate( iObserverBitRate );
-    
-    // If we don't know observer bit rate
-    if(iDownloadSize == iDLFileSize)
-        {
-        iBufferedDataSize = 0;
-        return;
-        }   
-
-    if(iObserverBitRate == 0 && (iSinkQueue->First() != NULL))
-        {
-            if(iPrimaryBufferingConfig.iType == TBufferingConfig::FIXEDDURATION
-            || iPrimaryBufferingConfig.iType == TBufferingConfig::DYNAMICDURATION)
-                {
-                    if(iSecondaryBufferingConfig.iType == TBufferingConfig::FIXEDDURATION
-                    || iSecondaryBufferingConfig.iType == TBufferingConfig::DYNAMICDURATION)
-                        {
-                        iBufferedDataSize =  iDLFileSize * iInitialBufferingPercentage / 100;       
-                        }
-                    else
-                        {
-                        if(iDLFileSize < iSecondaryBufferingConfig.iAmount)
-                            {
-                            iBufferedDataSize = iDLFileSize;
-                            }
-                        else
-                            {
-                            iBufferedDataSize = iSecondaryBufferingConfig.iAmount;
-                            }
-                        }    
-                }
-            else
-                {
-                if(iDLFileSize < iPrimaryBufferingConfig.iAmount)
-                    {
-                    iBufferedDataSize = iDLFileSize;
-                    }
-                else
-                    {
-                    iBufferedDataSize = iPrimaryBufferingConfig.iAmount;
-                    }
-                }                
-            
-        }
-     else
-        {
-            if(iPrimaryBufferingConfig.iType == TBufferingConfig::FIXEDDURATION
-            || iPrimaryBufferingConfig.iType == TBufferingConfig::DYNAMICDURATION)
-                {
-                TUint constantC = KMinPlaybackDuration * iObserverBitRate / 8;
-
-                // calculate time remaining
-                //TInt64 timeRemaining = ( iDLFileSize - iSnkBytes ) * 8 / iObserverBitRate;
-                TUint bytesRemaining = iDLFileSize - iSnkBytes;
-                iBufferedDataSize = bytesRemaining < constantC ? bytesRemaining : constantC;
-
-//                timeRemaining = timeRemaining < 0 ? 0 : timeRemaining;
-
-                // calculate the value in a temporary variable
-//                TInt64 bufferedDataSize = ((TInt64(iObserverBitRate)) - (TInt64(iTransferRate))) * timeRemaining / 8;
-//                bufferedDataSize = bufferedDataSize < constantC ? bufferedDataSize : constantC;
-
-//                iBufferedDataSize = bufferedDataSize > KMaxTUint ? KMaxTUint : I64LOW(bufferedDataSize);
-                }
-            else
-                {
-                iBufferedDataSize = iPrimaryBufferingConfig.iAmount;
-                }                
-        }   
-
-    DEBPRN5(_L("CProgDLMultimediaSource::CalculateBufferdDataSize[%u] ObserverBitRate[%d] SnkBytes[%u] TransferRate[%d]"), iBufferedDataSize,iObserverBitRate,iSnkBytes,iTransferRate );
-    }
-
-void CProgDLMultimediaSource::StateChanged(TState newState)
-    {
-    DEBPRN3(_L("CProgDLMultimediaSource::StateChanged OLD[%d] NEW[%d]"),iState, newState);        
-    if(iState != newState)
-        {
-        if(iMessage)
-            {
-            if(!iMessage->IsCompleted())
-                {
-                TPckgBuf<TState> statePckg(newState);	
-                iMessage->WriteDataToClient(statePckg);
-                iMessage->Complete(KErrNone);
-                delete iMessage;
-                iMessage = NULL;
-                }
-            }
-        iState = newState;
-        }
-    }
-
-TInt CProgDLMultimediaSource::ReadRequestStatus(CReadWriteRequest* aRequest, TRequestStatus& aStatus)
-    {
-    
-    if(aStatus != KErrNone)
-        {
-        TMMFEvent event(KMMFErrorCategoryControllerGeneralError, aStatus.Int());
-        iEventHandler->SendEventToClient(event);
-        return KErrNone;
-        }
-    else
-        {
-        
-        DEBPRN4(_L("CProgDLMultimediaSource::ReadRequestStatus Buffer[%x] BufferSize[%d] RequestSize[%d]"),aRequest->Buffer(),aRequest->Buffer()->BufferSize(),aRequest->Buffer()->RequestSize());
-        DEBPRN3(_L("CProgDLMultimediaSource::ReadRequestStatus Buffer[%x] LastBuffer[%d]"),aRequest->Buffer(),aRequest->Buffer()->LastBuffer());
-        
-        TBool lastBuffer = aRequest->Buffer()->LastBuffer();
-        
-        if((aRequest->Buffer()->BufferSize() != aRequest->Buffer()->RequestSize()) && !lastBuffer)
-            {
-            if(aRequest->SourceType())
-                {
-                MDataSink* sinkOrSource = REINTERPRET_CAST(MDataSink*,aRequest->GetSinkOrSource());
-                TUint position = aRequest->Buffer()->Position();
-                TUint newPos = position - aRequest->Buffer()->BufferSize();
-                aRequest->Buffer()->SetPosition(newPos);
-                AppendBufferToSinkQueue(aRequest->Buffer(),(MMultimediaDataSourceObserver*)NULL,sinkOrSource,ETrue);
-                //iSnkBytes -= aRequest->Buffer()->BufferSize();
-                iFile->Seek(ESeekStart,iSnkBytes);
-                StateChanged(EBUFFERING);
-                }
-            else
-                {
-                MMultimediaDataSourceObserver* sinkOrSource = REINTERPRET_CAST(MMultimediaDataSourceObserver*,aRequest->GetSinkOrSource());
-                TInt position = aRequest->Buffer()->Position();
-                TInt newPos = position - aRequest->Buffer()->BufferSize();
-                aRequest->Buffer()->SetPosition(newPos);
-                AppendBufferToSinkQueue(aRequest->Buffer(),sinkOrSource,(MDataSink*)NULL,ETrue);
-                //iSnkBytes -= aRequest->Buffer()->BufferSize();
-                iFile->Seek(ESeekStart,iSnkBytes);
-                StateChanged(EBUFFERING);
-                }
-            }
-        else
-            {	
-            iSnkBytes += aRequest->Buffer()->BufferSize();
-            
-            
-            if(aRequest->SourceType())
-                    REINTERPRET_CAST(MDataSink*, aRequest->GetSinkOrSource())->BufferFilledL(aRequest->Buffer()) ; // callback to MDataSource/Sink
-            else
-                    REINTERPRET_CAST(MMultimediaDataSourceObserver*, aRequest->GetSinkOrSource())->BufferFilled(aRequest->Buffer()) ; // callback to MDataSource/Sink			
-                
-                
-            }
-            
-        iReadRequestPending--;
-        DEBPRN4(_L("CProgDLMultimediaSource::ReadRequestStatus iReadRequestPending[%d] isDownloadComplete[%d] iReOpenCAF[%d]"),iReadRequestPending,isDownloadComplete,iReOpenCAF);        
-        if(!iReadRequestPending && isDownloadComplete && !iReOpenCAF)
-            {
-            ReOpenCAF();
-            while ( !iSinkQueue->IsEmpty() )
-                {
-                TInt err = ServiceFillBuffer();
-                if(err == KErrUnderflow)
-                    {
-                    StateChanged(EBUFFERING);
-                    break;
-                    }
-                }
-            }
-        
-        aRequest->SetStatus(ETrue);
-        return KErrNone;		
-        }
-    }
-
-
-TInt CProgDLMultimediaSource::ReOpenCAF()
-    {
-    TInt status(KErrNone);
-    DEBPRN2(_L("CProgDLMultimediaSource::StateChanged ReOpenCAF[%d]"),iSnkBytes);     
-    delete iFile;
-    iFile = NULL;
-    
-    if (!iFile)
-        {
-        if (iFileHandle)
-            {
-            TRAPD(status,iFile = CContentFile::NewL(iHandle, UniqueId(), iCAFParameters->iEnableUI));
-            if(status)
-                return status;
-            }
-        else
-            {
-            // Open for read-only access
-            TRAPD(status,iFile = CContentFile::NewL(iFsSession, iFullFileName, UniqueId(), EFileShareAny, iCAFParameters->iEnableUI));
-            if(status)
-                return status;                    
-            }
-            
-         if(!status)
-            iFile->Seek(ESeekCurrent,iSnkBytes);   
-        }
-    
-    if(iFile)
-        {
-        if(iFile->IsProtected())
-            {
-            iFile->Size(iFileSize);
-            iDownloadSize = iFileSize;
-            iDLFileSize = iFileSize;
-            
-			if(iObserver)
-				{
-				iObserver->Event(KMultimediaDataSourceObserverEventSourceSizeChanged);
-				}
-            }
-        else
-            {
-			iFileSize = iDLFileSize;		          
-            }
-        }												
-
-    iReOpenCAF = ETrue;
-    DEBPRN3(_L("CProgDLMultimediaSource::StateChanged Exit status[%d] iFileSize[%d]"),status,iFileSize);     
-    return status;    
-    }
-
-void CProgDLMultimediaSource::GetAudioConfiguration()
-    {
-    TInt bufType = 0;
-    TInt bufAmount = 0;
-    TInt bufPer = 0;
-    
-    iAudioConfigRepository->Get(KPDLPrimaryBufferingType,bufType);
-    iAudioConfigRepository->Get(KPDLPrimaryBufferingAmount,bufAmount);
-    
-    iPrimaryBufferingConfig.iType = TBufferingConfig::TBufferingType(bufType);
-    iPrimaryBufferingConfig.iAmount = bufAmount;
-    
-    iAudioConfigRepository->Get(KPDLSecondaryBufferingType,bufType);
-    iAudioConfigRepository->Get(KPDLSecondaryBufferingAmount,bufAmount);
-    
-    iSecondaryBufferingConfig.iType = TBufferingConfig::TBufferingType(bufType);
-    iSecondaryBufferingConfig.iAmount = bufAmount;
-    
-    iAudioConfigRepository->Get(KPDLInitialBufferingPercentage,bufPer);
-    iInitialBufferingPercentage = bufPer;
-    }
-
-TInt CProgDLMultimediaSource::Seek(TUint aPosInBytes)
-    {
-    DEBPRN2(_L("CProgDLMultimediaSource::Seek[%d]]"), aPosInBytes );
-    TInt status(KErrNone);
-    if(aPosInBytes <= iFileSize)
-        {
-        iSnkBytes = aPosInBytes;
-        status = iFile->Seek(ESeekStart,iSnkBytes);
-        }
-    else
-        {
-        status = KErrNotReady;        
-        }
-    return status;
-    }
-
-TInt CProgDLMultimediaSource::GetSeekingSupport( TBool& aSeekSupport )
-    {
-    aSeekSupport = ETrue;
-    return KErrNone;
-    }
-
-TInt CProgDLMultimediaSource::GetRandomSeekingSupport( TBool& aSeekSupport )
-    {
-    aSeekSupport = ETrue;
-    return KErrNone;
-    }
-//End of File
-
--- a/mmfenh/enhancedmediaclient/Plugins/ProgDLSource/src/SinkQueueItem.cpp	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +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:  Implementation of ProgDL Source Reader active object.
-*
-*/
-
-
-
-// INCLUDE FILES
-#ifdef _DEBUG
-#include    <e32svr.h>
-#endif
-
-#include "SinkQueueItem.h"
-#include <mmfdatasource.h>
-#include <mmfdatasink.h>
-#include <MultimediaDataSource.h>
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// CSinkQueueItem::CSinkQueueItem
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// -----------------------------------------------------------------------------
-//
-CSinkQueueItem::CSinkQueueItem(
-                               CMMFBuffer* aBuffer,
-                               MMultimediaDataSourceObserver* aMMDSObserver,
-                               MDataSink* aConsumer )
-                               :iBuffer(aBuffer),
-                               iMMDSObserver(aMMDSObserver),
-                               iConsumer(aConsumer)
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// CSinkQueueItem::ConstructL
-// Symbian 2nd phase constructor can leave.
-// -----------------------------------------------------------------------------
-//
-void CSinkQueueItem::ConstructL()
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// CSinkQueueItem::NewL
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-//
-CSinkQueueItem* CSinkQueueItem::NewL(
-                                     CMMFBuffer* aBuffer,
-                                     MMultimediaDataSourceObserver* aMMDSObserver,
-                                     MDataSink* aConsumer )
-    {
-    CSinkQueueItem* self = new(ELeave) CSinkQueueItem( aBuffer, aMMDSObserver, aConsumer );
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-
-// -----------------------------------------------------------------------------
-// CSinkQueueItem::~CSinkQueueItem
-// Destructor
-// -----------------------------------------------------------------------------
-//
-CSinkQueueItem::~CSinkQueueItem()
-    {
-    }
-
-CMMFDataBuffer* CSinkQueueItem::Buffer()
-    {    
-    return static_cast<CMMFDataBuffer*>(iBuffer);
-    }
-
-MMultimediaDataSourceObserver* CSinkQueueItem::Observer()
-    {
-    return iMMDSObserver;
-    }
-
-MDataSink* CSinkQueueItem::Consumer()
-    {
-    return iConsumer;
-    }
-
-// End of file
--- a/mmfenh/enhancedmediaclient/Plugins/ProgDLSource/src/SinkQueueItem.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +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 the ProgDL source reader active object class
-*
-*/
-
-
-#ifndef SINKQUEUEITEM_H
-#define SINKQUEUEITEM_H
-
-// INCLUDES
-#include <e32base.h>
-
-class CMMFBuffer;
-class CMMFDataBuffer;
-class MMultimediaDataSourceObserver;
-class MDataSink;
-
-class CSinkQueueItem : public CBase
-    {
-    public: // Constructors and destructor
-        static CSinkQueueItem* NewL( 
-            CMMFBuffer* aBuffer,
-            MMultimediaDataSourceObserver* aMMDSObserver,
-            MDataSink* aConsumer );
-        virtual ~CSinkQueueItem();
-        
-        CMMFDataBuffer* Buffer();
-        MMultimediaDataSourceObserver* Observer();
-        // This exists for legacy support
-        MDataSink* Consumer();
-        
-    private:
-        CSinkQueueItem(
-            CMMFBuffer* aBuffer,
-            MMultimediaDataSourceObserver* aMMDSObserver,
-            MDataSink* aConsumer );
-        void ConstructL();
-        
-    public:
-        // next item
-        TSglQueLink* iLink;
-        
-    private:
-        // Buffer to be sent to server-side
-        CMMFBuffer* iBuffer;
-        // Reference to Multimedia data source observer
-        MMultimediaDataSourceObserver* iMMDSObserver;
-        // Reference to MDataSink
-        MDataSink* iConsumer;
-    };
-
-#endif      // SINKQUEUEITEM_H
-
-//  End of File
--- a/mmfenh/enhancedmediaclient/Plugins/ProgDLSource/src/fileaccess.cpp	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,303 +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:  Implementation of FileAccess Classes.
-*
-*/
-
-#include <f32file.h>
-#include <e32std.h>
-#include <caf/attribute.h>
-#include <caf/bitset.h>
-#include <caf/content.h>
-#include <caf/data.h>
-using namespace ContentAccess;
-#include <f32file.h>
-
-#include "FileAccess.h"
-
-CF32File::~CF32File()
-    {
-    if (!iFileHandle)
-        iFile.Close();
-    delete iFilePath;
-    }
-
-CF32File* CF32File::NewL(RFs& aSession, TDesC& aFilePath, TUint aMode) 
-    {
-    CF32File* self = new (ELeave) CF32File;
-    CleanupStack::PushL(self);
-    self->ConstructL(aSession, aFilePath, aMode);
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-
-void CF32File::ConstructL(RFs& aSession, TDesC& aPath, TUint aFileMode)
-    {
-    iSession = &aSession;
-    iFilePath = aPath.AllocL();
-    TUint attributes = 0;
-    TInt err = iSession->Att(*iFilePath, attributes);
-    if (err == KErrNone)
-        {
-        if ( attributes & KEntryAttReadOnly )
-            User::LeaveIfError(iFile.Open(*iSession, *iFilePath, EFileShareReadersOnly )) ;
-        else //if ( !( attributes & KEntryAttReadOnly ) )
-            User::LeaveIfError(iFile.Open(*iSession, *iFilePath, aFileMode)) ;
-        }
-    else if ((err == KErrNotFound) && (aFileMode & EFileWrite))
-        {
-        User::LeaveIfError(iFile.Create(*iSession, *iFilePath, aFileMode )) ;
-        }
-    else
-        {
-        User::Leave(err);
-        }
-    }
-
-
-RFile& CF32File::FileL() 
-    {
-    return iFile;
-    }
-
-TInt CF32File::Seek(TSeek aSeekMode, TInt aPos)
-    {
-    return iFile.Seek(aSeekMode, aPos);
-    }
-
-TInt CF32File::Read(TDes8& aDes,TInt aLength)
-    {
-    return iFile.Read(aDes, aLength);
-    }
-
-void CF32File::Read(TDes8& aDes, TInt aLength, TRequestStatus& aStatus)
-    {
-    iFile.Read(aDes, aLength, aStatus);
-    }
-
-TInt CF32File::Write(const TDesC8& aDes,TInt aLength)
-    {
-    return iFile.Write(aDes, aLength);
-    }
-
-void CF32File::Write(const TDesC8& aDes, TInt aLength, TRequestStatus& aStatus)
-    {
-    iFile.Write(aDes, aLength, aStatus);
-    }
-
-TInt CF32File::Size(TInt& aSize)
-    {
-    return iFile.Size(aSize);
-    }
-
-TInt CF32File::SetSize(TInt aSize)	
-    {
-    TInt err =  iFile.SetSize(aSize);
-    if(err == KErrNone)
-        iFileSize = aSize;
-    else
-        iFileSize = -1;
-    
-    return err;
-    }
-
-TInt CF32File::EvaluateIntent(TIntent /*aIntent*/) const
-    {
-    return KErrNone;
-    }
-
-
-TInt CF32File::ExecuteIntent(TIntent /*aIntent*/)
-    {
-    return KErrNone;
-    }
-
-TBool CF32File::IsProtected() const
-    {
-    return EFalse;
-    }
-
-TInt CF32File::SetAgentProperty(TAgentProperty /*aProperty*/, TInt /*aValue*/)
-    {
-    // not an error to set this if not supported, just wont do anything
-    return KErrNone;
-    }
-
-CContentFile::~CContentFile()
-    {
-    delete iData;
-    
-    if (iLegacyFileOpen)
-        iLegacyFile.Close();
-    delete iFilePath;
-    }
-
-
-CContentFile* CContentFile::NewL(RFs& aSession, const TDesC& aFilePath, const TDesC& aUniqueId, TUint aMode, TBool aEnableUI) 
-    {
-    CContentFile* self = new (ELeave) CContentFile;
-    CleanupStack::PushL(self);
-    self->ConstructL(aSession, aFilePath, aUniqueId, aMode, aEnableUI);
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-void CContentFile::ConstructL(RFs& aSession, const TDesC& aPath, const TDesC& aUniqueId, TUint /*aMode*/, TBool aEnableUI)
-    {
-    iSession = &aSession;
-    iFilePath = aPath.AllocL();
-    
-    // Assume that we want the content to be shared and read-only.
-    if (aUniqueId.Length() > 0)
-        {
-        iData = CData::NewL(TVirtualPathPtr(*iFilePath, aUniqueId), EContentShareReadWrite);
-        }
-    else
-        {
-        iData = CData::NewL(TVirtualPathPtr(*iFilePath), EContentShareReadWrite);
-        }
-    
-    TInt err = iData->SetProperty(EAgentPropertyAgentUI, aEnableUI);
-    if (err != KErrNone && err != KErrCANotSupported)
-        {
-        User::Leave(err);
-        }
-    User::LeaveIfError(iData->EvaluateIntent(EPeek));
-    }
-
-
-
-TInt CContentFile::EvaluateIntent(TIntent aIntent) const
-    {
-    ASSERT(iData);
-    return iData->EvaluateIntent(aIntent);
-    }
-
-
-TInt CContentFile::ExecuteIntent(TIntent aIntent)
-    {
-    ASSERT(iData);
-    return iData->ExecuteIntent(aIntent);
-    }
-
-TBool CContentFile::IsProtected() const
-    {
-    ASSERT(iData);
-    TInt value = 0;
-    TInt err =iData->GetAttribute(EIsProtected, value);
-    return (err == KErrNone && value);
-    }
-
-TInt CContentFile::SetAgentProperty(ContentAccess::TAgentProperty aProperty, TInt aValue)
-    {
-    ASSERT(iData);
-    return iData->SetProperty(aProperty, aValue);
-    }
-
-TInt CContentFile::Seek(TSeek aSeekMode, TInt aPos)
-    {
-    ASSERT(iData);
-    return iData->Seek(aSeekMode, aPos);
-    }
-
-TInt CContentFile::Read(TDes8& aDes,TInt aLength)
-    {
-    ASSERT(iData);
-    return iData->Read(aDes,aLength);
-    }
-
-void CContentFile::Read(TDes8& aDes, TInt aLength, TRequestStatus& aStatus)
-    {
-    ASSERT(iData);
-    iData->Read(aDes, aLength, aStatus);
-    }
-
-TInt CContentFile::Write(const TDesC8& /*aDes*/,TInt /*aLength*/)
-    {
-    return KErrAccessDenied;
-    }
-void CContentFile::Write(const TDesC8& /*aDes*/, TInt /*aLength*/, TRequestStatus& aStatus)
-    {
-    TRequestStatus* status = &aStatus;
-    User::RequestComplete(status, KErrAccessDenied);
-    }
-
-TInt CContentFile::SetSize(TInt /*aSize*/)
-    {
-    // Only a source is implemented, hence this cannot be allowed
-    return KErrAccessDenied;
-    }
-
-
-// Get the size of file
-// this method opens a new, read-only, RFile the first time this method is called
-
-TInt CContentFile::Size(TInt& aSize)
-    {
-    ASSERT(iData);
-    TRAPD(err, iData->DataSizeL(aSize));
-    return err;
-    }
-
-    /**
-    * return a RFile for the legacy RFile method
-    * this method opens a new, read-only, RFile the first time this method is called
-    * @internalTechnology
-    * @return Reference to RFile handle to current file
-*/
-RFile& CContentFile::FileL() 
-    {
-    if (!iLegacyFileOpen)
-        {
-        User::LeaveIfError(iLegacyFile.Open(*iSession, *iFilePath, EFileRead | EFileStream | EFileShareReadersOnly));
-        iLegacyFileOpen = ETrue;
-        }
-    return iLegacyFile;
-    }
-
-CF32File* CF32File::NewL(RFile& aFile) 
-    {
-    CF32File* self = new (ELeave) CF32File;
-    CleanupStack::PushL(self);
-    self->ConstructL(aFile);
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-void CF32File::ConstructL(RFile& aFile)
-    {
-    iFile = aFile;
-    iFileHandle = ETrue;
-    }
-
-CContentFile* CContentFile::NewL(RFile& aFile, const TDesC& aUniqueId, TBool aEnableUI) 
-    {
-    CContentFile* self = new (ELeave) CContentFile;
-    CleanupStack::PushL(self);
-    self->ConstructL(aFile, aUniqueId, aEnableUI);
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-void CContentFile::ConstructL(RFile& aFile, const TDesC& aUniqueId, TBool aEnableUI)
-    {
-    iData = CData::NewL(aFile, aUniqueId);
-    TInt err = iData->SetProperty(EAgentPropertyAgentUI, aEnableUI);
-    if (err != KErrNone && err != KErrCANotSupported)
-        {
-        User::Leave(err);
-        }
-    User::LeaveIfError(iData->EvaluateIntent(EPeek));
-    }
--- a/mmfenh/enhancedmediaclient/Plugins/TransferRateMonitor/BWINS/TransferRateMonitor.def	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-EXPORTS
-	??1CTransferRateMonitor@@UAE@XZ @ 1 NONAME ; CTransferRateMonitor::~CTransferRateMonitor(void)
-	?NewL@CTransferRateMonitor@@SAPAV1@AAVMTransferRateObserver@@II@Z @ 2 NONAME ; class CTransferRateMonitor * CTransferRateMonitor::NewL(class MTransferRateObserver &, unsigned int, unsigned int)
-	?Reset@CTransferRateMonitor@@QAEHXZ @ 3 NONAME ; int CTransferRateMonitor::Reset(void)
-	?Start@CTransferRateMonitor@@QAEHXZ @ 4 NONAME ; int CTransferRateMonitor::Start(void)
-	?Stop@CTransferRateMonitor@@QAEXXZ @ 5 NONAME ; void CTransferRateMonitor::Stop(void)
-	?Tick@CTransferRateMonitor@@CAHPAX@Z @ 6 NONAME ; int CTransferRateMonitor::Tick(void *)
-	?TransferRate@CTransferRateMonitor@@QAEIXZ @ 7 NONAME ; unsigned int CTransferRateMonitor::TransferRate(void)
-
--- a/mmfenh/enhancedmediaclient/Plugins/TransferRateMonitor/EABI/TransferRateMonitor.def	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-EXPORTS
-	_ZN20CTransferRateMonitor12TransferRateEv @ 1 NONAME
-	_ZN20CTransferRateMonitor4NewLER21MTransferRateObserverjj @ 2 NONAME
-	_ZN20CTransferRateMonitor4StopEv @ 3 NONAME
-	_ZN20CTransferRateMonitor4TickEPv @ 4 NONAME
-	_ZN20CTransferRateMonitor5ResetEv @ 5 NONAME
-	_ZN20CTransferRateMonitor5StartEv @ 6 NONAME
-	_ZN20CTransferRateMonitorD0Ev @ 7 NONAME
-	_ZN20CTransferRateMonitorD1Ev @ 8 NONAME
-	_ZN20CTransferRateMonitorD2Ev @ 9 NONAME
-	_ZTI20CTransferRateMonitor @ 10 NONAME DATA 12 ; #<TI>#
-	_ZTV20CTransferRateMonitor @ 11 NONAME DATA 20 ; #<VT>#
-
--- a/mmfenh/enhancedmediaclient/Plugins/TransferRateMonitor/group/TransferRateMonitor.mmp	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +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:  Project file for EnhancedMediaClient Utility
-*
-*/
-
-
-#include <data_caging_paths.hrh>
-#include <platform_paths.hrh>
-
-TARGET          TransferRateMonitor.dll
-TARGETTYPE      DLL
-UID             0x1000008D 0x10207B4D
-CAPABILITY      CAP_GENERAL_DLL
-VENDORID        VID_DEFAULT
-
-SOURCEPATH      ../src
-SOURCE          TransferRateMonitor.cpp
-
-USERINCLUDE     ../inc
-USERINCLUDE	    ../../../../inc
-
-MW_LAYER_SYSTEMINCLUDE
-
-LIBRARY         euser.lib
-
-DEFFILE         TransferRateMonitor.def
-NOSTRICTDEF
--- a/mmfenh/enhancedmediaclient/Plugins/TransferRateMonitor/group/bld.inf	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +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:  Blf.inf file for the TransferRateMonitor Project
-*
-*/
-
-
-PRJ_EXPORTS
-
-
-PRJ_MMPFILES
-TransferRateMonitor.mmp
--- a/mmfenh/enhancedmediaclient/Plugins/TransferRateMonitor/inc/TransferRateMonitor.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +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:  Project file for EnhancedMediaClient Utility
-*
-*/
-
-
-#ifndef TRANSFERRATEMONITOR_H
-#define TRANSFERRATEMONITOR_H
-
-#include <e32base.h>
-
-class MTransferRateObserver
-    {
-    public:
-        // Called by CTransferRateMonitor when transfer rate changes by delta.
-        virtual void TransferRateChanged() = 0;
-        virtual TInt GetCurrentSize( TUint& aCurrentSize ) = 0;
-    };
-
-class CTransferRateMonitor : public CBase
-    {
-    public:
-        IMPORT_C static CTransferRateMonitor* NewL( MTransferRateObserver& aObserver,
-            TUint aFrequency,
-            TUint aDelta ) ;
-        IMPORT_C ~CTransferRateMonitor();
-        
-        // Returns previously calculated transfer rate.
-        IMPORT_C TUint TransferRate();
-        
-        IMPORT_C TInt Start();
-        IMPORT_C void Stop();
-        IMPORT_C TInt Reset();
-        
-    private:
-        CTransferRateMonitor( MTransferRateObserver& aObserver,
-            TUint aFrequency,
-            TUint aDelta ) ;
-        void ConstructL();
-        
-        static TInt Tick(TAny* aObject);
-        void DoTick();
-        
-    private:
-        // Pointer reference to observer
-        MTransferRateObserver* iObserver;
-        // Frequency in seconds after which timer need to go off
-        TUint iFrequency;
-        // Change in transfer rate that will trigger observer callback
-        TUint iDelta;
-        // Current transfer rate
-        TUint iTransferRate;
-        // Reference transfer rate at which observer callback was triggered
-        TUint iRefTransferRate;
-        // Size from last transfer rate calculation
-        TUint iPrevSize;
-        // timer
-        CPeriodic* iPeriodic;
-    };
-
-#endif // TRANSFERRATEMONITOR_H
-
-//  End of File
--- a/mmfenh/enhancedmediaclient/Plugins/TransferRateMonitor/src/TransferRateMonitor.cpp	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,113 +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:  Project file for EnhancedMediaClient Utility
-*
-*/
-
-
-#include "TransferRateMonitor.h"
-#include <MultimediaDataSource.h>
-
-CTransferRateMonitor::CTransferRateMonitor( MTransferRateObserver& aObserver,
-                                           TUint aFrequency,
-                                           TUint aDelta )
-                                           : iObserver(&aObserver),
-                                           iFrequency(aFrequency),
-                                           iDelta(aDelta)
-    {
-    // Create timer here
-    }
-
-EXPORT_C CTransferRateMonitor::~CTransferRateMonitor()
-    {
-    if ( iPeriodic )
-        {
-        iPeriodic->Cancel();
-        }
-    delete iPeriodic;
-    }
-EXPORT_C CTransferRateMonitor* CTransferRateMonitor::NewL( MTransferRateObserver& aObserver,
-                                                          TUint aFrequency,
-                                                          TUint aDelta )
-    {
-    CTransferRateMonitor* self = new (ELeave)CTransferRateMonitor( aObserver, aFrequency, aDelta );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-void CTransferRateMonitor::ConstructL()
-    {
-    iPeriodic = CPeriodic::NewL( CActive::EPriorityStandard );
-    }
-
-EXPORT_C TUint CTransferRateMonitor::TransferRate()
-    {
-    return iTransferRate;
-    }
-
-EXPORT_C TInt CTransferRateMonitor::Start()
-    {
-    TInt status(KErrNotReady);
-    if ( !iPeriodic->IsActive() )
-        {
-        TTimeIntervalMicroSeconds32 interval( iFrequency * 1000000 ); // Convert to micro seconds
-        iPeriodic->Start( interval, interval, TCallBack(Tick, this) );
-        status = KErrNone;
-        }
-    return status;
-    }
-
-EXPORT_C void CTransferRateMonitor::Stop()
-    {
-    iPeriodic->Cancel();
-    }
-
-EXPORT_C TInt CTransferRateMonitor::Reset()
-    {
-    TInt status(KErrNotReady);
-    if ( !iPeriodic->IsActive() )
-        {
-        iTransferRate = 0;
-        iRefTransferRate = 0;
-        iPrevSize = 0;
-        status = KErrNone;
-        }
-    return status;
-    }
-
-EXPORT_C TInt CTransferRateMonitor::Tick(TAny* aObject)
-    {
-    ((CTransferRateMonitor*)aObject)->DoTick();
-    return 1;
-    }
-
-void CTransferRateMonitor::DoTick()
-    {
-    TUint curSize(0);
-    if (iObserver->GetCurrentSize(curSize) == KErrNone)
-        {
-        iTransferRate = ( curSize - iPrevSize ) * 8 / iFrequency;
-        iPrevSize = curSize;
-        TInt diffInTransferRate = Abs ( iTransferRate - iRefTransferRate );
-        if ( diffInTransferRate >= iDelta )
-            {
-            iRefTransferRate = iTransferRate;
-            iObserver->TransferRateChanged();
-            }
-        }
-    }
-
-//  End of File
--- a/mmfenh/enhancedmediaclient/group/bld.inf	Mon May 03 12:59:52 2010 +0300
+++ b/mmfenh/enhancedmediaclient/group/bld.inf	Fri May 14 16:22:35 2010 +0300
@@ -31,12 +31,10 @@
 PRJ_MMPFILES
 #include "../Plugins/StreamControlCustomCommands/group/bld.inf"
 #include "../Plugins/DataBufferSource/group/bld.inf"
-#include "../Plugins/ProgDLSource/group/bld.inf"
 #include "../Plugins/DescriptorSource/group/bld.inf"
 #include "../Plugins/FileSource/group/bld.inf"
 #include "../Plugins/CacheSource/group/bld.inf"
 #include "../Plugins/DataSourceConfigIntfc/group/bld.inf"
-#include "../Plugins/TransferRateMonitor/group/bld.inf"
 #include "../Client/group/bld.inf"
 #include "../Plugins/MultimediaDataSource/group/bld.inf"
 #include "../Plugins/MultimediaDataSource/DataSourceFactory/group/bld.inf"
--- a/mmfenh/enhancedmediaclient/rom/EnhancedMediaClient.iby	Mon May 03 12:59:52 2010 +0300
+++ b/mmfenh/enhancedmediaclient/rom/EnhancedMediaClient.iby	Fri May 14 16:22:35 2010 +0300
@@ -29,9 +29,7 @@
 
 
 file=ABI_DIR\BUILD_DIR\EnhancedMediaClient.dll	            SHARED_LIB_DIR\EnhancedMediaClient.dll
-file=ABI_DIR\BUILD_DIR\TransferRateMonitor.dll		        SHARED_LIB_DIR\TransferRateMonitor.dll
 
-ECOM_PLUGIN(ProgDLSource.dll,ProgDLSource.rsc)
 ECOM_PLUGIN(DataBufferSource.DLL,DataBufferSource.rsc)
 ECOM_PLUGIN(FileSource.DLL,FileSource.rsc)
 ECOM_PLUGIN(DescriptorDataSource.DLL,DescriptorDataSource.rsc)
--- a/mmfenh/group/bld.inf	Mon May 03 12:59:52 2010 +0300
+++ b/mmfenh/group/bld.inf	Fri May 14 16:22:35 2010 +0300
@@ -28,8 +28,6 @@
 #include "../enhancedaudioplayerutility/Group/bld.inf"
 #include "../enhancedmediaclient/group/bld.inf"
 #include "../profilesettingsmonitor/group/bld.inf"
-#include "../progressivedownload/group/bld.inf"
-
 
 
 //  End of File
--- a/mmfenh/progressivedownload/Data/Create_ProgressiveDownload_STUB_SIS.bat	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +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 "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: batch file for PDU
-rem
-
-makesis -s ProgressiveDownload_Stub.pkg ProgressiveDownload_Stub.sis
Binary file mmfenh/progressivedownload/Data/ProgressiveDownload_Stub.SIS has changed
--- a/mmfenh/progressivedownload/Data/ProgressiveDownload_Stub.pkg	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +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: pkg for PDU
-;
-;Language
-&en
-
-;Header
-# {"Progressive Download"}, (0x10207BC3), 1, 0, 0, TYPE=SA, RU
-
-;Dependency header
-
-;Localised Vendor name
-%{"Nokia"}
-
-;Unique Vendor name
-:"Nokia"
-
-;Optional logofile
-
-;Files to install
--- a/mmfenh/progressivedownload/ProgressiveDownloadSource/BWINS/PROGRESSIVEDOWNLOADSOURCE.def	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
-	?ImplementationGroupProxy@@YAPBUTImplementationProxy@@AAH@Z @ 1 NONAME ; struct TImplementationProxy const * __cdecl ImplementationGroupProxy(int &)
-
--- a/mmfenh/progressivedownload/ProgressiveDownloadSource/data/10207a7b.rss	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
-* Copyright (c) 1020 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Resource file for ECOM registry for ProgressiveDownloadSource.
-*
-*/
-
-
-
-
-
-
-#include "ProgressiveDownloadSourceUIDs.hrh"
-#include <mmfplugininterfaceuids.hrh>
-#include <registryinfo.rh>
-
-
-RESOURCE REGISTRY_INFO theInfo 
-    {
-    dll_uid = 0x10207A7B; //The DLL's 3rd UID.
-    interfaces = 
-        {
-        INTERFACE_INFO
-            {
-            interface_uid = KMmfUidPluginInterfaceDataSource; //ECOM UID 
-            implementations = 
-                {
-                // This DLL contains only a single adapter implementation.
-                IMPLEMENTATION_INFO
-                    {
-                    implementation_uid = KProgressiveDownloadSourceUid; //UID 
-                             // Same value as in implementation table.
-                    version_no = 1;
-                    display_name = "ProgressiveDownloadSource"; //Human readable string for UI purposes.
-                    default_data = ""; //Ignored.
-                    opaque_data = ""; //Ignored.
-                    }
-                };
-            }
-        };
-    }
-
--- a/mmfenh/progressivedownload/ProgressiveDownloadSource/group/ProgressiveDownloadSource.mmp	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
-* Copyright (c) 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 Progressive Dowload DataSource
-*
-*/
-
-
-#include <data_caging_paths.hrh>
-#include <platform_paths.hrh>
-
-
-TARGET        	ProgressiveDownloadSource.dll
-
-TARGETTYPE	PLUGIN
-
-
-UID           	0x10009d8d 0x10207A7B
-
-
-CAPABILITY  CAP_ECOM_PLUGIN
-VENDORID    VID_DEFAULT
-
-
-
-TARGETPATH /System/Libs/Plugins
-
-
-SOURCEPATH      ../src
-SOURCE          fileaccess.cpp 
-SOURCE			ProgressiveDownloadSource.cpp
-
-SOURCEPATH      ../data
-
-
-START RESOURCE	10207a7b.rss
-TARGET ProgressiveDownloadSource.rsc
-END
-
-
-
-USERINCLUDE     ../inc ../src
-USERINCLUDE	../../../../inc
- 
-MW_LAYER_SYSTEMINCLUDE
-SYSTEMINCLUDE	/epoc32/include/ecom
-SYSTEMINCLUDE	/epoc32/include/mmf/server
-SYSTEMINCLUDE	/epoc32/include/mmf/common
-SYSTEMINCLUDE	/epoc32/include/mmf/plugin
-
-
-
-LIBRARY 	euser.lib
-LIBRARY 	ECom.lib
-LIBRARY 	efsrv.lib
-LIBRARY 	mmfcontrollerframework.lib
-LIBRARY 	estor.lib
-LIBRARY 	mmfserverbaseclasses.lib
-LIBRARY 	caf.lib
-LIBRARY		cafutils.lib
-
-
-
--- a/mmfenh/progressivedownload/ProgressiveDownloadSource/group/bld.inf	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-/*
-* Copyright (c) 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 ProgressiveDownloadSource
-*
-*/
-
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_MMPFILES
-progressivedownloadsource.mmp
-
-
--- a/mmfenh/progressivedownload/ProgressiveDownloadSource/src/FileAccess.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,159 +0,0 @@
-/*
-* Copyright (c) 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:  Progressive Download Utility
-*
-*/
-
-#ifndef __FILE_ACCESS_H__
-#define __FILE_ACCESS_H__
-
-#include <caf/content.h>
-#include <caf/data.h>
-#include <mmf/common/mmcaf.h>
-
-// Abstract class providing generic file access
-class MGenericFile
-	{
-public:
-	virtual ~MGenericFile();
-
-	virtual TInt Seek(TSeek aSeekMode, TInt aPosition)=0;
-	virtual TInt Read(TDes8& aDes,TInt aLength)=0;
-	virtual void Read(TDes8& aDes, TInt aLength, TRequestStatus& aStatus)=0;
-
-	virtual TInt Write(const TDesC8& aDes,TInt aLength)=0;
-	virtual void Write(const TDesC8& aDes, TInt aLength, TRequestStatus& aStatus)=0;
-
-	virtual TInt Size(TInt& aSize)=0;
-	virtual TInt SetSize(TInt aSize)=0;
-
-	virtual TInt EvaluateIntent(const ContentAccess::TIntent aIntent) const = 0;
-	virtual TInt ExecuteIntent(const ContentAccess::TIntent aIntent) = 0;
-	virtual TBool IsProtected()const = 0;
-
-	// legacy file support
-	virtual RFile& FileL()=0;
-
-
-	virtual TInt SetAgentProperty(ContentAccess::TAgentProperty aProperty, TInt aValue) = 0;
-
-
-	};
-
-// Provide RFile based file access
-class CF32File : public CBase, public MGenericFile
-	{
-public:
-	static CF32File* NewL(RFs& aSession, TDesC& aPath, TUint aMode);
-
-	static CF32File* NewL(RFile& aFile);
-	void ConstructL(RFile& aFile);
-
-	void ConstructL(RFs& aSession, TDesC& aPath, TUint aMode);
-
-	virtual ~CF32File();
-
-	// from MGenericFile
-	virtual TInt Seek(TSeek aSeekMode, TInt aPosition);
-	virtual TInt Read(TDes8& aDes,TInt aLength);
-	virtual void Read(TDes8& aDes, TInt aLength, TRequestStatus& aStatus);
-	virtual TInt Write(const TDesC8& aDes,TInt aLength);
-	virtual void Write(const TDesC8& aDes, TInt aLength, TRequestStatus& aStatus);
-	virtual TInt Size(TInt& aSize);
-	virtual TInt SetSize(TInt aSize);
-	virtual TInt EvaluateIntent(const ContentAccess::TIntent aIntent) const;
-	virtual TInt ExecuteIntent(const ContentAccess::TIntent aIntent);
-	virtual TBool IsProtected() const;
-	virtual RFile& FileL();
-
-
-	virtual TInt SetAgentProperty(ContentAccess::TAgentProperty, TInt aValue);
-
-
-private:
-	CF32File();
-
-private:
-	RFs* iSession;	// not owned
-	HBufC* iFilePath;
-	RFile iFile;
-
-	TBool iFileHandle;
-	TInt iFileSize;
-	};
-
-// Provides content access framework based file access
-class CContentFile : public CBase, public MGenericFile
-	{
-public:
-
-	static CContentFile* NewL(RFs& aSession, const TDesC& aPath, const TDesC& aUniqueId, TUint aMode);
-	void ConstructL(RFs& aSession, const TDesC& aPath, const TDesC& aUniqueId, TUint aMode);
-
-	static CContentFile* NewL(RFs& aSession, const TDesC& aPath, TUint aMode);
-	void ConstructL(RFs& aSession, const TDesC& aPath, TUint aMode);
-
-
-
-	static CContentFile* NewL(RFile& aFile, const TDesC& aUniqueId);
-	void ConstructL(RFile& aFile, const TDesC& aUniqueId);
-
-
-	virtual ~CContentFile();
-
-	// from MGenericFile
-	virtual TInt Seek(TSeek aSeekMode, TInt aPosition);
-	virtual TInt Read(TDes8& aDes,TInt aLength);
-	virtual void Read(TDes8& aDes, TInt aLength, TRequestStatus& aStatus);
-	virtual TInt Write(const TDesC8& aDes,TInt aLength);
-	virtual void Write(const TDesC8& aDes, TInt aLength, TRequestStatus& aStatus);
-	virtual TInt Size(TInt& aSize);
-	virtual TInt SetSize(TInt aSize);
-	virtual TInt EvaluateIntent(const ContentAccess::TIntent aIntent) const;
-	virtual TInt ExecuteIntent(const ContentAccess::TIntent aIntent);
-	virtual TBool IsProtected() const;
-	virtual RFile& FileL();
-
-
-	virtual TInt SetAgentProperty(ContentAccess::TAgentProperty, TInt aValue);
-
-
-private:
-	CContentFile();
-
-
-private:
-	RFs* iSession; // not owned
-	HBufC* iFilePath;
-	ContentAccess::CContent* iContent;
-	ContentAccess::CData* iData;
-
-	RFile iLegacyFile;
-	TBool iLegacyFileOpen;
-	};
-
-
-inline CF32File::CF32File()
-	{
-	}
-
-inline CContentFile::CContentFile()
-	{
-	}
-
-inline MGenericFile::~MGenericFile()
-	{
-	}
-
-#endif //__FILE_ACCESS_H__
--- a/mmfenh/progressivedownload/ProgressiveDownloadSource/src/MmffilePriv.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,188 +0,0 @@
-/*
-* Copyright (c) 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:  Progressive Download Utility
-*
-*/
-
-
-#ifndef __MMFFILEPRIV_H_
-#define __MMFFILEPRIV_H_
-
-#include <f32file.h>
-
-#include <mmf/server/mmfclip.h>
-#include <mmf/server/mmfdatabuffer.h>
-
-
-/**
- *  @publishedAll
- *
- *  Represents a copy of a KUidMmfTransferBuffer used for reading/writting to the file server
- */
-
-class CTransferBufferCopy : public CBase
-	{
-public:
-	static CTransferBufferCopy* NewL(TInt aMaxLength);
-
-	virtual ~CTransferBufferCopy()
-		{delete iBuffer;}
-
-
-	TDes8& Des() {return iBufferDes;}
-
-	TInt MaxLength() {return iBufferDes.MaxLength();}
-
-	void ReUse(TInt aMaxLength) {iBufferDes.Set(iBuffer,0, Min(aMaxLength, iMaxLength));}
-
-	TBool InUse() {return iInUse;}
-
-	void SetInUse(TBool aInUse) {iInUse=aInUse;}
-
-private:
-	CTransferBufferCopy(TInt aMaxLength) : CBase(), iMaxLength(aMaxLength), iBufferDes(0,0,0), iInUse(EFalse){}
-
-	void ConstructL();
-
-private:
-	TUint8*	iBuffer;
-
-	//Holds the original MaxLength when class constructed.
-	//May be larger than MaxLength of iBufferDes
-	TInt	iMaxLength;
-
-	TPtr8	iBufferDes;
-
-	TBool	iInUse;
-	};
-
-
-
-
-/**
- * @internalComponent
- *
- * A request is created when an external object requests or supplies data.  Calls to the File Server are
- * made asynchronously and a CReadWriteRequest created to notify the caller on completion.
- *
- * CReadWriteRequest is an abstract class.  Concrete instances are of CReadRequest & CWriteRequest.
- * Concrete instances need to know whether to call MDataSink::BufferFilledL() or MDataSource::BufferEmptiedL()
- */
-class CReadWriteRequest : public CActive
-	{
-public:
-	CReadWriteRequest(TAny* aSinkOrSource, CMMFBuffer* aBuffer,MAsyncEventHandler* aEventHandler)
-	: CActive(EPriorityStandard),
-	iSinkOrSource(aSinkOrSource),
-	iBuffer(aBuffer),
-	iEventHandler(aEventHandler)
-		{
-		CActiveScheduler::Add( this );
-		}
-
-	CReadWriteRequest(TAny* aSinkOrSource, CMMFBuffer* aBuffer, CTransferBufferCopy* aOptionalDataBuffer, MAsyncEventHandler* aEventHandler)
-	: CActive(EPriorityStandard),
-	iSinkOrSource(aSinkOrSource),
-	iBuffer(aBuffer),
-	iTransferBufferCopy(aOptionalDataBuffer),
-	iEventHandler(aEventHandler)
-		{
-		CActiveScheduler::Add( this );
-		iTransferBufferCopy->SetInUse(ETrue);
-		}
-
-	CReadWriteRequest(CReadWriteRequest& aRequest)
-	: CActive(EPriorityStandard),
-	iSinkOrSource(aRequest.iSinkOrSource),
-	iBuffer(aRequest.iBuffer),
-	iTransferBufferCopy(aRequest.iTransferBufferCopy),
-	iEventHandler(aRequest.iEventHandler)
-		{
-		CActiveScheduler::Add( this );
-		iTransferBufferCopy->SetInUse(ETrue);
-		}
-
-
-	TBool Completed() ;
-	TDes8& BufferDes() ;
-	const TDesC8& BufferDesC() ;
-
-	~CReadWriteRequest() ;
-
-
-	// CActive functions.
-	//
-	void SetActive() ;
-	void DoCancel() ;
-	virtual void RunL() = 0 ;
-	virtual TInt RunError( TInt aError ) ;
-
-
-protected :
-	TAny* iSinkOrSource;
-	CMMFBuffer* iBuffer;
-	CTransferBufferCopy* iTransferBufferCopy;
-
-	MAsyncEventHandler* iEventHandler;
-	TBool iCompleted ;
-	TDes8* iBufferDes ;
-	TInt iError ;
-	TBool iUseTransferBuffer ;
-	void SetTransferBuffer (TBool aTBuffer) ;
-	TBool CanUseTransferBuffer () ;
-	} ;
-
-/**
- * @internalComponent
- */
-class CReadRequest : public CReadWriteRequest
-	{
-public :
-	CReadRequest(TAny* aSinkOrSource, CMMFBuffer* aBuffer, TUint aPosition, TUint aFileSize, TInt aBytesDownloaded,MAsyncEventHandler* aEventHandler)
-	: CReadWriteRequest(aSinkOrSource, aBuffer, aEventHandler),
-	iPosition(aPosition), iFileSize(aFileSize),iBytesDownloaded(aBytesDownloaded)
-	{ }
-
-	CReadRequest(TAny* aSinkOrSource, CMMFBuffer* aBuffer, CTransferBufferCopy* aOptionalDataBuffer, TUint aPosition, TUint aFileSize,TInt aBytesDownloaded, MAsyncEventHandler* aEventHandler)
-	: CReadWriteRequest(aSinkOrSource, aBuffer, aOptionalDataBuffer,aEventHandler),
-	iPosition(aPosition), iFileSize(aFileSize),iBytesDownloaded(aBytesDownloaded)
-	{ }
-
-	void RunL();
-private:
-	TUint iPosition;
-	TUint iFileSize;
-	TInt iBytesDownloaded;
-	};
-
-/**
- * @internalComponent
- */
-class CWriteRequest : public CReadWriteRequest
-	{
-public :
-	CWriteRequest(TAny* aSinkOrSource, CMMFBuffer* aBuffer, MAsyncEventHandler* aEventHandler)
-	: CReadWriteRequest(aSinkOrSource, aBuffer, aEventHandler)
-	{ }
-
-	CWriteRequest(TAny* aSinkOrSource, CMMFBuffer* aBuffer, CTransferBufferCopy* aOptionalDataBuffer, MAsyncEventHandler* aEventHandler)
-	: CReadWriteRequest(aSinkOrSource, aBuffer, aOptionalDataBuffer, aEventHandler)
-	{ }
-
-	void RunL();
-	};
-
-
-#endif
-
--- a/mmfenh/progressivedownload/ProgressiveDownloadSource/src/ProgressiveDownloadSource.cpp	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1810 +0,0 @@
-/*
-* Copyright (c) 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:  Progressive Download Utility
-*
-*/
-
-
-#include <f32file.h>
-#include <e32std.h>
-#include <mmfdatabuffer.h>
-#include <mmfutilities.h>
-#include <mmf/common/mmfcontroller.h>
-#include <mmfpaniccodes.h>
-//#include "mmffile.h"
-
-#include "MmffilePriv.h"
-#include "FileAccess.h"
-
-
-#include "ProgressiveDownloadSource.h"
-#include <implementationproxy.h>
-
-const TUid KUidProgressiveDlSource	= {KProgressiveDownloadSourceUid};
-
-
-void Panic(TMMFFilePanicCode aPanicCode)
-	{
- 	_LIT(KMMFFilePanicCategory, "CProgressiveDownloadSource");
-	User::Panic(KMMFFilePanicCategory, aPanicCode);
-	}
-
-
-/**
- * Constructs a CTransferBufferCopy
- *
- * @return CTransferBufferCopy*
- */
-CTransferBufferCopy* CTransferBufferCopy::NewL(TInt aMaxLength)
-	{
-	CTransferBufferCopy* self = new (ELeave) CTransferBufferCopy(aMaxLength);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-/**
- * Second phase constructor for CTransferBufferCopy
- *
- * @return void
- */
-void CTransferBufferCopy::ConstructL()
-	{
-	iBuffer = static_cast<TUint8*>(User::AllocL(iMaxLength));
-	iBufferDes.Set(iBuffer,0,iMaxLength);
-	}
-
-/**
-Destructor.
-*/
-CProgressiveDownloadSource::~CProgressiveDownloadSource()
-	{
-	delete iFile;
-
-	iHandle.Close();
-	iFsSession.Close();
-	delete iFileName;
-	delete iFileExt;
-	delete iFilePath;
-	delete iFileDrive;
-	delete iMmfFileEventHandler;
-	delete iUniqueId;
-
-	// Get rid of everything in RArray's & close them.
-	iRequests.ResetAndDestroy();
-	iTransferBufferCopies.ResetAndDestroy();
-	}
-
-/**
-Protected constructor.
-
-The default implementation is empty.
-*/
-CProgressiveDownloadSource::CProgressiveDownloadSource() : CMMFClip(KUidProgressiveDlSource/*KUidMmfFileSource*/, KUidMmfFileSink ), iFileSize(-1)
-	{
-	iSinkNotStopped = EFalse;
-	}
-
-/**
-Constructs an CProgressiveDownloadSource MDataSource.
-
-@return A pointer to the new CProgressiveDownloadSource data source.
-*/
-MDataSource* CProgressiveDownloadSource::NewSourceL()
-	{
-	#if _DEBUG
-	  RDebug::Print(_L("CProgressiveDownloadSource::NewSourceL"));
-    #endif
-	CProgressiveDownloadSource* self = new (ELeave) CProgressiveDownloadSource ;
-	return STATIC_CAST( MDataSource*, self ) ;
-	}
-
-/**
-Constructs a CProgressiveDownloadSource MDataSink
-
-@return A pointer to the new CProgressiveDownloadSource data sink.
-*/
-MDataSink* CProgressiveDownloadSource::NewSinkL()
-	{
-	CProgressiveDownloadSource* self = new (ELeave) CProgressiveDownloadSource ;
-	return STATIC_CAST( MDataSink*, self ) ;
-	}
-
-/**
-Perform source construction dependant on the source construction
-initialisation data aInitData.
-
-@param  aInitData
-        The TPckg<TMMFFileParams> descriptor package containing the file name and full path.
-*/
-void CProgressiveDownloadSource::ConstructSourceL(const TDesC8& aInitData )
-	{
-	ConstructL(aInitData, ESourceMode);
-	}
-
-/**
-Performs sink construction dependant on the sink construction
-initialisation data aInitData.
-
-@param  aInitData
-        The TPckg<TMMFFileParams> descriptor package containing the file name and full path.
-*/
-void CProgressiveDownloadSource::ConstructSinkL(const TDesC8& aInitData)
-	{
-	ConstructL(aInitData, ESinkMode);
-	}
-
-/**
-Protected constructor.
-
-Extracts the initialisation data provided by the calling functions: ConstructSourceL() and
-ConstructSourceL(). Creates a file server session and sets up file name. If there is a file name and
-it cannot be found this function leaves. If there is no file name the function leaves. Does not
-attempt to open the file or check whether the file exists.
-
-@param  aInitData
-        Initialisation data packaged in a TMMFFileParams.
-*/
-void CProgressiveDownloadSource::ConstructL(const TDesC8& aInitData,TMMFileMode aFileMode)
-	{
-	User::LeaveIfError(iFsSession.Connect());
-#ifdef __IPC_V2_PRESENT__
-	// on IPCv2 we auto attach
-	User::LeaveIfError(iFsSession.ShareAuto());
-#else
-	// on IPCv1
-	we use explicit - more efficient
-	User::LeaveIfError(iFsSession.Share(RSessionBase::EExplicitAttach));
-#endif
-
-
-	TBool fileInit = EFalse;
-	HBufC* filename = NULL;
-	TBool filenamePushed = EFalse;
-
-
-	TBool drmContent = EFalse;
-	RDesReadStream stream(aInitData);
-	CleanupClosePushL(stream);
-
-	TUid initUid;
-
-	initUid = TUid::Uid(stream.ReadInt32L());
-
-	if (initUid == KMMFileHandleSourceUid)
-		{
-		TPckgBuf<RFile*> fileptr;
-		stream.ReadL(fileptr);
-
-		iHandle.Duplicate(*fileptr());
-
-		TInt length;
-		length = stream.ReadInt32L();
-		if (length>0)
-			{
-			iUniqueId = HBufC::NewL(length);
-			TPtr16 ptr = iUniqueId->Des();
-			stream.ReadL(ptr, length);
-			}
-		iFileHandle = ETrue;
-		filename = HBufC::NewMaxL(KMaxFileName);
-		TPtr ptr = filename->Des();
-		iHandle.Name(ptr);
-		fileInit = ETrue;
-		drmContent = ETrue;
-		}
-
-	else if (initUid == KMMFileSourceUid)
-		{
-		TInt length;
-		length = stream.ReadInt32L();
-		filename = HBufC::NewMaxLC(length);
-		TPtr ptr = filename->Des();
-		stream.ReadL(ptr, length);
-
-		length = stream.ReadInt32L();
-		if (length>0)
-			{
-			iUniqueId = HBufC::NewMaxL(length);
-			ptr.Set(iUniqueId->Des());
-			stream.ReadL(ptr, length);
-			}
-		CleanupStack::Pop(filename);
-
-		fileInit = ETrue;
-		drmContent = ETrue;
-		}
-	else
-		{
-//		TODO If the UID is unknown we should reject, but  currently
-//		code also used for older calls that just supply filename.
-//		User::Leave(KErrNotSupported);
-		}
-
-	CleanupStack::PopAndDestroy(&stream);
-
-	if (!fileInit && aInitData.Length() == sizeof(TMMFFileHandleParams))
-		{
-		TMMFFileHandleParams params;
-		TPckgC<TMMFFileHandleParams> config(params);
-		config.Set(aInitData);
-		params = config();
-
-
-		if (params.iUid == KFileHandleUid)
-			{
-			fileInit = ETrue;
-			User::LeaveIfError(iHandle.Duplicate(*params.iFile));
-			TInt pos = 0;
-			// make sure the duplicate handle is at the start of the file - the usage of the file handle really requires this
-			User::LeaveIfError(iHandle.Seek(ESeekStart, pos));
-			iFileHandle = ETrue;
-			filename = HBufC::NewMaxLC(KMaxFileName);
-			filenamePushed = ETrue;
-			TPtr ptr = filename->Des();
-			User::LeaveIfError(iHandle.Name(ptr));
-			}
-		}
-
-
-	if (!fileInit) // do old case as last resort
-		{
-		TMMFFileParams params;
-		TPckgC<TMMFFileParams> config(params);
-		config.Set(aInitData);
-		params = config();
-
-		filename = params.iPath.AllocL();
-		fileInit = ETrue;
-		}
-
-	if (!filenamePushed)
-		{
-		// from now on it is assumed pushed.
-		CleanupStack::PushL(filename);
-		}
-
-	TParse parser ;
-	User::LeaveIfError(parser.Set(*filename, NULL, NULL));
-	CleanupStack::PopAndDestroy(filename);
-	if ( !( parser.NamePresent() ) && !( parser.ExtPresent() ) )
-		User::Leave( KErrBadName ) ;
-
-	iFullFileName.Copy( parser.FullName() ) ;
-	iFileName = parser.Name().AllocL() ;
-	iFileExt = parser.Ext().AllocL() ;
-	iFilePath = parser.Path().AllocL() ;
-	iFileDrive = parser.Drive().AllocL() ;
-
-
-	// in order to simulate old behaviour we are not passing error out
-	// but will try to create Content again during PrimeL()
-	if (fileInit && drmContent && aFileMode==ESourceMode)
-		{
-		TInt contentError;
-		if (iFileHandle)
-			{
-			TRAP(contentError,
-				iFile = CContentFile::NewL(iHandle, UniqueId());
-				);
-			}
-		else
-			{
-			// Open for read-only access
-			//rj progressive download needs shared access
-			TRAP(contentError,
-				iFile = CContentFile::NewL(iFsSession, iFullFileName, UniqueId(), EFileShareAny);
-			);
-			}
-		iFileOpen = (contentError==KErrNone);
-		}
-
-	(void)(aFileMode=ESourceMode); // prevent from compiler warning
-
-	}
-
-
-/**
-@deprecated
-
-Returns an RFile handle to the current file.
-
-If there is no current file, one is created. If the file exists then it is opened with read access
-if it is read only, write access otherwise. If the file does not exist then it is opened with
-write access.
-
-@leave KErrNotReady
-       The file is not open.
-
-@return A handle to the current file.
-*/
-RFile& CProgressiveDownloadSource::FileL()
-	{
-
-	#if _DEBUG
-	  RDebug::Print(_L("CProgressiveDownloadSource::FileL"));
-    #endif
-	if (!iFile)
-		User::Leave(KErrNotReady);
-	if (iFileHandle)
-		return iHandle;
-	else
-		return iFile->FileL();
-
-	}
-
-/**
-Returns the file name of the current file.
-
-Note: This will give the wrong answer if the file is renamed!
-
-@return The FileName (without extension).
-*/
-const TDesC& CProgressiveDownloadSource::FileName() const
-	{
-	return *iFileName ;
-	}
-
-/**
-Returns the extension of the current file.
-
-Note: This will give the wrong answer if the file is renamed!
-
-@return The File Extension.
-*/
-const TDesC& CProgressiveDownloadSource::Extension() const
-	{
-	return *iFileExt ;
-	}
-
-/**
-Returns the path of the current file.
-
-Note: This will give the wrong answer if the file is renamed!
-
-@return The FilePath (without filename and extension)
-*/
-const TDesC& CProgressiveDownloadSource::FilePath() const
-	{
-	return *iFilePath ;
-	}
-
-/**
-Returns the drive on which the current file is located.
-
-Note: This will give the wrong answer if the file is renamed!
-
-@return The FileDrive (drive letter only, without path, filename and extension).
-*/
-const TDesC& CProgressiveDownloadSource::FileDrive() const
-	{
-	return *iFileDrive ;
-	}
-
-/**
-Returns the full name of the current file.
-
-Note: This will give the wrong answer if the file is renamed!
-
-@return The file name (full filename including drive letter, without path, filename and extension).
-*/
-const TFileName CProgressiveDownloadSource::FullName() const
-	{
-	return iFullFileName;
-	}
-
-
-/**
-Returns the uniqueID associated with this content. If no uniqueID has been provided, a null
-descriptor will be provided
-
-@return The UniqueID
-*/
-const TDesC& CProgressiveDownloadSource::UniqueId() const
-	{
-	if (iUniqueId)
-		return *iUniqueId;
-	else
-		return KNullDesC;
-	}
-
-
-
-/**
-Deletes the file.
-
-Closes the currently open file, then deletes it. If the file source is accessing a file handle,
-the file is truncated to 0 bytes instead.
-
-@return An error code indicating if the function call was successful. KErrNone on success, otherwise
-        another of the system-wide error codes.
-*/
-TInt CProgressiveDownloadSource::Delete()
-	{
-	#if _DEBUG
-	  RDebug::Print(_L("CProgressiveDownloadSource::Delete"));
-    #endif
-	if (!iFileHandle)
-		{
-		delete iFile;
-		iFile = NULL;
-		iFileSize=-1;
-		iPosition=0;
-
-		return iFsSession.Delete(iFullFileName);
-		}
-	else
-		{
-		iFileSize=-1;
-		iPosition=0;
-
-		return iFile->SetSize(0);
-		}
-
-	}
-
-/**
-Sets the file size.
-
-@param  aSize
-        The size of the file.
-
-@return An error code indicating if the function call was successful. KErrNone on success, otherwise
-        another of the system-wide error codes.
-*/
-TInt CProgressiveDownloadSource::SetSize(TInt aSize)
-	{
-	#if _DEBUG
-	  RDebug::Print(_L("[%x]CProgressiveDownloadSource::SetSize to %d"),this,aSize);
-    #endif
-
-    iFix = aSize;
-
-	if ( !iFile )
-		return KErrNotReady;
-
-	TInt err =  iFile->SetSize(aSize);
-	if(err == KErrNone)
-		iFileSize = aSize;
-	else
-		iFileSize = -1;
-
-	return err;
-	}
-
-/**
-Obtains a CTransferBufferCopy from iTransferBufferCopies that is
-at least as big as that required.
-
-There is no need to put the pointer returned by this method onto the CleanupStack
-as it will have already been placed into iTransferBufferCopies.
-
-@param  aMaxLength
-        The size required.
-
-@return A pointer to a valid CTransferBufferCopy.
-*/
-CTransferBufferCopy* CProgressiveDownloadSource::ObtainCopyOfTransferBufferL(TInt aMaxLength)
-	{
-	//find a free transfer buffer copy of the right size
-	TInt firstFree = -1;
-	CTransferBufferCopy* transBufCopyToUse = NULL;
-
-	for(TInt cnt=0; cnt < iTransferBufferCopies.Count(); cnt++)
-		{
-		if(!iTransferBufferCopies[cnt]->InUse())
-			{
-			//record the first free entry, we may remove this
-			//if entries in iTransferBufferCopies > KAcceptableTransferBufferCopiesSize
-			if(firstFree == -1)
-				firstFree = cnt;
-
-			if(iTransferBufferCopies[cnt]->MaxLength() >= aMaxLength)
-				{
-				transBufCopyToUse = iTransferBufferCopies[cnt];
-
-				//Set the MaxLength. This will ensure that the copy acts the same as
-				//the original Transfer buffer, eg. file server will throw KErrOverflow
-				transBufCopyToUse->ReUse(aMaxLength);
-				break;
-				}
-			}
-		}
-
-	//If we failed to find a suitable entry, we need to create a new one
-	if(!transBufCopyToUse)
-		{
-		//Firstly, should we re-cycle an existing entry?
-		//There must be entries in the array, a free entry must have been found,
-		//the size of the array must be beyond the water mark where we want to start
-		//cycling free entries.
-		if((iTransferBufferCopies.Count() > 0) &&
-			(firstFree != -1) &&
-			(iTransferBufferCopies.Count() > KAcceptableTransferBufferCopiesSize))
-			{
-			delete iTransferBufferCopies[firstFree];
-			iTransferBufferCopies.Remove(firstFree);
-
-			transBufCopyToUse = CTransferBufferCopy::NewL(aMaxLength);
-			CleanupStack::PushL(transBufCopyToUse);
-			User::LeaveIfError(iTransferBufferCopies.Insert(transBufCopyToUse,firstFree));
-
-			CleanupStack::Pop();
-			}
-		else
-			{
-#ifdef _DEBUG
-			if(iTransferBufferCopies.Count() > KMaximumTransferBufferCopiesSize)
-				{
-				User::Panic(_L("iTransferBufferCopies grew too large in CProgressiveDownloadSource"),KErrTooBig);
-				}
-#endif
-
-			transBufCopyToUse = CTransferBufferCopy::NewL(aMaxLength);
-			CleanupStack::PushL(transBufCopyToUse);
-			User::LeaveIfError(iTransferBufferCopies.Append(transBufCopyToUse));
-
-			CleanupStack::Pop();
-			}
-		}
-
-	return transBufCopyToUse;
-	}
-
-
-
-/**
-Loads aBuffer from iFile.
-
-The file must already be open for reading. File read is asynchronous. CReadRequest is created to
-respond to completion.
-
-@param  aBuffer
-        The buffer to be filled from the file.
-@param  aConsumer
-        The data sink consumer of the buffer.
-*/
-void CProgressiveDownloadSource::FillBufferL( CMMFBuffer* aBuffer, MDataSink* aConsumer, TMediaId /*aMediaId*/ )
-	{
-	#if _DEBUG
-	  RDebug::Print(_L("CProgressiveDownloadSource::FillBufferL"));
-    #endif
-	// Requires that iFile is open for read.
-	// Reads data from iFile into aBuffer
-	if ((aConsumer == NULL) || (aBuffer == NULL))
-		User::Leave(KErrArgument);
-
-	if (!iFile || (iMmfFileEventHandler == NULL))
-		User::Leave(KErrNotReady);
-
-	if (CMMFBuffer::IsSupportedDataBuffer(aBuffer->Type()))
-		{
-		CTransferBufferCopy* transBufCopy = NULL;
-		CReadRequest* request = NULL;
-
-		TDes8& aBufferDes = STATIC_CAST( CMMFDataBuffer*, aBuffer )->Data();
-
-		TInt requestSize;
-		if(aBuffer->RequestSize())
-			requestSize = aBuffer->RequestSize();
-		else
-			requestSize = aBufferDes.MaxLength();
-
-		//check whether buffer is safe to send to file server
-		//if not, eg for a transfer buffer, then it needs to be copied
-		if (!CMMFBuffer::IsFileServerSafe(aBuffer->Type()))
-			{
-			//NB: failure in this method will NOT cause transBufCopy to leak as it will be
-			//inserted into iTransferBufferCopies by ObtainCopyOfTransferBufferL.
-			transBufCopy = ObtainCopyOfTransferBufferL(aBufferDes.MaxLength());
-			request = new(ELeave) CReadRequest(STATIC_CAST(TAny*, aConsumer), aBuffer, transBufCopy, iPosition, Size(),iBytesDownloaded, iMmfFileEventHandler);
-			}
-		else
-			{
-			request = new(ELeave) CReadRequest(STATIC_CAST(TAny*, aConsumer), aBuffer, iPosition, Size(),iBytesDownloaded, iMmfFileEventHandler);
-			}
-
-		CleanupStack::PushL( request );
-
-		StoreRequestL(request); // transfers ownership
-		CleanupStack::Pop() ; // request
-
-		iFile->Read(request->BufferDes(), requestSize, request->iStatus);
-		iPosition += requestSize;
-
-		if (iPosition >= iFileSize)
-			{
-			aBuffer->SetLastBuffer(ETrue);
-			}
-
-		request->SetActive();
-		}
-	else // if (CMMFBuffer::IsSupportedDataBuffer(aBuffer->Type()))
-		User::Leave( KErrNotSupported ) ;
-	}
-
-/**
-Empties aBuffer into iFile. The file must be already open for writing.
-
-@param  aBuffer
-        The buffer to be written to the file.
-@param  aSupplier
-        The data source supplier of the buffer.
-*/
-void CProgressiveDownloadSource::EmptyBufferL( CMMFBuffer* aBuffer, MDataSource* aSupplier, TMediaId /*aMediaId*/ )
-	{
-
-	#if _DEBUG
-	  RDebug::Print(_L("CProgressiveDownloadSource::EmptyBufferL"));
-    #endif
-	// Requires that iFile is open for write.
-	// Writes data from iFile into aBuffer
-	if ((aSupplier == NULL) || (aBuffer == NULL))
-		User::Leave(KErrArgument);
-
-	if (!iFile || (iMmfFileEventHandler == NULL))
-		User::Leave(KErrNotReady);
-
-	CTransferBufferCopy* transBufCopy = NULL;
-
-	if (CMMFBuffer::IsSupportedDataBuffer(aBuffer->Type()))
-		{
-		CWriteRequest* request = NULL;
-		TDes8& aBufferDes = STATIC_CAST( CMMFDataBuffer*, aBuffer )->Data();
-
-		//check whether buffer is safe to send to file server
-		//if not, eg for a transfer buffer, then it needs to be copied
-		if (!CMMFBuffer::IsFileServerSafe(aBuffer->Type()))
-			{
-			//Obtain a normal buffer to send to the file server
-			//NB: failure in this method will NOT cause transBufCopy to leak as it will be
-			//inserted into iTransferBufferCopies by ObtainCopyOfTransferBufferL.
-			transBufCopy = ObtainCopyOfTransferBufferL(aBufferDes.MaxLength());
-
-			//Copy the data into the buffer we will send to the file server
-			transBufCopy->Des().Copy(aBufferDes);
-
-			request = new(ELeave) CWriteRequest(STATIC_CAST(TAny*, aSupplier), aBuffer, transBufCopy, iMmfFileEventHandler);
-			}
-		else
-			{
-			request = new(ELeave) CWriteRequest(STATIC_CAST(TAny*, aSupplier), aBuffer, iMmfFileEventHandler);
-			}
-
-		CleanupStack::PushL( request );
-
-		StoreRequestL(request);  // transfers ownership
-		CleanupStack::Pop(); // request
-
-		iFile->Write(request->BufferDes(), request->BufferDes().Length(), request->iStatus);
-		request->SetActive();
-		}
-	else  // if (CMMFBuffer::IsSupportedDataBuffer(aBuffer->Type()))
-		{
-		User::Leave( KErrNotSupported ) ;
-		}
-	}
-
-/**
-Loads aLength number of bytes into aBuffer from specified point in iFile.
-
-@param  aLength
-        The number of bytes to be read into buffer.
-@param  aBuffer
-        The buffer to be filled from the file.
-@param  aPosition
-        The offset into the file at which to start reading.
-@param  aConsumer
-        The data sink consumer of the buffer.
-*/
-void CProgressiveDownloadSource::ReadBufferL(TInt aLength, CMMFBuffer* aBuffer, TInt aPosition, MDataSink* aConsumer)
-	{
-
-	#if _DEBUG
-	  RDebug::Print(_L("CProgressiveDownloadSource::ReadBufferL Async"));
-    #endif
-	// Requires that iFile is open for read.
-	// Reads data from iFile into aBuffer
-	if ((aLength < 0) || (aPosition<0) || (aConsumer == NULL) || (aBuffer == NULL))
-		User::Leave(KErrArgument);
-
-	if (!iFile || (iMmfFileEventHandler == NULL))
-		User::Leave(KErrNotReady);
-
-	CTransferBufferCopy* transBufCopy = NULL;
-
-	if (CMMFBuffer::IsSupportedDataBuffer(aBuffer->Type()))
-		{
-		CReadRequest* request = NULL;
-		TDes8& aBufferDes = STATIC_CAST( CMMFDataBuffer*, aBuffer )->Data();
-
-		//check whether buffer is safe to send to file server
-		//if not, eg for a transfer buffer, then it needs to be copied
-		if (!CMMFBuffer::IsFileServerSafe(aBuffer->Type()))
-			{
-			//Obtain a normal buffer to send to the file server
-			//NB: failure in this method will NOT cause transBufCopy to leak as it will be
-			//inserted into iTransferBufferCopies by ObtainCopyOfTransferBufferL.
-			transBufCopy = ObtainCopyOfTransferBufferL(aBufferDes.MaxLength());
-
-			request = new(ELeave) CReadRequest(STATIC_CAST(TAny*, aConsumer), aBuffer, transBufCopy, aPosition, Size(), iBytesDownloaded,iMmfFileEventHandler);
-			}
-		else
-			{
-			request = new(ELeave) CReadRequest(STATIC_CAST(TAny*, aConsumer), aBuffer, aPosition, Size(), iBytesDownloaded,iMmfFileEventHandler);
-			}
-
-		CleanupStack::PushL( request );
-
-		StoreRequestL(request) ;  //transfers ownership
-		CleanupStack::Pop() ; //request
-
-
-
-		TInt err = iFile->Seek(ESeekStart, aPosition);
-		if (err==KErrNone)
-			iFile->Read(request->BufferDes(), aLength, request->iStatus);
-		else
-			{
-			TRequestStatus* status = &request->iStatus;
-			User::RequestComplete(status, err);
-			}
-
-		//rj wait until runl is completed
-	//	iPosition = aPosition + aLength;
-       iPosition = aPosition;
-
-	// rj 	if (iPosition >= iFileSize)
-	//		{
-	//		aBuffer->SetLastBuffer(ETrue);
-	//		}
-
-		request->SetActive();
-		}
-	else // if (CMMFBuffer::IsSupportedDataBuffer(aBuffer->Type()))
-		User::Leave( KErrNotSupported ) ;
-	}
-
-
-/**
-Loads aBuffer from specified point in iFile.
-
-The file must already be open for reading.
-
-@param  aBuffer
-        The buffer to be filled from the file.
-@param  aPosition
-        The offset into file at which to start reading.
-@param  aConsumer
-        The data sink consumer of the buffer.
-*/
-void CProgressiveDownloadSource::ReadBufferL(CMMFBuffer* aBuffer, TInt aPosition, MDataSink* aConsumer)
-	{
-    #if _DEBUG
-	  RDebug::Print(_L("CProgressiveDownloadSource::ReadBufferL Async"));
-    #endif
-
-	// Requires that iFile is open for read.
-	// Reads data from iFile into aBuffer
-	if ((aPosition<0) || (aConsumer == NULL) || (aBuffer == NULL))
-		User::Leave(KErrArgument);
-
-	if (CMMFBuffer::IsSupportedDataBuffer(aBuffer->Type()))
-		{
-		TInt requestSize;
-		if(aBuffer->RequestSize())
-			requestSize = aBuffer->RequestSize();
-		else
-			requestSize = STATIC_CAST( CMMFDataBuffer*, aBuffer )->Data().MaxLength();
-
-		ReadBufferL(requestSize, aBuffer, aPosition, aConsumer);
-		}
-	else // if (CMMFBuffer::IsSupportedDataBuffer(aBuffer->Type()))
-		User::Leave(KErrNotSupported);
-	}
-
-
-/**
-Loads aBuffer from specified point in iFile.  Note that this is a synchronous read.
-
-@param  aBuffer
-        The buffer to be filled from the file.
-@param  aPosition
-        The offset into file at which to start reading.
-*/
-void CProgressiveDownloadSource::ReadBufferL( CMMFBuffer* aBuffer, TInt aPosition)
-	{
-
-	#if _DEBUG
-	  RDebug::Print(_L("CProgressiveDownloadSource::ReadBufferL Sync"));
-    #endif
-	// Requires that iFile is open for read.
-	// Reads data from iFile into aBuffer
-	if ((aPosition<0) || (aBuffer == NULL))
-		User::Leave(KErrArgument);
-
-	if (!iFile)
-		User::Leave(KErrNotReady);
-
-	if (CMMFBuffer::IsSupportedDataBuffer(aBuffer->Type()))
-		{
-		TDes8& aBufferDes = STATIC_CAST( CMMFDataBuffer*, aBuffer )->Data();
-
-		TInt requestSize;
-		if(aBuffer->RequestSize())
-			requestSize = aBuffer->RequestSize();
-		else
-			requestSize = aBufferDes.MaxLength();
-
-		//check whether buffer is safe to send to file server
-		//if not, eg for a transfer buffer, then it needs to be copied
-		if (!CMMFBuffer::IsFileServerSafe(aBuffer->Type()))
-			{
-			//NB: failure in this method will NOT cause transBufCopy to leak as it will be
-			//inserted into iTransferBufferCopies by ObtainCopyOfTransferBufferL.
-			CTransferBufferCopy* transBufCopy = ObtainCopyOfTransferBufferL(aBufferDes.MaxLength());
-
-			User::LeaveIfError(iFile->Seek(ESeekStart, aPosition));
-			User::LeaveIfError(iFile->Read(transBufCopy->Des(), requestSize));
-			aBufferDes.Copy(transBufCopy->Des().Left(aBufferDes.MaxLength()));
-			}
-		else
-			{
-			User::LeaveIfError(iFile->Seek(ESeekStart, aPosition));
-			User::LeaveIfError(iFile->Read(aBufferDes, requestSize));
-			}
-
-		iPosition = aPosition + aBufferDes.Length();
-
-		//check if the buffer is the last buffer and if so set the last buffer flag on the CMMFDataBuffer
-		//NB: setting last buffer is the done by the formatter, but this is a hang over to account for
-		//existing formatters that may fail if this is removed.
-		if (aBufferDes.Length() < requestSize)
-			aBuffer->SetLastBuffer(ETrue);
-		}
-	else  // if (CMMFBuffer::IsSupportedDataBuffer(aBuffer->Type()))
-		User::Leave(KErrNotSupported);
-	}
-
-/**
-Empties aLength bytes from aBuffer into iFile at specified location.
-
-@param  aLength
-        The number of bytes to be emptied from buffer.
-@param  aBuffer
-        The data buffer containing bytes to be written.
-@param  aPosition
-        The offset into file at which to start writing.
-@param  aSupplier
-        The data source to be notified when the write has been completed.
-
-@leave  KErrNotReady
-        SinkPrimeL() and SinkThreadLogon() have not been called.
-@leave  KErrArgument
-        aLength<0 or aPosition<0 or aSupplier is NULL.
-@leave  KErrNotSupported
-        aBuffer is not a supported CMMFDataBuffer
-*/
-void CProgressiveDownloadSource::WriteBufferL(TInt aLength, CMMFBuffer* aBuffer, TInt aPosition, MDataSource* aSupplier)
-	{
-
-	#if _DEBUG
-	  RDebug::Print(_L("CProgressiveDownloadSource::WriteBufferL Async"));
-    #endif
-
-	if ((aLength<0) || (aPosition<0) || (aSupplier == NULL) || (aBuffer == NULL))
-		User::Leave(KErrArgument);
-
-	if (!iFile || (iMmfFileEventHandler == NULL))
-		User::Leave(KErrNotReady);
-
-	if (CMMFBuffer::IsSupportedDataBuffer(aBuffer->Type()))
-		{
-		CWriteRequest* request = NULL;
-		TDes8& aBufferDes = STATIC_CAST( CMMFDataBuffer*, aBuffer )->Data();
-
-		//check whether buffer is safe to send to file server
-		//if not, eg for a transfer buffer, then it needs to be copied
-		if (!CMMFBuffer::IsFileServerSafe(aBuffer->Type()))
-			{
-			//NB: failure in this method will NOT cause transBufCopy to leak as it will be
-			//inserted into iTransferBufferCopies by ObtainCopyOfTransferBufferL.
-			CTransferBufferCopy* transBufCopy = ObtainCopyOfTransferBufferL(aBufferDes.MaxLength());
-
-			transBufCopy->Des().Copy(aBufferDes);
-
-			request = new(ELeave) CWriteRequest(STATIC_CAST(TAny*, aSupplier), aBuffer, transBufCopy, iMmfFileEventHandler);
-			}
-		else
-			{
-			request = new(ELeave) CWriteRequest(STATIC_CAST(TAny*, aSupplier), aBuffer, iMmfFileEventHandler);
-			}
-
-		CleanupStack::PushL( request );
-
-		StoreRequestL(request);  // transfers ownership
-		CleanupStack::Pop(); // request
-
-		iFile->Seek(ESeekStart, aPosition);
-		iFile->Write(request->BufferDes(), aLength, request->iStatus);
-		//iFileSize = -1; //reset cached size
-
-		request->SetActive();
-		}
-	else // if (!CMMFBuffer::IsFileServerSafe(aBuffer->Type()))
-		{
-		//write bitmap to file
-		User::Leave(KErrNotSupported);
-		}
-	}
-
-/**
-Empties aBuffer into iFile at the specified location.
-
-@param  aBuffer
-        The data buffer containing bytes to be written.
-@param  aPosition
-        The offset into file at which to start writing.
-@param  aSupplier
-        The data source to be notified when the write has been completed.
-
-@leave  KErrNotReady
-        SinkPrimeL() and SinkThreadLogon() have not been called.
-@leave  KErrArgument
-        aSupplier is NULL.
-@leave  KErrNotSupported
-        The aBuffer is not of type KMMFDataBuffer.
-*/
-void CProgressiveDownloadSource::WriteBufferL( CMMFBuffer* aBuffer, TInt aPosition, MDataSource* aSupplier)
-	{
-
-	#if _DEBUG
-	  RDebug::Print(_L("CProgressiveDownloadSource::WriteBufferL Async"));
-    #endif
-	// Requires that iFile is open for write.
-	// Writes data from iFile into aBuffer
-	if ((aPosition<0) || (aSupplier == NULL) || (aBuffer == NULL))
-		User::Leave(KErrArgument);
-
-	if (CMMFBuffer::IsSupportedDataBuffer(aBuffer->Type()))
-		{
-		TUint requestSize = STATIC_CAST( CMMFDataBuffer*, aBuffer )->Data().Length();
-
-		WriteBufferL(requestSize, aBuffer, aPosition, aSupplier);
-		}
-	else  // if (CMMFBuffer::IsSupportedDataBuffer(aBuffer->Type()))
-		{
-		//write bitmap to file
-		User::Leave( KErrNotSupported ) ;
-		}
-	}
-
-/**
-Empties aBuffer into iFile at specified location.  Note that this is a synchronous write.
-
-@param  aBuffer
-        The data buffer containing bytes to be written.
-@param  aPosition
-        The offset into file at which to start writing.
-
-@return The error code from RFile.
-*/
-void CProgressiveDownloadSource::WriteBufferL( CMMFBuffer* aBuffer, TInt aPosition )
-	{
-
-	#if _DEBUG
-	  RDebug::Print(_L("CProgressiveDownloadSource::WriteBufferL Sync"));
-    #endif
-	if ((aPosition<0) || (aBuffer == NULL))
-		User::Leave(KErrArgument);
-
-	if (!iFile)
-		User::Leave(KErrNotReady);
-
-	TInt err(KErrNone) ;
-
-	//check whether buffer is safe to send to file server
-	//if not, eg for a transfer buffer, then it needs to be copied
-	if ((!CMMFBuffer::IsFileServerSafe(aBuffer->Type()))
-		&& (CMMFBuffer::IsSupportedDataBuffer(aBuffer->Type())))
-		{
-		TDes8& aBufferDes = STATIC_CAST( CMMFDataBuffer*, aBuffer )->Data();
-
-		//NB: failure in this method will NOT cause transBufCopy to leak as it will be
-		//inserted into iTransferBufferCopies by ObtainCopyOfTransferBufferL.
-		CTransferBufferCopy* transBufCopy = ObtainCopyOfTransferBufferL(aBufferDes.MaxLength());
-
-		transBufCopy->Des().Copy(aBufferDes);
-		err = iFile->Seek(ESeekStart, aPosition);
-		if (err==KErrNone)
-			err = iFile->Write(transBufCopy->Des(),transBufCopy->Des().Length());
-		//iFileSize = -1; //reset cached size
-		}
-	else if (CMMFBuffer::IsSupportedDataBuffer(aBuffer->Type()))
-		{
-		TDes8& aBufferDes = STATIC_CAST( CMMFDataBuffer*, aBuffer )->Data();
-
-		err = iFile->Seek(ESeekStart, aPosition);
-		if (err==KErrNone)
-			err = iFile->Write(aBufferDes, aBufferDes.Length());
-		//iFileSize = -1; //reset cached size
-		}
-	else // if (CMMFBuffer::IsSupportedDataBuffer(aBuffer->Type()))
-		{
-		User::Leave(KErrNotSupported);
-		}
-
-	User::LeaveIfError(err);
-	}
-
-/**
-Gets the number of free bytes in the device's file system.
-
-@return The number of free bytes.
-*/
-TInt64 CProgressiveDownloadSource::BytesFree()
-	{
-
-	#if _DEBUG
-	  RDebug::Print(_L("CProgressiveDownloadSource::BytesFree"));
-    #endif
-
-	TVolumeInfo volInfo;
-	if (iFsSession.Volume(volInfo) == KErrNone)
-		return volInfo.iFree;
-	return TInt64(0);
-	}
-
-/**
-Returns the size of the file in bytes.
-
-Note: This is not the maximum length.
-
-@return The size of the file in bytes.
-*/
-TInt CProgressiveDownloadSource::Size()
-	{
-
-	#if _DEBUG
-	  RDebug::Print(_L("CProgressiveDownloadSource::size iFileSize %d"),iFileSize);
-	  RDebug::Print(_L("CProgressiveDownloadSource::size iFixSize %d"),iFix);
-    #endif
-
-  	TInt size = 0;
-	TInt err = KErrNone;
-	TBool fileOpened = EFalse;
-
-
-	 if(iFix != 0)   //rj
-	 	{
-	 	iFileSize = iFix;
-	 	return iFix;
-	 	}
-
-
-	if(iFileSize != -1)
-		return iFileSize;
-
-	if (!iFile)
-		{
-		// Open the file.
-		TRAP(err, SourcePrimeL());
-		if (iFile)
-			fileOpened = ETrue;
-		}
-	if (err == KErrNone && iFile)
-		err = iFile->Size(size);
-	if (err)
-		{
-		size = 0;
-	//	iFileSize = -1; //reset cached size
-		}
-	else
-		iFileSize = size; //cache the filesize
-
-	if (fileOpened)
-		TRAP_IGNORE(SourceStopL());	// Close the file
-
-	return size;
-
-	}
-
-/**
-Source thread logon.
-
-Shares fsSession between threads
-
-@param  aEventHandler
-        This is an MAsyncEventHandler to handle asynchronous events that occur during the
-        transfer of multimedia data.
-
-@return An error code indicating if the function call was successful. KErrNone on success, otherwise
-        another of the system-wide error codes.
-*/
-TInt CProgressiveDownloadSource::SourceThreadLogon(MAsyncEventHandler& aEventHandler)
-	{
-	iEventHandler = &aEventHandler;
-	if(!iMmfFileEventHandler)
-		{
-		iMmfFileEventHandler = new CMMFFileAsyncEventHandler(this);
-		if(!iMmfFileEventHandler)
-			return KErrNoMemory;
-		}
-#ifdef __IPC_V2_PRESENT__
-	return KErrNone; // nothing to do
-#else
-	return iFsSession.Attach();
-#endif // __HIDE_IPC_V1__
-	}
-
-/**
-Logs off source thread.
-*/
-void CProgressiveDownloadSource::SourceThreadLogoff()
-	{
-	delete iMmfFileEventHandler;
-	iMmfFileEventHandler = NULL;
-	iEventHandler = NULL;
-	}
-
-
-/**
-Sink thread logon.
-
-Shares fsSession between threads.
-
-@param  aEventHandler
-        This is an MAsyncEventHandler to handle asynchronous events that occur during the
-        transfer of multimedia data.
-
-@return An error code indicating if the function call was successful. KErrNone on success, otherwise
-        another of the system-wide error codes.
-*/
-TInt CProgressiveDownloadSource::SinkThreadLogon(MAsyncEventHandler& aEventHandler)
-	{
-	iEventHandler = &aEventHandler;
-	if(!iMmfFileEventHandler)
-		{
-		iMmfFileEventHandler = new CMMFFileAsyncEventHandler(this);
-		if(!iMmfFileEventHandler)
-			return KErrNoMemory;
-		}
-#ifdef __IPC_V2_PRESENT__
-	return KErrNone;
-#else
-	return iFsSession.Attach();
-#endif // __HIDE_IPC_V1__
-	}
-
-/**
-Sink thread log off.
-*/
-void CProgressiveDownloadSource::SinkThreadLogoff()
-	{
-	delete iMmfFileEventHandler;
-	iMmfFileEventHandler = NULL;
-	iEventHandler = NULL;
-	}
-
-/**
-Stores a request in an array.
-
-CReadWriteRequests are stored in the array iRequests.
-This function takes ownership and places the request in the array.
-It also checks the array for completed requests and removes them.
-
-@param  aRequest
-        The request to store.
-*/
-void CProgressiveDownloadSource::StoreRequestL( CReadWriteRequest* aRequest )
-	{
-	// add aRequest to iRequests
-	User::LeaveIfError( iRequests.Append( aRequest ) ) ;
-
-	// Clear out any completed requests
-	for ( TInt ii = 0 ; ii < iRequests.Count() ; ii++ )
-		{
-		if (iRequests[ii]->Completed())
-			{
-			CReadWriteRequest* request = iRequests[ii];
-			delete request;
-
-			iRequests.Remove(ii);
-			ii--;
-			}
-		}
-	}
-
-
-/**
-Cancels outstanding requests.
-
-CReadWriteRequests are stored in the array iRequests.
-This function cancels any outstanding requests and removes them
-from iRequests.
-*/
-void CProgressiveDownloadSource::CancelRequests()
-	{
-	// Clear out any completed requests
-	for ( TInt ii = 0 ; ii < iRequests.Count() ; ii++ )
-		{
-		CReadWriteRequest* request = iRequests[ii];
-		delete request;
-		iRequests.Remove(ii);
-		ii--;
-		}
-	}
-
-
-
-/**
-Returns the data type as a fourCC code of CProgressiveDownloadSource as a data source.
-
-@return The data type fourCC code.
-*/
-TFourCC CProgressiveDownloadSource::SourceDataTypeCode(TMediaId /*aMediaId*/)
-	{
-	return  iSourceFourCC ;
-	}
-
-/**
-Returns the data type as a fourCC code of CProgressiveDownloadSource as a data sink.
-
-@return The data type fourCC code
-*/
-TFourCC CProgressiveDownloadSource::SinkDataTypeCode(TMediaId /*aMediaId*/)
-	{
-	return  iSinkFourCC ;
-	}
-
-
-/**
-CProgressiveDownloadSource as a source is always passive so this function is not supported.
-
-@param  aBuffer
-        The emptied buffer.
-*/
-void CProgressiveDownloadSource::BufferEmptiedL(CMMFBuffer* /* aBuffer */)
-	{
-	Panic(EMMFFilePanicBufferEmptiedLNotSupported);
-	}
-
-/**
-Tests whether a source buffer can be created.
-
-@return	A boolean indicating if if CProgressiveDownloadSource can create its own buffer. EFalse if CProgressiveDownloadSource cannot
-        create it's own buffer.
-*/
-TBool CProgressiveDownloadSource::CanCreateSourceBuffer()
-	{
-	return EFalse;
-	}
-
-/**
-Creates a source buffer.
-
-@param  aMediaId
-        The Media ID.
-@param  aReference
-        A boolean indicating if MDataSource owns the buffer. ETrue if it does, EFalse if the caller
-        owns the buffer.
-
-@return	NULL as a CProgressiveDownloadSource cannot create it's own buffer
-*/
-CMMFBuffer* CProgressiveDownloadSource::CreateSourceBufferL( TMediaId /*aMediaId*/ , TBool& /*aReference*/)
-	{
-	#if _DEBUG
-	  RDebug::Print(_L("CProgressiveDownloadSource::CreateSourceBufferL"));
-    #endif
-	User::Leave(KErrNotSupported);
-	return NULL ;
-	}
-
-/**
-CProgressiveDownloadSource as a sink is always passive so this function is not supported.
-
-@param  aBuffer
-        The buffer.
-*/
-void CProgressiveDownloadSource::BufferFilledL(CMMFBuffer* /* aBuffer */)
-	{
-	#if _DEBUG
-	  RDebug::Print(_L("CProgressiveDownloadSource::BufferFilledL"));
-    #endif
-	Panic(EMMFFilePanicBufferFilledLNotSupported);
-	}
-
-/**
-Tests whether a sink buffer can be created.
-
-@return	A boolean indicating if the sink buffer can be created. EFalse if CProgressiveDownloadSource cannot create
-        it's own buffer
-*/
-TBool CProgressiveDownloadSource::CanCreateSinkBuffer()
-	{
-	#if _DEBUG
-	  RDebug::Print(_L("CProgressiveDownloadSource::CanCreateSinkBuffer"));
-    #endif
-	return EFalse ;
-	}
-
-/**
-Creates a sink buffer.
-
-@param  aMediaId
-        The Media ID.
-@param  aReference
-        A boolean indicating if MDataSource owns the buffer. ETrue if MDataSource owns the buffer,
-        EFalse if the caller owns the buffer.
-
-@return	NULL as a CProgressiveDownloadSource cannot create it's own buffer
-*/
-CMMFBuffer* CProgressiveDownloadSource::CreateSinkBufferL(TMediaId /*aMediaId*/ , TBool& /*aReference*/)
-	{
-
-	#if _DEBUG
-	  RDebug::Print(_L("CProgressiveDownloadSource::CreateSinkBufferL"));
-    #endif
-	User::Leave(KErrNotSupported);
-	return NULL ;
-	}
-
-
-/**
-Primes the source.
-
-When used as a source, the file prime opens the file as read only.
-*/
-void CProgressiveDownloadSource::SourcePrimeL()
-	{
-
-	#if _DEBUG
-	  RDebug::Print(_L("CProgressiveDownloadSource::SourcePrimeL"));
-    #endif
-
-	// don't reopen file if already open
-	if (!iFile)
-		{
-
-		if (iFileHandle)
-			{
-			iFile = CContentFile::NewL(iHandle, UniqueId());
-			}
-		else
-			{
-			// rj Open for progressive download need to have shared access
-			iFile = CContentFile::NewL(iFsSession, iFullFileName, UniqueId(), EFileShareAny);
-
-			}
-
-		}
-	iFileOpen = ETrue;
-	}
-
-/**
-Primes the sink.
-
-When used as a sink, the file prime opens the file for read/write access.
-*/
-void CProgressiveDownloadSource::SinkPrimeL()
-	{
-	// don't reopen file if already open
-	if (!iFile)
-		{
-
-		if (iFileHandle)
-			iFile = CF32File::NewL(iHandle);
-		else
-			iFile = CF32File::NewL(iFsSession, iFullFileName, EFileRead | EFileWrite);
-
-		iSinkNotStopped = ETrue;
-		}
-	iFileOpen = ETrue;
-	}
-
-/**
-Stops the file source. When stopping close the file.
-*/
-void CProgressiveDownloadSource::SourceStopL()
-	{
-	#if _DEBUG
-	  RDebug::Print(_L("CProgressiveDownloadSource::SourceStopL"));
-    #endif
-	CancelRequests();
-
-    if(iFile == NULL) //rj
-       return;
-
-	iFileOpen = EFalse;
-	TInt pos = 0;
-	if (!iFileHandle && !iFile->IsProtected())
-		{
-		delete iFile;
-		iFile = NULL;
-	//	iFileSize = -1;
-		}
-	else
-		{
-		User::LeaveIfError(iFile->Seek(ESeekStart, pos));
-
-		}
-
-	iPosition=pos;
-	}
-
-/**
-Stops the file sink.
-
-When stopping close the file.
-*/
-void CProgressiveDownloadSource::SinkStopL()
-	{
-	#if _DEBUG
-	  RDebug::Print(_L("CProgressiveDownloadSource::SinkStopL"));
-    #endif
-
-	CancelRequests();
-	iFileOpen = EFalse;
-	if (!iFileHandle)
-		{
-		iSinkNotStopped = EFalse;
-		delete iFile;
-		iFile = NULL;
-		}
-	else
-		{
-		TInt pos = 0;
-		User::LeaveIfError(iFile->Seek(ESeekStart, pos));
-		}
-	//iFileSize = -1;
-	iPosition=0;
-	}
-
-/**
-Returns a boolean indicating if the sink has been stopped.
-
-@return A boolean indicating if the sink has stopped.
- */
-TBool CProgressiveDownloadSource::SinkStopped()
-	{
-	#if _DEBUG
-	  RDebug::Print(_L("CProgressiveDownloadSource::SinkStopped"));
-    #endif
-	if(iSinkNotStopped == EFalse)
-		return ETrue;
-	else
-		return EFalse;
-	}
-
-/**
-Evaluates a given intent against the rights associated with the file.
-
-The rights are not updated by this function call.
-
-@param  aIntent
-        The intent to evaluate.
-
-@return An error code indicating if the function call was successful. KErrNone on success, otherwise
-        another of the system-wide error codes.
-*/
-TInt CProgressiveDownloadSource::EvaluateIntent(ContentAccess::TIntent aIntent) const
-	{
-
-	#if _DEBUG
-	  RDebug::Print(_L("CProgressiveDownloadSource::EvaluateIntent"));
-    #endif
-	if (iFile==NULL)
-		{
-		return KErrNotReady;
-		}
-
-	return iFile->EvaluateIntent(aIntent);
-	}
-
-/**
-Evaluates and executes a given intent against the rights associated with the file.
-
-The rights object is updated after calling this function.
-
-@param  aIntent
-        The intent to evaluate.
-
-@return An error code indicating if the function call was successful. KErrNone on success, otherwise
-        another of the system-wide error codes.
-*/
-TInt CProgressiveDownloadSource::ExecuteIntent(ContentAccess::TIntent aIntent)
-	{
-
-	#if _DEBUG
-	  RDebug::Print(_L("CProgressiveDownloadSource::ExecuteIntent"));
-    #endif
-	if (!iFile)
-		return KErrNotReady;
-
-	return iFile->ExecuteIntent(aIntent);
-	}
-
-/**
-Returns whether the file is protected.
-
-@return A boolean indicating if the file is protected. ETrue if the file is protected.
-*/
-TBool CProgressiveDownloadSource::IsProtectedL() const
-	{
-
-	#if _DEBUG
-	  RDebug::Print(_L("CProgressiveDownloadSource::IsProtectedL"));
-    #endif
-	if (!iFile)
-		User::Leave(KErrNotReady);
-
-	return iFile->IsProtected();
-	}
-
-
-
-
-
-TInt CProgressiveDownloadSource::SetAgentProperty(ContentAccess::TAgentProperty aProperty, TInt aValue)
-	{
-	if (iFile==NULL)
-		{
-		return KErrNotReady;
-		}
-
-	return iFile->SetAgentProperty(aProperty, aValue);
-	}
-
-void CProgressiveDownloadSource::SourceCustomCommand(TMMFMessage& aMessage)
-	{
-    #if _DEBUG
-	  RDebug::Print(_L("CProgressiveDownloadSource::SourceCustomCommand"));
-    #endif
-
-    TInt err= KErrNone;
-	switch(aMessage.Function())
-		  {
-		  case EGETFILEPOSITION:
-			  {
-			  //get iPosition;
-			   #if _DEBUG
-	           RDebug::Print(_L("CProgressiveDownloadSource::SrcCustomCommand file position %d"),iPosition);
-               #endif
-              TPckgBuf<TInt> positionPckg(iPosition);
-			  err = aMessage.WriteDataToClient(positionPckg);
-
-			  break;
-			  }
-          case ESETFILESIZE:
-			  {
-			  //set file size;
-			  TPckgBuf<TInt> fileSizePckg;
-			  err = aMessage.ReadData1FromClient(fileSizePckg);
-			  if((err==KErrNone) && (fileSizePckg()>0))
-				  SetSize(fileSizePckg());
-
-			  break;
-
-			  }
-		 case ESETBYTESDOWNLOADED:
-		 	  {
-		      TPckgBuf<TInt> bytesDownloadedPckg;
-		      err = aMessage.ReadData1FromClient(bytesDownloadedPckg);
-
-		      if((err==KErrNone) &&(bytesDownloadedPckg()>0))
-		          iBytesDownloaded = bytesDownloadedPckg();
-		      break;
-		 	  }
-		  default:
-			  err = KErrNotSupported;
-			  break;
-		  }
-
-	aMessage.Complete(err);
-
-	}
-
-/*
- *	Returns ETrue if the request can safely be deleted.
- */
-TBool CReadWriteRequest::Completed()
-	{
-	return iCompleted ;
-	}
-
-/*
- *	Returns the data member of CMMFDataBuffer or CMMFTransferBuffer (as TPtr8)
- *
- */
-TDes8& CReadWriteRequest::BufferDes()
-	{
-	if(iTransferBufferCopy)
-		return iTransferBufferCopy->Des();
-	else
-		{
-		//reset iBufferDes in case iBuffer has changed...
-		iBufferDes = &(STATIC_CAST(CMMFDataBuffer*, iBuffer)->Data());
-		return *iBufferDes;
-		}
-	}
-
-const TDesC8& CReadWriteRequest::BufferDesC()
-	{
-	if(iTransferBufferCopy)
-		return iTransferBufferCopy->Des();
-	else
-		return BufferDes();
-	}
-
-
-/*
- *	Destructor.
- */
-CReadWriteRequest::~CReadWriteRequest()
-	{
-	Cancel();
-	if(iTransferBufferCopy)
-		iTransferBufferCopy->SetInUse(EFalse);
-	}
-
-/*
- *	Allows owning class access to SetActive()
- */
-void CReadWriteRequest::SetActive()
-	{
-	CActive::SetActive() ;
-	}
-
-/*
- *  For the moment at least...    Canceled requests may be deleted
- */
-void CReadWriteRequest::DoCancel()
-	{
-	iCompleted = ETrue ;
-	}
-
-/*
- *	Called when errors in RunL force Leave.  For the moment just mark the request deletable
- */
-TInt CReadWriteRequest::RunError( TInt aError )
-	{
-	//RunL can leave.
-	iCompleted = ETrue ;
-	iError = aError; //keep this error internally for now
-	return KErrNone ;
-	}
-
-/*
- *	On completion of read request call back to the MDataSink
- */
-void CReadRequest::RunL()
-	{
-
-	#if _DEBUG
-	   RDebug::Print(_L("CReadRequest::RunL file byte position %d"),iPosition);
-	   RDebug::Print(_L("CReadRequest::RunL buffer length %d"),BufferDes().Length());
-	#endif
-
-	if (iStatus != KErrNone)
-		{
-		TMMFEvent event(KMMFErrorCategoryControllerGeneralError, iStatus.Int());
-		iEventHandler->SendEventToClient(event);
-		}
-	else
-		{
-		//Copy the data from the normal buffer into the Transfer buffer
-		if(iTransferBufferCopy)
-			{
-			//must specify the size here as the dest may be smaller than the source.
-			TDes8& destDesc = STATIC_CAST(CMMFDataBuffer*, iBuffer)->Data();
-			destDesc.Copy(iTransferBufferCopy->Des().Left(destDesc.MaxLength()));
-
-			iTransferBufferCopy->SetInUse(EFalse);
-			}
-
-	   #if _DEBUG
-	      RDebug::Print(_L("CReadRequest::RunL bytes downloaded %d"),iBytesDownloaded);
-	   #endif
-	   if(iBytesDownloaded > 0 &&
-	      iBytesDownloaded <= iPosition + BufferDes().Length() &&
-	      iBytesDownloaded < iFileSize)
-		 {
-	   	 #if _DEBUG
-	       RDebug::Print(_L("CReadRequest::RunL - OUT OF DATA"));
-	   	 #endif
-
-	     STATIC_CAST(CMMFDataBuffer*, iBuffer)->Data().SetLength(0);
-
-		 }
-	    else
-	     {
-	     iPosition = iPosition + BufferDes().Length();
-	     }
-
-		//has all the files data been read
-		if(iPosition >= iFileSize)
-			{
-        #if _DEBUG
-           RDebug::Print(_L("CReadRequest::RunL filesize %d"),iFileSize);
-		   RDebug::Print(_L("CReadRequest::RunL file position %d"),iPosition);
-		   RDebug::Print(_L("CReadRequest::RunL setlastbuffer "));
-        #endif
-
-			iBuffer->SetLastBuffer(ETrue);
-			}
-
-		REINTERPRET_CAST(MDataSink*, iSinkOrSource)->BufferFilledL(iBuffer) ; // callback to MDataSource/Sink
-		}
-
-	iCompleted = ETrue ;
-	}
-
-/*
- *  On completion of write request call back to the MDataSource
- */
-void CWriteRequest::RunL()
-	{
-	if(iTransferBufferCopy)
-		iTransferBufferCopy->SetInUse(EFalse);
-
-	if (iStatus != KErrNone)
-		{
-		TMMFEvent event(KMMFErrorCategoryControllerGeneralError, iStatus.Int());
-		iEventHandler->SendEventToClient(event);
-		}
-	else
-		REINTERPRET_CAST(MDataSource*, iSinkOrSource)->BufferEmptiedL(iBuffer) ; // callback to MDataSource/Sink
-
-	iCompleted = ETrue ;
-	}
-
-CProgressiveDownloadSource::CMMFFileAsyncEventHandler::CMMFFileAsyncEventHandler(CProgressiveDownloadSource* aParent)
-	{
-	iParent = aParent;
-	}
-
-CProgressiveDownloadSource::CMMFFileAsyncEventHandler::~CMMFFileAsyncEventHandler()
-	{
-	}
-
-TInt CProgressiveDownloadSource::CMMFFileAsyncEventHandler::SendEventToClient(const TMMFEvent& aEvent)
-	{
-
-#if _DEBUG
-     RDebug::Print(_L("CProgressiveDownloadSource::CMMFFileAsyncEventHandler::SendEventToClient err=%d"),aEvent.iErrorCode);
-#endif
-
-	if(aEvent.iErrorCode == KErrNotReady)//i.e. MMC removed while recording
-		TRAP_IGNORE(iParent->SinkStopL());
-	return iParent->iEventHandler->SendEventToClient(aEvent);
-	}
-
-
-
-// __________________________________________________________________________
-// Exported proxy for instantiation method resolution
-// Define the interface UIDs
-
-const TImplementationProxy ImplementationTable[] =
-	{
-		IMPLEMENTATION_PROXY_ENTRY(KProgressiveDownloadSourceUid,CProgressiveDownloadSource::NewSourceL)
-	};
-
-EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
-	{
-	aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
-
-	return ImplementationTable;
-	}
--- a/mmfenh/progressivedownload/ProgressiveDownloadSource/src/ProgressiveDownloadSource.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,280 +0,0 @@
-/*
-* Copyright (c) 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:  Progressive Download Utility
-*
-*/
-
-
-
-#ifndef __PROGRESSIVEDOWNLOADSOURCE_H_
-#define __PROGRESSIVEDOWNLOADSOURCE_H_
-
-#include <f32file.h>
-
-#include <mmf/server/mmfclip.h>
-#include <mmf/server/mmfdatabuffer.h>
-#include <mmf/common/mmcaf.h>
-
-#include "ProgressiveDownloadSourceUIDs.hrh"
-
-class CReadWriteRequest;
-class CTransferBufferCopy;
-class MGenericFile;
-
-/**
-@publishedAll
-@released
-
-Provides the filename and path of file.
-
-Used by CMMFFile::ConstructL().
-*/
-class TMMFFileParams
-	{
-public:
-	/**
-	Filename and path of file.
-	*/
-	TFileName iPath ; // Filename and path of file.
-private:
-	/**
-	This member is internal and not intended for use.
-	*/
-	TInt iReserved1;
-	};
-
-/**
-@internalTechnology
-*/
-const TUid KFileHandleUid = {0x101FFA19};
-const TUid KMMFileSourceUid = {0x101F7DA9};
-const TUid KMMFileHandleSourceUid = {0x101F7DAA};
-/**
-@publishedAll
-@released
-
-Provides a pointer to the file handle
-
-Used by CMMFFile::ConstructL().
-*/
-class TMMFFileHandleParams
-	{
-public:
-	TMMFFileHandleParams(RFile* aFile) : iUid(KFileHandleUid), iFile(aFile) {}
-	TMMFFileHandleParams() : iUid(KFileHandleUid) {}
-
-	TUid iUid;
-	/**
-	Handle of file
-	*/
-	RFile* iFile;
-private:
-	/**
-	This member is internal and not intended for use.
-	*/
-	TInt iReserved1;
-	};
-
-
-
-
-/**
-@publishedAll
-@released
-*/
-typedef TPckgBuf<TMMFFileParams>  TMMFFileConfig ;
-
-/**
-@publishedAll
-@released
-*/
-typedef TPckgBuf<TMMFFileHandleParams>  TMMFFileHandleConfig ;
-
-
-/**
-@publishedAll
-@released
-
-This details how big the iTransferBufferCopies array of CMMFFile may
-become before we start looking to free entries.
-*/
-const TInt KAcceptableTransferBufferCopiesSize = 5;
-
-/**
-@publishedAll
-@released
-
-This details how big the iTransferBufferCopies array of CMMFFile may
-become before we start looking to free entries.
-*/
-const TInt KMaximumTransferBufferCopiesSize = 100;
-
-
-/**
-@publishedAll
-@released
-
-MultiMedia framework class.  Represents a physical file.
-
-This may be source file from which data is read or destination to which data is written.
-
-Intended to be used by controller plugin developers for source and sink plugins.
-*/
-class CProgressiveDownloadSource : public CMMFClip
-	{
-public:
-	// From MDataSource
-	virtual TFourCC SourceDataTypeCode(TMediaId aMediaId) ;
-	virtual void FillBufferL( CMMFBuffer* aBuffer, MDataSink* aConsumer, TMediaId aMediaId ) ;
-	virtual void BufferEmptiedL( CMMFBuffer* aBuffer ) ;
-	virtual TBool CanCreateSourceBuffer() ;
-	virtual CMMFBuffer* CreateSourceBufferL( TMediaId aMediaId, TBool &aReference ) ;
-	virtual TInt SourceThreadLogon(MAsyncEventHandler& aEventHandler) ;
-	virtual void SourceThreadLogoff();
-	virtual void SourcePrimeL();
-	virtual void SourceStopL();
-
-	// From MDataSink
-	virtual TFourCC SinkDataTypeCode(TMediaId aMediaId) ; //used by data path MDataSource/Sink for codec matching
-	virtual void EmptyBufferL( CMMFBuffer* aBuffer, MDataSource* aSupplier, TMediaId aMediaId ) ;
-	virtual void BufferFilledL( CMMFBuffer* aBuffer ) ;
-	virtual TBool CanCreateSinkBuffer() ;
-	virtual CMMFBuffer* CreateSinkBufferL( TMediaId aMediaId , TBool &aReference) ;
-	virtual TInt SinkThreadLogon(MAsyncEventHandler& aEventHandler) ;
-	virtual void SinkThreadLogoff();
-	virtual void SinkPrimeL();
-	virtual void SinkStopL();
-
-	// From CMMFClip
-	virtual void ReadBufferL( TInt aLength, CMMFBuffer* aBuffer, TInt aPosition, MDataSink* aConsumer);
-	virtual void WriteBufferL( TInt aLength, CMMFBuffer* aBuffer, TInt aPosition, MDataSource* aSupplier);
-	virtual void ReadBufferL( CMMFBuffer* aBuffer, TInt aPosition, MDataSink* aConsumer) ;
-	virtual void WriteBufferL( CMMFBuffer* aBuffer, TInt aPosition, MDataSource* aSupplier) ;
-	virtual void ReadBufferL( CMMFBuffer* aBuffer, TInt aPosition ) ;
-	virtual void WriteBufferL( CMMFBuffer* aBuffer, TInt aPosition ) ;
-	virtual TInt64 BytesFree() ;  // amount of space available for the clip
-	virtual TInt Size() ;
-	virtual TInt Delete();
-	virtual TInt SetSize(TInt aSize);
-
-	// New Functions
-	virtual const TDesC& FileName() const ;
-	virtual const TDesC& Extension() const ;
-	virtual const TDesC& FilePath() const ;
-	virtual const TDesC& FileDrive() const ;
-	virtual const TFileName FullName() const;
-	virtual RFile& FileL() ;
-
-	virtual void SourceCustomCommand(TMMFMessage& aMessage);
-
-
-public :
-	virtual ~CProgressiveDownloadSource() ;
-	static MDataSource* NewSourceL() ;
-	static MDataSink* NewSinkL() ;
-
-	void SetTransferBuffer (TBool aTBuffer) ;
-	TBool CanUseTransferBuffer () ;
-	virtual TBool SinkStopped();
-
-protected :
-	/**
-	Indicates for which purpose the object instance is being created
-	*/
-	enum TMMFileMode
-		{
-		/** The object is created for being a source */
-		ESourceMode,
-		/** The object is created for being a sink */
-		ESinkMode
-		};
-	virtual void ConstructSourceL( const TDesC8& aInitData ) ;
-	virtual void ConstructSinkL( const TDesC8& aInitData ) ;
-	void ConstructL(const TDesC8& aInitData, TMMFileMode aFileMode) ;
-	CProgressiveDownloadSource() ;
-
-	void StoreRequestL( CReadWriteRequest* aRequest ) ;
-	void CancelRequests();
-
-
-	CTransferBufferCopy* ObtainCopyOfTransferBufferL(TInt aMaxLength);
-
-public:
-	// Additional virtuals for DRM Intent
-	virtual TInt ExecuteIntent(ContentAccess::TIntent aIntent);
-	virtual TInt EvaluateIntent(ContentAccess::TIntent aIntent) const;
-	virtual TBool IsProtectedL() const;
-
-
-	virtual TInt SetAgentProperty(ContentAccess::TAgentProperty aProperty, TInt aValue);
-	virtual const TDesC& UniqueId() const;
-
-
-private:
-	class CMMFFileAsyncEventHandler : public MAsyncEventHandler
-		{
-		public:
-			CMMFFileAsyncEventHandler(CProgressiveDownloadSource* aParent);
-			virtual ~CMMFFileAsyncEventHandler();
-		public:
-			virtual TInt SendEventToClient(const TMMFEvent& aEvent);
-		private:
-			CProgressiveDownloadSource* iParent;
-		};
-private:
-	MGenericFile* iFile;
-	RFs iFsSession;
-
-	TBool iFileHandle;
-	RFile iHandle;
-	TBool iFileOpen; // "virtual" open, makes sure that certain accesses are between Prime and Stop
-
-	TBool iSinkNotStopped;
-
-	TFileName iFullFileName ;
-	HBufC* iFileName ;
-	HBufC* iFileExt ;
-	HBufC* iFilePath ;
-	HBufC* iFileDrive ;
-
-	HBufC* iUniqueId;
-
-	TInt iFileSize; //holds the cached file size
-
-	TInt iFix;
-
-	//Keeps track of the read position within the file. Needed in order to enable passing of the
-	//read position to the CReadRequest to manage the LastBuffer flag.
-	//NB: Continuous reads once EOF has been reached will result in iPosition going > iFileSize,
-	//but this causes no ill effects
-	TUint iPosition;
-
-	TFourCC  iSinkFourCC ;
-	TFourCC  iSourceFourCC ;
-
-
-	RPointerArray<CReadWriteRequest> iRequests;
-
-	MAsyncEventHandler *iEventHandler;
-	CMMFFileAsyncEventHandler* iMmfFileEventHandler;
-
-	RPointerArray<CTransferBufferCopy> iTransferBufferCopies;
-	friend class CMMFFileAsyncEventHandler;
-	TInt iBytesDownloaded;
-	};
-
-
-
-
-#endif
--- a/mmfenh/progressivedownload/ProgressiveDownloadSource/src/ProgressiveDownloadSourceUIDs.hrh	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
-* Copyright (c) 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:  Progressive Download Utility  
-*
-*/
-
-#ifndef __PROGRESSIVEDOWNLOADSOURCEUIDS_HRH__
-#define __PROGRESSIVEDOWNLOADSOURCEUIDS_HRH__
-
-
-// These are the ECOM Interface UIDs 
-
-#define KProgressiveDownloadSourceUid   0x10207A7C
-
-
-
-//DataSource CustomCommands
-enum
-{
-EGETFILEPOSITION,
-ESETFILESIZE,
-ESETBYTESDOWNLOADED
-};
-#endif
--- a/mmfenh/progressivedownload/ProgressiveDownloadSource/src/fileaccess.cpp	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,331 +0,0 @@
-/*
-* Copyright (c) 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:  Progressive Download Utility
-*
-*/
-
-#include <f32file.h>
-#include <e32std.h>
-#include <caf/attribute.h>
-#include <caf/bitset.h>
-#include <caf/content.h>
-#include <caf/data.h>
-using namespace ContentAccess;
-#include <f32file.h>
-
-#include "FileAccess.h"
-
-CF32File::~CF32File()
-	{
-	if (!iFileHandle)
-		iFile.Close();
-	delete iFilePath;
-	}
-
-CF32File* CF32File::NewL(RFs& aSession, TDesC& aFilePath, TUint aMode)
-	{
-	CF32File* self = new (ELeave) CF32File;
-	CleanupStack::PushL(self);
-	self->ConstructL(aSession, aFilePath, aMode);
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-
-void CF32File::ConstructL(RFs& aSession, TDesC& aPath, TUint aFileMode)
-	{
-	iSession = &aSession;
-	iFilePath = aPath.AllocL();
-	TUint attributes = 0;
-	TInt err = iSession->Att(*iFilePath, attributes);
-	if (err == KErrNone)
-		{
-		if ( attributes & KEntryAttReadOnly )
-			User::LeaveIfError(iFile.Open(*iSession, *iFilePath, EFileShareAny )) ;
-		else //if ( !( attributes & KEntryAttReadOnly ) )
-			User::LeaveIfError(iFile.Open(*iSession, *iFilePath, EFileShareAny)) ;
-		}
-	else if ((err == KErrNotFound) && (aFileMode & EFileWrite))
-		{
-		User::LeaveIfError(iFile.Create(*iSession, *iFilePath, EFileShareAny )) ;
-		}
-	else
-		{
-		User::Leave(err);
-		}
-	}
-
-
-RFile& CF32File::FileL()
-	{
-	return iFile;
-	}
-
-TInt CF32File::Seek(TSeek aSeekMode, TInt aPos)
-	{
-	return iFile.Seek(aSeekMode, aPos);
-	}
-
-TInt CF32File::Read(TDes8& aDes,TInt aLength)
-	{
-	return iFile.Read(aDes, aLength);
-	}
-
-void CF32File::Read(TDes8& aDes, TInt aLength, TRequestStatus& aStatus)
-	{
-	iFile.Read(aDes, aLength, aStatus);
-	}
-
-TInt CF32File::Write(const TDesC8& aDes,TInt aLength)
-	{
-	return iFile.Write(aDes, aLength);
-	}
-
-void CF32File::Write(const TDesC8& aDes, TInt aLength, TRequestStatus& aStatus)
-	{
-	iFile.Write(aDes, aLength, aStatus);
-	}
-
-TInt CF32File::Size(TInt& aSize)
-	{
-    #if _DEBUG
-	  RDebug::Print(_L("[%x]CF32File::Size to %d\n"),this,aSize);
-    #endif
-
-	return iFile.Size(aSize);
-	}
-
-TInt CF32File::SetSize(TInt aSize)
-	{
-	#if _DEBUG
-	  RDebug::Print(_L("[%x]CF32File::SetSize to %d\n"),this,aSize);
-    #endif
-
-
-	TInt err =  iFile.SetSize(aSize);
-	if(err == KErrNone)
-		iFileSize = aSize;
-	else
-		iFileSize = -1;
-
-	return err;
-	}
-
-TInt CF32File::EvaluateIntent(TIntent /*aIntent*/) const
-	{
-	return KErrNone;
-	}
-
-
-TInt CF32File::ExecuteIntent(TIntent /*aIntent*/)
-	{
-	return KErrNone;
-	}
-
-TBool CF32File::IsProtected() const
-	{
-	return EFalse;
-	}
-
-
-TInt CF32File::SetAgentProperty(TAgentProperty /*aProperty*/, TInt /*aValue*/)
-	{
-	// not an error to set this if not supported, just wont do anything
-	return KErrNone;
-	}
-
-
-CContentFile::~CContentFile()
-	{
-	delete iData;
-	delete iContent;
-
-	if (iLegacyFileOpen)
-		iLegacyFile.Close();
-	delete iFilePath;
-	}
-
-
-
-CContentFile* CContentFile::NewL(RFs& aSession, const TDesC& aFilePath, const TDesC& aUniqueId, TUint aMode)
-	{
-	CContentFile* self = new (ELeave) CContentFile;
-	CleanupStack::PushL(self);
-	self->ConstructL(aSession, aFilePath, aUniqueId, aMode);
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-void CContentFile::ConstructL(RFs& aSession, const TDesC& aPath, const TDesC& aUniqueId, TUint /*aMode*/)
-	{
-	iSession = &aSession;
-	iFilePath = aPath.AllocL();
-
-	iContent = CContent::NewL(*iFilePath,EContentShareReadWrite);
-	if (aUniqueId.Length()>0)
-		{
-		iData = iContent->OpenContentL(EPeek, aUniqueId);//rj need mode for this one.
-		}
-	else
-		{
-		iData = iContent->OpenContentL(EPeek,EContentShareReadWrite);
-		}
-	}
-
-CContentFile* CContentFile::NewL(RFs& aSession, const TDesC& aFilePath, TUint aMode)
-	{
-	CContentFile* self = new (ELeave) CContentFile;
-	CleanupStack::PushL(self);
-	self->ConstructL(aSession, aFilePath, aMode);
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-void CContentFile::ConstructL(RFs& aSession, const TDesC& aPath, TUint /*aMode*/)
-	{
-	iSession = &aSession;
-	iFilePath = aPath.AllocL();
-
-	iContent = CContent::NewL(*iFilePath, EContentShareReadWrite) ;
-	iData = iContent->OpenContentL(EPeek,EContentShareReadWrite);
-	}
-
-
-
-
-
-TInt CContentFile::EvaluateIntent(TIntent aIntent) const
-	{
-	ASSERT(iData);
-	return iData->EvaluateIntent(aIntent);
-	}
-
-
-TInt CContentFile::ExecuteIntent(TIntent aIntent)
-	{
-	ASSERT(iData);
-	return iData->ExecuteIntent(aIntent);
-	}
-
-TBool CContentFile::IsProtected() const
-	{
-	ASSERT(iContent && iData);
-	TInt value = 0;
-	TInt err =iData->GetAttribute(EIsProtected, value);
-	return (err == KErrNone && value);
-	}
-
-
-TInt CContentFile::SetAgentProperty(ContentAccess::TAgentProperty aProperty, TInt aValue)
-	{
-	ASSERT(iContent);
-	return iContent->SetProperty(aProperty, aValue);
-	}
-
-
-TInt CContentFile::Seek(TSeek aSeekMode, TInt aPos)
-	{
-	ASSERT(iData);
-	return iData->Seek(aSeekMode, aPos);
-	}
-
-TInt CContentFile::Read(TDes8& aDes,TInt aLength)
-	{
-	ASSERT(iData);
-	return iData->Read(aDes,aLength);
-	}
-
-void CContentFile::Read(TDes8& aDes, TInt aLength, TRequestStatus& aStatus)
-	{
-	ASSERT(iData);
-	iData->Read(aDes, aLength, aStatus);
-	}
-
-TInt CContentFile::Write(const TDesC8& /*aDes*/,TInt /*aLength*/)
-	{
-	return KErrAccessDenied;
-	}
-void CContentFile::Write(const TDesC8& /*aDes*/, TInt /*aLength*/, TRequestStatus& aStatus)
-	{
-	TRequestStatus* status = &aStatus;
-	User::RequestComplete(status, KErrAccessDenied);
-	}
-
-TInt CContentFile::SetSize(TInt /*aSize*/)
-	{
-	// Only a source is implemented, hence this cannot be allowed
-	return KErrAccessDenied;
-	}
-
-
-// Get the size of file
-// this method opens a new, read-only, RFile the first time this method is called
-
-TInt CContentFile::Size(TInt& aSize)
-	{
-	ASSERT(iData);
-	TRAPD(err, iData->DataSizeL(aSize));
-	return err;
-	}
-
-/**
- * return a RFile for the legacy RFile method
- * this method opens a new, read-only, RFile the first time this method is called
- * @internalTechnology
- * @return Reference to RFile handle to current file
- */
-RFile& CContentFile::FileL()
-	{
-	if (!iLegacyFileOpen)
-		{
-		User::LeaveIfError(iLegacyFile.Open(*iSession, *iFilePath, EFileRead | EFileStream | EFileShareAny));
-		iLegacyFileOpen = ETrue;
-		}
-	return iLegacyFile;
-	}
-
-
-CF32File* CF32File::NewL(RFile& aFile)
-	{
-	CF32File* self = new (ELeave) CF32File;
-	CleanupStack::PushL(self);
-	self->ConstructL(aFile);
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-void CF32File::ConstructL(RFile& aFile)
-	{
-	iFile = aFile;
-	iFileHandle = ETrue;
-	}
-
-CContentFile* CContentFile::NewL(RFile& aFile, const TDesC& aUniqueId)
-	{
-	CContentFile* self = new (ELeave) CContentFile;
-	CleanupStack::PushL(self);
-	self->ConstructL(aFile, aUniqueId);
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-void CContentFile::ConstructL(RFile& aFile, const TDesC& aUniqueId)
-	{
-	iContent = CContent::NewL(aFile) ;
-	if (aUniqueId.Length()>0)
-		iData = iContent->OpenContentL(EPeek, aUniqueId); //need mode
-	else
-		iData = iContent->OpenContentL(EPeek, aUniqueId);
-	}
-
--- a/mmfenh/progressivedownload/ProgressiveDownloadUtility/BWINS/PDProperties.def	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-EXPORTS
-	??1CPdProperties@@UAE@XZ @ 1 NONAME ; CPdProperties::~CPdProperties(void)
-	?NewL@CPdProperties@@SAPAV1@XZ @ 2 NONAME ; class CPdProperties * CPdProperties::NewL(void)
-	?NewLC@CPdProperties@@SAPAV1@XZ @ 3 NONAME ; class CPdProperties * CPdProperties::NewLC(void)
-	?OpenL@CPdProperties@@QAEPAVCAudioPdPlayUtility@@ABVRFile@@AAVMAudioPdPlayUtilityCallback@@@Z @ 4 NONAME ; class CAudioPdPlayUtility * CPdProperties::OpenL(class RFile const &, class MAudioPdPlayUtilityCallback &)
-	?OpenL@CPdProperties@@QAEPAVCAudioPdPlayUtility@@ABVTDesC16@@AAVMAudioPdPlayUtilityCallback@@@Z @ 5 NONAME ; class CAudioPdPlayUtility * CPdProperties::OpenL(class TDesC16 const &, class MAudioPdPlayUtilityCallback &)
-
--- a/mmfenh/progressivedownload/ProgressiveDownloadUtility/BWINS/ProgressiveDownloadUtility.def	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-EXPORTS
-	??1CProgressiveDownloadUtility@@UAE@XZ @ 1 NONAME ; CProgressiveDownloadUtility::~CProgressiveDownloadUtility(void)
-	?NewL@CProgressiveDownloadUtility@@SAPAV1@XZ @ 2 NONAME ; class CProgressiveDownloadUtility * CProgressiveDownloadUtility::NewL(void)
-	?OpenL@CProgressiveDownloadUtility@@QAEPAVMAudioPdPlayUtility@@ABVRFile@@AAVMAudioPdPlayUtilityCallback@@@Z @ 3 NONAME ; class MAudioPdPlayUtility * CProgressiveDownloadUtility::OpenL(class RFile const &, class MAudioPdPlayUtilityCallback &)
-	?OpenL@CProgressiveDownloadUtility@@QAEPAVMAudioPdPlayUtility@@ABVTDesC16@@AAVMAudioPdPlayUtilityCallback@@@Z @ 4 NONAME ; class MAudioPdPlayUtility * CProgressiveDownloadUtility::OpenL(class TDesC16 const &, class MAudioPdPlayUtilityCallback &)
-
--- a/mmfenh/progressivedownload/ProgressiveDownloadUtility/EABI/PDProperties.def	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-EXPORTS
-	_ZN13CPdProperties4NewLEv @ 1 NONAME
-	_ZN13CPdProperties5NewLCEv @ 2 NONAME
-	_ZN13CPdProperties5OpenLERK5RFileR27MAudioPdPlayUtilityCallback @ 3 NONAME
-	_ZN13CPdProperties5OpenLERK7TDesC16R27MAudioPdPlayUtilityCallback @ 4 NONAME
-	_ZN13CPdPropertiesD0Ev @ 5 NONAME
-	_ZN13CPdPropertiesD1Ev @ 6 NONAME
-	_ZN13CPdPropertiesD2Ev @ 7 NONAME
-	_ZTI13CPdProperties @ 8 NONAME ; #<TI>#
-	_ZTI18CAudioPdProperties @ 9 NONAME ; #<TI>#
-	_ZTI19CAudioPdPlayUtility @ 10 NONAME ; #<TI>#
-	_ZTI26CMMFMdaAudioPlayerCallBack @ 11 NONAME ; #<TI>#
-	_ZTI27CRepeatTrailingSilenceTimer @ 12 NONAME ; #<TI>#
-	_ZTIN10multimedia21CBufferEmptiedEventAOE @ 13 NONAME ; #<TI>#
-	_ZTIN25CMMFFindAndOpenController7CConfigE @ 14 NONAME ; #<TI>#
-	_ZTV13CPdProperties @ 15 NONAME ; #<VT>#
-	_ZTV18CAudioPdProperties @ 16 NONAME ; #<VT>#
-	_ZTV19CAudioPdPlayUtility @ 17 NONAME ; #<VT>#
-	_ZTV26CMMFMdaAudioPlayerCallBack @ 18 NONAME ; #<VT>#
-	_ZTV27CRepeatTrailingSilenceTimer @ 19 NONAME ; #<VT>#
-	_ZTVN10multimedia21CBufferEmptiedEventAOE @ 20 NONAME ; #<VT>#
-	_ZTVN25CMMFFindAndOpenController7CConfigE @ 21 NONAME ; #<VT>#
-	_ZTI12CContentFile @ 22 NONAME ; #<TI>#
-	_ZTV12CContentFile @ 23 NONAME ; #<VT>#
-
--- a/mmfenh/progressivedownload/ProgressiveDownloadUtility/EABI/ProgressiveDownloadUtility.def	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-EXPORTS
-	_ZN27CProgressiveDownloadUtility4NewLEv @ 1 NONAME
-	_ZN27CProgressiveDownloadUtility5OpenLERK5RFileR27MAudioPdPlayUtilityCallback @ 2 NONAME
-	_ZN27CProgressiveDownloadUtility5OpenLERK7TDesC16R27MAudioPdPlayUtilityCallback @ 3 NONAME
-	_ZN27CProgressiveDownloadUtilityD0Ev @ 4 NONAME
-	_ZN27CProgressiveDownloadUtilityD1Ev @ 5 NONAME
-	_ZN27CProgressiveDownloadUtilityD2Ev @ 6 NONAME
-	_ZTI27CProgressiveDownloadUtility @ 7 NONAME ; #<TI>#
-	_ZTV27CProgressiveDownloadUtility @ 8 NONAME ; #<VT>#
-
--- a/mmfenh/progressivedownload/ProgressiveDownloadUtility/group/PDProperties.mmp	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-/*
-* Copyright (c) 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 ProgressiveDownloadUtility
-*
-*/
-
-
-#include <platform_paths.hrh>
-
-TARGET       PDProperties.dll
-TARGETTYPE   DLL
-
-DEFFILE	     PDProperties.def
-NOSTRICTDEF
-
-
-
-UID  0x10207BA7
-
-CAPABILITY ALL -Tcb
-
-USERINCLUDE     ../inc ../../ProgressiveDownloadSource/src
-USERINCLUDE	../../../../inc
-
-MW_LAYER_SYSTEMINCLUDE
-SYSTEMINCLUDE	/epoc32/include/mmf/server
-SYSTEMINCLUDE	/epoc32/include/kernel
-SYSTEMINCLUDE	/epoc32/include/mmf/common
-SYSTEMINCLUDE   /epoc32/include/caf
-
-SOURCEPATH   	../src
-SOURCE      BufferEmptiedEventAO.cpp
-#ifdef RD_PD_FOR_AUDIO_CONTENT_VIA_HELIX_ENGINE
-SOURCE		EMCPdPlayUtility.cpp 
-#else
-SOURCE		AudioPdPlayUtility.cpp 
-#endif
-SOURCE		mmfclientutility.cpp
-SOURCE		ContentFile.cpp
-SOURCE		PDProperties.cpp 
-
-
-LIBRARY		euser.lib   
-LIBRARY 	efsrv.lib 
-LIBRARY		ecom.lib 
-LIBRARY		mmfcontrollerframework.lib 
-LIBRARY		mmfstandardcustomcommands.lib 
-LIBRARY		DownloadMgr.lib
-LIBRARY 	caf.lib
-LIBRARY		cafutils.lib
-LIBRARY     EnhancedMediaClient.lib
-LIBRARY     apgrfx.lib
-LIBRARY     apmime.lib
-LIBRARY     MetaDataUtility.lib        
-  
-#ifdef SYMBIAN_CAF_V2
-LIBRARY		estor.lib
-LIBRARY		mmcommon.lib
-#endif
-
--- a/mmfenh/progressivedownload/ProgressiveDownloadUtility/group/ProgressiveDownloadUtility.mmp	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
-* Copyright (c) 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 ProgressiveDownloadUtility
-*
-*/
-
-
-#include <platform_paths.hrh>
-
-TARGET       ProgressiveDownloadUtility.dll
-TARGETTYPE   DLL
-
-DEFFILE	     ProgressiveDownloadUtility.def
-NOSTRICTDEF
-
-
-
-UID  0x10207A7A
-
-CAPABILITY ALL -Tcb
-
-USERINCLUDE     ../inc ../../ProgressiveDownloadSource/src
-USERINCLUDE	../../../../inc
-
-MW_LAYER_SYSTEMINCLUDE
-SYSTEMINCLUDE	/epoc32/include/mmf/server
-SYSTEMINCLUDE	/epoc32/include/kernel
-SYSTEMINCLUDE	/epoc32/include/mmf/common
-
-
-
-SOURCEPATH   	../src
-SOURCE		ProgressiveDownloadUtility.cpp 
-
-
-LIBRARY		euser.lib   
-LIBRARY 	efsrv.lib  
-LIBRARY		ecom.lib 
-LIBRARY		mmfcontrollerframework.lib 
-LIBRARY		mmfstandardcustomcommands.lib 
-LIBRARY     PDProperties.lib        
-  
-#ifdef SYMBIAN_CAF_V2
-LIBRARY		estor.lib
-LIBRARY		mmcommon.lib
-#endif
-
--- a/mmfenh/progressivedownload/ProgressiveDownloadUtility/group/bld.inf	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-/*
-* Copyright (c) 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 ProgressiveDownloadUtility
-*
-*/
-
-
-PRJ_PLATFORMS
-DEFAULT
-
-
-PRJ_EXPORTS
-
-
-PRJ_MMPFILES
-PDProperties.mmp
-ProgressiveDownloadUtility.mmp
--- a/mmfenh/progressivedownload/ProgressiveDownloadUtility/src/AudioPdPlayUtility.cpp	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,947 +0,0 @@
-/*
-* Copyright (c) 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:  Progressive Download Utility
-*
-*/
-
-#include <bautils.h>
-#include <utf.h>
-#include <mmfpaniccodes.h>
-#include "AudioPdPlayUtility.h"
-#include "AudioPdProperties.h"
-#include "progressivedownloadsourceuids.hrh"
-
-#include <AudioPreference.h>
-
-//void Panic(TInt aPanicCode);
-
-const TUid KUidProgressiveDlSource	= {KProgressiveDownloadSourceUid};
-
-void Panic(TInt aPanicCode)
-	{
-	_LIT(KProgressiveDownloadUtility, "ProgressiveDownloadUtility");
-	User::Panic(KProgressiveDownloadUtility, aPanicCode);
-	}
-
-CAudioPdPlayUtility* CAudioPdPlayUtility::NewL(MAudioPdPlayUtilityCallback& aCallback)
-	{
-    CAudioPdPlayUtility* self = new(ELeave) CAudioPdPlayUtility();
-	CleanupStack::PushL(self);
-
- 	self->iProperties = CAudioPdProperties::NewL(aCallback);
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-CAudioPdPlayUtility::~CAudioPdPlayUtility()
-	{
-	delete iProperties;
-	}
-
-CAudioPdPlayUtility::CAudioPdPlayUtility()
-	{
-
-	}
-
-void CAudioPdPlayUtility::ConstructL()
-	{
-
-	}
-
-//For Download Status
-void CAudioPdPlayUtility::HandleDownloadEventL(TUint aTransactionID,
-                                               TBrCtlDownloadEvent aEvent,
-                                               TUint aValue)
-	{
-    iProperties->HandleDownloadEventL(aTransactionID,aEvent,aValue);
-	}
-
-
-void CAudioPdPlayUtility::Play()
-	{
-    iProperties->Play();
-	}
-void CAudioPdPlayUtility::Stop()
-	{
-    iProperties->Stop();
-	}
-TInt CAudioPdPlayUtility::Pause()
-	{
-    return iProperties->Pause();
-	}
-void CAudioPdPlayUtility::SetVolume(TInt aVolume)
-	{
-    iProperties->SetVolume(aVolume);
-	}
-void CAudioPdPlayUtility::SetRepeats(TInt aRepeatNumberOfTimes, const TTimeIntervalMicroSeconds& aTrailingSilence)
-	{
-    iProperties->SetRepeats(aRepeatNumberOfTimes,aTrailingSilence);
-	}
-void CAudioPdPlayUtility::SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration)
-	{
-    iProperties->SetVolumeRamp(aRampDuration);
-	}
-const TTimeIntervalMicroSeconds& CAudioPdPlayUtility::Duration()
-	{
-	return iProperties->Duration();
-	}
-TInt CAudioPdPlayUtility:: MaxVolume()
-	{
-	return iProperties->MaxVolume();
-	}
-void CAudioPdPlayUtility::Close()
-	{
-    iProperties->Close();
-	}
-TInt CAudioPdPlayUtility::GetPosition(TTimeIntervalMicroSeconds& aPosition)
-	{
-    return iProperties->GetPosition(aPosition);
-	}
-void CAudioPdPlayUtility::SetPosition(const TTimeIntervalMicroSeconds& aPosition)
-	{
-    iProperties->SetPosition(aPosition);
-	}
-
-TInt CAudioPdPlayUtility::SetPriority(TInt aPriority, TMdaPriorityPreference aPref)
-	{
-    return iProperties->SetPriority(aPriority,aPref);
-	}
-TInt CAudioPdPlayUtility::GetVolume(TInt& aVolume)
-	{
-    return iProperties->GetVolume(aVolume);
-	}
-TInt CAudioPdPlayUtility::GetNumberOfMetaDataEntries(TInt& aNumEntries)
-	{
-    return iProperties->GetNumberOfMetaDataEntries(aNumEntries);
-	}
-
-
-CMMFMetaDataEntry* CAudioPdPlayUtility::GetMetaDataEntryL(TInt aMetaDataIndex)
-	{
-	return iProperties->GetMetaDataEntryL(aMetaDataIndex);
-	}
-
-TInt CAudioPdPlayUtility::SetPlayWindow(const TTimeIntervalMicroSeconds& aStart,
-								const TTimeIntervalMicroSeconds& aEnd)
-	{
-    return iProperties->SetPlayWindow(aStart,aEnd);
-	}
-
-TInt CAudioPdPlayUtility::ClearPlayWindow()
-	{
-    return iProperties->ClearPlayWindow();
-	}
-TInt CAudioPdPlayUtility::SetBalance(TInt aBalance)
-	{
-    return iProperties->SetBalance(aBalance);
-	}
-TInt CAudioPdPlayUtility::GetBalance(TInt& aBalance)
-	{
-    return iProperties->GetBalance(aBalance);
-	}
-TInt CAudioPdPlayUtility::GetBitRate(TUint& aBitRate)
-	{
-    return iProperties->GetBitRate(aBitRate);
-	}
-
-
-void CAudioPdPlayUtility::RegisterForAudioLoadingNotification(MAudioLoadingObserver& aCallback)
-	{
-    iProperties->RegisterForAudioLoadingNotification(aCallback);
-	}
-
-void CAudioPdPlayUtility::GetAudioLoadingProgressL(TInt& aPercentageProgress)
-	{
-    iProperties->GetAudioLoadingProgressL(aPercentageProgress);
-	}
-
-const CMMFControllerImplementationInformation& CAudioPdPlayUtility::ControllerImplementationInformationL()
-	{
-	return iProperties->ControllerImplementationInformationL();
-	}
-
-
-TInt CAudioPdPlayUtility::CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom)
-	{
-    return iProperties->CustomCommandSync(aDestination, aFunction, aDataTo1, aDataTo2, aDataFrom);
-	}
-TInt CAudioPdPlayUtility::CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2)
-	{
-    return iProperties->CustomCommandSync(aDestination, aFunction, aDataTo1, aDataTo2);
-	}
-void CAudioPdPlayUtility::CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom, TRequestStatus& aStatus)
-	{
-	iProperties->CustomCommandAsync(aDestination, aFunction, aDataTo1, aDataTo2, aDataFrom, aStatus);
-	}
-void CAudioPdPlayUtility::CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TRequestStatus& aStatus)
-	{
-	iProperties->CustomCommandAsync(aDestination, aFunction, aDataTo1, aDataTo2, aStatus);
-	}
-
-void CAudioPdPlayUtility::OpenFileL(const TDesC& aFileName)
-	{
-	iProperties->OpenFileL(aFileName);
-	}
-
-
-void CAudioPdPlayUtility::OpenFileL(const RFile& aFile)
-	{
-	RFile& file = const_cast<RFile&>(aFile);
-	iProperties->OpenFileL(file);
-	}
-
-
-void CAudioPdPlayUtility::OpenFileL(const TMMSource& aSource)
-	{
-	iProperties->OpenFileL(aSource);
-	}
-
-void CAudioPdPlayUtility::DlCompleteOpenFileL(const TDesC& aFileName)
-	{
-	iProperties->DlCompleteOpenFileL(aFileName);
-	}
-
-TInt CAudioPdPlayUtility::GetFilePosition(TInt& aFilePosition)
-	{
-	return iProperties->GetFilePosition(aFilePosition);
-	}
-
-TInt CAudioPdPlayUtility::SetFileSize(TInt aFileSize)
-	{
-	return iProperties->SetFileSize(aFileSize);
-	}
-
-TInt CAudioPdPlayUtility::SetBytesDownloaded(TInt aBytesDownloaded, TBool aDownloadComplete)
-	{
-	return iProperties->SetBytesDownloaded(aBytesDownloaded,aDownloadComplete);
-	}
-
-MMMFDRMCustomCommand* CAudioPdPlayUtility::GetDRMCustomCommand()
-	{
-	//ASSERT(iProperties);
-	return iProperties->GetDRMCustomCommand();
-	}
-
-
-TInt CAudioPdPlayUtility::CheckAudioPlayerState()
-	{
-	return iProperties->CheckAudioPlayerState();
-	}
-
-
-//===============================================================
-// CAudioPdProperties implementation begins
-//
-//===============================================================
-CAudioPdProperties* CAudioPdProperties::NewL(MAudioPdPlayUtilityCallback& aCallback)
-	{
-	CAudioPdProperties* self = new(ELeave) CAudioPdProperties(aCallback);
-	CleanupStack::PushL(self);
-	self->ConstructL(aCallback);
-	CleanupStack::Pop(self);
-	return self;
-	}
-CAudioPdProperties* CAudioPdProperties::NewLC(MAudioPdPlayUtilityCallback& /*aCallback*/)
-	{
-	return NULL;
-	}
-
-CAudioPdProperties::~CAudioPdProperties()
-	{
-
-	delete iControllerImplementationInformation;
-	delete iAsyncCallBack;
-	delete iRepeatTrailingSilenceTimer;
-	delete iFindAndOpenController;
-	delete iControllerEventMonitor;
-	iMediaIds.Close();
-	iController.Close();
-	}
-
-CAudioPdProperties::CAudioPdProperties(/*MMdaAudioPlayerCallback*/MAudioPdPlayUtilityCallback& aCallback):
-	iCallback(aCallback),
-	iAudioPlayDeviceCommands(iController),
-	iAudioPlayControllerCommands(iController),
-	iDRMCustomCommands(iController)
-	{
-	iState = EStopped;
-	iPrioritySettings.iPriority = KAudioPriorityRealOnePlayer;//80
-	iPrioritySettings.iPref =(TMdaPriorityPreference) KAudioPrefRealOneLocalPlayback;// 0x01420001;
-	iPlayStart = TTimeIntervalMicroSeconds(0);
-	iPlayEnd = TTimeIntervalMicroSeconds(0);
-	iPlayWindowSet = ENone;
-    iSourceHandle =  NULL;
-	}
-
-void CAudioPdProperties::ConstructL(MAudioPdPlayUtilityCallback& /*aCallback*/)
-	{
-
-	iControllerEventMonitor = CMMFControllerEventMonitor::NewL(*this, iController);
-	iRepeatTrailingSilenceTimer = CRepeatTrailingSilenceTimer::NewL(*this);
-	iAsyncCallBack = CMMFMdaAudioPlayerCallBack::NewL(iCallback);
-	User::LeaveIfError(iMediaIds.Append(KUidMediaTypeAudio));
-	iFindAndOpenController = CMMFFindAndOpenController::NewL(*this);
-	iFindAndOpenController->Configure(iMediaIds[0], iPrioritySettings);
-	iFindAndOpenController->ConfigureController(iController, *iControllerEventMonitor, CMMFFindAndOpenController::EPlayback);
-
-	}
-
-void CAudioPdProperties::MfaocComplete(
-		TInt& aError,
-		RMMFController* /*aController*/,
-		TUid aControllerUid,
-		TMMFMessageDestination* aSourceHandle,
-		TMMFMessageDestination* /*aSinkHandle*/)
-	{
-
-	iSourceHandle = aSourceHandle;
-
-	if (aError == KErrNone)
-		{
-		iControllerUid = aControllerUid;
-
-		// Get the clip duration
-		iDuration = TTimeIntervalMicroSeconds(0);
-		aError = iController.GetDuration(iDuration);
-
-		// If an error occurred in any of the above, close the controller.
-		if (aError != KErrNone)
-			{
-			iControllerEventMonitor->Cancel();
-			iController.Close();
-			}
-		}
-
-	iAsyncCallBack->InitComplete(aError, iDuration);
-	}
-
-void CAudioPdProperties::HandleDownloadEventL(TUint aTransactionID,
-                                              TBrCtlDownloadEvent aEvent,
-                                              TUint aValue)
-	{
-	iCallback.HandleDownloadEventL(aTransactionID,aEvent,aValue);
-
-	}
-
-
-void CAudioPdProperties::OpenFileL(const TDesC& aFileName)
-	{
-	TMMFileSource filesource(aFileName, ContentAccess::KDefaultContentObject, ContentAccess::EPlay);
-	OpenFileL(filesource);
-	}
-
-
-void CAudioPdProperties::OpenFileL(const RFile& aFile)
-	{
-	RFile& file = const_cast<RFile&>(aFile);
-	TMMFileHandleSource filesource(file, KNullDesC, ContentAccess::EPlay);
-	OpenFileL(filesource);
-	}
-
-void CAudioPdProperties::OpenFileL(const TMMSource& aSource)
-	{
-	// If iAsyncCallBack is already active, we're still in the process of notifying the client
-	// that a previous request to Open...(...) has completed.
-	if (iAsyncCallBack->IsActive())
-		User::Leave(KErrNotReady);
-
-
-	if (aSource.SourceType()==KUidMMFileHandleSource)
-		{
-
-		RFile& fileHandle = static_cast<const TMMFileHandleSource&>(aSource).Handle();
-
-	    iFindAndOpenController->ConfigureSourceSink(
-	       CMMFFindAndOpenController::TSourceSink(KUidProgressiveDlSource,fileHandle),
-		   CMMFFindAndOpenController::TSourceSink(KUidMmfAudioOutput));
-
-		}
-	if (aSource.SourceType()==KUidMMFileSource)
-		{
-		const TDesC& fileName = static_cast<const TMMFileSource&>(aSource).Name();
-
-	    iFindAndOpenController->ConfigureSourceSink(
-	       CMMFFindAndOpenController::TSourceSink(KUidProgressiveDlSource,
-	       CMMFFindAndOpenController::GetConfigFile(fileName)),
-		   CMMFFindAndOpenController::TSourceSink(KUidMmfAudioOutput));
-
-		}
-
-	iFindAndOpenController->OpenByFileSource(aSource);
-	}
-
-void CAudioPdProperties::DlCompleteOpenFileL(const TDesC& aFileName)
-	{
-	if (iAsyncCallBack->IsActive())
-		User::Leave(KErrNotReady);
-
-	Close();
-
-	TMMFileSource filesource(aFileName, ContentAccess::KDefaultContentObject, ContentAccess::EPlay);
-
-
-	iFindAndOpenController->ConfigureSourceSink(
-			TMMFileSource(aFileName, filesource.UniqueId(), filesource.Intent(), filesource.IsUIEnabled()),
-			CMMFFindAndOpenController::TSourceSink(KUidMmfAudioOutput));
-
-	iFindAndOpenController->OpenByFileSource(filesource);
-
-
-	}
-
-
-void CAudioPdProperties::Play()
-	{
-	// if we're already playing, call the client's callback with KErrNotReady.
-	// This is what the controller would do if we allowed the Play()
-	// to propagate down. Need to do it here too (for consistency)
-	// in case we're in a trailing silence period.
-    if (iState == EPlaying)
-		{
-		iAsyncCallBack->PlayComplete(KErrNotReady);
-		return;
-		}
-
-	// cancel the repeat timer in case the client has called Play()
-	// without waiting for the previous play to complete
-	iRepeatTrailingSilenceTimer->Cancel();
-	// Reset played count
-	iNumberOfTimesPlayed = 0;
-
-	DoPlay();
-	}
-
-void CAudioPdProperties::DoPlay()
-	{
-#if defined(__AUDIO_PROFILING)
-	RDebug::ProfileStart(4);
-#endif  // defined(__AUDIO_PROFILING)
-    TInt err = KErrNone;
-    if (iState != EPaused)
-        {
-		err = iController.Prime();
-
-#if defined(__AUDIO_PROFILING)
-	RDebug::ProfileEnd(4);
-#endif  // defined(__AUDIO_PROFILING)
-
-		// make sure we don't set the position outside the play window -
-		// but allow it to remain unchanged if it's within the window
-		if (iPlayWindowSet == ESet &&
-			(iPosition < iPlayStart || iPosition >= iPlayEnd))
-			iPosition = iPlayStart;
-
-		if (err==KErrNone)
-			err = iController.SetPosition(iPosition);
-        }
-
-	if (err==KErrNone)
-		{
-		if (iPlayWindowSet == ESet)
-			err = iAudioPlayControllerCommands.SetPlaybackWindow(iPlayStart, iPlayEnd);
-		else if (iPlayWindowSet == EClear)
-			{
-			err = iAudioPlayControllerCommands.DeletePlaybackWindow();
-			iPlayWindowSet = ENone;	// assume window will stay cleared
-			}
-		}
-
-	if (err==KErrNone)
-		{
-#if defined(__AUDIO_PROFILING)
-		RDebug::ProfileStart(5);
-#endif  // defined(__AUDIO_PROFILING)
-
-		err = iController.Play();
-
-#if defined(__AUDIO_PROFILING)
-		RDebug::ProfileEnd(5);
-#endif  // defined(__AUDIO_PROFILING)
-		}
-
-	if (err!=KErrNone)
-		iAsyncCallBack->PlayComplete(err);
-	else
-		{
-		iState = EPlaying;
-		iCallback.Playing();
-		}
-	}
-
-
-void CAudioPdProperties::Stop()
-	{
-	if (iState==EPlaying || iState==EPaused)
-		{
-		// cancel the repeat timer in case the client has called Stop()
-		// during the trailing silence period
-		iRepeatTrailingSilenceTimer->Cancel();
-
-		iController.Stop();
-		iPosition = iPlayStart;
-		iState = EStopped;
-		}
-
-	}
-TInt CAudioPdProperties::Pause()
-	{
-    TInt err = KErrNone;
-	if (iState==EPlaying)
-		{
-		err = iController.Pause();
-		if (!err || err==KErrNotReady)
-			err = iController.GetPosition(iPosition);
-		iState = EPaused;
-		iCallback.Paused();
-		}
-	return err;
-	}
-void CAudioPdProperties::SetVolume(TInt aVolume)
-	{
-	TInt err = iAudioPlayDeviceCommands.SetVolume(aVolume);
-
-	__ASSERT_ALWAYS(err==KErrNone, Panic(EMMFMediaClientBadArgument));
-	}
-void CAudioPdProperties::SetRepeats(TInt aRepeatNumberOfTimes, const TTimeIntervalMicroSeconds& aTrailingSilence)
-	{
-	iNumberOfTimesToRepeat = aRepeatNumberOfTimes;
-	iTrailingSilence = aTrailingSilence;
-	}
-void CAudioPdProperties::SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration)
-	{
-	iAudioPlayDeviceCommands.SetVolumeRamp(aRampDuration);
-	}
-const TTimeIntervalMicroSeconds& CAudioPdProperties::Duration()
-	{
-	TInt err = iController.GetDuration(iDuration);
-	if (err)
-		{
-		iDuration = 0;
-		}
-	return iDuration;
-	}
-TInt CAudioPdProperties:: MaxVolume()
-	{
-		TInt maxVolume = 0;
-#ifdef _DEBUG
-	TInt error =
-#endif
-		iAudioPlayDeviceCommands.GetMaxVolume(maxVolume);
-	__ASSERT_DEBUG(error==KErrNone, Panic(EMMFMediaClientPanicServerCommunicationProblem));
-	return maxVolume;
-	}
-void CAudioPdProperties::Close()
-	{
-	// Reset the audio player state.
-	Stop();
-	iControllerEventMonitor->Cancel();
-	iController.Close();
-	}
-TInt CAudioPdProperties::GetPosition(TTimeIntervalMicroSeconds& aPosition)
-	{
-    TInt error = KErrNone;
-//	if (iState==EPlaying)
-   //For progressivedownload pause and resume I need to get the
-   //last position even if not playing.
-	error = iController.GetPosition(iPosition);
-
-	aPosition = iPosition;
-	return error;
-	}
-void CAudioPdProperties::SetPosition(const TTimeIntervalMicroSeconds& aPosition)
-	{
-	// Clip the position if aPosition is greater than the duration
-	// or if aPosition is negative.
-	const TTimeIntervalMicroSeconds maxPosition(Duration());
-	const TTimeIntervalMicroSeconds minPosition(0);
-
-	if (aPosition > maxPosition)
-		iPosition = maxPosition;
-	else if (aPosition < minPosition)
-		iPosition = minPosition;
-	else
-		iPosition = aPosition;
-
-    if (iState==EPlaying || iState==EPaused || iState == EStopped)
-		{
-		iController.SetPosition(iPosition);
-		}
-//	else if (iState == EPaused)
-//		{
-//		Stop();	// We call stop so that DevSound's internal buffers are reset
-//		}
-	}
-
-TInt CAudioPdProperties::SetPriority(TInt aPriority, TMdaPriorityPreference aPref)
-	{
-    iPrioritySettings.iPref = aPref;
-	iPrioritySettings.iPriority = aPriority;
-	iFindAndOpenController->Configure(iMediaIds[0], iPrioritySettings);
-
-	return iController.SetPrioritySettings(iPrioritySettings);
-	}
-TInt CAudioPdProperties::GetVolume(TInt& aVolume)
-	{
-    TInt error = iAudioPlayDeviceCommands.GetVolume(aVolume);
-	return error;
-	}
-TInt CAudioPdProperties::GetNumberOfMetaDataEntries(TInt& aNumEntries)
-	{
-    TInt error = iController.GetNumberOfMetaDataEntries(aNumEntries);
-	return error;
-	}
-
-
-CMMFMetaDataEntry* CAudioPdProperties::GetMetaDataEntryL(TInt aMetaDataIndex)
-	{
-	return iController.GetMetaDataEntryL(aMetaDataIndex);
-	}
-
-TInt CAudioPdProperties::SetPlayWindow(const TTimeIntervalMicroSeconds& aPlayStart,
-								const TTimeIntervalMicroSeconds& aPlayEnd)
-	{
-    TInt error = KErrNone;
-
-	if (aPlayStart >= TTimeIntervalMicroSeconds(0) &&
-		aPlayStart < iDuration &&
-			aPlayStart < aPlayEnd &&
-			aPlayEnd <= iDuration )
-		{
-		iPlayStart = aPlayStart;
-		iPlayEnd = aPlayEnd;
-		iPlayWindowSet = ESet;
-
-		if (iState==EPlaying)
-			error = iAudioPlayControllerCommands.SetPlaybackWindow(aPlayStart, aPlayEnd);
-		}
-	else
-		error = KErrArgument;
-
-	return error;
-	}
-
-TInt CAudioPdProperties::ClearPlayWindow()
-	{
-    	// clear play window start - very important because this is assigned
-	// to iPosition when we stop & is used to set the position on the next Play()
-	iPosition = iPlayStart = iPlayEnd = TTimeIntervalMicroSeconds(0);
-
-	iPlayWindowSet = EClear;
-	TInt err = KErrNone;
-	if (iState==EPlaying)
-		err = iAudioPlayControllerCommands.DeletePlaybackWindow();
-	return err;
-	}
-TInt CAudioPdProperties::SetBalance(TInt aBalance)
-	{
-    TInt err = iAudioPlayDeviceCommands.SetBalance(aBalance);
-	return err;
-	}
-TInt CAudioPdProperties::GetBalance(TInt& aBalance)
-	{
-	TInt err = iAudioPlayDeviceCommands.GetBalance(aBalance);
-	return err;
-	}
-
-TInt CAudioPdProperties::GetBitRate(TUint& aBitRate)
-	{
-	RMMFAudioControllerCustomCommands controller(iController);
-	TInt err = controller.GetSourceBitRate(aBitRate);
-	return err;
-	}
-
-void CAudioPdProperties::RegisterForAudioLoadingNotification(MAudioLoadingObserver& aLoadingObserver)
-	{
-    iLoadingObserver = &aLoadingObserver;
-	}
-
-void CAudioPdProperties::GetAudioLoadingProgressL(TInt& aPercentageProgress)
-	{
-    User::LeaveIfError(iAudioPlayControllerCommands.GetLoadingProgress(aPercentageProgress));
-	}
-
-const CMMFControllerImplementationInformation& CAudioPdProperties::ControllerImplementationInformationL()
-	{
-	if (!iControllerImplementationInformation)
-		{
-		if (iControllerUid==KNullUid)
-			User::Leave(KErrNotReady);
-		iControllerImplementationInformation = CMMFControllerImplementationInformation::NewL(iControllerUid);
-		}
-	return *iControllerImplementationInformation;
-	}
-
-TInt CAudioPdProperties::CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom)
-	{
-    return iController.CustomCommandSync(aDestination, aFunction, aDataTo1, aDataTo2, aDataFrom);
-	}
-TInt CAudioPdProperties::CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2)
-	{
-    return iController.CustomCommandSync(aDestination, aFunction, aDataTo1, aDataTo2);
-	}
-void CAudioPdProperties::CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom, TRequestStatus& aStatus)
-	{
-	iController.CustomCommandAsync(aDestination, aFunction, aDataTo1, aDataTo2, aDataFrom, aStatus);
-	}
-void CAudioPdProperties::CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TRequestStatus& aStatus)
-	{
-    iController.CustomCommandAsync(aDestination, aFunction, aDataTo1, aDataTo2, aStatus);
-	}
-
-TInt CAudioPdProperties::GetFilePosition(TInt& aFilePosition)
-	{
-  	TInt err = KErrNone;
-  	TPckgBuf<TInt> dataFrom;
-
-	if(iSourceHandle != NULL)
-        {
-    	TMMFMessageDestinationPckg destPckg(*iSourceHandle);
-	    err =CustomCommandSync(destPckg, EGETFILEPOSITION, KNullDesC8, KNullDesC8, dataFrom);
-	    }
-	else
-	    {
-	    err = KErrNotFound;
-	    }
-
-    if(err==KErrNone)
-       aFilePosition = dataFrom();
-
-	return err;
-    }
-
-TInt CAudioPdProperties::SetFileSize(TInt aFileSize)
-	{
-  	TInt err = KErrNone;
-	if(iSourceHandle != NULL)
-        {
-        TMMFMessageDestinationPckg destPckg(*iSourceHandle);
-        TPckgBuf<TInt> data1(aFileSize);
-        err = CustomCommandSync(destPckg, ESETFILESIZE, data1, KNullDesC8);
-        }
-	else
-	    {
-        err = KErrNotFound;
-	    }
-	return err;
-	}
-
-TInt CAudioPdProperties::SetBytesDownloaded(TInt aBytesDownloaded, TBool /*aDownloadComplete*/)
-	{
-  	TInt err = KErrNone;
-	if(iSourceHandle != NULL)
-        {
-        TMMFMessageDestinationPckg destPckg(*iSourceHandle);
-    	TPckgBuf<TInt> data1(aBytesDownloaded);
-        err = CustomCommandSync(destPckg, ESETBYTESDOWNLOADED, data1, KNullDesC8);
-        }
-	else
-	    {
-	    err = KErrNotFound;
-	    }
-
-    return err;
-	}
-
-
-MMMFDRMCustomCommand* CAudioPdProperties::GetDRMCustomCommand()
-	{
-	if (iDRMCustomCommands.IsSupported())
-		{
-		return static_cast<MMMFDRMCustomCommand*>(&iDRMCustomCommands);
-		}
-	else
-		{
-		return NULL;
-		}
-	}
-
-
-TInt CAudioPdProperties::CheckAudioPlayerState()
-	{
-	return iState;
-	}
-void CAudioPdProperties::HandleEvent(const TMMFEvent& aEvent)
-	{
-	// handle loading started/complete messages first, as the later code does not explicitly check the event type
-	if (aEvent.iEventType==KMMFEventCategoryAudioLoadingStarted)
-		{
-		if (iLoadingObserver)
-			iLoadingObserver->MaloLoadingStarted();
-		}
-	else if (aEvent.iEventType==KMMFEventCategoryAudioLoadingComplete)
-		{
-		if (iLoadingObserver)
-			iLoadingObserver->MaloLoadingComplete();
-		}
-	else if (aEvent.iEventType==KMMFEventCategoryPlaybackComplete)
-		{
-		TInt oldState = iState;
-		iPosition = iPlayStart;
-		if (aEvent.iErrorCode == KErrNone)
-			{
-			//If we weren't playing, ignore the event.
-			if(oldState == EPlaying)
-				{
-				//we finished playing the clip so repeat if required
-				iNumberOfTimesPlayed++;
-				if ((iNumberOfTimesPlayed>iNumberOfTimesToRepeat) && (iNumberOfTimesToRepeat!=KMdaRepeatForever))
-					{
-					//we've repeated enough times now
-					iNumberOfTimesPlayed = 0;
-					iState = EStopped;
-					iCallback.MapcPlayComplete(KErrNone);
-					}
-				else
-					{
-					// We need to repeat the clip
-					// we're truncating the trailingsilence here so maximum time is ~37mins
-               		TTimeIntervalMicroSeconds32 silence = I64INT(iTrailingSilence.Int64());
-					iRepeatTrailingSilenceTimer->After(silence);
-					}
-				}
-			}
-		else
-			{ //aEvent.iErrorCode != KErrNone
-			//if we weren't playing, don't advise Client.
-			iState = EStopped;
-			if(oldState == EPlaying)
-				iCallback.MapcPlayComplete(aEvent.iErrorCode);
-			}
-		}
-
-	// else we have an unexpected event that cannot be dealt with by the client.
-	// We will simply ignore this.
-	}
-
-
-void CAudioPdProperties::RepeatTrailingSilenceTimerComplete()
-	{
-	// reset the position for subsequent plays
-	iPosition = iPlayStart;
-	DoPlay();
-	}
-
-
-CRepeatTrailingSilenceTimer* CRepeatTrailingSilenceTimer::NewL(MRepeatTrailingSilenceTimerObs& aObs)
-	{
-	CRepeatTrailingSilenceTimer* s = new(ELeave) CRepeatTrailingSilenceTimer(aObs);
-	CleanupStack::PushL(s);
-	s->ConstructL();
-	CleanupStack::Pop();
-	return s;
-	}
-
-void CRepeatTrailingSilenceTimer::RunL()
-	{
-	iObs.RepeatTrailingSilenceTimerComplete();
-	}
-
-CRepeatTrailingSilenceTimer::CRepeatTrailingSilenceTimer(MRepeatTrailingSilenceTimerObs& aObs) :
-	CTimer(EPriorityHigh),
-	iObs(aObs)
-	{
-	CActiveScheduler::Add(this);
-	}
-
-
-CMMFMdaAudioPlayerCallBack* CMMFMdaAudioPlayerCallBack::NewL(MAudioPdPlayUtilityCallback& aCallback)
-	{
-	return new(ELeave) CMMFMdaAudioPlayerCallBack(aCallback);
-	}
-
-CMMFMdaAudioPlayerCallBack::CMMFMdaAudioPlayerCallBack(MAudioPdPlayUtilityCallback& aCallback) :
-	CActive(CActive::EPriorityHigh), iCallback(aCallback)
-	{
-	CActiveScheduler::Add(this);
-	}
-
-CMMFMdaAudioPlayerCallBack::~CMMFMdaAudioPlayerCallBack()
-	{
-	Cancel();
-	}
-
-void CMMFMdaAudioPlayerCallBack::InitComplete(TInt aError, const TTimeIntervalMicroSeconds& aDuration)
-	{
-	iError = aError;
-	iDuration = aDuration;
-	iState = ECallbackInitComplete;
-	if (!IsActive())
-		{
-		TRequestStatus* s = &iStatus;
-		SetActive();
-		User::RequestComplete(s, KErrNone);
-		}
-	}
-
-void CMMFMdaAudioPlayerCallBack::PlayComplete(TInt aError)
-	{
-	iError = aError;
-	iState = ECallbackPlayComplete;
-	if (!IsActive())
-		{
-		TRequestStatus* s = &iStatus;
-		SetActive();
-		User::RequestComplete(s, KErrNone);
-		}
-	}
-
-
-void CMMFMdaAudioPlayerCallBack::PlayingCallback()
-	{
-	iState = ECallbackPlaying;
-	if (!IsActive())
-		{
-		TRequestStatus* s = &iStatus;
-		SetActive();
-		User::RequestComplete(s, KErrNone);
-		}
-	}
-
-void CMMFMdaAudioPlayerCallBack::PausedCallback()
-	{
-	iState = ECallbackPaused;
-	if (!IsActive())
-		{
-		TRequestStatus* s = &iStatus;
-		SetActive();
-		User::RequestComplete(s, KErrNone);
-		}
-	}
-
-
-void CMMFMdaAudioPlayerCallBack::RunL()
-	{
-	switch (iState)
-		{
-		case ECallbackInitComplete:
-			iCallback.MapcInitComplete(iError, iDuration);
-			break;
-		case ECallbackPlayComplete:
-			iCallback.MapcPlayComplete(iError);
-			break;
-		case ECallbackPlaying:
-			iCallback.Playing();
-			break;
-		case ECallbackPaused:
-			iCallback.Paused();
-			break;
-
-		}
-	}
-
-void CMMFMdaAudioPlayerCallBack::DoCancel()
-	{
-	// Nothing to cancel
-	}
-
--- a/mmfenh/progressivedownload/ProgressiveDownloadUtility/src/AudioPdPlayUtility.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,126 +0,0 @@
-/*
-* Copyright (c) 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:  Progressive Download Utility
-*
-*/
-
-
-#ifndef __CAUDIOPDPLAYUTILITY_H__
-#define __CAUDIOPDPLAYUTILITY_H__
-
-#include <e32std.h>
-#include <e32base.h>
-#include <mmfcontrollerimplementationuids.hrh>
-#include "MAudioPdPlayUtility.h"
-
-
-
-class CAudioPdProperties;
-
-/**
-Concrete implementation of the CAudioPdPlayUtility API.
-@see CAudioPdPlayUtility
-*/
-
-class CAudioPdPlayUtility: public CBase,
-                           public MAudioPdPlayUtility
-                           //public MAudioPdPlayUtilityCallback
-	{
-
-public:
-
-
-
-	static CAudioPdPlayUtility* NewL(MAudioPdPlayUtilityCallback& aCallback);
-
-	~CAudioPdPlayUtility();
-
-	//For Download Status
-     void HandleDownloadEventL(TUint aTransactionID,
-                               TBrCtlDownloadEvent aEvent,
-                               TUint aValue);
-
-	 //For Audio control
-	void Play();
-	void Stop();
-	TInt Pause();
-	void SetVolume(TInt aVolume);
-	void SetRepeats(TInt aRepeatNumberOfTimes, const TTimeIntervalMicroSeconds& aTrailingSilence);
-	void SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration);
-	const TTimeIntervalMicroSeconds& Duration();
-	TInt MaxVolume();
-	void Close();
-	TInt GetPosition(TTimeIntervalMicroSeconds& aPosition);
-	void SetPosition(const TTimeIntervalMicroSeconds& aPosition);
-
-	TInt SetPriority(TInt aPriority, TMdaPriorityPreference aPref);
-	TInt GetVolume(TInt& aVolume);
-	TInt GetNumberOfMetaDataEntries(TInt& aNumEntries);
-	CMMFMetaDataEntry* GetMetaDataEntryL(TInt aMetaDataIndex);
-	TInt SetPlayWindow(const TTimeIntervalMicroSeconds& aStart,
-								const TTimeIntervalMicroSeconds& aEnd);
-	TInt ClearPlayWindow();
-	TInt SetBalance(TInt aBalance = KMMFBalanceCenter);
-	TInt GetBalance(TInt& aBalance);
-	TInt GetBitRate(TUint& aBitRate);
-
-	void RegisterForAudioLoadingNotification(MAudioLoadingObserver& aCallback);
-	void GetAudioLoadingProgressL(TInt& aPercentageProgress);
-	const CMMFControllerImplementationInformation& ControllerImplementationInformationL();
-
-	TInt CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom);
-	TInt CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2);
-	void CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom, TRequestStatus& aStatus);
-	void CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TRequestStatus& aStatus);
-
-
-
-	MMMFDRMCustomCommand* GetDRMCustomCommand();
-
-
-	void OpenFileL(const TDesC& aFileName);
-
-
-	void OpenFileL(const RFile& aFile);
-
-	void OpenFileL(const TMMSource& aSource);
-
-
-	void DlCompleteOpenFileL(const TDesC& aFileName);
-
-	//Source CustomCommands
-	TInt GetFilePosition(TInt& aFilePosition);
-	TInt SetFileSize(TInt aFileSize);
-	TInt SetBytesDownloaded(TInt aBytesDownloaded, TBool aDownloadComplete);
-
-	TInt CheckAudioPlayerState();
-
-
-protected:
-
-private:
-
-
-	CAudioPdPlayUtility();
-	void ConstructL();
-
-
-
-
-    CAudioPdProperties* iProperties;
-
-
-	};
-
-#endif
--- a/mmfenh/progressivedownload/ProgressiveDownloadUtility/src/AudioPdProperties.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,262 +0,0 @@
-/*
-* Copyright (c) 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:  Progressive Download Utility
-*
-*/
-
-
-#ifndef __AUDIOPDPLAYPROPERTIES_H__
-#define __AUDIOPDPLAYPROPERTIES_H__
-
-
-
-#include <e32std.h>
-#include <e32base.h>
-#include <f32file.h>
-#include "MAudioPlayUtility.h"
-#include "AudioPdPlayUtility.h"
-
-
-#include "MmfClientUtility.h"
-
-#include <mmf/common/mmcaf.h>
-
-static const TUid KUidMmfAudioController = {KMmfUidControllerAudio};
-
-/**
-Mixin class to allow notification that the timed silence has finished.
-*/
-class MRepeatTrailingSilenceTimerObs
-	{
-public:
-	virtual void RepeatTrailingSilenceTimerComplete() = 0;
-	};
-
-/**
-CTimer-based active object that waits the requested time before notifying its observer.
-*/
-class CRepeatTrailingSilenceTimer : public CTimer
-	{
-public:
-	static CRepeatTrailingSilenceTimer* NewL(MRepeatTrailingSilenceTimerObs& aObs);
-	void RunL();
-private:
-	CRepeatTrailingSilenceTimer(MRepeatTrailingSilenceTimerObs& aObs);
-private:
-	MRepeatTrailingSilenceTimerObs& iObs;
-	};
-
-/**
-Active object utility class to allow the callback to be called asynchronously.
-This should help prevent re-entrant code in clients of the mediaframework.
-*/
-class CMMFMdaAudioPlayerCallBack : public CActive
-	{
-public:
-	enum TCallbackState {
-		ECallbackInitComplete,
-		ECallbackPlayComplete,
-		ECallbackPlaying,
-		ECallbackPaused
-		};
-
-
-public:
-	static CMMFMdaAudioPlayerCallBack* NewL(MAudioPdPlayUtilityCallback& aCallback);
-	~CMMFMdaAudioPlayerCallBack();
-	void InitComplete(TInt aError, const TTimeIntervalMicroSeconds& aDuration);
-	void PlayComplete(TInt aError);
-	void PlayingCallback();
-	void PausedCallback();
-private:
-	CMMFMdaAudioPlayerCallBack(MAudioPdPlayUtilityCallback& aCallback);
-	void RunL();
-	void DoCancel();
-private:
-	MAudioPdPlayUtilityCallback& iCallback;
-	TInt iError;
-	TTimeIntervalMicroSeconds iDuration;
-	TCallbackState iState;
-	};
-
-
-
-/**
-Concrete implementation of the CAudioPdPlayUtility API.
-@see CAudioPdPlayUtility
-*/
-
-class CAudioPdProperties: public CBase,
-                         // public MAudioPdPlayUtility //may not be necessary
-						 public MMMFControllerEventMonitorObserver,
-					     public MRepeatTrailingSilenceTimerObs,
-						 public MMMFFindAndOpenControllerObserver
-	{
-
-public:
-
-	friend class CAudioPdPlayUtility;
-
-
-		enum TMMFAudioPlayerState
-		{
-		EStopped,
-		EOpening,
-		EPaused,
-		EPlaying
-		};
-
-	static CAudioPdProperties* NewL(MAudioPdPlayUtilityCallback& aCallback);
-	static CAudioPdProperties* NewLC(MAudioPdPlayUtilityCallback& aCallback);
-
-	~CAudioPdProperties();
-
-
-   //For Download Status
-    void HandleDownloadEventL(TUint aTransactionID,
-                              TBrCtlDownloadEvent aEvent,
-                              TUint aValue);
-
-
-	 //For Audio control
-	void Play();
-	void Stop();
-	TInt Pause();
-	void SetVolume(TInt aVolume);
-	void SetRepeats(TInt aRepeatNumberOfTimes, const TTimeIntervalMicroSeconds& aTrailingSilence);
-	void SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration);
-	const TTimeIntervalMicroSeconds& Duration();
-	TInt MaxVolume();
-	void Close();
-	TInt GetPosition(TTimeIntervalMicroSeconds& aPosition);
-	void SetPosition(const TTimeIntervalMicroSeconds& aPosition);
-
-	TInt SetPriority(TInt aPriority, TMdaPriorityPreference aPref);
-	TInt GetVolume(TInt& aVolume);
-	TInt GetNumberOfMetaDataEntries(TInt& aNumEntries);
-	CMMFMetaDataEntry* GetMetaDataEntryL(TInt aMetaDataIndex);
-	TInt SetPlayWindow(const TTimeIntervalMicroSeconds& aStart,
-								const TTimeIntervalMicroSeconds& aEnd);
-	TInt ClearPlayWindow();
-	TInt SetBalance(TInt aBalance = KMMFBalanceCenter);
-	TInt GetBalance(TInt& aBalance);
-	TInt GetBitRate(TUint& aBitRate);
-
-	void RegisterForAudioLoadingNotification(MAudioLoadingObserver& aCallback);
-	void GetAudioLoadingProgressL(TInt& aPercentageProgress);
-	const CMMFControllerImplementationInformation& ControllerImplementationInformationL();
-
-	TInt CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom);
-	TInt CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2);
-	void CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom, TRequestStatus& aStatus);
-	void CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TRequestStatus& aStatus);
-
-
-	MMMFDRMCustomCommand* GetDRMCustomCommand();
-
-
-	// from MMMFControllerEventMonitorObserver
-	virtual void HandleEvent(const TMMFEvent& aEvent);
-	// from MRepeatTrailingSilenceTimerObs
-	virtual void RepeatTrailingSilenceTimerComplete();
-
-	// from MMMFFindAndOpenControllerObserver
-	virtual void MfaocComplete(
-		TInt& aError,
-		RMMFController* aController,
-		TUid aControllerUid,
-		TMMFMessageDestination* aSourceHandle,
-		TMMFMessageDestination* aSinkHandle);
-
-
-	void OpenFileL(const TDesC& aFileName);
-
-
-	void OpenFileL(const RFile& aFile);
-
-	void OpenFileL(const TMMSource& aSource);
-
-
-    void DlCompleteOpenFileL(const TDesC& aFileName);
-
-	TInt GetFilePosition(TInt& aFilePosition);
-	TInt SetFileSize(TInt aFileSize);
-	TInt SetBytesDownloaded(TInt aBytesDownloaded, TBool aDownloadComplete);
-
-	TInt CheckAudioPlayerState();
-
-    void DoPlay();
-
-protected:
-
-private:
-	CAudioPdProperties(/*MMdaAudioPlayerCallback*/MAudioPdPlayUtilityCallback& aCallback);
-	void ConstructL(MAudioPdPlayUtilityCallback& aCallback);
-
-
-	MAudioPdPlayUtilityCallback* iAudioPdPlayCallback;
-
-	// last play window command
-	enum TPlayWindowCommand
-		{
-		ENone,
-		ESet,
-		EClear
-		};
-
-	/*MMdaAudioPlayerCallback*/MAudioPdPlayUtilityCallback& iCallback;
-	CMMFMdaAudioPlayerCallBack* iAsyncCallBack;
-	MAudioLoadingObserver* iLoadingObserver;
-	RMMFController iController;
-	CMMFControllerEventMonitor* iControllerEventMonitor;
-	TMMFAudioPlayerState iState;
-	TTimeIntervalMicroSeconds iDuration; // Needed because of api "Duration()" that returns a reference
-	TMMFPrioritySettings iPrioritySettings;
-
-	TInt iNumberOfTimesPlayed;
-	TInt iNumberOfTimesToRepeat;
-	TTimeIntervalMicroSeconds iTrailingSilence;
-	CRepeatTrailingSilenceTimer* iRepeatTrailingSilenceTimer;
-
-	// Source and sink handle info
-	TMMFMessageDestination* iSourceHandle;
-	TMMFMessageDestination iSinkHandle;
-
-	// Custom command handlers
-	RMMFAudioPlayDeviceCustomCommands iAudioPlayDeviceCommands;
-	RMMFAudioPlayControllerCustomCommands iAudioPlayControllerCommands;
-
-
-	RMMFDRMCustomCommands iDRMCustomCommands;
-
-
-	// Current playback time so we can resume from where we were stopped
-	TTimeIntervalMicroSeconds iPosition;
-
-	// Play window start and end times and whether it has been set
-	TTimeIntervalMicroSeconds iPlayStart;
-	TTimeIntervalMicroSeconds iPlayEnd;
-	TPlayWindowCommand iPlayWindowSet;
-	RArray<TUid> iMediaIds;
-
-	CMMFControllerImplementationInformation* iControllerImplementationInformation;
-	TUid iControllerUid;
-
-	// utility class to find and open a suitable controller asynchronously
-	CMMFFindAndOpenController* iFindAndOpenController;
-
-
-	};
-
-#endif
--- a/mmfenh/progressivedownload/ProgressiveDownloadUtility/src/BufferEmptiedEventAO.cpp	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +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:  Progressive Download Utility  Implementation of the BufTypeSupEventAO class.
-*
-*/
-
-
-#include "BufferEmptiedEventAO.h"
-#include <DataBuffer.h>
-
-using namespace multimedia;
-
-CBufferEmptiedEventAO::CBufferEmptiedEventAO(MBufferEmptiedObserver& aObserver )
-: CActive(CActive::EPriorityStandard),
-iObserver(aObserver),
-iError(KErrNone)
-    {
-    CActiveScheduler::Add(this);
-    }
-
-CBufferEmptiedEventAO::~CBufferEmptiedEventAO()
-    {
-    Cancel();
-    }
-
-CBufferEmptiedEventAO* CBufferEmptiedEventAO::NewL( MBufferEmptiedObserver& aObserver )
-    {
-    CBufferEmptiedEventAO* self = new (ELeave)CBufferEmptiedEventAO( aObserver );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-void CBufferEmptiedEventAO::ConstructL()
-    {
-    }
-
-void CBufferEmptiedEventAO::SetActive()
-    {
-    if (!IsActive())
-        {
-        CActive::SetActive();
-        }
-    }
-
-TInt CBufferEmptiedEventAO::Error()
-    {
-    return iError;
-    }
-
-// From CActive
-void CBufferEmptiedEventAO::RunL()
-    {
-    // Save the error code
-    iError = iStatus.Int();
-    // Signal the observer that this request is serviced
-    iObserver.BufferEmptiedBySource();
-    }
-
-void CBufferEmptiedEventAO::DoCancel()
-    {
-    if(iStatus.Int() != 0)
-        {
-        TRequestStatus* status = &iStatus;
-        User::RequestComplete(status,KErrCancel);
-        }
-    }
-
-TInt CBufferEmptiedEventAO::RunError( TInt /*aError*/ )
-    {
-    return KErrNone;
-    }
-
-void CBufferEmptiedEventAO::SetBuffer(MDataBuffer* aBuffer)
-    {
-    iBuffer = aBuffer;
-    }
-
-MDataBuffer* CBufferEmptiedEventAO::GetBuffer()
-    {
-    return iBuffer;
-    }
-
-// End of File
--- a/mmfenh/progressivedownload/ProgressiveDownloadUtility/src/BufferEmptiedEventAO.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +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:  Progressive Download Utility  Definition of the BufTypeSupEventAO class.
-*
-*/
-
-
-#ifndef BUFFEREMPTIEDEVENTAO_H
-#define BUFFEREMPTIEDEVENTAO_H
-
-//  INCLUDES
-#include <e32base.h>
-
-namespace multimedia
-    {
-
-    class MDataBuffer;
-    // Observer
-    class MBufferEmptiedObserver
-        {
-        public:
-            virtual void BufferEmptiedBySource() = 0;
-        };
-
-        /**
-        *  Class to encapsulate a queue item.
-    */
-    class CBufferEmptiedEventAO : public CActive
-        {
-        public:  // Constructors and destructor
-            static CBufferEmptiedEventAO* NewL(MBufferEmptiedObserver&);
-            virtual ~CBufferEmptiedEventAO();
-
-            void SetActive();
-            TInt Error();
-
-            void SetBuffer(MDataBuffer* aBuffer);
-            MDataBuffer* GetBuffer();
-
-        protected:
-            // From CActive
-            void RunL();
-            void DoCancel();
-            TInt RunError( TInt aError );
-
-        private:
-            CBufferEmptiedEventAO( MBufferEmptiedObserver& aObserver );
-            void ConstructL();
-
-        private:
-            MBufferEmptiedObserver& iObserver;
-            MDataBuffer* iBuffer;
-            TInt iError;
-        };
-    }
-#endif // BUFTYPESUPEVENTAO_H
-
-// End of File
--- a/mmfenh/progressivedownload/ProgressiveDownloadUtility/src/ContentFile.cpp	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,178 +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:  Progressive Download Utility  Implementation of ContentFile Classes.
-*
-*/
-
-#include <f32file.h>
-#include <e32std.h>
-#include <caf/attribute.h>
-#include <caf/bitset.h>
-
-using namespace ContentAccess;
-
-#include "ContentFile.h"
-
-
-CContentFile::~CContentFile()
-    {
-    delete iData;
-
-    if (iLegacyFileOpen)
-        iLegacyFile.Close();
-    delete iFilePath;
-    }
-
-
-CContentFile* CContentFile::NewL(RFs& aSession, const TDesC& aFilePath, const TDesC& aUniqueId, TUint aMode, TBool aEnableUI)
-    {
-    CContentFile* self = new (ELeave) CContentFile;
-    CleanupStack::PushL(self);
-    self->ConstructL(aSession, aFilePath, aUniqueId, aMode, aEnableUI);
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-void CContentFile::ConstructL(RFs& aSession, const TDesC& aPath, const TDesC& aUniqueId, TUint /*aMode*/, TBool aEnableUI)
-    {
-    iSession = &aSession;
-    iFilePath = aPath.AllocL();
-
-    // Assume that we want the content to be shared and read-only.
-    if (aUniqueId.Length() > 0)
-        {
-        iData = CData::NewL(TVirtualPathPtr(*iFilePath, aUniqueId), EContentShareReadWrite);
-        }
-    else
-        {
-        iData = CData::NewL(TVirtualPathPtr(*iFilePath), EContentShareReadWrite);
-        }
-
-    TInt err = iData->SetProperty(EAgentPropertyAgentUI, aEnableUI);
-    if (err != KErrNone && err != KErrCANotSupported)
-        {
-        User::Leave(err);
-        }
-    User::LeaveIfError(iData->EvaluateIntent(EPeek));
-    }
-
-
-
-TInt CContentFile::EvaluateIntent(TIntent aIntent) const
-    {
-    ASSERT(iData);
-    return iData->EvaluateIntent(aIntent);
-    }
-
-
-TInt CContentFile::ExecuteIntent(TIntent aIntent)
-    {
-    ASSERT(iData);
-    return iData->ExecuteIntent(aIntent);
-    }
-
-TBool CContentFile::IsProtected() const
-    {
-    ASSERT(iData);
-    TInt value = 0;
-    TInt err =iData->GetAttribute(EIsProtected, value);
-    return (err == KErrNone && value);
-    }
-
-TInt CContentFile::SetAgentProperty(ContentAccess::TAgentProperty aProperty, TInt aValue)
-    {
-    ASSERT(iData);
-    return iData->SetProperty(aProperty, aValue);
-    }
-
-TInt CContentFile::Seek(TSeek aSeekMode, TInt& aPos)
-    {
-    ASSERT(iData);
-    return iData->Seek(aSeekMode, aPos);
-    }
-
-TInt CContentFile::Read(TDes8& aDes,TInt aLength)
-    {
-    ASSERT(iData);
-    return iData->Read(aDes,aLength);
-    }
-
-void CContentFile::Read(TDes8& aDes, TInt aLength, TRequestStatus& aStatus)
-    {
-    ASSERT(iData);
-    iData->Read(aDes, aLength, aStatus);
-    }
-
-TInt CContentFile::Write(const TDesC8& /*aDes*/,TInt /*aLength*/)
-    {
-    return KErrAccessDenied;
-    }
-void CContentFile::Write(const TDesC8& /*aDes*/, TInt /*aLength*/, TRequestStatus& aStatus)
-    {
-    TRequestStatus* status = &aStatus;
-    User::RequestComplete(status, KErrAccessDenied);
-    }
-
-TInt CContentFile::SetSize(TInt /*aSize*/)
-    {
-    // Only a source is implemented, hence this cannot be allowed
-    return KErrAccessDenied;
-    }
-
-
-// Get the size of file
-// this method opens a new, read-only, RFile the first time this method is called
-
-TInt CContentFile::Size(TInt& aSize)
-    {
-    ASSERT(iData);
-    TRAPD(err, iData->DataSizeL(aSize));
-    return err;
-    }
-
-    /**
-    * return a RFile for the legacy RFile method
-    * this method opens a new, read-only, RFile the first time this method is called
-    * @internalTechnology
-    * @return Reference to RFile handle to current file
-*/
-RFile& CContentFile::FileL()
-    {
-    if (!iLegacyFileOpen)
-        {
-        User::LeaveIfError(iLegacyFile.Open(*iSession, *iFilePath, EFileRead | EFileStream | EFileShareReadersOnly));
-        iLegacyFileOpen = ETrue;
-        }
-    return iLegacyFile;
-    }
-
-CContentFile* CContentFile::NewL(RFile& aFile, const TDesC& aUniqueId, TBool aEnableUI)
-    {
-    CContentFile* self = new (ELeave) CContentFile;
-    CleanupStack::PushL(self);
-    self->ConstructL(aFile, aUniqueId, aEnableUI);
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-void CContentFile::ConstructL(RFile& aFile, const TDesC& aUniqueId, TBool aEnableUI)
-    {
-    iData = CData::NewL(aFile, aUniqueId);
-    TInt err = iData->SetProperty(EAgentPropertyAgentUI, aEnableUI);
-    if (err != KErrNone && err != KErrCANotSupported)
-        {
-        User::Leave(err);
-        }
-    User::LeaveIfError(iData->EvaluateIntent(EPeek));
-    }
--- a/mmfenh/progressivedownload/ProgressiveDownloadUtility/src/ContentFile.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +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:  Progressive Download Utility  Header of ContentFile Classes.
-*
-*/
-
-#ifndef __CONTENT_FILE_H__
-#define __CONTENT_FILE_H__
-
-#include <content.h>
-#include <data.h>
-#include <mmf/common/mmcaf.h>
-
-// Provides content access framework based file access
-class CContentFile : public CBase
-    {
-    public:
-        static CContentFile* NewL(RFs& aSession, const TDesC& aPath, const TDesC& aUniqueId, TUint aMode, TBool aEnableUI);
-        void ConstructL(RFs& aSession, const TDesC& aPath, const TDesC& aUniqueId, TUint aMode, TBool aEnableUI);
-
-        static CContentFile* NewL(RFile& aFile, const TDesC& aUniqueId, TBool aEnableUI);
-        void ConstructL(RFile& aFile, const TDesC& aUniqueId, TBool aEnableUI);
-
-        virtual ~CContentFile();
-
-        // from MGenericFile
-        virtual TInt Seek(TSeek aSeekMode, TInt& aPosition);
-        virtual TInt Read(TDes8& aDes,TInt aLength);
-        virtual void Read(TDes8& aDes, TInt aLength, TRequestStatus& aStatus);
-        virtual TInt Write(const TDesC8& aDes,TInt aLength);
-        virtual void Write(const TDesC8& aDes, TInt aLength, TRequestStatus& aStatus);
-        virtual TInt Size(TInt& aSize);
-        virtual TInt SetSize(TInt aSize);
-        virtual TInt EvaluateIntent(const ContentAccess::TIntent aIntent) const;
-        virtual TInt ExecuteIntent(const ContentAccess::TIntent aIntent);
-        virtual TBool IsProtected() const;
-        virtual RFile& FileL();
-
-        virtual TInt SetAgentProperty(ContentAccess::TAgentProperty, TInt aValue);
-
-    private:
-        CContentFile();
-
-
-    private:
-        RFs* iSession; // not owned
-        HBufC* iFilePath;
-        ContentAccess::CData* iData;
-
-        RFile iLegacyFile;
-        TBool iLegacyFileOpen;
-    };
-
-inline CContentFile::CContentFile()
-    {
-    }
-
-#endif //__CONTENT_FILE_H__
--- a/mmfenh/progressivedownload/ProgressiveDownloadUtility/src/EMCPdPlayUtility.cpp	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1573 +0,0 @@
-/*
-* Copyright (c) 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:  Progressive Download Utility
-*
-*/
-
-#include <bautils.h>
-#include <utf.h>
-#include <mmfpaniccodes.h>
-#include "EMCPdPlayUtility.h"
-#include "EMCPdProperties.h"
-#include "MProgressiveDownloadUtility.h"
-#include <apgcli.h>
-#include <AudioPreference.h>
-#include <SCCustomInterfaceUIDs.h>
-#include <drmagents.h>
-#include <DRMConfigIntfc.h>
-#include <content.h>
-#include <data.h>
-#include <MetaDataFieldContainer.h>
-#include <MetaDataUtility.h>
-#include <mmfmeta.h>
-
-_LIT8(KWMAMimeType,"audio/x-ms-wma");
-
-using namespace ContentAccess;
-using namespace DRM;
-
-#ifdef _DEBUG
-#define DEBPRN1(str)        RDebug::Print(str);
-#define DEBPRN2(str, val1)   RDebug::Print(str, val1);
-#define DEBPRN3(str, val1, val2)   RDebug::Print(str, val1, val2);
-#define DEBPRN4(str, val1, val2, val3)   RDebug::Print(str, val1, val2, val3);
-#define DEBPRN5(str, val1, val2, val3, val4)   RDebug::Print(str, val1, val2, val3, val4);
-#else
-#define DEBPRN1(str)
-#define DEBPRN2(str, val1)
-#define DEBPRN3(str, val1, val2)
-#define DEBPRN4(str, val1, val2, val3)
-#define DEBPRN5(str, val1, val2, val3, val4)
-#endif // _DEBUG
-
-const TInt KNumberOfBuffers = 10;
-//const TUid KUidProgressiveDlSource	= {KProgressiveDownloadSourceUid};
-const TInt KBufferingAmount = 40960;
-
-void Panic(TInt aPanicCode)
-	{
-	_LIT(KProgressiveDownloadUtility, "ProgressiveDownloadUtility");
-	User::Panic(KProgressiveDownloadUtility, aPanicCode);
-	}
-
-CAudioPdPlayUtility* CAudioPdPlayUtility::NewL(MAudioPdPlayUtilityCallback& aCallback)
-	{
-    CAudioPdPlayUtility* self = new(ELeave) CAudioPdPlayUtility();
-	CleanupStack::PushL(self);
-
- 	self->iProperties = CAudioPdProperties::NewL(aCallback);
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-CAudioPdPlayUtility::~CAudioPdPlayUtility()
-	{
-	delete iProperties;
-	}
-
-CAudioPdPlayUtility::CAudioPdPlayUtility()
-	{
-
-	}
-
-void CAudioPdPlayUtility::ConstructL()
-	{
-
-	}
-
-//For Download Status
-void CAudioPdPlayUtility::HandleDownloadEventL(TUint aTransactionID,
-                                               TBrCtlDownloadEvent aEvent,
-                                               TUint aValue)
-	{
-    iProperties->HandleDownloadEventL(aTransactionID,aEvent,aValue);
-	}
-
-
-void CAudioPdPlayUtility::Play()
-	{
-    iProperties->Play();
-	}
-void CAudioPdPlayUtility::Stop()
-	{
-    iProperties->Stop();
-	}
-TInt CAudioPdPlayUtility::Pause()
-	{
-    return iProperties->Pause();
-	}
-void CAudioPdPlayUtility::SetVolume(TInt aVolume)
-	{
-    iProperties->SetVolume(aVolume);
-	}
-void CAudioPdPlayUtility::SetRepeats(TInt aRepeatNumberOfTimes, const TTimeIntervalMicroSeconds& aTrailingSilence)
-	{
-    iProperties->SetRepeats(aRepeatNumberOfTimes,aTrailingSilence);
-	}
-void CAudioPdPlayUtility::SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration)
-	{
-    iProperties->SetVolumeRamp(aRampDuration);
-	}
-const TTimeIntervalMicroSeconds& CAudioPdPlayUtility::Duration()
-	{
-	return iProperties->Duration();
-	}
-TInt CAudioPdPlayUtility:: MaxVolume()
-	{
-	return iProperties->MaxVolume();
-	}
-void CAudioPdPlayUtility::Close()
-	{
-    iProperties->Close();
-	}
-TInt CAudioPdPlayUtility::GetPosition(TTimeIntervalMicroSeconds& aPosition)
-	{
-    return iProperties->GetPosition(aPosition);
-	}
-void CAudioPdPlayUtility::SetPosition(const TTimeIntervalMicroSeconds& aPosition)
-	{
-    iProperties->SetPosition(aPosition);
-	}
-
-TInt CAudioPdPlayUtility::SetPriority(TInt aPriority, TMdaPriorityPreference aPref)
-	{
-    return iProperties->SetPriority(aPriority,aPref);
-	}
-TInt CAudioPdPlayUtility::GetVolume(TInt& aVolume)
-	{
-    return iProperties->GetVolume(aVolume);
-	}
-TInt CAudioPdPlayUtility::GetNumberOfMetaDataEntries(TInt& aNumEntries)
-	{
-    return iProperties->GetNumberOfMetaDataEntries(aNumEntries);
-	}
-
-
-CMMFMetaDataEntry* CAudioPdPlayUtility::GetMetaDataEntryL(TInt aMetaDataIndex)
-	{
-	return iProperties->GetMetaDataEntryL(aMetaDataIndex);
-	}
-
-TInt CAudioPdPlayUtility::SetPlayWindow(const TTimeIntervalMicroSeconds& aStart,
-								const TTimeIntervalMicroSeconds& aEnd)
-	{
-    return iProperties->SetPlayWindow(aStart,aEnd);
-	}
-
-TInt CAudioPdPlayUtility::ClearPlayWindow()
-	{
-    return iProperties->ClearPlayWindow();
-	}
-TInt CAudioPdPlayUtility::SetBalance(TInt aBalance)
-	{
-    return iProperties->SetBalance(aBalance);
-	}
-TInt CAudioPdPlayUtility::GetBalance(TInt& aBalance)
-	{
-    return iProperties->GetBalance(aBalance);
-	}
-TInt CAudioPdPlayUtility::GetBitRate(TUint& aBitRate)
-	{
-    return iProperties->GetBitRate(aBitRate);
-	}
-
-
-void CAudioPdPlayUtility::RegisterForAudioLoadingNotification(MAudioLoadingObserver& aCallback)
-	{
-    iProperties->RegisterForAudioLoadingNotification(aCallback);
-	}
-
-void CAudioPdPlayUtility::GetAudioLoadingProgressL(TInt& aPercentageProgress)
-	{
-    iProperties->GetAudioLoadingProgressL(aPercentageProgress);
-	}
-
-const CMMFControllerImplementationInformation& CAudioPdPlayUtility::ControllerImplementationInformationL()
-	{
-	return iProperties->ControllerImplementationInformationL();
-	}
-
-
-TInt CAudioPdPlayUtility::CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom)
-	{
-    return iProperties->CustomCommandSync(aDestination, aFunction, aDataTo1, aDataTo2, aDataFrom);
-	}
-TInt CAudioPdPlayUtility::CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2)
-	{
-    return iProperties->CustomCommandSync(aDestination, aFunction, aDataTo1, aDataTo2);
-	}
-void CAudioPdPlayUtility::CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom, TRequestStatus& aStatus)
-	{
-	iProperties->CustomCommandAsync(aDestination, aFunction, aDataTo1, aDataTo2, aDataFrom, aStatus);
-	}
-void CAudioPdPlayUtility::CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TRequestStatus& aStatus)
-	{
-	iProperties->CustomCommandAsync(aDestination, aFunction, aDataTo1, aDataTo2, aStatus);
-	}
-
-void CAudioPdPlayUtility::OpenFileL(const TDesC& aFileName)
-	{
-	iProperties->OpenFileL(aFileName);
-	}
-
-
-void CAudioPdPlayUtility::OpenFileL(const RFile& aFile)
-	{
-	RFile& file = const_cast<RFile&>(aFile);
-	iProperties->OpenFileL(file);
-	}
-
-void CAudioPdPlayUtility::DlCompleteOpenFileL(const TDesC& aFileName)
-	{
-	iProperties->DlCompleteOpenFileL(aFileName);
-	}
-
-TInt CAudioPdPlayUtility::GetFilePosition(TInt& aFilePosition)
-	{
-	return iProperties->GetFilePosition(aFilePosition);
-	}
-
-TInt CAudioPdPlayUtility::SetFileSize(TInt aFileSize)
-	{
-	return iProperties->SetFileSize(aFileSize);
-	}
-
-TInt CAudioPdPlayUtility::SetBytesDownloaded(TInt aBytesDownloaded, TBool aDownloadComplete)
-	{
-	return iProperties->SetBytesDownloaded(aBytesDownloaded,aDownloadComplete);
-	}
-
-MMMFDRMCustomCommand* CAudioPdPlayUtility::GetDRMCustomCommand()
-	{
-	//ASSERT(iProperties);
-	return iProperties->GetDRMCustomCommand();
-	}
-
-
-TInt CAudioPdPlayUtility::CheckAudioPlayerState()
-	{
-	return iProperties->CheckAudioPlayerState();
-	}
-
-
-//===============================================================
-// CAudioPdProperties implementation begins
-//
-//===============================================================
-CAudioPdProperties* CAudioPdProperties::NewL(MAudioPdPlayUtilityCallback& aCallback)
-	{
-	CAudioPdProperties* self = new(ELeave) CAudioPdProperties(aCallback);
-	CleanupStack::PushL(self);
-	self->ConstructL(aCallback);
-	CleanupStack::Pop(self);
-	return self;
-	}
-CAudioPdProperties* CAudioPdProperties::NewLC(MAudioPdPlayUtilityCallback& /*aCallback*/)
-	{
-	return NULL;
-	}
-
-CAudioPdProperties::~CAudioPdProperties()
-	{
-
-    if(iMimeType)
-        {
-        delete iMimeType;
-        iMimeType = NULL;
-        }
-
-    if(iBufferEmptiedEventAO->IsActive())
-        {
-        iBufferEmptiedEventAO->Cancel();
-        }
-
-    delete iBufferEmptiedEventAO;
-
-    iFactory->DeleteStreamControl(iStreamControl);
-
-    while(iBuffers.Count())
-        {
-        MDataBuffer* temp = iBuffers[0];
-        iBuffers.Remove(0);
-        iFactory->DeleteDataBuffer(temp);
-        }
-
-    if(iMDataBufferSource)
-        {
-        MSourceControl* objPtr = iMDataBufferSource;
-        iFactory->DeleteSourceControl(objPtr);
-        iMDataBufferSource = NULL;
-        }
-
-    MSinkControl* objPtr1 = iMAudioSink;
-    iFactory->DeleteSinkControl(objPtr1);
-
-	if(iMVolumeControl)
-		{
-		MEffectControl* effectObj = iMVolumeControl;
-		iFactory->DeleteEffectControl(effectObj);
-		iMVolumeControl = NULL;
-		}
-
-    if(iFileName)
-        {
-        delete iFileName;
-        iFileName = NULL;
-        }
-
-    if (iMetaDataEntries.Count())
-    	{
-        iMetaDataEntries.ResetAndDestroy();
-		iMetaDataEntries.Close();
-		}
-
-    delete iFile;
-    iFile = NULL;
-    iFs.Close();
-    iBuffers.ResetAndDestroy();
-    iBuffers.Close();
-    iAvailable.Close();
-
- 	delete iFactory;
-
-	delete iControllerImplementationInformation;
-	delete iAsyncCallBack;
-//	iController.Close();
-	}
-
-CAudioPdProperties::CAudioPdProperties(/*MMdaAudioPlayerCallback*/MAudioPdPlayUtilityCallback& aCallback):
-	iCallback(aCallback),
-	iAudioPlayDeviceCommands(iController),
-	iAudioPlayControllerCommands(iController),
-	iDRMCustomCommands(iController)
-	{
-	iState = EStopped;
-	iPrioritySettings.iPriority = KAudioPriorityRealOnePlayer;//80
-	iPrioritySettings.iPref =(TMdaPriorityPreference) KAudioPrefRealOneLocalPlayback;// 0x01420001;
-	iPlayStart = TTimeIntervalMicroSeconds(0);
-	iPlayEnd = TTimeIntervalMicroSeconds(0);
-	iPlayWindowSet = ENone;
-	iBuffering = EFalse;
-	iControllerPtr = NULL;
-	iStopCalled = EFalse;
-	iFileName = NULL;
-	}
-
-void CAudioPdProperties::ConstructL(MAudioPdPlayUtilityCallback& /*aCallback*/)
-	{
-	iAsyncCallBack = CMMFMdaAudioPlayerCallBack::NewL(iCallback);
-    iBufferEmptiedEventAO = CBufferEmptiedEventAO::NewL(*this);
-    iMimeType = HBufC8::NewL(20);
-    TInt status = CMultimediaFactory::CreateFactory( iFactory );
-
-    TInt err = iFactory->CreateStreamControl( KStreamControl, iStreamControl );
-    User::LeaveIfError(err);
-    iStreamControl->AddObserver( *this );
-
-    MSinkControl* tempSinkCtrl(NULL);
-    err = iFactory->CreateSinkControl( KMMFAudioOutputSinkControl, tempSinkCtrl );
-    User::LeaveIfError(err);
-	iMAudioSink = tempSinkCtrl;
-    iStreamControl->AddSink( *iMAudioSink );
-
-    MSourceControl* tempCtrl(NULL);
-    err = iFactory->CreateSourceControl( KDataBufferSourceControl, tempCtrl );
-    User::LeaveIfError(err);
-    CreateAudioBuffersL();
-    iMDataBufferSource = static_cast<MDataBufferSource*>(tempCtrl);
-    iMDataBufferSource->AddObserver( *this );
-
-	//Create Volume Control
-	MEffectControl* effectCtrl(NULL);
-	err = iFactory->CreateEffectControl( KVolumeEffectControl, effectCtrl );
-	User::LeaveIfError(err);
-
-	iMVolumeControl = static_cast<MVolumeControl*>(effectCtrl);
-	err = iStreamControl->AddEffect( *iMVolumeControl );
-	}
-
-void CAudioPdProperties::HandleDownloadEventL(TUint aTransactionID,
-                                              TBrCtlDownloadEvent aEvent,
-                                              TUint aValue)
-	{
-	iCallback.HandleDownloadEventL(aTransactionID,aEvent,aValue);
-	}
-
-
-void CAudioPdProperties::CreateAudioBuffersL()
-    {
-    MDataBuffer* buffer;
-    iBuffers.ResetAndDestroy();
-    iAvailable.Reset();
-    for (int i = 0; i < KNumberOfBuffers; i++ )
-        {
-        iFactory->CreateDataBuffer(KDataBufferSourceControl,4096,buffer);
-        User::LeaveIfError(iBuffers.Append(buffer));
-        buffer = NULL;
-        iAvailable.AppendL(ETrue);
-        }
-    }
-
-void CAudioPdProperties::DetermineFNMimeType(const TDesC& aFileName, TDes8& aMimeType)
-    {
-    RApaLsSession ls;
-    TInt err;
-    err=ls.Connect();
-
-    TDataRecognitionResult result;
-    err = ls.RecognizeData(aFileName,KNullDesC8(),result);
-    if(!err && (result.iConfidence >= CApaDataRecognizerType::EProbable))
-        {
-        aMimeType.Copy(result.iDataType.Des8());
-        }
-    ls.Close();
-    }
-
-void CAudioPdProperties::DetermineFHMimeType(const RFile& aFile, TDes8& aMimeType)
-    {
-    RApaLsSession ls;
-    TInt err;
-    err=ls.Connect();
-
-    TDataRecognitionResult result;
-    err = ls.RecognizeData(aFile,result);
-    if(!err && (result.iConfidence >= CApaDataRecognizerType::EProbable))
-        {
-        aMimeType.Copy(result.iDataType.Des8());
-        }
-    ls.Close();
-    }
-
-
-void CAudioPdProperties::OpenFileL(const TDesC& aFileName)
-	{
-    TBuf8<20> mimeType;
-    User::LeaveIfError(iFs.Connect());
-
-    if(iFileName)
-        {
-        delete iFileName;
-        iFileName = NULL;
-        }
-
-    iFileName = HBufC::NewL(aFileName.Length());
-    TPtr des = iFileName->Des();
-    des.Copy(aFileName);
-
-	TInt err = ExtractDRMRestrictionsL();
-	User::LeaveIfError(err);
-    if(!isProtected)
-        {
-        DetermineFNMimeType(aFileName,mimeType);
-        iMimeType->Des().Copy(mimeType);
-        }
-
-
-    if(iMimeType->Des().Length())
-        {
-        DEBPRN1(_L("CAudioPdProperties::OpenFileL() Before iFile Open "));
-    	iFile =  CContentFile::NewL(iFs,aFileName, KNullDesC, EFileShareAny,EFalse);
-        DEBPRN2(_L("CAudioPdProperties::OpenFileL() After iFile Open Error[%d]"),err);
-        iStreamControl->AddSource(*iMDataBufferSource);
-    	MDataBuffer* dataBuffer = NULL;
-    	err = iMDataBufferSource->Open(*iMimeType,*dataBuffer);
-    	User::LeaveIfError(err);
-        SetPriority(iPrioritySettings.iPriority,(TMdaPriorityPreference)iPrioritySettings.iPref);
-    	iStreamControl->Open();
-        }
-    else
-        {
-        User::Leave(KErrNotSupported);
-        }
-	}
-
-
-void CAudioPdProperties::OpenFileL(const RFile& aFile)
-	{
-    TBuf8<20> mimeType;
-    iFileHandle = aFile;
-	TInt err = ExtractDRMRestrictionsL();
-	User::LeaveIfError(err);
-    if(!isProtected)
-        {
-        DetermineFHMimeType(iFileHandle,mimeType);
-        iMimeType->Des().Copy(mimeType);
-        }
-
-    iFile =  CContentFile::NewL(iFileHandle, KNullDesC ,EFalse);
-
-    if(iMimeType->Des().Length())
-        {
-        MDataBuffer* dataBuffer = NULL;
-    	TInt err = iMDataBufferSource->Open(*iMimeType,*dataBuffer);
-    	User::LeaveIfError(err);
-        SetPriority(iPrioritySettings.iPriority,(TMdaPriorityPreference)iPrioritySettings.iPref);
-    	iStreamControl->Open();
-        }
-    else
-        {
-        User::Leave(KErrNotSupported);
-        }
-	}
-
-void CAudioPdProperties::DlCompleteOpenFileL(const TDesC& aFileName)
-	{
-	OpenFileL(aFileName);
-	}
-
-
-void CAudioPdProperties::Play()
-	{
-    DEBPRN2(_L("CAudioPdProperties::Play() enter iIsEOFReached[%d]"),iIsEOFReached);
-	if (iPlayWindowSet == ESet)
-		{
-        iAudioPlayControllerCommands.SetPlaybackWindow(iPlayStart, iPlayEnd);
-		}
-	else if (iPlayWindowSet == EClear)
-		{
-		iAudioPlayControllerCommands.DeletePlaybackWindow();
-		iPlayWindowSet = ENone;	// assume window will stay cleared
-		}
-
-    if(iIsEOFReached)
-        {
-        delete iFile;
-        iFile = NULL;
-        if(iFileName)
-            {
-            DEBPRN2(_L("CAudioPdProperties::Play() iIsEOFReached[%d] "),iIsEOFReached);
-           	iFile =  CContentFile::NewL(iFs,*iFileName, KNullDesC, EFileShareAny,EFalse);
-            }
-        else
-            {
-            DEBPRN2(_L("CAudioPdProperties::Play() iIsEOFReached[%d] "),iIsEOFReached);
-            iFile =  CContentFile::NewL(iFileHandle, KNullDesC ,EFalse);
-            }
-        iIsEOFReached = EFalse;
-        }
-
-    if(iState != EStopped)
-        {
-        FillSourceBuffers();
-        }
-
-    if(!iDisableAutoIntent && iFile)
-        {
-        iFile->ExecuteIntent((iState == EPaused) ? ContentAccess::EContinue : ContentAccess::EPlay);
-        }
-
-    iStreamControl->Start();
-	}
-
-void CAudioPdProperties::Stop()
-	{
-    DEBPRN1(_L("CAudioPdProperties::Stop() enter"));
-    iStopCalled = ETrue;
-    iStreamControl->Stop();
-	}
-TInt CAudioPdProperties::Pause()
-	{
-    TInt err = KErrNone;
-    DEBPRN1(_L("CAudioPdProperties::Pause() enter"));
-    if(!iDisableAutoIntent && iFile)
-        {
-        iFile->ExecuteIntent(ContentAccess::EPause);
-        }
-
-    err = iStreamControl->Pause();
-	return err;
-	}
-
-void CAudioPdProperties::SetVolume(TInt aVolume)
-	{
-    if(iMVolumeControl)
-	    {
-	    iMVolumeControl->SetVolume(aVolume);
-	    iMVolumeControl->Apply();
-        }
-	}
-
-void CAudioPdProperties::SetRepeats(TInt aRepeatNumberOfTimes, const TTimeIntervalMicroSeconds& aTrailingSilence)
-	{
-	iNumberOfTimesToRepeat = aRepeatNumberOfTimes;
-	iTrailingSilence = aTrailingSilence;
-	}
-
-void CAudioPdProperties::SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration)
-	{
-   	TInt curVol = 0;
-   	MVolumeControl::TVolumeRampMode aMode= MVolumeControl::EIMMEDIATE;
-   	TUint64 duration = aRampDuration.Int64();
-   	TInt err = iMVolumeControl->GetVolume(curVol);
-    if(iMVolumeControl)
-    	{
-     	iMVolumeControl->SetVolumeRamp(0,curVol,duration,
-                                   aMode);
-		iMVolumeControl->Apply();
-    	}
-	}
-const TTimeIntervalMicroSeconds& CAudioPdProperties::Duration()
-	{
-	TInt64 duration = 0;
-	TInt err = iStreamControl->GetDuration(duration);
-	iDuration = duration;
-	return iDuration;
-	}
-
-TInt CAudioPdProperties:: MaxVolume()
-	{
-    TInt volume;
-    if(iMVolumeControl)
-    	iMVolumeControl->GetMaxVolume(volume);
-    return volume;
-	}
-
-void CAudioPdProperties::Close()
-	{
-	// Reset the audio player state.
-    DEBPRN1(_L("CAudioPdProperties::Close() enter"));
-	Stop();
-    DEBPRN1(_L("CAudioPdProperties::Close() Before File Close "));
-	delete iFile;
-	iFile = NULL;
-    DEBPRN1(_L("CAudioPdProperties::Close() After File Close "));
-	}
-
-TInt CAudioPdProperties::GetPosition(TTimeIntervalMicroSeconds& aPosition)
-	{
-    TInt error = KErrNone;
-    TInt64 position = 0;
-	error = iStreamControl->GetPosition(position);
-	aPosition = iPosition = position;
-	return error;
-	}
-
-void CAudioPdProperties::SetPosition(const TTimeIntervalMicroSeconds& aPosition)
-	{
-	TInt64 position = aPosition.Int64();
-	TTimeIntervalMicroSeconds currentPosition(0);
-	GetPosition(currentPosition);
-
-	// We only set the Position if the Current Position is different then the
-    // the new Position
-	if(currentPosition != aPosition)
-	    {
-	    //iStreamControl->SetPosition(position);
-	    }
-	}
-
-TInt CAudioPdProperties::SetPriority(TInt aPriority, TMdaPriorityPreference aPref)
-	{
-	TInt err = iStreamControl->SetPriority(aPriority,aPref);
-	return err;
-	}
-
-TInt CAudioPdProperties::GetVolume(TInt& aVolume)
-	{
-    TInt error = iAudioPlayDeviceCommands.GetVolume(aVolume);
-	return error;
-	}
-
-TInt CAudioPdProperties::GetNumberOfMetaDataEntries(TInt& aNumEntries)
-	{
-    TInt status(KErrNotReady);
-    if(!iMimeType->Des().Compare(KWMAMimeType()))
-        {
-        status = iController.GetNumberOfMetaDataEntries(aNumEntries);
-        }
-    else
-        {
-        if (!iMetaDataRead && iControllerLoaded)
-            {
-            CMetaDataUtility* metaDataUtility = CMetaDataUtility::NewL();
-            CleanupStack::PushL(metaDataUtility);
-
-    		RArray<TMetaDataFieldId> wantedFields;
-    		CleanupClosePushL(wantedFields);
-    		wantedFields.Append(EMetaDataSongTitle);
-    		wantedFields.Append(EMetaDataArtist);
-    		wantedFields.Append(EMetaDataAlbum);
-    		wantedFields.Append(EMetaDataYear);
-    		wantedFields.Append(EMetaDataComment);
-    		wantedFields.Append(EMetaDataAlbumTrack);
-    		wantedFields.Append(EMetaDataGenre);
-    		wantedFields.Append(EMetaDataComposer);
-    		wantedFields.Append(EMetaDataCopyright);
-    		wantedFields.Append(EMetaDataOriginalArtist);
-    		wantedFields.Append(EMetaDataUrl);
-    		wantedFields.Append(EMetaDataJpeg);
-    		wantedFields.Append(EMetaDataUserUrl);
-
-			if(iFileName)
-			    {
-			    TRAP(status,metaDataUtility->OpenFileL(*iFileName, wantedFields));
-			    }
-			else
-			    {
-			    TRAP(status,metaDataUtility->OpenFileL(iFileHandle, wantedFields));
-			    }
-
-            if(status != KErrNone)
-                {
-        		CleanupStack::PopAndDestroy(&wantedFields);	// wantedFields
-        		CleanupStack::PopAndDestroy(metaDataUtility);	//metaDataUtility
-                return status;
-                }
-            TInt count = metaDataUtility->MetaDataCount();
-
-            if (count > 0)
-    			{
-    			const CMetaDataFieldContainer& container = metaDataUtility->MetaDataFieldsL();
-    			TMetaDataFieldId id;
-    			for (TInt i = 0; i < count; i++)
-    				{
-    				TPtrC content = container.At(i, id);
-    				CMMFMetaDataEntry* metaData = NULL;
-    				switch (id)
-    					{
-    					case EMetaDataSongTitle:
-    						metaData = CMMFMetaDataEntry::NewL(KMMFMetaEntrySongTitle, content);
-    						break;
-    					case EMetaDataArtist:
-    						metaData = CMMFMetaDataEntry::NewL(KMMFMetaEntryArtist, content);
-    						break;
-    					case EMetaDataAlbum:
-    						metaData = CMMFMetaDataEntry::NewL(KMMFMetaEntryAlbum, content);
-    						break;
-    					case EMetaDataYear:
-    						metaData = CMMFMetaDataEntry::NewL(KMMFMetaEntryYear, content);
-    						break;
-    					case EMetaDataComment:
-    						metaData = CMMFMetaDataEntry::NewL(KMMFMetaEntryComment, content);
-    						break;
-    					case EMetaDataAlbumTrack:
-    						metaData = CMMFMetaDataEntry::NewL(KMMFMetaEntryAlbumTrack, content);
-    						break;
-    					case EMetaDataGenre:
-    						metaData = CMMFMetaDataEntry::NewL(KMMFMetaEntryGenre, content);
-    						break;
-    					case EMetaDataComposer:
-    						metaData = CMMFMetaDataEntry::NewL(KMMFMetaEntryComposer, content);
-    						break;
-    					case EMetaDataCopyright:
-    						metaData = CMMFMetaDataEntry::NewL(KMMFMetaEntryCopyright, content);
-    						break;
-    					case EMetaDataOriginalArtist:
-    						metaData = CMMFMetaDataEntry::NewL(KMMFMetaEntryOriginalArtist, content);
-    						break;
-    					case EMetaDataUrl:
-    						metaData = CMMFMetaDataEntry::NewL(KMMFMetaEntryWOAF, content);
-    						break;
-    					case EMetaDataJpeg:
-    						metaData = CMMFMetaDataEntry::NewL(KMMFMetaEntryAPIC, content);
-    						break;
-    					case EMetaDataUserUrl:
-    						metaData = CMMFMetaDataEntry::NewL(KMMFMetaEntryWXXX, content);
-    						break;
-    					default:	// Should never get here really...
-    						break;
-    					}
-    				if (metaData)
-    					{
-    					CleanupStack::PushL(metaData);
-    					User::LeaveIfError(iMetaDataEntries.Append(metaData));
-    					CleanupStack::Pop(metaData);	// metaData
-    					}
-    				}
-    			}
-    		iMetaDataRead = ETrue;
-    		CleanupStack::PopAndDestroy(&wantedFields);	// wantedFields
-    		CleanupStack::PopAndDestroy(metaDataUtility);	//metaDataUtility
-    		}
-        aNumEntries = iMetaDataEntries.Count();
-        status = KErrNone;
-        }
-    return status;
-	}
-
-
-CMMFMetaDataEntry* CAudioPdProperties::GetMetaDataEntryL(TInt aMetaDataIndex)
-	{
-    if(!iMimeType->Des().Compare(KWMAMimeType()))
-        {
-        return iController.GetMetaDataEntryL(aMetaDataIndex);
-        }
-	else
-        {
-        if (aMetaDataIndex > iMetaDataEntries.Count() - 1)
-        	{
-            User::Leave(KErrArgument);
-    		}
-
-        return CMMFMetaDataEntry::NewL(*iMetaDataEntries[aMetaDataIndex]);
-        }
-	}
-
-TInt CAudioPdProperties::SetPlayWindow(const TTimeIntervalMicroSeconds& aPlayStart,
-								const TTimeIntervalMicroSeconds& aPlayEnd)
-	{
-    TInt error = KErrNone;
-
-	if (aPlayStart >= TTimeIntervalMicroSeconds(0) &&
-		aPlayStart < iDuration &&
-			aPlayStart < aPlayEnd &&
-			aPlayEnd <= iDuration )
-		{
-		iPlayStart = aPlayStart;
-		iPlayEnd = aPlayEnd;
-		iPlayWindowSet = ESet;
-
-		if (iState==EPlaying)
-			error = iAudioPlayControllerCommands.SetPlaybackWindow(aPlayStart, aPlayEnd);
-		}
-	else
-		error = KErrArgument;
-
-	return error;
-	}
-
-TInt CAudioPdProperties::ClearPlayWindow()
-	{
-    	// clear play window start - very important because this is assigned
-	// to iPosition when we stop & is used to set the position on the next Play()
-	iPosition = iPlayStart = iPlayEnd = TTimeIntervalMicroSeconds(0);
-
-	iPlayWindowSet = EClear;
-	TInt err = KErrNone;
-	if (iState==EPlaying)
-		err = iAudioPlayControllerCommands.DeletePlaybackWindow();
-	return err;
-	}
-
-TInt CAudioPdProperties::SetBalance(TInt aBalance)
-	{
-    TInt err = iAudioPlayDeviceCommands.SetBalance(aBalance);
-	return err;
-	}
-
-TInt CAudioPdProperties::GetBalance(TInt& aBalance)
-	{
-	TInt err = iAudioPlayDeviceCommands.GetBalance(aBalance);
-	return err;
-	}
-
-TInt CAudioPdProperties::GetBitRate(TUint& aBitRate)
-	{
-    TInt status = KErrNone;
-    if(iMDataBufferSource)
-        {
-        status = iMDataBufferSource->GetBitRate(aBitRate);
-        }
-    return status;
-	}
-
-void CAudioPdProperties::RegisterForAudioLoadingNotification(MAudioLoadingObserver& aLoadingObserver)
-	{
-    iLoadingObserver = &aLoadingObserver;
-	}
-
-void CAudioPdProperties::GetAudioLoadingProgressL(TInt& aPercentageProgress)
-	{
-    User::LeaveIfError(iAudioPlayControllerCommands.GetLoadingProgress(aPercentageProgress));
-	}
-
-const CMMFControllerImplementationInformation& CAudioPdProperties::ControllerImplementationInformationL()
-	{
-	if (!iControllerImplementationInformation)
-		{
-		TUid* contUid = static_cast<TUid*>(iStreamControl->CustomInterface(KUidSCControllerUid));
-		iControllerUid = *contUid;
-		if (iControllerUid==KNullUid)
-			User::Leave(KErrNotReady);
-		iControllerImplementationInformation = CMMFControllerImplementationInformation::NewL(iControllerUid);
-		}
-	return *iControllerImplementationInformation;
-	}
-
-TInt CAudioPdProperties::CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom)
-	{
-    return iController.CustomCommandSync(aDestination, aFunction, aDataTo1, aDataTo2, aDataFrom);
-	}
-TInt CAudioPdProperties::CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2)
-	{
-    return iController.CustomCommandSync(aDestination, aFunction, aDataTo1, aDataTo2);
-	}
-void CAudioPdProperties::CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom, TRequestStatus& aStatus)
-	{
-	iController.CustomCommandAsync(aDestination, aFunction, aDataTo1, aDataTo2, aDataFrom, aStatus);
-	}
-void CAudioPdProperties::CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TRequestStatus& aStatus)
-	{
-    iController.CustomCommandAsync(aDestination, aFunction, aDataTo1, aDataTo2, aStatus);
-	}
-
-TInt CAudioPdProperties::GetFilePosition(TInt& /*aFilePosition*/)
-	{
-    return KErrNone;
-	}
-
-TInt CAudioPdProperties::SetFileSize(TInt aFileSize)
-	{
-    TInt status(KErrNone);
-    if(!isProtected)
-        {
-        iFileSize = aFileSize;
-        status = iMDataBufferSource->SetSize(aFileSize);
-        }
-    return status;
-	}
-
-TInt CAudioPdProperties::SetBytesDownloaded(TInt aBytesDownloaded, TBool aDownloadComplete)
-	{
-    TInt status(KErrNone);
-    iBytesDownloaded = aBytesDownloaded;
-    iDownloadComplete = aDownloadComplete;
-
-    if(iDownloadComplete && iFile)
-        {
-        ReOpenCAF();
-        }
-
-    if(iBuffering)
-        {
-        if(((aBytesDownloaded - iBytesReadFromFile) > KBufferingAmount)
-            || ((iFileSize - aBytesDownloaded) < KBufferingAmount))
-            {
-            FillSourceBuffers();
-            }
-        }
-    return status;
-	}
-
-
-MMMFDRMCustomCommand* CAudioPdProperties::GetDRMCustomCommand()
-	{
-    return this;
-	}
-
-
-TInt CAudioPdProperties::DisableAutomaticIntent(TBool aDisableAutoIntent)
-    {
-	if (iDRMCustomCommands.IsSupported())
-		{
-        iDisableAutoIntent = aDisableAutoIntent;
-        return KErrNone;
-		}
-	else
-		{
-		return KErrNotSupported;
-		}
-    }
-
-TInt CAudioPdProperties::ExecuteIntent(ContentAccess::TIntent aIntent)
-    {
-	if (iDRMCustomCommands.IsSupported())
-		{
-	    if(iFile)
-	        {
-	        return iFile->ExecuteIntent(aIntent);
-	        }
-        else
-            {
-            return KErrNotReady;
-            }
-		}
-	else
-		{
-		return KErrNotSupported;
-		}
-    }
-
-TInt CAudioPdProperties::EvaluateIntent(ContentAccess::TIntent aIntent)
-    {
-	if (iDRMCustomCommands.IsSupported())
-		{
-	    if(iFile)
-	        {
-            return iFile->EvaluateIntent(aIntent);
-	        }
-        else
-            {
-            return KErrNotReady;
-            }
-		}
-	else
-		{
-		return KErrNotSupported;
-		}
-    }
-
-TInt CAudioPdProperties::SetAgentProperty(ContentAccess::TAgentProperty aProperty, TInt aValue)
-    {
-	if (iDRMCustomCommands.IsSupported())
-		{
-	    if(iFile)
-	        {
-    		return iFile->SetAgentProperty(aProperty,aValue);
-	        }
-        else
-            {
-            return KErrNotReady;
-            }
-		}
-	else
-		{
-		return KErrNotSupported;
-		}
-    }
-
-TInt CAudioPdProperties::CheckAudioPlayerState()
-	{
-	return iState;
-	}
-
-CRepeatTrailingSilenceTimer* CRepeatTrailingSilenceTimer::NewL(MRepeatTrailingSilenceTimerObs& aObs)
-	{
-	CRepeatTrailingSilenceTimer* s = new(ELeave) CRepeatTrailingSilenceTimer(aObs);
-	CleanupStack::PushL(s);
-	s->ConstructL();
-	CleanupStack::Pop();
-	return s;
-	}
-
-void CRepeatTrailingSilenceTimer::RunL()
-	{
-	iObs.RepeatTrailingSilenceTimerComplete();
-	}
-
-CRepeatTrailingSilenceTimer::CRepeatTrailingSilenceTimer(MRepeatTrailingSilenceTimerObs& aObs) :
-	CTimer(EPriorityHigh),
-	iObs(aObs)
-	{
-	CActiveScheduler::Add(this);
-	}
-
-
-CMMFMdaAudioPlayerCallBack* CMMFMdaAudioPlayerCallBack::NewL(MAudioPdPlayUtilityCallback& aCallback)
-	{
-	return new(ELeave) CMMFMdaAudioPlayerCallBack(aCallback);
-	}
-
-CMMFMdaAudioPlayerCallBack::CMMFMdaAudioPlayerCallBack(MAudioPdPlayUtilityCallback& aCallback) :
-	CActive(CActive::EPriorityHigh), iCallback(aCallback)
-	{
-	CActiveScheduler::Add(this);
-	}
-
-CMMFMdaAudioPlayerCallBack::~CMMFMdaAudioPlayerCallBack()
-	{
-	Cancel();
-	}
-
-void CMMFMdaAudioPlayerCallBack::InitComplete(TInt aError, const TTimeIntervalMicroSeconds& aDuration)
-	{
-	iError = aError;
-	iDuration = aDuration;
-	iState = ECallbackInitComplete;
-	if (!IsActive())
-		{
-		TRequestStatus* s = &iStatus;
-		SetActive();
-		User::RequestComplete(s, KErrNone);
-		}
-	}
-
-void CMMFMdaAudioPlayerCallBack::PlayComplete(TInt aError)
-	{
-	iError = aError;
-	iState = ECallbackPlayComplete;
-	if (!IsActive())
-		{
-		TRequestStatus* s = &iStatus;
-		SetActive();
-		User::RequestComplete(s, KErrNone);
-		}
-	}
-
-void CMMFMdaAudioPlayerCallBack::PlayingCallback()
-	{
-	iState = ECallbackPlaying;
-	if (!IsActive())
-		{
-		TRequestStatus* s = &iStatus;
-		SetActive();
-		User::RequestComplete(s, KErrNone);
-		}
-	}
-
-void CMMFMdaAudioPlayerCallBack::PausedCallback()
-	{
-	iState = ECallbackPaused;
-	if (!IsActive())
-		{
-		TRequestStatus* s = &iStatus;
-		SetActive();
-		User::RequestComplete(s, KErrNone);
-		}
-	}
-
-
-void CMMFMdaAudioPlayerCallBack::RunL()
-	{
-	switch (iState)
-		{
-		case ECallbackInitComplete:
-			iCallback.MapcInitComplete(iError, iDuration);
-			break;
-		case ECallbackPlayComplete:
-			iCallback.MapcPlayComplete(iError);
-			break;
-		case ECallbackPlaying:
-			iCallback.Playing();
-			break;
-		case ECallbackPaused:
-			iCallback.Paused();
-			break;
-
-		}
-	}
-
-void CMMFMdaAudioPlayerCallBack::DoCancel()
-	{
-	// Nothing to cancel
-	}
-
-void CAudioPdProperties::Event( MControl* /*aControl*/, TUint aEventType, TAny* aEventObject )
-    {
-    switch (aEventType)
-        {
-        case MStreamControlObserver::KStateChangedEvent:
-            {
-            //MStreamControl* control1 = (MStreamControl*)(aControl);
-            //MErrorCode* evt = (MErrorCode*)aEventObject;
-            MStateChangedEvent* evt = (MStateChangedEvent*)aEventObject;
-            DEBPRN1(_L("CAudioPdProperties::Event:EStateChanged"));
-            iStreamState = evt->GetState();
-            switch(evt->GetState())
-                {
-                case MStreamControl::CLOSED:
-                    iState = EStopped;
-                    iControllerLoaded = EFalse;
-                    DEBPRN1(_L("CAudioPdProperties::Event:EStateChanged[Closed]"));
-                    break;
-                case MStreamControl::INITIALIZED:
-                    DEBPRN3(_L("CAudioPdProperties::Event:EStateChanged[Opened] [%d]StopCalled[%d]"),evt->GetErrorCode(),iStopCalled);
-                    iState = EOpening;
-                    if( evt->GetErrorCode() == KErrEof || iStopCalled)
-                        {
-                        iIsEOFReached = ETrue;
-                        iBytesReadFromFile = 0;
-                        DEBPRN1(_L("CAudioPdProperties::Event() Before File Close "));
-                        delete iFile;
-                        iFile = NULL;
-                        DEBPRN1(_L("CAudioPdProperties::Event() After File Close "));
-                        if(!iStopCalled)
-                            {
-                            iAsyncCallBack->PlayComplete(KErrNone);
-                            }
-                        iStopCalled = EFalse;
-                        }
-                    else if(evt->GetErrorCode() == KErrNone )
-                        {
-
-                        iControllerPtr = static_cast<RMMFController*> (iStreamControl->CustomInterface(KUidSCControllerRef));
-                        iController = *iControllerPtr;
-                        iControllerLoaded = ETrue;
-                        if(iFileSize == -1 || isProtected)
-                            {
-                            iFile->Size(iFileSize);
-                            iMDataBufferSource->SetSize(iFileSize);
-                            }
-                        else
-                            {
-                            SetFileSize(iFileSize);
-                            }
-                        FillSourceBuffers();
-                        iStreamControl->Prime();
-                        }
-                    else
-                        {
-                        switch(evt->GetErrorCode())
-                            {
-                            case KErrNotSupported:
-                            case KErrPermissionDenied:
-                            case KErrCANoRights:
-                                iAsyncCallBack->PlayComplete(evt->GetErrorCode());
-                                iIsEOFReached = ETrue;
-                                delete iFile;
-                                iFile = NULL;
-                                break;
-
-                            case KErrDied:
-                                Stop();
-                                iAsyncCallBack->PlayComplete(evt->GetErrorCode());
-                                iIsEOFReached = ETrue;
-                                delete iFile;
-                                iFile = NULL;
-                                break;
-                            }
-                        }
-                    break;
-                case MStreamControl::PRIMED:
-                    iState = EPrimed;
-                    DEBPRN1(_L("CAudioPdProperties::Event:EStateChanged[Primed]"));
-                    iAsyncCallBack->InitComplete(evt->GetErrorCode(), Duration());
-                    break;
-                case MStreamControl::EXECUTING:
-                    DEBPRN1(_L("CAudioPdProperties::Event:EStateChanged[Playing]"));
-                    iStopCalled = EFalse;
-                    iState = EPlaying;
-                    iAsyncCallBack->PlayingCallback();
-                    break;
-                case MStreamControl::BUFFERING:
-                    DEBPRN1(_L("CAudioPdProperties::Event:EStateChanged[Buffering]"));
-                    if(iBuffering)
-                        {
-                        iStreamControl->Pause();
-                        //iAsyncCallBack->PlayComplete(KErrDied);
-                        iAsyncCallBack->PlayComplete(KErrUnderflow);
-                        }
-                    iState = EBuffering;
-                    break;
-                case MStreamControl::PAUSED:
-                    iState = EPaused;
-                    iAsyncCallBack->PausedCallback();
-                    DEBPRN2(_L("CAudioPdProperties::Event:EStateChanged[Paused] [%d]"),evt->GetErrorCode());
-                    break;
-                default:
-                    break;
-                };
-            }
-            break;
-
-
-        case MSourceControlObserver::KBufferProcessedEvent:
-            {
-            MBufferProcessedEvent* evt = (MBufferProcessedEvent*)aEventObject;
-            DEBPRN3(_L("CAudioPdProperties::Event:EBufferProcessed[AudioBuffer[0x%x]Reason[%d]]") , evt->GetDataBuffer(), evt->GetErrorCode() );
-            TInt index = iBuffers.Find( evt->GetDataBuffer() );
-            if ( index >= 0 )
-                {
-                iAvailable[index] = ETrue;
-                }
-
-            if(!iBufferEmptiedEventAO->IsActive() && !iIsEOFReached)
-                {
-                iBufferEmptiedEventAO->SetActive();
-                iBufferEmptiedEventAO->SetBuffer(evt->GetDataBuffer());
-                }
-
-            if(iBufferEmptiedEventAO->IsActive())
-                {
-                TRequestStatus* status = &(iBufferEmptiedEventAO->iStatus);
-                User::RequestComplete(status,evt->GetErrorCode());
-                }
-            }
-            break;
-
-        case MSourceControlObserver::KBitRateChangedEvent:
-            {
-            //TUint rate = 0;
-            //DEBPRN2(_L("CAudioPdProperties::Event:BitRateChanged[%d]"),rate);
-            }
-            break;
-
-        case MStreamControlObserver::KDurationChangedEvent:
-            break;
-        default:
-            break;
-        };
-    }
-
-TInt CAudioPdProperties::ReadFromFileAndWriteToStream(TInt aIndex)
-    {
-    MDataBuffer* buffer = iBuffers[aIndex];
-    buffer->GetBufferPtr().FillZ();
-    // Read data into CAudioBuffer
-    TInt filePos = 0;
-    iFile->Seek(ESeekCurrent,filePos);
-
-    DEBPRN4(_L("CAudioPdProperties::ReadFromFileAndWriteToStream \
-    BytesDL[%d] filePos[%d] MaxLength[%d]"),iBytesDownloaded,filePos, buffer->GetBufferPtr().MaxLength());
-    TInt err1(KErrNone);
-    if(iBytesDownloaded - filePos > buffer->GetBufferPtr().MaxLength() || iDownloadComplete)
-        {
-        err1 = iFile->Read( buffer->GetBufferPtr(),  buffer->GetBufferPtr().MaxLength());
-        }
-    else
-        {
-        iBuffering =  ETrue;
-        return KErrUnderflow;
-        }
-    DEBPRN2(_L("CAudioPdProperties::ReadFromFileAndWriteToStream File Read Error [%d]"),err1);
-    User::LeaveIfError(err1);
-    iBytesReadFromFile += buffer->GetBufferPtr().Length();
-
-    DEBPRN3(_L("CAudioPdProperties::ReadFromFileAndWriteToStream\
-    bufferReadLen[%d] Buf Len[%d]"),buffer->GetBufferPtr().Length(),buffer->GetBufferPtr().MaxLength() );
-
-    if (buffer->GetBufferPtr().Length() < buffer->GetBufferPtr().MaxLength() && (iBytesReadFromFile < iFileSize))
-        {
-
-        iBytesReadFromFile = iBytesReadFromFile - buffer->GetBufferPtr().Length();
-        TInt seekOffset = -(buffer->GetBufferPtr().Length());
-        iFile->Seek( ESeekCurrent, seekOffset );
-        iBuffering =  ETrue;
-        DEBPRN3(_L("CAudioPdProperties::ReadFromFileAndWriteToStream\
-        BytesReadFromFile[%d] seekOffset[%d]"),iBytesReadFromFile,seekOffset );
-        return KErrOverflow;
-        }
-    else if(buffer->GetBufferPtr().Length() < buffer->GetBufferPtr().MaxLength())
-        {
-        buffer->SetLastBuffer( ETrue );
-        iIsEOFReached = ETrue;
-        //iFile.Close();
-        }
-    else
-        {
-        buffer->SetLastBuffer( EFalse );
-        }
-
-    // Write data into iMDataBufferSource
-    DEBPRN4(_L("CAudioPdProperties::ReadFromFileAndWriteToStream\
-    [AudioBuffer[0x%x]FileSize[%d]BytesRead[%d]]") , buffer, iFileSize, iBytesReadFromFile );
-
-    TInt err(KErrNone);
-    err = iMDataBufferSource->WriteData( *buffer );
-
-    if (err == KErrNone)
-        {
-        iAvailable[aIndex] = EFalse;
-        }
-    else if ( err == KErrOverflow )
-        {
-        // There isn't enough memory in the player to buffer the data.
-        // reset the file pos
-        TInt size = -(buffer->GetBufferPtr().Length());
-        iFile->Seek( ESeekCurrent, size );
-        iBytesReadFromFile -= size;
-        }
-    return err;
-    }
-
-
-void CAudioPdProperties::BufferEmptiedBySource()
-    {
-    TInt i = 0;
-    if (!iIsEOFReached &&
-        ( iBufferEmptiedEventAO->Error() == KErrNone) )
-        {
-
-        for(i=0; i < iAvailable.Count(); i++)
-            {
-            if(iAvailable[i])
-                break;
-            }
-
-        if(!iBuffering)
-            {
-            TInt err = ReadFromFileAndWriteToStream( i );
-            if ( err != KErrNone)
-                {
-                // Do Something..
-                }
-            }
-        }
-    else if (iBufferEmptiedEventAO->Error() == KErrCancel)
-        {
-
-        /*if(!iStopCalled)
-            {
-            MDataBuffer* buffer = iBufferEmptiedEventAO->GetBuffer();
-            iBytesReadFromFile = iBytesReadFromFile - buffer->GetBufferPtr().Length();
-            TInt seekOffset = -(buffer->GetBufferPtr().Length());
-            iFile.Seek( ESeekCurrent, seekOffset );
-
-            TInt filePos = 0;
-            iFile.Seek(ESeekCurrent,filePos);
-
-            DEBPRN4(_L("CAudioPdProperties::BufferEmptiedBySource() \
-            BytesReadFromFile[%d] filePos[%d] MaxLength[%d]"),iBytesReadFromFile,filePos, buffer->GetBufferPtr().MaxLength());
-            }*/
-        }
-    }
-
-void CAudioPdProperties::FillSourceBuffers()
-    {
-    DEBPRN1(_L("CAudioPdProperties::FillSourceBuffers() enter"));
-    TInt index = iAvailable.Find(ETrue);
-    DEBPRN2(_L("CAudioPdProperties::FillSourceBuffers() index[%d]"),index);
-    while ( (index != KErrNotFound ) && (!iIsEOFReached))
-        {
-        TInt err = ReadFromFileAndWriteToStream( index );
-        if(err)
-            {
-            iBuffering = ETrue;
-            break;
-            }
-        else
-            {
-            iBuffering = EFalse;
-            }
-        // Exit the loop if file EOF.
-        if ( !iIsEOFReached )
-            {
-            // Get the next free buffer
-            index = iAvailable.Find(ETrue);
-            }
-        }
-    DEBPRN2(_L("CAudioPdProperties::FillSourceBuffers() exit Buffering[%d]"), iBuffering);
-    }
-
-TInt CAudioPdProperties::ExtractDRMRestrictionsL()
-    {
-    DEBPRN1(_L("CAudioPdProperties::ExtractDRMRestrictionsL() enter"));
-    TInt status(KErrNone);
-
-    ContentAccess::CContent* content(NULL);
-	ContentAccess::CData* data(NULL);
-	CDRMConfigIntfc* drmConfigIntfc(NULL);
-
-
-    if(iFileName)
-        {
-	    content = CContent::NewL(*iFileName, EContentShareReadWrite) ;
-        }
-    else
-        {
-        content = CContent::NewL(iFileHandle);
-        }
-	data = content->OpenContentL(EPeek,EContentShareReadWrite);
-
-	status = data->GetAttribute(EIsProtected, isProtected);
-
-	if(!isProtected)
-	    {
-        DEBPRN2(_L("CAudioPdProperties::ExtractDRMRestrictionsL() isProtected[%d]"),isProtected);
-        delete data;
-        delete content;
-        return status;
-	    }
-
-    TInt value = 0;
-    content->GetAttribute(EDrmAllowedOutputs,value);
-    TPtr8 des = iMimeType->Des();
-    data->GetMimeTypeL(des);
-
-    TAny* intfc(NULL);
-    TVersion ver(KDRMConfigIntfcMajorVer1, KDRMConfigIntfcMinorVer1, KDRMConfigIntfcBuildVer1);
-    status = iMDataBufferSource->GetInterface(KDRMConfigIntfc,
-                                                  ver,
-                                                  intfc);
-    if (status == KErrNone)
-        {
-        drmConfigIntfc = (CDRMConfigIntfc*)intfc;
-        }
-    else
-        {
-        delete data;
-        delete content;
-        return status;
-        }
-
-    if(value & EDrmAllowAudioAnalog)
-        {
-        drmConfigIntfc->AppendAllowedOutputDevice(EAudioAllowAnalog);
-        }
-    if(value & EDrmAllowAudioFmTransmitter)
-        {
-        drmConfigIntfc->AppendAllowedOutputDevice(EAudioAllowFMTx);
-        }
-    if(value & EDrmAllowAudioBluetooth)
-        {
-        drmConfigIntfc->AppendAllowedOutputDevice(EAudioAllowBTA2DP);
-        drmConfigIntfc->AppendAllowedOutputDevice(EAudioAllowBTHFPHSP);
-        }
-    if(value & EDrmAllowAudioUplink)
-        {
-        drmConfigIntfc->AppendAllowedOutputDevice(EAudioAllowUplink);
-        }
-    if(value & EDrmAllowVideoAnalog)
-        {
-        drmConfigIntfc->AppendAllowedOutputDevice(EVideoAllowAnalog);
-        }
-    if(value & EDrmAllowVideoMacroVision)
-        {
-        drmConfigIntfc->AppendAllowedOutputDevice(EVideoAllowMacroVision);
-        }
-
-    if(value == EDrmAllowAll)
-        {
-        drmConfigIntfc->AppendAllowedOutputDevice(EAudioAllowAll);
-        }
-    /**
-	* RIM CR 417-7642: HDMI with HDCP to Resctricted Audio Output API
-	* Due to addition of new ENUMs to CRestrictedAudioOutput::TAllowedOutputPreference for HDMI and HDCP
-	* EAllowAudioHDMI and EAllowAudioHdmiHdcpRequired,the same is matched by adding
-	* EAudioAllowHDMI and EAudioAllowHdmiHdcpRequired. These ENUM values are matched for the values from drmagents.h
-	*/
-
-    if(value == EDrmAllowAudioHdmi)
-        {
-        drmConfigIntfc->AppendAllowedOutputDevice(EAudioAllowHDMI);
-        }
-    if(value == EDrmAllowAudioHdmiHdcpRequired)
-        {
-        drmConfigIntfc->AppendAllowedOutputDevice(EAudioAllowHdmiHdcpRequired);
-        }
-
-    delete data;
-    delete content;
-    delete drmConfigIntfc;
-
-    return status;
-
-    }
-
-TInt CAudioPdProperties::ReOpenCAF()
-    {
-    TInt status(KErrNone);
-    DEBPRN1(_L("CAudioPdProperties::ReOpenCAF"));
-
-    // Read data into CAudioBuffer
-    TInt filePos = 0;
-    iFile->Seek(ESeekCurrent,filePos);
-
-    delete iFile;
-    iFile = NULL;
-
-    if(iFileName)
-        {
-       	iFile =  CContentFile::NewL(iFs,*iFileName, KNullDesC, EFileShareAny,EFalse);
-        }
-    else
-        {
-        iFile =  CContentFile::NewL(iFileHandle, KNullDesC ,EFalse);
-        }
-
-    if(iFile)
-        {
-        status = iFile->Seek(ESeekStart,filePos);
-        if(isProtected)
-            {
-            iFile->Size(iFileSize);
-            SetFileSize(iFileSize);
-            }
-        }
-
-    DEBPRN3(_L("CAudioPdProperties::ReOpenCAF Exit status[%d] iFileSize[%d]"),status,iFileSize);
-    return status;
-    }
-
-// End of File
--- a/mmfenh/progressivedownload/ProgressiveDownloadUtility/src/EMCPdPlayUtility.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,134 +0,0 @@
-/*
-* Copyright (c) 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:  Progressive Download Utility
-*
-*/
-
-
-#ifndef __CAUDIOPDPLAYUTILITY_H__
-#define __CAUDIOPDPLAYUTILITY_H__
-
-#include <e32std.h>
-#include <e32base.h>
-//#include <mdaaudiosampleplayer.h>
-#include <mmf/common/mmfcontroller.h>
-#include <mmf/server/mmffile.h>
-#include <mmf/server/mmfdes.h>
-#include <mmfcontrollerimplementationuids.hrh>
-#include <mmf/common/mmfstandardcustomcommands.h>
-#include <mmf/common/mmfdrmcustomcommands.h>
-#include "mmfclientutility.h"
-
-#include <mmf/common/mmcaf.h>
-
-#include <downloadmgrclient.h>
-#include "MAudioPdPlayUtility.h"
-#include "MProgressiveDownloadUtility.h"
-
-
-class CAudioPdProperties;
-
-/**
-Concrete implementation of the CAudioPdPlayUtility API.
-@see CAudioPdPlayUtility
-*/
-
-class CAudioPdPlayUtility: public CBase,
-                           public MAudioPdPlayUtility
-                           //public MAudioPdPlayUtilityCallback
-	{
-
-public:
-
-
-
-	static CAudioPdPlayUtility* NewL(MAudioPdPlayUtilityCallback& aCallback);
-
-	~CAudioPdPlayUtility();
-
-	//For Download Status
-     void HandleDownloadEventL(TUint aTransactionID,
-                               TBrCtlDownloadEvent aEvent,
-                               TUint aValue);
-
-	 //For Audio control
-	void Play();
-	void Stop();
-	TInt Pause();
-	void SetVolume(TInt aVolume);
-	void SetRepeats(TInt aRepeatNumberOfTimes, const TTimeIntervalMicroSeconds& aTrailingSilence);
-	void SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration);
-	const TTimeIntervalMicroSeconds& Duration();
-	TInt MaxVolume();
-	void Close();
-	TInt GetPosition(TTimeIntervalMicroSeconds& aPosition);
-	void SetPosition(const TTimeIntervalMicroSeconds& aPosition);
-
-	TInt SetPriority(TInt aPriority, TMdaPriorityPreference aPref);
-	TInt GetVolume(TInt& aVolume);
-	TInt GetNumberOfMetaDataEntries(TInt& aNumEntries);
-	CMMFMetaDataEntry* GetMetaDataEntryL(TInt aMetaDataIndex);
-	TInt SetPlayWindow(const TTimeIntervalMicroSeconds& aStart,
-								const TTimeIntervalMicroSeconds& aEnd);
-	TInt ClearPlayWindow();
-	TInt SetBalance(TInt aBalance = KMMFBalanceCenter);
-	TInt GetBalance(TInt& aBalance);
-	TInt GetBitRate(TUint& aBitRate);
-
-	void RegisterForAudioLoadingNotification(MAudioLoadingObserver& aCallback);
-	void GetAudioLoadingProgressL(TInt& aPercentageProgress);
-	const CMMFControllerImplementationInformation& ControllerImplementationInformationL();
-
-	TInt CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom);
-	TInt CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2);
-	void CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom, TRequestStatus& aStatus);
-	void CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TRequestStatus& aStatus);
-
-
-
-	MMMFDRMCustomCommand* GetDRMCustomCommand();
-
-
-	void OpenFileL(const TDesC& aFileName);
-
-
-	void OpenFileL(const RFile& aFile);
-
-	void DlCompleteOpenFileL(const TDesC& aFileName);
-
-	//Source CustomCommands
-	TInt GetFilePosition(TInt& aFilePosition);
-	TInt SetFileSize(TInt aFileSize);
-	TInt SetBytesDownloaded(TInt aBytesDownloaded, TBool aDownloadComplete);
-
-	TInt CheckAudioPlayerState();
-
-
-protected:
-
-private:
-
-
-	CAudioPdPlayUtility();
-	void ConstructL();
-
-
-
-
-    CAudioPdProperties* iProperties;
-
-
-	};
-
-#endif
--- a/mmfenh/progressivedownload/ProgressiveDownloadUtility/src/EMCPdProperties.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,299 +0,0 @@
-/*
-* Copyright (c) 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:  Progressive Download Utility
-*
-*/
-
-
-#ifndef __EMCPDPROPERTIES_H__
-#define __EMCPDPROPERTIES_H__
-
-#include <e32std.h>
-#include <e32base.h>
-#include <f32file.h>
-#include "MAudioPlayUtility.h"
-#include "EMCPdPlayUtility.h"
-
-#include "mmfclientutility.h"
-
-#include <mmf/common/mmcaf.h>
-
-#include <StreamControl.h>
-#include <ControlObserver.h>
-#include <Events.h>
-#include <DataBufferSource.h>
-#include <DataBuffer.h>
-#include <MMControlFactory.h>
-#include <SinkControl.h>
-#include <MimeTypes.h>
-#include <VolumeControl.h>
-#include <StreamControlObserver.h>
-#include <SourceControlObserver.h>
-
-#include "BufferEmptiedEventAO.h"
-#include "ContentFile.h"
-
-using namespace multimedia;
-
-using multimedia::MStreamControl;
-using multimedia::MControlObserver;
-using multimedia::MDataBufferSource;
-using multimedia::MDataBuffer;
-using multimedia::MControl;
-using multimedia::CMultimediaFactory;
-using multimedia::MSinkControl;
-using multimedia::MVolumeControl;
-using multimedia::MSourceControlObserver;
-using multimedia::MStreamControlObserver;
-
-//static const TUid KUidMmfAudioController = {KMmfUidControllerAudio};
-
-
-/**
-Mixin class to allow notification that the timed silence has finished.
-*/
-class MRepeatTrailingSilenceTimerObs
-	{
-public:
-	virtual void RepeatTrailingSilenceTimerComplete() = 0;
-	};
-
-/**
-CTimer-based active object that waits the requested time before notifying its observer.
-*/
-class CRepeatTrailingSilenceTimer : public CTimer
-	{
-public:
-	static CRepeatTrailingSilenceTimer* NewL(MRepeatTrailingSilenceTimerObs& aObs);
-	void RunL();
-private:
-	CRepeatTrailingSilenceTimer(MRepeatTrailingSilenceTimerObs& aObs);
-private:
-	MRepeatTrailingSilenceTimerObs& iObs;
-	};
-
-/**
-Active object utility class to allow the callback to be called asynchronously.
-This should help prevent re-entrant code in clients of the mediaframework.
-*/
-class CMMFMdaAudioPlayerCallBack : public CActive
-	{
-public:
-	enum TCallbackState {
-		ECallbackInitComplete,
-		ECallbackPlayComplete,
-		ECallbackPlaying,
-		ECallbackPaused
-		};
-
-
-public:
-	static CMMFMdaAudioPlayerCallBack* NewL(MAudioPdPlayUtilityCallback& aCallback);
-	~CMMFMdaAudioPlayerCallBack();
-	void InitComplete(TInt aError, const TTimeIntervalMicroSeconds& aDuration);
-	void PlayComplete(TInt aError);
-	void PlayingCallback();
-	void PausedCallback();
-private:
-	CMMFMdaAudioPlayerCallBack(MAudioPdPlayUtilityCallback& aCallback);
-	void RunL();
-	void DoCancel();
-private:
-	MAudioPdPlayUtilityCallback& iCallback;
-	TInt iError;
-	TTimeIntervalMicroSeconds iDuration;
-	TCallbackState iState;
-	};
-
-
-
-/**
-Concrete implementation of the CAudioPdPlayUtility API.
-@see CAudioPdPlayUtility
-*/
-
-class CAudioPdProperties: public CBase,
-                            public MControlObserver,
-                            public MBufferEmptiedObserver,
-                            public MMMFDRMCustomCommand
-	{
-
-public:
-
-	enum TMMFAudioPlayerState
-		{
-		EStopped,
-		EOpening,
-		EPaused,
-		EPlaying,
-		EBuffering,
-		EPrimed
-		};
-
-	static CAudioPdProperties* NewL(MAudioPdPlayUtilityCallback& aCallback);
-	static CAudioPdProperties* NewLC(MAudioPdPlayUtilityCallback& aCallback);
-
-	~CAudioPdProperties();
-
-
-   //For Download Status
-    void HandleDownloadEventL(TUint aTransactionID,
-                              TBrCtlDownloadEvent aEvent,
-                              TUint aValue);
-
-
-	 //For Audio control
-	void Play();
-	void Stop();
-	TInt Pause();
-	void SetVolume(TInt aVolume);
-	void SetRepeats(TInt aRepeatNumberOfTimes, const TTimeIntervalMicroSeconds& aTrailingSilence);
-	void SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration);
-	const TTimeIntervalMicroSeconds& Duration();
-	TInt MaxVolume();
-	void Close();
-	TInt GetPosition(TTimeIntervalMicroSeconds& aPosition);
-	void SetPosition(const TTimeIntervalMicroSeconds& aPosition);
-
-	TInt SetPriority(TInt aPriority, TMdaPriorityPreference aPref);
-	TInt GetVolume(TInt& aVolume);
-	TInt GetNumberOfMetaDataEntries(TInt& aNumEntries);
-	CMMFMetaDataEntry* GetMetaDataEntryL(TInt aMetaDataIndex);
-	TInt SetPlayWindow(const TTimeIntervalMicroSeconds& aStart,
-								const TTimeIntervalMicroSeconds& aEnd);
-	TInt ClearPlayWindow();
-	TInt SetBalance(TInt aBalance = KMMFBalanceCenter);
-	TInt GetBalance(TInt& aBalance);
-	TInt GetBitRate(TUint& aBitRate);
-
-	void RegisterForAudioLoadingNotification(MAudioLoadingObserver& aCallback);
-	void GetAudioLoadingProgressL(TInt& aPercentageProgress);
-	const CMMFControllerImplementationInformation& ControllerImplementationInformationL();
-
-	TInt CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom);
-	TInt CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2);
-	void CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom, TRequestStatus& aStatus);
-	void CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TRequestStatus& aStatus);
-
-
-	MMMFDRMCustomCommand* GetDRMCustomCommand();
-
-	void OpenFileL(const TDesC& aFileName);
-	void OpenFileL(const RFile& aFile);
-
-    void DlCompleteOpenFileL(const TDesC& aFileName);
-
-	TInt GetFilePosition(TInt& aFilePosition);
-	TInt SetFileSize(TInt aFileSize);
-	TInt SetBytesDownloaded(TInt aBytesDownloaded, TBool isDownloadComplete);
-
-	TInt CheckAudioPlayerState();
-
-    TInt DisableAutomaticIntent(TBool aDisableAutoIntent);
-    TInt ExecuteIntent(ContentAccess::TIntent aIntent);
-    TInt EvaluateIntent(ContentAccess::TIntent aIntent);
-    TInt SetAgentProperty(ContentAccess::TAgentProperty aProperty, TInt aValue);
-
-private:
-
-    void Event( MControl* aControl, TUint aEventType, TAny* aEventObject );
-    void BufferEmptiedBySource();
-    void FillSourceBuffers();
-    void CreateAudioBuffersL();
-    void DetermineFNMimeType(const TDesC& aFileName, TDes8& aMimeType);
-    void DetermineFHMimeType(const RFile& aFile, TDes8& aMimeType);
-    TInt ReadFromFileAndWriteToStream(TInt aIndex)    ;
-    TInt ExtractDRMRestrictionsL();
-    TInt ReOpenCAF();
-
-	CAudioPdProperties(/*MMdaAudioPlayerCallback*/MAudioPdPlayUtilityCallback& aCallback);
-	void ConstructL(MAudioPdPlayUtilityCallback& aCallback);
-
-private:
-
-	//MAudioPdPlayUtilityCallback* iAudioPdPlayCallback;
-
-	// last play window command
-	enum TPlayWindowCommand
-		{
-		ENone,
-		ESet,
-		EClear
-		};
-
-	MAudioPdPlayUtilityCallback& iCallback;
-	CMMFMdaAudioPlayerCallBack* iAsyncCallBack;
-
-	MAudioLoadingObserver* iLoadingObserver;
-	RMMFController iController;
-	RMMFController* iControllerPtr;
-	TMMFAudioPlayerState iState;
-	TTimeIntervalMicroSeconds iDuration; // Needed because of api "Duration()" that returns a reference
-	TMMFPrioritySettings iPrioritySettings;
-
-	TInt iNumberOfTimesPlayed;
-	TInt iNumberOfTimesToRepeat;
-	TTimeIntervalMicroSeconds iTrailingSilence;
-
-	// Custom command handlers
-	RMMFAudioPlayDeviceCustomCommands iAudioPlayDeviceCommands;
-	RMMFAudioPlayControllerCustomCommands iAudioPlayControllerCommands;
-	RMMFDRMCustomCommands iDRMCustomCommands;
-
-	// Current playback time so we can resume from where we were stopped
-	TTimeIntervalMicroSeconds iPosition;
-
-	// Play window start and end times and whether it has been set
-	TTimeIntervalMicroSeconds iPlayStart;
-	TTimeIntervalMicroSeconds iPlayEnd;
-	TPlayWindowCommand iPlayWindowSet;
-	//RArray<TUid> iMediaIds;
-
-	CMMFControllerImplementationInformation* iControllerImplementationInformation;
-	TUid iControllerUid;
-
-
-    MStreamControl* iStreamControl;
-    MDataBufferSource* iMDataBufferSource;
-    MSinkControl* iMAudioSink;
-    MVolumeControl* iMVolumeControl;
-
-    RFs             iFs;
-    CContentFile*    iFile;
-    RFile               iFileHandle;
-
-    RPointerArray<MDataBuffer> iBuffers;
-    RArray<TInt> iAvailable;
-    TBool        iIsEOFReached;
-    TInt         iBytesReadFromFile;
-    TInt         iFileSizeInBytes;
-    CMultimediaFactory* iFactory;
-    HBufC8* iMimeType;
-    MStreamControl::TStreamState iStreamState;
-    CBufferEmptiedEventAO* iBufferEmptiedEventAO;
-    TInt iFileSize;
-    TBool iBuffering;
-    TInt iBytesDownloaded;
-    TBool iStopCalled;
-    HBufC* iFileName;
-    TBool isProtected;
-    TBool iDisableAutoIntent;
-    TBool iMetaDataRead;
-    // Metadata entries, if supported
-    RPointerArray<CMMFMetaDataEntry> iMetaDataEntries;
-    TBool iControllerLoaded;
-    TBool iDownloadComplete;
-	};
-
-#endif
--- a/mmfenh/progressivedownload/ProgressiveDownloadUtility/src/PDProperties.cpp	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,446 +0,0 @@
-/*
-* Copyright (c) 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:  Progressive Download Utility
-*
-*/
-
-
-
-#include "PdProperties.h"
-
-//Percentage (increments) of the file [TBD]
-//that needs to be downloaded/buffered before playing begins
-//Should try at 25%,50%,75%,100%
-const TInt KPercentageToBufferIncrement =25;
-
-
-//Percentage of the file needed for header [TBD]
-//const TInt KPercentageNeededForHeader = 33;
-const TInt KBytesNeededForHeader = 200000;//102400;
-
-//const TInt KMinFileSize = 100000;
-
-//Max attempts to openfile
-const TInt KRetryOpen = 1;
-
-
-//===============================================================
-// CPdProperties implementation begins
-//
-//===============================================================
-EXPORT_C CPdProperties* CPdProperties::NewL()
-    {
-    CPdProperties* self = new(ELeave) CPdProperties();
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-EXPORT_C CPdProperties* CPdProperties::NewLC()
-    {
-    CPdProperties* self = new (ELeave) CPdProperties();
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    return self;
-    }
-
-EXPORT_C CPdProperties::~CPdProperties()
-    {
-    delete iFileName;
-
-    }
-
-void CPdProperties::ConstructL()
-    {
-
-    iFileOpened        = EFalse;
-    iAttemptsToOpen    = 0;
-    iState             = EStopped;
-    iPercentageToBuffer= KPercentageToBufferIncrement;
-    iDownloadCompleted = EFalse;
-    iFileBytePosition  = 0;
-    iTimePosition      = 0;
-    iBytesDownloaded   = 0;
-    iOpenInProgress    = EFalse;
-
-    }
-
-CPdProperties::CPdProperties()
-    {
-
-    }
-
-EXPORT_C CAudioPdPlayUtility* CPdProperties::OpenL(const TDesC& aFileName,
-                                          MAudioPdPlayUtilityCallback& aCallback)
-    {
-    iUseFileHandle = EFalse;
-    iFileName = HBufC::NewL ( aFileName.Length() );
-    iFileName->Des().Copy( aFileName );
-
-    iCallback = &aCallback;
-
-    iAudioPdPlayUtility = CAudioPdPlayUtility::NewL(*this);
-
-    return iAudioPdPlayUtility;
-    }
-
-EXPORT_C CAudioPdPlayUtility* CPdProperties::OpenL(const RFile& aFileHandle,
-                                          MAudioPdPlayUtilityCallback& aCallback)
-    {
-    iUseFileHandle = ETrue;
-    iFileHandle.Duplicate(aFileHandle);
-
-    iCallback = &aCallback;
-
-    iAudioPdPlayUtility = CAudioPdPlayUtility::NewL(*this);
-
-
-    return iAudioPdPlayUtility;
-    }
-
-
-void CPdProperties::HandleDownloadEventL(TUint /*aTransactionID*/,
-                                         TBrCtlDownloadEvent aEvent,
-                                         TUint aValue)
-    {
-/*
-Event                    Value (optional)       Comment
-EDownloadEventStarted     Total Bytes           Size of content as specified in header.
-EDownloadEventCompleted   Total Bytes Received  Total number received should be same as specified at start.
-EDownloadEventProgress    Bytes Received        Number of bytes received so far. May be used to determine % received for progress bar. This will be sent multiple times. Frequency to be determined. Perhaps on every chunk received.
-EDownloadEventCanceled    N/A                   Cancelled by Download Manager
-EDownloadEventError       N/A                   Cancelled by BrowserEngine due to network/http error.
-EDownloadEventPaused,                           aValue is the size downloaded so far
-EDownloadEventResumed,                          aValue is the size downloaded
-EDownloadEventPausable                          aValue = true when it is pausable
-*/
-
-    switch (aEvent)
-        {
-        case EDownloadEventStarted: //Started
-           {
-           if(aValue)
-             iFileSize = aValue;
-           break;
-           }
-
-        case EDownloadEventCompleted: //Completed
-           {
-           iDownloadCompleted = ETrue;
-           iBytesDownloaded = aValue;
-
-           if((!iFileOpened) && (!iOpenInProgress))
-              {
-              //Used for when metadata is at the end of file
-              //or when the file is in cache and already downloaded.
-              iAudioPdPlayUtility->SetFileSize(iFileSize);
-              iAudioPdPlayUtility->SetBytesDownloaded(iBytesDownloaded, iDownloadCompleted);
-              iAudioPdPlayUtility->DlCompleteOpenFileL(iFileName->Des());
-              iOpenInProgress = ETrue;
-              iAttemptsToOpen++;
-              }
-           break;
-           }
-
-        case EDownloadEventProgress: //Progress
-           {
-           if(aValue)
-             iBytesDownloaded = aValue;
-           break;
-           }
-        case EDownloadEventCanceled: //Cancelled
-        case EDownloadEventError: //Error
-            {
-            iBytesDownloaded = 0;
-            iFileSize = 0;
-            break;
-            }
-
-        case EDownloadEventPaused:   //Paused
-        case EDownloadEventResumed:  //Resumed
-        case EDownloadEventPausable: //Pausable
-           //do nothing
-        break;
-
-        default:
-        break;
-
-        } // switch(aEvent)
-
-
-    #if _DEBUG
-       RDebug::Print(_L("CPdProperties::HandleDownloadEventL"));
-       RDebug::Print(_L("file byte position     %d"),iFileBytePosition);
-       RDebug::Print(_L("bytes downloaded       %d"),iBytesDownloaded);
-       RDebug::Print(_L("file size              %d"),iFileSize);
-       RDebug::Print(_L("percentage to buffer   %d"),iPercentageToBuffer);
-       RDebug::Print(_L("download state         %d"),aEvent);
-    #endif
-
-    HandleDownloadUpdateL();
-    }
-
-TInt CPdProperties::CalculatePercentageDownloaded()
-    {
-    TInt percentageDone = 0;
-    if((iFileSize>0) && (iBytesDownloaded>0))
-       percentageDone= ((100*iBytesDownloaded)/iFileSize);
-
-    return percentageDone;
-    }
-
-void CPdProperties::SavePosition()
-    {
-    #if _DEBUG
-      RDebug::Print(_L("CPdProperties::SavePosition"));
-    #endif
-    TTimeIntervalMicroSeconds timeposition;
-    if(iState==EPlaying)
-        {
-        iAudioPdPlayUtility->GetFilePosition(iFileBytePosition);
-
-        iAudioPdPlayUtility->GetPosition(timeposition);
-        if(timeposition >iTimePosition)
-           iTimePosition = timeposition;
-        }
-
-    #if _DEBUG
-      RDebug::Print(_L("CPdProperties::SavePosition iTimePosition %d"),I64INT(iTimePosition.Int64()));
-    #endif
-
-    }
-
-void CPdProperties::HandleDownloadUpdateL()
-    {
-    TInt percentageDone=0;
-
-    percentageDone = CalculatePercentageDownloaded();
-
-    #if _DEBUG
-        RDebug::Print(_L("iFileOpened %d "),iFileOpened);
-        RDebug::Print(_L("iState  %d "),iState);
-        RDebug::Print(_L("percentage downloaded %d "),percentageDone);
-        RDebug::Print(_L("iBytesDownloaded %d "),iBytesDownloaded);
-        RDebug::Print(_L("iAttemptsToOpen  %d "),iAttemptsToOpen);
-        RDebug::Print(_L("iOpenInProgress %d "),iOpenInProgress);
-        RDebug::Print(_L("iFileSize %d "),iFileSize);
-    #endif
-    //if((percentageDone>KPercentageNeededForHeader)&&
-    if((iBytesDownloaded>KBytesNeededForHeader)&&
-      (!iFileOpened) && iAttemptsToOpen<KRetryOpen && (!iOpenInProgress))
-        {
-        TInt err(KErrNone);
-        if(iUseFileHandle)
-            {
-#ifdef RD_PD_FOR_AUDIO_CONTENT_VIA_HELIX_ENGINE
-            iAudioPdPlayUtility->SetFileSize(iFileSize);
-#endif
-            iAudioPdPlayUtility->OpenFileL(iFileHandle);
-            }
-        else
-            {
-#ifdef RD_PD_FOR_AUDIO_CONTENT_VIA_HELIX_ENGINE
-            iAudioPdPlayUtility->SetFileSize(iFileSize);
-#endif
-            TRAP(err,iAudioPdPlayUtility->OpenFileL(iFileName->Des()));
-            }
-
-        if(err != KErrNone)
-            {
-            MapcInitComplete(err,0);
-            return;
-            }
-        iOpenInProgress = ETrue;
-        iAttemptsToOpen++;
-
-        }
-
-    //Pass bytes downloaded to ProgressiveDownload DataSource
-    iAudioPdPlayUtility->SetBytesDownloaded(iBytesDownloaded, iDownloadCompleted);
-
-    if(iFileOpened)
-        {//if the file is opened/playing save the
-        //file byte position and the time position
-        SavePosition();
-        switch (iState)
-            {
-            case EPlaying:
-                {
-                if((iFileBytePosition >=iBytesDownloaded) &&
-                   (percentageDone<=100))
-                    {
-                    //Should have paused, but is causing problems
-                    //with DRM1 FL
-                    #if _DEBUG
-                      RDebug::Print(_L("Should have paused"));
-                    #endif
-                    //StartPaused();
-                    }
-                break;
-                }
-            // Try to automatically resume only if we are stopped due to lac
-            // of data (KErrUnderflow)
-            //case EPaused:
-            //case EStopped:
-            case EStoppedAutoResume:
-                {
-                //if stopped attempt to play at 25%,50%,75%,100%
-                if( percentageDone >= iPercentageToBuffer )
-                    {
-                    StartPlaying();
-                    }
-                break;
-                }
-            default:
-                break;
-            }//switch iState
-
-        if( percentageDone > iPercentageToBuffer )
-            {
-            iPercentageToBuffer += KPercentageToBufferIncrement;
-            }
-        }//iFileOpened
-
-    }
-
-/*
-void CPdProperties::StartPaused()
-    {
-    #if _DEBUG
-       RDebug::Print(_L("ProgressiveDownload audio paused"));
-    #endif
-    iState = EPaused;
-    iAudioPdPlayUtility->Pause(); //Audio Pause
-    //iCallback->Paused();
-    }
-*/
-
-void CPdProperties::StartPlaying()
-    {
-    #if _DEBUG
-       RDebug::Print(_L("ProgressiveDownload audio play"));
-    #endif
-
-    //Will disable automatic play if manual play was started.
-    TInt state = iAudioPdPlayUtility->CheckAudioPlayerState();
-
-    if(iState!=EPlaying)
-        {
-        iState = EPlaying;
-
-        TTimeIntervalMicroSeconds timeposition(0);
-        TInt error = iAudioPdPlayUtility->GetPosition(timeposition);
-
-    #if _DEBUG
-       RDebug::Print(_L("ProgressiveDownload SetPosition SavePos[%d] CurPos[%d]"), I64INT(iTimePosition.Int64()),I64INT(timeposition.Int64()));
-    #endif
-
-        if(timeposition != iTimePosition)
-        {
-        iAudioPdPlayUtility->SetPosition(iTimePosition);
-        }
-
-        iAudioPdPlayUtility->Play();
-        //iCallback->Playing();
-        }
-    }
-
-//From MMdaAudioPlayerCallback
-void CPdProperties::MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& aDuration)
-    {
-
-#if _DEBUG
-   RDebug::Print(_L("ProgressiveDownload file opened err =%d"),aError);
-#endif
-    //iError = aError;
-    iOpenInProgress = EFalse;
-
-    iState = EStopped;
-
-    if( aError == KErrNone )
-        {
-        if( aDuration > 0 )
-            {
-            iFileOpened = ETrue;
-            }
-        else
-            {
-#if _DEBUG
-            RDebug::Print(_L("ProgressiveDownload - Open failed - could not calculate duration"));
-            RDebug::Print(_L("metadata is at the end of file PD not supported"));
-#endif
-            iFileOpened = EFalse;
-            return;
-            }
-
-        if( iFileSize > 0 )
-            {
-            TInt err = iAudioPdPlayUtility->SetFileSize(iFileSize);
-#if _DEBUG
-            RDebug::Print(_L("CPdProperties::SetFileSize=%d err %d"),iFileSize,err);
-#endif
-            }
-        // After init is complete successfully, playback is to be started
-        // automatically.
-        iState = EStoppedAutoResume;
-        }
-    iCallback->MapcInitComplete(aError,aDuration);
-
-    //Last chance to automatically play a file with very fast download
-    //or when the file is in cache and there are only a couple of download events.
-    if ( (iDownloadCompleted) && (aError == KErrNone ) )
-        {
-        StartPlaying();
-        }
-    }
-
-void CPdProperties::MapcPlayComplete(TInt aError)
-    {
-#if _DEBUG
-    RDebug::Print(_L("ProgressiveDownload play complete err=%d"),aError);
-#endif
-    //iError = aError;
-    // Playback stopped due to lac of data (KErrUnderflow)
-    if( aError == KErrUnderflow )
-        {// By now, Controller would've gone to STOPPED state and would've reset
-        // play position to zero. There is no point in querying position here.
-        TTimeIntervalMicroSeconds timeposition;
-        TInt error = iAudioPdPlayUtility->GetPosition(timeposition);
-        if(timeposition > iTimePosition)
-            {
-            iTimePosition = timeposition;
-            }
-#if _DEBUG
-        RDebug::Print(_L("ProgressiveDownload GetPosition return [%d] error[%d]"), I64INT(iTimePosition.Int64()), error);
-#endif
-        iState = EStoppedAutoResume;
-        iCallback->Paused();
-        }
-    else
-        {
-        iState = EStopped;
-        iCallback->MapcPlayComplete(aError);
-        }
-    }
-
-void CPdProperties::Playing()
-    {
-    iCallback->Playing();
-    }
-
-void CPdProperties::Paused()
-    {
-    iCallback->Paused();
-    }
--- a/mmfenh/progressivedownload/ProgressiveDownloadUtility/src/PdProperties.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-/*
-* Copyright (c) 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:  Progressive Download Utility
-*
-*/
-
-
-
-#ifndef __PDPROPERTIES_H__
-#define __PDPROPERTIES_H__
-
-#include <e32std.h>
-#include <e32base.h>
-#include <f32file.h>
-#include "AudioPdPlayUtility.h"
-
-//Forward Declaration
-
-
-class CPdProperties :public CBase,
-                     public MAudioPdPlayUtilityCallback
-    {
-    public:
-
-        IMPORT_C static CPdProperties* NewL();
-        IMPORT_C static CPdProperties* NewLC();
-
-        IMPORT_C ~CPdProperties();
-
-        IMPORT_C CAudioPdPlayUtility* OpenL(const TDesC& aFileName,MAudioPdPlayUtilityCallback& aCallback);
-        IMPORT_C CAudioPdPlayUtility* OpenL(const RFile& aFileHandle,MAudioPdPlayUtilityCallback& aCallback);
-
-    private:
-        CPdProperties();
-        void ConstructL();
-        void HandleDownloadEventL(TUint aTransactionID,
-                              TBrCtlDownloadEvent aEvent,
-                              TUint aValue);
-
-        TInt CalculatePercentageDownloaded();
-        void SavePosition();
-        void HandleDownloadUpdateL();
-
-        // This function is no where used. Remove it.
-        //void StartPaused();
-        void StartPlaying();
-
-        void Playing();
-        void Paused();
-
-        //From MMdaAudioPlayerCallback
-        void MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& aDuration);
-        void MapcPlayComplete(TInt aError);
-
-        enum TState
-            {
-            EStopped,
-            /*EOpening,*/
-            /*EPaused,*/
-            EStoppedAutoResume, /* State which will automatically re-start playback*/
-            EPlaying
-            };
-
-        TTimeIntervalMicroSeconds iTimePosition;
-        MAudioPdPlayUtilityCallback* iCallback;
-        CAudioPdPlayUtility* iAudioPdPlayUtility;
-        HBufC* iFileName;
-        RFile iFileHandle;
-        TBool iFileOpened;
-        TInt  iAttemptsToOpen;
-        TBool iUseFileHandle;
-        //TInt  iError; /* Not used */
-        TInt  iFileSize;
-        TInt  iBytesDownloaded;
-        TInt  iFileBytePosition;
-        TBool iDownloadCompleted;
-        enum  TState iState;
-        TInt  iPercentageToBuffer;
-        TBool iOpenInProgress;
-    };
-
-#endif
-
-// End of file
--- a/mmfenh/progressivedownload/ProgressiveDownloadUtility/src/ProgressiveDownloadUtility.cpp	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-/*
-* Copyright (c) 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:  Progressive Download Utility  Progressive Download Utility
-*
-*/
-
-
-
-#include <ProgressiveDownloadUtility.h>
-#include "PdProperties.h"
-/**
-Concrete implementation of the CProgressDownloadUtility API.
-@see CProgressDownloadUtility
-*/
-
-EXPORT_C CProgressiveDownloadUtility* CProgressiveDownloadUtility::NewL()
-	{
-    CProgressiveDownloadUtility* self = new(ELeave) CProgressiveDownloadUtility();
-	CleanupStack::PushL(self);
-
-	self->iProperties = CPdProperties::NewL();
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-EXPORT_C CProgressiveDownloadUtility::~CProgressiveDownloadUtility()
-	{
-	#if _DEBUG
-	  RDebug::Print(_L("CProgressiveDownloadUtility::~CProgressiveDownloadUtility"));
-    #endif
-    delete iProperties;
-	}
-
-void CProgressiveDownloadUtility::ConstructL()
-	{
-
-	}
-
-CProgressiveDownloadUtility::CProgressiveDownloadUtility()
-	{
-
-	}
-
-EXPORT_C MAudioPdPlayUtility* CProgressiveDownloadUtility::OpenL(const TDesC& aFileName,MAudioPdPlayUtilityCallback& aCallback)
-	{
-	#if _DEBUG
-	  RDebug::Print(_L("CProgressiveDownloadUtility::OpenL by filename"));
-    #endif
-	return STATIC_CAST(MAudioPdPlayUtility*,iProperties->OpenL(aFileName,aCallback));
-
-	}
-
-EXPORT_C MAudioPdPlayUtility* CProgressiveDownloadUtility::OpenL(const RFile& aFileHandle,MAudioPdPlayUtilityCallback& aCallback)
-	{
-	#if _DEBUG
-	  RDebug::Print(_L("CProgressiveDownloadUtility::OpenL by filehandle"));
-    #endif
-	return STATIC_CAST(MAudioPdPlayUtility*,iProperties->OpenL(aFileHandle,aCallback));
-	}
-
-// ENd of File
--- a/mmfenh/progressivedownload/ProgressiveDownloadUtility/src/mmfclientutility.cpp	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2308 +0,0 @@
-/*
-* Copyright (c) 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:  Progressive Download Utility  Audio, MIDI and Video client utility functions.
-*
-*/
-
-
-#include <e32std.h>
-#include <f32file.h>
-#include <bautils.h>
-#include <caf/content.h>
-#include <caf/data.h>
-using namespace ContentAccess;
-
-#include "mmfclientutility.h"
-#include <mmf/common/mmfpaniccodes.h>
-
-const TInt KMaxMimeLength = 256;
-const TInt KMaxHeaderSize = 256;
-#ifdef __WINDOWS_MEDIA
-_LIT8(KWMAMimeType,"audio/x-ms-wma");
-#endif
-
-void CUPanic(TInt aCUPanicCode)
-	{
-	_LIT(KMMFMediaClientUtilityPaanicCategory, "MMFClientUtility");
-	User::Panic(KMMFMediaClientUtilityPaanicCategory, aCUPanicCode);
-	}
-
-/**
- * @internalComponent
- */
- TUid CMMFClientUtility::ConvertMdaFormatUidToECOMWrite(TUid aMdaFormatUid)
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFClientUtility::ConvertMdaFormatUidToECOMWrite\n"));
-    #endif
-	TUid ECOMUid = KNullUid;
-	if (aMdaFormatUid == KUidMdaClipFormatWav)
-		ECOMUid = TUid::Uid(KMmfUidFormatWAVWrite);
-	else if (aMdaFormatUid == KUidMdaClipFormatAu)
-		ECOMUid = TUid::Uid(KMmfUidFormatAUWrite);
-	else if (aMdaFormatUid == KUidMdaClipFormatRawAudio)
-		ECOMUid = TUid::Uid(KMmfUidFormatRAWWrite);
-	else if (aMdaFormatUid == KUidMdaClipFormatRawAmr)
-		ECOMUid = TUid::Uid(KAdvancedUidFormatAMRWrite);
-
-	return ECOMUid;
-	}
-
-/**
- * @internalComponent
- */
- TUid CMMFClientUtility::ConvertMdaFormatUidToECOMRead(TUid aMdaFormatUid)
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFClientUtility::ConvertMdaFormatUidToECOMRead\n"));
-    #endif
-	TUid ECOMUid = KNullUid;
-	if (aMdaFormatUid == KUidMdaClipFormatWav)
-		ECOMUid = TUid::Uid(KMmfUidFormatWAVRead);
-	else if (aMdaFormatUid == KUidMdaClipFormatAu)
-		ECOMUid = TUid::Uid(KMmfUidFormatAURead);
-	else if (aMdaFormatUid == KUidMdaClipFormatRawAudio)
-		ECOMUid = TUid::Uid(KMmfUidFormatRAWRead);
-	else if (aMdaFormatUid == KUidMdaClipFormatRawAmr)
-		ECOMUid = TUid::Uid(KAdvancedUidFormatAMRRead);
-
-	return ECOMUid;
-	}
-
-/**
- * @internalComponent
- */
- TInt CMMFClientUtility::GetFileHeaderData(const TDesC& aFileName, TDes8& aHeaderData, TInt aMaxLength)
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFClientUtility::GetFileHeaderData***\n"));
-    #endif
-	RFs fsSession;
-	RFile file;
-	TInt error = KErrNone;
-	TInt size = 0;
-	if ((error = fsSession.Connect()) == KErrNone)
-		{
-		//rj  if ((error = file.Open(fsSession, aFileName, EFileShareReadersOnly)) == KErrNone)
-        if ((error = file.Open(fsSession, aFileName, EFileShareAny)) == KErrNone)
-			{
-
-
-			if ((error = file.Size(size)) == KErrNone)
-				{
-				if (size > 0)
-					{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFClientUtility::GetFileHeaderData actual size= %d  \n"),size);
-    #endif
-					if (size > aMaxLength)
-						size = aMaxLength;
-
-					error = file.Read(aHeaderData, size);
-					}
-				}
-			file.Close();
-			}
-		fsSession.Close();
-
-
-		}
-
-	#if _DEBUG
-      RDebug::Print(_L("CMMFClientUtility::GetFileHeaderData err %d  header %d\n"),error,size);
-    #endif
-
-	return error;
-	}
-
-/**
- * @internalComponent
- */
- TFourCC CMMFClientUtility::ConvertMdaCodecToFourCC(TMdaPackage& aCodec)
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFClientUtility::ConvertMdaCodecToFourCC\n"));
-    #endif
-	TFourCC dataType = KMMFFourCCCodeNULL;
-	switch (aCodec.Uid().iUid)
-		{
-		case KUidMdaWavPcmCodecDefine:
-			{
-			TMdaPcmWavCodec* pcmWavCodec = (TMdaPcmWavCodec*)&aCodec;
-			if (pcmWavCodec->iBits == TMdaPcmWavCodec::E8BitPcm)
-				dataType = KMMFFourCCCodePCMU8; //8 bit PCM
-			else
-				dataType = KMMFFourCCCodePCM16; //16 bit PCM
-			break;
-			}
-		case KUidMdaAu8PcmCodecDefine:
-			dataType = KMMFFourCCCodePCM8;
-			break;
-		case KUidMdaAuCodecDefine:
-		case KUidMdaAu16PcmCodecDefine:
-			dataType = KMMFFourCCCodePCM16B;
-			break;
-
-		case KUidMdaAuMulawCodecDefine:
-		case KUidMdaWavMulawCodecDefine:
-		case KUidMdaRawAudioMulawCodecDefine:  //uLAW
-			dataType = KMMFFourCCCodeMuLAW;
-			break;
-		case KUidMdaAuAlawCodecDefine:
-		case KUidMdaWavAlawCodecDefine:
-		case KUidMdaRawAudioAlawCodecDefine:	 //ALAW
-			dataType = KMMFFourCCCodeALAW;
-			break;
-		case KUidMdaRawAudioS8PcmCodecDefine:	 //  P8
-			dataType = KMMFFourCCCodePCM8;
-			break;
-		case KUidMdaRawAudioU8PcmCodecDefine:	  // PU8
-			dataType = KMMFFourCCCodePCMU8;
-			break;
-		case KUidMdaRawAudioSL16PcmCodecDefine: // P16
-			dataType = KMMFFourCCCodePCM16;
-			break;
-		case KUidMdaRawAudioSB16PcmCodecDefine: //P16B
-			dataType = KMMFFourCCCodePCM16B;
-			break;
-		case KUidMdaRawAudioUL16PcmCodecDefine: //PU16
-			dataType = KMMFFourCCCodePCMU16;
-			break;
-		case KUidMdaRawAudioUB16PcmCodecDefine: //PU6B
-			dataType = KMMFFourCCCodePCMU16B;
-			break;
-		case KUidMdaGsmWavCodecDefine: //GSM6
-			dataType = KMMFFourCCCodeGSM610;
-			break;
-		case KUidMdaWavImaAdpcmCodecDefine:
-			dataType = KMMFFourCCCodeIMAD;
-			break;
-		case KUidMdaRawAmrCodecDefine:
-			dataType = KMMFFourCCCodeAMR;
-			break;
-		default:	// Not a Uid we recognise
-			dataType = KMMFFourCCCodeNULL;
-			break;
-		}
-	return dataType;
-	}
-
-
-CMMFUtilityFileInfo* CMMFUtilityFileInfo::NewL(TMMSource& aSource)
-	{
-	CMMFUtilityFileInfo* self = CMMFUtilityFileInfo::NewLC(aSource);
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-
-CMMFUtilityFileInfo* CMMFUtilityFileInfo::NewLC(TMMSource& aSource)
-	{
-	CMMFUtilityFileInfo* self = new (ELeave) CMMFUtilityFileInfo;
-	CleanupStack::PushL(self);
-	self->ConstructL(aSource);
-	return self;
-	}
-
-
-void CMMFUtilityFileInfo::ConstructL(const TMMSource& aSource)
-	{
-	if (aSource.SourceType()==KUidMMFileSource)
-		{
-		const TMMFileSource& fileSource = static_cast<const TMMFileSource&>(aSource);
-		iData = CData::NewL(TVirtualPathPtr(fileSource.Name(), fileSource.UniqueId()),
-							EContentShareReadWrite/*EContentShareReadOnly*/);
-		}
-
-	if (aSource.SourceType()==KUidMMFileHandleSource)
-		{
-		const TMMFileHandleSource& fileHandleSource = static_cast<const TMMFileHandleSource&>(aSource);
-		iData = CData::NewL(fileHandleSource.Handle(), fileHandleSource.UniqueId());
-		}
-
-	TInt err = iData->SetProperty(EAgentPropertyAgentUI, aSource.IsUIEnabled());
-
-	if (err != KErrNone && err != KErrCANotSupported)
-		{
-		// KErrCANotSupported isn't a problem for us so eat the error code.
-		User::Leave(err);
-		}
-
-	err = iData->EvaluateIntent(aSource.Intent());
-	User::LeaveIfError(err);
-	}
-
-TInt CMMFUtilityFileInfo::EvaluateIntent(TIntent aIntent)
-	{
-	return iData->EvaluateIntent(aIntent);
-	}
-/**
- * @internalComponent
- */
-TBool CMMFUtilityFileInfo::GetFileMimeTypeL(TDes8& aMimeType)
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFUtilityFileInfo::GetFileMimeTypeL\n"));
-    #endif
-	return iData->GetMimeTypeL(aMimeType);
-	}
-
-/**
- * @internalComponent
- */
-void CMMFUtilityFileInfo::GetFileHeaderDataL(TDes8& aHeaderData, TInt aMaxLength)
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFUtilityFileInfo::GetFileHeaderDataL\n"));
-    #endif
-	TInt size = 0;
-	iData->DataSizeL(size);
-	if (size > 0)
-		{
-		if (size > aMaxLength)
-			size = aMaxLength;
-		TInt pos = 0;
-		User::LeaveIfError(iData->Seek(ESeekStart, pos));
-		User::LeaveIfError(iData->Read(aHeaderData, size));
-		}
-	}
-
-/**
- * @internalComponent
- */
- HBufC8* CMMFClientUtility::GetFileExtensionL(const TDesC& aFileName)
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFClientUtility::GetFileExtensionL\n"));
-    #endif
-	TParse fileName;
-	fileName.Set(aFileName,NULL,NULL);
-	HBufC8* fileSuffix = NULL;
-	if(fileName.ExtPresent())
-		{
-		TPtrC fileSuffixPtr(fileName.Ext());
-		fileSuffix = HBufC8::NewL(fileSuffixPtr.Length());
-		fileSuffix->Des().Copy(fileSuffixPtr);
-		}
-	else
-		{
-		fileSuffix = KNullDesC8().AllocL();
-		}
-	return fileSuffix;
-	}
-
-
-/**
- * @internalComponent
- */
-CMMFUtilityFileInfo::~CMMFUtilityFileInfo()
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFClientUtility::~CMMFUtilityFileInfo\n"));
-    #endif
-	delete iData;
-	}
-
-/*
- * @internalComponent
- *
- * Returns an integer rating indicating how well the supplied format matches
- * the header data and file extension supplied.
- * 3 brownie points awarded for data & suffix match.
- * 2 brownie points awarded for data match alone.
- * 1 brownie point awarded for suffix match alone.
- */
-TInt CMMFClientUtility::GetBestMatchL(const CMMFFormatImplementationInformation* format, const TDesC8& aHeaderData, const TDesC8& aFileExtension)
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFClientUtility::GetBestMatchL\n"));
-    #endif
-	TInt browniePoints = 0;
-
-	if (aHeaderData.Length() > 0) // Non empty file
-		{
-		if (aFileExtension.Length() > 0) // With a file extension
-			{
-			if (format->SupportsHeaderDataL(aHeaderData) &&
-				format->SupportsFileExtension(aFileExtension))
-				{
-				browniePoints = 3;
-				}
-			else if (format->SupportsHeaderDataL(aHeaderData))
-				{
-				browniePoints = 2;
-				}
-			else
-				{
-				// See if this format has any 'empty' match data or no match data, indicating
-				// that this format will match extension alone even if data present.
-				// (A format may have more than one match data string.)
-				const CDesC8Array& supportedHeaderData = format->SupportedHeaderData();
-
-				if (supportedHeaderData.Count() == 0)
-					{
-					// No header data indicated.
-					if (format->SupportsFileExtension(aFileExtension))
-						{
-							browniePoints = 1;
-						}
-					}
-				else
-					{
-					for (register TInt i = 0; i < supportedHeaderData.Count(); i++)
-						{
-						if ((supportedHeaderData[i].Length() == 0) &&
-							format->SupportsFileExtension(aFileExtension))
-							{
-							browniePoints = 1;
-							}
-						}
-					}
-				}
-			}
-		else
-			{
-			// No file suffix, so must match header data alone.
-			if (format->SupportsHeaderDataL(aHeaderData))
-				{
-				browniePoints = 2;
-				}
-			}
-		}
-	else // Empty File
-		{
-		// We have no choice but to match extension, if there is one.
-		if ((aFileExtension.Length() > 0) && format->SupportsFileExtension(aFileExtension))
-			{
-			browniePoints = 1;
-			}
-		}
-
-	return browniePoints;
-}
-
-/**
- * @internalComponent
- *
- * This function parses all the play & record formats in the given list of controllers,
- * looking for controllers & formats that best match the requirements.
- * Play controllers will be returned before record controllers, and
- * in cases of equal priority between formats, ECom order will be maintained.
- *
- * @param	"aControllers"
- *			A reference to a user supplied list of controllers retrieved from ECom.
- *			This list may be have been filtered for audio/video/play/record.
- * @param	"aHeaderDataPlayback"
- *			A descriptor reference containing the file's header data.
- *          for matching against a controller's play formats. May be KNullDesC8
- * @param	"aFileExtensionPlayback"
- *			A descriptor reference containing the filename's extension.
- *          for matching against a controller's play formats. May be KNullDesC8
- * @param	"aHeaderDataRecord"
- *			A descriptor reference containing the file's header data.
- *          for matching against a controller's record formats. May be KNullDesC8
- * @param	"aFileExtensionRecord"
- *			A descriptor reference containing the filename's extension.
- *          for matching against a controller's record formats. May be KNullDesC8
- * @param	"aPrioritisedControllers"
- *			A reference to a user supplied list through which the list of
- *			prioritised controllers will be returned.
- * @since	7.0s
- * @lib	"MediaClientUtility.lib"
- */
-void CMMFClientUtility::PrioritiseControllersL(
-	const RMMFControllerImplInfoArray& aControllers,
-	const TDesC8& aHeaderDataPlayback,
-	const TDesC8& aFileExtensionPlayback,
-	const TDesC8& aHeaderDataRecord,
-	const TDesC8& aFileExtensionRecord,
-	RMMFControllerImplInfoArray& prioritisedControllers)
-	{
-	RMMFControllerImplInfoArray fullMatchControllers; // data AND suffix
-	CleanupClosePushL(fullMatchControllers);
-	RMMFControllerImplInfoArray partMatchControllers; // data OR suffix
-	CleanupClosePushL(partMatchControllers);
-
-	TBool checkingPlaybackFormats = EFalse;
-	TBool checkingRecordFormats = EFalse;
-
-	if (aHeaderDataPlayback != KNullDesC8 || aFileExtensionPlayback != KNullDesC8)
-		checkingPlaybackFormats = ETrue;
-	if (aHeaderDataRecord != KNullDesC8 || aFileExtensionRecord != KNullDesC8)
-		checkingRecordFormats = ETrue;
-
-	// Examine each format for each controller. We only want to know at this stage
-	// if the controller has suitable formats, so as soon as we know it has, we can
-	// add it to out list, ranked by how well it matched.
-	for (register TInt i = 0; i < aControllers.Count(); i++)
-		{
-		const CMMFControllerImplementationInformation* controller = aControllers[i];
-		TInt savedBrowniePointsPlayback = 0;
-		TInt savedBrowniePointsRecord = 0;
-
-		if (checkingPlaybackFormats)
-			{
-			for (register TInt p = 0; p < controller->PlayFormats().Count(); p++)
-				{
-				const CMMFFormatImplementationInformation* format = controller->PlayFormats()[p];
-
-				TInt browniePoints = GetBestMatchL(format, aHeaderDataPlayback, aFileExtensionPlayback);
-
-				if (browniePoints >= savedBrowniePointsPlayback)
-					savedBrowniePointsPlayback = browniePoints;
-				}
-			}
-
-		if (checkingRecordFormats)
-			{
-			for (register TInt r = 0; r < controller->RecordFormats().Count(); r++)
-				{
-				const CMMFFormatImplementationInformation* format = controller->RecordFormats()[r];
-
-				TInt browniePoints = GetBestMatchL(format, aHeaderDataRecord, aFileExtensionRecord);
-
-				if (browniePoints >= savedBrowniePointsRecord)
-					savedBrowniePointsRecord = browniePoints;
-				}
-			}
-
-		TInt savedBrowniePoints = 0;
-		// if we're checking both playback & record formats
-		// make sure we've found both
-		if (checkingPlaybackFormats && checkingRecordFormats)
-			{
-			savedBrowniePoints = Min(savedBrowniePointsPlayback, savedBrowniePointsRecord);
-			}
-		else if (checkingPlaybackFormats)
-			{
-			savedBrowniePoints = savedBrowniePointsPlayback;
-			}
-		else if (checkingRecordFormats)
-			{
-			savedBrowniePoints = savedBrowniePointsRecord;
-			}
-
-		// Checked all formats for this controller, now count our brownie points.
-		switch (savedBrowniePoints)
-			{
-			case 3:
-				User::LeaveIfError(fullMatchControllers.Append(controller));
-				break;
-			case 2:
-				User::LeaveIfError(partMatchControllers.Insert(controller, 0));
-				break;
-			case 1:
-				User::LeaveIfError(partMatchControllers.Append(controller));
-				break;
-			default:
-				break;
-			}
-		}
-
-	// The better the controller matches, the earlier it will be in the final list.
-	for (register TInt x = 0; x < fullMatchControllers.Count(); x++)
-		{
-		if (prioritisedControllers.Find(fullMatchControllers[x]) == KErrNotFound)
-			{
-			User::LeaveIfError(prioritisedControllers.Append(fullMatchControllers[x]));
-			}
-		}
-
-	for (register TInt y = 0; y < partMatchControllers.Count(); y++)
-		{
-		if (prioritisedControllers.Find(partMatchControllers[y]) == KErrNotFound)
-			{
-			User::LeaveIfError(prioritisedControllers.Append(partMatchControllers[y]));
-			}
-		}
-
-	CleanupStack::PopAndDestroy(2, &fullMatchControllers); // fullMatchControllers, partMatchControllers
-	}
-
-/**
- * @internalComponent
- */
- CMMFMdaObjectStateChangeObserverCallback* CMMFMdaObjectStateChangeObserverCallback::NewL(MMdaObjectStateChangeObserver& aCallback)
-	{
-	return new(ELeave) CMMFMdaObjectStateChangeObserverCallback(aCallback);
-	}
-
-/**
- * @internalComponent
- */
-CMMFMdaObjectStateChangeObserverCallback::~CMMFMdaObjectStateChangeObserverCallback()
-	{
-	Cancel();
-	}
-
-/**
- * @internalComponent
- */
- void CMMFMdaObjectStateChangeObserverCallback::CallBack(CBase* aObject, TInt aPreviousState, TInt aCurrentState, TInt aErrorCode)
-	{
-	iObject = aObject;
-	iPreviousState = aPreviousState;
-	iCurrentState = aCurrentState;
-	iErrorCode = aErrorCode;
-	if (!IsActive())
-		{
-		TRequestStatus* s = &iStatus;
-		SetActive();
-		User::RequestComplete(s, KErrNone);
-		}
-	}
-
-CMMFMdaObjectStateChangeObserverCallback::CMMFMdaObjectStateChangeObserverCallback(MMdaObjectStateChangeObserver& aCallback) :
-	CActive(CActive::EPriorityHigh),
-	iCallback(aCallback)
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFMdaObjectStateChangeObserverCallback::CMMFMdaObjectStateChangeObserverCallback\n"));
-    #endif
-	CActiveScheduler::Add(this);
-	}
-
-void CMMFMdaObjectStateChangeObserverCallback::RunL()
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFMdaObjectStateChangeObserverCallback::RunL\n"));
-    #endif
-	iCallback.MoscoStateChangeEvent(iObject, iPreviousState, iCurrentState, iErrorCode);
-	}
-
-void CMMFMdaObjectStateChangeObserverCallback::DoCancel()
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFMdaObjectStateChangeObserverCallback::DoCancel\n"));
-    #endif
-	//nothing to cancel
-	}
-
-
-//****************************************
-// CMMFFindAndOpenController
-//****************************************
-
-/**
- * Factory function to create a CMMFFindAndOpenController class
- *
- * @internalComponent
- */
- CMMFFindAndOpenController* CMMFFindAndOpenController::NewL(MMMFFindAndOpenControllerObserver& aObserver)
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFFindAndOpenController::NewL\n"));
-    #endif
-	CMMFFindAndOpenController* self = new(ELeave) CMMFFindAndOpenController(aObserver);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-CMMFFindAndOpenController::~CMMFFindAndOpenController()
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFFindAndOpenController::~CMMFFindAndOpenController\n"));
-    #endif
-	Cancel();
-
-	// delete temporary variables
-	Close();
-
-	// this should cancel the AO
-	delete iAddDataSourceSinkAsync;
-
-	delete iPrimaryConfig;
-	delete iSecondaryConfig;
-	}
-
-/**
- * Function to free up memory after a successful open has completed
- * Useful to allow a alloc testing to work.
- * Must not be called if ReOpen() is to be called
- *
- * @internalComponent
- */
- void CMMFFindAndOpenController::Close()
-	{
-
-	Cancel();
-
-	if(iAddDataSourceSinkAsync)
-		{
-		iAddDataSourceSinkAsync->Cancel();
-		}
-
-	if (iPrimaryConfig)
-		iPrimaryConfig->Close();
-	if (iSecondaryConfig)
-		iSecondaryConfig->Close();
-
-	iPrioritisedControllers.Close();
-	iControllers.ResetAndDestroy();
-	iControllers.Close();
-
-	iFileName.SetLength(0);
-	iFileNameSecondary.SetLength(0);
-
-	delete iUrl;
-	iUrl = NULL;
-
-	delete iMimeType;
-	iMimeType = NULL;
-
-	delete iUniqueId;
-	iUniqueId = NULL;
-
-	iFileHandle.Close();
-	iUseFileHandle = EFalse;
-	}
-
-CMMFFindAndOpenController::CMMFFindAndOpenController(MMMFFindAndOpenControllerObserver& aObserver) :
-	CActive(EPriorityStandard),
-	iObserver(aObserver),
-	iDescriptor(NULL, 0)
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFFindAndOpenController::CMMFFindAndOpenController\n"));
-    #endif
-	CActiveScheduler::Add(this);
-	}
-
-void CMMFFindAndOpenController::ConstructL()
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFFindAndOpenController::ConstructL\n"));
-    #endif
-	iAddDataSourceSinkAsync = CMMFAddDataSourceSinkAsync::NewL(*this);
-	iPrimaryConfig = new (ELeave)  CConfig();
-	iSecondaryConfig =  new (ELeave) CConfig;
-	iCurrentConfig =  iPrimaryConfig;
-	}
-
-void CMMFFindAndOpenController::RunL()
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFFindAndOpenController::RunL\n"));
-    #endif
-	Process();
-	}
-
-void CMMFFindAndOpenController::DoCancel()
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFFindAndOpenController::DoCancel\n"));
-    #endif
-	iAddDataSourceSinkAsync->Cancel();
-	}
-
-/**
- * Defines the media ID & priority to be used when opening a controller
- * Normally called once only after class has been constructed
- *
- * @param	aMediaId
- *			the media ID to use when searching for a controller
- *			e.g. KUidMediaTypeAudio
- * @param	aPrioritySettings
- *			the priority settings to use when opening a controller
- * @param	aMediaIdMatchType
- *			Defines the type of media id match to be performed on the plugins
- *			returned from the ECOM registry.
- * @leave	can leave with KErrNoMemory
-
- * @internalComponent
- */
- void CMMFFindAndOpenController::Configure(
-	TUid aMediaId,
-	TMMFPrioritySettings aPrioritySettings,
-	CMMFPluginSelectionParameters::TMediaIdMatchType aMediaIdMatchType)
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFFindAndOpenController::Configure\n"));
-    #endif
-	iPrioritySettings = aPrioritySettings;
-
-	iMediaIdMatchType = aMediaIdMatchType;
-
-	iMediaId = aMediaId;
-	}
-
-void CMMFFindAndOpenController::ConfigureController(
-	CConfig& config,
-	RMMFController& aController,
-	CMMFControllerEventMonitor& aEventMonitor,
-	TControllerMode aControllerMode)
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFFindAndOpenController::ConfigureController\n"));
-    #endif
-	config.iController = &aController;
-	config.iEventMonitor = &aEventMonitor;
-	config.iControllerMode = aControllerMode;
-	}
-
-/**
- * Configures the primary controller
- *
- * @param	aController
- *			a reference to the client controller object to use
- * @param	aEventMonitor
- *			a reference to an event monitor object for receiving
- *			events from the controller
- * @param	aControllerMode
- *			indicates whether this controller is to be used for recording
- *          or playback
- *
- * @internalComponent
- */
- void CMMFFindAndOpenController::ConfigureController(
-	RMMFController& aController,
-	CMMFControllerEventMonitor& aEventMonitor,
-	TControllerMode aControllerMode)
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFFindAndOpenController::ConfigureController2\n"));
-    #endif
-	ConfigureController(
-		*iPrimaryConfig,
-		aController,
-		aEventMonitor,
-		aControllerMode);
-	}
-
-/**
- * Configures the secondary controller
- *
- * This is only needed for the audio recorder utility which opens
- * one controller for playback and another for recording
- *
- * @param	aController
- *			a reference to the client controller object to use
- * @param	aEventMonitor
- *			a reference to an event monitor object for receiving
- *			events from the controller
- * @param	aControllerMode
- *			indicates whether this controller is to be used for recording
- *          or playback or converting
- *
- * @internalComponent
- */
- void CMMFFindAndOpenController::ConfigureSecondaryController(
-	RMMFController& aController,
-	CMMFControllerEventMonitor& aEventMonitor,
-	TControllerMode aControllerMode)
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFFindAndOpenController::ConfigureSecondaryController\n"));
-    #endif
-	ConfigureController(
-		*iSecondaryConfig,
-		aController,
-		aEventMonitor,
-		aControllerMode);
-	}
-
-void CMMFFindAndOpenController::Init()
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFFindAndOpenController::Init\n"));
-    #endif
-	// This should be called prior to opening, so reset the error
-	iError = KErrNone;
-	iSourceSinkConfigured = EFalse;
-	iControllerCount = 0;
-	}
-
-void CMMFFindAndOpenController::ConfigureSourceSink(
-	CConfig& config,
-	TSourceSink aSource,
-	TSourceSink aSink)
-	{
-	TInt err;
-	TRAP(err, config.iSource = CreateSourceSinkL(aSource));
-	if (err != KErrNone)
-		{
-		iError = err;
-		return;
-		}
-
-	TRAP(err, config.iSink = CreateSourceSinkL(aSink));
-	if (err != KErrNone)
-		{
-		iError = err;
-		return;
-		}
-	}
-
-
-void CMMFFindAndOpenController::ConfigureSourceSink(
-	CConfig& config,
-	const TMMSource& aSource,
-	TSourceSink aSink)
-	{
-	TInt err;
-	TRAP(err, config.iSource = CreateSourceSinkL(aSource));
-	if (err != KErrNone)
-		{
-		iError = err;
-		return;
-		}
-
-	TRAP(err, config.iSink = CreateSourceSinkL(aSink));
-	if (err != KErrNone)
-		{
-		iError = err;
-		return;
-		}
-	}
-
-
-
-/**
- * Configure the primary controller's source and sink
- * The descriptors passed to this function are copied so they do not need to be persistent.
- * To simplify the API, any errors that occur are reported back asynchronously following
- * a subsequent call to OpenByXXX()
- *
- * @param	aSourceUid
- *			the UID of the data source
- * @param	aSourceData
- *			a reference to a descriptor used to configure the source
- * @param	aSinkUid
- *			the UID of the data sink
- * @param	aSinkData
- *			a reference to a descriptor used to configure the sink
- *
- * @internalComponent
- */
- void CMMFFindAndOpenController::ConfigureSourceSink(
-	TSourceSink aSource,
-	TSourceSink aSink)
-	{
-
-	CConfig* config = NULL;
-
-	Init();
-	config = iPrimaryConfig;
-
-
-	// must have already called ConfigureController()
-	__ASSERT_ALWAYS(config->iController != NULL, CUPanic(EMMFMediaClientUtilityBadState));
-
-	ConfigureSourceSink(
-		*config,
-		aSource,
-		aSink);
-	iCurrentConfig = config;
-
-	iSourceSinkConfigured = ETrue;
-	}
-
-
-/**
- * Configure the primary controller's source and sink
- * The descriptors passed to this function are copied so they do not need to be persistent.
- * To simplify the API, any errors that occur are reported back asynchronously following
- * a subsequent call to OpenByXXX()
- *
- * @param	aSourceUid
- *			the UID of the data source
- * @param	aSourceData
- *			a reference to a descriptor used to configure the source
- * @param	aSinkUid
- *			the UID of the data sink
- * @param	aSinkData
- *			a reference to a descriptor used to configure the sink
- *
- * @internalComponent
- */
- void CMMFFindAndOpenController::ConfigureSecondarySourceSink(
-	TSourceSink aSource,
-	TSourceSink aSink)
-	{
-	if (iError != KErrNone)
-		{
-		// if there was an error configuring the primary source/sink, do not try the secondary one
-		// Don't return the error, since the stored error will be returned by the OpenBy... method
-		return;
-		}
-
-	CConfig* config = NULL;
-
-	config = iSecondaryConfig;
-
-	// must have already configured the primary controller
-	__ASSERT_ALWAYS(iSourceSinkConfigured, CUPanic(EMMFMediaClientUtilityBadState));
-	config = iSecondaryConfig;
-
-	// must have already called ConfigureController()
-	__ASSERT_ALWAYS(config->iController != NULL, CUPanic(EMMFMediaClientUtilityBadState));
-
-	ConfigureSourceSink(
-		*config,
-		aSource,
-		aSink);
-	iCurrentConfig = config;
-
-	iSourceSinkConfigured = ETrue;
-	}
-
-
-
-
- void CMMFFindAndOpenController::ConfigureSourceSink(
-	const TMMSource& aSource,
-	TSourceSink aSink)
-	{
-	Init();
-	CConfig* config = iPrimaryConfig;
-
-	// must have already called ConfigureController()
-	__ASSERT_ALWAYS(config->iController != NULL, CUPanic(EMMFMediaClientUtilityBadState));
-
-	ConfigureSourceSink(
-		*config,
-		aSource,
-		aSink);
-	iCurrentConfig = config;
-
-	iSourceSinkConfigured = ETrue;
-	}
-
-
-
-
-/**
- * Opens a controller using the supplied controller UID
- * and adds the source & sink
- * Completion is indicated asynchonously by a call to MfaocComplete()
- *
- * @param	aControllerUid
- *			the UID of the primary controller
- * @param	aControllerUid
- *			the UID of the secondary controller
- *
- * @internalComponent
- */
- void CMMFFindAndOpenController::OpenByControllerUid(
-		TUid aControllerUid,
-		TUid aSecondaryControllerUid)
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFFindAndOpenController::OpenByControllerUid\n"));
-    #endif
-	// must have already called ConfigureSourceSink()
-	__ASSERT_ALWAYS(iSourceSinkConfigured, CUPanic(EMMFMediaClientUtilityBadState));
-
-	// Have there been any errors so far ?
-	if (iError != KErrNone)
-		{
-	    SchedSendError();
-		return;
-		}
-
-	if (iCurrentConfig == iPrimaryConfig)
-		{
-		// only do this for the playback controller
-		TRAP(iError, iCurrentConfig->iSource->EvaluateIntentL())
-
-		if (iError != KErrNone)
-			{
-	    	SchedSendError();
-			return;
-			}
-		}
-
-	iPrimaryConfig->iControllerUid = aControllerUid;
-	if (iCurrentConfig == iSecondaryConfig)
-		{
-		if (aSecondaryControllerUid == KNullUid)
-			iSecondaryConfig->iControllerUid = aControllerUid;
-		else
-			iSecondaryConfig->iControllerUid = aSecondaryControllerUid;
-		}
-
-	iMode = EOpenByControllerUid;
-	iControllerImplInfo = NULL;
-	iState = EOpenController;
-	KickState();
-	}
-
-/**
- * Opens a controller using the supplied file name
- * and adds the source & sink
- * A copy is made of the filename or file handle so that it need not be persistent
- * Completion is indicated asynchonously by a call to MfaocComplete()
- *
- * @param	aSource
- *			a reference to a TFileSource object to be used when searching
- *          for a controller
- * @param	aFileNameSecondary
- *			a reference to the seconday filename to be used when searching
- *          for a controller. This need only be supplied when converting
- *			between two files.
- *
- * @internalComponent
- */
- void CMMFFindAndOpenController::OpenByFileSource(const TMMSource& aSource, const TDesC& aFileNameSecondary)
-	{
-	// must have already called ConfigureSourceSink()
-	__ASSERT_ALWAYS(iSourceSinkConfigured, CUPanic(EMMFMediaClientUtilityBadState));
-
-	TInt err;
-	// Have there been any errors so far ?
-	if (iError != KErrNone)
-		{
-		SchedSendError();
-		return;
-		}
-
-	if (aSource.SourceType()==KUidMMFileSource)
-		{
-		const TMMFileSource& fileSource = static_cast<const TMMFileSource&>(aSource);
-		iFileName = fileSource.Name();
-		}
-
-	if (aSource.SourceType()==KUidMMFileHandleSource)
-		{
-		const TMMFileHandleSource& fileHandleSource = static_cast<const TMMFileHandleSource&>(aSource);
-		err = iFileHandle.Duplicate(fileHandleSource.Handle());
-
-
-		if (err != KErrNone)
-			{
-			SchedSendError(err);
-			return;
-			}
-
-		iFileHandle.Name(iFileName); //ignore error return since we'll just do without the filename if not available
-
-
-		iUseFileHandle = ETrue;
-		}
-
-	TRAP(err, iUniqueId = aSource.UniqueId().AllocL());
-	iIntent = aSource.Intent();
-	if (err != KErrNone)
-		{
-		SchedSendError(err);
-		return;
-		}
-
-
-	// take a copy of the secondary file name
-	iFileNameSecondary = aFileNameSecondary;
-
-	iMode = EOpenByFileName;
-	iState = EBuildControllerList;
-	KickState();
-	}
-
-/**
- * Opens a controller using the supplied format UID
- * and adds the source & sink
- * Completion is indicated asynchonously by a call to MfaocComplete()
- *
- * @param	aFormatUid
- *			the UID of a format that must be supported by the controller
- * @param	aFormatUidSecondary
- *			the UID of a secondary format that must be supported by the controller
- *			This need only be supplied when converting between two differnet formats.
- *
- * @internalComponent
- */
- void CMMFFindAndOpenController::OpenByFormatUid(TUid aFormatUid, TUid aFormatUidSecondary)
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFFindAndOpenController::OpenByFormatUid\n"));
-    #endif
-	// must have already called ConfigureSourceSink()
-	__ASSERT_ALWAYS(iSourceSinkConfigured, CUPanic(EMMFMediaClientUtilityBadState));
-
-	// Have there been any errors so far ?
-	if (iError != KErrNone)
-		{
-		SchedSendError();
-		return;
-		}
-
-	iFormatUid = aFormatUid;
-	iFormatUidSecondary = aFormatUidSecondary;
-
-	iMode = EOpenByFormatUid;
-	iState = EBuildControllerList;
-	KickState();
-	}
-
-/**
- * Opens a controller using the supplied descriptor
- * and adds the source & sink
- * Completion is indicated asynchonously by a call to MfaocComplete()
- *
- * @param	aDescriptor
- *			a reference to the descriptor to be used when searching
- *          for a controller
- *
- * @internalComponent
- */
- void  CMMFFindAndOpenController::OpenByDescriptor(const TDesC8& aDescriptor)
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFFindAndOpenController::OpenByDescriptor\n"));
-    #endif
-	// must have already called ConfigureSourceSink()
-	__ASSERT_ALWAYS(iSourceSinkConfigured, CUPanic(EMMFMediaClientUtilityBadState));
-
-	// Have there been any errors so far ?
-	if (iError != KErrNone)
-		{
-		SchedSendError();
-		return;
-		}
-
-	// take a copy of the descriptor
-	TUint8* desBufferPtr = const_cast<TUint8*> (aDescriptor.Ptr());
-	iDescriptor.Set( desBufferPtr,aDescriptor.Length(),aDescriptor.Length());
-
-	iMode = EOpenByDescriptor;
-	iState = EBuildControllerList;
-	KickState();
-	}
-
-/**
- * Opens a controller using the supplied URL
- * and adds the source & sink
- * Completion is indicated asynchonously by a call to MfaocComplete()
- *
- * @param	aUrl
- *			a reference to the URL to be used when searching for a controller
- * @param	aIapId
- *          the IAP ID to be used when searching for a controller
- * @param	aMimeType
- *          the MIME type of the data to be used when searching for a controller
- *
- * @internalComponent
- */
- void CMMFFindAndOpenController::OpenByUrl(const TDesC& aUrl, TInt aIapId, const TDesC8& aMimeType)
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFFindAndOpenController::OpenByUrl\n"));
-    #endif
-	// must have already called ConfigureSourceSink()
-	__ASSERT_ALWAYS(iSourceSinkConfigured, CUPanic(EMMFMediaClientUtilityBadState));
-
-	// Have there been any errors so far ?
-	if (iError != KErrNone)
-		{
-		SchedSendError();
-		return;
-		}
-
-	// take a copy of the Url
-	delete iUrl;
-	iUrl = NULL;
-	iUrl = aUrl.Alloc();
-	if (iUrl == NULL)
-		{
-		SchedSendError(KErrNoMemory);
-		return;
-		}
-
-	// take a copy of the IapId
-	iIapId = aIapId;
-
-	// take a copy of the mime type
-	delete iMimeType;
-	iMimeType = NULL;
-	iMimeType = aMimeType.Alloc();
-	if (iMimeType == NULL)
-		{
-		SchedSendError(KErrNoMemory);
-		return;
-		}
-
-	iMode = EOpenByUrl;
-	iState = EBuildControllerList;
-	KickState();
-	}
-
-/**
- * Static function to return a TMMFFileConfig object
- * suitable for passing to ConfigureSourceSink()
- *
- * @param	aFileName
- *          the filename to use
- *
- * @internalComponent
- */
- TMMFFileConfig CMMFFindAndOpenController::GetConfigFile(const TDesC& aFileName)
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFFindAndOpenController::GetConfigFile\n"));
-    #endif
-	TMMFFileConfig sourceSinkData;
-	sourceSinkData().iPath = aFileName;
-	return sourceSinkData;
-	}
-
-/**
- * Static function to return a TMMFDescriptorConfig object
- * suitable for passing to ConfigureSourceSink()
- *
- * @param	aFileName
- *          the filename to use
- *
- * @internalComponent
- */
- TMMFDescriptorConfig CMMFFindAndOpenController::GetConfigDescriptor(const TDesC8& aDescriptor)
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFFindAndOpenController::GetConfigDescriptor\n"));
-    #endif
-	TMMFDescriptorConfig sourceSinkData;
-	sourceSinkData().iDes = (TAny*)&aDescriptor;
-	sourceSinkData().iDesThreadId = RThread().Id();
-	return sourceSinkData;
-	}
-
-/**
- * Static function to create a CBufFlat object
- * suitable for passing to ConfigureSourceSink()
- *
- * @param	aUrlCfgBuffer
- *          the reference to a caller-supplied pointer used to create
- *			a CBufFlat object. The caller is responsible for deletion.
- * @param	aUrl
- *			a reference to the URL to be used
- * @param	aIapId
- *          the IAP ID to be used
- * @return	can return KErrNone or KErrNoMemory
- *
- * @internalComponent
- */
- TInt CMMFFindAndOpenController::GetConfigUrl(CBufFlat*& aUrlCfgBuffer, const TDesC& aUrl, TInt aIapId)
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFFindAndOpenController::GetConfigDescriptor\n"));
-    #endif
-	TInt error;
-	delete aUrlCfgBuffer;
-	aUrlCfgBuffer = NULL;
-
-	CMMFUrlParams* urlCfg = NULL;
-	TRAP(error, urlCfg = CMMFUrlParams::NewL(aUrl,aIapId));
-	if (error != KErrNone)
-		return error;
-
-	TRAP(error,
-		aUrlCfgBuffer = urlCfg->ExternalizeToCBufFlatLC();
-		CleanupStack::Pop(aUrlCfgBuffer);
-		);
-
-	delete urlCfg;
-
-	return error;
-	}
-
-/**
- * ReOpens the previously opened primary controller
- *
- * @internalComponent
- */
- void CMMFFindAndOpenController::ReOpen()
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFFindAndOpenController::ReOpen\n"));
-    #endif
-	// should already have a valid controller uid so just open it
-	iControllerImplInfo = NULL;
-	iState = EOpenController;
-	KickState();
-	}
-
-void CMMFFindAndOpenController::OpenPrimaryController(void)
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFFindAndOpenController::OpenPrimaryController\n"));
-    #endif
-	iCurrentConfig = iPrimaryConfig;
-	switch(iMode)
-		{
-		case EOpenByFileName:
-		case EOpenByFormatUid:
-		case EOpenByDescriptor:
-		case EOpenByUrl:
-			iState = EBuildControllerList;
-			break;
-		case EOpenByControllerUid:
-			iControllerImplInfo = NULL;
-			iState = EOpenController;
-			break;
-		}
-	KickState();
-	}
-
-void CMMFFindAndOpenController::KickState()
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFFindAndOpenController::KickState\n"));
-    #endif
-	TRequestStatus* status = &iStatus;
-	User::RequestComplete(status, KErrNone);
-	SetActive();
-	}
-
-void CMMFFindAndOpenController::CloseController()
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFFindAndOpenController::CloseController\n"));
-    #endif
-	if (iCurrentConfig->iEventMonitor)
-		iCurrentConfig->iEventMonitor->Cancel();
-	iCurrentConfig->iController->Close();
-	}
-
-void CMMFFindAndOpenController::Process()
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFFindAndOpenController::Process\n"));
-    #endif
-	switch(iState)
-		{
-		case EBuildControllerList:
-			switch(iMode)
-				{
-				case EOpenByFileName:
-					TRAP(iError, BuildControllerListFileNameL());
-					break;
-				case EOpenByDescriptor:
-					TRAP(iError, BuildControllerListDescriptorL());
-					break;
-				case EOpenByUrl:
-					TRAP(iError, BuildControllerListUrlL());
-					break;
-				case EOpenByFormatUid:
-					TRAP(iError, BuildControllerListFormatL());
-					break;
-				default:
-					CUPanic(EMMFMediaClientUtilityBadState);
-				}
-
-			if (iError != KErrNone)
-				{
-				iState = EIdle;
-				SendError();
-				break;
-				}
-
-			// try the first controller
-			iControllerIndex = -1;
-			TryNextController();
-			break;
-
-		case EOpenController:
-			// Make sure any existing controller is closed.
-			CloseController();
-
-			// Open the controller
-			if (iControllerImplInfo)
-				{
-				iError = iCurrentConfig->iController->Open(*iControllerImplInfo, iPrioritySettings);
-				}
-			else
-				{
-				iError = iCurrentConfig->iController->Open(iCurrentConfig->iControllerUid, iPrioritySettings);
-				}
-
-			if (iError)
-				{
-				TryNextController();
-				}
-			else
-				{
-
-				iCurrentConfig->iEventMonitor->Start();
-
-				if (iCurrentConfig == iSecondaryConfig)
-					{
-					iState = EAddSource;
-					KickState();
-					}
-				else
-					{
-					iState = EAddSink;
-					KickState();
-					}
-				}
-			break;
-
-		case EAddSource:
-			{
-			iState = EWaitingForSource;
-			const CMMSourceSink* source = iCurrentConfig->iSource;
-			iAddDataSourceSinkAsync->AddDataSource(*iCurrentConfig->iController,
-												   source->SourceSinkUid(),
-												   source->SourceSinkData());
-			}
-			break;
-
-		case EAddSink:
-			{
-			iState = EWaitingForSink;
-			const CMMSourceSink* sink = iCurrentConfig->iSink;
-			iAddDataSourceSinkAsync->AddDataSink(*iCurrentConfig->iController,
-												 sink->SourceSinkUid(),
-												 sink->SourceSinkData());
-			}
-			break;
-
-		case EWaitingForSource:
-			break;
-
-		case EWaitingForSink:
-			break;
-
-		case ESendError:
-			SendError();
-			iState = EIdle;
-			break;
-
-		case EIdle:
-		default:
-			break;
-		}
-	}
-
-void CMMFFindAndOpenController::TryNextController()
-	{
-
-    #if _DEBUG
-      RDebug::Print(_L("CMMFFindAndOpenController::TryNextController\n"));
-    #endif
-	// If an error occurred close the controller.
-	if (iError != KErrNone)
-		CloseController();
-
-	// take the first available exit if we're out of memory
-	if (iError == KErrNoMemory)
-		{
-		SendError();
-		return;
-		}
-
-	if (iMode == EOpenByControllerUid || ++iControllerIndex >= iControllerCount)
-		{
-		SendError(KErrNotSupported);		// KErrNotSupported
-		return;
-		}
-
-	if (iMode == EOpenByFileName || iMode == EOpenByFormatUid)
-		{
-		iControllerImplInfo = iPrioritisedControllers[iControllerIndex];
-		}
-	else	//if (iMode == EOpenByDescriptor || iMode == EOpenByUrl)
-		{
-		iControllerImplInfo = iControllers[iControllerIndex];
-		}
-
-        // This Flag is defined so that if the Helix Controller Supports
-        // the playback of Local Media for WMA, then the ProgDL still
-        // goes through the Old WMA Controller( AdvancedAudioController)
-        // We are launching the Old WMA Controller using the UID.
-
-#ifdef __WINDOWS_MEDIA
-    HBufC8* mimeType = HBufC8::NewLC(KMaxMimeLength);
-    TPtr8 mimeTypePtr = mimeType->Des();
-    mimeTypePtr.Copy(KWMAMimeType());
-
-    TBool IsSupported = EFalse;
-    const RMMFFormatImplInfoArray& playFormatInfo = iControllerImplInfo->PlayFormats();
-
-	for (TInt p = 0; p < iControllerImplInfo->PlayFormats().Count(); p++)
-		{
-		const CMMFFormatImplementationInformation* format = iControllerImplInfo->PlayFormats()[p];
-        IsSupported = format->SupportsMimeType(*mimeType);
-        if(IsSupported)
-            break;
-        }
-
-    if(IsSupported)
-        {
-        iControllerImplInfo = NULL;
-        iCurrentConfig->iControllerUid = TUid::Uid(0x10207A9B);
-        }
-    else
-#endif
-        {
-    	iCurrentConfig->iControllerUid = iControllerImplInfo->Uid();
-        }
-
-#ifdef __WINDOWS_MEDIA
-	CleanupStack::PopAndDestroy(mimeType);
-#endif
-	iState = EOpenController;
-	KickState();
-	}
-
-void CMMFFindAndOpenController::MadssaoAddDataSourceSinkAsyncComplete(TInt aError, const TMMFMessageDestination& aHandle)
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFFindAndOpenController::MadssaoAddDataSourceSinkAsyncComplete\n"));
-    #endif
-	iError = aError;
-
-	// take the first available exit if we're out of memory
-	// or we've been cancelled
-	if (iError == KErrNoMemory || iError == KErrCancel)
-		{
-		SendError();
-		return;
-		}
-
-	// failed to add source or sink - try the next controller
-	if (aError != KErrNone)
-		{
-		TryNextController();
-		return;
-		}
-
-	if (iState == EWaitingForSource)
-		{
-		iSourceHandle = aHandle;
-		if (iCurrentConfig == iSecondaryConfig)
-			{
-			iState = EAddSink;
-			}
-		else	// completed ok !
-			{
-			iState = EIdle;
-			iError = KErrNone;
-			SendError();
-			return;
-			}
-		}
-	else if (iState == EWaitingForSink)
-		{
-		iSinkHandle = aHandle;
-		if (iCurrentConfig == iSecondaryConfig)	// completed ok !
-			{
-			iState = EIdle;
-			iError = KErrNone;
-			SendError();
-			return;
-			}
-		else
-			{
-			iState = EAddSource;
-			}
-		}
-
-	KickState();
-	}
-
-void CMMFFindAndOpenController::SendError(TInt aError)
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFFindAndOpenController::SendError err= %d\n"),aError);
-    #endif
-	if (iError == KErrNone)
-		iError = aError;
-
-	iObserver.MfaocComplete(iError, iCurrentConfig->iController, iCurrentConfig->iControllerUid, &iSourceHandle, &iSinkHandle);
-
-	// if we've just attempted to open the Secondary controller,
-	// try to open the Primary controller
-	if (iCurrentConfig == iSecondaryConfig)
-		{
-		if (iError == KErrNone)
-			OpenPrimaryController();
-		}
-
-	// if we failed to open, may as well free up some memory
-	// if open succeeded we need to preserve state in case of a re-open
-	if (iError != KErrNone)
-		Close();
-	}
-
-void CMMFFindAndOpenController::SchedSendError(TInt aError)
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFFindAndOpenController::SchedSendError\n"));
-    #endif
-	if (aError != KErrNone)
-		iError = aError;
-	iState = ESendError;
-	KickState();
-	}
-
-void CMMFFindAndOpenController::BuildControllerListFileNameL()
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFFindAndOpenController::BuildControllerListFileNameL\n"));
-    #endif
-	// Retrieve a list of possible controllers from ECOM
-	// If we don't have a match, leave with unsupported
-
-	iControllers.ResetAndDestroy();
-	iPrioritisedControllers.Reset();
-
-	TControllerMode mode = iCurrentConfig->iControllerMode;
-
-	// if we're playing, try to get the MIME type from the Content Access
-	// Framework (CAF) & use that to select a controller - if that fails,
-	// try to select a controller based on the header data/file extension
-
-	CMMFUtilityFileInfo* fileInfo = NULL;
-
-	TInt error;
-
-	//If the current CMMSourceSink is a CMMFileSourceSink
-	// Using the previous version we'd get KErrCANoPermission when calling EvaluateIntent in the
-	// CMMFUtilityFileInfo ConstructL as the intent == EUnknown, so now pass the intent as a parameter
-	// to TMMFileHandleSource and....
-	if (iUseFileHandle)
-		{
-		if (iUniqueId != NULL)
-			{
-			TMMFileHandleSource fileHandleSource(iFileHandle, (*iUniqueId), iIntent);
-			TRAP(error, fileInfo = CMMFUtilityFileInfo::NewL(fileHandleSource));
-			}
-		else
-			{
-			TMMFileHandleSource fileHandleSource(iFileHandle);
-			TRAP(error, fileInfo = CMMFUtilityFileInfo::NewL(fileHandleSource));
-			}
-		}
-	else
-		{
-		if (iUniqueId != NULL)
-			{
-			TMMFileSource fileSource(iFileName, (*iUniqueId), iIntent);
-			TRAP(error, fileInfo = CMMFUtilityFileInfo::NewL(fileSource));
-			}
-		else
-			{
-			TMMFileSource fileSource(iFileName);
-			TRAP(error, fileInfo = CMMFUtilityFileInfo::NewL(fileSource));
-			}
-		}
-
-	if (fileInfo != NULL)
-		{
-		CleanupDeletePushL(fileInfo);
-		}
-
-	if (error != KErrNone)
-		{
-		// if playback mode, leave for any error
-		// if record mode, allow KErrNotFound
-		if (mode == EPlayback || (mode != EPlayback && error != KErrNotFound))
-			{
-			User::Leave(error);
-			}
-		}
-
-	CMMFControllerPluginSelectionParameters* cSelect = CMMFControllerPluginSelectionParameters::NewLC();
-	RArray<TUid> mediaIds;
-	CleanupClosePushL(mediaIds);
-	User::LeaveIfError(mediaIds.Append(iMediaId));
-
-	cSelect->SetMediaIdsL(mediaIds, iMediaIdMatchType);
-
-
-	if (mode == EPlayback)
-		{
-		ASSERT(fileInfo!=NULL);
-		TBuf8<KMaxMimeLength> mimeType;
-		TBool mimeTypeKnown = fileInfo->GetFileMimeTypeL(mimeType);
-		if (mimeTypeKnown)
-			{
-			CMMFFormatSelectionParameters* fSelect = CMMFFormatSelectionParameters::NewLC();
-			fSelect->SetMatchToMimeTypeL(mimeType);
-			cSelect->SetRequiredPlayFormatSupportL(*fSelect);
-			cSelect->ListImplementationsL(iControllers);
-			CleanupStack::PopAndDestroy(fSelect);
-			}
-
-
-		// copy to the iPrioritisedControllers array - this is a NOOP if the
-		// MIME type is not known since iControllers will be empty
-		ASSERT(mimeTypeKnown || iControllers.Count() == 0);
-		for (TInt controllerIndex=0; controllerIndex < iControllers.Count(); controllerIndex++)
-			User::LeaveIfError(iPrioritisedControllers.Append(iControllers[controllerIndex]));
-
-		iControllerCount = iPrioritisedControllers.Count();
-		if (iControllerCount > 0)
-			{
-			// Clean up
-			// cSelect, mediaIds,
-			CleanupStack::PopAndDestroy(2, cSelect);
-			if (fileInfo != NULL)
-				{
-				CleanupStack::PopAndDestroy(fileInfo);
-				}
-			return;
-			}
-		}
-
-	// Retrieve header data first. If file doesn't exist, its ok.
-	HBufC8* headerData = HBufC8::NewLC(KMaxHeaderSize);
-	TPtr8 headerDataPtr = headerData->Des();
-	if (fileInfo)
-		{
-		fileInfo->GetFileHeaderDataL(headerDataPtr, KMaxHeaderSize);
-		}
-
-	// Get the filename's suffix
-	HBufC8* fileSuffix = CMMFClientUtility::GetFileExtensionL(iFileName);
-
-	CleanupStack::PushL(fileSuffix);
-	TPtr8 fileSuffixPtr = fileSuffix->Des();
-
-	// Get the secondary filename's header data (for convert)
-	HBufC8* headerDataSecondary = HBufC8::NewLC(KMaxHeaderSize);
-	TPtr8 headerDataPtrSecondary = headerDataSecondary->Des();
-	if (iFileNameSecondary.Length() > 0 && fileInfo)
-		{
-		fileInfo->GetFileHeaderDataL(headerDataPtrSecondary, KMaxHeaderSize);
-		}
-
-	// Get the secondary filename's suffix
-	HBufC8* fileSuffixSecondary = CMMFClientUtility::GetFileExtensionL(iFileNameSecondary);
-	CleanupStack::PushL(fileSuffixSecondary);
-	TPtr8 fileSuffixPtrSecondary = fileSuffixSecondary->Des();
-
-
-	CMMFFormatSelectionParameters* fSelect = CMMFFormatSelectionParameters::NewLC();
-
-	if (mode == EPlayback || mode == EConvert)
-		cSelect->SetRequiredPlayFormatSupportL(*fSelect);
-	if (mode == ERecord || mode == EConvert)
-		cSelect->SetRequiredRecordFormatSupportL(*fSelect);
-
-	cSelect->ListImplementationsL(iControllers);
-
-	if (iControllers.Count()==0)
-		User::Leave(KErrNotSupported);
-
-	if (mode == ERecord)
-		{
-		CMMFClientUtility::PrioritiseControllersL(
-			iControllers,
-			headerDataPtrSecondary,
-			fileSuffixPtrSecondary,
-			headerDataPtr,
-			fileSuffixPtr,
-			iPrioritisedControllers);
-		}
-	else
-		{
-		CMMFClientUtility::PrioritiseControllersL(
-			iControllers,
-			headerDataPtr,
-			fileSuffixPtr,
-			headerDataPtrSecondary,
-			fileSuffixPtrSecondary,
-			iPrioritisedControllers);
-		}
-
-	iControllerCount = iPrioritisedControllers.Count();
-	if (iControllerCount == 0)
-		User::Leave(KErrNotSupported);
-
-	// Clean up
-	// cSelect, mediaIds,
-	// headerData, fileSuffix, headerDataSecondary, fileSuffixSecondary,
-	// fSelect
-	CleanupStack::PopAndDestroy(7, cSelect);
-	if (fileInfo != NULL)
-		{
-		CleanupStack::PopAndDestroy(fileInfo);
-		}
-	}
-
-void CMMFFindAndOpenController::BuildControllerListDescriptorL()
-	{
-	// Retrieve a list of possible controllers from ECOM
-	// If we don't have a match, leave with unsupported
-
-	iControllers.ResetAndDestroy();
-
-	CMMFControllerPluginSelectionParameters* cSelect = CMMFControllerPluginSelectionParameters::NewLC();
-	CMMFFormatSelectionParameters* fSelect = CMMFFormatSelectionParameters::NewLC();
-
-
-	RArray<TUid> mediaIds;
-	CleanupClosePushL(mediaIds);
-	User::LeaveIfError(mediaIds.Append(iMediaId));
-
-	cSelect->SetMediaIdsL(mediaIds, iMediaIdMatchType);
-
-	TPtrC8 header = iDescriptor.Left(KMaxHeaderSize);
-	fSelect->SetMatchToHeaderDataL(header);
-
-
-	TControllerMode mode = iCurrentConfig->iControllerMode;
-	if (mode == EPlayback || mode == EConvert)
-		cSelect->SetRequiredPlayFormatSupportL(*fSelect);
-	if (mode == ERecord || mode == EConvert)
-		cSelect->SetRequiredRecordFormatSupportL(*fSelect);
-
-	cSelect->ListImplementationsL(iControllers);
-
-	iControllerCount = iControllers.Count();
-	if (iControllerCount == 0)
-		User::Leave(KErrNotSupported);
-
-	// Clean up
-	// cSelect, fSelect, mediaIds
-	CleanupStack::PopAndDestroy(3, cSelect);
-	}
-
-void CMMFFindAndOpenController::BuildControllerListUrlL()
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFFindAndOpenController::BuildControllerListUrlL"));
-    #endif
-	// Retrieve a list of possible controllers from ECOM
-	// If we don't have a match, leave with unsupported
-
-	iControllers.ResetAndDestroy();
-
-	CMMFControllerPluginSelectionParameters* cSelect = CMMFControllerPluginSelectionParameters::NewLC();
-	CMMFFormatSelectionParameters* fSelect = CMMFFormatSelectionParameters::NewLC();
-
-	RArray<TUid> mediaIds;
-	CleanupClosePushL(mediaIds);
-	User::LeaveIfError(mediaIds.Append(iMediaId));
-
-	cSelect->SetMediaIdsL(mediaIds, iMediaIdMatchType);
-
-
- 	if (*iMimeType != KNullDesC8)
-		{
-		fSelect->SetMatchToMimeTypeL(*iMimeType);//We match to mime type
-		}
-	else
-		fSelect->SetMatchToUriL(*iUrl);
-
-
-	TControllerMode mode = iCurrentConfig->iControllerMode;
-	if (mode == EPlayback || mode == EConvert)
-		cSelect->SetRequiredPlayFormatSupportL(*fSelect);
-	if (mode == ERecord || mode == EConvert)
-		cSelect->SetRequiredRecordFormatSupportL(*fSelect);
-
-	cSelect->ListImplementationsL(iControllers);
-
-	iControllerCount = iControllers.Count();
-	if (iControllerCount == 0)
-		User::Leave(KErrNotSupported);
-
-	// Clean up
-	// cSelect, fSelect, mediaIds
-	CleanupStack::PopAndDestroy(3, cSelect);
-	}
-
-void CMMFFindAndOpenController::BuildControllerListFormatL()
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFFindAndOpenController::BuildControllerListFormatL"));
-    #endif
-	// Retrieve a list of possible controllers from ECOM
-	// If we don't have a match, leave with unsupported
-
-	iControllers.ResetAndDestroy();
-	iPrioritisedControllers.Reset();
-
-	CMMFControllerPluginSelectionParameters* cSelect = CMMFControllerPluginSelectionParameters::NewLC();
-
-	// Select the media IDs to allow
-	RArray<TUid> mediaIds;
-	CleanupClosePushL(mediaIds);
-	User::LeaveIfError(mediaIds.Append(iMediaId));
-
-	cSelect->SetMediaIdsL(mediaIds, iMediaIdMatchType);
-
-	CMMFFormatSelectionParameters* fSelect = CMMFFormatSelectionParameters::NewLC();
-
-	TControllerMode mode = iCurrentConfig->iControllerMode;
-	if (mode == EPlayback || mode == EConvert)
-		cSelect->SetRequiredPlayFormatSupportL(*fSelect);
-	if (mode == ERecord || mode == EConvert)
-		cSelect->SetRequiredRecordFormatSupportL(*fSelect);
-
-	//Obtain a list of the controllers
-	cSelect->ListImplementationsL(iControllers);
-
-	CleanupStack::PopAndDestroy(3, cSelect); // cSelect, mediaIds, fSelect
-
-	iControllerCount = iControllers.Count();
-	if (iControllerCount == 0)
-		User::Leave(KErrNotSupported);
-
-	TUid formatUidPrimary;
-	TUid formatUidSecondary;
-	if (mode == ERecord)
-		{
-		formatUidSecondary = iFormatUid;
-		formatUidPrimary = iFormatUidSecondary;
-		}
-	else
-		{
-		formatUidPrimary = iFormatUid;
-		formatUidSecondary = iFormatUidSecondary;
-		}
-
-	for (TInt controllerIndex=0; controllerIndex < iControllers.Count(); controllerIndex++)
-		{
-		const RMMFFormatImplInfoArray& recFormatInfo = iControllers[controllerIndex]->RecordFormats();
-		const RMMFFormatImplInfoArray& playFormatInfo = iControllers[controllerIndex]->PlayFormats();
-
-		TBool playFormatMatched = EFalse;
-		TBool recordFormatMatched = EFalse;
-
-		if (formatUidPrimary == KNullUid)
-			{
-			playFormatMatched = ETrue;
-			}
-		else
-			{
-			for(TInt playFormatIndex =0; playFormatIndex < playFormatInfo.Count(); playFormatIndex++)
-				{
-				if(playFormatInfo[playFormatIndex]->Uid() == formatUidPrimary)
-					{
-					playFormatMatched = ETrue;
-					break;
-					}
-				}
-			}
-
-		if (formatUidSecondary == KNullUid)
-			{
-			recordFormatMatched = ETrue;
-			}
-		else
-			{
-			for (TInt recFormatIndex =0; recFormatIndex < recFormatInfo.Count(); recFormatIndex++)
-				{
-				if (recFormatInfo[recFormatIndex]->Uid() == formatUidSecondary)
-					{
-					recordFormatMatched = ETrue;
-					break;
-					}
-				}
-			}
-
-		if (playFormatMatched && recordFormatMatched)
-			User::LeaveIfError(iPrioritisedControllers.Append(iControllers[controllerIndex]));
-		}
-
-	iControllerCount = iPrioritisedControllers.Count();
-	if (iControllerCount == 0)
-		User::Leave(KErrNotSupported);
-	}
-
-CMMSourceSink* CMMFFindAndOpenController::CreateSourceSinkL(const TSourceSink& aParams)
-	{
-	if (aParams.iUseFileHandle)
-		{
-		return CMMFileSourceSink::NewL(aParams.iUid, aParams.iFileHandle);
-		}
-	return CMMSourceSink::NewL(aParams.iUid, aParams.iConfigData);
-	}
-
-
-CMMSourceSink* CMMFFindAndOpenController::CreateSourceSinkL(const TMMSource& aSource)
-	{
-	if (!(aSource.SourceType()==KUidMMFileSource ||
-		aSource.SourceType()==KUidMMFileHandleSource))
-		User::Leave(KErrNotSupported);
-
-	return CMMFileSourceSink::NewL(KUidMmfFileSource, aSource);
-	}
-
-
-
- CMMFFindAndOpenController::TSourceSink::TSourceSink(TUid aUid, const TDesC8& aConfigData)
-	: iConfigData(aConfigData)
-	{
-	iUid = aUid;
-
-	iUseFileHandle = EFalse;
-	}
-
- CMMFFindAndOpenController::TSourceSink::TSourceSink(TUid aUid, const RFile& aFile)
-	: iConfigData(KNullDesC8)
-	{
-	iUid = aUid;
-
-	iFileHandle = aFile;
-	iUseFileHandle = ETrue;
-	}
-
-CMMFFindAndOpenController::CConfig::CConfig()
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFFindAndOpenController::CConfig"));
-    #endif
-	}
-
-void CMMFFindAndOpenController::CConfig::Close()
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFFindAndOpenController::Close"));
-    #endif
-	delete iSource;
-	iSource = NULL;
-	delete iSink;
-	iSink = NULL;
-	}
-CMMFFindAndOpenController::CConfig::~CConfig()
-	{
-    #if _DEBUG
-      RDebug::Print(_L("CMMFFindAndOpenController::~CConfig"));
-    #endif
-	Close();
-	}
-
- CMMSourceSink* CMMSourceSink::NewLC(TUid aUid, const TDesC8& aDescriptor)
-	{
-	CMMSourceSink* self = new (ELeave) CMMSourceSink(aUid);
-	CleanupStack::PushL(self);
-	self->ConstructL(aDescriptor);
-	return self;
-	}
-
- CMMSourceSink* CMMSourceSink::NewL(TUid aUid, const TDesC8& aDescriptor)
-	{
-	CMMSourceSink* sourcesink = CMMSourceSink::NewLC(aUid, aDescriptor);
-	CleanupStack::Pop(sourcesink);
-	return sourcesink;
-	}
-
-CMMSourceSink::CMMSourceSink(TUid aUid)
-	: iUid(aUid)
-	{
-	}
-
-CMMSourceSink::~CMMSourceSink()
-	{
-	delete iBuf;
-	}
-
-void CMMSourceSink::ConstructL(const TDesC8& aDescriptor)
-	{
-	iBuf = aDescriptor.AllocL();
-	}
-
-TUid CMMSourceSink::SourceSinkUid() const
-	{
-	return iUid;
-	}
-
-const TDesC8& CMMSourceSink::SourceSinkData() const
-	{
-	return *iBuf;
-	}
-
- CMMFileSourceSink* CMMFileSourceSink::NewLC(TUid aUid, const RFile& aFile)
-	{
-	CMMFileSourceSink* self = new (ELeave) CMMFileSourceSink(aUid);
-	CleanupStack::PushL(self);
-	self->ConstructL(aFile);
-	return self;
-	}
-
- CMMFileSourceSink* CMMFileSourceSink::NewL(TUid aUid, const RFile& aFile)
-	{
-	CMMFileSourceSink* sourcesink = CMMFileSourceSink::NewLC(aUid, aFile);
-	CleanupStack::Pop(sourcesink);
-	return sourcesink;
-	}
-
-CMMFileSourceSink::CMMFileSourceSink(TUid aUid)
-	: CMMSourceSink(aUid)
-	{
-	}
-
-void CMMFileSourceSink::ConstructL(const RFile& aFile)
-	{
-	iHandle.Duplicate(aFile);
-	iUsingFileHandle = ETrue;
-	iFileName = HBufC::NewMaxL(KMaxFileName);
-	TPtr fileNamePtr = iFileName->Des();
-	iHandle.Name(fileNamePtr);
-	DoCreateFileHandleSourceConfigDataL();
-	}
-const TInt KExpandSize = 100;
-
-void CMMFileSourceSink::DoCreateFileHandleSourceConfigDataL()
-	{
-	CBufFlat* buf = CBufFlat::NewL(KExpandSize);
-	CleanupStack::PushL(buf);
-	RBufWriteStream stream;
-	stream.Open(*buf);
-	CleanupClosePushL(stream);
-
-	TPckgBuf<RFile*> fileptr(&iHandle);
-	stream.WriteInt32L(KMMFileHandleSourceUid.iUid);
-
-	stream.WriteL(fileptr);
-
-	TInt length = 0;
-	if (iUniqueId != NULL)
-		length = iUniqueId->Length();
-	stream.WriteInt32L(length);
-	if (length>0)
-		stream.WriteL(*iUniqueId);
-
-	stream.WriteInt32L(iEnableUI);
-
-	stream.CommitL();
-	CleanupStack::PopAndDestroy(&stream);
-
-	iSourceSinkData = buf->Ptr(0).AllocL();
-
-	CleanupStack::PopAndDestroy(buf);
-	}
-
-const TDesC8& CMMFileSourceSink::SourceSinkData() const
-	{
-	ASSERT(iSourceSinkData);
-	return *iSourceSinkData;
-	}
-
-CMMFileSourceSink::~CMMFileSourceSink()
-	{
-	iHandle.Close();
-	delete iFileName;
-	delete iSourceSinkData;
-	delete iUniqueId;
-	}
-
- CMMFileSourceSink* CMMFileSourceSink::NewLC(TUid aUid, const TMMSource& aSource)
-	{
-	CMMFileSourceSink* self = new (ELeave) CMMFileSourceSink(aUid);
-	CleanupStack::PushL(self);
-	self->ConstructL(aSource);
-	return self;
-	}
-
- CMMFileSourceSink* CMMFileSourceSink::NewL(TUid aUid, const TMMSource& aSource)
-	{
-	CMMFileSourceSink* sourcesink = CMMFileSourceSink::NewLC(aUid, aSource);
-	CleanupStack::Pop(sourcesink);
-	return sourcesink;
-	}
-
-void CMMFileSourceSink::ConstructL(const TMMSource& aSource)
-	{
-	iUniqueId = aSource.UniqueId().AllocL();
-	iIntent = aSource.Intent();
-	iEnableUI = aSource.IsUIEnabled();
-
-	if (aSource.SourceType() == KUidMMFileSource)
-		{
-		const TMMFileSource& fileSource = static_cast<const TMMFileSource&>(aSource);
-		iFileName = fileSource.Name().AllocL();
-
-		DoCreateFileSourceConfigDataL();
-		}
-	else if (aSource.SourceType() == KUidMMFileHandleSource)
-		{
-		const TMMFileHandleSource& fileHandleSource = static_cast<const TMMFileHandleSource&>(aSource);
-		iHandle.Duplicate(fileHandleSource.Handle());
-		iUsingFileHandle = ETrue;
-		iFileName = HBufC::NewMaxL(KMaxFileName);
-		TPtr fileNamePtr = iFileName->Des();
-		iHandle.Name(fileNamePtr);
-
-		DoCreateFileHandleSourceConfigDataL();
-		}
-	else
-		{
-		User::Leave(KErrNotSupported);
-		}
-	}
-
-void CMMSourceSink::EvaluateIntentL()
-	{
-	}
-
-void CMMFileSourceSink::EvaluateIntentL()
-	{
-	if (iUsingFileHandle)
-		{
-   		ContentAccess::CContent* Content = ContentAccess::CContent::NewLC(iHandle);
-   		Content->OpenContentLC(iIntent, *iUniqueId);
-   		CleanupStack::PopAndDestroy(2, Content);
-		}
-	else
-		{
-		ContentAccess::CContent* Content = ContentAccess::CContent::NewLC(*iFileName);
-   		Content->OpenContentLC(iIntent, *iUniqueId);
-   		CleanupStack::PopAndDestroy(2, Content);
-		}
-	}
-
-
-
- void CMMFileSourceSink::EvaluateIntentL(ContentAccess::TIntent aIntent)
-	{
-	if (iUsingFileHandle)
-		{
-   		ContentAccess::CContent* Content = ContentAccess::CContent::NewLC(iHandle);
-   		Content->OpenContentLC(aIntent, *iUniqueId);
-   		CleanupStack::PopAndDestroy(2, Content);
-		}
-	else
-		{
-		ContentAccess::CContent* Content = ContentAccess::CContent::NewLC(*iFileName);
-   		Content->OpenContentLC(aIntent, *iUniqueId);
-   		CleanupStack::PopAndDestroy(2, Content);
-		}
-	}
-
-void CMMFileSourceSink::DoCreateFileSourceConfigDataL()
-	{
-	CBufFlat* buf = CBufFlat::NewL(KExpandSize);
-	CleanupStack::PushL(buf);
-	RBufWriteStream stream;
-	stream.Open(*buf);
-	CleanupClosePushL(stream);
-
-	stream.WriteInt32L(KMMFileSourceUid.iUid);
-	stream.WriteInt32L(iFileName->Length());
-	stream.WriteL(*iFileName);
-	TInt length = 0;
-	if (iUniqueId != NULL)
-		length = iUniqueId->Length();
-	stream.WriteInt32L(length);
-	if (length>0)
-		stream.WriteL(*iUniqueId);
-
-	stream.WriteInt32L(iEnableUI);
-
-	stream.CommitL();
-	CleanupStack::PopAndDestroy(&stream);
-
-	iSourceSinkData = buf->Ptr(0).AllocL();
-
-	CleanupStack::PopAndDestroy(buf);
-	}
-
-
-
--- a/mmfenh/progressivedownload/ProgressiveDownloadUtility/src/mmfclientutility.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,447 +0,0 @@
-/*
-* Copyright (c) 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:  Progressive Download Utility  Client utility functions
-*
-*/
-
-
-
-#ifndef __MMF_CLIENT_UTILITY_H__
-#define __MMF_CLIENT_UTILITY_H__
-
-#include <mda/common/audio.h>
-#include <mda/common/gsmaudio.h>
-#include <mda/client/utility.h>
-#include <mmf/common/mmffourcc.h>
-#include <mmfformatimplementationuids.hrh>
-#include "mmf/server/mmffile.h"
-#include "mmf/server/mmfdes.h"
-#include "mmf/common/mmfcontroller.h"
-
-#include <f32file.h>
-#include <caf/content.h>
-#include <caf/data.h>
-
-
-class CMMSourceSink; // declared here.
-
-NONSHARABLE_CLASS( CMMSourceSink ): public CBase
-	{
-public:
-	 static CMMSourceSink* NewL(TUid aUid, const TDesC8& aDescriptor);
-	 static CMMSourceSink* NewLC(TUid aUid, const TDesC8& aDescriptor);
-
-	virtual ~CMMSourceSink();
-	virtual TUid SourceSinkUid() const;
-	virtual const TDesC8& SourceSinkData() const;
-
-	virtual void EvaluateIntentL();
-protected:
-	CMMSourceSink(TUid aUid);
-
-
-private:
-	void ConstructL(const TDesC8& aDescriptor);
-
-	const TUid iUid;
-	HBufC8* iBuf;
-	};
-
-
-
-
-
-class CMMFileSourceSink; // declared here.
-
-NONSHARABLE_CLASS( CMMFileSourceSink ): public CMMSourceSink
-	{
-public:
-    static CMMFileSourceSink* NewL(TUid aUid, const RFile& aFile);
-	 static CMMFileSourceSink* NewLC(TUid aUid, const RFile& aFile);
-
-	 static CMMFileSourceSink* NewL(TUid aUid, const TMMSource& aMMSource);
-	 static CMMFileSourceSink* NewLC(TUid aUid, const TMMSource& aMMSource);
-
-	const TDesC& UniqueId() const {return *iUniqueId;}
-
-	virtual ~CMMFileSourceSink();
-
-	const TDesC& FileName() const {return *iFileName;}
-	const TDesC8& SourceSinkData() const;
-
-	 void EvaluateIntentL(ContentAccess::TIntent aIntent);
-	virtual void EvaluateIntentL();
-
-protected:
-	CMMFileSourceSink(TUid aUid);
-
-private:
-	void ConstructL(const TMMSource& aSource);
-	void DoCreateFileSourceConfigDataL();
-	void ConstructL(const RFile& aFile);
-	void DoCreateFileHandleSourceConfigDataL();
-
-	TBool iUsingFileHandle;
-	RFile iHandle;
-	HBufC* iFileName;
-	HBufC8* iSourceSinkData;
-	HBufC* iUniqueId;
-	ContentAccess::TIntent iIntent;
-	TBool	iEnableUI;
-	};
-
-
-
-
-class CMMFMdaObjectStateChangeObserverCallback; // declared here.
-/**
-Active object utility class to allow the callback to be called asynchronously.
-This should help prevent re-entrant code in clients of the mediaframework.
-*/
-NONSHARABLE_CLASS( CMMFMdaObjectStateChangeObserverCallback ): public CActive
-	{
-public:
-	 static CMMFMdaObjectStateChangeObserverCallback* NewL(MMdaObjectStateChangeObserver& aCallback);
-	virtual ~CMMFMdaObjectStateChangeObserverCallback();
-	 void CallBack(CBase* aObject, TInt aPreviousState, TInt aCurrentState, TInt aErrorCode);
-private:
-	CMMFMdaObjectStateChangeObserverCallback(MMdaObjectStateChangeObserver& aCallback);
-	void RunL();
-	void DoCancel();
-private:
-	MMdaObjectStateChangeObserver& iCallback;
-	CBase* iObject;
-	TInt iPreviousState;
-	TInt iCurrentState;
-	TInt iErrorCode;
-	};
-
-class CMMFClientUtility; // declared here.
-
-NONSHARABLE_CLASS( CMMFClientUtility )
-	{
-public:
-	 static TUid ConvertMdaFormatUidToECOMWrite(TUid aMdaFormatUid);
-	 static TUid ConvertMdaFormatUidToECOMRead(TUid aMdaFormatUid);
-	 static TFourCC ConvertMdaCodecToFourCC(TMdaPackage& aCodec);
-	 static TInt GetFileHeaderData(const TDesC& aFileName, TDes8& aHeaderData, TInt aMaxLength);
-	 static HBufC8* GetFileExtensionL(const TDesC& aFileName);
-	static void PrioritiseControllersL(
-		const RMMFControllerImplInfoArray& aControllers,
-		const TDesC8& aHeaderDataPlayback,
-		const TDesC8& aFileExtensionPlayback,
-		const TDesC8& aHeaderDataRecord,
-		const TDesC8& aFileExtensionRecord,
-		RMMFControllerImplInfoArray& aPrioritisedControllers);
-	static TInt GetBestMatchL(const CMMFFormatImplementationInformation* format, const TDesC8& aHeaderData, const TDesC8& aFileExtension);
-
-private:
-	CMMFClientUtility();
-	};
-
-class CMMFUtilityFileInfo; // declared here.
-
-NONSHARABLE_CLASS( CMMFUtilityFileInfo ): public CBase
-	{
-public:
-
-	static CMMFUtilityFileInfo* NewL(TMMSource& aSource);
-	static CMMFUtilityFileInfo* NewLC(TMMSource& aSource);
-
-	~CMMFUtilityFileInfo();
-
-	TBool GetFileMimeTypeL(TDes8& aMimeType);
-	void  GetFileHeaderDataL(TDes8& aHeaderData, TInt aMaxLength);
-	TInt EvaluateIntent(ContentAccess::TIntent aIntent);
-
-private:
-	CMMFUtilityFileInfo();
-
-	void ConstructL(const TMMSource& aSource);
-
-private:
-	ContentAccess::CData* iData;
-	};
-
-inline CMMFUtilityFileInfo::CMMFUtilityFileInfo()
-	{
-	};
-
-/**
- * Mixin class that the user of the class CMMFFindAndOpenController must derive from.
- * @internalComponent
- */
-class MMMFFindAndOpenControllerObserver
-	{
-public:
-	/**
-	 * Callback function to indicate the success or failure
-	 * of an attempt to find and open a suitable controller and
-	 * to add a source and sink.
-	 * @see CMMFFindAndOpenController
-	 *
-	 * @param aError
-	 *        Indicates whether a controller has been opened sucessfully
-	 *        This is passed by reference, mainly for the audio recorder utility
-	 *        which opens two controllers: if the secondary controller (which is
-	 *        always opened first) fails to open, then the audio recorder utility
-	 *        may choose to set aError = KErrNone in the MfaocComplete() callback
-	 *        to indicate to CFindAndOpenControler() that it should continue
-	 *        to open the primary controller, even though opening the secondary failed.
-	 * @param aController
-	 *        A pointer to the controller that has been opened or has failed to open
-	 *        This is mainly for the audio recorder utility to indicate
-	 *        which controller (primary or secondary) has been opened.
-	 * @param aControllerUid
-	 *        the UID of the controller that has been opened
-	 * @param aSourceHandle
-	 *        a pointer to the source handle
-	 * @internalComponent
-	 *        a pointer to the sink handle
-	 */
-	virtual void MfaocComplete(
-		TInt& aError,
-		RMMFController* aController,
-		TUid aControllerUid = KNullUid,
-		TMMFMessageDestination* aSourceHandle = NULL,
-		TMMFMessageDestination* aSinkHandle = NULL) = 0;
-	};
-
-
-class CMMFFindAndOpenController; // declared here.
-/**
- * Utility class used by the MMF client API classes.
- * Finds and opens a suitable controller and adds a source and a sink
- * asynchronously. Completion is indicated asynchronously
- * using the MMMFFindAndOpenControllerObserver mixin class.
- *
- * @internalComponent
- */
-NONSHARABLE_CLASS( CMMFFindAndOpenController ): public CActive, public MMMFAddDataSourceSinkAsyncObserver
-	{
-public:
-	enum TControllerMode
-		{
-		EPlayback,
-		ERecord,
-		EConvert
-		};
-
-	enum TControllerNumber
-		{
-		EPrimaryController,
-		ESecondaryController
-		};
-
-	class TSourceSink
-		{
-	public:
-		 TSourceSink(TUid aUid, const TDesC8& aData = KNullDesC8);
-		 TSourceSink(TUid aUid, const RFile& aFile);
-
-		TUid iUid;
-		const TDesC8& iConfigData;
-		TBool iUseFileHandle;
-		RFile iFileHandle;
-		};
-
-
-
-
-public:
-	 static CMMFFindAndOpenController* NewL(MMMFFindAndOpenControllerObserver& aObserver);
-	virtual ~CMMFFindAndOpenController();
-
-	// from CActive
-	virtual void DoCancel();
-	virtual void RunL();
-
-	// from MMMFAddDataSourceSinkAsyncObserver
-	virtual void MadssaoAddDataSourceSinkAsyncComplete(TInt aError, const TMMFMessageDestination& aHandle);
-
-	 void Configure(
-		TUid aMediaId,
-		TMMFPrioritySettings aPrioritySettings,
-		CMMFPluginSelectionParameters::TMediaIdMatchType aMediaIdMatchType = CMMFPluginSelectionParameters::EAllowOnlySuppliedMediaIds);
-
-	 void ConfigureController(RMMFController& aController, CMMFControllerEventMonitor& aEventMonitor, TControllerMode aControllerMode = EPlayback);
-	 void ConfigureSecondaryController(RMMFController& aController, CMMFControllerEventMonitor& aEventMonitor, TControllerMode aControllerMode = EPlayback);
-	 void ConfigureSourceSink(
-		TSourceSink aSource,
-		TSourceSink aSink);
-	 void ConfigureSecondarySourceSink(
-		TSourceSink aSource,
-		TSourceSink aSink);
-
-
-	 void ConfigureSourceSink(
-		const TMMSource& aSource,
-		TSourceSink aSink);
-
-
-
-	 void OpenByFileSource(const TMMSource& aFileSource, const TDesC& aFileNameSecondary = KNullDesC);
-
-	 void OpenByFilename(const TDesC& aFileName, const TDesC& aFileNameSecondary = KNullDesC);
-	 void OpenByFileHandle(const RFile& aFile);
-
-
-	 void OpenByFormatUid(TUid aFormatUid, TUid aFormatUidSecondary = KNullUid);
-	 void OpenByDescriptor(const TDesC8& aDescriptor);
-	 void OpenByUrl(const TDesC& aUrl, TInt aIapId, const TDesC8& aMimeType);
-	 void OpenByControllerUid(TUid aControllerUid, TUid aSecondaryControllerUid = KNullUid);
-	 void ReOpen();
-	 void Close();
-
-	 static TMMFFileConfig GetConfigFile(const TDesC& aFileName);
-	 static TMMFDescriptorConfig GetConfigDescriptor(const TDesC8& aDescriptor);
-	 static TInt GetConfigUrl(CBufFlat*& aUrlCfgBuffer, const TDesC& aUrl, TInt aIapId);
-
-private:
-	class CConfig: public CBase
-		{
-	public:
-		CConfig();
-		~CConfig();
-		void Close();
-	public:
-		RMMFController* iController;				// not owned
-		CMMFControllerEventMonitor* iEventMonitor;	// not owned
-
-		/** indicates whether this controller is being used for
-		playback, recording or converting */
-		TControllerMode iControllerMode;
-
-		CMMSourceSink* iSource;
-		CMMSourceSink* iSink;
-		TUid iControllerUid;
-		};
-
-	CMMFFindAndOpenController(MMMFFindAndOpenControllerObserver& aObserver);
-	void ConstructL();
-
-	void Init();
-
-	void ConfigureSourceSink(
-		CConfig& config,
-		TSourceSink aSource,
-		TSourceSink aSink);
-
-
-	void ConfigureSourceSink(
-		CConfig& config,
-		const TMMSource& aSource,
-		TSourceSink aSink);
-
-
-
-	void ConfigureController(
-		CConfig& config,
-		RMMFController& aController,
-		CMMFControllerEventMonitor& aEventMonitor,
-		TControllerMode aControllerMode);
-
-	void CloseController();
-
-	void OpenPrimaryController(void);
-
-	void KickState();
-	void Process();
-	void SendError(TInt aError = KErrNone);
-	void SchedSendError(TInt aError = KErrNone);
-	void BuildControllerListFileNameL();
-	void BuildControllerListDescriptorL();
-	void BuildControllerListUrlL();
-	void BuildControllerListFormatL();
-	void TryNextController();
-
-	CMMSourceSink* CreateSourceSinkL(const TSourceSink& aParams);
-
-	CMMSourceSink* CreateSourceSinkL(const TMMSource& aSource);
-
-
-private:
-	/** primary controller details */
-	CConfig* iPrimaryConfig;
-	/** secondary controller details */
-	CConfig* iSecondaryConfig;
-	/** points to either iPrimaryConfig or iSecondaryConfig */
-	CConfig* iCurrentConfig;	// not owned
-
-	enum TMode
-		{
-		EOpenByControllerUid,
-		EOpenByFileName,
-		EOpenByDescriptor,
-		EOpenByUrl,
-		EOpenByFormatUid
-		};
-	TMode iMode;
-
-	/** indicates what state the state machine is in */
-	enum TState
-		{
-		EIdle,
-		EBuildControllerList,
-		EOpenController,
-		EAddSource,
-		EAddSink,
-		EWaitingForSource,
-		EWaitingForSink,
-		ESendError
-		};
-	TState iState;
-
-	MMMFFindAndOpenControllerObserver& iObserver;
-	CMMFAddDataSourceSinkAsync* iAddDataSourceSinkAsync;
-
-	TInt iControllerIndex;
-	TInt iControllerCount;
-
-	TFileName iFileNameSecondary;	// for converting
-
-	TFileName iFileName;
-	TBool iUseFileHandle;
-	TBool iUseFileSource;
-	HBufC* iUniqueId;
-	RFile iFileHandle;
-	ContentAccess::TIntent iIntent;
-
-	HBufC* iUrl;
-	HBufC8* iMimeType;
-	TPtr8 iDescriptor;
-	TInt iIapId;
-	TUid iFormatUid;
-	TUid iFormatUidSecondary;	// for converting
-
-	TUid iMediaId;
-	TMMFPrioritySettings iPrioritySettings;
-	CMMFPluginSelectionParameters::TMediaIdMatchType iMediaIdMatchType;
-
-	RMMFControllerImplInfoArray iControllers;
-	RMMFControllerImplInfoArray iPrioritisedControllers;
-
-	// if this is non-null, then it points to an element in
-	// either iControllers or iPrioritisedControllers
-	CMMFControllerImplementationInformation* iControllerImplInfo;	// not owned
-
-	TControllerMode iControllerMode;
-	TBool iSourceSinkConfigured;
-	TInt iError;
-
-	TMMFMessageDestination iSourceHandle;
-	TMMFMessageDestination iSinkHandle;
-	};
-
-#endif
--- a/mmfenh/progressivedownload/group/bld.inf	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
-* Copyright (c) 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 ProgressiveDownloadUtility
-*
-*/
-
-
-#include <platform_paths.hrh>
-
-PRJ_PLATFORMS
-
-DEFAULT
-
-PRJ_EXPORTS
-../Data/ProgressiveDownload_Stub.SIS   /epoc32/data/z/system/install/ProgressiveDownload_Stub.SIS
-../rom/progressivedownload.iby         CORE_MW_LAYER_IBY_EXPORT_PATH(progressivedownload.iby)
-
-
-PRJ_MMPFILES
-#ifdef __SERIES60_NATIVE_BROWSER
-#ifdef RD_PROGDOWNLOAD
-../ProgressiveDownloadSource/group/ProgressiveDownloadSource.mmp
-../ProgressiveDownloadUtility/group/PDProperties.mmp
-../ProgressiveDownloadUtility/group/ProgressiveDownloadUtility.mmp
-#endif
-#endif
-
-PRJ_TESTMMPFILES
-#ifdef __SERIES60_NATIVE_BROWSER
-#ifdef RD_PROGDOWNLOAD
-//../internal/progdownloadtestapp/group/progdownload.mmp
-#endif
-#endif
--- a/mmfenh/progressivedownload/rom/progressivedownload.iby	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 ProgressiveDownloadUtility
-*
-*/
-
-
-
-
-#ifndef PROGRESSIVEDOWNLOAD_IBY
-#define PROGRESSIVEDOWNLOAD_IBY
-
-#ifdef __SERIES60_NATIVE_BROWSER
-#ifdef RD_PROGDOWNLOAD
-
-file=ABI_DIR\BUILD_DIR\ProgressiveDownloadUtility.dll     SHARED_LIB_DIR\ProgressiveDownloadUtility.dll
-file=ABI_DIR\BUILD_DIR\PDProperties.dll                     SHARED_LIB_DIR\PDProperties.dll
-
-// For ProgressiveDownload DataSource
-ECOM_PLUGIN(ProgressiveDownloadSource.dll, ProgressiveDownloadSource.rsc)
-
-#endif
-#endif
-
-// PROGRESSIVEDOWNLOAD STUB
-data=ZSYSTEM\install\ProgressiveDownload_Stub.SIS    System\Install\ProgressiveDownload_Stub.SIS
-
-
-#endif //PROGRESSIVEDOWNLOAD_IBY
-
-
--- a/mmmw_plat/audio_metadata_reader_api/inc/MetaDataField.hrh	Mon May 03 12:59:52 2010 +0300
+++ b/mmmw_plat/audio_metadata_reader_api/inc/MetaDataField.hrh	Fri May 14 16:22:35 2010 +0300
@@ -22,38 +22,40 @@
 
 // DATA TYPES
 enum TMetaDataFieldId		// Possible metadata fields
-	{
-	EUnknownMetaDataField = 0,
+    {
+    EUnknownMetaDataField = 0,
 
-	EMetaDataSongTitle = 1,
-	EMetaDataArtist,
-	EMetaDataAlbum,
-	EMetaDataYear,
-	EMetaDataComment,
-	EMetaDataAlbumTrack,
-	EMetaDataGenre,
-	EMetaDataComposer,
-	EMetaDataCopyright,
-	EMetaDataOriginalArtist,
-	EMetaDataUrl,
-	EMetaDataUserUrl,
-	EMetaDataJpeg,
-	EMetaDataVendor,
-	EMetaDataRating,
-	EMetaDataUniqueFileIdentifier,
-	EMetaDataDuration,
-	EMetaDataDate,
-	EMetaDataUnsyncLyrics
-	// More later...
-	};
+    EMetaDataSongTitle = 1,
+    EMetaDataArtist,
+    EMetaDataAlbum,
+    EMetaDataYear,
+    EMetaDataComment,
+    EMetaDataAlbumTrack,
+    EMetaDataGenre,
+    EMetaDataComposer,
+    EMetaDataCopyright,
+    EMetaDataOriginalArtist,
+    EMetaDataUrl,
+    EMetaDataUserUrl,
+    EMetaDataJpeg,
+    EMetaDataVendor,
+    EMetaDataRating,
+    EMetaDataUniqueFileIdentifier,
+    EMetaDataDuration,
+    EMetaDataDate,
+    EMetaDataUnsyncLyrics,
+    EMetaDataProtected        // get the Protected info, "0"=non protected, "1"=protected
+	
+    // More later...
+    };
 
 // ENUM for ID3 Version
 enum TID3Version
-	{
-	ENonID3,
-	EID3Version1,
-	EID3Version2
-	};
+    {
+    ENonID3,
+    EID3Version1,
+    EID3Version2
+    };
 
 #endif      // CMETADATAFIELD_HRH
 
--- a/mmmw_plat/audio_output_control_utility_api/tsrc/AudioOutputControlTestClass/inc/AudioOutputControlTestClass.h	Mon May 03 12:59:52 2010 +0300
+++ b/mmmw_plat/audio_output_control_utility_api/tsrc/AudioOutputControlTestClass/inc/AudioOutputControlTestClass.h	Fri May 14 16:22:35 2010 +0300
@@ -42,7 +42,6 @@
 #include <StreamControl.h>
 #include <ControlObserver.h>
 #include <Events.h>
-#include <ProgDLSource.h>
 #include <DataBufferSource.h>
 #include <FileSource.h>
 #include <DataBuffer.h>
@@ -109,7 +108,6 @@
 
 using multimedia::MStreamControl;
 using multimedia::MControlObserver;
-using multimedia::MProgDLSource;
 using multimedia::MDataBufferSource;
 using multimedia::MDescriptorSource;
 using multimedia::MDataBuffer;
--- a/mmmw_plat/emc_progressive_download_source_api/emc_progressive_download_source_api.metaxml	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-<?xml version="1.0" ?>
-<api id="395db82b74d00371df870fcb8d6e4b4e" dataversion="2.0">
-  <name>EMC Progressive Download Source API</name>
-  <description>This API defines a Progressive Download Source API for progressively downloading media file on the S60 platform using Enhanced Audio Playback API.</description>
-  <type>c++</type>
-  <collection>audioenhancements</collection>
-  <libs>
-    <lib name="EnhancedMediaClient.lib" />
-  </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/emc_progressive_download_source_api/group/bld.inf	Mon May 03 12:59:52 2010 +0300
+++ /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 
-:                EMC Progressive Download Source API
-*
-*/
-
-
-#include <platform_paths.hrh>
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_EXPORTS
-
-../inc/ProgDLSource.h     MW_LAYER_PLATFORM_EXPORT_PATH(ProgDLSource.h)
--- a/mmmw_plat/emc_progressive_download_source_api/inc/ProgDLSource.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +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:  Header of ProgDLSource class.
-*
-*/
-
-
-#ifndef PROGDLSOURCE_H
-#define PROGDLSOURCE_H
-
-#include <e32base.h>
-#include <SourceControl.h>
-
-namespace multimedia
-    {
-    
-    const TUid KProgDLSourceControl = {0x10207B43};
-    
-
-    // Class declaration
-    class MProgDLSource : public MSourceControl
-        {
-        public:
-        
-            enum TDownloadStatus
-            {
-                EUnknown,
-                EConnecting,
-                EStarted,
-                EPaused,
-                EFailed,
-                EDeleted,
-                ECompleted
-            };
-            
-            // Control msg
-            virtual TInt Open(const TDesC& aFileName,TInt32 aDLTxId ) = 0;
-            virtual TInt MoveFile(const TDesC& aDestFileName ) = 0;
-            virtual TInt CancelDownload() = 0;
-            virtual TInt ResumeDownload() = 0;
-            virtual TInt GetCurrentFileSize( TUint& aSize ) = 0;
-            virtual TInt GetExpectedFileSize( TUint& aSize ) = 0;
-            virtual TDownloadStatus GetDownloadStatus() = 0;
-            virtual TInt IsDownloadComplete(TBool& aBool) = 0;
-            virtual TInt GetPercentageDownloaded(TUint& aPercent) = 0;
-            virtual TInt GetPercentageBuffered(TUint& aPercent) = 0;            
-            virtual TInt GetDownloadingRate(TUint& aRate) = 0;
-            virtual TInt GetBitRate(TUint& aRate) = 0;
-            virtual TInt FileName(TPtr& aFileName) = 0;            
-        };
-    } // namespace multimedia
-
-#endif // PROGDLSOURCE_H
-
-// End of file
--- a/mmmw_plat/enhanced_media_client_api/tsrc/Conf/EnhanMediaTestClass.cfg	Mon May 03 12:59:52 2010 +0300
+++ b/mmmw_plat/enhanced_media_client_api/tsrc/Conf/EnhanMediaTestClass.cfg	Fri May 14 16:22:35 2010 +0300
@@ -1231,82 +1231,6 @@
 [Endtest]
 
 
-
-#[Test]
-#title 22. MP3-PDLS EMC Download
-#create EnhanMediaTestClass AudioEnhs
-#AudioEnhs CreateFactory
-#AudioEnhs Gen_StartProgDL http:\/\/10.123.32.53/sugarsugar-50KB.mp3 "Ethernet with Daemon Dynamic IP" C:\test.mp3
-#AudioEnhs CreateStream
-#AudioEnhs AddObserver 3
-#AudioEnhs CreateSource 6
-#AudioEnhs AddObserver 6
-#AudioEnhs CreateSink 4
-#AudioEnhs AddObserver 4
-#AudioEnhs StreamAddSource 6
-#AudioEnhs StreamAddSink 4
-#AudioEnhs PDLSOpenL
-#AudioEnhs StreamOpen
-#waittestclass AudioEnhs
-#AudioEnhs StreamStart
-#pause 10000
-#AudioEnhs StreamPause
-#AudioEnhs PDLSGetCurFileSizeL
-#AudioEnhs PDLSGetExpFileSizeL
-#AudioEnhs PDLSGetDLStatusL
-#AudioEnhs PDLSIsDLCompleteL
-#AudioEnhs PDLSGetPerDownloadedL
-#AudioEnhs PDLSGetPerBufferedL
-#AudioEnhs PDLSGetDLRateL
-#AudioEnhs PDLSGetBitRateL
-#AudioEnhs PDLSResumeDownloadL
-#AudioEnhs Control_Type 6
-#AudioEnhs Control_ControlType 6
-#AudioEnhs PDLSGetSize
-#pause 10000
-#AudioEnhs StreamStart
-#AudioEnhs PDLSMoveFileL c:\testing\data\test1.mp3
-#//pause 7000
-#//AudioEnhs StreamStop
-#//pause 2000
-#AudioEnhs StreamClose
-#AudioEnhs RemoveObserver 4
-#AudioEnhs RemoveObserver 6
-#AudioEnhs RemoveObserver 3
-#AudioEnhs DeleteStream
-#AudioEnhs DeleteSink 
-#AudioEnhs DeleteSource
-#AudioEnhs DeleteFactory
-#delete AudioEnhs
-#[Endtest] 
-
-#[Test]
-#title 23 MP3-PDLS EMC CancelDownload
-#create EnhanMediaTestClass AudioEnhs
-#AudioEnhs CreateFactory
-#AudioEnhs Gen_StartProgDL http:\/\/10.123.32.53/sugarsugar-50KB.mp3 "Ethernet with Daemon Dynamic IP" C:\test.mp3
-#AudioEnhs CreateStream
-#AudioEnhs AddObserver 3
-#AudioEnhs CreateSource 6
-#AudioEnhs AddObserver 6
-#AudioEnhs CreateSink 4
-#AudioEnhs AddObserver 4
-#AudioEnhs StreamAddSource 6
-#AudioEnhs StreamAddSink 4
-#AudioEnhs PDLSOpenL
-#pause 3000
-#AudioEnhs PDLSCancelDownloadL
-#pause 4000
-#AudioEnhs RemoveObserver 4
-#AudioEnhs RemoveObserver 6
-#AudioEnhs RemoveObserver 3
-#AudioEnhs DeleteStream
-#AudioEnhs DeleteSink 
-#AudioEnhs DeleteSource
-#AudioEnhs DeleteFactory
-#delete AudioEnhs
-#[Endtest] 
-
 #[ER_DecayHFRatio]    		ERDecayHFRatioL = 50
 #[ER_DecayHFRatioRange]    	ERDecayHFRatioRangeL = Min[10] Max[200]
 #[ER_DecayTime]    		ERDecayTimeL = 1000
--- a/mmmw_plat/enhanced_media_client_api/tsrc/EnhanMediaTestClass/EABI/EnhanMediaTestClassu.def	Mon May 03 12:59:52 2010 +0300
+++ b/mmmw_plat/enhanced_media_client_api/tsrc/EnhanMediaTestClass/EABI/EnhanMediaTestClassu.def	Fri May 14 16:22:35 2010 +0300
@@ -1,5 +1,5 @@
 EXPORTS
 	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
-	_ZTI14CSimpleTimeout @ 2 NONAME ; #<TI>#
-	_ZTV14CSimpleTimeout @ 3 NONAME ; #<VT>#
+	_ZTI14CSimpleTimeout @ 2 NONAME
+	_ZTV14CSimpleTimeout @ 3 NONAME
 
--- a/mmmw_plat/enhanced_media_client_api/tsrc/EnhanMediaTestClass/inc/EnhanMediaTestClass.h	Mon May 03 12:59:52 2010 +0300
+++ b/mmmw_plat/enhanced_media_client_api/tsrc/EnhanMediaTestClass/inc/EnhanMediaTestClass.h	Fri May 14 16:22:35 2010 +0300
@@ -37,7 +37,6 @@
 #include <SourceControl.h>
 #include <ControlObserver.h>
 #include <Events.h>
-#include <ProgDLSource.h>
 #include <DataBufferSource.h>
 #include <FileSource.h>
 #include <DataBuffer.h>
@@ -71,10 +70,8 @@
 
 #include "CEMCConstants.h"
 
-#include <DownloadMgrClientApiExt.h>
 using multimedia::MStreamControl;
 using multimedia::MControlObserver;
-using multimedia::MProgDLSource;
 using multimedia::MDataBufferSource;
 using multimedia::MDescriptorSource;
 using multimedia::MDataBuffer;
@@ -119,8 +116,7 @@
 */
 NONSHARABLE_CLASS(CEnhanMediaTestClass) : public CScriptBase,
 										  public MTimeoutObserver
-										  ,public MControlObserver,
-										  public MHttpDownloadMgrObserver
+										  ,public MControlObserver
 											//public MDevSoundObserver,
 											//public MMdaAudioOutputStreamCallback
 										//	public MRadioFmTunerObserver,
@@ -140,14 +136,6 @@
         virtual ~CEnhanMediaTestClass();
 
         void Event( MControl* aObject,TUint aEvent, TAny* aData );
-        /**
-        * From MhttpDownloadMgrObserver.
-        * Callback from the DownloadManager notifying Client Events.
-        * @since S60 v3.2
-        * @param aDownload Download for which the Event is meant
-        * @param aEvent Actual Event
-        */
-        void HandleDMgrEventL( RHttpDownload& aDownload, THttpDownloadEvent aEvent );
 
 		enum TAEnhsExpectedEvent
 		{
@@ -417,21 +405,6 @@
 
 	    TInt CreateSeekableData(CStifItemParser& aItem);
 
-	    TInt GeneralGen_StartProgDLL(CStifItemParser& aItem);
-	    TInt PDLSOpenL(CStifItemParser& aItem);
-	    TInt PDLSGetCurFileSizeL(CStifItemParser& aItem);
-	    TInt PDLSGetExpFileSizeL(CStifItemParser& aItem);
-	    TInt PDLSGetDLStatusL(CStifItemParser& aItem);
-	    TInt PDLSIsDLCompleteL(CStifItemParser& aItem);
-	    TInt PDLSGetPerDownloadedL(CStifItemParser& aItem);
-	    TInt PDLSGetPerBufferedL(CStifItemParser& aItem);
-	    TInt PDLSGetDLRateL(CStifItemParser& aItem);
-	    TInt PDLSGetBitRateL(CStifItemParser& aItem);
-	    TInt PDLSResumeDownloadL(CStifItemParser& aItem);
-	    TInt PDLSMoveFileL(CStifItemParser& aItem);
-	    TInt PDLSGetSize(CStifItemParser& aItem);
-	    TInt PDLSCancelDownloadL(CStifItemParser& aItem);
-
 	    TInt AudioEffectIsEnabled (CStifItemParser& aItem);
 
 	    TInt HandleAudioEffectEnableL(CStifItemParser& aItem);
@@ -557,7 +530,6 @@
         MSourceControl* iSourceControl;
         RPointerArray<MDataBuffer>  iBuffers;
         RArray<TInt> iAvailable;
-        MProgDLSource* iMProgDLSource;
         MEqualizerControl* iMEqualizerControl;
         MBassBoostControl* iMBassBoostControl;
         MVolumeControl* iMVolumeControl;
@@ -597,20 +569,6 @@
 
         TInt iAllowedDevice;
 
-        // Url used to Open the PDL
-        HBufC8*  iUrlName;
-        // Download Manager instance to which we connect
-        RHttpDownloadMgrApiExt  iDownloadMgr;
-        // Whether the DMgr is connected or not
-        TBool iDMgrConnected;
-        // Download for which we connect
-        RHttpDownload* iDownload;
-        // Current Download ID
-        TInt32 iDownloadId;
-        // Temp FileName
-        HBufC* iAccessPtName;
-
-
         CActiveSchedulerWait* iActive;
     	// ?one_line_short_description_of_data
         //?data_declaration;
--- a/mmmw_plat/enhanced_media_client_api/tsrc/EnhanMediaTestClass/src/EnhanMediaTestCallbacks.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmmw_plat/enhanced_media_client_api/tsrc/EnhanMediaTestClass/src/EnhanMediaTestCallbacks.cpp	Fri May 14 16:22:35 2010 +0300
@@ -94,14 +94,6 @@
  			    {
  			    switch (aEventType)
 			        {
-			        case MSourceControlObserver::KPercentageDownloadedChangedEvent:
-			        	{
-			        	TUint percent;
-			        	MProgDLSource* control1 = (MProgDLSource*)(aControl);
-			        	control1->GetPercentageBuffered(percent);
-			            iLog->Log(_L("KPercentageDownloadedChangedEvent"));
-			        	}
-			            break;
 			        case MSourceControlObserver::KBufferingTypesSupportChangedEvent:
 			        	{
 			            iLog->Log(_L("KBufferingTypesSupportChangedEvent"));
@@ -122,73 +114,12 @@
 			            iLog->Log(_L("CEnhanMediaTestClass::Event:BitRateChanged[%d]"),rate);
 			        	}
 			            break;
-			        case MSourceControlObserver::KDownloadStatusChangedEvent:
-			            {
-			            MProgDLSource* control1 = (MProgDLSource*)(aControl);
-			            RDebug::Print(_L("CMPlayerAudioUIController::Event:DownloadStatus[%d]"),control1->GetDownloadStatus());
-			            iLog->Log(_L("CMPlayerAudioUIController::Event:DownloadStatus[%d]"),control1->GetDownloadStatus());
-			            switch(control1->GetDownloadStatus())
-			            	{
-
-			            	case MProgDLSource::EConnecting:
-			            	    {
-			            	    RDebug::Print(_L("CEnhanMediaTestClass::Event:DownloadStatus [connecting]"));
-					            iLog->Log(_L("CEnhanMediaTestClass::Event:DownloadStatus [connecting]"));
-			            	    }
-			            	    break;
-
-			            	case MProgDLSource::EStarted:
-			            		{
-			            		RDebug::Print(_L("CEnhanMediaTestClass::Event:DownloadStatus [started]"));
-					            iLog->Log(_L("CEnhanMediaTestClass::Event:DownloadStatus [started]"));
-			            		}
-			            	    break;
-
-			            	case MProgDLSource::EPaused:
-			            		{
-			            	    RDebug::Print(_L("CEnhanMediaTestClass::Event:DownloadStatus [paused]"));
-					            iLog->Log(_L("CEnhanMediaTestClass::Event:DownloadStatus [paused]"));
-			            		}
-			            	    break;
-
-			            	case MProgDLSource::EDeleted:
-			            		{
-			            	    RDebug::Print(_L("CEnhanMediaTestClass::Event:DownloadStatus [deleted]"));
-					            iLog->Log(_L("CEnhanMediaTestClass::Event:DownloadStatus [deleted]"));
-			            		}
-			                    break;
-			            	case MProgDLSource::ECompleted:
-			            		{
-			            	    RDebug::Print(_L("CEnhanMediaTestClass::Event:DownloadStatus [completed]"));
-					            iLog->Log(_L("CEnhanMediaTestClass::Event:DownloadStatus [completed]"));
-			            		}
-			            	    break;
-			   	            case MProgDLSource::EFailed:
-			                    {
-			        	        RDebug::Print(_L("CEnhanMediaTestClass::Event:DownloadStatus [failed]"));
-					            iLog->Log(_L("CEnhanMediaTestClass::Event:DownloadStatus [failed]"));
-			                    break;
-			                    }
-			    	        case MProgDLSource::EUnknown:
-			        	        {
-			        	        RDebug::Print(_L("CEnhanMediaTestClass::Event:DownloadStatus [EUnknown]"));
-					            iLog->Log(_L("CEnhanMediaTestClass::Event:DownloadStatus [EUnknown]"));
-			        	        }
-			        	        break;
-			            	default:
-			            	  break;
-			            	}
-			            }
-			            break;
-
 			        case MSourceControlObserver::KFileMoveCompleteEvent:
 			            {
 				            RDebug::Print(_L("CEnhanMediaTestClass::Event:KFileMoveCompleteEvent"));
 				            iLog->Log(_L("CEnhanMediaTestClass::Event:KFileMoveCompleteEvent"));
 			            }
 			            break;
-
-
 			        };
 			    }
        			break;
@@ -213,54 +144,4 @@
 		};
 	}
 
-
-void CEnhanMediaTestClass::HandleDMgrEventL( RHttpDownload& aDownload, THttpDownloadEvent aEvent )
-    {
-    RDebug::Print(_L("HandleDMgrEventL DownloadState[%d] ProgressState[%d]"),aEvent.iDownloadState,aEvent.iProgressState);
-    iLog->Log(_L("HandleDMgrEventL DownloadState[%d] ProgressState[%d]"),aEvent.iDownloadState,aEvent.iProgressState);
-
-    TInt32 downloadSize = 0;
-    TInt32 length = 0;
-    TInt status = aDownload.GetIntAttribute(EDlAttrDownloadedSize, downloadSize);
-    status = aDownload.GetIntAttribute(EDlAttrLength, length);
-
-
-    TInt percentageDL = (downloadSize*100/length);
-
-    if(percentageDL > 8 && iActive->IsStarted())
-        {
-        iActive->AsyncStop();
-        }
-
-    //iLog->Log(_L("iMProgDLSource->GetDownloadingRate = [%d]"),rate);
-   // RDebug::Print(_L("CEnhanMediaTestClass::Event:EStateChanged[Opened]"));
-
-
-    if(aEvent.iDownloadState == EHttpDlPaused)
-        {
-        iDownload->Start();
-        }
-
-    if(aEvent.iDownloadState == EHttpDlCreated)
-        {
-        iLog->Log(_L("EHttpDlCreated"));
-        }
-
-    if(aEvent.iDownloadState == EHttpDlInprogress)
-        {
-        iLog->Log(_L("EHttpDlInprogress "));
-        }
-    if(aEvent.iDownloadState == EHttpDlPaused)
-        {
-        iLog->Log(_L("EHttpDlPaused "));
-        }
-    if(aEvent.iDownloadState == EHttpDlCompleted)
-        {
-        iLog->Log(_L("EHttpDlCompleted "));
-        }
-    if(aEvent.iDownloadState == EHttpDlFailed)
-        {
-        iLog->Log(_L("EHttpDlFailed "));
-        }
-    }
 // End of File
--- a/mmmw_plat/enhanced_media_client_api/tsrc/EnhanMediaTestClass/src/EnhanMediaTestClassBlocks.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmmw_plat/enhanced_media_client_api/tsrc/EnhanMediaTestClass/src/EnhanMediaTestClassBlocks.cpp	Fri May 14 16:22:35 2010 +0300
@@ -206,23 +206,6 @@
 
         ENTRY( "DSGetSize", CEnhanMediaTestClass::DSGetSize ),
 
-        ENTRY( "DSGetSize", CEnhanMediaTestClass::GeneralGen_StartProgDLL ),
-
-        ENTRY( "Gen_StartProgDL",CEnhanMediaTestClass::GeneralGen_StartProgDLL ),
-        ENTRY( "PDLSOpenL",CEnhanMediaTestClass::PDLSOpenL ),
-        ENTRY( "PDLSGetCurFileSizeL",CEnhanMediaTestClass::PDLSGetCurFileSizeL ),
-        ENTRY( "PDLSGetExpFileSizeL",CEnhanMediaTestClass::PDLSGetExpFileSizeL ),
-        ENTRY( "PDLSGetDLStatusL",CEnhanMediaTestClass::PDLSGetDLStatusL ),
-        ENTRY( "PDLSIsDLCompleteL",CEnhanMediaTestClass::PDLSIsDLCompleteL ),
-        ENTRY( "PDLSGetPerDownloadedL",CEnhanMediaTestClass::PDLSGetPerDownloadedL ),
-        ENTRY( "PDLSGetPerBufferedL",CEnhanMediaTestClass::PDLSGetPerBufferedL ),
-        ENTRY( "PDLSGetDLRateL",CEnhanMediaTestClass::PDLSGetDLRateL ),
-        ENTRY( "PDLSGetBitRateL",CEnhanMediaTestClass::PDLSGetBitRateL ),
-        ENTRY( "PDLSResumeDownloadL",CEnhanMediaTestClass::PDLSResumeDownloadL ),
-        ENTRY( "PDLSMoveFileL",CEnhanMediaTestClass::PDLSMoveFileL ),
-        ENTRY( "PDLSCancelDownloadL",CEnhanMediaTestClass::PDLSCancelDownloadL ),
-        ENTRY( "PDLSGetSize",CEnhanMediaTestClass::PDLSGetSize ),
-
         ENTRY( "AudioEffect_IsEnabled",CEnhanMediaTestClass::AudioEffectIsEnabled ),
         ENTRY( "AudioEffect_IsEnforced",CEnhanMediaTestClass::AudioEffectIsEnforced ),
         ENTRY( "AudioEffect_Uid",CEnhanMediaTestClass::AudioEffectUid ),
@@ -328,7 +311,6 @@
 		(TText*)L"EEStreamOpen",
 		(TText*)L"EEStreamPrime",
 		(TText*)L"EEStreamStart",
-		(TText*)L"EEPDLSOpen",
 
 	};
 	if( (TUint)aKey >= (sizeof( keywords )/sizeof(TText*)) )
@@ -625,15 +607,7 @@
         delete iDRMConfigIntfc;
         iDRMConfigIntfc = NULL;
         }
-    if(iUrlName)
-        {
-        delete iUrlName;
-        }
-
-    if(iAccessPtName)
-        {
-        delete iAccessPtName;
-        }
+
    // ProcessEvent(EECreateFactory, error);
 /*	for (TUint i =0; i < iExpectedEvents.Count() ; i++)
 		{
@@ -680,15 +654,6 @@
                 }
             break;
             }
-        case EPDLSOURCE:
-            {
-            status = iFactory->CreateSourceControl( KProgDLSourceControl, iSourceControl );
-            if(status == KErrNone)
-                {
-                iMProgDLSource = static_cast<MProgDLSource*>(iSourceControl);
-                }
-            break;
-            }
         default:
         	{
         	status = KErrNotSupported;
@@ -732,12 +697,6 @@
         iFactory->DeleteSourceControl(objPtr);
         iMFileSource = NULL;
         }
-    if(iMProgDLSource)
-        {
-        MSourceControl* objPtr = iMProgDLSource;
-        iFactory->DeleteSourceControl(objPtr);
-        iMProgDLSource = NULL;
-        }
     iLog->Log(_L("DeleteSourceControl OK"));
     //ProcessEvent(EECreateSource, status);
 	return status;
@@ -1563,18 +1522,6 @@
                 }
 	        break;
 	        }
-        case EPDLSOURCE:
-	        {
-	        if(iMProgDLSource)
-	            {
-                iMProgDLSource->AddObserver(*this);
-	            }
-            else
-                {
-                status = KErrNotFound;
-                }
-	        break;
-	        }
         case EVOLUMECONTROL:
 	        {
 	        if(iMVolumeControl)
@@ -2054,11 +2001,6 @@
             iSourceControl = iMDescriptorSource;
             }
             break;
-        case EPDLSOURCE:
-            {
-            iSourceControl = iMProgDLSource;
-            }
-            break;
         }
 
 	status = iMStreamControl->RemoveSource(*iSourceControl);
@@ -2099,11 +2041,6 @@
             iSourceControl = iMDescriptorSource;
             }
             break;
-        case EPDLSOURCE:
-            {
-            iSourceControl = iMProgDLSource;
-            }
-            break;
         }
 	status = iMStreamControl->AddSource(*iSourceControl);
     if (status == KErrNone)
@@ -2195,10 +2132,6 @@
 	else
 		{
 	        iLog->Log(_L("iMStreamControl->GetState() = %d"), state);
-	        if (iMProgDLSource)
-	        	{
-	        	status = iMProgDLSource->Close();
-	        	}
 			status = iMStreamControl->Close();
 	        iLog->Log(_L("iMStreamControl->GetState() = %d"), iMStreamControl->GetState());
 
@@ -2282,18 +2215,6 @@
                 }
 	        break;
 	        }
-        case EPDLSOURCE:
-	        {
-	        if(iMProgDLSource)
-	            {
-                iMProgDLSource->RemoveObserver(*this);
-	            }
-            else
-                {
-                status = KErrNotFound;
-                }
-	        break;
-	        }
         case EVOLUMECONTROL:
 	        {
 	        if(iMVolumeControl)
@@ -3628,18 +3549,6 @@
                 }
 	        break;
 	        }
-        case EPDLSOURCE:
-	        {
-	        if(iMProgDLSource)
-	            {
-                controlUid = iMProgDLSource->Type();
-	            }
-            else
-                {
-                status = KErrNotFound;
-                }
-	        break;
-	        }
 	    }
     iLog->Log(_L("CEnhanMediaTestClass::ControlTypeL  = [%d]"),control);
 	return status;
@@ -3737,18 +3646,6 @@
                 }
 	        break;
 	        }
-        case EPDLSOURCE:
-	        {
-	        if(iMProgDLSource)
-	            {
-				controlType = iMProgDLSource->ControlType();
-	            }
-            else
-              {
-              status = KErrNotFound;
-              }
-	        break;
-	        }
 	    }
     iLog->Log(_L("CEnhanMediaTestClass::ControlControlTypeL = [%d]"),control);
     return status;
@@ -3987,378 +3884,6 @@
     return status;
     }
 
-TInt CEnhanMediaTestClass::GeneralGen_StartProgDLL(CStifItemParser& aItem)
-    {
-    TInt status = KErrNone;
-    TPtrC string;
-	//AddExpectedEvent(EEStartDownload,KMediumTimeout);
-    aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing );
-
-    status = aItem.GetNextString ( string );
-
-    if ( status != KErrNone )
-        {
-        iLog->Log(_L("CHelixSTIFClient:: File name missing in config file "));
-        return status;
-        }
-    else
-        {
-        if(iUrlName)
-            {
-            delete iUrlName;
-            iUrlName = NULL;
-            }
-        iUrlName = HBufC8::NewL(string.Length());
-        TPtr8 des = iUrlName->Des();
-        des.Copy(string);
-        }
-
-    status = aItem.GetNextString ( string );
-
-    if ( status != KErrNone )
-        {
-        iLog->Log(_L("CHelixSTIFClient:: File name missing in config file "));
-        return status;
-        }
-    else
-        {
-        if(iAccessPtName)
-            {
-            delete iAccessPtName;
-            iAccessPtName = NULL;
-            }
-        iAccessPtName = HBufC::NewL(string.Length());
-        TPtr des = iAccessPtName->Des();
-        des.Copy(string);
-        }
-
-    status = aItem.GetNextString ( string );
-
-    if ( status != KErrNone )
-        {
-        iLog->Log(_L("CHelixSTIFClient:: File name missing in config file "));
-        return status;
-        }
-    else
-        {
-        if(iFileName)
-            {
-            delete iFileName;
-            iFileName = NULL;
-            }
-        iFileName = HBufC::NewL(string.Length());
-        TPtr des = iFileName->Des();
-        des.Copy(string);
-        }
-
-    if ( !iDMgrConnected )
-        {
-        TRAP(status,iDownloadMgr.ConnectL( TUid::Uid(1), *this, EFalse ));
-        if(!status)
-            {
-            iDMgrConnected = ETrue;
-            }
-        else
-            {
-            iLog->Log(_L("CHelixSTIFClient::GeneralGen_StartProgDLL Connection failed to DlMgr "));
-            return status;
-            }
-        }
-
-    // Get IAP names and ids from the database
-    TInt res;
-    TBuf<40> name;
-    TUint32 id;
-
-    CCommsDatabase* TheDb = CCommsDatabase::NewL(EDatabaseTypeIAP);
-    CleanupStack::PushL(TheDb);
-
-    TheDb->ShowHiddenRecords();
-
-    CCommsDbTableView* view = TheDb->OpenTableLC(TPtrC(IAP));
-    res = view->GotoFirstRecord();
-
-    while(res == KErrNone)
-        {
-        view->ReadTextL(TPtrC(COMMDB_NAME), name);
-        view->ReadUintL(TPtrC(COMMDB_ID), id);
-
-				iLog->Log(_L("CHelixSTIFClient::GeneralGen_StartProgDLL Name[%s] ID[%d] "),&name,id);
-        if(!iAccessPtName->Des().Compare(name))
-            {
-            break;
-            }
-
-        res = view->GotoNextRecord();
-        RDebug::Print(_L("IAP name, id: %S, %d"), &name, id);
-        }
-
-    CleanupStack::PopAndDestroy(); // view
-    CleanupStack::PopAndDestroy(); // TheDb
-
-    status = iDownloadMgr.SetIntAttribute( EDlMgrIap,id );
-    if(status != KErrNone)
-        {
-        return status;
-        }
-
-    status = iDownloadMgr.SetDefaultStringAttribute( EDlAttrDestFilename, *iFileName ) ;
-
-
-    TRAP(status,iDownload = &(iDownloadMgr.CreateDownloadL(*iUrlName)));
-    if(status != KErrNone)
-        {
-        return status;
-        }
-
-    status = iDownload->Start();
-    if(status != KErrNone)
-        {
-        iLog->Log(_L("CHelixSTIFClient::GeneralGen_StartProgDLL Download Start Failed "));
-        return status;
-        }
-    status = iDownload->GetIntAttribute(EDlAttrId, iDownloadId);
-    if(status != KErrNone)
-        {
-        iLog->Log(_L("CHelixSTIFClient::GeneralGen_StartProgDLL Getting DLId failed "));
-        return status;
-        }
-
-    if(iActive)
-        {
-        delete iActive;
-        iActive = NULL;
-        }
-
-    iActive = new CActiveSchedulerWait;
-    RDebug::Print(_L("Before"));
-    iLog->Log(_L("Before = %d"), status);
-    iActive->Start();
-    iLog->Log(_L("After = %d"), status);
-    RDebug::Print(_L("AFter"));
-    iLog->Log(_L("CEnhanMediaTestClass::GeneralGen_StartProgDLL = %d"), status);
-    return status;
-    }
-
-
-TInt CEnhanMediaTestClass::PDLSOpenL(CStifItemParser& /*aItem*/)
-	{
-	AddExpectedEvent(EEPDLSOpen,KMediumTimeout);
-	TInt status(KErrNone);
-	//TBool stateDL;
-	//TUint percent;
-	if(!iMProgDLSource)
-	    {
-	    return status = KErrNotReady;
-	    }
-    status = iMProgDLSource->Open(*iFileName,iDownloadId);
-//	iMProgDLSource->GetPercentageDownloaded(percent);
-	return status;
-	}
-
-TInt CEnhanMediaTestClass::PDLSGetCurFileSizeL(CStifItemParser& /*aItem*/)
-	{
-	TInt status(KErrNone);
-	TUint fileSize;
-	if(!iMProgDLSource)
-	    {
-	    return status = KErrNotReady;
-	    }
-    status = iMProgDLSource->GetCurrentFileSize(fileSize);
-    iLog->Log(_L("PDLSGetCurFileSizeL = %d"), fileSize);
-	return status;
-	}
-
-TInt CEnhanMediaTestClass::PDLSGetExpFileSizeL(CStifItemParser& /*aItem*/)
-	{
-	TInt status(KErrNone);
-	TUint fileSize;
-	if(!iMProgDLSource)
-	    {
-	    return status = KErrNotReady;
-	    }
-    status = iMProgDLSource->GetExpectedFileSize(fileSize);
-    iLog->Log(_L("PDLSGetExpFileSizeL = %d"), fileSize);
-
-	return status;
-	}
-
-TInt CEnhanMediaTestClass::PDLSGetDLStatusL(CStifItemParser& /*aItem*/)
-	{
-	TInt status(KErrNone);
-	MProgDLSource::TDownloadStatus dlStatus;
-	if(!iMProgDLSource)
-	    {
-	    return status = KErrNotReady;
-	    }
-
-    dlStatus = iMProgDLSource->GetDownloadStatus();
-    iLog->Log(_L("PDLSGetDLStatusL = %d"), dlStatus);
-
-	return status;
-	}
-
-
-TInt CEnhanMediaTestClass::PDLSIsDLCompleteL(CStifItemParser& /*aItem*/)
-	{
-	TInt status(KErrNone);
-	TBool dlComplete;
-	if(!iMProgDLSource)
-	    {
-	    return status = KErrNotReady;
-	    }
-
-    status = iMProgDLSource->IsDownloadComplete(dlComplete);
-    iLog->Log(_L("PDLSIsDLCompleteL = %d"), dlComplete);
-
-	return status;
-	}
-
-TInt CEnhanMediaTestClass::PDLSGetPerDownloadedL(CStifItemParser& /*aItem*/)
-	{
-	TInt status(KErrNone);
-	TUint perDl;
-	if(!iMProgDLSource)
-	    {
-	    return status = KErrNotReady;
-	    }
-
-    status = iMProgDLSource->GetPercentageDownloaded(perDl);
-    iLog->Log(_L("PDLSGetPerDownloadedL = %d"), perDl);
-
-	return status;
-	}
-
-TInt CEnhanMediaTestClass::PDLSGetPerBufferedL(CStifItemParser& /*aItem*/)
-	{
-	TInt status(KErrNone);
-	TUint perBuf;
-	if(!iMProgDLSource)
-	    {
-	    return status = KErrNotReady;
-	    }
-
-    status = iMProgDLSource->GetPercentageBuffered(perBuf);
-    iLog->Log(_L("PDLSGetPerBufferedL = %d"), perBuf);
-	return status;
-	}
-
-TInt CEnhanMediaTestClass::PDLSGetDLRateL(CStifItemParser& /*aItem*/)
-	{
-	TInt status(KErrNone);
-	TUint dlRate;
-	if(!iMProgDLSource)
-	    {
-	    return status = KErrNotReady;
-	    }
-
-    status = iMProgDLSource->GetDownloadingRate(dlRate);
-    iLog->Log(_L("PDLSGetDLRateL = %d"), dlRate);
-
-	return status;
-	}
-
-TInt CEnhanMediaTestClass::PDLSGetBitRateL(CStifItemParser& /*aItem*/)
-	{
-	TInt status(KErrNone);
-	TUint bitRate;
-	if(!iMProgDLSource)
-	    {
-	    return status = KErrNotReady;
-	    }
-
-    status = iMProgDLSource->GetBitRate(bitRate);
-    iLog->Log(_L("PDLSGetBitRateL = %d"), bitRate);
-
-	return status;
-	}
-
-TInt CEnhanMediaTestClass::PDLSResumeDownloadL(CStifItemParser& /*aItem*/)
-	{
-	TInt status(KErrNone);
-	if(!iMProgDLSource)
-	    {
-	    return status = KErrNotReady;
-	    }
-
-    status = iMProgDLSource->ResumeDownload();
-    iLog->Log(_L("PDLSResumeDownloadL = %d"), status);
-
-	return status;
-	}
-
-TInt CEnhanMediaTestClass::PDLSMoveFileL(CStifItemParser& aItem)
-	{
-	TInt status(KErrNone);
-    TPtrC string;
-    TFileName fileName;
-	if(!iMProgDLSource)
-	    {
-	    return status = KErrNotReady;
-	    }
-	status = 	aItem.GetNextString(string);
-	if ( status != KErrNone )
-		{
-		iLog->Log(_L("CEnhanMediaTestClass:: File name missing in config file "));
-		return status;
-		}
-	else
-		{
-		fileName.Copy(string);
-		}
-    if(iFileName)
-        {
-        delete iFileName;
-        iFileName = NULL;
-        }
-    iFileName = HBufC::NewL(fileName.Length());
-    iFileName->Des().Copy(fileName);
-
-
-    status = iMProgDLSource->MoveFile(*iFileName);
-    iLog->Log(_L("PDLSMoveFileL = %d"), status);
-
-	return status;
-	}
-
-TInt CEnhanMediaTestClass::PDLSGetSize(CStifItemParser& /*aItem*/)
-	{
-
-    iLog->Log(_L("CEnhanMediaTestClass::PDLSGetSize "));
-    TInt status(KErrNone);
-	TUint sizes = 0;
-	if(!iMProgDLSource)
-	    {
-	    status = KErrNotReady;
-	    }
-	else
-		{
-		status = iMProgDLSource->GetSize(sizes);
-		}
-    iLog->Log(_L("CEnhanMediaTestClass::PDLSGetSize [%d]"), status);
-
-    return status;
-	}
-
-TInt CEnhanMediaTestClass::PDLSCancelDownloadL(CStifItemParser& /*aItem*/)
-	{
-	TMediaId mediaId;
-	TFourCC dataType;
-    iLog->Log(_L("CEnhanMediaTestClass::PDLSCancelDownloadL "));
-    TInt status(KErrNone);
-	if(!iMProgDLSource)
-	    {
-	    status = KErrNotReady;
-	    }
-	else
-		{
-	    status = iMProgDLSource->CancelDownload();
-		}
-    iLog->Log(_L("CEnhanMediaTestClass::PDLSCancelDownloadL [%d]"), status);
-
-    return status;
-	}
-
 TInt CEnhanMediaTestClass::StreamCustomInterface(CStifItemParser& /*aItem*/)
 	{
     iLog->Log(_L("CEnhanMediaTestClass::StreamCustomInterface "));
@@ -5632,19 +5157,6 @@
                 }
 	        break;
 	        }
-        case EPDLSOURCE:
-	        {
-	        if(iMProgDLSource)
-	            {
-                controlUid = iMProgDLSource->Type();
-	            }
-            else
-                {
-                status = KErrNotFound;
-                }
-	        break;
-	        }
-
         case EVOLUMECONTROL:
 	        {
 	        if(iMVolumeControl)
@@ -5913,19 +5425,6 @@
               }
 	        break;
 	        }
-        case EPDLSOURCE:
-	        {
-	        if(iMProgDLSource)
-	            {
-				controlType = iMProgDLSource->ControlType();
-	            }
-            else
-              {
-              status = KErrNotFound;
-              }
-	        break;
-	        }
-
         case EVOLUMECONTROL:
 	        {
 	        if(iMVolumeControl)
--- a/mmmw_plat/equalizer_ui_api/equalizer_ui_api.metaxml	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-<?xml version="1.0" ?>
-<api id="49b7ca056311c9b504e61313de21d8a7" dataversion="2.0">
-  <name>Equalizer UI API</name>
-  <description>An API for launching Equalizer UI.</description>
-  <type>c++</type>
-  <collection>audioeffectsui</collection>
-  <libs>
-    <lib name="Equalizer.lib" />
-  </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/equalizer_ui_api/group/bld.inf	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +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 
-:                Equalizer UI API
-*
-*/
-
-
-
-
-#include <platform_paths.hrh>
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_EXPORTS
-
-../inc/EqualizerPresetsDialog.h     MW_LAYER_PLATFORM_EXPORT_PATH(EqualizerPresetsDialog.h)
-../inc/EqualizerConstants.h     MW_LAYER_PLATFORM_EXPORT_PATH(EqualizerConstants.h)
--- a/mmmw_plat/equalizer_ui_api/inc/EqualizerConstants.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +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:    This file contains declarations for public constants for
-*                Equalizer
-*
-*/
-
-
-
-#ifndef EQUALIZERCONSTANTS_H
-#define EQUALIZERCONSTANTS_H
-
-//  INCLUDES
-
-#include <e32std.h>
-
-// CONSTANTS
-// Used by client application for activating the preset "None"
-const TInt KEqualizerPresetNone = -1;
-
-// Used as the maximum length of a ListBox model entry (like "0\tNone")
-const TInt KListBoxEntryMaxLength = 64; 
-
-// DATA TYPES
-// Used to store a preset name or ListBox model entry
-typedef TBuf<KListBoxEntryMaxLength> TPresetName;
-
-#endif      // EQUALIZERCONSTANTS_H
-
-// End of File
--- a/mmmw_plat/equalizer_ui_api/inc/EqualizerPresetsDialog.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,369 +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:    Declaration of EqualizerPresetsDialog class
-*
-*/
-
-
-
-
-#ifndef EQUALIZERPRESETSDIALOG_H
-#define EQUALIZERPRESETSDIALOG_H
-
-// INCLUDES
-#include <AknDialog.h> 
-#include <aknlists.h>
-#include <EqualizerConstants.h>
-#include <AudioEqualizerUtility.h>
-
-// CLASS DECLARATION
-class CEqualizerPresetListArray;
-class CEqualizerEditingDialog;
-
-/**
-* This class is used to notify the client application about the activation
-* of a new preset.
-*  
-*  @lib Equalizer.lib
-*  @since Series 60 3.0
-*/
-NONSHARABLE_CLASS(MEqualizerPresetActivationObserver)
-    {
-    public: // New functions
-        /**
-        * This member is called by the Equalizer UI when the user activates 
-        * a new preset. 
-        * @ since Series 60 3.0
-        * @ aActivatedPreset It is KEqualizerPresetNone if the preset "None"
-        * is active. Otherwise, it is the value of 
-        * TEfAudioEqualizerUtilityPreset::iPresetNameKey for the entry
-        * whose TEfAudioEqualizerUtilityPreset::iPresetName matches the
-        * activated preset name, in the array retrieved using 
-        * CAudioEqualizerUtility::Presets().
-        */
-        virtual void HandlePresetActivation (TInt aActivatedPreset) = 0;
-   };
-    
-/**
-*  This class is used to display the preset list view of the Equalizer.
-*  
-*  @lib Equalizer.lib
-*  @since Series 60 3.0
-*/
-class CEqualizerPresetsDialog : public CAknDialog
-#ifdef RD_SCALABLE_UI_V2
-                              , public MEikListBoxObserver
-#endif //RD_SCALABLE_UI_V2
-    {
-    public:     //Constructors and Destructors
-        /**
-        * This function is called to create an object of 
-        * type CEqualizerPresetsDialog - Two phase Construction
-        * @since 3.0
-        * @param aAudEqUtility a reference to CAudioEqualizerUtility 
-        * @param aCurrentActivePreset It is KEqualizerPresetNone if the preset
-        * "None" is active. Otherwise, it is the value of 
-        * TEfAudioEqualizerUtilityPreset::iPresetNameKey for the entry
-        * whose TEfAudioEqualizerUtilityPreset::iPresetName matches the
-        * activated preset name, in the array retrieved using 
-        * CAudioEqualizerUtility::Presets().
-        * @param aEqualizerPresetActivationObserver a reference to an object 
-        * of type MEqualizerPresetActivationObserver         
-        */
-        IMPORT_C static CEqualizerPresetsDialog* NewL(
-           CAudioEqualizerUtility* aAudEqUtility,
-           TInt aCurrentActivePreset, 
-           MEqualizerPresetActivationObserver& aEqrPresetActObserver);
-
-        /**
-        * Destructor
-        * @since 3.0
-        */
-        virtual ~CEqualizerPresetsDialog();
-    private: //New functions
-        /**
-        * Second Phase Constructor
-        * @since 3.0
-        * @param aCurrentActivePreset the index into the preset array retrieved
-        * with the method CAudioEqualizerUtility::Presets()if a preset other 
-        * than "None" is active. It is KEqualizerPresetNone if the preset 
-        * "None" is active.
-        */
-        void ConstructL(const TInt aCurrentActivePreset);
-        /**
-        * This function is called to create an object of 
-        * type CEqualizerPresetsDialog - First Phase Constructor
-        * @since 3.0
-        * @param aAudEqUtility a reference to CAudioEqualizerUtility 
-        * @param aEqualizerPresetActivationObserver a reference to an object 
-        * of type MEqualizerPresetActivationObserver         
-        */
-        CEqualizerPresetsDialog (
-           CAudioEqualizerUtility* aAudEqUtility,
-           MEqualizerPresetActivationObserver& aEqrPresetActObserver);
-       
-        /**
-        * This function is called to get a free preset name
-        * @since 3.0
-        * @param aName Used to reurn a free preset name
-        */
-        void BuildPresetNameL( TDes& aName) const;
-        
-        /**
-        * This function returns the highlighted Preset in ListBox
-        * @since 3.0
-        * @return      Highlighted Preset e.g. "None"
-        */
-        TPresetName GetHighlightedPresetInListBox() const;
-        /**
-        * This function is called to find the index of a preset in the list
-        * of presets returned by CAudioEqualizerUtility::Presets()
-        * @since 3.0
-        * @param aPreset The preset focussed in ListBox
-        * @return index of the highlighted preset in the ListBox in the 
-        * list of presets returned by CAudioEqualizerUtility::Presets() 
-        */
-        TInt GetEngineIndexL(const TPresetName& aPreset) const; 
-        /**
-        * This function is used for the activation of a preset
-        * @since 3.0
-        * @param aIndex The index of the preset in the ListBox
-        * @param aPresetName The name of the preset
-        */
-        void ActivateEqrPresetL(const TInt aIndex, const TDesC& aPreset);
-        /**
-        * This function is used for the editing of a preset
-        * @since 3.0
-        * @param aIndex The index of the preset in the ListBox
-        * @param aPresetName The name of the preset
-        */
-        void EditEqrPresetL(const TInt aIndex, const TDesC& aPreset);
-        /**
-        * This function is used for the creation of a new preset
-        * @since 3.0
-        * @param aIndex The index of the preset in the ListBox. This is set
-        * to a the index in the ListBox if preset creation is successful. 
-        * If the creation is unscuccessful, then the parameter is not changed.
-        * @param aPreset The name of the preset created
-        */
-        void CreateNewEqrPresetL(TInt& aIndex, TPresetName& aPreset) const;
- 
-        /**
-        * This function is used for the renaming of a preset
-        * @since 3.0
-        * @param aIndex The index of the preset in the ListBox
-        * @param aPresetName The name of the preset
-        */
-        void RenameEqrPresetL(const TInt aIndex, const TDesC& aPreset); 
-
-        /**
-        * This function is used for the deletion of a preset
-        * @since 3.0
-        * @param aIndex The index of the preset in the ListBox
-        * @param aPresetName The name of the preset
-        */
-        void DeleteEqrPresetL(const TInt aIndex, const TDesC& aPreset);
-        
-        /**
-        * This function is used to display a dialog to query the user
-        * for a new name. It is used while creating a new preset or 
-        * renaming an existing preset.
-        * @since 3.0
-        * @param aResourceId The resource id to use for the dialog
-        * @param aPresetName 
-        * @return       ETrue if the user did not cancel the dialog box 
-        *               EFalse otherwise 
-        */
-        TBool GetNewNameL(const TInt aResourceId, TDes& aPresetName) const; 
- 
-        /**
-        * This function is used to load the ListBox icons in an array
-        * @since 3.0
-        * @returns   array of ListBox icons 
-        */
-        CArrayPtr<CGulIcon>* GetListBoxIconsL() const;
-        
-        /**
-        * This function is used to inform the client application about the 
-        * currently active preset 
-        * engine 
-        * @since 3.0
-        */
-        void SetCurrentPreset(const TPresetName& aPreset);
-
-        /**
-        * This function is used to rturn the currently active preset 
-        * engine 
-        * @since 3.0
-        */        
-        TPresetName CurrentPreset() const;
-
-        /**
-        * This function is used to search for a preset name in the ListBox
-        * @since 3.0
-        * @param aPreset The preset name to search for 
-        * @return It returns the index of the preset, if found and 
-        *  KErrNotFound if not found.
-        */
-        TInt SearchPresetL(const TPresetName& aPreset) const;
-
-        /**
-        * This function is used to display a dialog to the user for 
-        * editing a particular preset.
-        * @since 3.0
-        * @param aAudEqUtility pointer to CAudioEqualizerUtility
-        * @param aIndex the index of the preset in the array of presets 
-        * @param aIsActive whether the preset is active or not? 
-        * returned by CAudioEqualizerUtility::Presets() 
-        */
-        void DisplaySettingsL(CAudioEqualizerUtility* aAudEqUtility, 
-        const TInt aIndex, const TBool aIsActive);
-        
-        /**
-        * This function is used to display a note to the user if 
-        * memory is below critical level when creating a new preset.
-        * @since 3.1
-        */
-        void ShowDiskFullNoteL() const;
-    
-    public: 
-        /**
-        * This function is used to execute the Dialog.
-        * @since 3.0
-        * @returns return value of CAknDialog::ExecuteLD()   
-        */
-        IMPORT_C TInt ExecuteLD();
-        
-        /**
-        * This function is used to set new values for CAudioEqualizerUtility* 
-        * @since 3.0
-        * @param aAudEqUtility New pointer to CAudioEqualizerUtility
-        */
-        IMPORT_C void SetAudioEqualizerL(CAudioEqualizerUtility* aAudEqUtility);
-
-    private: //Functions from base classes
-    
-        /**
-        * From CAknDialog
-        * This function responds to the size changes to sets the 
-        * size and position of the 
-        * contents of this control.
-        */
-        void SizeChanged();
-    
-        /**
-        * From CAknDialog
-        * Handles changes to the application 
-        * when it switches to or from the foreground.
-        */
-        void HandleForegroundEventL( TBool aForeground);
-        
-        /**
-        * From CAknDialog
-        * Responds to a change in focus.
-        * This is called whenever the control gains or loses focus
-        */
-        void FocusChanged(TDrawNow aDrawNow);
-        
-        /**
-        * From CCoeControl
-        * This function is called when there is a Skin change event
-        * or layout change event
-        */     
-        void HandleResourceChangeL(TInt aType);
-        
-        /**
-        * This function is called when there is a Skin change event
-        * or layout change event, it calls HandleResourceChangeL()
-        */     
-        void HandleResourceChange(TInt aType);
-        
-        /**
-        * From CAknDialog Called when a key event happens.
-        */
-        TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, 
-            TEventCode aType ); 
-        /**
-        * From CAknDialog Called just before the dialog is displayed.
-        */
-        void PreLayoutDynInitL(void); 
-        /**
-        * From CAknDialog Called to process a user's menu command.
-        */
-        void ProcessCommandL(TInt  aCommandId); 
-        /**
-        * From CAknDialog Called just before the menu pane is displayed
-        */
-        void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane);
-        /**
-        * From CAknDialog Called when OK key is pressed
-        */
-        TBool OkToExitL(TInt aButtonId); 
-                       
-        /**
-        * Get help context for the control.
-        * @param aContext The context that is filled in.
-        * @return None.
-        */
-        void GetHelpContext( TCoeHelpContext& aContext ) const;
-
-#ifdef RD_SCALABLE_UI_V2
-        /**
-        * From MEikListBoxObserver
-        * Handles listbox events.
-        * @param aListBox Listbox where the event occurred.
-        * @param aEventType Event type.
-        *
-        */
-        void HandleListBoxEventL( CEikListBox* aListBox,
-                                  TListBoxEvent aEventType );
-#endif //RD_SCALABLE_UI_V2
-
-    private:
-        // Used to store whether the "OK" key has been pressed or not
-        // and accordingly invoke appropriate code in DynInitMenuPaneL().
-        // It is set to ETrue in OkToExitL() when the key pressed is "OK"
-        // and set to EFalse in DynInitMenuPaneL() after the "Context
-        // Sensitive" menu handling has been done.
-        TBool iContextSensitiveMenu;
-        // Used to store the offset of the resource file
-        TInt iResourceFileOffset;
-        // The ListBox control
-        CAknSingleGraphicStyleListBox* iListBox;
-        // Name of currently active preset
-        TPresetName iActivePreset;                
-        // Application title text
-        HBufC* iAppTitleText; 
-        // Preset "None" Text
-        HBufC* iPresetNoneText;
-        // Equalizer's title text
-        HBufC* iTitleText;    
-        // Used to store a pointer to CAudioEqualizerUtility
-        CAudioEqualizerUtility* iAudEqUtility;
-        // Used to store a reference to the observer class
-        MEqualizerPresetActivationObserver& iEqrPresetActObserver;
-        // ListBox Item Array
-        CEqualizerPresetListArray* iItemArray;
-        // Ignore Key events between track changes
-        TBool iIgnoreKeyEvents;
-        //Editing dialog
-        CEqualizerEditingDialog *iEditingDialog;
-        CRepository* iRepository;
-		// Status pane layout before launching this dialog
-		TInt iPreviousStatusPaneLayout;
-    };
-
-#endif  // EQUALIZERPRESETSDIALOG_H
-
-// End of File
--- a/mmmw_plat/equalizer_ui_api/tsrc/conf/tcequalizertest.cfg	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-[Test]
-title 1: CEqualizerPresetsDialog::NewL()
-run testscripter c:\testframework\ui_equalizertest.cfg 1
-[Endtest] 
-
-[Test]
-title 2: CEqualizerPresetsDialog::ExecuteLD()
-			//show dialog
-run testscripter c:\testframework\ui_equalizertest.cfg 2
-			//press key to dismiss dialog
-run testscripter c:\testframework\ui_equalizertest.cfg 4
-[Endtest] 
-
-[Test]
-title 3: CEqualizerPresetsDialog::SetAudioEqualizerL()
-run testscripter c:\testframework\ui_equalizertest.cfg 3
-[Endtest] 
-
--- a/mmmw_plat/equalizer_ui_api/tsrc/conf/ui_equalizertest.cfg	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-[Test]
-title 1: CEqualizerPresetsDialog::NewL()
-create ui_equalizertest equalizer
-bringtoforeground
-equalizer CEqualizerPresetsDialogNewL
-equalizer Release
-sendtobackground
-delete equalizer
-pause 1000
-[Endtest] 
-
-[Test]
-title 2: CEqualizerPresetsDialog::ExecuteLD()
-create ui_equalizertest equalizer
-bringtoforeground
-equalizer CEqualizerPresetsDialogNewL
-equalizer ExecuteLD
-equalizer Release
-sendtobackground
-delete equalizer
-pause 1000
-[Endtest] 
-
-[Test]
-title 3: CEqualizerPresetsDialog::SetAudioEqualizerL()
-create ui_equalizertest equalizer
-bringtoforeground
-equalizer CEqualizerPresetsDialogNewL
-equalizer SetAudioEqualizerL
-equalizer Release
-sendtobackground
-delete equalizer
-pause 1000
-[Endtest] 
-
-[Test]
-title 4: press right soft key
-pause 3000
-presskey global EKeyDevice1
-[Endtest] 
--- a/mmmw_plat/equalizer_ui_api/tsrc/group/bld.inf	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +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 
-:                equalizer ui api
-*
-*/
-
-// Version : %version: da1mmcf#3 %
-
-
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_EXPORTS
-
-PRJ_TESTEXPORTS
-
-PRJ_MMPFILES
-
-PRJ_TESTMMPFILES
-#include "../ui_equalizertest/group/bld.inf"
--- a/mmmw_plat/equalizer_ui_api/tsrc/init/TestFramework.ini	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,197 +0,0 @@
-#
-# This is STIF initialization file
-# Comment lines start with '#'-character.
-# See STIF TestFramework users guide.doc for instructions
-
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-# Set following test engine settings:
-#	- Set Test Reporting mode. TestReportMode's possible values are:
-#		+ 'Summary': Summary of the tested test cases.
-#		+ 'Environment': Hardware and software info.
-#		+ 'TestCases': Test case report.
-#		+ 'FullReport': Set of all above ones.
-#		+ Example 'TestReportMode= Summary TestCases'
-#
-# 	- CreateTestReport setting controls report creation mode
-#		+ YES, Test report will created.
-#		+ NO, No Test report.
-#
-# 	- File path indicates the base path of the test report.
-# 	- File name indicates the name of the test report.
-#
-# 	- File format indicates the type of the test report.
-#		+ TXT, Test report file will be txt type, for example 'TestReport.txt'.
-#		+ HTML, Test report will be html type, for example 'TestReport.html'.
-#
-# 	- File output indicates output source of the test report.
-#		+ FILE, Test report logging to file.
-#		+ RDEBUG, Test report logging to using rdebug.
-#
-# 	- File Creation Mode indicates test report overwriting if file exist.
-#		+ OVERWRITE, Overwrites if the Test report file exist.
-#		+ APPEND, Continue logging after the old Test report information if
-#                 report exist.
-# 	- Sets a device reset module's dll name(Reboot).
-#		+ If Nokia specific reset module is not available or it is not correct one
-#		  StifHWResetStub module may use as a template for user specific reset
-#		  module.
-# 	- Sets STIF test measurement disable options. e.g. pluging1 and pluging2 disablation
-#		DisableMeasurement= stifmeasurementplugin01 stifmeasurementplugin02
-#
-
-[Engine_Defaults]
-
-TestReportMode= FullReport		# Possible values are: 'Empty', 'Summary', 'Environment',
-                                                               'TestCases' or 'FullReport'
-
-CreateTestReport= YES			# Possible values: YES or NO
-
-TestReportFilePath= C:\LOGS\TestFramework\
-TestReportFileName= TestReport_ui_equalizertest
-
-TestReportFormat= TXT			# Possible values: TXT or HTML
-TestReportOutput= FILE			# Possible values: FILE or RDEBUG
-TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
-
-DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
-
-DisableMeasurement= stifmeasurementdisablenone	# Possible values are:
-						# 'stifmeasurementdisablenone', 'stifmeasurementdisableall'
-					  	# 'stifmeasurementplugin01', 'stifmeasurementplugin02',
-					  	# 'stifmeasurementplugin03', 'stifmeasurementplugin04',
-					  	# 'stifmeasurementplugin05' or 'stifbappeaprofiler'
-
-Timeout= 0                              # Default timeout value for each test case. In milliseconds
-UITestingSupport= YES
-[End_Defaults]
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-
-
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-# Module configurations start
-# Modules are added between module tags
-# tags. Module name is specified after ModuleName= tag, like
-# ModuleName= XXXXXXXXX
-# Modules might have initialisation file, specified as
-# IniFile= c:\testframework\YYYYYY
-# Modules might have several configuration files, like
-# TestCaseFile= c:\testframework\NormalCases.txt
-# TestCaseFile= c:\testframework\SmokeCases.txt
-# TestCaseFile= c:\testframework\ManualCases.txt
-
-# (TestCaseFile is synonym for old term ConfigFile)
-
-# Following case specifies demo module settings. Demo module
-# does not read any settings from file, so tags 
-# IniFile and TestCaseFile are not used.
-# In the simplest case it is enough to specify only the
-# name of the test module when adding new test module
-
-[New_Module]
-ModuleName= testcombiner
-TestCaseFile= c:\testframework\tcequalizertest.cfg
-[End_Module]
-
-
-# Load testmoduleXXX, optionally with initialization file and/or test case files
-#[New_Module]
-#ModuleName= testmodulexxx
-
-#TestModuleXXX used initialization file
-#IniFile= c:\testframework\init.txt
-
-#TestModuleXXX used configuration file(s)
-#TestCaseFile= c:\testframework\testcases1.cfg
-#TestCaseFile= c:\testframework\testcases2.cfg
-#TestCaseFile= c:\testframework\manualtestcases.cfg
-
-#[End_Module]
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-
-
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-# Set 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.
-#	
-#	Settings description:
-#	- Indicates option for creation log directory/directories. If log directory/directories
-#         is/are not created by user they will make by software.
-#		+ YES, Create log directory/directories if not allready exist.
-#		+ NO, Log directory/directories not created. Only created one is used.
-#
-#	- Overwrite emulator path setting.
-#		+ Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
-#		           Logger's path 'D:\\LOGS\\Module\\' with those definition the path
-#		           will be 'C:\LOGS\TestFramework\LOGS\Module\'
-#
-#	- Overwrite emulator's logging format.
-#		+ TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
-#		+ HTML, Log file(s) will be html type(s), for example 'Module.html'.
-#
-#	- Overwrited emulator logging output source.
-#		+ FILE, Logging to file(s).
-#		+ RDEBUG, Logging to using rdebug(s).
-#
-#	- Overwrite hardware path setting (Same description as above in emulator path).
-#	- Overwrite hardware's logging format(Same description as above in emulator format).
-#	- Overwrite hardware's logging output source(Same description as above in emulator output).
-#
-#	- File Creation Mode indicates file overwriting if file exist.
-#		+ OVERWRITE, Overwrites if file(s) exist.
-#		+ APPEND, Continue logging after the old logging information if file(s) exist.
-#
-#	- Will thread id include to the log filename.
-#		+ YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
-#		+ NO, No thread id to log file(s), Example filename 'Module.txt'.
-#
-#	- Will time stamps include the to log file.
-#		+ YES, Time stamp added to each line in log file(s). Time stamp is 
-#                 for example'12.Nov.2003 115958    LOGGING INFO'
-#		+ NO, No time stamp(s).
-#
-#	- Will line breaks include to the log file.
-#		+ YES, Each logging event includes line break and next log event is in own line.
-#		+ NO, No line break(s).
-#
-#	- Will event ranking include to the log file.
-#		+ YES, Event ranking number added to each line in log file(s). Ranking number
-#                 depends on environment's tics, for example(includes time stamp also)
-#                 '012   12.Nov.2003 115958    LOGGING INFO'
-#		+ NO, No event ranking.
-#
-#	- Will write log file in unicode format.
-#		+ YES, Log file will be written in unicode format
-#		+ NO, Log will be written as normal, not unicode, file.
-#
-
-[Logger_Defaults]
-
-#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#'
-#NOTE: TestEngine and TestServer logging settings cannot change here
-
-#CreateLogDirectories= YES    # Possible values: YES or NO
-
-#EmulatorBasePath= C:\LOGS\TestFramework\
-#EmulatorFormat= HTML         # Possible values: TXT or HTML
-#EmulatorOutput= FILE         # Possible values: FILE or RDEBUG
-
-#HardwareBasePath= D:\LOGS\TestFramework\
-#HardwareFormat= HTML         # Possible values: TXT or HTML
-#HardwareOutput= FILE         # Possible values: FILE or RDEBUG
-
-#FileCreationMode= OVERWRITE  # Possible values: OVERWRITE or APPEND
-
-#ThreadIdToLogFile= YES       # Possible values: YES or NO
-#WithTimeStamp= YES           # Possible values: YES or NO
-#WithLineBreak= YES           # Possible values: YES or NO
-#WithEventRanking= YES        # Possible values: YES or NO
-
-#FileUnicode= YES             # Possible values: YES or NO
-#AddTestCaseTitle= YES        # Possible values: YES or NO
-[End_Logger_Defaults]
-# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-# End of file
--- a/mmmw_plat/equalizer_ui_api/tsrc/ui_equalizertest/Bmarm/ui_equalizertestU.DEF	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
-	LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &)
-
--- a/mmmw_plat/equalizer_ui_api/tsrc/ui_equalizertest/Bwins/ui_equalizertestU.DEF	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
-	?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &)
-
--- a/mmmw_plat/equalizer_ui_api/tsrc/ui_equalizertest/EABI/ui_equalizertestU.def	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-EXPORTS
-	_Z9LibEntryLR13CTestModuleIf @ 1 NONAME
-	_ZTI17CEdwinTestControl @ 2 NONAME ; #<TI>#
-	_ZTV17CEdwinTestControl @ 3 NONAME ; #<VT>#
-
--- a/mmmw_plat/equalizer_ui_api/tsrc/ui_equalizertest/group/bld.inf	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +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:
-*
-*/
-
-PRJ_PLATFORMS
-// specify the platforms your component needs to be built for here
-// defaults to WINS MARM so you can ignore this if you just build these
-	
-	DEFAULT
-
-PRJ_TESTEXPORTS
-// NOTE: If using ARS requirements all export operations should be done under this.
-// 'abld test export'
-
-PRJ_EXPORTS
-// Specify the source file followed by its destination here
-// copy will be used to copy the source file to its destination
-// If there's no destination then the source file will be copied
-// to the same name in /epoc32/include
-// Example: 
-/*
-/agnmodel/inc/AGMCOMON.H
-*/
-
-PRJ_TESTMMPFILES
-
-	ui_equalizertest.mmp
-
-PRJ_MMPFILES
-
-
-// Specify the .mmp files required for building the important component
-// releasables.
-//
-// Specify "tidy" if the component you need to build doesn't need to be
-// released. Specify "ignore" if the MMP file exists but should be
-// ignored.
-// Example:
-/*
-/agnmodel/group/agnmodel.mmp
-#if defined(MARM)
-/agnmodel/group/agsvexe.mmp
-#endif
-*/
-
-//  End of File
--- a/mmmw_plat/equalizer_ui_api/tsrc/ui_equalizertest/group/ui_equalizertest.mmp	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-/*TYPE TESTCLASS*/
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-* 
-* Description: MMP file for STIF Test Framework's TestScripter 
-* testclass test module.
-*
-*/
-
-#include <platform_paths.hrh>
-
-TARGET          ui_equalizertest.dll
-TARGETTYPE      dll
-UID             0x1000008D 0x101FB3E3
-
-CAPABILITY      ALL -TCB
-/* Remove comments and replace 0x00000000 with correct vendor id */
-// VENDORID     0x00000000
-/* Remove comments and replace 0x00000000 with correct secure id */
-// SECUREID     0x00000000
-
-//TARGETPATH      ?target_path
-DEFFILE         ui_equalizertest.def
-
-USERINCLUDE     ../inc 
-
-#if 0
-MW_LAYER_SYSTEMINCLUDE
-#endif
-SYSTEMINCLUDE /epoc32/include /epoc32/include/mw /epoc32/include/platform/mw /epoc32/include/platform /epoc32/include/platform/loc /epoc32/include/platform/mw/loc /epoc32/include/platform/loc/sc /epoc32/include/platform/mw/loc/sc +/include/a3f +/include/mmf/server
-
-SOURCEPATH      ../src
-
-SOURCE          ui_equalizertest.cpp
-SOURCE          ui_equalizertestBlocks.cpp EdwinTestControl.cpp
-
-//RESOURCE        resource_file
-//RESOURCE        resource_file2
-
-LIBRARY         euser.lib
-LIBRARY         stiftestinterface.lib
-LIBRARY         stiftestengine.lib Equalizer.lib 
-LIBRARY         AudioEqualizerUtility.lib
-LIBRARY		    mediaclientaudio.lib CustomInterfaceUtility.lib CustomCommandUtility.lib 
-LIBRARY		    mmfcodeccommon.lib 
-LIBRARY		    mmfcontrollerframework.lib 
-LIBRARY		    mmfglblaudioeffect.lib 
-LIBRARY		    mmfserverbaseclasses.lib 
-LIBRARY		    ecom.lib 
-LIBRARY		    cone.lib 
-LIBRARY		    eikcoctl.lib AknSkins.lib 
-LIBRARY		    eikcore.lib 
-LIBRARY		    avkon.lib 
-
-LANG            SC
-
-/*
-START WINS      
-?wins_specific_information
-END
-
-START MARM
-?marm_specific_information
-END
-*/
-// Other possible keywords:
- 
-// DOCUMENT     ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes)
-/*
-START BITMAP ?target
-TARGETPATH   ?emulated_path_on_target_machine
-HEADER
-SOURCE       ?color_depth ?source_bitmap
-END
-*/
-// DEFFILE ?filename
-// AIF ?filename
-
-// End of File
--- a/mmmw_plat/equalizer_ui_api/tsrc/ui_equalizertest/group/ui_equalizertest.pkg	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-;
-; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-; All rights reserved.
-; This component and the accompanying materials are made available
-; under the terms of "Eclipse Public License v1.0"
-; which accompanies this distribution, and is available
-; at the URL "http://www.eclipse.org/legal/epl-v10.html".
-;
-; Initial Contributors:
-; Nokia Corporation - initial contribution.
-;
-; Contributors:
-; 
-; Description:
-;
-; 	Installation file for STIF
-;
-
-; Languages
-&EN
-
-; Provide value for uid
-#{"STIF equalizer ui test Application"},(0x10005942),1,1,0,TYPE=SA
-
-
-; Localised Vendor name
-%{"Nokia"}
-
-; Unique Vendor name
-:"Nokia"
-
-; Logo
-; None
-
-; Package signature - Optional
-; None
-
-; Start of Package body
-
-; Condition blocks
-; None
-
-; Options list
-; None
-
-; Install files
-"\epoc32\release\armv5\urel\ui_equalizertest.dll"   -   "c:\Sys\Bin\ui_equalizertest.dll"
-"..\..\init\TestFramework.ini"   -   "c:\testframework\TestFramework.ini" 
-"..\..\conf\ui_equalizertest.cfg"   -   "c:\testframework\ui_equalizertest.cfg"
-"..\..\conf\tcequalizertest.cfg"   -   "c:\testframework\tcequalizertest.cfg"
-  
-; Embedded SIS 
-; None
-
-; End of Package body
-
-; PKG dependencies
-; None
-
-; PKG capabilities
-; None
--- a/mmmw_plat/equalizer_ui_api/tsrc/ui_equalizertest/inc/EdwinTestControl.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +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: CEdwinTestControl test class for STIF Test Framework TestScripter.
-*
-*/
-#ifndef EDWINTESTCONTROL_H_
-#define EDWINTESTCONTROL_H_
-
-#include <eikedwin.h>
-
-class CAknsBasicBackgroundControlContext;
-
-class CEdwinTestControl : public CCoeControl, public MCoeControlObserver
-    {
-public:
-	static CEdwinTestControl* NewL(void);
-	virtual ~CEdwinTestControl();
-protected:
-	TTypeUid::Ptr MopSupplyObject(TTypeUid aId); // 
-private:
-	virtual void SizeChanged();
-	virtual void HandleResourceChange(TInt aType);
-	virtual TInt CountComponentControls() const;
-	virtual CCoeControl* ComponentControl(TInt aIndex) const;
-    void ConstructL(/*void*/);
-	void Draw(const TRect& aRect) const;
-	
-	void HandleControlEventL( CCoeControl* aControl, TCoeEvent aEventType);
-	TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType );	
-private:
-	CAknsBasicBackgroundControlContext*	iBgContext; 
-	CEikEdwin* iEditWin;
-};
-
-
-#endif /*EDWINTESTCONTROL_H_*/
--- a/mmmw_plat/equalizer_ui_api/tsrc/ui_equalizertest/inc/ui_equalizertest.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,255 +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: STIF testclass declaration
-*
-*/
-
-#ifndef UI_EQUALIZERTEST_H
-#define UI_EQUALIZERTEST_H
-
-//  INCLUDES
-#include <StifLogger.h>
-#include <TestScripterInternal.h>
-#include <StifTestModule.h>
-#include <TestclassAssert.h>
-#include <EqualizerPresetsDialog.h>
-#include <mdaaudiosampleplayer.h>
-
-#include <mdaaudiosampleeditor.h>
-#include <mpxcustomcommandobserver.h>
-#include "edwintestcontrol.h"
-
-
-
-// CONSTANTS
-//const ?type ?constant_var = ?constant;
-
-// MACROS
-//#define ?macro ?macro_def
-#define TEST_CLASS_VERSION_MAJOR 0
-#define TEST_CLASS_VERSION_MINOR 0
-#define TEST_CLASS_VERSION_BUILD 0
-
-
-#ifdef __WINSCW__
-// Logging path
-_LIT( Kui_equalizertestLogPath, "\\logs\\testframework\\ui_equalizertest\\" ); 
-// Log file
-_LIT( Kui_equalizertestLogFile, "ui_equalizertest.txt" ); 
-_LIT( Kui_equalizertestLogFileWithTitle, "ui_equalizertest_[%S].txt" );
-_LIT( Kui_equalizer_TestData_Path, "c:\\testing\\data\\" );
-#else
-// Logging path
-_LIT( Kui_equalizertestLogPath, "\\logs\\testframework\\ui_equalizertest\\" ); 
-// Log file
-_LIT( Kui_equalizertestLogFile, "ui_equalizertest.txt" ); 
-_LIT( Kui_equalizertestLogFileWithTitle, "ui_equalizertest_[%S].txt" );
-_LIT( Kui_equalizer_TestData_Path, "e:\\testing\\data\\" );
-#endif
-
-
-
-// FUNCTION PROTOTYPES
-//?type ?function_name(?arg_list);
-
-// FORWARD DECLARATIONS
-//class ?FORWARD_CLASSNAME;
-class Cui_equalizertest;
-class CCustomCommandUtility;
-class CCustomCommand;
-
-// DATA TYPES
-//enum ?declaration
-//typedef ?declaration
-//extern ?data_type;
-
-// CLASS DECLARATION
-
-/**
-*  Cui_equalizertest test class for STIF Test Framework TestScripter.
-*  ?other_description_lines
-*
-*  @lib ?library
-*  @since ?Series60_version
-*/
-NONSHARABLE_CLASS(Cui_equalizertest) : public CScriptBase,
-//									   public MMdaAudioPlayerCallback,
-									   public MEqualizerPresetActivationObserver//,
-//									   public MCustomInterface,
-//									   public MMdaObjectStateChangeObserver,
-//									   public MMPXPlaybackObserver,
-//									   public MMPXCustomCommandObserver
-									  
-    {
-    public:  // Constructors and destructor
-
-        /**
-        * Two-phased constructor.
-        */
-        static Cui_equalizertest* NewL( CTestModuleIf& aTestModuleIf );
-
-        /**
-        * Destructor.
-        */
-        virtual ~Cui_equalizertest();
-
-    public: // New functions
-
-        /**
-        * ?member_description.
-        * @since ?Series60_version
-        * @param ?arg1 ?description
-        * @return ?description
-        */
-        //?type ?member_function( ?type ?arg1 );
-    	
-       
-        /**
-         * From MEqualizerPresetActivationObserver
-         * Handle preset id activation from Equalizer dialog.
-         * 
-         * @param aActivatedPreset Current activated preset id.
-         */
-        virtual void HandlePresetActivation( TInt aActivatedPreset );
-  	
-    	
-
-	    
-	    /**
-	     * Handle custom commands.
-	     *
-	     * @since S60 3.2.3
-	     * @param aUid Command category Uid. Different command set will have 
-	     *             different Uid to avoid clash.
-	     * @param aCommand Command to be handled.
-	     * @param aData data for the specific command
-	     */
-	     void HandleCustomCommand( 
-	        const TUid& /*aUid*/,
-	        const TInt /*aCommand*/, 
-	        const TDesC8& aData = KNullDesC8 ){};
-        
-    	
-    public: // Functions from base classes
-
-        /**
-        * From CScriptBase Runs a script line.
-        * @since ?Series60_version
-        * @param aItem Script line containing method name and parameters
-        * @return Symbian OS error code
-        */
-        virtual TInt RunMethodL( CStifItemParser& aItem );
-        
-      
-        
-    protected:  // New functions
-
-        /**
-        * ?member_description.
-        * @since ?Series60_version
-        * @param ?arg1 ?description
-        * @return ?description
-        */
-        //?type ?member_function( ?type ?arg1 );
-
-    protected:  // Functions from base classes
-
-        /**
-        * From ?base_class ?member_description
-        */
-        //?type ?member_function();
-
-    private:
-
-        /**
-        * C++ default constructor.
-        */
-        Cui_equalizertest( CTestModuleIf& aTestModuleIf );
-
-        /**
-        * By default Symbian 2nd phase constructor is private.
-        */
-        void ConstructL();
-
-        // Prohibit copy constructor if not deriving from CBase.
-        // ?classname( const ?classname& );
-        // Prohibit assigment operator if not deriving from CBase.
-        // ?classname& operator=( const ?classname& );
-
-        /**
-        * Frees all resources allocated from test methods.
-        * @since ?Series60_version
-        */
-        void Delete();
-
-        /**
-        * Test methods are listed below. 
-        */
-
-        /**
-        * Example test method.
-        * @since ?Series60_version
-        * @param aItem Script line containing parameters.
-        * @return Symbian OS error code.
-        */
-        virtual TInt ExampleL( CStifItemParser& aItem );
-        
-        // Test functions for EqualizerPresetsDialog.h
-        TInt CEqualizerPresetsDialogNewL( CStifItemParser& aItem );        
-        TInt ExecuteLD( CStifItemParser& aItem );
-        TInt SetAudioEqualizerL( CStifItemParser& aItem );
-        TInt Release( CStifItemParser& aItem );
-        
-        /**
-         * Method used to log version of test class
-         */
-        void SendTestClassVersion();
-
-        //ADD NEW METHOD DEC HERE
-        //[TestMethods] - Do not remove
-
-    public:     // Data
-        // ?one_line_short_description_of_data
-        //?data_declaration;
-
-    protected:  // Data
-        // ?one_line_short_description_of_data
-        //?data_declaration;
-
-    private:    // Data
-        
-        // ?one_line_short_description_of_data
-        //?data_declaration;
-
-        // Reserved pointer for future extension
-        //TAny* iReserved;
-
-    public:     // Friend classes
-        //?friend_class_declaration;
-    protected:  // Friend classes
-        //?friend_class_declaration;
-    private:    // Friend classes
-        //?friend_class_declaration;
-    	// Used to store a pointer to CAudioEqualizerUtility
-        CAudioEqualizerUtility* iAudEqUtility;
-        CEqualizerPresetsDialog* iEqDialog;          
-        CCustomCommand* iCustomCommand;
-        CEdwinTestControl* iEdwinTestControl;
-        TInt iInitStatus;
-
-    };
-
-#endif      // UI_EQUALIZERTEST_H
-
-// End of File
--- a/mmmw_plat/equalizer_ui_api/tsrc/ui_equalizertest/src/EdwinTestControl.cpp	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,150 +0,0 @@
-/*
-* 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:   STIF for MPEngine
-*
-*/
-
-// Version : %version: da1mmcf#2 %
-
-
-
-#include "EdwinTestControl.h"
-#include <eikenv.h>
-#include <aknsutils.h> 
-#include <aknsdrawutils.h> 
-#include <aknutils.h> 
-#include <aknsbasicbackgroundcontrolcontext.h>
-
-
-CEdwinTestControl::~CEdwinTestControl()
-	{
-	delete iEditWin;
-	iEditWin = NULL;
-	delete iBgContext;
-	iBgContext = NULL;
-	}   
- 
-CEdwinTestControl* CEdwinTestControl::NewL(void)
-    {
-    CEdwinTestControl* self = new(ELeave)CEdwinTestControl();
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
- 
-void CEdwinTestControl::ConstructL()
-    {
-    CreateWindowL();
- 
-    iEditWin = new (ELeave) CEikEdwin();
-    iEditWin->ConstructL( 0, 100, 100, 1 );
-    iEditWin->SetContainerWindowL( *this );
-    iEditWin->CreateTextViewL();
-//    iEditWin->SetInputCapabilitiesL( TCoeInputCapabilities::EAllText );
-    
-	// make first with no size at all
-	iBgContext = CAknsBasicBackgroundControlContext::NewL(KAknsIIDQsnBgScreen,TRect(0,0,1,1), ETrue );
-	// Setting rect will cause SizeChanged to be called
-	// and iBgContext size & position is updated accordingly.
-	SetRect( CEikonEnv::Static()->EikAppUi()->ClientRect() );	
-	
-	ActivateL();
-	DrawNow();
-    }
- 
-void CEdwinTestControl::SizeChanged()
-	{
-	if ( iBgContext )
-		{
-		iBgContext->SetRect(Rect());
- 
-		if ( &Window() )
-			{
-			iBgContext->SetParentPos( PositionRelativeToScreen() );
-			}
-		}
-	if ( iEditWin )
-		{
-		iEditWin->SetRect(Rect());	
-		}
-	}
- 
- 
-void CEdwinTestControl::HandleResourceChange( TInt aType )
-	{
-	TRect rect;
- 
-    if ( aType == KEikDynamicLayoutVariantSwitch )
-    	{    
-        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, rect);
-        SetRect(rect);
-    	}
- 
-	CCoeControl::HandleResourceChange(aType);
-	}
- 
- 
-TTypeUid::Ptr CEdwinTestControl::MopSupplyObject(TTypeUid aId)
-	{
-	if ( iBgContext )
-		{
-		return MAknsControlContext::SupplyMopObject( aId, iBgContext );
-		}	
-
-	return CCoeControl::MopSupplyObject( aId );
-	}
- 
- 
-void CEdwinTestControl::Draw(const TRect& aRect) const
-	{
-	CWindowGc& gc = SystemGc();
-    
-    // draw background skin first.
-  	MAknsSkinInstance* skin = AknsUtils::SkinInstance();
-	AknsDrawUtils::Background( skin, iBgContext, this, gc, aRect );
-	}
-
-TInt CEdwinTestControl::CountComponentControls() const
-{
-    return 1;
-}
- 
-CCoeControl* CEdwinTestControl::ComponentControl(TInt aIndex) const
-{
-    switch (aIndex)
-    	{
-        case 0:
-        	return iEditWin;
-        default:
-            return 0;
-    	}
-}
-
-void CEdwinTestControl::HandleControlEventL( CCoeControl* /*aControl*/, TCoeEvent /*aEventType*/)
-	{
-    // TODO: Add your control event handler code here
-	}
-
-TKeyResponse CEdwinTestControl::OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType )
-	{
-	if ( iEditWin )
-		{
-		return iEditWin->OfferKeyEventL( aKeyEvent, aType );
-		}
-	else
-		{
-		return EKeyWasNotConsumed;
-		}
-	}
--- a/mmmw_plat/equalizer_ui_api/tsrc/ui_equalizertest/src/ui_equalizertest.cpp	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,203 +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 testclass implementation.
-*
-*/
-
-// INCLUDE FILES
-#include <Stiftestinterface.h>
-#include "ui_equalizertest.h"
-#include <SettingServerClient.h>
-
-// EXTERNAL DATA STRUCTURES
-//extern  ?external_data;
-
-// EXTERNAL FUNCTION PROTOTYPES  
-//extern ?external_function( ?arg_type,?arg_type );
-
-// CONSTANTS
-//const ?type ?constant_var = ?constant;
-
-// MACROS
-//#define ?macro ?macro_def
-
-// LOCAL CONSTANTS AND MACROS
-//const ?type ?constant_var = ?constant;
-//#define ?macro_name ?macro_def
-
-// MODULE DATA STRUCTURES
-//enum ?declaration
-//typedef ?declaration
-
-// LOCAL FUNCTION PROTOTYPES
-//?type ?function_name( ?arg_type, ?arg_type );
-
-// FORWARD DECLARATIONS
-//class ?FORWARD_CLASSNAME;
-
-// ============================= LOCAL FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// ?function_name ?description.
-// ?description
-// Returns: ?value_1: ?description
-//          ?value_n: ?description_line1
-//                    ?description_line2
-// -----------------------------------------------------------------------------
-//
-/*
-?type ?function_name(
-    ?arg_type arg,  // ?description
-    ?arg_type arg)  // ?description
-    {
-
-    ?code  // ?comment
-
-    // ?comment
-    ?code
-    }
-*/
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// Cui_equalizertest::Cui_equalizertest
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// -----------------------------------------------------------------------------
-//
-Cui_equalizertest::Cui_equalizertest( 
-    CTestModuleIf& aTestModuleIf ):
-        CScriptBase( aTestModuleIf )
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// Cui_equalizertest::ConstructL
-// Symbian 2nd phase constructor can leave.
-// -----------------------------------------------------------------------------
-//
-void Cui_equalizertest::ConstructL()
-    {
-    //Read logger settings to check whether test case name is to be
-    //appended to log file name.
-    RSettingServer settingServer;
-    TInt ret = settingServer.Connect();
-    if(ret != KErrNone)
-        {
-        User::Leave(ret);
-        }
-    // Struct to StifLogger settigs.
-    TLoggerSettings loggerSettings; 
-    // Parse StifLogger defaults from STIF initialization file.
-    ret = settingServer.GetLoggerSettings(loggerSettings);
-    if(ret != KErrNone)
-        {
-        User::Leave(ret);
-        } 
-    // Close Setting server session
-    settingServer.Close();
-
-    TFileName logFileName;
-    
-    if(loggerSettings.iAddTestCaseTitle)
-        {
-        TName title;
-        TestModuleIf().GetTestCaseTitleL(title);
-        logFileName.Format(Kui_equalizertestLogFileWithTitle, &title);
-        }
-    else
-        {
-        logFileName.Copy(Kui_equalizertestLogFile);
-        }
-
-    iLog = CStifLogger::NewL( Kui_equalizertestLogPath, 
-                          logFileName,
-                          CStifLogger::ETxt,
-                          CStifLogger::EFile,
-                          EFalse );
-    
-    SendTestClassVersion();
-    
-
-    
-    
-    }
-
-// -----------------------------------------------------------------------------
-// Cui_equalizertest::NewL
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-//
-Cui_equalizertest* Cui_equalizertest::NewL( 
-    CTestModuleIf& aTestModuleIf )
-    {
-    Cui_equalizertest* self = new (ELeave) Cui_equalizertest( aTestModuleIf );
-
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop();
-
-    return self;
-
-    }
-
-// Destructor
-Cui_equalizertest::~Cui_equalizertest()
-    { 
-
-    // Delete resources allocated from test methods
-    Delete();
-
-    // Delete logger
-    delete iLog; 
-
-    }
-
-//-----------------------------------------------------------------------------
-// Cui_equalizertest::SendTestClassVersion
-// Method used to send version of test class
-//-----------------------------------------------------------------------------
-//
-void Cui_equalizertest::SendTestClassVersion()
-	{
-	TVersion moduleVersion;
-	moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR;
-	moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR;
-	moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD;
-	
-	TFileName moduleName;
-	moduleName = _L("ui_equalizertest.dll");
-
-	TBool newVersionOfMethod = ETrue;
-	TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod);
-	}
-
-// ========================== OTHER EXPORTED FUNCTIONS =========================
-
-// -----------------------------------------------------------------------------
-// LibEntryL is a polymorphic Dll entry point.
-// Returns: CScriptBase: New CScriptBase derived object
-// -----------------------------------------------------------------------------
-//
-EXPORT_C CScriptBase* LibEntryL( 
-    CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
-    {
-
-    return ( CScriptBase* ) Cui_equalizertest::NewL( aTestModuleIf );
-
-    }
-
-
-//  End of File
--- a/mmmw_plat/equalizer_ui_api/tsrc/ui_equalizertest/src/ui_equalizertestBlocks.cpp	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,382 +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 testclass implementation.
-*
-*/
-
-// [INCLUDE FILES] - do not remove
-#include <e32svr.h>
-#include <StifParser.h>
-#include <Stiftestinterface.h>
-#include "ui_equalizertest.h"
-
-#include <CustomCommandUtility.h>
-
-
-    class CCustomCommand : public CCustomCommandUtility
-    	{
-    	public:
-    	CCustomCommand()
-			{
-
-			}
-    	
-    	~CCustomCommand()
-    		{
-    		
-    		}
-    	
-    	TInt CustomCommandSync(const TMMFMessageDestinationPckg&  /*aDestination*/,
-    	                                     TInt                         aFunction,
-    	                               const TDesC8&                      /*aDataTo1*/,
-    	                               const TDesC8&                      /*aDataTo2*/,
-    	                               TDes8&                       aDataFrom)
-    		{
-    		const TUid KUidCustomInterfaceBuilder = {0x10200017};
-    		const TUid KUidAudioEqualizerEffect = { 0x1020382A };
-    		if( aFunction == 3 )
-    			{
-				TPckgBuf<TUint8> buf( 1 );
-				aDataFrom = buf;
-    			}
-    		//if( aFunction == 1 || aDestination().Interface() == KUidCustomInterfaceBuilder )
-    		else
-    			{
-				TMMFMessageDestination     builderHandle(KUidCustomInterfaceBuilder);
-				TMMFMessageDestinationPckg builderHandlePckg( builderHandle );
-				aDataFrom = builderHandlePckg;
-    			}
-    		return 0; 
-			}
-
-    	TInt CustomCommandSync(const TMMFMessageDestinationPckg&  /*aDestination*/,
-    	                                     TInt                         /*aFunction*/,
-    	                               const TDesC8&                      /*aDataTo1*/,
-    	                               const TDesC8&                      /*aDataTo2*/)
-    		{
-    		return 0; 
-    		}
-    	
-    	void CustomCommandAsync(const TMMFMessageDestinationPckg& /*aDestination*/,
-    	                                      TInt                        /*aFunction*/,
-    	                                const TDesC8&                     /*aDataTo1*/,
-    	                                const TDesC8&                     /*aDataTo2*/,
-    	                                      TDes8&                      /*aDataFrom*/,
-    	                                      TRequestStatus&             /*aStatus*/)
-    		{
-    		
-    		}
-    	
-    	void CustomCommandAsync(const TMMFMessageDestinationPckg& /*aDestination*/,
-    	                                      TInt                        /*aFunction*/,
-    	                                const TDesC8&                     /*aDataTo1*/,
-    	                                const TDesC8&                     /*aDataTo2*/,
-    	                                      TRequestStatus&             /*aStatus*/)
-    		{
-    		
-    		}
-    	};
-
-
-
-
-
-
-
-
-// EXTERNAL DATA STRUCTURES
-//extern  ?external_data;
-
-// EXTERNAL FUNCTION PROTOTYPES  
-//extern ?external_function( ?arg_type,?arg_type );
-
-// CONSTANTS
-//const ?type ?constant_var = ?constant;
-
-// MACROS
-//#define ?macro ?macro_def
-
-// LOCAL CONSTANTS AND MACROS
-//const ?type ?constant_var = ?constant;
-//#define ?macro_name ?macro_def
-
-// MODULE DATA STRUCTURES
-//enum ?declaration
-//typedef ?declaration
-
-// LOCAL FUNCTION PROTOTYPES
-//?type ?function_name( ?arg_type, ?arg_type );
-
-// FORWARD DECLARATIONS
-//class ?FORWARD_CLASSNAME;
-
-// ============================= LOCAL FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// ?function_name ?description.
-// ?description
-// Returns: ?value_1: ?description
-//          ?value_n: ?description_line1
-//                    ?description_line2
-// -----------------------------------------------------------------------------
-//
-/*
-?type ?function_name(
-    ?arg_type arg,  // ?description
-    ?arg_type arg)  // ?description
-    {
-
-    ?code  // ?comment
-
-    // ?comment
-    ?code
-    }
-*/
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// Cui_equalizertest::Delete
-// Delete here all resources allocated and opened from test methods. 
-// Called from destructor. 
-// -----------------------------------------------------------------------------
-//
-
-
-void Cui_equalizertest::Delete() 
-    {
-
-    }
-
-// -----------------------------------------------------------------------------
-// Cui_equalizertest::RunMethodL
-// Run specified method. Contains also table of test mothods and their names.
-// -----------------------------------------------------------------------------
-//
-TInt Cui_equalizertest::RunMethodL( 
-    CStifItemParser& aItem ) 
-    {
-
-    static TStifFunctionInfo const KFunctions[] =
-        {  
-        // Copy this line for every implemented function.
-        // First string is the function name used in TestScripter script file.
-        // Second is the actual implementation member function. 
-        ENTRY( "Example", Cui_equalizertest::ExampleL ),
-        //ADD NEW ENTRY HERE
-        // [test cases entries] - Do not remove
-        // Test functions for EqualizerPresetsDialog.h
-        ENTRY( "CEqualizerPresetsDialogNewL", Cui_equalizertest::CEqualizerPresetsDialogNewL ),
-        ENTRY( "ExecuteLD", Cui_equalizertest::ExecuteLD ),
-        ENTRY( "SetAudioEqualizerL", Cui_equalizertest::SetAudioEqualizerL ),
-        ENTRY( "Release", Cui_equalizertest::Release ),
-        
-              
-        };
-
-    const TInt count = sizeof( KFunctions ) / 
-                        sizeof( TStifFunctionInfo );
-
-    return RunInternalL( KFunctions, count, aItem );
-
-    }
-
-
-
-// ---------------------------------------------------------------------------
-// From MEqualizerPresetActivationObserver
-// Handle preset id activation from Equalizer dialog.
-// ---------------------------------------------------------------------------
-//
-void Cui_equalizertest::HandlePresetActivation(
-    TInt aActivatedPreset )
-    {
-    iLog->Log(_L("Cui_equalizertest::HandlePresetActivation :-> aActivatedPreset[%d]"), aActivatedPreset );
-    }
-
-// -----------------------------------------------------------------------------
-// Cui_equalizertest::ExampleL
-// Example test method function.
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-TInt Cui_equalizertest::ExampleL( CStifItemParser& aItem )
-    {
-
-    // Print to UI
-    _LIT( Kui_equalizertest, "ui_equalizertest" );
-    _LIT( KExample, "In Example" );
-    TestModuleIf().Printf( 0, Kui_equalizertest, KExample );
-    // Print to log file
-    iLog->Log( KExample );
-
-    TInt i = 0;
-    TPtrC string;
-    _LIT( KParam, "Param[%i]: %S" );
-    while ( aItem.GetNextString ( string ) == KErrNone )
-        {
-        TestModuleIf().Printf( i, Kui_equalizertest, 
-                                KParam, i, &string );
-        i++;
-        }
-
-    return KErrNone;
-
-    }
-
-
-// ---------------------------------------------------------------------------
-// Cui_equalizertest::CEqualizerPresetsDialogNewL
-// ?implementation_description
-// (other items were commented in a header).
-// ---------------------------------------------------------------------------
-//
-TInt Cui_equalizertest::CEqualizerPresetsDialogNewL( CStifItemParser& /*aItem*/ )
-    {
-    iLog->Log(_L("Cui_equalizertest::CEqualizerPresetsDialogNewL"));
-    TInt err = KErrNone;  
-    TInt presetId = 0;
-
-
-    iCustomCommand = new (ELeave) CCustomCommand;
-    
-    iAudEqUtility = CAudioEqualizerUtility::NewL( iCustomCommand );
-
-    //iEqDialog = CEqualizerPresetsDialog::NewL( iAudEqUtility, presetId, *this );
-    
-    TRAP( err , iEqDialog = CEqualizerPresetsDialog::NewL( iAudEqUtility, presetId, *this ) ); 
-    
-    if ( err == KErrNone )
-    	{    	
-    	iLog->Log(_L("CEqualizerPresetsDialogNewL return with no error!"));   		
-    	}
-    else
-    	{
-    	iLog->Log(_L("ERROR:CEqualizerPresetsDialogNewL fails!%d returns!"),err);
-    	}
-    return err;
-    }
-
-// ---------------------------------------------------------------------------
-// Cui_equalizertest::ExecuteLD
-// ?implementation_description
-// (other items were commented in a header).
-// ---------------------------------------------------------------------------
-//
-TInt Cui_equalizertest::ExecuteLD( CStifItemParser& /*aItem*/ )
-    {
-    iLog->Log(_L("Cui_equalizertest::ExecuteLD"));
-    TInt err = KErrNone;    
-    TInt ret = 0;
-    
-    iEdwinTestControl = CEdwinTestControl::NewL();
-    CleanupStack::PushL( iEdwinTestControl );
-    CCoeEnv::Static()->AppUi()->AddToStackL( iEdwinTestControl );
-    iEdwinTestControl->MakeVisible(ETrue);
-    CleanupStack::Pop( iEdwinTestControl );
-    
-    //TRAP_IGNORE( ret = iEqDialog->ExecuteLD() );
-    //TRAP( err,ret = iEqDialog->ExecuteLD() );
-    ret = iEqDialog->ExecuteLD();
-    
-    //iEqDialog->OfferKeyEventL( ret );
-    
-    if ( err == KErrNone )
-    	{    	
-    	iLog->Log(_L("ExecuteLD return with no error!"));   	
-    	iLog->Log(_L("ExecuteLD() return [%d]!"),ret); 
-    	}
-    else
-    	{
-    	iLog->Log(_L("ERROR:ExecuteLD fails!%d returns!"),err);
-    	}
-    return err;
-    }
-
-// ---------------------------------------------------------------------------
-// Cui_equalizertest::SetAudioEqualizerL
-// ?implementation_description
-// (other items were commented in a header).
-// ---------------------------------------------------------------------------
-//
-TInt Cui_equalizertest::SetAudioEqualizerL( CStifItemParser& /*aItem*/ )
-    {
-    iLog->Log(_L("Cui_equalizertest::SetAudioEqualizerL"));
-    TInt err = KErrNone;    
-    if( iAudEqUtility )
-    	{
-        //iEqDialog->SetAudioEqualizerL( iAudEqUtility );
-        TRAP( err,iEqDialog->SetAudioEqualizerL( iAudEqUtility ) );
-        if ( err == KErrNone )
-        	{    	
-        	iLog->Log(_L("SetAudioEqualizerL return with no error!"));   		
-        	}
-        else
-        	{
-        	iLog->Log(_L("ERROR:SetAudioEqualizerL fails!%d returns!"),err);
-        	}
-    	}
-    else
-    	{
-    	iLog->Log(_L("iAudEqUtility is NULL, can not call SetAudioEqualizerL(). User leave here."));
-    	User::Leave( 1000 );
-    	}
-    return err;
-    }
-
-// ---------------------------------------------------------------------------
-// Cui_equalizertest::Release
-// ?implementation_description
-// (other items were commented in a header).
-// ---------------------------------------------------------------------------
-//
-TInt Cui_equalizertest::Release( CStifItemParser& /*aItem*/ )
-    {
-    iLog->Log(_L("Cui_equalizertest::Release"));
-    TInt err = KErrNone; 
-    if( iEqDialog )
-    	{
-    	delete iEqDialog;
-    	}
-    if( iAudEqUtility )
-    	{
-    	delete iAudEqUtility;
-    	}
-    if( iEdwinTestControl )
-    	{
-    	delete iEdwinTestControl;
-    	}
-    return err;
-    }
-
-// -----------------------------------------------------------------------------
-// Cui_equalizertest::?member_function
-// ?implementation_description
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-/*
-TInt Cui_equalizertest::?member_function(
-   CItemParser& aItem )
-   {
-
-   ?code
-
-   }
-*/
-
-// ========================== OTHER EXPORTED FUNCTIONS =========================
-// None
-
-//  [End of File] - Do not remove
--- a/mmmw_plat/group/bld.inf	Mon May 03 12:59:52 2010 +0300
+++ b/mmmw_plat/group/bld.inf	Fri May 14 16:22:35 2010 +0300
@@ -19,14 +19,11 @@
 
 
 #include "../multimedia_data_source_api/group/bld.inf"
-#include "../progressive_download_api/group/bld.inf"
-#include "../equalizer_ui_api/group/bld.inf"
 #include "../enhanced_media_client_api/group/bld.inf"
 #include "../stream_control_custom_command_api/group/bld.inf"
 #include "../emc_buffer_source_api/group/bld.inf"
 #include "../emc_file_source_api/group/bld.inf"
 #include "../audio_metadata_reader_api/group/bld.inf"
-#include "../emc_progressive_download_source_api/group/bld.inf"
 #include "../emc_volume_effect_api/group/bld.inf"
 #include "../emc_balance_effect_api/group/bld.inf"
 #include "../emc_descriptor_source_api/group/bld.inf"
@@ -44,3 +41,4 @@
 #include "../telephony_multimedia_service_api/group/bld.inf"
 #include "../openmax_al_api/group/bld.inf"
 #include "../system_tone_service_api/group/bld.inf"
+#include "../openmax_al_ext_api/group/bld.inf"
--- a/mmmw_plat/openmax_al_api/openmax_al_api.metaxml	Mon May 03 12:59:52 2010 +0300
+++ b/mmmw_plat/openmax_al_api/openmax_al_api.metaxml	Fri May 14 16:22:35 2010 +0300
@@ -8,7 +8,7 @@
   <libs>
     <lib name="openmaxal.lib"/>
   </libs>
-  <release category="platform" sinceversion="0"/>
+  <release category="platform" sinceversion="^4"/>
   <attributes>
     <htmldocprovided>no</htmldocprovided>
     <adaptation>no</adaptation>
--- a/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_common.cfg	Mon May 03 12:59:52 2010 +0300
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_common.cfg	Fri May 14 16:22:35 2010 +0300
@@ -49,6 +49,71 @@
 XA_RESULT_OPERATION_ABORTED         15
 XA_RESULT_CONTROL_LOST              16
 
+MO_ENGINE                           1
+MO_PLAYER                           4
+MO_RECORDER                         5
+
+XA_BOOLEAN_FALSE                    0
+XA_BOOLEAN_TRUE                     1
+
+// IID numbers for interfaces
+XA_IID_NULL                         1
+XA_IID_OBJECT                       2
+XA_IID_CONFIGEXTENSION              3
+XA_IID_DYNAMICINTERFACEMANAGEMENT   4
+XA_IID_ENGINE                       5
+XA_IID_THREADSYNC                   6
+XA_IID_PLAY                         7
+XA_IID_PLAYBACKRATE                 8
+XA_IID_PREFETCHSTATUS               9
+XA_IID_SEEK                         10
+XA_IID_VOLUME                       11
+XA_IID_IMAGECONTROLS                12
+XA_IID_IMAGEEFFECTS                 13
+XA_IID_VIDEOPOSTPROCESSING          14
+XA_IID_RECORD                       15
+XA_IID_SNAPSHOT                     16
+XA_IID_METADATAEXTRACTION           17
+XA_IID_METADATAINSERTION            18
+XA_IID_METADATATRAVERSAL            19
+XA_IID_DYNAMICSOURCE                20
+XA_IID_CAMERACAPABILITIES           21
+XA_IID_CAMERA                       22
+XA_IID_AUDIOIODEVICECAPABILITIES    23
+XA_IID_DEVICEVOLUME                 24
+XA_IID_EQUALIZER                    25
+XA_IID_OUTPUTMIX                    26
+XA_IID_RADIO                        27
+XA_IID_RDS                          28
+XA_IID_VIBRA                        29
+XA_IID_LED                          30
+XA_IID_AUDIODECODERCAPABILITIES     31
+XA_IID_AUDIOENCODER                 32
+XA_IID_AUDIOENCODERCAPABILITIES     33
+XA_IID_IMAGEENCODERCAPABILITIES     34
+XA_IID_IMAGEDECODERCAPABILITIES     35
+XA_IID_IMAGEENCODER                 36
+XA_IID_VIDEODECODERCAPABILITIES     37
+XA_IID_VIDEOENCODER                 38
+XA_IID_VIDEOENCODERCAPABILITIES     39
+XA_IID_STREAMINFORMATION            40
+XA_IID_NOKIAVOLUMEEXT               41
+XA_IID_NOKIALINEARVOLUME            42
+
+XA_OBJECT_STATE_UNREALIZED          1
+XA_OBJECT_STATE_REALIZED            2
+XA_OBJECT_STATE_SUSPENDED           3
+
+XA_PLAYSTATE_STOPPED                1
+XA_PLAYSTATE_PAUSED                 2
+XA_PLAYSTATE_PLAYING                3
+
+WinPtX                              0
+WinPtY                              300
+WinTopLeft                          0
+WinTopRight                         0
+WinBotLeft                          320
+WinBotRight                         240
 [Enddefine]
 
 //Constants for Data Source
@@ -112,44 +177,44 @@
 //-------------------------------------------------
 
 // IID numbers for interfaces to mention during object creation
-//	 XA_IID_NULL                    	1
-//	 XA_IID_OBJECT                    	2
-//	 XA_IID_CONFIGEXTENSION             3
-//	 XA_IID_DYNAMICINTERFACEMANAGEMENT  4
-//	 XA_IID_ENGINE                    	5
-//	 XA_IID_THREADSYNC                  6
-//	 XA_IID_PLAY                    	7
-//	 XA_IID_PLAYBACKRATE                8
-//	 XA_IID_PREFETCHSTATUS              9
-//	 XA_IID_SEEK                    	10
-//	 XA_IID_VOLUME                    	11
-//	 XA_IID_IMAGECONTROLS               12
-//	 XA_IID_IMAGEEFFECTS                13
-//	 XA_IID_VIDEOPOSTPROCESSING         14
-//	 XA_IID_RECORD                    	15
-//	 XA_IID_SNAPSHOT                    16
-//	 XA_IID_METADATAEXTRACTION          17
-//	 XA_IID_METADATAINSERTION           18
-//	 XA_IID_METADATATRAVERSAL           19
-//	 XA_IID_DYNAMICSOURCE               20
-//	 XA_IID_CAMERACAPABILITIES          21
-//	 XA_IID_CAMERA                    	22
-//	 XA_IID_AUDIOIODEVICECAPABILITIES   23
-//	 XA_IID_DEVICEVOLUME                24
-//	 XA_IID_EQUALIZER                   25
-//	 XA_IID_OUTPUTMIX                   26
-//	 XA_IID_RADIO                    	27
-//	 XA_IID_RDS                         28
-//	 XA_IID_VIBRA                    	29
-//	 XA_IID_LED                         30
-//	 XA_IID_AUDIODECODERCAPABILITIES    31
-//	 XA_IID_AUDIOENCODER                32
-//	 XA_IID_AUDIOENCODERCAPABILITIES    33
-//	 XA_IID_IMAGEENCODERCAPABILITIES    34
-//	 XA_IID_IMAGEDECODERCAPABILITIES    35
-//	 XA_IID_IMAGEENCODER                36
-//	 XA_IID_VIDEODECODERCAPABILITIES    37
-//	 XA_IID_VIDEOENCODER                38
-//	 XA_IID_VIDEOENCODERCAPABILITIES    39
-//	 XA_IID_STREAMINFORMATION           40
+//   XA_IID_NULL                        1
+//   XA_IID_OBJECT                      2
+//   XA_IID_CONFIGEXTENSION             3
+//   XA_IID_DYNAMICINTERFACEMANAGEMENT  4
+//   XA_IID_ENGINE                      5
+//   XA_IID_THREADSYNC                  6
+//   XA_IID_PLAY                        7
+//   XA_IID_PLAYBACKRATE                8
+//   XA_IID_PREFETCHSTATUS              9
+//   XA_IID_SEEK                        10
+//   XA_IID_VOLUME                      11
+//   XA_IID_IMAGECONTROLS               12
+//   XA_IID_IMAGEEFFECTS                13
+//   XA_IID_VIDEOPOSTPROCESSING         14
+//   XA_IID_RECORD                      15
+//   XA_IID_SNAPSHOT                    16
+//   XA_IID_METADATAEXTRACTION          17
+//   XA_IID_METADATAINSERTION           18
+//   XA_IID_METADATATRAVERSAL           19
+//   XA_IID_DYNAMICSOURCE               20
+//   XA_IID_CAMERACAPABILITIES          21
+//   XA_IID_CAMERA                      22
+//   XA_IID_AUDIOIODEVICECAPABILITIES   23
+//   XA_IID_DEVICEVOLUME                24
+//   XA_IID_EQUALIZER                   25
+//   XA_IID_OUTPUTMIX                   26
+//   XA_IID_RADIO                       27
+//   XA_IID_RDS                         28
+//   XA_IID_VIBRA                       29
+//   XA_IID_LED                         30
+//   XA_IID_AUDIODECODERCAPABILITIES    31
+//   XA_IID_AUDIOENCODER                32
+//   XA_IID_AUDIOENCODERCAPABILITIES    33
+//   XA_IID_IMAGEENCODERCAPABILITIES    34
+//   XA_IID_IMAGEDECODERCAPABILITIES    35
+//   XA_IID_IMAGEENCODER                36
+//   XA_IID_VIDEODECODERCAPABILITIES    37
+//   XA_IID_VIDEOENCODER                38
+//   XA_IID_VIDEOENCODERCAPABILITIES    39
+//   XA_IID_STREAMINFORMATION           40
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_common_dynsrcitf.cfg	Fri May 14 16:22:35 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: 
+//
+//
+
+[Test]
+title 13.1 DynSrcItf SetSource
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_DYNAMICSOURCE
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_DYNAMICSOURCE
+ALImpl al_playitf_RegisterCallback
+ALImpl al_playitf_SetCallbackEventMask 31
+request Event_XA_PLAYEVENT_HEADATEND
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 10000
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 4
+ALImpl al_dynsrcitf_SetSource
+pause 10000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+
+[Test]
+title 13.2 DynSrcItf MediaPlayer MetadataExtraction GetValue MP3
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 2 XA_IID_DYNAMICSOURCE XA_IID_METADATAEXTRACTION
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_DYNAMICSOURCE
+ALImpl al_objitf_GetInterface MO_PLAYER 17
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/JapJap.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 4
+ALImpl al_dynsrcitf_SetSource
+ALImpl al_metadataextractionitf_GetValue KhronosTitle JapJap
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 13.3 DynSrcItf MediaPlayer MetadataExtraction GetValue MP4
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 2 XA_IID_DYNAMICSOURCE XA_IID_METADATAEXTRACTION
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_DYNAMICSOURCE
+ALImpl al_objitf_GetInterface MO_PLAYER 17
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/testmp4.mp4
+ALImpl al_SetDataFormat 1 video/mp4 10
+ALImpl al_SetDataSource 1 1 4
+ALImpl al_dynsrcitf_SetSource
+ALImpl al_metadataextractionitf_GetValue KhronosTitle mp4_aac
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 13.4 DynSrcItf MetadataExtractor MetadataExtraction GetValue MP3
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 3
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMetadataExtractor 2 17 XA_IID_DYNAMICSOURCE
+ALImpl al_objitf_Realize 8 0
+ALImpl al_objitf_GetInterface 8 XA_IID_DYNAMICSOURCE
+ALImpl al_objitf_GetInterface 8 17
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/JapJap.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 4
+ALImpl al_dynsrcitf_SetSource
+ALImpl al_metadataextractionitf_GetValue KhronosTitle JapJap
+ALImpl al_objitf_Destroy 8
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 13.5 DynSrcItf MediaPlayer MetadataExtraction GetValue MP4 S60 Reset
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 3
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMetadataExtractor 2 17 XA_IID_DYNAMICSOURCE
+ALImpl al_objitf_Realize 8 0
+ALImpl al_objitf_GetInterface 8 XA_IID_DYNAMICSOURCE
+ALImpl al_objitf_GetInterface 8 17
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/testmp4.mp4
+ALImpl al_SetDataFormat 1 video/mp4 10
+ALImpl al_SetDataSource 1 1 4
+ALImpl al_dynsrcitf_SetSource
+ALImpl al_metadataextractionitf_GetValue KhronosTitle mp4_aac
+ALImpl al_objitf_Destroy 8
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 13.6 DynSrcItf MediaPlayer MetadataExtraction GetValue MP3 Helix Reset
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/testmp4.mp4
+ALImpl al_SetDataFormat 1 video/mp4 10
+ALImpl al_SetDataSource 1 1 3
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMetadataExtractor 2 17 XA_IID_DYNAMICSOURCE
+ALImpl al_objitf_Realize 8 0
+ALImpl al_objitf_GetInterface 8 XA_IID_DYNAMICSOURCE
+ALImpl al_objitf_GetInterface 8 17
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/JapJap.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 4
+ALImpl al_dynsrcitf_SetSource
+ALImpl al_metadataextractionitf_GetValue KhronosTitle JapJap
+ALImpl al_objitf_Destroy 8
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_common_noklinvolitf.cfg	Fri May 14 16:22:35 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: 
+//
+//
+
+
+[StifSettings]
+CheckHeapBalance=on
+[EndStifSettings]
+
+[Test]
+title 17.1 NokiaLinearVolumeItf SetVolumeLevel
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_NOKIALINEARVOLUME
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_NOKIALINEARVOLUME
+ALImpl al_nokialinearvolumeitf_SetVolumeLevel 10
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 17.2 NokiaLinearVolumeItf GetVolumeLevel
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_NOKIALINEARVOLUME
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_NOKIALINEARVOLUME
+ALImpl al_nokialinearvolumeitf_GetVolumeLevel
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+
+[Test]
+title 17.3 NokiaLinearVolumeItf GetStepCount
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_NOKIALINEARVOLUME
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_NOKIALINEARVOLUME
+ALImpl al_nokialinearvolumeitf_GetStepCount
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 17.4 NokiaLinearVolumeItf GetStereoPosition
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_NOKIALINEARVOLUME
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_NOKIALINEARVOLUME
+ALImpl al_nokialinearvolumeitf_RegisterVolumeCallback
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 17.5 NokiaLinearVolumeItf SetCallbackEventsMask
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_NOKIALINEARVOLUME
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_NOKIALINEARVOLUME
+ALImpl al_nokialinearvolumeitf_SetCallbackEventsMask 12
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 17.6 NokiaLinearVolumeItf GetCallbackEventsMask
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_NOKIALINEARVOLUME
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_NOKIALINEARVOLUME
+ALImpl al_nokialinearvolumeitf_GetCallbackEventsMask
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_common_nokvolextitf.cfg	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,273 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description: 
+//
+//
+
+
+[StifSettings]
+CheckHeapBalance=on
+[EndStifSettings]
+
+[Test]
+title 16.1 NokiaVolumeExtItf SetVolumeLevel
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_NOKIAVOLUMEEXT
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_NOKIAVOLUMEEXT
+ALImpl al_nokiavolumeextitf_SetVolumeLevel 10
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 16.2 NokiaVolumeExtItf GetVolumeLevel
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_NOKIAVOLUMEEXT
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_NOKIAVOLUMEEXT
+ALImpl al_nokiavolumeextitf_GetVolumeLevel
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 16.3 NokiaVolumeExtItf GetMaxVolumeLevel
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_NOKIAVOLUMEEXT
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_NOKIAVOLUMEEXT
+ALImpl al_nokiavolumeextitf_GetMaxVolumeLevel
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 16.4 NokiaVolumeExtItf SetMute
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_NOKIAVOLUMEEXT
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_NOKIAVOLUMEEXT
+ALImpl al_playitf_RegisterCallback
+ALImpl al_playitf_SetCallbackEventMask 31
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+pause 10000
+ALImpl al_nokiavolumeextitf_SetMute 1
+pause 5000
+ALImpl al_nokiavolumeextitf_SetMute 0
+pause 5000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 16.5 NokiaVolumeExtItf GetMute
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_NOKIAVOLUMEEXT
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_NOKIAVOLUMEEXT
+ALImpl al_playitf_RegisterCallback
+ALImpl al_playitf_SetCallbackEventMask 31
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+pause 10000
+ALImpl al_nokiavolumeextitf_SetMute 1
+ALImpl al_nokiavolumeextitf_GetMute
+pause 5000
+ALImpl al_nokiavolumeextitf_SetMute 0
+ALImpl al_nokiavolumeextitf_GetMute
+pause 5000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 16.6 NokiaVolumeExtItf EnableStereoPosition
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_NOKIAVOLUMEEXT
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_NOKIAVOLUMEEXT
+ALImpl al_nokiavolumeextitf_EnableStereoPosition 1
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 16.7 NokiaVolumeExtItf IsEnabledStereoPosition
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_NOKIAVOLUMEEXT
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_NOKIAVOLUMEEXT
+ALImpl al_nokiavolumeextitf_EnableStereoPosition 1
+ALImpl al_nokiavolumeextitf_IsEnabledStereoPosition
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 16.8 NokiaVolumeExtItf SetStereoPosition
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_NOKIAVOLUMEEXT
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_NOKIAVOLUMEEXT
+ALImpl al_nokiavolumeextitf_EnableStereoPosition 1
+ALImpl al_nokiavolumeextitf_SetStereoPosition 1000
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 16.9 NokiaVolumeExtItf GetStereoPosition
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_NOKIAVOLUMEEXT
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_NOKIAVOLUMEEXT
+ALImpl al_nokiavolumeextitf_EnableStereoPosition 1
+ALImpl al_nokiavolumeextitf_SetStereoPosition 1000
+ALImpl al_nokiavolumeextitf_GetStereoPosition
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 16.10 NokiaVolumeExtItf RegisterVolumeCallback
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_NOKIAVOLUMEEXT
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_NOKIAVOLUMEEXT
+ALImpl al_nokiavolumeextitf_RegisterVolumeCallback
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 16.11 NokiaVolumeExtItf SetCallbackEventsMask
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_NOKIAVOLUMEEXT
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_NOKIAVOLUMEEXT
+ALImpl al_nokiavolumeextitf_SetCallbackEventsMask 12
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 16.12 NokiaVolumeExtItf GetCallbackEventsMask
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_NOKIAVOLUMEEXT
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_NOKIAVOLUMEEXT
+ALImpl al_nokiavolumeextitf_GetCallbackEventsMask
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_common_volumeitf.cfg	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,216 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description: 
+//
+//
+
+
+[StifSettings]
+CheckHeapBalance=on
+[EndStifSettings]
+
+[Test]
+title 15.1 VolumeItf SetVolumeLevel
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_VOLUME
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_VOLUME
+ALImpl al_volumeitf_SetVolumeLevel 10
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 15.2 VolumeItf GetVolumeLevel
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_VOLUME
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_VOLUME
+ALImpl al_volumeitf_GetVolumeLevel
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 15.3 VolumeItf GetMaxVolumeLevel
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_VOLUME
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_VOLUME
+ALImpl al_volumeitf_GetMaxVolumeLevel
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 15.4 VolumeItf SetMute
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_VOLUME
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_VOLUME
+ALImpl al_playitf_RegisterCallback
+ALImpl al_playitf_SetCallbackEventMask 31
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+pause 10000
+ALImpl al_volumeitf_SetMute 1
+pause 5000
+ALImpl al_volumeitf_SetMute 0
+pause 5000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 15.5 VolumeItf GetMute
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_VOLUME
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_VOLUME
+ALImpl al_playitf_RegisterCallback
+ALImpl al_playitf_SetCallbackEventMask 31
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+pause 10000
+ALImpl al_volumeitf_SetMute 1
+ALImpl al_volumeitf_GetMute
+pause 5000
+ALImpl al_volumeitf_SetMute 0
+ALImpl al_volumeitf_GetMute
+pause 5000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 15.6 VolumeItf EnableStereoPosition
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_VOLUME
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_VOLUME
+ALImpl al_volumeitf_EnableStereoPosition 1
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 15.7 VolumeItf IsEnabledStereoPosition
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_VOLUME
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_VOLUME
+ALImpl al_volumeitf_EnableStereoPosition 1
+ALImpl al_volumeitf_IsEnabledStereoPosition
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 15.8 VolumeItf SetStereoPosition
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_VOLUME
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_VOLUME
+ALImpl al_volumeitf_EnableStereoPosition 1
+ALImpl al_volumeitf_SetStereoPosition 1000
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 15.9 VolumeItf GetStereoPosition
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_VOLUME
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_VOLUME
+ALImpl al_volumeitf_EnableStereoPosition 1
+ALImpl al_volumeitf_SetStereoPosition 1000
+ALImpl al_volumeitf_GetStereoPosition
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
\ No newline at end of file
--- a/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_engine_aiodcitf.cfg	Mon May 03 12:59:52 2010 +0300
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_engine_aiodcitf.cfg	Fri May 14 16:22:35 2010 +0300
@@ -57,6 +57,11 @@
 //	 XA_IID_VIDEOENCODERCAPABILITIES    39
 //	 XA_IID_STREAMINFORMATION           40
 
+
+[StifSettings]
+CheckHeapBalance=on
+[EndStifSettings]
+
 [Test]
 title 3.1 AudioIODevCapItf GetAvailableAudioInputs
 create openmaxaltestmodule ALImpl
--- a/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_engine_audenccapitf.cfg	Mon May 03 12:59:52 2010 +0300
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_engine_audenccapitf.cfg	Fri May 14 16:22:35 2010 +0300
@@ -57,6 +57,11 @@
 //	 XA_IID_VIDEOENCODERCAPABILITIES    39
 //	 XA_IID_STREAMINFORMATION           40
 
+
+[StifSettings]
+CheckHeapBalance=on
+[EndStifSettings]
+
 [Test]
 title 4.1 AudioEncCapItf GetAudioEncoders
 create openmaxaltestmodule ALImpl
--- a/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_engine_engineitf.cfg	Mon May 03 12:59:52 2010 +0300
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_engine_engineitf.cfg	Fri May 14 16:22:35 2010 +0300
@@ -119,10 +119,9 @@
 ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.wav
 ALImpl al_SetDataFormat 1 audio/wav 15
 ALImpl al_SetDataSource 1 1 1
-ALImpl al_SetDataLocator 3 1 2910736386
+ALImpl al_SetDataLocator 3 1 2910736386 0
 ALImpl al_SetDataFormat 1 audio/wav 15
-ALImpl al_SetDataSink 3 1 1
-allownextresult 0
+ALImpl al_SetDataSink 3 6 1
 ALImpl al_engitf_CreateMediaPlayer 0
 ALImpl al_objitf_Destroy 4
 ALImpl al_objitf_Destroy 1
@@ -135,10 +134,10 @@
 ALImpl al_createEngine 1 1 0 0
 ALImpl al_objitf_Realize 1 0
 ALImpl al_objitf_GetInterface 1 5
-ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.wav
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav
 ALImpl al_SetDataFormat 1 audio/wav 15
 ALImpl al_SetDataSink 1 1 5
-ALImpl al_SetDataLocator 3 1 2910736385
+ALImpl al_SetDataLocator 3 1 2910736385 1
 ALImpl al_SetDataSource 3 1 1
 ALImpl al_engitf_CreateMediaRecorder
 ALImpl al_objitf_Destroy 5
@@ -165,12 +164,11 @@
 ALImpl al_createEngine 1 1 0 0
 ALImpl al_objitf_Realize 1 0
 ALImpl al_objitf_GetInterface 1 5
-ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.wav
-ALImpl al_SetDataFormat 1 audio/wav 15
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/JapJap.mp3
+ALImpl al_SetDataFormat 1 audio/mp3 9
 ALImpl al_SetDataSource 1 1 3
-allownextresult 12
-ALImpl al_engitf_CreateMetadataExtractor
-//ALImpl al_objitf_Destroy 8
+ALImpl al_engitf_CreateMetadataExtractor 1 17
+ALImpl al_objitf_Destroy 8
 ALImpl al_objitf_Destroy 1
 delete ALImpl
 [Endtest]
--- a/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_global.cfg	Mon May 03 12:59:52 2010 +0300
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_global.cfg	Fri May 14 16:22:35 2010 +0300
@@ -57,6 +57,10 @@
 //	 XA_IID_VIDEOENCODERCAPABILITIES    39
 //	 XA_IID_STREAMINFORMATION           40
 
+[StifSettings]
+CheckHeapBalance=on
+[EndStifSettings]
+
 [Test]
 title 1.1 xaCreateEngine
 create openmaxaltestmodule ALImpl
@@ -86,4 +90,13 @@
 ALImpl al_createEngine 1 1 0 0
 ALImpl al_objitf_Destroy 1
 delete ALImpl
-[Endtest] 
\ No newline at end of file
+[Endtest] 
+
+[Test]
+title 1.5 xaCreateEngine ThreadSafety
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 1 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_mo.cfg	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,155 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description: 
+//
+//
+
+
+// IID numbers for interfaces to mention during object creation
+//	 XA_IID_NULL                    	1
+//	 XA_IID_OBJECT                    	2
+//	 XA_IID_CONFIGEXTENSION             3
+//	 XA_IID_DYNAMICINTERFACEMANAGEMENT  4
+//	 XA_IID_ENGINE                    	5
+//	 XA_IID_THREADSYNC                  6
+//	 XA_IID_PLAY                    	7
+//	 XA_IID_PLAYBACKRATE                8
+//	 XA_IID_PREFETCHSTATUS              9
+//	 XA_IID_SEEK                    	10
+//	 XA_IID_VOLUME                    	11
+//	 XA_IID_IMAGECONTROLS               12
+//	 XA_IID_IMAGEEFFECTS                13
+//	 XA_IID_VIDEOPOSTPROCESSING         14
+//	 XA_IID_RECORD                    	15
+//	 XA_IID_SNAPSHOT                    16
+//	 XA_IID_METADATAEXTRACTION          17
+//	 XA_IID_METADATAINSERTION           18
+//	 XA_IID_METADATATRAVERSAL           19
+//	 XA_IID_DYNAMICSOURCE               20
+//	 XA_IID_CAMERACAPABILITIES          21
+//	 XA_IID_CAMERA                    	22
+//	 XA_IID_AUDIOIODEVICECAPABILITIES   23
+//	 XA_IID_DEVICEVOLUME                24
+//	 XA_IID_EQUALIZER                   25
+//	 XA_IID_OUTPUTMIX                   26
+//	 XA_IID_RADIO                    	27
+//	 XA_IID_RDS                         28
+//	 XA_IID_VIBRA                    	29
+//	 XA_IID_LED                         30
+//	 XA_IID_AUDIODECODERCAPABILITIES    31
+//	 XA_IID_AUDIOENCODER                32
+//	 XA_IID_AUDIOENCODERCAPABILITIES    33
+//	 XA_IID_IMAGEENCODERCAPABILITIES    34
+//	 XA_IID_IMAGEDECODERCAPABILITIES    35
+//	 XA_IID_IMAGEENCODER                36
+//	 XA_IID_VIDEODECODERCAPABILITIES    37
+//	 XA_IID_VIDEOENCODER                38
+//	 XA_IID_VIDEOENCODERCAPABILITIES    39
+//	 XA_IID_STREAMINFORMATION           40
+
+
+[StifSettings]
+CheckHeapBalance=on
+[EndStifSettings]
+
+[Test]
+title 20.1 MetadataExtractor QueryNumSupportedInterfaces
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/JapJap.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 3
+ALImpl al_engitf_CreateMetadataExtractor 1 17
+ALImpl al_engitf_QueryNumSupportedInterfaces 8
+ALImpl al_objitf_Destroy 8
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 20.2 MetadataExtractor QuerySupportedInterfaces
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/JapJap.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 3
+ALImpl al_engitf_CreateMetadataExtractor 1 17
+ALImpl al_engitf_QuerySupportedInterfaces 8 0
+ALImpl al_objitf_Destroy 8
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 20.3 MetadataExtractor DynItf AddItf
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/JapJap.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 3
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMetadataExtractor 1 17
+ALImpl al_objitf_Realize 8 0
+ALImpl al_objitf_GetInterface 8 4
+ALImpl al_dimitf_AddInterface 3 0
+ALImpl al_dimitf_RemoveInterface 3 
+ALImpl al_objitf_Destroy 8
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 20.4 MetadataExtractor Resume Itf
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/JapJap.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 3
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMetadataExtractor 1 17
+ALImpl al_objitf_Realize 8 0
+allownextresult 1
+ALImpl al_objitf_Resume 8 0
+ALImpl al_objitf_Destroy 8
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 20.5 MetadataExtractor ResumeInterface Itf
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/JapJap.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 3
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMetadataExtractor 1 17
+ALImpl al_objitf_Realize 8 0
+ALImpl al_objitf_GetInterface 8 4
+ALImpl al_dimitf_ResumeInterface 3 0
+ALImpl al_dimitf_RemoveInterface 3
+ALImpl al_objitf_Destroy 8
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_mo_mdextractionitf.cfg	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,352 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description: 
+//
+//
+
+
+// IID numbers for interfaces to mention during object creation
+//	 XA_IID_NULL                    	1
+//	 XA_IID_OBJECT                    	2
+//	 XA_IID_CONFIGEXTENSION             3
+//	 XA_IID_DYNAMICINTERFACEMANAGEMENT  4
+//	 XA_IID_ENGINE                    	5
+//	 XA_IID_THREADSYNC                  6
+//	 XA_IID_PLAY                    	7
+//	 XA_IID_PLAYBACKRATE                8
+//	 XA_IID_PREFETCHSTATUS              9
+//	 XA_IID_SEEK                    	10
+//	 XA_IID_VOLUME                    	11
+//	 XA_IID_IMAGECONTROLS               12
+//	 XA_IID_IMAGEEFFECTS                13
+//	 XA_IID_VIDEOPOSTPROCESSING         14
+//	 XA_IID_RECORD                    	15
+//	 XA_IID_SNAPSHOT                    16
+//	 XA_IID_METADATAEXTRACTION          17
+//	 XA_IID_METADATAINSERTION           18
+//	 XA_IID_METADATATRAVERSAL           19
+//	 XA_IID_DYNAMICSOURCE               20
+//	 XA_IID_CAMERACAPABILITIES          21
+//	 XA_IID_CAMERA                    	22
+//	 XA_IID_AUDIOIODEVICECAPABILITIES   23
+//	 XA_IID_DEVICEVOLUME                24
+//	 XA_IID_EQUALIZER                   25
+//	 XA_IID_OUTPUTMIX                   26
+//	 XA_IID_RADIO                    	27
+//	 XA_IID_RDS                         28
+//	 XA_IID_VIBRA                    	29
+//	 XA_IID_LED                         30
+//	 XA_IID_AUDIODECODERCAPABILITIES    31
+//	 XA_IID_AUDIOENCODER                32
+//	 XA_IID_AUDIOENCODERCAPABILITIES    33
+//	 XA_IID_IMAGEENCODERCAPABILITIES    34
+//	 XA_IID_IMAGEDECODERCAPABILITIES    35
+//	 XA_IID_IMAGEENCODER                36
+//	 XA_IID_VIDEODECODERCAPABILITIES    37
+//	 XA_IID_VIDEOENCODER                38
+//	 XA_IID_VIDEOENCODERCAPABILITIES    39
+//	 XA_IID_STREAMINFORMATION           40
+
+//Container Type
+// XA_CONTAINERTYPE_UNSPECIFIED 1
+// XA_CONTAINERTYPE_RAW 2
+// XA_CONTAINERTYPE_ASF 3
+// XA_CONTAINERTYPE_AVI 4
+// XA_CONTAINERTYPE_BMP 5
+// XA_CONTAINERTYPE_JPG 6
+// XA_CONTAINERTYPE_JPG2000 7
+// XA_CONTAINERTYPE_M4A 8
+// XA_CONTAINERTYPE_MP3 9
+// XA_CONTAINERTYPE_MP4 10
+// XA_CONTAINERTYPE_MPEG_ES 11
+// XA_CONTAINERTYPE_MPEG_PS 12
+// XA_CONTAINERTYPE_MPEG_TS 13
+// XA_CONTAINERTYPE_QT 14
+// XA_CONTAINERTYPE_WAV 15
+// XA_CONTAINERTYPE_XMF_0 16
+// XA_CONTAINERTYPE_XMF_1 17
+// XA_CONTAINERTYPE_XMF_2 18
+// XA_CONTAINERTYPE_XMF_3 19
+// XA_CONTAINERTYPE_XMF_GENERIC 20
+// XA_CONTAINERTYPE_AMR 21
+// XA_CONTAINERTYPE_AAC 22
+// XA_CONTAINERTYPE_3GPP 23
+// XA_CONTAINERTYPE_3GA 24
+// XA_CONTAINERTYPE_RM 25
+// XA_CONTAINERTYPE_DMF 26
+// XA_CONTAINERTYPE_SMF 27
+// XA_CONTAINERTYPE_MOBILE_DLS 28
+// XA_CONTAINERTYPE_0GG 29
+
+//Data Locator
+// XA_DATALOCATOR_URI 1
+// XA_DATALOCATOR_ADDRESS 2
+// XA_DATALOCATOR_IODEVICE 3
+// XA_DATALOCATOR_OUTPUTMIX 4
+// XA_DATALOCATOR_NATIVEDISPLAY 5
+
+//MDU KEYS 
+//KhronosTitle
+//KhronosArtist
+//KhronosAlbum
+//KhronosYear
+//KhronosComment
+//KhronosTrackNumber
+//KhronosGenre
+//Composer
+//KhronosCopyright
+//KhronosContentURL
+//attachedpicture
+//Vendor
+//KhronosRating
+//Duration
+
+[Test]
+title 18.1 MetadataExtractionItf GetItemCount MP3
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/JapJap.mp3
+ALImpl al_SetDataFormat 1 audio/mp3 9
+ALImpl al_SetDataSource 1 1 3
+ALImpl al_engitf_CreateMetadataExtractor 1 17
+ALImpl al_objitf_Realize 8 0
+ALImpl al_objitf_GetInterface 8 17
+ALImpl al_metadataextractionitf_GetItemCount
+ALImpl al_objitf_Destroy 8
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 18.2 MetadataExtractionItf GetKeySize 1 MP3
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/JapJap.mp3
+ALImpl al_SetDataFormat 1 audio/mp3 9
+ALImpl al_SetDataSource 1 1 3
+ALImpl al_engitf_CreateMetadataExtractor 1 17
+ALImpl al_objitf_Realize 8 0
+ALImpl al_objitf_GetInterface 8 17
+ALImpl al_metadataextractionitf_GetKeySize 1
+ALImpl al_objitf_Destroy 8
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 18.3 MetadataExtractionItf GetKey 1 MP3
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/JapJap.mp3
+ALImpl al_SetDataFormat 1 audio/mp3 9
+ALImpl al_SetDataSource 1 1 3
+ALImpl al_engitf_CreateMetadataExtractor 1 17
+ALImpl al_objitf_Realize 8 0
+ALImpl al_objitf_GetInterface 8 17
+//ALImpl al_metadataextractionitf_GetKey 1 40
+ALImpl al_metadataextractionitf_GetKey KhronosTitle
+ALImpl al_objitf_Destroy 8
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 18.4 MetadataExtractionItf GetValueSize 1 MP3
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/JapJap.mp3
+ALImpl al_SetDataFormat 1 audio/mp3 9
+ALImpl al_SetDataSource 1 1 3
+ALImpl al_engitf_CreateMetadataExtractor 1 17
+ALImpl al_objitf_Realize 8 0
+ALImpl al_objitf_GetInterface 8 17
+ALImpl al_metadataextractionitf_GetValueSize 1
+ALImpl al_objitf_Destroy 8
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 18.5 MetadataExtractionItf GetValue 1 MP3
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/JapJap.mp3
+ALImpl al_SetDataFormat 1 audio/mp3 9
+ALImpl al_SetDataSource 1 1 3
+ALImpl al_engitf_CreateMetadataExtractor 1 17
+ALImpl al_objitf_Realize 8 0
+ALImpl al_objitf_GetInterface 8 17
+//ALImpl al_metadataextractionitf_GetValue 1 59
+ALImpl al_metadataextractionitf_GetValue KhronosTitle JapJap
+ALImpl al_objitf_Destroy 8
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 18.6 MetadataExtractionItf GetCoverArt MP3
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/JapJap.mp3
+ALImpl al_SetDataFormat 1 audio/mp3 9
+ALImpl al_SetDataSource 1 1 3
+ALImpl al_engitf_CreateMetadataExtractor 1 17
+ALImpl al_objitf_Realize 8 0
+ALImpl al_objitf_GetInterface 8 17
+ALImpl al_metadataextractionitf_GetCoverArt
+ALImpl al_objitf_Destroy 8
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 18.7 MetadataExtractionItf GetItemCount MP4
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/testmp4.mp4
+ALImpl al_SetDataFormat 1 video/mp4 10
+ALImpl al_SetDataSource 1 1 3
+ALImpl al_engitf_CreateMetadataExtractor 1 17
+ALImpl al_objitf_Realize 8 0
+ALImpl al_objitf_GetInterface 8 17
+ALImpl al_metadataextractionitf_GetItemCount
+ALImpl al_objitf_Destroy 8
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 18.8 MetadataExtractionItf GetKeySize 1 MP4
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/testmp4.mp4
+ALImpl al_SetDataFormat 1 video/mp4 10
+ALImpl al_SetDataSource 1 1 3
+ALImpl al_engitf_CreateMetadataExtractor 1 17
+ALImpl al_objitf_Realize 8 0
+ALImpl al_objitf_GetInterface 8 17
+ALImpl al_metadataextractionitf_GetKeySize 1
+ALImpl al_objitf_Destroy 8
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 18.9 MetadataExtractionItf GetKey 1 MP4
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/testmp4.mp4
+ALImpl al_SetDataFormat 1 video/mp4 10
+ALImpl al_SetDataSource 1 1 3
+ALImpl al_engitf_CreateMetadataExtractor 1 17
+ALImpl al_objitf_Realize 8 0
+ALImpl al_objitf_GetInterface 8 17
+ALImpl al_metadataextractionitf_GetKey KhronosTitle
+ALImpl al_objitf_Destroy 8
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 18.10 MetadataExtractionItf GetValueSize 1 MP4
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/testmp4.mp4
+ALImpl al_SetDataFormat 1 video/mp4 10
+ALImpl al_SetDataSource 1 1 3
+ALImpl al_engitf_CreateMetadataExtractor 1 17
+ALImpl al_objitf_Realize 8 0
+ALImpl al_objitf_GetInterface 8 17
+ALImpl al_metadataextractionitf_GetValueSize 1
+ALImpl al_objitf_Destroy 8
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 18.11 MetadataExtractionItf GetValue 1 MP4
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/testmp4.mp4
+ALImpl al_SetDataFormat 1 video/mp4 10
+ALImpl al_SetDataSource 1 1 3
+ALImpl al_engitf_CreateMetadataExtractor 1 17
+ALImpl al_objitf_Realize 8 0
+ALImpl al_objitf_GetInterface 8 17
+ALImpl al_metadataextractionitf_GetValue KhronosTitle mp4_aac
+ALImpl al_objitf_Destroy 8
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 18.12 MetadataExtractionItf AddKeyFilter
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/JapJap.mp3
+ALImpl al_SetDataFormat 1 audio/mp3 9
+ALImpl al_SetDataSource 1 1 3
+ALImpl al_engitf_CreateMetadataExtractor 1 17
+ALImpl al_objitf_Realize 8 0
+ALImpl al_objitf_GetInterface 8 17
+allownextresult 2
+ALImpl al_metadataextractionitf_AddKeyFilter
+ALImpl al_objitf_Destroy 8
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 18.13 MetadataExtractionItf ClearKeyFilter
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/JapJap.mp3
+ALImpl al_SetDataFormat 1 audio/mp3 9
+ALImpl al_SetDataSource 1 1 3
+ALImpl al_engitf_CreateMetadataExtractor 1 17
+ALImpl al_objitf_Realize 8 0
+ALImpl al_objitf_GetInterface 8 17
+allownextresult 2
+ALImpl al_metadataextractionitf_ClearKeyFilter
+ALImpl al_objitf_Destroy 8
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest] 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_mp.cfg	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,194 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description: 
+//
+//
+
+
+// IID numbers for interfaces to mention during object creation
+//	 XA_IID_NULL                    	1
+//	 XA_IID_OBJECT                    	2
+//	 XA_IID_CONFIGEXTENSION             3
+//	 XA_IID_DYNAMICINTERFACEMANAGEMENT  4
+//	 XA_IID_ENGINE                    	5
+//	 XA_IID_THREADSYNC                  6
+//	 XA_IID_PLAY                    	7
+//	 XA_IID_PLAYBACKRATE                8
+//	 XA_IID_PREFETCHSTATUS              9
+//	 XA_IID_SEEK                    	10
+//	 XA_IID_VOLUME                    	11
+//	 XA_IID_IMAGECONTROLS               12
+//	 XA_IID_IMAGEEFFECTS                13
+//	 XA_IID_VIDEOPOSTPROCESSING         14
+//	 XA_IID_RECORD                    	15
+//	 XA_IID_SNAPSHOT                    16
+//	 XA_IID_METADATAEXTRACTION          17
+//	 XA_IID_METADATAINSERTION           18
+//	 XA_IID_METADATATRAVERSAL           19
+//	 XA_IID_DYNAMICSOURCE               20
+//	 XA_IID_CAMERACAPABILITIES          21
+//	 XA_IID_CAMERA                    	22
+//	 XA_IID_AUDIOIODEVICECAPABILITIES   23
+//	 XA_IID_DEVICEVOLUME                24
+//	 XA_IID_EQUALIZER                   25
+//	 XA_IID_OUTPUTMIX                   26
+//	 XA_IID_RADIO                    	27
+//	 XA_IID_RDS                         28
+//	 XA_IID_VIBRA                    	29
+//	 XA_IID_LED                         30
+//	 XA_IID_AUDIODECODERCAPABILITIES    31
+//	 XA_IID_AUDIOENCODER                32
+//	 XA_IID_AUDIOENCODERCAPABILITIES    33
+//	 XA_IID_IMAGEENCODERCAPABILITIES    34
+//	 XA_IID_IMAGEDECODERCAPABILITIES    35
+//	 XA_IID_IMAGEENCODER                36
+//	 XA_IID_VIDEODECODERCAPABILITIES    37
+//	 XA_IID_VIDEOENCODER                38
+//	 XA_IID_VIDEOENCODERCAPABILITIES    39
+//	 XA_IID_STREAMINFORMATION           40
+
+
+[StifSettings]
+CheckHeapBalance=on
+[EndStifSettings]
+
+[Test]
+title 9.1 MediaPlayer CreateAudioMediaPlayer
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 9.2 PlayItf CreateVideoMediaPlayer
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.3gp
+ALImpl al_SetDataFormat 1 video/3gp 23
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 9.3 MediaPlayer QueryNumSupportedInterfaces
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_engitf_QueryNumSupportedInterfaces 4
+ALImpl al_engitf_QueryNumSupportedInterfaces 1
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 9.4 MediaPlayer QuerySupportedInterfaces
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_engitf_QuerySupportedInterfaces 4 0
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 9.5 MediaPlayer DynItf AddItf
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface 4 4
+ALImpl al_dimitf_AddInterface 17 0
+ALImpl al_dimitf_RemoveInterface 17 
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 9.6 MediaPlayer Resume Itf
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+allownextresult 1
+ALImpl al_objitf_Resume 4 0
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 9.7 MediaPlayer DynItf ResumeItf
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface 4 4
+ALImpl al_dimitf_ResumeInterface 17 0
+ALImpl al_dimitf_RemoveInterface 17 
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_mp_mdextractionitf.cfg	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,223 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description: 
+//
+//
+
+[Test]
+title 19.1 MediaPlayer MetadataExtractionItf GetItemCount MP3
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/JapJap.mp3
+ALImpl al_SetDataFormat 1 audio/mp3 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 17
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER 17
+ALImpl al_metadataextractionitf_GetItemCount
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 19.2 MediaPlayer MetadataExtractionItf GetKeySize MP3
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/JapJap.mp3
+ALImpl al_SetDataFormat 1 audio/mp3 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 17
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER 17
+ALImpl al_metadataextractionitf_GetKeySize 1
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest] 
+[Test]
+title 19.3 MediaPlayer MetadataExtractionItf GetKey MP3
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/JapJap.mp3
+ALImpl al_SetDataFormat 1 audio/mp3 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 17
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER 17
+ALImpl al_metadataextractionitf_GetKey KhronosTitle
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 19.4 MediaPlayer MetadataExtractionItf GetValueSize MP3
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/JapJap.mp3
+ALImpl al_SetDataFormat 1 audio/mp3 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 17
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER 17
+ALImpl al_metadataextractionitf_GetValueSize 1
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 19.5 MediaPlayer MetadataExtractionItf GetValue MP3
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/JapJap.mp3
+ALImpl al_SetDataFormat 1 audio/mp3 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 17
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER 17
+ALImpl al_metadataextractionitf_GetValue KhronosTitle JapJap
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 19.6 MediaPlayer MetadataExtractionItf GetCoverArt MP3
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/JapJap.mp3
+ALImpl al_SetDataFormat 1 audio/mp3 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 17
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER 17
+ALImpl al_metadataextractionitf_GetCoverArt
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 19.7 MediaPlayer MetadataExtractionItf GetItemCount MP4
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/testmp4.mp4
+ALImpl al_SetDataFormat 1 video/mp4 10
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 17
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER 17
+ALImpl al_metadataextractionitf_GetItemCount
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 19.8 MediaPlayer MetadataExtractionItf GetKeySize MP4
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/testmp4.mp4
+ALImpl al_SetDataFormat 1 video/mp4 10
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 17
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER 17
+ALImpl al_metadataextractionitf_GetKeySize 1
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest] 
+[Test]
+title 19.9 MediaPlayer MetadataExtractionItf GetKey MP4
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/testmp4.mp4
+ALImpl al_SetDataFormat 1 video/mp4 10
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 17
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER 17
+ALImpl al_metadataextractionitf_GetKey KhronosTitle
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 19.10 MediaPlayer MetadataExtractionItf GetValueSize MP4
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/testmp4.mp4
+ALImpl al_SetDataFormat 1 video/mp4 10
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 17
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER 17
+ALImpl al_metadataextractionitf_GetValueSize 1
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 19.11 MediaPlayer MetadataExtractionItf GetValue MP4
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/testmp4.mp4
+ALImpl al_SetDataFormat 1 video/mp4 10
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 17
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER 17
+ALImpl al_metadataextractionitf_GetValue KhronosTitle mp4_aac
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest] 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_mp_objectitf.cfg	Fri May 14 16:22:35 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: 
+//
+//
+
+
+[StifSettings]
+CheckHeapBalance=on
+[EndStifSettings]
+
+[Test]
+title 10.1 ObjectItf Realize
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 10.2 ObjectItf Resume
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+allownextresult XA_RESULT_PRECONDITIONS_VIOLATED
+ALImpl al_objitf_Resume MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 10.3 ObjectItf GetStateUnrealized
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_GetState MO_PLAYER XA_OBJECT_STATE_UNREALIZED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 10.4 ObjectItf GetStateRealized
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetState MO_PLAYER XA_OBJECT_STATE_REALIZED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 10.5 ObjectItf GetInterafcePlayItf
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 10.6 ObjectItf RegisterCallback
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_RegisterCallback MO_PLAYER
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 10.7 ObjectItf AbortAsyncOperation
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_RegisterCallback MO_PLAYER
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_AbortAsyncOperation MO_PLAYER
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 10.8 ObjectItf Destroy
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 10.9 ObjectItf SetPriority
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_SetPriority MO_PLAYER 3456789 1
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest] 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_mp_playitf.cfg	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,1435 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description: 
+//
+//
+
+
+[StifSettings]
+CheckHeapBalance=on
+[EndStifSettings]
+
+[Test]
+title 11.1 PlayItf GetInterafcePlayItfFailure
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+allownextresult XA_RESULT_PRECONDITIONS_VIOLATED
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.2 PlayItf GetInterafcePlayItf
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.3 PlayItf SetStatePlayStop
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 5000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+
+[Test]
+title 11.4 PlayItf SetStatePlayPausePlayStop
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 5000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PAUSED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PAUSED
+pause 2000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 5000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.5 PlayItf SetStatePause
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PAUSED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PAUSED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.6 PlayItf GetState
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.7 PlayItf GetDurationNullParam
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+allownextresult XA_RESULT_PARAMETER_INVALID
+ALImpl al_playitf_GetDurationNullParam
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.8 PlayItf GetDuration
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_GetDuration 19000 21000
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.9 PlayItf GetPositionNullParam
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+allownextresult XA_RESULT_PARAMETER_INVALID
+ALImpl al_playitf_GetPositionNullParam
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.10 PlayItf GetPositionZero
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_GetPosition 0 0
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.11 PlayItf GetPosition5Sec
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 5000
+ALImpl al_playitf_GetPosition
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.12 PlayItf RegisterCallback
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_RegisterCallback
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.13 PlayItf SetCallbackEventMaskInvalid
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+allownextresult XA_RESULT_PARAMETER_INVALID
+ALImpl al_playitf_SetCallbackEventMask 32
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.14 PlayItf SetCallbackEventMask
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetCallbackEventMask 31
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.15 PlayItf GetCallbackEventMaskInvalid
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+allownextresult XA_RESULT_PARAMETER_INVALID
+ALImpl al_playitf_GetCallbackEventMaskNullParam
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+
+[Test]
+title 11.16 PlayItf GetCallbackEventMask
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetCallbackEventMask 31
+ALImpl al_playitf_GetCallbackEventMask 31
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.17 PlayItf SetMarkerPositionInvalid
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+allownextresult XA_RESULT_PARAMETER_INVALID
+ALImpl al_playitf_SetMarkerPosition 300000
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.18 PlayItf SetMarkerPosition
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetMarkerPosition 10000
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.19 PlayItf ClearMarkerPosition
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetMarkerPosition 10000
+ALImpl al_playitf_ClearMarkerPosition
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.20 PlayItf GetMarkerPositionInvalid
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+allownextresult XA_RESULT_PARAMETER_INVALID
+ALImpl al_playitf_GetMarkerPositionNullParam
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.21 PlayItf GetMarkerPositionPreConditionViolation
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+allownextresult XA_RESULT_PRECONDITIONS_VIOLATED
+ALImpl al_playitf_GetMarkerPosition 0
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.22 PlayItf SetGetMarkerPosition
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetMarkerPosition 10000
+ALImpl al_playitf_GetMarkerPosition 10000
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.23 PlayItf SetClearGetMarkerPosition
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetMarkerPosition 10000
+ALImpl al_playitf_GetMarkerPosition 10000
+ALImpl al_playitf_ClearMarkerPosition
+allownextresult XA_RESULT_PRECONDITIONS_VIOLATED
+ALImpl al_playitf_GetMarkerPosition 0
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.24 PlayItf SetPositionUpdatePeriod
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetPositionUpdatePeriod 10000
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.25 PlayItf GetPositionUpdatePeriodInvalid
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+allownextresult XA_RESULT_PARAMETER_INVALID
+ALImpl al_playitf_GetPositionUpdatePeriodNullParam 10000
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.26 PlayItf GetPositionUpdatePeriod
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_GetPositionUpdatePeriod 1000
+ALImpl al_playitf_SetPositionUpdatePeriod 10000
+ALImpl al_playitf_GetPositionUpdatePeriod 10000
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.27 PlayItf PlayEventHeadMoving
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_RegisterCallback
+ALImpl al_playitf_SetCallbackEventMask 31
+request Event_XA_PLAYEVENT_HEADMOVING
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+wait Event_XA_PLAYEVENT_HEADMOVING
+release Event_XA_PLAYEVENT_HEADMOVING
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.28 PlayItf PlayEventHeadAtEnd
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_RegisterCallback
+ALImpl al_playitf_SetCallbackEventMask 31
+request Event_XA_PLAYEVENT_HEADATEND
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+wait Event_XA_PLAYEVENT_HEADATEND
+release Event_XA_PLAYEVENT_HEADATEND
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PAUSED
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.29 PlayItf PlayEventHeadAtMarker
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_RegisterCallback
+ALImpl al_playitf_SetCallbackEventMask 2
+ALImpl al_playitf_SetMarkerPosition 3000
+request Event_XA_PLAYEVENT_HEADATMARKER
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+wait Event_XA_PLAYEVENT_HEADATMARKER
+release Event_XA_PLAYEVENT_HEADATMARKER
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.30 PlayItf PlayEventHeadAtMarkerPlayPausePlay
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_RegisterCallback
+ALImpl al_playitf_SetCallbackEventMask 2
+ALImpl al_playitf_SetMarkerPosition 15000
+request Event_XA_PLAYEVENT_HEADATMARKER
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 10000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PAUSED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PAUSED
+pause 2000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+wait Event_XA_PLAYEVENT_HEADATMARKER
+release Event_XA_PLAYEVENT_HEADATMARKER
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.31 PlayItf PlayEventHeadAtNewPos
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_RegisterCallback
+ALImpl al_playitf_SetCallbackEventMask 5
+ALImpl al_playitf_SetPositionUpdatePeriod 2000
+request Event_XA_PLAYEVENT_HEADATEND
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+wait Event_XA_PLAYEVENT_HEADATEND
+release Event_XA_PLAYEVENT_HEADATEND
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.32 PlayItf GetInterafcePlayItfFailure
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.3gp
+ALImpl al_SetDataFormat 1 video/3gp 23
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+allownextresult XA_RESULT_PRECONDITIONS_VIOLATED
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.33 PlayItf GetInterafcePlayItf
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.3gp
+ALImpl al_SetDataFormat 1 video/3gp 23
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.34 PlayItf SetStatePlayStop
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.3gp
+ALImpl al_SetDataFormat 1 video/3gp 23
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 5000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+
+[Test]
+title 11.35 PlayItf SetStatePlayPausePlayStop
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.3gp
+ALImpl al_SetDataFormat 1 video/3gp 23
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 5000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PAUSED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PAUSED
+pause 2000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 5000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.36 PlayItf SetStatePause
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.3gp
+ALImpl al_SetDataFormat 1 video/3gp 23
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PAUSED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PAUSED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.37 PlayItf GetState
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.3gp
+ALImpl al_SetDataFormat 1 video/3gp 23
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.38 PlayItf GetDurationNullParam
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.3gp
+ALImpl al_SetDataFormat 1 video/3gp 23
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+allownextresult XA_RESULT_PARAMETER_INVALID
+ALImpl al_playitf_GetDurationNullParam
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.39 PlayItf GetDuration
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.3gp
+ALImpl al_SetDataFormat 1 video/3gp 23
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_GetDuration 140000 142000
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.40 PlayItf GetPositionNullParam
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.3gp
+ALImpl al_SetDataFormat 1 video/3gp 23
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+allownextresult XA_RESULT_PARAMETER_INVALID
+ALImpl al_playitf_GetPositionNullParam
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.41 PlayItf GetPositionZero
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.3gp
+ALImpl al_SetDataFormat 1 video/3gp 23
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_GetPosition 0
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.42 PlayItf GetPosition5Sec
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.3gp
+ALImpl al_SetDataFormat 1 video/3gp 23
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 5000
+ALImpl al_playitf_GetPosition
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.43 PlayItf RegisterCallback
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.3gp
+ALImpl al_SetDataFormat 1 video/3gp 23
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_RegisterCallback
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.44 PlayItf SetCallbackEventMaskInvalid
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.3gp
+ALImpl al_SetDataFormat 1 video/3gp 23
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+allownextresult XA_RESULT_PARAMETER_INVALID
+ALImpl al_playitf_SetCallbackEventMask 32
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.45 PlayItf SetCallbackEventMask
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.3gp
+ALImpl al_SetDataFormat 1 video/3gp 23
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetCallbackEventMask 31
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.46 PlayItf GetCallbackEventMaskInvalid
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.3gp
+ALImpl al_SetDataFormat 1 video/3gp 23
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+allownextresult XA_RESULT_PARAMETER_INVALID
+ALImpl al_playitf_GetCallbackEventMaskNullParam
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+
+[Test]
+title 11.47 PlayItf GetCallbackEventMask
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.3gp
+ALImpl al_SetDataFormat 1 video/3gp 23
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetCallbackEventMask 31
+ALImpl al_playitf_GetCallbackEventMask 31
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.48 PlayItf SetMarkerPositionInvalid
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.3gp
+ALImpl al_SetDataFormat 1 video/3gp 23
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+allownextresult XA_RESULT_PARAMETER_INVALID
+ALImpl al_playitf_SetMarkerPosition 300000
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.49 PlayItf SetMarkerPosition
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.3gp
+ALImpl al_SetDataFormat 1 video/3gp 23
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetMarkerPosition 10000
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.50 PlayItf ClearMarkerPosition
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.3gp
+ALImpl al_SetDataFormat 1 video/3gp 23
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetMarkerPosition 10000
+ALImpl al_playitf_ClearMarkerPosition
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.51 PlayItf GetMarkerPositionInvalid
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.3gp
+ALImpl al_SetDataFormat 1 video/3gp 23
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+allownextresult XA_RESULT_PARAMETER_INVALID
+ALImpl al_playitf_GetMarkerPositionNullParam
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.52 PlayItf GetMarkerPositionPreConditionViolation
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.3gp
+ALImpl al_SetDataFormat 1 video/3gp 23
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+allownextresult XA_RESULT_PRECONDITIONS_VIOLATED
+ALImpl al_playitf_GetMarkerPosition 0
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.53 PlayItf SetGetMarkerPosition
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.3gp
+ALImpl al_SetDataFormat 1 video/3gp 23
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetMarkerPosition 10000
+ALImpl al_playitf_GetMarkerPosition 10000
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.54 PlayItf SetClearGetMarkerPosition
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.3gp
+ALImpl al_SetDataFormat 1 video/3gp 23
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetMarkerPosition 10000
+ALImpl al_playitf_GetMarkerPosition 10000
+ALImpl al_playitf_ClearMarkerPosition
+allownextresult XA_RESULT_PRECONDITIONS_VIOLATED
+ALImpl al_playitf_GetMarkerPosition 0
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.55 PlayItf SetPositionUpdatePeriod
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.3gp
+ALImpl al_SetDataFormat 1 video/3gp 23
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetPositionUpdatePeriod 10000
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.56 PlayItf GetPositionUpdatePeriodInvalid
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.3gp
+ALImpl al_SetDataFormat 1 video/3gp 23
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+allownextresult XA_RESULT_PARAMETER_INVALID
+ALImpl al_playitf_GetPositionUpdatePeriodNullParam 10000
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.58 PlayItf GetPositionUpdatePeriod
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.3gp
+ALImpl al_SetDataFormat 1 video/3gp 23
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_GetPositionUpdatePeriod 1000
+ALImpl al_playitf_SetPositionUpdatePeriod 10000
+ALImpl al_playitf_GetPositionUpdatePeriod 10000
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.60 PlayItf PlayEventHeadMoving
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.3gp
+ALImpl al_SetDataFormat 1 video/3gp 23
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_RegisterCallback
+ALImpl al_playitf_SetCallbackEventMask 31
+request Event_XA_PLAYEVENT_HEADMOVING
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+wait Event_XA_PLAYEVENT_HEADMOVING
+release Event_XA_PLAYEVENT_HEADMOVING
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.61 PlayItf PlayEventHeadAtEnd
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.3gp
+ALImpl al_SetDataFormat 1 video/3gp 23
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_RegisterCallback
+ALImpl al_playitf_SetCallbackEventMask 31
+request Event_XA_PLAYEVENT_HEADATEND
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+wait Event_XA_PLAYEVENT_HEADATEND
+release Event_XA_PLAYEVENT_HEADATEND
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PAUSED
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 11.62 PlayItf PlayEventHeadAtMarker
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.3gp
+ALImpl al_SetDataFormat 1 video/3gp 23
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_RegisterCallback
+ALImpl al_playitf_SetCallbackEventMask 2
+ALImpl al_playitf_SetMarkerPosition 3000
+request Event_XA_PLAYEVENT_HEADATMARKER
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+wait Event_XA_PLAYEVENT_HEADATMARKER
+release Event_XA_PLAYEVENT_HEADATMARKER
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+//[Test]
+//title 11.63 PlayItf PlayEventHeadAtMarkerPlayPausePlay
+//create openmaxaltestmodule ALImpl
+//ALImpl al_createEngine 1 1 0 0
+//ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+//ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+//ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.3gp
+//ALImpl al_SetDataFormat 1 vdieo/3gp 17
+//ALImpl al_SetDataSource 1 1 1
+//ALImpl al_SetDataSink 3 6 1
+//ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+//ALImpl al_SetDataSink 5 3 2
+//ALImpl al_engitf_CreateMediaPlayer 0
+//ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+//ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+//ALImpl al_playitf_RegisterCallback
+//ALImpl al_playitf_SetCallbackEventMask 2
+//ALImpl al_playitf_SetMarkerPosition 15000
+//request Event_XA_PLAYEVENT_HEADATMARKER
+//ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+//ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+//pause 10000
+//ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PAUSED
+//ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PAUSED
+//pause 2000
+//ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+//ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+//wait Event_XA_PLAYEVENT_HEADATMARKER
+//release Event_XA_PLAYEVENT_HEADATMARKER
+//ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+//ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+//ALImpl al_objitf_Destroy MO_PLAYER
+//ALImpl al_objitf_Destroy MO_ENGINE
+//ALImpl al_DeleteWindow
+//delete ALImpl
+//[Endtest]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_mp_preemption.cfg	Fri May 14 16:22:35 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: 
+//
+//
+
+[Test]
+title 12.1 PlayItf AudioPreemption
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_RegisterCallback
+request Event_XA_OBJECT_EVENT_RESOURCES_LOST
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+wait Event_XA_OBJECT_EVENT_RESOURCES_LOST
+release Event_XA_OBJECT_EVENT_RESOURCES_LOST
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PAUSED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 12.2 PlayItf VideoPreemption
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.3gp
+ALImpl al_SetDataFormat 1 vdieo/3gp 17
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow 0 0 WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_RegisterCallback
+request Event_XA_OBJECT_EVENT_RESOURCES_LOST
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+wait Event_XA_OBJECT_EVENT_RESOURCES_LOST
+release Event_XA_OBJECT_EVENT_RESOURCES_LOST
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PAUSED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_mp_seekitf.cfg	Fri May 14 16:22:35 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: 
+//
+//
+
+
+[StifSettings]
+CheckHeapBalance=on
+[EndStifSettings]
+
+[Test]
+title 12.1 SeekItf SetPosition
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_SEEK
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_SEEK
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 15000
+ALImpl al_seekitf_SetPosition 10000 1
+pause 15000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 12.2 SeekItf SetLoop
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_SEEK
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_SEEK
+ALImpl al_playitf_RegisterCallback
+ALImpl al_playitf_SetCallbackEventMask 31
+ALImpl al_seekitf_SetLoop 1 10000 20000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 35000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 12.3 SeekItf GetLoop
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_SEEK
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_SEEK
+ALImpl al_playitf_RegisterCallback
+ALImpl al_playitf_SetCallbackEventMask 31
+ALImpl al_seekitf_SetLoop 1 10000 20000
+ALImpl al_seekitf_GetLoop
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 25000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 12.4 SeekItf SetPosition
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.3gp
+ALImpl al_SetDataFormat 1 vdieo/3gp 17
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer  1 XA_IID_SEEK
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_SEEK
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 10000
+ALImpl al_seekitf_SetPosition 60000 1
+pause 10000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 12.5 SeekItf SetLoop
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.3gp
+ALImpl al_SetDataFormat 1 vdieo/3gp 17
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer  1 XA_IID_SEEK
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_SEEK
+ALImpl al_playitf_RegisterCallback
+ALImpl al_playitf_SetCallbackEventMask 31
+allownextresult 13
+ALImpl al_seekitf_SetLoop 1 10000 20000
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_mp_strminfoitf.cfg	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,310 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description: 
+//
+//
+
+
+[StifSettings]
+CheckHeapBalance=on
+[EndStifSettings]
+
+[Test]
+title 14.1 StrmInfoItf QueryMediaContainerInformation
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_STREAMINFORMATION
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_STREAMINFORMATION
+ALImpl al_strminfoitf_QueryMediaContainerInformation
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 14.2 StrmInfoItf QueryStreamType
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_STREAMINFORMATION
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_STREAMINFORMATION
+ALImpl al_strminfoitf_QueryStreamType 1
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 14.3 StrmInfoItf QueryStreamInformation
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_STREAMINFORMATION
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_STREAMINFORMATION
+ALImpl al_strminfoitf_QueryStreamInformation 1 1
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 14.4 StrmInfoItf QueryStreamName
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_STREAMINFORMATION
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_STREAMINFORMATION
+ALImpl al_strminfoitf_QueryStreamName 1
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 14.5 StrmInfoItf RegisterStreamChangeCallback
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_STREAMINFORMATION
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_STREAMINFORMATION
+ALImpl al_strminfoitf_RegisterStreamChangeCallback
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 14.6 StrmInfoItf QueryActiveStreams
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_STREAMINFORMATION
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_STREAMINFORMATION
+ALImpl al_strminfoitf_QueryActiveStreams
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 14.7 StrmInfoItf SetActiveStream
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.mp3
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_STREAMINFORMATION
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_STREAMINFORMATION
+allownextresult XA_RESULT_FEATURE_UNSUPPORTED KErrNotSupported
+ALImpl al_strminfoitf_SetActiveStream 1 1 1
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 14.8 StrmInfoItf QueryMediaContainerInformation
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.3gp
+ALImpl al_SetDataFormat 1 video/3gp 23
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_STREAMINFORMATION
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_STREAMINFORMATION
+ALImpl al_strminfoitf_QueryMediaContainerInformation
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 14.9 StrmInfoItf QueryStreamType
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.3gp
+ALImpl al_SetDataFormat 1 video/3gp 23
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_STREAMINFORMATION
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_STREAMINFORMATION
+ALImpl al_strminfoitf_QueryStreamType 1
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 14.10 StrmInfoItf QueryStreamInformation
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.3gp
+ALImpl al_SetDataFormat 1 video/3gp 23
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_STREAMINFORMATION
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_STREAMINFORMATION
+ALImpl al_strminfoitf_QueryStreamInformation 1 1
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 14.11 StrmInfoItf QueryStreamName
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.3gp
+ALImpl al_SetDataFormat 1 video/3gp 23
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_STREAMINFORMATION
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_STREAMINFORMATION
+ALImpl al_strminfoitf_QueryStreamName 1
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 14.12 StrmInfoItf RegisterStreamChangeCallback
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.3gp
+ALImpl al_SetDataFormat 1 video/3gp 23
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_STREAMINFORMATION
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_STREAMINFORMATION
+ALImpl al_strminfoitf_RegisterStreamChangeCallback
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 14.13 StrmInfoItf QueryActiveStreams
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.3gp
+ALImpl al_SetDataFormat 1 video/3gp 23
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_STREAMINFORMATION
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_STREAMINFORMATION
+ALImpl al_strminfoitf_QueryActiveStreams
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 14.14 StrmInfoItf SetActiveStream
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.3gp
+ALImpl al_SetDataFormat 1 video/3gp 23
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 1 XA_IID_STREAMINFORMATION
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_STREAMINFORMATION
+allownextresult XA_RESULT_FEATURE_UNSUPPORTED KErrNotSupported
+ALImpl al_strminfoitf_SetActiveStream 1 1 1
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_mp_variousformats.cfg	Fri May 14 16:22:35 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: 
+//
+//
+
+[Test]
+title 21.1 PlayItf Play10SecWithAudioSink
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.wav
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 10000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 21.2 PlayItf Play10SecWithAudioVideoSink
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.wav
+ALImpl al_SetDataFormat 1 vdieo/3gp 17
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 10000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 21.3 PlayItf Play10SecWithAudioSink
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/f:/testing/data/omxaltestdata/128k_H264_AAC24M22_320x240_15fps.3gp
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 10000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 21.4 PlayItf Play10SecWithAudioVideoSink
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/f:/testing/data/omxaltestdata/128k_H264_AAC24M22_320x240_15fps.3gp
+ALImpl al_SetDataFormat 1 vdieo/3gp 17
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 10000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 21.5 PlayItf Play10SecWithAudioSink
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/f:/testing/data/omxaltestdata/145k_H263_NB12_352x288_15fps.3gp
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 10000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 21.6 PlayItf Play10SecWithAudioVideoSink
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/f:/testing/data/omxaltestdata/145k_H263_NB12_352x288_15fps.3gp
+ALImpl al_SetDataFormat 1 vdieo/3gp 17
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 10000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 21.7 PlayItf Play10SecWithAudioSink
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/f:/testing/data/omxaltestdata/200k_RV9_COOK21_320x240_15fps.rm
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 10000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 21.8 PlayItf Play10SecWithAudioVideoSink
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/f:/testing/data/omxaltestdata/200k_RV9_COOK21_320x240_15fps.rm
+ALImpl al_SetDataFormat 1 vdieo/3gp 17
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 10000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 21.9 PlayItf Play10SecWithAudioSink
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/f:/testing/data/omxaltestdata/30k_MPEG4_AAC_352x288_15fps.3gp
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 10000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 21.10 PlayItf Play10SecWithAudioVideoSink
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/f:/testing/data/omxaltestdata/30k_MPEG4_AAC_352x288_15fps.3gp
+ALImpl al_SetDataFormat 1 vdieo/3gp 17
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 10000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 21.11 PlayItf Play10SecWithAudioSink
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/f:/testing/data/omxaltestdata/30s_MID_Generic.mid
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 10000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 21.12 PlayItf Play10SecWithAudioVideoSink
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/f:/testing/data/omxaltestdata/30s_MID_Generic.mid
+ALImpl al_SetDataFormat 1 vdieo/3gp 17
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 10000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 21.13 PlayItf Play10SecWithAudioSink
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/f:/testing/data/omxaltestdata/384k_CBR_WMV9_CBR_WMA9_CIF_15fps.wmv
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 10000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 21.14 PlayItf Play10SecWithAudioVideoSink
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/f:/testing/data/omxaltestdata/384k_CBR_WMV9_CBR_WMA9_CIF_15fps.wmv
+ALImpl al_SetDataFormat 1 vdieo/3gp 17
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 10000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 21.15 PlayItf Play10SecWithAudioSink
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/f:/testing/data/omxaltestdata/3GP_AAC+_8kbps_16khz_mono.3gp
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 10000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 21.16 PlayItf Play10SecWithAudioVideoSink
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/f:/testing/data/omxaltestdata/3GP_AAC+_8kbps_16khz_mono.3gp
+ALImpl al_SetDataFormat 1 vdieo/3gp 17
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 10000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 21.17 PlayItf Play10SecWithAudioSink
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/f:/testing/data/omxaltestdata/3gp_AAC-LC_16kbps_24kHz_mono.3gp
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 10000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 21.18 PlayItf Play10SecWithAudioVideoSink
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/f:/testing/data/omxaltestdata/3gp_AAC-LC_16kbps_24kHz_mono.3gp
+ALImpl al_SetDataFormat 1 vdieo/3gp 17
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 10000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 21.19 PlayItf Play10SecWithAudioSink
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/f:/testing/data/omxaltestdata/3Mbps_864x480_25fps_AAC_128_short.MP4
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 10000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 21.20 PlayItf Play10SecWithAudioVideoSink
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/f:/testing/data/omxaltestdata/3Mbps_864x480_25fps_AAC_128_short.MP4
+ALImpl al_SetDataFormat 1 vdieo/3gp 17
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 10000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 21.21 PlayItf Play10SecWithAudioSink
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/f:/testing/data/omxaltestdata/768Kbps_H264_VGA_24fps_AAC44_128kbps.MKV
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 10000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 21.22 PlayItf Play10SecWithAudioVideoSink
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/f:/testing/data/omxaltestdata/768Kbps_H264_VGA_24fps_AAC44_128kbps.MKV
+ALImpl al_SetDataFormat 1 vdieo/3gp 17
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 10000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 21.23 PlayItf Play10SecWithAudioSink
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/f:/testing/data/omxaltestdata/AAC_LC_16kbps_8khz_mono.aac
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 10000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 21.24 PlayItf Play10SecWithAudioVideoSink
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/f:/testing/data/omxaltestdata/AAC_LC_16kbps_8khz_mono.aac
+ALImpl al_SetDataFormat 1 vdieo/3gp 17
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 10000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 21.25 PlayItf Play10SecWithAudioSink
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/f:/testing/data/omxaltestdata/AMR-WB-23kb.awb
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 10000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 21.26 PlayItf Play10SecWithAudioVideoSink
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/f:/testing/data/omxaltestdata/AMR-WB-23kb.awb
+ALImpl al_SetDataFormat 1 vdieo/3gp 17
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 10000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 21.27 PlayItf Play10SecWithAudioSink
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/f:/testing/data/omxaltestdata/AMR_NB_12.2kbps.amr
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 10000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 21.28 PlayItf Play10SecWithAudioVideoSink
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/f:/testing/data/omxaltestdata/AMR_NB_12.2kbps.amr
+ALImpl al_SetDataFormat 1 vdieo/3gp 17
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 10000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 21.29 PlayItf Play10SecWithAudioSink
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/f:/testing/data/omxaltestdata/DivX_MP3_1MBps_320X240_25fps.avi
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 10000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 21.30 PlayItf Play10SecWithAudioVideoSink
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/f:/testing/data/omxaltestdata/DivX_MP3_1MBps_320X240_25fps.avi
+ALImpl al_SetDataFormat 1 vdieo/3gp 17
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 10000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
+
+[Test]
+title 21.31 PlayItf Play10SecWithAudioSink
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/f:/testing/data/omxaltestdata/MP4_24kbps_16khz_mono.mp4
+ALImpl al_SetDataFormat 1 audio/mpeg 9
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 10000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 21.32 PlayItf Play10SecWithAudioVideoSink
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize MO_ENGINE XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_ENGINE XA_IID_ENGINE
+ALImpl al_SetDataLocator 1 file:/\/\/f:/testing/data/omxaltestdata/MP4_24kbps_16khz_mono.mp4
+ALImpl al_SetDataFormat 1 vdieo/3gp 17
+ALImpl al_SetDataSource 1 1 1
+ALImpl al_SetDataSink 3 6 1
+ALImpl al_CreateWindow WinPtX WinPtY WinTopLeft WinTopRight WinBotLeft WinBotRight
+ALImpl al_SetDataSink 5 3 2
+ALImpl al_engitf_CreateMediaPlayer 0
+ALImpl al_objitf_Realize MO_PLAYER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface MO_PLAYER XA_IID_PLAY
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_PLAYING
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_PLAYING
+pause 10000
+ALImpl al_playitf_SetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_playitf_GetPlayState XA_PLAYSTATE_STOPPED
+ALImpl al_objitf_Destroy MO_PLAYER
+ALImpl al_objitf_Destroy MO_ENGINE
+ALImpl al_DeleteWindow
+delete ALImpl
+[Endtest]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_mr.cfg	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,180 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description: 
+//
+//
+
+
+// IID numbers for interfaces to mention during object creation
+//	 XA_IID_NULL                    	1
+//	 XA_IID_OBJECT                    	2
+//	 XA_IID_CONFIGEXTENSION             3
+//	 XA_IID_DYNAMICINTERFACEMANAGEMENT  4
+//	 XA_IID_ENGINE                    	5
+//	 XA_IID_THREADSYNC                  6
+//	 XA_IID_PLAY                    	7
+//	 XA_IID_PLAYBACKRATE                8
+//	 XA_IID_PREFETCHSTATUS              9
+//	 XA_IID_SEEK                    	10
+//	 XA_IID_VOLUME                    	11
+//	 XA_IID_IMAGECONTROLS               12
+//	 XA_IID_IMAGEEFFECTS                13
+//	 XA_IID_VIDEOPOSTPROCESSING         14
+//	 XA_IID_RECORD                    	15
+//	 XA_IID_SNAPSHOT                    16
+//	 XA_IID_METADATAEXTRACTION          17
+//	 XA_IID_METADATAINSERTION           18
+//	 XA_IID_METADATATRAVERSAL           19
+//	 XA_IID_DYNAMICSOURCE               20
+//	 XA_IID_CAMERACAPABILITIES          21
+//	 XA_IID_CAMERA                    	22
+//	 XA_IID_AUDIOIODEVICECAPABILITIES   23
+//	 XA_IID_DEVICEVOLUME                24
+//	 XA_IID_EQUALIZER                   25
+//	 XA_IID_OUTPUTMIX                   26
+//	 XA_IID_RADIO                    	27
+//	 XA_IID_RDS                         28
+//	 XA_IID_VIBRA                    	29
+//	 XA_IID_LED                         30
+//	 XA_IID_AUDIODECODERCAPABILITIES    31
+//	 XA_IID_AUDIOENCODER                32
+//	 XA_IID_AUDIOENCODERCAPABILITIES    33
+//	 XA_IID_IMAGEENCODERCAPABILITIES    34
+//	 XA_IID_IMAGEDECODERCAPABILITIES    35
+//	 XA_IID_IMAGEENCODER                36
+//	 XA_IID_VIDEODECODERCAPABILITIES    37
+//	 XA_IID_VIDEOENCODER                38
+//	 XA_IID_VIDEOENCODERCAPABILITIES    39
+//	 XA_IID_STREAMINFORMATION           40
+
+
+[StifSettings]
+CheckHeapBalance=off
+[EndStifSettings]
+
+[Test]
+title 25.1 MediaRecorder CreateAudioMediaRecorder
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav
+ALImpl al_SetDataFormat 1 audio/wav 15
+ALImpl al_SetDataSink 1 1 5
+ALImpl al_SetDataLocator 3 1 2910736385 1
+ALImpl al_SetDataSource 3 1 1
+ALImpl al_engitf_CreateMediaRecorder 1 15
+ALImpl al_objitf_Destroy 5
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 25.2 MediaRecorder QueryNumSupportedInterfaces
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav
+ALImpl al_SetDataFormat 1 audio/wav 15
+ALImpl al_SetDataSink 1 1 5
+ALImpl al_SetDataLocator 3 1 2910736385 1
+ALImpl al_SetDataSource 3 1 1
+ALImpl al_engitf_CreateMediaRecorder 1 15
+ALImpl al_engitf_QueryNumSupportedInterfaces 5
+ALImpl al_engitf_QueryNumSupportedInterfaces 1
+ALImpl al_objitf_Destroy MO_RECORDER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 25.3 MediaRecorder QuerySupportedInterfaces
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav
+ALImpl al_SetDataFormat 1 audio/wav 15
+ALImpl al_SetDataSink 1 1 5
+ALImpl al_SetDataLocator 3 1 2910736385 1
+ALImpl al_SetDataSource 3 1 1
+ALImpl al_engitf_CreateMediaRecorder 1 15
+ALImpl al_engitf_QuerySupportedInterfaces 5 0
+ALImpl al_objitf_Destroy MO_RECORDER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 25.4 MediaRecorder DynItf AddItf
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav
+ALImpl al_SetDataFormat 1 audio/wav 15
+ALImpl al_SetDataSink 1 1 5
+ALImpl al_SetDataLocator 3 1 2910736385 1
+ALImpl al_SetDataSource 3 1 1
+ALImpl al_engitf_CreateMediaRecorder 1 15
+ALImpl al_objitf_Realize MO_RECORDER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface 5 4
+ALImpl al_dimitf_AddInterface 18 0
+ALImpl al_dimitf_RemoveInterface 18 
+ALImpl al_objitf_Destroy MO_RECORDER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 25.5 MediaRecorder Resume Itf
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav
+ALImpl al_SetDataFormat 1 audio/wav 15
+ALImpl al_SetDataSink 1 1 5
+ALImpl al_SetDataLocator 3 1 2910736385 1
+ALImpl al_SetDataSource 3 1 1
+ALImpl al_engitf_CreateMediaRecorder 1 15
+ALImpl al_objitf_Realize MO_RECORDER XA_BOOLEAN_FALSE
+allownextresult 1
+ALImpl al_objitf_Resume 5 0
+ALImpl al_objitf_Destroy MO_RECORDER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
+
+[Test]
+title 25.6 MediaRecorder DynItf AddItf
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav
+ALImpl al_SetDataFormat 1 audio/wav 15
+ALImpl al_SetDataSink 1 1 5
+ALImpl al_SetDataLocator 3 1 2910736385 1
+ALImpl al_SetDataSource 3 1 1
+ALImpl al_engitf_CreateMediaRecorder 1 15
+ALImpl al_objitf_Realize MO_RECORDER XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetInterface 5 4
+ALImpl al_dimitf_ResumeInterface 18 0
+ALImpl al_dimitf_RemoveInterface 18 
+ALImpl al_objitf_Destroy MO_RECORDER
+ALImpl al_objitf_Destroy MO_ENGINE
+delete ALImpl
+[Endtest]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_mr_audioencoderitf.cfg	Fri May 14 16:22:35 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: 
+//
+//
+
+
+// IID numbers for interfaces to mention during object creation
+//	 XA_IID_NULL                    	1
+//	 XA_IID_OBJECT                    	2
+//	 XA_IID_CONFIGEXTENSION             3
+//	 XA_IID_DYNAMICINTERFACEMANAGEMENT  4
+//	 XA_IID_ENGINE                    	5
+//	 XA_IID_THREADSYNC                  6
+//	 XA_IID_PLAY                    	7
+//	 XA_IID_PLAYBACKRATE                8
+//	 XA_IID_PREFETCHSTATUS              9
+//	 XA_IID_SEEK                    	10
+//	 XA_IID_VOLUME                    	11
+//	 XA_IID_IMAGECONTROLS               12
+//	 XA_IID_IMAGEEFFECTS                13
+//	 XA_IID_VIDEOPOSTPROCESSING         14
+//	 XA_IID_RECORD                    	15
+//	 XA_IID_SNAPSHOT                    16
+//	 XA_IID_METADATAEXTRACTION          17
+//	 XA_IID_METADATAINSERTION           18
+//	 XA_IID_METADATATRAVERSAL           19
+//	 XA_IID_DYNAMICSOURCE               20
+//	 XA_IID_CAMERACAPABILITIES          21
+//	 XA_IID_CAMERA                    	22
+//	 XA_IID_AUDIOIODEVICECAPABILITIES   23
+//	 XA_IID_DEVICEVOLUME                24
+//	 XA_IID_EQUALIZER                   25
+//	 XA_IID_OUTPUTMIX                   26
+//	 XA_IID_RADIO                    	27
+//	 XA_IID_RDS                         28
+//	 XA_IID_VIBRA                    	29
+//	 XA_IID_LED                         30
+//	 XA_IID_AUDIODECODERCAPABILITIES    31
+//	 XA_IID_AUDIOENCODER                32
+//	 XA_IID_AUDIOENCODERCAPABILITIES    33
+//	 XA_IID_IMAGEENCODERCAPABILITIES    34
+//	 XA_IID_IMAGEDECODERCAPABILITIES    35
+//	 XA_IID_IMAGEENCODER                36
+//	 XA_IID_VIDEODECODERCAPABILITIES    37
+//	 XA_IID_VIDEOENCODER                38
+//	 XA_IID_VIDEOENCODERCAPABILITIES    39
+//	 XA_IID_STREAMINFORMATION           40
+
+[Test]
+title 7.1 AudioEncoderItf GetEncoderSettings
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav
+ALImpl al_SetDataFormat 1 audio/wav 15
+ALImpl al_SetDataSink 1 1 5
+ALImpl al_SetDataLocator 3 1 2910736385 1
+ALImpl al_SetDataSource 3 1 1
+ALImpl al_engitf_CreateMediaRecorder
+ALImpl al_objitf_Realize 5 0
+ALImpl al_objitf_GetInterface 5 32
+ALImpl al_audioencoderitf_GetEncoderSettings
+ALImpl al_objitf_Destroy 5
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 7.2 AudioEncoderItf SetEncoderSettings
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav
+ALImpl al_SetDataFormat 1 audio/wav 15
+ALImpl al_SetDataSink 1 1 5
+ALImpl al_SetDataLocator 3 1 2910736385 1
+ALImpl al_SetDataSource 3 1 1
+ALImpl al_engitf_CreateMediaRecorder
+ALImpl al_objitf_Realize 5 0
+ALImpl al_objitf_GetInterface 5 32
+ALImpl al_audioencoderitf_SetEncoderSettings 13 1 2 2 44100 128 8 0 0 0 0 0 0 0
+ALImpl al_objitf_Destroy 5
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest] 
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_mr_mdinsertionitf.cfg	Fri May 14 16:22:35 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: 
+//
+//
+
+
+// IID numbers for interfaces to mention during object creation
+//	 XA_IID_NULL                    	1
+//	 XA_IID_OBJECT                    	2
+//	 XA_IID_CONFIGEXTENSION             3
+//	 XA_IID_DYNAMICINTERFACEMANAGEMENT  4
+//	 XA_IID_ENGINE                    	5
+//	 XA_IID_THREADSYNC                  6
+//	 XA_IID_PLAY                    	7
+//	 XA_IID_PLAYBACKRATE                8
+//	 XA_IID_PREFETCHSTATUS              9
+//	 XA_IID_SEEK                    	10
+//	 XA_IID_VOLUME                    	11
+//	 XA_IID_IMAGECONTROLS               12
+//	 XA_IID_IMAGEEFFECTS                13
+//	 XA_IID_VIDEOPOSTPROCESSING         14
+//	 XA_IID_RECORD                    	15
+//	 XA_IID_SNAPSHOT                    16
+//	 XA_IID_METADATAEXTRACTION          17
+//	 XA_IID_METADATAINSERTION           18
+//	 XA_IID_METADATATRAVERSAL           19
+//	 XA_IID_DYNAMICSOURCE               20
+//	 XA_IID_CAMERACAPABILITIES          21
+//	 XA_IID_CAMERA                    	22
+//	 XA_IID_AUDIOIODEVICECAPABILITIES   23
+//	 XA_IID_DEVICEVOLUME                24
+//	 XA_IID_EQUALIZER                   25
+//	 XA_IID_OUTPUTMIX                   26
+//	 XA_IID_RADIO                    	27
+//	 XA_IID_RDS                         28
+//	 XA_IID_VIBRA                    	29
+//	 XA_IID_LED                         30
+//	 XA_IID_AUDIODECODERCAPABILITIES    31
+//	 XA_IID_AUDIOENCODER                32
+//	 XA_IID_AUDIOENCODERCAPABILITIES    33
+//	 XA_IID_IMAGEENCODERCAPABILITIES    34
+//	 XA_IID_IMAGEDECODERCAPABILITIES    35
+//	 XA_IID_IMAGEENCODER                36
+//	 XA_IID_VIDEODECODERCAPABILITIES    37
+//	 XA_IID_VIDEOENCODER                38
+//	 XA_IID_VIDEOENCODERCAPABILITIES    39
+//	 XA_IID_STREAMINFORMATION           40
+
+[Test]
+title 6.1 MetadataInsertionItf CreateChildNode
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.amr
+ALImpl al_SetDataFormat 1 audio/amr 21
+ALImpl al_SetDataSink 1 1 5
+ALImpl al_SetDataLocator 3 1 2910736385 1
+ALImpl al_SetDataSource 3 1 1
+ALImpl al_engitf_CreateMediaRecorder
+ALImpl al_objitf_Realize 5 0
+ALImpl al_objitf_GetInterface 5 4
+ALImpl al_dimitf_AddInterface 18 0 
+ALImpl al_objitf_GetInterface 5 18
+allownextresult 12 0
+ALImpl al_metadatainsertionitf_CreateChildNode 2147483647 2 audio/amr
+ALImpl al_objitf_Destroy 5
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 6.2 MetadataInsertionItf GetSupportedKeysCount
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.amr
+ALImpl al_SetDataFormat 1 audio/amr 21
+ALImpl al_SetDataSink 1 1 5
+ALImpl al_SetDataLocator 3 1 2910736385 1
+ALImpl al_SetDataSource 3 1 1
+ALImpl al_engitf_CreateMediaRecorder
+ALImpl al_objitf_Realize 5 0
+ALImpl al_objitf_GetInterface 5 4
+ALImpl al_dimitf_AddInterface 18 0 
+ALImpl al_objitf_GetInterface 5 18
+allownextresult 2 0
+ALImpl al_metadatainsertionitf_GetSupportedKeysCount 1
+ALImpl al_objitf_Destroy 5
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 6.3 MetadataInsertionItf GetKeySize
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.amr
+ALImpl al_SetDataFormat 1 audio/amr 21
+ALImpl al_SetDataSink 1 1 5
+ALImpl al_SetDataLocator 3 1 2910736385 1
+ALImpl al_SetDataSource 3 1 1
+ALImpl al_engitf_CreateMediaRecorder
+ALImpl al_objitf_Realize 5 0
+ALImpl al_objitf_GetInterface 5 4
+ALImpl al_dimitf_AddInterface 18 0 
+ALImpl al_objitf_GetInterface 5 18
+allownextresult 2 0
+ALImpl al_metadatainsertionitf_GetKeySize 1 1
+ALImpl al_objitf_Destroy 5
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 6.4 MetadataInsertionItf GetKey
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.amr
+ALImpl al_SetDataFormat 1 audio/amr 21
+ALImpl al_SetDataSink 1 1 5
+ALImpl al_SetDataLocator 3 1 2910736385 1
+ALImpl al_SetDataSource 3 1 1
+ALImpl al_engitf_CreateMediaRecorder
+ALImpl al_objitf_Realize 5 0
+ALImpl al_objitf_GetInterface 5 4
+ALImpl al_dimitf_AddInterface 18 0 
+ALImpl al_objitf_GetInterface 5 18
+allownextresult 2 0
+ALImpl al_metadatainsertionitf_GetKey 1 1 1
+ALImpl al_objitf_Destroy 5
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 6.5 MetadataInsertionItf GetFreeKeysEncoding
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.amr
+ALImpl al_SetDataFormat 1 audio/amr 21
+ALImpl al_SetDataSink 1 1 5
+ALImpl al_SetDataLocator 3 1 2910736385 1
+ALImpl al_SetDataSource 3 1 1
+ALImpl al_engitf_CreateMediaRecorder
+ALImpl al_objitf_Realize 5 0
+ALImpl al_objitf_GetInterface 5 4
+ALImpl al_dimitf_AddInterface 18 0 
+ALImpl al_objitf_GetInterface 5 18
+allownextresult 2 1
+ALImpl al_metadatainsertionitf_GetFreeKeysEncoding 1 1
+ALImpl al_objitf_Destroy 5
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 6.6 MetadataInsertionItf InsertMetadataItem
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.amr
+ALImpl al_SetDataFormat 1 audio/amr 21
+ALImpl al_SetDataSink 1 1 5
+ALImpl al_SetDataLocator 3 1 2910736385 1
+ALImpl al_SetDataSource 3 1 1
+ALImpl al_engitf_CreateMediaRecorder
+ALImpl al_objitf_Realize 5 0
+ALImpl al_objitf_GetInterface 5 4
+ALImpl al_dimitf_AddInterface 18 0 
+ALImpl al_objitf_GetInterface 5 18
+allownextresult 12 2
+ALImpl al_metadatainsertionitf_InsertMetadataItem 1 2 3 english 4 5 chinese 1
+ALImpl al_objitf_Destroy 5
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 6.7 MetadataInsertionItf RegisterCallback
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.amr
+ALImpl al_SetDataFormat 1 audio/amr 21
+ALImpl al_SetDataSink 1 1 5
+ALImpl al_SetDataLocator 3 1 2910736385 1
+ALImpl al_SetDataSource 3 1 1
+ALImpl al_engitf_CreateMediaRecorder
+ALImpl al_objitf_Realize 5 0
+ALImpl al_objitf_GetInterface 5 4
+ALImpl al_dimitf_AddInterface 18 0 
+ALImpl al_objitf_GetInterface 5 18
+ALImpl al_metadatainsertionitf_RegisterCallback
+ALImpl al_objitf_Destroy 5
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 6.8 MetadataInsertionItf DynItfMgmt
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.amr
+ALImpl al_SetDataFormat 1 audio/amr 21
+ALImpl al_SetDataSink 1 1 5
+ALImpl al_SetDataLocator 3 1 2910736385 1
+ALImpl al_SetDataSource 3 1 1
+ALImpl al_engitf_CreateMediaRecorder
+ALImpl al_objitf_Realize 5 0
+ALImpl al_objitf_GetInterface 5 4
+ALImpl al_dimitf_AddInterface 18 0
+ALImpl al_objitf_GetInterface 5 18
+ALImpl al_dimitf_RegisterCallback
+ALImpl al_dimitf_RemoveInterface 18  
+ALImpl al_objitf_Destroy 5
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest]
+
+[Test]
+title 6.9 MetadataInsertionItf RegisterCallback
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.amr
+ALImpl al_SetDataFormat 1 audio/amr 21
+ALImpl al_SetDataSink 1 1 5
+ALImpl al_SetDataLocator 3 1 2910736385 1
+ALImpl al_SetDataSource 3 1 1
+ALImpl al_engitf_CreateMediaRecorder
+ALImpl al_objitf_Realize 5 0
+ALImpl al_objitf_GetInterface 5 4
+ALImpl al_dimitf_AddInterface 18 1 
+ALImpl al_objitf_GetInterface 5 18
+ALImpl al_metadatainsertionitf_RegisterCallback
+ALImpl al_objitf_Destroy 5
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest]
+
+[Test]
+title 6.11 MetadataInsertionItf DynItf ASyncResume
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.amr
+ALImpl al_SetDataFormat 1 audio/amr 21
+ALImpl al_SetDataSink 1 1 5
+ALImpl al_SetDataLocator 3 1 2910736385 1
+ALImpl al_SetDataSource 3 1 1
+ALImpl al_engitf_CreateMediaRecorder
+ALImpl al_objitf_Realize 5 0
+ALImpl al_objitf_GetInterface 5 4
+ALImpl al_dimitf_AddInterface 18 0
+ALImpl al_objitf_GetInterface 5 18
+ALImpl al_dimitf_ResumeInterface 18 1
+ALImpl al_objitf_Destroy 5
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest]
+
+[Test]
+title 6.12 MetadataInsertionItf DynItf Resume
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.amr
+ALImpl al_SetDataFormat 1 audio/amr 21
+ALImpl al_SetDataSink 1 1 5
+ALImpl al_SetDataLocator 3 1 2910736385 1
+ALImpl al_SetDataSource 3 1 1
+ALImpl al_engitf_CreateMediaRecorder
+ALImpl al_objitf_Realize 5 0
+ALImpl al_objitf_GetInterface 5 4
+ALImpl al_dimitf_AddInterface 18 0
+ALImpl al_objitf_GetInterface 5 18
+allownextresult 1
+ALImpl al_dimitf_ResumeInterface 18 0
+ALImpl al_objitf_Destroy 5
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_mr_recorditf.cfg	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,353 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description: 
+//
+//
+
+
+// IID numbers for interfaces to mention during object creation
+//	 XA_IID_NULL                    	1
+//	 XA_IID_OBJECT                    	2
+//	 XA_IID_CONFIGEXTENSION             3
+//	 XA_IID_DYNAMICINTERFACEMANAGEMENT  4
+//	 XA_IID_ENGINE                    	5
+//	 XA_IID_THREADSYNC                  6
+//	 XA_IID_PLAY                    	7
+//	 XA_IID_PLAYBACKRATE                8
+//	 XA_IID_PREFETCHSTATUS              9
+//	 XA_IID_SEEK                    	10
+//	 XA_IID_VOLUME                    	11
+//	 XA_IID_IMAGECONTROLS               12
+//	 XA_IID_IMAGEEFFECTS                13
+//	 XA_IID_VIDEOPOSTPROCESSING         14
+//	 XA_IID_RECORD                    	15
+//	 XA_IID_SNAPSHOT                    16
+//	 XA_IID_METADATAEXTRACTION          17
+//	 XA_IID_METADATAINSERTION           18
+//	 XA_IID_METADATATRAVERSAL           19
+//	 XA_IID_DYNAMICSOURCE               20
+//	 XA_IID_CAMERACAPABILITIES          21
+//	 XA_IID_CAMERA                    	22
+//	 XA_IID_AUDIOIODEVICECAPABILITIES   23
+//	 XA_IID_DEVICEVOLUME                24
+//	 XA_IID_EQUALIZER                   25
+//	 XA_IID_OUTPUTMIX                   26
+//	 XA_IID_RADIO                    	27
+//	 XA_IID_RDS                         28
+//	 XA_IID_VIBRA                    	29
+//	 XA_IID_LED                         30
+//	 XA_IID_AUDIODECODERCAPABILITIES    31
+//	 XA_IID_AUDIOENCODER                32
+//	 XA_IID_AUDIOENCODERCAPABILITIES    33
+//	 XA_IID_IMAGEENCODERCAPABILITIES    34
+//	 XA_IID_IMAGEDECODERCAPABILITIES    35
+//	 XA_IID_IMAGEENCODER                36
+//	 XA_IID_VIDEODECODERCAPABILITIES    37
+//	 XA_IID_VIDEOENCODER                38
+//	 XA_IID_VIDEOENCODERCAPABILITIES    39
+//	 XA_IID_STREAMINFORMATION           40
+
+[Test]
+title 8.1 RecordItf SetRecordState
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav
+ALImpl al_SetDataFormat 1 audio/wav 15
+ALImpl al_SetDataSink 1 1 5
+ALImpl al_SetDataLocator 3 1 2910736385 1
+ALImpl al_SetDataSource 3 1 1
+ALImpl al_engitf_CreateMediaRecorder 1 15
+ALImpl al_objitf_Realize 5 0
+ALImpl al_objitf_GetInterface 5 15
+ALImpl al_recorditf_SetCallbackEventsMask 7
+ALImpl al_recorditf_SetRecordState 3
+pause 5000
+ALImpl al_recorditf_SetRecordState 1
+ALImpl al_objitf_Destroy 5
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 8.2 RecordItf GetRecordState
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav
+ALImpl al_SetDataFormat 1 audio/wav 15
+ALImpl al_SetDataSink 1 1 5
+ALImpl al_SetDataLocator 3 1 2910736385 1
+ALImpl al_SetDataSource 3 1 1
+ALImpl al_engitf_CreateMediaRecorder
+ALImpl al_objitf_Realize 5 0
+ALImpl al_objitf_GetInterface 5 15
+ALImpl al_recorditf_GetRecordState
+ALImpl al_objitf_Destroy 5
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest]
+
+[Test]
+title 8.3 RecordItf SetDurationLimit
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav
+ALImpl al_SetDataFormat 1 audio/wav 15
+ALImpl al_SetDataSink 1 1 5
+ALImpl al_SetDataLocator 3 1 2910736385 1
+ALImpl al_SetDataSource 3 1 1
+ALImpl al_engitf_CreateMediaRecorder
+ALImpl al_objitf_Realize 5 0
+ALImpl al_objitf_GetInterface 5 15
+ALImpl al_recorditf_SetDurationLimit 100000
+ALImpl al_objitf_Destroy 5
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest]  
+
+[Test]
+title 8.4 RecordItf GetPosition
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav
+ALImpl al_SetDataFormat 1 audio/wav 15
+ALImpl al_SetDataSink 1 1 5
+ALImpl al_SetDataLocator 3 1 2910736385 1
+ALImpl al_SetDataSource 3 1 1
+ALImpl al_engitf_CreateMediaRecorder
+ALImpl al_objitf_Realize 5 0
+ALImpl al_objitf_GetInterface 5 15
+ALImpl al_recorditf_GetPosition
+ALImpl al_objitf_Destroy 5
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 8.5 RecordItf RegisterCallback
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav
+ALImpl al_SetDataFormat 1 audio/wav 15
+ALImpl al_SetDataSink 1 1 5
+ALImpl al_SetDataLocator 3 1 2910736385 1
+ALImpl al_SetDataSource 3 1 1
+ALImpl al_engitf_CreateMediaRecorder
+ALImpl al_objitf_Realize 5 0
+ALImpl al_objitf_GetInterface 5 15
+ALImpl al_recorditf_RegisterCallback
+ALImpl al_objitf_Destroy 5
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 8.6 RecordItf SetCallbackEventsMask
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav
+ALImpl al_SetDataFormat 1 audio/wav 15
+ALImpl al_SetDataSink 1 1 5
+ALImpl al_SetDataLocator 3 1 2910736385 1
+ALImpl al_SetDataSource 3 1 1
+ALImpl al_engitf_CreateMediaRecorder
+ALImpl al_objitf_Realize 5 0
+ALImpl al_objitf_GetInterface 5 15
+ALImpl al_recorditf_SetCallbackEventsMask 1
+ALImpl al_objitf_Destroy 5
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest]
+
+[Test]
+title 8.7 RecordItf GetCallbackEventsMask
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav
+ALImpl al_SetDataFormat 1 audio/wav 15
+ALImpl al_SetDataSink 1 1 5
+ALImpl al_SetDataLocator 3 1 2910736385 1
+ALImpl al_SetDataSource 3 1 1
+ALImpl al_engitf_CreateMediaRecorder
+ALImpl al_objitf_Realize 5 0
+ALImpl al_objitf_GetInterface 5 15
+ALImpl al_recorditf_GetCallbackEventsMask
+ALImpl al_objitf_Destroy 5
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest]
+
+
+[Test]
+title 8.8 RecordItf SetMarkerPosition
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav
+ALImpl al_SetDataFormat 1 audio/wav 15
+ALImpl al_SetDataSink 1 1 5
+ALImpl al_SetDataLocator 3 1 2910736385 1
+ALImpl al_SetDataSource 3 1 1
+ALImpl al_engitf_CreateMediaRecorder
+ALImpl al_objitf_Realize 5 0
+ALImpl al_objitf_GetInterface 5 15
+ALImpl al_recorditf_SetMarkerPosition 1000
+ALImpl al_objitf_Destroy 5
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest]
+
+
+[Test]
+title 8.9 RecordItf ClearMarkerPosition
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav
+ALImpl al_SetDataFormat 1 audio/wav 15
+ALImpl al_SetDataSink 1 1 5
+ALImpl al_SetDataLocator 3 1 2910736385 1
+ALImpl al_SetDataSource 3 1 1
+ALImpl al_engitf_CreateMediaRecorder
+ALImpl al_objitf_Realize 5 0
+ALImpl al_objitf_GetInterface 5 15
+ALImpl al_recorditf_SetMarkerPosition 1000
+ALImpl al_recorditf_ClearMarkerPosition
+ALImpl al_objitf_Destroy 5
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest]
+
+[Test]
+title 8.10 RecordItf SetMarkerPosition
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav
+ALImpl al_SetDataFormat 1 audio/wav 15
+ALImpl al_SetDataSink 1 1 5
+ALImpl al_SetDataLocator 3 1 2910736385 1
+ALImpl al_SetDataSource 3 1 1
+ALImpl al_engitf_CreateMediaRecorder
+ALImpl al_objitf_Realize 5 0
+ALImpl al_objitf_GetInterface 5 15
+ALImpl al_recorditf_SetMarkerPosition 1000
+ALImpl al_recorditf_GetMarkerPosition
+ALImpl al_objitf_Destroy 5
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest]
+
+[Test]
+title 8.11 RecordItf SetPositionUpdatePeriod
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav
+ALImpl al_SetDataFormat 1 audio/wav 15
+ALImpl al_SetDataSink 1 1 5
+ALImpl al_SetDataLocator 3 1 2910736385 1
+ALImpl al_SetDataSource 3 1 1
+ALImpl al_engitf_CreateMediaRecorder
+ALImpl al_objitf_Realize 5 0
+ALImpl al_objitf_GetInterface 5 15
+ALImpl al_recorditf_SetPositionUpdatePeriod 1000
+ALImpl al_objitf_Destroy 5
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest]
+
+[Test]
+title 8.12 RecordItf GetPositionUpdatePeriod
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav
+ALImpl al_SetDataFormat 1 audio/wav 15
+ALImpl al_SetDataSink 1 1 5
+ALImpl al_SetDataLocator 3 1 2910736385 1
+ALImpl al_SetDataSource 3 1 1
+ALImpl al_engitf_CreateMediaRecorder
+ALImpl al_objitf_Realize 5 0
+ALImpl al_objitf_GetInterface 5 15
+ALImpl al_recorditf_SetPositionUpdatePeriod 1000
+ALImpl al_recorditf_GetPositionUpdatePeriod
+ALImpl al_objitf_Destroy 5
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest]
+
+[Test]
+title 8.13 RecordItf SetRecordState AMR
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.amr
+ALImpl al_SetDataFormat 1 audio/amr 21
+ALImpl al_SetDataSink 1 1 5
+ALImpl al_SetDataLocator 3 1 2910736385 1
+ALImpl al_SetDataSource 3 1 1
+ALImpl al_engitf_CreateMediaRecorder 1 15
+ALImpl al_objitf_Realize 5 0
+ALImpl al_objitf_GetInterface 5 15
+ALImpl al_recorditf_SetRecordState 3
+pause 5000
+ALImpl al_recorditf_SetRecordState 1
+ALImpl al_objitf_Destroy 5
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 8.14 RecordItf SetRecordState MP4
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_GetInterface 1 5
+ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.mp4
+ALImpl al_SetDataFormat 1 audio/mpeg 10
+ALImpl al_SetDataSink 1 1 5
+ALImpl al_SetDataLocator 3 1 2910736385 1
+ALImpl al_SetDataSource 3 1 1
+ALImpl al_engitf_CreateMediaRecorder 1 15
+ALImpl al_objitf_Realize 5 0
+ALImpl al_objitf_GetInterface 5 15
+ALImpl al_recorditf_SetCallbackEventsMask 7
+ALImpl al_recorditf_SetRecordState 3
+pause 10000
+ALImpl al_recorditf_SetRecordState 1
+ALImpl al_objitf_Destroy 5
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest] 
+
--- a/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_objectitf.cfg	Mon May 03 12:59:52 2010 +0300
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_objectitf.cfg	Fri May 14 16:22:35 2010 +0300
@@ -14,26 +14,16 @@
 // Description: 
 //
 //
+[StifSettings]
+CheckHeapBalance=off
+[EndStifSettings]
 
 [Test]
 title 5.1 ObjectItf SetPriority
 create openmaxaltestmodule ALImpl
 ALImpl al_createEngine 1 1 0 0
-ALImpl al_objitf_Realize 1 0
-ALImpl al_objitf_GetInterface 1 5
-ALImpl al_objitf_SetPriority 1 100 100
-ALImpl al_objitf_GetPriority 1
-ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav
-ALImpl al_SetDataFormat 1 audio/wav 15
-ALImpl al_SetDataSink 1 1 5
-ALImpl al_SetDataLocator 3 1 2910736385
-ALImpl al_SetDataSource 3 1 1
-ALImpl al_engitf_CreateMediaRecorder
-ALImpl al_objitf_Realize 5 0
-ALImpl al_objitf_GetInterface 5 15
-ALImpl al_recorditf_SetPositionUpdatePeriod 1000
-ALImpl al_recorditf_GetPositionUpdatePeriod
-ALImpl al_objitf_Destroy 5
+ALImpl al_objitf_Realize 1 XA_BOOLEAN_FALSE
+ALImpl al_objitf_SetPriority 1 100 XA_BOOLEAN_FALSE
 ALImpl al_objitf_Destroy 1
 delete ALImpl
 [Endtest] 
@@ -42,21 +32,9 @@
 title 5.2 ObjectItf GetPriority
 create openmaxaltestmodule ALImpl
 ALImpl al_createEngine 1 1 0 0
-ALImpl al_objitf_Realize 1 0
-ALImpl al_objitf_GetInterface 1 5
-ALImpl al_objitf_SetPriority 1 100 100
-ALImpl al_objitf_GetPriority 1
-ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav
-ALImpl al_SetDataFormat 1 audio/wav 15
-ALImpl al_SetDataSink 1 1 5
-ALImpl al_SetDataLocator 3 1 2910736385
-ALImpl al_SetDataSource 3 1 1
-ALImpl al_engitf_CreateMediaRecorder
-ALImpl al_objitf_Realize 5 0
-ALImpl al_objitf_GetInterface 5 15
-ALImpl al_recorditf_SetPositionUpdatePeriod 1000
-ALImpl al_recorditf_GetPositionUpdatePeriod
-ALImpl al_objitf_Destroy 5
+ALImpl al_objitf_Realize 1 XA_BOOLEAN_FALSE
+ALImpl al_objitf_SetPriority 1 100 XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetPriority 1 100 XA_BOOLEAN_FALSE
 ALImpl al_objitf_Destroy 1
 delete ALImpl
 [Endtest] 
@@ -65,20 +43,8 @@
 title 5.3 ObjectItf SetLossOfControlInterfaces
 create openmaxaltestmodule ALImpl
 ALImpl al_createEngine 1 1 0 0
-ALImpl al_objitf_Realize 1 0
-ALImpl al_objitf_GetInterface 1 5
+ALImpl al_objitf_Realize 1 XA_BOOLEAN_FALSE
 ALImpl al_objitf_SetLossOfControlInterfaces 1 0 1
-ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav
-ALImpl al_SetDataFormat 1 audio/wav 15
-ALImpl al_SetDataSink 1 1 5
-ALImpl al_SetDataLocator 3 1 2910736385
-ALImpl al_SetDataSource 3 1 1
-ALImpl al_engitf_CreateMediaRecorder
-ALImpl al_objitf_Realize 5 0
-ALImpl al_objitf_GetInterface 5 15
-ALImpl al_recorditf_SetPositionUpdatePeriod 1000
-ALImpl al_recorditf_GetPositionUpdatePeriod
-ALImpl al_objitf_Destroy 5
 ALImpl al_objitf_Destroy 1
 delete ALImpl
 [Endtest] 
@@ -87,20 +53,8 @@
 title 5.4 ObjectItf RegisterCallback
 create openmaxaltestmodule ALImpl
 ALImpl al_createEngine 1 1 0 0
-ALImpl al_objitf_Realize 1 0
-ALImpl al_objitf_GetInterface 1 5
+ALImpl al_objitf_Realize 1 XA_BOOLEAN_FALSE
 ALImpl al_objitf_RegisterCallback 1
-ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav
-ALImpl al_SetDataFormat 1 audio/wav 15
-ALImpl al_SetDataSink 1 1 5
-ALImpl al_SetDataLocator 3 1 2910736385
-ALImpl al_SetDataSource 3 1 1
-ALImpl al_engitf_CreateMediaRecorder
-ALImpl al_objitf_Realize 5 0
-ALImpl al_objitf_GetInterface 5 15
-ALImpl al_recorditf_SetPositionUpdatePeriod 1000
-ALImpl al_recorditf_GetPositionUpdatePeriod
-ALImpl al_objitf_Destroy 5
 ALImpl al_objitf_Destroy 1
 delete ALImpl
 [Endtest] 
@@ -109,65 +63,67 @@
 title 5.5 ObjectItf GetState
 create openmaxaltestmodule ALImpl
 ALImpl al_createEngine 1 1 0 0
-ALImpl al_objitf_Realize 1 0
+ALImpl al_objitf_Realize 1 XA_BOOLEAN_FALSE
+ALImpl al_objitf_GetState 1 XA_OBJECT_STATE_REALIZED
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest]
+
+[Test]
+title 5.6 ObjectItf Realize
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 XA_BOOLEAN_FALSE
 ALImpl al_objitf_GetInterface 1 5
-ALImpl al_objitf_GetState 1
-ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav
-ALImpl al_SetDataFormat 1 audio/wav 15
-ALImpl al_SetDataSink 1 1 5
-ALImpl al_SetDataLocator 3 1 2910736385
-ALImpl al_SetDataSource 3 1 1
-ALImpl al_engitf_CreateMediaRecorder
-ALImpl al_objitf_Realize 5 0
-ALImpl al_objitf_GetInterface 5 15
-ALImpl al_recorditf_SetPositionUpdatePeriod 1000
-ALImpl al_recorditf_GetPositionUpdatePeriod
-ALImpl al_objitf_Destroy 5
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest] 
+
+
+[Test]
+title 5.7 ObjectItf Resume
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_Realize 1 XA_BOOLEAN_FALSE
+allownextresult XA_RESULT_PRECONDITIONS_VIOLATED
+ALImpl al_objitf_Resume 1 XA_BOOLEAN_FALSE
 ALImpl al_objitf_Destroy 1
 delete ALImpl
 [Endtest]
 
 [Test]
-title 5.6 ObjectItf Resume
+title 5.8 ObjectItf AbortAsyncOperation
 create openmaxaltestmodule ALImpl
 ALImpl al_createEngine 1 1 0 0
-ALImpl al_objitf_Realize 1 0
-ALImpl al_objitf_GetInterface 1 5
-ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav
-ALImpl al_SetDataFormat 1 audio/wav 15
-ALImpl al_SetDataSink 1 1 5
-ALImpl al_SetDataLocator 3 1 2910736385
-ALImpl al_SetDataSource 3 1 1
-ALImpl al_engitf_CreateMediaRecorder
-ALImpl al_objitf_Realize 5 0
-allownextresult XA_RESULT_PRECONDITIONS_VIOLATED
-ALImpl al_objitf_Resume 5 0
-ALImpl al_objitf_GetInterface 5 15
-ALImpl al_recorditf_SetPositionUpdatePeriod 1000
-ALImpl al_recorditf_GetPositionUpdatePeriod
-ALImpl al_objitf_Destroy 5
+ALImpl al_objitf_Realize 1 XA_BOOLEAN_FALSE
+ALImpl al_objitf_AbortAsyncOperation 1
 ALImpl al_objitf_Destroy 1
 delete ALImpl
 [Endtest]
 
 [Test]
-title 5.7 ObjectItf AbortAsyncOperation
+title 5.9 ObjectItf Realize Async
 create openmaxaltestmodule ALImpl
 ALImpl al_createEngine 1 1 0 0
-ALImpl al_objitf_Realize 1 0
-ALImpl al_objitf_GetInterface 1 5
-ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav
-ALImpl al_SetDataFormat 1 audio/wav 15
-ALImpl al_SetDataSink 1 1 5
-ALImpl al_SetDataLocator 3 1 2910736385
-ALImpl al_SetDataSource 3 1 1
-ALImpl al_engitf_CreateMediaRecorder
-ALImpl al_objitf_Realize 5 0
-ALImpl al_objitf_AbortAsyncOperation 5
-ALImpl al_objitf_GetInterface 5 15
-ALImpl al_recorditf_SetPositionUpdatePeriod 1000
-ALImpl al_recorditf_GetPositionUpdatePeriod
-ALImpl al_objitf_Destroy 5
+ALImpl al_objitf_RegisterCallback 1
+request Event_XA_OBJECT_EVENT_ASYNC_TERMINATION
+ALImpl al_objitf_Realize 1 XA_BOOLEAN_TRUE
+wait Event_XA_OBJECT_EVENT_ASYNC_TERMINATION
+release Event_XA_OBJECT_EVENT_ASYNC_TERMINATION
+ALImpl al_objitf_Destroy 1
+delete ALImpl
+[Endtest] 
+
+[Test]
+title 5.10 ObjectItf Resume
+create openmaxaltestmodule ALImpl
+ALImpl al_createEngine 1 1 0 0
+ALImpl al_objitf_RegisterCallback 1
+ALImpl al_objitf_Realize 1 XA_BOOLEAN_FALSE
+request Event_XA_OBJECT_EVENT_ASYNC_TERMINATION
+ALImpl al_objitf_Resume 1 XA_BOOLEAN_TRUE
+wait Event_XA_OBJECT_EVENT_ASYNC_TERMINATION
+release Event_XA_OBJECT_EVENT_ASYNC_TERMINATION
 ALImpl al_objitf_Destroy 1
 delete ALImpl
 [Endtest]
\ No newline at end of file
--- a/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_ro_audioencoderitf.cfg	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +0,0 @@
-//
-// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description: 
-//
-//
-
-// IID numbers for interfaces to mention during object creation
-//	 XA_IID_NULL                    	1
-//	 XA_IID_OBJECT                    	2
-//	 XA_IID_CONFIGEXTENSION             3
-//	 XA_IID_DYNAMICINTERFACEMANAGEMENT  4
-//	 XA_IID_ENGINE                    	5
-//	 XA_IID_THREADSYNC                  6
-//	 XA_IID_PLAY                    	7
-//	 XA_IID_PLAYBACKRATE                8
-//	 XA_IID_PREFETCHSTATUS              9
-//	 XA_IID_SEEK                    	10
-//	 XA_IID_VOLUME                    	11
-//	 XA_IID_IMAGECONTROLS               12
-//	 XA_IID_IMAGEEFFECTS                13
-//	 XA_IID_VIDEOPOSTPROCESSING         14
-//	 XA_IID_RECORD                    	15
-//	 XA_IID_SNAPSHOT                    16
-//	 XA_IID_METADATAEXTRACTION          17
-//	 XA_IID_METADATAINSERTION           18
-//	 XA_IID_METADATATRAVERSAL           19
-//	 XA_IID_DYNAMICSOURCE               20
-//	 XA_IID_CAMERACAPABILITIES          21
-//	 XA_IID_CAMERA                    	22
-//	 XA_IID_AUDIOIODEVICECAPABILITIES   23
-//	 XA_IID_DEVICEVOLUME                24
-//	 XA_IID_EQUALIZER                   25
-//	 XA_IID_OUTPUTMIX                   26
-//	 XA_IID_RADIO                    	27
-//	 XA_IID_RDS                         28
-//	 XA_IID_VIBRA                    	29
-//	 XA_IID_LED                         30
-//	 XA_IID_AUDIODECODERCAPABILITIES    31
-//	 XA_IID_AUDIOENCODER                32
-//	 XA_IID_AUDIOENCODERCAPABILITIES    33
-//	 XA_IID_IMAGEENCODERCAPABILITIES    34
-//	 XA_IID_IMAGEDECODERCAPABILITIES    35
-//	 XA_IID_IMAGEENCODER                36
-//	 XA_IID_VIDEODECODERCAPABILITIES    37
-//	 XA_IID_VIDEOENCODER                38
-//	 XA_IID_VIDEOENCODERCAPABILITIES    39
-//	 XA_IID_STREAMINFORMATION           40
-
-[Test]
-title 7.1 AudioEncoderItf GetEncoderSettings
-create openmaxaltestmodule ALImpl
-ALImpl al_createEngine 1 1 0 0
-ALImpl al_objitf_Realize 1 0
-ALImpl al_objitf_GetInterface 1 5
-ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.wav
-ALImpl al_SetDataFormat 1 audio/wav 15
-ALImpl al_SetDataSink 1 1 5
-ALImpl al_SetDataLocator 3 1 2910736385
-ALImpl al_SetDataSource 3 1 1
-ALImpl al_engitf_CreateMediaRecorder
-ALImpl al_objitf_Realize 5 0
-ALImpl al_objitf_GetInterface 5 32
-ALImpl al_audioencoderitf_GetEncoderSettings
-ALImpl al_objitf_Destroy 5
-ALImpl al_objitf_Destroy 1
-delete ALImpl
-[Endtest] 
-
-[Test]
-title 7.2 AudioEncoderItf SetEncoderSettings
-create openmaxaltestmodule ALImpl
-ALImpl al_createEngine 1 1 0 0
-ALImpl al_objitf_Realize 1 0
-ALImpl al_objitf_GetInterface 1 5
-ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.wav
-ALImpl al_SetDataFormat 1 audio/wav 15
-ALImpl al_SetDataSink 1 1 5
-ALImpl al_SetDataLocator 3 1 2910736385
-ALImpl al_SetDataSource 3 1 1
-ALImpl al_engitf_CreateMediaRecorder
-ALImpl al_objitf_Realize 5 0
-ALImpl al_objitf_GetInterface 5 32
-ALImpl al_audioencoderitf_SetEncoderSettings 1 1 1 8000 128000 16 1 1 0 0 0 0 0
-ALImpl al_objitf_Destroy 5
-ALImpl al_objitf_Destroy 1
-delete ALImpl
-[Endtest] 
\ No newline at end of file
--- a/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_ro_mdinsertionitf.cfg	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,218 +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: 
-//
-//
-
-// IID numbers for interfaces to mention during object creation
-//	 XA_IID_NULL                    	1
-//	 XA_IID_OBJECT                    	2
-//	 XA_IID_CONFIGEXTENSION             3
-//	 XA_IID_DYNAMICINTERFACEMANAGEMENT  4
-//	 XA_IID_ENGINE                    	5
-//	 XA_IID_THREADSYNC                  6
-//	 XA_IID_PLAY                    	7
-//	 XA_IID_PLAYBACKRATE                8
-//	 XA_IID_PREFETCHSTATUS              9
-//	 XA_IID_SEEK                    	10
-//	 XA_IID_VOLUME                    	11
-//	 XA_IID_IMAGECONTROLS               12
-//	 XA_IID_IMAGEEFFECTS                13
-//	 XA_IID_VIDEOPOSTPROCESSING         14
-//	 XA_IID_RECORD                    	15
-//	 XA_IID_SNAPSHOT                    16
-//	 XA_IID_METADATAEXTRACTION          17
-//	 XA_IID_METADATAINSERTION           18
-//	 XA_IID_METADATATRAVERSAL           19
-//	 XA_IID_DYNAMICSOURCE               20
-//	 XA_IID_CAMERACAPABILITIES          21
-//	 XA_IID_CAMERA                    	22
-//	 XA_IID_AUDIOIODEVICECAPABILITIES   23
-//	 XA_IID_DEVICEVOLUME                24
-//	 XA_IID_EQUALIZER                   25
-//	 XA_IID_OUTPUTMIX                   26
-//	 XA_IID_RADIO                    	27
-//	 XA_IID_RDS                         28
-//	 XA_IID_VIBRA                    	29
-//	 XA_IID_LED                         30
-//	 XA_IID_AUDIODECODERCAPABILITIES    31
-//	 XA_IID_AUDIOENCODER                32
-//	 XA_IID_AUDIOENCODERCAPABILITIES    33
-//	 XA_IID_IMAGEENCODERCAPABILITIES    34
-//	 XA_IID_IMAGEDECODERCAPABILITIES    35
-//	 XA_IID_IMAGEENCODER                36
-//	 XA_IID_VIDEODECODERCAPABILITIES    37
-//	 XA_IID_VIDEOENCODER                38
-//	 XA_IID_VIDEOENCODERCAPABILITIES    39
-//	 XA_IID_STREAMINFORMATION           40
-
-[Test]
-title 6.1 MetadataInsertionItf CreateChildNode
-create openmaxaltestmodule ALImpl
-ALImpl al_createEngine 1 1 0 0
-ALImpl al_objitf_Realize 1 0
-ALImpl al_objitf_GetInterface 1 5
-ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.amr
-ALImpl al_SetDataFormat 1 audio/amr 21
-ALImpl al_SetDataSink 1 1 5
-ALImpl al_SetDataLocator 3 1 2910736385
-ALImpl al_SetDataSource 3 1 1
-ALImpl al_engitf_CreateMediaRecorder
-ALImpl al_objitf_Realize 5 0
-ALImpl al_objitf_GetInterface 5 4
-ALImpl al_dimitf_AddInterface 18 0 
-ALImpl al_objitf_GetInterface 5 18
-allownextresult 12 0
-ALImpl al_metadatainsertionitf_CreateChildNode 2147483647 2 audio/amr
-ALImpl al_objitf_Destroy 5
-ALImpl al_objitf_Destroy 1
-delete ALImpl
-[Endtest] 
-
-[Test]
-title 6.2 MetadataInsertionItf GetSupportedKeysCount
-create openmaxaltestmodule ALImpl
-ALImpl al_createEngine 1 1 0 0
-ALImpl al_objitf_Realize 1 0
-ALImpl al_objitf_GetInterface 1 5
-ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.amr
-ALImpl al_SetDataFormat 1 audio/amr 21
-ALImpl al_SetDataSink 1 1 5
-ALImpl al_SetDataLocator 3 1 2910736385
-ALImpl al_SetDataSource 3 1 1
-ALImpl al_engitf_CreateMediaRecorder
-ALImpl al_objitf_Realize 5 0
-ALImpl al_objitf_GetInterface 5 4
-ALImpl al_dimitf_AddInterface 18 0 
-ALImpl al_objitf_GetInterface 5 18
-allownextresult 2 0
-ALImpl al_metadatainsertionitf_GetSupportedKeysCount 1
-ALImpl al_objitf_Destroy 5
-ALImpl al_objitf_Destroy 1
-delete ALImpl
-[Endtest] 
-
-[Test]
-title 6.3 MetadataInsertionItf GetKeySize
-create openmaxaltestmodule ALImpl
-ALImpl al_createEngine 1 1 0 0
-ALImpl al_objitf_Realize 1 0
-ALImpl al_objitf_GetInterface 1 5
-ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.amr
-ALImpl al_SetDataFormat 1 audio/amr 21
-ALImpl al_SetDataSink 1 1 5
-ALImpl al_SetDataLocator 3 1 2910736385
-ALImpl al_SetDataSource 3 1 1
-ALImpl al_engitf_CreateMediaRecorder
-ALImpl al_objitf_Realize 5 0
-ALImpl al_objitf_GetInterface 5 4
-ALImpl al_dimitf_AddInterface 18 0 
-ALImpl al_objitf_GetInterface 5 18
-allownextresult 2 0
-ALImpl al_metadatainsertionitf_GetKeySize 1 1
-ALImpl al_objitf_Destroy 5
-ALImpl al_objitf_Destroy 1
-delete ALImpl
-[Endtest] 
-
-[Test]
-title 6.4 MetadataInsertionItf GetKey
-create openmaxaltestmodule ALImpl
-ALImpl al_createEngine 1 1 0 0
-ALImpl al_objitf_Realize 1 0
-ALImpl al_objitf_GetInterface 1 5
-ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.amr
-ALImpl al_SetDataFormat 1 audio/amr 21
-ALImpl al_SetDataSink 1 1 5
-ALImpl al_SetDataLocator 3 1 2910736385
-ALImpl al_SetDataSource 3 1 1
-ALImpl al_engitf_CreateMediaRecorder
-ALImpl al_objitf_Realize 5 0
-ALImpl al_objitf_GetInterface 5 4
-ALImpl al_dimitf_AddInterface 18 0 
-ALImpl al_objitf_GetInterface 5 18
-allownextresult 2 0
-ALImpl al_metadatainsertionitf_GetKey 1 1 1
-ALImpl al_objitf_Destroy 5
-ALImpl al_objitf_Destroy 1
-delete ALImpl
-[Endtest] 
-
-[Test]
-title 6.5 MetadataInsertionItf GetFreeKeysEncoding
-create openmaxaltestmodule ALImpl
-ALImpl al_createEngine 1 1 0 0
-ALImpl al_objitf_Realize 1 0
-ALImpl al_objitf_GetInterface 1 5
-ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.amr
-ALImpl al_SetDataFormat 1 audio/amr 21
-ALImpl al_SetDataSink 1 1 5
-ALImpl al_SetDataLocator 3 1 2910736385
-ALImpl al_SetDataSource 3 1 1
-ALImpl al_engitf_CreateMediaRecorder
-ALImpl al_objitf_Realize 5 0
-ALImpl al_objitf_GetInterface 5 4
-ALImpl al_dimitf_AddInterface 18 0 
-ALImpl al_objitf_GetInterface 5 18
-allownextresult 2 1
-ALImpl al_metadatainsertionitf_GetFreeKeysEncoding 1 1
-ALImpl al_objitf_Destroy 5
-ALImpl al_objitf_Destroy 1
-delete ALImpl
-[Endtest] 
-
-[Test]
-title 6.6 MetadataInsertionItf InsertMetadataItem
-create openmaxaltestmodule ALImpl
-ALImpl al_createEngine 1 1 0 0
-ALImpl al_objitf_Realize 1 0
-ALImpl al_objitf_GetInterface 1 5
-ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.amr
-ALImpl al_SetDataFormat 1 audio/amr 21
-ALImpl al_SetDataSink 1 1 5
-ALImpl al_SetDataLocator 3 1 2910736385
-ALImpl al_SetDataSource 3 1 1
-ALImpl al_engitf_CreateMediaRecorder
-ALImpl al_objitf_Realize 5 0
-ALImpl al_objitf_GetInterface 5 4
-ALImpl al_dimitf_AddInterface 18 0 
-ALImpl al_objitf_GetInterface 5 18
-allownextresult 12 2
-ALImpl al_metadatainsertionitf_InsertMetadataItem 1 2 3 english 4 5 chinese 1
-ALImpl al_objitf_Destroy 5
-ALImpl al_objitf_Destroy 1
-delete ALImpl
-[Endtest] 
-
-[Test]
-title 6.7 MetadataInsertionItf RegisterCallback
-create openmaxaltestmodule ALImpl
-ALImpl al_createEngine 1 1 0 0
-ALImpl al_objitf_Realize 1 0
-ALImpl al_objitf_GetInterface 1 5
-ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/test.amr
-ALImpl al_SetDataFormat 1 audio/amr 21
-ALImpl al_SetDataSink 1 1 5
-ALImpl al_SetDataLocator 3 1 2910736385
-ALImpl al_SetDataSource 3 1 1
-ALImpl al_engitf_CreateMediaRecorder
-ALImpl al_objitf_Realize 5 0
-ALImpl al_objitf_GetInterface 5 4
-ALImpl al_dimitf_AddInterface 18 0 
-ALImpl al_objitf_GetInterface 5 18
-ALImpl al_metadatainsertionitf_RegisterCallback
-ALImpl al_objitf_Destroy 5
-ALImpl al_objitf_Destroy 1
-delete ALImpl
-[Endtest] 
--- a/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/conf/openmaxaltestmodule_ro_recorditf.cfg	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,350 +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: 
-//
-//
-
-// IID numbers for interfaces to mention during object creation
-//	 XA_IID_NULL                    	1
-//	 XA_IID_OBJECT                    	2
-//	 XA_IID_CONFIGEXTENSION             3
-//	 XA_IID_DYNAMICINTERFACEMANAGEMENT  4
-//	 XA_IID_ENGINE                    	5
-//	 XA_IID_THREADSYNC                  6
-//	 XA_IID_PLAY                    	7
-//	 XA_IID_PLAYBACKRATE                8
-//	 XA_IID_PREFETCHSTATUS              9
-//	 XA_IID_SEEK                    	10
-//	 XA_IID_VOLUME                    	11
-//	 XA_IID_IMAGECONTROLS               12
-//	 XA_IID_IMAGEEFFECTS                13
-//	 XA_IID_VIDEOPOSTPROCESSING         14
-//	 XA_IID_RECORD                    	15
-//	 XA_IID_SNAPSHOT                    16
-//	 XA_IID_METADATAEXTRACTION          17
-//	 XA_IID_METADATAINSERTION           18
-//	 XA_IID_METADATATRAVERSAL           19
-//	 XA_IID_DYNAMICSOURCE               20
-//	 XA_IID_CAMERACAPABILITIES          21
-//	 XA_IID_CAMERA                    	22
-//	 XA_IID_AUDIOIODEVICECAPABILITIES   23
-//	 XA_IID_DEVICEVOLUME                24
-//	 XA_IID_EQUALIZER                   25
-//	 XA_IID_OUTPUTMIX                   26
-//	 XA_IID_RADIO                    	27
-//	 XA_IID_RDS                         28
-//	 XA_IID_VIBRA                    	29
-//	 XA_IID_LED                         30
-//	 XA_IID_AUDIODECODERCAPABILITIES    31
-//	 XA_IID_AUDIOENCODER                32
-//	 XA_IID_AUDIOENCODERCAPABILITIES    33
-//	 XA_IID_IMAGEENCODERCAPABILITIES    34
-//	 XA_IID_IMAGEDECODERCAPABILITIES    35
-//	 XA_IID_IMAGEENCODER                36
-//	 XA_IID_VIDEODECODERCAPABILITIES    37
-//	 XA_IID_VIDEOENCODER                38
-//	 XA_IID_VIDEOENCODERCAPABILITIES    39
-//	 XA_IID_STREAMINFORMATION           40
-
-[Test]
-title 8.1 RecordItf SetRecordState
-create openmaxaltestmodule ALImpl
-ALImpl al_createEngine 1 1 0 0
-ALImpl al_objitf_Realize 1 0
-ALImpl al_objitf_GetInterface 1 5
-ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav
-ALImpl al_SetDataFormat 1 audio/wav 15
-ALImpl al_SetDataSink 1 1 5
-ALImpl al_SetDataLocator 3 1 2910736385
-ALImpl al_SetDataSource 3 1 1
-ALImpl al_engitf_CreateMediaRecorder 1 15
-ALImpl al_objitf_Realize 5 0
-ALImpl al_objitf_GetInterface 5 15
-ALImpl al_recorditf_SetRecordState 3
-pause 5000
-ALImpl al_recorditf_SetRecordState 1
-ALImpl al_objitf_Destroy 5
-ALImpl al_objitf_Destroy 1
-delete ALImpl
-[Endtest] 
-
-[Test]
-title 8.2 RecordItf GetRecordState
-create openmaxaltestmodule ALImpl
-ALImpl al_createEngine 1 1 0 0
-ALImpl al_objitf_Realize 1 0
-ALImpl al_objitf_GetInterface 1 5
-ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav
-ALImpl al_SetDataFormat 1 audio/wav 15
-ALImpl al_SetDataSink 1 1 5
-ALImpl al_SetDataLocator 3 1 2910736385
-ALImpl al_SetDataSource 3 1 1
-ALImpl al_engitf_CreateMediaRecorder
-ALImpl al_objitf_Realize 5 0
-ALImpl al_objitf_GetInterface 5 15
-ALImpl al_recorditf_GetRecordState
-ALImpl al_objitf_Destroy 5
-ALImpl al_objitf_Destroy 1
-delete ALImpl
-[Endtest]
-
-[Test]
-title 8.3 RecordItf SetDurationLimit
-create openmaxaltestmodule ALImpl
-ALImpl al_createEngine 1 1 0 0
-ALImpl al_objitf_Realize 1 0
-ALImpl al_objitf_GetInterface 1 5
-ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav
-ALImpl al_SetDataFormat 1 audio/wav 15
-ALImpl al_SetDataSink 1 1 5
-ALImpl al_SetDataLocator 3 1 2910736385
-ALImpl al_SetDataSource 3 1 1
-ALImpl al_engitf_CreateMediaRecorder
-ALImpl al_objitf_Realize 5 0
-ALImpl al_objitf_GetInterface 5 15
-ALImpl al_recorditf_SetDurationLimit 100000
-ALImpl al_objitf_Destroy 5
-ALImpl al_objitf_Destroy 1
-delete ALImpl
-[Endtest]  
-
-[Test]
-title 8.4 RecordItf GetPosition
-create openmaxaltestmodule ALImpl
-ALImpl al_createEngine 1 1 0 0
-ALImpl al_objitf_Realize 1 0
-ALImpl al_objitf_GetInterface 1 5
-ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav
-ALImpl al_SetDataFormat 1 audio/wav 15
-ALImpl al_SetDataSink 1 1 5
-ALImpl al_SetDataLocator 3 1 2910736385
-ALImpl al_SetDataSource 3 1 1
-ALImpl al_engitf_CreateMediaRecorder
-ALImpl al_objitf_Realize 5 0
-ALImpl al_objitf_GetInterface 5 15
-ALImpl al_recorditf_GetPosition
-ALImpl al_objitf_Destroy 5
-ALImpl al_objitf_Destroy 1
-delete ALImpl
-[Endtest] 
-
-[Test]
-title 8.5 RecordItf RegisterCallback
-create openmaxaltestmodule ALImpl
-ALImpl al_createEngine 1 1 0 0
-ALImpl al_objitf_Realize 1 0
-ALImpl al_objitf_GetInterface 1 5
-ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav
-ALImpl al_SetDataFormat 1 audio/wav 15
-ALImpl al_SetDataSink 1 1 5
-ALImpl al_SetDataLocator 3 1 2910736385
-ALImpl al_SetDataSource 3 1 1
-ALImpl al_engitf_CreateMediaRecorder
-ALImpl al_objitf_Realize 5 0
-ALImpl al_objitf_GetInterface 5 15
-ALImpl al_recorditf_RegisterCallback
-ALImpl al_objitf_Destroy 5
-ALImpl al_objitf_Destroy 1
-delete ALImpl
-[Endtest] 
-
-[Test]
-title 8.6 RecordItf SetCallbackEventsMask
-create openmaxaltestmodule ALImpl
-ALImpl al_createEngine 1 1 0 0
-ALImpl al_objitf_Realize 1 0
-ALImpl al_objitf_GetInterface 1 5
-ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav
-ALImpl al_SetDataFormat 1 audio/wav 15
-ALImpl al_SetDataSink 1 1 5
-ALImpl al_SetDataLocator 3 1 2910736385
-ALImpl al_SetDataSource 3 1 1
-ALImpl al_engitf_CreateMediaRecorder
-ALImpl al_objitf_Realize 5 0
-ALImpl al_objitf_GetInterface 5 15
-ALImpl al_recorditf_SetCallbackEventsMask 1
-ALImpl al_objitf_Destroy 5
-ALImpl al_objitf_Destroy 1
-delete ALImpl
-[Endtest]
-
-[Test]
-title 8.7 RecordItf GetCallbackEventsMask
-create openmaxaltestmodule ALImpl
-ALImpl al_createEngine 1 1 0 0
-ALImpl al_objitf_Realize 1 0
-ALImpl al_objitf_GetInterface 1 5
-ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav
-ALImpl al_SetDataFormat 1 audio/wav 15
-ALImpl al_SetDataSink 1 1 5
-ALImpl al_SetDataLocator 3 1 2910736385
-ALImpl al_SetDataSource 3 1 1
-ALImpl al_engitf_CreateMediaRecorder
-ALImpl al_objitf_Realize 5 0
-ALImpl al_objitf_GetInterface 5 15
-ALImpl al_recorditf_GetCallbackEventsMask
-ALImpl al_objitf_Destroy 5
-ALImpl al_objitf_Destroy 1
-delete ALImpl
-[Endtest]
-
-
-[Test]
-title 8.8 RecordItf SetMarkerPosition
-create openmaxaltestmodule ALImpl
-ALImpl al_createEngine 1 1 0 0
-ALImpl al_objitf_Realize 1 0
-ALImpl al_objitf_GetInterface 1 5
-ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav
-ALImpl al_SetDataFormat 1 audio/wav 15
-ALImpl al_SetDataSink 1 1 5
-ALImpl al_SetDataLocator 3 1 2910736385
-ALImpl al_SetDataSource 3 1 1
-ALImpl al_engitf_CreateMediaRecorder
-ALImpl al_objitf_Realize 5 0
-ALImpl al_objitf_GetInterface 5 15
-ALImpl al_recorditf_SetMarkerPosition 1000
-ALImpl al_objitf_Destroy 5
-ALImpl al_objitf_Destroy 1
-delete ALImpl
-[Endtest]
-
-
-[Test]
-title 8.9 RecordItf ClearMarkerPosition
-create openmaxaltestmodule ALImpl
-ALImpl al_createEngine 1 1 0 0
-ALImpl al_objitf_Realize 1 0
-ALImpl al_objitf_GetInterface 1 5
-ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav
-ALImpl al_SetDataFormat 1 audio/wav 15
-ALImpl al_SetDataSink 1 1 5
-ALImpl al_SetDataLocator 3 1 2910736385
-ALImpl al_SetDataSource 3 1 1
-ALImpl al_engitf_CreateMediaRecorder
-ALImpl al_objitf_Realize 5 0
-ALImpl al_objitf_GetInterface 5 15
-ALImpl al_recorditf_SetMarkerPosition 1000
-ALImpl al_recorditf_ClearMarkerPosition
-ALImpl al_objitf_Destroy 5
-ALImpl al_objitf_Destroy 1
-delete ALImpl
-[Endtest]
-
-[Test]
-title 8.10 RecordItf SetMarkerPosition
-create openmaxaltestmodule ALImpl
-ALImpl al_createEngine 1 1 0 0
-ALImpl al_objitf_Realize 1 0
-ALImpl al_objitf_GetInterface 1 5
-ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav
-ALImpl al_SetDataFormat 1 audio/wav 15
-ALImpl al_SetDataSink 1 1 5
-ALImpl al_SetDataLocator 3 1 2910736385
-ALImpl al_SetDataSource 3 1 1
-ALImpl al_engitf_CreateMediaRecorder
-ALImpl al_objitf_Realize 5 0
-ALImpl al_objitf_GetInterface 5 15
-ALImpl al_recorditf_SetMarkerPosition 1000
-ALImpl al_recorditf_GetMarkerPosition
-ALImpl al_objitf_Destroy 5
-ALImpl al_objitf_Destroy 1
-delete ALImpl
-[Endtest]
-
-[Test]
-title 8.11 RecordItf SetPositionUpdatePeriod
-create openmaxaltestmodule ALImpl
-ALImpl al_createEngine 1 1 0 0
-ALImpl al_objitf_Realize 1 0
-ALImpl al_objitf_GetInterface 1 5
-ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav
-ALImpl al_SetDataFormat 1 audio/wav 15
-ALImpl al_SetDataSink 1 1 5
-ALImpl al_SetDataLocator 3 1 2910736385
-ALImpl al_SetDataSource 3 1 1
-ALImpl al_engitf_CreateMediaRecorder
-ALImpl al_objitf_Realize 5 0
-ALImpl al_objitf_GetInterface 5 15
-ALImpl al_recorditf_SetPositionUpdatePeriod 1000
-ALImpl al_objitf_Destroy 5
-ALImpl al_objitf_Destroy 1
-delete ALImpl
-[Endtest]
-
-[Test]
-title 8.12 RecordItf GetPositionUpdatePeriod
-create openmaxaltestmodule ALImpl
-ALImpl al_createEngine 1 1 0 0
-ALImpl al_objitf_Realize 1 0
-ALImpl al_objitf_GetInterface 1 5
-ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.wav
-ALImpl al_SetDataFormat 1 audio/wav 15
-ALImpl al_SetDataSink 1 1 5
-ALImpl al_SetDataLocator 3 1 2910736385
-ALImpl al_SetDataSource 3 1 1
-ALImpl al_engitf_CreateMediaRecorder
-ALImpl al_objitf_Realize 5 0
-ALImpl al_objitf_GetInterface 5 15
-ALImpl al_recorditf_SetPositionUpdatePeriod 1000
-ALImpl al_recorditf_GetPositionUpdatePeriod
-ALImpl al_objitf_Destroy 5
-ALImpl al_objitf_Destroy 1
-delete ALImpl
-[Endtest]
-
-[Test]
-title 8.13 RecordItf SetRecordState AMR
-create openmaxaltestmodule ALImpl
-ALImpl al_createEngine 1 1 0 0
-ALImpl al_objitf_Realize 1 0
-ALImpl al_objitf_GetInterface 1 5
-ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.amr
-ALImpl al_SetDataFormat 1 audio/amr 21
-ALImpl al_SetDataSink 1 1 5
-ALImpl al_SetDataLocator 3 1 2910736385
-ALImpl al_SetDataSource 3 1 1
-ALImpl al_engitf_CreateMediaRecorder 1 15
-ALImpl al_objitf_Realize 5 0
-ALImpl al_objitf_GetInterface 5 15
-ALImpl al_recorditf_SetRecordState 3
-pause 5000
-ALImpl al_recorditf_SetRecordState 1
-ALImpl al_objitf_Destroy 5
-ALImpl al_objitf_Destroy 1
-delete ALImpl
-[Endtest] 
-
-[Test]
-title 8.14 RecordItf SetRecordState MP4
-create openmaxaltestmodule ALImpl
-ALImpl al_createEngine 1 1 0 0
-ALImpl al_objitf_Realize 1 0
-ALImpl al_objitf_GetInterface 1 5
-ALImpl al_SetDataLocator 1 file:/\/\/c:/testing/data/omxaltestdata/record.mp4
-ALImpl al_SetDataFormat 1 audio/mpeg 10
-ALImpl al_SetDataSink 1 1 5
-ALImpl al_SetDataLocator 3 1 2910736385
-ALImpl al_SetDataSource 3 1 1
-ALImpl al_engitf_CreateMediaRecorder 1 15
-ALImpl al_objitf_Realize 5 0
-ALImpl al_objitf_GetInterface 5 15
-ALImpl al_recorditf_SetRecordState 3
-pause 10000
-ALImpl al_recorditf_SetRecordState 1
-ALImpl al_objitf_Destroy 5
-ALImpl al_objitf_Destroy 1
-delete ALImpl
-[Endtest] 
-
Binary file mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/data/c/omxaltestdata/JapJap.mp3 has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/data/c/omxaltestdata/readme.txt	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,2 @@
+test.3gp - http://10.48.2.51/Copyright_Free_Test_Content/Clips/Video/3GP/176x144/h263/index_http.html - 15fps_384kbps_AAC-LC_128kbps_stereo_32kHz.3gp
+test.mp3 - http://10.48.2.51/Copyright_Free_Test_Content/Clips/Audio/Complete_Clips/Content/MP3/MPEG2.5/index_tmp.html - MP3_MPEG2.5_96kbps_11.025khz_stereo.mp3
\ No newline at end of file
Binary file mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/data/c/omxaltestdata/test.3gp has changed
Binary file mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/data/c/omxaltestdata/test.mp3 has changed
Binary file mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/data/c/omxaltestdata/testmp4.mp4 has changed
--- a/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/group/bld.inf	Mon May 03 12:59:52 2010 +0300
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/group/bld.inf	Fri May 14 16:22:35 2010 +0300
@@ -20,15 +20,34 @@
 
 PRJ_TESTEXPORTS
 ../conf/openmaxaltestmodule_common.cfg              /epoc32/winscw/c/testframework/openmaxaltestmodule_common.cfg
+../conf/openmaxaltestmodule_common_noklinvolitf.cfg /epoc32/winscw/c/testframework/openmaxaltestmodule_common_noklinvolitf.cfg
+../conf/openmaxaltestmodule_common_nokvolextitf.cfg /epoc32/winscw/c/testframework/openmaxaltestmodule_common_nokvolextitf.cfg
+../conf/openmaxaltestmodule_common_volumeitf.cfg    /epoc32/winscw/c/testframework/openmaxaltestmodule_common_volumeitf.cfg
 ../conf/openmaxaltestmodule_objectitf.cfg           /epoc32/winscw/c/testframework/openmaxaltestmodule_objectitf.cfg
-../conf/openmaxaltestmodule_ro_mdinsertionitf.cfg   /epoc32/winscw/c/testframework/openmaxaltestmodule_ro_mdinsertionitf.cfg
-../conf/openmaxaltestmodule_ro_recorditf.cfg        /epoc32/winscw/c/testframework/openmaxaltestmodule_ro_recorditf.cfg
-../conf/openmaxaltestmodule_ro_audioencoderitf.cfg  /epoc32/winscw/c/testframework/openmaxaltestmodule_ro_audioencoderitf.cfg
+../conf/openmaxaltestmodule_mr.cfg   					/epoc32/winscw/c/testframework/openmaxaltestmodule_mr.cfg
+../conf/openmaxaltestmodule_mr_mdinsertionitf.cfg   	/epoc32/winscw/c/testframework/openmaxaltestmodule_mr_mdinsertionitf.cfg
+../conf/openmaxaltestmodule_mr_recorditf.cfg        	/epoc32/winscw/c/testframework/openmaxaltestmodule_mr_recorditf.cfg
+../conf/openmaxaltestmodule_mr_audioencoderitf.cfg  	/epoc32/winscw/c/testframework/openmaxaltestmodule_mr_audioencoderitf.cfg
 ../conf/openmaxaltestmodule_engine_audenccapitf.cfg /epoc32/winscw/c/testframework/openmaxaltestmodule_engine_audenccapitf.cfg
 ../conf/openmaxaltestmodule_global.cfg              /epoc32/winscw/c/testframework/openmaxaltestmodule_global.cfg
 ../conf/openmaxaltestmodule_engine_engineitf.cfg    /epoc32/winscw/c/testframework/openmaxaltestmodule_engine_engineitf.cfg
 ../conf/openmaxaltestmodule_engine_aiodcitf.cfg     /epoc32/winscw/c/testframework/openmaxaltestmodule_engine_aiodcitf.cfg
+../conf/openmaxaltestmodule_mp.cfg 		    /epoc32/winscw/c/testframework/openmaxaltestmodule_mp.cfg
+../conf/openmaxaltestmodule_mo.cfg 		    /epoc32/winscw/c/testframework/openmaxaltestmodule_mo.cfg
+../conf/openmaxaltestmodule_mp_objectitf.cfg 	    /epoc32/winscw/c/testframework/openmaxaltestmodule_mp_objectitf.cfg
+../conf/openmaxaltestmodule_mp_playitf.cfg 	    /epoc32/winscw/c/testframework/openmaxaltestmodule_mp_playitf.cfg
+../conf/openmaxaltestmodule_mp_seekitf.cfg 	    /epoc32/winscw/c/testframework/openmaxaltestmodule_mp_seekitf.cfg
+../conf/openmaxaltestmodule_mp_variousformats.cfg   /epoc32/winscw/c/testframework/openmaxaltestmodule_mp_variousformats.cfg
+../conf/openmaxaltestmodule_common_dynsrcitf.cfg    /epoc32/winscw/c/testframework/openmaxaltestmodule_common_dynsrcitf.cfg
+../conf/openmaxaltestmodule_mp_strminfoitf.cfg 	    /epoc32/winscw/c/testframework/openmaxaltestmodule_mp_strminfoitf.cfg
+../conf/openmaxaltestmodule_mp_preemption.cfg       /epoc32/winscw/c/testframework/openmaxaltestmodule_mp_preemption.cfg
+../conf/openmaxaltestmodule_mo_mdextractionitf.cfg  /epoc32/winscw/c/testframework/openmaxaltestmodule_mo_mdextractionitf.cfg
+../conf/openmaxaltestmodule_mp_mdextractionitf.cfg  /epoc32/winscw/c/testframework/openmaxaltestmodule_mp_mdextractionitf.cfg
 ../data/c/omxaltestdata/test.wav                    /epoc32/winscw/c/testing/data/omxaltestdata/test.wav
+../data/c/omxaltestdata/test.mp3                    /epoc32/winscw/c/testing/data/omxaltestdata/test.mp3
+../data/c/omxaltestdata/test.3gp                    /epoc32/winscw/c/testing/data/omxaltestdata/test.3gp
+../data/c/omxaltestdata/JapJap.mp3                  /epoc32/winscw/c/testing/data/omxaltestdata/JapJap.mp3
+../data/c/omxaltestdata/testmp4.mp4                 /epoc32/winscw/c/testing/data/omxaltestdata/testmp4.mp4
 ../init/testframework.ini                           /epoc32/winscw/c/testframework/testframework.ini
 
 PRJ_EXPORTS
--- a/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/group/openmaxaltestmodule.mmp	Mon May 03 12:59:52 2010 +0300
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/group/openmaxaltestmodule.mmp	Fri May 14 16:22:35 2010 +0300
@@ -32,10 +32,15 @@
 //TARGETPATH      ?target_path
 DEFFILE         openmaxaltestmodule.def
 
+//MACRO           PROFILE_TIME
+//MACRO           PRINT_TO_CONSOLE_TIME_DIFF
+
 USERINCLUDE     ../inc 
 OS_LAYER_LIBC_SYSTEMINCLUDE
+OS_LAYER_GLIB_SYSTEMINCLUDE
 OS_LAYER_SYSTEMINCLUDE
 SYSTEMINCLUDE 	/epoc32/include/platform/mw/khronos/ 
+MW_LAYER_SYSTEMINCLUDE
 
 SOURCEPATH      ../src/common
 SOURCE          openmaxaltestmodule.cpp
@@ -45,30 +50,46 @@
 SOURCE          openmaxalobjectcallbacks.cpp 
 SOURCE          openmaxaldynitfmgmtitftests.cpp
 SOURCE          openmaxaldynitfmgmtitfcallbacks.cpp
+SOURCE		 	openmaxaldynsrcitftests.cpp
+SOURCE			openmaxalstrminfoitftests.cpp
+SOURCE			openmaxalvolumeitftests.cpp
+SOURCE			openmaxalnokiavolumeextitftests.cpp
+SOURCE			openmaxalnokialinearvolumeitftests.cpp
+SOURCE 			TimeoutController.cpp
+
 
 SOURCEPATH      ../src/engine
-SOURCE			openmaxalenginetests.cpp 
-SOURCE 			openmaxalengineitftests.cpp
-SOURCE 			openmaxalaudioiodevicecapabilitiesitftests.cpp
-SOURCE 			openmaxalaudioencodercapabiltiesitftests.cpp
+SOURCE		openmaxalenginetests.cpp 
+SOURCE 		openmaxalengineitftests.cpp
+SOURCE 		openmaxalaudioiodevicecapabilitiesitftests.cpp
+SOURCE 		openmaxalaudioencodercapabiltiesitftests.cpp
 SOURCE          openmaxalaudioiodevicecapabilitiesitfcallbacks.cpp 
 
 SOURCEPATH      ../src/recorder
-SOURCE 			openmaxalrecorditftests.cpp
-SOURCE 			openmaxalaudioencoderitftests.cpp
-SOURCE 			openmaxalmetadatainsertionitftests.cpp 
+SOURCE 		openmaxalrecorditftests.cpp
+SOURCE 		openmaxalaudioencoderitftests.cpp
+SOURCE 		openmaxalmetadatainsertionitftests.cpp 
 SOURCE          openmaxalrecorditfcallbacks.cpp 
 SOURCE          openmaxalmetadatainsertionitfcallbacks.cpp
 
+SOURCEPATH 	../src/player
+SOURCE 		openmaxalplayitftests.cpp
+SOURCE 		openmaxalseekitftests.cpp
+
+SOURCEPATH      ../src/metadata
+SOURCE		openmaxalmetadataextractionitftests.cpp
 
 LIBRARY         euser.lib
+LIBRARY			libglib.lib
 LIBRARY         stiftestinterface.lib
 LIBRARY         stiftestengine.lib
-LIBRARY			ecom.lib
+LIBRARY		ecom.lib
 LIBRARY         openmaxal.lib
-LIBRARY			libc.lib
+LIBRARY		libc.lib
+LIBRARY		ws32.lib
 LANG            SC
 
 
 
 // End of File
+
--- a/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/group/openmaxaltestmodule.pkg	Mon May 03 12:59:52 2010 +0300
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/group/openmaxaltestmodule.pkg	Fri May 14 16:22:35 2010 +0300
@@ -20,7 +20,7 @@
 &EN
 
 ; Provide value for uid
-#{"STIF"},(0x10207CA4),1,1,0,TYPE=SA
+#{"OpenMAXALTestModule"},(0x10207CA4),1,1,0,TYPE=SA
 
 ; Series60 product id for S60 3.0
 [0x101F7961], 0, 0, 0, {"Series60ProductID"}
@@ -49,17 +49,34 @@
 "\epoc32\release\armv5\udeb\openmaxaltestmodule.dll"                -   "!:\sys\bin\openmaxaltestmodule.dll"
 "..\conf\openmaxaltestmodule_global.cfg"                            -   "!:\testframework\openmaxaltestmodule_global.cfg"
 "..\conf\openmaxaltestmodule_common.cfg"                            -   "!:\testframework\openmaxaltestmodule_common.cfg"
+"..\conf\openmaxaltestmodule_common_noklinvolitf.cfg"               -   "!:\testframework\openmaxaltestmodule_common_noklinvolitf.cfg"
+"..\conf\openmaxaltestmodule_common_nokvolextitf.cfg"               -   "!:\testframework\openmaxaltestmodule_common_nokvolextitf.cfg"
+"..\conf\openmaxaltestmodule_common_volumeitf.cfg"                  -   "!:\testframework\openmaxaltestmodule_common_volumeitf.cfg"
 "..\conf\openmaxaltestmodule_objectitf.cfg"                         -   "!:\testframework\openmaxaltestmodule_objectitf.cfg"
 "..\conf\openmaxaltestmodule_engine_engineitf.cfg"                  -   "!:\testframework\openmaxaltestmodule_engine_engineitf.cfg"
 "..\conf\openmaxaltestmodule_engine_audenccapitf.cfg"               -   "!:\testframework\openmaxaltestmodule_engine_audenccapitf.cfg"
 "..\conf\openmaxaltestmodule_engine_aiodcitf.cfg"                   -   "!:\testframework\openmaxaltestmodule_engine_aiodcitf.cfg"
-"..\conf\openmaxaltestmodule_ro_recorditf.cfg"                      -   "!:\testframework\openmaxaltestmodule_ro_recorditf.cfg"
-"..\conf\openmaxaltestmodule_ro_mdinsertionitf.cfg"                 -   "!:\testframework\openmaxaltestmodule_ro_mdinsertionitf.cfg"
-"..\conf\openmaxaltestmodule_ro_audioencoderitf.cfg"                -   "!:\testframework\openmaxaltestmodule_ro_audioencoderitf.cfg"
-
+"..\conf\openmaxaltestmodule_mr.cfg"                      			-   "!:\testframework\openmaxaltestmodule_mr.cfg"
+"..\conf\openmaxaltestmodule_mr_recorditf.cfg"                      -   "!:\testframework\openmaxaltestmodule_mr_recorditf.cfg"
+"..\conf\openmaxaltestmodule_mr_mdinsertionitf.cfg"                 -   "!:\testframework\openmaxaltestmodule_mr_mdinsertionitf.cfg"
+"..\conf\openmaxaltestmodule_mr_audioencoderitf.cfg"                -   "!:\testframework\openmaxaltestmodule_mr_audioencoderitf.cfg"
+"..\conf\openmaxaltestmodule_mp.cfg"                                -   "!:\testframework\openmaxaltestmodule_mp.cfg"
+"..\conf\openmaxaltestmodule_mo.cfg"                                -   "!:\testframework\openmaxaltestmodule_mo.cfg"
+"..\conf\openmaxaltestmodule_mp_objectitf.cfg"                      -   "!:\testframework\openmaxaltestmodule_mp_objectitf.cfg"
+"..\conf\openmaxaltestmodule_mp_playitf.cfg"                        -   "!:\testframework\openmaxaltestmodule_mp_playitf.cfg"
+"..\conf\openmaxaltestmodule_mp_seekitf.cfg"                        -   "!:\testframework\openmaxaltestmodule_mp_seekitf.cfg"
+"..\conf\openmaxaltestmodule_common_dynsrcitf.cfg"                      -   "!:\testframework\openmaxaltestmodule_common_dynsrcitf.cfg"
+"..\conf\openmaxaltestmodule_mp_strminfoitf.cfg"                    -   "!:\testframework\openmaxaltestmodule_mp_strminfoitf.cfg"
+"..\conf\openmaxaltestmodule_mp_preemption.cfg"                     -   "!:\testframework\openmaxaltestmodule_mp_preemption.cfg"
+"..\conf\openmaxaltestmodule_mo_mdextractionitf.cfg"                -   "!:\testframework\openmaxaltestmodule_mo_mdextractionitf.cfg"
+"..\conf\openmaxaltestmodule_mp_mdextractionitf.cfg"                -   "!:\testframework\openmaxaltestmodule_mp_mdextractionitf.cfg"
+"..\conf\openmaxaltestmodule_mp_variousformats.cfg"                 -   "!:\testframework\openmaxaltestmodule_mp_variousformats.cfg"
 ;data files
 "..\data\c\omxaltestdata\test.wav"                                  -   "!:\testing\data\omxaltestdata\test.wav"
-
+"..\data\c\omxaltestdata\test.mp3"                                  -  "!:\testing\data\omxaltestdata\test.mp3"
+"..\data\c\omxaltestdata\test.3gp"                                  -  "!:\testing\data\omxaltestdata\test.3gp"
+"..\data\c\omxaltestdata\JapJap.mp3"                                -   "!:\testing\data\omxaltestdata\JapJap.mp3"
+"..\data\c\omxaltestdata\testmp4.mp4"                               -   "!:\testing\data\omxaltestdata\testmp4.mp4"
 ; Embedded SIS 
 ; None
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/inc/TimeoutController.h	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,137 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description:
+*
+*/
+
+
+
+#include <e32svr.h>
+#include <StifParser.h>
+#include <StifLogger.h>
+#include <StifTestInterface.h>
+
+
+/* This class is used to notify the observer 
+*  about the timeout 
+*/
+class MTimeoutObserver
+{
+    public: // New functions
+    
+    /**
+    * Timeout 
+    */
+    virtual void HandleTimeout(TInt error) = 0;
+};
+    
+
+_LIT(KFormatTimeStamp, "%:0%J%:1%T%:2%S%.%*C4%:3%+B");
+
+
+/* This class is used for extra time controlling
+*  The STIF timeout isn't enough
+*/
+NONSHARABLE_CLASS(CSimpleTimeout) : public CActive
+{
+    public:     // Enumerations
+    // None
+
+    private:    // Enumerations
+    // None
+
+    public:     // Constructors and destructor
+
+    /**
+    * Two-phased constructor.
+    */
+    static CSimpleTimeout* NewL( MTimeoutObserver* aObserver, CStifLogger* aLogger);
+
+    /**
+    * Destructor.
+    */
+    ~CSimpleTimeout();
+
+    public:     // New functions
+
+    /**
+    * Starts timeout counting
+    */
+    void Start(TTimeIntervalMicroSeconds aTimeout);
+
+    /**
+    * Cancel timeout counting
+    */
+    void Stop();
+
+
+    public:     // Functions from base classes
+
+    /**
+    * RunL derived from CActive handles the completed requests.
+    */
+    void RunL();
+
+    /**
+    * DoCancel derived from CActive handles the cancel
+    */
+    void DoCancel();
+
+    /**
+    * RunError derived from CActive handles errors from active handler.
+    */
+    TInt RunError( TInt aError );
+
+    protected:  // New functions
+    // None
+
+    protected:  // Functions from base classes
+    // None
+
+    private:
+
+    /**
+    * By default Symbian OS constructor is private.
+    */
+    void ConstructL(MTimeoutObserver* aObserver, CStifLogger* aLogger);
+
+    /**
+    * C++ constructor.
+    */
+    CSimpleTimeout();
+
+    public:     // Data
+    // None
+
+    protected:  // Data
+    // None
+
+    private:    // Data
+    MTimeoutObserver*   iObserver;
+    RTimer 						  iTimer;
+
+    // Storage for testcase timeout.
+    TTime 						iTestCaseTimeout;
+    CStifLogger*				iLog;
+
+    public:     // Friend classes
+    // None
+
+    protected:  // Friend classes
+    // None
+
+    private:    // Friend classes
+    // None
+
+};
--- a/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/inc/openmaxaltestmodule.h	Mon May 03 12:59:52 2010 +0300
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/inc/openmaxaltestmodule.h	Fri May 14 16:22:35 2010 +0300
@@ -24,9 +24,28 @@
 #include <StifTestModule.h>
 #include <TestclassAssert.h>
 #include <OpenMAXAL.h>
+#include <xanokialinearvolumeitf.h>
+#include <xanokiavolumeextitf.h>
+#include <e32msgqueue.h>
+#include "TimeoutController.h"
+#include <w32std.h>
+
 // CONSTANTS
 //const ?type ?constant_var = ?constant;
+// CONSTANTS
+const TInt KErrBadTestParameter= -1000;         // Error on configuration file
 
+const TInt KErrEventPending =-2000;             // Timeout and not callback 
+const TInt KErrCallbackErrorCode = -2001;       // Callback return error code
+const TInt KErrUnexpectedValue =-2002;          // Unexpected value at setting    
+const TInt KErrTimeoutController = -2007;       // Unexpected notification
+
+const TInt KShortTimeout = 1000;
+const TInt KMediumTimeout = 4000;
+const TInt KLongTimeout = 100000;
+
+
+_LIT( KMsgBadTestParameters, "[Error] No valid test case parameters");
 // MACROS
 #define RET_ERR_IF_ERR(err) if (err!=KErrNone) return err;
 //#define ?macro ?macro_def
@@ -63,7 +82,8 @@
 *  @lib ?library
 *  @since ?Series60_version
 */
-NONSHARABLE_CLASS(COpenMAXALTestModule) : public CScriptBase
+NONSHARABLE_CLASS(COpenMAXALTestModule) : public CScriptBase,
+                                            public MTimeoutObserver
     {
     public:  // Constructors and destructor
 
@@ -77,6 +97,15 @@
         */
         virtual ~COpenMAXALTestModule();
 
+        virtual void HandlePlayItfCallback( XAPlayItf caller, XAuint32 event );
+        virtual void HandleObjectCallback(XAObjectItf caller,XAuint32 event,
+                                XAresult result,XAuint32 param, void * pInterface);
+     
+        enum TOMXExpectedEvent
+            {
+            EEOSReceived = 1
+            };
+    
     public: // New functions
 
         /**
@@ -97,6 +126,21 @@
         */
         virtual TInt RunMethodL( CStifItemParser& aItem );
 
+        // From MTimeoutObserver
+
+        /**
+        * @since ?Series60_version
+        * @param none
+        * Review if all the expected events have ocurred once the time is over
+        */
+        void HandleTimeout(TInt error);
+
+        /**
+        * Verify that the event was expected, removes it from the list
+        * Signal the TestScripter with the returned error code
+        * @since ?Series60_version
+        */
+        void ProcessEvent(TOMXExpectedEvent aEvent, TInt aError);        
     protected:  // New functions
 
         /**
@@ -138,6 +182,63 @@
         void Delete();
 
         /**
+        * Set an event as expected and set default timeout
+        * @since ?Series60_version
+        */
+        void AddExpectedEvent(TOMXExpectedEvent event, TInt ms);
+
+
+        /**
+        * Unset an event as expected
+        * @since ?Series60_version
+        */
+        TBool RemoveExpectedEvent(TOMXExpectedEvent event);
+
+
+        /**
+        * @since ?Series60_version
+        * @param none
+        * Removes all expected events
+        */
+        void RemoveAllExpectedEvents();
+
+
+
+        /**
+        * Maps a event with a descriptor with its name
+        * @since ?Series60_version
+        */
+        TPtrC EventName( TInt aKey );
+
+        /*
+        * Test methods are listed below.
+        */
+
+        /**
+        * Sets a timeout different since the default
+        * @since Series60_3_2
+        * @param aItem Script line containing parameters.
+        * @return Symbian OS error code.
+        */
+        TInt SetTimeout( CStifItemParser& aItem );
+
+        /**
+        *
+        * @since Series60_3_2
+        * @param aItem Script line containing parameters.
+        * @return Symbian OS error code.
+        */
+        TInt SetExpectedEvents( CStifItemParser& aItem );
+
+        /**
+        *
+        * @since Series60_3_2
+        * @param aItem Script line containing parameters.
+        * @return Symbian OS error code.
+        */
+        TInt SetAllowedPanic( CStifItemParser& aItem );
+        
+        /**
         * Test methods are listed below. 
         */
 
@@ -153,7 +254,9 @@
         virtual TInt al_SetDataSink( CStifItemParser& aItem );        
         virtual TInt al_SetDataLocator( CStifItemParser& aItem );        
         virtual TInt al_SetDataFormat( CStifItemParser& aItem );        
-        
+        virtual TInt al_CreateWindow( CStifItemParser& aItem );
+        virtual TInt al_DeleteWindow( CStifItemParser& aItem );        
+
         virtual TInt al_createEngine( CStifItemParser& aItem );
         virtual TInt al_queryNumSupportedEngineInterfaces( CStifItemParser& aItem );
         virtual TInt al_querySupportedEngineInterfaces( CStifItemParser& aItem );
@@ -227,6 +330,77 @@
         virtual TInt al_metadatainsertionitf_InsertMetadataItem( CStifItemParser& aItem );
         virtual TInt al_metadatainsertionitf_RegisterCallback( CStifItemParser& aItem );
         
+        virtual TInt al_playitf_SetPlayState( CStifItemParser& aItem );
+        virtual TInt al_playitf_GetPlayState( CStifItemParser& aItem );
+        virtual TInt al_playitf_GetDurationNullParam( CStifItemParser& aItem );
+        virtual TInt al_playitf_GetDuration( CStifItemParser& aItem );
+        virtual TInt al_playitf_GetPositionNullParam( CStifItemParser& aItem );
+        virtual TInt al_playitf_GetPosition( CStifItemParser& aItem );
+        virtual TInt al_playitf_RegisterCallback( CStifItemParser& aItem );
+        virtual TInt al_playitf_SetCallbackEventMask( CStifItemParser& aItem );
+        virtual TInt al_playitf_GetCallbackEventMaskNullParam( CStifItemParser& aItem );
+        virtual TInt al_playitf_GetCallbackEventMask( CStifItemParser& aItem );
+        virtual TInt al_playitf_SetMarkerPosition( CStifItemParser& aItem );
+        virtual TInt al_playitf_ClearMarkerPosition( CStifItemParser& aItem );
+        virtual TInt al_playitf_GetMarkerPositionNullParam( CStifItemParser& aItem );
+        virtual TInt al_playitf_GetMarkerPosition( CStifItemParser& aItem );
+        virtual TInt al_playitf_SetPositionUpdatePeriod( CStifItemParser& aItem );
+        virtual TInt al_playitf_GetPositionUpdatePeriodNullParam( CStifItemParser& aItem );
+        virtual TInt al_playitf_GetPositionUpdatePeriod( CStifItemParser& aItem );
+
+        virtual TInt al_seekitf_SetPosition( CStifItemParser& aItem );
+        virtual TInt al_seekitf_SetLoop( CStifItemParser& aItem );
+        virtual TInt al_seekitf_GetLoop( CStifItemParser& aItem );
+        
+        virtual TInt al_dynsrcitf_SetSource( CStifItemParser& aItem );
+        
+        virtual TInt al_strminfoitf_QueryMediaContainerInformation( CStifItemParser& aItem );
+        virtual TInt al_strminfoitf_QueryStreamType( CStifItemParser& aItem );
+        virtual TInt al_strminfoitf_QueryStreamInformation( CStifItemParser& aItem );
+        virtual TInt al_strminfoitf_QueryStreamName( CStifItemParser& aItem );
+        virtual TInt al_strminfoitf_RegisterStreamChangeCallback( CStifItemParser& aItem );
+        virtual TInt al_strminfoitf_QueryActiveStreams( CStifItemParser& aItem );
+        virtual TInt al_strminfoitf_SetActiveStream( CStifItemParser& aItem );        
+        
+        virtual TInt al_volumeitf_SetVolumeLevel( CStifItemParser& aItem );
+        virtual TInt al_volumeitf_GetVolumeLevel( CStifItemParser& aItem );
+        virtual TInt al_volumeitf_GetMaxVolumeLevel( CStifItemParser& aItem );
+        virtual TInt al_volumeitf_SetMute( CStifItemParser& aItem );
+        virtual TInt al_volumeitf_GetMute( CStifItemParser& aItem );
+        virtual TInt al_volumeitf_EnableStereoPosition( CStifItemParser& aItem );
+        virtual TInt al_volumeitf_IsEnabledStereoPosition( CStifItemParser& aItem );
+        virtual TInt al_volumeitf_SetStereoPosition( CStifItemParser& aItem );
+        virtual TInt al_volumeitf_GetStereoPosition( CStifItemParser& aItem );
+
+        virtual TInt al_nokiavolumeextitf_SetVolumeLevel( CStifItemParser& aItem ); 
+        virtual TInt al_nokiavolumeextitf_GetVolumeLevel( CStifItemParser& aItem ); 
+        virtual TInt al_nokiavolumeextitf_GetMaxVolumeLevel( CStifItemParser& aItem ); 
+        virtual TInt al_nokiavolumeextitf_SetMute( CStifItemParser& aItem ); 
+        virtual TInt al_nokiavolumeextitf_GetMute( CStifItemParser& aItem ); 
+        virtual TInt al_nokiavolumeextitf_EnableStereoPosition( CStifItemParser& aItem ); 
+        virtual TInt al_nokiavolumeextitf_IsEnabledStereoPosition( CStifItemParser& aItem ); 
+        virtual TInt al_nokiavolumeextitf_SetStereoPosition( CStifItemParser& aItem ); 
+        virtual TInt al_nokiavolumeextitf_GetStereoPosition( CStifItemParser& aItem ); 
+        virtual TInt al_nokiavolumeextitf_RegisterVolumeCallback( CStifItemParser& aItem ); 
+        virtual TInt al_nokiavolumeextitf_SetCallbackEventsMask( CStifItemParser& aItem ); 
+        virtual TInt al_nokiavolumeextitf_GetCallbackEventsMask( CStifItemParser& aItem ); 
+
+        virtual TInt al_nokialinearvolumeitf_SetVolumeLevel( CStifItemParser& aItem );
+        virtual TInt al_nokialinearvolumeitf_GetVolumeLevel( CStifItemParser& aItem );
+        virtual TInt al_nokialinearvolumeitf_GetStepCount( CStifItemParser& aItem );
+        virtual TInt al_nokialinearvolumeitf_RegisterVolumeCallback( CStifItemParser& aItem );
+        virtual TInt al_nokialinearvolumeitf_SetCallbackEventsMask( CStifItemParser& aItem );
+        virtual TInt al_nokialinearvolumeitf_GetCallbackEventsMask( CStifItemParser& aItem );
+
+        virtual TInt al_metadataextractionitf_GetItemCount( CStifItemParser& aItem );
+		virtual TInt al_metadataextractionitf_GetKeySize( CStifItemParser& aItem );
+		virtual TInt al_metadataextractionitf_GetKey( CStifItemParser& aItem );
+		virtual TInt al_metadataextractionitf_GetValueSize( CStifItemParser& aItem );
+		virtual TInt al_metadataextractionitf_GetValue( CStifItemParser& aItem );
+		virtual TInt al_metadataextractionitf_AddKeyFilter( CStifItemParser& aItem );
+		virtual TInt al_metadataextractionitf_ClearKeyFilter( CStifItemParser& aItem );
+		virtual TInt al_metadataextractionitf_GetCoverArt( CStifItemParser& aItem );
+
         /**
          * Method used to log version of test class
          */
@@ -242,8 +416,11 @@
             {
             EEngine = 1,
             EMediaRecorder,
+/*
             ERecordItf,
             EEngineItf
+*/
+            EMediaPlayer = 4
             };
 
     protected:  // Data
@@ -256,6 +433,22 @@
         //?data_declaration;
 
     private:    // Data
+        
+        // reference to TestModuleIf
+        CTestModuleIf& iTestModuleIf;
+        // Active object with a timer to timeout the test case
+        CSimpleTimeout * iTimeoutController;
+
+        // Indicates if the test case use a normal exit reason
+        TBool iNormalExitReason;
+
+        // List of expected events
+        RArray<TOMXExpectedEvent> iExpectedEvents;
+
+        // List of notification event (by the callback)
+        RArray<TOMXExpectedEvent> iOcurredEvents;
+        
+        
         XAboolean     required[MAX_NUMBER_INTERFACES]; 
         XAInterfaceID iidArray[MAX_NUMBER_INTERFACES]; 
         XAEngineOption EngineOption[MAX_NUMBER_OPTIONS];
@@ -271,31 +464,44 @@
         XAObjectItf m_MOLEDObject;
         XAObjectItf m_MORadioObject;
         XAObjectItf m_MOCameraObject;
+
+        XAPlayItf m_PlayItf;
+        XASeekItf m_SeekItf;
+        XADynamicSourceItf m_DynSrcItf;
         
+        XAVolumeItf m_VolumeItf;
+        XANokiaLinearVolumeItf  m_NokiaLinearVolumeItf;
+        XANokiaVolumeExtItf m_NokiaVolumeExtItf;
         
         XADynamicInterfaceManagementItf m_DIMItf;
-        
+        XAStreamInformationItf m_StrInfoItf;
         
         XAEngineItf m_EngineItf;
         XAAudioIODeviceCapabilitiesItf m_AIODevCapItf;
         XAAudioEncoderCapabilitiesItf m_AEncCapItf;
         XAAudioEncoderItf m_AudEncItf;
         XAMetadataInsertionItf m_MetadataInsertionItf;
+        XAMetadataExtractionItf m_MetadataExtractionItf;
         
         /*Audio Source*/
         XADataSource m_AudioSource;
-        XADataLocator_IODevice  m_IODevice;
+        XADataLocator_IODevice  m_SrcIODevice;
+        XADataLocator_IODevice  m_SinkIODevice;
 
         /*Image/Video Source*/
         XADataSource m_VideoSource;
        
         /*MetadataExtractor Source*/
         XADataSource m_MOMetadataExtractorSource;
+
+        /*Dynamic Source*/
+        XADataSource m_DynamicSource;
         
         /*Data Sink*/
         XADataSink m_DataSink;
         XADataSink m_AudioSink;
         XADataSink m_VideoSink;
+        XADataLocator_NativeDisplay m_NativeDisplay;
         XADataSink m_LEDSink;
         XADataSink m_VibraSink;
         
@@ -305,7 +511,12 @@
         
         XADataFormat_MIME m_Mime;
         HBufC8* m_MimeType;
-        
+
+        RWsSession iRwSession;
+        RWindowGroup iRwGroup;
+        RWindow iRWindow;
+        CWsScreenDevice* iDevice;
+
         // ?one_line_short_description_of_data
         //?data_declaration;
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/inc/profileutilmacro.h	Fri May 14 16:22:35 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 PROFILEUTILMACRO_H
+#define PROFILEUTILMACRO_H
+
+/*
+// MACROS to be defined to use profiling
+PROFILE_TIME
+PROFILE_RAM_USAGE
+PROFILE_HEAP_USAGE
+PRINT_TO_CONSOLE_TIME_DIFF
+PRINT_TO_CONSOLE_RAM_DIFF
+PRINT_TO_CONSOLE_HEAP_DIFF
+*/
+
+#if defined(PROFILE_TIME) || defined(PROFILE_RAM_USAGE) || defined(PROFILE_HEAP_USAGE)
+#include <e32debug.h>
+#include <hal.h>
+#endif
+
+#ifdef PROFILE_TIME
+#define TAG_TIME_PROFILING_BEGIN \
+    TTime beginProfilingTime; \
+    beginProfilingTime.HomeTime()
+
+#define TAG_TIME_PROFILING_END \
+    TTime endProfilingTime; \
+    endProfilingTime.HomeTime(); \
+    TTimeIntervalMicroSeconds diffInMicroSecs = endProfilingTime.MicroSecondsFrom(beginProfilingTime)
+
+#define PRINT_TO_CONSOLE_TIME_DIFF \
+    RDebug::Printf("VPROFILEDAT: %s : Time taken[%u]microseconds ", __PRETTY_FUNCTION__, diffInMicroSecs.Int64())
+#else /* Empty macros */
+#define TAG_TIME_PROFILING_BEGIN
+#define TAG_TIME_PROFILING_END
+#define PRINT_TO_CONSOLE_TIME_DIFF
+#endif /*PROFILE_TIME*/
+
+#ifdef PROFILE_RAM_USAGE
+#define TAG_RAM_PROFILING_BEGIN \
+    TInt beginProfilingRAM; \
+    TInt err1 = HAL::Get(HALData::EMemoryRAMFree, beginProfilingRAM)
+
+#define TAG_RAM_PROFILING_END \
+    TInt endProfilingRAM; \
+    TInt err2 = HAL::Get(HALData::EMemoryRAMFree, endProfilingRAM)
+
+#define PRINT_TO_CONSOLE_RAM_DIFF \
+    if ((err1 == KErrNone) && (err2 == KErrNone)) \
+        { \
+        TInt diffRAM = (beginProfilingRAM - endProfilingRAM); \
+        if ( diffRAM > 0 ) \
+            { \
+            RDebug::Printf("VPROFILEDAT: %s : RAM used[%u]bytes ", __PRETTY_FUNCTION__, diffRAM); \
+            } \
+        else \
+            { \
+            RDebug::Printf("VPROFILEDAT: %s : RAM freed[%u]bytes ", __PRETTY_FUNCTION__, (-diffRAM)); \
+            } \
+        } \
+    else \
+        { \
+        RDebug::Printf("VPROFILEDAT: %s : Error1[%d] Error2[%d] ", __PRETTY_FUNCTION__, err1, err2); \
+        }
+
+#else /* Empty macros */
+#define TAG_RAM_PROFILING_BEGIN
+#define TAG_RAM_PROFILING_END
+#define PRINT_TO_CONSOLE_RAM_DIFF
+#endif /*PROFILE_RAM_USAGE*/
+
+#ifdef PROFILE_HEAP_USAGE
+#define TAG_DEFAULT_HEAP_PROFILING_BEGIN \
+    TInt beginProfilingHEAPBiggestBlock; \
+    TInt beginProfilingHEAP = User::Available(beginProfilingHEAPBiggestBlock) \
+
+#define TAG_DEFAULT_HEAP_PROFILING_END \
+    TInt endProfilingHEAPBiggestBlock; \
+    TInt endProfilingHEAP = User::Available(endProfilingHEAPBiggestBlock) \
+
+#define PRINT_TO_CONSOLE_HEAP_DIFF \
+    TInt diffHEAP = beginProfilingHEAP - endProfilingHEAP; \
+    if ( diffHEAP > 0 ) \
+        { \
+        RDebug::Printf("VPROFILEDAT: %s : HEAP used[%u]bytes ", __PRETTY_FUNCTION__, diffHEAP); \
+        } \
+    else \
+        { \
+        RDebug::Printf("VPROFILEDAT: %s : HEAP freed[%u]bytes ", __PRETTY_FUNCTION__, (-diffHEAP)); \
+        }
+#else /* Empty macros */
+#define TAG_DEFAULT_HEAP_PROFILING_BEGIN
+#define TAG_DEFAULT_HEAP_PROFILING_END
+#define PRINT_TO_CONSOLE_HEAP_DIFF
+#endif /*PROFILE_HEAP_USAGE*/
+
+#endif /* PROFILEUTILMACRO_H */
--- a/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/init/testframework.ini	Mon May 03 12:59:52 2010 +0300
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/init/testframework.ini	Fri May 14 16:22:35 2010 +0300
@@ -66,7 +66,7 @@
 
 TestReportFormat= TXT			# Possible values: TXT or HTML
 TestReportOutput= FILE			# Possible values: FILE or RDEBUG
-TestReportFileCreationMode= OVERWRITE	# Possible values: OVERWRITE or APPEND
+TestReportFileCreationMode= APPEND	# Possible values: OVERWRITE or APPEND
 
 DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
 
@@ -108,14 +108,29 @@
 [New_Module]
 ModuleName= TestScripter
 IniFile = c:\testframework\openmaxaltestmodule_common.cfg
+TestCaseFile= c:\testframework\openmaxaltestmodule_common_noklinvolitf.cfg
+TestCaseFile= c:\testframework\openmaxaltestmodule_common_nokvolextitf.cfg
+TestCaseFile= c:\testframework\openmaxaltestmodule_common_volumeitf.cfg
 TestCaseFile= c:\testframework\openmaxaltestmodule_objectitf.cfg
-TestCaseFile= c:\testframework\openmaxaltestmodule_ro_mdinsertionitf.cfg
-TestCaseFile= c:\testframework\openmaxaltestmodule_ro_recorditf.cfg
-TestCaseFile= c:\testframework\openmaxaltestmodule_ro_audioencoderitf.cfg
+TestCaseFile= c:\testframework\openmaxaltestmodule_mr.cfg
+TestCaseFile= c:\testframework\openmaxaltestmodule_mr_mdinsertionitf.cfg
+TestCaseFile= c:\testframework\openmaxaltestmodule_mr_recorditf.cfg
+TestCaseFile= c:\testframework\openmaxaltestmodule_mr_audioencoderitf.cfg
 TestCaseFile= c:\testframework\openmaxaltestmodule_engine_audenccapitf.cfg
 TestCaseFile= c:\testframework\openmaxaltestmodule_global.cfg
 TestCaseFile= c:\testframework\openmaxaltestmodule_engine_engineitf.cfg
 TestCaseFile= c:\testframework\openmaxaltestmodule_engine_aiodcitf.cfg
+TestCaseFile= c:\testframework\openmaxaltestmodule_mp.cfg
+TestCaseFile= c:\testframework\openmaxaltestmodule_mp_objectitf.cfg
+TestCaseFile= c:\testframework\openmaxaltestmodule_mp_playitf.cfg
+TestCaseFile= c:\testframework\openmaxaltestmodule_common_dynsrcitf.cfg
+TestCaseFile= c:\testframework\openmaxaltestmodule_mp_seekitf.cfg
+TestCaseFile= c:\testframework\openmaxaltestmodule_mp_strminfoitf.cfg
+#TestCaseFile= c:\testframework\openmaxaltestmodule_mp_preemption.cfg
+TestCaseFile= c:\testframework\openmaxaltestmodule_mo_mdextractionitf.cfg
+TestCaseFile= c:\testframework\openmaxaltestmodule_mp_mdextractionitf.cfg
+TestCaseFile= c:\testframework\openmaxaltestmodule_mo.cfg
+#TestCaseFile= c:\testframework\openmaxaltestmodule_mp_variousformats.cfg
 [End_Module]
 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/TimeoutController.cpp	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,328 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "openmaxaltestmodule.h"
+
+/*
+-------------------------------------------------------------------------------
+
+Class: CSimpleTimeout
+
+Method: CSimpleTimeout
+
+Description: Default constructor
+
+C++ default constructor can NOT contain any code, that
+might leave.
+
+Parameters: None
+
+Return Values: None
+
+Errors/Exceptions: None
+
+Status: Approved
+
+-------------------------------------------------------------------------------
+*/
+CSimpleTimeout::CSimpleTimeout() : CActive (CActive::EPriorityStandard)
+{
+   iLog->Log(_L("CSimpleTimeout::CSimpleTimeout"));
+}
+
+/*
+-------------------------------------------------------------------------------
+
+Class: CSimpleTimeout
+
+Method: ConstructL
+
+Description: Symbian OS second phase constructor
+
+Symbian OS default constructor can leave.
+
+Parameters:
+
+Return Values: None
+
+Errors/Exceptions:
+
+Status: Approved
+
+-------------------------------------------------------------------------------
+*/
+void CSimpleTimeout::ConstructL( MTimeoutObserver* aObserver,
+CStifLogger* aLogger)
+{
+   iLog->Log(_L("CSimpleTimeout::ConstructL"));
+    iObserver = aObserver;
+    iLog = aLogger;
+    iTimer.CreateLocal();
+    iTestCaseTimeout = 0;  // Initialize
+
+    // Add to active scheduler
+    CActiveScheduler::Add ( this );
+}
+
+/*
+-------------------------------------------------------------------------------
+
+Class: CSimpleTimeout
+
+Method: NewL
+
+Description: Two-phased constructor.
+
+Parameters: const TTestReportOutput aReportOutput: in: Report output type
+
+Return Values: CSimpleTimeout* : pointer to created object
+
+Errors/Exceptions: Leaves if memory allocation for object fails
+Leaves if ConstructL leaves
+
+Status: Approved
+
+-------------------------------------------------------------------------------
+*/
+CSimpleTimeout* CSimpleTimeout::NewL( MTimeoutObserver* aTestClass,
+CStifLogger* aLogger)
+{
+    CSimpleTimeout* self = new ( ELeave ) CSimpleTimeout();
+    CleanupStack::PushL( self );
+    self->ConstructL( aTestClass, aLogger);
+    CleanupStack::Pop( self );
+    return self;
+
+}
+
+/*
+-------------------------------------------------------------------------------
+
+Class: CSimpleTimeout
+
+Method: ~CSimpleTimeout
+
+Description: Destructor.
+
+Cancel request
+
+Parameters: None
+
+Return Values: None
+
+Errors/Exceptions: None
+
+Status: Approved
+
+-------------------------------------------------------------------------------
+*/
+CSimpleTimeout::~CSimpleTimeout()
+{
+   iLog->Log(_L("CSimpleTimeout::~CSimpleTimeout"));
+    Cancel();
+    iTimer.Close();
+}
+
+/*
+-------------------------------------------------------------------------------
+
+Class: CSimpleTimeout
+
+Method: Start
+
+Description: Start timeout counting
+
+Parameters: None
+
+Return Values: None
+
+Errors/Exceptions: None
+
+Status: Approved
+
+-------------------------------------------------------------------------------
+*/
+void CSimpleTimeout::Start(TTimeIntervalMicroSeconds aTimeout)
+{
+   iLog->Log(_L("CSimpleTimeout::Start"));
+    if (IsActive())
+    {
+        Cancel();
+    }
+
+    // Request timer
+    TTime endTime;
+    endTime.HomeTime();
+    endTime = endTime + aTimeout;
+
+    TInt64 miliseconds = aTimeout.Int64();
+    miliseconds /= 1000;
+
+    TBuf<30> dateString;
+    endTime.FormatL(dateString, KFormatTimeStamp);
+    iLog->Log(_L("Timer=%LD ms, EndTime=%S"), miliseconds, &dateString);
+
+    // Store absolute timeout
+    iTestCaseTimeout = endTime;
+
+    // Taken from STIF engine
+    // Note: iTimer.After() method cannot use because there needed
+    // TTimeIntervalMicroSeconds32 and it is 32 bit. So then cannot create
+    // timeout time that is long enough. At() uses 64 bit value=>Long enough.
+    iTimer.At( iStatus, endTime );
+    SetActive();
+}
+
+
+/*
+-------------------------------------------------------------------------------
+
+Class: CSimpleTimeout
+
+Method: Start
+
+Description: Start timeout counting
+
+Parameters: None
+
+Return Values: None
+
+Errors/Exceptions: None
+
+Status: Approved
+
+-------------------------------------------------------------------------------
+*/
+void CSimpleTimeout::Stop()
+{
+   iLog->Log(_L("CSimpleTimeout::Stop"));
+    if (IsActive())
+    {
+        Cancel();
+    }
+}
+/*
+-------------------------------------------------------------------------------
+
+Class: CSimpleTimeout
+
+Method: RunL
+
+Description: RunL handles completed timeouts.
+
+Parameters: None
+
+Return Values: None
+
+Errors/Exceptions: None
+
+Status: Approved
+
+-------------------------------------------------------------------------------
+*/
+void CSimpleTimeout::RunL()
+{
+   iLog->Log(_L("CSimpleTimeout::RunL"));
+	iLog->Log(_L("CSimpleTimeout::RunL"));
+    TTime timeout;
+    timeout.HomeTime();
+    // Handle the abort case when system time gets changed, but timeout is
+    // still valid. All other cases should timeout since they invalidate the
+    // logic of the timers.
+    if ( iStatus == KErrAbort)
+    {
+        if ( iTestCaseTimeout > timeout )
+        {
+            RDebug::Print( _L( "Absolute timer still valid. Restaring timer. iStatus: %d" ), iStatus.Int() );
+            // Start new timer
+            iStatus = KErrNone; // reset value
+            iTimer.At ( iStatus, iTestCaseTimeout );  // restart timer
+            SetActive();
+        }
+        else
+        {
+            // Absolute timer no longer valid. Must timeout.
+            iLog->Log(_L("Absolute timeout no longer valid"));
+            iObserver->HandleTimeout(KErrNone);
+        }
+
+    }
+    else
+    {
+        // Status was not KErrAbort. Timing out!
+        // iLog->Log(_L("CSimpleTimeout::RunL - Timeout !!"), iTimeout);
+        iLog->Log(_L("Timing out"));
+        iObserver->HandleTimeout(KErrNone);
+    }
+
+}
+
+/*
+-------------------------------------------------------------------------------
+
+Class: CSimpleTimeout
+
+Method: DoCancel
+
+Description: Cancel active request
+
+Parameters: None
+
+Return Values: None
+
+Errors/Exceptions: None
+
+Status: Approved
+
+-------------------------------------------------------------------------------
+*/
+void CSimpleTimeout::DoCancel()
+{
+   iLog->Log(_L("CSimpleTimeout::DoCancel"));
+    iTimer.Cancel();
+}
+
+/*
+-------------------------------------------------------------------------------
+
+Class: CSimpleTimeout
+
+Method: RunError
+
+Description: Handle errors. Just let framework handle errors because
+RunL does not leave.
+
+Parameters: TInt aError: in: Symbian OS error: Error code
+
+Return Values: TInt: Symbian OS error code
+
+Errors/Exceptions: None
+
+Status: Approved
+
+-------------------------------------------------------------------------------
+*/
+TInt CSimpleTimeout::RunError( TInt aError )
+{
+   iLog->Log(_L("CSimpleTimeout::RunError"));
+    iLog->Log(_L("Timeout error %d"), aError);
+    iObserver->HandleTimeout(aError);
+    return aError;
+}
+
--- a/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxalcommontests.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxalcommontests.cpp	Fri May 14 16:22:35 2010 +0300
@@ -20,6 +20,7 @@
 #include <StifParser.h>
 #include <StifTestInterface.h>
 #include "openmaxaltestmodule.h"
+#include <coedef.h>
 
 // EXTERNAL DATA STRUCTURES
 //extern  ?external_data;
@@ -92,11 +93,19 @@
             case XA_DATALOCATOR_ADDRESS:
             case XA_DATALOCATOR_IODEVICE:
                 {
-                commonSink.pLocator = &m_IODevice;
+                m_SinkIODevice.locatorType = XA_DATALOCATOR_IODEVICE;
+                commonSink.pLocator = &m_SinkIODevice;
                 }
+                break;
+            case XA_DATALOCATOR_NATIVEDISPLAY:
+                {
+                m_NativeDisplay.locatorType = XA_DATALOCATOR_NATIVEDISPLAY;
+                m_NativeDisplay.hWindow = (void*)&iRWindow;
+                m_NativeDisplay.hDisplay = (void*)&iRwSession;
+                commonSink.pLocator = &m_NativeDisplay;
+                }
+                break;
             case XA_DATALOCATOR_OUTPUTMIX:
-            case XA_DATALOCATOR_NATIVEDISPLAY:
-                break;
             default:
                 status = KErrGeneral;
                 break;
@@ -106,22 +115,33 @@
     if(!status)
         {
         status = aItem.GetNextInt(formattype);
-        
-        switch(formattype)
-            {
-            case XA_DATAFORMAT_MIME:
+        if (type == XA_DATALOCATOR_IODEVICE)
+            { /* Sink IO device can only be audio output*/
+            if (formattype == 6)
                 {
-                commonSink.pFormat = &m_Mime;
+                m_SinkIODevice.deviceType = formattype;
+                }
+            else
+                {
+                status = KErrGeneral;
                 }
-                break;
-            case XA_DATAFORMAT_PCM:
-            case XA_DATAFORMAT_RAWIMAGE:
-                break;
-            default:
-                status = KErrGeneral;
-                break;
             }
-
+        else
+            {
+            switch(formattype)
+                {
+                case XA_DATAFORMAT_MIME:
+                    {
+                    commonSink.pFormat = &m_Mime;
+                    }
+                    break;
+                case XA_DATAFORMAT_PCM:
+                case XA_DATAFORMAT_RAWIMAGE:
+                    break;
+                default:
+                    break;
+                }
+            }
         }
 
     if(!status)
@@ -176,7 +196,7 @@
             case XA_DATALOCATOR_ADDRESS:
             case XA_DATALOCATOR_IODEVICE:
                 {
-                commonSource.pLocator = &m_IODevice;
+                commonSource.pLocator = &m_SrcIODevice;
                 }
             case XA_DATALOCATOR_OUTPUTMIX:
             case XA_DATALOCATOR_NATIVEDISPLAY:
@@ -203,7 +223,6 @@
                 case XA_DATAFORMAT_RAWIMAGE:
                     break;
                 default:
-                    status = KErrGeneral;
                     break;
                 }
             }
@@ -226,6 +245,10 @@
                 case 3:
                     m_MOMetadataExtractorSource = commonSource;
                     break;
+                case 4:
+                    m_DynamicSource = commonSource;
+                    break;
+                    
                 default:
                     status = KErrGeneral;
                     break;
@@ -280,9 +303,27 @@
                 status = aItem.GetNextInt(deviceId);
                 if(!status)
                     {
-                    m_IODevice.deviceID = deviceId;
-                    m_IODevice.deviceType = devicetype;
-                    m_IODevice.locatorType = XA_DATALOCATOR_IODEVICE;
+                    TInt srcsinktype(0);
+                    status = aItem.GetNextInt(srcsinktype);
+                    if(!status)
+                        {
+                        if(srcsinktype == 1)
+                            {
+                            m_SrcIODevice.deviceID = deviceId;
+                            m_SrcIODevice.deviceType = devicetype;
+                            m_SrcIODevice.locatorType = XA_DATALOCATOR_IODEVICE;                    
+                            }
+                        else
+                            {
+                            m_SinkIODevice.deviceID = deviceId;
+                            m_SinkIODevice.deviceType = devicetype;
+                            m_SinkIODevice.locatorType = XA_DATALOCATOR_IODEVICE;                    
+                            }
+                        }
+                    else
+                        {
+                        status = KErrGeneral;
+                        }
                     }
                 else
                     {
@@ -357,3 +398,76 @@
     return status;   
     }
 
+TInt COpenMAXALTestModule::al_CreateWindow( CStifItemParser& aItem )
+    {
+    TInt status(KErrNone);
+    if (iRwSession.Handle())
+        User::Leave(KErrAlreadyExists);
+
+    TInt topX;
+    TInt topY ;
+    TInt bottomX;
+    TInt bottomY;
+    TInt posX;
+    TInt posY;
+    
+    status = aItem.GetNextInt(posX);
+    RET_ERR_IF_ERR(status);
+    status = aItem.GetNextInt(posY);
+    RET_ERR_IF_ERR(status);
+
+    status = aItem.GetNextInt(topX);
+    RET_ERR_IF_ERR(status);
+    status = aItem.GetNextInt(topY);
+    RET_ERR_IF_ERR(status);
+    status = aItem.GetNextInt(bottomX);
+    RET_ERR_IF_ERR(status);
+    status = aItem.GetNextInt(bottomY);
+    RET_ERR_IF_ERR(status);
+
+    /* Create resources needed for video play back*/
+    status = iRwSession.Connect();
+    RET_ERR_IF_ERR(status);
+
+    TInt groupId = iRwSession.GetFocusWindowGroup();
+    iRwGroup = RWindowGroup(iRwSession);
+    status = iRwGroup.Construct(groupId, ETrue);
+    RET_ERR_IF_ERR(status);
+    _LIT(KXASTIFWindowGroupName,"XASTIF");
+    iRwGroup.SetName(KXASTIFWindowGroupName);
+    iRwGroup.SetOrdinalPosition(0, ECoeWinPriorityAlwaysAtFront);
+
+    iRWindow = RWindow(iRwSession);
+    status = iRWindow.Construct(iRwGroup, (TUint32) this + 1);
+    RET_ERR_IF_ERR(status);
+
+    TPoint point(posX, posY);
+    iRWindow.SetPosition(point);
+    TRect rect(topX, topY, bottomX, bottomY);
+    TSize size(rect.Size());
+    iRWindow.SetSize(size);
+    iRWindow.Activate();
+    iRWindow.SetVisible(ETrue);
+    iRwSession.Flush();
+    iDevice = NULL;
+    iDevice = new CWsScreenDevice(iRwSession);
+    if (!iDevice)
+        {
+        status = KErrNoMemory;
+        }
+    RET_ERR_IF_ERR(status);
+
+    status = iDevice->Construct(0);
+    return status;
+    }
+
+TInt COpenMAXALTestModule::al_DeleteWindow( CStifItemParser& /*aItem*/ )
+    {
+    delete iDevice;
+    iDevice = NULL;
+    iRWindow.SetVisible(EFalse);
+    iRWindow.Close();
+    iRwGroup.Close();
+    iRwSession.Close();
+    return KErrNone;
+    }
--- a/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxaldynitfmgmtitftests.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxaldynitfmgmtitftests.cpp	Fri May 14 16:22:35 2010 +0300
@@ -117,7 +117,6 @@
     {
     TInt status(KErrNone);
     XAresult res;
-    TInt async(0);
     TInt interface(0);
     XAInterfaceID id(NULL);
 
@@ -132,22 +131,14 @@
         status = KErrGeneral;
         }
 
-    status = aItem.GetNextInt(async);
-    if(!status)
+    if(m_DIMItf)
         {
-        if(m_DIMItf)
-            {
-            res = (*m_DIMItf)->RemoveInterface(m_DIMItf,id);
-            status = res;
-            }
-        else
-            {
-            status = KErrNotFound;
-            }
+        res = (*m_DIMItf)->RemoveInterface(m_DIMItf,id);
+        status = res;
         }
     else
         {
-        status = KErrGeneral;
+        status = KErrNotFound;
         }
     return status;            
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxaldynsrcitftests.cpp	Fri May 14 16:22:35 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: This file contains testclass implementation.
+*
+*/
+
+// [INCLUDE FILES] - do not remove
+#include <e32svr.h>
+#include <StifParser.h>
+#include <StifTestInterface.h>
+#include "openmaxaltestmodule.h"
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+TInt COpenMAXALTestModule::al_dynsrcitf_SetSource( CStifItemParser& aItem )
+    {
+    TInt status(KErrNone);
+    XAresult res;
+    XADataSource* dynamicSrc(NULL);
+
+    if(m_DynamicSource.pFormat && m_DynamicSource.pLocator)
+        {
+        dynamicSrc = &m_DynamicSource;
+        }
+    
+    if(m_DynSrcItf)
+        {
+        res = (*m_DynSrcItf)->SetSource(m_DynSrcItf,dynamicSrc);
+        status = res;
+        }
+    else
+        {
+        status = KErrNotFound;
+        }
+    return status;    
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxalnokialinearvolumeitftests.cpp	Fri May 14 16:22:35 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: This file contains testclass implementation.
+*
+*/
+
+// [INCLUDE FILES] - do not remove
+#include <e32svr.h>
+#include <StifParser.h>
+#include <StifTestInterface.h>
+#include "openmaxaltestmodule.h"
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+void NokiaLinearVolumeCallback(
+    XANokiaLinearVolumeItf caller,
+    void * pContext,
+    XAuint32 event,
+    XAboolean eventBooleanData
+);
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+TInt COpenMAXALTestModule::al_nokialinearvolumeitf_SetVolumeLevel( CStifItemParser& aItem )
+    {
+    TInt status(KErrNone);
+    TInt volume(0);
+    XAuint32 alvol;
+    status = aItem.GetNextInt(volume);
+    RET_ERR_IF_ERR(status);
+    
+    if(m_NokiaLinearVolumeItf)
+        {
+        alvol = volume;
+        status = (*m_NokiaLinearVolumeItf)->SetVolumeLevel(m_NokiaLinearVolumeItf, &alvol);
+        }
+    else
+        {
+        status = KErrNotFound;
+        }
+    
+    return status;
+    }
+    
+TInt COpenMAXALTestModule::al_nokialinearvolumeitf_GetVolumeLevel( CStifItemParser& /*aItem*/ )
+    {
+    TInt status(KErrNone);
+    XAuint32 volume(0);
+    if(m_NokiaLinearVolumeItf)
+        {
+        status = (*m_NokiaLinearVolumeItf)->GetVolumeLevel(m_NokiaLinearVolumeItf, &volume);
+        }
+    else
+        {
+        status = KErrNotFound;
+        }
+    return status;
+    }
+    
+TInt COpenMAXALTestModule::al_nokialinearvolumeitf_GetStepCount( CStifItemParser& /*aItem*/ )
+    {
+    TInt status(KErrNone);
+    XAuint32 value(0);
+    if(m_NokiaLinearVolumeItf)
+        {
+        status = (*m_NokiaLinearVolumeItf)->GetStepCount(m_NokiaLinearVolumeItf, &value);
+        }
+    else
+        {
+        status = KErrNotFound;
+        }
+    return status;
+    }
+    
+TInt COpenMAXALTestModule::al_nokialinearvolumeitf_RegisterVolumeCallback( CStifItemParser& /*aItem*/ )
+    {
+    TInt status(KErrNone);
+    if(m_NokiaLinearVolumeItf)
+        {
+        status = (*m_NokiaLinearVolumeItf)->RegisterVolumeCallback(m_NokiaLinearVolumeItf, NokiaLinearVolumeCallback, this);
+        }
+    else
+        {
+        status = KErrNotFound;
+        }
+    return status;
+    }
+    
+TInt COpenMAXALTestModule::al_nokialinearvolumeitf_SetCallbackEventsMask( CStifItemParser& aItem )
+    {
+    TInt status(KErrNone);
+    TInt value(0);
+    
+    status = aItem.GetNextInt(value);
+    RET_ERR_IF_ERR(status);
+    
+    if(m_NokiaLinearVolumeItf)
+        {
+        status = (*m_NokiaLinearVolumeItf)->SetCallbackEventsMask(m_NokiaLinearVolumeItf, value);
+        }
+    else
+        {
+        status = KErrNotFound;
+        }
+    
+    return status;
+    }
+    
+TInt COpenMAXALTestModule::al_nokialinearvolumeitf_GetCallbackEventsMask( CStifItemParser& /*aItem*/ )
+    {
+    TInt status(KErrNone);
+    XAuint32 value(0);
+    
+    if(m_NokiaLinearVolumeItf)
+        {
+        status = (*m_NokiaLinearVolumeItf)->GetCallbackEventsMask(m_NokiaLinearVolumeItf, &value);
+        }
+    else
+        {
+        status = KErrNotFound;
+        }
+    
+    return status;
+    }
+    
+void NokiaLinearVolumeCallback(
+    XANokiaLinearVolumeItf caller,
+    void * pContext,
+    XAuint32 event,
+    XAboolean eventBooleanData
+)
+    {
+    
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxalnokiavolumeextitftests.cpp	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,303 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains testclass implementation.
+*
+*/
+
+// [INCLUDE FILES] - do not remove
+#include <e32svr.h>
+#include <StifParser.h>
+#include <StifTestInterface.h>
+#include "openmaxaltestmodule.h"
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+void NokiaVolumeExtCallback(
+    XANokiaVolumeExtItf caller,
+    void * pContext,
+    XAuint32 event,
+    XAboolean eventBooleanData
+);
+
+
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+TInt COpenMAXALTestModule::al_nokiavolumeextitf_SetVolumeLevel( CStifItemParser& aItem )
+    {
+    TInt status(KErrNone);
+    TInt volume(0);
+    
+    status = aItem.GetNextInt(volume);
+    RET_ERR_IF_ERR(status);
+    
+    if(m_NokiaVolumeExtItf)
+        {
+        status = (*m_NokiaVolumeExtItf)->SetVolumeLevel(m_NokiaVolumeExtItf, volume);
+        }
+    else
+        {
+        status = KErrNotFound;
+        }
+    
+    return status;
+    }
+    
+TInt COpenMAXALTestModule::al_nokiavolumeextitf_GetVolumeLevel( CStifItemParser& /*aItem*/ )
+    {
+    TInt status(KErrNone);
+    XAmillibel volume(0);
+    if(m_NokiaVolumeExtItf)
+        {
+        status = (*m_NokiaVolumeExtItf)->GetVolumeLevel(m_NokiaVolumeExtItf, &volume);
+        }
+    else
+        {
+        status = KErrNotFound;
+        }
+    return status;
+    }
+    
+TInt COpenMAXALTestModule::al_nokiavolumeextitf_GetMaxVolumeLevel( CStifItemParser& /*aItem*/ )
+    {
+    TInt status(KErrNone);
+    XAmillibel volume(0);
+    if(m_NokiaVolumeExtItf)
+        {
+        status = (*m_NokiaVolumeExtItf)->GetMaxVolumeLevel(m_NokiaVolumeExtItf, &volume);
+        }
+    else
+        {
+        status = KErrNotFound;
+        }
+    return status;
+    }
+    
+TInt COpenMAXALTestModule::al_nokiavolumeextitf_SetMute( CStifItemParser& aItem )
+    {
+    TInt status(KErrNone);
+    TInt mute(0);
+    
+    status = aItem.GetNextInt(mute);
+    RET_ERR_IF_ERR(status);
+    
+    if(m_NokiaVolumeExtItf)
+        {
+        status = (*m_NokiaVolumeExtItf)->SetMute(m_NokiaVolumeExtItf, mute);
+        }
+    else
+        {
+        status = KErrNotFound;
+        }
+    
+    return status;
+    }
+    
+TInt COpenMAXALTestModule::al_nokiavolumeextitf_GetMute( CStifItemParser& /*aItem*/ )
+    {
+    TInt status(KErrNone);
+    XAboolean mute(0);
+    
+    if(m_NokiaVolumeExtItf)
+        {
+        status = (*m_NokiaVolumeExtItf)->GetMute(m_NokiaVolumeExtItf, &mute);
+        }
+    else
+        {
+        status = KErrNotFound;
+        }
+    
+    return status;
+    }
+    
+TInt COpenMAXALTestModule::al_nokiavolumeextitf_EnableStereoPosition( CStifItemParser& aItem )
+    {
+    TInt status(KErrNone);
+    TInt value(0);
+    
+    status = aItem.GetNextInt(value);
+    RET_ERR_IF_ERR(status);
+    
+    if(m_NokiaVolumeExtItf)
+        {
+        status = (*m_NokiaVolumeExtItf)->EnableStereoPosition(m_NokiaVolumeExtItf, value);
+        }
+    else
+        {
+        status = KErrNotFound;
+        }
+    
+    return status;
+    }
+    
+TInt COpenMAXALTestModule::al_nokiavolumeextitf_IsEnabledStereoPosition( CStifItemParser& /*aItem*/ )
+    {
+    TInt status(KErrNone);
+    XAboolean value(0);
+    
+    if(m_NokiaVolumeExtItf)
+        {
+        status = (*m_NokiaVolumeExtItf)->IsEnabledStereoPosition(m_NokiaVolumeExtItf, &value);
+        }
+    else
+        {
+        status = KErrNotFound;
+        }
+    
+    return status;
+    }
+    
+TInt COpenMAXALTestModule::al_nokiavolumeextitf_SetStereoPosition( CStifItemParser& aItem )
+    {
+    TInt status(KErrNone);
+    TInt value(0);
+    
+    status = aItem.GetNextInt(value);
+    RET_ERR_IF_ERR(status);
+    
+    if(m_NokiaVolumeExtItf)
+        {
+        status = (*m_NokiaVolumeExtItf)->SetStereoPosition(m_NokiaVolumeExtItf, value);
+        }
+    else
+        {
+        status = KErrNotFound;
+        }
+    
+    return status;
+    }
+    
+TInt COpenMAXALTestModule::al_nokiavolumeextitf_GetStereoPosition( CStifItemParser& /*aItem*/ )
+    {
+    TInt status(KErrNone);
+    XApermille value(0);
+    
+    if(m_NokiaVolumeExtItf)
+        {
+        status = (*m_NokiaVolumeExtItf)->GetStereoPosition(m_NokiaVolumeExtItf, &value);
+        }
+    else
+        {
+        status = KErrNotFound;
+        }
+    
+    return status;
+    }
+
+TInt COpenMAXALTestModule::al_nokiavolumeextitf_RegisterVolumeCallback( CStifItemParser& /*aItem*/ )
+    {
+    TInt status(KErrNone);
+    if(m_NokiaVolumeExtItf)
+        {
+        status = (*m_NokiaVolumeExtItf)->RegisterVolumeCallback(m_NokiaVolumeExtItf, NokiaVolumeExtCallback, this);
+        }
+    else
+        {
+        status = KErrNotFound;
+        }
+    return status;
+    }
+    
+TInt COpenMAXALTestModule::al_nokiavolumeextitf_SetCallbackEventsMask( CStifItemParser& aItem )
+    {
+    TInt status(KErrNone);
+    TInt value(0);
+    
+    status = aItem.GetNextInt(value);
+    RET_ERR_IF_ERR(status);
+    
+    if(m_NokiaVolumeExtItf)
+        {
+        status = (*m_NokiaVolumeExtItf)->SetCallbackEventsMask(m_NokiaVolumeExtItf, value);
+        }
+    else
+        {
+        status = KErrNotFound;
+        }
+    
+    return status;
+    }
+    
+TInt COpenMAXALTestModule::al_nokiavolumeextitf_GetCallbackEventsMask( CStifItemParser& /*aItem*/ )
+    {
+    TInt status(KErrNone);
+    XAuint32 value(0);
+    
+    if(m_NokiaVolumeExtItf)
+        {
+        status = (*m_NokiaVolumeExtItf)->GetCallbackEventsMask(m_NokiaVolumeExtItf, &value);
+        }
+    else
+        {
+        status = KErrNotFound;
+        }
+    
+    return status;
+    }
+    
+
+void NokiaVolumeExtCallback(
+    XANokiaVolumeExtItf caller,
+    void * pContext,
+    XAuint32 event,
+    XAboolean eventBooleanData
+)
+    {
+
+    }
+
--- a/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxalobjectcallbacks.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxalobjectcallbacks.cpp	Fri May 14 16:22:35 2010 +0300
@@ -19,6 +19,7 @@
 #include <e32svr.h>
 #include <StifParser.h>
 #include <StifTestInterface.h>
+#include <StifTestEventInterface.h>
 #include "openmaxaltestmodule.h"
 
 // EXTERNAL DATA STRUCTURES
@@ -50,12 +51,6 @@
         XAuint32 param,
         void * pInterface);
 
-void MediaRecorderCallback(XAObjectItf caller,
-        const void * pContext,
-        XAuint32 event,
-        XAresult result,
-        XAuint32 param,
-        void * pInterface);
 // FORWARD DECLARATIONS
 //class ?FORWARD_CLASSNAME;
 
@@ -91,7 +86,10 @@
             func = ObjectCallback;
             break;
         case EMediaRecorder:
-            func = MediaRecorderCallback;
+            func = ObjectCallback;
+            break;
+        case EMediaPlayer:
+            func = ObjectCallback;
             break;
         default:
             func = NULL;
@@ -101,6 +99,58 @@
     
     }
 
+void COpenMAXALTestModule::HandleObjectCallback(XAObjectItf caller,XAuint32 event,
+                        XAresult result,XAuint32 param, void * pInterface)
+    {
+    switch(event)
+        {
+        case XA_OBJECT_EVENT_RUNTIME_ERROR:
+            {
+            TEventIf event( TEventIf::ESetEvent, _L("Event_XA_OBJECT_EVENT_RUNTIME_ERROR") );
+            TestModuleIf().Event( event );
+            }
+            break;
+        case XA_OBJECT_EVENT_ASYNC_TERMINATION:
+            {
+            TEventIf event( TEventIf::ESetEvent, _L("Event_XA_OBJECT_EVENT_ASYNC_TERMINATION") );
+            TestModuleIf().Event( event );
+            }
+            break;
+        case XA_OBJECT_EVENT_RESOURCES_LOST:
+            {
+            TEventIf event( TEventIf::ESetEvent, _L("Event_XA_OBJECT_EVENT_RESOURCES_LOST") );
+            TestModuleIf().Event( event );
+            }
+            break;
+        case XA_OBJECT_EVENT_RESOURCES_AVAILABLE:
+            {
+            TEventIf event( TEventIf::ESetEvent, _L("Event_XA_OBJECT_EVENT_RESOURCES_AVAILABLE") );
+            TestModuleIf().Event( event );
+            }
+            break;
+        case XA_OBJECT_EVENT_ITF_CONTROL_TAKEN:
+            {
+            TEventIf event( TEventIf::ESetEvent, _L("Event_XA_OBJECT_EVENT_ITF_CONTROL_TAKEN") );
+            TestModuleIf().Event( event );
+            }
+            break;
+        case XA_OBJECT_EVENT_ITF_CONTROL_RETURNED:
+            {
+            TEventIf event( TEventIf::ESetEvent, _L("Event_XA_OBJECT_EVENT_ITF_CONTROL_RETURNED") );
+            TestModuleIf().Event( event );
+            }
+            break;
+        case XA_OBJECT_EVENT_ITF_PARAMETERS_CHANGED:
+            {
+            TEventIf event( TEventIf::ESetEvent, _L("Event_XA_OBJECT_EVENT_ITF_PARAMETERS_CHANGED") );
+            TestModuleIf().Event( event );
+
+            }
+            break;
+        default:
+            break;
+        }
+    }
 
 void ObjectCallback(XAObjectItf caller,
         const void * pContext,
@@ -109,16 +159,9 @@
         XAuint32 param,
         void * pInterface)
     {
-    
+    if (pContext)
+        {
+        ((COpenMAXALTestModule*)pContext)->HandleObjectCallback(caller, event, result, param, pInterface);
+        }
     }
 
-void MediaRecorderCallback(XAObjectItf caller,
-        const void * pContext,
-        XAuint32 event,
-        XAresult result,
-        XAuint32 param,
-        void * pInterface)
-    {
-    
-    }
-
--- a/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxalobjectitftests.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxalobjectitftests.cpp	Fri May 14 16:22:35 2010 +0300
@@ -20,6 +20,7 @@
 #include <StifParser.h>
 #include <StifTestInterface.h>
 #include "openmaxaltestmodule.h"
+#include "profileutilmacro.h"
 
 // EXTERNAL DATA STRUCTURES
 //extern  ?external_data;
@@ -86,7 +87,17 @@
             status = aItem.GetNextInt(async);
             if(!status)
                 {
-                res = (*itf)->Realize(itf, async);
+                if (object == XA_OBJECTID_MEDIAPLAYER)
+                    {
+                    TAG_TIME_PROFILING_BEGIN;
+                    res = (*itf)->Realize(itf, async);
+                    TAG_TIME_PROFILING_END;
+                    PRINT_TO_CONSOLE_TIME_DIFF;
+                    }
+                else
+                    {
+                    res = (*itf)->Realize(itf, async);
+                    }
                 status = res;
                 }
             else
@@ -196,7 +207,7 @@
             func = GetCallbackFunc(object);
             if(func)
                 {
-                res = (*itf)->RegisterCallback(itf, func, NULL);
+                res = (*itf)->RegisterCallback(itf, func, this);
                 status = res;
                 }
             else
@@ -238,7 +249,17 @@
         XAObjectItf itf = GetObject(object);
         if(itf != NULL)
             {
-            (*itf)->Destroy(itf);
+            if (object == XA_OBJECTID_MEDIAPLAYER)
+                {
+                TAG_TIME_PROFILING_BEGIN;
+                (*itf)->Destroy(itf);
+                TAG_TIME_PROFILING_END;
+                PRINT_TO_CONSOLE_TIME_DIFF;
+                }
+            else
+                {
+                (*itf)->Destroy(itf);
+                }
             }
         else
             {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxalstrminfoitftests.cpp	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,300 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains testclass implementation.
+*
+*/
+
+// [INCLUDE FILES] - do not remove
+#include <e32svr.h>
+#include <StifParser.h>
+#include <StifTestInterface.h>
+#include "openmaxaltestmodule.h"
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+void StreamEventChangeCallback (
+        XAStreamInformationItf caller,
+        XAuint32 eventId,
+        XAuint32 streamIndex,
+        void * pEventData,
+        void * pContext
+);
+
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+ 
+TInt COpenMAXALTestModule::al_strminfoitf_QueryMediaContainerInformation( CStifItemParser& /*aItem*/ )
+    {
+    TInt status(KErrNone);
+    XAresult res;
+    XAMediaContainerInformation info;
+    
+    if(m_StrInfoItf)
+        {
+        res = (*m_StrInfoItf)->QueryMediaContainerInformation(m_StrInfoItf,&info);
+        status = res;
+        }
+    else
+        {
+        status = KErrNotFound;
+        }
+    return status;    
+    }
+
+TInt COpenMAXALTestModule::al_strminfoitf_QueryStreamType( CStifItemParser& aItem )
+    {
+    TInt status(KErrNone);
+    XAresult res;
+    TInt async(0);
+    TInt index(0);
+    XAuint32 streamType;
+
+    status = aItem.GetNextInt(index);
+    if(!status)
+        {
+        if(m_StrInfoItf)
+            {
+            res = (*m_StrInfoItf)->QueryStreamType(m_StrInfoItf,index, &streamType);
+            status = res;
+            }
+        else
+            {
+            status = KErrNotFound;
+            }
+        }
+    else
+        {
+        status = KErrGeneral;
+        }
+    return status;            
+    }
+
+TInt COpenMAXALTestModule::al_strminfoitf_QueryStreamInformation( CStifItemParser& aItem )
+    {
+    TInt status(KErrNone);
+    XAresult res;
+    TInt streamindex(0);
+    void* info = NULL;
+    XAuint32 domain;
+    XAAudioStreamInformation audioinfo;
+    XAVideoStreamInformation videoinfo;
+    
+    status = aItem.GetNextInt(streamindex);
+    RET_ERR_IF_ERR(status);
+    
+    if(m_StrInfoItf)
+        {
+        res = (*m_StrInfoItf)->QueryStreamType(m_StrInfoItf,streamindex, &domain);
+        status = res;
+        }
+    else
+        {
+        status = KErrNotFound;
+        }
+    
+    if(domain == XA_DOMAINTYPE_AUDIO)
+        {
+        info = &audioinfo;
+        }
+    else if ( domain == XA_DOMAINTYPE_VIDEO)
+        {
+        info = &videoinfo;
+        }
+    
+    if(!status)
+        {
+        if(m_StrInfoItf)
+            {
+            res = (*m_StrInfoItf)->QueryStreamInformation(m_StrInfoItf,streamindex, info);
+            status = res;
+            }
+        else
+            {
+            status = KErrNotFound;
+            }
+        }
+    else
+        {
+        status = KErrGeneral;
+        }
+    return status;        
+    }
+
+TInt COpenMAXALTestModule::al_strminfoitf_QueryStreamName( CStifItemParser& aItem )
+    {
+    TInt status(KErrNone);
+    XAresult res;
+    TInt streamindex(0);
+    XAuint16 size;
+
+    status = aItem.GetNextInt(streamindex);
+    if(!status)
+        {
+        if(m_StrInfoItf)
+            {
+            res = (*m_StrInfoItf)->QueryStreamName(m_StrInfoItf,streamindex, &size, NULL);
+            status = res;
+            }
+        else
+            {
+            status = KErrNotFound;
+            }
+        }
+    else
+        {
+        status = KErrGeneral;
+        }
+    return status;       
+    }
+
+TInt COpenMAXALTestModule::al_strminfoitf_RegisterStreamChangeCallback( CStifItemParser& /*aItem*/ )
+    {
+    TInt status(KErrNone);
+    XAresult res;
+    if(m_StrInfoItf)
+        {
+        res = (*m_StrInfoItf)->RegisterStreamChangeCallback(m_StrInfoItf,StreamEventChangeCallback,(void*)this);
+        status = res;
+        }
+    else
+        {
+        status = KErrNotFound;
+        }
+    return status;    
+    }
+
+TInt COpenMAXALTestModule::al_strminfoitf_QueryActiveStreams( CStifItemParser& aItem )
+    {
+    TInt status(KErrNone);
+    XAresult res;
+    TInt streamindex(0);
+    XAuint32 size(0);
+    TInt inpsize;
+    XAboolean arr[2];
+    
+    status = aItem.GetNextInt(inpsize);
+    if(!status)
+        {
+        if(m_StrInfoItf)
+            {
+            size = inpsize;
+            res = (*m_StrInfoItf)->QueryActiveStreams(m_StrInfoItf, &size, arr);
+            status = res;
+            }
+        else
+            {
+            status = KErrNotFound;
+            }
+        }
+    else
+        {
+        if(m_StrInfoItf)
+            {
+            res = (*m_StrInfoItf)->QueryActiveStreams(m_StrInfoItf,&size, NULL);
+            status = res;
+            }
+        else
+            {
+            status = KErrNotFound;
+            }
+        }
+    return status;     
+    }
+
+TInt COpenMAXALTestModule::al_strminfoitf_SetActiveStream( CStifItemParser& aItem )
+    {
+    TInt status(KErrNone);
+    XAresult res;
+    TInt streamindex(0);
+    XAboolean active;
+    XAboolean commitnow;
+    TInt value;
+    
+    status = aItem.GetNextInt(streamindex);
+    RET_ERR_IF_ERR(status);
+    
+    status = aItem.GetNextInt(value);
+    RET_ERR_IF_ERR(status);
+    active = value;
+
+    status = aItem.GetNextInt(value);
+    RET_ERR_IF_ERR(status);
+    commitnow = value;
+    
+    if(m_StrInfoItf)
+        {
+        res = (*m_StrInfoItf)->SetActiveStream(m_StrInfoItf,streamindex, active, commitnow);
+        status = res;
+        }
+    else
+        {
+        status = KErrNotFound;
+        }
+    return status;          
+    }
+
+void StreamEventChangeCallback (
+        XAStreamInformationItf caller,
+        XAuint32 eventId,
+        XAuint32 streamIndex,
+        void * pEventData,
+        void * pContext
+)
+    {
+    
+    }
--- a/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxaltestmodule.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxaltestmodule.cpp	Fri May 14 16:22:35 2010 +0300
@@ -19,7 +19,7 @@
 #include <StifTestInterface.h>
 #include "openmaxaltestmodule.h"
 #include <SettingServerClient.h>
-
+#include <glib.h>
 // EXTERNAL DATA STRUCTURES
 //extern  ?external_data;
 
@@ -79,7 +79,8 @@
 //
 COpenMAXALTestModule::COpenMAXALTestModule( 
     CTestModuleIf& aTestModuleIf ):
-        CScriptBase( aTestModuleIf )
+        CScriptBase( aTestModuleIf ), 
+        iTestModuleIf(aTestModuleIf)
     {
     }
 
@@ -129,6 +130,7 @@
                           EFalse );
     
     SendTestClassVersion();
+    g_setenv("G_SLICE", "always-malloc", 1);
     }
 
 // -----------------------------------------------------------------------------
--- a/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxaltestmoduleblocks.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxaltestmoduleblocks.cpp	Fri May 14 16:22:35 2010 +0300
@@ -113,6 +113,8 @@
         ENTRY( "al_SetDataSink", COpenMAXALTestModule::al_SetDataSink ),
         ENTRY( "al_SetDataLocator", COpenMAXALTestModule::al_SetDataLocator ),
         ENTRY( "al_SetDataFormat", COpenMAXALTestModule::al_SetDataFormat ),
+        ENTRY( "al_CreateWindow", COpenMAXALTestModule::al_CreateWindow ),
+        ENTRY( "al_DeleteWindow", COpenMAXALTestModule::al_DeleteWindow ),
         /* Common Utility Functions ends*/
         
         ENTRY( "al_createEngine", COpenMAXALTestModule::al_createEngine ),
@@ -212,6 +214,94 @@
         ENTRY( "al_metadatainsertionitf_InsertMetadataItem", COpenMAXALTestModule::al_metadatainsertionitf_InsertMetadataItem ),
         ENTRY( "al_metadatainsertionitf_RegisterCallback", COpenMAXALTestModule::al_metadatainsertionitf_RegisterCallback ),
         /*MetadataInsertionItf ends*/
+
+        /*PlayItf begins*/
+        ENTRY( "al_playitf_SetPlayState", COpenMAXALTestModule::al_playitf_SetPlayState ),
+        ENTRY( "al_playitf_GetPlayState", COpenMAXALTestModule::al_playitf_GetPlayState ),
+        ENTRY( "al_playitf_GetDurationNullParam", COpenMAXALTestModule::al_playitf_GetDurationNullParam ),
+        ENTRY( "al_playitf_GetDuration", COpenMAXALTestModule::al_playitf_GetDuration ),
+        ENTRY( "al_playitf_GetPositionNullParam", COpenMAXALTestModule::al_playitf_GetPositionNullParam ),
+        ENTRY( "al_playitf_GetPosition", COpenMAXALTestModule::al_playitf_GetPosition ),
+        ENTRY( "al_playitf_RegisterCallback", COpenMAXALTestModule::al_playitf_RegisterCallback ),
+        ENTRY( "al_playitf_SetCallbackEventMask", COpenMAXALTestModule::al_playitf_SetCallbackEventMask ),
+        ENTRY( "al_playitf_GetCallbackEventMaskNullParam", COpenMAXALTestModule::al_playitf_GetCallbackEventMaskNullParam ),
+        ENTRY( "al_playitf_GetCallbackEventMask", COpenMAXALTestModule::al_playitf_GetCallbackEventMask ),
+        ENTRY( "al_playitf_SetMarkerPosition", COpenMAXALTestModule::al_playitf_SetMarkerPosition ),
+        ENTRY( "al_playitf_ClearMarkerPosition", COpenMAXALTestModule::al_playitf_ClearMarkerPosition ),
+        ENTRY( "al_playitf_GetMarkerPositionNullParam", COpenMAXALTestModule::al_playitf_GetMarkerPositionNullParam ),
+        ENTRY( "al_playitf_GetMarkerPosition", COpenMAXALTestModule::al_playitf_GetMarkerPosition ),
+        ENTRY( "al_playitf_SetPositionUpdatePeriod", COpenMAXALTestModule::al_playitf_SetPositionUpdatePeriod ),
+        ENTRY( "al_playitf_GetPositionUpdatePeriodNullParam", COpenMAXALTestModule::al_playitf_GetPositionUpdatePeriodNullParam ),
+        ENTRY( "al_playitf_GetPositionUpdatePeriod", COpenMAXALTestModule::al_playitf_GetPositionUpdatePeriod ),
+        /*PlayItf ends*/
+
+        /*SeekItf begins*/
+        ENTRY( "al_seekitf_SetPosition", COpenMAXALTestModule::al_seekitf_SetPosition ),
+        ENTRY( "al_seekitf_SetLoop", COpenMAXALTestModule::al_seekitf_SetLoop ),
+        ENTRY( "al_seekitf_GetLoop", COpenMAXALTestModule::al_seekitf_GetLoop ),
+        /*SeekItf ends*/
+
+        /*DynamicSourceItf begins*/
+        ENTRY( "al_dynsrcitf_SetSource", COpenMAXALTestModule::al_dynsrcitf_SetSource ),
+        /*DynamicSourceItf ends*/
+        
+        /*StreamInformationItf begins*/
+        ENTRY( "al_strminfoitf_QueryMediaContainerInformation", COpenMAXALTestModule::al_strminfoitf_QueryMediaContainerInformation ),
+        ENTRY( "al_strminfoitf_QueryStreamType", COpenMAXALTestModule::al_strminfoitf_QueryStreamType ),
+        ENTRY( "al_strminfoitf_QueryStreamInformation", COpenMAXALTestModule::al_strminfoitf_QueryStreamInformation ),
+        ENTRY( "al_strminfoitf_QueryStreamName", COpenMAXALTestModule::al_strminfoitf_QueryStreamName ),
+        ENTRY( "al_strminfoitf_RegisterStreamChangeCallback", COpenMAXALTestModule::al_strminfoitf_RegisterStreamChangeCallback ),
+        ENTRY( "al_strminfoitf_QueryActiveStreams", COpenMAXALTestModule::al_strminfoitf_QueryActiveStreams ),
+        ENTRY( "al_strminfoitf_SetActiveStream", COpenMAXALTestModule::al_strminfoitf_SetActiveStream ),
+        /*StreamInformationItf ends*/
+        
+        /*VolumeItf begins*/
+        ENTRY( "al_volumeitf_SetVolumeLevel", COpenMAXALTestModule::al_volumeitf_SetVolumeLevel ),
+        ENTRY( "al_volumeitf_GetVolumeLevel", COpenMAXALTestModule::al_volumeitf_GetVolumeLevel ),
+        ENTRY( "al_volumeitf_GetMaxVolumeLevel", COpenMAXALTestModule::al_volumeitf_GetMaxVolumeLevel ),
+        ENTRY( "al_volumeitf_SetMute", COpenMAXALTestModule::al_volumeitf_SetMute ),
+        ENTRY( "al_volumeitf_GetMute", COpenMAXALTestModule::al_volumeitf_GetMute ),
+        ENTRY( "al_volumeitf_EnableStereoPosition", COpenMAXALTestModule::al_volumeitf_EnableStereoPosition ),
+        ENTRY( "al_volumeitf_IsEnabledStereoPosition", COpenMAXALTestModule::al_volumeitf_IsEnabledStereoPosition ),
+        ENTRY( "al_volumeitf_SetStereoPosition", COpenMAXALTestModule::al_volumeitf_SetStereoPosition ),
+        ENTRY( "al_volumeitf_GetStereoPosition", COpenMAXALTestModule::al_volumeitf_GetStereoPosition ),
+        /*VolumeItf ends*/        
+        
+        /*NokiaVolumeExtItf begins*/
+        ENTRY( "al_nokiavolumeextitf_SetVolumeLevel", COpenMAXALTestModule::al_nokiavolumeextitf_SetVolumeLevel ),
+        ENTRY( "al_nokiavolumeextitf_GetVolumeLevel", COpenMAXALTestModule::al_nokiavolumeextitf_GetVolumeLevel ),
+        ENTRY( "al_nokiavolumeextitf_GetMaxVolumeLevel", COpenMAXALTestModule::al_nokiavolumeextitf_GetMaxVolumeLevel ),
+        ENTRY( "al_nokiavolumeextitf_SetMute", COpenMAXALTestModule::al_nokiavolumeextitf_SetMute ),
+        ENTRY( "al_nokiavolumeextitf_GetMute", COpenMAXALTestModule::al_nokiavolumeextitf_GetMute ),
+        ENTRY( "al_nokiavolumeextitf_EnableStereoPosition", COpenMAXALTestModule::al_nokiavolumeextitf_EnableStereoPosition ),
+        ENTRY( "al_nokiavolumeextitf_IsEnabledStereoPosition", COpenMAXALTestModule::al_nokiavolumeextitf_IsEnabledStereoPosition ),
+        ENTRY( "al_nokiavolumeextitf_SetStereoPosition", COpenMAXALTestModule::al_nokiavolumeextitf_SetStereoPosition ),
+        ENTRY( "al_nokiavolumeextitf_GetStereoPosition", COpenMAXALTestModule::al_nokiavolumeextitf_GetStereoPosition ),
+        ENTRY( "al_nokiavolumeextitf_RegisterVolumeCallback", COpenMAXALTestModule::al_nokiavolumeextitf_RegisterVolumeCallback ),
+        ENTRY( "al_nokiavolumeextitf_SetCallbackEventsMask", COpenMAXALTestModule::al_nokiavolumeextitf_SetCallbackEventsMask ),
+        ENTRY( "al_nokiavolumeextitf_GetCallbackEventsMask", COpenMAXALTestModule::al_nokiavolumeextitf_GetCallbackEventsMask ),
+        /*NokiaVolumeExtItf ends*/        
+        
+        /*NokiaLinearVolumeItf begins*/
+        ENTRY( "al_nokialinearvolumeitf_SetVolumeLevel", COpenMAXALTestModule::al_nokialinearvolumeitf_SetVolumeLevel ),
+        ENTRY( "al_nokialinearvolumeitf_GetVolumeLevel", COpenMAXALTestModule::al_nokialinearvolumeitf_GetVolumeLevel ),
+        ENTRY( "al_nokialinearvolumeitf_GetStepCount", COpenMAXALTestModule::al_nokialinearvolumeitf_GetStepCount ),
+        ENTRY( "al_nokialinearvolumeitf_RegisterVolumeCallback", COpenMAXALTestModule::al_nokialinearvolumeitf_RegisterVolumeCallback ),
+        ENTRY( "al_nokialinearvolumeitf_SetCallbackEventsMask", COpenMAXALTestModule::al_nokialinearvolumeitf_SetCallbackEventsMask ),
+        ENTRY( "al_nokialinearvolumeitf_GetCallbackEventsMask", COpenMAXALTestModule::al_nokialinearvolumeitf_GetCallbackEventsMask ),
+        /*NokiaLinearVolumeItf ends*/        
+
+        /*MetadataExtractionItf*/
+        ENTRY( "al_metadataextractionitf_GetItemCount", COpenMAXALTestModule::al_metadataextractionitf_GetItemCount ),
+        ENTRY( "al_metadataextractionitf_GetKeySize", COpenMAXALTestModule::al_metadataextractionitf_GetKeySize ),
+        ENTRY( "al_metadataextractionitf_GetKey", COpenMAXALTestModule::al_metadataextractionitf_GetKey ),
+  	    ENTRY( "al_metadataextractionitf_GetValueSize", COpenMAXALTestModule::al_metadataextractionitf_GetValueSize ),
+        ENTRY( "al_metadataextractionitf_GetValue", COpenMAXALTestModule::al_metadataextractionitf_GetValue ),
+        ENTRY( "al_metadataextractionitf_AddKeyFilter", COpenMAXALTestModule::al_metadataextractionitf_AddKeyFilter ),
+        ENTRY( "al_metadataextractionitf_ClearKeyFilter", COpenMAXALTestModule::al_metadataextractionitf_ClearKeyFilter ),
+        ENTRY( "al_metadataextractionitf_GetCoverArt", COpenMAXALTestModule::al_metadataextractionitf_GetCoverArt ),        
+         /*MetadataExtractionItf ends*/
+        
         
         //ADD NEW ENTRY HERE
         // [test cases entries] - Do not remove
@@ -226,6 +316,244 @@
     }
 
 // -----------------------------------------------------------------------------
+// COpenMAXALTestModule::EventName
+// Return descriptor with the notification description
+// -----------------------------------------------------------------------------
+TPtrC COpenMAXALTestModule::EventName( TInt aKey )
+{
+    static TText* const badKeyword = (TText*)L"BadKeyword";
+    static TText* const keywords[] =
+    {
+
+        (TText*)L"EEOSReceived",
+        
+    };
+
+            
+
+    if( (TUint)aKey >= (sizeof( keywords )/sizeof(TText*)) )
+        {
+        iLog->Log(_L("Keyword out of bounds"));
+        TPtrC keyword( badKeyword );
+        return keyword;
+        }
+    else
+        {
+        TPtrC keyword( keywords[aKey] );
+        return keyword;
+        }
+}
+
+// -----------------------------------------------------------------------------
+// COpenMAXALTestModule::AddExpectedEvent
+// Add an event to the expected events' list
+// -----------------------------------------------------------------------------
+void COpenMAXALTestModule::AddExpectedEvent(TOMXExpectedEvent event, TInt ms)
+{
+   iLog->Log(_L("COpenMAXALTestModule::AddExpectedEvent"));
+    iExpectedEvents.Append(event);
+    TPtrC eventName = EventName(event);
+    iLog->Log(_L("Adding expected event:(0x%02x)%S Total=%d"), event, &eventName, iExpectedEvents.Count() );
+
+    if ( iTimeoutController && !iTimeoutController->IsActive() )
+        {
+        if (ms > 0)
+            {
+            iTimeoutController->Start( TTimeIntervalMicroSeconds(ms * 1000) );
+            }
+        else
+            {
+            iLog->Log(_L("Timeout with default value (1s)"));
+            iTimeoutController->Start( TTimeIntervalMicroSeconds(1000000) );
+            }
+        }
+}
+
+// -----------------------------------------------------------------------------
+// COpenMAXALTestModule::RemoveExpectedEvent
+// Remove the indicated event from the expected events' list
+// -----------------------------------------------------------------------------
+TBool COpenMAXALTestModule::RemoveExpectedEvent(TOMXExpectedEvent aEvent)
+{
+   iLog->Log(_L("COpenMAXALTestModule::RemoveExpectedEvent"));
+    TBool match = EFalse;
+    for (TUint i=0; i < iExpectedEvents.Count() ; i++)
+        {
+        if (iExpectedEvents[i] == aEvent)
+            {
+            iExpectedEvents.Remove(i);
+            match = ETrue;
+            break;
+            }
+        }
+
+    return match;
+}
+
+
+// -----------------------------------------------------------------------------
+// COpenMAXALTestModule::RemoveAllExpectedEvents
+// Remove the indicated event from the expected events' list
+// -----------------------------------------------------------------------------
+void COpenMAXALTestModule::RemoveAllExpectedEvents()
+{
+   iLog->Log(_L("COpenMAXALTestModule::RemoveAllExpectedEvents"));
+    iLog->Log(_L("Removing all expected events"));
+    
+    iExpectedEvents.Reset();
+    iOcurredEvents.Reset();
+}
+
+
+// -----------------------------------------------------------------------------
+// COpenMAXALTestModule::ProcessEvent
+// -----------------------------------------------------------------------------
+void COpenMAXALTestModule::ProcessEvent(TOMXExpectedEvent aEvent, TInt aError)
+{
+   iLog->Log(_L("COpenMAXALTestModule::ProcessExpectedEvent"));
+    TPtrC nameEvent = EventName(aEvent);
+
+    // Check for error
+    if (aError == KErrNone)
+        {
+        // Remove the event
+        if (RemoveExpectedEvent(aEvent))
+            {
+            iLog->Log(_L("Expected Event: (0x%02x)%S has ocurred Total=%d"), aEvent, &nameEvent,iExpectedEvents.Count());
+            }
+        else
+            {
+            iLog->Log(_L("Event: (0x%02x)%S has ocurred"), aEvent, &nameEvent);
+            return;
+            }
+
+        
+
+        // All expected events have ocurred
+        if (iExpectedEvents.Count() == 0 )
+            {
+            Signal();
+            iTimeoutController->Cancel();
+            }
+        
+        
+        }
+    else
+        {
+        iLog->Log(_L("[Error] Event: (0x%02x)%S return with error code=%d"), aEvent, &nameEvent, aError);
+        if (iExpectedEvents.Count() != 0 )
+            {
+            RemoveExpectedEvent(aEvent);
+            }
+        iTimeoutController->Cancel();
+        Signal(KErrCallbackErrorCode);
+        }
+}
+
+// -----------------------------------------------------------------------------
+// COpenMAXALTestModule::HandleTimeout
+// Review if all the expected events have ocurred once the time is over
+// -----------------------------------------------------------------------------
+
+void COpenMAXALTestModule::HandleTimeout(TInt aError)
+{
+   iLog->Log(_L("COpenMAXALTestModule::HandleTimeout"));
+    // All expected events have ocurred
+    if (aError != KErrNone)
+        {
+        if (iExpectedEvents.Count() == 0 )
+            {
+            iLog->Log(_L("Timing out but events have ocurred"));
+            Signal();
+            }
+        else
+            {
+            RemoveAllExpectedEvents();
+            iLog->Log(_L("Timing out and events still pending"));
+            Signal(KErrEventPending);
+            }
+        }
+    else
+        {
+        iLog->Log(_L("Timing out return a error %d"), aError);
+        Signal(aError);
+        }
+}
+
+// -----------------------------------------------------------------------------
+// COpenMAXALTestModule::SetTimeout
+// Create a timer and set a timeout
+// When the timeout is reached the test case is marked as failed
+// It's used rather than the "timeout" keyword in the configuration file
+// because in this way the log continues
+// -----------------------------------------------------------------------------
+TInt COpenMAXALTestModule::SetTimeout( CStifItemParser& aItem )
+{
+   iLog->Log(_L("COpenMAXALTestModule::SetTimeout"));
+    TInt timeout=0;
+    TInt error = aItem.GetNextInt(timeout) ;
+    if ( iTimeoutController )
+        {
+        if ( timeout > 0 )
+            {
+            iTimeoutController->Start( TTimeIntervalMicroSeconds(timeout*1000) );
+            }
+        else
+            {
+            iTimeoutController->Start( TTimeIntervalMicroSeconds(1000000) );
+            }
+        }
+    else
+        {
+        iLog->Log(_L("Timeout Controller doesn't exist"));
+        error = KErrTimeoutController;
+        }
+    return error;
+}
+
+
+// -----------------------------------------------------------------------------
+// Uses the TestModuleBase API to allow a panic as exit reason for a test case
+// -----------------------------------------------------------------------------
+TInt COpenMAXALTestModule::SetAllowedPanic( CStifItemParser& aItem )
+{
+   iLog->Log(_L("COpenMAXALTestModule::SetAllowedPanic"));
+    TInt error = KErrNone;
+    TInt panicCode;
+    TPtrC panicType;
+    if (  ( KErrNone == aItem.GetNextString(panicType) ) &&
+    ( KErrNone == aItem.GetNextInt(panicCode) )  )
+        {
+        iLog->Log(_L("Allowing panic: %S %d"), &panicType, panicCode);
+        iTestModuleIf.SetExitReason( CTestModuleIf::EPanic, panicCode );
+        iNormalExitReason = EFalse;
+        }
+    else
+        {
+        iLog->Log(KMsgBadTestParameters);
+        error = KErrBadTestParameter;
+        }
+    return error;
+}
+
+// -----------------------------------------------------------------------------
+// COpenMAXALTestModule::SetExpectedEvents()
+// -----------------------------------------------------------------------------
+TInt COpenMAXALTestModule::SetExpectedEvents( CStifItemParser& aItem )
+{
+   iLog->Log(_L("COpenMAXALTestModule::SetExpectedEvents"));
+    TInt error = KErrNone;
+    TInt event=0;
+    while ( KErrNone == aItem.GetNextInt(event))
+        {
+        TInt timeout=0;
+        aItem.GetNextInt(timeout);
+        AddExpectedEvent(static_cast<TOMXExpectedEvent>(event), timeout); // Default timeout value
+        }
+    return error;
+}
+
+// -----------------------------------------------------------------------------
 // COpenMAXALTestModule::ExampleL
 // Example test method function.
 // (other items were commented in a header).
@@ -444,6 +772,12 @@
         case 40:
             id = XA_IID_STREAMINFORMATION;
             break;
+        case 41:
+            id = XA_IID_NOKIAVOLUMEEXT;
+            break;
+        case 42:
+            id = XA_IID_NOKIALINEARVOLUME;
+            break;
         default:
             break;
         }
@@ -519,6 +853,7 @@
             break;
         case 7:
 /*            XA_IID_PLAY;*/
+            m_PlayItf = XAPlayItf(id);
             break;
         case 8:
 /*            XA_IID_PLAYBACKRATE;*/
@@ -528,9 +863,11 @@
             break;
         case 10:
 /*            XA_IID_SEEK;*/
+            m_SeekItf = XASeekItf(id);
             break;
         case 11:
 /*            XA_IID_VOLUME;*/
+            m_VolumeItf = XAVolumeItf(id);
             break;
         case 12:
 /*            XA_IID_IMAGECONTROLS;*/
@@ -549,6 +886,7 @@
             break;
         case 17:
 /*            XA_IID_METADATAEXTRACTION;*/
+            m_MetadataExtractionItf = XAMetadataExtractionItf(id);
             break;
         case 18:
             m_MetadataInsertionItf = XAMetadataInsertionItf(id);
@@ -559,6 +897,7 @@
             break;
         case 20:
 /*            XA_IID_DYNAMICSOURCE;*/
+            m_DynSrcItf = XADynamicSourceItf(id);
             break;
         case 21:
 /*            XA_IID_CAMERACAPABILITIES;*/
@@ -622,7 +961,17 @@
             break;
         case 40:
 /*            XA_IID_STREAMINFORMATION;*/
+            m_StrInfoItf = XAStreamInformationItf(id);
             break;
+        case 41:
+/*            XA_IID_NOKIAVOLUMEEXTITF;*/
+            m_NokiaVolumeExtItf = XANokiaVolumeExtItf(id);
+            break;
+        case 42:
+/*            XA_IID_NOKIALINEARVOLUMEITF;*/
+            m_NokiaLinearVolumeItf = XANokiaLinearVolumeItf(id);
+            break;
+            
         default:
             break;
             
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/common/openmaxalvolumeitftests.cpp	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,238 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains testclass implementation.
+*
+*/
+
+// [INCLUDE FILES] - do not remove
+#include <e32svr.h>
+#include <StifParser.h>
+#include <StifTestInterface.h>
+#include "openmaxaltestmodule.h"
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+TInt COpenMAXALTestModule::al_volumeitf_SetVolumeLevel( CStifItemParser& aItem )
+    {
+    TInt status(KErrNone);
+    TInt volume(0);
+    
+    status = aItem.GetNextInt(volume);
+    RET_ERR_IF_ERR(status);
+    
+    if(m_VolumeItf)
+        {
+        status = (*m_VolumeItf)->SetVolumeLevel(m_VolumeItf, volume);
+        }
+    else
+        {
+        status = KErrNotFound;
+        }
+    
+    return status;
+    }
+    
+TInt COpenMAXALTestModule::al_volumeitf_GetVolumeLevel( CStifItemParser& /*aItem*/ )
+    {
+    TInt status(KErrNone);
+    XAmillibel volume(0);
+    if(m_VolumeItf)
+        {
+        status = (*m_VolumeItf)->GetVolumeLevel(m_VolumeItf, &volume);
+        }
+    else
+        {
+        status = KErrNotFound;
+        }
+    return status;
+    }
+    
+TInt COpenMAXALTestModule::al_volumeitf_GetMaxVolumeLevel( CStifItemParser& /*aItem*/ )
+    {
+    TInt status(KErrNone);
+    XAmillibel volume(0);
+    if(m_VolumeItf)
+        {
+        status = (*m_VolumeItf)->GetMaxVolumeLevel(m_VolumeItf, &volume);
+        }
+    else
+        {
+        status = KErrNotFound;
+        }
+    return status;
+    }
+    
+TInt COpenMAXALTestModule::al_volumeitf_SetMute( CStifItemParser& aItem )
+    {
+    TInt status(KErrNone);
+    TInt mute(0);
+    
+    status = aItem.GetNextInt(mute);
+    RET_ERR_IF_ERR(status);
+    
+    if(m_VolumeItf)
+        {
+        status = (*m_VolumeItf)->SetMute(m_VolumeItf, mute);
+        }
+    else
+        {
+        status = KErrNotFound;
+        }
+    
+    return status;
+    }
+    
+TInt COpenMAXALTestModule::al_volumeitf_GetMute( CStifItemParser& /*aItem*/ )
+    {
+    TInt status(KErrNone);
+    XAboolean mute(0);
+    
+    if(m_VolumeItf)
+        {
+        status = (*m_VolumeItf)->GetMute(m_VolumeItf, &mute);
+        }
+    else
+        {
+        status = KErrNotFound;
+        }
+    
+    return status;
+    }
+    
+TInt COpenMAXALTestModule::al_volumeitf_EnableStereoPosition( CStifItemParser& aItem )
+    {
+    TInt status(KErrNone);
+    TInt value(0);
+    
+    status = aItem.GetNextInt(value);
+    RET_ERR_IF_ERR(status);
+    
+    if(m_VolumeItf)
+        {
+        status = (*m_VolumeItf)->EnableStereoPosition(m_VolumeItf, value);
+        }
+    else
+        {
+        status = KErrNotFound;
+        }
+    
+    return status;
+    }
+    
+TInt COpenMAXALTestModule::al_volumeitf_IsEnabledStereoPosition( CStifItemParser& /*aItem*/ )
+    {
+    TInt status(KErrNone);
+    XAboolean value(0);
+    
+    if(m_VolumeItf)
+        {
+        status = (*m_VolumeItf)->IsEnabledStereoPosition(m_VolumeItf, &value);
+        }
+    else
+        {
+        status = KErrNotFound;
+        }
+    
+    return status;
+    }
+    
+TInt COpenMAXALTestModule::al_volumeitf_SetStereoPosition( CStifItemParser& aItem )
+    {
+    TInt status(KErrNone);
+    TInt value(0);
+    
+    status = aItem.GetNextInt(value);
+    RET_ERR_IF_ERR(status);
+    
+    if(m_VolumeItf)
+        {
+        status = (*m_VolumeItf)->SetStereoPosition(m_VolumeItf, value);
+        }
+    else
+        {
+        status = KErrNotFound;
+        }
+    
+    return status;
+    }
+    
+TInt COpenMAXALTestModule::al_volumeitf_GetStereoPosition( CStifItemParser& /*aItem*/ )
+    {
+    TInt status(KErrNone);
+    XApermille value(0);
+    
+    if(m_VolumeItf)
+        {
+        status = (*m_VolumeItf)->GetStereoPosition(m_VolumeItf, &value);
+        }
+    else
+        {
+        status = KErrNotFound;
+        }
+    
+    return status;
+    }
+    
+
+
+
--- a/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/engine/openmaxalengineitftests.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/engine/openmaxalengineitftests.cpp	Fri May 14 16:22:35 2010 +0300
@@ -20,6 +20,7 @@
 #include <StifParser.h>
 #include <StifTestInterface.h>
 #include "openmaxaltestmodule.h"
+#include "profileutilmacro.h"
 
 // EXTERNAL DATA STRUCTURES
 //extern  ?external_data;
@@ -284,8 +285,7 @@
 TInt COpenMAXALTestModule::al_engitf_CreateMediaPlayer( CStifItemParser& aItem )
     {
     TInt status(KErrNone);
-    XADataSource* audioSource(NULL);
-    XADataSource* videoSource(NULL);
+    XADataSource* dataSource(NULL);
     XADataSink* audioSink(NULL);
     XADataSink* videoSink(NULL);
     XADataSink* ledSink(NULL);
@@ -321,14 +321,14 @@
             }
         }
     
-    if(m_AudioSource.pFormat && m_AudioSource.pLocator)
+    /*pFormat is not mandatory for RadioSrc*/
+    if(/*m_AudioSource.pFormat &&*/ m_AudioSource.pLocator)
         {
-        audioSource = &m_AudioSource;
+        dataSource = &m_AudioSource;
         }
-    
-    if(m_VideoSource.pFormat && m_VideoSource.pLocator)
+    else if(m_VideoSource.pFormat && m_VideoSource.pLocator)
         {
-        videoSource = &m_VideoSource;
+        dataSource = &m_VideoSource;
         }
     
     if(m_VibraSink.pFormat && m_VibraSink.pLocator)
@@ -340,23 +340,26 @@
         {
         ledSink = &m_LEDSink;
         }
-    
-    if(m_AudioSink.pFormat && m_AudioSink.pLocator)
+    /*pFormat is not mandatory for IODevice*/
+    if(/*m_AudioSink.pFormat && */m_AudioSink.pLocator)
         {
         audioSink = &m_AudioSink;
         }
-    
-    if(m_VideoSink.pFormat && m_VideoSink.pLocator)
+    /*pFormat is not mandatory for NativeDisplay*/
+    if(/*m_VideoSink.pFormat && */m_VideoSink.pLocator)
         {
         videoSink = &m_VideoSink;
         }    
     
     if(m_EngineItf)
         {
+        TAG_TIME_PROFILING_BEGIN;
         res = (*m_EngineItf)->CreateMediaPlayer(
-                m_EngineItf, &m_MOPlayer, audioSource, videoSource,
+                m_EngineItf, &m_MOPlayer, dataSource, NULL,
                 audioSink,videoSink, ledSink, vibraSink,
                 numInterfaces, iidArray, required);
+        TAG_TIME_PROFILING_END;
+        PRINT_TO_CONSOLE_TIME_DIFF;
         status = res;
         }
     else
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/metadata/openmaxalmetadataextractionitftests.cpp	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,505 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains testclass implementation.
+*
+*/
+
+// [INCLUDE FILES] - do not remove
+#include <e32svr.h>
+#include <StifParser.h>
+#include <StifTestInterface.h>
+#include "openmaxaltestmodule.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+TInt COpenMAXALTestModule::al_metadataextractionitf_GetItemCount( CStifItemParser& aItem )
+{
+    iLog->Log( _L("al_metadataextractionitf_GetItemCount >>") );
+    
+    TInt status(KErrNotFound);
+    XAresult res;
+    XAuint32 numItems = 0;
+    if(m_MetadataExtractionItf)
+    {
+        res = (*m_MetadataExtractionItf)->GetItemCount(
+                 m_MetadataExtractionItf, &numItems);              
+        status = MapErr(res);
+            
+        TInt expectedNum = 0;
+        if(aItem.GetNextInt(expectedNum) == KErrNone)
+        {				
+			if((status==KErrNone) && (expectedNum != numItems))
+			{
+                status = KErrGeneral;
+			}
+		}
+			
+		iLog->Log( _L("The number of Metadata Items:%d Expected: %d"), numItems, expectedNum );
+  }
+	
+  iLog->Log( _L("al_metadataextractionitf_GetItemCount (%d) <<"), status );
+  return status;
+}
+
+TInt COpenMAXALTestModule::al_metadataextractionitf_GetKeySize( CStifItemParser& aItem )
+{
+    iLog->Log( _L("al_metadataextractionitf_GetKeySize >>") );
+    
+    TInt status(KErrNotFound);
+    XAresult res;
+    XAuint32 keySize = 0;
+    if(m_MetadataExtractionItf)
+    {
+        TInt index;
+        if(aItem.GetNextInt(index) == KErrNone)
+        {
+            res     = (*m_MetadataExtractionItf)->GetKeySize(
+                        m_MetadataExtractionItf, index, &keySize);              
+            status  = MapErr(res);
+  			
+            TInt expectedSize = 0;
+            if(aItem.GetNextInt(expectedSize) == KErrNone)
+			{	      
+                if((status==KErrNone) && (expectedSize != keySize))
+                {
+                    status = KErrNotFound;
+                }
+			}
+			iLog->Log( _L("KeySize[%d]: %d Expected Size:%d"), index, keySize, expectedSize);				
+		}
+	}
+	
+	iLog->Log( _L("al_metadataextractionitf_GetKeySize (%d) <<"), status );
+  return status;
+}
+
+TInt COpenMAXALTestModule::al_metadataextractionitf_GetKey( CStifItemParser& aItem )
+{
+    iLog->Log( _L("al_metadataextractionitf_GetKey >>") );
+    
+    TInt status(KErrNotFound);
+    XAresult res;
+    XAMetadataInfo *key = NULL;
+    
+    if(m_MetadataExtractionItf)
+    {
+        TPtrC keyToFind;
+        if(aItem.GetNextString(keyToFind) == KErrNone)
+        {
+            HBufC *pB = HBufC16::NewL(keyToFind.Size());
+            TPtr tP = pB->Des();
+            tP.Copy(keyToFind);
+            iLog->Log( _L("Expected Key: %S"), pB);
+            delete pB;
+  		
+            XAuint32 numItems = 0;
+            res = (*m_MetadataExtractionItf)->GetItemCount(m_MetadataExtractionItf, &numItems);              
+
+            for(int i = 0; (i < numItems) && (MapErr(res) == KErrNone) && (status == KErrNotFound); i++)
+            {
+                XAuint32 keySize = 0;
+                res = (*m_MetadataExtractionItf)->GetKeySize(
+                       m_MetadataExtractionItf, i, &keySize);  
+      
+                if(MapErr(res) == KErrNone)
+                {
+                    key = (XAMetadataInfo *)calloc(keySize,1);
+                    if(key)
+                    {
+                        res = (*m_MetadataExtractionItf)->GetKey(
+                                        m_MetadataExtractionItf, i , keySize, key);              
+                        status = MapErr(res);
+                        if(status==KErrNone)
+                        {
+                            HBufC*   temp  = NULL;
+                            if(key->encoding == XA_CHARACTERENCODING_ASCII)
+                            {
+                                TPtrC8 des((TUint8*)(key->data), key->size-1 );
+                                temp = HBufC16::NewL(key->size-1);
+                                TPtr tempPtr = temp->Des();
+                                tempPtr.Copy(des);                        
+                                iLog->Log( _L("Key[%d]: %S"), i, temp);
+							}
+							else if(key->encoding == XA_CHARACTERENCODING_UTF16LE)
+							{
+                                TPtrC des((const TUint16*)key->data, key->size/2 - 1);
+                                temp = HBufC16::NewL(key->size/2 - 1);
+                                TPtr tempPtr = temp->Des();
+                                tempPtr.Copy(des);                        
+                                iLog->Log( _L("Key[%d]: %S"), i, temp);
+							}
+									
+							if(temp && !keyToFind.Compare(temp->Des()))
+							{
+								status = KErrNone;
+							}
+							else
+							{
+								status = KErrNotFound;
+							}
+							
+							if(temp)
+							{
+								delete temp;
+							}
+						}//end if(status==KErrNone)
+						
+						free(key);
+                    }//end if(key)
+                }//end if(MapErr(res) == KErrNone)
+            }//end for
+        }//end if(aItem.GetNextString(index) == KErrNone)
+    }//end if(m_MetadataExtractionItf)
+        
+    iLog->Log( _L("al_metadataextractionitf_GetKey (%d)<<"), status );
+    return status;
+}
+
+
+TInt COpenMAXALTestModule::al_metadataextractionitf_GetValueSize( CStifItemParser& aItem )
+{
+    iLog->Log( _L("al_metadataextractionitf_GetValueSize >>") );
+    
+    TInt status(KErrNotFound);
+    XAresult res;
+    XAuint32 valueSize = 0;
+    if(m_MetadataExtractionItf)
+    {
+        TInt index;
+        if(aItem.GetNextInt(index) == KErrNone)
+        {
+            res     = (*m_MetadataExtractionItf)->GetValueSize(
+                            m_MetadataExtractionItf, index, &valueSize);              
+            status  = MapErr(res);
+			iLog->Log( _L("ValueSize[%d]: %d"), index, valueSize);
+        }
+    }
+   
+   iLog->Log( _L("al_metadataextractionitf_GetValueSize (%d) <<"), status );
+   return status;
+}
+
+
+
+TInt COpenMAXALTestModule::al_metadataextractionitf_GetValue( CStifItemParser& aItem )
+{
+    iLog->Log( _L("al_metadataextractionitf_GetValue >>") );
+    
+    TInt status(KErrNotFound);
+    XAresult res;
+    
+    XAMetadataInfo *key = NULL;
+    
+    if(m_MetadataExtractionItf)
+    {
+        TInt index;
+        
+        //Find Key Index
+        TPtrC keyToFind;
+        if(aItem.GetNextString(keyToFind) == KErrNone)
+        {
+            HBufC *pB = HBufC16::NewL(keyToFind.Size());
+            TPtr tP = pB->Des();
+            tP.Copy(keyToFind);
+            iLog->Log( _L("Expected Key: %S"), pB);
+            delete pB;
+            
+            XAuint32 numItems = 0;
+            res = (*m_MetadataExtractionItf)->GetItemCount(m_MetadataExtractionItf, &numItems);              
+    
+            for(index = 0; (index < numItems) && (MapErr(res) == KErrNone) && (status == KErrNotFound); index++)
+            {
+                XAuint32 keySize = 0;
+                res = (*m_MetadataExtractionItf)->GetKeySize(
+                       m_MetadataExtractionItf, index, &keySize);  
+          
+                if(MapErr(res) == KErrNone)
+                {
+                    key = (XAMetadataInfo *)calloc(keySize,1);
+                    if(key)
+                    {
+                        res = (*m_MetadataExtractionItf)->GetKey(
+                                        m_MetadataExtractionItf, index , keySize, key);              
+                        status = MapErr(res);
+                        if(status==KErrNone)
+                        {
+                            HBufC*   temp  = NULL;
+                            TDesC16* pdesc = NULL;
+                                    
+                            if(key->encoding == XA_CHARACTERENCODING_ASCII)
+                            {
+                                TPtrC8 des((TUint8*)(key->data), key->size - 1 );
+                                temp = HBufC16::NewL(key->size - 1);
+                                TPtr tempPtr = temp->Des();
+                                tempPtr.Copy(des);                        
+                                iLog->Log( _L("Key[%d]: %S"), index, temp);
+                                pdesc = &tempPtr;
+                            }
+                            else if(key->encoding == XA_CHARACTERENCODING_UTF16LE)
+                            {
+                                TPtrC des((const TUint16*)key->data, key->size/2 - 1);
+                                temp = HBufC16::NewL(key->size/2 - 1);
+                                TPtr tempPtr = temp->Des();
+                                tempPtr.Copy(des);                        
+                                iLog->Log( _L("Key[%d]: %S"), index, temp);
+                                pdesc = &tempPtr;
+                            }
+                                        
+                            if(!keyToFind.Compare(*pdesc))
+                            {
+                                status = KErrNone;
+                            }
+                            else
+                            {
+                                status = KErrNotFound;
+                            }
+                            
+                            if(temp)
+                            {
+                                delete temp;
+                            }
+                        }//end if(status==KErrNone)
+                            
+                        free(key);
+                    }//end if(key)
+                }//end if(MapErr(res) == KErrNone)
+            }//end for
+        }//end if(aItem.GetNextString(index) == KErrNone)
+            
+        if((status == KErrNone) && (--index >= 0))
+        {
+            XAMetadataInfo *value = NULL;
+            XAuint32 valueSize;
+        
+            res = (*m_MetadataExtractionItf)->GetValueSize(
+                                   m_MetadataExtractionItf, index, &valueSize);  
+                
+            if(MapErr(res) == KErrNone)
+            {
+                value = (XAMetadataInfo *)calloc(valueSize,1);
+                if(value)
+                {
+                    res = (*m_MetadataExtractionItf)->GetValue(
+                            m_MetadataExtractionItf, index, valueSize, value);              
+                    status = MapErr(res);
+
+                    HBufC*   temp  = NULL;
+                    if(status == KErrNone)
+                    {
+                        if(value->encoding == XA_CHARACTERENCODING_ASCII)
+                        {
+                            TPtrC8 des((TUint8*)(value->data), value->size - 1 );
+                            temp = HBufC16::NewL(value->size - 1);
+                            TPtr tempPtr = temp->Des();
+                            tempPtr.Copy(des);
+                            iLog->Log( _L("Value[%d]: %S"), index, temp);
+                        }
+                        else if(value->encoding == XA_CHARACTERENCODING_UTF16LE)
+                        {
+                            TPtrC des((const TUint16*)value->data, value->size/2 - 1);
+                            temp = HBufC16::NewL(value->size/2 - 1);
+                            TPtr tempPtr = temp->Des();
+                            tempPtr.Copy(des);
+                            iLog->Log( _L("Value[%d]: %S"), index, temp);
+                       }
+                        else
+                        {
+                            iLog->Log( _L("Value[%d]: <Binary Value>"), index);
+                        }					
+
+                        if(value->encoding != XA_CHARACTERENCODING_BINARY)
+                        {            
+                            TPtrC expectedValue;
+                            if(aItem.GetNextString(expectedValue) == KErrNone)
+                            {            
+                                HBufC *pB = HBufC16::NewL(expectedValue.Size());
+                                TPtr tP = pB->Des();
+                                tP.Copy(expectedValue);
+                                iLog->Log( _L("Expected Value: %S"), pB);
+								iLog->Log(_L("Size: Expected(%d), Actual(%d)"),expectedValue.Size(), temp->Des().Size());
+                                delete pB;
+                                if(temp && !expectedValue.Compare(temp->Des()))
+                                {
+                                    status = KErrNone;
+                                }
+                                else
+                                {
+                                    status = KErrNotFound;
+                                }
+                            }
+                        }
+                               
+                        if(temp)
+                        {
+                            delete temp;
+                        }
+                    }//end if(status == KErrNone)
+                    delete value;
+                }//end if(value)
+            }//end if(MapErr(res) == KErrNone)
+        }//end if(status == KErrNone)   
+    }//end   if(m_MetadataExtractionItf)
+	
+    iLog->Log( _L("al_metadataextractionitf_GetValue (%d)<<"), status );
+    return status;
+}
+
+TInt COpenMAXALTestModule::al_metadataextractionitf_AddKeyFilter( CStifItemParser& /*aItem */)
+{
+    iLog->Log( _L("al_metadataextractionitf_AddKeyFilter >>") );
+    TInt status(KErrNotFound);
+    if(m_MetadataExtractionItf)
+    {
+		XAresult res = (*m_MetadataExtractionItf)->AddKeyFilter(m_MetadataExtractionItf,
+			        		                                       0, NULL, 0, NULL, 0, 0);
+		status = res;
+    }
+
+	iLog->Log( _L("al_metadataextractionitf_AddKeyFilter (%d)<<"), status );	
+
+	return status;
+}
+
+TInt COpenMAXALTestModule::al_metadataextractionitf_ClearKeyFilter( CStifItemParser& /*aItem*/ )
+{
+    iLog->Log( _L("al_metadataextractionitf_ClearKeyFilter >>") );
+    TInt status(KErrNotFound);
+    if(m_MetadataExtractionItf)
+    {
+	    XAresult res    = (*m_MetadataExtractionItf)->ClearKeyFilter(m_MetadataExtractionItf);
+
+		status = res;
+    }
+
+	iLog->Log( _L("al_metadataextractionitf_ClearKeyFilter (%d)<<"), status );
+
+	return status;
+}
+
+TInt COpenMAXALTestModule::al_metadataextractionitf_GetCoverArt( CStifItemParser& /*aItem*/ )
+{
+    iLog->Log( _L("al_metadataextractionitf_GetCoverArt >>") );
+
+    TInt status(KErrNotFound);
+    XAresult res;
+    
+    if(m_MetadataExtractionItf)
+    {
+        XAuint32 numItems = 0;
+        res = (*m_MetadataExtractionItf)->GetItemCount(
+                    m_MetadataExtractionItf, &numItems);              
+
+        for(int i = 0; (i < numItems) && (MapErr(res) == KErrNone) ; i++)
+        {
+            XAuint32 keySize = 0;
+            res = (*m_MetadataExtractionItf)->GetKeySize(
+                        m_MetadataExtractionItf, i, &keySize);  
+                     
+            if(MapErr(res) == KErrNone)
+            {
+                XAMetadataInfo* key = (XAMetadataInfo *)calloc(keySize,1);
+                if(key)
+                {
+                    res = (*m_MetadataExtractionItf)->GetKey(
+                             m_MetadataExtractionItf, i, keySize, key);              
+
+                    if(MapErr(res) == KErrNone)
+                    {
+                        if( key->encoding == XA_CHARACTERENCODING_ASCII)
+                        {
+                            if(!strcmp((const char*)key->data, "attachedpicture"))
+                            {
+                                XAuint32 valueSize;
+                                res = (*m_MetadataExtractionItf)->GetValueSize(
+                                              m_MetadataExtractionItf, i, &valueSize);  
+                                if(MapErr(res) == KErrNone)
+                                {
+                                    XAMetadataInfo* value = (XAMetadataInfo *)calloc(valueSize,1);
+                                    if(value)
+                                    {
+                                        res = (*m_MetadataExtractionItf)->GetValue(
+                                                m_MetadataExtractionItf, i, valueSize, value);              
+                                        if((MapErr(res) == KErrNone) && 
+                                           (value->encoding == XA_CHARACTERENCODING_BINARY))
+                                        {
+                                            iLog->Log( _L("CoverArt[%d] Size: %d"), i, value->size );
+                                        }
+                                        free(value);
+                                    }
+                                
+                                    break;
+                                }
+                            }            
+                        }
+                        free(key);
+                    }
+                }
+             }
+        }// end for
+        
+        status = MapErr(res);
+    }//end if(m_MetadataExtractionItf)
+    
+    return status;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/player/openmaxalplayitftests.cpp	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,497 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains testclass implementation.
+*
+*/
+
+// [INCLUDE FILES] - do not remove
+#include <e32svr.h>
+#include <StifParser.h>
+#include <StifTestInterface.h>
+#include <StifTestEventInterface.h>
+#include "openmaxaltestmodule.h"
+#include "profileutilmacro.h"
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+void PlayItfCallback (
+    XAPlayItf caller,
+    void * pContext,
+    XAuint32 event);
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+TInt COpenMAXALTestModule::al_playitf_SetPlayState( CStifItemParser& aItem )
+    {
+    TInt status(KErrNone);
+    TInt state(0);
+    status = aItem.GetNextInt(state);
+    RET_ERR_IF_ERR(status);
+
+    if(m_PlayItf)
+        {
+        TAG_TIME_PROFILING_BEGIN;
+        status = (*m_PlayItf)->SetPlayState(
+                m_PlayItf, state);              
+        TAG_TIME_PROFILING_END;
+        PRINT_TO_CONSOLE_TIME_DIFF;
+        }
+    else
+        {
+        status = KErrNotFound;
+        }    
+    return status;
+    }
+
+TInt COpenMAXALTestModule::al_playitf_GetPlayState( CStifItemParser& aItem )
+    {
+    TInt status(KErrNone);
+    XAuint32 state;
+    TInt expectedState;
+    status = aItem.GetNextInt(expectedState);
+    RET_ERR_IF_ERR(status);
+
+    if (m_PlayItf)
+        {
+        status = (*m_PlayItf)->GetPlayState(
+                m_PlayItf, &state);              
+        if (!status)
+            {
+            if (state != expectedState)
+                {
+                status = KErrCompletion;
+                }
+            }
+        }
+    else
+        {
+        status = KErrNotFound;
+        }    
+    return status;
+    }
+
+TInt COpenMAXALTestModule::al_playitf_GetDurationNullParam( CStifItemParser& /*aItem*/ )
+    {
+    TInt status(KErrNone);
+    if (m_PlayItf)
+        {
+        status = (*m_PlayItf)->GetDuration(
+                m_PlayItf, NULL);              
+        }
+    else
+        {
+        status = KErrNotFound;
+        }    
+    return status;
+    }
+
+TInt COpenMAXALTestModule::al_playitf_GetDuration( CStifItemParser& aItem )
+    {
+    TInt status(KErrNone);
+    XAmillisecond duration;
+    TInt expectedDurationLowLimit;
+    TInt expectedDurationHighLimit;
+    TBool expectedRangeDefined(EFalse);
+    status = aItem.GetNextInt(expectedDurationLowLimit);
+    if (status == KErrNone)
+        {
+        status = aItem.GetNextInt(expectedDurationHighLimit);
+        if (status == KErrNone)
+            {
+            expectedRangeDefined = ETrue;
+            }
+        }
+    if (m_PlayItf)
+        {
+        status = (*m_PlayItf)->GetDuration(
+                m_PlayItf, &duration);              
+        if (status == XA_RESULT_SUCCESS)
+            {
+            iLog->Log(_L("COpenMAXALTestModule::al_playitf_GetDuration:Duration[%u]"), duration);
+            /* If duration does not fall between the range we expected fail the case */
+            if (expectedRangeDefined &&
+                    !((expectedDurationLowLimit <= duration) && (duration <= expectedDurationHighLimit)))
+                {
+                status = KErrCompletion;
+                }
+            }
+        }
+    else
+        {
+        status = KErrNotFound;
+        }    
+    return status;
+    }
+
+TInt COpenMAXALTestModule::al_playitf_GetPositionNullParam( CStifItemParser& /*aItem*/ )
+    {
+    TInt status(KErrNone);
+    if (m_PlayItf)
+        {
+        status = (*m_PlayItf)->GetPosition(
+                m_PlayItf, NULL);              
+        }
+    else
+        {
+        status = KErrNotFound;
+        }    
+    return status;
+    }
+
+TInt COpenMAXALTestModule::al_playitf_GetPosition( CStifItemParser& aItem )
+    {
+    TInt status(KErrNone);
+    TInt expectedPos;
+    TBool expectedPosDefined(EFalse);
+    XAmillisecond position;
+    status = aItem.GetNextInt(expectedPos);
+    if (status == KErrNone)
+        {
+        expectedPosDefined = ETrue;
+        }
+
+    if (m_PlayItf)
+        {
+        status = (*m_PlayItf)->GetPosition(
+                m_PlayItf, &position);
+        if (status == XA_RESULT_SUCCESS)
+            {
+            if (expectedPosDefined &&
+                (expectedPos != position))
+                {
+                status = KErrCompletion;
+                }
+            iLog->Log(_L("COpenMAXALTestModule::al_playitf_GetPosition:Position[%u]"), position);
+            }
+        }
+    else
+        {
+        status = KErrNotFound;
+        }
+    return status;
+    }
+
+TInt COpenMAXALTestModule::al_playitf_RegisterCallback( CStifItemParser& /*aItem*/ )
+    {
+    TInt status(KErrNone);
+    XAresult res;
+
+    if(m_PlayItf)
+        {
+        res = (*m_PlayItf)->RegisterCallback(
+                m_PlayItf, &PlayItfCallback, (void*)this);              
+        status = res;
+        }
+    else
+        {
+        status = KErrNotFound;
+        }    
+
+    return status;
+    }
+
+TInt COpenMAXALTestModule::al_playitf_SetCallbackEventMask( CStifItemParser& aItem )
+    {
+    TInt status(KErrNone);
+    TInt eventMask;
+    status = aItem.GetNextInt(eventMask);
+    RET_ERR_IF_ERR(status);
+
+    if(m_PlayItf)
+        {
+        status = (*m_PlayItf)->SetCallbackEventsMask(
+                m_PlayItf, eventMask);              
+        }
+    else
+        {
+        status = KErrNotFound;
+        }
+    return status;
+    }
+
+TInt COpenMAXALTestModule::al_playitf_GetCallbackEventMaskNullParam( CStifItemParser& /*aItem*/ )
+    {
+    TInt status(KErrNone);
+    if(m_PlayItf)
+        {
+        status = (*m_PlayItf)->GetCallbackEventsMask(
+                m_PlayItf, NULL);              
+        }
+    else
+        {
+        status = KErrNotFound;
+        }    
+
+    return status;
+    }
+
+TInt COpenMAXALTestModule::al_playitf_GetCallbackEventMask( CStifItemParser& aItem )
+    {
+    TInt status(KErrNone);
+    XAuint32 eventMask;
+    TInt expectedEventMask;
+    status = aItem.GetNextInt(expectedEventMask);
+    RET_ERR_IF_ERR(status);
+
+    if(m_PlayItf)
+        {
+        status = (*m_PlayItf)->GetCallbackEventsMask(
+                m_PlayItf, &eventMask);              
+        if (!status)
+            {
+            /* Fail if position is not expected*/
+            if (eventMask != expectedEventMask)
+                {
+                status = KErrCompletion;
+                }
+            }
+        }
+    else
+        {
+        status = KErrNotFound;
+        }    
+
+    return status;
+    }
+TInt COpenMAXALTestModule::al_playitf_SetMarkerPosition( CStifItemParser& aItem )
+    {
+    TInt status(KErrNone);
+    TInt pos(0);
+    status = aItem.GetNextInt(pos);
+    RET_ERR_IF_ERR(status);
+
+    if(m_PlayItf)
+        {
+        status = (*m_PlayItf)->SetMarkerPosition(
+                m_PlayItf, (XAmillisecond)pos);              
+        }
+    else
+        {
+        status = KErrNotFound;
+        }    
+    return status;
+    }
+
+TInt COpenMAXALTestModule::al_playitf_ClearMarkerPosition( CStifItemParser& /*aItem*/ )
+    {
+    TInt status(KErrNone);
+
+    if(m_PlayItf)
+        {
+        status = (*m_PlayItf)->ClearMarkerPosition(
+                m_PlayItf);              
+        }
+    else
+        {
+        status = KErrNotFound;
+        }    
+    return status;
+    }
+
+TInt COpenMAXALTestModule::al_playitf_GetMarkerPositionNullParam( CStifItemParser& /*aItem*/ )
+    {
+    TInt status(KErrNone);
+
+    if(m_PlayItf)
+        {
+        status = (*m_PlayItf)->GetMarkerPosition(
+                m_PlayItf, NULL);
+        }
+    else
+        {
+        status = KErrNotFound;
+        }    
+    return status;
+    }
+
+TInt COpenMAXALTestModule::al_playitf_GetMarkerPosition( CStifItemParser& aItem )
+    {
+    TInt status(KErrNone);
+    TInt expectedMarkerPos(0);
+    status = aItem.GetNextInt(expectedMarkerPos);
+    XAmillisecond markerPos;
+    RET_ERR_IF_ERR(status);
+
+    if(m_PlayItf)
+        {
+        status = (*m_PlayItf)->GetMarkerPosition(
+                m_PlayItf, &markerPos);
+        if (!status && (markerPos != expectedMarkerPos))
+            {
+            status = KErrCompletion;
+            }
+        }
+    else
+        {
+        status = KErrNotFound;
+        }    
+    return status;
+    }
+
+TInt COpenMAXALTestModule::al_playitf_SetPositionUpdatePeriod( CStifItemParser& aItem )
+    {
+    TInt status(KErrNone);
+    TInt pos(0);
+    status = aItem.GetNextInt(pos);
+    RET_ERR_IF_ERR(status);
+
+    if(m_PlayItf)
+        {
+        status = (*m_PlayItf)->SetPositionUpdatePeriod(
+                m_PlayItf, (XAmillisecond)pos);
+        }
+    else
+        {
+        status = KErrNotFound;
+        }    
+    return status;
+    }
+
+TInt COpenMAXALTestModule::al_playitf_GetPositionUpdatePeriodNullParam( CStifItemParser& /*aItem*/ )
+    {
+    TInt status(KErrNone);
+
+    if(m_PlayItf)
+        {
+        status = (*m_PlayItf)->GetPositionUpdatePeriod(
+                m_PlayItf, NULL);
+        }
+    else
+        {
+        status = KErrNotFound;
+        }    
+    return status;
+    }
+
+TInt COpenMAXALTestModule::al_playitf_GetPositionUpdatePeriod( CStifItemParser& aItem )
+    {
+    TInt status(KErrNone);
+    TInt expectedMarkerPos(0);
+    status = aItem.GetNextInt(expectedMarkerPos);
+    XAmillisecond markerPos;
+    RET_ERR_IF_ERR(status);
+
+    if(m_PlayItf)
+        {
+        status = (*m_PlayItf)->GetPositionUpdatePeriod(
+                m_PlayItf, &markerPos);
+        if (!status && (markerPos != expectedMarkerPos))
+            {
+            status = KErrCompletion;
+            }
+        }
+    else
+        {
+        status = KErrNotFound;
+        }    
+    return status;
+    }
+
+void COpenMAXALTestModule::HandlePlayItfCallback( XAPlayItf /*caller*/, XAuint32 event )
+    {
+    switch (event)
+        {
+        case XA_PLAYEVENT_HEADATEND:
+            {
+            TEventIf event( TEventIf::ESetEvent, _L("Event_XA_PLAYEVENT_HEADATEND") );
+            TestModuleIf().Event( event );
+            }
+            break;
+        case XA_PLAYEVENT_HEADATMARKER:
+            {
+            TEventIf event( TEventIf::ESetEvent, _L("Event_XA_PLAYEVENT_HEADATMARKER") );
+            TestModuleIf().Event( event );
+            }
+            break;
+        case XA_OBJECT_EVENT_RESOURCES_LOST:
+            {
+            TEventIf event( TEventIf::ESetEvent, _L("Event_XA_OBJECT_EVENT_RESOURCES_LOST") );
+            TestModuleIf().Event( event );
+            }
+            break;
+        case XA_PLAYEVENT_HEADATNEWPOS:
+            {
+            iLog->Log(_L("COpenMAXALTestModule::HandlePlayItfCallback:XA_PLAYEVENT_HEADATNEWPOS"));
+            }
+            break;
+        case XA_PLAYEVENT_HEADMOVING:
+            {
+            TEventIf event( TEventIf::ESetEvent, _L("Event_XA_PLAYEVENT_HEADMOVING") );
+            TestModuleIf().Event( event );
+            }
+            break;
+        case XA_PLAYEVENT_HEADSTALLED:
+            {
+            TEventIf event( TEventIf::ESetEvent, _L("Event_XA_PLAYEVENT_HEADSTALLED") );
+            TestModuleIf().Event( event );
+            }
+            break;
+        default:
+            break;
+        }
+    }
+
+void PlayItfCallback (
+    XAPlayItf caller,
+    void * pContext,
+    XAuint32 event)
+    {
+    if (pContext)
+        {
+        ((COpenMAXALTestModule*)pContext)->HandlePlayItfCallback(caller, event);
+        }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/player/openmaxalseekitftests.cpp	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,150 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+* 
+* Description: This file contains testclass implementation.
+*
+*/
+
+// [INCLUDE FILES] - do not remove
+#include <e32svr.h>
+#include <StifParser.h>
+#include <StifTestInterface.h>
+#include <StifTestEventInterface.h>
+#include "openmaxaltestmodule.h"
+#include "profileutilmacro.h"
+
+// EXTERNAL DATA STRUCTURES
+//extern  ?external_data;
+
+// EXTERNAL FUNCTION PROTOTYPES  
+//extern ?external_function( ?arg_type,?arg_type );
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// LOCAL CONSTANTS AND MACROS
+//const ?type ?constant_var = ?constant;
+//#define ?macro_name ?macro_def
+
+// MODULE DATA STRUCTURES
+//enum ?declaration
+//typedef ?declaration
+
+// LOCAL FUNCTION PROTOTYPES
+//?type ?function_name( ?arg_type, ?arg_type );
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ?function_name ?description.
+// ?description
+// Returns: ?value_1: ?description
+//          ?value_n: ?description_line1
+//                    ?description_line2
+// -----------------------------------------------------------------------------
+//
+/*
+?type ?function_name(
+    ?arg_type arg,  // ?description
+    ?arg_type arg)  // ?description
+    {
+
+    ?code  // ?comment
+
+    // ?comment
+    ?code
+    }
+*/
+
+TInt COpenMAXALTestModule::al_seekitf_SetPosition( CStifItemParser& aItem )
+    {
+    TInt status(KErrNone);
+    TInt seekMode(0);
+    TInt position(0);
+
+    status = aItem.GetNextInt(position);
+    RET_ERR_IF_ERR(status);
+        
+    status = aItem.GetNextInt(seekMode);
+    RET_ERR_IF_ERR(status);
+
+    if(m_SeekItf)
+        {
+        TAG_TIME_PROFILING_BEGIN;
+        status = (*m_SeekItf)->SetPosition(
+                m_SeekItf, position, seekMode);              
+        TAG_TIME_PROFILING_END;
+        PRINT_TO_CONSOLE_TIME_DIFF;
+        }
+    else
+        {
+        status = KErrNotFound;
+        }    
+    return status;
+    }
+
+TInt COpenMAXALTestModule::al_seekitf_SetLoop( CStifItemParser& aItem )
+    {
+    TInt status(KErrNone);
+    TInt loopEnable(0);
+    TInt startPos(0);
+    TInt endPos(0);
+    
+    status = aItem.GetNextInt(loopEnable);
+    RET_ERR_IF_ERR(status);
+        
+    status = aItem.GetNextInt(startPos);
+    RET_ERR_IF_ERR(status);    
+    
+    status = aItem.GetNextInt(endPos);
+    RET_ERR_IF_ERR(status);
+
+    if (m_SeekItf)
+        {
+        status = (*m_SeekItf)->SetLoop(
+                m_SeekItf, loopEnable, startPos, endPos );              
+        }
+    else
+        {
+        status = KErrNotFound;
+        }    
+    return status;
+    }
+
+TInt COpenMAXALTestModule::al_seekitf_GetLoop( CStifItemParser& /*aItem*/ )
+    {
+    TInt status(KErrNone);
+    XAboolean loopEnable;
+    XAuint32 startPos(0);
+    XAuint32 endPos(0);
+    
+    if (m_SeekItf)
+        {
+        status = (*m_SeekItf)->GetLoop(
+                m_SeekItf, &loopEnable, &startPos, &endPos);
+        iLog->Log(_L("al_seekitf_GetLoop loopEnable[%d]"),loopEnable);
+        iLog->Log(_L("al_seekitf_GetLoop startPos[%d]"),startPos);
+        iLog->Log(_L("al_seekitf_GetLoop endPos[%d]"),endPos);
+        }
+    else
+        {
+        status = KErrNotFound;
+        }    
+    return status;
+    }
+
--- a/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/recorder/openmaxalaudioencoderitftests.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/recorder/openmaxalaudioencoderitftests.cpp	Fri May 14 16:22:35 2010 +0300
@@ -77,54 +77,62 @@
     XAAudioEncoderSettings setting;
     TUint value(0);
     TInt i(0);
+    TInt numItems;
     
-    while(aItem.GetNextInt(value) == KErrNone)
+    status = aItem.GetNextInt(numItems);
+    
+    while((numItems != 0) && (status == KErrNone))
         {
-        switch(i)
+        status = aItem.GetNextInt(value);
+        if(!status)
             {
-            case 0:
-                setting.encoderId = value;
-                break;
-            case 1:
-                setting.channelsIn = value;
-                break;
-            case 2:
-                setting.channelsOut = value;
-                break;
-            case 3:
-                setting.sampleRate = value;
-                break;
-            case 4:
-                setting.bitRate = value;
-                break;
-            case 5:
-                setting.bitsPerSample = value;
-                break;
-            case 6:
-                setting.rateControl = value;
-                break;
-            case 7:
-                setting.profileSetting = value;
-                break;
-            case 8:
-                setting.levelSetting = value;
-                break;
-            case 9:
-                setting.channelMode = value;
-                break;
-            case 10:
-                setting.streamFormat = value;
-                break;
-            case 11:
-                setting.encodeOptions = value;
-                break;
-            case 12:
-                setting.blockAlignment = value;
-                break;
-            default:
-                break;
+            switch(i)
+                {
+                case 0:
+                    setting.encoderId = value;
+                    break;
+                case 1:
+                    setting.channelsIn = value;
+                    break;
+                case 2:
+                    setting.channelsOut = value;
+                    break;
+                case 3:
+                    setting.sampleRate = value;
+                    break;
+                case 4:
+                    setting.bitRate = value;
+                    break;
+                case 5:
+                    setting.bitsPerSample = value;
+                    break;
+                case 6:
+                    setting.rateControl = value;
+                    break;
+                case 7:
+                    setting.profileSetting = value;
+                    break;
+                case 8:
+                    setting.levelSetting = value;
+                    break;
+                case 9:
+                    setting.channelMode = value;
+                    break;
+                case 10:
+                    setting.streamFormat = value;
+                    break;
+                case 11:
+                    setting.encodeOptions = value;
+                    break;
+                case 12:
+                    setting.blockAlignment = value;
+                    break;
+                default:
+                    break;
+                }
             }
         i++;
+        numItems--;
         }
 
     if(m_AudEncItf)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/openmax_al_ext_api/group/bld.inf	Fri May 14 16:22:35 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 Extension headers
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+#ifdef FF_OPENMAX_AL
+../inc/xanokiavolumeextitf.h        MW_LAYER_PLATFORM_EXPORT_PATH(khronos/xanokiavolumeextitf.h)
+../inc/xanokialinearvolumeitf.h     MW_LAYER_PLATFORM_EXPORT_PATH(khronos/xanokialinearvolumeitf.h)
+../readme_ext.txt                   MW_LAYER_PLATFORM_EXPORT_PATH(khronos/readme_ext.txt)
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/openmax_al_ext_api/inc/xanokialinearvolumeitf.h	Fri May 14 16:22:35 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 _XANOKIALINEARVOLUMEITF_H_
+#define _XANOKIALINEARVOLUMEITF_H_
+
+#include "OpenMAXAL.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* NOKIA LINEAR VOLUME */
+
+#define XA_NOKIALINEARVOLUME_EVENT_VOLUME_CHANGED          ((XAuint32) 0x00000001)
+
+XA_API extern const XAInterfaceID XA_IID_NOKIALINEARVOLUME;
+
+struct XANokiaLinearVolumeItf_;
+typedef const struct XANokiaLinearVolumeItf_ * const * XANokiaLinearVolumeItf;
+
+typedef void (XAAPIENTRY * xaNokiaLinearVolumeCallback) (
+    XANokiaLinearVolumeItf caller,
+    void * pContext,
+    XAuint32 event,
+    XAboolean eventBooleanData
+);
+
+struct XANokiaLinearVolumeItf_ {
+    XAresult (*SetVolumeLevel) (
+        XANokiaLinearVolumeItf self,
+        XAuint32 * pPercentage
+    );
+    XAresult (*GetVolumeLevel) (
+        XANokiaLinearVolumeItf self,
+        XAuint32 * pPercentage
+    );
+    XAresult (*GetStepCount) (
+        XANokiaLinearVolumeItf self,
+        XAuint32 * pStepCount
+    );
+    XAresult (*RegisterVolumeCallback) (
+        XANokiaLinearVolumeItf self,
+        xaNokiaLinearVolumeCallback callback, 
+        void * pContext
+    );
+    XAresult (*SetCallbackEventsMask) (
+        XANokiaLinearVolumeItf self,
+        XAuint32 eventFlags
+    );
+    XAresult (*GetCallbackEventsMask) (
+        XANokiaLinearVolumeItf self,
+        XAuint32 * pEventFlags
+    );
+};
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* _XANOKIALINEARVOLUMEITF_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/openmax_al_ext_api/inc/xanokiavolumeextitf.h	Fri May 14 16:22:35 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 _XANOKIAVOLUMEEXTITF_H_
+#define _XANOKIAVOLUMEEXTITF_H_
+
+#include "OpenMAXAL.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* NOKIA VOLUME */
+
+#define XA_NOKIAVOLUMEEXT_EVENT_VOLUME_CHANGED          ((XAuint32) 0x00000001)
+#define XA_NOKIAVOLUMEEXT_EVENT_MUTE_CHANGED      		((XAuint32) 0x00000002)
+#define XA_NOKIAVOLUMEEXT_EVENT_STEREO_POSITION_CHANGED ((XAuint32) 0x00000004)
+
+XA_API extern const XAInterfaceID XA_IID_NOKIAVOLUMEEXT;
+
+struct XANokiaVolumeExtItf_;
+typedef const struct XANokiaVolumeExtItf_ * const * XANokiaVolumeExtItf;
+
+typedef void (XAAPIENTRY * xaNokiaVolumeExtCallback) (
+    XANokiaVolumeExtItf caller,
+    void * pContext,
+    XAuint32 event,
+    XAboolean eventBooleanData
+);
+
+struct XANokiaVolumeExtItf_ {
+    XAresult (*SetVolumeLevel) (
+        XANokiaVolumeExtItf self,
+        XAmillibel level
+    );
+    XAresult (*GetVolumeLevel) (
+        XANokiaVolumeExtItf self,
+        XAmillibel * pLevel
+    );
+    XAresult (*GetMaxVolumeLevel) (
+        XANokiaVolumeExtItf self,
+        XAmillibel * pMaxLevel
+    );
+    XAresult (*SetMute) (
+        XANokiaVolumeExtItf self,
+        XAboolean mute
+    );
+    XAresult (*GetMute) (
+        XANokiaVolumeExtItf self,
+        XAboolean * pMute
+    );
+    XAresult (*EnableStereoPosition) (
+        XANokiaVolumeExtItf self,
+        XAboolean enable
+    );
+    XAresult (*IsEnabledStereoPosition) (
+        XANokiaVolumeExtItf self,
+        XAboolean * pEnable
+    );
+    XAresult (*SetStereoPosition) (
+        XANokiaVolumeExtItf self,
+        XApermille stereoPosition
+    );
+    XAresult (*GetStereoPosition) (
+        XANokiaVolumeExtItf self,
+        XApermille * pStereoPosition
+    );
+    XAresult (*RegisterVolumeCallback) (
+        XANokiaVolumeExtItf self,
+        xaNokiaVolumeExtCallback callback, 
+        void * pContext
+    );
+    XAresult (*SetCallbackEventsMask) (
+        XANokiaVolumeExtItf self,
+        XAuint32 eventFlags
+    );
+    XAresult (*GetCallbackEventsMask) (
+        XANokiaVolumeExtItf self,
+        XAuint32 * pEventFlags
+    );
+};
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* _XANOKIAVOLUMEEXTITF_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/openmax_al_ext_api/openmax_al_ext_api.metaxml	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<api id="429a389f5c9afb70c9b789bc52ebaa7d" dataversion="2.0">
+  <name>openmax_al_ext_api</name>
+  <description>This API provides extension to Khronos OpenMAX AL.</description>
+  <type>c++</type>
+  <collection>khronosfws</collection>
+  <libs>
+    <lib name="openmaxal.lib"/>
+  </libs>
+  <release category="platform" sinceversion="^4"/>
+  <attributes>
+    <htmldocprovided>no</htmldocprovided>
+    <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/openmax_al_ext_api/readme_ext.txt	Fri May 14 16:22:35 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/progressive_download_api/group/bld.inf	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +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 
-:                Progressive Download API
-*
-*/
-
-
-#include <platform_paths.hrh>
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_EXPORTS
-
-#ifdef __SERIES60_NATIVE_BROWSER
-#ifdef RD_PROGDOWNLOAD
-../inc/MAudioPlayUtility.h     MW_LAYER_PLATFORM_EXPORT_PATH(MAudioPlayUtility.h)
-../inc/ProgressiveDownloadUtility.h     MW_LAYER_PLATFORM_EXPORT_PATH(ProgressiveDownloadUtility.h)
-../inc/MProgressiveDownloadUtility.h     MW_LAYER_PLATFORM_EXPORT_PATH(MProgressiveDownloadUtility.h)
-../inc/MAudioPdPlayUtility.h     MW_LAYER_PLATFORM_EXPORT_PATH(MAudioPdPlayUtility.h)
-#endif
-#endif
--- a/mmmw_plat/progressive_download_api/inc/MAudioPdPlayUtility.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
-* Copyright (c) 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:  Interface definition for the ProgressiveDownloadUtility functions.
-*
-*/
-
-
-#ifndef __MAUDIOPDPLAYUTILITY_H__
-#define __MAUDIOPDPLAYUTILITY_H__
-
-#include <e32std.h>
-#include <e32base.h>
-#include "MProgressiveDownloadUtility.h"
-#include "MAudioPlayUtility.h"
-
-
-
-
-class MAudioPdPlayUtilityCallback: public MProgressiveDownloadUtilityCallback, 
-                                   public MMdaAudioPlayerCallback
-	{
-	public:
-		virtual void HandleDownloadEventL(TUint aTransactionID,                 
-                                          TBrCtlDownloadEvent aEvent,
-                                          TUint aValue)=0;
-		
-	};
-
-class MAudioPdPlayUtility:public MProgessiveDownloadUtility, 
-                          public MAudioPlayUtility
-	{
-	public:
-		virtual ~MAudioPdPlayUtility(){};
-		
-	};
-
-
-
-#endif
--- a/mmmw_plat/progressive_download_api/inc/MAudioPlayUtility.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
-* Copyright (c) 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:  Interface definition for the ProgressiveDownloadUtility functions.
-*
-*/
-
-
-
-#ifndef __MAUDIOPLAYUTILITY_H__
-#define __MAUDIOPLAYUTILITY_H__
-
-#include <e32std.h>
-#include <e32base.h>
-#include <mdaaudiosampleplayer.h>
-#include <mmf/common/mmfcontroller.h>
-#include <mmf/server/mmffile.h>
-#include <mmf/server/mmfdes.h>
-#include <mmfcontrollerimplementationuids.hrh>
-#include <mmf/common/mmfstandardcustomcommands.h>
-#include <mmf/common/mmfdrmcustomcommands.h>
-
-#include <bldvariant.hrh>
-
-class MAudioPlayUtility
-	{
-	public:
-      
-	 virtual void Play()=0;
-	 virtual void Stop()=0;
-	 virtual TInt Pause()=0;
-	 virtual void SetVolume(TInt aVolume)=0;
-	 virtual void SetRepeats(TInt aRepeatNumberOfTimes, const TTimeIntervalMicroSeconds& aTrailingSilence)=0;
-	 virtual void SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration)=0;
-	 virtual const TTimeIntervalMicroSeconds& Duration()=0;
-	 virtual TInt MaxVolume()=0;	
-	 virtual void Close()=0;
-	 virtual TInt GetPosition(TTimeIntervalMicroSeconds& aPosition)=0;
-	 virtual void SetPosition(const TTimeIntervalMicroSeconds& aPosition)=0;
-
-	 virtual TInt SetPriority(TInt aPriority, TMdaPriorityPreference aPref)=0;
-	 virtual TInt GetVolume(TInt& aVolume)=0;
-	 virtual TInt GetNumberOfMetaDataEntries(TInt& aNumEntries)=0;
-	 virtual CMMFMetaDataEntry* GetMetaDataEntryL(TInt aMetaDataIndex)=0;
-	 virtual TInt SetPlayWindow(const TTimeIntervalMicroSeconds& aStart,
-								const TTimeIntervalMicroSeconds& aEnd)=0;
-	 virtual TInt ClearPlayWindow()=0;
-	 virtual TInt SetBalance(TInt aBalance = KMMFBalanceCenter)=0;
-	 virtual TInt GetBalance(TInt& aBalance)=0;
-	 virtual TInt GetBitRate(TUint& aBitRate)=0;
-	
-	 virtual void RegisterForAudioLoadingNotification(MAudioLoadingObserver& aCallback)=0;
-	 virtual void GetAudioLoadingProgressL(TInt& aPercentageProgress)=0;
-	 virtual const CMMFControllerImplementationInformation& ControllerImplementationInformationL()=0;
-	
-	 virtual TInt CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom)=0;
-	 virtual TInt CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2)=0;
-	 virtual void CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom, TRequestStatus& aStatus)=0;
-	 virtual void CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TRequestStatus& aStatus)=0;
-
-
-	 virtual MMMFDRMCustomCommand* GetDRMCustomCommand()=0;
-
-
-	};
-	
-#endif
--- a/mmmw_plat/progressive_download_api/inc/MProgressiveDownloadUtility.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
-* Copyright (c) 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:  Interface definition for the ProgressiveDownloadUtility functions.
-*
-*/
-
-
-
-#ifndef __MPROGRESSIVEDOWNLOADUTILITY_H__
-#define __MPROGRESSIVEDOWNLOADUTILITY_H__
-
-
-#include <BrCtlDownloadObserver.h>
-
-
-class MProgessiveDownloadUtility//:public MBrCtlDownloadObserver
-	{
-	public:
-	   virtual void HandleDownloadEventL(TUint aTransactionID,                 
-                                         TBrCtlDownloadEvent aEvent,
-                                         TUint aValue)=0;
-	};
-	
-	
-class MProgressiveDownloadUtilityCallback
-	{
-	public:
-	    virtual void Paused()=0;
-	   	virtual void Playing()=0;	
-	   
-	};
-
-	
-#endif
\ No newline at end of file
--- a/mmmw_plat/progressive_download_api/inc/ProgressiveDownloadUtility.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-/*
-* Copyright (c) 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:  Class definition for the ProgressiveDownloadUtility functions.
-*
-*/
-
-#ifndef __CPROGRESSIVEDOWNLOADUTILITY_H__
-#define __CPROGRESSIVEDOWNLOADUTILITY_H__
-
-#include <e32std.h>
-#include <e32base.h>
-#include <f32file.h>
-
-
-//Forward Declaration
-class MAudioPdPlayUtility;
-class MAudioPdPlayUtilityCallback;
-class CPdProperties;
-
-
-// CLASS DEFINITIONS
-
-/**
-*  This class provides Progressive download utility functions.
-*
-*  @lib ProgressiveDownloadUtility.lib
-*  @since 3.0
-*/
-class CProgressiveDownloadUtility: public CBase 
-	{
-
-public:
-    /**
-    * Two-phased constructor.
-    */
-	IMPORT_C static CProgressiveDownloadUtility* NewL();
-
-	/**
-    * Destructor.
-    */
-	IMPORT_C virtual ~CProgressiveDownloadUtility();
-
-    /**
-    * From CProgressiveDownloadUtility
-    * @param aFileName
-	* @param aCallback
-	* @return MAudioPdPlayUtility*
-	*/	
-	IMPORT_C MAudioPdPlayUtility* OpenL(const TDesC& aFileName,MAudioPdPlayUtilityCallback& aCallback);
-
-    /**
-    * From CProgressiveDownloadUtility
-    * @param aFileHandle
-	* @param aCallback
-	* @return MAudioPdPlayUtility*
-	*/			
-	IMPORT_C MAudioPdPlayUtility* OpenL(const RFile& aFileHandle,MAudioPdPlayUtilityCallback& aCallback);
-	
-protected:
-
-	
-private:
-	/**
-    * C++ default constructor.
-    */
-	CProgressiveDownloadUtility();
-
-	/**
-    * By default Symbian 2nd phase constructor is private.
-    */
-	void ConstructL();
-
-	CPdProperties* iProperties;
-   
-	}; 
-
-#endif
--- a/mmmw_plat/progressive_download_api/progressive_download_api.metaxml	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-<?xml version="1.0" ?>
-<api id="243bbea558d980d70cbe5812cadfba64" dataversion="2.0">
-  <name>Progressive Download API</name>
-  <description>An API for playing back an audio file that is currently being downloaded.</description>
-  <type>c++</type>
-  <collection>audioenhancements</collection>
-  <libs>
-    <lib name="ProgressiveDownloadUtility.lib" />
-  </libs>
-  <release category="platform" deprecatedsince="0"/>
-  <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/system_tone_service_api/inc/systemtoneservice.h	Mon May 03 12:59:52 2010 +0300
+++ b/mmmw_plat/system_tone_service_api/inc/systemtoneservice.h	Fri May 14 16:22:35 2010 +0300
@@ -20,8 +20,8 @@
  *
  */
 
-#ifndef __SYSTEMTONESERVICE_H__
-#define __SYSTEMTONESERVICE_H__
+#ifndef SYSTEMTONESERVICE_H_
+#define SYSTEMTONESERVICE_H_
 
 // System includes
 #include <e32base.h>
@@ -29,6 +29,27 @@
 // Forward declarations
 NONSHARABLE_CLASS( CStsImplementation);
 
+//Observer declaration
+/**
+ *  Play Alarm Observer API definition.
+ *  This defines the interface that must be implemented by Play Alarm
+ *  Observers.
+ *
+ */
+class MStsPlayAlarmObserver
+    {
+public:
+    /**
+     * Informs the observer when the play alarm as indicated by the alarm
+     * context is complete.  This method will not be called when this alarm
+     * associated with the alarm context has been stopped with the StopAlarm
+     * method.
+     *
+     * @param aAlarmContext The context of the alarm that has completed.
+     */
+    virtual void PlayAlarmComplete(unsigned int aAlarmContext) = 0;
+    };
+
 // Class declaration
 /**
  *  System Tone Service API definition.
@@ -44,12 +65,12 @@
  *       ...
  *       sts->PlayTone(CSystemToneService::EWarningTone);
  *       ...
- *       sts->Playtone(CSystemToneService::ECalendarAlarm, &calendarAlarmContext);
+ *       sts->PlayAlarm(CSystemToneService::ECalendarAlarm, &calendarAlarmContext);
+ *       ...
+ *       sts->StopAlarm(calendarAlarmContext);
  *       ...
  *   }
  *   ...
- *   sts->StopTone(calendarAlarmContext);
- *   ...
  *   CSystemToneService::Delete(sts);
  *  @endcode
  *
@@ -68,59 +89,65 @@
     /** The type of System Tones that are supported by this API. */
     enum TToneType
         {
-        // Calendar Tones
-        ECalendarAlarm = 0x0001,
-        EClockAlarm = 0x0002,
-        EToDoAlarm = 0x0003,
-
         // Capture Tones
-        EBurstMode = 0x1001,
-        ECapture = 0x1002,
-        ECallRecording = 0x1003,
-        ERecordingStart = 0x1004,
-        ERecordingStop = 0x1005,
-        ESelfTimer = 0x1006,
+        EBurstMode = 0x0001,
+        ECapture = 0x0002,
+        ECallRecording = 0x0003,
+        ERecordingStart = 0x0004,
+        ERecordingStop = 0x0005,
+        ESelfTimer = 0x0006,
 
         // General Tones
-        EConfirmationBeep = 0x2001,
-        EDefaultBeep = 0x2002,
-        EErrorBeep = 0x2003,
-        EInformationBeep = 0x2004,
-        EWarningBeep = 0x2005,
-        EIntegratedHandsFreeActivated = 0x2006,
+        EConfirmationBeep = 0x0101,
+        EDefaultBeep = 0x0102,
+        EErrorBeep = 0x0103,
+        EInformationBeep = 0x0104,
+        EWarningBeep = 0x0105,
+        EIntegratedHandsFreeActivated = 0x0106,
 
         // Key Tones
-        ETouchScreen = 0x3001,
+        ETouchScreen = 0x0201,
 
         // Location Tones
-        ELocationRequest = 0x4001,
+        ELocationRequest = 0x0301,
 
         // Messaging Tones
-        EChatAlert = 0x5001,
-        EEmailAlert = 0x5002,
-        EMmsAlert = 0x5003,
-        ESmsAlert = 0x5004,
-        EDeliveryReport = 0x5005,
-        EMessageSendFailure = 0x5006,
+        EChatAlert = 0x0401,
+        EEmailAlert = 0x0402,
+        EMmsAlert = 0x0403,
+        ESmsAlert = 0x0404,
+        EDeliveryReport = 0x0405,
+        EMessageSendFailure = 0x0406,
 
         // Power Tones
-        EBatteryLow = 0x6001,
-        EBatteryRecharged = 0x6002,
-        EPowerOn = 0x6003,
-        EPowerOff = 0x6004,
-        EWakeUp = 0x6005,
-        EWrongCharger = 0x6006,
+        EBatteryLow = 0x0501,
+        EBatteryRecharged = 0x0502,
+        EPowerOn = 0x0503,
+        EPowerOff = 0x0504,
+        EWakeUp = 0x0505,
+        EWrongCharger = 0x0506,
 
         // Telephony Tones
-        EIncomingCall = 0x7001,
-        EIncomingCallLine2 = 0x7002,
-        EIncomingDataCall = 0x7003,
-        EAutomaticRedialComplete = 0x7004,
+        EAutomaticRedialComplete = 0x0604,
 
         // Voice Recognition Tones
-        EVoiceStart = 0x8001,
-        EVoiceError = 0x8002,
-        EVoiceAbort = 0x8003
+        EVoiceStart = 0x0701,
+        EVoiceError = 0x0702,
+        EVoiceAbort = 0x0703
+        };
+
+    /** The type of System Alarms that are supported by this API. */
+    enum TAlarmType
+        {
+        // Calendar Alarms
+        ECalendarAlarm = 0x8001,
+        EClockAlarm = 0x8002,
+        EToDoAlarm = 0x8003,
+
+        // Telephony Alarms
+        EIncomingCall = 0x8101,
+        EIncomingCallLine2 = 0x8102,
+        EIncomingDataCall = 0x8103
         };
 
     /**
@@ -129,30 +156,28 @@
      * to play to completion and do not need to be stopped by the client.
      *
      * @param aTone An input parameter that indicates the type of tone to play.
-     * @return description
      */
     IMPORT_C void PlayTone(TToneType aTone);
 
     /**
-     * Plays the specified tone.  If the tone type is not recognized a default tone will
-     * be played.  This method is used for tones that may not be fixed duration such as
-     * infinitely looping tones, or for tones that can be manually stopped by the client.
+     * Plays the specified alarm.  If the alarm type is not recognized a default alarm will
+     * be played.  Alarms are tones that are not fixed duration such as a calendar alarm
+     * that can be manually stopped by the client, or the client needs to know when the alarm
+     * has completed playing.
      *
-     * @param aTone An input parameter that indicates the type of tone to play.
-     * @param aPlayToneContext An output parameter that provides back a unique context to
-     *  the client for this tone play that can be used for stopping the playback.
-     * @return description
+     * @param aAlarn An input parameter that indicates the type of alarm to play.
+     * @param aAlarmContext An output parameter that provides back a unique context to
+     *  the client for this alarm that can be used for stopping the alarm.
      */
-    IMPORT_C void PlayTone(TToneType aTone, unsigned int& aPlayToneContext);
+    IMPORT_C void PlayAlarm(TAlarmType aAlarm, unsigned int& aAlarmContext, MStsPlayAlarmObserver& aObserver);
 
     /**
-     * Stops the specified tone playback.  If the playback has already completed or the
-     * context is not recognized, this method does nothing.
+     * Stops the specified alarm playback.  If the playback has already completed or the
+     * context is not valid, this method does nothing.
      *
-     * @param aPlayToneContext The context to the Tone Playing that is to be stopped.
-     * @return description
+     * @param aAlarmContext The context to the alarm that is to be stopped.
      */
-    IMPORT_C void StopTone(unsigned int aPlayToneContext);
+    IMPORT_C void StopAlarm(unsigned int aAlarmContext);
 
 protected:
     // Protected constructors and destructors
@@ -167,4 +192,4 @@
     CStsImplementation& iImplementation;
     };
 
-#endif  // __SYSTEMTONESERVICE_H__
+#endif  // SYSTEMTONESERVICE_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/system_tone_service_api/system_tone_service_api.metaxml	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<api id="80ba9722d6ed1f7c0d543739e4709a6a" dataversion="2.0">
+  <name>System Tone Service API</name>
+  <description>Native API for applications and middleware to easily play system tones and alarms.</description>
+  <type>c++</type>
+  <collection>mmserv</collection>
+  <libs>
+    <lib name="systemtoneservice.lib"/>
+  </libs>
+  <release category="platform" sinceversion="^4"/>
+  <attributes>
+    <htmldocprovided>no</htmldocprovided>
+    <adaptation>no</adaptation>
+  </attributes>
+</api>
--- a/mmmw_plat/system_tone_service_api/tsrc/conf/systemtoneservicestif.cfg	Mon May 03 12:59:52 2010 +0300
+++ b/mmmw_plat/system_tone_service_api/tsrc/conf/systemtoneservicestif.cfg	Fri May 14 16:22:35 2010 +0300
@@ -1,49 +1,72 @@
+//
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+// Description: Example test case for calendar alarm
+//
+//
+
 [Define]
-CalendarAlarm 								1
-ClockAlarm 										2
-ToDoAlarm 										3
-BurstMode 			  						4097
-Capture  											4098
-CallRecording  								4099
-RecordingStart  							4100
-RecordingStop  								4101
-SelfTimer  										4102
-ConfirmationBeep 							8193
-DefaultBeep   								8194
-ErrorBeep  										8195
-InformationBeep  							8196
-WarningBeep  									8197
-IntegratedHandsFreeActivated 	8198
-TouchScreen  									12289
-LocationRequest  							16395
-ChatAlert  										20481
-EmailAlert  									20482
-MmsAlert  										20483
-SmsAlert  										20484
-DeliveryReport  							20485
-MessageSendFailure  					20486
-BatteryLow  									24577
-BatteryRecharged 							24578
-PowerOn  											24579
-PowerOff  										24580
-WakeUp  											24581
-WrongCharger  								24582
-IncomingCall  								28673
-IncomingCallLine2  						28674
-IncomingDataCall  						28675
-AutomaticRedialComplete  			28676
-VoiceStart  									32769
-VoiceError  									32770
-VoiceAbort  									32771
+CalendarAlarm 									32769			
+ClockAlarm 											32770			
+ToDoAlarm 											32771			
+
+BurstMode 			  							1			
+Capture  												2			
+CallRecording  									3			
+RecordingStart  								4			
+RecordingStop  									5			
+SelfTimer  											6			
+
+ConfirmationBeep 								257			
+DefaultBeep   									258			
+ErrorBeep  											259			
+InformationBeep  								260			
+WarningBeep  										261			
+IntegratedHandsFreeActivated 		262
+
+TouchScreen  									  513
+
+LocationRequest  							  769 
+
+ChatAlert  										  1025
+EmailAlert  									  1026
+MmsAlert  										  1027
+SmsAlert  										  1028
+DeliveryReport  							  1029
+MessageSendFailure  					  1030 
+
+BatteryLow  									  1281
+BatteryRecharged 							  1282
+PowerOn  											  1283
+PowerOff  										  1284
+WakeUp  											  1285
+WrongCharger  								  1286
+
+IncomingCall  								  33025
+IncomingCallLine2  						  33026 
+IncomingDataCall  						  33027
+
+AutomaticRedialComplete  			  1540
+
+VoiceStart  									  1793 
+VoiceError  									  1794
+VoiceAbort  									  1795
 [Enddefine]
 
 [Test]
 title NFT
 create systemtoneservicestif STSSTIF
 STSSTIF Create
-STSSTIF PlayToneWithContext ClockAlarm
+STSSTIF PlayAlarm ClockAlarm
 pause 10000
-STSSTIF StopTone True
+STSSTIF StopAlarm True
 STSSTIF Delete
 delete STSSTIF
 [Endtest]
@@ -63,7 +86,7 @@
 title 02 Play ClockAlarm Ringtone
 create systemtoneservicestif STSSTIF
 STSSTIF Create
-STSSTIF PlayTone  ClockAlarm
+STSSTIF PlayAlarm  ClockAlarm
 pause 5000
 STSSTIF Delete
 delete STSSTIF
@@ -74,7 +97,7 @@
 title 03 Play ClockAlarmContext Ringtone
 create systemtoneservicestif STSSTIF
 STSSTIF Create
-STSSTIF PlayToneWithContext ClockAlarm
+STSSTIF PlayAlarm ClockAlarm
 pause 10000
 STSSTIF Delete
 delete STSSTIF
@@ -84,9 +107,9 @@
 title 04 Stop ClockAlarm with recognized Context
 create systemtoneservicestif STSSTIF
 STSSTIF Create
-STSSTIF PlayToneWithContext ClockAlarm
+STSSTIF PlayAlarm ClockAlarm
 pause 10000
-STSSTIF StopTone True
+STSSTIF StopAlarm True
 pause 5000
 STSSTIF Delete
 delete STSSTIF
@@ -97,9 +120,9 @@
 title 05 Stop ClockAlarm with non-recognized Context
 create systemtoneservicestif STSSTIF
 STSSTIF Create
-STSSTIF PlayToneWithContext ClockAlarm
+STSSTIF PlayAlarm ClockAlarm
 pause 10000
-STSSTIF StopTone False
+STSSTIF StopAlarm False
 pause 5000
 STSSTIF Delete
 delete STSSTIF
@@ -110,11 +133,11 @@
 title 06 Play two tones
 create systemtoneservicestif STSSTIF
 STSSTIF Create
-STSSTIF PlayToneWithContext ClockAlarm
+STSSTIF PlayAlarm ClockAlarm
 pause 10000
 STSSTIF PlayTone CalendarAlarm
 pause 10000
-STSSTIF StopTone True
+STSSTIF StopAlarm True
 STSSTIF Delete
 delete STSSTIF
 [Endtest]
@@ -124,10 +147,10 @@
 title 07 Stop tone after tone complete
 create systemtoneservicestif STSSTIF
 STSSTIF Create
-STSSTIF PlayToneWithContext ClockAlarm
+STSSTIF PlayAlarm ClockAlarm
 pause 10000
-STSSTIF StopTone True
-STSSTIF StopTone True
+STSSTIF StopAlarm True
+STSSTIF StopAlarm True
 STSSTIF Delete
 delete STSSTIF
 [Endtest]
\ No newline at end of file
--- a/mmmw_plat/system_tone_service_api/tsrc/conf/systemtoneservicestif_calendaralarm.cfg	Mon May 03 12:59:52 2010 +0300
+++ b/mmmw_plat/system_tone_service_api/tsrc/conf/systemtoneservicestif_calendaralarm.cfg	Fri May 14 16:22:35 2010 +0300
@@ -13,13 +13,13 @@
 //
 
 
-
 [Test]
 title 1.1 Test CalendarAlarm Ringtone
 create systemtoneservicestif STSSTIF
 STSSTIF Create
-STSSTIF PlayTone  CalendarAlarm
+STSSTIF PlayAlarm  CalendarAlarm
 pause 5000
+STSSTIF StopAlarm  True
 STSSTIF Delete
 delete STSSTIF
 [Endtest]
@@ -29,9 +29,11 @@
 title 1.2 Test CalendarAlarmContext Ringtone
 create systemtoneservicestif STSSTIF
 STSSTIF Create
-STSSTIF PlayToneWithContext  CalendarAlarm
-pause 2000
-STSSTIF StopTone True
+request Event_PlayAlarmComplete
+STSSTIF PlayAlarm  CalendarAlarm
+wait Event_PlayAlarmComplete
+release Event_PlayAlarmComplete
+STSSTIF StopAlarm
 STSSTIF Delete
 delete STSSTIF
 [Endtest]
--- a/mmmw_plat/system_tone_service_api/tsrc/conf/systemtoneservicestif_common.cfg	Mon May 03 12:59:52 2010 +0300
+++ b/mmmw_plat/system_tone_service_api/tsrc/conf/systemtoneservicestif_common.cfg	Fri May 14 16:22:35 2010 +0300
@@ -13,44 +13,51 @@
 //
 
 [Define]
-CalendarAlarm 								1
-ClockAlarm 							 	2
-ToDoAlarm 								3
-BurstMode 			  					4097
-Capture  								4098
-CallRecording  								4099
-RecordingStart  							4100
-RecordingStop  								4101
-SelfTimer  								4102
-ConfirmationBeep 							8193
-DefaultBeep   								8194
-ErrorBeep  								8195
-InformationBeep  							8196
-WarningBeep  								8197
-IntegratedHandsFreeActivated 						8198
-TouchScreen  								12289
-LocationRequest  							16395
-ChatAlert  								20481
-EmailAlert  								20482
-MmsAlert  								20483
-SmsAlert  								20484
-DeliveryReport  							20485
-MessageSendFailure  							20486
-BatteryLow  								24577
-BatteryRecharged 							24578
-PowerOn  								24579
-PowerOff  								24580
-WakeUp  								24581
-WrongCharger  								24582
-IncomingCall  								28673
-IncomingCallLine2  							28674
-IncomingDataCall  							28675
-AutomaticRedialComplete  						28676
-VoiceStart  								32769
-VoiceError  								32770
-VoiceAbort  								32771
+CalendarAlarm 									32769			
+ClockAlarm 											32770			
+ToDoAlarm 											32771			
+
+BurstMode 			  							1			
+Capture  												2			
+CallRecording  									3			
+RecordingStart  								4			
+RecordingStop  									5			
+SelfTimer  											6			
+
+ConfirmationBeep 								257			
+DefaultBeep   									258			
+ErrorBeep  											259			
+InformationBeep  								260			
+WarningBeep  										261			
+IntegratedHandsFreeActivated 		262
+
+TouchScreen  									  513
+
+LocationRequest  							  769 
+
+ChatAlert  										  1025
+EmailAlert  									  1026
+MmsAlert  										  1027
+SmsAlert  										  1028
+DeliveryReport  							  1029
+MessageSendFailure  					  1030 
+
+BatteryLow  									  1281
+BatteryRecharged 							  1282
+PowerOn  											  1283
+PowerOff  										  1284
+WakeUp  											  1285
+WrongCharger  								  1286
+
+IncomingCall  								  33025
+IncomingCallLine2  						  33026 
+IncomingDataCall  						  33027
+
+AutomaticRedialComplete  			  1540
+
+VoiceStart  									  1793 
+VoiceError  									  1794
+VoiceAbort  									  1795
 [Enddefine]
 
 
-
-
--- a/mmmw_plat/system_tone_service_api/tsrc/group/systemtoneservicestif.mmp	Mon May 03 12:59:52 2010 +0300
+++ b/mmmw_plat/system_tone_service_api/tsrc/group/systemtoneservicestif.mmp	Fri May 14 16:22:35 2010 +0300
@@ -46,7 +46,7 @@
 SOURCEPATH      ../src
 
 SOURCE          systemtoneservicestif.cpp
-SOURCE          systemtoneservicestifBlocks.cpp
+SOURCE          systemtoneservicestifblocks.cpp
 
 
 LIBRARY         euser.lib
--- a/mmmw_plat/system_tone_service_api/tsrc/inc/systemtoneservicestif.h	Mon May 03 12:59:52 2010 +0300
+++ b/mmmw_plat/system_tone_service_api/tsrc/inc/systemtoneservicestif.h	Fri May 14 16:22:35 2010 +0300
@@ -23,6 +23,7 @@
 #include <TestScripterInternal.h>
 #include <StifTestModule.h>
 #include <TestclassAssert.h>
+#include <systemtoneservice.h>
 
 
 // CONSTANTS
@@ -46,7 +47,7 @@
 // FORWARD DECLARATIONS
 
 class CSystemToneServiceStif;
-class CSystemToneService;
+
 
 enum TPlayState
     {
@@ -63,7 +64,7 @@
 *  CSystemToneServiceStif test class for STIF Test Framework TestScripter.
 
 */
-NONSHARABLE_CLASS(CSystemToneServiceStif) : public CScriptBase
+NONSHARABLE_CLASS(CSystemToneServiceStif) : public CScriptBase, MStsPlayAlarmObserver
     {
     public:  // Constructors and destructor
 
@@ -128,15 +129,19 @@
       
         virtual TInt  DeleteSystemToneService(  );
         
-        virtual TInt  PlaySystemToneService( CStifItemParser& aItem);
+        virtual TInt  PlayTone( CStifItemParser& aItem);
         
-        virtual TInt  PlaySystemToneServiceWithContext( CStifItemParser& aItem );
+        virtual TInt  PlayAlarm( CStifItemParser& aItem );
         
-        virtual TInt  StopSystemToneService( CStifItemParser& aItem  );
+        virtual TInt  StopAlarm( CStifItemParser& aItem );
 
 
 
-    private:    // Data
+    private:  
+    	 // inherited from MPlayAlarmObserver
+       virtual void PlayAlarmComplete(unsigned int aAlarmContext);
+    	
+    	  // Data
         TPlayState            iPlayState;
         CSystemToneService*   iSts;
         TUint                 iCurrentContext;
--- a/mmmw_plat/system_tone_service_api/tsrc/src/systemtoneservicestifblocks.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmmw_plat/system_tone_service_api/tsrc/src/systemtoneservicestifblocks.cpp	Fri May 14 16:22:35 2010 +0300
@@ -19,7 +19,7 @@
 #include <e32svr.h>
 #include <StifParser.h>
 #include <StifTestInterface.h>
-#include <systemtoneservice.h>
+#include <StifTestEventInterface.h>
 #include "systemtoneservicestif.h"
 
 
@@ -34,9 +34,9 @@
         // Second is the actual implementation member function.
         ENTRY( "Create", CSystemToneServiceStif::CreateSystemToneService ),
         ENTRY( "Delete", CSystemToneServiceStif::DeleteSystemToneService ),
-        ENTRY( "PlayTone", CSystemToneServiceStif::PlaySystemToneService ),
-        ENTRY( "PlayToneWithContext", CSystemToneServiceStif::PlaySystemToneServiceWithContext ),
-        ENTRY( "StopTone", CSystemToneServiceStif::StopSystemToneService ),
+        ENTRY( "PlayTone", CSystemToneServiceStif::PlayTone ),
+        ENTRY( "PlayAlarm", CSystemToneServiceStif::PlayAlarm ),
+        ENTRY( "StopAlarm", CSystemToneServiceStif::StopAlarm ),
         
 
 
@@ -119,7 +119,7 @@
     }
     
     
-TInt CSystemToneServiceStif::PlaySystemToneService( CStifItemParser& aItem )
+TInt CSystemToneServiceStif::PlayTone( CStifItemParser& aItem )
     {
         // Print to UI
             _LIT( Ksystemtoneservicestif, "systemtoneservicestif" );
@@ -150,7 +150,7 @@
 }
 
 
-TInt CSystemToneServiceStif::PlaySystemToneServiceWithContext( CStifItemParser& aItem )
+TInt CSystemToneServiceStif::PlayAlarm( CStifItemParser& aItem )
     {
         // Print to UI
             _LIT( Ksystemtoneservicestif, "systemtoneservicestif" );
@@ -160,22 +160,22 @@
             iLog->Log( KPrint );
             
                TInt lRetVal = KErrNone;
-               TInt toneType = 0;
+               TInt alarmType = 0;
 
-               lRetVal = aItem.GetNextInt(toneType);
+               lRetVal = aItem.GetNextInt(alarmType);
 
                if ( lRetVal != KErrNone )
                 {
                    iLog->Log(_L("CSystemToneServiceStif::PlaySystemToneService tone type missing in config file "));
                    iLog->Log(_L("Playing Default Tone"));
                    
-            iSts->PlayTone(CSystemToneService::EDefaultBeep, iCurrentContext);
+            iSts->PlayAlarm(CSystemToneService::EClockAlarm, iCurrentContext, *this);
         }
 			  else
         {
             //iSts->PlayTone(CSystemToneService::EClockAlarm, iCurrentContext);
-            iSts->PlayTone(CSystemToneService::TToneType(toneType), iCurrentContext);
-            iLog->Log(_L("CSystemToneService::TToneType(toneType) %d"),CSystemToneService::TToneType(toneType) );
+            iSts->PlayAlarm(CSystemToneService::TAlarmType(alarmType), iCurrentContext, *this);
+            iLog->Log(_L("CSystemToneService::TAlarmType(alarmType) %d"),CSystemToneService::TAlarmType(alarmType) );
         }
         
         return lRetVal;       
@@ -183,8 +183,15 @@
         }
 
 
-TInt  CSystemToneServiceStif::StopSystemToneService(CStifItemParser& aItem  )
+TInt  CSystemToneServiceStif::StopAlarm(CStifItemParser& aItem  )
     {
+    // Print to UI
+          _LIT( Ksystemtoneservicestif, "systemtoneservicestif" );
+          _LIT( KPrint, "In StopSystemToneService" );
+          TestModuleIf().Printf( 0, Ksystemtoneservicestif, KPrint );
+          // Print to log file
+          iLog->Log( KPrint );
+          
     TPtrC StopType;
 		TInt error = KErrNone;
 		
@@ -195,15 +202,26 @@
     {
 				iLog->Log(_L("Stop Tone with recognized context number"));
           
-        iSts->StopTone(iCurrentContext);
+        iSts->StopAlarm(iCurrentContext);
 		}
 		else
 		{
 		    iLog->Log(_L("Stop Tone with unrecognized context number"));
           
-        iSts->StopTone(iCurrentContext+1);
+        iSts->StopAlarm(iCurrentContext+1);
     }
     
     return error;
 }
+    
+void CSystemToneServiceStif::PlayAlarmComplete(unsigned int aAlarmContext)
+    {
+    if (aAlarmContext == iCurrentContext)
+        {
+        iPlayState = EStopped;
+        TEventIf event( TEventIf::ESetEvent, _L("Event_PlayAlarmComplete") );
+        TestModuleIf().Event( event );
+        
+        }
+    }  
 
--- a/mmmw_plat/telephony_multimedia_service_api/inc/tmssource.h	Mon May 03 12:59:52 2010 +0300
+++ b/mmmw_plat/telephony_multimedia_service_api/inc/tmssource.h	Fri May 14 16:22:35 2010 +0300
@@ -48,22 +48,6 @@
     virtual gint GetType(TMSSourceType& sourcetype) = 0;
     };
 
-/*class TMSDeviceMic:public TMSSource
-    {
-public:
-    virtual gint GetType(TMSSourceType& sourcetype){return iSourceType};
-private:
-    TMSSourceType iSourceType;
-    };*/
-
-/*class TMSModem:public TMSSource
-    {
-public:
-    virtual gint GetType(TMSSourceType& sourcetype){return iSourceType};
-private:
-    TMSSourceType iSourceType;
-    };*/
-
 } //namespace TMS
 
 #endif //TMS_SOURCE_H
--- a/mmmw_plat/telephony_multimedia_service_api/tsrc/Conf/TMSAudioServicesTestClass.cfg	Mon May 03 12:59:52 2010 +0300
+++ b/mmmw_plat/telephony_multimedia_service_api/tsrc/Conf/TMSAudioServicesTestClass.cfg	Fri May 14 16:22:35 2010 +0300
@@ -700,12 +700,12 @@
 Tms CreateDownlinkStream
 Tms CreateEffect 9
 allownextresult TMS_RESULT_DOES_NOT_EXIST
-Tms RemoveGlobleVolumeEffectToStream
-Tms AddGlobleVolumeEffectToStream
+Tms RemoveGlobalVolumeEffectToStream
+Tms AddGlobalVolumeEffectToStream
 allownextresult TMS_RESULT_ALREADY_EXIST
-Tms AddGlobleVolumeEffectToStream
-Tms RemoveGlobleVolumeEffectToStream
-Tms AddGlobleVolumeEffectToStream
+Tms AddGlobalVolumeEffectToStream
+Tms RemoveGlobalVolumeEffectToStream
+Tms AddGlobalVolumeEffectToStream
 delete Tms
 [Endtest]
 
@@ -717,12 +717,12 @@
 Tms CreateUplinkStream
 Tms CreateEffect 10
 allownextresult TMS_RESULT_DOES_NOT_EXIST
-Tms RemoveGlobleGainEffectToStream
-Tms AddGlobleGainEffectToStream
+Tms RemoveGlobalGainEffectToStream
+Tms AddGlobalGainEffectToStream
 allownextresult TMS_RESULT_ALREADY_EXIST
-Tms AddGlobleGainEffectToStream
-Tms RemoveGlobleGainEffectToStream
-Tms AddGlobleGainEffectToStream
+Tms AddGlobalGainEffectToStream
+Tms RemoveGlobalGainEffectToStream
+Tms AddGlobalGainEffectToStream
 delete Tms
 [Endtest]
 
@@ -1702,25 +1702,407 @@
 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  10. TMSRingTone - 01. CreateRingTonePlayer
+create TmsAudioServicesTestClass Tms
+Tms CreateFactory
+Tms CreateRingTonePlayer
+delete Tms
+[Endtest]
+
+[Test]
+title  10. TMSRingTone - 02. InitRingTonePlayer - Default
+create TmsAudioServicesTestClass Tms
+Tms CreateFactory
+Tms CreateRingTonePlayer
+Tms InitRingTonePlayer RTDefault
+waittestclass Tms
+Tms CloseRingTonePlayer
+delete Tms
+[Endtest]
+
+[Test]
+title  10. TMSRingTone - 03. InitRingTonePlayer - File
+create TmsAudioServicesTestClass Tms
+Tms CreateFactory
+Tms CreateRingTonePlayer
+Tms InitRingTonePlayer RTFile
+waittestclass Tms
+Tms CloseRingTonePlayer
+delete Tms
+[Endtest]
+
+[Test]
+title  10. TMSRingTone - 04. PlayRingTone - Default
+create TmsAudioServicesTestClass Tms
+Tms CreateFactory
+Tms CreateRingTonePlayer
+Tms InitRingTonePlayer RTDefault
+waittestclass Tms
+Tms PlayRingTone
+waittestclass Tms
+Tms StopRingTone
+Tms CloseRingTonePlayer
+delete Tms
+[Endtest]
+
+[Test]
+title  10. TMSRingTone - 05. PlayRingTone - File
+create TmsAudioServicesTestClass Tms
+Tms CreateFactory
+Tms CreateRingTonePlayer
+Tms InitRingTonePlayer RTFile
+waittestclass Tms
+Tms PlayRingTone
+waittestclass Tms
+Tms MuteRingTone
+Tms CloseRingTonePlayer
+delete Tms
+[Endtest]
+
+[Test]
+title  10. TMSRingTone - 06. PlayRingTone - BeepOnce
+create TmsAudioServicesTestClass Tms
+Tms CreateFactory
+Tms CreateRingTonePlayer
+Tms InitRingTonePlayer RTBeepOnce
+waittestclass Tms
+Tms PlayRingTone
+waittestclass Tms
+Tms CloseRingTonePlayer
+delete Tms
+[Endtest]
+
+[Test]
+title  10. TMSRingTone - 07. PlayRingTone - Silent
+create TmsAudioServicesTestClass Tms
+Tms CreateFactory
+Tms CreateRingTonePlayer
+Tms InitRingTonePlayer RTSilent
+waittestclass Tms
+Tms PlayRingTone
+waittestclass Tms
+Tms StopRingTone
+Tms CloseRingTonePlayer
+delete Tms
+[Endtest]
+
+[Test]
+title  10. TMSRingTone - 08. PlayRingTone - UnsecureVoIP
+create TmsAudioServicesTestClass Tms
+Tms CreateFactory
+Tms CreateRingTonePlayer
+Tms InitRingTonePlayer RTUnsecureVoIP
+waittestclass Tms
+Tms PlayRingTone
+waittestclass Tms
+Tms MuteRingTone
+Tms CloseRingTonePlayer
+delete Tms
+[Endtest]
+
+[Test]
+title  10. TMSRingTone - 09. PlayRingTone - Sequence
+create TmsAudioServicesTestClass Tms
+Tms CreateFactory
+Tms CreateRingTonePlayer
+Tms InitRingTonePlayer RTSequence
+waittestclass Tms
+Tms PlayRingTone
+waittestclass Tms
+Tms CloseRingTonePlayer
+delete Tms
+[Endtest]
+
+[Test]
+title  10. TMSRingTone - 10. PlayRingTone - TTS
+create TmsAudioServicesTestClass Tms
+Tms CreateFactory
+Tms CreateRingTonePlayer
+Tms InitRingTonePlayer RTTts
+waittestclass Tms
+Tms PlayRingTone
+waittestclass Tms
+Tms CloseRingTonePlayer
+delete Tms
+[Endtest]
+
+[Test]
+title  10. TMSRingTone - 11. PlayRingTone - Play BKP tone
+create TmsAudioServicesTestClass Tms
+Tms CreateFactory
+Tms CreateRingTonePlayer
+Tms InitRingTonePlayer RTSequence
+waittestclass Tms
+Tms PlayRingToneNoEvent
+Tms PauseRingTone   //will cancel sequence RT
+Tms PlayRingTone    //will play default RT
+waittestclass Tms
+Tms CloseRingTonePlayer
+delete Tms
+[Endtest]
+
+[Test]
+title  11. TMSInbandTone - 01. CreateInbandTonePlayer
+create TmsAudioServicesTestClass Tms
+Tms CreateFactory
+Tms CreateInbandTonePlayer
+Tms CloseInbandTonePlayer
+delete Tms
+[Endtest]
+
+[Test]
+title  11. TMSInbandTone - 02. StartInbandTone - UserBusy
+create TmsAudioServicesTestClass Tms
+Tms CreateFactory
+Tms CreateInbandTonePlayer
+Tms StartInbandTone UserBusy
+waittestclass Tms
+Tms StopInbandTone
+Tms CloseInbandTonePlayer
+delete Tms
+[Endtest]
+
+[Test]
+title  11. TMSInbandTone - 03. StartInbandTone - RadioPathNotFound
+create TmsAudioServicesTestClass Tms
+Tms CreateFactory
+Tms CreateInbandTonePlayer
+Tms StartInbandTone RadioPathNotFound
+waittestclass Tms
+Tms StopInbandTone
+Tms CloseInbandTonePlayer
+delete Tms
+[Endtest]
+
+[Test]
+title  11. TMSInbandTone - 04. StartInbandTone - Congestion
+create TmsAudioServicesTestClass Tms
+Tms CreateFactory
+Tms CreateInbandTonePlayer
+Tms StartInbandTone Congestion
+waittestclass Tms
+Tms StopInbandTone
+Tms CloseInbandTonePlayer
+delete Tms
+[Endtest]
+
+[Test]
+title  11. TMSInbandTone - 05. StartInbandTone - SpecialInfo
+create TmsAudioServicesTestClass Tms
+Tms CreateFactory
+Tms CreateInbandTonePlayer
+Tms StartInbandTone SpecialInfo
+waittestclass Tms
+Tms StopInbandTone
+Tms CloseInbandTonePlayer
+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]
+[Test]
+title  11. TMSInbandTone - 06. StartInbandTone - Reorder
+create TmsAudioServicesTestClass Tms
+Tms CreateFactory
+Tms CreateInbandTonePlayer
+Tms StartInbandTone Reorder
+waittestclass Tms
+Tms StopInbandTone
+Tms CloseInbandTonePlayer
+delete Tms
+[Endtest]
+
+[Test]
+title  11. TMSInbandTone - 07. StartInbandTone - Alerting
+create TmsAudioServicesTestClass Tms
+Tms CreateFactory
+Tms CreateInbandTonePlayer
+Tms StartInbandTone Alerting
+waittestclass Tms
+Tms StopInbandTone
+Tms CloseInbandTonePlayer
+delete Tms
+[Endtest]
+
+[Test]
+title  11. TMSInbandTone - 08. StartInbandTone - Waiting
+create TmsAudioServicesTestClass Tms
+Tms CreateFactory
+Tms CreateInbandTonePlayer
+Tms StartInbandTone Waiting
+waittestclass Tms
+Tms StopInbandTone
+Tms CloseInbandTonePlayer
+delete Tms
+[Endtest]
+
+[Test]
+title  11. TMSInbandTone - 09. StartInbandTone - DataCall
+create TmsAudioServicesTestClass Tms
+Tms CreateFactory
+Tms CreateInbandTonePlayer
+Tms StartInbandTone DataCall
+waittestclass Tms
+Tms StopInbandTone
+Tms CloseInbandTonePlayer
+delete Tms
+[Endtest]
+
+[Test]
+title  11. TMSInbandTone - 10. StartInbandTone - NoSequence
+create TmsAudioServicesTestClass Tms
+Tms CreateFactory
+Tms CreateInbandTonePlayer
+Tms StartInbandTone NoSequence
+waittestclass Tms
+Tms StopInbandTone
+Tms CloseInbandTonePlayer
+delete Tms
+[Endtest]
+
+[Test]
+title  11. TMSInbandTone - 11. StartInbandTone - BeepSequence
+create TmsAudioServicesTestClass Tms
+Tms CreateFactory
+Tms CreateInbandTonePlayer
+Tms StartInbandTone BeepSequence
+waittestclass Tms
+Tms StopInbandTone
+Tms CloseInbandTonePlayer
+delete Tms
+[Endtest]
+
+[Test]
+title  12. TMSDTMFTone - 01. CreateDTMFTonePlayer Dnlink
+create TmsAudioServicesTestClass Tms
+Tms CreateFactory
+Tms CreateDTMFTonePlayer Dnlink
+Tms CloseDTMFPlayer Dnlink
+delete Tms
+[Endtest]
+
+[Test]
+title  12. TMSDTMFTone - 02. CreateDTMFTonePlayer Uplink
+create TmsAudioServicesTestClass Tms
+Tms CreateFactory
+Tms CreateDTMFTonePlayer Uplink
+Tms CloseDTMFPlayer Uplink
+delete Tms
+[Endtest]
 
+[Test]
+title  12. TMSDTMFTone - 03. DTMFTonePlay - Dnlink IP
+create TmsAudioServicesTestClass Tms
+Tms CreateFactory
+Tms CreateCall 2
+Tms CreateDownlinkStream
+Tms CreateFormat PCM16 Dnlink
+Tms SetDownlinkFormat
+Tms CreateSource 3  //CLIENT
+Tms AddSourceObserver
+Tms AddClientSrcToDnlStream
+Tms CreateSink 8    //SPKR
+Tms AddSinkObserver
+Tms AddSpkrSinkToDnlStream
+Tms OpenDownlink
+waittestclass Tms
+Tms CreateDTMFTonePlayer Dnlink
+Tms DTMFTonePlay Dnlink
+waittestclass Tms
+Tms StopDTMFTonePlayer Dnlink
+Tms CloseDTMFPlayer Dnlink
+Tms RemoveSinkObserver
+Tms RemoveSourceObserver
+//Client must call DeInit() otherwise return TMS_RESULT_INVALID_STATE
+allownextresult TMS_RESULT_INVALID_STATE
+Tms RemoveClientSrcFromDnlStream
+//Client must call DeInit() otherwise return TMS_RESULT_INVALID_STATE
+allownextresult TMS_RESULT_INVALID_STATE
+Tms RemoveSpkrSinkFromDnlStream
+Tms Close Dnlink
+delete Tms
+[Endtest]
+
+[Test]
+title  12. TMSDTMFTone - 04. DTMFTonePlay - Uplink IP
+create TmsAudioServicesTestClass Tms
+Tms CreateFactory
+Tms CreateCall 2
+Tms CreateUplinkStream
+Tms CreateFormat PCM16
+Tms SetUplinkFormat
+Tms CreateSource 5  //MIC
+Tms AddMicSrcToUplStream
+Tms CreateSink 6    //CLIENT
+Tms AddClientSinkToUplStream
+Tms OpenUplink
+waittestclass Tms
+Tms CreateDTMFTonePlayer Uplink
+allownextresult TMS_RESULT_FEATURE_NOT_SUPPORTED
+Tms ContinueDTMFStringSending Uplink
+Tms DTMFTonePlay Uplink
+waittestclass Tms
+Tms StopDTMFTonePlayer Uplink
+Tms CloseDTMFPlayer Uplink
+//Client must call DeInit() otherwise return TMS_RESULT_INVALID_STATE
+allownextresult TMS_RESULT_INVALID_STATE
+Tms RemoveMicSrcFromUplStream
+//Client must call DeInit() otherwise return TMS_RESULT_INVALID_STATE
+allownextresult TMS_RESULT_INVALID_STATE
+Tms RemoveClientSinkFromUplStream
+Tms Close Uplink
+delete Tms
+[Endtest]
+
+[Test]
+title  12. TMSDTMFTone - 05. DTMFTonePlay - Dnlink CS
+create TmsAudioServicesTestClass Tms
+Tms CreateFactory
+Tms CreateCall 0    //CS
+Tms CreateDownlinkStream
+Tms CreateSource 4  //MODEM
+Tms AddModemSrcToDnlStream
+Tms CreateSink 8    //SPKR
+Tms AddSpkrSinkToDnlStream
+Tms OpenDownlink
+waittestclass Tms
+Tms CreateDTMFTonePlayer Dnlink
+Tms DTMFTonePlay Dnlink
+waittestclass Tms
+Tms StopDTMFTonePlayer Dnlink
+Tms CloseDTMFPlayer Dnlink
+//Client must call DeInit() otherwise return TMS_RESULT_INVALID_STATE
+allownextresult TMS_RESULT_INVALID_STATE
+Tms RemoveModemSrcFromDnlStream
+//Client must call DeInit() otherwise return TMS_RESULT_INVALID_STATE
+allownextresult TMS_RESULT_INVALID_STATE
+Tms RemoveSpkrSinkFromDnlStream
+Tms Close Dnlink
+delete Tms
+[Endtest]
+
+[Test]
+title  12. TMSDTMFTone - 06. DTMFTonePlay - Uplink CS
+create TmsAudioServicesTestClass Tms
+Tms CreateFactory
+Tms CreateCall 0    //CS
+Tms CreateUplinkStream
+Tms CreateSource 5  //MIC
+Tms AddMicSrcToUplStream
+Tms CreateSink 7    //MODEM
+Tms AddModemSinkToUplStream
+Tms OpenUplink
+waittestclass Tms
+Tms CreateDTMFTonePlayer Uplink
+Tms DTMFTonePlay Uplink
+waittestclass Tms
+Tms StopDTMFTonePlayer Uplink
+Tms CloseDTMFPlayer Uplink
+//Client must call DeInit() otherwise return TMS_RESULT_INVALID_STATE
+allownextresult TMS_RESULT_INVALID_STATE
+Tms RemoveMicSrcFromUplStream
+//Client must call DeInit() otherwise return TMS_RESULT_INVALID_STATE
+allownextresult TMS_RESULT_INVALID_STATE
+Tms RemoveModemSinkFromUplStream
+Tms Close Uplink
+delete Tms
+[Endtest]
--- a/mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/inc/TMSAudioServicesTestClass.h	Mon May 03 12:59:52 2010 +0300
+++ b/mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/inc/TMSAudioServicesTestClass.h	Fri May 14 16:22:35 2010 +0300
@@ -31,8 +31,6 @@
 #include <tmscall.h>
 #include <tmsstream.h>
 #include <tmsformat.h>
-#include <tmsdtmf.h>
-#include <tmsringtone.h>
 #include <tmsclientsink.h>
 #include <tmsclientsource.h>
 #include <tmsclientsourceobsrvr.h>
@@ -51,6 +49,12 @@
 #include <tmsilbcformat.h>
 #include <tmspcmformat.h>
 #include <tmsamrformat.h>
+#include <tmsdtmf.h>
+#include <tmsdtmfobsrvr.h>
+#include <tmsringtone.h>
+#include <tmsringtoneobsrvr.h>
+#include <tmsinbandtone.h>
+#include <tmsinbandtoneobsrvr.h>
 
 #include "TimeoutController.h"
 
@@ -63,6 +67,7 @@
 const TInt KErrUnexpectedValue = -2002; // Unexpected value at setting
 const TInt KErrTimeoutController = -2007; // Unexpected notification
 
+const TInt KMicroTimeout = 1000;
 const TInt KShortTimeout = 2000;
 const TInt KMediumTimeout = 10000;
 const TInt KLongTimeout = 100000;
@@ -105,20 +110,43 @@
 _LIT( KTagPublic, "Public");
 _LIT( KTagPrivate, "Private");
 
+_LIT( KTagRTDefault, "RTDefault");
+_LIT( KTagRTFile, "RTFile");
+_LIT( KTagRTBeepOnce, "RTBeepOnce");
+_LIT( KTagRTSilent, "RTSilent");
+_LIT( KTagRTUnsecureVoIP, "RTUnsecureVoIP");
+_LIT( KTagRTSequence, "RTSequence");
+_LIT( KTagRTTts, "RTTts");
+
+_LIT( KTagUserBusy, "UserBusy" );
+_LIT( KTagRadioPathNotFound, "RadioPathNotFound" );
+_LIT( KTagCongestion, "Congestion" );
+_LIT( KTagSpecialInfo, "SpecialInfo" );
+_LIT( KTagReorder, "Reorder" );
+_LIT( KTagAlerting, "Alerting" );
+_LIT( KTagWaiting, "Waiting" );
+_LIT( KTagDataCall, "DataCall" );
+_LIT( KTagNoSequence, "NoSequence" );
+_LIT( KTagBeepSequence, "BeepSequence" );
+
 // MACROS
-//#define ?macro ?macro_def
-// Logging path
+
 #ifdef __WINSCW__
 _LIT( KTmsAudioServicesTestClassLogPath, "\\logs\\testframework\\" );
 _LIT16(KTestFile1, "\\testing\\data\\alarm 1.aac");
 _LIT16(KTestFile2, "\\testing\\data\\alarm.aac");
-_LIT16(KTestFile3, "\\testing\\data\\test_8khz.wav");
+//_LIT16(KTestFile3, "\\testing\\data\\test_8khz.wav");
+_LIT16(KTestFile3, "c:\\data\\sounds\\digital\\test_8khz.wav");
 #else
 _LIT( KTmsAudioServicesTestClassLogPath, "c:\\testing\\Log\\" );
 _LIT16(KTestFile1, "c:\\testing\\data\\alarm 1.aac");
 _LIT16(KTestFile2, "c:\\testing\\data\\alarm.aac");
-_LIT16(KTestFile3, "c:\\testing\\data\\test_8khz.wav");
+//_LIT16(KTestFile3, "c:\\testing\\data\\test_8khz.wav");
+_LIT16(KTestFile3, "c:\\data\\sounds\\digital\\test_8khz.wav");
 #endif
+_LIT8(KRTBeepSequence, "\x00\x11\x0A\x0A\x08\x73\x0A\x40\x28\x0A\xF7\
+\x05\xFC\x40\x64\x0A\x08\x40\x32\x0A\xF7\x06\x0B");
+_LIT16(KTextToSpeak, "THE PHONE IS RINGING");
 
 // Log file
 _LIT( KTmsAudioServicesTestClassLogFile, "CTmsAudioServicesTestClass.txt" );
@@ -150,7 +178,10 @@
     public TMSClientSourceObserver,
     public TMSClientSinkObserver,
     public TMSEffectObserver,
-    public TMSGlobalRoutingObserver
+    public TMSGlobalRoutingObserver,
+    public TMSRingToneObserver,
+    public TMSDTMFObserver,
+    public TMSInbandToneObserver
     {
     enum StreamState
         {
@@ -188,6 +219,13 @@
         EFillBuffer,
         EOutputChanged,
         ESetOutputComplete,
+        ERTInitComplete,
+        ERTPlayComplete,
+        ERTDeinitComplete,
+        EInbToneStarted,
+        EInbToneStopped,
+        EDTMFToneStarted,
+        EDTMFToneStopped
         };
 
 public:
@@ -227,6 +265,15 @@
     void GlobalRoutingEvent(const TMSGlobalRouting& /*routing*/,
             TMSSignalEvent event, TMSAudioOutput output);
 
+    // from TMSRingToneObserver
+    void RingtoneEvent(const TMSRingTone& rt, TMSSignalEvent event);
+
+    // from TMSDTMFObserver
+    void DTMFEvent(const TMSDTMF& dtmf, TMSSignalEvent event);
+
+    // from TMSInbandToneObserver
+    void InbandToneEvent(const TMSInbandTone& inbandtone, TMSSignalEvent event);
+
 private:
 
     /**
@@ -333,10 +380,8 @@
     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 SetDownlinkFormat(CStifItemParser& aItem);
     TInt SetUplinkFormat(CStifItemParser& aItem);
@@ -352,18 +397,25 @@
     TInt Gain(CStifItemParser& aItem);
     TInt Volume(CStifItemParser& aItem);
 
-    TInt InitDTMFTonePlayer(CStifItemParser& aItem);
+    TInt CreateDTMFTonePlayer(CStifItemParser& aItem);
     TInt DTMFTonePlay(CStifItemParser& aItem);
+    TInt StopDTMFTonePlayer(CStifItemParser& aItem);
+    TInt ContinueDTMFStringSending(CStifItemParser& aItem);
     TInt CloseDTMFPlayer(CStifItemParser& aItem);
-    TInt StopDTMFTonePlayer(CStifItemParser& aItem);
 
+    TInt CreateRingTonePlayer(CStifItemParser& aItem);
     TInt InitRingTonePlayer(CStifItemParser& aItem);
+    TInt PlayRingTone(CStifItemParser& aItem);
+    TInt PlayRingToneNoEvent(CStifItemParser& aItem);
+    TInt PauseRingTone(CStifItemParser& aItem); //IP video call only (10.2)
+    TInt StopRingTone(CStifItemParser& aItem);
+    TInt MuteRingTone(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 CreateInbandTonePlayer(CStifItemParser& aItem);
+    TInt StartInbandTone(CStifItemParser& aItem);
+    TInt StopInbandTone(CStifItemParser& aItem);
+    TInt CloseInbandTonePlayer(CStifItemParser& aItem);
 
     //  TInt GetSupportedBitrates( CStifItemParser& aItem );
 
@@ -385,6 +437,7 @@
     void DisplayFormat(TMSFormatType aFormat);
     void GetSupportedBitrates(RArray<TUint>& aBrArr);
     void DisplayDevice(TMSAudioOutput device);
+    TInt GetBufferType(CStifItemParser& aItem);
 
     TInt ConfigEncAudDevice(CStifItemParser& aItem);
 
@@ -407,15 +460,15 @@
     TInt RemoveSinkObserver(CStifItemParser& aItem);
 
     gint CreateVolumeEffect();
-    gint CreateVolumeGlobleEffect();
+    gint CreateVolumeGlobalEffect();
     TInt AddVolumeEffectToStream(CStifItemParser& aItem);
-    TInt AddGlobleVolumeEffectToStream(CStifItemParser& aItem);
-    TInt RemoveGlobleVolumeEffectToStream(CStifItemParser& aItem);
+    TInt AddGlobalVolumeEffectToStream(CStifItemParser& aItem);
+    TInt RemoveGlobalVolumeEffectToStream(CStifItemParser& aItem);
     gint CreateGainEffect();
-    gint CreateGlobleGainEffect();
+    gint CreateGlobalGainEffect();
     TInt AddGainEffectToStream(CStifItemParser& aItem);
-    TInt AddGlobleGainEffectToStream(CStifItemParser& aItem);
-    TInt RemoveGlobleGainEffectToStream(CStifItemParser& aItem);
+    TInt AddGlobalGainEffectToStream(CStifItemParser& aItem);
+    TInt RemoveGlobalGainEffectToStream(CStifItemParser& aItem);
     TInt GetStreamType(CStifItemParser& aItem);
     TInt GetStreamState(CStifItemParser& aItem);
 
@@ -439,6 +492,7 @@
     TMSDTMF* iDTMFTonePlayerDn;
     TMSDTMF* iDTMFTonePlayerUp;
     TMSRingTone* iRingTonePlayer;
+    TMSInbandTone* iInbandTonePlayer;
     TMSAudioOutput iDevice;
 
     // Codec format APIs
@@ -486,8 +540,8 @@
     TBool iRecBufReady;
 
     // For ring tone playback
-    RFile iRTFile;
-    RFs iFs;
+    GString* iRTStr;
+    GString* iTTSStr;
 
     // Active object with a timer to timeout the test case
     CSimpleTimeout * iTimeoutController;
@@ -502,7 +556,6 @@
     RArray<TTmsExpectedEvent> iOcurredEvents;
 
     CActiveSchedulerWait* iActive;
-
     };
 
 #endif //__TMSAUDIOSERVICESTESTCLASS_H
Binary file mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/sis/TmsAudioServicesTestClass.sis has changed
Binary file mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/sis/TmsAudioServicesTestClass.sisx has changed
--- a/mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/sis/create_sis.bat	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-cls
-@echo off
-echo.
-
-rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-rem All rights reserved.
-rem This component and the accompanying materials are made available
-rem under the terms of the "Eclipse Public License v1.0"
-rem which accompanies this distribution, and is available
-rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
-rem
-rem Initial Contributors:
-rem Nokia Corporation - initial contribution.
-rem
-rem Contributors:
-rem
-echo Description:  TMS SIS package creation utility
-rem
-
-del TmsAudioServicesTestClass.sis*
-makesis ..\group\TmsAudioServicesTestClass.pkg TmsAudioServicesTestClass.sis
-rem signsis TmsAudioServicesTestClass.sis TmsAudioServicesTestClass.sisx rd.crt rd.key
--- a/mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/src/TmsAudioServicesTestClassBlocks.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/src/TmsAudioServicesTestClassBlocks.cpp	Fri May 14 16:22:35 2010 +0300
@@ -119,6 +119,7 @@
     delete iRingTonePlayer;
     delete iDTMFTonePlayerDn;
     delete iDTMFTonePlayerUp;
+    delete iInbandTonePlayer;
 
     // delete iPlayBuf;
 
@@ -152,8 +153,7 @@
 //
 TInt CTmsAudioServicesTestClass::RunMethodL(CStifItemParser& aItem)
     {
-    static TStifFunctionInfo const
-    KFunctions[] =
+    static TStifFunctionInfo const KFunctions[] =
         {
         // Copy this line for every implemented function.
         // First string is the function name used in TestScripter script file.
@@ -175,9 +175,6 @@
         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 ),
@@ -187,12 +184,12 @@
         ENTRY( "OpenDownlink", CTmsAudioServicesTestClass::OpenDownlink ),
         ENTRY( "OpenUplink", CTmsAudioServicesTestClass::OpenUplink ),
         ENTRY( "Gain", CTmsAudioServicesTestClass::Gain ),
-        ENTRY( "AddGlobleGainEffectToStream", CTmsAudioServicesTestClass::AddGlobleGainEffectToStream),
-        ENTRY( "RemoveGlobleGainEffectToStream", CTmsAudioServicesTestClass::RemoveGlobleGainEffectToStream),
+        ENTRY( "AddGlobalGainEffectToStream", CTmsAudioServicesTestClass::AddGlobalGainEffectToStream),
+        ENTRY( "RemoveGlobalGainEffectToStream", CTmsAudioServicesTestClass::RemoveGlobalGainEffectToStream),
         ENTRY( "Volume", CTmsAudioServicesTestClass::Volume ),
-        ENTRY( "AddGlobleVolumeEffectToStream", CTmsAudioServicesTestClass::AddGlobleVolumeEffectToStream),
-        ENTRY( "RemoveGlobleVolumeEffectToStream", CTmsAudioServicesTestClass::RemoveGlobleVolumeEffectToStream),
-        ENTRY( "CreateGlobleGainEffect", CTmsAudioServicesTestClass::CreateGlobleGainEffect),
+        ENTRY( "AddGlobalVolumeEffectToStream", CTmsAudioServicesTestClass::AddGlobalVolumeEffectToStream),
+        ENTRY( "RemoveGlobalVolumeEffectToStream", CTmsAudioServicesTestClass::RemoveGlobalVolumeEffectToStream),
+        ENTRY( "CreateGlobalGainEffect", CTmsAudioServicesTestClass::CreateGlobalGainEffect),
         ENTRY( "Close", CTmsAudioServicesTestClass::Close ),
         ENTRY( "Start", CTmsAudioServicesTestClass::Start ),
         ENTRY( "Pause", CTmsAudioServicesTestClass::Pause ),
@@ -200,18 +197,25 @@
         ENTRY( "GetBitRateList", CTmsAudioServicesTestClass::GetBitRateList ),
         ENTRY( "SetBitrates", CTmsAudioServicesTestClass::SetBitrates ),
         ENTRY( "GetBitrates", CTmsAudioServicesTestClass::GetBitrates ),
-        ENTRY( "InitDTMFTonePlayer", CTmsAudioServicesTestClass::InitDTMFTonePlayer ),
+        ENTRY( "CreateDTMFTonePlayer", CTmsAudioServicesTestClass::CreateDTMFTonePlayer ),
         ENTRY( "DTMFTonePlay", CTmsAudioServicesTestClass::DTMFTonePlay ),
+        ENTRY( "StopDTMFTonePlayer", CTmsAudioServicesTestClass::StopDTMFTonePlayer ),
+        ENTRY( "ContinueDTMFStringSending", CTmsAudioServicesTestClass::ContinueDTMFStringSending ),
         ENTRY( "CloseDTMFPlayer", CTmsAudioServicesTestClass::CloseDTMFPlayer ),
-        ENTRY( "StopDTMFPlayer", CTmsAudioServicesTestClass::StopDTMFTonePlayer ),
+        ENTRY( "CreateRingTonePlayer", CTmsAudioServicesTestClass::CreateRingTonePlayer ),
+        ENTRY( "InitRingTonePlayer", CTmsAudioServicesTestClass::InitRingTonePlayer ),
+        ENTRY( "PlayRingTone", CTmsAudioServicesTestClass::PlayRingTone ),
+        ENTRY( "PlayRingToneNoEvent", CTmsAudioServicesTestClass::PlayRingToneNoEvent ),
+        ENTRY( "PauseRingTone", CTmsAudioServicesTestClass::PauseRingTone ),
+        ENTRY( "MuteRingTone", CTmsAudioServicesTestClass::MuteRingTone ),
+        ENTRY( "StopRingTone", CTmsAudioServicesTestClass::StopRingTone ),
+        ENTRY( "CloseRingTonePlayer", CTmsAudioServicesTestClass::CloseRingTonePlayer ),
+        ENTRY( "CreateInbandTonePlayer", CTmsAudioServicesTestClass::CreateInbandTonePlayer ),
+        ENTRY( "StartInbandTone", CTmsAudioServicesTestClass::StartInbandTone ),
+        ENTRY( "StopInbandTone", CTmsAudioServicesTestClass::StopInbandTone ),
+        ENTRY( "CloseInbandTonePlayer", CTmsAudioServicesTestClass::CloseInbandTonePlayer ),
         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 ),
@@ -276,6 +280,13 @@
         (TText*)L"EFillBuffer",
         (TText*)L"EOutputChanged",
         (TText*)L"ESetOutputComplete",
+        (TText*)L"ERTInitComplete",
+        (TText*)L"ERTPlayComplete",
+        (TText*)L"ERTDeinitComplete",
+        (TText*)L"EInbToneStarted",
+        (TText*)L"EInbToneStopped",
+        (TText*)L"EDTMFToneStarted",
+        (TText*)L"EDTMFToneStopped",
         };
 
     if( (TUint)aKey >= (sizeof( keywords )/sizeof(TText*)) )
@@ -692,8 +703,8 @@
                 break;
             case TMS_EFFECT_GLOBAL_VOL:
                 {
-                error = CreateVolumeGlobleEffect();
-                //       AddGlobleVolumeEffectToStream();
+                error = CreateVolumeGlobalEffect();
+                //       AddGlobalVolumeEffectToStream();
                 }
                 break;
             case TMS_EFFECT_GAIN:
@@ -704,8 +715,8 @@
                 break;
             case TMS_EFFECT_GLOBAL_GAIN:
                 {
-                error = CreateGlobleGainEffect();
-                //        AddGlobleGainEffectToStream();
+                error = CreateGlobalGainEffect();
+                //        AddGlobalGainEffectToStream();
                 }
                 break;
             default:
@@ -1051,7 +1062,8 @@
     return error;
     }
 
-TInt CTmsAudioServicesTestClass::CreateDownlinkStream(CStifItemParser& /*aItem*/)
+TInt CTmsAudioServicesTestClass::CreateDownlinkStream(
+        CStifItemParser& /*aItem*/)
     {
     FTRACE(FPrint(_L("CTmsAudioServicesTestClass::CreateDownlinkStream")));
     iLog->Log(_L("CTmsAudioServicesTestClass::CreateDownlinkStream"));
@@ -1099,88 +1111,6 @@
     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"));
@@ -1295,8 +1225,7 @@
 
         if (error != KErrNone)
             {
-            iLog->Log(_L("CTmsAudioServicesTestClass::SetDownlinkFormat - failed, return error = %d" ),
-                    error);
+            iLog->Log(_L("CTmsAudioServicesTestClass::SetDownlinkFormat - failed, return error = %d" ), error);
             return error;
             }
         }
@@ -1320,8 +1249,7 @@
         error = iTmsDnlink->ResetFormat(iTmsFormatDn);
         if (error != KErrNone)
             {
-            iLog->Log(_L("CTmsAudioServicesTestClass::ReSetDownlinkFormat - failed, return error = %d" ),
-                    error);
+            iLog->Log(_L("CTmsAudioServicesTestClass::ReSetDownlinkFormat - failed, return error = %d" ), error);
             return error;
             }
         }
@@ -1372,8 +1300,7 @@
         {
         if (iTmsFormatUp)
             {
-            iLog->Log(
-                    _L("CTmsAudioServicesTestClass::SetUplinkFormat - iTmsFormatUp"));
+            iLog->Log(_L("CTmsAudioServicesTestClass::SetUplinkFormat - iTmsFormatUp"));
             error = iTmsUplink->SetFormat(iTmsFormatUp);
             }
         else
@@ -1384,8 +1311,7 @@
 
         if (error != KErrNone)
             {
-            iLog->Log(_L("CTmsAudioServicesTestClass::SetUplinkFormat - failed, return error = %d" ),
-                    error);
+            iLog->Log(_L("CTmsAudioServicesTestClass::SetUplinkFormat - failed, return error = %d" ), error);
             return error;
             }
         }
@@ -1496,6 +1422,7 @@
             iRecBufReady = EFalse;
             //iUpLinkCodec = ENULL;
             iTmsUplink->Deinit();
+            iTmsUplink->RemoveObserver(*this);
             iUpLinkStatus = UNINITIALIZED;
             iLog->Log(_L("Close Uplink"));
             AddExpectedEvent(EUplinkClosed, KMediumTimeout);
@@ -1504,6 +1431,7 @@
             {
             //iPlayBufPtr.Set(NULL, 0, 0);
             iTmsDnlink->Deinit();
+            iTmsDnlink->RemoveObserver(*this);
             iDnLinkStatus = UNINITIALIZED;
             iPlayBufReady = EFalse;
             // iDnLinkCodec = ENULL;
@@ -1690,7 +1618,7 @@
     if (effecttype == TMS_EFFECT_GAIN)
         {
         RDebug::Printf("[TMS STIF] GAIN, GetMaxLevel");
-        ret = static_cast<TMSGainEffect*>(iTmsUplinkEffect)->GetMaxLevel(
+        ret = static_cast<TMSGainEffect*> (iTmsUplinkEffect)->GetMaxLevel(
                 iMaxGain);
         RDebug::Printf("[TMS STIF] GAIN, GetMaxLevel Level [%d] Ret Err [%d]", iMaxGain, ret);
         RDebug::Printf("[TMS STIF] GAIN, SetLevel to [%d]", iMaxGain);
@@ -1698,7 +1626,7 @@
         RDebug::Printf("[TMS STIF] GAIN, SetLevel ret [%d]", ret);
         iLog->Log(_L("SetMaxGain: %d"), iMaxGain);
         RDebug::Printf("[TMS STIF] GAIN, GetLevel");
-        ret = static_cast<TMSGainEffect*>(iTmsUplinkEffect)->GetLevel(iGain);
+        ret = static_cast<TMSGainEffect*> (iTmsUplinkEffect)->GetLevel(iGain);
         RDebug::Printf("[TMS STIF] GAIN, Exp Level [%d] Ret Level [%d] Ret Err [%d]", iMaxGain, iGain, ret);
         if (iGain != iMaxGain)
             {
@@ -1706,9 +1634,9 @@
             return KErrUnexpectedValue;
             }
 
-        static_cast<TMSGainEffect*>(iTmsUplinkEffect)->SetLevel(0);
+        static_cast<TMSGainEffect*> (iTmsUplinkEffect)->SetLevel(0);
         iLog->Log(_L("MuteMic"));
-        static_cast<TMSGainEffect*>(iTmsUplinkEffect)->GetLevel(iGain);
+        static_cast<TMSGainEffect*> (iTmsUplinkEffect)->GetLevel(iGain);
 
         if (iGain != 0)
             {
@@ -1719,26 +1647,26 @@
     else if (effecttype == TMS_EFFECT_GLOBAL_GAIN)
         {
         RDebug::Printf("[TMS STIF] GLOBAL GAIN, GetMaxLevel");
-        ret = static_cast<TMSGlobalGainEffect*>(iGlobalGain)->GetMaxLevel(
+        ret = static_cast<TMSGlobalGainEffect*> (iGlobalGain)->GetMaxLevel(
                 iMaxGain);
         RDebug::Printf("[TMS STIF] GLOBAL GAIN, GetMaxLevel Level [%d] Ret Err [%d]", iMaxGain, ret);
         RDebug::Printf("[TMS STIF] GLOBAL GAIN, SetLevel to [%d]", iMaxGain);
-        ret = static_cast<TMSGlobalGainEffect*>(iGlobalGain)->SetLevel(
+        ret = static_cast<TMSGlobalGainEffect*> (iGlobalGain)->SetLevel(
                 iMaxGain);
         RDebug::Printf("[TMS STIF] GLOBAL GAIN, SetLevel ret [%d]", ret);
-        iLog->Log(_L("SetGlobleMaxGain: %d"), iMaxGain);
+        iLog->Log(_L("SetGlobalMaxGain: %d"), iMaxGain);
         RDebug::Printf("[TMS STIF] GLOBAL GAIN, GetLevel");
         ret = static_cast<TMSGlobalGainEffect*>(iGlobalGain)->GetLevel(iGain);
         RDebug::Printf("[TMS STIF] GLOBAL GAIN, Exp Level [%d] Ret Level [%d] Ret Err [%d]", iMaxGain, iGain, ret);
         if (iGain != iMaxGain)
             {
-            iLog->Log(_L("GetGain doesn't return expected Globle MaxGain!!! returned Gain = %d"), iGain);
+            iLog->Log(_L("GetGain doesn't return expected Global MaxGain!!! returned Gain = %d"), iGain);
             return KErrUnexpectedValue;
             }
 
-        static_cast<TMSGlobalGainEffect*>(iGlobalGain)->SetLevel(0);
+        static_cast<TMSGlobalGainEffect*> (iGlobalGain)->SetLevel(0);
         iLog->Log(_L("MuteMic"));
-        static_cast<TMSGlobalGainEffect*>(iGlobalGain)->GetLevel(iGain);
+        static_cast<TMSGlobalGainEffect*> (iGlobalGain)->GetLevel(iGain);
 
         if (iGain != 0)
             {
@@ -1764,16 +1692,16 @@
     if (effecttype == TMS_EFFECT_VOLUME)
         {
         RDebug::Printf("[TMS STIF] Volume, GetMaxLevel");
-        ret = static_cast<TMSVolumeEffect*>(iTmsDnlinkEffect)->GetMaxLevel(
+        ret = static_cast<TMSVolumeEffect*> (iTmsDnlinkEffect)->GetMaxLevel(
                 iMaxVolume);
         RDebug::Printf("[TMS STIF] MaxLevel [%d] Ret Error [%d]", iMaxVolume, ret);
         RDebug::Printf("[TMS STIF] Volume, SetLevel to MaxLevel [%d]", iMaxVolume);
-        ret = static_cast<TMSVolumeEffect*>(iTmsDnlinkEffect)->SetLevel(
+        ret = static_cast<TMSVolumeEffect*> (iTmsDnlinkEffect)->SetLevel(
                 iMaxVolume);
         RDebug::Printf("[TMS STIF] SetLevel Ret Error [%d]", ret);
         iLog->Log(_L("SetMaxVolume: %d"), iMaxVolume);
         RDebug::Printf("[TMS STIF] GetLevel");
-        ret = static_cast<TMSVolumeEffect*>(iTmsDnlinkEffect)->GetLevel(
+        ret = static_cast<TMSVolumeEffect*> (iTmsDnlinkEffect)->GetLevel(
                 iVolume);
         RDebug::Printf("[TMS STIF] Level [%d] Ret Error [%d]", iVolume, ret);
         if (iVolume != iMaxVolume)
@@ -1783,10 +1711,10 @@
             }
 
         RDebug::Printf("[TMS STIF] Volume, SetLevel to 0 ");
-        ret = static_cast<TMSVolumeEffect*>(iTmsDnlinkEffect)->SetLevel(0);
+        ret = static_cast<TMSVolumeEffect*> (iTmsDnlinkEffect)->SetLevel(0);
         RDebug::Printf("[TMS STIF] SetLevel Ret Error [%d]", ret);
         iLog->Log(_L("Mute Volume"));
-        ret = static_cast<TMSVolumeEffect*>(iTmsDnlinkEffect)->GetLevel(
+        ret = static_cast<TMSVolumeEffect*> (iTmsDnlinkEffect)->GetLevel(
                 iVolume);
         RDebug::Printf("[TMS STIF] Level [%d] Ret Error [%d]", iVolume, ret);
         if (iVolume != 0)
@@ -1798,34 +1726,34 @@
     else if (effecttype == TMS_EFFECT_GLOBAL_VOL)
         {
         RDebug::Printf("[TMS STIF] GLOBAL_VOL, Get Current Level");
-        ret = static_cast<TMSGlobalVolEffect*>(iGlobalVol)->GetLevel(iVolume);
+        ret = static_cast<TMSGlobalVolEffect*> (iGlobalVol)->GetLevel(iVolume);
         RDebug::Printf("[TMS STIF] Current Vol Level [%d] Ret Error [%d]", iVolume, ret);
         RDebug::Printf("[TMS STIF] GLOBAL_VOL, GetMaxLevel");
-        ret = static_cast<TMSGlobalVolEffect*>(iGlobalVol)->GetMaxLevel(
+        ret = static_cast<TMSGlobalVolEffect*> (iGlobalVol)->GetMaxLevel(
                 iMaxVolume);
         RDebug::Printf("[TMS STIF] MaxLevel [%d] Ret Error [%d]", iMaxVolume, ret);
         RDebug::Printf("[TMS STIF] GLOBAL_VOL, SetLevel to [%d]", iMaxVolume);
-        ret = static_cast<TMSGlobalVolEffect*>(iGlobalVol)->SetLevel(
+        ret = static_cast<TMSGlobalVolEffect*> (iGlobalVol)->SetLevel(
                 iMaxVolume);
         RDebug::Printf("[TMS STIF] SetLevel Ret Error [%d]", ret);
-        iLog->Log(_L("SetMaxGlobleVolume: %d"), iMaxVolume);
+        iLog->Log(_L("SetMaxGlobalVolume: %d"), iMaxVolume);
         RDebug::Printf("[TMS STIF] GLOBAL_VOL,GetLevel");
-        ret = static_cast<TMSGlobalVolEffect*>(iGlobalVol)->GetLevel(iVolume);
+        ret = static_cast<TMSGlobalVolEffect*> (iGlobalVol)->GetLevel(iVolume);
         RDebug::Printf("[TMS STIF] Expected Level [%d] Ret Level [%d] Ret Error [%d]", iMaxVolume, iVolume, ret);
-        iLog->Log(_L("GetMaxGlobleVolume: %d"), iVolume);
+        iLog->Log(_L("GetMaxGlobalVolume: %d"), iVolume);
         if (iVolume != iMaxVolume)
             {
-            iLog->Log(_L("GetGlobleVolume doesn't return expected MaxVolume!!! returned Volume = %d"), iVolume);
+            iLog->Log(_L("GetGlobalVolume doesn't return expected MaxVolume!!! returned Volume = %d"), iVolume);
             return KErrUnexpectedValue;
             }
 
-        static_cast<TMSGlobalVolEffect*>(iGlobalVol)->SetLevel(0);
-        iLog->Log(_L("Mute Globle Volume"));
-        static_cast<TMSGlobalVolEffect*>(iGlobalVol)->GetLevel(iVolume);
+        static_cast<TMSGlobalVolEffect*> (iGlobalVol)->SetLevel(0);
+        iLog->Log(_L("Mute Global Volume"));
+        static_cast<TMSGlobalVolEffect*> (iGlobalVol)->GetLevel(iVolume);
 
         if (iVolume != 0)
             {
-            iLog->Log(_L("GetGlobleVolume does not return expected Mute value!!! returned Volume = %d"), iVolume);
+            iLog->Log(_L("GetGlobalVolume does not return expected Mute value!!! returned Volume = %d"), iVolume);
             return KErrUnexpectedValue;
             }
         }
@@ -1907,7 +1835,8 @@
     return error;
     }
 
-TInt CTmsAudioServicesTestClass::AddGlobalRoutingObserver(CStifItemParser& /*aItem */)
+TInt CTmsAudioServicesTestClass::AddGlobalRoutingObserver(
+        CStifItemParser& /*aItem */)
     {
     iLog->Log(_L("CTmsAudioServicesTestClass::AddGlobalRoutingObserver"));
     TInt error = KErrNone;
@@ -1924,7 +1853,8 @@
     return error;
     }
 
-TInt CTmsAudioServicesTestClass::DeleteGlobalRoutingObserver(CStifItemParser& /*aItem*/)
+TInt CTmsAudioServicesTestClass::DeleteGlobalRoutingObserver(
+        CStifItemParser& /*aItem*/)
     {
     iLog->Log(_L("CTmsAu dioServicesTestClass::DeleteGlobalRoutingObserver"));
     TInt error = KErrNone;
@@ -1997,7 +1927,7 @@
             return error;
             }
 
-        AddExpectedEvent(ESetOutputComplete, KLongTimeout);
+        AddExpectedEvent(ESetOutputComplete, KShortTimeout);
         }
 
     return error;
@@ -2224,91 +2154,6 @@
     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;
-    }
-
 TInt CTmsAudioServicesTestClass::GetBitRateList(CStifItemParser& /*aItem*/)
     {
     iLog ->Log(_L("CTmsAudioServicesTestClass::GetBitRateList"));
@@ -2343,8 +2188,7 @@
             {
             if (iBitratesVector.size() > 0)
                 {
-                std::vector<guint>::iterator iBitrate =
-                        iBitratesVector.begin();
+                std::vector<guint>::iterator iBitrate = iBitratesVector.begin();
                 error = iTmsFormatUp -> SetBitRate(*iBitrate);
                 iLog->Log(_L("BR set %d"), *iBitrate);
                 }
@@ -2425,13 +2269,16 @@
     switch (iUpLinkCodec)
         {
         case TMS_FORMAT_G711:
-            error = static_cast<TMSG711Format*>(iTmsFormatUp)->GetVADMode(aVad);
+            error = static_cast<TMSG711Format*> (iTmsFormatUp)->GetVADMode(
+                    aVad);
             break;
         case TMS_FORMAT_G729:
-            error = static_cast<TMSG729Format*>(iTmsFormatUp)->GetVADMode(aVad);
+            error = static_cast<TMSG729Format*> (iTmsFormatUp)->GetVADMode(
+                    aVad);
             break;
         case TMS_FORMAT_ILBC:
-            error = static_cast<TMSILBCFormat*>(iTmsFormatUp)->GetVADMode(aVad);
+            error = static_cast<TMSILBCFormat*> (iTmsFormatUp)->GetVADMode(
+                    aVad);
             break;
         default:
             break;
@@ -2456,13 +2303,16 @@
     switch (iUpLinkCodec)
         {
         case TMS_FORMAT_G711:
-            error = static_cast<TMSG711Format*>(iTmsFormatUp)->SetVADMode(iVad);
+            error = static_cast<TMSG711Format*> (iTmsFormatUp)->SetVADMode(
+                    iVad);
             break;
         case TMS_FORMAT_G729:
-            error = static_cast<TMSG729Format*>(iTmsFormatUp)->SetVADMode(iVad);
+            error = static_cast<TMSG729Format*> (iTmsFormatUp)->SetVADMode(
+                    iVad);
             break;
         case TMS_FORMAT_ILBC:
-            error = static_cast<TMSILBCFormat*>(iTmsFormatUp)->SetVADMode(iVad);
+            error = static_cast<TMSILBCFormat*> (iTmsFormatUp)->SetVADMode(
+                    iVad);
             break;
         default:
             break;
@@ -2482,7 +2332,7 @@
         if ((linkType == KTagUplink) && (iUpLinkCodec == TMS_FORMAT_G711))
             {
             TMSG711CodecMode aMode;
-            static_cast<TMSG711Format*>(iTmsFormatUp)->GetMode(aMode);
+            static_cast<TMSG711Format*> (iTmsFormatUp)->GetMode(aMode);
 
             if (aMode == TMS_G711_CODEC_MODE_ALAW)
                 {
@@ -2501,7 +2351,7 @@
                 && (iUpLinkCodec == TMS_FORMAT_ILBC))
             {
             TMSILBCCodecMode aMode;
-            static_cast<TMSILBCFormat*>(iTmsFormatUp)->GetMode(aMode);
+            static_cast<TMSILBCFormat*> (iTmsFormatUp)->GetMode(aMode);
 
             if (aMode == TMS_ILBC_CODEC_MODE_20MS_FRAME)
                 {
@@ -2520,7 +2370,7 @@
                 && (iDnLinkCodec == TMS_FORMAT_G711))
             {
             TMSG711CodecMode aMode;
-            static_cast<TMSG711Format*>(iTmsFormatDn)->GetMode(aMode);
+            static_cast<TMSG711Format*> (iTmsFormatDn)->GetMode(aMode);
 
             if (aMode == TMS_G711_CODEC_MODE_ALAW)
                 {
@@ -2539,7 +2389,7 @@
                 && (iDnLinkCodec == TMS_FORMAT_ILBC))
             {
             TMSILBCCodecMode aMode;
-            static_cast<TMSILBCFormat*>(iTmsFormatDn)->GetMode(aMode);
+            static_cast<TMSILBCFormat*> (iTmsFormatDn)->GetMode(aMode);
 
             if (aMode == TMS_ILBC_CODEC_MODE_20MS_FRAME)
                 {
@@ -2582,56 +2432,56 @@
                 && (mode == KTagALaw))
             {
             iLog->Log(_L("UPL Mode Set: aLaw"));
-            static_cast<TMSG711Format*>(iTmsFormatUp)->SetMode(
+            static_cast<TMSG711Format*> (iTmsFormatUp)->SetMode(
                     TMS_G711_CODEC_MODE_ALAW);
             }
         else if ((linkType == KTagUplink)
                 && (iUpLinkCodec == TMS_FORMAT_G711) && (mode == KTagULaw))
             {
             iLog->Log(_L("UPL Mode Set: uLaw"));
-            static_cast<TMSG711Format*>(iTmsFormatUp)->SetMode(
+            static_cast<TMSG711Format*> (iTmsFormatUp)->SetMode(
                     TMS_G711_CODEC_MODE_MULAW);
             }
         else if ((linkType == KTagUplink)
                 && (iUpLinkCodec == TMS_FORMAT_ILBC) && (mode == KTag20ms))
             {
             iLog->Log(_L("UPL Mode Set: 20ms frame"));
-            static_cast<TMSILBCFormat*>(iTmsFormatUp)->SetMode(
+            static_cast<TMSILBCFormat*> (iTmsFormatUp)->SetMode(
                     TMS_ILBC_CODEC_MODE_20MS_FRAME);
             }
         else if ((linkType == KTagUplink)
                 && (iUpLinkCodec == TMS_FORMAT_ILBC) && (mode == KTag30ms))
             {
             iLog->Log(_L("UPL Mode Set: 30ms frame"));
-            static_cast<TMSILBCFormat*>(iTmsFormatUp)->SetMode(
+            static_cast<TMSILBCFormat*> (iTmsFormatUp)->SetMode(
                     TMS_ILBC_CODEC_MODE_30MS_FRAME);
             }
         else if ((linkType == KTagDnlink)
                 && (iDnLinkCodec == TMS_FORMAT_G711) && (mode == KTagALaw))
             {
             iLog->Log(_L("DNL Mode Set: aLaw"));
-            static_cast<TMSG711Format*>(iTmsFormatDn)->SetMode(
+            static_cast<TMSG711Format*> (iTmsFormatDn)->SetMode(
                     TMS_G711_CODEC_MODE_ALAW);
             }
         else if ((linkType == KTagDnlink)
                 && (iDnLinkCodec == TMS_FORMAT_G711) && (mode == KTagULaw))
             {
             iLog->Log(_L("DNL Mode Set: uLaw"));
-            static_cast<TMSG711Format*>(iTmsFormatDn)->SetMode(
+            static_cast<TMSG711Format*> (iTmsFormatDn)->SetMode(
                     TMS_G711_CODEC_MODE_MULAW);
             }
         else if ((linkType == KTagDnlink)
                 && (iDnLinkCodec == TMS_FORMAT_ILBC) && (mode == KTag20ms))
             {
             iLog->Log(_L("DNL Mode Set: 20ms frame"));
-            static_cast<TMSILBCFormat*>(iTmsFormatDn)->SetMode(
+            static_cast<TMSILBCFormat*> (iTmsFormatDn)->SetMode(
                     TMS_ILBC_CODEC_MODE_20MS_FRAME);
             }
         else if ((linkType == KTagDnlink)
                 && (iDnLinkCodec == TMS_FORMAT_ILBC) && (mode == KTag30ms))
             {
             iLog->Log(_L("DNL Mode Set: 30ms frame"));
-            static_cast<TMSILBCFormat*>(iTmsFormatDn)->SetMode(
+            static_cast<TMSILBCFormat*> (iTmsFormatDn)->SetMode(
                     TMS_ILBC_CODEC_MODE_30MS_FRAME);
             }
         else
@@ -2652,11 +2502,11 @@
     switch (iDnLinkCodec)
         {
         case TMS_FORMAT_G711:
-            error = static_cast<TMSG711Format*>(iTmsFormatDn)->GetCNG(aCng);
+            error = static_cast<TMSG711Format*> (iTmsFormatDn)->GetCNG(aCng);
             iLog->Log(_L("CNG: %d"), aCng);
             break;
         case TMS_FORMAT_ILBC:
-            error = static_cast<TMSILBCFormat*>(iTmsFormatDn)->GetCNG(aCng);
+            error = static_cast<TMSILBCFormat*> (iTmsFormatDn)->GetCNG(aCng);
             iLog->Log(_L("CNG: %d"), aCng);
             break;
         default:
@@ -2673,18 +2523,17 @@
 
 TInt CTmsAudioServicesTestClass::ToggleCNG(CStifItemParser & /*aItem*/)
     {
-
     iLog ->Log(_L("CTmsAudioServicesTestClass::ToggleCNG"));
     TInt error = KErrNone;
     iCng = (iCng) ? EFalse : ETrue;
     switch (iDnLinkCodec)
         {
         case TMS_FORMAT_G711:
-            static_cast<TMSG711Format*>(iTmsFormatDn)->SetCNG(iCng);
+            static_cast<TMSG711Format*> (iTmsFormatDn)->SetCNG(iCng);
             iLog->Log(_L("CNG set: %d"), iCng);
             break;
         case TMS_FORMAT_ILBC:
-            static_cast<TMSILBCFormat*>(iTmsFormatDn)->SetCNG(iCng);
+            static_cast<TMSILBCFormat*> (iTmsFormatDn)->SetCNG(iCng);
             iLog->Log(_L("CNG set: %d"), iCng);
             break;
         default:
@@ -2700,7 +2549,7 @@
     TBool aPlc = EFalse;
     if (iDnLinkCodec == TMS_FORMAT_G711)
         {
-        static_cast<TMSG711Format*>(iTmsFormatDn)->GetPlc(aPlc);
+        static_cast<TMSG711Format*> (iTmsFormatDn)->GetPlc(aPlc);
         iLog->Log(_L("PLC: %d"), aPlc);
         }
 
@@ -2720,31 +2569,13 @@
     iPlc = (iPlc) ? EFalse : ETrue;
     if (iDnLinkCodec == TMS_FORMAT_G711)
         {
-        error = static_cast<TMSG711Format*>(iTmsFormatDn)->SetPlc(iPlc);
+        error = static_cast<TMSG711Format*> (iTmsFormatDn)->SetPlc(iPlc);
         iLog->Log(_L("PLC set: %d"), iPlc);
         }
 
     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")));
@@ -2762,9 +2593,7 @@
         {
         error = iTmsDnlink->AddSource(iTmsClientSource);
         }
-    iLog->Log(
-            _L("CTmsAudioServicesTestClass::AddClientSrcToDnlStream Error [%d]"),
-            error);
+    iLog->Log(_L("CTmsAudioServicesTestClass::AddClientSrcToDnlStream Error [%d]"), error);
     return error;
     }
 
@@ -2842,7 +2671,7 @@
     TInt error = KErrNone;
     if (iTmsClientSource)
         {
-        error = static_cast<TMSClientSource*>(iTmsClientSource)->AddObserver(
+        error = static_cast<TMSClientSource*> (iTmsClientSource)->AddObserver(
                 *this, NULL);
         }
     return error;
@@ -2855,8 +2684,7 @@
     TInt error = KErrNone;
     if (iTmsClientSource)
         {
-        error = static_cast<TMSClientSource*>(iTmsClientSource)->RemoveObserver(
-                *this);
+        error = static_cast<TMSClientSource*> (iTmsClientSource)->RemoveObserver(*this);
         }
     return error;
     }
@@ -2941,8 +2769,8 @@
     TInt error = KErrNone;
     if (iTmsUplink && iTmsClientSink)
         {
-        error = static_cast<TMSClientSink*>(iTmsClientSink)->AddObserver(*this,
-                NULL);
+        error = static_cast<TMSClientSink*> (iTmsClientSink)->AddObserver(
+                *this, NULL);
         }
     return error;
     }
@@ -2953,7 +2781,7 @@
     TInt error = KErrNone;
     if (iTmsUplink && iTmsClientSink)
         {
-        error = static_cast<TMSClientSink*>(iTmsClientSink)->RemoveObserver(
+        error = static_cast<TMSClientSink*> (iTmsClientSink)->RemoveObserver(
                 *this);
         }
     return error;
@@ -2968,30 +2796,29 @@
         status = iFactory->CreateEffect(TMS_EFFECT_VOLUME, iTmsDnlinkEffect);
         if (status == KErrNone)
             {
-            static_cast<TMSVolumeEffect*>(iTmsDnlinkEffect)->AddObserver(*this,
-                    NULL);
+            static_cast<TMSVolumeEffect*> (iTmsDnlinkEffect)->AddObserver(
+                    *this, NULL);
             }
         }
     RDebug::Printf("[TMS STIF] CreateVolumeEffect Return [%d]", status);
     return status;
     }
 
-gint CTmsAudioServicesTestClass::CreateVolumeGlobleEffect()
+gint CTmsAudioServicesTestClass::CreateVolumeGlobalEffect()
     {
-    iLog->Log(_L("CTmsAudioServicesTestClass::CreateVolumeGlobleEffect"));
+    iLog->Log(_L("CTmsAudioServicesTestClass::CreateVolumeGlobalEffect"));
     gint status(KErrNone);
     if (iFactory && !iGlobalVol)
         {
         status = iFactory->CreateEffect(TMS_EFFECT_GLOBAL_VOL, iGlobalVol);
-
         if (status == KErrNone)
             {
-            static_cast<TMSGlobalVolEffect*>(iGlobalVol)->AddObserver(*this,
+            static_cast<TMSGlobalVolEffect*> (iGlobalVol)->AddObserver(*this,
                     NULL);
-            iLog->Log(_L("CTmsAudioServicesTestClass::CreateVolumeGlobleEffect - AddObserver"));
+            iLog->Log(_L("CTmsAudioServicesTestClass::CreateVolumeGlobalEffect - AddObserver"));
             }
         }
-    RDebug::Printf("[TMS STIF] CreateVolumeGlobleEffect Return [%d]", status);
+    RDebug::Printf("[TMS STIF] CreateVolumeGlobalEffect Return [%d]", status);
     return status;
     }
 
@@ -3007,10 +2834,10 @@
     return error;
     }
 
-TInt CTmsAudioServicesTestClass::AddGlobleVolumeEffectToStream(
+TInt CTmsAudioServicesTestClass::AddGlobalVolumeEffectToStream(
         CStifItemParser& /*aItem*/)
     {
-    iLog->Log(_L("CTmsAudioServicesTestClass::AddGlobleVolumeEffectToStream"));
+    iLog->Log(_L("CTmsAudioServicesTestClass::AddGlobalVolumeEffectToStream"));
     TInt error = KErrNone;
     if (iTmsDnlink && iGlobalVol)
         {
@@ -3019,10 +2846,10 @@
     return error;
     }
 
-TInt CTmsAudioServicesTestClass::RemoveGlobleVolumeEffectToStream(
+TInt CTmsAudioServicesTestClass::RemoveGlobalVolumeEffectToStream(
         CStifItemParser& /*aItem*/)
     {
-    iLog->Log(_L("CTmsAudioServicesTestClass::RemoveGlobleVolumeEffectToStream"));
+    iLog->Log(_L("CTmsAudioServicesTestClass::RemoveGlobalVolumeEffectToStream"));
     TInt error = KErrNone;
     if (iTmsDnlink && iGlobalVol)
         {
@@ -3041,28 +2868,28 @@
         status = iFactory->CreateEffect(TMS_EFFECT_GAIN, iTmsUplinkEffect);
         if (status == KErrNone)
             {
-            static_cast<TMSGainEffect*>(iTmsUplinkEffect)->AddObserver(*this,
-                    NULL);
+            static_cast<TMSGainEffect*> (iTmsUplinkEffect)->AddObserver(
+                    *this, NULL);
             }
         }
     RDebug::Printf("[TMS STIF] CreateGainEffect Return [%d]", status);
     return status;
     }
 
-gint CTmsAudioServicesTestClass::CreateGlobleGainEffect()
+gint CTmsAudioServicesTestClass::CreateGlobalGainEffect()
     {
-    iLog->Log(_L("CTmsAudioServicesTestClass::CreateGlobleGainEffect"));
+    iLog->Log(_L("CTmsAudioServicesTestClass::CreateGlobalGainEffect"));
     gint status(KErrNone);
     if (iFactory && !iGlobalGain)
         {
         status = iFactory->CreateEffect(TMS_EFFECT_GLOBAL_GAIN, iGlobalGain);
         if (status == KErrNone)
             {
-            static_cast<TMSGlobalGainEffect*>(iGlobalGain)->AddObserver(*this,
-                    NULL);
+            static_cast<TMSGlobalGainEffect*> (iGlobalGain)->AddObserver(
+                    *this, NULL);
             }
         }
-    RDebug::Printf("[TMS STIF] CreateGlobleGainEffect Return [%d]", status);
+    RDebug::Printf("[TMS STIF] CreateGlobalGainEffect Return [%d]", status);
     return status;
     }
 
@@ -3078,10 +2905,10 @@
     return error;
     }
 
-TInt CTmsAudioServicesTestClass::AddGlobleGainEffectToStream(
+TInt CTmsAudioServicesTestClass::AddGlobalGainEffectToStream(
         CStifItemParser& /*aItem*/)
     {
-    iLog->Log(_L("CTmsAudioServicesTestClass::AddGlobleGainEffectToStream"));
+    iLog->Log(_L("CTmsAudioServicesTestClass::AddGlobalGainEffectToStream"));
     TInt error = KErrNone;
     if (iTmsUplink && iGlobalGain)
         {
@@ -3090,10 +2917,10 @@
     return error;
     }
 
-TInt CTmsAudioServicesTestClass::RemoveGlobleGainEffectToStream(
+TInt CTmsAudioServicesTestClass::RemoveGlobalGainEffectToStream(
         CStifItemParser& /*aItem*/)
     {
-    iLog->Log(_L("CTmsAudioServicesTestClass::RemoveGlobleGainEffectToStream"));
+    iLog->Log(_L("CTmsAudioServicesTestClass::RemoveGlobalGainEffectToStream"));
     TInt error = KErrNone;
     if (iTmsUplink && iGlobalGain)
         {
@@ -3102,6 +2929,509 @@
     return error;
     }
 
+TInt CTmsAudioServicesTestClass::CreateDTMFTonePlayer(CStifItemParser& aItem)
+    {
+    iLog->Log(_L("CTmsAudioServicesTestClass::CreateDTMFTonePlayer"));
+    TInt error = TMS_RESULT_SUCCESS;
+    TPtrC StreamType;
+    error = aItem.GetNextString(StreamType);
+
+    if (error == TMS_RESULT_SUCCESS)
+        {
+        if (StreamType == KTagDnlink)
+            {
+            if (iFactory && !iDTMFTonePlayerDn)
+                {
+                error = iFactory->CreateDTMF(TMS_STREAM_DOWNLINK,
+                        iDTMFTonePlayerDn);
+                error |= iDTMFTonePlayerDn->AddObserver(*this, NULL);
+                }
+            FTRACE(FPrint(_L("CreateDTMF-DNL Error [%d]"), error));
+            }
+        else if (StreamType == KTagUplink)
+            {
+            if (iFactory && !iDTMFTonePlayerUp)
+                {
+                error = iFactory->CreateDTMF(TMS_STREAM_UPLINK,
+                        iDTMFTonePlayerUp);
+                error |= iDTMFTonePlayerUp->AddObserver(*this, NULL);
+                }
+            FTRACE(FPrint(_L("CreateDTMF-UPL Error [%d]"), error));
+            }
+        else
+            {
+            iLog->Log(KMsgBadTestParameters);
+            error = KErrBadTestParameter;
+            }
+        }
+    iLog->Log(_L("CTmsAudioServicesTestClass::CreateDTMFTonePlayer Error [%d]"), error);
+    return error;
+    }
+
+TInt CTmsAudioServicesTestClass::DTMFTonePlay(CStifItemParser& aItem)
+    {
+    FTRACE (FPrint(_L("CTmsAudioServicesTestClass::DTMFTonePlay")));
+    iLog->Log(_L("CTmsAudioServicesTestClass::DTMFTonePlay"));
+    GString* dtmfstring;
+    TInt error = TMS_RESULT_SUCCESS;
+    TPtrC StreamType;
+    error = aItem.GetNextString(StreamType);
+
+    if (error == TMS_RESULT_SUCCESS)
+        {
+        if (StreamType == KTagDnlink)
+            {
+            if (iDTMFTonePlayerDn)
+                {
+                // NOTE: UpLink Status must be READY or STREAMING
+                dtmfstring = g_string_new("4723");
+                dtmfstring = g_string_append_c(dtmfstring, '4');
+                error = iDTMFTonePlayerDn->SetTone(dtmfstring);
+                if (error == TMS_RESULT_SUCCESS)
+                    {
+                    error = iDTMFTonePlayerDn->Start();
+                    }
+                g_string_free(dtmfstring, TRUE);
+                }
+            }
+        else if (StreamType == KTagUplink)
+            {
+            if (iDTMFTonePlayerUp)
+                {
+                // NOTE: UpLink Status must be READY or STREAMING
+                dtmfstring = g_string_new("987");
+                dtmfstring = g_string_append_c(dtmfstring, '4');
+                error = iDTMFTonePlayerUp->SetTone(dtmfstring);
+                if (error == TMS_RESULT_SUCCESS)
+                    {
+                    error = iDTMFTonePlayerUp->Start();
+                    }
+                g_string_free(dtmfstring, TRUE);
+                }
+            }
+        else
+            {
+            iLog->Log(KMsgBadTestParameters);
+            error = KErrBadTestParameter;
+            }
+        }
+
+    if (error == TMS_RESULT_SUCCESS)
+        {
+        AddExpectedEvent(EDTMFToneStopped, KMediumTimeout);
+        }
+
+    iLog->Log(_L("CTmsAudioServicesTestClass::DTMFTonePlay Error [%d]"), error);
+    return error;
+    }
+
+TInt CTmsAudioServicesTestClass::StopDTMFTonePlayer(CStifItemParser& aItem)
+    {
+    FTRACE(FPrint(_L("CTmsAudioServicesTestClass::StopDTMFTonePlayer")));
+    iLog->Log(_L("CTmsAudioServicesTestClass::StopDTMFTonePlay"));
+    TInt error = TMS_RESULT_SUCCESS;
+    TPtrC StreamType;
+    error = aItem.GetNextString(StreamType);
+
+    if (error == TMS_RESULT_SUCCESS)
+        {
+        if (StreamType == KTagDnlink)
+            {
+            if (iFactory && iDTMFTonePlayerDn)
+                {
+                iDTMFTonePlayerDn->Stop();
+                RemoveExpectedEvent(EDTMFToneStopped);
+                }
+            }
+        else if (StreamType == KTagUplink)
+            {
+            if (iFactory && iDTMFTonePlayerUp)
+                {
+                iDTMFTonePlayerUp->Stop();
+                RemoveExpectedEvent(EDTMFToneStopped);
+                }
+            }
+        else
+            {
+            iLog->Log(KMsgBadTestParameters);
+            error = KErrBadTestParameter;
+            }
+        }
+
+    iLog->Log(_L("CTmsAudioServicesTestClass::StopDTMFTonePlayer Error [%d]"), error);
+    return error;
+    }
+
+TInt CTmsAudioServicesTestClass::ContinueDTMFStringSending(
+        CStifItemParser& aItem)
+    {
+    FTRACE(FPrint(_L("CTmsAudioServicesTestClass::ContinueDTMFStringSending")));
+    iLog->Log(_L("CTmsAudioServicesTestClass::ContinueDTMFStringSending"));
+    TInt error = TMS_RESULT_SUCCESS;
+    TPtrC StreamType;
+    error = aItem.GetNextString(StreamType);
+
+    if (error == TMS_RESULT_SUCCESS)
+        {
+        if (StreamType == KTagDnlink)
+            {
+            if (iFactory && iDTMFTonePlayerDn)
+                {
+                //case not supported for DNL, should return valid error
+                error = iDTMFTonePlayerDn->ContinueDTMFStringSending(TRUE);
+                }
+            }
+        else if (StreamType == KTagUplink)
+            {
+            if (iFactory && iDTMFTonePlayerUp)
+                {
+                error = iDTMFTonePlayerUp->ContinueDTMFStringSending(TRUE);
+                }
+            }
+        else
+            {
+            iLog->Log(KMsgBadTestParameters);
+            error = KErrBadTestParameter;
+            }
+        }
+    iLog->Log(_L("CTmsAudioServicesTestClass::ContinueDTMFStringSending Error [%d]"), error);
+    return error;
+    }
+
+TInt CTmsAudioServicesTestClass::CloseDTMFPlayer(CStifItemParser& aItem)
+    {
+    FTRACE(FPrint(_L("CTmsAudioServicesTestClass::CloseDTMFPlayer")));
+    iLog->Log(_L("CTmsAudioServicesTestClass::CloseDTMFPlayer"));
+    TInt error = TMS_RESULT_SUCCESS;
+    TPtrC StreamType;
+    error = aItem.GetNextString(StreamType);
+
+    if (error == TMS_RESULT_SUCCESS)
+        {
+        if (StreamType == KTagDnlink)
+            {
+            if (iFactory && iDTMFTonePlayerDn)
+                {
+                iDTMFTonePlayerDn->RemoveObserver(*this);
+                iFactory->DeleteDTMF(iDTMFTonePlayerDn);
+                }
+            }
+        else if (StreamType == KTagUplink)
+            {
+            if (iFactory && iDTMFTonePlayerUp)
+                {
+                iDTMFTonePlayerUp->RemoveObserver(*this);
+                iFactory->DeleteDTMF(iDTMFTonePlayerUp);
+                }
+            }
+        else
+            {
+            iLog->Log(KMsgBadTestParameters);
+            error = KErrBadTestParameter;
+            }
+        }
+    iLog->Log(_L("CTmsAudioServicesTestClass::StopDTMFTonePlayer Error [%d]"), error);
+    return error;
+    }
+
+TInt CTmsAudioServicesTestClass::CreateRingTonePlayer(
+        CStifItemParser& /*aItem */)
+    {
+    FTRACE(FPrint(_L("CTmsAudioServicesTestClass::CreateRingTonePlayer")));
+    iLog->Log(_L("CTmsAudioServicesTestClass::CreateRingTonePlayer"));
+    TInt error = TMS_RESULT_SUCCESS;
+    if (iFactory)
+        {
+        error = iFactory->CreateRingTonePlayer(iRingTonePlayer);
+        if (error == TMS_RESULT_SUCCESS)
+            {
+            iRingTonePlayer->AddObserver(*this, NULL);
+            }
+        }
+    iLog->Log(_L("CTmsAudioServicesTestClass::CreateRingTonePlayer Error [%d]"), error);
+    return error;
+    }
+
+TInt CTmsAudioServicesTestClass::InitRingTonePlayer(CStifItemParser& aItem)
+    {
+    FTRACE(FPrint(_L("CTmsAudioServicesTestClass::InitRingTonePlayer")));
+    iLog->Log(_L("CTmsAudioServicesTestClass::InitRingTonePlayer"));
+
+    TInt error = TMS_RESULT_SUCCESS;
+    TPtrC StreamType;
+    error = aItem.GetNextString(StreamType);
+
+    if (error == TMS_RESULT_SUCCESS && iRingTonePlayer)
+        {
+        if (StreamType == KTagRTDefault)
+            {
+            error = iRingTonePlayer->Init(TMS_RINGTONE_DEFAULT);
+            }
+        else if (StreamType == KTagRTFile)
+            {
+            TBuf<sizeof(KTestFile3)> buf(KTestFile3);
+            iRTStr = g_string_new_len((gchar*) buf.Ptr(), buf.Length() * 2);
+            error = iRingTonePlayer->Init(TMS_RINGTONE_FILE, iRTStr);
+            g_string_free(iRTStr, TRUE);
+            iRTStr = NULL;
+            }
+        else if (StreamType == KTagRTBeepOnce)
+            {
+            error = iRingTonePlayer->Init(TMS_RINGTONE_BEEP_ONCE);
+            }
+        else if (StreamType == KTagRTSilent)
+            {
+            error = iRingTonePlayer->Init(TMS_RINGTONE_SILENT);
+            }
+        else if (StreamType == KTagRTUnsecureVoIP)
+            {
+            error = iRingTonePlayer->Init(TMS_RINGTONE_UNSECURE_VOIP);
+            }
+        else if (StreamType == KTagRTSequence)
+            {
+            TBuf8<sizeof(KRTBeepSequence)> buf(KRTBeepSequence);
+            iRTStr = g_string_new_len((gchar*) buf.Ptr(), buf.Length());
+            error = iRingTonePlayer->Init(TMS_RINGTONE_SEQUENCE, iRTStr);
+            g_string_free(iRTStr, TRUE);
+            }
+        else if (StreamType == KTagRTTts)
+            {
+            TBuf<sizeof(KTextToSpeak)> buf(KTextToSpeak);
+            iTTSStr = g_string_new_len((gchar*) buf.Ptr(), buf.Length() * 2);
+            error = iRingTonePlayer->Init(TMS_RINGTONE_DEFAULT, NULL,
+                    iTTSStr);
+            g_string_free(iTTSStr, TRUE);
+            iTTSStr = NULL;
+            }
+        else
+            {
+            iLog->Log(KMsgBadTestParameters);
+            error = KErrBadTestParameter;
+            }
+
+        if (error == TMS_RESULT_SUCCESS)
+            {
+            AddExpectedEvent(ERTInitComplete, KMediumTimeout);
+            }
+        }
+    iLog->Log(_L("CTmsAudioServicesTestClass::InitRingTonePlayer Error [%d]"), error);
+    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(ERTPlayComplete, KMediumTimeout);
+        }
+    else
+        {
+        error = KErrNotFound;
+        }
+
+    iLog->Log(_L("CTmsAudioServicesTestClass::PlayRingTone Error [%d]"), error);
+    return error;
+    }
+
+TInt CTmsAudioServicesTestClass::PlayRingToneNoEvent(CStifItemParser& /*aItem*/)
+    {
+    FTRACE (FPrint(_L("CTmsAudioServicesTestClass::PlayRingToneNoEvent")));
+    iLog->Log(_L("CTmsAudioServicesTestClass::PlayRingToneNoEvent"));
+    TInt error = KErrNone;
+
+    if (iRingTonePlayer)
+        {
+        iRingTonePlayer->Play();
+        // Not expecting any event - will allow to cancel
+        }
+    else
+        {
+        error = KErrNotFound;
+        }
+
+    iLog->Log(_L("CTmsAudioServicesTestClass::PlayRingToneNoEvent Error [%d]"), error);
+    return error;
+    }
+
+TInt CTmsAudioServicesTestClass::PauseRingTone(CStifItemParser& /*aItem*/)
+    {
+    FTRACE (FPrint(_L("CTmsAudioServicesTestClass::PauseRingTone")));
+    iLog->Log(_L("CTmsAudioServicesTestClass::PauseRingTone"));
+    TInt error = KErrNone;
+
+    if (iRingTonePlayer)
+        {
+        iRingTonePlayer->Pause();
+        RemoveExpectedEvent(ERTPlayComplete);
+        }
+    else
+        {
+        error = KErrNotFound;
+        }
+
+    iLog->Log(_L("CTmsAudioServicesTestClass::PauseRingTone Error [%d]"), error);
+    return error;
+    }
+
+TInt CTmsAudioServicesTestClass::StopRingTone(CStifItemParser& /*aItem*/)
+    {
+    FTRACE (FPrint(_L("CTmsAudioServicesTestClass::StopRingTone")));
+    iLog->Log(_L("CTmsAudioServicesTestClass::StopRingTone"));
+    TInt error = KErrNotFound;
+    if (iRingTonePlayer)
+        {
+        error = iRingTonePlayer->Stop();
+        RemoveExpectedEvent(ERTPlayComplete);
+        }
+    iLog->Log(_L("CTmsAudioServicesTestClass::StopRingTone Error [%d]"), error);
+    return error;
+    }
+
+TInt CTmsAudioServicesTestClass::MuteRingTone(CStifItemParser& /*aItem*/)
+    {
+    FTRACE (FPrint(_L("CTmsAudioServicesTestClass::MuteRingTone")));
+    iLog->Log(_L("CTmsAudioServicesTestClass::MuteRingTone"));
+    TInt error = KErrNotFound;
+    if (iRingTonePlayer)
+        {
+        error = iRingTonePlayer->Mute();
+        }
+    iLog->Log(_L("CTmsAudioServicesTestClass::MuteRingTone Error [%d]"), error);
+    return error;
+    }
+
+TInt CTmsAudioServicesTestClass::CloseRingTonePlayer(CStifItemParser& /*aItem*/)
+    {
+    FTRACE (FPrint(_L("CTmsAudioServicesTestClass::CloseRingTonePlayer")));
+    iLog->Log(_L("CTmsAudioServicesTestClass::CloseRingTonePlayer"));
+    TInt error = KErrNotFound;
+    if (iFactory && iRingTonePlayer)
+        {
+        error = iRingTonePlayer->Deinit();
+        error |= iRingTonePlayer->RemoveObserver(*this);
+        error |= iFactory->DeleteRingTonePlayer(iRingTonePlayer);
+        }
+    iLog->Log(_L("CTmsAudioServicesTestClass::CloseRingTonePlayer Error [%d]"), error);
+    return error;
+    }
+
+TInt CTmsAudioServicesTestClass::CreateInbandTonePlayer(CStifItemParser& /*aItem*/)
+    {
+    FTRACE (FPrint(_L("CTmsAudioServicesTestClass::CreateInbandTonePlayer")));
+    iLog->Log(_L("CTmsAudioServicesTestClass::CreateInbandTonePlayer"));
+    TInt error = KErrNotFound;
+
+    if (iFactory && !iInbandTonePlayer)
+        {
+        error = iFactory->CreateInbandTonePlayer(iInbandTonePlayer);
+        if (iInbandTonePlayer)
+            {
+            iInbandTonePlayer->AddObserver(*this, NULL);
+            }
+        }
+    iLog->Log(_L("CTmsAudioServicesTestClass::CreateInbandTonePlayer Error [%d]"), error);
+    return error;
+    }
+
+TInt CTmsAudioServicesTestClass::StartInbandTone(CStifItemParser& aItem)
+    {
+    FTRACE (FPrint(_L("CTmsAudioServicesTestClass::StartInbandTone")));
+    iLog->Log(_L("CTmsAudioServicesTestClass::StartInbandTone"));
+    TInt error = TMS_RESULT_SUCCESS;
+    TPtrC StreamType;
+    error = aItem.GetNextString(StreamType);
+
+    if (error == TMS_RESULT_SUCCESS && iInbandTonePlayer)
+        {
+        if (StreamType == KTagUserBusy)
+            {
+            error = iInbandTonePlayer->Start(TMS_INBAND_USER_BUSY);
+            }
+        else if (StreamType == KTagRadioPathNotFound)
+            {
+            error = iInbandTonePlayer->Start(TMS_INBAND_RADIO_PATH_NOT_AVAIL);
+            }
+        else if (StreamType == KTagCongestion)
+            {
+            error = iInbandTonePlayer->Start(TMS_INBAND_CONGESTION);
+            }
+        else if (StreamType == KTagSpecialInfo)
+            {
+            error = iInbandTonePlayer->Start(TMS_INBAND_SPECIAL_INFO);
+            }
+        else if (StreamType == KTagReorder)
+            {
+            error = iInbandTonePlayer->Start(TMS_INBAND_REORDER);
+            }
+        else if (StreamType == KTagAlerting)
+            {
+            error = iInbandTonePlayer->Start(TMS_INBAND_REMOTE_ALEARTING);
+            }
+        else if (StreamType == KTagWaiting)
+            {
+            error = iInbandTonePlayer->Start(TMS_INBAND_CALL_WAITING);
+            }
+        else if (StreamType == KTagDataCall)
+            {
+            error = iInbandTonePlayer->Start(TMS_INBAND_DATA_CALL);
+            }
+        else if (StreamType == KTagNoSequence)
+            {
+            error = iInbandTonePlayer->Start(TMS_INBAND_NO_SEQUENCE);
+            }
+        else if (StreamType == KTagBeepSequence)
+            {
+            error = iInbandTonePlayer->Start(TMS_INBAND_BEEP_SEQUENCE);
+            }
+        else
+            {
+            iLog->Log(KMsgBadTestParameters);
+            error = KErrBadTestParameter;
+            }
+        }
+
+    if (error == TMS_RESULT_SUCCESS)
+        {
+        AddExpectedEvent(EInbToneStarted, KShortTimeout);
+        }
+
+    iLog->Log(_L("CTmsAudioServicesTestClass::StartInbandTone Error [%d]"), error);
+    return error;
+    }
+
+TInt CTmsAudioServicesTestClass::StopInbandTone(CStifItemParser& /*aItem*/)
+    {
+    FTRACE (FPrint(_L("CTmsAudioServicesTestClass::StopInbandTone")));
+    iLog->Log(_L("CTmsAudioServicesTestClass::StopInbandTone"));
+    TInt error = KErrNotFound;
+    if (iFactory && iInbandTonePlayer)
+        {
+        error = iInbandTonePlayer->Stop();
+        RemoveExpectedEvent(EInbToneStarted);
+        }
+    iLog->Log(_L("CTmsAudioServicesTestClass::StopInbandTone Error [%d]"), error);
+    return error;
+    }
+
+TInt CTmsAudioServicesTestClass::CloseInbandTonePlayer(CStifItemParser& /*aItem*/)
+    {
+    FTRACE (FPrint(_L("CTmsAudioServicesTestClass::CloseInbandTonePlayer")));
+    iLog->Log(_L("CTmsAudioServicesTestClass::CloseInbandTonePlayer"));
+    TInt error = KErrNotFound;
+    if (iFactory && iInbandTonePlayer)
+        {
+        error = iInbandTonePlayer->RemoveObserver(*this);
+        error |= iFactory->DeleteInbandTonePlayer(iInbandTonePlayer);
+        }
+    iLog->Log(_L("CTmsAudioServicesTestClass::CloseInbandTonePlayer Error [%d]"), error);
+    return error;
+    }
+
 // ----------------------------------------------------------------------------
 // CTmsTestEngine::DoLoopback
 //
@@ -3127,12 +3457,12 @@
 
         Mem::Copy(desptr, srcptr, srcsize);
 
-        static_cast<TMSClientSource*>(iTmsClientSource)->BufferFilled(
+        static_cast<TMSClientSource*> (iTmsClientSource)->BufferFilled(
                 *iPlayBuf);
-        static_cast<TMSClientSink*>(iTmsClientSink)->BufferProcessed(iRecBuf);
+        static_cast<TMSClientSink*> (iTmsClientSink)->BufferProcessed(iRecBuf);
 
         iPlayBufReady = EFalse; // buf filled, ready for FillBuffer
-        iRecBufReady = EFalse; // buf consumed, ready for EmptyBuffer
+        iRecBufReady = EFalse;  // buf consumed, ready for EmptyBuffer
         }
 
     iLog->Log(_L("CTmsAudioServicesTestClass::DoLoopback END"));
--- a/mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/src/TmsAudioServicesTestClassBlocksCallbacks.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/src/TmsAudioServicesTestClassBlocksCallbacks.cpp	Fri May 14 16:22:35 2010 +0300
@@ -144,6 +144,7 @@
 void CTmsAudioServicesTestClass::EffectsEvent(const TMSEffect& tmseffect,
         TMSSignalEvent /*event*/)
     {
+    iLog->Log(_L("[tms cb]CTmsAudioServicesTestClass::EffectsEvent"));
     TMSEffectType effecttype;
     const_cast<TMSEffect&>(tmseffect).GetType(effecttype);
     switch (effecttype)
@@ -179,3 +180,71 @@
             break;
         }
     }
+
+// From TMSRingToneObserver
+void CTmsAudioServicesTestClass::RingtoneEvent(const TMSRingTone& /*rt*/,
+        TMSSignalEvent event)
+    {
+    iLog->Log(_L("[tms cb]CTmsAudioServicesTestClass::RingtoneEvent"));
+    gint reason = event.reason;
+    switch (event.type)
+        {
+        case TMS_EVENT_RINGTONE_OPEN_COMPLETE:
+            iLog->Log(_L("[tms cb]RingtoneEvent ERTInitComplete"));
+            ProcessEvent(ERTInitComplete, KErrNone);
+            break;
+        case TMS_EVENT_RINGTONE_PLAY_COMPLETE:
+            iLog->Log(_L("[tms cb]RingtoneEvent ERTPlayComplete"));
+            ProcessEvent(ERTPlayComplete, KErrNone);
+            break;
+        case TMS_EVENT_RINGTONE_DEINIT_COMPLETE:
+            iLog->Log(_L("[tms cb]RingtoneEvent ERTDeinitComplete"));
+            ProcessEvent(ERTDeinitComplete, KErrNone);
+            break;
+        default:
+            break;
+        }
+    }
+
+// From TMSDTMFObserver
+void CTmsAudioServicesTestClass::DTMFEvent(const TMSDTMF& /*dtmf*/,
+        TMSSignalEvent event)
+    {
+    iLog->Log(_L("[tms cb]CTmsAudioServicesTestClass::DTMFEvent"));
+    gint reason = event.reason;
+    switch (event.type)
+        {
+        case TMS_EVENT_DTMF_TONE_STARTED:
+            //ProcessEvent(EDTMFToneStarted, KErrNone);
+            iLog->Log(_L("DTMF Tone Started"));
+            break;
+        case TMS_EVENT_DTMF_TONE_STOPPED:
+            ProcessEvent(EDTMFToneStopped, KErrNone);
+            iLog->Log(_L("DTMF Tone Stopped"));
+            break;
+        default:
+            break;
+        }
+    }
+
+// From TMSInbandToneObserver
+void CTmsAudioServicesTestClass::InbandToneEvent(
+        const TMSInbandTone& /*inbandtone*/, TMSSignalEvent event)
+    {
+    iLog->Log(_L("[tms cb]CTmsAudioServicesTestClass::InbandToneEvent"));
+    gint reason = event.reason;
+    switch (event.type)
+        {
+        case TMS_EVENT_INBAND_TONE_STARTED:
+            //ProcessEvent(EInbToneStarted, KErrNone);
+            iLog->Log(_L("Inband Tone Started"));
+            break;
+        case TMS_EVENT_INBAND_TONE_STOPPED:
+            //ProcessEvent(EInbToneStopped, KErrNone);
+            iLog->Log(_L("Inband Tone Stopped"));
+            break;
+        default:
+            break;
+        }
+    }
+
--- a/mmserv/audioeffectsui/equalizer/bwinscw/EqualizerU.DEF	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-EXPORTS
-	?ExecuteLD@CEqualizerPresetsDialog@@QAEHXZ @ 1 NONAME ; int CEqualizerPresetsDialog::ExecuteLD(void)
-	?NewL@CEqualizerPresetsDialog@@SAPAV1@PAVCAudioEqualizerUtility@@HAAVMEqualizerPresetActivationObserver@@@Z @ 2 NONAME ; class CEqualizerPresetsDialog * CEqualizerPresetsDialog::NewL(class CAudioEqualizerUtility *, int, class MEqualizerPresetActivationObserver &)
-	?SetAudioEqualizerL@CEqualizerPresetsDialog@@QAEXPAVCAudioEqualizerUtility@@@Z @ 3 NONAME ; void CEqualizerPresetsDialog::SetAudioEqualizerL(class CAudioEqualizerUtility *)
-
--- a/mmserv/audioeffectsui/equalizer/data/Equalizer.rss	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,447 +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:    RSS for Equalizer
-*
-*/
-
-
-
-//  RESOURCE IDENTIFIER
-NAME    EQUI // 4 letter ID
-
-//  INCLUDES
-#include <eikon.rh>
-#include <avkon.rh>
-#include <avkon.loc>
-#include <avkon.rsg>
-#include <avkon.mbg>
-
-#include "Equalizer.rh"
-#include "Equalizer.hrh"
-#include <equalizer.loc>
-
-
-//  CONSTANTS  
-// EqualizerEngine has a limit of 32 characters for the preset name
-#define KMaxPresetNameLength 32 
-//  MACROS  
-
-//  RESOURCE DEFINITIONS 
-
-RESOURCE RSS_SIGNATURE { }
-
-RESOURCE TBUF { buf=""; }
-
-RESOURCE CBA r_equalizer_softkeys_options_back__select
-    {
-    buttons = 
-        {
-        CBA_BUTTON {id=EAknSoftkeyOptions; txt = text_softkey_option;},
-        CBA_BUTTON {id=EAknSoftkeyBack; txt = text_softkey_back; },
-        CBA_BUTTON {id=EAknSoftkeySelect;  txt=qtn_msk_eq_activate;}
-        };
-    }
-    
-RESOURCE CBA r_equalizer_softkeys_options_back__contextoptions
-    {
-    buttons =
-        {
-        CBA_BUTTON {id=EAknSoftkeyOptions; txt = text_softkey_option;},
-        CBA_BUTTON {id=EAknSoftkeyBack; txt = text_softkey_back; },
-        CBA_BUTTON {id=EAknSoftkeyContextOptions; txt = text_softkey_option;}
-        };
-    }
-
-RESOURCE EIK_APP_INFO
-    {
-    menubar=r_equalizer_container_menubar;
-    cba=R_AVKON_SOFTKEYS_OPTIONS_BACK;     
-    }
-
-//----------------------------------------------------
-//   
-//    r_equalizer_container_menubar
-//    This resource is used to create the Equalizer 
-//    listbox view  menubar
-//
-//----------------------------------------------------
-//
-RESOURCE MENU_BAR r_equalizer_container_menubar
-    {
-    titles= 
-        {
-        MENU_TITLE { menu_pane=r_equalizer_container_menu; txt=""; }
-        };
-    }
-
-//----------------------------------------------------
-//   
-//    r_equalizer_container_menu
-//    This resource is used to create the equalizer 
-//    menu items
-//
-//----------------------------------------------------
-//
-RESOURCE MENU_PANE r_equalizer_container_menu
-    {
-    items=
-        {
-        MENU_ITEM { command=EEqualizerCmdActivate;  
-        txt=qtn_eq_options_activate;
-#ifdef SINGLE_CLICK_INCLUDED
-        flags = EEikMenuItemAction;
-#endif
-        },
-        MENU_ITEM { command=EEqualizerCmdEdit;  txt=qtn_eq_options_edit;
-#ifdef SINGLE_CLICK_INCLUDED
-        flags = EEikMenuItemSpecific;
-#endif
-        },
-        MENU_ITEM { command=EEqualizerCmdCreateNew; 
-        txt=qtn_eq_options_create_new;},
-        MENU_ITEM { command=EEqualizerCmdDelete;  txt=qtn_eq_options_delete;},
-        MENU_ITEM { command=EEqualizerCmdRename;  txt=qtn_eq_options_rename;},
-        MENU_ITEM {command = EEqualizerCmdHelp; txt=qtn_options_help;},
-        MENU_ITEM { command = EAknCmdExit ;  txt=qtn_options_exit;}
-        };
-    }
-
-//----------------------------------------------------
-//   
-//    r_equalizer_settings_menubar
-//    This resource is used to create the Equalizer
-//    frequency bands view menubar
-//
-//----------------------------------------------------
-//
-RESOURCE MENU_BAR r_equalizer_settings_menubar
-    {
-    titles=
-        {
-        MENU_TITLE { menu_pane=r_equalizer_settings_menu; txt=""; }
-        };
-    }
-
-//----------------------------------------------------
-//   
-//    r_equalizer_settings_menu
-//    This resource is used to create the equalizer
-//    frequency bands view menu items
-//
-//----------------------------------------------------
-//
-RESOURCE MENU_PANE r_equalizer_settings_menu
-    {
-    items=
-        {
-        MENU_ITEM { command=EEqualizerCmdReset;  txt=qtn_eq_options_reset;},
-        MENU_ITEM {command = EEqualizerCmdHelp; txt=qtn_options_help;},
-        MENU_ITEM { command = EAknCmdExit ;  txt=qtn_options_exit;}
-        };
-    }
-
-// ---------------------------------------------------------
-//   
-//   r_equalizer_editing_dialog
-//   Dialog used for the equalizer editing view
-//
-// ---------------------------------------------------------
-//
-RESOURCE DIALOG r_equalizer_editing_dialog
-    {
-    flags = EEikDialogFlagNoDrag | EEikDialogFlagCbaButtons |
-             EEikDialogFlagWait| EEikDialogFlagFillAppClientRect; 
-     
-    buttons = r_equalizer_softkeys_options_back__contextoptions;  
-
-    items =
-        {
-        DLG_LINE
-            {
-            id = EEqualizerCustomCtrlDlgCIdCustomControl;
-            type = EEqualizerCustomCtrlDlgCtCustomControl; 
-            control=EQUALIZER_CONTROL
-                {
-                };
-            }            
-        };
-    }
-
-// ---------------------------------------------------------
-//   
-//   r_equalizer_dialog
-//   Dialog used for the equalizer preset view
-//
-// ---------------------------------------------------------
-//
-RESOURCE DIALOG r_equalizer_dialog
-    {
-    flags = EEikDialogFlagNoDrag | EEikDialogFlagCbaButtons |
-              EEikDialogFlagWait| EEikDialogFlagFillAppClientRect | EEikDialogFlagNotifyEsc; 
-    title = qtn_eq_title_equalizer;
-    buttons = r_equalizer_softkeys_options_back__select;
-
-    items =
-        {
-        DLG_LINE
-            {
-            type = EAknCtSingleGraphicListBox;
-            id = ESelectionListControl; 
-            control = LISTBOX
-                {
-                flags = EAknListBoxSelectionList;
-                };
-            }
-        };
-    }
- 
-// ---------------------------------------------------------
-//   
-//   r_dialog_text_rename_item_name
-//   Dialog for the name of a to be renamed item
-//
-// ---------------------------------------------------------
-//
-RESOURCE DIALOG r_dialog_text_rename_item_name
-    {
-    flags = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
-    items =
-        {
-        DLG_LINE
-            {
-            type = EAknCtQuery;
-            id = EGeneralQuery;
-            control = AVKON_DATA_QUERY
-                {
-                layout = EDataLayout;
-                label = qtn_fldr_item_name_prmpt;
-                control = EDWIN
-                    {
-          flags = EEikEdwinNoLineOrParaBreaks; 
-                    maxlength = KMaxPresetNameLength;
-                    };
-                };
-            }
-        };
-    }
-
-// ---------------------------------------------------------
-//   
-//   r_dialog_text_new_item_name
-//   Dialog for the name of a new item
-//
-// ---------------------------------------------------------
-//
-RESOURCE DIALOG r_dialog_text_new_item_name
-    {
-    flags = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
-    items =
-        {
-        DLG_LINE
-            {
-            type = EAknCtQuery;
-            id = EGeneralQuery;
-            control = AVKON_DATA_QUERY
-                {
-                layout = EDataLayout;
-                label = qtn_eq_title_preset_name;
-                control = EDWIN
-                    {
-                    flags = EEikEdwinNoLineOrParaBreaks; 
-                    maxlength = KMaxPresetNameLength;
-                    };
-                };
-            }
-        };
-    }
-
-// ---------------------------------------------------------
-//   
-//   r_equalizer_confirmation_query
-//   For delete confirmation
-//
-// ---------------------------------------------------------
-//
-RESOURCE DIALOG r_equalizer_confirmation_query
-    {
-    flags = EGeneralQueryFlags;
-    buttons = R_AVKON_SOFTKEYS_YES_NO;
-    items =
-        {
-        DLG_LINE
-            {
-            type = EAknCtQuery;
-            id = EGeneralQuery;
-            control = AVKON_CONFIRMATION_QUERY 
-                { 
-                layout = EConfirmationLayout;
-                };
-            }
-        };
-    }
-
-// ---------------------------------------------------
-//
-//    r_qtn_equalizer_title_text
-//
-// ---------------------------------------------------
-//
-RESOURCE TBUF r_qtn_equalizer_title_text
-    {
-    buf = qtn_eq_title_equalizer;
-    }
-
-// ---------------------------------------------------
-//
-//    r_qtn_eq_preset_default_name
-//
-// ---------------------------------------------------
-//
-RESOURCE TBUF r_qtn_eq_preset_default_name
-    {
-    buf = qtn_eq_preset_default_name;
-    }
-
-// ---------------------------------------------------
-//
-//    r_eq_note_info_preset_activated
-//
-// ---------------------------------------------------
-//
-RESOURCE TBUF r_qtn_eq_note_info_preset_activated
-    {
-    buf = qtn_eq_note_info_preset_activated;
-    }
-
-// ---------------------------------------------------
-//
-//    r_qtn_eq_note_err_preset_in_use_no_rename
-//
-// ---------------------------------------------------
-//
-RESOURCE TBUF r_qtn_eq_note_err_preset_in_use_no_rename
-    {
-    buf = qtn_eq_note_err_preset_in_use_no_rename;
-    }
-
-// ---------------------------------------------------
-//
-//    r_eq_note_err_preset_in_use
-//
-// ---------------------------------------------------
-//
-RESOURCE TBUF r_qtn_eq_note_err_preset_in_use
-    {
-    buf = qtn_eq_note_err_preset_in_use;
-    }
-
-// ---------------------------------------------------
-//
-//    r_qtn_query_common_conf_delete
-//
-// ---------------------------------------------------
-//
-RESOURCE TBUF r_qtn_query_common_conf_delete
-    {
-    buf = qtn_query_common_conf_delete;
-    }
-
-// ---------------------------------------------------
-//
-//    r_qtn_fldr_illegal_characters
-//
-// ---------------------------------------------------
-//
-RESOURCE TBUF r_qtn_fldr_illegal_characters
-    {
-    buf = qtn_fldr_illegal_characters;
-    }
-
-// ---------------------------------------------------
-//
-//    r_qtn_fldr_name_already_used
-//
-// ---------------------------------------------------
-//
-RESOURCE TBUF r_qtn_fldr_name_already_used
-    {
-    buf = qtn_fldr_name_already_used;
-    }  
-    
-// ---------------------------------------------------
-//
-//    r_qtn_equalizer_preset_none
-//
-// ---------------------------------------------------
-//
-RESOURCE TBUF r_qtn_equalizer_preset_none
-    {
-    buf = qtn_eq_preset_none;
-    }
-
-// ---------------------------------------------------
-//
-//    r_qtn_memlo_not_enough_memory
-//
-// ---------------------------------------------------
-//
-RESOURCE TBUF r_qtn_memlo_not_enough_memory
-    {
-    buf = qtn_memlo_not_enough_memory;
-    }
-
-// ---------------------------------------------------
-//
-//    r_qtn_eq_preset_frequency_hz
-//
-// ---------------------------------------------------
-//
-RESOURCE TBUF r_qtn_eq_preset_frequency_hz	
-	{ 
-		buf= qtn_eq_preset_frequency_hz; 
-	}
-		
-// ---------------------------------------------------
-//
-//    r_qtn_eq_preset_frequency_khz
-//
-// ---------------------------------------------------
-//
-RESOURCE TBUF r_qtn_eq_preset_frequency_khz	
-	{ 
-		buf= qtn_eq_preset_frequency_khz; 
-	}
-    
-// ---------------------------------------------------------
-//   
-//   r_equalizer_predefined_presets
-//   Predefined preset names with localised names
-//
-// ---------------------------------------------------------
-//
-RESOURCE ARRAY r_equalizer_predefined_presets		
-	{
-	items=
-		{
-		LBUF { txt = "Rock""\t"qtn_eq_preset_rock; },
-		LBUF { txt = "Pop""\t"qtn_eq_preset_pop; },
-		LBUF { txt = "Jazz""\t"qtn_eq_preset_jazz; },
-		LBUF { txt = "Classic""\t"qtn_eq_preset_classic; },
-		LBUF { txt = "Bass Booster""\t"qtn_eq_preset_bassboost; }
-		};
-	}
-
-// End of File
--- a/mmserv/audioeffectsui/equalizer/eabi/EqualizerU.DEF	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-EXPORTS
-	_ZN23CEqualizerPresetsDialog18SetAudioEqualizerLEP22CAudioEqualizerUtility @ 1 NONAME
-	_ZN23CEqualizerPresetsDialog4NewLEP22CAudioEqualizerUtilityiR34MEqualizerPresetActivationObserver @ 2 NONAME
-	_ZN23CEqualizerPresetsDialog9ExecuteLDEv @ 3 NONAME
-	_ZTI23CEqualizerPresetsDialog @ 4 NONAME ; #<TI>#
-	_ZTV23CEqualizerPresetsDialog @ 5 NONAME ; #<VT>#
-
--- a/mmserv/audioeffectsui/equalizer/group/Equalizer.mmp	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,105 +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:    Project file for Equalizer DLL
-*
-*/
-
-
-
-    
-#include <bldvariant.hrh>
-#include <data_caging_paths.hrh>
-#include <platform_paths.hrh>
-#include "../../inc/audioeffectsuibldvariant.hrh"
-
-TARGET Equalizer.dll
-TARGETTYPE dll
-UID 0x1000008d 0x101FD659
-
-CAPABILITY CAP_GENERAL_DLL
-VENDORID VID_DEFAULT
-
-#ifdef IAD_INCLUDE_SINGLE_CLICK 
-MACRO SINGLE_CLICK_INCLUDED
-#endif
-
-SOURCEPATH      ../src
-SOURCE EqualizerMain.cpp
-SOURCE EqualizerPresetsDialog.cpp
-SOURCE EqualizerFreqBandContainer.cpp
-SOURCE EqualizerPresetListArray.cpp
-SOURCE EqualizerFreqBand.cpp
-SOURCE EqualizerEditingDialog.cpp
-
-USERINCLUDE     ../inc
-USERINCLUDE 	../../../inc
-
-MW_LAYER_SYSTEMINCLUDE
-SYSTEMINCLUDE   /epoc32/include/mmf/server
-SYSTEMINCLUDE   /epoc32/include/mmf/common
-SYSTEMINCLUDE   /epoc32/include/app	// temporary fix build break on header relocation change
- 
-SOURCEPATH ../data
-START RESOURCE Equalizer.rss
-HEADER
-TARGETPATH APP_RESOURCE_DIR
-LANGUAGE_IDS
-END // RESOURCE
-
-LIBRARY euser.lib
-LIBRARY apparc.lib
-LIBRARY cone.lib 
-LIBRARY eikcore.lib 
-LIBRARY eikcoctl.lib 
-LIBRARY avkon.lib
-LIBRARY estor.lib 
-LIBRARY bafl.lib 
-LIBRARY commonengine.lib
-LIBRARY eikctl.lib
-LIBRARY eikcdlg.lib
-LIBRARY eikdlg.lib
-LIBRARY fbscli.lib
-LIBRARY ws32.lib
-LIBRARY efsrv.lib
-LIBRARY audioequalizerutility.lib
-LIBRARY audioequalizereffect.lib
-LIBRARY CdlEngine.lib
-LIBRARY AknSkins.lib
-LIBRARY egul.lib
-LIBRARY AknLayout2Scalable.lib
-LIBRARY AknIcon.lib
-LIBRARY hlplch.lib // for "Help" options menu
-LIBRARY featmgr.lib
-LIBRARY aknnotify.lib
-LIBRARY SysUtil.lib
-LIBRARY aknlayout2.lib
-LIBRARY centralrepository.lib
-#if defined(RD_TACTILE_FEEDBACK)
-LIBRARY touchfeedback.lib
-#endif
-
-#if defined(ARMCC)
-deffile ../eabi/ 
-#elif defined(WINSCW)
-deffile ../bwinscw/ 
-#elif defined(WINS)
-deffile ../bwins/ 
-#else
-deffile ../bmarm/ 
-#endif
-
-//LANG SC
-
-// End of File
-
--- a/mmserv/audioeffectsui/equalizer/group/EqualizerIcons.txt	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-/c8,8 empty13x13
-/c8,8 qgn_prop_psln_active
-/c8,8 qgn_indi_mup_eq_bg
-/c8,8 qgn_indi_mup_eq_slider
--- a/mmserv/audioeffectsui/equalizer/group/EqualizerIcons2.txt	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-/c8,8 empty13x13
-/c8,8 qgn_prop_psln_active
-/c8,8 qgn_indi_mup2_eq_bg
-/c8,8 qgn_indi_mup_eq_slider
--- a/mmserv/audioeffectsui/equalizer/group/bld.inf	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +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:    This file provides the information required for building the 
-*                implementation collection.
-*
-*/
-
-
-
-
-#include <platform_paths.hrh>
-
-#include "../help/group/bld.inf"
-
-PRJ_PLATFORMS
-// specify the platforms your component needs to be built for here
-
-PRJ_EXPORTS
-// iby file
-../rom/Equalizer.iby           CORE_MW_LAYER_IBY_EXPORT_PATH(Equalizer.iby)
-../rom/EqualizerResources.iby  LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(EqualizerResources.iby)
-
-// loc file
-../loc/equalizer.loc  MW_LAYER_LOC_EXPORT_PATH(equalizer.loc)
-
-PRJ_EXTENSIONS
-START EXTENSION s60/mifconv
-OPTION TARGETFILE equalizer.mif
-OPTION HEADERFILE equalizer.mbg
-OPTION SOURCES -c8,8 empty13x13 -c8,8 qgn_prop_psln_active \
-               -c8,8 qgn_indi_mup2_eq_bg -c8,8 qgn_indi_mup_eq_slider
-END
-
-PRJ_MMPFILES
-// Specify the .mmp files required for building the important component
-// releasables. Note that you should specify any .mmp files for test
-// programs further down the file.
-
-
-Equalizer.mmp
-
-
-// End of File
-
--- a/mmserv/audioeffectsui/equalizer/group/icons.mk	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +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:    This file is used to invoke "mifconv" tool to 
-#                  generate mbm and mif files
-#
-
-ifeq (WINS,$(findstring WINS, $(PLATFORM)))
-ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\Z
-else
-ZDIR=\epoc32\data\z
-endif
-
-TARGETDIR=$(ZDIR)\resource\apps
-ICONTARGETFILENAME=$(TARGETDIR)\equalizer.mif
-
-HEADERDIR=\epoc32\include
-HEADERFILENAME=$(HEADERDIR)\equalizer.mbg
-
-ICONLISTFILE=..\Group\EqualizerIcons2.txt
-
-do_nothing :
-	@rem do_nothing
-
-MAKMAKE : do_nothing
-
-BLD : do_nothing
-
-CLEAN : do_nothing
-
-LIB : do_nothing
-
-CLEANLIB : do_nothing
-
-# ----------------------------------------------------------------------------
-# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by
-# MifConv if the mask detph is defined.
-#
-# NOTE 2: Usually, source paths should not be included in the bitmap
-# definitions. MifConv searches for the icons in all icon directories in a
-# predefined order, which is currently \s60\icons, \s60\bitmaps2.
-# The directory \s60\icons is included in the search only if the feature flag
-# __SCALABLE_ICONS is defined.
-# ----------------------------------------------------------------------------
-
-RESOURCE : 
-	mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) /f$(ICONLISTFILE)
-
-FREEZE : do_nothing
-
-SAVESPACE : do_nothing
-
-RELEASABLES :
-	@echo $(HEADERFILENAME)&& \
-	@echo $(ICONTARGETFILENAME)
-
-FINAL : do_nothing
-
-
--- a/mmserv/audioeffectsui/equalizer/group/icons_dc.mk	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +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:    This file is used to invoke "mifconv" tool to 
-#                  generate mbm and mif files
-#
-
-ifeq (WINS,$(findstring WINS, $(PLATFORM)))
-ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\Z
-else
-ZDIR=\epoc32\data\z
-endif
-
-TARGETDIR=$(ZDIR)\resource\apps
-ICONTARGETFILENAME=$(TARGETDIR)\equalizer.mif
-
-HEADERDIR=\epoc32\include
-HEADERFILENAME=$(HEADERDIR)\equalizer.mbg
-
-ICONLISTFILE=..\Group\EqualizerIcons.txt
-	
-do_nothing :
-	@rem do_nothing
-
-MAKMAKE : do_nothing
-
-BLD : do_nothing
-
-CLEAN : do_nothing
-
-LIB : do_nothing
-
-CLEANLIB : do_nothing
-
-# ----------------------------------------------------------------------------
-# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by
-# MifConv if the mask detph is defined.
-#
-# NOTE 2: Usually, source paths should not be included in the bitmap
-# definitions. MifConv searches for the icons in all icon directories in a
-# predefined order, which is currently \s60\icons, \s60\bitmaps2.
-# The directory \s60\icons is included in the search only if the feature flag
-# __SCALABLE_ICONS is defined.
-# ----------------------------------------------------------------------------
-
-RESOURCE : 
-	mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) /f$(ICONLISTFILE)
-
-FREEZE : do_nothing
-
-SAVESPACE : do_nothing
-
-RELEASABLES :
-	@echo $(HEADERFILENAME)&& \
-	@echo $(ICONTARGETFILENAME)
-
-FINAL : do_nothing
-
-
Binary file mmserv/audioeffectsui/equalizer/help/data/xhtml.zip has changed
--- a/mmserv/audioeffectsui/equalizer/help/group/bld.inf	Mon May 03 12:59:52 2010 +0300
+++ /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:
-* Export help related files.
-*
-*/
-
-#include <platform_paths.hrh>				
-PRJ_EXPORTS
-:zip ../data/xhtml.zip   /epoc32/data/z/resource/ overwrite
-:zip ../data/xhtml.zip   /epoc32/winscw/c/resource/ overwrite
-
-../inc/eq.hlp.hrh	MW_LAYER_PLATFORM_EXPORT_PATH(csxhelp/eq.hlp.hrh)
-../rom/equalizerhelps_variant.iby		CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(equalizerhelps_variant.iby)
--- a/mmserv/audioeffectsui/equalizer/help/inc/eq.hlp.hrh	Mon May 03 12:59:52 2010 +0300
+++ /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:
-*
-*/
-	
-//
-// eq.hlp.hrh generated by CSXHelp Utilities.
-//           
-
-#ifndef __EQ_HLP_HRH__
-#define __EQ_HLP_HRH__
-
-_LIT(KEQ_HLP_EDITING_VIEW, "EQ_HLP_EDITING_VIEW"); // 
-_LIT(KEQ_HLP_LIST_VIEW, "EQ_HLP_LIST_VIEW"); // 
-
-#endif 
\ No newline at end of file
--- a/mmserv/audioeffectsui/equalizer/help/rom/equalizerhelps_variant.iby	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +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: Help IBY file
-*
-*/
-
-
-#ifndef __EQUALIZERHELPS_VARIANT_IBY__
-#define __EQUALIZERHELPS_VARIANT_IBY__
-
-#if defined(FF_S60_HELPS_IN_USE) 
-    data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x101FD659\contents.zip, RESOURCE_FILES_DIR\xhtml\%02d\0x101FD659\contents.zip)
-    data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x101FD659\index.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x101FD659\index.xml)
-    data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x101FD659\keywords.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x101FD659\keywords.xml)
-    data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x101FD659\meta.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x101FD659\meta.xml)
-#endif
-
-#endif
\ No newline at end of file
--- a/mmserv/audioeffectsui/equalizer/inc/Equalizer.hrh	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +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:    This file contains declarations for constants of Equalizer
-*
-*/
-
-
-
-#ifndef EQUALIZER_HRH
-#define EQUALIZER_HRH
-
-// DATA TYPES
-
-// Used as Command ids for menubar
-enum TEqualizerCommandIds
-    {
-    EEqualizerCmdActivate = 1,
-    EEqualizerCmdEdit,
-    EEqualizerCmdCreateNew,
-    EEqualizerCmdDelete,
-    EEqualizerCmdRename,
-    EEqualizerCmdHelp,
-    EEqualizerCmdReset
-    };
-
-// Used for custom Control Id and type   
-enum TEqualizerCustomControlIds
-    {    
-    EEqualizerCustomCtrlDlgCIdCustomControl = 1000,
-    EEqualizerCustomCtrlDlgCtCustomControl
-    };
-
-//Used for the equalizer varieties   
-enum TEqualizerVarieties
-    {
-    EEqualizerVarietyNotUsed = -1,
-    EEqualizerVarietyOne = 0,
-    EEqualizerVarietyTwo
-    };    
-
-//Used for retriving the rect from the layout information
-enum TEqualizerComponents
-    {
-    EEqualizerFreqBand1 = 0,
-    EEqualizerFreqBand2,
-    EEqualizerFreqBand3,
-    EEqualizerFreqBand4,
-    EEqualizerFreqBand5,
-    EEqualizerFreqBand6,
-    EEqualizerFreqBand7,
-    EEqualizerFreqBand8,
-    EEqualizerMainPane,
-    EEqualizerScale,
-    EEqualizerBackground,
-    EEqualizerSlider
-    };    
-    
-#endif     //EQUALIZER_HRH
-// End of File
--- a/mmserv/audioeffectsui/equalizer/inc/Equalizer.rh	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +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:    RH for storing Custom Control parameters struct
-*
-*/
-
-
-
-
-#ifndef EQUALIZER_RH
-#define EQUALIZER_RH
-
-STRUCT EQUALIZER_CONTROL
-    {
-    }
-
-#endif //EQUALIZER_RH
-
-// End of File 
-
--- a/mmserv/audioeffectsui/equalizer/inc/EqualizerEditingDialog.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,194 +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:    Declares classes related to Equalizer Settings
-*
-*/
-
-
-
-
-#ifndef EQUALIZEREDITINGDIALOG_H
-#define EQUALIZEREDITINGDIALOG_H
-
-//  INCLUDES
-#include <AknDialog.h> 
-#include "EqualizerPrivateConstants.h"
-
-#include "EqualizerPresetsDialog.h"
-// FORWARD DECLARATIONS
-class CAudioEqualizerUtility;
-class CEqualizerFreqBandContainer;
-
-// CLASS DECLARATIONS
-NONSHARABLE_CLASS(CEqualizerEditingDialog) : public CAknDialog
-    {
-    public:      // Constructors and destructor
-    
-        /**
-        * This function is called to create an object of 
-        * type CEqualizerPresetsDialog - Two phase Construction
-        * @since 3.0
-        * @param aAudEqUtility a pointer to CAudioEqualizerUtility 
-        * @param aPresetIndex the index into the preset array retrieved
-        * with the method CAudioEqualizerUtility::Presets()
-        * @param aRect a reference to the view rectangle
-        * returned by CAudioEqualizerUtility::Presets()         
-        * @param aIsPresetActive whether the preset is active or not? 
-        */
-        static CEqualizerEditingDialog* NewL(
-        CAudioEqualizerUtility* aAudEqUtility,const TInt aPresetIndex, 
-        TRect& aRect, const TBool aIsPresetActive,
-        MEqualizerPresetActivationObserver& aObs,
-        TInt aPresetKey);
-        /**
-        * Destructor
-        * @since 3.0
-        */
-       virtual ~CEqualizerEditingDialog(); 
-    
-    public:      // New functions  
-        /**
-        * This function is used to execute the Dialog.
-        * @since 3.0
-        * @returns return value of CAknDialog::ExecuteLD()   
-        */
-        TInt ExecuteLD();
-        /**
-        * This function is used to read the positions of the mover for the 
-        * frequency bands from the engine.
-        * @since 3.0
-        * @param aReset Whether the preset is being reset
-        */
-        void SetMoverPositionsL(TBool aReset);   
-        
-        /**
-        * This function is used to set new values for CAudioEqualizerUtility* 
-        * @since 3.0
-        * @param aAudEqUtility New pointer to CAudioEqualizerUtility
-        */
-        void SetAudioEqualizerL(CAudioEqualizerUtility* aAudEqUtility);    
-
-        /**
-        * This function is used to return current mover position for each frequence band
-        * @since 3.0
-        * @param aBandIndex Frequence band index for which mover position is required
-        * @returns current mover position
-        */
-        TInt GetMoverPosition(TInt aBandIndex);   
- 
-    private:
-        /**
-        * First Phase Constructor
-        * @since 3.0
-        * @param aAudEqUtility a pointer to CAudioEqualizerUtility 
-        * @param aPresetIndex the index into the preset array retrieved
-        * with the method CAudioEqualizerUtility::Presets()
-        * @param aRect a reference to the view rectangle
-        * returned by CAudioEqualizerUtility::Presets()         
-        * @param aIsPresetActive whether the preset is active or not? 
-        */
-        CEqualizerEditingDialog(CAudioEqualizerUtility* aAudEqUtility,
-        const TInt aPresetIndex, TRect& aRect, 
-        const TBool aIsPresetActive,
-        MEqualizerPresetActivationObserver& aObs,
-        TInt aPresetKey);
-         
-        /**
-        * Second Phase Constructor
-        * @since 3.0
-        */
-        void ConstructL();
-       
-    private: // Functions from base classes  
-        /**
-        * From CAknDialog Called when a key event happens.
-        */
-        TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, 
-            TEventCode aType ); 
-        /**
-        * From CAknDialog Called just before the menu pane is displayed
-        */
-        void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane);
-        /**
-        * From CAknDialog Called just before the menu pane is displayed
-        */
-        void ProcessCommandL(TInt  aCommandId); 
-        /**
-        * From CAknDialog Called when OK key is pressed
-        */
-        TBool OkToExitL(TInt aButtonId);
-        /**
-        * From CAknDialog Called when a custom control is to be created
-        */
-        SEikControlInfo CreateCustomControlL  (  TInt  aControlType   );
-
-        /**
-        * From CAknDialog
-        * This function will respond to any change in the controls size.
-        */
-        void SizeChanged();
-        /**
-        * Get help context for the control.
-        * @param aContext The context that is filled in.
-        * @return None.
-        */
-        void GetHelpContext( TCoeHelpContext& aContext ) const;
-
-		/**
-		* This function is called to retrieve the rectangle
-		* of the freq band control, scale and slider from the layout
-		*/
-      	void GetLayoutRect();
-
-    private:
-        // Used to store a pointer to CAudioEqualizerUtility 
-        CAudioEqualizerUtility* iAudEqUtility;
-        // Used to store a pointer to CEqualizerFreqBandContainer 
-        CEqualizerFreqBandContainer* iFreqBandContainer;
-        // Used to store the preset name
-        TPresetName iPresetName;
-        // The index of the preset in the array returned by
-        // CAudioEqualizerUtility::Presets()
-        const TInt iPresetIndex;
-        // The rectangle in which the Dialog is displayed
-        TRect& iRect;
-        // Whether the preset displayed is an active preset?
-        const TBool iIsActivePreset;
-        // Used to store the offset of the resource file
-        TInt iResourceFileOffset;
-        // Stores the positions of the movers in the various bands.
-        CArrayFix<TInt>* iMover;
-        // Number of Frequency bands 
-        TUint iNumberOfFreqBands;   
-        // Ignore Key events between track changes
-        TBool iIgnoreKeyEvents;   
-		// Array to store the rects of the freq band
-        RArray<TRect> iFreqBandRect;
-        // Array to store the rects of the freq band scale
-        RArray<TRect> iScaleRect;
-        // Array to store the rects of the background
-        RArray<TRect> iBackgroundRect;
-        // Array to store the rects of the slider
-        RArray<TRect> iSliderRect;
-		// Used to determine if context sensitive menu is ON or not when pressing MSK
-        TBool iContextSensitiveMenu;
-       
-        // Observer for changing presets
-        MEqualizerPresetActivationObserver& iObserver;
-        TInt iPresetKey;
-  };
-
-#endif     //EQUALIZEREDITINGDIALOG_H
-
-// End of File
--- a/mmserv/audioeffectsui/equalizer/inc/EqualizerFreqBand.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,216 +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:    Declares classes related to Equalizer Settings
-*
-*/
-
-
-
-
-#ifndef EQUALIZERFREQBAND_H
-#define EQUALIZERFREQBAND_H
-
-//  INCLUDES
-#include <AknDialog.h> 
-#include "EqualizerPrivateConstants.h"
-
-// FORWARD DECLARATIONS
-class CAudioEqualizerUtility;
-class CAudioEqualizer;
-
-// CLASS DECLARATIONS
-
-NONSHARABLE_CLASS(CEqualizerFreqBand)  : public CCoeControl
-    {
-    public:      // Constructors and destructor
-        /**
-        * This function is called to create an object of 
-        * type CEqualizerFreqBand - Two phase Construction
-        * @since 3.0
-        * @param aaEqEditingDialog a reference to CEqualizerEditingDialog
-        * @param aAudEqUtility a reference to CAudioEqualizerUtility 
-        * @param aPresetIndex the index of the Preset being edited
-        * @param aIsActivePreset whether the preset is active or not?
-        * @param aBandIndex the index of the Frequncy band
-        * @param aContainerRect the CEqualizerFreqBandContainer rectangle
-        */
-        static CEqualizerFreqBand* NewL(CEqualizerEditingDialog* aEqEditingDialog,
-         CAudioEqualizerUtility*& aAudEqUtility, 
-         const TInt aPresetIndex, const TBool aIsActivePreset, const TInt aBandIndex, 
-         TRect& aContainerRect);
-        /**
-        * This function is called to create an object of 
-        * type CEqualizerFreqBand - Two phase Construction
-        * @since 3.0
-        * @param aaEqEditingDialog a reference to CEqualizerEditingDialog
-        * @param aAudEqUtility a reference to CAudioEqualizerUtility 
-        * @param aPresetIndex the index of the Preset being edited
-        * @param aIsActivePreset whether the preset is active or not?
-        * @param aBandIndex the index of the Frequncy band
-        * @param aContainerRect the CEqualizerFreqBandContainer rectangle
-        */
-        static CEqualizerFreqBand* NewLC(CEqualizerEditingDialog* aEqEditingDialog,
-         CAudioEqualizerUtility*& aAudEqUtility, 
-         const TInt aPresetIndex, const TBool aIsActivePreset, const TInt aBandIndex, 
-         TRect& aContainerRect);
-        /**
-        * Destructor
-        * @since 3.0
-        */
-        virtual ~CEqualizerFreqBand();
-
-    public:     // Functions from base classes 
-        /**
-        * From CCoeControl Called when user presses a key
-        */
-        TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,
-           TEventCode aType);
-    
-    public:
-    
-		/**
-		* Function to return the Rect of the controls from the 
-		* layout [read from the CDL file].
-		* TRect aRect :  parent controls rect
-		* TInt aVariety : equalizer variety based on the number 
-		* of frequnecy bands
-		* TInt aComponentNumber : Controls which are enumerated for
-		* which the rectangle is required from the layout
-		*/
-        static TRect ComponentRect(const TRect& aRect, TInt aVariety, 
-                                                TInt aComponentNumber);
-    
-    private://Constructors
-        /**
-        * This function is called to create an object of 
-        * type CEqualizerFreqBand - First phase Constructor
-        * @since 3.0
-        * @param aaEqEditingDialog a reference to CEqualizerEditingDialog
-        * @param aAudEqUtility a reference to CAudioEqualizerUtility 
-        * @param aPresetIndex the index of the Preset being edited
-        * @param aIsActivePreset whether the preset is active or not?
-        * @param aBandIndex the index of the Frequncy band
-        * @param aContainerRect the CEqualizerFreqBandContainer rectangle
-        */
-        CEqualizerFreqBand(CEqualizerEditingDialog* aEqEditingDialog,CAudioEqualizerUtility*& aAudEqUtility, 
-         const TInt aPresetIndex, const TBool aIsActivePreset, 
-         const TInt aBandIndex,
-         TRect& aContainerRect); 
-
-        /*
-        * Second Phase Constructor
-        */
-        void ConstructL();    
-        
-    private: // New functions 
-        /**
-        *This function is called to load the bitmaps from the icons file
-        */
-        void LoadBitmapsL();
-        
-        /**
-        * This member is called by the Equalizer UI to update the new band
-        * level in the engine 
-        * a new preset. 
-        * @ since Series 60 3.0
-        * lastIncFlag : Flag which indicates that the slider has reached the
-        * the limits
-        */
-        void UpdateBandLevelInEngineL(TBool lastIncFlag);
-    public: // New functions 
-       /**
-        * This function is used to set new values for CAudioEqualizerUtility* 
-        * @since 3.0
-        * @param aAudEqUtility New pointer to CAudioEqualizerUtility
-        */
-        void SetAudioEqualizerL(CAudioEqualizerUtility* aAudEqUtility);
-
-#ifdef RD_SCALABLE_UI_V2
-       /**
-        * This function is used by the frequency band container to send 
-        * pointer events to individual bands 
-        * @since 3.2
-        * @param aPointerEvent pointer event 
-        */
-        void HandlePointerEventL(const TPointerEvent& aPointerEvent);
-#endif //RD_SCALABLE_UI_V2
-
-    private: // Functions from base classes      
-        /**
-        * From CCoeControl Called to draw a control
-        */
-        void Draw(const TRect& aRect) const;
-        /**
-        * From CCoeControl Called when the control's size is changed
-        */
-        void SizeChanged();   
-        /**
-        * From CCoeControl Called when a control's focus is changed
-        */
-        void FocusChanged(TDrawNow aDrawNow);
-            
-        /**
-        * From CCoeControl
-        * This function is called when there is a skin change or
-        * change in the layout
-        */
-        void HandleResourceChange(TInt aType);      
-    
-    private:   //Data
-        //Pointers to hold the equalizer backgroung bitmap and mask
-        CFbsBitmap * iBgBitmap;
-        CFbsBitmap * iBgBitmapMask;
-
-        //Pointers to hold the equalizer scale bitmap and mask
-        CFbsBitmap * iSliderBitmap;
-        CFbsBitmap * iSliderBitmapMask;
-        
-        // Stores the zero position of mover
-        TInt iZeroPos;
-        // Minimum frequency band decibel level 
-        TInt32 iMinBandLevel;
-        // Maximum frequency band decibel level 
-        TInt32 iMaxBandLevel;        
-        // Used to store a pointer to CEqualizerEditingDialog 
-        CEqualizerEditingDialog* iEqEditingDialog;
-        // Used to store a pointer to CAudioEqualizerUtility 
-        CAudioEqualizerUtility* iAudEqUtility;
-        // Used to store a pointer to CAudioEqualizer 
-        CAudioEqualizer* iAudioEqualizer;
-        // The index of the preset in the array returned by
-        // CAudioEqualizerUtility::Presets()
-        const TInt iPresetIndex;
-        // Used to store the name of the preset
-        TPresetName iPresetName;
-        // Whether the preset displayed is an active preset?
-        const TBool iIsActivePreset;
-        // Index of the Frequency Band as passed to Engine
-        const TInt iBandIndex;
-        // Position of the mover
-        TInt iMoverPos;
-        //Stores the container's rect value
-        TRect& iContainerRect;  
-        //Stores the freq band Scale's rectangle
-        TRect iScaleRect;
-        //Stores the slider's rectangle
-        TRect iSliderRect;
-        //Stores the background rectangle
-        TRect iBackgroundRect;
-		//Stores the step count of the slider
-        TInt32 iStepCount;
-        };
-
-
-#endif //EQUALIZERFREQBAND_H
-// End of File
--- a/mmserv/audioeffectsui/equalizer/inc/EqualizerFreqBandContainer.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,185 +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:    Declares class for frequency band container
-*
-*/
-
-
-
-
-#ifndef EQUALIZERFREQBANDCONTAINER_H
-#define EQUALIZERFREQBANDCONTAINER_H
-
-//  INCLUDES
-#include <AknDialog.h> 
-#include "EqualizerFreqBand.h"
-#include "EqualizerPrivateConstants.h"
-
-// FORWARD DECLARATIONS
-class CAudioEqualizerUtility;
-class CAudioEqualizer;
-class CAknsBasicBackgroundControlContext;
-
-// CLASS DECLARATIONS
-
-//////////////////////////////////////////////////////////////////////////////
-//
-// -----> CEqualizerFreqBandContainer(definition)
-//
-//////////////////////////////////////////////////////////////////////////////
-NONSHARABLE_CLASS(CEqualizerFreqBandContainer)  : public CCoeControl
-    {
-    public:
-        /**
-          * This function is called to create an object of 
-          * type CEqualizerFreqBandContainer - First phase Constructor
-          * @since 3.0
-          * @param aaEqEditingDialog a reference to CEqualizerEditingDialog
-          * @param aAudEqUtility a pointer to CAudioEqualizerUtility 
-          * @param aPresetIndex the index of the Preset being edited
-          * @param aIsActivePreset whether the preset is active or not?
-          * @param aRect the CEqualizerFreqBandContainer rectangle
-          */
-        CEqualizerFreqBandContainer(
-        CEqualizerEditingDialog* aEqEditingDialog, 
-        CAudioEqualizerUtility* aAudEqUtility, 
-        const TInt aPresetIndex, const TBool aIsActivePreset, TRect& aRect,
-        MEqualizerPresetActivationObserver& aObserver, TInt aPresetKey,
-        TPresetName& aPresetName ); 
-        /**
-         * Destructor
-         * @since 3.0
-         */
-        virtual ~CEqualizerFreqBandContainer();
-  
-    public:     
-        /**
-         * Handles key events 
-         * @param aKeyEvent key event.
-         * @param aType key code
-         * @return TKeyResponse
-         */
-        TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); 
-  
- 
-   private:  //New Functions
-        void ConstructL(TRect& aRect);
-        /**
-         * This function is used to swap the focus from one control to other
-         * @since 3.0
-         * @param aPrevControl Previous control
-         * @param aNewControl New Control
-         */
-        void SwapFocus(CCoeControl* aPrevControl, CCoeControl* aNewControl) ;
-
-        /**
-         * This function is used to construct the frequency value labels
-         * @since 3.2
-         */
-        void ConstructLabelsL();
-   
-   public: // New functions     
-       /**
-        * This function is used to set new values for CAudioEqualizerUtility* 
-        * @since 3.0
-        * @param aAudEqUtility New pointer to CAudioEqualizerUtility
-        */
-        void SetAudioEqualizerL(CAudioEqualizerUtility* aAudEqUtility);
-        
-    private:  //Functions from base classes    
-        /**
-         * This function is called by the framework whenever a custom control
-         * is constructed inside the Dialog
-         */
-        void ConstructFromResourceL(TResourceReader& aReader);
-        /**
-         * Virtual, defined by CCoeControl; replaces the default implementation
-         * provided by CCoeControl.
-         */        
-        void         Draw(const TRect& /*aRect*/) const;
-
-        /**
-         * Virtual, defined by CCoeControl; replaces the default implementation
-         * provided by CCoeControl. 
-         */
-        TInt         CountComponentControls() const;
-
-        /** Virtual, defined by CCoeControl; replaces the default implementation
-         * provided by CCoeControl.
-         */
-        CCoeControl* ComponentControl(TInt aIndex) const;
-        /**
-         *Virtual, defined by CCoeControl; empty implementation provided by
-         * CCoeControl; full implementation provided by this class
-         */
-        void         SizeChanged();
-        /*
-         * From CCoeControl Called when a control's focus is changed
-         */
-        void FocusChanged(TDrawNow aDrawNow);
-
-        /*
-		* From CCoeControl
-		* @see CCoeControl
-		*/
-		TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
-		
-#ifdef RD_SCALABLE_UI_V2
-        /*
-		* From CCoeControl
-		* @see CCoeControl
-		*/
-		void HandlePointerEventL(const TPointerEvent& aPointerEvent);
-#endif //RD_SCALABLE_UI_V2
-
-    private:
-        // Data members defined and used by this class.
-        //Array of frequency band pointers  
-        CArrayPtr<CEqualizerFreqBand>* iFreqBand;
-        // Stores the currently focussed frequency band
-        CCoeControl*    iFocussedFreqBand;
-        // Stores the Index of the currently focussed frequency band
-        TUint           iIndexOfFocussedFreqBand;
-        // Used to store a pointer to CEqualizerEditingDialog 
-        CEqualizerEditingDialog* iEqEditingDialog;
-        // Used to store a pointer to CAudioEqualizerUtility 
-        CAudioEqualizerUtility* iAudEqUtility;
-        // Used to store the preset index
-        const TInt iPresetIndex;
-        // Whether the preset displayed is an active preset?
-        const TBool iIsActivePreset;  
-        // Rectangle in which to display the control 
-        TRect& iRect;
-        // Number of Frequency bands 
-        TUint iNumberOfFreqBands;
-        // For skin in the background
-        CAknsBasicBackgroundControlContext* iBackGround;
-        //Array of frequence band labels
-        CArrayPtr<CEikLabel>* iFreqLabels;
-        
-        // Observer for changing equalizer presets
-        MEqualizerPresetActivationObserver& iObserver;
-        TInt iPresetKey;
-
-        // Used to indicate a band is selected in touch
-        TBool iBandSelected;
-
-        // Used to store the preset name
-        TPresetName iPresetName;
-    
-    };
-
-#endif     //EQUALIZERFREQBANDCONTAINER_H
-
-// End of File
--- a/mmserv/audioeffectsui/equalizer/inc/EqualizerPresetListArray.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,168 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:    Item text array for Equalizer listbox.
-*
-*/
-
-
-
-
-
-#ifndef CEQUALIZERPRESETLISTARRAY_H
-#define CEQUALIZERPRESETLISTARRAY_H
-
-//  INCLUDES
-#include "EqualizerPrivateConstants.h"
-#include <AudioEqualizerUtility.h>
-
-// FORWARD DECLARATIONS
-
-
-// CLASS DECLARATION
-
-/**
-*  Item text array for playlist listbox. 
-*   Creates item text descriptors according to playlist data stored to playlist
-*   model.
-*
-*  @lib Equalizer.dll
-*  @since 3.0
-*/
-NONSHARABLE_CLASS(CEqualizerPresetListArray) : public CBase,
-                              public MDesCArray
-    {
-    public:  // Constructors and destructor
-
-        /**
-         * Two-phased constructor.
-         * @since 3.0
-         * @param aAudEqUtility a pointer to CAudioEqualizerUtility 
-         * @param aActivePreset Currently active preset
-         */
-        static CEqualizerPresetListArray* NewL(
-                   CAudioEqualizerUtility*  aAudioEqUtil,
-                   TInt aActivePresetKey);
-        
-        /**
-        * Destructor.
-        */
-        virtual ~CEqualizerPresetListArray();
-    
-    public: //New Functions
-        /**
-         * Used to set the currently active preset
-         * @since 3.0
-         * @param aActivePreset Currently active preset
-         */
-        void SetCurrentActivePreset(const TPtrC& aActivePreset);
-        
-		/** 
-         * Returns the currently actibe preset
-         */        
-		void CEqualizerPresetListArray::GetCurrentActivePreset(TPresetName&
-                                       aActivePreset);
-		/** 
-         * Updates the sorted array with the changed user-defined presets
-         */
-        void UpdateSortedArrayL();
-        
-        /**
-        * Returns the PresetNameKey given the localised name for the preset
-        */
-		void GetPresetKeyFromLocalisedName(TInt& aPresetNameKey, 
-											const TPresetName& aPresetName);
-        /**
-        * Returns the localised name for the preset given the PresetNameKey
-        */
-		void GetLocalisedPresetNameFromKey(TInt aPresetNameKey, 
-											 TPresetName& aPresetName);
-											 
-       /**
-        * This function is used to set new values for currently active preset 
-        * @since 3.0
-        * @param aActivePreset Active preset
-        */
-        void SetCurrentActivePreset(const TDesC& aActivePreset);
-       
-       /**
-        * This function is used to set new values for CAudioEqualizerUtility* 
-        * @since 3.0
-        * @param aAudEqUtility New pointer to CAudioEqualizerUtility
-        */
-        void SetAudioEqualizer(CAudioEqualizerUtility* aAudEqUtility);    
-        
-        /**
-        * This function is used to get the length of prefix (eg "0\t")
-        * before the preset name. 
-        * @since 3.0
-        * @returns Length of the prefix
-        */
-        TInt CEqualizerPresetListArray::GetPrefixLength();
-        
-    public: // Functions from base classes
-
-        /**
-        * From MDesCArray, returns the number of descriptor elements
-        * in a descriptor
-        */
-        TInt MdcaCount() const;
-        
-        /**
-        * From MDesCArray, indexes into a descriptor array.
-        */
-        TPtrC MdcaPoint(TInt aIndex) const;
-        
-   
-    private: // Constructors
-
-        /**
-         * First-phase constructor.
-         * @since 3.0
-         * @param aAudioEqUtil a pointer to CAudioEqualizerUtility 
-         */
-        CEqualizerPresetListArray(CAudioEqualizerUtility*  aAudioEqUtil);
-        /**
-        * By default Symbian 2nd phase constructor is private.
-        */
-        void ConstructL(TInt aActivePresetKey);
-        
-        /** 
-        * Creates the ListBox text including the icon information. 
-        * e.g "0\tNone"
-        */
-        void CreateListBoxIconText(const TPtrC& aPresetName) const;
-
-        /**
-        * Searches for a localised name for a preset found in the CenRep
-        */
-        HBufC* SearchForPredefinedPresetL(const CDesCArray& 
-            aPresetArray, const TPresetName& aCenrepPreset);
-    private:    // Data
-        HBufC* iItem;
-        // Pointer to CAudioEqualizerUtility
-        CAudioEqualizerUtility* iAudEqUtility;
-        // This preset array contains alphabetically sorted user-defined
-        // presets
-        CDesCArray* iSortedPresetArray;
-        // This preset array contains localised predefined presets
-        CDesCArray* iPreDefinedPresetArray;    
-        //Preset "None"
-        HBufC* iPresetNoneText;
-        //Current active preset
-        TPresetName iActivePreset;
-    };
-
-#endif      // CEQUALIZERPRESETLISTARRAY_H
-            
-// End of File
--- a/mmserv/audioeffectsui/equalizer/inc/EqualizerPrivateConstants.h	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +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:    This file contains declarations for private constants for 
-*                Equalizer
-*
-*/
-
-
-
-#ifndef EQUALIZERPRIVATECONSTANTS_H
-#define EQUALIZERPRIVATECONSTANTS_H
-
-//  INCLUDES
-
-#include <e32std.h>
-#include <bldvariant.hrh>
-#include "EqualizerConstants.h"
-
-// CONSTANTS
-
-// Used as the maximum length of a Preset name
-const TInt KMaxPresetNameLength = 32;
-// Uid of Equalizer
-const TUid KUidEqualizer = { 0x101FD659 };
-// Used to set the array granularity for dynamic arrays
-const TUint KEqualizerArrayGranularity = 4;
-// Equalizer rsc file name
-_LIT( KEqualizerResourceFileName, "Z:Equalizer.rsc" );
-// Equalizer mif file name
-_LIT(KIconsFilename, "Z:Equalizer.mbm");
-// Used if the number of bands returned from engine is 8
-const TInt KEqualizerEightBands = 8;
-// Used if the number of bands returned from engine is 5
-const TInt KEqualizerFiveBands = 5;
-// Number of slider movements
-const TInt KNumberOfSteps = 20;
-
-// for old s60 musicplayer
-//const TUid KCRUidMusicPlayerSettings = {0x101F880C};
-//const TUint32 KMPlayerEqPresetId       = 0x00000009;
-const TUid KCRUidMusicPlayerSettings = {0x101FFCDC};
-const TUint32 KMPlayerEqPresetId = 0x00000001;
-
-// MACROS
-//Used in model text
-_LIT(KEqrTab, "\t");
-
-// DATA TYPES
-
-#endif      // EQUALIZERPRIVATECONSTANTS_H
-
-// End of File
--- a/mmserv/audioeffectsui/equalizer/inc/eq.hlp.hrh	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +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:    RH for storing Custom Control parameters struct
-*
-*/
-
-
-
-
-
-#ifndef __EQ_HLP_HRH__
-#define __EQ_HLP_HRH__
-
-
-_LIT(KEQ_HLP_LIST_VIEW,"EQ_HLP_LIST_VIEW"); //Selecting equalizer presets vuew
-_LIT(KEQ_HLP_EDITING_VIEW,"EQ_HLP_EDITING_VIEW"); //Editing frequency presets view
-
-#endif
--- a/mmserv/audioeffectsui/equalizer/loc/equalizer.loc	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,175 +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:    Localisation file for Equalizer dll
-*
-*/
-
-
-
-
-// LOCALISATION STRINGS
-
-//d: Displayed if the maximum number of presets is reached
-//l: popup_note_window
-//w:
-//r:3.0
-//
-#define qtn_eq_note_err_max_preset_number_reached "Maximum number of presets reached. Delete some preset and try again"
-
-//d: Command resets the values of presets to default values 
-//l: list_single_pane_t1_cp2
-//w:
-//r:3.0
-//
-#define qtn_eq_options_reset "Reset values"
-
-//d: Displayed if the user tries to rename a preset which is currently active
-//l: popup_note_window
-//w:
-//r:3.0
-//
-#define qtn_eq_note_err_preset_in_use_no_rename "Preset in use. Cannot be renamed."
-
-//d: Displayed if the user tries to delete a preset which is currently active
-//l: popup_note_window
-//w:
-//r:3.0
-//
-#define qtn_eq_note_err_preset_in_use "Preset in use. Unable to delete."
-
-//d: Displayed as the default name for a preset
-//l: popup_query_data_window
-//w:
-//r:3.0
-//
-#define qtn_eq_preset_default_name "Preset"
-
-//d: Displayed when the user tries to name a new preset
-//l: popup_query_data_window
-//w:
-//r:3.0
-//
-#define qtn_eq_title_preset_name "Preset name:"
-
-//d: Displayed when the user activates a preset
-//l: popup_note_window
-//w:
-//r:3.0
-//
-#define qtn_eq_note_info_preset_activated "Activated preset: %U"
-
-//d: This command isused to rename a preset 
-//l: list_single_pane_t1_cp2
-//w:
-//r:3.0
-//
-#define qtn_eq_options_rename "Rename"
-
-//d: This command is used to delete a preset 
-//l: list_single_pane_t1_cp2
-//w:
-//r:3.0
-//
-#define qtn_eq_options_delete "Delete"
-
-//d: This command is used to create a new preset 
-//l: list_single_pane_t1_cp2
-//w:
-//r:3.0
-//
-#define qtn_eq_options_create_new "Create new"
-
-//d: This command is used to edit preset values 
-//l: list_single_pane_t1_cp2
-//w:
-//r:3.0
-//
-#define qtn_eq_options_edit "Edit"
-
-//d: This command is used to activate a preset
-//l: list_single_pane_t1_cp2
-//w:
-//r:3.0
-//
-#define qtn_eq_options_activate "Activate"
-
-//d: A pre-defined preset.
-//l: list_single_graphic_pane_t1_cp2
-//w:
-//r:3.0
-//
-#define qtn_eq_preset_rock "Rock"
-
-//d: A pre-defined preset.
-//l: list_single_graphic_pane_t1_cp2
-//w:
-//r:3.0
-//
-#define qtn_eq_preset_pop "Pop"
-
-//d: A pre-defined preset.
-//l: list_single_graphic_pane_t1_cp2
-//w:
-//r:3.0
-//
-#define qtn_eq_preset_jazz "Jazz"
-
-//d: A pre-defined preset.
-//l: list_single_graphic_pane_t1_cp2
-//w:
-//r:3.0
-//
-#define qtn_eq_preset_classic "Classic"
-
-//d: A pre-defined preset.
-//l: list_single_graphic_pane_t1_cp2
-//w:
-//r:3.0
-//
-#define qtn_eq_preset_bassboost "Bass Booster"
-
-//d: Title of the Equalizer UI
-//l: title_pane_t2/opt9
-//w:
-//r:3.0
-//
-#define qtn_eq_title_equalizer "Equalizer"
-
-//d: A pre-defined preset.
-//l: list_single_graphic_pane_t1_cp2
-//w:
-//r:3.0
-//
-#define qtn_eq_preset_none "None"
-
-//d: Frequency band label for Hz.
-//l: main_mup_eq_pane_t9/opt2
-//w:
-//r:3.2
-//
-#define qtn_eq_preset_frequency_hz "Hz"
-
-//d: Frequency band label for KHz.
-//l: main_mup_eq_pane_t10/opt2
-//w:
-//r:3.2
-//
-#define qtn_eq_preset_frequency_khz "KHz"
-
-//d:Text in middle soft key (for Equalizer CBA)
-//l:control_pane_t3/opt7
-//w:
-//r:3.2
-#define qtn_msk_eq_activate  "Activate"
-// End of File
--- a/mmserv/audioeffectsui/equalizer/rom/Equalizer.iby	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +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 Equalizer
-*
-*/
-
-
-
-#ifndef EQUALIZER_IBY
-#define EQUALIZER_IBY
-
-S60_APP_BITMAP(Equalizer)
-file=ABI_DIR\BUILD_DIR\Equalizer.dll          SHARED_LIB_DIR\Equalizer.dll
-
-#endif
-// End of File
--- a/mmserv/audioeffectsui/equalizer/rom/EqualizerResources.iby	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +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 Equalizer Resources
-*
-*/
-
-
-
-#ifndef EQUALIZERRESOURCES_IBY__
-#define EQUALIZERRESOURCES_IBY__
-
-REM Equalizer
-
-data=DATAZ_\APP_RESOURCE_DIR\Equalizer.rsc       APP_RESOURCE_DIR\Equalizer.rsc
-
-#endif // EQUALIZERRESOURCES_IBY__
--- a/mmserv/audioeffectsui/equalizer/src/EqualizerEditingDialog.cpp	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,554 +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 functionality related to Equalizer Settings Dialog
-*
-*/
-
-
-
-// INCLUDE FILES
- 
-#include <bautils.h>
-#include <aknenv.h>      
-#include <avkon.hrh>
-#include <e32cmn.h>
-#include <data_caging_path_literals.hrh>
-//LAF and Skin changes 
-#include <aknlayout.cdl.h>
-#include <aknlayoutscalable_apps.cdl.h>
-#include <AknLayout2ScalableDef.h>
-#include <AknLayout2Def.h>
-#include <AknUtils.h>
-#include <bldvariant.hrh>
-#include <featmgr.h>
-#include <AudioEqualizerUtility.h>
-#include <hlplch.h>
-#include <StringLoader.h>
-#include <akntitle.h> 
-#include <aknnotewrappers.h>
-
-#include <Equalizer.rsg>
-#include "EqualizerPrivateConstants.h"
-#include <csxhelp/eq.hlp.hrh>
-#include "EqualizerEditingDialog.h"
-#include "EqualizerFreqBandContainer.h"       
-#include "Equalizer.hrh"
-
-// ============================ MEMBER FUNCTIONS =============================
-
-// -------------------------------------------------------------------
-// CEqualizerEditingDialog* CEqualizerEditingDialog::NewL(
-// CAudioEqualizerUtility& aAudEqUtility, 
-// const TInt aPresetIndex, TRect& aRect, const TBool aIsActivePreset)
-// Create instance of concrete ECOM interface implementation
-// -------------------------------------------------------------------
-// 
-CEqualizerEditingDialog* CEqualizerEditingDialog::NewL(
-CAudioEqualizerUtility* aAudEqUtility, const TInt aPresetIndex,
- TRect& aRect, const TBool aIsActivePreset,
- MEqualizerPresetActivationObserver& aObserver,
- TInt aPresetKey)
-    {
-    CEqualizerEditingDialog* self = new (ELeave) CEqualizerEditingDialog(
-        aAudEqUtility, aPresetIndex, aRect, aIsActivePreset, aObserver,
-        aPresetKey);
-    CleanupStack::PushL(self); 
-    self->ConstructL();
-    CleanupStack::Pop(self); 
-    return self;
-    }
-
-// -------------------------------------------------------------------
-// CEqualizerEditingDialog::ConstructL()
-// Second Phase Constructor
-// -------------------------------------------------------------------
-// 
-void CEqualizerEditingDialog::ConstructL()
-    {
-    //Initially set these variable to EFalse
-    iIgnoreKeyEvents = EFalse;
-    iContextSensitiveMenu = EFalse;
-
-    iPresetName = iAudEqUtility->GetPresetL(iPresetIndex);
-    CAudioEqualizer& audioEqualizer = iAudEqUtility->Equalizer();
-    iNumberOfFreqBands = audioEqualizer.NumberOfBands();
-    iMover=new(ELeave)CArrayFixSeg<TInt>(KEqualizerArrayGranularity);
-
-    iFreqBandRect = RArray<TRect>(iNumberOfFreqBands);
-    iScaleRect = RArray<TRect>(iNumberOfFreqBands);
-    iBackgroundRect = RArray<TRect>(iNumberOfFreqBands);
-    iSliderRect = RArray<TRect>(iNumberOfFreqBands);
-    GetLayoutRect();
-
-    // Find which drive this DLL is installed.
-    TFileName fileName;
-
-    // Get the full resource file
-    TParse fp;
-
-    // Add the resource dir
-    fp.Set( KEqualizerResourceFileName, &KDC_APP_RESOURCE_DIR, NULL);
-    // Get the filename with full path
-    fileName = fp.FullName();
-    //for localisation of resource file
-    BaflUtils::NearestLanguageFile( iEikonEnv->FsSession(), fileName );
-    iResourceFileOffset = iEikonEnv->AddResourceFileL( fileName );
-    CAknDialog::ConstructL(R_EQUALIZER_SETTINGS_MENUBAR);
-    }
-
-// ---------------------------------------------------------------------
-// CEqualizerEditingDialog::CEqualizerEditingDialog
-// (CAudioEqualizerUtility* aAudEqUtility, TInt aPresetIndex, 
-// TRect& aRect, const TBool aIsActivePreset)
-// First phase constructor
-// ---------------------------------------------------------------------
-// 
-CEqualizerEditingDialog::CEqualizerEditingDialog(CAudioEqualizerUtility*
-aAudEqUtility, const TInt aPresetIndex, TRect& aRect, 
-const TBool aIsActivePreset, MEqualizerPresetActivationObserver& aObserver,
-TInt aPresetKey ): 
-iAudEqUtility(aAudEqUtility), 
-iPresetIndex(aPresetIndex), iRect(aRect), 
-iIsActivePreset(aIsActivePreset),
-iObserver( aObserver ), iPresetKey( aPresetKey )
-    {
-    }
-
-// --------------------------------------------------------------------
-// CEqualizerEditingDialog::~CEqualizerEditingDialog()
-// Destructor
-// --------------------------------------------------------------------
-// 
-CEqualizerEditingDialog::~CEqualizerEditingDialog()
-    {
-    if (iResourceFileOffset)
-        {
-        iEikonEnv->DeleteResourceFile(iResourceFileOffset);      
-        }
-    
-    if (iMover)
-        {
-        iMover->Reset();
-        delete iMover;
-        }
-     
-    iFreqBandRect.Close();
-    iScaleRect.Close();
-    iBackgroundRect.Close();
-    iSliderRect.Close();
-    }
-
-// --------------------------------------------------------------------
-// SEikControlInfo CEqualizerEditingDialog::
-// CreateCustomControlL  (  TInt  aControlType   )
-// This function is called by the framework to create a custom control
-// inside the dialog
-// --------------------------------------------------------------------
-// 
-SEikControlInfo CEqualizerEditingDialog::CreateCustomControlL  (  TInt 
- aControlType   ) 
-    {
-    SEikControlInfo controlInfo;
-    controlInfo.iControl = NULL;
-    controlInfo.iTrailerTextId = 0;
-    controlInfo.iFlags = 0;
-
-    SetMoverPositionsL(EFalse);      
-   
-    switch ( aControlType)
-        {
-        case EEqualizerCustomCtrlDlgCtCustomControl:
-            controlInfo.iControl = new(ELeave) CEqualizerFreqBandContainer
-            (this, iAudEqUtility, iPresetIndex, iIsActivePreset, 
-             iRect, iObserver, iPresetKey, iPresetName); 
-             
-            iFreqBandContainer = (CEqualizerFreqBandContainer*)
-                                        controlInfo.iControl; 
-            break;
-        default:
-            break;
-        }
-    
-    return controlInfo;
-    }
-
-// -------------------------------------------------------------------
-// void CEqualizerEditingDialog::SizeChanged()
-//
-// This function is called by the framework whenever the control size 
-// is changed
-// --------------------------------------------------------------------
-//
-void CEqualizerEditingDialog::SizeChanged()
-    {
-    CAknDialog::SizeChanged();    
-    iRect = Rect();
-	GetLayoutRect();
-    CAudioEqualizer& audioEqualizer = iAudEqUtility->Equalizer();
-    iAudEqUtility->ModifyPresetL(iPresetIndex, iPresetName, audioEqualizer); 
-	iMover->Reset();
-	SetMoverPositionsL(EFalse);
-    }
-
-// -------------------------------------------------------------------
-// void CEqualizerEditingDialog::GetLayoutRect()
-//
-// This function is called to retrive the freqband rect, scale rect
-// slider rect from the layout
-// --------------------------------------------------------------------
-//
-void CEqualizerEditingDialog::GetLayoutRect()
-	{
-	iFreqBandRect.Reset();
-	iScaleRect.Reset();
-	iBackgroundRect.Reset();
-	iSliderRect.Reset();
-	
-	TInt variety = EEqualizerVarietyOne;
-        
-	if(iNumberOfFreqBands == KEqualizerFiveBands)
-		variety = EEqualizerVarietyTwo;
-	
-	for(TInt count = 0; count < iNumberOfFreqBands; count++)
-		{
-		iFreqBandRect.Append(CEqualizerFreqBand::ComponentRect(
-			iRect,variety+2,count));
-		iScaleRect.Append(CEqualizerFreqBand::ComponentRect(
-			iFreqBandRect[count],variety,EEqualizerScale));
-		iBackgroundRect.Append(CEqualizerFreqBand::ComponentRect(
-			iScaleRect[count],EEqualizerVarietyNotUsed,EEqualizerBackground));
-		iSliderRect.Append(CEqualizerFreqBand::ComponentRect(
-			iScaleRect[count],EEqualizerVarietyNotUsed,EEqualizerSlider));
-		}
-	}
-
-// --------------------------------------------------------------------
-// void CEqualizerEditingDialog::SetMoverPositionsL(TBool aReset)
-// This function is used to read the positions of the mover for the 
-// various bands from the engine.
-// --------------------------------------------------------------------
-// 
-void CEqualizerEditingDialog::SetMoverPositionsL(TBool aReset)
-    {
-    //Calulate change in db level
-    TInt32 minBandLevel;
-    TInt32 maxBandLevel;
-    iAudEqUtility->GetPresetL(iPresetIndex);
-    CAudioEqualizer& audioEqualizer = iAudEqUtility->Equalizer();
-
-    audioEqualizer.DbLevelLimits(minBandLevel, maxBandLevel);
-
-    //The minimum band level should always be negative and the
-    // maximum band level should always be positive.
-    if (( minBandLevel > 0 ) || (maxBandLevel < 0))
-        {
-        User::Leave(KErrNotSupported);
-        }
-
-    for (TInt i =0; i<iNumberOfFreqBands; i++)
-        {
-	    TInt scaleHeight = iBackgroundRect[i].Height();
-	    TInt scaleZeroPos = (iBackgroundRect[i].iTl.iY) + (scaleHeight / 2);
-
-		TInt halfSliderSize = iSliderRect[i].Height() / 2;
-		TInt sliderInc = iBackgroundRect[i].Height() / KNumberOfSteps;
-		TInt diffUIBandLevel = KNumberOfSteps / 2;
-
-        TInt curBandlevel = audioEqualizer.BandLevel(i+1);
-        
-        
-        __ASSERT_DEBUG((curBandlevel >= minBandLevel) ||
-                         (curBandlevel <= maxBandLevel), User::Invariant());
-        if ((curBandlevel < minBandLevel) || (curBandlevel > maxBandLevel))
-            {
-            curBandlevel = 0; //Band level is invalid, use zero instead.
-            }
-        
-        if (curBandlevel > 0)
-            {
-            TReal frac = (TReal)curBandlevel / maxBandLevel;
-            TInt moverPos = (TInt) (scaleZeroPos - (frac * 
-            								diffUIBandLevel * sliderInc));
-            if((moverPos < (iBackgroundRect[i].iTl.iY + halfSliderSize)) ||
-            			((scaleZeroPos - moverPos) >= (diffUIBandLevel * sliderInc)))
-            	{
-            	moverPos = iBackgroundRect[i].iTl.iY + halfSliderSize;
-            	}
-
-            if (aReset)
-                {
-                (*iMover)[i] = moverPos;    
-                }
-            else
-                {
-                iMover->AppendL(moverPos);    
-                }
-            }
-        else if (curBandlevel < 0)
-            {
-            TReal frac = (TReal)curBandlevel / minBandLevel;
-            TInt moverPos = (TInt) (scaleZeroPos + (frac * 
-            								diffUIBandLevel * sliderInc));
-            if((moverPos > ((iBackgroundRect[i].iBr.iY ) - halfSliderSize)) ||
-            		((moverPos - scaleZeroPos) >= (diffUIBandLevel * sliderInc)))
-            	{
-            	moverPos = (iBackgroundRect[i].iBr.iY ) - halfSliderSize;
-            	}
-
-            if (aReset)
-                {
-                (*iMover)[i] = moverPos;    
-                }
-            else
-                {
-                iMover->AppendL(moverPos);    
-                }
-            }
-        else
-            {
-            if (aReset)
-                {
-                (*iMover)[i] = scaleZeroPos;    
-                }
-            else
-                {
-                iMover->AppendL(scaleZeroPos);    
-                }
-            }   
-        }
-    }
-
-// ---------------------------------------------------------
-// CEqualizerEditingDialog::OfferKeyEventL(
-//     const TKeyEvent& aKeyEvent,TEventCode aType)
-// This function is used to handle key events
-// ---------------------------------------------------------
-//
-TKeyResponse CEqualizerEditingDialog::OfferKeyEventL(
-    const TKeyEvent& aKeyEvent,
-    TEventCode aType )
-    { 
-    if (iIgnoreKeyEvents)
-        {
-        return EKeyWasNotConsumed;
-        }
-    else
-        {
-        return CAknDialog::OfferKeyEventL( aKeyEvent, aType );        
-        }
-    }
-
-// -------------------------------------------------------------------
-// void CEqualizerEditingDialog::ProcessCommandL(TInt aCommandId)
-// This function is called by the framework to handle the user's
-// menubar command options
-// --------------------------------------------------------------------
-// 
-void CEqualizerEditingDialog::ProcessCommandL(TInt aCommandId)
-    {
-    // Need to do this in all cases or menu does not disappear after
-    // a selection is made
-    CAknDialog::ProcessCommandL(aCommandId);
-    
-    switch(aCommandId)
-        {
-        case EAknCmdExit :
-        case EEikCmdExit :
-            {
-            CAudioEqualizer& audioEqualizer = iAudEqUtility->Equalizer();
-			iAudEqUtility->ModifyPresetL(iPresetIndex, iPresetName, audioEqualizer);
-            iAvkonAppUi->HandleCommandL( aCommandId );
-            break;
-            }
-
-        case EEqualizerCmdHelp: 
-            {
-            HlpLauncher::LaunchHelpApplicationL
-                ( iEikonEnv->WsSession(),
-                 CEikonEnv::Static()->AppUi()->AppHelpContextL() );
-            break;
-            }
-
-        case EEqualizerCmdReset:
-            {
-            iAudEqUtility->GetPresetL(iPresetIndex);
-            CAudioEqualizer& audioEqualizer = iAudEqUtility->Equalizer();
- 
-            if (iPresetIndex < iAudEqUtility->NumberOfPreDefinedPresets())
-                 {
-                 //Predefined preset
-                 iAudEqUtility->ResetPresetL(iPresetIndex);     
-                 SetMoverPositionsL(ETrue);
-                 }
-             else
-                 {
-                 //User defined preset, Reset manually
-                 for (TInt i =0; i<iNumberOfFreqBands; i++)
-                     {
-					 TInt scaleHeight = iBackgroundRect[i].Height();
-				     TInt scaleZeroPos = (iBackgroundRect[i].iTl.iY) 
-				     									+ (scaleHeight / 2);
-				     (*iMover)[i] = scaleZeroPos;
-                     audioEqualizer.SetBandLevelL(i+1, 0);
-                     }
-                 iAudEqUtility->ModifyPresetL(iPresetIndex, iPresetName, 
-                   audioEqualizer);    
-                 }
-
-             if (iIsActivePreset)
-                 {
-                 TRAP_IGNORE(iAudEqUtility->ApplyPresetL(iPresetIndex));
-                 }
-             
-             // In MPX, we need to callback to observer when a preset is changed
-             if( iIsActivePreset )
-                 {
-                 iObserver.HandlePresetActivation( iPresetKey );
-                 }
-    		 iFreqBandContainer->SetRect(iRect);
-             DrawNow();
-             break;
-             }
-              
-        default:
-            {
-            break;
-            }
-        }
-    }
-
-// -------------------------------------------------------------------
-// void CEqualizerEditingDialog::GetHelpContext( 
-//            TCoeHelpContext& aContext ) const
-// Get help context for the control
-// --------------------------------------------------------------------
-//         
-void CEqualizerEditingDialog::GetHelpContext( 
-            TCoeHelpContext& aContext ) const
-    {
-    aContext.iMajor = KUidEqualizer;
-    aContext.iContext = KEQ_HLP_EDITING_VIEW;
-    }
-
-// ---------------------------------------------------------------------------
-// CEqualizerEditingDialog::DynInitMenuPaneL(
-//                              TInt aResourceId,CEikMenuPane* aMenuPane)
-//  This function is called by the EIKON framework just before it displays
-//  a menu pane. Its default implementation is empty, and by overriding it,
-//  the application can set the state of menu items dynamically according
-//  to the state of application data.
-// ---------------------------------------------------------------------------
-//
-void CEqualizerEditingDialog::DynInitMenuPaneL(
-                        TInt aResourceId, CEikMenuPane* aMenuPane)
-    {
-    if ( aResourceId == R_EQUALIZER_SETTINGS_MENU)
-        {
-        iMenuBar->SetMenuType(CEikMenuBar::EMenuOptions);
-        // Help should be displayed only if the feature is supported
-        // according to Feature Manager
-        if (!FeatureManager::FeatureSupported(KFeatureIdHelp))
-            {
-            aMenuPane->SetItemDimmed(EEqualizerCmdHelp, ETrue);
-            }
-            
-        if(iContextSensitiveMenu)
-        	{
-        	iMenuBar->SetMenuType(CEikMenuBar::EMenuContext);
-          	aMenuPane->SetItemDimmed(EAknCmdExit, ETrue);
-          	aMenuPane->SetItemDimmed(EEqualizerCmdHelp, ETrue);
-			iContextSensitiveMenu = EFalse;
-        	}
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CEqualizerEditingDialog::SetAudioEqualizerL(CAudioEqualizerUtility* 
-// aAudEqUtility)
-// This function is used to set a new CAudioEqualizerUtility* 
-// ----------------------------------------------------------------------------
-//    
-void CEqualizerEditingDialog::SetAudioEqualizerL(
-CAudioEqualizerUtility* aAudEqUtility)
-	{
-	iAudEqUtility=aAudEqUtility;
-	if (iAudEqUtility)
-	    {
-	    iIgnoreKeyEvents = EFalse;
-	    iFreqBandContainer->SetAudioEqualizerL(aAudEqUtility);
-	    }
-	else
-	    {
-	    iIgnoreKeyEvents = ETrue; 
-	    }
-	}
-	
-// -------------------------------------------------------------------
-// TInt CEqualizerEditingDialog::ExecuteLD()
-// This function is called to execute and delete the dialog
-// --------------------------------------------------------------------
-// 
-TInt CEqualizerEditingDialog::ExecuteLD()
-    {
-    return CAknDialog::ExecuteLD(R_EQUALIZER_EDITING_DIALOG);
-    }                    
-
-// -------------------------------------------------------------------
-// TBool CEqualizerEditingDialog::OkToExitL(TInt aButtonId)
-// This function is called when the OK key is pressed
-// --------------------------------------------------------------------
-// 
-TBool CEqualizerEditingDialog::OkToExitL(TInt aButtonId)
-    {
-    TBool ret = EFalse;
-    if (aButtonId == EEikBidOk)
-        {
-        ret = EFalse;
-        }
-    else if (aButtonId == EAknSoftkeyBack) 
-        {
-        CAudioEqualizer& audioEqualizer = iAudEqUtility->Equalizer();
-        iAudEqUtility->ModifyPresetL(iPresetIndex, iPresetName, audioEqualizer);
-        
-        HBufC* iTitleText = StringLoader::LoadLC(R_QTN_EQUALIZER_TITLE_TEXT);
-        CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane();
-        CAknTitlePane* tp=(CAknTitlePane*)sp->ControlL(TUid::Uid(EEikStatusPaneUidTitle));
-        tp->SetTextL(*iTitleText);
-        CleanupStack::PopAndDestroy(iTitleText);
-    
-    	ret = CAknDialog::OkToExitL( aButtonId ); 
-        }        
-    else if(aButtonId == EAknSoftkeyContextOptions)
-        {
-        iContextSensitiveMenu = ETrue;
-    	 DisplayMenuL();
-        }
-    else 
-        {
-        ret = CAknDialog::OkToExitL( aButtonId );        
-        }   
-    return ret;
-    } 
-    
-// -------------------------------------------------------------------
-// TInt CEqualizerEditingDialog::GetMoverPosition(TInt aBandIndex)
-// This function returns the current mover position for each frequency band
-// --------------------------------------------------------------------
-// 
-TInt CEqualizerEditingDialog::GetMoverPosition(TInt aBandIndex)
-{
-	return (*iMover)[aBandIndex];
-}
-
-// End of File
--- a/mmserv/audioeffectsui/equalizer/src/EqualizerFreqBand.cpp	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,741 +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 functionality related to Equalizer Frequency band
-*
-*/
-
-
-
-// INCLUDE FILES
-
-#include <eikdef.h>
-#include <e32math.h>
-#include <AknUtils.h>
-#include <AknsDrawUtils.h>
-#include <bautils.h>
-#include <data_caging_path_literals.hrh> 
-//LAF and Skin changes
-#include <AknIconUtils.h>
-#include <AknsUtils.h>
-#include <AknsConstants.h>
-#include <AknsDrawUtils.h>
-#include <aknlayout.cdl.h>
-#include <aknlayoutscalable_apps.cdl.h>
-#include <AknLayout2ScalableDef.h>
-#include <AknLayout2Def.h>
-#include <AudioEqualizerUtility.h>
-#if defined(RD_TACTILE_FEEDBACK)
-#include <touchfeedback.h>
-#endif
-
-#include <equalizer.mbg>
-#include "EqualizerPrivateConstants.h"
-#include "EqualizerEditingDialog.h"
-#include "EqualizerFreqBand.h"
-#include "Equalizer.hrh"
-
-// ============================ MEMBER FUNCTIONS =============================
-
-//============================================================================
-// -----> CEqualizerFreqBand (implementation)
-//============================================================================
-
-// ----------------------------------------------------------------------------
-// CEqualizerFreqBand* CEqualizerFreqBand::NewL(CEqualizerEditingDialog* aEqEditingDialog,
-//    CAudioEqualizerUtility*& aAudEqUtility, CAudioEqualizer& aAudEqualizer,
-//     const TInt aPresetIndex, const TBool aIsActivePreset,
-//    const TInt aBandIndex, TInt& aMoverPos, TRect& aRect)
-//
-// Two Phase construction
-// ----------------------------------------------------------------------------
-//
-CEqualizerFreqBand* CEqualizerFreqBand::NewL(CEqualizerEditingDialog* aEqEditingDialog,
-    CAudioEqualizerUtility*& aAudEqUtility, const TInt aPresetIndex,
-    const TBool aIsActivePreset, const TInt aBandIndex, 
-    TRect& aRect)
-    {
-    CEqualizerFreqBand* self = CEqualizerFreqBand::NewLC(aEqEditingDialog, aAudEqUtility,
-     aPresetIndex, aIsActivePreset, aBandIndex, 
-     aRect);
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-// ----------------------------------------------------------------------------
-// CEqualizerFreqBand* CEqualizerFreqBand::NewLC(CEqualizerEditingDialog* aEqEditingDialog,
-// CAudioEqualizerUtility*& aAudEqUtility, const TInt aPresetIndex,
-// const TBool aIsActivePreset,   const TInt aBandIndex, TInt& aMoverPos, 
-// TRect& aRect)
-// Two Phase construction
-// ----------------------------------------------------------------------------
-//
-CEqualizerFreqBand* CEqualizerFreqBand::NewLC(CEqualizerEditingDialog* aEqEditingDialog,
-    CAudioEqualizerUtility*& aAudEqUtility, const TInt aPresetIndex,
-    const TBool aIsActivePreset, const TInt aBandIndex, 
-    TRect& aRect)
-    {
-    CEqualizerFreqBand* self = new (ELeave) CEqualizerFreqBand(aEqEditingDialog, aAudEqUtility,
-    aPresetIndex, aIsActivePreset, aBandIndex, 
-    aRect);
-    CleanupStack::PushL(self); 
-    self->ConstructL();
-    return self;
-    }    
-// ----------------------------------------------------------------------------
-//CEqualizerFreqBand::CEqualizerFreqBand(CEqualizerEditingDialog* aEqEditingDialog,
-//    CAudioEqualizerUtility*& aAudEqUtility, 
-//     const TPresetName& aPresetName, const TBool aIsActivePreset,
-//    const TInt aBandIndex, TInt& aMoverPos, TRect& aRect) 
-//
-// First phase constructor
-// ----------------------------------------------------------------------------
-CEqualizerFreqBand::CEqualizerFreqBand(CEqualizerEditingDialog* aEqEditingDialog, 
-    CAudioEqualizerUtility*& aAudEqUtility, const TInt aPresetIndex, 
-    const TBool aIsActivePreset,
-    const TInt aBandIndex,  TRect& aContainerRect) 
-    : iEqEditingDialog(aEqEditingDialog), iAudEqUtility(aAudEqUtility), iPresetIndex(aPresetIndex), 
-    iIsActivePreset(aIsActivePreset), iBandIndex(aBandIndex), 
-    iContainerRect(aContainerRect)
-    {
-    }
-
-// -------------------------------------------------------------------
-// void CEqualizerFreqBand::ConstructL() 
-//
-// Second phase constructor
-// --------------------------------------------------------------------
-//
-void CEqualizerFreqBand::ConstructL() 
-    {
-    LoadBitmapsL();
-    iPresetName = iAudEqUtility->GetPresetL(iPresetIndex);
-    iAudioEqualizer = &iAudEqUtility->Equalizer();
-    iAudioEqualizer->DbLevelLimits(iMinBandLevel, iMaxBandLevel);
-    }
-
-// -------------------------------------------------------------------
-// CEqualizerFreqBand::~CEqualizerFreqBand()
-//
-// Destructor
-// --------------------------------------------------------------------
-//    
-CEqualizerFreqBand::~CEqualizerFreqBand()
-    { 
-    delete iBgBitmap;
-    delete iBgBitmapMask;
-    delete iSliderBitmap;
-    delete iSliderBitmapMask;
-
-#if defined(RD_TACTILE_FEEDBACK)
-   MTouchFeedback* feedback = MTouchFeedback::Instance();
-   if (feedback)
-       {
-   	   feedback->RemoveFeedbackForControl(this);
-       }
-#endif
-    }
-
-// -------------------------------------------------------------------
-// void CEqualizerFreqBand::Draw(const TRect& aRect) const
-//
-// Function to draw the control
-// --------------------------------------------------------------------
-//
-void CEqualizerFreqBand::Draw(const TRect& /*aRect*/) const
-    {
-    CWindowGc& gc=SystemGc();
-    MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance();
-    MAknsControlContext* cc = AknsDrawUtils::ControlContext( this );
-    AknsDrawUtils::Background( skinInstance, cc, this, gc, iBackgroundRect );
-    TRect innerRect = iBackgroundRect;
-    innerRect.Shrink( TSize( 5, 5) );
-	if (IsFocused())
-		{
-   			
-   		AknsDrawUtils::DrawFrame( skinInstance, gc, iBackgroundRect, 
-   						innerRect,KAknsIIDQsnFrGrid, KAknsIIDQsnFrGridCenter);		
-		}
-    					
-	gc.BitBltMasked(iBackgroundRect.iTl,iBgBitmap, TRect(TPoint(), 
-					iBackgroundRect.Size()), iBgBitmapMask, ETrue);
-	
-	TInt halfSliderSize = iSliderRect.Height() / 2;
-	TInt sliderRectYCoord = iSliderRect.iTl.iY;
-	TInt yCoordOffset = ((iMoverPos - sliderRectYCoord) - halfSliderSize);
-	TRect tempSliderRect = iSliderRect;
-	tempSliderRect.Move(0,yCoordOffset);
-	
-    gc.BitBltMasked(tempSliderRect.iTl,iSliderBitmap,TRect(TPoint(), 
-    						tempSliderRect.Size()),iSliderBitmapMask,ETrue);
-	}
-// -------------------------------------------------------------------
-// void CEqualizerFreqBand::SizeChanged()
-//
-// This function is called by the framework whenever the control size 
-// is changed
-// --------------------------------------------------------------------
-void CEqualizerFreqBand::SizeChanged()
-    {
-	TInt variety = EEqualizerVarietyOne;
-
-    CAudioEqualizer& audioEqualizer = iAudEqUtility->Equalizer();
-    TUint numberOfFreqBands = audioEqualizer.NumberOfBands();
-        
-	if(numberOfFreqBands == KEqualizerFiveBands)
-	    {
-	    variety = EEqualizerVarietyTwo;
-	    }
-   
-	iScaleRect = ComponentRect(Rect(),
-									variety,EEqualizerScale);
-	iBackgroundRect = ComponentRect(iScaleRect,
-								EEqualizerVarietyNotUsed,EEqualizerBackground);
- 	iSliderRect = ComponentRect(iScaleRect,
- 									EEqualizerVarietyNotUsed,EEqualizerSlider);
-
-#if defined(RD_TACTILE_FEEDBACK)
-	MTouchFeedback* feedback = MTouchFeedback::Instance();
-	if (feedback)
-		{
-		feedback->SetFeedbackArea(this, 0, iBackgroundRect,
-			ETouchFeedbackBasic, ETouchEventStylusDown);
-		}
-#endif
-
-	AknIconUtils::SetSize(iBgBitmap,iBackgroundRect.Size(), EAspectRatioNotPreserved);
-	AknIconUtils::SetSize(iBgBitmapMask,iBackgroundRect.Size(), EAspectRatioNotPreserved);
-	
-	AknIconUtils::SetSize(iSliderBitmap,iSliderRect.Size(), EAspectRatioNotPreserved);
-    AknIconUtils::SetSize(iSliderBitmapMask,iSliderRect.Size(), EAspectRatioNotPreserved);
-    
-    TInt scaleHeight = iBackgroundRect.Height();
-    TInt zeroCoord = iBackgroundRect.iTl.iY + (scaleHeight / 2);
-    iZeroPos = zeroCoord;  
-    iMoverPos = iEqEditingDialog->GetMoverPosition(iBandIndex);
-    
-    TInt sliderInc = iBackgroundRect.Height() / KNumberOfSteps;
-    TReal res,frac;
-    frac = (TReal)(iMoverPos - iZeroPos) / sliderInc;
-    Math::Round(res,frac,0);
-    Math::Int(iStepCount,res);
-    iStepCount += KNumberOfSteps / 2;
-    if(iStepCount > KNumberOfSteps)
-    	{
-    	iStepCount = KNumberOfSteps;
-    	}
-    if(iStepCount < 0)
-    	{
-    	iStepCount = 0;
-    	}
-
-    }
-
-// -------------------------------------------------------------------
-// void CEqualizerFreqBand::FocusChanged(TDrawNow aDrawNow)
-//
-// This function is called by the framework whenever the control's 
-// focus is changed
-// --------------------------------------------------------------------
-//
-void CEqualizerFreqBand::FocusChanged(TDrawNow aDrawNow)
-    {
-    if (aDrawNow)
-        {
-        DrawNow();        
-        }
-    }
-    
-// -------------------------------------------------------------------
-// void CEqualizerFreqBand::HandleResourceChange(TInt aType)
-//
-// This function is called by the framework whenever there is a 
-// change in skin
-// -------------------------------------------------------------------
-void CEqualizerFreqBand::HandleResourceChange(TInt aType)
-    {
-    if (aType == KAknsMessageSkinChange)
-        {
-        TInt tempMoverPos = iMoverPos;
-        LoadBitmapsL();
-        SizeChanged();
-        iMoverPos = tempMoverPos;
-        DrawNow();
-        }
-    }
-
-// -------------------------------------------------------------------
-// void CEqualizerFreqBand::LoadBitmapsL()
-// This function is called to load the bitmaps from the icons file
-// --------------------------------------------------------------------
-//     
-void CEqualizerFreqBand::LoadBitmapsL()
-    {
-    // Find which drive this DLL is installed.
-    TFileName fileName;
-    // Get the full resource file
-    TParse fp;
-    // Add the resource dir
-    fp.Set( KIconsFilename, &KDC_APP_BITMAP_DIR, NULL);
-    // Get the filename with full path
-    fileName = fp.FullName(); 
-
-    MAknsSkinInstance * skinInstance;
-    skinInstance = AknsUtils::SkinInstance();
-    
-    //Destroying previously created background icons
-    if (iBgBitmap)
-    	{
-    	delete iBgBitmap;
-    	iBgBitmap = NULL;
-    	}
-    	
-    if (iBgBitmapMask)
-    	{
-    	delete iBgBitmapMask;
-    	iBgBitmapMask = NULL;
-    	}
-    
-    //Destroying previously created slider icons
-    if (iSliderBitmap)
-    	{
-    	delete iSliderBitmap;
-    	iSliderBitmap = NULL;
-    	}
-    
-    if (iSliderBitmapMask)
-    	{
-    	delete iSliderBitmapMask;
-    	iSliderBitmapMask = NULL;
-    	}
-    
-    //Creating the background icon
-    AknsUtils::CreateIconL(skinInstance,KAknsIIDQgnIndiMupEqBg,
-                           iBgBitmap,iBgBitmapMask,fileName,
-                           EMbmEqualizerQgn_indi_mup2_eq_bg,
-                           EMbmEqualizerQgn_indi_mup2_eq_bg_mask);
-    
-    //Creating the slider icon
-    AknsUtils::CreateIconL(skinInstance,KAknsIIDQgnIndiMupEqSlider,
-                           iSliderBitmap,iSliderBitmapMask,fileName,
-                           EMbmEqualizerQgn_indi_mup_eq_slider,
-                           EMbmEqualizerQgn_indi_mup_eq_slider_mask);
-    }       
-
-// -------------------------------------------------------------------
-// void CEqualizerFreqBand::UpdateBandLevelInEngineL()
-// This function is called to update the engine with the new band level
-// --------------------------------------------------------------------
-// 
-void CEqualizerFreqBand::UpdateBandLevelInEngineL(TBool lastIncFlag)
-    {
-    //Update engine
-	TInt sliderInc = iBackgroundRect.Height() / KNumberOfSteps;
-    TInt diffUIBandLevel = KNumberOfSteps / 2;
-    TInt bandLevel;
-    TReal frac;
-    TInt sliderNoOfPix;
-    TInt actualNoOfPix;
-    TInt pixDiff;
-    TReal fracDiff;
-        
-    if (iMoverPos > iZeroPos)
-        {
-        frac = (TReal)(iMoverPos - iZeroPos) / ((TReal)diffUIBandLevel * sliderInc);
-		if(lastIncFlag)
-			{
-			sliderNoOfPix = diffUIBandLevel * sliderInc;
-			actualNoOfPix = iMoverPos - iZeroPos;
-			if(sliderNoOfPix > actualNoOfPix)
-				{
-				pixDiff = sliderNoOfPix - actualNoOfPix;
-				fracDiff = (TReal)pixDiff / ((TReal)diffUIBandLevel * sliderInc);
-				frac += fracDiff;				
-				}
-			else
-				{
-				pixDiff = actualNoOfPix - sliderNoOfPix;
-				fracDiff = (TReal)pixDiff / ((TReal)diffUIBandLevel * sliderInc);
-				frac -= fracDiff;				
-				}
-			}
-		if (frac > 1)
-			{
-			frac = 1;
-			}
-		else
-		if (frac < -1)
-			{
-			frac = -1;
-			}
-        bandLevel=(TInt)(frac * iMinBandLevel);        
-        }
-    else if (iMoverPos < iZeroPos)
-        {
-        frac = (TReal)(iZeroPos - iMoverPos) / ((TReal)diffUIBandLevel * sliderInc);
-        if(lastIncFlag)						
-			{
-			sliderNoOfPix = diffUIBandLevel * sliderInc;
-			actualNoOfPix = iZeroPos - iMoverPos;
-			if(sliderNoOfPix > actualNoOfPix)
-				{
-				pixDiff = sliderNoOfPix - actualNoOfPix;
-				fracDiff = (TReal)pixDiff / ((TReal)diffUIBandLevel * sliderInc);
-				frac += fracDiff;				
-				}
-			else
-				{
-				pixDiff = actualNoOfPix - sliderNoOfPix;
-				fracDiff = (TReal)pixDiff / ((TReal)diffUIBandLevel * sliderInc);
-				frac -= fracDiff;				
-				}
-			}
-		if (frac > 1)
-			{
-			frac = 1;
-			}
-		else
-		if (frac < -1)
-			{
-			frac = -1;
-			}
-        bandLevel=(TInt)(frac * iMaxBandLevel);   
-        }
-    else
-        {
-        bandLevel = 0;
-        }   
-       
-//RDebug::Printf("Todd1 ==> bnad index=%d, Level set = %d", iBandIndex+1, bandLevel);
-    iAudioEqualizer->SetBandLevelL(iBandIndex+1, bandLevel);     
-
-    if (iIsActivePreset) 
-        {
-        TInt err;
-        TRAP(err, iAudioEqualizer->EnableL());	
-        }
-   }
-
-// -------------------------------------------------------------------
-// TKeyResponse CEqualizerFreqBand::OfferKeyEventL
-// (const TKeyEvent& aKeyEvent,TEventCode aType)
-// This function is called to handle key events
-// --------------------------------------------------------------------
-//
-TKeyResponse CEqualizerFreqBand::OfferKeyEventL(const TKeyEvent& aKeyEvent,
-TEventCode aType)
-    {
-    TKeyResponse ret = EKeyWasNotConsumed;
-    
-    TInt halfSliderSize = iSliderRect.Height() / 2;
-    TInt sliderInc = iBackgroundRect.Height() / KNumberOfSteps;
-	TInt nextInc;
-	TBool lastIncFlag = 0;
-	
-    if (aType==EEventKey && (aKeyEvent.iScanCode==EStdKeyDownArrow ))
-        {
-        if (iMoverPos < (iBackgroundRect.iBr.iY - halfSliderSize))
-         	{
-            nextInc = sliderInc;
-            iStepCount += 1;
-            if(((iMoverPos + nextInc) <= 
-            				(iBackgroundRect.iBr.iY - halfSliderSize))
-            				&& (iStepCount != KNumberOfSteps))
-            	{
-            	TInt offset = Abs(iMoverPos - iZeroPos) % sliderInc;
-            	if(offset==0)
-            		iMoverPos += nextInc ;
-            	else
-            		{
-            		//iStepCount--;
-            		if(iMoverPos>iZeroPos)	
-            	   		iMoverPos+= sliderInc - offset;
-            	
-            		if(iMoverPos<iZeroPos)
-            	    	iMoverPos+= sliderInc + offset;
-            		}
-            	}
-		    else
-		    	{
-		    	nextInc = (iBackgroundRect.iBr.iY - halfSliderSize)
-		    								 - iMoverPos;
-		    	iMoverPos += nextInc;
-		    	
-		    	if(iStepCount > KNumberOfSteps )
-		    	    iStepCount = KNumberOfSteps;
-		    	}
-            if(((iMoverPos) == (iBackgroundRect.iBr.iY - halfSliderSize)) ||
-            			(iStepCount == KNumberOfSteps))
-            	{
-            	lastIncFlag = 1;
-            	}
-            //Update engine
-            UpdateBandLevelInEngineL(lastIncFlag);
-            }
-        DrawNow();
-        ret = EKeyWasConsumed;
-        }
-    else if (aType==EEventKey && (aKeyEvent.iScanCode==EStdKeyUpArrow))
-        {
-        if (iMoverPos > (iBackgroundRect.iTl.iY+halfSliderSize))
-            {
-            nextInc = sliderInc;
-            iStepCount -= 1;
-            if(((iMoverPos - nextInc) >= (iBackgroundRect.iTl.iY + halfSliderSize))
-            			&& (iStepCount != 0))
-            	{
-            	TInt offset = Abs(iMoverPos - iZeroPos) % sliderInc;
-            	if(offset==0)
-               		iMoverPos -= nextInc;
-            	else
-            		{
-            		//iStepCount++; 
-            		if(iMoverPos>iZeroPos)	
-            	   		iMoverPos-= nextInc + offset;
-            	
-            		if(iMoverPos<iZeroPos)
-            	   		iMoverPos-= sliderInc - offset;
-            		}
-            	}
-            else
-            	{
-            	nextInc = iMoverPos - (iBackgroundRect.iTl.iY + halfSliderSize);
-            	iMoverPos -= nextInc;
-            	
-            	if(iStepCount < 0 )
-		    	    iStepCount = 0;
-            	}
-            if(((iMoverPos) == (iBackgroundRect.iTl.iY + halfSliderSize)) ||
-            			(iStepCount == 0))
-            	{
-            	lastIncFlag = 1;
-            	}
-            //Update engine
-            UpdateBandLevelInEngineL(lastIncFlag);
-            }
-        DrawNow();
-        ret = EKeyWasConsumed;
-        }
-    else
-        {
-        ret = EKeyWasNotConsumed;
-        }
-    return ret;
-    }
-
-// ----------------------------------------------------------------------------
-// TRect CEqualizerFreqBand::ComponentRect(const TRect& aRect, TInt aVariety, 
-//                                                    TInt aComponentNumber)
-// This function is called to return the rect of a control after reading the 
-// layout information from the CDL file. It returns the rect for the control 
-// based on the Enumerated member sent as a parameter
-// ----------------------------------------------------------------------------
-//
-TRect CEqualizerFreqBand::ComponentRect(const TRect& aRect, TInt aVariety, 
-                                                    TInt aComponentNumber)
-    {
-    TAknWindowComponentLayout lLayout;
-    
-    switch(aComponentNumber)
-        {
-        case EEqualizerFreqBand1:    lLayout = AknLayoutScalable_Apps::
-                                            mup_equalizer_pane(aVariety);
-                                    break;
-                                    
-        case EEqualizerFreqBand2:    lLayout = AknLayoutScalable_Apps::
-                                            mup_equalizer_pane_cp1(aVariety);
-                                    break;
-                                    
-        case EEqualizerFreqBand3:    lLayout = AknLayoutScalable_Apps::
-                                            mup_equalizer_pane_cp2(aVariety);
-                                    break;
-                                    
-        case EEqualizerFreqBand4:    lLayout = AknLayoutScalable_Apps::
-                                            mup_equalizer_pane_cp3(aVariety);
-                                    break;
-                                    
-        case EEqualizerFreqBand5:    lLayout = AknLayoutScalable_Apps::
-                                            mup_equalizer_pane_cp4(aVariety);
-                                    break;
-
-        case EEqualizerFreqBand6:    lLayout = AknLayoutScalable_Apps::
-                                            mup_equalizer_pane_cp5(1);
-                                    break;
-
-        case EEqualizerFreqBand7:    lLayout = AknLayoutScalable_Apps::
-                                            mup_equalizer_pane_cp6(1);
-                                    break;
-
-        case EEqualizerFreqBand8:    lLayout = AknLayoutScalable_Apps::
-                                            mup_equalizer_pane_cp7(1);
-                                    break;
-                                    
-        case EEqualizerMainPane:    lLayout = AknLayoutScalable_Apps::
-                                            main_mup_eq_pane();
-                                    break;
-
-        case EEqualizerScale:         lLayout = AknLayoutScalable_Apps::
-                                            mup_scale_pane(aVariety);
-                                    break;
-
-        case EEqualizerBackground:    lLayout = AknLayoutScalable_Apps::
-                                            mup_scale_pane_g1();
-                                    break;
-
-        case EEqualizerSlider:        lLayout = AknLayoutScalable_Apps::
-                                            mup_scale_pane_g2();
-                                    break;
-
-        default:                    break;
-        }
-    
-    TAknLayoutRect lLayoutRect;
-    lLayoutRect.LayoutRect(aRect,lLayout.LayoutLine());
-    
-    TRect rect = lLayoutRect.Rect();
-    return (rect);
-    }
-
-// ----------------------------------------------------------------------------
-// CEqualizerFreqBand::SetAudioEqualizerL(CAudioEqualizerUtility* 
-// aAudEqUtility)
-// This function is used to set a new CAudioEqualizerUtility* 
-// ----------------------------------------------------------------------------
-//    
-void CEqualizerFreqBand::SetAudioEqualizerL(
-CAudioEqualizerUtility* aAudEqUtility)
-	{
-	
-	// Save the user's settings
-	iAudEqUtility->ModifyPresetL(iPresetIndex, iPresetName, *iAudioEqualizer);
-	
-	// Set new value for CAudioEqualizerUtility
-	__ASSERT_DEBUG((iAudEqUtility != NULL), User::Invariant());
-	iAudEqUtility = aAudEqUtility;
-	iPresetName = iAudEqUtility->GetPresetL(iPresetIndex);
-    iAudioEqualizer = &iAudEqUtility->Equalizer();
-	}
-
-#ifdef RD_SCALABLE_UI_V2
-// ----------------------------------------------------------------------------
-// CEqualizerFreqBand::HandlePointerEventL(const TPointerEvent&  
-// aPointerEvent)
-// This function is used handle pen input events 
-// ----------------------------------------------------------------------------
-//    
-void CEqualizerFreqBand::HandlePointerEventL(const TPointerEvent& aPointerEvent)
-	{
-    TInt pos;
-	TInt halfSliderSize = iSliderRect.Height() / 2;
-    TInt sliderInc = iBackgroundRect.Height() / KNumberOfSteps;
-    TInt offset;
-	TBool lastIncFlag = 0;
-#if defined(RD_TACTILE_FEEDBACK)
-	MTouchFeedback* feedback = NULL;
-#endif
-
-	if ( aPointerEvent.iPosition.iY < iBackgroundRect.iTl.iY )
-		{
-		pos = iBackgroundRect.iTl.iY;
-		}
-	else if ( aPointerEvent.iPosition.iY > iBackgroundRect.iBr.iY )
-		{
-		pos = iBackgroundRect.iBr.iY;
-		}
-	else
-		{
-		pos = aPointerEvent.iPosition.iY;
-		}
-
-	if (AknLayoutUtils::PenEnabled())
-		{
-		switch (aPointerEvent.iType)
-            {
-            case TPointerEvent::EButton1Down:
-                break;
-
-            case TPointerEvent::EButton1Up:
-            	offset = Abs(pos- iZeroPos) % sliderInc;
-
-            	if(pos<= iZeroPos)
-	            	{
-	               	if(offset!=0)
-            			{
-	            		if(offset <= (sliderInc/2))
-	            	   		pos+= offset;
-	            		else
-	            	    	pos+= offset - sliderInc;
-	            		}
-	            	}
-	            else
-	            	{
-	            	if(offset!=0)
-		            	{
-		            	if(offset <= (sliderInc/2))
-	            	   		pos-= offset;
-	            	    else
-	            	   		pos+= sliderInc - offset;
-		            	}
-	            	}
-
-	            iStepCount = (pos - iBackgroundRect.iTl.iY)/sliderInc;
-
-	            if(iStepCount == 0)
-		            {
-		            lastIncFlag = 1;
-		            pos = iBackgroundRect.iTl.iY + halfSliderSize;
-		            }
-
-	            if(iStepCount >= KNumberOfSteps)
-		            {
-		            lastIncFlag = 1;
-		            pos = iBackgroundRect.iBr.iY - halfSliderSize;
-		            }
-
-                iMoverPos = pos;
-	            UpdateBandLevelInEngineL(lastIncFlag);
-	            DrawNow();
-                break;
-
-            case TPointerEvent::EDrag:
-#if defined(RD_TACTILE_FEEDBACK)
-            	feedback = MTouchFeedback::Instance();
-				if (feedback)
-				    {
-					feedback->InstantFeedback(ETouchFeedbackSensitive);
-	                }
-#endif
-                if(pos< (iBackgroundRect.iTl.iY + halfSliderSize))
-                    {
-                	pos = iBackgroundRect.iTl.iY + halfSliderSize;
-                	lastIncFlag = 1;
-                    }
-
-                if(pos> (iBackgroundRect.iBr.iY - halfSliderSize))
-                    {
-                	pos=iBackgroundRect.iBr.iY - halfSliderSize;
-                	lastIncFlag = 1;
-                    }
-
-                iMoverPos = pos;
-	            UpdateBandLevelInEngineL(lastIncFlag);
-	            DrawNow();
-                break;
-            default:
-//RDebug::Printf("Todd2 %d=", aPointerEvent.iType);
-                break;
-            }
-		}
-	}
-#endif //RD_SCALABLE_UI_V2
-// End of File
--- a/mmserv/audioeffectsui/equalizer/src/EqualizerFreqBandContainer.cpp	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,709 +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 functionality related to Equalizer Frequency Band 
-*                Container
-*
-*/
-
-
-
-// INCLUDE FILES
-
-#include <AknUtils.h>
-#include <AknsDrawUtils.h>
-#include <bautils.h>
-#include <AknsBasicBackgroundControlContext.h> 
-#include <data_caging_path_literals.hrh>
-
-//LAF and Skin changes
-#include <AknIconUtils.h>
-#include <AknsUtils.h>
-#include <AknsConstants.h>
-#include <aknlayout.cdl.h>
-#include <aknlayoutscalable_apps.cdl.h>
-#include <AknLayout2ScalableDef.h>
-#include <AknLayout2Def.h>
-#include <AudioEqualizerUtility.h>
-#include <eiklabel.h>
-#include <StringLoader.h>
-#include <Equalizer.rsg>
-#include <layoutmetadata.cdl.h>
-#include <e32math.h>
-
-#include "EqualizerPrivateConstants.h"
-#include "EqualizerEditingDialog.h"
-#include "EqualizerFreqBand.h"
-#include "EqualizerFreqBandContainer.h"
-#include "Equalizer.hrh"
-
-_LIT(KLabelFormatInt,"%d");
-_LIT(KLabelFormatFloat,"%.1f");
-
-// ============================ MEMBER FUNCTIONS =============================
-
-//////////////////////////////////////////////////////////////////////////////
-//
-// -----> CEqualizerFreqBandContainer (implementation)
-//
-//////////////////////////////////////////////////////////////////////////////
-
-// -------------------------------------------------------------------
-// CEqualizerFreqBandContainer::CEqualizerFreqBandContainer
-//(CAudioEqualizerUtility* aAudEqUtility,  TInt aPresetIndex,
-// TRect& aRect)
-//
-// First phase constructor
-// --------------------------------------------------------------------
-// 
-CEqualizerFreqBandContainer::CEqualizerFreqBandContainer(
-	CEqualizerEditingDialog* aEqEditingDialog,
-    CAudioEqualizerUtility* aAudEqUtility, TInt aPresetIndex, 
-    const TBool aIsActivePreset, TRect& aRect,
-    MEqualizerPresetActivationObserver& aObserver,
-    TInt aPresetKey, TPresetName& aPresetName )
-     :iEqEditingDialog(aEqEditingDialog), iAudEqUtility(aAudEqUtility), iPresetIndex(aPresetIndex), 
-     iIsActivePreset(aIsActivePreset), iRect(aRect), iObserver( aObserver ), iPresetKey( aPresetKey ),
-     iBandSelected(EFalse), iPresetName( aPresetName )
-    {
-    }
-
-// -------------------------------------------------------------------
-// CEqualizerFreqBandContainer::~CEqualizerFreqBandContainer()
-//
-// Destructor
-// --------------------------------------------------------------------
-//     
-CEqualizerFreqBandContainer::~CEqualizerFreqBandContainer()
-    {
-    delete iBackGround; 
-    if (iFreqBand)
-        {
-        iFreqBand->ResetAndDestroy(); //delete items
-        delete (iFreqBand);
-        }
-    if (iFreqLabels)
-        {
-        iFreqLabels->ResetAndDestroy(); //delete items
-        delete (iFreqLabels);
-        }
-    }
-
-// -------------------------------------------------------------------
-// void CEqualizerFreqBandContainer::ConstructL(TRect& aRect)
-//
-// Because CEqualizerFreqBandContainer is a compound control, it needs a
-// ConstructL() for when it's created outside a dialog, and a
-// ConstructFromResourceL() for when it's created inside a dialog.
-// --------------------------------------------------------------------
-//     
-void CEqualizerFreqBandContainer::ConstructL(TRect& aRect)
-    {
-    iBackGround = CAknsBasicBackgroundControlContext::NewL
-    	( KAknsIIDQsnBgAreaMain, Rect(), EFalse );
-    iAudEqUtility->GetPresetL(iPresetIndex);
-    CAudioEqualizer& audioEqualizer = iAudEqUtility->Equalizer();
-    iNumberOfFreqBands = audioEqualizer.NumberOfBands();
-    iFreqBand = new(ELeave) CArrayPtrFlat<CEqualizerFreqBand>
-                 (KEqualizerArrayGranularity);
-    iFreqLabels = new(ELeave) CArrayPtrFlat<CEikLabel>
-                 (KEqualizerArrayGranularity);
-    
-    for (int i=0; i<iNumberOfFreqBands; i++)
-        {
-        // Create the CEqualizerFreqBands. Their size and position is 
-        // set in CEqualizerFreqBandContainer::SizeChangedL().
-        
-        CEqualizerFreqBand* band = CEqualizerFreqBand::NewL(iEqEditingDialog, iAudEqUtility, 
-         iPresetIndex, iIsActivePreset, i, aRect);
-         
-        CleanupStack::PushL(band);
-        iFreqBand->AppendL(band);
-        CleanupStack::Pop(band);
-        (*iFreqBand)[i]->SetContainerWindowL(*this);
-        }
-
-    (*iFreqBand)[0]->SetFocus(ETrue);
-    iIndexOfFocussedFreqBand = 0;
-        
-#ifdef RD_SCALABLE_UI_V2
-    EnableDragEvents();
-#endif //RD_SCALABLE_UI_V2
-    ConstructLabelsL();
-    // Set the bounding rectangle of this control (this will result in 
-    // a call to SizeChangedL(). The component controls must be 
-    // created before calling this, because SizeChangedL() sets their
-    // sizes.
-    SetRect(aRect);
-    ActivateL();
-    }
-
-// ----------------------------------------------------------------------
-// void CEqualizerFreqBandContainer::ConstructFromResourceL
-// (TResourceReader& /*aReader*/)
-//
-// This function is used when the CEqualizerFreqBandContainer is created
-// inside a dialog.
-// ----------------------------------------------------------------------
-// 
-void CEqualizerFreqBandContainer::ConstructFromResourceL(TResourceReader& 
-/*aReader*/)
-    {
-    ConstructL(iRect);
-    }
-
-// -------------------------------------------------------------------
-// TInt CEqualizerFreqBandContainer::CountComponentControls() const
-//
-// Returns the number of controls in a compound control.
-// -------------------------------------------------------------------
-// 
-TInt CEqualizerFreqBandContainer::CountComponentControls() const
-    {
-    return iNumberOfFreqBands + iFreqLabels->Count();
-    }
-
-// -------------------------------------------------------------------
-// CCoeControl* CEqualizerFreqBandContainer::ComponentControl
-// (TInt aIndex) const
-//
-// Returns the control given by the index in a compind control.
-// -------------------------------------------------------------------
-//
-CCoeControl* CEqualizerFreqBandContainer::ComponentControl(TInt aIndex) const
-    {
-    if(aIndex<iNumberOfFreqBands)
-    return (*iFreqBand)[aIndex];
-    else 
-    return (*iFreqLabels)[aIndex - iNumberOfFreqBands];
-    }
-
-// ---------------------------------------------------------------------
-// void CEqualizerFreqBandContainer::SizeChanged()
-//
-// This function gets called whenever one of the size-setting functions 
-// is called. As this is a compound control, this function calculates 
-// and sets the size and position for its components, based on its own 
-// size.
-// ---------------------------------------------------------------------
-//
-void CEqualizerFreqBandContainer::SizeChanged()
-    {
-    TInt equalizerVariety = EEqualizerVarietyOne; //By defualt use variety one
-    
-    TRect myRect = Rect();
-    TRect rect = CEqualizerFreqBand::ComponentRect(iRect,
-                                EEqualizerVarietyNotUsed,EEqualizerMainPane);
-    iRect = rect;
-    /**
-     *Equalizer variety based on the number of bands
-     * Number of bands = 8 ==> Variety = 0
-     * Number of bands = 5 ==> Variety = 1
-     */
-    if(iNumberOfFreqBands == KEqualizerEightBands)
-        {
-        equalizerVariety = EEqualizerVarietyOne;
-        }
-        
-    if(iNumberOfFreqBands == KEqualizerFiveBands)
-        {
-        equalizerVariety = EEqualizerVarietyTwo;
-        }
-        
-    //Setting the position and size for the frequency bands from the layout 
-    //obtained
-    for(TInt count = 0;count < iNumberOfFreqBands; count++)
-        {
-        TRect freqBandRect = CEqualizerFreqBand::ComponentRect(iRect,
-                                                     equalizerVariety+2,count);
-        (*iFreqBand)[count]->SetRect(freqBandRect);
-        }
-        
-    TInt variety=0;
-    if(Layout_Meta_Data::IsLandscapeOrientation())
-    	variety=4;
-    TRect temp;
-    AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EApplicationWindow, temp );
-    TAknLayoutRect mainPaneLayout;
-    mainPaneLayout.LayoutRect( temp,AknLayoutScalable_Apps::main_pane(variety).LayoutLine() );
-    myRect = mainPaneLayout.Rect();
-    myRect.iBr.iY = myRect.iBr.iY - myRect.iTl.iY;
-    myRect.iTl.iY = 0;
-    
-    TAknTextLineLayout tLayout;
-    
-    tLayout = AknLayoutScalable_Apps::main_mup_eq_pane_t9(equalizerVariety);
-   	AknLayoutUtils::LayoutLabel((*iFreqLabels)[0], myRect, tLayout);
-	
-	tLayout = AknLayoutScalable_Apps::main_mup_eq_pane_t10(equalizerVariety);
-	AknLayoutUtils::LayoutLabel((*iFreqLabels)[1], myRect, tLayout);
-	
-	tLayout = AknLayoutScalable_Apps::main_mup_eq_pane_t1(equalizerVariety);
-	AknLayoutUtils::LayoutLabel((*iFreqLabels)[2], iRect, tLayout);
-	
-	tLayout = AknLayoutScalable_Apps::main_mup_eq_pane_t2(equalizerVariety);
-	AknLayoutUtils::LayoutLabel((*iFreqLabels)[3], iRect, tLayout);
-	
-	tLayout = AknLayoutScalable_Apps::main_mup_eq_pane_t3(equalizerVariety);
-	AknLayoutUtils::LayoutLabel((*iFreqLabels)[4], iRect, tLayout);
-	
-	tLayout = AknLayoutScalable_Apps::main_mup_eq_pane_t4(equalizerVariety);
-	AknLayoutUtils::LayoutLabel((*iFreqLabels)[5], iRect, tLayout);
-	
-	tLayout = AknLayoutScalable_Apps::main_mup_eq_pane_t5(equalizerVariety);
-	AknLayoutUtils::LayoutLabel((*iFreqLabels)[6], iRect, tLayout);
-	
-	if(equalizerVariety == 0)
-		{
-		tLayout = AknLayoutScalable_Apps::main_mup_eq_pane_t6(equalizerVariety);
-		AknLayoutUtils::LayoutLabel((*iFreqLabels)[7], iRect, tLayout);
-		
-		tLayout = AknLayoutScalable_Apps::main_mup_eq_pane_t7(equalizerVariety);
-		AknLayoutUtils::LayoutLabel((*iFreqLabels)[8], iRect, tLayout);
-		
-		tLayout = AknLayoutScalable_Apps::main_mup_eq_pane_t8(equalizerVariety);
-		AknLayoutUtils::LayoutLabel((*iFreqLabels)[9], iRect, tLayout);
-		}
-	
-	if (iBackGround)
-	    {
-	    iBackGround->SetRect(iRect);
-	    }
-    TRgb color;
-    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
-        
-    for(TInt i=0; i<iFreqLabels->Count(); i++)
-        {
-        CCoeControl* label( ComponentControl( i+iNumberOfFreqBands ));
-        TInt error = AknsUtils::GetCachedColor( skin, color,
-                                                KAknsIIDQsnTextColors,
-                                                EAknsCIQsnTextColorsCG6 );
-        if ( !error )
-           	AknLayoutUtils::OverrideControlColorL( *label,
-                                                  EColorLabelText,
-                                                  color);
-        }
-    }
-
-// -------------------------------------------------------------------
-// void CEqualizerFreqBandContainer::Draw(const TRect& aRect) const
-//
-// This function gets called to draw a control
-// -------------------------------------------------------------------
-//         
-void CEqualizerFreqBandContainer::Draw(const TRect& aRect) const
-    {
-    CWindowGc& gc=SystemGc();
-    gc.Clear(iRect);
-    // Drawing skin
-    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
-    if (iBackGround)
-        {
-        AknsDrawUtils::Background(skin, iBackGround, this, gc, iRect);
-        }
-    
-    for(TInt i=0; i<iFreqLabels->Count(); i++)
-    	{
-    	if( (*iFreqLabels)[i] )
-    		{
-    		(*iFreqLabels)[i]->Draw(aRect);
-    		}
-        }
-    }
-
-// ---------------------------------------------------------------------
-// void CEqualizerFreqBandContainer::FocusChanged(TDrawNow aDrawNow)
-//
-// This function gets called whenever the application calls SetFocus().
-// It redraws the CEqualizerFreqBandContainer, so that they are updated
-// to show which one now has focus.
-// ---------------------------------------------------------------------
-//
-void CEqualizerFreqBandContainer::FocusChanged(TDrawNow aDrawNow)
-    {
-    if (IsFocused())
-        {
-        (*iFreqBand)[0]->SetFocus(ETrue, EDrawNow);
-        iFocussedFreqBand = (*iFreqBand)[0];
-        iIndexOfFocussedFreqBand = 0;
-        }
-    else
-        {
-        if (iFocussedFreqBand && iFocussedFreqBand->IsFocused())
-            {
-            iFocussedFreqBand->SetFocus(EFalse, EDrawNow);             
-            }
-        }
-    if (aDrawNow)
-        {
-        DrawNow();        
-        } 
-    }
-
-// ----------------------------------------------------------------------
-// void CEqualizerFreqBandContainer::SwapFocus(CCoeControl* aPrevControl,
-//  CCoeControl* aNewControl)
-//
-// This function is called from OfferKeyEventL() whenever the user 
-// presses left/right arrow keys to change to the previous/next band
-// ----------------------------------------------------------------------
-//
-void CEqualizerFreqBandContainer::SwapFocus(CCoeControl* aPrevControl, 
-CCoeControl* aNewControl)
-    {
-    aPrevControl->SetFocus(EFalse, EDrawNow);
-    aNewControl->SetFocus(ETrue, EDrawNow);
-    iFocussedFreqBand =  aNewControl;
-    }
-
-// -------------------------------------------------------------------------
-// CEqualizerFreqBandContainer::OfferKeyEventL 
-// Function for handling key events.
-// -------------------------------------------------------------------------
-//
-TKeyResponse CEqualizerFreqBandContainer::OfferKeyEventL(const TKeyEvent& 
-aKeyEvent,TEventCode aType)
-    {
-    TKeyResponse ret = EKeyWasNotConsumed;
-    TInt indexOfLastFocussedBand = -1;
-    if( aType == EEventKey )
-        {
-          // Use the arrow keys to move focus between the two CEqualizerFreqBands.
-        switch (aKeyEvent.iCode)
-            {
-            case EKeyUpArrow:
-            case EKeyDownArrow:
-                {
-                ret = (*iFreqBand)[iIndexOfFocussedFreqBand]->OfferKeyEventL(
-                aKeyEvent, aType);
-                
-                // In MPX the band dialog presets need to be saved 
-                // and called back to the observer
-                //
-                if( iIsActivePreset )
-                    {
-                    CAudioEqualizer& audioEqualizer = iAudEqUtility->Equalizer();
-                    iAudEqUtility->ModifyPresetL(iPresetIndex, iPresetName, audioEqualizer);
-                    
-                    iObserver.HandlePresetActivation( iPresetKey );
-                    }
-                }
-                break;
-            
-            case EKeyRightArrow:
-                if (AknLayoutUtils::LayoutMirrored())
-                    {
-                    // For Series60 Arabic Hebrew LAF                
-                    // Bugfix for Id: TCON-6HKGAB            
-                    indexOfLastFocussedBand = iIndexOfFocussedFreqBand;
-                    iIndexOfFocussedFreqBand = 
-                    (indexOfLastFocussedBand+iNumberOfFreqBands-1)
-                                    %iNumberOfFreqBands;
-                    SwapFocus((*iFreqBand)[indexOfLastFocussedBand], 
-                    (*iFreqBand)[iIndexOfFocussedFreqBand]);
-                    ret = EKeyWasConsumed;                     
-                    }
-                else
-                    {
-                    indexOfLastFocussedBand = iIndexOfFocussedFreqBand;
-                    iIndexOfFocussedFreqBand = 
-                    (indexOfLastFocussedBand+1)%iNumberOfFreqBands;
-                    SwapFocus((*iFreqBand)[indexOfLastFocussedBand], 
-                    (*iFreqBand)[iIndexOfFocussedFreqBand]);
-                    ret = EKeyWasConsumed;                   
-                    }
-                break;
-            case EKeyLeftArrow:
-                if (AknLayoutUtils::LayoutMirrored())
-                    {
-                    // For Series60 Arabic Hebrew LAF                
-                    // Bugfix for Id: TCON-6HKGAB
-                    indexOfLastFocussedBand = iIndexOfFocussedFreqBand;
-                    iIndexOfFocussedFreqBand = (indexOfLastFocussedBand + 1)% 
-                                                iNumberOfFreqBands;
-                    SwapFocus((*iFreqBand)[indexOfLastFocussedBand], 
-                    (*iFreqBand)[iIndexOfFocussedFreqBand]);
-                    ret = EKeyWasConsumed;                     
-                    }
-                else
-                    {
-                    indexOfLastFocussedBand = iIndexOfFocussedFreqBand;
-                    iIndexOfFocussedFreqBand = (indexOfLastFocussedBand + 
-                    iNumberOfFreqBands -1)% iNumberOfFreqBands;
-                    SwapFocus((*iFreqBand)[indexOfLastFocussedBand], 
-                    (*iFreqBand)[iIndexOfFocussedFreqBand]);
-                    ret = EKeyWasConsumed;                   
-                    }
-                break;
-
-            default:
-                break;
-            }         
-        }
-
-    // If the CEqualizerFreqBandContainer didn't use the key event, it
-    // must return EKeyWasNotConsumed,
-    // so that the key event is passed to other controls on the stack.
-    return ret;
-    }
-
-// ----------------------------------------------------------------------------
-// CEqualizerFreqBandContainer::SetAudioEqualizerL(CAudioEqualizerUtility* 
-// aAudEqUtility)
-// This function is used to set a new CAudioEqualizerUtility* 
-// ----------------------------------------------------------------------------
-//    
-void CEqualizerFreqBandContainer::SetAudioEqualizerL(
-CAudioEqualizerUtility* aAudEqUtility)
-	{
-	iAudEqUtility=aAudEqUtility;
-	for (int i=0; i<iNumberOfFreqBands; i++)
-	    {
-	    (*iFreqBand)[i]->SetAudioEqualizerL(aAudEqUtility);
-	    }
-	}
-
-// ---------------------------------------------------------
-// CEqualizerFreqBandContainer::MopSupplyObject
-// Pass skin information if need.
-// (other items were commented in a header).
-// ---------------------------------------------------------
-//
-TTypeUid::Ptr CEqualizerFreqBandContainer::MopSupplyObject(TTypeUid aId)
-	{
-	if ( aId.iUid == MAknsControlContext::ETypeId )
-		{
-		// Return the control context for the childs
-		return MAknsControlContext::SupplyMopObject( aId, iBackGround );
-		}
-	return CCoeControl::MopSupplyObject( aId );
-	}
-	
-// ---------------------------------------------------------
-// CEqualizerFreqBandContainer::ConstructLabelsL
-// Contruct the frequency value labels.
-// (other items were commented in a header).
-// ---------------------------------------------------------
-//
-void CEqualizerFreqBandContainer::ConstructLabelsL()
-	{
-	
-	CAudioEqualizer& audioEqualizer = iAudEqUtility->Equalizer();
-	CEikLabel* tempLabel;
-	TBuf<15> tempStr;
-	TReal x,y;
-	
-	tempLabel = new (ELeave) CEikLabel;
-	tempLabel->SetContainerWindowL( *this );
-  HBufC* hzText = StringLoader::LoadLC(R_QTN_EQ_PRESET_FREQUENCY_HZ);
-	tempLabel->SetTextL(hzText->Des());
-	tempLabel->SetBrushStyle(CGraphicsContext::ENullBrush);
-	CleanupStack::PushL(tempLabel);
-	iFreqLabels->AppendL(tempLabel); 
-	CleanupStack::Pop(tempLabel);
-	CleanupStack::PopAndDestroy(); // hzText
-	
-	tempLabel = new (ELeave) CEikLabel;
-	tempLabel->SetContainerWindowL( *this );
-  HBufC* mhzText = StringLoader::LoadLC(R_QTN_EQ_PRESET_FREQUENCY_KHZ);
-	tempLabel->SetTextL(mhzText->Des());
-	tempLabel->SetBrushStyle(CGraphicsContext::ENullBrush);
-	CleanupStack::PushL(tempLabel);
-	iFreqLabels->AppendL(tempLabel); 
-	CleanupStack::Pop(tempLabel);
-	CleanupStack::PopAndDestroy(); // MhzText
-
-	tempLabel = new (ELeave) CEikLabel;
-	tempLabel->SetContainerWindowL( *this );
-	tempStr.Format(KLabelFormatInt,audioEqualizer.CenterFrequency(1));
-	AknTextUtils::LanguageSpecificNumberConversion( tempStr );
-	tempLabel->SetTextL(tempStr);
-	tempLabel->SetBrushStyle(CGraphicsContext::ENullBrush);
-	CleanupStack::PushL(tempLabel);
-	iFreqLabels->AppendL(tempLabel); 
-	CleanupStack::Pop(tempLabel);
-	
-	tempLabel = new (ELeave) CEikLabel;
-	tempLabel->SetContainerWindowL( *this );
-    tempStr.Format(KLabelFormatInt, audioEqualizer.CenterFrequency(2));
-    AknTextUtils::LanguageSpecificNumberConversion( tempStr );
-	tempLabel->SetTextL(tempStr);
-	tempLabel->SetBrushStyle(CGraphicsContext::ENullBrush);
-	CleanupStack::PushL(tempLabel);
-	iFreqLabels->AppendL(tempLabel); 
-	CleanupStack::Pop(tempLabel);
-	
-	tempLabel = new (ELeave) CEikLabel;
-	tempLabel->SetContainerWindowL( *this );
-    tempStr.Format(KLabelFormatInt, audioEqualizer.CenterFrequency(3));
-    AknTextUtils::LanguageSpecificNumberConversion( tempStr );
-	tempLabel->SetTextL(tempStr);
-	tempLabel->SetBrushStyle(CGraphicsContext::ENullBrush);
-	CleanupStack::PushL(tempLabel);
-	iFreqLabels->AppendL(tempLabel); 
-	CleanupStack::Pop(tempLabel);
-	
-	Math::Round(y,(TReal)audioEqualizer.CenterFrequency(4)/1000,1);
-	tempLabel = new (ELeave) CEikLabel;
-	tempLabel->SetContainerWindowL( *this );
-	Math::Mod(x,y*10,10);
-	if(x==0)
-	    tempStr.Format(KLabelFormatInt,(TInt)y);
-	else
-	    tempStr.Format(KLabelFormatFloat,y);
-	AknTextUtils::LanguageSpecificNumberConversion( tempStr );
-	tempLabel->SetTextL(tempStr);
-	tempLabel->SetBrushStyle(CGraphicsContext::ENullBrush);
-	CleanupStack::PushL(tempLabel);
-	iFreqLabels->AppendL(tempLabel); 
-	CleanupStack::Pop(tempLabel);
-	
-	Math::Round(y,(TReal)audioEqualizer.CenterFrequency(5)/1000,1);
-	tempLabel = new (ELeave) CEikLabel;
-	tempLabel->SetContainerWindowL( *this );
-	Math::Mod(x,y*10,10);
-	if(x==0)
-	    tempStr.Format(KLabelFormatInt,(TInt)y);
-	else
-	    tempStr.Format(KLabelFormatFloat,y);
-	AknTextUtils::LanguageSpecificNumberConversion( tempStr );
-	tempLabel->SetTextL(tempStr);
-	tempLabel->SetBrushStyle(CGraphicsContext::ENullBrush);
-	CleanupStack::PushL(tempLabel);
-	iFreqLabels->AppendL(tempLabel); 
-	CleanupStack::Pop(tempLabel);
-	
-	if(iNumberOfFreqBands ==KEqualizerEightBands)
-		{
-		Math::Round(y,(TReal)audioEqualizer.CenterFrequency(6)/1000,1);
-		tempLabel = new (ELeave) CEikLabel;
-		tempLabel->SetContainerWindowL( *this );
-		Math::Mod(x,y*10,10);
-		if(x==0)
-	        tempStr.Format(KLabelFormatInt,(TInt)y);
-	    else
-	        tempStr.Format(KLabelFormatFloat,y);
-	    AknTextUtils::LanguageSpecificNumberConversion( tempStr );
-		tempLabel->SetTextL(tempStr);
-		tempLabel->SetBrushStyle(CGraphicsContext::ENullBrush);
-		CleanupStack::PushL(tempLabel);
-		iFreqLabels->AppendL(tempLabel); 
-		CleanupStack::Pop(tempLabel);
-		
-		Math::Round(y,(TReal)audioEqualizer.CenterFrequency(7)/1000,1);
-		tempLabel = new (ELeave) CEikLabel;
-		tempLabel->SetContainerWindowL( *this );
-		Math::Mod(x,y*10,10);
-		if(x==0)
-	        tempStr.Format(KLabelFormatInt,(TInt)y);
-	    else
-	        tempStr.Format(KLabelFormatFloat,y);
-	    AknTextUtils::LanguageSpecificNumberConversion(tempStr);
-		tempLabel->SetTextL(tempStr);
-		tempLabel->SetBrushStyle(CGraphicsContext::ENullBrush);
-		CleanupStack::PushL(tempLabel);
-		iFreqLabels->AppendL(tempLabel); 
-		CleanupStack::Pop(tempLabel);
-		
-		Math::Round(y,(TReal)audioEqualizer.CenterFrequency(8)/1000,1);
-		tempLabel = new (ELeave) CEikLabel;
-		tempLabel->SetContainerWindowL( *this );
-		Math::Mod(x,y*10,10);
-		if(x==0)
-	        tempStr.Format(KLabelFormatInt,(TInt)y);
-    	else
-	        tempStr.Format(KLabelFormatFloat,y);
-    	AknTextUtils::LanguageSpecificNumberConversion(tempStr);
-		tempLabel->SetTextL(tempStr);
-		tempLabel->SetBrushStyle(CGraphicsContext::ENullBrush);
-		CleanupStack::PushL(tempLabel);
-		iFreqLabels->AppendL(tempLabel); 
-		CleanupStack::Pop(tempLabel);
-		}
-		
-	TRgb color;
-  MAknsSkinInstance* skin = AknsUtils::SkinInstance();
-    
-  for(TInt i=0; i<iFreqLabels->Count(); i++)
-   	{
-   	CCoeControl* label( ComponentControl( i+iNumberOfFreqBands ));
-   	TInt error = AknsUtils::GetCachedColor( skin, color,
-                                            KAknsIIDQsnTextColors,
-                                            EAknsCIQsnTextColorsCG6 );
-   	if ( !error )
-       	AknLayoutUtils::OverrideControlColorL( *label,
-                                              EColorLabelText,
-                                              color);
-   	}
-	
-	}
-	
-#ifdef RD_SCALABLE_UI_V2
-// ---------------------------------------------------------
-// CEqualizerFreqBandContainer::HandlePointerEventL
-// This function is used to handle pen input events.
-// ---------------------------------------------------------
-//
-void CEqualizerFreqBandContainer::HandlePointerEventL(const TPointerEvent& aPointerEvent)
-    {
-    if (AknLayoutUtils::PenEnabled())
-        {
-        if ( aPointerEvent.iType == TPointerEvent::EButton1Down )
-            {
-	        for ( TInt i = 0; i < iNumberOfFreqBands; i++ )
-	            {
-	            TRect x = (*iFreqBand)[i]->Rect();
-	            if (x.Contains(aPointerEvent.iPosition))
-	                {
-	                if ( iIndexOfFocussedFreqBand != i )
-	                    {
-	                    TInt indexOfLastFocussedBand = iIndexOfFocussedFreqBand;
-	                    iIndexOfFocussedFreqBand = i;
-	                    SwapFocus((*iFreqBand)[indexOfLastFocussedBand],
-	                        (*iFreqBand)[iIndexOfFocussedFreqBand]);
-	                    }
-	                iBandSelected = ETrue;
-	                break;
-	                }
-				}
-			}
-
-		if ( iBandSelected )
-		    {
-			(*iFreqBand)[iIndexOfFocussedFreqBand]->HandlePointerEventL(aPointerEvent);
-		    }
-
-		// In MPX the band dialog presets need to be saved
-		// and called back to the observer
-		//
-		if ( iBandSelected &&
-            ( (aPointerEvent.iType == TPointerEvent::EButton1Up) ||
-		      (aPointerEvent.iType == TPointerEvent::EDrag) ) )
-			{
-			if ( iIsActivePreset )
-                {
-				CAudioEqualizer& audioEqualizer = iAudEqUtility->Equalizer();
-				iAudEqUtility->ModifyPresetL(iPresetIndex, iPresetName, audioEqualizer);
-				iObserver.HandlePresetActivation( iPresetKey );
-				}
-			if ( aPointerEvent.iType == TPointerEvent::EButton1Up )
-                {
-                iBandSelected = EFalse;
-			    }
-			}
-	    }
-    }
-#endif //RD_SCALABLE_UI_V2
-
-// End of File
-
--- a/mmserv/audioeffectsui/equalizer/src/EqualizerMain.cpp	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +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:    Standard entry point for a DLL
-*
-*/
-
-
-
-
-// INCLUDE FILES
-#include <e32base.h> 
-
-
-// End of File
--- a/mmserv/audioeffectsui/equalizer/src/EqualizerPresetListArray.cpp	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,405 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:    Item text array for Equalizer Preset Listbox.
-*
-*/
-
-
-
-
-// INCLUDE FILES
-#include    <coemain.h>
-#include    <aknconsts.h>
-#include    <AknsUtils.h>
-#include    <AknsConstants.h>
-#include    <eikenv.h>
-#include    <data_caging_path_literals.hrh>
-#include    <StringLoader.h>
-#include    <barsread.h>
-
-#include    <Equalizer.rsg>  // Contains the resource definition
-#include    "EqualizerPrivateConstants.h"
-#include    "EqualizerPresetListArray.h"
-
-// CONSTANTS
-
-const TInt KEqrActiveIcon = 1;
-const TInt KEqrNonActiveIcon = 0;
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// CEqualizerPresetListArray::CEqualizerPresetListArray
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// -----------------------------------------------------------------------------
-//
-CEqualizerPresetListArray::CEqualizerPresetListArray (
- CAudioEqualizerUtility*  aAudioEqUtil): 
-                               iAudEqUtility(aAudioEqUtil)
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// CEqualizerPresetListArray::ConstructL
-// Symbian 2nd phase constructor can leave.
-// -----------------------------------------------------------------------------
-//
-void CEqualizerPresetListArray::ConstructL(TInt aActivePresetKey)
-    {
-    //Read text for preset "None" from rss file
-    iPresetNoneText = StringLoader::LoadL(R_QTN_EQUALIZER_PRESET_NONE);
-
-    // iItem length cannot be defined dynamically as MdcaPoint is const function
-    iItem = HBufC::NewL(KListBoxEntryMaxLength);
-    iSortedPresetArray =  new (ELeave) CDesCArrayFlat
-                                    (KEqualizerArrayGranularity);  
-    UpdateSortedArrayL();
-    
-    HBufC* tempText = NULL;
-    iPreDefinedPresetArray =  new (ELeave) CDesCArrayFlat
-                                    (KEqualizerArrayGranularity);
-    if (iAudEqUtility) 
-        {
-        // construct the array of available languages
-        TResourceReader reader;
-        CEikonEnv::Static()->CreateResourceReaderLC( reader, 
-                                    R_EQUALIZER_PREDEFINED_PRESETS );
-        CDesCArray* presetStringArray; 
-        presetStringArray = reader.ReadDesCArrayL();
-        CleanupStack::PopAndDestroy(); // resource reader
-        CleanupStack::PushL( presetStringArray );
-        
-        TArray<TEfAudioEqualizerUtilityPreset> presets =
-                                                iAudEqUtility->Presets();
-        TInt numPreDefinedPresets =iAudEqUtility->NumberOfPreDefinedPresets();                                        
-        for (TInt presetIndex = 0; 
-             presetIndex < numPreDefinedPresets; presetIndex++) 
-            {
-            TArray<TEfAudioEqualizerUtilityPreset> presets =
-                                                    iAudEqUtility->Presets();
-            TInt numPreDefinedPresets = 
-                                iAudEqUtility->NumberOfPreDefinedPresets();                                        
-            for (TInt presetIndex = 0; 
-                 presetIndex < numPreDefinedPresets; presetIndex++) 
-                {
-                if ((tempText = SearchForPredefinedPresetL(*presetStringArray, 
-                            presets[presetIndex].iPresetName)) == NULL)
-                    {
-                    // If control reaches here then there is a predefined preset in 
-                    // the cenrep whose name is not localised
-                    // In case no match is found display the English text
-                    tempText = presets[presetIndex].iPresetName.AllocL();
-                    }
-                CleanupStack::PushL(tempText);
-                iPreDefinedPresetArray->AppendL(*tempText);
-                CleanupStack::PopAndDestroy(tempText);
-                }
-			GetLocalisedPresetNameFromKey(aActivePresetKey, iActivePreset);
-            }
-        CleanupStack::PopAndDestroy(presetStringArray);    
-        }
-    }
-    
-
-
-// -----------------------------------------------------------------------------
-// CEqualizerPresetListArray::NewL
-// Two-phased constructor.
-// ----------------------------------------------------------------------------
-//
-CEqualizerPresetListArray* CEqualizerPresetListArray::NewL(
-                               CAudioEqualizerUtility* aAudioEqUtil,
-                               TInt aActivePresetKey)
-    {
-    CEqualizerPresetListArray* self = new(ELeave) CEqualizerPresetListArray
-                                           (aAudioEqUtil);                                  
-    CleanupStack::PushL(self);
-    self->ConstructL(aActivePresetKey);
-    CleanupStack::Pop(self); 
-
-    return self;
-    }
-    
-// ---------------------------------------------------------------------------
-// CEqualizerPresetListArray::~CEqualizerPresetListArray
-// Destructor.
-// ---------------------------------------------------------------------------
-//
-CEqualizerPresetListArray::~CEqualizerPresetListArray()
-    {
-    delete iPresetNoneText;
-    delete iItem;
-    if (iSortedPresetArray)
-        {
-        iSortedPresetArray->Reset();
-        delete iSortedPresetArray;       
-        }
-    if (iPreDefinedPresetArray)
-        {
-        iPreDefinedPresetArray->Reset();
-        delete iPreDefinedPresetArray;         
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// CEqualizerPresetListArray::MdcaCount() const
-// Returns the number of descriptor elements in a descriptor array.
-// ---------------------------------------------------------------------------
-//
-TInt CEqualizerPresetListArray::MdcaCount() const
-    {
-    TInt ret = 0;
-    // Check if iAudEqUtility is NULL, if it is NULL then the ListBox
-    // is empty.
-    if (iAudEqUtility) 
-        {
-        TArray<TEfAudioEqualizerUtilityPreset> presets =
-                                                iAudEqUtility->Presets();
-        ret = presets.Count() + 1; //Add the preset "None"
-        }
-    
-    return ret;
-    }
-    
-// -----------------------------------------------------------------------------
-// CEqualizerPresetListArray::MdcaPoint
-// Indexes into a descriptor array.
-// -----------------------------------------------------------------------------
-//
-TPtrC CEqualizerPresetListArray::MdcaPoint(TInt aIndex) const
-    {
-    TPtrC item;
-    TArray<TEfAudioEqualizerUtilityPreset> presets = iAudEqUtility->Presets();
-    
-    if (aIndex <= iAudEqUtility->NumberOfPreDefinedPresets())
-        { // The predefined presets do not need to be sorted
-        if (aIndex == 0)
-            {
-            CreateListBoxIconText(*iPresetNoneText);
-            }
-        else
-            {
-            CreateListBoxIconText((*iPreDefinedPresetArray)[aIndex-1]);
-            }
-        }
-    else
-        { // Sort the user defined presets
-        CreateListBoxIconText((*iSortedPresetArray)[aIndex -
-                         iAudEqUtility->NumberOfPreDefinedPresets()-1]);       
-        }
-    
-    item.Set(*iItem);
-    return item;
-    
-    }
-    
-// ---------------------------------------------------------------------------
-// CEqualizerPresetListArray::UpdateSortedArrayL() 
-// Updates the sorted array with the changed user-defined presets
-// ---------------------------------------------------------------------------
-//    
-void CEqualizerPresetListArray::UpdateSortedArrayL()
-    {
-    TInt presetIndex;
-    TInt numPreDefinedPresets = iAudEqUtility->NumberOfPreDefinedPresets();
-    TArray<TEfAudioEqualizerUtilityPreset> presets = iAudEqUtility->Presets();
-    iSortedPresetArray->Reset();
-    for (presetIndex = numPreDefinedPresets; presetIndex < presets.Count(); 
-                                                                presetIndex++) 
-        {
-        TPresetName preset = presets[presetIndex].iPresetName;
-        iSortedPresetArray->InsertIsqL(presets[presetIndex].iPresetName, 
-                                                                ECmpCollated);
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// CEqualizerPresetListArray::GetLocalisedPresetNameFromKey() 
-// Returns the localised name for the preset given the PresetNameKey
-// ---------------------------------------------------------------------------
-//    
-void CEqualizerPresetListArray::GetLocalisedPresetNameFromKey(TInt aPresetNameKey, 
-											TPresetName& aPresetName)
-    {
-    TInt count;
-
-  	//If a junk aCurrentActivePreset is passed to us we activate preset "None"
-	aPresetName = *iPresetNoneText;
-
-	if (aPresetNameKey == KEqualizerPresetNone)
-		{
-		aPresetName = *iPresetNoneText;
-		}
-	else
-		{
-		TArray<TEfAudioEqualizerUtilityPreset> presets = iAudEqUtility->Presets();
-		TInt numPredefinedPresets = iAudEqUtility->NumberOfPreDefinedPresets();
-	    TInt numPresets = presets.Count();
-		for (count = 0; count < numPresets; count++)
-		    {
-			if (presets[count].iPresetNameKey == aPresetNameKey)
-				{
-				if (count < numPredefinedPresets)
-				    {
-					TPtrC selectedItem = MdcaPoint(count+1);
-                    TInt begin = selectedItem.FindC(KEqrTab);
-                    TPtrC localisedPreset = selectedItem.Right
-                       (selectedItem.Length() -begin-1);            
-                    aPresetName = localisedPreset;
-					}
-				else
-					{
-					aPresetName = presets[count].iPresetName;
-					}
-			    }
-			}
-		}	
-    } 
-
-// ---------------------------------------------------------------------------
-// CEqualizerPresetListArray::GetPresetKeyFromLocalisedName() 
-// Returns the PresetNameKey given the localised name for the preset
-// ---------------------------------------------------------------------------
-//    
-void CEqualizerPresetListArray::GetPresetKeyFromLocalisedName(TInt& 
-            aPresetNameKey, const TPresetName& aPresetName)
-    {
-    TInt count;
-
-	if (aPresetName == *iPresetNoneText)
-		{
-		aPresetNameKey = KEqualizerPresetNone;
-		}
-	else
-		{
-		TArray<TEfAudioEqualizerUtilityPreset> presets = iAudEqUtility->Presets();
-		TInt numPredefinedPresets = iAudEqUtility->NumberOfPreDefinedPresets();
-	    TInt numPresets = presets.Count();
-		for (count = 0; count < numPresets; count++)
-		    {
-		    TPtrC selectedItem = MdcaPoint(count+1);
-            TInt begin = selectedItem.FindC(KEqrTab);
-            TPtrC localisedPreset = selectedItem.Right(selectedItem.Length()
-                                        -begin-1);            
-
-			if (((count < numPredefinedPresets) && (localisedPreset == 
-			    aPresetName)) || (presets[count].iPresetName == aPresetName))
-				{
-				aPresetNameKey = presets[count].iPresetNameKey; 
-				break;
-				}
-			}
-		}	
-    } 
-
-// ---------------------------------------------------------------------------
-// HBufC* CEqualizerPresetListArray::SearchForPredefinedPresetL
-// (const CDesCArray& aPresetArray, const TPresetName& aCenrepPreset)
-// Searches for a localised name for a preset found in the CenRep
-// ---------------------------------------------------------------------------
-//    
-HBufC* CEqualizerPresetListArray::SearchForPredefinedPresetL(const CDesCArray& 
-    aPresetArray, const TPresetName& aCenrepPreset)
-    {
-    HBufC* retLocalisedPreset = NULL;
-    for (TInt index =0; index<aPresetArray.Count(); index++)
-        {
-        TPtrC resourceFileText(aPresetArray[index]);
-        TInt begin = resourceFileText.FindC(KEqrTab);
-        TPtrC preset(resourceFileText.Left(begin));
-        TPtrC localisedPreset(resourceFileText.Right(resourceFileText.Length()
-                                -begin-1));
-        if (aCenrepPreset == preset)   
-            {
-            retLocalisedPreset = localisedPreset.AllocL();
-            break;
-            }
-        }
-    return retLocalisedPreset;
-    }
-    
-// ---------------------------------------------------------------------------
-// CEqualizerPresetListArray::CreateListBoxIconText(const 
-//  TPresetName& aPresetName) const 
-// Creates the ListBox text including the icon information. e.g "0\tNone"
-// ---------------------------------------------------------------------------
-//    
-void CEqualizerPresetListArray::CreateListBoxIconText(const 
-  TPtrC& aPresetName) const
-    {
-    TPtr ptr = iItem->Des();
-    ptr.Zero();
-    if (aPresetName == iActivePreset) 
-        {
-        ptr.AppendNumUC(KEqrActiveIcon);
-        }
-    else
-        {
-        ptr.AppendNumUC(KEqrNonActiveIcon);
-        }
-    ptr.Append(KEqrTab); 
-    ptr.Append(aPresetName);
-    }
-    
-// -----------------------------------------------------------------------------
-// void CEqualizerPresetListArray::SetCurrentActivePreset(const TDesC&
-//                                       aActivePreset)
-// Used to set the currently active preset.
-// -----------------------------------------------------------------------------
-//
-void CEqualizerPresetListArray::SetCurrentActivePreset(const TDesC& 
-                                       aActivePreset)
-    {
-    iActivePreset = aActivePreset;
-    }
-
-// -----------------------------------------------------------------------------
-// TPtrC CEqualizerPresetListArray::GetCurrentActivePreset()
-// Used to set the currently active preset.
-// -----------------------------------------------------------------------------
-//
-void CEqualizerPresetListArray::GetCurrentActivePreset(TPresetName& aActivePreset)
-    {
-    aActivePreset = iActivePreset;
-    }    
-    
-// ----------------------------------------------------------------------------
-// CEqualizerPresetListArray::SetAudioEqualizer(CAudioEqualizerUtility* 
-// aAudEqUtility)
-// This function is used to set a new CAudioEqualizerUtility* 
-// ----------------------------------------------------------------------------
-//    
-void CEqualizerPresetListArray::SetAudioEqualizer(
-CAudioEqualizerUtility* aAudEqUtility)
-	{
-	iAudEqUtility=aAudEqUtility;
-	}
-	
-// ----------------------------------------------------------------------------
-// CEqualizerPresetListArray::GetPrefixLength()
-// This function is used to get the length of prefix (eg "0\t")
-// before the preset name. 
-// ----------------------------------------------------------------------------
-//    
-TInt CEqualizerPresetListArray::GetPrefixLength()
-	{
-	TPtr ptr = iItem->Des();
-    ptr.Zero();
-    ptr.AppendNumUC(KEqrActiveIcon);
-    ptr.Append(KEqrTab); 
-    return ptr.Length();
-	}
-	    
-//  End of File  
--- a/mmserv/audioeffectsui/equalizer/src/EqualizerPresetsDialog.cpp	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1228 +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:    Implementation of CEqualizerPresetsDialog class
-*
-*/
-
-
-
-
-// INCLUDE FILES   
-#include <StringLoader.h>
-#include <akntitle.h>  
-#include <eikenv.h>
-#include <bldvariant.hrh>
-#include <aknnotewrappers.h>
-#include <bautils.h>
-#include <aknenv.h> 
-#include <aknlists.h>
-#include <data_caging_path_literals.hrh>
-#include <eikclbd.h>
-#include <AknIconArray.h> 
-#include <avkon.hrh>
-//LAF and Skin changes
-#include <AknsUtils.h>
-#include <e32base.h>
-#include <AknsConstants.h>
-#include <aknlayout.cdl.h>
-#include <featmgr.h>
-#include <hlplch.h>
-#include <AudioEqualizerUtility.h>
-#include <sysutil.h>
-#include <AknGlobalNote.h>
-#include <aknclearer.h>
-#include <layoutmetadata.cdl.h>
-
-#include <csxhelp/eq.hlp.hrh>
-#include <Equalizer.rsg>  // Contains the resource definition
-#include <equalizer.mbg>
-#include "EqualizerPrivateConstants.h"
-#include "EqualizerPresetsDialog.h" 
-#include "EqualizerPresetListArray.h" 
-#include "EqualizerEditingDialog.h" 
-#include "Equalizer.hrh"
-
-// CONSTANTS
-//Used during building a new preset name   
-_LIT( KEqrFormat, "%d)" );
-_LIT( KEqrZero, "0" );
-_LIT( KEqrParenthesis, "(" );  
-
-// Used for checking if the new preset name contains illegal characters
-_LIT(KEqrLessThan, "<");
-_LIT(KEqrGreaterThan, ">");
-_LIT(KEqrQuote, "\"");
-_LIT(KEqrBackSlash, "\\");
-_LIT(KEqrForwardSlash, "/");
-_LIT(KEqrOrSymbol, "|");
-_LIT(KEqrColon, ":");
-_LIT(KEqrAsterisk, "*");
-_LIT(KEqrQuestionMark, "?");
-  
-// ================= MEMBER FUNCTIONS =======================
- 
-// -------------------------------------------------------------------
-// CEqualizerPresetsDialog* CEqualizerPresetsDialog::NewL()
-// Create instance of concrete ECOM interface implementation
-// -------------------------------------------------------------------
-// 
-EXPORT_C CEqualizerPresetsDialog* CEqualizerPresetsDialog::NewL(
-       CAudioEqualizerUtility* aAudEqUtility,
-       TInt aCurrentActivePreset, 
-       MEqualizerPresetActivationObserver& aEqrPresetActObserver)
-    {
-    CEqualizerPresetsDialog* self = new (ELeave) CEqualizerPresetsDialog(
-        aAudEqUtility, aEqrPresetActObserver);
-    CleanupStack::PushL(self); 
-    self->ConstructL(aCurrentActivePreset);
-    CleanupStack::Pop(self); 
-    return self;
-    }
-
-// -------------------------------------------------------------------
-// CEqualizerPresetsDialog::CEqualizerPresetsDialog(
-//       CAudioEqualizerUtility*& aAudEqUtility,
-//       MEqualizerPresetActivationObserver& aEqrPresetActObserver)
-// First Phase Construction
-// -------------------------------------------------------------------
-// 
-CEqualizerPresetsDialog::CEqualizerPresetsDialog(
-       CAudioEqualizerUtility* aAudEqUtility,
-       MEqualizerPresetActivationObserver& aEqrPresetActObserver):
-       
-       iAudEqUtility(aAudEqUtility),
-       iEqrPresetActObserver(aEqrPresetActObserver)
-    {
-    }
-
-// -------------------------------------------------------------------
-// CEqualizerPresetsDialog::ConstructL()
-// Second Phase Constructor
-// -------------------------------------------------------------------
-// 
-void CEqualizerPresetsDialog::ConstructL(const TInt aCurrentActivePreset)
-    {
-    //Initially set these variable to EFalse
-    iContextSensitiveMenu = EFalse;
-    iIgnoreKeyEvents = EFalse;
-    
-    iRepository = CRepository::NewL(KCRUidMusicPlayerSettings);
-
-    //Add the resource file
-
-    // Find which drive this DLL is installed.
-    TFileName fileName;
-    // Get the full resource file
-    TParse fp;
-    // Add the resource dir
-    fp.Set( KEqualizerResourceFileName, &KDC_APP_RESOURCE_DIR, NULL);
-    // Get the filename with full path
-    fileName = fp.FullName(); 
-    //for localisation of resource file
-    BaflUtils::NearestLanguageFile( iEikonEnv->FsSession(), fileName ); 
-    iResourceFileOffset = iEikonEnv->AddResourceFileL( fileName );
-
-    //Read text for preset "None" from rss file
-    iPresetNoneText = StringLoader::LoadL(R_QTN_EQUALIZER_PRESET_NONE);
-    iTitleText = StringLoader::LoadL(R_QTN_EQUALIZER_TITLE_TEXT);
-
-    iItemArray = CEqualizerPresetListArray::NewL(iAudEqUtility, 
-                                     aCurrentActivePreset);
-
-    iItemArray->GetCurrentActivePreset(iActivePreset);
-
-    CAknDialog::ConstructL(R_EQUALIZER_CONTAINER_MENUBAR);
-    }
-
-// -------------------------------------------------------------------
-// CEqualizerPresetsDialog::~CEqualizerPresetsDialog()
-// Destructor
-// --------------------------------------------------------------------
-//  
-CEqualizerPresetsDialog::~CEqualizerPresetsDialog()
-    {
-    if (iResourceFileOffset)
-        {
-        iEikonEnv->DeleteResourceFile(iResourceFileOffset); 
-        }
-    delete iRepository;
-    if (iAppTitleText)
-        {
-        // restore musicplayer's title
-        CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane();
-        CAknTitlePane* tp=(CAknTitlePane*)sp->ControlL(TUid::Uid(EEikStatusPaneUidTitle));   
-        tp->SetTextL(*iAppTitleText);        
-	    delete iAppTitleText;
-        }
-    delete iPresetNoneText;
-    delete iTitleText;
-    delete iItemArray;
-    }
-
-// --------------------------------------------------------------------------
-// void CEqualizerPresetsDialog::BuildPresetNameL( TDes& aName) const
-// Returns free folder name
-// --------------------------------------------------------------------------
-//
-void CEqualizerPresetsDialog::BuildPresetNameL( TDes& aName) const
-    {
-    //set name in the query box to "Preset"
-    HBufC* defaultText = StringLoader::LoadLC(
-        R_QTN_EQ_PRESET_DEFAULT_NAME);    
-
-    TInt n(0);
-
-    // Numbers start from 1
-    TBool found( EFalse );
-    TBuf<KMaxPresetNameLength> number;
-
-    // The loop is iterated until a free folder name is found.
-    FOREVER
-        {
-        found = EFalse;
-        // Constructs a candidate for the name
-        TBuf<KMaxPresetNameLength> newName;
-        newName.Copy( *defaultText );
-
-        if( n > 0 )
-            // First new is without number ( New folder, New folder(01), New folder(02), ...)
-            {
-            // Creates the current number.
-            number.Format( KEqrFormat, n );
-            AknTextUtils::LanguageSpecificNumberConversion ( number );
-
-            TInt leadingZeroLength( 0 );
-            if( n < 10 )
-                {
-                leadingZeroLength = KEqrZero().Length();
-                }
-
-            // checks the total length of the costructed string
-            if( ( number.Length() + newName.Length() + KEqrParenthesis().Length()
-                  + leadingZeroLength ) > KMaxPresetNameLength )
-                {
-                User::Leave( KErrOverflow );
-                }
-
-            // Appends the first parenthesis
-            newName.Append( KEqrParenthesis );
-            if( n < 10 )
-                {
-                // Appends the leading zero ( always two digits 08, 09, 10, 11,...)
-                 TBuf< 16 > zero(KEqrZero);
-        		AknTextUtils::DisplayTextLanguageSpecificNumberConversion( zero );
-                newName.Append( KEqrZero );
-                }
-            newName.Append( number );
-            }
-        found = SearchPresetL(newName);
-        
-        if( found == KErrNotFound )
-            {
-            aName = newName;
-            CleanupStack::PopAndDestroy( defaultText); 
-            return;
-            }
-        n++;
-        }   
-    }
-
-// -----------------------------------------------------------------------
-// CEqualizerPresetsDialog::GetNewName(TInt aResourceId, TDes& presetName)
-//
-// This function is called to display the dialog box to get a new name
-// during "Raname" or "Create new"
-// -----------------------------------------------------------------------
-// 
-TBool CEqualizerPresetsDialog::GetNewNameL(const TInt aResourceId, TDes& 
-aPresetName) const
-    {
-    CAknTextQueryDialog* dlg;
-    TBool ret = EFalse;
-    
-    while (1)
-        {
-        dlg = CAknTextQueryDialog::NewL(aPresetName); 
-        if (dlg->ExecuteLD(aResourceId))
-            {
-            // Illegal characters in a preset name are < > \" \\ / | : * ?"
-
-            if ( (aPresetName.FindC( KEqrLessThan ) != KErrNotFound ) ||
-                 (aPresetName.FindC( KEqrGreaterThan ) != KErrNotFound ) ||
-                 (aPresetName.FindC( KEqrQuote ) != KErrNotFound ) ||
-                 (aPresetName.FindC( KEqrBackSlash ) != KErrNotFound ) ||                 
-                 (aPresetName.FindC( KEqrForwardSlash ) != KErrNotFound ) ||
-                 (aPresetName.FindC( KEqrOrSymbol ) != KErrNotFound ) ||
-                 (aPresetName.FindC( KEqrColon ) != KErrNotFound ) ||                 
-                 (aPresetName.FindC( KEqrAsterisk ) != KErrNotFound ) ||
-                 (aPresetName.FindC( KEqrQuestionMark ) != KErrNotFound )             
-               )
-                {
-                HBufC* text = StringLoader::LoadLC(
-                    R_QTN_FLDR_ILLEGAL_CHARACTERS);
-                CAknInformationNote* note = new( ELeave ) CAknInformationNote(ETrue);
-                note->ExecuteLD( *text );
-                CleanupStack::PopAndDestroy(text);
-                continue;
-                }
-            
-            TInt error = SearchPresetL(aPresetName);    
-            if (error != KErrNotFound)
-                {
-                // display error
-                HBufC* label = StringLoader::LoadLC(
-                    R_QTN_FLDR_NAME_ALREADY_USED, aPresetName );
-                CAknInformationNote* note = new( ELeave )
-                                         CAknInformationNote( ETrue );
-                note->ExecuteLD( *label );
-                CleanupStack::PopAndDestroy(label);
-                continue;
-                }
-            // New name entered
-            ret = ETrue;
-            }
-        // Break, in case user Cancels the data query or 
-        // enters a valid name 
-        break;
-        }    
-    return ret;
-    }
- 
-// ---------------------------------------------------------------------------
-// TPresetName CEqualizerPresetsDialog::GetHighlightedPresetInListBox() const
-// This function returns the highlighted Preset in ListBox
-// ---------------------------------------------------------------------------
-//  
-TPresetName CEqualizerPresetsDialog::GetHighlightedPresetInListBox() const
-    {
-    TInt selectedIndex = iListBox->CurrentItemIndex();
-    CTextListBoxModel* model = iListBox->Model();
-    TPresetName selectedItem(model->ItemText(selectedIndex));
-    TPresetName highlightedPreset = 
-             selectedItem.Right(selectedItem.Length()- iItemArray->GetPrefixLength());
-    return highlightedPreset;  
-    }
-
-// ---------------------------------------------------------------------------
-//void CEqualizerPresetsDialog::ActivateEqrPresetL(const TInt  aIndex, 
-//const TDesC& aPreset)  const
-//
-//This function is used for the activation of a preset
-// ---------------------------------------------------------------------------
-//
-void CEqualizerPresetsDialog::ActivateEqrPresetL(const TInt aIndex, 
-const TDesC& aPreset) 
-    {
-    TInt err;
-    // Store activated preset in central repository    
-    SetCurrentPreset(aPreset);
-    
-    // Set the active preset in the equalizer item array
-    iItemArray->SetCurrentActivePreset(aPreset);
-    
-    // Display Confirmation note                   
-    HBufC* activateNoteText = StringLoader::LoadLC(
-    R_QTN_EQ_NOTE_INFO_PRESET_ACTIVATED, aPreset);
-    CAknConfirmationNote* dialog = new(ELeave)CAknConfirmationNote();
-    dialog->ExecuteLD(*activateNoteText);
-    CleanupStack::PopAndDestroy(activateNoteText); 
-    
-    // Inform the engine
-    if (aPreset.Compare(*iPresetNoneText) == 0)            
-        {
-        TRAP(err, iAudEqUtility->DisableEqualizerL());                
-        }
-    else
-        {
-        TRAP(err, iAudEqUtility->ApplyPresetL(GetEngineIndexL(aPreset)));
-        }  
-   
-   if(!err)
-	   {
-	   iListBox->HandleItemAdditionL();
-	   iListBox->SetCurrentItemIndexAndDraw(aIndex);
-	   // To prevent two tickmarks from appearing sometimes
-	   iListBox->DrawNow(); 
-	   }
-   }
-
-// ---------------------------------------------------------------------------
-//void CEqualizerPresetsDialog::RenameEqrPresetL(const TInt  aIndex, 
-//const TDesC& aPreset)  const
-//
-//This function is used for the renaming of a preset
-// ---------------------------------------------------------------------------
-//
-void CEqualizerPresetsDialog::RenameEqrPresetL(const TInt /*aIndex*/, 
-const TDesC& aPreset) 
-    {
-    //Check if this is an active preset
-    TPresetName activePresetName = CurrentPreset();
-    if (aPreset.Compare(activePresetName) == 0)            
-       {
-        //Display Confirmation note                 
-        HBufC* renameText = StringLoader::LoadLC(
-        R_QTN_EQ_NOTE_ERR_PRESET_IN_USE_NO_RENAME);               
-        CAknErrorNote* dialog = new(ELeave)CAknErrorNote();         
-        dialog->ExecuteLD(*renameText);
-        CleanupStack::PopAndDestroy(renameText);
-        } 
-    else
-        {
-        TPresetName presetName;
-        presetName =  aPreset;
-        TBool nameEnteredIsFine = 
-        GetNewNameL(R_DIALOG_TEXT_RENAME_ITEM_NAME, presetName); 
-          
-        if (nameEnteredIsFine)
-            {
-            TInt engineIndex = GetEngineIndexL(aPreset);
-            //Update Engine
-            iAudEqUtility->GetPresetL(engineIndex);
-            CAudioEqualizer& audioEqualizer = iAudEqUtility->Equalizer();
-                                           
-            iAudEqUtility->ModifyPresetL(engineIndex,presetName,
-             audioEqualizer);
-              
-            //Update listbox
-            // Sort the array of user-defined presets
-            iItemArray->UpdateSortedArrayL(); 
-            iListBox->SetCurrentItemIndex(SearchPresetL(presetName));
-            iListBox->DrawNow();
-            }
-        }
-   }
-
-// ---------------------------------------------------------------------------
-// void CEqualizerPresetsDialog::EditEqrPresetL(const TInt  aIndex, 
-// const TDesC& aPreset)  const
-//
-// This function is used for the editing of a preset
-// ---------------------------------------------------------------------------
-//
-void CEqualizerPresetsDialog::EditEqrPresetL(const TInt  /*aIndex*/, 
-const TDesC& aPreset) 
-    {
-    //Set application name in the title pane to preset name.
-    CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane();
-    CAknTitlePane* tp=(CAknTitlePane*)sp->ControlL(TUid::Uid(
-    EEikStatusPaneUidTitle));
-    tp->SetTextL(aPreset);
-    TInt engineIndex = GetEngineIndexL(aPreset);
-    //Update Engine
-    TBool isActivePreset = (aPreset==CurrentPreset());
-    
-    DisplaySettingsL(iAudEqUtility, engineIndex, isActivePreset);
-    }
-
-// ---------------------------------------------------------------------------
-// void CEqualizerPresetsDialog::CreateNewEqrPresetL(TInt&  aIndex, 
-// TPresetName& aPreset) const
-//
-// This function is used for the creation of a new preset.
-// @param aIndex The index of the preset in the ListBox. This is set
-// to a the index in the ListBox if preset creation is successful. 
-// If the creation is unscuccessful, then the parameter is not changed.
-// @param aPreset The name of the preset created
-// ---------------------------------------------------------------------------
-//
-void CEqualizerPresetsDialog::CreateNewEqrPresetL(TInt&  aIndex, 
-TPresetName& aPreset) const
-    {
-    RFs fs; 
-    User::LeaveIfError( fs.Connect() );
-    CleanupClosePushL<RFs>( fs );
-       
-    if (SysUtil::FFSSpaceBelowCriticalLevelL(&fs,0))
-        {
-        ShowDiskFullNoteL(); // Phone memory full, show note
-        }
-    else
-        {
-        TPresetName presetName;
-        BuildPresetNameL(presetName);
- 
-        TBool nameEnteredIsFine = GetNewNameL(R_DIALOG_TEXT_NEW_ITEM_NAME,
-         presetName);
-
-        if (nameEnteredIsFine)
-            {
-            //Update Engine
-            CAudioEqualizer& audioEqualizer = iAudEqUtility->Equalizer();
-            iAudEqUtility->CreatePresetL(presetName, audioEqualizer);
-        
-            //Set the level of all bands to 0.
-            TInt numFreqBand = audioEqualizer.NumberOfBands();
-            for (TInt i = 0; i < numFreqBand; i++)
-                {
-                audioEqualizer.SetBandLevelL(i+1, 0);
-                }
-
-            iItemArray->UpdateSortedArrayL();            
-            //Update AudioEqualizerUtility object, setting the level of all
-            // bands to 0 
-            iAudEqUtility->ModifyPresetL(GetEngineIndexL(presetName),
-                                 presetName, audioEqualizer);
-        
-            //Set the focus to the new preset 
-            iListBox->HandleItemAdditionL();
-            iListBox->SetCurrentItemIndex(SearchPresetL(presetName));                 
-            iListBox->DrawNow();
-    
-            aPreset = presetName;
-            aIndex = iItemArray->MdcaCount()-1;  
-	          }
-        }
-        CleanupStack::PopAndDestroy();
-    }
-    
-// ---------------------------------------------------------------------------
-//void CEqualizerPresetsDialog::DeleteEqrPresetL(const TInt  aIndex, 
-//const TDesC& aPreset)  const
-//
-//This function is used for the deletion of a preset
-// ---------------------------------------------------------------------------
-//
-void CEqualizerPresetsDialog::DeleteEqrPresetL(const TInt aIndex,
-const TDesC& aPreset)
-    {
-    //Check if this is an active preset
-    TPresetName activePresetName = CurrentPreset();
-    if (aPreset.Compare(activePresetName) == 0)     
-        {
-        //Display error note                   
-        HBufC* renameText =
-         StringLoader::LoadLC(R_QTN_EQ_NOTE_ERR_PRESET_IN_USE);
-        CAknErrorNote* dialog = new(ELeave)CAknErrorNote();
-        dialog->ExecuteLD(*renameText);
-        CleanupStack::PopAndDestroy(renameText);
-        } 
-    else
-        {
-        //Delete?\n%U" §qtn.query.common.conf.delete?
-        HBufC* text = 
-        StringLoader::LoadLC( R_QTN_QUERY_COMMON_CONF_DELETE, 
-        aPreset);
-
-        // Show confirmation note
-        CAknQueryDialog* dlg = CAknQueryDialog::NewL();
-        TInt result( 
-        dlg->ExecuteLD( R_EQUALIZER_CONFIRMATION_QUERY, *text ) );
-        CleanupStack::PopAndDestroy(text); // text
-
-        if ( result )
-            {
-            //Update Engine
-            iAudEqUtility->DeletePresetL(GetEngineIndexL(aPreset));
-            //Remove from listbox
-            iItemArray->UpdateSortedArrayL();
-            iListBox->HandleItemRemovalL();
-            // This is to avoid the gap observed when the last entry present
-            // in the Preset List is deleted
-            iListBox->SetCurrentItemIndexAndDraw(0);
-            //If we are at the last preset set focus to the next preset
-            // else the previous preset
-            if (aIndex == iItemArray->MdcaCount())
-                {
-                iListBox->SetCurrentItemIndexAndDraw(aIndex - 1);
-                }
-            else
-                {
-                iListBox->SetCurrentItemIndexAndDraw(aIndex);
-                }
-            iListBox->DrawNow();
-            }
-        }
-    }
-
-// -------------------------------------------------------------------
-// TInt CEqualizerPresetsDialog::GetEngineIndexL
-// (const TPresetName& aPresetName)
-//
-// This function is called to find the index of a preset in the list of
-// presets returned by CAudioEqualizerUtility::Presets()
-// --------------------------------------------------------------------
-// 
-TInt CEqualizerPresetsDialog::GetEngineIndexL(const TPresetName& aPresetName) const  
-    {
-    TInt engineIndex = KErrNotFound;
-    TInt count;
-        
-    TArray<TEfAudioEqualizerUtilityPreset> presets = iAudEqUtility->Presets();
-    TInt numPredefinedPresets = iAudEqUtility->NumberOfPreDefinedPresets();
-    TInt numPresets = presets.Count();
-    for (count = 0; count < numPresets; count++)
-        {
-        TPresetName selectedItem = iItemArray->MdcaPoint(count+1);
-        TPresetName presetName = selectedItem.Right(
-                            selectedItem.Length() - iItemArray->GetPrefixLength());
-
-        
-        if (((count < numPredefinedPresets) && (presetName == aPresetName))
-            || (presets[count].iPresetName == aPresetName))
-            {
-            engineIndex = count;
-            }
-        }
-   if (engineIndex == KErrNotFound)
-        {
-        // Leave if this function is called for preset "None" or a preset
-        // which is there in the ListBox but not in the Engine.
-        User::Leave(KErrArgument);
-        }
-        
-    return engineIndex;
-    }
-    
-// -----------------------------------------------------------------------
-// CEqualizerPresetsDialog::DisplaySettingsL
-// (CAudioEqualizerUtility *aAudEqUtility, TInt aIndex,
-// const TBool aIsActivePreset)) const
-//
-// This function is used to display the current equalizer settings
-// by creating a new dialog. The dialog can also be used for editing, etc.
-// of the settings.
-// ------------------------------------------------------------------------
-//  
-void CEqualizerPresetsDialog::DisplaySettingsL(CAudioEqualizerUtility*
- aAudEqUtility, const TInt aIndex, const TBool aIsActivePreset)
-    {
-    TRect rect = Rect();
-    
-    TInt item;
-    TPresetName preset = GetHighlightedPresetInListBox(); 
-    iItemArray->GetPresetKeyFromLocalisedName(item, preset);
-    iEditingDialog = CEqualizerEditingDialog::NewL(aAudEqUtility, 
-      aIndex, rect, aIsActivePreset,iEqrPresetActObserver, item);
-    iEditingDialog->ExecuteLD(); 
-    iEditingDialog = NULL;    
-    }  
-
-// --------------------------------------------------------------
-// CEqualizerPresetsDialog::CurrentPreset()
-// This function is used to read the currently active preset from
-// the central repository
-// --------------------------------------------------------------
-//    
-TPresetName CEqualizerPresetsDialog::CurrentPreset() const
-    {
-    TInt res = 0;
-    TPresetName preset;
-    User::LeaveIfError(iRepository->Get(KMPlayerEqPresetId, res));
-    iItemArray->GetLocalisedPresetNameFromKey(res,preset );
-    return preset;   
-    }
-
-// ----------------------------------------------------------------
-// CEqualizerPresetsDialog::SetCurrentPreset(const TPtrC& aPreset)
-// This function is used to store the currently active preset into
-// the central repository
-// ----------------------------------------------------------------
-//     
-void CEqualizerPresetsDialog::SetCurrentPreset(const TPresetName& aPreset)
-    {
-    TInt activePresetKey;
-    iActivePreset = aPreset;
-    iItemArray->GetPresetKeyFromLocalisedName(activePresetKey, aPreset);
-    iEqrPresetActObserver.HandlePresetActivation(activePresetKey);
-    }
-
-// ----------------------------------------------------------------------------
-// CEqualizerPresetsDialog::SearchPresetL(const TPresetName& aPreset) const
-// This function is used to search for a preset name in the ListBox.
-// It return the index of the preset, if found and KErrNotFound if not found.
-// ----------------------------------------------------------------------------
-//       
-TInt CEqualizerPresetsDialog::SearchPresetL(const TPresetName& aPreset) const
-    {
-    TInt ret = KErrNotFound;
-    iItemArray->UpdateSortedArrayL();
-
-    for (TInt i=0; i<iItemArray->MdcaCount(); i++)
-        {
-        TPresetName selectedItem = iItemArray->MdcaPoint(i);
-        TPresetName presetName = selectedItem.Right(selectedItem.Length() - iItemArray->GetPrefixLength());
-
-        if (aPreset == presetName)      
-            {
-            ret = i;
-            break;
-            }
-        }
-    return ret;
-    }
-
-// ----------------------------------------------------------------------------
-// CEqualizerPresetsDialog::SetAudioEqualizerL(CAudioEqualizerUtility* 
-// aAudEqUtility)
-// This function is used to set a new CAudioEqualizerUtility* 
-// ----------------------------------------------------------------------------
-//    
-EXPORT_C void CEqualizerPresetsDialog::SetAudioEqualizerL(
-CAudioEqualizerUtility* aAudEqUtility)
-    {
-    iAudEqUtility=aAudEqUtility;
-    if (iItemArray)
-        {
-        iItemArray->SetAudioEqualizer(iAudEqUtility);
-        }	
-
-    if (iEditingDialog)
-        {
-        iEditingDialog->SetAudioEqualizerL(iAudEqUtility);
-        }
-
-        
-    if (iAudEqUtility)
-        {
-        iIgnoreKeyEvents = EFalse;
-        }
-    else
-        {
-        iIgnoreKeyEvents = ETrue; 
-        }
-    }
-    
-// ----------------------------------------------------------------------
-// CEqualizerPresets::GetListBoxIconsL()
-// This function is used to load the lisitbox icons into an array
-// ----------------------------------------------------------------------
-//
-CArrayPtr<CGulIcon>* CEqualizerPresetsDialog::GetListBoxIconsL() const
-    {
-    // Get the icon array and deleted if already exists. Memory leak error.
-    CArrayPtr<CGulIcon>* previcons = iListBox->ItemDrawer()->ColumnData()->IconArray();
-    if( previcons )
-    	{
-    	previcons->ResetAndDestroy();
-    	delete previcons;
-    	previcons = NULL;
-    	}
-    
-    // CGulIcon class packages two bitmaps: icon image and its mask
-    // CAknIconArray inherits from CArrayPtrFlat
-    CArrayPtr<CGulIcon>* iconList = new (ELeave) 
-                                 CAknIconArray(KEqualizerArrayGranularity);
-    CleanupStack::PushL(iconList);
-    
-    // Find which drive this DLL is installed.
-    TFileName fileName;
-    // Get the full resource file
-    TParse fp;
-    // Add the resource dir
-    fp.Set( KIconsFilename, &KDC_APP_BITMAP_DIR, NULL);
-
-    // Get the filename with full path
-    fileName = fp.FullName(); 
-     
-    MAknsSkinInstance* skinInstance;
-    CFbsBitmap* newIconBmp = NULL;
-    CFbsBitmap* newIconBmpMask = NULL;
-    CGulIcon* newIcon = NULL;
-    
-    skinInstance = AknsUtils::SkinInstance();
-    
-    //creating blank icon
-    AknsUtils::CreateIconLC(skinInstance,KAknsIIDQgnPropEmpty,
-                           newIconBmp,newIconBmpMask,fileName,
-                           EMbmEqualizerEmpty13x13,
-                           EMbmEqualizerEmpty13x13_mask);
-    
-    newIcon = CGulIcon::NewL(newIconBmp,newIconBmpMask);
-    
-    CleanupStack::Pop(2);
-    CleanupStack::PushL(newIcon);
-    iconList->AppendL(newIcon);
-    
-    CleanupStack::Pop();
-    
-    //creating TICK mark icon
-    AknsUtils::CreateIconLC(skinInstance,KAknsIIDQgnPropPslnActive,
-                           newIconBmp,newIconBmpMask,fileName,
-                           EMbmEqualizerQgn_prop_psln_active,
-                           EMbmEqualizerQgn_prop_psln_active_mask);
-
-
-    newIcon = CGulIcon::NewL(newIconBmp,newIconBmpMask);
-    
-    CleanupStack::Pop(2);
-    CleanupStack::PushL(newIcon);
-    iconList->AppendL(newIcon);
-
-    CleanupStack::Pop();
-    
-    CleanupStack::Pop(iconList);
-
-    newIconBmp = NULL;
-    newIconBmpMask = NULL;
-    newIcon = NULL;
-
-    return iconList;
-    }    
-    
-// -------------------------------------------------------------------
-// CEqualizerPresetsDialog::ExecuteLD() 
-//
-// This function is called to create a dialog
-// to display the preset list view of the equalizer
-// --------------------------------------------------------------------
-//  
-EXPORT_C TInt CEqualizerPresetsDialog::ExecuteLD()
-    {
-    TInt ret = CAknDialog::ExecuteLD(R_EQUALIZER_DIALOG);
-    return ret;
-    }
-
-// ---------------------------------------------------------------------------
-// void CEqualizerPresetsDialog::PreLayoutDynInitL(void)
-// This function is called just before the dialog is displayed
-// ---------------------------------------------------------------------------
-// 
-void CEqualizerPresetsDialog::PreLayoutDynInitL(void)
-    {
-     
-    CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane();
-    CAknTitlePane* tp=(CAknTitlePane*)sp->ControlL(TUid::Uid(
-    EEikStatusPaneUidTitle));
-    // Store the Application's title text
-    iAppTitleText =  tp->Text()->AllocL(); 
-       
-    // Set preset name in the title pane
-    tp->SetTextL(*iTitleText);
-
-    iPreviousStatusPaneLayout = sp->CurrentLayoutResId();
-    
-    if ( sp )
-        {
-        if ( R_AVKON_STATUS_PANE_LAYOUT_USUAL != iPreviousStatusPaneLayout )
-            {
-            sp->SwitchLayoutL( R_AVKON_STATUS_PANE_LAYOUT_USUAL );
-            }
-        }
-    iListBox= (CAknSingleGraphicStyleListBox*)Control(ESelectionListControl);
-    iListBox->ItemDrawer()->ColumnData()->SetIconArray(GetListBoxIconsL());
-    
-    // Set item array to listbox model
-    iListBox->Model()->SetItemTextArray(iItemArray);
-    // Item array is not owned by ListBox so it has to be freed. 
-    iListBox->Model()->SetOwnershipType(ELbmDoesNotOwnItemArray);        
-    
-    //
-    // Create a scrollbar that will be displayed automatically
-    // if all the items cannot be displayed on screen
-    //
-    iListBox->CreateScrollBarFrameL(ETrue);
-    iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(
-    CEikScrollBarFrame::EOff,CEikScrollBarFrame::EAuto);
-    // Set focus to the currently active preset
-    
-#ifdef RD_SCALABLE_UI_V2
-    iListBox->SetListBoxObserver(this);
-#endif //RD_SCALABLE_UI_V2
-    TPresetName currentPreset = CurrentPreset();
-    
-    TInt cur = SearchPresetL(currentPreset);
-    if (cur == KErrNotFound) //Some preset should always be active
-        {
-        User::Leave(KErrNotSupported);
-        }  
-    iListBox->SetCurrentItemIndexAndDraw(cur);     
-    
-    }
-
-// -------------------------------------------------------------------
-// CEqualizerPresetsDialog::OkToExitL(TInt aButtonId)
-//
-// This function is called when the user presses the selection key
-// for displaying context sesitive menu
-// --------------------------------------------------------------------
-// 
-TBool CEqualizerPresetsDialog::OkToExitL(TInt aButtonId)
-    {
-    TBool ret = EFalse;
-    if (aButtonId == EEikBidOk)
-        {
-        iContextSensitiveMenu = ETrue;
-        DisplayMenuL();
-        }
-    else if (aButtonId == EAknSoftkeyBack) 
-        {
-        CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane();
-        CAknTitlePane* tp=(CAknTitlePane*)sp->ControlL(TUid::Uid(
-          EEikStatusPaneUidTitle));
-    
-        if (iAppTitleText)
-            {
-             //set application name in the title pane
-            tp->SetTextL(*iAppTitleText);        
-            }
-        ret = CAknDialog::OkToExitL( aButtonId ); 
-        }
-     else if (aButtonId == EAknSoftkeySelect) 
-        {
-        const TInt index = iListBox->CurrentItemIndex();
-        TPresetName preset = GetHighlightedPresetInListBox();
-        ActivateEqrPresetL(index, preset);
-        }
-    else  
-        {
-        ret = CAknDialog::OkToExitL( aButtonId );        
-        } 
-
-    if ( ret )
-        {
-        // Restore landscape layout
-        CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane();
-        if( Layout_Meta_Data::IsLandscapeOrientation() )
-            {
-            if ( sp && KErrNone != iPreviousStatusPaneLayout )
-                {
-                if ( sp->CurrentLayoutResId() != R_AVKON_STATUS_PANE_LAYOUT_USUAL )
-                    {
-                    sp->SwitchLayoutL( R_AVKON_STATUS_PANE_LAYOUT_USUAL );
-                    }
-                }
-            }
-        else
-            {
-            CAknLocalScreenClearer* clearer = CAknLocalScreenClearer::NewLC( ETrue );
-            sp->SwitchLayoutL( R_AVKON_STATUS_PANE_LAYOUT_USUAL_FLAT );
-            CleanupStack::PopAndDestroy( clearer );
-            }
-        }
-    return ret;
-    } 
-
-// -------------------------------------------------------------------
-// void CEqualizerPresetsDialog::SizeChanged()
-//
-// This function is called by the framework whenever there is a change
-// in the size of the control
-// -------------------------------------------------------------------
-//
-void CEqualizerPresetsDialog::SizeChanged()
-    {
-    TRect rect = Rect();
-    //Getting the layout for the list box
-    AknLayoutUtils::LayoutControl(iListBox, rect, AknLayout::list_gen_pane(1));
-    CAknDialog::SizeChanged();
-    }
-
-// -------------------------------------------------------------------
-// void CEqualizerPresetsDialog::HandleForegroundEventL( TBool aForeground)
-//
-// Handles changes to the application 
-// when it switches to or from the foreground.
-// -------------------------------------------------------------------
-//     
-void CEqualizerPresetsDialog::HandleForegroundEventL( TBool aForeground)
-    {
-    if (aForeground)
-        {
-        CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane();
-        CAknTitlePane* tp=(CAknTitlePane*)sp->ControlL(TUid::Uid(
-        EEikStatusPaneUidTitle));
-        tp->SetTextL(*iTitleText);
-        } 
-    }
-    
-// -------------------------------------------------------------------
-// void CEqualizerPresetsDialog::FocusChanged(TDrawNow aDrawNow)
-//
-// Responds to a change in focus.
-// This is called whenever the control gains or loses focus
-// -------------------------------------------------------------------
-//   
-void CEqualizerPresetsDialog::FocusChanged(TDrawNow /*aDrawNow*/)
-	{
-	iItemArray->UpdateSortedArrayL(); 
-	TPresetName currentPreset = CurrentPreset();
-    iItemArray->SetCurrentActivePreset(currentPreset);
-
-    if(iListBox)
-    {
-        iListBox->HandleItemAdditionL();
-	}
-	}
-	
-// -------------------------------------------------------------------
-// void CEqualizerFreqBand::HandleResourceChangeL(TInt aType)
-//
-// This function is called by the framework whenever there is a 
-// change in skin or layout
-// -------------------------------------------------------------------
-//
-void CEqualizerPresetsDialog::HandleResourceChangeL(TInt aType)
-    {
-    if (aType == KAknsMessageSkinChange)
-        {
-        //Creating the icons for the new Skin
-        iListBox->ItemDrawer()->ColumnData()->SetIconArray(GetListBoxIconsL());
-        iListBox->HandleResourceChange(aType);    
-        }
-
-     else if (aType == KEikDynamicLayoutVariantSwitch)
-        {                
-	    TRect rect;
-	    AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, rect);  	    
-	    SetRect(rect);
-        }            
-       
-    }
-
-void CEqualizerPresetsDialog::HandleResourceChange(TInt aType)
-	{
-	CAknDialog::HandleResourceChange( aType );
-	HandleResourceChangeL(aType);
-	}
-
-// ---------------------------------------------------------
-// CEqualizerPresetsDialog::OfferKeyEventL(
-//     const TKeyEvent& aKeyEvent,TEventCode aType)
-// This function is used to handle key events
-// ---------------------------------------------------------
-//
-TKeyResponse CEqualizerPresetsDialog::OfferKeyEventL(
-    const TKeyEvent& aKeyEvent,
-    TEventCode aType )
-    { 
-    if (iIgnoreKeyEvents)
-        {
-        return EKeyWasNotConsumed;
-        }
-    if (aType == EEventKey)
-        {
-        if (aKeyEvent.iCode == EKeyBackspace)
-            {
-            // Find the preset highlighted
-            const TInt listBoxIndex = iListBox->CurrentItemIndex();
-              
-            // pre-defined presets cannot be deleted.
-            // preset "None" is not stored in engine.
-            if (listBoxIndex > (TInt) 
-               (iAudEqUtility->NumberOfPreDefinedPresets()))
-                {
-                TPresetName preset = GetHighlightedPresetInListBox(); 
-                DeleteEqrPresetL(listBoxIndex, preset);
-                }
-            return EKeyWasConsumed;
-            }
-        }
-    return CAknDialog::OfferKeyEventL( aKeyEvent, aType ); 
-    }
-    
-// ---------------------------------------------------------------------------
-// CEqualizerPresetsDialog::DynInitMenuPaneL(
-//                              TInt aResourceId,CEikMenuPane* aMenuPane)
-//  This function is called by the EIKON framework just before it displays
-//  a menu pane. Its default implementation is empty, and by overriding it,
-//  the application can set the state of menu items dynamically according
-//  to the state of application data.
-// ---------------------------------------------------------------------------
-//
-void CEqualizerPresetsDialog::DynInitMenuPaneL(
-                        TInt aResourceId, CEikMenuPane* aMenuPane)
-    {
-    TPresetName selectedItem = GetHighlightedPresetInListBox(); 
-     
-    TInt selectedIndex = iListBox->CurrentItemIndex();     
-    TInt numberOfPreDefinedPresets = 
-    iAudEqUtility->NumberOfPreDefinedPresets();      
-    
-    if ( aResourceId == R_EQUALIZER_CONTAINER_MENU)
-        {
-        //Is the menubar invoked from Options menu or selection key?
-        if (iContextSensitiveMenu == EFalse)
-            {
-            // The menubar is invoked from Options menu
-	        iMenuBar->SetMenuType(CEikMenuBar::EMenuOptions);
-            // The selected preset is "None"
-            if (selectedItem.Compare(*iPresetNoneText) == 0)
-                {
-                aMenuPane->SetItemDimmed(EEqualizerCmdRename, ETrue);
-                aMenuPane->SetItemDimmed(EEqualizerCmdDelete, ETrue);
-                aMenuPane->SetItemDimmed(EEqualizerCmdEdit, ETrue);
-                }
-            // The selected preset is a pre defined preset other than "None"
-            if (selectedIndex <= numberOfPreDefinedPresets)
-                {
-                aMenuPane->SetItemDimmed(EEqualizerCmdRename, ETrue);
-                aMenuPane->SetItemDimmed(EEqualizerCmdDelete, ETrue);
-                }
-            // Help should be displayed only if the feature is supported
-            // according to Feature Manager
-            if (!FeatureManager::FeatureSupported(KFeatureIdHelp))
-                {
-                aMenuPane->SetItemDimmed(EEqualizerCmdHelp, ETrue);
-                }
-            }
-        else
-            {
-            // The menubar is invoked from selection key
-	        iMenuBar->SetMenuType(CEikMenuBar::EMenuContext);
-            // These Options are always hidden
-            aMenuPane->SetItemDimmed(EEqualizerCmdDelete, ETrue);
-            aMenuPane->SetItemDimmed(EEqualizerCmdRename, ETrue);
-            aMenuPane->SetItemDimmed(EEqualizerCmdCreateNew, ETrue);
-            aMenuPane->SetItemDimmed(EEqualizerCmdHelp, ETrue);
-            aMenuPane->SetItemDimmed(EAknCmdExit, ETrue);
-            
-            // The selected preset is "None"
-            if (selectedItem.Compare(*iPresetNoneText) == 0)            
-                {
-                aMenuPane->SetItemDimmed(EEqualizerCmdEdit, ETrue);
-                }
-            iContextSensitiveMenu = EFalse; 
-            }
-        }
-   }
-
-// -------------------------------------------------------------------
-// CEqualizerPresetsDialog::ProcessCommandL(TInt  aCommandId ) 
-//
-// This function is called to process the menubar command in a dialog
-// --------------------------------------------------------------------
-// 
-void CEqualizerPresetsDialog::ProcessCommandL(TInt  aCommandId )
-    {
-    // Need to do this in all cases or menu does not disappear after
-    // a selection is made
-    CAknDialog::ProcessCommandL(aCommandId);
-    
-    // Find the preset highlighted
-    const TInt index = iListBox->CurrentItemIndex();
-    TPresetName preset = GetHighlightedPresetInListBox(); 
-       
-    switch(aCommandId)
-        {
-        case EAknCmdExit :
-        case EEikCmdExit :
-            {
-            iAvkonAppUi->HandleCommandL( aCommandId );
-            break;
-            }    
-        case EEqualizerCmdEdit:
-            {
-            EditEqrPresetL(index, preset);
-            break;
-            }
-        case EEqualizerCmdActivate:
-            {
-            ActivateEqrPresetL(index, preset);
-            break;
-            }
-        case EEqualizerCmdCreateNew:
-            {
-            TInt presetIndex = -1;
-            TPresetName presetName; 
-
-            CreateNewEqrPresetL(presetIndex, presetName);
-         
-            if (presetIndex != -1)
-                {
-                // A valid preset name has been entered
-                EditEqrPresetL(presetIndex, presetName);
-                }   
-            break;   
-            }
- 
-        case EEqualizerCmdDelete:
-            { 
-            DeleteEqrPresetL(index, preset); 
-            break;
-            }
-
-        case EEqualizerCmdRename:
-            { 
-            RenameEqrPresetL(index, preset);
-            break;
-            }
-
-        case EEqualizerCmdHelp:
-            {
-            HlpLauncher::LaunchHelpApplicationL
-                ( iEikonEnv->WsSession(),
-                 CEikonEnv::Static()->AppUi()->AppHelpContextL() );
-            break;
-            }
-
-        default:
-            {
-            break;
-            }
-        }
-    }
-     
-// -------------------------------------------------------------------
-// void CEqualizerPresetsDialog::GetHelpContext( 
-//            TCoeHelpContext& aContext ) const
-// Get help context for the control
-// --------------------------------------------------------------------
-//         
-void CEqualizerPresetsDialog::GetHelpContext( 
-            TCoeHelpContext& aContext ) const
-    {
-    aContext.iMajor = KUidEqualizer;
-    aContext.iContext = KEQ_HLP_LIST_VIEW;
-    }
-
-// -------------------------------------------------------------------
-// void CEqualizerPresetsDialog::ShowDiskFullNoteL() 
-// This function is used to display a note to the user if           
-// memory is below critical level when creating a new preset.
-// --------------------------------------------------------------------
-//  
-void CEqualizerPresetsDialog::ShowDiskFullNoteL() const
-    {
-    HBufC* message = NULL;
-    message = StringLoader::LoadLC(R_QTN_MEMLO_NOT_ENOUGH_MEMORY);
-       
-    CAknGlobalNote* note = CAknGlobalNote::NewLC();
-    note->SetSoftkeys(R_AVKON_SOFTKEYS_OK_EMPTY);
-    note->ShowNoteL(/*status,*/ EAknGlobalErrorNote, *message);
-    
-    CleanupStack::PopAndDestroy(note); // note, message
-    CleanupStack::PopAndDestroy(message); // note, message
-    }
-
-#ifdef RD_SCALABLE_UI_V2
-// -------------------------------------------------------------------
-// void CEqualizerPresetsDialog::HandleListBoxEventL 
-// This function callback from MEikListBoxObserver when a listbox item           
-// is double clicked using a pen input .
-// --------------------------------------------------------------------
-//  
-void CEqualizerPresetsDialog::HandleListBoxEventL(
-    CEikListBox* /*aListBox*/,
-    TListBoxEvent aEventType )
-    {
-    switch ( aEventType )
-        {
-#ifdef SINGLE_CLICK_INCLUDED
-        case EEventItemSingleClicked:
-#endif
-        case EEventItemDoubleClicked:
-            {
-            const TInt index = iListBox->CurrentItemIndex();
-            TPresetName preset = GetHighlightedPresetInListBox();
-            ActivateEqrPresetL(index, preset);
-            break;
-            }
-        default:
-            break;
-        }
-    }
-#endif //RD_SCALABLE_UI_V2
-// End of File 
-
--- a/mmserv/audioeffectsui/group/bld.inf	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +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:  Build information file for equalizer  
-*
-*/
-
-
-
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_EXPORTS
-
-PRJ_MMPFILES
-#include "../equalizer/group/bld.inf"
-
-
-//  End of File  
-
--- a/mmserv/audioeffectsui/inc/audioeffectsuibldvariant.hrh	Mon May 03 12:59:52 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +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:  bldvariant headers for project audioeffectsui
-*
-*/
-
-
-
-#ifndef AUDIOEFFECTSUIBLDVARIANT_HRH
-#define AUDIOEFFECTSUIBLDVARIANT_HRH
-
-
-#define IAD_INCLUDE_SINGLE_CLICK
-
-
-#endif  // AUDIOEFFECTSUIBLDVARIANT_HRH
-
-// End of File
\ No newline at end of file
--- a/mmserv/group/bld.inf	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/group/bld.inf	Fri May 14 16:22:35 2010 +0300
@@ -23,7 +23,6 @@
 
 PRJ_MMPFILES
 
-#include "../audioeffectsui/group/bld.inf"
 #include "../callaudiocontrol/group/bld.inf"
 #include "../metadatautility/Group/bld.inf"
 #include "../radioutility/group/bld.inf"
--- a/mmserv/metadatautility/Src/MetaDataParser.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/metadatautility/Src/MetaDataParser.cpp	Fri May 14 16:22:35 2010 +0300
@@ -19,13 +19,16 @@
 
 
 // INCLUDE FILES
-#include "MetaDataParser.h"
 #include <syslangutil.h>
 #include <languages.hrh>
 #include <TopCharacterSet.rsg>
 #include <data_caging_path_literals.hrh>
 #include <bautils.h>
 
+#include "MetaDataParser.h"
+#include "MetaDataSourceFile.h"
+#include "MetaDataFieldContainer.h"
+
 _LIT(KCharacterSetRscFile, "TopCharacterSet.rsc");
 
 // ============================ MEMBER FUNCTIONS ===============================
@@ -121,6 +124,10 @@
 TInt CMetaDataParser::UnicodeBOM(
 	const TDesC8& aUnicode )
 	{
+#ifdef _DEBUG
+     RDebug::Print(_L("CMetaDataParser::UnicodeBOM"));
+#endif
+    
 	TPtrC8 bomData( aUnicode.Left( 2 ) );
 
 	TBuf8<2> BEbom; // Big endian BOM
@@ -162,6 +169,10 @@
 //
 void CMetaDataParser::MapID3GenreToStringL(TInt aNum, TDes& aGenrePtr)
 {
+#ifdef _DEBUG
+     RDebug::Print(_L("CMetaDataParser::MapID3GenreToStringL"));
+#endif
+    
 	if(aNum < 0 || aNum > 125 && aNum != 199)
 		{
 		return;
@@ -560,6 +571,10 @@
 //
 void CMetaDataParser::MapID3GenreToStringL(TInt aNum, TDes8& aGenrePtr)
 {
+#ifdef _DEBUG
+     RDebug::Print(_L("CMetaDataParser::MapID3GenreToStringL"));
+#endif
+
 	if(aNum < 0 || aNum > 125 && aNum != 199)
 		{
 		return;
@@ -1242,4 +1257,46 @@
 		}
 	return EFalse;
 	}
+
+
+// -----------------------------------------------------------------------------
+// CMetaDataParser::CommonParseL
+// -----------------------------------------------------------------------------
+//
+void CMetaDataParser::CommonParseL(
+    CMetaDataSourceFile* aSource,
+    const RArray<TMetaDataFieldId>& aWantedFields,
+    CMetaDataFieldContainer& aContainer )
+    {
+#ifdef _DEBUG
+     RDebug::Print(_L("CMetaDataParser::CommonParseL"));
+#endif
+
+    GetProtectedL(aSource, aContainer);
+    ParseL(aWantedFields, aContainer);
+    }
+
+// -----------------------------------------------------------------------------
+// CMetaDataParser::GetProtectedL
+// -----------------------------------------------------------------------------
+//
+void CMetaDataParser::GetProtectedL( CMetaDataSourceFile* aSource,
+        CMetaDataFieldContainer& aContainer )
+    {
+#ifdef _DEBUG
+     RDebug::Print(_L("CMetaDataParser::GetProtectedL"));
+#endif
+
+    TBool fileProtected = aSource->FileProtected();
+    TBuf16<5> desc16;
+    desc16.AppendNum(fileProtected);
+
+    aContainer.AppendL( EMetaDataProtected, desc16 );
+    
+#ifdef _DEBUG
+     RDebug::Print(_L("CMetaDataParser::GetProtectedL, Protected=%S "), &desc16);
+#endif
+    
+    }
+
 //  End of File
--- a/mmserv/metadatautility/Src/MetaDataParser.h	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/metadatautility/Src/MetaDataParser.h	Fri May 14 16:22:35 2010 +0300
@@ -26,13 +26,14 @@
 #include <MetaDataField.hrh>
 #include <f32file.h>
 #include <charconv.h>
-#include "MetaDataID3v1Genre.h"
 #include <barsc.h>
 #include <barsread.h>
 
+#include "MetaDataID3v1Genre.h"
 
 // FORWARD DECLARATION
 class CMetaDataFieldContainer;
+class CMetaDataSourceFile;
 
 // CONSTANTS
 const TInt KUnicodeBOMNotFound		= 0;
@@ -97,7 +98,7 @@
         * @since 3.0
         * @return void
         */
-		void MapID3GenreToStringL(TInt aNum, TDes& aGenrePtr);
+		void MapID3GenreToStringL( TInt aNum, TDes& aGenrePtr );
 
 		/**
         * Maps ID3v2 genre integer to string
@@ -107,11 +108,33 @@
         * @return void
         */
 
-		void MapID3GenreToStringL(TInt aNum, TDes8& aGenrePtr);
+		void MapID3GenreToStringL( TInt aNum, TDes8& aGenrePtr );
 		void GenerateTopCharacterSetsL();
-		void SelectCharacterSetsForLanguageL(TInt aLanguage);
-		void ReadCharacterSetResourceL(TInt aResourceId);
-		TBool IsInTopCharacterSet(TUint aCharacterSetId);
+		void SelectCharacterSetsForLanguageL( TInt aLanguage );
+		void ReadCharacterSetResourceL( TInt aResourceId );
+		TBool IsInTopCharacterSet( TUint aCharacterSetId );
+
+		/**
+        * Parses the common metadata, the metadata fields are
+        * inserted into the container.
+        * @since 9.2
+        * @param aSource a Metadata source file.
+        * @param aWantedFields An array of TMetaDataFieldId's. Empty array is interpreted as all fields.
+        * @param aContainer On return, metadata found in aSource is stored here
+        * @return void
+        */
+        void CommonParseL( CMetaDataSourceFile* aSource,
+                const RArray<TMetaDataFieldId>& aWantedFields, 
+                CMetaDataFieldContainer& aContainer );
+
+        /**
+        * Append DRM Protected data to the container.
+        * @param aSource a Metadata source file.
+        * @param aContainer On return, metadata ptotected data is stored here
+        * @return void
+        */
+		void GetProtectedL( CMetaDataSourceFile* aSource,
+		        CMetaDataFieldContainer& aContainer );
 
     protected:
 
@@ -121,8 +144,8 @@
         * @param aDesc The original descriptor
         * @return Pointer to descriptor without whitespace
         */
-        TPtrC8 StripTrailingZeroes( const TDesC8& aDesc, TInt encoding = 0);
-        TPtrC StripTrailingZeroes( const TDesC& aDesc);
+        TPtrC8 StripTrailingZeroes( const TDesC8& aDesc, TInt encoding = 0 );
+        TPtrC StripTrailingZeroes( const TDesC& aDesc );
 
         /**
         * Returns BOM indication in the provided unicode.
--- a/mmserv/metadatautility/Src/MetaDataUtilityBody.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/metadatautility/Src/MetaDataUtilityBody.cpp	Fri May 14 16:22:35 2010 +0300
@@ -108,7 +108,7 @@
 	iParser = FindParserFileL(aFileName);
 	if ( iParser )
 		{
-		iParser->ParseL(aWantedFields, *iContainer);
+		iParser->CommonParseL((CMetaDataSourceFile*)iSource, aWantedFields, *iContainer);
 		}
 	}
 
@@ -130,7 +130,7 @@
 	iParser = FindParserFileL(aFile);
 	if ( iParser )
 		{
-		iParser->ParseL(aWantedFields, *iContainer);
+		iParser->CommonParseL((CMetaDataSourceFile*)iSource, aWantedFields, *iContainer);
 		}
 	}
 
@@ -152,7 +152,7 @@
 	iParser = FindParserDesL(aDes);
 	if ( iParser )
 		{
-		iParser->ParseL(aWantedFields, *iContainer);
+		iParser->CommonParseL((CMetaDataSourceFile*)iSource, aWantedFields, *iContainer);
 		}
 	}
 
@@ -467,10 +467,7 @@
 		{
 		User::Leave(KErrAlreadyExists);
 		}
-	
-	// iParser = FindParserFileL(aFileName);	
-		
-	if(KErrNone == IsSupportedMimeType(aMimeType))	
+		if(KErrNone == IsSupportedMimeType(aMimeType))	
 	{
 		iParser = FindParserFileL(aFileName, aMimeType);
 	}
@@ -481,7 +478,7 @@
 	
 	if ( iParser )
 	{
-		iParser->ParseL(aWantedFields, *iContainer);
+		iParser->CommonParseL((CMetaDataSourceFile*)iSource, aWantedFields, *iContainer);
 	}	
 	}
 // -----------------------------------------------------------------------------
@@ -501,8 +498,6 @@
 		User::Leave(KErrAlreadyExists);
 	}
 		
-	//iParser = FindParserFileL(aFile);	
-	
 	if(KErrNone == IsSupportedMimeType(aMimeType))	
 	{
 		iParser = FindParserFileL(aFile, aMimeType);
@@ -512,10 +507,9 @@
 		User::Leave(KErrNotSupported);		
 	}
 	
-	//iParser = FindParserFileL(aFile);
 	if ( iParser )
 	{
-		iParser->ParseL(aWantedFields, *iContainer);
+		iParser->CommonParseL((CMetaDataSourceFile*)iSource, aWantedFields, *iContainer);
 	}
 	}
 
@@ -703,7 +697,7 @@
 		}
 	if ( iParser )
 		{
-		iParser->ParseL(aWantedFields, *iContainer);
+		iParser->CommonParseL((CMetaDataSourceFile*)iSource, aWantedFields, *iContainer);
 		}
 	}	
 	
--- a/mmserv/radioutility/radio_utility/group/Radio_Utility.mmp	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/radioutility/radio_utility/group/Radio_Utility.mmp	Fri May 14 16:22:35 2010 +0300
@@ -46,3 +46,4 @@
 LIBRARY		euser.lib 
 LIBRARY		RadioSession.lib
 LIBRARY		CustomInterfaceUtility.lib 
+LIBRARY		flogger.lib 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/radioutility/radio_utility/inc/trace.h	Fri May 14 16:22:35 2010 +0300
@@ -0,0 +1,596 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+* Trace macro definitions.
+*
+*/
+
+#ifndef TRACE_H
+#define TRACE_H
+
+#include <e32base.h> // TCleanupItem
+#include "traceconfiguration.hrh"
+
+#ifdef TRACE_INTO_FILE
+#include <flogger.h> // RFileLogger
+#else
+#include <e32debug.h> // RDebug
+#endif
+
+//-----------------------------------------------------------------------------
+// Constants
+//-----------------------------------------------------------------------------
+//
+
+// NOTE!
+// Replace all COMPONENT_NAME occurnaces with your own component / module name.
+
+/**
+* Prefix trace macro to complete tracing with component name.
+* Returns TDesC which can be used directly with RDebug or RFileLogger.
+*/
+#define _PREFIX_TRACE( aMsg ) TPtrC( (const TText*)L"[Radio_Utility]: " L##aMsg )
+
+/**
+* Prefix error trace
+*/
+#define _PREFIX_ERROR( aMsg ) _PREFIX_TRACE( "[ERROR: %d]: " L##aMsg )
+
+/**
+* Prefix info trace.
+*/
+#define _PREFIX_INFO( aMsg ) _PREFIX_TRACE( "[INFO]: " L##aMsg )
+
+/**
+* Prefix macro for strings
+*/
+#define _PREFIX_CHAR( aMsg ) (const char*)"[Radio_Utility]: " ##aMsg
+
+/**
+* Define needed directories if TRACE_INTO_FILE macro in use
+*/
+#ifdef TRACE_INTO_FILE
+
+    _LIT( KDir, "radio" );
+    _LIT( KFile, "radio.txt" );
+    _LIT( KFullPath, "c:\\logs\\radio\\" );
+
+#endif
+
+//-----------------------------------------------------------------------------
+// Error trace macros
+//-----------------------------------------------------------------------------
+//
+#ifdef ERROR_TRACE
+
+    /**
+    * Error trace definitions.
+    */
+    #ifdef TRACE_INTO_FILE
+
+        #define ERROR( aErr, aMsg )\
+            {\
+            if( aErr < KErrNone )\
+                {\
+                RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_ERROR( aMsg ), aErr );\
+                }\
+            }
+        #define ERROR_1( aErr, aMsg, aP1 )\
+            {\
+            if( aErr < KErrNone )\
+                {\
+                RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_ERROR( aMsg ), aErr, aP1 );\
+                }\
+            }
+        #define ERROR_2( aErr, aMsg, aP1, aP2 )\
+            {\
+            if( aErr < KErrNone )\
+                {\
+                RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_ERROR( aMsg ), aErr, aP1, aP2 );\
+                }\
+            }
+        #define ERROR_3( aErr, aMsg, aP1, aP2, aP3 )\
+            {\
+            if( aErr < KErrNone )\
+                {\
+                RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_ERROR( aMsg ), aErr, aP1, aP2, aP3 );\
+                }\
+            }
+        #define ERROR_4( aErr, aMsg, aP1, aP2, aP3, aP4 )\
+            {\
+            if( aErr < KErrNone )\
+                {\
+                RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_ERROR( aMsg ), aErr, aP1, aP2, aP3, aP4 );\
+                }\
+            }
+        #define ERROR_5( aErr, aMsg, aP1, aP2, aP3, aP4, aP5 )\
+            {\
+            if( aErr < KErrNone )\
+                {\
+                RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_ERROR( aMsg ), aErr, aP1, aP2, aP3, aP4, aP5 );\
+                }\
+            }
+        #define ERROR_6( aErr, aMsg, aP1, aP2, aP3, aP4, aP5, aP6 )\
+            {\
+            if( aErr < KErrNone )\
+                {\
+                RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_ERROR( aMsg ), aErr, aP1, aP2, aP3, aP4, aP5 );\
+                }\
+            }
+            
+    #else//TRACE_INTO_FILE not defined
+    
+        #define ERROR( aErr, aMsg )\
+            {\
+            if( aErr < KErrNone )\
+                {\
+                RDebug::Print( _PREFIX_ERROR( aMsg ), aErr );\
+                }\
+            }
+        #define ERROR_1( aErr, aMsg, aP1 )\
+            {\
+            if( aErr < KErrNone )\
+                {\
+                RDebug::Print( _PREFIX_ERROR( aMsg ), aErr, aP1 );\
+                }\
+            }
+        #define ERROR_2( aErr, aMsg, aP1, aP2 )\
+            {\
+            if( aErr < KErrNone )\
+                {\
+                RDebug::Print( _PREFIX_ERROR( aMsg ), aErr, aP1, aP2 );\
+                }\
+            }
+        #define ERROR_3( aErr, aMsg, aP1, aP2, aP3 )\
+            {\
+            if( aErr < KErrNone )\
+                {\
+                RDebug::Print( _PREFIX_ERROR( aMsg ), aErr, aP1, aP2, aP3 );\
+                }\
+            }
+        #define ERROR_4( aErr, aMsg, aP1, aP2, aP3, aP4 )\
+            {\
+            if( aErr < KErrNone )\
+                {\
+                RDebug::Print( _PREFIX_ERROR( aMsg ), aErr, aP1, aP2, aP3, aP4 );\
+                }\
+            }
+        #define ERROR_5( aErr, aMsg, aP1, aP2, aP3, aP4, aP5 )\
+            {\
+            if( aErr < KErrNone )\
+                {\
+                RDebug::Print( _PREFIX_ERROR( aMsg ), aErr, aP1, aP2, aP3, aP4, aP5 );\
+                }\
+            }
+        #define ERROR_6( aErr, aMsg, aP1, aP2, aP3, aP4, aP5, aP6 )\
+            {\
+            if( aErr < KErrNone )\
+                {\
+                RDebug::Print( _PREFIX_ERROR( aMsg ), aErr, aP1, aP2, aP3, aP4, aP5, aP6 );\
+                }\
+            }
+    
+    #endif//TRACE_INTO_FILE
+
+    #define ERROR_GEN( aMsg ) ERROR( KErrGeneral, aMsg )
+    #define ERROR_GEN_1( aMsg, aP1 ) ERROR_1( KErrGeneral, aMsg, aP1 )
+    #define ERROR_GEN_2( aMsg, aP1, aP2 ) ERROR_2( KErrGeneral, aMsg, aP1, aP2 )
+    #define ERROR_GEN_3( aMsg, aP1, aP2, aP3 ) ERROR_3( KErrGeneral, aMsg, aP1, aP3 )
+    #define ERROR_GEN_4( aMsg, aP1, aP2, aP3, aP4 ) ERROR_4( KErrGeneral, aMsg, aP1, aP3, aP4 )
+    #define ERROR_GEN_5( aMsg, aP1, aP2, aP3, aP4, aP5 ) ERROR_5( KErrGeneral, aMsg, aP1, aP3, aP4, aP5 )
+    #define ERROR_GEN_6( aMsg, aP1, aP2, aP3, aP4, aP5, aP6 ) ERROR_6( KErrGeneral, aMsg, aP1, aP3, aP4, aP5, aP6 )
+
+#else//ERROR_TRACE not defined
+
+    #define ERROR( aErr, aMsg )
+    #define ERROR_1( aErr, aMsg, aP1 )
+    #define ERROR_2( aErr, aMsg, aP1, aP2 )
+    #define ERROR_3( aErr, aMsg, aP1, aP2, aP3 )
+    #define ERROR_4( aErr, aMsg, aP1, aP2, aP3, aP4 )
+    #define ERROR_5( aErr, aMsg, aP1, aP2, aP3, aP4, aP5 )
+    #define ERROR_6( aErr, aMsg, aP1, aP2, aP3, aP4, aP5, aP6 )
+
+    #define ERROR_GEN( aMsg )
+    #define ERROR_GEN_1( aMsg, aP1 )
+    #define ERROR_GEN_2( aMsg, aP1, aP2 )
+    #define ERROR_GEN_3( aMsg, aP1, aP2, aP3 )
+    #define ERROR_GEN_4( aMsg, aP1, aP2, aP3, aP4 )
+    #define ERROR_GEN_5( aMsg, aP1, aP2, aP3, aP4, aP5 )
+    #define ERROR_GEN_6( aMsg, aP1, aP2, aP3, aP4, aP5, aP6 )
+
+#endif//ERROR_TRACE
+
+//-----------------------------------------------------------------------------
+// TRAP and trace with error macro
+//-----------------------------------------------------------------------------
+//
+#define TRAP_ERROR( aErr, aFunction )\
+    {\
+    TRAP( aErr, aFunction );\
+    TPtrC8 file( ( TText8* )__FILE__ );\
+    ERROR_2( aErr, "Trapped leave in '%S' line %d", &file, __LINE__);\
+    }
+
+//-----------------------------------------------------------------------------
+// Info trace macros
+//-----------------------------------------------------------------------------
+//
+#ifdef INFO_TRACE
+
+    /**
+    * Info log message definitions.
+    */
+    #ifdef TRACE_INTO_FILE
+    
+        #define INFO( aMsg )\
+            {\
+            RFileLogger::Write( KDir, KFile, EFileLoggingModeAppend, _PREFIX_INFO( aMsg ) );\
+            }
+        #define INFO_1( aMsg, aP1 )\
+            {\
+            RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_INFO( aMsg ), aP1 );\
+            }
+        #define INFO_2( aMsg, aP1, aP2 )\
+            {\
+            RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_INFO( aMsg ), aP1, aP2 );\
+            }
+        #define INFO_3( aMsg, aP1, aP2, aP3 )\
+            {\
+            RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_INFO( aMsg ), aP1, aP2, aP3 );\
+            }
+        #define INFO_4( aMsg, aP1, aP2, aP3, aP4 )\
+            {\
+            RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_INFO( aMsg ), aP1, aP2, aP3, aP4 );\
+            }
+        #define INFO_5( aMsg, aP1, aP2, aP3, aP4, aP5 )\
+            {\
+            RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_INFO( aMsg ), aP1, aP2, aP3, aP4, aP5 );\
+            }
+        #define INFO_6( aMsg, aP1, aP2, aP3, aP4, aP5, aP6 )\
+            {\
+            RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_INFO( aMsg ), aP1, aP2, aP3, aP4, aP5, aP6 );\
+            }
+
+    #else//TRACE_INTO_FILE not defined
+
+        #define INFO( aMsg )\
+            {\
+            RDebug::Print( _PREFIX_INFO( aMsg ) );\
+            }
+        #define INFO_1( aMsg, aP1 )\
+            {\
+            RDebug::Print( _PREFIX_INFO( aMsg ), aP1 );\
+            }
+        #define INFO_2( aMsg, aP1, aP2 )\
+            {\
+            RDebug::Print( _PREFIX_INFO( aMsg ), aP1, aP2 );\
+            }
+        #define INFO_3( aMsg, aP1, aP2, aP3 )\
+            {\
+            RDebug::Print( _PREFIX_INFO( aMsg ), aP1, aP2, aP3 );\
+            }
+        #define INFO_4( aMsg, aP1, aP2, aP3, aP4 )\
+            {\
+            RDebug::Print( _PREFIX_INFO( aMsg ), aP1, aP2, aP3, aP4 );\
+            }
+        #define INFO_5( aMsg, aP1, aP2, aP3, aP4, aP5 )\
+            {\
+            RDebug::Print( _PREFIX_INFO( aMsg ), aP1, aP2, aP3, aP4, aP5 );\
+            }
+        #define INFO_6( aMsg, aP1, aP2, aP3, aP4, aP5, aP6 )\
+            {\
+            RDebug::Print( _PREFIX_INFO( aMsg ), aP1, aP2, aP3, aP4, aP5, aP6 );\
+            }
+
+    #endif//TRACE_INTO_FILE
+        
+#else//INFO_TRACE not defined
+
+    #define INFO( aMsg )
+    #define INFO_1( aMsg, aP1 )
+    #define INFO_2( aMsg, aP1, aP2 )
+    #define INFO_3( aMsg, aP1, aP2, aP3 )
+    #define INFO_4( aMsg, aP1, aP2, aP3, aP4 )
+    #define INFO_5( aMsg, aP1, aP2, aP3, aP4, aP5 )
+    #define INFO_6( aMsg, aP1, aP2, aP3, aP4, aP5, aP6 )
+
+#endif//INFO_TRACE
+
+//-----------------------------------------------------------------------------
+// Trace current client thread name and process id
+//-----------------------------------------------------------------------------
+//
+#ifdef CLIENT_TRACE
+
+    #define CLIENT_PROCESS\
+        {\
+        CLIENT_PROCESS_PREFIX( "" );\
+        }        
+
+    #define CLIENT_PROCESS_PREFIX( aPrefix )\
+        {\
+        RProcess process;\
+        TPtrC name( process.Name() );\
+        TSecureId sid( process.SecureId() );\
+        TPtrC prefix( _S( aPrefix ) );\
+        if( prefix.Length() )\
+            {\
+            INFO_3( "%S: CLIENT - Name: [%S], Sid: [0x%x]", &prefix, &name, sid.iId );\
+            }\
+        else\
+            {\
+            INFO_2( "CLIENT - Name: [%S], Sid: [0x%x]", &name, sid.iId );\
+            }\
+        process.Close();\
+        }        
+
+    #define CLIENT_MESSAGE( aMsg )\
+        {\
+        CLIENT_MESSAGE_PREFIX( "", aMsg );\
+        }
+
+    #define CLIENT_MESSAGE_PREFIX( aPrefix, aMsg )\
+        {\
+        RThread thread;\
+        TInt err = aMsg.Client( thread );\
+        if( err == KErrNone )\
+            {\
+            RProcess process;\
+            err = thread.Process( process );\
+            if( err == KErrNone )\
+                {\
+                TPtrC threadName( thread.Name() );\
+                TUid processUid( process.SecureId() );\
+                TPtrC prefix( _S( aPrefix ) );\
+                if( prefix.Length() )\
+                    {\
+                    INFO_4( "%S: MSG - Name: [%S], Sid: [0x%x], Message ID: [%d]",\
+                        &prefix,\
+                        &threadName,\
+                        processUid,\
+                        aMsg.Function() );\
+                    }\
+                else\
+                    {\
+                    INFO_3( "MSG - Name: [%S], Sid: [0x%x], Message ID: [%d]",\
+                        &threadName,\
+                        processUid,\
+                        aMsg.Function() );\
+                    }\
+                }\
+            process.Close();\
+            }\
+        thread.Close();\
+        }
+
+#else
+
+    #define CLIENT_PROCESS
+    #define CLIENT_PROCESS_PREFIX( aPrefix )
+    #define CLIENT_MESSAGE( aMsg )
+    #define CLIENT_MESSAGE_PREFIX( aPrefix, aMsg )
+
+#endif
+
+//-----------------------------------------------------------------------------
+// Function trace macros
+//-----------------------------------------------------------------------------
+//
+#ifdef FUNC_TRACE
+
+    /**
+    * Function logging definitions.
+    */
+    #ifdef TRACE_INTO_FILE
+    
+        #define FUNC( aMsg, aP1 )\
+            {\
+            TPtrC8 trace( _S8( aMsg ) );\
+            RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, trace, aP1 );\
+            }\
+    
+    #else//TRACE_INTO_FILE not defined
+    
+        #define FUNC( aMsg, aP1 )\
+            {\
+            RDebug::Printf( aMsg, aP1 );\
+            }\
+    
+    #endif//TRACE_INTO_FILE
+        
+    /**
+    * Function trace helper class.
+    * 
+    * NOTE:
+    * LC -methods cannot be trapped. Therefore if LC -method leaves
+    * END trace is used instead of LEAVE trace.
+    * If you have an idea how to round this problem please tell.
+    */
+    _LIT8( KFuncNameTerminator, "(" );
+    _LIT8( KFuncLeavePatternL, "L" );
+    class TFuncLog
+        {
+        public:
+            static void Cleanup( TAny* aPtr )
+                {
+                TFuncLog* self = static_cast< TFuncLog* >( aPtr );
+                self->iLeft = ETrue;
+                FUNC( _PREFIX_CHAR("%S-LEAVE"), &self->iFunc ); // Leave detected
+                }
+            inline TFuncLog( const char* aFunc ) :
+                    iFunc( aFunc ? _S8( aFunc ) : _S8("") ),
+                    iLeft( EFalse ),
+                    iCleanupItem( Cleanup, this ),
+                    iCanLeave( EFalse )
+                {
+                TInt pos( iFunc.Find( KFuncNameTerminator ) );
+                if( pos != KErrNotFound )
+                    {
+                    iFunc.Set( iFunc.Left( pos ) );
+                    iCanLeave = !iFunc.Right( KFuncLeavePatternL().Length() ).Compare( KFuncLeavePatternL );
+                    if ( iCanLeave )
+                        {
+                        CleanupStack::PushL( iCleanupItem ); // Ignore warnings
+                        }
+                    }
+                FUNC( _PREFIX_CHAR("%S-START"), &iFunc );
+                }
+
+            inline ~TFuncLog()
+                {
+                if ( !iLeft )
+                    {
+                    if ( iCanLeave )
+                        {
+                        CleanupStack::Pop( this ); // Pop the cleanup item
+                        }
+                    FUNC( _PREFIX_CHAR("%S-END"), &iFunc ); // Normally finished
+                    }
+                }
+
+        private: // Data
+            TPtrC8 iFunc;
+            TBool iLeft;
+            TCleanupItem iCleanupItem;
+            TBool iCanLeave;
+        };
+    #define FUNC_LOG TFuncLog _fl( __PRETTY_FUNCTION__ );
+    
+#else//FUNC_TRACE not defined
+
+    #define FUNC_LOG
+
+#endif//FUNC_TRACE
+
+//-----------------------------------------------------------------------------
+// Timestamp trace macros
+//-----------------------------------------------------------------------------
+//
+#ifdef TIMESTAMP_TRACE
+
+    #ifdef TRACE_INTO_FILE
+    
+        #define TIMESTAMP( aCaption )\
+            {\
+            TTime t;\
+            t.HomeTime();\
+            TDateTime dt = t.DateTime();\
+            _LIT( KCaption, aCaption );\
+            RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend,\
+                _PREFIX_TRACE("[TIMESTAMP] %S %d:%02d:%02d.%d us"),\
+                    &KCaption, dt.Hour(), dt.Minute(), dt.Second(), dt.MicroSecond() );\
+            }
+
+    #else//TRACE_INTO_FILE not defined
+    
+        #define TIMESTAMP( aCaption )\
+            {\
+            TTime t;\
+            t.HomeTime();\
+            TDateTime dt = t.DateTime();\
+            _LIT( KCaption, aCaption );\
+            RDebug::Print( _PREFIX_TRACE("[TIMESTAMP] %S %d:%02d:%02d.%d us"),\
+                &KCaption, dt.Hour(), dt.Minute(), dt.Second(), dt.MicroSecond() );\
+            }
+
+    #endif//TRACE_INTO_FILE
+
+#else//TIMESTAMP_TRACE not defined
+
+    #define TIMESTAMP( aCaption )
+
+#endif//TIMESTAMP_TRACE
+
+#ifdef HEAP_TRACE
+
+    #ifdef TRACE_INTO_FILE
+
+        #define HEAP( aMsg )\
+            {\
+            TInt totalAllocSpace = 0;\
+            User::AllocSize( totalAllocSpace );\
+            RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_HEAP( aMsg ), totalAllocSpace );\
+            }
+        #define HEAP_1( aMsg, aP1 )\
+            {\
+            TInt totalAllocSpace = 0;\
+            User::AllocSize( totalAllocSpace );\
+            RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_HEAP( aMsg ), totalAllocSpace, aP1 );\
+            }
+        #define HEAP_2( aMsg, aP1, aP2 )\
+            {\
+            TInt totalAllocSpace = 0;\
+            User::AllocSize( totalAllocSpace );\
+            RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_HEAP( aMsg ), totalAllocSpace, aP1, aP2 );\
+            }
+        #define HEAP_3( aMsg, aP1, aP2, aP3 )\
+            {\
+            TInt totalAllocSpace = 0;\
+            User::AllocSize( totalAllocSpace );\
+            RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_HEAP( aMsg ), totalAllocSpace, aP1, aP2, aP3 );\
+            }
+        #define HEAP_4( aMsg, aP1, aP2, aP3, aP4 )\
+            {\
+            TInt totalAllocSpace = 0;\
+            User::AllocSize( totalAllocSpace );\
+            RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_HEAP( aMsg ), totalAllocSpace, aP1, aP2, aP3, aP4 );\
+            }
+
+    #else//TRACE_INTO_FILE not defined
+
+        #define HEAP( aMsg )\
+            {\
+            TInt totalAllocSpace = 0;\
+            User::AllocSize( totalAllocSpace );\
+            RDebug::Print( _PREFIX_HEAP( aMsg ), totalAllocSpace );\
+            }
+        #define HEAP_1( aMsg, aP1 )\
+            {\
+            TInt totalAllocSpace = 0;\
+            User::AllocSize( totalAllocSpace );\
+            RDebug::Print( _PREFIX_HEAP( aMsg ), totalAllocSpace, aP1 );\
+            }
+        #define HEAP_2( aMsg, aP1, aP2 )\
+            {\
+            TInt totalAllocSpace = 0;\
+            User::AllocSize( totalAllocSpace );\
+            RDebug::Print( _PREFIX_HEAP( aMsg ), totalAllocSpace, aP1, aP2 );\
+            }
+        #define HEAP_3( aMsg, aP1, aP2, aP3 )\
+            {\
+            TInt totalAllocSpace = 0;\
+            User::AllocSize( totalAllocSpace );\
+            RDebug::Print( _PREFIX_HEAP( aMsg ), totalAllocSpace, aP1, aP2, aP3 );\
+            }
+        #define HEAP_4( aMsg, aP1, aP2, aP3, aP4 )\
+            {\
+            TInt totalAllocSpace = 0;\
+            User::AllocSize( totalAllocSpace );\
+            RDebug::Print( _PREFIX_HEAP( aMsg ), totalAllocSpace, aP1, aP2, aP3, aP4 );\
+            }
+
+    #endif//TRACE_INTO_FILE
+
+#else//HEAP_TRACE not defined
+
+    #define HEAP( aMsg )
+    #define HEAP_1( aMsg, aP1 )
+    #define HEAP_2( aMsg, aP1, aP2 )
+    #define HEAP_3( aMsg, aP1, aP2, aP3 )
+    #define HEAP_4( aMsg, aP1, aP2, aP3, aP4 )
+
+#endif//HEAP_TRACE
+
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/radioutility/radio_utility/inc/traceconfiguration.hrh	Fri May 14 16:22:35 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: 
+* Trace Macro Configurations.
+*
+*/
+
+
+#ifndef TRACECONFIGURATION_HRH
+#define TRACECONFIGURATION_HRH
+
+//-----------------------------------------------------------------------------
+// Trace definitions
+//-----------------------------------------------------------------------------
+//
+
+/**
+* Error trace enabled
+*/
+#ifdef _DEBUG
+    #define ERROR_TRACE
+#else
+    #undef ERROR_TRACE
+#endif
+
+/**
+* Info trace enabled
+*/
+#ifdef _DEBUG
+    #define INFO_TRACE
+#else
+    #undef INFO_TRACE
+#endif
+
+/**
+* Timestamp tracing on
+*/
+#ifdef _DEBUG
+    #define TIMESTAMP_TRACE
+#else
+    #undef TIMESTAMP_TRACE
+#endif
+
+/**
+* Tracing current client process and thread
+*/
+#ifdef _DEBUG
+    #define CLIENT_TRACE
+#else
+    #undef CLIENT_TRACE
+#endif
+
+/**
+* Function trace enabled
+*/
+#ifdef _DEBUG
+    #define FUNC_TRACE
+#else
+    #undef FUNC_TRACE
+#endif
+
+/**
+* Tracing into file enabled, default RDebug
+*/
+#undef TRACE_INTO_FILE
+
+#endif
+
--- a/mmserv/radioutility/radio_utility/src/RadioFmTunerUtility.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/radioutility/radio_utility/src/RadioFmTunerUtility.cpp	Fri May 14 16:22:35 2010 +0300
@@ -18,6 +18,7 @@
 
 #include <RadioFmTunerUtility.h>
 #include "RadioFmTunerUtilityBody.h"
+#include "trace.h"
 
 // -----------------------------------------------------------------------------
 // CRadioFmTunerUtility::NewL
@@ -28,6 +29,7 @@
     RRadioSession& aRadioSession,
     MRadioFmTunerObserver& aObserver)
     {
+    FUNC_LOG;
     CRadioFmTunerUtility* self = new(ELeave) CRadioFmTunerUtility;
     CleanupStack::PushL(self);
     self->iBody = CRadioFmTunerUtility::CBody::NewL(aRadioSession, aObserver);
@@ -42,6 +44,7 @@
 //
 EXPORT_C CRadioFmTunerUtility::~CRadioFmTunerUtility()
     {
+    FUNC_LOG;
     delete iBody;
     }
 
@@ -52,6 +55,7 @@
 //
 CRadioFmTunerUtility::CRadioFmTunerUtility()
     {
+    FUNC_LOG;
     }
 
 // -----------------------------------------------------------------------------
@@ -61,6 +65,7 @@
 //
 EXPORT_C void CRadioFmTunerUtility::RequestTunerControl()
     {
+    FUNC_LOG;
     ASSERT(iBody);
     iBody->RequestTunerControl();
     }
@@ -72,6 +77,7 @@
 //
 EXPORT_C void CRadioFmTunerUtility::Close()
     {
+    FUNC_LOG;
     ASSERT(iBody);
     iBody->Close();
     }
@@ -84,6 +90,7 @@
 EXPORT_C TInt CRadioFmTunerUtility::GetCapabilities(
     TFmTunerCapabilities& aCaps)
     {
+    FUNC_LOG;
     ASSERT(iBody);
     return iBody->GetCapabilities(aCaps);
     }
@@ -97,6 +104,7 @@
     TBool aEnable )
 
     {
+    FUNC_LOG;
     ASSERT(iBody);
     return iBody->EnableTunerInOfflineMode(aEnable);
     }
@@ -109,6 +117,7 @@
 EXPORT_C void CRadioFmTunerUtility::SetFrequency(
     TInt aFrequency )
     {
+    FUNC_LOG;
     ASSERT(iBody);
     iBody->SetFrequency(aFrequency);
     }
@@ -120,6 +129,7 @@
 //
 EXPORT_C void CRadioFmTunerUtility::CancelSetFrequency()
     {
+    FUNC_LOG;
     ASSERT(iBody);
     iBody->CancelSetFrequency();
     }
@@ -132,6 +142,7 @@
 EXPORT_C TInt CRadioFmTunerUtility::GetFrequency(
     TInt& aFrequency ) const
     {
+    FUNC_LOG;
     ASSERT(iBody);
     return iBody->GetFrequency(aFrequency);
     }
@@ -144,6 +155,7 @@
 EXPORT_C void CRadioFmTunerUtility::SetFrequencyRange(
     TFmRadioFrequencyRange aRange )
     {
+    FUNC_LOG;
     ASSERT(iBody);
     iBody->SetFrequencyRange(aRange);
     }
@@ -155,6 +167,7 @@
 //
 EXPORT_C void CRadioFmTunerUtility::CancelSetFrequencyRange()
     {
+    FUNC_LOG;
     ASSERT(iBody);
     iBody->CancelSetFrequencyRange();
     }
@@ -169,6 +182,7 @@
     TInt& aMinFreq,
     TInt& aMaxFreq ) const
     {
+    FUNC_LOG;
     ASSERT(iBody);
     return iBody->GetFrequencyRange(aRange, aMinFreq, aMaxFreq);
     }
@@ -181,6 +195,7 @@
 EXPORT_C void CRadioFmTunerUtility::StationSeek(
     TBool aUpwards )
     {
+    FUNC_LOG;
     ASSERT(iBody);
     iBody->StationSeek(aUpwards);
     }
@@ -192,6 +207,7 @@
 //
 EXPORT_C void CRadioFmTunerUtility::CancelStationSeek()
     {
+    FUNC_LOG;
     ASSERT(iBody);
     iBody->CancelStationSeek();
     }
@@ -204,6 +220,7 @@
 EXPORT_C TInt CRadioFmTunerUtility::GetSignalStrength(
     TInt& aSignalStrength ) const
     {
+    FUNC_LOG;
     ASSERT(iBody);
     return iBody->GetSignalStrength(aSignalStrength);
     }
@@ -216,6 +233,7 @@
 EXPORT_C TInt CRadioFmTunerUtility::GetMaxSignalStrength(
     TInt& aMaxSignalStrength ) const
     {
+    FUNC_LOG;
     ASSERT(iBody);
     return iBody->GetMaxSignalStrength(aMaxSignalStrength);
     }
@@ -228,6 +246,7 @@
 EXPORT_C TInt CRadioFmTunerUtility::GetStereoMode(
     TBool& aStereo ) const
     {
+    FUNC_LOG;
     ASSERT(iBody);
     return iBody->GetStereoMode(aStereo);
     }
@@ -240,6 +259,7 @@
 EXPORT_C TInt CRadioFmTunerUtility::ForceMonoReception(
     TBool aForcedMono )
     {
+    FUNC_LOG;
     ASSERT(iBody);
     return iBody->ForceMonoReception(aForcedMono);
     }
@@ -252,6 +272,7 @@
 EXPORT_C TInt CRadioFmTunerUtility::GetForcedMonoReception(
     TBool& aForcedMono ) const
     {
+    FUNC_LOG;
     ASSERT(iBody);
     return iBody->GetForcedMonoReception(aForcedMono);
     }
@@ -264,6 +285,7 @@
 EXPORT_C TInt CRadioFmTunerUtility::SetSquelch(
     TBool aSquelch )
     {
+    FUNC_LOG;
     ASSERT(iBody);
     return iBody->SetSquelch(aSquelch);
     }
@@ -276,6 +298,7 @@
 EXPORT_C TInt CRadioFmTunerUtility::GetSquelch(
     TBool& aSquelch ) const
     {
+    FUNC_LOG;
     ASSERT(iBody);
     return iBody->GetSquelch(aSquelch);
     }
--- a/mmserv/radioutility/radio_utility/src/RadioFmTunerUtilityBody.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/radioutility/radio_utility/src/RadioFmTunerUtilityBody.cpp	Fri May 14 16:22:35 2010 +0300
@@ -18,6 +18,7 @@
 
 #include "RadioFmTunerUtilityBody.h"
 #include "RadioUtilityBody.h"
+#include "trace.h"
 
 // -----------------------------------------------------------------------------
 // CRadioFmTunerUtility::CBody::NewL
@@ -28,9 +29,8 @@
     RRadioSession& aRadioSession,
     MRadioFmTunerObserver& aObserver )
     {
-    CRadioFmTunerUtility::CBody* s = new(ELeave) CRadioFmTunerUtility::CBody();
-    s->iRadioFmTunerUtilityClient = &aObserver;
-    s->iRadioSession = &aRadioSession;
+    FUNC_LOG;
+    CRadioFmTunerUtility::CBody* s = new(ELeave) CRadioFmTunerUtility::CBody( aRadioSession, aObserver );
     CleanupStack::PushL(s);
     s->ConstructL();
     CleanupStack::Pop();
@@ -44,14 +44,21 @@
 //
 void CRadioFmTunerUtility::CBody::ConstructL()
     {
+    FUNC_LOG;
     }
 
 // -----------------------------------------------------------------------------
 // CRadioFmTunerUtility::CBody::CBody
 // -----------------------------------------------------------------------------
 //
-CRadioFmTunerUtility::CBody::CBody()
+CRadioFmTunerUtility::CBody::CBody( 
+        RRadioSession& aRadioSession,
+        MRadioFmTunerObserver& aObserver )
+    : iRadioSession(aRadioSession),
+    iRadioFmTunerUtilityClient(aObserver)
+   
     {
+    FUNC_LOG;
     }
 
 // -----------------------------------------------------------------------------
@@ -60,6 +67,7 @@
 //
 CRadioFmTunerUtility::CBody::~CBody()
     {
+    FUNC_LOG;
     }
 
 // -----------------------------------------------------------------------------
@@ -69,7 +77,8 @@
 //
 void CRadioFmTunerUtility::CBody::RequestTunerControl()
     {
-    iRadioSession->RequestTunerControl( ERsTunerFm );
+    FUNC_LOG;
+    iRadioSession.RequestTunerControl( ERsTunerFm );
     }
 
 // -----------------------------------------------------------------------------
@@ -79,6 +88,7 @@
 //
 void CRadioFmTunerUtility::CBody::Close()
     {
+    FUNC_LOG;
     // Consider releasing tuner control here.
     }
 
@@ -90,8 +100,9 @@
 TInt CRadioFmTunerUtility::CBody::GetCapabilities(
     TFmTunerCapabilities& aCaps ) const
     {
+    FUNC_LOG;
     TRsTunerCapabilities caps;
-    TInt error = iRadioSession->GetTunerCapabilities( caps );
+    TInt error = iRadioSession.GetTunerCapabilities( caps );
 
     if ( !error )
         {
@@ -112,7 +123,8 @@
 TInt CRadioFmTunerUtility::CBody::EnableTunerInOfflineMode(
     TBool aEnable )
     {
-    return iRadioSession->EnableTunerInOfflineMode( aEnable );
+    FUNC_LOG;
+    return iRadioSession.EnableTunerInOfflineMode( aEnable );
     }
 
 // -----------------------------------------------------------------------------
@@ -125,9 +137,10 @@
     TInt& aMinFreq,
     TInt& aMaxFreq ) const
     {
+    FUNC_LOG;
 
     TRsFrequencyRange range;
-    TInt error = iRadioSession->GetFrequencyRange( range, aMinFreq, aMaxFreq );
+    TInt error = iRadioSession.GetFrequencyRange( range, aMinFreq, aMaxFreq );
     if ( !error )
         {
     switch ( range )
@@ -142,10 +155,7 @@
             break;
             }
         }
-#ifdef _DEBUG
-    RDebug::Print(_L("CRadioFmTunerUtility::CBody::GetFrequencyRange, aRange = %d, aMinFreq = %d, aMaxFreq = %d"),
-        aRange, aMinFreq, aMaxFreq);
-#endif
+    INFO_3("aRange = %d, aMinFreq = %d, aMaxFreq = %d", aRange, aMinFreq, aMaxFreq);
     return error;
     }
 
@@ -158,9 +168,8 @@
 void CRadioFmTunerUtility::CBody::SetFrequencyRange(
     TFmRadioFrequencyRange aRange )
     {
-#ifdef _DEBUG
-    RDebug::Print(_L("CRadioFmTunerUtility::CBody::SetFrequencyRange, aRange = %d"), aRange);
-#endif
+    FUNC_LOG;
+    INFO_1("aRange = %d", aRange);
     TRsFrequencyRange range = ERsRangeFmEuroAmerica;    //default
     switch (aRange)
         {
@@ -173,7 +182,7 @@
         default:
             break;
         }
-    iRadioSession->SetFrequencyRange( range );
+    iRadioSession.SetFrequencyRange( range );
     }
 
 
@@ -184,7 +193,8 @@
 //
 void CRadioFmTunerUtility::CBody::CancelSetFrequencyRange()
     {
-    iRadioSession->CancelSetFrequencyRange();
+    FUNC_LOG;
+    iRadioSession.CancelSetFrequencyRange();
     }
 
 // -----------------------------------------------------------------------------
@@ -195,10 +205,9 @@
 void CRadioFmTunerUtility::CBody::SetFrequency(
     TInt aFrequency )
     {
-#ifdef _DEBUG
-    RDebug::Print(_L("CRadioFmTunerUtility::CBody::SetFrequency, aFrequency = %d"), aFrequency);
-#endif
-    iRadioSession->SetFrequency(aFrequency);
+    FUNC_LOG;
+    INFO_1("aFrequency = %d", aFrequency);
+    iRadioSession.SetFrequency(aFrequency);
     }
 
 // -----------------------------------------------------------------------------
@@ -209,7 +218,8 @@
 //
 void CRadioFmTunerUtility::CBody::CancelSetFrequency()
     {
-    iRadioSession->CancelSetFrequency();
+    FUNC_LOG;
+    iRadioSession.CancelSetFrequency();
     }
 
 // -----------------------------------------------------------------------------
@@ -220,7 +230,8 @@
 TInt CRadioFmTunerUtility::CBody::GetFrequency(
     TInt& aFrequency ) const
     {
-    return iRadioSession->GetFrequency(aFrequency);
+    FUNC_LOG;
+    return iRadioSession.GetFrequency(aFrequency);
     }
 
 // -----------------------------------------------------------------------------
@@ -231,10 +242,9 @@
 void CRadioFmTunerUtility::CBody::StationSeek(
     TBool aUpwards )
     {
-#ifdef _DEBUG
-    RDebug::Print(_L("CRadioFmTunerUtility::CBody::StationSeek, aUpwards = %d"), aUpwards);
-#endif
-    iRadioSession->StationSeek(aUpwards);
+    FUNC_LOG;
+    INFO_1("aUpwards = %d", aUpwards);
+    iRadioSession.StationSeek(aUpwards);
     }
 
 // -----------------------------------------------------------------------------
@@ -244,7 +254,8 @@
 //
 void CRadioFmTunerUtility::CBody::CancelStationSeek()
     {
-    iRadioSession->CancelStationSeek();
+    FUNC_LOG;
+    iRadioSession.CancelStationSeek();
     }
 
 // -----------------------------------------------------------------------------
@@ -255,7 +266,8 @@
 TInt CRadioFmTunerUtility::CBody::GetSignalStrength(
     TInt& aSignalStrength ) const
     {
-    return iRadioSession->GetSignalStrength(aSignalStrength);
+    FUNC_LOG;
+    return iRadioSession.GetSignalStrength(aSignalStrength);
     }
 
 // -----------------------------------------------------------------------------
@@ -266,7 +278,8 @@
 TInt CRadioFmTunerUtility::CBody::GetMaxSignalStrength(
     TInt& aMaxSignalStrength ) const
     {
-    return iRadioSession->GetMaxSignalStrength(aMaxSignalStrength);
+    FUNC_LOG;
+    return iRadioSession.GetMaxSignalStrength(aMaxSignalStrength);
     }
 
 // -----------------------------------------------------------------------------
@@ -277,7 +290,8 @@
 TInt CRadioFmTunerUtility::CBody::GetStereoMode(
     TBool& aStereo ) const
     {
-    return iRadioSession->GetStereoMode(aStereo);
+    FUNC_LOG;
+    return iRadioSession.GetStereoMode(aStereo);
     }
 
 // -----------------------------------------------------------------------------
@@ -288,7 +302,8 @@
 TInt CRadioFmTunerUtility::CBody::ForceMonoReception(
     TBool aForcedMono)
     {
-    return iRadioSession->ForceMonoReception(aForcedMono);
+    FUNC_LOG;
+    return iRadioSession.ForceMonoReception(aForcedMono);
     }
 
 // -----------------------------------------------------------------------------
@@ -299,7 +314,8 @@
 TInt CRadioFmTunerUtility::CBody::GetForcedMonoReception(
     TBool& aForcedMono ) const
     {
-    return iRadioSession->GetForceMonoReception(aForcedMono);
+    FUNC_LOG;
+    return iRadioSession.GetForceMonoReception(aForcedMono);
     }
 
 // -----------------------------------------------------------------------------
@@ -310,7 +326,8 @@
 TInt CRadioFmTunerUtility::CBody::SetSquelch(
     TBool aSquelch )
     {
-    return iRadioSession->SetSquelch(aSquelch);
+    FUNC_LOG;
+    return iRadioSession.SetSquelch(aSquelch);
     }
 
 // -----------------------------------------------------------------------------
@@ -321,7 +338,8 @@
 TInt CRadioFmTunerUtility::CBody::GetSquelch(
     TBool& aSquelch ) const
     {
-    return iRadioSession->GetSquelch(aSquelch);
+    FUNC_LOG;
+    return iRadioSession.GetSquelch(aSquelch);
     }
 
 // End of File
--- a/mmserv/radioutility/radio_utility/src/RadioFmTunerUtilityBody.h	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/radioutility/radio_utility/src/RadioFmTunerUtilityBody.h	Fri May 14 16:22:35 2010 +0300
@@ -233,14 +233,14 @@
 private:
 
     void ConstructL();
-    CBody();
+    CBody( RRadioSession& aRadioSession, MRadioFmTunerObserver& aObserver );
 
 private: // data
 
     // The radio server session
-    RRadioSession* iRadioSession; // not own
+    RRadioSession& iRadioSession;
     // Tuner utility observer
-    MRadioFmTunerObserver* iRadioFmTunerUtilityClient; // not own
+    MRadioFmTunerObserver& iRadioFmTunerUtilityClient;
     };
 
 #endif  // C_RADIOFMTUNERUTILITY_H
--- a/mmserv/radioutility/radio_utility/src/RadioMonitor.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/radioutility/radio_utility/src/RadioMonitor.cpp	Fri May 14 16:22:35 2010 +0300
@@ -17,6 +17,7 @@
 
 
 #include "RadioMonitorBody.h"
+#include "trace.h"
 
 
 // ======== MEMBER FUNCTIONS ========
@@ -29,6 +30,7 @@
 EXPORT_C CRadioMonitor* CRadioMonitor::NewL(
     MRadioMonitorObserver& aObserver )
     {
+    FUNC_LOG;
     CRadioMonitor* self = new(ELeave) CRadioMonitor( aObserver );
     CleanupStack::PushL(self);
     self->iBody = CRadioMonitor::CBody::NewL( aObserver );
@@ -42,6 +44,7 @@
 //
 EXPORT_C CRadioMonitor::~CRadioMonitor()
     {
+    FUNC_LOG;
     delete iBody;
     }
 
@@ -53,6 +56,7 @@
 CRadioMonitor::CRadioMonitor(
     MRadioMonitorObserver& /*aObserver*/ )
     {
+    FUNC_LOG;
     }
 
 // -----------------------------------------------------------------------------
@@ -63,6 +67,7 @@
 //
 EXPORT_C TBool CRadioMonitor::IsRadioOn() const
     {
+    FUNC_LOG;
     ASSERT(iBody);
     return iBody->IsRadioOn();
     }
--- a/mmserv/radioutility/radio_utility/src/RadioMonitorBody.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/radioutility/radio_utility/src/RadioMonitorBody.cpp	Fri May 14 16:22:35 2010 +0300
@@ -19,6 +19,13 @@
 #include <RadioMonitor.h>
 #include "RadioMonitorBody.h"
 #include "RadioServerData.h"
+#include "trace.h"
+
+// This has to be the last include. 
+#ifdef STUB_CONSTELLATION
+#   include "RadioStubManager.h"
+#   define KRadioServerPropertyCategory KStub_KRadioServerPropertyCategory
+#endif //STUB_CONSTELLATION
 
 // ======== MEMBER FUNCTIONS ========
 
@@ -30,8 +37,8 @@
 CRadioMonitor::CBody* CRadioMonitor::CBody::NewL(
     MRadioMonitorObserver& aObserver )
     {
-    CRadioMonitor::CBody* s = new(ELeave) CRadioMonitor::CBody();
-    s->iRadioMonitorClient = &aObserver;
+    FUNC_LOG;
+    CRadioMonitor::CBody* s = new(ELeave) CRadioMonitor::CBody( aObserver );
     CleanupStack::PushL(s);
     s->ConstructL();
     CleanupStack::Pop();
@@ -44,6 +51,7 @@
 //
 CRadioMonitor::CBody::~CBody()
     {
+    FUNC_LOG;
     Cancel();
     iProperty.Close();
     }
@@ -53,9 +61,11 @@
 // Two-phased constructor.
 // -----------------------------------------------------------------------------
 //
-CRadioMonitor::CBody::CBody() :
-    CActive(EPriorityStandard)
+CRadioMonitor::CBody::CBody( MRadioMonitorObserver& aObserver ) :
+    CActive(EPriorityStandard),
+    iRadioMonitorClient(aObserver)
     {
+    FUNC_LOG;
     }
 
 // -----------------------------------------------------------------------------
@@ -65,6 +75,7 @@
 //
 void CRadioMonitor::CBody::ConstructL()
     {
+    FUNC_LOG;
     CActiveScheduler::Add(this);
 
     // Attach property
@@ -82,6 +93,7 @@
 //
 TBool CRadioMonitor::CBody::IsRadioOn() const
     {
+    FUNC_LOG;
     TBool radioState = ERadioStateOff;
     RProperty::Get(KRadioServerPropertyCategory,
                    KRadioServPsMonitorState,
@@ -97,6 +109,7 @@
 //
 void CRadioMonitor::CBody::RunL()
     {
+    FUNC_LOG;
     TBool radioState = ERadioStateOff;
 
     // Resubscribe before processing new value to prevent missing updates
@@ -106,11 +119,11 @@
     TInt error = iProperty.Get(radioState);
     if ( error == KErrNone )
         {
-        iRadioMonitorClient->MrmEvent((TRadioMonitorEvent)radioState);
+        iRadioMonitorClient.MrmEvent((TRadioMonitorEvent)radioState);
         }
     else if ( error == KErrNotFound )
         {
-        iRadioMonitorClient->MrmEvent(ERadioStateOff);
+        iRadioMonitorClient.MrmEvent(ERadioStateOff);
         }
     else
         {
@@ -125,6 +138,7 @@
 //
 void CRadioMonitor::CBody::DoCancel()
     {
+    FUNC_LOG;
     iProperty.Cancel();
     }
 
--- a/mmserv/radioutility/radio_utility/src/RadioMonitorBody.h	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/radioutility/radio_utility/src/RadioMonitorBody.h	Fri May 14 16:22:35 2010 +0300
@@ -78,14 +78,14 @@
 private:
 
     void ConstructL();
-    CBody();
+    CBody( MRadioMonitorObserver& aObserver  );
 
 private:
 
     // The monitored P&S key
     RProperty iProperty;
     // Radio monitoring client
-    MRadioMonitorObserver* iRadioMonitorClient;
+    MRadioMonitorObserver& iRadioMonitorClient;
 
     };
 
--- a/mmserv/radioutility/radio_utility/src/RadioPlayerUtility.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/radioutility/radio_utility/src/RadioPlayerUtility.cpp	Fri May 14 16:22:35 2010 +0300
@@ -19,6 +19,7 @@
 #include <RadioPlayerUtility.h>
 #include "RadioPlayerUtilityBody.h"
 #include "RadioSession.h"
+#include "trace.h"
 
 // ======== MEMBER FUNCTIONS ========
 
@@ -31,6 +32,7 @@
      RRadioSession& aRadioSession,
      MRadioPlayerObserver& aObserver)
     {
+    FUNC_LOG;
     CRadioPlayerUtility* self = new(ELeave) CRadioPlayerUtility;
     CleanupStack::PushL(self);
     self->iBody = CRadioPlayerUtility::CBody::NewL(aRadioSession, aObserver);
@@ -45,6 +47,7 @@
 //
 EXPORT_C CRadioPlayerUtility::~CRadioPlayerUtility()
     {
+    FUNC_LOG;
     delete iBody;
     }
 
@@ -55,6 +58,7 @@
 //
 CRadioPlayerUtility::CRadioPlayerUtility()
     {
+    FUNC_LOG;
     }
 
 // -----------------------------------------------------------------------------
@@ -64,6 +68,7 @@
 //
 EXPORT_C TPlayerState CRadioPlayerUtility::PlayerState() const
     {
+    FUNC_LOG;
     TPlayerState playerState;
     ASSERT(iBody);
     iBody->PlayerState(playerState);
@@ -79,6 +84,7 @@
 //
 EXPORT_C void CRadioPlayerUtility::Close()
     {
+    FUNC_LOG;
     ASSERT(iBody);
     iBody->Close();
     }
@@ -91,6 +97,7 @@
 //
 EXPORT_C void CRadioPlayerUtility::Play()
     {
+    FUNC_LOG;
     ASSERT(iBody);
     iBody->Play();
     }
@@ -103,6 +110,7 @@
 //
 EXPORT_C void CRadioPlayerUtility::Stop()
     {
+    FUNC_LOG;
     ASSERT(iBody);
     iBody->Stop();
     }
@@ -115,6 +123,7 @@
 //
 EXPORT_C TInt CRadioPlayerUtility::Mute(TBool aMute)
     {
+    FUNC_LOG;
     ASSERT(iBody);
     return iBody->Mute(aMute);
     }
@@ -127,6 +136,7 @@
 //
 EXPORT_C TBool CRadioPlayerUtility::IsMute()
     {
+    FUNC_LOG;
     ASSERT(iBody);
     return iBody->IsMute();
     }
@@ -140,6 +150,7 @@
 //
 EXPORT_C TInt CRadioPlayerUtility::SetVolume(TInt aVolume)
     {
+    FUNC_LOG;
     ASSERT(iBody);
     return iBody->SetVolume(aVolume);
     }
@@ -152,6 +163,7 @@
 //
 EXPORT_C TInt CRadioPlayerUtility::GetVolume(TInt& aVolume) const
     {
+    FUNC_LOG;
     ASSERT(iBody);
     return iBody->GetVolume(aVolume);
     }
@@ -165,6 +177,7 @@
 EXPORT_C TInt CRadioPlayerUtility::SetVolumeRamp(
     const TTimeIntervalMicroSeconds& aRampInterval)
     {
+    FUNC_LOG;
     ASSERT(iBody);
     return iBody->SetVolumeRamp(aRampInterval);
     }
@@ -178,6 +191,7 @@
 EXPORT_C TInt CRadioPlayerUtility::GetMaxVolume(
     TInt& aMaxVolume ) const
     {
+    FUNC_LOG;
     ASSERT(iBody);
     return iBody->GetMaxVolume(aMaxVolume);
     }
@@ -192,6 +206,7 @@
     TInt aLeftPercentage,
     TInt aRightPercentage )
     {
+    FUNC_LOG;
     ASSERT(iBody);
     return iBody->SetBalance(aLeftPercentage, aRightPercentage);
     }
@@ -206,6 +221,7 @@
     TInt& aLeftPercentage,
     TInt& aRightPercentage ) const
     {
+    FUNC_LOG;
     ASSERT(iBody);
     return iBody->GetBalance(aLeftPercentage, aRightPercentage);
     }
@@ -219,6 +235,7 @@
 EXPORT_C TAny* CRadioPlayerUtility::CustomInterface(
     TUid aInterfaceId )
     {
+    FUNC_LOG;
     ASSERT(iBody);
     return iBody->CustomInterface(aInterfaceId);
     }
--- a/mmserv/radioutility/radio_utility/src/RadioPlayerUtilityBody.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/radioutility/radio_utility/src/RadioPlayerUtilityBody.cpp	Fri May 14 16:22:35 2010 +0300
@@ -20,6 +20,7 @@
 #include "RadioServerData.h"
 #include "RadioPlayerUtilityBody.h"
 #include "RadioSession.h"
+#include "trace.h"
 
 // ======== MEMBER FUNCTIONS ========
 
@@ -33,9 +34,8 @@
     RRadioSession& aRadioSession,
     MRadioPlayerObserver& aObserver )
     {
-    CRadioPlayerUtility::CBody* s = new(ELeave) CRadioPlayerUtility::CBody();
-    s->iRadioPlayerUtilityClient = &aObserver;
-    s->iRadioSession = &aRadioSession;
+    FUNC_LOG;
+    CRadioPlayerUtility::CBody* s = new(ELeave) CRadioPlayerUtility::CBody( aRadioSession, aObserver );
     CleanupStack::PushL(s);
     s->ConstructL();
     CleanupStack::Pop();
@@ -49,14 +49,20 @@
 //
 void CRadioPlayerUtility::CBody::ConstructL()
     {
+    FUNC_LOG;
     }
 
 // -----------------------------------------------------------------------------
 // CRadioPlayerUtility::CBody::CBody
 // -----------------------------------------------------------------------------
 //
-CRadioPlayerUtility::CBody::CBody()
+CRadioPlayerUtility::CBody::CBody(
+        RRadioSession& aRadioSession,
+        MRadioPlayerObserver& aObserver )
+    :iRadioSession(aRadioSession),
+    iRadioPlayerUtilityClient(aObserver)
     {
+    FUNC_LOG;
     }
 
 // -----------------------------------------------------------------------------
@@ -65,6 +71,7 @@
 //
 CRadioPlayerUtility::CBody::~CBody()
     {
+    FUNC_LOG;
     }
 
 // -----------------------------------------------------------------------------
@@ -77,9 +84,10 @@
 void CRadioPlayerUtility::CBody::PlayerState(
     TPlayerState& aPlayerState ) const
     {
+    FUNC_LOG;
     TRsPlayerState playerState;
 
-    if ( !iRadioSession->PlayerState( playerState ) )
+    if ( !iRadioSession.PlayerState( playerState ) )
         {
         aPlayerState = (TPlayerState)playerState;
         }
@@ -98,7 +106,8 @@
 //
 void CRadioPlayerUtility::CBody::Close()
     {
-    iRadioSession->Stop( ETrue );
+    FUNC_LOG;
+    iRadioSession.Stop( ETrue );
     }
 
 // -----------------------------------------------------------------------------
@@ -108,7 +117,8 @@
 //
 void CRadioPlayerUtility::CBody::Play()
     {
-    iRadioSession->Play();
+    FUNC_LOG;
+    iRadioSession.Play();
     }
 
 // -----------------------------------------------------------------------------
@@ -118,7 +128,8 @@
 //
 void CRadioPlayerUtility::CBody::Stop()
     {
-    iRadioSession->Stop();
+    FUNC_LOG;
+    iRadioSession.Stop();
     }
 
 // -----------------------------------------------------------------------------
@@ -129,7 +140,8 @@
 TInt CRadioPlayerUtility::CBody::Mute(
     TBool aMute )
     {
-    return iRadioSession->Mute( aMute );
+    FUNC_LOG;
+    return iRadioSession.Mute( aMute );
     }
 
 // -----------------------------------------------------------------------------
@@ -139,8 +151,9 @@
 //
 TBool CRadioPlayerUtility::CBody::IsMute()
     {
+    FUNC_LOG;
     TBool Mute = EFalse;
-    iRadioSession->GetMuteStatus( Mute );
+    iRadioSession.GetMuteStatus( Mute );
     return Mute;
     }
 
@@ -152,7 +165,8 @@
 TInt CRadioPlayerUtility::CBody::SetVolume(
     TInt aVolume )
     {
-    return iRadioSession->SetVolume( aVolume );
+    FUNC_LOG;
+    return iRadioSession.SetVolume( aVolume );
     }
 
 // -----------------------------------------------------------------------------
@@ -163,7 +177,8 @@
 TInt CRadioPlayerUtility::CBody::GetVolume(
     TInt& aVolume ) const
     {
-    return iRadioSession->GetVolume( aVolume );
+    FUNC_LOG;
+    return iRadioSession.GetVolume( aVolume );
     }
 
 // -----------------------------------------------------------------------------
@@ -174,10 +189,8 @@
 TInt CRadioPlayerUtility::CBody::SetVolumeRamp(
     const TTimeIntervalMicroSeconds& aRampInterval )
     {
-#ifdef _DEBUG
-    RDebug::Print(_L("CRadioPlayerUtility::CBody::SetVolumeRamp"));
-#endif
-    return iRadioSession->SetVolumeRamp( aRampInterval );
+    FUNC_LOG;
+    return iRadioSession.SetVolumeRamp( aRampInterval );
     }
 
 // -----------------------------------------------------------------------------
@@ -188,7 +201,8 @@
 TInt CRadioPlayerUtility::CBody::GetMaxVolume(
     TInt& aMaxVolume ) const
     {
-    return iRadioSession->GetMaxVolume( aMaxVolume );
+    FUNC_LOG;
+    return iRadioSession.GetMaxVolume( aMaxVolume );
     }
 
 // -----------------------------------------------------------------------------
@@ -200,11 +214,9 @@
     TInt aLeftPercentage,
     TInt aRightPercentage )
     {
-#ifdef _DEBUG
-    RDebug::Print(_L("CRadioPlayerUtility::CBody::SetBalance, aLeftPercentage = %d, aRightPercentage = %d"),
-        aLeftPercentage, aRightPercentage);
-#endif
-    return iRadioSession->SetBalance( aLeftPercentage, aRightPercentage );
+    FUNC_LOG;
+    INFO_2("aLeftPercentage = %d, aRightPercentage = %d", aLeftPercentage, aRightPercentage);
+    return iRadioSession.SetBalance( aLeftPercentage, aRightPercentage );
     }
 
 // -----------------------------------------------------------------------------
@@ -216,7 +228,8 @@
     TInt& aLeftPercentage,
     TInt& aRightPercentage ) const
     {
-    return iRadioSession->GetBalance( aLeftPercentage, aRightPercentage );
+    FUNC_LOG;
+    return iRadioSession.GetBalance( aLeftPercentage, aRightPercentage );
     }
 
 // -----------------------------------------------------------------------------
@@ -228,13 +241,12 @@
 TAny* CRadioPlayerUtility::CBody::CustomInterface(
     TUid aInterfaceId )
     {
-#ifdef _DEBUG
-    RDebug::Print(_L("CRadioPlayerUtility::CBody::CustomInterface, aInterfaceId = %d"), aInterfaceId);
-#endif
+    FUNC_LOG;
+    INFO_1("aInterfaceId = %d", aInterfaceId);
     TAny* ci = NULL;
     CCustomInterfaceUtility* customInterfaceUtil = NULL;
 
-    TRAPD( error, customInterfaceUtil = CCustomInterfaceUtility::NewL( *iRadioSession ) );
+    TRAPD( error, customInterfaceUtil = CCustomInterfaceUtility::NewL( iRadioSession ) );
 
     if ( !error )
         {
--- a/mmserv/radioutility/radio_utility/src/RadioPlayerUtilityBody.h	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/radioutility/radio_utility/src/RadioPlayerUtilityBody.h	Fri May 14 16:22:35 2010 +0300
@@ -185,14 +185,14 @@
 private:
 
     void ConstructL();
-    CBody();
+    CBody( RRadioSession& aRadioSession, MRadioPlayerObserver& aObserver );
 
 private: // data
 
     // The radio server session
-    RRadioSession* iRadioSession; // not own
+    RRadioSession& iRadioSession;
     // Player utility observer
-    MRadioPlayerObserver* iRadioPlayerUtilityClient; // not own
+    MRadioPlayerObserver& iRadioPlayerUtilityClient;
     };
 
 #endif  // C_RADIOPLAYERUTILITY_H
--- a/mmserv/radioutility/radio_utility/src/RadioRdsUtility.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/radioutility/radio_utility/src/RadioRdsUtility.cpp	Fri May 14 16:22:35 2010 +0300
@@ -17,6 +17,7 @@
 
 
 #include "RadioRdsUtilityBody.h"
+#include "trace.h"
 
 // -----------------------------------------------------------------------------
 // CRadioRdsUtility::NewL
@@ -27,6 +28,7 @@
     RRadioSession& aRadioSession,
     MRadioRdsObserver& aObserver)
     {
+    FUNC_LOG;
     CRadioRdsUtility* self = new(ELeave) CRadioRdsUtility;
     CleanupStack::PushL(self);
     self->iBody = CRadioRdsUtility::CBody::NewL(aRadioSession, aObserver);
@@ -41,7 +43,8 @@
 //
 CRadioRdsUtility::~CRadioRdsUtility()
     {
-        delete iBody;
+    FUNC_LOG;
+    delete iBody;
     }
 
 // -----------------------------------------------------------------------------
@@ -51,6 +54,7 @@
 //
 CRadioRdsUtility::CRadioRdsUtility()
     {
+    FUNC_LOG;
     }
 
 // -----------------------------------------------------------------------------
@@ -59,6 +63,7 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CRadioRdsUtility::Close()
     {
+    FUNC_LOG;
     ASSERT(iBody);
     return iBody->Close();
     }
@@ -70,6 +75,7 @@
 EXPORT_C TInt CRadioRdsUtility::GetCapabilities(
     TRdsCapabilities& aCaps ) const
     {
+    FUNC_LOG;
     ASSERT(iBody);
     return iBody->GetCapabilities(aCaps);
     }
@@ -81,6 +87,7 @@
 EXPORT_C TInt CRadioRdsUtility::GetRdsSignalStatus(
     TBool& aRdsSignal ) const
     {
+    FUNC_LOG;
     ASSERT(iBody);
     return iBody->GetRdsSignalStatus( aRdsSignal );
     }
@@ -92,6 +99,7 @@
 EXPORT_C TInt CRadioRdsUtility::NotifyRdsDataChange(
     TRdsData aRdsData )
     {
+    FUNC_LOG;
     ASSERT(iBody);
     return iBody->NotifyRdsDataChange( aRdsData );
     }
@@ -102,6 +110,7 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CRadioRdsUtility::CancelNotifyRdsDataChange()
     {
+    FUNC_LOG;
     ASSERT(iBody);
     iBody->CancelNotifyRdsDataChange();
     }
@@ -113,6 +122,7 @@
 EXPORT_C TInt CRadioRdsUtility::SetAutomaticSwitching(
     TBool aAuto )
     {
+    FUNC_LOG;
     ASSERT(iBody);
     return iBody->SetAutomaticSwitching(aAuto);
     }
@@ -124,6 +134,7 @@
 EXPORT_C TInt CRadioRdsUtility::GetAutomaticSwitching(
     TBool& aAuto )
     {
+    FUNC_LOG;
     ASSERT(iBody);
     return iBody->GetAutomaticSwitching(aAuto);
     }
@@ -134,6 +145,7 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CRadioRdsUtility::CancelAFSearch()
     {
+    FUNC_LOG;
     ASSERT(iBody);
     iBody->CancelAFSearch();
     }
@@ -145,6 +157,7 @@
 EXPORT_C TInt CRadioRdsUtility::SetAutomaticTrafficAnnouncement(
     TBool aAuto )
     {
+    FUNC_LOG;
     ASSERT(iBody);
     return iBody->SetAutomaticTrafficAnnouncement(aAuto);
     }
@@ -156,6 +169,7 @@
 EXPORT_C TInt CRadioRdsUtility::GetAutomaticTrafficAnnouncement(
     TBool& aAuto )
     {
+    FUNC_LOG;
     ASSERT(iBody);
     return iBody->GetAutomaticTrafficAnnouncement(aAuto);
     }
@@ -168,6 +182,7 @@
     TRdsProgrammeType aPty,
     TBool aUpwards )
     {
+    FUNC_LOG;
     ASSERT(iBody);
     iBody->StationSeekByPTY(aPty, aUpwards);
     }
@@ -179,6 +194,7 @@
 EXPORT_C void CRadioRdsUtility::StationSeekByTA(
     TBool aSeekUp )
     {
+    FUNC_LOG;
     ASSERT(iBody);
     iBody->StationSeekByTA(aSeekUp);
     }
@@ -190,6 +206,7 @@
 EXPORT_C void CRadioRdsUtility::StationSeekByTP(
     TBool aSeekUp )
     {
+    FUNC_LOG;
     ASSERT(iBody);
     iBody->StationSeekByTP(aSeekUp);
     }
@@ -200,6 +217,7 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CRadioRdsUtility::CancelRdsStationSeek()
     {
+    FUNC_LOG;
     ASSERT(iBody);
     iBody->CancelRdsStationSeek();
     }
@@ -211,6 +229,7 @@
 EXPORT_C void CRadioRdsUtility::GetFreqByPTY(
     TRdsProgrammeType aPty )
     {
+    FUNC_LOG;
     ASSERT(iBody);
     iBody->GetFreqByPTY( aPty );
     }
@@ -221,6 +240,7 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CRadioRdsUtility::CancelGetFreqByPTY()
     {
+    FUNC_LOG;
     ASSERT(iBody);
     iBody->CancelGetFreqByPTY();
     }
@@ -231,6 +251,7 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CRadioRdsUtility::GetFreqByTA()
     {
+    FUNC_LOG;
     ASSERT(iBody);
     iBody->GetFreqByTA();
     }
@@ -241,6 +262,7 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CRadioRdsUtility::CancelGetFreqByTA()
     {
+    FUNC_LOG;
     ASSERT(iBody);
     iBody->CancelGetFreqByTA();
     }
@@ -252,6 +274,7 @@
 EXPORT_C void CRadioRdsUtility::GetPSByPTY(
     TRdsProgrammeType aPty )
     {
+    FUNC_LOG;
     ASSERT(iBody);
     iBody->GetPSByPTY( aPty );
     }
@@ -262,6 +285,7 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CRadioRdsUtility::CancelGetPSByPTY()
     {
+    FUNC_LOG;
     ASSERT(iBody);
     iBody->CancelGetPSByPTY();
     }
@@ -272,6 +296,7 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CRadioRdsUtility::GetPSByTA()
     {
+    FUNC_LOG;
     ASSERT(iBody);
     iBody->GetPSByTA();
     }
@@ -282,6 +307,7 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CRadioRdsUtility::CancelGetPSByTA()
     {
+    FUNC_LOG;
     ASSERT(iBody);
     iBody->CancelGetPSByTA();
     }
@@ -293,6 +319,7 @@
 EXPORT_C TInt CRadioRdsUtility::GetProgrammeIdentification(
     TInt& aPi )
     {
+    FUNC_LOG;
     ASSERT(iBody);
     return iBody->GetProgrammeIdentification( aPi );
     }
@@ -304,6 +331,7 @@
 EXPORT_C TInt CRadioRdsUtility::GetProgrammeType(
     TRdsProgrammeType& aPty )
     {
+    FUNC_LOG;
     ASSERT(iBody);
     return iBody->GetProgrammeType( aPty );
     }
@@ -315,6 +343,7 @@
 EXPORT_C TInt CRadioRdsUtility::GetProgrammeService(
     TRdsPSName& aPs )
     {
+    FUNC_LOG;
     ASSERT(iBody);
     return iBody->GetProgrammeService( aPs );
     }
@@ -326,6 +355,7 @@
 EXPORT_C TInt CRadioRdsUtility::GetRadioText(
     TRdsRadioText& aRt )
     {
+    FUNC_LOG;
     ASSERT(iBody);
     return iBody->GetRadioText( aRt );
     }
@@ -338,6 +368,7 @@
     TRdsRTplusClass aRtPlusClass,
     TRdsRadioText& aRtPlusData )
     {
+    FUNC_LOG;
     ASSERT(iBody);
     return iBody->GetRadioTextPlus( aRtPlusClass,aRtPlusData );
     }
@@ -349,6 +380,7 @@
 EXPORT_C TInt CRadioRdsUtility::GetClockTime(
     TDateTime& aCt )
     {
+    FUNC_LOG;
     ASSERT(iBody);
     return iBody->GetClockTime( aCt );
     }
@@ -360,6 +392,7 @@
 EXPORT_C TInt CRadioRdsUtility::GetTrafficAnnouncementStatus(
     TBool& aTaStatus )
     {
+    FUNC_LOG;
     ASSERT(iBody);
     return iBody->GetTrafficAnnouncementStatus( aTaStatus );
     }
@@ -371,6 +404,7 @@
 EXPORT_C TInt CRadioRdsUtility::GetTrafficProgrammeStatus(
     TBool& aTpStatus )
     {
+    FUNC_LOG;
     ASSERT(iBody);
     return iBody->GetTrafficProgrammeStatus( aTpStatus );
     }
--- a/mmserv/radioutility/radio_utility/src/RadioRdsUtilityBody.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/radioutility/radio_utility/src/RadioRdsUtilityBody.cpp	Fri May 14 16:22:35 2010 +0300
@@ -19,6 +19,7 @@
 #include "RadioRdsUtilityBody.h"
 #include "RadioServerData.h"
 #include "RadioSession.h"
+#include "trace.h"
 
 // ======== MEMBER FUNCTIONS ========
 
@@ -31,9 +32,8 @@
     RRadioSession& aRadioSession,
     MRadioRdsObserver& aObserver )
     {
-    CRadioRdsUtility::CBody* s = new(ELeave) CRadioRdsUtility::CBody();
-    s->iRadioRdsUtilityClient = &aObserver;
-    s->iRadioSession = &aRadioSession;
+    FUNC_LOG;
+    CRadioRdsUtility::CBody* s = new(ELeave) CRadioRdsUtility::CBody( aRadioSession, aObserver );
     CleanupStack::PushL(s);
     s->ConstructL();
     CleanupStack::Pop();
@@ -47,14 +47,20 @@
 //
 void CRadioRdsUtility::CBody::ConstructL()
     {
+    FUNC_LOG;
     }
 
 // -----------------------------------------------------------------------------
 // CRadioRdsUtility::CBody::CBody
 // -----------------------------------------------------------------------------
 //
-CRadioRdsUtility::CBody::CBody()
+CRadioRdsUtility::CBody::CBody(
+        RRadioSession& aRadioSession,
+        MRadioRdsObserver& aObserver )
+    :iRadioSession(aRadioSession),
+    iRadioRdsUtilityClient(aObserver)
     {
+    FUNC_LOG;
     }
 
 // -----------------------------------------------------------------------------
@@ -63,6 +69,7 @@
 //
 CRadioRdsUtility::CBody::~CBody()
     {
+    FUNC_LOG;
     }
 
 // -----------------------------------------------------------------------------
@@ -73,10 +80,11 @@
 //
 void CRadioRdsUtility::CBody::Close()
     {
+    FUNC_LOG;
     if ( iRdsDataReq.iRdsFunctions || iRdsDataReq.iAdditionalFunctions1 ||
          iRdsDataReq.iAdditionalFunctions2 )
         {
-        iRadioSession->CancelNotifyRdsDataChange();
+        iRadioSession.CancelNotifyRdsDataChange();
         }
     }
 
@@ -88,8 +96,9 @@
 TInt CRadioRdsUtility::CBody::GetCapabilities(
     TRdsCapabilities& aCaps ) const
     {
+    FUNC_LOG;
     TRsRdsCapabilities Caps;
-    TInt error = iRadioSession->GetRdsCapabilities(Caps);
+    TInt error = iRadioSession.GetRdsCapabilities(Caps);
     if ( !error )
         {
         aCaps.iRdsFunctions = Caps.iRdsFunctions;
@@ -107,7 +116,8 @@
 TInt CRadioRdsUtility::CBody::GetRdsSignalStatus(
     TBool& aRdsSignal ) const
     {
-    return iRadioSession->GetRdsSignalStatus( aRdsSignal );
+    FUNC_LOG;
+    return iRadioSession.GetRdsSignalStatus( aRdsSignal );
     }
 
 // -----------------------------------------------------------------------------
@@ -118,10 +128,11 @@
 TInt CRadioRdsUtility::CBody::NotifyRdsDataChange(
     TRdsData aRdsData )
     {
+    FUNC_LOG;
     iRdsDataReq.iRdsFunctions = aRdsData.iRdsFunctions;
     iRdsDataReq.iAdditionalFunctions1 = aRdsData.iAdditionalFunctions1;
     iRdsDataReq.iAdditionalFunctions2 = aRdsData.iAdditionalFunctions2;
-    return iRadioSession->NotifyRdsDataChange( iRdsDataReq );
+    return iRadioSession.NotifyRdsDataChange( iRdsDataReq );
     }
 
 // -----------------------------------------------------------------------------
@@ -131,7 +142,8 @@
 //
 void CRadioRdsUtility::CBody::CancelNotifyRdsDataChange()
     {
-    iRadioSession->CancelNotifyRdsDataChange();
+    FUNC_LOG;
+    iRadioSession.CancelNotifyRdsDataChange();
     }
 
 // -----------------------------------------------------------------------------
@@ -142,7 +154,8 @@
 TInt CRadioRdsUtility::CBody::SetAutomaticSwitching(
     TBool aAuto )
     {
-    return iRadioSession->SetAutomaticSwitching( aAuto );
+    FUNC_LOG;
+    return iRadioSession.SetAutomaticSwitching( aAuto );
     }
 
 // -----------------------------------------------------------------------------
@@ -153,7 +166,8 @@
 TInt CRadioRdsUtility::CBody::GetAutomaticSwitching(
     TBool& aAuto )
     {
-    return iRadioSession->GetAutomaticSwitching( aAuto );
+    FUNC_LOG;
+    return iRadioSession.GetAutomaticSwitching( aAuto );
     }
 
 // -----------------------------------------------------------------------------
@@ -163,7 +177,8 @@
 //
 void CRadioRdsUtility::CBody::CancelAFSearch()
     {
-    iRadioSession->CancelAFSearch();
+    FUNC_LOG;
+    iRadioSession.CancelAFSearch();
     }
 
 // -----------------------------------------------------------------------------
@@ -174,7 +189,8 @@
 TInt CRadioRdsUtility::CBody::SetAutomaticTrafficAnnouncement(
     TBool aAuto )
     {
-    return iRadioSession->SetAutomaticTrafficAnnouncement( aAuto );
+    FUNC_LOG;
+    return iRadioSession.SetAutomaticTrafficAnnouncement( aAuto );
     }
 
 // -----------------------------------------------------------------------------
@@ -185,7 +201,8 @@
 TInt CRadioRdsUtility::CBody::GetAutomaticTrafficAnnouncement(
     TBool& aAuto )
     {
-    return iRadioSession->GetAutomaticTrafficAnnouncement( aAuto );
+    FUNC_LOG;
+    return iRadioSession.GetAutomaticTrafficAnnouncement( aAuto );
     }
 
 // -----------------------------------------------------------------------------
@@ -197,7 +214,8 @@
     TRdsProgrammeType aPty,
     TBool aUpwards )
     {
-    iRadioSession->StationSeekByPTY( aPty, aUpwards );
+    FUNC_LOG;
+    iRadioSession.StationSeekByPTY( aPty, aUpwards );
     }
 
 // -----------------------------------------------------------------------------
@@ -208,7 +226,8 @@
 void CRadioRdsUtility::CBody::StationSeekByTA(
     TBool aSeekUp )
     {
-    iRadioSession->StationSeekByTA( aSeekUp );
+    FUNC_LOG;
+    iRadioSession.StationSeekByTA( aSeekUp );
     }
 
 // -----------------------------------------------------------------------------
@@ -219,7 +238,8 @@
 void CRadioRdsUtility::CBody::StationSeekByTP(
     TBool aSeekUp )
     {
-    iRadioSession->StationSeekByTP( aSeekUp );
+    FUNC_LOG;
+    iRadioSession.StationSeekByTP( aSeekUp );
     }
 
 // -----------------------------------------------------------------------------
@@ -229,7 +249,8 @@
 //
 void CRadioRdsUtility::CBody::CancelRdsStationSeek()
     {
-    iRadioSession->CancelRdsStationSeek();
+    FUNC_LOG;
+    iRadioSession.CancelRdsStationSeek();
     }
 
 // -----------------------------------------------------------------------------
@@ -240,7 +261,8 @@
 void CRadioRdsUtility::CBody::GetFreqByPTY(
     TRdsProgrammeType aPty )
     {
-    iRadioSession->GetFreqByPTY( aPty );
+    FUNC_LOG;
+    iRadioSession.GetFreqByPTY( aPty );
     }
 
 // -----------------------------------------------------------------------------
@@ -250,7 +272,8 @@
 //
 void CRadioRdsUtility::CBody::CancelGetFreqByPTY()
     {
-    iRadioSession->CancelGetFreqByPTY();
+    FUNC_LOG;
+    iRadioSession.CancelGetFreqByPTY();
     }
 
 // -----------------------------------------------------------------------------
@@ -260,7 +283,8 @@
 //
 void CRadioRdsUtility::CBody::GetFreqByTA()
     {
-    iRadioSession->GetFreqByTA();
+    FUNC_LOG;
+    iRadioSession.GetFreqByTA();
     }
 
 // -----------------------------------------------------------------------------
@@ -270,7 +294,8 @@
 //
 void CRadioRdsUtility::CBody::CancelGetFreqByTA()
     {
-    iRadioSession->CancelGetFreqByTA();
+    FUNC_LOG;
+    iRadioSession.CancelGetFreqByTA();
     }
 
 // -----------------------------------------------------------------------------
@@ -281,7 +306,8 @@
 void CRadioRdsUtility::CBody::GetPSByPTY(
     TRdsProgrammeType aPty )
     {
-    iRadioSession->GetPSByPTY( aPty );
+    FUNC_LOG;
+    iRadioSession.GetPSByPTY( aPty );
     }
 
 // -----------------------------------------------------------------------------
@@ -291,7 +317,8 @@
 //
 void CRadioRdsUtility::CBody::CancelGetPSByPTY()
     {
-    iRadioSession->CancelGetPSByPTY();
+    FUNC_LOG;
+    iRadioSession.CancelGetPSByPTY();
     }
 
 // -----------------------------------------------------------------------------
@@ -301,7 +328,8 @@
 //
 void CRadioRdsUtility::CBody::GetPSByTA()
     {
-    iRadioSession->GetPSByTA();
+    FUNC_LOG;
+    iRadioSession.GetPSByTA();
     }
 
 // -----------------------------------------------------------------------------
@@ -311,7 +339,8 @@
 //
 void CRadioRdsUtility::CBody::CancelGetPSByTA()
     {
-    iRadioSession->CancelGetPSByTA();
+    FUNC_LOG;
+    iRadioSession.CancelGetPSByTA();
     }
 
 // -----------------------------------------------------------------------------
@@ -322,7 +351,8 @@
 TInt CRadioRdsUtility::CBody::GetProgrammeIdentification(
     TInt& aPi )
     {
-    return iRadioSession->GetProgrammeIdentification( aPi );
+    FUNC_LOG;
+    return iRadioSession.GetProgrammeIdentification( aPi );
     }
 
 // -----------------------------------------------------------------------------
@@ -333,7 +363,8 @@
 TInt CRadioRdsUtility::CBody::GetProgrammeType(
     TRdsProgrammeType& aPty )
     {
-    return iRadioSession->GetProgrammeType( aPty );
+    FUNC_LOG;
+    return iRadioSession.GetProgrammeType( aPty );
     }
 
 // -----------------------------------------------------------------------------
@@ -344,8 +375,9 @@
 TInt CRadioRdsUtility::CBody::GetProgrammeService(
     TRdsPSName& aPs )
     {
+    FUNC_LOG;
     TRsRdsPSName ps;
-    TInt error = iRadioSession->GetProgrammeService( ps );
+    TInt error = iRadioSession.GetProgrammeService( ps );
 
     if ( aPs.Length() )
         {
@@ -363,8 +395,9 @@
 TInt CRadioRdsUtility::CBody::GetRadioText(
     TRdsRadioText& aRt )
     {
+    FUNC_LOG;
     TRsRdsRadioText rt;
-    TInt error = iRadioSession->GetRadioText( rt );
+    TInt error = iRadioSession.GetRadioText( rt );
 
     if ( rt.Length() )
        {
@@ -383,10 +416,11 @@
     TRdsRTplusClass aRtPlusClass,
     TRdsRadioText& aRtPlusData )
     {
+    FUNC_LOG;
     aRtPlusClass = aRtPlusClass; // for compiler warning
     TRsRdsRadioText rt;
     TRsRdsRTplusClass rtPlusClass = ERsRTplusItemDummy;
-    TInt error = iRadioSession->GetRadioTextPlus( rtPlusClass, rt );
+    TInt error = iRadioSession.GetRadioTextPlus( rtPlusClass, rt );
 
     if ( rt.Length() )
         {
@@ -405,7 +439,8 @@
 TInt CRadioRdsUtility::CBody::GetClockTime(
     TDateTime& aCt )
     {
-    return iRadioSession->GetClockTime( aCt );
+    FUNC_LOG;
+    return iRadioSession.GetClockTime( aCt );
     }
 
 // -----------------------------------------------------------------------------
@@ -416,7 +451,8 @@
 TInt CRadioRdsUtility::CBody::GetTrafficAnnouncementStatus(
     TBool& aTaStatus )
     {
-    return iRadioSession->GetTrafficAnnouncementStatus( aTaStatus );
+    FUNC_LOG;
+    return iRadioSession.GetTrafficAnnouncementStatus( aTaStatus );
     }
 
 // -----------------------------------------------------------------------------
@@ -427,7 +463,8 @@
 TInt CRadioRdsUtility::CBody::GetTrafficProgrammeStatus(
     TBool& aTpStatus )
     {
-    return iRadioSession->GetTrafficProgrammeStatus( aTpStatus );
+    FUNC_LOG;
+    return iRadioSession.GetTrafficProgrammeStatus( aTpStatus );
     }
 
 
--- a/mmserv/radioutility/radio_utility/src/RadioRdsUtilityBody.h	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/radioutility/radio_utility/src/RadioRdsUtilityBody.h	Fri May 14 16:22:35 2010 +0300
@@ -415,14 +415,14 @@
 private:
 
     void ConstructL();
-    CBody();
+    CBody( RRadioSession& aRadioSession, MRadioRdsObserver& aObserver );
 
 private: // data
 
     // The radio server session
-    RRadioSession* iRadioSession; // not own
+    RRadioSession& iRadioSession;
     // RDS Utility Observer
-    MRadioRdsObserver* iRadioRdsUtilityClient; // not own
+    MRadioRdsObserver& iRadioRdsUtilityClient;
     // RDS notification reqs
     TRsRdsData iRdsDataReq;
     };
--- a/mmserv/radioutility/radio_utility/src/RadioUtility.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/radioutility/radio_utility/src/RadioUtility.cpp	Fri May 14 16:22:35 2010 +0300
@@ -17,6 +17,7 @@
 
 
 #include "RadioUtilityBody.h"
+#include "trace.h"
 
 
 // ======== MEMBER FUNCTIONS ========
@@ -29,10 +30,11 @@
 EXPORT_C CRadioUtility* CRadioUtility::NewL(
     TBool aPrimaryClient )
     {
+    FUNC_LOG;
     CRadioUtility* self = new(ELeave) CRadioUtility();
     CleanupStack::PushL(self);
     self->iBody = CRadioUtility::CBody::NewL(aPrimaryClient);
-    CleanupStack::Pop();
+    CleanupStack::Pop(self);
     return self;
     }
 
@@ -42,6 +44,7 @@
 //
 EXPORT_C CRadioUtility::~CRadioUtility()
     {
+    FUNC_LOG;
     delete iBody;
     }
 
@@ -52,6 +55,7 @@
 //
 CRadioUtility::CRadioUtility()
     {
+    FUNC_LOG;
     }
 
 // -----------------------------------------------------------------------------
@@ -62,6 +66,7 @@
 EXPORT_C CRadioFmTunerUtility& CRadioUtility::RadioFmTunerUtilityL(
     MRadioFmTunerObserver& aObserver )
     {
+    FUNC_LOG;
     ASSERT(iBody);
     return iBody->RadioFmTunerUtilityL(aObserver);
     }
@@ -74,6 +79,7 @@
 EXPORT_C CRadioPlayerUtility& CRadioUtility::RadioPlayerUtilityL(
     MRadioPlayerObserver& aObserver )
     {
+    FUNC_LOG;
     ASSERT(iBody);
     return iBody->RadioPlayerUtilityL(aObserver);
     }
@@ -86,6 +92,7 @@
 EXPORT_C CRadioRdsUtility& CRadioUtility::RadioRdsUtilityL(
     MRadioRdsObserver& aObserver )
     {
+    FUNC_LOG;
     ASSERT(iBody);
     return iBody->RadioRdsUtilityL(aObserver);
     }
--- a/mmserv/radioutility/radio_utility/src/RadioUtilityBody.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/radioutility/radio_utility/src/RadioUtilityBody.cpp	Fri May 14 16:22:35 2010 +0300
@@ -21,6 +21,7 @@
 #include <RadioRdsUtility.h>
 #include "RadioUtilityBody.h"
 #include "RadioServerData.h"
+#include "trace.h"
 
 // ======== MEMBER FUNCTIONS ========
 
@@ -32,10 +33,11 @@
 CRadioUtility::CBody* CRadioUtility::CBody::NewL(
     TBool aPrimaryClient )
     {
+    FUNC_LOG;
     CRadioUtility::CBody* self = new (ELeave) CRadioUtility::CBody();
     CleanupStack::PushL(self);
     self->ConstructL(aPrimaryClient);
-    CleanupStack::Pop();
+    CleanupStack::Pop(self);
     return self;
     }
 
@@ -47,6 +49,8 @@
 void CRadioUtility::CBody::ConstructL(
     TBool aPrimaryClient )
     {
+    FUNC_LOG;
+    INFO_1("Size of RRadioSession: %i", sizeof(RRadioSession) );
     iRadioSession = new (ELeave) RRadioSession();
     User::LeaveIfError(iRadioSession->Connect(*this, aPrimaryClient));
     }
@@ -62,6 +66,7 @@
         iPlayerUtility(NULL),
         iRdsUtility(NULL)
     {
+    FUNC_LOG;
     }
 
 // -----------------------------------------------------------------------------
@@ -70,9 +75,7 @@
 //
 CRadioUtility::CBody::~CBody()
     {
-#ifdef _DEBUG
-   RDebug::Print(_L("CRadioUtility::CBody::~CBody"));
-#endif
+    FUNC_LOG;
     delete iFmTunerUtility;
     delete iPlayerUtility;
     delete iRdsUtility;
@@ -91,9 +94,7 @@
 CRadioFmTunerUtility& CRadioUtility::CBody::RadioFmTunerUtilityL(
     MRadioFmTunerObserver& aObserver)
     {
-#ifdef _DEBUG
-   RDebug::Print(_L("CRadioUtility::CBody::RadioFmTunerUtilityL"));
-#endif
+    FUNC_LOG;
 
     if ( !iFmTunerUtility )
         {
@@ -116,9 +117,7 @@
 CRadioPlayerUtility& CRadioUtility::CBody::RadioPlayerUtilityL(
     MRadioPlayerObserver& aObserver)
     {
-#ifdef _DEBUG
-   RDebug::Print(_L("CRadioUtility::CBody::RadioPlayerUtilityL"));
-#endif
+    FUNC_LOG;
 
     if ( !iPlayerUtility )
         {
@@ -141,9 +140,7 @@
 CRadioRdsUtility& CRadioUtility::CBody::RadioRdsUtilityL(
     MRadioRdsObserver& aObserver)
     {
-#ifdef _DEBUG
-   RDebug::Print(_L("CRadioUtility::CBody::RadioRdsUtility"));
-#endif
+    FUNC_LOG;
 
     if ( !iRdsUtility )
         {
@@ -167,9 +164,7 @@
 void CRadioUtility::CBody::RequestTunerControlComplete(
     TRadioServerError aError )
     {
-#ifdef _DEBUG
-    RDebug::Print(_L("CRadioUtility::CBody::RequestTunerControlComplete"));
-#endif
+    FUNC_LOG;
     if ( iTunerObserver )
         {
         iTunerObserver->MrftoRequestTunerControlComplete( aError );
@@ -184,9 +179,7 @@
 void CRadioUtility::CBody::SetFrequencyRangeComplete(
     TRadioServerError aError )
     {
-#ifdef _DEBUG
-    RDebug::Print(_L("CRadioUtility::CBody::SetFrequencyRangeComplete"));
-#endif
+    FUNC_LOG;
     if ( iTunerObserver )
         {
         iTunerObserver->MrftoSetFrequencyRangeComplete( aError );
@@ -201,9 +194,7 @@
 void CRadioUtility::CBody::SetFrequencyComplete(
     TRadioServerError aError )
     {
-#ifdef _DEBUG
-    RDebug::Print(_L("CRadioUtility::CBody::SetFrequencyComplete"));
-#endif
+    FUNC_LOG;
     if ( iTunerObserver )
         {
         iTunerObserver->MrftoSetFrequencyComplete( aError );
@@ -219,9 +210,7 @@
     TRadioServerError aError,
     TInt aFrequency )
     {
-#ifdef _DEBUG
-    RDebug::Print(_L("CRadioUtility::CBody::StationSeekComplete"));
-#endif
+    FUNC_LOG;
     if ( iTunerObserver )
         {
         iTunerObserver->MrftoStationSeekComplete( aError, aFrequency );
@@ -236,9 +225,7 @@
 void CRadioUtility::CBody::RadioEventTransmitterStatusChange(
     TBool aActive )
     {
-#ifdef _DEBUG
-    RDebug::Print(_L("CRadioUtility::CBody::TransmitterStatusChange"));
-#endif
+    FUNC_LOG;
     if ( iTunerObserver )
         {
         iTunerObserver->MrftoFmTransmitterStatusChange( aActive );
@@ -253,9 +240,7 @@
 void CRadioUtility::CBody::RadioEventAntennaStatusChange(
     TBool aAttached )
     {
-#ifdef _DEBUG
-    RDebug::Print(_L("CRadioUtility::CBody::RadioEventAntennaStatusChange"));
-#endif
+    FUNC_LOG;
     if ( iTunerObserver )
         {
         iTunerObserver->MrftoAntennaStatusChange( aAttached );
@@ -270,9 +255,7 @@
 void CRadioUtility::CBody::RadioEventOfflineModeChange(
     TBool aOfflineMode )
     {
-#ifdef _DEBUG
-    RDebug::Print(_L("CRadioUtility::CBody::RadioEventOfflineModeChange Start offline mode = %d"), aOfflineMode);
-#endif
+    FUNC_LOG;
     if ( iTunerObserver )
         {
         iTunerObserver->MrftoOfflineModeStatusChange( aOfflineMode );
@@ -287,9 +270,7 @@
 void CRadioUtility::CBody::RadioEventFrequencyRangeChanged(
     TRsFrequencyRange aNewRange )
     {
-#ifdef _DEBUG
-    RDebug::Print(_L("CRadioUtility::CBody::RadioEventFrequencyRangeChanged"));
-#endif
+    FUNC_LOG;
 
     if ( iTunerObserver )
         {
@@ -318,9 +299,7 @@
 void CRadioUtility::CBody::RadioEventFrequencyChange(
     TInt aNewFrequency )
     {
-#ifdef _DEBUG
-    RDebug::Print(_L("CRadioUtility::CBody::RadioEventFrequencyChange"));
-#endif
+    FUNC_LOG;
     if ( iTunerObserver )
         {
         iTunerObserver->MrftoFrequencyChange( aNewFrequency );
@@ -335,9 +314,7 @@
 void CRadioUtility::CBody::RadioEventForcedMonoChanged(
     TBool aForceMono )
     {
-#ifdef _DEBUG
-    RDebug::Print(_L("CRadioUtility::CBody::RadioEventForcedMonoChanged"));
-#endif
+    FUNC_LOG;
     if ( iTunerObserver )
         {
         iTunerObserver->MrftoForcedMonoChange( aForceMono );
@@ -352,9 +329,7 @@
 void CRadioUtility::CBody::RadioEventSquelchChanged(
     TBool aSquelch )
     {
-#ifdef _DEBUG
-    RDebug::Print(_L("CRadioUtility::CBody::RadioEventSquelchChanged"));
-#endif
+    FUNC_LOG;
     if ( iTunerObserver )
         {
         iTunerObserver->MrftoSquelchChange( aSquelch );
@@ -370,9 +345,7 @@
     TBool aRadioOn,
     TRadioServerError aError )
     {
-#ifdef _DEBUG
-    RDebug::Print(_L("CRadioUtility::CBody::RadioEventStateChange"));
-#endif
+    FUNC_LOG;
     if ( iPlayerObserver )
         {
         TPlayerState state = ERadioPlayerIdle;
@@ -393,9 +366,7 @@
 void CRadioUtility::CBody::RadioEventVolumeChange(
     TInt aVolume )
     {
-#ifdef _DEBUG
-    RDebug::Print(_L("CRadioUtility::CBody::RadioEventVolumeChange"));
-#endif
+    FUNC_LOG;
     if ( iPlayerObserver )
         {
         iPlayerObserver->MrpoVolumeChange( aVolume );
@@ -410,9 +381,7 @@
 void CRadioUtility::CBody::RadioEventMuteChange(
     TBool aMute )
     {
-#ifdef _DEBUG
-    RDebug::Print(_L("CRadioUtility::CBody::RadioEventMuteChange"));
-#endif
+    FUNC_LOG;
     if ( iPlayerObserver )
         {
         iPlayerObserver->MrpoMuteChange( aMute );
@@ -428,9 +397,7 @@
     TInt aLeftPercentage,
     TInt aRightPercentage )
     {
-#ifdef _DEBUG
-    RDebug::Print(_L("CRadioUtility::CBody::RadioEventBalanceChange"));
-#endif
+    FUNC_LOG;
     if ( iPlayerObserver )
         {
         iPlayerObserver->MrpoBalanceChange( aLeftPercentage, aRightPercentage );
@@ -446,9 +413,7 @@
     TInt aError,
     TInt aFrequency )
     {
-#ifdef _DEBUG
-    RDebug::Print(_L("CRadioUtility::CBody::StationSeekByPTYComplete"));
-#endif
+    FUNC_LOG;
     if ( iRdsObserver )
         {
         iRdsObserver->MrroStationSeekByPTYComplete(aError, aFrequency );
@@ -465,9 +430,7 @@
     TInt aError,
     TInt aFrequency )
     {
-#ifdef _DEBUG
-    RDebug::Print(_L("CRadioUtility::CBody::StationSeekByTAComplete"));
-#endif
+    FUNC_LOG;
 
     if ( iRdsObserver )
         {
@@ -484,9 +447,7 @@
     TInt aError,
     TInt aFrequency )
     {
-#ifdef _DEBUG
-    RDebug::Print(_L("CRadioUtility::CBody::StationSeekByTPComplete"));
-#endif
+    FUNC_LOG;
 
     if ( iRdsObserver )
         {
@@ -503,9 +464,7 @@
     TInt aError,
     RArray<TInt>& aFreqList )
     {
-#ifdef _DEBUG
-    RDebug::Print(_L("CRadioUtility::CBody::GetFreqByPTYComplete"));
-#endif
+    FUNC_LOG;
     if ( iRdsObserver )
         {
         iRdsObserver->MrroGetFreqByPTYComplete( aError, aFreqList );
@@ -521,9 +480,7 @@
     TInt aError,
     RArray<TInt>& aFreqList )
     {
-#ifdef _DEBUG
-    RDebug::Print(_L("CRadioUtility::CBody::GetFreqByTAComplete"));
-#endif
+    FUNC_LOG;
     if ( iRdsObserver )
         {
         iRdsObserver->MrroGetFreqByTAComplete( aError, aFreqList );
@@ -539,9 +496,7 @@
     TInt aError,
     RArray<TRsRdsPSName>& aPsList )
     {
-#ifdef _DEBUG
-    RDebug::Print(_L("CRadioUtility::CBody::GetPSByPTYComplete"));
-#endif
+    FUNC_LOG;
     if ( iRdsObserver )
         {
         RArray<TRdsPSName> psList;
@@ -569,9 +524,7 @@
     TInt aError,
     RArray<TRsRdsPSName>& aPsList )
     {
-#ifdef _DEBUG
-    RDebug::Print(_L("CRadioUtility::CBody::GetPSByTAComplete"));
-#endif
+    FUNC_LOG;
     if ( iRdsObserver )
         {
         RArray<TRdsPSName> psList;
@@ -598,9 +551,7 @@
 void CRadioUtility::CBody::RadioEventRdsDataPI(
     TInt aPi )
     {
-#ifdef _DEBUG
-    RDebug::Print(_L("CRadioUtility::CBody::RadioEventRdsDataPI"));
-#endif
+    FUNC_LOG;
     if ( iRdsObserver )
         {
         iRdsObserver->MrroRdsDataPI( aPi );
@@ -615,9 +566,7 @@
 void CRadioUtility::CBody::RadioEventRdsDataPTY(
     TRsRdsProgrammeType aPty )
     {
-#ifdef _DEBUG
-    RDebug::Print(_L("CRadioUtility::CBody::RadioEventRdsDataPTY"));
-#endif
+    FUNC_LOG;
     if ( iRdsObserver )
         {
         iRdsObserver->MrroRdsDataPTY( aPty );
@@ -632,9 +581,7 @@
 void CRadioUtility::CBody::RadioEventRdsDataPS(
     TRsRdsPSName& aPs )
     {
-#ifdef _DEBUG
-    RDebug::Print(_L("CRadioUtility::CBody::RadioEventRdsDataPS"));
-#endif
+    FUNC_LOG;
     if ( iRdsObserver )
         {
         TRdsPSName ps;
@@ -655,9 +602,7 @@
 void CRadioUtility::CBody::RadioEventRdsDataRT(
     TRsRdsRadioText& aRt )
     {
-#ifdef _DEBUG
-    RDebug::Print(_L("CRadioUtility::CBody::RadioEventRdsDataRT"));
-#endif
+    FUNC_LOG;
     if ( iRdsObserver )
         {
         TRdsRadioText rt;
@@ -680,9 +625,7 @@
     TRsRdsRTplusClass aRtPlusClass,
     TRsRdsRadioText& aRtPlusData )
     {
-#ifdef _DEBUG
-    RDebug::Print(_L("CRadioUtility::CBody::RadioEventRdsDataRTplus"));
-#endif
+    FUNC_LOG;
     if ( iRdsObserver )
         {
         TRdsRTplusClass rtPlusClass;
@@ -706,9 +649,7 @@
 void CRadioUtility::CBody::RadioEventRdsDataCT(
     TDateTime& aCt )
     {
-#ifdef _DEBUG
-    RDebug::Print(_L("CRadioUtility::CBody::RadioEventRdsDataCT"));
-#endif
+    FUNC_LOG;
     if ( iRdsObserver )
         {
         iRdsObserver->MrroRdsDataCT( aCt );
@@ -723,9 +664,7 @@
 void CRadioUtility::CBody::RadioEventRdsDataTA(
     TBool aTaOn )
     {
-#ifdef _DEBUG
-    RDebug::Print(_L("CRadioUtility::CBody::RadioEventRdsDataTA"));
-#endif
+    FUNC_LOG;
     if ( iRdsObserver )
         {
         iRdsObserver->MrroRdsDataTA( aTaOn );
@@ -739,9 +678,7 @@
 //
 void CRadioUtility::CBody::RadioEventRdsSearchBeginAF()
     {
-#ifdef _DEBUG
-    RDebug::Print(_L("CRadioUtility::CBody::RadioEventRdsSearchBeginAF"));
-#endif
+    FUNC_LOG;
     if ( iRdsObserver )
         {
         iRdsObserver->MrroRdsSearchBeginAF();
@@ -758,9 +695,7 @@
     TInt aError,
     TInt aFrequency )
     {
-#ifdef _DEBUG
-    RDebug::Print(_L("CRadioUtility::CBody::RadioEventRdsSearchEndAF"));
-#endif
+    FUNC_LOG;
     if ( iRdsObserver )
         {
         iRdsObserver->MrroRdsSearchEndAF( aError, aFrequency );
@@ -775,9 +710,7 @@
 void CRadioUtility::CBody::RadioEventRdsStationChangeTA(
     TInt aFrequency )
     {
-#ifdef _DEBUG
-    RDebug::Print(_L("CRadioUtility::CBody::RadioEventRdsStationChangeTA"));
-#endif
+    FUNC_LOG;
     if ( iRdsObserver )
         {
         iRdsObserver->MrroRdsStationChangeTA( aFrequency );
@@ -792,9 +725,7 @@
 void CRadioUtility::CBody::RadioEventRdsAutomaticSwitchingChange(
     TBool aAuto )
     {
-#ifdef _DEBUG
-    RDebug::Print(_L("CRadioUtility::CBody::RadioEventRdsAutomaticSwitchingChange"));
-#endif
+    FUNC_LOG;
     if ( iRdsObserver )
         {
         iRdsObserver->MrroRdsEventAutomaticSwitchingChange( aAuto );
@@ -809,9 +740,7 @@
 void CRadioUtility::CBody::RadioEventRdsAutomaticTrafficAnnouncement(
     TBool aAuto )
     {
-#ifdef _DEBUG
-    RDebug::Print(_L("CRadioUtility::CBody::RadioEventRdsAutomaticTrafficAnnouncement"));
-#endif
+    FUNC_LOG;
     if ( iRdsObserver )
         {
         iRdsObserver->MrroRdsEventAutomaticTrafficAnnouncement( aAuto );
@@ -826,9 +755,7 @@
 void CRadioUtility::CBody::RadioEventRdsSignalChange(
     TBool aSignal )
     {
-#ifdef _DEBUG
-    RDebug::Print(_L("CRadioUtility::CBody::RadioEventRdsSignalChange"));
-#endif
+    FUNC_LOG;
     if ( iRdsObserver )
         {
         iRdsObserver->MrroRdsEventSignalChange( aSignal );
--- a/mmserv/radioutility/radioserver/Server/Src/RadioServer.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/radioutility/radioserver/Server/Src/RadioServer.cpp	Fri May 14 16:22:35 2010 +0300
@@ -491,6 +491,8 @@
     {
     RADIO_RDEBUG_INT3(_L("[RADIO-SVR] TunerOnComplete(%d) State[%d] Trigger[%d]"), aError, iState, iTunerOnTrigger);
     TFourCC radioFourCC;
+    // TBool antennaStatus = iSettings->IsAntennaAttached();
+    
     switch ( iTunerOnTrigger )
         {
         case ETriggerTunerControl:
@@ -559,10 +561,13 @@
             if ( aError == KErrNone )
                 {
                 iState = EStateTunerOn;
-                // AK - begin: to cause publishing (CPHU-73YTQW)
-                iSettings->SetAntennaStatus(EFalse, EFalse);
-                // - end
-                iSettings->SetAntennaStatus(ETrue);
+                if ( iSettings->IsAntennaAttached() )
+                    {
+                    // AK - begin: to cause publishing (CPHU-73YTQW)
+                    iSettings->SetAntennaStatus(EFalse, EFalse);
+                    // - end
+                    iSettings->SetAntennaStatus(ETrue);
+                    }
                 }
             // else
                 // Unable to turn the tuner back on. It's possible that after TunerOn request
@@ -594,6 +599,14 @@
         default:
             break;
         }
+    
+    if ( iSettings->IsAntennaAttached() == EFalse )
+        {
+        // antenna removed during TunerOn sequence, request TunerOff
+        // can not shutdown totally in TunerOffComplete thus set iState to EStateTunerOff
+        iState = EStateTunerOff;
+        iTunerControl->TunerOff();    
+        }
     }
 
 // -----------------------------------------------------------------------------
@@ -648,13 +661,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"));
+                }
             else
                 {
-                if( aError == KRadioServErrDuplicateRequest )
-                    {
-                    // tuner off and duplicate request going on, trace it out
-                    RADIO_RDEBUG(_L("[RADIO-SVR] TunerOffComplete() - EStateTunerOff - KRadioServErrDuplicateRequest"));
-                    }
+                RADIO_RDEBUG(_L("[RADIO-SVR] TunerOffComplete() - iState = EStateTunerOff;"));
                 }
             break;
         default:
--- a/mmserv/radioutility/radioserver/Server/Src/RadioServerShutdown.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/radioutility/radioserver/Server/Src/RadioServerShutdown.cpp	Fri May 14 16:22:35 2010 +0300
@@ -86,14 +86,6 @@
     }
 
 // -----------------------------------------------------------------------------
-// CRadioServerShutdown::DoCancel
-// -----------------------------------------------------------------------------
-//
-void CRadioServerShutdown::DoCancel()
-    {
-    }
-
-// -----------------------------------------------------------------------------
 // CRadioServerShutdown::RunL
 // -----------------------------------------------------------------------------
 //
--- a/mmserv/radioutility/radioserver/Server/Src/RadioServerShutdown.h	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/radioutility/radioserver/Server/Src/RadioServerShutdown.h	Fri May 14 16:22:35 2010 +0300
@@ -58,12 +58,6 @@
 
 	/**
 	 * From CTimer
-	 * Cancel the shutdown timer.
-	 */
-	void DoCancel();
-
-	/**
-	 * From CTimer
 	 * Timer has expired, stop the RadioServer.
 	 **/
 	void RunL();
--- a/mmserv/sts/bwins/systemtoneservice.def	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/sts/bwins/systemtoneservice.def	Fri May 14 16:22:35 2010 +0300
@@ -1,7 +1,7 @@
 EXPORTS
-	?Delete@CSystemToneService@@SAXPAV1@@Z @ 1 NONAME ; void CSystemToneService::Delete(class CSystemToneService *)
-	?StopTone@CSystemToneService@@QAEXI@Z @ 2 NONAME ; void CSystemToneService::StopTone(unsigned int)
-	?PlayTone@CSystemToneService@@QAEXW4TToneType@1@AAI@Z @ 3 NONAME ; void CSystemToneService::PlayTone(enum CSystemToneService::TToneType, unsigned int &)
+	?StopAlarm@CSystemToneService@@QAEXI@Z @ 1 NONAME ; void CSystemToneService::StopAlarm(unsigned int)
+	?Delete@CSystemToneService@@SAXPAV1@@Z @ 2 NONAME ; void CSystemToneService::Delete(class CSystemToneService *)
+	?PlayAlarm@CSystemToneService@@QAEXW4TAlarmType@1@AAIAAVMStsPlayAlarmObserver@@@Z @ 3 NONAME ; void CSystemToneService::PlayAlarm(enum CSystemToneService::TAlarmType, unsigned int &, class MStsPlayAlarmObserver &)
 	?Create@CSystemToneService@@SAPAV1@XZ @ 4 NONAME ; class CSystemToneService * CSystemToneService::Create(void)
 	?PlayTone@CSystemToneService@@QAEXW4TToneType@1@@Z @ 5 NONAME ; void CSystemToneService::PlayTone(enum CSystemToneService::TToneType)
 
--- a/mmserv/sts/eabi/systemtoneservice.def	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/sts/eabi/systemtoneservice.def	Fri May 14 16:22:35 2010 +0300
@@ -2,6 +2,6 @@
 	_ZN18CSystemToneService6CreateEv @ 1 NONAME
 	_ZN18CSystemToneService6DeleteEPS_ @ 2 NONAME
 	_ZN18CSystemToneService8PlayToneENS_9TToneTypeE @ 3 NONAME
-	_ZN18CSystemToneService8PlayToneENS_9TToneTypeERj @ 4 NONAME
-	_ZN18CSystemToneService8StopToneEj @ 5 NONAME
+	_ZN18CSystemToneService9PlayAlarmENS_10TAlarmTypeERjR21MStsPlayAlarmObserver @ 4 NONAME
+	_ZN18CSystemToneService9StopAlarmEj @ 5 NONAME
 
--- a/mmserv/sts/inc/sts.h	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/sts/inc/sts.h	Fri May 14 16:22:35 2010 +0300
@@ -32,9 +32,10 @@
 public:
     static CSts* Create();
     static void Delete(CSts* aSts);
-    void PlayTone(CSystemToneService::TToneType aToneType,
-            unsigned int& aPlayToneContext);
-    void StopTone(unsigned int aPlayToneContext);
+    void PlayTone(CSystemToneService::TToneType aTone);
+    void PlayAlarm(CSystemToneService::TAlarmType aAlarm,
+            unsigned int& aAlarmContext, MStsPlayAlarmObserver& aObserver);
+    void StopAlarm(unsigned int aAlarmContext);
 
 protected:
     CSts();
@@ -45,12 +46,13 @@
     void CleanUpPlayers();
 
     // inherited from MPlayerObserver
-    virtual void PlayToneComplete(unsigned int aPlayToneContext);
+    virtual void PlayComplete(unsigned int aContext);
 
 private:
     unsigned int iNextContext;
-    typedef std::map<unsigned int, CStsPlayer*> TPlayerMap;
-    TPlayerMap iMap;
+    class CPlayerNode;
+    typedef std::map<unsigned int, CPlayerNode*> TPlayerMap;
+    TPlayerMap iPlayerMap;
     };
 
 #endif //STS_H
--- a/mmserv/sts/inc/stsclientservercommon.h	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/sts/inc/stsclientservercommon.h	Fri May 14 16:22:35 2010 +0300
@@ -34,12 +34,27 @@
 // This type enumerates the client/server messages for the STS server.
 enum TStsServerCommandType
     {
+    StsMsg_RegisterMsgQueue,
     StsMsg_PlayTone,
-    StsMsg_StopTone,
+    StsMsg_PlayAlarm,
+    StsMsg_StopAlarm,
     StsMsg_ENDMARKER
     };
 
 const TStsServerCommandType KStsCmdLast =
         (TStsServerCommandType) ((int) StsMsg_ENDMARKER - 1);
 
+enum TStsCallBackType
+    {
+    EStsShutdown,
+    EStsPlayAlarmComplete
+    };
+
+struct TStsCallBack
+    {
+    TStsCallBackType callBackType;
+    MStsPlayAlarmObserver* observer;
+    unsigned int alarmContext;
+    };
+
 #endif // STSCLIENTSERVERCOMMON_H_
--- a/mmserv/sts/inc/stsimplementation.h	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/sts/inc/stsimplementation.h	Fri May 14 16:22:35 2010 +0300
@@ -31,8 +31,9 @@
 public:
     void PlayTone(CSystemToneService::TToneType aTone);
     void
-    PlayTone(CSystemToneService::TToneType aTone, unsigned int& aPlayToneContext);
-    void StopTone(unsigned int aPlayToneContext);
+    PlayAlarm(CSystemToneService::TAlarmType aAlarm,
+            unsigned int& aAlarmContext, MStsPlayAlarmObserver& aObserver);
+    void StopAlarm(unsigned int aAlarmContext);
 private:
     CStsImplementation();
     bool Init();
--- a/mmserv/sts/inc/stsplayer.h	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/sts/inc/stsplayer.h	Fri May 14 16:22:35 2010 +0300
@@ -24,21 +24,23 @@
 class MStsPlayerObserver
     {
 public:
-    virtual void PlayToneComplete(unsigned int aPlayToneContext) = 0;
+    virtual void PlayComplete(unsigned int aContext) = 0;
     };
 
 class CStsPlayer : private MMdaAudioPlayerCallback
     {
 public:
-    static CStsPlayer* Create(MStsPlayerObserver& aObserver,
-            CSystemToneService::TToneType aToneType, unsigned int aPlayToneContext);
+    static CStsPlayer* CreateTonePlayer(MStsPlayerObserver& aObserver,
+            CSystemToneService::TToneType aTone, unsigned int aContext);
+    static CStsPlayer* CreateAlarmPlayer(MStsPlayerObserver& aObserver,
+            CSystemToneService::TAlarmType aAlarm, unsigned int aContext);
     virtual ~CStsPlayer();
     void Play();
     void Stop();
 
 protected:
     CStsPlayer(MStsPlayerObserver& aObserver, const TDesC& aFileName,
-            int aRepeatNumberOfTimes, unsigned int aPlayToneContext);
+            int aRepeatNumberOfTimes, unsigned int aContext);
     bool Init();
 
 private:
@@ -50,7 +52,7 @@
     CMdaAudioPlayerUtility* iPlayer;
     TPtrC iFileName;
     int iRepeatNumberOfTimes;
-    unsigned int iPlayToneContext;
+    unsigned int iContext;
     };
 
 #endif // STSPLAYER_H_
--- a/mmserv/sts/src/systemtoneservice.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/sts/src/systemtoneservice.cpp	Fri May 14 16:22:35 2010 +0300
@@ -58,13 +58,13 @@
     iImplementation.PlayTone(aTone);
     }
 
-EXPORT_C void CSystemToneService::PlayTone(TToneType aTone,
-        unsigned int& aPlayToneContext)
+EXPORT_C void CSystemToneService::PlayAlarm(TAlarmType aAlarm,
+        unsigned int& aAlarmContext, MStsPlayAlarmObserver& aObserver)
     {
-    iImplementation.PlayTone(aTone, aPlayToneContext);
+    iImplementation.PlayAlarm(aAlarm, aAlarmContext, aObserver);
     }
 
-EXPORT_C void CSystemToneService::StopTone(unsigned int aPlayToneContext)
+EXPORT_C void CSystemToneService::StopAlarm(unsigned int aAlarmContext)
     {
-    iImplementation.StopTone(aPlayToneContext);
+    iImplementation.StopAlarm(aAlarmContext);
     }
--- a/mmserv/sts/stsimplementation/src/rstssession.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/sts/stsimplementation/src/rstssession.cpp	Fri May 14 16:22:35 2010 +0300
@@ -21,6 +21,62 @@
 
 const TUint KNumSlots = 30;
 
+/*static*/TInt RStsSession::CallBackThreadMain(TAny* aSession)
+    {
+    TInt err = KErrNoMemory;
+
+    RThread myThread;
+    myThread.SetPriority(EPriorityAbsoluteHigh);
+    myThread.Close();
+
+    CTrapCleanup* cleanup = CTrapCleanup::New();
+
+    if (cleanup)
+        {
+        // Run the server and request a thread rendezvous.
+        TRAP( err, ((RStsSession*)aSession)->RunThreadL() );
+        delete cleanup;
+        }
+
+    return err;
+    }
+
+void RStsSession::RunThreadL()
+    {
+    // Initialisation complete, now signal the client, if requested.
+    RThread::Rendezvous(KErrNone);
+
+    while (true)
+        {
+        TStsCallBack message;
+        iMsgQueue.ReceiveBlocking(message);
+        TStsCallBackType type = message.callBackType;
+        if (type == EStsPlayAlarmComplete)
+            {
+            message.observer->PlayAlarmComplete(message.alarmContext);
+            }
+        else if (type == EStsShutdown)
+            {
+            break;
+            }
+        else
+            {
+            //TODO: Log error message
+            }
+        }
+    }
+
+TInt RStsSession::StartMsgQueue()
+    {
+    // Create a nameless global message queue, then pass the handle to the queue to the server.
+    TInt err = iMsgQueue.CreateGlobal(KNullDesC, 30);
+    if (err == KErrNone)
+        {
+        err = SendReceive(StsMsg_RegisterMsgQueue, TIpcArgs(iMsgQueue));
+        }
+    return err;
+    }
+
 TInt RStsSession::StartServer()
     {
     TInt err = KErrNone;
@@ -37,36 +93,67 @@
         {
         TRequestStatus rendezvousStatus;
         server.Rendezvous(rendezvousStatus);
+        server.Resume();
 
-        if (rendezvousStatus != KRequestPending)
-            {
-            server.Kill(0); // abort startup
-            }
-        else
-            {
-            server.Resume(); // logon OK - start the server thread
-            } // end if
-
-        User::WaitForRequest(rendezvousStatus); // wait for start or death
+        // wait for start or death
+        User::WaitForRequest(rendezvousStatus);
 
         // we can't use the 'exit reason' if the server panicked as this
         // is the panic 'reason' and may be '0' which cannot be distinguished
         // from KErrNone  
-        err = (server.ExitType() == EExitPanic)
-                                                ? KErrGeneral
-                                                   : rendezvousStatus.Int();
-        server.Close();
+        if (server.ExitType() == EExitPanic)
+            {
+            err = KErrGeneral;
+            }
+        else
+            {
+            err = rendezvousStatus.Int();
+            }
         }
 
+    server.Close();
+
     return err;
     }
 
+TInt RStsSession::StartThread()
+    {
+    TInt result = iThread.Create(KNullDesC,
+            RStsSession::CallBackThreadMain, KDefaultStackSize,
+            &User::Heap(), (TAny*) this);
+
+    if (result == KErrNone)
+        {
+        TRequestStatus rendezvousStatus = KRequestPending;
+
+        //  Register for rendezvous notification when thread is started.
+        iThread.Rendezvous(rendezvousStatus);
+
+        // Start the thread execution
+        iThread.Resume();
+
+        // Wait for thread to start.
+        User::WaitForRequest(rendezvousStatus);
+
+        result = rendezvousStatus.Int();
+
+        if (result != KErrNone)
+            {
+            iThread.Kill(result);
+            }
+        }
+
+    return result;
+    }
+
 TInt RStsSession::Connect()
     {
+    // Try to create a session with the server
     TInt result = CreateSession(KStsServerName, TVersion(
             KStsServerMajorVersion, KStsServerMinorVersion, KStsServerBuild),
             KNumSlots, EIpcSession_Sharable);
 
+    // If the server wasn't found, start the server and try creating a session again
     if (result == KErrNotFound)
         {
         result = StartServer();
@@ -74,17 +161,17 @@
             {
             result = CreateSession(KStsServerName, TVersion(
                     KStsServerMajorVersion, KStsServerMinorVersion,
-                    KStsServerBuild), KNumSlots);
+                    KStsServerBuild), KNumSlots, EIpcSession_Sharable);
             }
         }
 
+    // Create thread for receiving asynch callbacks from the server
     if (result == KErrNone)
         {
-        result = ShareAuto();
-
-        if (result != KErrNone)
+        result = StartMsgQueue();
+        if (result == KErrNone)
             {
-            Close();
+            result = StartThread();
             }
         }
 
@@ -93,18 +180,28 @@
 
 void RStsSession::Close()
     {
+    TRequestStatus logonStatus = KRequestPending;
+    iThread.Logon(logonStatus);
     RSessionBase::Close();
+    User::WaitForRequest(logonStatus);
+    iThread.Close();
+    iMsgQueue.Close();
+    }
+
+TInt RStsSession::SendPlayTone(CSystemToneService::TToneType aTone)
+    {
+    return SendReceive(StsMsg_PlayTone, TIpcArgs(aTone));
     }
 
-TInt RStsSession::SendPlayTone(CSystemToneService::TToneType aToneType,
-        unsigned int& aPlayToneContext)
+TInt RStsSession::SendPlayAlarm(CSystemToneService::TAlarmType aAlarm,
+        unsigned int& aAlarmContext, MStsPlayAlarmObserver& aObserver)
     {
-    TPckg<unsigned int> playToneContextPckg(aPlayToneContext);
-    return SendReceive(StsMsg_PlayTone, TIpcArgs((TInt) aToneType,
-            &playToneContextPckg));
+    TPckg<unsigned int> alarmContextPckg(aAlarmContext);
+    return SendReceive(StsMsg_PlayAlarm, TIpcArgs(aAlarm, &alarmContextPckg,
+            &aObserver));
     }
 
-TInt RStsSession::SendStopTone(unsigned int aPlayToneContext)
+TInt RStsSession::SendStopAlarm(unsigned int aAlarmContext)
     {
-    return SendReceive(StsMsg_StopTone, TIpcArgs(aPlayToneContext));
+    return SendReceive(StsMsg_StopAlarm, TIpcArgs(aAlarmContext));
     }
--- a/mmserv/sts/stsimplementation/src/rstssession.h	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/sts/stsimplementation/src/rstssession.h	Fri May 14 16:22:35 2010 +0300
@@ -19,9 +19,11 @@
 #ifndef RSTSSESSION_H_
 #define RSTSSESSION_H_
 
-#include <e32std.h>
+#include <e32msgqueue.h>
 #include <systemtoneservice.h>
 
+#include "stsclientservercommon.h"
+
 class RStsSession : public RSessionBase
     {
 public:
@@ -30,15 +32,24 @@
 
     void Close();
 
-    TInt SendPlayTone(CSystemToneService::TToneType aToneType,
-            unsigned int& aPlayToneContext);
+    TInt SendPlayTone(CSystemToneService::TToneType aTone);
 
-    TInt SendStopTone(unsigned int aPlayToneContext);
+    TInt SendPlayAlarm(CSystemToneService::TAlarmType aAlarm,
+            unsigned int& aAlarmContext, MStsPlayAlarmObserver& aObserver);
+
+    TInt SendStopAlarm(unsigned int aAlarmContext);
 
 private:
 
+    static TInt CallBackThreadMain(TAny* aSession);
+    void RunThreadL();
+    
+    TInt StartMsgQueue();
     TInt StartServer();
+    TInt StartThread();
 
+    RThread iThread;
+    RMsgQueue<TStsCallBack> iMsgQueue;
     };
 
 #endif // RSTSSESSION_H_
--- a/mmserv/sts/stsimplementation/src/stsimplementation.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/sts/stsimplementation/src/stsimplementation.cpp	Fri May 14 16:22:35 2010 +0300
@@ -63,19 +63,18 @@
 
 void CStsImplementation::PlayTone(CSystemToneService::TToneType aTone)
     {
-    unsigned int playToneContext;
-    PlayTone(aTone, playToneContext);
+    iSession->SendPlayTone(aTone);
     }
 
-void CStsImplementation::PlayTone(CSystemToneService::TToneType aTone,
-        unsigned int& aPlayToneContext)
+void CStsImplementation::PlayAlarm(CSystemToneService::TAlarmType aAlarm,
+        unsigned int& aAlarmContext, MStsPlayAlarmObserver& aObserver)
     {
     //TODO: Add logging and error checking
-    iSession->SendPlayTone(aTone, aPlayToneContext);
+    iSession->SendPlayAlarm(aAlarm, aAlarmContext, aObserver);
     }
 
-void CStsImplementation::StopTone(unsigned int aPlayToneContext)
+void CStsImplementation::StopAlarm(unsigned int aAlarmContext)
     {
     //TODO: Add logging and error checking
-    iSession->SendStopTone(aPlayToneContext);
+    iSession->SendStopAlarm(aAlarmContext);
     }
--- a/mmserv/sts/stsplayer/src/sts.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/sts/stsplayer/src/sts.cpp	Fri May 14 16:22:35 2010 +0300
@@ -18,6 +18,51 @@
 
 #include "sts.h"
 
+class CSts::CPlayerNode
+    {
+public:
+    CPlayerNode(CStsPlayer* aPlayer);
+    CPlayerNode(CStsPlayer* aPlayer, MStsPlayAlarmObserver& aObserver);
+    ~CPlayerNode();
+    bool HasObserver();
+    CStsPlayer* Player();
+    MStsPlayAlarmObserver& Observer();
+private:
+    CStsPlayer* iPlayer;
+    MStsPlayAlarmObserver* iObserver;
+    };
+
+CSts::CPlayerNode::CPlayerNode(CStsPlayer* aPlayer) :
+    iPlayer(aPlayer), iObserver(0)
+    {
+    }
+
+CSts::CPlayerNode::CPlayerNode(CStsPlayer* aPlayer,
+        MStsPlayAlarmObserver& aObserver) :
+    iPlayer(aPlayer), iObserver(&aObserver)
+    {
+    }
+
+CSts::CPlayerNode::~CPlayerNode()
+    {
+    delete iPlayer;
+    }
+
+bool CSts::CPlayerNode::HasObserver()
+    {
+    return iObserver != 0;
+    }
+
+CStsPlayer* CSts::CPlayerNode::Player()
+    {
+    return iPlayer;
+    }
+
+MStsPlayAlarmObserver& CSts::CPlayerNode::Observer()
+    {
+    return *iObserver;
+    }
+
 /*static*/CSts* CSts::Create()
     {
     CSts* self = new CSts();
@@ -53,47 +98,84 @@
     CleanUpPlayers();
     }
 
-void CSts::PlayTone(CSystemToneService::TToneType aToneType,
-        unsigned int& aPlayToneContext)
+void CSts::PlayTone(CSystemToneService::TToneType aTone)
     {
-    CStsPlayer* player = CStsPlayer::Create(*this, aToneType, iNextContext);
+    CStsPlayer* player = CStsPlayer::CreateTonePlayer(*this, aTone,
+            iNextContext);
     if (player != 0)
         {
-        iMap[iNextContext] = player;
-        aPlayToneContext = iNextContext;
+        iPlayerMap[iNextContext] = new CPlayerNode(player);
         iNextContext++;
+        if (iNextContext == 0)
+            iNextContext++;
         player->Play();
         }
     else
         {
-        aPlayToneContext = 0;
+        //TODO: Add trace here
         }
     }
 
-void CSts::StopTone(unsigned int aPlayToneContext)
+void CSts::PlayAlarm(CSystemToneService::TAlarmType aAlarm,
+        unsigned int& aAlarmContext, MStsPlayAlarmObserver& aObserver)
     {
-    CStsPlayer* player = iMap[aPlayToneContext];
-    if (player)
+    CStsPlayer* player = CStsPlayer::CreateAlarmPlayer(*this, aAlarm,
+            iNextContext);
+    if (player != 0)
+        {
+        iPlayerMap[iNextContext] = new CPlayerNode(player, aObserver);
+        aAlarmContext = iNextContext;
+        iNextContext++;
+        if (iNextContext == 0)
+            iNextContext++;
+        player->Play();
+        }
+    else
         {
-        player->Stop();
-        PlayToneComplete(aPlayToneContext);
+        //TODO: Add trace here
+        aAlarmContext = 0;
+        }
+    }
+
+void CSts::StopAlarm(unsigned int aAlarmContext)
+    {
+    CPlayerNode* node = iPlayerMap[aAlarmContext];
+    iPlayerMap.erase(aAlarmContext);
+    if (node)
+        {
+        node->Player()->Stop();
+        delete node;
+        }
+    else
+        {
+        //TODO: Add trace here
         }
     }
 
 void CSts::CleanUpPlayers()
     {
-    for (TPlayerMap::iterator i = iMap.begin(); i != iMap.end(); i++)
-        {
-        StopTone(i->first);
-        }
+        while (!iPlayerMap.empty())
+            {
+            //TODO: Add trace here
+            StopAlarm(iPlayerMap.begin()->first);
+            }
     }
 
-void CSts::PlayToneComplete(unsigned int aPlayToneContext)
+void CSts::PlayComplete(unsigned int aContext)
     {
-    CStsPlayer* player = iMap[aPlayToneContext];
-    iMap[aPlayToneContext] = 0;
-    if (player)
+    CPlayerNode* node = iPlayerMap[aContext];
+    iPlayerMap.erase(aContext);
+    if (node)
         {
-        delete player;
+        CStsPlayer* player = node->Player();
+        if (node->HasObserver())
+            {
+            node->Observer().PlayAlarmComplete(aContext);
+            }
+        delete node;
+        }
+    else
+        {
+        // TODO: log unexpected error
         }
     }
--- a/mmserv/sts/stsplayer/src/stsplayer.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/sts/stsplayer/src/stsplayer.cpp	Fri May 14 16:22:35 2010 +0300
@@ -15,20 +15,46 @@
  * This file provides the implementation for creating and deleting a
  * an MMF based player for playing and stopping a tone playback.
  */
+
 #include "stsplayer.h"
+
 _LIT(KDefaultFile,"z:\\data\\sounds\\digital\\clock.aac");
 
-/*static*/CStsPlayer* CStsPlayer::Create(MStsPlayerObserver& aObserver,
-        CSystemToneService::TToneType aToneType, unsigned int aPlayToneContext)
+/*static*/CStsPlayer* CStsPlayer::CreateTonePlayer(
+        MStsPlayerObserver& aObserver, CSystemToneService::TToneType aTone,
+        unsigned int aContext)
     {
     CStsPlayer* self = 0;
-    switch (aToneType)
+    switch (aTone)
+        {
+        default:
+            self = new CStsPlayer(aObserver, KDefaultFile, 0, aContext);
+            break;
+        }
+    if (self != 0)
+        {
+        bool successful = self->Init();
+        if (!successful)
+            {
+            delete self;
+            self = 0;
+            }
+        }
+    return self;
+    }
+
+/*static*/CStsPlayer* CStsPlayer::CreateAlarmPlayer(
+        MStsPlayerObserver& aObserver, CSystemToneService::TAlarmType aAlarm,
+        unsigned int aContext)
+    {
+    CStsPlayer* self = 0;
+    switch (aAlarm)
         {
         case CSystemToneService::EClockAlarm:
-            self = new CStsPlayer(aObserver, KDefaultFile, 10, aPlayToneContext);
+            self = new CStsPlayer(aObserver, KDefaultFile, 10, aContext);
             break;
         default:
-            self = new CStsPlayer(aObserver, KDefaultFile, 0, aPlayToneContext);
+            self = new CStsPlayer(aObserver, KDefaultFile, 10, aContext);
             break;
         }
     if (self != 0)
@@ -44,10 +70,9 @@
     }
 
 CStsPlayer::CStsPlayer(MStsPlayerObserver& aObserver, const TDesC& aFileName,
-        int aRepeatNumberOfTimes, unsigned int aPlayToneContext) :
+        int aRepeatNumberOfTimes, unsigned int aContext) :
     iObserver(aObserver), iPlayer(0), iFileName(aFileName),
-            iRepeatNumberOfTimes(aRepeatNumberOfTimes), iPlayToneContext(
-                    aPlayToneContext)
+            iRepeatNumberOfTimes(aRepeatNumberOfTimes), iContext(aContext)
     {
     }
 
@@ -64,7 +89,15 @@
 
 void CStsPlayer::Play()
     {
-    TRAP_IGNORE(iPlayer->OpenFileL(iFileName));
+    // Play the tone
+    TRAPD(err, iPlayer->OpenFileL(iFileName));
+
+    // If there is an error, indicate that the playback is complete. 
+    if (err)
+        {
+        //TODO: Add trace here
+        iObserver.PlayComplete(iContext);
+        }
     }
 
 void CStsPlayer::Stop()
@@ -72,7 +105,8 @@
     iPlayer->Stop();
     }
 
-void CStsPlayer::MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& /*aDuration*/)
+void CStsPlayer::MapcInitComplete(TInt aError,
+        const TTimeIntervalMicroSeconds& /*aDuration*/)
     {
     if (aError == KErrNone)
         {
@@ -83,6 +117,8 @@
     else
         {
         //TODO: add trace
+        // Since there is an error, indicate that the playback is complete
+        iObserver.PlayComplete(iContext);
         }
     }
 
@@ -92,5 +128,5 @@
         {
         //TODO: add trace
         }
-    iObserver.PlayToneComplete(iPlayToneContext);
+    iObserver.PlayComplete(iContext);
     }
--- a/mmserv/sts/stsserver/src/stsserver.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/sts/stsserver/src/stsserver.cpp	Fri May 14 16:22:35 2010 +0300
@@ -20,7 +20,6 @@
 
 #include "stsserver.h"
 
-#include <ecom/ecom.h>
 #include "stsserversession.h"
 #include "sts.h"
 
@@ -80,7 +79,6 @@
     {
     iSessions.ResetAndDestroy();
     CSts::Delete(iSts);
-    REComSession::FinalClose();
     }
 
 CSession2* CStsServer::NewSessionL(const TVersion& aVersion, const RMessage2& /*aMessage*/) const
@@ -89,13 +87,18 @@
             != KStsServerMinorVersion || aVersion.iBuild != KStsServerBuild)
         {
         User::Leave(KErrNotSupported);
-        } // end if
+        }
+    else
+        {
+        //TODO: Add trace here
+        }// end if
 
     CStsServer& nonConstThis = *const_cast<CStsServer*> (this);
 
     // Construct a new session, passing it a pointer to the server object.  This function
     // is const, so the const-ness must be cast away from the this pointer.
-    CSession2* returnValue = new (ELeave) CStsServerSession(nonConstThis, *iSts);
+    CSession2* returnValue = new (ELeave) CStsServerSession(nonConstThis,
+            *iSts);
 
     return returnValue;
     }
@@ -114,6 +117,10 @@
         {
         // Remove the session from the list of sessions.
         iSessions.Remove(index);
+        }
+    else
+        {
+        //TODO: Add trace here
         } // end if
 
     if (iSessions.Count() == 0)
@@ -125,8 +132,7 @@
 
 // SERVER LAUNCHING FUNCTIONALITY
 
-EXPORT_C void CStsServer::RunServerL(bool aPerformProcessRendezvous,
-        bool aPerformThreadRendezvous)
+EXPORT_C void CStsServer::RunServerL()
     {
     // naming the server thread after the server helps to debug panics
     User::LeaveIfError(User::RenameThread(KStsServerName));
@@ -139,17 +145,8 @@
     // create the server (leave it on the cleanup stack)
     CStsServer* server = CStsServer::NewLC();
 
-    // Initialisation complete, now signal the client, if requested.
-
-    if (aPerformProcessRendezvous)
-        {
-        RProcess::Rendezvous(KErrNone);
-        }
-
-    if (aPerformThreadRendezvous)
-        {
-        RThread::Rendezvous(KErrNone);
-        }
+    // Initialisation complete, now signal the client.
+    RProcess::Rendezvous(KErrNone);
 
     // Ready to run
     // Start wait loop, will return when server is shutdown
--- a/mmserv/sts/stsserver/src/stsserver.h	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/sts/stsserver/src/stsserver.h	Fri May 14 16:22:35 2010 +0300
@@ -28,8 +28,7 @@
 public:
 
     // Runs the server on the current thread, and blocks until the server exits.
-    IMPORT_C static void RunServerL(bool aPerformProcessRendezvous = EFalse,
-            bool aPerformThreadRendezvous = EFalse);
+    IMPORT_C static void RunServerL();
 
     void AddSession(CStsServerSession* aSession);
 
--- a/mmserv/sts/stsserver/src/stsserverexe.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/sts/stsserver/src/stsserverexe.cpp	Fri May 14 16:22:35 2010 +0300
@@ -15,26 +15,27 @@
  * The file containt the main method of the STS Server.
  */
 
+#include <ecom/ecom.h>
 #include "stsserver.h"
-#include "stsclientservercommon.h"
 
 TInt E32Main()
     {
+    __UHEAP_MARK;
     TInt returnValue = KErrNoMemory;
 
     RThread myThread;
     myThread.SetPriority(EPriorityAbsoluteRealTime1);
-
-    __UHEAP_MARK;
-
+    myThread.Close();
+    
     CTrapCleanup* cleanup = CTrapCleanup::New();
 
     if (cleanup)
         {
         // Run the server and request a process rendezvous.
-        TRAP( returnValue, CStsServer::RunServerL( ETrue ) );
+        TRAP( returnValue, CStsServer::RunServerL() );
         delete cleanup;
         }
+    REComSession::FinalClose();
     __UHEAP_MARKEND;
 
     return returnValue;
--- a/mmserv/sts/stsserver/src/stsserversession.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/sts/stsserver/src/stsserversession.cpp	Fri May 14 16:22:35 2010 +0300
@@ -29,7 +29,11 @@
 
 CStsServerSession::~CStsServerSession()
     {
+    TStsCallBack callBack;
+    callBack.callBackType = EStsShutdown;
+    iMsgQueue.SendBlocking(callBack);
     iServer.DropSession(this);
+    iMsgQueue.Close();
     }
 
 void CStsServerSession::CreateL()
@@ -41,11 +45,17 @@
     {
     switch (aMessage.Function())
         {
+        case StsMsg_RegisterMsgQueue:
+            DoRegisterMsgQueueL(aMessage);
+            break;
         case StsMsg_PlayTone:
             DoPlayToneL(aMessage);
             break;
-        case StsMsg_StopTone:
-            DoStopToneL(aMessage);
+        case StsMsg_PlayAlarm:
+            DoPlayAlarmL(aMessage);
+            break;
+        case StsMsg_StopAlarm:
+            DoStopAlarmL(aMessage);
             break;
         default:
             break;
@@ -57,20 +67,54 @@
     CSession2::ServiceError(aMessage, aError);
     }
 
+void CStsServerSession::DoRegisterMsgQueueL(const RMessage2& aMessage)
+    {
+    TInt result = iMsgQueue.Open(aMessage, 0);
+
+    aMessage.Complete(result);
+    }
+
 void CStsServerSession::DoPlayToneL(const RMessage2& aMessage)
     {
-    CSystemToneService::TToneType toneType =
+    CSystemToneService::TToneType tone =
             (CSystemToneService::TToneType) aMessage.Int0();
+    aMessage.Complete(KErrNone);
+    iSts.PlayTone(tone);
+    }
+
+void CStsServerSession::DoPlayAlarmL(const RMessage2& aMessage)
+    {
+    CSystemToneService::TAlarmType alarm =
+            (CSystemToneService::TAlarmType) aMessage.Int0();
     unsigned int context = 0;
-    iSts.PlayTone(toneType, context);
+    iSts.PlayAlarm(alarm, context, *this);
+    iObserverMap[context] = (MStsPlayAlarmObserver*) aMessage.Ptr2();
     TPckg<unsigned int> contextPckg(context);
     TRAPD(err,aMessage.WriteL(1,contextPckg));
     aMessage.Complete(err);
+    // if the context is 0 there was a problem with the PlayAlarm,
+    // so trigger the PlayAlarmComplete callback.
+    if (context == 0)
+        {
+        PlayAlarmComplete(0);
+        }
     }
 
-void CStsServerSession::DoStopToneL(const RMessage2& aMessage)
+void CStsServerSession::DoStopAlarmL(const RMessage2& aMessage)
     {
     unsigned int context = aMessage.Int0();
     aMessage.Complete(KErrNone);
-    iSts.StopTone(context);
+    iObserverMap.erase(context);
+    iSts.StopAlarm(context);
     }
+
+void CStsServerSession::PlayAlarmComplete(unsigned int aAlarmContext)
+    {
+    //TODO: Trigger play complete callback to RSession
+    TStsCallBack callBack =
+        {
+        EStsPlayAlarmComplete, iObserverMap[aAlarmContext], aAlarmContext
+        };
+    iMsgQueue.SendBlocking(callBack);
+    iObserverMap.erase(aAlarmContext);
+    }
--- a/mmserv/sts/stsserver/src/stsserversession.h	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/sts/stsserver/src/stsserversession.h	Fri May 14 16:22:35 2010 +0300
@@ -20,13 +20,15 @@
 
 #include <e32base.h>
 #include <e32msgqueue.h>
+#include <map>
 
 #include "stsclientservercommon.h"
 
 class CSts;
 class CStsServer;
+class CStsPlayAlarmObserver;
 
-class CStsServerSession : public CSession2
+class CStsServerSession : public CSession2, private MStsPlayAlarmObserver
     {
 public:
 
@@ -41,12 +43,20 @@
 
 private:
 
+    void DoRegisterMsgQueueL(const RMessage2& aMessage);
     void DoPlayToneL(const RMessage2& aMessage);
-    void DoStopToneL(const RMessage2& aMessage);
+    void DoPlayAlarmL(const RMessage2& aMessage);
+    void DoStopAlarmL(const RMessage2& aMessage);
+
+    // inherited from MPlayAlarmObserver
+    virtual void PlayAlarmComplete(unsigned int aAlarmContext);
 
     CStsServer& iServer;
     CSts& iSts;
 
+    typedef std::map<unsigned int, MStsPlayAlarmObserver*> TObserverMap;
+    TObserverMap iObserverMap;
+    RMsgQueue<TStsCallBack> iMsgQueue;
     };
 
 #endif // STSSERVERSESSION_H_
--- a/mmserv/sts/tsrc/ststester/sis/ststester.pkg	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/sts/tsrc/ststester/sis/ststester.pkg	Fri May 14 16:22:35 2010 +0300
@@ -31,7 +31,7 @@
 :"Nokia"
 
 ;Add System Tone Service package
-@"../../../sis/systemtoneservice.sisx",(0x10207C90)
+;@"../../../sis/systemtoneservice.sisx",(0x10207C90)
 
 ;Files To Copy...<src> <destination>
 "/epoc32/release/armv5/udeb/ststester.exe"		         -"!:/sys/bin/ststester.exe"
--- a/mmserv/sts/tsrc/ststester/src/ststester.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/sts/tsrc/ststester/src/ststester.cpp	Fri May 14 16:22:35 2010 +0300
@@ -27,27 +27,61 @@
 
 const TOperationsPage KKeyMap[KKeyMapPageCount] =
     {
-        {STR("Standard controls"), 5, // default softkey index
-           {
-               // Enter
-               {STR(""),                   KOperation_ExecuteOption},
-               // Up / Down / Left / Right
-               {STR(""),                   KOperation_PreviousOption},
-               {STR(""),                   KOperation_NextOption},
-               {STR(""),                   KOperation_PreviousOptionPage},
-               {STR(""),                   KOperation_NextOptionPage},
-               // 0 - 9
-               {STR("Play Default Beep"),  EOperation_PlayDefaultBeep},
-               {STR("Play Clock Alarm"),   EOperation_PlayClockAlarm},
-               {STR("Stop Clock Alarm"),   EOperation_StopClockAlarm},
-               {STR(""),                   KOperation_None},
-               {STR(""),                   KOperation_None},
-               {STR(""),                   KOperation_None},
-               {STR(""),                   KOperation_None},
-               {STR(""),                   KOperation_None},
-               {STR(""),                   KOperation_None},
-               {STR("Exit"),               KOperation_Exit}
-           }
+        {
+        STR("Standard controls"), 5, // default softkey index
+                    {
+                    // Enter
+                                {
+                                STR(""), KOperation_ExecuteOption
+                                },
+                            // Up / Down / Left / Right
+                                {
+                                STR(""), KOperation_PreviousOption
+                                },
+                                {
+                                STR(""), KOperation_NextOption
+                                },
+                                {
+                                STR(""), KOperation_PreviousOptionPage
+                                },
+                                {
+                                STR(""), KOperation_NextOptionPage
+                                },
+                            // 0 - 9
+                                {
+                                        STR("Play Default Beep"),
+                                        EOperation_PlayDefaultBeep
+                                },
+                                {
+                                        STR("Play Clock Alarm"),
+                                        EOperation_PlayClockAlarm
+                                },
+                                {
+                                        STR("Stop Clock Alarm"),
+                                        EOperation_StopClockAlarm
+                                },
+                                {
+                                STR(""), KOperation_None
+                                },
+                                {
+                                STR(""), KOperation_None
+                                },
+                                {
+                                STR(""), KOperation_None
+                                },
+                                {
+                                STR(""), KOperation_None
+                                },
+                                {
+                                STR(""), KOperation_None
+                                },
+                                {
+                                STR(""), KOperation_None
+                                },
+                                {
+                                STR("Exit"), KOperation_Exit
+                                }
+                    }
         }
     };
 
@@ -67,7 +101,7 @@
 
 CStsTester::~CStsTester()
     {
-    CSystemToneService::Delete( iSts);
+    CSystemToneService::Delete(iSts);
     }
 
 void CStsTester::InitL()
@@ -78,15 +112,15 @@
 
 void CStsTester::Main()
     {
-    TRAP_IGNORE( MainL() );
+    TRAP_IGNORE(MainL());
     }
 
 void CStsTester::MainL()
     {
-    _LIT( KPlayDefault, "Play Default Beep" );
-    _LIT( KPlayClockAlarm, "Play Clock Alarm" );
-    _LIT( KStopClockAlarm, "Stop Clock Alarm" );
-    _LIT( KExit, "Exit");
+    _LIT(KPlayDefault, "Play Default Beep");
+    _LIT(KPlayClockAlarm, "Play Clock Alarm");
+    _LIT(KStopClockAlarm, "Stop Clock Alarm");
+    _LIT(KExit, "Exit");
 
     bool done = false;
 
@@ -98,8 +132,8 @@
         operations.Append(&KStopClockAlarm);
         operations.Append(&KExit);
 
-        TInt index = SelectFromListL(TPoint(0, 0), iDisplaySize,
-                _L("Select STS operation to perform:"), operations);
+        TInt index = SelectFromListL(TPoint(0, 0), iDisplaySize, _L(
+                "Select STS operation to perform:"), operations);
 
         operations.Reset();
 
@@ -144,8 +178,8 @@
             if (iPlayState != EPlaying)
                 {
                 TAG_TIME_PROFILING_BEGIN;
-                iSts->PlayTone(CSystemToneService::EClockAlarm,
-                        iCurrentContext);
+                iSts->PlayAlarm(CSystemToneService::EClockAlarm,
+                        iCurrentContext, *this);
                 TAG_TIME_PROFILING_END;
                 PRINT_TO_CONSOLE_TIME_DIFF;
                 iPlayState = EPlaying;
@@ -155,7 +189,7 @@
         case EOperation_StopClockAlarm:
             {
             TAG_TIME_PROFILING_BEGIN;
-            iSts->StopTone(iCurrentContext);
+            iSts->StopAlarm(iCurrentContext);
             TAG_TIME_PROFILING_END;
             PRINT_TO_CONSOLE_TIME_DIFF;
             iPlayState = EStopped;
@@ -167,3 +201,11 @@
             }
         }
     }
+
+void CStsTester::PlayAlarmComplete(unsigned int aAlarmContext)
+    {
+    if (aAlarmContext == iCurrentContext)
+        {
+        iPlayState = EStopped;
+        }
+    }
--- a/mmserv/sts/tsrc/ststester/src/ststester.h	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/sts/tsrc/ststester/src/ststester.h	Fri May 14 16:22:35 2010 +0300
@@ -19,8 +19,7 @@
 #define STSTESTER_H_
 
 #include "testappbase.h"
-
-class CSystemToneService;
+#include <systemtoneservice.h>
 
 enum TOperations
     {
@@ -29,7 +28,7 @@
     EOperation_StopClockAlarm
     };
 
-class CStsTester : public CTestAppBase
+class CStsTester : public CTestAppBase, MStsPlayAlarmObserver
     {
 public:
     // Methods
@@ -54,6 +53,9 @@
             const TDesC& aOperationText);
 
 private:
+    // inherited from MPlayAlarmObserver
+    virtual void PlayAlarmComplete(unsigned int aAlarmContext);
+    
     // Attributes
 
     enum TPlayState
--- a/mmserv/thumbnailengine/TneAPISrc/HXTneserver.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/thumbnailengine/TneAPISrc/HXTneserver.cpp	Fri May 14 16:22:35 2010 +0300
@@ -21,6 +21,8 @@
 #include"HXTneclientservercommon.h"
 #include <flogger.h>
 #include <f32file64.h>
+#include <e32math.h> // Sqrt
+#include <stdlib.h> // abs
 static const TInt kDefaultStack = 0x4000;
 
 
@@ -57,7 +59,7 @@
 
 
 
-const TInt KMaxPacketToDecode = 32;
+const TInt KMaxPacketToDecode = 160; // Many clips begin with several seconds of logos / MPAA rating which need to be skipped
 
 //////////////Server///////////////
 
@@ -688,51 +690,126 @@
         }
 }
 
+/* Determines whether a frame contains sufficient data to be considered an useful frame.
+ * The logic scans a set of pixels to confirm:
+ * too bright or too dark pixels are not taken into account. Only mid brightness pixels will be considered
+ * if less than minSamples valid samples the frame is rejected. 
+ * if the mode is more frequent than maxModePrct% the frame is rejected. This is useful to reject the MPAA rating or other simple logos
+ * if the contrast is too low (max - min) frame is rejected
+ * if the standard deviation is too low frame is rejected.
+ */
+
 TBool CTneSession::IsGoodFrame(TUint8* aYUVDataPtr)
 {
-	
  	TInt i;
+    TInt ySize = iWidth*iHeight; 
+    TUint8 * resetYUVPtr = aYUVDataPtr;
+
+    // only these luminances are taken into account
+    TInt minSamples = 5;
+    TInt tooDark = 30;
+    TInt tooBright = 240;
+
+    // Defines how much data we analyze from the image to analyze its validity
+    TInt pixelSkips = iHeight;  // scans about 1 to 3 pixels per line depending on aspect ratio 
+
+    // average luminance profiling
+    TInt runningSum = 0;
+    TInt numberOfSamples = 0;
+    TInt averageValue = 0;
+
+    // contrast profiling
     TInt minValue = 255;
     TInt maxValue = 0;
+    TInt minMaxDeltaThreshold = 20;
+
+    // mode profiling
+    int mode = 0;
+    int modeSamples = 0;
+    int histogram[255] = {0};
+    int maxModePrct = 69;
+
+    // standard deviation profiling
+    TInt minStdDeviation = 5;
+    TUint32 residualsum = 0;
+    TReal stdDeviation = 0;
+
+    // Exit value
     TBool goodFrame = ETrue;
-    TInt runningSum=0;
-    TInt averageValue=0;
-    TInt pixelSkips = 4;
-    TInt numberOfSamples=0;
-    TInt minMaxDeltaThreshold = 20; 
-    TInt extremeRegionThreshold = 20; 
-    TInt ySize = iWidth*iHeight; 
-    
-    // gather image statistics
-    for(i=0, numberOfSamples=0; i<ySize; i+=pixelSkips, aYUVDataPtr+=pixelSkips, numberOfSamples++)
+
+    for(i=0, numberOfSamples=0; i<ySize; i+=pixelSkips, aYUVDataPtr+=pixelSkips)
     {
-        
-        
-        runningSum += *aYUVDataPtr;
-        if(*aYUVDataPtr > maxValue)
-            maxValue = *aYUVDataPtr;
-        if(*aYUVDataPtr < minValue)
-            minValue = *aYUVDataPtr;
+        if ( (*aYUVDataPtr>tooDark) && (*aYUVDataPtr<tooBright) )
+        {
+            runningSum += *aYUVDataPtr;
+            if(*aYUVDataPtr > maxValue)
+                maxValue = *aYUVDataPtr;
+            if(*aYUVDataPtr < minValue)
+                minValue = *aYUVDataPtr;
+            histogram[*aYUVDataPtr]++;
+            numberOfSamples++;
+        }
+    }
+
+    if (numberOfSamples < minSamples)
+    {
+        //FLOG(_L("CTneSession::IsGoodFrame too few good samples"));
+        goodFrame = EFalse;
     }
-    //VDASSERT(numberOfSamples,10);
-    if (numberOfSamples == 0)
+    else
     {
-        FLOG(_L("CTneSession::IsGoodFrame numberOfSamples is zero")); 
-    }
-    else 
-    {
-        averageValue = runningSum/numberOfSamples;
-    }
+        // Find the mode
+        for (i=0; i<255; i++)
+        {
+            if (histogram[i] > modeSamples)
+            {
+                modeSamples = histogram[i];
+                mode = i;
+            }
+        }
+        // Add the mode and most immediate values, as compression may add artifacts that disperse its value
+        for (i = mode-2, modeSamples = 0; i < mode+3; i++)
+        {
+            modeSamples += histogram[i];
+        }
     
-    // make decision based statistics
-    if((maxValue - minValue) < minMaxDeltaThreshold)
-        goodFrame = EFalse;
-    else 
-    {
-        if(averageValue < (minValue + extremeRegionThreshold) || 
-            averageValue > (maxValue - extremeRegionThreshold))
-            goodFrame = EFalse;
+        if (modeSamples * 100 / numberOfSamples > maxModePrct)
+        {
+            //FLOG(_L("Mode (%d) in over %d%% of the image\n", mode, modeSamples * 100 / numberOfSamples);
+            goodFrame = false;
+        }
+        else 
+        {
+            averageValue = runningSum / numberOfSamples;
+            // Rescan the frame now that we the average value is known
+            aYUVDataPtr = resetYUVPtr;
+    
+    
+            // Calculate the sum of residuals: (pixel - avgpixel)^2
+            for(i=0; i<ySize; i+=pixelSkips, aYUVDataPtr+=pixelSkips)
+            {
+                if ( (*aYUVDataPtr>tooDark) && (*aYUVDataPtr<tooBright) )
+                {
+                    residualsum += (*aYUVDataPtr - averageValue) * (*aYUVDataPtr - averageValue);
+                }
+            }
+    
+            // Get the standard deviation
+            Math::Sqrt(stdDeviation , residualsum / numberOfSamples);
+    
+            if (stdDeviation < minStdDeviation)
+            {
+                //FLOG(_L("CTneSession::IsGoodFrame too low StdDeviation: %f"), stdDeviation);
+                goodFrame = EFalse;
+            }
+            else if((maxValue - minValue) < minMaxDeltaThreshold)
+            {
+                //FLOG(_L("CTneSession::IsGoodFrame too little difference between brightest and darkest pixel"));
+                goodFrame = EFalse;
+            }
+        }
     }
+
     return goodFrame;
 }
 
--- a/mmserv/tms/inc/tmsbufferimpl.h	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/tms/inc/tmsbufferimpl.h	Fri May 14 16:22:35 2010 +0300
@@ -29,13 +29,9 @@
 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/tmseffectimpl.h	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/tms/inc/tmseffectimpl.h	Fri May 14 16:22:35 2010 +0300
@@ -29,13 +29,9 @@
 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	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/tms/inc/tmsformatimpl.h	Fri May 14 16:22:35 2010 +0300
@@ -30,15 +30,9 @@
 class TMSFormatImpl : public TMSFormat
     {
 public:
-    virtual ~TMSFormatImpl();
     IMPORT_C static gint Create(TMSFormatType formattype,
             TMSFormat*& tmsformat);
     IMPORT_C static gint Delete(TMSFormat*& tmsformat);
-
-    gint SetProxy(TMSCallProxy* aProxy, gpointer queuehandler);
-
-private:
-    TMSFormatImpl();
     };
 
 } //namespace TMS
--- a/mmserv/tms/inc/tmssinkimpl.h	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/tms/inc/tmssinkimpl.h	Fri May 14 16:22:35 2010 +0300
@@ -29,12 +29,8 @@
 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/tmscallserver/inc/tmscsdownlink.h	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/tms/tmscallserver/inc/tmscsdownlink.h	Fri May 14 16:22:35 2010 +0300
@@ -15,8 +15,8 @@
  *
  */
 
-#ifndef CSDOWNLINK_H
-#define CSDOWNLINK_H
+#ifndef TMSCSDOWNLINK_H
+#define TMSCSDOWNLINK_H
 
 #include <glib.h>
 #include "tmscsdevsound.h"
@@ -89,4 +89,4 @@
 
 } //namespace TMS
 
-#endif // CSDOWNLINK_H
+#endif // TMSCSDOWNLINK_H
--- a/mmserv/tms/tmscallserver/inc/tmscsuplink.h	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/tms/tmscallserver/inc/tmscsuplink.h	Fri May 14 16:22:35 2010 +0300
@@ -15,8 +15,8 @@
  *
  */
 
-#ifndef CS_UPLINK_H
-#define CS_UPLINK_H
+#ifndef TMSCSUPLINK_H
+#define TMSCSUPLINK_H
 
 #include <glib.h>
 #include "tmscsdevsound.h"
@@ -101,4 +101,4 @@
 
 } //namespace TMS
 
-#endif // CS_UPLINK_H
+#endif // TMSCSUPLINK_H
--- a/mmserv/tms/tmscallserver/src/tmscallcsadpt.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/tms/tmscallserver/src/tmscallcsadpt.cpp	Fri May 14 16:22:35 2010 +0300
@@ -1017,7 +1017,7 @@
 gint TMSCallCSAdpt::ContinueDTMF(TBool continuesending)
     {
     TRACE_PRN_FN_ENT;
-    gint status(TMS_RESULT_SUCCESS);
+    gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
 
     if (iDTMFUplinkPlayer)
         {
--- a/mmserv/tms/tmsimpl/eabi/tmsimpl.def	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/tms/tmsimpl/eabi/tmsimpl.def	Fri May 14 16:22:35 2010 +0300
@@ -23,95 +23,93 @@
 	_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
+	_ZTIN3TMS13TMSStreamImplE @ 25 NONAME
+	_ZTIN3TMS15TMSCallBodyImplE @ 26 NONAME
+	_ZTIN3TMS15TMSDTMFBodyImplE @ 27 NONAME
+	_ZTIN3TMS15TMSRingToneImplE @ 28 NONAME
+	_ZTIN3TMS16TMSAMRFormatImplE @ 29 NONAME
+	_ZTIN3TMS16TMSMicSourceImplE @ 30 NONAME
+	_ZTIN3TMS16TMSModemSinkImplE @ 31 NONAME
+	_ZTIN3TMS16TMSPCMFormatImplE @ 32 NONAME
+	_ZTIN3TMS17TMSCSCallBodyImplE @ 33 NONAME
+	_ZTIN3TMS17TMSClientSinkImplE @ 34 NONAME
+	_ZTIN3TMS17TMSFormatBodyImplE @ 35 NONAME
+	_ZTIN3TMS17TMSG711FormatImplE @ 36 NONAME
+	_ZTIN3TMS17TMSG729FormatImplE @ 37 NONAME
+	_ZTIN3TMS17TMSGainEffectImplE @ 38 NONAME
+	_ZTIN3TMS17TMSILBCFormatImplE @ 39 NONAME
+	_ZTIN3TMS17TMSIPCallBodyImplE @ 40 NONAME
+	_ZTIN3TMS17TMSInbandToneImplE @ 41 NONAME
+	_ZTIN3TMS17TMSStreamBodyImplE @ 42 NONAME
+	_ZTIN3TMS18TMSModemSourceImplE @ 43 NONAME
+	_ZTIN3TMS18TMSSpeakerSinkImplE @ 44 NONAME
+	_ZTIN3TMS19TMSClientSourceImplE @ 45 NONAME
+	_ZTIN3TMS19TMSRingToneBodyImplE @ 46 NONAME
+	_ZTIN3TMS19TMSVolumeEffectImplE @ 47 NONAME
+	_ZTIN3TMS20TMSAMRFormatBodyImplE @ 48 NONAME
+	_ZTIN3TMS20TMSGlobalRoutingImplE @ 49 NONAME
+	_ZTIN3TMS20TMSMicSourceBodyImplE @ 50 NONAME
+	_ZTIN3TMS20TMSModemSinkBodyImplE @ 51 NONAME
+	_ZTIN3TMS20TMSPCMFormatBodyImplE @ 52 NONAME
+	_ZTIN3TMS21TMSClientSinkBodyImplE @ 53 NONAME
+	_ZTIN3TMS21TMSG711FormatBodyImplE @ 54 NONAME
+	_ZTIN3TMS21TMSG729FormatBodyImplE @ 55 NONAME
+	_ZTIN3TMS21TMSGainEffectBodyImplE @ 56 NONAME
+	_ZTIN3TMS21TMSILBCFormatBodyImplE @ 57 NONAME
+	_ZTIN3TMS21TMSInbandToneBodyImplE @ 58 NONAME
+	_ZTIN3TMS22TMSGlobalVolEffectImplE @ 59 NONAME
+	_ZTIN3TMS22TMSModemSourceBodyImplE @ 60 NONAME
+	_ZTIN3TMS22TMSSpeakerSinkBodyImplE @ 61 NONAME
+	_ZTIN3TMS23TMSClientSourceBodyImplE @ 62 NONAME
+	_ZTIN3TMS23TMSGlobalGainEffectImplE @ 63 NONAME
+	_ZTIN3TMS23TMSVolumeEffectBodyImplE @ 64 NONAME
+	_ZTIN3TMS24TMSGlobalRoutingBodyImplE @ 65 NONAME
+	_ZTIN3TMS26TMSGlobalVolEffectBodyImplE @ 66 NONAME
+	_ZTIN3TMS27TMSGlobalGainEffectBodyImplE @ 67 NONAME
+	_ZTVN3TMS11TMSCallImplE @ 68 NONAME
+	_ZTVN3TMS11TMSDTMFImplE @ 69 NONAME
+	_ZTVN3TMS12TMSMemBufferE @ 70 NONAME
+	_ZTVN3TMS13TMSStreamImplE @ 71 NONAME
+	_ZTVN3TMS15TMSCallBodyImplE @ 72 NONAME
+	_ZTVN3TMS15TMSDTMFBodyImplE @ 73 NONAME
+	_ZTVN3TMS15TMSRingToneImplE @ 74 NONAME
+	_ZTVN3TMS16TMSAMRFormatImplE @ 75 NONAME
+	_ZTVN3TMS16TMSMicSourceImplE @ 76 NONAME
+	_ZTVN3TMS16TMSModemSinkImplE @ 77 NONAME
+	_ZTVN3TMS16TMSPCMFormatImplE @ 78 NONAME
+	_ZTVN3TMS17TMSCSCallBodyImplE @ 79 NONAME
+	_ZTVN3TMS17TMSClientSinkImplE @ 80 NONAME
+	_ZTVN3TMS17TMSFormatBodyImplE @ 81 NONAME
+	_ZTVN3TMS17TMSG711FormatImplE @ 82 NONAME
+	_ZTVN3TMS17TMSG729FormatImplE @ 83 NONAME
+	_ZTVN3TMS17TMSGainEffectImplE @ 84 NONAME
+	_ZTVN3TMS17TMSILBCFormatImplE @ 85 NONAME
+	_ZTVN3TMS17TMSIPCallBodyImplE @ 86 NONAME
+	_ZTVN3TMS17TMSInbandToneImplE @ 87 NONAME
+	_ZTVN3TMS17TMSStreamBodyImplE @ 88 NONAME
+	_ZTVN3TMS18TMSModemSourceImplE @ 89 NONAME
+	_ZTVN3TMS18TMSSpeakerSinkImplE @ 90 NONAME
+	_ZTVN3TMS19TMSClientSourceImplE @ 91 NONAME
+	_ZTVN3TMS19TMSRingToneBodyImplE @ 92 NONAME
+	_ZTVN3TMS19TMSVolumeEffectImplE @ 93 NONAME
+	_ZTVN3TMS20TMSAMRFormatBodyImplE @ 94 NONAME
+	_ZTVN3TMS20TMSGlobalRoutingImplE @ 95 NONAME
+	_ZTVN3TMS20TMSMicSourceBodyImplE @ 96 NONAME
+	_ZTVN3TMS20TMSModemSinkBodyImplE @ 97 NONAME
+	_ZTVN3TMS20TMSPCMFormatBodyImplE @ 98 NONAME
+	_ZTVN3TMS21TMSClientSinkBodyImplE @ 99 NONAME
+	_ZTVN3TMS21TMSG711FormatBodyImplE @ 100 NONAME
+	_ZTVN3TMS21TMSG729FormatBodyImplE @ 101 NONAME
+	_ZTVN3TMS21TMSGainEffectBodyImplE @ 102 NONAME
+	_ZTVN3TMS21TMSILBCFormatBodyImplE @ 103 NONAME
+	_ZTVN3TMS21TMSInbandToneBodyImplE @ 104 NONAME
+	_ZTVN3TMS22TMSGlobalVolEffectImplE @ 105 NONAME
+	_ZTVN3TMS22TMSModemSourceBodyImplE @ 106 NONAME
+	_ZTVN3TMS22TMSSpeakerSinkBodyImplE @ 107 NONAME
+	_ZTVN3TMS23TMSClientSourceBodyImplE @ 108 NONAME
+	_ZTVN3TMS23TMSGlobalGainEffectImplE @ 109 NONAME
+	_ZTVN3TMS23TMSVolumeEffectBodyImplE @ 110 NONAME
+	_ZTVN3TMS24TMSGlobalRoutingBodyImplE @ 111 NONAME
+	_ZTVN3TMS26TMSGlobalVolEffectBodyImplE @ 112 NONAME
+	_ZTVN3TMS27TMSGlobalGainEffectBodyImplE @ 113 NONAME
 
--- a/mmserv/tms/tmsimpl/src/tmsbufferimpl.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/tms/tmsimpl/src/tmsbufferimpl.cpp	Fri May 14 16:22:35 2010 +0300
@@ -21,18 +21,6 @@
 
 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/tmseffectimpl.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/tms/tmsimpl/src/tmseffectimpl.cpp	Fri May 14 16:22:35 2010 +0300
@@ -24,18 +24,6 @@
 
 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/tmsformatimpl.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/tms/tmsimpl/src/tmsformatimpl.cpp	Fri May 14 16:22:35 2010 +0300
@@ -26,18 +26,6 @@
 
 using namespace TMS;
 
-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)
     {
     gint ret(TMS_RESULT_INSUFFICIENT_MEMORY);
--- a/mmserv/tms/tmsimpl/src/tmssinkimpl.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/tms/tmsimpl/src/tmssinkimpl.cpp	Fri May 14 16:22:35 2010 +0300
@@ -23,18 +23,6 @@
 
 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	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/tms/tmsimpl/src/tmssourceimpl.cpp	Fri May 14 16:22:35 2010 +0300
@@ -23,18 +23,6 @@
 
 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/tmsserver/inc/tmsaudioinbandtoneplayer.h	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/tms/tmsserver/inc/tmsaudioinbandtoneplayer.h	Fri May 14 16:22:35 2010 +0300
@@ -47,7 +47,7 @@
     /**
      * Destructor.
      */
-    ~TMSAudioInbandTonePlayer();
+    virtual ~TMSAudioInbandTonePlayer();
 
     /**
      * Plays given tone. Originates from CCP plugin.
--- a/mmserv/tms/tmsserver/inc/tmsaudiotoneutility.h	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/tms/tmsserver/inc/tmsaudiotoneutility.h	Fri May 14 16:22:35 2010 +0300
@@ -15,8 +15,8 @@
  *
  */
 
-#ifndef CPEAUDIOTONEUTILITY_H
-#define CPEAUDIOTONEUTILITY_H
+#ifndef TMSAUDIOTONEUTILITY_H
+#define TMSAUDIOTONEUTILITY_H
 
 #include <mdaaudiotoneplayer.h>
 
@@ -28,12 +28,11 @@
  */
 class TMSAudioToneUtility
     {
-
 public:
     /**
      * See CMdaAudioToneUtility::PrepareToPlayDesSequence.
      */
-    virtual void PrepareToPlayDesSequence(const TDesC8& aSequence ) = 0;
+    virtual void PrepareToPlayDesSequence(const TDesC8& aSequence) = 0;
 
     /**
      * See CMdaAudioToneUtility::State.
@@ -53,27 +52,24 @@
     /**
      * See CMdaAudioToneUtility::SetVolume.
      */
-    virtual void SetVolume( TInt aVolume ) = 0;
+    virtual void SetVolume(TInt aVolume) = 0;
 
     /**
      * See CMdaAudioToneUtility::SetRepeats.
      */
-    virtual void SetRepeats(
-        TInt aRepeatNumberOfTimes,
-        const TTimeIntervalMicroSeconds& aTrailingSilence ) = 0;
+    virtual void SetRepeats(TInt aRepeatNumberOfTimes,
+            const TTimeIntervalMicroSeconds& aTrailingSilence) = 0;
 
     /**
      * See CMdaAudioToneUtility::SetPriority.
      */
-    virtual void SetPriority(
-        TInt aPriority,
-        TMdaPriorityPreference aPref) = 0;
+    virtual void SetPriority(TInt aPriority, TMdaPriorityPreference aPref) = 0;
 
     /**
      * See CMdaAudioToneUtility::SetVolumeRamp.
      */
     virtual void SetVolumeRamp(
-        const TTimeIntervalMicroSeconds& aRampDuration) = 0;
+            const TTimeIntervalMicroSeconds& aRampDuration) = 0;
 
     /**
      * See CMdaAudioToneUtility::SetVolumeRamp.
@@ -89,4 +85,4 @@
 
 } //namespace TMS
 
-#endif // CPEAUDIOTONEUTILITY_H
+#endif // TMSAUDIOTONEUTILITY_H
--- a/mmserv/tms/tmsserver/src/tmsaudioinbandtoneplayer.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/tms/tmsserver/src/tmsaudioinbandtoneplayer.cpp	Fri May 14 16:22:35 2010 +0300
@@ -58,6 +58,9 @@
     {
     TRACE_PRN_FN_ENT;
     iFsSession.Close();
+    iCurrent->CancelPlay();
+    delete iCurrent;
+
     delete iPlayBeepSequence;
     delete iPlayNoSoundSequence;
     delete iPlayDataSequence;
@@ -68,7 +71,6 @@
     delete iResourceCongestionSeq;
     delete iResourceReorderSeq;
     delete iResourceBusySeq;
-    delete iCurrent;
     TRACE_PRN_FN_EXT;
     }
 
--- a/mmserv/tms/tmsserver/src/tmsaudiotoneutilityimpl.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/tms/tmsserver/src/tmsaudiotoneutilityimpl.cpp	Fri May 14 16:22:35 2010 +0300
@@ -25,6 +25,7 @@
 //
 TMSAudioToneUtilityImpl::TMSAudioToneUtilityImpl()
     {
+    iToneUtility = NULL;
     }
 
 // ---------------------------------------------------------------------------
--- a/mmserv/tms/tmsserver/src/tmsserver.cpp	Mon May 03 12:59:52 2010 +0300
+++ b/mmserv/tms/tmsserver/src/tmsserver.cpp	Fri May 14 16:22:35 2010 +0300
@@ -83,8 +83,8 @@
     iUplCodecs.Close();
     delete iEffectSettings;
     delete iTarHandler;
-    CancelCenRepHandler();
-    CancelDTMFNotifier();
+    delete iAudioCenRepHandler;
+    delete iDTMFHandler;
     DeinitRingTonePlayer();
     delete iTMSRtPlayer;
 
--- a/tsrc/group/bld.inf	Mon May 03 12:59:52 2010 +0300
+++ b/tsrc/group/bld.inf	Fri May 14 16:22:35 2010 +0300
@@ -33,7 +33,6 @@
 #include "../../mmmw_plat/call_audio_control_api/tsrc/Group/bld.inf"
 #include "../../mmmw_plat/radio_utilities_api/tsrc/Group/bld.inf"
 #include "../../mmmw_plat/thumbnail_engine_api/tsrc/group/bld.inf"
-#include "../../mmmw_plat/equalizer_ui_api/tsrc/group/bld.inf"
 #include "../../mmmw_plat/telephony_multimedia_service_api/tsrc/Group/Bld.inf"
 
 PRJ_MMPFILES