Revision: 2010wk32
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Thu, 02 Sep 2010 20:13:57 +0300
changeset 0 58be5850fb6c
child 1 e0d606d6e3b1
Revision: 2010wk32 Kit: 201035
bld.inf
build.config.xml
omxilcomp/omxilaudioemulator/group/bld.inf
omxilcomp/omxilaudioemulator/group/omxilcompref.iby
omxilcomp/omxilaudioemulator/pcmcapturer/group/bld.inf
omxilcomp/omxilaudioemulator/pcmcapturer/mmpfiles/omxilmicsource.mmp
omxilcomp/omxilaudioemulator/pcmcapturer/src/log.h
omxilcomp/omxilaudioemulator/pcmcapturer/src/omxilmicsource.cpp
omxilcomp/omxilaudioemulator/pcmcapturer/src/omxilmicsource.h
omxilcomp/omxilaudioemulator/pcmcapturer/src/omxilmicsource.hrh
omxilcomp/omxilaudioemulator/pcmcapturer/src/omxilmicsource.rss
omxilcomp/omxilaudioemulator/pcmcapturer/src/omxilmicsourceapb0port.cpp
omxilcomp/omxilaudioemulator/pcmcapturer/src/omxilmicsourceapb0port.h
omxilcomp/omxilaudioemulator/pcmcapturer/src/omxilmicsourceconst.h
omxilcomp/omxilaudioemulator/pcmcapturer/src/omxilmicsourceprocessingfunction.cpp
omxilcomp/omxilaudioemulator/pcmcapturer/src/omxilmicsourceprocessingfunction.h
omxilcomp/omxilaudioemulator/pcmcapturer/testscript/compconf_capturer_pcm.txt
omxilcomp/omxilaudioemulator/pcmrenderer/group/bld.inf
omxilcomp/omxilaudioemulator/pcmrenderer/inc/mdasoundadapter.h
omxilcomp/omxilaudioemulator/pcmrenderer/inc/omxilsymbianaudiopcmextensions.h
omxilcomp/omxilaudioemulator/pcmrenderer/mmpfiles/omxilpcmrenderer.mmp
omxilcomp/omxilaudioemulator/pcmrenderer/src/log.h
omxilcomp/omxilaudioemulator/pcmrenderer/src/mdasoundadapter.cpp
omxilcomp/omxilaudioemulator/pcmrenderer/src/mdasoundadapter.h
omxilcomp/omxilaudioemulator/pcmrenderer/src/mdasoundadapterbody.cpp
omxilcomp/omxilaudioemulator/pcmrenderer/src/mdasoundadapterbody.h
omxilcomp/omxilaudioemulator/pcmrenderer/src/omxilpcmrenderer.cpp
omxilcomp/omxilaudioemulator/pcmrenderer/src/omxilpcmrenderer.h
omxilcomp/omxilaudioemulator/pcmrenderer/src/omxilpcmrenderer.hrh
omxilcomp/omxilaudioemulator/pcmrenderer/src/omxilpcmrenderer.rss
omxilcomp/omxilaudioemulator/pcmrenderer/src/omxilpcmrendererapb0port.cpp
omxilcomp/omxilaudioemulator/pcmrenderer/src/omxilpcmrendererapb0port.h
omxilcomp/omxilaudioemulator/pcmrenderer/src/omxilpcmrendererconfigmanager.cpp
omxilcomp/omxilaudioemulator/pcmrenderer/src/omxilpcmrendererconfigmanager.h
omxilcomp/omxilaudioemulator/pcmrenderer/src/omxilpcmrendererconst.h
omxilcomp/omxilaudioemulator/pcmrenderer/src/omxilpcmrendererprocessingfunction.cpp
omxilcomp/omxilaudioemulator/pcmrenderer/src/omxilpcmrendererprocessingfunction.h
omxilcomp/omxilaudioemulator/pcmrenderer/src/rateconvert.cpp
omxilcomp/omxilaudioemulator/pcmrenderer/src/rateconvert.h
omxilcomp/omxilaudioemulator/pcmrenderer/src/rateconvertimpl.h
omxilcomp/omxilaudioemulator/pcmrenderer/unittest/bwins/tsu_omxil_pcmrenderer_01.def
omxilcomp/omxilaudioemulator/pcmrenderer/unittest/data/pcm16stereo44khz.raw
omxilcomp/omxilaudioemulator/pcmrenderer/unittest/data/pcm16stereo8khz.raw
omxilcomp/omxilaudioemulator/pcmrenderer/unittest/eabi/tsu_omxil_pcmrenderer_01.def
omxilcomp/omxilaudioemulator/pcmrenderer/unittest/group/bld.inf
omxilcomp/omxilaudioemulator/pcmrenderer/unittest/group/tsu_omxil_components.iby
omxilcomp/omxilaudioemulator/pcmrenderer/unittest/mmpfiles/tsu_omxil_pcmrenderer_01.mmp
omxilcomp/omxilaudioemulator/pcmrenderer/unittest/scripts/tsu_omxil_pcmrenderer_01.script
omxilcomp/omxilaudioemulator/pcmrenderer/unittest/src/log.h
omxilcomp/omxilaudioemulator/pcmrenderer/unittest/src/tsu_omxil_component_base.cpp
omxilcomp/omxilaudioemulator/pcmrenderer/unittest/src/tsu_omxil_component_base.h
omxilcomp/omxilaudioemulator/pcmrenderer/unittest/src/tsu_omxil_component_constants.h
omxilcomp/omxilaudioemulator/pcmrenderer/unittest/src/tsu_omxil_pcmrenderer_step.cpp
omxilcomp/omxilaudioemulator/pcmrenderer/unittest/src/tsu_omxil_pcmrenderer_step.h
omxilcomp/omxilaudioemulator/pcmrenderer/unittest/src/tsu_omxil_pcmrenderer_suite.cpp
omxilcomp/omxilaudioemulator/pcmrenderer/unittest/src/tsu_omxil_pcmrenderer_suite.h
omxilcomp/omxilaudioemulator/pcmrenderer/unittest/src/uids.hrh
omxilcomp/omxilgeneric/filesink/group/bld.inf
omxilcomp/omxilgeneric/filesink/group/omxilaudiofilesink.iby
omxilcomp/omxilgeneric/filesink/group/omxilimagefilesink.iby
omxilcomp/omxilgeneric/filesink/group/omxilotherfilesink.iby
omxilcomp/omxilgeneric/filesink/group/omxilvideofilesink.iby
omxilcomp/omxilgeneric/filesink/inc/omxilaudiofilesinkapb0port.h
omxilcomp/omxilgeneric/filesink/inc/omxilfilesink.h
omxilcomp/omxilgeneric/filesink/inc/omxilfilesink.hrh
omxilcomp/omxilgeneric/filesink/inc/omxilfilesinkconfigmanager.h
omxilcomp/omxilgeneric/filesink/inc/omxilfilesinkopb0port.h
omxilcomp/omxilgeneric/filesink/inc/omxilfilesinkprocessingfunction.h
omxilcomp/omxilgeneric/filesink/inc/omxilimagefilesinkipb0port.h
omxilcomp/omxilgeneric/filesink/inc/omxilotherfilesinkopb0port.h
omxilcomp/omxilgeneric/filesink/inc/omxilvideofilesinkvpb0port.h
omxilcomp/omxilgeneric/filesink/mmpfiles/omxilaudiofilesink.mmp
omxilcomp/omxilgeneric/filesink/mmpfiles/omxilimagefilesink.mmp
omxilcomp/omxilgeneric/filesink/mmpfiles/omxilotherfilesink.mmp
omxilcomp/omxilgeneric/filesink/mmpfiles/omxilvideofilesink.mmp
omxilcomp/omxilgeneric/filesink/src/omxilaudiofilesink.rss
omxilcomp/omxilgeneric/filesink/src/omxilaudiofilesinkapb0port.cpp
omxilcomp/omxilgeneric/filesink/src/omxilfilesink.cpp
omxilcomp/omxilgeneric/filesink/src/omxilfilesinkconfigmanager.cpp
omxilcomp/omxilgeneric/filesink/src/omxilfilesinkprocessingfunction.cpp
omxilcomp/omxilgeneric/filesink/src/omxilimagefilesink.rss
omxilcomp/omxilgeneric/filesink/src/omxilimagefilesinkipb0port.cpp
omxilcomp/omxilgeneric/filesink/src/omxilotherfilesink.rss
omxilcomp/omxilgeneric/filesink/src/omxilotherfilesinkopb0port.cpp
omxilcomp/omxilgeneric/filesink/src/omxilvideofilesink.rss
omxilcomp/omxilgeneric/filesink/src/omxilvideofilesinkvpb0port.cpp
omxilcomp/omxilgeneric/filesink/tests/khronos_conformance/Khronos_file_sink_audio.txt
omxilcomp/omxilgeneric/filesink/tests/khronos_conformance/Khronos_file_sink_image.txt
omxilcomp/omxilgeneric/filesink/tests/khronos_conformance/Khronos_file_sink_other.txt
omxilcomp/omxilgeneric/filesink/tests/khronos_conformance/Khronos_file_sink_video.txt
omxilcomp/omxilgeneric/filesink/tests/unit/te_omx_filesink.ini
omxilcomp/omxilgeneric/filesink/tests/unit/te_omx_filesink_audio.script
omxilcomp/omxilgeneric/filesink/tests/unit/te_omx_filesink_audio.xml
omxilcomp/omxilgeneric/filesink/tests/unit/te_omx_filesink_image.script
omxilcomp/omxilgeneric/filesink/tests/unit/te_omx_filesink_image.xml
omxilcomp/omxilgeneric/filesink/tests/unit/te_omx_filesink_other.script
omxilcomp/omxilgeneric/filesink/tests/unit/te_omx_filesink_other.xml
omxilcomp/omxilgeneric/filesink/tests/unit/te_omx_filesink_video.script
omxilcomp/omxilgeneric/filesink/tests/unit/te_omx_filesink_video.xml
omxilcomp/omxilgeneric/filesink/tests/unit/te_omx_filesink_video_compatibility.script
omxilcomp/omxilgeneric/filesink/tests/unit/te_omx_filesink_video_compatibility.xml
omxilcomp/omxilgeneric/filesource/group/bld.inf
omxilcomp/omxilgeneric/filesource/group/omxilaudiofilesource.iby
omxilcomp/omxilgeneric/filesource/group/omxilimagefilesource.iby
omxilcomp/omxilgeneric/filesource/group/omxilotherfilesource.iby
omxilcomp/omxilgeneric/filesource/group/omxilvideofilesource.iby
omxilcomp/omxilgeneric/filesource/inc/omxilaudiofilesourceapb0port.h
omxilcomp/omxilgeneric/filesource/inc/omxilfilesource.h
omxilcomp/omxilgeneric/filesource/inc/omxilfilesource.hrh
omxilcomp/omxilgeneric/filesource/inc/omxilfilesourceconfigmanager.h
omxilcomp/omxilgeneric/filesource/inc/omxilfilesourceopb0port.h
omxilcomp/omxilgeneric/filesource/inc/omxilfilesourceprocessingfunction.h
omxilcomp/omxilgeneric/filesource/inc/omxilimagefilesourceipb0port.h
omxilcomp/omxilgeneric/filesource/inc/omxilotherfilesourceopb0port.h
omxilcomp/omxilgeneric/filesource/inc/omxilvideofilesourcevpb0port.h
omxilcomp/omxilgeneric/filesource/mmpfiles/omxilaudiofilesource.mmp
omxilcomp/omxilgeneric/filesource/mmpfiles/omxilimagefilesource.mmp
omxilcomp/omxilgeneric/filesource/mmpfiles/omxilotherfilesource.mmp
omxilcomp/omxilgeneric/filesource/mmpfiles/omxilvideofilesource.mmp
omxilcomp/omxilgeneric/filesource/src/omxilaudiofilesource.rss
omxilcomp/omxilgeneric/filesource/src/omxilaudiofilesourceapb0port.cpp
omxilcomp/omxilgeneric/filesource/src/omxilfilesource.cpp
omxilcomp/omxilgeneric/filesource/src/omxilfilesourceconfigmanager.cpp
omxilcomp/omxilgeneric/filesource/src/omxilfilesourceprocessingfunction.cpp
omxilcomp/omxilgeneric/filesource/src/omxilimagefilesource.rss
omxilcomp/omxilgeneric/filesource/src/omxilimagefilesourceipb0port.cpp
omxilcomp/omxilgeneric/filesource/src/omxilotherfilesource.rss
omxilcomp/omxilgeneric/filesource/src/omxilotherfilesourceopb0port.cpp
omxilcomp/omxilgeneric/filesource/src/omxilvideofilesource.rss
omxilcomp/omxilgeneric/filesource/src/omxilvideofilesourcevpb0port.cpp
omxilcomp/omxilgeneric/filesource/tests/khronos_conformance/Khronos_file_source_audio.txt
omxilcomp/omxilgeneric/filesource/tests/khronos_conformance/Khronos_file_source_image.txt
omxilcomp/omxilgeneric/filesource/tests/khronos_conformance/Khronos_file_source_other.txt
omxilcomp/omxilgeneric/filesource/tests/khronos_conformance/Khronos_file_source_video.txt
omxilcomp/omxilgeneric/filesource/tests/unit/te_omx_filesource_audio.script
omxilcomp/omxilgeneric/filesource/tests/unit/te_omx_filesource_audio.xml
omxilcomp/omxilgeneric/filesource/tests/unit/te_omx_filesource_image.script
omxilcomp/omxilgeneric/filesource/tests/unit/te_omx_filesource_image.xml
omxilcomp/omxilgeneric/filesource/tests/unit/te_omx_filesource_other.script
omxilcomp/omxilgeneric/filesource/tests/unit/te_omx_filesource_other.xml
omxilcomp/omxilgeneric/filesource/tests/unit/te_omx_filesource_video.script
omxilcomp/omxilgeneric/filesource/tests/unit/te_omx_filesource_video.xml
omxilcomp/omxilgeneric/filesource/tests/unit/te_omx_filesrc.ini
omxilcomp/omxilgeneric/group/aac.stream
omxilcomp/omxilgeneric/group/aac.stream.length
omxilcomp/omxilgeneric/group/bld.inf
omxilcomp/omxilgeneric/group/cube-xvid-640x480-10fps-10s.3gp
omxilcomp/omxiltestcomp/group/bld.inf
omxilcomp/omxiltestcomp/md5sink/group/bld.inf
omxilcomp/omxiltestcomp/md5sink/group/omxiltestothermd5sink.iby
omxilcomp/omxiltestcomp/md5sink/group/omxiltestothermd5sink.mmp
omxilcomp/omxiltestcomp/md5sink/src/omxiltestmd5sink.cpp
omxilcomp/omxiltestcomp/md5sink/src/omxiltestmd5sink.h
omxilcomp/omxiltestcomp/md5sink/src/omxiltestmd5sink.hrh
omxilcomp/omxiltestcomp/md5sink/src/omxiltestmd5sinkconfigmanager.cpp
omxilcomp/omxiltestcomp/md5sink/src/omxiltestmd5sinkconfigmanager.h
omxilcomp/omxiltestcomp/md5sink/src/omxiltestmd5sinkconst.h
omxilcomp/omxiltestcomp/md5sink/src/omxiltestmd5sinkport.cpp
omxilcomp/omxiltestcomp/md5sink/src/omxiltestmd5sinkport.h
omxilcomp/omxiltestcomp/md5sink/src/omxiltestmd5sinkprocessingfunction.cpp
omxilcomp/omxiltestcomp/md5sink/src/omxiltestmd5sinkprocessingfunction.h
omxilcomp/omxiltestcomp/md5sink/src/omxiltestothermd5sink.rss
package_definition.xml
package_map.xml
sysdef_1_4_0.dtd
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bld.inf	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,21 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+#include "omxilcomp/omxilgeneric/group/bld.inf"
+#include "omxilcomp/omxilaudioemulator/group/bld.inf"
+#include "omxilcomp/omxiltestcomp/group/bld.inf"
+
+// Uggly hack for pcmrenderer tests which will not compile in NCP110 (due to missing testframework.h)
+// NOT built via xml files...
+#include "omxilcomp/omxilaudioemulator/pcmrenderer/unittest/group/bld.inf"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build.config.xml	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,36 @@
+<?xml version="1.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: For use by Sirocco build system
+
+-->
+
+<!DOCTYPE SystemDefinition SYSTEM "sysdef_1_4_0.dtd" [
+  <!ENTITY layer_real_source_path "/sf/adapt/openmaxil.nokia" >
+]>
+
+<SystemDefinition name="openmaxil.nokia" schema="1.4.0">
+  <systemModel>
+    <layer name="ncp_layer">
+      <module name="openmaxil.nokia">
+        <component name="omxilcomp">
+          <unit unitID="omxilcomp.omxilcomp" name="OpenMAX IL Components" mrp="" bldFile="&layer_real_source_path;/omxilcomp/omxilgeneric/group"/>
+          <unit unitID="omxilcomp.omxilaudioemulator" name="OpenMAX IL Emulator Components" mrp="" bldFile="&layer_real_source_path;/omxilcomp/omxilaudioemulator/group"/>
+          <unit unitID="omxilcomp.omxiltestcomp" name="OpenMAX IL Test Components" mrp="" bldFile="&layer_real_source_path;/omxilcomp/omxiltestcomp/group"/>
+        </component>
+      </module>
+    </layer>
+  </systemModel>
+</SystemDefinition>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/group/bld.inf	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,24 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+PRJ_EXPORTS
+
+// Romkit include files
+omxilcompref.iby							/epoc32/rom/include/omxilcompref.iby
+
+
+#include "../pcmrenderer/group/bld.inf"
+#include "../pcmcapturer/group/bld.inf"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/group/omxilcompref.iby	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,23 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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 OMXILCOMPREF_IBY
+#define OMXILCOMPREF_IBY
+
+
+// OMX IL Components
+ECOM_PLUGIN(omxilpcmrenderer.dll, omxilpcmrenderer.rsc)
+
+#endif // OMXILCOMPREF_IBY
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmcapturer/group/bld.inf	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,20 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifdef SYMBIAN_MM_OPENMAXIL_ADDITIONAL_COMPONENTS
+PRJ_MMPFILES
+// Components
+../mmpfiles/omxilmicsource.mmp
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmcapturer/mmpfiles/omxilmicsource.mmp	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,53 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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					
+@SYMPurpose
+*/
+
+#include				"../src/omxilmicsource.hrh"
+
+TARGET					omxilmicsource.dll
+CAPABILITY				ALL -TCB
+TARGETTYPE				plugin
+UID						0x10009D8D KUidSymbianOmxILMicSourceDll
+VENDORID				0x70000001
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+USERINCLUDE				../src
+
+SOURCEPATH				../src
+SOURCE					omxilmicsource.cpp
+SOURCE					omxilmicsourceapb0port.cpp
+SOURCE					omxilmicsourceprocessingfunction.cpp
+
+RESOURCE	 			omxilmicsource.rss
+
+LIBRARY					euser.lib
+LIBRARY					ecom.lib
+LIBRARY					omxilcomponentcommon.lib
+STATICLIBRARY			omxilcomponentif.lib
+
+// Uncomment to activate debug tracing in this module
+//MACRO					_OMXIL_MICSOURCE_DEBUG_TRACING_ON
+
+// In-context callback manager is now default
+// MACRO			_OMXIL_MICSOURCE_INCONTEXT_CALLBACKMANAGER_ON
+
+// Uncomment to activate dynamical device settings
+//MACRO					SYMBIAN_MICSOURCE_DYNAMIC_SETTINGS
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmcapturer/src/log.h	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,149 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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 __SWI_LOG_H__
+#define __SWI_LOG_H__
+
+#include <e32debug.h>
+
+namespace DSD
+{
+
+#ifdef _DEBUG
+
+#ifdef _OMXIL_MICSOURCE_DEBUG_TRACING_ON
+
+#define DEBUG_PRINTF(a) {DSD::DebugPrintf(__LINE__, __FILE__, a);}
+#define DEBUG_PRINTF2(a, b) {DSD::DebugPrintf(__LINE__, __FILE__, a, b);}
+#define DEBUG_PRINTF3(a, b, c) {DSD::DebugPrintf(__LINE__, __FILE__, a, b, c);}
+#define DEBUG_PRINTF4(a, b, c, d) {DSD::DebugPrintf(__LINE__, __FILE__, a, b, c, d);}
+#define DEBUG_PRINTF5(a, b, c, d, e) {DSD::DebugPrintf(__LINE__, __FILE__, a, b, c, d, e);}
+
+#define DEBUG_CODE_SECTION(a) TRAP_IGNORE({ a; }) 
+
+class TTruncateOverflowHandler16 : public TDes16Overflow
+	{
+	public:
+		virtual void Overflow( TDes16& aDes );
+	};
+	
+inline void TTruncateOverflowHandler16::Overflow( TDes16& aDes)
+	{
+	_LIT(KErrOverflowMsg,"Descriptor Overflow, hence value truncated");
+	if( aDes.MaxLength() >= KErrOverflowMsg().Length() + aDes.Length() )
+     	aDes.Append(KErrOverflowMsg);
+	}
+	
+class TTruncateOverflowHandler8 : public TDes8Overflow
+	{
+	public:
+		virtual void Overflow( TDes8& aDes );
+	};
+	
+inline void TTruncateOverflowHandler8::Overflow( TDes8& aDes)
+	{
+    _LIT(KErrOverflowMsg,"Descriptor Overflow, hence value truncated");
+	if( aDes.MaxLength() >= KErrOverflowMsg().Length() + aDes.Length() )
+     	aDes.Append(KErrOverflowMsg);
+	}
+
+// UTF-8 overload of the DebufPrintf method. Should be used by default,
+// since it's cheaper both in CPU cycles and stack space.
+
+inline void DebugPrintf(TInt aLine, char* aFile, TRefByValue<const TDesC8> aFormat, ...)
+	{
+	TTruncateOverflowHandler8 overflowHandler8;
+	VA_LIST list;
+	VA_START(list, aFormat);
+	
+	TTime now;
+	now.HomeTime();
+	
+	TBuf8<1024> buffer;
+	_LIT8(KSwiLogPrefix, "[pcmcapturer] ");
+	_LIT8(KSwiLineFileFormat, "TID[%d] : [%s:%d] -- ");
+	buffer.Append(KSwiLogPrefix);
+	RThread thread;
+	TUint threadId = thread.Id();
+	thread.Close();
+	RProcess proc;
+	TFileName fName = proc.FileName();
+	proc.Close();
+	buffer.AppendFormat(KSwiLineFileFormat, threadId, aFile, aLine);
+	buffer.AppendFormatList(aFormat, list ,&overflowHandler8 );
+	buffer.Append(_L8("\r\n"));
+	
+	RDebug::RawPrint(buffer);
+	
+	VA_END(list);
+	}
+	
+// Unicode DebufPrintf overload
+
+inline void DebugPrintf(TInt aLine, char* aFile, TRefByValue<const TDesC16> aFormat, ...)
+	{
+	TTruncateOverflowHandler16 overflowHandler16;
+	VA_LIST list;
+	VA_START(list, aFormat);
+	
+	TTime now;
+	now.HomeTime();
+	
+	TBuf8<256> header;
+	_LIT8(KSwiLogPrefix, "[pcmcapturer] ");
+	_LIT8(KSwiLineFileFormat, "%Ld Line: % 5d, File: %s -- ");
+	header.Append(KSwiLogPrefix);
+	header.AppendFormat(KSwiLineFileFormat, now.Int64(), aLine, aFile);
+	
+	TBuf<1024> buffer;
+	buffer.Copy(header);
+	buffer.AppendFormatList(aFormat, list ,&overflowHandler16);
+	buffer.Append(_L("\r\n"));
+	
+	RDebug::RawPrint(buffer);
+	
+	VA_END(list);
+	}
+#else
+
+#define DEBUG_PRINTF(a)
+#define DEBUG_PRINTF2(a, b)
+#define DEBUG_PRINTF3(a, b, c)
+#define DEBUG_PRINTF4(a, b, c, d)
+#define DEBUG_PRINTF5(a, b, c, d, e)
+
+#define DEBUG_CODE_SECTION(a)
+
+#endif
+
+#else
+
+#define DEBUG_PRINTF(a)
+#define DEBUG_PRINTF2(a, b)
+#define DEBUG_PRINTF3(a, b, c)
+#define DEBUG_PRINTF4(a, b, c, d)
+#define DEBUG_PRINTF5(a, b, c, d, e)
+
+#define DEBUG_CODE_SECTION(a)
+
+#endif //_OMXIL_MICSOURCE_DEBUG_TRACING_ON
+
+
+} // namespace DSD
+
+#endif // __SWI_LOG_H__
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmcapturer/src/omxilmicsource.cpp	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,225 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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
+   @internalComponent
+*/
+
+#include "log.h"
+#include <openmax/il/common/omxilclientclockport.h>
+#include <openmax/il/common/omxilconfigmanager.h>
+#include <openmax/il/common/omxilspecversion.h>
+#include <openmax/il/loader/omxilsymbiancomponentif.h>
+
+#include "omxilmicsource.h"
+#include "omxilmicsource.hrh"
+#include "omxilmicsourceconst.h"
+#include "omxilmicsourceapb0port.h"
+#include "omxilmicsourceprocessingfunction.h"
+
+OMXIL_COMPONENT_ECOM_ENTRYPOINT(KUidSymbianOmxILMicSource);
+
+// Component Entry Point
+OMX_ERRORTYPE OMX_ComponentInit(OMX_HANDLETYPE aComponent)
+	{
+	// This method should be called as a result of a OMX_GetHandle call. Let's
+	// return something that is consistent with the return codes allowed for
+	// that API call.	
+	return COmxILComponent::SymbianErrorToGetHandleError(COmxILMicSource::CreateComponent(aComponent));
+	}
+
+
+TInt
+COmxILMicSource::CreateComponent(OMX_HANDLETYPE aComponent)
+	{
+    DEBUG_PRINTF(_L8("COmxILMicSource::CreateComponent"));
+
+	COmxILMicSource* self = new COmxILMicSource();
+
+	if (!self)
+		{
+		return KErrNoMemory;
+		}
+
+	TRAPD(err, self->ConstructL(aComponent));
+	if (err != KErrNone)
+		{
+		delete self;
+		}
+	return err;
+
+	}
+
+void
+COmxILMicSource::ConstructL(OMX_HANDLETYPE aComponent)
+	{
+    DEBUG_PRINTF(_L8("COmxILMicSource::ConstructL"));
+
+	// STEP 1: Initialize the data received from the IL Core
+	COmxILComponent::ConstructL(aComponent);
+	
+	// STEP 2: Create the call backs manager...
+	MOmxILCallbackNotificationIf* callbackNotificationIf=CreateCallbackManagerL(COmxILComponent::EOutofContext);
+
+	// STEP 3: Create the audio capturer-specific Processing Function...
+	// Create the clock port first
+	COmxILClientClockPort*opb0Port = ConstructOPB0PortL();
+	CleanupStack::PushL(opb0Port);
+	
+	COmxILProcessingFunction* pProcessingFunction = 
+	        COmxILMicSourceProcessingFunction::NewL(*callbackNotificationIf, *opb0Port);
+    RegisterProcessingFunction(pProcessingFunction); 
+
+	// STEP 4: Create Port manager...
+	CreatePortManagerL(COmxILComponent::ENonBufferSharingPortManager,
+			iOmxILVersion,      // Component's OMX Version
+			1,					// The number of audio ports in this component
+			0,					// The starting audio port index
+			0,					// The number of image ports in this component
+			0,					// The starting image port index
+			0,					// The number of video ports in this component
+			0,					// The starting video port index
+			1,					// The number of other ports in this component
+			1					// The starting other port index
+		);
+
+	// STEP 5: Create audio capturer component port
+	COmxILMicSourceAPB0Port* apb0Port = ConstructAPB0PortL();
+	CleanupStack::PushL(apb0Port);
+	
+	// ..  and add them to the port manager...
+	User::LeaveIfError(AddPort(apb0Port, OMX_DirOutput));
+	CleanupStack::Pop();
+	User::LeaveIfError(AddPort(opb0Port, OMX_DirInput));
+	CleanupStack::Pop();
+	
+	// STEP 6: Create the non-port related configuration manager...
+	RPointerArray<TDesC8> componentRoles;
+	CleanupClosePushL(componentRoles);
+	componentRoles.AppendL(&KSymbianOmxILMicSourceRole());
+
+	COmxILConfigManager* pConfigManager  = COmxILConfigManager::NewL(
+											KSymbianOmxILMicSourceName,
+											TOmxILVersion(KMicSourceComponentVersionMajor,
+														  KMicSourceComponentVersionMinor,
+														  KMicSourceComponentVersionRevision,
+														  KMicSourceComponentVersionStep),
+											componentRoles);
+	RegisterConfigurationManager(pConfigManager);
+
+	CleanupStack::PopAndDestroy();	// componentRoles
+
+	// And finally, let's get everything started
+	InitComponentL();
+
+	}
+
+COmxILMicSource::COmxILMicSource()
+	:
+	iOmxILVersion(TOmxILSpecVersion())
+	{
+    DEBUG_PRINTF(_L8("COmxILMicSource::COmxILMicSource"));
+	}
+
+COmxILMicSource::~COmxILMicSource()
+	{
+    DEBUG_PRINTF(_L8("COmxILMicSource::~COmxILMicSource"));
+	}
+
+COmxILMicSourceAPB0Port*
+COmxILMicSource::ConstructAPB0PortL() const
+	{
+    DEBUG_PRINTF(_L8("COmxILMicSource::ConstructAPB0PortL"));
+
+	RArray<OMX_AUDIO_CODINGTYPE> supportedAudioFormats;
+	CleanupClosePushL(supportedAudioFormats);
+	supportedAudioFormats.AppendL(OMX_AUDIO_CodingPCM);
+
+	OMX_AUDIO_PARAM_PCMMODETYPE	paramPcmModeType;
+	paramPcmModeType.nSize				= sizeof(OMX_AUDIO_PARAM_PCMMODETYPE);
+	paramPcmModeType.nVersion			= iOmxILVersion;
+	paramPcmModeType.nPortIndex			= KMICSOURCE_APB0PORT_INDEX;
+
+	static_cast<COmxILMicSourceProcessingFunction*>(GetProcessingFunction())->FillParamPCMModeType(paramPcmModeType);
+
+	OMX_AUDIO_CONFIG_VOLUMETYPE	configAudioVolume;
+	configAudioVolume.nSize			 = sizeof(OMX_AUDIO_CONFIG_VOLUMETYPE);
+	configAudioVolume.nVersion		 = iOmxILVersion;
+	configAudioVolume.nPortIndex	 = KMICSOURCE_APB0PORT_INDEX;
+	configAudioVolume.bLinear		 = OMX_TRUE;
+	configAudioVolume.sVolume.nValue = static_cast<COmxILMicSourceProcessingFunction*>(GetProcessingFunction())->GetVolume();
+	configAudioVolume.sVolume.nMin	 = KMICSOURCE_VOLUME_MIN;
+	configAudioVolume.sVolume.nMax	 = KMICSOURCE_VOLUME_MAX;
+
+	OMX_AUDIO_CONFIG_MUTETYPE	configAudioMute;
+    configAudioMute.nSize	   = sizeof(OMX_AUDIO_CONFIG_MUTETYPE);
+	configAudioMute.nVersion   = iOmxILVersion;
+	configAudioMute.nPortIndex = KMICSOURCE_APB0PORT_INDEX;
+	configAudioMute.bMute	   = OMX_FALSE;
+
+	COmxILMicSourceAPB0Port* apb0Port = COmxILMicSourceAPB0Port::NewL(
+		TOmxILCommonPortData(
+			iOmxILVersion,				// OMX specification version information
+			KMICSOURCE_APB0PORT_INDEX,	// Port number the structure applies to
+			OMX_DirOutput,				// Direction of this port
+			KMICSOURCE_PCMPORT_BUFFERCOUNT_MIN,	// The minimum number of buffers this port requires
+			KMICSOURCE_PCMPORT_BUFFERSIZE_MIN,  // Minimum size, in bytes, for buffers to be used for this port
+			OMX_PortDomainAudio,		// Domain of the port
+			OMX_FALSE,					// Buffers contiguous requirement (true or false)
+			0,							// Buffer aligment requirements
+			OMX_BufferSupplyOutput,	// supplier preference when tunneling between two ports
+			0),
+		supportedAudioFormats,
+		paramPcmModeType,
+		configAudioVolume,
+		configAudioMute,
+		static_cast<COmxILMicSourceProcessingFunction&>(*(GetProcessingFunction()))
+		);
+
+	CleanupStack::PopAndDestroy(&supportedAudioFormats);
+	return apb0Port;
+	}
+
+COmxILClientClockPort*
+COmxILMicSource::ConstructOPB0PortL() const
+	{
+    DEBUG_PRINTF(_L8("COmxILMicSource::ConstructOPB0PortL"));
+
+    TOmxILCommonPortData portData(
+		iOmxILVersion,
+		KMICSOURCE_OPB0PORT_INDEX,		// port index
+		OMX_DirInput,
+		KMICSOURCE_CLOCKPORT_BUFFERCOUNT_MIN,// minimum number of buffers
+		sizeof(OMX_TIME_MEDIATIMETYPE), // minimum buffer size, in bytes
+		OMX_PortDomainOther,
+		OMX_FALSE,				// do not need contigious buffers
+		0,						// byte alignment
+		OMX_BufferSupplyUnspecified,
+		COmxILPort::KBufferMarkPropagationPortNotNeeded
+		);
+
+	// TODO: Clean up the code below. The supportedOtherFormats variable has been added in order to make
+	// this component compilable during integration from the MM projectintegration branch .
+	RArray<OMX_OTHER_FORMATTYPE> supportedOtherFormats;
+	CleanupClosePushL(supportedOtherFormats);
+	supportedOtherFormats.AppendL(OMX_OTHER_FormatTime);
+	COmxILClientClockPort* aClientClockPort = COmxILClientClockPort::NewL(portData, supportedOtherFormats);
+	CleanupStack::PopAndDestroy(&supportedOtherFormats);
+	
+	return aClientClockPort;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmcapturer/src/omxilmicsource.h	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,49 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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
+	@internalComponent
+*/
+
+#ifndef OMXILMICSOURCE_H
+#define OMXILMICSOURCE_H
+
+#include <openmax/il/common/omxilcomponent.h>
+
+// Forward declarations
+class COmxILMicSourceAPB0Port;
+class COmxILClientClockPort;
+
+NONSHARABLE_CLASS(COmxILMicSource) : public COmxILComponent
+	{
+public:
+	static  TInt CreateComponent(OMX_HANDLETYPE aComponent);
+	~COmxILMicSource();
+
+private:
+	COmxILMicSource();
+	void ConstructL(OMX_HANDLETYPE aComponent);
+
+	COmxILMicSourceAPB0Port* ConstructAPB0PortL() const;
+	COmxILClientClockPort* ConstructOPB0PortL() const;
+
+private:
+	const OMX_VERSIONTYPE iOmxILVersion;
+	};
+
+#endif // OMXILMICSOURCE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmcapturer/src/omxilmicsource.hrh	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,24 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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 OMXILMICSOURCE_HRH
+#define OMXILMICSOURCE_HRH
+
+#define KUidSymbianOmxILMicSourceDll        0x1028669F
+#define KUidSymbianOmxILMicSource           0x102866A0
+
+#endif // OMXILMICSOURCE_HRH
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmcapturer/src/omxilmicsource.rss	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,43 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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 <ecom/registryinfo.rh>
+#include <openmax/il/loader/omxilcomponentif.hrh>
+#include "omxilmicsource.hrh"
+
+RESOURCE REGISTRY_INFO theInfo
+	{
+	dll_uid = KUidSymbianOmxILMicSourceDll;
+	interfaces =
+		{
+		INTERFACE_INFO
+			{
+			interface_uid = KUidOmxILSymbianComponentIf;
+			implementations =
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid = KUidSymbianOmxILMicSource;
+					version_no = 1;
+					display_name = "OMX.NOKIA.AUDIO.CAPTURER.PCM";
+					default_data = "audio_capturer.pcm";
+					opaque_data  = "";
+					}
+				};
+			}
+		};
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmcapturer/src/omxilmicsourceapb0port.cpp	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,526 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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
+   @internalComponent
+*/
+
+#include <openmax/il/khronos/v1_x/OMX_Component.h>
+#include <openmax/il/common/omxilutil.h>
+
+#include "log.h"
+#include "omxilmicsourceapb0port.h"
+#include "omxilmicsourceprocessingfunction.h"
+
+_LIT8(KMimeTypeAudioPcm, "audio/pcm");
+
+COmxILMicSourceAPB0Port*
+COmxILMicSourceAPB0Port::NewL(
+	const TOmxILCommonPortData& aCommonPortData,
+	const RArray<OMX_AUDIO_CODINGTYPE>& aSupportedAudioFormats,
+	const OMX_AUDIO_PARAM_PCMMODETYPE& aParamAudioPcm,
+	const OMX_AUDIO_CONFIG_VOLUMETYPE& aConfigAudioVolume,
+	const OMX_AUDIO_CONFIG_MUTETYPE& aConfigAudioMute,
+	COmxILMicSourceProcessingFunction& aProcessingFunction)
+	{
+    DEBUG_PRINTF(_L8("COmxILMicSourceAPB0Port::NewL"));
+
+	COmxILMicSourceAPB0Port* self = 
+		new (ELeave)COmxILMicSourceAPB0Port(aParamAudioPcm,
+											aConfigAudioVolume,
+											aConfigAudioMute,
+											aProcessingFunction);
+
+	CleanupStack::PushL(self);
+	self->ConstructL(aCommonPortData, aSupportedAudioFormats);
+	CleanupStack::Pop(self);
+	return self;
+
+	}
+
+
+void
+COmxILMicSourceAPB0Port::ConstructL(const TOmxILCommonPortData& aCommonPortData, const RArray<OMX_AUDIO_CODINGTYPE>& aSupportedAudioFormats)
+	{
+	// base 
+	COmxILAudioPort::ConstructL(aCommonPortData, aSupportedAudioFormats);
+	
+    DEBUG_PRINTF(_L8("COmxILMicSourceAPB0Port::ConstructL"));
+    OMX_PARAM_PORTDEFINITIONTYPE& paramPortDefinition=GetParamPortDefinition();
+	// We have to finish with iParamPortDefinition
+    paramPortDefinition.eDomain = OMX_PortDomainAudio;
+    paramPortDefinition.format.audio.pNativeRender = 0;
+
+	iMimeTypeBuf.CreateL(KMimeTypeAudioPcm(), KMimeTypeAudioPcm().Length() + 1);
+
+	TUint8* pTUint2 = const_cast<TUint8*>(iMimeTypeBuf.PtrZ());
+	paramPortDefinition.format.audio.cMIMEType = reinterpret_cast<OMX_STRING>(pTUint2);
+
+	paramPortDefinition.format.audio.bFlagErrorConcealment = OMX_FALSE;
+	paramPortDefinition.format.audio.eEncoding = OMX_AUDIO_CodingPCM;
+	
+	iConfigAudioVolume.bLinear = OMX_FALSE;	
+	}
+
+
+COmxILMicSourceAPB0Port::COmxILMicSourceAPB0Port(
+	const OMX_AUDIO_PARAM_PCMMODETYPE& aParamAudioPcm,
+	const OMX_AUDIO_CONFIG_VOLUMETYPE& aConfigAudioVolume,
+	const OMX_AUDIO_CONFIG_MUTETYPE& aConfigAudioMute,
+	COmxILMicSourceProcessingFunction& aProcessingFunction)
+	:
+	iParamAudioPcm(aParamAudioPcm),
+	iConfigAudioVolume(aConfigAudioVolume),
+	iConfigAudioMute(aConfigAudioMute),
+	iProcessingFunction(aProcessingFunction)
+	{
+    DEBUG_PRINTF(_L8("COmxILMicSourceAPB0Port::COmxILMicSourceAPB0Port"));
+	}
+
+
+COmxILMicSourceAPB0Port::~COmxILMicSourceAPB0Port()
+	{
+    DEBUG_PRINTF(_L8("COmxILMicSourceAPB0Port::~COmxILMicSourceAPB0Port"));
+
+	iMimeTypeBuf.Close();
+	}
+
+
+OMX_ERRORTYPE
+COmxILMicSourceAPB0Port::SetFormatInPortDefinition(
+	const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition,
+	TBool& aUpdateProcessingFunction)
+	{
+    DEBUG_PRINTF(_L8("COmxILMicSourceAPB0Port::SetFormatInPortDefinition"));
+    
+	// There's no point on chaging the cMIMEType type of this port
+	// Same thing for pNativeRender and eEncoding
+	GetParamPortDefinition().format.audio.bFlagErrorConcealment =
+		aPortDefinition.format.audio.bFlagErrorConcealment;
+	
+	// Error concealment not currently needed at the processing function
+	aUpdateProcessingFunction = EFalse;
+
+	return OMX_ErrorNone;
+	}
+
+
+TBool
+COmxILMicSourceAPB0Port::IsTunnelledPortCompatible(
+	const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const
+	{
+    DEBUG_PRINTF(_L8("COmxILMicSourceAPB0Port::IsTunnelledPortCompatible"));
+
+	// First, the easy checks...
+	if(aPortDefinition.eDomain != GetParamPortDefinition().eDomain)
+		{
+		return EFalse;
+		}
+
+	if(aPortDefinition.format.audio.eEncoding != OMX_AUDIO_CodingPCM)
+		{
+		return EFalse;
+		}
+
+	TBool retValue(EFalse);
+	RBuf8 tunnelMimeTypeBuf;
+	TInt err = tunnelMimeTypeBuf.Create(KMimeTypeAudioPcm().Length() + 1);
+	if(err == KErrNone)
+		{
+	
+		tunnelMimeTypeBuf =
+			const_cast<const TUint8*>(
+				reinterpret_cast<TUint8*>(aPortDefinition.format.audio.cMIMEType));
+	
+		if (iMimeTypeBuf == tunnelMimeTypeBuf)
+			{
+			retValue = ETrue;
+			}
+
+		tunnelMimeTypeBuf.Close();
+		}
+
+	return retValue;
+	}
+
+
+OMX_ERRORTYPE
+COmxILMicSourceAPB0Port::GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const
+	{
+    DEBUG_PRINTF(_L8("COmxILMicSourceAPB0Port::GetLocalOmxParamIndexes"));
+
+	// Always collect local indexes from parent
+	OMX_ERRORTYPE omxRetValue =
+		COmxILAudioPort::GetLocalOmxParamIndexes(aIndexArray);
+
+	if (OMX_ErrorNone != omxRetValue)
+		{
+		return omxRetValue;
+		}
+
+	TInt err = aIndexArray.InsertInOrder(OMX_IndexParamAudioPcm);
+
+	// Note that index duplication is OK.
+	if (KErrNone != err && KErrAlreadyExists != err)
+		{
+		return OMX_ErrorInsufficientResources;
+		}
+
+	return OMX_ErrorNone;
+
+	}
+
+OMX_ERRORTYPE
+COmxILMicSourceAPB0Port::GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const
+	{
+    DEBUG_PRINTF(_L8("COmxILMicSourceAPB0Port::GetLocalOmxConfigIndexes"));
+
+	// Always collect local indexes from parent
+	OMX_ERRORTYPE omxRetValue =
+		COmxILAudioPort::GetLocalOmxConfigIndexes(aIndexArray);
+
+	if (OMX_ErrorNone != omxRetValue)
+		{
+		return omxRetValue;
+		}
+
+	TInt err = aIndexArray.InsertInOrder(OMX_IndexConfigAudioVolume);
+
+	// Note that index duplication is OK.
+	if (KErrNone == err || KErrAlreadyExists == err)
+		{
+		err = aIndexArray.InsertInOrder(OMX_IndexConfigAudioMute);
+		}
+
+	if (KErrNone != err && KErrAlreadyExists != err)
+		{
+		return OMX_ErrorInsufficientResources;
+		}
+
+	return OMX_ErrorNone;
+
+	}
+
+
+OMX_ERRORTYPE
+COmxILMicSourceAPB0Port::GetParameter(OMX_INDEXTYPE aParamIndex,
+										TAny* apComponentParameterStructure) const
+	{
+    DEBUG_PRINTF(_L8("COmxILMicSourceAPB0Port::GetParameter"));
+
+	OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+	switch(aParamIndex)
+		{
+	case OMX_IndexParamAudioPcm:
+		{
+		if (OMX_ErrorNone !=
+			(omxRetValue =
+			 TOmxILUtil::CheckOmxStructSizeAndVersion(
+				 apComponentParameterStructure,
+				 sizeof(OMX_AUDIO_PARAM_PCMMODETYPE))))
+			{
+			return omxRetValue;
+			}
+
+		OMX_AUDIO_PARAM_PCMMODETYPE* pPcmMode
+			= static_cast<OMX_AUDIO_PARAM_PCMMODETYPE*>(
+				apComponentParameterStructure);
+
+		*pPcmMode = iParamAudioPcm;
+		}
+		break;
+
+	default:
+		{
+		// Try the parent's indexes
+		return COmxILAudioPort::GetParameter(aParamIndex,
+											 apComponentParameterStructure);
+		}
+		};
+
+	return OMX_ErrorNone;
+
+	}
+
+
+OMX_ERRORTYPE
+COmxILMicSourceAPB0Port::SetParameter(OMX_INDEXTYPE aParamIndex,
+										const TAny* apComponentParameterStructure,
+										TBool& aUpdateProcessingFunction)
+	{
+    DEBUG_PRINTF(_L8("COmxILMicSourceAPB0Port::SetParameter"));
+
+	aUpdateProcessingFunction = EFalse;
+
+	OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+	switch(aParamIndex)
+		{
+	case OMX_IndexParamAudioPcm:
+		{
+		if (OMX_ErrorNone !=
+			(omxRetValue =
+			 TOmxILUtil::CheckOmxStructSizeAndVersion(
+				 const_cast<OMX_PTR>(apComponentParameterStructure),
+				 sizeof(OMX_AUDIO_PARAM_PCMMODETYPE))))
+			{
+			return omxRetValue;
+			}
+
+		const OMX_AUDIO_PARAM_PCMMODETYPE* pPcmMode
+			= static_cast<const OMX_AUDIO_PARAM_PCMMODETYPE*>(
+				apComponentParameterStructure);
+
+		// Set the new default values
+		if (iParamAudioPcm.eNumData		 != pPcmMode->eNumData			||
+			iParamAudioPcm.eEndian		 != pPcmMode->eEndian			||
+			iParamAudioPcm.bInterleaved	 != pPcmMode->bInterleaved		||
+			iParamAudioPcm.nBitPerSample != pPcmMode->nBitPerSample		||
+			iParamAudioPcm.nSamplingRate != pPcmMode->nSamplingRate		||
+			iParamAudioPcm.ePCMMode		 != pPcmMode->ePCMMode)
+			{
+			iParamAudioPcm.eNumData		 = pPcmMode->eNumData;
+			iParamAudioPcm.eEndian		 = pPcmMode->eEndian;
+			iParamAudioPcm.bInterleaved	 = pPcmMode->bInterleaved;
+			iParamAudioPcm.nBitPerSample = pPcmMode->nBitPerSample;
+		    iParamAudioPcm.nSamplingRate = pPcmMode->nSamplingRate;
+			iParamAudioPcm.ePCMMode		 = pPcmMode->ePCMMode;
+			// This is an indication to the PortManager that the processing
+			// function needs to get updated
+			aUpdateProcessingFunction = ETrue;
+			}
+		
+		if(iParamAudioPcm.nChannels	 != pPcmMode->nChannels)
+			{
+			iParamAudioPcm.nChannels = pPcmMode->nChannels;
+			aUpdateProcessingFunction = ETrue;
+			
+			//Only change channel mappings when the number of channels has been changed.
+			for (TInt i=0; i<OMX_AUDIO_MAXCHANNELS; i++)
+				{
+				
+				if (iParamAudioPcm.eChannelMapping[i] != pPcmMode->eChannelMapping[i])
+					{
+					iParamAudioPcm.eChannelMapping[i] = pPcmMode->eChannelMapping[i];
+					}
+				}
+			}
+		}
+		break;
+	default:
+		{
+		// Try the parent's indexes
+		return COmxILAudioPort::SetParameter(aParamIndex,
+											 apComponentParameterStructure,
+											 aUpdateProcessingFunction);
+		}
+		};
+
+	return OMX_ErrorNone;
+
+	}
+
+
+OMX_ERRORTYPE
+COmxILMicSourceAPB0Port::GetConfig(OMX_INDEXTYPE aConfigIndex,
+									 TAny* apComponentConfigStructure) const
+	{
+    DEBUG_PRINTF(_L8("COmxILMicSourceAPB0Port::GetConfig"));
+
+	OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+	switch(aConfigIndex)
+		{
+	case OMX_IndexConfigAudioVolume:
+		{
+		if (OMX_ErrorNone !=
+			(omxRetValue =
+			 TOmxILUtil::CheckOmxStructSizeAndVersion(
+				 apComponentConfigStructure,
+				 sizeof(OMX_AUDIO_CONFIG_VOLUMETYPE))))
+			{
+			return omxRetValue;
+			}
+
+		OMX_AUDIO_CONFIG_VOLUMETYPE* pConfigVolume
+			= static_cast<OMX_AUDIO_CONFIG_VOLUMETYPE*>(
+				apComponentConfigStructure);
+
+		*pConfigVolume = iConfigAudioVolume;
+		}
+		break;
+
+	case OMX_IndexConfigAudioMute:
+		{
+		if (OMX_ErrorNone !=
+			(omxRetValue =
+			 TOmxILUtil::CheckOmxStructSizeAndVersion(
+				 apComponentConfigStructure,
+				 sizeof(OMX_AUDIO_CONFIG_MUTETYPE))))
+			{
+			return omxRetValue;
+			}
+
+		OMX_AUDIO_CONFIG_MUTETYPE* pConfigMute
+			= static_cast<OMX_AUDIO_CONFIG_MUTETYPE*>(
+				apComponentConfigStructure);
+
+		*pConfigMute = iConfigAudioMute;
+		}
+		break;
+
+	default:
+		{
+		// There's no need to try the parent indexes as we know there isn't any
+		// other config in the parent audio classes
+		return OMX_ErrorUnsupportedIndex;
+		}
+		};
+
+	return OMX_ErrorNone;
+
+	}
+
+OMX_ERRORTYPE
+COmxILMicSourceAPB0Port::SetConfig(OMX_INDEXTYPE aConfigIndex,
+									 const TAny* apComponentConfigStructure,
+									 TBool& aUpdateProcessingFunction)
+	{
+    DEBUG_PRINTF(_L8("COmxILMicSourceAPB0Port::SetConfig"));
+
+	aUpdateProcessingFunction = EFalse;
+
+	OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+	switch(aConfigIndex)
+		{
+	case OMX_IndexConfigAudioVolume:
+		{
+		if (OMX_ErrorNone !=
+			(omxRetValue =
+			 TOmxILUtil::CheckOmxStructSizeAndVersion(
+				 const_cast<OMX_PTR>(apComponentConfigStructure),
+				 sizeof(OMX_AUDIO_CONFIG_VOLUMETYPE))))
+			{
+			return omxRetValue;
+			}
+
+		const OMX_AUDIO_CONFIG_VOLUMETYPE* pConfigVolume
+			= static_cast<const OMX_AUDIO_CONFIG_VOLUMETYPE*>(
+				apComponentConfigStructure);
+
+		// Set the new default values
+		if (iConfigAudioVolume.bLinear		  != pConfigVolume->bLinear			||
+			iConfigAudioVolume.sVolume.nValue != pConfigVolume->sVolume.nValue	||
+			iConfigAudioVolume.sVolume.nMin	  != pConfigVolume->sVolume.nMin	||
+			iConfigAudioVolume.sVolume.nMax	  != pConfigVolume->sVolume.nMax)
+			{
+			iConfigAudioVolume.bLinear		  = pConfigVolume->bLinear;
+			iConfigAudioVolume.sVolume.nValue = pConfigVolume->sVolume.nValue;
+			iConfigAudioVolume.sVolume.nMin	  = pConfigVolume->sVolume.nMin;
+			iConfigAudioVolume.sVolume.nMax	  = pConfigVolume->sVolume.nMax;
+			// This is an indication to the PortManager that the processing
+			// function needs to get updated
+			aUpdateProcessingFunction = ETrue;
+			}
+
+		}
+		break;
+	case OMX_IndexConfigAudioMute:
+		{
+		if (OMX_ErrorNone !=
+			(omxRetValue =
+			 TOmxILUtil::CheckOmxStructSizeAndVersion(
+				 const_cast<OMX_PTR>(apComponentConfigStructure),
+				 sizeof(OMX_AUDIO_CONFIG_MUTETYPE))))
+			{
+			return omxRetValue;
+			}
+
+		const OMX_AUDIO_CONFIG_MUTETYPE* pConfigMute
+			= static_cast<const OMX_AUDIO_CONFIG_MUTETYPE*>(
+				apComponentConfigStructure);
+
+		if (iConfigAudioMute.bMute != pConfigMute->bMute)
+			{
+			iConfigAudioMute.bMute = pConfigMute->bMute;
+			// This is an indication to the PortManager that the processing
+			// function needs to get updated
+			aUpdateProcessingFunction = ETrue;
+			}
+
+		}
+		break;
+	default:
+		{
+		// There's no need to try the parent indexes as we know there isn't any
+		// other config in the parent audio classes
+		return OMX_ErrorUnsupportedIndex;
+		}
+		};
+
+	return OMX_ErrorNone;
+	}
+
+OMX_ERRORTYPE 
+COmxILMicSourceAPB0Port::DoBufferAllocation(OMX_U32 aSizeBytes, 
+											OMX_U8*& apPortSpecificBuffer, 
+											OMX_PTR& /* apPortPrivate */, 
+											OMX_PTR& /* apPlatformPrivate */,
+											OMX_PTR  /* apAppPrivate */)
+	{
+	//Simply delegate the call down to processing function class.
+	return iProcessingFunction.DoBufferAllocation(aSizeBytes, 
+												  apPortSpecificBuffer, 
+												  GetParamPortDefinition());
+	}
+
+void COmxILMicSourceAPB0Port::DoBufferDeallocation(OMX_PTR apPortSpecificBuffer, 
+												   OMX_PTR apPortPrivate, 
+												   OMX_PTR /*apPlatformPrivate*/, 
+												   OMX_PTR /* apAppPrivate */)
+	{
+	//Simply delegate the call down to processing function class.
+	iProcessingFunction.DoBufferDeallocation(apPortSpecificBuffer, apPortPrivate);
+	}
+
+OMX_ERRORTYPE 
+COmxILMicSourceAPB0Port::DoBufferWrapping(OMX_U32 aSizeBytes, 
+										  OMX_U8* apBuffer, 
+										  OMX_PTR& apPortPrivate, 
+										  OMX_PTR& /*apPlatformPrivate*/,
+										  OMX_PTR /* apAppPrivate */ )
+	{
+	if(aSizeBytes > GetParamPortDefinition().nBufferSize)
+		{
+		//Make sure the sharing buffers is smaller than the native buffers
+		GetParamPortDefinition().nBufferSize = aSizeBytes;
+		}
+	
+	return iProcessingFunction.DoBufferWrapping(aSizeBytes, 
+											    apBuffer, 
+											    apPortPrivate, 
+											    GetParamPortDefinition());
+	}
+
+void COmxILMicSourceAPB0Port::DoBufferUnwrapping(OMX_PTR apPortSpecificBuffer, 
+												 OMX_PTR apPortPrivate, 
+												 OMX_PTR /*apPlatformPrivate*/,
+												 OMX_PTR /* apAppPrivate */)
+	{
+	//Simply delegate the call down to processing function class.
+	iProcessingFunction.DoBufferUnwrapping(apPortSpecificBuffer, apPortPrivate);
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmcapturer/src/omxilmicsourceapb0port.h	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,95 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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
+   @internalComponent
+*/
+
+#ifndef OMXILMICSOURCEAPB0PORT_H
+#define OMXILMICSOURCEAPB0PORT_H
+
+#include <openmax/il/common/omxilaudioport.h>
+
+class COmxILMicSourceProcessingFunction;
+
+class COmxILMicSourceAPB0Port : public COmxILAudioPort
+	{
+
+public:
+
+	static COmxILMicSourceAPB0Port* NewL(
+		const TOmxILCommonPortData& aCommonPortData,
+		const RArray<OMX_AUDIO_CODINGTYPE>& aSupportedAudioFormats,
+		const OMX_AUDIO_PARAM_PCMMODETYPE& aParamAudioPcm,
+		const OMX_AUDIO_CONFIG_VOLUMETYPE& aConfigAudioVolume,
+		const OMX_AUDIO_CONFIG_MUTETYPE& aConfigAudioMute,
+		COmxILMicSourceProcessingFunction& aProcessingFunction);
+
+
+	~COmxILMicSourceAPB0Port();
+
+	OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const;
+
+	OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const;
+
+	OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex,
+							   TAny* apComponentParameterStructure) const;
+
+	OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex,
+							   const TAny* apComponentParameterStructure,
+							   TBool& aUpdateProcessingFunction);
+
+	OMX_ERRORTYPE GetConfig(OMX_INDEXTYPE aConfigIndex,
+							TAny* apComponentConfigStructure) const;
+
+	OMX_ERRORTYPE SetConfig(OMX_INDEXTYPE aConfigIndex,
+							const TAny* apComponentConfigStructure,
+							TBool& aUpdateProcessingFunction);
+
+protected:
+
+	COmxILMicSourceAPB0Port(
+		const OMX_AUDIO_PARAM_PCMMODETYPE& aParamAudioPcm,
+		const OMX_AUDIO_CONFIG_VOLUMETYPE& aConfigAudioVolume,
+		const OMX_AUDIO_CONFIG_MUTETYPE& aConfigAudioMute,
+		COmxILMicSourceProcessingFunction& iProcessingFunction);
+
+	void ConstructL(const TOmxILCommonPortData& aCommonPortData, const RArray<OMX_AUDIO_CODINGTYPE>& aSupportedAudioFormats);
+
+	OMX_ERRORTYPE SetFormatInPortDefinition(
+		const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition,
+		TBool& aUpdateProcessingFunction);
+
+	TBool IsTunnelledPortCompatible(
+		const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const;
+	
+	OMX_ERRORTYPE DoBufferAllocation(OMX_U32 aSizeBytes, OMX_U8*& apPortSpecificBuffer, OMX_PTR& apPortPrivate, OMX_PTR& apPlatformPrivate, OMX_PTR apAppPrivate = 0);
+	void DoBufferDeallocation(OMX_PTR apPortSpecificBuffer, OMX_PTR apPortPrivate, OMX_PTR apPlatformPrivate, OMX_PTR apAppPrivate = 0);
+	OMX_ERRORTYPE DoBufferWrapping(OMX_U32 aSizeBytes, OMX_U8* apBuffer, OMX_PTR& apPortPrivate, OMX_PTR& apPlatformPrivate, OMX_PTR apAppPrivate = 0);
+	void DoBufferUnwrapping(OMX_PTR apPortSpecificBuffer, OMX_PTR apPortPrivate, OMX_PTR apPlatformPrivate, OMX_PTR apAppPrivate = 0);
+	
+protected:
+
+	OMX_AUDIO_PARAM_PCMMODETYPE iParamAudioPcm;
+	OMX_AUDIO_CONFIG_VOLUMETYPE iConfigAudioVolume;
+	OMX_AUDIO_CONFIG_MUTETYPE iConfigAudioMute;
+	RBuf8 iMimeTypeBuf;
+	
+	COmxILMicSourceProcessingFunction& iProcessingFunction;	
+	};
+
+#endif // OMXILMICSOURCEAPB0PORT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmcapturer/src/omxilmicsourceconst.h	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,73 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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
+	@internalComponent
+*/
+
+#ifndef OMXILMICSOURCECONST_H_
+#define OMXILMICSOURCECONST_H_
+
+#include <d32soundsc.h>
+
+_LIT8(KSymbianOmxILMicSourceName, "OMX.NOKIA.AUDIO.CAPTURER.PCM");
+_LIT8(KSymbianOmxILMicSourceRole, "audio_capturer.pcm");
+
+_LIT(KSndLddFileName,"ESOUNDSC.LDD");
+_LIT(KSndPddFileName,"SOUNDSC.PDD");
+_LIT(KSndPddWildcardExtension,".*");
+
+const TUint8 KMicSourceComponentVersionMajor = 1;
+const TUint8 KMicSourceComponentVersionMinor = 0;
+const TUint8 KMicSourceComponentVersionRevision = 0;
+const TUint8 KMicSourceComponentVersionStep = 0;
+
+const OMX_U32 KMICSOURCE_APB0PORT_INDEX = 0;
+const OMX_U32 KMICSOURCE_OPB0PORT_INDEX = 1;
+
+const OMX_U32 KMICSOURCE_VOLUME_MIN = 0;
+const OMX_U32 KMICSOURCE_VOLUME_MAX = KSoundMaxVolume;
+
+const OMX_U32 KMICSOURCE_PCMPORT_BUFFERCOUNT_MIN = 4;
+const OMX_U32 KMICSOURCE_PCMPORT_BUFFERSIZE_MIN = 15360; // TODO: Decide the actual size of it, currently just copied from PCM render. 
+const OMX_U32 KMICSOURCE_CLOCKPORT_BUFFERCOUNT_MIN = 3;
+
+#ifndef MICSOURCE_DYNAMIC_SETTINGS
+//Default current sound settings 
+const TUint32 			KMICSOURCE_VOLUME_DEFAULT 			= 127;
+const TInt 				KMICSOURCE_CHANNELS_DEFAULT 		= 2;
+const TSoundRate 		KMICSOURCE_SOUNDRATE_DEFAULT 		= ESoundRate48000Hz;
+const TSoundEncoding 	KMICSOURCE_SOUNDENCODING_DEFAULT 	= ESoundEncoding16BitPCM;
+const TSoundDataFormat  KMICSOURCE_SOUNDDATAFORMAT_DEFAULT 	= ESoundDataFormatInterleaved;
+
+//Default supported sound settings
+const TUint32 KMICSOURCE_CHANNELS_SUPPORT = KSoundMonoChannel | KSoundStereoChannel;
+const TUint32 KMICSOURCE_SAMPLERATES_SUPPORT = KSoundRate7350Hz | KSoundRate8000Hz | KSoundRate8820Hz |
+						KSoundRate9600Hz | KSoundRate11025Hz | KSoundRate12000Hz | KSoundRate14700Hz |
+						KSoundRate16000Hz | KSoundRate22050Hz | KSoundRate24000Hz | KSoundRate29400Hz |
+						KSoundRate32000Hz | KSoundRate44100Hz | KSoundRate48000Hz;
+
+const TUint32 KMICSOURCE_ENCODING_SUPPORT = KSoundEncoding8BitPCM | KSoundEncoding16BitPCM;
+const TUint32 KMICSOURCE_DATAFORMATS_SUPPORT = KSoundDataFormatInterleaved;
+const TSoundDirection KMICSOURCE_SOUNDDIRECTION = ESoundDirRecord;
+const TBool KMICSOURCE_HWCONFIGNOTIFICATION_SUPPORT = EFalse;
+const TInt KMICSOURCE_REQUESTMINSIZE_SUPPORT = 0;
+const TInt KMICSOURCE_REQUESTALIGNMENT_SUPPORT = 0;
+#endif //MICSOURCE_DYNAMIC_SETTINGS
+
+#endif /*OMXILMICSOURCECONST_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmcapturer/src/omxilmicsourceprocessingfunction.cpp	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,1692 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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
+   @internalComponent
+*/
+
+#include <e32std.h>
+#include <openmax/il/khronos/v1_x/OMX_Audio.h>
+#include <openmax/il/common/omxilcallbacknotificationif.h>
+#include <openmax/il/common/omxilclockcomponentcmdsif.h>
+#include <openmax/il/common/omxilspecversion.h>
+
+#include "log.h"
+#include "omxilmicsourceprocessingfunction.h"
+#include "omxilmicsourceconst.h"
+
+//The maxium number of sample rates the sound driver can support
+const TInt KSAMPERATESNUMBER = ESoundRate48000Hz + 1;
+
+const OMX_U32
+COmxILMicSourceProcessingFunction::KSampleRates[KSAMPERATESNUMBER] = {7350, 8000, 8820,
+																	  9600, 11025, 12000,
+																	  14700, 16000,22050,
+																	  24000, 29400, 32000,
+																	  44100, 48000};
+
+const TInt COmxILMicSourceProcessingFunction::CCommandsQueue::KMaxMsgQueueEntries;
+
+COmxILMicSourceProcessingFunction*
+COmxILMicSourceProcessingFunction::NewL(MOmxILCallbackNotificationIf& aCallbacks,
+										MOmxILClockComponentCmdsIf& aClientClockPort)
+	{
+    DEBUG_PRINTF(_L8("COmxILMicSourceProcessingFunction::NewL"));
+
+	COmxILMicSourceProcessingFunction* self =
+		new (ELeave)COmxILMicSourceProcessingFunction(aCallbacks, aClientClockPort);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+void
+COmxILMicSourceProcessingFunction::ConstructL()
+	{
+    DEBUG_PRINTF(_L8("COmxILMicSourceProcessingFunction::ConstructL"));
+
+    iTransitionToPauseWait = new(ELeave) CActiveSchedulerWait();
+    User::LeaveIfError(iTransitionToPauseWaitSemaphore.CreateLocal(0));
+
+    //record the ID of the creator thread for later use
+    iOwnerThreadId = RThread().Id();
+    
+    //Loading physical sound device
+    TInt err = User::LoadPhysicalDevice(KSndPddFileName);
+	if(err != KErrNone && err != KErrAlreadyExists)
+		{
+		User::Leave(err);
+		}
+
+    //Loading logical sound driver
+	err = User::LoadLogicalDevice(KSndLddFileName);
+	if(err != KErrNone && err != KErrAlreadyExists)
+		{
+		User::Leave(err);
+		}
+
+
+#ifdef SYMBIAN_MICSOURCE_DYNAMIC_SETTINGS
+    User::LeaveIfError(iMicSource.Open(KSoundScRxUnit0));
+
+    //Get initial setting from device
+    iMicSourceSettings.iVolume = iMicSource.Volume();
+
+    TSoundFormatsSupportedV02Buf capsBuf;
+    iMicSource.Caps(capsBuf);
+    iMicSourceSettings.iSupportedSoundFormat = capsBuf();
+
+    TCurrentSoundFormatV02Buf audioFormatBuf;
+    iMicSource.AudioFormat(audioFormatBuf);
+    iMicSourceSettings.iCurSoundFormat = audioFormatBuf();
+    iMicSource.Close();
+#else //SYMBIAN_MICSOURCE_DYNAMIC_SETTINGS
+    iMicSourceSettings.iVolume = KMICSOURCE_VOLUME_DEFAULT;
+	iMicSourceSettings.iMute = EFalse;
+
+    //fill in default supported settings
+    iMicSourceSettings.iSupportedSoundFormat.iChannels = KMICSOURCE_CHANNELS_SUPPORT;
+    iMicSourceSettings.iSupportedSoundFormat.iDataFormats = KMICSOURCE_DATAFORMATS_SUPPORT;
+    iMicSourceSettings.iSupportedSoundFormat.iDirection = KMICSOURCE_SOUNDDIRECTION;
+    iMicSourceSettings.iSupportedSoundFormat.iEncodings = KMICSOURCE_ENCODING_SUPPORT;
+    iMicSourceSettings.iSupportedSoundFormat.iHwConfigNotificationSupport = KMICSOURCE_HWCONFIGNOTIFICATION_SUPPORT;
+    iMicSourceSettings.iSupportedSoundFormat.iRates = KMICSOURCE_SAMPLERATES_SUPPORT;
+    iMicSourceSettings.iSupportedSoundFormat.iRequestAlignment = KMICSOURCE_REQUESTALIGNMENT_SUPPORT;
+    iMicSourceSettings.iSupportedSoundFormat.iRequestMinSize = KMICSOURCE_REQUESTMINSIZE_SUPPORT;
+
+    //fill in default current sound settings
+    iMicSourceSettings.iCurSoundFormat.iChannels = KMICSOURCE_CHANNELS_DEFAULT;
+    iMicSourceSettings.iCurSoundFormat.iDataFormat = KMICSOURCE_SOUNDDATAFORMAT_DEFAULT;
+    iMicSourceSettings.iCurSoundFormat.iEncoding = KMICSOURCE_SOUNDENCODING_DEFAULT;
+    iMicSourceSettings.iCurSoundFormat.iRate = KMICSOURCE_SOUNDRATE_DEFAULT;
+#endif //SYMBIAN_MICSOURCE_DYNAMIC_SETTINGS
+
+	iBufferQueue = CBufferQueue::NewL(*this);
+	iCommandsQueue = CCommandsQueue::NewL(*this);
+
+	iMediaStartTime = 0;
+	iTotalBytesRecorded = 0;
+	}
+
+COmxILMicSourceProcessingFunction::COmxILMicSourceProcessingFunction(
+	MOmxILCallbackNotificationIf& aCallbacks,
+	MOmxILClockComponentCmdsIf& aClientClockPort)
+	:
+	COmxILProcessingFunction(aCallbacks),
+	iInitialPendingBufferOffset(-1),
+	ipClientClockPort(&aClientClockPort)
+	{
+    DEBUG_PRINTF(_L8("COmxILMicSourceProcessingFunction::COmxILMicSourceProcessingFunction"));
+	}
+
+COmxILMicSourceProcessingFunction::~COmxILMicSourceProcessingFunction()
+	{
+    DEBUG_PRINTF(_L8("COmxILMicSourceProcessingFunction::~COmxILMicSourceProcessingFunction"));
+
+    delete iTransitionToPauseWait;
+    iTransitionToPauseWaitSemaphore.Close();
+    delete iBufferQueue;
+    delete iCommandsQueue;
+    iMicSource.Close();
+
+	User::FreeLogicalDevice(KDevSoundScName);
+
+	TName pddName(KDevSoundScName);
+	pddName.Append(KSndPddWildcardExtension);
+	TFindPhysicalDevice findPD(pddName);
+	TFullName findResult;
+	while(KErrNone == findPD.Next(findResult))
+		{
+		User::FreePhysicalDevice(findResult);
+		findPD.Find(pddName); // Reset the find handle now that we have deleted something from the container.
+		}
+	}
+
+void COmxILMicSourceProcessingFunction::FillParamPCMModeType(OMX_AUDIO_PARAM_PCMMODETYPE& aPcmModeType) const
+	{
+    DEBUG_PRINTF(_L8("COmxILMicSourceProcessingFunction::FillParamPCMModeType"));
+
+	aPcmModeType.eNumData = OMX_NumericalDataSigned;
+    aPcmModeType.eEndian = OMX_EndianBig;
+
+    aPcmModeType.bInterleaved =
+	(iMicSourceSettings.iCurSoundFormat.iDataFormat == ESoundDataFormatInterleaved)
+		? OMX_TRUE : OMX_FALSE;
+
+	aPcmModeType.nBitPerSample = ConvertEnumToBitsPerSample(
+		iMicSourceSettings.iCurSoundFormat.iEncoding);
+
+    aPcmModeType.nSamplingRate = ConvertEnumToSampleRate(iMicSourceSettings.iCurSoundFormat.iRate);
+	aPcmModeType.ePCMMode = OMX_AUDIO_PCMModeLinear;
+
+    aPcmModeType.nChannels = static_cast<OMX_U32>(iMicSourceSettings.iCurSoundFormat.iChannels);
+	if(aPcmModeType.nChannels == 1)
+		{
+		aPcmModeType.eChannelMapping[0] = OMX_AUDIO_ChannelCF;
+		}
+	else
+		{
+		//Assume the device only supports 2 channels as maxium
+		//TODO: Add more channel mapping options for different number of channels.
+		aPcmModeType.eChannelMapping[0] = OMX_AUDIO_ChannelLF;
+		aPcmModeType.eChannelMapping[1] = OMX_AUDIO_ChannelRF;
+		}
+	}
+
+TInt COmxILMicSourceProcessingFunction::GetVolume() const
+	{
+    DEBUG_PRINTF(_L8("COmxILMicSourceProcessingFunction::GetVolume"));
+
+	return iMicSourceSettings.iVolume;
+	}
+
+OMX_U32 COmxILMicSourceProcessingFunction::ConvertEnumToSampleRate(TSoundRate aEnum)
+	{
+	return KSampleRates[aEnum];
+	}
+
+OMX_U32 COmxILMicSourceProcessingFunction::ConvertEnumToBitsPerSample(
+	TSoundEncoding aEnum)
+	{
+	OMX_U32 nBitPerSample = 0;
+	switch(aEnum)
+	{
+	case ESoundEncoding8BitPCM:
+		nBitPerSample = 8;
+		break;
+	case ESoundEncoding16BitPCM:
+		nBitPerSample = 16;
+		break;
+	case ESoundEncoding24BitPCM:
+		nBitPerSample = 24;
+		break;
+	default:
+		// Assume the default is 16 bits
+		nBitPerSample = 16;
+		break;
+	};
+
+	return nBitPerSample;
+	}
+
+TSoundRate COmxILMicSourceProcessingFunction::ConvertEnumToSampleRate(OMX_U32 aSampleRate)
+	{
+	TSoundRate rate = ESoundRate48000Hz;
+	for(TInt index = 0; index < KSAMPERATESNUMBER; ++index)
+		{
+		if(KSampleRates[index] == aSampleRate)
+			{
+			rate = static_cast<TSoundRate>(index);
+			break;
+			}
+		}
+
+	return rate;
+	}
+
+
+OMX_ERRORTYPE
+COmxILMicSourceProcessingFunction::StateTransitionIndication(TStateIndex aNewState)
+	{
+    DEBUG_PRINTF(_L8("COmxILMicSourceProcessingFunction::StateTransitionIndication"));
+
+    OMX_ERRORTYPE err = OMX_ErrorNone;
+	switch(aNewState)
+		{
+	case EStateExecuting:
+		{
+		DEBUG_PRINTF(_L8("StateTransitionIndication : OMX_StateExecuting"));
+
+		OMX_STATETYPE previousState = iState;
+        iState = OMX_StateExecuting;
+		if (ipClientClockPort->IsClockComponentAvailable())
+		    {
+		    // Only record if clock is running
+		    OMX_TIME_CONFIG_CLOCKSTATETYPE clockState;
+		    OMX_ERRORTYPE omxError = ipClientClockPort->GetClockState(clockState);
+		    if (OMX_ErrorNone != omxError)
+		        {
+		        iCallbacks.ErrorEventNotification(omxError);
+		        break;     
+		        }
+		    if (OMX_TIME_ClockStateRunning != clockState.eState)
+		        {
+		        break;
+		        }
+		    }
+		
+		TInt error(KErrGeneral);
+		if(previousState == OMX_StatePause) //going from Paused to Executing -> resume recording
+		    {
+		    error = iCommandsQueue->Resume();
+		    }
+		else
+		    {
+		    error = iCommandsQueue->StartRecording();
+		    }
+		
+        if (error != KErrNone)
+			{
+			//TODO: should not we roll back to the previous state here? ie: iState = previousState;
+			return OMX_ErrorInsufficientResources;
+			}
+		}
+		break;
+	case EStateInvalid:
+		{
+		DEBUG_PRINTF(_L8("StateTransitionIndication : OMX_StateInvalid"));
+		iStartedRecording = EFalse;
+		
+		if(iState == OMX_StateExecuting || iState == OMX_StatePause)
+			{
+			iCommandsQueue->CleanupBufferQueue();
+			iCommandsQueue->CloseDevice();
+			}
+
+		iState = OMX_StateInvalid;
+		}
+		break;
+	case EStatePause:
+		{
+		DEBUG_PRINTF(_L8("StateTransitionIndication : OMX_StatePause"));
+
+		if(iState == OMX_StateExecuting) //only do anything iff pausing in executing state
+		    {
+		    iStartedRecording = EFalse;
+            if (iCommandsQueue->Pause() != KErrNone)
+                {
+                iState = OMX_StateExecuting; //transition to Paused state failed; roll back state to Exectuing
+                return OMX_ErrorInsufficientResources;
+                }
+            WaitForTransitionToPauseToFinish(); //blocking this state transition here until Bufferqueue finishes processing data
+		    }
+		else //going from a state other than Executing -> no action needed
+		    {
+		    iState = OMX_StatePause;
+		    }
+		}
+		break;
+	case EStateIdle:
+		{
+		iStartedRecording = EFalse;
+		
+		DEBUG_PRINTF(_L8("StateTransitionIndication : OMX_StateIdle"));
+		iState = OMX_StateIdle;
+		}
+		break;
+	case EStateLoaded:
+		{
+		DEBUG_PRINTF(_L8("StateTransitionIndication : OMX_StateLoaded"));
+
+		iCommandsQueue->CloseDevice();
+		iState = OMX_StateLoaded;
+		}
+		break;
+	case EStateWaitForResources:
+		{
+		DEBUG_PRINTF(_L8("StateTransitionIndication : OMX_StateLoaded, OMX_StateWaitForResources"));
+		if(iState == OMX_StateExecuting || iState == OMX_StatePause)
+			{
+			if (iCommandsQueue->StopAndReset() != KErrNone)
+				{
+				return OMX_ErrorInsufficientResources;
+				}
+
+			if (iCommandsQueue->CleanupBufferQueue() != KErrNone)
+				{
+				return OMX_ErrorInsufficientResources;
+				}
+			}
+		iState = OMX_StateWaitForResources;
+		}
+		break;
+	case ESubStateLoadedToIdle:
+		{
+		DEBUG_PRINTF(_L8("StateTransitionIndication : ESubStateLoadedToIdle"));
+
+		//always cleanup the buffer queue before other initialization
+		iBufferQueue->Cleanup();
+
+		if (iMicSource.Open(KSoundScRxUnit0) != KErrNone)
+			{
+			return OMX_ErrorInsufficientResources;
+			}
+
+		TInt currentVolume = iMicSource.Volume();
+		TInt volume = (iMicSourceSettings.iMute) ? 0 : iMicSourceSettings.iVolume;
+		if(currentVolume != volume && KErrNone != iMicSource.SetVolume(volume))
+			{
+			iMicSourceSettings.iVolume = currentVolume;
+			iMicSourceSettings.iMute = EFalse;
+			err = PostVolumeChangeEvent();
+			}
+
+		TPckgBuf<TCurrentSoundFormatV02> curSoundFormatBuf(iMicSourceSettings.iCurSoundFormat);
+		if(KErrNone != iMicSource.SetAudioFormat(curSoundFormatBuf))
+			{
+		    TCurrentSoundFormatV02Buf audioFormatBuf;
+		    iMicSource.AudioFormat(audioFormatBuf);
+		    iMicSourceSettings.iCurSoundFormat = audioFormatBuf();
+			err = PostAudioFormatChangeEvent();
+			}
+		}
+		break;
+	case ESubStateIdleToLoaded:
+		{
+		DEBUG_PRINTF(_L8("StateTransitionIndication : ESubStateIdleToLoaded"));
+		if (iCommandsQueue->CleanupBufferQueue() != KErrNone)
+			{
+			return OMX_ErrorInsufficientResources;
+			}
+		}
+		break;
+	case ESubStateExecutingToIdle:
+	case ESubStatePauseToIdle:
+		{
+		if (iCommandsQueue->StopAndReset() != KErrNone)
+			{
+			return OMX_ErrorInsufficientResources;
+			}
+		}
+		break;
+	default:
+		{
+		return OMX_ErrorIncorrectStateTransition;
+		}
+		};
+
+	return err;
+	}
+
+OMX_ERRORTYPE COmxILMicSourceProcessingFunction::PostVolumeChangeEvent()
+	{
+	OMX_AUDIO_CONFIG_VOLUMETYPE volumeType;
+	volumeType.sVolume.nValue = iMicSourceSettings.iVolume;
+	volumeType.sVolume.nMin = KMICSOURCE_VOLUME_MIN;
+	volumeType.sVolume.nMax = KMICSOURCE_VOLUME_MAX;
+	volumeType.nSize = sizeof(OMX_AUDIO_CONFIG_VOLUMETYPE);
+	volumeType.bLinear = OMX_TRUE;
+	volumeType.nPortIndex = KMICSOURCE_APB0PORT_INDEX;
+	volumeType.nVersion = TOmxILVersion(KMicSourceComponentVersionMajor,
+										KMicSourceComponentVersionMinor,
+										KMicSourceComponentVersionRevision,
+										KMicSourceComponentVersionStep);
+
+	TPckgBuf<OMX_AUDIO_CONFIG_VOLUMETYPE> volumeTypeBuf(volumeType);
+	return iCallbacks.PortSettingsChangeNotification(KMICSOURCE_APB0PORT_INDEX,
+													 OMX_IndexConfigAudioVolume,
+													 volumeTypeBuf);
+	}
+
+OMX_ERRORTYPE COmxILMicSourceProcessingFunction::PostAudioFormatChangeEvent()
+	{
+	OMX_AUDIO_PARAM_PCMMODETYPE pcmProfile;
+	pcmProfile.nSize = sizeof(OMX_AUDIO_PARAM_PCMMODETYPE);
+	pcmProfile.nVersion = TOmxILVersion(KMicSourceComponentVersionMajor,
+										KMicSourceComponentVersionMinor,
+										KMicSourceComponentVersionRevision,
+										KMicSourceComponentVersionStep);
+	pcmProfile.nPortIndex = KMICSOURCE_APB0PORT_INDEX;
+
+	FillParamPCMModeType(pcmProfile);
+
+	TPckgBuf<OMX_AUDIO_PARAM_PCMMODETYPE> pcmProfileBuf(pcmProfile);
+	return iCallbacks.PortSettingsChangeNotification(KMICSOURCE_APB0PORT_INDEX,
+													OMX_IndexParamAudioPcm,
+													pcmProfileBuf);
+
+	}
+
+OMX_ERRORTYPE
+COmxILMicSourceProcessingFunction::BufferFlushingIndication(TUint32 aPortIndex,
+															OMX_DIRTYPE aDirection)
+	{
+    DEBUG_PRINTF(_L8("COmxILMicSourceProcessingFunction::BufferFlushingIndication"));
+
+    if ((aPortIndex == OMX_ALL && aDirection == OMX_DirMax) ||
+		(aPortIndex == 0 && aDirection == OMX_DirOutput))
+		{
+		if(iCommandsQueue->Stop() != KErrNone)
+			{
+			return OMX_ErrorInsufficientResources;
+			}
+		iBufferQueue->FlushBuffers(OMX_DirOutput);
+		}
+	return OMX_ErrorNone;
+	}
+
+OMX_ERRORTYPE
+COmxILMicSourceProcessingFunction::ParamIndication(OMX_INDEXTYPE aParamIndex,
+												const TAny* apComponentParameterStructure)
+	{
+    DEBUG_PRINTF(_L8("COmxILMicSourceProcessingFunction::ParamIndication"));
+
+    OMX_ERRORTYPE err = OMX_ErrorNone;
+    switch(aParamIndex)
+	{
+	case OMX_IndexParamAudioPcm:
+		{
+		const OMX_AUDIO_PARAM_PCMMODETYPE* pPcmProfile
+			= static_cast<const OMX_AUDIO_PARAM_PCMMODETYPE*>(
+				apComponentParameterStructure);
+
+		TCurrentSoundFormatV02 newSoundFormat;
+		newSoundFormat.iChannels = pPcmProfile->nChannels;
+		newSoundFormat.iReserved1 = 0;
+		if(0 == (iMicSourceSettings.iSupportedSoundFormat.iChannels & (KSoundMonoChannel << (newSoundFormat.iChannels - 1))))
+			{
+			err = OMX_ErrorUnsupportedSetting;
+			break;
+			}
+
+		newSoundFormat.iDataFormat = (pPcmProfile->bInterleaved == OMX_TRUE)
+									 ? ESoundDataFormatInterleaved : ESoundDataFormatNonInterleaved;
+		if(0 == (iMicSourceSettings.iSupportedSoundFormat.iDataFormats & (KSoundDataFormatInterleaved << newSoundFormat.iDataFormat)))
+			{
+			err = OMX_ErrorUnsupportedSetting;
+			break;
+			}
+
+		switch(pPcmProfile->nBitPerSample)
+			{
+			case 8:
+				newSoundFormat.iEncoding = ESoundEncoding8BitPCM;
+				break;
+			case 24:
+				newSoundFormat.iEncoding = ESoundEncoding24BitPCM;
+				break;
+			default:
+				newSoundFormat.iEncoding = ESoundEncoding16BitPCM;
+				break;
+			}
+		if(0 == (iMicSourceSettings.iSupportedSoundFormat.iEncodings & (KSoundEncoding8BitPCM << newSoundFormat.iEncoding)))
+			{
+			err = OMX_ErrorUnsupportedSetting;
+			break;
+			}
+
+		newSoundFormat.iRate = ConvertEnumToSampleRate(pPcmProfile->nSamplingRate);
+		if(0 == (iMicSourceSettings.iSupportedSoundFormat.iRates & (KSoundRate7350Hz << newSoundFormat.iRate)))
+			{
+			err = OMX_ErrorUnsupportedSetting;
+			break;
+			}
+
+		if(iState > OMX_StateLoaded && iState != OMX_StateWaitForResources)
+			{
+			TPckgBuf<TCurrentSoundFormatV02> curSoundFormatBuf(newSoundFormat);
+			if(KErrNone != iMicSource.SetAudioFormat(curSoundFormatBuf))
+				{
+				return OMX_ErrorHardware;
+				}
+			}
+
+		iMicSourceSettings.iCurSoundFormat = newSoundFormat;
+		}
+		break;
+	default:
+		{
+		// Ignore other port param changes...
+		}
+		break;
+	};
+
+	return err;
+	}
+
+OMX_ERRORTYPE
+COmxILMicSourceProcessingFunction::ConfigIndication(OMX_INDEXTYPE aConfigIndex,
+													const TAny* apComponentConfigStructure)
+	{
+    DEBUG_PRINTF(_L8("COmxILMicSourceProcessingFunction::ConfigIndication"));
+
+    OMX_ERRORTYPE err = OMX_ErrorNone;
+    switch(aConfigIndex)
+    {
+	case OMX_IndexConfigAudioVolume:
+		{
+		const OMX_AUDIO_CONFIG_VOLUMETYPE* pVolumeType
+			= static_cast<const OMX_AUDIO_CONFIG_VOLUMETYPE*>(apComponentConfigStructure);
+
+		if((pVolumeType->bLinear == OMX_TRUE) &&
+		  (pVolumeType->sVolume.nMax == 255) &&
+		  (pVolumeType->sVolume.nMin == 0) &&
+		  (pVolumeType->sVolume.nValue <= pVolumeType->sVolume.nMax) &&
+		  (pVolumeType->sVolume.nValue >= pVolumeType->sVolume.nMin))
+			{
+			if(iState > OMX_StateLoaded && iState != OMX_StateWaitForResources)
+				{
+				if(KErrNone != iMicSource.SetVolume(pVolumeType->sVolume.nValue))
+					{
+					return OMX_ErrorHardware;
+					}
+				}
+			iMicSourceSettings.iVolume = pVolumeType->sVolume.nValue;
+			iMicSourceSettings.iMute = EFalse;
+			}
+		else
+			{
+			err = OMX_ErrorBadParameter;
+			}
+		}
+		break;
+
+	case OMX_IndexConfigAudioMute:
+		{
+		const OMX_AUDIO_CONFIG_MUTETYPE* pVolumeType
+			= static_cast<const OMX_AUDIO_CONFIG_MUTETYPE*>(apComponentConfigStructure);
+
+		if(pVolumeType->bMute && !iMicSourceSettings.iMute)
+			{
+			if(iState > OMX_StateLoaded && iState != OMX_StateWaitForResources)
+				{
+				if(iMicSource.SetVolume(0) != KErrNone)
+					{
+					return OMX_ErrorHardware;
+					}
+				}
+			iMicSourceSettings.iMute = ETrue;
+			}
+		else if(!pVolumeType->bMute && iMicSourceSettings.iMute)
+			{
+			if(iState > OMX_StateLoaded && iState != OMX_StateWaitForResources)
+				{
+				if(iMicSource.SetVolume(iMicSourceSettings.iVolume) != KErrNone)
+					{
+					return OMX_ErrorHardware;
+					}
+				}
+			iMicSourceSettings.iMute = EFalse;
+			}
+		}
+		break;
+
+	default:
+		{
+		// Ignore other port config changes...
+		}
+		break;
+	};
+
+	return err;
+	}
+
+OMX_ERRORTYPE
+COmxILMicSourceProcessingFunction::BufferIndication(OMX_BUFFERHEADERTYPE* apBufferHeader,
+													OMX_DIRTYPE aDirection)
+	{
+    DEBUG_PRINTF2(_L8("COmxILMicSourceProcessingFunction::BufferIndication : [%X]"), apBufferHeader);
+
+    if (aDirection == OMX_DirOutput)
+		{
+		if(iState > OMX_StateLoaded && iState != OMX_StateWaitForResources)
+			{
+			//Don't queue buffer unless we are in executing/pause state
+			return iBufferQueue->QueueBuffer(apBufferHeader);
+			}
+		else
+			{
+			return OMX_ErrorNotReady;
+			}
+		}
+    else
+		{
+		return OMX_ErrorBadParameter;
+		}
+	}
+
+OMX_BOOL
+COmxILMicSourceProcessingFunction::BufferRemovalIndication(OMX_BUFFERHEADERTYPE* apBufferHeader,
+														   OMX_DIRTYPE /* aDirection */)
+	{
+    DEBUG_PRINTF2(_L8("COmxILMicSourceProcessingFunction::BufferRemovalIndication : BUFFER [%X]"), apBufferHeader);
+	return iBufferQueue->RemoveBuffer(apBufferHeader);
+	}
+
+OMX_ERRORTYPE
+COmxILMicSourceProcessingFunction::DoBufferAllocation(OMX_U32 /* aSizeBytes */,
+													  OMX_U8*& apPortSpecificBuffer,
+													  OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition)
+	{
+	return iBufferQueue->AllocateBuffer(apPortSpecificBuffer, aPortDefinition);
+	}
+
+void COmxILMicSourceProcessingFunction::DoBufferDeallocation(OMX_PTR apPortSpecificBuffer,
+															 OMX_PTR /* apPortPrivate */)
+	{
+	iBufferQueue->FreeBuffer(apPortSpecificBuffer);
+	}
+
+OMX_ERRORTYPE
+COmxILMicSourceProcessingFunction::DoBufferWrapping(OMX_U32 /* aSizeBytes */,
+													OMX_U8* apBuffer,
+													OMX_PTR& /* apPortPrivate */,
+													OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition)
+	{
+	return iBufferQueue->UseBuffer(apBuffer, aPortDefinition);
+	}
+
+void COmxILMicSourceProcessingFunction::DoBufferUnwrapping(OMX_PTR apPortSpecificBuffer,
+														   OMX_PTR /* apPortPrivate */)
+	{
+	iBufferQueue->RemoveBuffer(apPortSpecificBuffer);
+	}
+
+void COmxILMicSourceProcessingFunction::ReleasePendingBufferIfExists()
+    {
+    if (iInitialPendingBufferOffset >= 0)
+        {
+        iMicSource.ReleaseBuffer(iInitialPendingBufferOffset);
+        iInitialPendingBufferOffset = -1;
+        }
+    }
+
+OMX_TICKS COmxILMicSourceProcessingFunction::CalculateTimestamp(TUint64 aBytesTransSinceStart)
+    {
+    OMX_S64 bitsPerSample = ConvertEnumToBitsPerSample(iMicSourceSettings.iCurSoundFormat.iEncoding);
+    OMX_S64 sampleRate = ConvertEnumToSampleRate(iMicSourceSettings.iCurSoundFormat.iRate);
+    TUint64 bytesPerSec = (bitsPerSample / 8) * sampleRate;
+    TUint64 bytesTicksPerSec = aBytesTransSinceStart * static_cast<TUint64>(OMX_TICKS_PER_SECOND);
+	bytesTicksPerSec /= iMicSourceSettings.iCurSoundFormat.iChannels;
+
+    // Calculate the presentation time (rounded up to nearest
+    // integer). The media start time + presentation time is the
+    // timestamp for the first sample of each buffer.
+    OMX_TICKS  currentAudioPresentationTime = ((bytesTicksPerSec + (bytesPerSec/2))/bytesPerSec);
+
+    // Set the buffer timestamp and start flag if needed
+    return (iMediaStartTime + currentAudioPresentationTime);    
+    }
+
+OMX_ERRORTYPE
+COmxILMicSourceProcessingFunction::MediaTimeIndication(const OMX_TIME_MEDIATIMETYPE& aMediaTime)
+	{
+	DEBUG_PRINTF5(_L8("COmxILMicSourceProcessingFunction::MediaTimeIndication : eUpdateType = %d eState = %d xScale = %d nMediaTimestamp = %d "), aMediaTime.eUpdateType, aMediaTime.eState, aMediaTime.xScale, aMediaTime.nMediaTimestamp);
+
+	// Only OMX_TIME_UpdateClockStateChanged is supported. The verification is done here to avoid overloading the commands queue with bogus updates in the component conformance suite which treats clock port as any other inpuit port
+	if (OMX_TIME_UpdateClockStateChanged != aMediaTime.eUpdateType)
+		{
+		return OMX_ErrorNone;
+		}	
+	
+	if (iCommandsQueue->MediaTimeIndication(aMediaTime) != KErrNone)
+		{
+		return OMX_ErrorInsufficientResources;
+		}
+
+	return OMX_ErrorNone;
+	}
+
+void COmxILMicSourceProcessingFunction::StartRecording()
+	{
+	// Ensure that we don't issue RecordData twice				
+	if (iStartedRecording)
+		return;
+
+	iStartedRecording = ETrue;
+	if (!ipClientClockPort->IsClockComponentAvailable())
+		{
+		//Don't reset iTotalBytesRecorded or iMediaStartTime here as this method is called when going from Paused->Exec, not just Idle->Exec
+		// If we transitioned to Idle previously, then the counters would've reset at that point
+		iBufferQueue->RecordData();
+		}
+	else
+		{
+		//Implicit that we are clock is running, checks performed when message queued
+		// Reinitialise our timestamp calculation to the current media time and begin recording
+		// In the presence of a clock component, we use its media time as our starting point, so we reset all the aggregated counters, to avoid jumping ahead in time					
+		iTotalBytesRecorded = 0;
+		iMicSource.ResetBytesTransferred();
+		ipClientClockPort->GetMediaTime(iMediaStartTime);
+		iBufferQueue->RecordData();
+		}	
+	}
+	
+void
+COmxILMicSourceProcessingFunction::ProcessMediaTimeUpdate(const OMX_TIME_MEDIATIMETYPE& aMediaTime)
+	{
+	DEBUG_PRINTF5(_L8("COmxILMicSourceProcessingFunction::ProcessMediaTimeUpdate : eUpdateType[%d] eState[%d] xScale[%d] nMediaTimestamp[%d]"), aMediaTime.eUpdateType, aMediaTime.eState, aMediaTime.xScale, aMediaTime.nMediaTimestamp);
+
+	// Only processing of clock state changes are supported (no seeking) - the verification of the correct update type was done before adding the message to the command queue
+	ASSERT(OMX_TIME_UpdateClockStateChanged == aMediaTime.eUpdateType);
+
+	// Process here the clock state changes:
+	// 
+	// 1 - Transition to running:
+	//
+	// - If executing trigger a call to initialise our copy of the media time and start recording
+	//
+	// 2 - Transition to WaitForStartTime:
+	//
+	// - Simply report audio start time as the current media time
+	//
+	// 3 - Transition to Stopped
+	//
+	// - Stop recording, all counters reinitialised if recording resumes
+
+	// TODO: Consider what to do with media time updates in all states, not
+	// only EXE and PAUSE
+
+
+	OMX_ERRORTYPE omxError = OMX_ErrorNone;
+	switch(aMediaTime.eState)
+		{
+	case OMX_TIME_ClockStateRunning:
+		{
+		if (iState == OMX_StateExecuting)
+			{
+			StartRecording();
+			}
+		}
+		break;
+
+	case OMX_TIME_ClockStateWaitingForStartTime:
+		{
+		iStartedRecording = EFalse;
+		// For now, only considering this could happen during Exe or Pause
+		if (iState == OMX_StateExecuting || iState == OMX_StatePause)
+			{
+			// Send start time
+			OMX_TICKS mediaTime;
+			omxError = ipClientClockPort->GetMediaTime(mediaTime);
+			if (OMX_ErrorNone == omxError)
+				{
+				// Ignore the error returned
+				ipClientClockPort->SetStartTime(mediaTime);
+				}
+			}
+		DEBUG_PRINTF2(_L8("COmxILMicSourceProcessingFunction::ProcessMediaTimeUpdate : GetWallTime returned [%d]"), omxError);
+		}
+		break;
+
+	case OMX_TIME_ClockStateStopped:
+		{
+		iStartedRecording = EFalse;
+		// For now, only considering this in Exe and Pause
+		if (iState == OMX_StateExecuting || iState == OMX_StatePause)
+			{
+			ReleasePendingBufferIfExists();
+			iMicSource.CancelRecordData();
+			}
+		}
+		break;
+
+	default:
+		{
+		DEBUG_PRINTF(_L8("COmxILMicSourceProcessingFunction::ProcessMediaTimeUpdate : Ignoring invalid clock state"));
+		}
+		};
+	}
+
+void COmxILMicSourceProcessingFunction::WaitForTransitionToPauseToFinish()
+    {
+    if(RThread().Id() == iOwnerThreadId)
+        {
+        //if the owner thread is the same thread as the one created the active objects in this processing function
+        //then we can wait by using CActiveSchedulerWait
+        DEBUG_PRINTF(_L8("COmxILMicSourceProcessingFunction::WaitForTransitionToPauseToFinish - blocking transition to pause with active scheduler wait now"));
+        iTransitionToPauseWait->Start();
+        }
+    else
+        {
+        //if this is a thread different from the creator thread then semaphore is needed to block this thread until the transition
+        //to paused state completes
+        DEBUG_PRINTF(_L8("COmxILMicSourceProcessingFunction::WaitForTransitionToPauseToFinish - blocking thread with semaphore now"));
+        iTransitionToPauseWaitSemaphore.Wait();
+        }
+    }
+
+void COmxILMicSourceProcessingFunction::TransitionToPauseFinished()
+    {
+    if(iTransitionToPauseWait->IsStarted())
+        {
+        DEBUG_PRINTF(_L8("COmxILMicSourceProcessingFunction::TransitionToPauseFinished - unblocking transition to pause (active scheduler wait) now"));
+        iTransitionToPauseWait->AsyncStop();
+        }
+    else
+        {
+        DEBUG_PRINTF(_L8("COmxILMicSourceProcessingFunction::TransitionToPauseFinished - unblocking transition to pause (semaphore) now"));
+        iTransitionToPauseWaitSemaphore.Signal();
+        }
+    }
+
+
+COmxILMicSourceProcessingFunction::CCommandsQueue* COmxILMicSourceProcessingFunction::CCommandsQueue::NewL(COmxILMicSourceProcessingFunction& aParent)
+	{
+	CCommandsQueue* self = new (ELeave) CCommandsQueue(aParent);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+COmxILMicSourceProcessingFunction::CCommandsQueue::CCommandsQueue(COmxILMicSourceProcessingFunction& aParent)
+: CActive(EPriorityStandard),
+  iParent(aParent)
+	{
+	CActiveScheduler::Add(this);
+	}
+
+void COmxILMicSourceProcessingFunction::CCommandsQueue::ConstructL()
+	{
+	User::LeaveIfError(iMsgQueue.CreateLocal(KMaxMsgQueueEntries));
+	iMsgQueue.NotifyDataAvailable(iStatus);
+	SetActive();
+	}
+
+COmxILMicSourceProcessingFunction::CCommandsQueue::~CCommandsQueue()
+	{
+	Cancel();
+	iMsgQueue.Close();
+	}
+
+void COmxILMicSourceProcessingFunction::CCommandsQueue::RunL()
+	{
+	TProcMessage msg;
+	while (iMsgQueue.Receive(msg)==KErrNone)
+		{
+	    DEBUG_PRINTF2(_L8("COmxILMicSourceProcessingFunction::CCommandsQueue::RunL : msg.iType[%d]"), msg.iType);
+		switch (msg.iType)
+			{
+			case EMsgStop:
+				{
+				//This variant, which does not reset the timestamping counters, is needed for when recording without a clock, have received a flush buffer indication, yet have not been moved to Idle
+	            iParent.ReleasePendingBufferIfExists();
+				iParent.iBufferQueue->Stop();
+				break;
+				}
+            case EMsgStopAndReset:
+                {
+                //The timestamping conters are reset here for when recording without a clock
+                iParent.iTotalBytesRecorded = 0;
+                iParent.iMediaStartTime = 0;
+                iParent.ReleasePendingBufferIfExists();
+                iParent.iBufferQueue->Stop();
+                iParent.iMicSource.ResetBytesTransferred();
+                break;
+                }				
+			case EMsgPause:
+				{
+				iParent.iBufferQueue->Pause();
+                iParent.iState = OMX_StatePause;
+				break;
+				}
+			
+			case EMsgMediaTime:
+				{
+				iParent.ProcessMediaTimeUpdate(msg.iMediaTime);
+				break;
+				}
+
+			case EMsgRecord:
+				{
+				if (iParent.iInitialPendingBufferOffset >= 0)
+					{
+					iParent.iBufferQueue->FillFirstOpenMaxIlBuffer(
+						iParent.iInitialPendingBufferOffset,
+						iParent.iInitialPendingBufferLength);
+					iParent.iInitialPendingBufferOffset = -1;
+					}
+				else
+					{
+					iParent.iBufferQueue->RecordData();
+					}
+				break;
+				}
+
+            case EMsgStartRecording:
+                {
+				iParent.StartRecording();
+                break;
+                }				
+				
+			case EMsgCleanupBuffer:
+				{
+				iParent.iBufferQueue->Cleanup();
+				}
+				break;
+			case EMsgCloseDevice:
+				{
+				if(iParent.iMicSource.Handle())
+					{
+					iParent.iMicSource.Close();
+					}
+				}
+				break;
+				
+			case EResume:
+                {
+                iParent.iBufferQueue->Resume();
+                }
+                break;
+			    
+			default:
+				{
+				break;
+				}
+			}
+		}
+
+	// setup for next callbacks
+	iMsgQueue.NotifyDataAvailable(iStatus);
+	SetActive();
+	}
+
+void COmxILMicSourceProcessingFunction::CCommandsQueue::DoCancel()
+	{
+	iMsgQueue.CancelDataAvailable();
+	}
+
+TInt COmxILMicSourceProcessingFunction::CCommandsQueue::Pause()
+	{
+	DEBUG_PRINTF2(_L8("CCommandsQueue::Pause : IsActive[%s]"), (IsActive() ? "YES" : "NO"));
+	TProcMessage message;
+	message.iType = EMsgPause;
+	return iMsgQueue.Send(message);
+	}
+
+TInt COmxILMicSourceProcessingFunction::CCommandsQueue::Stop()
+	{
+	DEBUG_PRINTF2(_L8("CCommandsQueue::Stop : IsActive[%s]"), (IsActive() ? "YES" : "NO"));
+	TProcMessage message;
+	message.iType = EMsgStop;
+	return iMsgQueue.Send(message);
+	}
+
+TInt COmxILMicSourceProcessingFunction::CCommandsQueue::StopAndReset()
+    {
+    DEBUG_PRINTF2(_L8("CCommandsQueue::StopAndReset : IsActive[%s]"), (IsActive() ? "YES" : "NO"));
+    TProcMessage message;
+    message.iType = EMsgStopAndReset;
+    return iMsgQueue.Send(message);
+    }
+
+TInt COmxILMicSourceProcessingFunction::CCommandsQueue::RecordData()
+	{
+	DEBUG_PRINTF2(_L8("CCommandsQueue::RecordData : IsActive[%s]"), (IsActive() ? "YES" : "NO"));
+
+	TProcMessage message;
+	message.iType = EMsgRecord;
+
+	return iMsgQueue.Send(message);
+	}
+
+TInt COmxILMicSourceProcessingFunction::CCommandsQueue::StartRecording()
+    {
+    DEBUG_PRINTF2(_L8("CCommandsQueue::StartRecording : IsActive[%s]"), (IsActive() ? "YES" : "NO"));
+
+    TProcMessage message;
+    message.iType = EMsgStartRecording;
+
+    return iMsgQueue.Send(message);
+    }
+
+TInt COmxILMicSourceProcessingFunction::CCommandsQueue::MediaTimeIndication(
+	const OMX_TIME_MEDIATIMETYPE& aMediaTime)
+	{
+	DEBUG_PRINTF2(_L8("CCommandsQueue::MediaTimeIndication : IsActive[%s]"), (IsActive() ? "YES" : "NO"));
+
+	TProcMessage message;
+	message.iType = EMsgMediaTime;
+	message.iMediaTime = aMediaTime;
+
+	return iMsgQueue.Send(message);
+	}
+
+TInt COmxILMicSourceProcessingFunction::CCommandsQueue::CleanupBufferQueue()
+	{
+	DEBUG_PRINTF2(_L8("CCommandsQueue::CleanupBufferQueue : IsActive[%s]"), (IsActive() ? "YES" : "NO"));
+	TProcMessage message;
+	message.iType = EMsgCleanupBuffer;
+	return iMsgQueue.Send(message);
+	}
+
+TInt COmxILMicSourceProcessingFunction::CCommandsQueue::CloseDevice()
+	{
+	DEBUG_PRINTF2(_L8("CCommandsQueue::CloseDevice : IsActive[%s]"), (IsActive() ? "YES" : "NO"));
+	TProcMessage message;
+	message.iType = EMsgCloseDevice;
+	return iMsgQueue.Send(message);
+	}
+
+TInt COmxILMicSourceProcessingFunction::CCommandsQueue::Resume()
+    {
+    DEBUG_PRINTF2(_L8("CCommandsQueue::Resume : IsActive[%s]"), (IsActive() ? "YES" : "NO"));
+    TProcMessage message;
+    message.iType = EResume;
+    return iMsgQueue.Send(message);
+    }
+
+COmxILMicSourceProcessingFunction::CBufferQueue* COmxILMicSourceProcessingFunction::CBufferQueue::NewL(COmxILMicSourceProcessingFunction& aParent)
+	{
+	CBufferQueue* self = new (ELeave) CBufferQueue(aParent);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+    return self;
+	}
+
+COmxILMicSourceProcessingFunction::CBufferQueue::CBufferQueue(COmxILMicSourceProcessingFunction& aParent)
+	:CActive(EPriorityStandard),iParent(aParent), iIsSupplier(ETrue)
+	{
+	CActiveScheduler::Add(this);
+	}
+
+void COmxILMicSourceProcessingFunction::CBufferQueue::ConstructL()
+	{
+	DEBUG_PRINTF2(_L8("CBufferQueue::ConstructL : IsActive[%s]"), (IsActive() ? "YES" : "NO"));
+	User::LeaveIfError(iMutex.CreateLocal());
+	}
+
+COmxILMicSourceProcessingFunction::CBufferQueue::~CBufferQueue()
+	{
+	DEBUG_PRINTF2(_L8("CBufferQueue::~CBufferQueue : IsActive[%s]"), (IsActive() ? "YES" : "NO"));
+
+	Cancel();
+
+	iBuffersToFill.Reset();
+	if(iSharedChunk.Handle())
+		{
+		iSharedChunk.Close();
+		}
+
+	if(iParent.iMicSource.Handle())
+		{
+		iParent.iMicSource.Close();
+		}
+
+	iMutex.Close();
+	}
+
+void COmxILMicSourceProcessingFunction::CBufferQueue::RecordData()
+	{
+	DEBUG_PRINTF2(_L8("CBufferQueue::RecordData : IsActive[%s]"), (IsActive() ? "YES" : "NO"));
+
+	iMutex.Wait();
+	if(!IsActive())
+		{
+		iParent.iMicSource.RecordData(iStatus, iRecordedLength);
+		SetActive();
+		}
+	iMutex.Signal();
+	}
+
+OMX_ERRORTYPE
+COmxILMicSourceProcessingFunction::CBufferQueue::AllocateBuffer(OMX_U8*& aPortSpecificBuffer,
+																const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition)
+	{
+	DEBUG_PRINTF2(_L8("CBufferQueue::AllocateBuffer : IsActive[%s]"), (IsActive() ? "YES" : "NO"));
+
+	if (!iSharedChunk.Handle())
+		{
+		OMX_ERRORTYPE err;
+		if(OMX_ErrorNone != (err = CreateBuffer(aPortDefinition)))
+			{
+			return err;
+			}
+
+		iIsSupplier = ETrue;
+		iSharedBufferIndex = 0;
+		}
+	else
+		{
+		++iSharedBufferIndex;
+		}
+
+	ASSERT(iSharedBufferIndex < iSharedChuckConfig.iNumBuffers);
+	aPortSpecificBuffer = iSharedChunk.Base() + iSharedChuckConfig.iBufferOffsetList[iSharedBufferIndex];
+	DEBUG_PRINTF2(_L8("CBufferQueue::AllocateBuffer: [%X]"), aPortSpecificBuffer);
+	return OMX_ErrorNone;
+	}
+
+
+OMX_ERRORTYPE
+COmxILMicSourceProcessingFunction::CBufferQueue::UseBuffer(OMX_U8* /* apBuffer */,
+														   const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition)
+	{
+	DEBUG_PRINTF2(_L8("CBufferQueue::UseBuffer : IsActive[%s]"), (IsActive() ? "YES" : "NO"));
+
+	if(!iSharedChunk.Handle() || (iSharedChuckConfig.iBufferSizeInBytes < aPortDefinition.nBufferSize))
+		{
+		OMX_ERRORTYPE err;
+		if(OMX_ErrorNone != (err = CreateBuffer(aPortDefinition)))
+			{
+			return err;
+			}
+
+		iIsSupplier = EFalse;
+		}
+	return OMX_ErrorNone;
+	}
+
+OMX_ERRORTYPE
+COmxILMicSourceProcessingFunction::CBufferQueue::CreateBuffer(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition)
+	{
+	DEBUG_PRINTF2(_L8("CBufferQueue::CreateBuffer : IsActive[%s]"), (IsActive() ? "YES" : "NO"));
+
+	iSharedChuckConfig.iNumBuffers = aPortDefinition.nBufferCountActual;
+	iSharedChuckConfig.iBufferSizeInBytes = aPortDefinition.nBufferSize;
+	iSharedChuckConfig.iFlags = KScFlagBufOffsetListInUse;
+
+	//Enforce the sound driver to stop recording.
+	Stop();
+
+	TPckgBuf<TSharedChunkBufConfigBase> configBuf(iSharedChuckConfig);
+	RChunk chunk;
+	TInt ret = iParent.iMicSource.SetBufferChunkCreate(configBuf, chunk);
+	if(ret == KErrNone)
+		{
+		//RSoundSc::SetBufferChunkCreate give the chunk a handle owned by the thread only
+		//So we need to change the chunk handle to be shared by the whole process.
+		RThread thread;
+		iSharedChunk.SetHandle(chunk.Handle());
+		ret = iSharedChunk.Duplicate(thread);
+		thread.Close();
+
+		//Get the actual buffer configuration after the buffer creating call succeed.
+		TPtr8 sharedChunkBufConfigBuf(reinterpret_cast<TUint8*>(&iSharedChuckConfig), sizeof(TSharedChunkBufConfig));
+		iParent.iMicSource.GetBufferConfig(sharedChunkBufConfigBuf);
+		}
+
+	chunk.Close();
+
+	OMX_ERRORTYPE err;
+	switch(ret)
+		{
+		case KErrNone:
+			err = OMX_ErrorNone;
+			break;
+		case KErrNoMemory:
+			err = OMX_ErrorInsufficientResources;
+			break;
+		case KErrInUse:
+			err = OMX_ErrorIncorrectStateOperation;
+			break;
+		default:
+			err = OMX_ErrorBadParameter;
+			break;
+		};
+
+	return err;
+	}
+
+OMX_ERRORTYPE
+COmxILMicSourceProcessingFunction::CBufferQueue::QueueBuffer(OMX_BUFFERHEADERTYPE* apBufferHeader)
+	{
+	DEBUG_PRINTF2(_L8("CBufferQueue::QueueBuffer: [%X]"), apBufferHeader->pBuffer);
+
+	if(iIsSupplier)
+		{
+		//Empty buffer called from tunnelled port/client. Call on device to release the buffer
+		iParent.iMicSource.ReleaseBuffer(apBufferHeader->pBuffer - iSharedChunk.Base());
+		}
+
+	iMutex.Wait();
+		
+	iBuffersToFill.Append(apBufferHeader);
+	iMutex.Signal();
+
+	// If we are not in the executing state we want to queue the buffer to be filled but not start recording
+	if (iParent.iState != OMX_StateExecuting)
+	    {
+	    return OMX_ErrorNone;
+	    }
+	    
+	TInt err = iParent.iCommandsQueue->RecordData();
+	
+	return (err == KErrNone) ? OMX_ErrorNone : OMX_ErrorInsufficientResources;
+	}
+
+OMX_BOOL
+COmxILMicSourceProcessingFunction::CBufferQueue::RemoveBuffer(OMX_BUFFERHEADERTYPE* apBufferHeader)
+	{
+	DEBUG_PRINTF2(_L8("CBufferQueue::RemoveBuffer1: [%X]"), apBufferHeader->pBuffer);
+
+	TInt headerIndexInArray = KErrNotFound;
+
+	iMutex.Wait();
+	if (KErrNotFound !=	(headerIndexInArray = iBuffersToFill.Find(apBufferHeader)))
+		{
+		iBuffersToFill.Remove(headerIndexInArray);
+		}
+	iMutex.Signal();
+
+	return (headerIndexInArray == KErrNotFound) ? OMX_FALSE : OMX_TRUE;
+	}
+
+void COmxILMicSourceProcessingFunction::CBufferQueue::RemoveBuffer(OMX_PTR apPortSpecificBuffer)
+	{
+	DEBUG_PRINTF2(_L8("CBufferQueue::RemoveBuffer2 [%X]"), apPortSpecificBuffer);
+
+	if(!iIsSupplier)
+		{
+		iMutex.Wait();
+		RemoveBufferFromQueue(apPortSpecificBuffer);
+		iMutex.Signal();
+		}
+	}
+
+
+void COmxILMicSourceProcessingFunction::CBufferQueue::FreeBuffer(OMX_PTR apPortSpecificBuffer)
+	{
+	DEBUG_PRINTF2(_L8("CBufferQueue::FreeBuffer [%X]"), apPortSpecificBuffer);
+
+	iMutex.Wait();
+	if(iIsSupplier && iSharedChunk.Handle())
+		{
+		RemoveBufferFromQueue(apPortSpecificBuffer);
+		TBool found(EFalse);
+		for(TInt index = 0; index < iSharedChuckConfig.iNumBuffers; ++index)
+			{
+			OMX_PTR bufferAllocated = iSharedChunk.Base() + iSharedChuckConfig.iBufferOffsetList[index];
+			if(apPortSpecificBuffer == bufferAllocated)
+				{
+				found = ETrue;
+				break;
+				}
+			}
+
+		if(found && (--iSharedBufferIndex < 0))
+			{
+			//All buffers have been release by client
+			iSharedChunk.Close();
+			}
+		}
+	iMutex.Signal();
+	}
+
+void COmxILMicSourceProcessingFunction::CBufferQueue::RemoveBufferFromQueue(OMX_PTR apPortSpecificBuffer)
+	{
+	DEBUG_PRINTF2(_L8("CBufferQueue::RemoveBufferFromQueue : IsActive[%s]"), (IsActive() ? "YES" : "NO"));
+
+	const TUint bufferCount = iBuffersToFill.Count();
+	OMX_BUFFERHEADERTYPE* pBufferHeader = 0;
+
+	for (TUint i=0; i < bufferCount; ++i)
+		{
+		pBufferHeader = iBuffersToFill[i];
+		if(pBufferHeader->pBuffer == apPortSpecificBuffer)
+			{
+			iBuffersToFill.Remove(i);
+			break;
+			}
+		}
+	}
+
+
+void COmxILMicSourceProcessingFunction::CBufferQueue::FlushBuffers(OMX_DIRTYPE aDirection)
+	{
+	DEBUG_PRINTF2(_L8("CBufferQueue::FlushBuffers : IsActive[%s]"), (IsActive() ? "YES" : "NO"));
+
+	iMutex.Wait();
+	const TUint bufferCount = iBuffersToFill.Count();
+	OMX_BUFFERHEADERTYPE* pBufferHeader = 0;
+	for (TUint i=0; i < bufferCount; ++i)
+		{
+		pBufferHeader = iBuffersToFill[i];
+		pBufferHeader->nFilledLen = 0;
+		iParent.iCallbacks.BufferDoneNotification(
+				pBufferHeader,
+				pBufferHeader->nOutputPortIndex,
+				aDirection
+				);
+		}
+	// Empty buffer lists...
+	iBuffersToFill.Reset();
+
+	iMutex.Signal();
+	}
+
+void COmxILMicSourceProcessingFunction::CBufferQueue::RunL()
+	{
+	DEBUG_PRINTF2(_L8("CBufferQueue::RunL : IsActive[%s]"), (IsActive() ? "YES" : "NO"));
+
+	TInt chunkOffset = iStatus.Int(); 
+	if(iParent.iState != OMX_StateExecuting && iParent.iState != OMX_StatePause)
+        {
+        if (chunkOffset >= 0)
+            {
+            iParent.iMicSource.ReleaseBuffer(chunkOffset);
+            }
+        return;
+        }
+	    
+	    
+    TBool queueRecordRequest(ETrue); // whether we queue another RecordData request, if currently recording the driver will continue recording regardless of whether we make another call to RecordData	
+	if(chunkOffset < 0) // When negative the request status = error code
+        {
+        switch(chunkOffset)
+            {
+            case KErrCancel:
+                //Recording is paused or stoped
+                if(iParent.iState == OMX_StatePause)
+                    {
+                    // Handling transition to pause.
+                    // Normally we issue RecordData requests for all data buffered in the driver, when the
+                    // driver runs out of data it immediately completes with KErrCancel and we send an empty
+                    // buffer marked with EOS. 
+                    // nb. It is possible that all buffers returned during a pause are full length (though unlikely).
+                    // There is special handling in the buffer processing code so that if we run out of OMX buffers
+                    // before emptying the driver, we will mark the last OMX buffer with EOS and flush the driver.
+                    EmitEOSBuffer();
+                    iParent.TransitionToPauseFinished(); //the processing function can now complete the transition to paused state
+                    }
+                else //print out an error msg
+                    {
+                    DEBUG_PRINTF2(_L8("CBufferQueue::RunL : [KErrCancel] received in iParent.iState = [%d]"), static_cast<TInt>(iParent.iState));
+                    }
+                queueRecordRequest = EFalse;
+                break;
+            case KErrInUse:
+                //It's overflow error in term of OMX conception: The buffer was not available when it was needed.
+                DEBUG_PRINTF(_L8("CBufferQueue::RunL : KErrInUse"));
+                iParent.iCallbacks.ErrorEventNotification(OMX_ErrorOverflow);
+                break;
+            case KErrOverflow:
+				{
+                //RSoundSc has to overwrite pre-filled buffer.
+                //It's underflow error in term of OMX conception: buffer is filled before next is available.
+                DEBUG_PRINTF(_L8("CBufferQueue::RunL : KErrOverflow"));
+                iParent.iCallbacks.ErrorEventNotification(OMX_ErrorUnderflow);
+                
+                //In the event of an overflow our internal byte counter has fallen  
+                //behind the one in the driver by a number of buffers, we have no way
+                //of knowing how many, so we reinitialise.  Throwing away the data in the
+                //driver also gives us time to catch up and will result in one, longer loss of audio
+				//as opposed to potentially numerous, small ones
+                TInt upToDateBytesTrans = iParent.iMicSource.BytesTransferred();
+                iParent.ReleasePendingBufferIfExists();
+                iParent.iMicSource.CancelRecordData();
+                iParent.iMicSource.ResetBytesTransferred();
+                iParent.iMicSource.RecordData(iStatus, iRecordedLength);
+                SetActive();
+                iParent.iMediaStartTime += iParent.CalculateTimestamp(static_cast<TUint64>(upToDateBytesTrans));
+				}
+                break;
+            default:
+                queueRecordRequest = EFalse;
+                DEBUG_PRINTF2(_L8("CBufferQueue::RunL : [%d] -> OMX_ErrorHardware"), iStatus.Int());
+                iParent.iCallbacks.ErrorEventNotification(OMX_ErrorHardware);
+                break;
+            };    
+        }
+    else    // When positive the request status = offset of buffer in the chunk
+        {
+		iMutex.Wait();  
+        if (iBuffersToFill.Count() > 0)
+            {
+            OMX_BUFFERHEADERTYPE* pBufferHeader = iBuffersToFill[0];
+            iBuffersToFill.Remove(0);
+            TInt buffersToFill = iBuffersToFill.Count();
+ 			iMutex.Signal();
+
+			if((iParent.iState == OMX_StatePause) && (buffersToFill <= 0))
+			    {
+		        DEBUG_PRINTF(_L8("CBufferQueue::RunL - In transition to Pause. No more OMX buffers available to queue more RecodData. Forcing EOS and stopping recording!"));
+		        // We are pausing and have run out of OMX buffers so can not continue retrieving data from the driver,
+			    // therefore mark this buffer as the last one, send it out and discard further data.
+			    pBufferHeader->nFlags |= OMX_BUFFERFLAG_EOS;
+                FillOpenMaxIlBuffer(pBufferHeader, chunkOffset, iRecordedLength);
+			    queueRecordRequest = EFalse;
+			    FlushDriver();
+		        iParent.TransitionToPauseFinished();
+			    }
+			else
+			    {
+	            FillOpenMaxIlBuffer(pBufferHeader, chunkOffset, iRecordedLength);
+			    }
+
+            // Update the clock component with the current audio time using
+            // BytesTransferred() (rounded up to nearest integer). The
+            // reference time is the current media time (as seen from the audio
+            // device) to be notified to the clock component.
+            OMX_S64 bitsPerSample = ConvertEnumToBitsPerSample(iParent.iMicSourceSettings.iCurSoundFormat.iEncoding);
+            OMX_S64 sampleRate = ConvertEnumToSampleRate(iParent.iMicSourceSettings.iCurSoundFormat.iRate);
+            TUint64 bytesPerSec = (bitsPerSample / 8) * sampleRate;
+            
+            TUint64 bytesTicksPerSec = static_cast<TUint64>(iParent.iMicSource.BytesTransferred()) * static_cast<TUint64>(OMX_TICKS_PER_SECOND);
+            bytesTicksPerSec /= iParent.iMicSourceSettings.iCurSoundFormat.iChannels;
+            OMX_TICKS audioReferenceTime = ((bytesTicksPerSec + (bytesPerSec/2))/bytesPerSec);
+            
+            // The return code is ignored intentionally, since if the clock component is missing or cannot accept the audio reference, it should not affect the main processing
+            (void)iParent.ipClientClockPort->SetAudioReference(iParent.iMediaStartTime + audioReferenceTime);
+			
+            DEBUG_PRINTF2(_L8("CBufferQueue::RunL : bitsPerSample = [%d]"), bitsPerSample);
+            DEBUG_PRINTF2(_L8("CBufferQueue::RunL : sampleRate = [%d]"), sampleRate);
+            DEBUG_PRINTF2(_L8("CBufferQueue::RunL : bytesPerSec = [%d]"), bytesPerSec);
+            DEBUG_PRINTF2(_L8("CBufferQueue::RunL : number of channels = [%d]"), iParent.iMicSourceSettings.iCurSoundFormat.iChannels);
+
+            DEBUG_PRINTF2(_L8("CBufferQueue::RunL : iMicSource.BytesTransferred = [%d]"), iParent.iMicSource.BytesTransferred());
+            DEBUG_PRINTF2(_L8("CBufferQueue::RunL : bytesTicksPerSec = [%lu]"), bytesTicksPerSec);
+            DEBUG_PRINTF2(_L8("CBufferQueue::RunL : audioReferenceTime = [%d]"), audioReferenceTime);
+            DEBUG_PRINTF2(_L8("CBufferQueue::RunL : approx. [%f] sec data recorded from the driver so far"), (static_cast<TReal>(iParent.iTotalBytesRecorded)/static_cast<TReal>(iParent.iMicSourceSettings.iCurSoundFormat.iChannels))/static_cast<TReal>(bytesPerSec));
+            
+            }
+        else
+            {
+			// Unlock mutex that was lock before if statement
+			iMutex.Signal();
+            __ASSERT_DEBUG(iParent.iInitialPendingBufferOffset < 0, User::Panic(KOmxILMicSourcePFPanicCategory, 1));  // If we still have a buffer handed to us from the driver, that has not been copied into an OpenMAX buffer, we should never have queued another RecordData() request
+            queueRecordRequest = EFalse;    // the driver will continue recording, we will queue another RecordData() when this buffer has been used
+
+            if(iParent.iState == OMX_StatePause)
+                {
+                DEBUG_PRINTF(_L8("CBufferQueue::RunL - In transition to Pause. Data coming in from driver and no OMX buffer available to copy into. Unblocking client and stopping recording!"));
+                // We are pausing and have run out of OMX buffers so can not continue retrieving data from the driver,
+                // therefore unblock client. At this point we can not send any EOS buffers.
+                FlushDriver();
+                iParent.TransitionToPauseFinished();
+                }
+
+            iParent.iInitialPendingBufferOffset = chunkOffset;
+            iParent.iInitialPendingBufferLength = iRecordedLength;
+            }
+        }
+    iMutex.Wait();
+	TInt buffersToFillCount = iBuffersToFill.Count();
+    DEBUG_PRINTF2(_L8("CBufferQueue::RunL - number of buffers to fill: [%d]"), buffersToFillCount);
+	iMutex.Signal();
+
+    if (queueRecordRequest && (buffersToFillCount > 0) && !IsActive())
+        {
+        SetActive();
+        iParent.iMicSource.RecordData(iStatus, iRecordedLength);
+        DEBUG_PRINTF(_L8("CBufferQueue::RunL - issuing RecordData again"));
+        }    
+
+
+	}
+
+void COmxILMicSourceProcessingFunction::CBufferQueue::DoCancel()
+	{
+    DEBUG_PRINTF2(_L8("CBufferQueue::DoCancel : IsActive[%s]"), (IsActive() ? "YES" : "NO"));
+	if(iParent.iMicSource.Handle())
+		{
+		iParent.ReleasePendingBufferIfExists();
+		Stop();
+		}
+	}
+
+void COmxILMicSourceProcessingFunction::CBufferQueue::Cleanup()
+	{
+	DEBUG_PRINTF2(_L8("CBufferQueue::Cleanup : IsActive[%s]"), (IsActive() ? "YES" : "NO"));
+
+	if(IsActive())
+		{
+		Cancel();
+		}
+
+	iMutex.Wait();
+	iBuffersToFill.Reset();
+	if(iSharedChunk.Handle())
+		{
+		iSharedChunk.Close();
+		}
+	iMutex.Signal();
+	}
+
+
+void COmxILMicSourceProcessingFunction::CBufferQueue::FillFirstOpenMaxIlBuffer(
+	TInt aChunkOffset,
+	TInt aLengthOfData)
+    {
+	iMutex.Wait();
+	if (iBuffersToFill.Count() > 0)
+		{
+		OMX_BUFFERHEADERTYPE* pBuffer = iBuffersToFill[0];
+		iBuffersToFill.Remove(0);
+		// Better to unlock mutext before calling callback manager
+		iMutex.Signal();
+		FillOpenMaxIlBuffer(pBuffer, aChunkOffset, aLengthOfData);
+		}
+	else
+		{
+		iMutex.Signal();
+		}
+	}
+
+void COmxILMicSourceProcessingFunction::CBufferQueue::FillOpenMaxIlBuffer(OMX_BUFFERHEADERTYPE* aBufferHeader, TInt aChunkOffset, TInt aLengthOfData)
+    {
+    //************************************************************************************************************
+    // TODO: TEMPORARY WORKAROUND - If the length of data provided by the driver is greater than the buffer size,
+    // we set the the specificied data length to the maximum buffer length specified in the buffer header. This is
+    // to prevent descriptor overflow during the copy.
+    
+    // This is a known issue within the LDD (DTW-MM00769)   
+    if(aLengthOfData > aBufferHeader->nAllocLen)
+        {
+        aLengthOfData = aBufferHeader->nAllocLen;
+        }
+    //************************************************************************************************************
+    
+    aBufferHeader->nFilledLen = aLengthOfData;
+    aBufferHeader->nOffset = 0;
+    if(iIsSupplier)
+        {
+        //We are supplier so just use the buffer in the shared chunk
+        aBufferHeader->pBuffer = iSharedChunk.Base() + aChunkOffset;
+        }
+    else
+        {
+        //Have to do the data copy from shared chunk to supplied buffer
+        TPtr8 ptr(aBufferHeader->pBuffer, aBufferHeader->nAllocLen);
+        ptr.Copy(iSharedChunk.Base() + aChunkOffset, aLengthOfData);
+        iParent.iMicSource.ReleaseBuffer(aChunkOffset);
+        }
+
+    // Set the buffer timestamp and start flag if needed
+    aBufferHeader->nTimeStamp = iParent.CalculateTimestamp(static_cast<TUint64>(iParent.iTotalBytesRecorded));
+    if (iParent.iTotalBytesRecorded == 0)
+        {
+        aBufferHeader->nFlags |= OMX_BUFFERFLAG_STARTTIME;
+        }
+
+    // Update the total bytes recorded
+    iParent.iTotalBytesRecorded += aLengthOfData;
+
+    DEBUG_PRINTF2(_L8("CBufferQueue::FillOpenMaxIlBuffer : startTime = [%d]"), iParent.iMediaStartTime);
+    DEBUG_PRINTF2(_L8("CBufferQueue::FillOpenMaxIlBuffer : iTotalBytesRecorded = [%d]"), iParent.iTotalBytesRecorded);
+    DEBUG_PRINTF2(_L8("CBufferQueue::FillOpenMaxIlBuffer : OMX_TICKS_PER_SECOND = [%d]"), OMX_TICKS_PER_SECOND);
+    DEBUG_PRINTF2(_L8("CBufferQueue::FillOpenMaxIlBuffer : nTimeStamp = [%d]"), aBufferHeader->nTimeStamp);
+
+    iParent.iCallbacks.BufferDoneNotification(aBufferHeader, aBufferHeader->nOutputPortIndex, OMX_DirOutput); 
+    }
+
+void COmxILMicSourceProcessingFunction::CBufferQueue::Pause()
+    {
+    DEBUG_PRINTF2(_L8("CBufferQueue::Pause : IsActive[%s]"), (IsActive() ? "YES" : "NO"));
+    iParent.iMicSource.Pause();
+    if(!IsActive()) //no outstanding recorddata 
+        {
+        DEBUG_PRINTF(_L8("CBufferQueue::Pause - Not active. Seinding out EOS buffer and flushing driver!"));
+        // Almost certainly completly out of OMX buffers, but there is a slim chance that we have 
+        // just been given a buffer and there is a RecordData command queued behind this pause command...
+        // In this case the EmitEOSBuffer will send an empty buffer marked with EOS.
+        EmitEOSBuffer();
+        FlushDriver();
+        iParent.TransitionToPauseFinished();
+        }
+    //if BufferQueue is active it means that there is outstanding recorddata request
+    //therefore the transition to Paused state will be completed at a later point in RunL 
+    }
+
+void COmxILMicSourceProcessingFunction::CBufferQueue::Stop()
+    {
+    DEBUG_PRINTF2(_L8("CBufferQueue::Stop : IsActive[%s]"), (IsActive() ? "YES" : "NO"));
+    iParent.iMicSource.CancelRecordData();
+    }
+
+void COmxILMicSourceProcessingFunction::CBufferQueue::Resume()
+    {
+    DEBUG_PRINTF(_L8("CBufferQueue::Resume"));
+	// Make sure that to discard a partial buffer aggregated from the previous run (if exists). See the header file for more detailed explanation on iInitialPendingBufferOffset
+	iParent.iInitialPendingBufferOffset = -1;
+    if(!IsActive())
+        {
+        iParent.iMicSource.Resume();
+        SetActive();
+        iParent.iMicSource.RecordData(iStatus, iRecordedLength);
+        }
+    }
+
+
+void COmxILMicSourceProcessingFunction::CBufferQueue::EmitEOSBuffer()
+    {
+    DEBUG_PRINTF(_L8("CBufferQueue::EmitEOSBuffer"));
+    iMutex.Wait();  
+    if (iBuffersToFill.Count() > 0)
+        {
+        OMX_BUFFERHEADERTYPE* pBufferHeader = iBuffersToFill[0];
+        iBuffersToFill.Remove(0);
+        iMutex.Signal();
+        pBufferHeader->nFilledLen = 0;
+        pBufferHeader->nTimeStamp = iParent.CalculateTimestamp(static_cast<TUint64>(iParent.iTotalBytesRecorded));
+        pBufferHeader->nFlags |= OMX_BUFFERFLAG_EOS;
+        iParent.iCallbacks.BufferDoneNotification(pBufferHeader, pBufferHeader->nOutputPortIndex, OMX_DirOutput);
+        DEBUG_PRINTF(_L8("CBufferQueue::EmitEOSBuffer - Sending out empty OMX buffer marked with EOS flag!"));
+        }
+    else
+        {
+        iMutex.Signal();
+        DEBUG_PRINTF(_L8("CBufferQueue::EmitEOSBuffer - Error! No OMX bufferheader available to mark with EOS flag!"));
+        }
+    }
+
+void COmxILMicSourceProcessingFunction::CBufferQueue::FlushDriver()
+    {
+    DEBUG_PRINTF(_L8("CBufferQueue::FlushDriver"));
+    TRequestStatus status;
+    TInt recordedLength;
+    TInt error(KErrNone);
+    //flush the driver: fetch all buffers and throw them away until KErrCancel is received
+    //obviously this assumes that a Pause or Stop has been isssued prior to this
+    do  {
+        iParent.iMicSource.RecordData(status, recordedLength);
+        User::WaitForRequest(status);
+        error = status.Int();
+        if(error >= 0)
+            {
+            DEBUG_PRINTF3(_L8("CBufferQueue::FlushDriver - throwing away [%d] bytes of data from driver buffer [%d]"), error, recordedLength);
+            iParent.iMicSource.ReleaseBuffer(error);
+            }
+        } while(error!=KErrCancel);
+    
+    //Now correct the number of bytes received
+    iParent.iTotalBytesRecorded = iParent.iMicSource.BytesTransferred();
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmcapturer/src/omxilmicsourceprocessingfunction.h	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,234 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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
+   @internalComponent
+*/
+
+#ifndef OMXILMICSOURCEPROCESSINGFUNCTION_H
+#define OMXILMICSOURCEPROCESSINGFUNCTION_H
+
+#include <d32soundsc.h>
+#include <openmax/il/khronos/v1_x/OMX_Component.h>
+#include <openmax/il/common/omxilprocessingfunction.h>
+#include <e32msgqueue.h>
+
+/**
+    Mic Source PF Panic category
+*/
+_LIT(KOmxILMicSourcePFPanicCategory, "OmxILPcmCapturerProcFunctionPanic");
+
+// Forward declarations
+class MOmxILClockComponentCmdsIf;
+
+const TInt KMaxNumberOfSharedBuffers = 6;
+
+NONSHARABLE_CLASS(COmxILMicSourceProcessingFunction) :
+	public COmxILProcessingFunction
+	{
+
+public:
+	static COmxILMicSourceProcessingFunction* NewL(MOmxILCallbackNotificationIf& aCallbacks,
+												   MOmxILClockComponentCmdsIf& aClientClockPort);
+
+	~COmxILMicSourceProcessingFunction();
+
+	OMX_ERRORTYPE StateTransitionIndication(TStateIndex aNewState);
+	OMX_ERRORTYPE BufferFlushingIndication(TUint32 aPortIndex, OMX_DIRTYPE aDirection);
+	OMX_ERRORTYPE ParamIndication(OMX_INDEXTYPE aParamIndex, const TAny* apComponentParameterStructure);
+	OMX_ERRORTYPE ConfigIndication(OMX_INDEXTYPE aConfigIndex, const TAny* apComponentConfigStructure);
+
+	OMX_ERRORTYPE BufferIndication(OMX_BUFFERHEADERTYPE* apBufferHeader, OMX_DIRTYPE aDirection);
+	OMX_ERRORTYPE MediaTimeIndication(const OMX_TIME_MEDIATIMETYPE& aMediaTime);
+
+	OMX_BOOL BufferRemovalIndication(OMX_BUFFERHEADERTYPE* apBufferHeader, OMX_DIRTYPE aDirection);
+
+	OMX_ERRORTYPE DoBufferAllocation(OMX_U32 aSizeBytes, OMX_U8*& apPortSpecificBuffer, OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition);
+	void DoBufferDeallocation(OMX_PTR apPortSpecificBuffer, OMX_PTR apPortPrivate);
+	OMX_ERRORTYPE DoBufferWrapping(OMX_U32 aSizeBytes, OMX_U8* apBuffer, OMX_PTR& apPortPrivate, OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition);
+	void DoBufferUnwrapping(OMX_PTR apPortSpecificBuffer, OMX_PTR apPortPrivate);
+
+	void FillParamPCMModeType(OMX_AUDIO_PARAM_PCMMODETYPE& aPcmModeType) const;
+	TInt GetVolume() const;
+	
+	OMX_TICKS CalculateTimestamp(TUint64 aBytesTransSinceStart);	
+    void ReleasePendingBufferIfExists();	
+    
+private:
+	COmxILMicSourceProcessingFunction(MOmxILCallbackNotificationIf& aCallbacks,
+									  MOmxILClockComponentCmdsIf& aClientClockPort);
+	void ConstructL();
+
+	void FlushBufferList(RPointerArray<OMX_BUFFERHEADERTYPE>& aBufferList);
+	OMX_ERRORTYPE PostVolumeChangeEvent();
+	OMX_ERRORTYPE PostAudioFormatChangeEvent();
+
+	void ProcessMediaTimeUpdate(const OMX_TIME_MEDIATIMETYPE& aMediaTime);
+	void StartRecording();
+
+	static OMX_U32 ConvertEnumToSampleRate(TSoundRate aEnum);
+	static TSoundRate ConvertEnumToSampleRate(OMX_U32 aSampleRate);
+	static OMX_U32 ConvertEnumToBitsPerSample(TSoundEncoding aEnum);
+
+	void WaitForTransitionToPauseToFinish();
+	void TransitionToPauseFinished();	
+private:
+	OMX_STATETYPE iState;
+	RSoundSc iMicSource;
+	
+	//We have to start recording when:
+	//-We receive a call to move to executing state and clock port is disabled
+	//-We receive a call to move to executing state and the clock is running or vice versa
+	//As a result we must call RecordData() on the driver but may not have an OpenMAX IL
+	//buffer to fill.  On completion of this first RecordData() call if we still do not 
+	//have an OMX buffer to fill then we store the details of the buffer within the shared
+	//chunk in these member variables.  There is no need to queue a second RecordData(),
+	//the driver will continue recording.
+	TInt iInitialPendingBufferOffset;
+	TInt iInitialPendingBufferLength;
+	
+	static const OMX_U32 KSampleRates[];
+
+	class TSharedChunkBufConfig : public TSharedChunkBufConfigBase
+		{
+	public:
+		TInt iBufferOffsetList[KMaxNumberOfSharedBuffers];
+		};
+
+	class TMicrophoneSettings
+		{
+	public:
+		//Settings in RSoundSc
+		TInt iVolume;
+		TBool iMute;
+		TCurrentSoundFormatV02 iCurSoundFormat;
+		TSoundFormatsSupportedV02 iSupportedSoundFormat;
+		} iMicSourceSettings;
+
+	class CBufferQueue : public CActive
+		{
+	public:
+		static CBufferQueue* NewL(COmxILMicSourceProcessingFunction& aParent);
+		~CBufferQueue();
+
+		// from CActive
+		void RunL();
+		void DoCancel();
+
+		void RecordData();
+		void Cleanup();
+
+        void Pause();
+        void Stop();
+        void Resume();
+        
+        OMX_ERRORTYPE AllocateBuffer(OMX_U8*& aPortSpecificBuffer, const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition);
+		OMX_ERRORTYPE UseBuffer(OMX_U8* apBuffer, const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition);
+		void RemoveBuffer(OMX_PTR apPortSpecificBuffer);
+		void FreeBuffer(OMX_PTR aPortSpecificBuffer);
+
+		OMX_ERRORTYPE QueueBuffer(OMX_BUFFERHEADERTYPE* apBufferHeader);
+		OMX_BOOL RemoveBuffer(OMX_BUFFERHEADERTYPE* apBufferHeader);
+		void FlushBuffers(OMX_DIRTYPE aDirection);
+		void FillFirstOpenMaxIlBuffer(TInt aChunkOffset, TInt aLengthOfData);
+
+	private:
+		CBufferQueue(COmxILMicSourceProcessingFunction& aParent);
+		void ConstructL();
+		OMX_ERRORTYPE CreateBuffer(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition);
+		void RemoveBufferFromQueue(OMX_PTR apPortSpecificBuffer);
+		void FillOpenMaxIlBuffer(OMX_BUFFERHEADERTYPE* aBufferHeader, TInt aChunkOffset, TInt aLengthOfData);
+		void EmitEOSBuffer();
+        void FlushDriver();
+
+	private:
+		COmxILMicSourceProcessingFunction& iParent;
+
+		RChunk iSharedChunk;
+		TSharedChunkBufConfig iSharedChuckConfig;
+		TInt iSharedBufferIndex;
+		TInt iRecordedLength;
+
+		TBool iIsSupplier;
+		RFastLock iMutex;
+		RPointerArray<OMX_BUFFERHEADERTYPE> iBuffersToFill;
+		} *iBufferQueue;
+
+
+	class CCommandsQueue : public CActive
+		{
+	public:
+		static CCommandsQueue* NewL(COmxILMicSourceProcessingFunction& aParent);
+		~CCommandsQueue();
+
+		// from CActive
+		void RunL();
+		void DoCancel();
+
+		TInt Pause();
+		TInt Stop();
+        TInt StopAndReset();		
+		TInt RecordData();
+		TInt StartRecording();
+		TInt MediaTimeIndication(const OMX_TIME_MEDIATIMETYPE& aMediaTime);
+		TInt CleanupBufferQueue();
+		TInt CloseDevice();
+		TInt Resume();
+		
+		enum TMessageType
+			{
+			EMsgPause,
+			EMsgStop,
+            EMsgStopAndReset,			
+			EMsgRecord,
+			EMsgStartRecording,
+			EMsgMediaTime,
+			EMsgCleanupBuffer,
+			EMsgCloseDevice,
+			EResume
+			};
+
+		class TProcMessage
+			{
+		public:
+			TMessageType iType;
+			OMX_TIME_MEDIATIMETYPE iMediaTime;
+			};
+
+		RMsgQueue<TProcMessage> iMsgQueue;
+
+	private:
+		CCommandsQueue(COmxILMicSourceProcessingFunction& aParent);
+		void ConstructL();
+
+	private:
+		static const TInt KMaxMsgQueueEntries = 10;
+		COmxILMicSourceProcessingFunction& iParent;
+		} *iCommandsQueue;
+
+	MOmxILClockComponentCmdsIf* ipClientClockPort;
+	OMX_TICKS iMediaStartTime;
+	TUint iTotalBytesRecorded;
+	
+	TBool iStartedRecording;     //To ensure we don't initialise recording twice
+	TThreadId iOwnerThreadId;
+	CActiveSchedulerWait* iTransitionToPauseWait;
+	RSemaphore iTransitionToPauseWaitSemaphore;
+	};
+
+#endif // OMXILMICSOURCEPROCESSINGFUNCTION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmcapturer/testscript/compconf_capturer_pcm.txt	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,83 @@
+;; cc <testname> : conformance test component (sets appropriate flags, adds all tests, tests component)
+;; st <traceflags>: OMX_CONF_SetTraceflags(<traceflags>);
+;; ol <logfilename>: OMX_OSAL_OpenLogfile(<logfilename>);
+;; cl : OMX_OSAL_CloseLogfile();
+;; at <testname>: OMX_CONF_AddTest(<testname>);
+;; rt <testname>: OMX_CONF_RemoveTest(<testname>);
+;; mi <inputfilename> <portindex> : OMX_CONF_MapInputfile(<inputfilename>,<portindex>);
+;; tc <testname>: OMX_CONF_TestComponent(<testname>);
+;; ps: OMX_CONF_PrintSettings();
+;; h: OMX_CONF_PrintHelp();
+;; lt: list all available tests.
+;; lc: list all available components.
+
+
+; setup tracing, open logfile
+st 0x7F ; (OMX_OSAL_TRACE_PASSFAIL|OMX_OSAL_TRACE_CALLSEQUENCE|OMX_OSAL_TRACE_PARAMTERS|OMX_OSAL_TRACE_INFO|OMX_OSAL_TRACE_ERROR|OMX_OSAL_TRACE_BUFFER|OMX_OSAL_TRACE_WARNING)
+ol c:\compconf_test_audio_capaturer.txt 
+
+; add tests
+
+; Base Profile Tests
+
+;; ============
+;; Passed tests
+;; vvvvvvvvvvvv
+at StateTransitionTest
+at ComponentNameTest
+at BaseParameterTest
+at BufferTest
+at BufferFlagTest
+at FlushTest
+at BaseMultiThreadedTest
+at PortCommunicationTest
+at ResourceExhaustionTest
+;; ^^^^^^^^^^^^
+;; Passed tests
+;; ============
+
+
+; Interop Profile Tests
+
+
+;; ============
+;; Passed tests
+;; vvvvvvvvvvvv
+at InteropParameterTest
+at ValidInputOutputTest
+at InvalidInputOutputTest
+at PortBufferSupplierTest
+at PortDisableEnableTest
+at IncompleteStopTest
+at MinPayloadSizeTest
+at InteropMultiThreadedTest
+at TunnelledUnitTest
+;; ^^^^^^^^^^^^
+;; Passed tests
+;; ============
+
+
+
+;; Problem Resource Manager : Functionality not existent
+; at ResourcePreemptionTest
+; at WaitForResourcesTest
+
+;; Non-applicable tests
+; at ClockComponentTest
+; at SeekingComponentTest
+
+; Standard Component Class Tests
+
+;; ============
+;; Passed tests
+;; vvvvvvvvvvvv
+;at StdAudioCapturerTest
+;; ^^^^^^^^^^^^
+;; Passed tests
+;; ============
+
+; test components
+tc OMX.NOKIA.AUDIO.CAPTURER.PCM
+
+; close logfile
+cl
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmrenderer/group/bld.inf	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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_MMPFILES
+// Components
+../mmpfiles/omxilpcmrenderer.mmp
+
+PRJ_EXPORTS
+// Romkit include files
+../inc/omxilsymbianaudiopcmextensions.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/extensions/omxilsymbianaudiopcmextensions.h)
+
+
+// We do not include the pcmrenderer tests here because they depend on the testframework which does not exist in NCP builds.
+// They are built via the omxilunittest bld.inf (which NCP does not include)
+//#include "..\unittest\group\bld.inf"
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmrenderer/inc/mdasoundadapter.h	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,241 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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 MDASOUNDADAPTER_H
+#define MDASOUNDADAPTER_H
+
+#include <e32std.h>
+#include <e32ver.h>
+
+	
+#define MDADEVSOUNDNAME _L8("RMdaDevSound")
+
+/*
+ Adapter class which routes the calls on RMdaDevSound(old sound driver interface) to RSoundSc(new sound driver interface). 
+ The purpose of this class is to use the new sound driver in MDF without changing the calling code. This class
+ does not support any new functionalities supported by the shared chunk sound driver but supports the functionality of the 
+ of the old driver with the new driver.
+ */
+class RMdaDevSound
+	{
+	class CBody;
+public:
+	/*
+	enum for major, minor and build version of sound device driver.
+	*/
+	enum TVer {EMajorVersionNumber=1,EMinorVersionNumber=0,EBuildVersionNumber=KE32BuildVersionNumber};
+    /*
+	enum for sound media device play/record request.
+	*/
+	enum TMdaRequest
+		{
+		/* Play data request */
+		EMdaRequestPlayData,
+		/* Play error notification */
+		EMdaRequestPlayErrorNotification,
+		/* Record data request */
+		EMdaRequestRecordData,
+		/* Record error notification */
+		EMdaRequestRecordErrorNotification
+		};
+	
+	/* enum for media device control request */
+	enum TMdaControl
+		{
+		/* play format (capability) supported request */
+		EMdaControlPlayFormatsSupported,
+		/* get the current play format request */
+		EMdaControlGetPlayFormat,
+		/* set the play format request  */
+		EMdaControlSetPlayFormat,
+		/* get play volume request */
+		EMdaControlGetPlayVolume,
+		/* set play volume request */
+		EMdaControlSetPlayVolume,
+		/* record format supported request */
+		EMdaControlRecordFormatsSupported,
+		/* get the current record format request */
+		EMdaControlGetRecordFormat,
+		/* set record format request */
+		EMdaControlSetRecordFormat,
+		/* get record volume request */
+		EMdaControlGetRecordLevel,
+		/* set record volume request */
+		EMdaControlSetRecordLevel,
+		/* stop play request */
+		EMdaControlFlushPlayBuffer,
+		/* stop record request */
+		EMdaControlFlushRecordBuffer,
+		/* bytes played request  */
+		EMdaControlBytesPlayed,
+		/* set base value for the bytes played */
+		EMdaControlResetBytesPlayed,
+		/* Investigate for sound media driver request */
+		EMdaControlIsMdaSound,
+		/* pause play request */
+		EMdaControlPausePlayBuffer,
+		/* resume play request */
+		EMdaControlResumePlaying
+		};
+		
+	/*
+    This enum corresponds to supported sound encoding schemes
+    */
+	enum TMdaSoundEncoding
+		{
+		/* sound encoding(compression) using 8 bit PCM (pulse code modulation) */
+		EMdaSoundEncoding8BitPCM		= 0x00000001,
+		/* sound encoding using 16 bit PCM */
+		EMdaSoundEncoding16BitPCM		= 0x00000002,
+		/* sound encoding using 8 bit A law */
+		EMdaSoundEncoding8BitALaw		= 0x00000004,
+		/* sound encoding using 8 bit Mu law */
+		EMdaSoundEncoding8BitMuLaw		= 0x00000008,
+		};
+		
+	/*
+    This class corresponds to a supported sound format.
+	The format describes the supported audio device's min/max sampling rate, encoding, channels and buffer size of play/record and volume.
+    */
+	class TSoundFormatsSupported
+		{
+	public:
+	/*
+    This corresponds to minimum sample rate supported. This depends on the physical sound device used(example: 8000 hertz). 
+    */
+		TInt iMinRate;
+		
+	/*
+    This corresponds to maximum sample rate supported. This depends on the physical sound device used(example: 48000 hertz).
+    */
+		TInt iMaxRate;
+		
+	/*
+    This corresponds to encoding format supported.  
+	@see  TMdaSoundEncoding
+    */		
+		TUint32 iEncodings;
+		
+	/*
+    This corresponds to the number of sound channels supported. Possible values are EMono for a single channel and EStereo for two channel sound.
+	Also this depends on the physical device used.
+    */
+		TInt iChannels;
+		
+	/*
+    This corresponds to minimum buffer size. This depends on the physical device used and sampling rate adapted.
+	@see KSoundMinBufferSize
+    */
+		TInt iMinBufferSize;
+		
+	/*
+    This corresponds to maximum buffer size.This depends on the physical device used and sampling rate adapted. 
+	@see KSoundPlayBufferSize
+    @see KSoundRecordBufferSize
+    */
+		TInt iMaxBufferSize;
+
+	/*
+    This corresponds to minimum play/record volume. 
+    */	
+		TInt iMinVolume;
+		
+	/*
+    This corresponds to maximum play/record volume. 
+    */
+		TInt iMaxVolume;
+		};
+
+	/* A typedef'd packaged RMdaDevSound::TSoundFormatsSupported for passing through a generic API method */
+	typedef TPckgBuf<TSoundFormatsSupported> TSoundFormatsSupportedBuf;
+
+	/*
+    This class corresponds to current supported sound format. 
+	The format describes the supported audio device's sampling rate, encoding, channels and buffer size of play/record.
+    */
+	class TCurrentSoundFormat
+		{
+	public:
+	/*
+    This corresponds to sound sampling rate like (44000 Hertz, 8000 Hertz). The possible values depends on the physical device used.
+    */
+		TInt iRate;
+		
+	/*
+    @see TMdaSoundEncoding
+    */
+		TMdaSoundEncoding iEncoding;
+		
+	/*
+    This corresponds to the number of sound channels supported. Possible values are EMono for a single channel and EStereo for two channel sound.
+	Also this depends on the physical device used.
+    */
+		TInt iChannels;
+		
+	/*
+    Play or Record buffer size. The possible value depends on the physical device used. 
+    */
+		TInt iBufferSize;
+		};
+
+	/* A typedef'd packaged RMdaDevSound::TCurrentSoundFormat for passing through a generic API method */
+	typedef TPckgBuf<TCurrentSoundFormat> TCurrentSoundFormatBuf;
+public:
+	RMdaDevSound();
+	TInt Open(TInt aUnit=KNullUnit);
+	TVersion VersionRequired() const;
+	TInt IsMdaSound();
+	void PlayFormatsSupported(TSoundFormatsSupportedBuf& aFormatsSupported);
+	void GetPlayFormat(TCurrentSoundFormatBuf& aFormat);
+	TInt SetPlayFormat(const TCurrentSoundFormatBuf& aFormat);
+	TInt PlayVolume();
+	// This function mimics RMdaDevSound interface with linear volume semantics
+	void SetPlayVolume(TInt aLinearVolume);
+	// This function supports volume change with logarithmic semantics
+	void SetVolume(TInt aLogarithmicVolume);
+	void PlayData(TRequestStatus& aStatus,const TDesC8& aData);
+	void CancelPlayData();
+	void NotifyPlayError(TRequestStatus& aStatus);
+	void CancelNotifyPlayError();
+
+	void RecordFormatsSupported(TSoundFormatsSupportedBuf& aFormatsSupported);
+	void GetRecordFormat(TCurrentSoundFormatBuf& aFormat);
+	TInt SetRecordFormat(const TCurrentSoundFormatBuf& aFormat);
+	TInt RecordLevel();
+	void SetRecordLevel(TInt aLevel);
+	void RecordData(TRequestStatus& aStatus,TDes8& aData);
+	void CancelRecordData();
+	void NotifyRecordError(TRequestStatus& aStatus);
+	void CancelNotifyRecordError();
+
+	void FlushPlayBuffer();
+	void FlushRecordBuffer();
+	TInt BytesPlayed();
+	void ResetBytesPlayed();
+	void PausePlayBuffer();
+	void ResumePlaying();
+	void ResumePlaying(TRequestStatus&);
+	void Close();
+	TInt Handle();
+	void PauseRecordBuffer();
+	void ResumeRecording();
+	TInt GetTimePlayed(TTimeIntervalMicroSeconds& aTimePlayed);
+private:
+	CBody* iBody;
+	};
+	
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmrenderer/inc/omxilsymbianaudiopcmextensions.h	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,91 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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
+ @publishedPartner@prototype
+*/
+
+#ifndef OMXILSYMBIANAUDIOPCMEXTENSIONS_H
+#define OMXILSYMBIANAUDIOPCMEXTENSIONS_H
+
+
+#include <openmax/il/khronos/v1_x/OMX_Types.h>
+
+
+/**
+ * The string that the Symbian's OpenMAX IL PCM Renderer component will
+ * translate into a 32-bit OpenMAX IL index (@see
+ * OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP) to support the
+ * Volume Ramp feature of the MPlayCustomInterface CI
+ */
+const char sOmxSymbianPcmVolumeRamp [] =
+	"OMX.Symbian.index.config.audio.pcm.volumeramp";
+
+
+/**
+ * Custom index used by Symbian's OpenMAX IL PCM renderer to select the
+ * structure for setting/getting a Volume Ramp configuration data item
+ */
+#define OMX_SymbianIndexConfigAudioPcmVolumeRamp 0x7F000002
+
+
+/**
+ * Custom OpenMAX IL structure to be used as a container for an
+ * Volume Ramp configuration data item
+ */
+struct OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP
+	{
+    OMX_U32 nSize;                 /**< Size of this structure, in Bytes */
+    OMX_VERSIONTYPE nVersion;      /**< OMX specification version information */
+    OMX_U32 nPortIndex;            /**< Port that this structure applies to */
+    OMX_U64 nRampDuration;         /**< the period, in microseconds, over which the volume level is 
+    								   to rise smoothly from nothing to the 
+    								   required volume level */
+	};
+
+/**
+ * The string that the Symbian's OpenMAX IL PCM Renderer component will
+ * translate into a 32-bit OpenMAX IL index (@see
+ * OMX_SYMBIAN_AUDIO_CONFIG_PCM_BYTESPLAYED) to support the
+ * Bytes Played feature of the MPlayCustomInterface CI
+ */
+const char sOmxSymbianPcmBytesPlayed [] =
+	"OMX.Symbian.index.config.audio.pcm.bytesplayed";
+
+
+/**
+ * Custom index used by Symbian's OpenMAX IL PCM renderer to select the
+ * structure for getting a Bytes Played configuration data item
+ */
+#define OMX_SymbianIndexConfigAudioBytesPlayed 0x7F000003
+
+
+/**
+ * Custom OpenMAX IL structure to be used as a container for an
+ * Bytes Played configuration data item
+ */
+struct OMX_SYMBIAN_AUDIO_CONFIG_PCM_BYTESPLAYED
+	{
+    OMX_U32 nSize;                 /**< Size of this structure, in Bytes */
+    OMX_VERSIONTYPE nVersion;      /**< OMX specification version information */
+    OMX_U32 nBytesPlayed;          /**< the number of bytes played */
+	};
+
+
+#endif // OMXILSYMBIANAUDIOPCMEXTENSIONS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmrenderer/mmpfiles/omxilpcmrenderer.mmp	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,60 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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                   
+// @SYMPurpose
+// 
+//
+
+#include                "../src/omxilpcmrenderer.hrh"
+
+TARGET                  omxilpcmrenderer.dll
+CAPABILITY              ALL -TCB
+TARGETTYPE              plugin
+UID                     0x10009D8D KUidSymbianOmxILPcmRendererDll
+VENDORID                0x70000001
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+USERINCLUDE             ../src
+USERINCLUDE				../inc
+
+SOURCEPATH              ../src
+SOURCE					omxilpcmrenderer.cpp
+SOURCE					omxilpcmrendererapb0port.cpp
+SOURCE					omxilpcmrendererprocessingfunction.cpp
+SOURCE					omxilpcmrendererconfigmanager.cpp
+
+SOURCE	mdasoundadapter.cpp
+SOURCE	mdasoundadapterbody.cpp
+
+SOURCE rateconvert.cpp
+
+
+RESOURCE	 			omxilpcmrenderer.rss
+
+LIBRARY					euser.lib
+LIBRARY					ecom.lib
+LIBRARY					hal.lib
+LIBRARY					omxilcomponentcommon.lib
+STATICLIBRARY			omxilcomponentif.lib
+
+// Uncomment to activate debug tracing in this module
+// MACRO				_OMXIL_PCMRENDERER_DEBUG_TRACING_ON
+
+// Uncomment to enable MIME type checking during tunnel compatibility checks
+// MACRO				_OMXIL_PCMRENDERER_CHECK_MIME_TYPE_ON
+
+// MACRO			        _OMXIL_PCMRENDERER_INCONTEXT_CALLBACKMANAGER_ON
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmrenderer/src/log.h	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,153 @@
+/*
+* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 __PCMRENDERER_LOG_H__
+#define __PCMRENDERER_LOG_H__
+
+#include <e32debug.h>
+
+namespace DSD
+{
+
+#ifdef _DEBUG
+
+#ifdef _OMXIL_PCMRENDERER_DEBUG_TRACING_ON
+
+#define DEBUG_PRINTF(a) {DSD::DebugPrintf(__LINE__, __FILE__, a);}
+#define DEBUG_PRINTF2(a, b) {DSD::DebugPrintf(__LINE__, __FILE__, a, b);}
+#define DEBUG_PRINTF3(a, b, c) {DSD::DebugPrintf(__LINE__, __FILE__, a, b, c);}
+#define DEBUG_PRINTF4(a, b, c, d) {DSD::DebugPrintf(__LINE__, __FILE__, a, b, c, d);}
+#define DEBUG_PRINTF5(a, b, c, d, e) {DSD::DebugPrintf(__LINE__, __FILE__, a, b, c, d, e);}
+
+#define DEBUG_CODE_SECTION(a) TRAP_IGNORE({ a; }) 
+
+class TTruncateOverflowHandler16 : public TDes16Overflow
+	{
+	public:
+		virtual void Overflow( TDes16& aDes );
+	};
+	
+inline void TTruncateOverflowHandler16::Overflow( TDes16& aDes)
+	{
+	_LIT(KErrOverflowMsg,"Descriptor Overflow, hence value truncated");
+	if( aDes.MaxLength() >= KErrOverflowMsg().Length() + aDes.Length() )
+     	aDes.Append(KErrOverflowMsg);
+	}
+	
+class TTruncateOverflowHandler8 : public TDes8Overflow
+	{
+	public:
+		virtual void Overflow( TDes8& aDes );
+	};
+	
+inline void TTruncateOverflowHandler8::Overflow( TDes8& aDes)
+	{
+    _LIT(KErrOverflowMsg,"Descriptor Overflow, hence value truncated");
+	if( aDes.MaxLength() >= KErrOverflowMsg().Length() + aDes.Length() )
+     	aDes.Append(KErrOverflowMsg);
+	}
+
+// UTF-8 overload of the DebufPrintf method. Should be used by default,
+// since it's cheaper both in CPU cycles and stack space.
+
+inline void DebugPrintf(TInt aLine, char* aFile, TRefByValue<const TDesC8> aFormat, ...)
+	{
+	TTruncateOverflowHandler8 overflowHandler8;
+	VA_LIST list;
+	//coverity[var_decl]
+	// Disabled Coverity warning, since it does not support vararg and throws a warning		
+	VA_START(list, aFormat);
+	
+	TTime now;
+	now.HomeTime();
+	
+	TBuf8<1024> buffer;
+	_LIT8(KSwiLogPrefix, "[pcmrend] ");
+	_LIT8(KSwiLineFileFormat, "TID[%d] : [%s:%d] -- ");
+	buffer.Append(KSwiLogPrefix);
+	RThread thread;
+	TUint threadId = thread.Id();
+	thread.Close();
+	RProcess proc;
+	TFileName fName = proc.FileName();
+	proc.Close();
+	buffer.AppendFormat(KSwiLineFileFormat, threadId, aFile, aLine);
+	buffer.AppendFormatList(aFormat, list ,&overflowHandler8 );
+	// coverity[uninit_use_in_call]
+	// See comment on Coverity at the start of the function. The comment above silences a Coverity false positive	
+	buffer.Append(_L8("\r\n"));
+	
+	RDebug::RawPrint(buffer);
+	
+	VA_END(list);
+	}
+	
+// Unicode DebufPrintf overload
+
+inline void DebugPrintf(TInt aLine, char* aFile, TRefByValue<const TDesC16> aFormat, ...)
+	{
+	TTruncateOverflowHandler16 overflowHandler16;
+	VA_LIST list;
+	VA_START(list, aFormat);
+	
+	TTime now;
+	now.HomeTime();
+	
+	TBuf8<256> header;
+	_LIT8(KSwiLogPrefix, "[pcmrenderer] ");
+	_LIT8(KSwiLineFileFormat, "%Ld Line: % 5d, File: %s -- ");
+	header.Append(KSwiLogPrefix);
+	header.AppendFormat(KSwiLineFileFormat, now.Int64(), aLine, aFile);
+	
+	TBuf<1024> buffer;
+	buffer.Copy(header);
+	buffer.AppendFormatList(aFormat, list ,&overflowHandler16);
+	buffer.Append(_L("\r\n"));
+	
+	RDebug::RawPrint(buffer);
+	
+	VA_END(list);
+	}
+#else
+
+#define DEBUG_PRINTF(a)
+#define DEBUG_PRINTF2(a, b)
+#define DEBUG_PRINTF3(a, b, c)
+#define DEBUG_PRINTF4(a, b, c, d)
+#define DEBUG_PRINTF5(a, b, c, d, e)
+
+#define DEBUG_CODE_SECTION(a)
+
+#endif
+
+#else
+
+#define DEBUG_PRINTF(a)
+#define DEBUG_PRINTF2(a, b)
+#define DEBUG_PRINTF3(a, b, c)
+#define DEBUG_PRINTF4(a, b, c, d)
+#define DEBUG_PRINTF5(a, b, c, d, e)
+
+#define DEBUG_CODE_SECTION(a)
+
+#endif
+
+
+} // namespace DSD
+
+#endif // __PCMRENDERER_LOG_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmrenderer/src/mdasoundadapter.cpp	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,488 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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 "mdasoundadapter.h"
+#include "mdasoundadapterbody.h"
+#include <e32debug.h>
+
+RMdaDevSound::RMdaDevSound()
+	:iBody(NULL)
+	{
+	}
+		
+/*
+ @capability MultimediaDD
+ 
+ This function creates the handle to the sound media driver.
+ 
+ @param aUnit	A unit of the device.
+ 
+ @return KErrNone on success, otherwise system wide error code.
+ 
+ @capability MultimediaDD
+*/
+TInt RMdaDevSound::Open(TInt aUnit)
+	{
+	TInt err = KErrNone;
+	if(iBody == NULL)
+		{
+		TRAP(err, iBody = RMdaDevSound::CBody::NewL());
+		}
+	if(err == KErrNone)
+		{
+		err = iBody->Open(aUnit);
+		}
+	return err;
+	}
+
+/*
+ Gets the version object of sound media driver.
+
+@return version object.
+
+*/
+TVersion RMdaDevSound::VersionRequired() const
+	{
+	if(iBody)
+		{
+		return iBody->VersionRequired();
+		}
+	return TVersion();
+	}
+
+/*
+ Indicates whether the driver is sound media driver.
+
+@return KErrNone on success, otherwise System wide error code.
+
+*/
+TInt RMdaDevSound::IsMdaSound()
+	{
+	return iBody->IsMdaSound();
+	}
+
+/*
+ This function gets the play volume. 
+ The range of volume level supported depends on the physical audio device used.
+
+@return Volume level.
+
+*/
+TInt RMdaDevSound::PlayVolume()
+	{
+	__ASSERT_DEBUG(iBody != NULL, Panic(EDeviceNotOpened));
+	return iBody->PlayVolume();
+	}
+	
+/*
+ This function sets the play volume.
+ The volume level depends on the physical audio device used.
+	
+@param aVolume	Play volume level in the range 0 to 255 inclusive
+@see TSoundFormatsSupported
+
+*/
+void RMdaDevSound::SetPlayVolume(TInt aVolume)
+	{
+	__ASSERT_DEBUG(iBody != NULL, Panic(EDeviceNotOpened));
+	iBody->SetPlayVolume(aVolume);
+	}
+
+/*
+ This function sets the play volume.
+ The volume level depends on the physical audio device used.
+	
+@param aVolume	Play volume level. Logarithmic value.
+@see TSoundFormatsSupported
+
+*/
+void RMdaDevSound::SetVolume(TInt aLogarithmicVolume)
+	{
+	__ASSERT_DEBUG(iBody != NULL, Panic(EDeviceNotOpened));
+	iBody->SetVolume(aLogarithmicVolume);	
+	}
+	
+/*
+ This function cancels the currently playing sound.
+ If paused, the pause will be cancelled.
+ Will panic if not open.
+ Will not cancel Notify*Error().
+*/
+void RMdaDevSound::CancelPlayData()
+	{
+	__ASSERT_DEBUG(iBody != NULL, Panic(EDeviceNotOpened));
+	iBody->CancelPlayData();
+	}
+
+/*
+ Gets the sound record volume.
+ This depends on the physical audio device used.
+@return Record volume level.
+
+*/
+TInt RMdaDevSound::RecordLevel()
+	{
+	__ASSERT_DEBUG(iBody != NULL, Panic(EDeviceNotOpened));
+	return iBody->RecordLevel();
+	}
+
+/*
+ This function sets the device record volume level.
+ This depends on the physical audio device used.
+@param aLevel Record volume level.	
+@see TSoundFormatsSupported
+
+*/
+void RMdaDevSound::SetRecordLevel(TInt aLevel)
+	{
+	__ASSERT_DEBUG(iBody != NULL, Panic(EDeviceNotOpened));
+	iBody->SetRecordLevel(aLevel);
+	}
+
+/*
+ This function cancels the recording in progress.
+ If paused, the pause will be cancelled.
+ Any buffered data will be discarded.
+ Will panic if not open.
+ Will not cancel Notify*Error().
+*/
+void RMdaDevSound::CancelRecordData()
+	{
+	__ASSERT_DEBUG(iBody != NULL, Panic(EDeviceNotOpened));
+	iBody->CancelRecordData();
+	}
+
+/*
+ This function stops recording and completes the outstanding RecordData request immediately with any available data.
+ Any following RecordData calls will be completed immediately returning any buffered data, they will NOT restart recording.
+
+ It  maybe called either when recording or stopped.
+
+ The flushing state should be exited by calling CancelRecordData.
+ 
+ The adaptor implements this functionality via Pause, which results in slightly different behaviour to the old RMdaDevSound driver.
+ In particular the flushing state can also be exited by calling ResumeRecording, do NOT do  this... If you want this behaviour, use the
+ new PauseRecording/ResumeRecording functions.
+ */
+void RMdaDevSound::FlushRecordBuffer()
+	{
+	__ASSERT_DEBUG(iBody != NULL, Panic(EDeviceNotOpened));
+	iBody->FlushRecordBuffer();
+	}
+
+/*
+ This function returns the number of bytes played by the driver since calling Open or 
+ calling ResetBytesPlayed().
+
+ It is not reset by PlayData or PausePlayBuffer/ResumePlayBuffer
+
+@see RMdaDevSound::ResetBytesPlayed() 
+@return Number of bytes played.
+*/
+TInt RMdaDevSound::BytesPlayed()
+	{
+	__ASSERT_DEBUG(iBody != NULL, Panic(EDeviceNotOpened));
+	return iBody->BytesPlayed();
+	}
+
+/*
+ Resets the count of bytes played.
+
+ If called whilst playing, the counter might not reset to exactly zero, it will reset to the number of bytes played in the current
+ internal transfer.
+*/
+void RMdaDevSound::ResetBytesPlayed()
+	{
+	__ASSERT_DEBUG(iBody != NULL, Panic(EDeviceNotOpened));
+	return iBody->ResetBytesPlayed();
+	}
+
+/*
+ This function changes the audio play state to pause.
+ It is legal to pause whilst not playing, in which case a following (single) PlayData request will be queued until
+ ResumePlaying is called.
+ Currently "pause whilst not playing" is disabled due to an issue in the datapath code which panics...
+*/
+void RMdaDevSound::PausePlayBuffer()
+	{
+	__ASSERT_DEBUG(iBody != NULL, Panic(EDeviceNotOpened));
+	iBody->PausePlayBuffer();
+	}
+
+	
+/*
+ This function starts the audio play from pause state.
+ If a PlaData request was active when the Pause was requested it will continue.
+ If a PlayData request was not active when the Pause was requested, but a one was issued whilst paused,
+ it will start.
+ If there is nothing to resume, we will notify KErrUnderflow.
+*/
+void RMdaDevSound::ResumePlaying()
+	{
+	__ASSERT_DEBUG(iBody != NULL, Panic(EDeviceNotOpened));
+	iBody->ResumePlaying();
+	}
+
+/*
+ This function is identical to RMdaDevSound::ResumePlaying(), the parameter is ignored.
+*/
+void RMdaDevSound::ResumePlaying(TRequestStatus&)
+	{
+	__ASSERT_DEBUG(iBody != NULL, Panic(EDeviceNotOpened));
+	iBody->ResumePlaying();
+	}
+
+/*
+The current record request will be completed early with partial contents and further
+recording paused.
+
+Any following RecordData calls will be completed immediately using any buffered data, it will NOT restart recording.
+
+Pausing whilst stopped does nothing, and hence a following RecordData call would restart recording...
+
+*/
+void RMdaDevSound::PauseRecordBuffer()
+	{
+	__ASSERT_DEBUG(iBody != NULL, Panic(EDeviceNotOpened));
+	iBody->PauseRecordBuffer();
+	}
+
+/*
+	Resume recording.
+	Recorded data will be buffered internally.
+	If an outstanding RecordData request was issued whilst paused it will be processed.
+*/
+void RMdaDevSound::ResumeRecording()
+	{
+	__ASSERT_DEBUG(iBody != NULL, Panic(EDeviceNotOpened));
+	iBody->ResumeRecording();
+	}
+
+/*
+	Return the duration of the audio data which has been played.
+	Note that this may be less than the amount of data/time queued.
+*/
+TInt RMdaDevSound::GetTimePlayed(TTimeIntervalMicroSeconds& aTimePlayed)
+	{
+	__ASSERT_DEBUG(iBody != NULL, Panic(EDeviceNotOpened));
+	return iBody->GetTimePlayed(aTimePlayed);
+	}
+
+
+/*
+ Gets the play format(capability) supported by this device. 
+ This record describes supported sample rate, encoding, volume level, channels, buffer size of the audio for playing. 
+
+@param  aFormatsSupported	A reference to a client supplied TSoundFormatsSupported class to be filled by this function. 
+@see TSoundFormatsSupported
+
+*/
+void RMdaDevSound::PlayFormatsSupported(TSoundFormatsSupportedBuf& aFormatsSupported)
+	{
+	__ASSERT_DEBUG(iBody != NULL, Panic(EDeviceNotOpened));
+	iBody->PlayFormatsSupported(aFormatsSupported);
+	}
+
+/*
+ This function gets the current play format.
+
+@param  aFormat	A reference to a client supplied TCurrentSoundFormat class to be filled by this function. 
+@see TCurrentSoundFormat
+
+*/
+void RMdaDevSound::GetPlayFormat(TCurrentSoundFormatBuf& aFormat)
+	{
+	__ASSERT_DEBUG(iBody != NULL, Panic(EDeviceNotOpened));
+	iBody->GetPlayFormat(aFormat);
+	}
+
+/*
+ This functions sets the play format.
+
+@param aFormat For the details refer to TCurrentSoundFormat. 
+
+@see TCurrentSoundFormat
+
+@return KErrNone on success,
+		KErrInUse if playing, 
+        KErrAccessDenied if play and recording sample rate is different,
+        KErrNotSupported if input sound format does not match with supported capability,
+        otherwise system wide error code.
+
+*/	
+TInt RMdaDevSound::SetPlayFormat(const TCurrentSoundFormatBuf& aFormat)
+	{
+	__ASSERT_DEBUG(iBody != NULL, Panic(EDeviceNotOpened));
+	return iBody->SetPlayFormat(aFormat);
+	}
+
+/*
+ Gets the sound record format. 
+ This record describes supported sample rate, encoding, volume level, buffer size of the audio for recording.
+ This depends on the physical device used.
+
+@param  aFormatsSupported	A reference to a client supplied TSoundFormatsSupported class to be filled by this function.  
+@see TSoundFormatsSupported
+
+*/
+void RMdaDevSound::RecordFormatsSupported(TSoundFormatsSupportedBuf& aFormatsSupported)
+	{
+	__ASSERT_DEBUG(iBody != NULL, Panic(EDeviceNotOpened));
+	iBody->RecordFormatsSupported(aFormatsSupported);
+	}
+
+/*
+ Gets a current sound format used for recording.
+ 
+@param aFormat	A reference to a client supplied TCurrentSoundFormat class to be filled by this function.
+@see TCurrentSoundFormat
+
+*/
+void RMdaDevSound::GetRecordFormat(TCurrentSoundFormatBuf& aFormat)
+	{
+	__ASSERT_DEBUG(iBody != NULL, Panic(EDeviceNotOpened));
+	iBody->GetRecordFormat(aFormat);
+	}
+
+/*
+ Call this function to change the sound format used for recording.
+
+@param aFormat	For details refer to TCurrentSoundFormat. 
+@see TCurrentSoundFormat
+
+@return KErrNone on sucess,
+        KErrInUse  if recording already in progress,
+        KErrAccessDenied   play and record sample rates are different,
+        otherwise system wide error code.
+
+*/
+TInt RMdaDevSound::SetRecordFormat(const TCurrentSoundFormatBuf& aFormat)
+	{
+	__ASSERT_DEBUG(iBody != NULL, Panic(EDeviceNotOpened));
+	return iBody->SetRecordFormat(aFormat);
+	}
+	
+void RMdaDevSound::Close()
+	{
+	if(iBody)
+		{
+		iBody->Close();
+		delete iBody;
+		iBody = NULL;
+		}
+	}
+		
+TInt RMdaDevSound::Handle()
+	{
+	if(iBody)
+		{
+		return iBody->Handle();
+		}
+	return 0;
+	}
+
+/*
+ Call this function to play the audio data in the supplied descriptor.
+
+Only a single request may be outstanding at any point in time.
+
+If paused, the request will be queued until ResumePlaying is called.
+
+@param  aStatus	For details refer to TRequestStatus. 
+@see TRequestStatus
+
+@param	aData	Descriptor with play data
+
+*/
+void RMdaDevSound::PlayData(TRequestStatus& aStatus, const TDesC8& aData)
+	{
+	__ASSERT_DEBUG(iBody != NULL, Panic(EDeviceNotOpened));
+	iBody->PlayData(aStatus, aData);
+	}
+
+/*
+ Records audio data into the supplied descriptor.
+
+Only a single request may be outstanding at any point in time.
+
+If paused, the request will be queued until ResumeRecording is called.
+
+@param  aStatus	Request status
+@see TRequestStatus
+
+@param  aData	Record buffer descriptor.
+
+*/
+void RMdaDevSound::RecordData(TRequestStatus& aStatus, TDes8& aData)
+	{
+	__ASSERT_DEBUG(iBody != NULL, Panic(EDeviceNotOpened));
+	iBody->RecordData(aStatus, aData);
+	}
+
+/*
+ Call this function to notify any error encountered while recording audio.
+
+@param  aStatus	request object's completion code value 
+@see TRequestStatus
+
+*/
+void RMdaDevSound::NotifyRecordError(TRequestStatus& aStatus)
+	{
+	__ASSERT_DEBUG(iBody != NULL, Panic(EDeviceNotOpened));
+	iBody->NotifyRecordError(aStatus);
+	}
+
+/*
+ Call this function to notify the play error encountered while playing the sound.
+
+@param aStatus	Error code stating the cause for the play error.
+
+*/
+void RMdaDevSound::NotifyPlayError(TRequestStatus& aStatus)
+	{
+	__ASSERT_DEBUG(iBody != NULL, Panic(EDeviceNotOpened));
+	iBody->NotifyPlayError(aStatus);
+	}
+
+/*
+ This function cancels the play notification error.
+
+*/
+void RMdaDevSound::CancelNotifyPlayError()
+	{
+	__ASSERT_DEBUG(iBody != NULL, Panic(EDeviceNotOpened));
+	iBody->CancelNotifyPlayError();
+	}
+
+/*
+ This function cancels the recording error notification.
+*/
+void RMdaDevSound::CancelNotifyRecordError()
+	{
+	__ASSERT_DEBUG(iBody != NULL, Panic(EDeviceNotOpened));
+	iBody->CancelNotifyRecordError();
+	}
+
+/*
+This function cancels the currently playing sound.
+If paused, the pause will be cancelled.
+
+ This function is identical to CancelPlayData
+*/
+void RMdaDevSound::FlushPlayBuffer()
+	{
+	__ASSERT_DEBUG(iBody != NULL, Panic(EDeviceNotOpened));
+	iBody->FlushPlayBuffer();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmrenderer/src/mdasoundadapter.h	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,241 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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 MDASOUNDADAPTER_H
+#define MDASOUNDADAPTER_H
+
+#include <e32std.h>
+#include <e32ver.h>
+
+	
+#define MDADEVSOUNDNAME _L8("RMdaDevSound")
+
+/*
+ Adapter class which routes the calls on RMdaDevSound(old sound driver interface) to RSoundSc(new sound driver interface). 
+ The purpose of this class is to use the new sound driver in MDF without changing the calling code. This class
+ does not support any new functionalities supported by the shared chunk sound driver but supports the functionality of the 
+ of the old driver with the new driver.
+ */
+class RMdaDevSound
+	{
+	class CBody;
+public:
+	/*
+	enum for major, minor and build version of sound device driver.
+	*/
+	enum TVer {EMajorVersionNumber=1,EMinorVersionNumber=0,EBuildVersionNumber=KE32BuildVersionNumber};
+    /*
+	enum for sound media device play/record request.
+	*/
+	enum TMdaRequest
+		{
+		/* Play data request */
+		EMdaRequestPlayData,
+		/* Play error notification */
+		EMdaRequestPlayErrorNotification,
+		/* Record data request */
+		EMdaRequestRecordData,
+		/* Record error notification */
+		EMdaRequestRecordErrorNotification
+		};
+	
+	/* enum for media device control request */
+	enum TMdaControl
+		{
+		/* play format (capability) supported request */
+		EMdaControlPlayFormatsSupported,
+		/* get the current play format request */
+		EMdaControlGetPlayFormat,
+		/* set the play format request  */
+		EMdaControlSetPlayFormat,
+		/* get play volume request */
+		EMdaControlGetPlayVolume,
+		/* set play volume request */
+		EMdaControlSetPlayVolume,
+		/* record format supported request */
+		EMdaControlRecordFormatsSupported,
+		/* get the current record format request */
+		EMdaControlGetRecordFormat,
+		/* set record format request */
+		EMdaControlSetRecordFormat,
+		/* get record volume request */
+		EMdaControlGetRecordLevel,
+		/* set record volume request */
+		EMdaControlSetRecordLevel,
+		/* stop play request */
+		EMdaControlFlushPlayBuffer,
+		/* stop record request */
+		EMdaControlFlushRecordBuffer,
+		/* bytes played request  */
+		EMdaControlBytesPlayed,
+		/* set base value for the bytes played */
+		EMdaControlResetBytesPlayed,
+		/* Investigate for sound media driver request */
+		EMdaControlIsMdaSound,
+		/* pause play request */
+		EMdaControlPausePlayBuffer,
+		/* resume play request */
+		EMdaControlResumePlaying
+		};
+		
+	/*
+    This enum corresponds to supported sound encoding schemes
+    */
+	enum TMdaSoundEncoding
+		{
+		/* sound encoding(compression) using 8 bit PCM (pulse code modulation) */
+		EMdaSoundEncoding8BitPCM		= 0x00000001,
+		/* sound encoding using 16 bit PCM */
+		EMdaSoundEncoding16BitPCM		= 0x00000002,
+		/* sound encoding using 8 bit A law */
+		EMdaSoundEncoding8BitALaw		= 0x00000004,
+		/* sound encoding using 8 bit Mu law */
+		EMdaSoundEncoding8BitMuLaw		= 0x00000008,
+		};
+		
+	/*
+    This class corresponds to a supported sound format.
+	The format describes the supported audio device's min/max sampling rate, encoding, channels and buffer size of play/record and volume.
+    */
+	class TSoundFormatsSupported
+		{
+	public:
+	/*
+    This corresponds to minimum sample rate supported. This depends on the physical sound device used(example: 8000 hertz). 
+    */
+		TInt iMinRate;
+		
+	/*
+    This corresponds to maximum sample rate supported. This depends on the physical sound device used(example: 48000 hertz).
+    */
+		TInt iMaxRate;
+		
+	/*
+    This corresponds to encoding format supported.  
+	@see  TMdaSoundEncoding
+    */		
+		TUint32 iEncodings;
+		
+	/*
+    This corresponds to the number of sound channels supported. Possible values are EMono for a single channel and EStereo for two channel sound.
+	Also this depends on the physical device used.
+    */
+		TInt iChannels;
+		
+	/*
+    This corresponds to minimum buffer size. This depends on the physical device used and sampling rate adapted.
+	@see KSoundMinBufferSize
+    */
+		TInt iMinBufferSize;
+		
+	/*
+    This corresponds to maximum buffer size.This depends on the physical device used and sampling rate adapted. 
+	@see KSoundPlayBufferSize
+    @see KSoundRecordBufferSize
+    */
+		TInt iMaxBufferSize;
+
+	/*
+    This corresponds to minimum play/record volume. 
+    */	
+		TInt iMinVolume;
+		
+	/*
+    This corresponds to maximum play/record volume. 
+    */
+		TInt iMaxVolume;
+		};
+
+	/* A typedef'd packaged RMdaDevSound::TSoundFormatsSupported for passing through a generic API method */
+	typedef TPckgBuf<TSoundFormatsSupported> TSoundFormatsSupportedBuf;
+
+	/*
+    This class corresponds to current supported sound format. 
+	The format describes the supported audio device's sampling rate, encoding, channels and buffer size of play/record.
+    */
+	class TCurrentSoundFormat
+		{
+	public:
+	/*
+    This corresponds to sound sampling rate like (44000 Hertz, 8000 Hertz). The possible values depends on the physical device used.
+    */
+		TInt iRate;
+		
+	/*
+    @see TMdaSoundEncoding
+    */
+		TMdaSoundEncoding iEncoding;
+		
+	/*
+    This corresponds to the number of sound channels supported. Possible values are EMono for a single channel and EStereo for two channel sound.
+	Also this depends on the physical device used.
+    */
+		TInt iChannels;
+		
+	/*
+    Play or Record buffer size. The possible value depends on the physical device used. 
+    */
+		TInt iBufferSize;
+		};
+
+	/* A typedef'd packaged RMdaDevSound::TCurrentSoundFormat for passing through a generic API method */
+	typedef TPckgBuf<TCurrentSoundFormat> TCurrentSoundFormatBuf;
+public:
+	RMdaDevSound();
+	TInt Open(TInt aUnit=KNullUnit);
+	TVersion VersionRequired() const;
+	TInt IsMdaSound();
+	void PlayFormatsSupported(TSoundFormatsSupportedBuf& aFormatsSupported);
+	void GetPlayFormat(TCurrentSoundFormatBuf& aFormat);
+	TInt SetPlayFormat(const TCurrentSoundFormatBuf& aFormat);
+	TInt PlayVolume();
+	// This function mimics RMdaDevSound interface with linear volume semantics
+	void SetPlayVolume(TInt aLinearVolume);
+	// This function supports volume change with logarithmic semantics
+	void SetVolume(TInt aLogarithmicVolume);
+	void PlayData(TRequestStatus& aStatus,const TDesC8& aData);
+	void CancelPlayData();
+	void NotifyPlayError(TRequestStatus& aStatus);
+	void CancelNotifyPlayError();
+
+	void RecordFormatsSupported(TSoundFormatsSupportedBuf& aFormatsSupported);
+	void GetRecordFormat(TCurrentSoundFormatBuf& aFormat);
+	TInt SetRecordFormat(const TCurrentSoundFormatBuf& aFormat);
+	TInt RecordLevel();
+	void SetRecordLevel(TInt aLevel);
+	void RecordData(TRequestStatus& aStatus,TDes8& aData);
+	void CancelRecordData();
+	void NotifyRecordError(TRequestStatus& aStatus);
+	void CancelNotifyRecordError();
+
+	void FlushPlayBuffer();
+	void FlushRecordBuffer();
+	TInt BytesPlayed();
+	void ResetBytesPlayed();
+	void PausePlayBuffer();
+	void ResumePlaying();
+	void ResumePlaying(TRequestStatus&);
+	void Close();
+	TInt Handle();
+	void PauseRecordBuffer();
+	void ResumeRecording();
+	TInt GetTimePlayed(TTimeIntervalMicroSeconds& aTimePlayed);
+private:
+	CBody* iBody;
+	};
+	
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmrenderer/src/mdasoundadapterbody.cpp	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,1948 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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 "mdasoundadapterbody.h"
+#include <e32debug.h>
+
+#include "rateconvert.h" // if we need to resample
+
+#include <hal.h>
+
+_LIT(KPddFileName,"SOUNDSC.PDD");
+_LIT(KLddFileName,"ESOUNDSC.LDD");
+
+
+const TInt KBytesPerSample = 2;
+const TInt KMinBufferSize = 2;
+
+/**
+This function raises a panic
+EDeviceNotOpened is raised when any of the RMdaDevSound APIs are called before opening the device. 
+*/
+GLDEF_C void Panic(TSoundAdapterPanicCodes aPanicCode)
+	{
+	User::Panic(KSoundAdapterPanicCategory, aPanicCode);
+	}
+
+
+const TText8 *RMdaDevSound::CBody::TState::Name() const
+	{
+	#ifdef SYMBIAN_SOUNDADAPTER_DEBUG	 
+	switch(iState)
+		{
+		case ENotReady:				return _S8("ENotReady");
+		case EStopped:				return _S8("EStopped");
+		case ERecording:			return _S8("ERecording");
+		case ERecordingPausedInHw:	return _S8("ERecordingPausedInHw");
+		case ERecordingPausedInSw:	return _S8("ERecordingPausedInSw");
+		case EPlaying:				return _S8("EPlaying");
+		case EPlayingPausedInHw: 	return _S8("EPlayingPausedInHw");
+		case EPlayingPausedInSw:	return _S8("EPlayingPausedInSw");
+		case EPlayingUnderrun:		return _S8("EPlayingUnderrun");
+		}
+	return _S8("CorruptState");
+	#else
+	return _S8("");
+	#endif
+	}
+
+	
+
+RMdaDevSound::CBody::TState &RMdaDevSound::CBody::TState::operator=(TStateEnum aNewState)
+	{
+    if(iState != aNewState)
+        {
+        #ifdef SYMBIAN_SOUNDADAPTER_DEBUG    
+        RDebug::Printf("RMdaDevSound state %s -> %s", Name(), TState(aNewState).Name());
+        #endif
+        iState = aNewState;
+        }
+	return *this;
+	}
+
+RMdaDevSound::CBody* RMdaDevSound::CBody::NewL()
+	{
+	CBody* self = new(ELeave) CBody();
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop();
+	return self;
+	}
+
+RMdaDevSound::CBody::~CBody()
+	{
+	for(TInt i = 0; i < KPlaySharedChunkBuffers; i++)
+		{
+		delete iPlayers[i];
+		iPlayers[i] = NULL;
+		}
+	delete iRecorder;
+	iRecorder = NULL;
+	delete iPlayFormatData.iConverter;
+	delete iRecordFormatData.iConverter;
+	iPlayChunk.Close();
+	iPlaySoundDevice.Close();
+	iRecordChunk.Close();
+	iRecordSoundDevice.Close();
+	iConvertedPlayData.Close();
+	iSavedTrailingData.Close();
+	iBufferedRecordData.Close();
+	}
+	
+RMdaDevSound::CBody::CBody()
+	:iState(ENotReady), iBufferOffset(-1)
+	{
+	
+	}
+
+TVersion RMdaDevSound::CBody::VersionRequired() const
+	{
+	if(iPlaySoundDevice.Handle())
+		{
+		return iPlaySoundDevice.VersionRequired();
+		}
+	else
+		{
+		return TVersion();
+		}
+	}
+
+TInt RMdaDevSound::CBody::IsMdaSound()
+	{
+	return ETrue;
+	}
+	
+void RMdaDevSound::CBody::ConstructL()
+	{
+	// Try to load the audio physical driver
+    TInt err = User::LoadPhysicalDevice(KPddFileName);
+	if ((err!=KErrNone) && (err!=KErrAlreadyExists))
+		{
+		User::Leave(err);
+		}
+    // Try to load the audio logical driver
+	err = User::LoadLogicalDevice(KLddFileName);
+    if ((err!=KErrNone) && (err!=KErrAlreadyExists))
+    	{
+    	User::Leave(err);
+    	}
+	for(TInt i=0; i<KPlaySharedChunkBuffers; i++)
+		{
+		iPlayers[i] = new(ELeave) CPlayer(CActive::EPriorityUserInput, *this, i);
+		iFreePlayers.Push(iPlayers[i]);
+		}
+	
+	iRecorder = new(ELeave) CRecorder(CActive::EPriorityUserInput, *this);
+	
+	TInt tmp;
+	User::LeaveIfError(HAL::Get(HAL::ENanoTickPeriod, tmp));
+	iNTickPeriodInUsec = tmp;
+	}
+
+TInt RMdaDevSound::CBody::Open(TInt /*aUnit*/)
+	{
+    #ifdef SYMBIAN_SOUNDADAPTER_DEBUG	
+        RDebug::Print(_L("RMdaDevSound::CBody::Open "));
+    #endif	
+	TInt err = KErrNone;
+	//Default behavior of this method is to open both the play and record audio devices.
+	if(!iPlaySoundDevice.Handle() && !iRecordSoundDevice.Handle())
+        {
+		err = iPlaySoundDevice.Open(KSoundScTxUnit0);
+    	if(err == KErrNone)
+    		{
+    		err = iRecordSoundDevice.Open(KSoundScRxUnit0);
+    		}
+		}
+	if(err != KErrNone)
+		{
+		Close();
+		}
+	else
+	    {
+		TSoundFormatsSupportedV02Buf capsBuf;
+		iPlaySoundDevice.Caps(capsBuf);
+		TInt minBufferSize = KMinBufferSize;
+		#ifdef SYMBIAN_FORCE_32BIT_LENGTHS
+		minBufferSize = Max(minBufferSize, 4); // force to 32-bit buffer align
+		#endif
+		iRequestMinSize = Max(capsBuf().iRequestMinSize, minBufferSize); 
+		// work out mask so that x&iRequestMinMask is equiv to x/iRequestMinSize*iRequestMinSize
+		iRequestMinMask = ~(iRequestMinSize-1); // assume iRequestMinSize is power of 2
+		iSavedTrailingData.Close();
+		iSavedTrailingData.Create(iRequestMinSize);
+	
+	    iState = EStopped;
+		iBytesPlayed = 0;
+	    }
+
+	return err;
+	}
+		
+TInt RMdaDevSound::CBody::PlayVolume()
+	{
+	__ASSERT_DEBUG(iPlaySoundDevice.Handle(), Panic(EDeviceNotOpened));
+	return iPlaySoundDevice.Volume();	
+	}
+	
+void RMdaDevSound::CBody::SetPlayVolume(TInt aVolume)
+	{
+	__ASSERT_DEBUG(iPlaySoundDevice.Handle(), Panic(EDeviceNotOpened));
+	if(aVolume >=0 && aVolume<=KSoundMaxVolume)
+		{
+		iPlaySoundDevice.SetVolume(KLinerToDbConstantLookup[aVolume].iDBValue);
+		}
+	}
+void RMdaDevSound::CBody::SetVolume(TInt aLogarithmicVolume)
+	{
+	__ASSERT_DEBUG(iPlaySoundDevice.Handle(), Panic(EDeviceNotOpened));
+	if(aLogarithmicVolume >= 0 && aLogarithmicVolume <= KSoundMaxVolume)
+		{
+		iPlaySoundDevice.SetVolume(aLogarithmicVolume);
+		}
+	}
+	
+void RMdaDevSound::CBody::CancelPlayData()
+	{
+    #ifdef SYMBIAN_SOUNDADAPTER_DEBUG	
+    RDebug::Printf("RMdaDevSound::CBody::CancelPlayData: state %s", iState.Name());
+    #endif	
+	__ASSERT_DEBUG(iPlaySoundDevice.Handle(), Panic(EDeviceNotOpened));
+
+    // If there is a client request, cancel it
+    // Must do this before canceling players because otherwise they may just restart!
+    if(iClientPlayStatus)
+        {
+        #ifdef SYMBIAN_SOUNDADAPTER_DEBUG    
+        RDebug::Printf("msp PlayCancelled complete iClientPlayStatus");
+		#endif
+        User::RequestComplete(iClientPlayStatus, KErrCancel); // Call also sets iClientPlayStatus to NULL
+        }
+    
+    // Discard any buffered data
+    iClientPlayData.Set(0,0);
+	// Discard any saved trailing data (ie. data saved due driver requiring all requests to be a multiple of iRequestMinSize).
+	iSavedTrailingData.SetLength(0);
+
+    // Emulator RSoundSc PDD when running without a soundcard has a major
+    // issue with cancelling whilst paused. It will not clear the pending
+    // list (because the timer is not active) and therefore this list will
+    // later overflow causing hep corruption.
+    // This means that, for now, we MUST Resume before calling CancelPlayData
+    // to avoid kernel panics...
+    
+    // The device driver will not cancel a request which is in progress...
+    // So, if we are paused in hw, we must resume before cancelling the
+    // player otherwise it will hang in CActive::Cancel
+    if(iState == EPlayingPausedInHw)
+        {
+        #ifdef SYMBIAN_SOUNDADAPTER_DEBUG    
+        RDebug::Printf("msp Resume to avoid hang");
+        #endif
+        (void) iPlaySoundDevice.Resume();
+        }
+    
+    // Update state
+	iState = EStopped;
+	
+
+    // The RSoundSc driver will not cancel a request which is in progress (or paused).
+    // If we just loop across the players, cancelling each individual request and waiting for it to complete,
+    // several of them will actually play, which is both wrong and time consuming....
+    // Issue a block cancel upfront to avoid this
+    iPlaySoundDevice.CancelPlayData();
+ 
+	// Cancel all players
+	for (TUint playerIndex=0; playerIndex<KPlaySharedChunkBuffers; ++playerIndex)
+	    {
+	    // If the player is active it will call PlayRequestCompleted with aDueToCancelCommand true
+	    // to update the iFreePlayers and iActivePlayRequestSizes FIFOs.
+        iPlayers[playerIndex]->Cancel();
+	    }
+	
+	iBufferOffset = -1;
+	iBufferLength = 0;
+	
+	return;
+	}
+	
+TInt RMdaDevSound::CBody::RecordLevel()
+	{
+	__ASSERT_DEBUG(iRecordSoundDevice.Handle(), Panic(EDeviceNotOpened));
+	return iRecordSoundDevice.Volume();
+	}
+	
+void RMdaDevSound::CBody::SetRecordLevel(TInt aLevel)
+	{
+	__ASSERT_DEBUG(iRecordSoundDevice.Handle(), Panic(EDeviceNotOpened));
+	iRecordSoundDevice.SetVolume(aLevel);	
+	}
+	
+void RMdaDevSound::CBody::CancelRecordData()
+	{
+	__ASSERT_DEBUG(iRecordSoundDevice.Handle(), Panic(EDeviceNotOpened));
+    #ifdef SYMBIAN_SOUNDADAPTER_DEBUG	
+    RDebug::Printf("RMdaDevSound::CBody::CancelRecordData: state %s", iState.Name());
+    #endif
+
+    // Stop recorder object (and its request)
+    iRecorder->Cancel();
+    
+    // Stop driver from recording
+    iRecordSoundDevice.CancelRecordData();
+             
+    // If there is a client request, cancel it
+    if(iClientRecordStatus)
+   		{
+        User::RequestComplete(iClientRecordStatus, KErrNone); // Call also sets iClientPlayStatus to NULL
+        }
+
+    iState = EStopped;
+    return;
+	}
+	
+void RMdaDevSound::CBody::FlushRecordBuffer()
+	{
+	__ASSERT_DEBUG(iRecordSoundDevice.Handle(), Panic(EDeviceNotOpened));
+    #ifdef SYMBIAN_SOUNDADAPTER_DEBUG	
+        RDebug::Print(_L("RMdaDevSound::CBody::FlushRecordBuffer - implemented by calling PauseRecordBuffer"));
+    #endif
+
+	PauseRecordBuffer();
+	}
+	
+TInt RMdaDevSound::CBody::BytesPlayed()
+	{
+    #ifdef SYMBIAN_SOUNDADAPTER_DEBUG    
+    RDebug::Printf("RMdaDevSound::BytesPlayed %s", iState.Name());
+	#endif
+
+	return I64LOW(BytesPlayed64());
+	}
+
+
+TUint64 RMdaDevSound::CBody::BytesPlayed64()
+	{
+	__ASSERT_DEBUG(iPlaySoundDevice.Handle(), Panic(EDeviceNotOpened));
+
+	TUint64 currentBytesPlayed = KMaxTUint64;
+
+	switch(iState)
+	{
+	case ENotReady:
+		Panic(EDeviceNotOpened);
+		break;
+
+	case EStopped:
+		currentBytesPlayed = iBytesPlayed;
+		break;
+
+	case ERecording:
+	case ERecordingPausedInHw:
+	case ERecordingPausedInSw:
+		Panic(EBadState);
+		break;
+
+	case EPlayingPausedInHw: // ie. Play request pending on h/w and paused
+		// Paused, so use pause time
+        #ifdef SYMBIAN_SOUNDADAPTER_DEBUG    
+		RDebug::Printf("EPlayingPausedInHw: iPausedBytes %x %x", I64HIGH(iPausedBytesPlayed), I64LOW(iPausedBytesPlayed));
+		#endif
+		currentBytesPlayed = iPausedBytesPlayed;
+		break;
+
+	case EPlayingPausedInSw: // ie. Driver not playing or paused
+		#ifdef SYMBIAN_SOUNDADAPTER_DEBUG	 
+		RDebug::Printf("EPlayingPausedInSw: iPausedBytesPlayed %x %x", I64HIGH(iPausedBytesPlayed), I64LOW(iPausedBytesPlayed));
+		#endif
+		currentBytesPlayed = iPausedBytesPlayed;
+		break;
+
+	case EPlayingUnderrun:
+		#ifdef SYMBIAN_SOUNDADAPTER_DEBUG	 
+		RDebug::Printf("EPlayingUnderrun: iBytesPlayed %x %x", I64HIGH(iBytesPlayed), I64LOW(iBytesPlayed));
+		#endif
+		currentBytesPlayed = iBytesPlayed;
+		break;
+
+	case EPlaying:
+		{
+		// Playing so calculate time since last update to iBytesPlayed
+		TUint32 curTime = CurrentTimeInMsec();
+		TUint32 curRequestSize = iActivePlayRequestSizes.Peek();
+
+		TUint32 extraPlayTime = (curTime >= iStartTime) ? (curTime-iStartTime) : (KMaxTUint32 - (iStartTime-curTime));
+        #ifdef SYMBIAN_SOUNDADAPTER_DEBUG	 
+		RDebug::Printf("iStartTime %d curTime %d extraPlayTime %d", iStartTime, curTime, extraPlayTime);
+		
+		RDebug::Printf("iPlayFormatData.iSampleRate %d KBytesPerSample %d iNTickPeriodInUsec %d",
+					   iPlayFormatData.iSampleRate, KBytesPerSample, iNTickPeriodInUsec);
+        #endif
+		TUint32 extraBytesPlayed = TUint32((TUint64(extraPlayTime) * iPlayFormatData.iSampleRate * iPlayFormatData.iRequestedChannels * KBytesPerSample)/1000);
+		if(extraBytesPlayed > curRequestSize)
+			{
+            #ifdef SYMBIAN_SOUNDADAPTER_DEBUG	 
+			RDebug::Printf("caping extraBytes played from %d to %d", extraBytesPlayed, curRequestSize);
+            #endif
+			extraBytesPlayed = curRequestSize;
+			}
+
+		#ifdef SYMBIAN_SOUNDADAPTER_DEBUG
+		RDebug::Printf("iBytesPlayed %d extraBytesPlayed %d (curRequestSize %d) -> currentBytesPlayed %x %x",
+                iBytesPlayed, extraBytesPlayed, curRequestSize, I64HIGH(currentBytesPlayed), I64LOW(currentBytesPlayed));
+        #endif
+
+		currentBytesPlayed = iBytesPlayed + extraBytesPlayed;
+		break;
+		}
+	
+	default:
+		Panic(EBadState);
+		break;
+	}
+ 
+
+    #ifdef SYMBIAN_SOUNDADAPTER_DEBUG
+	RDebug::Printf("iPlayFormatData.iConverter %x", iPlayFormatData.iConverter);
+    #endif
+
+	if (iPlayFormatData.iConverter)
+		{
+		// need to scale bytes played to fit with requested rate and channels, not actual
+		if (iPlayFormatData.iActualChannels != iPlayFormatData.iRequestedChannels)
+			{
+			if (iPlayFormatData.iActualChannels == 2)
+				{
+				// requested was mono, we have stereo
+				currentBytesPlayed /= 2;
+				}
+			else 
+				{
+				// requested was stereo, we have mono
+				currentBytesPlayed *= 2;
+				}
+			}
+		if (iPlayFormatData.iSampleRate != iPlayFormatData.iActualRate)
+			{
+			currentBytesPlayed = TUint64(currentBytesPlayed*
+					TReal(iPlayFormatData.iSampleRate)/TReal(iPlayFormatData.iActualRate)); // don't round
+			}
+		}
+
+    #ifdef SYMBIAN_SOUNDADAPTER_DEBUG
+	RDebug::Printf("currentBytesPlayed %x %x", I64HIGH(currentBytesPlayed), I64LOW(currentBytesPlayed));
+    #endif
+	return currentBytesPlayed;
+	}
+
+void RMdaDevSound::CBody::ResetBytesPlayed()
+	{
+    #ifdef SYMBIAN_SOUNDADAPTER_DEBUG    
+    RDebug::Printf("RMdaDevSound::CBody::ResetBytesPlayed %s", iState.Name());
+	#endif
+	__ASSERT_DEBUG(iPlaySoundDevice.Handle(), Panic(EDeviceNotOpened));
+	iBytesPlayed = 0;
+	iPlaySoundDevice.ResetBytesTransferred();
+	return;
+	}
+	
+void RMdaDevSound::CBody::PausePlayBuffer()
+	{
+#ifdef SYMBIAN_SOUNDADAPTER_DEBUG   
+    RDebug::Printf("RMdaDevSound::CBody::PausePlayBuffer %s", iState.Name());
+#endif  
+	switch(iState)
+		{
+		case ENotReady:
+			Panic(EDeviceNotOpened);
+			break;
+
+		case EStopped:
+			// Can not move to EPlayingPausedInSw because it provokes a datapath panic....
+			break;
+
+		case ERecording:
+		case ERecordingPausedInHw:
+		case ERecordingPausedInSw:
+			Panic(EBadState);
+			break;
+
+		case EPlayingPausedInHw: // ie. Play request pending on h/w and paused
+		case EPlayingPausedInSw: // ie. Driver not playing or paused
+			// Already paused so nothing to do.
+			break;
+
+		case EPlayingUnderrun:
+			iState = EPlayingPausedInSw;
+			break;
+			
+		case EPlaying:
+			{
+			iPauseTime = CurrentTimeInMsec();
+			iPausedBytesPlayed = BytesPlayed64();
+			TInt res = iPlaySoundDevice.Pause();
+			#ifdef SYMBIAN_SOUNDADAPTER_DEBUG   
+			RDebug::Printf("iPlaySoundDevice.Pause res = %d", res);
+			#endif
+ 			if(res == KErrNone)
+				{
+				iState = EPlayingPausedInHw;
+				}
+			else
+				{
+			    #ifdef SYMBIAN_SOUNDADAPTER_DEBUG    
+				RDebug::Printf("msp PausePlayBuffer hw pause unexpectedly failed, doing sw pause");
+				#endif
+				iState = EPlayingPausedInSw;
+				}
+			break;
+			}
+		
+		default:
+			Panic(EBadState);
+			break;
+		}
+	
+	return;
+	}
+	
+void RMdaDevSound::CBody::ResumePlaying()
+	{
+	#ifdef SYMBIAN_SOUNDADAPTER_DEBUG   
+	RDebug::Printf("RMdaDevSound::CBody::ResumePlaying %s", iState.Name());
+	#endif	
+    __ASSERT_DEBUG(iPlaySoundDevice.Handle(), Panic(EDeviceNotOpened));
+
+	switch(iState)
+		{
+		case ENotReady:
+			Panic(EDeviceNotOpened);
+			break;
+				
+		case EStopped:
+			// No change
+			break;
+	
+		case ERecording:
+		case ERecordingPausedInHw:
+		case ERecordingPausedInSw:
+			Panic(EBadState);
+			break;
+			
+		case EPlaying:
+			// No change
+			break;
+
+		case EPlayingPausedInHw: // ie. Play request pending on h/w and paused
+			{
+			// Re-enable reporting of KErrUnderflow (will re-raise KErrUnderflow if nothing to start playing).
+			iUnderFlowReportedSinceLastPlayOrRecordRequest = EFalse;
+
+			TInt res = iPlaySoundDevice.Resume();
+#ifdef SYMBIAN_SOUNDADAPTER_DEBUG	
+			RDebug::Printf("ResumePlayBuffer EPlayingPausedInHw res = %d", res);
+#endif
+			if(res == KErrNone)
+				{
+				// Resume ok so a pending request will complete
+				iState = EPlaying;
+	            // Update iStartTime to allow for time spent paused
+	            TUint32 curTime = CurrentTimeInMsec();
+	            TUint32 timePaused = (curTime >= iPauseTime) ? (curTime-iPauseTime) : (KMaxTUint32 - (iPauseTime-curTime));
+	            iStartTime += timePaused; // nb. It is harmless if this wraps.
+				}
+			else
+				{
+				// Resume failed, therefore driver is not playing
+                // No need to update iStartTime/iPauseTime because these are only used within a driver request
+                // Change state to Stopped
+                iState = EStopped;
+                //  Attempt to start a new (pending) request.
+                StartPlayersAndUpdateState();
+				}
+			break;
+			}
+
+		case EPlayingPausedInSw: // ie. Driver not playing/paused
+			{
+			// Driver not playing
+			// Re-enable reporting of KErrUnderflow (will re-raise KErrUnderflow if nothing to start playing).
+			iUnderFlowReportedSinceLastPlayOrRecordRequest = EFalse;
+			// No need to update iStartTime/iPauseTime because these are only used within a driver request
+			// Change state to Stopped
+            iState = EStopped;
+            //	Attempt to start a new (pending) request.
+			StartPlayersAndUpdateState();
+			break;
+			}
+	
+		case EPlayingUnderrun:
+			// Not paused, therefore no change
+			break;
+			
+		default:
+			Panic(EBadState);
+			break;
+		}
+	
+	return;	
+	}
+
+void RMdaDevSound::CBody::PauseRecordBuffer()
+	{
+    #ifdef SYMBIAN_SOUNDADAPTER_DEBUG   
+    RDebug::Printf("RMdaDevSound::CBody::PauseRecordBuffer %s", iState.Name());
+    #endif
+	
+	switch(iState)
+		{
+		case ENotReady:
+			Panic(EDeviceNotOpened);
+			break;
+			
+		case EStopped:
+			// Driver is not recording
+		    // Do not pause because that will cause problems when CAudioDevice::Pause calls
+		    // PausePlayBuffer and PauseRecordBuffer in state EStopped...
+			break;
+
+		case ERecording:
+			{
+			TInt res = iRecordSoundDevice.Pause();
+			#ifdef SYMBIAN_SOUNDADAPTER_DEBUG	
+			RDebug::Printf("PauseRecordBuffer EPlaying res = %d", res);
+			#endif
+			if(res == KErrNone)
+				{
+				iState = ERecordingPausedInHw;
+				}
+			else
+				{
+				#ifdef SYMBIAN_SOUNDADAPTER_DEBUG	
+				RDebug::Printf("PauseRecordBuffer hw pause unexpectedly failed, doing sw pause");
+				#endif
+				iState = ERecordingPausedInSw;
+				}
+			break;
+			}
+		
+		case ERecordingPausedInHw:
+		case ERecordingPausedInSw:
+			// Already paused so nothing to do.
+			break;
+			
+		case EPlaying:
+		case EPlayingPausedInHw: // ie. Play request pending on h/w and paused
+            Panic(EBadState);
+            break;
+		    
+		case EPlayingPausedInSw: 
+		    // This is an ugly hack to maintain compatibility with CAudioDevice::Pause which
+		    // calls both PausePlayBuffer and PauseRecordBuffer whilst in stopped, then later calls ResumePlaying
+		    break;
+
+		case EPlayingUnderrun: // ie. Play request pending on h/w and paused
+			Panic(EBadState);
+			break;
+		    
+		default:
+			Panic(EBadState);
+			break;
+		}
+
+	return;	
+	}
+
+void RMdaDevSound::CBody::ResumeRecording()
+	{
+    #ifdef SYMBIAN_SOUNDADAPTER_DEBUG   
+    RDebug::Printf("RMdaDevSound::CBody::ResumeRecording %s", iState.Name());
+    #endif
+	__ASSERT_DEBUG(iPlaySoundDevice.Handle(), Panic(EDeviceNotOpened));
+
+	switch(iState)
+		{
+		case ENotReady:
+			Panic(EDeviceNotOpened);
+			break;
+				
+		case EStopped:
+			// No change
+			break;
+	
+		case ERecording:
+			// No change
+			break;
+
+		case ERecordingPausedInHw:
+			{
+			TInt res = iRecordSoundDevice.Resume();
+			#ifdef SYMBIAN_SOUNDADAPTER_DEBUG	
+			RDebug::Printf("ResumeRecordBuffer ERecordingPausedInHw res = %d", res);
+			#endif
+			if(res == KErrNone)
+				{
+				// Resume ok so a pending request will complete
+				iState = ERecording;
+				}
+			else
+				{
+				iState = EStopped;
+				// Resume failed, so attempt to start a new (pending) request.
+				// If this works, it will update the state to ERecording.
+				StartRecordRequest();
+				}
+			break;
+			}
+		case ERecordingPausedInSw:
+			{
+			// Update state to stopped and attempt to start any pending request
+			iState = EStopped;
+			// If this works, it will update the state to ERecording.
+			StartRecordRequest();
+			break;
+			}
+
+		case EPlaying:
+		case EPlayingPausedInHw: // ie. Play request pending on h/w and paused
+		case EPlayingPausedInSw: // ie. Driver not playing/paused
+		case EPlayingUnderrun:
+		default:
+			Panic(EBadState);
+			break;
+		}
+		
+		return; 
+
+
+	}
+
+TInt RMdaDevSound::CBody::GetTimePlayed(TTimeIntervalMicroSeconds& aTimePlayed)
+	{
+	__ASSERT_DEBUG(iPlaySoundDevice.Handle(), Panic(EDeviceNotOpened));
+
+
+	TUint64 bytesPlayed = BytesPlayed64();
+
+	TUint64 timePlayed = 1000 * 1000 * bytesPlayed / (iPlayFormatData.iSampleRate * iPlayFormatData.iRequestedChannels * KBytesPerSample);
+
+	aTimePlayed = TTimeIntervalMicroSeconds(timePlayed);
+
+	return KErrNone;
+	}
+
+	
+void RMdaDevSound::CBody::FormatsSupported(TSoundFormatsSupportedBuf& aFormatsSupported, RSoundSc& aSoundDevice)
+	{
+	TSoundFormatsSupportedV02Buf supportedFormat;
+	aSoundDevice.Caps(supportedFormat);
+	TUint32 rates = supportedFormat().iRates;
+	
+	for(TInt i = KNumSampleRates-1; i > 0 ;i--)//min to max
+		{
+		if(rates & KRateEnumLookup[i].iRateConstant)
+			{
+			aFormatsSupported().iMinRate = KRateEnumLookup[i].iRate;
+			break;
+			}
+		}
+	for(TInt i = 0; i < KNumSampleRates; i++)//max to min
+		{
+		if(rates & KRateEnumLookup[i].iRateConstant)
+			{
+			aFormatsSupported().iMaxRate = KRateEnumLookup[i].iRate;
+			break;
+			}
+		}
+	TUint32 enc = supportedFormat().iEncodings;
+	
+	if (enc & KSoundEncoding16BitPCM)
+		{
+		aFormatsSupported().iEncodings = EMdaSoundEncoding16BitPCM;// Always defaults to this
+		}
+	if (enc & KSoundEncoding8BitPCM)
+		{
+		aFormatsSupported().iEncodings |= EMdaSoundEncoding8BitPCM;
+		}
+	TUint32 channels = supportedFormat().iChannels;
+	
+	if (channels & KSoundStereoChannel)
+		{
+		aFormatsSupported().iChannels = 2;
+		}
+	else
+		{
+		aFormatsSupported().iChannels = 1;
+		}
+	aFormatsSupported().iMinBufferSize = supportedFormat().iRequestMinSize;
+	aFormatsSupported().iMaxBufferSize = KMaxBufferSize;
+	aFormatsSupported().iMinVolume = 0;
+	aFormatsSupported().iMaxVolume = KSoundMaxVolume;
+	}
+	
+void RMdaDevSound::CBody::GetFormat(TCurrentSoundFormatBuf& aFormat, 
+									RSoundSc& /*aSoundDevice*/,
+									const TFormatData &aFormatData)
+	{
+	// always return the requested, or the initial, not current device setting
+	aFormat().iChannels = aFormatData.iRequestedChannels; // never clear if this is bitmap or value, but effectively the same
+	aFormat().iRate = aFormatData.iSampleRate;
+	}
+	
+void RMdaDevSound::CBody::StartPlayersAndUpdateState()
+	{
+	__ASSERT_DEBUG(iPlaySoundDevice.Handle(), Panic(EDeviceNotOpened));
+
+	switch(iState)
+		{
+		case ENotReady:
+			Panic(EDeviceNotOpened);
+			break;
+				
+		case EStopped:
+ 			// Allow following code to queue more driver play requests and check for stopped
+			break;
+	
+		case ERecording:
+		case ERecordingPausedInHw:
+		case ERecordingPausedInSw:
+			Panic(EBadState);
+			break;
+			
+		case EPlaying:
+            // Allow following code to queue more driver play requests  and check for underrun
+		    break;
+			
+		case EPlayingPausedInHw: // ie. Play request pending on h/w and paused
+			// Allow following code to queue more driver play requests
+			break;
+		
+		case EPlayingPausedInSw:
+			// Paused but driver not playing+paused, therefore do not queue new requests until ResumePlaying
+			return;
+
+		case EPlayingUnderrun:
+			// Allow following code to queue more driver play requests		
+			break;
+			
+		default:
+			Panic(EBadState);
+			break;
+		}
+
+	// iState is now either EStopped, EPlaying, EPlayingPausedInHw or EPlayingUnderrun
+    __ASSERT_DEBUG(((iState == EStopped) || (iState == EPlaying) || (iState == EPlayingPausedInHw) || (iState == EPlayingUnderrun)), Panic(EBadState));
+
+	while( (iClientPlayData.Length() != 0) && (! iFreePlayers.IsEmpty()))
+		{
+		// More data to play and more players,  so issue another request 
+
+		bool wasIdle = iFreePlayers.IsFull();
+		// Get a free player		
+		CPlayer *player = iFreePlayers.Pop();
+		// Calculate length of request
+		TUint32 lengthToPlay = iClientPlayData.Length();
+		if(lengthToPlay > iDeviceBufferLength)
+		    {
+            lengthToPlay = iDeviceBufferLength;
+		    }
+
+		// Remember request length, so we can update bytes played when it finishes
+		iActivePlayRequestSizes.Push(lengthToPlay);
+
+		// Find offset to copy data to
+		TUint playerIndex = player->GetPlayerIndex();
+		ASSERT(playerIndex < KPlaySharedChunkBuffers);
+		TUint chunkOffset = iPlayBufferConfig.iBufferOffsetList[playerIndex];
+
+		// Copy data
+		TPtr8 destPtr(iPlayChunk.Base()+ chunkOffset, 0, iDeviceBufferLength);
+		destPtr.Copy(iClientPlayData.Mid(0, lengthToPlay));
+
+		// Update iClientPlayData to remove the data just queued
+		iClientPlayData.Set(iClientPlayData.Right(iClientPlayData.Length()-lengthToPlay));
+
+		// Start the CPlayer
+		player->PlayData(chunkOffset, lengthToPlay);
+		if(wasIdle)
+			{
+			// HW was not active so update state and start time
+			iState = EPlaying;
+			iStartTime = CurrentTimeInMsec();
+			}
+		}
+
+	// Check if the client request is now complete
+	if(iClientPlayData.Length() == 0 && iClientPlayStatus)
+		{
+		// We have queued all the client play data to the driver so we can now complete the client request.
+		// If actual playback fails, we will notify the client via the Play Error notification mechanism.
+		#ifdef SYMBIAN_SOUNDADAPTER_DEBUG	
+		RDebug::Printf("RMdaDevSound::CBody::StartPlayersAndUpdateState completing client request");
+		#endif
+		User::RequestComplete(iClientPlayStatus, KErrNone); // This call also sets iClientPlayStatus to NULL
+		}
+	
+    //nb. iState is now either EStopped, EPlaying, EPlayingPausedInHw or EPlayingUnderrun (see previous switch and assert)
+	if(iState != EPlayingPausedInHw)
+	    {
+        if(iFreePlayers.IsFull())
+            {
+            // Free fifo is full, therefore there are no active players
+            iState = EPlayingUnderrun;
+			if(! iUnderFlowReportedSinceLastPlayOrRecordRequest)
+				{
+				// We report KErrUnderflow if we have not already reported it since the last PlayData call.
+				// Note that 
+				// i) We do NOT report driver underflows.
+				// ii) We report underflow when we run out of data to pass to the driver.
+				// iii) We throttle this reporting
+				// iv) We WILL report KErrUnderflow if already stopped and asked to play a zero length buffer
+				// The last point is required because the client maps a manual stop command into a devsound play with a 
+				// zero length buffer and the last buffer flag set, this in turn is mapped to a Playdata calll with an empty buffer
+				// which is expected to complete ok and cause a KErrUnderflow error to be reported...
+				iUnderFlowReportedSinceLastPlayOrRecordRequest = ETrue;
+				#ifdef SYMBIAN_SOUNDADAPTER_DEBUG	
+		        RDebug::Printf("RMdaDevSound::CBody::StartPlayersAndUpdateState stopped and iUnderFlowReportedSinceLastPlayOrRecordRequest false so raising KErrUnderflow");
+				#endif
+				
+				// Discard any saved trailing data (ie. data saved due driver requiring all requests to be a multiple of iRequestMinSize).
+				// This maybe because client is delibrately letting us underflow to play silence. In that case we do not want to
+				// play the trailing data at the beginning of the new data issued after the silence...
+				iSavedTrailingData.SetLength(0);
+
+				SoundDeviceError(KErrUnderflow);
+				}
+            }
+        else
+            {
+            // Free fifo not full, therefore there are active players
+            iState = EPlaying;
+            }
+	    }
+	return;
+	}
+
+TInt RMdaDevSound::CBody::SetFormat(const TCurrentSoundFormatBuf& aFormat, 
+									RSoundSc& aSoundDevice,
+									TFormatData &aFormatData)
+	{
+	TInt err = KErrNotFound;
+	TCurrentSoundFormatV02Buf formatBuf;
+	
+	delete aFormatData.iConverter; 
+	aFormatData.iConverter = NULL; // setting this to NULL indicates we are not using converter. No other flag
+	iConvertedPlayData.Close();
+	
+	TInt wantedRate = aFormat().iRate;
+	for(TInt index = 0; index < KNumSampleRates; index++ )
+		{
+		if(wantedRate == KRateEnumLookup[index].iRate)
+			{
+			formatBuf().iRate = KRateEnumLookup[index].iRateEnum;
+			aFormatData.iSampleRate = wantedRate;
+			err = KErrNone;
+			break;
+			}
+		}
+	
+	if(err == KErrNone)
+		{
+		// Assume, for now, we support the requested channels and rate
+		aFormatData.iActualChannels = aFormatData.iRequestedChannels;
+		aFormatData.iActualRate = aFormatData.iSampleRate;
+
+		// Attempt to configure driver
+		formatBuf().iChannels = aFormat().iChannels;
+		formatBuf().iEncoding = ESoundEncoding16BitPCM;
+		formatBuf().iDataFormat = ESoundDataFormatInterleaved;
+		err = aSoundDevice.SetAudioFormat(formatBuf);
+        #if defined(SYMBIAN_SOUNDADAPTER_FORCECDRATES) || defined (SYMBIAN_SOUNDADAPTER_FORCESTEREO)
+            err = KErrNotSupported; // force Negotiate - for debugging
+        #endif
+		if (err==KErrNotSupported)
+			{
+			// don't support directly. Perhaps can rate convert?
+			err = NegotiateFormat(aFormat, aSoundDevice, aFormatData);
+			}
+		}
+	return err;	
+	}
+	
+TInt RMdaDevSound::CBody::NegotiateFormat(const TCurrentSoundFormatBuf& aFormat, 
+										  RSoundSc& aSoundDevice, 
+										  TFormatData &aFormatData)
+	{
+	ASSERT(!aFormatData.iConverter); // we don't clear on fail - so assuming NULL to start with
+	
+	TInt err = KErrNotFound;
+	TCurrentSoundFormatV02Buf formatBuf;
+
+	// find out first what the driver supports
+	TSoundFormatsSupportedV02Buf supportedFormat;
+	aSoundDevice.Caps(supportedFormat);
+	TUint32 supportedRates = supportedFormat().iRates;
+    #ifdef SYMBIAN_SOUNDADAPTER_FORCECDRATES
+        supportedRates &= KSoundRate11025Hz| KSoundRate22050Hz | KSoundRate44100Hz; // only use CD rates - for debugging
+    #endif
+	
+	// For PlayCase:
+	// 		first try to find the first rate below or equal to the requested that is supported
+	// 		initially go down and be fussy, but if we pass the requested rate find the first that
+	// 		is supported
+	// For RecordCase:
+	//		We want the next rate above consistently - we go down from this to the requested rate.
+	//		If there is one, we don't support - we _never_ upsample.
+	// note that the table is given in descending order, so we start with the highest
+	TInt wantedRate = aFormat().iRate;
+	TInt takeTheFirst = EFalse;
+	TInt nextUpValidIndex = -1;
+	for(TInt index = 0; index < KNumSampleRates; index++ )
+		{
+		TBool lookingAtRequestedRate = wantedRate == KRateEnumLookup[index].iRate;
+		TSoundRate wantedEnum = KRateEnumLookup[index].iRateEnum;
+		TUint32 equivBitmap = KRateEnumLookup[index].iRateConstant;
+		TBool isSupported = (equivBitmap & supportedRates) != EFalse;
+		if (lookingAtRequestedRate || takeTheFirst)
+			{
+			if (isSupported)
+				{
+				// this rate is supported
+				formatBuf().iRate = wantedEnum;
+				aFormatData.iActualRate = KRateEnumLookup[index].iRate;
+				err = KErrNone;
+				break;				
+				}
+			}
+		else if (!takeTheFirst)
+			{
+			// while we are still looking for the rate, want to cache any supported index
+			// at end of loop, this will be the first rate above ours that is supported
+			// use for fallback if required
+			if (isSupported)
+				{
+				nextUpValidIndex = index;
+				}
+			}
+		if (lookingAtRequestedRate)
+			{
+			// if we get this far we've gone passed the wanted rate. For play we enable
+			// "takeTheFirst". For record we just abort.
+			if (&aSoundDevice==&iPlaySoundDevice)
+				{
+				takeTheFirst = ETrue;
+				}
+			else
+				{
+				break;
+				}
+			}
+		}
+		
+	if (err)
+		{
+		// if there is one above the requested rate, use that
+		if (nextUpValidIndex>=0)
+			{
+			TSoundRate wantedEnum = KRateEnumLookup[nextUpValidIndex].iRateEnum;
+			formatBuf().iRate = wantedEnum;
+			aFormatData.iActualRate = KRateEnumLookup[nextUpValidIndex].iRate;
+			err = KErrNone;		
+			}
+		}
+		
+	if (err)
+		{
+		// should have something!
+		return err;
+		}
+		
+	aFormatData.iSampleRate = wantedRate; // iSampleRate is our requested/apparent rate, not the device rate.
+	
+	TUint32 channelsSupported = supportedFormat().iChannels;
+    #ifdef SYMBIAN_SOUNDADAPTER_FORCESTEREO
+        channelsSupported &= KSoundStereoChannel; // don't use mono - for debugging
+    #endif
+
+	if (aFormat().iChannels == 1)
+		{
+		aFormatData.iRequestedChannels = 1;
+		// want mono
+		if (channelsSupported & KSoundMonoChannel)
+			{
+			// mono is supported, as usual
+			aFormatData.iActualChannels = 1;
+			}
+		else if (channelsSupported & KSoundStereoChannel)
+			{
+			aFormatData.iActualChannels = 2;
+			}
+		else
+			{
+			return KErrNotSupported; // should not get this far for real
+			}
+		}
+	else if (aFormat().iChannels == 2)
+		{
+		aFormatData.iRequestedChannels = 2;
+		// want stereo
+		if (channelsSupported & KSoundStereoChannel)
+			{
+			// stereo is supported, as usual
+			aFormatData.iActualChannels = 2;
+			}
+		else if (channelsSupported & KSoundMonoChannel)
+			{
+			aFormatData.iActualChannels = 1;
+			}
+		else
+			{
+			return KErrNotSupported; // should not get this far for real
+			}
+		}
+	else
+		{
+		return KErrNotSupported; // unknown number of channels requested!
+		}
+	
+	formatBuf().iChannels = aFormatData.iActualChannels;
+	
+	formatBuf().iEncoding = ESoundEncoding16BitPCM;
+	formatBuf().iDataFormat = ESoundDataFormatInterleaved;
+	err = aSoundDevice.SetAudioFormat(formatBuf);
+	
+	if (!err)
+		{
+		ASSERT(!aFormatData.iConverter); // pre-condition at top of function anyway
+		if (&aSoundDevice==&iPlaySoundDevice)
+			{
+            #ifdef SYMBIAN_SOUNDADAPTER_DEBUG
+                RDebug::Print(_L("RMdaDevSound::CBody::NegotiateFormat: Convert:CreateL from %d/%d to %d/%d"), 
+                            aFormatData.iSampleRate, aFormatData.iRequestedChannels, 
+                            aFormatData.iActualRate, aFormatData.iActualChannels);
+            #endif																	       
+			// when playing we convert from requested to actual
+			TRAP(err, aFormatData.iConverter = CChannelAndSampleRateConverter::CreateL(aFormatData.iSampleRate, 
+																		   aFormatData.iRequestedChannels, 
+																	       aFormatData.iActualRate, 
+																	       aFormatData.iActualChannels));
+			}
+		else
+			{
+			// when recording we convert from actual to requested
+			TInt outputRateToUse = aFormatData.iSampleRate;
+            #ifdef SYMBIAN_SKIP_RESAMPLE_ON_RECORD
+                // with this macro just channel convert at most
+                outputRateToUse = aFormatData.iActualRate;
+            #endif
+            #ifdef SYMBIAN_SOUNDADAPTER_DEBUG
+                RDebug::Print(_L("RMdaDevSound::CBody::NegotiateFormat: Convert:CreateL from %d/%d to %d/%d"), 
+                            aFormatData.iActualRate, aFormatData.iActualChannels,
+                            aFormatData.iSampleRate, aFormatData.iRequestedChannels); 
+            #endif																	       
+			TRAP(err, aFormatData.iConverter = CChannelAndSampleRateConverter::CreateL(aFormatData.iActualRate, 
+																	       aFormatData.iActualChannels,
+																	       outputRateToUse, 
+																		   aFormatData.iRequestedChannels));
+			}
+		}
+	if(err != KErrNone)
+		{
+		delete aFormatData.iConverter;
+		aFormatData.iConverter= NULL;
+		iConvertedPlayData.Close();
+		}
+	
+	return err;
+	}
+
+void RMdaDevSound::CBody::StartRecordRequest()
+	{
+	__ASSERT_DEBUG(iRecordSoundDevice.Handle(), Panic(EDeviceNotOpened));
+	
+	iRecorder->RecordData(iBufferLength);
+	}
+
+// Note both InRecordMode and InPlayMode return EFalse for ENotReady and EStopped
+TBool RMdaDevSound::CBody::InRecordMode()const
+	{
+	switch(iState)
+		{
+		case ENotReady:
+		case EStopped:
+			return EFalse;
+			
+		case ERecording:
+		case ERecordingPausedInHw:
+		case ERecordingPausedInSw:
+			return ETrue;
+			
+		case EPlaying:
+		case EPlayingPausedInHw: 
+		case EPlayingPausedInSw:
+		case EPlayingUnderrun:
+			return EFalse;
+			
+		default:
+			Panic(EBadState);
+			break;
+		}
+	return EFalse;
+	}
+
+TBool RMdaDevSound::CBody::InPlayMode() const
+	{
+	switch(iState)
+		{
+		case ENotReady:
+		case EStopped:
+			return EFalse;
+			
+		case ERecording:
+		case ERecordingPausedInHw:
+		case ERecordingPausedInSw:
+			return EFalse;
+			
+		case EPlaying:
+		case EPlayingPausedInHw: 
+		case EPlayingPausedInSw:
+		case EPlayingUnderrun:
+			return ETrue;
+			
+		default:
+			Panic(EBadState);
+			break;
+		}
+	
+	return EFalse;
+	}
+
+
+TUint32 RMdaDevSound::CBody::CurrentTimeInMsec() const
+	{
+	TUint64 tmp = User::NTickCount();
+	tmp *= iNTickPeriodInUsec;
+	tmp /= 1000;
+	return TUint32(tmp);
+	}
+
+void RMdaDevSound::CBody::PlayFormatsSupported(TSoundFormatsSupportedBuf& aFormatsSupported)
+	{
+	__ASSERT_DEBUG(iPlaySoundDevice.Handle(), Panic(EDeviceNotOpened));
+	FormatsSupported(aFormatsSupported, iPlaySoundDevice);
+	}
+	
+void RMdaDevSound::CBody::GetPlayFormat(TCurrentSoundFormatBuf& aFormat)
+	{
+	__ASSERT_DEBUG(iPlaySoundDevice.Handle(), Panic(EDeviceNotOpened));
+	GetFormat(aFormat, iPlaySoundDevice, iPlayFormatData);
+	}
+	
+TInt RMdaDevSound::CBody::SetPlayFormat(const TCurrentSoundFormatBuf& aFormat)
+	{
+	__ASSERT_DEBUG(iPlaySoundDevice.Handle(), Panic(EDeviceNotOpened));
+	return SetFormat(aFormat, iPlaySoundDevice, iPlayFormatData);
+	}
+
+void RMdaDevSound::CBody::RecordFormatsSupported(TSoundFormatsSupportedBuf& aFormatsSupported)
+	{
+	__ASSERT_DEBUG(iRecordSoundDevice.Handle(), Panic(EDeviceNotOpened));
+	FormatsSupported(aFormatsSupported, iRecordSoundDevice);
+	}
+
+void RMdaDevSound::CBody::GetRecordFormat(TCurrentSoundFormatBuf& aFormat)
+	{
+	__ASSERT_DEBUG(iRecordSoundDevice.Handle(), Panic(EDeviceNotOpened));
+	GetFormat(aFormat, iRecordSoundDevice, iRecordFormatData);	
+	}
+
+TInt RMdaDevSound::CBody::SetRecordFormat(const TCurrentSoundFormatBuf& aFormat)
+	{
+	__ASSERT_DEBUG(iRecordSoundDevice.Handle(), Panic(EDeviceNotOpened));
+	return SetFormat(aFormat, iRecordSoundDevice, iRecordFormatData);
+	}
+	
+void RMdaDevSound::CBody::Close()
+	{
+    #ifdef SYMBIAN_SOUNDADAPTER_DEBUG
+        RDebug::Printf("void RMdaDevSound::CBody::Close() started");
+    #endif
+	iBufferOffset = -1;
+	iBufferLength = 0;
+
+	if(iPlaySoundDevice.Handle() != KNullHandle)
+	    {
+        // Make sure all player objects are idle
+        CancelPlayData();
+        iPlayChunk.Close();
+        iPlaySoundDevice.Close();
+	    }
+
+    if(iRecordSoundDevice.Handle() != KNullHandle)
+        {
+        CancelRecordData();
+        iRecordChunk.Close();
+        iRecordSoundDevice.Close();
+        }
+	
+	iState = ENotReady;
+    #ifdef SYMBIAN_SOUNDADAPTER_DEBUG
+        RDebug::Printf("void RMdaDevSound::CBody::Close() ended");
+    #endif
+	}
+
+TInt RMdaDevSound::CBody::Handle()
+	{//This method is actually used to check whether the device is opened. Below logic should work
+	if(iPlaySoundDevice.Handle())
+		{
+		return iPlaySoundDevice.Handle();
+		}
+	if(iRecordSoundDevice.Handle())
+		{
+		return iRecordSoundDevice.Handle();
+		}
+	return 0;
+	}
+
+
+void RMdaDevSound::CBody::PlayData(TRequestStatus& aStatus, const TDesC8& aData)
+	{
+	#ifdef SYMBIAN_SOUNDADAPTER_DEBUG
+    RDebug::Printf("RMdaDevSound::CBody::PlayData(0x%x,%d) State=%s Handle=%d.",&aStatus, 
+                   aData.Length(), iState.Name(), iPlayChunk.Handle());
+	#endif
+	
+	__ASSERT_DEBUG(iPlaySoundDevice.Handle(), Panic(EDeviceNotOpened));
+	aStatus = KRequestPending;
+
+	if((iClientPlayStatus != NULL) || InRecordMode())
+		{
+		// We only support one outstanding request
+		// No support for simultaneous play and record in RMdaDevSound
+		TRequestStatus *pRequest = &aStatus;
+		User::RequestComplete(pRequest, KErrInUse);
+		return;
+		}
+	iClientPlayStatus = &aStatus;//store the status of datapath player
+
+	if(iPlayFormatData.iConverter || iSavedTrailingData.Length() != 0)
+		{
+		// Need a conversion buffer
+        // Needs to hold any trailing data truncated from the previous request (due
+        // to alignment requirements) and either the new data, or the new rate adapted data
+		TUint32 spaceRequired = iSavedTrailingData.Length();
+		if(iPlayFormatData.iConverter)
+			{
+			// Doing rate conversion so also need space for the converted data
+			spaceRequired += iPlayFormatData.iConverter->MaxConvertBufferSize(aData.Length());
+			}
+		else
+			{
+			// Not doing rate adaptation therefore only need to allow for the new incoming data
+			spaceRequired += aData.Length();
+			}
+		// Check if existing buffer exists and is big enough
+		if(iConvertedPlayData.MaxLength() < spaceRequired)
+			{
+			iConvertedPlayData.Close();
+			TInt err = iConvertedPlayData.Create(spaceRequired);
+			if(err)
+				{
+				User::RequestComplete(iClientPlayStatus, err);
+				return;
+				}
+			}
+
+		// Truncate iConvertedPlayData and copy in saved trailing data (if any)
+		iConvertedPlayData = iSavedTrailingData;
+		iSavedTrailingData.SetLength(0);
+		
+		// Now append rate adapted data or incoming data
+		if (iPlayFormatData.iConverter)
+			{
+            // The convertor will panic if it fails to convert any data, therefore
+            // we avoid passing it an empty source buffer
+			if(aData.Length() != 0)
+				{
+                TPtr8 destPtr((TUint8 *)iConvertedPlayData.Ptr()+iConvertedPlayData.Length(), 0, iConvertedPlayData.MaxLength()-iConvertedPlayData.Length());
+				TInt len = iPlayFormatData.iConverter->Convert(aData, destPtr);
+				iConvertedPlayData.SetLength(iConvertedPlayData.Length() + destPtr.Length());
+				if(len != aData.Length())
+					{
+					#ifdef SYMBIAN_SOUNDADAPTER_DEBUG
+					RDebug::Printf("RMdaDevSound::CBody::PlayData converted %d	but expected to convert %d", len, aData.Length());
+					#endif
+					}
+				}
+			}
+		else
+			{
+			iConvertedPlayData.Append(aData);
+			}
+		iClientPlayData.Set(iConvertedPlayData);
+		}
+	else
+		{
+		// Do not need a conversion buffer so just aim the descriptor at the data
+		iClientPlayData.Set(aData);
+		}
+	iUnderFlowReportedSinceLastPlayOrRecordRequest = EFalse;
+
+	// All driver requests must be an exact multiple of iRequestMinSize
+	TUint32 trailingDataLen = iClientPlayData.Length() % iRequestMinSize;
+	if(trailingDataLen)
+		{
+		// Not a multiple of iRequestMinSize, so need to truncate current request, and save trailing bytes for 
+		// inclusion at the beginning of the next request
+		iSavedTrailingData = iClientPlayData.Right(trailingDataLen);
+		iClientPlayData.Set(iClientPlayData.Left(iClientPlayData.Length()-trailingDataLen));
+		}
+
+    #ifdef SYMBIAN_FORCE_32BIT_LENGTHS
+	if (iClientPlayData.Length()%4 != 0)
+	    {
+        // simulate the limitation of some hardware, where -6 is generated if the
+        // buffer length is not divisible by 4.
+        TRequestStatus *pRequest = &aStatus;
+        User::RequestComplete(pRequest, KErrArgument);
+	}
+    #endif
+
+	iRecordChunk.Close();
+	if(!iPlayChunk.Handle())
+		{
+		//This is where we setup to play. 
+		//Configure the shared chunk for two buffers with iBufferSize each
+		iPlayBufferConfig.iNumBuffers = KPlaySharedChunkBuffers;
+		iDeviceBufferLength = KPlaySharedChunkBufferSize;
+		#ifdef SYMBIAN_SOUNDADAPTER_DEBUG	
+		RDebug::Printf("iDeviceBufferLength %d", iDeviceBufferLength);
+		#endif
+		iPlayBufferConfig.iFlags = 0;//data will be continuous
+		// If required, use rate converter etc
+		iPlayBufferConfig.iBufferSizeInBytes = iDeviceBufferLength;
+        #ifdef SYMBIAN_SOUNDADAPTER_DEBUG
+            RDebug::Printf("number of buffers: [%d]",iPlayBufferConfig.iNumBuffers);
+            RDebug::Printf("BufferSize in Bytes [%d]",iPlayBufferConfig.iBufferSizeInBytes);
+        #endif
+		TPckg<TPlaySharedChunkBufConfig> bufferConfigBuf(iPlayBufferConfig);
+		TInt error = iPlaySoundDevice.SetBufferChunkCreate(bufferConfigBuf,iPlayChunk);
+		if(error == KErrNone)
+			{
+			iPlaySoundDevice.GetBufferConfig(bufferConfigBuf);
+			}
+		if (error)
+			{
+			SoundDeviceError(error);
+			return;
+			}
+		}
+
+    StartPlayersAndUpdateState();
+
+	return;	
+	}
+
+void RMdaDevSound::CBody::RecordData(TRequestStatus& aStatus, TDes8& aData)
+	{
+	__ASSERT_DEBUG(iRecordSoundDevice.Handle(), Panic(EDeviceNotOpened));
+	aStatus = KRequestPending;
+	if((iClientPlayStatus != NULL) || InPlayMode())
+		{
+		// We only support one outstanding request
+		// No support for simultaneous play and record in RMdaDevSound
+		TRequestStatus *pRequest = &aStatus;
+		User::RequestComplete(pRequest, KErrInUse);
+		return;
+		}
+	iClientRecordStatus = &aStatus;
+	iClientRecordData = &aData;
+	iUnderFlowReportedSinceLastPlayOrRecordRequest = EFalse;
+
+	iPlayChunk.Close();
+	if(!iRecordChunk.Handle())
+		{
+		//Configure the shared chunk for two buffers with iBufferSize each
+		iRecordBufferConfig.iNumBuffers = KRecordMaxSharedChunkBuffers;
+		iDeviceBufferLength = KRecordSharedChunkBufferSize; // initial size - resize if needs be
+		if (iRecordFormatData.iConverter)
+			{
+			// if number of channels used differs from request, resize buffer
+			// assume we have nice rounded values for buffer.
+			if (iRecordFormatData.iActualChannels>iRecordFormatData.iRequestedChannels)
+				{
+				iDeviceBufferLength *= 2; // will record at stereo and convert to mono 
+				}
+			else if (iRecordFormatData.iActualChannels<iRecordFormatData.iRequestedChannels)
+				{
+				iDeviceBufferLength /= 2; // will record at mono and convert to stereo 
+				}
+			}
+		iRecordBufferConfig.iBufferSizeInBytes = iDeviceBufferLength;
+		iRecordBufferConfig.iFlags = 0;
+		TPckg<TRecordSharedChunkBufConfig> bufferConfigBuf(iRecordBufferConfig);
+		TInt error = iRecordSoundDevice.SetBufferChunkCreate(bufferConfigBuf,iRecordChunk);
+		if(error == KErrNone)
+			{
+			iRecordSoundDevice.GetBufferConfig(bufferConfigBuf);
+			}
+		else
+			{
+			SoundDeviceError(error);
+			return;
+			}
+		iState = ERecording;
+		}		
+    #ifdef SYMBIAN_SOUNDADAPTER_DEBUG
+        RDebug::Printf("RMdaDevSound::CBody::RecordData,iBufferOffset[%d]",iBufferOffset);
+    #endif
+
+	switch(iState)
+		{
+		case ENotReady:
+			Panic(EBadState);
+			break;
+
+		case EStopped:
+		case ERecording:
+			// Either idle or recording is in progress, therefore we can issue another request			
+			StartRecordRequest();
+			break;
+			
+		case ERecordingPausedInHw:
+			// Driver is paused, therefore we can issue a request which will immediately return buffered data
+			// or be aborted (in the driver) with KErrCancelled if there is no more data). nb. That KErrCancelled should not be
+			// returned to the client because the old RMdaDevSound driver would have completed with KErrNone and zero data length.
+			StartRecordRequest();
+			break;
+
+		case ERecordingPausedInSw:
+			// Paused in s/w but driver is not paused, therefore can not issue a new request to driver because
+			// it would re-start recording.
+			// This implies we were paused whilst the h/w was not recording, so there is no buffered data.
+			
+			// Complete the request with KErrNone and no data.
+			iClientRecordData->SetLength(0);
+			User::RequestComplete(iClientRecordStatus, KErrNone);
+			break;
+			
+		case EPlaying:
+		case EPlayingPausedInHw:
+		case EPlayingPausedInSw:
+		case EPlayingUnderrun:
+			Panic(EBadState);
+			break;
+			
+		default:
+			Panic(EBadState);
+			break;
+		}
+	}
+	
+/**
+	Notify client of error.
+	
+	Note that we continue playing/recording if possible.
+	
+	We do not maintain information which could map the error back to a particular client play/record request
+	and therefore we have to notify the client of error every time it happens.
+	
+	nb. A client play/record request is completed with KErrNone if it queues ok - All errors are reported via the Notify*Error
+	mechanism.
+ */
+void RMdaDevSound::CBody::SoundDeviceError(TInt aError)
+	{
+    #ifdef SYMBIAN_SOUNDADAPTER_DEBUG
+	RDebug::Printf("RMdaDevSound::CBody::SoundDeviceError: Error[%d] state %s", aError, iState.Name());
+    #endif
+
+	ASSERT(aError != KErrNone);
+	
+	if(iClientPlayErrorStatus)
+		{
+        #ifdef SYMBIAN_SOUNDADAPTER_DEBUG
+            RDebug::Printf("RMdaDevSound::CBody::SoundDeviceError Completing iPlayerErrorStatus");
+        #endif
+
+		User::RequestComplete(iClientPlayErrorStatus, aError); // nb call also sets iClientPlayErrorStatus to NULL
+		}
+
+  	if(iClientRecordErrorStatus)
+		{
+        #ifdef SYMBIAN_SOUNDADAPTER_DEBUG
+            RDebug::Printf("RMdaDevSound::CBody::SoundDeviceError Completing iClientRecordErrorStatus");
+        #endif
+		User::RequestComplete(iClientRecordErrorStatus, aError); // nb call also sets iClientRecordErrorStatus to NULL
+		}
+
+	return;
+	}
+
+void RMdaDevSound::CBody::NotifyRecordError(TRequestStatus& aStatus)
+	{
+	aStatus = KRequestPending;
+	iClientRecordErrorStatus = &aStatus;
+	}
+
+void RMdaDevSound::CBody::NotifyPlayError(TRequestStatus& aStatus)
+	{
+	aStatus = KRequestPending;
+	iClientPlayErrorStatus = &aStatus;
+	}
+
+void RMdaDevSound::CBody::CancelNotifyPlayError()
+	{
+	if(iClientPlayErrorStatus)
+		{
+		User::RequestComplete(iClientPlayErrorStatus, KErrCancel);
+		}
+	}
+
+void RMdaDevSound::CBody::CancelNotifyRecordError()
+	{
+	if(iClientRecordErrorStatus)
+		{
+		User::RequestComplete(iClientRecordErrorStatus, KErrCancel);
+		}
+	else
+	    {
+		#ifdef SYMBIAN_SOUNDADAPTER_DEBUG	
+        RDebug::Printf("msp BufferEmptied but iClientPlayStatus==NULL");
+		#endif
+	    }
+	}
+
+void RMdaDevSound::CBody::FlushPlayBuffer()
+	{
+	#ifdef SYMBIAN_SOUNDADAPTER_DEBUG	
+    RDebug::Printf("RMdaDevSound::CBody::FlushPlayBuffer calling CancelPlayData");
+	#endif	
+	CancelPlayData();
+	}
+
+RSoundSc& RMdaDevSound::CBody::PlaySoundDevice()
+	{
+	return iPlaySoundDevice;
+	}
+
+RSoundSc& RMdaDevSound::CBody::RecordSoundDevice()
+	{
+	return iRecordSoundDevice;
+	}
+	
+const RMdaDevSound::CBody::TState &RMdaDevSound::CBody::State() const
+	{
+	return iState;
+	}
+
+
+void RMdaDevSound::CBody::BufferFilled(TInt aBufferOffset)
+	{
+    #ifdef SYMBIAN_SOUNDADAPTER_DEBUG	
+        RDebug::Print(_L("RMdaDevSound::CBody::BufferFilled:"));
+    #endif	
+
+	ASSERT(aBufferOffset>=0 || aBufferOffset==KErrCancel);
+	ASSERT(iClientRecordData); // request should not get this without
+
+	if(aBufferOffset==KErrCancel)
+		{
+		//we can get KErrCancel when we call pause and there is no more data left with the driver
+		//we send the empty buffer to the HwDevice, where this should trigger the shutdown mechanism
+		iClientRecordData->SetLength(0);
+		User::RequestComplete(iClientRecordStatus, KErrNone);
+		iClientRecordStatus = NULL;
+		return;
+		}
+		
+	iBufferOffset = aBufferOffset;
+	//when last buffer is flushed, new driver sometimes gives buffer size of odd number. One of our codecs
+	//expects that the buffer size should always be even. Base suggested that we fix in multimedia
+	//as it is quite complicated to fix in overthere.
+	iBufferLength = iBufferLength & 0xfffffffe;
+	TPtr8 dataPtr(iRecordChunk.Base()+ iBufferOffset, iBufferLength, iClientRecordData->MaxLength());
+	if (iRecordFormatData.iConverter)
+		{
+		iRecordFormatData.iConverter->Convert(dataPtr, *iClientRecordData);
+		}
+	else
+		{
+		iClientRecordData->Copy(dataPtr);
+		}
+    #ifdef SYMBIAN_SOUNDADAPTER_DEBUG
+        RDebug::Print(_L("RMdaDevSound::CBody::BufferFilled: BufferOffset[%d] BufferLen[%d]"), iBufferOffset, iBufferLength);
+    #endif
+	if(iBufferOffset >= 0)
+		{
+		iRecordSoundDevice.ReleaseBuffer(iBufferOffset);
+		}
+	if(iClientRecordStatus)
+		{
+		User::RequestComplete(iClientRecordStatus, KErrNone);
+		iClientRecordStatus = NULL;
+		}
+	else
+	    {
+        RDebug::Printf("msp PlayCancelled but iClientPlayStatus==NULL");
+	    }
+	}
+		
+/*
+	This function is called to notify us that a CPlayer's request has completed and what its status was.
+
+	It is important to note that:-
+	1) RSoundSc driver PlayData requests are guaranteed to complete in order, oldest first
+	2) If we are overloaded, it is possible for more than one request to complete before any CPlayer::RunL is ran. In
+	this situation the CPlayer::RunL functions, and hence this callback, maybe invoked in non-oldest first order
+
+	but
+
+	a) It is impossible for callback for the second oldest CPlayer to occur before the driver request for the oldest has
+	been complete (because of 1)
+	b) We will always get exactly one callback for every complete request.
+
+	Therefore this callback notifies us of two subtly separate things:-
+
+	i) The oldest request has been completed (so we can reduce can increase the bytes played counter by its length
+	ii) CPlayer aPlayerIndex is free for re-use
+
+	but we can not assume that aPlayerIndex is the oldest request, therefore we save the play request lengths outside of
+	the CPlayer object.
+*/
+void RMdaDevSound::CBody::PlayRequestHasCompleted(CPlayer *aPlayer, TInt aStatus, TBool aDueToCancelCommand)
+	{
+	// CPlayer is done so put it on the free queue
+	iFreePlayers.Push(aPlayer);
+
+	TUint32 bytesPlayed = iActivePlayRequestSizes.Pop();
+	// Request has finished therefore now timing the following request to simulate bytes played
+    iStartTime = CurrentTimeInMsec();
+	if(aDueToCancelCommand)
+	    {
+        // Callback due to CPlayer::Cancel/DoCancel being called, therefore we
+        // do not want to update bytes played, process state, report a error or start new players
+        return;
+	    }
+	
+	// Update iBytesPlayed by the length of the oldest request (which might not be the one that CPlayer was 
+	// handling).
+	iBytesPlayed += bytesPlayed;
+	#ifdef SYMBIAN_SOUNDADAPTER_DEBUG	
+    RDebug::Printf("PlayRequestHasCompleted increasing iBytesPlayed by %d to %d", bytesPlayed, iBytesPlayed);
+	#endif
+	
+    // Process state
+	switch(iState)
+		{
+		case ENotReady:
+			Panic(EDeviceNotOpened);
+			break;
+				
+		case EStopped:
+			// Will happen if we are doing CancelPlayData processing with active players
+			break;
+		
+		case ERecording:
+		case ERecordingPausedInHw:
+		case ERecordingPausedInSw:
+			Panic(EBadState);
+			break;
+			
+		case EPlaying:
+			// Normal situation
+			break;
+
+		case EPlayingPausedInHw: 
+			// H/W was/is paused, but there must have been an already complete request that we had not 
+			// processed yet.
+			// There must be at least one more pending request on h/w, otherwise the h/w would have refused to pause
+			// I would expect this be rare, but it happens quite often...
+            #ifdef SYMBIAN_SOUNDADAPTER_DEBUG
+			ASSERT(iActivePlayRequestSizes.Length() != 0);
+            #endif
+			// Need to update the start and pause time to now because we have just updated the actual iBytesPlayed
+			// and logically the h/w is paused at the beginning of the next request
+			iStartTime = CurrentTimeInMsec();
+			iPauseTime = iStartTime;
+			break;
+		
+		case EPlayingPausedInSw:
+			// This will happen if there is only a single hw request outstanding, and the hardware has finished it, but the
+			// corresponding RunL has not run yet (in which case PausePlayBuffer will have attempted to use h/w pause,
+			// but the driver call would have failed, and the state changed to EPlayingPausedInSw).
+			iStartTime = CurrentTimeInMsec();
+			iPauseTime = iStartTime;
+			return;
+
+		case EPlayingUnderrun:
+			// Probably can not happen...
+			break;
+				
+		default:
+			Panic(EBadState);
+			break;
+		}
+
+
+	// If we have an error, report it to the client
+	// We NEVER report driver underflow, instead we report KErrUnderflow if we run out of data to pass to driver.
+	if( (aStatus != KErrNone) && (aStatus != KErrUnderflow) )
+		{
+		SoundDeviceError(aStatus);
+		}
+
+    // If appropriate start more players
+	StartPlayersAndUpdateState();
+	return;
+	}
+
+RMdaDevSound::CBody::CPlayer::CPlayer(TInt aPriority, RMdaDevSound::CBody& aParent, TInt aIndex):
+	CActive(aPriority), iParent(aParent), iIndex(aIndex), iBufferOffset(-1), iBufferLength(0)
+	{
+	CActiveScheduler::Add(this);
+	}
+
+RMdaDevSound::CBody::CPlayer::~CPlayer()
+	{
+	Cancel();
+	}
+
+
+void RMdaDevSound::CBody::CPlayer::RunL()
+	{
+    #ifdef SYMBIAN_SOUNDADAPTER_DEBUG	
+    RDebug::Printf("****RMdaDevSound::CBody::CPlayer(%d)::RunL: Error[%d] ParentState[%s]", 
+                     iIndex, iStatus.Int(), iParent.State().Name());
+	RDebug::Printf("iActivePlayRequestSizes.Length() = %d iFreePlayers.Length() = %d (including this one as active)", 
+					iParent.iActivePlayRequestSizes.Length(), 
+					iParent.iFreePlayers.Length());
+    #endif
+	iParent.PlayRequestHasCompleted(this, iStatus.Int(), EFalse);
+	return;
+	}
+
+TInt RMdaDevSound::CBody::CPlayer::RunError(TInt aError)
+	{
+	iParent.PlayRequestHasCompleted(this, aError, EFalse);
+	return KErrNone;
+	}
+
+void RMdaDevSound::CBody::CPlayer::DoCancel()
+	{
+#ifdef SYMBIAN_SOUNDADAPTER_DEBUG
+	RDebug::Printf("RMdaDevSound::CBody::CPlayer(%d)::DoCancel", iIndex);
+#endif
+	if(iStatus == KRequestPending)
+	    {
+        // Avoid cancelling requests which have already completed.
+        // It wastes time, and might provoke a sound driver problem
+	    #ifdef SYMBIAN_SOUNDADAPTER_DEBUG	
+        RDebug::Printf("RMdaDevSound::CBody::CPlayer::DoCancel - would have cancelled driver request");
+		#endif
+        iParent.PlaySoundDevice().Cancel(iStatus);
+	    }
+	iParent.PlayRequestHasCompleted(this, KErrCancel, ETrue);
+	}
+
+void RMdaDevSound::CBody::CPlayer::PlayData(TUint aChunkOffset, TInt aLength)
+	{
+    #ifdef SYMBIAN_SOUNDADAPTER_DEBUG	
+	RDebug::Print(_L("RMdaDevSound::CBody::CPlayer(%d)::PlayData : IsActive[%d]"),
+				  iIndex,    IsActive());
+	RDebug::Printf("iActivePlayRequestSizes.Length() = %d iFreePlayers.Length() = %d (inc this player)", 
+					iParent.iActivePlayRequestSizes.Length(), 
+					iParent.iFreePlayers.Length());
+    #endif	
+	
+	iBufferOffset = aChunkOffset;
+	iBufferLength = aLength;
+
+    //Make sure the length is a multiple of 4 to work around an h6 limitation.
+	iBufferLength = iBufferLength & 0xfffffffc;
+
+	// Issue the RSoundSc request
+	iParent.PlaySoundDevice().PlayData(iStatus, iBufferOffset, iBufferLength, EFalse);
+	SetActive();
+	return;
+	}
+	
+TUint RMdaDevSound::CBody::CPlayer::GetPlayerIndex() const
+	{
+	return iIndex;
+	}
+
+RMdaDevSound::CBody::CRecorder::CRecorder(TInt aPriority, RMdaDevSound::CBody& aParent):
+    CActive(aPriority), iParent(aParent), iBufferOffset(-1), iBufferLength(0)
+    {
+    CActiveScheduler::Add(this);
+    }
+
+RMdaDevSound::CBody::CRecorder::~CRecorder()
+    {
+    Cancel();
+    }
+
+void RMdaDevSound::CBody::CRecorder::RecordData(TInt& aBufferLength)
+	{
+	if (!IsActive())
+	    {
+	    iStatus = KRequestPending;
+        #ifdef SYMBIAN_SOUNDADAPTER_DEBUG
+            RDebug::Printf("Recording request: BufferLength[%d]", aBufferLength);
+        #endif
+	    iParent.RecordSoundDevice().RecordData(iStatus, aBufferLength);
+	    SetActive();
+	    }
+	}
+
+void RMdaDevSound::CBody::CRecorder::RunL()
+	{
+    #ifdef SYMBIAN_SOUNDADAPTER_DEBUG	
+    RDebug::Printf("****RMdaDevSound::CBody::CRecorder()::RunL: Error[%d] ParentState[%s]", 
+                     iStatus.Int(), iParent.State().Name());
+    #endif
+
+	
+	TInt error = iStatus.Int();
+	
+	if((error >= 0) || (error == KErrCancel))
+		{//we can get KErrCancel when we call pause and there is no more data left with the driver
+		iParent.BufferFilled(error);
+		}
+	else 
+		{
+        #ifdef SYMBIAN_SOUNDADAPTER_DEBUG	
+            RDebug::Print(_L("RMdaDevSound::CBody::CPlayer()::RunL: Error[%d]"), error);
+        #endif
+		iParent.SoundDeviceError(error);
+		}
+	}
+
+	
+TInt RMdaDevSound::CBody::CRecorder::RunError(TInt aError)
+    {
+    iParent.SoundDeviceError(aError);
+    return KErrNone;
+    }
+
+void RMdaDevSound::CBody::CRecorder::DoCancel()
+    {
+#ifdef SYMBIAN_SOUNDADAPTER_DEBUG
+    RDebug::Printf("RMdaDevSound::CBody::CRecorder()::DoCancel");
+#endif
+    iParent.RecordSoundDevice().Cancel(iStatus);
+    }
+
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmrenderer/src/mdasoundadapterbody.h	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,639 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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 MDASOUNDADAPTERBODY_H
+#define MDASOUNDADAPTERBODY_H
+
+#include "mdasoundadapter.h"
+#include <d32soundsc.h>
+#include <e32base.h>
+#include <e32std.h>
+
+/** 
+Panic category and codes for the mdasoundadapter
+*/
+_LIT(KSoundAdapterPanicCategory, "mdasoundadapter");
+enum TSoundAdapterPanicCodes
+	{
+	EDeviceNotOpened,
+	EPanicPartialBufferConverterNotSupported,
+	EBadState,
+	ENoClientPlayRequest,
+	EFifoEmpty,
+	EFifoFull
+	};
+	
+//Structure used to map samples per second to the corresponding enums in RSoundSc
+struct TSampleRateEnumTable
+  	{
+	TInt iRate;
+	TSoundRate iRateEnum;
+	TUint iRateConstant;
+	};
+
+//Table that maps given samples per second to the corresponding enums in RSoundSc
+const TSampleRateEnumTable KRateEnumLookup[] =
+								 {
+									{48000,ESoundRate48000Hz,KSoundRate48000Hz},
+			                   		{44100,ESoundRate44100Hz,KSoundRate44100Hz},
+				                  	{32000,ESoundRate32000Hz,KSoundRate32000Hz},
+									{24000,ESoundRate24000Hz,KSoundRate24000Hz},
+				                  	{22050,ESoundRate22050Hz,KSoundRate22050Hz},
+				                  	{16000,ESoundRate16000Hz,KSoundRate16000Hz},
+				                  	{12000,ESoundRate12000Hz,KSoundRate12000Hz},
+				                  	{11025,ESoundRate11025Hz,KSoundRate11025Hz},
+				                  	{8000, ESoundRate8000Hz, KSoundRate8000Hz}
+                   				 };
+//Structure used to map linear value of the volume to the decibel value.
+struct TLinearToDbTable
+	{
+	TInt iLiniearValue;
+	TInt iDBValue;
+	};
+
+
+//Table that maps given linear value of volume to the corresponding decibel value.
+const TLinearToDbTable KLinerToDbConstantLookup[] =
+						{
+							{0,0},
+							{1,158},
+							{2,170},
+							{3,177},
+							{4,182},
+							{5,186},
+							{6,189},
+							{7,192},
+							{8,194},
+							{9,196},
+							{10,198},
+							{11,200},
+							{12,201},
+							{13,203},
+							{14,204},
+							{15,205},
+							{16,206},
+							{17,207},
+							{18,208},
+							{19,209},
+							{20,210},
+							{21,211},
+							{22,212},
+							{23,213},
+							{24,213},
+							{25,214},
+							{26,215},
+							{27,215},
+							{28,216},
+							{29,217},
+							{30,217},
+							{31,218},
+							{32,218},
+							{33,219},
+							{34,219},
+							{35,220},
+							{36,220},
+							{37,221},
+							{38,221},
+							{39,222},
+							{40,222},
+							{41,223},
+							{42,223},
+							{43,224},
+							{44,224},
+							{45,224},
+							{46,225},
+							{47,225},
+							{48,225},
+							{49,226},
+							{50,226},
+							{51,226},
+							{52,227},
+							{53,227},
+							{54,227},
+							{55,228},
+							{56,228},
+							{57,228},
+							{58,229},
+							{59,229},
+							{60,229},
+							{61,230},
+							{62,230},
+							{63,230},
+							{64,230},
+							{65,231},
+							{66,231},
+							{67,231},
+							{68,231},
+							{69,232},
+							{70,232},
+							{71,232},
+							{72,232},
+							{73,233},
+							{74,233},
+							{75,233},
+							{76,233},
+							{77,234},
+							{78,234},
+							{79,234},
+							{80,234},
+							{81,235},
+							{82,235},
+							{83,235},
+							{84,235},
+							{85,235},
+							{86,236},
+							{87,236},
+							{88,236},
+							{89,236},
+							{90,236},
+							{91,237},
+							{92,237},
+							{93,237},
+							{94,237},
+							{95,237},
+							{96,237},
+							{97,238},
+							{98,238},
+							{99,238},
+							{100,238},
+							{101,238},
+							{102,239},
+							{103,239},
+							{104,239},
+							{105,239},
+							{106,239},
+							{107,239},
+							{108,240},
+							{109,240},
+							{110,240},
+							{111,240},
+							{112,240},
+							{113,240},
+							{114,240},
+							{115,241},
+							{116,241},
+							{117,241},
+							{118,241},
+							{119,241},
+							{120,241},
+							{121,241},
+							{122,242},
+							{123,242},
+							{124,242},
+							{125,242},
+							{126,242},
+							{127,242},
+							{128,242},
+							{129,243},
+							{130,243},
+							{131,243},
+							{132,243},
+							{133,243},
+							{134,243},
+							{135,243},
+							{136,244},
+							{137,244},
+							{138,244},
+							{139,244},
+							{140,244},
+							{141,244},
+							{142,244},
+							{143,244},
+							{144,245},
+							{145,245},
+							{146,245},
+							{147,245},
+							{148,245},
+							{149,245},
+							{150,245},
+							{151,245},
+							{152,245},
+							{153,246},
+							{154,246},
+							{155,246},
+							{156,246},
+							{157,246},
+							{158,246},
+							{159,246},
+							{160,246},
+							{161,246},
+							{162,247},
+							{163,247},
+							{164,247},
+							{165,247},
+							{166,247},
+							{167,247},
+							{168,247},
+							{169,247},
+							{170,247},
+							{171,247},
+							{172,248},
+							{173,248},
+							{174,248},
+							{175,248},
+							{176,248},
+							{177,248},
+							{178,248},
+							{179,248},
+							{180,248},
+							{181,248},
+							{182,249},
+							{183,249},
+							{184,249},
+							{185,249},
+							{186,249},
+							{187,249},
+							{188,249},
+							{189,249},
+							{190,249},
+							{191,249},
+							{192,250},
+							{193,250},
+							{194,250},
+							{195,250},
+							{196,250},
+							{197,250},
+							{198,250},
+							{199,250},
+							{200,250},
+							{201,250},
+							{202,250},
+							{203,250},
+							{204,251},
+							{205,251},
+							{206,251},
+							{207,251},
+							{208,251},
+							{209,251},
+							{210,251},
+							{211,251},
+							{212,251},
+							{213,251},
+							{214,251},
+							{215,251},
+							{216,252},
+							{217,252},
+							{218,252},
+							{219,252},
+							{220,252},
+							{221,252},
+							{222,252},
+							{223,252},
+							{224,252},
+							{225,252},
+							{226,252},
+							{227,252},
+							{228,252},
+							{229,253},
+							{230,253},
+							{231,253},
+							{232,253},
+							{233,253},
+							{234,253},
+							{235,253},
+							{236,253},
+							{237,253},
+							{238,253},
+							{239,253},
+							{240,253},
+							{241,253},
+							{242,254},
+							{243,254},
+							{244,254},
+							{245,254},
+							{246,254},
+							{247,254},
+							{248,254},
+							{249,254},
+							{250,254},
+							{251,254},
+							{252,254},
+							{253,254},
+							{254,254},
+							{255,254}
+						};
+
+// Total Number of sample rates
+const TUint KNumSampleRates = 9;
+// Number of shared chunk buffers used for playing
+// Each buffer is permanently mapped, via an index number, to a particular buffer in the chunk
+// The esoundsc.ldd can only handle a max of 8 pending play requests, therefore no point in having
+// more than 8 play buffers...
+const TUint KPlaySharedChunkBuffers = 8;
+// Size of RSoundSc play buffers
+const TUint KPlaySharedChunkBufferSize = 4096;
+
+//Number of shared chunk buffers used for recording
+const TUint KRecordMaxSharedChunkBuffers = 8;
+// Size of RSoundSc record buffers
+const TUint KRecordSharedChunkBufferSize = 4096;
+
+//Shared chunk driver does not support max. buffer size. 16K is given in order to simulate the old driver behavior.
+const TUint KMaxBufferSize = 0x4000;
+
+class TPlaySharedChunkBufConfig : public TSharedChunkBufConfigBase
+	{
+public:
+	TInt iBufferOffsetList[KPlaySharedChunkBuffers];
+	};
+
+class TRecordSharedChunkBufConfig : public TSharedChunkBufConfigBase
+	{
+public:
+	TInt iBufferOffsetList[KRecordMaxSharedChunkBuffers];
+	};
+	
+class CChannelAndSampleRateConverter; // forward dec
+
+GLDEF_C void Panic(TSoundAdapterPanicCodes aPanicCode);//forward declaration
+
+// RFifo class which manages a fifo of up to COUNT items of type T
+template<typename T, TUint32 COUNT> class RFifo
+	{
+public:
+	RFifo()
+		: iWriteIndex(0), iReadIndex(0)
+		{}
+	TBool IsEmpty() const
+		{
+		return iWriteIndex == iReadIndex;
+		}
+	TBool IsFull() const
+		{
+		// Full if writing one more item would make iWriteIndex equal to iReadIndex
+		TUint32 next = NextIndex(iWriteIndex);
+		return next == iReadIndex;
+		}
+	/// Push item into FIFO. Does not take ownership. Will PANIC with EFifoFull if full.
+	void Push(const T &aItem)
+		{
+		if(IsFull())
+			{
+			Panic(EFifoFull);
+			}
+		iFifo[iWriteIndex] = aItem;
+		iWriteIndex = NextIndex(iWriteIndex);
+		}
+    /// Pop item from FIFO. Will PANIC with EFifoEmpty if empty 
+	T Pop()
+		{
+		if(IsEmpty())
+			{
+			Panic(EFifoEmpty);
+			}
+		TUint32 tmp = iReadIndex;
+		iReadIndex = NextIndex(iReadIndex);
+		return iFifo[tmp];
+		}
+
+    /// Peek first item from FIFO. Will PANIC with EFifoEmpty if empty 
+	T Peek()
+		{
+		if(IsEmpty())
+			{
+			Panic(EFifoEmpty);
+			}
+		return iFifo[iReadIndex];
+		}
+	TUint Length() const
+		{
+		TUint len;
+		if(iWriteIndex >= iReadIndex)
+			{
+			len = iWriteIndex - iReadIndex;
+			}
+		else
+			{
+			len =  COUNT+1 - (iReadIndex - iWriteIndex);
+			}
+		return len;
+		}
+private:
+	TUint32 NextIndex(TUint32 aIndex) const
+		{
+		++aIndex;
+		aIndex %= (COUNT+1);
+		return aIndex;
+		}
+	T iFifo[COUNT+1];
+	TUint32 iWriteIndex;
+	TUint32 iReadIndex;
+	};
+
+
+
+//Body class for the adapter
+NONSHARABLE_CLASS( RMdaDevSound::CBody ): public CBase
+	{
+public:
+	//This class handles the play/record completions from the new sound driver
+	NONSHARABLE_CLASS( CPlayer ) : public CActive
+		{
+	public:
+		explicit CPlayer(TInt aPriority, RMdaDevSound::CBody& aParent, TInt aIndex);
+		~CPlayer();
+		void RunL();
+		TInt RunError(TInt aError);
+		void DoCancel();
+		void PlayData(TUint aChunkOffset, TInt aLength);
+
+		TUint GetPlayerIndex() const;
+
+	private:		
+		RMdaDevSound::CBody& iParent;
+		const TUint iIndex; // index of this object in parent
+		
+		TInt iBufferOffset;
+		TInt iBufferLength;
+		};
+
+	
+	NONSHARABLE_CLASS( CRecorder ) : public CActive
+		{
+	public:
+		explicit CRecorder(TInt aPriority, RMdaDevSound::CBody& aParent);
+		~CRecorder();
+		void RunL();
+		TInt RunError(TInt aError);
+		void DoCancel();
+		void RecordData(TInt& aLength);
+
+	private:		
+		RMdaDevSound::CBody& iParent;
+
+		TInt iBufferOffset;
+		TInt iBufferLength;
+		};
+	
+	enum TStateEnum
+		{
+		ENotReady,
+		EStopped,
+		ERecording,
+		ERecordingPausedInHw,
+		ERecordingPausedInSw,
+		EPlaying,
+		EPlayingPausedInHw, // ie. Play request pending on h/w and paused
+		EPlayingPausedInSw, // ie. Driver not playing or paused
+		EPlayingUnderrun
+		};
+
+	NONSHARABLE_CLASS( TState )
+		{
+		public:
+			TState(TStateEnum aState) : iState(aState) {}
+			const TText8 *Name() const;
+			TState &operator=(TStateEnum aNewState);
+			operator TStateEnum() const { return iState; }
+		private:
+			TStateEnum iState;
+		};
+		
+	class TFormatData
+		{
+	public:
+		inline TFormatData():
+			iSampleRate(8000), iRequestedChannels(1) // default
+			{
+			}
+	public:
+		CChannelAndSampleRateConverter* iConverter;
+		TInt iSampleRate;
+		TInt iActualRate;
+		TInt iRequestedChannels;
+		TInt iActualChannels;			
+		};
+		
+public:
+	~CBody();
+	static CBody* NewL();
+	TInt Open(TInt aUnit=KNullUnit);
+	TVersion VersionRequired() const;
+	TInt IsMdaSound();
+	void PlayFormatsSupported(TSoundFormatsSupportedBuf& aFormatsSupported);
+	void GetPlayFormat(TCurrentSoundFormatBuf& aFormat);
+	TInt SetPlayFormat(const TCurrentSoundFormatBuf& aFormat);
+	TInt PlayVolume();
+	void SetPlayVolume(TInt aVolume);
+	void SetVolume(TInt aLogarithmicVolume);
+	void CancelPlayData();
+	void RecordFormatsSupported(TSoundFormatsSupportedBuf& aFormatsSupported);
+	void GetRecordFormat(TCurrentSoundFormatBuf& aFormat);
+	TInt SetRecordFormat(const TCurrentSoundFormatBuf& aFormat);
+	TInt RecordLevel();
+	void SetRecordLevel(TInt aLevel);
+	void CancelRecordData();
+	void FlushRecordBuffer();
+	TInt BytesPlayed();
+	void ResetBytesPlayed();
+	void PausePlayBuffer();
+	void ResumePlaying();
+	void PauseRecordBuffer();
+	void ResumeRecording();
+	TInt GetTimePlayed(TTimeIntervalMicroSeconds& aTimePlayed);
+	void Close();
+	TInt Handle();
+	void PlayData(TRequestStatus& aStatus,const TDesC8& aData);
+	void RecordData(TRequestStatus& aStatus,TDes8& aData);
+	void NotifyRecordError(TRequestStatus& aStatus);
+	void NotifyPlayError(TRequestStatus& aStatus);
+	void CancelNotifyPlayError();
+	void CancelNotifyRecordError();
+	void FlushPlayBuffer();
+	//internal methods added to reduce the code
+	void FormatsSupported(TSoundFormatsSupportedBuf& aFormatsSupported, RSoundSc& aDevice);
+	void GetFormat(TCurrentSoundFormatBuf& aFormat, RSoundSc& aDevice, const TFormatData &aFormatData);
+	TInt SetFormat(const TCurrentSoundFormatBuf& aFormat, RSoundSc& aDevice, TFormatData &aFormatData);
+	
+	//for players
+	void SoundDeviceError(TInt aError);
+	RSoundSc& PlaySoundDevice();
+	RSoundSc& RecordSoundDevice();
+	const TState &State() const;
+	void BufferFilled(TInt aError);
+
+	// Called whenever a player becomes inactive.
+	// This includes driver request ok, driver request failed, CPlayer:::RunError invoked.
+	void PlayRequestHasCompleted(CPlayer *aPlayer, TInt aStatus, TBool aDueToCancelCommand);
+
+private:
+	CBody();
+	void ConstructL();
+	
+	TInt NegotiateFormat(const TCurrentSoundFormatBuf& aFormat, RSoundSc& aDevice, TFormatData &aFormatData);
+
+	void StartPlayersAndUpdateState();
+	void StartRecordRequest();
+
+	const char *StateName() const;
+
+	TBool InRecordMode() const;
+	TBool InPlayMode() const;
+
+	TUint32 CurrentTimeInMsec() const;
+	TUint64 BytesPlayed64();
+
+private:
+	RSoundSc iPlaySoundDevice;
+	RChunk iPlayChunk;//handle to the shared chunk
+	RSoundSc iRecordSoundDevice;
+	RChunk iRecordChunk;//handle to the shared chunk
+	TState iState;
+
+	//Playing Properties
+	TPlaySharedChunkBufConfig iPlayBufferConfig;
+	TInt iDeviceBufferLength;
+	
+	//Stores the status of CDataPathPlayer
+	TRequestStatus* iClientPlayStatus;
+	TPtrC8 iClientPlayData;
+	//Stores the status of CSoundDevPlayErrorReceiver
+	TRequestStatus* iClientPlayErrorStatus;
+	RBuf8 iConvertedPlayData;
+	RBuf8 iSavedTrailingData;
+
+	CPlayer* iPlayers[KPlaySharedChunkBuffers];
+	RFifo<CPlayer *, KPlaySharedChunkBuffers> iFreePlayers;
+	RFifo<TUint32, KPlaySharedChunkBuffers> iActivePlayRequestSizes;
+	
+	TInt iRequestMinSize;
+	TUint iRequestMinMask;
+	
+	//Recording Properties
+	TRecordSharedChunkBufConfig iRecordBufferConfig;
+	TInt iBufferOffset;
+	TInt iBufferLength;
+
+	//Stores the status of CDataPathRecorder
+	TRequestStatus* iClientRecordStatus;
+	//Stores the status of CSoundDevRecordErrorReceiver
+	TRequestStatus* iClientRecordErrorStatus;
+	TDes8* iClientRecordData;//stores the data pointer from datapath recorder
+	RBuf8 iBufferedRecordData; // Used if RSoundSc returns more data than current client request requires.
+
+	CRecorder* iRecorder; // We only need one recorder. The driver will buffer data for us.
+
+	TBool iUnderFlowReportedSinceLastPlayOrRecordRequest;
+	
+	TUint64 iBytesPlayed;
+	TUint32 iNTickPeriodInUsec;
+	TUint32 iStartTime; // Time when previous driver PlayData completed (or first was issued) in msec
+	TUint32 iPauseTime; // Time when pause started in msec
+	TUint64 iPausedBytesPlayed;
+
+	TFormatData iPlayFormatData;
+	TFormatData iRecordFormatData;
+	};
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmrenderer/src/omxilpcmrenderer.cpp	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,238 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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
+ @internalComponent
+*/
+#include <openmax/il/common/omxilspecversion.h>
+#include <openmax/il/common/omxilclientclockport.h>
+#include <openmax/il/loader/omxilsymbiancomponentif.h>
+#include "log.h"
+#include "omxilpcmrenderer.h"
+#include "omxilpcmrendererapb0port.h"
+#include "omxilpcmrendererprocessingfunction.h"
+#include "omxilpcmrendererconfigmanager.h"
+#include "omxilpcmrenderer.hrh"
+
+
+const TUint8 COmxILPcmRenderer::iComponentVersionMajor;
+const TUint8 COmxILPcmRenderer::iComponentVersionMinor;
+const TUint8 COmxILPcmRenderer::iComponentVersionRevision;
+const TUint8 COmxILPcmRenderer::iComponentVersionStep;
+
+
+OMXIL_COMPONENT_ECOM_ENTRYPOINT(KUidSymbianOmxILPcmRenderer);
+
+// Component Entry Point
+OMX_ERRORTYPE OMX_ComponentInit(OMX_HANDLETYPE aComponent)
+	{
+	// This method should be called as a result of a OMX_GetHandle call. Let's
+	// return something that is consistent with the return codes allowed for
+	// that API call.	
+	return COmxILComponent::SymbianErrorToGetHandleError(COmxILPcmRenderer::CreateComponent(aComponent));
+	}
+
+
+TInt COmxILPcmRenderer::CreateComponent(OMX_HANDLETYPE aComponent)
+	{
+    DEBUG_PRINTF(_L8("COmxILPcmRenderer::CreateComponent"));
+
+	COmxILPcmRenderer* self = new COmxILPcmRenderer();
+
+	if (!self)
+		{
+		return KErrNoMemory;
+		}
+
+	TRAPD(err, self->ConstructL(aComponent));
+	if (err != KErrNone)
+		{
+		delete self;
+		}
+	return err;
+
+	}
+
+void COmxILPcmRenderer::ConstructL(OMX_HANDLETYPE aComponent)
+	{
+    DEBUG_PRINTF(_L8("COmxILPcmRenderer::ConstructL"));
+
+	// STEP 1: Initialize the data received from the IL Core
+	COmxILComponent::ConstructL(aComponent);
+
+	// STEP 2: Create the call backs manager...
+	MOmxILCallbackNotificationIf* callbackNotificationIf(0);
+#ifdef _OMXIL_PCMRENDERER_INCONTEXT_CALLBACKMANAGER_ON
+	callbackNotificationIf=CreateCallbackManagerL(COmxILComponent::EInContext);
+#else
+	callbackNotificationIf=CreateCallbackManagerL(COmxILComponent::EOutofContext);
+#endif
+
+	// STEP 3: Create the PCM renderer-specific Processing Function...
+
+	// ...create PCM renderer component Client Clock port
+	COmxILClientClockPort* clientClockPort = ConstructClientClockPortL();
+	CleanupStack::PushL(clientClockPort);
+	
+	COmxILProcessingFunction* pProcessingFunction = COmxILPcmRendererProcessingFunction::NewL(*callbackNotificationIf, *clientClockPort);
+	RegisterProcessingFunction(pProcessingFunction);
+	
+	// STEP 4: Create Port manager...
+	CreatePortManagerL(COmxILComponent::ENonBufferSharingPortManager,
+					iOmxILVersion,               // Component's OMX Version
+					1,					         // The number of audio ports in this component
+					KPCMRENDERER_APB0PORT_INDEX, // The starting audio port index
+					0,					         // The number of image ports in this component
+					0,					         // The starting image port index
+					0,					         // The number of video ports in this component
+					0,					         // The starting video port index
+					1,					         // The number of other ports in this component
+					KPCMRENDERER_OPB0PORT_INDEX	 // The starting other port index
+					);
+							
+	// ...create PCM renderer component ports (no OPB0 port)
+	COmxILPcmRendererAPB0Port* pb0Port = ConstructAPB0PortL();
+	CleanupStack::PushL(pb0Port);
+	
+	// ..  and add them to the port manager...
+	User::LeaveIfError(AddPort(pb0Port, OMX_DirInput));
+	CleanupStack::Pop(); //pb0Port
+
+    User::LeaveIfError(AddPort(clientClockPort, OMX_DirInput));
+    CleanupStack::Pop(); //clientClockPort
+
+	
+	// STEP 5: Create the non-port related configuration manager...
+	RPointerArray<TDesC8> componentRoles;
+	CleanupClosePushL(componentRoles);
+	User::LeaveIfError(componentRoles.Append(&KSymbianOmxILPcmRendererRole()));
+
+	COmxILConfigManager* pConfigManager = COmxILPcmRendererConfigManager::NewL(
+		*static_cast<COmxILPcmRendererProcessingFunction*>(pProcessingFunction),
+		KSymbianOmxILPcmRendererName,
+		TOmxILVersion(iComponentVersionMajor,
+					  iComponentVersionMinor,
+					  iComponentVersionRevision,
+					  iComponentVersionStep),
+		componentRoles);
+		
+	RegisterConfigurationManager(pConfigManager);
+	
+	CleanupStack::Pop();	// componentRoles
+	componentRoles.Close(); // Must not destroy pointers
+
+	// And finally, let's get everything started
+	InitComponentL();
+	}
+
+COmxILPcmRenderer::COmxILPcmRenderer()
+	:
+	iOmxILVersion(TOmxILSpecVersion())
+	{
+    DEBUG_PRINTF(_L8("COmxILPcmRenderer::COmxILPcmRenderer"));
+	}
+
+COmxILPcmRenderer::~COmxILPcmRenderer()
+	{
+    DEBUG_PRINTF(_L8("COmxILPcmRenderer::~COmxILPcmRenderer"));
+	}
+
+
+COmxILPcmRendererAPB0Port* COmxILPcmRenderer::ConstructAPB0PortL() const
+	{
+    DEBUG_PRINTF(_L8("COmxILPcmRenderer::ConstructAPB0PortL"));
+
+	RArray<OMX_AUDIO_CODINGTYPE> supportedAudioFormats;
+	CleanupClosePushL(supportedAudioFormats);
+	supportedAudioFormats.AppendL(OMX_AUDIO_CodingPCM);
+
+	OMX_AUDIO_PARAM_PCMMODETYPE	paramPcmModeType;
+	paramPcmModeType.nSize				= sizeof(OMX_AUDIO_PARAM_PCMMODETYPE);
+	paramPcmModeType.nVersion			= iOmxILVersion;
+	paramPcmModeType.nPortIndex			= KPCMRENDERER_APB0PORT_INDEX;
+	paramPcmModeType.nChannels			= KDefaultNumberChannels;
+	paramPcmModeType.eNumData			= OMX_NumericalDataSigned;
+	paramPcmModeType.eEndian			= OMX_EndianBig;
+	paramPcmModeType.bInterleaved		= OMX_TRUE;
+	paramPcmModeType.nBitPerSample		= KDefaultBitPerSample;
+	paramPcmModeType.nSamplingRate		= KDefaultSampleRate;
+	paramPcmModeType.ePCMMode			= OMX_AUDIO_PCMModeLinear;
+	paramPcmModeType.eChannelMapping[0] = OMX_AUDIO_ChannelLF;
+	paramPcmModeType.eChannelMapping[1] = OMX_AUDIO_ChannelRF;
+
+	OMX_AUDIO_CONFIG_VOLUMETYPE	configAudioVolume;
+	configAudioVolume.nSize			 = sizeof(OMX_AUDIO_CONFIG_VOLUMETYPE);
+	configAudioVolume.nVersion		 = iOmxILVersion;
+	configAudioVolume.nPortIndex	 = KPCMRENDERER_APB0PORT_INDEX;
+	configAudioVolume.bLinear		 = OMX_FALSE;
+	configAudioVolume.sVolume.nValue = 50;
+	configAudioVolume.sVolume.nMin	 = 0;
+	configAudioVolume.sVolume.nMax	 = 100;
+
+	OMX_AUDIO_CONFIG_MUTETYPE	configAudioMute;
+    configAudioMute.nSize	   = sizeof(OMX_AUDIO_CONFIG_MUTETYPE);
+	configAudioMute.nVersion   = iOmxILVersion;
+	configAudioMute.nPortIndex = KPCMRENDERER_APB0PORT_INDEX;
+	configAudioMute.bMute	   = OMX_FALSE;
+	TOmxILCommonPortData portData(iOmxILVersion,				// OMX specification version information
+                                    KPCMRENDERER_APB0PORT_INDEX,// Port number the structure applies to
+                                    OMX_DirInput,				// Direction of this port
+                                    1,							// The minimum number of buffers this port requires
+                                    15360,						// Minimum size, in bytes, for buffers to be used for this port
+                                    OMX_PortDomainAudio,		// Domain of the port
+                                    OMX_FALSE,					// Buffers contiguous requirement (true or false)
+                                    0,							// Buffer aligment requirements
+                                    OMX_BufferSupplyInput,     	// supplier preference when tunneling between two ports
+                                    // This component is a sink component so there's no need to
+                                    // propagate buffer marks received on input ports
+                                    COmxILPort:: KBufferMarkPropagationPortNotNeeded);
+	
+	COmxILPcmRendererAPB0Port* apb0Port = COmxILPcmRendererAPB0Port::NewL(portData,
+                                                                        supportedAudioFormats,
+                                                                        paramPcmModeType,
+                                                                        configAudioVolume,
+                                                                        configAudioMute);
+	
+	CleanupStack::PopAndDestroy(&supportedAudioFormats);
+	return apb0Port;
+	}
+
+COmxILClientClockPort* COmxILPcmRenderer::ConstructClientClockPortL() const
+	{
+    DEBUG_PRINTF(_L8("COmxILPcmRenderer::ConstructClientClockPortL"));
+    
+    TOmxILCommonPortData portData(iOmxILVersion, 
+                                    KPCMRENDERER_OPB0PORT_INDEX,	// port index
+                                    OMX_DirInput,
+                                    4,								// minimum number of buffers
+                                    sizeof(OMX_TIME_MEDIATIMETYPE),	// minimum buffer size, in bytes
+                                    OMX_PortDomainOther,
+                                    OMX_FALSE,						// do not need contigious buffers
+                                    0,								// byte alignment
+                                    OMX_BufferSupplyUnspecified, 
+                                    COmxILPort::KBufferMarkPropagationPortNotNeeded);
+	
+	RArray<OMX_OTHER_FORMATTYPE> supportedOtherFormats;
+	CleanupClosePushL(supportedOtherFormats);
+	supportedOtherFormats.AppendL(OMX_OTHER_FormatTime);
+	COmxILClientClockPort* aClientClockPort = COmxILClientClockPort::NewL(portData, supportedOtherFormats);
+	CleanupStack::PopAndDestroy(&supportedOtherFormats);
+
+	return aClientClockPort;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmrenderer/src/omxilpcmrenderer.h	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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
+ @internalComponent
+*/
+
+#ifndef OMXILPCMRENDERER_H
+#define OMXILPCMRENDERER_H
+
+#include <openmax/il/common/omxilcomponent.h>
+
+// Forward declarations
+class COmxILPcmRendererAPB0Port;
+class COmxILClientClockPort;
+
+NONSHARABLE_CLASS(COmxILPcmRenderer) : public COmxILComponent
+	{
+
+public:
+
+	static const TUint8 iComponentVersionMajor	  = 1;
+	static const TUint8 iComponentVersionMinor	  = 0;
+	static const TUint8 iComponentVersionRevision = 0;
+	static const TUint8 iComponentVersionStep	  = 0;
+
+public:
+
+	static  TInt CreateComponent(OMX_HANDLETYPE aComponent);
+
+	~COmxILPcmRenderer();
+
+private:
+
+	COmxILPcmRenderer();
+
+	void ConstructL(OMX_HANDLETYPE aComponent);
+
+	COmxILPcmRendererAPB0Port* ConstructAPB0PortL() const;
+	COmxILClientClockPort* ConstructClientClockPortL() const;
+
+private:
+
+	const OMX_VERSIONTYPE iOmxILVersion;
+	};
+
+#endif // OMXILPCMRENDERER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmrenderer/src/omxilpcmrenderer.hrh	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 OMXILPCMRENDERER_HRH
+#define OMXILPCMRENDERER_HRH
+
+// Note that these are also hardcoded into the aacdecoder test code,
+// in particular omxilaacdecoder.hrh
+#define KUidSymbianOmxILPcmRendererDll        0x1028349B
+#define KUidSymbianOmxILPcmRenderer           0x1028349F
+
+#endif // OMXILPCMRENDERER_HRH
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmrenderer/src/omxilpcmrenderer.rss	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <ecom/registryinfo.rh>
+#include <openmax/il/loader/omxilcomponentif.hrh>
+#include "omxilpcmrenderer.hrh"
+
+RESOURCE REGISTRY_INFO theInfo
+	{
+	dll_uid = KUidSymbianOmxILPcmRendererDll;
+	interfaces =
+		{
+		INTERFACE_INFO
+			{
+			interface_uid = KUidOmxILSymbianComponentIf;
+			implementations =
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid = KUidSymbianOmxILPcmRenderer;
+					version_no = 1;
+					display_name = "OMX.NOKIA.AUDIO.RENDERER.PCM";
+					default_data = "audio_renderer.pcm";
+					opaque_data  = "";
+					}
+				};
+			}
+		};
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmrenderer/src/omxilpcmrendererapb0port.cpp	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,580 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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
+ @internalComponent
+*/
+
+#include <openmax/il/khronos/v1_x/OMX_Component.h>
+#include <openmax/il/common/omxilutil.h>
+#include "log.h"
+#include "omxilpcmrendererapb0port.h"
+#include "omxilpcmrendererconst.h"
+
+
+COmxILPcmRendererAPB0Port*
+COmxILPcmRendererAPB0Port::NewL(
+	const TOmxILCommonPortData& aCommonPortData,
+	const RArray<OMX_AUDIO_CODINGTYPE>& aSupportedAudioFormats,
+	const OMX_AUDIO_PARAM_PCMMODETYPE& aParamAudioPcm,
+	const OMX_AUDIO_CONFIG_VOLUMETYPE& aConfigAudioVolume,
+	const OMX_AUDIO_CONFIG_MUTETYPE& aConfigAudioMute)
+	{
+    DEBUG_PRINTF(_L8("COmxILPcmRendererAPB0Port::NewL"));
+
+	COmxILPcmRendererAPB0Port* self = new (ELeave)COmxILPcmRendererAPB0Port(
+		aParamAudioPcm,
+		aConfigAudioVolume,
+		aConfigAudioMute);
+	
+	CleanupStack::PushL(self);
+	self->ConstructL(aCommonPortData, aSupportedAudioFormats);
+	CleanupStack::Pop(self);
+	return self;
+
+	}
+
+
+void
+COmxILPcmRendererAPB0Port::ConstructL(const TOmxILCommonPortData& aCommonPortData, const RArray<OMX_AUDIO_CODINGTYPE>& aSupportedAudioFormats)
+	{
+    DEBUG_PRINTF(_L8("COmxILPcmRendererAPB0Port::ConstructL"));
+	COmxILAudioPort::ConstructL(aCommonPortData, aSupportedAudioFormats);
+	OMX_PARAM_PORTDEFINITIONTYPE& paramPortDefinition=GetParamPortDefinition();
+	// We have to finish with iParamPortDefinition
+	paramPortDefinition.eDomain = OMX_PortDomainAudio;
+	paramPortDefinition.format.audio.pNativeRender = 0;
+
+	iMimeTypeBuf.CreateL(KMimeTypeAudioPcm(), KMimeTypeAudioPcm().Length() + 1);
+
+	TUint8* pTUint2 = const_cast<TUint8*>(iMimeTypeBuf.PtrZ());
+	paramPortDefinition.format.audio.cMIMEType = reinterpret_cast<OMX_STRING>(pTUint2);
+
+	paramPortDefinition.format.audio.bFlagErrorConcealment = OMX_FALSE;
+	paramPortDefinition.format.audio.eEncoding = OMX_AUDIO_CodingPCM;
+	
+	// Init iParamVolumeRamp here...
+	iConfigVolumeRamp.nSize			  = sizeof(OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP);
+	iConfigVolumeRamp.nVersion		  = TOmxILSpecVersion();
+	iConfigVolumeRamp.nPortIndex		  = paramPortDefinition.nPortIndex;
+	iConfigVolumeRamp.nRampDuration	  = 0;
+	}
+
+
+COmxILPcmRendererAPB0Port::COmxILPcmRendererAPB0Port(
+	const OMX_AUDIO_PARAM_PCMMODETYPE& aParamAudioPcm,
+	const OMX_AUDIO_CONFIG_VOLUMETYPE& aConfigAudioVolume,
+	const OMX_AUDIO_CONFIG_MUTETYPE& aConfigAudioMute)
+	:
+	iParamAudioPcm(aParamAudioPcm),
+	iConfigAudioVolume(aConfigAudioVolume),
+	iConfigAudioMute(aConfigAudioMute)
+	{
+    DEBUG_PRINTF(_L8("COmxILPcmRendererAPB0Port::COmxILPcmRendererAPB0Port"));
+	}
+
+
+COmxILPcmRendererAPB0Port::~COmxILPcmRendererAPB0Port()
+	{
+    DEBUG_PRINTF(_L8("COmxILPcmRendererAPB0Port::~COmxILPcmRendererAPB0Port"));
+
+	CleanUpPort();
+	iMimeTypeBuf.Close();
+
+	}
+
+
+OMX_ERRORTYPE
+COmxILPcmRendererAPB0Port::SetFormatInPortDefinition(
+	const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition,
+	TBool& aUpdateProcessingFunction)
+	{
+    DEBUG_PRINTF(_L8("COmxILPcmRendererAPB0Port::SetFormatInPortDefinition"));
+	// There's no point on chaging the cMIMEType type of this port
+	// Same thing for pNativeRender and eEncoding
+	GetParamPortDefinition().format.audio.bFlagErrorConcealment =
+		aPortDefinition.format.audio.bFlagErrorConcealment;
+	// Error concealment not currently needed at the processing function
+	aUpdateProcessingFunction = EFalse;
+
+	return OMX_ErrorNone;
+
+	}
+
+
+TBool
+COmxILPcmRendererAPB0Port::IsTunnelledPortCompatible(
+	const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const
+	{
+	DEBUG_PRINTF(_L8("COmxILPcmRendererAPB0Port::IsTunnelledPortCompatible"));
+
+	// First, the easy checks...
+	if(aPortDefinition.eDomain != GetParamPortDefinition().eDomain)
+		{
+		return EFalse;
+		}
+
+	if(aPortDefinition.format.audio.eEncoding != OMX_AUDIO_CodingPCM)
+		{
+		return EFalse;
+		}
+	
+    TBool retValue = ETrue;
+    
+#ifdef _OMXIL_PCMRENDERER_CHECK_MIME_TYPE_ON
+	RBuf8 tunnelMimeTypeBuf;
+	tunnelMimeTypeBuf.Create(KMimeTypeAudioPcm().Length() + 1);
+	tunnelMimeTypeBuf =
+		const_cast<const TUint8*>(
+			reinterpret_cast<TUint8*>(aPortDefinition.format.audio.cMIMEType));
+
+
+	if (iMimeTypeBuf != tunnelMimeTypeBuf)
+		{
+		retValue = EFalse;
+		}
+
+	tunnelMimeTypeBuf.Close();
+#endif
+
+	return retValue;
+	}
+
+
+OMX_ERRORTYPE
+COmxILPcmRendererAPB0Port::GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const
+	{
+    DEBUG_PRINTF(_L8("COmxILPcmRendererAPB0Port::GetLocalOmxParamIndexes"));
+
+	// Always collect local indexes from parent
+	OMX_ERRORTYPE omxRetValue =
+		COmxILAudioPort::GetLocalOmxParamIndexes(aIndexArray);
+
+	if (OMX_ErrorNone != omxRetValue)
+		{
+		return omxRetValue;
+		}
+
+	TInt err = aIndexArray.InsertInOrder(OMX_IndexParamAudioPcm);
+
+	// Note that index duplication is OK.
+	if (KErrNone != err && KErrAlreadyExists != err)
+		{
+		return OMX_ErrorInsufficientResources;
+		}
+
+	return OMX_ErrorNone;
+
+	}
+
+OMX_ERRORTYPE
+COmxILPcmRendererAPB0Port::GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const
+	{
+    DEBUG_PRINTF(_L8("COmxILPcmRendererAPB0Port::GetLocalOmxConfigIndexes"));
+
+	// Always collect local indexes from parent
+	OMX_ERRORTYPE omxRetValue =
+		COmxILAudioPort::GetLocalOmxConfigIndexes(aIndexArray);
+
+	if (OMX_ErrorNone != omxRetValue)
+		{
+		return omxRetValue;
+		}
+
+	TInt err = aIndexArray.InsertInOrder(OMX_IndexConfigAudioVolume);
+
+	// Note that index duplication is OK.
+	if (KErrNone == err || KErrAlreadyExists == err)
+		{
+		err = aIndexArray.InsertInOrder(OMX_IndexConfigAudioMute);
+
+		if (KErrNone == err || KErrAlreadyExists == err)
+			{
+			err = aIndexArray.InsertInOrder(
+				OMX_SymbianIndexConfigAudioPcmVolumeRamp);
+			}
+
+		}
+
+	if (KErrNone != err && KErrAlreadyExists != err)
+		{
+		return OMX_ErrorInsufficientResources;
+		}
+
+	return OMX_ErrorNone;
+
+	}
+
+
+OMX_ERRORTYPE
+COmxILPcmRendererAPB0Port::GetParameter(OMX_INDEXTYPE aParamIndex,
+										TAny* apComponentParameterStructure) const
+	{
+    DEBUG_PRINTF(_L8("COmxILPcmRendererAPB0Port::GetParameter"));
+
+	OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+	switch(aParamIndex)
+		{
+	case OMX_IndexParamAudioPcm:
+		{
+		if (OMX_ErrorNone !=
+			(omxRetValue =
+			 TOmxILUtil::CheckOmxStructSizeAndVersion(
+				 apComponentParameterStructure,
+				 sizeof(OMX_AUDIO_PARAM_PCMMODETYPE))))
+			{
+			return omxRetValue;
+			}
+
+		OMX_AUDIO_PARAM_PCMMODETYPE* pPcmMode
+			= static_cast<OMX_AUDIO_PARAM_PCMMODETYPE*>(
+				apComponentParameterStructure);
+
+		*pPcmMode = iParamAudioPcm;
+		}
+		break;
+
+	default:
+		{
+		// Try the parent's indexes
+		return COmxILAudioPort::GetParameter(aParamIndex,
+											 apComponentParameterStructure);
+		}
+		};
+
+	return OMX_ErrorNone;
+
+	}
+
+
+OMX_ERRORTYPE
+COmxILPcmRendererAPB0Port::SetParameter(OMX_INDEXTYPE aParamIndex,
+										const TAny* apComponentParameterStructure,
+										TBool& aUpdateProcessingFunction)
+	{
+    DEBUG_PRINTF(_L8("COmxILPcmRendererAPB0Port::SetParameter"));
+
+	aUpdateProcessingFunction = EFalse;
+
+	OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+	switch(aParamIndex)
+		{
+	case OMX_IndexParamAudioPcm:
+		{
+		if (OMX_ErrorNone !=
+			(omxRetValue =
+			 TOmxILUtil::CheckOmxStructSizeAndVersion(
+				 const_cast<OMX_PTR>(apComponentParameterStructure),
+				 sizeof(OMX_AUDIO_PARAM_PCMMODETYPE))))
+			{
+			return omxRetValue;
+			}
+
+		const OMX_AUDIO_PARAM_PCMMODETYPE* pPcmMode
+			= static_cast<const OMX_AUDIO_PARAM_PCMMODETYPE*>(
+				apComponentParameterStructure);
+
+		switch (pPcmMode->nSamplingRate)
+			{
+			case 8000 :
+			case 11025 :
+			case 12000 :
+			case 16000 :
+			case 22050 :
+			case 24000 :
+			case 32000 :
+			case 44100 :
+			case 48000 :
+				break;
+			default:
+				return OMX_ErrorBadParameter;
+			}
+
+		switch (pPcmMode->nBitPerSample)
+			{
+			case 8 :
+			case 16 :
+				break;
+			default:
+				return OMX_ErrorBadParameter;
+			}
+
+		// Set the new default values
+		if (iParamAudioPcm.nChannels	 != pPcmMode->nChannels			||
+			iParamAudioPcm.eNumData		 != pPcmMode->eNumData			||
+			iParamAudioPcm.eEndian		 != pPcmMode->eEndian			||
+			iParamAudioPcm.bInterleaved	 != pPcmMode->bInterleaved		||
+			iParamAudioPcm.nBitPerSample != pPcmMode->nBitPerSample		||
+			iParamAudioPcm.nSamplingRate != pPcmMode->nSamplingRate		||
+			iParamAudioPcm.ePCMMode		 != pPcmMode->ePCMMode)
+			{
+			iParamAudioPcm.nChannels	 = pPcmMode->nChannels;
+			iParamAudioPcm.eNumData		 = pPcmMode->eNumData;
+			iParamAudioPcm.eEndian		 = pPcmMode->eEndian;
+			iParamAudioPcm.bInterleaved	 = pPcmMode->bInterleaved;
+			iParamAudioPcm.nBitPerSample = pPcmMode->nBitPerSample;
+		    iParamAudioPcm.nSamplingRate = pPcmMode->nSamplingRate;
+			iParamAudioPcm.ePCMMode		 = pPcmMode->ePCMMode;
+			// This is an indication to the PortManager that the processing
+			// function needs to get updated
+			aUpdateProcessingFunction = ETrue;
+			}
+
+		for (TInt i=0; i<OMX_AUDIO_MAXCHANNELS; i++)
+			{
+			if (iParamAudioPcm.eChannelMapping[i] != pPcmMode->eChannelMapping[i])
+				{
+				iParamAudioPcm.eChannelMapping[i] = pPcmMode->eChannelMapping[i];
+				// This is an indication to the PortManager that the processing
+				// function needs to get updated
+				aUpdateProcessingFunction = ETrue;
+				}
+			}
+
+		}
+		break;
+	default:
+		{
+		// Try the parent's indexes
+		return COmxILAudioPort::SetParameter(aParamIndex,
+											 apComponentParameterStructure,
+											 aUpdateProcessingFunction);
+		}
+		};
+
+	return OMX_ErrorNone;
+
+	}
+
+
+OMX_ERRORTYPE
+COmxILPcmRendererAPB0Port::GetConfig(OMX_INDEXTYPE aConfigIndex,
+									 TAny* apComponentConfigStructure) const
+	{
+    DEBUG_PRINTF(_L8("COmxILPcmRendererAPB0Port::GetConfig"));
+
+	OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+	switch(aConfigIndex)
+		{
+	case OMX_SymbianIndexConfigAudioPcmVolumeRamp:
+		{
+		if (OMX_ErrorNone !=
+			(omxRetValue =
+			 TOmxILUtil::CheckOmxStructSizeAndVersion(
+				 apComponentConfigStructure,
+				 sizeof(OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP))))
+			{
+			return omxRetValue;
+			}
+
+		OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP*
+			pPcmVolumeRamp
+			= static_cast<
+			OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP*>(
+				apComponentConfigStructure);
+
+		*pPcmVolumeRamp = iConfigVolumeRamp;
+		}
+		break;
+				
+	case OMX_IndexConfigAudioVolume:
+		{
+		if (OMX_ErrorNone !=
+			(omxRetValue =
+			 TOmxILUtil::CheckOmxStructSizeAndVersion(
+				 apComponentConfigStructure,
+				 sizeof(OMX_AUDIO_CONFIG_VOLUMETYPE))))
+			{
+			return omxRetValue;
+			}
+
+		OMX_AUDIO_CONFIG_VOLUMETYPE* pConfigVolume
+			= static_cast<OMX_AUDIO_CONFIG_VOLUMETYPE*>(
+				apComponentConfigStructure);
+
+		*pConfigVolume = iConfigAudioVolume;
+		}
+		break;
+
+	case OMX_IndexConfigAudioMute:
+		{
+		if (OMX_ErrorNone !=
+			(omxRetValue =
+			 TOmxILUtil::CheckOmxStructSizeAndVersion(
+				 apComponentConfigStructure,
+				 sizeof(OMX_AUDIO_CONFIG_MUTETYPE))))
+			{
+			return omxRetValue;
+			}
+
+		OMX_AUDIO_CONFIG_MUTETYPE* pConfigMute
+			= static_cast<OMX_AUDIO_CONFIG_MUTETYPE*>(
+				apComponentConfigStructure);
+
+		*pConfigMute = iConfigAudioMute;
+		}
+		break;
+
+	default:
+		{
+		// There's no need to try the parent indexes as we know there isn't any
+		// other config in the parent audio classes
+		return OMX_ErrorUnsupportedIndex;
+		}
+		};
+
+	return OMX_ErrorNone;
+
+	}
+
+OMX_ERRORTYPE
+COmxILPcmRendererAPB0Port::SetConfig(OMX_INDEXTYPE aConfigIndex,
+									 const TAny* apComponentConfigStructure,
+									 TBool& aUpdateProcessingFunction)
+	{
+    DEBUG_PRINTF(_L8("COmxILPcmRendererAPB0Port::SetConfig"));
+
+	aUpdateProcessingFunction = EFalse;
+
+	OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+	switch(aConfigIndex)
+		{
+	case OMX_SymbianIndexConfigAudioPcmVolumeRamp:
+		{
+		if (OMX_ErrorNone !=
+			(omxRetValue =
+			 TOmxILUtil::CheckOmxStructSizeAndVersion(
+				 const_cast<OMX_PTR>(apComponentConfigStructure),
+				 sizeof(OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP))))
+			{
+			return omxRetValue;
+			}
+
+		const OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP*
+			pPcmVolumeRamp
+			= static_cast<
+			const OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP*>(
+				apComponentConfigStructure);
+
+		if (iConfigVolumeRamp.nRampDuration != pPcmVolumeRamp->nRampDuration)
+			{
+			// This is an indication to the PortManager that the processing
+			// function needs to get updated
+			aUpdateProcessingFunction = ETrue;
+
+			iConfigVolumeRamp.nRampDuration = pPcmVolumeRamp->nRampDuration;
+			}
+
+		}
+		break;
+		
+	case OMX_IndexConfigAudioVolume:
+		{
+		if (OMX_ErrorNone !=
+			(omxRetValue =
+			 TOmxILUtil::CheckOmxStructSizeAndVersion(
+				 const_cast<OMX_PTR>(apComponentConfigStructure),
+				 sizeof(OMX_AUDIO_CONFIG_VOLUMETYPE))))
+			{
+			return omxRetValue;
+			}
+
+		const OMX_AUDIO_CONFIG_VOLUMETYPE* pConfigVolume
+			= static_cast<const OMX_AUDIO_CONFIG_VOLUMETYPE*>(
+				apComponentConfigStructure);
+
+		// Set the new default values
+		if (iConfigAudioVolume.bLinear		  != pConfigVolume->bLinear			||
+			iConfigAudioVolume.sVolume.nValue != pConfigVolume->sVolume.nValue	||
+			iConfigAudioVolume.sVolume.nMin	  != pConfigVolume->sVolume.nMin	||
+			iConfigAudioVolume.sVolume.nMax	  != pConfigVolume->sVolume.nMax)
+			{
+			iConfigAudioVolume.bLinear		  = pConfigVolume->bLinear;
+			iConfigAudioVolume.sVolume.nValue = pConfigVolume->sVolume.nValue;
+			iConfigAudioVolume.sVolume.nMin	  = pConfigVolume->sVolume.nMin;
+			iConfigAudioVolume.sVolume.nMax	  = pConfigVolume->sVolume.nMax;
+			// This is an indication to the PortManager that the processing
+			// function needs to get updated
+			aUpdateProcessingFunction = ETrue;
+			}
+
+		}
+		break;
+	case OMX_IndexConfigAudioMute:
+		{
+		if (OMX_ErrorNone !=
+			(omxRetValue =
+			 TOmxILUtil::CheckOmxStructSizeAndVersion(
+				 const_cast<OMX_PTR>(apComponentConfigStructure),
+				 sizeof(OMX_AUDIO_CONFIG_MUTETYPE))))
+			{
+			return omxRetValue;
+			}
+
+		const OMX_AUDIO_CONFIG_MUTETYPE* pConfigMute
+			= static_cast<const OMX_AUDIO_CONFIG_MUTETYPE*>(
+				apComponentConfigStructure);
+
+		if (iConfigAudioMute.bMute != pConfigMute->bMute)
+			{
+			iConfigAudioMute.bMute = pConfigMute->bMute;
+			// This is an indication to the PortManager that the processing
+			// function needs to get updated
+			aUpdateProcessingFunction = ETrue;
+			}
+
+		}
+		break;
+	default:
+		{
+		// There's no need to try the parent indexes as we know there isn't any
+		// other config in the parent audio classes
+		return OMX_ErrorUnsupportedIndex;
+		}
+		};
+
+	return OMX_ErrorNone;
+	}
+
+OMX_ERRORTYPE
+COmxILPcmRendererAPB0Port::GetExtensionIndex(
+	OMX_STRING aParameterName,
+	OMX_INDEXTYPE* apIndexType) const
+	{
+    DEBUG_PRINTF(_L8("COmxILPcmRendererAPB0Port::GetExtensionIndex"));
+
+	TPtrC8 requestedParameterNamePtr(
+		const_cast<const TUint8*>(
+			reinterpret_cast<TUint8*>(aParameterName)));
+
+	TPtrC8 parameterNamePtr(
+		reinterpret_cast<const TUint8*>(sOmxSymbianPcmVolumeRamp));
+
+	if (requestedParameterNamePtr == parameterNamePtr)
+		{
+		*apIndexType =
+			static_cast<OMX_INDEXTYPE>(
+					OMX_SymbianIndexConfigAudioPcmVolumeRamp);
+			
+		return OMX_ErrorNone;
+		}
+
+	*apIndexType = OMX_IndexMax;
+	return OMX_ErrorUnsupportedIndex;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmrenderer/src/omxilpcmrendererapb0port.h	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,92 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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
+ @internalComponent
+*/
+
+#ifndef OMXILPCMRENDERERAPB0PORT_H
+#define OMXILPCMRENDERERAPB0PORT_H
+
+#include <openmax/il/common/omxilaudioport.h>
+#include <openmax/il/extensions/omxilsymbianaudiopcmextensions.h>
+
+class COmxILPcmRendererAPB0Port : public COmxILAudioPort
+	{
+
+public:
+
+	static COmxILPcmRendererAPB0Port* NewL(
+		const TOmxILCommonPortData& aCommonPortData,
+		const RArray<OMX_AUDIO_CODINGTYPE>& aSupportedAudioFormats,
+		const OMX_AUDIO_PARAM_PCMMODETYPE& aParamAudioPcm,
+		const OMX_AUDIO_CONFIG_VOLUMETYPE& aConfigAudioVolume,
+		const OMX_AUDIO_CONFIG_MUTETYPE& aConfigAudioMute);
+
+
+	~COmxILPcmRendererAPB0Port();
+
+	OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const;
+
+	OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const;
+
+	OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex,
+							   TAny* apComponentParameterStructure) const;
+
+	OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex,
+							   const TAny* apComponentParameterStructure,
+							   TBool& aUpdateProcessingFunction);
+
+	OMX_ERRORTYPE GetConfig(OMX_INDEXTYPE aConfigIndex,
+							TAny* apComponentConfigStructure) const;
+
+	OMX_ERRORTYPE SetConfig(OMX_INDEXTYPE aConfigIndex,
+							const TAny* apComponentConfigStructure,
+							TBool& aUpdateProcessingFunction);
+	
+	OMX_ERRORTYPE GetExtensionIndex(OMX_STRING aParameterName,
+									OMX_INDEXTYPE* apIndexType) const;
+
+protected:
+
+	COmxILPcmRendererAPB0Port(
+		const OMX_AUDIO_PARAM_PCMMODETYPE& aParamAudioPcm,
+		const OMX_AUDIO_CONFIG_VOLUMETYPE& aConfigAudioVolume,
+		const OMX_AUDIO_CONFIG_MUTETYPE& aConfigAudioMute);
+
+	void ConstructL(const TOmxILCommonPortData& aCommonPortData, const RArray<OMX_AUDIO_CODINGTYPE>& aSupportedAudioFormats);
+
+	OMX_ERRORTYPE SetFormatInPortDefinition(
+		const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition,
+		TBool& aUpdateProcessingFunction);
+
+	TBool IsTunnelledPortCompatible(
+		const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const;
+
+protected:
+
+	OMX_AUDIO_PARAM_PCMMODETYPE iParamAudioPcm;
+	OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP iConfigVolumeRamp;
+	OMX_AUDIO_CONFIG_VOLUMETYPE iConfigAudioVolume;
+	OMX_AUDIO_CONFIG_MUTETYPE iConfigAudioMute;
+	RBuf8 iMimeTypeBuf;
+
+	};
+
+#endif // OMXILPCMRENDERERAPB0PORT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmrenderer/src/omxilpcmrendererconfigmanager.cpp	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,179 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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
+ @internalComponent
+*/
+
+#include <openmax/il/common/omxilutil.h>
+#include <openmax/il/extensions/omxilsymbianaudiopcmextensions.h>
+#include "log.h"
+#include "omxilpcmrendererconfigmanager.h"
+#include "omxilpcmrendererprocessingfunction.h"
+
+
+
+COmxILPcmRendererConfigManager*
+COmxILPcmRendererConfigManager::NewL(
+	COmxILPcmRendererProcessingFunction& aProcessingFunction,
+	const TDesC8& aComponentName,
+	const OMX_VERSIONTYPE& aComponentVersion,
+	const RPointerArray<TDesC8>& aComponentRoleList)
+	{
+    DEBUG_PRINTF(_L8("COmxILPcmRendererConfigManager::NewL"));
+	ASSERT(aComponentName.Length() && aComponentRoleList.Count());
+
+	COmxILPcmRendererConfigManager* self = new (ELeave)COmxILPcmRendererConfigManager(aProcessingFunction);
+	CleanupStack::PushL(self);
+	self->ConstructL(aComponentName,
+					 aComponentVersion,
+					 aComponentRoleList);
+	CleanupStack::Pop(self);
+	return self;
+
+	}
+
+void
+COmxILPcmRendererConfigManager::ConstructL(const TDesC8& aComponentName,
+								const OMX_VERSIONTYPE& aComponentVersion,
+								const RPointerArray<TDesC8>& aComponentRoleList)
+	{
+    DEBUG_PRINTF(_L8("COmxILPcmRendererConfigManager::ConstructL"));
+
+	COmxILConfigManager::ConstructL(aComponentName, aComponentVersion, aComponentRoleList);
+	
+	ManagedConfigIndexes().InsertInOrderL(OMX_SymbianIndexConfigAudioBytesPlayed);
+	}
+
+COmxILPcmRendererConfigManager::COmxILPcmRendererConfigManager(COmxILPcmRendererProcessingFunction& aProcessingFunction)
+	:iProcessingFunction(aProcessingFunction)
+	{
+    DEBUG_PRINTF(_L8("COmxILPcmRendererConfigManager::COmxILPcmRendererConfigManager"));
+
+	}
+
+COmxILPcmRendererConfigManager::~COmxILPcmRendererConfigManager()
+	{
+    DEBUG_PRINTF(_L8("COmxILPcmRendererConfigManager::~COmxILPcmRendererConfigManager"));
+
+	}
+
+OMX_ERRORTYPE
+COmxILPcmRendererConfigManager::GetConfig(OMX_INDEXTYPE aConfigIndex,
+							   TAny* apComponentConfigStructure) const
+	{
+    DEBUG_PRINTF(_L8("COmxILPcmRendererConfigManager::GetConfig"));
+
+	TInt index = FindConfigIndex(aConfigIndex);
+	if (KErrNotFound == index)
+		{
+		return OMX_ErrorUnsupportedIndex;
+		}
+
+	OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+	switch(aConfigIndex)
+		{
+	case OMX_SymbianIndexConfigAudioBytesPlayed:
+		{
+		if (OMX_ErrorNone !=
+			(omxRetValue =
+			 TOmxILUtil::CheckOmxStructSizeAndVersion(
+				 apComponentConfigStructure,
+				 sizeof(OMX_SYMBIAN_AUDIO_CONFIG_PCM_BYTESPLAYED))))
+			{
+			return omxRetValue;
+			}
+
+		OMX_SYMBIAN_AUDIO_CONFIG_PCM_BYTESPLAYED*
+			pPcmBytesPlayed
+			= static_cast<
+			OMX_SYMBIAN_AUDIO_CONFIG_PCM_BYTESPLAYED*>(
+				apComponentConfigStructure);
+			
+		pPcmBytesPlayed->nBytesPlayed = iProcessingFunction.GetBytesPlayed();
+		}
+		break;
+		
+	default:
+		{
+		omxRetValue = COmxILConfigManager::GetConfig(aConfigIndex, apComponentConfigStructure);
+		}
+		};
+
+	return omxRetValue;
+	}
+
+OMX_ERRORTYPE
+COmxILPcmRendererConfigManager::SetConfig(OMX_INDEXTYPE aConfigIndex,
+							   const TAny* apComponentConfigStructure)
+
+	{
+    DEBUG_PRINTF(_L8("COmxILPcmRendererConfigManager::SetConfig"));
+
+	TInt index = FindConfigIndex(aConfigIndex);
+	if (KErrNotFound == index)
+		{
+		return OMX_ErrorUnsupportedIndex;
+		}
+
+	OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+	switch(aConfigIndex)
+		{
+	case OMX_SymbianIndexConfigAudioBytesPlayed:
+		{
+		omxRetValue = OMX_ErrorUnsupportedSetting;
+		}
+		break;
+				
+	default:
+		{
+		omxRetValue = COmxILConfigManager::SetConfig(aConfigIndex, apComponentConfigStructure);
+		}
+		};
+
+	return omxRetValue;
+
+	}
+
+OMX_ERRORTYPE
+COmxILPcmRendererConfigManager::GetExtensionIndex(
+	OMX_STRING aParameterName,
+	OMX_INDEXTYPE* apIndexType) const
+	{
+    DEBUG_PRINTF(_L8("COmxILPcmRendererConfigManager::GetExtensionIndex"));
+
+	TPtrC8 requestedParameterNamePtr(
+		const_cast<const TUint8*>(
+			reinterpret_cast<TUint8*>(aParameterName)));
+
+	TPtrC8 parameterNamePtr(
+		reinterpret_cast<const TUint8*>(sOmxSymbianPcmBytesPlayed));
+
+	if (requestedParameterNamePtr == parameterNamePtr)
+		{
+		*apIndexType =
+			static_cast<OMX_INDEXTYPE>(
+					OMX_SymbianIndexConfigAudioBytesPlayed);
+			
+		return OMX_ErrorNone;
+		}
+
+	*apIndexType = OMX_IndexMax;
+	return OMX_ErrorUnsupportedIndex;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmrenderer/src/omxilpcmrendererconfigmanager.h	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,74 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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
+ @internalComponent
+*/
+
+#ifndef OMXILPCMRENDERERCONFIGMANAGER_H
+#define OMXILPCMRENDERERCONFIGMANAGER_H
+
+#include <openmax/il/common/omxilconfigmanager.h>
+
+// class forwarding
+class COmxILPcmRendererProcessingFunction;
+
+/**
+   This class is a placeholder for those PCM Renderer parameters and configs that
+   apply to the component as a whole and not to a specific port in the
+   component.
+ */
+NONSHARABLE_CLASS(COmxILPcmRendererConfigManager) : public COmxILConfigManager
+	{
+
+public:
+
+	static COmxILPcmRendererConfigManager* NewL(
+		COmxILPcmRendererProcessingFunction& aProcessingFunction,
+		const TDesC8& aComponentName,
+		const OMX_VERSIONTYPE& aComponentVersion,
+		const RPointerArray<TDesC8>& aComponentRoleList);
+
+	~COmxILPcmRendererConfigManager();
+
+	OMX_ERRORTYPE GetConfig(
+		OMX_INDEXTYPE aConfigIndex,
+		TAny* apComponentConfigStructure) const;
+
+	OMX_ERRORTYPE SetConfig(
+		OMX_INDEXTYPE aConfigIndex,
+		const TAny* apComponentConfigStructure);
+
+	OMX_ERRORTYPE GetExtensionIndex(
+		OMX_STRING aParameterName,
+		OMX_INDEXTYPE* apIndexType) const;
+
+protected:
+
+	COmxILPcmRendererConfigManager(COmxILPcmRendererProcessingFunction& aProcessingFunction);
+
+	void ConstructL(const TDesC8& aComponentName,
+					const OMX_VERSIONTYPE& aComponentVersion,
+					const RPointerArray<TDesC8>& aComponentRoleList);
+
+private:
+	COmxILPcmRendererProcessingFunction& iProcessingFunction;
+	};
+
+#endif // OMXILPCMRENDERERCONFIGMANAGER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmrenderer/src/omxilpcmrendererconst.h	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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
+ @internalComponent
+*/
+
+
+#ifndef OMXILPCMRENDERERCONST_H_
+#define OMXILPCMRENDERERCONST_H_
+
+#include "mdasoundadapter.h"
+
+_LIT8(KSymbianOmxILPcmRendererName, "OMX.NOKIA.AUDIO.RENDERER.PCM");
+_LIT8(KSymbianOmxILPcmRendererRole, "audio_renderer.pcm");
+_LIT8(KMimeTypeAudioPcm, "audio/pcm");
+
+const OMX_U32 KPCMRENDERER_APB0PORT_INDEX = 0;
+const OMX_U32 KPCMRENDERER_OPB0PORT_INDEX = 1;
+
+const TInt KBufferSize = 16384;   // we need 16k to hold a pcm packet
+const TInt KDefaultSampleRate = 48000; // check out ./boardsupport/omap3variants/tiomap3bsp/variant/common/soundsc/variant_sound.cpp to find out the supporting rates
+const TInt KDefaultNumberChannels = 2;
+const TInt KDefaultBitPerSample = 16;
+const TInt KMaxVolume = 255;
+const TInt KMedianVolume = 226;
+const TInt KDefaultVolume = KMedianVolume;
+const TInt KMinBufferMilliseconds = 100; // Minimum number of milliseconds allowed in a buffer
+
+// Timeout to call RSoundSc::TimePlayed() every second
+// Under normal operation, the timer will return exactly one sec.
+// It is particular useful to compare the value from TimePlayed()
+static const TInt KPcmRendererTimePlayedDelay = 998113;
+
+const TBool KDefaultMuted = EFalse;
+
+const RMdaDevSound::TMdaSoundEncoding KDefaultEncoding = RMdaDevSound::EMdaSoundEncoding16BitPCM;
+
+#endif /*OMXILPCMRENDERERCONST_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmrenderer/src/omxilpcmrendererprocessingfunction.cpp	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,1685 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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
+ @internalComponent
+*/
+
+#include <openmax/il/khronos/v1_x/OMX_Audio.h>
+
+#include <d32soundsc.h>
+
+#include "log.h"
+#include <openmax/il/common/omxilcallbacknotificationif.h>
+#include <openmax/il/common/omxilclockcomponentcmdsif.h>
+#include <openmax/il/extensions/omxilsymbianaudiopcmextensions.h>
+#include "omxilpcmrendererprocessingfunction.h"
+
+const TInt COmxILPcmRendererProcessingFunction::CPFHelper::KMaxMsgQueueEntries;
+
+COmxILPcmRendererProcessingFunction*
+COmxILPcmRendererProcessingFunction::NewL(MOmxILCallbackNotificationIf& aCallbacks, 
+										MOmxILClockComponentCmdsIf& aClientClockPort)
+	{
+    DEBUG_PRINTF(_L8("COmxILPcmRendererProcessingFunction::NewL"));
+
+	COmxILPcmRendererProcessingFunction* self =
+		new (ELeave)COmxILPcmRendererProcessingFunction(aCallbacks, aClientClockPort);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+
+	}
+
+void
+COmxILPcmRendererProcessingFunction::ConstructL()
+	{
+    DEBUG_PRINTF(_L8("COmxILPcmRendererProcessingFunction::ConstructL"));
+
+    iAudioDevice = CAudioDevice::NewL(*this);
+    iPFHelper = CPFHelper::NewL(*iAudioDevice);
+	}
+
+COmxILPcmRendererProcessingFunction::COmxILPcmRendererProcessingFunction(
+	MOmxILCallbackNotificationIf& aCallbacks, 
+	MOmxILClockComponentCmdsIf& aClientClockPort)
+	:
+	COmxILProcessingFunction(aCallbacks),
+	iClientClockPortPtr(&aClientClockPort)
+	{
+    DEBUG_PRINTF(_L8("COmxILPcmRendererProcessingFunction::COmxILPcmRendererProcessingFunction"));
+
+	}
+
+COmxILPcmRendererProcessingFunction::~COmxILPcmRendererProcessingFunction()
+	{
+    DEBUG_PRINTF(_L8("COmxILPcmRendererProcessingFunction::~COmxILPcmRendererProcessingFunction"));
+
+	// Check in case the Sound Device has not been closed. That would happen in
+	// an scenario where the component is not being deleted in an orderer way.
+	if(iAudioDevice && iPFHelper &&
+	   (iState == OMX_StateInvalid   ||
+	    iState == OMX_StateExecuting ||
+	    iState == OMX_StatePause))
+		{
+		// Ignore error if the following call fails
+		iPFHelper->CloseDeviceOnError();
+		}
+
+	// Buffer headers are not owned by the processing function
+    iBuffersToEmpty.Close();
+    iBuffersEmptied.Close();
+    delete iAudioDevice;
+    delete iPFHelper;
+	}
+
+
+OMX_ERRORTYPE
+COmxILPcmRendererProcessingFunction::StateTransitionIndication(TStateIndex aNewState)
+	{
+    DEBUG_PRINTF(_L8("COmxILPcmRendererProcessingFunction::StateTransitionIndication"));
+
+    OMX_ERRORTYPE err = OMX_ErrorNone;
+	switch(aNewState)
+		{
+	case EStateExecuting:
+		{
+		DEBUG_PRINTF(_L8("StateTransitionIndication : OMX_StateExecuting"));
+		if (iPFHelper->Execute() != KErrNone)
+			{
+			return OMX_ErrorInsufficientResources;
+			}
+		}
+		break;
+	case EStateInvalid:
+		{
+		DEBUG_PRINTF(_L8("StateTransitionIndication : OMX_StateInvalid"));
+		if (iPFHelper->Stop() != KErrNone)
+			{ // InsufficientResources to stop???
+			return OMX_ErrorInsufficientResources;
+			}
+		}
+		break;
+	case EStatePause:
+		{
+		DEBUG_PRINTF(_L8("StateTransitionIndication : OMX_StatePause"));
+		err = iAudioDevice->MoveToPausedState();
+		}
+		break;
+	case EStateIdle:
+		{
+		DEBUG_PRINTF(_L8("StateTransitionIndication : OMX_StateIdle"));
+		iBuffersToEmpty.Reset();
+		if (iPFHelper->Stop() != KErrNone)
+			{ // InsufficientResources to stop???
+			return OMX_ErrorInsufficientResources;
+			}
+		}
+		break;
+	case EStateLoaded:
+	case EStateWaitForResources:
+		{
+		DEBUG_PRINTF(_L8("StateTransitionIndication : OMX_StateLoaded, OMX_StateWaitForResources"));
+		if (iPFHelper->Stop() != KErrNone)
+			{ // InsufficientResources to stop???
+			return OMX_ErrorInsufficientResources;
+			}
+		}
+		break;
+	case ESubStateLoadedToIdle:
+		{
+		DEBUG_PRINTF(_L8("StateTransitionIndication : ESubStateLoadedToIdle"));
+		if (iPFHelper->OpenDevice() != KErrNone)
+			{
+			return OMX_ErrorInsufficientResources;
+			}
+		}
+		break;
+	case ESubStateIdleToLoaded:
+		{
+		DEBUG_PRINTF(_L8("StateTransitionIndication : ESubStateIdleToLoaded"));
+		if (iPFHelper->CloseDevice() != KErrNone)
+			{ // InsufficientResources to close???
+			return OMX_ErrorInsufficientResources;
+			}
+		}
+		break;
+	case ESubStateExecutingToIdle:
+	case ESubStatePauseToIdle:
+		{
+		// Ignore these transitions...
+		return OMX_ErrorNone;
+		}
+	default:
+		{
+		// Always ASSERT; This would be a problem in the framework.
+		ASSERT(0);
+		return OMX_ErrorIncorrectStateTransition;
+		}
+		};
+
+	return err;
+
+	}
+
+
+OMX_ERRORTYPE
+COmxILPcmRendererProcessingFunction::BufferFlushingIndication(
+	TUint32 aPortIndex,
+	OMX_DIRTYPE aDirection)
+	{
+    DEBUG_PRINTF2(_L8("COmxILPcmRendererProcessingFunction::BufferFlushingIndication : aPortIndex[%d]"), aPortIndex);
+
+    if ((aPortIndex == OMX_ALL && aDirection == OMX_DirMax) ||
+		(aPortIndex == KPCMRENDERER_APB0PORT_INDEX && aDirection == OMX_DirInput))
+		{
+		// If we are currently processing a buffer then cancel
+		if (iPFHelper->CancelDevice() != KErrNone)
+			{
+			return OMX_ErrorInsufficientResources;
+			}
+
+		// Send BufferDone notifications for each emptied buffer...
+		FlushBufferList(iBuffersEmptied);
+
+	    // Send BufferDone notifications for each pending buffer...
+		FlushBufferList(iBuffersToEmpty);
+		
+		return OMX_ErrorNone;
+		}
+	else if (aPortIndex == KPCMRENDERER_OPB0PORT_INDEX && aDirection == OMX_DirInput)
+		{
+		// Since the clock port buffers are returned immediately, 
+		// there's nothing to flush for the port
+		return OMX_ErrorNone;
+		}
+	else
+		{
+		// Always ASSERT; This would be a problem in the framework.
+		ASSERT(0);
+		return OMX_ErrorBadParameter;
+		}
+	}
+
+void
+COmxILPcmRendererProcessingFunction::FlushBufferList(
+	RPointerArray<OMX_BUFFERHEADERTYPE>& aBufferList)
+	{
+    DEBUG_PRINTF2(_L8("COmxILPcmRendererProcessingFunction::FlushBufferList : [%s]"),
+				  &aBufferList == &iBuffersToEmpty ? "iBuffersToEmpty" : "iBuffersEmptied");
+
+	const TUint bufferCount = aBufferList.Count();
+	OMX_BUFFERHEADERTYPE* pBufferHeader = 0;
+	// We know there is only one input port...
+	OMX_DIRTYPE portDirection = OMX_DirInput;
+
+	for (TUint i=0; i<bufferCount; ++i)
+		{
+		pBufferHeader = aBufferList[i];
+		pBufferHeader->nFilledLen = 0;
+		iCallbacks.
+			BufferDoneNotification(
+				pBufferHeader,
+				pBufferHeader->nInputPortIndex,
+				portDirection
+				);
+		}
+
+	// Empty buffer list...
+	aBufferList.Reset();
+
+	}
+
+
+OMX_ERRORTYPE
+COmxILPcmRendererProcessingFunction::ParamIndication(
+	OMX_INDEXTYPE aParamIndex,
+	const TAny* apComponentParameterStructure)
+	{
+    DEBUG_PRINTF(_L8("COmxILPcmRendererProcessingFunction::ParamIndication"));
+
+    OMX_ERRORTYPE err = OMX_ErrorNone;
+    switch(aParamIndex)
+	{
+	case OMX_IndexParamAudioPcm:
+		{
+		const OMX_AUDIO_PARAM_PCMMODETYPE* pPcmProfile
+			= static_cast<const OMX_AUDIO_PARAM_PCMMODETYPE*>(
+				apComponentParameterStructure);
+
+		if((pPcmProfile->nChannels == 1 || pPcmProfile->nChannels == 2) &&
+		  (pPcmProfile->eNumData == OMX_NumericalDataSigned) &&
+		  (pPcmProfile->eEndian == OMX_EndianBig) &&
+		  (pPcmProfile->bInterleaved == OMX_TRUE) &&
+		  (pPcmProfile->nBitPerSample == 16) &&
+		  ((pPcmProfile->nSamplingRate == 8000)  ||
+		   (pPcmProfile->nSamplingRate == 11025) ||
+		   (pPcmProfile->nSamplingRate == 12000) ||
+		   (pPcmProfile->nSamplingRate == 16000) ||
+		   (pPcmProfile->nSamplingRate == 22050) ||
+		   (pPcmProfile->nSamplingRate == 24000) ||
+		   (pPcmProfile->nSamplingRate == 32000) ||
+		   (pPcmProfile->nSamplingRate == 44100) ||
+		   (pPcmProfile->nSamplingRate == 48000)) &&
+		  (pPcmProfile->ePCMMode == OMX_AUDIO_PCMModeLinear) &&
+		  (pPcmProfile->eChannelMapping[0] == OMX_AUDIO_ChannelLF) &&
+		  (pPcmProfile->eChannelMapping[1] == OMX_AUDIO_ChannelRF))
+			{
+			if (iPFHelper->ParamIndication(pPcmProfile) != KErrNone)
+				{
+				err = OMX_ErrorInsufficientResources;
+				}
+			}
+		else
+			{
+			err = OMX_ErrorBadParameter;
+			}
+		}
+		break;
+	default:
+		{
+		// Ignore other port param changes...
+		}
+	};
+
+	return err;
+
+	}
+
+OMX_ERRORTYPE
+COmxILPcmRendererProcessingFunction::ConfigIndication(OMX_INDEXTYPE aConfigIndex,
+													  const TAny* apComponentConfigStructure)
+	{
+    DEBUG_PRINTF2(_L8("COmxILPcmRendererProcessingFunction::ConfigIndication %X"), aConfigIndex);
+
+    OMX_ERRORTYPE err = OMX_ErrorNone;
+    switch(aConfigIndex)
+	{
+	case OMX_SymbianIndexConfigAudioPcmVolumeRamp:
+		{
+		const OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP*
+			pPcmVolumeRamp
+			= static_cast<
+			const OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP*>(
+					apComponentConfigStructure);
+
+		if (iPFHelper->SetVolumeRamp(pPcmVolumeRamp->nRampDuration) != KErrNone)
+			{
+			err = OMX_ErrorInsufficientResources;
+			}
+		}
+		break;
+
+	case OMX_IndexConfigAudioVolume:
+		{
+		const OMX_AUDIO_CONFIG_VOLUMETYPE* pVolumeType
+			= static_cast<const OMX_AUDIO_CONFIG_VOLUMETYPE*>(
+					apComponentConfigStructure);
+
+        if (pVolumeType->bLinear == OMX_TRUE)
+            {
+            // Some configuration structures contain read-only fields. The 
+            // OMX_SetConfig method will preserve read-only fields in configuration
+            // structures that contain them, and shall not generate an error when 
+            // the caller attempts to change the value of a read-only field.
+            err = OMX_ErrorNone;
+            break;
+            }
+			
+		if ((pVolumeType->sVolume.nValue <= pVolumeType->sVolume.nMax) &&
+		   (pVolumeType->sVolume.nValue >= pVolumeType->sVolume.nMin))
+			{
+			if (iPFHelper->SetVolume(pVolumeType->sVolume.nValue) != KErrNone)
+				{
+				err = OMX_ErrorInsufficientResources;
+				}
+			}
+		else
+			{
+			err = OMX_ErrorBadParameter;
+			}
+		}
+		break;
+
+	case OMX_IndexConfigAudioMute:
+		{
+		const OMX_AUDIO_CONFIG_MUTETYPE* pVolumeType
+		= static_cast<const OMX_AUDIO_CONFIG_MUTETYPE*>(
+				apComponentConfigStructure);
+
+		if (iPFHelper->SetMuted(pVolumeType->bMute) != KErrNone)
+			{
+			err = OMX_ErrorInsufficientResources;
+			}
+		}
+		break;
+
+	default:
+		{
+		// Ignore other port config changes...
+		}
+	};
+
+	return err;
+
+	}
+
+OMX_ERRORTYPE
+COmxILPcmRendererProcessingFunction::BufferIndication(
+	OMX_BUFFERHEADERTYPE* apBufferHeader,
+	OMX_DIRTYPE aDirection)
+	{
+    DEBUG_PRINTF2(_L8("COmxILPcmRendererProcessingFunction::BufferIndication : [%X]"), apBufferHeader);
+
+	if (aDirection != OMX_DirInput)
+		{
+		return OMX_ErrorBadParameter;
+		}
+    
+	if (iBuffersToEmpty.Append(apBufferHeader) != KErrNone)
+		{
+		return OMX_ErrorInsufficientResources;
+		}
+
+	// If we are not in an executing state or if the audio device is busy, delay playing back the buffer
+	if (iState != OMX_StateExecuting || iAudioDevice->IsActive())
+		{
+		return OMX_ErrorNone;
+		}
+				
+	if (iPFHelper->BufferIndication() != KErrNone)
+		{
+		return OMX_ErrorInsufficientResources;
+		}
+
+	return OMX_ErrorNone;
+	}
+
+OMX_ERRORTYPE COmxILPcmRendererProcessingFunction::MediaTimeIndication(const OMX_TIME_MEDIATIMETYPE& aMediaTimeType)
+	{
+	// Received a requested media time notification.
+	DEBUG_PRINTF5(_L8("MediaTimeIndication : eUpdateType = %d eState = %d xScale = %d nMediaTimestamp = %d "), 
+						aMediaTimeType.eUpdateType, aMediaTimeType.eState, aMediaTimeType.xScale, aMediaTimeType.nMediaTimestamp);
+	
+	iPFHelper->MediaTimeIndication(aMediaTimeType);
+	return OMX_ErrorNone;
+	}
+
+OMX_BOOL
+COmxILPcmRendererProcessingFunction::BufferRemovalIndication(
+	OMX_BUFFERHEADERTYPE* apBufferHeader,
+	OMX_DIRTYPE /* aDirection */)
+	{
+    DEBUG_PRINTF2(_L8("COmxILPcmRendererProcessingFunction::BufferRemovalIndication : BUFFER [%X]"), apBufferHeader);
+
+    TBool headerDeletionResult = ETrue;
+    // Check if the buffer we want to remove is the one is being currently processed
+    if (iAudioDevice->IsActive() && iAudioDevice->GetCurrentBuffer() == apBufferHeader)
+		{
+		if (iPFHelper->CancelDevice() != KErrNone)
+			{
+			return OMX_FALSE;
+			}
+
+		// if you cancel the audio device then you send the buffer to the other end of the tunnel
+		// so you shouldn't say that you had the buffer in the processing function in this situation.
+		headerDeletionResult = EFalse;
+		}
+    else
+		{
+		TInt headerIndexInArray = KErrNotFound;
+		if (KErrNotFound !=
+			(headerIndexInArray =
+			 iBuffersToEmpty.Find(apBufferHeader)))
+			{
+			iBuffersToEmpty.Remove(headerIndexInArray);
+			}
+		else if(KErrNotFound !=
+				(headerIndexInArray =
+				 iBuffersEmptied.Find(apBufferHeader)))
+			{
+			iBuffersEmptied.Remove(headerIndexInArray);
+			}
+		else
+			{
+			headerDeletionResult = EFalse;
+			}
+		}
+
+    DEBUG_PRINTF2(_L8("BufferRemovalIndication : Removal result [%s]"), (headerDeletionResult ? "YES" : "NO"));
+    return (headerDeletionResult ? OMX_TRUE : OMX_FALSE);
+	}
+
+TInt
+COmxILPcmRendererProcessingFunction::GetBytesPlayed() const
+	{
+	return iAudioDevice->GetBytesPlayed();
+	}
+
+
+COmxILPcmRendererProcessingFunction::CAudioDevice* COmxILPcmRendererProcessingFunction::CAudioDevice::NewL(COmxILPcmRendererProcessingFunction& aParent)
+	{
+	CAudioDevice* self = new (ELeave) CAudioDevice(aParent);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+COmxILPcmRendererProcessingFunction::CAudioDevice::CAudioDevice(COmxILPcmRendererProcessingFunction& aParent)
+: CActive(EPriorityUserInput),
+  iParent(aParent),
+  iSampleRate(KDefaultSampleRate),
+  iChannels(KDefaultNumberChannels),
+  iEncoding(KDefaultEncoding),
+  iVolume(KDefaultVolume),
+  iMuted(KDefaultMuted),
+  iBufferSize(KBufferSize),
+  iClockStateRunning(EFalse),
+  iPausedClockViaScale(EFalse),
+  iIsStartTimeFlagSet(EFalse)
+	{
+	CActiveScheduler::Add(this);
+	}
+
+
+void COmxILPcmRendererProcessingFunction::CAudioDevice::ConstructL()
+    {
+	iCachedPlayBuffer.CreateL(0);
+	}
+
+COmxILPcmRendererProcessingFunction::CAudioDevice::~CAudioDevice()
+	{
+	delete iPeriodic;
+	Cancel();
+	iCachedPlayBuffer.Close();
+	}
+
+void COmxILPcmRendererProcessingFunction::CAudioDevice::RunL()
+	{
+	DEBUG_PRINTF(_L8("CAudioDevice::RunL : "));
+	if (iStatus != KErrNone)
+		{
+		switch(iStatus.Int())
+			{
+		case KErrUnderflow:
+			DEBUG_PRINTF(_L8("CAudioDevice::RunL : KErrUnderflow"));
+			iParent.iCallbacks.ErrorEventNotification(OMX_ErrorUnderflow);
+			break;
+
+		case KErrOverflow:
+			DEBUG_PRINTF(_L8("CAudioDevice::RunL : KErrOverflow"));
+			iParent.iCallbacks.ErrorEventNotification(OMX_ErrorOverflow);
+			break;
+
+		default:
+			DEBUG_PRINTF2(_L8("CAudioDevice::RunL : [%d] -> OMX_ErrorHardware"), iStatus.Int());
+			iParent.iCallbacks.ErrorEventNotification(OMX_ErrorHardware);
+			};
+		}
+
+	ASSERT(iCurrentBuffer);
+	// Update the last value of bytes played...
+	iLastBytesPlayedValue = iSoundDevice.BytesPlayed();
+
+	// Return the emptied buffer to the IL Client or the tunnelled
+	// component..
+	SignalBufferCompletion(iCurrentBuffer);
+	iCurrentBuffer = 0;
+		
+	// Make sure to clear the aggregated cache buffer, if it was used
+	iCachedPlayBuffer.Zero();
+	}
+
+void COmxILPcmRendererProcessingFunction::CAudioDevice::SignalBufferCompletion(
+	OMX_BUFFERHEADERTYPE* apCurrentBuffer)
+	{
+	DEBUG_PRINTF2(_L8("CAudioDevice::SignalBufferCompletion : BUFFER = [%X]"), apCurrentBuffer);
+
+	iParent.iBuffersEmptied.Append(apCurrentBuffer);
+
+	// Process the queue only if in executing state...
+	if (iParent.iState == OMX_StateExecuting)
+		{
+		const TUint bufferCount = iParent.iBuffersEmptied.Count();
+		OMX_BUFFERHEADERTYPE* pBufferHeader = 0;
+		for (TUint i=0; i<bufferCount; ++i)
+			{
+			pBufferHeader = iParent.iBuffersEmptied[i];
+			TBool lastBuffer = EFalse;
+			if (pBufferHeader->nFlags & OMX_BUFFERFLAG_EOS)
+				{
+				lastBuffer = ETrue;
+				}
+
+			pBufferHeader->nFilledLen = 0;
+			iParent.iCallbacks.BufferDoneNotification(pBufferHeader,
+													  pBufferHeader->nInputPortIndex,
+													  OMX_DirInput);
+			if (lastBuffer)
+				{
+				pBufferHeader->nFlags |= OMX_BUFFERFLAG_EOS;
+				// propagate the EOS flag
+				iParent.iCallbacks.EventNotification(
+					OMX_EventBufferFlag,
+					KPCMRENDERER_APB0PORT_INDEX,
+					pBufferHeader->nFlags,
+					NULL);
+				}
+			}
+
+		// Empty list...
+		iParent.iBuffersEmptied.Reset();
+		}
+
+	if (iParent.iBuffersToEmpty.Count() > 0)
+		{
+		DEBUG_PRINTF2(_L8("CAudioDevice::RunL : iBuffersToEmpty.Count = [%d]"),
+					  iParent.iBuffersToEmpty.Count());
+		iParent.iPFHelper->BufferIndication();
+		}		
+		
+	}
+
+
+TBool COmxILPcmRendererProcessingFunction::CAudioDevice::ConstructAndStartUpdateTimer()
+    {
+    // Need this check if:
+    // - The component state transitions from Execution-Idle-Execution
+    // - The Clock's state transitions from Running-Stop-Running
+    if (iPeriodic == NULL)
+        {
+        iPeriodic = CPeriodic::New(EPriorityStandard);
+        
+        if (iPeriodic == NULL)
+            {
+            iParent.iCallbacks.ErrorEventNotification(OMX_ErrorInsufficientResources);
+            return EFalse;
+            }
+        }
+    
+    StartUpdateTimer();
+    
+    return ETrue;
+    }
+
+
+void COmxILPcmRendererProcessingFunction::CAudioDevice::ProcessNextBuffer()
+	{
+	if (iParent.iBuffersToEmpty.Count() == 0)
+		return;
+
+	// To implement A/V Sync, we should start playing only once the clock component gives the appopriate command
+	// If the clock component is not available, we start playing immediately
+	// Since the PCM Renderer supplies the reference clock, we make sure to initialise the clock component with
+	// the reference when we receive the first buffer
+	
+	if (!iParent.iClientClockPortPtr->IsClockComponentAvailable())
+		{
+		PlayData();
+		return;
+		}
+
+	OMX_BUFFERHEADERTYPE* bufferPtr = iParent.iBuffersToEmpty[0];
+	
+	TBool bufferHasStartTime = bufferPtr->nFlags & OMX_BUFFERFLAG_STARTTIME;
+	
+    if (!iClockStateRunning)
+        {
+        if (!bufferHasStartTime)
+            {
+            // Connected with the Clock but OMX_BUFFERFLAG_STARTTIME isn't set; simply queue the buffer
+            return;
+            }
+        else
+            {
+            OMX_ERRORTYPE err = iParent.iClientClockPortPtr->SetStartTime(static_cast<OMX_TICKS>(bufferPtr->nTimeStamp));
+            
+            if (err == OMX_ErrorNone)
+                {
+                // Clear the returning buffer's flag
+                bufferPtr->nFlags &= ~OMX_BUFFERFLAG_STARTTIME;
+                }
+            else
+                {
+                // NOTE: If the Clock is not in OMX_TIME_ClockStateWaitingForStartTime,
+                //       currently SetStartTime will return OMX_ErrorIncorrectStateOperation
+                
+                // It is not the PCM renderer to flag a Clock component error;
+                // therefore, ignore the error.
+                // 
+                // As the Clock is not in OMX_TIME_ClockStateRunning state, the Renderer needs  
+                // to keep the OMX_BUFFERFLAG_STARTTIME in the first buffer until the Clock 
+                // moves into OMX_TIME_ClockStateWaitingForStartTime or OMX_TIME_ClockStateRunning
+                // state
+                DEBUG_PRINTF2(_L8("CAudioDevice::ProcessNextBuffer SetStartTime() return %d"), err);
+                }
+            
+            // Update the iStartMediaTime
+            iParent.iStartMediaTime = static_cast<OMX_TICKS>(bufferPtr->nTimeStamp);
+            iIsStartTimeFlagSet = ETrue;
+            }
+        } // (!iClockStateRunning)
+    else
+		{
+        if (bufferHasStartTime)
+            {
+            // The Clock moves straight into OMX_TIME_ClockStateRunning state,
+            // clear the returning buffer's flag.
+            bufferPtr->nFlags &= ~OMX_BUFFERFLAG_STARTTIME;
+            }
+        
+        if (!iPlayData)
+            {
+            // Not allowed to render audio. This could be due to:
+            //  - The renderer is waiting for a time completion notification from the Clock;
+            return;
+            }
+		
+		if (!iIsStartTimeFlagSet)
+		    {
+		    // As the StartTimeFlag is not mandatory; therefore it might be missing from the first audio buffer
+		    // In such a case, we use the first buffer's timestamp as the StartMediaTime.
+		    //
+		    // NOTE: Since the Clock is running, calling SetStartTime() to the Clock is meaningless
+		    
+		    // Update the iStartMediaTime
+		    iParent.iStartMediaTime = static_cast<OMX_TICKS>(bufferPtr->nTimeStamp);
+		    iIsStartTimeFlagSet = ETrue;
+		    
+            // Cross checking the Clock's media timestamp with iStartMediaTime to see 
+            // data can be rendered straight away 
+            if (!CanPlayNow())
+                {
+                return;
+                }
+            
+            if (!ConstructAndStartUpdateTimer())
+                {
+                return;
+                }
+		    }
+		
+		DEBUG_PRINTF3(_L8("ProcessNextBuffer : iStartMediaTime = %d nTimeStamp = %d"), 
+	            I64LOW(iParent.iStartMediaTime), I64LOW(bufferPtr->nTimeStamp));
+		
+		if (!iPausedClockViaScale)	//if clock scale is zero then we are effectively paused
+			{
+			PlayData();
+			}
+		} // else
+	}
+
+
+void COmxILPcmRendererProcessingFunction::CAudioDevice::PlayData()
+	{
+	DEBUG_PRINTF(_L8("COmxILPcmRendererProcessingFunction::CAudioDevice::PlayData()++"));
+	if (iParent.iBuffersToEmpty.Count() == 0 || iSoundDevice.Handle() == 0 || IsActive())
+		{
+		DEBUG_PRINTF(_L8("COmxILPcmRendererProcessingFunction::CAudioDevice::PlayData() nothing to play, or there is an outstanding request"));
+		return;
+		}
+
+	iCurrentBuffer = iParent.iBuffersToEmpty[0];
+
+	iParent.iBuffersToEmpty.Remove(0);
+
+	CMMFDataBuffer* mmfSrcBuffer = static_cast<CMMFDataBuffer*>(iCurrentBuffer->pInputPortPrivate);
+	mmfSrcBuffer->Data().SetLength(iCurrentBuffer->nFilledLen);
+
+	// Attenuate the amplitude of the samples if volume ramping has been changed
+	if (iRampAudioSample)
+		{
+		iRampAudioSample = RampAudio(mmfSrcBuffer);
+		}
+
+	// First, check whether the buffer length is sufficient not to cause underflows in the device driver
+	TBool isFilledLengthSufficient = IsBufferLengthSufficient(iCurrentBuffer->nFilledLen);
+	// This variable defines whether we should send the data to the driver directly, or append it to an aggregated buffer
+	// We append the buffer instead of sending it directly, if (i) the buffer is too small, or (ii)  we have already aggregated something.
+	TBool appendBuffer = (!isFilledLengthSufficient || iCachedPlayBuffer.Length() > 0) ? ETrue : EFalse;
+	if (!appendBuffer)
+		{
+		SendBufferToSoundDevice(mmfSrcBuffer->Data());
+		}
+	else
+		{
+		// Check if we need to allocate the cached buffer
+		if (iCachedPlayBuffer.MaxLength() == 0)
+			{
+			// The RMdaDevSound shim allocates the shared chunk according to the maxLength of the descriptor it receives
+			// For this reason, we must allocate our buffer conservatively, otherwise the chunk may be insufficient and the RMdaDevSound shim will panic			
+			TInt err = iCachedPlayBuffer.ReAlloc(GetMinBufferLength() + iCurrentBuffer->nAllocLen);
+			if  (err != KErrNone)
+				{
+				iParent.iCallbacks.ErrorEventNotification(OMX_ErrorInsufficientResources);
+				return;
+				}
+			}
+		
+		iCachedPlayBuffer.Append(mmfSrcBuffer->Data());
+				
+		// If we have sufficient length aggregated, play the cached buffer
+		// Also if this is the last buffer, we have to play it now, there's nothing left to cache
+		if (IsBufferLengthSufficient(iCachedPlayBuffer.Length()) || iCurrentBuffer->nFlags & OMX_BUFFERFLAG_EOS)
+			{
+			SendBufferToSoundDevice(iCachedPlayBuffer);
+			}
+		// If not, make sure to notify that we notify that the buffer is done for the OMX tunnnel, so that the port will be able to reuse it
+		else
+			{
+			SignalBufferCompletion(iCurrentBuffer);
+			iCurrentBuffer = NULL;
+			}
+		}
+	}
+
+void COmxILPcmRendererProcessingFunction::CAudioDevice::SendBufferToSoundDevice(TDes8& aBuffer) 
+	{
+	ASSERT(!IsActive());
+	iStatus = KRequestPending;
+	DEBUG_PRINTF2(_L8("COmxILPcmRendererProcessingFunction::CAudioDevice::SendBufferToSoundDevice() PlayData [%d]"), aBuffer.Length());
+	iSoundDevice.PlayData(iStatus, aBuffer);
+	if (iResumeAfterNextPlay)
+		{
+		iResumeAfterNextPlay = EFalse;
+		iSoundDevice.ResumePlaying();
+		}
+	SetActive();				
+	}
+	
+TInt COmxILPcmRendererProcessingFunction::CAudioDevice::GetMinBufferLength() const
+	{
+	TInt minBufSize = KMinBufferMilliseconds * iSampleRate * iChannels / 1000;
+	if (iEncoding == RMdaDevSound::EMdaSoundEncoding16BitPCM)
+		{
+		minBufSize *= 2; // All other encodings use 1 byte per sample
+		}
+	return minBufSize;
+	}
+	
+TBool COmxILPcmRendererProcessingFunction::CAudioDevice::IsBufferLengthSufficient(TInt aBufferLength) const
+	{
+	return aBufferLength >= GetMinBufferLength() ? ETrue : EFalse;
+	}
+
+
+void COmxILPcmRendererProcessingFunction::CAudioDevice::ProcessMediaTimeIndication(OMX_TIME_MEDIATIMETYPE& aMediaTimeType)
+	{
+	switch (aMediaTimeType.eUpdateType)
+		{
+		case OMX_TIME_UpdateClockStateChanged:
+			{
+			HandleClockStateChanged(aMediaTimeType);
+			}
+			break;
+			
+		case OMX_TIME_UpdateRequestFulfillment:
+			{
+			// As the Clock was using another earlier start time;
+			// it is time for the PCM renderer to start playing the audio.
+			iPlayData = ETrue;
+			PlayData();
+			
+			if (!ConstructAndStartUpdateTimer())
+			    {
+			    return;
+			    }
+			}
+			break;
+			
+		case OMX_TIME_UpdateScaleChanged:
+			{
+			HandleClockScaleChanged(aMediaTimeType);
+			}
+			break;
+			
+		default:
+			{
+			// Do nothing here
+			}
+		}
+	}
+
+
+void COmxILPcmRendererProcessingFunction::CAudioDevice::StartUpdateTimer()
+	{
+	if (!iIsStartTimeFlagSet)
+		{
+		DEBUG_PRINTF(_L8("COmxILPcmRendererProcessingFunction::CAudioDevice::StartUpdateTimer() iIsStartTimeFlagSet == EFalse!!"));
+		return;
+		}
+	
+	// In case the timer already started
+	ASSERT(iPeriodic);
+	iPeriodic->Cancel();
+	
+	TCallBack callback(UpdateClockMediaTime, this);
+	
+	// Start updating the Clock comp. every KPcmRendererTimePlayedDelay
+	iPeriodic->Start(KPcmRendererTimePlayedDelay, KPcmRendererTimePlayedDelay, callback);
+	}
+
+
+TBool COmxILPcmRendererProcessingFunction::CAudioDevice::CanPlayNow()
+    {
+    if (iParent.iState != OMX_StateExecuting)
+        {
+        return EFalse;
+        }
+    
+    if (iClockMediaTime < iParent.iStartMediaTime)
+        {
+        // Once all required Clock's clients have responded, the clock component starts 
+        // the media clock using the earliest client start time.
+        // Therefore, start playing the audio only when such time comes; send a time
+        // completion request to the Clock component
+        OMX_ERRORTYPE err = iParent.iClientClockPortPtr->MediaTimeRequest(NULL, iParent.iStartMediaTime, 0);
+        
+        if (err != OMX_ErrorNone)
+            {
+            DEBUG_PRINTF2(_L8("CAudioDevice::CanPlayNow() MediaTimeRequest() return %d"), err);
+            }
+        
+        // Indicate that processing a new buffer should not trigger a false start on playback.
+        iPlayData = EFalse;
+        return EFalse;
+        }
+    else if (iClockMediaTime > iParent.iStartMediaTime)
+        {
+        // NOTE: The spec. states that the clock should use the minimum of the received start times
+        //       Therefore the Clock should NOT jump forwards with timestamp greater than the PCM
+        //       Renderer iStartMediaTime 
+        DEBUG_PRINTF3(_L8("CanPlayNow() nMediaTimestamp(%d) > iStartMediaTime(%d) IGNORE this use case"), 
+                I64LOW(iClockMediaTime), I64LOW(iParent.iStartMediaTime));
+        
+        // However if the Clock sends out a timestamp greater than the buffer's timestamp
+        // drop the buffers that fall outside the Clock specified MediaTimestamp;
+        
+        OMX_BUFFERHEADERTYPE* bufferPtr = iParent.iBuffersToEmpty[0];
+        iParent.iBuffersToEmpty.Remove(0);
+        SignalBufferCompletion(bufferPtr);
+        bufferPtr = NULL;
+        
+        // Since the iStartMediaTime doesn't make sense anymore, reset iIsStartTimeFlagSet until the buffer's timestamp 
+        // is within the the Clock's Media timestamp
+        iIsStartTimeFlagSet = EFalse;
+        return EFalse;
+        }
+    
+    return ETrue;
+    }
+
+
+void COmxILPcmRendererProcessingFunction::CAudioDevice::HandleClockStateChanged(const OMX_TIME_MEDIATIMETYPE& aMediaTimeType)
+	{	
+	switch (aMediaTimeType.eState)
+	    {
+	    case OMX_TIME_ClockStateRunning:
+	        {
+	        iClockMediaTime = aMediaTimeType.nMediaTimestamp;
+	        
+	        // There are two possibilities:
+	        // case 1 - The clock goes straight into running and the PCM renderer processes the  
+	        //          StateChanged notification prior the audio buffer
+	         
+	        if (iIsStartTimeFlagSet)
+	            {
+	            // OR
+	            // case 2 - The PCM recieves the audio buffer, and the clock StateChanged notification
+	            // comes later
+	            
+	            // Clear the returning buffer's flag.
+	            iParent.iBuffersToEmpty[0]->nFlags &= ~OMX_BUFFERFLAG_STARTTIME;
+	            
+	            // Cross checking the Clock's media timestamp with iStartMediaTime to see 
+	            // data can be rendered straight away
+	            if (!CanPlayNow())
+	                {
+	                break;
+	                }
+	            
+	            // Start playing the audio and start updating the Clock media time regularly 
+	            PlayData();
+
+	            if (!ConstructAndStartUpdateTimer())
+	                {
+	                return;
+	                }
+	            }
+			else if ((!iClockStateRunning) && (iParent.iState == OMX_StateExecuting))
+				{
+				// The clock has gone to running but no start time flag was received. This would
+				// indicate that the client moved it straight from stopped to running. As we may
+				// have received buffers while in stopped state, we need to start processing
+				// them now.
+                DEBUG_PRINTF(_L8("HandleClockStateChanged() Gone to running without start time flag set"));
+				iClockStateRunning = ETrue;
+				ProcessNextBuffer();
+				}
+	        
+	        // Otherwise, the queue is empty;
+	        //
+	        // NOTE: When !iIsStartTimeFlagSet && !iClockStateRunning would drop the incoming buffers;
+	        //       if the first buffer does not have the OMX_BUFFERFLAG_STARTTIME set
+	        }
+	        break;
+	    
+        case OMX_TIME_ClockStateWaitingForStartTime:
+            {
+            if (iClockStateRunning)
+                {
+                DEBUG_PRINTF(_L8("HandleClockStateChanged() OMX_TIME_ClockStateRunning -> OMX_TIME_ClockStateWaitingForStartTime IGNORED!!"));
+                }
+            else
+                {
+                // Let's try to process buffers (if any).
+                ProcessNextBuffer();
+                }
+            }
+            break;
+
+        case OMX_TIME_ClockStateStopped:
+            {
+            if (iClockStateRunning)
+                {
+                // The Clock was in "Running" state but not anymore; stop the audio
+                if (IsActive())
+                    {
+                    Cancel();
+                    }
+                else
+                    {
+                    DoCancel();
+                    }
+
+                iPlayData = ETrue;
+                if (iIsStartTimeFlagSet)
+                    {
+                    iIsStartTimeFlagSet = EFalse;
+                    iPeriodic->Cancel();
+                    }
+                }
+            
+            // Otherwise, ignore other possibilities
+            }
+            
+            break;
+         
+        default:
+            {
+            DEBUG_PRINTF2(_L8("HandleClockStateChanged() aMediaTimeType.eState = %d IGNORED!!"), aMediaTimeType.eState);
+            }
+         break;
+	    }
+   
+	iClockStateRunning = (aMediaTimeType.eState == OMX_TIME_ClockStateRunning) ? ETrue : EFalse;
+	}	
+
+
+void COmxILPcmRendererProcessingFunction::CAudioDevice::HandleClockScaleChanged(const OMX_TIME_MEDIATIMETYPE& aMediaTimeType)
+	{
+	if (aMediaTimeType.xScale == 0)
+		{
+		PauseAudio();
+		iPausedClockViaScale = ETrue;
+        DEBUG_PRINTF2(_L8("HandleClockScaleChanged() pausing iPausedClockViaScale = %d"), iPausedClockViaScale);
+ 		}
+	else if (aMediaTimeType.xScale == 0x10000)
+		{
+		// The scale is a Q16 value
+		iPausedClockViaScale = EFalse;
+		DEBUG_PRINTF2(_L8("HandleClockScaleChanged() resuming iPausedClockViaScale = %d"), iPausedClockViaScale);
+
+		// If we are active then there is an outstanding PlayData() request so we need to call ResumePlaying().
+		// However calling ResumePlaying() without an outstanding PlayData() request can cause the TimePLayed() API
+		// to go awry, so we should defer calling ResumePlaying() until the next PlayData() call.
+		if (IsActive())
+			{
+			iSoundDevice.ResumePlaying();
+			}
+		else
+			{
+			iResumeAfterNextPlay = ETrue;
+			}
+		iParent.iPFHelper->BufferIndication();	//handles the race condition where both 1) iSoundDevice was paused after the last PlayData() completed and before it was passed any data & 2) BufferIndication()s came in for all the IL buffers while in this paused state
+		StartUpdateTimer();
+		}
+
+	// TODO: Handle the rest of the scale values
+
+	}
+
+
+void COmxILPcmRendererProcessingFunction::CAudioDevice::DoCancel()
+	{
+	if (iSoundDevice.Handle() != 0)
+		{
+		iSoundDevice.CancelPlayData();
+		iSoundDevice.FlushPlayBuffer();
+		}
+	
+	if (iCurrentBuffer)
+	    {
+		iCurrentBuffer->nFilledLen = 0;
+		
+		iParent.iCallbacks.BufferDoneNotification(iCurrentBuffer,
+		        iCurrentBuffer->nInputPortIndex,
+		        OMX_DirInput);
+		
+		iCachedPlayBuffer.Zero();
+		iCurrentBuffer = NULL;
+		}
+	}
+
+
+OMX_ERRORTYPE COmxILPcmRendererProcessingFunction::CAudioDevice::OpenDevice()
+	{
+	OMX_ERRORTYPE err = OMX_ErrorNone;
+	if(!iSoundDevice.Handle())
+		{
+		if(KErrNone != iSoundDevice.Open(KSoundScTxUnit0))
+			{
+			err = OMX_ErrorHardware;
+			}
+		}
+	return err;
+	}
+
+OMX_ERRORTYPE COmxILPcmRendererProcessingFunction::CAudioDevice::CloseDevice()
+	{
+	OMX_ERRORTYPE err = OMX_ErrorNone;
+	if(iSoundDevice.Handle())
+		{
+		iSoundDevice.Close();
+		iResumeAfterNextPlay = EFalse;
+		}
+	return err;
+	}
+
+OMX_ERRORTYPE COmxILPcmRendererProcessingFunction::CAudioDevice::Execute()
+	{
+	if(!iSoundDevice.Handle())
+		{
+		if(KErrNone != iSoundDevice.Open())
+			{
+			return OMX_ErrorHardware;
+			}
+		}
+
+	if(iParent.iState == OMX_StatePause)
+		{
+		// Now we can send BufferDone notifications for each emptied
+		// buffer...
+		iParent.FlushBufferList(iParent.iBuffersEmptied);
+		// If we are active then there is an outstanding PlayData() request so we need to call ResumePlaying().
+		// However calling ResumePlaying() without an outstanding PlayData() request can cause the TimePLayed() API
+		// to go awry, so we should defer calling ResumePlaying() until the next PlayData() call.
+		if (IsActive())
+			{
+			iSoundDevice.ResumePlaying();
+			}
+		else
+			{
+			iResumeAfterNextPlay = ETrue;
+			}
+		StartUpdateTimer();
+		}
+	else
+		{
+		// Set play format
+		RMdaDevSound::TCurrentSoundFormatBuf buf;
+		iSoundDevice.GetPlayFormat(buf);
+		buf().iRate = iSampleRate;
+		buf().iChannels = iChannels;
+		buf().iBufferSize = iBufferSize;
+		buf().iEncoding = iEncoding;
+		if(KErrNone != iSoundDevice.SetPlayFormat(buf))
+			{
+			return OMX_ErrorHardware;
+			}
+		
+		if (iMuted)
+		    {
+		    iSoundDevice.SetVolume(0);
+		    }
+		else
+		    {
+		    iSoundDevice.SetVolume(iVolume);
+		    }
+		}
+
+	iParent.iState = OMX_StateExecuting;		
+		
+	// Make sure to start processing of queued up buffers (if any)
+	if (!IsActive() && iParent.iBuffersToEmpty.Count() > 0)
+		{
+		ProcessNextBuffer();
+		}
+
+	return OMX_ErrorNone;
+	}
+
+OMX_ERRORTYPE COmxILPcmRendererProcessingFunction::CAudioDevice::MoveToPausedState()
+	{
+	iParent.iState = OMX_StatePause;
+	PauseAudio();
+
+	return OMX_ErrorNone;
+	}
+
+OMX_ERRORTYPE COmxILPcmRendererProcessingFunction::CAudioDevice::Stop()
+	{
+	if(iParent.iState == OMX_StateExecuting || iParent.iState == OMX_StatePause)
+		{
+		// Cancel and flush the device driver
+		Cancel();
+
+		// Cancel timer to stop calling RSoundSc::TimePlayed()
+		if (iIsStartTimeFlagSet)
+			{
+			ASSERT(iPeriodic);
+			iPeriodic->Cancel();
+			}
+		
+		iParent.iState = OMX_StateIdle;
+
+		// If the audio device is still open, store the last value of bytes
+		// played before closing the audio device...
+		if(iSoundDevice.Handle() != 0)
+			{
+			iLastBytesPlayedValue = iSoundDevice.BytesPlayed();
+			// Close the sound device
+			iSoundDevice.Close();
+			iResumeAfterNextPlay = EFalse;
+			}
+		}
+	
+	iClockStateRunning = EFalse;
+	iIsStartTimeFlagSet = EFalse;
+	iPlayData = ETrue;
+
+	return OMX_ErrorNone;
+	}
+
+
+void COmxILPcmRendererProcessingFunction::CAudioDevice::PauseAudio()
+	{
+	// Cancel timer to stop calling RSoundSc::TimePlayed()
+	if (iIsStartTimeFlagSet)
+		{
+		ASSERT(iPeriodic);
+		iPeriodic->Cancel();
+		}
+	
+	if (iSoundDevice.Handle())
+		{
+		iSoundDevice.PausePlayBuffer();
+		}
+	}
+
+
+OMX_ERRORTYPE COmxILPcmRendererProcessingFunction::CAudioDevice::SetChannels(TUint aChannels)
+	{
+	iChannels = aChannels;
+	return SetPlayFormat();
+	}
+
+OMX_ERRORTYPE COmxILPcmRendererProcessingFunction::CAudioDevice::SetSampleRate(TUint aSampleRate)
+	{
+	iSampleRate = aSampleRate;
+	return SetPlayFormat();
+	}
+
+TInt ConvertOmxToSymbianVolume(TInt aVolume)
+	{
+	// OpenMax volume is in millibels while Symbian volume is in 0.5 db increments in the [0..255] range
+	// We divide by 50 as 0.5 dB = 50 millibells
+	TInt res = KMedianVolume + aVolume / 50;
+	if (res < 0)
+		return 0;
+	if (res > KMaxVolume)
+		return KMaxVolume;
+	return res;
+	}
+	
+OMX_ERRORTYPE COmxILPcmRendererProcessingFunction::CAudioDevice::SetVolume(TInt aVolume)
+	{
+	iVolume = ConvertOmxToSymbianVolume(aVolume);
+	if ((!iMuted) && (iSoundDevice.Handle() != 0))
+		{
+		iSoundDevice.SetVolume(iVolume);
+		}
+	return OMX_ErrorNone;
+	}
+
+OMX_ERRORTYPE COmxILPcmRendererProcessingFunction::CAudioDevice::SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration)
+	{
+	iVolumeRamp = aRampDuration;
+	if(iVolumeRamp.Int64() != 0)
+		{
+		iRampAudioSample = ETrue;
+		ConfigAudioRamper(
+			iVolumeRamp.Int64());
+		}
+	else
+		{
+		iRampAudioSample = EFalse;
+		}
+	return OMX_ErrorNone;
+	}
+
+OMX_ERRORTYPE COmxILPcmRendererProcessingFunction::CAudioDevice::SetMuted(TBool aMuted)
+	{
+	iMuted = aMuted;
+	
+	if (iSoundDevice.Handle() == 0)
+	    {
+		// Just cache the value; the value will be set once the the device is opened
+	    return OMX_ErrorNone;
+	    }
+	
+	if (iMuted)
+		{
+		iSoundDevice.SetVolume(0);
+		}
+	else
+		{
+		iSoundDevice.SetVolume(iVolume);
+		}
+	return OMX_ErrorNone;
+	}
+
+OMX_ERRORTYPE COmxILPcmRendererProcessingFunction::CAudioDevice::SetPlayFormat()
+	{
+	if (iParent.iState == OMX_StateExecuting)
+		{
+		RMdaDevSound::TCurrentSoundFormatBuf buf;
+		iSoundDevice.GetPlayFormat(buf);
+		buf().iRate = iSampleRate;
+		buf().iChannels = iChannels;
+		buf().iBufferSize = iBufferSize;
+		buf().iEncoding = iEncoding;
+		if(KErrNone != iSoundDevice.SetPlayFormat(buf))
+			{
+			return OMX_ErrorHardware;
+			}
+		}
+	return OMX_ErrorNone;
+	}
+
+OMX_BUFFERHEADERTYPE* COmxILPcmRendererProcessingFunction::CAudioDevice::GetCurrentBuffer()
+	{
+	return iCurrentBuffer;
+	}
+
+TInt COmxILPcmRendererProcessingFunction::CAudioDevice::GetBytesPlayed()
+	{
+	if(iSoundDevice.Handle() != 0)
+		{
+		return iSoundDevice.BytesPlayed();
+		}
+
+	return iLastBytesPlayedValue;
+	}
+
+void COmxILPcmRendererProcessingFunction::CAudioDevice::ConfigAudioRamper(TInt64 aRampTime)
+	{
+	iRampSamples = I64LOW(((TInt64(iSampleRate) * aRampTime) /1000000 )); // Add this
+	iRampSamplesLeft = iRampSamples;
+	iRampIncr = 0;
+	iSkip = ETrue;
+	}
+
+TBool COmxILPcmRendererProcessingFunction::CAudioDevice::RampAudio(CMMFDataBuffer* aBuffer)
+	{
+	TInt i=0;
+	TInt length = aBuffer->Data().Length()>>1;
+	if (length == 0)
+		{
+		return EFalse;
+		}
+		
+	TInt16* sample = REINTERPRET_CAST(TInt16*,&aBuffer->Data()[0]);
+	TInt64 theResult(0);
+	while ((i < length) && (iRampIncr < iRampSamples))
+		{
+		theResult = sample[i];
+		theResult *= iRampIncr;
+		theResult /= iRampSamples;
+		sample[i] = STATIC_CAST(TInt16, I64LOW(theResult) );
+
+		if ((iChannels == 1) || (!iSkip))
+			{
+			iRampIncr++;
+			}
+		iSkip = !iSkip;
+		i++;
+		}
+
+	if (iRampIncr < iRampSamples)
+		return ETrue;
+	else
+		return EFalse;
+	}
+
+
+TInt COmxILPcmRendererProcessingFunction::CAudioDevice::UpdateClockMediaTime(TAny* aPtr)
+	{
+	CAudioDevice* ptr = (CAudioDevice*)aPtr;
+	TTimeIntervalMicroSeconds playedTime(0);
+  	
+	if (ptr->iSoundDevice.GetTimePlayed(playedTime) != KErrNone)
+		{
+		ptr->iParent.iCallbacks.ErrorEventNotification(OMX_ErrorHardware);
+		return EFalse;
+		}
+	
+  	OMX_ERRORTYPE err;
+  	
+	// Update the clock component audio reference clock
+  	err = ptr->iParent.iClientClockPortPtr->SetAudioReference(ptr->iParent.iStartMediaTime + playedTime.Int64());
+
+	if (err != OMX_ErrorNone)
+		{
+		ptr->iParent.iCallbacks.ErrorEventNotification(err);
+		return EFalse;
+		}
+	
+	DEBUG_PRINTF2(_L8("CAudioDevice::UpdateClockMediaTime : playedTime = %d"), 
+					I64LOW(playedTime.Int64()));
+
+	return ETrue;
+	}
+
+
+void COmxILPcmRendererProcessingFunction::CAudioDevice::ProcessParamIndication(const OMX_AUDIO_PARAM_PCMMODETYPE& aPcmModeType)
+	{
+	if(SetChannels(aPcmModeType.nChannels) != OMX_ErrorNone)
+		{
+		iParent.iCallbacks.ErrorEventNotification(OMX_ErrorHardware);
+		return;
+		}
+	
+	if (SetSampleRate(aPcmModeType.nSamplingRate) != OMX_ErrorNone)
+		{
+		iParent.iCallbacks.ErrorEventNotification(OMX_ErrorHardware);
+		return;
+		}
+	}
+
+COmxILPcmRendererProcessingFunction::CPFHelper* COmxILPcmRendererProcessingFunction::CPFHelper::NewL(CAudioDevice& aAudioDevice)
+	{
+	CPFHelper* self = new (ELeave) CPFHelper(aAudioDevice);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+COmxILPcmRendererProcessingFunction::CPFHelper::CPFHelper(CAudioDevice& aAudioDevice)
+: CActive(EPriorityUserInput),
+  iAudioDevice(aAudioDevice)
+	{
+	}
+	
+void COmxILPcmRendererProcessingFunction::CPFHelper::ConstructL()
+	{
+	CActiveScheduler::Add(this);
+	User::LeaveIfError(iCallerSemaphore.CreateGlobal(KNullDesC, 0));
+	User::LeaveIfError(iMsgQueue.CreateLocal(KMaxMsgQueueEntries));
+	iMsgQueue.NotifyDataAvailable(iStatus);
+	RThread thisThread;
+	iHelperThreadId = thisThread.Id();
+	thisThread.Close();
+	SetActive();
+	}
+	
+COmxILPcmRendererProcessingFunction::CPFHelper::~CPFHelper()
+	{
+	Cancel(); 
+	iMsgQueue.Close();
+	iCallerSemaphore.Close();
+	}
+
+void COmxILPcmRendererProcessingFunction::CPFHelper::RunL()
+	{
+
+	TProcMessage msg;
+	while (iMsgQueue.Receive(msg)==KErrNone)
+		{
+		switch (msg.iType)
+			{
+			case EOpenDevice:
+				{
+				iAudioDevice.OpenDevice();
+				break;
+				}
+			case ECloseDevice:
+				{
+				iAudioDevice.CloseDevice();
+				break;
+				}
+			case ECloseDeviceOnError:
+				{
+				iAudioDevice.Cancel();
+				iAudioDevice.CloseDevice();
+				iCallerSemaphore.Signal();
+				break;
+				}
+			case EExecuteCommand:
+				{
+				iAudioDevice.Execute();	
+				break;
+				}				
+
+			case EStopCommand:
+				{
+				iAudioDevice.Stop();	
+				break;
+				}
+				
+			case ECancelCommand:
+				{
+				iAudioDevice.Cancel();	
+				break;
+				}
+				
+			case EBufferIndication:
+				{
+				iAudioDevice.ProcessNextBuffer();	
+				break;
+				}
+			case EMediaTimeIndication:
+				{
+				iAudioDevice.ProcessMediaTimeIndication(msg.iMediaTimeType);	
+				break;
+				}
+			case EParamIndication:
+				{
+				iAudioDevice.ProcessParamIndication(msg.iPcmModeType);
+				break;
+				}
+			case ESetVolumeRamp:
+				{
+				iAudioDevice.SetVolumeRamp(TTimeIntervalMicroSeconds(msg.iRampDuration));
+				break;
+				}
+			case ESetVolume:
+				{
+				iAudioDevice.SetVolume(msg.iVolumeValue);
+				break;
+				}
+			case ESetMuted:
+				{
+				iAudioDevice.SetMuted(msg.iMuted);
+				break;
+				}
+			default:
+				{
+				break;
+				}					
+			}
+		}
+	DEBUG_PRINTF2(_L8("COmxILPcmRendererProcessingFunction::CPFHelper::RunL : msg.iType[%d]"), msg.iType);		
+	// setup for next callbacks		
+	iMsgQueue.NotifyDataAvailable(iStatus);
+	SetActive();
+	}
+
+void COmxILPcmRendererProcessingFunction::CPFHelper::DoCancel()
+	{
+	if (iMsgQueue.Handle()!=NULL)
+		{
+		iMsgQueue.CancelDataAvailable();
+		}
+	}
+
+TInt COmxILPcmRendererProcessingFunction::CPFHelper::OpenDevice()
+	{
+	TProcMessage message;
+	message.iType = EOpenDevice;
+	return iMsgQueue.Send(message);
+	}
+
+TInt COmxILPcmRendererProcessingFunction::CPFHelper::CloseDevice()
+	{
+	DEBUG_PRINTF2(_L8("COmxILPcmRendererProcessingFunction::CPFHelper::CloseDevice : IsActive[%s]"),
+				  (IsActive() ? "YES" : "NO"));
+	TProcMessage message;
+	message.iType = ECloseDevice;
+	return iMsgQueue.Send(message);
+	}
+
+TInt COmxILPcmRendererProcessingFunction::CPFHelper::CloseDeviceOnError()
+	{
+	DEBUG_PRINTF2(_L8("COmxILPcmRendererProcessingFunction::CPFHelper::CloseDeviceOnError : IsActive[%d]"), (IsActive() ? 1 : 0));
+
+	RThread thisThread;
+	if (thisThread.Id() == iHelperThreadId)
+		{
+		// Just do it...
+		iAudioDevice.Cancel();
+		iAudioDevice.CloseDevice();
+		}
+	else
+		{
+
+		TProcMessage message;
+		message.iType = ECloseDeviceOnError;
+		TInt error = iMsgQueue.Send(message);
+		if (KErrNone != error)
+			{
+			// only wait if the message was sent into the queue...
+			iCallerSemaphore.Wait();
+			}
+		}
+
+	thisThread.Close();
+
+	return KErrNone;
+
+	}
+
+TInt COmxILPcmRendererProcessingFunction::CPFHelper::Execute()
+	{
+	DEBUG_PRINTF2(_L8("CPFHelper::Execute : IsActive[%s]"), (IsActive() ? "YES" : "NO"));
+	TProcMessage message;
+	message.iType = EExecuteCommand;
+	return iMsgQueue.Send(message);
+	}
+		
+TInt COmxILPcmRendererProcessingFunction::CPFHelper::Stop()
+	{
+	DEBUG_PRINTF2(_L8("CPFHelper::Stop : IsActive[%s]"), (IsActive() ? "YES" : "NO"));
+	TProcMessage message;
+	message.iType = EStopCommand;
+	return iMsgQueue.Send(message);
+	}
+	
+TInt COmxILPcmRendererProcessingFunction::CPFHelper::CancelDevice()
+	{
+	DEBUG_PRINTF2(_L8("CPFHelper::CancelDevice : IsActive[%s]"), (IsActive() ? "YES" : "NO"));
+	TProcMessage message;
+	message.iType = ECancelCommand;
+	return iMsgQueue.Send(message);
+	}
+	
+TInt COmxILPcmRendererProcessingFunction::CPFHelper::BufferIndication()
+	{
+	DEBUG_PRINTF2(_L8("CPFHelper::BufferIndication : IsActive[%s]"), (IsActive() ? "YES" : "NO"));
+	TProcMessage message;
+	message.iType = EBufferIndication;
+	return iMsgQueue.Send(message);
+	}
+
+TInt COmxILPcmRendererProcessingFunction::CPFHelper::MediaTimeIndication(const OMX_TIME_MEDIATIMETYPE& aMediaTimeType)
+	{
+	DEBUG_PRINTF2(_L8("CPFHelper::MediaTimeIndication : IsActive[%s]"), (IsActive() ? "YES" : "NO"));
+	TProcMessage message;
+	message.iType = EMediaTimeIndication;
+	message.iMediaTimeType.eUpdateType = aMediaTimeType.eUpdateType;
+	message.iMediaTimeType.eState = aMediaTimeType.eState;
+	message.iMediaTimeType.xScale = aMediaTimeType.xScale;	
+	message.iMediaTimeType.nMediaTimestamp = aMediaTimeType.nMediaTimestamp;
+	
+	return iMsgQueue.Send(message);
+	}
+
+TInt COmxILPcmRendererProcessingFunction::CPFHelper::ParamIndication(const OMX_AUDIO_PARAM_PCMMODETYPE* aPcmModeType)
+	{
+	DEBUG_PRINTF2(_L8("CPFHelper::ParamIndication : IsActive[%s]"), (IsActive() ? "YES" : "NO"));
+	TProcMessage message;
+	message.iType = EParamIndication;
+	message.iPcmModeType.nChannels =  aPcmModeType->nChannels;
+	message.iPcmModeType.nSamplingRate =  aPcmModeType->nSamplingRate;
+	
+	return iMsgQueue.Send(message);
+	}
+
+TInt COmxILPcmRendererProcessingFunction::CPFHelper::SetVolumeRamp(const OMX_U64 aRampDuration)
+	{
+	DEBUG_PRINTF2(_L8("CPFHelper::SetVolumeRamp : IsActive[%s]"), (IsActive() ? "YES" : "NO"));
+	TProcMessage message;
+	message.iType = ESetVolumeRamp;
+	message.iRampDuration = aRampDuration;
+	
+	return iMsgQueue.Send(message);
+	}
+
+TInt COmxILPcmRendererProcessingFunction::CPFHelper::SetVolume(const OMX_S32 aVolumeValue)
+	{
+	DEBUG_PRINTF2(_L8("CPFHelper::SetVolume : IsActive[%s]"), (IsActive() ? "YES" : "NO"));
+	TProcMessage message;
+	message.iType = ESetVolume;
+	message.iVolumeValue = aVolumeValue;
+	
+	return iMsgQueue.Send(message);	
+	}
+
+TInt COmxILPcmRendererProcessingFunction::CPFHelper::SetMuted(const OMX_BOOL aMuted)
+	{
+	DEBUG_PRINTF2(_L8("CPFHelper::SetMuted : IsActive[%s]"), (IsActive() ? "YES" : "NO"));
+	TProcMessage message;
+	message.iType = ESetMuted;
+	message.iMuted = aMuted;
+	
+	return iMsgQueue.Send(message);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmrenderer/src/omxilpcmrendererprocessingfunction.h	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,238 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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
+ @internalComponent
+*/
+
+#ifndef OMXILPCMRENDERERPROCESSINGFUNCTION_H
+#define OMXILPCMRENDERERPROCESSINGFUNCTION_H
+
+#include <mmf/server/mmfdatabuffer.h>
+#include "omxilpcmrendererconst.h"
+#include <openmax/il/common/omxilprocessingfunction.h>
+#include <e32msgqueue.h> 
+
+// Forward declarations
+class MOmxILClockComponentCmdsIf;
+
+NONSHARABLE_CLASS(COmxILPcmRendererProcessingFunction) :
+	public COmxILProcessingFunction
+	{
+
+public:
+	static COmxILPcmRendererProcessingFunction* NewL(
+		MOmxILCallbackNotificationIf& aCallbacks,
+		MOmxILClockComponentCmdsIf& aClientClockPort);
+
+	~COmxILPcmRendererProcessingFunction();
+
+	OMX_ERRORTYPE StateTransitionIndication(TStateIndex aNewState);
+
+	OMX_ERRORTYPE BufferFlushingIndication(TUint32 aPortIndex,
+										   OMX_DIRTYPE aDirection);
+
+	OMX_ERRORTYPE ParamIndication(OMX_INDEXTYPE aParamIndex,
+									  const TAny* apComponentParameterStructure);
+
+	OMX_ERRORTYPE ConfigIndication(OMX_INDEXTYPE aConfigIndex,
+									   const TAny* apComponentConfigStructure);
+
+	OMX_ERRORTYPE BufferIndication(
+		OMX_BUFFERHEADERTYPE* apBufferHeader,
+		OMX_DIRTYPE aDirection);
+
+	OMX_ERRORTYPE MediaTimeIndication(const OMX_TIME_MEDIATIMETYPE& aMediaTimeType);
+	
+	OMX_BOOL BufferRemovalIndication(
+		OMX_BUFFERHEADERTYPE* apBufferHeader,
+		OMX_DIRTYPE aDirection);
+
+	TInt GetBytesPlayed() const;
+	
+private:
+
+	COmxILPcmRendererProcessingFunction(MOmxILCallbackNotificationIf& aCallbacks,
+									MOmxILClockComponentCmdsIf& aClientClockPort);
+	
+	void ConstructL();
+
+	void FlushBufferList(RPointerArray<OMX_BUFFERHEADERTYPE>& aBufferList);
+	
+private:
+	RPointerArray<OMX_BUFFERHEADERTYPE> iBuffersToEmpty;
+	RPointerArray<OMX_BUFFERHEADERTYPE> iBuffersEmptied;
+	OMX_STATETYPE iState;
+	MOmxILClockComponentCmdsIf* iClientClockPortPtr;
+	OMX_TICKS iStartMediaTime;	
+	
+	class CAudioDevice : public CActive
+		{
+	public:
+		static CAudioDevice* NewL(COmxILPcmRendererProcessingFunction& aParent);
+		~CAudioDevice();
+
+		// from CActive
+		void RunL();
+		void DoCancel();
+
+		OMX_ERRORTYPE OpenDevice();
+		OMX_ERRORTYPE CloseDevice();
+		OMX_ERRORTYPE Execute();
+		OMX_ERRORTYPE MoveToPausedState();
+		OMX_ERRORTYPE Stop();
+
+		OMX_ERRORTYPE SetChannels(TUint aChannels);
+		OMX_ERRORTYPE SetSampleRate(TUint aSampleRate);
+		OMX_ERRORTYPE SetVolume(TInt aVolume);
+		OMX_ERRORTYPE SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration);
+		OMX_ERRORTYPE SetMuted(TBool aMuted);
+		OMX_BUFFERHEADERTYPE* GetCurrentBuffer();
+		TInt GetBytesPlayed();
+		void ConfigAudioRamper(TInt64 aRampTime);
+		TBool RampAudio(CMMFDataBuffer* aBuffer);
+		TBool ConstructAndStartUpdateTimer();
+		void ProcessNextBuffer();
+		void PlayData();
+		void ProcessMediaTimeIndication(OMX_TIME_MEDIATIMETYPE& aMediaTimeType);
+		void ProcessParamIndication(const OMX_AUDIO_PARAM_PCMMODETYPE& aPcmModeType);
+		
+	private:
+		CAudioDevice(COmxILPcmRendererProcessingFunction& aParent);
+		void ConstructL();
+		OMX_ERRORTYPE SetPlayFormat();
+		void SignalBufferCompletion(OMX_BUFFERHEADERTYPE* apCurrentBuffer);
+		TBool IsBufferLengthSufficient(TInt aBufferLength) const;
+		TInt GetMinBufferLength() const;
+		void SendBufferToSoundDevice(TDes8& aBuffer);
+		void StartUpdateTimer();
+		void HandleClockStateChanged(const OMX_TIME_MEDIATIMETYPE& aMediaTimeType);
+		TBool CanPlayNow();
+		void HandleClockScaleChanged(const OMX_TIME_MEDIATIMETYPE& aMediaTimeType);		
+		void PauseAudio();
+
+		// From MGenericTimerClient
+		static TInt UpdateClockMediaTime(TAny* aPtr );
+
+	private:
+		RMdaDevSound iSoundDevice;
+		OMX_BUFFERHEADERTYPE* iCurrentBuffer;
+		COmxILPcmRendererProcessingFunction& iParent;
+		TInt iSampleRate;
+		TInt iChannels;
+		RMdaDevSound::TMdaSoundEncoding iEncoding;
+		TUint iVolume;
+		TBool iMuted;
+		TUint iBufferSize;
+		TTimeIntervalMicroSeconds iVolumeRamp;
+		TBool iRampAudioSample;
+		TInt iRampSamples;
+		TInt iRampSamplesLeft;
+		TInt iRampIncr;
+		TBool iSkip;
+		TBool iClockStateRunning;
+		TBool iPausedClockViaScale;
+		TBool iIsStartTimeFlagSet;
+		OMX_TICKS iClockMediaTime;
+		TBool iPlayData;  // To indicate whether it can start rendering audio or not 
+
+		/// If the component is in a state other than OMX_StateExecuting, this
+		/// internal variable is used to store the last value of bytes played by
+		/// the Sound Device.
+		TInt iLastBytesPlayedValue;
+		
+		/// This is used to send a media time update to the clock component
+		CPeriodic* iPeriodic;
+		
+		// This variable is used to optionally allocate a memory segment to cache OMX buffers if the tunnelled component does not utilise them well
+		// If the tunnelled components don't fill in sufficient data in the buffers, this can create underflows in the renderer, as the driver won't have enough data to play
+		RBuf8 iCachedPlayBuffer;		
+		TBool iResumeAfterNextPlay;
+
+		} *iAudioDevice;
+
+	class CPFHelper : public CActive
+		{
+	public:
+		static CPFHelper* NewL(CAudioDevice& aAudioDevice);
+		~CPFHelper();
+
+		// from CActive
+		void RunL();
+		void DoCancel();
+
+		TInt OpenDevice();
+		TInt CloseDevice();
+		TInt CloseDeviceOnError();
+		TInt Execute();
+		TInt Stop();
+		TInt CancelDevice();
+		TInt BufferIndication();
+		TInt MediaTimeIndication(const OMX_TIME_MEDIATIMETYPE& aMediaTimeType);
+		TInt ParamIndication(const OMX_AUDIO_PARAM_PCMMODETYPE* aPcmModeType);
+		TInt SetVolumeRamp(const OMX_U64 aRampDuration);
+		TInt SetVolume(const OMX_S32 aVolumeValue);
+		TInt SetMuted(const OMX_BOOL aVolumeValue);
+		
+		enum TMessageType 
+			{
+			EOpenDevice,
+			ECloseDevice,
+			ECloseDeviceOnError,
+			EExecuteCommand,
+			EStopCommand,
+			ECancelCommand,
+			EBufferIndication,
+			EMediaTimeIndication,
+			EParamIndication,
+			ESetVolumeRamp,
+			ESetVolume,
+			ESetMuted
+			};
+
+		class TProcMessage
+			{
+		public:
+			TMessageType iType;
+			OMX_TIME_MEDIATIMETYPE iMediaTimeType;
+			OMX_AUDIO_PARAM_PCMMODETYPE iPcmModeType;
+			OMX_U64 iRampDuration;
+			OMX_S32 iVolumeValue;
+			OMX_BOOL iMuted;
+			};
+			
+		RMsgQueue<TProcMessage> iMsgQueue;
+	
+	private:
+		CPFHelper(CAudioDevice& aAudioDevice);
+		void ConstructL();
+
+	private:
+
+		static const TInt KMaxMsgQueueEntries = 150;
+
+		CAudioDevice& iAudioDevice;
+		TThreadId iHelperThreadId;
+		RSemaphore iCallerSemaphore;
+
+		} *iPFHelper;
+
+	};
+
+#endif // OMXILPCMRENDERERPROCESSINGFUNCTION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmrenderer/src/rateconvert.cpp	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,486 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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\mmf\utils\rateconvert.cpp
+// Note this code used to be in mmfutilities.cpp but split off here to allow
+// scaling of descriptors instead of just CMMFBuffers.
+// 
+//
+
+#include "rateconvertimpl.h" // includes rateconvert.h itself
+#include <e32const.h>
+
+const TInt KMaxInt16Bit = 65536 ; 
+
+/*
+The rate conversion algorithms used here are extremely basic, using nearest neighbour, not
+even interpolation. An increment is created - initially a real, but converted to 16.16 fixed
+point notation for efficiency purposes. For example, from 8000 to 11025 this increment is set
+at 8000/11025 (~ 0.73). Each increment to the destination buffer conceptually increments the
+src pointer by this value (0.73). On each iteration the nearest src sample is used.
+
+The idea is that successive buffers run on from each other. The index is adjusted so at the end
+of the run it is correct for the next buffer, and this is saved from one iteration to the next.
+If the client wants to convert separate buffers, it should call Reset(), where the index is reset
+to 0. 
+
+Note the algorithm is even then not ideal, as it effectively truncates and not rounds the 
+fixed-point index. However, a feature of this is that the nearest src sample is always behind the
+conceptual fixed-point index. This makes it easy to ensure that processing of the next buffer
+never needs data from the previous cycle - except this index value.
+
+*/
+
+enum TPanicCodes
+	{
+	EPanicNoDestinationBuffer=1,
+	EPanicNoSourceConsumed
+	};
+
+#ifdef _DEBUG
+
+static void Panic(TInt aPanicCode)
+	{
+	_LIT(KRateConvert,"RateConvert");
+	User::Panic(KRateConvert, aPanicCode);
+	}
+	
+#endif // _DEBUG
+
+//
+// CChannelAndSampleRateConverter 
+//
+
+CChannelAndSampleRateConverter::CChannelAndSampleRateConverter()
+	{
+	// constructor does nothing but ensures can't derive from outside dll
+	}
+
+// Factory function
+CChannelAndSampleRateConverter* CChannelAndSampleRateConverter::CreateL(TInt aFromRate,
+																				 TInt aFromChannels,
+										 										 TInt aToRate,
+										 										 TInt aToChannels)
+	{
+	// check that the params in range so we can assume OK later on
+	if (aFromChannels <= 0 || aFromChannels > 2 ||
+		aToChannels <= 0 || aToChannels > 2 ||
+		aFromRate <= 0 || aToRate <= 0)
+		{
+		User::Leave(KErrArgument);
+		}
+		
+	CChannelAndSampleRateConverterCommon* converter = NULL;
+
+	if (aFromChannels==aToChannels)
+		{
+		if (aFromChannels==1)
+			{
+			converter = new (ELeave) CMonoToMonoRateConverter;			
+			}
+		else
+			{
+			converter = new (ELeave) CStereoToStereoRateConverter;
+			}
+		}
+	else
+		{
+		if (aFromChannels==1)
+			{
+			if (aFromRate!=aToRate)
+				{
+				converter = new (ELeave) CMonoToStereoRateConverter;				
+				}
+			else
+				{
+				converter = new (ELeave) CMonoToStereoConverter;				
+				}
+			}
+		else
+			{
+            ASSERT(aFromChannels>1 && aToChannels==1);
+			if (aFromRate!=aToRate)
+				{
+				converter = new (ELeave) CStereoToMonoRateConverter;				
+				}
+			else
+				{
+ 				converter = new (ELeave) CStereoToMonoConverter;				
+				}
+			}
+		}
+	converter->SetRates(aFromRate,aToRate);
+	return converter;
+	}
+	
+//
+// CChannelAndSampleRateConverterImpl
+//
+
+CChannelAndSampleRateConverterCommon::CChannelAndSampleRateConverterCommon()
+	{
+	}
+
+void CChannelAndSampleRateConverterCommon::Reset()
+	{
+	// default does nothing
+	}
+	
+void CChannelAndSampleRateConverterCommon::SetRates(TInt /*aFromRate*/, TInt /*aToRate*/)
+	{
+	// in default no need to know so don't cache
+	}
+
+TInt CChannelAndSampleRateConverterCommon::MaxConvertBufferSize(TInt aSrcBufferSize, TBool aRoundUpToPower)
+	{
+	// assume aSrcBuffer takes channel change into account
+	TInt rawValue = aSrcBufferSize;
+	if (aRoundUpToPower)
+		{
+		return NextPowerUp(rawValue); 
+		}
+	else
+		{
+		return rawValue;
+		}
+	}
+	
+TInt CChannelAndSampleRateConverterCommon::NextPowerUp(TInt aValue)
+	{
+	TInt power = 128; // no need to start lower
+	while (power<aValue)
+		{
+		power *= 2;
+		}
+	return power;
+	}
+	
+//
+// CChannelAndSampleRateConvert
+//
+
+CChannelAndSampleRateConvert::CChannelAndSampleRateConvert()
+	{
+	}
+
+	
+TInt CChannelAndSampleRateConvert::MaxConvertBufferSize(TInt aSrcBufferSize, TBool aRoundUpToPower)
+	{
+	// take rate conversion into account. Assumed channel mismatch handled by the child class.
+	TInt rawValue = aSrcBufferSize;
+	if (iFromRate < iToRate)
+		{
+		TInt result = SizeOfUpsampleBuffer(rawValue);
+		return result; // always rounded up to next size
+		}
+	else
+		{
+		if (aRoundUpToPower)
+			{
+			return NextPowerUp(rawValue); 
+			}
+		else
+			{
+			return rawValue;
+			}
+		}
+	}
+	
+void CChannelAndSampleRateConvert::SetRates(TInt aFromRate, TInt aToRate)
+	{
+	iFromRate=aFromRate;
+	iToRate=aToRate;
+
+	TReal ratio = TReal(aFromRate) / TReal(aToRate);
+	TInt quotient = TInt(ratio);
+	TReal remainder = ratio - TReal(quotient);
+	iFraction = (quotient << 16) + TInt32(remainder * KMaxInt16Bit);
+
+	Reset();
+	}
+	
+void CChannelAndSampleRateConvert::Reset()
+	{
+	iIndex = 0;
+	}
+	
+TInt CChannelAndSampleRateConvert::SizeOfUpsampleBuffer(TInt aBufferLength)
+	{
+	TInt rawValue = aBufferLength;
+	ASSERT(iFromRate < iToRate); // should not be called otherwise
+	// upsample - will generate more data. use floats to avoid extra round error
+	rawValue = TInt(rawValue * TReal(iToRate) / TReal(iFromRate) + 0.5) + 4*sizeof(TInt16); // add some fudge factor just in case
+	rawValue = NextPowerUp(rawValue); // when upscaling always give nice power
+	return rawValue;	
+	}
+
+//
+// Specific converter code
+//
+
+CStereoToStereoRateConverter::CStereoToStereoRateConverter()
+	{
+	}
+
+TInt CStereoToStereoRateConverter::Convert(const TDesC8& aSrcBuffer, TDes8& aDstBuffer)
+	{
+	const TInt32* srcPtr = reinterpret_cast<const TInt32*>(aSrcBuffer.Ptr());
+	TInt32* dstPtr = const_cast<TInt32*>(reinterpret_cast<const TInt32*>(aDstBuffer.Ptr()));
+	
+	const TInt32* srcLimit=srcPtr+LengthBytesTo32Bit(aSrcBuffer.Length()); // ptr+n does *4 for TInt32* ptr
+	TInt32* dstLimit=dstPtr+LengthBytesTo32Bit(aDstBuffer.MaxLength()); // ditto
+
+	// add left over from last buffer
+	TUint index = iIndex;
+	const TInt32* src = srcPtr + (index>>16);
+	TInt32* dst = dstPtr;
+
+	if (dst>=dstLimit)
+		{
+		__ASSERT_DEBUG(EFalse,Panic(EPanicNoDestinationBuffer));
+		return 0;
+		}
+
+	while (src<srcLimit && dst<dstLimit)
+		{
+  		*dst++ = *src;
+		index += iFraction;
+		src = srcPtr + (index>>16); // truncate fix-point index
+		}
+
+	// get amount by which index exceeded end of buffer
+	// so that we can add it back to start of next buffer
+	const TInt32* conceptualLastSrc = Min(src, srcLimit); // ptr to last src we have we'd _not_ used next iteration
+	TInt srcSamplesCopied = conceptualLastSrc - srcPtr;
+	__ASSERT_DEBUG(srcSamplesCopied>0, Panic(EPanicNoSourceConsumed)); // should always be ok if we have some destination space
+	iIndex = index - (srcSamplesCopied << 16); 
+
+	// return sample byte count and setup output buffer
+	TInt dstLength = Length32BitToBytes(dst-dstPtr);
+	aDstBuffer.SetLength(dstLength); //adjust length of destination buffer
+	return Length32BitToBytes(srcSamplesCopied);
+	}
+	
+CMonoToStereoRateConverter::CMonoToStereoRateConverter()
+	{
+	}
+
+TInt CMonoToStereoRateConverter::Convert(const TDesC8& aSrcBuffer, TDes8& aDstBuffer)
+	{
+	const TInt16* srcPtr = reinterpret_cast<const TInt16*>(aSrcBuffer.Ptr());
+	TInt32* dstPtr = const_cast<TInt32*>(reinterpret_cast<const TInt32*>(aDstBuffer.Ptr()));
+	
+	const TInt16* srcLimit=srcPtr+LengthBytesTo16Bit(aSrcBuffer.Length()); // as ptr+n does *2 for TInt16* ptr
+	TInt32* dstLimit=dstPtr+LengthBytesTo32Bit(aDstBuffer.MaxLength()); // ditto but does *4 for TInt32*
+
+	// add left over from last buffer
+	TUint index = iIndex;
+	const TInt16* src = srcPtr + (index>>16);
+	TInt32* dst = dstPtr;
+
+	if (dst>=dstLimit)
+		{
+		__ASSERT_DEBUG(EFalse,Panic(EPanicNoDestinationBuffer));
+		return 0;
+		}
+
+	while (src<srcLimit && dst<dstLimit-1)
+		{
+		TInt16 sample = *src;
+		TInt32 stereoSample = MonoToStereo(sample);
+		*dst++ = stereoSample;
+		index += iFraction;
+		src = srcPtr + (index>>16); // truncate fix-point index
+		}
+
+	// get amount by which index exceeded end of buffer
+	// so that we can add it back to start of next buffer
+	const TInt16* conceptualLastSrc = Min(src, srcLimit); // ptr to last src we have we'd _not_ used next iteration
+	TInt srcSamplesCopied = conceptualLastSrc - srcPtr;
+	__ASSERT_DEBUG(srcSamplesCopied>0, Panic(EPanicNoSourceConsumed)); // should always be ok if we have some destination space
+	iIndex = index - (srcSamplesCopied << 16); 
+
+	// return sample byte count and setup output buffer
+	TInt dstLength = Length32BitToBytes(dst-dstPtr);			// size in bytes
+	aDstBuffer.SetLength(dstLength); //adjust length of destination buffer
+	return Length16BitToBytes(srcSamplesCopied);
+	}	
+	
+
+TInt CMonoToStereoRateConverter::MaxConvertBufferSize(TInt aSrcBufferSize, TBool aRoundUpToPower)
+	{
+	return CChannelAndSampleRateConvert::MaxConvertBufferSize(aSrcBufferSize*2, aRoundUpToPower);
+	}
+	
+CMonoToMonoRateConverter::CMonoToMonoRateConverter()
+	{
+	}
+
+TInt CMonoToMonoRateConverter::Convert(const TDesC8& aSrcBuffer, TDes8& aDstBuffer)
+	{
+	const TInt16* srcPtr = reinterpret_cast<const TInt16*>(aSrcBuffer.Ptr());
+	TInt16* dstPtr = const_cast<TInt16*>(reinterpret_cast<const TInt16*>(aDstBuffer.Ptr()));
+	
+	const TInt16* srcLimit=srcPtr+LengthBytesTo16Bit(aSrcBuffer.Length()); // ptr+n does *2 for TInt16* ptr
+	TInt16* dstLimit=dstPtr+LengthBytesTo16Bit(aDstBuffer.MaxLength()); // ditto
+
+	// add left over from last buffer
+	TUint index = iIndex;
+	const TInt16* src = srcPtr + (index>>16);
+	TInt16* dst = dstPtr;
+
+	if (dst>=dstLimit)
+		{
+		__ASSERT_DEBUG(EFalse,Panic(EPanicNoDestinationBuffer));
+		return 0;
+		}
+
+	while (src<srcLimit && dst<dstLimit)
+		{
+  		*dst++ = *src;
+		index += iFraction;
+		src = srcPtr + (index>>16); // truncate fix-point index
+		}
+
+	// get amount by which index exceeded end of buffer
+	// so that we can add it back to start of next buffer
+	const TInt16* conceptualLastSrc = Min(src, srcLimit); // ptr to last src we have we'd _not_ used next iteration
+	TInt srcSamplesCopied = conceptualLastSrc - srcPtr;
+	__ASSERT_DEBUG(srcSamplesCopied>0, Panic(EPanicNoSourceConsumed)); // should always be ok if we have some destination space
+	iIndex = index - (srcSamplesCopied << 16); 
+
+	// return sample byte count and setup output buffer
+	TInt dstLength = Length16BitToBytes(dst-dstPtr);		// size in bytes
+	aDstBuffer.SetLength(dstLength); //adjust length of destination buffer
+	return Length16BitToBytes(srcSamplesCopied);
+	}	
+	
+CStereoToMonoRateConverter::CStereoToMonoRateConverter()
+	{
+	}
+
+//This method takes the left and right sample of interleaved PCM and sums it, then divides by 2
+TInt CStereoToMonoRateConverter::Convert(const TDesC8& aSrcBuffer, TDes8& aDstBuffer)
+	{
+	const TInt32* srcPtr = reinterpret_cast<const TInt32*>(aSrcBuffer.Ptr());
+	TInt16* dstPtr = const_cast<TInt16*>(reinterpret_cast<const TInt16*>(aDstBuffer.Ptr()));
+	
+	const TInt32* srcLimit=srcPtr+LengthBytesTo32Bit(aSrcBuffer.Length()); // ptr+n does *4 for TInt32* ptr
+	TInt16* dstLimit=dstPtr+LengthBytesTo16Bit(aDstBuffer.MaxLength()); // ditto but *2 for TInt16*
+
+	// add left over from last buffer
+	TUint index = iIndex;
+	const TInt32* src = srcPtr + (index>>16);
+	TInt16* dst = dstPtr;
+
+	if (dst>=dstLimit)
+		{
+		__ASSERT_DEBUG(EFalse,Panic(EPanicNoDestinationBuffer));
+		return 0;
+		}
+
+	while (src<srcLimit && dst<dstLimit)
+		{
+		TInt32 sample = *src;
+		TInt16 monoSample = StereoToMono(sample);
+  		*dst++ =  monoSample;
+		index += iFraction;
+		src = srcPtr + (index>>16); // truncate fix-point index
+		}
+
+	// get amount by which index exceeded end of buffer
+	// so that we can add it back to start of next buffer
+	const TInt32* conceptualLastSrc = Min(src, srcLimit); // ptr to last src we have we'd _not_ used next iteration
+	TInt srcSamplesCopied = conceptualLastSrc - srcPtr;
+	__ASSERT_DEBUG(srcSamplesCopied>0, Panic(EPanicNoSourceConsumed)); // should always be ok if we have some destination space
+	iIndex = index - (srcSamplesCopied << 16); 
+
+	// return sample byte count and setup output buffer
+	TInt dstLength = Length16BitToBytes(dst-dstPtr);			// size in bytes
+	aDstBuffer.SetLength(dstLength); //adjust length of destination buffer
+	return Length32BitToBytes(srcSamplesCopied);
+	}
+
+
+TInt CStereoToMonoRateConverter::MaxConvertBufferSize(TInt aSrcBufferSize, TBool aRoundUpToPower)
+	{
+	TUint size = aSrcBufferSize/2;
+	size += aSrcBufferSize & 1; //avoid round down error
+	return CChannelAndSampleRateConvert::MaxConvertBufferSize(size, aRoundUpToPower);
+	}
+	
+CStereoToMonoConverter::CStereoToMonoConverter()
+	{
+	}
+
+//This method takes the left and right sample of interleaved PCM and sums it, then divides by 2
+TInt CStereoToMonoConverter::Convert(const TDesC8& aSrcBuffer, TDes8& aDstBuffer)
+	{
+	const TInt32* src = reinterpret_cast<const TInt32*>(aSrcBuffer.Ptr());
+	TInt16* dst = const_cast<TInt16*>(reinterpret_cast<const TInt16*>(aDstBuffer.Ptr()));
+
+	TInt srcCount = LengthBytesTo32Bit(aSrcBuffer.Length());
+	TInt dstCount = LengthBytesTo16Bit(aDstBuffer.MaxLength());
+	TInt count = Min(srcCount, dstCount); // if aDstBuffer is short, just copy that much
+	
+	for (TUint i=0;i<count;++i)
+		{
+		TInt32 sample = *src++;
+		TInt16 monoSample = StereoToMono(sample);
+  		*dst++ = monoSample;
+		}
+		
+	aDstBuffer.SetLength(Length16BitToBytes(count)); // *2 because is mono
+	return Length32BitToBytes(count); // *4 as is stereo
+	}	
+
+TInt CStereoToMonoConverter::MaxConvertBufferSize(TInt aSrcBufferSize, TBool aRoundUpToPower)
+	{
+	TUint size = aSrcBufferSize/2;
+	size += aSrcBufferSize & 1; //avoid round down error
+	return CChannelAndSampleRateConverterCommon::MaxConvertBufferSize(size, aRoundUpToPower);
+	}
+	
+CMonoToStereoConverter::CMonoToStereoConverter()
+	{
+	}
+
+TInt CMonoToStereoConverter::Convert(const TDesC8& aSrcBuffer, TDes8& aDstBuffer)
+	{
+	const TInt16* src = reinterpret_cast<const TInt16*>(aSrcBuffer.Ptr());
+	TInt32* dst = const_cast<TInt32*>(reinterpret_cast<const TInt32*>(aDstBuffer.Ptr()));
+
+	TInt srcCount = LengthBytesTo16Bit(aSrcBuffer.Length());
+	TInt dstCount = LengthBytesTo32Bit(aDstBuffer.MaxLength());
+	TInt count = Min(srcCount, dstCount); // if aDstBuffer is short, just copy that much
+	
+	for (TUint i=0;i<count;i++)
+		{
+		TInt16 sample = *src++;
+		TInt32 stereoSample = MonoToStereo(sample);
+  		*dst++ =  stereoSample;
+		}
+		
+	aDstBuffer.SetLength(Length32BitToBytes(count)); // *4 because is stereo
+	return Length16BitToBytes(count); // *2 as is mono
+	}	
+
+TInt CMonoToStereoConverter::MaxConvertBufferSize(TInt aSrcBufferSize, TBool aRoundUpToPower)
+	{
+	return CChannelAndSampleRateConverterCommon::MaxConvertBufferSize(aSrcBufferSize*2, aRoundUpToPower);
+	}
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmrenderer/src/rateconvert.h	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,68 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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\mmf\utils\rateconvert.h
+// 
+//
+
+#ifndef RATECONVERT_H
+#define RATECONVERT_H
+
+/**
+@internalTechnology
+@file
+*/
+
+#include <e32base.h>
+
+/**
+Base utility class to change the sample rate of audio data in a buffer
+*/
+class CChannelAndSampleRateConverter : public CBase
+	{
+protected:
+	CChannelAndSampleRateConverter();
+	
+public:
+	/*
+	Create a converter that will do rate and channel conversion as requested
+	*/
+	static CChannelAndSampleRateConverter* CreateL(TInt aFromRate,TInt aFromChannels,
+												 TInt aToRate,TInt aToChannels);
+	/**
+	Reads the audio data from the source buffer,
+	converts the number of channels and the sample rate
+	and copies the result to the destination buffer
+
+	@param  aSrcBuffer
+	        The source buffer containing the audio data to convert.
+	@param  aDstBuffer
+	        The destination buffer - assumed big enough
+
+	@return The length of the source buffer that was consumed.
+	*/
+	virtual TInt Convert(const TDesC8& aSrcBuffer, TDes8& aDstBuffer)=0;
+	virtual void Reset()=0;
+
+	/*
+	Indicates what buffer size is required to hold the converted data.
+	Support size of original buffer. 
+	aRoundUpToPower means give next power of 2 size up from raw size.
+	NB. May be bigger than strictly necessary.
+	*/
+	virtual TInt MaxConvertBufferSize(TInt aSrcBufferSize, TBool aRoundUpToPower=EFalse)=0;
+	};
+
+
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmrenderer/src/rateconvertimpl.h	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,183 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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 RATECONVERTIMPL_H
+#define RATECONVERTIMPL_H
+
+#include "rateconvert.h"
+
+/**
+Abstract class that all specific converters derive from.
+*/
+NONSHARABLE_CLASS( CChannelAndSampleRateConverterCommon ) : public CChannelAndSampleRateConverter
+	{
+public:
+	virtual void SetRates(TInt aSrcRate,TInt aDstRate);
+	
+	// from CChannelAndSampleRateConverter
+	void Reset();
+	TInt MaxConvertBufferSize(TInt aSrcBufferSize, TBool aRoundUpToPower);
+	
+protected:
+	CChannelAndSampleRateConverterCommon();
+	
+	static TInt NextPowerUp(TInt aValue);
+	inline static TInt StereoToMono(TInt aSample);
+	inline static TInt MonoToStereo(TInt aSample);
+	
+	inline static TInt LengthBytesTo16Bit(TInt aLength);
+	inline static TInt LengthBytesTo32Bit(TInt aLength);
+	inline static TInt Length16BitToBytes(TInt aLength);
+	inline static TInt Length32BitToBytes(TInt aLength);
+	};
+	
+/* functions for copying from mono to stereo and from stereo to mono */
+
+inline TInt CChannelAndSampleRateConverterCommon::StereoToMono(TInt aSample)
+	{
+	TInt topChannel = aSample>>16; // will naturally keep sign
+	TInt bottomChannel = TInt16(aSample&0xffff); // need to sign extend
+	TInt monoSample = (topChannel + bottomChannel)/2; // add two channels and divide
+	return monoSample;
+	}
+	
+inline TInt CChannelAndSampleRateConverterCommon::MonoToStereo(TInt aSample)
+	{
+	TInt32 stereoSample = (aSample<<16) | (aSample&0xffff);
+#ifdef _DEBUG
+	TInt monoSample = StereoToMono(stereoSample);
+	ASSERT(monoSample==aSample);
+#endif
+	return TInt(stereoSample);
+	}
+	
+// Convert various lengths by multipling or dividing by 2 or 4
+
+inline TInt CChannelAndSampleRateConverterCommon::LengthBytesTo16Bit(TInt aLength)
+	{
+	return aLength/sizeof(TInt16);
+	}
+	
+inline TInt CChannelAndSampleRateConverterCommon::LengthBytesTo32Bit(TInt aLength)
+	{
+	return aLength/sizeof(TInt32);
+	}
+	
+inline TInt CChannelAndSampleRateConverterCommon::Length16BitToBytes(TInt aLength)
+	{
+	return aLength*sizeof(TInt16);
+	}
+	
+inline TInt CChannelAndSampleRateConverterCommon::Length32BitToBytes(TInt aLength)
+	{
+	return aLength*sizeof(TInt32);
+	}
+
+/**
+Abstract class that all specific rate converters derive from - as opposed to channel converters
+*/
+NONSHARABLE_CLASS( CChannelAndSampleRateConvert ) : public CChannelAndSampleRateConverterCommon
+	{
+public:
+	
+	// from CChannelAndSampleRateConverterCommon
+	void Reset();
+	TInt MaxConvertBufferSize(TInt aSrcBufferSize, TBool aRoundUpToPower);
+	void SetRates(TInt aSrcRate,TInt aDstRate);
+	
+protected:
+	CChannelAndSampleRateConvert();
+	
+	TInt SizeOfUpsampleBuffer(TInt aBufferLength);
+protected:
+	/*
+	The sample rate of the data in the source buffer
+	*/
+	TInt iFromRate;
+	/*
+	The sample rate of the data in the destination buffer
+	*/
+	TInt iToRate;
+
+	TInt iFraction;
+	TInt iIndex;
+	};
+
+NONSHARABLE_CLASS( CStereoToMonoRateConverter ) : public CChannelAndSampleRateConvert
+	{
+public:
+	CStereoToMonoRateConverter();
+	
+protected:
+	// from CChannelAndSampleRateConvert
+	TInt Convert(const TDesC8& aSrcBuffer, TDes8& aDstBuffer);
+	TInt MaxConvertBufferSize(TInt aSrcBufferSize, TBool aRoundUpToPower);
+	};
+
+NONSHARABLE_CLASS( CStereoToMonoConverter ) : public CChannelAndSampleRateConverterCommon
+	{
+public:
+	CStereoToMonoConverter();
+	
+protected:
+	// from CChannelAndSampleRateConverterCommon
+	TInt Convert(const TDesC8& aSrcBuffer, TDes8& aDstBuffer);
+	TInt MaxConvertBufferSize(TInt aSrcBufferSize, TBool aRoundUpToPower);
+	};
+
+NONSHARABLE_CLASS( CStereoToStereoRateConverter ) : public CChannelAndSampleRateConvert
+	{
+public:
+	CStereoToStereoRateConverter();
+	
+protected:
+	// from CChannelAndSampleRateConvert
+	TInt Convert(const TDesC8& aSrcBuffer, TDes8& aDstBuffer);
+	};
+
+NONSHARABLE_CLASS( CMonoToMonoRateConverter ) : public CChannelAndSampleRateConvert
+	{
+public:
+	CMonoToMonoRateConverter();
+	
+protected:
+	// from CChannelAndSampleRateConvert
+	TInt Convert(const TDesC8& aSrcBuffer, TDes8& aDstBuffer);
+	};
+
+NONSHARABLE_CLASS( CMonoToStereoConverter ) : public CChannelAndSampleRateConverterCommon
+	{
+public:
+	CMonoToStereoConverter();
+	
+protected:
+	// from CChannelAndSampleRateConverterCommon
+	TInt Convert(const TDesC8& aSrcBuffer, TDes8& aDstBuffer);
+	TInt MaxConvertBufferSize(TInt aSrcBufferSize, TBool aRoundUpToPower);
+	};
+
+NONSHARABLE_CLASS( CMonoToStereoRateConverter ) : public CChannelAndSampleRateConvert
+	{
+public:
+	CMonoToStereoRateConverter();
+	
+protected:
+	// from CChannelAndSampleRateConvert
+	TInt Convert(const TDesC8& aSrcBuffer, TDes8& aDstBuffer);
+	TInt MaxConvertBufferSize(TInt aSrcBufferSize, TBool aRoundUpToPower);
+	};
+
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmrenderer/unittest/bwins/tsu_omxil_pcmrenderer_01.def	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,3 @@
+EXPORTS
+	?NewTestSuiteL@@YAPAVCTestSuiteOmxILPcmRenderer@@XZ @ 1 NONAME ; class CTestSuiteOmxILPcmRenderer * NewTestSuiteL(void)
+
Binary file omxilcomp/omxilaudioemulator/pcmrenderer/unittest/data/pcm16stereo44khz.raw has changed
Binary file omxilcomp/omxilaudioemulator/pcmrenderer/unittest/data/pcm16stereo8khz.raw has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmrenderer/unittest/eabi/tsu_omxil_pcmrenderer_01.def	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,3 @@
+EXPORTS
+	_Z13NewTestSuiteLv @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmrenderer/unittest/group/bld.inf	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,28 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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_TESTEXPORTS
+../scripts/tsu_omxil_pcmrenderer_01.script		c:/omxil/tsu_omxil_pcmrenderer_01.script
+
+// Export test files
+../data/pcm16stereo8khz.raw		        	c:/omxil/testfiles/pcm16stereo8khz.raw
+../data/pcm16stereo44khz.raw		        	c:/omxil/testfiles/pcm16stereo44khz.raw
+
+// .iby
+tsu_omxil_components.iby                        	/epoc32/rom/include/tsu_omxil_components.iby
+
+PRJ_TESTMMPFILES
+../mmpfiles/tsu_omxil_pcmrenderer_01.mmp
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmrenderer/unittest/group/tsu_omxil_components.iby	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,24 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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 TSU_OMXIL_COMPONENTS_IBY
+#define TSU_OMXIL_COMPONENTS_IBY
+
+// OMX IL Components Unit tests and scripts
+
+file=ABI_DIR\BUILD_DIR\tsu_omxil_pcmrenderer_01.dll    System\Libs\tsu_omxil_pcmrenderer_01.dll
+data=EPOCROOT##epoc32\data\c\omxil\tsu_omxil_pcmrenderer_01.script        	\omxil\tsu_omxil_pcmrenderer_01.script
+
+#endif // TSU_OMXIL_COMPONENTS_IBY
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmrenderer/unittest/mmpfiles/tsu_omxil_pcmrenderer_01.mmp	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,51 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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 "../src/uids.hrh"
+
+TARGET                  tsu_omxil_pcmrenderer_01.dll
+CAPABILITY              ALL -TCB
+TARGETTYPE              dll
+UID                     KSharedLibraryUidDefine KUidTsuOmxILPcmRendererDll
+VENDORID 0x70000001
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+OS_LAYER_ESTLIB_SYSTEMINCLUDE
+
+USERINCLUDE		../src
+USERINCLUDE		../../src
+
+SOURCEPATH		../src
+SOURCE			tsu_omxil_component_base.cpp
+SOURCE			tsu_omxil_pcmrenderer_suite.cpp
+SOURCE			tsu_omxil_pcmrenderer_step.cpp
+
+LIBRARY		        euser.lib
+LIBRARY		        efsrv.lib
+LIBRARY		        ecom.lib
+LIBRARY		        testframeworkclient.lib
+LIBRARY             omxilcomponentcommon.lib
+LIBRARY			    mmfserverbaseclasses.lib
+STATICLIBRARY 	    omxilcomponentif.lib
+
+NOSTRICTDEF
+#ifdef EABI
+NOEXPORTLIBRARY
+#endif
+
+// Uncomment to activate debug tracing in this module
+// MACRO                   _OMXIL_AACUNIT_DEBUG_TRACING_ON
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmrenderer/unittest/scripts/tsu_omxil_pcmrenderer_01.script	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,91 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+LOAD_SUITE tsu_omxil_pcmrenderer_01.dll
+
+//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0020-HP
+
+RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0020-HP
+TEST_COMPLETE
+
+//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0021-HP
+
+RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0021-HP
+TEST_COMPLETE
+
+//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0022-HP
+
+RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0022-HP
+TEST_COMPLETE
+
+//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0001-HP
+
+RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0001-HP
+TEST_COMPLETE
+
+//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0002-HP
+
+RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0002-HP
+TEST_COMPLETE
+
+//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0003-HP
+
+RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0003-HP
+TEST_COMPLETE
+
+//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0004-HP
+
+RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0004-HP
+TEST_COMPLETE
+
+//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0005-HP
+
+RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0005-HP
+TEST_COMPLETE
+
+//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0006-HP
+
+RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0006-HP
+TEST_COMPLETE
+
+//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0007-HP
+
+RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0007-HP
+TEST_COMPLETE
+
+//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0008-HP
+
+RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0008-HP
+TEST_COMPLETE
+
+//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0009-HP
+
+RUN_TEST_STEP 30000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0009-HP
+TEST_COMPLETE
+
+//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0010-HP
+
+RUN_TEST_STEP 30000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0010-HP
+TEST_COMPLETE
+
+//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0030-HP
+
+RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0030-HP
+TEST_COMPLETE
+
+//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0031-HP
+
+RUN_TEST_STEP 30000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0031-HP
+TEST_COMPLETE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmrenderer/unittest/src/log.h	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,146 @@
+// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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 __SWI_LOG_H__
+#define __SWI_LOG_H__
+
+#include <e32debug.h>
+
+class TTruncateOverflowHandler16 : public TDes16Overflow
+	{
+	public:
+		virtual void Overflow( TDes16& aDes );
+	};
+	
+inline void TTruncateOverflowHandler16::Overflow( TDes16& aDes)
+	{
+	_LIT(KErrOverflowMsg,"Descriptor Overflow, hence value truncated");
+	if( aDes.MaxLength() >= KErrOverflowMsg().Length() + aDes.Length() )
+     	aDes.Append(KErrOverflowMsg);
+	}
+	
+class TTruncateOverflowHandler8 : public TDes8Overflow
+	{
+	public:
+		virtual void Overflow( TDes8& aDes );
+	};
+	
+inline void TTruncateOverflowHandler8::Overflow( TDes8& aDes)
+	{
+    _LIT(KErrOverflowMsg,"Descriptor Overflow, hence value truncated");
+	if( aDes.MaxLength() >= KErrOverflowMsg().Length() + aDes.Length() )
+     	aDes.Append(KErrOverflowMsg);
+	}
+
+namespace DSD
+{
+
+#ifdef _DEBUG
+
+#ifdef _OMXIL_AACUNIT_DEBUG_TRACING_ON
+
+#define DEBUG_PRINTF(a) {DSD::DebugPrintf(__LINE__, __FILE__, a);}
+#define DEBUG_PRINTF2(a, b) {DSD::DebugPrintf(__LINE__, __FILE__, a, b);}
+#define DEBUG_PRINTF3(a, b, c) {DSD::DebugPrintf(__LINE__, __FILE__, a, b, c);}
+#define DEBUG_PRINTF4(a, b, c, d) {DSD::DebugPrintf(__LINE__, __FILE__, a, b, c, d);}
+#define DEBUG_PRINTF5(a, b, c, d, e) {DSD::DebugPrintf(__LINE__, __FILE__, a, b, c, d, e);}
+
+#define DEBUG_CODE_SECTION(a) TRAP_IGNORE({ a; }) 
+
+// UTF-8 overload of the DebufPrintf method. Should be used by default,
+// since it's cheaper both in CPU cycles and stack space.
+
+inline void DebugPrintf(TInt aLine, char* aFile, TRefByValue<const TDesC8> aFormat, ...)
+	{
+	TTruncateOverflowHandler8 overflowHandler8;
+	VA_LIST list;
+	VA_START(list, aFormat);
+	
+	TTime now;
+	now.HomeTime();
+	
+	TBuf8<1024> buffer;
+	_LIT8(KSwiLogPrefix, "[aacunit] ");
+	_LIT8(KSwiLineFileFormat, "TID[%d] : [%s:%d] -- ");
+	buffer.Append(KSwiLogPrefix);
+	RThread thread;
+	TUint threadId = thread.Id();
+	thread.Close();
+	RProcess proc;
+	TFileName fName = proc.FileName();
+	proc.Close();
+	buffer.AppendFormat(KSwiLineFileFormat, threadId, aFile, aLine);
+	buffer.AppendFormatList(aFormat, list ,&overflowHandler8 );
+	buffer.Append(_L8("\r\n"));
+	
+	RDebug::RawPrint(buffer);
+	
+	VA_END(list);
+	}
+	
+// Unicode DebufPrintf overload
+
+inline void DebugPrintf(TInt aLine, char* aFile, TRefByValue<const TDesC16> aFormat, ...)
+	{
+	TTruncateOverflowHandler16 overflowHandler16;
+	VA_LIST list;
+	VA_START(list, aFormat);
+	
+	TTime now;
+	now.HomeTime();
+	
+	TBuf8<256> header;
+	_LIT8(KSwiLogPrefix, "[aacunit] ");
+	_LIT8(KSwiLineFileFormat, "%Ld Line: % 5d, File: %s -- ");
+	header.Append(KSwiLogPrefix);
+	header.AppendFormat(KSwiLineFileFormat, now.Int64(), aLine, aFile);
+	
+	TBuf<1024> buffer;
+	buffer.Copy(header);
+	buffer.AppendFormatList(aFormat, list ,&overflowHandler16);
+	buffer.Append(_L("\r\n"));
+	
+	RDebug::RawPrint(buffer);
+	
+	VA_END(list);
+	}
+#else
+
+#define DEBUG_PRINTF(a)
+#define DEBUG_PRINTF2(a, b)
+#define DEBUG_PRINTF3(a, b, c)
+#define DEBUG_PRINTF4(a, b, c, d)
+#define DEBUG_PRINTF5(a, b, c, d, e)
+
+#define DEBUG_CODE_SECTION(a)
+
+#endif
+
+#else
+
+#define DEBUG_PRINTF(a)
+#define DEBUG_PRINTF2(a, b)
+#define DEBUG_PRINTF3(a, b, c)
+#define DEBUG_PRINTF4(a, b, c, d)
+#define DEBUG_PRINTF5(a, b, c, d, e)
+
+#define DEBUG_CODE_SECTION(a)
+
+#endif
+
+
+} // namespace DSD
+
+#endif // __SWI_LOG_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmrenderer/unittest/src/tsu_omxil_component_base.cpp	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,879 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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
+ @internalComponent
+*/
+
+#include <mmf/server/mmfbuffer.h>
+#include <mmf/server/mmfdatabuffer.h>
+
+#include <ecom/ecom.h>
+#include <openmax/il/khronos/v1_x/OMX_Component.h>
+#include <openmax/il/loader/omxilcomponentif.h>
+
+#include "log.h"
+#include "tsu_omxil_component_base.h"
+
+
+const TInt CCallbackHandler::KMaxMsgQueueEntries;
+
+
+CAacTestFile*
+CAacTestFile::NewL()
+	{
+    DEBUG_PRINTF(_L8("CAacTestFile::NewL"));
+	CAacTestFile* self = new (ELeave) CAacTestFile();
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+void
+CAacTestFile::ConstructL()
+	{
+    DEBUG_PRINTF(_L8("CAacTestFile::ConstructL"));
+	}
+
+CAacTestFile::CAacTestFile() :
+	iSourceFile(0),
+	iSourceFileReadPos(0),
+	iFinished(EFalse)
+	{
+    DEBUG_PRINTF(_L8("CAacTestFile::CAacTestFile"));
+	}
+
+CAacTestFile::~CAacTestFile()
+	{
+    DEBUG_PRINTF(_L8("CAacTestFile::~CAacTestFile"));
+
+	delete iSourceFile;
+
+	}
+
+TInt
+CAacTestFile::ReadTestFileInBuffer(const TDesC& aFileName)
+	{
+    DEBUG_PRINTF(_L8("CAacTestFile::ReadTestFileInBuffer"));
+
+	RFs fs;
+	TInt err;
+	err = fs.Connect();
+	
+	if (err != KErrNone)
+		{
+		return err;
+		}
+	
+	RFile file;
+	err = file.Open(fs, aFileName, EFileRead);
+	
+	if (err == KErrNone)
+		{
+		TInt size;
+		err = file.Size(size);
+		if (err == KErrNone)
+			{
+			iSourceFile = HBufC8::NewMax(size);
+			if(!iSourceFile)
+				{
+				return KErrNoMemory;
+				}
+			TPtr8 ptr = iSourceFile->Des();
+			file.Read(ptr,size);
+			file.Close();
+			}
+		fs.Close();
+		}
+
+    return err;
+
+	}
+
+
+void
+CAacTestFile::ReadNextBuffer(CMMFBuffer& aDataBuffer)
+    {
+    DEBUG_PRINTF(_L8("CAacTestFile::ReadNextBuffer"));
+
+	CMMFDataBuffer* pDataBuffer = static_cast<CMMFDataBuffer*>(&aDataBuffer);
+    while (ETrue)
+		{
+		// check if finished
+		if (iFinished)
+			{
+			DEBUG_PRINTF(_L8("CAacTestFile::ReadNextBuffer : File finished"));
+			pDataBuffer->Data().Zero();
+			return;
+			}
+
+		TInt srcLength = iSourceFile->Size();
+		if (iSourceFileReadPos < srcLength)
+			{
+			TInt size = srcLength;
+			if (size > pDataBuffer->Data().MaxLength())
+				{
+				size = pDataBuffer->Data().MaxLength();
+				}
+			Mem::Copy((TAny*)pDataBuffer->Data().Ptr(), (TAny*)iSourceFile->Mid(iSourceFileReadPos).Ptr(), size);
+			pDataBuffer->Data().SetLength(size);
+			iSourceFileReadPos += size;
+			DEBUG_PRINTF2(_L8("CAacTestFile::ReadNextBuffer : data read = [%d] bytes"), iSourceFileReadPos);
+			DEBUG_PRINTF2(_L8("CAacTestFile::ReadNextBuffer : pDataBuffer->BufferSize = [%u] bytes"), pDataBuffer->BufferSize());
+			if (iSourceFileReadPos >= srcLength)
+				{
+				DEBUG_PRINTF(_L8("CAacTestFile::ReadNextBuffer : end of data"));
+				pDataBuffer->SetLastBuffer(ETrue);
+				iFinished = ETrue;
+				}
+			return;
+
+			}
+		else
+			{
+			// no more data
+			DEBUG_PRINTF(_L8("CAacTestFile::ReadNextBuffer : end of data"));
+			iFinished = ETrue;
+			return;
+			}
+		}
+    }
+
+void
+CAacTestFile::ResetPos()
+	{
+	iSourceFileReadPos = 0;
+	iFinished = EFalse;
+	}
+
+TInt
+CAacTestFile::GetPos()
+	{
+	return iSourceFileReadPos;
+	}
+
+
+CAacOutputTestFile*
+CAacOutputTestFile::NewL()
+	{
+    DEBUG_PRINTF(_L8("CAacOutputTestFile::NewL"));
+	CAacOutputTestFile* self = new (ELeave) CAacOutputTestFile();
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+void
+CAacOutputTestFile::ConstructL()
+	{
+    DEBUG_PRINTF(_L8("CAacOutputTestFile::ConstructL"));
+	}
+
+CAacOutputTestFile::CAacOutputTestFile() :
+	iFileServerSession(),
+	iOutputFile(),
+	iWrittenDataTotal(0),
+	iBuffersWrittenCount(0)
+	{
+    DEBUG_PRINTF(_L8("CAacOutputTestFile::CAacOutputTestFile"));
+	}
+
+CAacOutputTestFile::~CAacOutputTestFile()
+	{
+    DEBUG_PRINTF(_L8("CAacOutputTestFile::~CAacOutputTestFile"));
+	}
+
+TInt
+CAacOutputTestFile::SetUpOutputFile(const TDesC& aFileName)
+	{
+    DEBUG_PRINTF(_L8("CAacOutputTestFile::SetUpOutputFile"));
+
+	TInt err;
+	
+	err = iFileServerSession.Connect();
+
+	if (err != KErrNone)
+		{
+		return err;
+		}
+		
+	err = iOutputFile.Create(iFileServerSession,
+ 			   					  aFileName,
+ 			   					  EFileWrite|EFileShareExclusive);
+	if(err != KErrNone)
+		{
+		err = iOutputFile.Replace(iFileServerSession,
+							aFileName,
+							EFileWrite|EFileShareExclusive);
+		}
+	return err;
+
+	}
+
+TInt
+CAacOutputTestFile::WriteDataToFile(const CMMFBuffer& aDataBuffer)
+	{
+    DEBUG_PRINTF(_L8("CAacOutputTestFile::WriteDataToFile"));
+
+	const CMMFDataBuffer& dataBuffer = static_cast<const CMMFDataBuffer&>(aDataBuffer);
+	const TDesC8& data = dataBuffer.Data();
+
+	TInt err = KErrNone;
+	err = iOutputFile.Write(data);
+	if(err != KErrNone)
+		{
+		return err;
+		}
+	// keep record of amount of data and the number of buffers written out
+	iWrittenDataTotal += data.Size();
+	iBuffersWrittenCount++;
+
+    DEBUG_PRINTF2(_L8("CAacOutputTestFile::WriteDataToFile : data.Size()[%d]"), data.Size());
+    DEBUG_PRINTF2(_L8("CAacOutputTestFile::WriteDataToFile : iWrittenDataTotal[%d]"), iWrittenDataTotal);
+	DEBUG_PRINTF2(_L8("CAacOutputTestFile::WriteDataToFile : iBuffersWrittenCount[%d]"), iBuffersWrittenCount);
+
+	return err;
+
+	}
+
+
+TInt
+CAacOutputTestFile::AddWavHeader()
+	{
+    DEBUG_PRINTF(_L8("CAacOutputTestFile::AddWavHeader"));
+
+	TInt err;
+	RFs fs;
+	err = fs.Connect();
+	
+	if (err != KErrNone)
+		{
+		return err;
+		}
+		
+	RFile file;
+	err = file.Open(fs, KAacDecoderOutputTestFile, EFileRead);
+	if (err != KErrNone)
+		{
+		return err;
+		}
+
+	TInt size;
+	err = file.Size(size);
+	if (err != KErrNone)
+		{
+		return err;
+		}
+
+	HBufC8* rawDecFile = HBufC8::NewMax(size);
+	if(!rawDecFile)
+		{
+		return KErrNoMemory;
+		}
+
+	TPtr8 ptr = rawDecFile->Des();
+	file.Read(ptr,size);
+	file.Close();
+
+	// add headers
+	err = file.Replace(fs, KAacDecoderOutputTestFile, EFileWrite);
+	if (err != KErrNone)
+		{
+		return err;
+		}
+
+	// this is canonical WAV file format header
+	TInt32 chunkSize = size + KTestWavFormatPCMChunkHeaderSize;
+	TInt32 subchunk1size = KTestWavFormatPCMSubchunk1Size;
+	TInt16 audioFormat = KTestAudioFormatPCM;
+	TInt16 numChannels = KTestNumChannels;
+	TInt32 sampleRate = KTestSampleRate;
+	TInt16 bitsPerSample = KTestBitsPerSample;
+	TInt32 byteRate = sampleRate * numChannels * (bitsPerSample / 8);
+	TInt16 blockAlign = numChannels * (bitsPerSample / 8);
+	TInt32 subchunk2size = size;
+
+	file.Write(_L8("RIFF"));
+	{ TPtrC8 buf((TText8*)&chunkSize,sizeof(TInt32)); file.Write(buf); }
+	file.Write(_L8("WAVEfmt "));
+	{ TPtrC8 buf((TText8*)&subchunk1size,sizeof(TInt32)); file.Write(buf); }
+	{ TPtrC8 buf((TText8*)&audioFormat,sizeof(TInt16)); file.Write(buf); }
+	{ TPtrC8 buf((TText8*)&numChannels,sizeof(TInt16)); file.Write(buf); }
+	{ TPtrC8 buf((TText8*)&sampleRate,sizeof(TInt32)); file.Write(buf); }
+	{ TPtrC8 buf((TText8*)&byteRate,sizeof(TInt32)); file.Write(buf); }
+	{ TPtrC8 buf((TText8*)&blockAlign,sizeof(TInt16)); file.Write(buf); }
+	{ TPtrC8 buf((TText8*)&bitsPerSample,sizeof(TInt16)); file.Write(buf); }
+	file.Write(_L8("data"));
+	{ TPtrC8 buf((TText8*)&subchunk2size,sizeof(TInt32)); file.Write(buf); }
+	file.Write(ptr,size);
+
+	// store file size
+	file.Size(iWrittenDataTotal);
+
+	file.Close();
+	fs.Close();
+
+	delete rawDecFile;
+
+	return KErrNone;
+
+	}
+
+void
+CAacOutputTestFile::CloseOutputFile()
+	{
+    DEBUG_PRINTF(_L8("CAacOutputTestFile::CloseOutputFile"));
+
+	iOutputFile.Close();
+	iFileServerSession.Close();
+
+	}
+
+//
+// CUtilityTimer
+//
+CUtilityTimer*
+CUtilityTimer::NewL(TTimeIntervalMicroSeconds32& aDelay,
+					MTimerObserver& aObserver)
+    {
+    CUtilityTimer* self = new (ELeave) CUtilityTimer(aObserver);
+    CleanupStack::PushL(self);
+    self->ConstructL(aDelay);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+void
+CUtilityTimer::ConstructL(TTimeIntervalMicroSeconds32& aDelay)
+    {
+    CTimer::ConstructL();
+
+    iDelay = aDelay;
+    CActiveScheduler::Add(this);
+    }
+
+CUtilityTimer::~CUtilityTimer()
+    {
+    Cancel();
+    }
+
+void
+CUtilityTimer::InitializeTimer()
+    {
+	// Request another wait - assume not active
+	CTimer::After(iDelay);
+    }
+
+void
+CUtilityTimer::RunL()
+    {
+	if (iStatus.Int() == KErrNone)
+		iObserver.TimerExpired();
+    }
+
+void
+CUtilityTimer::DoCancel()
+	{
+	}
+
+
+CUtilityTimer::CUtilityTimer(MTimerObserver& aObserver) :
+	CTimer(CActive::EPriorityUserInput),
+    iObserver(aObserver)
+	{
+    }
+
+//
+// CCallbackHandler
+//
+CCallbackHandler*
+CCallbackHandler::NewL(RAsyncTestStepOmxILComponentBase& aDecoderTest)
+	{
+    DEBUG_PRINTF(_L8("CCallbackHandler::NewL"));
+
+	CCallbackHandler* self = new (ELeave) CCallbackHandler(aDecoderTest);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+
+	}
+
+
+void
+CCallbackHandler::ConstructL()
+	{
+    DEBUG_PRINTF(_L8("CCallbackHandler::ConstructL"));
+
+	OMX_CALLBACKTYPE h =
+		{
+		CCallbackHandler::EventHandler,
+		CCallbackHandler::EmptyBufferDone,
+		CCallbackHandler::FillBufferDone
+		};
+
+	iHandle = h;
+	CActiveScheduler::Add(this);
+
+	User::LeaveIfError(iMsgQueue.CreateLocal(KMaxMsgQueueEntries));
+	iMsgQueue.NotifyDataAvailable(iStatus);
+	SetActive();
+
+	}
+
+CCallbackHandler::CCallbackHandler(RAsyncTestStepOmxILComponentBase& aDecoderTest)
+	: CActive(EPriorityNormal),
+	  iDecoderTest(aDecoderTest)
+	{
+    DEBUG_PRINTF(_L8("CCallbackHandler::CCallbackHandler"));
+	}
+
+
+CCallbackHandler::operator OMX_CALLBACKTYPE*()
+	{
+    DEBUG_PRINTF(_L8("CCallbackHandler::operator OMX_CALLBACKTYPE*"));
+
+	return &iHandle;
+
+	}
+
+
+void
+CCallbackHandler::RunL()
+	{
+    DEBUG_PRINTF(_L8("CCallbackHandler::RunL"));
+
+	TOmxMessage msg;
+	while (iMsgQueue.Receive(msg)==KErrNone)
+		{
+		switch (msg.iType)
+			{
+		case EEmptyBufferCallback:
+			{
+			iDecoderTest.DoEmptyBufferDoneL(msg.iComponent,
+											msg.iBuffer);
+			}
+			break;
+		case EFillBufferCallback:
+			{
+			iDecoderTest.DoFillBufferDoneL(msg.iComponent,
+										   msg.iBuffer);
+			}
+			break;
+		case EEventCallback:
+			{
+			iDecoderTest.DoEventHandlerL(msg.iComponent,
+										 msg.iEventParams.iEvent,
+										 msg.iEventParams.iData1,
+										 msg.iEventParams.iData2,
+										 msg.iEventParams.iExtra);
+			}
+			break;
+		default:
+			{
+			// This is an invalid state
+			ASSERT(EFalse);
+			}
+			};
+		}
+
+	// setup for next callbacks
+	iStatus = KRequestPending;
+	iMsgQueue.NotifyDataAvailable(iStatus);
+	SetActive();
+
+	}
+
+CCallbackHandler::~CCallbackHandler()
+	{
+    DEBUG_PRINTF(_L8("CCallbackHandler::~CCallbackHandler"));
+
+	Cancel();
+	iMsgQueue.Close();
+
+	}
+
+
+void
+CCallbackHandler::DoCancel()
+	{
+    DEBUG_PRINTF(_L8("CCallbackHandler::DoCancel"));
+
+	if (iMsgQueue.Handle())
+		{
+		iMsgQueue.CancelDataAvailable();
+		}
+
+	}
+
+OMX_ERRORTYPE
+CCallbackHandler::FillBufferDone(OMX_HANDLETYPE aComponent,
+								 TAny* aAppData,
+								 OMX_BUFFERHEADERTYPE* aBuffer)
+	{
+    DEBUG_PRINTF(_L8("CCallbackHandler::FillBufferDone"));
+
+	return static_cast<CCallbackHandler*>(aAppData)->DoFillBufferDone(aComponent, aBuffer);
+
+	}
+
+OMX_ERRORTYPE
+CCallbackHandler::EmptyBufferDone(OMX_HANDLETYPE aComponent,
+								  TAny* aAppData,
+								  OMX_BUFFERHEADERTYPE* aBuffer)
+	{
+    DEBUG_PRINTF(_L8("CCallbackHandler::EmptyBufferDone"));
+
+	return static_cast<CCallbackHandler*>(aAppData)->DoEmptyBufferDone(aComponent, aBuffer);
+
+	}
+
+OMX_ERRORTYPE
+CCallbackHandler::EventHandler(OMX_HANDLETYPE aComponent,
+							   TAny* aAppData,
+							   OMX_EVENTTYPE aEvent,
+							   TUint32 aData1,
+							   TUint32 aData2,
+							   TAny* aExtra)
+	{
+    DEBUG_PRINTF4(_L8("CCallbackHandler::EventHandler : EVENT[%d] Data1[%d] Data2[%d]"), aExtra, aData1, aData2);
+
+	CCallbackHandler::TEventParams eventParams;
+	eventParams.iEvent = aEvent;
+	eventParams.iData1 = aData1;
+	eventParams.iData2 = aData2;
+	eventParams.iExtra = aExtra;
+	return static_cast<CCallbackHandler*>(aAppData)->DoEventHandler(aComponent, eventParams);
+
+	}
+
+OMX_ERRORTYPE
+CCallbackHandler::DoFillBufferDone(OMX_HANDLETYPE aComponent,
+								   OMX_BUFFERHEADERTYPE* aBuffer)
+	{
+    DEBUG_PRINTF(_L8("CCallbackHandler::DoFillBufferDone"));
+
+	TOmxMessage message;
+	message.iType = EFillBufferCallback;
+	message.iComponent = aComponent;
+	message.iBuffer = aBuffer;
+	return RAsyncTestStepOmxILComponentBase::ConvertSymbianErrorType(
+		iMsgQueue.Send(message));
+
+	}
+
+OMX_ERRORTYPE
+CCallbackHandler::DoEmptyBufferDone(OMX_HANDLETYPE aComponent,
+									OMX_BUFFERHEADERTYPE* aBuffer)
+	{
+    DEBUG_PRINTF(_L8("CCallbackHandler::DoEmptyBufferDone"));
+
+	TOmxMessage message;
+	message.iType = EEmptyBufferCallback;
+	message.iComponent = aComponent;
+	message.iBuffer = aBuffer;
+	return RAsyncTestStepOmxILComponentBase::ConvertSymbianErrorType(
+		iMsgQueue.Send(message));
+
+	}
+
+OMX_ERRORTYPE
+CCallbackHandler::DoEventHandler(OMX_HANDLETYPE aComponent,
+								 TEventParams aEventParams)
+	{
+    DEBUG_PRINTF(_L8("CCallbackHandler::DoEventHandler"));
+
+	TOmxMessage message;
+	message.iType = EEventCallback;
+	message.iComponent = aComponent;
+	message.iEventParams = aEventParams;
+	return RAsyncTestStepOmxILComponentBase::ConvertSymbianErrorType(
+		iMsgQueue.Send(message));
+
+	}
+
+//
+// RAsyncTestStepOmxILComponentBase
+//
+RAsyncTestStepOmxILComponentBase::RAsyncTestStepOmxILComponentBase(const TDesC& aTestName, TInt aComponentUid)
+	:
+	iComponentUid(),
+	ipKickoffAOp(0),
+	ipKickoffStop(0),
+	ipCOmxILComponent(0),
+	ipCallbackHandler(0),
+	ipTestFile(0),
+	iTestFileName(KAacDecoderTestFile()),
+	ipCompHandle(0)
+	{
+    DEBUG_PRINTF2(_L8("RAsyncTestStepOmxILComponentBase::RAsyncTestStepOmxILComponentBase: UID[%X]"), aComponentUid);
+	iTestStepName = aTestName;
+	iComponentUid = aComponentUid;
+	// Default heap size is 32K. Increased to avoid the KErrNoMemory for this test step.
+	iHeapSize = KTestHeapSize;
+
+	}
+
+RAsyncTestStepOmxILComponentBase::~RAsyncTestStepOmxILComponentBase()
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::~RAsyncTestStepOmxILComponentBase"));
+	// nothing here just yet
+	}
+
+void
+RAsyncTestStepOmxILComponentBase::PrintOmxState(OMX_STATETYPE aOmxState)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::PrintOmxState"));
+
+	switch(aOmxState)
+		{
+    case OMX_StateInvalid:
+		{
+		INFO_PRINTF1(_L("OMX STATE : OMX_StateInvalid"));
+		}
+		break;
+    case OMX_StateLoaded:
+		{
+		INFO_PRINTF1(_L("OMX STATE : OMX_StateLoaded"));
+		}
+		break;
+    case OMX_StateIdle:
+		{
+		INFO_PRINTF1(_L("OMX STATE : OMX_StateIdle"));
+		}
+		break;
+    case OMX_StateExecuting:
+		{
+		INFO_PRINTF1(_L("OMX STATE : OMX_StateExecuting"));
+		}
+		break;
+    case OMX_StatePause:
+		{
+		INFO_PRINTF1(_L("OMX STATE : OMX_StatePause"));
+		}
+		break;
+    case OMX_StateWaitForResources:
+		{
+		INFO_PRINTF1(_L("OMX STATE : OMX_StateWaitForResources"));
+		}
+		break;
+	default:
+		{
+		INFO_PRINTF1(_L("OMX STATE : Wrong state found"));
+		}
+		};
+
+	}
+
+OMX_ERRORTYPE
+RAsyncTestStepOmxILComponentBase::ConvertSymbianErrorType(TInt aError)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::ConvertSymbianErrorType"));
+
+	OMX_ERRORTYPE err = OMX_ErrorNone;
+	switch (aError)
+		{
+	case KErrNone:
+		err = OMX_ErrorNone;
+		break;
+	case KErrNoMemory:
+		err = OMX_ErrorInsufficientResources;
+		break;
+	case KErrGeneral:
+		break;
+	default:
+		err = OMX_ErrorUndefined;
+		}
+	return err;
+
+	}
+
+
+/**
+   This method is used at the beginning of the test, and initialises the
+   asynchronous calls that will be activated once the call returns. The
+   ActiveScheduler is active at this point.  If this test leaves, then
+   StopTest() will be called with the leave value, so implicitly the test
+   stops.
+
+*/
+void
+RAsyncTestStepOmxILComponentBase::KickoffTestL()
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::KickoffTestL"));
+
+	__MM_HEAP_MARK;
+
+	// Set up an asynchronous call
+	TCallBack callback (ComponentBaseCallBack, this);
+	delete ipKickoffAOp;
+	ipKickoffAOp = NULL;
+	ipKickoffAOp =
+		new (ELeave) CAsyncCallBack (callback, CActive::EPriorityLow);
+	// Queues this active object to be run once.
+	ipKickoffAOp->Call();
+
+	}
+
+TInt
+RAsyncTestStepOmxILComponentBase::ComponentBaseCallBack(TAny* aPtr)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::ComponentBaseCallBack"));
+
+	RAsyncTestStepOmxILComponentBase* self = static_cast<RAsyncTestStepOmxILComponentBase*> (aPtr);
+	self->DoComponentBaseCallBack();
+	return KErrNone;
+
+	}
+
+void
+RAsyncTestStepOmxILComponentBase::DoComponentBaseCallBack()
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::DoComponentBaseCallBack"));
+
+	TRAPD(err, ipCOmxILComponent =
+		  COmxILComponentIf::CreateImplementationL(TUid::Uid(iComponentUid)));
+
+	//return StopTest(err, EFail);
+	if (err != KErrNone)
+		{
+		INFO_PRINTF2(_L("RAsyncTestStepOmxILComponentBase::DoComponentBaseCallBack : err [%d]"), err);
+		if (KErrNotFound == err)
+			{
+			INFO_PRINTF1(_L("DoComponentBaseCallBack : CreateImplementationL returned KErrNotFound"));
+// PacketVideo's AAC decoder libraries only provided for UDEB
+#ifndef _DEBUG
+			INFO_PRINTF1(_L("IMPORTANT NOTE : THIS SUITE CAN ONLY BE RUN IN UDEB MODE"));
+			INFO_PRINTF1(_L("IMPORTANT NOTE : PACKETVIDEO'S AAC DECODER LIBRARY ONLY AVAILABLE IN UDEB MODE"));
+#endif
+			}
+		return StopTest(err, EFail);
+		}
+
+	ipCompHandle = static_cast<OMX_COMPONENTTYPE*>(ipCOmxILComponent->Handle());
+	if (!ipCompHandle)
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	TRAP(err, ipCallbackHandler = CCallbackHandler::NewL(*this));
+	if (err != KErrNone)
+		{
+		return StopTest(err, EFail);
+		}
+
+	TRAP(err, ipTestFile = CAacTestFile::NewL());
+	if (err != KErrNone)
+		{
+		return StopTest(err, EFail);
+		}
+
+	err = ipTestFile->ReadTestFileInBuffer(iTestFileName);
+	if (err != KErrNone)
+		{
+		return StopTest(err, EFail);
+		}
+
+	TRAP(err, ipOutputTestFile = CAacOutputTestFile::NewL());
+	if (err != KErrNone)
+		{
+		return StopTest(err, EFail);
+		}
+
+	err = ipOutputTestFile->SetUpOutputFile(KAacDecoderOutputTestFile);
+	if (err != KErrNone)
+		{
+		return StopTest(err, EFail);
+		}
+
+
+	}
+
+TInt
+RAsyncTestStepOmxILComponentBase::StopTestCallBack(TAny* aPtr)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::StopTestCallBack"));
+	RAsyncTestStepOmxILComponentBase* self =
+		static_cast<RAsyncTestStepOmxILComponentBase*> (aPtr);
+	self->DoStopTestCallBack();
+	return KErrNone;
+	}
+
+void
+RAsyncTestStepOmxILComponentBase::DoStopTestCallBack()
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::DoStopTestCallBack"));
+
+	StopTest();
+
+	}
+
+
+void
+RAsyncTestStepOmxILComponentBase::CloseTest()
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::CloseTest"));
+
+    if (ipCompHandle)
+    	{
+    	ipCompHandle->ComponentDeInit(ipCompHandle);
+    	}
+	delete ipCOmxILComponent;
+	ipCOmxILComponent = 0;
+	ipCompHandle = 0;
+
+	delete ipKickoffAOp; // no need to Cancel
+	ipKickoffAOp = 0;
+
+	delete ipCallbackHandler;
+	ipCallbackHandler = 0;
+
+	delete ipTestFile;
+	ipTestFile = 0;
+
+	if (ipOutputTestFile)
+		{
+		ipOutputTestFile->CloseOutputFile();
+		// We ignore here this error...
+		TInt err = ipOutputTestFile->AddWavHeader();
+		delete ipOutputTestFile;
+		ipOutputTestFile = 0;
+		}
+
+	REComSession::FinalClose();
+	__MM_HEAP_MARKEND;
+
+	}
+
+void
+RAsyncTestStepOmxILComponentBase::DoFillBufferDoneL(OMX_HANDLETYPE /* aComponent */,
+												   OMX_BUFFERHEADERTYPE* /* aBuffer */)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::DoFillBufferDoneL"));
+	// By default, no callback expected here...
+	return StopTest(KErrGeneral, EFail);
+	}
+
+void
+RAsyncTestStepOmxILComponentBase::DoEmptyBufferDoneL(OMX_HANDLETYPE /* aComponent */,
+													OMX_BUFFERHEADERTYPE* /* aBuffer */)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::DoEmptyBufferDoneL"));
+	// By default, no callback expected here...
+	return StopTest(KErrGeneral, EFail);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmrenderer/unittest/src/tsu_omxil_component_base.h	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,275 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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 
+*/
+
+#ifndef TSU_OMXIL_COMPONENT_BASE_H
+#define TSU_OMXIL_COMPONENT_BASE_H
+
+#include <e32msgqueue.h>
+#include <testframework.h>
+#include <openmax/il/khronos/v1_x/OMX_Core.h>
+
+#include "tsu_omxil_component_constants.h"
+#include <openmax/il/common/omxilstatedefs.h>
+
+// Forward declarations
+class COmxILComponentIf;
+struct OMX_COMPONENTTYPE;
+class RAsyncTestStepOmxILComponentBase;
+class CMMFBuffer;
+
+
+class CAacTestFile : public CBase
+	{
+
+public:
+
+	static CAacTestFile* NewL();
+
+	~CAacTestFile();
+
+	TInt ReadTestFileInBuffer(const TDesC& aFileName);
+    void ReadNextBuffer(CMMFBuffer& aDataBuffer);
+    void ResetPos();
+    TInt GetPos();
+
+private:
+
+	CAacTestFile();
+	void ConstructL();
+
+
+private:
+
+	HBufC8* iSourceFile;
+	TInt iSourceFileReadPos;
+	TBool iFinished;
+
+	};
+
+
+class CAacOutputTestFile : public CBase
+	{
+
+public:
+
+	static CAacOutputTestFile* NewL();
+
+	~CAacOutputTestFile();
+
+	TInt SetUpOutputFile(const TDesC& aFileName);
+	TInt WriteDataToFile(const CMMFBuffer& aDataBuffer);
+	TInt AddWavHeader();
+	void CloseOutputFile();
+
+private:
+
+	CAacOutputTestFile();
+	void ConstructL();
+
+
+private:
+
+	RFs iFileServerSession;
+	RFile iOutputFile;
+	TInt iWrittenDataTotal;
+	TInt iBuffersWrittenCount;
+
+	};
+
+class MTimerObserver
+	{
+
+public:
+
+	virtual void TimerExpired() = 0;
+
+	};
+
+class CUtilityTimer : public CTimer
+	{
+
+public:
+
+	static CUtilityTimer* NewL(TTimeIntervalMicroSeconds32& aDelay,
+							   MTimerObserver& aObserver);
+	~CUtilityTimer();
+
+	void InitializeTimer();
+
+private:
+
+    CUtilityTimer(MTimerObserver& aObserver);
+    void ConstructL(TTimeIntervalMicroSeconds32& aDelay);
+
+	// from CActive
+    void RunL();
+	void DoCancel();
+
+private:
+
+    TTimeIntervalMicroSeconds32 iDelay;
+	MTimerObserver& iObserver;
+
+    };
+
+
+class CCallbackHandler : public CActive
+	{
+public:
+
+	enum TMessageType
+		{
+		EFillBufferCallback,
+		EEmptyBufferCallback,
+		EEventCallback
+		};
+
+	class TEventParams
+		{
+	public:
+		OMX_EVENTTYPE iEvent;
+		TUint iData1;
+		TUint iData2;
+		TAny* iExtra;
+		};
+
+	class TOmxMessage
+		{
+	public:
+		TMessageType iType;
+		OMX_HANDLETYPE iComponent;
+		union
+			{
+			OMX_BUFFERHEADERTYPE* iBuffer;
+			TEventParams iEventParams;
+			};
+		};
+
+
+	static const TInt KMaxMsgQueueEntries = 10;
+
+public:
+
+	static CCallbackHandler* NewL(RAsyncTestStepOmxILComponentBase& aDecoderTest);
+	virtual ~CCallbackHandler();
+
+	operator OMX_CALLBACKTYPE*();
+
+	void RunL();
+	void DoCancel();
+
+	static OMX_ERRORTYPE FillBufferDone(OMX_HANDLETYPE aComponent,
+										TAny* aAppData,
+										OMX_BUFFERHEADERTYPE* aBuffer);
+
+	static OMX_ERRORTYPE EmptyBufferDone(OMX_HANDLETYPE aComponent,
+										 TAny* aAppData,
+										 OMX_BUFFERHEADERTYPE* aBuffer);
+
+	static OMX_ERRORTYPE EventHandler(OMX_HANDLETYPE aComponent,
+									  TAny* aAppData,
+									  OMX_EVENTTYPE aEvent,
+									  TUint32 aData1,
+									  TUint32 aData2,
+									  TAny* aExtra);
+
+
+private:
+
+	void ConstructL();
+	CCallbackHandler(RAsyncTestStepOmxILComponentBase& aDecoderTest);
+
+	OMX_ERRORTYPE DoFillBufferDone(OMX_HANDLETYPE aComponent,
+								   OMX_BUFFERHEADERTYPE* aBuffer);
+	OMX_ERRORTYPE DoEmptyBufferDone(OMX_HANDLETYPE aComponent,
+									OMX_BUFFERHEADERTYPE* aBuffer);
+	OMX_ERRORTYPE DoEventHandler(OMX_HANDLETYPE aComponent,
+								 TEventParams aParams);
+
+	//
+	//
+	//
+
+
+private:
+
+	RAsyncTestStepOmxILComponentBase& iDecoderTest;
+	RMsgQueue<TOmxMessage> iMsgQueue;
+	OMX_CALLBACKTYPE iHandle;
+
+	};
+
+
+class RAsyncTestStepOmxILComponentBase : public RAsyncTestStep
+	{
+
+public:
+
+	RAsyncTestStepOmxILComponentBase(const TDesC& aTestName, TInt aComponentUid);
+
+	~RAsyncTestStepOmxILComponentBase();
+
+	// From RAsyncTestStep
+	void KickoffTestL();
+	void CloseTest();
+
+	//
+	virtual void DoFillBufferDoneL(OMX_HANDLETYPE aComponent,
+								  OMX_BUFFERHEADERTYPE* aBuffer);
+
+	virtual void DoEmptyBufferDoneL(OMX_HANDLETYPE aComponent,
+								   OMX_BUFFERHEADERTYPE* aBuffer);
+
+	virtual void DoEventHandlerL(OMX_HANDLETYPE aComponent,
+								OMX_EVENTTYPE aEvent,
+								TUint aData1,
+								TUint aData2,
+								TAny* aExtra) = 0;
+
+
+	static OMX_ERRORTYPE ConvertSymbianErrorType(TInt aError);
+
+
+
+protected:
+
+	void PrintOmxState(OMX_STATETYPE aOmxState);
+
+	// Async Call backs
+	static TInt ComponentBaseCallBack(TAny* aPtr);
+	void DoComponentBaseCallBack();
+
+	static TInt StopTestCallBack(TAny* aPtr);
+	void DoStopTestCallBack();
+
+protected:
+
+	TInt iComponentUid;
+	CAsyncCallBack* ipKickoffAOp;
+	CAsyncCallBack* ipKickoffStop;
+	COmxILComponentIf* ipCOmxILComponent;
+	CCallbackHandler* ipCallbackHandler;
+	CAacTestFile* ipTestFile;
+	TPtrC iTestFileName;
+    CAacOutputTestFile* ipOutputTestFile;
+	OMX_COMPONENTTYPE* ipCompHandle;
+	};
+
+#endif // TSU_OMXIL_COMPONENT_BASE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmrenderer/unittest/src/tsu_omxil_component_constants.h	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,52 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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 
+*/
+
+#ifndef TSU_OMXIL_COMPONENT_CONSTANTS_H
+#define TSU_OMXIL_COMPONENT_CONSTANTS_H
+
+_LIT(KAacDecoderTestFile, "c:\\omxil\\testfiles\\probando123.hev2.aac");
+_LIT(KAacDecoderOutputTestFile, "c:\\omxil\\testfiles\\omxilaacdecoderoutput.wav");
+
+const TInt KTestHeapSize = 0x400000;	// 4 Mb;
+
+// AudioSpecificConfig length (bytes) for probando123.hev2.aac
+const TInt		KAudioSpecificConfigLength = 7;
+
+// Wav header params... based on  probando123.hev2.aac...
+const TInt		KTestWavFormatPCMChunkHeaderSize = 36;
+const TInt		KTestWavFormatPCMSubchunk1Size	 = 16;
+const TInt		KTestAudioFormatPCM				 = 1;
+const TInt		KTestSampleRate					 = 44100;
+const TInt		KTestNumChannels				 = 2;
+const TInt		KTestBitsPerSample				 = 16;
+const TInt		KTestBitRate					 = 1411000;
+
+// These are two numbers that identify some input/output buffers in the middle
+// of the processing of a test file
+const TInt		KSomeInputBufferCount  = 15;
+const TInt		KSomeOutputBufferCount = 25;
+
+// Some time interval that can be used for timeouts...
+const TInt      KTwoPointFiveSeconds = 2500000;
+
+// Some other time interval that can be used for timeouts...
+const TInt      KPointFiveSeconds = 500000;
+
+#endif // TSU_OMXIL_COMPONENT_CONSTANTS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmrenderer/unittest/src/tsu_omxil_pcmrenderer_step.cpp	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,3977 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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
+ @internalComponent
+*/
+
+#include <e32base.h>
+#include <e32cmn.h>
+#include <mmf/server/mmfbuffer.h>
+#include <mmf/server/mmfdatabuffer.h>
+
+#include <openmax/il/khronos/v1_x/OMX_Component.h>
+#include <openmax/il/khronos/v1_x/OMX_Types.h>
+
+#include <openmax/il/loader/omxilcomponentif.h>
+#include <openmax/il/extensions/omxilsymbianaudiopcmextensions.h>
+
+#include "log.h"
+#include "omxilpcmrenderer.hrh"
+#include <openmax/il/common/omxilspecversion.h>
+
+#include "tsu_omxil_pcmrenderer_step.h"
+
+_LIT8(KSymbianOmxILPcmRendererRole, "audio_renderer.pcm");
+_LIT8(KTestOmxILWrongRendererRole, "audio_renderer.wrong");
+_LIT(KPcmRendererTestFile, "c:\\omxil\\testfiles\\pcm16stereo8khz.raw");
+_LIT(KPcmRendererTestFile2, "c:\\omxil\\testfiles\\pcm16stereo44khz.raw");
+
+OMX_ERRORTYPE ComponentInit(OMX_HANDLETYPE /*aComponent*/)
+	{
+	return OMX_ErrorNone;
+	}
+
+
+//
+// RAsyncTestStepOmxILPcmRenderer0020
+//
+RAsyncTestStepOmxILPcmRenderer0020::RAsyncTestStepOmxILPcmRenderer0020(const TDesC& aTestName, TInt aComponentUid)
+	:
+	RAsyncTestStepOmxILComponentBase(aTestName, aComponentUid),
+	ipKickoff01(NULL),
+	ipKickoff02(NULL),
+	ipKickoff03(NULL),
+	ipKickoff04(NULL),
+	ipKickoff05(NULL),
+	ipKickoff06(NULL)
+
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0020::RAsyncTestStepOmxILPcmRenderer0020"));
+	}
+
+
+void
+RAsyncTestStepOmxILPcmRenderer0020::KickoffTestL()
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0020::KickoffTestL"));
+
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test20  "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Init Component "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Obtain the component's state (GetState) "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Obtain the component's version (GetComponentVersion) "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Provide callbacks to component (SetCallbacks) "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 5.- Obtain the port def params for Port #0 (GetParameter) "));
+
+	// This will install one callback
+	RAsyncTestStepOmxILComponentBase::KickoffTestL();
+
+	// This is the only step in this test...
+	TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0020Step01, this);
+	delete ipKickoff01;
+	ipKickoff01 = NULL;
+	ipKickoff01 =
+		new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow);
+	ipKickoff01->Call();
+
+	// The successful termination...
+	TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this);
+	delete ipKickoffStop;
+	ipKickoffStop = NULL;
+	ipKickoffStop =
+		new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow);
+	ipKickoffStop->Call();
+
+	}
+
+void
+RAsyncTestStepOmxILPcmRenderer0020::CloseTest()
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0020::CloseTest"));
+
+	delete ipKickoff01; // no need to Cancel
+	ipKickoff01 = NULL;
+	delete ipKickoff02; // no need to Cancel
+	ipKickoff02 = NULL;
+	delete ipKickoff03; // no need to Cancel
+	ipKickoff03 = NULL;
+	delete ipKickoff04; // no need to Cancel
+	ipKickoff04 = NULL;
+	delete ipKickoff05; // no need to Cancel
+	ipKickoff05 = NULL;
+	delete ipKickoff06; // no need to Cancel
+	ipKickoff06 = NULL;
+
+	delete ipKickoffStop; // no need to Cancel
+	ipKickoffStop = 0;
+
+	RAsyncTestStepOmxILComponentBase::CloseTest();
+
+	}
+
+
+void
+RAsyncTestStepOmxILPcmRenderer0020::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/,
+											  OMX_EVENTTYPE /*aEvent*/,
+											  TUint /*aData1*/,
+											  TUint /*aData2*/,
+											  TAny* /*aExtra*/)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0020::DoEventHandlerL"));
+
+	// We don't expect here any callback
+	return StopTest(KErrGeneral, EFail);
+
+	}
+
+
+TInt
+RAsyncTestStepOmxILPcmRenderer0020::RAsyncTestStepOmxILPcmRenderer0020Step01(TAny* aPtr)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0020::RAsyncTestStepOmxILPcmRenderer0020Step01"));
+    RAsyncTestStepOmxILPcmRenderer0020* self =
+		static_cast<RAsyncTestStepOmxILPcmRenderer0020*> (aPtr);
+	self->DoRAsyncTestStepOmxILPcmRenderer0020Step01();
+	return KErrNone;
+	}
+
+void
+RAsyncTestStepOmxILPcmRenderer0020::DoRAsyncTestStepOmxILPcmRenderer0020Step01()
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0020::DoRAsyncTestStepOmxILPcmRenderer0020Step01"));
+
+
+	//
+	// Obtain the component's state
+	//
+	OMX_STATETYPE compState;
+	if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle,
+												&compState))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	PrintOmxState(compState);
+
+	if (OMX_StateLoaded != compState)
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	char componentNameArray[OMX_MAX_STRINGNAME_SIZE];
+	OMX_VERSIONTYPE componentVersion;
+	OMX_VERSIONTYPE specVersion;
+	OMX_UUIDTYPE componentUUID;
+
+	//
+	// Obtain the component's version
+	//
+
+	if (OMX_ErrorNone != ipCompHandle->GetComponentVersion(
+			ipCompHandle,
+			componentNameArray,
+			&componentVersion,
+			&specVersion,
+			&componentUUID))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	TBuf8<128> componentNameBuf8;
+	componentNameBuf8 = const_cast<const TUint8*>(reinterpret_cast<TUint8*>(componentNameArray));
+	TBuf<128> componentNameBuf16;
+	INFO_PRINTF2(_L("Component Name length: %d"), componentNameBuf8.Length());
+	componentNameBuf16.Copy(componentNameBuf8);
+	componentNameBuf16.PtrZ();
+
+	// INFO_PRINTF2(_L("Component Name: %s"), dst.Ptr());
+	INFO_PRINTF2(_L("Component Name: %S"), &componentNameBuf16);
+	INFO_PRINTF2(_L("Component Version Major: %d"), componentVersion.s.nVersionMajor);
+	INFO_PRINTF2(_L("Component Version Minor: %d"), componentVersion.s.nVersionMinor);
+	INFO_PRINTF2(_L("Component Version Revision: %d"), componentVersion.s.nRevision);
+	INFO_PRINTF2(_L("Component Version Step: %d"), componentVersion.s.nStep);
+	INFO_PRINTF2(_L("OMX Version Major: %d"), specVersion.s.nVersionMajor);
+	INFO_PRINTF2(_L("OMX Version Minor: %d"), specVersion.s.nVersionMinor);
+	INFO_PRINTF2(_L("OMX Version Revision: %d"), specVersion.s.nRevision);
+	INFO_PRINTF2(_L("OMX Version Step: %d"), specVersion.s.nStep);
+	INFO_PRINTF2(_L("Component UUID: %X"), componentUUID);
+
+
+	//
+	// Provide callbacks to component
+	//
+	OMX_CALLBACKTYPE* omxCallbacks = *ipCallbackHandler;
+
+	if (OMX_ErrorNone != ipCompHandle->SetCallbacks(
+			ipCompHandle,
+			omxCallbacks,
+			ipCallbackHandler))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	INFO_PRINTF2(_L("Component Callbacks set successfully: %X"), ipCallbackHandler);
+
+	//
+	// Obtain the port def params for Port #0
+	//
+	OMX_PARAM_PORTDEFINITIONTYPE portParamsInputPort;
+	portParamsInputPort.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE);
+	portParamsInputPort.nVersion = TOmxILSpecVersion();
+	portParamsInputPort.nPortIndex = 0;
+	if (OMX_ErrorNone != ipCompHandle->GetParameter(
+			ipCompHandle,
+			OMX_IndexParamPortDefinition,
+			&portParamsInputPort))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	INFO_PRINTF2(_L("PORTDEFINITIONTYPE nPortIndex: %d"), portParamsInputPort.nPortIndex);
+	INFO_PRINTF2(_L("PORTDEFINITIONTYPE eDir: %d"), portParamsInputPort.eDir);
+	INFO_PRINTF2(_L("PORTDEFINITIONTYPE nBufferCountActual: %d"), portParamsInputPort.nBufferCountActual);
+	INFO_PRINTF2(_L("PORTDEFINITIONTYPE nBufferCountMin: %d"), portParamsInputPort.nBufferCountMin);
+	INFO_PRINTF2(_L("PORTDEFINITIONTYPE nBufferSize: %d"), portParamsInputPort.nBufferSize);
+	INFO_PRINTF2(_L("PORTDEFINITIONTYPE bEnabled: %d"), portParamsInputPort.bEnabled == OMX_FALSE ? 0 : 1);
+	INFO_PRINTF2(_L("PORTDEFINITIONTYPE bPopulated: %d"), portParamsInputPort.bPopulated == OMX_FALSE ? 0 : 1);
+	INFO_PRINTF2(_L("PORTDEFINITIONTYPE eDomain: %d"), portParamsInputPort.eDomain);
+
+	TBuf8<128> cMIMEType8Input;
+	cMIMEType8Input = const_cast<const TUint8*>(reinterpret_cast<TUint8*>(portParamsInputPort.format.audio.cMIMEType));
+
+	TBuf<128> cMIMEType16Input;
+	cMIMEType16Input.Copy(cMIMEType8Input);
+	cMIMEType16Input.PtrZ();
+
+	INFO_PRINTF2(_L("PORTDEFINITIONTYPE format.cMIMEType: %S"), &cMIMEType16Input);
+	INFO_PRINTF2(_L("PORTDEFINITIONTYPE format.pNativeRender: %X"), portParamsInputPort.format.audio.pNativeRender);
+	INFO_PRINTF2(_L("PORTDEFINITIONTYPE format.bFlagErrorConcealment: %d"),
+				 portParamsInputPort.format.audio.bFlagErrorConcealment == OMX_FALSE ? 0 : 1);
+	INFO_PRINTF2(_L("PORTDEFINITIONTYPE format.eEncoding: %d"), portParamsInputPort.format.audio.eEncoding);
+	INFO_PRINTF2(_L("PORTDEFINITIONTYPE bBuffersContiguous: %d"),
+				 portParamsInputPort.bBuffersContiguous == OMX_FALSE ? 0 : 1);
+	INFO_PRINTF2(_L("PORTDEFINITIONTYPE nBufferAlignment: %d"), portParamsInputPort.nBufferAlignment);
+	}
+
+//
+// RAsyncTestStepOmxILPcmRenderer0021
+//
+RAsyncTestStepOmxILPcmRenderer0021::RAsyncTestStepOmxILPcmRenderer0021(const TDesC& aTestName, TInt aComponentUid)
+	:
+	RAsyncTestStepOmxILComponentBase(aTestName, aComponentUid),
+	ipKickoff01(NULL),
+	ipKickoff02(NULL),
+	ipKickoff03(NULL),
+	ipKickoff04(NULL),
+	ipKickoff05(NULL),
+	ipKickoff06(NULL)
+
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0021::RAsyncTestStepOmxILPcmRenderer0021"));
+	}
+
+
+void
+RAsyncTestStepOmxILPcmRenderer0021::KickoffTestL()
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0021::KickoffTestL"));
+
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test21  "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Init Component "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Provide callbacks to component (SetCallbacks) "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Obtain the component's state (GetState) "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Obtain component's role #1 with null string (ComponentRoleEnum fails with OMX_ErrorBadParameter) "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 5.- Obtain component's role #1 (ComponentRoleEnum returns audio_renderer.pcm) "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 6.- Obtain component's role #2 (ComponentRoleEnum fails with OMX_ErrorNoMore) "));
+
+	// This will install one callback
+	RAsyncTestStepOmxILComponentBase::KickoffTestL();
+
+	// This is the only step in this test...
+	TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0021Step01, this);
+	delete ipKickoff01;
+	ipKickoff01 = NULL;
+	ipKickoff01 =
+		new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow);
+	ipKickoff01->Call();
+
+	// The successful termination...
+	TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this);
+	delete ipKickoffStop;
+	ipKickoffStop = NULL;
+	ipKickoffStop =
+		new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow);
+	ipKickoffStop->Call();
+
+	}
+
+void
+RAsyncTestStepOmxILPcmRenderer0021::CloseTest()
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0021::CloseTest"));
+
+	delete ipKickoff01; // no need to Cancel
+	ipKickoff01 = NULL;
+	delete ipKickoff02; // no need to Cancel
+	ipKickoff02 = NULL;
+	delete ipKickoff03; // no need to Cancel
+	ipKickoff03 = NULL;
+	delete ipKickoff04; // no need to Cancel
+	ipKickoff04 = NULL;
+	delete ipKickoff05; // no need to Cancel
+	ipKickoff05 = NULL;
+	delete ipKickoff06; // no need to Cancel
+	ipKickoff06 = NULL;
+
+	delete ipKickoffStop; // no need to Cancel
+	ipKickoffStop = 0;
+
+	RAsyncTestStepOmxILComponentBase::CloseTest();
+
+	}
+
+
+void
+RAsyncTestStepOmxILPcmRenderer0021::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/,
+											  OMX_EVENTTYPE /*aEvent*/,
+											  TUint /*aData1*/,
+											  TUint /*aData2*/,
+											  TAny* /*aExtra*/)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0021::DoEventHandlerL"));
+
+	// We don't expect here any callback
+	return StopTest(KErrGeneral, EFail);
+
+	}
+
+
+TInt
+RAsyncTestStepOmxILPcmRenderer0021::RAsyncTestStepOmxILPcmRenderer0021Step01(TAny* aPtr)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0021::RAsyncTestStepOmxILPcmRenderer0021Step01"));
+    RAsyncTestStepOmxILPcmRenderer0021* self =
+		static_cast<RAsyncTestStepOmxILPcmRenderer0021*> (aPtr);
+	self->DoRAsyncTestStepOmxILPcmRenderer0021Step01();
+	return KErrNone;
+	}
+
+void
+RAsyncTestStepOmxILPcmRenderer0021::DoRAsyncTestStepOmxILPcmRenderer0021Step01()
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0021::DoRAsyncTestStepOmxILPcmRenderer0021Step01"));
+
+	//
+	// Provide callbacks to component
+	//
+	OMX_CALLBACKTYPE* omxCallbacks = *ipCallbackHandler;
+
+	if (OMX_ErrorNone != ipCompHandle->SetCallbacks(
+			ipCompHandle,
+			omxCallbacks,
+			ipCallbackHandler))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	//
+	// Obtain the component's state
+	//
+	OMX_STATETYPE compState;
+	if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle,
+												&compState))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	PrintOmxState(compState);
+
+	if (OMX_StateLoaded != compState)
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	INFO_PRINTF2(_L("Component Callbacks set successfully: %X"), ipCallbackHandler);
+
+
+	//
+	// Try to obtain the component's first role with null string  (must fail with error OMX_ErrorBadParameter)
+	//
+	OMX_U8* pNullUint = 0;
+	if (OMX_ErrorBadParameter != ipCompHandle->ComponentRoleEnum(
+			ipCompHandle,
+			pNullUint,
+			0 // This is index # 0, the first of the component's roles
+			))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	//
+	// Obtain the component's first role (success)
+	//
+	char componentRoleArray[OMX_MAX_STRINGNAME_SIZE];
+	if (OMX_ErrorNone != ipCompHandle->ComponentRoleEnum(
+			ipCompHandle,
+			reinterpret_cast<OMX_U8*>(componentRoleArray),
+			0 // This is index # 0, the first of the component's roles
+			))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	TBuf8<128> componentRoleBuf8;
+	componentRoleBuf8 = const_cast<const TUint8*>(reinterpret_cast<TUint8*>(componentRoleArray));
+	TBuf<128> componentRoleBuf16;
+	INFO_PRINTF2(_L("Component's Role length: %d"), componentRoleBuf8.Length());
+	componentRoleBuf16.Copy(componentRoleBuf8);
+	componentRoleBuf16.PtrZ();
+
+	INFO_PRINTF2(_L("Component's 1st Role [%S] "), &componentRoleBuf16);
+
+	if (componentRoleBuf8.Compare(KSymbianOmxILPcmRendererRole()) != 0)
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	//
+	// Obtain the component's second role (must fail with error OMX_ErrorNoMore)
+	//
+	if (OMX_ErrorNoMore != ipCompHandle->ComponentRoleEnum(
+			ipCompHandle,
+			reinterpret_cast<OMX_U8*>(componentRoleArray),
+			1 // This is index # 1, the second of the component's roles
+			))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	}
+
+//
+// RAsyncTestStepOmxILPcmRenderer0022
+//
+RAsyncTestStepOmxILPcmRenderer0022::RAsyncTestStepOmxILPcmRenderer0022(const TDesC& aTestName, TInt aComponentUid)
+	:
+	RAsyncTestStepOmxILComponentBase(aTestName, aComponentUid),
+	ipKickoff01(NULL),
+	ipKickoff02(NULL),
+	ipKickoff03(NULL),
+	ipKickoff04(NULL),
+	ipKickoff05(NULL),
+	ipKickoff06(NULL)
+
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0022::RAsyncTestStepOmxILPcmRenderer0022"));
+	}
+
+
+void
+RAsyncTestStepOmxILPcmRenderer0022::KickoffTestL()
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0022::KickoffTestL"));
+
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test22  "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Init Component "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Provide callbacks to component (SetCallbacks) "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Obtain the component's state (GetState) "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Get component's current role (GetParameter(OMX_IndexParamStandardComponentRole) )"));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 5.- Set unsupported audio_renderer.wrong role (SetParameter(OMX_IndexParamStandardComponentRole) )"));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 5a.- SetParameter returns OMX_ErrorBadParameter (audio_renderer.wrong role not supported)"));
+
+	// This will install one callback
+	RAsyncTestStepOmxILComponentBase::KickoffTestL();
+
+	// This is the only step in this test...
+	TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0022Step01, this);
+	delete ipKickoff01;
+	ipKickoff01 = NULL;
+	ipKickoff01 =
+		new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow);
+	ipKickoff01->Call();
+
+	// The successful termination...
+	TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this);
+	delete ipKickoffStop;
+	ipKickoffStop = NULL;
+	ipKickoffStop =
+		new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow);
+	ipKickoffStop->Call();
+
+	}
+
+void
+RAsyncTestStepOmxILPcmRenderer0022::CloseTest()
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0022::CloseTest"));
+
+	delete ipKickoff01; // no need to Cancel
+	ipKickoff01 = NULL;
+	delete ipKickoff02; // no need to Cancel
+	ipKickoff02 = NULL;
+	delete ipKickoff03; // no need to Cancel
+	ipKickoff03 = NULL;
+	delete ipKickoff04; // no need to Cancel
+	ipKickoff04 = NULL;
+	delete ipKickoff05; // no need to Cancel
+	ipKickoff05 = NULL;
+	delete ipKickoff06; // no need to Cancel
+	ipKickoff06 = NULL;
+
+	delete ipKickoffStop; // no need to Cancel
+	ipKickoffStop = 0;
+
+	RAsyncTestStepOmxILComponentBase::CloseTest();
+
+	}
+
+
+void
+RAsyncTestStepOmxILPcmRenderer0022::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/,
+											  OMX_EVENTTYPE /*aEvent*/,
+											  TUint /*aData1*/,
+											  TUint /*aData2*/,
+											  TAny* /*aExtra*/)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0022::DoEventHandlerL"));
+
+	// We don't expect here any callback
+	return StopTest(KErrGeneral, EFail);
+
+	}
+
+
+TInt
+RAsyncTestStepOmxILPcmRenderer0022::RAsyncTestStepOmxILPcmRenderer0022Step01(TAny* aPtr)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0022::RAsyncTestStepOmxILPcmRenderer0022Step01"));
+    RAsyncTestStepOmxILPcmRenderer0022* self =
+		static_cast<RAsyncTestStepOmxILPcmRenderer0022*> (aPtr);
+	self->DoRAsyncTestStepOmxILPcmRenderer0022Step01();
+	return KErrNone;
+	}
+
+void
+RAsyncTestStepOmxILPcmRenderer0022::DoRAsyncTestStepOmxILPcmRenderer0022Step01()
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0022::DoRAsyncTestStepOmxILPcmRenderer0022Step01"));
+
+	//
+	// Provide callbacks to component
+	//
+	OMX_CALLBACKTYPE* omxCallbacks = *ipCallbackHandler;
+
+	if (OMX_ErrorNone != ipCompHandle->SetCallbacks(
+			ipCompHandle,
+			omxCallbacks,
+			ipCallbackHandler))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	INFO_PRINTF2(_L("Component Callbacks set successfully: %X"), ipCallbackHandler);
+
+	//
+	// Obtain the component's state
+	//
+	OMX_STATETYPE compState;
+	if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle,
+												&compState))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	PrintOmxState(compState);
+
+	if (OMX_StateLoaded != compState)
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	//
+	// Get component's current standard role
+	//
+	OMX_PARAM_COMPONENTROLETYPE componentRoleType;
+	componentRoleType.nSize = sizeof(OMX_PARAM_COMPONENTROLETYPE);
+	componentRoleType.nVersion = TOmxILSpecVersion();
+	if (OMX_ErrorNone != ipCompHandle->GetParameter(
+			ipCompHandle,
+			OMX_IndexParamStandardComponentRole,
+			&componentRoleType))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	TBuf8<128> componentRoleBuf8;
+	componentRoleBuf8 = const_cast<const TUint8*>(reinterpret_cast<TUint8*>(componentRoleType.cRole));
+	TBuf<128> componentRoleBuf16;
+	INFO_PRINTF2(_L("Component Role length: %d"), componentRoleBuf8.Length());
+	componentRoleBuf16.Copy(componentRoleBuf8);
+	componentRoleBuf16.PtrZ();
+
+	INFO_PRINTF2(_L("Component's current Role: %S"), &componentRoleBuf16);
+
+
+	//
+	// Set unsupported standard role
+	//
+	TPtr8 role(reinterpret_cast<TUint8*>(componentRoleType.cRole),
+			   OMX_MAX_STRINGNAME_SIZE);
+	role.Copy(KTestOmxILWrongRendererRole());
+	role.PtrZ();
+
+	if (OMX_ErrorBadParameter != ipCompHandle->SetParameter(
+			ipCompHandle,
+			OMX_IndexParamStandardComponentRole,
+			&componentRoleType))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	TBuf8<128> cRole8;
+	cRole8 = const_cast<const TUint8*>(reinterpret_cast<TUint8*>(componentRoleType.cRole));
+
+	TBuf<128> cRole16;
+	cRole16.Copy(cRole8);
+	cRole16.PtrZ();
+
+	INFO_PRINTF2(_L("SetParameter of an unsupported standard role failed (success): %S"), &cRole16);
+
+	}
+
+
+
+//
+// RAsyncTestStepOmxILPcmRenderer0001
+//
+RAsyncTestStepOmxILPcmRenderer0001::RAsyncTestStepOmxILPcmRenderer0001(const TDesC& aTestName, TInt aComponentUid)
+	:
+	RAsyncTestStepOmxILComponentBase(aTestName, aComponentUid),
+	ipBufferHeaderInput(0),
+	ipBufferHeaderOutput(0),
+	iTerminateNow(EFalse),
+	iSamplingRate(8000),
+	iTestState(EStateDefault),
+	ipKickoff01(NULL),
+	ipKickoff02(NULL),
+	ipKickoff03(NULL),
+	ipKickoff04(NULL),
+	ipKickoff05(NULL),
+	ipKickoff06(NULL)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0001::RAsyncTestStepOmxILPcmRenderer0001"));
+	}
+
+
+void
+RAsyncTestStepOmxILPcmRenderer0001::KickoffTestL()
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0001::KickoffTestL"));
+	iTestState = EStateLoadKickoffTestLComplete;
+
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test01  "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(AllocateBuffer-population) "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Loaded(depopulation) "));
+
+	// This will install one callback
+	RAsyncTestStepOmxILComponentBase::KickoffTestL();
+
+	TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0001Step01, this);
+	delete ipKickoff01;
+	ipKickoff01 = NULL;
+	ipKickoff01 =
+		new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow);
+	ipKickoff01->Call();
+
+	}
+
+void
+RAsyncTestStepOmxILPcmRenderer0001::CloseTest()
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0001::CloseTest"));
+
+	delete ipKickoff01; // no need to Cancel
+	ipKickoff01 = NULL;
+	delete ipKickoff02; // no need to Cancel
+	ipKickoff02 = NULL;
+	delete ipKickoff03; // no need to Cancel
+	ipKickoff03 = NULL;
+	delete ipKickoff04; // no need to Cancel
+	ipKickoff04 = NULL;
+	delete ipKickoff05; // no need to Cancel
+	ipKickoff05 = NULL;
+	delete ipKickoff06; // no need to Cancel
+	ipKickoff06 = NULL;
+
+	delete ipKickoffStop; // no need to Cancel
+	ipKickoffStop = 0;
+
+	TInt count = ipClientClockPortBufferArray.Count();
+	
+	for (TInt n = 0; n < count; n++)
+		{
+		delete ipClientClockPortBufferArray[n];
+		}
+	
+	ipClientClockPortBufferArray.Close();
+	
+	RAsyncTestStepOmxILComponentBase::CloseTest();
+
+	}
+
+
+void
+RAsyncTestStepOmxILPcmRenderer0001::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/,
+											  OMX_EVENTTYPE /*aEvent*/,
+											  TUint /*aData1*/,
+											  TUint /*aData2*/,
+											  TAny* /*aExtra*/)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0001::DoEventHandlerL"));
+
+	if (!iTerminateNow)
+		{
+		TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0001Step02, this);
+		delete ipKickoff02;
+		ipKickoff02 = NULL;
+		ipKickoff02 =
+			new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow);
+		ipKickoff02->Call();
+		}
+	else
+		{
+		OMX_STATETYPE compState;
+		if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle,
+													&compState))
+			{
+			return StopTest(KErrGeneral, EFail);
+			}
+
+		PrintOmxState(compState);
+
+		if (OMX_StateLoaded != compState)
+			{
+			return StopTest(KErrGeneral, EFail);
+			}
+
+		// The successful termination...
+		TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this);
+		delete ipKickoffStop;
+		ipKickoffStop = NULL;
+		ipKickoffStop =
+			new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow);
+		ipKickoffStop->Call();
+		}
+
+	}
+
+
+TInt
+RAsyncTestStepOmxILPcmRenderer0001::RAsyncTestStepOmxILPcmRenderer0001Step01(TAny* aPtr)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0001::RAsyncTestStepOmxILPcmRenderer0001Step01"));
+    RAsyncTestStepOmxILPcmRenderer0001* self =
+		static_cast<RAsyncTestStepOmxILPcmRenderer0001*> (aPtr);
+	self->DoRAsyncTestStepOmxILPcmRenderer0001Step01();
+	return KErrNone;
+	}
+
+void
+RAsyncTestStepOmxILPcmRenderer0001::DoRAsyncTestStepOmxILPcmRenderer0001Step01()
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0001::DoRAsyncTestStepOmxILPcmRenderer0001Step01"));
+
+	//
+	// Provide callbacks to component
+	//
+	OMX_CALLBACKTYPE* omxCallbacks = *ipCallbackHandler;
+
+	if (OMX_ErrorNone != ipCompHandle->SetCallbacks(
+			ipCompHandle,
+			omxCallbacks,
+			ipCallbackHandler))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	INFO_PRINTF2(_L("Component Callbacks set successfully: %X"), ipCallbackHandler);
+
+	//
+	// Obtain the port def params for Port #0
+	//
+	OMX_PARAM_PORTDEFINITIONTYPE portParamsInputPort;
+	portParamsInputPort.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE);
+	portParamsInputPort.nVersion = TOmxILSpecVersion();
+	portParamsInputPort.nPortIndex = 0;
+	if (OMX_ErrorNone != ipCompHandle->GetParameter(
+			ipCompHandle,
+			OMX_IndexParamPortDefinition,
+			&portParamsInputPort))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+	
+	//
+	// Obtain the port def params for Client Clock Port #1
+	//
+	OMX_PARAM_PORTDEFINITIONTYPE portParamsInputPort1;
+	portParamsInputPort1.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE);
+	portParamsInputPort1.nVersion = TOmxILSpecVersion();
+	portParamsInputPort1.nPortIndex = 1;
+
+	if (OMX_ErrorNone != ipCompHandle->GetParameter(
+			ipCompHandle,
+			OMX_IndexParamPortDefinition,
+			&portParamsInputPort1))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	//
+	// Change the sampling rate on PCM Renderer's port #0
+	//
+	OMX_AUDIO_PARAM_PCMMODETYPE pcmMode;
+	pcmMode.nSize = sizeof(OMX_AUDIO_PARAM_PCMMODETYPE);
+	pcmMode.nVersion = TOmxILSpecVersion();
+	pcmMode.nPortIndex = 0;
+	if (OMX_ErrorNone != ipCompHandle->GetParameter(
+			ipCompHandle,
+			OMX_IndexParamAudioPcm,
+			&pcmMode))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+	pcmMode.nSamplingRate = iSamplingRate;
+	if (OMX_ErrorNone != ipCompHandle->SetParameter(
+			ipCompHandle,
+			OMX_IndexParamAudioPcm,
+			&pcmMode))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	//
+	// Move component to OMX_StateIdle
+	//
+
+	if (OMX_ErrorNone != ipCompHandle->SendCommand(
+			ipCompHandle,
+			OMX_CommandStateSet,
+			OMX_StateIdle,
+			0))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Moving component to OMX_StateIdle"));
+
+	OMX_STATETYPE compState;
+	if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle,
+												&compState))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	PrintOmxState(compState);
+
+	if (OMX_StateLoaded != compState)
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	//
+	// Allocate buffer on input port
+	//
+	if (OMX_ErrorNone != ipCompHandle->AllocateBuffer(
+			ipCompHandle,
+			&ipBufferHeaderInput,
+			0, // input port
+			0,
+			portParamsInputPort.nBufferSize))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Populated buffer (AllocateBuffer) in INPUT port"));
+	
+	//
+	// Allocate buffer on Client Clock Port
+	//
+	TInt bufferCount = portParamsInputPort1.nBufferCountActual;
+	
+	for (TInt n = 0; n < bufferCount; n++)
+		{
+		OMX_BUFFERHEADERTYPE* clockBufPtr;
+		
+		if (OMX_ErrorNone != ipCompHandle->AllocateBuffer(
+				ipCompHandle,
+				&clockBufPtr,
+				1, // Clock input port
+				0,
+				portParamsInputPort1.nBufferSize))
+			{
+			return StopTest(KErrGeneral, EFail);
+			}
+		
+		if (ipClientClockPortBufferArray.Append(clockBufPtr) != KErrNone)
+			{
+			return StopTest(KErrNoMemory, EFail);
+			}
+		}
+	
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Populated buffer (AllocateBuffer) in Clock INPUT port"));
+	}
+
+TInt
+RAsyncTestStepOmxILPcmRenderer0001::RAsyncTestStepOmxILPcmRenderer0001Step02(TAny* aPtr)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0001::RAsyncTestStepOmxILPcmRenderer0001Step02"));
+    RAsyncTestStepOmxILPcmRenderer0001* self =
+		static_cast<RAsyncTestStepOmxILPcmRenderer0001*> (aPtr);
+	self->DoRAsyncTestStepOmxILPcmRenderer0001Step02();
+	return KErrNone;
+	}
+
+void
+RAsyncTestStepOmxILPcmRenderer0001::DoRAsyncTestStepOmxILPcmRenderer0001Step02()
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0001::DoRAsyncTestStepOmxILPcmRenderer0001Step02"));
+
+	//
+	// Move component to OMX_StateLoaded
+	//
+
+	if (OMX_ErrorNone != ipCompHandle->SendCommand(
+			ipCompHandle,
+			OMX_CommandStateSet,
+			OMX_StateLoaded,
+			0))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Moving component to OMX_StateLoaded"));
+
+	OMX_STATETYPE compState;
+	if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle,
+												&compState))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	PrintOmxState(compState);
+
+	if (OMX_StateIdle != compState)
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	//
+	// Free buffer on input port
+	//
+	if (OMX_ErrorNone != ipCompHandle->FreeBuffer(
+			ipCompHandle,
+			0, // input port
+			ipBufferHeaderInput))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Depopulated buffer (FreeBuffer) in INPUT port"));
+
+	//
+	// Free Client Clock Port buffer on input port
+	//
+	TInt count =  ipClientClockPortBufferArray.Count();
+	
+	for (TInt n = 0; n < count; n++)
+		{
+		if (OMX_ErrorNone != ipCompHandle->FreeBuffer(
+				ipCompHandle,
+				1, // Client Clock Port
+				ipClientClockPortBufferArray[0]))
+			{
+			return StopTest(KErrGeneral, EFail);
+			}
+
+		ipClientClockPortBufferArray.Remove(0);
+		}
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Depopulated Client Clock Port buffer (FreeBuffer) in INPUT port"));
+
+	iTerminateNow = ETrue;
+
+	}
+
+
+//
+// RAsyncTestStepOmxILPcmRenderer0002
+//
+RAsyncTestStepOmxILPcmRenderer0002::RAsyncTestStepOmxILPcmRenderer0002(const TDesC& aTestName, TInt aComponentUid)
+	:
+	RAsyncTestStepOmxILPcmRenderer0001(aTestName, aComponentUid),
+	ipInputBuffer(0),
+	ipOutputBuffer(0)
+
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0002::RAsyncTestStepOmxILPcmRenderer0002"));
+	}
+
+
+void
+RAsyncTestStepOmxILPcmRenderer0002::KickoffTestL()
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0002::KickoffTestL"));
+
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test02 "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(UseBuffer-population) "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Loaded(depopulation) "));
+
+	// This will install one callback
+	RAsyncTestStepOmxILComponentBase::KickoffTestL();
+
+	TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0002Step01, this);
+	delete ipKickoff01;
+	ipKickoff01 = NULL;
+	ipKickoff01 =
+		new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow);
+	ipKickoff01->Call();
+
+	}
+
+void
+RAsyncTestStepOmxILPcmRenderer0002::CloseTest()
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0002::CloseTest"));
+
+	delete ipInputBuffer;
+	ipInputBuffer = NULL;
+	delete ipOutputBuffer;
+	ipOutputBuffer = NULL;
+
+	delete ipKickoff01; // no need to Cancel
+	ipKickoff01 = NULL;
+	delete ipKickoff02; // no need to Cancel
+	ipKickoff02 = NULL;
+	delete ipKickoff03; // no need to Cancel
+	ipKickoff03 = NULL;
+	delete ipKickoff04; // no need to Cancel
+	ipKickoff04 = NULL;
+	delete ipKickoff05; // no need to Cancel
+	ipKickoff05 = NULL;
+	delete ipKickoff06; // no need to Cancel
+	ipKickoff06 = NULL;
+
+	delete ipKickoffStop; // no need to Cancel
+	ipKickoffStop = 0;
+
+	ipClientClockPortBufferArray.Close();
+	
+	TInt count = iClockPortBufferPtrArray.Count();
+	
+	for (TInt n = 0; n < count; n++)
+		{
+		delete iClockPortBufferPtrArray[n];
+		}
+	
+	iClockPortBufferPtrArray.Close();
+	
+	RAsyncTestStepOmxILComponentBase::CloseTest();
+
+	}
+
+void
+RAsyncTestStepOmxILPcmRenderer0002::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/,
+											  OMX_EVENTTYPE /*aEvent*/,
+											  TUint /*aData1*/,
+											  TUint /*aData2*/,
+											  TAny* /*aExtra*/)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0002::DoEventHandlerL"));
+
+	if (!iTerminateNow)
+		{
+		TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0002Step02, this);
+		delete ipKickoff02;
+		ipKickoff02 = NULL;
+		ipKickoff02 =
+			new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow);
+		ipKickoff02->Call();
+		}
+
+	if (iTerminateNow)
+		{
+		OMX_STATETYPE compState;
+		if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle,
+													&compState))
+			{
+			return StopTest(KErrGeneral, EFail);
+			}
+
+		PrintOmxState(compState);
+
+		if (OMX_StateLoaded != compState)
+			{
+			return StopTest(KErrGeneral, EFail);
+			}
+
+		// The successful termination...
+		TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this);
+		delete ipKickoffStop;
+		ipKickoffStop = NULL;
+		ipKickoffStop =
+			new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow);
+		ipKickoffStop->Call();
+		}
+
+	}
+
+
+TInt
+RAsyncTestStepOmxILPcmRenderer0002::RAsyncTestStepOmxILPcmRenderer0002Step01(TAny* aPtr)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0002::RAsyncTestStepOmxILPcmRenderer0002Step01"));
+	RAsyncTestStepOmxILPcmRenderer0002* self =
+		static_cast<RAsyncTestStepOmxILPcmRenderer0002*> (aPtr);
+	self->DoRAsyncTestStepOmxILPcmRenderer0002Step01();
+	return KErrNone;
+	}
+
+void
+RAsyncTestStepOmxILPcmRenderer0002::DoRAsyncTestStepOmxILPcmRenderer0002Step01()
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0002::DoRAsyncTestStepOmxILPcmRenderer0002Step01"));
+
+	//
+	// Provide callbacks to component
+	//
+	OMX_CALLBACKTYPE* omxCallbacks = *ipCallbackHandler;
+
+	if (OMX_ErrorNone != ipCompHandle->SetCallbacks(
+			ipCompHandle,
+			omxCallbacks,
+			ipCallbackHandler))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	INFO_PRINTF2(_L("Component Callbacks set successfully: %X"), ipCallbackHandler);
+
+	//
+	// Obtain the port def params for Port #0
+	//
+	OMX_PARAM_PORTDEFINITIONTYPE portParamsInputPort;
+	portParamsInputPort.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE);
+	portParamsInputPort.nVersion = TOmxILSpecVersion();
+	portParamsInputPort.nPortIndex = 0;
+	if (OMX_ErrorNone != ipCompHandle->GetParameter(
+			ipCompHandle,
+			OMX_IndexParamPortDefinition,
+			&portParamsInputPort))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	//
+	// Obtain the port def params for Client Clock Port #1
+	//
+	OMX_PARAM_PORTDEFINITIONTYPE portParamsInputPort1;
+	portParamsInputPort1.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE);
+	portParamsInputPort1.nVersion = TOmxILSpecVersion();
+	portParamsInputPort1.nPortIndex = 1;
+
+	if (OMX_ErrorNone != ipCompHandle->GetParameter(
+			ipCompHandle,
+			OMX_IndexParamPortDefinition,
+			&portParamsInputPort1))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	//
+	// Move component to OMX_StateIdle
+	//
+
+	if (OMX_ErrorNone != ipCompHandle->SendCommand(
+			ipCompHandle,
+			OMX_CommandStateSet,
+			OMX_StateIdle,
+			0))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	OMX_STATETYPE compState;
+	if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle,
+												&compState))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	PrintOmxState(compState);
+
+	if (OMX_StateLoaded != compState)
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+
+	//
+	// Allocate buffer on input port
+	//
+	TRAPD(err, ipInputBuffer = CMMFDescriptorBuffer::NewL(portParamsInputPort.nBufferSize));
+	if(err != KErrNone)
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	TDes8& inputBufferDes = ipInputBuffer->Data();
+
+	if (OMX_ErrorNone != ipCompHandle->UseBuffer(
+			ipCompHandle,
+			&ipBufferHeaderInput,
+			0,					// input port
+			ipInputBuffer,		// pAppPrivate
+			portParamsInputPort.nBufferSize,
+			const_cast<TUint8*>(inputBufferDes.Ptr())))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+	INFO_PRINTF1(_L("Populated buffer (UseBuffer) in INPUT port"));
+
+	//
+	// Allocate Client Clock Port buffer
+	//
+	TInt bufferCount = portParamsInputPort1.nBufferCountActual;
+	
+	for (TInt n = 0; n < bufferCount; n++)
+		{
+		CMMFDescriptorBuffer* bufPtr;
+		
+		TRAPD(err, bufPtr = CMMFDescriptorBuffer::NewL(portParamsInputPort1.nBufferSize));
+		
+		if(err != KErrNone)
+			{
+			return StopTest(KErrGeneral, EFail);
+			}
+		
+		if (iClockPortBufferPtrArray.Append(bufPtr) != KErrNone)
+			{
+			delete bufPtr;
+			return StopTest(KErrGeneral, EFail);
+			}
+		
+		TDes8& inputBufferDes = bufPtr->Data();
+		OMX_BUFFERHEADERTYPE* clockBufPtr;
+		
+		if (OMX_ErrorNone != ipCompHandle->UseBuffer(
+				ipCompHandle,
+				&clockBufPtr,
+				1,					// Clock input port
+				ipInputBuffer,		// pAppPrivate
+				portParamsInputPort.nBufferSize,
+				const_cast<TUint8*>(inputBufferDes.Ptr())))
+			{
+			return StopTest(KErrGeneral, EFail);
+			}
+		
+		TRAPD(error, ipClientClockPortBufferArray.AppendL(clockBufPtr));
+		if(error != KErrNone)
+		  {
+		    return StopTest(KErrGeneral, EFail);
+		  }
+		}
+	INFO_PRINTF1(_L("Populated buffer (UseBuffer) in Client Clock Port"));
+
+	}
+
+TInt
+RAsyncTestStepOmxILPcmRenderer0002::RAsyncTestStepOmxILPcmRenderer0002Step02(TAny* aPtr)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0002::RAsyncTestStepOmxILPcmRenderer0002Step02"));
+	// NOTE, Here we reuse inherited code, to depopulate the component and make it go to OMX_StateLoaded
+	RAsyncTestStepOmxILPcmRenderer0002* self =
+		static_cast<RAsyncTestStepOmxILPcmRenderer0002*> (aPtr);
+	self->DoRAsyncTestStepOmxILPcmRenderer0001Step02();
+	return KErrNone;
+	}
+
+
+//
+// RAsyncTestStepOmxILPcmRenderer0003
+//
+RAsyncTestStepOmxILPcmRenderer0003::RAsyncTestStepOmxILPcmRenderer0003(const TDesC& aTestName, TInt aComponentUid)
+	:
+	RAsyncTestStepOmxILComponentBase(aTestName, aComponentUid),
+	iTerminateNow(EFalse),
+	ipKickoff01(NULL),
+	ipKickoff02(NULL),
+	ipKickoff03(NULL),
+	ipKickoff04(NULL),
+	ipKickoff05(NULL),
+	ipKickoff06(NULL)
+
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0003::RAsyncTestStepOmxILPcmRenderer0003"));
+	}
+
+
+void
+RAsyncTestStepOmxILPcmRenderer0003::KickoffTestL()
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0003::KickoffTestL"));
+
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test03 "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->WaitForResources "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- WaitForResources->Loaded "));
+
+	// This will install one callback
+	RAsyncTestStepOmxILComponentBase::KickoffTestL();
+
+	TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0003Step01, this);
+	delete ipKickoff01;
+	ipKickoff01 = NULL;
+	ipKickoff01 =
+		new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow);
+	ipKickoff01->Call();
+
+	// This will be used later in DoRAsyncTestStepOmxILPcmRenderer0003Step02
+	TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this);
+	delete ipKickoffStop;
+	ipKickoffStop = NULL;
+	ipKickoffStop =
+		new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow);
+
+	}
+
+void
+RAsyncTestStepOmxILPcmRenderer0003::CloseTest()
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0003::CloseTest"));
+
+	delete ipKickoff01; // no need to Cancel
+	ipKickoff01 = NULL;
+	delete ipKickoff02; // no need to Cancel
+	ipKickoff02 = NULL;
+	delete ipKickoff03; // no need to Cancel
+	ipKickoff03 = NULL;
+	delete ipKickoff04; // no need to Cancel
+	ipKickoff04 = NULL;
+	delete ipKickoff05; // no need to Cancel
+	ipKickoff05 = NULL;
+	delete ipKickoff06; // no need to Cancel
+	ipKickoff06 = NULL;
+
+	delete ipKickoffStop; // no need to Cancel
+	ipKickoffStop = 0;
+
+	RAsyncTestStepOmxILComponentBase::CloseTest();
+
+	}
+
+void
+RAsyncTestStepOmxILPcmRenderer0003::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/,
+											  OMX_EVENTTYPE /*aEvent*/,
+											  TUint /*aData1*/,
+											  TUint /*aData2*/,
+											  TAny* /*aExtra*/)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0003::DoEventHandlerL"));
+
+	TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0003Step02, this);
+	delete ipKickoff02;
+	ipKickoff02 = NULL;
+	ipKickoff02 =
+		new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow);
+	ipKickoff02->Call();
+
+	}
+
+
+TInt
+RAsyncTestStepOmxILPcmRenderer0003::RAsyncTestStepOmxILPcmRenderer0003Step01(TAny* aPtr)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0003::RAsyncTestStepOmxILPcmRenderer0003Step01"));
+	RAsyncTestStepOmxILPcmRenderer0003* self =
+		static_cast<RAsyncTestStepOmxILPcmRenderer0003*> (aPtr);
+	self->DoRAsyncTestStepOmxILPcmRenderer0003Step01();
+	return KErrNone;
+	}
+
+void
+RAsyncTestStepOmxILPcmRenderer0003::DoRAsyncTestStepOmxILPcmRenderer0003Step01()
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0003::DoRAsyncTestStepOmxILPcmRenderer0003Step01"));
+
+	//
+	// Obtain the component's state
+	//
+	OMX_STATETYPE compState;
+	if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle,
+												&compState))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	PrintOmxState(compState);
+
+	if (OMX_StateLoaded != compState)
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	//
+	// Provide callbacks to component
+	//
+	OMX_CALLBACKTYPE* omxCallbacks = *ipCallbackHandler;
+
+	if (OMX_ErrorNone != ipCompHandle->SetCallbacks(
+			ipCompHandle,
+			omxCallbacks,
+			ipCallbackHandler))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	INFO_PRINTF2(_L("Component Callbacks set successfully: %X"), ipCallbackHandler);
+
+	//
+	// Move component to OMX_StateWaitForResources
+	//
+
+	if (OMX_ErrorNone != ipCompHandle->SendCommand(
+			ipCompHandle,
+			OMX_CommandStateSet,
+			OMX_StateWaitForResources,
+			0))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle,
+												&compState))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	PrintOmxState(compState);
+
+	if (OMX_StateWaitForResources != compState)
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+    //
+    // The following code is to improve code coerage only
+    //
+    OMX_AUDIO_PARAM_PCMMODETYPE pcmMode;
+    pcmMode.nSize = sizeof(OMX_AUDIO_PARAM_PCMMODETYPE);
+    pcmMode.nVersion = TOmxILSpecVersion();
+    pcmMode.nPortIndex = 0;
+    if (OMX_ErrorNone != ipCompHandle->GetParameter(
+            ipCompHandle,
+            OMX_IndexParamAudioPcm,
+            &pcmMode))
+        {
+        return StopTest(KErrGeneral, EFail);
+        }
+    pcmMode.nSamplingRate = 44100;
+    if (OMX_ErrorNone != ipCompHandle->SetParameter(
+            ipCompHandle,
+            OMX_IndexParamAudioPcm,
+            &pcmMode))
+        {
+        return StopTest(KErrGeneral, EFail);
+        }
+    OMX_BUFFERHEADERTYPE temp;
+    OMX_BUFFERHEADERTYPE* bufferHeaderInput=&temp;
+    if (OMX_ErrorIncorrectStateOperation != ipCompHandle->AllocateBuffer(
+            ipCompHandle,
+            &bufferHeaderInput,
+            0, // input port
+            0,
+            1024))
+        {
+        return StopTest(KErrGeneral, EFail);
+        }
+
+    if (OMX_ErrorBadPortIndex != ipCompHandle->EmptyThisBuffer(
+            ipCompHandle,
+            bufferHeaderInput))
+        {
+        return StopTest(KErrGeneral, EFail);
+        }
+
+    if (OMX_ErrorBadPortIndex != ipCompHandle->FillThisBuffer(
+            ipCompHandle,
+            bufferHeaderInput))
+        {
+        return StopTest(KErrGeneral, EFail);
+        }
+    
+    if (OMX_ErrorBadPortIndex != ipCompHandle->FreeBuffer(
+            ipCompHandle,
+            2,
+            bufferHeaderInput))
+        {
+        return StopTest(KErrGeneral, EFail);
+        }
+    
+    if (OMX_ErrorNone != ipCompHandle->SendCommand(
+            ipCompHandle,
+            OMX_CommandPortEnable,
+            0,
+            0))
+        {
+        return StopTest(KErrGeneral, EFail);
+        }
+    
+    OMX_TUNNELSETUPTYPE tunnelSetup;
+    OMX_U32 outputPort = 1;
+    OMX_U32 inputPort = 0;
+        
+    if (OMX_ErrorIncorrectStateOperation !=
+        ipCompHandle->ComponentTunnelRequest(
+            ipCompHandle,
+            outputPort,
+            ipCompHandle,
+            inputPort,
+            &tunnelSetup))
+        {
+        return StopTest(KErrGeneral, EFail);
+        }
+	}
+
+TInt
+RAsyncTestStepOmxILPcmRenderer0003::RAsyncTestStepOmxILPcmRenderer0003Step02(TAny* aPtr)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0003::RAsyncTestStepOmxILPcmRenderer0003Step02"));
+	RAsyncTestStepOmxILPcmRenderer0003* self =
+		static_cast<RAsyncTestStepOmxILPcmRenderer0003*> (aPtr);
+	self->DoRAsyncTestStepOmxILPcmRenderer0003Step02();
+	return KErrNone;
+	}
+
+void
+RAsyncTestStepOmxILPcmRenderer0003::DoRAsyncTestStepOmxILPcmRenderer0003Step02()
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0003::DoRAsyncTestStepOmxILPcmRenderer0003Step02"));
+
+	OMX_STATETYPE compState;
+	if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle,
+												&compState))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	PrintOmxState(compState);
+
+	if (OMX_StateWaitForResources != compState)
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	//
+	// Move component to OMX_StateLoaded
+	//
+
+	if (OMX_ErrorNone != ipCompHandle->SendCommand(
+			ipCompHandle,
+			OMX_CommandStateSet,
+			OMX_StateLoaded,
+			0))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle,
+												&compState))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	PrintOmxState(compState);
+
+	if (OMX_StateLoaded != compState)
+		{		return StopTest(KErrGeneral, EFail);
+		}
+
+	// The successful termination...
+	ipKickoffStop->Call();
+
+	}
+
+
+//
+// RAsyncTestStepOmxILPcmRenderer0004
+//
+RAsyncTestStepOmxILPcmRenderer0004::RAsyncTestStepOmxILPcmRenderer0004(const TDesC& aTestName, TInt aComponentUid)
+	:
+	RAsyncTestStepOmxILPcmRenderer0001(aTestName, aComponentUid)
+
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0004::RAsyncTestStepOmxILPcmRenderer0004"));
+	}
+
+
+void
+RAsyncTestStepOmxILPcmRenderer0004::KickoffTestL()
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0004::KickoffTestL"));
+	iTestState = EStateLoadKickoffTestLComplete;
+
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test04 "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(AllocateBuffer-population) "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Pause "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Pause->Idle "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Idle->Loaded(depopulation) "));
+
+	// This will install one callback
+	RAsyncTestStepOmxILComponentBase::KickoffTestL();
+
+	TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0004Step01, this);
+	delete ipKickoff01;
+	ipKickoff01 = NULL;
+	ipKickoff01 =
+		new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow);
+	ipKickoff01->Call();
+
+	}
+
+void
+RAsyncTestStepOmxILPcmRenderer0004::CloseTest()
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0004::CloseTest"));
+
+	delete ipKickoff01; // no need to Cancel
+	ipKickoff01 = NULL;
+	delete ipKickoff02; // no need to Cancel
+	ipKickoff02 = NULL;
+	delete ipKickoff03; // no need to Cancel
+	ipKickoff03 = NULL;
+	delete ipKickoff04; // no need to Cancel
+	ipKickoff04 = NULL;
+	delete ipKickoff05; // no need to Cancel
+	ipKickoff05 = NULL;
+	delete ipKickoff06; // no need to Cancel
+	ipKickoff06 = NULL;
+
+	delete ipKickoffStop; // no need to Cancel
+	ipKickoffStop = 0;
+
+	TInt count = ipClientClockPortBufferArray.Count();
+	
+	for (TInt n = 0; n < count; n++)
+		{
+		delete ipClientClockPortBufferArray[n];
+		}
+	
+	ipClientClockPortBufferArray.Close();
+	
+	RAsyncTestStepOmxILComponentBase::CloseTest();
+
+	}
+
+void
+RAsyncTestStepOmxILPcmRenderer0004::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/,
+											  OMX_EVENTTYPE aEvent,
+											  TUint aData1,
+											  TUint aData2,
+											  TAny* /*aExtra*/)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0004::DoEventHandlerL"));
+
+	switch (aEvent)
+		{
+	case OMX_EventError:
+		{
+		INFO_PRINTF2(_L("DoEventHandlerL: OMX_EventError [%d]"), aData1);
+		return StopTest(KErrGeneral, EFail);
+		}
+	case OMX_EventCmdComplete:
+		{
+		switch(aData1)
+			{
+		case OMX_CommandStateSet:
+			{
+			switch(aData2)
+				{
+			case OMX_StateLoaded:
+				{
+				if (EStateTransitionToIdleComplete == iTestState)
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateLoaded [EStateTransitionToIdleComplete]"));
+					iTestState = EStateTransitionToLoadedComplete;
+					OMX_STATETYPE compState;
+					if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle,
+																&compState))
+						{
+						return StopTest(KErrGeneral, EFail);
+						}
+
+					PrintOmxState(compState);
+
+					if (OMX_StateLoaded != compState)
+						{
+						return StopTest(KErrGeneral, EFail);
+						}
+
+					// The successful termination...
+					TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this);
+					delete ipKickoffStop;
+					ipKickoffStop = NULL;
+					ipKickoffStop =
+						new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow);
+					ipKickoffStop->Call();
+					}
+				}
+				break;
+			case OMX_StateIdle:
+				{
+				if (EStateLoadKickoffTestLComplete == iTestState)
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateLoadKickoffTestLComplete]"));
+					iTestState = EStateTransitionToIdleComplete;
+					TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0004Step02, this);
+					delete ipKickoff02;
+					ipKickoff02 = NULL;
+					ipKickoff02 =
+						new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow);
+					ipKickoff02->Call();
+
+					}
+				else if (EStateTransitionToPauseComplete == iTestState)
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateTransitionToPauseComplete]"));
+					iTestState = EStateTransitionToIdleComplete;
+					TCallBack callback04 (RAsyncTestStepOmxILPcmRenderer0004Step04, this);
+					delete ipKickoff04;
+					ipKickoff04 = NULL;
+					ipKickoff04 =
+						new (ELeave) CAsyncCallBack (callback04, CActive::EPriorityLow);
+					ipKickoff04->Call();
+
+					}
+				else
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [Other]"));
+					return StopTest(KErrGeneral, EFail);
+					}
+				}
+				break;
+			case OMX_StatePause:
+				{
+				if (EStateTransitionToIdleComplete == iTestState)
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StatePause [EStateTransitionToIdleComplete]"));
+					iTestState = EStateTransitionToPauseComplete;
+					TCallBack callback03 (RAsyncTestStepOmxILPcmRenderer0004Step03, this);
+					delete ipKickoff03;
+					ipKickoff03 = NULL;
+					ipKickoff03 =
+						new (ELeave) CAsyncCallBack (callback03, CActive::EPriorityLow);
+					ipKickoff03->Call();
+					}
+				else
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StatePause [Other]"));
+					return StopTest(KErrGeneral, EFail);
+					}
+				}
+				break;
+			default:
+				{
+				INFO_PRINTF2(_L("DoEventHandlerL: OMX_State [%d]"), aData2);
+				return StopTest(KErrGeneral, EFail);
+				}
+				};
+			}
+			break;
+		default:
+			{
+			INFO_PRINTF2(_L("DoEventHandlerL: OMX_Command [%d]"), aData1);
+			return StopTest(KErrGeneral, EFail);
+			}
+			};
+		}
+		break;
+	default:
+		{
+		INFO_PRINTF2(_L("DoEventHandlerL: OMX Event [%d]"), aEvent);
+		return StopTest(KErrGeneral, EFail);
+		}
+		};
+
+	}
+
+
+TInt
+RAsyncTestStepOmxILPcmRenderer0004::RAsyncTestStepOmxILPcmRenderer0004Step01(TAny* aPtr)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0004::RAsyncTestStepOmxILPcmRenderer0004Step01"));
+	// NOTE, Here we reuse inherited code, to populate the component and make it go to OMX_StateIdle
+	RAsyncTestStepOmxILPcmRenderer0004* self =
+		static_cast<RAsyncTestStepOmxILPcmRenderer0004*> (aPtr);
+	self->DoRAsyncTestStepOmxILPcmRenderer0001Step01();
+	return KErrNone;
+	}
+
+TInt
+RAsyncTestStepOmxILPcmRenderer0004::RAsyncTestStepOmxILPcmRenderer0004Step02(TAny* aPtr)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0004::RAsyncTestStepOmxILPcmRenderer0004Step02"));
+	RAsyncTestStepOmxILPcmRenderer0004* self =
+		static_cast<RAsyncTestStepOmxILPcmRenderer0004*> (aPtr);
+	self->DoRAsyncTestStepOmxILPcmRenderer0004Step02();
+	return KErrNone;
+	}
+
+void
+RAsyncTestStepOmxILPcmRenderer0004::DoRAsyncTestStepOmxILPcmRenderer0004Step02()
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0004::DoRAsyncTestStepOmxILPcmRenderer0004Step02"));
+
+	OMX_STATETYPE compState;
+	if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle,
+												&compState))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	PrintOmxState(compState);
+
+	if (OMX_StateIdle != compState)
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	//
+	// Move component to OMX_StatePause
+	//
+
+	if (OMX_ErrorNone != ipCompHandle->SendCommand(
+			ipCompHandle,
+			OMX_CommandStateSet,
+			OMX_StatePause,
+			0))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle,
+												&compState))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	PrintOmxState(compState);
+
+	if (OMX_StatePause != compState)
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	}
+
+TInt
+RAsyncTestStepOmxILPcmRenderer0004::RAsyncTestStepOmxILPcmRenderer0004Step03(TAny* aPtr)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0004::RAsyncTestStepOmxILPcmRenderer0004Step03"));
+	RAsyncTestStepOmxILPcmRenderer0004* self =
+		static_cast<RAsyncTestStepOmxILPcmRenderer0004*> (aPtr);
+	self->DoRAsyncTestStepOmxILPcmRenderer0004Step03();
+	return KErrNone;
+	}
+
+
+void
+RAsyncTestStepOmxILPcmRenderer0004::DoRAsyncTestStepOmxILPcmRenderer0004Step03()
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0004::DoRAsyncTestStepOmxILPcmRenderer0004Step03"));
+
+	//
+	// Move component to OMX_StateIdle
+	//
+
+	if (OMX_ErrorNone != ipCompHandle->SendCommand(
+			ipCompHandle,
+			OMX_CommandStateSet,
+			OMX_StateIdle,
+			0))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	OMX_STATETYPE compState;
+	if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle,
+												&compState))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	PrintOmxState(compState);
+
+	if (OMX_StateIdle != compState)
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	}
+
+
+TInt
+RAsyncTestStepOmxILPcmRenderer0004::RAsyncTestStepOmxILPcmRenderer0004Step04(TAny* aPtr)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0004::RAsyncTestStepOmxILPcmRenderer0004Step04"));
+	// NOTE, Here we reuse inherited code, to depopulate the component and to
+	// make it go to OMX_StateLoaded
+	RAsyncTestStepOmxILPcmRenderer0004* self =
+		static_cast<RAsyncTestStepOmxILPcmRenderer0004*> (aPtr);
+	self->DoRAsyncTestStepOmxILPcmRenderer0001Step02();
+	return KErrNone;
+	}
+
+
+//
+// RAsyncTestStepOmxILPcmRenderer0005
+//
+RAsyncTestStepOmxILPcmRenderer0005::RAsyncTestStepOmxILPcmRenderer0005(const TDesC& aTestName, TInt aComponentUid)
+	:
+	RAsyncTestStepOmxILPcmRenderer0004(aTestName, aComponentUid)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0005::RAsyncTestStepOmxILPcmRenderer0005"));
+	}
+
+
+void
+RAsyncTestStepOmxILPcmRenderer0005::KickoffTestL()
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0005::KickoffTestL"));
+	iTestState = EStateLoadKickoffTestLComplete;
+
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test05 "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(AllocateBuffer-population) "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Executing "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2a. - Call EmptyThisBuffer on PCM Renderer "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2b. - EmptyBufferDone callback received "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Executing->Idle(BufferFlushing) "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Idle->Loaded(Depopulation) "));
+
+	// This will change the test file
+	iTestFileName.Set(KPcmRendererTestFile);
+	
+	// This will install one callback
+	RAsyncTestStepOmxILComponentBase::KickoffTestL();
+
+	TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0005Step01, this);
+	delete ipKickoff01;
+	ipKickoff01 = NULL;
+	ipKickoff01 =
+		new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow);
+	ipKickoff01->Call();
+
+	}
+
+void
+RAsyncTestStepOmxILPcmRenderer0005::CloseTest()
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0005::CloseTest"));
+
+	delete ipKickoff01; // no need to Cancel
+	ipKickoff01 = NULL;
+	delete ipKickoff02; // no need to Cancel
+	ipKickoff02 = NULL;
+	delete ipKickoff03; // no need to Cancel
+	ipKickoff03 = NULL;
+	delete ipKickoff04; // no need to Cancel
+	ipKickoff04 = NULL;
+	delete ipKickoff05; // no need to Cancel
+	ipKickoff05 = NULL;
+	delete ipKickoff06; // no need to Cancel
+	ipKickoff06 = NULL;
+
+	delete ipKickoffStop; // no need to Cancel
+	ipKickoffStop = 0;
+
+	TInt count = ipClientClockPortBufferArray.Count();
+	
+	for (TInt n = 0; n < count; n++)
+		{
+		delete ipClientClockPortBufferArray[n];
+		}
+	
+	ipClientClockPortBufferArray.Close();
+	
+	RAsyncTestStepOmxILComponentBase::CloseTest();
+
+	}
+
+void
+RAsyncTestStepOmxILPcmRenderer0005::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/,
+											  OMX_EVENTTYPE aEvent,
+											  TUint aData1,
+											  TUint aData2,
+											  TAny* /*aExtra*/)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0005::DoEventHandlerL"));
+
+	switch (aEvent)
+		{
+	case OMX_EventError:
+		{
+		INFO_PRINTF2(_L("DoEventHandlerL: OMX_EventError [%d]"), aData1);
+		return StopTest(KErrGeneral, EFail);
+		}
+	case OMX_EventCmdComplete:
+		{
+		switch(aData1)
+			{
+		case OMX_CommandStateSet:
+			{
+			switch(aData2)
+				{
+			case OMX_StateLoaded:
+				{
+				if (EStateTransitionToIdleComplete == iTestState)
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateLoaded [EStateTransitionToIdleComplete]"));
+					iTestState = EStateTransitionToLoadedComplete;
+					OMX_STATETYPE compState;
+					if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle,
+																&compState))
+						{
+						return StopTest(KErrGeneral, EFail);
+						}
+
+					PrintOmxState(compState);
+
+					if (OMX_StateLoaded != compState)
+						{
+						return StopTest(KErrGeneral, EFail);
+						}
+
+					// The successful termination...
+					TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this);
+					delete ipKickoffStop;
+					ipKickoffStop = NULL;
+					ipKickoffStop =
+						new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow);
+					ipKickoffStop->Call();
+					}
+				}
+				break;
+			case OMX_StateIdle:
+				{
+				if (EStateLoadKickoffTestLComplete == iTestState)
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateLoadKickoffTestLComplete]"));
+					iTestState = EStateTransitionToIdleComplete;
+					TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0005Step02, this);
+					delete ipKickoff02;
+					ipKickoff02 = NULL;
+					ipKickoff02 =
+						new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow);
+					ipKickoff02->Call();
+
+					}
+				else if (EStateTransitionToExecutingComplete == iTestState)
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateTransitionToPauseComplete]"));
+					iTestState = EStateTransitionToIdleComplete;
+					TCallBack callback04 (RAsyncTestStepOmxILPcmRenderer0005Step04, this);
+					delete ipKickoff04;
+					ipKickoff04 = NULL;
+					ipKickoff04 =
+						new (ELeave) CAsyncCallBack (callback04, CActive::EPriorityLow);
+					ipKickoff04->Call();
+
+					}
+				else
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [Other]"));
+					return StopTest(KErrGeneral, EFail);
+					}
+				}
+				break;
+			case OMX_StateExecuting:
+				{
+				if (EStateTransitionToIdleComplete == iTestState)
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [EStateTransitionToIdleComplete]"));
+					iTestState = EStateTransitionToExecutingComplete;
+					CMMFDataBuffer& dataBuffer = *(static_cast<CMMFDataBuffer*>(ipBufferHeaderInput->pInputPortPrivate));
+					ipTestFile->ReadNextBuffer(dataBuffer);
+					ipBufferHeaderInput->nFilledLen = dataBuffer.BufferSize();
+
+					// Send a buffer to the input port
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [Send a buffer to the input port]"));
+					INFO_PRINTF2(_L("ipBufferHeaderInput->pBuffer [%X]"), ipBufferHeaderInput->pBuffer);
+					INFO_PRINTF2(_L("ipBufferHeaderInput->nAllocLen [%d]"), ipBufferHeaderInput->nAllocLen);
+					INFO_PRINTF2(_L("ipBufferHeaderInput->nFilledLen [%d]"), ipBufferHeaderInput->nFilledLen);
+					INFO_PRINTF2(_L("ipBufferHeaderInput->nOffset [%d]"), ipBufferHeaderInput->nOffset);
+					INFO_PRINTF2(_L("ipBufferHeaderInput->pAppPrivate [%X]"), ipBufferHeaderInput->pAppPrivate);
+					INFO_PRINTF2(_L("ipBufferHeaderInput->pPlatformPrivate [%X]"), ipBufferHeaderInput->pPlatformPrivate);
+					INFO_PRINTF2(_L("ipBufferHeaderInput->pInputPortPrivate [%X]"), ipBufferHeaderInput->pInputPortPrivate);
+					INFO_PRINTF2(_L("ipBufferHeaderInput->pOutputPortPrivate [%X]"), ipBufferHeaderInput->pOutputPortPrivate);
+					INFO_PRINTF2(_L("ipBufferHeaderInput->hMarkTargetComponent [%X]"), ipBufferHeaderInput->hMarkTargetComponent);
+					INFO_PRINTF2(_L("ipBufferHeaderInput->pMarkData [%X]"), ipBufferHeaderInput->pMarkData);
+					INFO_PRINTF2(_L("ipBufferHeaderInput->nTickCount [%d]"), ipBufferHeaderInput->nTickCount);
+					INFO_PRINTF2(_L("ipBufferHeaderInput->nFlags [%X]"), ipBufferHeaderInput->nFlags);
+					INFO_PRINTF2(_L("ipBufferHeaderInput->nOutputPortIndex [%X]"), ipBufferHeaderInput->nOutputPortIndex);
+					INFO_PRINTF2(_L("ipBufferHeaderInput->nInputPortIndex [%X]"), ipBufferHeaderInput->nInputPortIndex);
+
+					if (OMX_ErrorNone != ipCompHandle->EmptyThisBuffer(
+							ipCompHandle, ipBufferHeaderInput))
+						{
+						return StopTest(KErrGeneral, EFail);
+						}
+					}
+				else
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [Other]"));
+					return StopTest(KErrGeneral, EFail);
+					}
+				}
+				break;
+			default:
+				{
+				INFO_PRINTF2(_L("DoEventHandlerL: OMX_State [%d]"), aData2);
+				return StopTest(KErrGeneral, EFail);
+				}
+				};
+			}
+			break;
+		default:
+			{
+			INFO_PRINTF2(_L("DoEventHandlerL: OMX_Command [%d]"), aData1);
+			return StopTest(KErrGeneral, EFail);
+			}
+			};
+		}
+		break;
+	default:
+		{
+		INFO_PRINTF2(_L("DoEventHandlerL: OMX Event [%d]"), aEvent);
+		return StopTest(KErrGeneral, EFail);
+		}
+		};
+
+	}
+
+void
+RAsyncTestStepOmxILPcmRenderer0005::DoEmptyBufferDoneL(OMX_HANDLETYPE /*aComponent*/,
+													 OMX_BUFFERHEADERTYPE* /*aBuffer*/)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0005::DoEmptyBufferDoneL"));
+
+	INFO_PRINTF1(_L("DoEmptyBufferDoneL : Callback received "));
+
+	TCallBack callback03 (RAsyncTestStepOmxILPcmRenderer0005Step03, this);
+	delete ipKickoff03;
+	ipKickoff03 = NULL;
+	ipKickoff03 =
+		new (ELeave) CAsyncCallBack (callback03, CActive::EPriorityLow);
+	ipKickoff03->Call();
+	}
+
+
+TInt
+RAsyncTestStepOmxILPcmRenderer0005::RAsyncTestStepOmxILPcmRenderer0005Step01(TAny* aPtr)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0005::RAsyncTestStepOmxILPcmRenderer0005Step01"));
+	// NOTE, Here we reuse inherited code, to populate the component and make it go to OMX_StateIdle
+	RAsyncTestStepOmxILPcmRenderer0005* self =
+		static_cast<RAsyncTestStepOmxILPcmRenderer0005*> (aPtr);
+	self->DoRAsyncTestStepOmxILPcmRenderer0001Step01();
+	return KErrNone;
+	}
+
+TInt
+RAsyncTestStepOmxILPcmRenderer0005::RAsyncTestStepOmxILPcmRenderer0005Step02(TAny* aPtr)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0005::RAsyncTestStepOmxILPcmRenderer0005Step02"));
+	RAsyncTestStepOmxILPcmRenderer0005* self =
+		static_cast<RAsyncTestStepOmxILPcmRenderer0005*> (aPtr);
+	self->DoRAsyncTestStepOmxILPcmRenderer0005Step02();
+	return KErrNone;
+	}
+
+void
+RAsyncTestStepOmxILPcmRenderer0005::DoRAsyncTestStepOmxILPcmRenderer0005Step02()
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0005::DoRAsyncTestStepOmxILPcmRenderer0005Step02"));
+
+	//
+	// Move component to OMX_StateExecuting
+	//
+
+	if (OMX_ErrorNone != ipCompHandle->SendCommand(
+			ipCompHandle,
+			OMX_CommandStateSet,
+			OMX_StateExecuting,
+			0))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	OMX_STATETYPE compState;
+	if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle,
+												&compState))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	PrintOmxState(compState);
+
+	if (OMX_StateExecuting != compState)
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	}
+
+TInt
+RAsyncTestStepOmxILPcmRenderer0005::RAsyncTestStepOmxILPcmRenderer0005Step03(TAny* aPtr)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0005::RAsyncTestStepOmxILPcmRenderer0005Step03"));
+	RAsyncTestStepOmxILPcmRenderer0005* self =
+		static_cast<RAsyncTestStepOmxILPcmRenderer0005*> (aPtr);
+	self->DoRAsyncTestStepOmxILPcmRenderer0004Step03();
+	return KErrNone;
+	}
+
+
+TInt
+RAsyncTestStepOmxILPcmRenderer0005::RAsyncTestStepOmxILPcmRenderer0005Step04(TAny* aPtr)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0005::RAsyncTestStepOmxILPcmRenderer0005Step04"));
+	// NOTE, Here we reuse inherited code, to depopulate the component and to
+	// make it go to OMX_StateLoaded
+	RAsyncTestStepOmxILPcmRenderer0005* self =
+		static_cast<RAsyncTestStepOmxILPcmRenderer0005*> (aPtr);
+	self->DoRAsyncTestStepOmxILPcmRenderer0001Step02();
+	return KErrNone;
+	}
+
+
+
+//
+// RAsyncTestStepOmxILPcmRenderer0006
+//
+RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006(const TDesC& aTestName, TInt aComponentUid)
+	:
+	RAsyncTestStepOmxILPcmRenderer0005(aTestName, aComponentUid)
+
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006"));
+	}
+
+
+void
+RAsyncTestStepOmxILPcmRenderer0006::KickoffTestL()
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::KickoffTestL"));
+	iTestState = EStateLoadKickoffTestLComplete;
+
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test06 "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(AllocateBuffer-population) "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Executing "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Executing->Pause "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Pause->Executing "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 5.- Executing->Idle(BufferFlushing) "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 6.- Idle->Loaded(depopulation) "));
+
+	// This will install one callback
+	RAsyncTestStepOmxILComponentBase::KickoffTestL();
+
+	TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0006Step01, this);
+	delete ipKickoff01;
+	ipKickoff01 = NULL;
+	ipKickoff01 =
+		new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow);
+	ipKickoff01->Call();
+
+	}
+
+void
+RAsyncTestStepOmxILPcmRenderer0006::CloseTest()
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::CloseTest"));
+
+	delete ipKickoff01; // no need to Cancel
+	ipKickoff01 = NULL;
+	delete ipKickoff02; // no need to Cancel
+	ipKickoff02 = NULL;
+	delete ipKickoff03; // no need to Cancel
+	ipKickoff03 = NULL;
+	delete ipKickoff04; // no need to Cancel
+	ipKickoff04 = NULL;
+	delete ipKickoff05; // no need to Cancel
+	ipKickoff05 = NULL;
+	delete ipKickoff06; // no need to Cancel
+	ipKickoff06 = NULL;
+
+	delete ipKickoffStop; // no need to Cancel
+	ipKickoffStop = 0;
+
+	TInt count = ipClientClockPortBufferArray.Count();
+	
+	for (TInt n = 0; n < count; n++)
+		{
+		delete ipClientClockPortBufferArray[n];
+		}
+	
+	ipClientClockPortBufferArray.Close();
+	
+	RAsyncTestStepOmxILComponentBase::CloseTest();
+
+	}
+
+
+void
+RAsyncTestStepOmxILPcmRenderer0006::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/,
+											  OMX_EVENTTYPE aEvent,
+											  TUint aData1,
+											  TUint aData2,
+											  TAny* /*aExtra*/)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::DoEventHandlerL"));
+
+	switch (aEvent)
+		{
+	case OMX_EventError:
+		{
+		INFO_PRINTF2(_L("DoEventHandlerL: OMX_EventError [%d]"), aData1);
+		return StopTest(KErrGeneral, EFail);
+		}
+	case OMX_EventCmdComplete:
+		{
+		switch(aData1)
+			{
+		case OMX_CommandStateSet:
+			{
+			switch(aData2)
+				{
+			case OMX_StateLoaded:
+				{
+				if (EStateTransitionToIdleComplete == iTestState)
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateLoaded [EStateTransitionToIdleComplete]"));
+					iTestState = EStateTransitionToLoadedComplete;
+					OMX_STATETYPE compState;
+					if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle,
+																&compState))
+						{
+						return StopTest(KErrGeneral, EFail);
+						}
+
+					PrintOmxState(compState);
+
+					if (OMX_StateLoaded != compState)
+						{
+						return StopTest(KErrGeneral, EFail);
+						}
+
+					// The successful termination...
+					TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this);
+					delete ipKickoffStop;
+					ipKickoffStop = NULL;
+					ipKickoffStop =
+						new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow);
+					ipKickoffStop->Call();
+					}
+				}
+				break;
+			case OMX_StateIdle:
+				{
+				if (EStateLoadKickoffTestLComplete == iTestState)
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateLoadKickoffTestLComplete]"));
+					iTestState = EStateTransitionToIdleComplete;
+					TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0006Step02, this);
+					delete ipKickoff02;
+					ipKickoff02 = NULL;
+					ipKickoff02 =
+						new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow);
+					ipKickoff02->Call();
+
+					}
+				else if (EStateTransitionToExecutingComplete == iTestState)
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateTransitionToExecutingComplete]"));
+					iTestState = EStateTransitionToIdleComplete;
+					TCallBack callback06 (RAsyncTestStepOmxILPcmRenderer0006Step06, this);
+					delete ipKickoff06;
+					ipKickoff06 = NULL;
+					ipKickoff06 =
+						new (ELeave) CAsyncCallBack (callback06, CActive::EPriorityLow);
+					ipKickoff06->Call();
+
+					}
+				else
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [Other]"));
+					return StopTest(KErrGeneral, EFail);
+					}
+				}
+				break;
+			case OMX_StateExecuting:
+				{
+				if (EStateTransitionToIdleComplete == iTestState)
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [EStateTransitionToIdleComplete]"));
+					iTestState = EStateTransitionToExecutingComplete;
+					TCallBack callback03 (RAsyncTestStepOmxILPcmRenderer0006Step03, this);
+					delete ipKickoff03;
+					ipKickoff03 = NULL;
+					ipKickoff03 =
+						new (ELeave) CAsyncCallBack (callback03, CActive::EPriorityLow);
+					ipKickoff03->Call();
+
+					}
+				else if (EStateTransitionToPauseComplete == iTestState)
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [EStateTransitionToPauseComplete]"));
+					iTestState = EStateTransitionToExecutingComplete;
+					TCallBack callback05 (RAsyncTestStepOmxILPcmRenderer0006Step05, this);
+					delete ipKickoff05;
+					ipKickoff05 = NULL;
+					ipKickoff05 =
+						new (ELeave) CAsyncCallBack (callback05, CActive::EPriorityLow);
+					ipKickoff05->Call();
+
+					}
+				else
+					{
+					INFO_PRINTF2(_L("DoEventHandlerL: OMX_StateExecuting iTestState[%d]"), iTestState);
+					return StopTest(KErrGeneral, EFail);
+					}
+				}
+				break;
+				case OMX_StatePause:
+					{
+					if (EStateTransitionToExecutingComplete == iTestState)
+						{
+						INFO_PRINTF1(_L("DoEventHandlerL: OMX_StatePause [EStateTransitionToExecutingComplete]"));
+						iTestState = EStateTransitionToPauseComplete;
+						TCallBack callback04 (RAsyncTestStepOmxILPcmRenderer0006Step04, this);
+						delete ipKickoff04;
+						ipKickoff04 = NULL;
+						ipKickoff04 =
+							new (ELeave) CAsyncCallBack (callback04, CActive::EPriorityLow);
+						ipKickoff04->Call();
+						}
+					else
+						{
+						INFO_PRINTF2(_L("DoEventHandlerL: OMX_StatePause iTestState[%d]"), iTestState);
+						return StopTest(KErrGeneral, EFail);
+						}
+
+					}
+				break;
+			default:
+				{
+				INFO_PRINTF2(_L("DoEventHandlerL: OMX_State [%d]"), aData2);
+				return StopTest(KErrGeneral, EFail);
+				}
+				};
+			}
+			break;
+		default:
+			{
+			INFO_PRINTF2(_L("DoEventHandlerL: OMX_Command [%d]"), aData1);
+			return StopTest(KErrGeneral, EFail);
+			}
+			};
+		}
+		break;
+	default:
+		{
+		INFO_PRINTF2(_L("DoEventHandlerL: OMX Event [%d]"), aEvent);
+		return StopTest(KErrGeneral, EFail);
+		}
+		};
+
+	}
+
+
+TInt
+RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step01(TAny* aPtr)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step01"));
+	// NOTE, Here we reuse inherited code, to populate the component and make it go to OMX_StateIdle
+	RAsyncTestStepOmxILPcmRenderer0006* self =
+		static_cast<RAsyncTestStepOmxILPcmRenderer0006*> (aPtr);
+	self->DoRAsyncTestStepOmxILPcmRenderer0001Step01();
+	return KErrNone;
+	}
+
+TInt
+RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step02(TAny* aPtr)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step02"));
+	RAsyncTestStepOmxILPcmRenderer0006* self =
+		static_cast<RAsyncTestStepOmxILPcmRenderer0006*> (aPtr);
+	self->DoRAsyncTestStepOmxILPcmRenderer0005Step02();
+	return KErrNone;
+	}
+
+TInt
+RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step03(TAny* aPtr)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step03"));
+	RAsyncTestStepOmxILPcmRenderer0006* self =
+		static_cast<RAsyncTestStepOmxILPcmRenderer0006*> (aPtr);
+	self->DoRAsyncTestStepOmxILPcmRenderer0006Step03();
+	return KErrNone;
+	}
+
+void
+RAsyncTestStepOmxILPcmRenderer0006::DoRAsyncTestStepOmxILPcmRenderer0006Step03()
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::DoRAsyncTestStepOmxILPcmRenderer0006Step03"));
+
+	//
+	// Move component to OMX_StatePause
+	//
+	OMX_STATETYPE compState;
+	if (OMX_ErrorNone != ipCompHandle->SendCommand(
+			ipCompHandle,
+			OMX_CommandStateSet,
+			OMX_StatePause,
+			0))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle,
+												&compState))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	PrintOmxState(compState);
+
+	if (OMX_StatePause != compState)
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	}
+
+
+TInt
+RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step04(TAny* aPtr)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step04"));
+	// NOTE, Here we reuse inherited code, to make it go to OMX_StateIdle
+	RAsyncTestStepOmxILPcmRenderer0006* self =
+		static_cast<RAsyncTestStepOmxILPcmRenderer0006*> (aPtr);
+	self->DoRAsyncTestStepOmxILPcmRenderer0005Step02();
+	return KErrNone;
+	}
+
+TInt
+RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step05(TAny* aPtr)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step05"));
+	// NOTE, Here we reuse inherited code, to make it go to OMX_StateIdle
+	RAsyncTestStepOmxILPcmRenderer0006* self =
+		static_cast<RAsyncTestStepOmxILPcmRenderer0006*> (aPtr);
+	self->DoRAsyncTestStepOmxILPcmRenderer0004Step03();
+	return KErrNone;
+	}
+
+TInt
+RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step06(TAny* aPtr)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step06"));
+	// NOTE, Here we reuse inherited code, to make it go to OMX_StateLoaded
+	RAsyncTestStepOmxILPcmRenderer0006* self =
+		static_cast<RAsyncTestStepOmxILPcmRenderer0006*> (aPtr);
+	self->DoRAsyncTestStepOmxILPcmRenderer0001Step02();
+	return KErrNone;
+	}
+
+
+//
+// RAsyncTestStepOmxILPcmRenderer0007
+//
+RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007(const TDesC& aTestName, TInt aComponentUid)
+	:
+	RAsyncTestStepOmxILPcmRenderer0006(aTestName, aComponentUid)
+
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007"));
+	}
+
+
+void
+RAsyncTestStepOmxILPcmRenderer0007::KickoffTestL()
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0007::KickoffTestL"));
+	iTestState = EStateLoadKickoffTestLComplete;
+
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test07 "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(AllocateBuffer-population) "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Executing "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Executing->Pause "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Pause->Idle(BufferFlushing)"));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 5.- Idle->Loaded(depopulation) "));
+
+	// This will install one callback
+	RAsyncTestStepOmxILComponentBase::KickoffTestL();
+
+	TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0007Step01, this);
+	delete ipKickoff01;
+	ipKickoff01 = NULL;
+	ipKickoff01 =
+		new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow);
+	ipKickoff01->Call();
+
+	}
+
+void
+RAsyncTestStepOmxILPcmRenderer0007::CloseTest()
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0007::CloseTest"));
+
+	delete ipKickoff01; // no need to Cancel
+	ipKickoff01 = NULL;
+	delete ipKickoff02; // no need to Cancel
+	ipKickoff02 = NULL;
+	delete ipKickoff03; // no need to Cancel
+	ipKickoff03 = NULL;
+	delete ipKickoff04; // no need to Cancel
+	ipKickoff04 = NULL;
+	delete ipKickoff05; // no need to Cancel
+	ipKickoff05 = NULL;
+	delete ipKickoff06; // no need to Cancel
+	ipKickoff06 = NULL;
+
+	delete ipKickoffStop; // no need to Cancel
+	ipKickoffStop = 0;
+
+	TInt count = ipClientClockPortBufferArray.Count();
+	
+	for (TInt n = 0; n < count; n++)
+		{
+		delete ipClientClockPortBufferArray[n];
+		}
+	
+	ipClientClockPortBufferArray.Close();
+	
+	RAsyncTestStepOmxILComponentBase::CloseTest();
+
+	}
+
+
+void
+RAsyncTestStepOmxILPcmRenderer0007::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/,
+											  OMX_EVENTTYPE aEvent,
+											  TUint aData1,
+											  TUint aData2,
+											  TAny* /*aExtra*/)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0007::DoEventHandlerL"));
+
+	switch (aEvent)
+		{
+	case OMX_EventError:
+		{
+		//  Ignore underflow errors...
+		if (OMX_ErrorUnderflow == (OMX_S32)aData1)
+			{
+			INFO_PRINTF1(_L("DoEventHandlerL: [OMX_ErrorUnderflow]"));
+			}
+		else
+			{
+			INFO_PRINTF2(_L("DoEventHandlerL: OMX_EventError [%x]"), aData1);
+			return StopTest(KErrGeneral, EFail);
+			}
+		}
+		break;
+
+	case OMX_EventCmdComplete:
+		{
+		switch(aData1)
+			{
+		case OMX_CommandStateSet:
+			{
+			switch(aData2)
+				{
+			case OMX_StateLoaded:
+				{
+				if (EStateTransitionToIdleComplete == iTestState)
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateLoaded [EStateTransitionToIdleComplete]"));
+					iTestState = EStateTransitionToLoadedComplete;
+					OMX_STATETYPE compState;
+					if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle,
+																&compState))
+						{
+						return StopTest(KErrGeneral, EFail);
+						}
+
+					PrintOmxState(compState);
+
+					if (OMX_StateLoaded != compState)
+						{
+						return StopTest(KErrGeneral, EFail);
+						}
+
+					// The successful termination...
+					TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this);
+					delete ipKickoffStop;
+					ipKickoffStop = NULL;
+					ipKickoffStop =
+						new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow);
+					ipKickoffStop->Call();
+					}
+				}
+				break;
+			case OMX_StateIdle:
+				{
+				if (EStateLoadKickoffTestLComplete == iTestState)
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateLoadKickoffTestLComplete]"));
+					iTestState = EStateTransitionToIdleComplete;
+					TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0007Step02, this);
+					delete ipKickoff02;
+					ipKickoff02 = NULL;
+					ipKickoff02 =
+						new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow);
+					ipKickoff02->Call();
+
+					}
+				else if (EStateTransitionToPauseComplete == iTestState)
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateTransitionToPauseComplete]"));
+					iTestState = EStateTransitionToIdleComplete;
+					TCallBack callback05 (RAsyncTestStepOmxILPcmRenderer0007Step05, this);
+					delete ipKickoff05;
+					ipKickoff05 = NULL;
+					ipKickoff05 =
+						new (ELeave) CAsyncCallBack (callback05, CActive::EPriorityLow);
+					ipKickoff05->Call();
+
+					}
+				else
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [Other]"));
+					return StopTest(KErrGeneral, EFail);
+					}
+				}
+				break;
+			case OMX_StateExecuting:
+				{
+				if (EStateTransitionToIdleComplete == iTestState)
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [EStateTransitionToIdleComplete]"));
+					iTestState = EStateTransitionToExecutingComplete;
+					TCallBack callback03 (RAsyncTestStepOmxILPcmRenderer0007Step03, this);
+					delete ipKickoff03;
+					ipKickoff03 = NULL;
+					ipKickoff03 =
+						new (ELeave) CAsyncCallBack (callback03, CActive::EPriorityLow);
+					ipKickoff03->Call();
+
+					}
+				else
+					{
+					INFO_PRINTF2(_L("DoEventHandlerL: OMX_StateExecuting iTestState[%d]"), iTestState);
+					return StopTest(KErrGeneral, EFail);
+					}
+				}
+				break;
+			case OMX_StatePause:
+				{
+				if (EStateTransitionToExecutingComplete == iTestState)
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StatePause [EStateTransitionToExecutingComplete]"));
+					iTestState = EStateTransitionToPauseComplete;
+					TCallBack callback04 (RAsyncTestStepOmxILPcmRenderer0007Step04, this);
+					delete ipKickoff04;
+					ipKickoff04 = NULL;
+					ipKickoff04 =
+						new (ELeave) CAsyncCallBack (callback04, CActive::EPriorityLow);
+					ipKickoff04->Call();
+					}
+				else
+					{
+					INFO_PRINTF2(_L("DoEventHandlerL: OMX_StatePause iTestState[%d]"), iTestState);
+					return StopTest(KErrGeneral, EFail);
+					}
+
+				}
+				break;
+			default:
+				{
+				INFO_PRINTF2(_L("DoEventHandlerL: OMX_State [%d]"), aData2);
+				return StopTest(KErrGeneral, EFail);
+				}
+				};
+			}
+			break;
+		default:
+			{
+			INFO_PRINTF2(_L("DoEventHandlerL: OMX_Command [%d]"), aData1);
+			return StopTest(KErrGeneral, EFail);
+			}
+			};
+		}
+		break;
+	default:
+		{
+		INFO_PRINTF2(_L("DoEventHandlerL: OMX Event [%d]"), aEvent);
+		return StopTest(KErrGeneral, EFail);
+		}
+		};
+
+	}
+
+
+TInt
+RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007Step01(TAny* aPtr)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007Step01"));
+	// NOTE, Here we reuse inherited code, to populate the component and make it go to OMX_StateIdle
+	RAsyncTestStepOmxILPcmRenderer0007* self =
+		static_cast<RAsyncTestStepOmxILPcmRenderer0007*> (aPtr);
+	self->DoRAsyncTestStepOmxILPcmRenderer0001Step01();
+	return KErrNone;
+	}
+
+TInt
+RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007Step02(TAny* aPtr)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007Step02"));
+	RAsyncTestStepOmxILPcmRenderer0007* self =
+		static_cast<RAsyncTestStepOmxILPcmRenderer0007*> (aPtr);
+	self->DoRAsyncTestStepOmxILPcmRenderer0005Step02();
+	return KErrNone;
+	}
+
+TInt
+RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007Step03(TAny* aPtr)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007Step03"));
+	RAsyncTestStepOmxILPcmRenderer0007* self =
+		static_cast<RAsyncTestStepOmxILPcmRenderer0007*> (aPtr);
+	self->DoRAsyncTestStepOmxILPcmRenderer0006Step03();
+	return KErrNone;
+	}
+
+TInt
+RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007Step04(TAny* aPtr)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007Step04"));
+	// NOTE, Here we reuse inherited code, to make it go to OMX_StateIdle
+	RAsyncTestStepOmxILPcmRenderer0007* self =
+		static_cast<RAsyncTestStepOmxILPcmRenderer0007*> (aPtr);
+	self->DoRAsyncTestStepOmxILPcmRenderer0004Step03();
+	return KErrNone;
+	}
+
+TInt
+RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007Step05(TAny* aPtr)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007Step05"));
+	// NOTE, Here we reuse inherited code, to make it go to OMX_StateIdle
+	RAsyncTestStepOmxILPcmRenderer0007* self =
+		static_cast<RAsyncTestStepOmxILPcmRenderer0007*> (aPtr);
+	self->DoRAsyncTestStepOmxILPcmRenderer0001Step02();
+	return KErrNone;
+	}
+
+//
+// RAsyncTestStepOmxILPcmRenderer0008
+//
+RAsyncTestStepOmxILPcmRenderer0008::RAsyncTestStepOmxILPcmRenderer0008(const TDesC& aTestName, TInt aComponentUid)
+	:
+	RAsyncTestStepOmxILPcmRenderer0005(aTestName, aComponentUid)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0008::RAsyncTestStepOmxILPcmRenderer0008"));
+	}
+
+
+void
+RAsyncTestStepOmxILPcmRenderer0008::KickoffTestL()
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0008::KickoffTestL"));
+	iTestState = EStateLoadKickoffTestLComplete;
+
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test08 "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(AllocateBuffer-population) "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Executing "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Repeat these two steps until the whole file has beeen empited "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2a. - Call EmptyThisBuffer on PCM Renderer "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2b. - EmptyBufferDone callback received "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Executing->Idle(BufferFlushing) "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Idle->Loaded(Depopulation) "));
+
+	// This will change the test file
+	iTestFileName.Set(KPcmRendererTestFile);
+	
+	// This will install one callback
+	RAsyncTestStepOmxILComponentBase::KickoffTestL();
+
+	TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0005Step01, this);
+	delete ipKickoff01;
+	ipKickoff01 = NULL;
+	ipKickoff01 =
+		new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow);
+	ipKickoff01->Call();
+	}
+
+void
+RAsyncTestStepOmxILPcmRenderer0008::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/,
+											  OMX_EVENTTYPE aEvent,
+											  TUint aData1,
+											  TUint aData2,
+											  TAny* /*aExtra*/)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0008::DoEventHandlerL"));
+
+	switch (aEvent)
+		{
+	case OMX_EventError:
+		{
+		//  Ignore underflow errors...
+		if (OMX_ErrorUnderflow == (OMX_S32)aData1)
+			{
+			INFO_PRINTF1(_L("DoEventHandlerL: [OMX_ErrorUnderflow]"));
+			}
+		else
+			{
+			INFO_PRINTF2(_L("DoEventHandlerL: OMX_EventError [%x]"), aData1);
+			return StopTest(KErrGeneral, EFail);
+			}
+		}
+		break;
+
+	case OMX_EventCmdComplete:
+		{
+		switch(aData1)
+			{
+		case OMX_CommandStateSet:
+			{
+			switch(aData2)
+				{
+			case OMX_StateLoaded:
+				{
+				if (EStateTransitionToIdleComplete == iTestState)
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateLoaded [EStateTransitionToIdleComplete]"));
+					iTestState = EStateTransitionToLoadedComplete;
+					OMX_STATETYPE compState;
+					if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle,
+																&compState))
+						{
+						return StopTest(KErrGeneral, EFail);
+						}
+
+					PrintOmxState(compState);
+
+					if (OMX_StateLoaded != compState)
+						{
+						return StopTest(KErrGeneral, EFail);
+						}
+
+					// The successful termination...
+					TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this);
+					delete ipKickoffStop;
+					ipKickoffStop = NULL;
+					ipKickoffStop =
+						new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow);
+					ipKickoffStop->Call();
+					}
+				}
+				break;
+			case OMX_StateIdle:
+				{
+				if (EStateLoadKickoffTestLComplete == iTestState)
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateLoadKickoffTestLComplete]"));
+					iTestState = EStateTransitionToIdleComplete;
+					TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0005Step02, this);
+					delete ipKickoff02;
+					ipKickoff02 = NULL;
+					ipKickoff02 =
+						new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow);
+					ipKickoff02->Call();
+
+					}
+				else if (EStateTransitionToExecutingComplete == iTestState)
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateTransitionToPauseComplete]"));
+					iTestState = EStateTransitionToIdleComplete;
+					TCallBack callback04 (RAsyncTestStepOmxILPcmRenderer0005Step04, this);
+					delete ipKickoff04;
+					ipKickoff04 = NULL;
+					ipKickoff04 =
+						new (ELeave) CAsyncCallBack (callback04, CActive::EPriorityLow);
+					ipKickoff04->Call();
+
+					}
+				else
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [Other]"));
+					return StopTest(KErrGeneral, EFail);
+					}
+				}
+				break;
+			case OMX_StateExecuting:
+				{
+				if (EStateTransitionToIdleComplete == iTestState)
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [EStateTransitionToIdleComplete]"));
+					iTestState = EStateTransitionToExecutingComplete;
+					
+					CMMFDataBuffer& dataBuffer = *(static_cast<CMMFDataBuffer*>(ipBufferHeaderInput->pInputPortPrivate));
+					ipTestFile->ReadNextBuffer(dataBuffer);
+					
+					// Send a buffer to the input port
+					ipBufferHeaderInput->nFilledLen = dataBuffer.BufferSize();
+					
+					if (OMX_ErrorNone != ipCompHandle->EmptyThisBuffer(
+							ipCompHandle, ipBufferHeaderInput))
+						{
+						StopTest(KErrGeneral, EFail);
+						}
+					}
+				else
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [Other]"));
+					return StopTest(KErrGeneral, EFail);
+					}
+				}
+				break;
+			default:
+				{
+				INFO_PRINTF2(_L("DoEventHandlerL: OMX_State [%d]"), aData2);
+				return StopTest(KErrGeneral, EFail);
+				}
+				};
+			}
+			break;
+		default:
+			{
+			INFO_PRINTF2(_L("DoEventHandlerL: OMX_Command [%d]"), aData1);
+			return StopTest(KErrGeneral, EFail);
+			}
+			};
+		}
+		break;
+	default:
+		{
+		INFO_PRINTF2(_L("DoEventHandlerL: OMX Event [%d]"), aEvent);
+		return StopTest(KErrGeneral, EFail);
+		}
+		};
+
+	}
+
+void
+RAsyncTestStepOmxILPcmRenderer0008::DoEmptyBufferDoneL(OMX_HANDLETYPE /*aComponent*/,
+													 OMX_BUFFERHEADERTYPE* /*aBuffer*/)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0008::DoEmptyBufferDoneL"));
+	INFO_PRINTF1(_L("DoEmptyBufferDoneL : Callback received "));
+	
+	CMMFDataBuffer& dataBuffer = *(static_cast<CMMFDataBuffer*>(ipBufferHeaderInput->pInputPortPrivate));
+	ipTestFile->ReadNextBuffer(dataBuffer);
+	
+	if (dataBuffer.BufferSize() > 0)
+		{
+		// Send a buffer to the input port
+		ipBufferHeaderInput->nFilledLen = dataBuffer.BufferSize();
+		
+		if (OMX_ErrorNone != ipCompHandle->EmptyThisBuffer(
+				ipCompHandle, ipBufferHeaderInput))
+			{
+			StopTest(KErrGeneral, EFail);
+			}
+		}
+	else
+		{
+		TCallBack callback03 (RAsyncTestStepOmxILPcmRenderer0005Step03, this);
+		delete ipKickoff03;
+		ipKickoff03 = NULL;
+		ipKickoff03 =
+			new (ELeave) CAsyncCallBack (callback03, CActive::EPriorityLow);
+		ipKickoff03->Call();
+		}
+	}
+
+//
+// RAsyncTestStepOmxILPcmRenderer0009
+//
+RAsyncTestStepOmxILPcmRenderer0009::RAsyncTestStepOmxILPcmRenderer0009(const TDesC& aTestName, TInt aComponentUid)
+	:
+	RAsyncTestStepOmxILPcmRenderer0008(aTestName, aComponentUid)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0009::RAsyncTestStepOmxILPcmRenderer0009"));
+    iSamplingRate = 44100;
+	}
+
+
+void
+RAsyncTestStepOmxILPcmRenderer0009::KickoffTestL()
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0009::KickoffTestL"));
+	iTestState = EStateLoadKickoffTestLComplete;
+
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test09 "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(AllocateBuffer-population) "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Executing "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Repeat these two steps until the whole file has beeen empited "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2a. - Call EmptyThisBuffer on PCM Renderer "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2b. - EmptyBufferDone callback received "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Executing->Pause and Pause->Executing (after 5 and again after 10 buffers played) "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Executing->Idle(BufferFlushing) "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 5.- Idle->Loaded(Depopulation) "));
+
+	// This will change the test file
+	iTestFileName.Set(KPcmRendererTestFile2);
+	
+	// This will install one callback
+	RAsyncTestStepOmxILComponentBase::KickoffTestL();
+
+	TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0005Step01, this);
+	delete ipKickoff01;
+	ipKickoff01 = NULL;
+	ipKickoff01 =
+		new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow);
+	ipKickoff01->Call();
+	}
+
+void
+RAsyncTestStepOmxILPcmRenderer0009::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/,
+											  OMX_EVENTTYPE aEvent,
+											  TUint aData1,
+											  TUint aData2,
+											  TAny* /*aExtra*/)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0009::DoEventHandlerL"));
+	
+	switch (aEvent)
+		{
+	case OMX_EventError:
+		{
+		//  Ignore underflow errors...
+		if (OMX_ErrorUnderflow == (OMX_S32)aData1)
+			{
+			INFO_PRINTF1(_L("DoEventHandlerL: [OMX_ErrorUnderflow]"));
+			}
+		else
+			{
+			INFO_PRINTF2(_L("DoEventHandlerL: OMX_EventError [%x]"), aData1);
+			return StopTest(KErrGeneral, EFail);
+			}
+		}
+		break;
+
+	case OMX_EventCmdComplete:
+		{
+		switch(aData1)
+			{
+		case OMX_CommandStateSet:
+			{
+			switch(aData2)
+				{
+			case OMX_StateLoaded:
+				{
+				if (EStateTransitionToIdleComplete == iTestState)
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateLoaded [EStateTransitionToIdleComplete]"));
+					iTestState = EStateTransitionToLoadedComplete;
+					OMX_STATETYPE compState;
+					if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle,
+																&compState))
+						{
+						return StopTest(KErrGeneral, EFail);
+						}
+
+					PrintOmxState(compState);
+
+					if (OMX_StateLoaded != compState)
+						{
+						return StopTest(KErrGeneral, EFail);
+						}
+
+					// The successful termination...
+					TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this);
+					delete ipKickoffStop;
+					ipKickoffStop = NULL;
+					ipKickoffStop =
+						new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow);
+					ipKickoffStop->Call();
+					}
+				}
+				break;
+			case OMX_StateIdle:
+				{
+				if (EStateLoadKickoffTestLComplete == iTestState)
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateLoadKickoffTestLComplete]"));
+					iTestState = EStateTransitionToIdleComplete;
+					TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0005Step02, this);
+					delete ipKickoff02;
+					ipKickoff02 = NULL;
+					ipKickoff02 =
+						new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow);
+					ipKickoff02->Call();
+
+					}
+				else if (EStateTransitionToExecutingComplete == iTestState)
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateTransitionToPauseComplete]"));
+					iTestState = EStateTransitionToIdleComplete;
+					TCallBack callback04 (RAsyncTestStepOmxILPcmRenderer0005Step04, this);
+					delete ipKickoff04;
+					ipKickoff04 = NULL;
+					ipKickoff04 =
+						new (ELeave) CAsyncCallBack (callback04, CActive::EPriorityLow);
+					ipKickoff04->Call();
+
+					}
+				else
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [Other]"));
+					return StopTest(KErrGeneral, EFail);
+					}
+				}
+				break;
+			case OMX_StateExecuting:
+				{
+				if (EStateTransitionToIdleComplete == iTestState)
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [EStateTransitionToIdleComplete]"));
+					iTestState = EStateTransitionToExecutingComplete;
+					
+					CMMFDataBuffer& dataBuffer = *(static_cast<CMMFDataBuffer*>(ipBufferHeaderInput->pInputPortPrivate));
+					ipTestFile->ReadNextBuffer(dataBuffer);
+					
+					// Send a buffer to the input port
+					ipBufferHeaderInput->nFilledLen = dataBuffer.BufferSize();
+					
+					if (OMX_ErrorNone != ipCompHandle->EmptyThisBuffer(
+							ipCompHandle, ipBufferHeaderInput))
+						{
+						StopTest(KErrGeneral, EFail);
+						}
+					}
+				else if (EStateTransitionToPauseComplete == iTestState)
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [EStateTransitionToIdleComplete]"));
+					iTestState = EStateTransitionToExecutingComplete;
+					}
+				else
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [Other]"));
+					return StopTest(KErrGeneral, EFail);
+					}
+				}
+				break;
+			case OMX_StatePause:
+				{
+				if (EStateTransitionToExecutingComplete == iTestState)
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StatePause [EStateTransitionToExecutingComplete]"));
+					iTestState = EStateTransitionToPauseComplete;
+					
+					// Wait for a second...
+					User::After(1000000);
+					
+					// Resume playing...
+					TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0005Step02, this);
+					delete ipKickoff02;
+					ipKickoff02 = NULL;
+					ipKickoff02 =
+						new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow);
+					ipKickoff02->Call();
+					}
+				else
+					{
+					INFO_PRINTF2(_L("DoEventHandlerL: OMX_StatePause iTestState[%d]"), iTestState);
+					return StopTest(KErrGeneral, EFail);
+					}
+
+				}
+				break;
+			default:
+				{
+				INFO_PRINTF2(_L("DoEventHandlerL: OMX_State [%d]"), aData2);
+				return StopTest(KErrGeneral, EFail);
+				}
+				};
+			}
+			break;
+		default:
+			{
+			INFO_PRINTF2(_L("DoEventHandlerL: OMX_Command [%d]"), aData1);
+			return StopTest(KErrGeneral, EFail);
+			}
+			};
+		}
+		break;
+	default:
+		{
+		INFO_PRINTF2(_L("DoEventHandlerL: OMX Event [%d]"), aEvent);
+		return StopTest(KErrGeneral, EFail);
+		}
+		};
+
+	}
+
+void
+RAsyncTestStepOmxILPcmRenderer0009::DoEmptyBufferDoneL(OMX_HANDLETYPE /*aComponent*/,
+													 OMX_BUFFERHEADERTYPE* /*aBuffer*/)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0009::DoEmptyBufferDoneL"));
+	INFO_PRINTF1(_L("DoEmptyBufferDoneL : Callback received "));
+	
+	iNumOfEmptiedBuffers++;
+	if (iNumOfEmptiedBuffers == 5 || iNumOfEmptiedBuffers == 10)
+		{
+		//
+		// Move component to OMX_StatePause
+		//
+		if (OMX_ErrorNone != ipCompHandle->SendCommand(
+				ipCompHandle,
+				OMX_CommandStateSet,
+				OMX_StatePause,
+				0))
+			{
+			return StopTest(KErrGeneral, EFail);
+			}
+
+		OMX_STATETYPE compState;
+		if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle,
+													&compState))
+			{
+			return StopTest(KErrGeneral, EFail);
+			}
+
+		PrintOmxState(compState);
+		if (OMX_StatePause != compState)
+			{
+			return StopTest(KErrGeneral, EFail);
+			}
+		}
+
+	CMMFDataBuffer& dataBuffer = *(static_cast<CMMFDataBuffer*>(ipBufferHeaderInput->pInputPortPrivate));
+	ipTestFile->ReadNextBuffer(dataBuffer);
+	
+	if (dataBuffer.BufferSize() > 0)
+		{
+		// Send a buffer to the input port
+		ipBufferHeaderInput->nFilledLen = dataBuffer.BufferSize();
+		
+		if (OMX_ErrorNone != ipCompHandle->EmptyThisBuffer(
+				ipCompHandle, ipBufferHeaderInput))
+			{
+			StopTest(KErrGeneral, EFail);
+			}
+		}
+	else
+		{
+		TCallBack callback03 (RAsyncTestStepOmxILPcmRenderer0005Step03, this);
+		delete ipKickoff03;
+		ipKickoff03 = NULL;
+		ipKickoff03 =
+			new (ELeave) CAsyncCallBack (callback03, CActive::EPriorityLow);
+		ipKickoff03->Call();
+		}
+	}
+
+//
+// RAsyncTestStepOmxILPcmRenderer0010
+//
+RAsyncTestStepOmxILPcmRenderer0010::RAsyncTestStepOmxILPcmRenderer0010(const TDesC& aTestName, TInt aComponentUid)
+	:
+	RAsyncTestStepOmxILPcmRenderer0008(aTestName, aComponentUid)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0010::RAsyncTestStepOmxILPcmRenderer0010"));
+    iSamplingRate = 44100;
+	}
+
+
+void
+RAsyncTestStepOmxILPcmRenderer0010::KickoffTestL()
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0010::KickoffTestL"));
+	iTestState = EStateLoadKickoffTestLComplete;
+
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test10 "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(AllocateBuffer-population) "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Executing "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Repeat these two steps until the whole file has beeen empited "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2a. - Call EmptyThisBuffer on PCM Renderer "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2b. - EmptyBufferDone callback received "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Executing->Idle and Idle->Executing (after 5 and again after 10 buffers played) "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Executing->Idle(BufferFlushing) "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 5.- Idle->Loaded(Depopulation) "));
+
+	// This will change the test file
+	iTestFileName.Set(KPcmRendererTestFile2);
+	
+	// This will install one callback
+	RAsyncTestStepOmxILComponentBase::KickoffTestL();
+
+	TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0005Step01, this);
+	delete ipKickoff01;
+	ipKickoff01 = NULL;
+	ipKickoff01 =
+		new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow);
+	ipKickoff01->Call();
+	}
+
+void
+RAsyncTestStepOmxILPcmRenderer0010::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/,
+											  OMX_EVENTTYPE aEvent,
+											  TUint aData1,
+											  TUint aData2,
+											  TAny* /*aExtra*/)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0010::DoEventHandlerL"));
+
+	switch (aEvent)
+		{
+	case OMX_EventError:
+		{
+		//  Ignore underflow errors...
+		if (OMX_ErrorUnderflow == (OMX_S32)aData1)
+			{
+			INFO_PRINTF1(_L("DoEventHandlerL: [OMX_ErrorUnderflow]"));
+			}
+		else
+			{
+			INFO_PRINTF2(_L("DoEventHandlerL: OMX_EventError [%x]"), aData1);
+			return StopTest(KErrGeneral, EFail);
+			}
+		}
+		break;
+
+	case OMX_EventCmdComplete:
+		{
+		switch(aData1)
+			{
+		case OMX_CommandStateSet:
+			{
+			switch(aData2)
+				{
+			case OMX_StateLoaded:
+				{
+				if (EStateTransitionToIdleComplete == iTestState)
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateLoaded [EStateTransitionToIdleComplete]"));
+					iTestState = EStateTransitionToLoadedComplete;
+					OMX_STATETYPE compState;
+					if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle,
+																&compState))
+						{
+						return StopTest(KErrGeneral, EFail);
+						}
+
+					PrintOmxState(compState);
+
+					if (OMX_StateLoaded != compState)
+						{
+						return StopTest(KErrGeneral, EFail);
+						}
+
+					// The successful termination...
+					TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this);
+					delete ipKickoffStop;
+					ipKickoffStop = NULL;
+					ipKickoffStop =
+						new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow);
+					ipKickoffStop->Call();
+					}
+				}
+				break;
+			case OMX_StateIdle:
+				{
+				if (EStateLoadKickoffTestLComplete == iTestState)
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateLoadKickoffTestLComplete]"));
+					iTestState = EStateTransitionToIdleComplete;
+					TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0005Step02, this);
+					delete ipKickoff02;
+					ipKickoff02 = NULL;
+					ipKickoff02 =
+						new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow);
+					ipKickoff02->Call();
+
+					}
+				else if (EStateTransitionToExecutingComplete == iTestState)
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateTransitionToExecutingComplete]"));
+					iTestState = EStateTransitionToIdleComplete;
+					
+					if(iNumOfEmptiedBuffers <= 20)
+						{
+						// Wait for a second...
+						User::After(1000000);
+						
+						// Resume playing...
+						TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0005Step02, this);
+						delete ipKickoff02;
+						ipKickoff02 = NULL;
+						ipKickoff02 =
+							new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow);
+						ipKickoff02->Call();
+						}
+					else
+						{
+						// Playback finished
+						TCallBack callback04 (RAsyncTestStepOmxILPcmRenderer0005Step04, this);
+						delete ipKickoff04;
+						ipKickoff04 = NULL;
+						ipKickoff04 =
+							new (ELeave) CAsyncCallBack (callback04, CActive::EPriorityLow);
+						ipKickoff04->Call();
+						}
+					}
+				else
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [Other]"));
+					return StopTest(KErrGeneral, EFail);
+					}
+				}
+				break;
+			case OMX_StateExecuting:
+				{
+				if (EStateTransitionToIdleComplete == iTestState)
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [EStateTransitionToIdleComplete]"));
+					iTestState = EStateTransitionToExecutingComplete;
+					
+					CMMFDataBuffer& dataBuffer = *(static_cast<CMMFDataBuffer*>(ipBufferHeaderInput->pInputPortPrivate));
+					ipTestFile->ReadNextBuffer(dataBuffer);
+					
+					// Send a buffer to the input port
+					ipBufferHeaderInput->nFilledLen = dataBuffer.BufferSize();
+					
+					if (OMX_ErrorNone != ipCompHandle->EmptyThisBuffer(
+							ipCompHandle, ipBufferHeaderInput))
+						{
+						StopTest(KErrGeneral, EFail);
+						}
+					}
+				else if (EStateTransitionToPauseComplete == iTestState)
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [EStateTransitionToIdleComplete]"));
+					iTestState = EStateTransitionToExecutingComplete;
+					}
+				else
+					{
+					INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [Other]"));
+					return StopTest(KErrGeneral, EFail);
+					}
+				}
+				break;
+			default:
+				{
+				INFO_PRINTF2(_L("DoEventHandlerL: OMX_State [%d]"), aData2);
+				return StopTest(KErrGeneral, EFail);
+				}
+				};
+			}
+			break;
+		default:
+			{
+			INFO_PRINTF2(_L("DoEventHandlerL: OMX_Command [%d]"), aData1);
+			return StopTest(KErrGeneral, EFail);
+			}
+			};
+		}
+		break;
+	default:
+		{
+		INFO_PRINTF2(_L("DoEventHandlerL: OMX Event [%d]"), aEvent);
+		return StopTest(KErrGeneral, EFail);
+		}
+		};
+
+	}
+
+void
+RAsyncTestStepOmxILPcmRenderer0010::DoEmptyBufferDoneL(OMX_HANDLETYPE /*aComponent*/,
+													 OMX_BUFFERHEADERTYPE* /*aBuffer*/)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0010::DoEmptyBufferDoneL"));
+	INFO_PRINTF1(_L("DoEmptyBufferDoneL : Callback received "));
+	
+	iNumOfEmptiedBuffers++;
+	if (iNumOfEmptiedBuffers == 5 || iNumOfEmptiedBuffers == 10)
+		{
+		//
+		// Move component to OMX_StateIdle
+		//
+
+		if (OMX_ErrorNone != ipCompHandle->SendCommand(
+				ipCompHandle,
+				OMX_CommandStateSet,
+				OMX_StateIdle,
+				0))
+			{
+			return StopTest(KErrGeneral, EFail);
+			}
+
+		OMX_STATETYPE compState;
+		if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle,
+													&compState))
+			{
+			return StopTest(KErrGeneral, EFail);
+			}
+
+		PrintOmxState(compState);
+
+		if (OMX_StateIdle != compState)
+			{
+			return StopTest(KErrGeneral, EFail);
+			}
+		
+		// Reset the file position
+		ipTestFile->ResetPos();
+		}
+	else
+		{
+		CMMFDataBuffer& dataBuffer = *(static_cast<CMMFDataBuffer*>(ipBufferHeaderInput->pInputPortPrivate));
+		ipTestFile->ReadNextBuffer(dataBuffer);
+		
+		if (dataBuffer.BufferSize() > 0)
+			{
+			// Send a buffer to the input port
+			ipBufferHeaderInput->nFilledLen = dataBuffer.BufferSize();
+			
+			if (OMX_ErrorNone != ipCompHandle->EmptyThisBuffer(
+					ipCompHandle, ipBufferHeaderInput))
+				{
+				StopTest(KErrGeneral, EFail);
+				}
+			}
+		else
+			{
+			TCallBack callback03 (RAsyncTestStepOmxILPcmRenderer0005Step03, this);
+			delete ipKickoff03;
+			ipKickoff03 = NULL;
+			ipKickoff03 =
+				new (ELeave) CAsyncCallBack (callback03, CActive::EPriorityLow);
+			ipKickoff03->Call();
+			}
+		}
+	}
+
+TInt
+RAsyncTestStepOmxILPcmRenderer0010::RAsyncTestStepOmxILPcmRenderer0010Step01(TAny* aPtr)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0010::RAsyncTestStepOmxILPcmRenderer0010Step01"));
+	RAsyncTestStepOmxILPcmRenderer0010* self =
+		static_cast<RAsyncTestStepOmxILPcmRenderer0010*> (aPtr);
+	self->DoRAsyncTestStepOmxILPcmRenderer0010Step01();
+	return KErrNone;
+	}
+
+void
+RAsyncTestStepOmxILPcmRenderer0010::DoRAsyncTestStepOmxILPcmRenderer0010Step01()
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0010::DoRAsyncTestStepOmxILPcmRenderer0010Step01"));
+
+	//
+	// Provide callbacks to component
+	//
+	OMX_CALLBACKTYPE* omxCallbacks = *ipCallbackHandler;
+
+	if (OMX_ErrorNone != ipCompHandle->SetCallbacks(
+			ipCompHandle,
+			omxCallbacks,
+			ipCallbackHandler))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	INFO_PRINTF2(_L("Component Callbacks set successfully: %X"), ipCallbackHandler);
+
+	//
+	// Obtain the port def params for Port #0
+	//
+	OMX_PARAM_PORTDEFINITIONTYPE portParamsInputPort;
+	portParamsInputPort.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE);
+	portParamsInputPort.nVersion = TOmxILSpecVersion();
+	portParamsInputPort.nPortIndex = 0;
+	if (OMX_ErrorNone != ipCompHandle->GetParameter(
+			ipCompHandle,
+			OMX_IndexParamPortDefinition,
+			&portParamsInputPort))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+	
+	//
+	// Change the sampling rate on PCM Renderer's port #0
+	//
+	OMX_AUDIO_PARAM_PCMMODETYPE pcmMode;
+	pcmMode.nSize = sizeof(OMX_AUDIO_PARAM_PCMMODETYPE);
+	pcmMode.nVersion = TOmxILSpecVersion();
+	pcmMode.nPortIndex = 0;
+	if (OMX_ErrorNone != ipCompHandle->GetParameter(
+			ipCompHandle,
+			OMX_IndexParamAudioPcm,
+			&pcmMode))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+	pcmMode.nSamplingRate = 44100;
+	if (OMX_ErrorNone != ipCompHandle->SetParameter(
+			ipCompHandle,
+			OMX_IndexParamAudioPcm,
+			&pcmMode))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	//
+	// Move component to OMX_StateIdle
+	//
+
+	if (OMX_ErrorNone != ipCompHandle->SendCommand(
+			ipCompHandle,
+			OMX_CommandStateSet,
+			OMX_StateIdle,
+			0))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Moving component to OMX_StateIdle"));
+
+	OMX_STATETYPE compState;
+	if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle,
+												&compState))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+	PrintOmxState(compState);
+
+	if (OMX_StateLoaded != compState)
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+
+
+	//
+	// Allocate buffer on input port
+	//
+	if (OMX_ErrorNone != ipCompHandle->AllocateBuffer(
+			ipCompHandle,
+			&ipBufferHeaderInput,
+			0, // input port
+			0,
+			portParamsInputPort.nBufferSize))
+		{
+		return StopTest(KErrGeneral, EFail);
+		}
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Populated buffer (AllocateBuffer) in INPUT port"));
+	}
+
+
+//
+// RAsyncTestStepOmxILPcmRenderer0030
+//
+RAsyncTestStepOmxILPcmRenderer0030::RAsyncTestStepOmxILPcmRenderer0030(const TDesC& aTestName, TInt aComponentUid)
+	:
+	RAsyncTestStepOmxILPcmRenderer0008(aTestName, aComponentUid)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0030::RAsyncTestStepOmxILPcmRenderer0030"));
+	}
+
+
+void
+RAsyncTestStepOmxILPcmRenderer0030::KickoffTestL()
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0030::KickoffTestL"));
+	iTestState = EStateLoadKickoffTestLComplete;
+
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test30 "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(AllocateBuffer-population) "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Executing "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Repeat these two steps until the whole file has beeen empited "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2a. - Call EmptyThisBuffer on PCM Renderer "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2b. - EmptyBufferDone callback received "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2c. - Get Bytes Played parameter and compare with the bytes readed from file "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Executing->Idle(BufferFlushing) "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Idle->Loaded(Depopulation) "));
+
+	// This will change the test file
+	iTestFileName.Set(KPcmRendererTestFile);
+	
+	// This will install one callback
+	RAsyncTestStepOmxILComponentBase::KickoffTestL();
+
+	TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0005Step01, this);
+	delete ipKickoff01;
+	ipKickoff01 = NULL;
+	ipKickoff01 =
+		new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow);
+	ipKickoff01->Call();
+	}
+
+void
+RAsyncTestStepOmxILPcmRenderer0030::DoEmptyBufferDoneL(OMX_HANDLETYPE /*aComponent*/,
+													 OMX_BUFFERHEADERTYPE* /*aBuffer*/)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0030::DoEmptyBufferDoneL"));
+	INFO_PRINTF1(_L("DoEmptyBufferDoneL : Callback received "));
+	
+	// Check that GetConfig is returning the correct amount of bytes played
+	OMX_SYMBIAN_AUDIO_CONFIG_PCM_BYTESPLAYED bytesPlayedStruct;
+	bytesPlayedStruct.nSize = sizeof(OMX_SYMBIAN_AUDIO_CONFIG_PCM_BYTESPLAYED);
+	bytesPlayedStruct.nVersion = TOmxILSpecVersion();
+	if (OMX_ErrorNone != ipCompHandle->GetConfig(ipCompHandle, 
+												 static_cast<OMX_INDEXTYPE>(OMX_SymbianIndexConfigAudioBytesPlayed), 
+												 &bytesPlayedStruct))
+		{
+		StopTest(KErrGeneral, EFail);
+		}
+	//check the number of bytes played by the device corresponds
+	//to the number of bytes readed from file
+	//allow an extra margin of one buffer.
+	TUint maxAllowedBytesPlayed =ipTestFile->GetPos();
+	if (bytesPlayedStruct.nBytesPlayed > maxAllowedBytesPlayed)
+		{
+		StopTest(KErrGeneral, EFail);
+		}
+	
+	CMMFDataBuffer& dataBuffer = *(static_cast<CMMFDataBuffer*>(ipBufferHeaderInput->pInputPortPrivate));
+	ipTestFile->ReadNextBuffer(dataBuffer);
+	
+	if (dataBuffer.BufferSize() > 0)
+		{
+		// Send a buffer to the input port
+		ipBufferHeaderInput->nFilledLen = dataBuffer.BufferSize();
+		
+		if (OMX_ErrorNone != ipCompHandle->EmptyThisBuffer(
+				ipCompHandle, ipBufferHeaderInput))
+			{
+			StopTest(KErrGeneral, EFail);
+			}
+		}
+	else
+		{
+		TCallBack callback03 (RAsyncTestStepOmxILPcmRenderer0005Step03, this);
+		delete ipKickoff03;
+		ipKickoff03 = NULL;
+		ipKickoff03 =
+			new (ELeave) CAsyncCallBack (callback03, CActive::EPriorityLow);
+		ipKickoff03->Call();
+		}
+	}
+
+//
+// RAsyncTestStepOmxILPcmRenderer0031
+//
+RAsyncTestStepOmxILPcmRenderer0031::RAsyncTestStepOmxILPcmRenderer0031(const TDesC& aTestName, TInt aComponentUid)
+	:
+	RAsyncTestStepOmxILPcmRenderer0008(aTestName, aComponentUid)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0031::RAsyncTestStepOmxILPcmRenderer0031"));
+    iSamplingRate = 44100;    
+	}
+
+
+void
+RAsyncTestStepOmxILPcmRenderer0031::KickoffTestL()
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0031::KickoffTestL"));
+	iTestState = EStateLoadKickoffTestLComplete;
+
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test31 "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(AllocateBuffer-population) "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Executing "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Repeat these two steps until the whole file has beeen empited "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2a. - Call EmptyThisBuffer on PCM Renderer "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2b. - EmptyBufferDone callback received "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Set Volume Ramp to 2s (after 5 buffers played) "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Executing->Idle(BufferFlushing) "));
+	INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 5.- Idle->Loaded(Depopulation) "));
+
+	// This will change the test file
+	iTestFileName.Set(KPcmRendererTestFile2);
+	
+	// This will install one callback
+	RAsyncTestStepOmxILComponentBase::KickoffTestL();
+
+	TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0005Step01, this);
+	delete ipKickoff01;
+	ipKickoff01 = NULL;
+	ipKickoff01 =
+		new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow);
+	ipKickoff01->Call();
+	}
+
+void
+RAsyncTestStepOmxILPcmRenderer0031::DoEmptyBufferDoneL(OMX_HANDLETYPE /*aComponent*/,
+													 OMX_BUFFERHEADERTYPE* /*aBuffer*/)
+	{
+    DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0031::DoEmptyBufferDoneL"));
+	INFO_PRINTF1(_L("DoEmptyBufferDoneL : Callback received "));
+	
+	iNumOfEmptiedBuffers++;
+	if (iNumOfEmptiedBuffers == 5)
+		{
+		OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP volumeRampStruct;
+		volumeRampStruct.nSize = sizeof(OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP);
+		volumeRampStruct.nVersion = TOmxILSpecVersion();
+		volumeRampStruct.nPortIndex = 0;
+		if (OMX_ErrorNone != ipCompHandle->GetConfig(ipCompHandle, 
+													 static_cast<OMX_INDEXTYPE>(OMX_SymbianIndexConfigAudioPcmVolumeRamp), 
+													 &volumeRampStruct))
+			{
+			StopTest(KErrGeneral, EFail);
+			}
+		volumeRampStruct.nRampDuration = 2000000;	// 2 second
+		if (OMX_ErrorNone != ipCompHandle->SetConfig(ipCompHandle, 
+													 static_cast<OMX_INDEXTYPE>(OMX_SymbianIndexConfigAudioPcmVolumeRamp), 
+													 &volumeRampStruct))
+			{
+			StopTest(KErrGeneral, EFail);
+			}
+		INFO_PRINTF1(_L("Volume ramp set"));
+		}
+
+	CMMFDataBuffer& dataBuffer = *(static_cast<CMMFDataBuffer*>(ipBufferHeaderInput->pInputPortPrivate));
+	ipTestFile->ReadNextBuffer(dataBuffer);
+	
+	if (dataBuffer.BufferSize() > 0)
+		{
+		// Send a buffer to the input port
+		ipBufferHeaderInput->nFilledLen = dataBuffer.BufferSize();
+		
+		if (OMX_ErrorNone != ipCompHandle->EmptyThisBuffer(
+				ipCompHandle, ipBufferHeaderInput))
+			{
+			StopTest(KErrGeneral, EFail);
+			}
+		}
+	else
+		{
+		TCallBack callback03 (RAsyncTestStepOmxILPcmRenderer0005Step03, this);
+		delete ipKickoff03;
+		ipKickoff03 = NULL;
+		ipKickoff03 =
+			new (ELeave) CAsyncCallBack (callback03, CActive::EPriorityLow);
+		ipKickoff03->Call();
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmrenderer/unittest/src/tsu_omxil_pcmrenderer_step.h	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,704 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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
+ @internalComponent
+*/
+
+#ifndef TSU_OMXIL_PCMRENDERER_STEP_H
+#define TSU_OMXIL_PCMRENDERER_STEP_H
+
+#include "tsu_omxil_component_base.h"
+
+
+// Forward declarations
+class CMMFDescriptorBuffer;
+
+//
+// RAsyncTestStepOmxILPcmRenderer0020
+//
+// Test20 Description
+//     -# Init Component
+//          -# Obtain the component's state (GetState)
+//          -# Obtain the component's version (GetComponentVersion)
+//          -# Provide callbacks to component (SetCallbacks)
+//          -# Obtain component's role #1 (ComponentRoleEnum)
+//          -# Obtain component's role #2 (ComponentRoleEnum fails with OMX_ErrorNoMore)
+//
+class RAsyncTestStepOmxILPcmRenderer0020 : public RAsyncTestStepOmxILComponentBase
+	{
+
+public:
+
+	RAsyncTestStepOmxILPcmRenderer0020(const TDesC& aTestName, TInt aComponentUid);
+
+	// From RAsyncTestStep
+	void KickoffTestL();
+	void CloseTest();
+
+
+	//
+	void DoEventHandlerL(OMX_HANDLETYPE aComponent,
+						OMX_EVENTTYPE aEvent,
+						TUint aData1,
+						TUint aData2,
+						TAny* aExtra);
+
+
+protected:
+
+	// Call backs
+	static TInt RAsyncTestStepOmxILPcmRenderer0020Step01(TAny* aPtr);
+	void DoRAsyncTestStepOmxILPcmRenderer0020Step01();
+
+protected:
+
+	CAsyncCallBack* ipKickoff01;
+	CAsyncCallBack* ipKickoff02;
+	CAsyncCallBack* ipKickoff03;
+	CAsyncCallBack* ipKickoff04;
+	CAsyncCallBack* ipKickoff05;
+	CAsyncCallBack* ipKickoff06;
+
+	};
+
+// Test21 Description
+//     -# Init Component
+//          -# Provide callbacks to component (SetCallbacks)
+//          -# Obtain the component's state (GetState)
+//          -# Obtain component's role #1 with null string (ComponentRoleEnum fails with OMX_ErrorBadParameter)
+//          -# Obtain component's role #1 (ComponentRoleEnum successfully returns audio_decoder.aac)
+//          -# Obtain component's role #2 (ComponentRoleEnum fails with OMX_ErrorNoMore)
+//
+class RAsyncTestStepOmxILPcmRenderer0021 : public RAsyncTestStepOmxILComponentBase
+	{
+
+public:
+
+	RAsyncTestStepOmxILPcmRenderer0021(const TDesC& aTestName, TInt aComponentUid);
+
+	// From RAsyncTestStep
+	void KickoffTestL();
+	void CloseTest();
+
+
+	//
+	void DoEventHandlerL(OMX_HANDLETYPE aComponent,
+						OMX_EVENTTYPE aEvent,
+						TUint aData1,
+						TUint aData2,
+						TAny* aExtra);
+
+
+protected:
+
+	// Call backs
+	static TInt RAsyncTestStepOmxILPcmRenderer0021Step01(TAny* aPtr);
+	void DoRAsyncTestStepOmxILPcmRenderer0021Step01();
+
+protected:
+
+	CAsyncCallBack* ipKickoff01;
+	CAsyncCallBack* ipKickoff02;
+	CAsyncCallBack* ipKickoff03;
+	CAsyncCallBack* ipKickoff04;
+	CAsyncCallBack* ipKickoff05;
+	CAsyncCallBack* ipKickoff06;
+
+	};
+
+// Test22 Description
+//     -# Init Component
+//          -# Provide callbacks to component (SetCallbacks)
+//          -# Obtain the component's state (GetState)
+//          -# Get component's current role (GetParameter(OMX_IndexParamStandardComponentRole) )
+//          -# Set unsupported audio_decoder.mp3 role (SetParameter(OMX_IndexParamStandardComponentRole) )
+//               -# SetParameter returns OMX_ErrorBadParameter (audio_decoder.mp3 role not supported)
+//
+class RAsyncTestStepOmxILPcmRenderer0022 : public RAsyncTestStepOmxILComponentBase
+	{
+
+public:
+
+	RAsyncTestStepOmxILPcmRenderer0022(const TDesC& aTestName, TInt aComponentUid);
+
+	// From RAsyncTestStep
+	void KickoffTestL();
+	void CloseTest();
+
+
+	//
+	void DoEventHandlerL(OMX_HANDLETYPE aComponent,
+						OMX_EVENTTYPE aEvent,
+						TUint aData1,
+						TUint aData2,
+						TAny* aExtra);
+
+
+protected:
+
+	// Call backs
+	static TInt RAsyncTestStepOmxILPcmRenderer0022Step01(TAny* aPtr);
+	void DoRAsyncTestStepOmxILPcmRenderer0022Step01();
+
+protected:
+
+	CAsyncCallBack* ipKickoff01;
+	CAsyncCallBack* ipKickoff02;
+	CAsyncCallBack* ipKickoff03;
+	CAsyncCallBack* ipKickoff04;
+	CAsyncCallBack* ipKickoff05;
+	CAsyncCallBack* ipKickoff06;
+
+	};
+
+
+
+//
+// RAsyncTestStepOmxILPcmRenderer0001
+//
+// Test01
+//     -# Init Component
+//          -# Loaded->Idle(AllocateBuffer-population)
+//          -# Idle->Loaded(depopulation)
+//
+class RAsyncTestStepOmxILPcmRenderer0001 : public RAsyncTestStepOmxILComponentBase
+	{
+
+public:
+
+	RAsyncTestStepOmxILPcmRenderer0001(const TDesC& aTestName, TInt aComponentUid);
+
+	// From RAsyncTestStep
+	void KickoffTestL();
+	void CloseTest();
+
+
+	//
+	void DoEventHandlerL(OMX_HANDLETYPE aComponent,
+						OMX_EVENTTYPE aEvent,
+						TUint aData1,
+						TUint aData2,
+						TAny* aExtra);
+
+
+protected:
+
+	// Call backs
+	static TInt RAsyncTestStepOmxILPcmRenderer0001Step01(TAny* aPtr);
+	void DoRAsyncTestStepOmxILPcmRenderer0001Step01();
+
+	static TInt RAsyncTestStepOmxILPcmRenderer0001Step02(TAny* aPtr);
+	void DoRAsyncTestStepOmxILPcmRenderer0001Step02();
+
+protected:
+
+
+	// Set of states for simple state machine
+	enum TTestState
+		{
+		EStateDefault,
+		EStateLoadKickoffTestLComplete,
+		EStateTransitionToLoadedComplete,
+		EStateTransitionToIdleComplete,
+		EStateTransitionToWaiForResourcesComplete,
+		EStateTransitionToPauseComplete,
+		EStateTransitionToExecutingComplete,
+		};
+
+	OMX_BUFFERHEADERTYPE* ipBufferHeaderInput;
+	OMX_BUFFERHEADERTYPE* ipBufferHeaderOutput;
+	RArray<OMX_BUFFERHEADERTYPE*> ipClientClockPortBufferArray;
+	
+	TBool iTerminateNow;
+	TInt iSamplingRate;
+
+	TTestState iTestState;
+
+	CAsyncCallBack* ipKickoff01;
+	CAsyncCallBack* ipKickoff02;
+	CAsyncCallBack* ipKickoff03;
+	CAsyncCallBack* ipKickoff04;
+	CAsyncCallBack* ipKickoff05;
+	CAsyncCallBack* ipKickoff06;
+
+	};
+
+//
+// RAsyncTestStepOmxILPcmRenderer0002
+//
+// Test02
+//     -# Init Component
+//          -# Loaded->Idle(UseBuffer-population)
+//          -# Idle->Loaded(depopulation)
+//
+class RAsyncTestStepOmxILPcmRenderer0002 : public RAsyncTestStepOmxILPcmRenderer0001
+	{
+
+public:
+
+	RAsyncTestStepOmxILPcmRenderer0002(const TDesC& aTestName, TInt aComponentUid);
+
+	// From RAsyncTestStep
+	void KickoffTestL();
+	void CloseTest();
+
+
+	//
+	void DoEventHandlerL(OMX_HANDLETYPE aComponent,
+						OMX_EVENTTYPE aEvent,
+						TUint aData1,
+						TUint aData2,
+						TAny* aExtra);
+
+
+protected:
+
+	// Call backs
+	static TInt RAsyncTestStepOmxILPcmRenderer0002Step01(TAny* aPtr);
+	void DoRAsyncTestStepOmxILPcmRenderer0002Step01();
+
+	static TInt RAsyncTestStepOmxILPcmRenderer0002Step02(TAny* aPtr);
+	// void DoRAsyncTestStepOmxILPcmRenderer0002Step02();
+
+
+protected:
+
+	CMMFDescriptorBuffer* ipInputBuffer;
+	CMMFDescriptorBuffer* ipOutputBuffer;
+	RArray<CMMFDescriptorBuffer*> iClockPortBufferPtrArray;
+	};
+
+//
+// RAsyncTestStepOmxILPcmRenderer0003
+//
+// Test03
+//     -# Init Component
+//          -# Loaded->WaitForResources
+//          -# WaitForResources->Loaded
+//
+class RAsyncTestStepOmxILPcmRenderer0003 : public RAsyncTestStepOmxILComponentBase
+	{
+
+public:
+
+	RAsyncTestStepOmxILPcmRenderer0003(const TDesC& aTestName, TInt aComponentUid);
+
+	// From RAsyncTestStep
+	void KickoffTestL();
+	void CloseTest();
+
+
+	//
+	void DoEventHandlerL(OMX_HANDLETYPE aComponent,
+						OMX_EVENTTYPE aEvent,
+						TUint aData1,
+						TUint aData2,
+						TAny* aExtra);
+
+
+protected:
+
+	// Call backs
+	static TInt RAsyncTestStepOmxILPcmRenderer0003Step01(TAny* aPtr);
+	void DoRAsyncTestStepOmxILPcmRenderer0003Step01();
+
+	static TInt RAsyncTestStepOmxILPcmRenderer0003Step02(TAny* aPtr);
+	void DoRAsyncTestStepOmxILPcmRenderer0003Step02();
+
+
+protected:
+
+	TBool iTerminateNow;
+
+	CAsyncCallBack* ipKickoff01;
+	CAsyncCallBack* ipKickoff02;
+	CAsyncCallBack* ipKickoff03;
+	CAsyncCallBack* ipKickoff04;
+	CAsyncCallBack* ipKickoff05;
+	CAsyncCallBack* ipKickoff06;
+
+
+	};
+
+//
+// RAsyncTestStepOmxILPcmRenderer0004
+//
+// Test04
+//     -# Init Component
+//          -# Loaded->Idle(AllocateBuffer-population)
+//          -# Idle->Pause
+//          -# Pause->Idle
+//          -# Idle->Loaded(depopulation)
+//
+class RAsyncTestStepOmxILPcmRenderer0004 : public RAsyncTestStepOmxILPcmRenderer0001
+	{
+
+public:
+
+	RAsyncTestStepOmxILPcmRenderer0004(const TDesC& aTestName, TInt aComponentUid);
+
+	// From RAsyncTestStep
+	void KickoffTestL();
+	void CloseTest();
+
+
+	//
+	void DoEventHandlerL(OMX_HANDLETYPE aComponent,
+						OMX_EVENTTYPE aEvent,
+						TUint aData1,
+						TUint aData2,
+						TAny* aExtra);
+
+
+protected:
+
+	// Call backs
+	static TInt RAsyncTestStepOmxILPcmRenderer0004Step01(TAny* aPtr);
+	// void DoRAsyncTestStepOmxILPcmRenderer0004Step01();
+
+	static TInt RAsyncTestStepOmxILPcmRenderer0004Step02(TAny* aPtr);
+	void DoRAsyncTestStepOmxILPcmRenderer0004Step02();
+
+	static TInt RAsyncTestStepOmxILPcmRenderer0004Step03(TAny* aPtr);
+	void DoRAsyncTestStepOmxILPcmRenderer0004Step03();
+
+	static TInt RAsyncTestStepOmxILPcmRenderer0004Step04(TAny* aPtr);
+	// void DoRAsyncTestStepOmxILPcmRenderer0004Step04();
+
+	};
+
+//
+// RAsyncTestStepOmxILPcmRenderer0005
+//
+// Test05
+//     -# Init Component
+//     -# Loaded->Idle(AllocateBuffer-population)
+//     -# Idle->Executing
+//          -# Call EmptyThisBuffer on PCM Renderer
+//          -# EmptyBufferDone callbacks received
+//     -# Executing->Idle(BufferFlushing)
+//     -# Idle->Loaded(Depopulation)
+//
+class RAsyncTestStepOmxILPcmRenderer0005 : public RAsyncTestStepOmxILPcmRenderer0004
+	{
+
+public:
+
+	RAsyncTestStepOmxILPcmRenderer0005(const TDesC& aTestName, TInt aComponentUid);
+
+	// From RAsyncTestStep
+	void KickoffTestL();
+	void CloseTest();
+
+
+	//
+	void DoEventHandlerL(OMX_HANDLETYPE aComponent,
+						OMX_EVENTTYPE aEvent,
+						TUint aData1,
+						TUint aData2,
+						TAny* aExtra);
+
+	void DoEmptyBufferDoneL(OMX_HANDLETYPE aComponent,
+						   OMX_BUFFERHEADERTYPE* aBuffer);
+
+protected:
+
+	// Call backs
+	static TInt RAsyncTestStepOmxILPcmRenderer0005Step01(TAny* aPtr);
+	// void DoRAsyncTestStepOmxILPcmRenderer0005Step01();
+
+	static TInt RAsyncTestStepOmxILPcmRenderer0005Step02(TAny* aPtr);
+	void DoRAsyncTestStepOmxILPcmRenderer0005Step02();
+
+	static TInt RAsyncTestStepOmxILPcmRenderer0005Step03(TAny* aPtr);
+	// void DoRAsyncTestStepOmxILPcmRenderer0005Step03();
+
+	static TInt RAsyncTestStepOmxILPcmRenderer0005Step04(TAny* aPtr);
+	// void DoRAsyncTestStepOmxILPcmRenderer0005Step04();
+	};
+
+//
+// RAsyncTestStepOmxILPcmRenderer0006
+//
+// Test06
+//     -# Init Component
+//         -# Loaded->Idle(AllocateBuffer-population)
+//         -# Idle->Executing
+//         -# Executing->Pause
+//         -# Pause->Executing
+//         -# Executing->Idle(BufferFlushing)
+//         -# Idle->Loaded(depopulation)
+//
+class RAsyncTestStepOmxILPcmRenderer0006 : public RAsyncTestStepOmxILPcmRenderer0005
+	{
+
+public:
+
+	RAsyncTestStepOmxILPcmRenderer0006(const TDesC& aTestName, TInt aComponentUid);
+
+	// From RAsyncTestStep
+	void KickoffTestL();
+	void CloseTest();
+
+
+	//
+	void DoEventHandlerL(OMX_HANDLETYPE aComponent,
+						OMX_EVENTTYPE aEvent,
+						TUint aData1,
+						TUint aData2,
+						TAny* aExtra);
+
+
+protected:
+
+	// Call backs
+	static TInt RAsyncTestStepOmxILPcmRenderer0006Step01(TAny* aPtr);
+	// void DoRAsyncTestStepOmxILPcmRenderer0006Step01();
+
+	static TInt RAsyncTestStepOmxILPcmRenderer0006Step02(TAny* aPtr);
+	// void DoRAsyncTestStepOmxILPcmRenderer0006Step02();
+
+	static TInt RAsyncTestStepOmxILPcmRenderer0006Step03(TAny* aPtr);
+	void DoRAsyncTestStepOmxILPcmRenderer0006Step03();
+
+	static TInt RAsyncTestStepOmxILPcmRenderer0006Step04(TAny* aPtr);
+	// void DoRAsyncTestStepOmxILPcmRenderer0006Step04();
+
+	static TInt RAsyncTestStepOmxILPcmRenderer0006Step05(TAny* aPtr);
+	// void DoRAsyncTestStepOmxILPcmRenderer0006Step05();
+
+	static TInt RAsyncTestStepOmxILPcmRenderer0006Step06(TAny* aPtr);
+	// void DoRAsyncTestStepOmxILPcmRenderer0006Step06();
+
+	};
+
+//
+// RAsyncTestStepOmxILPcmRenderer0007
+//
+// Test07
+//     -# Init Component
+//         -# Loaded->Idle(AllocateBuffer-population)
+//         -# Idle->Executing
+//         -# Executing->Pause
+//         -# Pause->Idle(BufferFlushing)
+//         -# Idle->Loaded(depopulation)
+//
+class RAsyncTestStepOmxILPcmRenderer0007 : public RAsyncTestStepOmxILPcmRenderer0006
+	{
+
+public:
+
+	RAsyncTestStepOmxILPcmRenderer0007(const TDesC& aTestName, TInt aComponentUid);
+
+	// From RAsyncTestStep
+	void KickoffTestL();
+	void CloseTest();
+
+
+	//
+	void DoEventHandlerL(OMX_HANDLETYPE aComponent,
+						OMX_EVENTTYPE aEvent,
+						TUint aData1,
+						TUint aData2,
+						TAny* aExtra);
+
+
+protected:
+
+	// Call backs
+	static TInt RAsyncTestStepOmxILPcmRenderer0007Step01(TAny* aPtr);
+	// void DoRAsyncTestStepOmxILPcmRenderer0007Step01();
+
+	static TInt RAsyncTestStepOmxILPcmRenderer0007Step02(TAny* aPtr);
+	// void DoRAsyncTestStepOmxILPcmRenderer0007Step02();
+
+	static TInt RAsyncTestStepOmxILPcmRenderer0007Step03(TAny* aPtr);
+	// void DoRAsyncTestStepOmxILPcmRenderer0007Step03();
+
+	static TInt RAsyncTestStepOmxILPcmRenderer0007Step04(TAny* aPtr);
+	// void DoRAsyncTestStepOmxILPcmRenderer0007Step04();
+
+	static TInt RAsyncTestStepOmxILPcmRenderer0007Step05(TAny* aPtr);
+	// void DoRAsyncTestStepOmxILPcmRenderer0007Step05();
+	};
+
+//
+// RAsyncTestStepOmxILPcmRenderer0008
+//
+// Test08
+//     -# Init Component
+//     -# Loaded->Idle(AllocateBuffer-population)
+//     -# Idle->Executing
+//		-# Repeat these steps until the whole file has been emptied
+//          -# Call EmptyThisBuffer on PCM Renderer
+//          -# EmptyBufferDone callbacks received
+//     -# Executing->Idle(BufferFlushing)
+//     -# Idle->Loaded(Depopulation)
+//
+class RAsyncTestStepOmxILPcmRenderer0008 : public RAsyncTestStepOmxILPcmRenderer0005
+	{
+public:
+	RAsyncTestStepOmxILPcmRenderer0008(const TDesC& aTestName, TInt aComponentUid);
+
+	// From RAsyncTestStep
+	void KickoffTestL();
+
+	void DoEventHandlerL(OMX_HANDLETYPE aComponent,
+						OMX_EVENTTYPE aEvent,
+						TUint aData1,
+						TUint aData2,
+						TAny* aExtra);
+
+	void DoEmptyBufferDoneL(OMX_HANDLETYPE aComponent,
+						   OMX_BUFFERHEADERTYPE* aBuffer);
+	};
+	
+//
+// RAsyncTestStepOmxILPcmRenderer0009
+//
+// Test09
+//     -# Init Component
+//     -# Loaded->Idle(AllocateBuffer-population)
+//     -# Idle->Executing
+//		-# Repeat these steps until the whole file has been emptied
+//          -# Call EmptyThisBuffer on PCM Renderer
+//          -# EmptyBufferDone callbacks received
+//		-# Executing->Pause and Pause->Executing (after 5 and again after 10 buffers played)
+//     -# Executing->Idle(BufferFlushing)
+//     -# Idle->Loaded(Depopulation)
+//
+class RAsyncTestStepOmxILPcmRenderer0009 : public RAsyncTestStepOmxILPcmRenderer0008
+	{
+public:
+	RAsyncTestStepOmxILPcmRenderer0009(const TDesC& aTestName, TInt aComponentUid);
+
+	// From RAsyncTestStep
+	void KickoffTestL();
+	
+	void DoEventHandlerL(OMX_HANDLETYPE aComponent,
+			OMX_EVENTTYPE aEvent,
+			TUint aData1,
+			TUint aData2,
+			TAny* aExtra);
+
+	void DoEmptyBufferDoneL(OMX_HANDLETYPE aComponent,
+						   OMX_BUFFERHEADERTYPE* aBuffer);
+	
+private:
+	TInt iNumOfEmptiedBuffers;
+	};
+
+//
+// RAsyncTestStepOmxILPcmRenderer0010
+//
+// Test09
+//     -# Init Component
+//     -# Loaded->Idle(AllocateBuffer-population)
+//     -# Idle->Executing
+//		-# Repeat these steps until the whole file has been emptied
+//          -# Call EmptyThisBuffer on PCM Renderer
+//          -# EmptyBufferDone callbacks received
+//		-# Executing->Idle and Idle->Executing (after 5 and again after 10 buffers played)
+//     -# Executing->Idle(BufferFlushing)
+//     -# Idle->Loaded(Depopulation)
+//
+class RAsyncTestStepOmxILPcmRenderer0010 : public RAsyncTestStepOmxILPcmRenderer0008
+	{
+public:
+	RAsyncTestStepOmxILPcmRenderer0010(const TDesC& aTestName, TInt aComponentUid);
+
+	// From RAsyncTestStep
+	void KickoffTestL();
+	
+	void DoEventHandlerL(OMX_HANDLETYPE aComponent,
+			OMX_EVENTTYPE aEvent,
+			TUint aData1,
+			TUint aData2,
+			TAny* aExtra);
+
+	void DoEmptyBufferDoneL(OMX_HANDLETYPE aComponent,
+						   OMX_BUFFERHEADERTYPE* aBuffer);
+
+protected:
+
+	// Call backs
+	static TInt RAsyncTestStepOmxILPcmRenderer0010Step01(TAny* aPtr);
+	void DoRAsyncTestStepOmxILPcmRenderer0010Step01();
+
+private:
+
+
+	TInt iNumOfEmptiedBuffers;
+	};
+
+//
+// RAsyncTestStepOmxILPcmRenderer0030
+//
+// Test30
+//     -# Init Component
+//     -# Loaded->Idle(AllocateBuffer-population)
+//     -# Idle->Executing
+//		-# Repeat these steps until the whole file has been emptied
+//          -# Call EmptyThisBuffer on PCM Renderer
+//          -# EmptyBufferDone callbacks received
+//			 -# Get Bytes Played parameter and compare with the bytes readed from file
+//     -# Executing->Idle(BufferFlushing)
+//     -# Idle->Loaded(Depopulation)
+//
+class RAsyncTestStepOmxILPcmRenderer0030 : public RAsyncTestStepOmxILPcmRenderer0008
+	{
+public:
+	RAsyncTestStepOmxILPcmRenderer0030(const TDesC& aTestName, TInt aComponentUid);
+
+	// From RAsyncTestStep
+	void KickoffTestL();
+
+	void DoEmptyBufferDoneL(OMX_HANDLETYPE aComponent,
+						   OMX_BUFFERHEADERTYPE* aBuffer);
+	};
+
+//
+// RAsyncTestStepOmxILPcmRenderer0031
+//
+// Test09
+//     -# Init Component
+//     -# Loaded->Idle(AllocateBuffer-population)
+//     -# Idle->Executing
+//		-# Repeat these steps until the whole file has been emptied
+//          -# Call EmptyThisBuffer on PCM Renderer
+//          -# EmptyBufferDone callbacks received
+//		-# Set Volume Ramp to 2s (after 5 buffers played)
+//     -# Executing->Idle(BufferFlushing)
+//     -# Idle->Loaded(Depopulation)
+//
+class RAsyncTestStepOmxILPcmRenderer0031 : public RAsyncTestStepOmxILPcmRenderer0008
+	{
+public:
+	RAsyncTestStepOmxILPcmRenderer0031(const TDesC& aTestName, TInt aComponentUid);
+
+	// From RAsyncTestStep
+	void KickoffTestL();
+
+	void DoEmptyBufferDoneL(OMX_HANDLETYPE aComponent,
+						   OMX_BUFFERHEADERTYPE* aBuffer);
+	
+private:
+	TInt iNumOfEmptiedBuffers;
+	};
+
+#endif // TSU_OMXIL_PCMRENDERER_STEP_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmrenderer/unittest/src/tsu_omxil_pcmrenderer_suite.cpp	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,170 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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
+ @internalComponent
+*/
+
+#include <e32base.h>
+
+#include "log.h"
+#include "tsu_omxil_pcmrenderer_suite.h"
+#include "tsu_omxil_pcmrenderer_step.h"
+#include "omxilpcmrenderer.hrh"
+
+/**
+ *
+ * NewTestSuiteL
+ *	NewTestSuite is exported at ordinal 1
+ *	this provides the interface to allow schedule test
+ *	to create instances of this test suite
+ * @result CTestSuiteOmxILPcmRenderer*
+ *
+ */
+EXPORT_C CTestSuiteOmxILPcmRenderer* NewTestSuiteL()
+	{
+	CTestSuiteOmxILPcmRenderer* result = new (ELeave) CTestSuiteOmxILPcmRenderer;
+	CleanupStack::PushL(result);
+	result->ConstructL();
+	CleanupStack::Pop(); // result
+	return result;
+	}
+
+/**
+ *
+ * CTestSuiteOmxILPcmRenderer
+ *
+ */
+CTestSuiteOmxILPcmRenderer::CTestSuiteOmxILPcmRenderer()
+	{
+    DEBUG_PRINTF(_L8("CTestSuiteOmxILPcmRenderer::CTestSuiteOmxILPcmRenderer"));
+
+	}
+
+
+/**
+ *
+ * ~CTestSuiteOmxILPcmRenderer
+ *
+ */
+CTestSuiteOmxILPcmRenderer::~CTestSuiteOmxILPcmRenderer()
+	{
+    DEBUG_PRINTF(_L8("CTestSuiteOmxILPcmRenderer::~CTestSuiteOmxILPcmRenderer"));
+	}
+/**
+ *
+ * GetVersion
+ *	Get Test Suite version
+ * @result TPtrC
+ *
+ */
+TPtrC CTestSuiteOmxILPcmRenderer::GetVersion( void ) const
+	{
+	_LIT(KTxtVersion,"1.00");
+	return KTxtVersion();
+	}
+
+
+
+/**
+ *
+ * InitialiseL
+ *	Constructor for test suite
+ *	this creates all the test steps and
+ *	stores them inside CTestSuiteOmxILPcmRenderer
+ *
+ */
+void CTestSuiteOmxILPcmRenderer::InitialiseL(void)
+	{
+	// store the name of this test suite
+	iSuiteName = _L("TSU_OMXIL_PcmRenderer");
+
+	AddTestStepL(
+		new(ELeave) RAsyncTestStepOmxILPcmRenderer0020(
+			_L("MM-OMXIL-OMXILPcmRenderer-U-0020-HP"),
+			KUidSymbianOmxILPcmRenderer));
+
+	AddTestStepL(
+		new(ELeave) RAsyncTestStepOmxILPcmRenderer0021(
+			_L("MM-OMXIL-OMXILPcmRenderer-U-0021-HP"),
+			KUidSymbianOmxILPcmRenderer));
+
+	AddTestStepL(
+		new(ELeave) RAsyncTestStepOmxILPcmRenderer0022(
+			_L("MM-OMXIL-OMXILPcmRenderer-U-0022-HP"),
+			KUidSymbianOmxILPcmRenderer));
+
+	AddTestStepL(
+		new(ELeave) RAsyncTestStepOmxILPcmRenderer0001(
+			_L("MM-OMXIL-OMXILPcmRenderer-U-0001-HP"),
+			KUidSymbianOmxILPcmRenderer));
+
+	AddTestStepL(
+		new(ELeave) RAsyncTestStepOmxILPcmRenderer0002(
+			_L("MM-OMXIL-OMXILPcmRenderer-U-0002-HP"),
+			KUidSymbianOmxILPcmRenderer));
+
+	AddTestStepL(
+		new(ELeave) RAsyncTestStepOmxILPcmRenderer0003(
+			_L("MM-OMXIL-OMXILPcmRenderer-U-0003-HP"),
+			KUidSymbianOmxILPcmRenderer));
+
+	AddTestStepL(
+		new(ELeave) RAsyncTestStepOmxILPcmRenderer0004(
+			_L("MM-OMXIL-OMXILPcmRenderer-U-0004-HP"),
+			KUidSymbianOmxILPcmRenderer));
+
+	AddTestStepL(
+		new(ELeave) RAsyncTestStepOmxILPcmRenderer0005(
+			_L("MM-OMXIL-OMXILPcmRenderer-U-0005-HP"),
+			KUidSymbianOmxILPcmRenderer));
+
+	AddTestStepL(
+		new(ELeave) RAsyncTestStepOmxILPcmRenderer0006(
+			_L("MM-OMXIL-OMXILPcmRenderer-U-0006-HP"),
+			KUidSymbianOmxILPcmRenderer));
+
+	AddTestStepL(
+		new(ELeave) RAsyncTestStepOmxILPcmRenderer0007(
+			_L("MM-OMXIL-OMXILPcmRenderer-U-0007-HP"),
+			KUidSymbianOmxILPcmRenderer));
+	
+	AddTestStepL(
+		new(ELeave) RAsyncTestStepOmxILPcmRenderer0008(
+			_L("MM-OMXIL-OMXILPcmRenderer-U-0008-HP"),
+			KUidSymbianOmxILPcmRenderer));
+	
+	AddTestStepL(
+		new(ELeave) RAsyncTestStepOmxILPcmRenderer0009(
+			_L("MM-OMXIL-OMXILPcmRenderer-U-0009-HP"),
+			KUidSymbianOmxILPcmRenderer));
+	
+	AddTestStepL(
+		new(ELeave) RAsyncTestStepOmxILPcmRenderer0010(
+			_L("MM-OMXIL-OMXILPcmRenderer-U-0010-HP"),
+			KUidSymbianOmxILPcmRenderer));
+	
+	AddTestStepL(
+		new(ELeave) RAsyncTestStepOmxILPcmRenderer0030(
+			_L("MM-OMXIL-OMXILPcmRenderer-U-0030-HP"),
+			KUidSymbianOmxILPcmRenderer));
+	
+	AddTestStepL(
+		new(ELeave) RAsyncTestStepOmxILPcmRenderer0031(
+			_L("MM-OMXIL-OMXILPcmRenderer-U-0031-HP"),
+			KUidSymbianOmxILPcmRenderer));
+
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmrenderer/unittest/src/tsu_omxil_pcmrenderer_suite.h	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,43 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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
+ @internalComponent
+*/
+
+#ifndef TSU_OMXIL_PCMRENDERER_SUITE_H
+#define TSU_OMXIL_PCMRENDERER_SUITE_H
+
+#include <testframework.h>
+
+/**
+ *
+ * CTestSuiteOmxILPcmRenderer defines the test suite for OMX IL PCM Renderer tests
+ * 
+ *
+ *
+ */
+class  CTestSuiteOmxILPcmRenderer : public CTestSuite
+	{
+
+public:
+CTestSuiteOmxILPcmRenderer();
+	void InitialiseL(void);
+	virtual ~CTestSuiteOmxILPcmRenderer();
+	virtual TPtrC GetVersion( void ) const;
+	};
+
+#endif // TSU_OMXIL_PCMRENDERER_SUITE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilaudioemulator/pcmrenderer/unittest/src/uids.hrh	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,26 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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 UIDS_HRH
+#define UIDS_HRH
+
+#define KSharedLibraryUidDefine 0x1000008d
+
+//  The following UID  has changed to fix the defect DEF123946 v9.5
+#define KUidTsuOmxILAacDecoderDll 0x10285E7C
+#define KUidTsuOmxILPcmRendererDll 0x10285C07
+
+#endif // UIDS_HRH
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/group/bld.inf	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,51 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifdef SYMBIAN_MM_OPENMAXIL_ADDITIONAL_COMPONENTS
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+omxilotherfilesink.iby							/epoc32/rom/include/omxilotherfilesink.iby
+omxilaudiofilesink.iby							/epoc32/rom/include/omxilaudiofilesink.iby
+omxilvideofilesink.iby							/epoc32/rom/include/omxilvideofilesink.iby	
+omxilimagefilesink.iby							/epoc32/rom/include/omxilimagefilesink.iby
+
+PRJ_MMPFILES
+../mmpfiles/omxilotherfilesink.mmp
+../mmpfiles/omxilaudiofilesink.mmp
+../mmpfiles/omxilvideofilesink.mmp
+../mmpfiles/omxilimagefilesink.mmp
+
+PRJ_TESTEXPORTS
+../tests/khronos_conformance/Khronos_file_sink_audio.txt		/epoc32/winscw/c/omxil/khronos/Khronos_file_sink_audio.txt
+../tests/khronos_conformance/Khronos_file_sink_image.txt		/epoc32/winscw/c/omxil/khronos/Khronos_file_sink_image.txt
+../tests/khronos_conformance/Khronos_file_sink_video.txt		/epoc32/winscw/c/omxil/khronos/Khronos_file_sink_video.txt
+../tests/khronos_conformance/Khronos_file_sink_other.txt		/epoc32/winscw/c/omxil/khronos/Khronos_file_sink_other.txt
+
+../tests/unit/te_omx_filesink.ini				/epoc32/winscw/c/omxil/tef/te_omx_filesink.ini				
+../tests/unit/te_omx_filesink_audio.script			/epoc32/winscw/c/omxil/tef/te_omx_filesink_audio.script			
+../tests/unit/te_omx_filesink_audio.xml				/epoc32/winscw/c/omxil/tef/te_omx_filesink_audio.xml			
+../tests/unit/te_omx_filesink_image.script			/epoc32/winscw/c/omxil/tef/te_omx_filesink_image.script			
+../tests/unit/te_omx_filesink_image.xml				/epoc32/winscw/c/omxil/tef/te_omx_filesink_image.xml			
+../tests/unit/te_omx_filesink_other.script			/epoc32/winscw/c/omxil/tef/te_omx_filesink_other.script			
+../tests/unit/te_omx_filesink_other.xml				/epoc32/winscw/c/omxil/tef/te_omx_filesink_other.xml			
+../tests/unit/te_omx_filesink_video.script			/epoc32/winscw/c/omxil/tef/te_omx_filesink_video.script			
+../tests/unit/te_omx_filesink_video.xml				/epoc32/winscw/c/omxil/tef/te_omx_filesink_video.xml			
+../tests/unit/te_omx_filesink_video_compatibility.script	/epoc32/winscw/c/omxil/tef/te_omx_filesink_video_compatibility.script	
+../tests/unit/te_omx_filesink_video_compatibility.xml		/epoc32/winscw/c/omxil/tef/te_omx_filesink_video_compatibility.xml		
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/group/omxilaudiofilesink.iby	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifndef OMXILAUDIOFILESINK_IBY_
+#define OMXILAUDIOFILESINK_IBY_
+
+#include <omxilcomp.iby>
+
+ECOM_PLUGIN(omxilaudiofilesink.dll, omxilaudiofilesink.rsc)
+
+#endif /*OMXILAUDIOFILESINK_IBY_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/group/omxilimagefilesink.iby	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifndef OMXILIMAGEFILESINK_IBY_
+#define OMXILIMAGEFILESINK_IBY_
+
+#include <omxilcomp.iby>
+
+ECOM_PLUGIN(omxilimagefilesink.dll, omxilimagefilesink.rsc)
+
+#endif /*OMXILIMAGEFILESINK_IBY_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/group/omxilotherfilesink.iby	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,26 @@
+/*
+* 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: 
+*
+*/
+
+
+#ifndef OMXILFILESINK_IBY_
+#define OMXILFILESINK_IBY_
+
+#include <omxilcomp.iby>
+
+ECOM_PLUGIN(omxilotherfilesink.dll, omxilotherfilesink.rsc)
+
+#endif /*OMXILFILESINK_IBY_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/group/omxilvideofilesink.iby	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#ifndef OMXILVIDEOFILESINK_IBY_
+#define OMXILVIDEOFILESINK_IBY_
+
+#include <omxilcomp.iby>
+
+ECOM_PLUGIN(omxilvideofilesink.dll, omxilvideofilesink.rsc)
+
+#endif /*OMXILVIDEOFILESINK_IBY_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/inc/omxilaudiofilesinkapb0port.h	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,59 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ * @file
+ * @internalTechnology
+ */
+
+#ifndef OMXILAUDIOFILESINKOPB0PORT_H
+#define OMXILAUDIOFILESINKOPB0PORT_H
+
+#include <openmax/il/common/omxilaudioport.h>
+#include "omxilfilesinkprocessingfunction.h"
+#include <openmax/il/khronos/v1_x/OMX_Other.h>
+
+class COmxILAudioFileSinkAPB0Port : public COmxILAudioPort
+	{
+public:
+	static COmxILAudioFileSinkAPB0Port* NewL(const TOmxILCommonPortData& aCommonPortData, 
+											const RArray<OMX_AUDIO_CODINGTYPE>& aSupportedAudioFormats, 
+											const COmxILFileSinkProcessingFunction& aFileSinkPF);
+	~COmxILAudioFileSinkAPB0Port();
+	
+	OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const;
+	OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const;
+
+	OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex, 
+								TAny* apComponentParameterStructure) const;
+	OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex, 
+								const TAny* apComponentParameterStructure, 
+								TBool& aUpdateProcessingFunction);
+
+private:
+	COmxILAudioFileSinkAPB0Port(const COmxILFileSinkProcessingFunction& aFileSinkPF);
+	void ConstructL(const TOmxILCommonPortData& aCommonPortData, const RArray<OMX_AUDIO_CODINGTYPE>& aSupportedAudioFormats);
+	OMX_ERRORTYPE SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, 
+											TBool& aUpdateProcessingFunction);
+	TBool IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const;
+
+private:
+	const COmxILFileSinkProcessingFunction& iFileSinkPF;
+	RBuf8 iMimeType;
+	};
+
+#endif // OMXILAUDIOFILESINKOPB0PORT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/inc/omxilfilesink.h	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,44 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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
+ * @internalTechnology
+ */
+
+#ifndef OMXILFILESINK_H
+#define OMXILFILESINK_H
+
+#include <openmax/il/common/omxilcomponent.h>
+
+class COmxILPort;
+class COmxILFileSinkProcessingFunction;
+
+NONSHARABLE_CLASS(COmxILFileSink) : public COmxILComponent
+	{		
+public:
+	static void CreateComponentL(OMX_HANDLETYPE aComponent);
+	~COmxILFileSink();
+	
+private:
+	COmxILFileSink();
+	void ConstructL(OMX_HANDLETYPE aComponent);
+	COmxILPort* ConstructPortL() const;
+
+	};
+	
+#endif // OMXILFILESINK_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/inc/omxilfilesink.hrh	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,39 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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 OMXILFILESINK_HRH_
+#define OMXILFILESINK_HRH_
+
+
+#define KUidNokiaOmxILAudioFileSinkDll     0x2002EAA4
+#define KUidNokiaOmxILAudioFileSink        0x2002EAA5
+
+
+#define KUidNokiaOmxILVideoFileSinkDll     0x2002EAA6
+#define KUidNokiaOmxILVideoFileSink        0x2002EAA7
+
+
+#define KUidNokiaOmxILImageFileSinkDll     0x2002EAA8
+#define KUidNokiaOmxILImageFileSink        0x2002EAA9
+
+
+#define KUidSymbianOmxIOtherLFileSinkDll     0x10285C92
+#define KUidSymbianOmxILOtherFileSink        0x10285C93
+
+
+
+#endif /*OMXILFILESINK_HRH_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/inc/omxilfilesinkconfigmanager.h	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,52 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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
+ * @internalTechnology
+ */
+
+#ifndef OMXILFILESINKCONFIGMANAGER_H
+#define OMXILFILESINKCONFIGMANAGER_H
+
+#include <openmax/il/common/omxilconfigmanager.h>
+
+class COmxILFileSinkProcessingFunction;
+
+NONSHARABLE_CLASS(COmxILFileSinkConfigManager) : public COmxILConfigManager
+	{
+public:
+	static COmxILFileSinkConfigManager* NewL(
+			const TDesC8& aComponentName,
+			const OMX_VERSIONTYPE& aComponentVersion,
+			const RPointerArray<TDesC8>& aComponentRoleList,
+			COmxILFileSinkProcessingFunction& aFileSinkPF);
+
+	~COmxILFileSinkConfigManager();
+	
+	OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex, TAny* apComponentParameterStructure) const;
+	OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex, const TAny* apComponentParameterStructure, OMX_BOOL aInitTime = OMX_TRUE);
+	
+private:
+	COmxILFileSinkConfigManager(COmxILFileSinkProcessingFunction& aFileSinkPF);
+	void ConstructL(const TDesC8& aComponentName, const OMX_VERSIONTYPE& aComponentVersion, const RPointerArray<TDesC8>& aComponentRoleList);
+
+private:
+	COmxILFileSinkProcessingFunction& iFileSinkPF;
+	};
+
+#endif // OMXILFILESINKCONFIGMANAGER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/inc/omxilfilesinkopb0port.h	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,59 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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
+ * @internalTechnology
+ */
+
+#ifndef OMXILFILESINKOPB0PORT_H
+#define OMXILFILESINKOPB0PORT_H
+
+#include <openmax/il/common/omxilotherport.h>
+#include "omxilfilesinkprocessingfunction.h"
+#include <openmax/il/khronos/v1_x/OMX_Other.h>
+
+class COmxILOtherFileSinkOPB0Port : public COmxILOtherPort
+	{
+public:
+	static COmxILOtherFileSinkOPB0Port* NewL(const TOmxILCommonPortData& aCommonPortData, 
+										const RArray<OMX_OTHER_FORMATTYPE>& aSupportedOtherFormats, 
+										const COmxILFileSinkProcessingFunction& aFileSinkPF);
+	~COmxILOtherFileSinkOPB0Port();
+	
+	OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const;
+	OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const;
+
+	OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex, 
+								TAny* apComponentParameterStructure) const;
+	OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex, 
+								const TAny* apComponentParameterStructure, 
+								TBool& aUpdateProcessingFunction);
+
+private:
+	COmxILOtherFileSinkOPB0Port(const TOmxILCommonPortData& aCommonPortData, 
+								const COmxILFileSinkProcessingFunction& aFileSinkPF);
+	void ConstructL(const RArray<OMX_OTHER_FORMATTYPE>& aSupportedOtherFormats);
+	OMX_ERRORTYPE SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, 
+											TBool& aUpdateProcessingFunction);
+	TBool IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const;
+
+private:
+	const COmxILFileSinkProcessingFunction& iFileSinkPF;
+	};
+
+#endif // OMXILFILESINKOPB0PORT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/inc/omxilfilesinkprocessingfunction.h	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,148 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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
+ * @internalTechnology
+ */
+
+#ifndef OMXILFILESINKPROCESSINGFUNCTION_H
+#define OMXILFILESINKPROCESSINGFUNCTION_H
+
+#include <openmax/il/common/omxilprocessingfunction.h>
+#include <openmax/il/khronos/v1_x/OMX_Component.h>
+#include <e32msgqueue.h>
+#include <f32file.h>
+
+class COmxILFileSinkProcessingFunction : public COmxILProcessingFunction
+	{
+public:
+	static COmxILFileSinkProcessingFunction* NewL(MOmxILCallbackNotificationIf& aCallbacks);
+	~COmxILFileSinkProcessingFunction();
+
+	OMX_ERRORTYPE StateTransitionIndication(TStateIndex aNewState);
+	OMX_ERRORTYPE BufferFlushingIndication(TUint32 aPortIndex, OMX_DIRTYPE aDirection);
+	OMX_ERRORTYPE ParamIndication(OMX_INDEXTYPE aParamIndex, const TAny* apComponentParameterStructure);
+	OMX_ERRORTYPE ConfigIndication(OMX_INDEXTYPE aConfigIndex, const TAny* apComponentConfigStructure);
+	OMX_ERRORTYPE BufferIndication(OMX_BUFFERHEADERTYPE* apBufferHeader, OMX_DIRTYPE aDirection);
+	OMX_BOOL BufferRemovalIndication(OMX_BUFFERHEADERTYPE* apBufferHeader, OMX_DIRTYPE aDirection);	
+	MOmxILCallbackNotificationIf& GetCallbacks();
+
+	/** can return NULL if parameter has not been set. */
+	const HBufC* FileName() const;
+	const HBufC8* Uri() const;
+
+private:
+	COmxILFileSinkProcessingFunction(MOmxILCallbackNotificationIf& aCallbacks);
+	void ConstructL();
+
+	void InitFileAndUriL();
+	OMX_ERRORTYPE SetFileName(const OMX_PARAM_CONTENTURITYPE* aContentUriType);
+			
+private:
+	RPointerArray<OMX_BUFFERHEADERTYPE> iBuffersToEmpty;
+	OMX_STATETYPE iState;
+	HBufC8* ipUri;
+	HBufC* ipFileName;
+
+private:
+	class CPFHelper;
+	class CFileSinkAccess : public CActive
+		{
+	friend class CPFHelper;
+	public:
+		static CFileSinkAccess* NewL(COmxILFileSinkProcessingFunction& aParent);
+		~CFileSinkAccess();
+
+		// from CActive
+		void RunL();
+		void DoCancel();
+
+		TInt Execute();
+		void Pause();
+		void Stop();
+		void Idle();
+		
+		TInt ProcessNextBuffer();
+
+	private:
+		CFileSinkAccess(COmxILFileSinkProcessingFunction& aParent);
+		void ConstructL();
+		
+	private:
+		COmxILFileSinkProcessingFunction& iParent;
+		OMX_BUFFERHEADERTYPE* iCurrentBuffer;
+		
+		RFs iFs;
+		RFile iFileHandle;
+		TInt iBufferOffset;
+		TPtr8 iWriteBuffer;
+		
+		} *ipFileSinkAccess;
+
+	class CPFHelper : public CActive
+		{
+	public:
+		static CPFHelper* NewL(COmxILFileSinkProcessingFunction& aParent, CFileSinkAccess& aFileSinkAccess);
+		~CPFHelper();
+		
+		static OMX_ERRORTYPE ConvertSymbianErrorType(TInt aError);
+
+		// from CActive
+		void RunL();
+		void DoCancel();
+
+		TInt ExecuteAsync();
+		TInt StopAsync();
+		TInt PauseAsync();
+		void StopSync();
+		TInt IdleAsync();
+		TInt BufferIndication(OMX_BUFFERHEADERTYPE* apBufferHeader);
+
+		enum TMessageType 
+			{
+			EExecuteCommand,
+			EStopCommand,
+			EPauseCommand,
+			ECancelCommand,
+			EBufferIndication,
+			EIdleCommand
+			};
+
+		class TProcMessage
+			{
+		public:
+			TMessageType iType;
+			TAny* iPtr;
+			};
+			
+		RMsgQueue<TProcMessage> iMsgQueue;
+	
+	private:
+		CPFHelper(COmxILFileSinkProcessingFunction& aParent, CFileSinkAccess& aFileSinkAccess);
+		void ConstructL();
+		
+		TInt ProcessQueue();
+
+	private:
+		COmxILFileSinkProcessingFunction& iParent;
+		CFileSinkAccess& iFileSinkAccess;
+		} *ipPFHelper;			
+	};
+
+#endif // OMXILFILESINKPROCESSINGFUNCTION_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/inc/omxilimagefilesinkipb0port.h	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,63 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ * @file
+ * @internalTechnology
+ */
+
+#ifndef OMXILIMAGEFILESINKOPB0PORT_H
+#define OMXILIMAGEFILESINKOPB0PORT_H
+
+#include <openmax/il/common/omxilimageport.h>
+#include "omxilfilesinkprocessingfunction.h"
+#include <openmax/il/khronos/v1_x/OMX_Other.h>
+
+class COmxILImageFileSinkIPB0Port : public COmxILImagePort
+	{
+public:
+	static COmxILImageFileSinkIPB0Port* NewL(const TOmxILCommonPortData& aCommonPortData, 
+                                            const RArray<OMX_IMAGE_CODINGTYPE>& aSupportedImageFormats,
+                                            const RArray<OMX_COLOR_FORMATTYPE>& aSupportedColorFormats,
+                                            const COmxILFileSinkProcessingFunction& aFileSinkPF);
+
+	~COmxILImageFileSinkIPB0Port();
+	
+	OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const;
+	OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const;
+
+	OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex, 
+								TAny* apComponentParameterStructure) const;
+	OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex, 
+								const TAny* apComponentParameterStructure, 
+								TBool& aUpdateProcessingFunction);
+
+private:
+	COmxILImageFileSinkIPB0Port(const COmxILFileSinkProcessingFunction& aFileSinkPF);
+	void ConstructL(const TOmxILCommonPortData& aCommonPortData,
+                    const RArray<OMX_IMAGE_CODINGTYPE>& aSupportedImageFormats,
+                    const RArray<OMX_COLOR_FORMATTYPE>& aSupportedColorFormats);
+	OMX_ERRORTYPE SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, 
+											TBool& aUpdateProcessingFunction);
+	TBool IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const;
+
+private:
+	const COmxILFileSinkProcessingFunction& iFileSinkPF;
+	RBuf8 iMimeType;
+	};
+
+#endif // OMXILIMAGEFILESINKOPB0PORT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/inc/omxilotherfilesinkopb0port.h	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,58 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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
+ * @internalTechnology
+ */
+
+#ifndef OMXILFILESINKOPB0PORT_H
+#define OMXILFILESINKOPB0PORT_H
+
+#include <openmax/il/common/omxilotherport.h>
+#include "omxilfilesinkprocessingfunction.h"
+#include <openmax/il/khronos/v1_x/OMX_Other.h>
+
+class COmxILOtherFileSinkOPB0Port : public COmxILOtherPort
+	{
+public:
+	static COmxILOtherFileSinkOPB0Port* NewL(const TOmxILCommonPortData& aCommonPortData, 
+										const RArray<OMX_OTHER_FORMATTYPE>& aSupportedOtherFormats, 
+										const COmxILFileSinkProcessingFunction& aFileSinkPF);
+	~COmxILOtherFileSinkOPB0Port();
+	
+	OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const;
+	OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const;
+
+	OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex, 
+								TAny* apComponentParameterStructure) const;
+	OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex, 
+								const TAny* apComponentParameterStructure, 
+								TBool& aUpdateProcessingFunction);
+
+private:
+	COmxILOtherFileSinkOPB0Port(const COmxILFileSinkProcessingFunction& aFileSinkPF);
+	void ConstructL(const TOmxILCommonPortData& aCommonPortData, const RArray<OMX_OTHER_FORMATTYPE>& aSupportedOtherFormats);
+	OMX_ERRORTYPE SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, 
+											TBool& aUpdateProcessingFunction);
+	TBool IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const;
+
+private:
+	const COmxILFileSinkProcessingFunction& iFileSinkPF;
+	};
+
+#endif // OMXILFILESINKOPB0PORT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/inc/omxilvideofilesinkvpb0port.h	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,63 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ * @file
+ * @internalTechnology
+ */
+
+#ifndef OMXILVIDEOFILESINKOPB0PORT_H
+#define OMXILVIDEOFILESINKOPB0PORT_H
+
+#include <openmax/il/common/omxilvideoport.h>
+#include "omxilfilesinkprocessingfunction.h"
+#include <openmax/il/khronos/v1_x/OMX_Other.h>
+
+class COmxILVideoFileSinkVPB0Port : public COmxILVideoPort
+	{
+public:
+	static COmxILVideoFileSinkVPB0Port* NewL(const TOmxILCommonPortData& aCommonPortData, 
+	                                         const RArray<OMX_VIDEO_CODINGTYPE>& aSupportedCodings,
+	                                         const RArray<OMX_COLOR_FORMATTYPE>& aSupportedColourFormats,
+	                                         const COmxILFileSinkProcessingFunction& aFileSinkPF);
+
+	~COmxILVideoFileSinkVPB0Port();
+	
+	OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const;
+	OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const;
+
+	OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex, 
+								TAny* apComponentParameterStructure) const;
+	OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex, 
+								const TAny* apComponentParameterStructure, 
+								TBool& aUpdateProcessingFunction);
+
+private:
+	COmxILVideoFileSinkVPB0Port(const COmxILFileSinkProcessingFunction& aFileSinkPF);
+	void ConstructL(const TOmxILCommonPortData& aCommonPortData,
+	        const RArray<OMX_VIDEO_CODINGTYPE>& aSupportedCodings,
+            const RArray<OMX_COLOR_FORMATTYPE>& aSupportedColourFormats);
+	OMX_ERRORTYPE SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, 
+											TBool& aUpdateProcessingFunction);
+	TBool IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const;
+
+private:
+	const COmxILFileSinkProcessingFunction& iFileSinkPF;
+	RBuf8 iMimeType;
+	};
+
+#endif // OMXILVIDEOFILESINKOPB0PORT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/mmpfiles/omxilaudiofilesink.mmp	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,47 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+// This macro is required to enable domain specific code
+MACRO OMXIL_AUDIO_FILESINK
+
+#include 				"../inc/omxilfilesink.hrh"
+
+TARGET		  			omxilaudiofilesink.dll
+CAPABILITY	  			ALL -TCB
+TARGETTYPE	  			PLUGIN
+UID           			0x10009D8D KUidNokiaOmxILAudioFileSinkDll
+VENDORID                0x70000001
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+OS_LAYER_ESTLIB_SYSTEMINCLUDE
+
+USERINCLUDE	 			../inc
+
+SOURCEPATH	  			../src
+
+SOURCE		  			omxilfilesink.cpp
+SOURCE		  			omxilfilesinkprocessingfunction.cpp
+SOURCE		  			omxilfilesinkconfigmanager.cpp
+SOURCE		  			omxilaudiofilesinkapb0port.cpp 
+
+RESOURCE				omxilaudiofilesink.rss
+
+LIBRARY		 			euser.lib
+LIBRARY		 			efsrv.lib
+LIBRARY		 			inetprotutil.lib
+LIBRARY		 			ecom.lib
+LIBRARY					estlib.lib
+LIBRARY         		omxilcomponentcommon.lib
+STATICLIBRARY			omxilcomponentif.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/mmpfiles/omxilimagefilesink.mmp	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,47 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+// This macro is required to enable domain specific code
+MACRO OMXIL_IMAGE_FILESINK
+
+#include 				"../inc/omxilfilesink.hrh"
+
+TARGET		  			omxilimagefilesink.dll
+CAPABILITY	  			ALL -TCB	// TODO restrict capabilities, as writing to file
+TARGETTYPE	  			PLUGIN
+UID           			0x10009D8D KUidNokiaOmxILImageFileSinkDll
+VENDORID                0x70000001
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+OS_LAYER_ESTLIB_SYSTEMINCLUDE
+
+USERINCLUDE	 			../inc
+
+SOURCEPATH	  			../src
+
+SOURCE		  			omxilfilesink.cpp
+SOURCE		  			omxilfilesinkprocessingfunction.cpp
+SOURCE		  			omxilfilesinkconfigmanager.cpp
+SOURCE		  			omxilimagefilesinkipb0port.cpp 
+
+RESOURCE				omxilimagefilesink.rss
+
+LIBRARY		 			euser.lib
+LIBRARY		 			efsrv.lib
+LIBRARY		 			inetprotutil.lib
+LIBRARY		 			ecom.lib
+LIBRARY					estlib.lib
+LIBRARY         		omxilcomponentcommon.lib
+STATICLIBRARY			omxilcomponentif.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/mmpfiles/omxilotherfilesink.mmp	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,47 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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 macro is required to enable domain specific code
+MACRO OMXIL_OTHER_FILESINK
+
+#include 				"../inc/omxilfilesink.hrh"
+
+TARGET		  			omxilotherfilesink.dll
+CAPABILITY	  			ALL -TCB
+TARGETTYPE	  			PLUGIN
+UID           			0x10009D8D KUidSymbianOmxIOtherLFileSinkDll
+VENDORID                0x70000001
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+OS_LAYER_ESTLIB_SYSTEMINCLUDE
+
+USERINCLUDE	 			../inc
+
+SOURCEPATH	  			../src
+
+SOURCE		  			omxilfilesink.cpp
+SOURCE		  			omxilotherfilesinkopb0port.cpp
+SOURCE		  			omxilfilesinkprocessingfunction.cpp
+SOURCE		  			omxilfilesinkconfigmanager.cpp
+
+RESOURCE				omxilotherfilesink.rss
+
+LIBRARY		 			euser.lib
+LIBRARY		 			efsrv.lib
+LIBRARY		 			inetprotutil.lib
+LIBRARY		 			ecom.lib
+LIBRARY					estlib.lib
+LIBRARY         		omxilcomponentcommon.lib
+STATICLIBRARY			omxilcomponentif.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/mmpfiles/omxilvideofilesink.mmp	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,47 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+// This macro is required to enable domain specific code
+MACRO OMXIL_VIDEO_FILESINK
+
+#include 				"../inc/omxilfilesink.hrh"
+
+TARGET		  			omxilvideofilesink.dll
+CAPABILITY	  			ALL -TCB
+TARGETTYPE	  			PLUGIN
+UID           			0x10009D8D KUidNokiaOmxILVideoFileSinkDll
+VENDORID                0x70000001
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+OS_LAYER_ESTLIB_SYSTEMINCLUDE
+
+USERINCLUDE	 			../inc
+
+SOURCEPATH	  			../src
+
+SOURCE		  			omxilfilesink.cpp
+SOURCE		  			omxilfilesinkprocessingfunction.cpp
+SOURCE		  			omxilfilesinkconfigmanager.cpp
+SOURCE		  			omxilvideofilesinkvpb0port.cpp
+
+RESOURCE				omxilvideofilesink.rss
+
+LIBRARY		 			euser.lib
+LIBRARY		 			efsrv.lib
+LIBRARY		 			inetprotutil.lib
+LIBRARY		 			ecom.lib
+LIBRARY					estlib.lib
+LIBRARY         		omxilcomponentcommon.lib
+STATICLIBRARY			omxilcomponentif.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/src/omxilaudiofilesink.rss	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,43 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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 <ecom/registryinfo.rh>
+#include <openmax/il/loader/omxilcomponentif.hrh>
+#include "omxilfilesink.hrh"
+
+RESOURCE REGISTRY_INFO theInfo
+	{
+	dll_uid = KUidNokiaOmxILAudioFileSinkDll;
+	interfaces =
+		{
+		INTERFACE_INFO
+			{
+			interface_uid = KUidOmxILSymbianComponentIf;
+			implementations =
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid = KUidNokiaOmxILAudioFileSink;
+					version_no = 1;
+					display_name = "OMX.NOKIA.AUDIO.FILESINK";
+					default_data = "audio_writer.binary";
+					}
+				};
+			}
+		};
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/src/omxilaudiofilesinkapb0port.cpp	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,126 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+#include "omxilaudiofilesinkapb0port.h"
+#include "omxilfilesinkprocessingfunction.h"
+#include <string.h>
+#include <uri8.h>
+
+COmxILAudioFileSinkAPB0Port* COmxILAudioFileSinkAPB0Port::NewL(const TOmxILCommonPortData& aCommonPortData, 
+													 const RArray<OMX_AUDIO_CODINGTYPE>& aSupportedAudioFormats,
+													 const COmxILFileSinkProcessingFunction& aFileSinkPF)
+	{
+	COmxILAudioFileSinkAPB0Port* self = new (ELeave) COmxILAudioFileSinkAPB0Port(aFileSinkPF);
+	CleanupStack::PushL(self);
+	self->ConstructL(aCommonPortData, aSupportedAudioFormats);
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+void COmxILAudioFileSinkAPB0Port::ConstructL(const TOmxILCommonPortData& aCommonPortData, const RArray<OMX_AUDIO_CODINGTYPE>& aSupportedAudioFormats)
+	{
+	
+	
+	// base
+	COmxILAudioPort::ConstructL(aCommonPortData, aSupportedAudioFormats);
+	GetParamPortDefinition().eDomain = OMX_PortDomainAudio;
+	}
+
+COmxILAudioFileSinkAPB0Port::COmxILAudioFileSinkAPB0Port(const COmxILFileSinkProcessingFunction& aFileSinkPF)
+	: iFileSinkPF(aFileSinkPF)
+	{
+	}
+
+COmxILAudioFileSinkAPB0Port::~COmxILAudioFileSinkAPB0Port()
+	{
+	iMimeType.Close();
+	CleanUpPort();
+	}
+	
+OMX_ERRORTYPE COmxILAudioFileSinkAPB0Port::GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const
+	{
+	return COmxILAudioPort::GetLocalOmxParamIndexes(aIndexArray);
+	}
+
+OMX_ERRORTYPE COmxILAudioFileSinkAPB0Port::GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const
+	{
+	return COmxILAudioPort::GetLocalOmxConfigIndexes(aIndexArray);
+	}
+
+OMX_ERRORTYPE COmxILAudioFileSinkAPB0Port::GetParameter(OMX_INDEXTYPE aParamIndex, 
+														TAny* apComponentParameterStructure) const
+	{
+	return COmxILAudioPort::GetParameter(aParamIndex, apComponentParameterStructure);
+	}
+	
+
+OMX_ERRORTYPE COmxILAudioFileSinkAPB0Port::SetParameter(OMX_INDEXTYPE aParamIndex, 
+														const TAny* apComponentParameterStructure, 
+														TBool& aUpdateProcessingFunction)
+	{
+	return COmxILAudioPort::SetParameter(aParamIndex, 
+										 apComponentParameterStructure, 
+										 aUpdateProcessingFunction);
+	}
+
+OMX_ERRORTYPE COmxILAudioFileSinkAPB0Port::SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, 
+																TBool& /*aUpdateProcessingFunction*/)
+	{
+	OMX_ERRORTYPE omxErr = OMX_ErrorNone;
+	if (aPortDefinition.format.audio.eEncoding == OMX_AUDIO_CodingUnused)
+        {
+        OMX_STRING ptempMIMEType = GetParamPortDefinition().format.audio.cMIMEType;
+        GetParamPortDefinition().format.audio = aPortDefinition.format.audio;
+        GetParamPortDefinition().format.audio.cMIMEType = ptempMIMEType;
+        
+        if(aPortDefinition.format.audio.cMIMEType)
+            {
+            TInt len= strlen (aPortDefinition.format.audio.cMIMEType);
+            if(len > 0)
+                {
+                TPtrC8 mimetype(reinterpret_cast<const TUint8 *>(aPortDefinition.format.audio.cMIMEType), len +1 );
+                HBufC8 *pHBuf = mimetype.Alloc();
+                if(pHBuf != NULL )
+                    {
+                    iMimeType.Close();
+                    iMimeType.Assign(pHBuf );
+                    TUint8* pTempBuff = const_cast<TUint8*>(iMimeType.PtrZ() );
+                    GetParamPortDefinition().format.audio.cMIMEType = reinterpret_cast<OMX_STRING>(pTempBuff );
+                    }
+                }
+            }
+        }
+	else
+	    {
+	    omxErr = OMX_ErrorUnsupportedSetting;
+	    }
+	
+	return omxErr;
+	}
+
+TBool COmxILAudioFileSinkAPB0Port::IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const
+	{
+	if(aPortDefinition.eDomain != GetParamPortDefinition().eDomain)
+	    {
+	    return EFalse;
+	    }
+
+	if (aPortDefinition.format.audio.eEncoding >= OMX_AUDIO_CodingMax)
+        {
+        return EFalse;
+        }	
+	return ETrue;	
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/src/omxilfilesink.cpp	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,284 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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 <openmax/il/common/omxilport.h>
+#include <openmax/il/common/omxilspecversion.h>
+#include <openmax/il/loader/omxilsymbiancomponentif.h>
+
+#include "omxilfilesink.h"
+#include "omxilfilesinkprocessingfunction.h"
+#include "omxilfilesinkconfigmanager.h"
+#include "omxilfilesink.hrh"
+
+
+#ifdef OMXIL_AUDIO_FILESINK
+#include "omxilaudiofilesinkapb0port.h"
+_LIT8(KNokiaOMXFileSinkComponentName, "OMX.NOKIA.AUDIO.FILESINK");
+_LIT8(KNokiaOMXFileSinkRole, "audio_writer.binary");
+OMXIL_COMPONENT_ECOM_ENTRYPOINT(KUidNokiaOmxILAudioFileSink);
+
+#elif defined(OMXIL_VIDEO_FILESINK)
+#include "omxilvideofilesinkvpb0port.h"
+_LIT8(KNokiaOMXFileSinkComponentName, "OMX.NOKIA.VIDEO.FILESINK");
+_LIT8(KNokiaOMXFileSinkRole, "video_writer.binary");
+OMXIL_COMPONENT_ECOM_ENTRYPOINT(KUidNokiaOmxILVideoFileSink);
+
+#elif defined(OMXIL_IMAGE_FILESINK)
+#include "omxilimagefilesinkipb0port.h"
+_LIT8(KNokiaOMXFileSinkComponentName, "OMX.NOKIA.IMAGE.FILESINK");
+_LIT8(KNokiaOMXFileSinkRole, "image_writer.binary");
+OMXIL_COMPONENT_ECOM_ENTRYPOINT(KUidNokiaOmxILImageFileSink);
+
+#elif defined(OMXIL_OTHER_FILESINK)
+#include "omxilotherfilesinkopb0port.h"
+_LIT8(KNokiaOMXFileSinkComponentName, "OMX.NOKIA.OTHER.FILESINK");
+_LIT8(KNokiaOMXFileSinkRole, "other_writer.binary");
+OMXIL_COMPONENT_ECOM_ENTRYPOINT(KUidSymbianOmxILOtherFileSink);
+
+#endif
+
+const TUint8 KComponentVersionMajor = 1;
+const TUint8 KComponentVersionMinor = 1;
+const TUint8 KComponentVersionRevision = 0;
+const TUint8 KComponentVersionStep = 0;
+
+static const TInt KMinBuffers = 1;
+static const TInt KMinBufferSize = 15360;
+
+
+// Component Entry Point
+OMX_ERRORTYPE OMX_ComponentInit(OMX_HANDLETYPE aComponent)
+	{
+	TRAPD(err, COmxILFileSink::CreateComponentL(aComponent));
+	if (err == KErrNone)
+		{
+		return OMX_ErrorNone;
+		}
+	else
+		{
+		return err == KErrNoMemory ? OMX_ErrorInsufficientResources : OMX_ErrorUndefined;
+		}
+	}
+
+void COmxILFileSink::CreateComponentL(OMX_HANDLETYPE aComponent)
+	{
+	COmxILFileSink* self = new (ELeave) COmxILFileSink();
+	CleanupStack::PushL(self);
+	self->ConstructL(aComponent);
+	CleanupStack::Pop(self);
+	}
+
+COmxILFileSink::COmxILFileSink()
+	{
+	// nothing to do
+	}
+
+COmxILFileSink::~COmxILFileSink()
+	{
+	}
+
+void COmxILFileSink::ConstructL(OMX_HANDLETYPE aComponent)
+	{
+    // STEP 1: Initialize the data received from the IL Core
+    COmxILComponent::ConstructL(aComponent);
+    
+    // STEP 2: Create the call backs manager...
+    MOmxILCallbackNotificationIf* callbackNotificationIf=CreateCallbackManagerL(COmxILComponent::EOutofContext);
+
+	// STEP 3: Create the file sink-specific Processing Function...
+    COmxILFileSinkProcessingFunction* pProcessingFunction = COmxILFileSinkProcessingFunction::NewL(*callbackNotificationIf);
+    RegisterProcessingFunction(pProcessingFunction);
+    
+	// STEP 4: Create Port manager...
+
+#ifdef OMXIL_AUDIO_FILESINK
+    CreatePortManagerL(COmxILComponent::ENonBufferSharingPortManager,
+        TOmxILSpecVersion(),    // OMX Version
+        1,                      // The number of audio ports in this component
+        0,                      // The starting audio port index
+        0,                      // The number of image ports in this component
+        0,                      // The starting image port index
+        0,                      // The number of video ports in this component
+        0,                      // The starting video port index
+        0,                      // The number of other ports in this component
+        0                       // The starting other port index
+        );
+
+#elif defined(OMXIL_VIDEO_FILESINK)
+    CreatePortManagerL(COmxILComponent::ENonBufferSharingPortManager,
+        TOmxILSpecVersion(),    // OMX Version
+        0,                      // The number of audio ports in this component
+        0,                      // The starting audio port index
+        0,                      // The number of image ports in this component
+        0,                      // The starting image port index
+        1,                      // The number of video ports in this component
+        0,                      // The starting video port index
+        0,                      // The number of other ports in this component
+        0                       // The starting other port index
+        );
+
+#elif defined(OMXIL_IMAGE_FILESINK)
+    CreatePortManagerL(COmxILComponent::ENonBufferSharingPortManager,
+        TOmxILSpecVersion(),    // OMX Version
+        0,                      // The number of audio ports in this component
+        0,                      // The starting audio port index
+        1,                      // The number of image ports in this component
+        0,                      // The starting image port index
+        0,                      // The number of video ports in this component
+        0,                      // The starting video port index
+        0,                      // The number of other ports in this component
+        0                       // The starting other port index
+        );
+
+
+#elif defined(OMXIL_OTHER_FILESINK)
+    CreatePortManagerL(COmxILComponent::ENonBufferSharingPortManager,
+        TOmxILSpecVersion(),    // OMX Version
+        0,                      // The number of audio ports in this component
+        0,                      // The starting audio port index
+        0,                      // The number of image ports in this component
+        0,                      // The starting image port index
+        0,                      // The number of video ports in this component
+        0,                      // The starting video port index
+        1,                      // The number of other ports in this component
+        0                       // The starting other port index
+        );
+#endif
+
+	// STEP 5: Create the File Sink component port...
+    COmxILPort* pPort = ConstructPortL();
+	CleanupStack::PushL(pPort);
+	
+	// STEP 6: Add to the port manager...
+	User::LeaveIfError(AddPort(pPort, OMX_DirInput));
+	CleanupStack::Pop(); //pPort
+	
+	// STEP 7: Create the non-port related configuration manager...
+	RPointerArray<TDesC8> componentRoles;
+	CleanupClosePushL(componentRoles);
+
+	componentRoles.AppendL(&KNokiaOMXFileSinkRole);
+	COmxILFileSinkConfigManager* pConfigManager = COmxILFileSinkConfigManager::NewL(
+		KNokiaOMXFileSinkComponentName,
+		TOmxILVersion(KComponentVersionMajor,
+					  KComponentVersionMinor,
+					  KComponentVersionRevision,
+					  KComponentVersionStep),
+		componentRoles,
+		*pProcessingFunction);
+    RegisterConfigurationManager(pConfigManager);
+	CleanupStack::PopAndDestroy(&componentRoles);
+
+	// STEP 9: Finally, let's get everything started
+	InitComponentL();
+	}
+
+COmxILPort* COmxILFileSink::ConstructPortL() const
+	{
+	OMX_U32 thisPortIndex = 0;
+	//const TUint32 KBufferAlignment = 4;
+#ifdef OMXIL_AUDIO_FILESINK
+	RArray<OMX_AUDIO_CODINGTYPE> supportedAudioFormats;
+	CleanupClosePushL(supportedAudioFormats);
+	supportedAudioFormats.AppendL(OMX_AUDIO_CodingUnused);
+	COmxILAudioFileSinkAPB0Port* pPort = COmxILAudioFileSinkAPB0Port::NewL(
+			TOmxILCommonPortData (
+			TOmxILSpecVersion(),	// OMX specification version information
+			thisPortIndex, 			// Port number the structure applies to
+			OMX_DirInput, 			// Direction of this port
+			KMinBuffers,			// The minimum number of buffers this port requires
+			KMinBufferSize,			// Minimum size, in bytes, for buffers to be used for this port
+			OMX_PortDomainAudio,	// Domain of the port
+			OMX_FALSE,				// Buffers contiguous requirement (true or false)
+			0,		                // Buffer aligment requirements
+			OMX_BufferSupplyOutput,	// supplier preference when tunneling between two ports
+			COmxILPort::KBufferMarkPropagationPortNotNeeded),
+			supportedAudioFormats,
+			static_cast<COmxILFileSinkProcessingFunction&>(*GetProcessingFunction()));
+	CleanupStack::PopAndDestroy(&supportedAudioFormats);
+	return pPort;
+
+#elif defined(OMXIL_VIDEO_FILESINK)
+    RArray<OMX_VIDEO_CODINGTYPE> supportedVideoFormats;
+    CleanupClosePushL(supportedVideoFormats);
+    RArray<OMX_COLOR_FORMATTYPE> supportedColourFormats;
+    CleanupClosePushL(supportedColourFormats);
+    COmxILVideoFileSinkVPB0Port* pPort = COmxILVideoFileSinkVPB0Port::NewL(
+            TOmxILCommonPortData (
+            TOmxILSpecVersion(),    // OMX specification version information
+            thisPortIndex,          // Port number the structure applies to
+            OMX_DirInput,           // Direction of this port
+            KMinBuffers,            // The minimum number of buffers this port requires
+            KMinBufferSize,         // Minimum size, in bytes, for buffers to be used for this port
+            OMX_PortDomainVideo,    // Domain of the port
+            OMX_FALSE,              // Buffers contiguous requirement (true or false)
+            0,                      // Buffer aligment requirements
+            OMX_BufferSupplyOutput, // supplier preference when tunneling between two ports
+            COmxILPort::KBufferMarkPropagationPortNotNeeded),
+            supportedVideoFormats,
+            supportedColourFormats,
+            static_cast<COmxILFileSinkProcessingFunction&>(*GetProcessingFunction()));
+    CleanupStack::PopAndDestroy(2);
+    return pPort;
+
+#elif defined(OMXIL_IMAGE_FILESINK)
+    RArray<OMX_IMAGE_CODINGTYPE> supportedImageFormats;
+    CleanupClosePushL(supportedImageFormats);
+    //supportedImageFormats.AppendL(OMX_IMAGE_CodingUnused);
+    RArray<OMX_COLOR_FORMATTYPE> supportedColourFormats;
+    CleanupClosePushL(supportedColourFormats);
+    COmxILImageFileSinkIPB0Port* pPort = COmxILImageFileSinkIPB0Port::NewL(
+            TOmxILCommonPortData (
+            TOmxILSpecVersion(),    // OMX specification version information
+            thisPortIndex,          // Port number the structure applies to
+            OMX_DirInput,           // Direction of this port
+            KMinBuffers,            // The minimum number of buffers this port requires
+            KMinBufferSize,         // Minimum size, in bytes, for buffers to be used for this port
+            OMX_PortDomainImage,    // Domain of the port
+            OMX_FALSE,              // Buffers contiguous requirement (true or false)
+            0,                      // Buffer aligment requirements
+            OMX_BufferSupplyOutput, // supplier preference when tunneling between two ports
+            COmxILPort::KBufferMarkPropagationPortNotNeeded),
+            supportedImageFormats,
+            supportedColourFormats,
+            static_cast<COmxILFileSinkProcessingFunction&>(*GetProcessingFunction()));
+    CleanupStack::PopAndDestroy(2);
+    return pPort;
+
+#elif defined(OMXIL_OTHER_FILESINK)
+	RArray<OMX_OTHER_FORMATTYPE> supportedOtherFormats;
+	CleanupClosePushL(supportedOtherFormats);
+	supportedOtherFormats.AppendL(OMX_OTHER_FormatBinary);
+	COmxILOtherFileSinkOPB0Port* pPort = COmxILOtherFileSinkOPB0Port::NewL(
+			TOmxILCommonPortData (
+			TOmxILSpecVersion(),	// OMX specification version information
+			thisPortIndex, 			// Port number the structure applies to
+			OMX_DirInput, 			// Direction of this port
+			KMinBuffers,			// The minimum number of buffers this port requires
+			KMinBufferSize,			// Minimum size, in bytes, for buffers to be used for this port
+			OMX_PortDomainOther,	// Domain of the port
+			OMX_FALSE,				// Buffers contiguous requirement (true or false)
+			0,		                // Buffer aligment requirements
+			OMX_BufferSupplyOutput,	// supplier preference when tunneling between two ports
+			COmxILPort::KBufferMarkPropagationPortNotNeeded),
+			supportedOtherFormats,
+			static_cast<COmxILFileSinkProcessingFunction&>(*GetProcessingFunction()));
+	CleanupStack::PopAndDestroy(&supportedOtherFormats);
+	return pPort;
+
+#endif
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/src/omxilfilesinkconfigmanager.cpp	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,130 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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
+ * @internalTechnology
+ */
+
+#include "omxilfilesinkconfigmanager.h"
+#include "omxilfilesinkprocessingfunction.h"
+#include <openmax/il/common/omxilspecversion.h>
+
+COmxILFileSinkConfigManager* COmxILFileSinkConfigManager::NewL(
+                                                            const TDesC8& aComponentName,
+                                                            const OMX_VERSIONTYPE& aComponentVersion,
+                                                            const RPointerArray<TDesC8>& aComponentRoleList,
+                                                            COmxILFileSinkProcessingFunction& aFileSinkPF)
+	{
+	COmxILFileSinkConfigManager* self = new(ELeave) COmxILFileSinkConfigManager(aFileSinkPF);
+	CleanupStack::PushL(self);
+	self->ConstructL(aComponentName, aComponentVersion, aComponentRoleList);
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+COmxILFileSinkConfigManager::COmxILFileSinkConfigManager(COmxILFileSinkProcessingFunction& aFileSinkPF)
+	: iFileSinkPF(aFileSinkPF)
+	{
+	}
+
+void COmxILFileSinkConfigManager::ConstructL(
+                                            const TDesC8& aComponentName,
+                                            const OMX_VERSIONTYPE& aComponentVersion,
+                                            const RPointerArray<TDesC8>& aComponentRoleList)
+	{
+	COmxILConfigManager::ConstructL(aComponentName, aComponentVersion, aComponentRoleList);
+	
+	InsertParamIndexL(OMX_IndexParamContentURI);
+	}
+
+COmxILFileSinkConfigManager::~COmxILFileSinkConfigManager()
+	{
+	}
+	
+OMX_ERRORTYPE COmxILFileSinkConfigManager::GetParameter(OMX_INDEXTYPE aParamIndex, TAny* aPtr) const
+	{
+	TInt index = FindParamIndex(aParamIndex);
+	if (KErrNotFound == index)
+		{
+		return OMX_ErrorUnsupportedIndex;
+		}
+		
+	switch (aParamIndex)
+		{
+		case OMX_IndexParamContentURI:
+			{			
+			OMX_PARAM_CONTENTURITYPE* param = reinterpret_cast<OMX_PARAM_CONTENTURITYPE*>(aPtr);
+			const HBufC8* uriData = iFileSinkPF.Uri();
+			if (!uriData)
+				{
+				return OMX_ErrorNotReady;
+				}
+			
+			const OMX_PARAM_CONTENTURITYPE* uri = reinterpret_cast<const OMX_PARAM_CONTENTURITYPE*>(uriData->Ptr());
+			if (uri->nSize > param->nSize)
+				{
+				return OMX_ErrorBadParameter;
+				}
+			
+			// The client's structure is guaranteed to be big enough.
+			Mem::Copy(param, uri, uri->nSize);
+			}
+			break;
+			
+		default:
+			{
+			return COmxILConfigManager::GetParameter(aParamIndex, aPtr);
+			}
+		}
+
+	return OMX_ErrorNone;
+	}
+
+OMX_ERRORTYPE COmxILFileSinkConfigManager::SetParameter(OMX_INDEXTYPE aParamIndex, const TAny* aPtr, OMX_BOOL aInitTime)
+	{
+	TInt index = FindParamIndex(aParamIndex);
+	if (KErrNotFound == index)
+		{
+		return OMX_ErrorUnsupportedIndex;
+		}
+
+	OMX_ERRORTYPE omxErr = OMX_ErrorNone;
+	
+	switch (aParamIndex)
+		{
+		case OMX_IndexParamContentURI:
+			{
+			if(aInitTime == OMX_TRUE)
+			    {
+			    omxErr = iFileSinkPF.ParamIndication(aParamIndex, aPtr);
+			    }
+			else
+			    {
+			    omxErr = OMX_ErrorUndefined;
+			    }
+			break;
+			}
+		default:
+			{
+			omxErr = COmxILConfigManager::SetParameter(aParamIndex, aPtr, aInitTime);
+			break;
+			}
+		}
+
+	return omxErr;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/src/omxilfilesinkprocessingfunction.cpp	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,645 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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
+ * @internalTechnology
+ */
+
+#include <uri8.h>
+#include <openmax/il/common/omxilcallbacknotificationif.h>
+#include "omxilfilesinkprocessingfunction.h"
+
+const TInt KMaxMsgQueueEntries = 25;
+
+COmxILFileSinkProcessingFunction* COmxILFileSinkProcessingFunction::NewL(MOmxILCallbackNotificationIf& aCallbacks)
+	{
+	COmxILFileSinkProcessingFunction* self = new (ELeave) COmxILFileSinkProcessingFunction(aCallbacks);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+COmxILFileSinkProcessingFunction::COmxILFileSinkProcessingFunction(MOmxILCallbackNotificationIf& aCallbacks)
+: COmxILProcessingFunction(aCallbacks)
+	{
+	}
+
+void COmxILFileSinkProcessingFunction::ConstructL()
+	{
+	iState = OMX_StateLoaded;
+	ipFileSinkAccess = CFileSinkAccess::NewL(*this);
+	ipPFHelper = CPFHelper::NewL(*this, *ipFileSinkAccess);
+	}
+
+COmxILFileSinkProcessingFunction::~COmxILFileSinkProcessingFunction()
+	{
+	if(ipPFHelper &&
+	   (iState == OMX_StateInvalid  ||
+	    iState == OMX_StateExecuting ||
+	    iState == OMX_StatePause))
+		{
+		ipPFHelper->StopSync();
+		}
+
+	delete ipPFHelper;
+	delete ipFileSinkAccess;
+	delete ipUri;
+	delete ipFileName;
+
+	// Buffer headers are not owned by the processing function
+    iBuffersToEmpty.Close();
+	}
+
+OMX_ERRORTYPE COmxILFileSinkProcessingFunction::StateTransitionIndication(TStateIndex aNewState)
+	{
+	OMX_ERRORTYPE err = OMX_ErrorNone;
+	switch(aNewState)
+		{
+		case EStateExecuting:
+			{
+			if (ipPFHelper->ExecuteAsync() != KErrNone)
+				{
+				err = OMX_ErrorInsufficientResources;
+				}
+			}
+			break;
+
+		case EStateInvalid:
+			{
+            if (ipPFHelper && ipPFHelper->StopAsync() != KErrNone)
+                {
+                err = OMX_ErrorInsufficientResources;
+                }
+			}
+			break;
+
+		case EStatePause:
+			{
+			ipPFHelper->PauseAsync();
+			}
+			break;
+
+		case EStateIdle:
+			{
+			ipPFHelper->IdleAsync();
+			}
+			break;
+
+		case EStateLoaded:
+		case EStateWaitForResources:
+			{
+			if (ipPFHelper && ipPFHelper->StopAsync() != KErrNone)
+				{
+				err = OMX_ErrorInsufficientResources;
+				}
+			}
+			break;
+
+		case ESubStateExecutingToIdle:
+			{
+			ipPFHelper->StopAsync();
+			}
+			break;
+
+        case ESubStateLoadedToIdle:
+        case ESubStateIdleToLoaded:
+		case ESubStatePauseToIdle:
+			break;
+
+		default:
+			{
+			err = OMX_ErrorIncorrectStateTransition;
+			}
+		};
+	return err;
+	}
+
+OMX_ERRORTYPE COmxILFileSinkProcessingFunction::BufferFlushingIndication(TUint32 aPortIndex, OMX_DIRTYPE aDirection)
+	{
+	OMX_ERRORTYPE err = OMX_ErrorNone;
+    if ((aPortIndex == OMX_ALL && aDirection == OMX_DirMax) ||
+        (aPortIndex == 0 && aDirection == OMX_DirInput))
+        {
+        // Send BufferDone notifications for each bufer...
+        for (TUint i=0, bufferCount=iBuffersToEmpty.Count(); i<bufferCount; ++i)
+            {
+            OMX_BUFFERHEADERTYPE* pBufferHeader = iBuffersToEmpty[i];
+            iCallbacks.BufferDoneNotification(pBufferHeader,
+                                              pBufferHeader->nInputPortIndex,
+                                              OMX_DirInput);
+            }
+        // Empty buffer lists...
+        iBuffersToEmpty.Reset();
+        }
+    else
+        {
+        err = OMX_ErrorBadParameter;
+        }
+    return err;
+	}
+
+OMX_ERRORTYPE COmxILFileSinkProcessingFunction::ParamIndication(OMX_INDEXTYPE aParamIndex, const TAny* apComponentParameterStructure)
+	{
+	OMX_ERRORTYPE err = OMX_ErrorNone;
+	switch(aParamIndex)
+		{
+		case OMX_IndexParamPortDefinition:
+			{
+			//const OMX_PARAM_PORTDEFINITIONTYPE* portDefinition = static_cast<const OMX_PARAM_PORTDEFINITIONTYPE*>(apComponentParameterStructure);
+			//nothing to do
+			//
+			//the number of buffers may change depending on capture mode (single shot vs burst mode)
+			//in that case, we need to do something for PF...
+			break;
+			}
+
+		case OMX_IndexParamContentURI:
+			{
+			const OMX_PARAM_CONTENTURITYPE* contentUriType = reinterpret_cast<const OMX_PARAM_CONTENTURITYPE*>(apComponentParameterStructure);
+			err = SetFileName(contentUriType);
+			break;
+			}
+		default:
+			{
+			err = OMX_ErrorUnsupportedIndex;
+			}
+		}
+	return err;
+	}
+
+OMX_ERRORTYPE COmxILFileSinkProcessingFunction::ConfigIndication(OMX_INDEXTYPE /*aConfigIndex*/, const TAny* /*apComponentConfigStructure*/)
+	{
+	return OMX_ErrorNone;
+	}
+
+OMX_ERRORTYPE COmxILFileSinkProcessingFunction::BufferIndication(OMX_BUFFERHEADERTYPE* apBufferHeader, OMX_DIRTYPE aDirection)
+	{
+	if (aDirection == OMX_DirInput)
+    	{
+    	if (ipPFHelper->BufferIndication(apBufferHeader) != KErrNone)
+    		{
+    		return OMX_ErrorInsufficientResources;
+    		}
+		}
+    else
+    	{
+    	return OMX_ErrorBadParameter;
+    	}
+
+    return OMX_ErrorNone;
+	}
+
+OMX_BOOL COmxILFileSinkProcessingFunction::BufferRemovalIndication(OMX_BUFFERHEADERTYPE* apBufferHeader, OMX_DIRTYPE /*aDirection*/)
+	{
+	OMX_BOOL headerDeletionResult = OMX_TRUE;
+
+	TInt headerIndexInArray = KErrNotFound;
+	if (KErrNotFound != (headerIndexInArray = iBuffersToEmpty.Find(apBufferHeader)))
+		{
+		iBuffersToEmpty.Remove(headerIndexInArray);
+		}
+	else
+		{
+		headerDeletionResult = OMX_FALSE;
+		}
+
+    return headerDeletionResult;
+	}
+
+MOmxILCallbackNotificationIf& COmxILFileSinkProcessingFunction::GetCallbacks()
+	{
+	return iCallbacks;
+	}
+
+OMX_ERRORTYPE COmxILFileSinkProcessingFunction::SetFileName(const OMX_PARAM_CONTENTURITYPE* aContentUriType)
+	{
+	ASSERT(aContentUriType);
+	delete ipFileName;
+	ipFileName = NULL;
+	delete ipUri;
+	ipUri = NULL;
+
+	//TInt dataLength = aContentUriType->nSize - sizeof(OMX_PARAM_CONTENTURITYPE) + 4;
+	TInt sizeOfUri = aContentUriType->nSize - _FOFF(OMX_PARAM_CONTENTURITYPE, contentURI); //Actual size of URI
+	if (sizeOfUri <= 0)
+		{
+		return OMX_ErrorBadParameter;
+		}
+
+	// Don't include the zero character at the end.
+	//TPtrC8 uriDes(reinterpret_cast<const TUint8*>(&aContentUriType->contentURI), dataLength - 1);
+	TPtrC8 uriDes(aContentUriType->contentURI,sizeOfUri);
+
+	TInt err = KErrNone;
+	do
+		{
+		TUriParser8 parser;
+		err = parser.Parse(uriDes);
+		if (err != KErrNone)
+			{
+			break;
+			}
+
+		TRAP(err, ipFileName = parser.GetFileNameL());
+		if (err != KErrNone)
+			{
+			break;
+			}
+
+		// Remove Null charcter '\0' if any.
+		TPtr filePtr(ipFileName->Des());
+		TInt index = filePtr.LocateReverse('\0');
+		if (index != KErrNotFound && index == filePtr.Length()-1)
+		    {
+		    filePtr.Delete(index,1);
+		    }
+
+		uriDes.Set(reinterpret_cast<const TUint8 *>(aContentUriType), aContentUriType->nSize );
+		ipUri = uriDes.Alloc();
+		if (!ipUri)
+			{
+			err = KErrNoMemory;
+			break;
+			}
+
+		return OMX_ErrorNone;
+		}
+	while (EFalse);
+
+	// Something failed.
+	__ASSERT_DEBUG( (err == KErrNone), User::Panic(_L("UriParsing"), err) );
+	delete ipFileName;
+	ipFileName = NULL;
+	delete ipUri;
+	ipUri = NULL;
+	return (err == KErrNoMemory ? OMX_ErrorInsufficientResources : OMX_ErrorBadParameter);
+	}
+
+
+const HBufC* COmxILFileSinkProcessingFunction::FileName() const
+	{
+	return ipFileName;
+	}
+
+const HBufC8* COmxILFileSinkProcessingFunction::Uri() const
+	{
+	return ipUri;
+	}
+
+COmxILFileSinkProcessingFunction::CFileSinkAccess* COmxILFileSinkProcessingFunction::CFileSinkAccess::NewL(COmxILFileSinkProcessingFunction& aParent)
+	{
+	CFileSinkAccess* self = new (ELeave) CFileSinkAccess(aParent);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+COmxILFileSinkProcessingFunction::CFileSinkAccess::CFileSinkAccess(COmxILFileSinkProcessingFunction& aParent)
+	: CActive(EPriorityStandard),
+	iParent(aParent),
+	iBufferOffset(0),
+	iWriteBuffer(0,0)
+	{
+	CActiveScheduler::Add(this);
+	}
+
+void COmxILFileSinkProcessingFunction::CFileSinkAccess::ConstructL()
+	{
+	User::LeaveIfError(iFs.Connect());
+	}
+
+COmxILFileSinkProcessingFunction::CFileSinkAccess::~CFileSinkAccess()
+	{
+	Cancel();
+
+	iFileHandle.Close();
+	iFs.Close();
+	}
+
+void COmxILFileSinkProcessingFunction::CFileSinkAccess::RunL()
+	{
+
+	// The buffer is not on the list implies that they have already been flushed/spotted
+	// via BufferFlushingIndication/BufferRemovalIndication
+	TInt index = iParent.iBuffersToEmpty.Find(iCurrentBuffer);
+	if (KErrNotFound != index)
+		{
+		switch(iStatus.Int())
+			{
+			case KErrNone:
+				{
+				// Consumed all data completely
+				if(OMX_BUFFERFLAG_EOS & iCurrentBuffer->nFlags)
+					{
+					iFileHandle.Close();
+					iParent.GetCallbacks().EventNotification(OMX_EventBufferFlag, iCurrentBuffer->nInputPortIndex, OMX_BUFFERFLAG_EOS, NULL);
+					}
+				iCurrentBuffer->nFilledLen = 0;
+				iCurrentBuffer->nOffset = 0;
+				iCurrentBuffer->nFlags = 0;
+				iCurrentBuffer->nTimeStamp = 0;
+				break;
+				}
+			default:
+				{
+				// Leave actual value of iCurrentBuffer->nFilledLen
+				}
+			};
+
+		iParent.GetCallbacks().BufferDoneNotification(iCurrentBuffer,iCurrentBuffer->nInputPortIndex,OMX_DirInput);
+		iParent.iBuffersToEmpty.Remove(index);
+		iCurrentBuffer = NULL;
+		if(iFileHandle.SubSessionHandle() != 0)
+			{
+			ProcessNextBuffer();
+			}
+		}
+	}
+
+TInt COmxILFileSinkProcessingFunction::CFileSinkAccess::ProcessNextBuffer()
+	{
+	if ((iParent.iBuffersToEmpty.Count() > 0) && !IsActive() && iParent.iState == OMX_StateExecuting)
+		{
+		iCurrentBuffer = iParent.iBuffersToEmpty[0];
+		iWriteBuffer.Set(iCurrentBuffer->pBuffer, iCurrentBuffer->nFilledLen, iCurrentBuffer->nAllocLen);
+
+		// If the buffer is empty, we should not invoke RFile::Write, but self-complete instead
+    	if (iCurrentBuffer->nFilledLen == 0 || iFileHandle.SubSessionHandle() == 0)
+    		{
+     		SetActive();
+			TRequestStatus* status(&iStatus);
+			User::RequestComplete(status, KErrNone);
+		    }
+		else
+			{
+			iFileHandle.Write(iWriteBuffer, iCurrentBuffer->nFilledLen, iStatus);
+			SetActive();
+			}
+		}
+	return KErrNone;
+	}
+
+void COmxILFileSinkProcessingFunction::CFileSinkAccess::DoCancel()
+	{
+	if (iFileHandle.SubSessionHandle() != 0)
+	    {
+	    iFileHandle.Close();
+	    }
+	iCurrentBuffer = NULL;
+	}
+
+TInt COmxILFileSinkProcessingFunction::CFileSinkAccess::Execute()
+	{
+	iParent.iState = OMX_StateExecuting;
+	return ProcessNextBuffer();
+	}
+
+void COmxILFileSinkProcessingFunction::CFileSinkAccess::Pause()
+	{
+	iParent.iState = OMX_StatePause;
+	Cancel();
+	}
+
+void COmxILFileSinkProcessingFunction::CFileSinkAccess::Idle()
+    {
+    iParent.iBuffersToEmpty.Reset();
+    iParent.iState = OMX_StateIdle;
+    }
+
+void COmxILFileSinkProcessingFunction::CFileSinkAccess::Stop()
+	{
+	if(iParent.iState == OMX_StateExecuting || iParent.iState == OMX_StatePause)
+		{
+		Cancel();
+		iParent.iState = OMX_StateIdle;
+		}
+	}
+
+COmxILFileSinkProcessingFunction::CPFHelper* COmxILFileSinkProcessingFunction::CPFHelper::NewL(COmxILFileSinkProcessingFunction& aParent, CFileSinkAccess& aFileSinkAccess)
+	{
+	CPFHelper* self = new (ELeave) CPFHelper(aParent, aFileSinkAccess);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+COmxILFileSinkProcessingFunction::CPFHelper::CPFHelper(COmxILFileSinkProcessingFunction& aParent, CFileSinkAccess& aFileSinkAccess)
+: CActive(EPriorityStandard),
+  iParent(aParent),
+  iFileSinkAccess(aFileSinkAccess)
+	{
+	CActiveScheduler::Add(this);
+	}
+
+void COmxILFileSinkProcessingFunction::CPFHelper::ConstructL()
+	{
+	User::LeaveIfError(iMsgQueue.CreateLocal(KMaxMsgQueueEntries));
+	SetActive();
+	iMsgQueue.NotifyDataAvailable(iStatus);
+	}
+
+COmxILFileSinkProcessingFunction::CPFHelper::~CPFHelper()
+	{
+	Cancel();
+	iMsgQueue.Close();
+	}
+
+void COmxILFileSinkProcessingFunction::CPFHelper::RunL()
+	{
+	TInt err = ProcessQueue();
+	if (err != KErrNone)
+		{
+		iParent.GetCallbacks().ErrorEventNotification( ConvertSymbianErrorType(err));
+		}
+
+	// setup for next callbacks
+	SetActive();
+	iMsgQueue.NotifyDataAvailable(iStatus);
+	}
+
+void COmxILFileSinkProcessingFunction::CPFHelper::DoCancel()
+	{
+	if (iMsgQueue.Handle())
+		{
+		ProcessQueue();
+		iMsgQueue.CancelDataAvailable();
+		}
+	}
+
+TInt COmxILFileSinkProcessingFunction::CPFHelper::ProcessQueue()
+	{
+	TProcMessage msg;
+	TInt err = KErrNone;
+
+	while (iMsgQueue.Receive(msg) == KErrNone)
+		{
+		switch (msg.iType)
+			{
+			case EExecuteCommand:
+				{
+                const HBufC* fileName = iParent.FileName();
+	            if (fileName)
+                    {
+                    TUint fileMode = EFileWrite | EFileShareExclusive;
+                    if(iFileSinkAccess.iFileHandle.SubSessionHandle() == 0)
+                        {
+                        err = iFileSinkAccess.iFileHandle.Replace(iFileSinkAccess.iFs, *fileName, fileMode);
+                        }
+                    }
+                if ( err == KErrNone)
+                    {
+                    err = iFileSinkAccess.Execute();
+                    }
+				break;
+				}
+
+			case EStopCommand:
+				{
+				iFileSinkAccess.Stop();
+				break;
+				}
+
+			case EPauseCommand:
+				{
+				iFileSinkAccess.Pause();
+				break;
+				}
+
+            case EIdleCommand:
+                {
+                iFileSinkAccess.Idle();
+                break;
+                }
+
+			case EBufferIndication:
+				{
+				OMX_BUFFERHEADERTYPE* bufferHeader = reinterpret_cast<OMX_BUFFERHEADERTYPE*>(msg.iPtr);
+				if ( bufferHeader && (iParent.iState == OMX_StateExecuting || iParent.iState == OMX_StatePause
+				        || iParent.iState == OMX_StateIdle) )
+					{
+					err = iParent.iBuffersToEmpty.Append(bufferHeader);
+					if(err == KErrNone)
+						{
+						if(iParent.iState != OMX_StateIdle)
+						    {
+						    err = iFileSinkAccess.ProcessNextBuffer();
+						    }
+						}
+					else
+					    {
+					    // to prevent potential buffer leakage if the Append operation fails
+					    iParent.GetCallbacks().BufferDoneNotification(bufferHeader, bufferHeader->nInputPortIndex,OMX_DirInput);
+					    }
+					}
+				break;
+				}
+			default:
+				{
+				break;
+				}
+			}
+
+		if (err)
+			{
+			break;
+			}
+		}
+	return err;
+	}
+
+TInt COmxILFileSinkProcessingFunction::CPFHelper::ExecuteAsync()
+	{
+	TProcMessage message;
+	message.iType = EExecuteCommand;
+	return iMsgQueue.Send(message);
+	}
+
+TInt COmxILFileSinkProcessingFunction::CPFHelper::StopAsync()
+	{
+	TProcMessage message;
+	message.iType = EStopCommand;
+	return iMsgQueue.Send(message);
+	}
+
+TInt COmxILFileSinkProcessingFunction::CPFHelper::PauseAsync()
+    {
+    TProcMessage message;
+    message.iType = EPauseCommand;
+    return iMsgQueue.Send(message);
+    }
+
+TInt COmxILFileSinkProcessingFunction::CPFHelper::BufferIndication(OMX_BUFFERHEADERTYPE* apBufferHeader)
+	{
+	TProcMessage message;
+	message.iType = EBufferIndication;
+	message.iPtr = apBufferHeader;
+	return iMsgQueue.Send(message);
+	}
+
+void COmxILFileSinkProcessingFunction::CPFHelper::StopSync()
+    {
+    // Cancel to process the existing queue before handling this command
+    Cancel();
+    iFileSinkAccess.Stop();
+
+    // setup for next callbacks
+    SetActive();
+    iMsgQueue.NotifyDataAvailable(iStatus);
+    }
+
+TInt COmxILFileSinkProcessingFunction::CPFHelper::IdleAsync()
+    {
+    TProcMessage message;
+    message.iType = EIdleCommand;
+    return iMsgQueue.Send(message);
+    }
+/**
+ Converts a Symbian error code to an OpenMAX error code.
+ @param     aError The Symbian error code.
+ @return    The OpenMAX error code.
+ */
+OMX_ERRORTYPE COmxILFileSinkProcessingFunction::CPFHelper::ConvertSymbianErrorType(TInt aError)
+    {
+    // In the current implementation this function is only used for the return code in the
+    // callback methods. Currently the only expected errors KErrNone and KErrOverflow.
+
+    OMX_ERRORTYPE err = OMX_ErrorNone;
+    switch (aError)
+        {
+    case KErrNone:
+        err = OMX_ErrorNone;
+        break;
+    case KErrOverflow:
+    case KErrNoMemory:
+        err = OMX_ErrorInsufficientResources;
+        break;
+    case KErrNotSupported:
+        err = OMX_ErrorNotImplemented;
+        break;
+    case KErrNotReady:
+        err = OMX_ErrorNotReady;
+        break;
+    case KErrGeneral:
+    default:
+        err = OMX_ErrorUndefined;
+        }
+    return err;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/src/omxilimagefilesink.rss	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,43 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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 <ecom/registryinfo.rh>
+#include <openmax/il/loader/omxilcomponentif.hrh>
+#include "omxilfilesink.hrh"
+
+RESOURCE REGISTRY_INFO theInfo
+	{
+	dll_uid = KUidNokiaOmxILImageFileSinkDll;
+	interfaces =
+		{
+		INTERFACE_INFO
+			{
+			interface_uid = KUidOmxILSymbianComponentIf;
+			implementations =
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid = KUidNokiaOmxILImageFileSink;
+					version_no = 1;
+					display_name = "OMX.NOKIA.IMAGE.FILESINK";
+					default_data = "image_writer.binary";
+					}
+				};
+			}
+		};
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/src/omxilimagefilesinkipb0port.cpp	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,132 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ * @file
+ * @internalTechnology
+ */
+
+#include "omxilimagefilesinkipb0port.h"
+#include "omxilfilesinkprocessingfunction.h"
+#include <string.h>
+#include <uri8.h>
+
+COmxILImageFileSinkIPB0Port* COmxILImageFileSinkIPB0Port::NewL(const TOmxILCommonPortData& aCommonPortData,
+                                                             const RArray<OMX_IMAGE_CODINGTYPE>& aSupportedImageFormats,
+                                                             const RArray<OMX_COLOR_FORMATTYPE>& aSupportedColorFormats,
+                                                             const COmxILFileSinkProcessingFunction& aFileSinkPF)
+	{
+	COmxILImageFileSinkIPB0Port* self = new (ELeave) COmxILImageFileSinkIPB0Port(aFileSinkPF);
+	CleanupStack::PushL(self);
+	self->ConstructL(aCommonPortData, aSupportedImageFormats, aSupportedColorFormats);
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+void COmxILImageFileSinkIPB0Port::ConstructL(const TOmxILCommonPortData& aCommonPortData,
+                                            const RArray<OMX_IMAGE_CODINGTYPE>& aSupportedImageFormats,
+                                            const RArray<OMX_COLOR_FORMATTYPE>& aSupportedColorFormats)
+	{
+    COmxILImagePort::ConstructL(aCommonPortData, aSupportedImageFormats, aSupportedColorFormats);
+	GetSupportedImageFormats().AppendL(OMX_IMAGE_CodingUnused);
+	GetParamPortDefinition().eDomain = OMX_PortDomainImage;
+	}
+
+COmxILImageFileSinkIPB0Port::COmxILImageFileSinkIPB0Port(const COmxILFileSinkProcessingFunction& aFileSinkPF)
+	: iFileSinkPF(aFileSinkPF)
+	{
+	}
+
+COmxILImageFileSinkIPB0Port::~COmxILImageFileSinkIPB0Port()
+	{
+	iMimeType.Close();
+	CleanUpPort();
+	}
+	
+OMX_ERRORTYPE COmxILImageFileSinkIPB0Port::GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const
+	{
+	return COmxILImagePort::GetLocalOmxParamIndexes(aIndexArray);
+	}
+
+OMX_ERRORTYPE COmxILImageFileSinkIPB0Port::GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const
+	{
+	return COmxILImagePort::GetLocalOmxConfigIndexes(aIndexArray);
+	}
+
+OMX_ERRORTYPE COmxILImageFileSinkIPB0Port::GetParameter(OMX_INDEXTYPE aParamIndex, 
+														TAny* apComponentParameterStructure) const
+	{
+	return COmxILImagePort::GetParameter(aParamIndex, apComponentParameterStructure);
+	}
+
+OMX_ERRORTYPE COmxILImageFileSinkIPB0Port::SetParameter(OMX_INDEXTYPE aParamIndex, 
+														const TAny* apComponentParameterStructure, 
+														TBool& aUpdateProcessingFunction)
+	{
+	return COmxILImagePort::SetParameter(aParamIndex, 
+										 apComponentParameterStructure, 
+										 aUpdateProcessingFunction);
+	}
+
+OMX_ERRORTYPE COmxILImageFileSinkIPB0Port::SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, 
+																TBool& /*aUpdateProcessingFunction*/)
+	{
+	OMX_ERRORTYPE omxErr = OMX_ErrorNone;
+	if (aPortDefinition.format.image.eCompressionFormat == OMX_IMAGE_CodingUnused)
+	    {
+	    OMX_STRING ptempMIMEType =GetParamPortDefinition().format.image.cMIMEType;
+        GetParamPortDefinition().format.image = aPortDefinition.format.image;
+        
+        GetParamPortDefinition().format.image.cMIMEType = ptempMIMEType;
+        if(aPortDefinition.format.image.cMIMEType)
+            {
+            TInt len= strlen (aPortDefinition.format.image.cMIMEType);
+            if(len > 0)
+                {
+                TPtrC8 mimetype(reinterpret_cast<const TUint8 *>(aPortDefinition.format.image.cMIMEType), len +1 );
+                HBufC8 *pHBuf = mimetype.Alloc();
+                if(pHBuf != NULL )
+                    {
+                    iMimeType.Close();
+                    iMimeType.Assign(pHBuf);
+                    TUint8* pTempBuff = const_cast<TUint8*>(iMimeType.PtrZ() );
+                    GetParamPortDefinition().format.image.cMIMEType = reinterpret_cast<OMX_STRING>(pTempBuff );
+                    }
+                }
+            }
+	    }
+	else
+	    {
+	    omxErr = OMX_ErrorUnsupportedSetting;
+	    }
+	
+	return omxErr;
+	}
+
+TBool COmxILImageFileSinkIPB0Port::IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const
+	{
+	if(aPortDefinition.eDomain != GetParamPortDefinition().eDomain)
+	    {
+	    return EFalse;
+	    }
+
+	if (aPortDefinition.format.image.eCompressionFormat == OMX_IMAGE_CodingMax)
+        {
+        return EFalse;
+        }	
+	return ETrue;	
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/src/omxilotherfilesink.rss	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,43 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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 <ecom/registryinfo.rh>
+#include <openmax/il/loader/omxilcomponentif.hrh>
+#include "omxilfilesink.hrh"
+
+RESOURCE REGISTRY_INFO theInfo
+	{
+	dll_uid = KUidSymbianOmxIOtherLFileSinkDll;
+	interfaces =
+		{
+		INTERFACE_INFO
+			{
+			interface_uid = KUidOmxILSymbianComponentIf;
+			implementations =
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid = KUidSymbianOmxILOtherFileSink;
+					version_no = 1;
+					display_name = "OMX.NOKIA.OTHER.FILESINK";
+					default_data = "other_writer.binary";
+					}
+				};
+			}
+		};
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/src/omxilotherfilesinkopb0port.cpp	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,109 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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
+ * @internalTechnology
+ */
+
+#include "omxilotherfilesinkopb0port.h"
+#include "omxilfilesinkprocessingfunction.h"
+#include <uri8.h>
+
+COmxILOtherFileSinkOPB0Port* COmxILOtherFileSinkOPB0Port::NewL(const TOmxILCommonPortData& aCommonPortData, 
+													 const RArray<OMX_OTHER_FORMATTYPE>& aSupportedOtherFormats,
+													 const COmxILFileSinkProcessingFunction& aFileSinkPF)
+	{
+	COmxILOtherFileSinkOPB0Port* self = new (ELeave) COmxILOtherFileSinkOPB0Port(aFileSinkPF);
+	CleanupStack::PushL(self);
+	self->ConstructL(aCommonPortData, aSupportedOtherFormats);
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+void COmxILOtherFileSinkOPB0Port::ConstructL(const TOmxILCommonPortData& aCommonPortData, const RArray<OMX_OTHER_FORMATTYPE>& aSupportedOtherFormats)
+	{
+    // base
+    COmxILOtherPort::ConstructL(aCommonPortData, aSupportedOtherFormats);    
+	GetParamPortDefinition().eDomain = OMX_PortDomainOther;
+	GetParamPortDefinition().format.other.eFormat = OMX_OTHER_FormatBinary;
+	}
+
+COmxILOtherFileSinkOPB0Port::COmxILOtherFileSinkOPB0Port(const COmxILFileSinkProcessingFunction& aFileSinkPF)
+	: iFileSinkPF(aFileSinkPF)
+	{
+	}
+
+COmxILOtherFileSinkOPB0Port::~COmxILOtherFileSinkOPB0Port()
+	{
+	CleanUpPort();
+	}
+	
+OMX_ERRORTYPE COmxILOtherFileSinkOPB0Port::GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const
+	{
+	return COmxILOtherPort::GetLocalOmxParamIndexes(aIndexArray);
+	}
+
+OMX_ERRORTYPE COmxILOtherFileSinkOPB0Port::GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const
+	{
+	return COmxILOtherPort::GetLocalOmxConfigIndexes(aIndexArray);
+	}
+
+OMX_ERRORTYPE COmxILOtherFileSinkOPB0Port::GetParameter(OMX_INDEXTYPE aParamIndex, 
+												   TAny* apComponentParameterStructure) const
+	{
+	return COmxILOtherPort::GetParameter(aParamIndex, apComponentParameterStructure);
+	}
+
+OMX_ERRORTYPE COmxILOtherFileSinkOPB0Port::SetParameter(OMX_INDEXTYPE aParamIndex, 
+		           								   const TAny* apComponentParameterStructure, 
+		           								   TBool& aUpdateProcessingFunction)
+	{
+	return COmxILOtherPort::SetParameter(aParamIndex, 
+										 apComponentParameterStructure, 
+										 aUpdateProcessingFunction);
+	}
+
+OMX_ERRORTYPE COmxILOtherFileSinkOPB0Port::SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, 
+																TBool& /*aUpdateProcessingFunction*/)
+	{
+	OMX_ERRORTYPE OMXErr = OMX_ErrorNone;
+	if(aPortDefinition.format.other.eFormat == OMX_OTHER_FormatBinary)
+	    {
+        GetParamPortDefinition().format.other = aPortDefinition.format.other;
+	    }
+	else
+	    {
+	    OMXErr=OMX_ErrorUnsupportedSetting;
+	    }
+	return OMXErr;
+	}
+
+TBool COmxILOtherFileSinkOPB0Port::IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const
+	{
+	if(aPortDefinition.eDomain != GetParamPortDefinition().eDomain)
+	    {
+	    return EFalse;
+	    }
+
+	if (aPortDefinition.format.other.eFormat == OMX_OTHER_FormatMax)
+        {
+        return EFalse;
+        }	
+	
+	return ETrue;	
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/src/omxilvideofilesink.rss	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,43 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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 <ecom/registryinfo.rh>
+#include <openmax/il/loader/omxilcomponentif.hrh>
+#include "omxilfilesink.hrh"
+
+RESOURCE REGISTRY_INFO theInfo
+	{
+	dll_uid = KUidNokiaOmxILVideoFileSinkDll;
+	interfaces =
+		{
+		INTERFACE_INFO
+			{
+			interface_uid = KUidOmxILSymbianComponentIf;
+			implementations =
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid = KUidNokiaOmxILVideoFileSink;
+					version_no = 1;
+					display_name = "OMX.NOKIA.VIDEO.FILESINK";
+					default_data = "video_writer.binary";
+					}
+				};
+			}
+		};
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/src/omxilvideofilesinkvpb0port.cpp	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,128 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+#include "omxilvideofilesinkvpb0port.h"
+#include "omxilfilesinkprocessingfunction.h"
+#include <string.h>
+#include <uri8.h>
+
+COmxILVideoFileSinkVPB0Port* COmxILVideoFileSinkVPB0Port::NewL(const TOmxILCommonPortData& aCommonPortData,
+	                                                 const RArray<OMX_VIDEO_CODINGTYPE>& aSupportedCodings,
+	                                                 const RArray<OMX_COLOR_FORMATTYPE>& aSupportedColourFormats,
+													 const COmxILFileSinkProcessingFunction& aFileSinkPF)
+	{
+	COmxILVideoFileSinkVPB0Port* self = new (ELeave) COmxILVideoFileSinkVPB0Port(aFileSinkPF);
+	CleanupStack::PushL(self);
+	self->ConstructL(aCommonPortData, aSupportedCodings, aSupportedColourFormats);
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+void COmxILVideoFileSinkVPB0Port::ConstructL(const TOmxILCommonPortData& aCommonPortData,
+                                        const RArray<OMX_VIDEO_CODINGTYPE>& aSupportedCodings,
+                                        const RArray<OMX_COLOR_FORMATTYPE>& aSupportedColourFormats
+)
+	{
+    COmxILVideoPort::ConstructL(aCommonPortData, aSupportedCodings, aSupportedColourFormats);
+	GetSupportedVideoFormats().AppendL(OMX_VIDEO_CodingUnused);
+	GetParamPortDefinition().eDomain = OMX_PortDomainVideo;
+	}
+
+COmxILVideoFileSinkVPB0Port::COmxILVideoFileSinkVPB0Port(const COmxILFileSinkProcessingFunction& aFileSinkPF)
+	: iFileSinkPF(aFileSinkPF)
+	{
+	}
+
+COmxILVideoFileSinkVPB0Port::~COmxILVideoFileSinkVPB0Port()
+	{
+	iMimeType.Close();
+	CleanUpPort();
+	}
+	
+OMX_ERRORTYPE COmxILVideoFileSinkVPB0Port::GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const
+	{
+	return COmxILVideoPort::GetLocalOmxParamIndexes(aIndexArray);
+	}
+
+OMX_ERRORTYPE COmxILVideoFileSinkVPB0Port::GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const
+	{
+	return COmxILVideoPort::GetLocalOmxConfigIndexes(aIndexArray);
+	}
+
+OMX_ERRORTYPE COmxILVideoFileSinkVPB0Port::GetParameter(OMX_INDEXTYPE aParamIndex, 
+														TAny* apComponentParameterStructure) const
+	{
+	return COmxILVideoPort::GetParameter(aParamIndex, apComponentParameterStructure);
+	}
+
+OMX_ERRORTYPE COmxILVideoFileSinkVPB0Port::SetParameter(OMX_INDEXTYPE aParamIndex, 
+														const TAny* apComponentParameterStructure, 
+														TBool& aUpdateProcessingFunction)
+	{
+	return COmxILVideoPort::SetParameter(aParamIndex, 
+										 apComponentParameterStructure, 
+										 aUpdateProcessingFunction);
+	}
+
+OMX_ERRORTYPE COmxILVideoFileSinkVPB0Port::SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, 
+																TBool& /*aUpdateProcessingFunction*/)
+	{
+    OMX_ERRORTYPE omxErr = OMX_ErrorNone;
+    if (aPortDefinition.format.video.eCompressionFormat == OMX_VIDEO_CodingUnused)
+        {
+        OMX_STRING ptempMIMEType = GetParamPortDefinition().format.video.cMIMEType;
+        GetParamPortDefinition().format.video = aPortDefinition.format.video;
+        
+        GetParamPortDefinition().format.video.cMIMEType = ptempMIMEType;
+        if(aPortDefinition.format.video.cMIMEType)
+            {
+            TInt len= strlen (aPortDefinition.format.video.cMIMEType);
+            if(len > 0)
+                {
+                TPtrC8 mimetype(reinterpret_cast<const TUint8 *>(aPortDefinition.format.video.cMIMEType), len +1 );
+                HBufC8 *pHBuf = mimetype.Alloc();
+                if(pHBuf != NULL )
+                    {
+                    iMimeType.Close();
+                    iMimeType.Assign(pHBuf );
+                    TUint8* pTempBuff = const_cast<TUint8*>(iMimeType.PtrZ() );
+                    GetParamPortDefinition().format.video.cMIMEType = reinterpret_cast<OMX_STRING>(pTempBuff );
+                    }
+                }
+            }
+        }
+    else
+        {
+        omxErr = OMX_ErrorUnsupportedSetting;
+        }
+    
+    return omxErr; 
+	}
+
+TBool COmxILVideoFileSinkVPB0Port::IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const
+	{
+	if(aPortDefinition.eDomain != GetParamPortDefinition().eDomain)
+	    {
+	    return EFalse;
+	    }
+
+	if (aPortDefinition.format.video.eCompressionFormat == OMX_VIDEO_CodingMax)
+        {
+        return EFalse;
+        }	
+	return ETrue;	
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/tests/khronos_conformance/Khronos_file_sink_audio.txt	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,87 @@
+;; cc <testname> : conformance test component (sets appropriate flags, adds all tests, tests component) 
+;; st <traceflags>: OMX_CONF_SetTraceflags(<traceflags>);
+;; ol <logfilename>: OMX_OSAL_OpenLogfile(<logfilename>);
+;; cl : OMX_OSAL_CloseLogfile();
+;; at <testname>: OMX_CONF_AddTest(<testname>);
+;; rt <testname>: OMX_CONF_RemoveTest(<testname>);
+;; mi <inputfilename> <portindex> : OMX_CONF_MapInputfile(<inputfilename>,<portindex>);
+;; tc <testname>: OMX_CONF_TestComponent(<testname>);
+;; ps: OMX_CONF_PrintSettings();
+;; h: OMX_CONF_PrintHelp();
+;; lt: list all available tests.
+;; lc: list all available components.
+
+
+; setup tracing, open logfile
+st 0x7F ; (OMX_OSAL_TRACE_PASSFAIL|OMX_OSAL_TRACE_CALLSEQUENCE|OMX_OSAL_TRACE_PARAMTERS|OMX_OSAL_TRACE_INFO|OMX_OSAL_TRACE_ERROR|OMX_OSAL_TRACE_BUFFER|OMX_OSAL_TRACE_WARNING)
+ol c:\file_sink_audio_output.txt
+
+; add tests
+
+; Base Profile Tests
+
+;; ============
+;; Passed tests
+;; vvvvvvvvvvvv
+at StateTransitionTest
+at ComponentNameTest
+at BaseParameterTest
+at BufferTest
+at BufferFlagTest
+at FlushTest
+at BaseMultiThreadedTest
+at PortCommunicationTest
+;; ^^^^^^^^^^^^
+;; Passed tests
+;; ============
+
+;; at ResourceExhaustionTest Not run as we do not exhaust the resources within the iteration limit.
+
+
+; Interop Profile Tests
+
+
+;; ============
+;; Passed tests
+;; vvvvvvvvvvvv
+at InteropParameterTest
+at ValidInputOutputTest
+at InvalidInputOutputTest
+at PortBufferSupplierTest
+at PortDisableEnableTest
+at IncompleteStopTest
+at MinPayloadSizeTest
+at InteropMultiThreadedTest
+at TunnelledUnitTest
+;; ^^^^^^^^^^^^
+;; Passed tests
+;; ============
+
+
+
+;; Problem Resource Manager : Functionality not existent
+; at ResourcePreemptionTest
+; at WaitForResourcesTest
+
+;; Non-applicable tests
+; at ClockComponentTest
+; at SeekingComponentTest
+
+; Standard Component Class Tests
+
+;; ============
+;; Passed tests
+;; vvvvvvvvvvvv
+at StdBinaryAudioWriterTest
+;; ^^^^^^^^^^^^
+;; Passed tests
+;; ============
+
+mi c:\omxil\data\aac.stream 0
+
+; test components
+tc OMX.NOKIA.AUDIO.FILESINK
+
+
+; close logfile
+cl
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/tests/khronos_conformance/Khronos_file_sink_image.txt	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,86 @@
+;; cc <testname> : conformance test component (sets appropriate flags, adds all tests, tests component) 
+;; st <traceflags>: OMX_CONF_SetTraceflags(<traceflags>);
+;; ol <logfilename>: OMX_OSAL_OpenLogfile(<logfilename>);
+;; cl : OMX_OSAL_CloseLogfile();
+;; at <testname>: OMX_CONF_AddTest(<testname>);
+;; rt <testname>: OMX_CONF_RemoveTest(<testname>);
+;; mi <inputfilename> <portindex> : OMX_CONF_MapInputfile(<inputfilename>,<portindex>);
+;; tc <testname>: OMX_CONF_TestComponent(<testname>);
+;; ps: OMX_CONF_PrintSettings();
+;; h: OMX_CONF_PrintHelp();
+;; lt: list all available tests.
+;; lc: list all available components.
+
+
+; setup tracing, open logfile
+st 0x7F ; (OMX_OSAL_TRACE_PASSFAIL|OMX_OSAL_TRACE_CALLSEQUENCE|OMX_OSAL_TRACE_PARAMTERS|OMX_OSAL_TRACE_INFO|OMX_OSAL_TRACE_ERROR|OMX_OSAL_TRACE_BUFFER|OMX_OSAL_TRACE_WARNING)
+ol c:\file_sink_image_output.txt
+
+; add tests
+
+; Base Profile Tests
+
+;; ============
+;; Passed tests
+;; vvvvvvvvvvvv
+at StateTransitionTest
+at ComponentNameTest
+at BaseParameterTest
+at BufferTest
+at BufferFlagTest
+at FlushTest
+at BaseMultiThreadedTest
+at PortCommunicationTest
+;; ^^^^^^^^^^^^
+;; Passed tests
+;; ============
+
+;; at ResourceExhaustionTest Not run as we do not exhaust resources within the iteration limit.
+
+; Interop Profile Tests
+
+
+;; ============
+;; Passed tests
+;; vvvvvvvvvvvv
+at InteropParameterTest
+at ValidInputOutputTest
+at InvalidInputOutputTest
+at PortBufferSupplierTest
+at PortDisableEnableTest
+at IncompleteStopTest
+at MinPayloadSizeTest
+at InteropMultiThreadedTest
+at TunnelledUnitTest
+;; ^^^^^^^^^^^^
+;; Passed tests
+;; ============
+
+
+
+;; Problem Resource Manager : Functionality not existent
+; at ResourcePreemptionTest
+; at WaitForResourcesTest
+
+;; Non-applicable tests
+; at ClockComponentTest
+; at SeekingComponentTest
+
+; Standard Component Class Tests
+
+;; ============
+;; Passed tests
+;; vvvvvvvvvvvv
+at StdBinaryImageWriterTest
+;; ^^^^^^^^^^^^
+;; Passed tests
+;; ============
+
+
+mi c:\omxil\data\aac.stream 0
+
+; test components
+tc OMX.NOKIA.IMAGE.FILESINK
+
+; close logfile
+cl
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/tests/khronos_conformance/Khronos_file_sink_other.txt	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,88 @@
+;; cc <testname> : conformance test component (sets appropriate flags, adds all tests, tests component) 
+;; st <traceflags>: OMX_CONF_SetTraceflags(<traceflags>);
+;; ol <logfilename>: OMX_OSAL_OpenLogfile(<logfilename>);
+;; cl : OMX_OSAL_CloseLogfile();
+;; at <testname>: OMX_CONF_AddTest(<testname>);
+;; rt <testname>: OMX_CONF_RemoveTest(<testname>);
+;; mi <inputfilename> <portindex> : OMX_CONF_MapInputfile(<inputfilename>,<portindex>);
+;; tc <testname>: OMX_CONF_TestComponent(<testname>);
+;; ps: OMX_CONF_PrintSettings();
+;; h: OMX_CONF_PrintHelp();
+;; lt: list all available tests.
+;; lc: list all available components.
+
+
+; setup tracing, open logfile
+st 0x7F ; (OMX_OSAL_TRACE_PASSFAIL|OMX_OSAL_TRACE_CALLSEQUENCE|OMX_OSAL_TRACE_PARAMTERS|OMX_OSAL_TRACE_INFO|OMX_OSAL_TRACE_ERROR|OMX_OSAL_TRACE_BUFFER|OMX_OSAL_TRACE_WARNING)
+ol c:\file_sink_other_output.txt
+
+; add tests
+
+; Base Profile Tests
+
+;; ============
+;; Passed tests
+;; vvvvvvvvvvvv
+at StateTransitionTest
+at ComponentNameTest
+at BaseParameterTest
+at BufferTest
+at BufferFlagTest
+at FlushTest
+at BaseMultiThreadedTest
+at PortCommunicationTest
+;; ^^^^^^^^^^^^
+;; Passed tests
+;; ============
+
+;; at ResourceExhaustionTest Not run as do not exhaust resources within the iteration limit.
+
+
+
+; Interop Profile Tests
+
+
+;; ============
+;; Passed tests
+;; vvvvvvvvvvvv
+at InteropParameterTest
+at ValidInputOutputTest
+at InvalidInputOutputTest
+at PortBufferSupplierTest
+at PortDisableEnableTest
+at IncompleteStopTest
+at MinPayloadSizeTest
+at InteropMultiThreadedTest
+at TunnelledUnitTest
+;; ^^^^^^^^^^^^
+;; Passed tests
+;; ============
+
+
+
+;; Problem Resource Manager : Functionality not existent
+; at ResourcePreemptionTest
+; at WaitForResourcesTest
+
+;; Non-applicable tests
+; at ClockComponentTest
+; at SeekingComponentTest
+
+; Standard Component Class Tests
+
+;; ============
+;; Passed tests
+;; vvvvvvvvvvvv
+;; ^^^^^^^^^^^^
+;; Passed tests
+;; ============
+
+;; at StdWriterTest Not run as other_writer.binary is not a standard role, so the test will fail as it is only for standard components as defined in section 8 of the spec.
+
+mi c:\omxil\data\aac.stream 0
+
+; test components
+tc OMX.NOKIA.OTHER.FILESINK
+
+; close logfile
+cl
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/tests/khronos_conformance/Khronos_file_sink_video.txt	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,86 @@
+;; cc <testname> : conformance test component (sets appropriate flags, adds all tests, tests component) 
+;; st <traceflags>: OMX_CONF_SetTraceflags(<traceflags>);
+;; ol <logfilename>: OMX_OSAL_OpenLogfile(<logfilename>);
+;; cl : OMX_OSAL_CloseLogfile();
+;; at <testname>: OMX_CONF_AddTest(<testname>);
+;; rt <testname>: OMX_CONF_RemoveTest(<testname>);
+;; mi <inputfilename> <portindex> : OMX_CONF_MapInputfile(<inputfilename>,<portindex>);
+;; tc <testname>: OMX_CONF_TestComponent(<testname>);
+;; ps: OMX_CONF_PrintSettings();
+;; h: OMX_CONF_PrintHelp();
+;; lt: list all available tests.
+;; lc: list all available components.
+
+
+; setup tracing, open logfile
+st 0x7F ; (OMX_OSAL_TRACE_PASSFAIL|OMX_OSAL_TRACE_CALLSEQUENCE|OMX_OSAL_TRACE_PARAMTERS|OMX_OSAL_TRACE_INFO|OMX_OSAL_TRACE_ERROR|OMX_OSAL_TRACE_BUFFER|OMX_OSAL_TRACE_WARNING)
+ol c:\file_sink_video_output.txt
+
+; add tests
+
+; Base Profile Tests
+
+;; ============
+;; Passed tests
+;; vvvvvvvvvvvv
+at StateTransitionTest
+at ComponentNameTest
+at BaseParameterTest
+at BufferTest
+at BufferFlagTest
+at FlushTest
+at BaseMultiThreadedTest
+at PortCommunicationTest
+;; ^^^^^^^^^^^^
+;; Passed tests
+;; ============
+
+;; at ResourceExhaustionTest Not run as we do not exhaust resources within the iteration limit.
+
+; Interop Profile Tests
+
+
+;; ============
+;; Passed tests
+;; vvvvvvvvvvvv
+at InteropParameterTest
+at ValidInputOutputTest
+at InvalidInputOutputTest
+at PortBufferSupplierTest
+at PortDisableEnableTest
+at IncompleteStopTest
+at MinPayloadSizeTest
+at InteropMultiThreadedTest
+at TunnelledUnitTest
+;; ^^^^^^^^^^^^
+;; Passed tests
+;; ============
+
+
+
+;; Problem Resource Manager : Functionality not existent
+; at ResourcePreemptionTest
+; at WaitForResourcesTest
+
+;; Non-applicable tests
+; at ClockComponentTest
+; at SeekingComponentTest
+
+; Standard Component Class Tests
+
+;; ============
+;; Passed tests
+;; vvvvvvvvvvvv
+at StdBinaryVideoWriterTest
+;; ^^^^^^^^^^^^
+;; Passed tests
+;; ============
+
+mi c:\omxil\data\aac.stream 0
+
+; test components
+tc OMX.NOKIA.VIDEO.FILESINK
+
+
+; close logfile
+cl
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/tests/unit/te_omx_filesink.ini	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,2 @@
+[InstanceName]
+name=OmxXmlTestObject
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/tests/unit/te_omx_filesink_audio.script	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,34 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+LOAD_SUITE te_xmlomxclient
+
+START_TESTCASE MM-AUDIO-OMX-FILESOURCE-001-HP
+	START_TEST_BLOCK 30 te_xmlomxclient c:\omxil\tef\te_omx_filesink.ini
+		CREATE_OBJECT OmxXmlTestWrapper InstanceName
+		COMMAND	InstanceName New c:\omxil\tef\te_omx_filesink_audio.xml
+		COMMAND InstanceName RunTest BasicOperation
+		COMMAND InstanceName RunTest GetFilenameNoFileSet_filesink
+		COMMAND InstanceName RunTest GetFilenameOverFlow_filesink
+		COMMAND InstanceName RunTest ChangeEncodeType_filesink
+		COMMAND InstanceName RunTest ChangeInvalidEncodeType_filesink
+		COMMAND InstanceName RunTest BasicOperation_nofilename_filesink
+	END_TEST_BLOCK
+END_TESTCASE MM-AUDIO-OMX-FILESOURCE-001-HP
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/tests/unit/te_omx_filesink_audio.xml	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+	Copyright (c) NOKIA 2009. All rights reserved.
+	file Source Sink Audio tests for OpenMAX IL.
+	
+	Expected Result:
+	BasicOperation				Pass
+	GetFilenameNoFileSet_filesink		Fail	OMX_ErrorNotReady
+	GetFilenameOverFlow_filesink		Fail	OMX_ErrorBadParameter
+	ChangeEncodeType_filesink		Pass		
+	ChangeInvalidEncodeType_filesink	Fail	OMX_ErrorUnsupportedSetting
+	BasicOperation_nofilename_filesink	Pass
+
+-->
+
+<TestSet>
+
+	<!--  ->  
+		File Source Audio -> 	File Sink Audio	 	
+	-->
+	<Test name="BasicOperation">
+		<!-- Simple file read\write testcase: all comps. to IDLE then to EXECUTING then 3 secs later to IDLE
+			 -->
+		<LoadComponent comp="filesink" name="OMX.NOKIA.AUDIO.FILESINK" />
+		<LoadComponent comp="filesource" name="OMX.NOKIA.AUDIO.FILESOURCE" />
+		
+		<SetupTunnel output="filesource:0" input="filesink:0" />
+		<BufferSupplierOverride output="filesource:0" input="filesink:0" supplier="output" />
+		
+		<SetFilename comp="filesink" filename="C:\omxil\data\aac_same_audio.stream" />
+		
+		<SetFilename comp="filesource" filename="C:\omxil\data\aac.stream" />
+		<GetFilename comp="filesink" filename="C:\omxil\data\aab_same_audio.stream"/>	
+
+		<IgnoreEvent comp="filesink" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+		<IgnoreEvent comp="filesource" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+		
+		<IgnoreEvent comp="filesink" event="OMX_EventBufferFlag" nData1="0x00000000 " nData2="0x00000001" nData3="0"/>
+		<IgnoreEvent comp="filesource" event="OMX_EventBufferFlag" nData1="0x00000000 " nData2="0x00000001" nData3="0"/>
+		
+		<AllTransition state="idle" order="auto"/>
+		<AllTransition state="executing" order="auto" />
+		<Wait delaytime="3000000" />
+		<AllTransition state="idle" order="auto"/>
+		<AllTransition state="loaded" order="auto"/>
+	</Test>
+	
+	
+	<Test name="GetFilenameNoFileSet_filesink">
+		<LoadComponent comp="filesink" name="OMX.NOKIA.AUDIO.FILESINK" />
+		<!--OMX_ErrorNotReady-->
+		<ExpectEvent comp="filesink" event="Error" nData1="0x80001010" nData2="0"/>
+		<GetFilename comp="filesink" filename="C:\omxil\data\aab.stream" expectedomxerr="OMX_ErrorNotReady"/>
+	</Test>
+	
+	<Test name="GetFilenameOverFlow_filesink">
+		<LoadComponent comp="filesink" name="OMX.NOKIA.AUDIO.FILESINK" />
+		<!--OMX_ErrorBadParameter-->
+		
+		<SetFilename comp="filesink" filename="C:\omxil\data\aac.stream" />
+		<IgnoreEvent comp="filesink" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+		
+		<ExpectEvent comp="filesink" event="Error" nData1="0x80001005" nData2="0" />
+		<GetFilename comp="filesink" filename="C:\omxil\data\aa.stream" expectedomxerr="OMX_ErrorBadParameter"/>
+	</Test>
+	
+	<Test name="ChangeEncodeType_filesink">
+	<!-- expected result :Pass -->
+		<LoadComponent comp="filesink" name="OMX.NOKIA.AUDIO.FILESINK" />
+		<!--Pass-->
+		<SetAudioPortDef port="filesink:0" codingType="unused" /> 
+		<IgnoreEvent comp="filesink" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+	</Test>
+	
+	
+	<Test name="ChangeInvalidEncodeType_filesink">
+	<!-- expected result :fail OMX_ErrorUnsupportedSetting-->
+		<LoadComponent comp="filesink" name="OMX.NOKIA.AUDIO.FILESINK" />
+		<!--OMX_ErrorUnsupportedSetting-->
+		<SetAudioPortDef port="filesink:0" codingType="pcm" expectedomxerr="OMX_ErrorUnsupportedSetting" /> 
+		<IgnoreEvent comp="filesink" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+	</Test>
+	
+	<Test name="BasicOperation_nofilename_filesink">
+		<!-- Simple file read\write testcase: all comps. to IDLE then to EXECUTING then 3 secs later to IDLE
+		 no filename is set for the file sink -->
+		<LoadComponent comp="filesink" name="OMX.NOKIA.AUDIO.FILESINK" />
+		<LoadComponent comp="filesource" name="OMX.NOKIA.AUDIO.FILESOURCE" />
+
+		<SetupTunnel output="filesource:0" input="filesink:0" />
+		<BufferSupplierOverride output="filesource:0" input="filesink:0" supplier="output" />
+
+		<SetFilename comp="filesource" filename="C:\omxil\data\aac.stream" />
+		
+		<IgnoreEvent comp="filesink" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+		<IgnoreEvent comp="filesource" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+
+		<IgnoreEvent comp="filesink" event="OMX_EventBufferFlag" nData1="0x00000000 " nData2="0x00000001" nData3="0"/>
+		<IgnoreEvent comp="filesource" event="OMX_EventBufferFlag" nData1="0x00000000 " nData2="0x00000001" nData3="0"/>
+
+		<AllTransition state="idle" order="auto"/>
+		<AllTransition state="executing" order="auto" />
+		<Wait delaytime="3000000" />
+		<AllTransition state="idle" order="auto"/>
+		<AllTransition state="loaded" order="auto"/>
+	</Test>
+	
+	
+</TestSet>
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/tests/unit/te_omx_filesink_image.script	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,32 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+LOAD_SUITE te_xmlomxclient
+
+START_TESTCASE MM-IMAGE-OMX-FILESOURCE-001-HP
+	START_TEST_BLOCK 30 te_xmlomxclient c:\omxil\tef\te_omx_filesink.ini
+		CREATE_OBJECT OmxXmlTestWrapper InstanceName
+		COMMAND	InstanceName New c:\omxil\tef\te_omx_filesink_image.xml
+		COMMAND InstanceName RunTest BasicOperation
+		COMMAND InstanceName RunTest GetFilenameNoFileSet_filesink
+		COMMAND InstanceName RunTest GetFilenameOverFlow_filesink
+		COMMAND InstanceName RunTest BasicOperation_nofilename_filesink
+	END_TEST_BLOCK
+END_TESTCASE MM-IMAGE-OMX-FILESOURCE-001-HP
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/tests/unit/te_omx_filesink_image.xml	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+	Copyright (c) NOKIA 2009. All rights reserved.
+	file Source Sink Image tests for OpenMAX IL.
+	
+
+	Expected Result:
+	BasicOperation				Pass
+	GetFilenameNoFileSet_filesink		Fail	OMX_ErrorNotReady
+	GetFilenameOverFlow_filesink		Fail	OMX_ErrorBadParameter
+	BasicOperation_nofilename_filesink	Pass
+-->
+
+<TestSet>
+
+	<!--  ->  
+		File Source Image -> 	File Sink Image	 	
+	-->
+	<Test name="BasicOperation">
+		<!-- Simple file read\write testcase: all comps. to IDLE then to EXECUTING then 3 secs later to IDLE
+			 -->
+		<LoadComponent comp="filesink" name="OMX.NOKIA.IMAGE.FILESINK" />
+		<LoadComponent comp="filesource" name="OMX.NOKIA.IMAGE.FILESOURCE" />
+		
+		<SetupTunnel output="filesource:0" input="filesink:0" />
+		<BufferSupplierOverride output="filesource:0" input="filesink:0" supplier="output" />
+		
+		<SetFilename comp="filesink" filename="C:\omxil\data\aac_same_image.stream" />
+		
+		<SetFilename comp="filesource" filename="C:\omxil\data\aac.stream" />
+		<GetFilename comp="filesink" filename="C:\omxil\data\aab_same_image.stream"/>	
+
+		<IgnoreEvent comp="filesink" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+		<IgnoreEvent comp="filesource" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+		
+		<IgnoreEvent comp="filesink" event="OMX_EventBufferFlag" nData1="0x00000000 " nData2="0x00000001" nData3="0"/>
+		<IgnoreEvent comp="filesource" event="OMX_EventBufferFlag" nData1="0x00000000 " nData2="0x00000001" nData3="0"/>
+		
+		<AllTransition state="idle" order="auto"/>
+		<AllTransition state="executing" order="auto" />
+		<Wait delaytime="3000000" />
+		<AllTransition state="idle" order="auto"/>
+		<AllTransition state="loaded" order="auto"/>
+	</Test>
+	
+	
+	<Test name="GetFilenameNoFileSet_filesink">
+		<LoadComponent comp="filesink" name="OMX.NOKIA.IMAGE.FILESINK" />
+		<!--OMX_ErrorNotReady-->
+		<ExpectEvent comp="filesink" event="Error" nData1="0x80001010" nData2="0"/>
+		<GetFilename comp="filesink" filename="C:\omxil\data\aab.stream" expectedomxerr="OMX_ErrorNotReady"/>
+	</Test>
+	
+	<Test name="GetFilenameOverFlow_filesink">
+		<LoadComponent comp="filesink" name="OMX.NOKIA.IMAGE.FILESINK" />
+		<!--OMX_ErrorBadParameter-->
+		
+		<SetFilename comp="filesink" filename="C:\omxil\data\aac.stream" />
+		<IgnoreEvent comp="filesink" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+		
+		<ExpectEvent comp="filesink" event="Error" nData1="0x80001005" nData2="0" />
+		<GetFilename comp="filesink" filename="C:\omxil\data\aa.stream" expectedomxerr="OMX_ErrorBadParameter"/>
+	</Test>
+	
+	
+	<Test name="BasicOperation_nofilename_filesink">
+		<!-- Simple file read\write testcase: all comps. to IDLE then to EXECUTING then 3 secs later to IDLE
+		 no filename is set for the file sink -->
+		<LoadComponent comp="filesink" name="OMX.NOKIA.IMAGE.FILESINK" />
+		<LoadComponent comp="filesource" name="OMX.NOKIA.IMAGE.FILESOURCE" />
+
+		<SetupTunnel output="filesource:0" input="filesink:0" />
+		<BufferSupplierOverride output="filesource:0" input="filesink:0" supplier="output" />
+
+		<SetFilename comp="filesource" filename="C:\omxil\data\aac.stream" />
+		
+		<IgnoreEvent comp="filesink" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+		<IgnoreEvent comp="filesource" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+
+		<IgnoreEvent comp="filesink" event="OMX_EventBufferFlag" nData1="0x00000000 " nData2="0x00000001" nData3="0"/>
+		<IgnoreEvent comp="filesource" event="OMX_EventBufferFlag" nData1="0x00000000 " nData2="0x00000001" nData3="0"/>
+
+		<AllTransition state="idle" order="auto"/>
+		<AllTransition state="executing" order="auto" />
+		<Wait delaytime="3000000" />
+		<AllTransition state="idle" order="auto"/>
+		<AllTransition state="loaded" order="auto"/>
+	</Test>
+	
+	
+</TestSet>
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/tests/unit/te_omx_filesink_other.script	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,32 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+LOAD_SUITE te_xmlomxclient
+
+START_TESTCASE MM-OTHER-OMX-FILESOURCE-001-HP
+	START_TEST_BLOCK 30 te_xmlomxclient c:\omxil\tef\te_omx_filesink.ini
+		CREATE_OBJECT OmxXmlTestWrapper InstanceName
+		COMMAND	InstanceName New c:\omxil\tef\te_omx_filesink_other.xml
+		COMMAND InstanceName RunTest BasicOperation
+		COMMAND InstanceName RunTest GetFilenameNoFileSet_filesink
+		COMMAND InstanceName RunTest GetFilenameOverFlow_filesink
+		COMMAND InstanceName RunTest BasicOperation_nofilename_filesink
+	END_TEST_BLOCK
+END_TESTCASE MM-OTHER-OMX-FILESOURCE-001-HP
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/tests/unit/te_omx_filesink_other.xml	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+	Copyright (c) NOKIA 2009. All rights reserved.
+	file Source Sink Other tests for OpenMAX IL.
+	
+
+	Expected Result:
+	BasicOperation				Pass
+	GetFilenameNoFileSet_filesink		Fail	OMX_ErrorNotReady
+	GetFilenameOverFlow_filesink		Fail	OMX_ErrorBadParameter	
+	BasicOperation_nofilename_filesink	Pass
+-->
+
+<TestSet>
+
+	<!--  ->  
+		File Source Other -> 	File Sink Other	 	
+	-->
+	<Test name="BasicOperation">
+		<!-- Simple file read\write testcase: all comps. to IDLE then to EXECUTING then 3 secs later to IDLE
+			 -->
+		<LoadComponent comp="filesink" name="OMX.NOKIA.OTHER.FILESINK" />
+		<LoadComponent comp="filesource" name="OMX.NOKIA.OTHER.FILESOURCE" />
+		
+		<SetupTunnel output="filesource:0" input="filesink:0" />
+		<BufferSupplierOverride output="filesource:0" input="filesink:0" supplier="output" />
+		
+		<SetFilename comp="filesink" filename="C:\omxil\data\aac_same_other.stream" />
+		
+		<SetFilename comp="filesource" filename="C:\omxil\data\aac.stream" />
+		<GetFilename comp="filesink" filename="C:\omxil\data\aab_same_other.stream"/>	
+
+		<IgnoreEvent comp="filesink" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+		<IgnoreEvent comp="filesource" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+		
+		<IgnoreEvent comp="filesink" event="OMX_EventBufferFlag" nData1="0x00000000 " nData2="0x00000001" nData3="0"/>
+		<IgnoreEvent comp="filesource" event="OMX_EventBufferFlag" nData1="0x00000000 " nData2="0x00000001" nData3="0"/>
+		
+		<AllTransition state="idle" order="auto"/>
+		<AllTransition state="executing" order="auto" />
+		<Wait delaytime="3000000" />
+		<AllTransition state="idle" order="auto"/>
+		<AllTransition state="loaded" order="auto"/>
+	</Test>
+	
+	
+	<Test name="GetFilenameNoFileSet_filesink">
+		<LoadComponent comp="filesink" name="OMX.NOKIA.OTHER.FILESINK" />
+		<!--OMX_ErrorNotReady-->
+		<ExpectEvent comp="filesink" event="Error" nData1="0x80001010" nData2="0"/>
+		<GetFilename comp="filesink" filename="C:\omxil\data\aab.stream" expectedomxerr="OMX_ErrorNotReady"/>
+	</Test>
+	
+	<Test name="GetFilenameOverFlow_filesink">
+		<LoadComponent comp="filesink" name="OMX.NOKIA.OTHER.FILESINK" />
+		<!--OMX_ErrorBadParameter-->
+		
+		<SetFilename comp="filesink" filename="C:\omxil\data\aac.stream" />
+		<IgnoreEvent comp="filesink" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+		
+		<ExpectEvent comp="filesink" event="Error" nData1="0x80001005" nData2="0" />
+		<GetFilename comp="filesink" filename="C:\omxil\data\aa.stream" expectedomxerr="OMX_ErrorBadParameter"/>
+	</Test>
+	
+	
+	<Test name="BasicOperation_nofilename_filesink">
+		<!-- Simple file read\write testcase: all comps. to IDLE then to EXECUTING then 3 secs later to IDLE
+		 no filename is set for the file sink -->
+		<LoadComponent comp="filesink" name="OMX.NOKIA.OTHER.FILESINK" />
+		<LoadComponent comp="filesource" name="OMX.NOKIA.OTHER.FILESOURCE" />
+
+		<SetupTunnel output="filesource:0" input="filesink:0" />
+		<BufferSupplierOverride output="filesource:0" input="filesink:0" supplier="output" />
+
+		<SetFilename comp="filesource" filename="C:\omxil\data\aac.stream" />
+		
+		<IgnoreEvent comp="filesink" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+		<IgnoreEvent comp="filesource" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+
+		<IgnoreEvent comp="filesink" event="OMX_EventBufferFlag" nData1="0x00000000 " nData2="0x00000001" nData3="0"/>
+		<IgnoreEvent comp="filesource" event="OMX_EventBufferFlag" nData1="0x00000000 " nData2="0x00000001" nData3="0"/>
+
+		<AllTransition state="idle" order="auto"/>
+		<AllTransition state="executing" order="auto" />
+		<Wait delaytime="3000000" />
+		<AllTransition state="idle" order="auto"/>
+		<AllTransition state="loaded" order="auto"/>
+	</Test>
+	
+	
+</TestSet>
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/tests/unit/te_omx_filesink_video.script	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,34 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+LOAD_SUITE te_xmlomxclient
+
+START_TESTCASE MM-VIDEO-OMX-FILESOURCE-001-HP
+	START_TEST_BLOCK 30 te_xmlomxclient c:\omxil\tef\te_omx_filesink.ini
+		CREATE_OBJECT OmxXmlTestWrapper InstanceName
+		COMMAND	InstanceName New c:\omxil\tef\te_omx_filesink_video.xml
+		COMMAND InstanceName RunTest BasicOperation
+		COMMAND InstanceName RunTest GetFilenameNoFileSet_filesink
+		COMMAND InstanceName RunTest GetFilenameOverFlow_filesink
+		COMMAND InstanceName RunTest ChangeEncodeType_filesink
+		COMMAND InstanceName RunTest ChangeInvalidEncodeType_filesink
+		COMMAND InstanceName RunTest BasicOperation_nofilename_filesink
+	END_TEST_BLOCK
+END_TESTCASE MM-VIDEO-OMX-FILESOURCE-001-HP
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/tests/unit/te_omx_filesink_video.xml	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+	Copyright (c) NOKIA 2009. All rights reserved.
+	file Source Sink Video tests for OpenMAX IL.
+	
+
+	Expected Result:
+	BasicOperation				Pass
+	GetFilenameNoFileSet_filesink		Fail	OMX_ErrorNotReady
+	GetFilenameOverFlow_filesink		Fail	OMX_ErrorBadParameter
+	ChangeEncodeType_filesink		Pass		
+	ChangeInvalidEncodeType_filesink	Fail	OMX_ErrorUnsupportedSetting
+	BasicOperation_nofilename_filesink	Pass
+-->
+
+<TestSet>
+
+	<!--  ->  
+		File Source Video -> 	File Sink Video	 	
+	-->
+	<Test name="BasicOperation">
+		<!-- Simple file read\write testcase: all comps. to IDLE then to EXECUTING then 3 secs later to IDLE
+			 -->
+		<LoadComponent comp="filesink" name="OMX.NOKIA.VIDEO.FILESINK" />
+		<LoadComponent comp="filesource" name="OMX.NOKIA.VIDEO.FILESOURCE" />
+		
+		<SetupTunnel output="filesource:0" input="filesink:0" />
+		<BufferSupplierOverride output="filesource:0" input="filesink:0" supplier="output" />
+		
+		<SetFilename comp="filesink" filename="C:\omxil\data\aac_same_video.stream" />
+		
+		<SetFilename comp="filesource" filename="C:\omxil\data\aac.stream" />
+		<GetFilename comp="filesink" filename="C:\omxil\data\aab_same_video.stream"/>	
+
+		<IgnoreEvent comp="filesink" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+		<IgnoreEvent comp="filesource" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+		
+		<IgnoreEvent comp="filesink" event="OMX_EventBufferFlag" nData1="0x00000000 " nData2="0x00000001" nData3="0"/>
+		<IgnoreEvent comp="filesource" event="OMX_EventBufferFlag" nData1="0x00000000 " nData2="0x00000001" nData3="0"/>
+		
+		<AllTransition state="idle" order="auto"/>
+		<AllTransition state="executing" order="auto" />
+		<Wait delaytime="3000000" />
+		<AllTransition state="idle" order="auto"/>
+		<AllTransition state="loaded" order="auto"/>
+	</Test>
+	
+	
+	<Test name="GetFilenameNoFileSet_filesink">
+		<LoadComponent comp="filesink" name="OMX.NOKIA.VIDEO.FILESINK" />
+		<!--OMX_ErrorNotReady-->
+		<ExpectEvent comp="filesink" event="Error" nData1="0x80001010" nData2="0"/>
+		<GetFilename comp="filesink" filename="C:\omxil\data\aab.stream" expectedomxerr="OMX_ErrorNotReady"/>
+	</Test>
+	
+	<Test name="GetFilenameOverFlow_filesink">
+		<LoadComponent comp="filesink" name="OMX.NOKIA.VIDEO.FILESINK" />
+		<!--OMX_ErrorBadParameter-->
+		
+		<SetFilename comp="filesink" filename="C:\omxil\data\aac.stream" />
+		<IgnoreEvent comp="filesink" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+		
+		<ExpectEvent comp="filesink" event="Error" nData1="0x80001005" nData2="0" />
+		<GetFilename comp="filesink" filename="C:\omxil\data\aa.stream" expectedomxerr="OMX_ErrorBadParameter"/>
+	</Test>
+		
+	<Test name="ChangeEncodeType_filesink">
+	<!-- expected result :Pass -->
+		<LoadComponent comp="filesink" name="OMX.NOKIA.VIDEO.FILESINK" />
+		<!--Pass-->
+		<SetVideoPortDef port="filesink:0" codingType="unused" /> 
+		<IgnoreEvent comp="filesink" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+	</Test>
+	
+	
+	<Test name="ChangeInvalidEncodeType_filesink">
+	<!-- expected result :fail OMX_ErrorUnsupportedSetting-->
+		<LoadComponent comp="filesink" name="OMX.NOKIA.VIDEO.FILESINK" />
+		<!--Pass-->
+		<SetVideoPortDef port="filesink:0" codingType="mpeg4" expectedomxerr="OMX_ErrorUnsupportedSetting"/> 
+		<IgnoreEvent comp="filesink" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+	</Test>
+	
+	<Test name="BasicOperation_nofilename_filesink">
+		<!-- Simple file read\write testcase: all comps. to IDLE then to EXECUTING then 3 secs later to IDLE
+		 no filename is set for the file sink -->
+		<LoadComponent comp="filesink" name="OMX.NOKIA.VIDEO.FILESINK" />
+		<LoadComponent comp="filesource" name="OMX.NOKIA.VIDEO.FILESOURCE" />
+
+		<SetupTunnel output="filesource:0" input="filesink:0" />
+		<BufferSupplierOverride output="filesource:0" input="filesink:0" supplier="output" />
+
+		<SetFilename comp="filesource" filename="C:\omxil\data\aac.stream" />
+		
+		<IgnoreEvent comp="filesink" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+		<IgnoreEvent comp="filesource" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+
+		<IgnoreEvent comp="filesink" event="OMX_EventBufferFlag" nData1="0x00000000 " nData2="0x00000001" nData3="0"/>
+		<IgnoreEvent comp="filesource" event="OMX_EventBufferFlag" nData1="0x00000000 " nData2="0x00000001" nData3="0"/>
+
+		<AllTransition state="idle" order="auto"/>
+		<AllTransition state="executing" order="auto" />
+		<Wait delaytime="3000000" />
+		<AllTransition state="idle" order="auto"/>
+		<AllTransition state="loaded" order="auto"/>
+	</Test>
+	
+	
+</TestSet>
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/tests/unit/te_omx_filesink_video_compatibility.script	Thu Sep 02 20:13:57 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:
+//
+
+
+
+LOAD_SUITE te_xmlomxclient
+
+START_TESTCASE MM-VIDEO-OMX-FILESOURCE-001-HP
+	START_TEST_BLOCK 30 te_xmlomxclient c:\omxil\tef\te_omx_filesink.ini
+		CREATE_OBJECT OmxXmlTestWrapper InstanceName
+		COMMAND	InstanceName New c:\omxil\tef\te_omx_filesink_video_compatibility.xml
+		COMMAND InstanceName RunTest Read3GPFormat
+	END_TEST_BLOCK
+END_TESTCASE MM-VIDEO-OMX-FILESOURCE-001-HP
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesink/tests/unit/te_omx_filesink_video_compatibility.xml	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+	Copyright (c) NOKIA 2009. All rights reserved.
+	file Source Sink Video tests for OpenMAX IL.
+	
+	This tests confirms that the file sink functions as expected with established components
+
+	Expected Result:
+	Read3GPFormat				Pass
+-->
+
+<TestSet>
+
+	<!--
+		File Source Video (3GP demuxer) -> 	File Sink Video	
+		Perform format detection by setting the component to the Executing state.
+	-->
+	<Test name="Read3GPFormat">
+		<LoadComponent comp="sink" name="OMX.NOKIA.VIDEO.FILESINK" />
+		<LoadComponent comp="3gp" name="OMX.SYMBIAN.OTHER.CONTAINER_DEMUXER.3GP" />
+		<SetFilename comp="3gp" filename="c:\omxil\data\cube-xvid-640x480-10fps-10s.3gp" />
+		<DisablePort port="3gp:0"/>
+		<ExpectEvent comp="3gp" event="CmdComplete" nData1="PortDisable" nData2="0" />
+		<DisablePort port="3gp:2"/>
+		<ExpectEvent comp="3gp" event="CmdComplete" nData1="PortDisable" nData2="2" />
+		<SetVideoPortDef port="3gp:1" codingType="autodetect" />
+		<SetFilename comp="sink" filename="c:\sink.3gp" />
+		<SetupTunnel output="3gp:1" input="sink:0" />
+		<AllTransition state="idle" />
+		<ExpectEvent comp="3gp" event="PortFormatDetected" nData1="1" nData2="0" />
+		<ExpectEvent comp="3gp" event="PortSettingsChanged" nData1="0x02000001" nData2="1" />
+		<ExpectEvent comp="sink" event="PortSettingsChanged" nData1="0x02000001" nData2="0"/>
+		
+		<AllTransition state="executing" />
+
+
+		<IgnoreEvent comp="3gp" event="OMX_EventBufferFlag" nData1="0x00000001" nData2="0x00000032" nData3="0"/>
+		
+		
+		<CheckVideoPortDef port="3gp:1" width="640" height="480" coding="mpeg4" colorFormat="unused" />	
+		<WaitEOS /> 
+
+		<AllTransition state="idle" />
+		<AllTransition state="loaded" />
+	</Test>
+	
+	
+</TestSet>
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesource/group/bld.inf	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,50 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+#ifdef SYMBIAN_MM_OPENMAXIL_ADDITIONAL_COMPONENTS
+PRJ_EXPORTS
+
+omxilotherfilesource.iby							/epoc32/rom/include/omxilotherfilesource.iby
+omxilaudiofilesource.iby							/epoc32/rom/include/omxilaudiofilesource.iby
+omxilvideofilesource.iby							/epoc32/rom/include/omxilvideofilesource.iby	
+omxilimagefilesource.iby							/epoc32/rom/include/omxilimagefilesource.iby
+
+PRJ_MMPFILES
+../mmpfiles/omxilotherfilesource.mmp
+../mmpfiles/omxilaudiofilesource.mmp
+../mmpfiles/omxilimagefilesource.mmp
+../mmpfiles/omxilvideofilesource.mmp
+
+
+PRJ_TESTEXPORTS
+../tests/khronos_conformance/Khronos_file_source_audio.txt		/epoc32/winscw/c/omxil/khronos/Khronos_file_source_audio.txt
+../tests/khronos_conformance/Khronos_file_source_image.txt		/epoc32/winscw/c/omxil/khronos/Khronos_file_source_image.txt
+../tests/khronos_conformance/Khronos_file_source_video.txt		/epoc32/winscw/c/omxil/khronos/Khronos_file_source_video.txt
+../tests/khronos_conformance/Khronos_file_source_other.txt		/epoc32/winscw/c/omxil/khronos/Khronos_file_source_other.txt
+
+../tests/unit/te_omx_filesource_audio.script		/epoc32/winscw/c/omxil/tef/te_omx_filesource_audio.script	
+../tests/unit/te_omx_filesource_audio.xml		/epoc32/winscw/c/omxil/tef/te_omx_filesource_audio.xml	
+../tests/unit/te_omx_filesource_image.script		/epoc32/winscw/c/omxil/tef/te_omx_filesource_image.script	
+../tests/unit/te_omx_filesource_image.xml		/epoc32/winscw/c/omxil/tef/te_omx_filesource_image.xml	
+../tests/unit/te_omx_filesource_other.script		/epoc32/winscw/c/omxil/tef/te_omx_filesource_other.script
+../tests/unit/te_omx_filesource_other.xml		/epoc32/winscw/c/omxil/tef/te_omx_filesource_other.xml	
+../tests/unit/te_omx_filesource_video.script		/epoc32/winscw/c/omxil/tef/te_omx_filesource_video.script
+../tests/unit/te_omx_filesource_video.xml		/epoc32/winscw/c/omxil/tef/te_omx_filesource_video.xml	
+../tests/unit/te_omx_filesrc.ini			/epoc32/winscw/c/omxil/tef/te_omx_filesrc.ini
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesource/group/omxilaudiofilesource.iby	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,26 @@
+/*
+* 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: 
+*
+*/
+
+
+#ifndef OMXILAUDIOFILESOURCE_IBY_
+#define OMXILAUDIOFILESOURCE_IBY_
+
+#include <omxilcomp.iby>
+
+ECOM_PLUGIN(omxilaudiofilesource.dll, omxilaudiofilesource.rsc)
+
+#endif /*OMXILAUDIOFILESOURCE_IBY_*/
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesource/group/omxilimagefilesource.iby	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,26 @@
+/*
+* 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: 
+*
+*/
+
+
+#ifndef OMXILIMAGEFILESOURCE_IBY_
+#define OMXILIMAGEFILESOURCE_IBY_
+
+#include <omxilcomp.iby>
+
+ECOM_PLUGIN(omxilimagefilesource.dll, omxilimagefilesource.rsc)
+
+#endif /*OMXILIMAGEFILESOURCE_IBY_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesource/group/omxilotherfilesource.iby	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,26 @@
+/*
+* 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: 
+*
+*/
+
+
+#ifndef OMXILFILESOURCE_IBY_
+#define OMXILFILESOURCE_IBY_
+
+#include <omxilcomp.iby>
+
+ECOM_PLUGIN(omxilotherfilesource.dll, omxilotherfilesource.rsc)
+
+#endif /*OMXILFILESOURCE_IBY_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesource/group/omxilvideofilesource.iby	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,26 @@
+/*
+* 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: 
+*
+*/
+
+
+#ifndef OMXILVIDEOFILESOURCE_IBY_
+#define OMXILVIDEOFILESOURCE_IBY_
+
+#include <omxilcomp.iby>
+
+ECOM_PLUGIN(omxilvideofilesource.dll, omxilvideofilesource.rsc)
+
+#endif /*OMXILVIDEOFILESOURCE_IBY_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesource/inc/omxilaudiofilesourceapb0port.h	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,59 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ * @file
+ * @internalTechnology
+ */
+
+#ifndef OMXILAUDIOFILESOURCEOPB0PORT_H
+#define OMXILAUDIOFILESOURCEOPB0PORT_H
+
+#include <openmax/il/common/omxilaudioport.h>
+#include "omxilfilesourceprocessingfunction.h"
+#include <openmax/il/khronos/v1_x/OMX_Other.h>
+
+class COmxILAudioFileSourceAPB0Port : public COmxILAudioPort
+	{
+public:
+	static COmxILAudioFileSourceAPB0Port* NewL(const TOmxILCommonPortData& aCommonPortData,
+											const RArray<OMX_AUDIO_CODINGTYPE>& aSupportedAudioFormats,
+											const COmxILFileSourceProcessingFunction& aFileSourcePF);
+	~COmxILAudioFileSourceAPB0Port();
+
+	OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const;
+	OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const;
+
+	OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex,
+								TAny* apComponentParameterStructure) const;
+	OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex,
+								const TAny* apComponentParameterStructure,
+								TBool& aUpdateProcessingFunction);
+
+private:
+	COmxILAudioFileSourceAPB0Port(const COmxILFileSourceProcessingFunction& aFileSourcePF);
+	void ConstructL(const TOmxILCommonPortData& aCommonPortData,const RArray<OMX_AUDIO_CODINGTYPE>& aSupportedAudioFormats);
+	OMX_ERRORTYPE SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition,
+											TBool& aUpdateProcessingFunction);
+	TBool IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const;
+
+private:
+	const COmxILFileSourceProcessingFunction& iFileSourcePF;
+	RBuf8 iMimeType;
+	};
+
+#endif // OMXILAUDIOFILESOURCEOPB0PORT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesource/inc/omxilfilesource.h	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,43 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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
+ * @internalTechnology
+ */
+
+#ifndef OMXILFILESOURCE_H
+#define OMXILFILESOURCE_H
+
+#include <openmax/il/common/omxilcomponent.h>
+
+class COmxILPort;
+class COmxILFileSourceProcessingFunction;
+
+NONSHARABLE_CLASS(COmxILFileSource) : public COmxILComponent
+	{
+public:
+	static void CreateComponentL(OMX_HANDLETYPE aComponent);
+	~COmxILFileSource();
+
+private:
+	COmxILFileSource();
+	void ConstructL(OMX_HANDLETYPE aComponent);
+	COmxILPort* ConstructPortL() const;
+	};
+
+#endif // OMXILFILESOURCE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesource/inc/omxilfilesource.hrh	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,35 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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 OMXILFILESOURCE_HRH_
+#define OMXILFILESOURCE_HRH_
+
+
+#define KUidNokiaOmxILAudioFileSourceDll     0x2002EAAA
+#define KUidNokiaOmxILAudioFileSource        0x2002EAAB
+
+#define KUidNokiaOmxILVideoFileSourceDll     0x2002EAAC
+#define KUidNokiaOmxILVideoFileSource        0x2002EAAD
+
+#define KUidNokiaOmxILImageFileSourceDll     0x2002EAAE
+#define KUidNokiaOmxILImageFileSource        0x2002EAAF
+
+#define KUidNokiaOmxILOtherFileSourceDll     0x2002EAB0
+#define KUidNokiaOmxILOtherFileSource        0x2002EAB1
+
+
+#endif /*OMXILFILESOURCE_HRH_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesource/inc/omxilfilesourceconfigmanager.h	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,52 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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
+ * @internalTechnology
+ */
+
+#ifndef OMXILFILESOURCECONFIGMANAGER_H
+#define OMXILFILESOURCECONFIGMANAGER_H
+
+#include <openmax/il/common/omxilconfigmanager.h>
+
+class COmxILFileSourceProcessingFunction;
+
+NONSHARABLE_CLASS(COmxILFileSourceConfigManager) : public COmxILConfigManager
+	{
+public:
+	static COmxILFileSourceConfigManager* NewL(
+			const TDesC8& aComponentName,
+			const OMX_VERSIONTYPE& aComponentVersion,
+			const RPointerArray<TDesC8>& aComponentRoleList,
+			COmxILFileSourceProcessingFunction& aFileSourcePF);
+
+	~COmxILFileSourceConfigManager();
+	
+	OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex, TAny* apComponentParameterStructure) const;
+	OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex, const TAny* apComponentParameterStructure, OMX_BOOL aInitTime = OMX_TRUE);
+	
+private:
+	COmxILFileSourceConfigManager(COmxILFileSourceProcessingFunction& aFileSourcePF);
+	void ConstructL(const TDesC8& aComponentName, const OMX_VERSIONTYPE& aComponentVersion, const RPointerArray<TDesC8>& aComponentRoleList);
+
+private:
+	COmxILFileSourceProcessingFunction& iFileSourcePF;
+	};
+
+#endif // OMXILFILESOURCECONFIGMANAGER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesource/inc/omxilfilesourceopb0port.h	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,59 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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
+ * @internalTechnology
+ */
+
+#ifndef OMXILFILESOURCEOPB0PORT_H
+#define OMXILFILESOURCEOPB0PORT_H
+
+#include <openmax/il/common/omxilotherport.h>
+#include "omxilfilesourceprocessingfunction.h"
+#include <openmax/il/khronos/v1_x/OMX_Other.h>
+
+class COmxILOtherFileSourceOPB0Port : public COmxILOtherPort
+	{
+public:
+	static COmxILOtherFileSourceOPB0Port* NewL(const TOmxILCommonPortData& aCommonPortData, 
+										const RArray<OMX_OTHER_FORMATTYPE>& aSupportedOtherFormats, 
+										const COmxILFileSourceProcessingFunction& aFileSourcePF);
+	~COmxILOtherFileSourceOPB0Port();
+	
+	OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const;
+	OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const;
+
+	OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex, 
+								TAny* apComponentParameterStructure) const;
+	OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex, 
+								const TAny* apComponentParameterStructure, 
+								TBool& aUpdateProcessingFunction);
+
+private:
+	COmxILOtherFileSourceOPB0Port(const TOmxILCommonPortData& aCommonPortData, 
+								const COmxILFileSourceProcessingFunction& aFileSourcePF);
+	void ConstructL(const RArray<OMX_OTHER_FORMATTYPE>& aSupportedOtherFormats);
+	OMX_ERRORTYPE SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, 
+											TBool& aUpdateProcessingFunction);
+	TBool IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const;
+
+private:
+	const COmxILFileSourceProcessingFunction& iFileSourcePF;
+	};
+
+#endif // OMXILFILESOURCEOPB0PORT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesource/inc/omxilfilesourceprocessingfunction.h	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,200 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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
+ * @internalTechnology
+ */
+
+#ifndef OMXILFILESOURCEPROCESSINGFUNCTION_H
+#define OMXILFILESOURCEPROCESSINGFUNCTION_H
+
+#include <openmax/il/common/omxilprocessingfunction.h>
+#include <e32base.h>
+#include <e32msgqueue.h>
+#include <f32file.h>
+#include <openmax/il/khronos/v1_x/OMX_Component.h>
+
+class COmxILFileSourceProcessingFunction : public COmxILProcessingFunction
+	{
+public:
+	static COmxILFileSourceProcessingFunction* NewL(MOmxILCallbackNotificationIf& aCallbacks);
+	~COmxILFileSourceProcessingFunction();
+
+	OMX_ERRORTYPE StateTransitionIndication(TStateIndex aNewState);
+	OMX_ERRORTYPE BufferFlushingIndication(TUint32 aPortIndex, OMX_DIRTYPE aDirection);
+	OMX_ERRORTYPE ParamIndication(OMX_INDEXTYPE aParamIndex, const TAny* apComponentParameterStructure);
+	OMX_ERRORTYPE ConfigIndication(OMX_INDEXTYPE aConfigIndex, const TAny* apComponentConfigStructure);
+	OMX_ERRORTYPE BufferIndication(OMX_BUFFERHEADERTYPE* apBufferHeader, OMX_DIRTYPE aDirection);
+	OMX_BOOL BufferRemovalIndication(OMX_BUFFERHEADERTYPE* apBufferHeader, OMX_DIRTYPE aDirection);
+	
+	MOmxILCallbackNotificationIf& GetCallbacks();
+
+	/** can return NULL if parameter has not been set. */
+	const HBufC* FileName() const;
+	const HBufC8* Uri() const;
+
+private:
+	COmxILFileSourceProcessingFunction(MOmxILCallbackNotificationIf& aCallbacks);
+	void ConstructL();
+	
+	void InitFileAndUriL();
+	OMX_ERRORTYPE SetFileName(const OMX_PARAM_CONTENTURITYPE* aContentUriType);
+			
+private:
+	RPointerArray<OMX_BUFFERHEADERTYPE> iBuffersToFill;
+	OMX_STATETYPE iState;
+	HBufC8* ipUri;
+	HBufC* ipFileName;
+
+private:
+	class CPFHelper;
+	class CBufferArrivalHandler;
+	
+	class CFileSourceAccess : public CActive
+		{
+	friend class CPFHelper;
+	public:
+		static CFileSourceAccess* NewL(COmxILFileSourceProcessingFunction& aParent);
+		~CFileSourceAccess();
+
+		// from CActive
+		void RunL();
+		void DoCancel();
+
+		TInt Execute();
+		void Pause();
+		void Stop();
+		void Idle();
+		
+		void CancelDataTransfer();
+		
+		TInt ProcessNextBuffer();
+
+	private:
+		CFileSourceAccess(COmxILFileSourceProcessingFunction& aParent);
+		void ConstructL();
+		
+	private:
+		COmxILFileSourceProcessingFunction& iParent;
+		OMX_BUFFERHEADERTYPE* iCurrentBuffer;
+		
+		RFs iFs;
+		RFile iFileHandle;
+		TInt iBufferOffset;
+		TPtr8 iReadBuffer;
+		TBool iEOSFlag; // Notifies that end of file has been reached.
+		TInt iEOSBufferNotificationCount; // counts the number of responses to buffer notification when URI is unspecified
+		
+		} *ipFileSourceAccess;
+
+	class CPFHelper : public CActive
+		{
+	public:
+		static CPFHelper* NewL(COmxILFileSourceProcessingFunction& aParent, CFileSourceAccess& aFileSourceAccess, CBufferArrivalHandler& aBufferArrivalHandler);
+		~CPFHelper();
+		
+		static OMX_ERRORTYPE ConvertSymbianErrorType(TInt aError);
+
+		// from CActive
+		void RunL();
+		void DoCancel();
+
+		TInt ExecuteAsync();
+		TInt StopAsync();
+		TInt PauseAsync();
+		void StopSync();
+		TInt IdleAsync();
+		TInt FlushIndication();
+		OMX_BOOL RemoveBufferIndication(OMX_BUFFERHEADERTYPE* apBufferHeader);
+
+		enum TMessageType 
+			{
+			EExecuteCommand,
+			EStopCommand,
+			EPauseCommand,
+			ECancelCommand,
+			EIdleCommand,
+			EFlushCommand,
+			ERemoveBufferCommand
+			};
+
+		class TProcMessage
+			{
+		public:
+			TMessageType iType;
+			TAny* iPtr;
+			};
+		
+		class TBufferRemovalArgs
+		    {
+		public:
+		    OMX_BUFFERHEADERTYPE* ipHeader; // Input parameter. Not owned
+		    OMX_BOOL* iHdrRemoved; // Return parameter. Not owned
+		    };
+				
+		RMsgQueue<TProcMessage> iMsgQueue;
+	
+	private:
+		CPFHelper(COmxILFileSourceProcessingFunction& aParent, CFileSourceAccess& aFileSourceAccess,CBufferArrivalHandler& aBufferArrivalHandler);
+		void ConstructL();
+		
+		TInt ProcessQueue();
+		void PerformFlush();
+		OMX_BOOL PerformBufferRemoval(OMX_BUFFERHEADERTYPE* apBufferHeader);
+
+	private:
+		COmxILFileSourceProcessingFunction& iParent;
+		CFileSourceAccess& iFileSourceAccess;
+		CBufferArrivalHandler& iBufferArrivalHandler;
+	    RThread iRunLContext;
+	    RSemaphore iWaitSemaphore;
+		} *ipPFHelper;
+		
+    class CBufferArrivalHandler : public CActive
+        {
+    public:
+        static CBufferArrivalHandler* NewL(COmxILFileSourceProcessingFunction& aParent, CFileSourceAccess& aFileSourceAccess);
+        ~CBufferArrivalHandler();        
+        
+        TInt BufferIndication(OMX_BUFFERHEADERTYPE* apBufferHeader);
+        void FlushIndication();
+        OMX_BOOL RemoveBufferIndication(OMX_BUFFERHEADERTYPE* apBufferHeader);
+    
+        // CActive
+        void RunL();
+        void DoCancel();
+        
+    private:
+        CBufferArrivalHandler(COmxILFileSourceProcessingFunction& aParent, CFileSourceAccess& aFileSourceAccess);
+        void ConstructL();
+        
+    private:    
+		class TBufferIndicationMessage
+            {
+        public:
+            OMX_BUFFERHEADERTYPE* iBufferHdr; // Not owned
+            };
+		
+        RMsgQueue<TBufferIndicationMessage> iMsgQueue; 
+        COmxILFileSourceProcessingFunction& iParent;
+        CFileSourceAccess& iFileSourceAccess;
+        } *ipBufferArrivalHandler;
+	};
+
+#endif // OMXILFILESOURCEPROCESSINGFUNCTION_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesource/inc/omxilimagefilesourceipb0port.h	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,64 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ * @file
+ * @internalTechnology
+ */
+
+#ifndef OMXILIMAGEFILESOURCEOPB0PORT_H
+#define OMXILIMAGEFILESOURCEOPB0PORT_H
+
+#include <openmax/il/common/omxilimageport.h>
+#include "omxilfilesourceprocessingfunction.h"
+#include <openmax/il/khronos/v1_x/OMX_Other.h>
+
+class COmxILImageFileSourceIPB0Port : public COmxILImagePort
+	{
+public:
+	static COmxILImageFileSourceIPB0Port* NewL(const TOmxILCommonPortData& aCommonPortData,
+	                                         const RArray<OMX_IMAGE_CODINGTYPE>& aSupportedImageFormats,
+	                                         const RArray<OMX_COLOR_FORMATTYPE>& aSupportedColorFormats,
+	                                         const COmxILFileSourceProcessingFunction& aFileSourcePF);
+
+	~COmxILImageFileSourceIPB0Port();
+
+	OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const;
+	OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const;
+
+	OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex,
+								TAny* apComponentParameterStructure) const;
+	OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex,
+								const TAny* apComponentParameterStructure,
+								TBool& aUpdateProcessingFunction);
+
+private:
+	COmxILImageFileSourceIPB0Port(const COmxILFileSourceProcessingFunction& aFileSourcePF);
+	void ConstructL(const TOmxILCommonPortData& aCommonPortData,
+                    const RArray<OMX_IMAGE_CODINGTYPE>& aSupportedImageFormats,
+                    const RArray<OMX_COLOR_FORMATTYPE>& aSupportedColorFormats);
+	
+	OMX_ERRORTYPE SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition,
+											TBool& aUpdateProcessingFunction);
+	TBool IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const;
+
+private:
+	const COmxILFileSourceProcessingFunction& iFileSourcePF;
+	RBuf8 iMimeType;
+	};
+
+#endif // OMXILIMAGEFILESOURCEOPB0PORT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesource/inc/omxilotherfilesourceopb0port.h	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,59 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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
+ * @internalTechnology
+ */
+
+#ifndef OMXILFILESOURCEOPB0PORT_H
+#define OMXILFILESOURCEOPB0PORT_H
+
+#include <openmax/il/common/omxilotherport.h>
+#include "omxilfilesourceprocessingfunction.h"
+#include <openmax/il/khronos/v1_x/OMX_Other.h>
+
+class COmxILOtherFileSourceOPB0Port : public COmxILOtherPort
+	{
+public:
+	static COmxILOtherFileSourceOPB0Port* NewL(const TOmxILCommonPortData& aCommonPortData, 
+										const RArray<OMX_OTHER_FORMATTYPE>& aSupportedOtherFormats, 
+										const COmxILFileSourceProcessingFunction& aFileSourcePF);
+	~COmxILOtherFileSourceOPB0Port();
+	
+	OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const;
+	OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const;
+
+	OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex, 
+								TAny* apComponentParameterStructure) const;
+	OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex, 
+								const TAny* apComponentParameterStructure, 
+								TBool& aUpdateProcessingFunction);
+
+	
+private:
+	COmxILOtherFileSourceOPB0Port(const COmxILFileSourceProcessingFunction& aFileSourcePF);
+	void ConstructL(const TOmxILCommonPortData& aCommonPortData, const RArray<OMX_OTHER_FORMATTYPE>& aSupportedOtherFormats);
+	OMX_ERRORTYPE SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, 
+											TBool& aUpdateProcessingFunction);
+	TBool IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const;
+
+private:
+	const COmxILFileSourceProcessingFunction& iFileSourcePF;
+	};
+
+#endif // OMXILFILESOURCEOPB0PORT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesource/inc/omxilvideofilesourcevpb0port.h	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,63 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ * @file
+ * @internalTechnology
+ */
+
+#ifndef OMXILVIDEOFILESOURCEOPB0PORT_H
+#define OMXILVIDEOFILESOURCEOPB0PORT_H
+
+#include <openmax/il/common/omxilvideoport.h>
+#include "omxilfilesourceprocessingfunction.h"
+#include <openmax/il/khronos/v1_x/OMX_Other.h>
+
+class COmxILVideoFileSourceVPB0Port : public COmxILVideoPort
+	{
+public:
+	static COmxILVideoFileSourceVPB0Port* NewL(const TOmxILCommonPortData& aCommonPortData,
+	                                         const RArray<OMX_VIDEO_CODINGTYPE>& aSupportedCodings,
+	                                         const RArray<OMX_COLOR_FORMATTYPE>& aSupportedColourFormats,
+	                                         const COmxILFileSourceProcessingFunction& aFileSourcePF);
+
+	~COmxILVideoFileSourceVPB0Port();
+
+	OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const;
+	OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const;
+
+	OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex,
+								TAny* apComponentParameterStructure) const;
+	OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex,
+								const TAny* apComponentParameterStructure,
+								TBool& aUpdateProcessingFunction);
+
+private:
+	COmxILVideoFileSourceVPB0Port(const COmxILFileSourceProcessingFunction& aFileSourcePF);
+	void ConstructL(const TOmxILCommonPortData& aCommonPortData,
+                    const RArray<OMX_VIDEO_CODINGTYPE>& aSupportedCodings,
+                    const RArray<OMX_COLOR_FORMATTYPE>& aSupportedColourFormats);
+	OMX_ERRORTYPE SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition,
+											TBool& aUpdateProcessingFunction);
+	TBool IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const;
+
+private:
+	const COmxILFileSourceProcessingFunction& iFileSourcePF;
+	RBuf8 iMimeType;
+	};
+
+#endif // OMXILVIDEOFILESOURCEOPB0PORT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesource/mmpfiles/omxilaudiofilesource.mmp	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,48 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+// This macro is required to enable domain specific code
+MACRO OMXIL_AUDIO_FILESOURCE
+
+
+#include 				"../inc/omxilfilesource.hrh"
+
+TARGET		  			omxilaudiofilesource.dll
+CAPABILITY	  			ALL -TCB
+TARGETTYPE	  			PLUGIN
+UID           			0x10009D8D KUidNokiaOmxILAudioFileSourceDll
+VENDORID                0x70000001
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+OS_LAYER_ESTLIB_SYSTEMINCLUDE
+
+USERINCLUDE	 			../inc
+
+SOURCEPATH	  			../src
+
+SOURCE		  			omxilfilesource.cpp
+SOURCE		  			omxilfilesourceprocessingfunction.cpp
+SOURCE		  			omxilfilesourceconfigmanager.cpp 
+SOURCE		  			omxilaudiofilesourceapb0port.cpp
+
+RESOURCE				omxilaudiofilesource.rss
+
+LIBRARY		 			euser.lib
+LIBRARY		 			efsrv.lib
+LIBRARY		 			inetprotutil.lib
+LIBRARY		 			ecom.lib
+LIBRARY					estlib.lib
+LIBRARY         		omxilcomponentcommon.lib
+STATICLIBRARY			omxilcomponentif.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesource/mmpfiles/omxilimagefilesource.mmp	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,48 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+// This macro is required to enable domain specific code
+MACRO OMXIL_IMAGE_FILESOURCE
+
+
+#include 				"../inc/omxilfilesource.hrh"
+
+TARGET		  			omxilimagefilesource.dll
+CAPABILITY	  			ALL -TCB
+TARGETTYPE	  			PLUGIN
+UID           			0x10009D8D KUidNokiaOmxILImageFileSourceDll
+VENDORID                0x70000001
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+OS_LAYER_ESTLIB_SYSTEMINCLUDE
+
+USERINCLUDE	 			../inc
+
+SOURCEPATH	  			../src
+
+SOURCE		  			omxilfilesource.cpp
+SOURCE		  			omxilfilesourceprocessingfunction.cpp
+SOURCE		  			omxilfilesourceconfigmanager.cpp 
+SOURCE		  			omxilimagefilesourceipb0port.cpp
+
+RESOURCE				omxilimagefilesource.rss
+
+LIBRARY		 			euser.lib
+LIBRARY		 			efsrv.lib
+LIBRARY		 			inetprotutil.lib
+LIBRARY		 			ecom.lib
+LIBRARY					estlib.lib
+LIBRARY         		omxilcomponentcommon.lib
+STATICLIBRARY			omxilcomponentif.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesource/mmpfiles/omxilotherfilesource.mmp	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,49 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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 macro is required to enable domain specific code
+MACRO OMXIL_OTHER_FILESOURCE
+
+
+#include 				"../inc/omxilfilesource.hrh"
+
+TARGET		  			omxilotherfilesource.dll
+CAPABILITY	  			ALL -TCB
+TARGETTYPE	  			PLUGIN
+UID           			0x10009D8D KUidNokiaOmxILOtherFileSourceDll
+VENDORID                0x70000001
+
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+OS_LAYER_ESTLIB_SYSTEMINCLUDE
+
+USERINCLUDE	 			../inc
+
+SOURCEPATH	  			../src
+
+SOURCE		  			omxilfilesource.cpp
+SOURCE		  			omxilfilesourceprocessingfunction.cpp
+SOURCE		  			omxilfilesourceconfigmanager.cpp 
+SOURCE		  			omxilotherfilesourceopb0port.cpp
+
+RESOURCE				omxilotherfilesource.rss
+
+LIBRARY		 			euser.lib
+LIBRARY		 			efsrv.lib
+LIBRARY		 			inetprotutil.lib
+LIBRARY		 			ecom.lib
+LIBRARY					estlib.lib
+LIBRARY         		omxilcomponentcommon.lib
+STATICLIBRARY			omxilcomponentif.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesource/mmpfiles/omxilvideofilesource.mmp	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,48 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+// This macro is required to enable domain specific code
+MACRO OMXIL_VIDEO_FILESOURCE
+
+
+#include 				"../inc/omxilfilesource.hrh"
+
+TARGET		  			omxilvideofilesource.dll
+CAPABILITY	  			ALL -TCB
+TARGETTYPE	  			PLUGIN
+UID           		0x10009D8D KUidNokiaOmxILVideoFileSourceDll
+VENDORID                0x70000001
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+OS_LAYER_ESTLIB_SYSTEMINCLUDE
+
+USERINCLUDE	 			../inc
+
+SOURCEPATH	  			../src
+
+SOURCE		  			omxilfilesource.cpp
+SOURCE		  			omxilfilesourceprocessingfunction.cpp
+SOURCE		  			omxilfilesourceconfigmanager.cpp
+SOURCE		  			omxilvideofilesourcevpb0port.cpp
+
+RESOURCE				omxilvideofilesource.rss
+
+LIBRARY		 			euser.lib
+LIBRARY		 			efsrv.lib
+LIBRARY		 			inetprotutil.lib
+LIBRARY		 			ecom.lib
+LIBRARY					estlib.lib
+LIBRARY         			omxilcomponentcommon.lib
+STATICLIBRARY				omxilcomponentif.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesource/src/omxilaudiofilesource.rss	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,43 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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 <ecom/registryinfo.rh>
+#include <openmax/il/loader/omxilcomponentif.hrh>
+#include "omxilfilesource.hrh"
+
+RESOURCE REGISTRY_INFO theInfo
+	{
+	dll_uid = KUidNokiaOmxILAudioFileSourceDll;
+	interfaces =
+		{
+		INTERFACE_INFO
+			{
+			interface_uid = KUidOmxILSymbianComponentIf;
+			implementations =
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid = KUidNokiaOmxILAudioFileSource;
+					version_no = 1;
+					display_name = "OMX.NOKIA.AUDIO.FILESOURCE";
+					default_data = "audio_reader.binary";
+					}
+				};
+			}
+		};
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesource/src/omxilaudiofilesourceapb0port.cpp	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,126 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+#include "omxilaudiofilesourceapb0port.h"
+#include "omxilfilesourceprocessingfunction.h"
+#include <string.h>
+#include <uri8.h>
+
+
+COmxILAudioFileSourceAPB0Port* COmxILAudioFileSourceAPB0Port::NewL(const TOmxILCommonPortData& aCommonPortData,
+													 const RArray<OMX_AUDIO_CODINGTYPE>& aSupportedAudioFormats,
+													 const COmxILFileSourceProcessingFunction& aFileSourcePF)
+	{
+	COmxILAudioFileSourceAPB0Port* self = new (ELeave) COmxILAudioFileSourceAPB0Port(aFileSourcePF);
+	CleanupStack::PushL(self);
+	self->ConstructL(aCommonPortData, aSupportedAudioFormats);
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+void COmxILAudioFileSourceAPB0Port::ConstructL(const TOmxILCommonPortData& aCommonPortData, const RArray<OMX_AUDIO_CODINGTYPE>& aSupportedAudioFormats)
+	{
+    // base
+    COmxILAudioPort::ConstructL(aCommonPortData, aSupportedAudioFormats);
+	GetParamPortDefinition().eDomain = OMX_PortDomainAudio;	
+	}
+
+COmxILAudioFileSourceAPB0Port::COmxILAudioFileSourceAPB0Port(const COmxILFileSourceProcessingFunction& aFileSourcePF)
+	: iFileSourcePF(aFileSourcePF)
+	{
+	}
+
+COmxILAudioFileSourceAPB0Port::~COmxILAudioFileSourceAPB0Port()
+	{
+	iMimeType.Close();
+	CleanUpPort();
+	}
+
+OMX_ERRORTYPE COmxILAudioFileSourceAPB0Port::GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const
+	{
+	return COmxILAudioPort::GetLocalOmxParamIndexes(aIndexArray);
+	}
+
+OMX_ERRORTYPE COmxILAudioFileSourceAPB0Port::GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const
+	{
+	return COmxILAudioPort::GetLocalOmxConfigIndexes(aIndexArray);
+	}
+
+OMX_ERRORTYPE COmxILAudioFileSourceAPB0Port::GetParameter(OMX_INDEXTYPE aParamIndex,
+														TAny* apComponentParameterStructure) const
+	{
+	return COmxILAudioPort::GetParameter(aParamIndex, apComponentParameterStructure);
+	}
+
+OMX_ERRORTYPE COmxILAudioFileSourceAPB0Port::SetParameter(OMX_INDEXTYPE aParamIndex,
+														const TAny* apComponentParameterStructure,
+														TBool& aUpdateProcessingFunction)
+	{
+	return COmxILAudioPort::SetParameter(aParamIndex,
+										 apComponentParameterStructure,
+										 aUpdateProcessingFunction);
+	}
+
+OMX_ERRORTYPE COmxILAudioFileSourceAPB0Port::SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition,
+																TBool& /*aUpdateProcessingFunction*/)
+	{
+	OMX_ERRORTYPE omxErr = OMX_ErrorNone;
+    if (aPortDefinition.format.audio.eEncoding == OMX_AUDIO_CodingUnused)
+        {
+        OMX_STRING ptempMIMEType = GetParamPortDefinition().format.audio.cMIMEType;
+        GetParamPortDefinition().format.audio = aPortDefinition.format.audio;
+        GetParamPortDefinition().format.audio.cMIMEType = ptempMIMEType;
+        
+        if(aPortDefinition.format.audio.cMIMEType)
+            {
+            TInt len= strlen (aPortDefinition.format.audio.cMIMEType);
+            if(len > 0)
+                {
+                TPtrC8 mimetype(reinterpret_cast<const TUint8 *>(aPortDefinition.format.audio.cMIMEType), len +1 );
+                HBufC8 *pHBuf = mimetype.Alloc();
+                if(pHBuf != NULL )
+                    {
+                    iMimeType.Close();
+                    iMimeType.Assign(pHBuf );
+                    TUint8* pTempBuff = const_cast<TUint8*>(iMimeType.PtrZ() );
+                    GetParamPortDefinition().format.audio.cMIMEType = reinterpret_cast<OMX_STRING>(pTempBuff );
+                    }
+                }
+            }
+        }
+    else
+        {
+        omxErr = OMX_ErrorUnsupportedSetting;
+        }
+	    
+	    return omxErr;
+	}
+
+TBool COmxILAudioFileSourceAPB0Port::IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const
+	{
+	
+	if(aPortDefinition.eDomain != GetParamPortDefinition().eDomain)
+	    {
+	    return EFalse;
+	    }
+
+	if (aPortDefinition.format.audio.eEncoding == OMX_AUDIO_CodingMax)
+        {
+        return EFalse;
+        }
+	
+	return ETrue;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesource/src/omxilfilesource.cpp	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,282 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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 <openmax/il/common/omxilport.h>
+#include <openmax/il/common/omxilspecversion.h>
+#include <openmax/il/loader/omxilsymbiancomponentif.h>
+
+#include "omxilfilesource.h"
+#include "omxilotherfilesourceopb0port.h"
+#include "omxilfilesourceprocessingfunction.h"
+#include "omxilfilesourceconfigmanager.h"
+#include "omxilfilesource.hrh"
+
+#ifdef OMXIL_AUDIO_FILESOURCE
+#include "omxilaudiofilesourceapb0port.h"
+_LIT8(KNokiaOMXFileSourceComponentName, "OMX.NOKIA.AUDIO.FILESOURCE");
+_LIT8(KNokiaOMXFileSourceRole, "audio_reader.binary");
+OMXIL_COMPONENT_ECOM_ENTRYPOINT(KUidNokiaOmxILAudioFileSource);
+
+#elif defined(OMXIL_VIDEO_FILESOURCE)
+#include "omxilvideofilesourcevpb0port.h"
+_LIT8(KNokiaOMXFileSourceComponentName, "OMX.NOKIA.VIDEO.FILESOURCE");
+_LIT8(KNokiaOMXFileSourceRole, "video_reader.binary");
+OMXIL_COMPONENT_ECOM_ENTRYPOINT(KUidNokiaOmxILVideoFileSource);
+
+#elif defined(OMXIL_IMAGE_FILESOURCE)
+#include "omxilimagefilesourceipb0port.h"
+_LIT8(KNokiaOMXFileSourceComponentName, "OMX.NOKIA.IMAGE.FILESOURCE");
+_LIT8(KNokiaOMXFileSourceRole, "image_reader.binary");
+OMXIL_COMPONENT_ECOM_ENTRYPOINT(KUidNokiaOmxILImageFileSource);
+
+#elif defined(OMXIL_OTHER_FILESOURCE)
+#include "omxilotherfilesourceopb0port.h"
+_LIT8(KNokiaOMXFileSourceComponentName, "OMX.NOKIA.OTHER.FILESOURCE");
+_LIT8(KNokiaOMXFileSourceRole, "other_reader.binary");
+OMXIL_COMPONENT_ECOM_ENTRYPOINT(KUidNokiaOmxILOtherFileSource);
+
+#endif
+
+const TUint8 KComponentVersionMajor = 1;
+const TUint8 KComponentVersionMinor = 1;
+const TUint8 KComponentVersionRevision = 0;
+const TUint8 KComponentVersionStep = 0;
+
+static const TInt KMinBuffers = 1;
+static const TInt KMinBufferSize = 15360;
+
+
+// Component Entry Point
+OMX_ERRORTYPE OMX_ComponentInit(OMX_HANDLETYPE aComponent)
+	{
+	TRAPD(err, COmxILFileSource::CreateComponentL(aComponent));
+	if (err == KErrNone)
+		{
+		return OMX_ErrorNone;
+		}
+	else
+		{
+		return err == KErrNoMemory ? OMX_ErrorInsufficientResources : OMX_ErrorUndefined;
+		}
+	}
+
+void COmxILFileSource::CreateComponentL(OMX_HANDLETYPE aComponent)
+	{
+	COmxILFileSource* self = new (ELeave) COmxILFileSource();
+	CleanupStack::PushL(self);
+	self->ConstructL(aComponent);
+	CleanupStack::Pop(self);
+	}
+
+COmxILFileSource::COmxILFileSource()
+	{
+	// nothing to do
+	}
+
+COmxILFileSource::~COmxILFileSource()
+	{
+	}
+
+void COmxILFileSource::ConstructL(OMX_HANDLETYPE aComponent)
+	{
+    // STEP 1: Initialize the data received from the IL Core
+    COmxILComponent::ConstructL(aComponent);
+    
+    // STEP 2: Create the call backs manager...
+    MOmxILCallbackNotificationIf* callbackNotificationIf=CreateCallbackManagerL(COmxILComponent::EOutofContext);
+
+	// STEP 3: Create the file source-specific Processing Function...
+    COmxILFileSourceProcessingFunction* pProcessingFunction = COmxILFileSourceProcessingFunction::NewL(*callbackNotificationIf);
+    RegisterProcessingFunction(pProcessingFunction);
+    
+	// STEP 4: Create Port manager...
+
+#ifdef OMXIL_AUDIO_FILESOURCE
+    CreatePortManagerL(COmxILComponent::ENonBufferSharingPortManager,
+        TOmxILSpecVersion(),    // OMX Version
+        1,                      // The number of audio ports in this component
+        0,                      // The starting audio port index
+        0,                      // The number of image ports in this component
+        0,                      // The starting image port index
+        0,                      // The number of video ports in this component
+        0,                      // The starting video port index
+        0,                      // The number of other ports in this component
+        0                       // The starting other port index
+        );
+
+#elif defined(OMXIL_VIDEO_FILESOURCE)
+    CreatePortManagerL(COmxILComponent::ENonBufferSharingPortManager,
+        TOmxILSpecVersion(),    // OMX Version
+        0,                      // The number of audio ports in this component
+        0,                      // The starting audio port index
+        0,                      // The number of image ports in this component
+        0,                      // The starting image port index
+        1,                      // The number of video ports in this component
+        0,                      // The starting video port index
+        0,                      // The number of other ports in this component
+        0                       // The starting other port index
+        );
+
+#elif defined(OMXIL_IMAGE_FILESOURCE)
+    CreatePortManagerL(COmxILComponent::ENonBufferSharingPortManager,
+        TOmxILSpecVersion(),    // OMX Version
+        0,                      // The number of audio ports in this component
+        0,                      // The starting audio port index
+        1,                      // The number of image ports in this component
+        0,                      // The starting image port index
+        0,                      // The number of video ports in this component
+        0,                      // The starting video port index
+        0,                      // The number of other ports in this component
+        0                       // The starting other port index
+        );
+
+
+#elif defined(OMXIL_OTHER_FILESOURCE)
+    CreatePortManagerL(COmxILComponent::ENonBufferSharingPortManager,
+        TOmxILSpecVersion(),    // OMX Version
+        0,                      // The number of audio ports in this component
+        0,                      // The starting audio port index
+        0,                      // The number of image ports in this component
+        0,                      // The starting image port index
+        0,                      // The number of video ports in this component
+        0,                      // The starting video port index
+        1,                      // The number of other ports in this component
+        0                       // The starting other port index
+        );
+#endif
+
+	// STEP 5: Create the File Source component port...
+    COmxILPort* pPort = ConstructPortL();
+    CleanupStack::PushL(pPort);
+    
+	// STEP 6: Add to the port manager...
+	User::LeaveIfError(AddPort(pPort, OMX_DirOutput));
+	CleanupStack::Pop(); //pPort
+	
+	// STEP 7: Create the non-port related configuration manager...
+	RPointerArray<TDesC8> componentRoles;
+	CleanupClosePushL(componentRoles);
+	componentRoles.AppendL(&KNokiaOMXFileSourceRole);
+	COmxILFileSourceConfigManager* pConfigManager = COmxILFileSourceConfigManager::NewL(
+                                    KNokiaOMXFileSourceComponentName,
+                                    TOmxILVersion(KComponentVersionMajor,
+                                                  KComponentVersionMinor,
+                                                  KComponentVersionRevision,
+                                                  KComponentVersionStep),
+                                    componentRoles,
+                                    *pProcessingFunction);
+    RegisterConfigurationManager(pConfigManager);
+	CleanupStack::PopAndDestroy(&componentRoles);
+
+	// STEP 8: Finally, let's get everything started
+	InitComponentL();
+	}
+
+COmxILPort* COmxILFileSource::ConstructPortL() const
+	{
+	OMX_U32 thisPortIndex = 0;
+#ifdef OMXIL_AUDIO_FILESOURCE
+	RArray<OMX_AUDIO_CODINGTYPE> supportedAudioFormats;
+	CleanupClosePushL(supportedAudioFormats);
+	supportedAudioFormats.AppendL(OMX_AUDIO_CodingUnused);
+	COmxILAudioFileSourceAPB0Port* opb0Port = COmxILAudioFileSourceAPB0Port::NewL(
+			TOmxILCommonPortData (
+			TOmxILSpecVersion(),	// OMX specification version information
+			thisPortIndex, 			// Port number the structure applies to
+			OMX_DirOutput, 			// Direction of this port
+			KMinBuffers,			// The minimum number of buffers this port requires
+			KMinBufferSize,			// Minimum size, in bytes, for buffers to be used for this port
+			OMX_PortDomainAudio,	// Domain of the port
+			OMX_FALSE,				// Buffers contiguous requirement (true or false)
+			0,		                 // Buffer aligment requirements
+			OMX_BufferSupplyUnspecified,	// supplier preference when tunneling between two ports
+			COmxILPort::KBufferMarkPropagationPortNotNeeded),
+			supportedAudioFormats,
+			static_cast<COmxILFileSourceProcessingFunction&>(*GetProcessingFunction()));
+	CleanupStack::PopAndDestroy(&supportedAudioFormats);
+	return opb0Port;
+#elif defined(OMXIL_VIDEO_FILESOURCE)
+    RArray<OMX_VIDEO_CODINGTYPE> supportedVideoFormats;
+    CleanupClosePushL(supportedVideoFormats);
+    RArray<OMX_COLOR_FORMATTYPE> supportedColourFormats;
+    CleanupClosePushL(supportedColourFormats);
+    COmxILVideoFileSourceVPB0Port* opb0Port = COmxILVideoFileSourceVPB0Port::NewL(
+            TOmxILCommonPortData (
+            TOmxILSpecVersion(),    // OMX specification version information
+            thisPortIndex,          // Port number the structure applies to
+            OMX_DirOutput,           // Direction of this port
+            KMinBuffers,            // The minimum number of buffers this port requires
+            KMinBufferSize,         // Minimum size, in bytes, for buffers to be used for this port
+            OMX_PortDomainVideo,    // Domain of the port
+            OMX_FALSE,//OMX_TRUE,               // Buffers contiguous requirement (true or false)
+            0,//KBufferAlignment,       // Buffer aligment requirements
+            OMX_BufferSupplyUnspecified, // supplier preference when tunneling between two ports
+            COmxILPort::KBufferMarkPropagationPortNotNeeded),
+            supportedVideoFormats,
+            supportedColourFormats,
+            static_cast<COmxILFileSourceProcessingFunction&>(*GetProcessingFunction()));
+    CleanupStack::PopAndDestroy(2);
+    return opb0Port;
+#elif defined(OMXIL_IMAGE_FILESOURCE)
+
+    RArray<OMX_IMAGE_CODINGTYPE> supportedImageFormats;
+     CleanupClosePushL(supportedImageFormats);
+     RArray<OMX_COLOR_FORMATTYPE> supportedColourFormats;
+     CleanupClosePushL(supportedColourFormats);
+     COmxILImageFileSourceIPB0Port* opb0Port = COmxILImageFileSourceIPB0Port::NewL(
+             TOmxILCommonPortData (
+             TOmxILSpecVersion(),    // OMX specification version information
+             thisPortIndex,          // Port number the structure applies to
+             OMX_DirOutput,           // Direction of this port
+             KMinBuffers,            // The minimum number of buffers this port requires
+             KMinBufferSize,         // Minimum size, in bytes, for buffers to be used for this port
+             OMX_PortDomainImage,    // Domain of the port
+             OMX_FALSE,              // Buffers contiguous requirement (true or false)
+             0,                      // Buffer aligment requirements
+             OMX_BufferSupplyUnspecified, // supplier preference when tunneling between two ports
+             COmxILPort::KBufferMarkPropagationPortNotNeeded),
+             supportedImageFormats,
+             supportedColourFormats,
+             static_cast<COmxILFileSourceProcessingFunction&>(*GetProcessingFunction()));
+     CleanupStack::PopAndDestroy(2);
+     return opb0Port;
+
+#elif defined(OMXIL_OTHER_FILESOURCE)
+	RArray<OMX_OTHER_FORMATTYPE> supportedOtherFormats;
+
+	CleanupClosePushL(supportedOtherFormats);
+	supportedOtherFormats.AppendL(OMX_OTHER_FormatBinary);
+
+	COmxILOtherFileSourceOPB0Port* opb0Port = COmxILOtherFileSourceOPB0Port::NewL(
+			TOmxILCommonPortData (
+			TOmxILSpecVersion(),	// OMX specification version information
+			thisPortIndex, 			// Port number the structure applies to
+			OMX_DirOutput, 			// Direction of this port
+			KMinBuffers,			// The minimum number of buffers this port requires
+			KMinBufferSize,			// Minimum size, in bytes, for buffers to be used for this port
+			OMX_PortDomainOther,	// Domain of the port
+			OMX_FALSE,				// Buffers contiguous requirement (true or false)
+			0,		                 // Buffer aligment requirements
+			OMX_BufferSupplyUnspecified,	// supplier preference when tunneling between two ports
+			COmxILPort::KBufferMarkPropagationPortNotNeeded),
+			supportedOtherFormats,
+			static_cast<COmxILFileSourceProcessingFunction&>(*GetProcessingFunction()));
+
+	CleanupStack::PopAndDestroy(&supportedOtherFormats);
+	return opb0Port;
+#endif
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesource/src/omxilfilesourceconfigmanager.cpp	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,130 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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
+ * @internalTechnology
+ */
+
+#include "omxilfilesourceconfigmanager.h"
+#include "omxilfilesourceprocessingfunction.h"
+#include <openmax/il/common/omxilspecversion.h>
+
+COmxILFileSourceConfigManager* COmxILFileSourceConfigManager::NewL(
+                                        const TDesC8& aComponentName,
+                                        const OMX_VERSIONTYPE& aComponentVersion,
+                                        const RPointerArray<TDesC8>& aComponentRoleList,
+                                        COmxILFileSourceProcessingFunction& aFileSourcePF)
+	{
+	COmxILFileSourceConfigManager* self = new(ELeave) COmxILFileSourceConfigManager(aFileSourcePF);
+	CleanupStack::PushL(self);
+	self->ConstructL(aComponentName, aComponentVersion, aComponentRoleList);
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+COmxILFileSourceConfigManager::COmxILFileSourceConfigManager(COmxILFileSourceProcessingFunction& aFileSourcePF)
+	:iFileSourcePF(aFileSourcePF)
+	{
+	}
+
+void COmxILFileSourceConfigManager::ConstructL(
+                                    const TDesC8& aComponentName,
+                                    const OMX_VERSIONTYPE& aComponentVersion,
+                                    const RPointerArray<TDesC8>& aComponentRoleList)
+	{
+	COmxILConfigManager::ConstructL(aComponentName, aComponentVersion, aComponentRoleList);
+	
+	InsertParamIndexL(OMX_IndexParamContentURI);
+	}
+
+COmxILFileSourceConfigManager::~COmxILFileSourceConfigManager()
+	{
+	}
+
+OMX_ERRORTYPE COmxILFileSourceConfigManager::GetParameter(OMX_INDEXTYPE aParamIndex, TAny* aPtr) const
+	{
+	TInt index = FindParamIndex(aParamIndex);
+	if (KErrNotFound == index)
+		{
+		return OMX_ErrorUnsupportedIndex;
+		}
+		
+	switch (aParamIndex)
+		{
+		case OMX_IndexParamContentURI:
+			{			
+			OMX_PARAM_CONTENTURITYPE* param = reinterpret_cast<OMX_PARAM_CONTENTURITYPE*>(aPtr);
+			const HBufC8* uriData = iFileSourcePF.Uri();
+			if (!uriData)
+				{
+				return OMX_ErrorNotReady;
+				}
+			
+			const OMX_PARAM_CONTENTURITYPE* uri = reinterpret_cast<const OMX_PARAM_CONTENTURITYPE*>(uriData->Ptr());
+			if (uri->nSize > param->nSize)
+				{
+				return OMX_ErrorBadParameter;
+				}
+			
+			// The client's structure is guaranteed to be big enough.
+			Mem::Copy(param, uri, uri->nSize);            
+			}
+			break;
+			
+		default:
+			{
+			return COmxILConfigManager::GetParameter(aParamIndex, aPtr);
+			}
+		}
+
+	return OMX_ErrorNone;
+	}
+
+OMX_ERRORTYPE COmxILFileSourceConfigManager::SetParameter(OMX_INDEXTYPE aParamIndex, const TAny* aPtr, OMX_BOOL aInitTime)
+	{
+	TInt index = FindParamIndex(aParamIndex);
+	if (KErrNotFound == index)
+		{
+		return OMX_ErrorUnsupportedIndex;
+		}
+
+	OMX_ERRORTYPE omxErr = OMX_ErrorNone;
+	
+	switch (aParamIndex)
+		{
+		case OMX_IndexParamContentURI:
+		    {
+            if(aInitTime == OMX_TRUE)
+                {
+                omxErr = iFileSourcePF.ParamIndication(aParamIndex, aPtr);
+                }
+            else
+                {
+                omxErr = OMX_ErrorUndefined;
+                }
+            break;
+			}
+		default:
+			{
+			omxErr = COmxILConfigManager::SetParameter(aParamIndex, aPtr, aInitTime);
+			break;
+			}
+		}
+
+	return omxErr;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesource/src/omxilfilesourceprocessingfunction.cpp	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,892 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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
+ * @internalTechnology
+ */
+
+#include <uri8.h>
+#include <openmax/il/common/omxilcallbacknotificationif.h>
+#include "omxilfilesourceprocessingfunction.h"
+
+const TInt KMaxMsgQueueEntries = 25;
+// This represents the number of times this component will respond to a client when the file handle is invalid
+// (e.g a URI is not specified) before sending a OMX_BUFFERFLAG_EOS notification flag. This is to prevent
+// the endless buffer passing. 250 is chosen as it is more than the number of buffers passed by Khronos conformance
+// suite during port communication test.
+const TInt KMaxBuffersWhenNoFileName =250; 
+const TInt KBufferSizeReturnedWhenNoFileName = 2;
+
+COmxILFileSourceProcessingFunction* COmxILFileSourceProcessingFunction::NewL(MOmxILCallbackNotificationIf& aCallbacks)
+	{
+	COmxILFileSourceProcessingFunction* self = new (ELeave) COmxILFileSourceProcessingFunction(aCallbacks);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+COmxILFileSourceProcessingFunction::COmxILFileSourceProcessingFunction(MOmxILCallbackNotificationIf& aCallbacks)
+: COmxILProcessingFunction(aCallbacks)
+	{
+	}
+
+void COmxILFileSourceProcessingFunction::ConstructL()
+	{
+	iState = OMX_StateLoaded;
+	ipFileSourceAccess = CFileSourceAccess::NewL(*this);
+	ipBufferArrivalHandler = CBufferArrivalHandler::NewL(*this, *ipFileSourceAccess);
+	ipPFHelper = CPFHelper::NewL(*this, *ipFileSourceAccess, *ipBufferArrivalHandler);
+	}
+
+COmxILFileSourceProcessingFunction::~COmxILFileSourceProcessingFunction()
+	{
+	if(ipPFHelper &&
+	   (iState == OMX_StateInvalid  ||
+	    iState == OMX_StateExecuting ||
+	    iState == OMX_StatePause))
+		{
+		ipPFHelper->StopSync();
+		}
+
+	delete ipBufferArrivalHandler;
+	delete ipPFHelper;
+	delete ipFileSourceAccess;
+	delete ipUri;
+	delete ipFileName;
+
+	// Buffer headers are not owned by the processing function
+    iBuffersToFill.Close();
+	}
+
+OMX_ERRORTYPE COmxILFileSourceProcessingFunction::StateTransitionIndication(TStateIndex aNewState)
+	{
+	OMX_ERRORTYPE err = OMX_ErrorNone;
+	switch(aNewState)
+		{
+		case EStateExecuting:
+			{
+			if (ipPFHelper->ExecuteAsync() != KErrNone)
+				{
+				err = OMX_ErrorInsufficientResources;
+				}
+			}
+			break;
+
+		case EStateInvalid:
+			{
+            if (ipPFHelper && ipPFHelper->StopAsync() != KErrNone)
+                {
+                err = OMX_ErrorInsufficientResources;
+                }
+
+			}
+			break;
+
+		case EStatePause:
+			{
+			ipPFHelper->PauseAsync();
+			}
+			break;
+
+		case EStateIdle:
+			{
+			ipPFHelper->IdleAsync();
+			}
+			break;
+
+		case EStateLoaded:
+		case EStateWaitForResources:
+			{
+			if (ipPFHelper && ipPFHelper->StopAsync() != KErrNone)
+				{
+				err = OMX_ErrorInsufficientResources;
+				}
+			}
+			break;
+
+		case ESubStateExecutingToIdle:
+			{
+			ipPFHelper->StopAsync();
+			}
+			break;
+		case ESubStatePauseToIdle:
+	    case ESubStateLoadedToIdle:
+	    case ESubStateIdleToLoaded:
+			break;
+
+		default:
+			{
+			err = OMX_ErrorIncorrectStateTransition;
+			}
+		};
+
+	return err;
+	}
+
+OMX_ERRORTYPE COmxILFileSourceProcessingFunction::BufferFlushingIndication(TUint32 aPortIndex, OMX_DIRTYPE aDirection)
+	{
+    OMX_ERRORTYPE err = OMX_ErrorNone;
+    if ((aPortIndex == OMX_ALL && aDirection == OMX_DirMax) ||
+        (aPortIndex == 0 && aDirection == OMX_DirOutput))
+        {
+        err = CPFHelper::ConvertSymbianErrorType(ipPFHelper->FlushIndication());
+        }
+    else
+        {
+        err = OMX_ErrorBadParameter;
+        }
+    return err;
+    }
+
+OMX_ERRORTYPE COmxILFileSourceProcessingFunction::ParamIndication(OMX_INDEXTYPE aParamIndex, const TAny* apComponentParameterStructure)
+	{
+	OMX_ERRORTYPE err = OMX_ErrorNone;
+	switch(aParamIndex)
+		{
+		case OMX_IndexParamPortDefinition:
+			{
+			//const OMX_PARAM_PORTDEFINITIONTYPE* portDefinition = static_cast<const OMX_PARAM_PORTDEFINITIONTYPE*>(apComponentParameterStructure);
+			//nothing to do
+			//
+			//the number of buffers may change depending on capture mode (single shot vs burst mode)
+			//in that case, we need to do something for PF...
+			break;
+			}
+		case OMX_IndexParamContentURI:
+			{
+			const OMX_PARAM_CONTENTURITYPE* contentUriType = reinterpret_cast<const OMX_PARAM_CONTENTURITYPE*>(apComponentParameterStructure);
+			err = SetFileName(contentUriType);
+			break;
+			}
+		default:
+			{
+			err = OMX_ErrorUnsupportedIndex;
+			}
+		}
+	return err;
+	}
+
+OMX_ERRORTYPE COmxILFileSourceProcessingFunction::ConfigIndication(OMX_INDEXTYPE /*aConfigIndex*/, const TAny* /*apComponentConfigStructure*/)
+	{
+	return OMX_ErrorNone;
+	}
+
+OMX_ERRORTYPE COmxILFileSourceProcessingFunction::BufferIndication(OMX_BUFFERHEADERTYPE* apBufferHeader, OMX_DIRTYPE aDirection)
+	{
+	if (aDirection == OMX_DirOutput)
+    	{
+    	if (ipBufferArrivalHandler->BufferIndication(apBufferHeader) != KErrNone)
+    		{
+    		return OMX_ErrorInsufficientResources;
+    		}
+		}
+    else
+    	{
+    	return OMX_ErrorBadParameter;
+    	}
+
+    return OMX_ErrorNone;
+	}
+
+OMX_BOOL COmxILFileSourceProcessingFunction::BufferRemovalIndication(OMX_BUFFERHEADERTYPE* apBufferHeader, OMX_DIRTYPE /*aDirection*/)
+	{
+	return ipPFHelper->RemoveBufferIndication(apBufferHeader);
+	}
+
+MOmxILCallbackNotificationIf& COmxILFileSourceProcessingFunction::GetCallbacks()
+	{
+	return iCallbacks;
+	}
+
+OMX_ERRORTYPE COmxILFileSourceProcessingFunction::SetFileName(const OMX_PARAM_CONTENTURITYPE* aContentUriType)
+	{
+	ASSERT(aContentUriType);
+	delete ipFileName;
+	ipFileName = NULL;
+	delete ipUri;
+	ipUri = NULL;
+
+	TInt sizeOfUri = aContentUriType->nSize - _FOFF(OMX_PARAM_CONTENTURITYPE, contentURI); //Actual size of URI
+	if (sizeOfUri <= 0)
+		{
+		return OMX_ErrorBadParameter;
+		}
+
+	// Don't include the zero character at the end.
+	TPtrC8 uriDes(aContentUriType->contentURI,sizeOfUri);
+
+	TInt err = KErrNone;
+	do
+		{
+		TUriParser8 parser;
+		err = parser.Parse(uriDes);
+		if (err != KErrNone)
+			{
+			break;
+			}
+
+		TRAP(err, ipFileName = parser.GetFileNameL());
+		if (err != KErrNone)
+			{
+			break;
+			}
+
+		// Remove Null charcter '\0' if any.
+		TPtr filePtr(ipFileName->Des());
+		TInt index = filePtr.LocateReverse('\0');
+		if (index != KErrNotFound && index == filePtr.Length()-1)
+		    {
+		    filePtr.Delete(index,1);
+		    }
+
+		uriDes.Set(reinterpret_cast<const TUint8 *>(aContentUriType), aContentUriType->nSize );
+        ipUri = uriDes.Alloc();
+        if (!ipUri)
+            {
+            err = KErrNoMemory;
+            break;
+            }
+
+		return OMX_ErrorNone;
+		}
+	while (EFalse);
+
+	// Something failed.
+	__ASSERT_DEBUG( (err == KErrNone), User::Panic(_L("UriParsing"), err) );
+
+	delete ipFileName;
+	ipFileName = NULL;
+	delete ipUri;
+	ipUri = NULL;
+	return (err == KErrNoMemory ? OMX_ErrorInsufficientResources : OMX_ErrorBadParameter);
+	}
+
+
+const HBufC* COmxILFileSourceProcessingFunction::FileName() const
+	{
+	return ipFileName;
+	}
+
+const HBufC8* COmxILFileSourceProcessingFunction::Uri() const
+	{
+	return ipUri;
+	}
+
+COmxILFileSourceProcessingFunction::CFileSourceAccess* COmxILFileSourceProcessingFunction::CFileSourceAccess::NewL(COmxILFileSourceProcessingFunction& aParent)
+	{
+	CFileSourceAccess* self = new (ELeave) CFileSourceAccess(aParent);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+COmxILFileSourceProcessingFunction::CFileSourceAccess::CFileSourceAccess(COmxILFileSourceProcessingFunction& aParent)
+	: CActive(EPriorityStandard),
+	iParent(aParent),
+	iBufferOffset(0),
+	iReadBuffer(0,0),
+	iEOSFlag(EFalse)
+	{
+	CActiveScheduler::Add(this);
+	}
+
+void COmxILFileSourceProcessingFunction::CFileSourceAccess::ConstructL()
+	{
+	User::LeaveIfError(iFs.Connect());
+	}
+
+COmxILFileSourceProcessingFunction::CFileSourceAccess::~CFileSourceAccess()
+	{
+	Cancel();
+
+	iFileHandle.Close();
+	iFs.Close();
+	}
+
+void COmxILFileSourceProcessingFunction::CFileSourceAccess::RunL()
+	{
+	// The buffer is not on the list implies that they have already been flushed/spotted
+	// via BufferFlushingIndication/BufferRemovalIndication
+	TInt index = iParent.iBuffersToFill.Find(iCurrentBuffer);
+	if (KErrNotFound != index)
+		{
+		switch(iStatus.Int())
+			{
+			case KErrNone:
+				{
+				if (iReadBuffer.Length()==0) //the end of the file
+				    {
+				    iFileHandle.Close();
+				    iCurrentBuffer->nFlags |= OMX_BUFFERFLAG_EOS;
+				    iParent.GetCallbacks().EventNotification(OMX_EventBufferFlag, iCurrentBuffer->nOutputPortIndex, OMX_BUFFERFLAG_EOS, NULL);
+				    iEOSFlag = ETrue;
+				    }
+				iCurrentBuffer->nFilledLen=iReadBuffer.Length();
+				iCurrentBuffer->nOffset = 0;
+				break;
+				}
+			default:
+				{
+				User::Leave(iStatus.Int());
+				}
+			};
+
+		iParent.GetCallbacks().BufferDoneNotification(iCurrentBuffer,iCurrentBuffer->nOutputPortIndex,OMX_DirOutput);
+		iParent.iBuffersToFill.Remove(index);
+		iCurrentBuffer = NULL;
+		}
+	
+    if(iFileHandle.SubSessionHandle() != 0)
+        {
+        ProcessNextBuffer();
+        }
+	}
+
+TInt COmxILFileSourceProcessingFunction::CFileSourceAccess::ProcessNextBuffer()
+	{
+	TInt err = KErrNone;
+	if ((iParent.iBuffersToFill.Count() > 0) && !IsActive() && iParent.iState == OMX_StateExecuting)
+		{
+		iCurrentBuffer = iParent.iBuffersToFill[0];
+		iReadBuffer.Set(iCurrentBuffer->pBuffer, iCurrentBuffer->nAllocLen, iCurrentBuffer->nAllocLen);
+        if (iFileHandle.SubSessionHandle() == 0)
+            {
+            if(iEOSFlag == EFalse)
+                {
+                // This condition caters for when an IL client does not set the URI before trasitioning to 
+                // executing state (like the Khronos conformance suite). The proposed way to deal with this is to keep
+                // sending BufferDone notification with blank buffers with size >0 for KMaxBuffersWhenNoFileName number
+                // of times before OMX_BUFFERFLAG_EOS flag is sent to client. This simulates a normal communication.
+                if( iEOSBufferNotificationCount <= KMaxBuffersWhenNoFileName )
+                    {
+                    TUint nBufferSize = 0;
+                    if (iEOSBufferNotificationCount < KMaxBuffersWhenNoFileName)
+                        {
+                        nBufferSize = KBufferSizeReturnedWhenNoFileName;
+                        }
+                    iReadBuffer.Set(iCurrentBuffer->pBuffer, nBufferSize, iCurrentBuffer->nAllocLen);                  
+                    iEOSBufferNotificationCount++;              
+                    SetActive();
+                    TRequestStatus* status(&iStatus);
+                    User::RequestComplete(status, KErrNone);
+                    }
+                }
+            else
+                {
+                iReadBuffer.Set(iCurrentBuffer->pBuffer, iCurrentBuffer->nAllocLen, iCurrentBuffer->nAllocLen);
+                // do nothing. this menas that all operations have completed succesfully.
+                }
+            
+            }
+        else
+            {
+            iFileHandle.Read(iReadBuffer, iCurrentBuffer->nAllocLen, iStatus);
+            SetActive();
+            }
+		}
+	return err;
+	}
+
+void COmxILFileSourceProcessingFunction::CFileSourceAccess::DoCancel()
+	{
+	if (iFileHandle.SubSessionHandle() != 0)
+	    {
+	    iFileHandle.Close();
+	    }
+	iEOSFlag = EFalse;
+	iEOSBufferNotificationCount = 0;
+	
+	iCurrentBuffer = NULL;
+	}
+
+TInt COmxILFileSourceProcessingFunction::CFileSourceAccess::Execute()
+	{
+	iEOSFlag = EFalse;
+	iEOSBufferNotificationCount = 0;
+	iParent.iState = OMX_StateExecuting;
+	return ProcessNextBuffer();
+	}
+
+void COmxILFileSourceProcessingFunction::CFileSourceAccess::Pause()
+	{
+	iParent.iState = OMX_StatePause;
+	}
+
+void COmxILFileSourceProcessingFunction::CFileSourceAccess::Idle()
+    {
+    iParent.iState = OMX_StateIdle;
+    iParent.iBuffersToFill.Reset();
+    }
+
+void COmxILFileSourceProcessingFunction::CFileSourceAccess::CancelDataTransfer()
+    {
+    if(iFileHandle.SubSessionHandle() != 0)
+        {
+        iFileHandle.ReadCancel();
+        }
+    }
+
+void COmxILFileSourceProcessingFunction::CFileSourceAccess::Stop()
+	{
+	if(iParent.iState == OMX_StateExecuting || iParent.iState == OMX_StatePause)
+		{
+		Cancel();
+		iParent.iState = OMX_StateIdle;
+		}
+	}
+
+COmxILFileSourceProcessingFunction::CPFHelper* COmxILFileSourceProcessingFunction::CPFHelper::NewL(COmxILFileSourceProcessingFunction& aParent, CFileSourceAccess& aFileSourceAccess, CBufferArrivalHandler& aBufferArrivalHandler)
+	{
+	CPFHelper* self = new (ELeave) CPFHelper(aParent, aFileSourceAccess, aBufferArrivalHandler);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+COmxILFileSourceProcessingFunction::CPFHelper::CPFHelper(COmxILFileSourceProcessingFunction& aParent, CFileSourceAccess& aFileSourceAccess, CBufferArrivalHandler& aBufferArrivalHandler)
+: CActive(CActive::EPriorityUserInput),
+  iParent(aParent),
+  iFileSourceAccess(aFileSourceAccess),
+  iBufferArrivalHandler(aBufferArrivalHandler)
+	{
+	CActiveScheduler::Add(this);
+    iRunLContext = RThread();
+	}
+
+void COmxILFileSourceProcessingFunction::CPFHelper::ConstructL()
+	{
+    User::LeaveIfError(iWaitSemaphore.CreateLocal(0));
+	User::LeaveIfError(iMsgQueue.CreateLocal(KMaxMsgQueueEntries));
+	SetActive();
+	iMsgQueue.NotifyDataAvailable(iStatus);
+	}
+
+COmxILFileSourceProcessingFunction::CPFHelper::~CPFHelper()
+	{
+	Cancel();
+	iMsgQueue.Close();
+    iRunLContext.Close();
+    iWaitSemaphore.Close();
+	}
+
+void COmxILFileSourceProcessingFunction::CPFHelper::RunL()
+	{
+	TInt err = ProcessQueue();
+	if (err != KErrNone)
+		{
+		iParent.GetCallbacks().ErrorEventNotification( ConvertSymbianErrorType(err) );
+		}
+
+	// setup for next callbacks
+	SetActive();
+	iMsgQueue.NotifyDataAvailable(iStatus);
+	}
+
+void COmxILFileSourceProcessingFunction::CPFHelper::DoCancel()
+	{
+	if (iMsgQueue.Handle())
+		{
+		ProcessQueue();
+		iMsgQueue.CancelDataAvailable();
+		}
+	}
+
+TInt COmxILFileSourceProcessingFunction::CPFHelper::ProcessQueue()
+	{
+	TProcMessage msg;
+	TInt err = KErrNone;
+
+	while (iMsgQueue.Receive(msg) == KErrNone)
+		{
+		switch (msg.iType)
+			{
+			case EExecuteCommand:
+				{
+                const HBufC* fileName = iParent.FileName();
+	            if (fileName && iFileSourceAccess.iFileHandle.SubSessionHandle() == 0)
+                    {
+                    err = iFileSourceAccess.iFileHandle.Open(iFileSourceAccess.iFs, *fileName, EFileRead | EFileShareReadersOnly);
+                    }
+	            // Transition to execute only when opening the file succeeds or there is no file name at all
+                if ( err == KErrNone)
+                    {
+                    err = iFileSourceAccess.Execute();
+                    }
+				break;
+				}
+
+			case EStopCommand:
+				{
+				iFileSourceAccess.Stop();
+				break;
+				}
+
+			case EPauseCommand:
+				{
+				iFileSourceAccess.Pause();
+				break;
+				}
+
+			case EIdleCommand:
+			    {
+			    iFileSourceAccess.Idle();
+			    break;
+			    }
+			    
+			case EFlushCommand:
+			    {
+			    // Carry out the flush and wake up the non-Active Scheduler client.
+			    PerformFlush();
+			    iWaitSemaphore.Signal();
+			    break;
+			    }
+			    
+			case ERemoveBufferCommand:
+			    {
+			    // Carry out the buffer removal and wake up the non-Active Scheduler client.
+			    TBufferRemovalArgs* args = reinterpret_cast<TBufferRemovalArgs*>(msg.iPtr);
+			    *(args->iHdrRemoved) = PerformBufferRemoval(args->ipHeader);
+			    iWaitSemaphore.Signal();
+			    break;
+			    }
+			    
+			default:
+				{
+				break;
+				}
+			}
+
+		if (err)
+			{
+			break;
+			}
+		}
+	return err;
+	}
+
+TInt COmxILFileSourceProcessingFunction::CPFHelper::ExecuteAsync()
+	{
+	TProcMessage message;
+	message.iType = EExecuteCommand;
+	return iMsgQueue.Send(message);
+	}
+
+TInt COmxILFileSourceProcessingFunction::CPFHelper::StopAsync()
+	{
+	TProcMessage message;
+	message.iType = EStopCommand;
+	return iMsgQueue.Send(message);
+	}
+
+TInt COmxILFileSourceProcessingFunction::CPFHelper::PauseAsync()
+    {
+    TProcMessage message;
+    message.iType = EPauseCommand;
+    return iMsgQueue.Send(message);
+    }
+
+void COmxILFileSourceProcessingFunction::CPFHelper::StopSync()
+    {
+    // Cancel to process the existing queue before handling this command
+    Cancel();
+    iFileSourceAccess.Stop();
+
+    // setup for next callbacks
+    SetActive();
+    iMsgQueue.NotifyDataAvailable(iStatus);
+    }
+
+TInt COmxILFileSourceProcessingFunction::CPFHelper::IdleAsync()
+    {
+    TProcMessage message;
+    message.iType = EIdleCommand;
+    return iMsgQueue.Send(message);
+    }
+
+TInt COmxILFileSourceProcessingFunction::CPFHelper::FlushIndication()
+    {
+    TInt error = KErrNone;    
+    RThread currentThread = RThread();
+    if (currentThread.Id() == iRunLContext.Id())
+        {
+        // Running in the same context as CFileSourceAccess::RunL() so 
+        // sure of no concurrency issues.
+        PerformFlush();
+        }
+    else
+        {
+        // Running in a different thread, meaning the client does
+        // not have an active scheduler.  To avoid concurrency problems 
+        // during the flush, switch to the thread in which the active objects'
+        // execution is handled.
+        TProcMessage message;
+        message.iType = EFlushCommand;
+        error =  iMsgQueue.Send(message);
+        if (error == KErrNone)
+            {
+            iWaitSemaphore.Wait();
+            }
+        }
+    currentThread.Close();
+    return error;
+    }
+
+void COmxILFileSourceProcessingFunction::CPFHelper::PerformFlush()
+    {
+    // Running in the same context as CFileSourceAccess::RunL() so 
+    // sure of no concurrency issues.
+    
+    // So that we don't continue to write to the buffer once it's returned.
+    iFileSourceAccess.CancelDataTransfer();
+    
+    while (iParent.iBuffersToFill.Count() > 0)
+        {
+        OMX_BUFFERHEADERTYPE* pBufferHeader = iParent.iBuffersToFill[0];
+        iParent.iBuffersToFill.Remove(0);
+        iParent.iCallbacks.BufferDoneNotification(pBufferHeader,
+                                                pBufferHeader->nOutputPortIndex,
+                                                OMX_DirOutput);
+        }
+    
+    iBufferArrivalHandler.FlushIndication();    
+    }
+
+OMX_BOOL COmxILFileSourceProcessingFunction::CPFHelper::RemoveBufferIndication(OMX_BUFFERHEADERTYPE* apBufferHeader)
+    {
+    TInt error = KErrNone;    
+    RThread currentThread = RThread();
+    if (currentThread.Id() == iRunLContext.Id())
+        {
+        currentThread.Close();
+        // Running in the same context as CFileSourceAccess::RunL() so 
+        // sure of no concurrency issues.
+        return PerformBufferRemoval(apBufferHeader);
+        }
+    else
+        {
+        currentThread.Close();
+        // Running in a different thread, meaning the client does
+        // not have an active scheduler.  To avoid concurrency problems 
+        // during the flush, switch to the thread in which the active objects'
+        // execution is handled.
+        TProcMessage message;
+        OMX_BOOL bufferFound;
+        TBufferRemovalArgs messageArgs;
+        messageArgs.ipHeader = apBufferHeader;
+        messageArgs.iHdrRemoved = &bufferFound;
+        message.iType = ERemoveBufferCommand;
+        message.iPtr = &messageArgs;
+        error =  iMsgQueue.Send(message);
+        if (error == KErrNone)
+            {
+            iWaitSemaphore.Wait();
+            return bufferFound;
+            }
+        iParent.GetCallbacks().ErrorEventNotification(OMX_ErrorInsufficientResources);
+        return OMX_FALSE;
+        }
+    }
+
+OMX_BOOL COmxILFileSourceProcessingFunction::CPFHelper::PerformBufferRemoval(OMX_BUFFERHEADERTYPE* apBufferHeader)
+    {
+    if (iParent.iBuffersToFill.Count() < 1)
+        {
+        return OMX_FALSE;
+        }
+    
+    if (iParent.iBuffersToFill[0] == apBufferHeader)
+        {
+        iFileSourceAccess.CancelDataTransfer();
+        iParent.iBuffersToFill.Remove(0);
+        return OMX_TRUE;
+        }
+    
+    TInt count = iParent.iBuffersToFill.Count();
+    for (TInt index = 1; index < count; ++index)
+        {
+        if (iParent.iBuffersToFill[index] == apBufferHeader)
+            {
+            iParent.iBuffersToFill.Remove(index);
+            return OMX_TRUE;
+            }
+        }
+    
+    return iBufferArrivalHandler.RemoveBufferIndication(apBufferHeader);
+    }
+
+/**
+ Converts a Symbian error code to an OpenMAX error code.
+ @param     aError The Symbian error code.
+ @return    The OpenMAX error code.
+ */
+OMX_ERRORTYPE COmxILFileSourceProcessingFunction::CPFHelper::ConvertSymbianErrorType(TInt aError)
+    {
+    // In the current implementation this function is only used for the return code in the
+    // callback methods. Currently the only expected errors KErrNone and KErrOverflow.
+
+    OMX_ERRORTYPE err = OMX_ErrorNone;
+    switch (aError)
+        {
+    case KErrNone:
+        err = OMX_ErrorNone;
+        break;
+    case KErrOverflow:
+    case KErrNoMemory:
+        err = OMX_ErrorInsufficientResources;
+        break;
+    case KErrNotSupported:
+        err = OMX_ErrorNotImplemented;
+        break;
+    case KErrNotReady:
+        err = OMX_ErrorNotReady;
+        break;
+    case KErrGeneral:
+    default:
+        err = OMX_ErrorUndefined;
+        }
+    return err;
+    }
+
+COmxILFileSourceProcessingFunction::CBufferArrivalHandler* COmxILFileSourceProcessingFunction::CBufferArrivalHandler::NewL(COmxILFileSourceProcessingFunction& aParent, CFileSourceAccess& aFileSourceAccess)
+    {
+    CBufferArrivalHandler* self = new (ELeave) CBufferArrivalHandler(aParent, aFileSourceAccess);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+COmxILFileSourceProcessingFunction::CBufferArrivalHandler::CBufferArrivalHandler(COmxILFileSourceProcessingFunction& aParent, CFileSourceAccess& aFileSourceAccess)
+: CActive(CActive::EPriorityStandard),
+  iParent(aParent),
+  iFileSourceAccess(aFileSourceAccess)
+    { 
+    CActiveScheduler::Add(this);
+    }
+
+void COmxILFileSourceProcessingFunction::CBufferArrivalHandler::ConstructL()
+    {
+    User::LeaveIfError(iMsgQueue.CreateLocal(KMaxMsgQueueEntries));
+    SetActive();
+    iMsgQueue.NotifyDataAvailable(iStatus);
+    }
+
+COmxILFileSourceProcessingFunction::CBufferArrivalHandler::~CBufferArrivalHandler()
+    {
+    Cancel();
+    iMsgQueue.Close();  // Queue should be emptied by now
+    }
+        
+TInt COmxILFileSourceProcessingFunction::CBufferArrivalHandler::BufferIndication(OMX_BUFFERHEADERTYPE* apBufferHeader)
+    {
+    TBufferIndicationMessage msg;
+    msg.iBufferHdr = apBufferHeader;
+    return iMsgQueue.Send(msg);    
+    }
+
+/*
+ * Bear in mind that this results in BufferDoneNotifications and so should be called at the end of of the 
+ * flush sequence to ensure headers are completed in the order they were received.
+ */
+void COmxILFileSourceProcessingFunction::CBufferArrivalHandler::FlushIndication()
+    {
+    TBufferIndicationMessage msg;
+    
+    while (iMsgQueue.Receive(msg) == KErrNone)
+        {
+        iParent.GetCallbacks().BufferDoneNotification(msg.iBufferHdr, msg.iBufferHdr->nOutputPortIndex,OMX_DirOutput);
+        }
+    }
+
+OMX_BOOL COmxILFileSourceProcessingFunction::CBufferArrivalHandler::RemoveBufferIndication(OMX_BUFFERHEADERTYPE* apBufferHeader)
+    {
+    RArray<TBufferIndicationMessage> bufferedMsgs;
+    TBufferIndicationMessage msg;
+    
+    OMX_BOOL hdrFound = OMX_FALSE;
+    while (iMsgQueue.Receive(msg) == KErrNone)
+        {
+        if (msg.iBufferHdr == apBufferHeader)
+            {
+            hdrFound = OMX_TRUE;
+            }
+        else
+            {
+            TInt error = bufferedMsgs.Append(msg);
+            if (error != KErrNone)
+                {
+                // to prevent potential buffer leakage if the Append operation fails
+                iParent.GetCallbacks().BufferDoneNotification(msg.iBufferHdr, msg.iBufferHdr->nOutputPortIndex,OMX_DirOutput);
+                }
+            }
+        }
+    
+    TInt count = bufferedMsgs.Count();
+    for (TInt index = 0; index < count; ++index)
+        {
+        // There's the potential here, in an environment when 3+ threads
+        // (which is possible in the case of a non-AS client and a multi-threaded
+        // tunneled component, e.g. Bellagio) are manipulatng the component, for
+        // a buffer to be inserted out of order if a FillThisBuffer() command comes
+        // in during the move to Idle and with particular thread scheduling 
+        // sequences.  However as we only have one port and this command is called as
+        // part of a move to Idle or port disablement then we should get a 
+        // BufferRemovalNotification() for every buffer so in this instance it shouldn't
+        // be a problem.
+        iMsgQueue.Send(bufferedMsgs[index]);
+        }
+    return hdrFound;
+    }
+
+void COmxILFileSourceProcessingFunction::CBufferArrivalHandler::RunL()
+    {
+    TBufferIndicationMessage msg;
+    TInt err = iMsgQueue.Receive(msg);
+    
+    if ((err == KErrNone) && (iParent.iState == OMX_StateExecuting ||
+                                iParent.iState == OMX_StatePause || 
+                                iParent.iState == OMX_StateIdle))
+        {
+        err = iParent.iBuffersToFill.Append(msg.iBufferHdr);
+        
+        if(err == KErrNone)
+            {
+            if(iParent.iState != OMX_StateIdle)
+                {
+                err = iFileSourceAccess.ProcessNextBuffer();
+                }
+            }
+        else
+            {
+            iParent.GetCallbacks().ErrorEventNotification(OMX_ErrorInsufficientResources);
+            // to prevent potential buffer leakage if the Append operation fails
+            iParent.GetCallbacks().BufferDoneNotification(msg.iBufferHdr, msg.iBufferHdr->nOutputPortIndex,OMX_DirOutput);
+            }        
+        }
+            
+    SetActive();
+    iMsgQueue.NotifyDataAvailable(iStatus);  
+    }
+
+void COmxILFileSourceProcessingFunction::CBufferArrivalHandler::DoCancel()
+    {
+    iMsgQueue.CancelDataAvailable();
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesource/src/omxilimagefilesource.rss	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,43 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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 <ecom/registryinfo.rh>
+#include <openmax/il/loader/omxilcomponentif.hrh>
+#include "omxilfilesource.hrh"
+
+RESOURCE REGISTRY_INFO theInfo
+	{
+	dll_uid = KUidNokiaOmxILImageFileSourceDll;
+	interfaces =
+		{
+		INTERFACE_INFO
+			{
+			interface_uid = KUidOmxILSymbianComponentIf;
+			implementations =
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid = KUidNokiaOmxILImageFileSource;
+					version_no = 1;
+					display_name = "OMX.NOKIA.IMAGE.FILESOURCE";
+					default_data = "image_reader.binary";
+					}
+				};
+			}
+		};
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesource/src/omxilimagefilesourceipb0port.cpp	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,132 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ * @file
+ * @internalTechnology
+ */
+
+#include "omxilimagefilesourceipb0port.h"
+#include "omxilfilesourceprocessingfunction.h"
+#include <string.h>
+#include <uri8.h>
+
+COmxILImageFileSourceIPB0Port* COmxILImageFileSourceIPB0Port::NewL(const TOmxILCommonPortData& aCommonPortData,
+	                                                 const RArray<OMX_IMAGE_CODINGTYPE>& aSupportedImageFormats,
+	                                                 const RArray<OMX_COLOR_FORMATTYPE>& aSupportedColorFormats,
+													 const COmxILFileSourceProcessingFunction& aFileSourcePF)
+	{
+	COmxILImageFileSourceIPB0Port* self = new (ELeave) COmxILImageFileSourceIPB0Port(aFileSourcePF);
+	CleanupStack::PushL(self);
+	self->ConstructL(aCommonPortData, aSupportedImageFormats, aSupportedColorFormats);
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+void COmxILImageFileSourceIPB0Port::ConstructL(const TOmxILCommonPortData& aCommonPortData,
+                                                const RArray<OMX_IMAGE_CODINGTYPE>& aSupportedImageFormats,
+                                                const RArray<OMX_COLOR_FORMATTYPE>& aSupportedColorFormats)
+	{
+    COmxILImagePort::ConstructL(aCommonPortData, aSupportedImageFormats, aSupportedColorFormats);
+	GetSupportedImageFormats().AppendL(OMX_IMAGE_CodingUnused);
+	GetParamPortDefinition().eDomain = OMX_PortDomainImage;
+	}
+
+COmxILImageFileSourceIPB0Port::COmxILImageFileSourceIPB0Port(const COmxILFileSourceProcessingFunction& aFileSourcePF)
+	: iFileSourcePF(aFileSourcePF)
+	{
+	}
+
+COmxILImageFileSourceIPB0Port::~COmxILImageFileSourceIPB0Port()
+	{
+	iMimeType.Close();
+	CleanUpPort();
+	}
+
+OMX_ERRORTYPE COmxILImageFileSourceIPB0Port::GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const
+	{
+	return COmxILImagePort::GetLocalOmxParamIndexes(aIndexArray);
+	}
+
+OMX_ERRORTYPE COmxILImageFileSourceIPB0Port::GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const
+	{
+	return COmxILImagePort::GetLocalOmxConfigIndexes(aIndexArray);
+	}
+
+OMX_ERRORTYPE COmxILImageFileSourceIPB0Port::GetParameter(OMX_INDEXTYPE aParamIndex,
+														TAny* apComponentParameterStructure) const
+	{
+	return COmxILImagePort::GetParameter(aParamIndex, apComponentParameterStructure);
+	}
+
+OMX_ERRORTYPE COmxILImageFileSourceIPB0Port::SetParameter(OMX_INDEXTYPE aParamIndex,
+														const TAny* apComponentParameterStructure,
+														TBool& aUpdateProcessingFunction)
+	{
+	return COmxILImagePort::SetParameter(aParamIndex,
+										 apComponentParameterStructure,
+										 aUpdateProcessingFunction);
+	}
+
+OMX_ERRORTYPE COmxILImageFileSourceIPB0Port::SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition,
+																TBool& /*aUpdateProcessingFunction*/)
+	{
+	OMX_ERRORTYPE omxErr = OMX_ErrorNone;
+    if (aPortDefinition.format.image.eCompressionFormat == OMX_IMAGE_CodingUnused)
+        {
+        OMX_STRING ptempMIMEType = GetParamPortDefinition().format.image.cMIMEType;
+        GetParamPortDefinition().format.image = aPortDefinition.format.image;
+        
+        GetParamPortDefinition().format.image.cMIMEType = ptempMIMEType;
+        if(aPortDefinition.format.image.cMIMEType)
+            {
+            TInt len= strlen (aPortDefinition.format.image.cMIMEType);
+            if(len > 0)
+                {
+                TPtrC8 mimetype(reinterpret_cast<const TUint8 *>(aPortDefinition.format.image.cMIMEType), len +1 );
+                HBufC8 *pHBuf = mimetype.Alloc();
+                if(pHBuf != NULL )
+                    {
+                    iMimeType.Close();
+                    iMimeType.Assign(pHBuf );
+                    TUint8* pTempBuff = const_cast<TUint8*>(iMimeType.PtrZ() );
+                    GetParamPortDefinition().format.image.cMIMEType = reinterpret_cast<OMX_STRING>(pTempBuff );
+                    }
+                }
+            }
+        }
+    else
+        {
+        omxErr = OMX_ErrorUnsupportedSetting;
+        }
+	    
+	return omxErr;
+	}
+
+TBool COmxILImageFileSourceIPB0Port::IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const
+	{
+    if(aPortDefinition.eDomain != GetParamPortDefinition().eDomain)
+        {
+        return EFalse;
+        }
+
+    if (aPortDefinition.format.image.eCompressionFormat == OMX_IMAGE_CodingMax)
+        {
+        return EFalse;
+        }
+	return ETrue;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesource/src/omxilotherfilesource.rss	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,44 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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 <ecom/registryinfo.rh>
+#include <openmax/il/loader/omxilcomponentif.hrh>
+#include "omxilfilesource.hrh"
+
+
+RESOURCE REGISTRY_INFO theInfo
+	{
+	dll_uid = KUidNokiaOmxILOtherFileSourceDll;
+	interfaces =
+		{
+		INTERFACE_INFO
+			{
+			interface_uid = KUidOmxILSymbianComponentIf;
+			implementations =
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid = KUidNokiaOmxILOtherFileSource;
+					version_no = 1;
+					display_name = "OMX.NOKIA.OTHER.FILESOURCE";
+					default_data = "other_reader.binary";
+					}
+				};
+			}
+		};
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesource/src/omxilotherfilesourceopb0port.cpp	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,108 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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 "omxilotherfilesourceopb0port.h"
+#include "omxilfilesourceprocessingfunction.h"
+#include <uri8.h>
+
+COmxILOtherFileSourceOPB0Port* COmxILOtherFileSourceOPB0Port::NewL(const TOmxILCommonPortData& aCommonPortData, 
+													 const RArray<OMX_OTHER_FORMATTYPE>& aSupportedOtherFormats,
+													 const COmxILFileSourceProcessingFunction& aFileSourcePF)
+	{
+	COmxILOtherFileSourceOPB0Port* self = new (ELeave) COmxILOtherFileSourceOPB0Port(aFileSourcePF);
+	CleanupStack::PushL(self);
+	self->ConstructL(aCommonPortData, aSupportedOtherFormats);
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+void COmxILOtherFileSourceOPB0Port::ConstructL(const TOmxILCommonPortData& aCommonPortData, const RArray<OMX_OTHER_FORMATTYPE>& aSupportedOtherFormats)
+	{
+    // base
+    COmxILOtherPort::ConstructL(aCommonPortData, aSupportedOtherFormats);    
+	GetParamPortDefinition().eDomain = OMX_PortDomainOther;
+	GetParamPortDefinition().format.other.eFormat = OMX_OTHER_FormatBinary;
+	}
+
+COmxILOtherFileSourceOPB0Port::COmxILOtherFileSourceOPB0Port(const COmxILFileSourceProcessingFunction& aFileSourcePF)
+	: iFileSourcePF(aFileSourcePF)
+	{
+	}
+
+COmxILOtherFileSourceOPB0Port::~COmxILOtherFileSourceOPB0Port()
+	{
+	CleanUpPort();
+	}
+	
+OMX_ERRORTYPE COmxILOtherFileSourceOPB0Port::GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const
+	{
+	return COmxILOtherPort::GetLocalOmxParamIndexes(aIndexArray);
+	}
+
+OMX_ERRORTYPE COmxILOtherFileSourceOPB0Port::GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const
+	{
+	return COmxILOtherPort::GetLocalOmxConfigIndexes(aIndexArray);
+	}
+
+OMX_ERRORTYPE COmxILOtherFileSourceOPB0Port::GetParameter(OMX_INDEXTYPE aParamIndex, 
+												   TAny* apComponentParameterStructure) const
+	{
+	return COmxILOtherPort::GetParameter(aParamIndex, apComponentParameterStructure);
+	}
+
+OMX_ERRORTYPE COmxILOtherFileSourceOPB0Port::SetParameter(OMX_INDEXTYPE aParamIndex, 
+		           								   const TAny* apComponentParameterStructure, 
+		           								   TBool& aUpdateProcessingFunction)
+	{
+	return COmxILOtherPort::SetParameter(aParamIndex, 
+										 apComponentParameterStructure, 
+										 aUpdateProcessingFunction);
+	}
+
+
+OMX_ERRORTYPE COmxILOtherFileSourceOPB0Port::SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, 
+																TBool& /*aUpdateProcessingFunction*/)
+	{
+   OMX_ERRORTYPE OMXErr = OMX_ErrorNone;
+    if(aPortDefinition.format.other.eFormat == OMX_OTHER_FormatBinary)
+        {
+        GetParamPortDefinition().format.other = aPortDefinition.format.other;
+        }
+    else
+        {
+        OMXErr=OMX_ErrorUnsupportedSetting;
+        }
+    return OMXErr;
+	}
+
+TBool COmxILOtherFileSourceOPB0Port::IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const
+	{
+	if(aPortDefinition.eDomain != GetParamPortDefinition().eDomain)
+	    {
+	    return EFalse;
+	    }
+
+	
+	if (aPortDefinition.format.other.eFormat == OMX_OTHER_FormatMax)
+        {
+        return EFalse;
+        }
+	
+	
+	return ETrue;	
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesource/src/omxilvideofilesource.rss	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,43 @@
+// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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 <ecom/registryinfo.rh>
+#include <openmax/il/loader/omxilcomponentif.hrh>
+#include "omxilfilesource.hrh"
+
+RESOURCE REGISTRY_INFO theInfo
+	{
+	dll_uid = KUidNokiaOmxILVideoFileSourceDll;
+	interfaces =
+		{
+		INTERFACE_INFO
+			{
+			interface_uid = KUidOmxILSymbianComponentIf;
+			implementations =
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid = KUidNokiaOmxILVideoFileSource;
+					version_no = 1;
+					display_name = "OMX.NOKIA.VIDEO.FILESOURCE";
+					default_data = "video_reader.binary";
+					}
+				};
+			}
+		};
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesource/src/omxilvideofilesourcevpb0port.cpp	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,132 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+/**
+ * @file
+ * @internalTechnology
+ */
+
+#include "omxilvideofilesourcevpb0port.h"
+#include "omxilfilesourceprocessingfunction.h"
+#include <string.h>
+#include <uri8.h>
+
+COmxILVideoFileSourceVPB0Port* COmxILVideoFileSourceVPB0Port::NewL(const TOmxILCommonPortData& aCommonPortData,
+	                                                 const RArray<OMX_VIDEO_CODINGTYPE>& aSupportedCodings,
+	                                                 const RArray<OMX_COLOR_FORMATTYPE>& aSupportedColourFormats,
+													 const COmxILFileSourceProcessingFunction& aFileSourcePF)
+	{
+	COmxILVideoFileSourceVPB0Port* self = new (ELeave) COmxILVideoFileSourceVPB0Port(aFileSourcePF);
+	CleanupStack::PushL(self);
+	self->ConstructL(aCommonPortData, aSupportedCodings, aSupportedColourFormats);
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+void COmxILVideoFileSourceVPB0Port::ConstructL(const TOmxILCommonPortData& aCommonPortData,
+                                        const RArray<OMX_VIDEO_CODINGTYPE>& aSupportedCodings,
+                                        const RArray<OMX_COLOR_FORMATTYPE>& aSupportedColourFormats)
+	{
+    COmxILVideoPort::ConstructL(aCommonPortData, aSupportedCodings, aSupportedColourFormats);
+	GetSupportedVideoFormats().AppendL(OMX_VIDEO_CodingUnused);
+	GetParamPortDefinition().eDomain = OMX_PortDomainVideo;
+	}
+
+COmxILVideoFileSourceVPB0Port::COmxILVideoFileSourceVPB0Port(const COmxILFileSourceProcessingFunction& aFileSourcePF)
+	: iFileSourcePF(aFileSourcePF)
+	{
+	}
+
+COmxILVideoFileSourceVPB0Port::~COmxILVideoFileSourceVPB0Port()
+	{
+	iMimeType.Close();
+	CleanUpPort();
+	}
+
+OMX_ERRORTYPE COmxILVideoFileSourceVPB0Port::GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const
+	{
+	return COmxILVideoPort::GetLocalOmxParamIndexes(aIndexArray);
+	}
+
+OMX_ERRORTYPE COmxILVideoFileSourceVPB0Port::GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const
+	{
+	return COmxILVideoPort::GetLocalOmxConfigIndexes(aIndexArray);
+	}
+
+OMX_ERRORTYPE COmxILVideoFileSourceVPB0Port::GetParameter(OMX_INDEXTYPE aParamIndex,
+														TAny* apComponentParameterStructure) const
+	{
+	return COmxILVideoPort::GetParameter(aParamIndex, apComponentParameterStructure);
+	}
+
+OMX_ERRORTYPE COmxILVideoFileSourceVPB0Port::SetParameter(OMX_INDEXTYPE aParamIndex,
+														const TAny* apComponentParameterStructure,
+														TBool& aUpdateProcessingFunction)
+	{
+	return COmxILVideoPort::SetParameter(aParamIndex,
+										 apComponentParameterStructure,
+										 aUpdateProcessingFunction);
+	}
+
+OMX_ERRORTYPE COmxILVideoFileSourceVPB0Port::SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition,
+																TBool& /*aUpdateProcessingFunction*/)
+	{
+    OMX_ERRORTYPE omxErr = OMX_ErrorNone;
+    if (aPortDefinition.format.video.eCompressionFormat == OMX_VIDEO_CodingUnused)
+        {
+        OMX_STRING ptempMIMEType = GetParamPortDefinition().format.video.cMIMEType; 
+        GetParamPortDefinition().format.video = aPortDefinition.format.video;
+        GetParamPortDefinition().format.video.cMIMEType = ptempMIMEType;
+        
+        if(aPortDefinition.format.video.cMIMEType)
+            {
+            TInt len= strlen (aPortDefinition.format.video.cMIMEType);
+            if(len > 0)
+                {
+                TPtrC8 mimetype(reinterpret_cast<const TUint8 *>(aPortDefinition.format.video.cMIMEType), len +1 );
+                HBufC8 *pHBuf = mimetype.Alloc();
+                if(pHBuf != NULL )
+                    {
+                    iMimeType.Close();
+                    iMimeType.Assign(pHBuf );
+                    TUint8* pTempBuff = const_cast<TUint8*>(iMimeType.PtrZ() );
+                    GetParamPortDefinition().format.video.cMIMEType = reinterpret_cast<OMX_STRING>(pTempBuff );
+                    }
+                }
+            }
+        }
+    else
+        {
+        omxErr = OMX_ErrorUnsupportedSetting;
+        }
+    
+    return omxErr; 
+	}
+
+TBool COmxILVideoFileSourceVPB0Port::IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const
+	{
+    if(aPortDefinition.eDomain != GetParamPortDefinition().eDomain)
+        {
+        return EFalse;
+        }
+
+    if (aPortDefinition.format.video.eCompressionFormat == OMX_VIDEO_CodingMax)
+        {
+        return EFalse;
+        }
+	return ETrue;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesource/tests/khronos_conformance/Khronos_file_source_audio.txt	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,84 @@
+;; cc <testname> : conformance test component (sets appropriate flags, adds all tests, tests component) 
+;; st <traceflags>: OMX_CONF_SetTraceflags(<traceflags>);
+;; ol <logfilename>: OMX_OSAL_OpenLogfile(<logfilename>);
+;; cl : OMX_OSAL_CloseLogfile();
+;; at <testname>: OMX_CONF_AddTest(<testname>);
+;; rt <testname>: OMX_CONF_RemoveTest(<testname>);
+;; mi <inputfilename> <portindex> : OMX_CONF_MapInputfile(<inputfilename>,<portindex>);
+;; tc <testname>: OMX_CONF_TestComponent(<testname>);
+;; ps: OMX_CONF_PrintSettings();
+;; h: OMX_CONF_PrintHelp();
+;; lt: list all available tests.
+;; lc: list all available components.
+
+
+; setup tracing, open logfile
+st 0x7F ; (OMX_OSAL_TRACE_PASSFAIL|OMX_OSAL_TRACE_CALLSEQUENCE|OMX_OSAL_TRACE_PARAMTERS|OMX_OSAL_TRACE_INFO|OMX_OSAL_TRACE_ERROR|OMX_OSAL_TRACE_BUFFER|OMX_OSAL_TRACE_WARNING)
+ol c:\file_source_audio_output.txt
+
+; add tests
+
+; Base Profile Tests
+
+;; ============
+;; Passed tests
+;; vvvvvvvvvvvv
+at StateTransitionTest
+at ComponentNameTest
+at BaseParameterTest
+at BufferTest
+at BufferFlagTest
+at FlushTest
+at BaseMultiThreadedTest
+at PortCommunicationTest
+;; ^^^^^^^^^^^^
+;; Passed tests
+;; ============
+
+;; at ResourceExhaustionTest - not run as we do not run out of memory within the hardcoded test iteration limit.
+
+
+; Interop Profile Tests
+
+
+;; ============
+;; Passed tests
+;; vvvvvvvvvvvv
+at InteropParameterTest
+at ValidInputOutputTest
+at InvalidInputOutputTest
+at PortBufferSupplierTest
+at PortDisableEnableTest
+at IncompleteStopTest
+at MinPayloadSizeTest
+at InteropMultiThreadedTest
+at TunnelledUnitTest
+;; ^^^^^^^^^^^^
+;; Passed tests
+;; ============
+
+
+
+;; Problem Resource Manager : Functionality not existent
+; at ResourcePreemptionTest
+; at WaitForResourcesTest
+
+;; Non-applicable tests
+; at ClockComponentTest
+; at SeekingComponentTest
+
+; Standard Component Class Tests
+
+;; ============
+;; Passed tests
+;; vvvvvvvvvvvv
+at StdBinaryAudioReaderTest
+;; ^^^^^^^^^^^^
+;; Passed tests
+;; ============
+
+; test components
+tc OMX.NOKIA.AUDIO.FILESOURCE
+
+; close logfile
+cl
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesource/tests/khronos_conformance/Khronos_file_source_image.txt	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,84 @@
+;; cc <testname> : conformance test component (sets appropriate flags, adds all tests, tests component) 
+;; st <traceflags>: OMX_CONF_SetTraceflags(<traceflags>);
+;; ol <logfilename>: OMX_OSAL_OpenLogfile(<logfilename>);
+;; cl : OMX_OSAL_CloseLogfile();
+;; at <testname>: OMX_CONF_AddTest(<testname>);
+;; rt <testname>: OMX_CONF_RemoveTest(<testname>);
+;; mi <inputfilename> <portindex> : OMX_CONF_MapInputfile(<inputfilename>,<portindex>);
+;; tc <testname>: OMX_CONF_TestComponent(<testname>);
+;; ps: OMX_CONF_PrintSettings();
+;; h: OMX_CONF_PrintHelp();
+;; lt: list all available tests.
+;; lc: list all available components.
+
+
+; setup tracing, open logfile
+st 0x7F ; (OMX_OSAL_TRACE_PASSFAIL|OMX_OSAL_TRACE_CALLSEQUENCE|OMX_OSAL_TRACE_PARAMTERS|OMX_OSAL_TRACE_INFO|OMX_OSAL_TRACE_ERROR|OMX_OSAL_TRACE_BUFFER|OMX_OSAL_TRACE_WARNING)
+ol c:\file_source_image_output.txt
+
+; add tests
+
+; Base Profile Tests
+
+;; ============
+;; Passed tests
+;; vvvvvvvvvvvv
+at StateTransitionTest
+at ComponentNameTest
+at BaseParameterTest
+at BufferTest
+at BufferFlagTest
+at FlushTest
+at BaseMultiThreadedTest
+at PortCommunicationTest
+;; ^^^^^^^^^^^^
+;; Passed tests
+;; ============
+
+;; at ResourceExhaustionTest - not run as we do not run out of memory within the hardcoded test iteration limit.
+
+; Interop Profile Tests
+
+
+;; ============
+;; Passed tests
+;; vvvvvvvvvvvv
+at InteropParameterTest
+at ValidInputOutputTest
+at InvalidInputOutputTest
+at PortBufferSupplierTest
+at PortDisableEnableTest
+at IncompleteStopTest
+at MinPayloadSizeTest
+at InteropMultiThreadedTest
+at TunnelledUnitTest
+;; ^^^^^^^^^^^^
+;; Passed tests
+;; ============
+
+
+
+;; Problem Resource Manager : Functionality not existent
+; at ResourcePreemptionTest
+; at WaitForResourcesTest
+
+;; Non-applicable tests
+; at ClockComponentTest
+; at SeekingComponentTest
+
+; Standard Component Class Tests
+
+;; ============
+;; Passed tests
+;; vvvvvvvvvvvv
+at StdBinaryImageReaderTest
+;; ^^^^^^^^^^^^
+;; Passed tests
+;; ============
+
+
+; test components
+tc OMX.NOKIA.IMAGE.FILESOURCE
+
+; close logfile
+cl
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesource/tests/khronos_conformance/Khronos_file_source_other.txt	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,84 @@
+;; cc <testname> : conformance test component (sets appropriate flags, adds all tests, tests component) 
+;; st <traceflags>: OMX_CONF_SetTraceflags(<traceflags>);
+;; ol <logfilename>: OMX_OSAL_OpenLogfile(<logfilename>);
+;; cl : OMX_OSAL_CloseLogfile();
+;; at <testname>: OMX_CONF_AddTest(<testname>);
+;; rt <testname>: OMX_CONF_RemoveTest(<testname>);
+;; mi <inputfilename> <portindex> : OMX_CONF_MapInputfile(<inputfilename>,<portindex>);
+;; tc <testname>: OMX_CONF_TestComponent(<testname>);
+;; ps: OMX_CONF_PrintSettings();
+;; h: OMX_CONF_PrintHelp();
+;; lt: list all available tests.
+;; lc: list all available components.
+
+
+; setup tracing, open logfile
+st 0x7F ; (OMX_OSAL_TRACE_PASSFAIL|OMX_OSAL_TRACE_CALLSEQUENCE|OMX_OSAL_TRACE_PARAMTERS|OMX_OSAL_TRACE_INFO|OMX_OSAL_TRACE_ERROR|OMX_OSAL_TRACE_BUFFER|OMX_OSAL_TRACE_WARNING)
+ol c:\file_source_other_output.txt
+
+; add tests
+
+; Base Profile Tests
+
+;; ============
+;; Passed tests
+;; vvvvvvvvvvvv
+at StateTransitionTest
+at ComponentNameTest
+at BaseParameterTest
+at BufferTest
+at BufferFlagTest
+at FlushTest
+at BaseMultiThreadedTest
+at PortCommunicationTest
+;; ^^^^^^^^^^^^
+;; Passed tests
+;; ============
+
+;; at ResourceExhaustionTest - not run as we do not run out of memory within the hardcoded test iteration limit.
+
+; Interop Profile Tests
+
+
+;; ============
+;; Passed tests
+;; vvvvvvvvvvvv
+at InteropParameterTest
+at ValidInputOutputTest
+at InvalidInputOutputTest
+at PortBufferSupplierTest
+at PortDisableEnableTest
+at IncompleteStopTest
+at MinPayloadSizeTest
+at InteropMultiThreadedTest
+at TunnelledUnitTest
+;; ^^^^^^^^^^^^
+;; Passed tests
+;; ============
+
+
+
+;; Problem Resource Manager : Functionality not existent
+; at ResourcePreemptionTest
+; at WaitForResourcesTest
+
+;; Non-applicable tests
+; at ClockComponentTest
+; at SeekingComponentTest
+
+; Standard Component Class Tests
+
+;; ============
+;; Passed tests
+;; vvvvvvvvvvvv
+;; ^^^^^^^^^^^^
+;; Passed tests
+;; ============
+
+;; at StdReaderTest Not run as other_reader.binary is not a standard role, so the test will fail as it is only for standard components as defined in section 8 of the spec.
+
+; test components
+tc OMX.NOKIA.OTHER.FILESOURCE
+
+; close logfile
+cl
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesource/tests/khronos_conformance/Khronos_file_source_video.txt	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,85 @@
+;; cc <testname> : conformance test component (sets appropriate flags, adds all tests, tests component) 
+;; st <traceflags>: OMX_CONF_SetTraceflags(<traceflags>);
+;; ol <logfilename>: OMX_OSAL_OpenLogfile(<logfilename>);
+;; cl : OMX_OSAL_CloseLogfile();
+;; at <testname>: OMX_CONF_AddTest(<testname>);
+;; rt <testname>: OMX_CONF_RemoveTest(<testname>);
+;; mi <inputfilename> <portindex> : OMX_CONF_MapInputfile(<inputfilename>,<portindex>);
+;; tc <testname>: OMX_CONF_TestComponent(<testname>);
+;; ps: OMX_CONF_PrintSettings();
+;; h: OMX_CONF_PrintHelp();
+;; lt: list all available tests.
+;; lc: list all available components.
+
+
+; setup tracing, open logfile
+st 0x7F ; (OMX_OSAL_TRACE_PASSFAIL|OMX_OSAL_TRACE_CALLSEQUENCE|OMX_OSAL_TRACE_PARAMTERS|OMX_OSAL_TRACE_INFO|OMX_OSAL_TRACE_ERROR|OMX_OSAL_TRACE_BUFFER|OMX_OSAL_TRACE_WARNING)
+ol c:\file_source_video_output.txt
+
+; add tests
+
+; Base Profile Tests
+
+;; ============
+;; Passed tests
+;; vvvvvvvvvvvv
+at StateTransitionTest
+at ComponentNameTest
+at BaseParameterTest
+at BufferTest
+at BufferFlagTest
+at FlushTest
+at BaseMultiThreadedTest
+at PortCommunicationTest
+;; ^^^^^^^^^^^^
+;; Passed tests
+;; ============
+
+;; at ResourceExhaustionTest - not run as we do not run out of memory within the hardcoded test iteration limit.
+
+; Interop Profile Tests
+
+
+;; ============
+;; Passed tests
+;; vvvvvvvvvvvv
+at InteropParameterTest
+at ValidInputOutputTest
+at InvalidInputOutputTest
+at PortBufferSupplierTest
+at PortDisableEnableTest
+at IncompleteStopTest
+at MinPayloadSizeTest
+at InteropMultiThreadedTest
+at TunnelledUnitTest
+;; ^^^^^^^^^^^^
+;; Passed tests
+;; ============
+
+
+
+;; Problem Resource Manager : Functionality not existent
+; at ResourcePreemptionTest
+; at WaitForResourcesTest
+
+;; Non-applicable tests
+; at ClockComponentTest
+; at SeekingComponentTest
+
+; Standard Component Class Tests
+
+;; ============
+;; Passed tests
+;; vvvvvvvvvvvv
+at StdBinaryVideoReaderTest
+;; ^^^^^^^^^^^^
+;; Passed tests
+;; ============
+
+
+; test components
+tc OMX.NOKIA.VIDEO.FILESOURCE
+
+
+; close logfile
+cl
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesource/tests/unit/te_omx_filesource_audio.script	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,34 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+LOAD_SUITE te_xmlomxclient
+
+START_TESTCASE MM-AUDIO-OMX-FILESOURCE-001-HP
+	START_TEST_BLOCK 30 te_xmlomxclient c:\omxil\tef\te_omx_filesrc.ini
+		CREATE_OBJECT OmxXmlTestWrapper InstanceName
+		COMMAND	InstanceName New c:\omxil\tef\te_omx_filesource_audio.xml
+		COMMAND InstanceName RunTest BasicOperation
+		COMMAND InstanceName RunTest GetFilenameNoFileSet_filesource
+		COMMAND InstanceName RunTest GetFilenameOverFlow_filesource
+		COMMAND InstanceName RunTest ChangeEncodeType_filesource
+		COMMAND InstanceName RunTest ChangeInvalidEncodeType_filesource
+		COMMAND InstanceName RunTest BasicOperation_nofilename_filesource
+	END_TEST_BLOCK
+END_TESTCASE MM-AUDIO-OMX-FILESOURCE-001-HP
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesource/tests/unit/te_omx_filesource_audio.xml	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+	Copyright (c) NOKIA 2009. All rights reserved.
+	file Source Sink Audio tests for OpenMAX IL.
+	
+	Expected Result:
+	BasicOperation				Pass
+	GetFilenameNoFileSet_filesource		Fail	OMX_ErrorNotReady
+	GetFilenameOverFlow_filesource		Fail	OMX_ErrorBadParameter
+	ChangeEncodeType_filesource		Pass		
+	ChangeInvalidEncodeType_filesource	Fail	OMX_ErrorUnsupportedSetting
+	BasicOperation_nofilename_filesource	Pass
+
+-->
+
+<TestSet>
+
+	<!--  ->  
+		File Source Audio -> 	File Sink Audio	 	
+	-->
+	<Test name="BasicOperation">
+		<!-- Simple file read\write testcase: all comps. to IDLE then to EXECUTING then 3 secs later to IDLE
+			 -->
+		<LoadComponent comp="filesink" name="OMX.NOKIA.AUDIO.FILESINK" />
+		<LoadComponent comp="filesource" name="OMX.NOKIA.AUDIO.FILESOURCE" />
+		
+		<SetupTunnel output="filesource:0" input="filesink:0" />
+		<BufferSupplierOverride output="filesource:0" input="filesink:0" supplier="output" />
+		
+		<SetFilename comp="filesink" filename="C:\omxil\data\aac_same_audio.stream" />
+		
+		<SetFilename comp="filesource" filename="C:\omxil\data\aac.stream" />
+		<GetFilename comp="filesource" filename="C:\omxil\data\aab.stream"/>	
+
+		<IgnoreEvent comp="filesink" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+		<IgnoreEvent comp="filesource" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+		
+		<IgnoreEvent comp="filesink" event="OMX_EventBufferFlag" nData1="0x00000000 " nData2="0x00000001" nData3="0"/>
+		<IgnoreEvent comp="filesource" event="OMX_EventBufferFlag" nData1="0x00000000 " nData2="0x00000001" nData3="0"/>
+		
+		<AllTransition state="idle" order="auto"/>
+		<AllTransition state="executing" order="auto" />
+		<Wait delaytime="3000000" />
+		<AllTransition state="idle" order="auto"/>
+		<AllTransition state="loaded" order="auto"/>
+	</Test>
+	
+	
+	<Test name="GetFilenameNoFileSet_filesource">
+		<LoadComponent comp="filesource" name="OMX.NOKIA.AUDIO.FILESOURCE" />
+		<!--OMX_ErrorNotReady-->
+		<ExpectEvent comp="filesource" event="Error" nData1="0x80001010" nData2="0"/>
+		<GetFilename comp="filesource" filename="C:\omxil\data\aab.stream" expectedomxerr="OMX_ErrorNotReady"/>
+	</Test>
+	
+	<Test name="GetFilenameOverFlow_filesource">
+		<LoadComponent comp="filesource" name="OMX.NOKIA.AUDIO.FILESOURCE" />
+		<!--OMX_ErrorBadParameter-->
+		
+		<SetFilename comp="filesource" filename="C:\omxil\data\aac.stream" />
+		<IgnoreEvent comp="filesource" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+		
+		<ExpectEvent comp="filesource" event="Error" nData1="0x80001005" nData2="0" />
+		<GetFilename comp="filesource" filename="C:\omxil\data\aa.stream" expectedomxerr="OMX_ErrorBadParameter"/>
+	</Test>
+	
+	
+	
+	<Test name="ChangeEncodeType_filesource">
+	<!-- expected result :Pass -->
+		<LoadComponent comp="filesource" name="OMX.NOKIA.AUDIO.FILESOURCE" />
+		<!--Pass-->
+		<SetAudioPortDef port="filesource:0" codingType="unused" /> 
+		<IgnoreEvent comp="filesource" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+	</Test>
+	
+	
+	<Test name="ChangeInvalidEncodeType_filesource">
+	<!-- expected result :fail OMX_ErrorUnsupportedSetting-->
+		<LoadComponent comp="filesource" name="OMX.NOKIA.AUDIO.FILESOURCE" />
+		<!--Pass-->
+		<SetAudioPortDef port="filesource:0" codingType="pcm" expectedomxerr="OMX_ErrorUnsupportedSetting"/> 
+		<IgnoreEvent comp="filesource" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+	</Test>
+	
+	<Test name="BasicOperation_nofilename_filesource">
+		<!-- Simple file read\write testcase: all comps. to IDLE then to EXECUTING then 3 secs later to IDLE
+		 no filename is set for the file source -->
+		<LoadComponent comp="filesink" name="OMX.NOKIA.AUDIO.FILESINK" />
+		<LoadComponent comp="filesource" name="OMX.NOKIA.AUDIO.FILESOURCE" />
+
+		<SetupTunnel output="filesource:0" input="filesink:0" />
+		<BufferSupplierOverride output="filesource:0" input="filesink:0" supplier="output" />
+
+		<SetFilename comp="filesink" filename="C:\omxil\data\aac_audio_invalid.stream" />
+		
+		<IgnoreEvent comp="filesink" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+		<IgnoreEvent comp="filesource" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+
+		<IgnoreEvent comp="filesink" event="OMX_EventBufferFlag" nData1="0x00000000 " nData2="0x00000001" nData3="0"/>
+		<IgnoreEvent comp="filesource" event="OMX_EventBufferFlag" nData1="0x00000000 " nData2="0x00000001" nData3="0"/>
+
+		<AllTransition state="idle" order="auto"/>
+		<AllTransition state="executing" order="auto" />
+		<Wait delaytime="3000000" />
+		<AllTransition state="idle" order="auto"/>
+		<AllTransition state="loaded" order="auto"/>
+	</Test>
+	
+	
+</TestSet>
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesource/tests/unit/te_omx_filesource_image.script	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,32 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+LOAD_SUITE te_xmlomxclient
+
+START_TESTCASE MM-IMAGE-OMX-FILESOURCE-001-HP
+	START_TEST_BLOCK 30 te_xmlomxclient c:\omxil\tef\te_omx_filesrc.ini
+		CREATE_OBJECT OmxXmlTestWrapper InstanceName
+		COMMAND	InstanceName New c:\omxil\tef\te_omx_filesource_image.xml
+		COMMAND InstanceName RunTest BasicOperation
+		COMMAND InstanceName RunTest GetFilenameNoFileSet_filesource
+		COMMAND InstanceName RunTest GetFilenameOverFlow_filesource
+		COMMAND InstanceName RunTest BasicOperation_nofilename_filesource
+	END_TEST_BLOCK
+END_TESTCASE MM-IMAGE-OMX-FILESOURCE-001-HP
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesource/tests/unit/te_omx_filesource_image.xml	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+	Copyright (c) NOKIA 2009. All rights reserved.
+	file Source Sink Image tests for OpenMAX IL.
+	
+
+	Expected Result:
+	BasicOperation				Pass
+	GetFilenameNoFileSet_filesource		Fail	OMX_ErrorNotReady
+	GetFilenameOverFlow_filesource		Fail	OMX_ErrorBadParameter
+	BasicOperation_nofilename_filesource	Pass
+-->
+
+<TestSet>
+
+	<!--  ->  
+		File Source Image -> 	File Sink Image	 	
+	-->
+	<Test name="BasicOperation">
+		<!-- Simple file read\write testcase: all comps. to IDLE then to EXECUTING then 3 secs later to IDLE
+			 -->
+		<LoadComponent comp="filesink" name="OMX.NOKIA.IMAGE.FILESINK" />
+		<LoadComponent comp="filesource" name="OMX.NOKIA.IMAGE.FILESOURCE" />
+		
+		<SetupTunnel output="filesource:0" input="filesink:0" />
+		<BufferSupplierOverride output="filesource:0" input="filesink:0" supplier="output" />
+		
+		<SetFilename comp="filesink" filename="C:\omxil\data\aac_same_image.stream" />
+		
+		<SetFilename comp="filesource" filename="C:\omxil\data\aac.stream" />
+		<GetFilename comp="filesource" filename="C:\omxil\data\aab.stream"/>	
+
+		<IgnoreEvent comp="filesink" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+		<IgnoreEvent comp="filesource" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+		
+		<IgnoreEvent comp="filesink" event="OMX_EventBufferFlag" nData1="0x00000000 " nData2="0x00000001" nData3="0"/>
+		<IgnoreEvent comp="filesource" event="OMX_EventBufferFlag" nData1="0x00000000 " nData2="0x00000001" nData3="0"/>
+		
+		<AllTransition state="idle" order="auto"/>
+		<AllTransition state="executing" order="auto" />
+		<Wait delaytime="3000000" />
+		<AllTransition state="idle" order="auto"/>
+		<AllTransition state="loaded" order="auto"/>
+	</Test>
+	
+	
+	<Test name="GetFilenameNoFileSet_filesource">
+		<LoadComponent comp="filesource" name="OMX.NOKIA.IMAGE.FILESOURCE" />
+		<!--OMX_ErrorNotReady-->
+		<ExpectEvent comp="filesource" event="Error" nData1="0x80001010" nData2="0"/>
+		<GetFilename comp="filesource" filename="C:\omxil\data\aab.stream" expectedomxerr="OMX_ErrorNotReady"/>
+	</Test>
+	
+	<Test name="GetFilenameOverFlow_filesource">
+		<LoadComponent comp="filesource" name="OMX.NOKIA.IMAGE.FILESOURCE" />
+		<!--OMX_ErrorBadParameter-->
+		
+		<SetFilename comp="filesource" filename="C:\omxil\data\aac.stream" />
+		<IgnoreEvent comp="filesource" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+		
+		<ExpectEvent comp="filesource" event="Error" nData1="0x80001005" nData2="0" />
+		<GetFilename comp="filesource" filename="C:\omxil\data\aa.stream" expectedomxerr="OMX_ErrorBadParameter"/>
+	</Test>
+	
+	
+	<Test name="BasicOperation_nofilename_filesource">
+		<!-- Simple file read\write testcase: all comps. to IDLE then to EXECUTING then 3 secs later to IDLE
+		 no filename is set for the file source -->
+		<LoadComponent comp="filesink" name="OMX.NOKIA.IMAGE.FILESINK" />
+		<LoadComponent comp="filesource" name="OMX.NOKIA.IMAGE.FILESOURCE" />
+
+		<SetupTunnel output="filesource:0" input="filesink:0" />
+		<BufferSupplierOverride output="filesource:0" input="filesink:0" supplier="output" />
+
+		<SetFilename comp="filesink" filename="C:\omxil\data\aac_image_invalid.stream" />
+		
+		<IgnoreEvent comp="filesink" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+		<IgnoreEvent comp="filesource" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+
+		<IgnoreEvent comp="filesink" event="OMX_EventBufferFlag" nData1="0x00000000 " nData2="0x00000001" nData3="0"/>
+		<IgnoreEvent comp="filesource" event="OMX_EventBufferFlag" nData1="0x00000000 " nData2="0x00000001" nData3="0"/>
+
+		<AllTransition state="idle" order="auto"/>
+		<AllTransition state="executing" order="auto" />
+		<Wait delaytime="3000000" />
+		<AllTransition state="idle" order="auto"/>
+		<AllTransition state="loaded" order="auto"/>
+	</Test>
+	
+	
+</TestSet>
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesource/tests/unit/te_omx_filesource_other.script	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,32 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+LOAD_SUITE te_xmlomxclient
+
+START_TESTCASE MM-OTHER-OMX-FILESOURCE-001-HP
+	START_TEST_BLOCK 30 te_xmlomxclient c:\omxil\tef\te_omx_filesrc.ini
+		CREATE_OBJECT OmxXmlTestWrapper InstanceName
+		COMMAND	InstanceName New c:\omxil\tef\te_omx_filesource_other.xml
+		COMMAND InstanceName RunTest BasicOperation
+		COMMAND InstanceName RunTest GetFilenameNoFileSet_filesource
+		COMMAND InstanceName RunTest GetFilenameOverFlow_filesource
+		COMMAND InstanceName RunTest BasicOperation_nofilename_filesource
+	END_TEST_BLOCK
+END_TESTCASE MM-OTHER-OMX-FILESOURCE-001-HP
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesource/tests/unit/te_omx_filesource_other.xml	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+	Copyright (c) NOKIA 2009. All rights reserved.
+	file Source Sink Other tests for OpenMAX IL.
+	
+
+	Expected Result:
+	BasicOperation				Pass
+	GetFilenameNoFileSet_filesource		Fail	OMX_ErrorNotReady
+	GetFilenameOverFlow_filesource		Fail	OMX_ErrorBadParameter	
+	BasicOperation_nofilename_filesource	Pass
+-->
+
+<TestSet>
+
+	<!--  ->  
+		File Source Other -> 	File Sink Other	 	
+	-->
+	<Test name="BasicOperation">
+		<!-- Simple file read\write testcase: all comps. to IDLE then to EXECUTING then 3 secs later to IDLE
+			 -->
+		<LoadComponent comp="filesink" name="OMX.NOKIA.OTHER.FILESINK" />
+		<LoadComponent comp="filesource" name="OMX.NOKIA.OTHER.FILESOURCE" />
+		
+		<SetupTunnel output="filesource:0" input="filesink:0" />
+		<BufferSupplierOverride output="filesource:0" input="filesink:0" supplier="output" />
+		
+		<SetFilename comp="filesink" filename="C:\omxil\data\aac_same_other.stream" />
+		
+		<SetFilename comp="filesource" filename="C:\omxil\data\aac.stream" />
+		<GetFilename comp="filesource" filename="C:\omxil\data\aab.stream"/>	
+
+		<IgnoreEvent comp="filesink" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+		<IgnoreEvent comp="filesource" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+		
+		<IgnoreEvent comp="filesink" event="OMX_EventBufferFlag" nData1="0x00000000 " nData2="0x00000001" nData3="0"/>
+		<IgnoreEvent comp="filesource" event="OMX_EventBufferFlag" nData1="0x00000000 " nData2="0x00000001" nData3="0"/>
+		
+		<AllTransition state="idle" order="auto"/>
+		<AllTransition state="executing" order="auto" />
+		<Wait delaytime="3000000" />
+		<AllTransition state="idle" order="auto"/>
+		<AllTransition state="loaded" order="auto"/>
+	</Test>
+	
+	
+	<Test name="GetFilenameNoFileSet_filesource">
+		<LoadComponent comp="filesource" name="OMX.NOKIA.OTHER.FILESOURCE" />
+		<!--OMX_ErrorNotReady-->
+		<ExpectEvent comp="filesource" event="Error" nData1="0x80001010" nData2="0"/>
+		<GetFilename comp="filesource" filename="C:\omxil\data\aab.stream" expectedomxerr="OMX_ErrorNotReady"/>
+	</Test>
+	
+	<Test name="GetFilenameOverFlow_filesource">
+		<LoadComponent comp="filesource" name="OMX.NOKIA.OTHER.FILESOURCE" />
+		<!--OMX_ErrorBadParameter-->
+		
+		<SetFilename comp="filesource" filename="C:\omxil\data\aac.stream" />
+		<IgnoreEvent comp="filesource" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+		
+		<ExpectEvent comp="filesource" event="Error" nData1="0x80001005" nData2="0" />
+		<GetFilename comp="filesource" filename="C:\omxil\data\aa.stream" expectedomxerr="OMX_ErrorBadParameter"/>
+	</Test>
+	
+	
+	<Test name="BasicOperation_nofilename_filesource">
+		<!-- Simple file read\write testcase: all comps. to IDLE then to EXECUTING then 3 secs later to IDLE
+		 no filename is set for the file source -->
+		<LoadComponent comp="filesink" name="OMX.NOKIA.OTHER.FILESINK" />
+		<LoadComponent comp="filesource" name="OMX.NOKIA.OTHER.FILESOURCE" />
+
+		<SetupTunnel output="filesource:0" input="filesink:0" />
+		<BufferSupplierOverride output="filesource:0" input="filesink:0" supplier="output" />
+
+		<SetFilename comp="filesink" filename="C:\omxil\data\aac_other_invalid.stream" />
+		
+		<IgnoreEvent comp="filesink" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+		<IgnoreEvent comp="filesource" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+
+		<IgnoreEvent comp="filesink" event="OMX_EventBufferFlag" nData1="0x00000000 " nData2="0x00000001" nData3="0"/>
+		<IgnoreEvent comp="filesource" event="OMX_EventBufferFlag" nData1="0x00000000 " nData2="0x00000001" nData3="0"/>
+
+		<AllTransition state="idle" order="auto"/>
+		<AllTransition state="executing" order="auto" />
+		<Wait delaytime="3000000" />
+		<AllTransition state="idle" order="auto"/>
+		<AllTransition state="loaded" order="auto"/>
+	</Test>
+	
+	
+</TestSet>
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesource/tests/unit/te_omx_filesource_video.script	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,34 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+
+LOAD_SUITE te_xmlomxclient
+
+START_TESTCASE MM-VIDEO-OMX-FILESOURCE-001-HP
+	START_TEST_BLOCK 30 te_xmlomxclient c:\omxil\tef\te_omx_filesrc.ini
+		CREATE_OBJECT OmxXmlTestWrapper InstanceName
+		COMMAND	InstanceName New c:\omxil\tef\te_omx_filesource_video.xml
+		COMMAND InstanceName RunTest BasicOperation
+		COMMAND InstanceName RunTest GetFilenameNoFileSet_filesource
+		COMMAND InstanceName RunTest GetFilenameOverFlow_filesource
+		COMMAND InstanceName RunTest ChangeEncodeType_filesource
+		COMMAND InstanceName RunTest ChangeInvalidEncodeType_filesource
+		COMMAND InstanceName RunTest BasicOperation_nofilename_filesource
+	END_TEST_BLOCK
+END_TESTCASE MM-VIDEO-OMX-FILESOURCE-001-HP
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesource/tests/unit/te_omx_filesource_video.xml	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+	Copyright (c) NOKIA 2009. All rights reserved.
+	file Source Sink Video tests for OpenMAX IL.
+	
+
+	Expected Result:
+	BasicOperation				Pass
+	GetFilenameNoFileSet_filesource		Fail	OMX_ErrorNotReady
+	GetFilenameOverFlow_filesource		Fail	OMX_ErrorBadParameter
+	ChangeEncodeType_filesource		Pass		
+	ChangeInvalidEncodeType_filesource	Fail	OMX_ErrorUnsupportedSetting
+	BasicOperation_nofilename_filesource	Pass
+-->
+
+<TestSet>
+
+	<!--  ->  
+		File Source Video -> 	File Sink Video	 	
+	-->
+	<Test name="BasicOperation">
+		<!-- Simple file read\write testcase: all comps. to IDLE then to EXECUTING then 3 secs later to IDLE
+			 -->
+		<LoadComponent comp="filesink" name="OMX.NOKIA.VIDEO.FILESINK" />
+		<LoadComponent comp="filesource" name="OMX.NOKIA.VIDEO.FILESOURCE" />
+		
+		<SetupTunnel output="filesource:0" input="filesink:0" />
+		<BufferSupplierOverride output="filesource:0" input="filesink:0" supplier="output" />
+		
+		<SetFilename comp="filesink" filename="C:\omxil\data\aac_same_video.stream" />
+		
+		<SetFilename comp="filesource" filename="C:\omxil\data\aac.stream" />
+		<GetFilename comp="filesource" filename="C:\omxil\data\aab.stream"/>	
+
+		<IgnoreEvent comp="filesink" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+		<IgnoreEvent comp="filesource" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+		
+		<IgnoreEvent comp="filesink" event="OMX_EventBufferFlag" nData1="0x00000000 " nData2="0x00000001" nData3="0"/>
+		<IgnoreEvent comp="filesource" event="OMX_EventBufferFlag" nData1="0x00000000 " nData2="0x00000001" nData3="0"/>
+		
+		<AllTransition state="idle" order="auto"/>
+		<AllTransition state="executing" order="auto" />
+		<Wait delaytime="3000000" />
+		<AllTransition state="idle" order="auto"/>
+		<AllTransition state="loaded" order="auto"/>
+	</Test>
+	
+	
+	<Test name="GetFilenameNoFileSet_filesource">
+		<LoadComponent comp="filesource" name="OMX.NOKIA.VIDEO.FILESOURCE" />
+		<!--OMX_ErrorNotReady-->
+		<ExpectEvent comp="filesource" event="Error" nData1="0x80001010" nData2="0"/>
+		<GetFilename comp="filesource" filename="C:\omxil\data\aab.stream" expectedomxerr="OMX_ErrorNotReady"/>
+	</Test>
+	
+	<Test name="GetFilenameOverFlow_filesource">
+		<LoadComponent comp="filesource" name="OMX.NOKIA.VIDEO.FILESOURCE" />
+		<!--OMX_ErrorBadParameter-->
+		
+		<SetFilename comp="filesource" filename="C:\omxil\data\aac.stream" />
+		<IgnoreEvent comp="filesource" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+		
+		<ExpectEvent comp="filesource" event="Error" nData1="0x80001005" nData2="0" />
+		<GetFilename comp="filesource" filename="C:\omxil\data\aa.stream" expectedomxerr="OMX_ErrorBadParameter"/>
+	</Test>
+	
+	
+	<Test name="ChangeEncodeType_filesource">
+	<!-- expected result :Pass -->
+		<LoadComponent comp="filesource" name="OMX.NOKIA.VIDEO.FILESOURCE" />
+		<!--Pass-->
+		<SetVideoPortDef port="filesource:0" codingType="unused" /> 
+		<IgnoreEvent comp="filesource" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+	</Test>
+	
+	
+	<Test name="ChangeInvalidEncodeType_filesource">
+	<!-- expected result :fail OMX_ErrorUnsupportedSetting-->
+		<LoadComponent comp="filesource" name="OMX.NOKIA.VIDEO.FILESOURCE" />
+		<!--Pass-->
+		<SetVideoPortDef port="filesource:0" codingType="mpeg4" expectedomxerr="OMX_ErrorUnsupportedSetting"/> 
+		<IgnoreEvent comp="filesource" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+	</Test>
+	
+	<Test name="BasicOperation_nofilename_filesource">
+		<!-- Simple file read\write testcase: all comps. to IDLE then to EXECUTING then 3 secs later to IDLE
+		 no filename is set for the file source -->
+		<LoadComponent comp="filesink" name="OMX.NOKIA.VIDEO.FILESINK" />
+		<LoadComponent comp="filesource" name="OMX.NOKIA.VIDEO.FILESOURCE" />
+
+		<SetupTunnel output="filesource:0" input="filesink:0" />
+		<BufferSupplierOverride output="filesource:0" input="filesink:0" supplier="output" />
+
+		<SetFilename comp="filesink" filename="C:\omxil\data\aac_video_invalid.stream" />
+		
+		<IgnoreEvent comp="filesink" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+		<IgnoreEvent comp="filesource" event="PortSettingsChanged" nData1="0x02000001" nData2="0" nData3="0"/>
+
+		<IgnoreEvent comp="filesink" event="OMX_EventBufferFlag" nData1="0x00000000 " nData2="0x00000001" nData3="0"/>
+		<IgnoreEvent comp="filesource" event="OMX_EventBufferFlag" nData1="0x00000000 " nData2="0x00000001" nData3="0"/>
+
+		<AllTransition state="idle" order="auto"/>
+		<AllTransition state="executing" order="auto" />
+		<Wait delaytime="3000000" />
+		<AllTransition state="idle" order="auto"/>
+		<AllTransition state="loaded" order="auto"/>
+	</Test>
+	
+	
+</TestSet>
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/filesource/tests/unit/te_omx_filesrc.ini	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,2 @@
+[InstanceName]
+name=OmxXmlTestObject
Binary file omxilcomp/omxilgeneric/group/aac.stream has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/group/aac.stream.length	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,247 @@
+0
+0
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
+1600
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxilgeneric/group/bld.inf	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,23 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+
+PRJ_TESTEXPORTS
+
+aac.stream				/epoc32/winscw/c/omxil/data/aac.stream
+aac.stream.length			/epoc32/winscw/c/omxil/data/aac.stream.length
+cube-xvid-640x480-10fps-10s.3gp		/epoc32/winscw/c/omxil/data/cube-xvid-640x480-10fps-10s.3gp
+
+
+#include "../filesink/group/bld.inf"
+#include "../filesource/group/bld.inf"
Binary file omxilcomp/omxilgeneric/group/cube-xvid-640x480-10fps-10s.3gp has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxiltestcomp/group/bld.inf	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,19 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+PRJ_EXPORTS
+
+#include "../md5sink/group/bld.inf"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxiltestcomp/md5sink/group/bld.inf	Thu Sep 02 20:13:57 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:
+*
+*/
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_TESTEXPORTS
+
+// The extension for this test component is now exported from the openmaxil package to 
+// openmaxil/il/extensions/test/omxiltestmd5parma.h
+
+./omxiltestothermd5sink.iby /epoc32/rom/include/omxiltestothermd5sink.iby
+
+PRJ_TESTMMPFILES
+./omxiltestothermd5sink.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxiltestcomp/md5sink/group/omxiltestothermd5sink.iby	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 OMXILTESTOTHERMD5SINK_IBY
+#define OMXILTESTOTHERMD5SINK_IBY
+
+#include <omxilcomp.iby>
+
+ECOM_PLUGIN(omxiltestothermd5sink.dll, omxiltestothermd5sink.rsc)
+
+#endif //OMXILTESTOTHERMD5SINK_IBY
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxiltestcomp/md5sink/group/omxiltestothermd5sink.mmp	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include "../src/omxiltestmd5sink.hrh"
+
+TARGET omxiltestothermd5sink.dll
+TARGETTYPE PLUGIN
+UID 0x10009D8D KUidSymbianOmxILTestOtherMD5SinkDll
+CAPABILITY All -TCB
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+USERINCLUDE ../src
+
+SOURCEPATH ../src
+SOURCE omxiltestmd5sink.cpp
+SOURCE omxiltestmd5sinkport.cpp
+SOURCE omxiltestmd5sinkconfigmanager.cpp
+SOURCE omxiltestmd5sinkprocessingfunction.cpp
+
+RESOURCE omxiltestothermd5sink.rss
+
+nostrictdef
+
+LIBRARY euser.lib hash.lib ecom.lib
+LIBRARY omxilcomponentcommon.lib
+STATICLIBRARY omxilcomponentif.lib
+
+MACRO DOMAIN_OTHER
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxiltestcomp/md5sink/src/omxiltestmd5sink.cpp	Thu Sep 02 20:13:57 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:
+*
+*/
+
+
+/**
+@file
+@internalComponent
+*/
+
+#include <openmax/il/common/omxilspecversion.h>
+#include <openmax/il/loader/omxilcomponentif.h>
+#include <openmax/il/loader/omxilsymbiancomponentif.h>
+
+#include "omxiltestmd5sink.h"
+#include "omxiltestmd5sinkport.h"
+#include "omxiltestmd5sinkprocessingfunction.h"
+#include "omxiltestmd5sinkconfigmanager.h"
+#include "omxiltestmd5sink.hrh"
+#include "omxiltestmd5sinkconst.h"
+
+#ifdef DOMAIN_OTHER
+_LIT8(KOmxILComponentName, "OMX.NOKIA.TEST.OTHER.MD5SINK");
+#endif
+
+_LIT8(KOmxILRole, "????");
+
+#ifdef DOMAIN_OTHER
+OMXIL_COMPONENT_ECOM_ENTRYPOINT(KUidSymbianOmxILTestOtherMD5Sink);
+#endif
+
+// Component Entry Point
+OMX_ERRORTYPE OMX_ComponentInit(OMX_HANDLETYPE aComponent)
+	{
+	TInt err = COmxILTestMD5Sink::CreateComponent(aComponent);
+	if (err == KErrNone)
+		{
+		return OMX_ErrorNone;
+		}
+	else
+		{
+		// TODO translate Symbian error code into OMX_ERRORTYPE
+		return OMX_ErrorInsufficientResources;
+		}
+	}
+
+TInt COmxILTestMD5Sink::CreateComponent(OMX_HANDLETYPE hComponent)
+	{
+	COmxILTestMD5Sink* self = new COmxILTestMD5Sink();
+
+	if (!self)
+		{
+		return KErrNoMemory;
+		}
+
+	TRAPD(err, self->ConstructL(hComponent));
+	return err;
+	}
+
+COmxILTestMD5Sink::COmxILTestMD5Sink()
+	{
+	// nothing to do
+	}
+
+void COmxILTestMD5Sink::ConstructL(OMX_HANDLETYPE hComponent)
+	{
+	// STEP 1: Initialize the data received from the IL Core
+    COmxILComponent::ConstructL(hComponent);
+    
+	// STEP 2: Create the call backs holder...
+    MOmxILCallbackNotificationIf* callbackNotificationIf=CreateCallbackManagerL(COmxILComponent::EOutofContext);
+
+	// STEP 3: Create the MD5 sink-specific Processing Function...
+    COmxILTestMD5SinkProcessingFunction* pProcessingFunction = COmxILTestMD5SinkProcessingFunction::NewL(*callbackNotificationIf);
+    RegisterProcessingFunction(pProcessingFunction);
+    
+	// STEP 4: Create Port manager...
+    CreatePortManagerL(COmxILComponent::ENonBufferSharingPortManager,
+		TOmxILSpecVersion(),	        // OMX Version
+		0,						// The number of audio ports in this component
+		0,						// The starting audio port index
+		0,						// The number of image ports in this component
+		0,						// The starting image port index
+		0,						// The number of video ports in this component
+		0,						// The starting video port index
+#ifdef DOMAIN_OTHER
+		1,						// The number of other ports in this component
+#else
+		0,						// The number of other ports in this component
+#endif
+		KMD5SINK_OPB0PORT_INDEX		// The starting other port index
+		);
+
+	// STEP 5: Create the non-port related configuration manager...
+	RPointerArray<TDesC8> roleList;
+	CleanupClosePushL(roleList);
+	roleList.AppendL(&KOmxILRole);
+	COmxILTestMD5SinkConfigManager* apSinkConfigManager = COmxILTestMD5SinkConfigManager::NewL(KOmxILComponentName, TOmxILSpecVersion(), roleList);
+	RegisterConfigurationManager(apSinkConfigManager);
+	CleanupStack::PopAndDestroy(&roleList);
+
+	static_cast<COmxILTestMD5SinkProcessingFunction*>(GetProcessingFunction())->SetConfigManager(apSinkConfigManager);
+	
+	// create the input port
+	ConstructSinkPortL();
+	CleanupStack::PushL(ipSinkPort);
+	// ..  and add it to the port manager...
+	User::LeaveIfError(AddPort(ipSinkPort, OMX_DirInput));
+	CleanupStack::Pop();
+
+	// And finally, let's get everything started
+	InitComponentL();
+	}
+
+COmxILTestMD5Sink::~COmxILTestMD5Sink()
+	{
+	}
+
+void COmxILTestMD5Sink::ConstructSinkPortL()
+	{
+	TOmxILCommonPortData aPortData(
+			TOmxILSpecVersion(),
+			KMD5SINK_OPB0PORT_INDEX, 
+			OMX_DirInput, 
+			KMinBuffers,
+			KMinBufferSize,
+#ifdef DOMAIN_OTHER
+			OMX_PortDomainOther,
+#endif
+			OMX_FALSE,
+			0,
+			OMX_BufferSupplyInput,
+			COmxILPort::KBufferMarkPropagationPortNotNeeded);
+
+	ipSinkPort = COmxILTestMD5SinkPort::NewL(aPortData);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxiltestcomp/md5sink/src/omxiltestmd5sink.h	Thu Sep 02 20:13:57 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:
+*
+*/
+
+
+/**
+@file
+@internalComponent
+*/
+
+#ifndef COMXILTESTMD5SINK_H
+#define COMXILTESTMD5SINK_H
+
+#include <openmax/il/common/omxilcomponent.h>
+
+class COmxILTestMD5SinkPort;
+
+NONSHARABLE_CLASS(COmxILTestMD5Sink) : COmxILComponent
+	{
+public:
+	static TInt CreateComponent(OMX_HANDLETYPE hComponent);
+	~COmxILTestMD5Sink();
+	
+protected:
+	COmxILTestMD5Sink();
+	void ConstructL(OMX_HANDLETYPE hComponent);
+	
+	void ConstructSinkPortL();
+	
+private:
+	
+	COmxILTestMD5SinkPort* ipSinkPort;
+	};
+	
+#endif //COMXILTESTMD5SINK_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxiltestcomp/md5sink/src/omxiltestmd5sink.hrh	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,25 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 OMXILTESTMD5SINK_HRH
+#define OMXILTESTMD5SINK_HRH
+
+#define KUidSymbianOmxILTestOtherMD5SinkDll 0x102866B9
+#define KUidSymbianOmxILTestOtherMD5Sink    0x102866BA
+
+#endif //OMXILTESTMD5SINK_HRH
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxiltestcomp/md5sink/src/omxiltestmd5sinkconfigmanager.cpp	Thu Sep 02 20:13:57 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:
+*
+*/
+
+
+/**
+@file
+@internalComponent
+*/
+
+#include "omxiltestmd5sinkconfigmanager.h"
+#include <openmax/il/extensions/test/omxiltestmd5param.h>
+
+COmxILTestMD5SinkConfigManager* COmxILTestMD5SinkConfigManager::NewL(
+		const TDesC8& aComponentName,
+		const OMX_VERSIONTYPE& aComponentVersion,
+		const RPointerArray<TDesC8>& aComponentRoles)
+	{
+	COmxILTestMD5SinkConfigManager* self = new(ELeave) COmxILTestMD5SinkConfigManager();
+	CleanupStack::PushL(self);
+	self->ConstructL(aComponentName, aComponentVersion, aComponentRoles);
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+COmxILTestMD5SinkConfigManager::COmxILTestMD5SinkConfigManager()
+	{
+	// nothing to do
+	}
+
+void COmxILTestMD5SinkConfigManager::ConstructL(const TDesC8& aComponentName,
+		const OMX_VERSIONTYPE& aComponentVersion,
+		const RPointerArray<TDesC8>& aComponentRoles)
+	{
+	COmxILConfigManager::ConstructL(aComponentName, aComponentVersion, aComponentRoles);
+	}
+
+COmxILTestMD5SinkConfigManager::~COmxILTestMD5SinkConfigManager()
+	{
+
+	}
+	
+OMX_ERRORTYPE COmxILTestMD5SinkConfigManager::GetParameter(OMX_INDEXTYPE aParamIndex,
+			   TAny* apComponentParameterStructure) const
+	{
+	// try the base class first
+	OMX_ERRORTYPE error = COmxILConfigManager::GetParameter(aParamIndex, apComponentParameterStructure);
+	if(error != OMX_ErrorUnsupportedIndex)
+		{
+		return error;
+		}
+		
+	if(aParamIndex == OMX_IndexParam_Symbian_MD5)
+		{
+		OMX_PARAM_SYMBIAN_MD5TYPE* aMD5Struct = static_cast<OMX_PARAM_SYMBIAN_MD5TYPE*>(apComponentParameterStructure);
+		TPtr8 aDest(aMD5Struct->pHash, 16);
+		aDest = iHash;
+		return OMX_ErrorNone;
+		}
+	
+	return OMX_ErrorUnsupportedIndex;
+	}
+
+OMX_ERRORTYPE COmxILTestMD5SinkConfigManager::SetParameter(OMX_INDEXTYPE aParamIndex,
+			   const TAny* apComponentParameterStructure, OMX_BOOL aInitTime)
+	{
+	// try the base class first
+	OMX_ERRORTYPE error = COmxILConfigManager::SetParameter(aParamIndex, apComponentParameterStructure, aInitTime);
+	if(error != OMX_ErrorUnsupportedIndex)
+		{
+		return error;
+		}
+	
+	return OMX_ErrorUnsupportedIndex;
+	}
+
+void COmxILTestMD5SinkConfigManager::SetHash(const TDesC8& aHash)
+	{
+	iHash = aHash;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxiltestcomp/md5sink/src/omxiltestmd5sinkconfigmanager.h	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,56 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+/**
+@file
+@internalComponent
+*/
+
+#ifndef COMXILTESTMD5SINKCONFIGMANAGER_H_
+#define COMXILTESTMD5SINKCONFIGMANAGER_H_
+
+#include <openmax/il/common/omxilconfigmanager.h>
+
+class COmxILTestMD5SinkConfigManager : public COmxILConfigManager
+	{
+public:
+	static COmxILTestMD5SinkConfigManager* NewL(
+			const TDesC8& aComponentName,
+			const OMX_VERSIONTYPE& aComponentVersion,
+			const RPointerArray<TDesC8>& aComponentRoles);
+	~COmxILTestMD5SinkConfigManager();
+	
+	OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex,
+			   TAny* apComponentParameterStructure) const;
+
+	OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex,
+			   const TAny* apComponentParameterStructure,
+			   OMX_BOOL aInitTime = OMX_TRUE);
+
+	void SetHash(const TDesC8& aHash);
+	
+private:
+	COmxILTestMD5SinkConfigManager();
+	void ConstructL(const TDesC8& aComponentName,
+			const OMX_VERSIONTYPE& aComponentVersion,
+			const RPointerArray<TDesC8>& aComponentRoles);
+	
+	TBuf8<16> iHash;
+	};
+
+#endif //COMXILTESTMD5SINKCONFIGMANAGER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxiltestcomp/md5sink/src/omxiltestmd5sinkconst.h	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,25 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef OMXILTESTMD5SINKCONST_H_
+#define OMXILTESTMD5SINKCONST_H_
+
+const OMX_U32 KMD5SINK_OPB0PORT_INDEX = 0;
+const OMX_U32 KMinBuffers = 1;
+const OMX_U32 KMinBufferSize = 1;
+
+#endif /* OMXILTESTMD5SINKCONST_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxiltestcomp/md5sink/src/omxiltestmd5sinkport.cpp	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,94 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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
+@internalComponent
+*/
+
+#include <openmax/il/common/omxilutil.h>
+#include "omxiltestmd5sinkport.h"
+
+COmxILTestMD5SinkPort* COmxILTestMD5SinkPort::NewL(const TOmxILCommonPortData& aCommonPortData)
+	{
+	COmxILTestMD5SinkPort* self = new(ELeave) COmxILTestMD5SinkPort();
+    CleanupStack::PushL(self);
+    self->ConstructL(aCommonPortData);
+    CleanupStack::Pop(self);
+    return self;	
+	
+	}
+
+void COmxILTestMD5SinkPort::ConstructL(const TOmxILCommonPortData& aCommonPortData)
+    {
+    RArray<OMX_OTHER_FORMATTYPE> supportedOtherFormats;
+    COmxILOtherPort::ConstructL(aCommonPortData, supportedOtherFormats);
+    GetParamPortDefinition().format.other.eFormat = OMX_OTHER_FormatBinary;
+    }
+
+COmxILTestMD5SinkPort::COmxILTestMD5SinkPort()
+	{
+	}
+
+COmxILTestMD5SinkPort::~COmxILTestMD5SinkPort()
+	{
+	// nothing to do
+	}
+	
+OMX_ERRORTYPE COmxILTestMD5SinkPort::GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const
+	{
+	return COmxILOtherPort::GetLocalOmxParamIndexes(aIndexArray);
+	}
+
+OMX_ERRORTYPE COmxILTestMD5SinkPort::GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const
+	{
+    return COmxILOtherPort::GetLocalOmxConfigIndexes(aIndexArray);
+	}
+
+OMX_ERRORTYPE COmxILTestMD5SinkPort::GetParameter(OMX_INDEXTYPE aParamIndex,
+                                               TAny* apComponentParameterStructure) const
+	{
+    return COmxILOtherPort::GetParameter(aParamIndex, apComponentParameterStructure);
+	}
+
+OMX_ERRORTYPE COmxILTestMD5SinkPort::SetParameter(OMX_INDEXTYPE aParamIndex,
+		                                       const TAny* apComponentParameterStructure,
+		                                       TBool& aUpdateProcessingFunction)
+	{
+	return COmxILOtherPort::SetParameter(aParamIndex, apComponentParameterStructure, 
+	        aUpdateProcessingFunction);
+	}
+
+OMX_ERRORTYPE COmxILTestMD5SinkPort::SetFormatInPortDefinition(
+		const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition,
+		TBool& aUpdateProcessingFunction)
+	{
+#ifdef DOMAIN_OTHER
+	GetParamPortDefinition().format.other = aPortDefinition.format.other;
+#endif
+	aUpdateProcessingFunction = EFalse;
+	return OMX_ErrorNone;
+	}
+
+TBool COmxILTestMD5SinkPort::IsTunnelledPortCompatible(
+		const OMX_PARAM_PORTDEFINITIONTYPE& /*aPortDefinition*/) const
+	{
+    // Note to be revisited when stricter port domain checking is introduced as a 
+    // result of current in progress spec. clarrifications. 
+	return ETrue;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxiltestcomp/md5sink/src/omxiltestmd5sinkport.h	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,56 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+/**
+@file
+@internalComponent
+*/
+
+#ifndef COMXILTESTMD5SINKPORT_H
+#define COMXILTESTMD5SINKPORT_H
+
+#include <openmax/il/common/omxilotherport.h>
+
+class COmxILTestMD5SinkPort : public COmxILOtherPort
+	{
+public:
+	static COmxILTestMD5SinkPort* NewL(const TOmxILCommonPortData& aCommonPortData);
+	~COmxILTestMD5SinkPort();
+	
+	OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const;
+	OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const;
+	OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex,
+			                   TAny* apComponentParameterStructure) const;
+	OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex,
+			const TAny* apComponentParameterStructure,
+			TBool& aUpdateProcessingFunction);
+
+protected:
+	OMX_ERRORTYPE SetFormatInPortDefinition(
+		const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition,
+		TBool& aUpdateProcessingFunction);
+	
+	TBool IsTunnelledPortCompatible(
+		const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const;
+
+private:
+	COmxILTestMD5SinkPort();
+	void ConstructL(const TOmxILCommonPortData& aCommonPortData);
+	};
+
+#endif //COMXILTESTMD5SINKPORT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxiltestcomp/md5sink/src/omxiltestmd5sinkprocessingfunction.cpp	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,296 @@
+/*
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+/**
+@file
+@internalComponent
+*/
+
+#include <hash.h>
+#include "omxiltestmd5sinkprocessingfunction.h"
+#include "omxiltestmd5sinkconfigmanager.h"
+#include <openmax/il/common/omxilcallbacknotificationif.h>
+#include "omxiltestmd5sinkconst.h"
+
+enum { KMsgQueueSize = 10 };
+
+COmxILTestMD5SinkProcessingFunction* COmxILTestMD5SinkProcessingFunction::NewL(MOmxILCallbackNotificationIf& aCallbacks)
+	{
+	COmxILTestMD5SinkProcessingFunction* self = new (ELeave) COmxILTestMD5SinkProcessingFunction(aCallbacks);
+	CleanupStack::PushL(self);
+	self->ConstructL(aCallbacks);
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+COmxILTestMD5SinkProcessingFunction::COmxILTestMD5SinkProcessingFunction(MOmxILCallbackNotificationIf& aCallbacks)
+: COmxILProcessingFunction(aCallbacks)
+	{
+	}
+
+void COmxILTestMD5SinkProcessingFunction::ConstructL(MOmxILCallbackNotificationIf& aCallback)
+	{
+	iMD5Active = CMD5Active::NewL(aCallback);
+	iFlushHandler = CFlushActive::NewL(*iMD5Active);
+	}
+
+COmxILTestMD5SinkProcessingFunction::~COmxILTestMD5SinkProcessingFunction()
+	{
+    delete iFlushHandler;
+	delete iMD5Active;
+	}
+
+void COmxILTestMD5SinkProcessingFunction::SetConfigManager(COmxILTestMD5SinkConfigManager* aConfigManager)
+	{
+	iMD5Active->SetConfigManager(aConfigManager);
+	}
+
+OMX_ERRORTYPE COmxILTestMD5SinkProcessingFunction::StateTransitionIndication(TStateIndex /*aNewState*/)
+	{
+    return OMX_ErrorNone;
+	}
+
+OMX_ERRORTYPE COmxILTestMD5SinkProcessingFunction::BufferFlushingIndication(TUint32 aPortIndex, OMX_DIRTYPE aDirection)
+	{
+    if ((aPortIndex != OMX_ALL) && ((aPortIndex != KMD5SINK_OPB0PORT_INDEX) || (aDirection != OMX_DirInput)))
+        {
+        return OMX_ErrorNone;
+        }
+    
+    iFlushHandler->Flush();
+    
+	return OMX_ErrorNone;
+	}
+
+OMX_ERRORTYPE COmxILTestMD5SinkProcessingFunction::ParamIndication(OMX_INDEXTYPE /*aParamIndex*/,
+													const TAny* /*apComponentParameterStructure*/)
+	{
+	return OMX_ErrorNone;
+	}
+
+OMX_ERRORTYPE COmxILTestMD5SinkProcessingFunction::ConfigIndication(OMX_INDEXTYPE /*aConfigIndex*/,
+												 const TAny* /*apComponentConfigStructure*/)
+	{
+	return OMX_ErrorNone;
+	}
+
+OMX_ERRORTYPE COmxILTestMD5SinkProcessingFunction::BufferIndication(OMX_BUFFERHEADERTYPE* apBufferHeader,
+																OMX_DIRTYPE aDirection)			
+	{
+	__ASSERT_ALWAYS(aDirection == OMX_DirInput, User::Invariant());
+	return iMD5Active->DeliverBuffer(apBufferHeader);
+	}
+
+OMX_BOOL COmxILTestMD5SinkProcessingFunction::BufferRemovalIndication(OMX_BUFFERHEADERTYPE* apBufferHeader, OMX_DIRTYPE aDirection)
+	{
+	__ASSERT_ALWAYS(aDirection == OMX_DirInput, User::Invariant());
+	return iMD5Active->RemoveBuffer(apBufferHeader);
+	}
+
+///////////////////////////////////////////////////////////////////////////////////////////
+
+CMD5Active* CMD5Active::NewL(MOmxILCallbackNotificationIf& aCallback)
+	{
+	CMD5Active* self = new(ELeave) CMD5Active(aCallback);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+CMD5Active::CMD5Active(MOmxILCallbackNotificationIf& aCallback):
+CActive(CActive::EPriorityStandard),
+iCallback(aCallback)
+	{
+	CActiveScheduler::Add(this);
+	}
+
+void CMD5Active::ConstructL()
+	{
+	iMD5 = CMD5::NewL();
+	User::LeaveIfError(iBuffers.CreateLocal(KMsgQueueSize));
+	iBuffers.NotifyDataAvailable(iStatus);
+	SetActive();
+	}
+
+CMD5Active::~CMD5Active()
+	{
+	Cancel();
+	delete iMD5;
+	}
+
+void CMD5Active::SetConfigManager(COmxILTestMD5SinkConfigManager* aConfigManager)
+	{
+	iConfigManager = aConfigManager;
+	}
+
+OMX_ERRORTYPE CMD5Active::DeliverBuffer(OMX_BUFFERHEADERTYPE* aBuffer)
+	{
+	TInt aErr = iBuffers.Send(aBuffer);
+	if(aErr == KErrNone)
+		{
+		return OMX_ErrorNone;
+		}
+	else if(aErr == KErrOverflow)
+		{
+		return OMX_ErrorInsufficientResources;
+		}
+	else
+		{
+		return OMX_ErrorUndefined;
+		}
+	}
+
+OMX_BOOL CMD5Active::RemoveBuffer(OMX_BUFFERHEADERTYPE* aBuffer)
+	{
+	TBool removed = EFalse;
+	TRAPD(err, removed = RemoveFromQueueL(iBuffers, aBuffer));
+	if(err)
+		{
+		User::Invariant();
+		}
+	return removed ? OMX_TRUE : OMX_FALSE;
+	}
+
+TBool CMD5Active::RemoveFromQueueL(RMsgQueue<OMX_BUFFERHEADERTYPE*>& aQueue, OMX_BUFFERHEADERTYPE* aBufferHeader)
+	{
+	TBool removed = EFalse;
+	RMsgQueue<OMX_BUFFERHEADERTYPE*> tempQueue;
+	User::LeaveIfError(tempQueue.CreateLocal(KMsgQueueSize));
+	OMX_BUFFERHEADERTYPE* bufferHeader = NULL;
+	while(aQueue.Receive(bufferHeader) != KErrUnderflow)
+		{
+		if(bufferHeader != aBufferHeader)
+			{
+			__ASSERT_ALWAYS(tempQueue.Send(bufferHeader) == KErrNone, User::Invariant());
+			}
+		else
+			{
+			removed = ETrue;
+			}
+		}
+	while(tempQueue.Receive(bufferHeader) != KErrUnderflow)
+		{
+		__ASSERT_ALWAYS(aQueue.Send(bufferHeader) == KErrNone, User::Invariant());
+		}
+	tempQueue.Close();
+	return removed;
+	}
+
+void CMD5Active::RunL()
+	{
+	OMX_BUFFERHEADERTYPE* aBuff;
+	// may have an empty queue despite being notified if a RemoveBuffer() occured in the meantime
+	if(iBuffers.Receive(aBuff) != KErrUnderflow)
+		{	
+		// hash the buffer
+		TPtrC8 aDes(aBuff->pBuffer + aBuff->nOffset, aBuff->nFilledLen);
+		TPtrC8 aHash = iMD5->Hash(aDes);
+		iConfigManager->SetHash(aHash);
+		aBuff->nFilledLen = 0;
+		OMX_U32 flags = aBuff->nFlags;
+		iCallback.BufferDoneNotification(aBuff, KMD5SINK_OPB0PORT_INDEX, OMX_DirInput);
+		if(flags)
+			{
+			iCallback.EventNotification(OMX_EventBufferFlag, 0, flags, NULL);
+			}
+		}	
+	iBuffers.NotifyDataAvailable(iStatus);
+	SetActive();
+	}
+
+void CMD5Active::FlushHeaders()
+    {
+    OMX_BUFFERHEADERTYPE* aBuff;
+    
+    while(iBuffers.Receive(aBuff) == KErrNone)
+        {   
+        aBuff->nFilledLen = 0;
+        iCallback.BufferDoneNotification(aBuff, KMD5SINK_OPB0PORT_INDEX, OMX_DirInput);
+        }
+    }
+
+void CMD5Active::DoCancel()
+	{
+	iBuffers.CancelDataAvailable();
+	}
+
+///////////////////////////////////////////////////////////////////////////////////////////
+
+CFlushActive* CFlushActive::NewL(CMD5Active& aBufferHandler)
+    {
+    CFlushActive* self = new (ELeave) CFlushActive(aBufferHandler);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CFlushActive::CFlushActive(CMD5Active& aBufferHandler):
+CActive(CActive::EPriorityHigh),    // Higher priority than CMD5Active to ensure we run before them when the Active Scheduler is picking who to run next
+iBufferHandler(aBufferHandler)
+    {
+    CActiveScheduler::Add(this);
+    iRunLContext = RThread();
+    iStatus = KRequestPending;
+    SetActive();
+    }
+
+void CFlushActive::ConstructL()
+    {
+    User::LeaveIfError(iWaitSemaphore.CreateLocal(0));
+    }
+
+CFlushActive::~CFlushActive()
+    {
+    Cancel();
+    iRunLContext.Close();
+    iWaitSemaphore.Close(); 
+    }
+
+void CFlushActive::Flush()
+    {
+    RThread currentContext;
+    if (currentContext.Id() == iRunLContext.Id())
+        {
+        // The same context so cannot be running concurrently with CMD5Active::RunL() so safe to drain buffer queue
+        iBufferHandler.FlushHeaders();
+        return;
+        }
+    
+    // Different thread to the one in which the Active objects are running,
+    TRequestStatus* selfStatus = &iStatus;
+    iRunLContext.RequestComplete(selfStatus, KErrNone);
+    iWaitSemaphore.Wait();
+    }
+     
+void CFlushActive::RunL()
+    {
+    // Now sure we are not running concurrently with CMD5Active::RunL()
+    iBufferHandler.FlushHeaders();
+    iStatus = KRequestPending;
+    SetActive();
+    iWaitSemaphore.Signal();
+    }
+
+void CFlushActive::DoCancel()
+    {
+    iWaitSemaphore.Signal();    // Only happens as part of deletion so irrelevant whether we are blocked or not
+    TRequestStatus* selfStatus = &iStatus;
+    User::RequestComplete(selfStatus, KErrNone);
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxiltestcomp/md5sink/src/omxiltestmd5sinkprocessingfunction.h	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,118 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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
+@internalComponent
+*/
+#ifndef COMXILTESTMD5SINKPROCESSINGFUNCTION_H
+#define COMXILTESTMD5SINKPROCESSINGFUNCTION_H
+
+#include <e32base.h>
+#include <e32msgqueue.h>
+#include <f32file.h>
+#include <openmax/il/khronos/v1_x/OMX_Index.h>
+#include <openmax/il/khronos/v1_x/OMX_Component.h>
+#include <openmax/il/common/omxilprocessingfunction.h>
+
+class COmxILTestMD5SinkConfigManager;
+class CMD5Active;
+class CFlushActive;
+
+class COmxILTestMD5SinkProcessingFunction : public COmxILProcessingFunction
+	{
+public:
+	static COmxILTestMD5SinkProcessingFunction* NewL(MOmxILCallbackNotificationIf&);
+	~COmxILTestMD5SinkProcessingFunction();
+
+	void SetConfigManager(COmxILTestMD5SinkConfigManager* aConfigManager);
+	
+	OMX_ERRORTYPE StateTransitionIndication(TStateIndex aNewState);
+	OMX_ERRORTYPE BufferFlushingIndication(TUint32 aPortIndex, OMX_DIRTYPE aDirection);
+	OMX_ERRORTYPE ParamIndication(OMX_INDEXTYPE aParamIndex, const TAny* apComponentParameterStructure);
+	OMX_ERRORTYPE ConfigIndication(OMX_INDEXTYPE aConfigIndex, const TAny* apComponentConfigStructure);
+	OMX_ERRORTYPE BufferIndication(OMX_BUFFERHEADERTYPE* apBufferHeader, OMX_DIRTYPE aDirection);
+	OMX_BOOL BufferRemovalIndication(OMX_BUFFERHEADERTYPE* apBufferHeader, OMX_DIRTYPE aDirection);
+
+private:
+	COmxILTestMD5SinkProcessingFunction(MOmxILCallbackNotificationIf&);
+	void ConstructL(MOmxILCallbackNotificationIf&);
+			
+private:
+	CMD5Active* iMD5Active;
+	CFlushActive* iFlushHandler;
+	};
+
+class CMD5;
+
+class CMD5Active : public CActive
+	{
+public:
+	static CMD5Active* NewL(MOmxILCallbackNotificationIf& aCallback);
+	~CMD5Active();
+	
+	OMX_ERRORTYPE DeliverBuffer(OMX_BUFFERHEADERTYPE*);
+	OMX_BOOL RemoveBuffer(OMX_BUFFERHEADERTYPE*);
+	
+	void FlushHeaders();
+	void SetConfigManager(COmxILTestMD5SinkConfigManager* aConfigManager);
+		
+protected:
+	void RunL();
+	void DoCancel();
+	
+private:
+	CMD5Active(MOmxILCallbackNotificationIf& aCallback);
+	void ConstructL();
+	
+	TBool RemoveFromQueueL(RMsgQueue<OMX_BUFFERHEADERTYPE*>& aQueue, OMX_BUFFERHEADERTYPE* aBufferHeader);
+
+	COmxILTestMD5SinkConfigManager* iConfigManager;
+	RMsgQueue<OMX_BUFFERHEADERTYPE*> iBuffers;
+	MOmxILCallbackNotificationIf& iCallback;
+	CMD5* iMD5;
+	};
+
+/*
+ * Dependant on whether the client has an Active Scheduler or not the active objects may be running in a 
+ * different thread context to that of the caller, in which case for flush to work it needs to run in this
+ * context to ensure we don't complete while CMD5Active::RunL() is executing concurrently which would 
+ * fail the conformance suite and the spec. because we complete the flush call yet still own a buffer.
+ */
+class CFlushActive : public CActive
+    {
+public:
+    static CFlushActive* NewL(CMD5Active& aBufferHandler);
+    ~CFlushActive();
+    
+    void Flush();
+    
+protected:
+    CFlushActive(CMD5Active& aBufferHandler);
+    void ConstructL();
+    
+    void RunL();
+    void DoCancel();
+    
+private:
+    CMD5Active& iBufferHandler;
+    RSemaphore iWaitSemaphore;
+    RThread iRunLContext;
+    };
+
+#endif //COMXILTESTMD5SINKPROCESSINGFUNCTION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/omxilcomp/omxiltestcomp/md5sink/src/omxiltestothermd5sink.rss	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include <ecom/registryinfo.rh>
+#include <openmax/il/loader/omxilcomponentif.hrh>
+#include "omxiltestmd5sink.hrh"
+
+RESOURCE REGISTRY_INFO theInfo
+	{
+	dll_uid = KUidSymbianOmxILTestOtherMD5SinkDll;
+	interfaces =
+		{
+		INTERFACE_INFO
+			{
+			interface_uid = KUidOmxILSymbianComponentIf;
+			implementations =
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid = KUidSymbianOmxILTestOtherMD5Sink;
+					version_no = 1;
+					display_name = "OMX.NOKIA.TEST.OTHER.MD5SINK";
+					default_data = "Symbian OpenMAX IL 1.1.1 Test Other MD5 Sink";
+					}
+				};
+			}
+		};
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/package_definition.xml	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<SystemDefinition schema="3.0.1">
+  <package id="openmaxil.nokia" name="Openmaxil Adaptation" levels="adaptation hw-if device-fw devices middleware app-if">
+
+    <collection id="omxilcomp" name="OpenMAX IL Components" level="adaptation">
+         <component id="omxilgeneric" name="OpenMAX IL generic Components" introduced="^3" purpose="optional" class="plugin">
+        <unit version="1" bldFile="omxilcomp/omxilgeneric/group"/>
+      </component>
+
+          <component id="omxilaudioemulator" name="OpenMAX IL Emulator Components" introduced="^3" purpose="optional" class="plugin">
+        <unit version="1" bldFile="omxilcomp/omxilaudioemulator/group"/>
+      </component>
+
+          <component id="omxiltestcomp" name="OpenMAX IL Test Components" introduced="^3" purpose="development" class="plugin">
+        <unit version="1" bldFile="omxilcomp/omxiltestcomp/group"/>
+      </component>
+    </collection>
+
+  </package>
+</SystemDefinition>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/package_map.xml	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,1 @@
+<PackageMap root="sf" layer="adapt"/>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysdef_1_4_0.dtd	Thu Sep 02 20:13:57 2010 +0300
@@ -0,0 +1,86 @@
+ <!ELEMENT SystemDefinition (systemModel?, build?)>
+ <!ATTLIST SystemDefinition
+  name CDATA #REQUIRED
+  schema CDATA #REQUIRED>
+ <!ELEMENT systemModel (layer+)>
+ <!ELEMENT layer (logicalset* | module*)*>
+ <!ATTLIST layer
+  name CDATA #REQUIRED
+  levels CDATA #IMPLIED
+  span CDATA #IMPLIED>
+ <!ELEMENT logicalset (logicalsubset* | module* | unit* | package* | prebuilt*)*>
+ <!ATTLIST logicalset name CDATA #REQUIRED>
+ <!ELEMENT logicalsubset (module* | unit* | package* | prebuilt*)*>
+ <!ATTLIST logicalsubset name CDATA #REQUIRED>
+ <!ELEMENT module (component* | unit* | package* | prebuilt*)*>
+ <!ATTLIST module
+  name CDATA #REQUIRED
+  level CDATA #IMPLIED>
+ <!ELEMENT component (unit* | package* | prebuilt*)*>
+ <!ATTLIST component name CDATA #REQUIRED>
+ <!ELEMENT unit EMPTY>
+ <!ATTLIST unit
+  unitID ID #REQUIRED
+  name CDATA #REQUIRED
+  mrp CDATA #REQUIRED
+  filter CDATA #IMPLIED
+  bldFile CDATA #REQUIRED
+  priority CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT package EMPTY>
+ <!ATTLIST package
+  name CDATA #REQUIRED
+  mrp CDATA #REQUIRED
+  filter CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT prebuilt EMPTY>
+ <!ATTLIST prebuilt
+  name CDATA #REQUIRED
+  version CDATA #REQUIRED
+  late (Y|N) #IMPLIED
+  filter CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT build (option* | target+ | targetList+ | unitList+ | configuration+)*>
+ <!ELEMENT unitList (unitRef+)>
+ <!ATTLIST unitList
+  name ID #REQUIRED
+  description CDATA #REQUIRED>
+ <!ELEMENT unitRef EMPTY>
+ <!ATTLIST unitRef unit IDREF #REQUIRED>
+ <!ELEMENT targetList EMPTY>
+ <!ATTLIST targetList
+  name ID #REQUIRED
+  description CDATA #REQUIRED
+  target IDREFS #REQUIRED>
+ <!ELEMENT target EMPTY>
+ <!ATTLIST target
+  name ID #REQUIRED
+  abldTarget CDATA #REQUIRED
+  description CDATA #REQUIRED>
+ <!ELEMENT option EMPTY>
+ <!ATTLIST option
+  name ID #REQUIRED
+  abldOption CDATA #REQUIRED
+  description CDATA #REQUIRED
+  enable (Y | N | y | n) #REQUIRED>
+ <!ELEMENT configuration (unitListRef+ | layerRef+ | task+)*>
+ <!ATTLIST configuration
+  name ID #REQUIRED
+  description CDATA #REQUIRED
+  filter CDATA #REQUIRED>
+ <!ELEMENT task ( unitListRef* , (buildLayer | specialInstructions))>
+ <!ELEMENT unitListRef EMPTY>
+ <!ATTLIST unitListRef unitList IDREF #REQUIRED>
+ <!ELEMENT layerRef EMPTY>
+ <!ATTLIST layerRef layerName CDATA #REQUIRED>
+ <!ELEMENT buildLayer EMPTY>
+ <!ATTLIST buildLayer
+  command CDATA #REQUIRED
+  targetList IDREFS #IMPLIED
+  unitParallel (Y | N | y | n) #REQUIRED
+  targetParallel (Y | N | y | n) #IMPLIED>
+ <!ELEMENT specialInstructions EMPTY>
+ <!ATTLIST specialInstructions
+  name CDATA #REQUIRED
+  cwd CDATA #REQUIRED
+  command CDATA #REQUIRED>