--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bld.inf Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,22 @@
+// Copyright (c) 2008-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 "openmaxil_plat/khronos_api/group/bld.inf"
+#include "openmaxil_plat/symbian_api/group/bld.inf"
+#include "openmaxil_plat/test_api/group/bld.inf"
+#include "omxil_generic/omxilcomplib/group/bld.inf"
+#include "omxil_generic/omxilcore/group/bld.inf"
+#include "omxil_generic/omxilloader/group/bld.inf"
+
+#include "tsrc/xmltestharness/group/bld.inf"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/build.config.xml Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,46 @@
+<?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: Build configuration for use by Sirocco
+
+-->
+
+<!DOCTYPE SystemDefinition SYSTEM "sysdef_1_4_0.dtd" [
+ <!ENTITY layer_real_source_path "/sf/os/openmaxil" >
+]>
+
+<SystemDefinition name="openmaxil" schema="1.4.0">
+ <systemModel>
+ <layer name="os_layer">
+ <module name="openmaxil">
+ <component name="openmaxil_plat">
+ <unit unitID="openmaxil_plat.khronos_api" name="OpenMAX IL API" mrp="" bldFile="&layer_real_source_path;/openmaxil_plat/khronos_api/group"/>
+ <unit unitID="openmaxil_plat.symbian_api" name="OpenMAX IL Symbian API" mrp="" bldFile="&layer_real_source_path;/openmaxil_plat/symbian_api/group"/>
+ <unit unitID="openmaxil_plat.test_api" name="OpenMAX IL Symbian API" mrp="" bldFile="&layer_real_source_path;/openmaxil_plat/test_api/group"/>
+ </component>
+
+ <component name="openmaxil_generic">
+ <unit unitID="openmaxil_generic.omxilcomplib" name="OpenMAX IL Component Framework" mrp="" bldFile="&layer_real_source_path;/omxil_generic/omxilcomplib/group"/>
+ <unit unitID="openmaxil_generic.omxilcore" name="OpenMAX IL Core" mrp="" bldFile="&layer_real_source_path;/omxil_generic/omxilcore/group"/>
+ <unit unitID="openmaxil_generic.omxilloader" name="OpenMAX IL Loader" mrp="" bldFile="&layer_real_source_path;/omxil_generic/omxilloader/group"/>
+ </component>
+
+ <component name="tsrc">
+ <unit unitID="tsrc.xmltestharness" name="OpenMAX IL xmlclient" mrp="" bldFile="&layer_real_source_path;/tsrc/xmltestharness/group"/>
+ </component>
+ </module>
+ </layer>
+ </systemModel>
+</SystemDefinition>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/bwins/omxilcomponentcommon.def Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,201 @@
+EXPORTS
+ ?ManagedConfigIndexes@COmxILConfigManager@@IAEAAV?$RArray@I@@XZ @ 1 NONAME ; class RArray<unsigned int> & COmxILConfigManager::ManagedConfigIndexes(void)
+ ?DoBufferAllocation@COmxILAudioPort@@MAE?AW4OMX_ERRORTYPE@@KAAPAEAAPAX1PAX@Z @ 2 NONAME ; enum OMX_ERRORTYPE COmxILAudioPort::DoBufferAllocation(unsigned long, unsigned char * &, void * &, void * &, void *)
+ ?SetConfig@COmxILConfigManager@@UAE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PBX@Z @ 3 NONAME ; enum OMX_ERRORTYPE COmxILConfigManager::SetConfig(enum OMX_INDEXTYPE, void const *)
+ ?FindConfigIndex@COmxILConfigManager@@QBEHI@Z @ 4 NONAME ; int COmxILConfigManager::FindConfigIndex(unsigned int) const
+ ?IsBufferAtHome@COmxILVideoPort@@UBEHPAUOMX_BUFFERHEADERTYPE@@@Z @ 5 NONAME ; int COmxILVideoPort::IsBufferAtHome(struct OMX_BUFFERHEADERTYPE *) const
+ ?FreeTunnel@COmxILVideoPort@@UAE?AW4OMX_ERRORTYPE@@AAH@Z @ 6 NONAME ; enum OMX_ERRORTYPE COmxILVideoPort::FreeTunnel(int &)
+ ?SetBufferReturned@COmxILOtherPort@@UAEHPAUOMX_BUFFERHEADERTYPE@@@Z @ 7 NONAME ; int COmxILOtherPort::SetBufferReturned(struct OMX_BUFFERHEADERTYPE *)
+ ??0COmxILVideoPort@@IAE@XZ @ 8 NONAME ; COmxILVideoPort::COmxILVideoPort(void)
+ ?GetConfigManager@COmxILComponent@@IBEPAVCOmxILConfigManager@@XZ @ 9 NONAME ; class COmxILConfigManager * COmxILComponent::GetConfigManager(void) const
+ ?GetSupportedColorFormats@COmxILImagePort@@IAEAAV?$RArray@W4OMX_COLOR_FORMATTYPE@@@@XZ @ 10 NONAME ; class RArray<enum OMX_COLOR_FORMATTYPE> & COmxILImagePort::GetSupportedColorFormats(void)
+ ?GetParameter@COmxILOtherPort@@UBE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PAX@Z @ 11 NONAME ; enum OMX_ERRORTYPE COmxILOtherPort::GetParameter(enum OMX_INDEXTYPE, void *) const
+ ?SetBufferReturned@COmxILAudioPort@@UAEHPAUOMX_BUFFERHEADERTYPE@@@Z @ 12 NONAME ; int COmxILAudioPort::SetBufferReturned(struct OMX_BUFFERHEADERTYPE *)
+ ?SetTransitionToDisabled@COmxILVideoPort@@UAEXXZ @ 13 NONAME ; void COmxILVideoPort::SetTransitionToDisabled(void)
+ ?GetSupportedOtherFormats@COmxILOtherPort@@IAEAAV?$RArray@W4OMX_OTHER_FORMATTYPE@@@@XZ @ 14 NONAME ; class RArray<enum OMX_OTHER_FORMATTYPE> & COmxILOtherPort::GetSupportedOtherFormats(void)
+ ?FreeTunnel@COmxILImagePort@@UAE?AW4OMX_ERRORTYPE@@AAH@Z @ 15 NONAME ; enum OMX_ERRORTYPE COmxILImagePort::FreeTunnel(int &)
+ ?SetConfig@COmxILImagePort@@UAE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PBXAAH@Z @ 16 NONAME ; enum OMX_ERRORTYPE COmxILImagePort::SetConfig(enum OMX_INDEXTYPE, void const *, int &)
+ ?ConstructL@COmxILOtherPort@@IAEXABVTOmxILCommonPortData@@ABV?$RArray@W4OMX_OTHER_FORMATTYPE@@@@@Z @ 17 NONAME ; void COmxILOtherPort::ConstructL(class TOmxILCommonPortData const &, class RArray<enum OMX_OTHER_FORMATTYPE> const &)
+ ?GetParamOtherPortFormat@COmxILOtherPort@@IAEAAUOMX_OTHER_PARAM_PORTFORMATTYPE@@XZ @ 18 NONAME ; struct OMX_OTHER_PARAM_PORTFORMATTYPE & COmxILOtherPort::GetParamOtherPortFormat(void)
+ ??1COmxILImagePort@@UAE@XZ @ 19 NONAME ; COmxILImagePort::~COmxILImagePort(void)
+ ?TunnelRequest@COmxILVideoPort@@UAE?AW4OMX_ERRORTYPE@@PAXKPAUOMX_TUNNELSETUPTYPE@@@Z @ 20 NONAME ; enum OMX_ERRORTYPE COmxILVideoPort::TunnelRequest(void *, unsigned long, struct OMX_TUNNELSETUPTYPE *)
+ ??0COmxILAudioPort@@IAE@XZ @ 21 NONAME ; COmxILAudioPort::COmxILAudioPort(void)
+ ?GetExtensionIndex@COmxILAudioPort@@UBE?AW4OMX_ERRORTYPE@@PADPAW4OMX_INDEXTYPE@@@Z @ 22 NONAME ; enum OMX_ERRORTYPE COmxILAudioPort::GetExtensionIndex(char *, enum OMX_INDEXTYPE *) const
+ ?FreeBuffer@COmxILOtherPort@@UAE?AW4OMX_ERRORTYPE@@PAUOMX_BUFFERHEADERTYPE@@AAH@Z @ 23 NONAME ; enum OMX_ERRORTYPE COmxILOtherPort::FreeBuffer(struct OMX_BUFFERHEADERTYPE *, int &)
+ ?SetTransitionToEnabledCompleted@COmxILOtherPort@@UAEXXZ @ 24 NONAME ; void COmxILOtherPort::SetTransitionToEnabledCompleted(void)
+ ?PopulateTunnel@COmxILOtherPort@@UAE?AW4OMX_ERRORTYPE@@AAH@Z @ 25 NONAME ; enum OMX_ERRORTYPE COmxILOtherPort::PopulateTunnel(int &)
+ ?HasAllBuffersAtHome@COmxILImagePort@@UBEHXZ @ 26 NONAME ; int COmxILImagePort::HasAllBuffersAtHome(void) const
+ ?GetParamImagePortFormat@COmxILImagePort@@IBEABUOMX_IMAGE_PARAM_PORTFORMATTYPE@@XZ @ 27 NONAME ; struct OMX_IMAGE_PARAM_PORTFORMATTYPE const & COmxILImagePort::GetParamImagePortFormat(void) const
+ ?SetTransitionToDisabled@COmxILAudioPort@@UAEXXZ @ 28 NONAME ; void COmxILAudioPort::SetTransitionToDisabled(void)
+ ?RegisterProcessingFunction@COmxILComponent@@IAEXPBVCOmxILProcessingFunction@@@Z @ 29 NONAME ; void COmxILComponent::RegisterProcessingFunction(class COmxILProcessingFunction const *)
+ ?SymbianErrorToGetHandleError@COmxILComponent@@SA?AW4OMX_ERRORTYPE@@H@Z @ 30 NONAME ; enum OMX_ERRORTYPE COmxILComponent::SymbianErrorToGetHandleError(int)
+ ?GetTunnelledPort@COmxILPort@@IBEABKXZ @ 31 NONAME ; unsigned long const & COmxILPort::GetTunnelledPort(void) const
+ ?StoreBufferMark@COmxILVideoPort@@UAE?AW4OMX_ERRORTYPE@@PBUOMX_MARKTYPE@@@Z @ 32 NONAME ; enum OMX_ERRORTYPE COmxILVideoPort::StoreBufferMark(struct OMX_MARKTYPE const *)
+ ?DoBufferUnwrapping@COmxILImagePort@@MAEXPAX000@Z @ 33 NONAME ; void COmxILImagePort::DoBufferUnwrapping(void *, void *, void *, void *)
+ ?DoBufferWrapping@COmxILAudioPort@@MAE?AW4OMX_ERRORTYPE@@KPAEAAPAX1PAX@Z @ 34 NONAME ; enum OMX_ERRORTYPE COmxILAudioPort::DoBufferWrapping(unsigned long, unsigned char *, void * &, void * &, void *)
+ ?FreeBuffer@COmxILAudioPort@@UAE?AW4OMX_ERRORTYPE@@PAUOMX_BUFFERHEADERTYPE@@AAH@Z @ 35 NONAME ; enum OMX_ERRORTYPE COmxILAudioPort::FreeBuffer(struct OMX_BUFFERHEADERTYPE *, int &)
+ ?DoBufferAllocation@COmxILVideoPort@@MAE?AW4OMX_ERRORTYPE@@KAAPAEAAPAX1PAX@Z @ 36 NONAME ; enum OMX_ERRORTYPE COmxILVideoPort::DoBufferAllocation(unsigned long, unsigned char * &, void * &, void * &, void *)
+ ?ComponentRoleIndication@COmxILProcessingFunction@@UAE?AW4OMX_ERRORTYPE@@I@Z @ 37 NONAME ; enum OMX_ERRORTYPE COmxILProcessingFunction::ComponentRoleIndication(unsigned int)
+ ?PopulateBuffer@COmxILImagePort@@UAE?AW4OMX_ERRORTYPE@@PAPAUOMX_BUFFERHEADERTYPE@@PAXKPAEAAH@Z @ 38 NONAME ; enum OMX_ERRORTYPE COmxILImagePort::PopulateBuffer(struct OMX_BUFFERHEADERTYPE * *, void *, unsigned long, unsigned char *, int &)
+ ?DoBufferDeallocation@COmxILImagePort@@MAEXPAX000@Z @ 39 NONAME ; void COmxILImagePort::DoBufferDeallocation(void *, void *, void *, void *)
+ ?ConstructL@COmxILComponent@@MAEXPAX@Z @ 40 NONAME ; void COmxILComponent::ConstructL(void *)
+ ?SetBufferSent@COmxILOtherPort@@UAEHPAUOMX_BUFFERHEADERTYPE@@AAH@Z @ 41 NONAME ; int COmxILOtherPort::SetBufferSent(struct OMX_BUFFERHEADERTYPE *, int &)
+ ?GetSupportedColorFormats@COmxILVideoPort@@IAEAAV?$RArray@W4OMX_COLOR_FORMATTYPE@@@@XZ @ 42 NONAME ; class RArray<enum OMX_COLOR_FORMATTYPE> & COmxILVideoPort::GetSupportedColorFormats(void)
+ ?FreeBuffer@COmxILImagePort@@UAE?AW4OMX_ERRORTYPE@@PAUOMX_BUFFERHEADERTYPE@@AAH@Z @ 43 NONAME ; enum OMX_ERRORTYPE COmxILImagePort::FreeBuffer(struct OMX_BUFFERHEADERTYPE *, int &)
+ ?GetSupportedImageFormats@COmxILImagePort@@IBEABV?$RArray@W4OMX_IMAGE_CODINGTYPE@@@@XZ @ 44 NONAME ; class RArray<enum OMX_IMAGE_CODINGTYPE> const & COmxILImagePort::GetSupportedImageFormats(void) const
+ ?Extension_@COmxILPort@@MAEHIAAPAXPAX@Z @ 45 NONAME ; int COmxILPort::Extension_(unsigned int, void * &, void *)
+ ?SetTransitionToEnabled@COmxILVideoPort@@UAEXXZ @ 46 NONAME ; void COmxILVideoPort::SetTransitionToEnabled(void)
+ ??0TOmxILCommonPortData@@QAE@TOMX_VERSIONTYPE@@KW4OMX_DIRTYPE@@KKW4OMX_PORTDOMAINTYPE@@W4OMX_BOOL@@KW4OMX_BUFFERSUPPLIERTYPE@@K@Z @ 47 NONAME ; TOmxILCommonPortData::TOmxILCommonPortData(union OMX_VERSIONTYPE, unsigned long, enum OMX_DIRTYPE, unsigned long, unsigned long, enum OMX_PORTDOMAINTYPE, enum OMX_BOOL, unsigned long, enum OMX_BUFFERSUPPLIERTYPE, unsigned long)
+ ?SetTransitionToDisabledCompleted@COmxILVideoPort@@UAEXXZ @ 48 NONAME ; void COmxILVideoPort::SetTransitionToDisabledCompleted(void)
+ ?ConstructL@COmxILAudioPort@@IAEXABVTOmxILCommonPortData@@ABV?$RArray@W4OMX_AUDIO_CODINGTYPE@@@@@Z @ 49 NONAME ; void COmxILAudioPort::ConstructL(class TOmxILCommonPortData const &, class RArray<enum OMX_AUDIO_CODINGTYPE> const &)
+ ?GetConfig@COmxILConfigManager@@UBE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PAX@Z @ 50 NONAME ; enum OMX_ERRORTYPE COmxILConfigManager::GetConfig(enum OMX_INDEXTYPE, void *) const
+ ?GetSupportedVideoFormats@COmxILVideoPort@@IAEAAV?$RArray@W4OMX_VIDEO_CODINGTYPE@@@@XZ @ 51 NONAME ; class RArray<enum OMX_VIDEO_CODINGTYPE> & COmxILVideoPort::GetSupportedVideoFormats(void)
+ ?SetParameter@COmxILConfigManager@@UAE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PBXW4OMX_BOOL@@@Z @ 52 NONAME ; enum OMX_ERRORTYPE COmxILConfigManager::SetParameter(enum OMX_INDEXTYPE, void const *, enum OMX_BOOL)
+ ?InitComponentL@COmxILComponent@@IAEXXZ @ 53 NONAME ; void COmxILComponent::InitComponentL(void)
+ ?DoBufferUnwrapping@COmxILAudioPort@@MAEXPAX000@Z @ 54 NONAME ; void COmxILAudioPort::DoBufferUnwrapping(void *, void *, void *, void *)
+ ?NewL@COmxILConfigManager@@SAPAV1@ABVTDesC8@@ABTOMX_VERSIONTYPE@@ABV?$RPointerArray@VTDesC8@@@@@Z @ 55 NONAME ; class COmxILConfigManager * COmxILConfigManager::NewL(class TDesC8 const &, union OMX_VERSIONTYPE const &, class RPointerArray<class TDesC8> const &)
+ ?DoBufferWrapping@COmxILOtherPort@@MAE?AW4OMX_ERRORTYPE@@KPAEAAPAX1PAX@Z @ 56 NONAME ; enum OMX_ERRORTYPE COmxILOtherPort::DoBufferWrapping(unsigned long, unsigned char *, void * &, void * &, void *)
+ ?ConstructL@COmxILImagePort@@IAEXABVTOmxILCommonPortData@@ABV?$RArray@W4OMX_IMAGE_CODINGTYPE@@@@ABV?$RArray@W4OMX_COLOR_FORMATTYPE@@@@@Z @ 57 NONAME ; void COmxILImagePort::ConstructL(class TOmxILCommonPortData const &, class RArray<enum OMX_IMAGE_CODINGTYPE> const &, class RArray<enum OMX_COLOR_FORMATTYPE> const &)
+ ?FreeTunnel@COmxILAudioPort@@UAE?AW4OMX_ERRORTYPE@@AAH@Z @ 58 NONAME ; enum OMX_ERRORTYPE COmxILAudioPort::FreeTunnel(int &)
+ ?DoOmxUseBuffer@COmxILAudioPort@@MAE?AW4OMX_ERRORTYPE@@PAXPAPAUOMX_BUFFERHEADERTYPE@@K00KPAE@Z @ 59 NONAME ; enum OMX_ERRORTYPE COmxILAudioPort::DoOmxUseBuffer(void *, struct OMX_BUFFERHEADERTYPE * *, unsigned long, void *, void *, unsigned long, unsigned char *)
+ ?DoBufferAllocation@COmxILImagePort@@MAE?AW4OMX_ERRORTYPE@@KAAPAEAAPAX1PAX@Z @ 60 NONAME ; enum OMX_ERRORTYPE COmxILImagePort::DoBufferAllocation(unsigned long, unsigned char * &, void * &, void * &, void *)
+ ?SetBufferReturned@COmxILImagePort@@UAEHPAUOMX_BUFFERHEADERTYPE@@@Z @ 61 NONAME ; int COmxILImagePort::SetBufferReturned(struct OMX_BUFFERHEADERTYPE *)
+ ?GetExtensionIndex@COmxILVideoPort@@UBE?AW4OMX_ERRORTYPE@@PADPAW4OMX_INDEXTYPE@@@Z @ 62 NONAME ; enum OMX_ERRORTYPE COmxILVideoPort::GetExtensionIndex(char *, enum OMX_INDEXTYPE *) const
+ ?GetConfig@COmxILVideoPort@@UBE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PAX@Z @ 63 NONAME ; enum OMX_ERRORTYPE COmxILVideoPort::GetConfig(enum OMX_INDEXTYPE, void *) const
+ ?SetTransitionToEnabled@COmxILAudioPort@@UAEXXZ @ 64 NONAME ; void COmxILAudioPort::SetTransitionToEnabled(void)
+ ?SetParameter@COmxILVideoPort@@UAE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PBXAAH@Z @ 65 NONAME ; enum OMX_ERRORTYPE COmxILVideoPort::SetParameter(enum OMX_INDEXTYPE, void const *, int &)
+ ?PopulateBuffer@COmxILVideoPort@@UAE?AW4OMX_ERRORTYPE@@PAPAUOMX_BUFFERHEADERTYPE@@PAXKPAEAAH@Z @ 66 NONAME ; enum OMX_ERRORTYPE COmxILVideoPort::PopulateBuffer(struct OMX_BUFFERHEADERTYPE * *, void *, unsigned long, unsigned char *, int &)
+ ?SetTransitionToDisabledCompleted@COmxILAudioPort@@UAEXXZ @ 67 NONAME ; void COmxILAudioPort::SetTransitionToDisabledCompleted(void)
+ ?MediaTimeIndication@COmxILProcessingFunction@@UAE?AW4OMX_ERRORTYPE@@ABUOMX_TIME_MEDIATIMETYPE@@@Z @ 68 NONAME ; enum OMX_ERRORTYPE COmxILProcessingFunction::MediaTimeIndication(struct OMX_TIME_MEDIATIMETYPE const &)
+ ?DoBufferDeallocation@COmxILAudioPort@@MAEXPAX000@Z @ 69 NONAME ; void COmxILAudioPort::DoBufferDeallocation(void *, void *, void *, void *)
+ ?GetLocalOmxParamIndexes@COmxILAudioPort@@UBE?AW4OMX_ERRORTYPE@@AAV?$RArray@I@@@Z @ 70 NONAME ; enum OMX_ERRORTYPE COmxILAudioPort::GetLocalOmxParamIndexes(class RArray<unsigned int> &) const
+ ??0COmxILConfigManager@@IAE@XZ @ 71 NONAME ; COmxILConfigManager::COmxILConfigManager(void)
+ ??0COmxILOtherPort@@IAE@XZ @ 72 NONAME ; COmxILOtherPort::COmxILOtherPort(void)
+ ??0TOmxILSpecVersion@@QAE@XZ @ 73 NONAME ; TOmxILSpecVersion::TOmxILSpecVersion(void)
+ ??1COmxILVideoPort@@UAE@XZ @ 74 NONAME ; COmxILVideoPort::~COmxILVideoPort(void)
+ ?SetBufferSent@COmxILImagePort@@UAEHPAUOMX_BUFFERHEADERTYPE@@AAH@Z @ 75 NONAME ; int COmxILImagePort::SetBufferSent(struct OMX_BUFFERHEADERTYPE *, int &)
+ ?SetTransitionToDisabled@COmxILOtherPort@@UAEXXZ @ 76 NONAME ; void COmxILOtherPort::SetTransitionToDisabled(void)
+ ?GetParameter@COmxILVideoPort@@UBE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PAX@Z @ 77 NONAME ; enum OMX_ERRORTYPE COmxILVideoPort::GetParameter(enum OMX_INDEXTYPE, void *) const
+ ?GetHandle@COmxILComponent@@IBEPAUOMX_COMPONENTTYPE@@XZ @ 78 NONAME ; struct OMX_COMPONENTTYPE * COmxILComponent::GetHandle(void) const
+ ?PopulateBuffer@COmxILOtherPort@@UAE?AW4OMX_ERRORTYPE@@PAPAUOMX_BUFFERHEADERTYPE@@PAXKPAEAAH@Z @ 79 NONAME ; enum OMX_ERRORTYPE COmxILOtherPort::PopulateBuffer(struct OMX_BUFFERHEADERTYPE * *, void *, unsigned long, unsigned char *, int &)
+ ?HasAllBuffersAtHome@COmxILVideoPort@@UBEHXZ @ 80 NONAME ; int COmxILVideoPort::HasAllBuffersAtHome(void) const
+ ?SetTransitionToEnabledCompleted@COmxILImagePort@@UAEXXZ @ 81 NONAME ; void COmxILImagePort::SetTransitionToEnabledCompleted(void)
+ ?DoPortReconfiguration@COmxILAudioPort@@UAE?AW4OMX_ERRORTYPE@@IABVTDesC8@@AAW4OMX_EVENTTYPE@@@Z @ 82 NONAME ; enum OMX_ERRORTYPE COmxILAudioPort::DoPortReconfiguration(unsigned int, class TDesC8 const &, enum OMX_EVENTTYPE &)
+ ?IsBufferAtHome@COmxILOtherPort@@UBEHPAUOMX_BUFFERHEADERTYPE@@@Z @ 83 NONAME ; int COmxILOtherPort::IsBufferAtHome(struct OMX_BUFFERHEADERTYPE *) const
+ ?DoBufferUnwrapping@COmxILVideoPort@@MAEXPAX000@Z @ 84 NONAME ; void COmxILVideoPort::DoBufferUnwrapping(void *, void *, void *, void *)
+ ?GetParamImagePortFormat@COmxILImagePort@@IAEAAUOMX_IMAGE_PARAM_PORTFORMATTYPE@@XZ @ 85 NONAME ; struct OMX_IMAGE_PARAM_PORTFORMATTYPE & COmxILImagePort::GetParamImagePortFormat(void)
+ ?SetParameter@COmxILOtherPort@@UAE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PBXAAH@Z @ 86 NONAME ; enum OMX_ERRORTYPE COmxILOtherPort::SetParameter(enum OMX_INDEXTYPE, void const *, int &)
+ ?Extension_@COmxILConfigManager@@MAEHIAAPAXPAX@Z @ 87 NONAME ; int COmxILConfigManager::Extension_(unsigned int, void * &, void *)
+ ??1COmxILAudioPort@@UAE@XZ @ 88 NONAME ; COmxILAudioPort::~COmxILAudioPort(void)
+ ?IsBufferAtHome@COmxILAudioPort@@UBEHPAUOMX_BUFFERHEADERTYPE@@@Z @ 89 NONAME ; int COmxILAudioPort::IsBufferAtHome(struct OMX_BUFFERHEADERTYPE *) const
+ ?SetParameter@COmxILAudioPort@@UAE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PBXAAH@Z @ 90 NONAME ; enum OMX_ERRORTYPE COmxILAudioPort::SetParameter(enum OMX_INDEXTYPE, void const *, int &)
+ ?DoBufferAllocation@COmxILOtherPort@@MAE?AW4OMX_ERRORTYPE@@KAAPAEAAPAX1PAX@Z @ 91 NONAME ; enum OMX_ERRORTYPE COmxILOtherPort::DoBufferAllocation(unsigned long, unsigned char * &, void * &, void * &, void *)
+ ?GetParamPortDefinition@COmxILPort@@IBEABUOMX_PARAM_PORTDEFINITIONTYPE@@XZ @ 92 NONAME ; struct OMX_PARAM_PORTDEFINITIONTYPE const & COmxILPort::GetParamPortDefinition(void) const
+ ?DoBufferWrapping@COmxILImagePort@@MAE?AW4OMX_ERRORTYPE@@KPAEAAPAX1PAX@Z @ 93 NONAME ; enum OMX_ERRORTYPE COmxILImagePort::DoBufferWrapping(unsigned long, unsigned char *, void * &, void * &, void *)
+ ?GetLocalOmxConfigIndexes@COmxILAudioPort@@UBE?AW4OMX_ERRORTYPE@@AAV?$RArray@I@@@Z @ 94 NONAME ; enum OMX_ERRORTYPE COmxILAudioPort::GetLocalOmxConfigIndexes(class RArray<unsigned int> &) const
+ ?HasAllBuffersAtHome@COmxILAudioPort@@UBEHXZ @ 95 NONAME ; int COmxILAudioPort::HasAllBuffersAtHome(void) const
+ ??1COmxILConfigManager@@UAE@XZ @ 96 NONAME ; COmxILConfigManager::~COmxILConfigManager(void)
+ ?DoBufferDeallocation@COmxILVideoPort@@MAEXPAX000@Z @ 97 NONAME ; void COmxILVideoPort::DoBufferDeallocation(void *, void *, void *, void *)
+ ?ConstructL@COmxILConfigManager@@IAEXABVTDesC8@@ABTOMX_VERSIONTYPE@@ABV?$RPointerArray@VTDesC8@@@@@Z @ 98 NONAME ; void COmxILConfigManager::ConstructL(class TDesC8 const &, union OMX_VERSIONTYPE const &, class RPointerArray<class TDesC8> const &)
+ ?FreeTunnel@COmxILOtherPort@@UAE?AW4OMX_ERRORTYPE@@AAH@Z @ 99 NONAME ; enum OMX_ERRORTYPE COmxILOtherPort::FreeTunnel(int &)
+ ?GetConfig@COmxILAudioPort@@UBE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PAX@Z @ 100 NONAME ; enum OMX_ERRORTYPE COmxILAudioPort::GetConfig(enum OMX_INDEXTYPE, void *) const
+ ?NewL@COmxILClientClockPort@@SAPAV1@ABVTOmxILCommonPortData@@ABV?$RArray@W4OMX_OTHER_FORMATTYPE@@@@@Z @ 101 NONAME ; class COmxILClientClockPort * COmxILClientClockPort::NewL(class TOmxILCommonPortData const &, class RArray<enum OMX_OTHER_FORMATTYPE> const &)
+ ?GetAppData@COmxILComponent@@IBEPAXXZ @ 102 NONAME ; void * COmxILComponent::GetAppData(void) const
+ ?GetConfig@COmxILImagePort@@UBE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PAX@Z @ 103 NONAME ; enum OMX_ERRORTYPE COmxILImagePort::GetConfig(enum OMX_INDEXTYPE, void *) const
+ ?Extension_@COmxILOtherPort@@MAEHIAAPAXPAX@Z @ 104 NONAME ; int COmxILOtherPort::Extension_(unsigned int, void * &, void *)
+ ?GetExtensionIndex@COmxILConfigManager@@UBE?AW4OMX_ERRORTYPE@@PADPAW4OMX_INDEXTYPE@@@Z @ 105 NONAME ; enum OMX_ERRORTYPE COmxILConfigManager::GetExtensionIndex(char *, enum OMX_INDEXTYPE *) const
+ ?GetLocalOmxParamIndexes@COmxILVideoPort@@UBE?AW4OMX_ERRORTYPE@@AAV?$RArray@I@@@Z @ 106 NONAME ; enum OMX_ERRORTYPE COmxILVideoPort::GetLocalOmxParamIndexes(class RArray<unsigned int> &) const
+ ?TunnelRequest@COmxILOtherPort@@UAE?AW4OMX_ERRORTYPE@@PAXKPAUOMX_TUNNELSETUPTYPE@@@Z @ 107 NONAME ; enum OMX_ERRORTYPE COmxILOtherPort::TunnelRequest(void *, unsigned long, struct OMX_TUNNELSETUPTYPE *)
+ ?Extension_@COmxILAudioPort@@MAEHIAAPAXPAX@Z @ 108 NONAME ; int COmxILAudioPort::Extension_(unsigned int, void * &, void *)
+ ?SetBufferReturned@COmxILVideoPort@@UAEHPAUOMX_BUFFERHEADERTYPE@@@Z @ 109 NONAME ; int COmxILVideoPort::SetBufferReturned(struct OMX_BUFFERHEADERTYPE *)
+ ??0COmxILComponent@@IAE@XZ @ 110 NONAME ; COmxILComponent::COmxILComponent(void)
+ ?GetCallbacks@COmxILComponent@@IBEPAUOMX_CALLBACKTYPE@@XZ @ 111 NONAME ; struct OMX_CALLBACKTYPE * COmxILComponent::GetCallbacks(void) const
+ ?SetConfig@COmxILVideoPort@@UAE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PBXAAH@Z @ 112 NONAME ; enum OMX_ERRORTYPE COmxILVideoPort::SetConfig(enum OMX_INDEXTYPE, void const *, int &)
+ ?CreatePortManagerL@COmxILComponent@@IAEXW4TPortManagerType@1@ABTOMX_VERSIONTYPE@@KKKKKKKKW4OMX_BOOL@@@Z @ 113 NONAME ; void COmxILComponent::CreatePortManagerL(enum COmxILComponent::TPortManagerType, union OMX_VERSIONTYPE const &, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, enum OMX_BOOL)
+ ?GetSupportedColorFormats@COmxILImagePort@@IBEABV?$RArray@W4OMX_COLOR_FORMATTYPE@@@@XZ @ 114 NONAME ; class RArray<enum OMX_COLOR_FORMATTYPE> const & COmxILImagePort::GetSupportedColorFormats(void) const
+ ?PopulateTunnel@COmxILVideoPort@@UAE?AW4OMX_ERRORTYPE@@AAH@Z @ 115 NONAME ; enum OMX_ERRORTYPE COmxILVideoPort::PopulateTunnel(int &)
+ ?StoreBufferMark@COmxILImagePort@@UAE?AW4OMX_ERRORTYPE@@PBUOMX_MARKTYPE@@@Z @ 116 NONAME ; enum OMX_ERRORTYPE COmxILImagePort::StoreBufferMark(struct OMX_MARKTYPE const *)
+ ?SetTransitionToEnabled@COmxILOtherPort@@UAEXXZ @ 117 NONAME ; void COmxILOtherPort::SetTransitionToEnabled(void)
+ ?GetParamVideoPortFormat@COmxILVideoPort@@IBEABUOMX_VIDEO_PARAM_PORTFORMATTYPE@@XZ @ 118 NONAME ; struct OMX_VIDEO_PARAM_PORTFORMATTYPE const & COmxILVideoPort::GetParamVideoPortFormat(void) const
+ ?GetSupportedOtherFormats@COmxILOtherPort@@IBEABV?$RArray@W4OMX_OTHER_FORMATTYPE@@@@XZ @ 119 NONAME ; class RArray<enum OMX_OTHER_FORMATTYPE> const & COmxILOtherPort::GetSupportedOtherFormats(void) const
+ ?SetTransitionToDisabledCompleted@COmxILOtherPort@@UAEXXZ @ 120 NONAME ; void COmxILOtherPort::SetTransitionToDisabledCompleted(void)
+ ?GetParameter@COmxILAudioPort@@UBE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PAX@Z @ 121 NONAME ; enum OMX_ERRORTYPE COmxILAudioPort::GetParameter(enum OMX_INDEXTYPE, void *) const
+ ?GetTunnelledComponent@COmxILPort@@IBEABQAXXZ @ 122 NONAME ; void * const const & COmxILPort::GetTunnelledComponent(void) const
+ ?GetParameter@COmxILImagePort@@UBE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PAX@Z @ 123 NONAME ; enum OMX_ERRORTYPE COmxILImagePort::GetParameter(enum OMX_INDEXTYPE, void *) const
+ ?TunnelRequest@COmxILAudioPort@@UAE?AW4OMX_ERRORTYPE@@PAXKPAUOMX_TUNNELSETUPTYPE@@@Z @ 124 NONAME ; enum OMX_ERRORTYPE COmxILAudioPort::TunnelRequest(void *, unsigned long, struct OMX_TUNNELSETUPTYPE *)
+ ?SetComponentRoleDefaults@COmxILImagePort@@UAE?AW4OMX_ERRORTYPE@@I@Z @ 125 NONAME ; enum OMX_ERRORTYPE COmxILImagePort::SetComponentRoleDefaults(unsigned int)
+ ?PopulateTunnel@COmxILImagePort@@UAE?AW4OMX_ERRORTYPE@@AAH@Z @ 126 NONAME ; enum OMX_ERRORTYPE COmxILImagePort::PopulateTunnel(int &)
+ ?StoreBufferMark@COmxILOtherPort@@UAE?AW4OMX_ERRORTYPE@@PBUOMX_MARKTYPE@@@Z @ 127 NONAME ; enum OMX_ERRORTYPE COmxILOtherPort::StoreBufferMark(struct OMX_MARKTYPE const *)
+ ?FreeBuffer@COmxILVideoPort@@UAE?AW4OMX_ERRORTYPE@@PAUOMX_BUFFERHEADERTYPE@@AAH@Z @ 128 NONAME ; enum OMX_ERRORTYPE COmxILVideoPort::FreeBuffer(struct OMX_BUFFERHEADERTYPE *, int &)
+ ?GetLocalOmxParamIndexes@COmxILImagePort@@UBE?AW4OMX_ERRORTYPE@@AAV?$RArray@I@@@Z @ 129 NONAME ; enum OMX_ERRORTYPE COmxILImagePort::GetLocalOmxParamIndexes(class RArray<unsigned int> &) const
+ ?Index@COmxILPort@@QBEKXZ @ 130 NONAME ; unsigned long COmxILPort::Index(void) const
+ ?InsertConfigIndexL@COmxILConfigManager@@QAEXI@Z @ 131 NONAME ; void COmxILConfigManager::InsertConfigIndexL(unsigned int)
+ ?Extension_@COmxILComponent@@MAEHIAAPAXPAX@Z @ 132 NONAME ; int COmxILComponent::Extension_(unsigned int, void * &, void *)
+ ?AddPort@COmxILComponent@@IAEHPBVCOmxILPort@@W4OMX_DIRTYPE@@@Z @ 133 NONAME ; int COmxILComponent::AddPort(class COmxILPort const *, enum OMX_DIRTYPE)
+ ?GetSupportedImageFormats@COmxILImagePort@@IAEAAV?$RArray@W4OMX_IMAGE_CODINGTYPE@@@@XZ @ 134 NONAME ; class RArray<enum OMX_IMAGE_CODINGTYPE> & COmxILImagePort::GetSupportedImageFormats(void)
+ ?ConstructL@COmxILVideoPort@@IAEXABVTOmxILCommonPortData@@ABV?$RArray@W4OMX_VIDEO_CODINGTYPE@@@@ABV?$RArray@W4OMX_COLOR_FORMATTYPE@@@@@Z @ 135 NONAME ; void COmxILVideoPort::ConstructL(class TOmxILCommonPortData const &, class RArray<enum OMX_VIDEO_CODINGTYPE> const &, class RArray<enum OMX_COLOR_FORMATTYPE> const &)
+ ?CheckOmxStructSizeAndVersion@TOmxILUtil@@SA?AW4OMX_ERRORTYPE@@PAXK@Z @ 136 NONAME ; enum OMX_ERRORTYPE TOmxILUtil::CheckOmxStructSizeAndVersion(void *, unsigned long)
+ ?TunnelRequest@COmxILImagePort@@UAE?AW4OMX_ERRORTYPE@@PAXKPAUOMX_TUNNELSETUPTYPE@@@Z @ 137 NONAME ; enum OMX_ERRORTYPE COmxILImagePort::TunnelRequest(void *, unsigned long, struct OMX_TUNNELSETUPTYPE *)
+ ?DoOmxUseBuffer@COmxILImagePort@@MAE?AW4OMX_ERRORTYPE@@PAXPAPAUOMX_BUFFERHEADERTYPE@@K00KPAE@Z @ 138 NONAME ; enum OMX_ERRORTYPE COmxILImagePort::DoOmxUseBuffer(void *, struct OMX_BUFFERHEADERTYPE * *, unsigned long, void *, void *, unsigned long, unsigned char *)
+ ?SetBufferSent@COmxILAudioPort@@UAEHPAUOMX_BUFFERHEADERTYPE@@AAH@Z @ 139 NONAME ; int COmxILAudioPort::SetBufferSent(struct OMX_BUFFERHEADERTYPE *, int &)
+ ?DoBufferUnwrapping@COmxILOtherPort@@MAEXPAX000@Z @ 140 NONAME ; void COmxILOtherPort::DoBufferUnwrapping(void *, void *, void *, void *)
+ ??0COmxILImagePort@@IAE@XZ @ 141 NONAME ; COmxILImagePort::COmxILImagePort(void)
+ ?GetLocalOmxConfigIndexes@COmxILVideoPort@@UBE?AW4OMX_ERRORTYPE@@AAV?$RArray@I@@@Z @ 142 NONAME ; enum OMX_ERRORTYPE COmxILVideoPort::GetLocalOmxConfigIndexes(class RArray<unsigned int> &) const
+ ?SetConfig@COmxILOtherPort@@UAE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PBXAAH@Z @ 143 NONAME ; enum OMX_ERRORTYPE COmxILOtherPort::SetConfig(enum OMX_INDEXTYPE, void const *, int &)
+ ??0COmxILProcessingFunction@@IAE@AAVMOmxILCallbackNotificationIf@@@Z @ 144 NONAME ; COmxILProcessingFunction::COmxILProcessingFunction(class MOmxILCallbackNotificationIf &)
+ ?DoBufferWrapping@COmxILVideoPort@@MAE?AW4OMX_ERRORTYPE@@KPAEAAPAX1PAX@Z @ 145 NONAME ; enum OMX_ERRORTYPE COmxILVideoPort::DoBufferWrapping(unsigned long, unsigned char *, void * &, void * &, void *)
+ ?GetProcessingFunction@COmxILComponent@@IBEPAVCOmxILProcessingFunction@@XZ @ 146 NONAME ; class COmxILProcessingFunction * COmxILComponent::GetProcessingFunction(void) const
+ ?SetConfig@COmxILAudioPort@@UAE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PBXAAH@Z @ 147 NONAME ; enum OMX_ERRORTYPE COmxILAudioPort::SetConfig(enum OMX_INDEXTYPE, void const *, int &)
+ ?GetTunnelledPort@COmxILPort@@IAEAAKXZ @ 148 NONAME ; unsigned long & COmxILPort::GetTunnelledPort(void)
+ ?InsertParamIndexL@COmxILConfigManager@@QAEXI@Z @ 149 NONAME ; void COmxILConfigManager::InsertParamIndexL(unsigned int)
+ ?SetTransitionToDisabled@COmxILImagePort@@UAEXXZ @ 150 NONAME ; void COmxILImagePort::SetTransitionToDisabled(void)
+ ?SetComponentRoleDefaults@COmxILOtherPort@@UAE?AW4OMX_ERRORTYPE@@I@Z @ 151 NONAME ; enum OMX_ERRORTYPE COmxILOtherPort::SetComponentRoleDefaults(unsigned int)
+ ?IsBufferAtHome@COmxILImagePort@@UBEHPAUOMX_BUFFERHEADERTYPE@@@Z @ 152 NONAME ; int COmxILImagePort::IsBufferAtHome(struct OMX_BUFFERHEADERTYPE *) const
+ ?GetParamOtherPortFormat@COmxILOtherPort@@IBEABUOMX_OTHER_PARAM_PORTFORMATTYPE@@XZ @ 153 NONAME ; struct OMX_OTHER_PARAM_PORTFORMATTYPE const & COmxILOtherPort::GetParamOtherPortFormat(void) const
+ ?SetTransitionToEnabledCompleted@COmxILVideoPort@@UAEXXZ @ 154 NONAME ; void COmxILVideoPort::SetTransitionToEnabledCompleted(void)
+ ?DoBufferDeallocation@COmxILOtherPort@@MAEXPAX000@Z @ 155 NONAME ; void COmxILOtherPort::DoBufferDeallocation(void *, void *, void *, void *)
+ ??1COmxILOtherPort@@UAE@XZ @ 156 NONAME ; COmxILOtherPort::~COmxILOtherPort(void)
+ ?CleanUpPort@COmxILPort@@IAEXXZ @ 157 NONAME ; void COmxILPort::CleanUpPort(void)
+ ?Extension_@COmxILImagePort@@MAEHIAAPAXPAX@Z @ 158 NONAME ; int COmxILImagePort::Extension_(unsigned int, void * &, void *)
+ ?Extension_@COmxILVideoPort@@MAEHIAAPAXPAX@Z @ 159 NONAME ; int COmxILVideoPort::Extension_(unsigned int, void * &, void *)
+ ?GetParameter@COmxILConfigManager@@UBE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PAX@Z @ 160 NONAME ; enum OMX_ERRORTYPE COmxILConfigManager::GetParameter(enum OMX_INDEXTYPE, void *) const
+ ?HasAllBuffersAtHome@COmxILOtherPort@@UBEHXZ @ 161 NONAME ; int COmxILOtherPort::HasAllBuffersAtHome(void) const
+ ?StoreBufferMark@COmxILAudioPort@@UAE?AW4OMX_ERRORTYPE@@PBUOMX_MARKTYPE@@@Z @ 162 NONAME ; enum OMX_ERRORTYPE COmxILAudioPort::StoreBufferMark(struct OMX_MARKTYPE const *)
+ ?GetSupportedColorFormats@COmxILVideoPort@@IBEABV?$RArray@W4OMX_COLOR_FORMATTYPE@@@@XZ @ 163 NONAME ; class RArray<enum OMX_COLOR_FORMATTYPE> const & COmxILVideoPort::GetSupportedColorFormats(void) const
+ ?DoOmxUseBuffer@COmxILVideoPort@@MAE?AW4OMX_ERRORTYPE@@PAXPAPAUOMX_BUFFERHEADERTYPE@@K00KPAE@Z @ 164 NONAME ; enum OMX_ERRORTYPE COmxILVideoPort::DoOmxUseBuffer(void *, struct OMX_BUFFERHEADERTYPE * *, unsigned long, void *, void *, unsigned long, unsigned char *)
+ ?FindParamIndex@COmxILConfigManager@@QBEHI@Z @ 165 NONAME ; int COmxILConfigManager::FindParamIndex(unsigned int) const
+ ?DoPortReconfiguration@COmxILImagePort@@UAE?AW4OMX_ERRORTYPE@@IABVTDesC8@@AAW4OMX_EVENTTYPE@@@Z @ 166 NONAME ; enum OMX_ERRORTYPE COmxILImagePort::DoPortReconfiguration(unsigned int, class TDesC8 const &, enum OMX_EVENTTYPE &)
+ ?GetLocalOmxConfigIndexes@COmxILImagePort@@UBE?AW4OMX_ERRORTYPE@@AAV?$RArray@I@@@Z @ 167 NONAME ; enum OMX_ERRORTYPE COmxILImagePort::GetLocalOmxConfigIndexes(class RArray<unsigned int> &) const
+ ?ClearBufferContents@TOmxILUtil@@SAXPAUOMX_BUFFERHEADERTYPE@@@Z @ 168 NONAME ; void TOmxILUtil::ClearBufferContents(struct OMX_BUFFERHEADERTYPE *)
+ ?SetParameter@COmxILImagePort@@UAE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PBXAAH@Z @ 169 NONAME ; enum OMX_ERRORTYPE COmxILImagePort::SetParameter(enum OMX_INDEXTYPE, void const *, int &)
+ ?GetLocalOmxParamIndexes@COmxILOtherPort@@UBE?AW4OMX_ERRORTYPE@@AAV?$RArray@I@@@Z @ 170 NONAME ; enum OMX_ERRORTYPE COmxILOtherPort::GetLocalOmxParamIndexes(class RArray<unsigned int> &) const
+ ?SetTransitionToEnabledCompleted@COmxILAudioPort@@UAEXXZ @ 171 NONAME ; void COmxILAudioPort::SetTransitionToEnabledCompleted(void)
+ ?PopulateBuffer@COmxILAudioPort@@UAE?AW4OMX_ERRORTYPE@@PAPAUOMX_BUFFERHEADERTYPE@@PAXKPAEAAH@Z @ 172 NONAME ; enum OMX_ERRORTYPE COmxILAudioPort::PopulateBuffer(struct OMX_BUFFERHEADERTYPE * *, void *, unsigned long, unsigned char *, int &)
+ ?GetParamPortDefinition@COmxILPort@@IAEAAUOMX_PARAM_PORTDEFINITIONTYPE@@XZ @ 173 NONAME ; struct OMX_PARAM_PORTDEFINITIONTYPE & COmxILPort::GetParamPortDefinition(void)
+ ?GetSupportedVideoFormats@COmxILVideoPort@@IBEABV?$RArray@W4OMX_VIDEO_CODINGTYPE@@@@XZ @ 174 NONAME ; class RArray<enum OMX_VIDEO_CODINGTYPE> const & COmxILVideoPort::GetSupportedVideoFormats(void) const
+ ?GetExtensionIndex@COmxILImagePort@@UBE?AW4OMX_ERRORTYPE@@PADPAW4OMX_INDEXTYPE@@@Z @ 175 NONAME ; enum OMX_ERRORTYPE COmxILImagePort::GetExtensionIndex(char *, enum OMX_INDEXTYPE *) const
+ ?Extension_@COmxILProcessingFunction@@MAEHIAAPAXPAX@Z @ 176 NONAME ; int COmxILProcessingFunction::Extension_(unsigned int, void * &, void *)
+ ?UpdateColorFormat@COmxILVideoPort@@IAEHAAW4OMX_COLOR_FORMATTYPE@@W42@AAH@Z @ 177 NONAME ; int COmxILVideoPort::UpdateColorFormat(enum OMX_COLOR_FORMATTYPE &, enum OMX_COLOR_FORMATTYPE, int &)
+ ?PopulateTunnel@COmxILAudioPort@@UAE?AW4OMX_ERRORTYPE@@AAH@Z @ 178 NONAME ; enum OMX_ERRORTYPE COmxILAudioPort::PopulateTunnel(int &)
+ ?SetComponentRoleDefaults@COmxILAudioPort@@UAE?AW4OMX_ERRORTYPE@@I@Z @ 179 NONAME ; enum OMX_ERRORTYPE COmxILAudioPort::SetComponentRoleDefaults(unsigned int)
+ ?DoOmxUseBuffer@COmxILOtherPort@@MAE?AW4OMX_ERRORTYPE@@PAXPAPAUOMX_BUFFERHEADERTYPE@@K00KPAE@Z @ 180 NONAME ; enum OMX_ERRORTYPE COmxILOtherPort::DoOmxUseBuffer(void *, struct OMX_BUFFERHEADERTYPE * *, unsigned long, void *, void *, unsigned long, unsigned char *)
+ ?GetExtensionIndex@COmxILOtherPort@@UBE?AW4OMX_ERRORTYPE@@PADPAW4OMX_INDEXTYPE@@@Z @ 181 NONAME ; enum OMX_ERRORTYPE COmxILOtherPort::GetExtensionIndex(char *, enum OMX_INDEXTYPE *) const
+ ?RegisterConfigurationManager@COmxILComponent@@IAEXPBVCOmxILConfigManager@@@Z @ 182 NONAME ; void COmxILComponent::RegisterConfigurationManager(class COmxILConfigManager const *)
+ ?DoPortReconfiguration@COmxILOtherPort@@UAE?AW4OMX_ERRORTYPE@@IABVTDesC8@@AAW4OMX_EVENTTYPE@@@Z @ 183 NONAME ; enum OMX_ERRORTYPE COmxILOtherPort::DoPortReconfiguration(unsigned int, class TDesC8 const &, enum OMX_EVENTTYPE &)
+ ?SetBufferSent@COmxILVideoPort@@UAEHPAUOMX_BUFFERHEADERTYPE@@AAH@Z @ 184 NONAME ; int COmxILVideoPort::SetBufferSent(struct OMX_BUFFERHEADERTYPE *, int &)
+ ??BTOmxILVersion@@QAEAATOMX_VERSIONTYPE@@XZ @ 185 NONAME ; TOmxILVersion::operator union OMX_VERSIONTYPE &(void)
+ ?GetTunnelledComponent@COmxILPort@@IAEAAPAXXZ @ 186 NONAME ; void * & COmxILPort::GetTunnelledComponent(void)
+ ?UpdateCodingType@COmxILVideoPort@@IAEHAAW4OMX_VIDEO_CODINGTYPE@@W42@AAH@Z @ 187 NONAME ; int COmxILVideoPort::UpdateCodingType(enum OMX_VIDEO_CODINGTYPE &, enum OMX_VIDEO_CODINGTYPE, int &)
+ ?CreateCallbackManagerL@COmxILComponent@@IAEPAVMOmxILCallbackNotificationIf@@W4TCallbackManagerType@1@@Z @ 188 NONAME ; class MOmxILCallbackNotificationIf * COmxILComponent::CreateCallbackManagerL(enum COmxILComponent::TCallbackManagerType)
+ ?SetTransitionToEnabled@COmxILImagePort@@UAEXXZ @ 189 NONAME ; void COmxILImagePort::SetTransitionToEnabled(void)
+ ?IsEnabled@COmxILPort@@QBEHXZ @ 190 NONAME ; int COmxILPort::IsEnabled(void) const
+ ??0TOmxILVersion@@QAE@EEEE@Z @ 191 NONAME ; TOmxILVersion::TOmxILVersion(unsigned char, unsigned char, unsigned char, unsigned char)
+ ?GetConfig@COmxILOtherPort@@UBE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PAX@Z @ 192 NONAME ; enum OMX_ERRORTYPE COmxILOtherPort::GetConfig(enum OMX_INDEXTYPE, void *) const
+ ?SetComponentRoleDefaults@COmxILVideoPort@@UAE?AW4OMX_ERRORTYPE@@I@Z @ 193 NONAME ; enum OMX_ERRORTYPE COmxILVideoPort::SetComponentRoleDefaults(unsigned int)
+ ??1COmxILProcessingFunction@@UAE@XZ @ 194 NONAME ; COmxILProcessingFunction::~COmxILProcessingFunction(void)
+ ?GetParamVideoPortFormat@COmxILVideoPort@@IAEAAUOMX_VIDEO_PARAM_PORTFORMATTYPE@@XZ @ 195 NONAME ; struct OMX_VIDEO_PARAM_PORTFORMATTYPE & COmxILVideoPort::GetParamVideoPortFormat(void)
+ ?DoPortReconfiguration@COmxILVideoPort@@UAE?AW4OMX_ERRORTYPE@@IABVTDesC8@@AAW4OMX_EVENTTYPE@@@Z @ 196 NONAME ; enum OMX_ERRORTYPE COmxILVideoPort::DoPortReconfiguration(unsigned int, class TDesC8 const &, enum OMX_EVENTTYPE &)
+ ?SetTransitionToDisabledCompleted@COmxILImagePort@@UAEXXZ @ 197 NONAME ; void COmxILImagePort::SetTransitionToDisabledCompleted(void)
+ ??1COmxILComponent@@UAE@XZ @ 198 NONAME ; COmxILComponent::~COmxILComponent(void)
+ ?GetLocalOmxConfigIndexes@COmxILOtherPort@@UBE?AW4OMX_ERRORTYPE@@AAV?$RArray@I@@@Z @ 199 NONAME ; enum OMX_ERRORTYPE COmxILOtherPort::GetLocalOmxConfigIndexes(class RArray<unsigned int> &) const
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/eabi/omxilcomponentcommon.def Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,292 @@
+EXPORTS
+ _ZN10COmxILPort10Extension_EjRPvS0_ @ 1 NONAME
+ _ZN10COmxILPort11CleanUpPortEv @ 2 NONAME
+ _ZN10COmxILPort16GetTunnelledPortEv @ 3 NONAME
+ _ZN10COmxILPort21GetTunnelledComponentEv @ 4 NONAME
+ _ZN10COmxILPort22GetParamPortDefinitionEv @ 5 NONAME
+ _ZN10TOmxILUtil19ClearBufferContentsEP20OMX_BUFFERHEADERTYPE @ 6 NONAME
+ _ZN10TOmxILUtil28CheckOmxStructSizeAndVersionEPvm @ 7 NONAME
+ _ZN13TOmxILVersionC1Ehhhh @ 8 NONAME
+ _ZN13TOmxILVersionC2Ehhhh @ 9 NONAME
+ _ZN13TOmxILVersioncvR15OMX_VERSIONTYPEEv @ 10 NONAME
+ _ZN15COmxILAudioPort10ConstructLERK20TOmxILCommonPortDataRK6RArrayI20OMX_AUDIO_CODINGTYPEE @ 11 NONAME
+ _ZN15COmxILAudioPort10Extension_EjRPvS0_ @ 12 NONAME
+ _ZN15COmxILAudioPort10FreeBufferEP20OMX_BUFFERHEADERTYPERi @ 13 NONAME
+ _ZN15COmxILAudioPort10FreeTunnelERi @ 14 NONAME
+ _ZN15COmxILAudioPort12SetParameterE13OMX_INDEXTYPEPKvRi @ 15 NONAME
+ _ZN15COmxILAudioPort13SetBufferSentEP20OMX_BUFFERHEADERTYPERi @ 16 NONAME
+ _ZN15COmxILAudioPort13TunnelRequestEPvmP19OMX_TUNNELSETUPTYPE @ 17 NONAME
+ _ZN15COmxILAudioPort14DoOmxUseBufferEPvPP20OMX_BUFFERHEADERTYPEmS0_S0_mPh @ 18 NONAME
+ _ZN15COmxILAudioPort14PopulateBufferEPP20OMX_BUFFERHEADERTYPEPvmPhRi @ 19 NONAME
+ _ZN15COmxILAudioPort14PopulateTunnelERi @ 20 NONAME
+ _ZN15COmxILAudioPort15StoreBufferMarkEPK12OMX_MARKTYPE @ 21 NONAME
+ _ZN15COmxILAudioPort16DoBufferWrappingEmPhRPvS2_S1_ @ 22 NONAME
+ _ZN15COmxILAudioPort17SetBufferReturnedEP20OMX_BUFFERHEADERTYPE @ 23 NONAME
+ _ZN15COmxILAudioPort18DoBufferAllocationEmRPhRPvS3_S2_ @ 24 NONAME
+ _ZN15COmxILAudioPort18DoBufferUnwrappingEPvS0_S0_S0_ @ 25 NONAME
+ _ZN15COmxILAudioPort20DoBufferDeallocationEPvS0_S0_S0_ @ 26 NONAME
+ _ZN15COmxILAudioPort21DoPortReconfigurationEjRK6TDesC8R13OMX_EVENTTYPE @ 27 NONAME
+ _ZN15COmxILAudioPort22SetTransitionToEnabledEv @ 28 NONAME
+ _ZN15COmxILAudioPort23SetTransitionToDisabledEv @ 29 NONAME
+ _ZN15COmxILAudioPort24SetComponentRoleDefaultsEj @ 30 NONAME
+ _ZN15COmxILAudioPort31SetTransitionToEnabledCompletedEv @ 31 NONAME
+ _ZN15COmxILAudioPort32SetTransitionToDisabledCompletedEv @ 32 NONAME
+ _ZN15COmxILAudioPort9SetConfigE13OMX_INDEXTYPEPKvRi @ 33 NONAME
+ _ZN15COmxILAudioPortC2Ev @ 34 NONAME
+ _ZN15COmxILAudioPortD0Ev @ 35 NONAME
+ _ZN15COmxILAudioPortD1Ev @ 36 NONAME
+ _ZN15COmxILAudioPortD2Ev @ 37 NONAME
+ _ZN15COmxILComponent10ConstructLEPv @ 38 NONAME
+ _ZN15COmxILComponent10Extension_EjRPvS0_ @ 39 NONAME
+ _ZN15COmxILComponent14InitComponentLEv @ 40 NONAME
+ _ZN15COmxILComponent18CreatePortManagerLENS_16TPortManagerTypeERK15OMX_VERSIONTYPEmmmmmmmm8OMX_BOOL @ 41 NONAME
+ _ZN15COmxILComponent22CreateCallbackManagerLENS_20TCallbackManagerTypeE @ 42 NONAME
+ _ZN15COmxILComponent26RegisterProcessingFunctionEPK24COmxILProcessingFunction @ 43 NONAME
+ _ZN15COmxILComponent28RegisterConfigurationManagerEPK19COmxILConfigManager @ 44 NONAME
+ _ZN15COmxILComponent28SymbianErrorToGetHandleErrorEi @ 45 NONAME
+ _ZN15COmxILComponent7AddPortEPK10COmxILPort11OMX_DIRTYPE @ 46 NONAME
+ _ZN15COmxILComponentC1Ev @ 47 NONAME
+ _ZN15COmxILComponentC2Ev @ 48 NONAME
+ _ZN15COmxILComponentD0Ev @ 49 NONAME
+ _ZN15COmxILComponentD1Ev @ 50 NONAME
+ _ZN15COmxILComponentD2Ev @ 51 NONAME
+ _ZN15COmxILImagePort10ConstructLERK20TOmxILCommonPortDataRK6RArrayI20OMX_IMAGE_CODINGTYPEERKS3_I20OMX_COLOR_FORMATTYPEE @ 52 NONAME
+ _ZN15COmxILImagePort10Extension_EjRPvS0_ @ 53 NONAME
+ _ZN15COmxILImagePort10FreeBufferEP20OMX_BUFFERHEADERTYPERi @ 54 NONAME
+ _ZN15COmxILImagePort10FreeTunnelERi @ 55 NONAME
+ _ZN15COmxILImagePort12SetParameterE13OMX_INDEXTYPEPKvRi @ 56 NONAME
+ _ZN15COmxILImagePort13SetBufferSentEP20OMX_BUFFERHEADERTYPERi @ 57 NONAME
+ _ZN15COmxILImagePort13TunnelRequestEPvmP19OMX_TUNNELSETUPTYPE @ 58 NONAME
+ _ZN15COmxILImagePort14DoOmxUseBufferEPvPP20OMX_BUFFERHEADERTYPEmS0_S0_mPh @ 59 NONAME
+ _ZN15COmxILImagePort14PopulateBufferEPP20OMX_BUFFERHEADERTYPEPvmPhRi @ 60 NONAME
+ _ZN15COmxILImagePort14PopulateTunnelERi @ 61 NONAME
+ _ZN15COmxILImagePort15StoreBufferMarkEPK12OMX_MARKTYPE @ 62 NONAME
+ _ZN15COmxILImagePort16DoBufferWrappingEmPhRPvS2_S1_ @ 63 NONAME
+ _ZN15COmxILImagePort17SetBufferReturnedEP20OMX_BUFFERHEADERTYPE @ 64 NONAME
+ _ZN15COmxILImagePort18DoBufferAllocationEmRPhRPvS3_S2_ @ 65 NONAME
+ _ZN15COmxILImagePort18DoBufferUnwrappingEPvS0_S0_S0_ @ 66 NONAME
+ _ZN15COmxILImagePort20DoBufferDeallocationEPvS0_S0_S0_ @ 67 NONAME
+ _ZN15COmxILImagePort21DoPortReconfigurationEjRK6TDesC8R13OMX_EVENTTYPE @ 68 NONAME
+ _ZN15COmxILImagePort22SetTransitionToEnabledEv @ 69 NONAME
+ _ZN15COmxILImagePort23GetParamImagePortFormatEv @ 70 NONAME
+ _ZN15COmxILImagePort23SetTransitionToDisabledEv @ 71 NONAME
+ _ZN15COmxILImagePort24GetSupportedColorFormatsEv @ 72 NONAME
+ _ZN15COmxILImagePort24GetSupportedImageFormatsEv @ 73 NONAME
+ _ZN15COmxILImagePort24SetComponentRoleDefaultsEj @ 74 NONAME
+ _ZN15COmxILImagePort31SetTransitionToEnabledCompletedEv @ 75 NONAME
+ _ZN15COmxILImagePort32SetTransitionToDisabledCompletedEv @ 76 NONAME
+ _ZN15COmxILImagePort9SetConfigE13OMX_INDEXTYPEPKvRi @ 77 NONAME
+ _ZN15COmxILImagePortC2Ev @ 78 NONAME
+ _ZN15COmxILImagePortD0Ev @ 79 NONAME
+ _ZN15COmxILImagePortD1Ev @ 80 NONAME
+ _ZN15COmxILImagePortD2Ev @ 81 NONAME
+ _ZN15COmxILOtherPort10ConstructLERK20TOmxILCommonPortDataRK6RArrayI20OMX_OTHER_FORMATTYPEE @ 82 NONAME
+ _ZN15COmxILOtherPort10Extension_EjRPvS0_ @ 83 NONAME
+ _ZN15COmxILOtherPort10FreeBufferEP20OMX_BUFFERHEADERTYPERi @ 84 NONAME
+ _ZN15COmxILOtherPort10FreeTunnelERi @ 85 NONAME
+ _ZN15COmxILOtherPort12SetParameterE13OMX_INDEXTYPEPKvRi @ 86 NONAME
+ _ZN15COmxILOtherPort13SetBufferSentEP20OMX_BUFFERHEADERTYPERi @ 87 NONAME
+ _ZN15COmxILOtherPort13TunnelRequestEPvmP19OMX_TUNNELSETUPTYPE @ 88 NONAME
+ _ZN15COmxILOtherPort14DoOmxUseBufferEPvPP20OMX_BUFFERHEADERTYPEmS0_S0_mPh @ 89 NONAME
+ _ZN15COmxILOtherPort14PopulateBufferEPP20OMX_BUFFERHEADERTYPEPvmPhRi @ 90 NONAME
+ _ZN15COmxILOtherPort14PopulateTunnelERi @ 91 NONAME
+ _ZN15COmxILOtherPort15StoreBufferMarkEPK12OMX_MARKTYPE @ 92 NONAME
+ _ZN15COmxILOtherPort16DoBufferWrappingEmPhRPvS2_S1_ @ 93 NONAME
+ _ZN15COmxILOtherPort17SetBufferReturnedEP20OMX_BUFFERHEADERTYPE @ 94 NONAME
+ _ZN15COmxILOtherPort18DoBufferAllocationEmRPhRPvS3_S2_ @ 95 NONAME
+ _ZN15COmxILOtherPort18DoBufferUnwrappingEPvS0_S0_S0_ @ 96 NONAME
+ _ZN15COmxILOtherPort20DoBufferDeallocationEPvS0_S0_S0_ @ 97 NONAME
+ _ZN15COmxILOtherPort21DoPortReconfigurationEjRK6TDesC8R13OMX_EVENTTYPE @ 98 NONAME
+ _ZN15COmxILOtherPort22SetTransitionToEnabledEv @ 99 NONAME
+ _ZN15COmxILOtherPort23GetParamOtherPortFormatEv @ 100 NONAME
+ _ZN15COmxILOtherPort23SetTransitionToDisabledEv @ 101 NONAME
+ _ZN15COmxILOtherPort24GetSupportedOtherFormatsEv @ 102 NONAME
+ _ZN15COmxILOtherPort24SetComponentRoleDefaultsEj @ 103 NONAME
+ _ZN15COmxILOtherPort31SetTransitionToEnabledCompletedEv @ 104 NONAME
+ _ZN15COmxILOtherPort32SetTransitionToDisabledCompletedEv @ 105 NONAME
+ _ZN15COmxILOtherPort9SetConfigE13OMX_INDEXTYPEPKvRi @ 106 NONAME
+ _ZN15COmxILOtherPortC2Ev @ 107 NONAME
+ _ZN15COmxILOtherPortD0Ev @ 108 NONAME
+ _ZN15COmxILOtherPortD1Ev @ 109 NONAME
+ _ZN15COmxILOtherPortD2Ev @ 110 NONAME
+ _ZN15COmxILVideoPort10ConstructLERK20TOmxILCommonPortDataRK6RArrayI20OMX_VIDEO_CODINGTYPEERKS3_I20OMX_COLOR_FORMATTYPEE @ 111 NONAME
+ _ZN15COmxILVideoPort10Extension_EjRPvS0_ @ 112 NONAME
+ _ZN15COmxILVideoPort10FreeBufferEP20OMX_BUFFERHEADERTYPERi @ 113 NONAME
+ _ZN15COmxILVideoPort10FreeTunnelERi @ 114 NONAME
+ _ZN15COmxILVideoPort12SetParameterE13OMX_INDEXTYPEPKvRi @ 115 NONAME
+ _ZN15COmxILVideoPort13SetBufferSentEP20OMX_BUFFERHEADERTYPERi @ 116 NONAME
+ _ZN15COmxILVideoPort13TunnelRequestEPvmP19OMX_TUNNELSETUPTYPE @ 117 NONAME
+ _ZN15COmxILVideoPort14DoOmxUseBufferEPvPP20OMX_BUFFERHEADERTYPEmS0_S0_mPh @ 118 NONAME
+ _ZN15COmxILVideoPort14PopulateBufferEPP20OMX_BUFFERHEADERTYPEPvmPhRi @ 119 NONAME
+ _ZN15COmxILVideoPort14PopulateTunnelERi @ 120 NONAME
+ _ZN15COmxILVideoPort15StoreBufferMarkEPK12OMX_MARKTYPE @ 121 NONAME
+ _ZN15COmxILVideoPort16DoBufferWrappingEmPhRPvS2_S1_ @ 122 NONAME
+ _ZN15COmxILVideoPort16UpdateCodingTypeER20OMX_VIDEO_CODINGTYPES0_Ri @ 123 NONAME
+ _ZN15COmxILVideoPort17SetBufferReturnedEP20OMX_BUFFERHEADERTYPE @ 124 NONAME
+ _ZN15COmxILVideoPort17UpdateColorFormatER20OMX_COLOR_FORMATTYPES0_Ri @ 125 NONAME
+ _ZN15COmxILVideoPort18DoBufferAllocationEmRPhRPvS3_S2_ @ 126 NONAME
+ _ZN15COmxILVideoPort18DoBufferUnwrappingEPvS0_S0_S0_ @ 127 NONAME
+ _ZN15COmxILVideoPort20DoBufferDeallocationEPvS0_S0_S0_ @ 128 NONAME
+ _ZN15COmxILVideoPort21DoPortReconfigurationEjRK6TDesC8R13OMX_EVENTTYPE @ 129 NONAME
+ _ZN15COmxILVideoPort22SetTransitionToEnabledEv @ 130 NONAME
+ _ZN15COmxILVideoPort23GetParamVideoPortFormatEv @ 131 NONAME
+ _ZN15COmxILVideoPort23SetTransitionToDisabledEv @ 132 NONAME
+ _ZN15COmxILVideoPort24GetSupportedColorFormatsEv @ 133 NONAME
+ _ZN15COmxILVideoPort24GetSupportedVideoFormatsEv @ 134 NONAME
+ _ZN15COmxILVideoPort24SetComponentRoleDefaultsEj @ 135 NONAME
+ _ZN15COmxILVideoPort31SetTransitionToEnabledCompletedEv @ 136 NONAME
+ _ZN15COmxILVideoPort32SetTransitionToDisabledCompletedEv @ 137 NONAME
+ _ZN15COmxILVideoPort9SetConfigE13OMX_INDEXTYPEPKvRi @ 138 NONAME
+ _ZN15COmxILVideoPortC2Ev @ 139 NONAME
+ _ZN15COmxILVideoPortD0Ev @ 140 NONAME
+ _ZN15COmxILVideoPortD1Ev @ 141 NONAME
+ _ZN15COmxILVideoPortD2Ev @ 142 NONAME
+ _ZN17TOmxILSpecVersionC1Ev @ 143 NONAME
+ _ZN17TOmxILSpecVersionC2Ev @ 144 NONAME
+ _ZN19COmxILConfigManager10ConstructLERK6TDesC8RK15OMX_VERSIONTYPERK13RPointerArrayIS0_E @ 145 NONAME
+ _ZN19COmxILConfigManager10Extension_EjRPvS0_ @ 146 NONAME
+ _ZN19COmxILConfigManager12SetParameterE13OMX_INDEXTYPEPKv8OMX_BOOL @ 147 NONAME
+ _ZN19COmxILConfigManager17InsertParamIndexLEj @ 148 NONAME
+ _ZN19COmxILConfigManager18InsertConfigIndexLEj @ 149 NONAME
+ _ZN19COmxILConfigManager20ManagedConfigIndexesEv @ 150 NONAME
+ _ZN19COmxILConfigManager4NewLERK6TDesC8RK15OMX_VERSIONTYPERK13RPointerArrayIS0_E @ 151 NONAME
+ _ZN19COmxILConfigManager9SetConfigE13OMX_INDEXTYPEPKv @ 152 NONAME
+ _ZN19COmxILConfigManagerC1Ev @ 153 NONAME
+ _ZN19COmxILConfigManagerC2Ev @ 154 NONAME
+ _ZN19COmxILConfigManagerD0Ev @ 155 NONAME
+ _ZN19COmxILConfigManagerD1Ev @ 156 NONAME
+ _ZN19COmxILConfigManagerD2Ev @ 157 NONAME
+ _ZN20TOmxILCommonPortDataC1E15OMX_VERSIONTYPEm11OMX_DIRTYPEmm18OMX_PORTDOMAINTYPE8OMX_BOOLm22OMX_BUFFERSUPPLIERTYPEm @ 158 NONAME
+ _ZN20TOmxILCommonPortDataC2E15OMX_VERSIONTYPEm11OMX_DIRTYPEmm18OMX_PORTDOMAINTYPE8OMX_BOOLm22OMX_BUFFERSUPPLIERTYPEm @ 159 NONAME
+ _ZN21COmxILClientClockPort4NewLERK20TOmxILCommonPortDataRK6RArrayI20OMX_OTHER_FORMATTYPEE @ 160 NONAME
+ _ZN24COmxILProcessingFunction10Extension_EjRPvS0_ @ 161 NONAME
+ _ZN24COmxILProcessingFunction19MediaTimeIndicationERK22OMX_TIME_MEDIATIMETYPE @ 162 NONAME
+ _ZN24COmxILProcessingFunction23ComponentRoleIndicationEj @ 163 NONAME
+ _ZN24COmxILProcessingFunctionC2ER28MOmxILCallbackNotificationIf @ 164 NONAME
+ _ZN24COmxILProcessingFunctionD0Ev @ 165 NONAME
+ _ZN24COmxILProcessingFunctionD1Ev @ 166 NONAME
+ _ZN24COmxILProcessingFunctionD2Ev @ 167 NONAME
+ _ZNK10COmxILPort16GetTunnelledPortEv @ 168 NONAME
+ _ZNK10COmxILPort21GetTunnelledComponentEv @ 169 NONAME
+ _ZNK10COmxILPort22GetParamPortDefinitionEv @ 170 NONAME
+ _ZNK10COmxILPort5IndexEv @ 171 NONAME
+ _ZNK10COmxILPort9IsEnabledEv @ 172 NONAME
+ _ZNK15COmxILAudioPort12GetParameterE13OMX_INDEXTYPEPv @ 173 NONAME
+ _ZNK15COmxILAudioPort14IsBufferAtHomeEP20OMX_BUFFERHEADERTYPE @ 174 NONAME
+ _ZNK15COmxILAudioPort17GetExtensionIndexEPcP13OMX_INDEXTYPE @ 175 NONAME
+ _ZNK15COmxILAudioPort19HasAllBuffersAtHomeEv @ 176 NONAME
+ _ZNK15COmxILAudioPort23GetLocalOmxParamIndexesER6RArrayIjE @ 177 NONAME
+ _ZNK15COmxILAudioPort24GetLocalOmxConfigIndexesER6RArrayIjE @ 178 NONAME
+ _ZNK15COmxILAudioPort9GetConfigE13OMX_INDEXTYPEPv @ 179 NONAME
+ _ZNK15COmxILComponent10GetAppDataEv @ 180 NONAME
+ _ZNK15COmxILComponent12GetCallbacksEv @ 181 NONAME
+ _ZNK15COmxILComponent16GetConfigManagerEv @ 182 NONAME
+ _ZNK15COmxILComponent21GetProcessingFunctionEv @ 183 NONAME
+ _ZNK15COmxILComponent9GetHandleEv @ 184 NONAME
+ _ZNK15COmxILImagePort12GetParameterE13OMX_INDEXTYPEPv @ 185 NONAME
+ _ZNK15COmxILImagePort14IsBufferAtHomeEP20OMX_BUFFERHEADERTYPE @ 186 NONAME
+ _ZNK15COmxILImagePort17GetExtensionIndexEPcP13OMX_INDEXTYPE @ 187 NONAME
+ _ZNK15COmxILImagePort19HasAllBuffersAtHomeEv @ 188 NONAME
+ _ZNK15COmxILImagePort23GetLocalOmxParamIndexesER6RArrayIjE @ 189 NONAME
+ _ZNK15COmxILImagePort23GetParamImagePortFormatEv @ 190 NONAME
+ _ZNK15COmxILImagePort24GetLocalOmxConfigIndexesER6RArrayIjE @ 191 NONAME
+ _ZNK15COmxILImagePort24GetSupportedColorFormatsEv @ 192 NONAME
+ _ZNK15COmxILImagePort24GetSupportedImageFormatsEv @ 193 NONAME
+ _ZNK15COmxILImagePort9GetConfigE13OMX_INDEXTYPEPv @ 194 NONAME
+ _ZNK15COmxILOtherPort12GetParameterE13OMX_INDEXTYPEPv @ 195 NONAME
+ _ZNK15COmxILOtherPort14IsBufferAtHomeEP20OMX_BUFFERHEADERTYPE @ 196 NONAME
+ _ZNK15COmxILOtherPort17GetExtensionIndexEPcP13OMX_INDEXTYPE @ 197 NONAME
+ _ZNK15COmxILOtherPort19HasAllBuffersAtHomeEv @ 198 NONAME
+ _ZNK15COmxILOtherPort23GetLocalOmxParamIndexesER6RArrayIjE @ 199 NONAME
+ _ZNK15COmxILOtherPort23GetParamOtherPortFormatEv @ 200 NONAME
+ _ZNK15COmxILOtherPort24GetLocalOmxConfigIndexesER6RArrayIjE @ 201 NONAME
+ _ZNK15COmxILOtherPort24GetSupportedOtherFormatsEv @ 202 NONAME
+ _ZNK15COmxILOtherPort9GetConfigE13OMX_INDEXTYPEPv @ 203 NONAME
+ _ZNK15COmxILVideoPort12GetParameterE13OMX_INDEXTYPEPv @ 204 NONAME
+ _ZNK15COmxILVideoPort14IsBufferAtHomeEP20OMX_BUFFERHEADERTYPE @ 205 NONAME
+ _ZNK15COmxILVideoPort17GetExtensionIndexEPcP13OMX_INDEXTYPE @ 206 NONAME
+ _ZNK15COmxILVideoPort19HasAllBuffersAtHomeEv @ 207 NONAME
+ _ZNK15COmxILVideoPort23GetLocalOmxParamIndexesER6RArrayIjE @ 208 NONAME
+ _ZNK15COmxILVideoPort23GetParamVideoPortFormatEv @ 209 NONAME
+ _ZNK15COmxILVideoPort24GetLocalOmxConfigIndexesER6RArrayIjE @ 210 NONAME
+ _ZNK15COmxILVideoPort24GetSupportedColorFormatsEv @ 211 NONAME
+ _ZNK15COmxILVideoPort24GetSupportedVideoFormatsEv @ 212 NONAME
+ _ZNK15COmxILVideoPort9GetConfigE13OMX_INDEXTYPEPv @ 213 NONAME
+ _ZNK19COmxILConfigManager12GetParameterE13OMX_INDEXTYPEPv @ 214 NONAME
+ _ZNK19COmxILConfigManager14FindParamIndexEj @ 215 NONAME
+ _ZNK19COmxILConfigManager15FindConfigIndexEj @ 216 NONAME
+ _ZNK19COmxILConfigManager17GetExtensionIndexEPcP13OMX_INDEXTYPE @ 217 NONAME
+ _ZNK19COmxILConfigManager9GetConfigE13OMX_INDEXTYPEPv @ 218 NONAME
+ _ZTI10COmxILPort @ 219 NONAME
+ _ZTI14COmxILPortImpl @ 220 NONAME
+ _ZTI15COmxILAudioPort @ 221 NONAME
+ _ZTI15COmxILComponent @ 222 NONAME
+ _ZTI15COmxILImagePort @ 223 NONAME
+ _ZTI15COmxILOtherPort @ 224 NONAME
+ _ZTI15COmxILVideoPort @ 225 NONAME
+ _ZTI19COmxILAudioPortImpl @ 226 NONAME
+ _ZTI19COmxILComponentImpl @ 227 NONAME
+ _ZTI19COmxILConfigManager @ 228 NONAME
+ _ZTI19COmxILImagePortImpl @ 229 NONAME
+ _ZTI19COmxILOtherPortImpl @ 230 NONAME
+ _ZTI19COmxILVideoPortImpl @ 231 NONAME
+ _ZTI23COmxILConfigManagerImpl @ 232 NONAME
+ _ZTI24COmxILProcessingFunction @ 233 NONAME
+ _ZTI27XOmxILCallbackManagerIfImpl @ 234 NONAME
+ _ZTIN21COmxILCallbackManager16CCallbackCommandE @ 235 NONAME
+ _ZTIN21COmxILCallbackManager21CBufferRemovalCommandE @ 236 NONAME
+ _ZTIN21COmxILCallbackManager21CEventCallbackCommandE @ 237 NONAME
+ _ZTIN21COmxILCallbackManager26CBufferDoneCallbackCommandE @ 238 NONAME
+ _ZTIN21COmxILCallbackManager26CPortSettingsChangeCommandE @ 239 NONAME
+ _ZTIN21COmxILCallbackManager30CCompHandleRegistrationCommandE @ 240 NONAME
+ _ZTIN21COmxILCallbackManager34CTunnelCallbackRegistrationCommandE @ 241 NONAME
+ _ZTIN21COmxILCallbackManager35CClientCallbacksRegistrationCommandE @ 242 NONAME
+ _ZTIN21COmxILCallbackManager41CBufferMarkPropagationRegistrationCommandE @ 243 NONAME
+ _ZTIN9COmxILFsm11COmxILStateE @ 244 NONAME
+ _ZTIN9COmxILFsm15COmxILStateIdleE @ 245 NONAME
+ _ZTIN9COmxILFsm16COmxILStatePauseE @ 246 NONAME
+ _ZTIN9COmxILFsm17COmxILStateLoadedE @ 247 NONAME
+ _ZTIN9COmxILFsm18COmxILStateInvalidE @ 248 NONAME
+ _ZTIN9COmxILFsm20COmxILStateExecutingE @ 249 NONAME
+ _ZTIN9COmxILFsm22COmxILStatePauseToIdleE @ 250 NONAME
+ _ZTIN9COmxILFsm23COmxILStateIdleToLoadedE @ 251 NONAME
+ _ZTIN9COmxILFsm23COmxILStateLoadedToIdleE @ 252 NONAME
+ _ZTIN9COmxILFsm26COmxILStateExecutingToIdleE @ 253 NONAME
+ _ZTIN9COmxILFsm27COmxILStateWaitForResourcesE @ 254 NONAME
+ _ZTV10COmxILPort @ 255 NONAME
+ _ZTV14COmxILPortImpl @ 256 NONAME
+ _ZTV15COmxILAudioPort @ 257 NONAME
+ _ZTV15COmxILComponent @ 258 NONAME
+ _ZTV15COmxILImagePort @ 259 NONAME
+ _ZTV15COmxILOtherPort @ 260 NONAME
+ _ZTV15COmxILVideoPort @ 261 NONAME
+ _ZTV19COmxILAudioPortImpl @ 262 NONAME
+ _ZTV19COmxILComponentImpl @ 263 NONAME
+ _ZTV19COmxILConfigManager @ 264 NONAME
+ _ZTV19COmxILImagePortImpl @ 265 NONAME
+ _ZTV19COmxILOtherPortImpl @ 266 NONAME
+ _ZTV19COmxILVideoPortImpl @ 267 NONAME
+ _ZTV23COmxILConfigManagerImpl @ 268 NONAME
+ _ZTV24COmxILProcessingFunction @ 269 NONAME
+ _ZTV27XOmxILCallbackManagerIfImpl @ 270 NONAME
+ _ZTVN21COmxILCallbackManager16CCallbackCommandE @ 271 NONAME
+ _ZTVN21COmxILCallbackManager21CBufferRemovalCommandE @ 272 NONAME
+ _ZTVN21COmxILCallbackManager21CEventCallbackCommandE @ 273 NONAME
+ _ZTVN21COmxILCallbackManager26CBufferDoneCallbackCommandE @ 274 NONAME
+ _ZTVN21COmxILCallbackManager26CPortSettingsChangeCommandE @ 275 NONAME
+ _ZTVN21COmxILCallbackManager30CCompHandleRegistrationCommandE @ 276 NONAME
+ _ZTVN21COmxILCallbackManager34CTunnelCallbackRegistrationCommandE @ 277 NONAME
+ _ZTVN21COmxILCallbackManager35CClientCallbacksRegistrationCommandE @ 278 NONAME
+ _ZTVN21COmxILCallbackManager41CBufferMarkPropagationRegistrationCommandE @ 279 NONAME
+ _ZTVN9COmxILFsm11COmxILStateE @ 280 NONAME
+ _ZTVN9COmxILFsm15COmxILStateIdleE @ 281 NONAME
+ _ZTVN9COmxILFsm16COmxILStatePauseE @ 282 NONAME
+ _ZTVN9COmxILFsm17COmxILStateLoadedE @ 283 NONAME
+ _ZTVN9COmxILFsm18COmxILStateInvalidE @ 284 NONAME
+ _ZTVN9COmxILFsm20COmxILStateExecutingE @ 285 NONAME
+ _ZTVN9COmxILFsm22COmxILStatePauseToIdleE @ 286 NONAME
+ _ZTVN9COmxILFsm23COmxILStateIdleToLoadedE @ 287 NONAME
+ _ZTVN9COmxILFsm23COmxILStateLoadedToIdleE @ 288 NONAME
+ _ZTVN9COmxILFsm26COmxILStateExecutingToIdleE @ 289 NONAME
+ _ZTVN9COmxILFsm27COmxILStateWaitForResourcesE @ 290 NONAME
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/group/bld.inf Wed Aug 25 12:40:50 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_PLATFORMS
+BASEDEFAULT
+
+PRJ_EXPORTS
+// OMX IL Component Extensions
+omxilcomp.iby /epoc32/rom/include/omxilcomp.iby
+
+PRJ_MMPFILES
+// Component common framework
+../mmpfiles/omxilcomponentcommon.mmp
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/group/omxilcomp.iby Wed Aug 25 12:40:50 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:
+//
+
+
+/**
+ @file
+ @internalTechnology
+*/
+
+#ifndef OMXILCOMP_IBY
+#define OMXILCOMP_IBY
+
+// OMX IL component common
+file=ABI_DIR\BUILD_DIR\omxilcomponentcommon.dll System\Libs\omxilcomponentcommon.dll
+
+#endif // OMXILCOMP_IBY
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/mmpfiles/omxilcomponentcommon.mmp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,73 @@
+// Copyright (c) 2008-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 <mmf/common/mmfbase.hrh>
+#include "../src/omxilcomponent.hrh" // get UIDs
+
+TARGET omxilcomponentcommon.dll
+CAPABILITY ALL -TCB
+TARGETTYPE dll
+UID KSharedLibraryUidDefine KUidSymbianOmxILComponentCommonDll
+VENDORID 0x70000001
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+SOURCEPATH ../src/
+SOURCE omxilcomponent.cpp
+SOURCE omxilcomponentimpl.cpp
+SOURCE omxilcallbackmanagerifimpl.cpp
+SOURCE omxilcallbackmanager.cpp
+SOURCE omxilconfigmanager.cpp
+SOURCE omxilconfigmanagerimpl.cpp
+SOURCE omxilincontextcallbackmanager.cpp
+SOURCE omxilfsm.cpp
+SOURCE omxilport.cpp
+SOURCE omxilportimpl.cpp
+SOURCE omxilaudioport.cpp
+SOURCE omxilaudioportimpl.cpp
+SOURCE omxilportmanager.cpp
+SOURCE omxilprocessingfunction.cpp
+SOURCE omxilstate.cpp
+SOURCE omxilspecversion.cpp
+SOURCE omxilutil.cpp
+SOURCE omxilimageport.cpp
+SOURCE omxilimageportimpl.cpp
+SOURCE omxilvideoport.cpp
+SOURCE omxilvideoportimpl.cpp
+SOURCE omxilotherport.cpp
+SOURCE omxilotherportimpl.cpp
+SOURCE omxilclientclockport.cpp
+
+LIBRARY euser.lib
+LIBRARY mmfserverbaseclasses.lib
+
+// Uncomment to activate debug tracing in this module
+//MACRO _OMXIL_COMMON_DEBUG_TRACING_ON
+
+
+// Uncomment to activate tracing of FillThisBuffer and EmptyThisBuffer
+// This produces a *lot* of output
+//MACRO _OMXIL_COMMON_BUFFER_TRACING_ON
+
+// Uncomment to activate spec version checks in OMX IL structs
+//MACRO _OMXIL_COMMON_SPEC_VERSION_CHECKS_ON
+
+// Uncomment to activate the "alternatives to App Note IL #318"
+// See IL516c_Issue#1-Race-Conditions-Solutions-for-1.y_Nokia.pdf
+// MACRO _OMXIL_COMMON_IL516C_ON
+
+
+NOSTRICTDEF
+
+SMPSAFE
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/log.h Wed Aug 25 12:40:50 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
+
+//#define _OMXIL_COMMON_DEBUG_TRACING_ON
+#ifdef _OMXIL_COMMON_DEBUG_TRACING_ON
+
+
+
+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);
+ }
+
+#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, "[ccommon] ");
+ _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, "[common] ");
+ _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/omxil_generic/omxilcomplib/src/omxilaudioport.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,387 @@
+// Copyright (c) 2008-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 "log.h"
+#include "omxilaudioportimpl.h"
+#include <openmax/il/common/omxilaudioport.h>
+#include <openmax/il/common/omxilutil.h>
+
+EXPORT_C
+COmxILAudioPort::~COmxILAudioPort()
+ {
+ DEBUG_PRINTF(_L8("COmxILAudioPort::~COmxILAudioPort"));
+ delete ipAudioPortImpl;
+ }
+
+EXPORT_C
+COmxILAudioPort::COmxILAudioPort()
+ {
+ DEBUG_PRINTF(_L8("COmxILAudioPort::COmxILAudioPort"));
+ }
+
+EXPORT_C void COmxILAudioPort::ConstructL(const TOmxILCommonPortData& aCommonPortData, const RArray<OMX_AUDIO_CODINGTYPE>& aSupportedAudioFormats)
+ {
+ COmxILPort::ConstructL(aCommonPortData); //create COmxILPortImpl
+ ipAudioPortImpl=COmxILAudioPortImpl::NewL(aSupportedAudioFormats, aCommonPortData); //create COmxILAudioPortImpl
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILAudioPort::GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const
+ {
+ DEBUG_PRINTF(_L8("COmxILAudioPort::GetLocalOmxParamIndexes"));
+
+ // Always collect local indexes from parent
+ OMX_ERRORTYPE omxRetValue =
+ COmxILPort::GetLocalOmxParamIndexes(aIndexArray);
+
+ if (OMX_ErrorNone != omxRetValue)
+ {
+ return omxRetValue;
+ }
+
+ TInt err = aIndexArray.InsertInOrder(OMX_IndexParamAudioPortFormat);
+
+ // Note that index duplication is OK.
+ if (KErrNone != err && KErrAlreadyExists != err)
+ {
+ return OMX_ErrorInsufficientResources;
+ }
+
+ return OMX_ErrorNone;
+
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILAudioPort::GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const
+ {
+ DEBUG_PRINTF(_L8("COmxILAudioPort::GetLocalOmxConfigIndexes"));
+
+ // Always collect local indexes from parent
+ return COmxILPort::GetLocalOmxConfigIndexes(aIndexArray);
+
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILAudioPort::GetParameter(OMX_INDEXTYPE aParamIndex,
+ TAny* apComponentParameterStructure) const
+ {
+ DEBUG_PRINTF(_L8("COmxILAudioPort::GetParameter"));
+ __ASSERT_ALWAYS(ipAudioPortImpl, User::Panic(KOmxILAudioPortPanicCategory, 1));
+ OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+
+ switch(aParamIndex)
+ {
+ case OMX_IndexParamAudioPortFormat:
+ {
+ omxRetValue=ipAudioPortImpl->GetParameter(aParamIndex, apComponentParameterStructure);
+ }
+ break;
+
+ default:
+ {
+ // Try the parent's indexes
+ omxRetValue=COmxILPort::GetParameter(aParamIndex, apComponentParameterStructure);
+ }
+ };
+
+ return omxRetValue;
+
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILAudioPort::SetParameter(OMX_INDEXTYPE aParamIndex,
+ const TAny* apComponentParameterStructure,
+ TBool& aUpdateProcessingFunction)
+ {
+ DEBUG_PRINTF(_L8("COmxILAudioPort::SetParameter"));
+ __ASSERT_ALWAYS(ipAudioPortImpl, User::Panic(KOmxILAudioPortPanicCategory, 1));
+ aUpdateProcessingFunction = EFalse;
+
+ OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+ switch(aParamIndex)
+ {
+ case OMX_IndexParamAudioPortFormat:
+ {
+ omxRetValue=ipAudioPortImpl->SetParameter(aParamIndex, apComponentParameterStructure, aUpdateProcessingFunction);
+ }
+ break;
+
+ default:
+ {
+ // Try the parent's indexes
+ omxRetValue = COmxILPort::SetParameter(aParamIndex,
+ apComponentParameterStructure,
+ aUpdateProcessingFunction);
+ }
+ };
+
+ return omxRetValue;
+ }
+
+
+EXPORT_C OMX_ERRORTYPE
+COmxILAudioPort::GetConfig(OMX_INDEXTYPE aConfigIndex,
+ TAny* apComponentConfigStructure) const
+ {
+ DEBUG_PRINTF(_L8("COmxILPort::GetConfig"));
+ return COmxILPort::GetConfig(aConfigIndex,
+ apComponentConfigStructure);
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILAudioPort::SetConfig(OMX_INDEXTYPE aConfigIndex,
+ const TAny* apComponentConfigStructure,
+ TBool& aUpdateProcessingFunction)
+ {
+ DEBUG_PRINTF(_L8("COmxILPort::SetConfig"));
+ return COmxILPort::SetConfig(aConfigIndex,
+ apComponentConfigStructure,
+ aUpdateProcessingFunction);
+
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILAudioPort::GetExtensionIndex(OMX_STRING aParameterName,
+ OMX_INDEXTYPE* apIndexType) const
+ {
+ return COmxILPort::GetExtensionIndex(aParameterName,
+ apIndexType);
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILAudioPort::PopulateBuffer(OMX_BUFFERHEADERTYPE** appBufferHdr,
+ const OMX_PTR apAppPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer,
+ TBool& aPortPopulationCompleted)
+ {
+ DEBUG_PRINTF2(_L8("COmxILAudioPort::PopulateBuffer : pBuffer [%X]"), apBuffer);
+ return COmxILPort::PopulateBuffer(appBufferHdr,
+ apAppPrivate,
+ aSizeBytes,
+ apBuffer,
+ aPortPopulationCompleted);
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILAudioPort::FreeBuffer(OMX_BUFFERHEADERTYPE* apBufferHeader,
+ TBool& aPortDepopulationCompleted)
+ {
+ DEBUG_PRINTF2(_L8("COmxILAudioPort::FreeBuffer : BUFFER [%X]"), apBufferHeader);
+ return COmxILPort::FreeBuffer(apBufferHeader, aPortDepopulationCompleted);
+ }
+
+
+EXPORT_C OMX_ERRORTYPE
+COmxILAudioPort::TunnelRequest(OMX_HANDLETYPE aTunneledComp,
+ OMX_U32 aTunneledPort,
+ OMX_TUNNELSETUPTYPE* apTunnelSetup)
+ {
+ DEBUG_PRINTF(_L8("COmxILAudioPort::TunnelRequest"));
+ return COmxILPort::TunnelRequest(aTunneledComp,
+ aTunneledPort,
+ apTunnelSetup);
+ }
+
+
+EXPORT_C OMX_ERRORTYPE
+COmxILAudioPort::PopulateTunnel(TBool& portPopulationCompleted)
+ {
+ DEBUG_PRINTF(_L8("COmxILAudioPort::PopulateTunnel"));
+ return COmxILPort::PopulateTunnel(portPopulationCompleted);
+ }
+
+
+EXPORT_C OMX_ERRORTYPE
+COmxILAudioPort::FreeTunnel(TBool& portDepopulationCompleted)
+ {
+ DEBUG_PRINTF(_L8("COmxILAudioPort::FreeTunnel"));
+ return COmxILPort::FreeTunnel(portDepopulationCompleted);
+ }
+
+EXPORT_C TBool
+COmxILAudioPort::SetBufferSent(OMX_BUFFERHEADERTYPE* apBufferHeader,
+ TBool& aBufferMarkedWithOwnMark)
+ {
+ DEBUG_PRINTF(_L8("COmxILAudioPort::SetBufferSent"));
+ return COmxILPort::SetBufferSent(apBufferHeader,
+ aBufferMarkedWithOwnMark);
+ }
+
+EXPORT_C TBool
+COmxILAudioPort::SetBufferReturned(OMX_BUFFERHEADERTYPE* apBufferHeader)
+ {
+ DEBUG_PRINTF(_L8("COmxILAudioPort::SetBufferReturned"));
+ return COmxILPort::SetBufferReturned(apBufferHeader);
+ }
+
+EXPORT_C void
+COmxILAudioPort::SetTransitionToEnabled()
+ {
+ DEBUG_PRINTF(_L8("COmxILAudioPort::SetTransitionToEnabled"));
+ return COmxILPort::SetTransitionToEnabled();
+ }
+
+EXPORT_C void
+COmxILAudioPort::SetTransitionToDisabled()
+ {
+ DEBUG_PRINTF(_L8("COmxILAudioPort::SetTransitionToDisabled"));
+ return COmxILPort::SetTransitionToDisabled();
+ }
+
+EXPORT_C void
+COmxILAudioPort::SetTransitionToDisabledCompleted()
+ {
+ DEBUG_PRINTF(_L8("COmxILAudioPort::SetTransitionToDisabledCompleted"));
+ return COmxILPort::SetTransitionToDisabledCompleted();
+ }
+
+EXPORT_C void
+COmxILAudioPort::SetTransitionToEnabledCompleted()
+ {
+ DEBUG_PRINTF(_L8("COmxILAudioPort::SetTransitionToEnabledCompleted"));
+ return COmxILPort::SetTransitionToEnabledCompleted();
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILAudioPort::StoreBufferMark(const OMX_MARKTYPE* apMark)
+ {
+ DEBUG_PRINTF(_L8("COmxILAudioPort::StoreBufferMark"));
+ return COmxILPort::StoreBufferMark(apMark);
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILAudioPort::SetComponentRoleDefaults(TUint aComponentRoleIndex)
+ {
+ DEBUG_PRINTF(_L8("COmxILAudioPort::SetComponentRoleDefaults"));
+
+ return COmxILPort::SetComponentRoleDefaults(aComponentRoleIndex);
+ }
+
+EXPORT_C TBool
+COmxILAudioPort::HasAllBuffersAtHome() const
+ {
+ return COmxILPort::HasAllBuffersAtHome();
+ }
+
+EXPORT_C TBool
+COmxILAudioPort::IsBufferAtHome(OMX_BUFFERHEADERTYPE* apBufferHeader) const
+ {
+ DEBUG_PRINTF2(_L8("COmxILAudioPort::IsBufferAtHome : [%X]"), apBufferHeader);
+ return COmxILPort::IsBufferAtHome(apBufferHeader);
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILAudioPort::DoPortReconfiguration(TUint aPortSettingsIndex,
+ const TDesC8& aPortSettings,
+ OMX_EVENTTYPE& aEventForILClient)
+ {
+ DEBUG_PRINTF(_L8("COmxILAudioPort::DoPortReconfiguration"));
+
+ return COmxILPort::DoPortReconfiguration(aPortSettingsIndex,
+ aPortSettings,
+ aEventForILClient);
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILAudioPort::DoBufferAllocation(OMX_U32 aSizeBytes,
+ OMX_U8*& apPortSpecificBuffer,
+ OMX_PTR& apPortPrivate,
+ OMX_PTR& apPlatformPrivate,
+ OMX_PTR apAppPrivate)
+ {
+ DEBUG_PRINTF2(_L8("COmxILAudioPort::DoBufferAllocation : aSizeBytes[%u]"), aSizeBytes);
+ return COmxILPort::DoBufferAllocation(aSizeBytes,
+ apPortSpecificBuffer,
+ apPortPrivate,
+ apPlatformPrivate,
+ apAppPrivate);
+ }
+
+EXPORT_C void
+COmxILAudioPort::DoBufferDeallocation(OMX_PTR apPortSpecificBuffer,
+ OMX_PTR apPortPrivate,
+ OMX_PTR apPlatformPrivate,
+ OMX_PTR apAppPrivate)
+ {
+ DEBUG_PRINTF(_L8("COmxILAudioPort::DoBufferDeallocation"));
+ return COmxILPort::DoBufferDeallocation(apPortSpecificBuffer,
+ apPortPrivate,
+ apPlatformPrivate,
+ apAppPrivate);
+ }
+
+
+EXPORT_C OMX_ERRORTYPE
+COmxILAudioPort::DoBufferWrapping(OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer,
+ OMX_PTR& apPortPrivate,
+ OMX_PTR& apPlatformPrivate,
+ OMX_PTR apAppPrivate)
+ {
+ DEBUG_PRINTF(_L8("COmxILAudioPort::DoBufferWrapping"));
+ return COmxILPort::DoBufferWrapping(aSizeBytes,
+ apBuffer,
+ apPortPrivate,
+ apPlatformPrivate,
+ apAppPrivate);
+ }
+
+EXPORT_C void
+COmxILAudioPort::DoBufferUnwrapping(OMX_PTR apBuffer,
+ OMX_PTR appPortPrivate,
+ OMX_PTR apPlatformPrivate,
+ OMX_PTR apAppPrivate)
+ {
+
+ DEBUG_PRINTF(_L8("COmxILAudioPort::DoBufferUnwrapping"));
+ return COmxILPort::DoBufferUnwrapping(apBuffer,
+ appPortPrivate,
+ apPlatformPrivate,
+ apAppPrivate);
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILAudioPort::DoOmxUseBuffer(OMX_HANDLETYPE aTunnelledComponent,
+ OMX_BUFFERHEADERTYPE** appBufferHdr,
+ OMX_U32 aTunnelledPortIndex,
+ OMX_PTR apPortPrivate,
+ OMX_PTR apPlatformPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer)
+ {
+
+ DEBUG_PRINTF(_L8("COmxILAudioPort::DoOmxUseBuffer"));
+ return COmxILPort::DoOmxUseBuffer(aTunnelledComponent,
+ appBufferHdr,
+ aTunnelledPortIndex,
+ apPortPrivate,
+ apPlatformPrivate,
+ aSizeBytes,
+ apBuffer);
+ }
+
+EXPORT_C
+TInt COmxILAudioPort::Extension_(TUint aExtensionId, TAny *&a0, TAny *a1)
+ {
+ return COmxILPort::Extension_(aExtensionId, a0, a1);
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilaudioportimpl.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,161 @@
+// 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
+ @internalComponent
+*/
+
+#include "log.h"
+#include <openmax/il/common/omxilaudioport.h>
+#include "omxilaudioportimpl.h"
+#include <openmax/il/common/omxilutil.h>
+
+COmxILAudioPortImpl* COmxILAudioPortImpl::NewL(const RArray<OMX_AUDIO_CODINGTYPE>& aSupportedAudioFormats,
+ const TOmxILCommonPortData& aCommonPortData)
+ {
+ COmxILAudioPortImpl* self = new(ELeave) COmxILAudioPortImpl();
+ CleanupStack::PushL(self);
+ self->ConstructL(aSupportedAudioFormats, aCommonPortData);
+ CleanupStack::Pop();
+ return self;
+ }
+
+void COmxILAudioPortImpl::ConstructL(const RArray<OMX_AUDIO_CODINGTYPE>& aSupportedAudioFormats,
+ const TOmxILCommonPortData& aCommonPortData)
+ {
+ iParamAudioPortFormat.nSize = sizeof(OMX_AUDIO_PARAM_PORTFORMATTYPE);
+ iParamAudioPortFormat.nVersion = aCommonPortData.iOmxVersion;
+ iParamAudioPortFormat.nPortIndex = aCommonPortData.iPortIndex;
+ iParamAudioPortFormat.nIndex = 0;
+
+ TUint count = aSupportedAudioFormats.Count();
+ for (TInt i = 0; i < count; i++)
+ {
+ iSupportedAudioFormats.AppendL(aSupportedAudioFormats[i]);
+ }
+ iParamAudioPortFormat.eEncoding = count ? iSupportedAudioFormats[0] : OMX_AUDIO_CodingUnused;
+ }
+
+COmxILAudioPortImpl::~COmxILAudioPortImpl()
+ {
+ DEBUG_PRINTF(_L8("COmxILAudioPortImpl::~COmxILAudioPortImpl"));
+ iSupportedAudioFormats.Close();
+ }
+
+COmxILAudioPortImpl::COmxILAudioPortImpl()
+ {
+ DEBUG_PRINTF(_L8("COmxILAudioPortImpl::COmxILAudioPortImpl"));
+ }
+
+OMX_ERRORTYPE
+COmxILAudioPortImpl::GetParameter(OMX_INDEXTYPE aParamIndex,
+ TAny* apComponentParameterStructure) const
+ {
+ DEBUG_PRINTF(_L8("COmxILAudioPortImpl::GetParameter"));
+
+ OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+ switch(aParamIndex)
+ {
+ case OMX_IndexParamAudioPortFormat:
+ {
+ if (OMX_ErrorNone != (omxRetValue =
+ TOmxILUtil::CheckOmxStructSizeAndVersion(
+ apComponentParameterStructure,
+ sizeof(OMX_AUDIO_PARAM_PORTFORMATTYPE))))
+ {
+ return omxRetValue;
+ }
+
+ OMX_AUDIO_PARAM_PORTFORMATTYPE* pParamAudioPortFormat
+ = static_cast<OMX_AUDIO_PARAM_PORTFORMATTYPE*>(apComponentParameterStructure);
+
+ if (pParamAudioPortFormat->nIndex >=
+ iSupportedAudioFormats.Count())
+ {
+ return OMX_ErrorNoMore;
+ }
+
+ pParamAudioPortFormat->eEncoding =
+ iSupportedAudioFormats[pParamAudioPortFormat->nIndex];
+ }
+ break;
+
+ default:
+ __ASSERT_ALWAYS(EFalse, User::Panic(KOmxILAudioPortPanicCategory, 1));
+
+ };
+ return OMX_ErrorNone;
+ }
+
+OMX_ERRORTYPE
+COmxILAudioPortImpl::SetParameter(OMX_INDEXTYPE aParamIndex,
+ const TAny* apComponentParameterStructure,
+ TBool& aUpdateProcessingFunction)
+ {
+ DEBUG_PRINTF(_L8("COmxILAudioPortImpl::SetParameter"));
+ aUpdateProcessingFunction = EFalse;
+ OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+ switch(aParamIndex)
+ {
+ case OMX_IndexParamAudioPortFormat:
+ {
+ if (OMX_ErrorNone != (omxRetValue =
+ TOmxILUtil::CheckOmxStructSizeAndVersion(
+ const_cast<OMX_PTR>(apComponentParameterStructure),
+ sizeof(OMX_AUDIO_PARAM_PORTFORMATTYPE))))
+ {
+ return omxRetValue;
+ }
+
+ const OMX_AUDIO_PARAM_PORTFORMATTYPE* pParamAudioPortFormat
+ = static_cast<const OMX_AUDIO_PARAM_PORTFORMATTYPE*>(
+ apComponentParameterStructure);
+
+ // Check in case the specified format is not actually supported by this
+ // port
+ OMX_AUDIO_CODINGTYPE newDefaultCodingType =
+ pParamAudioPortFormat->eEncoding;
+
+ if (newDefaultCodingType > OMX_AUDIO_CodingMax)
+ {
+ return OMX_ErrorBadParameter;
+ }
+
+ if (KErrNotFound == iSupportedAudioFormats.Find(newDefaultCodingType))
+ {
+ return OMX_ErrorUnsupportedSetting;
+ }
+
+ // Set the new default format, but check first that we are actually
+ // changing something...
+ if (iParamAudioPortFormat.eEncoding != newDefaultCodingType)
+ {
+ iParamAudioPortFormat.eEncoding = newDefaultCodingType;
+ // This is an indication to the PortManager that the processing
+ // function needs to get updated
+ //
+ aUpdateProcessingFunction = ETrue;
+ }
+ }
+ break;
+
+ default:
+ __ASSERT_ALWAYS(EFalse, User::Panic(KOmxILAudioPortPanicCategory, 1));
+ };
+
+ return OMX_ErrorNone;
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilaudioportimpl.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,53 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+/**
+ @file
+ @internalComponent
+*/
+
+#ifndef OMXILAUDIOPORTIMPL_H
+#define OMXILAUDIOPORTIMPL_H
+
+#include <e32base.h>
+#include <openmax/il/khronos/v1_x/OMX_Types.h>
+#include <openmax/il/khronos/v1_x/OMX_Core.h>
+#include <openmax/il/khronos/v1_x/OMX_Component.h>
+#include <openmax/il/common/omxilport.h>
+
+class COmxILAudioPortImpl : public CBase
+ {
+public:
+ static COmxILAudioPortImpl* NewL(const RArray<OMX_AUDIO_CODINGTYPE>& aSupportedAudioFormats,
+ const TOmxILCommonPortData& aCommonPortData);
+ ~COmxILAudioPortImpl();
+ OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex,
+ TAny* apComponentParameterStructure) const;
+ OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex,
+ const TAny* apComponentParameterStructure,
+ TBool& aUpdateProcessingFunction);
+
+private:
+ COmxILAudioPortImpl();
+ void ConstructL(const RArray<OMX_AUDIO_CODINGTYPE>& aSupportedAudioFormats,
+ const TOmxILCommonPortData& aCommonPortData);
+private:
+ RArray<OMX_AUDIO_CODINGTYPE> iSupportedAudioFormats;
+ OMX_AUDIO_PARAM_PORTFORMATTYPE iParamAudioPortFormat;
+ };
+
+#endif // OMXILAUDIOPORTIMPL_H
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilcallbackmanager.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,1084 @@
+// 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 "omxilcallbackmanager.h"
+#include "omxilfsm.h"
+#include <openmax/il/common/omxilstatedefs.h>
+#include <openmax/il/common/omxilutil.h>
+#include "omxilportmanagerif.h"
+
+const TInt COmxILCallbackManager::KMaxMsgQueueEntries;
+
+
+COmxILCallbackManager*
+COmxILCallbackManager::NewL(
+ OMX_HANDLETYPE apComponentHandle,
+ OMX_PTR apAppData,
+ OMX_CALLBACKTYPE* apCallbacks)
+ {
+ DEBUG_PRINTF(_L8("COmxILCallbackManager::NewL"));
+ COmxILCallbackManager* self = new (ELeave)COmxILCallbackManager(
+ apComponentHandle,
+ apAppData,
+ apCallbacks);
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ CleanupStack::Pop(self);
+ return self;
+ }
+
+void
+COmxILCallbackManager::ConstructL()
+ {
+ DEBUG_PRINTF(_L8("COmxILCallbackManager::ConstructL"));
+
+ CActiveScheduler::Add(this);
+ User::LeaveIfError(iCommandQueue.CreateLocal(KMaxMsgQueueEntries));
+ iCommandQueue.NotifyDataAvailable(iStatus);
+
+ User::LeaveIfError(iPendingQueue.CreateLocal(KMaxMsgQueueEntries));
+
+ SetActive();
+
+ }
+
+COmxILCallbackManager::COmxILCallbackManager(OMX_HANDLETYPE apComponentHandle,
+ OMX_PTR apAppData,
+ OMX_CALLBACKTYPE* apCallbacks)
+ :
+ CActive(CActive::EPriorityStandard),
+ XOmxILCallbackManagerIfImpl(
+ static_cast<OMX_COMPONENTTYPE*>(apComponentHandle),
+ apAppData,
+ apCallbacks),
+ iCommandQueue(),
+ iPendingQueue(),
+ iFlushPendingQueue(EFalse),
+ iCurrentState(OMX_StateLoaded),
+ iPreviousState(OMX_StateLoaded)
+ {
+ DEBUG_PRINTF(_L8("COmxILCallbackManager::COmxILCallbackManager"));
+ }
+
+
+COmxILCallbackManager::~COmxILCallbackManager()
+ {
+ DEBUG_PRINTF(_L8("COmxILCallbackManager::~COmxILCallbackManager"));
+
+ Cancel();
+
+ CleanUpQueue(iPendingQueue);
+
+ CleanUpQueue(iCommandQueue);
+
+ }
+
+
+void
+COmxILCallbackManager::CleanUpQueue(RCallbackManagerQueue& aQueue)
+ {
+ DEBUG_PRINTF(_L8("COmxILCallbackManager::CleanUpQueue"));
+
+ if (aQueue.Handle() != 0)
+ {
+ CCallbackCommand* pCommand = 0;
+ TInt err = KErrNone;
+ while ((err = aQueue.Receive(pCommand)) == KErrNone)
+ {
+ DEBUG_PRINTF2(_L8("COmxILCallbackManager::CleanUpQueue : aQueue.Receive [%X]"), pCommand);
+ delete pCommand;
+ pCommand = 0;
+ }
+
+ if (KErrNone != err)
+ {
+ DEBUG_PRINTF2(_L8("COmxILCallbackManager::CleanUpQueue : aQueue.Receive returned error [%d]"), err);
+ if (KErrNoMemory == err)
+ {
+ HandleInsufficientResources();
+ }
+ }
+
+ }
+
+ aQueue.Close();
+
+ }
+
+
+void
+COmxILCallbackManager::SetPortManager(MOmxILPortManagerIf& apPortManager)
+ {
+ DoSetPortManager(apPortManager);
+ }
+
+void
+COmxILCallbackManager::SetFsm(COmxILFsm& apFsm)
+ {
+ DoSetFsm(apFsm);
+ }
+
+OMX_ERRORTYPE
+COmxILCallbackManager::RegisterComponentHandle(OMX_HANDLETYPE aComponentHandle)
+ {
+ DEBUG_PRINTF(_L8("COmxILCallbackManager::RegisterComponentHandle"));
+
+ __ASSERT_DEBUG(aComponentHandle,
+ User::Panic(KOmxILCallbackManagerPanicCategory, 1));
+
+ CCompHandleRegistrationCommand* pHandleReg =
+ new CCompHandleRegistrationCommand(aComponentHandle);
+ if (!pHandleReg || (iCommandQueue.Send(pHandleReg) != KErrNone))
+ {
+ delete pHandleReg;
+ DoRegisterComponentHandle(aComponentHandle);
+ return OMX_ErrorInsufficientResources;
+ }
+
+ return OMX_ErrorNone;
+
+ }
+
+/**
+ The IL Client callback registration is handled in this implementation
+ asynchronously. Note that this implementation assumes that the IL Client
+ will update the callbacks information once all expected callbacks from this
+ component have already been received and therefore, the callback change will
+ be safe leading to no race condition at the IL Client side.
+
+ @param apCallbacks The IL Client callback structure.
+
+ @param apAppData Pointer to an application provided value so that the
+ application can have a component specific context when receiving
+ the callback.
+
+ @return OMX_ERRORTYPE
+ */
+OMX_ERRORTYPE
+COmxILCallbackManager::RegisterILClientCallbacks(
+ const OMX_CALLBACKTYPE* apCallbacks,
+ const OMX_PTR apAppData)
+ {
+ DEBUG_PRINTF(_L8("COmxILCallbackManager::RegisterILClientCallbacks"));
+
+ CClientCallbacksRegistrationCommand* pClientCBacksReg =
+ new CClientCallbacksRegistrationCommand(
+ apCallbacks,
+ apAppData);
+ if (!pClientCBacksReg || (iCommandQueue.Send(pClientCBacksReg) != KErrNone))
+ {
+ delete pClientCBacksReg;
+ DoRegisterILClientCallbacks(apCallbacks, apAppData);
+ return OMX_ErrorInsufficientResources;
+ }
+
+ return OMX_ErrorNone;
+
+ }
+
+OMX_ERRORTYPE
+COmxILCallbackManager::RegisterTunnelCallback(
+ OMX_U32 aLocalPortIndex,
+ OMX_DIRTYPE aLocalPortDirection,
+ OMX_HANDLETYPE aTunnelledComponentHandle,
+ OMX_U32 aTunnelledPortIndex)
+ {
+ DEBUG_PRINTF2(_L8("COmxILCallbackManager::RegisterTunnelCallback : aTunnelledComponentHandle [%x]"), aTunnelledComponentHandle);
+
+ CTunnelCallbackRegistrationCommand* pTunnelCBacksReg =
+ new CTunnelCallbackRegistrationCommand(aLocalPortIndex,
+ aLocalPortDirection,
+ aTunnelledComponentHandle,
+ aTunnelledPortIndex);
+
+ if (!pTunnelCBacksReg || (iCommandQueue.Send(pTunnelCBacksReg) != KErrNone))
+ {
+ delete pTunnelCBacksReg;
+ return OMX_ErrorInsufficientResources;
+ }
+
+ return OMX_ErrorNone;
+
+ }
+
+OMX_ERRORTYPE
+COmxILCallbackManager::DeregisterTunnelCallback(
+ OMX_U32 aLocalPortIndex)
+ {
+
+ DEBUG_PRINTF(_L8("COmxILCallbackManager::DeregisterTunnelCallback"));
+
+ return RegisterTunnelCallback(aLocalPortIndex,
+ OMX_DirMax,
+ 0,
+ 0);
+
+ }
+
+OMX_ERRORTYPE
+COmxILCallbackManager::RegisterBufferMarkPropagationPort(
+ OMX_U32 aPortIndex,
+ OMX_U32 aPropagationPortIndex)
+ {
+ DEBUG_PRINTF(_L8("COmxILCallbackManager::RegisterBufferMarkPropagationPort"));
+
+ CBufferMarkPropagationRegistrationCommand* pBufferMarkPropReg =
+ new CBufferMarkPropagationRegistrationCommand(aPortIndex,
+ aPropagationPortIndex);
+ if (!pBufferMarkPropReg || (iCommandQueue.Send(pBufferMarkPropReg) != KErrNone))
+ {
+ delete pBufferMarkPropReg;
+ HandleInsufficientResources();
+ }
+
+ return OMX_ErrorNone;
+
+ }
+
+TBool
+COmxILCallbackManager::BufferRemovalIndication(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_DIRTYPE aDirection)
+ {
+ DEBUG_PRINTF(_L8("COmxILCallbackManager::BufferRemovalIndication"));
+
+ CBufferRemovalCommand* pBufferRemovalCmd =
+ new CBufferRemovalCommand(apBufferHeader, aDirection);
+
+ if (!pBufferRemovalCmd ||
+ (iCommandQueue.Send(pBufferRemovalCmd) != KErrNone))
+ {
+ delete pBufferRemovalCmd;
+ HandleInsufficientResources();
+ }
+
+ // Always return false now as the buffer would be removed asynchronously
+ return EFalse;
+
+ }
+
+OMX_ERRORTYPE
+COmxILCallbackManager::TransitionCompleteNotification(OMX_STATETYPE aOmxState)
+ {
+ DEBUG_PRINTF(_L8("COmxILCallbackManager::TransitionCompleteNotification"));
+
+ return EventNotificationImpl(OMX_EventCmdComplete,
+ OMX_CommandStateSet,
+ aOmxState,
+ 0);
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILCallbackManager::CommandCompleteNotification(OMX_COMMANDTYPE aOmxCommand,
+ OMX_U32 aOmxPortIndex)
+ {
+ DEBUG_PRINTF(_L8("COmxILCallbackManager::CommandCompleteNotification"));
+
+ return EventNotification(OMX_EventCmdComplete,
+ aOmxCommand,
+ aOmxPortIndex,
+ 0);
+
+ }
+
+#ifdef _OMXIL_COMMON_IL516C_ON
+OMX_ERRORTYPE
+COmxILCallbackManager::EjectBuffersRequest(OMX_U32 aLocalOmxPortIndex)
+ {
+ DEBUG_PRINTF2(_L8("COmxILCallbackManager::EjectBuffersRequest : aLocalOmxPortIndex [%u]"), aLocalOmxPortIndex);
+
+ CEjectBuffersRequestCommand* pEjectCBack =
+ new CEjectBuffersRequestCommand(aLocalOmxPortIndex);
+ if (!pEjectCBack || (iCommandQueue.Send(pEjectCBack) != KErrNone))
+ {
+ delete pEjectCBack;
+ HandleInsufficientResources();
+ }
+
+ return OMX_ErrorNone;
+
+ }
+#endif
+
+OMX_ERRORTYPE
+COmxILCallbackManager::ErrorEventNotification(OMX_ERRORTYPE aOmxError)
+ {
+ DEBUG_PRINTF2(_L8("COmxILCallbackManager::ErrorEventNotification : aOmxError[%X] "), aOmxError);
+
+ return EventNotification(OMX_EventError,
+ aOmxError,
+ 0,
+ 0);
+
+ }
+
+OMX_ERRORTYPE
+COmxILCallbackManager::EventNotification(OMX_EVENTTYPE aEvent,
+ TUint32 aData1,
+ TUint32 aData2,
+ OMX_STRING aExtraInfo)
+ {
+ // The error code is ignored intentionally, as errors from this function cannot be handled by clients, since they don't have
+ // another mechanism for reporting an error
+ (void)EventNotificationImpl(aEvent, aData1, aData2, aExtraInfo);
+ return OMX_ErrorNone;
+ }
+
+
+OMX_ERRORTYPE COmxILCallbackManager::EventNotificationImpl(OMX_EVENTTYPE aEvent,
+ TUint32 aData1,
+ TUint32 aData2,
+ OMX_STRING aExtraInfo)
+ {
+ DEBUG_PRINTF4(_L8("COmxILCallbackManager::EventNotificationImpl : aEvent[%X] aData1[%X] aData2[%u]"), aEvent, aData1, aData2);
+
+ CEventCallbackCommand* pEventCBack =
+ new CEventCallbackCommand(aEvent,
+ aData1,
+ aData2,
+ aExtraInfo);
+ if (!pEventCBack || (iCommandQueue.Send(pEventCBack) != KErrNone))
+ {
+ delete pEventCBack;
+ HandleInsufficientResources();
+ return OMX_ErrorInsufficientResources;
+ }
+
+ return OMX_ErrorNone;
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILCallbackManager::BufferDoneNotification(OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_U32 aLocalPortIndex,
+ OMX_DIRTYPE aLocalPortDirection)
+ {
+ DEBUG_PRINTF(_L8("COmxILCallbackManager::BufferDoneNotificaton"));
+
+ return SendBufferDoneNotification(apBufferHeader,
+ aLocalPortIndex,
+ aLocalPortDirection,
+ CCallbackCommand::EPriorityNormal);
+
+ }
+
+OMX_ERRORTYPE
+COmxILCallbackManager::ClockBufferDoneNotification(OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_U32 aLocalPortIndex,
+ OMX_DIRTYPE aLocalPortDirection)
+ {
+ DEBUG_PRINTF(_L8("COmxILCallbackManager::ClockBufferDoneNotification"));
+
+ return SendBufferDoneNotification(apBufferHeader,
+ aLocalPortIndex,
+ aLocalPortDirection,
+ CCallbackCommand::EPriorityHigh);
+
+ }
+
+OMX_ERRORTYPE
+COmxILCallbackManager::PortSettingsChangeNotification(
+ OMX_U32 aLocalPortIndex,
+ TUint aPortSettingsIndex,
+ const TDesC8& aPortSettings)
+ {
+ DEBUG_PRINTF2(_L8("COmxILCallbackManager::PortSettingsChangeNotification : aLocalPortIndex[%d]"), aLocalPortIndex);
+
+ HBufC8* pPortSettings = aPortSettings.Alloc();
+ if (!pPortSettings)
+ {
+ HandleInsufficientResources();
+ return OMX_ErrorNone;
+ }
+
+ CPortSettingsChangeCommand* pPortSettingsCmd =
+ new CPortSettingsChangeCommand(aLocalPortIndex,
+ aPortSettingsIndex,
+ pPortSettings);
+ if (!pPortSettingsCmd)
+ {
+ delete pPortSettings;
+ HandleInsufficientResources();
+ return OMX_ErrorNone;
+ }
+
+ if (iCommandQueue.Send(pPortSettingsCmd) != KErrNone)
+ {
+ delete pPortSettingsCmd; // Destructor will delete pPortSettings
+ HandleInsufficientResources();
+ }
+
+ return OMX_ErrorNone;
+
+ }
+
+OMX_ERRORTYPE
+COmxILCallbackManager::SendBufferDoneNotification(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_U32 aLocalPortIndex,
+ OMX_DIRTYPE aLocalPortDirection,
+ TInt aPriority)
+ {
+ DEBUG_PRINTF(_L8("COmxILCallbackManager::SendBufferDoneNotification"));
+
+ __ASSERT_ALWAYS(apBufferHeader &&
+ (OMX_DirInput == aLocalPortDirection ||
+ OMX_DirOutput == aLocalPortDirection),
+ User::Panic(KOmxILCallbackManagerPanicCategory, 1));
+
+ __ASSERT_ALWAYS(apBufferHeader->nOffset + apBufferHeader->nFilledLen
+ <= apBufferHeader->nAllocLen,
+ User::Panic(KOmxILCallbackManagerPanicCategory, 1));
+
+ CBufferDoneCallbackCommand* pEventCBack =
+ new CBufferDoneCallbackCommand(apBufferHeader,
+ aLocalPortIndex,
+ aLocalPortDirection,
+ aPriority);
+
+ if (!pEventCBack || (iCommandQueue.Send(pEventCBack) != KErrNone))
+ {
+ delete pEventCBack;
+ HandleInsufficientResources();
+ }
+
+ return OMX_ErrorNone;
+
+ }
+
+
+void
+COmxILCallbackManager::RunL()
+ {
+ DEBUG_PRINTF2(_L8("COmxILCallbackManager::RunL : Handle[%X]"), ipHandle);
+
+ ProcessQueue(iCommandQueue);
+
+ // Setup for next callbacks
+ iCommandQueue.NotifyDataAvailable(iStatus);
+ SetActive();
+
+ }
+
+
+void
+COmxILCallbackManager::ProcessQueue(RCallbackManagerQueue& aQueue)
+ {
+ DEBUG_PRINTF2(_L8("COmxILCallbackManager::ProcessQueue : Handle[%X]"), ipHandle);
+
+ CCallbackCommand* pCommand = 0;
+
+ TInt receiveRes = 0;
+ TBool hasBeenDeferred = EFalse;
+ while ((receiveRes = aQueue.Receive(pCommand)) == KErrNone)
+ {
+ if (pCommand)
+ {
+ DEBUG_PRINTF2(_L8("COmxILCallbackManager::ProcessQueue : aQueue.Receive [%X]"),
+ pCommand);
+ hasBeenDeferred = EFalse;
+ (*pCommand)(*this, hasBeenDeferred);
+ if (hasBeenDeferred)
+ {
+ // Move the current command to the pending queue
+ if (iPendingQueue.Send(pCommand) != KErrNone)
+ {
+ delete pCommand;
+ pCommand = 0;
+ HandleInsufficientResources();
+ }
+ }
+ else
+ {
+ delete pCommand;
+ pCommand = 0;
+ }
+ }
+
+ }
+
+ if (KErrNoMemory == receiveRes)
+ {
+ HandleInsufficientResources();
+ }
+
+ }
+
+void
+COmxILCallbackManager::DoCancel()
+ {
+ DEBUG_PRINTF2(_L8("COmxILCallbackManager::DoCancel : Handle[%X]"), ipHandle);
+
+ iCommandQueue.CancelDataAvailable();
+
+ }
+
+
+//
+// COmxILCallbackManager::RCallbackManagerQueue
+//
+TBool
+COmxILCallbackManager::RCallbackManagerQueue::RemoveBufferDoneCbCommandsByBufferHeader(
+ COmxILCallbackManager& aCbMgr,
+ const OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_DIRTYPE aDirection)
+ {
+ DEBUG_PRINTF2(_L8("RCallbackManagerQueue::RemoveBufferDoneCbCommandsByBufferHeader : Handle[%X]"), aCbMgr.ipHandle);
+
+ if (KErrNone != DrainBackQueue())
+ {
+ aCbMgr.HandleInsufficientResources();
+ return EFalse;
+ }
+
+ if(!iFrontQueue.IsEmpty())
+ {
+ TBool removed = EFalse;
+ TDblQueIter<TFrontQueueElement> frontQueueIter(iFrontQueue);
+ TFrontQueueElement* pLastElement = iFrontQueue.Last();
+ TFrontQueueElement* pCurrentElement = 0;
+
+ do
+ {
+ pCurrentElement = frontQueueIter++;
+ __ASSERT_DEBUG(pCurrentElement && pCurrentElement->ipInfo,
+ User::Panic(KOmxILCallbackManagerPanicCategory, 1));
+ removed = reinterpret_cast<CCallbackCommand*>(
+ const_cast<TAny*>(pCurrentElement->ipInfo))->
+ DoRemoveBufferDoneCbCommandByBufferHeader(aCbMgr,
+ apBufferHeader,
+ aDirection);
+ if (removed)
+ {
+ pCurrentElement->iLink.Deque();
+ delete reinterpret_cast<CCallbackCommand*>(
+ const_cast<TAny*>(pCurrentElement->ipInfo));
+ delete pCurrentElement;
+ DEBUG_PRINTF2(_L8("RCallbackManagerQueue::RemoveBufferDoneCbCommandsByBufferHeader : Removed Buffer Done @ Header [%X]"), apBufferHeader);
+ return ETrue;
+ }
+ }
+ while (pCurrentElement != pLastElement);
+ }
+
+ return EFalse;
+
+ }
+
+TBool
+COmxILCallbackManager::RCallbackManagerQueue::RemoveBufferDoneCbCommandsByPortIndex(
+ COmxILCallbackManager& aCbMgr,
+ OMX_U32 aLocalPortIndex)
+ {
+ DEBUG_PRINTF2(_L8("RCallbackManagerQueue::RemoveBufferDoneCbCommandsByPortIndex : Handle[%X]"), aCbMgr.ipHandle);
+
+ TBool somethingRemoved = EFalse;
+
+ if (KErrNone != DrainBackQueue())
+ {
+ aCbMgr.HandleInsufficientResources();
+ return EFalse;
+ }
+
+ if(!iFrontQueue.IsEmpty())
+ {
+ TBool removed = EFalse;
+ TDblQueIter<TFrontQueueElement> frontQueueIter(iFrontQueue);
+ TFrontQueueElement* pLastElement = iFrontQueue.Last();
+ TFrontQueueElement* pCurrentElement = 0;
+
+ do
+ {
+ pCurrentElement = frontQueueIter++;
+ __ASSERT_DEBUG(pCurrentElement && pCurrentElement->ipInfo,
+ User::Panic(KOmxILCallbackManagerPanicCategory, 1));
+ removed = reinterpret_cast<CCallbackCommand*>(
+ const_cast<TAny*>(pCurrentElement->ipInfo))->
+ DoRemoveBufferDoneCbCommandByPortIndex(aCbMgr,
+ aLocalPortIndex);
+ if (removed)
+ {
+ somethingRemoved = ETrue;
+ pCurrentElement->iLink.Deque();
+ delete reinterpret_cast<CCallbackCommand*>(
+ const_cast<TAny*>(pCurrentElement->ipInfo));
+ delete pCurrentElement;
+ DEBUG_PRINTF2(_L8("RCallbackManagerQueue::RemoveBufferDoneCbCommandsByPortIndex : Removed Buffer Done @ Port Index [%d]"), aLocalPortIndex);
+ }
+ }
+ while (pCurrentElement != pLastElement);
+ }
+
+ return somethingRemoved;
+
+ }
+
+
+TBool
+COmxILCallbackManager::RCallbackManagerQueue::ExecuteBufferDoneCbCommandsByPortIndex(
+ COmxILCallbackManager& aCbMgr,
+ OMX_U32 aLocalPortIndex)
+ {
+ DEBUG_PRINTF2(_L8("RCallbackManagerQueue::ExecuteBufferDoneCbCommandsByPortIndex : Handle[%X]"), aCbMgr.ipHandle);
+
+ TBool somethingExecuted = EFalse;
+
+ if (KErrNone != DrainBackQueue())
+ {
+ aCbMgr.HandleInsufficientResources();
+ return EFalse;
+ }
+
+ if(!iFrontQueue.IsEmpty())
+ {
+ TBool executed = EFalse;
+ TDblQueIter<TFrontQueueElement> frontQueueIter(iFrontQueue);
+ TFrontQueueElement* pLastElement = iFrontQueue.Last();
+ TFrontQueueElement* pCurrentElement = 0;
+
+ do
+ {
+ pCurrentElement = frontQueueIter++;
+ __ASSERT_DEBUG(pCurrentElement && pCurrentElement->ipInfo,
+ User::Panic(KOmxILCallbackManagerPanicCategory, 1));
+ executed = reinterpret_cast<CCallbackCommand*>(
+ const_cast<TAny*>(pCurrentElement->ipInfo))->
+ DoExecuteBufferDoneCbCommandByPortIndex(aCbMgr,
+ aLocalPortIndex);
+ if (executed)
+ {
+ somethingExecuted = ETrue;
+ pCurrentElement->iLink.Deque();
+ delete reinterpret_cast<CCallbackCommand*>(
+ const_cast<TAny*>(pCurrentElement->ipInfo));
+ delete pCurrentElement;
+ DEBUG_PRINTF2(_L8("RCallbackManagerQueue::ExecuteBufferDoneCbCommandsByPortIndex : Executed Buffer Done @ Port Index [%d]"), aLocalPortIndex);
+ }
+ }
+ while (pCurrentElement != pLastElement);
+ }
+
+ return somethingExecuted;
+
+ }
+
+
+//
+// COmxILCallbackManager commands
+//
+
+TBool
+COmxILCallbackManager::CCallbackCommand::DoRemoveBufferDoneCbCommandByBufferHeader(
+ COmxILCallbackManager& /*aCbMgr*/,
+ const OMX_BUFFERHEADERTYPE* /*apBufferHeader*/,
+ OMX_DIRTYPE /*aDirection*/)
+ {
+ return EFalse;
+ }
+
+TBool
+COmxILCallbackManager::CCallbackCommand::DoRemoveBufferDoneCbCommandByPortIndex(
+ COmxILCallbackManager& /*aCbMgr*/,
+ OMX_U32 /* aLocalPortIndex */)
+ {
+ return EFalse;
+ }
+
+TBool
+COmxILCallbackManager::CCallbackCommand::DoExecuteBufferDoneCbCommandByPortIndex(
+ COmxILCallbackManager& /*aCbMgr*/,
+ OMX_U32 /* aLocalPortIndex */)
+ {
+ return EFalse;
+ }
+
+void
+COmxILCallbackManager::CCompHandleRegistrationCommand::operator()(
+ COmxILCallbackManager& aCbMgr, TBool& /* aHasBeenDeferred */)
+ {
+ DEBUG_PRINTF2(_L8("CCompHandleRegistrationCommand::operator() : Handle[%X]"), aCbMgr.ipHandle);
+ aCbMgr.DoRegisterComponentHandle(ipHandle);
+ }
+
+void
+COmxILCallbackManager::CClientCallbacksRegistrationCommand::operator()(
+ COmxILCallbackManager& aCbMgr, TBool& /* aHasBeenDeferred */)
+ {
+ DEBUG_PRINTF2(_L8("CClientCallbacksRegistrationCommand::operator() : Handle[%X]"), aCbMgr.ipHandle);
+ aCbMgr.DoRegisterILClientCallbacks(ipCallbacks, ipAppData);
+ }
+
+void
+COmxILCallbackManager::CBufferMarkPropagationRegistrationCommand::operator()(
+ COmxILCallbackManager& aCbMgr, TBool& /* aHasBeenDeferred */)
+ {
+ DEBUG_PRINTF2(_L8("CBufferMarkPropagationRegistrationCommand::operator() : Handle[%X]"), aCbMgr.ipHandle);
+
+ OMX_ERRORTYPE omxError =
+ aCbMgr.DoRegisterBufferMarkPropagationPort(
+ iMarkPropagationInfo.iPortIndex,
+ iMarkPropagationInfo.iPropagationPortIndex);
+
+ if (OMX_ErrorInsufficientResources == omxError)
+ {
+ aCbMgr.HandleInsufficientResources();
+ }
+ }
+
+void
+COmxILCallbackManager::CBufferRemovalCommand::operator()(
+ COmxILCallbackManager& aCbMgr, TBool& /* aHasBeenDeferred */)
+ {
+ DEBUG_PRINTF2(_L8("CBufferRemovalCommand::operator() : Handle[%X]"), aCbMgr.ipHandle);
+
+ // Returned value not relevant
+ aCbMgr.iPendingQueue.RemoveBufferDoneCbCommandsByBufferHeader(
+ aCbMgr,
+ ipBufferHeader,
+ iDirection);
+
+ // Returned value not relevant
+ aCbMgr.iCommandQueue.RemoveBufferDoneCbCommandsByBufferHeader(
+ aCbMgr,
+ ipBufferHeader,
+ iDirection);
+
+
+ }
+
+void
+COmxILCallbackManager::CTunnelCallbackRegistrationCommand::operator()(
+ COmxILCallbackManager& aCbMgr, TBool& /* aHasBeenDeferred */)
+ {
+ DEBUG_PRINTF2(_L8("CTunnelCallbackRegistrationCommand::operator() : Handle[%X]"), aCbMgr.ipHandle);
+
+ if (!iTunnelInfo.iTunnelledComponentHandle)
+ {
+ // This is a tunnel deregistration command, then remove any pending
+ // callbacks on that tunnel...
+ aCbMgr.iCommandQueue.RemoveBufferDoneCbCommandsByPortIndex(
+ aCbMgr,
+ iTunnelInfo.iLocalPortIndex);
+ }
+
+ OMX_ERRORTYPE omxError =
+ aCbMgr.DoRegisterTunnelCallback(iTunnelInfo.iLocalPortIndex,
+ iTunnelInfo.iLocalPortDirection,
+ iTunnelInfo.iTunnelledComponentHandle,
+ iTunnelInfo.iTunnelledPortIndex);
+
+ if (OMX_ErrorInsufficientResources == omxError)
+ {
+ aCbMgr.HandleInsufficientResources();
+ }
+
+ }
+
+
+void
+COmxILCallbackManager::CEventCallbackCommand::operator()(
+ COmxILCallbackManager& aCbMgr, TBool& /* aHasBeenDeferred */)
+ {
+ DEBUG_PRINTF2(_L8("CEventCallbackCommand::operator() : Handle[%X]"), aCbMgr.ipHandle);
+
+ OMX_ERRORTYPE omxError = OMX_ErrorNone;
+ switch(iData1)
+ {
+ case OMX_CommandStateSet:
+ {
+ aCbMgr.iPreviousState = aCbMgr.iCurrentState;
+ aCbMgr.iCurrentState = static_cast<OMX_STATETYPE>(iData2);
+
+ DEBUG_PRINTF4(_L8("CEventCallbackCommand::operator() : Handle[%X] iPreviousState[%d] -> iCurrentState[%d]"), aCbMgr.ipHandle, aCbMgr.iPreviousState, aCbMgr.iCurrentState);
+
+ if (OMX_StatePause == aCbMgr.iPreviousState &&
+ OMX_StateIdle == aCbMgr.iCurrentState)
+ {
+ // Flush pending queue first...
+ aCbMgr.ProcessQueue(aCbMgr.iPendingQueue);
+
+ // ... and now signal command completion...
+ omxError =
+ aCbMgr.DoEventNotification(iEvent,
+ iData1,
+ iData2,
+ iExtraInfo);
+
+ }
+ else if (OMX_StatePause == aCbMgr.iPreviousState &&
+ OMX_StateExecuting == aCbMgr.iCurrentState)
+ {
+ // Signal command completion first...
+ omxError =
+ aCbMgr.DoEventNotification(iEvent,
+ iData1,
+ iData2,
+ iExtraInfo);
+
+ // ... and now flush...
+ aCbMgr.ProcessQueue(aCbMgr.iPendingQueue);
+
+ }
+ else
+ {
+ // Signal command completion...
+ omxError =
+ aCbMgr.DoEventNotification(iEvent,
+ iData1,
+ iData2,
+ iExtraInfo);
+
+ }
+
+ }
+ break;
+
+ case OMX_CommandPortDisable:
+ case OMX_CommandFlush:
+ {
+ // Process pending queue unconditionally...
+ aCbMgr.iFlushPendingQueue = ETrue;
+
+ // Flush first...
+ if (OMX_ALL == iData2)
+ {
+ aCbMgr.ProcessQueue(aCbMgr.iPendingQueue);
+ }
+ else
+ {
+ aCbMgr.iPendingQueue.
+ ExecuteBufferDoneCbCommandsByPortIndex(aCbMgr,
+ iData2);
+
+ }
+
+ aCbMgr.iFlushPendingQueue = EFalse;
+
+ // ... and now signal command completion...
+ omxError =
+ aCbMgr.DoEventNotification(iEvent,
+ iData1,
+ iData2,
+ iExtraInfo);
+
+ }
+ break;
+
+ default:
+ {
+ // Signal command completion...
+ omxError =
+ aCbMgr.DoEventNotification(iEvent,
+ iData1,
+ iData2,
+ iExtraInfo);
+
+ }
+
+ };
+
+ if (OMX_ErrorInsufficientResources == omxError)
+ {
+ aCbMgr.HandleInsufficientResources();
+ }
+
+ }
+
+
+void
+COmxILCallbackManager::CBufferDoneCallbackCommand::operator()(
+ COmxILCallbackManager& aCbMgr, TBool& aHasBeenDeferred)
+ {
+ DEBUG_PRINTF2(_L8("CBufferDoneCallbackCommand::operator() : Handle[%X]"), aCbMgr.ipHandle);
+
+ // Only send the buffer done callback if is not in Pause stae or if there
+ // is a buffer flushing situation...
+
+ if ((OMX_StatePause == aCbMgr.iCurrentState) &&
+ (!aCbMgr.iFlushPendingQueue))
+ {
+ aHasBeenDeferred = ETrue;
+ return;
+ }
+
+ OMX_ERRORTYPE omxError =
+ aCbMgr.DoBufferDoneNotification(ipBufferHeader,
+ iLocalPortIndex,
+ iLocalPortDirection);
+
+ if (OMX_ErrorInsufficientResources == omxError)
+ {
+ aCbMgr.HandleInsufficientResources();
+ }
+
+ }
+
+TBool
+COmxILCallbackManager::CBufferDoneCallbackCommand::DoRemoveBufferDoneCbCommandByBufferHeader(
+ COmxILCallbackManager& aCbMgr,
+ const OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_DIRTYPE aDirection)
+ {
+
+ if (apBufferHeader == ipBufferHeader)
+ {
+ __ASSERT_DEBUG(aCbMgr.ipFsm,
+ User::Panic(KOmxILCallbackManagerPanicCategory, 1));
+ __ASSERT_DEBUG(aDirection == OMX_DirInput ||
+ aDirection == OMX_DirOutput,
+ User::Panic(KOmxILCallbackManagerPanicCategory, 1));
+
+ DEBUG_PRINTF4(_L8("DoRemoveBufferDoneCbCommandByBufferHeader() : Nofiying FSM : Handle[%X] aDirection[%X] apBufferHeader[%X]"), aCbMgr.ipHandle, aDirection, apBufferHeader);
+
+ // Make sure the buffer contents are cleared...
+ TOmxILUtil::ClearBufferContents(
+ const_cast<OMX_BUFFERHEADERTYPE*>(apBufferHeader));
+
+ if (aDirection == OMX_DirInput)
+ {
+ aCbMgr.ipFsm->EmptyThisBuffer(
+ const_cast<OMX_BUFFERHEADERTYPE*>(apBufferHeader));
+ }
+ else
+ {
+ aCbMgr.ipFsm->FillThisBuffer(
+ const_cast<OMX_BUFFERHEADERTYPE*>(apBufferHeader));
+ }
+ return ETrue;
+ }
+
+ return EFalse;
+
+ }
+
+//
+// This method only prints some logging information for debugging purposes. For
+// now, there's no other action to be performed as the deletion is done by the caller.
+//
+TBool
+COmxILCallbackManager::CBufferDoneCallbackCommand::DoRemoveBufferDoneCbCommandByPortIndex(
+ COmxILCallbackManager& /* aCbMgr */,
+ OMX_U32 aLocalPortIndex)
+ {
+
+ if (iLocalPortIndex == aLocalPortIndex)
+ {
+ DEBUG_PRINTF2(_L8("CBufferDoneCallbackCommand::DoRemoveBufferDoneCbCommandByPortIndex() : FOUND -> PortIndex[%d]"), aLocalPortIndex);
+ return ETrue;
+ }
+
+ DEBUG_PRINTF2(_L8("CBufferDoneCallbackCommand::DoRemoveBufferDoneCbCommandByPortIndex() : NOT FOUND -> PortIndex[%d]"), aLocalPortIndex);
+
+ return EFalse;
+ }
+
+
+TBool
+COmxILCallbackManager::CBufferDoneCallbackCommand::DoExecuteBufferDoneCbCommandByPortIndex(
+ COmxILCallbackManager& aCbMgr,
+ OMX_U32 aLocalPortIndex)
+ {
+
+ TBool executed = EFalse;
+
+ if (iLocalPortIndex == aLocalPortIndex)
+ {
+ TBool hasBeenDeferred = EFalse;
+ // The only use case for this method is during unconditional flushing
+ // of the pending queue...
+ __ASSERT_DEBUG(aCbMgr.iFlushPendingQueue,
+ User::Panic(KOmxILCallbackManagerPanicCategory, 1));
+ this->operator()(aCbMgr, hasBeenDeferred);
+ __ASSERT_DEBUG(!hasBeenDeferred,
+ User::Panic(KOmxILCallbackManagerPanicCategory, 1));
+ executed = ETrue;
+ }
+
+ DEBUG_PRINTF3(_L8("CBufferDoneCallbackCommand::DoExecuteBufferDoneCbCommandByPortIndex() : %s FOUND -> PortIndex[%d]"),
+ (executed ? "" : "NOT"), aLocalPortIndex);
+
+ return executed;
+
+ }
+
+
+TBool
+XOmxILCallbackManagerIfImpl::TBufferMarkPropagationInfo::Compare(
+ const TBufferMarkPropagationInfo& aBmpi1,
+ const TBufferMarkPropagationInfo& aBmpi2)
+ {
+ return (aBmpi1.iPortIndex == aBmpi2.iPortIndex ? ETrue : EFalse);
+ }
+
+TBool
+XOmxILCallbackManagerIfImpl::TOutputPortBufferMarkInfo::Compare(
+ const TOutputPortBufferMarkInfo& aOpbmi1,
+ const TOutputPortBufferMarkInfo& aOpbmi2)
+ {
+ return (aOpbmi1.iPortIndex == aOpbmi2.iPortIndex ? ETrue : EFalse);
+ }
+
+COmxILCallbackManager::CPortSettingsChangeCommand::~CPortSettingsChangeCommand()
+ {
+ delete ipPortSettings;
+ }
+
+void
+COmxILCallbackManager::CPortSettingsChangeCommand::operator()(
+ COmxILCallbackManager& aCbMgr, TBool& /* aHasBeenDeferred */)
+ {
+ DEBUG_PRINTF3(_L8("CPortSettingsChangeCommand::operator() : Handle[%X], iLocalPortIndex=[%d]"),
+ aCbMgr.ipHandle, iLocalPortIndex);
+
+ OMX_ERRORTYPE omxError =
+ aCbMgr.DoPortSettingsChangeNotification(iLocalPortIndex,
+ iPortSettingsIndex,
+ *ipPortSettings);
+
+ if (OMX_ErrorInsufficientResources == omxError)
+ {
+ aCbMgr.HandleInsufficientResources();
+ }
+
+ }
+
+#ifdef _OMXIL_COMMON_IL516C_ON
+void
+COmxILCallbackManager::CEjectBuffersRequestCommand::operator()(
+ COmxILCallbackManager& aCbMgr, TBool& /* aHasBeenDeferred */)
+ {
+ DEBUG_PRINTF3(_L8("CEjectBuffersRequestCommand::operator() : Handle[%X], iLocalOmxPortIndex=[%u]"),
+ aCbMgr.ipHandle, iLocalOmxPortIndex);
+
+ OMX_ERRORTYPE omxError =
+ aCbMgr.DoEjectBuffersRequest(iLocalOmxPortIndex);
+
+ if (OMX_ErrorInsufficientResources == omxError)
+ {
+ aCbMgr.HandleInsufficientResources();
+ }
+
+ }
+#endif //_OMXIL_COMMON_IL516C_ON
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilcallbackmanager.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,527 @@
+// 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 OMXILCALLBACKMANAGER_H
+#define OMXILCALLBACKMANAGER_H
+
+#include <e32base.h>
+
+#include "omxilcallbackmanagerif.h"
+#include "omxilcallbackmanagerifimpl.h"
+#include "primsgqueue.h"
+
+
+/**
+ Call Back Manager Panic category
+*/
+_LIT(KOmxILCallbackManagerPanicCategory, "OmxILCallbackManager");
+
+
+/**
+ OpenMAX IL call backs and buffer marks manager. This is an asynchronous
+ implementation of MOmxILCallbackManagerIf. It keeps and manages the IL
+ Client callback information as well as the buffer mark propagation info.
+
+ */
+NONSHARABLE_CLASS(COmxILCallbackManager) :
+ public CActive,
+ public MOmxILCallbackManagerIf,
+ private XOmxILCallbackManagerIfImpl
+ {
+
+ // Declaration of nested private command classes
+ class CCallbackCommand;
+ class CCompHandleRegistrationCommand;
+ class CClientCallbacksRegistrationCommand;
+ class CTunnelCallbackRegistrationCommand;
+ class CBufferMarkPropagationRegistrationCommand;
+ class CBufferRemovalCommand;
+ class CEventCallbackCommand;
+ class CBufferDoneCallbackCommand;
+ class CPortSettingsChangeCommand;
+#ifdef _OMXIL_COMMON_IL516C_ON
+ class CEjectBuffersRequestCommand;
+#endif
+ // Note that the following friends don't break COmxILCallbackManager's
+ // interface as all friends below are COmxILCallbackManager's private
+ // nested classes and therefore they are logically part of
+ // COmxILCallbackManager implementation
+ friend class CCompHandleRegistrationCommand;
+ friend class CClientCallbacksRegistrationCommand;
+ friend class CTunnelCallbackRegistrationCommand;
+ friend class CBufferMarkPropagationRegistrationCommand;
+ friend class CBufferRemovalCommand;
+ friend class CEventCallbackCommand;
+ friend class CBufferDoneCallbackCommand;
+ friend class CPortSettingsChangeCommand;
+#ifdef _OMXIL_COMMON_IL516C_ON
+ friend class CEjectBuffersRequestCommand;
+#endif
+
+public:
+
+ static COmxILCallbackManager* NewL(
+ OMX_HANDLETYPE apComponentHandle,
+ OMX_PTR apAppData,
+ OMX_CALLBACKTYPE* apCallbacks);
+
+ ~COmxILCallbackManager();
+
+ void SetPortManager(MOmxILPortManagerIf& apPortManager);
+
+ void SetFsm(COmxILFsm& apFsm);
+
+
+ //
+ // Methods for Callback Registration (from MOmxILCallbackManagerIf)
+ //
+
+ OMX_ERRORTYPE RegisterComponentHandle(
+ OMX_HANDLETYPE aComponentHandle);
+
+ OMX_ERRORTYPE RegisterILClientCallbacks(
+ const OMX_CALLBACKTYPE* apCallbacks,
+ const OMX_PTR apAppData);
+
+ OMX_ERRORTYPE RegisterTunnelCallback(
+ OMX_U32 aLocalPortIndex,
+ OMX_DIRTYPE aLocalPortDirection,
+ OMX_HANDLETYPE aTunnelledComponentHandle,
+ OMX_U32 aTunnelledPortIndex
+ );
+
+ OMX_ERRORTYPE DeregisterTunnelCallback(
+ OMX_U32 aLocalPortIndex);
+
+ OMX_ERRORTYPE RegisterBufferMarkPropagationPort(
+ OMX_U32 aPortIndex,
+ OMX_U32 aPropagationPortIndex);
+
+ TBool BufferRemovalIndication(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_DIRTYPE aDirection);
+
+
+ //
+ // Methods for Callback Notification (from MOmxILCallbackManagerIf)
+ //
+
+ OMX_ERRORTYPE TransitionCompleteNotification(
+ OMX_STATETYPE aOmxState);
+
+ OMX_ERRORTYPE CommandCompleteNotification(
+ OMX_COMMANDTYPE aOmxCommand,
+ OMX_U32 aOmxPortIndex);
+
+#ifdef _OMXIL_COMMON_IL516C_ON
+ OMX_ERRORTYPE EjectBuffersRequest(
+ OMX_U32 aLocalOmxPortIndex);
+#endif
+
+ //
+ // Methods for Callback Notification (from MOmxILCallbackManagerIf)
+ //
+
+ OMX_ERRORTYPE ErrorEventNotification(
+ OMX_ERRORTYPE aOmxError);
+
+ OMX_ERRORTYPE EventNotification(
+ OMX_EVENTTYPE aEvent,
+ TUint32 aData1,
+ TUint32 aData2,
+ OMX_STRING aExtraInfo);
+
+ OMX_ERRORTYPE BufferDoneNotification(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_U32 aLocalPortIndex,
+ OMX_DIRTYPE aLocalPortDirection);
+
+ OMX_ERRORTYPE ClockBufferDoneNotification(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_U32 aLocalPortIndex,
+ OMX_DIRTYPE aLocalPortDirection);
+
+ OMX_ERRORTYPE PortSettingsChangeNotification(
+ OMX_U32 aLocalPortIndex,
+ TUint aPortSettingsIndex,
+ const TDesC8& aPortSettings);
+
+ //
+ // From CActive
+ //
+private:
+ void RunL();
+ void DoCancel();
+
+private:
+
+ // Convenience typedef
+ typedef RPriMsgQueue<CCallbackCommand*> RCbCmdPriQue;
+
+ /**
+ COmxILCallbackManager's priority-based command queue.
+
+ This queue is based on RPriMsgQueue but it is specialized to support the
+ search and deletion of Buffer Done Callback Commands using some specific
+ search criteria like buffer headers or port indexes.
+ */
+ class RCallbackManagerQueue : public RCbCmdPriQue
+ {
+
+ public:
+
+ TBool RemoveBufferDoneCbCommandsByBufferHeader(
+ COmxILCallbackManager& aCbMgr,
+ const OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_DIRTYPE aDirection);
+
+ TBool RemoveBufferDoneCbCommandsByPortIndex(
+ COmxILCallbackManager& aCbMgr,
+ OMX_U32 aLocalPortIndex);
+
+ TBool ExecuteBufferDoneCbCommandsByPortIndex(
+ COmxILCallbackManager& aCbMgr,
+ OMX_U32 aLocalPortIndex);
+
+
+ };
+
+private:
+
+ static const TInt KMaxMsgQueueEntries = 30;
+
+private:
+
+ COmxILCallbackManager(OMX_HANDLETYPE apComponentHandle,
+ OMX_PTR apAppData,
+ OMX_CALLBACKTYPE* apCallbacks);
+ void ConstructL();
+
+
+ OMX_ERRORTYPE SendBufferDoneNotification(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_U32 aLocalPortIndex,
+ OMX_DIRTYPE aLocalPortDirection,
+ TInt aPriority);
+
+ void ProcessQueue(RCallbackManagerQueue& aQueue);
+
+ void CleanUpQueue(RCallbackManagerQueue& aQueue);
+
+ OMX_ERRORTYPE EventNotificationImpl(
+ OMX_EVENTTYPE aEvent,
+ TUint32 aData1,
+ TUint32 aData2,
+ OMX_STRING aExtraInfo);
+
+private:
+
+ // COmxILCallbackManager priority queue.
+ RCallbackManagerQueue iCommandQueue;
+
+ // Queue of buffer done notifications that need to be queued during
+ // OMX_StatePaused state
+ RCallbackManagerQueue iPendingQueue;
+
+ // Flag to enable unconditional flushing of buffer done notifications
+ TBool iFlushPendingQueue;
+
+ OMX_STATETYPE iCurrentState;
+ OMX_STATETYPE iPreviousState;
+
+ };
+
+
+//
+// COmxILCallbackManager nested classes
+//
+
+/**
+ Abstract Callback Manager's command class.
+ */
+class COmxILCallbackManager::CCallbackCommand : public CBase
+ {
+
+public:
+
+ enum TCommandPriority
+ {
+ EPriorityLow,
+ EPriorityNormal,
+ EPriorityHigh,
+ EPriorityVeryHigh
+ };
+
+public:
+
+ inline CCallbackCommand(TInt aPriority);
+
+ /**
+ Operator() method that must be implemented to perform the specific
+ command logic.
+
+ @param [in] aCbMgr The Callback Manager object used as context to the
+ command operation
+ */
+ virtual void operator()(COmxILCallbackManager& aCbMgr, TBool& aHasBeenDeferred) = 0;
+
+ virtual TBool DoRemoveBufferDoneCbCommandByBufferHeader(
+ COmxILCallbackManager& aCbMgr,
+ const OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_DIRTYPE aDirection);
+
+ virtual TBool DoRemoveBufferDoneCbCommandByPortIndex(
+ COmxILCallbackManager& aCbMgr,
+ OMX_U32 aLocalPortIndex);
+
+ virtual TBool DoExecuteBufferDoneCbCommandByPortIndex(
+ COmxILCallbackManager& aCbMgr,
+ OMX_U32 aLocalPortIndex);
+
+ inline TInt Priority();
+
+public:
+
+ TInt iPriority;
+
+ };
+
+/**
+ Callback Manager's command class for registering component handles.
+ */
+class COmxILCallbackManager::CCompHandleRegistrationCommand :
+ public COmxILCallbackManager::CCallbackCommand
+ {
+
+public:
+
+ inline CCompHandleRegistrationCommand(OMX_HANDLETYPE aComponentHandle);
+
+ void operator()(COmxILCallbackManager& aCbMgr, TBool& aHasBeenDeferred);
+
+private:
+
+ OMX_COMPONENTTYPE* ipHandle; // Not owned
+
+ };
+
+/**
+ Callback Manager's command class for registering IL Client callbacks .
+ */
+class COmxILCallbackManager::CClientCallbacksRegistrationCommand :
+ public COmxILCallbackManager::CCallbackCommand
+ {
+
+public:
+
+ inline CClientCallbacksRegistrationCommand(
+ const OMX_CALLBACKTYPE*& apCallbacks,
+ const OMX_PTR& apAppData);
+
+ void operator()(COmxILCallbackManager& aCbMgr, TBool& aHasBeenDeferred);
+
+private:
+
+ const OMX_CALLBACKTYPE* ipCallbacks; // not owned
+ const OMX_PTR ipAppData; // not owned
+
+ };
+
+/**
+ Callback Manager's command class for registering tunnel callbacks.
+ */
+class COmxILCallbackManager::CTunnelCallbackRegistrationCommand :
+ public COmxILCallbackManager::CCallbackCommand
+ {
+
+public:
+
+ inline CTunnelCallbackRegistrationCommand(
+ OMX_U32 aLocalPortIndex,
+ OMX_DIRTYPE aLocalPortDirection,
+ OMX_HANDLETYPE aTunnelledComponentHandle,
+ OMX_U32 aTunnelledPortIndex);
+
+ void operator()(COmxILCallbackManager& aCbMgr, TBool& aHasBeenDeferred);
+
+
+public:
+
+ TTunnelRegistrationInfo iTunnelInfo;
+
+ };
+
+/**
+ Callback Manager's command class for registering buffer marks info .
+ */
+class COmxILCallbackManager::CBufferMarkPropagationRegistrationCommand :
+ public COmxILCallbackManager::CCallbackCommand
+ {
+
+public:
+
+ inline CBufferMarkPropagationRegistrationCommand(
+ OMX_U32 aPortIndex,
+ OMX_U32 aPropagationPortIndex);
+
+ void operator()(COmxILCallbackManager& aCbMgr, TBool& aHasBeenDeferred);
+
+public:
+
+ TBufferMarkPropagationInfo iMarkPropagationInfo;
+
+ };
+
+/**
+ Callback Manager's command class for buffer header removal.
+ */
+class COmxILCallbackManager::CBufferRemovalCommand :
+ public COmxILCallbackManager::CCallbackCommand
+ {
+
+public:
+
+ inline CBufferRemovalCommand(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_DIRTYPE aDirection);
+
+ void operator()(COmxILCallbackManager& aCbMgr, TBool& aHasBeenDeferred);
+
+public:
+
+ OMX_BUFFERHEADERTYPE* ipBufferHeader;
+ OMX_DIRTYPE iDirection;
+
+ };
+
+/**
+ Callback Manager's command class for notification of OpenMAX IL events .
+ */
+class COmxILCallbackManager::CEventCallbackCommand :
+ public COmxILCallbackManager::CCallbackCommand
+ {
+
+public:
+
+ inline CEventCallbackCommand(OMX_EVENTTYPE aEvent,
+ TUint32 aData1,
+ TUint32 aData2,
+ OMX_STRING aExtraInfo);
+
+ void operator()(COmxILCallbackManager& aCbMgr, TBool& aHasBeenDeferred);
+
+private:
+
+ OMX_EVENTTYPE iEvent;
+ TUint32 iData1;
+ TUint32 iData2;
+ OMX_STRING iExtraInfo;
+
+ };
+
+/**
+ Callback Manager's command class for notification of buffer done events .
+ */
+class COmxILCallbackManager::CBufferDoneCallbackCommand :
+ public COmxILCallbackManager::CCallbackCommand
+ {
+
+public:
+
+ inline CBufferDoneCallbackCommand(OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_U32 aLocalPortIndex,
+ OMX_DIRTYPE aLocalPortDirection,
+ TInt aPriority = CCallbackCommand::EPriorityNormal);
+
+ void operator()(COmxILCallbackManager& aCbMgr, TBool& aHasBeenDeferred);
+
+ TBool DoRemoveBufferDoneCbCommandByBufferHeader(
+ COmxILCallbackManager& aCbMgr,
+ const OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_DIRTYPE aDirection);
+
+ TBool DoRemoveBufferDoneCbCommandByPortIndex(
+ COmxILCallbackManager& aCbMgr,
+ OMX_U32 aLocalPortIndex);
+
+ TBool DoExecuteBufferDoneCbCommandByPortIndex(
+ COmxILCallbackManager& aCbMgr,
+ OMX_U32 aLocalPortIndex);
+
+private:
+
+ OMX_BUFFERHEADERTYPE* ipBufferHeader; // not owned
+ OMX_U32 iLocalPortIndex;
+ OMX_DIRTYPE iLocalPortDirection;
+
+ };
+
+/**
+ Callback Manager's command class for notification of port settings change
+ events .
+ */
+class COmxILCallbackManager::CPortSettingsChangeCommand :
+ public COmxILCallbackManager::CCallbackCommand
+ {
+
+public:
+
+ inline CPortSettingsChangeCommand(OMX_U32 aLocalPortIndex,
+ TUint aPortSettingsIndex,
+ HBufC8*& apPortSettings);
+
+ ~CPortSettingsChangeCommand();
+
+ void operator()(COmxILCallbackManager& aCbMgr, TBool& aHasBeenDeferred);
+
+private:
+
+ OMX_U32 iLocalPortIndex;
+ TUint iPortSettingsIndex;
+ HBufC8* ipPortSettings; // This is owned by this class
+
+ };
+
+#ifdef _OMXIL_COMMON_IL516C_ON
+/**
+ Callback Manager's command class for requesting buffer ejection from tunnelled component.
+ */
+class COmxILCallbackManager::CEjectBuffersRequestCommand :
+ public COmxILCallbackManager::CCallbackCommand
+ {
+
+public:
+
+ inline CEjectBuffersRequestCommand(OMX_U32 aLocalOmxPortIndex);
+
+ void operator()(COmxILCallbackManager& aCbMgr, TBool& aHasBeenDeferred);
+
+private:
+
+ OMX_U32 iLocalOmxPortIndex;
+
+ };
+#endif
+
+
+#include "omxilcallbackmanager.inl"
+
+#endif // OMXILCALLBACKMANAGER_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilcallbackmanager.inl Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,145 @@
+// 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
+*/
+
+inline
+COmxILCallbackManager::CCallbackCommand::CCallbackCommand(
+ TInt aPriority)
+ :
+ iPriority(aPriority)
+ {
+ }
+
+inline TInt
+COmxILCallbackManager::CCallbackCommand::Priority()
+ {
+ return iPriority;
+ }
+
+inline
+COmxILCallbackManager::CCompHandleRegistrationCommand::CCompHandleRegistrationCommand(
+ OMX_HANDLETYPE aComponentHandle)
+ :
+ CCallbackCommand(CCallbackCommand::EPriorityVeryHigh),
+ ipHandle(static_cast<OMX_COMPONENTTYPE*>(aComponentHandle))
+ {
+ }
+
+inline
+COmxILCallbackManager::CClientCallbacksRegistrationCommand::CClientCallbacksRegistrationCommand(
+ const OMX_CALLBACKTYPE*& apCallbacks,
+ const OMX_PTR& apAppData)
+ :
+ CCallbackCommand(CCallbackCommand::EPriorityVeryHigh),
+ ipCallbacks(apCallbacks),
+ ipAppData(apAppData)
+ {
+ }
+
+inline
+COmxILCallbackManager::CTunnelCallbackRegistrationCommand::CTunnelCallbackRegistrationCommand(
+ OMX_U32 aLocalPortIndex,
+ OMX_DIRTYPE aLocalPortDirection,
+ OMX_HANDLETYPE aTunnelledComponentHandle,
+ OMX_U32 aTunnelledPortIndex)
+ :
+ CCallbackCommand(CCallbackCommand::EPriorityVeryHigh),
+ iTunnelInfo(aLocalPortIndex,
+ aLocalPortDirection,
+ aTunnelledComponentHandle,
+ aTunnelledPortIndex)
+ {
+ }
+
+inline
+COmxILCallbackManager::CBufferMarkPropagationRegistrationCommand::
+CBufferMarkPropagationRegistrationCommand(
+ OMX_U32 aPortIndex,
+ OMX_U32 aPropagationPortIndex)
+ :
+ CCallbackCommand(CCallbackCommand::EPriorityVeryHigh),
+ iMarkPropagationInfo(aPortIndex,
+ aPropagationPortIndex)
+ {
+ }
+
+inline
+COmxILCallbackManager::CBufferRemovalCommand::CBufferRemovalCommand(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_DIRTYPE aDirection)
+ :
+ CCallbackCommand(CCallbackCommand::EPriorityVeryHigh),
+ ipBufferHeader(apBufferHeader),
+ iDirection(aDirection)
+ {
+ }
+
+inline
+COmxILCallbackManager::CEventCallbackCommand::CEventCallbackCommand(
+ OMX_EVENTTYPE aEvent,
+ TUint32 aData1,
+ TUint32 aData2,
+ OMX_STRING aExtraInfo)
+ :
+ CCallbackCommand(CCallbackCommand::EPriorityNormal),
+ iEvent(aEvent),
+ iData1(aData1),
+ iData2(aData2),
+ iExtraInfo(aExtraInfo)
+ {
+ }
+
+inline
+COmxILCallbackManager::CBufferDoneCallbackCommand::
+CBufferDoneCallbackCommand(OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_U32 aLocalPortIndex,
+ OMX_DIRTYPE aLocalPortDirection,
+ TInt aPriority)
+ :
+ CCallbackCommand(aPriority),
+ ipBufferHeader(apBufferHeader),
+ iLocalPortIndex(aLocalPortIndex),
+ iLocalPortDirection(aLocalPortDirection)
+ {
+ }
+
+inline
+COmxILCallbackManager::CPortSettingsChangeCommand::
+CPortSettingsChangeCommand(OMX_U32 aLocalPortIndex,
+ TUint aPortSettingsIndex,
+ HBufC8*& apPortSettings)
+ :
+ CCallbackCommand(CCallbackCommand::EPriorityNormal),
+ iLocalPortIndex(aLocalPortIndex),
+ iPortSettingsIndex(aPortSettingsIndex),
+ ipPortSettings(apPortSettings)
+ {
+ }
+
+#ifdef _OMXIL_COMMON_IL516C_ON
+inline
+COmxILCallbackManager::CEjectBuffersRequestCommand::
+CEjectBuffersRequestCommand(OMX_U32 aLocalOmxPortIndex)
+ :
+ CCallbackCommand(CCallbackCommand::EPriorityNormal),
+ iLocalOmxPortIndex(aLocalOmxPortIndex)
+ {
+ }
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilcallbackmanagerif.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,195 @@
+// 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 OMXILCALLBACKMANAGERIF_H
+#define OMXILCALLBACKMANAGERIF_H
+
+#include <openmax/il/khronos/v1_x/OMX_Component.h>
+
+#include <openmax/il/common/omxilcallbacknotificationif.h>
+
+// Forward declarations
+class MOmxILPortManagerIf;
+class COmxILFsm;
+
+/**
+ CallBack Manager Interface used by Callback Manager implementations.
+ */
+class MOmxILCallbackManagerIf : public MOmxILCallbackNotificationIf
+ {
+
+public:
+
+ virtual ~MOmxILCallbackManagerIf();
+
+ /**
+ Method to update the Port Manager reference
+
+ @param [in] aPortManager The Port Manager
+
+ @return OMX_ERRORTYPE
+ */
+ virtual void SetPortManager(MOmxILPortManagerIf& aPortManager) = 0;
+
+ /**
+ Method to update the FSM reference
+
+ @param [in] aFsm The FSM
+
+ @return OMX_ERRORTYPE
+ */
+ virtual void SetFsm(COmxILFsm& aFsm) = 0;
+
+
+ //
+ // Methods for Callback Registration/Un-registration
+ //
+
+ /**
+ Method to register the component handle
+
+ @param [in] aComponentHandle The component handle
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE RegisterComponentHandle(
+ OMX_HANDLETYPE aComponentHandle) = 0;
+
+ /**
+ Method to register the IL Client callbacks
+
+ @param [in] apCallbacks The IL Client callback pointers
+
+ @param [in] apAppData The IL Client data used to provide
+ component-specific context
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE RegisterILClientCallbacks(
+ const OMX_CALLBACKTYPE* apCallbacks,
+ const OMX_PTR apAppData) = 0;
+
+ /**
+ Method to register a tunnel callback
+
+ @param [in] aLocalPortIndex The tunnel's local port index
+
+ @param [in] aLocalPortDirection The direction of the tunnel's local port
+
+ @param [in] aTunnelledComponentHandle Tunnelled component handle
+
+ @param [in] aTunnelledPortIndex Index of the tunnelled port
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE RegisterTunnelCallback(
+ OMX_U32 aLocalPortIndex,
+ OMX_DIRTYPE aLocalPortDirection,
+ OMX_HANDLETYPE aTunnelledComponentHandle,
+ OMX_U32 aTunnelledPortIndex) = 0;
+
+ /**
+ Method to un-register a tunnel callback
+
+ @param [in] aLocalPortIndex The tunnel's local port index
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE DeregisterTunnelCallback(
+ OMX_U32 aLocalPortIndex) = 0;
+
+ /**
+ Method to register buffer mark propagation ports
+
+ @param [in] aPortIndex The index of the input port that receives buffer
+ marks
+
+ @param [in] aPropagationPortIndex An index of the ouput port where buffer marks
+ will be propagated
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE RegisterBufferMarkPropagationPort(
+ OMX_U32 aPortIndex,
+ OMX_U32 aPropagationPortIndex) = 0;
+
+ /**
+ Method to remove a buffer done commands from the Callback Manager
+ internal queues, if queueing is in use
+
+ @param [in] apBufferHeader The buffer header contained in the buffer indication
+
+ @param [in] aDirection The direction of the port that handles the buffer
+
+ @return TBool
+ */
+ virtual TBool BufferRemovalIndication(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_DIRTYPE aDirection) = 0;
+
+ //
+ // Methods for Callback Notification
+ //
+
+ /**
+ Method to notify the IL Client of the completion of an OpenMAX IL state
+ transition
+
+ @param [in] aOmxState The new state
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE TransitionCompleteNotification(
+ OMX_STATETYPE aOmxState) = 0;
+
+ /**
+ Method to notify the IL Client of the completion of a OpenMAX IL command
+
+ @param [in] aOmxCommand The command that has been completed
+
+ @param [in] aOmxPortIndex The index of the port where the command
+ applies, if any
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE CommandCompleteNotification(
+ OMX_COMMANDTYPE aOmxCommand,
+ OMX_U32 aOmxPortIndex) = 0;
+
+#ifdef _OMXIL_COMMON_IL516C_ON
+ /**
+ Method to request from the tunnelled component the ejection of the
+ buffers present in one of its ports
+
+ @param [in] aLocalOmxPortIndex The index of the local port that is
+ tunnelled to the component that the ejection request applies to
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE EjectBuffersRequest(
+ OMX_U32 aLocalOmxPortIndex) = 0;
+#endif
+
+ };
+
+#include "omxilcallbackmanagerif.inl"
+
+#endif // OMXILCALLBACKMANAGERIF_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilcallbackmanagerif.inl Wed Aug 25 12:40:50 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:
+//
+
+
+/**
+@file
+@internalComponent
+*/
+
+inline MOmxILCallbackManagerIf::~MOmxILCallbackManagerIf()
+ {
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilcallbackmanagerifimpl.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,581 @@
+// 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 "omxilcallbackmanagerifimpl.h"
+#include "omxilfsm.h"
+#include "omxilportmanagerif.h"
+#include <openmax/il/common/omxilstatedefs.h>
+
+
+
+
+XOmxILCallbackManagerIfImpl::XOmxILCallbackManagerIfImpl(OMX_HANDLETYPE apComponentHandle,
+ OMX_PTR apAppData,
+ OMX_CALLBACKTYPE* apCallbacks)
+ :
+ ipHandle(static_cast<OMX_COMPONENTTYPE*>(apComponentHandle)),
+ ipAppData(apAppData),
+ ipCallbacks(apCallbacks),
+ iRegisteredTunnels(),
+ iBufferMarkPropagationPorts(),
+ iBufferMarks(),
+ ipPortManager(0),
+ ipFsm(0)
+ {
+ DEBUG_PRINTF(_L8("XOmxILCallbackManagerIfImpl::XOmxILCallbackManagerIfImpl"));
+ }
+
+
+XOmxILCallbackManagerIfImpl::~XOmxILCallbackManagerIfImpl()
+ {
+ DEBUG_PRINTF(_L8("XOmxILCallbackManagerIfImpl::~XOmxILCallbackManagerIfImpl"));
+ // These pointers are cleared to make sure that any further calls on this
+ // object will fail (e.g., from a threaded PF)
+ ipHandle = 0;
+ ipAppData = 0;
+ ipCallbacks = 0;
+
+ iRegisteredTunnels.Close();
+ iBufferMarkPropagationPorts.Close();
+ iBufferMarks.Close();
+
+ ipPortManager = 0;
+
+ ipFsm = 0;
+
+ }
+
+void
+XOmxILCallbackManagerIfImpl::DoSetPortManager(MOmxILPortManagerIf& apPortManager)
+ {
+ ipPortManager = &apPortManager;
+ }
+
+void
+XOmxILCallbackManagerIfImpl::DoSetFsm(COmxILFsm& apFsm)
+ {
+ ipFsm = &apFsm;
+ }
+
+OMX_ERRORTYPE
+XOmxILCallbackManagerIfImpl::DoRegisterComponentHandle(OMX_HANDLETYPE aComponentHandle)
+ {
+ DEBUG_PRINTF(_L8("XOmxILCallbackManagerIfImpl::DoRegisterComponentHandle"));
+
+ __ASSERT_DEBUG(aComponentHandle,
+ User::Panic(KOmxILCallbackManagerIfImplPanicCategory, 1));
+
+ ipHandle = static_cast<OMX_COMPONENTTYPE *>(aComponentHandle);
+
+ return OMX_ErrorNone;
+
+ }
+
+
+OMX_ERRORTYPE
+XOmxILCallbackManagerIfImpl::DoRegisterILClientCallbacks(const OMX_CALLBACKTYPE* apCallbacks,
+ const OMX_PTR apAppData)
+ {
+ DEBUG_PRINTF(_L8("XOmxILCallbackManagerIfImpl::DoRegisterILClientCallbacks"));
+
+ ipAppData = const_cast<OMX_PTR>(apAppData);
+ ipCallbacks = const_cast<OMX_CALLBACKTYPE*>(apCallbacks);
+
+ return OMX_ErrorNone;
+
+ }
+
+OMX_ERRORTYPE
+XOmxILCallbackManagerIfImpl::DoRegisterTunnelCallback(
+ OMX_U32 aLocalPortIndex,
+ OMX_DIRTYPE aLocalPortDirection,
+ OMX_HANDLETYPE aTunnelledComponentHandle,
+ OMX_U32 aTunnelledPortIndex)
+ {
+ DEBUG_PRINTF(_L8("XOmxILCallbackManagerIfImpl::DoRegisterTunnelCallback"));
+
+ OMX_ERRORTYPE omxError = OMX_ErrorNone;
+
+ if (aTunnelledComponentHandle)
+ {
+ // Register tunnelled port
+ TInt err = iRegisteredTunnels.Append(
+ TTunnelRegistrationInfo(aLocalPortIndex,
+ aLocalPortDirection,
+ aTunnelledComponentHandle,
+ aTunnelledPortIndex));
+ if (KErrNone != err)
+ {
+ switch (err)
+ {
+ case KErrNoMemory:
+ {
+ omxError = OMX_ErrorInsufficientResources;
+ }
+ break;
+ default:
+ {
+ omxError = OMX_ErrorUndefined;
+ }
+ };
+ }
+
+ }
+ else
+ {
+ // Deregister tunnelled port
+ const TUint tunnelCount = iRegisteredTunnels.Count();
+ for (TUint i=0; i<tunnelCount; ++i)
+ {
+ if (iRegisteredTunnels[i].iLocalPortIndex ==
+ aLocalPortIndex)
+ {
+ iRegisteredTunnels.Remove(i);
+ break;
+ }
+ }
+ }
+
+ return omxError;
+
+ }
+
+OMX_ERRORTYPE
+XOmxILCallbackManagerIfImpl::DoRegisterBufferMarkPropagationPort(
+ OMX_U32 aPortIndex,
+ OMX_U32 aPropagationPortIndex)
+ {
+ DEBUG_PRINTF3(_L8("XOmxILCallbackManagerIfImpl::DoRegisterBufferMarkPropagationPort : aPortIndex[%d] aPropagationPortIndex[%d] "),aPortIndex, aPropagationPortIndex);
+
+ TInt err = iBufferMarkPropagationPorts.Append(
+ TBufferMarkPropagationInfo(aPortIndex,
+ aPropagationPortIndex));
+
+ OMX_ERRORTYPE omxError = OMX_ErrorNone;
+ if (KErrNone != err)
+ {
+ switch (err)
+ {
+ case KErrNoMemory:
+ {
+ omxError = OMX_ErrorInsufficientResources;
+ }
+ break;
+ default:
+ {
+ omxError = OMX_ErrorUndefined;
+ }
+ };
+ }
+
+ return omxError;
+
+ }
+
+
+
+OMX_ERRORTYPE
+XOmxILCallbackManagerIfImpl::DoTransitionCompleteNotification(OMX_STATETYPE aOmxState)
+ {
+ DEBUG_PRINTF(_L8("XOmxILCallbackManagerIfImpl::DoTransitionCompleteNotification"));
+
+ return DoEventNotification(OMX_EventCmdComplete,
+ OMX_CommandStateSet,
+ aOmxState,
+ 0);
+
+ }
+
+
+OMX_ERRORTYPE
+XOmxILCallbackManagerIfImpl::DoCommandCompleteNotification(OMX_COMMANDTYPE aOmxCommand,
+ OMX_U32 aOmxPortIndex)
+ {
+ DEBUG_PRINTF(_L8("XOmxILCallbackManagerIfImpl::DoCommandCompleteNotification"));
+
+ return DoEventNotification(OMX_EventCmdComplete,
+ aOmxCommand,
+ aOmxPortIndex,
+ 0);
+
+ }
+
+
+OMX_ERRORTYPE
+XOmxILCallbackManagerIfImpl::DoErrorEventNotification(OMX_ERRORTYPE aOmxError)
+ {
+ DEBUG_PRINTF2(_L8("XOmxILCallbackManagerIfImpl::DoErrorEventNotification : aOmxError[%X] "), aOmxError);
+
+ return DoEventNotification(OMX_EventError,
+ aOmxError,
+ 0,
+ 0);
+
+ }
+
+OMX_ERRORTYPE
+XOmxILCallbackManagerIfImpl::DoEventNotification(OMX_EVENTTYPE aEvent,
+ TUint32 aData1,
+ TUint32 aData2,
+ OMX_STRING aExtraInfo)
+ {
+ DEBUG_PRINTF5(_L8("XOmxILCallbackManagerIfImpl::DoEventNotification : Handle[%X] aEvent[%u] aData1[%u] aData2[%u]"), ipHandle, aEvent, aData1, aData2);
+
+ __ASSERT_DEBUG(ipHandle && ipCallbacks, User::Panic(KOmxILCallbackManagerIfImplPanicCategory, 1));
+
+
+ ipCallbacks->EventHandler(ipHandle,
+ ipAppData,
+ aEvent,
+ aData1,
+ aData2,
+ aExtraInfo);
+ return OMX_ErrorNone;
+
+ }
+
+
+OMX_ERRORTYPE
+XOmxILCallbackManagerIfImpl::DoBufferDoneNotification(OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_U32 aLocalPortIndex,
+ OMX_DIRTYPE aLocalPortDirection)
+ {
+ DEBUG_PRINTF5(_L8("XOmxILCallbackManagerIfImpl::DoBufferDoneNotification : HANDLE [%X] BUFFER [%X] PORT[%d] DIR[%d]"), ipHandle, apBufferHeader, aLocalPortIndex, aLocalPortDirection);
+
+ __ASSERT_ALWAYS(apBufferHeader &&
+ (OMX_DirInput == aLocalPortDirection ||
+ OMX_DirOutput == aLocalPortDirection),
+ User::Panic(KOmxILCallbackManagerIfImplPanicCategory, 1));
+
+ __ASSERT_ALWAYS(apBufferHeader->nOffset + apBufferHeader->nFilledLen
+ <= apBufferHeader->nAllocLen,
+ User::Panic(KOmxILCallbackManagerIfImplPanicCategory, 1));
+
+ __ASSERT_DEBUG(ipHandle && ipCallbacks, User::Panic(KOmxILCallbackManagerIfImplPanicCategory, 1));
+
+ // Look for buffer marks to be signalled or propagated
+ SignalOrPropagateBufferMarks(apBufferHeader,
+ aLocalPortDirection);
+
+ // find out whether the port is tunnelled or not
+ TBool tunnelled = EFalse;
+ TUint tunnelInfoArrayIndex = 0;
+ const TUint tunnelCount = iRegisteredTunnels.Count();
+ for (TUint i=0; i<tunnelCount; ++i)
+ {
+ if (iRegisteredTunnels[i].iLocalPortIndex ==
+ aLocalPortIndex)
+ {
+ tunnelled = ETrue;
+ tunnelInfoArrayIndex = i;
+ break;
+ }
+ }
+
+ if (tunnelled)
+ {
+ OMX_COMPONENTTYPE* ipTunnelledComponent =
+ static_cast<OMX_COMPONENTTYPE*>(
+ iRegisteredTunnels[tunnelInfoArrayIndex].
+ iTunnelledComponentHandle);
+
+ __ASSERT_DEBUG(ipTunnelledComponent,
+ User::Panic(KOmxILCallbackManagerIfImplPanicCategory, 1));
+
+ // From OMX_Core.h "Callbacks should not return an error to the
+ // component, so if an error occurs, the application shall handle it
+ // internally". Callback return error ignored here.
+ if (OMX_DirInput == aLocalPortDirection)
+ {
+ OMX_FillThisBuffer(ipTunnelledComponent, apBufferHeader);
+ }
+ else
+ {
+ OMX_EmptyThisBuffer(ipTunnelledComponent, apBufferHeader);
+ }
+
+ }
+ else
+ {
+ OMX_ERRORTYPE (*fp2CBackHandler)
+ (OMX_HANDLETYPE, OMX_PTR, OMX_BUFFERHEADERTYPE*) =
+ (aLocalPortDirection == OMX_DirInput ?
+ ipCallbacks->EmptyBufferDone :
+ ipCallbacks->FillBufferDone);
+
+ // From OMX_Core.h "Callbacks should not return an error to the
+ // component, so if an error occurs, the application shall handle it
+ // internally". Callback return error ignored here.
+#ifdef OMX_DEBUG_TRACING_ON
+ if (aLocalPortDirection == OMX_DirInput)
+ {
+ OMX_TRACE_EMPTYBUFFERDONE_IN(ipHandle, ipAppData, apBufferHeader);
+ }
+ else
+ {
+ OMX_TRACE_FILLBUFFERDONE_IN(ipHandle, ipAppData, apBufferHeader);
+ }
+#endif
+ fp2CBackHandler(ipHandle,
+ ipAppData,
+ apBufferHeader);
+#ifdef OMX_DEBUG_TRACING_ON
+ if (aLocalPortDirection == OMX_DirInput)
+ {
+ OMX_TRACE_EMPTYBUFFERDONE_OUT(ipHandle, ipAppData, apBufferHeader, 0);
+ }
+ else
+ {
+ OMX_TRACE_FILLBUFFERDONE_OUT(ipHandle, ipAppData, apBufferHeader, 0);
+ }
+#endif
+
+ }
+
+ return OMX_ErrorNone;
+
+ }
+
+OMX_ERRORTYPE
+XOmxILCallbackManagerIfImpl::DoPortSettingsChangeNotification(
+ OMX_U32 aLocalPortIndex,
+ TUint aPortSettingsIndex,
+ const TDesC8& aPortSettings)
+ {
+ DEBUG_PRINTF2(_L8("XOmxILCallbackManagerIfImpl::DoPortSettingsChangeNotification : aLocalPortIndex[%d]"), aLocalPortIndex);
+
+ __ASSERT_DEBUG(ipHandle &&
+ ipCallbacks &&
+ ipPortManager,
+ User::Panic(KOmxILCallbackManagerIfImplPanicCategory, 1));
+
+ HBufC8* pPortSettings = HBufC8::New(aPortSettings.Length());
+ if (!pPortSettings)
+ {
+ return OMX_ErrorInsufficientResources;
+ }
+ *pPortSettings = aPortSettings;
+
+ // This is an event that the port may want to convey to the IL Client...
+ OMX_EVENTTYPE eventForILClient = OMX_EventMax;
+ OMX_ERRORTYPE omxRetError =
+ ipPortManager->PortSettingsChangeIndication(aLocalPortIndex,
+ aPortSettingsIndex,
+ *pPortSettings,
+ eventForILClient);
+
+ delete pPortSettings;
+ pPortSettings = NULL;
+
+ // Inform the IL Client that some value in one of the ports' configuration
+ // structures has changed...
+ if (OMX_EventMax != eventForILClient)
+ {
+ // Only allow these two port events...
+ __ASSERT_ALWAYS(eventForILClient == OMX_EventPortSettingsChanged ||
+ eventForILClient == OMX_EventPortFormatDetected,
+ User::Panic(KOmxILCallbackManagerIfImplPanicCategory, 1));
+
+ // From OMX_Core.h "Callbacks should not return an error to the component,
+ // so if an error occurs, the application shall handle it
+ // internally". Callback return error ignored here.
+ ipCallbacks->EventHandler(ipHandle,
+ ipAppData,
+ eventForILClient,
+ aLocalPortIndex,
+ 0,
+ 0);
+ }
+
+ return OMX_ErrorNone;
+
+ }
+
+#ifdef _OMXIL_COMMON_IL516C_ON
+OMX_ERRORTYPE
+XOmxILCallbackManagerIfImpl::DoEjectBuffersRequest(
+ OMX_U32 aLocalPortIndex)
+ {
+ DEBUG_PRINTF2(_L8("XOmxILCallbackManagerIfImpl::DoEjectBuffersRequest : "
+ "aLocalPortIndex[%d]"), aLocalPortIndex);
+
+ __ASSERT_DEBUG(ipHandle &&
+ ipCallbacks &&
+ ipPortManager,
+ User::Panic(KOmxILCallbackManagerIfImplPanicCategory, 1));
+
+ // find out whether the port is tunnelled or not
+ const TUint tunnelCount = iRegisteredTunnels.Count();
+ for (TUint i=0; i<tunnelCount; ++i)
+ {
+ if (iRegisteredTunnels[i].iLocalPortIndex ==
+ aLocalPortIndex)
+ {
+
+ OMX_COMPONENTTYPE* ipTunnelledComponent =
+ static_cast<OMX_COMPONENTTYPE*>(
+ iRegisteredTunnels[i].
+ iTunnelledComponentHandle);
+
+ __ASSERT_DEBUG(ipTunnelledComponent,
+ User::Panic(KOmxILCallbackManagerIfImplPanicCategory, 1));
+
+ DEBUG_PRINTF3(_L8("XOmxILCallbackManagerIfImpl::DoEjectBuffersRequest : "
+ "iTunnelledComponent [%X] iTunnelledPortIndex[%u]"),
+ ipTunnelledComponent,
+ iRegisteredTunnels[i].iTunnelledPortIndex);
+
+ OMX_PARAM_U32TYPE ejectBufferRequest;
+ ejectBufferRequest.nSize = sizeof(OMX_PARAM_U32TYPE);
+ ejectBufferRequest.nVersion = TOmxILSpecVersion();
+ ejectBufferRequest.nPortIndex = iRegisteredTunnels[i].iTunnelledPortIndex;
+ ejectBufferRequest.nU32 = 1; // .... we can define a constant to be used here
+
+ // Returned error ignored here. Cannot handle an error from the
+ // tunnelled component
+ OMX_SetConfig(ipTunnelledComponent,
+ OMX_IndexConfigPortBufferReturnRequest,
+ &ejectBufferRequest);
+
+ break;
+ }
+ }
+
+ return OMX_ErrorNone;
+
+ }
+#endif
+
+void
+XOmxILCallbackManagerIfImpl::SignalOrPropagateBufferMarks(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_U32 aLocalPortIndex)
+ {
+ DEBUG_PRINTF(_L8("XOmxILCallbackManagerIfImpl::SignalOrPropagateBufferMarks()"));
+
+ // Look for buffer marks to be signalled or propagated
+ if (apBufferHeader->hMarkTargetComponent)
+ {
+ // See if this component is the buffer mark target component...
+ if (apBufferHeader->hMarkTargetComponent == ipHandle)
+ {
+ // Inform the IL Client that a marked buffer has been processed...
+ ipCallbacks->EventHandler(ipHandle,
+ ipAppData,
+ OMX_EventMark,
+ 0,
+ 0,
+ apBufferHeader->pMarkData);
+
+ // At this point, the mark has been delivered to the IL
+ // Client...Remove the mark from the processed header...
+ apBufferHeader->hMarkTargetComponent = 0;
+ apBufferHeader->pMarkData = 0;
+
+ }
+ else
+ {
+ // Propagate the mark...
+
+ // First find the buffer mark propagation port...
+ const TInt index = iBufferMarkPropagationPorts.Find(
+ TBufferMarkPropagationInfo(aLocalPortIndex),
+ TIdentityRelation<TBufferMarkPropagationInfo>(
+ &TBufferMarkPropagationInfo::Compare));
+
+ // Note that sink components don't propagate marks...
+ if (index != KErrNotFound)
+ {
+ const TBufferMarkPropagationInfo& propInfo =
+ iBufferMarkPropagationPorts[index];
+
+ // Let's check for the special case: The case for a source
+ // component where the output port is both the port that marks
+ // the headers and the port that propagates them ... Therefore
+ // no need to store the mark for later propagation...
+ if (propInfo.iPropagationPortIndex != aLocalPortIndex)
+ {
+ // Now, store temporarily the mark so the next time we send
+ // a buffer done callback in that propagation port, we mark
+ // that header accordingly...
+ // Unsuccessful insertion is ignored.
+ iBufferMarks.Append(
+ TOutputPortBufferMarkInfo(
+ propInfo.iPropagationPortIndex,
+ apBufferHeader->hMarkTargetComponent,
+ apBufferHeader->pMarkData));
+
+ // At this point the mark has been set for propagation to
+ // an output port. Remove the mark from the processed
+ // header...
+ apBufferHeader->hMarkTargetComponent = 0;
+ apBufferHeader->pMarkData = 0;
+ }
+ }
+ }
+ }
+ else
+ {
+ if(iBufferMarks.Count() != 0)
+ {
+ // Let's see if we have a mark waiting to go out...This will find the
+ // first mark in the local list of marks ...
+ const TInt index = iBufferMarks.Find(
+ TOutputPortBufferMarkInfo(aLocalPortIndex),
+ TIdentityRelation<TOutputPortBufferMarkInfo>(
+ &TOutputPortBufferMarkInfo::Compare));
+ if (index != KErrNotFound)
+ {
+ const TOutputPortBufferMarkInfo& markInfo =
+ iBufferMarks[index];
+
+ // Mark the header...
+ apBufferHeader->hMarkTargetComponent = markInfo.ipMarkTargetComponent;
+ apBufferHeader->pMarkData = markInfo.ipMarkData;
+
+ // Remove the mark info from the local store
+ iBufferMarks.Remove(index);
+ }
+ }
+
+ }
+
+
+ }
+
+void
+XOmxILCallbackManagerIfImpl::HandleInsufficientResources()
+ {
+ DEBUG_PRINTF3(_L8("XOmxILCallbackManagerIfImpl::HandleInsufficientResources : ipCallbacks[%X] ipHandle[%X]"), ipCallbacks, ipHandle);
+
+ if (ipCallbacks && ipHandle)
+ {
+ // This is a best-effort action, let's try to inform the IL Client of
+ // the lack of resources...
+ ipCallbacks->EventHandler(ipHandle,
+ ipAppData,
+ OMX_EventError,
+ (OMX_U32)OMX_ErrorInsufficientResources,
+ 0,
+ 0);
+ }
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilcallbackmanagerifimpl.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,236 @@
+// 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 OMXILCALLBACKMANAGERIFIMPL_H
+#define OMXILCALLBACKMANAGERIFIMPL_H
+
+#include <openmax/il/khronos/v1_x/OMX_Component.h>
+
+/**
+ Call Back ManagerIf Impl Panic category
+*/
+_LIT(KOmxILCallbackManagerIfImplPanicCategory, "OmxILCallbackManagerIfImpl");
+
+// Forward declarations
+class MOmxILPortManagerIf;
+class COmxILFsm;
+
+/**
+ This is a generic implementation of the Callback Manager functionality.
+
+ This implementation is meant to be reused totally or partially by specilized
+ implementations of a Callback Manager object.
+ */
+class XOmxILCallbackManagerIfImpl
+ {
+
+protected:
+
+ XOmxILCallbackManagerIfImpl(OMX_HANDLETYPE apComponentHandle,
+ OMX_PTR apAppData,
+ OMX_CALLBACKTYPE* apCallbacks);
+
+ virtual ~XOmxILCallbackManagerIfImpl();
+
+ virtual void DoSetPortManager(MOmxILPortManagerIf& apPortManager);
+
+ virtual void DoSetFsm(COmxILFsm& apFsm);
+
+ //
+ // Methods for Callback Registration
+ //
+ virtual OMX_ERRORTYPE DoRegisterComponentHandle(
+ OMX_HANDLETYPE aComponentHandle);
+
+ virtual OMX_ERRORTYPE DoRegisterILClientCallbacks(
+ const OMX_CALLBACKTYPE* apCallbacks,
+ const OMX_PTR apAppData);
+
+ virtual OMX_ERRORTYPE DoRegisterTunnelCallback(
+ OMX_U32 aLocalPortIndex,
+ OMX_DIRTYPE aLocalPortDirection,
+ OMX_HANDLETYPE aTunnelledComponentHandle,
+ OMX_U32 aTunnelledPortIndex);
+
+ virtual OMX_ERRORTYPE DoRegisterBufferMarkPropagationPort(
+ OMX_U32 aPortIndex,
+ OMX_U32 aPropagationPortIndex);
+
+ //
+ // Methods for Callback Notification
+ //
+
+ virtual OMX_ERRORTYPE DoTransitionCompleteNotification(
+ OMX_STATETYPE aOmxState);
+
+ virtual OMX_ERRORTYPE DoCommandCompleteNotification(
+ OMX_COMMANDTYPE aOmxCommand,
+ OMX_U32 aOmxPortIndex);
+
+ //
+ // Methods for Callback Notification
+ //
+
+ virtual OMX_ERRORTYPE DoErrorEventNotification(
+ OMX_ERRORTYPE aOmxError);
+
+ virtual OMX_ERRORTYPE DoEventNotification(
+ OMX_EVENTTYPE aEvent,
+ TUint32 aData1,
+ TUint32 aData2,
+ OMX_STRING aExtraInfo);
+
+ virtual OMX_ERRORTYPE DoBufferDoneNotification(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_U32 aLocalPortIndex,
+ OMX_DIRTYPE aLocalPortDirection);
+
+ virtual OMX_ERRORTYPE DoPortSettingsChangeNotification(
+ OMX_U32 aLocalPortIndex,
+ TUint aPortSettingsIndex,
+ const TDesC8& aPortSettings);
+
+#ifdef _OMXIL_COMMON_IL516C_ON
+ virtual OMX_ERRORTYPE DoEjectBuffersRequest(
+ OMX_U32 aLocalPortIndex);
+#endif
+
+ virtual void SignalOrPropagateBufferMarks(OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_U32 aLocalPortIndex);
+
+ virtual void HandleInsufficientResources();
+
+protected:
+
+ // Declaration of nested protected classes
+ class TTunnelRegistrationInfo;
+ class TBufferMarkPropagationInfo;
+ class TOutputPortBufferMarkInfo;
+
+protected:
+
+ // \defgroup IL Client callbacks data
+ //@{
+ OMX_COMPONENTTYPE* ipHandle; // not owned
+ OMX_PTR ipAppData; // not owned
+ OMX_CALLBACKTYPE* ipCallbacks; // not owned
+ //@}
+
+ // Tunnelled ports callback data
+ RArray<TTunnelRegistrationInfo> iRegisteredTunnels;
+
+ // Associations between input and output ports to be used in buffer marks
+ // propagation
+ RArray<TBufferMarkPropagationInfo> iBufferMarkPropagationPorts;
+
+ // Temporary store of buffer marks waiting to go out in the next output
+ // buffer
+ RArray<TOutputPortBufferMarkInfo> iBufferMarks;
+
+ // Port manager
+ MOmxILPortManagerIf* ipPortManager;
+
+ // FSM
+ COmxILFsm* ipFsm;
+
+ };
+
+/**
+ Structure used to hold the tunnel information needed for callback handling
+ in tunnelled communication.
+ */
+class XOmxILCallbackManagerIfImpl::TTunnelRegistrationInfo
+ {
+
+public:
+
+ inline TTunnelRegistrationInfo(
+ OMX_U32 aLocalPortIndex,
+ OMX_DIRTYPE aLocalPortDirection,
+ OMX_HANDLETYPE aTunnelledComponentHandle,
+ OMX_U32 aTunnelledPortIndex);
+
+public:
+
+ OMX_U32 iLocalPortIndex;
+ OMX_DIRTYPE iLocalPortDirection;
+ OMX_HANDLETYPE iTunnelledComponentHandle;
+ OMX_U32 iTunnelledPortIndex;
+
+ };
+
+
+/**
+ Structure used to hold the association of marked port and propagation port.
+ */
+class XOmxILCallbackManagerIfImpl::TBufferMarkPropagationInfo
+ {
+
+public:
+
+ inline TBufferMarkPropagationInfo(
+ OMX_U32 aPortIndex,
+ OMX_U32 aPropagationPortIndex);
+
+ // This constructor should only be used for array look-ups
+ inline explicit TBufferMarkPropagationInfo(OMX_U32 aPortIndex);
+
+ static TBool Compare(const TBufferMarkPropagationInfo& aBmpi1,
+ const TBufferMarkPropagationInfo& aBmpi2);
+
+public:
+
+ OMX_U32 iPortIndex;
+ OMX_U32 iPropagationPortIndex;
+
+ };
+
+/**
+ Structure used to hold the buffer marking info needed to propagate buffer
+ marks on output ports.
+ */
+class XOmxILCallbackManagerIfImpl::TOutputPortBufferMarkInfo
+ {
+
+public:
+
+ inline TOutputPortBufferMarkInfo(
+ OMX_U32 aPortIndex,
+ OMX_HANDLETYPE apMarkTargetComponent,
+ OMX_PTR apMarkData);
+
+ // This constructor should only be used for array look-ups
+ inline explicit TOutputPortBufferMarkInfo(OMX_U32 aPortIndex);
+
+ static TBool Compare(const TOutputPortBufferMarkInfo& aOpbmi1,
+ const TOutputPortBufferMarkInfo& aOpbmi2);
+
+public:
+
+ OMX_U32 iPortIndex;
+ OMX_HANDLETYPE ipMarkTargetComponent;
+ OMX_PTR ipMarkData;
+
+ };
+
+#include "omxilcallbackmanagerifimpl.inl"
+
+#endif // OMXILCALLBACKMANAGERIFIMPL_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilcallbackmanagerifimpl.inl Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,78 @@
+// 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
+*/
+
+
+inline
+XOmxILCallbackManagerIfImpl::TTunnelRegistrationInfo::TTunnelRegistrationInfo(
+ OMX_U32 aLocalPortIndex,
+ OMX_DIRTYPE aLocalPortDirection,
+ OMX_HANDLETYPE aTunnelledComponentHandle,
+ OMX_U32 aTunnelledPortIndex)
+ :
+ iLocalPortIndex(aLocalPortIndex),
+ iLocalPortDirection(aLocalPortDirection),
+ iTunnelledComponentHandle(aTunnelledComponentHandle),
+ iTunnelledPortIndex(aTunnelledPortIndex)
+ {
+ }
+
+inline
+XOmxILCallbackManagerIfImpl::TBufferMarkPropagationInfo::TBufferMarkPropagationInfo(
+ OMX_U32 aPortIndex,
+ OMX_U32 aPropagationPortIndex)
+ :
+ iPortIndex(aPortIndex),
+ iPropagationPortIndex(aPropagationPortIndex)
+ {
+ }
+
+// This constructor should only be used for array look-ups
+inline
+XOmxILCallbackManagerIfImpl::TBufferMarkPropagationInfo::TBufferMarkPropagationInfo(
+ OMX_U32 aPortIndex)
+ :
+ iPortIndex(aPortIndex),
+ iPropagationPortIndex(0)
+ {
+ }
+
+inline
+XOmxILCallbackManagerIfImpl::TOutputPortBufferMarkInfo::TOutputPortBufferMarkInfo(
+ OMX_U32 aPortIndex,
+ OMX_HANDLETYPE apMarkTargetComponent,
+ OMX_PTR apMarkData)
+ :
+ iPortIndex(aPortIndex),
+ ipMarkTargetComponent(apMarkTargetComponent),
+ ipMarkData(apMarkData)
+ {
+ }
+
+// This constructor should only be used for array look-ups
+inline
+XOmxILCallbackManagerIfImpl::TOutputPortBufferMarkInfo::TOutputPortBufferMarkInfo(
+ OMX_U32 aPortIndex)
+ :
+ iPortIndex(aPortIndex),
+ ipMarkTargetComponent(0),
+ ipMarkData(0)
+ {
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilclientclockport.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,229 @@
+// 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/omxilclientclockport.h>
+#include "log.h"
+
+
+EXPORT_C COmxILClientClockPort* COmxILClientClockPort::NewL(const TOmxILCommonPortData& aCommonPortData,
+ const RArray<OMX_OTHER_FORMATTYPE>& aSupportedOtherFormats)
+ {
+ COmxILClientClockPort* self = new(ELeave) COmxILClientClockPort();
+ CleanupStack::PushL(self);
+ self->ConstructL(aCommonPortData, aSupportedOtherFormats);
+ CleanupStack::Pop();
+ return self;
+ }
+
+void COmxILClientClockPort::ConstructL(const TOmxILCommonPortData& aCommonPortData, const RArray<OMX_OTHER_FORMATTYPE>& aSupportedOtherFormats)
+ {
+ COmxILOtherPort::ConstructL(aCommonPortData, aSupportedOtherFormats);
+ }
+
+COmxILClientClockPort::COmxILClientClockPort()
+ : iSpecVersion(TOmxILSpecVersion())
+ {
+ DEBUG_PRINTF(_L8("COmxILClientClockPort::COmxILClientClockPort"));
+ }
+
+OMX_ERRORTYPE COmxILClientClockPort::GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const
+ {
+ DEBUG_PRINTF(_L8("COmxILClientClockPort::GetLocalOmxParamIndexes"));
+ return COmxILOtherPort::GetLocalOmxParamIndexes(aIndexArray);
+ }
+
+
+OMX_ERRORTYPE COmxILClientClockPort::GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const
+ {
+ DEBUG_PRINTF(_L8("COmxILClientClockPort::GetLocalOmxParamIndexes"));
+ return COmxILOtherPort::GetLocalOmxConfigIndexes(aIndexArray);
+ }
+
+
+OMX_ERRORTYPE COmxILClientClockPort::GetParameter(OMX_INDEXTYPE aParamIndex,
+ TAny* apComponentParameterStructure) const
+ {
+ DEBUG_PRINTF(_L8("COmxILClientClockPort::GetParameter"));
+ return COmxILOtherPort::GetParameter(aParamIndex, apComponentParameterStructure);
+ }
+
+
+OMX_ERRORTYPE COmxILClientClockPort::SetParameter(OMX_INDEXTYPE aParamIndex,
+ const TAny* apComponentParameterStructure,
+ TBool& aUpdateProcessingFunction)
+ {
+ DEBUG_PRINTF(_L8("COmxILClientClockPort::SetParameter"));
+ return COmxILOtherPort::SetParameter(aParamIndex, apComponentParameterStructure, aUpdateProcessingFunction);
+ }
+
+
+OMX_ERRORTYPE COmxILClientClockPort::SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& /*aPortDefinition*/,
+ TBool& /*aUpdateProcessingFunction*/)
+ {
+ DEBUG_PRINTF(_L8("COmxILClientClockPort::SetFormatInPortDefinition"));
+ return OMX_ErrorNone;
+ }
+
+
+TBool COmxILClientClockPort::IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const
+ {
+ DEBUG_PRINTF(_L8("COmxILClientClockPort::IsTunnelledPortCompatible"));
+ // Domain check
+ if(aPortDefinition.eDomain != GetParamPortDefinition().eDomain)
+ {
+ return EFalse;
+ }
+
+ // Format check
+ if (aPortDefinition.format.other.eFormat != GetParamPortDefinition().format.other.eFormat)
+ {
+ return EFalse;
+ }
+
+ return ETrue;
+ }
+
+
+OMX_ERRORTYPE COmxILClientClockPort::GetMediaTime(OMX_TICKS& aMediaTime) const
+ {
+ DEBUG_PRINTF(_L8("COmxILClientClockPort::GetMediaTime"));
+ return GetTime(aMediaTime, OMX_IndexConfigTimeCurrentMediaTime);
+ }
+
+
+OMX_ERRORTYPE COmxILClientClockPort::GetWallTime(OMX_TICKS& aWallTime) const
+ {
+ DEBUG_PRINTF(_L8("COmxILClientClockPort::GetWallTime"));
+ return GetTime(aWallTime, OMX_IndexConfigTimeCurrentWallTime);
+ }
+
+
+OMX_ERRORTYPE COmxILClientClockPort::GetClockState(OMX_TIME_CONFIG_CLOCKSTATETYPE& aClockState) const
+ {
+ DEBUG_PRINTF(_L8("COmxILClientClockPort::GetClockState"));
+
+ if (IsClockComponentAvailable())
+ {
+ aClockState.nSize = sizeof(OMX_TIME_CONFIG_CLOCKSTATETYPE);
+ aClockState.nVersion = iSpecVersion;
+ aClockState.eState = OMX_TIME_ClockStateMax;
+ aClockState.nStartTime = 0;
+ aClockState.nOffset = 0;
+ aClockState.nWaitMask = 0;
+ return OMX_GetConfig(GetTunnelledComponent(), OMX_IndexConfigTimeClockState, &aClockState);
+ }
+
+ return OMX_ErrorIncorrectStateOperation;
+
+ }
+
+OMX_ERRORTYPE COmxILClientClockPort::MediaTimeRequest(const OMX_PTR apPrivate,
+ const OMX_TICKS aMediaTime,
+ const OMX_TICKS aOffset) const
+ {
+ DEBUG_PRINTF(_L8("COmxILClientClockPort::MediaTimeRequest"));
+ OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE timeInfo;
+ timeInfo.nSize = sizeof(timeInfo);
+ timeInfo.nVersion = iSpecVersion;
+ timeInfo.nPortIndex = GetTunnelledPort();
+ timeInfo.pClientPrivate = apPrivate;
+ timeInfo.nMediaTimestamp = aMediaTime;
+ timeInfo.nOffset = aOffset;
+
+ if (IsClockComponentAvailable())
+ {
+ return OMX_SetConfig(GetTunnelledComponent(), OMX_IndexConfigTimeMediaTimeRequest, &timeInfo);
+ }
+
+ return OMX_ErrorIncorrectStateOperation;
+ }
+
+
+OMX_ERRORTYPE COmxILClientClockPort::SetStartTime(const OMX_TICKS aStartTime) const
+ {
+ DEBUG_PRINTF(_L8("COmxILClientClockPort::SetStartTime"));
+ return SetTime(aStartTime, OMX_IndexConfigTimeClientStartTime);
+ }
+
+
+OMX_ERRORTYPE COmxILClientClockPort::SetVideoReference(const OMX_TICKS aVideoRef) const
+ {
+ DEBUG_PRINTF(_L8("COmxILClientClockPort::SetVideoReference"));
+ return SetTime(aVideoRef, OMX_IndexConfigTimeCurrentVideoReference);
+ }
+
+
+OMX_ERRORTYPE COmxILClientClockPort::SetAudioReference(const OMX_TICKS aAudioRef) const
+ {
+ DEBUG_PRINTF(_L8("COmxILClientClockPort::SetAudioReference"));
+ return SetTime(aAudioRef, OMX_IndexConfigTimeCurrentAudioReference);
+ }
+
+OMX_BOOL COmxILClientClockPort::IsClockComponentAvailable() const
+{
+ if (GetTunnelledComponent() != NULL && GetParamPortDefinition().bEnabled)
+ {
+ return OMX_TRUE;
+ }
+
+ return OMX_FALSE;
+}
+
+OMX_ERRORTYPE COmxILClientClockPort::GetTime(OMX_TICKS& aWallTime, const OMX_INDEXTYPE aTimeIndex) const
+ {
+ DEBUG_PRINTF(_L8("COmxILClientClockPort::GetTime"));
+ OMX_TIME_CONFIG_TIMESTAMPTYPE timeInfo;
+ timeInfo.nSize = sizeof(timeInfo);
+ timeInfo.nVersion = iSpecVersion;
+ timeInfo.nPortIndex = GetTunnelledPort();
+
+ if (!IsClockComponentAvailable())
+ {
+ return OMX_ErrorIncorrectStateOperation;
+ }
+
+ OMX_ERRORTYPE error = OMX_GetConfig(GetTunnelledComponent(), aTimeIndex, &timeInfo);
+
+ if (error == OMX_ErrorNone)
+ {
+ aWallTime = timeInfo.nTimestamp;
+ }
+
+ return error;
+ }
+
+
+OMX_ERRORTYPE COmxILClientClockPort::SetTime(const OMX_TICKS aStartTime, const OMX_INDEXTYPE aTimeIndex) const
+ {
+ DEBUG_PRINTF(_L8("COmxILClientClockPort::SetTime"));
+ OMX_TIME_CONFIG_TIMESTAMPTYPE timeInfo;
+ timeInfo.nSize = sizeof(timeInfo);
+ timeInfo.nVersion = iSpecVersion;
+ timeInfo.nPortIndex = GetTunnelledPort();
+ timeInfo.nTimestamp = aStartTime;
+
+ if (IsClockComponentAvailable())
+ {
+ return OMX_SetConfig(GetTunnelledComponent(), aTimeIndex, &timeInfo);
+ }
+
+ return OMX_ErrorIncorrectStateOperation;
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilcommand.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,54 @@
+// 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 OMXILCOMMAND_H
+#define OMXILCOMMAND_H
+
+
+#include <openmax/il/khronos/v1_x/OMX_Core.h>
+
+class TOmxILCommand
+ {
+
+public:
+
+ OMX_COMMANDTYPE iCommandType;
+ OMX_U32 iParam1;
+ OMX_PTR ipCommandData;
+
+ // Constructor
+ inline TOmxILCommand(
+ OMX_COMMANDTYPE aCommandType,
+ OMX_U32 aParam1,
+ OMX_PTR apCommandData);
+
+ };
+
+
+inline
+TOmxILCommand::TOmxILCommand(
+ OMX_COMMANDTYPE aCommandType,
+ OMX_U32 aParam1,
+ OMX_PTR apCommandData
+ )
+ :
+ iCommandType(aCommandType),
+ iParam1(aParam1),
+ ipCommandData(apCommandData)
+ {
+ }
+
+#endif // OMXILCOMMAND_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilcomponent.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,165 @@
+// 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/omxilcomponent.h>
+#include "omxilcomponentimpl.h"
+#include "log.h"
+
+EXPORT_C
+COmxILComponent::COmxILComponent()
+ {
+ DEBUG_PRINTF(_L8("COmxILComponent::COmxILComponent"));
+ }
+
+EXPORT_C
+COmxILComponent::~COmxILComponent()
+ {
+ DEBUG_PRINTF(_L8("COmxILComponent::~COmxILComponent"));
+ delete ipImpl;
+ }
+
+EXPORT_C void
+COmxILComponent::ConstructL(OMX_HANDLETYPE aComponent)
+ {
+ DEBUG_PRINTF(_L8("COmxILComponent::ConstructL"));
+ ipImpl = COmxILComponentImpl::NewL(this, aComponent);
+ }
+
+EXPORT_C void
+COmxILComponent::InitComponentL()
+ {
+ DEBUG_PRINTF(_L8("COmxILComponent::InitComponent"));
+ __ASSERT_ALWAYS(ipImpl, User::Panic(KOmxILComponentPanicCategory, 1));
+ ipImpl->InitComponentL();
+ }
+
+EXPORT_C
+OMX_ERRORTYPE COmxILComponent::SymbianErrorToGetHandleError(TInt aSymbianError)
+ {
+ switch(aSymbianError)
+ {
+ case KErrNone:
+ return OMX_ErrorNone;
+ case KErrNoMemory:
+ return OMX_ErrorInsufficientResources;
+ case KErrArgument:
+ return OMX_ErrorBadParameter;
+ };
+ return OMX_ErrorUndefined;
+ }
+
+EXPORT_C
+MOmxILCallbackNotificationIf* COmxILComponent::CreateCallbackManagerL(TCallbackManagerType aCallbackManagerType)
+ {
+ __ASSERT_ALWAYS(ipImpl, User::Panic(KOmxILComponentPanicCategory, 1));
+ return ipImpl->CreateCallbackManagerL(aCallbackManagerType);
+ }
+
+EXPORT_C
+TInt COmxILComponent::AddPort(const COmxILPort* aPort, OMX_DIRTYPE aDirection)
+ {
+ __ASSERT_ALWAYS(ipImpl, User::Panic(KOmxILComponentPanicCategory, 1));
+ return ipImpl->AddPort(aPort, aDirection);
+ }
+
+EXPORT_C
+void COmxILComponent::CreatePortManagerL(TPortManagerType aType,
+ const OMX_VERSIONTYPE& aOmxVersion,
+ OMX_U32 aNumberOfAudioPorts,
+ OMX_U32 aStartAudioPortNumber,
+ OMX_U32 aNumberOfImagePorts,
+ OMX_U32 aStartImagePortNumber,
+ OMX_U32 aNumberOfVideoPorts,
+ OMX_U32 aStartVideoPortNumber,
+ OMX_U32 aNumberOfOtherPorts,
+ OMX_U32 aStartOtherPortNumber,
+ OMX_BOOL aImmediateReturnTimeBuffer)
+ {
+ __ASSERT_ALWAYS(ipImpl, User::Panic(KOmxILComponentPanicCategory, 1));
+ ipImpl->CreatePortManagerL(aType,
+ aOmxVersion,
+ aNumberOfAudioPorts,
+ aStartAudioPortNumber,
+ aNumberOfImagePorts,
+ aStartImagePortNumber,
+ aNumberOfVideoPorts,
+ aStartVideoPortNumber,
+ aNumberOfOtherPorts,
+ aStartOtherPortNumber,
+ aImmediateReturnTimeBuffer);
+ }
+
+EXPORT_C
+void COmxILComponent::RegisterProcessingFunction(const COmxILProcessingFunction* apProcessingFunction)
+ {
+ __ASSERT_ALWAYS(ipImpl && apProcessingFunction, User::Panic(KOmxILComponentPanicCategory, 1));
+ ipImpl->RegisterProcessingFunction(apProcessingFunction);
+ }
+
+EXPORT_C
+void COmxILComponent::RegisterConfigurationManager(const COmxILConfigManager* apConfigManager)
+ {
+ __ASSERT_ALWAYS(ipImpl && apConfigManager, User::Panic(KOmxILComponentPanicCategory, 1));
+ ipImpl->RegisterConfigurationManager(apConfigManager);
+ }
+
+
+EXPORT_C
+OMX_COMPONENTTYPE* COmxILComponent::GetHandle() const
+ {
+ __ASSERT_ALWAYS(ipImpl, User::Panic(KOmxILComponentPanicCategory, 1));
+ return ipImpl->GetHandle();
+ }
+
+EXPORT_C
+OMX_PTR COmxILComponent::GetAppData() const
+ {
+ __ASSERT_ALWAYS(ipImpl, User::Panic(KOmxILComponentPanicCategory, 1));
+ return ipImpl->GetAppData();
+ }
+
+EXPORT_C
+OMX_CALLBACKTYPE* COmxILComponent::GetCallbacks() const
+ {
+ __ASSERT_ALWAYS(ipImpl, User::Panic(KOmxILComponentPanicCategory, 1));
+ return ipImpl->GetCallbacks();
+ }
+
+EXPORT_C
+COmxILConfigManager* COmxILComponent::GetConfigManager() const
+ {
+ __ASSERT_ALWAYS(ipImpl, User::Panic(KOmxILComponentPanicCategory, 1));
+ return ipImpl->GetConfigManager();
+ }
+
+EXPORT_C
+COmxILProcessingFunction* COmxILComponent::GetProcessingFunction() const
+ {
+ __ASSERT_ALWAYS(ipImpl, User::Panic(KOmxILComponentPanicCategory, 1));
+ return ipImpl->GetProcessingFunction();
+ }
+
+EXPORT_C
+TInt COmxILComponent::Extension_(TUint aExtensionId, TAny *&a0, TAny *a1)
+ {
+ return CBase::Extension_(aExtensionId, a0, a1);
+ }
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilcomponent.hrh Wed Aug 25 12:40:50 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 OMXILCOMPONENT_HRH
+#define OMXILCOMPONENT_HRH
+
+#define KUidSymbianOmxILComponentCommonDll 0x10283498
+
+#endif // OMXILCOMPONENT_HRH
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilcomponentimpl.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,504 @@
+// 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_Types.h>
+#include "omxilindexmanager.h"
+#include "omxilportmanager.h"
+#include "omxilcallbackmanager.h"
+#include "omxilincontextcallbackmanager.h"
+#include <openmax/il/common/omxilconfigmanager.h>
+#include <openmax/il/common/omxilprocessingfunction.h>
+#include <openmax/il/common/omxilstatedefs.h>
+#include <openmax/il/common/omxilcomponent.h>
+#include "omxilcomponentimpl.h"
+#include "omxilfsm.h"
+#include "log.h"
+
+COmxILComponentImpl* COmxILComponentImpl::NewL(COmxILComponent* aComponent, OMX_HANDLETYPE aHandle)
+ {
+ if (aComponent==0 || aHandle==0)
+ {
+ User::Leave(KErrArgument);
+ }
+ COmxILComponentImpl* self=new(ELeave) COmxILComponentImpl(aComponent, aHandle);
+ return self;
+ }
+
+COmxILComponentImpl::COmxILComponentImpl(COmxILComponent* aComponent, OMX_HANDLETYPE aHandle)
+ : ipComponent(aComponent),
+ iComponentName(0),
+ ipHandle(static_cast<OMX_COMPONENTTYPE*>(aHandle)),
+ ipAppData(0),
+ ipCallbacks(0),
+ ipFsm(0),
+ ipConfigManager(0),
+ ipCallbackManager(0),
+ ipPortManager(0),
+ ipProcessingFunction(0)
+ {
+ DEBUG_PRINTF3(_L8("COmxILComponentImpl::COmxILComponentImpl : Comp[%X], Handle[%X]"), aComponent, ipHandle);
+ }
+
+COmxILComponentImpl::~COmxILComponentImpl()
+ {
+ DEBUG_PRINTF2(_L8("COmxILComponentImpl::~COmxILComponentImpl : Handle[%X]"), ipHandle);
+ delete ipProcessingFunction;
+ delete ipPortManager;
+ delete ipConfigManager;
+ delete ipFsm;
+ delete ipCallbackManager;
+ iComponentName.Close();
+ }
+
+OMX_ERRORTYPE
+COmxILComponentImpl::GetComponentVersion(
+ OMX_HANDLETYPE aComponent,
+ OMX_STRING aComponentName,
+ OMX_VERSIONTYPE* apComponentVersion,
+ OMX_VERSIONTYPE* apSpecVersion,
+ OMX_UUIDTYPE* apComponentUUID)
+ {
+ DEBUG_PRINTF2(_L8("COmxILComponentImpl::GetComponentVersion : Handle[%X]"), aComponent);
+ OMX_ERRORTYPE omxError;
+ omxError = (static_cast<COmxILFsm*>
+ ((static_cast<OMX_COMPONENTTYPE*>(aComponent))->pComponentPrivate))->
+ GetComponentVersion(aComponentName, apComponentVersion,
+ apSpecVersion, apComponentUUID);
+ return omxError;
+ }
+
+OMX_ERRORTYPE
+COmxILComponentImpl::SendCommand(
+ OMX_HANDLETYPE aComponent,
+ OMX_COMMANDTYPE aCmd,
+ OMX_U32 aParam1,
+ OMX_PTR aCmdData)
+ {
+ DEBUG_PRINTF2(_L8("COmxILComponentImpl::SendCommand : Handle[%X]"), aComponent);
+ OMX_ERRORTYPE omxError;
+ omxError = (static_cast<COmxILFsm*>
+ ((static_cast<OMX_COMPONENTTYPE*>(aComponent))->pComponentPrivate))->
+ SendCommand(aCmd ,aParam1, aCmdData);
+
+ return omxError;
+ }
+
+OMX_ERRORTYPE
+COmxILComponentImpl::GetParameter(
+ OMX_HANDLETYPE aComponent,
+ OMX_INDEXTYPE aParamIndex,
+ OMX_PTR aComponentParameterStructure)
+ {
+ DEBUG_PRINTF3(_L8("COmxILComponentImpl::GetParameter : Handle[%X]; ParamIndex[0x%X]"), aComponent, aParamIndex);
+
+ OMX_ERRORTYPE omxError;
+ omxError = (static_cast<COmxILFsm*>
+ ((static_cast<OMX_COMPONENTTYPE*>(aComponent))->pComponentPrivate))->
+ GetParameter(aParamIndex, aComponentParameterStructure);
+
+ return omxError;
+ }
+
+OMX_ERRORTYPE
+COmxILComponentImpl::SetParameter(
+ OMX_HANDLETYPE aComponent,
+ OMX_INDEXTYPE aIndex,
+ OMX_PTR aComponentParameterStructure)
+ {
+ DEBUG_PRINTF3(_L8("COmxILComponentImpl::SetParameter : Handle[%X]; ParamIndex[0x%X]"), aComponent, aIndex);
+
+ OMX_ERRORTYPE omxError;
+ omxError = (static_cast<COmxILFsm*>
+ ((static_cast<OMX_COMPONENTTYPE*>(aComponent))->pComponentPrivate))->
+ SetParameter(aIndex,
+ const_cast<const TAny*>(aComponentParameterStructure));
+
+ return omxError;
+ }
+
+OMX_ERRORTYPE
+COmxILComponentImpl::GetConfig(
+ OMX_HANDLETYPE aComponent,
+ OMX_INDEXTYPE aIndex,
+ OMX_PTR aComponentParameterStructure)
+ {
+ DEBUG_PRINTF3(_L8("COmxILComponentImpl::GetConfig : Handle[%X]; ConfigIndex[0x%X]"), aComponent, aIndex);
+ OMX_ERRORTYPE omxError;
+ omxError = (static_cast<COmxILFsm*>
+ ((static_cast<OMX_COMPONENTTYPE*>(aComponent))->pComponentPrivate))->
+ GetConfig(aIndex, aComponentParameterStructure);
+ return omxError;
+ }
+
+OMX_ERRORTYPE
+COmxILComponentImpl::SetConfig(
+ OMX_HANDLETYPE aComponent,
+ OMX_INDEXTYPE aIndex,
+ OMX_PTR aComponentConfigStructure)
+ {
+ DEBUG_PRINTF3(_L8("COmxILComponentImpl::SetConfig : Handle[%X]; ConfigIndex[0x%X]"), aComponent, aIndex);
+ OMX_ERRORTYPE omxError;
+ omxError = (static_cast<COmxILFsm*>
+ ((static_cast<OMX_COMPONENTTYPE*>(aComponent))->pComponentPrivate))->
+ SetConfig(aIndex, const_cast<const TAny*>(aComponentConfigStructure));
+ return omxError;
+ }
+
+OMX_ERRORTYPE
+COmxILComponentImpl::GetExtensionIndex(
+ OMX_HANDLETYPE aComponent,
+ OMX_STRING aParameterName,
+ OMX_INDEXTYPE* aIndexType)
+ {
+ DEBUG_PRINTF2(_L8("COmxILComponentImpl::GetExtensionIndex : Handle[%X]"), aComponent);
+ OMX_ERRORTYPE omxError;
+ omxError = (static_cast<COmxILFsm*>
+ ((static_cast<OMX_COMPONENTTYPE*>(aComponent))->pComponentPrivate))->
+ GetExtensionIndex(aParameterName, aIndexType);
+ return omxError;
+ }
+
+OMX_ERRORTYPE
+COmxILComponentImpl::GetState(
+ OMX_HANDLETYPE aComponent,
+ OMX_STATETYPE* aState)
+ {
+ DEBUG_PRINTF2(_L8("COmxILComponentImpl::GetState : Handle[%X]"), aComponent);
+ OMX_ERRORTYPE omxError;
+ omxError = (static_cast<COmxILFsm*>
+ ((static_cast<OMX_COMPONENTTYPE*>(aComponent))->pComponentPrivate))->
+ GetState(aState);
+ return omxError;
+ }
+
+OMX_ERRORTYPE
+COmxILComponentImpl::ComponentTunnelRequest(
+ OMX_HANDLETYPE aComponent,
+ OMX_U32 aPort,
+ OMX_HANDLETYPE aTunneledComp,
+ OMX_U32 aTunneledPort,
+ OMX_TUNNELSETUPTYPE* aTunnelSetup)
+ {
+ DEBUG_PRINTF2(_L8("COmxILComponentImpl::ComponentTunnelRequest : Handle[%X]"), aComponent);
+ OMX_ERRORTYPE omxError;
+ omxError = (static_cast<COmxILFsm*>
+ ((static_cast<OMX_COMPONENTTYPE*>(aComponent))->pComponentPrivate))->
+ ComponentTunnelRequest(aPort, aTunneledComp,
+ aTunneledPort, aTunnelSetup);
+ return omxError;
+ }
+
+OMX_ERRORTYPE
+COmxILComponentImpl::UseBuffer(
+ OMX_HANDLETYPE aComponent,
+ OMX_BUFFERHEADERTYPE** appBufferHdr,
+ OMX_U32 aPortIndex,
+ OMX_PTR apAppPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* aBuffer)
+ {
+ DEBUG_PRINTF2(_L8("COmxILComponentImpl::UseBuffer : Handle[%X]"), aComponent);
+ OMX_ERRORTYPE omxError;
+ omxError = (static_cast<COmxILFsm*>
+ ((static_cast<OMX_COMPONENTTYPE*>(aComponent))->pComponentPrivate))->
+ UseBuffer(appBufferHdr, aPortIndex, apAppPrivate, aSizeBytes, aBuffer);
+ return omxError;
+ }
+
+OMX_ERRORTYPE
+COmxILComponentImpl::AllocateBuffer(
+ OMX_HANDLETYPE aComponent,
+ OMX_BUFFERHEADERTYPE** apBuffer,
+ OMX_U32 aPortIndex,
+ OMX_PTR aAppData,
+ OMX_U32 aSizeBytes)
+ {
+ DEBUG_PRINTF2(_L8("COmxILComponentImpl::AllocateBuffer : Handle[%X]"), aComponent);
+ OMX_ERRORTYPE omxError;
+ omxError = (static_cast<COmxILFsm*>
+ ((static_cast<OMX_COMPONENTTYPE*>(aComponent))->pComponentPrivate))->
+ AllocateBuffer(apBuffer, aPortIndex, aAppData, aSizeBytes);
+ return omxError;
+ }
+
+OMX_ERRORTYPE
+COmxILComponentImpl::FreeBuffer(
+ OMX_HANDLETYPE aComponent,
+ OMX_U32 aPortIndex,
+ OMX_BUFFERHEADERTYPE* aBuffer)
+ {
+ DEBUG_PRINTF2(_L8("COmxILComponentImpl::FreeBuffer : Handle[%X]"), aComponent);
+ OMX_ERRORTYPE omxError;
+ omxError = (static_cast<COmxILFsm*>
+ ((static_cast<OMX_COMPONENTTYPE*>(aComponent))->pComponentPrivate))->
+ FreeBuffer(aPortIndex, aBuffer);
+ return omxError;
+ }
+
+OMX_ERRORTYPE
+COmxILComponentImpl::EmptyThisBuffer(
+ OMX_HANDLETYPE aComponent,
+ OMX_BUFFERHEADERTYPE* aBuffer)
+ {
+ DEBUG_PRINTF2(_L8("COmxILComponentImpl::EmptyThisBuffer : Handle[%X]"), aComponent);
+#ifdef _OMXIL_COMMON_BUFFER_TRACING_ON
+ RDebug::Print(_L("COmxILComponentImpl::EmptyThisBuffer component=0x%08X header=0x%08X port=%d flags=0x%X filledLen=%d timeStamp=%Ld"),
+ aComponent, aBuffer, aBuffer->nInputPortIndex, aBuffer->nFlags, aBuffer->nFilledLen, aBuffer->nTimeStamp);
+#endif
+ OMX_ERRORTYPE omxError;
+ omxError = (static_cast<COmxILFsm*>
+ ((static_cast<OMX_COMPONENTTYPE*>(aComponent))->pComponentPrivate))->
+ EmptyThisBuffer(aBuffer);
+
+ return omxError;
+ }
+
+OMX_ERRORTYPE
+COmxILComponentImpl::FillThisBuffer(
+ OMX_HANDLETYPE aComponent,
+ OMX_BUFFERHEADERTYPE* aBuffer)
+ {
+ DEBUG_PRINTF2(_L8("COmxILComponentImpl::FillThisBuffer : Handle[%X]"), aComponent);
+#ifdef _OMXIL_COMMON_BUFFER_TRACING_ON
+ RDebug::Print(_L("COmxILComponentImpl::FillThisBuffer component=0x%08X header=0x%08X port=%d"), aComponent, aBuffer, aBuffer->nOutputPortIndex);
+#endif
+
+ OMX_ERRORTYPE omxError;
+ omxError = (static_cast<COmxILFsm*>
+ ((static_cast<OMX_COMPONENTTYPE*>(aComponent))->pComponentPrivate))->
+ FillThisBuffer(aBuffer);
+
+ return omxError;
+ }
+
+OMX_ERRORTYPE
+COmxILComponentImpl::SetCallbacks(
+ OMX_HANDLETYPE aComponent,
+ OMX_CALLBACKTYPE* aCallbacks,
+ OMX_PTR aAppData)
+ {
+ DEBUG_PRINTF2(_L8("COmxILComponentImpl::SetCallbacks : Handle[%X]"), aComponent);
+ OMX_ERRORTYPE omxError;
+ omxError = (static_cast<COmxILFsm*>
+ ((static_cast<OMX_COMPONENTTYPE*>(aComponent))->pComponentPrivate))->
+ SetCallbacks(const_cast<const OMX_CALLBACKTYPE*>(aCallbacks), aAppData);
+ if (OMX_ErrorNone==omxError)
+ {
+ (static_cast<OMX_COMPONENTTYPE*>(aComponent))->pApplicationPrivate = aAppData;
+ }
+ return omxError;
+ }
+
+OMX_ERRORTYPE
+COmxILComponentImpl::ComponentDeInit(
+ OMX_HANDLETYPE aComponent)
+ {
+ DEBUG_PRINTF2(_L8("COmxILComponentImpl::ComponentDeInit : Handle[%X]"), aComponent);
+ delete (static_cast<COmxILComponent*>(
+ (static_cast<COmxILFsm*>(
+ (static_cast<OMX_COMPONENTTYPE*>(aComponent))->
+ pComponentPrivate))->GetComponent()));
+ return OMX_ErrorNone;
+ }
+
+OMX_ERRORTYPE
+COmxILComponentImpl::UseEGLImage(
+ OMX_HANDLETYPE aComponent,
+ OMX_BUFFERHEADERTYPE** appBufferHdr,
+ OMX_U32 aPortIndex,
+ OMX_PTR aAppPrivate,
+ void* eglImage)
+ {
+ DEBUG_PRINTF2(_L8("COmxILComponentImpl::UseEGLImage : Handle[%X]"), aComponent);
+ OMX_ERRORTYPE omxError;
+ omxError = (static_cast<COmxILFsm*>
+ ((static_cast<OMX_COMPONENTTYPE*>(aComponent))->pComponentPrivate))->
+ UseEGLImage(appBufferHdr, aPortIndex, aAppPrivate, eglImage);
+ return omxError;
+ }
+
+OMX_ERRORTYPE
+COmxILComponentImpl::ComponentRoleEnum(
+ OMX_HANDLETYPE aComponent,
+ OMX_U8* aRole,
+ OMX_U32 aIndex)
+ {
+ DEBUG_PRINTF2(_L8("COmxILComponentImpl::ComponentRoleEnum : Handle[%X]"), aComponent);
+ OMX_ERRORTYPE omxError;
+ omxError = (static_cast<COmxILFsm*>
+ ((static_cast<OMX_COMPONENTTYPE*>(aComponent))->pComponentPrivate))->
+ ComponentRoleEnum(aRole, aIndex);
+ return omxError;
+ }
+
+void
+COmxILComponentImpl::InitComponentL()
+ {
+ DEBUG_PRINTF2(_L8("COmxILComponentImpl::InitComponent : Handle[%X]"), ipHandle);
+ __ASSERT_ALWAYS(ipHandle && ipProcessingFunction && ipCallbackManager && ipPortManager && ipConfigManager, User::Panic(KOmxILComponentPanicCategory, 1));
+ ipFsm = COmxILFsm::NewL(*ipComponent,
+ *ipProcessingFunction,
+ *ipPortManager,
+ *ipConfigManager,
+ *ipCallbackManager);
+
+ char componentNamebuffer[OMX_MAX_STRINGNAME_SIZE];
+ OMX_VERSIONTYPE componentVersion;
+ OMX_VERSIONTYPE specVersion;
+ OMX_UUIDTYPE componentUid;
+
+ ipConfigManager->GetComponentVersion(componentNamebuffer,
+ &componentVersion,
+ &specVersion,
+ &componentUid);
+ TBuf8<128> componentNameBuf8;
+ componentNameBuf8 = const_cast<const TUint8*>(reinterpret_cast<TUint8*>(componentNamebuffer));
+ iComponentName.CreateL(componentNameBuf8, componentNameBuf8.Length() + 1);
+ iComponentName.PtrZ();
+ DEBUG_PRINTF2(_L8("COmxILComponentImpl::InitComponent : [%S]"), &iComponentName);
+
+ // Fill in the component handle
+ ipHandle->nVersion = componentVersion;
+ // The FSM will take care of all the API calls
+ ipHandle->pComponentPrivate = ipFsm;
+ ipHandle->pApplicationPrivate = 0;
+ ipHandle->GetComponentVersion = COmxILComponentImpl::GetComponentVersion;
+ ipHandle->SendCommand = COmxILComponentImpl::SendCommand;
+ ipHandle->GetParameter = COmxILComponentImpl::GetParameter;
+ ipHandle->SetParameter = COmxILComponentImpl::SetParameter;
+ ipHandle->GetConfig = COmxILComponentImpl::GetConfig;
+ ipHandle->SetConfig = COmxILComponentImpl::SetConfig;
+ ipHandle->GetExtensionIndex = COmxILComponentImpl::GetExtensionIndex;
+ ipHandle->GetState = COmxILComponentImpl::GetState;
+ ipHandle->ComponentTunnelRequest = COmxILComponentImpl::ComponentTunnelRequest;
+ ipHandle->UseBuffer = COmxILComponentImpl::UseBuffer;
+ ipHandle->AllocateBuffer = COmxILComponentImpl::AllocateBuffer;
+ ipHandle->FreeBuffer = COmxILComponentImpl::FreeBuffer;
+ ipHandle->EmptyThisBuffer = COmxILComponentImpl::EmptyThisBuffer;
+ ipHandle->FillThisBuffer = COmxILComponentImpl::FillThisBuffer;
+ ipHandle->SetCallbacks = COmxILComponentImpl::SetCallbacks;
+ ipHandle->ComponentDeInit = COmxILComponentImpl::ComponentDeInit;
+ ipHandle->UseEGLImage = COmxILComponentImpl::UseEGLImage;
+ ipHandle->ComponentRoleEnum = COmxILComponentImpl::ComponentRoleEnum;
+
+ OMX_ERRORTYPE omxRetValue =
+ ipCallbackManager->RegisterComponentHandle(ipHandle);
+ if (OMX_ErrorNone != omxRetValue)
+ {
+ if (OMX_ErrorInsufficientResources == omxRetValue)
+ {
+ User::Leave(KErrNoMemory);
+ }
+ User::Leave(KErrGeneral);
+ }
+
+ // Let's init the FSM...
+ ipFsm->InitFsm();
+ }
+
+MOmxILCallbackNotificationIf* COmxILComponentImpl::CreateCallbackManagerL(COmxILComponent::TCallbackManagerType aCallbackManagerType)
+ {
+ if (aCallbackManagerType==COmxILComponent::EInContext)
+ {
+ ipCallbackManager = COmxILInContextCallbackManager::NewL(ipHandle, ipAppData, ipCallbacks);
+ }
+ else if (aCallbackManagerType==COmxILComponent::EOutofContext)
+ {
+ ipCallbackManager = COmxILCallbackManager::NewL(ipHandle, ipAppData, ipCallbacks);
+ }
+
+ return ipCallbackManager;
+ }
+
+TInt COmxILComponentImpl::AddPort(const COmxILPort* aPort, OMX_DIRTYPE aDirection)
+ {
+ return ipPortManager->AddPort(aPort, aDirection);
+ }
+
+void COmxILComponentImpl::CreatePortManagerL(COmxILComponent::TPortManagerType /*aType*/,
+ const OMX_VERSIONTYPE& aOmxVersion,
+ OMX_U32 aNumberOfAudioPorts,
+ OMX_U32 aStartAudioPortNumber,
+ OMX_U32 aNumberOfImagePorts,
+ OMX_U32 aStartImagePortNumber,
+ OMX_U32 aNumberOfVideoPorts,
+ OMX_U32 aStartVideoPortNumber,
+ OMX_U32 aNumberOfOtherPorts,
+ OMX_U32 aStartOtherPortNumber,
+ OMX_BOOL aImmediateReturnTimeBuffer)
+ {
+ __ASSERT_ALWAYS(ipProcessingFunction && ipCallbackManager, User::Panic(KOmxILComponentPanicCategory, 1));
+ ipPortManager = COmxILPortManager::NewL(*ipProcessingFunction, // The component's processing function
+ *ipCallbackManager, // The call back manager object
+ aOmxVersion, // Component's OMX Version
+ aNumberOfAudioPorts, // The number of audio ports in this component
+ aStartAudioPortNumber, // The starting audio port index
+ aNumberOfImagePorts, // The number of image ports in this component
+ aStartImagePortNumber, // The starting image port index
+ aNumberOfVideoPorts, // The number of video ports in this component
+ aStartVideoPortNumber, // The starting video port index
+ aNumberOfOtherPorts, // The number of other ports in this component
+ aStartOtherPortNumber, // The starting other port index
+ aImmediateReturnTimeBuffer
+ );
+ }
+
+void COmxILComponentImpl::RegisterProcessingFunction(const COmxILProcessingFunction* apProcessingFunction)
+ {
+ __ASSERT_ALWAYS(apProcessingFunction, User::Panic(KOmxILComponentPanicCategory, 1));
+ ipProcessingFunction = const_cast<COmxILProcessingFunction*>(apProcessingFunction);
+ }
+
+void COmxILComponentImpl::RegisterConfigurationManager(const COmxILConfigManager* apConfigManager)
+ {
+ __ASSERT_ALWAYS(apConfigManager, User::Panic(KOmxILComponentPanicCategory, 1));
+ ipConfigManager = const_cast<COmxILConfigManager*>(apConfigManager);
+ SetPortManagerForConfigManager();
+ }
+
+OMX_COMPONENTTYPE* COmxILComponentImpl::GetHandle() const
+ {
+ return ipHandle;
+ }
+OMX_PTR COmxILComponentImpl::GetAppData() const
+ {
+ return ipAppData;
+ }
+OMX_CALLBACKTYPE* COmxILComponentImpl::GetCallbacks() const
+ {
+ return ipCallbacks;
+ }
+COmxILConfigManager* COmxILComponentImpl::GetConfigManager() const
+ {
+ return ipConfigManager;
+ }
+COmxILProcessingFunction* COmxILComponentImpl::GetProcessingFunction() const
+ {
+ return ipProcessingFunction;
+ }
+MOmxILCallbackNotificationIf* COmxILComponentImpl::GetCallbackNotificationIf() const
+ {
+ return ipCallbackManager;
+ }
+void COmxILComponentImpl::SetPortManagerForConfigManager()
+ {
+ __ASSERT_ALWAYS(ipPortManager && ipConfigManager, User::Panic(KOmxILComponentPanicCategory, 1));
+ ipConfigManager->SetPortManager(ipPortManager);
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilcomponentimpl.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,183 @@
+// 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 OMXILCOMPONENTIMPL_H
+#define OMXILCOMPONENTIMPL_H
+
+#include <e32base.h>
+#include <openmax/il/khronos/v1_x/OMX_Component.h>
+
+// forward declarations
+class COmxILFsm;
+class COmxILConfigManager;
+class MOmxILCallbackManagerIf;
+class MOmxILPortManagerIf;
+class MOmxILCallbackNotificationIf;
+class COmxILProcessingFunction;
+class COmxILPort;
+
+class COmxILComponentImpl : public CBase
+ {
+public:
+ static COmxILComponentImpl* NewL(COmxILComponent* aComponent, OMX_HANDLETYPE aHandle);
+ virtual ~COmxILComponentImpl();
+
+ void InitComponentL();
+ void ConstructL(OMX_HANDLETYPE aComponent);
+ MOmxILCallbackNotificationIf* CreateCallbackManagerL(COmxILComponent::TCallbackManagerType aCallbackManagerType);
+ void CreatePortManagerL(COmxILComponent::TPortManagerType aType,
+ const OMX_VERSIONTYPE& aOmxVersion,
+ OMX_U32 aNumberOfAudioPorts,
+ OMX_U32 aStartAudioPortNumber,
+ OMX_U32 aNumberOfImagePorts,
+ OMX_U32 aStartImagePortNumber,
+ OMX_U32 aNumberOfVideoPorts,
+ OMX_U32 aStartVideoPortNumber,
+ OMX_U32 aNumberOfOtherPorts,
+ OMX_U32 aStartOtherPortNumber,
+ OMX_BOOL aImmediateReturnTimeBuffer);
+ TInt AddPort(const COmxILPort* aPort, OMX_DIRTYPE aDirection);
+ void RegisterProcessingFunction(const COmxILProcessingFunction* aProcessingFunction);
+ void RegisterConfigurationManager(const COmxILConfigManager* aConfigManager);
+ //Getters
+ OMX_COMPONENTTYPE* GetHandle() const;
+ OMX_PTR GetAppData() const;
+ OMX_CALLBACKTYPE* GetCallbacks() const;
+ COmxILConfigManager* GetConfigManager() const;
+ COmxILProcessingFunction* GetProcessingFunction() const;
+ MOmxILCallbackNotificationIf* GetCallbackNotificationIf() const;
+ //Setters
+ void SetPortManagerForConfigManager();
+
+private:
+ COmxILComponentImpl(COmxILComponent* aComponent, OMX_HANDLETYPE aHandle);
+ void ConstructL();
+ static OMX_ERRORTYPE GetComponentVersion(
+ OMX_HANDLETYPE aComponent,
+ OMX_STRING aComponentName,
+ OMX_VERSIONTYPE* apComponentVersion,
+ OMX_VERSIONTYPE* apSpecVersion,
+ OMX_UUIDTYPE* apComponentUUID);
+
+ static OMX_ERRORTYPE SendCommand(
+ OMX_HANDLETYPE aComponent,
+ OMX_COMMANDTYPE aCmd,
+ OMX_U32 aParam1,
+ OMX_PTR aCmdData);
+
+ static OMX_ERRORTYPE GetParameter(
+ OMX_HANDLETYPE aComponent,
+ OMX_INDEXTYPE aParamIndex,
+ OMX_PTR aComponentParameterStructure);
+
+ static OMX_ERRORTYPE SetParameter(
+ OMX_HANDLETYPE aComponent,
+ OMX_INDEXTYPE aIndex,
+ OMX_PTR aComponentParameterStructure);
+
+ static OMX_ERRORTYPE GetConfig(
+ OMX_HANDLETYPE aComponent,
+ OMX_INDEXTYPE aIndex,
+ OMX_PTR aComponentConfigStructure);
+
+ static OMX_ERRORTYPE SetConfig(
+ OMX_HANDLETYPE aComponent,
+ OMX_INDEXTYPE aIndex,
+ OMX_PTR aComponentConfigStructure);
+
+ static OMX_ERRORTYPE GetExtensionIndex(
+ OMX_HANDLETYPE aComponent,
+ OMX_STRING aParameterName,
+ OMX_INDEXTYPE* aIndexType);
+
+ static OMX_ERRORTYPE GetState(
+ OMX_HANDLETYPE aComponent,
+ OMX_STATETYPE* aState);
+
+ static OMX_ERRORTYPE ComponentTunnelRequest(
+ OMX_HANDLETYPE aComp,
+ OMX_U32 aPort,
+ OMX_HANDLETYPE aTunneledComp,
+ OMX_U32 aTunneledPort,
+ OMX_TUNNELSETUPTYPE* aTunnelSetup);
+
+ static OMX_ERRORTYPE UseBuffer(
+ OMX_HANDLETYPE aComponent,
+ OMX_BUFFERHEADERTYPE** appBufferHdr,
+ OMX_U32 aPortIndex,
+ OMX_PTR apAppPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* aBuffer);
+
+ static OMX_ERRORTYPE AllocateBuffer(
+ OMX_HANDLETYPE aComponent,
+ OMX_BUFFERHEADERTYPE** apBuffer,
+ OMX_U32 aPortIndex,
+ OMX_PTR aAppData,
+ OMX_U32 aSizeBytes);
+
+ static OMX_ERRORTYPE FreeBuffer(
+ OMX_HANDLETYPE aComponent,
+ OMX_U32 aPortIndex,
+ OMX_BUFFERHEADERTYPE* aBuffer);
+
+ static OMX_ERRORTYPE EmptyThisBuffer(
+ OMX_HANDLETYPE aComponent,
+ OMX_BUFFERHEADERTYPE* aBuffer);
+
+ static OMX_ERRORTYPE FillThisBuffer(
+ OMX_HANDLETYPE aComponent,
+ OMX_BUFFERHEADERTYPE* aBuffer);
+
+ static OMX_ERRORTYPE SetCallbacks(
+ OMX_HANDLETYPE aComponent,
+ OMX_CALLBACKTYPE* aCallbacks,
+ OMX_PTR aAppData);
+
+ static OMX_ERRORTYPE ComponentDeInit(
+ OMX_HANDLETYPE aComponent);
+
+ static OMX_ERRORTYPE UseEGLImage(
+ OMX_HANDLETYPE aComponent,
+ OMX_BUFFERHEADERTYPE** appBufferHdr,
+ OMX_U32 aPortIndex,
+ OMX_PTR aAppPrivate,
+ void* eglImage);
+
+ static OMX_ERRORTYPE ComponentRoleEnum(
+ OMX_HANDLETYPE aComponent,
+ OMX_U8* aRole,
+ OMX_U32 aIndex);
+
+private:
+ COmxILComponent* ipComponent;
+ RBuf8 iComponentName;
+ OMX_COMPONENTTYPE* ipHandle;
+ OMX_PTR ipAppData;
+ OMX_CALLBACKTYPE* ipCallbacks;
+ COmxILFsm* ipFsm;
+ COmxILConfigManager* ipConfigManager;
+ MOmxILCallbackManagerIf* ipCallbackManager;
+ MOmxILPortManagerIf* ipPortManager;
+ COmxILProcessingFunction* ipProcessingFunction;
+ };
+
+#endif // OMXILCOMPONENTIMPL_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilconfigmanager.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,194 @@
+// 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 <e32cmn.h>
+#include <openmax/il/khronos/v1_x/OMX_Core.h>
+
+#include "log.h"
+#include <openmax/il/common/omxilconfigmanager.h>
+#include <openmax/il/common/omxilspecversion.h>
+#include <openmax/il/common/omxilutil.h>
+#include "omxilportmanagerif.h"
+#include "omxilconfigmanagerimpl.h"
+
+EXPORT_C COmxILConfigManager*
+COmxILConfigManager::NewL(
+ const TDesC8& aComponentName,
+ const OMX_VERSIONTYPE& aComponentVersion,
+ const RPointerArray<TDesC8>& aComponentRoleList)
+ {
+ DEBUG_PRINTF(_L8("COmxILConfigManager::NewL"));
+ __ASSERT_DEBUG(aComponentName.Length() && aComponentRoleList.Count(),
+ User::Panic(KOmxILConfigManagerPanicCategory, 1));
+
+ COmxILConfigManager* self = new (ELeave)COmxILConfigManager();
+ CleanupStack::PushL(self);
+ self->ConstructL(aComponentName,
+ aComponentVersion,
+ aComponentRoleList);
+ CleanupStack::Pop(self);
+ return self;
+
+ }
+
+EXPORT_C void
+COmxILConfigManager::ConstructL(const TDesC8& aComponentName,
+ const OMX_VERSIONTYPE& aComponentVersion,
+ const RPointerArray<TDesC8>& aComponentRoleList)
+ {
+ DEBUG_PRINTF(_L8("COmxILConfigManager::ConstructL"));
+ ipConfigManagerImpl=COmxILConfigManagerImpl::NewL(aComponentName,
+ aComponentVersion,
+ aComponentRoleList);
+ }
+
+EXPORT_C
+COmxILConfigManager::COmxILConfigManager()
+ {
+ DEBUG_PRINTF(_L8("COmxILConfigManager::COmxILConfigManager"));
+ }
+
+EXPORT_C
+COmxILConfigManager::~COmxILConfigManager()
+ {
+ DEBUG_PRINTF(_L8("COmxILConfigManager::~COmxILConfigManager"));
+
+ delete ipConfigManagerImpl;
+ }
+
+OMX_ERRORTYPE
+COmxILConfigManager::GetComponentVersion(OMX_STRING aComponentName,
+ OMX_VERSIONTYPE* apComponentVersion,
+ OMX_VERSIONTYPE* apSpecVersion,
+ OMX_UUIDTYPE* apComponentUUID) const
+ {
+ DEBUG_PRINTF(_L8("COmxILConfigManager::GetComponentVersion"));
+ __ASSERT_ALWAYS(ipConfigManagerImpl, User::Panic(KOmxILConfigManagerPanicCategory, 1));
+ return ipConfigManagerImpl->GetComponentVersion(aComponentName,
+ apComponentVersion,
+ apSpecVersion,
+ apComponentUUID);
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILConfigManager::GetParameter(OMX_INDEXTYPE aParamIndex,
+ TAny* apComponentParameterStructure) const
+ {
+ DEBUG_PRINTF(_L8("COmxILConfigManager::GetParameter"));
+ __ASSERT_ALWAYS(ipConfigManagerImpl, User::Panic(KOmxILConfigManagerPanicCategory, 1));
+ return ipConfigManagerImpl->GetParameter(aParamIndex, apComponentParameterStructure);
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILConfigManager::SetParameter(OMX_INDEXTYPE aParamIndex,
+ const TAny* apComponentParameterStructure,
+ OMX_BOOL aInitTime /* = OMX_TRUE */)
+ {
+ DEBUG_PRINTF(_L8("COmxILConfigManager::SetParameter"));
+ __ASSERT_ALWAYS(ipConfigManagerImpl, User::Panic(KOmxILConfigManagerPanicCategory, 1));
+ return ipConfigManagerImpl->SetParameter(aParamIndex, apComponentParameterStructure, aInitTime);
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILConfigManager::GetConfig(OMX_INDEXTYPE aConfigIndex,
+ TAny* apComponentConfigStructure) const
+ {
+ DEBUG_PRINTF(_L8("COmxILConfigManager::GetConfig"));
+ __ASSERT_ALWAYS(ipConfigManagerImpl, User::Panic(KOmxILConfigManagerPanicCategory, 1));
+ return ipConfigManagerImpl->GetConfig(aConfigIndex, apComponentConfigStructure);
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILConfigManager::SetConfig(OMX_INDEXTYPE aConfigIndex,
+ const TAny* apComponentConfigStructure)
+
+ {
+ DEBUG_PRINTF(_L8("COmxILConfigManager::SetConfig"));
+ __ASSERT_ALWAYS(ipConfigManagerImpl, User::Panic(KOmxILConfigManagerPanicCategory, 1));
+ return ipConfigManagerImpl->SetConfig(aConfigIndex, apComponentConfigStructure);
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILConfigManager::GetExtensionIndex(
+ OMX_STRING /*aParameterName*/,
+ OMX_INDEXTYPE* /*apIndexType*/) const
+ {
+ DEBUG_PRINTF(_L8("COmxILConfigManager::GetExtensionIndex"));
+
+ // No custom index here for now...
+ return OMX_ErrorUnsupportedIndex;
+ }
+
+OMX_ERRORTYPE
+COmxILConfigManager::ComponentRoleEnum(OMX_U8* aRole,
+ OMX_U32 aIndex) const
+ {
+ DEBUG_PRINTF(_L8("COmxILConfigManager::ComponentRoleEnum"));
+ __ASSERT_ALWAYS(ipConfigManagerImpl, User::Panic(KOmxILConfigManagerPanicCategory, 1));
+ return ipConfigManagerImpl->ComponentRoleEnum(aRole, aIndex);
+ }
+
+void COmxILConfigManager::SetPortManager(MOmxILPortManagerIf* aPortManager)
+ {
+ __ASSERT_ALWAYS(ipConfigManagerImpl, User::Panic(KOmxILConfigManagerPanicCategory, 1));
+ return ipConfigManagerImpl->SetPortManager(aPortManager);
+ }
+EXPORT_C
+void COmxILConfigManager::InsertParamIndexL(TUint aParamIndex)
+ {
+ __ASSERT_ALWAYS(ipConfigManagerImpl, User::Panic(KOmxILConfigManagerPanicCategory, 1));
+ return ipConfigManagerImpl->InsertParamIndexL(aParamIndex);
+ }
+EXPORT_C
+TInt COmxILConfigManager::FindParamIndex(TUint aParamIndex) const
+ {
+ __ASSERT_ALWAYS(ipConfigManagerImpl, User::Panic(KOmxILConfigManagerPanicCategory, 1));
+ return ipConfigManagerImpl->FindParamIndex(aParamIndex);
+ }
+EXPORT_C
+void COmxILConfigManager::InsertConfigIndexL(TUint aConfigIndex)
+ {
+ __ASSERT_ALWAYS(ipConfigManagerImpl, User::Panic(KOmxILConfigManagerPanicCategory, 1));
+ return ipConfigManagerImpl->InsertConfigIndexL(aConfigIndex);
+ }
+EXPORT_C
+TInt COmxILConfigManager::FindConfigIndex(TUint aConfigIndex) const
+ {
+ __ASSERT_ALWAYS(ipConfigManagerImpl, User::Panic(KOmxILConfigManagerPanicCategory, 1));
+ return ipConfigManagerImpl->FindConfigIndex(aConfigIndex);
+ }
+
+RArray<TUint>& COmxILConfigManager::ManagedParamIndexes()
+ {
+ __ASSERT_ALWAYS(ipConfigManagerImpl, User::Panic(KOmxILConfigManagerPanicCategory, 1));
+ return ipConfigManagerImpl->ManagedParamIndexes();
+ }
+EXPORT_C
+RArray<TUint>& COmxILConfigManager::ManagedConfigIndexes()
+ {
+ __ASSERT_ALWAYS(ipConfigManagerImpl, User::Panic(KOmxILConfigManagerPanicCategory, 1));
+ return ipConfigManagerImpl->ManagedConfigIndexes();
+ }
+EXPORT_C
+TInt COmxILConfigManager::Extension_(TUint aExtensionId, TAny *&a0, TAny *a1)
+ {
+ return CBase::Extension_(aExtensionId, a0, a1);
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilconfigmanagerimpl.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,539 @@
+// 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 <e32cmn.h>
+#include <openmax/il/khronos/v1_x/OMX_Core.h>
+
+#include "log.h"
+#include <openmax/il/common/omxilconfigmanager.h>
+#include <openmax/il/common/omxilspecversion.h>
+#include <openmax/il/common/omxilutil.h>
+#include "omxilportmanagerif.h"
+#include "omxilconfigmanagerimpl.h"
+
+// NOTE: OMX_UUIDTYPE[128] is defined in OMX_Types.h
+#define KMAX_UUIDTYPE_SIZE 128
+
+COmxILConfigManagerImpl*
+COmxILConfigManagerImpl::NewL(
+ const TDesC8& aComponentName,
+ const OMX_VERSIONTYPE& aComponentVersion,
+ const RPointerArray<TDesC8>& aComponentRoleList)
+ {
+ DEBUG_PRINTF(_L8("COmxILConfigManagerImpl::NewL"));
+ COmxILConfigManagerImpl* self = new (ELeave)COmxILConfigManagerImpl();
+ CleanupStack::PushL(self);
+ self->ConstructL(aComponentName,
+ aComponentVersion,
+ aComponentRoleList);
+ CleanupStack::Pop(self);
+ return self;
+
+ }
+
+void
+COmxILConfigManagerImpl::ConstructL(const TDesC8& aComponentName,
+ const OMX_VERSIONTYPE& aComponentVersion,
+ const RPointerArray<TDesC8>& aComponentRoleList)
+ {
+ DEBUG_PRINTF(_L8("COmxILConfigManagerImpl::ConstructL"));
+
+ iComponentName.CreateL(aComponentName, OMX_MAX_STRINGNAME_SIZE);
+ iComponentName.PtrZ();
+ iComponentVersion.s = aComponentVersion.s;
+
+ // Note that the first role in the list of roles becomes the default role
+ // assumed by the component
+
+ const TUint rolesCount = aComponentRoleList.Count();
+ for (TUint i=0; i<rolesCount; ++i)
+ {
+ iComponentRoleList.AppendL(aComponentRoleList[i]->AllocLC());
+ CleanupStack::Pop();
+ }
+
+
+ InsertParamIndexL(OMX_IndexParamDisableResourceConcealment);
+ InsertParamIndexL(OMX_IndexParamSuspensionPolicy);
+ InsertParamIndexL(OMX_IndexParamStandardComponentRole);
+ InsertParamIndexL(OMX_IndexParamPriorityMgmt);
+ InsertConfigIndexL(OMX_IndexConfigPriorityMgmt);
+
+ }
+
+COmxILConfigManagerImpl::COmxILConfigManagerImpl()
+ :
+ iComponentName(),
+ iComponentRoleList(),
+ iCurrentRoleIndex(0)
+
+ {
+ DEBUG_PRINTF(_L8("COmxILConfigManagerImpl::COmxILConfigManagerImpl"));
+
+ iParamDisableResourceConcealment.nSize = sizeof(OMX_RESOURCECONCEALMENTTYPE);
+ iParamDisableResourceConcealment.nVersion = TOmxILSpecVersion();
+ iParamDisableResourceConcealment.bResourceConcealmentForbidden = OMX_TRUE;
+
+ iParamSuspensionPolicy.nSize = sizeof(OMX_PARAM_SUSPENSIONPOLICYTYPE);
+ iParamSuspensionPolicy.nVersion = TOmxILSpecVersion();
+ iParamSuspensionPolicy.ePolicy = OMX_SuspensionDisabled;
+
+ iConfigPriorityMgmt.nSize = sizeof(OMX_PRIORITYMGMTTYPE);
+ iConfigPriorityMgmt.nVersion = TOmxILSpecVersion();
+ iConfigPriorityMgmt.nGroupPriority = 0;
+ iConfigPriorityMgmt.nGroupID = 0;
+
+ }
+
+COmxILConfigManagerImpl::~COmxILConfigManagerImpl()
+ {
+ DEBUG_PRINTF(_L8("COmxILConfigManagerImpl::~COmxILConfigManagerImpl"));
+
+ iComponentName.Close();
+ iComponentRoleList.ResetAndDestroy();
+ }
+
+OMX_ERRORTYPE
+COmxILConfigManagerImpl::GetComponentVersion(OMX_STRING aComponentName,
+ OMX_VERSIONTYPE* apComponentVersion,
+ OMX_VERSIONTYPE* apSpecVersion,
+ OMX_UUIDTYPE* apComponentUUID) const
+ {
+ DEBUG_PRINTF(_L8("COmxILConfigManagerImpl::GetComponentVersion"));
+
+ TPtr8 name(reinterpret_cast<TUint8*>(aComponentName),
+ OMX_MAX_STRINGNAME_SIZE);
+ name.Copy(iComponentName);
+ name.PtrZ();
+
+ (*apComponentVersion) = iComponentVersion;
+ (*apSpecVersion) = TOmxILSpecVersion();
+
+ // Generate a component uuid
+ TUint32 uid = reinterpret_cast<TUint32>(this);
+ TPtr8 uidPtr(reinterpret_cast<TUint8*>(*apComponentUUID),
+ KMAX_UUIDTYPE_SIZE);
+ uidPtr = TPtr8(reinterpret_cast<TUint8*>(uid), sizeof(uid));
+
+ return OMX_ErrorNone;
+
+ }
+
+OMX_ERRORTYPE
+COmxILConfigManagerImpl::GetParameter(OMX_INDEXTYPE aParamIndex,
+ TAny* apComponentParameterStructure) const
+ {
+ DEBUG_PRINTF(_L8("COmxILConfigManagerImpl::GetParameter"));
+
+ TInt index = FindParamIndex(aParamIndex);
+ if (KErrNotFound == index)
+ {
+ return OMX_ErrorUnsupportedIndex;
+ }
+
+ OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+ switch(aParamIndex)
+ {
+ case OMX_IndexParamStandardComponentRole:
+ {
+ if (OMX_ErrorNone != (omxRetValue =
+ TOmxILUtil::CheckOmxStructSizeAndVersion(
+ apComponentParameterStructure,
+ sizeof(OMX_PARAM_COMPONENTROLETYPE))))
+ {
+ return omxRetValue;
+ }
+
+ OMX_PARAM_COMPONENTROLETYPE* pComponentRole
+ = static_cast<OMX_PARAM_COMPONENTROLETYPE*>(
+ apComponentParameterStructure);
+
+ // Here, the role returned must be the role that this component is
+ // currently assuming
+ TPtr8 role(reinterpret_cast<TUint8*>(pComponentRole->cRole),
+ OMX_MAX_STRINGNAME_SIZE);
+
+ role = *(iComponentRoleList[iCurrentRoleIndex]);
+ role.PtrZ();
+
+ }
+ break;
+
+ case OMX_IndexParamDisableResourceConcealment:
+ {
+ if (OMX_ErrorNone != (omxRetValue =
+ TOmxILUtil::CheckOmxStructSizeAndVersion(
+ apComponentParameterStructure,
+ sizeof(OMX_RESOURCECONCEALMENTTYPE))))
+ {
+ return omxRetValue;
+ }
+
+ OMX_RESOURCECONCEALMENTTYPE* pResConceal
+ = static_cast<OMX_RESOURCECONCEALMENTTYPE*>(
+ apComponentParameterStructure);
+
+ *pResConceal = iParamDisableResourceConcealment;
+
+ }
+ break;
+ case OMX_IndexParamSuspensionPolicy:
+ {
+ if (OMX_ErrorNone != (omxRetValue =
+ TOmxILUtil::CheckOmxStructSizeAndVersion(
+ apComponentParameterStructure,
+ sizeof(OMX_PARAM_SUSPENSIONPOLICYTYPE))))
+ {
+ return omxRetValue;
+ }
+
+ OMX_PARAM_SUSPENSIONPOLICYTYPE* pSuspensionPolicy
+ = static_cast<OMX_PARAM_SUSPENSIONPOLICYTYPE*>(
+ apComponentParameterStructure);
+
+ *pSuspensionPolicy = iParamSuspensionPolicy;
+
+ }
+ break;
+
+ case OMX_IndexParamPriorityMgmt:
+ {
+ if (OMX_ErrorNone != (omxRetValue =
+ TOmxILUtil::CheckOmxStructSizeAndVersion(
+ apComponentParameterStructure,
+ sizeof(OMX_PRIORITYMGMTTYPE))))
+ {
+ return omxRetValue;
+ }
+
+ OMX_PRIORITYMGMTTYPE* pPriorityMgmt
+ = static_cast<OMX_PRIORITYMGMTTYPE*>(
+ apComponentParameterStructure);
+
+ *pPriorityMgmt = iConfigPriorityMgmt;
+
+ }
+ break;
+
+ default:
+ {
+ __ASSERT_ALWAYS(EFalse,
+ User::Panic(KOmxILConfigManagerPanicCategory, 1));
+ }
+ };
+
+ return OMX_ErrorNone;
+
+ }
+
+OMX_ERRORTYPE
+COmxILConfigManagerImpl::SetParameter(OMX_INDEXTYPE aParamIndex,
+ const TAny* apComponentParameterStructure,
+ OMX_BOOL aInitTime /* = OMX_TRUE */)
+ {
+ DEBUG_PRINTF(_L8("COmxILConfigManagerImpl::SetParameter"));
+
+ TInt index = FindParamIndex(aParamIndex);
+ if (KErrNotFound == index)
+ {
+ return OMX_ErrorUnsupportedIndex;
+ }
+
+ OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+ switch(aParamIndex)
+ {
+ case OMX_IndexParamStandardComponentRole:
+ {
+ if (!aInitTime)
+ {
+ return OMX_ErrorIncorrectStateOperation;
+ }
+
+ if (OMX_ErrorNone != (omxRetValue =
+ TOmxILUtil::CheckOmxStructSizeAndVersion(
+ const_cast<OMX_PTR>(apComponentParameterStructure),
+ sizeof(OMX_PARAM_COMPONENTROLETYPE))))
+ {
+ return omxRetValue;
+ }
+
+ const OMX_PARAM_COMPONENTROLETYPE* pComponentRole
+ = static_cast<const OMX_PARAM_COMPONENTROLETYPE*>(
+ apComponentParameterStructure);
+
+ TPtrC8 roleToFindPtr(
+ static_cast<const TUint8*>(pComponentRole->cRole));
+
+ HBufC8* pRoleToFind = HBufC8::New(OMX_MAX_STRINGNAME_SIZE);
+ if (!pRoleToFind)
+ {
+ return OMX_ErrorInsufficientResources;
+ }
+ *pRoleToFind = roleToFindPtr;
+
+ TInt newRoleIndex = 0;
+ if (KErrNotFound ==
+ (newRoleIndex =
+ iComponentRoleList.Find(pRoleToFind,
+ TIdentityRelation<HBufC8>(
+ &COmxILConfigManagerImpl::CompareRoles))))
+ {
+ delete pRoleToFind;
+ return OMX_ErrorBadParameter;
+ }
+
+ if (*pRoleToFind != *(iComponentRoleList[iCurrentRoleIndex]))
+ {
+ // At this point, it is mandated that the component populates all
+ // defaults according to the new role that has just been set by the
+ // IL Client
+ if (OMX_ErrorNone !=
+ (omxRetValue =
+ ipPortManager->ComponentRoleIndication(newRoleIndex)))
+ {
+ delete pRoleToFind;
+ return omxRetValue;
+ }
+
+ iCurrentRoleIndex = newRoleIndex;
+
+ }
+
+ delete pRoleToFind;
+
+ }
+ break;
+
+ case OMX_IndexParamDisableResourceConcealment:
+ {
+ if (!aInitTime)
+ {
+ return OMX_ErrorIncorrectStateOperation;
+ }
+
+ if (OMX_ErrorNone != (omxRetValue =
+ TOmxILUtil::CheckOmxStructSizeAndVersion(
+ const_cast<OMX_PTR>(apComponentParameterStructure),
+ sizeof(OMX_RESOURCECONCEALMENTTYPE))))
+ {
+ return omxRetValue;
+ }
+
+ const OMX_RESOURCECONCEALMENTTYPE* pResConceal
+ = static_cast<const OMX_RESOURCECONCEALMENTTYPE*>(
+ apComponentParameterStructure);
+
+ iParamDisableResourceConcealment = *pResConceal;
+
+ }
+ break;
+
+ case OMX_IndexParamSuspensionPolicy:
+ {
+ if (!aInitTime)
+ {
+ return OMX_ErrorIncorrectStateOperation;
+ }
+
+ if (OMX_ErrorNone != (omxRetValue =
+ TOmxILUtil::CheckOmxStructSizeAndVersion(
+ const_cast<OMX_PTR>(apComponentParameterStructure),
+ sizeof(OMX_PARAM_SUSPENSIONPOLICYTYPE))))
+ {
+ return omxRetValue;
+ }
+
+ const OMX_PARAM_SUSPENSIONPOLICYTYPE* pSuspensionPolicy
+ = static_cast<const OMX_PARAM_SUSPENSIONPOLICYTYPE*>(
+ apComponentParameterStructure);
+
+ // OMX_SuspensionEnabled is the last of the supported values as of
+ // v1.1.1
+ if (pSuspensionPolicy->ePolicy > OMX_SuspensionEnabled)
+ {
+ return OMX_ErrorBadParameter;
+ }
+
+ iParamSuspensionPolicy = *pSuspensionPolicy;
+
+ }
+ break;
+
+ case OMX_IndexParamPriorityMgmt:
+ {
+ if (!aInitTime)
+ {
+ return OMX_ErrorIncorrectStateOperation;
+ }
+
+ if (OMX_ErrorNone != (omxRetValue =
+ TOmxILUtil::CheckOmxStructSizeAndVersion(
+ const_cast<OMX_PTR>(apComponentParameterStructure),
+ sizeof(OMX_PRIORITYMGMTTYPE))))
+ {
+ return omxRetValue;
+ }
+
+
+ const OMX_PRIORITYMGMTTYPE* pPriorityMgmt
+ = static_cast<const OMX_PRIORITYMGMTTYPE*>(
+ apComponentParameterStructure);
+
+ iConfigPriorityMgmt = *pPriorityMgmt;
+
+ }
+ break;
+
+ default:
+ {
+ __ASSERT_ALWAYS(EFalse,
+ User::Panic(KOmxILConfigManagerPanicCategory, 1));
+ }
+ };
+
+ return OMX_ErrorNone;
+
+ }
+
+OMX_ERRORTYPE
+COmxILConfigManagerImpl::GetConfig(OMX_INDEXTYPE aConfigIndex,
+ TAny* apComponentConfigStructure) const
+ {
+ DEBUG_PRINTF(_L8("COmxILConfigManagerImpl::GetConfig"));
+
+ TInt index = FindConfigIndex(aConfigIndex);
+ if (KErrNotFound == index)
+ {
+ return OMX_ErrorUnsupportedIndex;
+ }
+
+ OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+ switch(aConfigIndex)
+ {
+ case OMX_IndexConfigPriorityMgmt:
+ {
+ if (OMX_ErrorNone != (omxRetValue =
+ TOmxILUtil::CheckOmxStructSizeAndVersion(
+ apComponentConfigStructure,
+ sizeof(OMX_PRIORITYMGMTTYPE))))
+ {
+ return omxRetValue;
+ }
+
+ OMX_PRIORITYMGMTTYPE* pPriorityMgmt
+ = static_cast<OMX_PRIORITYMGMTTYPE*>(
+ apComponentConfigStructure);
+
+ *pPriorityMgmt = iConfigPriorityMgmt;
+
+ }
+ break;
+ default:
+ {
+ __ASSERT_ALWAYS(EFalse,
+ User::Panic(KOmxILConfigManagerPanicCategory, 1));
+ }
+ };
+
+ return OMX_ErrorNone;
+
+ }
+
+OMX_ERRORTYPE
+COmxILConfigManagerImpl::SetConfig(OMX_INDEXTYPE aConfigIndex,
+ const TAny* apComponentConfigStructure)
+
+ {
+ DEBUG_PRINTF(_L8("COmxILConfigManagerImpl::SetConfig"));
+
+ TInt index = FindConfigIndex(aConfigIndex);
+ if (KErrNotFound == index)
+ {
+ return OMX_ErrorUnsupportedIndex;
+ }
+
+ OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+ switch(aConfigIndex)
+ {
+ case OMX_IndexConfigPriorityMgmt:
+ {
+ if (OMX_ErrorNone !=
+ (omxRetValue =
+ TOmxILUtil::CheckOmxStructSizeAndVersion(
+ const_cast<OMX_PTR>(apComponentConfigStructure),
+ sizeof(OMX_PRIORITYMGMTTYPE))))
+ {
+ return omxRetValue;
+ }
+
+ const OMX_PRIORITYMGMTTYPE* pPriorityMgmt
+ = static_cast<const OMX_PRIORITYMGMTTYPE*>(
+ apComponentConfigStructure);
+
+ iConfigPriorityMgmt = *pPriorityMgmt;
+
+ }
+ break;
+ default:
+ {
+ __ASSERT_ALWAYS(EFalse,
+ User::Panic(KOmxILConfigManagerPanicCategory, 1));
+ }
+ };
+
+ return OMX_ErrorNone;
+
+ }
+
+OMX_ERRORTYPE
+COmxILConfigManagerImpl::ComponentRoleEnum(OMX_U8* aRole,
+ OMX_U32 aIndex) const
+ {
+ DEBUG_PRINTF(_L8("COmxILConfigManagerImpl::ComponentRoleEnum"));
+
+ // TWC:OpenmaxIL requires error code OMX_ErrorNoMore to be returned when no more roles
+ if (aIndex >= iComponentRoleList.Count())
+ {
+ return OMX_ErrorNoMore;
+ }
+
+ HBufC8* pRole = iComponentRoleList[aIndex];
+
+ TPtr8 role(reinterpret_cast<TUint8*>(aRole),
+ OMX_MAX_STRINGNAME_SIZE);
+ role = *pRole;
+ role.PtrZ();
+
+ return OMX_ErrorNone;
+
+ }
+
+TBool
+COmxILConfigManagerImpl::CompareRoles(
+ const HBufC8& aRole1, const HBufC8& aRole2)
+ {
+ return (aRole1 == aRole2);
+ }
+
+void COmxILConfigManagerImpl::SetPortManager(MOmxILPortManagerIf* aPortManager)
+ {
+ ipPortManager = aPortManager;
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilconfigmanagerimpl.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,118 @@
+// 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 OMXILCONFIGMANAGERIMPL_H
+#define OMXILCONFIGMANAGERIMPL_H
+
+#include <e32base.h>
+#include <openmax/il/khronos/v1_x/OMX_Core.h>
+#include <openmax/il/khronos/v1_x/OMX_Component.h>
+#include <openmax/il/khronos/v1_x/OMX_Types.h>
+
+#include "omxilindexmanager.h"
+
+// Forward declarations
+class MOmxILPortManagerIf;
+
+class COmxILConfigManagerImpl : public COmxILIndexManager
+ {
+
+public:
+
+ static COmxILConfigManagerImpl* NewL(
+ const TDesC8& aComponentName,
+ const OMX_VERSIONTYPE& aComponentVersion,
+ const RPointerArray<TDesC8>& aComponentRoleList);
+
+ ~COmxILConfigManagerImpl();
+
+ virtual OMX_ERRORTYPE GetComponentVersion(
+ OMX_STRING aComponentName,
+ OMX_VERSIONTYPE* apComponentVersion,
+ OMX_VERSIONTYPE* apSpecVersion,
+ OMX_UUIDTYPE* apComponentUUID) const;
+
+ OMX_ERRORTYPE GetParameter(
+ OMX_INDEXTYPE aParamIndex,
+ TAny* apComponentParameterStructure) const;
+
+ OMX_ERRORTYPE SetParameter(
+ OMX_INDEXTYPE aParamIndex,
+ const TAny* apComponentParameterStructure,
+ OMX_BOOL aInitTime = OMX_TRUE);
+
+ OMX_ERRORTYPE GetConfig(
+ OMX_INDEXTYPE aConfigIndex,
+ TAny* apComponentConfigStructure) const;
+
+ OMX_ERRORTYPE SetConfig(
+ OMX_INDEXTYPE aConfigIndex,
+ const TAny* apComponentConfigStructure);
+
+ OMX_ERRORTYPE ComponentRoleEnum(
+ OMX_U8* aRole,
+ OMX_U32 aIndex) const;
+
+ void SetPortManager(MOmxILPortManagerIf* aPortManager);
+
+private:
+
+ COmxILConfigManagerImpl();
+
+ void ConstructL(const TDesC8& aComponentName,
+ const OMX_VERSIONTYPE& aComponentVersion,
+ const RPointerArray<TDesC8>& aComponentRoleList);
+
+ static TBool CompareRoles(const HBufC8& aRole1, const HBufC8& aRole2);
+
+private:
+
+ // Reference to the component's port manager
+ MOmxILPortManagerIf* ipPortManager;
+
+ // Reference to the component's port manager
+ RBuf8 iComponentName;
+
+ // The list of OpenMAX IL roles supported by the component
+ RPointerArray<HBufC8> iComponentRoleList;
+
+ // The current OpenMAX IL role
+ TUint iCurrentRoleIndex;
+
+ // The current version of this component (this is different to the spec
+ // version)
+ OMX_VERSIONTYPE iComponentVersion;
+
+ // OpenMAX IL resource concealment structure (only set/get, resource
+ // concealment logic not implemented)
+ OMX_RESOURCECONCEALMENTTYPE iParamDisableResourceConcealment;
+
+ // OpenMAX IL component suspension policy structure (only set/get,
+ // component suspension logic not implemented)
+ OMX_PARAM_SUSPENSIONPOLICYTYPE iParamSuspensionPolicy;
+
+ // OpenMAX IL component priority structure (only set/get, component
+ // priority logic not implemented)
+ OMX_PRIORITYMGMTTYPE iConfigPriorityMgmt;
+
+ };
+
+#endif // OMXILCONFIGMANAGERIMPL_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilfsm.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,785 @@
+// 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 "omxilfsm.h"
+#include "omxilstate.h"
+#include <openmax/il/common/omxilconfigmanager.h>
+#include "omxilcallbackmanager.h"
+#include <openmax/il/common/omxilprocessingfunction.h>
+#include "omxilportmanagerif.h"
+#include "omxilcommand.h"
+#include <openmax/il/common/omxilstatedefs.h>
+
+#define RETURN_OMX_ERROR_AND_EVENT_IF_NEEDED(_a) \
+ { \
+ const OMX_ERRORTYPE _err = _a; \
+ if (OMX_ErrorNone == _err) return _err; \
+ else return SendOmxErrorEventIfNeeded(_err); \
+ }
+
+
+const TInt COmxILFsm::KMaxMsgQueueEntries;
+
+COmxILFsm*
+COmxILFsm::NewL(COmxILComponent& aComponent,
+ COmxILProcessingFunction& aProcFunction,
+ MOmxILPortManagerIf& aPortManager,
+ COmxILConfigManager& aConfigManager,
+ MOmxILCallbackManagerIf& aCallbacks)
+ {
+ DEBUG_PRINTF(_L8("COmxILFsm::NewLC"));
+
+ COmxILFsm* self = new (ELeave) COmxILFsm(aComponent,
+ aProcFunction,
+ aPortManager,
+ aConfigManager,
+ aCallbacks);
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ CleanupStack::Pop(self);
+ return (self);
+ }
+
+void
+COmxILFsm::ConstructL()
+ {
+ DEBUG_PRINTF(_L8("COmxILFsm::ConstructL"));
+
+ // Create the FSM states
+
+ // Init the array
+ for (TUint i=0; i < EStateMax; ++i)
+ {
+ iStates.AppendL(NULL);
+ }
+
+ // Add the standard states...
+ iStates[EStateInvalid] = new (ELeave)COmxILStateInvalid;
+ iStates[EStateLoaded] = new (ELeave)COmxILStateLoaded;
+ iStates[EStateIdle] = new (ELeave)COmxILStateIdle;
+ iStates[EStateExecuting] = new (ELeave)COmxILStateExecuting;
+ iStates[EStatePause] = new (ELeave)COmxILStatePause;
+ iStates[EStateWaitForResources] = new (ELeave)COmxILStateWaitForResources;
+
+ // Now add the substates
+ iStates[ESubStateLoadedToIdle] = new (ELeave)COmxILStateLoadedToIdle;
+ iStates[ESubStateIdleToLoaded] = new (ELeave)COmxILStateIdleToLoaded;
+ iStates[ESubStateExecutingToIdle] = new (ELeave)COmxILStateExecutingToIdle;
+ iStates[ESubStatePauseToIdle] = new (ELeave)COmxILStatePauseToIdle;
+
+ iCallbacks.SetPortManager(iPortManager);
+ iCallbacks.SetFsm(*this);
+
+ }
+
+COmxILFsm::COmxILFsm(COmxILComponent& aComponent,
+ COmxILProcessingFunction& aProcFunction,
+ MOmxILPortManagerIf& aPortManager,
+ COmxILConfigManager& aConfigManager,
+ MOmxILCallbackManagerIf& aCallbacks)
+ :
+ iComponent(aComponent),
+ iProcFunction(aProcFunction),
+ iPortManager(aPortManager),
+ iConfigManager(aConfigManager),
+ iCallbacks(aCallbacks),
+ iStates(),
+ iCurrentStateIndex(EStateMax),
+ ipCurrentState(0)
+ {
+ DEBUG_PRINTF(_L8("COmxILFsm::COmxILFsm"));
+ }
+
+COmxILFsm::~COmxILFsm()
+ {
+ DEBUG_PRINTF(_L8("COmxILFsm::~COmxILFsm"));
+
+ iCurrentStateIndex = EStateMax;
+ ipCurrentState = 0;
+ iStates.ResetAndDestroy();
+
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::InitFsm()
+ {
+ DEBUG_PRINTF(_L8("COmxILFsm::InitFsm"));
+
+ // Let's get ready to handle API calls...
+ iCurrentStateIndex = EStateLoaded;
+ ipCurrentState = iStates[iCurrentStateIndex];
+ return OMX_ErrorNone;
+
+ }
+
+COmxILComponent*
+COmxILFsm::GetComponent() const
+ {
+ return &iComponent;
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::PopulateBuffer(OMX_BUFFERHEADERTYPE** appBufferHdr,
+ OMX_U32 aPortIndex,
+ OMX_PTR apAppPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer)
+ {
+ DEBUG_PRINTF(_L8("COmxILFsm::PopulateBuffer"));
+
+ TBool portPopulationCompleted = EFalse;
+ OMX_ERRORTYPE omxRetValue =
+ ipCurrentState->PopulateBuffer(*this,
+ appBufferHdr,
+ aPortIndex,
+ apAppPrivate,
+ aSizeBytes,
+ apBuffer,
+ portPopulationCompleted);
+
+ if (OMX_ErrorNone == omxRetValue)
+ {
+ if (portPopulationCompleted &&
+ ESubStateLoadedToIdle == iCurrentStateIndex &&
+ iPortManager.AllPortsPopulated())
+ {
+ // Complete here the transition to OMX_StateIdle
+ omxRetValue = FsmTransition(EStateIdle);
+ if (OMX_ErrorNone == omxRetValue)
+ {
+ // Notify the IL client that port population has
+ // completed sucessfully
+ omxRetValue = iCallbacks.TransitionCompleteNotification(
+ OMX_StateIdle);
+
+ }
+ }
+ }
+
+ if (OMX_ErrorNone == omxRetValue ||
+ OMX_ErrorInsufficientResources == omxRetValue)
+ {
+ // OMX_ErrorInsufficientResources is allowed in OMX_EmptyThisBuffer and
+ // OMX_FillThisBuffer
+ return omxRetValue;
+ }
+ else
+ {
+ return SendOmxErrorEventIfNeeded(omxRetValue);
+ }
+
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::FsmTransition(TStateIndex aNewState)
+ {
+ DEBUG_PRINTF2(_L8("COmxILFsm::FsmTransition : %d"), aNewState);
+
+ __ASSERT_ALWAYS(aNewState < EStateMax,
+ User::Panic(KOmxILFsmPanicCategory, 1));
+
+ if (aNewState != iCurrentStateIndex)
+ {
+ // We notify the processing function of all the state transitions, even
+ // if they are not to a final OpenMAX IL state.
+ OMX_ERRORTYPE omxRetValue;
+ if (OMX_ErrorNone !=
+ (omxRetValue =
+ iProcFunction.StateTransitionIndication(aNewState)))
+ {
+ // No need of propagating further error codes if the component is
+ // transitioning to OMX_StateInvalid or if the PF itself is
+ // invalidating the component...
+ if (EStateInvalid != aNewState &&
+ OMX_ErrorInvalidState != omxRetValue)
+ {
+ return omxRetValue;
+ }
+ }
+
+ iCurrentStateIndex = aNewState;
+ ipCurrentState = iStates[iCurrentStateIndex];
+
+ }
+
+ return OMX_ErrorNone;
+
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::FsmTransition(TUint32 aNewState)
+ {
+
+ return FsmTransition(static_cast<TStateIndex>(aNewState));
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::GetComponentVersion(OMX_STRING aComponentName,
+ OMX_VERSIONTYPE* apComponentVersion,
+ OMX_VERSIONTYPE* apSpecVersion,
+ OMX_UUIDTYPE* apComponentUUID) const
+ {
+ DEBUG_PRINTF(_L8("COmxILFsm::GetComponentVersion"));
+
+ __ASSERT_DEBUG(iCurrentStateIndex != EStateMax,
+ User::Panic(KOmxILFsmPanicCategory, 1));
+
+ // This api should not be allowed in OMX_StateInvalid
+ if (EStateInvalid == iCurrentStateIndex)
+ {
+ return SendOmxErrorEventIfNeeded(OMX_ErrorInvalidState);
+ }
+
+ if (!aComponentName ||
+ !apComponentVersion ||
+ !apSpecVersion ||
+ !apComponentUUID)
+ {
+ return OMX_ErrorBadParameter;
+ }
+
+ // This API call is independent of the current state. Its handled by the
+ // the config manager
+
+ RETURN_OMX_ERROR_AND_EVENT_IF_NEEDED(
+ iConfigManager.GetComponentVersion(
+ aComponentName,
+ apComponentVersion,
+ apSpecVersion,
+ apComponentUUID));
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::SendCommand(OMX_COMMANDTYPE aCommand,
+ TUint32 anParam1,
+ TAny* apCmdData)
+ {
+ DEBUG_PRINTF3(_L8("COmxILFsm::SendCommand : command [%d] Param1 [%d]"), aCommand, anParam1);
+
+ __ASSERT_DEBUG(iCurrentStateIndex != EStateMax,
+ User::Panic(KOmxILFsmPanicCategory, 1));
+
+ // Do some very minor error checking here to try to save some time...
+ if (OMX_CommandStateSet == aCommand &&
+ anParam1 > OMX_StateWaitForResources)
+ {
+ return OMX_ErrorBadParameter;
+ }
+
+ TOmxILCommand command(aCommand, anParam1, apCmdData);
+ OMX_ERRORTYPE sendCommandError;
+ switch (aCommand)
+ {
+ case OMX_CommandStateSet:
+ {
+ sendCommandError = ipCurrentState->CommandStateSet(*this, command);
+ }
+ break;
+ case OMX_CommandFlush:
+ {
+ sendCommandError = ipCurrentState->CommandFlush(*this, command);
+ }
+ break;
+ case OMX_CommandPortDisable:
+ {
+ sendCommandError = ipCurrentState->CommandPortDisable(*this, command);
+ }
+ break;
+ case OMX_CommandPortEnable:
+ {
+ sendCommandError = ipCurrentState->CommandPortEnable(*this, command);
+ }
+ break;
+ case OMX_CommandMarkBuffer:
+ {
+ sendCommandError = ipCurrentState->CommandMarkBuffer(*this, command);
+ }
+ break;
+ default:
+ {
+ // This is an invalid command type
+ return OMX_ErrorBadParameter;
+ }
+ };
+
+ if (OMX_ErrorNone == sendCommandError ||
+ OMX_ErrorInsufficientResources == sendCommandError)
+ {
+ // OMX_ErrorInsufficientResources is allowed in OMX_SendCommand
+ return sendCommandError;
+ }
+ else
+ {
+ return SendOmxErrorEventIfNeeded(sendCommandError);
+ }
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::GetParameter(OMX_INDEXTYPE aParamIndex,
+ TAny* apComponentParameterStructure) const
+ {
+ DEBUG_PRINTF(_L8("COmxILFsm::GetParameter"));
+
+ __ASSERT_DEBUG(iCurrentStateIndex != EStateMax,
+ User::Panic(KOmxILFsmPanicCategory, 1));
+
+ if (!apComponentParameterStructure)
+ {
+ return OMX_ErrorBadParameter;
+ }
+
+ RETURN_OMX_ERROR_AND_EVENT_IF_NEEDED(
+ ipCurrentState->GetParameter(*this, aParamIndex,
+ apComponentParameterStructure));
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::SetParameter(OMX_INDEXTYPE aParamIndex,
+ const TAny* apComponentParameterStructure)
+ {
+ DEBUG_PRINTF(_L8("COmxILFsm::SetParameter"));
+
+ __ASSERT_DEBUG(iCurrentStateIndex != EStateMax,
+ User::Panic(KOmxILFsmPanicCategory, 1));
+
+ if (!apComponentParameterStructure)
+ {
+ return OMX_ErrorBadParameter;
+ }
+
+ RETURN_OMX_ERROR_AND_EVENT_IF_NEEDED(
+ ipCurrentState->SetParameter(*this, aParamIndex,
+ apComponentParameterStructure));
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::GetConfig(OMX_INDEXTYPE aConfigIndex,
+ TAny* apComponentConfigStructure) const
+ {
+ DEBUG_PRINTF(_L8("COmxILFsm::GetConfig"));
+
+ __ASSERT_DEBUG(iCurrentStateIndex != EStateMax,
+ User::Panic(KOmxILFsmPanicCategory, 1));
+
+ if (!apComponentConfigStructure)
+ {
+ return OMX_ErrorBadParameter;
+ }
+
+ RETURN_OMX_ERROR_AND_EVENT_IF_NEEDED(
+ ipCurrentState->GetConfig(*this,
+ aConfigIndex,
+ apComponentConfigStructure));
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::SetConfig(OMX_INDEXTYPE aIndex,
+ const TAny* apComponentConfigStructure)
+ {
+ DEBUG_PRINTF(_L8("COmxILFsm::SetConfig"));
+
+ __ASSERT_DEBUG(iCurrentStateIndex != EStateMax,
+ User::Panic(KOmxILFsmPanicCategory, 1));
+
+ if (!apComponentConfigStructure)
+ {
+ return OMX_ErrorBadParameter;
+ }
+
+ RETURN_OMX_ERROR_AND_EVENT_IF_NEEDED(
+ ipCurrentState->SetConfig(*this, aIndex, apComponentConfigStructure));
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::GetExtensionIndex(
+ OMX_STRING aParameterName,
+ OMX_INDEXTYPE* apIndexType) const
+ {
+ DEBUG_PRINTF(_L8("COmxILFsm::GetExtensionIndex"));
+
+ __ASSERT_DEBUG(iCurrentStateIndex != EStateMax,
+ User::Panic(KOmxILFsmPanicCategory, 1));
+
+ if (!apIndexType || !aParameterName)
+ {
+ return OMX_ErrorBadParameter;
+ }
+
+ RETURN_OMX_ERROR_AND_EVENT_IF_NEEDED(
+ ipCurrentState->GetExtensionIndex(*this,
+ aParameterName,
+ apIndexType));
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::GetState(OMX_STATETYPE* apState) const
+ {
+ DEBUG_PRINTF(_L8("COmxILFsm::GetState"));
+
+ __ASSERT_DEBUG(iCurrentStateIndex != EStateMax,
+ User::Panic(KOmxILFsmPanicCategory, 1));
+
+ if (!apState)
+ {
+ return OMX_ErrorBadParameter;
+ }
+
+ *apState = ipCurrentState->GetState();
+
+ return OMX_ErrorNone;
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::ComponentTunnelRequest(OMX_U32 aPort,
+ OMX_HANDLETYPE aTunneledComp,
+ OMX_U32 aTunneledPort,
+ OMX_TUNNELSETUPTYPE* apTunnelSetup)
+ {
+ DEBUG_PRINTF(_L8("COmxILFsm::ComponentTunnelRequest"));
+
+ __ASSERT_DEBUG(iCurrentStateIndex != EStateMax,
+ User::Panic(KOmxILFsmPanicCategory, 1));
+
+ // Here, since NULL is a valid parameter for aTunneledComp, checking of
+ // input parameters is completely done by the ports.
+ RETURN_OMX_ERROR_AND_EVENT_IF_NEEDED(
+ ipCurrentState->ComponentTunnelRequest(*this,
+ aPort,
+ aTunneledComp,
+ aTunneledPort,
+ apTunnelSetup));
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::UseBuffer(OMX_BUFFERHEADERTYPE** appBufferHdr,
+ OMX_U32 aPortIndex,
+ OMX_PTR apAppPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer)
+ {
+ DEBUG_PRINTF(_L8("COmxILFsm::UseBuffer"));
+
+ __ASSERT_DEBUG(iCurrentStateIndex != EStateMax,
+ User::Panic(KOmxILFsmPanicCategory, 1));
+
+ if (!appBufferHdr || !aSizeBytes || !apBuffer)
+ {
+ return OMX_ErrorBadParameter;
+ }
+
+ return PopulateBuffer(appBufferHdr,
+ aPortIndex,
+ apAppPrivate,
+ aSizeBytes,
+ apBuffer);
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::AllocateBuffer(OMX_BUFFERHEADERTYPE** appBufferHdr,
+ OMX_U32 aPortIndex,
+ OMX_PTR apAppPrivate,
+ OMX_U32 aSizeBytes)
+ {
+ DEBUG_PRINTF(_L8("COmxILFsm::AllocateBuffer"));
+
+ __ASSERT_DEBUG(iCurrentStateIndex != EStateMax,
+ User::Panic(KOmxILFsmPanicCategory, 1));
+
+ if (!appBufferHdr || !aSizeBytes)
+ {
+ return OMX_ErrorBadParameter;
+ }
+
+
+ return PopulateBuffer(appBufferHdr,
+ aPortIndex,
+ apAppPrivate,
+ aSizeBytes,
+ 0);
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::FreeBuffer(OMX_U32 aPortIndex,
+ OMX_BUFFERHEADERTYPE* apBuffer)
+ {
+ DEBUG_PRINTF(_L8("COmxILFsm::FreeBuffer"));
+
+ __ASSERT_DEBUG(iCurrentStateIndex != EStateMax,
+ User::Panic(KOmxILFsmPanicCategory, 1));
+
+ if (!apBuffer)
+ {
+ return OMX_ErrorBadParameter;
+ }
+
+ TBool portDepopulationCompleted = EFalse;
+ OMX_ERRORTYPE omxRetValue =
+ ipCurrentState->FreeBuffer(*this,
+ aPortIndex,
+ apBuffer,
+ portDepopulationCompleted);
+
+ if (OMX_ErrorNone == omxRetValue)
+ {
+ if (portDepopulationCompleted)
+ {
+ if (ESubStateIdleToLoaded == iCurrentStateIndex)
+ {
+ if (iPortManager.AllPortsDePopulated())
+ {
+ // Complete here the transition to OMX_StateLoaded
+ omxRetValue = FsmTransition(EStateLoaded);
+ if (OMX_ErrorNone == omxRetValue)
+ {
+ // Notify the IL client that port depopulation has
+ // completed sucessfully
+ omxRetValue =
+ iCallbacks.TransitionCompleteNotification(
+ OMX_StateLoaded);
+ }
+ }
+ }
+ }
+ }
+
+ if (OMX_ErrorNone == omxRetValue)
+ {
+ return OMX_ErrorNone;
+ }
+ else
+ {
+ return SendOmxErrorEventIfNeeded(omxRetValue);
+ }
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::EmptyThisBuffer(OMX_BUFFERHEADERTYPE* apBuffer)
+ {
+ DEBUG_PRINTF2(_L8("COmxILFsm::EmptyThisBuffer : BUFFER [%X]"), apBuffer);
+
+ __ASSERT_DEBUG(iCurrentStateIndex != EStateMax,
+ User::Panic(KOmxILFsmPanicCategory, 1));
+
+ if (!apBuffer)
+ {
+ return OMX_ErrorBadParameter;
+ }
+
+ RETURN_OMX_ERROR_AND_EVENT_IF_NEEDED(
+ ipCurrentState->EmptyThisBuffer(*this, apBuffer));
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::FillThisBuffer(OMX_BUFFERHEADERTYPE* apBuffer)
+ {
+ DEBUG_PRINTF2(_L8("COmxILFsm::FillThisBuffer : BUFFER [%X]"), apBuffer);
+
+ __ASSERT_DEBUG(iCurrentStateIndex != EStateMax,
+ User::Panic(KOmxILFsmPanicCategory, 1));
+
+ if (!apBuffer)
+ {
+ return OMX_ErrorBadParameter;
+ }
+
+ RETURN_OMX_ERROR_AND_EVENT_IF_NEEDED(
+ ipCurrentState->FillThisBuffer(*this, apBuffer));
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::SetCallbacks(const OMX_CALLBACKTYPE* apCallbacks,
+ const OMX_PTR apAppData)
+ {
+ DEBUG_PRINTF(_L8("COmxILFsm::SetCallbacks"));
+
+ __ASSERT_DEBUG(iCurrentStateIndex != EStateMax,
+ User::Panic(KOmxILFsmPanicCategory, 1));
+
+ if (!apCallbacks)
+ {
+ return OMX_ErrorBadParameter;
+ }
+
+ // This api should only be allowed in OMX_StateLoaded
+ if (EStateLoaded != iCurrentStateIndex)
+ {
+ return OMX_ErrorIncorrectStateOperation;
+ }
+
+ RETURN_OMX_ERROR_AND_EVENT_IF_NEEDED(
+ iCallbacks.RegisterILClientCallbacks(apCallbacks, apAppData));
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::UseEGLImage(OMX_BUFFERHEADERTYPE** /*appBufferHdr*/,
+ OMX_U32 /*aPortIndex*/,
+ OMX_PTR /*aAppPrivate*/,
+ void* /*eglImage*/)
+ {
+ DEBUG_PRINTF(_L8("COmxILFsm::UseEGLImage"));
+
+ __ASSERT_DEBUG(iCurrentStateIndex != EStateMax,
+ User::Panic(KOmxILFsmPanicCategory, 1));
+
+ return OMX_ErrorNotImplemented;
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::ComponentRoleEnum(OMX_U8* aRole,
+ OMX_U32 aIndex) const
+ {
+ DEBUG_PRINTF(_L8("COmxILFsm::ComponentRoleEnum"));
+
+ __ASSERT_DEBUG(iCurrentStateIndex != EStateMax,
+ User::Panic(KOmxILFsmPanicCategory, 1));
+
+ // This api should not be allowed in OMX_StateInvalid
+ if (EStateInvalid == iCurrentStateIndex)
+ {
+ return SendOmxErrorEventIfNeeded(OMX_ErrorInvalidState);
+ }
+
+ if (!aRole)
+ {
+ return OMX_ErrorBadParameter;
+ }
+
+ RETURN_OMX_ERROR_AND_EVENT_IF_NEEDED(
+ iConfigManager.ComponentRoleEnum(aRole,
+ aIndex));
+
+ }
+
+/**
+ This method is here to fullfill the following functionalities:
+
+ -# It is used to make sure that the component error codes are returned to
+ the IL Client in a way that conforms with Table 3-9 of the OpenMAX IL
+ 1.1.1 spec. This table specifies which error codes must be sent with
+ EventHandler. If an error code is to be sent via EventHandler, the API
+ return code must be OMX_ErrorNone.
+
+ -# This method is also used to invalidate the component whenever an internal
+ component action returns OMX_ErrorInvalidState. For example, this is
+ useful when code executed by a port or by the processing function cannot
+ recover from an internal error. Returning OMX_ErrorInvalidState in that
+ kind of situation will invalidate the component in
+ SendOmxErrorEventIfNeeded and the event will be conveyed to the IL Client
+ as mandated by the spec.
+
+ @param aError An OpenMAX IL error code.
+ */
+OMX_ERRORTYPE
+COmxILFsm::SendOmxErrorEventIfNeeded(OMX_ERRORTYPE aError)
+ {
+ DEBUG_PRINTF2(_L8("COmxILFsm::SendOmxErrorEventIfNeeded - aError = 0x%X"), aError);
+
+ OMX_ERRORTYPE returnError = aError;
+ switch(aError)
+ {
+ case OMX_ErrorInsufficientResources:
+ {
+ DEBUG_PRINTF(_L8("COmxILFsm::SendOmxErrorEventIfNeeded aError[OMX_ErrorInsufficientResources]"));
+ iCallbacks.ErrorEventNotification(aError);
+ }
+ break;
+ case OMX_ErrorInvalidState:
+ {
+ DEBUG_PRINTF(_L8("COmxILFsm::SendOmxErrorEventIfNeeded aError[OMX_ErrorInvalidState]"));
+ iCallbacks.ErrorEventNotification(aError);
+ if (EStateInvalid != iCurrentStateIndex)
+ {
+ returnError = OMX_ErrorNone;
+ }
+ }
+ break;
+ case OMX_ErrorUnderflow:
+ case OMX_ErrorOverflow:
+ case OMX_ErrorHardware:
+ case OMX_ErrorStreamCorrupt:
+ case OMX_ErrorResourcesLost:
+ case OMX_ErrorSameState:
+ case OMX_ErrorResourcesPreempted:
+ case OMX_ErrorPortUnresponsiveDuringAllocation:
+ case OMX_ErrorPortUnresponsiveDuringDeallocation:
+ case OMX_ErrorPortUnresponsiveDuringStop:
+ case OMX_ErrorIncorrectStateTransition:
+ case OMX_ErrorPortUnpopulated:
+ case OMX_ErrorDynamicResourcesUnavailable:
+ case OMX_ErrorMbErrorsInFrame:
+ case OMX_ErrorFormatNotDetected:
+ {
+ DEBUG_PRINTF2(_L8("COmxILFsm::SendOmxErrorEventIfNeeded aError[%X]"), aError);
+ iCallbacks.ErrorEventNotification(aError);
+ returnError = OMX_ErrorNone;
+ }
+ break;
+ };
+
+ if(OMX_ErrorInvalidState == aError &&
+ EStateInvalid != iCurrentStateIndex)
+ {
+ // Invalidate this component. This instance of the component should be
+ // destroyed by the IL Client after this. No need to check error code.
+ FsmTransition(EStateInvalid);
+ }
+
+ return returnError;
+
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::SendOmxErrorEventIfNeeded(OMX_ERRORTYPE aError) const
+ {
+ DEBUG_PRINTF(_L8("COmxILFsm::SendOmxErrorEventIfNeeded"));
+
+ return const_cast<COmxILFsm*>(this)->SendOmxErrorEventIfNeeded(aError);
+
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilfsm.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,204 @@
+// 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 OMXILFSM_H
+#define OMXILFSM_H
+
+
+#include <e32base.h>
+#include <openmax/il/khronos/v1_x/OMX_Core.h>
+#include <e32msgqueue.h>
+#include <openmax/il/common/omxilstatedefs.h>
+
+// forward declarations
+class MOmxILPortManagerIf;
+class COmxILConfigManager;
+class MOmxILCallbackManagerIf;
+class COmxILComponent;
+class COmxILProcessingFunction;
+
+/**
+ FSM Panic category
+*/
+_LIT(KOmxILFsmPanicCategory, "OmxILFsm");
+
+
+/**
+ FSM class that represents the main FSM context object of the State
+ pattern. It delegates most events for processing to the current state
+ object.
+ */
+NONSHARABLE_CLASS(COmxILFsm) : public CBase
+ {
+
+public:
+
+ static const TInt KMaxMsgQueueEntries = 10;
+public:
+
+ static COmxILFsm* NewL(COmxILComponent& aComponent,
+ COmxILProcessingFunction& aProcFunction,
+ MOmxILPortManagerIf& aPortManager,
+ COmxILConfigManager& aConfigManager,
+ MOmxILCallbackManagerIf& aCallbacks);
+
+ ~COmxILFsm();
+
+ OMX_ERRORTYPE InitFsm();
+
+ COmxILComponent* GetComponent() const;
+
+ //
+ // OpenMAX IL API calls
+ //
+
+ OMX_ERRORTYPE GetComponentVersion(OMX_STRING aComponentName,
+ OMX_VERSIONTYPE* pComponentVersion,
+ OMX_VERSIONTYPE* pSpecVersion,
+ OMX_UUIDTYPE* pComponentUUID) const;
+
+ OMX_ERRORTYPE SendCommand(OMX_COMMANDTYPE Cmd,
+ TUint32 nParam1,
+ TAny* apCmdData);
+
+ OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex,
+ TAny* apComponentParameterStructure) const;
+
+ OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex,
+ const TAny* apComponentParameterStructure);
+
+ 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;
+
+ OMX_ERRORTYPE GetState(OMX_STATETYPE* apState) const;
+
+ OMX_ERRORTYPE ComponentTunnelRequest(OMX_U32 aPort,
+ OMX_HANDLETYPE aTunneledComp,
+ OMX_U32 aTunneledPort,
+ OMX_TUNNELSETUPTYPE* apTunnelSetup);
+
+ OMX_ERRORTYPE UseBuffer(OMX_BUFFERHEADERTYPE** appBufferHdr,
+ OMX_U32 aPortIndex,
+ OMX_PTR apAppPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer);
+
+ OMX_ERRORTYPE AllocateBuffer(OMX_BUFFERHEADERTYPE** appBufferHdr,
+ OMX_U32 aPortIndex,
+ OMX_PTR apAppPrivate,
+ OMX_U32 aSizeBytes);
+
+ OMX_ERRORTYPE FreeBuffer(OMX_U32 aPortIndex,
+ OMX_BUFFERHEADERTYPE* apBuffer);
+
+ OMX_ERRORTYPE EmptyThisBuffer(OMX_BUFFERHEADERTYPE* apBuffer);
+
+ OMX_ERRORTYPE FillThisBuffer(OMX_BUFFERHEADERTYPE* apBuffer);
+
+ OMX_ERRORTYPE SetCallbacks(const OMX_CALLBACKTYPE* apCallbacks,
+ const OMX_PTR apAppData);
+
+ OMX_ERRORTYPE UseEGLImage(OMX_BUFFERHEADERTYPE** appBufferHdr,
+ OMX_U32 aPortIndex,
+ OMX_PTR aAppPrivate,
+ void* eglImage);
+
+ OMX_ERRORTYPE ComponentRoleEnum(OMX_U8* aRole,
+ OMX_U32 aIndex) const;
+
+private:
+
+ // Declaration of nested private state classes
+ class COmxILState;
+ class COmxILStateInvalid;
+ class COmxILStateLoaded;
+ class COmxILStateLoadedToIdle;
+ class COmxILStateWaitForResources;
+ class COmxILStateIdle;
+ class COmxILStateIdleToLoaded;
+ class COmxILStateExecuting;
+ class COmxILStateExecutingToIdle;
+ class COmxILStatePause;
+ class COmxILStatePauseToIdle;
+ class MOmxILPauseOrExecutingToIdle;
+
+ // Note that the following friends don't break COmxILFsm's interface as all
+ // friends below are COmxILFsm's private nested classes and therefore they
+ // are logically part of COmxILFsm implementation
+ friend class COmxILState;
+ friend class COmxILStateInvalid;
+ friend class COmxILStateLoaded;
+ friend class COmxILStateLoadedToIdle;
+ friend class COmxILStateWaitForResources;
+ friend class COmxILStateIdle;
+ friend class COmxILStateIdleToLoaded;
+ friend class COmxILStateExecuting;
+ friend class COmxILStateExecutingToIdle;
+ friend class COmxILStatePause;
+ friend class COmxILStatePauseToIdle;
+ friend class MOmxILPauseOrExecutingToIdle;
+
+private:
+
+ COmxILFsm(COmxILComponent& aComponent,
+ COmxILProcessingFunction& aProcFunction,
+ MOmxILPortManagerIf& aPortManager,
+ COmxILConfigManager& aConfigManager,
+ MOmxILCallbackManagerIf& aCallbacks);
+
+ void ConstructL();
+
+ OMX_ERRORTYPE PopulateBuffer(OMX_BUFFERHEADERTYPE** appBufferHdr,
+ OMX_U32 aPortIndex,
+ OMX_PTR apAppPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer);
+
+ OMX_ERRORTYPE FsmTransition(TStateIndex aNewState);
+
+ OMX_ERRORTYPE FsmTransition(TUint32 aNewState);
+
+ OMX_ERRORTYPE SendOmxErrorEventIfNeeded(OMX_ERRORTYPE aError) const;
+
+ OMX_ERRORTYPE SendOmxErrorEventIfNeeded(OMX_ERRORTYPE aError);
+
+private:
+
+ COmxILComponent& iComponent;
+ COmxILProcessingFunction& iProcFunction;
+ MOmxILPortManagerIf& iPortManager;
+ COmxILConfigManager& iConfigManager;
+ MOmxILCallbackManagerIf& iCallbacks;
+
+ RPointerArray<COmxILState> iStates;
+ TStateIndex iCurrentStateIndex;
+ COmxILState* ipCurrentState;
+
+ };
+
+
+#endif // OMXILFSM_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilimageport.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,418 @@
+// 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/omxilimageport.h>
+#include <openmax/il/common/omxilutil.h>
+#include "log.h"
+#include "omxilimageportimpl.h"
+
+EXPORT_C
+COmxILImagePort::COmxILImagePort()
+ {
+ DEBUG_PRINTF(_L8("COmxILImagePort::COmxILImagePort"));
+ }
+
+EXPORT_C
+COmxILImagePort::~COmxILImagePort()
+ {
+ DEBUG_PRINTF(_L8("COmxILImagePort::~COmxILImagePort"))
+ delete ipImagePortImpl;
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILImagePort::GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const
+ {
+ DEBUG_PRINTF(_L8("COmxILImagePort::GetLocalOmxParamIndexes"));
+
+ // Always collect local indexes from parent
+ OMX_ERRORTYPE omxRetValue = COmxILPort::GetLocalOmxParamIndexes(aIndexArray);
+
+ if (OMX_ErrorNone != omxRetValue)
+ {
+ return omxRetValue;
+ }
+
+ TInt err = aIndexArray.InsertInOrder(OMX_IndexParamImagePortFormat);
+
+ // Note that index duplication is OK.
+ if (KErrNone != err && KErrAlreadyExists != err)
+ {
+ return OMX_ErrorInsufficientResources;
+ }
+
+ return OMX_ErrorNone;
+
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILImagePort::GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const
+ {
+ DEBUG_PRINTF(_L8("COmxILImagePort::GetLocalOmxConfigIndexes"));
+
+ // Always collect local indexes from parent
+ return COmxILPort::GetLocalOmxConfigIndexes(aIndexArray);
+
+ }
+
+EXPORT_C OMX_ERRORTYPE COmxILImagePort::GetParameter(OMX_INDEXTYPE aParamIndex, TAny* apComponentParameterStructure) const
+ {
+ DEBUG_PRINTF(_L8("COmxILImagePort::GetParameter"));
+ OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+ switch(aParamIndex)
+ {
+ case OMX_IndexParamImagePortFormat:
+ {
+ __ASSERT_ALWAYS(ipImagePortImpl, User::Panic(KOmxILImagePortPanicCategory, 1));
+ omxRetValue = ipImagePortImpl->GetParameter(aParamIndex, apComponentParameterStructure);
+ }
+ break;
+ default:
+ {
+ // Try the parent's indexes
+ omxRetValue = COmxILPort::GetParameter(aParamIndex, apComponentParameterStructure);
+ }
+ };
+
+ return omxRetValue;
+ }
+
+EXPORT_C OMX_ERRORTYPE COmxILImagePort::SetParameter(OMX_INDEXTYPE aParamIndex, const TAny* apComponentParameterStructure, TBool& aUpdateProcessingFunction)
+ {
+ DEBUG_PRINTF(_L8("COmxILImagePort::SetParameter"));
+ OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+
+ switch(aParamIndex)
+ {
+ case OMX_IndexParamImagePortFormat:
+ {
+ __ASSERT_ALWAYS(ipImagePortImpl, User::Panic(KOmxILImagePortPanicCategory, 1));
+ omxRetValue = ipImagePortImpl->SetParameter(aParamIndex, apComponentParameterStructure, aUpdateProcessingFunction);
+ }
+ break;
+ default:
+ {
+ // Try the parent's indexes
+ omxRetValue = COmxILPort::SetParameter(aParamIndex, apComponentParameterStructure, aUpdateProcessingFunction);
+ }
+ };
+ return omxRetValue;
+ }
+
+EXPORT_C
+void COmxILImagePort::ConstructL(const TOmxILCommonPortData& aCommonPortData,
+ const RArray<OMX_IMAGE_CODINGTYPE>& aSupportedImageFormats,
+ const RArray<OMX_COLOR_FORMATTYPE>& aSupportedColorFormats)
+ {
+ COmxILPort::ConstructL(aCommonPortData); //create COmxILPortImpl
+ ipImagePortImpl=COmxILImagePortImpl::NewL(aCommonPortData, aSupportedImageFormats, aSupportedColorFormats); //create COmxILImagePortImpl
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILImagePort::GetConfig(OMX_INDEXTYPE aConfigIndex,
+ TAny* apComponentConfigStructure) const
+ {
+ DEBUG_PRINTF(_L8("COmxILPort::GetConfig"));
+ return COmxILPort::GetConfig(aConfigIndex,
+ apComponentConfigStructure);
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILImagePort::SetConfig(OMX_INDEXTYPE aConfigIndex,
+ const TAny* apComponentConfigStructure,
+ TBool& aUpdateProcessingFunction)
+ {
+ DEBUG_PRINTF(_L8("COmxILPort::SetConfig"));
+ return COmxILPort::SetConfig(aConfigIndex,
+ apComponentConfigStructure,
+ aUpdateProcessingFunction);
+
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILImagePort::GetExtensionIndex(OMX_STRING aParameterName,
+ OMX_INDEXTYPE* apIndexType) const
+ {
+ return COmxILPort::GetExtensionIndex(aParameterName,
+ apIndexType);
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILImagePort::PopulateBuffer(OMX_BUFFERHEADERTYPE** appBufferHdr,
+ const OMX_PTR apAppPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer,
+ TBool& aPortPopulationCompleted)
+ {
+ DEBUG_PRINTF2(_L8("COmxILImagePort::PopulateBuffer : pBuffer [%X]"), apBuffer);
+ return COmxILPort::PopulateBuffer(appBufferHdr,
+ apAppPrivate,
+ aSizeBytes,
+ apBuffer,
+ aPortPopulationCompleted);
+ }
+
+
+EXPORT_C OMX_ERRORTYPE
+COmxILImagePort::FreeBuffer(OMX_BUFFERHEADERTYPE* apBufferHeader,
+ TBool& aPortDepopulationCompleted)
+ {
+ DEBUG_PRINTF2(_L8("COmxILImagePort::FreeBuffer : BUFFER [%X]"), apBufferHeader);
+ return COmxILPort::FreeBuffer(apBufferHeader, aPortDepopulationCompleted);
+ }
+
+
+EXPORT_C OMX_ERRORTYPE
+COmxILImagePort::TunnelRequest(OMX_HANDLETYPE aTunneledComp,
+ OMX_U32 aTunneledPort,
+ OMX_TUNNELSETUPTYPE* apTunnelSetup)
+ {
+ DEBUG_PRINTF(_L8("COmxILImagePort::TunnelRequest"));
+ return COmxILPort::TunnelRequest(aTunneledComp,
+ aTunneledPort,
+ apTunnelSetup);
+ }
+
+
+EXPORT_C OMX_ERRORTYPE
+COmxILImagePort::PopulateTunnel(TBool& portPopulationCompleted)
+ {
+ DEBUG_PRINTF(_L8("COmxILImagePort::PopulateTunnel"));
+ return COmxILPort::PopulateTunnel(portPopulationCompleted);
+ }
+
+
+EXPORT_C OMX_ERRORTYPE
+COmxILImagePort::FreeTunnel(TBool& portDepopulationCompleted)
+ {
+ DEBUG_PRINTF(_L8("COmxILImagePort::FreeTunnel"));
+ return COmxILPort::FreeTunnel(portDepopulationCompleted);
+ }
+
+EXPORT_C TBool
+COmxILImagePort::SetBufferSent(OMX_BUFFERHEADERTYPE* apBufferHeader,
+ TBool& aBufferMarkedWithOwnMark)
+ {
+ DEBUG_PRINTF(_L8("COmxILImagePort::SetBufferSent"));
+ return COmxILPort::SetBufferSent(apBufferHeader,
+ aBufferMarkedWithOwnMark);
+ }
+
+EXPORT_C TBool
+COmxILImagePort::SetBufferReturned(OMX_BUFFERHEADERTYPE* apBufferHeader)
+ {
+ DEBUG_PRINTF(_L8("COmxILImagePort::SetBufferReturned"));
+ return COmxILPort::SetBufferReturned(apBufferHeader);
+ }
+
+EXPORT_C void
+COmxILImagePort::SetTransitionToEnabled()
+ {
+ DEBUG_PRINTF(_L8("COmxILImagePort::SetTransitionToEnabled"));
+ return COmxILPort::SetTransitionToEnabled();
+ }
+
+EXPORT_C void
+COmxILImagePort::SetTransitionToDisabled()
+ {
+ DEBUG_PRINTF(_L8("COmxILImagePort::SetTransitionToDisabled"));
+ return COmxILPort::SetTransitionToDisabled();
+ }
+
+EXPORT_C void
+COmxILImagePort::SetTransitionToDisabledCompleted()
+ {
+ DEBUG_PRINTF(_L8("COmxILImagePort::SetTransitionToDisabledCompleted"));
+ return COmxILPort::SetTransitionToDisabledCompleted();
+ }
+
+EXPORT_C void
+COmxILImagePort::SetTransitionToEnabledCompleted()
+ {
+ DEBUG_PRINTF(_L8("COmxILImagePort::SetTransitionToEnabledCompleted"));
+ return COmxILPort::SetTransitionToEnabledCompleted();
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILImagePort::StoreBufferMark(const OMX_MARKTYPE* apMark)
+ {
+ DEBUG_PRINTF(_L8("COmxILImagePort::StoreBufferMark"));
+ return COmxILPort::StoreBufferMark(apMark);
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILImagePort::SetComponentRoleDefaults(TUint aComponentRoleIndex)
+ {
+ DEBUG_PRINTF(_L8("COmxILImagePort::SetComponentRoleDefaults"));
+
+ return COmxILPort::SetComponentRoleDefaults(aComponentRoleIndex);
+ }
+
+EXPORT_C TBool
+COmxILImagePort::HasAllBuffersAtHome() const
+ {
+ return COmxILPort::HasAllBuffersAtHome();
+ }
+
+EXPORT_C TBool
+COmxILImagePort::IsBufferAtHome(OMX_BUFFERHEADERTYPE* apBufferHeader) const
+ {
+ DEBUG_PRINTF2(_L8("COmxILImagePort::IsBufferAtHome : [%X]"), apBufferHeader);
+ return COmxILPort::IsBufferAtHome(apBufferHeader);
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILImagePort::DoPortReconfiguration(TUint aPortSettingsIndex,
+ const TDesC8& aPortSettings,
+ OMX_EVENTTYPE& aEventForILClient)
+ {
+ DEBUG_PRINTF(_L8("COmxILImagePort::DoPortReconfiguration"));
+
+ return COmxILPort::DoPortReconfiguration(aPortSettingsIndex,
+ aPortSettings,
+ aEventForILClient);
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILImagePort::DoBufferAllocation(OMX_U32 aSizeBytes,
+ OMX_U8*& apPortSpecificBuffer,
+ OMX_PTR& apPortPrivate,
+ OMX_PTR& apPlatformPrivate,
+ OMX_PTR apAppPrivate)
+ {
+ DEBUG_PRINTF2(_L8("COmxILImagePort::DoBufferAllocation : aSizeBytes[%u]"), aSizeBytes);
+ return COmxILPort::DoBufferAllocation(aSizeBytes,
+ apPortSpecificBuffer,
+ apPortPrivate,
+ apPlatformPrivate,
+ apAppPrivate);
+ }
+
+EXPORT_C void
+COmxILImagePort::DoBufferDeallocation(OMX_PTR apPortSpecificBuffer,
+ OMX_PTR apPortPrivate,
+ OMX_PTR apPlatformPrivate,
+ OMX_PTR apAppPrivate)
+ {
+ DEBUG_PRINTF(_L8("COmxILImagePort::DoBufferDeallocation"));
+ return COmxILPort::DoBufferDeallocation(apPortSpecificBuffer,
+ apPortPrivate,
+ apPlatformPrivate,
+ apAppPrivate);
+ }
+
+
+EXPORT_C OMX_ERRORTYPE
+COmxILImagePort::DoBufferWrapping(OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer,
+ OMX_PTR& apPortPrivate,
+ OMX_PTR& apPlatformPrivate,
+ OMX_PTR apAppPrivate)
+ {
+ DEBUG_PRINTF(_L8("COmxILImagePort::DoBufferWrapping"));
+ return COmxILPort::DoBufferWrapping(aSizeBytes,
+ apBuffer,
+ apPortPrivate,
+ apPlatformPrivate,
+ apAppPrivate);
+ }
+
+EXPORT_C void
+COmxILImagePort::DoBufferUnwrapping(OMX_PTR apBuffer,
+ OMX_PTR appPortPrivate,
+ OMX_PTR apPlatformPrivate,
+ OMX_PTR apAppPrivate)
+ {
+
+ DEBUG_PRINTF(_L8("COmxILImagePort::DoBufferUnwrapping"));
+ return COmxILPort::DoBufferUnwrapping(apBuffer,
+ appPortPrivate,
+ apPlatformPrivate,
+ apAppPrivate);
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILImagePort::DoOmxUseBuffer(OMX_HANDLETYPE aTunnelledComponent,
+ OMX_BUFFERHEADERTYPE** appBufferHdr,
+ OMX_U32 aTunnelledPortIndex,
+ OMX_PTR apPortPrivate,
+ OMX_PTR apPlatformPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer)
+ {
+
+ DEBUG_PRINTF(_L8("COmxILImagePort::DoOmxUseBuffer"));
+ return COmxILPort::DoOmxUseBuffer(aTunnelledComponent,
+ appBufferHdr,
+ aTunnelledPortIndex,
+ apPortPrivate,
+ apPlatformPrivate,
+ aSizeBytes,
+ apBuffer);
+ }
+
+
+EXPORT_C
+TInt COmxILImagePort::Extension_(TUint aExtensionId, TAny *&a0, TAny *a1)
+ {
+ return COmxILPort::Extension_(aExtensionId, a0, a1);
+ }
+
+EXPORT_C
+const RArray<OMX_IMAGE_CODINGTYPE>& COmxILImagePort::GetSupportedImageFormats() const
+ {
+ __ASSERT_ALWAYS(ipImagePortImpl, User::Panic(KOmxILImagePortPanicCategory, 1));
+ return ipImagePortImpl->GetSupportedImageFormats();
+ }
+
+EXPORT_C
+const RArray<OMX_COLOR_FORMATTYPE>& COmxILImagePort::GetSupportedColorFormats() const
+ {
+ __ASSERT_ALWAYS(ipImagePortImpl, User::Panic(KOmxILImagePortPanicCategory, 1));
+ return ipImagePortImpl->GetSupportedColorFormats();
+ }
+
+EXPORT_C
+const OMX_IMAGE_PARAM_PORTFORMATTYPE& COmxILImagePort::GetParamImagePortFormat() const
+ {
+ __ASSERT_ALWAYS(ipImagePortImpl, User::Panic(KOmxILImagePortPanicCategory, 1));
+ return ipImagePortImpl->GetParamImagePortFormat();
+ }
+
+EXPORT_C
+RArray<OMX_IMAGE_CODINGTYPE>& COmxILImagePort::GetSupportedImageFormats()
+ {
+ __ASSERT_ALWAYS(ipImagePortImpl, User::Panic(KOmxILImagePortPanicCategory, 1));
+ return ipImagePortImpl->GetSupportedImageFormats();
+ }
+
+EXPORT_C
+RArray<OMX_COLOR_FORMATTYPE>& COmxILImagePort::GetSupportedColorFormats()
+ {
+ __ASSERT_ALWAYS(ipImagePortImpl, User::Panic(KOmxILImagePortPanicCategory, 1));
+ return ipImagePortImpl->GetSupportedColorFormats();
+ }
+
+EXPORT_C
+OMX_IMAGE_PARAM_PORTFORMATTYPE& COmxILImagePort::GetParamImagePortFormat()
+ {
+ __ASSERT_ALWAYS(ipImagePortImpl, User::Panic(KOmxILImagePortPanicCategory, 1));
+ return ipImagePortImpl->GetParamImagePortFormat();
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilimageportimpl.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,221 @@
+// 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/omxilimageport.h>
+#include <openmax/il/common/omxilutil.h>
+#include "log.h"
+#include "omxilimageportimpl.h"
+
+COmxILImagePortImpl* COmxILImagePortImpl::NewL(const TOmxILCommonPortData& aCommonPortData,
+ const RArray<OMX_IMAGE_CODINGTYPE>& aSupportedImageFormats,
+ const RArray<OMX_COLOR_FORMATTYPE>& aSupportedColorFormats)
+ {
+ COmxILImagePortImpl* self = new(ELeave) COmxILImagePortImpl();
+ CleanupStack::PushL(self);
+ self->ConstructL(aCommonPortData, aSupportedImageFormats, aSupportedColorFormats);
+ CleanupStack::Pop();
+ return self;
+ }
+
+COmxILImagePortImpl::COmxILImagePortImpl()
+ {
+ DEBUG_PRINTF(_L8("COmxILImagePortImpl::COmxILImagePortImpl"));
+ }
+
+void COmxILImagePortImpl::ConstructL(const TOmxILCommonPortData& aCommonPortData,
+ const RArray<OMX_IMAGE_CODINGTYPE>& aSupportedImageFormats,
+ const RArray<OMX_COLOR_FORMATTYPE>& aSupportedColorFormats)
+ {
+ DEBUG_PRINTF(_L8("COmxILImagePortImpl::ConstructL"));
+ TUint count = aSupportedImageFormats.Count();
+ for (TInt i = 0; i < count; ++i)
+ {
+ iSupportedImageFormats.AppendL(aSupportedImageFormats[i]);
+ }
+
+ count = aSupportedColorFormats.Count();
+ for (TInt i = 0; i < count; ++i)
+ {
+ iSupportedColorFormats.AppendL(aSupportedColorFormats[i]);
+ }
+
+ TInt numImageFormats = iSupportedImageFormats.Count();
+ TInt numColorFormats = iSupportedColorFormats.Count();
+ iParamImagePortFormat.nSize = sizeof(OMX_IMAGE_PARAM_PORTFORMATTYPE);
+ iParamImagePortFormat.nVersion = aCommonPortData.iOmxVersion;
+ iParamImagePortFormat.nPortIndex = aCommonPortData.iPortIndex;
+ iParamImagePortFormat.nIndex = numImageFormats ? numImageFormats - 1 : 0;
+ iParamImagePortFormat.eCompressionFormat = numImageFormats ? iSupportedImageFormats[0] : OMX_IMAGE_CodingUnused;
+ iParamImagePortFormat.eColorFormat = numColorFormats ? iSupportedColorFormats[0] : OMX_COLOR_FormatUnused;
+ }
+
+COmxILImagePortImpl::~COmxILImagePortImpl()
+ {
+ DEBUG_PRINTF(_L8("COmxILImagePortImpl::~COmxILImagePortImpl"));
+ iSupportedImageFormats.Close();
+ iSupportedColorFormats.Close();
+ }
+
+OMX_ERRORTYPE COmxILImagePortImpl::GetParameter(OMX_INDEXTYPE aParamIndex, TAny* apComponentParameterStructure) const
+ {
+ DEBUG_PRINTF(_L8("COmxILImagePortImpl::GetParameter"));
+ OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+
+ switch(aParamIndex)
+ {
+ case OMX_IndexParamImagePortFormat:
+ {
+ if (OMX_ErrorNone != (omxRetValue =
+ TOmxILUtil::CheckOmxStructSizeAndVersion(
+ const_cast<OMX_PTR>(apComponentParameterStructure),
+ sizeof(OMX_IMAGE_PARAM_PORTFORMATTYPE))))
+ {
+ return omxRetValue;
+ }
+
+ OMX_IMAGE_PARAM_PORTFORMATTYPE* imagePortDefinition = static_cast<OMX_IMAGE_PARAM_PORTFORMATTYPE*>(apComponentParameterStructure);
+
+ if(OMX_IMAGE_CodingUnused == iParamImagePortFormat.eCompressionFormat)
+ {
+ if (imagePortDefinition->nIndex >= iSupportedColorFormats.Count())
+ {
+ return OMX_ErrorNoMore;
+ }
+ imagePortDefinition->eCompressionFormat = OMX_IMAGE_CodingUnused;
+ imagePortDefinition->eColorFormat = iSupportedColorFormats[imagePortDefinition->nIndex];
+ }
+ else
+ {
+ if (imagePortDefinition->nIndex >= iSupportedImageFormats.Count())
+ {
+ return OMX_ErrorNoMore;
+ }
+ imagePortDefinition->eCompressionFormat = iSupportedImageFormats[imagePortDefinition->nIndex];
+ }
+ break;
+ }
+ default:
+ __ASSERT_ALWAYS(EFalse, User::Panic(KOmxILImagePortPanicCategory, 1));
+ };
+
+ return OMX_ErrorNone;
+ }
+
+OMX_ERRORTYPE COmxILImagePortImpl::SetParameter(OMX_INDEXTYPE aParamIndex, const TAny* apComponentParameterStructure, TBool& aUpdateProcessingFunction)
+ {
+ DEBUG_PRINTF(_L8("COmxILImagePortImpl::SetParameter"));
+ OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+
+ switch(aParamIndex)
+ {
+ case OMX_IndexParamImagePortFormat:
+ {
+ if (OMX_ErrorNone != (omxRetValue =
+ TOmxILUtil::CheckOmxStructSizeAndVersion(
+ const_cast<OMX_PTR>(apComponentParameterStructure),
+ sizeof(OMX_IMAGE_PARAM_PORTFORMATTYPE))))
+ {
+ return omxRetValue;
+ }
+
+ const OMX_IMAGE_PARAM_PORTFORMATTYPE *componentParameterStructure = static_cast<const OMX_IMAGE_PARAM_PORTFORMATTYPE*>(apComponentParameterStructure);
+
+ if(OMX_IMAGE_CodingUnused == componentParameterStructure->eCompressionFormat)
+ {
+ if(OMX_COLOR_FormatUnused == componentParameterStructure->eColorFormat)
+ {
+ // Both Compression Format and Color can not be Unused at the same time.
+ return OMX_ErrorBadParameter;
+ }
+
+ if(iParamImagePortFormat.eColorFormat != componentParameterStructure->eColorFormat)
+ {
+ if(KErrNotFound == iSupportedColorFormats.Find(componentParameterStructure->eColorFormat))
+ {
+ return OMX_ErrorUnsupportedSetting;
+ }
+ else
+ {
+ iParamImagePortFormat.eColorFormat = componentParameterStructure->eColorFormat;
+ }
+ aUpdateProcessingFunction = ETrue;
+ }
+ }
+ else
+ {
+ // Data is compressed. Change relevant variables.
+ if (OMX_COLOR_FormatUnused != componentParameterStructure->eColorFormat)
+ {
+ // Both Compression Format and Color can not be Unused at the same time.
+ return OMX_ErrorBadParameter;
+ }
+
+ if (iParamImagePortFormat.eCompressionFormat != componentParameterStructure->eCompressionFormat)
+ {
+ if(KErrNotFound == iSupportedImageFormats.Find(componentParameterStructure->eCompressionFormat))
+ {
+ return OMX_ErrorUnsupportedSetting;
+ }
+ else
+ {
+ iParamImagePortFormat.eCompressionFormat = componentParameterStructure->eCompressionFormat;
+ aUpdateProcessingFunction = ETrue;
+ }
+ }
+ }
+ break;
+ }
+ default:
+ __ASSERT_ALWAYS(EFalse, User::Panic(KOmxILImagePortPanicCategory, 1));
+ };
+ return OMX_ErrorNone;
+ }
+
+const RArray<OMX_IMAGE_CODINGTYPE>& COmxILImagePortImpl::GetSupportedImageFormats() const
+ {
+ return iSupportedImageFormats;
+ }
+
+const RArray<OMX_COLOR_FORMATTYPE>& COmxILImagePortImpl::GetSupportedColorFormats() const
+ {
+ return iSupportedColorFormats;
+ }
+
+const OMX_IMAGE_PARAM_PORTFORMATTYPE& COmxILImagePortImpl::GetParamImagePortFormat() const
+ {
+ return iParamImagePortFormat;
+ }
+
+RArray<OMX_IMAGE_CODINGTYPE>& COmxILImagePortImpl::GetSupportedImageFormats()
+ {
+ return iSupportedImageFormats;
+ }
+
+RArray<OMX_COLOR_FORMATTYPE>& COmxILImagePortImpl::GetSupportedColorFormats()
+ {
+ return iSupportedColorFormats;
+ }
+
+OMX_IMAGE_PARAM_PORTFORMATTYPE& COmxILImagePortImpl::GetParamImagePortFormat()
+ {
+ return iParamImagePortFormat;
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilimageportimpl.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,66 @@
+// 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 OMXILIMAGEPORTIMPL_H
+#define OMXILIMAGEPORTIMPL_H
+
+#include <e32base.h>
+
+#include <openmax/il/khronos/v1_x/OMX_Types.h>
+#include <openmax/il/khronos/v1_x/OMX_Core.h>
+#include <openmax/il/khronos/v1_x/OMX_Component.h>
+
+#include <openmax/il/common/omxilport.h>
+
+class COmxILImagePortImpl : public CBase
+ {
+public:
+ static COmxILImagePortImpl* NewL(const TOmxILCommonPortData& aCommonPortData,
+ const RArray<OMX_IMAGE_CODINGTYPE>& aSupportedImageFormats,
+ const RArray<OMX_COLOR_FORMATTYPE>& aSupportedColorFormats);
+ ~COmxILImagePortImpl();
+
+ OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex,
+ TAny* apComponentParameterStructure) const;
+
+ OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex,
+ const TAny* apComponentParameterStructure,
+ TBool& aUpdateProcessingFunction);
+
+ const RArray<OMX_IMAGE_CODINGTYPE>& GetSupportedImageFormats() const;
+ const RArray<OMX_COLOR_FORMATTYPE>& GetSupportedColorFormats() const;
+ const OMX_IMAGE_PARAM_PORTFORMATTYPE& GetParamImagePortFormat() const;
+ RArray<OMX_IMAGE_CODINGTYPE>& GetSupportedImageFormats();
+ RArray<OMX_COLOR_FORMATTYPE>& GetSupportedColorFormats();
+ OMX_IMAGE_PARAM_PORTFORMATTYPE& GetParamImagePortFormat();
+
+private:
+ COmxILImagePortImpl();
+ void ConstructL(const TOmxILCommonPortData& aCommonPortData,
+ const RArray<OMX_IMAGE_CODINGTYPE>& aSupportedImageFormats,
+ const RArray<OMX_COLOR_FORMATTYPE>& aSupportedColorFormats);
+
+private:
+ RArray<OMX_IMAGE_CODINGTYPE> iSupportedImageFormats;
+ RArray<OMX_COLOR_FORMATTYPE> iSupportedColorFormats;
+ OMX_IMAGE_PARAM_PORTFORMATTYPE iParamImagePortFormat;
+ };
+#endif // OMXILIMAGEPORTIMPL_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilincontextcallbackmanager.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,780 @@
+// 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 "omxilincontextcallbackmanager.h"
+#include "omxilfsm.h"
+#include <openmax/il/common/omxilstatedefs.h>
+#include <openmax/il/common/omxilutil.h>
+
+COmxILInContextCallbackManager*
+COmxILInContextCallbackManager::NewL(
+ OMX_HANDLETYPE apComponentHandle,
+ OMX_PTR apAppData,
+ OMX_CALLBACKTYPE* apCallbacks)
+ {
+ DEBUG_PRINTF(_L8("COmxILInContextCallbackManager::NewL"));
+ COmxILInContextCallbackManager* self = new (ELeave)COmxILInContextCallbackManager(
+ apComponentHandle,
+ apAppData,
+ apCallbacks);
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ CleanupStack::Pop(self);
+ return self;
+ }
+
+void
+COmxILInContextCallbackManager::ConstructL()
+ {
+ DEBUG_PRINTF(_L8("COmxILInContextCallbackManager::ConstructL"));
+
+ User::LeaveIfError(iLock.CreateLocal());
+
+ }
+
+COmxILInContextCallbackManager::COmxILInContextCallbackManager(OMX_HANDLETYPE apComponentHandle,
+ OMX_PTR apAppData,
+ OMX_CALLBACKTYPE* apCallbacks)
+ :
+ CBase(),
+ XOmxILCallbackManagerIfImpl(
+ static_cast<OMX_COMPONENTTYPE*>(apComponentHandle),
+ apAppData,
+ apCallbacks),
+ iLock(),
+ iPendingQueue(),
+ iFlushPendingQueue(EFalse),
+ iCurrentState(OMX_StateLoaded),
+ iPreviousState(OMX_StateLoaded)
+ {
+ DEBUG_PRINTF(_L8("COmxILInContextCallbackManager::COmxILInContextCallbackManager"));
+ }
+
+COmxILInContextCallbackManager::~COmxILInContextCallbackManager()
+ {
+ DEBUG_PRINTF2(_L8("COmxILInContextCallbackManager::~COmxILInContextCallbackManager Pending Queue count [%d]"),
+ iPendingQueue.Count());
+
+ iLock.Close();
+
+ iPendingQueue.Close();
+
+ }
+
+void
+COmxILInContextCallbackManager::LockCallbackManager()
+ {
+ iLock.Wait();
+ }
+
+void
+COmxILInContextCallbackManager::UnlockCallbackManager()
+ {
+ iLock.Signal();
+ }
+
+void
+COmxILInContextCallbackManager::SetPortManager(MOmxILPortManagerIf& apPortManager)
+ {
+ LockCallbackManager();
+ DoSetPortManager(apPortManager);
+ UnlockCallbackManager();
+ }
+
+void
+COmxILInContextCallbackManager::SetFsm(COmxILFsm& apFsm)
+ {
+ LockCallbackManager();
+ DoSetFsm(apFsm);
+ UnlockCallbackManager();
+ }
+
+OMX_ERRORTYPE
+COmxILInContextCallbackManager::RegisterComponentHandle(OMX_HANDLETYPE aComponentHandle)
+ {
+ DEBUG_PRINTF(_L8("COmxILInContextCallbackManager::RegisterComponentHandle"));
+ LockCallbackManager();
+ OMX_ERRORTYPE omxError = DoRegisterComponentHandle(aComponentHandle);
+ UnlockCallbackManager();
+ return omxError;
+ }
+
+/**
+ The IL Client callback registration is handled in this implementation
+ asynchronously. Note that this implementation assumes that the IL Client
+ will update the callbacks information once all expected callbacks from this
+ component have already been received and therefore, the callback change will
+ be safe leading to no race condition at the IL Client side.
+
+ @param apCallbacks The IL Client callback structure.
+
+ @param apAppData Pointer to an application provided value so that the
+ application can have a component specific context when receiving
+ the callback.
+
+ @return OMX_ERRORTYPE
+ */
+OMX_ERRORTYPE
+COmxILInContextCallbackManager::RegisterILClientCallbacks(const OMX_CALLBACKTYPE* apCallbacks,
+ const OMX_PTR apAppData)
+ {
+ DEBUG_PRINTF(_L8("COmxILInContextCallbackManager::RegisterILClientCallbacks"));
+
+ LockCallbackManager();
+ OMX_ERRORTYPE omxError = DoRegisterILClientCallbacks(apCallbacks, apAppData);
+ UnlockCallbackManager();
+ return omxError;
+
+ }
+
+OMX_ERRORTYPE
+COmxILInContextCallbackManager::RegisterTunnelCallback(
+ OMX_U32 aLocalPortIndex,
+ OMX_DIRTYPE aLocalPortDirection,
+ OMX_HANDLETYPE aTunnelledComponentHandle,
+ OMX_U32 aTunnelledPortIndex)
+ {
+ DEBUG_PRINTF2(_L8("COmxILInContextCallbackManager::RegisterTunnelCallback : aTunnelledComponentHandle [%x]"), aTunnelledComponentHandle);
+
+ LockCallbackManager();
+ OMX_ERRORTYPE omxError = DoRegisterTunnelCallback(aLocalPortIndex,
+ aLocalPortDirection,
+ aTunnelledComponentHandle,
+ aTunnelledPortIndex);
+ UnlockCallbackManager();
+ return omxError;
+
+ }
+
+OMX_ERRORTYPE
+COmxILInContextCallbackManager::DeregisterTunnelCallback(
+ OMX_U32 aLocalPortIndex)
+ {
+
+ DEBUG_PRINTF(_L8("COmxILInContextCallbackManager::DeregisterTunnelCallback"));
+
+ LockCallbackManager();
+ OMX_ERRORTYPE omxError = DoRegisterTunnelCallback(aLocalPortIndex,
+ OMX_DirMax,
+ 0,
+ 0);
+ UnlockCallbackManager();
+ return omxError;
+
+ }
+
+OMX_ERRORTYPE
+COmxILInContextCallbackManager::RegisterBufferMarkPropagationPort(
+ OMX_U32 aPortIndex,
+ OMX_U32 aPropagationPortIndex)
+ {
+ DEBUG_PRINTF(_L8("COmxILInContextCallbackManager::RegisterBufferMarkPropagationPort"));
+
+ LockCallbackManager();
+ OMX_ERRORTYPE omxError = DoRegisterBufferMarkPropagationPort(
+ aPortIndex,
+ aPropagationPortIndex);
+ UnlockCallbackManager();
+ return omxError;
+
+ }
+
+TBool
+COmxILInContextCallbackManager::BufferRemovalIndication(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_DIRTYPE aDirection)
+ {
+ DEBUG_PRINTF(_L8("COmxILInContextCallbackManager::BufferRemovalIndication"));
+
+ return RemoveBuffersByBufferHeader(
+ iPendingQueue, apBufferHeader, aDirection);
+
+ }
+
+OMX_ERRORTYPE
+COmxILInContextCallbackManager::TransitionCompleteNotification(OMX_STATETYPE aOmxState)
+ {
+ DEBUG_PRINTF(_L8("COmxILInContextCallbackManager::TransitionCompleteNotification"));
+
+ // No need to lock callback manager. Anyway, we should not have it locked
+ // when calling an IL Client callback method
+ OMX_ERRORTYPE omxError = EventNotification(OMX_EventCmdComplete,
+ OMX_CommandStateSet,
+ aOmxState,
+ 0);
+
+ return omxError;
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILInContextCallbackManager::CommandCompleteNotification(OMX_COMMANDTYPE aOmxCommand,
+ OMX_U32 aOmxPortIndex)
+ {
+ DEBUG_PRINTF(_L8("COmxILInContextCallbackManager::CommandCompleteNotification"));
+
+ // No need to lock callback manager. Anyway, we should not have it locked
+ // when calling an IL Client callback method
+
+ OMX_ERRORTYPE omxError = EventNotification(OMX_EventCmdComplete,
+ aOmxCommand,
+ aOmxPortIndex,
+ 0);
+
+ return omxError;
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILInContextCallbackManager::ErrorEventNotification(OMX_ERRORTYPE aOmxError)
+ {
+ DEBUG_PRINTF2(_L8("COmxILInContextCallbackManager::ErrorEventNotification : aOmxError[%X] "), aOmxError);
+
+ // No need to lock callback manager. Anyway, we should not have it locked
+ // when calling an IL Client callback method
+ OMX_ERRORTYPE omxError = EventNotification(OMX_EventError,
+ aOmxError,
+ 0,
+ 0);
+
+ return omxError;
+
+ }
+
+OMX_ERRORTYPE
+COmxILInContextCallbackManager::EventNotification(OMX_EVENTTYPE aEvent,
+ TUint32 aData1,
+ TUint32 aData2,
+ OMX_STRING aExtraInfo)
+ {
+ DEBUG_PRINTF4(_L8("COmxILInContextCallbackManager::EventNotification : aEvent[%u] aData1[%u] aData2[%u]"),
+ aEvent, aData1, aData2);
+
+ OMX_ERRORTYPE omxError = OMX_ErrorNone;
+ switch(aData1)
+ {
+ case OMX_CommandStateSet:
+ {
+ LockCallbackManager();
+ iPreviousState = iCurrentState;
+ iCurrentState = static_cast<OMX_STATETYPE>(aData2);
+
+ DEBUG_PRINTF4(_L8("COmxILInContextCallbackManager::EventNotification() : Handle[%X] iPreviousState[%d] -> iCurrentState[%d]"), ipHandle, iPreviousState, iCurrentState);
+
+ if (OMX_StatePause == iPreviousState &&
+ OMX_StateIdle == iCurrentState)
+ {
+ // Release lock before any callback gets called...
+ UnlockCallbackManager();
+
+ // Flush pending queue first...
+ FlushQueue(iPendingQueue);
+
+ // ... and now signal command completion...
+ omxError =
+ DoEventNotification(aEvent,
+ aData1,
+ aData2,
+ aExtraInfo);
+
+ }
+ else if (OMX_StatePause == iPreviousState &&
+ OMX_StateExecuting == iCurrentState)
+ {
+ // Release lock before any callback...
+ UnlockCallbackManager();
+
+ // Signal command completion first...
+ omxError =
+ DoEventNotification(aEvent,
+ aData1,
+ aData2,
+ aExtraInfo);
+
+ // ... and now flush...
+ FlushQueue(iPendingQueue);
+
+ }
+ else
+ {
+ // Release lock before any callback...
+ UnlockCallbackManager();
+
+ // Signal command completion...
+ omxError =
+ DoEventNotification(aEvent,
+ aData1,
+ aData2,
+ aExtraInfo);
+
+ }
+
+ }
+ break;
+
+ case OMX_CommandPortDisable:
+ case OMX_CommandFlush:
+ {
+ // Flush first...
+ if (OMX_ALL == aData2)
+ {
+ FlushQueue(iPendingQueue);
+ }
+ else
+ {
+ FlushBuffersByPortIndex(iPendingQueue,
+ aData2);
+ }
+
+ // ... and now signal command completion...
+ omxError =
+ DoEventNotification(aEvent,
+ aData1,
+ aData2,
+ aExtraInfo);
+
+ }
+ break;
+
+ default:
+ {
+ // Signal command completion...
+ omxError =
+ DoEventNotification(aEvent,
+ aData1,
+ aData2,
+ aExtraInfo);
+
+ }
+
+ };
+
+ if (OMX_ErrorInsufficientResources == omxError)
+ {
+ HandleInsufficientResources();
+ }
+
+ return omxError;
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILInContextCallbackManager::BufferDoneNotification(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_U32 aLocalPortIndex,
+ OMX_DIRTYPE aLocalPortDirection)
+ {
+ DEBUG_PRINTF2(_L8("COmxILInContextCallbackManager::BufferDoneNotificaton : BUFFER [%X]"),
+ apBufferHeader);
+
+ __ASSERT_ALWAYS(apBufferHeader &&
+ (OMX_DirInput == aLocalPortDirection ||
+ OMX_DirOutput == aLocalPortDirection),
+ User::Panic(KOmxILCallbackManagerIfImplPanicCategory, 1));
+
+ __ASSERT_ALWAYS(apBufferHeader->nOffset + apBufferHeader->nFilledLen
+ <= apBufferHeader->nAllocLen,
+ User::Panic(KOmxILCallbackManagerIfImplPanicCategory, 1));
+
+ __ASSERT_DEBUG(ipHandle && ipCallbacks,
+ User::Panic(KOmxILCallbackManagerIfImplPanicCategory, 1));
+
+ LockCallbackManager();
+ if (OMX_StatePause == iCurrentState)
+ {
+ if (KErrNone != iPendingQueue.Append(TOmxILBuffer(
+ apBufferHeader,
+ aLocalPortIndex,
+ aLocalPortDirection)))
+ {
+ // Not much we can do here...
+ UnlockCallbackManager();
+ HandleInsufficientResources();
+ }
+ else
+ {
+ DEBUG_PRINTF4(_L8("COmxILInContextCallbackManager::BufferDoneNotificaton : DEFERRED buffer header[%X] port [%X] queue items [%d]"),
+ apBufferHeader, aLocalPortIndex, iPendingQueue.Count());
+ UnlockCallbackManager();
+ }
+
+ return OMX_ErrorNone;
+
+ }
+ UnlockCallbackManager();
+
+ ProcessBufferDoneNotification(apBufferHeader,
+ aLocalPortIndex,
+ aLocalPortDirection);
+
+ return OMX_ErrorNone;
+
+ }
+
+void
+COmxILInContextCallbackManager::ProcessBufferDoneNotification(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_U32 aLocalPortIndex,
+ OMX_DIRTYPE aLocalPortDirection)
+ {
+ DEBUG_PRINTF2(_L8("COmxILInContextCallbackManager::ProcessBufferDoneNotification : BUFFER [%X]"),
+ apBufferHeader);
+
+ // Look for buffer marks to be signalled or propagated (maintain callback
+ // manager unlocked here)
+ SignalOrPropagateBufferMarks(apBufferHeader,
+ aLocalPortDirection);
+
+ LockCallbackManager();
+
+ // find out whether the port is tunnelled or not
+ TBool tunnelled = EFalse;
+ OMX_COMPONENTTYPE* pTunnelledComponent = 0;
+ const TUint tunnelCount = iRegisteredTunnels.Count();
+ for (TUint i=0; i<tunnelCount; ++i)
+ {
+ if (iRegisteredTunnels[i].iLocalPortIndex ==
+ aLocalPortIndex)
+ {
+ tunnelled = ETrue;
+ pTunnelledComponent =
+ static_cast<OMX_COMPONENTTYPE*>(
+ iRegisteredTunnels[i].
+ iTunnelledComponentHandle);
+
+ __ASSERT_DEBUG(pTunnelledComponent,
+ User::Panic(KOmxILCallbackManagerIfImplPanicCategory, 1));
+
+ break;
+ }
+ }
+
+ // Unlock callback manager before calling the callback
+ UnlockCallbackManager();
+
+ if (tunnelled)
+ {
+ // From OMX_Core.h "Callbacks should not return an error to the
+ // component, so if an error occurs, the application shall handle it
+ // internally". Callback return error ignored here.
+ if (OMX_DirInput == aLocalPortDirection)
+ {
+ OMX_FillThisBuffer(pTunnelledComponent, apBufferHeader);
+ }
+ else
+ {
+ OMX_EmptyThisBuffer(pTunnelledComponent, apBufferHeader);
+ }
+
+ }
+ else
+ {
+ OMX_ERRORTYPE (*fp2CBackHandler)
+ (OMX_HANDLETYPE, OMX_PTR, OMX_BUFFERHEADERTYPE*) =
+ (aLocalPortDirection == OMX_DirInput ?
+ ipCallbacks->EmptyBufferDone :
+ ipCallbacks->FillBufferDone);
+
+
+ // From OMX_Core.h "Callbacks should not return an error to the
+ // component, so if an error occurs, the application shall handle it
+ // internally". Callback return error ignored here.
+ fp2CBackHandler(ipHandle,
+ ipAppData,
+ apBufferHeader);
+
+ }
+
+ }
+
+void
+COmxILInContextCallbackManager::SignalOrPropagateBufferMarks(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_U32 aLocalPortIndex)
+ {
+ DEBUG_PRINTF2(_L8("COmxILInContextCallbackManager::SignalOrPropagateBufferMarks() : BUFFER [%X]"),
+ apBufferHeader);
+
+ // Look for buffer marks to be signalled or propagated
+ if (apBufferHeader->hMarkTargetComponent)
+ {
+ // See if this component is the buffer mark target component...
+ if (apBufferHeader->hMarkTargetComponent == ipHandle)
+ {
+ // Inform the IL Client that a marked buffer has been processed...
+ ipCallbacks->EventHandler(ipHandle,
+ ipAppData,
+ OMX_EventMark,
+ 0,
+ 0,
+ apBufferHeader->pMarkData);
+
+ // At this point, the mark has been delivered to the IL
+ // Client...Remove the mark from the processed header...
+ apBufferHeader->hMarkTargetComponent = 0;
+ apBufferHeader->pMarkData = 0;
+
+ }
+ else
+ {
+ // Propagate the mark...
+
+ LockCallbackManager();
+
+ // First find the buffer mark propagation port...
+ const TInt index = iBufferMarkPropagationPorts.Find(
+ TBufferMarkPropagationInfo(aLocalPortIndex),
+ TIdentityRelation<TBufferMarkPropagationInfo>(
+ &TBufferMarkPropagationInfo::Compare));
+
+ // Note that sink components don't propagate marks...
+ if (index != KErrNotFound)
+ {
+ const TBufferMarkPropagationInfo& propInfo =
+ iBufferMarkPropagationPorts[index];
+
+ // Let's check for the special case: The case for a source
+ // component where the output port is both the port that marks
+ // the headers and the port that propagates them ... Therefore
+ // no need to store the mark for later propagation...
+ if (propInfo.iPropagationPortIndex != aLocalPortIndex)
+ {
+ // Now, store temporarily the mark so the next time we send
+ // a buffer done callback in that propagation port, we mark
+ // that header accordingly...
+ // Unsuccessful insertion is ignored.
+ iBufferMarks.Append(
+ TOutputPortBufferMarkInfo(
+ propInfo.iPropagationPortIndex,
+ apBufferHeader->hMarkTargetComponent,
+ apBufferHeader->pMarkData));
+
+ // At this point the mark has been set for propagation to
+ // an output port. Remove the mark from the processed
+ // header...
+ apBufferHeader->hMarkTargetComponent = 0;
+ apBufferHeader->pMarkData = 0;
+ }
+ }
+
+ UnlockCallbackManager();
+
+ }
+ }
+ else
+ {
+ LockCallbackManager();
+
+ if(iBufferMarks.Count() != 0)
+ {
+ // Let's see if we have a mark waiting to go out...This will find the
+ // first mark in the local list of marks ...
+ const TInt index = iBufferMarks.Find(
+ TOutputPortBufferMarkInfo(aLocalPortIndex),
+ TIdentityRelation<TOutputPortBufferMarkInfo>(
+ &TOutputPortBufferMarkInfo::Compare));
+ if (index != KErrNotFound)
+ {
+ const TOutputPortBufferMarkInfo& markInfo =
+ iBufferMarks[index];
+
+ // Mark the header...
+ apBufferHeader->hMarkTargetComponent = markInfo.ipMarkTargetComponent;
+ apBufferHeader->pMarkData = markInfo.ipMarkData;
+
+ // Remove the mark info from the local store
+ iBufferMarks.Remove(index);
+ }
+
+ }
+
+ UnlockCallbackManager();
+
+ }
+
+
+ }
+
+OMX_ERRORTYPE
+COmxILInContextCallbackManager::ClockBufferDoneNotification(OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_U32 aLocalPortIndex,
+ OMX_DIRTYPE aLocalPortDirection)
+ {
+ DEBUG_PRINTF(_L8("COmxILInContextCallbackManager::ClockBufferDoneNotification"));
+
+ return BufferDoneNotification(apBufferHeader,
+ aLocalPortIndex,
+ aLocalPortDirection);
+
+ }
+
+OMX_ERRORTYPE
+COmxILInContextCallbackManager::PortSettingsChangeNotification(
+ OMX_U32 aLocalPortIndex,
+ TUint aPortSettingsIndex,
+ const TDesC8& aPortSettings)
+ {
+ DEBUG_PRINTF2(_L8("COmxILInContextCallbackManager::PortSettingsChangeNotification : aLocalPortIndex[%d]"), aLocalPortIndex);
+
+ LockCallbackManager();
+ OMX_ERRORTYPE omxError = DoPortSettingsChangeNotification(aLocalPortIndex,
+ aPortSettingsIndex,
+ aPortSettings);
+ UnlockCallbackManager();
+ return omxError;
+
+ }
+
+#ifdef _OMXIL_COMMON_IL516C_ON
+OMX_ERRORTYPE
+COmxILInContextCallbackManager::EjectBuffersRequest(
+ OMX_U32 aLocalOmxPortIndex)
+ {
+ DEBUG_PRINTF2(_L8("COmxILInContextCallbackManager::EjectBuffersRequest : aLocalOmxPortIndex[%d]"), aLocalOmxPortIndex);
+
+ OMX_ERRORTYPE omxError = DoEjectBuffersRequest(aLocalOmxPortIndex);
+ return omxError;
+
+ }
+#endif
+
+void
+COmxILInContextCallbackManager::FlushQueue(
+ RCbMgrBufferQueue& aQueue)
+ {
+ DEBUG_PRINTF2(_L8("COmxILInContextCallbackManager::FlushQueue : Handle[%X]"), ipHandle);
+
+ LockCallbackManager();
+
+ TInt i = 0;
+ while(i < aQueue.Count())
+ {
+ TOmxILBuffer buffer(aQueue[i]);
+ aQueue.Remove(i);
+ DEBUG_PRINTF4(_L8("COmxILInContextCallbackManager::FlushQueue() : FOUND -> buffer header [%X] PortIndex[%d], queue items [%d]"), buffer.ipBufferHeader, buffer.iLocalPortIndex, aQueue.Count());
+
+ UnlockCallbackManager();
+ ProcessBufferDoneNotification(buffer.ipBufferHeader,
+ buffer.iLocalPortIndex,
+ buffer.iLocalPortDirection);
+ LockCallbackManager();
+ // There is a window where new items could have been added to the
+ // queue. Restart loop just in case...
+ i = 0;
+ }
+
+ UnlockCallbackManager();
+ }
+
+TBool
+COmxILInContextCallbackManager::RemoveBuffersByBufferHeader(
+ RCbMgrBufferQueue& aQueue,
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ const OMX_DIRTYPE aDirection)
+ {
+ DEBUG_PRINTF2(_L8("COmxILInContextCallbackManager::RemoveBuffersByBufferHeader : Handle[%X]"), ipHandle);
+
+ LockCallbackManager();
+
+ TInt i = 0;
+ while(i < aQueue.Count())
+ {
+ TOmxILBuffer buffer(aQueue[i]);
+ if (apBufferHeader == buffer.ipBufferHeader)
+ {
+ __ASSERT_DEBUG(aDirection == OMX_DirInput ||
+ aDirection == OMX_DirOutput,
+ User::Panic(KOmxILCallbackManagerPanicCategory, 1));
+
+ DEBUG_PRINTF4(_L8("COmxILInContextCallbackManager::RemoveBuffersByBufferHeader() : Nofiying FSM : Handle[%X] aDirection[%X] apBufferHeader[%X]"), ipHandle, aDirection, apBufferHeader);
+
+ // Make sure the buffer contents are cleared...
+ TOmxILUtil::ClearBufferContents(apBufferHeader);
+
+ aQueue.Remove(i);
+ UnlockCallbackManager();
+
+ if (aDirection == OMX_DirInput)
+ {
+ ipFsm->EmptyThisBuffer(
+ const_cast<OMX_BUFFERHEADERTYPE*>(apBufferHeader));
+ }
+ else
+ {
+ ipFsm->FillThisBuffer(
+ const_cast<OMX_BUFFERHEADERTYPE*>(apBufferHeader));
+ }
+
+ return ETrue;
+ }
+ else
+ {
+ ++i;
+ }
+ }
+
+ UnlockCallbackManager();
+
+ return EFalse;
+ }
+
+
+void
+COmxILInContextCallbackManager::FlushBuffersByPortIndex(
+ RCbMgrBufferQueue& aQueue,
+ const OMX_U32 aLocalPortIndex)
+ {
+ DEBUG_PRINTF2(_L8("COmxILInContextCallbackManager::FlushBuffersByPortIndex : Handle[%X]"), ipHandle);
+
+ LockCallbackManager();
+
+ TInt i = 0;
+ while(i < aQueue.Count())
+ {
+ TOmxILBuffer buffer(aQueue[i]);
+ DEBUG_PRINTF4(_L8("COmxILInContextCallbackManager::FlushBuffersByPortIndex() : LOOKING -> buffer header [%X] PortIndex[%d], queue items [%d]"), buffer.ipBufferHeader, aLocalPortIndex, aQueue.Count());
+ if (aLocalPortIndex == buffer.iLocalPortIndex)
+ {
+ aQueue.Remove(i);
+ DEBUG_PRINTF4(_L8("COmxILInContextCallbackManager::FlushBuffersByPortIndex() : FOUND -> buffer header [%X] PortIndex[%d], queue items [%d]"), buffer.ipBufferHeader, aLocalPortIndex, aQueue.Count());
+ UnlockCallbackManager();
+ ProcessBufferDoneNotification(buffer.ipBufferHeader,
+ buffer.iLocalPortIndex,
+ buffer.iLocalPortDirection);
+ LockCallbackManager();
+ // There is a window where new items could have been added to the
+ // queue. Restart loop just in case...
+ i = 0;
+ }
+ else
+ {
+ ++i;
+ }
+ }
+
+ UnlockCallbackManager();
+
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilincontextcallbackmanager.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,222 @@
+// 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 OMXILINCONTEXTCALLBACKMANAGER_H
+#define OMXILINCONTEXTCALLBACKMANAGER_H
+
+#include "omxilcallbackmanager.h"
+
+/**
+ OpenMAX IL call backs and buffer marks manager. This is a synchronous
+ implementation of MOmxILCallbackManagerIf.
+
+ */
+NONSHARABLE_CLASS(COmxILInContextCallbackManager) :
+ public CBase,
+ public MOmxILCallbackManagerIf,
+ private XOmxILCallbackManagerIfImpl
+ {
+
+public:
+
+ static COmxILInContextCallbackManager* NewL(
+ OMX_HANDLETYPE apComponentHandle,
+ OMX_PTR apAppData,
+ OMX_CALLBACKTYPE* apCallbacks);
+
+ ~COmxILInContextCallbackManager();
+
+ void SetPortManager(MOmxILPortManagerIf& apPortManager);
+
+ void SetFsm(COmxILFsm& apFsm);
+
+ //
+ // Methods for Callback Registration (from MOmxILCallbackManagerIf)
+ //
+ OMX_ERRORTYPE RegisterComponentHandle(
+ OMX_HANDLETYPE aComponentHandle);
+
+ OMX_ERRORTYPE RegisterILClientCallbacks(
+ const OMX_CALLBACKTYPE* apCallbacks,
+ const OMX_PTR apAppData);
+
+ OMX_ERRORTYPE RegisterTunnelCallback(
+ OMX_U32 aLocalPortIndex,
+ OMX_DIRTYPE aLocalPortDirection,
+ OMX_HANDLETYPE aTunnelledComponentHandle,
+ OMX_U32 aTunnelledPortIndex
+ );
+
+ OMX_ERRORTYPE DeregisterTunnelCallback(
+ OMX_U32 aLocalPortIndex);
+
+ OMX_ERRORTYPE RegisterBufferMarkPropagationPort(
+ OMX_U32 aPortIndex,
+ OMX_U32 aPropagationPortIndex);
+
+ TBool BufferRemovalIndication(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_DIRTYPE aDirection);
+
+
+ //
+ // Methods for Callback Notification (from MOmxILCallbackManagerIf)
+ //
+
+ OMX_ERRORTYPE TransitionCompleteNotification(
+ OMX_STATETYPE aOmxState);
+
+ OMX_ERRORTYPE CommandCompleteNotification(
+ OMX_COMMANDTYPE aOmxCommand,
+ OMX_U32 aOmxPortIndex);
+
+#ifdef _OMXIL_COMMON_IL516C_ON
+ OMX_ERRORTYPE EjectBuffersRequest(
+ OMX_U32 aLocalOmxPortIndex);
+#endif
+
+ //
+ // Methods for Callback Notification (from MOmxILCallbackManagerIf)
+ //
+
+ OMX_ERRORTYPE ErrorEventNotification(
+ OMX_ERRORTYPE aOmxError);
+
+ OMX_ERRORTYPE EventNotification(
+ OMX_EVENTTYPE aEvent,
+ TUint32 aData1,
+ TUint32 aData2,
+ OMX_STRING aExtraInfo);
+
+ OMX_ERRORTYPE BufferDoneNotification(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_U32 aLocalPortIndex,
+ OMX_DIRTYPE aLocalPortDirection);
+
+ OMX_ERRORTYPE ClockBufferDoneNotification(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_U32 aLocalPortIndex,
+ OMX_DIRTYPE aLocalPortDirection);
+
+ OMX_ERRORTYPE PortSettingsChangeNotification(
+ OMX_U32 aLocalPortIndex,
+ TUint aPortSettingsIndex,
+ const TDesC8& aPortSettings);
+
+
+private:
+
+ class TOmxILBuffer
+ {
+
+ public:
+
+ OMX_BUFFERHEADERTYPE* ipBufferHeader;
+ OMX_U32 iLocalPortIndex;
+ OMX_DIRTYPE iLocalPortDirection;
+
+ // Default Constructor
+ inline TOmxILBuffer();
+
+ // Constructor
+ inline TOmxILBuffer(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_U32 aLocalPortIndex,
+ OMX_DIRTYPE aLocalPortDirection);
+
+ };
+
+private:
+
+ // Convenience typedef
+ typedef RArray<TOmxILBuffer> RCbMgrBufferQueue;
+
+
+private:
+
+ COmxILInContextCallbackManager(OMX_HANDLETYPE apComponentHandle,
+ OMX_PTR apAppData,
+ OMX_CALLBACKTYPE* apCallbacks);
+ void ConstructL();
+
+ void LockCallbackManager();
+ void UnlockCallbackManager();
+
+ void SignalOrPropagateBufferMarks(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_U32 aLocalPortIndex);
+
+ void ProcessBufferDoneNotification(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_U32 aLocalPortIndex,
+ OMX_DIRTYPE aLocalPortDirection);
+
+ void FlushQueue(RCbMgrBufferQueue& aQueue);
+
+ TBool RemoveBuffersByBufferHeader(
+ RCbMgrBufferQueue& aQueue,
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ const OMX_DIRTYPE aDirection);
+
+ void FlushBuffersByPortIndex(RCbMgrBufferQueue& aQueue,
+ const OMX_U32 aLocalPortIndex);
+
+
+private:
+
+ RFastLock iLock;
+
+ // Queue of buffer done notifications that need to be queued during
+ // OMX_StatePaused state
+ RCbMgrBufferQueue iPendingQueue;
+
+ // Flag to enable unconditional flushing of buffer done notifications
+ TBool iFlushPendingQueue;
+
+ OMX_STATETYPE iCurrentState;
+ OMX_STATETYPE iPreviousState;
+
+ };
+
+inline
+COmxILInContextCallbackManager::TOmxILBuffer::TOmxILBuffer()
+ :
+ ipBufferHeader(0),
+ iLocalPortIndex(0),
+ iLocalPortDirection(OMX_DirMax)
+ {
+ }
+
+inline
+COmxILInContextCallbackManager::TOmxILBuffer::TOmxILBuffer(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_U32 aLocalPortIndex,
+ OMX_DIRTYPE aLocalPortDirection
+ )
+ :
+ ipBufferHeader(apBufferHeader),
+ iLocalPortIndex(aLocalPortIndex),
+ iLocalPortDirection(aLocalPortDirection)
+ {
+ }
+
+
+#endif // OMXILINCONTEXTCALLBACKMANAGER_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilindexmanager.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,62 @@
+// 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 OMXILINDEXMANAGER_H
+#define OMXILINDEXMANAGER_H
+
+#include <e32base.h>
+
+// Forward declarations
+
+
+class COmxILIndexManager : public CBase
+ {
+
+public:
+
+ inline ~COmxILIndexManager();
+
+ inline void InsertParamIndexL(TUint aParamIndex);
+
+ inline TInt FindParamIndex(TUint aParamIndex) const;
+
+ inline void InsertConfigIndexL(TUint aConfigIndex);
+
+ inline TInt FindConfigIndex(TUint aConfigIndex) const;
+
+ inline RArray<TUint>& ManagedParamIndexes();
+
+ inline RArray<TUint>& ManagedConfigIndexes();
+protected:
+
+ inline COmxILIndexManager();
+
+protected:
+
+ RArray<TUint> iManagedOmxParamIndexes;
+ RArray<TUint> iManagedOmxConfigIndexes;
+
+ };
+
+#include "omxilindexmanager.inl"
+
+#endif // OMXILINDEXMANAGER_H
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilindexmanager.inl Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,86 @@
+// 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
+*/
+
+inline COmxILIndexManager::COmxILIndexManager()
+ {
+ }
+
+inline COmxILIndexManager::~COmxILIndexManager()
+ {
+ iManagedOmxParamIndexes.Close();
+ iManagedOmxConfigIndexes.Close();
+ }
+
+inline void
+COmxILIndexManager::InsertParamIndexL(TUint aParamIndex)
+ {
+ TInt err = iManagedOmxParamIndexes.InsertInOrder(aParamIndex);
+
+ // Note that index duplication is OK.
+ if (KErrNone != err && KErrAlreadyExists != err)
+ {
+ User::Leave(err);
+ }
+
+ }
+
+inline TInt
+COmxILIndexManager::FindParamIndex(TUint aParamIndex) const
+ {
+ return iManagedOmxParamIndexes.SpecificFindInOrder(
+ aParamIndex,
+ EArrayFindMode_First);
+ }
+
+inline void
+COmxILIndexManager::InsertConfigIndexL(TUint aConfigIndex)
+ {
+ TInt err = iManagedOmxConfigIndexes.InsertInOrder(aConfigIndex);
+
+ // Note that index duplication is OK.
+ if (KErrNone != err && KErrAlreadyExists != err)
+ {
+ User::Leave(err);
+ }
+
+ }
+
+inline TInt
+COmxILIndexManager::FindConfigIndex(TUint aConfigIndex) const
+ {
+ return iManagedOmxConfigIndexes.SpecificFindInOrder(
+ aConfigIndex,
+ EArrayFindMode_First);
+ }
+
+inline RArray<TUint>&
+COmxILIndexManager::ManagedParamIndexes()
+ {
+ return iManagedOmxParamIndexes;
+ }
+
+inline RArray<TUint>&
+COmxILIndexManager::ManagedConfigIndexes()
+ {
+ return iManagedOmxConfigIndexes;
+ }
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilotherport.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,381 @@
+// 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/omxilotherport.h>
+#include <openmax/il/common/omxilutil.h>
+#include "omxilotherportimpl.h"
+#include "log.h"
+
+EXPORT_C COmxILOtherPort::COmxILOtherPort()
+ {
+ }
+
+EXPORT_C void COmxILOtherPort::ConstructL(const TOmxILCommonPortData& aCommonPortData, const RArray<OMX_OTHER_FORMATTYPE>& aSupportedOtherFormats)
+ {
+ COmxILPort::ConstructL(aCommonPortData); //create COmxILPortImpl
+ ipOtherPortImpl=COmxILOtherPortImpl::NewL(aSupportedOtherFormats, aCommonPortData); //create COmxILOtherPortImpl
+ }
+
+EXPORT_C COmxILOtherPort::~COmxILOtherPort()
+ {
+ delete ipOtherPortImpl;
+ }
+
+EXPORT_C OMX_ERRORTYPE COmxILOtherPort::GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const
+ {
+ // Always collect local indexes from parent
+ OMX_ERRORTYPE omxRetValue = COmxILPort::GetLocalOmxParamIndexes(aIndexArray);
+ if (omxRetValue != OMX_ErrorNone)
+ {
+ return omxRetValue;
+ }
+
+ TInt err = aIndexArray.InsertInOrder(OMX_IndexParamOtherPortFormat);
+ // Note that index duplication is OK
+ if (err != KErrNone && err != KErrAlreadyExists)
+ {
+ return OMX_ErrorInsufficientResources;
+ }
+
+ return OMX_ErrorNone;
+ }
+
+EXPORT_C OMX_ERRORTYPE COmxILOtherPort::GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const
+ {
+ // Always collect local indexes from parent
+ return COmxILPort::GetLocalOmxConfigIndexes(aIndexArray);
+ }
+
+EXPORT_C OMX_ERRORTYPE COmxILOtherPort::GetParameter(OMX_INDEXTYPE aParamIndex,
+ TAny* apComponentParameterStructure) const
+ {
+ OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+ switch(aParamIndex)
+ {
+ case OMX_IndexParamOtherPortFormat:
+ {
+ __ASSERT_ALWAYS(ipOtherPortImpl, User::Panic(KOmxILOtherPortPanicCategory, 1));
+ omxRetValue = ipOtherPortImpl->GetParameter(aParamIndex, apComponentParameterStructure);
+ }
+ break;
+ default:
+ {
+ // Try the parent's indexes
+ omxRetValue = COmxILPort::GetParameter(aParamIndex, apComponentParameterStructure);
+ }
+ };
+
+ return omxRetValue;
+ }
+
+EXPORT_C OMX_ERRORTYPE COmxILOtherPort::SetParameter(OMX_INDEXTYPE aParamIndex,
+ const TAny* apComponentParameterStructure,
+ TBool& aUpdateProcessingFunction)
+ {
+ aUpdateProcessingFunction = EFalse;
+ OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+ switch(aParamIndex)
+ {
+ case OMX_IndexParamOtherPortFormat:
+ {
+ __ASSERT_ALWAYS(ipOtherPortImpl, User::Panic(KOmxILOtherPortPanicCategory, 1));
+ omxRetValue = ipOtherPortImpl->SetParameter(aParamIndex, apComponentParameterStructure, aUpdateProcessingFunction);
+ }
+ break;
+ default:
+ {
+ // Try the parent's indexes
+ omxRetValue = COmxILPort::SetParameter(aParamIndex,
+ apComponentParameterStructure,
+ aUpdateProcessingFunction);
+ }
+ };
+
+ return omxRetValue;
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILOtherPort::GetConfig(OMX_INDEXTYPE aConfigIndex,
+ TAny* apComponentConfigStructure) const
+ {
+ return COmxILPort::GetConfig(aConfigIndex,
+ apComponentConfigStructure);
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILOtherPort::SetConfig(OMX_INDEXTYPE aConfigIndex,
+ const TAny* apComponentConfigStructure,
+ TBool& aUpdateProcessingFunction)
+ {
+ return COmxILPort::SetConfig(aConfigIndex,
+ apComponentConfigStructure,
+ aUpdateProcessingFunction);
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILOtherPort::GetExtensionIndex(OMX_STRING aParameterName,
+ OMX_INDEXTYPE* apIndexType) const
+ {
+ return COmxILPort::GetExtensionIndex(aParameterName,
+ apIndexType);
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILOtherPort::PopulateBuffer(OMX_BUFFERHEADERTYPE** appBufferHdr,
+ const OMX_PTR apAppPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer,
+ TBool& aPortPopulationCompleted)
+ {
+ DEBUG_PRINTF2(_L8("COmxILOtherPort::PopulateBuffer : pBuffer [%X]"), apBuffer);
+ return COmxILPort::PopulateBuffer(appBufferHdr,
+ apAppPrivate,
+ aSizeBytes,
+ apBuffer,
+ aPortPopulationCompleted);
+ }
+
+
+EXPORT_C OMX_ERRORTYPE
+COmxILOtherPort::FreeBuffer(OMX_BUFFERHEADERTYPE* apBufferHeader,
+ TBool& aPortDepopulationCompleted)
+ {
+ DEBUG_PRINTF2(_L8("COmxILOtherPort::FreeBuffer : BUFFER [%X]"), apBufferHeader);
+ return COmxILPort::FreeBuffer(apBufferHeader, aPortDepopulationCompleted);
+ }
+
+
+EXPORT_C OMX_ERRORTYPE
+COmxILOtherPort::TunnelRequest(OMX_HANDLETYPE aTunneledComp,
+ OMX_U32 aTunneledPort,
+ OMX_TUNNELSETUPTYPE* apTunnelSetup)
+ {
+ DEBUG_PRINTF(_L8("COmxILOtherPort::TunnelRequest"));
+ return COmxILPort::TunnelRequest(aTunneledComp,
+ aTunneledPort,
+ apTunnelSetup);
+ }
+
+
+EXPORT_C OMX_ERRORTYPE
+COmxILOtherPort::PopulateTunnel(TBool& portPopulationCompleted)
+ {
+ DEBUG_PRINTF(_L8("COmxILOtherPort::PopulateTunnel"));
+ return COmxILPort::PopulateTunnel(portPopulationCompleted);
+ }
+
+
+EXPORT_C OMX_ERRORTYPE
+COmxILOtherPort::FreeTunnel(TBool& portDepopulationCompleted)
+ {
+ DEBUG_PRINTF(_L8("COmxILOtherPort::FreeTunnel"));
+ return COmxILPort::FreeTunnel(portDepopulationCompleted);
+ }
+
+EXPORT_C TBool
+COmxILOtherPort::SetBufferSent(OMX_BUFFERHEADERTYPE* apBufferHeader,
+ TBool& aBufferMarkedWithOwnMark)
+ {
+ DEBUG_PRINTF(_L8("COmxILOtherPort::SetBufferSent"));
+ return COmxILPort::SetBufferSent(apBufferHeader,
+ aBufferMarkedWithOwnMark);
+ }
+
+EXPORT_C TBool
+COmxILOtherPort::SetBufferReturned(OMX_BUFFERHEADERTYPE* apBufferHeader)
+ {
+ DEBUG_PRINTF(_L8("COmxILOtherPort::SetBufferReturned"));
+ return COmxILPort::SetBufferReturned(apBufferHeader);
+ }
+
+EXPORT_C void
+COmxILOtherPort::SetTransitionToEnabled()
+ {
+ DEBUG_PRINTF(_L8("COmxILOtherPort::SetTransitionToEnabled"));
+ return COmxILPort::SetTransitionToEnabled();
+ }
+
+EXPORT_C void
+COmxILOtherPort::SetTransitionToDisabled()
+ {
+ DEBUG_PRINTF(_L8("COmxILOtherPort::SetTransitionToDisabled"));
+ return COmxILPort::SetTransitionToDisabled();
+ }
+
+EXPORT_C void
+COmxILOtherPort::SetTransitionToDisabledCompleted()
+ {
+ DEBUG_PRINTF(_L8("COmxILOtherPort::SetTransitionToDisabledCompleted"));
+ return COmxILPort::SetTransitionToDisabledCompleted();
+ }
+
+EXPORT_C void
+COmxILOtherPort::SetTransitionToEnabledCompleted()
+ {
+ DEBUG_PRINTF(_L8("COmxILOtherPort::SetTransitionToEnabledCompleted"));
+ return COmxILPort::SetTransitionToEnabledCompleted();
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILOtherPort::StoreBufferMark(const OMX_MARKTYPE* apMark)
+ {
+ DEBUG_PRINTF(_L8("COmxILOtherPort::StoreBufferMark"));
+ return COmxILPort::StoreBufferMark(apMark);
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILOtherPort::SetComponentRoleDefaults(TUint aComponentRoleIndex)
+ {
+ DEBUG_PRINTF(_L8("COmxILOtherPort::SetComponentRoleDefaults"));
+
+ return COmxILPort::SetComponentRoleDefaults(aComponentRoleIndex);
+ }
+
+EXPORT_C TBool
+COmxILOtherPort::HasAllBuffersAtHome() const
+ {
+ return COmxILPort::HasAllBuffersAtHome();
+ }
+
+EXPORT_C TBool
+COmxILOtherPort::IsBufferAtHome(OMX_BUFFERHEADERTYPE* apBufferHeader) const
+ {
+ DEBUG_PRINTF2(_L8("COmxILOtherPort::IsBufferAtHome : [%X]"), apBufferHeader);
+ return COmxILPort::IsBufferAtHome(apBufferHeader);
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILOtherPort::DoPortReconfiguration(TUint aPortSettingsIndex,
+ const TDesC8& aPortSettings,
+ OMX_EVENTTYPE& aEventForILClient)
+ {
+ DEBUG_PRINTF(_L8("COmxILOtherPort::DoPortReconfiguration"));
+
+ return COmxILPort::DoPortReconfiguration(aPortSettingsIndex,
+ aPortSettings,
+ aEventForILClient);
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILOtherPort::DoBufferAllocation(OMX_U32 aSizeBytes,
+ OMX_U8*& apPortSpecificBuffer,
+ OMX_PTR& apPortPrivate,
+ OMX_PTR& apPlatformPrivate,
+ OMX_PTR apAppPrivate)
+ {
+ DEBUG_PRINTF2(_L8("COmxILOtherPort::DoBufferAllocation : aSizeBytes[%u]"), aSizeBytes);
+ return COmxILPort::DoBufferAllocation(aSizeBytes,
+ apPortSpecificBuffer,
+ apPortPrivate,
+ apPlatformPrivate,
+ apAppPrivate);
+ }
+
+EXPORT_C void
+COmxILOtherPort::DoBufferDeallocation(OMX_PTR apPortSpecificBuffer,
+ OMX_PTR apPortPrivate,
+ OMX_PTR apPlatformPrivate,
+ OMX_PTR apAppPrivate)
+ {
+ DEBUG_PRINTF(_L8("COmxILOtherPort::DoBufferDeallocation"));
+ return COmxILPort::DoBufferDeallocation(apPortSpecificBuffer,
+ apPortPrivate,
+ apPlatformPrivate,
+ apAppPrivate);
+ }
+
+
+EXPORT_C OMX_ERRORTYPE
+COmxILOtherPort::DoBufferWrapping(OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer,
+ OMX_PTR& apPortPrivate,
+ OMX_PTR& apPlatformPrivate,
+ OMX_PTR apAppPrivate)
+ {
+ DEBUG_PRINTF(_L8("COmxILOtherPort::DoBufferWrapping"));
+ return COmxILPort::DoBufferWrapping(aSizeBytes,
+ apBuffer,
+ apPortPrivate,
+ apPlatformPrivate,
+ apAppPrivate);
+ }
+
+EXPORT_C void
+COmxILOtherPort::DoBufferUnwrapping(OMX_PTR apBuffer,
+ OMX_PTR appPortPrivate,
+ OMX_PTR apPlatformPrivate,
+ OMX_PTR apAppPrivate)
+ {
+
+ DEBUG_PRINTF(_L8("COmxILOtherPort::DoBufferUnwrapping"));
+ return COmxILPort::DoBufferUnwrapping(apBuffer,
+ appPortPrivate,
+ apPlatformPrivate,
+ apAppPrivate);
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILOtherPort::DoOmxUseBuffer(OMX_HANDLETYPE aTunnelledComponent,
+ OMX_BUFFERHEADERTYPE** appBufferHdr,
+ OMX_U32 aTunnelledPortIndex,
+ OMX_PTR apPortPrivate,
+ OMX_PTR apPlatformPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer)
+ {
+
+ DEBUG_PRINTF(_L8("COmxILOtherPort::DoOmxUseBuffer"));
+ return COmxILPort::DoOmxUseBuffer(aTunnelledComponent,
+ appBufferHdr,
+ aTunnelledPortIndex,
+ apPortPrivate,
+ apPlatformPrivate,
+ aSizeBytes,
+ apBuffer);
+ }
+
+EXPORT_C RArray<OMX_OTHER_FORMATTYPE>& COmxILOtherPort::GetSupportedOtherFormats()
+ {
+ __ASSERT_ALWAYS(ipOtherPortImpl, User::Panic(KOmxILOtherPortPanicCategory, 1));
+ return ipOtherPortImpl->GetSupportedOtherFormats();
+ }
+EXPORT_C OMX_OTHER_PARAM_PORTFORMATTYPE& COmxILOtherPort::GetParamOtherPortFormat()
+ {
+ __ASSERT_ALWAYS(ipOtherPortImpl, User::Panic(KOmxILOtherPortPanicCategory, 1));
+ return ipOtherPortImpl->GetParamOtherPortFormat();
+ }
+EXPORT_C const RArray<OMX_OTHER_FORMATTYPE>& COmxILOtherPort::GetSupportedOtherFormats() const
+ {
+ __ASSERT_ALWAYS(ipOtherPortImpl, User::Panic(KOmxILOtherPortPanicCategory, 1));
+ return ipOtherPortImpl->GetSupportedOtherFormats();
+
+ }
+EXPORT_C const OMX_OTHER_PARAM_PORTFORMATTYPE& COmxILOtherPort::GetParamOtherPortFormat() const
+ {
+ __ASSERT_ALWAYS(ipOtherPortImpl, User::Panic(KOmxILOtherPortPanicCategory, 1));
+ return ipOtherPortImpl->GetParamOtherPortFormat();
+ }
+
+EXPORT_C
+TInt COmxILOtherPort::Extension_(TUint aExtensionId, TAny *&a0, TAny *a1)
+ {
+ return COmxILPort::Extension_(aExtensionId, a0, a1);
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilotherportimpl.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,168 @@
+// 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/omxilotherport.h>
+#include <openmax/il/common/omxilutil.h>
+#include "omxilotherportimpl.h"
+
+COmxILOtherPortImpl* COmxILOtherPortImpl::NewL(const RArray<OMX_OTHER_FORMATTYPE>& aSupportedOtherFormats, const TOmxILCommonPortData& aCommonPortData)
+ {
+ COmxILOtherPortImpl* self = new(ELeave) COmxILOtherPortImpl(aCommonPortData);
+ CleanupStack::PushL(self);
+ self->ConstructL(aSupportedOtherFormats);
+ CleanupStack::Pop();
+ return self;
+ }
+
+COmxILOtherPortImpl::COmxILOtherPortImpl(const TOmxILCommonPortData& aCommonPortData)
+ {
+ iParamOtherPortFormat.nSize = sizeof(OMX_OTHER_PARAM_PORTFORMATTYPE);
+ iParamOtherPortFormat.nVersion = aCommonPortData.iOmxVersion;
+ iParamOtherPortFormat.nPortIndex = aCommonPortData.iPortIndex;
+ iParamOtherPortFormat.nIndex = 0;
+ }
+
+void COmxILOtherPortImpl::ConstructL(const RArray<OMX_OTHER_FORMATTYPE>& aSupportedOtherFormats)
+ {
+ TUint count = aSupportedOtherFormats.Count();
+ for (TInt i = 0; i < count; i++)
+ {
+ iSupportedOtherFormats.AppendL(aSupportedOtherFormats[i]);
+ }
+ iParamOtherPortFormat.eFormat = count ? iSupportedOtherFormats[0] : OMX_OTHER_FormatMax;
+ }
+
+COmxILOtherPortImpl::~COmxILOtherPortImpl()
+ {
+ iSupportedOtherFormats.Close();
+ }
+
+OMX_ERRORTYPE COmxILOtherPortImpl::GetParameter(OMX_INDEXTYPE aParamIndex,
+ TAny* apComponentParameterStructure) const
+ {
+ switch(aParamIndex)
+ {
+ case OMX_IndexParamOtherPortFormat:
+ {
+ OMX_ERRORTYPE omxRetValue = TOmxILUtil::CheckOmxStructSizeAndVersion(apComponentParameterStructure,
+ sizeof(OMX_OTHER_PARAM_PORTFORMATTYPE));
+
+ if (omxRetValue != OMX_ErrorNone)
+ {
+ return omxRetValue;
+ }
+
+ OMX_OTHER_PARAM_PORTFORMATTYPE* pParamOtherPortFormat =
+ static_cast<OMX_OTHER_PARAM_PORTFORMATTYPE*>(apComponentParameterStructure);
+
+ if (pParamOtherPortFormat->nIndex >= iSupportedOtherFormats.Count())
+ {
+ return OMX_ErrorNoMore;
+ }
+
+ pParamOtherPortFormat->eFormat = iSupportedOtherFormats[pParamOtherPortFormat->nIndex];
+ }
+ break;
+ default:
+ __ASSERT_ALWAYS(EFalse, User::Panic(KOmxILOtherPortPanicCategory, 1));
+ };
+
+ return OMX_ErrorNone;
+ }
+
+OMX_ERRORTYPE COmxILOtherPortImpl::SetParameter(OMX_INDEXTYPE aParamIndex,
+ const TAny* apComponentParameterStructure,
+ TBool& aUpdateProcessingFunction)
+ {
+ aUpdateProcessingFunction = EFalse;
+
+ switch(aParamIndex)
+ {
+ case OMX_IndexParamOtherPortFormat:
+ {
+ OMX_ERRORTYPE omxRetValue = TOmxILUtil::CheckOmxStructSizeAndVersion(const_cast<OMX_PTR>(apComponentParameterStructure),
+ sizeof(OMX_OTHER_PARAM_PORTFORMATTYPE));
+
+ if (omxRetValue != OMX_ErrorNone)
+ {
+ return omxRetValue;
+ }
+
+ const OMX_OTHER_PARAM_PORTFORMATTYPE* pParamOtherPortFormat =
+ static_cast<const OMX_OTHER_PARAM_PORTFORMATTYPE*>(apComponentParameterStructure);
+
+ // Check in case the specified format is not actually supported by this
+ // port
+ OMX_OTHER_FORMATTYPE newFormatType = pParamOtherPortFormat->eFormat;
+
+ // OMX_OTHER_FormatVendorReserved is the last of the supported values as of
+ // v1.1.1
+ if (newFormatType > OMX_OTHER_FormatVendorReserved)
+ {
+ return OMX_ErrorBadParameter;
+ }
+
+ if (KErrNotFound == iSupportedOtherFormats.Find(newFormatType))
+ {
+ return OMX_ErrorUnsupportedSetting;
+ }
+
+ // Set the new default format, but check first that we are actually
+ // changing something...
+ if (iParamOtherPortFormat.eFormat != newFormatType)
+ {
+ iParamOtherPortFormat.eFormat = newFormatType;
+
+ // This is an indication to the PortManager that the processing
+ // function needs to get updated
+ //
+ aUpdateProcessingFunction = ETrue;
+ }
+ }
+ break;
+ default:
+ __ASSERT_ALWAYS(EFalse, User::Panic(KOmxILOtherPortPanicCategory, 1));
+ };
+
+ return OMX_ErrorNone;
+ }
+
+const RArray<OMX_OTHER_FORMATTYPE>& COmxILOtherPortImpl::GetSupportedOtherFormats() const
+ {
+ return iSupportedOtherFormats;
+ }
+
+const OMX_OTHER_PARAM_PORTFORMATTYPE& COmxILOtherPortImpl::GetParamOtherPortFormat() const
+ {
+ return iParamOtherPortFormat;
+ }
+
+RArray<OMX_OTHER_FORMATTYPE>& COmxILOtherPortImpl::GetSupportedOtherFormats()
+ {
+ return iSupportedOtherFormats;
+ }
+
+OMX_OTHER_PARAM_PORTFORMATTYPE& COmxILOtherPortImpl::GetParamOtherPortFormat()
+ {
+ return iParamOtherPortFormat;
+ }
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilotherportimpl.h Wed Aug 25 12:40:50 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
+ @internalTechnology
+*/
+
+#ifndef OMXILOTHERPORTIMPL_H
+#define OMXILOTHERPORTIMPL_H
+
+#include <openmax/il/common/omxilport.h>
+#include <e32base.h>
+#include <openmax/il/khronos/v1_x/OMX_Types.h>
+#include <openmax/il/khronos/v1_x/OMX_Core.h>
+#include <openmax/il/khronos/v1_x/OMX_Component.h>
+
+class COmxILOtherPortImpl : public CBase
+ {
+public:
+ static COmxILOtherPortImpl* NewL(const RArray<OMX_OTHER_FORMATTYPE>& aSupportedOtherFormats,
+ const TOmxILCommonPortData& aCommonPortData);
+ ~COmxILOtherPortImpl();
+ OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex,
+ TAny* apComponentParameterStructure) const;
+
+ OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex,
+ const TAny* apComponentParameterStructure,
+ TBool& aUpdateProcessingFunction);
+
+ const RArray<OMX_OTHER_FORMATTYPE>& GetSupportedOtherFormats() const;
+ const OMX_OTHER_PARAM_PORTFORMATTYPE& GetParamOtherPortFormat() const;
+ RArray<OMX_OTHER_FORMATTYPE>& GetSupportedOtherFormats();
+ OMX_OTHER_PARAM_PORTFORMATTYPE& GetParamOtherPortFormat();
+
+
+protected:
+ COmxILOtherPortImpl(const TOmxILCommonPortData& aCommonPortData);
+ void ConstructL(const RArray<OMX_OTHER_FORMATTYPE>& aSupportedOtherFormats);
+
+private:
+ // To indicate the supported formats
+ RArray<OMX_OTHER_FORMATTYPE> iSupportedOtherFormats;
+ OMX_OTHER_PARAM_PORTFORMATTYPE iParamOtherPortFormat;
+ };
+
+#endif // OMXILOTHERPORTIMPL_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilport.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,716 @@
+// Copyright (c) 2008-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 <mmf/server/mmfbuffer.h>
+#include <mmf/server/mmfdatabuffer.h>
+
+#include "log.h"
+#include "omxilportimpl.h"
+#include <openmax/il/common/omxilport.h>
+#include <openmax/il/common/omxilutil.h>
+
+const TInt COmxILPort::KBufferMarkPropagationPortNotNeeded;
+
+EXPORT_C
+TOmxILCommonPortData::TOmxILCommonPortData(
+ OMX_VERSIONTYPE aOmxVersion,
+ OMX_U32 aPortIndex,
+ OMX_DIRTYPE aDirection,
+ OMX_U32 aBufferCountMin,
+ OMX_U32 aBufferSizeMin,
+ OMX_PORTDOMAINTYPE aPortDomain,
+ OMX_BOOL aBuffersContiguous,
+ OMX_U32 aBufferAlignment,
+ OMX_BUFFERSUPPLIERTYPE aBufferSupplier,
+ OMX_U32 aBufferMarkPropagationPortIndex)
+ :
+ iOmxVersion(aOmxVersion),
+ iPortIndex(aPortIndex),
+ iDirection(aDirection),
+ iBufferCountMin(aBufferCountMin),
+ iBufferSizeMin(aBufferSizeMin),
+ iPortDomain(aPortDomain),
+ iBuffersContiguous(aBuffersContiguous),
+ iBufferAlignment(aBufferAlignment),
+ iBufferSupplier(aBufferSupplier),
+ iBufferMarkPropagationPortIndex(aBufferMarkPropagationPortIndex)
+ {
+ }
+
+
+COmxILPort::COmxILPort()
+ {
+ DEBUG_PRINTF(_L8("COmxILPort::COmxILPort"));
+ }
+
+
+COmxILPort::~COmxILPort()
+ {
+ DEBUG_PRINTF(_L8("COmxILPort::~COmxILPort"));
+ delete ipPortImpl;
+ }
+
+void COmxILPort::ConstructL(const TOmxILCommonPortData& aCommonPortData)
+ {
+ __ASSERT_DEBUG(aCommonPortData.iDirection == OMX_DirInput ||
+ aCommonPortData.iDirection == OMX_DirOutput,
+ User::Panic(KOmxILPortPanicCategory, 1));
+
+ // From Section 3.1.2.12.1 .
+ //
+ // nBufferCountMin : "The component shall define this non-zero default
+ // value."
+ //
+ // nBufferCountActual : "The component shall set a default value no less
+ // than nBufferCountMin for this field"
+ __ASSERT_DEBUG(aCommonPortData.iBufferCountMin > 0,
+ User::Panic(KOmxILPortPanicCategory, 1));
+
+ ipPortImpl=COmxILPortImpl::NewL(aCommonPortData, *this);
+ }
+
+OMX_ERRORTYPE
+COmxILPort::GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const
+ {
+ DEBUG_PRINTF(_L8("COmxILPort::GetLocalOmxParamIndexes"));
+
+ TInt err = aIndexArray.InsertInOrder(OMX_IndexParamPortDefinition);
+
+ // Note that index duplication is OK.
+ if (KErrNone == err || KErrAlreadyExists == err)
+ {
+ err = aIndexArray.InsertInOrder(OMX_IndexParamCompBufferSupplier);
+ }
+
+ if (KErrNone != err && KErrAlreadyExists != err)
+ {
+ return OMX_ErrorInsufficientResources;
+ }
+
+ return OMX_ErrorNone;
+
+ }
+
+OMX_ERRORTYPE
+COmxILPort::GetLocalOmxConfigIndexes(RArray<TUint>& /*aIndexArray*/) const
+ {
+ DEBUG_PRINTF(_L8("COmxILPort::GetLocalOmxConfigIndexes"));
+
+ return OMX_ErrorNone;
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILPort::GetParameter(OMX_INDEXTYPE aParamIndex,
+ TAny* apComponentParameterStructure) const
+ {
+ DEBUG_PRINTF(_L8("COmxILPort::GetParameter"));
+ __ASSERT_ALWAYS(ipPortImpl, User::Panic(KOmxILPortPanicCategory, 1));
+ return ipPortImpl->GetParameter(aParamIndex, apComponentParameterStructure);
+ }
+
+OMX_ERRORTYPE
+COmxILPort::SetParameter(OMX_INDEXTYPE aParamIndex,
+ const TAny* apComponentParameterStructure,
+ TBool& aUpdateProcessingFunction)
+ {
+ DEBUG_PRINTF(_L8("COmxILPort::SetParameter"));
+ __ASSERT_ALWAYS(ipPortImpl, User::Panic(KOmxILPortPanicCategory, 1));
+ return ipPortImpl->SetParameter(aParamIndex, apComponentParameterStructure, aUpdateProcessingFunction);
+ }
+
+
+OMX_ERRORTYPE
+COmxILPort::GetConfig(OMX_INDEXTYPE /*aConfigIndex*/,
+ TAny* /*apComponentConfigStructure*/) const
+ {
+ DEBUG_PRINTF(_L8("COmxILPort::GetConfig"));
+ return OMX_ErrorUnsupportedIndex;
+ }
+
+OMX_ERRORTYPE
+COmxILPort::SetConfig(OMX_INDEXTYPE /*aConfigIndex*/,
+ const TAny* /*apComponentConfigStructure*/,
+ TBool& /*aUpdateProcessingFunction*/)
+ {
+ DEBUG_PRINTF(_L8("COmxILPort::SetConfig"));
+ return OMX_ErrorUnsupportedIndex;
+ }
+
+OMX_ERRORTYPE
+COmxILPort::GetExtensionIndex(OMX_STRING /* aParameterName */,
+ OMX_INDEXTYPE* /* apIndexType */) const
+ {
+ // This method is intended to be overridden by the concrete ports when
+ // needed...
+ return OMX_ErrorUnsupportedIndex;
+ }
+
+OMX_ERRORTYPE
+COmxILPort::PopulateBuffer(OMX_BUFFERHEADERTYPE** appBufferHdr,
+ const OMX_PTR apAppPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer,
+ TBool& aPortPopulationCompleted)
+ {
+ DEBUG_PRINTF2(_L8("COmxILPort::PopulateBuffer : pBuffer [%X]"), apBuffer);
+ __ASSERT_ALWAYS(ipPortImpl, User::Panic(KOmxILPortPanicCategory, 1));
+ return ipPortImpl->PopulateBuffer(appBufferHdr, apAppPrivate, aSizeBytes, apBuffer, aPortPopulationCompleted);
+ }
+
+
+OMX_ERRORTYPE
+COmxILPort::FreeBuffer(OMX_BUFFERHEADERTYPE* apBufferHeader,
+ TBool& aPortDepopulationCompleted)
+ {
+ DEBUG_PRINTF2(_L8("COmxILPort::FreeBuffer : BUFFER [%X]"), apBufferHeader);
+ __ASSERT_ALWAYS(ipPortImpl, User::Panic(KOmxILPortPanicCategory, 1));
+ return ipPortImpl->FreeBuffer(apBufferHeader, aPortDepopulationCompleted);
+ }
+
+
+OMX_ERRORTYPE
+COmxILPort::TunnelRequest(OMX_HANDLETYPE aTunneledComp,
+ OMX_U32 aTunneledPort,
+ OMX_TUNNELSETUPTYPE* apTunnelSetup)
+ {
+ DEBUG_PRINTF(_L8("COmxILPort::TunnelRequest"));
+ __ASSERT_ALWAYS(ipPortImpl, User::Panic(KOmxILPortPanicCategory, 1));
+ return ipPortImpl->TunnelRequest(aTunneledComp, aTunneledPort, apTunnelSetup);
+ }
+
+
+OMX_ERRORTYPE
+COmxILPort::PopulateTunnel(TBool& portPopulationCompleted)
+ {
+ DEBUG_PRINTF(_L8("COmxILPort::PopulateTunnel"));
+ __ASSERT_ALWAYS(ipPortImpl, User::Panic(KOmxILPortPanicCategory, 1));
+ return ipPortImpl->PopulateTunnel(portPopulationCompleted);
+ }
+
+
+OMX_ERRORTYPE
+COmxILPort::FreeTunnel(TBool& portDepopulationCompleted)
+ {
+ DEBUG_PRINTF(_L8("COmxILPort::FreeTunnel"));
+ __ASSERT_ALWAYS(ipPortImpl, User::Panic(KOmxILPortPanicCategory, 1));
+ return ipPortImpl->FreeTunnel(portDepopulationCompleted);
+ }
+
+
+
+TBool
+COmxILPort::SetBufferSent(OMX_BUFFERHEADERTYPE* apBufferHeader,
+ TBool& aBufferMarkedWithOwnMark)
+ {
+ DEBUG_PRINTF(_L8("COmxILPort::SetBufferSent"));
+ __ASSERT_DEBUG(apBufferHeader, User::Panic(KOmxILPortPanicCategory, 1));
+ __ASSERT_ALWAYS(ipPortImpl, User::Panic(KOmxILPortPanicCategory, 1));
+ return ipPortImpl->SetBufferSent(apBufferHeader, aBufferMarkedWithOwnMark);
+ }
+
+TBool
+COmxILPort::SetBufferReturned(OMX_BUFFERHEADERTYPE* apBufferHeader)
+ {
+ DEBUG_PRINTF(_L8("COmxILPort::SetBufferReturned"));
+
+ __ASSERT_DEBUG(apBufferHeader, User::Panic(KOmxILPortPanicCategory, 1));
+ __ASSERT_ALWAYS(ipPortImpl, User::Panic(KOmxILPortPanicCategory, 1));
+ return ipPortImpl->SetBufferReturned(apBufferHeader);
+ }
+
+void
+COmxILPort::SetTransitionToEnabled()
+ {
+ DEBUG_PRINTF(_L8("COmxILPort::SetTransitionToEnabled"));
+ __ASSERT_ALWAYS(ipPortImpl, User::Panic(KOmxILPortPanicCategory, 1));
+ return ipPortImpl->SetTransitionToEnabled();
+ }
+
+void
+COmxILPort::SetTransitionToDisabled()
+ {
+ DEBUG_PRINTF(_L8("COmxILPort::SetTransitionToDisabled"));
+ __ASSERT_ALWAYS(ipPortImpl, User::Panic(KOmxILPortPanicCategory, 1));
+ return ipPortImpl->SetTransitionToDisabled();
+ }
+
+void
+COmxILPort::SetTransitionToDisabledCompleted()
+ {
+ DEBUG_PRINTF(_L8("COmxILPort::SetTransitionToDisabledCompleted"));
+ __ASSERT_ALWAYS(ipPortImpl, User::Panic(KOmxILPortPanicCategory, 1));
+ return ipPortImpl->SetTransitionToDisabledCompleted();
+ }
+
+void
+COmxILPort::SetTransitionToEnabledCompleted()
+ {
+ DEBUG_PRINTF(_L8("COmxILPort::SetTransitionToEnabledCompleted"));
+ __ASSERT_ALWAYS(ipPortImpl, User::Panic(KOmxILPortPanicCategory, 1));
+ return ipPortImpl->SetTransitionToEnabledCompleted();
+ }
+
+OMX_ERRORTYPE
+COmxILPort::StoreBufferMark(const OMX_MARKTYPE* apMark)
+ {
+ DEBUG_PRINTF(_L8("COmxILPort::StoreBufferMark"));
+ __ASSERT_ALWAYS(ipPortImpl, User::Panic(KOmxILPortPanicCategory, 1));
+ return ipPortImpl->StoreBufferMark(apMark);
+ }
+
+
+/**
+ This utility method may be called from the most derived port
+ class' destructor to delete any buffer header and or buffer that may remain
+ allocated in the port. This typically happens when the component is unloaded
+ without being properly transitioned from OMX_StateIdle to OMX_StateLoaded.
+
+ */
+EXPORT_C void
+COmxILPort::CleanUpPort()
+ {
+ __ASSERT_ALWAYS(ipPortImpl, User::Panic(KOmxILPortPanicCategory, 1));
+ return ipPortImpl->CleanUpPort();
+ }
+
+/**
+ This is to be overriden by concrete ports that either support more than
+ one role or that want to let the IL Client to reset the component to
+ some default state...
+
+ @param aComponentRoleIndex The index of the role that is to be assumed by
+ the component.
+
+ @return OMX_ERRORTYPE
+ */
+OMX_ERRORTYPE
+COmxILPort::SetComponentRoleDefaults(TUint /*aComponentRoleIndex*/)
+ {
+ DEBUG_PRINTF(_L8("COmxILPort::SetComponentRoleDefaults"));
+
+ return OMX_ErrorNotImplemented;
+ }
+
+/**
+ This is to be overriden by concrete ports that either support more than one
+ role or that want to let the IL Client to reset the component to some
+ default state...
+
+ @param aPortSettingsIndex An implementation-specific identifier that the
+ implementation associates to the setting(s) that need(s) updating in the
+ port.
+
+ @param aPortSettings A buffer descriptor that contains an
+ implementation-specific structure with the new setting(s) that need to
+ be updated in the port.
+
+ @param [output] aEventForILClient An event that the port may choose to
+ deliver to the IL Client. This should be one of OMX_EventPortSettingsChanged
+ or OMX_EventPortFormatDetected. Use OMX_EventMax if no event need to be
+ sent.
+ */
+OMX_ERRORTYPE
+COmxILPort::DoPortReconfiguration(TUint /* aPortSettingsIndex */,
+ const TDesC8& /* aPortSettings */,
+ OMX_EVENTTYPE& aEventForILClient)
+ {
+ DEBUG_PRINTF(_L8("COmxILPort::DoPortReconfiguration"));
+
+ // This means no need to notify the IL Client...
+ aEventForILClient = OMX_EventMax;
+
+ return OMX_ErrorNotImplemented;
+ }
+
+OMX_ERRORTYPE
+COmxILPort::StoreBufferMark(OMX_HANDLETYPE& ipMarkTargetComponent,
+ OMX_PTR& ipMarkData)
+ {
+ DEBUG_PRINTF(_L8("COmxILPort::StoreBufferMark"));
+ __ASSERT_ALWAYS(ipPortImpl, User::Panic(KOmxILPortPanicCategory, 1));
+ return ipPortImpl->StoreBufferMark(ipMarkTargetComponent, ipMarkData);
+ }
+
+TBool
+COmxILPort::HasAllBuffersAtHome() const
+ {
+ __ASSERT_ALWAYS(ipPortImpl, User::Panic(KOmxILPortPanicCategory, 1));
+ __ASSERT_ALWAYS(ipPortImpl->IsTunnelledAndBufferSupplier(),
+ User::Panic(KOmxILPortPanicCategory, 1));
+ return ipPortImpl->HasAllBuffersAtHome();
+ }
+
+TBool
+COmxILPort::IsBufferAtHome(OMX_BUFFERHEADERTYPE* apBufferHeader) const
+ {
+ DEBUG_PRINTF2(_L8("COmxILPort::IsBufferAtHome : [%X]"), apBufferHeader);
+ __ASSERT_ALWAYS(ipPortImpl, User::Panic(KOmxILPortPanicCategory, 1));
+ return ipPortImpl->IsBufferAtHome(apBufferHeader);
+ }
+
+
+/**
+ This method provides a mechanism for ports to place the port-specific
+ buffer allocation logic (typically used in an OMX_AllocateBuffer
+ scenario).
+
+ @param aSizeBytes The size in bytes of the buffer to be allocated.
+
+ @param [OUT] apPortSpecificBuffer A pointer to the memory area allocated by
+ the port.
+
+ @param [OUT] apPortPrivate A pointer that refers to an optional
+ port-specific structure.
+
+ @apPlatformPrivate[OUT] A pointer to an optional platform-specific
+ structure.
+
+ @param apAppPrivate A pointer that refers to a buffer supplier-specific
+ structure.
+
+ @return OMX_ERRORTYPE
+*/
+OMX_ERRORTYPE
+COmxILPort::DoBufferAllocation(OMX_U32 aSizeBytes,
+ OMX_U8*& apPortSpecificBuffer,
+ OMX_PTR& apPortPrivate,
+ OMX_PTR& /* apPlatformPrivate */,
+ OMX_PTR /* apAppPrivate = 0 */)
+ {
+ DEBUG_PRINTF2(_L8("COmxILPort::DoBufferAllocation : aSizeBytes[%u]"), aSizeBytes);
+
+ __ASSERT_DEBUG(aSizeBytes > 0, User::Panic(KOmxILPortPanicCategory, 1));
+
+ CMMFDescriptorBuffer* pDescBuffer = 0;
+ TRAPD(allocRes, pDescBuffer = CMMFDescriptorBuffer::NewL(aSizeBytes));
+ if (KErrNone != allocRes)
+ {
+ return OMX_ErrorInsufficientResources;
+ }
+
+ apPortSpecificBuffer = const_cast<TUint8*>(pDescBuffer->Data().Ptr());
+ apPortPrivate = static_cast<CMMFBuffer*>(pDescBuffer);
+
+ return OMX_ErrorNone;
+
+ }
+
+/**
+ This method provides a mechanism for ports to place the port-specific
+ buffer deallocation logic (typically used in an OMX_FreeBuffer
+ scenario).
+
+ @param apPortSpecificBuffer A pointer to the memory area to be deallocated
+ by the port.
+
+ @param apPortPrivate A pointer that refers to a port-specific structure.
+
+ @param apPlatformPrivate A pointer to an optional platform-specific
+ structure.
+
+ @param apAppPrivate A pointer that refers to a buffer supplier-specific
+ structure.
+
+*/
+void
+COmxILPort::DoBufferDeallocation(OMX_PTR /*apPortSpecificBuffer */,
+ OMX_PTR apPortPrivate,
+ OMX_PTR /* apPlatformPrivate */,
+ OMX_PTR /* apAppPrivate = 0 */)
+ {
+ DEBUG_PRINTF(_L8("COmxILPort::DoBufferDeallocation"));
+
+ __ASSERT_DEBUG(apPortPrivate, User::Panic(KOmxILPortPanicCategory, 1));
+
+ delete reinterpret_cast<CMMFBuffer*>(apPortPrivate);
+
+ }
+
+/**
+ This method provides a mechanism for ports to place the port-specific buffer
+ wrapping logic (typically used in an OMX_UseBuffer scenario).
+
+ @param aSizeBytes The size in bytes of the buffer to be wrapped.
+
+ @param apBuffer A pointer received from the IL Client or another
+ component that references the allocated memory area .
+
+ @param [OUT] apPortPrivate A pointer that refers to a port-specific
+ structure.
+
+ @param [OUT] apPlatformPrivate A pointer to an optional platform-specific
+ structure.
+
+ @param [OUT] apAppPrivate A pointer that refers to a buffer
+ supplier-specific structure.
+
+ @return OMX_ERRORTYPE
+*/
+OMX_ERRORTYPE
+COmxILPort::DoBufferWrapping(OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer,
+ OMX_PTR& apPortPrivate,
+ OMX_PTR& /* apPlatformPrivate */,
+ OMX_PTR /* apAppPrivate = 0 */)
+ {
+ DEBUG_PRINTF(_L8("COmxILPort::DoBufferWrapping"));
+
+ __ASSERT_DEBUG(aSizeBytes > 0 && apBuffer,
+ User::Panic(KOmxILPortPanicCategory, 1));
+
+ CMMFBuffer* pMmfBuffer = 0;
+ TPtr8 ptr(apBuffer, aSizeBytes, aSizeBytes);
+ TRAPD(allocRes, pMmfBuffer = CMMFPtrBuffer::NewL(ptr));
+ if (KErrNone != allocRes)
+ {
+ return OMX_ErrorInsufficientResources;
+ }
+
+ apPortPrivate = pMmfBuffer;
+
+ return OMX_ErrorNone;
+
+ }
+
+/**
+ This method provides a mechanism for ports to place the port-specific buffer
+ unwrapping logic (typically used in an OMX_FreeBuffer scenario).
+
+ @param apPortSpecificBuffer A pointer to the allocated memory area.
+
+ @param apPortPrivate A pointer that refers to a port-specific structure.
+
+ @param apPlatformPrivate A pointer to an optional platform-specific
+ structure.
+
+ @param apAppPrivate A pointer that refers to a buffer supplier-specific
+ structure.
+
+*/
+void
+COmxILPort::DoBufferUnwrapping(OMX_PTR /* apBuffer*/,
+ OMX_PTR appPortPrivate,
+ OMX_PTR /* apPlatformPrivate */,
+ OMX_PTR /* apAppPrivate = 0 */)
+ {
+
+ DEBUG_PRINTF(_L8("COmxILPort::DoBufferUnwrapping"));
+
+ __ASSERT_DEBUG(appPortPrivate, User::Panic(KOmxILPortPanicCategory, 1));
+
+ delete reinterpret_cast<CMMFBuffer*>(appPortPrivate);
+
+ }
+
+/**
+ This method gets called during tunnelled buffer allocation (i.e.,
+ PopulateTunnel). This is to allow component implementations to override this
+ default implementation in a way that the pAppPrivate pointer parameter of
+ OMX_UseBuffer can be used to convey pPortPrivate or pPlatformPrivate to the
+ tunnelled component.
+
+ @param aTunnelledComponent Handle to the tunnelled component
+
+ @param [OUT] appBufferHdr The buffer header that will be allocated by the
+ tunnelled component
+
+ @param aTunnelledPortIndex The index of the tunnelled port
+
+ @param apPortPrivate pPortPrivate pointer as returned by DoBufferAllocation
+
+ @param apPlatformPrivate pPlatformPrivate pointer as returned by
+ DoBufferAllocation
+
+ @aSizeBytes The size in bytes of the to be allocated buffer
+
+ @apBuffer A pointer to the allocated buffer
+
+ @return OMX_ERRORTYPE
+
+*/
+OMX_ERRORTYPE
+COmxILPort::DoOmxUseBuffer(OMX_HANDLETYPE aTunnelledComponent,
+ OMX_BUFFERHEADERTYPE** appBufferHdr,
+ OMX_U32 aTunnelledPortIndex,
+ OMX_PTR /* apPortPrivate */,
+ OMX_PTR /* apPlatformPrivate */,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer)
+ {
+
+ DEBUG_PRINTF(_L8("COmxILPort::DoOmxUseBuffer"));
+
+ return OMX_UseBuffer(
+ aTunnelledComponent,
+ appBufferHdr,
+ aTunnelledPortIndex,
+ 0,
+ aSizeBytes,
+ apBuffer);
+
+ }
+
+
+OMX_DIRTYPE
+COmxILPort::Direction() const
+ {
+ __ASSERT_ALWAYS(ipPortImpl, User::Panic(KOmxILPortPanicCategory, 1));
+ return ipPortImpl->Direction();
+ }
+
+EXPORT_C TBool
+COmxILPort::IsEnabled() const
+ {
+ __ASSERT_ALWAYS(ipPortImpl, User::Panic(KOmxILPortPanicCategory, 1));
+ return ipPortImpl->IsEnabled();
+ }
+
+TBool
+COmxILPort::IsPopulated() const
+ {
+ __ASSERT_ALWAYS(ipPortImpl, User::Panic(KOmxILPortPanicCategory, 1));
+ return ipPortImpl->IsPopulated();
+ }
+
+TBool
+COmxILPort::IsDePopulated() const
+ {
+ __ASSERT_ALWAYS(ipPortImpl, User::Panic(KOmxILPortPanicCategory, 1));
+ return ipPortImpl->IsDePopulated();
+ }
+
+TBool
+COmxILPort::IsTunnelled() const
+ {
+ __ASSERT_ALWAYS(ipPortImpl, User::Panic(KOmxILPortPanicCategory, 1));
+ return ipPortImpl->IsTunnelled();
+ }
+
+TBool
+COmxILPort::IsTunnelledAndBufferSupplier() const
+ {
+ __ASSERT_ALWAYS(ipPortImpl, User::Panic(KOmxILPortPanicCategory, 1));
+ return ipPortImpl->IsTunnelledAndBufferSupplier();
+ }
+
+TBool
+COmxILPort::IsTransitioningToEnabled() const
+ {
+ __ASSERT_ALWAYS(ipPortImpl, User::Panic(KOmxILPortPanicCategory, 1));
+ return ipPortImpl->IsTransitioningToEnabled();
+ }
+
+TBool
+COmxILPort::IsTransitioningToDisabled() const
+ {
+ __ASSERT_ALWAYS(ipPortImpl, User::Panic(KOmxILPortPanicCategory, 1));
+ return ipPortImpl->IsTransitioningToDisabled();
+ }
+
+EXPORT_C OMX_U32
+COmxILPort::Index() const
+ {
+ __ASSERT_ALWAYS(ipPortImpl, User::Panic(KOmxILPortPanicCategory, 1));
+ return ipPortImpl->Index();
+ }
+
+OMX_PORTDOMAINTYPE
+COmxILPort::Domain() const
+ {
+ __ASSERT_ALWAYS(ipPortImpl, User::Panic(KOmxILPortPanicCategory, 1));
+ return ipPortImpl->Domain();
+ }
+
+OMX_U32
+COmxILPort::Count() const
+ {
+ __ASSERT_ALWAYS(ipPortImpl, User::Panic(KOmxILPortPanicCategory, 1));
+ return ipPortImpl->Count();
+ }
+
+OMX_BUFFERHEADERTYPE* const&
+COmxILPort::operator[](TInt anIndex) const
+ {
+ return this->operator[](anIndex);
+ }
+
+OMX_BUFFERHEADERTYPE*&
+COmxILPort::operator[](TInt anIndex)
+ {
+ __ASSERT_ALWAYS(ipPortImpl, User::Panic(KOmxILPortPanicCategory, 1));
+ return ipPortImpl->operator[](anIndex);
+ }
+
+
+OMX_U32
+COmxILPort::BufferMarkPropagationPort() const
+ {
+ __ASSERT_ALWAYS(ipPortImpl, User::Panic(KOmxILPortPanicCategory, 1));
+ return ipPortImpl->BufferMarkPropagationPort();
+ }
+
+EXPORT_C const OMX_PARAM_PORTDEFINITIONTYPE& COmxILPort::GetParamPortDefinition() const
+ {
+ __ASSERT_ALWAYS(ipPortImpl, User::Panic(KOmxILPortPanicCategory, 1));
+ return ipPortImpl->GetParamPortDefinition();
+ }
+
+EXPORT_C const OMX_HANDLETYPE& COmxILPort::GetTunnelledComponent() const
+ {
+ __ASSERT_ALWAYS(ipPortImpl, User::Panic(KOmxILPortPanicCategory, 1));
+ return ipPortImpl->GetTunnelledComponent();
+ }
+
+EXPORT_C const OMX_U32& COmxILPort::GetTunnelledPort() const
+ {
+ __ASSERT_ALWAYS(ipPortImpl, User::Panic(KOmxILPortPanicCategory, 1));
+ return ipPortImpl->GetTunnelledPort();
+ }
+
+EXPORT_C OMX_PARAM_PORTDEFINITIONTYPE& COmxILPort::GetParamPortDefinition()
+ {
+ __ASSERT_ALWAYS(ipPortImpl, User::Panic(KOmxILPortPanicCategory, 1));
+ return ipPortImpl->GetParamPortDefinition();
+ }
+
+EXPORT_C OMX_HANDLETYPE& COmxILPort::GetTunnelledComponent()
+ {
+ __ASSERT_ALWAYS(ipPortImpl, User::Panic(KOmxILPortPanicCategory, 1));
+ return ipPortImpl->GetTunnelledComponent();
+ }
+
+EXPORT_C OMX_U32& COmxILPort::GetTunnelledPort()
+ {
+ __ASSERT_ALWAYS(ipPortImpl, User::Panic(KOmxILPortPanicCategory, 1));
+ return ipPortImpl->GetTunnelledPort();
+ }
+
+EXPORT_C
+TInt COmxILPort::Extension_(TUint aExtensionId, TAny *&a0, TAny *a1)
+ {
+ return CBase::Extension_(aExtensionId, a0, a1);
+ }
+
+
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilportimpl.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,1142 @@
+// 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
+ @internalComponent
+*/
+
+#include <mmf/server/mmfbuffer.h>
+#include <mmf/server/mmfdatabuffer.h>
+
+#include "log.h"
+#include "omxilportimpl.h"
+#include <openmax/il/common/omxilport.h>
+#include <openmax/il/common/omxilutil.h>
+
+const TInt COmxILPortImpl::KMaxBufferMarksQueueSize;
+
+COmxILPortImpl* COmxILPortImpl::NewL(const TOmxILCommonPortData& aCommonPortData, COmxILPort& aPort)
+ {
+ COmxILPortImpl* self = new (ELeave) COmxILPortImpl(aCommonPortData, aPort);
+ return self;
+ }
+
+COmxILPortImpl::COmxILPortImpl(const TOmxILCommonPortData& aCommonPortData, COmxILPort& aPort)
+ :
+ iTunnelledComponent(0),
+ iTunnelledPort(0),
+ iBufferHeaders(),
+ iBufferMarks(_FOFF(TBufferMarkInfo, iLink)),
+ iTransitionState(EPortNotTransitioning),
+ iBufferMarkPropagationPortIndex(aCommonPortData.iBufferMarkPropagationPortIndex),
+ aFirstUseBufferHasBeenReceived(OMX_FALSE),
+ iOmxILPort(aPort)
+ {
+ DEBUG_PRINTF(_L8("COmxILPortImpl::COmxILPortImpl"));
+
+ // Filll in OMX_PARAM_PORTDEFINITIONTYPE
+ iParamPortDefinition.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE);
+ iParamPortDefinition.nVersion = aCommonPortData.iOmxVersion;
+ iParamPortDefinition.nPortIndex = aCommonPortData.iPortIndex;
+ iParamPortDefinition.eDir = aCommonPortData.iDirection;
+ iParamPortDefinition.nBufferCountActual = aCommonPortData.iBufferCountMin;
+ iParamPortDefinition.nBufferCountMin = aCommonPortData.iBufferCountMin;
+ iParamPortDefinition.nBufferSize = aCommonPortData.iBufferSizeMin;
+ iParamPortDefinition.bEnabled = OMX_TRUE;
+ iParamPortDefinition.bPopulated = OMX_FALSE;
+ iParamPortDefinition.eDomain = aCommonPortData.iPortDomain;
+ // NOTE: iParamPortDefinition.format must be finished up by concrete ports
+ iParamPortDefinition.bBuffersContiguous = aCommonPortData.iBuffersContiguous;
+ iParamPortDefinition.nBufferAlignment = aCommonPortData.iBufferAlignment;
+
+ // Fill in OMX_PARAM_BUFFERSUPPLIERTYPE
+ iParamCompBufferSupplier.nSize = sizeof(OMX_PARAM_BUFFERSUPPLIERTYPE);
+ iParamCompBufferSupplier.nVersion = aCommonPortData.iOmxVersion;
+ iParamCompBufferSupplier.nPortIndex = aCommonPortData.iPortIndex;
+ iParamCompBufferSupplier.eBufferSupplier = aCommonPortData.iBufferSupplier;
+
+ }
+
+COmxILPortImpl::~COmxILPortImpl()
+ {
+ DEBUG_PRINTF(_L8("COmxILPortImpl::~COmxILPortImpl"));
+
+#ifdef _DEBUG
+ const TInt headerCount = iBufferHeaders.Count();
+ if (headerCount > 0)
+ {
+ DEBUG_PRINTF(_L8("COmxILPortImpl::~COmxILPortImpl :: ------------------------------- WARNING --------------------------------------- "));
+ DEBUG_PRINTF2(_L8("COmxILPortImpl::~COmxILPortImpl :: [%d] Buffer headers still exist"), headerCount);
+ DEBUG_PRINTF(_L8("COmxILPortImpl::~COmxILPortImpl :: CleanUpPort() may be used from the most derived port class to delete them"));
+ DEBUG_PRINTF(_L8("COmxILPortImpl::~COmxILPortImpl :: ------------------------------- WARNING --------------------------------------- "));
+ }
+#endif
+
+ iBufferHeaders.Close();
+ iBufferMarks.ResetAndDestroy();
+
+ }
+
+OMX_ERRORTYPE
+COmxILPortImpl::GetParameter(OMX_INDEXTYPE aParamIndex,
+ TAny* apComponentParameterStructure) const
+ {
+ DEBUG_PRINTF(_L8("COmxILPortImpl::GetParameter"));
+
+ OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+ switch(aParamIndex)
+ {
+ case OMX_IndexParamPortDefinition:
+ {
+ if (OMX_ErrorNone != (omxRetValue =
+ TOmxILUtil::CheckOmxStructSizeAndVersion(
+ apComponentParameterStructure,
+ sizeof(OMX_PARAM_PORTDEFINITIONTYPE))))
+ {
+ return omxRetValue;
+ }
+
+ OMX_PARAM_PORTDEFINITIONTYPE* pPortDefinition
+ = static_cast<OMX_PARAM_PORTDEFINITIONTYPE*>(
+ apComponentParameterStructure);
+
+ *pPortDefinition = iParamPortDefinition;
+ }
+ break;
+
+ case OMX_IndexParamCompBufferSupplier:
+ {
+ if (OMX_ErrorNone != (omxRetValue =
+ TOmxILUtil::CheckOmxStructSizeAndVersion(
+ apComponentParameterStructure,
+ sizeof(OMX_PARAM_BUFFERSUPPLIERTYPE))))
+ {
+ return omxRetValue;
+ }
+
+ OMX_PARAM_BUFFERSUPPLIERTYPE* pBufferSupplier
+ = static_cast<OMX_PARAM_BUFFERSUPPLIERTYPE*>(
+ apComponentParameterStructure);
+
+ pBufferSupplier->eBufferSupplier =
+ iParamCompBufferSupplier.eBufferSupplier;
+ }
+ break;
+
+ default:
+ {
+ return OMX_ErrorUnsupportedIndex;
+ }
+ };
+
+ return OMX_ErrorNone;
+
+ }
+
+OMX_ERRORTYPE
+COmxILPortImpl::SetParameter(OMX_INDEXTYPE aParamIndex,
+ const TAny* apComponentParameterStructure,
+ TBool& aUpdateProcessingFunction)
+ {
+ DEBUG_PRINTF(_L8("COmxILPortImpl::SetParameter"));
+
+ aUpdateProcessingFunction = EFalse;
+
+
+ if (OMX_TRUE == aFirstUseBufferHasBeenReceived)
+ {
+ DEBUG_PRINTF2(_L8("COmxILPortImpl::SetParameter : PORT [%u] WARNING : port population already initiated, returning OMX_ErrorIncorrectStateOperation"), Index());
+ // SetParameter is not allowed after the first OMX_UseBuffer has been
+ // received in the port, that is, the population of the port has
+ // already been initiated...
+ return OMX_ErrorIncorrectStateOperation;
+ }
+
+ OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+
+ switch(aParamIndex)
+ {
+ case OMX_IndexParamPortDefinition:
+ {
+ if (OMX_ErrorNone != (omxRetValue =
+ TOmxILUtil::CheckOmxStructSizeAndVersion(
+ const_cast<OMX_PTR>(apComponentParameterStructure),
+ sizeof(OMX_PARAM_PORTDEFINITIONTYPE))))
+ {
+ return omxRetValue;
+ }
+
+ const OMX_PARAM_PORTDEFINITIONTYPE* pPortDefinition
+ = static_cast<const OMX_PARAM_PORTDEFINITIONTYPE*>(
+ apComponentParameterStructure);
+
+ // Port Format must be set by the concrete port...
+ if (OMX_ErrorNone !=
+ (omxRetValue =
+ iOmxILPort.SetFormatInPortDefinition(*pPortDefinition,
+ aUpdateProcessingFunction)))
+ {
+ return omxRetValue;
+ }
+
+ // Set here only the additional read-write parameters of
+ // OMX_PARAM_PORTDEFINITIONTYPE
+ if (iParamPortDefinition.nBufferCountActual !=
+ pPortDefinition->nBufferCountActual)
+ {
+ if (pPortDefinition->nBufferCountActual <
+ iParamPortDefinition.nBufferCountMin)
+ {
+ return OMX_ErrorBadParameter;
+ }
+ DEBUG_PRINTF3(_L8("COmxILPortImpl::SetParameter : old.nBufferCountActual [%u] new.nBufferCountActual [%u]"),
+ iParamPortDefinition.nBufferCountActual, pPortDefinition->nBufferCountActual);
+ iParamPortDefinition.nBufferCountActual =
+ pPortDefinition->nBufferCountActual;
+ aUpdateProcessingFunction = ETrue;
+ }
+
+ }
+ break;
+
+ case OMX_IndexParamCompBufferSupplier:
+ {
+ if (OMX_ErrorNone != (omxRetValue =
+ TOmxILUtil::CheckOmxStructSizeAndVersion(
+ const_cast<OMX_PTR>(apComponentParameterStructure),
+ sizeof(OMX_PARAM_BUFFERSUPPLIERTYPE))))
+ {
+ return omxRetValue;
+ }
+
+ const OMX_PARAM_BUFFERSUPPLIERTYPE* pBufferSupplier
+ = static_cast<const OMX_PARAM_BUFFERSUPPLIERTYPE*>(
+ apComponentParameterStructure);
+
+ // OMX_BufferSupplyOutput is the last of the supported values as of
+ // v1.1.1
+ if (iParamCompBufferSupplier.eBufferSupplier > OMX_BufferSupplyOutput)
+ {
+ return OMX_ErrorBadParameter;
+ }
+
+ if (iParamCompBufferSupplier.eBufferSupplier !=
+ pBufferSupplier->eBufferSupplier)
+ {
+ // The component providing the input port is responsible for
+ // signalling the tunnelled component about the buffer supplier
+ // override...
+ if (iTunnelledComponent &&
+ iParamPortDefinition.eDir == OMX_DirInput)
+ {
+ OMX_PARAM_BUFFERSUPPLIERTYPE bufferSupplierType;
+ bufferSupplierType.nSize = sizeof(OMX_PARAM_BUFFERSUPPLIERTYPE);
+ bufferSupplierType.nVersion = iParamPortDefinition.nVersion;
+ bufferSupplierType.nPortIndex = iTunnelledPort;
+ bufferSupplierType.eBufferSupplier = pBufferSupplier->eBufferSupplier;
+ OMX_ERRORTYPE retValue = OMX_ErrorUndefined;
+ if (OMX_ErrorNone !=
+ (retValue =
+ OMX_SetParameter(iTunnelledComponent,
+ OMX_IndexParamCompBufferSupplier,
+ &bufferSupplierType)) )
+ {
+ return retValue;
+ }
+ }
+ DEBUG_PRINTF3(_L8("COmxILPortImpl::SetParameter : old.eBufferSupplier [%u] new.eBufferSupplier [%u]"),
+ iParamCompBufferSupplier.eBufferSupplier, pBufferSupplier->eBufferSupplier);
+ iParamCompBufferSupplier.eBufferSupplier =
+ pBufferSupplier->eBufferSupplier;
+ }
+
+ }
+ break;
+ default:
+ {
+ return OMX_ErrorUnsupportedIndex;
+ }
+ };
+
+ return OMX_ErrorNone;
+
+ }
+
+OMX_ERRORTYPE
+COmxILPortImpl::PopulateBuffer(OMX_BUFFERHEADERTYPE** appBufferHdr,
+ const OMX_PTR apAppPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer,
+ TBool& portPopulationCompleted)
+ {
+ DEBUG_PRINTF3(_L8("COmxILPort::PopulateBuffer : pBuffer[%X] PORT[%u]"), apBuffer, iParamPortDefinition.nPortIndex);
+ portPopulationCompleted = EFalse;
+
+ if(aSizeBytes < iParamPortDefinition.nBufferSize)
+ {
+ return OMX_ErrorBadParameter;
+ }
+
+ // Allocate the buffer header...
+ OMX_BUFFERHEADERTYPE* pHeader = new OMX_BUFFERHEADERTYPE;
+ *appBufferHdr = pHeader;
+ if (!pHeader)
+ {
+ return OMX_ErrorInsufficientResources;
+ }
+
+ DEBUG_PRINTF2(_L8("COmxILPortImpl::PopulateBuffer : BUFFER [%X]"), pHeader);
+
+ // Here, lets discriminate between apBuffer == 0 (AllocateBuffer) and
+ // apBuffer != 0 (UseBuffer)
+ TUint8* pPortSpecificBuffer = 0;
+ OMX_PTR pPortPrivate = 0;
+ OMX_PTR pPlatformPrivate = 0;
+ OMX_ERRORTYPE portSpecificErr = OMX_ErrorNone;
+ if (apBuffer)
+ {
+ //... (UseBuffer) Do any port-specific wrapping of the received buffer,
+ // if needed by the port....
+ portSpecificErr = iOmxILPort.DoBufferWrapping(aSizeBytes,
+ apBuffer,
+ pPortPrivate,
+ pPlatformPrivate,
+ apAppPrivate);
+
+ aFirstUseBufferHasBeenReceived = OMX_TRUE;
+ }
+ else
+ {
+ // ... (AllocateBuffer) Do the port-specific buffer allocation ...
+ portSpecificErr = iOmxILPort.DoBufferAllocation(aSizeBytes,
+ pPortSpecificBuffer,
+ pPortPrivate,
+ pPlatformPrivate,
+ apAppPrivate);
+ }
+
+ if (OMX_ErrorNone != portSpecificErr)
+ {
+ delete *appBufferHdr; *appBufferHdr = 0;
+ return portSpecificErr;
+ }
+
+
+ // Add to local list of buffer headers...
+ if (KErrNone !=
+ iBufferHeaders.Append(
+ TBufferInfo(pHeader,
+ (apBuffer ?
+ TBufferInfo::EBufferAway :
+ TBufferInfo::EBufferAtHome),
+ (apBuffer ?
+ TBufferInfo::EBufferNotOwned :
+ TBufferInfo::EBufferOwned),
+ apBuffer,
+ apAppPrivate,
+ pPlatformPrivate,
+ pPortPrivate)))
+ {
+ // Undo custom buffer allocation/wrapping
+ if (apBuffer)
+ {
+ iOmxILPort.DoBufferUnwrapping(
+ apBuffer,
+ pPortPrivate,
+ pPlatformPrivate,
+ apAppPrivate);
+
+ }
+ else
+ {
+ iOmxILPort.DoBufferDeallocation(
+ pPortSpecificBuffer,
+ pPortPrivate,
+ pPlatformPrivate,
+ apAppPrivate);
+ }
+ delete *appBufferHdr; *appBufferHdr = NULL;
+ return OMX_ErrorInsufficientResources;
+ }
+
+
+ // Fill in the header...
+ pHeader->nSize = sizeof(OMX_BUFFERHEADERTYPE);
+ pHeader->nVersion = iParamPortDefinition.nVersion;
+ pHeader->pBuffer = apBuffer ? apBuffer : pPortSpecificBuffer;
+ pHeader->nAllocLen = aSizeBytes;
+ pHeader->nFilledLen = 0;
+ pHeader->nOffset = 0;
+ pHeader->pAppPrivate = apAppPrivate;
+ pHeader->pPlatformPrivate = pPlatformPrivate;
+ pHeader->hMarkTargetComponent = 0;
+ pHeader->pMarkData = 0;
+ pHeader->nTickCount = 0;
+ pHeader->nTimeStamp = 0;
+ pHeader->nFlags = 0;
+
+
+ if (OMX_DirInput == iParamPortDefinition.eDir)
+ {
+ pHeader->pInputPortPrivate = pPortPrivate;
+ pHeader->pOutputPortPrivate = 0;
+ pHeader->nInputPortIndex = iParamPortDefinition.nPortIndex;
+ pHeader->nOutputPortIndex = 0;
+ }
+ else
+ {
+ pHeader->pInputPortPrivate = 0;
+ pHeader->pOutputPortPrivate = pPortPrivate;
+ pHeader->nInputPortIndex = 0;
+ pHeader->nOutputPortIndex = iParamPortDefinition.nPortIndex;
+ }
+
+ if (iParamPortDefinition.nBufferCountActual == iBufferHeaders.Count())
+ {
+ iParamPortDefinition.bPopulated = OMX_TRUE;
+ portPopulationCompleted = ETrue;
+ }
+
+ return OMX_ErrorNone;
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILPortImpl::FreeBuffer(OMX_BUFFERHEADERTYPE* apBufferHeader,
+ TBool& portDepopulationCompleted)
+ {
+ DEBUG_PRINTF2(_L8("COmxILPortImpl::FreeBuffer : BUFFER [%X]"), apBufferHeader);
+
+ portDepopulationCompleted = EFalse;
+
+ TInt headerIndex = 0;
+ if (KErrNotFound ==
+ (headerIndex =
+ iBufferHeaders.Find(TBufferInfo(apBufferHeader),
+ TIdentityRelation<TBufferInfo>(
+ &TBufferInfo::Compare))))
+ {
+ return OMX_ErrorBadParameter;
+ }
+
+
+ OMX_PTR pPortPrivate =
+ OMX_DirInput == iParamPortDefinition.eDir ?
+ apBufferHeader->pInputPortPrivate :
+ apBufferHeader->pOutputPortPrivate;
+
+ if (iBufferHeaders[headerIndex].IsBufferOwned())
+ {
+ iOmxILPort.DoBufferDeallocation(
+ apBufferHeader->pBuffer,
+ pPortPrivate,
+ apBufferHeader->pPlatformPrivate,
+ apBufferHeader->pAppPrivate);
+ }
+ else
+ {
+ iOmxILPort.DoBufferUnwrapping(
+ apBufferHeader->pBuffer,
+ pPortPrivate,
+ apBufferHeader->pPlatformPrivate,
+ apBufferHeader->pAppPrivate);
+ }
+
+ delete apBufferHeader;
+ iBufferHeaders.Remove(headerIndex);
+
+ if (iBufferHeaders.Count() < iParamPortDefinition.nBufferCountActual)
+ {
+ iParamPortDefinition.bPopulated = OMX_FALSE;
+ }
+
+ if (0 == iBufferHeaders.Count())
+ {
+ portDepopulationCompleted = ETrue;
+ aFirstUseBufferHasBeenReceived = OMX_FALSE;
+ }
+
+ return OMX_ErrorNone;
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILPortImpl::TunnelRequest(OMX_HANDLETYPE aTunneledComp,
+ OMX_U32 aTunneledPort,
+ OMX_TUNNELSETUPTYPE* apTunnelSetup)
+ {
+ DEBUG_PRINTF(_L8("COmxILPortImpl::TunnelRequest"));
+
+ // Check whether the tunnel is being torn down
+ if (!aTunneledComp)
+ {
+ // Cancel existing tunnel setup, if any
+ iTunnelledComponent = 0;
+ return OMX_ErrorNone;
+ }
+
+ // Check that we are receiving a valid tunnel setup structure
+ if (!apTunnelSetup)
+ {
+ return OMX_ErrorBadParameter;
+ }
+
+ // STEP 0: Retrieve the port definition from the tunnelled component...
+ OMX_PARAM_PORTDEFINITIONTYPE paramPortDef;
+ paramPortDef.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE);
+ paramPortDef.nVersion = iParamPortDefinition.nVersion;
+ paramPortDef.nPortIndex = aTunneledPort;
+ if (OMX_ErrorNone !=
+ OMX_GetParameter(aTunneledComp,
+ OMX_IndexParamPortDefinition,
+ ¶mPortDef) )
+ {
+ return OMX_ErrorUndefined;
+ }
+
+ if (OMX_DirOutput == iParamPortDefinition.eDir)
+ {
+ // OMX_DirOutput
+ //
+
+ // Step 1: Check that this output port is being tunnelled to an input
+ // port...
+ if (paramPortDef.eDir != OMX_DirInput)
+ {
+ return OMX_ErrorPortsNotCompatible;
+ }
+
+ // Step 2: Fill in the tunnel setup structure received...
+ apTunnelSetup->nTunnelFlags = 0;
+ apTunnelSetup->eSupplier = iParamCompBufferSupplier.eBufferSupplier;
+
+ iTunnelledComponent = aTunneledComp;
+ iTunnelledPort = aTunneledPort;
+ }
+ else
+ {
+ // OMX_DirInput
+ //
+
+ // Check that this input port is being tunnelled to an output
+ // port...
+ if (paramPortDef.eDir != OMX_DirOutput)
+ {
+ return OMX_ErrorPortsNotCompatible;
+ }
+
+ // Check that there is something consistent in the tunnel setup data
+ // received...
+ if ((apTunnelSetup->eSupplier != OMX_BufferSupplyUnspecified) &&
+ (apTunnelSetup->eSupplier != OMX_BufferSupplyInput) &&
+ (apTunnelSetup->eSupplier != OMX_BufferSupplyOutput))
+ {
+ return OMX_ErrorBadParameter;
+ }
+
+ // Set tunnelled component and port as they will be needed by
+ // IsTunnelledPortCompatible...
+ iTunnelledComponent = aTunneledComp;
+ iTunnelledPort = aTunneledPort;
+
+ // Check domain-specific parameter compatibility (this is delegated
+ // to derived port classes)...
+ if (!iOmxILPort.IsTunnelledPortCompatible(paramPortDef))
+ {
+ iTunnelledComponent = 0;
+ return OMX_ErrorPortsNotCompatible;
+ }
+
+ // Now, try to get to an understanding here...Work out which port will
+ // be buffer supplier...
+ OMX_BUFFERSUPPLIERTYPE bufferSupplierDecision =
+ OMX_BufferSupplyUnspecified;
+ if (apTunnelSetup->nTunnelFlags & OMX_PORTTUNNELFLAG_READONLY ||
+ ( (apTunnelSetup->eSupplier == OMX_BufferSupplyInput) &&
+ (iParamCompBufferSupplier.eBufferSupplier ==
+ OMX_BufferSupplyInput ||
+ iParamCompBufferSupplier.eBufferSupplier ==
+ OMX_BufferSupplyUnspecified) ) ||
+ ( (apTunnelSetup->eSupplier == OMX_BufferSupplyUnspecified) &&
+ (iParamCompBufferSupplier.eBufferSupplier ==
+ OMX_BufferSupplyInput)) )
+ {
+ bufferSupplierDecision = OMX_BufferSupplyInput;
+ }
+ else
+ {
+ bufferSupplierDecision = OMX_BufferSupplyOutput;
+ }
+
+ // Set buffer supplier param in tunnelled port...
+ OMX_PARAM_BUFFERSUPPLIERTYPE bufferSupplierType;
+ bufferSupplierType.nSize = sizeof(OMX_PARAM_BUFFERSUPPLIERTYPE);
+ bufferSupplierType.nVersion = iParamPortDefinition.nVersion;
+ bufferSupplierType.nPortIndex = aTunneledPort;
+ bufferSupplierType.eBufferSupplier = bufferSupplierDecision;
+ if (OMX_ErrorNone !=
+ OMX_SetParameter(aTunneledComp,
+ OMX_IndexParamCompBufferSupplier,
+ &bufferSupplierType) )
+ {
+ iTunnelledComponent = 0;
+ return OMX_ErrorPortsNotCompatible;
+ }
+
+ apTunnelSetup->eSupplier = bufferSupplierDecision;
+ iParamCompBufferSupplier.eBufferSupplier = bufferSupplierDecision;
+
+ }
+
+ return OMX_ErrorNone;
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILPortImpl::PopulateTunnel(TBool& portPopulationCompleted)
+ {
+ DEBUG_PRINTF(_L8("COmxILPortImpl::PopulateTunnel"));
+
+ __ASSERT_DEBUG(iBufferHeaders.Count() == 0,
+ User::Panic(KOmxILPortPanicCategory, 1));
+ __ASSERT_DEBUG(IsTunnelledAndBufferSupplier(),
+ User::Panic(KOmxILPortPanicCategory, 1));
+
+ portPopulationCompleted = EFalse;
+
+ // STEP 1: Obtain the number of buffers that the tunnelled port requires to
+ // be populated... Retrieve the port definition from the tunnelled
+ // component
+ OMX_PARAM_PORTDEFINITIONTYPE paramPortDef;
+ paramPortDef.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE);
+ paramPortDef.nVersion = iParamPortDefinition.nVersion;
+ paramPortDef.nPortIndex = iTunnelledPort;
+ if (OMX_ErrorNone !=
+ OMX_GetParameter(iTunnelledComponent,
+ OMX_IndexParamPortDefinition,
+ ¶mPortDef) )
+ {
+ return OMX_ErrorUndefined;
+ }
+
+ // Step 2: Both ports must have the same threshold value (number of buffers
+ // to be populated) before completing the transition to
+ // OMX_StateIdle...Otherwise the population process would complete earlier
+ // or never...
+ TUint numOfBuffersToPopulate = iParamPortDefinition.nBufferCountActual;
+ if(paramPortDef.nBufferCountActual !=
+ iParamPortDefinition.nBufferCountActual)
+ {
+ numOfBuffersToPopulate =
+ Max(iParamPortDefinition.nBufferCountActual,
+ paramPortDef.nBufferCountActual);
+ if (iParamPortDefinition.nBufferCountActual <
+ numOfBuffersToPopulate)
+ {
+ // Update own buffer count requirements
+ DEBUG_PRINTF3(_L8("COmxILPortImpl::PopulateTunnel : Updated own nBufferCountActual - Old Value [%d] New Value [%d] "),
+ iParamPortDefinition.nBufferCountActual, numOfBuffersToPopulate);
+ iParamPortDefinition.nBufferCountActual = numOfBuffersToPopulate;
+ }
+ else
+ {
+ // Update peer's buffer count requirements
+ DEBUG_PRINTF3(_L8("COmxILPortImpl::PopulateTunnel : Updated peer's nBufferCountActual - Old Value [%d] New Value [%d] "),
+ paramPortDef.nBufferCountActual, numOfBuffersToPopulate);
+ paramPortDef.nBufferCountActual = numOfBuffersToPopulate;
+ if (OMX_ErrorNone != OMX_SetParameter(iTunnelledComponent,
+ OMX_IndexParamPortDefinition,
+ ¶mPortDef))
+ {
+ DEBUG_PRINTF(_L8("COmxILPortImpl::PopulateTunnel : Error setting nBufferCountActual in tunnelled component "));
+ return OMX_ErrorUndefined;
+ }
+ }
+ }
+
+ // STEP 3: Start population of the tunnel...
+ TUint sizeOfBuffersToPopulate =
+ iParamPortDefinition.nBufferSize >= paramPortDef.nBufferSize ?
+ iParamPortDefinition.nBufferSize :
+ paramPortDef.nBufferSize;
+
+ OMX_BUFFERHEADERTYPE* pHeader = 0;
+ TUint8* pPortSpecificBuffer = 0;
+ OMX_PTR pPortPrivate = 0;
+ OMX_PTR pPlatformPrivate = 0;
+ OMX_ERRORTYPE portSpecificErr = OMX_ErrorNone;
+ for (TUint i=0; i<numOfBuffersToPopulate; i++)
+ {
+ // Allocate the buffer...
+ if (OMX_ErrorNone !=
+ (portSpecificErr = iOmxILPort.DoBufferAllocation(
+ sizeOfBuffersToPopulate,
+ pPortSpecificBuffer,
+ pPortPrivate,
+ pPlatformPrivate)))
+ {
+ // There's no point on continuing here... the tunnel will never
+ // be completely populated now...
+ return portSpecificErr;
+ }
+
+ OMX_ERRORTYPE useBufRes = iOmxILPort.DoOmxUseBuffer(iTunnelledComponent,
+ &pHeader,
+ iTunnelledPort,
+ pPortPrivate,
+ pPlatformPrivate,
+ sizeOfBuffersToPopulate,
+ pPortSpecificBuffer);
+
+ if ((OMX_ErrorNone != useBufRes) || !pHeader)
+ {
+ iOmxILPort.DoBufferDeallocation(
+ pPortSpecificBuffer,
+ pPortPrivate,
+ pPlatformPrivate);
+
+ if (pHeader)
+ {
+ switch(useBufRes)
+ {
+ case OMX_ErrorIncorrectStateOperation:
+ {
+ // Here, the tunnelled component is not ready. Probably,
+ // the IL Client has not commanded yet the component to go
+ // to OMX_StateIdle. Out-of-context implementations could
+ // do here a backoff-and-retry procedure. This
+ // implementation can just return and expect that the IL
+ // Client will detect the situation of this component not
+ // transitioning to OMX_StateIdle.
+ DEBUG_PRINTF(_L8("COmxILPortImpl::PopulateTunnel : OMX_ErrorIncorrectStateOperation received from non-supplier component"));
+ }
+ break;
+ };
+ }
+
+ if (OMX_ErrorInsufficientResources == useBufRes)
+ {
+ return OMX_ErrorInsufficientResources;
+ }
+ // This is a gotcha. Here there is some problem with the tunnelled
+ // component. If we return the received error, this component may
+ // be sending back some error code that is not allowed in
+ // OMX_SendCommand. Example: The component conformance suite
+ // expects here OMX_ErrorNone if the tunnelled component does not
+ // support OMX_UseBuffer or some other problem. Also, we don't send
+ // and error event here as there's no appropriate error for this
+ // situation (OMX_ErrorPortUnresponsiveDuringAllocation is for
+ // non-supplier ports). Therefore, the IL Client should recover
+ // from this situation after some time by detecting that this
+ // component didn't transition to OMX_StateIdle.
+
+ return OMX_ErrorNone;
+ }
+ // Fill the data in the received header so we can correctly use it when
+ // the header is at this side of the tunnel...
+ if (OMX_DirInput == iParamPortDefinition.eDir)
+ {
+ pHeader->pInputPortPrivate = pPortPrivate;
+ pHeader->nInputPortIndex = iParamPortDefinition.nPortIndex;
+ }
+ else // OMX_DirOutput == iParamPortDefinition.eDir
+ {
+ pHeader->pOutputPortPrivate = pPortPrivate;
+ pHeader->nOutputPortIndex = iParamPortDefinition.nPortIndex;
+ }
+
+ // Add to local list of buffer headers... return if not sucessful...
+ if (KErrNone !=
+ iBufferHeaders.Append(
+ TBufferInfo(pHeader,
+ TBufferInfo::EBufferAtHome,
+ TBufferInfo::EBufferOwned,
+ pPortSpecificBuffer,
+ 0,
+ pPlatformPrivate,
+ pPortPrivate)))
+ {
+ iOmxILPort.DoBufferDeallocation(
+ pPortSpecificBuffer,
+ pPortPrivate,
+ pPlatformPrivate);
+
+ return OMX_ErrorInsufficientResources;
+ }
+ }
+
+ iParamPortDefinition.bPopulated = OMX_TRUE;
+ portPopulationCompleted = ETrue;
+
+ __ASSERT_DEBUG(iBufferHeaders.Count() ==
+ iParamPortDefinition.nBufferCountActual,
+ User::Panic(KOmxILPortPanicCategory, 1));
+
+ return OMX_ErrorNone;
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILPortImpl::FreeTunnel(TBool& portDepopulationCompleted)
+ {
+ DEBUG_PRINTF(_L8("COmxILPortImpl::FreeTunnel"));
+
+ __ASSERT_DEBUG(iBufferHeaders.Count() ==
+ iParamPortDefinition.nBufferCountActual,
+ User::Panic(KOmxILPortPanicCategory, 1));
+
+ __ASSERT_DEBUG(IsTunnelledAndBufferSupplier(),
+ User::Panic(KOmxILPortPanicCategory, 1));
+
+ const TUint numBuffersToDepopulate = iBufferHeaders.Count();
+ for (TUint i=0; i<numBuffersToDepopulate; ++i)
+ {
+ OMX_BUFFERHEADERTYPE* pBufferHeader = iBufferHeaders[i].GetHeader();
+
+ // Take some things from the header, before it gets deleted by the
+ // tunnelled port...
+ OMX_U8* pBuffer = pBufferHeader->pBuffer;
+ OMX_PTR pPortPrivate =
+ OMX_DirInput == iParamPortDefinition.eDir ?
+ pBufferHeader->pInputPortPrivate :
+ pBufferHeader->pOutputPortPrivate;
+ OMX_PTR pAppPrivate = pBufferHeader->pAppPrivate;
+ OMX_PTR pPlatformPrivate = pBufferHeader->pPlatformPrivate;
+
+ DEBUG_PRINTF2(_L8("COmxILPortImpl::FreeTunnel : BUFFER [%X]"), iBufferHeaders[i].GetHeader());
+
+ OMX_ERRORTYPE freeBufRes = OMX_FreeBuffer(
+ iTunnelledComponent,
+ iTunnelledPort,
+ pBufferHeader);
+
+ // At this point, the actual buffer header should no longer exist...
+ pBufferHeader = 0;
+
+ // NOTE that we don't check OMX_FreeBuffer returned error here. If
+ // something wrong happens at the tunnelled component side we'll
+ // continue here and try to free as many buffers as possible.... at
+ // least the state of this component will remain valid.... (we don't
+ // report errors coming from the tunnelled component as that is its
+ // responsibility....)
+
+ iOmxILPort.DoBufferDeallocation(
+ pBuffer,
+ pPortPrivate,
+ pPlatformPrivate,
+ pAppPrivate);
+ }
+
+ // Clear the local list of headers. Note that there's no need to delete the
+ // header as these have been allocated by the tunnelled port...
+
+ iBufferHeaders.Reset();
+ iParamPortDefinition.bPopulated = OMX_FALSE;
+ portDepopulationCompleted = ETrue;
+
+ __ASSERT_DEBUG(iBufferHeaders.Count() == 0,
+ User::Panic(KOmxILPortPanicCategory, 1));
+
+ return OMX_ErrorNone;
+
+ }
+
+
+
+TBool
+COmxILPortImpl::SetBufferSent(OMX_BUFFERHEADERTYPE* apBufferHeader,
+ TBool& aBufferMarkedWithOwnMark)
+ {
+ DEBUG_PRINTF(_L8("COmxILPortImpl::SetBufferSent"));
+
+ __ASSERT_DEBUG(apBufferHeader, User::Panic(KOmxILPortPanicCategory, 1));
+
+ aBufferMarkedWithOwnMark = EFalse;
+
+ TInt index = 0;
+ if (KErrNotFound ==
+ (index =
+ iBufferHeaders.Find(TBufferInfo(apBufferHeader),
+ TIdentityRelation<TBufferInfo>(
+ &TBufferInfo::Compare))))
+ {
+ return EFalse;
+ }
+
+ iBufferHeaders[index].SetBufferAway();
+
+ if (!iBufferMarks.IsEmpty())
+ {
+ // Check for existing marks in the buffer header...
+ if (apBufferHeader->hMarkTargetComponent)
+ {
+ // We queue the mark received within the buffer header if there are
+ // marks already to be delivered... it is mandatory to give a FIFO
+ // preference to the marks received by a port..
+ if (iBufferMarks.Elements() < KMaxBufferMarksQueueSize)
+ {
+ // The buffer is marked already. Store the current mark at the end
+ // of the buffer mark list...
+ StoreBufferMark(apBufferHeader->hMarkTargetComponent,
+ apBufferHeader->pMarkData);
+ }
+ }
+
+ // Use the first mark in the queue...
+ TBufferMarkInfo* pMark = iBufferMarks.First();
+ apBufferHeader->hMarkTargetComponent = pMark->ipMarkTargetComponent;
+ apBufferHeader->pMarkData = pMark->ipMarkData;
+ aBufferMarkedWithOwnMark = pMark->iOwnMark;
+ iBufferMarks.Remove(*pMark);
+ delete pMark;
+ }
+
+ return ETrue;
+
+ }
+
+TBool
+COmxILPortImpl::SetBufferReturned(OMX_BUFFERHEADERTYPE* apBufferHeader)
+ {
+ DEBUG_PRINTF(_L8("COmxILPortImpl::SetBufferReturned"));
+
+ __ASSERT_DEBUG(apBufferHeader, User::Panic(KOmxILPortPanicCategory, 1));
+
+ TInt index = 0;
+ if (KErrNotFound ==
+ (index =
+ iBufferHeaders.Find(TBufferInfo(apBufferHeader),
+ TIdentityRelation<TBufferInfo>(
+ &TBufferInfo::Compare))))
+ {
+ return EFalse;
+ }
+
+ iBufferHeaders[index].SetBufferAtHome();
+
+ return ETrue;
+
+ }
+
+void
+COmxILPortImpl::SetTransitionToEnabled()
+ {
+ DEBUG_PRINTF(_L8("COmxILPortImpl::SetTransitionToEnabled"));
+
+ iTransitionState = EPortTransitioningToEnabled;
+ iParamPortDefinition.bEnabled = OMX_TRUE;
+
+ }
+
+void
+COmxILPortImpl::SetTransitionToDisabled()
+ {
+ DEBUG_PRINTF(_L8("COmxILPortImpl::SetTransitionToDisabled"));
+
+ iTransitionState = EPortTransitioningToDisabled;
+ iParamPortDefinition.bEnabled = OMX_FALSE;
+
+ }
+
+void
+COmxILPortImpl::SetTransitionToDisabledCompleted()
+ {
+ DEBUG_PRINTF(_L8("COmxILPortImpl::SetTransitionToDisabledCompleted"));
+
+ iTransitionState = EPortNotTransitioning;
+ iParamPortDefinition.bEnabled = OMX_FALSE;
+
+ }
+
+void
+COmxILPortImpl::SetTransitionToEnabledCompleted()
+ {
+ DEBUG_PRINTF(_L8("COmxILPortImpl::SetTransitionToEnabledCompleted"));
+
+ iTransitionState = EPortNotTransitioning;
+ iParamPortDefinition.bEnabled = OMX_TRUE;
+
+ }
+
+OMX_ERRORTYPE
+COmxILPortImpl::StoreBufferMark(const OMX_MARKTYPE* apMark)
+ {
+ DEBUG_PRINTF(_L8("COmxILPortImpl::StoreBufferMark"));
+ TBufferMarkInfo* pTBufferMarkInfo = new TBufferMarkInfo(apMark);
+ if (!pTBufferMarkInfo)
+ {
+ return OMX_ErrorInsufficientResources;
+ }
+
+ iBufferMarks.AddLast(*pTBufferMarkInfo);
+
+ return OMX_ErrorNone;
+
+ }
+
+/**
+ This utility method may be called from the most derived port
+ class' destructor to delete any buffer header and or buffer that may remain
+ allocated in the port. This typically happens when the component is unloaded
+ without being properly transitioned from OMX_StateIdle to OMX_StateLoaded.
+
+ */
+void
+COmxILPortImpl::CleanUpPort()
+ {
+
+ // Do the clean-up here in case something went wrong and the component is
+ // being unloaded in a failure scenario...
+ const TInt headerCount = iBufferHeaders.Count();
+ if (headerCount > 0)
+ {
+ if (!IsTunnelled())
+ {
+ // A non-tunnelled port needs to delete always the header and needs
+ // to deallocate/unwrap the buffer depending on whether the buffer
+ // is owned or not...
+
+ RPointerArray<OMX_BUFFERHEADERTYPE> tempHeadersArray;
+ for (TInt i=0; i<headerCount; ++i)
+ {
+ tempHeadersArray.Append(iBufferHeaders[i].GetHeader());
+ }
+
+ TBool portDepopulationCompleted = EFalse;
+ for (TInt i=0; i<headerCount; ++i)
+ {
+ // Errors are ignored here ...
+ FreeBuffer(tempHeadersArray[i], portDepopulationCompleted);
+ }
+ tempHeadersArray.Close();
+
+ }
+ else
+ {
+ if (IsTunnelledAndBufferSupplier())
+ {
+ // A tunnelled supplier only needs to delete the buffers, not
+ // the buffer headers... Also, we cannot use the pointer to the
+ // buffer header, as it may not exist anymore...
+ for (TInt i=0; i<headerCount; ++i)
+ {
+ iOmxILPort.DoBufferDeallocation(
+ iBufferHeaders[i].GetBufferPointer(),
+ iBufferHeaders[i].GetPortPointer(),
+ iBufferHeaders[i].GetPlatformPointer(),
+ iBufferHeaders[i].GetAppPointer());
+ }
+
+ }
+ else
+ {
+ // A tunnelled non-supplier needs to remove buffer headers and
+ // undo the buffer wrapping, if any. We can use FreeBuffer for
+ // that purpose...
+ RPointerArray<OMX_BUFFERHEADERTYPE> tempHeadersArray;
+ for (TInt i=0; i<headerCount; ++i)
+ {
+ tempHeadersArray.Append(iBufferHeaders[i].GetHeader());
+ }
+
+ TBool portDepopulationCompleted = EFalse;
+ for (TInt i=0; i<headerCount; ++i)
+ {
+ // errors here...
+ FreeBuffer(tempHeadersArray[i], portDepopulationCompleted);
+ }
+ tempHeadersArray.Close();
+ }
+ }
+ }
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILPortImpl::StoreBufferMark(OMX_HANDLETYPE& ipMarkTargetComponent,
+ OMX_PTR& ipMarkData)
+ {
+ DEBUG_PRINTF(_L8("COmxILPortImpl::StoreBufferMark"));
+
+ TBufferMarkInfo* pTBufferMarkInfo =
+ new TBufferMarkInfo(ipMarkTargetComponent,
+ ipMarkData, EFalse);
+ if (!pTBufferMarkInfo)
+ {
+ return OMX_ErrorInsufficientResources;
+ }
+
+ iBufferMarks.AddLast(*pTBufferMarkInfo);
+
+ return OMX_ErrorNone;
+
+ }
+
+TBool
+COmxILPortImpl::HasAllBuffersAtHome() const
+ {
+
+ __ASSERT_ALWAYS(IsTunnelledAndBufferSupplier(),
+ User::Panic(KOmxILPortPanicCategory, 1));
+
+ const TInt headerCount = iBufferHeaders.Count();
+ for (TInt i=0; i<headerCount; ++i)
+ {
+ if (!iBufferHeaders[i].IsBufferAtHome())
+ {
+ DEBUG_PRINTF(_L8("COmxILPortImpl::HasAllBuffersAtHome : [NO]"));
+ return EFalse;
+ }
+ }
+
+ DEBUG_PRINTF(_L8("COmxILPortImpl::HasAllBuffersAtHome : [YES]"));
+ return ETrue;
+
+ }
+
+TBool
+COmxILPortImpl::IsBufferAtHome(OMX_BUFFERHEADERTYPE* apBufferHeader) const
+ {
+ DEBUG_PRINTF2(_L8("COmxILPortImpl::IsBufferAtHome : [%X]"), apBufferHeader);
+
+ TInt headerIndex = 0;
+ if (KErrNotFound ==
+ (headerIndex =
+ iBufferHeaders.Find(TBufferInfo(apBufferHeader),
+ TIdentityRelation<TBufferInfo>(
+ &TBufferInfo::Compare))))
+ {
+ User::Panic(KOmxILPortPanicCategory, 1);
+ }
+
+ DEBUG_PRINTF2(_L8("COmxILPortImpl::IsBufferAtHome : [%s]"), iBufferHeaders[headerIndex].IsBufferAtHome() ? "YES" : "NO");
+
+ return iBufferHeaders[headerIndex].IsBufferAtHome();
+
+ }
+
+TBool
+COmxILPortImpl::TBufferInfo::Compare(const TBufferInfo& aBi1,
+ const TBufferInfo& aBi2)
+ {
+ return (aBi1.GetHeader() == aBi2.GetHeader() ? ETrue : EFalse);
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilportimpl.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,375 @@
+// 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
+ @internalComponent
+*/
+
+#ifndef OMXILPORTIMPL_H
+#define OMXILPORTIMPL_H
+
+#include <e32base.h>
+#include <openmax/il/khronos/v1_x/OMX_Component.h>
+#include <openmax/il/common/omxilspecversion.h>
+#include <openmax/il/common/omxilport.h>
+
+/**
+ OpenMAX IL component port base implementation class.
+*/
+class COmxILPortImpl : public CBase
+ {
+public:
+ static const TInt KMaxBufferMarksQueueSize = 10;
+ static COmxILPortImpl* NewL(const TOmxILCommonPortData& aCommonPortData, COmxILPort& aPort);
+ ~COmxILPortImpl();
+
+ 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;
+
+ OMX_ERRORTYPE PopulateBuffer(
+ OMX_BUFFERHEADERTYPE** appBufferHdr,
+ const OMX_PTR apAppPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer,
+ TBool& portPopulationCompleted);
+
+ OMX_ERRORTYPE FreeBuffer(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ TBool& portDepopulationCompleted);
+
+ OMX_ERRORTYPE TunnelRequest(
+ OMX_HANDLETYPE aTunneledComp,
+ OMX_U32 aTunneledPort,
+ OMX_TUNNELSETUPTYPE* apTunnelSetup);
+
+ OMX_ERRORTYPE PopulateTunnel(
+ TBool& portPopulationCompleted);
+
+ OMX_ERRORTYPE FreeTunnel(
+ TBool& portDepopulationCompleted);
+
+ TBool SetBufferSent(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ TBool& aBufferMarkedWithOwnMark);
+
+ TBool SetBufferReturned(
+ OMX_BUFFERHEADERTYPE* apBufferHeader);
+
+ void SetTransitionToDisabled();
+
+ void SetTransitionToEnabled();
+
+ void SetTransitionToDisabledCompleted();
+
+ void SetTransitionToEnabledCompleted();
+
+ OMX_ERRORTYPE StoreBufferMark(
+ const OMX_MARKTYPE* pMark);
+
+ OMX_ERRORTYPE SetComponentRoleDefaults(
+ TUint aComponentRoleIndex);
+
+ OMX_ERRORTYPE DoPortReconfiguration(
+ TUint aPortSettingsIndex,
+ const TDesC8& aPortSettings,
+ OMX_EVENTTYPE& aEventForILClient);
+
+ inline OMX_DIRTYPE Direction() const;
+
+ inline TBool IsEnabled() const;
+
+ inline TBool IsPopulated() const;
+
+ inline TBool IsDePopulated() const;
+
+ inline TBool IsTunnelled() const;
+
+ inline TBool IsTunnelledAndBufferSupplier() const;
+
+ virtual TBool HasAllBuffersAtHome() const;
+
+ TBool IsTransitioningToEnabled() const;
+
+ inline TBool IsTransitioningToDisabled() const;
+
+ virtual TBool IsBufferAtHome(
+ OMX_BUFFERHEADERTYPE* apHeaderHeader) const;
+
+ inline OMX_U32 Index() const;
+
+ inline OMX_PORTDOMAINTYPE Domain() const;
+
+ inline OMX_U32 Count() const;
+
+ inline OMX_BUFFERHEADERTYPE* const& operator[](TInt anIndex) const;
+
+ inline OMX_BUFFERHEADERTYPE*& operator[](TInt anIndex);
+
+ inline OMX_U32 BufferMarkPropagationPort() const;
+
+protected:
+
+ class TBufferMarkInfo;
+
+ /**
+ Buffer mark info list
+ */
+ class TBufferMarkInfoQue :
+ public TSglQue<TBufferMarkInfo>
+ {
+
+ public:
+
+ // Convenience typedef....
+ typedef TSglQue<TBufferMarkInfo> Tq;
+
+ public:
+
+ inline explicit TBufferMarkInfoQue(TInt aOffset);
+
+ inline TBufferMarkInfo* First() const;
+
+ inline void AddLast(TBufferMarkInfo& aRef);
+
+ inline void Remove(TBufferMarkInfo& aRef);
+
+ inline TInt Elements() const;
+
+ inline void ResetAndDestroy();
+
+ private:
+
+ TBufferMarkInfoQue();
+ void AddFirst(TBufferMarkInfo& aRef);
+ TBool IsFirst(const TBufferMarkInfo* aPtr) const;
+ TBool IsLast(const TBufferMarkInfo* aPtr) const;
+
+ TBufferMarkInfo* Last() const;
+
+ private:
+
+ TInt iNumElements;
+
+ };
+
+
+ class TBufferInfo;
+
+private:
+
+ enum TPortIntermediateState
+ {
+ EPortNotTransitioning,
+ EPortTransitioningToDisabled,
+ EPortTransitioningToEnabled
+ };
+
+
+protected:
+
+ COmxILPortImpl(const TOmxILCommonPortData& aCommonPortData, COmxILPort& aPort);
+
+public:
+ template<typename T>
+ inline OMX_ERRORTYPE GetParamStructureFromTunnel(
+ T& aComponentConfigStructure, OMX_INDEXTYPE aParamIndex) const;
+
+ OMX_ERRORTYPE StoreBufferMark(
+ OMX_HANDLETYPE& ipMarkTargetComponent,
+ OMX_PTR& ipMarkData);
+
+ void CleanUpPort();
+
+ inline const OMX_PARAM_PORTDEFINITIONTYPE& GetParamPortDefinition() const;
+ inline const OMX_HANDLETYPE& GetTunnelledComponent() const;
+ inline const OMX_U32& GetTunnelledPort() const;
+ inline OMX_PARAM_PORTDEFINITIONTYPE& GetParamPortDefinition();
+ inline OMX_HANDLETYPE& GetTunnelledComponent();
+ inline OMX_U32& GetTunnelledPort();
+
+private:
+
+ // Tunnelled component
+ OMX_HANDLETYPE iTunnelledComponent;
+
+ // Tunnelled component's port
+ OMX_U32 iTunnelledPort;
+
+ // Buffer headers store
+ RArray<TBufferInfo> iBufferHeaders;
+
+ // Buffer marks store
+ TBufferMarkInfoQue iBufferMarks;
+
+ // Port's intermediate state to enabled or disabled
+ TPortIntermediateState iTransitionState;
+
+ // Associated port that will be used to propagate buffer marks
+ OMX_U32 iBufferMarkPropagationPortIndex;
+
+ // This is a flag that is set when the port receives the first
+ // OMX_UseBuffer (non-supplier ports). This will be used to know when
+ // SetParameter will be allowed
+ OMX_BOOL aFirstUseBufferHasBeenReceived;
+
+ // OpenMAX IL port definition structure
+ OMX_PARAM_PORTDEFINITIONTYPE iParamPortDefinition;
+
+ // OpenMAX IL buffer supplier structure
+ OMX_PARAM_BUFFERSUPPLIERTYPE iParamCompBufferSupplier;
+
+ COmxILPort& iOmxILPort;
+
+ };
+
+/**
+ Buffer mark info structure
+*/
+class COmxILPortImpl::TBufferMarkInfo
+ {
+
+public:
+
+ inline explicit TBufferMarkInfo(
+ const OMX_MARKTYPE*& apMark,
+ TBool aOwnMark = ETrue);
+
+ inline TBufferMarkInfo(
+ OMX_HANDLETYPE& apMarkTargetComponent,
+ OMX_PTR& apMarkData,
+ TBool aOwnMark = ETrue);
+
+public:
+
+ OMX_HANDLETYPE ipMarkTargetComponent;
+ OMX_PTR ipMarkData;
+ TBool iOwnMark;
+ TSglQueLink iLink;
+
+ };
+
+/**
+ Buffer info structure
+*/
+class COmxILPortImpl::TBufferInfo
+ {
+
+public:
+
+ enum THeaderLocationProperty
+ {
+ EBufferAtHome = 0x01,
+ EBufferAway = 0x00
+ };
+
+ enum THeaderOwnershipProperty
+ {
+ EBufferOwned = 0x02,
+ EBufferNotOwned = 0x00
+ };
+
+public:
+
+ inline TBufferInfo(OMX_BUFFERHEADERTYPE* apHeader,
+ THeaderLocationProperty aLocation,
+ THeaderOwnershipProperty aOwnership,
+ OMX_U8* apBuffer,
+ OMX_PTR apApp,
+ OMX_PTR apPlatform,
+ OMX_PTR apPort);
+
+ inline explicit TBufferInfo(OMX_BUFFERHEADERTYPE* apHeader);
+
+ static TBool Compare(const TBufferInfo& aBi1,
+ const TBufferInfo& aBi2);
+
+ inline const OMX_BUFFERHEADERTYPE* GetHeader() const;
+
+ inline OMX_BUFFERHEADERTYPE* GetHeader();
+
+ inline operator OMX_BUFFERHEADERTYPE*&();
+
+ inline operator OMX_BUFFERHEADERTYPE* const&() const;
+
+ inline OMX_U8* GetBufferPointer() const;
+
+ inline OMX_U8* GetBufferPointer();
+
+ inline OMX_PTR GetPortPointer() const;
+
+ inline OMX_PTR GetPortPointer();
+
+ inline OMX_PTR GetPlatformPointer() const;
+
+ inline OMX_PTR GetPlatformPointer();
+
+ inline OMX_PTR GetAppPointer() const;
+
+ inline OMX_PTR GetAppPointer();
+
+ inline void SetBufferAtHome();
+
+ inline void SetBufferAway();
+
+ inline void SetBufferOwned();
+
+ inline void SetBufferNotOwned();
+
+ inline TBool IsBufferAtHome() const;
+
+ inline TBool IsBufferOwned() const;
+
+private:
+
+ enum THeaderPropertyMask
+ {
+ EBufferAwayMask = 0xFE,
+ EBufferNotOwnedMask = 0xFD
+ };
+
+private:
+
+ OMX_BUFFERHEADERTYPE* ipHeader;
+ TUint8 iBufferProperties;
+ OMX_U8* ipBuffer;
+ OMX_PTR ipApp;
+ OMX_PTR ipPlatform;
+ OMX_PTR ipPort;
+
+ };
+
+#include "omxilportimpl.inl"
+#endif // OMXILPORTIMPL_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilportimpl.inl Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,410 @@
+// 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
+ @internalComponent
+*/
+
+
+
+
+
+inline OMX_DIRTYPE
+COmxILPortImpl::Direction() const
+ {
+ return iParamPortDefinition.eDir;
+ }
+
+inline TBool
+COmxILPortImpl::IsEnabled() const
+ {
+ return iParamPortDefinition.bEnabled;
+ }
+
+inline TBool
+COmxILPortImpl::IsPopulated() const
+ {
+ return (OMX_TRUE == iParamPortDefinition.bPopulated ? ETrue : EFalse);
+ }
+
+inline TBool
+COmxILPortImpl::IsDePopulated() const
+ {
+ return (iBufferHeaders.Count() == 0 ? ETrue : EFalse);
+ }
+
+inline TBool
+COmxILPortImpl::IsTunnelled() const
+ {
+ return (iTunnelledComponent != 0 ? ETrue : EFalse);
+ }
+
+inline TBool
+COmxILPortImpl::IsTunnelledAndBufferSupplier() const
+ {
+ TBool retValue = (
+ iTunnelledComponent &&
+ (((iParamCompBufferSupplier.eBufferSupplier ==
+ OMX_BufferSupplyInput)
+ &&
+ (iParamPortDefinition.eDir == OMX_DirInput))
+ ||
+ ((iParamCompBufferSupplier.eBufferSupplier == OMX_BufferSupplyOutput)
+ &&
+ (iParamPortDefinition.eDir == OMX_DirOutput)))
+ );
+
+ return retValue;
+
+ }
+
+inline TBool
+COmxILPortImpl::IsTransitioningToEnabled() const
+ {
+ return (iTransitionState == EPortTransitioningToEnabled ? ETrue : EFalse);
+ }
+
+inline TBool
+COmxILPortImpl::IsTransitioningToDisabled() const
+ {
+ return (iTransitionState == EPortTransitioningToDisabled ? ETrue : EFalse);
+ }
+
+inline OMX_U32
+COmxILPortImpl::Index() const
+ {
+ return iParamPortDefinition.nPortIndex;
+ }
+
+inline OMX_PORTDOMAINTYPE
+COmxILPortImpl::Domain() const
+ {
+ return iParamPortDefinition.eDomain;
+ }
+
+inline OMX_U32
+COmxILPortImpl::Count() const
+ {
+ return iBufferHeaders.Count();
+ }
+
+inline OMX_BUFFERHEADERTYPE* const&
+COmxILPortImpl::operator[](TInt anIndex) const
+ {
+ return this->operator[](anIndex);
+ }
+
+inline OMX_BUFFERHEADERTYPE*&
+COmxILPortImpl::operator[](TInt anIndex)
+ {
+ __ASSERT_ALWAYS((anIndex>=0 && anIndex<iBufferHeaders.Count()),
+ User::Panic(KOmxILPortPanicCategory, 1));
+ return iBufferHeaders[anIndex];
+ }
+
+
+inline OMX_U32
+COmxILPortImpl::BufferMarkPropagationPort() const
+ {
+ return iBufferMarkPropagationPortIndex;
+ }
+
+
+template<typename T>
+inline OMX_ERRORTYPE
+COmxILPortImpl::GetParamStructureFromTunnel(
+ T& aComponentConfigStructure, OMX_INDEXTYPE aParamIndex) const
+ {
+
+ __ASSERT_ALWAYS(iTunnelledComponent,
+ User::Panic(KOmxILPortPanicCategory, 1));
+
+ aComponentConfigStructure.nSize = sizeof(T);
+ aComponentConfigStructure.nVersion = TOmxILSpecVersion();
+ aComponentConfigStructure.nPortIndex = iTunnelledPort;
+
+ if (OMX_ErrorNone !=
+ OMX_GetParameter(iTunnelledComponent,
+ aParamIndex,
+ &aComponentConfigStructure) )
+ {
+ return OMX_ErrorUndefined;
+ }
+
+ return OMX_ErrorNone;
+
+ }
+
+
+
+inline
+COmxILPortImpl::TBufferMarkInfo::TBufferMarkInfo(
+ const OMX_MARKTYPE*& apMark,
+ TBool aOwnMark /* = ETrue */)
+ :
+ ipMarkTargetComponent(apMark->hMarkTargetComponent),
+ ipMarkData(apMark->pMarkData),
+ iOwnMark(aOwnMark)
+ {
+ __ASSERT_DEBUG(ipMarkTargetComponent,
+ User::Panic(KOmxILPortPanicCategory, 1));
+ }
+
+inline
+COmxILPortImpl::TBufferMarkInfo::TBufferMarkInfo(
+ OMX_HANDLETYPE& apMarkTargetComponent,
+ OMX_PTR& apMarkData,
+ TBool aOwnMark /* = ETrue */)
+ :
+ ipMarkTargetComponent(apMarkTargetComponent),
+ ipMarkData(apMarkData),
+ iOwnMark(aOwnMark)
+ {
+ __ASSERT_DEBUG(ipMarkTargetComponent,
+ User::Panic(KOmxILPortPanicCategory, 1));
+ }
+
+inline
+COmxILPortImpl::TBufferMarkInfoQue::TBufferMarkInfoQue(TInt aOffset)
+ :
+ Tq(aOffset),
+ iNumElements(0)
+ {
+ }
+
+inline COmxILPortImpl::TBufferMarkInfo*
+COmxILPortImpl::TBufferMarkInfoQue::First() const
+ {
+ return Tq::First();
+ }
+
+inline void
+COmxILPortImpl::TBufferMarkInfoQue::AddLast(COmxILPortImpl::TBufferMarkInfo& aRef)
+ {
+ Tq::AddLast(aRef);
+ ++iNumElements;
+ }
+
+inline void
+COmxILPortImpl::TBufferMarkInfoQue::Remove(COmxILPortImpl::TBufferMarkInfo& aRef)
+ {
+ Tq::Remove(aRef);
+ --iNumElements;
+ }
+
+inline TInt
+COmxILPortImpl::TBufferMarkInfoQue::Elements() const
+ {
+ return iNumElements;
+ }
+
+inline void
+COmxILPortImpl::TBufferMarkInfoQue::ResetAndDestroy()
+ {
+ while (!Tq::IsEmpty())
+ {
+ COmxILPortImpl::TBufferMarkInfo* pMark = Tq::First();
+ __ASSERT_DEBUG(pMark, User::Panic(KOmxILPortPanicCategory, 1));
+ Tq::Remove(*pMark);
+ delete pMark;
+ }
+ iNumElements = 0;
+ }
+
+
+inline
+COmxILPortImpl::TBufferInfo::TBufferInfo(
+ OMX_BUFFERHEADERTYPE* apHeader,
+ THeaderLocationProperty aLocation,
+ THeaderOwnershipProperty aOwnership,
+ OMX_U8* apBuffer,
+ OMX_PTR apApp,
+ OMX_PTR apPlatform,
+ OMX_PTR apPort)
+ :
+ ipHeader(apHeader),
+ iBufferProperties(0),
+ ipBuffer(apBuffer),
+ ipApp(apApp),
+ ipPlatform(apPlatform),
+ ipPort(apPort)
+ {
+ __ASSERT_DEBUG(ipHeader, User::Panic(KOmxILPortPanicCategory, 1));
+ iBufferProperties = aLocation | aOwnership;
+ }
+
+
+// This constructor should only be used for array look-ups
+inline
+COmxILPortImpl::TBufferInfo::TBufferInfo(
+ OMX_BUFFERHEADERTYPE* apHeader)
+ :
+ ipHeader(apHeader),
+ iBufferProperties(0),
+ ipBuffer(0),
+ ipApp(0),
+ ipPlatform(0),
+ ipPort(0)
+ {
+ __ASSERT_DEBUG(ipHeader, User::Panic(KOmxILPortPanicCategory, 1));
+ iBufferProperties = EBufferAtHome | EBufferOwned;
+ }
+
+
+inline const OMX_BUFFERHEADERTYPE*
+COmxILPortImpl::TBufferInfo::GetHeader() const
+ {
+ return ipHeader;
+ }
+
+inline OMX_BUFFERHEADERTYPE*
+COmxILPortImpl::TBufferInfo::GetHeader()
+ {
+ return ipHeader;
+ }
+
+inline
+COmxILPortImpl::TBufferInfo::operator OMX_BUFFERHEADERTYPE*&()
+ {
+ return ipHeader;
+ }
+
+inline
+COmxILPortImpl::TBufferInfo::operator OMX_BUFFERHEADERTYPE* const&() const
+ {
+ return ipHeader;
+ }
+
+inline OMX_U8*
+COmxILPortImpl::TBufferInfo::GetBufferPointer() const
+ {
+ return ipBuffer;
+ }
+
+inline OMX_U8*
+COmxILPortImpl::TBufferInfo::GetBufferPointer()
+ {
+ return ipBuffer;
+ }
+
+inline OMX_PTR
+COmxILPortImpl::TBufferInfo::GetPortPointer() const
+ {
+ return ipPort;
+ }
+
+inline OMX_PTR
+COmxILPortImpl::TBufferInfo::GetPortPointer()
+ {
+ return ipPort;
+ }
+
+inline OMX_PTR
+COmxILPortImpl::TBufferInfo::GetPlatformPointer() const
+ {
+ return ipPlatform;
+ }
+
+inline OMX_PTR
+COmxILPortImpl::TBufferInfo::GetPlatformPointer()
+ {
+ return ipPlatform;
+ }
+
+inline OMX_PTR
+COmxILPortImpl::TBufferInfo::GetAppPointer() const
+ {
+ return ipApp;
+ }
+
+inline OMX_PTR
+COmxILPortImpl::TBufferInfo::GetAppPointer()
+ {
+ return ipApp;
+ }
+
+inline void
+COmxILPortImpl::TBufferInfo::SetBufferAtHome()
+ {
+ iBufferProperties |= EBufferAtHome;
+ }
+
+inline void
+COmxILPortImpl::TBufferInfo::SetBufferAway()
+ {
+ iBufferProperties &= EBufferAwayMask;
+ }
+
+inline void
+COmxILPortImpl::TBufferInfo::SetBufferOwned()
+ {
+ iBufferProperties |= EBufferOwned;
+ }
+
+inline void
+COmxILPortImpl::TBufferInfo::SetBufferNotOwned()
+ {
+ iBufferProperties &= EBufferNotOwnedMask;
+ }
+
+inline TBool
+COmxILPortImpl::TBufferInfo::IsBufferAtHome() const
+ {
+ return ((iBufferProperties & EBufferAtHome) != 0x0 ? ETrue : EFalse);
+ }
+
+inline TBool
+COmxILPortImpl::TBufferInfo::IsBufferOwned() const
+ {
+ return ((iBufferProperties & EBufferOwned) != 0x0 ? ETrue : EFalse);
+ }
+
+inline const OMX_PARAM_PORTDEFINITIONTYPE&
+COmxILPortImpl::GetParamPortDefinition() const
+ {
+ return iParamPortDefinition;
+ }
+
+inline const OMX_HANDLETYPE&
+COmxILPortImpl::GetTunnelledComponent() const
+ {
+ return iTunnelledComponent;
+ }
+
+inline const OMX_U32&
+COmxILPortImpl::GetTunnelledPort() const
+ {
+ return iTunnelledPort;
+ }
+
+inline OMX_PARAM_PORTDEFINITIONTYPE&
+COmxILPortImpl::GetParamPortDefinition()
+ {
+ return iParamPortDefinition;
+ }
+
+inline OMX_HANDLETYPE&
+COmxILPortImpl::GetTunnelledComponent()
+ {
+ return iTunnelledComponent;
+ }
+
+inline OMX_U32&
+COmxILPortImpl::GetTunnelledPort()
+ {
+ return iTunnelledPort;
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilportmanager.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,2178 @@
+// 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 "omxilportmanager.h"
+#include <openmax/il/common/omxilprocessingfunction.h>
+#include "omxilcallbackmanager.h"
+#include <openmax/il/common/omxilutil.h>
+
+ /**
+ Static NewL for two-phase construction
+
+ @param aProcessingFunction The component's processing function
+
+ @param aCallbacks The component's callback manager
+
+ @param aOmxVersion The IL Spec version in use
+
+ @param aNumberOfAudioPorts Number of audio ports in the component
+
+ @param aStartAudioPortNumber The start index for audio ports
+
+ @param aNumberOfImagePorts Number of image ports in the component
+
+ @param aStartImagePortNumber The start index for image ports
+
+ @param aNumberOfVideoPorts Number of video ports in the component
+
+ @param aStartVideoPortNumber The start index for video ports
+
+ @param aNumberOfOtherPorts Number of other ports in the component
+
+ @param aStartOtherPortNumber The start index for other ports
+
+ @param aImmediateReturnTimeBuffer This only applies to components with a
+ clock client port. Indicates whether the Port Manager must forward an
+ arriving clock buffer to the Callback Manager (ETrue) or to the
+ Processing Function (EFalse) . If the clock buffer is to be forwarded to
+ the Processing Function, this will happen using the BufferIndication
+ function of the component's PF. Otherwise, PF's MediaTimeIndication is
+ used instead.
+ */
+COmxILPortManager*
+COmxILPortManager::NewL(
+ COmxILProcessingFunction& aProcessingFunction,
+ MOmxILCallbackManagerIf& aCallbacks,
+ const OMX_VERSIONTYPE& aOmxVersion,
+ OMX_U32 aNumberOfAudioPorts,
+ OMX_U32 aStartAudioPortNumber,
+ OMX_U32 aNumberOfImagePorts,
+ OMX_U32 aStartImagePortNumber,
+ OMX_U32 aNumberOfVideoPorts,
+ OMX_U32 aStartVideoPortNumber,
+ OMX_U32 aNumberOfOtherPorts,
+ OMX_U32 aStartOtherPortNumber,
+ OMX_BOOL aImmediateReturnTimeBuffer)
+ {
+ DEBUG_PRINTF(_L8("COmxILPortManager::NewL"));
+
+ COmxILPortManager* self =
+ new (ELeave)COmxILPortManager(
+ aProcessingFunction,
+ aCallbacks);
+
+ CleanupStack::PushL(self);
+ self->ConstructL(aProcessingFunction,
+ aCallbacks,
+ aOmxVersion,
+ aNumberOfAudioPorts,
+ aStartAudioPortNumber,
+ aNumberOfImagePorts,
+ aStartImagePortNumber,
+ aNumberOfVideoPorts,
+ aStartVideoPortNumber,
+ aNumberOfOtherPorts,
+ aStartOtherPortNumber,
+ aImmediateReturnTimeBuffer);
+ CleanupStack::Pop(self);
+ return self;
+ }
+
+void
+COmxILPortManager::ConstructL(
+ COmxILProcessingFunction& /* aProcessingFunction */,
+ MOmxILCallbackManagerIf& /* aCallbacks */,
+ const OMX_VERSIONTYPE& aOmxVersion,
+ OMX_U32 aNumberOfAudioPorts,
+ OMX_U32 aStartAudioPortNumber,
+ OMX_U32 aNumberOfImagePorts,
+ OMX_U32 aStartImagePortNumber,
+ OMX_U32 aNumberOfVideoPorts,
+ OMX_U32 aStartVideoPortNumber,
+ OMX_U32 aNumberOfOtherPorts,
+ OMX_U32 aStartOtherPortNumber,
+ OMX_BOOL aImmediateReturnTimeBuffer)
+ {
+ DEBUG_PRINTF(_L8("COmxILPortManager::ConstructL"));
+
+ iImmediateReturnTimeBuffer = aImmediateReturnTimeBuffer;
+
+ iAudioParamInit.nSize = sizeof(OMX_PORT_PARAM_TYPE);
+ iAudioParamInit.nVersion = aOmxVersion;
+ iAudioParamInit.nPorts = aNumberOfAudioPorts;
+ iAudioParamInit.nStartPortNumber = aStartAudioPortNumber;
+
+ iImageParamInit.nSize = sizeof(OMX_PORT_PARAM_TYPE);
+ iImageParamInit.nVersion = aOmxVersion;
+ iImageParamInit.nPorts = aNumberOfImagePorts;
+ iImageParamInit.nStartPortNumber = aStartImagePortNumber;
+
+ iVideoParamInit.nSize = sizeof(OMX_PORT_PARAM_TYPE);
+ iVideoParamInit.nVersion = aOmxVersion;
+ iVideoParamInit.nPorts = aNumberOfVideoPorts;
+ iVideoParamInit.nStartPortNumber = aStartVideoPortNumber;
+
+ iOtherParamInit.nSize = sizeof(OMX_PORT_PARAM_TYPE);
+ iOtherParamInit.nVersion = aOmxVersion;
+ iOtherParamInit.nPorts = aNumberOfOtherPorts;
+ iOtherParamInit.nStartPortNumber = aStartOtherPortNumber;
+
+
+ InsertParamIndexL(OMX_IndexParamAudioInit);
+ InsertParamIndexL(OMX_IndexParamImageInit);
+ InsertParamIndexL(OMX_IndexParamVideoInit);
+ InsertParamIndexL(OMX_IndexParamOtherInit);
+
+
+ if(iAudioParamInit.nStartPortNumber != 0)
+ {
+ User::Leave(KErrArgument);
+ }
+
+ if (iImageParamInit.nPorts > 0)
+ {
+ if (iAudioParamInit.nPorts !=
+ iImageParamInit.nStartPortNumber)
+ {
+ User::Leave(KErrArgument);
+ }
+ }
+
+ if (iVideoParamInit.nPorts > 0)
+ {
+ if ((iAudioParamInit.nPorts +
+ iImageParamInit.nPorts) !=
+ iVideoParamInit.nStartPortNumber)
+ {
+ User::Leave(KErrArgument);
+ }
+ }
+
+ if (iOtherParamInit.nPorts > 0)
+ {
+ if ((iAudioParamInit.nPorts +
+ iImageParamInit.nPorts +
+ iVideoParamInit.nPorts) !=
+ iOtherParamInit.nStartPortNumber)
+ {
+ User::Leave(KErrArgument);
+ }
+ }
+
+ }
+
+COmxILPortManager::COmxILPortManager(
+ COmxILProcessingFunction& aProcessingFunction,
+ MOmxILCallbackManagerIf& aCallbacks)
+ :
+ iProcessingFunction(aProcessingFunction),
+ iCallbacks(aCallbacks),
+ iAllPorts()
+ {
+ DEBUG_PRINTF(_L8("COmxILPortManager::COmxILPortManager"));
+
+ }
+
+COmxILPortManager::~COmxILPortManager()
+ {
+ DEBUG_PRINTF(_L8("COmxILPortManager::~COmxILPortManager"));
+ iAllPorts.ResetAndDestroy();
+ iTimePorts.Close();
+ }
+
+void
+COmxILPortManager::AppendPortL(const COmxILPort* aPort)
+ {
+ DEBUG_PRINTF(_L8("COmxILPortManager::AppendPort"));
+
+ const TInt portCount = iAllPorts.Count();
+ OMX_PORTDOMAINTYPE portDomain = aPort->Domain();
+ OMX_U32 startPortNumber = 0;
+ TBool timePort = EFalse;
+
+ switch(portDomain)
+ {
+ case OMX_PortDomainAudio:
+ {
+ __ASSERT_ALWAYS(portCount >= 0,
+ User::Panic(KOmxILPortManagerPanicCategory, 1));
+ __ASSERT_ALWAYS(portCount < iAudioParamInit.nPorts,
+ User::Panic(KOmxILPortManagerPanicCategory, 1));
+
+ startPortNumber = iAudioParamInit.nStartPortNumber;
+
+ }
+ break;
+
+ case OMX_PortDomainImage:
+ {
+ __ASSERT_ALWAYS(portCount >= iAudioParamInit.nPorts,
+ User::Panic(KOmxILPortManagerPanicCategory, 1));
+ __ASSERT_ALWAYS(portCount <
+ iAudioParamInit.nPorts +
+ iImageParamInit.nPorts,
+ User::Panic(KOmxILPortManagerPanicCategory, 1));
+
+ startPortNumber = iImageParamInit.nStartPortNumber;
+
+ }
+ break;
+
+ case OMX_PortDomainVideo:
+ {
+ __ASSERT_ALWAYS(portCount >=
+ iAudioParamInit.nPorts +
+ iImageParamInit.nPorts,
+ User::Panic(KOmxILPortManagerPanicCategory, 1));
+ __ASSERT_ALWAYS(portCount <
+ iAudioParamInit.nPorts +
+ iImageParamInit.nPorts +
+ iVideoParamInit.nPorts,
+ User::Panic(KOmxILPortManagerPanicCategory, 1));
+
+ startPortNumber = iVideoParamInit.nStartPortNumber;
+
+ }
+ break;
+
+
+ case OMX_PortDomainOther:
+ {
+ __ASSERT_ALWAYS(portCount >=
+ iAudioParamInit.nPorts +
+ iImageParamInit.nPorts +
+ iVideoParamInit.nPorts,
+ User::Panic(KOmxILPortManagerPanicCategory, 1));
+ __ASSERT_ALWAYS(portCount <
+ iAudioParamInit.nPorts +
+ iImageParamInit.nPorts +
+ iVideoParamInit.nPorts +
+ iOtherParamInit.nPorts,
+ User::Panic(KOmxILPortManagerPanicCategory, 1));
+
+ startPortNumber = iOtherParamInit.nStartPortNumber;
+
+ OMX_OTHER_PARAM_PORTFORMATTYPE paramFormat;
+ paramFormat.nSize = sizeof(OMX_OTHER_PARAM_PORTFORMATTYPE);
+ paramFormat.nVersion = TOmxILSpecVersion();
+ paramFormat.nPortIndex = aPort->Index();
+ paramFormat.nIndex = 0;
+
+ if ((aPort->GetParameter(OMX_IndexParamOtherPortFormat, ¶mFormat) == OMX_ErrorNone) &&
+ paramFormat.eFormat == OMX_OTHER_FormatTime)
+ {
+ timePort = ETrue;
+ }
+ }
+
+ break;
+
+ default:
+ {
+ User::Panic(KOmxILPortManagerPanicCategory, 1);
+ }
+ };
+
+ if(portCount == startPortNumber)
+ {
+ iAllPorts.AppendL(aPort);
+ }
+ else
+ {
+ for (TInt i=startPortNumber; i<portCount; ++i)
+ {
+ if (iAllPorts[i]->Index() >= aPort->Index())
+ {
+ User::Panic(KOmxILPortManagerPanicCategory, 1);
+ }
+ }
+ iAllPorts.AppendL(aPort);
+ }
+
+
+ TRAPD(err, iTimePorts.AppendL(timePort));
+ if (KErrNone != err)
+ {
+ iAllPorts.Remove(iAllPorts.Count()-1);
+ User::Leave(err);
+ }
+ }
+
+void COmxILPortManager::RemoveLastAppendedPort()
+ {
+ if (iAllPorts.Count()>0 && iTimePorts.Count()>0)
+ {
+ iAllPorts.Remove(iAllPorts.Count()-1);
+ iTimePorts.Remove(iTimePorts.Count()-1);
+ }
+ }
+
+
+/**
+ This method is used at component's construction time, i.e., in a factory
+ method of the component. The main component object uses this method to add
+ the component's ports to its port manager instance.
+
+ @param aPort The port instance to be added.
+
+ @param aDirection The direction of the port being added.
+
+ @ return A Symbian error code indicating if the function call was
+ successful. KErrNone on success, otherwise another of the system-wide error
+ codes.
+*/
+TInt
+COmxILPortManager::AddPort(const COmxILPort* aPort,
+ OMX_DIRTYPE aDirection)
+ {
+ DEBUG_PRINTF(_L8("COmxILPortManager::AddPort"));
+
+ __ASSERT_ALWAYS(aPort, User::Panic(KOmxILPortManagerPanicCategory, 1));
+
+ if (iAllPorts.Count() >= (iAudioParamInit.nPorts +
+ iVideoParamInit.nPorts +
+ iImageParamInit.nPorts +
+ iOtherParamInit.nPorts))
+ {
+ return KErrArgument;
+ }
+
+ if (aPort->Direction() != aDirection)
+ {
+ return KErrArgument;
+ }
+
+ if (iAllPorts.Find(aPort) != KErrNotFound)
+ {
+ return KErrArgument;
+ }
+
+ OMX_ERRORTYPE omxRetValue =
+ aPort->GetLocalOmxParamIndexes(ManagedParamIndexes());
+ if (OMX_ErrorNone == omxRetValue)
+ {
+ omxRetValue = aPort->GetLocalOmxConfigIndexes(ManagedConfigIndexes());
+ }
+
+ if (OMX_ErrorNone != omxRetValue)
+ {
+ if (OMX_ErrorInsufficientResources == omxRetValue)
+ {
+ return KErrNoMemory;
+ }
+ else
+ {
+ return KErrGeneral;
+ }
+ }
+
+ TRAPD(err, AppendPortL(aPort));
+ if (KErrNone != err)
+ {
+ return err;
+ }
+
+ // Here, let's register this port into the call back manager so buffer
+ // marks can be propagated to the right port...
+ const OMX_U32 propagationPortIndex = aPort->BufferMarkPropagationPort();
+ if (propagationPortIndex != COmxILPort::KBufferMarkPropagationPortNotNeeded)
+ {
+ omxRetValue = iCallbacks.RegisterBufferMarkPropagationPort(aPort->Index(),
+ propagationPortIndex);
+ }
+
+ err = KErrNone;
+ if (OMX_ErrorNone != omxRetValue)
+ {
+ RemoveLastAppendedPort();
+ switch (omxRetValue)
+ {
+ case OMX_ErrorInsufficientResources:
+ {
+ err = KErrNoMemory;
+ }
+ break;
+ default:
+ {
+ err = KErrGeneral;
+ }
+ };
+ }
+
+ return err;
+
+ }
+
+TBool
+COmxILPortManager::RemoveBuffersFromPfOrCm(
+ COmxILPort* apPort, OMX_BOOL aRemoveFromPfOnly /* = OMX_FALSE */) const
+ {
+ __ASSERT_DEBUG(apPort, User::Panic(KOmxILPortManagerPanicCategory, 1));
+ DEBUG_PRINTF3(_L8("COmxILPortManager::RemoveBuffersFromPfOrCm: PORT[%d] aRemoveFromPfOnly[%s] "),
+ apPort->Index(), aRemoveFromPfOnly ? "TRUE" : "FALSE");
+
+ const TInt headerCount = apPort->Count();
+ OMX_BUFFERHEADERTYPE* pHeader = 0;
+ TBool allHeadersRemovedFromPf = ETrue;
+ for (TInt j=0; j<headerCount; ++j)
+ {
+ pHeader = (*apPort)[j];
+ if (!apPort->IsBufferAtHome(pHeader))
+ {
+ // Tell the PF to remove this header from its queues...
+ if (!iProcessingFunction.BufferRemovalIndication(
+ pHeader,
+ apPort->Direction()))
+ {
+ if (OMX_FALSE == aRemoveFromPfOnly)
+ {
+ if (!iCallbacks.BufferRemovalIndication(
+ pHeader,
+ apPort->Direction()))
+ {
+ allHeadersRemovedFromPf = EFalse;
+ }
+ else
+ {
+ apPort->SetBufferReturned(pHeader);
+ // Make sure the buffer contents are cleared
+ TOmxILUtil::ClearBufferContents(pHeader);
+ }
+ }
+ }
+ else
+ {
+ apPort->SetBufferReturned(pHeader);
+ // Make sure the buffer contents are cleared
+ TOmxILUtil::ClearBufferContents(pHeader);
+ }
+ }
+ }
+
+ return allHeadersRemovedFromPf;
+
+ }
+
+OMX_ERRORTYPE
+COmxILPortManager::GetParameter(OMX_INDEXTYPE aParamIndex,
+ TAny* apComponentParameterStructure) const
+ {
+ DEBUG_PRINTF(_L8("COmxILPortManager::GetParameter"));
+
+ TInt index = FindParamIndex(aParamIndex);
+ if (KErrNotFound == index)
+ {
+ return OMX_ErrorUnsupportedIndex;
+ }
+
+ OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+ switch(aParamIndex)
+ {
+ case OMX_IndexParamAudioInit:
+ case OMX_IndexParamImageInit:
+ case OMX_IndexParamVideoInit:
+ case OMX_IndexParamOtherInit:
+ {
+ if (OMX_ErrorNone !=
+ (omxRetValue =
+ TOmxILUtil::CheckOmxStructSizeAndVersion(
+ const_cast<OMX_PTR>(apComponentParameterStructure),
+ sizeof(OMX_PORT_PARAM_TYPE))))
+ {
+ return omxRetValue;
+ }
+
+ OMX_PORT_PARAM_TYPE*
+ pPortParamType
+ = static_cast<OMX_PORT_PARAM_TYPE*>(
+ apComponentParameterStructure);
+
+ switch(aParamIndex)
+ {
+ case OMX_IndexParamAudioInit:
+ *pPortParamType = iAudioParamInit;
+ break;
+ case OMX_IndexParamImageInit:
+ *pPortParamType = iImageParamInit;
+ break;
+ case OMX_IndexParamVideoInit:
+ *pPortParamType = iVideoParamInit;
+ break;
+ case OMX_IndexParamOtherInit:
+ *pPortParamType = iOtherParamInit;
+ break;
+ }
+
+ }
+ break;
+
+ default:
+ {
+ // Obtain the port index
+ OMX_U32 portIndex;
+ if (OMX_ErrorNone != GetPortIndexFromOmxStruct(
+ apComponentParameterStructure,
+ portIndex))
+ {
+ return OMX_ErrorBadPortIndex;
+ }
+
+ // Now delegate to the specific port
+ return iAllPorts[portIndex]->GetParameter(
+ aParamIndex,
+ apComponentParameterStructure);
+ }
+ };
+
+ return OMX_ErrorNone;
+
+ }
+
+OMX_ERRORTYPE
+COmxILPortManager::SetParameter(OMX_INDEXTYPE aParamIndex,
+ const TAny* apComponentParameterStructure,
+ OMX_BOOL aPortIsDisabled /* = OMX_FALSE */ )
+ {
+ DEBUG_PRINTF(_L8("COmxILPortManager::SetParameter"));
+
+ TInt index = FindParamIndex(aParamIndex);
+ if (KErrNotFound == index)
+ {
+ return OMX_ErrorUnsupportedIndex;
+ }
+
+ // Obtain the port index
+ OMX_U32 portIndex;
+ if (OMX_ErrorNone != GetPortIndexFromOmxStruct(
+ apComponentParameterStructure,
+ portIndex))
+ {
+ return OMX_ErrorBadPortIndex;
+ }
+
+ DEBUG_PRINTF2(_L8("COmxILPortManager::SetParameter : PORT[%u]"), portIndex);
+
+ // Grab the port here...
+ COmxILPort* pPort = iAllPorts[portIndex];
+
+ if (OMX_TRUE == aPortIsDisabled &&
+ pPort->IsEnabled() &&
+ !pPort->IsTransitioningToEnabled())
+ {
+ // There is an indication from the FSM that the port must be disabled,
+ // otherwise, this is not allowed in the current state.
+ return OMX_ErrorIncorrectStateOperation;
+ }
+
+ OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+ switch(aParamIndex)
+ {
+ case OMX_IndexParamAudioInit:
+ case OMX_IndexParamVideoInit:
+ case OMX_IndexParamImageInit:
+ case OMX_IndexParamOtherInit:
+ {
+ // Don't allow changes in the OMX_PORT_PARAM_TYPE structure
+ return OMX_ErrorUnsupportedIndex;
+ }
+ default:
+ {
+ TBool updateProcessingFunction = EFalse;
+ omxRetValue =
+ pPort->SetParameter(
+ aParamIndex,
+ apComponentParameterStructure,
+ updateProcessingFunction);
+
+ if (OMX_ErrorNone == omxRetValue)
+ {
+ if (updateProcessingFunction)
+ {
+ omxRetValue = iProcessingFunction.ParamIndication(
+ aParamIndex,
+ apComponentParameterStructure);
+ }
+ }
+
+ }
+ };
+
+ return omxRetValue;
+
+ }
+
+OMX_ERRORTYPE
+COmxILPortManager::GetConfig(OMX_INDEXTYPE aConfigIndex,
+ TAny* apComponentConfigStructure) const
+ {
+ DEBUG_PRINTF(_L8("COmxILPortManager::GetConfig"));
+
+ TInt index = FindConfigIndex(aConfigIndex);
+ if (KErrNotFound == index)
+ {
+ return OMX_ErrorUnsupportedIndex;
+ }
+
+ // Obtain the port index
+ OMX_U32 portIndex;
+ if (OMX_ErrorNone != GetPortIndexFromOmxStruct(apComponentConfigStructure,
+ portIndex))
+ {
+ return OMX_ErrorBadPortIndex;
+ }
+
+ // Now delegate to the specific port
+ return iAllPorts[portIndex]->GetConfig(
+ aConfigIndex,
+ apComponentConfigStructure);
+
+ }
+
+OMX_ERRORTYPE
+COmxILPortManager::SetConfig(OMX_INDEXTYPE aConfigIndex,
+ const TAny* apComponentConfigStructure)
+ {
+ DEBUG_PRINTF(_L8("COmxILPortManager::SetConfig"));
+
+#ifdef _OMXIL_COMMON_IL516C_ON
+
+ if (OMX_IndexConfigPortBufferReturnRequest == aConfigIndex)
+ {
+ OMX_U32 portIndex;
+ if (OMX_ErrorNone != GetPortIndexFromOmxStruct(
+ apComponentConfigStructure,
+ portIndex))
+ {
+ return OMX_ErrorBadPortIndex;
+ }
+ DEBUG_PRINTF2(_L8("COmxILPortManager::SetConfig : PORT[%u] OMX_IndexConfigPortBufferReturnRequest"), portIndex);
+
+ // Check the index of the port..
+ if ((OMX_ALL != portIndex) &&
+ (CheckPortIndex(portIndex) != OMX_ErrorNone))
+ {
+ return OMX_ErrorBadPortIndex;
+ }
+
+ // This error will be ignored...
+ OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+ if (portIndex != OMX_ALL)
+ {
+ omxRetValue = BufferEjectIndication(portIndex);
+ }
+ else
+ {
+ const TInt portCount = iAllPorts.Count();
+
+ for (TUint i = 0; i< portCount; ++i)
+ {
+ omxRetValue = BufferEjectIndication(iAllPorts[i]->Index());
+ }
+ }
+
+ return OMX_ErrorNone;
+
+ }
+#endif
+
+ TInt index = FindConfigIndex(aConfigIndex);
+ if (KErrNotFound == index)
+ {
+ return OMX_ErrorUnsupportedIndex;
+ }
+
+ // Obtain the port index
+ OMX_U32 portIndex;
+ if (OMX_ErrorNone != GetPortIndexFromOmxStruct(apComponentConfigStructure,
+ portIndex))
+ {
+ return OMX_ErrorBadPortIndex;
+ }
+
+ DEBUG_PRINTF2(_L8("COmxILPortManager::SetConfig : PORT[%u]"), portIndex);
+
+ TBool updateProcessingFunction = EFalse;
+ OMX_ERRORTYPE omxRetValue =
+ iAllPorts[portIndex]->SetConfig(
+ aConfigIndex,
+ apComponentConfigStructure,
+ updateProcessingFunction);
+
+ if (OMX_ErrorNone == omxRetValue)
+ {
+ if (updateProcessingFunction)
+ {
+ omxRetValue = iProcessingFunction.ConfigIndication(
+ aConfigIndex,
+ apComponentConfigStructure);
+ }
+ }
+
+ return omxRetValue;
+
+ }
+
+OMX_ERRORTYPE
+COmxILPortManager::GetExtensionIndex(
+ OMX_STRING aParameterName,
+ OMX_INDEXTYPE* apIndexType) const
+ {
+ DEBUG_PRINTF(_L8("COmxILPortManager::GetExtensionIndex"));
+
+ // See if the extension index is supported by any of the ports...
+ const TInt portCount = iAllPorts.Count();
+ OMX_ERRORTYPE retValue = OMX_ErrorNone;
+ for (TUint i = 0; i< portCount; ++i)
+ {
+ retValue = iAllPorts[i]->GetExtensionIndex(aParameterName,
+ apIndexType);
+ if (retValue != OMX_ErrorUnsupportedIndex)
+ {
+ return retValue;
+ }
+ }
+
+ return OMX_ErrorUnsupportedIndex;
+
+ }
+
+OMX_ERRORTYPE
+COmxILPortManager::PopulateBuffer(OMX_BUFFERHEADERTYPE** appBufferHdr,
+ OMX_U32 aPortIndex,
+ OMX_PTR apAppPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer,
+ TBool& portPopulationCompleted,
+ OMX_BOOL aPortIsDisabled /* = OMX_FALSE */ )
+ {
+ DEBUG_PRINTF(_L8("COmxILPortManager::PopulateBuffer"));
+
+ // Check the index of the port..
+ if (CheckPortIndex(aPortIndex) != OMX_ErrorNone)
+ {
+ return OMX_ErrorBadPortIndex;
+ }
+
+ // Grab the port here...
+ COmxILPort* pPort = iAllPorts[aPortIndex];
+
+#ifdef _OMXIL_COMMON_IL516C_ON
+ if (!apBuffer)
+ {
+ // Basically, if OMX_UseBuffer is used, the port must not be populated
+ // at this point, otherwise it is an error...
+ if (pPort->IsPopulated())
+ {
+ return OMX_ErrorIncorrectStateOperation;
+ }
+ }
+ else
+ {
+ // ... AllocateBuffer... this is only allowed if the the IL Client has
+ // issued the command to idle already..
+#endif
+
+ if (OMX_TRUE == aPortIsDisabled &&
+ pPort->IsEnabled() &&
+ !pPort->IsTransitioningToEnabled())
+ {
+ // There is an indication from the FSM that the port must be disabled,
+ // otherwise, the buffer allocation is not allowed in the current
+ // state. Note that a port may be transitioning to enabled and in that
+ // case the buffer population must be allowed...
+ return OMX_ErrorIncorrectStateOperation;
+ }
+
+#ifdef _OMXIL_COMMON_IL516C_ON
+ }
+#endif
+
+ // Check that in case of tunnelling, this port is not buffer supplier...
+ if (pPort->IsTunnelledAndBufferSupplier())
+ {
+ return OMX_ErrorBadPortIndex;
+ }
+
+ // Now delegate to the port...
+ OMX_ERRORTYPE omxRetValue;
+ if (OMX_ErrorNone != (omxRetValue = pPort->PopulateBuffer(
+ appBufferHdr,
+ apAppPrivate,
+ aSizeBytes,
+ apBuffer,
+ portPopulationCompleted)))
+ {
+ return omxRetValue;
+ }
+
+ if (portPopulationCompleted && pPort->IsTransitioningToEnabled())
+ {
+ // This is a case of port being enabled... Inform the port that it
+ // has been enabled..
+ pPort->SetTransitionToEnabledCompleted();
+
+ // For each enabled port, the IL Client must be notified with an
+ // enabled completion event...
+ omxRetValue = iCallbacks.CommandCompleteNotification(
+ OMX_CommandPortEnable, pPort->Index());
+ }
+
+ return omxRetValue;
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILPortManager::FreeBuffer(OMX_U32 aPortIndex,
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ TBool& portDepopulationCompleted,
+ OMX_BOOL aPortIsDisabled /* = OMX_FALSE */)
+ {
+ DEBUG_PRINTF3(_L8("COmxILPortManager::FreeBuffer : PORT[%u] BUFFER [%X]"), aPortIndex, apBufferHeader);
+
+ // Check the index of the port..
+ if (CheckPortIndex(aPortIndex) != OMX_ErrorNone)
+ {
+ return OMX_ErrorBadPortIndex;
+ }
+
+ // Grab the port here...
+ COmxILPort* pPort = iAllPorts[aPortIndex];
+
+ // Check that in case of tunnelling, this port is not buffer supplier...
+ if (pPort->IsTunnelledAndBufferSupplier())
+ {
+ return OMX_ErrorBadPortIndex;
+ }
+
+ TBool errorPortUnpopulated = EFalse;
+ if (OMX_TRUE == aPortIsDisabled &&
+ pPort->IsEnabled())
+ {
+ // There is an indication from the FSM that the port should be
+ // disabled. If that's not the case, the buffer deallocation will raise
+ // an OMX_ErrorPortUnpopulated error in the current state.
+
+ if (!pPort->IsBufferAtHome(apBufferHeader))
+ {
+ // FreeBuffer will normally be called in a situation where we are
+ // not suppliers and the supplier already got the buffer. So the
+ // buffer won't be on our side almost never.
+
+ if (!iTimePorts[aPortIndex] || !iImmediateReturnTimeBuffer)
+ {
+ // We'll tell the PF to remove this
+ // header from its queues, in case this is called in some strange
+ // situation (should not happen if the tunnelled component is well
+ // behaved)...
+ iProcessingFunction.BufferRemovalIndication(
+ apBufferHeader,
+ pPort->Direction());
+ }
+
+ // Set the returned flag as this buffer will not count as "away"
+ // anymore...
+ pPort->SetBufferReturned(apBufferHeader);
+ }
+
+ // We have to send the Port Unpopulated Error...
+ errorPortUnpopulated = ETrue;
+ }
+
+ OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+ // Now delegate to the port...
+ if (OMX_ErrorNone != (omxRetValue = pPort->FreeBuffer(
+ apBufferHeader,
+ portDepopulationCompleted)))
+ {
+ return omxRetValue;
+ }
+
+ if (errorPortUnpopulated)
+ {
+ if (OMX_ErrorNone !=
+ (omxRetValue =
+ iCallbacks.ErrorEventNotification(OMX_ErrorPortUnpopulated)))
+ {
+ return omxRetValue;
+ }
+ }
+
+
+ if (portDepopulationCompleted)
+ {
+ if (pPort->IsTransitioningToDisabled())
+ {
+ // Here we must complete the OMX_CommandPortDisable command
+
+ // Set the state of the port to disabled as the command has already
+ // completed...
+ pPort->SetTransitionToDisabledCompleted();
+
+ // For each disabled port, the IL Client must be notified
+ // with a disabled completion event...
+ omxRetValue = iCallbacks.CommandCompleteNotification(
+ OMX_CommandPortDisable, aPortIndex);
+
+ // Clear this flag here. Otherwise, the FSM would inform the client
+ // of a successful transition to OMX_StateIdle which is not the
+ // case...
+ portDepopulationCompleted = EFalse;
+ }
+ }
+
+ return omxRetValue;
+
+ }
+
+OMX_ERRORTYPE
+COmxILPortManager::TunnelRequest(OMX_U32 aPortIndex,
+ OMX_HANDLETYPE aTunneledComp,
+ OMX_U32 aTunneledPort,
+ OMX_TUNNELSETUPTYPE* apTunnelSetup,
+ OMX_BOOL aPortIsDisabled /* = OMX_FALSE */)
+ {
+ DEBUG_PRINTF3(_L8("COmxILPortManager::TunnelRequest : aTunneledComp [%X] aTunneledPort [%d]"), aTunneledComp, aTunneledPort);
+
+ // Check the index of the port..
+ if (CheckPortIndex(aPortIndex) != OMX_ErrorNone)
+ {
+ return OMX_ErrorBadPortIndex;
+ }
+
+ // Grab the port here...
+ COmxILPort* pPort = iAllPorts[aPortIndex];
+
+ if (OMX_TRUE == aPortIsDisabled &&
+ pPort->IsEnabled())
+ {
+ // There is an indication from the FSM that the port must be disabled,
+ // otherwise, the tunnel request is not allowed in the current state.
+ return OMX_ErrorIncorrectStateOperation;
+ }
+
+ OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+ // Check whether the tunnel is being torn down...
+ if (!aTunneledComp)
+ {
+ // Tell the port...
+ if (OMX_ErrorNone !=
+ (omxRetValue = pPort->TunnelRequest(
+ aTunneledComp,
+ aTunneledPort,
+ apTunnelSetup)))
+ {
+ return omxRetValue;
+ }
+
+ if (OMX_ErrorNone !=
+ (omxRetValue = iCallbacks.DeregisterTunnelCallback(aPortIndex)))
+ {
+ // This is serious enough...
+ return OMX_ErrorInvalidComponent;
+ }
+
+ // We are done here...
+ return OMX_ErrorNone;
+ }
+
+ // Check whether the port is being re-tunnelled...
+ if (pPort->IsTunnelled())
+ {
+ // Only two valid options here:
+ // 1.- The port is completely disabled...
+ // or...
+ // 2.- The port is enabled AND component in OMX_StateLoaded
+ if ((!pPort->IsEnabled() &&
+ !pPort->IsTransitioningToEnabled() &&
+ !pPort->IsTransitioningToDisabled())
+ ||
+ (pPort->IsEnabled() && !aPortIsDisabled))
+ {
+ if (OMX_ErrorNone !=
+ (omxRetValue = iCallbacks.DeregisterTunnelCallback(aPortIndex)))
+ {
+ return OMX_ErrorInvalidComponent;
+ }
+ }
+ else
+ {
+ return OMX_ErrorIncorrectStateOperation;
+ }
+ }
+
+ // Delegate to the port...
+ if (OMX_ErrorNone !=
+ (omxRetValue = pPort->TunnelRequest(
+ aTunneledComp,
+ aTunneledPort,
+ apTunnelSetup)))
+ {
+ return omxRetValue;
+ }
+
+ // From this point on, the port will assume that a tunnel has been
+ // successfully created. If there is a problem at other end, the IL Client
+ // will clear the tunnel on this side using ComponentTunnelRequest with
+ // NULL handle parameter
+
+ // Register the existence of a tunnel within the callback manager...
+ if (OMX_ErrorNone !=
+ (omxRetValue = iCallbacks.RegisterTunnelCallback(aPortIndex,
+ pPort->Direction(),
+ aTunneledComp,
+ aTunneledPort)))
+ {
+ // This is serious enough...
+ return OMX_ErrorInvalidComponent;
+ }
+
+ return OMX_ErrorNone;
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILPortManager::TunnellingBufferAllocation(TBool& aComponentPopulationCompleted,
+ TUint32 aPortIndex /* = OMX_ALL */)
+ {
+ DEBUG_PRINTF(_L8("COmxILPortManager::TunnellingBufferAllocation"));
+
+ aComponentPopulationCompleted = EFalse;
+
+ // Check the index of the port..
+ if ((OMX_ALL != aPortIndex) && (CheckPortIndex(aPortIndex) != OMX_ErrorNone))
+ {
+ return OMX_ErrorBadPortIndex;
+ }
+
+ const TInt portCount = iAllPorts.Count();
+ COmxILPort* pPort = 0;
+ OMX_U32 portIndex = 0;
+ TInt i=0;
+ OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+ do
+ {
+ if (aPortIndex != OMX_ALL)
+ {
+ // Grab the port here...
+ pPort = iAllPorts[aPortIndex];
+ portIndex = aPortIndex;
+ }
+ else
+ {
+ pPort = iAllPorts[i];
+ portIndex = pPort->Index();
+ }
+
+
+ if (pPort->IsEnabled() &&
+ pPort->IsTunnelledAndBufferSupplier() &&
+ !pPort->IsPopulated())
+ {
+ TBool portPopulationCompleted = EFalse;
+ if (OMX_ErrorNone !=
+ (omxRetValue = pPort->PopulateTunnel(portPopulationCompleted)))
+ {
+ // TODO: Check case of ports being enabled (error callback needed...)
+ return omxRetValue;
+ }
+
+ if (portPopulationCompleted && pPort->IsTransitioningToEnabled())
+ {
+ // This is a case of port being enabled... Inform the port that it
+ // has been enabled..
+ pPort->SetTransitionToEnabledCompleted();
+
+ // For each enabled port, the IL Client must be notified with an
+ // enabled completion event...
+ if (OMX_ErrorNone != (
+ omxRetValue = iCallbacks.CommandCompleteNotification(
+ OMX_CommandPortEnable, portIndex)))
+ {
+ return omxRetValue;
+ }
+ }
+
+ }
+
+ // Increment loop counter
+ ++i;
+ }
+ while (OMX_ALL == aPortIndex && i < portCount);
+
+ if (AllPortsPopulated())
+ {
+ DEBUG_PRINTF(_L8("COmxILPortManager::TunnellingBufferAllocation : AllPortsPopulated : [TRUE]"));
+ aComponentPopulationCompleted = ETrue;
+ }
+
+ return OMX_ErrorNone;
+
+ }
+
+OMX_ERRORTYPE
+COmxILPortManager::TunnellingBufferDeallocation(
+ TBool& aComponentDepopulationCompleted)
+ {
+ DEBUG_PRINTF(_L8("COmxILPortManager::TunnellingBufferDeallocation"));
+
+ aComponentDepopulationCompleted = EFalse;
+
+ const TInt portCount = iAllPorts.Count();
+ COmxILPort* pPort = 0;
+ TInt portDepopulationCounter = 0;
+ OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+ TBool portDepopulationCompleted = EFalse;
+ for (TInt i=0; i<portCount; ++i)
+ {
+ pPort = iAllPorts[i];
+ if (pPort->IsEnabled() && pPort->IsTunnelledAndBufferSupplier())
+ {
+ // TODO: Check that at this point, the ProcessingFunction must not
+ // hold any buffer header...
+ portDepopulationCompleted = EFalse;
+ if (OMX_ErrorNone !=
+ (omxRetValue = pPort->FreeTunnel(portDepopulationCompleted)))
+ {
+ return omxRetValue;
+ }
+
+ if (pPort->IsDePopulated())
+ {
+ portDepopulationCounter++;
+ }
+ }
+ }
+
+ if (AllPortsDePopulated())
+ {
+ DEBUG_PRINTF(_L8("COmxILPortManager::TunnellingBufferDeallocation : AllPortsDepopulated : [TRUE]"));
+ aComponentDepopulationCompleted = ETrue;
+ }
+
+ return OMX_ErrorNone;
+
+ }
+
+OMX_ERRORTYPE
+COmxILPortManager::InitiateTunnellingDataFlow(
+ OMX_U32 aPortIndex /* = OMX_ALL */,
+ OMX_BOOL aSuppliersAndNonSuppliers /* = OMX_FALSE */)
+ {
+ DEBUG_PRINTF2(_L8("COmxILPortManager::InitiateTunnellingDataFlow : PORT[%d]"), aPortIndex);
+
+ // Check the index of the port..
+ if ((OMX_ALL != aPortIndex) && (CheckPortIndex(aPortIndex) != OMX_ErrorNone))
+ {
+ return OMX_ErrorBadPortIndex;
+ }
+
+ // This is an indication that the component is ready to start exchanging
+ // buffers... Supplier tunnelled ports must initiate the buffer exchange in
+ // the tunnel...
+ const TInt portCount = iAllPorts.Count();
+ COmxILPort* pPort = 0;
+ OMX_U32 portIndex = 0;
+ TInt i=0;
+ do
+ {
+ if (aPortIndex != OMX_ALL)
+ {
+ // Grab the port here...
+ pPort = iAllPorts[aPortIndex];
+ portIndex = aPortIndex;
+ }
+ else
+ {
+ pPort = iAllPorts[i];
+ portIndex = pPort->Index();
+ }
+
+ if (pPort->IsEnabled() &&
+ ((OMX_TRUE == aSuppliersAndNonSuppliers) ||
+ pPort->IsTunnelledAndBufferSupplier()))
+ {
+ const TInt headerCount = pPort->Count();
+ OMX_BUFFERHEADERTYPE* pHeader = 0;
+ OMX_DIRTYPE portDir = OMX_DirMax;
+ OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+ for (TInt j=0; j<headerCount; ++j)
+ {
+ // Here, there are two options:
+ //
+ // 1. -The port is an input port, in which case, the buffer is
+ // directly sent to the callback manager which in turn sends it
+ // to the tunnelled component in charge of filling it
+ // (OMX_FillThisBuffer)
+ //
+ // 2.- The port is an output port, and the buffer must be sent
+ // to the processing function to be filled before the buffer
+ // can be sent to the tunnelled component. After that, the proc
+ // function will send the buffer to the call back manager to be
+ // sent to the tunnelled component (OMX_EmptyThisBuffer)...
+ pHeader = (*pPort)[j];
+
+ // Check that we actually have the buffer in our side...
+ if (!pPort->IsBufferAtHome(pHeader))
+ {
+ DEBUG_PRINTF2(_L8("COmxILPortManager::InitiateTunnellingDataFlow : BUFFER HEADER[%X] is not at home"),
+ pHeader);
+ continue;
+ }
+
+ portDir = pPort->Direction();
+ __ASSERT_DEBUG((OMX_DirInput == portDir ||
+ OMX_DirOutput == portDir),
+ User::Panic(KOmxILPortManagerPanicCategory, 1));
+
+ if (OMX_DirInput == portDir)
+ {
+ // Input port -> Send buffer to callback manager...
+ omxRetValue =
+ iCallbacks.BufferDoneNotification(pHeader,
+ portIndex,
+ portDir);
+ }
+ else
+ {
+ // Output port -> Send buffer to processing function...
+ omxRetValue =
+ iProcessingFunction.BufferIndication(pHeader,
+ portDir);
+ }
+
+ if (omxRetValue != OMX_ErrorNone)
+ {
+ return omxRetValue;
+ }
+
+ // Inform the port that one of its buffers has been sent
+ // away...
+ TBool bufferMarkedWithOwnMark = EFalse;
+ if (!pPort->SetBufferSent(pHeader, bufferMarkedWithOwnMark))
+ {
+ // The buffer header was not found...
+ return OMX_ErrorBadParameter;
+ }
+
+ // For each MarkBuffer command processed, the IL Client must be notified
+ // with an OMX_EventCommandComplete event...
+ if (bufferMarkedWithOwnMark)
+ {
+ if (OMX_ErrorNone !=
+ (omxRetValue = iCallbacks.CommandCompleteNotification(
+ OMX_CommandMarkBuffer, portIndex)))
+ {
+ return omxRetValue;
+ }
+ }
+
+ } // for (TInt j=0; j<headerCount; j++)
+ } // if (pPort->IsEnabled() && pPort->IsTunnelledAndBufferSupplier())
+
+ // Increment loop counter
+ ++i;
+ }
+ while(OMX_ALL == aPortIndex && i < portCount);
+
+ return OMX_ErrorNone;
+
+ }
+
+OMX_ERRORTYPE
+COmxILPortManager::BufferIndication(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_DIRTYPE aDirection,
+ OMX_BOOL aPortIsDisabled /* = OMX_FALSE */)
+ {
+
+ OMX_U32 portIndex = aDirection == OMX_DirInput ?
+ apBufferHeader->nInputPortIndex : apBufferHeader->nOutputPortIndex;
+
+ DEBUG_PRINTF3(_L8("COmxILPortManager::BufferIndication : PORT[%u] BUFFER [%X] "),
+ portIndex, apBufferHeader);
+
+ // Check the index of the port..
+ if (CheckPortIndex(portIndex) != OMX_ErrorNone)
+ {
+ return OMX_ErrorBadPortIndex;
+ }
+
+ // Grab the port here...
+ COmxILPort* pPort = iAllPorts[portIndex];
+
+ // Check that port direction is the correct one...
+ if (pPort->Direction() != aDirection)
+ {
+ return OMX_ErrorBadPortIndex;
+ }
+
+#ifdef _OMXIL_COMMON_IL516C_ON
+ (void)aPortIsDisabled;
+ // Only restriction here is that the port must be populated
+ if (!pPort->IsPopulated())
+ {
+ return OMX_ErrorIncorrectStateOperation;
+ }
+#endif
+
+#ifndef _OMXIL_COMMON_IL516C_ON
+ if (!pPort->IsEnabled() &&
+ !pPort->IsTransitioningToDisabled() &&
+ !pPort->IsTransitioningToEnabled())
+ {
+ return OMX_ErrorIncorrectStateOperation;
+ }
+
+ // Check port enabled property...
+ if (OMX_TRUE == aPortIsDisabled &&
+ pPort->IsEnabled())
+ {
+ // There is an indication from the FSM that the port must be disabled,
+ // otherwise, the buffer indication is not allowed in the current
+ // state.
+ return OMX_ErrorIncorrectStateOperation;
+ }
+
+#endif
+
+ OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+ // Check whether this port is a buffer supplier...
+ if (pPort->IsTunnelledAndBufferSupplier() &&
+ pPort->IsTransitioningToDisabled())
+ {
+ // Set the state of the port to disabled as the command has already
+ // completed...
+ if (!pPort->SetBufferReturned(apBufferHeader))
+ {
+ // The buffer header was not found...
+ return OMX_ErrorBadParameter;
+ }
+
+ if (pPort->HasAllBuffersAtHome())
+ {
+ // All buffers at home.. we can initiate here the
+ // depopulation of the tunnel...
+ TBool portDepopulationCompleted = EFalse;
+ if (OMX_ErrorNone !=
+ (omxRetValue = pPort->FreeTunnel(portDepopulationCompleted)))
+ {
+ return omxRetValue;
+ }
+
+ // Inform the port that the disabled command has
+ // completed...
+ pPort->SetTransitionToDisabledCompleted();
+
+ // For each disabled port, the IL Client must be notified
+ // with a port disabled completion event...
+ if (OMX_ErrorNone !=
+ (omxRetValue = iCallbacks.CommandCompleteNotification(
+ OMX_CommandPortDisable, portIndex)))
+ {
+ return omxRetValue;
+ }
+ }
+
+ // Make sure the buffer contents are cleared...
+ TOmxILUtil::ClearBufferContents(apBufferHeader);
+
+ // ... we are done.. no need to send the buffer to the
+ // processing function...
+ return OMX_ErrorNone;
+
+ } // if ((pPort->IsTunnelledAndBufferSupplier() && pPort->IsTransitioningToDisabled())
+#ifdef _OMXIL_COMMON_IL516C_ON
+ else if (pPort->IsTunnelled() && pPort->IsTransitioningToDisabled())
+ {
+ // We get here if the port is tunnelled, non-supplier and is currently
+ // in the process of transitioning to disabled... To avoid Race
+ // condition #3, we need to check that we've received the request from
+ // the supplier to return its buffers... however, we don't check it for
+ // now, it is just easier to return the buffer now...
+ DEBUG_PRINTF3(_L8("COmxILPortManager::BufferIndication : PORT [%u] BUFFER [%X] : "
+ "WARNING This port is being disabled, "
+ "the buffer id being returned to the tunnelled component"),
+ portIndex, apBufferHeader);
+ omxRetValue =
+ iCallbacks.BufferDoneNotification(apBufferHeader,
+ portIndex,
+ aDirection);
+ // ... we are done..
+ return OMX_ErrorNone;
+ }
+#endif
+
+
+ // Inform the port that one of its buffers is going to be sent to the
+ // processing function (exception applies to OMX_PortDomainOther ports) ...
+ // The port will also mark this buffer if the port
+ // has pending marks to be signalled... The buffer marks are finally
+ // processed/propagated by the callback manager once the buffer has been
+ // consumed by the processing function...
+ TBool bufferMarkedWithOwnMark = EFalse;
+ if (!pPort->SetBufferSent(apBufferHeader, bufferMarkedWithOwnMark))
+ {
+ return OMX_ErrorBadParameter;
+ }
+
+ // For each MarkBuffer command processed, the IL Client must be notified
+ // with an OMX_EventCommandComplete event...
+ if (bufferMarkedWithOwnMark)
+ {
+ if (OMX_ErrorNone !=
+ (omxRetValue = iCallbacks.CommandCompleteNotification(
+ OMX_CommandMarkBuffer, portIndex)))
+ {
+ return omxRetValue;
+ }
+ }
+
+ if (iImmediateReturnTimeBuffer && iTimePorts[portIndex])
+ {
+ // OMX_OTHER_FormatTime ports (such as COmxILClientClockPort) needs
+ // to return the buffer sooner to the buffer supplier component
+ OMX_TIME_MEDIATIMETYPE* pMediaTime =
+ reinterpret_cast<OMX_TIME_MEDIATIMETYPE*>(apBufferHeader->pBuffer);
+
+ OMX_TIME_MEDIATIMETYPE timeInfo;
+ if (pMediaTime)
+ {
+ timeInfo = *pMediaTime;
+ }
+
+ // Return the buffer (send the Buffer Done notification) via callback now.
+ apBufferHeader->nFilledLen = 0;
+
+ OMX_ERRORTYPE err = iCallbacks.ClockBufferDoneNotification(
+ apBufferHeader, portIndex, aDirection);
+
+ if (err != OMX_ErrorNone)
+ {
+ return err;
+ }
+
+ if (pMediaTime)
+ {
+ // Send time update to the processing function
+ err = iProcessingFunction.MediaTimeIndication(timeInfo);
+ }
+
+ __ASSERT_DEBUG(err != OMX_ErrorNotImplemented,
+ User::Panic(KOmxILPortManagerPanicCategory, 1));
+
+ return err;
+ }
+
+ return iProcessingFunction.BufferIndication(apBufferHeader,
+ aDirection);
+ }
+
+
+OMX_ERRORTYPE
+COmxILPortManager::BufferReturnIndication(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_DIRTYPE aDirection,
+ TBool& aAllBuffersReturned)
+ {
+
+ aAllBuffersReturned = EFalse;
+
+ OMX_U32 portIndex = aDirection == OMX_DirInput ?
+ apBufferHeader->nInputPortIndex : apBufferHeader->nOutputPortIndex;
+
+ DEBUG_PRINTF3(_L8("COmxILPortManager::BufferReturnIndication : PORT[%u] BUFFER [%X]"),
+ portIndex, apBufferHeader);
+
+ // Check the index of the port..
+ if (CheckPortIndex(portIndex) != OMX_ErrorNone)
+ {
+ return OMX_ErrorBadPortIndex;
+ }
+
+ // Grab the port here...
+ COmxILPort* pPort = iAllPorts[portIndex];
+
+ // Check that port direction is the correct one...
+ if (pPort->Direction() != aDirection)
+ {
+ return OMX_ErrorBadPortIndex;
+ }
+
+
+ if (!pPort->IsEnabled())
+ {
+ return OMX_ErrorBadPortIndex;
+ }
+
+ // Check that this port must be buffer supplier...
+ if (!pPort->IsTunnelledAndBufferSupplier())
+ {
+ return OMX_ErrorBadPortIndex;
+ }
+
+ // Inform the port that a buffer has returned...
+ if (!pPort->SetBufferReturned(apBufferHeader))
+ {
+ // The buffer header was not found...
+ return OMX_ErrorBadParameter;
+ }
+
+ // Make sure the buffer contents are cleared...
+ TOmxILUtil::ClearBufferContents(apBufferHeader);
+
+ if (pPort->HasAllBuffersAtHome())
+ {
+ aAllBuffersReturned = ETrue;
+ }
+
+ return OMX_ErrorNone;
+
+ }
+
+OMX_ERRORTYPE
+COmxILPortManager::BufferFlushIndicationFlushCommand(
+ TUint32 aPortIndex, TBool aEjectBuffers /* = ETrue */)
+ {
+ DEBUG_PRINTF2(_L8("COmxILPortManager::BufferFlushIndicationFlushCommand : PORT[%u]"), aPortIndex);
+
+ // Check the index of the port..
+ if ((OMX_ALL != aPortIndex) && (CheckPortIndex(aPortIndex) != OMX_ErrorNone))
+ {
+ return OMX_ErrorBadPortIndex;
+ }
+
+ OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+ RPointerArray<COmxILPort> portsToFlush;
+ RPointerArray<COmxILPort> portsToNotify;
+ const TInt portCount = iAllPorts.Count();
+ COmxILPort* pPort = 0;
+ TInt i=0;
+ TBool flushSuccessful;
+ do
+ {
+ flushSuccessful = ETrue;
+ if (aPortIndex != OMX_ALL)
+ {
+ // Grab the port here...
+ pPort = iAllPorts[aPortIndex];
+ }
+ else
+ {
+ pPort = iAllPorts[i];
+ }
+
+ if (pPort->IsEnabled() && pPort->Count())
+ {
+ // If port is tunnelled:
+ //
+ // - Output ports buffers are sent to the processing function when
+ // flushed
+ //
+ // - Input ports buffers are sent upstream.
+ //
+ // If port is non-tunnelled:
+ // - Buffers are ejected always...
+ if (pPort->IsTunnelled())
+ {
+ // Remove buffers from PF only...
+ RemoveBuffersFromPfOrCm(pPort, OMX_TRUE);
+
+ if (aEjectBuffers)
+ {
+ // Now we need to send input buffers upstream and ouput
+ // buffers to the PF... this is done by
+ // InitiateTunnellingDataFlow
+ if ((omxRetValue = InitiateTunnellingDataFlow(
+ pPort->Index(), OMX_TRUE)) != OMX_ErrorNone)
+ {
+ // The flush has failed, we need to notify the IL Cient
+ // via EventHandler...
+ iCallbacks.ErrorEventNotification(omxRetValue);
+ flushSuccessful = EFalse;
+ }
+ }
+ }
+ else
+ {
+ // All other ports are simply flushed...
+ portsToFlush.Append(pPort);
+ }
+ }
+ // Notify flushing completed, even if there was nothing to
+ // flush...
+ if (flushSuccessful)
+ {
+ portsToNotify.Append(pPort);
+ }
+
+ // Increment loop counter
+ ++i;
+ }
+ while(OMX_ALL == aPortIndex && i < portCount);
+
+ const TInt flushCount = portsToFlush.Count();
+ const TInt notifyCount = portsToNotify.Count();
+
+
+ if (iAllPorts.Count() == flushCount)
+ {
+ omxRetValue = iProcessingFunction.BufferFlushingIndication(
+ OMX_ALL,
+ OMX_DirMax);
+ }
+ else
+ {
+ for (i=0; i<flushCount && OMX_ErrorNone == omxRetValue; ++i)
+ {
+ pPort = portsToFlush[i];
+ omxRetValue = iProcessingFunction.BufferFlushingIndication(
+ pPort->Index(),
+ pPort->Direction());
+ }
+ }
+
+ for (i=0; i<notifyCount && OMX_ErrorNone == omxRetValue; ++i)
+ {
+ pPort = portsToNotify[i];
+ omxRetValue = iCallbacks.CommandCompleteNotification(OMX_CommandFlush,
+ portsToNotify[i]->Index());
+ }
+
+ portsToFlush.Close();
+ portsToNotify.Close();
+
+ return omxRetValue;
+
+ }
+
+OMX_ERRORTYPE
+COmxILPortManager::BufferFlushIndicationPauseOrExeToIdleCommand(
+ TBool& aAllBuffersReturnedToSuppliers)
+ {
+ DEBUG_PRINTF(_L8("COmxILPortManager::BufferFlushIndicationPauseOrExeToIdleCommand"));
+
+ aAllBuffersReturnedToSuppliers = EFalse;
+
+ const TInt portCount = iAllPorts.Count();
+ TBool foundBufferSupplierThatNeedsToWait = EFalse;
+ COmxILPort* pPort = 0;
+ OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+ for (TInt i=0; i<portCount; ++i)
+ {
+ pPort = iAllPorts[i];
+
+ if (pPort->Count())
+ {
+ if (pPort->IsTunnelledAndBufferSupplier() &&
+ !pPort->HasAllBuffersAtHome())
+ {
+ if (!RemoveBuffersFromPfOrCm(pPort))
+ {
+ // This port will have to wait to get some of its buffers
+ // returned by the tunnelled port...
+ foundBufferSupplierThatNeedsToWait = ETrue;
+#ifdef _OMXIL_COMMON_IL516C_ON
+ // Request buffer ejection from the tunnelled component
+ iCallbacks.EjectBuffersRequest(pPort->Index());
+#endif
+ }
+ continue;
+ }
+
+#ifdef _OMXIL_COMMON_IL516C_ON
+ if (!pPort->IsTunnelled())
+ {
+#endif
+
+ if (OMX_ErrorNone !=
+ (omxRetValue = iProcessingFunction.BufferFlushingIndication(
+ pPort->Index(),
+ pPort->Direction())))
+ {
+ return omxRetValue;
+ }
+
+#ifdef _OMXIL_COMMON_IL516C_ON
+ }
+#endif
+
+ }
+ }
+
+ if (!foundBufferSupplierThatNeedsToWait)
+ {
+ aAllBuffersReturnedToSuppliers = ETrue;
+ }
+
+ return OMX_ErrorNone;
+
+ }
+
+OMX_ERRORTYPE
+COmxILPortManager::PortEnableIndication(
+ TUint32 aPortIndex,
+ TBool aIndicationIsFinal)
+ {
+ DEBUG_PRINTF3(_L8("COmxILPortManager::PortEnableIndication: PORT[%u] TRANSITIONISFINAL[%d]"), aPortIndex, aIndicationIsFinal);
+
+ // Check the index of the port..
+ if ((OMX_ALL != aPortIndex) && (CheckPortIndex(aPortIndex) != OMX_ErrorNone))
+ {
+ return OMX_ErrorBadPortIndex;
+ }
+
+ const TInt portCount = iAllPorts.Count();
+ COmxILPort* pPort = 0;
+ OMX_U32 portIndex = 0;
+ TInt i=0;
+ OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+ do
+ {
+ // We do this so we loop or not depending on the needs...
+ if (aPortIndex != OMX_ALL)
+ {
+ // Grab the port here...
+ pPort = iAllPorts[aPortIndex];
+ portIndex = aPortIndex;
+ }
+ else
+ {
+ pPort = iAllPorts[i];
+ portIndex = pPort->Index();
+ }
+
+ // If port is already enabled, just indicate that the enable command has
+ // completed successfully
+ if (pPort->IsEnabled())
+ {
+ if (OMX_ErrorNone !=
+ (omxRetValue =
+ iCallbacks.CommandCompleteNotification(
+ OMX_CommandPortEnable, portIndex)))
+ {
+ return omxRetValue;
+ }
+
+ ++i;
+ continue;
+ }
+
+ // First check that no-one port is currently transitioning to
+ // Enabled...
+ if (pPort->IsTransitioningToEnabled() ||
+ pPort->IsTransitioningToDisabled())
+ {
+ // Send an error event... The spec mandates that the nData2 and
+ // the pEventData are 0 and NULL respectively, but they could be
+ // used here to hand some information like the index of the port
+ // that has failed...
+ if (OMX_ErrorNone !=
+ (omxRetValue =
+ iCallbacks.ErrorEventNotification(OMX_ErrorPortUnresponsiveDuringAllocation)))
+ {
+ return omxRetValue;
+ }
+
+ if (OMX_ALL == aPortIndex)
+ {
+ ++i;
+ continue;
+ }
+ else
+ {
+ return OMX_ErrorUndefined;
+ }
+ }
+
+ if (aIndicationIsFinal)
+ {
+ // Inform the port that it has been enabled..
+ pPort->SetTransitionToEnabledCompleted();
+
+ // For each enabled port, the IL Client must be notified
+ // with an enabled completion event...
+ if (OMX_ErrorNone !=
+ (omxRetValue =
+ iCallbacks.CommandCompleteNotification(
+ OMX_CommandPortEnable, portIndex)))
+ {
+ return omxRetValue;
+ }
+
+ }
+ else
+ {
+ // Inform the port that it is being enabled..
+ pPort->SetTransitionToEnabled();
+ }
+
+ // Increment loop counter
+ ++i;
+ }
+ while(OMX_ALL == aPortIndex && i < portCount);
+
+ return OMX_ErrorNone;
+
+ }
+
+OMX_ERRORTYPE
+COmxILPortManager::PortDisableIndication(
+ TUint32 aPortIndex)
+ {
+ DEBUG_PRINTF2(_L8("COmxILPortManager::PortDisableIndication: PORT[%u] "), aPortIndex);
+
+ // Check the index of the port..
+ if ((OMX_ALL != aPortIndex) && (CheckPortIndex(aPortIndex) != OMX_ErrorNone))
+ {
+ return OMX_ErrorBadPortIndex;
+ }
+
+ const TInt portCount = iAllPorts.Count();
+ COmxILPort* pPort = 0;
+ OMX_U32 portIndex = 0;
+ TInt i=0;
+ OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+ do
+ {
+ if (aPortIndex != OMX_ALL)
+ {
+ // Grab the port here...
+ pPort = iAllPorts[aPortIndex];
+ portIndex = aPortIndex;
+ }
+ else
+ {
+ pPort = iAllPorts[i];
+ portIndex = pPort->Index();
+ }
+
+ // If port is already disabled, just indicate that the disable command has
+ // completed successfully
+ if (!pPort->IsEnabled())
+ {
+ if (OMX_ErrorNone !=
+ (omxRetValue =
+ iCallbacks.CommandCompleteNotification(
+ OMX_CommandPortDisable, portIndex)))
+ {
+ return omxRetValue;
+ }
+
+ ++i;
+ continue;
+ }
+
+ // First check that no-one port is currently transitioning to
+ // Disabled...
+ if (pPort->IsTransitioningToDisabled() ||
+ pPort->IsTransitioningToEnabled())
+ {
+ // Send an error event... The spec mandates that the nData2 and
+ // the pEventData are 0 and NULL respectively, but they could be
+ // used here to hand some information like the index of the port
+ // that has failed...
+ if (OMX_ErrorNone !=
+ (omxRetValue =
+ iCallbacks.ErrorEventNotification(OMX_ErrorPortUnresponsiveDuringAllocation)))
+ {
+ return omxRetValue;
+ }
+
+ if (OMX_ALL == aPortIndex)
+ {
+ ++i;
+ continue;
+ }
+ else
+ {
+ return OMX_ErrorUndefined;
+ }
+
+ }
+
+ if (pPort->IsTunnelledAndBufferSupplier())
+ {
+ if (!pPort->HasAllBuffersAtHome() && !RemoveBuffersFromPfOrCm(pPort))
+ {
+ // Inform the port that it is being disabled
+ pPort->SetTransitionToDisabled();
+ // This port will have to wait to get all its buffers
+ // returned by the tunnelled port...
+#ifdef _OMXIL_COMMON_IL516C_ON
+ //... but request the ejection of the buffers first...
+ iCallbacks.EjectBuffersRequest(pPort->Index());
+#endif
+ }
+ else
+ {
+ // Buffer supplier with all buffers at home.. we can
+ // initiate here the depopulation of the tunnel...
+
+ // This boolean is not used here ...
+ TBool portDepopulationCompleted = EFalse;
+
+ // Better to ignore here any possible error in
+ // FreeTunnel... nothing we can do about it...
+ if (OMX_ErrorNone !=
+ (omxRetValue =
+ pPort->FreeTunnel(portDepopulationCompleted)))
+ {
+ return omxRetValue;
+ }
+
+ // Inform the port that the disabled command has
+ // completed...
+ pPort->SetTransitionToDisabledCompleted();
+
+ // For each disabled port, the IL Client must be notified
+ // with a disabled completion event...
+ if (OMX_ErrorNone !=
+ (omxRetValue =
+ iCallbacks.CommandCompleteNotification(
+ OMX_CommandPortDisable, portIndex)))
+ {
+ return omxRetValue;
+ }
+
+ } // else <- if (!pPort->HasAllBuffersAtHome())
+
+ } // if (pPort->IsTunnelledAndBufferSupplier())
+ else
+ {
+ if (pPort->Count() > 0)
+ {
+
+#ifdef _OMXIL_COMMON_IL516C_ON
+ if (!pPort->IsTunnelled())
+ {
+#endif
+
+ if (OMX_ErrorNone !=
+ (omxRetValue =
+ iProcessingFunction.BufferFlushingIndication(
+ portIndex,
+ pPort->Direction())))
+ {
+ return omxRetValue;
+ }
+
+#ifdef _OMXIL_COMMON_IL516C_ON
+ }
+#endif
+
+ // Inform the port that it is being disabled
+ pPort->SetTransitionToDisabled();
+ }
+ else
+ {
+ // Inform the port that the disabled command has
+ // completed...
+ pPort->SetTransitionToDisabledCompleted();
+
+ // For each disabled port, the IL Client must be notified
+ // with a disabled completion event...
+ if (OMX_ErrorNone !=
+ (omxRetValue =
+ iCallbacks.CommandCompleteNotification(
+ OMX_CommandPortDisable, portIndex)))
+ {
+ return omxRetValue;
+ }
+ }
+
+ }
+
+ // Increment loop counter
+ ++i;
+ }
+ while(OMX_ALL == aPortIndex && i < portCount);
+
+ return OMX_ErrorNone;
+
+ }
+
+OMX_ERRORTYPE
+COmxILPortManager::BufferMarkIndication(
+ TUint32 aPortIndex,
+ OMX_PTR ipMarkData)
+ {
+ DEBUG_PRINTF2(_L8("COmxILPortManager::BufferMarkIndication: PORT[%u] "), aPortIndex);
+
+ // Check the index of the port..
+ if (CheckPortIndex(aPortIndex) != OMX_ErrorNone)
+ {
+ return OMX_ErrorBadPortIndex;
+ }
+
+ const OMX_MARKTYPE* pMark = static_cast<OMX_MARKTYPE*>(ipMarkData);
+
+ if (!pMark->hMarkTargetComponent)
+ {
+ return OMX_ErrorBadParameter;
+ }
+
+ // Let's tell the port to store the mark so it can mark the next incoming
+ // buffer...
+ return iAllPorts[aPortIndex]->StoreBufferMark(pMark);
+
+ }
+
+#ifdef _OMXIL_COMMON_IL516C_ON
+OMX_ERRORTYPE
+COmxILPortManager::BufferEjectIndication(
+ TUint32 aPortIndex)
+ {
+ DEBUG_PRINTF2(_L8("COmxILPortManager::BufferEjectIndication: PORT[%u] "), aPortIndex);
+
+ // Check the index of the port..
+ if (CheckPortIndex(aPortIndex) != OMX_ErrorNone)
+ {
+ return OMX_ErrorBadPortIndex;
+ }
+
+ OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+ COmxILPort* pPort = iAllPorts[aPortIndex];
+
+ if (pPort->Count())
+ {
+ omxRetValue = iProcessingFunction.BufferFlushingIndication(
+ pPort->Index(),
+ pPort->Direction());
+ }
+
+ return omxRetValue;
+
+ }
+#endif
+
+OMX_ERRORTYPE
+COmxILPortManager::ComponentRoleIndication(TUint aComponentRoleIndex)
+ {
+ DEBUG_PRINTF2(_L8("COmxILPortManager::ComponentRoleIndication : aComponentRoleIndex[%u]"), aComponentRoleIndex);
+
+ // At this point, the IL Client wants to set the default role that the
+ // standard component is assuming. Therefore, the role defaults need to be
+ // reloaded into all ports and the processing function object.
+ OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+ const TInt portCount = iAllPorts.Count();
+ for (TUint i = 0; i< portCount; ++i)
+ {
+ if (OMX_ErrorNone !=
+ (omxRetValue =
+ iAllPorts[i]->SetComponentRoleDefaults(aComponentRoleIndex)))
+ {
+ return omxRetValue;
+ }
+ }
+
+ return iProcessingFunction.ComponentRoleIndication(aComponentRoleIndex);
+
+ }
+
+OMX_ERRORTYPE
+COmxILPortManager::PortSettingsChangeIndication(OMX_U32 aPortIndex,
+ TUint aPortSettingsIndex,
+ const TDesC8& aPortSettings,
+ OMX_EVENTTYPE& aEventForILClient)
+ {
+ DEBUG_PRINTF2(_L8("COmxILPortManager::PortSettingsChangeIndication: PORT[%u] "), aPortIndex);
+
+ // Check the index of the port..
+ if (CheckPortIndex(aPortIndex) != OMX_ErrorNone)
+ {
+ return OMX_ErrorBadPortIndex;
+ }
+
+ return iAllPorts[aPortIndex]->DoPortReconfiguration(
+ aPortSettingsIndex, aPortSettings, aEventForILClient);
+
+ }
+
+
+TBool
+COmxILPortManager::AllPortsPopulated() const
+ {
+
+ const TInt portCount = iAllPorts.Count();
+ COmxILPort* pPort = 0;
+ for (TInt i=0; i<portCount; ++i)
+ {
+ pPort = iAllPorts[i];
+ if (!pPort->IsEnabled())
+ {
+ continue;
+ }
+
+ if (!pPort->IsPopulated())
+ {
+ DEBUG_PRINTF(_L8("COmxILPortManager::AllPortsPopulated : [FALSE]"));
+ return EFalse;
+ }
+ }
+
+ DEBUG_PRINTF(_L8("COmxILPortManager::AllPortsPopulated : [TRUE]"));
+ return ETrue;
+
+ }
+
+TBool
+COmxILPortManager::AllPortsDePopulated() const
+ {
+
+ const TInt portCount = iAllPorts.Count();
+ for (TInt i=0; i<portCount; ++i)
+ {
+ if (!iAllPorts[i]->IsDePopulated())
+ {
+ DEBUG_PRINTF(_L8("COmxILPortManager::AllPortsDePopulated : [FALSE]"));
+ return EFalse;
+ }
+ }
+
+ DEBUG_PRINTF(_L8("COmxILPortManager::AllPortsDePopulated : [TRUE]"));
+ return ETrue;
+
+ }
+
+TBool
+COmxILPortManager::AllBuffersAtHome() const
+ {
+
+ const TInt portCount = iAllPorts.Count();
+ for (TInt i=0; i<portCount; ++i)
+ {
+ if (iAllPorts[i]->IsTunnelledAndBufferSupplier())
+ {
+ if (!iAllPorts[i]->HasAllBuffersAtHome())
+ {
+ DEBUG_PRINTF(_L8("COmxILPortManager::AllBuffersAtHome : [FALSE]"));
+ return EFalse;
+ }
+ }
+ }
+
+ DEBUG_PRINTF(_L8("COmxILPortManager::AllBuffersAtHome : [TRUE]"));
+ return ETrue;
+
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilportmanager.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,222 @@
+// 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 OMXILPORTMANAGER_H
+#define OMXILPORTMANAGER_H
+
+#include <openmax/il/khronos/v1_x/OMX_Component.h>
+
+#include <openmax/il/common/omxilport.h>
+#include "omxilindexmanager.h"
+#include "omxilportmanagerif.h"
+
+/**
+ Port Manager Panic category
+*/
+_LIT(KOmxILPortManagerPanicCategory, "OmxILPortManager");
+
+
+// Forward declarations
+class COmxILProcessingFunction;
+class MOmxILCallbackManagerIf;
+
+/**
+ OpenMAX IL Port Manager.
+
+ It keeps and manages a list of the ports configured in the component. The
+ Port Manager is used by the FSM object (@see COmxILFsm) to communicate with
+ the ports.
+
+*/
+NONSHARABLE_CLASS(COmxILPortManager) : public COmxILIndexManager,
+ public MOmxILPortManagerIf
+ {
+
+public:
+
+ static COmxILPortManager* NewL(
+ COmxILProcessingFunction& aProcessingFunction,
+ MOmxILCallbackManagerIf& aCallbacks,
+ const OMX_VERSIONTYPE& aOmxVersion,
+ OMX_U32 aNumberOfAudioPorts,
+ OMX_U32 aStartAudioPortNumber,
+ OMX_U32 aNumberOfImagePorts,
+ OMX_U32 aStartImagePortNumber,
+ OMX_U32 aNumberOfVideoPorts,
+ OMX_U32 aStartVideoPortNumber,
+ OMX_U32 aNumberOfOtherPorts,
+ OMX_U32 aStartOtherPortNumber,
+ OMX_BOOL aImmediateReturnTimeBuffer = OMX_TRUE);
+
+ ~COmxILPortManager();
+
+ TInt AddPort(const COmxILPort* aPort,
+ OMX_DIRTYPE aDirection);
+
+ OMX_ERRORTYPE GetParameter(
+ OMX_INDEXTYPE aParamIndex,
+ TAny* apComponentParameterStructure) const;
+
+ OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex,
+ const TAny* apComponentParameterStructure,
+ OMX_BOOL aPortIsDisabled = OMX_FALSE);
+
+ 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;
+
+ OMX_ERRORTYPE PopulateBuffer(OMX_BUFFERHEADERTYPE** appBufferHdr,
+ OMX_U32 aPortIndex,
+ OMX_PTR apAppPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer,
+ TBool& portPopulationCompleted,
+ OMX_BOOL aPortIsDisabled = OMX_FALSE);
+
+ OMX_ERRORTYPE FreeBuffer(OMX_U32 aPortIndex,
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ TBool& portDepopulationCompleted,
+ OMX_BOOL aPortIsDisabled = OMX_FALSE);
+
+ OMX_ERRORTYPE TunnelRequest(OMX_U32 aPortIndex,
+ OMX_HANDLETYPE aTunneledComp,
+ OMX_U32 aTunneledPort,
+ OMX_TUNNELSETUPTYPE* apTunnelSetup,
+ OMX_BOOL aPortIsDisabled = OMX_FALSE);
+
+ OMX_ERRORTYPE TunnellingBufferAllocation(
+ TBool& aComponentPopulationCompleted,
+ TUint32 aPortIndex = OMX_ALL);
+
+ OMX_ERRORTYPE TunnellingBufferDeallocation(
+ TBool& aComponentDePopulationCompleted);
+
+ OMX_ERRORTYPE InitiateTunnellingDataFlow(
+ OMX_U32 aPortIndex = OMX_ALL,
+ OMX_BOOL aSuppliersAndNonSuppliers = OMX_FALSE);
+
+ OMX_ERRORTYPE BufferIndication(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_DIRTYPE aDirection,
+ OMX_BOOL aPortIsDisabled = OMX_FALSE);
+
+ OMX_ERRORTYPE BufferReturnIndication(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_DIRTYPE aDirection,
+ TBool& aAllBuffersReturned);
+
+ OMX_ERRORTYPE BufferFlushIndicationFlushCommand(
+ TUint32 aPortIndex, TBool aEjectBuffers = ETrue);
+
+ OMX_ERRORTYPE BufferFlushIndicationPauseOrExeToIdleCommand(
+ TBool& aAllBuffersReturnedToSuppliers);
+
+ OMX_ERRORTYPE PortEnableIndication(
+ TUint32 aPortIndex,
+ TBool aIndicationIsFinal);
+
+ OMX_ERRORTYPE PortDisableIndication(
+ TUint32 aPortIndex);
+
+ OMX_ERRORTYPE BufferMarkIndication(OMX_U32 aPortIndex,
+ OMX_PTR ipMarkData);
+
+#ifdef _OMXIL_COMMON_IL516C_ON
+ OMX_ERRORTYPE BufferEjectIndication(
+ TUint32 aPortIndex);
+#endif
+
+ OMX_ERRORTYPE ComponentRoleIndication(TUint aComponentRoleIndex);
+
+ OMX_ERRORTYPE PortSettingsChangeIndication(OMX_U32 aPortIndex,
+ TUint aPortSettingsIndex,
+ const TDesC8& aPortSettings,
+ OMX_EVENTTYPE& aEventForILClient);
+
+ //
+ //
+ //
+ TBool AllPortsPopulated() const;
+
+ TBool AllPortsDePopulated() const;
+
+ TBool AllBuffersAtHome() const;
+
+
+private:
+
+ COmxILPortManager(COmxILProcessingFunction& aProcessingFunction,
+ MOmxILCallbackManagerIf& aCallbacks);
+
+ // From MOmxILPortManagerIf
+ void ConstructL(COmxILProcessingFunction& aProcessingFunction,
+ MOmxILCallbackManagerIf& aCallbacks,
+ const OMX_VERSIONTYPE& aOmxVersion,
+ OMX_U32 aNumberOfAudioPorts,
+ OMX_U32 aStartAudioPortNumber,
+ OMX_U32 aNumberOfImagePorts,
+ OMX_U32 aStartImagePortNumber,
+ OMX_U32 aNumberOfVideoPorts,
+ OMX_U32 aStartVideoPortNumber,
+ OMX_U32 aNumberOfOtherPorts,
+ OMX_U32 aStartOtherPortNumber,
+ OMX_BOOL aImmediateReturnTimeBuffer = OMX_TRUE);
+
+
+ void AppendPortL(const COmxILPort* aPort);
+ void RemoveLastAppendedPort();
+
+ inline OMX_ERRORTYPE CheckPortIndex(OMX_U32 aPortIndex) const;
+
+ inline OMX_ERRORTYPE GetPortIndexFromOmxStruct(
+ const TAny*& apComponentParameterStructure,
+ OMX_U32& aIndex) const;
+
+ inline OMX_ERRORTYPE GetPortIndexFromOmxStruct(
+ TAny*& apComponentParameterStructure,
+ OMX_U32& aIndex) const;
+
+ TBool RemoveBuffersFromPfOrCm(COmxILPort* apPort,
+ OMX_BOOL aRemoveFromPfOnly = OMX_FALSE) const;
+
+private:
+
+ COmxILProcessingFunction& iProcessingFunction;
+ MOmxILCallbackManagerIf& iCallbacks;
+
+ RPointerArray<COmxILPort> iAllPorts;
+ RArray<TBool> iTimePorts; // Indicate the corresponding port is OMX_OTHER_FormatTime
+
+ OMX_PORT_PARAM_TYPE iAudioParamInit;
+ OMX_PORT_PARAM_TYPE iImageParamInit;
+ OMX_PORT_PARAM_TYPE iVideoParamInit;
+ OMX_PORT_PARAM_TYPE iOtherParamInit;
+ OMX_BOOL iImmediateReturnTimeBuffer;
+ };
+
+#include "omxilportmanager.inl"
+
+#endif // OMXILPORTMANAGER_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilportmanager.inl Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,76 @@
+// 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
+*/
+
+inline OMX_ERRORTYPE
+COmxILPortManager::GetPortIndexFromOmxStruct(
+ TAny*& apComponentParameterStructure,
+ OMX_U32& aIndex) const
+ {
+ return GetPortIndexFromOmxStruct(
+ const_cast<const TAny*&>(apComponentParameterStructure), aIndex);
+ }
+
+
+inline OMX_ERRORTYPE
+COmxILPortManager::GetPortIndexFromOmxStruct(
+ const TAny*& apComponentParameterStructure,
+ OMX_U32& aIndex) const
+ {
+ OMX_U32* const pPortIndex =
+ reinterpret_cast<OMX_U32*>(
+ const_cast<TAny*&>(apComponentParameterStructure)) +
+ sizeof(OMX_U32) / sizeof(OMX_U32) +
+ sizeof(OMX_VERSIONTYPE) / sizeof(OMX_U32);
+
+ if (OMX_ErrorNone != CheckPortIndex(*pPortIndex))
+ {
+ return OMX_ErrorBadPortIndex;
+ }
+
+ aIndex = *pPortIndex;
+
+ return OMX_ErrorNone;
+
+ }
+
+
+/**
+ Checks that a port index is consistent with port information found in the
+ port's OMX_PORT_PARAM_TYPE structure, i.e., the number of ports in the
+ component.
+
+ @param aPortIndex The port index to be checked.
+
+ @return OMX_ErrorBadPortIndex in case of error. OMX_ErrorNone otherwise.
+*/
+inline OMX_ERRORTYPE
+COmxILPortManager::CheckPortIndex(OMX_U32 aPortIndex) const
+ {
+
+ if (aPortIndex >= iAllPorts.Count())
+ {
+ return OMX_ErrorBadPortIndex;
+ }
+
+ return OMX_ErrorNone;
+
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilportmanagerif.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,542 @@
+// 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 OMXILPORTMANAGERIF_H
+#define OMXILPORTMANAGERIF_H
+
+#include <openmax/il/khronos/v1_x/OMX_Component.h>
+
+// Forward declarations
+class COmxILProcessingFunction;
+class MOmxILCallbackManagerIf;
+class COmxILPort;
+
+/**
+ OpenMAX IL Port Manager Interface to be used by Port Manager
+ implementations.
+ */
+class MOmxILPortManagerIf
+ {
+
+public:
+
+ virtual ~MOmxILPortManagerIf();
+
+ /**
+ This method is used at component's construction time, i.e., in a factory
+ method of the final component implementation. The main component object
+ uses this method to add the component's ports to its port manager
+ instance. This is the only method that needs to be exported by Port
+ Manager's implementations. All other Port Managers public methods are
+ for internal use in the component framework.
+
+ @param aPort The pointer of the port instance to be added.
+
+ @param aDirection The direction of the port being added.
+
+ @return A Symbian error code indicating if the function call was
+ successful. KErrNone on success, otherwise another of the system-wide
+ error codes.
+ */
+ virtual TInt AddPort(const COmxILPort* aPort,
+ OMX_DIRTYPE aDirection) = 0;
+
+
+/**
+ Port Manager's interface for OpenMAX IL Standard API component
+ functions. These are for interal use in the component framework and should
+ not be exported by Port Manager implementations.
+
+ */
+
+
+ /**
+ Port Manager's version of the GetParameter OpenMAX IL component
+ API
+
+ @param aParamIndex The index of the OpenMAX IL param structure.
+
+ @param apComponentParameterStructure The pointer to the IL
+ client-allocated param structure to be filled by the Port Manager
+ (tipically delegated to the port)
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE GetParameter(
+ OMX_INDEXTYPE aParamIndex,
+ TAny* apComponentParameterStructure) const = 0;
+
+ /**
+ Port Manager's version of the SetParameter OpenMAX IL component
+ API
+
+ @param aParamIndex The index of the OpenMAX IL param structure.
+
+ @param apComponentParameterStructure The pointer to the IL
+ client-allocated param structure to be set into the port
+
+ @param aPortIsDisabled This is an indication from the FSM to the Port
+ Manager of whether the port should or should not be currently disabled
+ for this OpenMAX IL API to succeed. If aPortIsDisabled is OMX_TRUE and
+ the port is enabled this API is not allowed in the current state and the
+ Port Manager must return OMX_ErrorIncorrectStateOperation. Default value
+ is OMX_FALSE.
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex,
+ const TAny* apComponentParameterStructure,
+ OMX_BOOL aPortIsDisabled = OMX_FALSE) = 0;
+
+ /**
+ Port Manager's version of the GetConfig OpenMAX IL component
+ API
+
+ @param aParamIndex The index of the OpenMAX IL config structure.
+
+ @param apComponentParameterStructure The pointer to the config structure
+ to be filled by the Port Manager (tipically delegated to the port)
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE GetConfig(OMX_INDEXTYPE aConfigIndex,
+ TAny* apComponentConfigStructure) const = 0;
+
+ /**
+ Port Manager's version of the SetConfig OpenMAX IL component
+ API
+
+ @param aParamIndex The index of the OpenMAX IL config structure.
+
+ @param apComponentParameterStructure The pointer to the config structure
+ to be set into the port
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE SetConfig(OMX_INDEXTYPE aConfigIndex,
+ const TAny* apComponentConfigStructure) = 0;
+
+ /**
+ Port Manager's version of the GetExtensionIndex OpenMAX IL component
+ API
+
+ @param aParameterName An OMX_STRING value that shall be less than 128
+ characters long including the trailing null byte. The Port Manager will
+ translate this string into a configuration index.
+
+ @param apIndexType A pointer to the OMX_INDEXTYPE structure that is to
+ receive the index value.
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE GetExtensionIndex(OMX_STRING aParameterName,
+ OMX_INDEXTYPE* apIndexType) const = 0;
+
+
+ /**
+ Port Manager's version of the AllocateBuffer/UseBuffer OpenMAX IL component
+ APIs
+
+ @param appBufferHdr A pointer to a pointer of an OMX_BUFFERHEADERTYPE
+ structure that receives the pointer to the buffer header.
+
+ @param aPortIndex The index of the port that will use the specified
+ buffer.
+
+ @param apAppPrivate A pointer that refers to an implementation-specific
+ memory area that is under responsibility of the supplier of the buffer
+
+ @param aSizeBytes The buffer size in bytes
+
+ @param apBuffer A pointer to the memory buffer area to be used
+
+ @param [out] aPortPopulationCompleted This is an indication from the
+ Port Manager to the FSM of whether the port population has completed or
+ not.
+
+ @param aPortIsDisabled This is an indication from the FSM to the Port
+ Manager of whether the port should or should not be currently disabled
+ for this OpenMAX IL API to succeed. If aPortIsDisabled is OMX_TRUE and
+ the port is enabled this API is not allowed in the current state and the
+ Port Manager must return OMX_ErrorIncorrectStateOperation. Default value
+ is OMX_FALSE.
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE PopulateBuffer(OMX_BUFFERHEADERTYPE** appBufferHdr,
+ OMX_U32 aPortIndex,
+ OMX_PTR apAppPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer,
+ TBool& aPortPopulationCompleted,
+ OMX_BOOL aPortIsDisabled = OMX_FALSE) = 0;
+
+ /**
+ Port Manager's version of the FreeBuffer OpenMAX IL component
+ API
+
+ @param aPortIndex The index of the port that is using the specified
+ buffer
+
+ @param apBufferHeader A pointer to an OMX_BUFFERHEADERTYPE structure
+
+ @param aPortDepopulationCompleted This is a g
+
+ @param aPortIsDisabled This is an indication from the FSM to the Port
+ Manager of whether the port should or should not be currently disabled
+ for this OpenMAX IL API to succeed. If aPortIsDisabled is OMX_TRUE and
+ the port is enabled this API is not allowed in the current state and the
+ Port Manager must return OMX_ErrorIncorrectStateOperation. Default value
+ is OMX_FALSE.
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE FreeBuffer(OMX_U32 aPortIndex,
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ TBool& aPortDepopulationCompleted,
+ OMX_BOOL aPortIsDisabled = OMX_FALSE) = 0;
+
+ /**
+ Port Manager's version of the EmptyThisBuffer/FillThisBuffer OpenMAX IL
+ component APIs. This is to be used by the FSM in any state except
+ substates OMX_StateExecuting to OMX_StateIdle and OMX_StatePause to
+ OMX_StateIdle, in which case BufferReturnIndication should be used.
+
+ @param apBufferHeader A pointer to an OMX_BUFFERHEADERTYPE structure
+
+ @param aDirection The direction of the port that received the
+ EmptyThisBuffer/FillThisBuffer call
+
+ @param aPortIsDisabled This is an indication from the FSM to the Port
+ Manager of whether the port should or should not be currently disabled
+ for this OpenMAX IL API to succeed. If aPortIsDisabled is OMX_TRUE and
+ the port is enabled this API is not allowed in the current state and the
+ Port Manager must return OMX_ErrorIncorrectStateOperation. Default value
+ is OMX_FALSE.
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE BufferIndication(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_DIRTYPE aDirection,
+ OMX_BOOL aPortIsDisabled = OMX_FALSE) = 0;
+
+ /**
+ Port Manager's version of the EmptyThisBuffer/FillThisBuffer OpenMAX IL
+ component APIs. This is to be used by the FSM when the component is in
+ substates OMX_StateExecuting to OMX_StateIdle and OMX_StatePause to
+ OMX_StateIdle.
+
+ @param apBufferHeader A pointer to an OMX_BUFFERHEADERTYPE structure
+
+ @param aDirection The direction of the port that received the
+ EmptyThisBuffer/FillThisBuffer call
+
+ @param [out] aAllBuffersReturned ETrue if all buffers have already been
+ returned to ports managed by the Port Manager. This is an indication to
+ the FSM that the component is ready to be complete the transition to
+ OMX_StateIdle.
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE BufferReturnIndication(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_DIRTYPE aDirection,
+ TBool& aAllBuffersReturned) = 0;
+
+ /**
+ Port Manager's version of the ComponentTunnelRequest OpenMAX IL
+ component API. This is to be used by the FSM when the component is in
+ substates OMX_StateExecuting to OMX_StateIdle and OMX_StatePause to
+ OMX_StateIdle.
+
+ @param aPortIndex The index of the local port that is going to be tunnelled
+
+ @param aTunneledComp The handle of the other component that participates
+ in the tunnel. When this parameter is NULL, the port specified in aPortIndex
+ should be configured for non-tunneled communication with the IL client.
+
+ @param aTunneledPort The index of the remote port to be tunnelled with
+
+ @param apTunnelSetup The structure that contains data for the tunneling
+ negotiation between components.
+
+ @param aPortIsDisabled This is an indication from the FSM to the Port
+ Manager of whether the port should or should not be currently disabled
+ for this OpenMAX IL API to succeed. If aPortIsDisabled is OMX_TRUE and
+ the port is enabled this API is not allowed in the current state and the
+ Port Manager must return OMX_ErrorIncorrectStateOperation. Default value
+ is OMX_FALSE.
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE TunnelRequest(OMX_U32 aPortIndex,
+ OMX_HANDLETYPE aTunneledComp,
+ OMX_U32 aTunneledPort,
+ OMX_TUNNELSETUPTYPE* apTunnelSetup,
+ OMX_BOOL aPortIsDisabled = OMX_FALSE) = 0;
+
+
+/**
+ Other Port Manager's interface, with no direct mapping to OpenMAX IL
+ APIs. These are also for interal use in the component framework and should
+ not be exported by Port Manager implementations.
+
+ */
+
+ /**
+ This is and indication from the FSM to the Port Manager that the
+ component is transitioning from OMX_StateLoaded to OMX_StateIdle and
+ that the Port Manager shall initiate the allocation of buffers in
+ tunnelled supplier ports.
+
+ @param [out] aComponentPopulationCompleted This is an indication from
+ the Port Manager to the FSM of whether the population has completed in
+ all ports, suppliers and non-suppliers.
+
+ @param aPortIndex The index of the port to start populating. OMX_ALL by default.
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE TunnellingBufferAllocation(
+ TBool& aComponentPopulationCompleted,
+ TUint32 aPortIndex = OMX_ALL) = 0;
+
+ /**
+ This is and indication from the FSM to the Port Manager that the
+ component is transitioning to from OMX_StateExecuting or OMX_StatePause
+ to OMX_StateIdle and that the Port Manager shall initiate the de-allocation
+ of buffers in tunnelled supplier ports.
+
+ @param [out] aComponentDePopulationCompleted This is an indication from
+ the Port Manager to the FSM of whether the de-population has completed in
+ all ports, suppliers and non-suppliers.
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE TunnellingBufferDeallocation(
+ TBool& aComponentDePopulationCompleted) = 0;
+
+ /**
+ This is and indication from the FSM to the Port Manager that the
+ component is transitioning to from OMX_StateIdle to OMX_StatePause or
+ OMX_StateExecuting and that the Port Manager shall initiate the data
+ flow in the tunnel (supplier input ports buffers are sent to the Callback Manager
+ and supplier ouput ports buffers to the Processing Function)
+
+ @param aPortIndex The index of the port that this function applies
+ to. OMX_ALL if applies to all tunnelled supplier ports in the component.
+
+ @param aSuppliersAndNonSuppliers This overrides the default behaviour of
+ this function, i.e., initiating the data flow for the supplier
+ ports. This is an indication to the Port Manager that non-supplier ports
+ should be included too.
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE InitiateTunnellingDataFlow(
+ OMX_U32 aPortIndex = OMX_ALL,
+ OMX_BOOL aSuppliersAndNonSuppliers = OMX_FALSE) = 0;
+
+
+ /**
+ This is and indication from the FSM to the Port Manager that the
+ component has received a command to flush buffers.
+
+ @param aPortIndex The index of the port that this function applies
+ to. OMX_ALL if applies to all tunnelled supplier ports in the component.
+
+ @param aEjectBuffers This is an indication to the Port Manager of
+ whether owned buffers should be circulated or not as a consequence of
+ flushing. The default is ETrue (buffers are ejected, ie sent to the
+ Processing Function or the Callback Manager as needed). The FSM may
+ override this default behaviour by using EFalse, e.g. if a flush command
+ is received when the component is already in OMX_StateIdle state.
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE BufferFlushIndicationFlushCommand(
+ TUint32 aPortIndex, TBool aEjectBuffers = ETrue) = 0;
+
+ /**
+ This is and indication from the FSM to the Port Manager that the
+ component needs to flush buffers as a consequence of a transition to
+ OMX_StateIdle from OMX_StateExecuting or OMX_StatePause.
+
+ @param [out] aAllBuffersReturnedToSuppliers This is an indication from
+ the Port Manager to the FSM that all buffers have been sent/received
+ to/from suppliers/non-suppliers and that the component is ready to
+ complete the transition to OMX_StateIdle.
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE BufferFlushIndicationPauseOrExeToIdleCommand(
+ TBool& aAllBuffersReturnedToSuppliers) = 0;
+
+ /**
+ This is and indication from the FSM to the Port Manager that it needs to
+ enable some port.
+
+ @param aPortIndex The index of the port to be enabled. OMX_ALL if all ports.
+
+ @param aIndicationIsFinal When this is ETrue, this is an indication from
+ the FSM to the Port Manager that the current state of the component does
+ not require the allocation of buffers (e.g. OMX_StateLoaded) and the
+ port should complete the transition to enabled and forward the command
+ complete event to the IL Client.
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE PortEnableIndication(
+ TUint32 aPortIndex,
+ TBool aIndicationIsFinal) = 0;
+
+ /**
+ This is and indication from the FSM to the Port Manager that it needs to
+ disable some port.
+
+ @param aPortIndex The index of the port to be disabled. OMX_ALL if all ports.
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE PortDisableIndication(
+ TUint32 aPortIndex) = 0;
+
+ /**
+ This is and indication from the FSM to the Port Manager that there is a
+ buffer mark command to be applied to some port.
+
+ @param aPortIndex The index of the port that receives the buffer mark command.
+
+ @param ipMarkData The pointer to the buffer mark data
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE BufferMarkIndication(OMX_U32 aPortIndex,
+ OMX_PTR ipMarkData) = 0;
+
+ /**
+ This is an indication to the Port Manager that there is a request to
+ change the role of the component and that the component's ports need to
+ be adjusted to it.
+
+ @param aComponentRoleIndex This is the index from the internal list of
+ roles supported by the component
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE ComponentRoleIndication(
+ TUint aComponentRoleIndex) = 0;
+
+ /**
+ This is an indication to the Port Manager that there is a port that
+ needs to be reconfigured.
+
+ @param aPortIndex The index of the port to be reconfigured.
+
+ @param aPortSettingsIndex This is an index of the port structure to be
+ reconfigured
+
+ @param aPortSettings This is a descriptor that contains the information
+ to be passed to the port that is to be reconfigured
+
+ @param [out] aEventForILClient This is the event returned by the port
+ after reconfiguration so the caller can forward that to the IL Client.
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE PortSettingsChangeIndication(
+ OMX_U32 aPortIndex,
+ TUint aPortSettingsIndex,
+ const TDesC8& aPortSettings,
+ OMX_EVENTTYPE& aEventForILClient) = 0;
+
+ /**
+ Returns ETrue is all ports are currently populated
+ */
+ virtual TBool AllPortsPopulated() const = 0;
+
+ /**
+ Returns ETrue is all ports are currently depopulated
+ */
+ virtual TBool AllPortsDePopulated() const = 0;
+
+ /**
+ Returns ETrue is all buffer headers are currently with the Port Manager
+ */
+ virtual TBool AllBuffersAtHome() const = 0;
+
+
+private:
+
+ /**
+ Virtual constructor. This is mostly for reference. Port Managers should
+ follow the below contruction interface.
+
+ @param aProcessingFunction The component's processing function
+
+ @param aCallbacks The component's callback manager
+
+ @param aOmxVersion The IL Spec version in use
+
+ @param aNumberOfAudioPorts Number of audio ports in the component
+
+ @param aStartAudioPortNumber The start index for audio ports
+
+ @param aNumberOfImagePorts Number of image ports in the component
+
+ @param aStartImagePortNumber The start index for image ports
+
+ @param aNumberOfVideoPorts Number of video ports in the component
+
+ @param aStartVideoPortNumber The start index for video ports
+
+ @param aNumberOfOtherPorts Number of other ports in the component
+
+ @param aStartOtherPortNumber The start index for other ports
+
+ @param aImmediateReturnTimeBuffer This only applies to components with a
+ clock client port. Indicates whether the Port Manager must forward an
+ arriving clock buffer to the Callback Manager (ETrue) or to the
+ Processing Function (EFalse) . If the clock buffer is to be forwarded to
+ the Processing Function, this will happen using the BufferIndication
+ function of the component's PF. Otherwise, PF's MediaTimeIndication is
+ used instead.
+ */
+ virtual void ConstructL(COmxILProcessingFunction& aProcessingFunction,
+ MOmxILCallbackManagerIf& aCallbacks,
+ const OMX_VERSIONTYPE& aOmxVersion,
+ OMX_U32 aNumberOfAudioPorts,
+ OMX_U32 aStartAudioPortNumber,
+ OMX_U32 aNumberOfImagePorts,
+ OMX_U32 aStartImagePortNumber,
+ OMX_U32 aNumberOfVideoPorts,
+ OMX_U32 aStartVideoPortNumber,
+ OMX_U32 aNumberOfOtherPorts,
+ OMX_U32 aStartOtherPortNumber,
+ OMX_BOOL aImmediateReturnTimeBuffer = OMX_TRUE) = 0;
+
+ };
+
+#include "omxilportmanagerif.inl"
+
+#endif // OMXILPORTMANAGERIF_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilportmanagerif.inl Wed Aug 25 12:40:50 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:
+//
+
+
+/**
+@file
+@internalComponent
+*/
+
+inline MOmxILPortManagerIf::~MOmxILPortManagerIf()
+ {
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilprocessingfunction.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,72 @@
+// 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/omxilprocessingfunction.h>
+
+
+EXPORT_C
+COmxILProcessingFunction::COmxILProcessingFunction(
+ MOmxILCallbackNotificationIf& aCallbacks)
+ :
+ iCallbacks(aCallbacks)
+ {
+ DEBUG_PRINTF(_L8("COmxILProcessingFunction::COmxILProcessingFunction"));
+
+ }
+
+EXPORT_C
+COmxILProcessingFunction::~COmxILProcessingFunction()
+ {
+ DEBUG_PRINTF(_L8("COmxILProcessingFunction::~COmxILProcessingFunction"));
+
+ }
+
+/**
+ This is an indication from the framework that the IL Client wants to set the
+ default role that a standard component is assuming. Therefore, the role
+ defaults need to be reloaded into all ports and the Processing
+ Function. This method is the indication to the processing function that the
+ role defaults have been set into the component ports. A component not
+ claiming support of any of the standard component roles does not need to
+ override this method.
+
+ @param aComponentRoleIndex An integer associated to the new component role.
+
+ @return OMX_ERRORTYPE
+ */
+EXPORT_C OMX_ERRORTYPE
+COmxILProcessingFunction::ComponentRoleIndication(TUint /* aComponentRoleIndex */)
+ {
+ return OMX_ErrorNotImplemented;
+ }
+
+EXPORT_C
+OMX_ERRORTYPE COmxILProcessingFunction::MediaTimeIndication(const OMX_TIME_MEDIATIMETYPE& )
+ {
+ return OMX_ErrorNotImplemented;
+ }
+
+EXPORT_C
+TInt COmxILProcessingFunction::Extension_(TUint aExtensionId, TAny *&a0, TAny *a1)
+ {
+ return CBase::Extension_(aExtensionId, a0, a1);
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilspecversion.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,81 @@
+// 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>
+
+const TUint8 TOmxILSpecVersion::KSpecVersionMajor;
+const TUint8 TOmxILSpecVersion::KSpecVersionMinor;
+const TUint8 TOmxILSpecVersion::KSpecVersionRevision;
+const TUint8 TOmxILSpecVersion::KSpecVersionStep;
+
+EXPORT_C
+TOmxILVersion::TOmxILVersion(TUint8 aMajor,
+ TUint8 aMinor,
+ TUint8 aRev,
+ TUint8 aStep)
+ {
+ iSpecVersion.s.nVersionMajor = aMajor;
+ iSpecVersion.s.nVersionMinor = aMinor;
+ iSpecVersion.s.nRevision = aRev;
+ iSpecVersion.s.nStep = aStep;
+ }
+
+EXPORT_C
+TOmxILVersion::operator OMX_VERSIONTYPE&()
+ {
+ return iSpecVersion;
+ }
+
+#ifdef _OMXIL_COMMON_SPEC_VERSION_CHECKS_ON
+TBool
+TOmxILVersion::operator!=(
+ const OMX_VERSIONTYPE& aVer) const
+ {
+ return !operator==(aVer);
+ }
+
+TBool
+TOmxILVersion::operator==(
+ const OMX_VERSIONTYPE& aVer) const
+ {
+ if (iSpecVersion.s.nVersionMajor == aVer.s.nVersionMajor &&
+ iSpecVersion.s.nVersionMinor == aVer.s.nVersionMinor &&
+ iSpecVersion.s.nRevision == aVer.s.nRevision &&
+ iSpecVersion.s.nStep == aVer.s.nStep)
+ {
+ return ETrue;
+ }
+ return EFalse;
+ }
+#endif
+
+EXPORT_C
+TOmxILSpecVersion::TOmxILSpecVersion()
+ :
+ TOmxILVersion(KSpecVersionMajor,
+ KSpecVersionMinor,
+ KSpecVersionRevision,
+ KSpecVersionStep)
+ {
+ }
+
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilstate.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,1998 @@
+// 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 "omxilstate.h"
+#include "omxilfsm.h"
+#include <openmax/il/common/omxilstatedefs.h>
+#include "omxilcommand.h"
+#include <openmax/il/common/omxilconfigmanager.h>
+#include "omxilcallbackmanager.h"
+
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILState::GetParameter(
+ const COmxILFsm& aFsm,
+ OMX_INDEXTYPE aParamIndex,
+ TAny* apComponentParameterStructure) const
+ {
+ DEBUG_PRINTF(_L8("COmxILState::GetParameter"));
+
+ // This API can be used independently of the current state of the
+ // component. Let's try first the Port Manager to check if the index is
+ // known there
+ OMX_ERRORTYPE retValue =
+ aFsm.iPortManager.GetParameter(aParamIndex,
+ apComponentParameterStructure);
+
+ if (OMX_ErrorUnsupportedIndex == retValue)
+ {
+ // Otherwise, try Config Manager...
+ retValue = aFsm.iConfigManager.GetParameter(
+ aParamIndex,
+ apComponentParameterStructure);
+ }
+
+ return retValue;
+
+ }
+
+// This SetParameter version must be used in the following states:
+// - OMX_StateIdle,
+// - OMX_StateExecuting,
+// - OMX_StatePaused, and
+//
+OMX_ERRORTYPE
+COmxILFsm::COmxILState::SetParameter(
+ COmxILFsm& aFsm,
+ OMX_INDEXTYPE aParamIndex,
+ const TAny* apComponentParameterStructure)
+ {
+ DEBUG_PRINTF(_L8("COmxILState::SetParameter"));
+
+ OMX_ERRORTYPE retValue =
+ aFsm.iPortManager.SetParameter(
+ aParamIndex,
+ apComponentParameterStructure,
+ OMX_TRUE // Port must be disabled
+ );
+
+ if (OMX_ErrorUnsupportedIndex == retValue)
+ {
+ // Try Config Manager now...
+ retValue = aFsm.iConfigManager.SetParameter(
+ aParamIndex,
+ apComponentParameterStructure,
+ OMX_FALSE // run-time
+ );
+ }
+
+ return retValue;
+
+ }
+
+// This SetParameter version must be used in the following states:
+// - OMX_StateLoaded and derived states,
+// - OMX_StateWaitForResources
+//
+OMX_ERRORTYPE
+COmxILFsm::COmxILState::SetParameterV2(
+ COmxILFsm& aFsm,
+ OMX_INDEXTYPE aParamIndex,
+ const TAny* apComponentParameterStructure)
+ {
+ DEBUG_PRINTF(_L8("COmxILState::SetParameterV2"));
+
+ OMX_ERRORTYPE retValue =
+ aFsm.iPortManager.SetParameter(aParamIndex,
+ apComponentParameterStructure);
+
+ if (OMX_ErrorUnsupportedIndex == retValue)
+ {
+ // Try Config Manager now...
+ retValue = aFsm.iConfigManager.SetParameter(
+ aParamIndex,
+ apComponentParameterStructure);
+ }
+
+ return retValue;
+
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILState::GetConfig(
+ const COmxILFsm& aFsm,
+ OMX_INDEXTYPE aConfigIndex,
+ TAny* apComponentConfigStructure) const
+ {
+ DEBUG_PRINTF(_L8("COmxILState::GetConfig"));
+
+ OMX_ERRORTYPE retValue =
+ aFsm.iPortManager.GetConfig(aConfigIndex,
+ apComponentConfigStructure);
+
+ if (OMX_ErrorUnsupportedIndex == retValue)
+ {
+ // Try Config Manager now...
+ retValue = aFsm.iConfigManager.GetConfig(
+ aConfigIndex,
+ apComponentConfigStructure);
+ }
+
+ return retValue;
+
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILState::SetConfig(COmxILFsm& aFsm,
+ OMX_INDEXTYPE aConfigIndex,
+ const TAny* apComponentConfigStructure)
+ {
+ DEBUG_PRINTF(_L8("COmxILState::SetConfig"));
+
+ OMX_ERRORTYPE retValue =
+ aFsm.iPortManager.SetConfig(aConfigIndex,
+ apComponentConfigStructure);
+
+ if (OMX_ErrorUnsupportedIndex == retValue)
+ {
+ // Try Config Manager now...
+ retValue = aFsm.iConfigManager.SetConfig(
+ aConfigIndex,
+ apComponentConfigStructure);
+ }
+
+ return retValue;
+
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILState::GetExtensionIndex(const COmxILFsm& aFsm,
+ OMX_STRING aParameterName,
+ OMX_INDEXTYPE* apIndexType) const
+ {
+ DEBUG_PRINTF(_L8("COmxILState::GetExtensionIndex"));
+
+ OMX_ERRORTYPE retValue =
+ aFsm.iPortManager.GetExtensionIndex(aParameterName,
+ apIndexType);
+
+ if (OMX_ErrorUnsupportedIndex == retValue)
+ {
+ // Try Config Manager now...
+ retValue = aFsm.iConfigManager.GetExtensionIndex(
+ aParameterName,
+ apIndexType);
+ }
+
+ return retValue;
+
+ }
+
+//
+//
+//
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILState::CommandFlush(COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand)
+ {
+ DEBUG_PRINTF(_L8("COmxILState::CommandFlush"));
+
+ __ASSERT_DEBUG(aCommand.iCommandType == OMX_CommandFlush,
+ User::Panic(KOmxILFsmPanicCategory, 1));
+
+ return aFsm.iPortManager.BufferFlushIndicationFlushCommand(
+ aCommand.iParam1);
+
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILState::CommandPortDisable(COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand)
+ {
+ DEBUG_PRINTF(_L8("COmxILState::CommandPortDisable"));
+ __ASSERT_DEBUG(aCommand.iCommandType == OMX_CommandPortDisable,
+ User::Panic(KOmxILFsmPanicCategory, 1));
+
+ // First, flush all buffers in the port(s) that is(are) to be disabled.
+ return aFsm.iPortManager.PortDisableIndication(
+ aCommand.iParam1);
+
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILState::CommandPortEnable(COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand)
+ {
+ DEBUG_PRINTF(_L8("COmxILState::CommandPortEnable"));
+ __ASSERT_DEBUG(aCommand.iCommandType == OMX_CommandPortEnable,
+ User::Panic(KOmxILFsmPanicCategory, 1));
+
+ TBool indicationIsFinal = EFalse;
+ return aFsm.iPortManager.PortEnableIndication(
+ aCommand.iParam1,
+ indicationIsFinal);
+
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILState::CommandMarkBuffer(COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand)
+ {
+ DEBUG_PRINTF(_L8("COmxILState::CommandMarkBuffer"));
+
+ __ASSERT_DEBUG(aCommand.iCommandType == OMX_CommandMarkBuffer,
+ User::Panic(KOmxILFsmPanicCategory, 1));
+
+ if (!aCommand.ipCommandData)
+ {
+ return OMX_ErrorBadParameter;
+ }
+
+ return aFsm.iPortManager.BufferMarkIndication(aCommand.iParam1,
+ aCommand.ipCommandData);
+
+ }
+
+//
+// COmxILStateInvalid
+//
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateInvalid::GetParameter(
+ const COmxILFsm& /*aFsm*/,
+ OMX_INDEXTYPE /*aParamIndex*/,
+ TAny* /*apComponentParameterStructure*/) const
+ {
+ DEBUG_PRINTF(_L8("COmxILStateInvalid::GetParameter"));
+ return OMX_ErrorInvalidState;
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateInvalid::SetParameter(
+ COmxILFsm& /*aFsm*/,
+ OMX_INDEXTYPE /*aParamIndex*/,
+ const TAny* /*apComponentParameterStructure*/)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateInvalid::SetParameter"));
+ return OMX_ErrorInvalidState;
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateInvalid::GetConfig(
+ const COmxILFsm& /*aFsm*/,
+ OMX_INDEXTYPE /*aConfigIndex*/,
+ TAny* /*apComponentConfigStructure*/) const
+ {
+ DEBUG_PRINTF(_L8("COmxILStateInvalid::GetConfig"));
+ return OMX_ErrorInvalidState;
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateInvalid::SetConfig(
+ COmxILFsm& /*aFsm*/,
+ OMX_INDEXTYPE /*aConfigIndex*/,
+ const TAny* /*apComponentConfigStructure*/)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateInvalid::SetConfig"));
+ return OMX_ErrorInvalidState;
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateInvalid::GetExtensionIndex(
+ const COmxILFsm& /*aFsm*/,
+ OMX_STRING /*aParameterName*/,
+ OMX_INDEXTYPE* /*apIndexType*/) const
+ {
+ DEBUG_PRINTF(_L8("COmxILStateInvalid::GetExtensionIndex"));
+ return OMX_ErrorInvalidState;
+ }
+
+OMX_STATETYPE
+COmxILFsm::COmxILStateInvalid::GetState() const
+ {
+ DEBUG_PRINTF(_L8("COmxILStateInvalid::GetState"));
+ return OMX_StateInvalid;
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateInvalid::ComponentTunnelRequest(
+ COmxILFsm& /*aFsm*/,
+ OMX_U32 /*aPort*/,
+ OMX_HANDLETYPE /*aTunneledComp*/,
+ OMX_U32 /*aTunneledPort*/,
+ OMX_TUNNELSETUPTYPE* /*apTunnelSetup*/)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateInvalid::ComponentTunnelRequest"));
+
+ return OMX_ErrorInvalidState;
+
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateInvalid::PopulateBuffer(
+ COmxILFsm& /*aFsm*/,
+ OMX_BUFFERHEADERTYPE** /*appBufferHdr*/,
+ OMX_U32 /*aPortIndex*/,
+ OMX_PTR /*apAppPrivate*/,
+ OMX_U32 /*aSizeBytes*/,
+ OMX_U8* /*apBuffer*/,
+ TBool& /*portPopulationCompleted*/)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateInvalid::PopulateBuffer"));
+
+ return OMX_ErrorInvalidState;
+
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateInvalid::FreeBuffer(COmxILFsm& aFsm,
+ OMX_U32 aPortIndex,
+ OMX_BUFFERHEADERTYPE* apBuffer,
+ TBool& aPortDepopulationCompleted)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateInvalid::FreeBuffer"));
+
+ return COmxILState::FreeBufferV2(
+ aFsm,
+ aPortIndex,
+ apBuffer,
+ aPortDepopulationCompleted);
+
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateInvalid::EmptyThisBuffer(
+ COmxILFsm& /*aFsm*/,
+ OMX_BUFFERHEADERTYPE* /*apBuffer*/)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateInvalid::EmptyThisBuffer"));
+
+ return OMX_ErrorInvalidState;
+
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateInvalid::FillThisBuffer(
+ COmxILFsm& /*aFsm*/,
+ OMX_BUFFERHEADERTYPE* /*apBuffer*/)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateInvalid::FillThisBuffer"));
+
+ return OMX_ErrorInvalidState;
+
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateInvalid::CommandStateSet(
+ COmxILFsm& /*aFsm*/,
+ const TOmxILCommand& /*aCommand*/)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateInvalid::CommandStateSet"));
+ return OMX_ErrorInvalidState;
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateInvalid::CommandFlush(
+ COmxILFsm& /*aFsm*/,
+ const TOmxILCommand& /*aCommand*/)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateInvalid::CommandFlush"));
+ return OMX_ErrorInvalidState;
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateInvalid::CommandPortEnable(
+ COmxILFsm& /*aFsm*/,
+ const TOmxILCommand& /*aCommand*/)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateInvalid::CommandPortEnable"));
+ return OMX_ErrorInvalidState;
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateInvalid::CommandPortDisable(
+ COmxILFsm& /*aFsm*/,
+ const TOmxILCommand& /*aCommand*/)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateInvalid::CommandPortDisable"));
+ return OMX_ErrorInvalidState;
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateInvalid::CommandMarkBuffer(
+ COmxILFsm& /*aFsm*/,
+ const TOmxILCommand& /*aCommand*/)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateInvalid::CommandMarkBuffer"));
+ return OMX_ErrorInvalidState;
+ }
+
+//
+// COmxILStateLoaded
+//
+OMX_STATETYPE
+COmxILFsm::COmxILStateLoaded::GetState() const
+ {
+ DEBUG_PRINTF(_L8("COmxILStateLoaded::GetState"));
+ return OMX_StateLoaded;
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateLoaded::SetParameter(
+ COmxILFsm& aFsm,
+ OMX_INDEXTYPE aParamIndex,
+ const TAny* apComponentParameterStructure)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateLoaded::SetParameter"));
+
+ return COmxILState::SetParameterV2(aFsm,
+ aParamIndex,
+ apComponentParameterStructure);
+
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateLoaded::PopulateBuffer(
+ COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE** appBufferHdr,
+ OMX_U32 aPortIndex,
+ OMX_PTR apAppPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer,
+ TBool& portPopulationCompleted)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateLoaded::PopulateBuffer"));
+
+
+#ifdef _OMXIL_COMMON_IL516C_ON
+
+ if (!apBuffer)
+ {
+ // ... AllocateBuffer
+ //
+ // At this point, the command requesting the transition from Loaded to
+ // Idle has not been received yet.. (see
+ // COmxILStateLoadedToIdle). Therefore, this can only be successful if
+ // the port is disabled
+ return COmxILState::PopulateBuffer(aFsm,
+ appBufferHdr,
+ aPortIndex,
+ apAppPrivate,
+ aSizeBytes,
+ apBuffer,
+ portPopulationCompleted);
+ }
+ else
+ {
+ //... UseBuffer...
+ OMX_ERRORTYPE omxError =
+ COmxILState::PopulateBufferV2(aFsm,
+ appBufferHdr,
+ aPortIndex,
+ apAppPrivate,
+ aSizeBytes,
+ apBuffer,
+ portPopulationCompleted);
+ if (apBuffer && OMX_ErrorNone == omxError)
+ {
+ DEBUG_PRINTF2(_L8("COmxILStateLoaded::PopulateBuffer : PORT [%u] : Buffer population occurring in OMX_StateLoaded"), aPortIndex);
+ }
+ return omxError;
+ }
+#else
+
+ // At this point, the command requesting the transition from Loaded to Idle
+ // has not been received yet.. (see COmxILStateLoadedToIdle). Therefore,
+ // this can only be successful if the port is disabled
+ return COmxILState::PopulateBuffer(aFsm,
+ appBufferHdr,
+ aPortIndex,
+ apAppPrivate,
+ aSizeBytes,
+ apBuffer,
+ portPopulationCompleted);
+#endif
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateLoaded::FreeBuffer(COmxILFsm& aFsm,
+ OMX_U32 aPortIndex,
+ OMX_BUFFERHEADERTYPE* apBuffer,
+ TBool& aPortDepopulationCompleted)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateLoaded::FreeBuffer"));
+
+ return COmxILState::FreeBuffer(aFsm,
+ aPortIndex,
+ apBuffer,
+ aPortDepopulationCompleted);
+
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateLoaded::EmptyThisBuffer(COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE* apBuffer)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateLoaded::EmptyThisBuffer"));
+
+#ifdef _OMXIL_COMMON_IL516C_ON
+ return COmxILState::EmptyThisBufferV2(aFsm,
+ apBuffer);
+#endif
+
+ return COmxILState::EmptyThisBuffer(aFsm,
+ apBuffer);
+
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateLoaded::FillThisBuffer(COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE* apBuffer)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateLoaded::FillThisBuffer"));
+
+#ifdef _OMXIL_COMMON_IL516C_ON
+ return COmxILState::FillThisBufferV2(aFsm,
+ apBuffer);
+#endif
+
+ return COmxILState::FillThisBuffer(aFsm,
+ apBuffer);
+
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateLoaded::ComponentTunnelRequest(
+ COmxILFsm& aFsm,
+ OMX_U32 aPort,
+ OMX_HANDLETYPE aTunneledComp,
+ OMX_U32 aTunneledPort,
+ OMX_TUNNELSETUPTYPE* apTunnelSetup)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateLoaded::ComponentTunnelRequest"));
+
+ return COmxILState::ComponentTunnelRequestV2(aFsm,
+ aPort,
+ aTunneledComp,
+ aTunneledPort,
+ apTunnelSetup);
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateLoaded::CommandStateSet(
+ COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateLoaded::CommandStateSet"));
+
+ __ASSERT_DEBUG(aCommand.iCommandType == OMX_CommandStateSet,
+ User::Panic(KOmxILFsmPanicCategory, 1));
+
+ // The only two transitions allowed are :
+ // - OMX_StateIdle and
+ // - OMX_StateWaitForResources.
+ TStateIndex nextState = EStateMax;
+ switch(aCommand.iParam1)
+ {
+ case OMX_StateIdle:
+ {
+ nextState = ESubStateLoadedToIdle;
+ }
+ break;
+ case OMX_StateWaitForResources:
+ {
+ nextState = EStateWaitForResources;
+ }
+ break;
+ case OMX_StateLoaded:
+ {
+ return OMX_ErrorSameState;
+ }
+ case OMX_StateInvalid:
+ {
+ // Notify the IL client... ignore the ret value..
+ aFsm.iCallbacks.TransitionCompleteNotification(OMX_StateInvalid);
+ // Invalidate component
+ return OMX_ErrorInvalidState;
+ }
+ default:
+ {
+ return OMX_ErrorIncorrectStateTransition;
+ }
+
+ };
+
+ // Initial checks OK. The component is commanded to make a transition to
+ // OMX_StateIdle or OMX_StateWaitForResources.
+ OMX_ERRORTYPE omxRetValue = aFsm.FsmTransition(nextState);
+ if (OMX_ErrorNone != omxRetValue)
+ {
+ return omxRetValue;
+ }
+
+ if (ESubStateLoadedToIdle == nextState)
+ {
+ // Lets tell port manager in case there are buffer supplier tunnelled ports
+ TBool componentPopulationCompleted = EFalse;
+ omxRetValue =
+ aFsm.iPortManager.TunnellingBufferAllocation(
+ componentPopulationCompleted);
+ if (OMX_ErrorNone != omxRetValue)
+ {
+ return omxRetValue;
+ }
+
+ if (componentPopulationCompleted)
+ {
+ // Complete here the transition to OMX_StateIdle
+ omxRetValue = aFsm.FsmTransition(EStateIdle);
+ if (OMX_ErrorNone == omxRetValue)
+ {
+ // Notify the IL client that port population has completed
+ // sucessfully
+ omxRetValue =
+ aFsm.iCallbacks.TransitionCompleteNotification(
+ OMX_StateIdle);
+ }
+
+ }
+
+ }
+ else
+ {
+ // Notify the IL client that the transition to
+ // OMX_StateWaitForResources has completed sucessfully
+ omxRetValue = aFsm.iCallbacks.TransitionCompleteNotification(
+ OMX_StateWaitForResources);
+
+ }
+
+ return omxRetValue;
+
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateLoaded::CommandPortEnable(
+ COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateLoaded::CommandPortEnable"));
+ __ASSERT_DEBUG(aCommand.iCommandType == OMX_CommandPortEnable,
+ User::Panic(KOmxILFsmPanicCategory, 1));
+
+ TBool indicationIsFinal = ETrue;
+ return aFsm.iPortManager.PortEnableIndication(
+ aCommand.iParam1,
+ indicationIsFinal);
+
+ }
+
+
+//
+// COmxILStateLoadedToIdle
+//
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateLoadedToIdle::PopulateBuffer(
+ COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE** appBufferHdr,
+ OMX_U32 aPortIndex,
+ OMX_PTR apAppPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer,
+ TBool& portPopulationCompleted)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateLoadedToIdle::PopulateBuffer"));
+
+ OMX_ERRORTYPE omxError =
+ COmxILState::PopulateBufferV2(aFsm,
+ appBufferHdr,
+ aPortIndex,
+ apAppPrivate,
+ aSizeBytes,
+ apBuffer,
+ portPopulationCompleted);
+
+ if (apBuffer && OMX_ErrorNone == omxError)
+ {
+ DEBUG_PRINTF2(_L8("COmxILStateLoadedToIdle::PopulateBuffer : PORT [%u] : Buffer population occurring in state LoadedToIdle"), aPortIndex);
+ }
+
+ return omxError;
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateLoadedToIdle::CommandStateSet(
+ COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateLoadedToIdle::CommandStateSet"));
+
+ __ASSERT_DEBUG(aCommand.iCommandType == OMX_CommandStateSet,
+ User::Panic(KOmxILFsmPanicCategory, 1));
+
+ switch(aCommand.iParam1)
+ {
+ case OMX_StateWaitForResources:
+ {
+ // Not implemented for now...
+ return OMX_ErrorNotImplemented;
+ }
+ case OMX_StateLoaded:
+ {
+ // Here, return "same state" as the transition to OMX_StateLoaded has
+ // not completed yet.
+ return OMX_ErrorSameState;
+ }
+ case OMX_StateInvalid:
+ {
+ // Notify the IL client... ignore the ret value...
+ aFsm.iCallbacks.TransitionCompleteNotification(OMX_StateInvalid);
+ // Invalidate component
+ return OMX_ErrorInvalidState;
+ }
+ default:
+ {
+ return OMX_ErrorIncorrectStateTransition;
+ }
+ };
+
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateLoadedToIdle::CommandPortEnable(
+ COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateLoadedToIdle::CommandPortEnable"));
+ __ASSERT_DEBUG(aCommand.iCommandType == OMX_CommandPortEnable,
+ User::Panic(KOmxILFsmPanicCategory, 1));
+
+ TBool indicationIsFinal = EFalse;
+ OMX_ERRORTYPE omxRetValue =
+ aFsm.iPortManager.PortEnableIndication(
+ aCommand.iParam1,
+ indicationIsFinal);
+ if (OMX_ErrorNone != omxRetValue)
+ {
+ return omxRetValue;
+ }
+
+ // Lets tell port manager in case the port being enabled is a tunnel
+ // supplier...
+ TBool componentPopulationCompleted = EFalse;
+ omxRetValue =
+ aFsm.iPortManager.TunnellingBufferAllocation(
+ componentPopulationCompleted, aCommand.iParam1);
+ if (OMX_ErrorNone != omxRetValue)
+ {
+ return omxRetValue;
+ }
+
+ // Let's do this check here although this situation is going to be very
+ // unlikely...
+ if (componentPopulationCompleted)
+ {
+ // Complete here the transition to OMX_StateIdle
+ omxRetValue = aFsm.FsmTransition(EStateIdle);
+ if (OMX_ErrorNone == omxRetValue)
+ {
+ // Notify the IL client that port population has completed sucessfully
+ aFsm.iCallbacks.TransitionCompleteNotification(
+ OMX_StateIdle);
+ }
+
+ }
+
+ return omxRetValue;
+
+ }
+
+
+//
+// COmxILStateWaitForResources
+//
+OMX_STATETYPE
+COmxILFsm::COmxILStateWaitForResources::GetState() const
+ {
+ DEBUG_PRINTF(_L8("COmxILStateWaitForResources::GetState"));
+ return OMX_StateWaitForResources;
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateWaitForResources::SetParameter(
+ COmxILFsm& aFsm,
+ OMX_INDEXTYPE aParamIndex,
+ const TAny* apComponentParameterStructure)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateWaitForResources::SetParameter"));
+
+ return COmxILState::SetParameterV2(aFsm,
+ aParamIndex,
+ apComponentParameterStructure);
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateWaitForResources::PopulateBuffer(
+ COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE** appBufferHdr,
+ OMX_U32 aPortIndex,
+ OMX_PTR apAppPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer,
+ TBool& portPopulationCompleted)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateWaitForResources::PopulateBuffer"));
+
+ // NOTE that according to the spec, PopulateBuffer could be used here even
+ // if the port is enabled. However, for now the transition from
+ // OMX_StateWaitForResouces -> OMX_StateIdle is not supported, therefore
+ // buffer population is only allowed for disabled ports. This should be
+ // changed once Resource Management functionality is available and this
+ // state is revisited.
+ return COmxILState::PopulateBuffer(aFsm,
+ appBufferHdr,
+ aPortIndex,
+ apAppPrivate,
+ aSizeBytes,
+ apBuffer,
+ portPopulationCompleted);
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateWaitForResources::FreeBuffer(
+ COmxILFsm& aFsm,
+ OMX_U32 aPortIndex,
+ OMX_BUFFERHEADERTYPE* apBuffer,
+ TBool& aPortDepopulationCompleted)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateWaitForResources::FreeBuffer"));
+
+ return COmxILState::FreeBuffer(aFsm,
+ aPortIndex,
+ apBuffer,
+ aPortDepopulationCompleted);
+
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateWaitForResources::EmptyThisBuffer(
+ COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE* apBuffer)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateWaitForResources::EmptyThisBuffer"));
+
+#ifdef _OMXIL_COMMON_IL516C_ON
+ return COmxILState::EmptyThisBufferV2(aFsm,
+ apBuffer);
+#endif
+
+ return COmxILState::EmptyThisBuffer(aFsm,
+ apBuffer);
+
+
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateWaitForResources::FillThisBuffer(
+ COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE* apBuffer)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateWaitForResources::FillThisBuffer"));
+
+#ifdef _OMXIL_COMMON_IL516C_ON
+ return COmxILState::FillThisBufferV2(aFsm,
+ apBuffer);
+#endif
+
+ return COmxILState::FillThisBuffer(aFsm,
+ apBuffer);
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateWaitForResources::ComponentTunnelRequest(
+ COmxILFsm& aFsm,
+ OMX_U32 aPort,
+ OMX_HANDLETYPE aTunneledComp,
+ OMX_U32 aTunneledPort,
+ OMX_TUNNELSETUPTYPE* apTunnelSetup)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateWaitForResources::ComponentTunnelRequest"));
+
+ return COmxILState::ComponentTunnelRequest(aFsm,
+ aPort,
+ aTunneledComp,
+ aTunneledPort,
+ apTunnelSetup);
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateWaitForResources::CommandStateSet(
+ COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateWaitForResources::CommandStateSet"));
+
+ __ASSERT_DEBUG(aCommand.iCommandType == OMX_CommandStateSet,
+ User::Panic(KOmxILFsmPanicCategory, 1));
+
+ // Transition to OMX_StateIdle not implemented for now...
+ TStateIndex nextState = EStateMax;
+ switch(aCommand.iParam1)
+ {
+ case OMX_StateLoaded:
+ {
+ nextState = EStateLoaded;
+ }
+ break;
+ case OMX_StateWaitForResources:
+ {
+ return OMX_ErrorSameState;
+ }
+ case OMX_StateInvalid:
+ {
+ // Notify the IL client... ignore the ret value...
+ aFsm.iCallbacks.TransitionCompleteNotification(OMX_StateInvalid);
+ // Invalidate component
+ return OMX_ErrorInvalidState;
+ }
+ default:
+ {
+ return OMX_ErrorIncorrectStateTransition;
+ }
+ };
+
+ // Initial checks OK. The component is commanded to make a transition to
+ // OMX_StateLoaded
+ OMX_ERRORTYPE omxRetValue = aFsm.FsmTransition(nextState);
+ if (OMX_ErrorNone == omxRetValue)
+ {
+ // Notify the IL client that the transition to
+ // OMX_StateLoaded has completed sucessfully
+ omxRetValue =
+ aFsm.iCallbacks.TransitionCompleteNotification(OMX_StateLoaded);
+ }
+
+ return omxRetValue;
+
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateWaitForResources::CommandPortEnable(
+ COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateWaitForResources::CommandPortEnable"));
+ __ASSERT_DEBUG(aCommand.iCommandType == OMX_CommandPortEnable,
+ User::Panic(KOmxILFsmPanicCategory, 1));
+
+ // NOTE: Here, we only care about the port enabled flag. Transition from
+ // OMX_StateWaitForResources to OMX_StateIdle is not implemented at this
+ // stage until a Resource Manager is available. Whenever a Resource Manager
+ // becomes available, a COmxILStateWaitForResourcesToIdle substate should
+ // be implemented to handle the allocation of buffers mandated by the
+ // standard when a port is enabled in this transition.
+ TBool indicationIsFinal = ETrue;
+ return aFsm.iPortManager.PortEnableIndication(
+ aCommand.iParam1,
+ indicationIsFinal);
+
+ }
+
+
+//
+// COmxILStateIdle
+//
+OMX_STATETYPE
+COmxILFsm::COmxILStateIdle::GetState() const
+ {
+ DEBUG_PRINTF(_L8("COmxILStateIdle::GetState"));
+ return OMX_StateIdle;
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateIdle::SetParameter(
+ COmxILFsm& aFsm,
+ OMX_INDEXTYPE aParamIndex,
+ const TAny* apComponentParameterStructure)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateIdle::SetParameter"));
+
+ return COmxILState::SetParameter(aFsm,
+ aParamIndex,
+ apComponentParameterStructure);
+
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateIdle::PopulateBuffer(COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE** appBufferHdr,
+ OMX_U32 aPortIndex,
+ OMX_PTR apAppPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer,
+ TBool& portPopulationCompleted)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateIdle::PopulateBuffer"));
+
+ // At this point, no buffer population can take place unless the port is disabled
+ return COmxILState::PopulateBuffer(aFsm,
+ appBufferHdr,
+ aPortIndex,
+ apAppPrivate,
+ aSizeBytes,
+ apBuffer,
+ portPopulationCompleted);
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateIdle::FreeBuffer(COmxILFsm& aFsm,
+ OMX_U32 aPortIndex,
+ OMX_BUFFERHEADERTYPE* apBuffer,
+ TBool& aPortDepopulationCompleted)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateIdle::FreeBuffer"));
+
+ // At this point, the command requesting the transition from Idle to Loaded
+ // has not been received yet.. (see COmxILStateIdleToLoaded). Therefore,
+ // this can only be successful if the port is disabled
+ return COmxILState::FreeBuffer(aFsm,
+ aPortIndex,
+ apBuffer,
+ aPortDepopulationCompleted);
+
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateIdle::EmptyThisBuffer(
+ COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE* apBuffer)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateIdle::EmptyThisBuffer"));
+
+ return COmxILState::EmptyThisBufferV2(aFsm,
+ apBuffer);
+
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateIdle::FillThisBuffer(COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE* apBuffer)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateIdle::FillThisBuffer"));
+
+ return COmxILState::FillThisBufferV2(aFsm,
+ apBuffer);
+
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateIdle::ComponentTunnelRequest(
+ COmxILFsm& aFsm,
+ OMX_U32 aPort,
+ OMX_HANDLETYPE aTunneledComp,
+ OMX_U32 aTunneledPort,
+ OMX_TUNNELSETUPTYPE* apTunnelSetup)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateIdle::ComponentTunnelRequest"));
+
+ return COmxILState::ComponentTunnelRequest(aFsm,
+ aPort,
+ aTunneledComp,
+ aTunneledPort,
+ apTunnelSetup);
+
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateIdle::CommandStateSet(
+ COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateIdle::CommandStateSet"));
+
+ __ASSERT_DEBUG(aCommand.iCommandType == OMX_CommandStateSet,
+ User::Panic(KOmxILFsmPanicCategory, 1));
+
+ TStateIndex nextState = EStateInvalid;
+ switch(aCommand.iParam1)
+ {
+ case OMX_StateLoaded:
+ {
+ nextState = ESubStateIdleToLoaded;
+ }
+ break;
+ case OMX_StateExecuting:
+ {
+ nextState = EStateExecuting;
+ }
+ break;
+ case OMX_StatePause:
+ {
+ nextState = EStatePause;
+ }
+ break;
+ case OMX_StateIdle:
+ {
+ return OMX_ErrorSameState;
+ }
+ case OMX_StateInvalid:
+ {
+ // Notify the IL client... ignore the ret value...
+ aFsm.iCallbacks.TransitionCompleteNotification(OMX_StateInvalid);
+ // Invalidate component
+ return OMX_ErrorInvalidState;
+ }
+ default:
+ {
+ return OMX_ErrorIncorrectStateTransition;
+ }
+ };
+
+ // Initial command checks OK
+
+ // Commit transition to the valid state
+ OMX_ERRORTYPE omxRetValue = aFsm.FsmTransition(nextState);
+ if (OMX_ErrorNone != omxRetValue)
+ {
+ return omxRetValue;
+ }
+
+ if (ESubStateIdleToLoaded == nextState)
+ {
+ // Lets tell port manager in case there are tunnelled ports...
+ TBool componentDepopulationCompleted = EFalse;
+ omxRetValue =
+ aFsm.iPortManager.TunnellingBufferDeallocation(
+ componentDepopulationCompleted);
+ if (OMX_ErrorNone != omxRetValue)
+ {
+ return omxRetValue;
+ }
+
+ if (componentDepopulationCompleted)
+ {
+ // Complete here the transition to OMX_StateLoaded
+ omxRetValue = aFsm.FsmTransition(EStateLoaded);
+ if (OMX_ErrorNone == omxRetValue)
+ {
+ // Notify the IL client that port population has completed sucessfully
+ omxRetValue = aFsm.iCallbacks.TransitionCompleteNotification(
+ OMX_StateLoaded);
+ }
+ }
+
+ }
+ else
+ {
+ // Notify the IL client that the transition to the valid state
+ // OMX_StatePause or OMX_StateExecuting has completed sucessfully
+ omxRetValue = aFsm.iCallbacks.TransitionCompleteNotification(
+ static_cast<OMX_STATETYPE>(aCommand.iParam1));
+
+ if (OMX_ErrorNone == omxRetValue)
+ {
+ // Fire up the tunnelled buffer exchange, if any tunnelled ports are
+ // found in the component...
+ omxRetValue = aFsm.iPortManager.InitiateTunnellingDataFlow();
+ }
+
+ }
+
+ return omxRetValue;
+
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateIdle::CommandFlush(COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateIdle::CommandFlush"));
+
+ __ASSERT_DEBUG(aCommand.iCommandType == OMX_CommandFlush,
+ User::Panic(KOmxILFsmPanicCategory, 1));
+
+ return aFsm.iPortManager.BufferFlushIndicationFlushCommand(
+ aCommand.iParam1, OMX_FALSE); // Do not eject buffers
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateIdle::CommandPortEnable(
+ COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateIdle::CommandPortEnable"));
+ __ASSERT_DEBUG(aCommand.iCommandType == OMX_CommandPortEnable,
+ User::Panic(KOmxILFsmPanicCategory, 1));
+
+ // In this state, the port allocation has finished for enabled
+ // ports. However, a port is being enabled here. The port being enabled
+ // must populate (if tunnel supplier) or be populated (if non-tunnel
+ // supplier or IL Client communication)
+ TBool indicationIsFinal = EFalse;
+ OMX_ERRORTYPE omxRetValue =
+ aFsm.iPortManager.PortEnableIndication(
+ aCommand.iParam1,
+ indicationIsFinal);
+
+ if (OMX_ErrorNone == omxRetValue)
+ {
+ // From section 3.2.2.6, "If the IL client enables a port while the
+ // component is in any state other than OMX_StateLoaded or
+ // OMX_WaitForResources, then that port shall allocate its buffers via
+ // the same call sequence used on a transition from OMX_StateLoaded to
+ // OMX_StateIdle."
+
+ // Lets tell port manager in case the port being enabled is a tunnel
+ // supplier...
+ TBool componentPopulationCompleted = EFalse;
+ omxRetValue =
+ aFsm.iPortManager.TunnellingBufferAllocation(
+ componentPopulationCompleted, aCommand.iParam1);
+ }
+
+ return omxRetValue;
+
+ }
+
+
+//
+// COmxILStateIdleToLoaded
+//
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateIdleToLoaded::FreeBuffer(COmxILFsm& aFsm,
+ OMX_U32 aPortIndex,
+ OMX_BUFFERHEADERTYPE* apBuffer,
+ TBool& aPortDepopulationCompleted)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateIdleToLoaded::FreeBuffer"));
+
+ return COmxILState::FreeBufferV2(aFsm,
+ aPortIndex,
+ apBuffer,
+ aPortDepopulationCompleted);
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateIdleToLoaded::CommandStateSet(
+ COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateIdleToLoaded::CommandStateSet"));
+
+ __ASSERT_DEBUG(aCommand.iCommandType == OMX_CommandStateSet,
+ User::Panic(KOmxILFsmPanicCategory, 1));
+
+ switch (aCommand.iParam1)
+ {
+ case OMX_StateIdle:
+ {
+ // Here, return "same state" as the transition to OMX_StateLoaded has
+ // not completed yet.
+ return OMX_ErrorSameState;
+ }
+ case OMX_StateInvalid:
+ {
+ // Notify the IL client... ignore the ret value...
+ aFsm.iCallbacks.TransitionCompleteNotification(OMX_StateInvalid);
+ // Invalidate component
+ return OMX_ErrorInvalidState;
+ }
+ default:
+ {
+ __ASSERT_ALWAYS(0, User::Panic(KOmxILFsmPanicCategory, 1));
+ }
+ };
+
+ return OMX_ErrorNone;
+
+ }
+
+
+//
+// COmxILStateExecuting
+//
+OMX_STATETYPE
+COmxILFsm::COmxILStateExecuting::GetState() const
+ {
+ DEBUG_PRINTF(_L8("COmxILStateExecuting::GetState"));
+ return OMX_StateExecuting;
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateExecuting::SetParameter(COmxILFsm& aFsm,
+ OMX_INDEXTYPE aParamIndex,
+ const TAny* apComponentParameterStructure)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateExecuting::SetParameter"));
+
+ return COmxILState::SetParameter(aFsm,
+ aParamIndex,
+ apComponentParameterStructure);
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateExecuting::PopulateBuffer(COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE** appBufferHdr,
+ OMX_U32 aPortIndex,
+ OMX_PTR apAppPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer,
+ TBool& portPopulationCompleted)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateExecuting::PopulateBuffer"));
+
+ return COmxILState::PopulateBuffer(aFsm,
+ appBufferHdr,
+ aPortIndex,
+ apAppPrivate,
+ aSizeBytes,
+ apBuffer,
+ portPopulationCompleted);
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateExecuting::FreeBuffer(COmxILFsm& aFsm,
+ OMX_U32 aPortIndex,
+ OMX_BUFFERHEADERTYPE* apBuffer,
+ TBool& aPortDepopulationCompleted)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateExecuting::FreeBuffer"));
+
+ return COmxILState::FreeBuffer(aFsm,
+ aPortIndex,
+ apBuffer,
+ aPortDepopulationCompleted);
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateExecuting::EmptyThisBuffer(
+ COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE* apBuffer)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateExecuting::EmptyThisBuffer"));
+
+ return COmxILState::EmptyThisBufferV2(aFsm,
+ apBuffer);
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateExecuting::FillThisBuffer(COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE* apBuffer)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateExecuting::FillThisBuffer"));
+
+ return COmxILState::FillThisBufferV2(aFsm,
+ apBuffer);
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateExecuting::ComponentTunnelRequest(
+ COmxILFsm& aFsm,
+ OMX_U32 aPort,
+ OMX_HANDLETYPE aTunneledComp,
+ OMX_U32 aTunneledPort,
+ OMX_TUNNELSETUPTYPE* apTunnelSetup)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateExecuting::ComponentTunnelRequest"));
+
+ return COmxILState::ComponentTunnelRequest(aFsm,
+ aPort,
+ aTunneledComp,
+ aTunneledPort,
+ apTunnelSetup);
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateExecuting::CommandStateSet(
+ COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateExecuting::CommandStateSet"));
+
+ __ASSERT_DEBUG(aCommand.iCommandType == OMX_CommandStateSet,
+ User::Panic(KOmxILFsmPanicCategory, 1));
+
+ TStateIndex nextState = EStateMax;
+ switch(aCommand.iParam1)
+ {
+ case OMX_StateIdle:
+ {
+ nextState = ESubStateExecutingToIdle;
+ }
+ break;
+ case OMX_StatePause:
+ {
+ nextState = EStatePause;
+ }
+ break;
+ case OMX_StateExecuting:
+ {
+ return OMX_ErrorSameState;
+ }
+ case OMX_StateInvalid:
+ {
+ // Notify the IL client... ignore the ret value...
+ aFsm.iCallbacks.TransitionCompleteNotification(OMX_StateInvalid);
+ // Invalidate component
+ return OMX_ErrorInvalidState;
+ }
+ default:
+ {
+ return OMX_ErrorIncorrectStateTransition;
+ }
+ };
+
+
+ // Initial checks OK. The component is commanded to make a transition to
+ // ESubStateExecutingToIdle substate or OMX_StatePause.
+ OMX_ERRORTYPE omxRetValue = aFsm.FsmTransition(nextState);
+ if (OMX_ErrorNone != omxRetValue)
+ {
+ return omxRetValue;
+ }
+
+ if (ESubStateExecutingToIdle == nextState)
+ {
+ // Lets tell port manager since at this point it is mandated that all
+ // buffers must be returned to their suppliers (IL Client and/or
+ // tunnelled components).
+ TBool allBuffersReturnedToSuppliers = EFalse;
+ omxRetValue =
+ aFsm.iPortManager.BufferFlushIndicationPauseOrExeToIdleCommand(
+ allBuffersReturnedToSuppliers);
+ if (OMX_ErrorNone != omxRetValue)
+ {
+ return omxRetValue;
+ }
+
+ if (allBuffersReturnedToSuppliers)
+ {
+ // Complete here the transition to OMX_StateIdle
+ omxRetValue = aFsm.FsmTransition(EStateIdle);
+ if (OMX_ErrorNone == omxRetValue)
+ {
+ // Notify the IL client that port population has completed sucessfully
+ omxRetValue = aFsm.iCallbacks.TransitionCompleteNotification(
+ OMX_StateIdle);
+ }
+ }
+
+ }
+ else
+ {
+ // Notify the IL client that the transition to OMX_StatePause has
+ // completed sucessfully
+ omxRetValue = aFsm.iCallbacks.TransitionCompleteNotification(
+ OMX_StatePause);
+
+ }
+
+ return omxRetValue;
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateExecuting::CommandPortEnable(
+ COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateExecuting::CommandPortEnable"));
+ __ASSERT_DEBUG(aCommand.iCommandType == OMX_CommandPortEnable,
+ User::Panic(KOmxILFsmPanicCategory, 1));
+
+ // In this state, the port allocation has finished for enabled
+ // ports. However, a port is being enabled here. The port being enabled
+ // must populate (if tunnel supplier) or be populated (if non-tunnel
+ // supplier or IL Client communication)
+ TBool indicationIsFinal = EFalse;
+ OMX_ERRORTYPE omxRetValue =
+ aFsm.iPortManager.PortEnableIndication(
+ aCommand.iParam1,
+ indicationIsFinal);
+
+ if (OMX_ErrorNone == omxRetValue)
+ {
+ // From section 3.2.2.6, "If the IL client enables a port while the
+ // component is in any state other than OMX_StateLoaded or
+ // OMX_WaitForResources, then that port shall allocate its buffers via
+ // the same call sequence used on a transition from OMX_StateLoaded to
+ // OMX_StateIdle. If the IL client enables while the component is in
+ // the OMX_Executing state, then that port shall begin transferring
+ // buffers"
+
+ // Lets tell port manager in case the port being enabled is a tunnel
+ // supplier...
+ TBool componentPopulationCompleted = EFalse;
+ omxRetValue =
+ aFsm.iPortManager.TunnellingBufferAllocation(
+ componentPopulationCompleted, aCommand.iParam1);
+
+ // No need to use here componentPopulationCompleted. A port is being
+ // enabled in OMX_StateExecuting. If the port is a supplier, after
+ // being re-enabled it should start the buffer allocation phase,
+ // regardless of the population state of other ports in the component.
+ if (OMX_ErrorNone == omxRetValue)
+ {
+ // Fire up the tunnelled buffer exchange in the enabled port...
+ omxRetValue = aFsm.iPortManager.InitiateTunnellingDataFlow(
+ aCommand.iParam1);
+ }
+ }
+
+ return omxRetValue;
+
+ }
+
+
+//
+// MOmxILPauseOrExecutingToIdle
+//
+OMX_ERRORTYPE
+COmxILFsm::MOmxILPauseOrExecutingToIdle::ReturnThisBuffer(
+ COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE* apBuffer,
+ OMX_DIRTYPE aDirection)
+ {
+ DEBUG_PRINTF(_L8("MOmxILPauseOrExecutingToIdle::ReturnThisBuffer"));
+
+ TBool allBuffersReturned = EFalse;
+ OMX_ERRORTYPE omxRetValue =
+ aFsm.iPortManager.BufferReturnIndication(
+ apBuffer,
+ aDirection,
+ allBuffersReturned
+ );
+
+ if (OMX_ErrorNone != omxRetValue)
+ {
+ return omxRetValue;
+ }
+
+ if (allBuffersReturned &&
+ aFsm.iPortManager.AllBuffersAtHome())
+ {
+ // Complete here the transition to OMX_StateIdle
+ omxRetValue = aFsm.FsmTransition(EStateIdle);
+ if (OMX_ErrorNone == omxRetValue)
+ {
+ // Notify the IL client that transition to Idle has completed
+ // sucessfully
+ omxRetValue = aFsm.iCallbacks.TransitionCompleteNotification(
+ OMX_StateIdle);
+ }
+ }
+
+ return omxRetValue;
+
+ }
+
+
+
+//
+// COmxILStateExecutingToIdle
+//
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateExecutingToIdle::EmptyThisBuffer(
+ COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE* apBuffer)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateExecutingToIdle::EmptyThisBuffer"));
+
+ return ReturnThisBuffer(aFsm,
+ apBuffer,
+ OMX_DirInput);
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateExecutingToIdle::FillThisBuffer(
+ COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE* apBuffer)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateExecutingToIdle::FillThisBuffer"));
+
+ return ReturnThisBuffer(aFsm,
+ apBuffer,
+ OMX_DirOutput);
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStateExecutingToIdle::CommandStateSet(
+ COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand)
+ {
+ DEBUG_PRINTF(_L8("COmxILStateExecutingToIdle::CommandStateSet"));
+
+ __ASSERT_DEBUG(aCommand.iCommandType == OMX_CommandStateSet,
+ User::Panic(KOmxILFsmPanicCategory, 1));
+
+ switch(aCommand.iParam1)
+ {
+ case OMX_StateExecuting:
+ {
+ // Here, return "same state" as the transition to OMX_StateIdle has
+ // not completed yet.
+ return OMX_ErrorSameState;
+ }
+ case OMX_StateInvalid:
+ {
+ // Notify the IL client... ignore the ret value...
+ aFsm.iCallbacks.TransitionCompleteNotification(OMX_StateInvalid);
+ // Invalidate component
+ return OMX_ErrorInvalidState;
+ }
+ default:
+ {
+ return OMX_ErrorIncorrectStateTransition;
+ }
+ };
+
+ }
+
+
+//
+// COmxILStatePause
+//
+OMX_STATETYPE
+COmxILFsm::COmxILStatePause::GetState() const
+ {
+ DEBUG_PRINTF(_L8("COmxILStatePause::GetState"));
+ return OMX_StatePause;
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStatePause::SetParameter(
+ COmxILFsm& aFsm,
+ OMX_INDEXTYPE aParamIndex,
+ const TAny* apComponentParameterStructure)
+ {
+ DEBUG_PRINTF(_L8("COmxILStatePause::SetParameter"));
+
+ return COmxILState::SetParameter(aFsm,
+ aParamIndex,
+ apComponentParameterStructure);
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStatePause::PopulateBuffer(
+ COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE** appBufferHdr,
+ OMX_U32 aPortIndex,
+ OMX_PTR apAppPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer,
+ TBool& portPopulationCompleted)
+ {
+ DEBUG_PRINTF(_L8("COmxILStatePause::PopulateBuffer"));
+
+ return COmxILState::PopulateBuffer(aFsm,
+ appBufferHdr,
+ aPortIndex,
+ apAppPrivate,
+ aSizeBytes,
+ apBuffer,
+ portPopulationCompleted);
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStatePause::FreeBuffer(COmxILFsm& aFsm,
+ OMX_U32 aPortIndex,
+ OMX_BUFFERHEADERTYPE* apBuffer,
+ TBool& aPortDepopulationCompleted)
+ {
+ DEBUG_PRINTF(_L8("COmxILStatePause::FreeBuffer"));
+
+ return COmxILState::FreeBuffer(aFsm,
+ aPortIndex,
+ apBuffer,
+ aPortDepopulationCompleted);
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStatePause::EmptyThisBuffer(
+ COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE* apBuffer)
+ {
+ DEBUG_PRINTF(_L8("COmxILStatePause::EmptyThisBuffer"));
+
+ return COmxILState::EmptyThisBufferV2(aFsm,
+ apBuffer);
+
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStatePause::FillThisBuffer(COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE* apBuffer)
+ {
+ DEBUG_PRINTF(_L8("COmxILStatePause::FillThisBuffer"));
+
+ return COmxILState::FillThisBufferV2(aFsm,
+ apBuffer);
+
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStatePause::ComponentTunnelRequest(
+ COmxILFsm& aFsm,
+ OMX_U32 aPort,
+ OMX_HANDLETYPE aTunneledComp,
+ OMX_U32 aTunneledPort,
+ OMX_TUNNELSETUPTYPE* apTunnelSetup)
+ {
+ DEBUG_PRINTF(_L8("COmxILStatePause::ComponentTunnelRequest"));
+
+ return COmxILState::ComponentTunnelRequest(aFsm,
+ aPort,
+ aTunneledComp,
+ aTunneledPort,
+ apTunnelSetup);
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStatePause::CommandStateSet(
+ COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand)
+ {
+ DEBUG_PRINTF(_L8("COmxILStatePause::CommandStateSet"));
+
+ __ASSERT_DEBUG(aCommand.iCommandType == OMX_CommandStateSet,
+ User::Panic(KOmxILFsmPanicCategory, 1));
+
+ TStateIndex nextState = EStateInvalid;
+ switch(aCommand.iParam1)
+ {
+ case OMX_StateIdle:
+ {
+ nextState = ESubStatePauseToIdle;
+ }
+ break;
+ case OMX_StateExecuting:
+ {
+ nextState = EStateExecuting;
+ }
+ break;
+ case OMX_StatePause:
+ {
+ return OMX_ErrorSameState;
+ }
+ case OMX_StateInvalid:
+ {
+ // Notify the IL client... ignore the ret value...
+ aFsm.iCallbacks.TransitionCompleteNotification(OMX_StateInvalid);
+ // Invalidate component
+ return OMX_ErrorInvalidState;
+ }
+ default:
+ {
+ return OMX_ErrorIncorrectStateTransition;
+ }
+ };
+
+ // Initial command checks OK. The component is commanded to make a
+ // transition to ESubStatePauseToIdle substate or OMX_StateExecuting.
+ // Commit transition to the valid state
+ OMX_ERRORTYPE omxRetValue = aFsm.FsmTransition(nextState);
+ if (OMX_ErrorNone != omxRetValue)
+ {
+ return omxRetValue;
+ }
+
+ if (ESubStatePauseToIdle == nextState)
+ {
+ // Lets tell port manager since at this point it is mandated that all
+ // buffers must be returned to their suppliers (IL Client and/or
+ // tunnelled components).
+ TBool allBuffersReturnedToSuppliers = EFalse;
+ omxRetValue =
+ aFsm.iPortManager.BufferFlushIndicationPauseOrExeToIdleCommand(
+ allBuffersReturnedToSuppliers);
+ if (OMX_ErrorNone != omxRetValue)
+ {
+ return omxRetValue;
+ }
+
+ if (allBuffersReturnedToSuppliers)
+ {
+ // Complete here the transition to OMX_StateIdle
+ omxRetValue = aFsm.FsmTransition(EStateIdle);
+ if (OMX_ErrorNone == omxRetValue)
+ {
+ // Notify the IL client that port population has completed sucessfully
+ aFsm.iCallbacks.TransitionCompleteNotification(
+ OMX_StateIdle);
+ }
+ }
+
+ }
+ else
+ {
+ // Notify the IL client that the transition to OMX_StateExecuting has
+ // completed sucessfully
+ omxRetValue = aFsm.iCallbacks.TransitionCompleteNotification(
+ OMX_StateExecuting);
+
+ if (OMX_ErrorNone == omxRetValue)
+ {
+ // Fire up the tunnelled buffer exchange, if any tunnelled ports are
+ // found in the component...
+ omxRetValue = aFsm.iPortManager.InitiateTunnellingDataFlow();
+ }
+
+ }
+
+ return omxRetValue;
+
+ }
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStatePause::CommandPortEnable(
+ COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand)
+ {
+ DEBUG_PRINTF(_L8("COmxILStatePause::CommandPortEnable"));
+ __ASSERT_DEBUG(aCommand.iCommandType == OMX_CommandPortEnable,
+ User::Panic(KOmxILFsmPanicCategory, 1));
+
+ // In this state, the port allocation has finished for enabled
+ // ports. However, a port is being enabled here. The port being enabled
+ // must populate (if tunnel supplier) or be populated (if non-tunnel
+ // supplier or IL Client communication)
+ TBool indicationIsFinal = EFalse;
+ OMX_ERRORTYPE omxRetValue = aFsm.iPortManager.PortEnableIndication(
+ aCommand.iParam1,
+ indicationIsFinal);
+
+ if (OMX_ErrorNone == omxRetValue)
+ {
+ // From section 3.2.2.6, "If the IL client enables a port while the
+ // component is in any state other than OMX_StateLoaded or
+ // OMX_WaitForResources, then that port shall allocate its buffers via
+ // the same call sequence used on a transition from OMX_StateLoaded to
+ // OMX_StateIdle."
+
+ // Lets tell port manager in case the port being enabled is a tunnel
+ // supplier...
+ TBool componentPopulationCompleted = EFalse;
+ omxRetValue =
+ aFsm.iPortManager.TunnellingBufferAllocation(
+ componentPopulationCompleted, aCommand.iParam1);
+
+ }
+
+ return omxRetValue;
+
+ }
+
+
+//
+// COmxILStatePauseToIdle
+//
+OMX_ERRORTYPE
+COmxILFsm::COmxILStatePauseToIdle::EmptyThisBuffer(
+ COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE* apBuffer)
+ {
+ DEBUG_PRINTF(_L8("COmxILStatePauseToIdle::EmptyThisBuffer"));
+
+ return ReturnThisBuffer(aFsm,
+ apBuffer,
+ OMX_DirInput);
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStatePauseToIdle::FillThisBuffer(
+ COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE* apBuffer)
+ {
+ DEBUG_PRINTF(_L8("COmxILStatePauseToIdle::FillThisBuffer"));
+
+ return ReturnThisBuffer(aFsm,
+ apBuffer,
+ OMX_DirOutput);
+
+ }
+
+
+OMX_ERRORTYPE
+COmxILFsm::COmxILStatePauseToIdle::CommandStateSet(
+ COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand)
+ {
+ DEBUG_PRINTF(_L8("COmxILStatePauseToIdle::CommandStateSet"));
+
+ __ASSERT_DEBUG(aCommand.iCommandType == OMX_CommandStateSet,
+ User::Panic(KOmxILFsmPanicCategory, 1));
+
+ switch(aCommand.iParam1)
+ {
+ case OMX_StatePause:
+ {
+ // Here, return "same state" as the transition to OMX_StateIdle has not
+ // completed yet.
+ return OMX_ErrorSameState;
+ }
+ case OMX_StateInvalid:
+ {
+ // Notify the IL client... ignore the ret value...
+ aFsm.iCallbacks.TransitionCompleteNotification(OMX_StateInvalid);
+ // Invalidate component
+ return OMX_ErrorInvalidState;
+ }
+ default:
+ {
+ return OMX_ErrorIncorrectStateTransition;
+ }
+ };
+
+ }
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilstate.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,748 @@
+// 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 OMXILSTATE_H
+#define OMXILSTATE_H
+
+#include <e32base.h>
+#include <openmax/il/khronos/v1_x/OMX_Core.h>
+#include <openmax/il/common/omxilstatedefs.h>
+#include "omxilfsm.h"
+#include "omxilportmanagerif.h"
+
+// Forward declarations
+class TOmxILCommand;
+
+/**
+ Base class for concrete OpenMAX IL state objects (State Pattern)
+*/
+class COmxILFsm::COmxILState : public CBase
+ {
+
+public:
+
+ //
+ // Events, a.k.a. OpenMAX IL API calls
+ //
+
+ virtual OMX_ERRORTYPE GetParameter(
+ const COmxILFsm& aFsm,
+ OMX_INDEXTYPE aParamIndex,
+ TAny* apComponentParameterStructure) const;
+
+ /**
+ State-specific version of the OpenMAX IL SetParameter API.
+
+ @param [in] aFsm The main FSM context class that delegates the events to the
+ state classes.
+
+ @param [in] aParamIndex The index of the structure that is to be filled.
+
+ @param [in] apComponentParameterStructure A pointer to the IL structure.
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE SetParameter(
+ COmxILFsm& aFsm,
+ OMX_INDEXTYPE aParamIndex,
+ const TAny* apComponentParameterStructure) = 0;
+
+ virtual OMX_ERRORTYPE GetConfig(
+ const COmxILFsm& aFsm,
+ OMX_INDEXTYPE aConfigIndex,
+ TAny* apComponentConfigStructure) const;
+
+ virtual OMX_ERRORTYPE SetConfig(
+ COmxILFsm& aFsm,
+ OMX_INDEXTYPE aConfigIndex,
+ const TAny* apComponentConfigStructure);
+
+ virtual OMX_ERRORTYPE GetExtensionIndex(
+ const COmxILFsm& aFsm,
+ OMX_STRING aParameterName,
+ OMX_INDEXTYPE* apIndexType) const;
+
+ /**
+ State-specific version of the OpenMAX IL GetState API.
+
+ @return OMX_STATETYPE
+ */
+ virtual OMX_STATETYPE GetState() const = 0;
+
+ /**
+ State-specific version of the OpenMAX IL ComponentTunnelRequest API.
+
+ @param [in] aFsm The main FSM context class that delegates the events to
+ the state classes.
+
+ @param [in] aPort Used to select the port on the component to be used
+ for tunneling.
+
+ @param [in] aTunneledComp Handle of the component to tunnel with.
+
+ @param [in] aTunneledPort Indicates the port the component should tunnel
+ with.
+
+ @param [in] aTunnelSetup Pointer to the tunnel setup structure.
+
+ @return OMX_ERRORTYPE
+ */
+ inline virtual OMX_ERRORTYPE ComponentTunnelRequest(
+ COmxILFsm& aFsm,
+ OMX_U32 aPort,
+ OMX_HANDLETYPE aTunneledComp,
+ OMX_U32 aTunneledPort,
+ OMX_TUNNELSETUPTYPE* apTunnelSetup) = 0;
+
+ /**
+ State-specific version of the PopulateBuffer method used by the FSM
+ object to implement the OpenMAX IL AllocateBuffer/UseBuffer APIs.
+
+ @param [in] aFsm The main FSM context class that delegates the events
+ to the state classes.
+
+ @param [out] appBufferHdr A pointer to a pointer of an
+ OMX_BUFFERHEADERTYPE structure that receives the pointer to the buffer
+ header.
+
+ @param [in] aPortIndex The index of the port that will use the
+ specified buffer. This index is relative to the component that owns the
+ port.
+
+ @param [in] apAppPrivate A pointer that refers to an
+ implementation-specific memory area that is under responsibility of the
+ supplier of the buffer.
+
+ @param [in] aSizeBytes The buffer size in bytes.
+
+ @param [in] apBuffer A pointer to the memory buffer area to be used.
+
+ @param [out] portPopulationCompleted Used to signal the FSM object the
+ the port population has completed.
+
+ @return OMX_ERRORTYPE
+ */
+ inline virtual OMX_ERRORTYPE PopulateBuffer(
+ COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE** appBufferHdr,
+ OMX_U32 aPortIndex,
+ OMX_PTR apAppPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer,
+ TBool& portPopulationCompleted) = 0;
+
+ /**
+ State-specific version of the OpenMAX IL FreeBuffer API.
+
+ @param [in] aFsm The main FSM context class that delegates the events
+ to the state classes.
+
+ @param [in] aPortIndex The index of the port that is using the
+ specified buffer.
+
+ @param [in] apBuffer A pointer to an OMX_BUFFERHEADERTYPE structure
+ used to provide or receive the pointer to the buffer header.
+
+ @param [out] aPortDepopulationCompleted Used to signal the FSM object
+ the the port population has completed.
+
+ @return OMX_ERRORTYPE
+ */
+ inline virtual OMX_ERRORTYPE FreeBuffer(
+ COmxILFsm& aFsm,
+ OMX_U32 aPortIndex,
+ OMX_BUFFERHEADERTYPE* apBuffer,
+ TBool& aPortDepopulationCompleted) = 0;
+
+ /**
+ State-specific version of the OpenMAX IL EmptyThisBuffer API.
+
+ @param [in] aFsm The main FSM context class that delegates the events
+ to the state classes.
+
+ @param [in] apBuffer A pointer to an OMX_BUFFERHEADERTYPE structure that is
+ used to receive the pointer to the buffer header. The buffer header
+ shall specify the index of the input port that receives the buffer.
+
+ @return OMX_ERRORTYPE
+ */
+ inline virtual OMX_ERRORTYPE EmptyThisBuffer(
+ COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE* apBuffer) = 0;
+
+ /**
+ State-specific version of the OpenMAX IL FillThisBuffer API.
+
+ @param [in] aFsm The main FSM context class that delegates the events
+ to the state classes.
+
+ @param [in] apBuffer A pointer to an OMX_BUFFERHEADERTYPE structure
+ that is used to receive the pointer to the buffer header. The buffer
+ header shall specify the index of the input port that receives the
+ buffer.
+
+ @return OMX_ERRORTYPE
+ */
+ inline virtual OMX_ERRORTYPE FillThisBuffer(
+ COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE* apBuffer) = 0;
+
+ /**
+ State-specific version of the method used by the FSM object to
+ implement the OpenMAX IL OMX_CommandStateSet command.
+
+ @param [in] aFsm The main FSM context class that delegates the events
+ to the state classes.
+
+ @param [in] aCommand A TOmxILCommand object used to carry the command
+ parameters.
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE CommandStateSet(
+ COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand) = 0;
+
+ virtual OMX_ERRORTYPE CommandFlush(
+ COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand);
+
+ /**
+ State-specific version of the method used by the FSM object to
+ implement the OpenMAX IL OMX_CommandPortEnable command.
+
+ @param [in] aFsm The main FSM context class that delegates the events
+ to the state classes.
+
+ @param [in] aCommand A TOmxILCommand object used to carry the command
+ parameters.
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE CommandPortEnable(
+ COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand) = 0;
+
+ virtual OMX_ERRORTYPE CommandPortDisable(
+ COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand);
+
+ virtual OMX_ERRORTYPE CommandMarkBuffer(
+ COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand);
+
+protected:
+
+ virtual OMX_ERRORTYPE SetParameterV2(
+ COmxILFsm& aFsm,
+ OMX_INDEXTYPE aParamIndex,
+ const TAny* apComponentParameterStructure);
+
+ inline virtual OMX_ERRORTYPE PopulateBufferV2(
+ COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE** appBufferHdr,
+ OMX_U32 aPortIndex,
+ OMX_PTR apAppPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer,
+ TBool& portPopulationCompleted);
+
+ inline virtual OMX_ERRORTYPE FreeBufferV2(
+ COmxILFsm& aFsm,
+ OMX_U32 aPortIndex,
+ OMX_BUFFERHEADERTYPE* apBuffer,
+ TBool& aPortDepopulationCompleted);
+
+ inline virtual OMX_ERRORTYPE ComponentTunnelRequestV2(
+ COmxILFsm& aFsm,
+ OMX_U32 aPort,
+ OMX_HANDLETYPE aTunneledComp,
+ OMX_U32 aTunneledPort,
+ OMX_TUNNELSETUPTYPE* apTunnelSetup);
+
+ inline virtual OMX_ERRORTYPE EmptyThisBufferV2(
+ COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE* apBuffer);
+
+ inline virtual OMX_ERRORTYPE FillThisBufferV2(
+ COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE* apBuffer);
+
+ };
+
+
+/**
+ Concrete class that implements the OpenMAX IL OMX_StateInvalid state
+*/
+class COmxILFsm::COmxILStateInvalid : public COmxILFsm::COmxILState
+ {
+
+public:
+
+ OMX_ERRORTYPE GetParameter(const COmxILFsm& aFsm,
+ OMX_INDEXTYPE aParamIndex,
+ TAny* apComponentParameterStructure) const;
+
+ OMX_ERRORTYPE SetParameter(COmxILFsm& aFsm,
+ OMX_INDEXTYPE aParamIndex,
+ const TAny* apComponentParameterStructure);
+
+ OMX_ERRORTYPE GetConfig(const COmxILFsm& aFsm,
+ OMX_INDEXTYPE aConfigIndex,
+ TAny* apComponentConfigStructure) const;
+
+ OMX_ERRORTYPE SetConfig(COmxILFsm& aFsm,
+ OMX_INDEXTYPE aConfigIndex,
+ const TAny* apComponentConfigStructure);
+
+ OMX_ERRORTYPE GetExtensionIndex(const COmxILFsm& aFsm,
+ OMX_STRING aParameterName,
+ OMX_INDEXTYPE* apIndexType) const;
+
+ OMX_STATETYPE GetState() const;
+
+ OMX_ERRORTYPE ComponentTunnelRequest(COmxILFsm& aFsm,
+ OMX_U32 aPort,
+ OMX_HANDLETYPE aTunneledComp,
+ OMX_U32 aTunneledPort,
+ OMX_TUNNELSETUPTYPE* apTunnelSetup);
+
+ OMX_ERRORTYPE PopulateBuffer(COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE** appBufferHdr,
+ OMX_U32 aPortIndex,
+ OMX_PTR apAppPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer,
+ TBool& portPopulationCompleted);
+
+ OMX_ERRORTYPE FreeBuffer(COmxILFsm& aFsm,
+ OMX_U32 aPortIndex,
+ OMX_BUFFERHEADERTYPE* apBuffer,
+ TBool& aPortDepopulationCompleted);
+
+ OMX_ERRORTYPE EmptyThisBuffer(COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE* apBuffer);
+
+ OMX_ERRORTYPE FillThisBuffer(COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE* apBuffer);
+
+
+ OMX_ERRORTYPE CommandStateSet(
+ COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand);
+
+ OMX_ERRORTYPE CommandFlush(
+ COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand);
+
+ OMX_ERRORTYPE CommandPortEnable(
+ COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand);
+
+ OMX_ERRORTYPE CommandPortDisable(
+ COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand);
+
+ OMX_ERRORTYPE CommandMarkBuffer(
+ COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand);
+
+ };
+
+/**
+ Concrete class that implements the OpenMAX IL OMX_StateLoaded state
+*/
+class COmxILFsm::COmxILStateLoaded : public COmxILFsm::COmxILState
+ {
+
+public:
+
+ OMX_STATETYPE GetState() const;
+
+ OMX_ERRORTYPE SetParameter(COmxILFsm& aFsm,
+ OMX_INDEXTYPE aParamIndex,
+ const TAny* apComponentParameterStructure);
+
+ OMX_ERRORTYPE PopulateBuffer(COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE** appBufferHdr,
+ OMX_U32 aPortIndex,
+ OMX_PTR apAppPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer,
+ TBool& portPopulationCompleted);
+
+ OMX_ERRORTYPE FreeBuffer(COmxILFsm& aFsm,
+ OMX_U32 aPortIndex,
+ OMX_BUFFERHEADERTYPE* apBuffer,
+ TBool& aPortDepopulationCompleted);
+
+ OMX_ERRORTYPE EmptyThisBuffer(COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE* apBuffer);
+
+ OMX_ERRORTYPE FillThisBuffer(COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE* apBuffer);
+
+ OMX_ERRORTYPE ComponentTunnelRequest(COmxILFsm& aFsm,
+ OMX_U32 aPort,
+ OMX_HANDLETYPE aTunneledComp,
+ OMX_U32 aTunneledPort,
+ OMX_TUNNELSETUPTYPE* apTunnelSetup);
+
+ OMX_ERRORTYPE CommandStateSet(
+ COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand);
+
+ OMX_ERRORTYPE CommandPortEnable(
+ COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand);
+
+ };
+
+
+/**
+ Concrete class that implements the intermediate state OMX_StateLoaded ->
+ OMX_StateIdle.
+*/
+class COmxILFsm::COmxILStateLoadedToIdle : public COmxILFsm::COmxILStateLoaded
+ {
+
+public:
+
+
+ OMX_ERRORTYPE PopulateBuffer(COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE** appBufferHdr,
+ OMX_U32 aPortIndex,
+ OMX_PTR apAppPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer,
+ TBool& portPopulationCompleted);
+
+ OMX_ERRORTYPE CommandStateSet(
+ COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand);
+
+ OMX_ERRORTYPE CommandPortEnable(
+ COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand);
+
+ };
+
+/**
+ Concrete class that implements the OpenMAX IL OMX_StateWaitForResources
+ state
+
+ NOTE: This state is here only to provide the basic functionality of
+ transitioning form OMX_StateLoaded to OMX_StateWaitForResources and
+ viceversa. Transition from OMX_StateWaitForResources to OMX_StateIdle is not
+ implemented at this stage since a Resource Manager is not present
+ yet. Whenever a Resource Manager becomes available, a
+ COmxILStateWaitForResourcesToIdle substate should be implemented to handle
+ the allocation of buffers mandated by the standard in this transition.
+
+*/
+class COmxILFsm::COmxILStateWaitForResources : public COmxILFsm::COmxILState
+ {
+
+public:
+
+ OMX_STATETYPE GetState() const;
+
+ OMX_ERRORTYPE SetParameter(COmxILFsm& aFsm,
+ OMX_INDEXTYPE aParamIndex,
+ const TAny* apComponentParameterStructure);
+
+ OMX_ERRORTYPE PopulateBuffer(COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE** appBufferHdr,
+ OMX_U32 aPortIndex,
+ OMX_PTR apAppPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer,
+ TBool& portPopulationCompleted);
+
+ OMX_ERRORTYPE FreeBuffer(COmxILFsm& aFsm,
+ OMX_U32 aPortIndex,
+ OMX_BUFFERHEADERTYPE* apBuffer,
+ TBool& aPortDepopulationCompleted);
+
+ OMX_ERRORTYPE EmptyThisBuffer(COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE* apBuffer);
+
+ OMX_ERRORTYPE FillThisBuffer(COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE* apBuffer);
+
+ OMX_ERRORTYPE ComponentTunnelRequest(COmxILFsm& aFsm,
+ OMX_U32 aPort,
+ OMX_HANDLETYPE aTunneledComp,
+ OMX_U32 aTunneledPort,
+ OMX_TUNNELSETUPTYPE* apTunnelSetup);
+
+ OMX_ERRORTYPE CommandStateSet(
+ COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand);
+
+ OMX_ERRORTYPE CommandPortEnable(
+ COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand);
+
+ };
+
+/**
+ Concrete class that implements the OpenMAX IL COmxILStateIdle state
+*/
+class COmxILFsm::COmxILStateIdle : public COmxILFsm::COmxILState
+ {
+
+public:
+
+ OMX_STATETYPE GetState() const;
+
+ OMX_ERRORTYPE SetParameter(COmxILFsm& aFsm,
+ OMX_INDEXTYPE aParamIndex,
+ const TAny* apComponentParameterStructure);
+
+ OMX_ERRORTYPE PopulateBuffer(COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE** appBufferHdr,
+ OMX_U32 aPortIndex,
+ OMX_PTR apAppPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer,
+ TBool& portPopulationCompleted);
+
+ OMX_ERRORTYPE FreeBuffer(COmxILFsm& aFsm,
+ OMX_U32 aPortIndex,
+ OMX_BUFFERHEADERTYPE* apBuffer,
+ TBool& aPortDepopulationCompleted);
+
+ OMX_ERRORTYPE EmptyThisBuffer(COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE* apBuffer);
+
+ OMX_ERRORTYPE FillThisBuffer(COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE* apBuffer);
+
+ OMX_ERRORTYPE ComponentTunnelRequest(COmxILFsm& aFsm,
+ OMX_U32 aPort,
+ OMX_HANDLETYPE aTunneledComp,
+ OMX_U32 aTunneledPort,
+ OMX_TUNNELSETUPTYPE* apTunnelSetup);
+
+ OMX_ERRORTYPE CommandStateSet(
+ COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand);
+
+ OMX_ERRORTYPE CommandFlush(
+ COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand);
+
+ OMX_ERRORTYPE CommandPortEnable(
+ COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand);
+
+ };
+
+/**
+ Concrete class that implements the intermediate state OMX_StateIdle ->
+ OMX_StateLoaded.
+*/
+class COmxILFsm::COmxILStateIdleToLoaded : public COmxILFsm::COmxILStateIdle
+ {
+
+public:
+
+ OMX_ERRORTYPE FreeBuffer(COmxILFsm& aFsm,
+ OMX_U32 aPortIndex,
+ OMX_BUFFERHEADERTYPE* apBuffer,
+ TBool& aPortDepopulationCompleted);
+
+ OMX_ERRORTYPE CommandStateSet(
+ COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand);
+
+ };
+
+/**
+ Concrete class that implements the OpenMAX IL COmxILStateExecuting state
+*/
+class COmxILFsm::COmxILStateExecuting : public COmxILFsm::COmxILState
+ {
+
+public:
+
+ OMX_STATETYPE GetState() const;
+
+ OMX_ERRORTYPE SetParameter(COmxILFsm& aFsm,
+ OMX_INDEXTYPE aParamIndex,
+ const TAny* apComponentParameterStructure);
+
+ OMX_ERRORTYPE PopulateBuffer(COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE** appBufferHdr,
+ OMX_U32 aPortIndex,
+ OMX_PTR apAppPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer,
+ TBool& portPopulationCompleted);
+
+ OMX_ERRORTYPE FreeBuffer(COmxILFsm& aFsm,
+ OMX_U32 aPortIndex,
+ OMX_BUFFERHEADERTYPE* apBuffer,
+ TBool& aPortDepopulationCompleted);
+
+ OMX_ERRORTYPE EmptyThisBuffer(COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE* apBuffer);
+
+ OMX_ERRORTYPE FillThisBuffer(COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE* apBuffer);
+
+ OMX_ERRORTYPE ComponentTunnelRequest(COmxILFsm& aFsm,
+ OMX_U32 aPort,
+ OMX_HANDLETYPE aTunneledComp,
+ OMX_U32 aTunneledPort,
+ OMX_TUNNELSETUPTYPE* apTunnelSetup);
+
+ OMX_ERRORTYPE CommandStateSet(
+ COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand);
+
+ OMX_ERRORTYPE CommandPortEnable(
+ COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand);
+
+ };
+
+/**
+ Class used to abstract the commonalities of the transitions from
+ OMX_StatePause or OMX_StateExecuting to OMX_StateIdle.
+*/
+class COmxILFsm::MOmxILPauseOrExecutingToIdle
+ {
+
+protected:
+
+ OMX_ERRORTYPE ReturnThisBuffer(COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE* apBuffer,
+ OMX_DIRTYPE aDirection);
+
+ OMX_ERRORTYPE CommandPortEnable(
+ COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand);
+
+ };
+
+/**
+ Concrete class that implements the intermediate state OMX_StateExecuting ->
+ OMX_StateIdle.
+*/
+class COmxILFsm::COmxILStateExecutingToIdle :
+ public COmxILFsm::COmxILStateExecuting,
+ private COmxILFsm::MOmxILPauseOrExecutingToIdle
+
+ {
+
+public:
+
+ OMX_ERRORTYPE EmptyThisBuffer(COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE* apBuffer);
+
+ OMX_ERRORTYPE FillThisBuffer(COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE* apBuffer);
+
+ OMX_ERRORTYPE CommandStateSet(
+ COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand);
+
+ };
+
+/**
+ Concrete class that implements the OpenMAX IL COmxILStatePause state
+*/
+class COmxILFsm::COmxILStatePause : public COmxILFsm::COmxILState
+ {
+
+public:
+
+ OMX_STATETYPE GetState() const;
+
+ OMX_ERRORTYPE SetParameter(COmxILFsm& aFsm,
+ OMX_INDEXTYPE aParamIndex,
+ const TAny* apComponentParameterStructure);
+
+ OMX_ERRORTYPE PopulateBuffer(COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE** appBufferHdr,
+ OMX_U32 aPortIndex,
+ OMX_PTR apAppPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer,
+ TBool& portPopulationCompleted);
+
+ OMX_ERRORTYPE FreeBuffer(COmxILFsm& aFsm,
+ OMX_U32 aPortIndex,
+ OMX_BUFFERHEADERTYPE* apBuffer,
+ TBool& aPortDepopulationCompleted);
+
+ OMX_ERRORTYPE EmptyThisBuffer(COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE* apBuffer);
+
+ OMX_ERRORTYPE FillThisBuffer(COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE* apBuffer);
+
+ OMX_ERRORTYPE ComponentTunnelRequest(COmxILFsm& aFsm,
+ OMX_U32 aPort,
+ OMX_HANDLETYPE aTunneledComp,
+ OMX_U32 aTunneledPort,
+ OMX_TUNNELSETUPTYPE* apTunnelSetup);
+
+ OMX_ERRORTYPE CommandStateSet(
+ COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand);
+
+ OMX_ERRORTYPE CommandPortEnable(
+ COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand);
+
+ };
+
+/**
+ Concrete class that implements the intermediate state OMX_StatePause ->
+ OMX_StateIdle.
+*/
+class COmxILFsm::COmxILStatePauseToIdle
+ : public COmxILFsm::COmxILStatePause,
+ private COmxILFsm::MOmxILPauseOrExecutingToIdle
+ {
+
+public:
+
+ OMX_ERRORTYPE EmptyThisBuffer(COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE* apBuffer);
+
+ OMX_ERRORTYPE FillThisBuffer(COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE* apBuffer);
+
+ OMX_ERRORTYPE CommandStateSet(
+ COmxILFsm& aFsm,
+ const TOmxILCommand& aCommand);
+
+ };
+
+#include "omxilstate.inl"
+
+#endif // OMXILSTATE_H
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilstate.inl Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,213 @@
+// 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
+*/
+
+
+// ComponentTunnelRequest must be used in the following states:
+// - Any state, (but the port will have to be disabled)
+//
+inline OMX_ERRORTYPE
+COmxILFsm::COmxILState::ComponentTunnelRequest(
+ COmxILFsm& aFsm,
+ OMX_U32 aPort,
+ OMX_HANDLETYPE aTunneledComp,
+ OMX_U32 aTunneledPort,
+ OMX_TUNNELSETUPTYPE* apTunnelSetup)
+ {
+ return aFsm.iPortManager.TunnelRequest(
+ aPort,
+ aTunneledComp,
+ aTunneledPort,
+ apTunnelSetup,
+ OMX_TRUE // Port must be disabled
+ );
+ }
+
+// ComponentTunnelRequestV2 must be used in the following states:
+// - OMX_StateLoaded
+//
+inline OMX_ERRORTYPE
+COmxILFsm::COmxILState::ComponentTunnelRequestV2(
+ COmxILFsm& aFsm,
+ OMX_U32 aPort,
+ OMX_HANDLETYPE aTunneledComp,
+ OMX_U32 aTunneledPort,
+ OMX_TUNNELSETUPTYPE* apTunnelSetup)
+ {
+ return aFsm.iPortManager.TunnelRequest(
+ aPort,
+ aTunneledComp,
+ aTunneledPort,
+ apTunnelSetup,
+ OMX_FALSE // Port does not need to be disabled
+ );
+ }
+
+// This PopulateBuffer version must be used in the following states:
+// - OMX_StateIdle,
+// - OMX_StateExecuting,
+// - OMX_StatePaused
+//
+inline OMX_ERRORTYPE
+COmxILFsm::COmxILState::PopulateBuffer(COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE** appBufferHdr,
+ OMX_U32 aPortIndex,
+ OMX_PTR apAppPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer,
+ TBool& portPopulationCompleted)
+ {
+ return aFsm.iPortManager.PopulateBuffer(
+ appBufferHdr,
+ aPortIndex,
+ apAppPrivate,
+ aSizeBytes,
+ apBuffer,
+ portPopulationCompleted,
+ OMX_TRUE // Port must be disabled
+ );
+ }
+
+// This PopulateBuffer version must be used in the following states:
+// - OMX_StateLoaded,
+// - OMX_StateWaitForResources
+//
+inline OMX_ERRORTYPE
+COmxILFsm::COmxILState::PopulateBufferV2(
+ COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE** appBufferHdr,
+ OMX_U32 aPortIndex,
+ OMX_PTR apAppPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer,
+ TBool& portPopulationCompleted)
+ {
+ return aFsm.iPortManager.PopulateBuffer(
+ appBufferHdr,
+ aPortIndex,
+ apAppPrivate,
+ aSizeBytes,
+ apBuffer,
+ portPopulationCompleted,
+ OMX_FALSE // Port does not need to be disabled
+ );
+ }
+
+
+// This FreeBuffer version is used in the following states:
+// - OMX_StateLoaded,
+// - OMX_StateWaitForResources
+// - OMX_StateExecuting,
+// - OMX_StatePaused,
+// AND the port must be disabled
+inline OMX_ERRORTYPE
+COmxILFsm::COmxILState::FreeBuffer(COmxILFsm& aFsm,
+ OMX_U32 aPortIndex,
+ OMX_BUFFERHEADERTYPE* apBuffer,
+ TBool& aPortDepopulationCompleted)
+ {
+ return aFsm.iPortManager.FreeBuffer(
+ aPortIndex,
+ apBuffer,
+ aPortDepopulationCompleted,
+ OMX_TRUE // Port should be disabled, otherwise
+ // OMX_ErrorPortUnpopulated might be sent
+ );
+ }
+
+// This FreeBuffer version is used in the following states:
+// - OMX_StateIdle,
+//
+inline OMX_ERRORTYPE
+COmxILFsm::COmxILState::FreeBufferV2(COmxILFsm& aFsm,
+ OMX_U32 aPortIndex,
+ OMX_BUFFERHEADERTYPE* apBuffer,
+ TBool& aPortDepopulationCompleted)
+ {
+ return aFsm.iPortManager.FreeBuffer(
+ aPortIndex,
+ apBuffer,
+ aPortDepopulationCompleted,
+ OMX_FALSE // Port does not need to be disabled
+ );
+ }
+
+// This EmptyThisBuffer version must be used in the following states:
+// - OMX_StateLoaded,
+// - OMX_StateWaitForResources
+// AND the port must be disabled
+inline OMX_ERRORTYPE
+COmxILFsm::COmxILState::EmptyThisBuffer(COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE* apBuffer)
+ {
+ return aFsm.iPortManager.BufferIndication(
+ apBuffer,
+ OMX_DirInput,
+ OMX_TRUE // Port must be disabled
+ );
+ }
+
+// This EmptyThisBuffer version must be used in the following states:
+// - OMX_StateIdle,
+// - OMX_StateExecuting,
+// - OMX_StatePaused
+//
+inline OMX_ERRORTYPE
+COmxILFsm::COmxILState::EmptyThisBufferV2(COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE* apBuffer)
+ {
+ return aFsm.iPortManager.BufferIndication(
+ apBuffer,
+ OMX_DirInput,
+ OMX_FALSE // Port does not need to be disabled
+ );
+ }
+
+// This FillThisBuffer version must be used in the following states:
+// - OMX_StateLoaded,
+// - OMX_StateWaitForResources
+// AND the port must be disabled
+inline OMX_ERRORTYPE
+COmxILFsm::COmxILState::FillThisBuffer(COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE* apBuffer)
+ {
+ return aFsm.iPortManager.BufferIndication(
+ apBuffer,
+ OMX_DirOutput,
+ OMX_TRUE // Port must be disabled
+ );
+ }
+
+// This FillThisBuffer version must be used in the following states:
+// - OMX_StateIdle,
+// - OMX_StateExecuting,
+// - OMX_StatePaused
+//
+inline OMX_ERRORTYPE
+COmxILFsm::COmxILState::FillThisBufferV2(COmxILFsm& aFsm,
+ OMX_BUFFERHEADERTYPE* apBuffer)
+ {
+ return aFsm.iPortManager.BufferIndication(
+ apBuffer,
+ OMX_DirOutput,
+ OMX_FALSE // Port does not need to be disabled
+ );
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilutil.cpp Wed Aug 25 12:40:50 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
+ @internalComponent
+*/
+
+
+#include <openmax/il/common/omxilutil.h>
+#include <openmax/il/common/omxilspecversion.h>
+
+/**
+ This method checks that the size of an OpenMAX IL data structure is
+ correct. It also checks that the OpenMAX IL version stated in the structure
+ is the same as the one returned by TOmxILSpecVersion() (at the time of
+ writting this is 1.1.1). In this version of the component framework,
+ backward compatibility in not supported for OpenMAX IL structures.
+
+ @param apHeader An OpenMAX IL data structure.
+
+ @param aSize sizeof(OMXIL structure)
+
+ @return OMX_ErrorVersionMismatch if the version is not
+ 1.1.1. OMX_ErrorBadParameter if versions are the same but the nSize is
+ different. OMX_ErrorNone otherwise
+ */
+EXPORT_C OMX_ERRORTYPE
+TOmxILUtil::CheckOmxStructSizeAndVersion(OMX_PTR apHeader, OMX_U32 aSize)
+ {
+
+ if (!apHeader || aSize == 0)
+ {
+ return OMX_ErrorBadParameter;
+ }
+
+#ifdef _OMXIL_COMMON_SPEC_VERSION_CHECKS_ON
+
+ OMX_U32* const pStructSize =
+ reinterpret_cast<OMX_U32*>(apHeader);
+
+ // In an OpenMAX IL structure the nSize and nVersion fields are used to
+ // detect the difference in spec versions.
+ OMX_VERSIONTYPE* const pOmxVersion =
+ reinterpret_cast<OMX_VERSIONTYPE*>(
+ pStructSize + (sizeof(OMX_U32)/sizeof(OMX_U32)));
+
+ if ( (TOmxILSpecVersion() != *pOmxVersion)&&(TOmxILVersion(OMX_VERSION_MAJOR, OMX_VERSION_MINOR, 1, OMX_VERSION_STEP) != *pOmxVersion) )
+
+ {
+ return OMX_ErrorVersionMismatch;
+ }
+
+ // If the spec versions are the same, then the struct sizes must be the
+ // same too...
+ if (*pStructSize != aSize)
+ {
+ return OMX_ErrorBadParameter;
+ }
+
+#endif // _OMXIL_COMMON_SPEC_VERSION_CHECKS_ON
+
+ return OMX_ErrorNone;
+
+ }
+
+/**
+ This method simply resets the following fields in the OMX IL 1.1.x buffer header:
+ nFilledLen
+ hMarkTargetComponent
+ pMarkData
+ nTickCount
+ nTimeStamp
+ nFlags
+
+ @param apBufferHeader An OpenMAX IL buffer header structure.
+
+ */
+EXPORT_C void
+TOmxILUtil::ClearBufferContents(
+ OMX_BUFFERHEADERTYPE* apBufferHeader)
+ {
+
+ if (!apBufferHeader)
+ {
+ return;
+ }
+
+ apBufferHeader->nFilledLen = 0;
+ apBufferHeader->hMarkTargetComponent = 0;
+ apBufferHeader->pMarkData = 0;
+ apBufferHeader->nTickCount = 0;
+ apBufferHeader->nTimeStamp = 0;
+ apBufferHeader->nFlags = 0;
+
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilvideoport.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,427 @@
+// 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/omxilvideoport.h>
+#include <openmax/il/common/omxilutil.h>
+#include "log.h"
+#include "omxilvideoportimpl.h"
+
+EXPORT_C
+COmxILVideoPort::COmxILVideoPort()
+ {
+ DEBUG_PRINTF(_L8("COmxILVideoPort::COmxILVideoPort"));
+ }
+
+EXPORT_C
+void COmxILVideoPort::ConstructL(const TOmxILCommonPortData& aCommonPortData,
+ const RArray<OMX_VIDEO_CODINGTYPE>& aSupportedVideoFormats,
+ const RArray<OMX_COLOR_FORMATTYPE>& aSupportedColorFormats)
+ {
+ COmxILPort::ConstructL(aCommonPortData); //create COmxILPortImpl
+ ipVideoPortImpl=COmxILVideoPortImpl::NewL(aSupportedVideoFormats, aSupportedColorFormats, aCommonPortData); //create COmxILVideoPortImpl
+ }
+
+EXPORT_C
+COmxILVideoPort::~COmxILVideoPort()
+ {
+ DEBUG_PRINTF(_L8("COmxILVideoPort::~COmxILVideoPort"));
+ delete ipVideoPortImpl;
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILVideoPort::GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const
+ {
+ DEBUG_PRINTF(_L8("COmxILVideoPort::GetLocalOmxParamIndexes"));
+
+ // Always collect local indexes from parent
+ OMX_ERRORTYPE omxRetValue = COmxILPort::GetLocalOmxParamIndexes(aIndexArray);
+
+ if (OMX_ErrorNone != omxRetValue)
+ {
+ return omxRetValue;
+ }
+
+ TInt err = aIndexArray.InsertInOrder(OMX_IndexParamVideoPortFormat);
+
+ // Note that index duplication is OK.
+ if (KErrNone != err && KErrAlreadyExists != err)
+ {
+ return OMX_ErrorInsufficientResources;
+ }
+
+ return OMX_ErrorNone;
+
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILVideoPort::GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const
+ {
+ DEBUG_PRINTF(_L8("COmxILVideoPort::GetLocalOmxConfigIndexes"));
+
+ // Always collect local indexes from parent
+ return COmxILPort::GetLocalOmxConfigIndexes(aIndexArray);
+
+ }
+
+EXPORT_C OMX_ERRORTYPE COmxILVideoPort::GetParameter(OMX_INDEXTYPE aParamIndex, TAny* apComponentParameterStructure) const
+ {
+ DEBUG_PRINTF(_L8("COmxILVideoPort::GetParameter"));
+ OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+ switch(aParamIndex)
+ {
+ case OMX_IndexParamVideoPortFormat:
+ {
+ __ASSERT_ALWAYS(ipVideoPortImpl, User::Panic(KOmxILVideoPortPanicCategory, 1));
+ omxRetValue=ipVideoPortImpl->GetParameter(aParamIndex, apComponentParameterStructure);
+ break;
+ }
+ default:
+ {
+ // Try the parent's indexes
+ omxRetValue=COmxILPort::GetParameter(aParamIndex, apComponentParameterStructure);
+ }
+ };
+ return omxRetValue;
+ }
+
+EXPORT_C OMX_ERRORTYPE COmxILVideoPort::SetParameter(OMX_INDEXTYPE aParamIndex, const TAny* apComponentParameterStructure, TBool& aUpdateProcessingFunction)
+ {
+ DEBUG_PRINTF(_L8("COmxILVideoPort::SetParameter"));
+ OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+ switch(aParamIndex)
+ {
+ case OMX_IndexParamVideoPortFormat:
+ {
+ __ASSERT_ALWAYS(ipVideoPortImpl, User::Panic(KOmxILVideoPortPanicCategory, 1));
+ omxRetValue=ipVideoPortImpl->SetParameter(aParamIndex, apComponentParameterStructure, aUpdateProcessingFunction);
+ break;
+ }
+ default:
+ {
+ // Try the parent's indexes
+ omxRetValue=COmxILPort::SetParameter(aParamIndex, apComponentParameterStructure, aUpdateProcessingFunction);
+ }
+ };
+ return omxRetValue;
+ }
+
+EXPORT_C TBool COmxILVideoPort::UpdateColorFormat(OMX_COLOR_FORMATTYPE& aOldColor, OMX_COLOR_FORMATTYPE aNewColor, TBool& aUpdated)
+ {
+ __ASSERT_ALWAYS(ipVideoPortImpl, User::Panic(KOmxILVideoPortPanicCategory, 1));
+ return ipVideoPortImpl->UpdateColorFormat(aOldColor, aNewColor, aUpdated);
+ }
+
+EXPORT_C TBool COmxILVideoPort::UpdateCodingType(OMX_VIDEO_CODINGTYPE& aOldCodingType, OMX_VIDEO_CODINGTYPE aNewCodingType, TBool& aUpdated)
+ {
+ __ASSERT_ALWAYS(ipVideoPortImpl, User::Panic(KOmxILVideoPortPanicCategory, 1));
+ return ipVideoPortImpl->UpdateCodingType(aOldCodingType, aNewCodingType, aUpdated);
+ }
+
+EXPORT_C RArray<OMX_VIDEO_CODINGTYPE>& COmxILVideoPort::GetSupportedVideoFormats()
+ {
+ __ASSERT_ALWAYS(ipVideoPortImpl, User::Panic(KOmxILVideoPortPanicCategory, 1));
+ return ipVideoPortImpl->GetSupportedVideoFormats();
+
+ }
+
+EXPORT_C RArray<OMX_COLOR_FORMATTYPE>& COmxILVideoPort::GetSupportedColorFormats()
+ {
+ __ASSERT_ALWAYS(ipVideoPortImpl, User::Panic(KOmxILVideoPortPanicCategory, 1));
+ return ipVideoPortImpl->GetSupportedColorFormats();
+ }
+
+
+EXPORT_C OMX_VIDEO_PARAM_PORTFORMATTYPE& COmxILVideoPort::GetParamVideoPortFormat()
+ {
+ __ASSERT_ALWAYS(ipVideoPortImpl, User::Panic(KOmxILVideoPortPanicCategory, 1));
+ return ipVideoPortImpl->GetParamVideoPortFormat();
+ }
+
+EXPORT_C const RArray<OMX_VIDEO_CODINGTYPE>& COmxILVideoPort::GetSupportedVideoFormats() const
+ {
+ __ASSERT_ALWAYS(ipVideoPortImpl, User::Panic(KOmxILVideoPortPanicCategory, 1));
+ return ipVideoPortImpl->GetSupportedVideoFormats();
+
+ }
+
+EXPORT_C const RArray<OMX_COLOR_FORMATTYPE>& COmxILVideoPort::GetSupportedColorFormats() const
+ {
+ __ASSERT_ALWAYS(ipVideoPortImpl, User::Panic(KOmxILVideoPortPanicCategory, 1));
+ return ipVideoPortImpl->GetSupportedColorFormats();
+ }
+
+
+EXPORT_C const OMX_VIDEO_PARAM_PORTFORMATTYPE& COmxILVideoPort::GetParamVideoPortFormat() const
+ {
+ __ASSERT_ALWAYS(ipVideoPortImpl, User::Panic(KOmxILVideoPortPanicCategory, 1));
+ return ipVideoPortImpl->GetParamVideoPortFormat();
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILVideoPort::GetConfig(OMX_INDEXTYPE aConfigIndex,
+ TAny* apComponentConfigStructure) const
+ {
+ DEBUG_PRINTF(_L8("COmxILPort::GetConfig"));
+ return COmxILPort::GetConfig(aConfigIndex,
+ apComponentConfigStructure);
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILVideoPort::SetConfig(OMX_INDEXTYPE aConfigIndex,
+ const TAny* apComponentConfigStructure,
+ TBool& aUpdateProcessingFunction)
+ {
+ DEBUG_PRINTF(_L8("COmxILPort::SetConfig"));
+ return COmxILPort::SetConfig(aConfigIndex,
+ apComponentConfigStructure,
+ aUpdateProcessingFunction);
+
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILVideoPort::GetExtensionIndex(OMX_STRING aParameterName,
+ OMX_INDEXTYPE* apIndexType) const
+ {
+ return COmxILPort::GetExtensionIndex(aParameterName,
+ apIndexType);
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILVideoPort::PopulateBuffer(OMX_BUFFERHEADERTYPE** appBufferHdr,
+ const OMX_PTR apAppPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer,
+ TBool& aPortPopulationCompleted)
+ {
+ DEBUG_PRINTF2(_L8("COmxILVideoPort::PopulateBuffer : pBuffer [%X]"), apBuffer);
+ return COmxILPort::PopulateBuffer(appBufferHdr,
+ apAppPrivate,
+ aSizeBytes,
+ apBuffer,
+ aPortPopulationCompleted);
+ }
+
+
+EXPORT_C OMX_ERRORTYPE
+COmxILVideoPort::FreeBuffer(OMX_BUFFERHEADERTYPE* apBufferHeader,
+ TBool& aPortDepopulationCompleted)
+ {
+ DEBUG_PRINTF2(_L8("COmxILVideoPort::FreeBuffer : BUFFER [%X]"), apBufferHeader);
+ return COmxILPort::FreeBuffer(apBufferHeader, aPortDepopulationCompleted);
+ }
+
+
+EXPORT_C OMX_ERRORTYPE
+COmxILVideoPort::TunnelRequest(OMX_HANDLETYPE aTunneledComp,
+ OMX_U32 aTunneledPort,
+ OMX_TUNNELSETUPTYPE* apTunnelSetup)
+ {
+ DEBUG_PRINTF(_L8("COmxILVideoPort::TunnelRequest"));
+ return COmxILPort::TunnelRequest(aTunneledComp,
+ aTunneledPort,
+ apTunnelSetup);
+ }
+
+
+EXPORT_C OMX_ERRORTYPE
+COmxILVideoPort::PopulateTunnel(TBool& portPopulationCompleted)
+ {
+ DEBUG_PRINTF(_L8("COmxILVideoPort::PopulateTunnel"));
+ return COmxILPort::PopulateTunnel(portPopulationCompleted);
+ }
+
+
+EXPORT_C OMX_ERRORTYPE
+COmxILVideoPort::FreeTunnel(TBool& portDepopulationCompleted)
+ {
+ DEBUG_PRINTF(_L8("COmxILVideoPort::FreeTunnel"));
+ return COmxILPort::FreeTunnel(portDepopulationCompleted);
+ }
+
+EXPORT_C TBool
+COmxILVideoPort::SetBufferSent(OMX_BUFFERHEADERTYPE* apBufferHeader,
+ TBool& aBufferMarkedWithOwnMark)
+ {
+ DEBUG_PRINTF(_L8("COmxILVideoPort::SetBufferSent"));
+ return COmxILPort::SetBufferSent(apBufferHeader,
+ aBufferMarkedWithOwnMark);
+ }
+
+EXPORT_C TBool
+COmxILVideoPort::SetBufferReturned(OMX_BUFFERHEADERTYPE* apBufferHeader)
+ {
+ DEBUG_PRINTF(_L8("COmxILVideoPort::SetBufferReturned"));
+ return COmxILPort::SetBufferReturned(apBufferHeader);
+ }
+
+EXPORT_C void
+COmxILVideoPort::SetTransitionToEnabled()
+ {
+ DEBUG_PRINTF(_L8("COmxILVideoPort::SetTransitionToEnabled"));
+ return COmxILPort::SetTransitionToEnabled();
+ }
+
+EXPORT_C void
+COmxILVideoPort::SetTransitionToDisabled()
+ {
+ DEBUG_PRINTF(_L8("COmxILVideoPort::SetTransitionToDisabled"));
+ return COmxILPort::SetTransitionToDisabled();
+ }
+
+EXPORT_C void
+COmxILVideoPort::SetTransitionToDisabledCompleted()
+ {
+ DEBUG_PRINTF(_L8("COmxILVideoPort::SetTransitionToDisabledCompleted"));
+ return COmxILPort::SetTransitionToDisabledCompleted();
+ }
+
+EXPORT_C void
+COmxILVideoPort::SetTransitionToEnabledCompleted()
+ {
+ DEBUG_PRINTF(_L8("COmxILVideoPort::SetTransitionToEnabledCompleted"));
+ return COmxILPort::SetTransitionToEnabledCompleted();
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILVideoPort::StoreBufferMark(const OMX_MARKTYPE* apMark)
+ {
+ DEBUG_PRINTF(_L8("COmxILVideoPort::StoreBufferMark"));
+ return COmxILPort::StoreBufferMark(apMark);
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILVideoPort::SetComponentRoleDefaults(TUint aComponentRoleIndex)
+ {
+ DEBUG_PRINTF(_L8("COmxILVideoPort::SetComponentRoleDefaults"));
+
+ return COmxILPort::SetComponentRoleDefaults(aComponentRoleIndex);
+ }
+
+EXPORT_C TBool
+COmxILVideoPort::HasAllBuffersAtHome() const
+ {
+ return COmxILPort::HasAllBuffersAtHome();
+ }
+
+EXPORT_C TBool
+COmxILVideoPort::IsBufferAtHome(OMX_BUFFERHEADERTYPE* apBufferHeader) const
+ {
+ DEBUG_PRINTF2(_L8("COmxILVideoPort::IsBufferAtHome : [%X]"), apBufferHeader);
+ return COmxILPort::IsBufferAtHome(apBufferHeader);
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILVideoPort::DoPortReconfiguration(TUint aPortSettingsIndex,
+ const TDesC8& aPortSettings,
+ OMX_EVENTTYPE& aEventForILClient)
+ {
+ DEBUG_PRINTF(_L8("COmxILVideoPort::DoPortReconfiguration"));
+
+ return COmxILPort::DoPortReconfiguration(aPortSettingsIndex,
+ aPortSettings,
+ aEventForILClient);
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILVideoPort::DoBufferAllocation(OMX_U32 aSizeBytes,
+ OMX_U8*& apPortSpecificBuffer,
+ OMX_PTR& apPortPrivate,
+ OMX_PTR& apPlatformPrivate,
+ OMX_PTR apAppPrivate)
+ {
+ DEBUG_PRINTF2(_L8("COmxILVideoPort::DoBufferAllocation : aSizeBytes[%u]"), aSizeBytes);
+ return COmxILPort::DoBufferAllocation(aSizeBytes,
+ apPortSpecificBuffer,
+ apPortPrivate,
+ apPlatformPrivate,
+ apAppPrivate);
+ }
+
+EXPORT_C void
+COmxILVideoPort::DoBufferDeallocation(OMX_PTR apPortSpecificBuffer,
+ OMX_PTR apPortPrivate,
+ OMX_PTR apPlatformPrivate,
+ OMX_PTR apAppPrivate)
+ {
+ DEBUG_PRINTF(_L8("COmxILVideoPort::DoBufferDeallocation"));
+ return COmxILPort::DoBufferDeallocation(apPortSpecificBuffer,
+ apPortPrivate,
+ apPlatformPrivate,
+ apAppPrivate);
+ }
+
+
+EXPORT_C OMX_ERRORTYPE
+COmxILVideoPort::DoBufferWrapping(OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer,
+ OMX_PTR& apPortPrivate,
+ OMX_PTR& apPlatformPrivate,
+ OMX_PTR apAppPrivate)
+ {
+ DEBUG_PRINTF(_L8("COmxILVideoPort::DoBufferWrapping"));
+ return COmxILPort::DoBufferWrapping(aSizeBytes,
+ apBuffer,
+ apPortPrivate,
+ apPlatformPrivate,
+ apAppPrivate);
+ }
+
+EXPORT_C void
+COmxILVideoPort::DoBufferUnwrapping(OMX_PTR apBuffer,
+ OMX_PTR appPortPrivate,
+ OMX_PTR apPlatformPrivate,
+ OMX_PTR apAppPrivate)
+ {
+
+ DEBUG_PRINTF(_L8("COmxILVideoPort::DoBufferUnwrapping"));
+ return COmxILPort::DoBufferUnwrapping(apBuffer,
+ appPortPrivate,
+ apPlatformPrivate,
+ apAppPrivate);
+ }
+
+EXPORT_C OMX_ERRORTYPE
+COmxILVideoPort::DoOmxUseBuffer(OMX_HANDLETYPE aTunnelledComponent,
+ OMX_BUFFERHEADERTYPE** appBufferHdr,
+ OMX_U32 aTunnelledPortIndex,
+ OMX_PTR apPortPrivate,
+ OMX_PTR apPlatformPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer)
+ {
+
+ DEBUG_PRINTF(_L8("COmxILVideoPort::DoOmxUseBuffer"));
+ return COmxILPort::DoOmxUseBuffer(aTunnelledComponent,
+ appBufferHdr,
+ aTunnelledPortIndex,
+ apPortPrivate,
+ apPlatformPrivate,
+ aSizeBytes,
+ apBuffer);
+ }
+
+
+EXPORT_C
+TInt COmxILVideoPort::Extension_(TUint aExtensionId, TAny *&a0, TAny *a1)
+ {
+ return COmxILPort::Extension_(aExtensionId, a0, a1);
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilvideoportimpl.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,209 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+/**
+ @file
+ @internalComponent
+*/
+#include "log.h"
+#include "omxilvideoportimpl.h"
+#include <openmax/il/common/omxilvideoport.h>
+#include <openmax/il/common/omxilutil.h>
+
+COmxILVideoPortImpl* COmxILVideoPortImpl::NewL(const RArray<OMX_VIDEO_CODINGTYPE>& aSupportedVideoFormats,
+ const RArray<OMX_COLOR_FORMATTYPE>& aSupportedColorFormats,
+ const TOmxILCommonPortData& aCommonPortData)
+ {
+ COmxILVideoPortImpl* self = new (ELeave) COmxILVideoPortImpl();
+ CleanupStack::PushL(self);
+ self->ConstructL(aSupportedVideoFormats, aSupportedColorFormats, aCommonPortData);
+ CleanupStack::Pop();
+ return self;
+ }
+
+void COmxILVideoPortImpl::ConstructL(const RArray<OMX_VIDEO_CODINGTYPE>& aSupportedVideoFormats,
+ const RArray<OMX_COLOR_FORMATTYPE>& aSupportedColorFormats,
+ const TOmxILCommonPortData& aCommonPortData)
+ {
+
+ TUint count = aSupportedVideoFormats.Count();
+ for (TInt i = 0; i < count; i++)
+ {
+ iSupportedVideoFormats.AppendL(aSupportedVideoFormats[i]);
+ }
+
+ count = aSupportedColorFormats.Count();
+ for (TInt i = 0; i < count; i++)
+ {
+ iSupportedColorFormats.AppendL(aSupportedColorFormats[i]);
+ }
+
+ TInt numVideoFormats = iSupportedVideoFormats.Count();
+ TInt numColorFormats = iSupportedColorFormats.Count();
+ iParamVideoPortFormat.nSize = sizeof(OMX_VIDEO_PARAM_PORTFORMATTYPE);
+ iParamVideoPortFormat.nVersion = aCommonPortData.iOmxVersion;
+ iParamVideoPortFormat.nPortIndex = aCommonPortData.iPortIndex;
+ iParamVideoPortFormat.nIndex = numVideoFormats ? numVideoFormats - 1 : 0;
+ iParamVideoPortFormat.eCompressionFormat = numVideoFormats ? iSupportedVideoFormats[0] : OMX_VIDEO_CodingUnused;
+ iParamVideoPortFormat.eColorFormat = numColorFormats ? iSupportedColorFormats[0] : OMX_COLOR_FormatUnused;
+ iParamVideoPortFormat.xFramerate = 0;//aCommonPortData.xFramerate???;
+ }
+
+COmxILVideoPortImpl::COmxILVideoPortImpl()
+ {
+ DEBUG_PRINTF(_L8("COmxILVideoPortImpl::COmxILVideoPortImpl"));
+ }
+
+COmxILVideoPortImpl::~COmxILVideoPortImpl()
+ {
+ DEBUG_PRINTF(_L8("COmxILVideoPortImpl::~COmxILVideoPortImpl"));
+ iSupportedVideoFormats.Close();
+ iSupportedColorFormats.Close();
+ }
+
+OMX_ERRORTYPE COmxILVideoPortImpl::GetParameter(OMX_INDEXTYPE aParamIndex, TAny* apComponentParameterStructure) const
+ {
+ DEBUG_PRINTF(_L8("COmxILVideoPortImpl::GetParameter"));
+ OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+
+ switch(aParamIndex)
+ {
+ case OMX_IndexParamVideoPortFormat:
+ {
+ if (OMX_ErrorNone != (omxRetValue =
+ TOmxILUtil::CheckOmxStructSizeAndVersion(
+ const_cast<OMX_PTR>(apComponentParameterStructure),
+ sizeof(OMX_VIDEO_PARAM_PORTFORMATTYPE))))
+ {
+ return omxRetValue;
+ }
+
+ OMX_VIDEO_PARAM_PORTFORMATTYPE* videoPortDefinition = static_cast<OMX_VIDEO_PARAM_PORTFORMATTYPE*>(apComponentParameterStructure);
+
+ if(OMX_VIDEO_CodingUnused == iParamVideoPortFormat.eCompressionFormat)
+ {
+ if (videoPortDefinition->nIndex >= iSupportedColorFormats.Count())
+ {
+ return OMX_ErrorNoMore;
+ }
+ videoPortDefinition->eColorFormat = iSupportedColorFormats[videoPortDefinition->nIndex];
+ }
+ else
+ {
+ if (videoPortDefinition->nIndex >= iSupportedVideoFormats.Count())
+ {
+ return OMX_ErrorNoMore;
+ }
+ videoPortDefinition->eCompressionFormat = iSupportedVideoFormats[videoPortDefinition->nIndex];
+ }
+ videoPortDefinition->xFramerate = iParamVideoPortFormat.xFramerate;
+ break;
+ }
+ default:
+ __ASSERT_ALWAYS(EFalse, User::Panic(KOmxILVideoPortPanicCategory, 1));
+ };
+
+ return OMX_ErrorNone;
+ }
+
+OMX_ERRORTYPE COmxILVideoPortImpl::SetParameter(OMX_INDEXTYPE aParamIndex, const TAny* apComponentParameterStructure, TBool& aUpdateProcessingFunction)
+ {
+ DEBUG_PRINTF(_L8("COmxILVideoPortImpl::SetParameter"));
+ OMX_ERRORTYPE omxRetValue = OMX_ErrorNone;
+ switch(aParamIndex)
+ {
+ case OMX_IndexParamVideoPortFormat:
+ {
+ if (OMX_ErrorNone != (omxRetValue =
+ TOmxILUtil::CheckOmxStructSizeAndVersion(
+ const_cast<OMX_PTR>(apComponentParameterStructure),
+ sizeof(OMX_VIDEO_PARAM_PORTFORMATTYPE))))
+ {
+ return omxRetValue;
+ }
+
+ const OMX_VIDEO_PARAM_PORTFORMATTYPE *componentParameterStructure = static_cast<const OMX_VIDEO_PARAM_PORTFORMATTYPE*>(apComponentParameterStructure);
+
+ if (!UpdateColorFormat(iParamVideoPortFormat.eColorFormat, componentParameterStructure->eColorFormat, aUpdateProcessingFunction))
+ {
+ return OMX_ErrorUnsupportedSetting;
+ }
+
+ if (!UpdateCodingType(iParamVideoPortFormat.eCompressionFormat, componentParameterStructure->eCompressionFormat, aUpdateProcessingFunction))
+ {
+ return OMX_ErrorUnsupportedSetting;
+ }
+
+ if(iParamVideoPortFormat.eCompressionFormat == OMX_VIDEO_CodingUnused)
+ {
+ if(iParamVideoPortFormat.xFramerate != componentParameterStructure->xFramerate)
+ {
+ iParamVideoPortFormat.xFramerate = componentParameterStructure->xFramerate;
+ aUpdateProcessingFunction = ETrue;
+ }
+ }
+ break;
+ }
+ default:
+ __ASSERT_ALWAYS(EFalse, User::Panic(KOmxILVideoPortPanicCategory, 1));
+ };
+ return OMX_ErrorNone;
+ }
+
+TBool COmxILVideoPortImpl::UpdateColorFormat(OMX_COLOR_FORMATTYPE& aOldColor, OMX_COLOR_FORMATTYPE aNewColor, TBool& aUpdated)
+ {
+ if (aNewColor != aOldColor)
+ {
+ if(iSupportedColorFormats.Find(aNewColor) == KErrNotFound)
+ {
+ return EFalse;
+ }
+ aOldColor = aNewColor;
+ aUpdated = ETrue;
+ }
+
+ return ETrue;
+ }
+
+TBool COmxILVideoPortImpl::UpdateCodingType(OMX_VIDEO_CODINGTYPE& aOldCodingType, OMX_VIDEO_CODINGTYPE aNewCodingType, TBool& aUpdated)
+ {
+ if (aNewCodingType != aOldCodingType)
+ {
+ if(iSupportedVideoFormats.Find(aNewCodingType) == KErrNotFound)
+ {
+ return EFalse;
+ }
+ aOldCodingType = aNewCodingType;
+ aUpdated = ETrue;
+ }
+
+ return ETrue;
+ }
+
+RArray<OMX_VIDEO_CODINGTYPE>& COmxILVideoPortImpl::GetSupportedVideoFormats()
+ {
+ return iSupportedVideoFormats;
+ }
+
+RArray<OMX_COLOR_FORMATTYPE>& COmxILVideoPortImpl::GetSupportedColorFormats()
+ {
+ return iSupportedColorFormats;
+ }
+
+OMX_VIDEO_PARAM_PORTFORMATTYPE& COmxILVideoPortImpl::GetParamVideoPortFormat()
+ {
+ return iParamVideoPortFormat;
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/omxilvideoportimpl.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,66 @@
+// 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 OMXILVIDEOPORTIMPL_H
+#define OMXILVIDEOPORTIMPL_H
+
+#include <e32base.h>
+
+#include <openmax/il/khronos/v1_x/OMX_Types.h>
+#include <openmax/il/khronos/v1_x/OMX_Core.h>
+#include <openmax/il/khronos/v1_x/OMX_Component.h>
+
+#include <openmax/il/common/omxilport.h>
+
+class COmxILVideoPortImpl : public CBase
+ {
+public:
+ static COmxILVideoPortImpl* NewL(const RArray<OMX_VIDEO_CODINGTYPE>& aSupportedVideoFormats,
+ const RArray<OMX_COLOR_FORMATTYPE>& aSupportedColorFormatsconst,
+ const TOmxILCommonPortData& aCommonPortData);
+ ~COmxILVideoPortImpl();
+
+ OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex,
+ TAny* apComponentParameterStructure) const;
+
+ OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex,
+ const TAny* apComponentParameterStructure,
+ TBool& aUpdateProcessingFunction);
+
+ TBool UpdateColorFormat(OMX_COLOR_FORMATTYPE& aOldColor, OMX_COLOR_FORMATTYPE aNewColor, TBool& aUpdated);
+ TBool UpdateCodingType(OMX_VIDEO_CODINGTYPE& aOldCodingType, OMX_VIDEO_CODINGTYPE aNewCodingType, TBool& aUpdated);
+ RArray<OMX_VIDEO_CODINGTYPE>& GetSupportedVideoFormats();
+ RArray<OMX_COLOR_FORMATTYPE>& GetSupportedColorFormats();
+ OMX_VIDEO_PARAM_PORTFORMATTYPE& GetParamVideoPortFormat();
+private:
+ COmxILVideoPortImpl();
+ void ConstructL(const RArray<OMX_VIDEO_CODINGTYPE>& aSupportedVideoFormats,
+ const RArray<OMX_COLOR_FORMATTYPE>& aSupportedColorFormats,
+ const TOmxILCommonPortData& aCommonPortData);
+
+private:
+ RArray<OMX_VIDEO_CODINGTYPE> iSupportedVideoFormats;
+ RArray<OMX_COLOR_FORMATTYPE> iSupportedColorFormats;
+ RArray<OMX_U32> iSupportedFrameRates;
+ OMX_VIDEO_PARAM_PORTFORMATTYPE iParamVideoPortFormat;
+ };
+
+#endif // OMXILVIDEOPORT_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/primsgqueue.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,87 @@
+// 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 PRIMSGQUEUE_H
+#define PRIMSGQUEUE_H
+
+#include <e32std.h>
+#include <e32msgqueue.h>
+
+/**
+ RPriMsgQueue panic category
+*/
+_LIT(RPriMsgQueuePanicCategory, "RPriMsgQueue");
+
+/**
+ A priority-based message queue similar to RMsQueue .
+
+ This templated class provides the behaviour for managing an asynchronous
+ queue of messages, ordered by descending priority order, where the template
+ parameter defines the message type. Note that this message queue is intended
+ to be used with pointer types only. Also, message types are assumed to have
+ a member with the following signature : TInt Priority()
+
+ */
+template <typename T>
+class RPriMsgQueue
+ {
+
+public:
+
+ inline TInt CreateLocal(TInt aSize, TOwnerType aType=EOwnerProcess);
+ inline TInt Handle() const;
+ inline TInt Send(const T& aMsg);
+ inline TInt Receive(T& aMsg);
+ inline void Close();
+ inline void NotifyDataAvailable(TRequestStatus& aStatus);
+ inline void CancelDataAvailable();
+
+protected:
+
+ class TFrontQueueElement
+ {
+
+ public:
+
+ inline explicit TFrontQueueElement(const TAny* apInfo);
+ inline TFrontQueueElement(const TAny* apInfo, TInt aPriority);
+
+ public:
+
+ const TAny* ipInfo;
+ TPriQueLink iLink;
+
+ };
+
+protected:
+
+ inline TInt DrainBackQueue();
+
+protected:
+
+ RMsgQueueBase iBackQueue;
+ TPriQue<TFrontQueueElement> iFrontQueue;
+
+ };
+
+#include "primsgqueue.inl"
+
+#endif // PRIMSGQUEUE_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcomplib/src/primsgqueue.inl Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,156 @@
+// 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
+*/
+
+
+template <typename T>
+inline RPriMsgQueue<T>::TFrontQueueElement::TFrontQueueElement(
+ const TAny* apInfo)
+ :
+ ipInfo(apInfo)
+ {
+ iLink.iPriority = 0;
+ }
+
+template <typename T>
+inline RPriMsgQueue<T>::TFrontQueueElement::TFrontQueueElement(
+ const TAny* apInfo, TInt aPriority)
+ :
+ ipInfo(apInfo)
+ {
+ iLink.iPriority = aPriority;
+ }
+
+template <typename T>
+inline TInt RPriMsgQueue<T>::CreateLocal(TInt aSize, TOwnerType aOwner)
+ {
+ iFrontQueue.SetOffset(_FOFF(TFrontQueueElement, iLink));
+ return iBackQueue.CreateLocal(aSize, sizeof(T), aOwner);
+ }
+
+template <typename T>
+inline TInt RPriMsgQueue<T>::Handle() const
+ {
+ return iBackQueue.Handle();
+ }
+
+template <typename T>
+inline TInt RPriMsgQueue<T>::Send(const T& aMsg)
+ {
+ ASSERT(aMsg);
+ return iBackQueue.Send(&aMsg, sizeof(T));
+ }
+
+template <typename T>
+inline TInt RPriMsgQueue<T>::Receive(T& aMsg)
+ {
+ TInt err = DrainBackQueue();
+ if (KErrNone == err)
+ {
+ if (iFrontQueue.IsEmpty())
+ {
+ return KErrUnderflow;
+ }
+
+ TFrontQueueElement* pElement = iFrontQueue.First();
+ __ASSERT_DEBUG(pElement != 0,
+ User::Panic(RPriMsgQueuePanicCategory, 1));
+ pElement->iLink.Deque();
+ aMsg = reinterpret_cast<T>(const_cast<TAny*>(pElement->ipInfo));
+ delete pElement;
+ }
+
+ return err;
+
+ }
+
+template <typename T>
+inline void RPriMsgQueue<T>::Close()
+ {
+
+ // Back queue should be empty by now, but just in case...
+
+ // Here we expect a pointer type!...
+ T pElement;
+ while (iBackQueue.Receive(&pElement, sizeof(T)) == KErrNone)
+ {
+ delete pElement;
+ pElement = 0;
+ }
+ iBackQueue.Close();
+
+ // Front queue should be empty by now, but just in case...
+ TFrontQueueElement* pFQElement = 0;
+ while (!iFrontQueue.IsEmpty())
+ {
+ pFQElement = iFrontQueue.First();
+ __ASSERT_DEBUG(pFQElement != 0,
+ User::Panic(RPriMsgQueuePanicCategory, 1));
+ pFQElement->iLink.Deque();
+ pElement = reinterpret_cast<T>(const_cast<TAny*>(pFQElement->ipInfo));
+ delete pElement;
+ delete pFQElement;
+ }
+
+ }
+
+template <typename T>
+inline void RPriMsgQueue<T>::NotifyDataAvailable(TRequestStatus& aStatus)
+ {
+ iBackQueue.NotifyDataAvailable(aStatus);
+ }
+
+template <typename T>
+inline void RPriMsgQueue<T>::CancelDataAvailable()
+ {
+ iBackQueue.CancelDataAvailable();
+ }
+
+template <typename T>
+TInt RPriMsgQueue<T>::DrainBackQueue()
+ {
+
+ // Here we expect a pointer type!...
+ T pElement;
+ while (iBackQueue.Receive(&pElement, sizeof(T)) == KErrNone)
+ {
+ TFrontQueueElement* pElem =
+ new TFrontQueueElement(pElement, pElement->Priority());
+
+ // This double attempt at allocation is done in order to allow OOM
+ // tests to pass, as there is no way to report an error to the client
+ // if we lose a RegisterCallbacks message in an OOM situation
+ if (!pElem)
+ {
+ pElem = new TFrontQueueElement(pElement, pElement->Priority());
+ }
+
+ if (!pElem)
+ {
+ // This command will get lost, but at least it won't be leaked
+ delete pElement;
+ return KErrNoMemory;
+ }
+ iFrontQueue.Add(*pElem);
+ }
+
+ return KErrNone;
+
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcore/bwins/omxilcoreclient.def Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,11 @@
+EXPORTS
+ OMX_ComponentNameEnum @ 1 NONAME
+ OMX_Deinit @ 2 NONAME
+ OMX_FreeHandle @ 3 NONAME
+ OMX_GetComponentsOfRole @ 4 NONAME
+ OMX_GetContentPipe @ 5 NONAME
+ OMX_GetHandle @ 6 NONAME
+ OMX_GetRolesOfComponent @ 7 NONAME
+ OMX_Init @ 8 NONAME
+ OMX_SetupTunnel @ 9 NONAME
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcore/bwins/omxilcoreserver.def Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,11 @@
+EXPORTS
+ ?ComponentNameEnum@COmxILCore@@QAE?AW4OMX_ERRORTYPE@@PADKK@Z @ 1 NONAME ; enum OMX_ERRORTYPE COmxILCore::ComponentNameEnum(char *, unsigned long, unsigned long)
+ ?ConstructOmxILCoreServerName@@YAHAAVTDes16@@@Z @ 2 NONAME ABSENT ; int ConstructOmxILCoreServerName(class TDes16 &)
+ ?FreeHandle@COmxILCore@@QBE?AW4OMX_ERRORTYPE@@PAX@Z @ 3 NONAME ; enum OMX_ERRORTYPE COmxILCore::FreeHandle(void *) const
+ ?GetComponentsOfRole@COmxILCore@@QAE?AW4OMX_ERRORTYPE@@PADPAKPAPAE@Z @ 4 NONAME ; enum OMX_ERRORTYPE COmxILCore::GetComponentsOfRole(char *, unsigned long *, unsigned char * *)
+ ?GetContentPipe@COmxILCore@@QAE?AW4OMX_ERRORTYPE@@PAPAXPAD@Z @ 5 NONAME ; enum OMX_ERRORTYPE COmxILCore::GetContentPipe(void * *, char *)
+ ?GetRolesOfComponent@COmxILCore@@QAE?AW4OMX_ERRORTYPE@@PADPAKPAPAE@Z @ 6 NONAME ; enum OMX_ERRORTYPE COmxILCore::GetRolesOfComponent(char *, unsigned long *, unsigned char * *)
+ ?LoadComponent@COmxILCore@@QAE?AW4OMX_ERRORTYPE@@PADPAPAXPAXPAUOMX_CALLBACKTYPE@@@Z @ 7 NONAME ; enum OMX_ERRORTYPE COmxILCore::LoadComponent(char *, void * *, void *, struct OMX_CALLBACKTYPE *)
+ ?SetupTunnel@COmxILCore@@SA?AW4OMX_ERRORTYPE@@PAXK0K@Z @ 8 NONAME ; enum OMX_ERRORTYPE COmxILCore::SetupTunnel(void *, unsigned long, void *, unsigned long)
+ ?StartOmxILCoreServer@@YAHPAK@Z @ 9 NONAME ; int StartOmxILCoreServer(unsigned long *)
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcore/eabi/omxilcoreclient.def Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,11 @@
+EXPORTS
+ OMX_ComponentNameEnum @ 1 NONAME
+ OMX_Deinit @ 2 NONAME
+ OMX_FreeHandle @ 3 NONAME
+ OMX_GetComponentsOfRole @ 4 NONAME
+ OMX_GetContentPipe @ 5 NONAME
+ OMX_GetHandle @ 6 NONAME
+ OMX_GetRolesOfComponent @ 7 NONAME
+ OMX_Init @ 8 NONAME
+ OMX_SetupTunnel @ 9 NONAME
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcore/eabi/omxilcoreserver.def Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,11 @@
+EXPORTS
+ _Z20StartOmxILCoreServerPm @ 1 NONAME
+ _Z28ConstructOmxILCoreServerNameR6TDes16 @ 2 NONAME ABSENT
+ _ZN10COmxILCore11SetupTunnelEPvmS0_m @ 3 NONAME
+ _ZN10COmxILCore13LoadComponentEPcPPvS1_P16OMX_CALLBACKTYPE @ 4 NONAME
+ _ZN10COmxILCore14GetContentPipeEPPvPc @ 5 NONAME
+ _ZN10COmxILCore17ComponentNameEnumEPcmm @ 6 NONAME
+ _ZN10COmxILCore19GetComponentsOfRoleEPcPmPPh @ 7 NONAME
+ _ZN10COmxILCore19GetRolesOfComponentEPcPmPPh @ 8 NONAME
+ _ZNK10COmxILCore10FreeHandleEPv @ 9 NONAME
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcore/group/bld.inf Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,33 @@
+// 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
+BASEDEFAULT
+
+PRJ_MMPFILES
+// Core and Loader
+../mmpfiles/omxilsymbianloaderif.mmp
+../mmpfiles/omxilsymbiancontentpipeif.mmp
+../mmpfiles/omxilcoreserver.mmp
+../mmpfiles/omxilcoreclient.mmp
+
+
+
+
+PRJ_EXPORTS
+
+// Romkit include files
+omxilcore.iby /epoc32/rom/include/omxilcore.iby
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcore/group/omxilcore.iby Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,26 @@
+// Copyright (c) 2008-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 OMXILCORE_IBY
+#define OMXILCORE_IBY
+
+// OMX IL Core
+file=ABI_DIR\BUILD_DIR\omxilcoreserver.dll System\Libs\omxilcoreserver.dll
+file=ABI_DIR\BUILD_DIR\omxilcoreclient.dll System\Libs\omxilcoreclient.dll
+
+// Temp include of loader to maintain compatibility
+#include <omxilloader.iby>
+
+#endif // OMXILCORE_IBY
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcore/mmpfiles/OSTOMXILFrameworkTrace.mmh Wed Aug 25 12:40:50 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:
+// @file
+// @SYMPurpose omxilcomponentif.lib Library used by the OMX Core to
+// allow an OMX component to be loaded as an ECom plugin.
+//
+//
+
+#ifndef SHAREDOSTOMXILFRAMEWORKTRACE_HRH
+#define SHAREDOSTOMXILFRAMEWORKTRACE_HRH
+
+
+// ******* enables OMX-IL performance traces ***********
+//#define ENABLE_OMXIL_TRACE_OSTV1
+//#define ENABLE_OMXIL_TRACE_OSTV2
+// *******************************************************
+
+#ifdef ENABLE_OMXIL_TRACE_OSTV2
+MACRO SYMBIAN_PERF_TRACE_OMX_IL
+#define SYMBIAN_PERF_TRACE_OMX_IL
+#endif
+
+#ifdef ENABLE_OMXIL_TRACE_OSTV1
+MACRO SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+#define SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ // comment out to stub out all tracepoint
+#define SYMBIAN_INCLUDE_EXECUTABLE_TRACE
+ #include <platform/opensystemtrace.mmh>
+#endif // SYMBIAN_PERF_TRACE_OMX_IL
+
+#endif //SHAREDOSTOMXILFRAMEWORKTRACE_HRH
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcore/mmpfiles/omxilcoreclient.mmp Wed Aug 25 12:40:50 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:
+//
+
+#include "OSTOMXILFrameworkTrace.mmh"
+#include "../src/core/omxiluids.hrh"
+
+TARGET omxilcoreclient.dll
+TARGETTYPE dll
+UID KSharedLibraryUidDefine KUidOmxILCoreClientDll
+
+VENDORID 0x70000001
+CAPABILITY ALL -TCB
+
+MACRO __OMX_EXPORTS
+
+SOURCEPATH ../src/omxilcoreclient
+SOURCE omxilcoreclientsession.cpp
+
+USERINCLUDE ../src/omxilcoreserver
+USERINCLUDE ../src/core
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+LIBRARY euser.lib
+LIBRARY estor.lib
+LIBRARY omxilcoreserver.lib
+
+#ifdef WINS
+LIBRARY ewsd.lib // For Process Local Storage on Emulator only
+#else
+EPOCALLOWDLLDATA
+#endif
+
+
+// MACRO _OMXIL_CORECLIENT_DEBUG_TRACING_ON
+
+DEFFILE omxilcoreclient.def
+NOSTRICTDEF
+
+SMPSAFE
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcore/mmpfiles/omxilcoreserver.mmp Wed Aug 25 12:40:50 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:
+//
+
+#include "OSTOMXILFrameworkTrace.mmh"
+#include "../src/core/omxiluids.hrh"
+
+TARGET omxilcoreserver.dll
+TARGETTYPE dll
+UID 0x1000008D KUidOmxILCoreServerDll
+
+VENDORID 0x70000001
+CAPABILITY ALL -TCB
+
+SOURCEPATH ../src/omxilcoreserver
+SOURCE omxilcoreserver.cpp
+SOURCE omxilcoreserversession.cpp
+
+SOURCEPATH ../src/core
+SOURCE omxilcore.cpp
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+SOURCE omxilcomponentapiperformancetrace.cpp
+#endif
+
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+SOURCE omxilcomponentapiperformancetrace.cpp
+#endif
+
+USERINCLUDE ../src/core
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+OS_LAYER_ESTLIB_SYSTEMINCLUDE
+
+
+LIBRARY euser.lib
+LIBRARY ecom.lib
+LIBRARY inetprotutil.lib
+LIBRARY estlib.lib
+
+// MACRO _OMXIL_CORESERVER_DEBUG_TRACING_ON
+
+DEFFILE omxilcoreserver.def
+NOSTRICTDEF
+
+SMPSAFE
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcore/mmpfiles/omxilsymbiancontentpipeif.mmp Wed Aug 25 12:40:50 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:
+//
+
+#include "../src/core/omxiluids.hrh"
+
+TARGET omxilsymbiancontentpipeif.lib
+TARGETTYPE LIB
+UID KUidOmxILSymbianContentPipeIfLib
+VENDORID 0x70000001
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+SOURCEPATH ../src/core
+SOURCE omxilsymbiancontentpipeif.cpp
+
+SMPSAFE
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcore/mmpfiles/omxilsymbianloaderif.mmp Wed Aug 25 12:40:50 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:
+//
+
+#include "../src/core/omxiluids.hrh"
+
+TARGET omxilsymbianloaderif.lib
+TARGETTYPE LIB
+UID KUidOmxILLoaderLib
+VENDORID 0x70000001
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+SOURCEPATH ../src/core
+SOURCE omxilsymbianloaderif.cpp
+
+SMPSAFE
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcore/src/core/OSTOMXILFrameworkTrace.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,219 @@
+// 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 __OSTOMXILFRAMEWORKTRACE_H
+#define __OSTOMXILFRAMEWORKTRACE_H
+
+/**
+Enable this macro to compile in the OMX-IL peformance trace points that trace out all the performance
+use-cases.
+*/
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+
+/*
+ * ComponentId Default
+ * must be defined before <opensystemtrace_types.h>
+ * Include this header file from exe specific header file that defines EXECUTABLE_DEFAULT_COMPONENTID
+ */
+
+#include <opensystemtrace_types.h>
+#include <e32des8.h>
+
+#define MAKESTRING(str) (#str)
+#define BLANK_STR (& (_L8("") ) )
+
+
+const TUint ADDITIONAL_INFO_SIZE = 100;
+
+const TClassificationAll EPerFormanceTraceClassification = ESystemCharacteristicMetrics;
+const static TComponentId KTracePerformanceTraceUID= 0x100039e4;
+
+/**
+This defines trace attributes to be used by trace points within OMX-IL.
+*/
+namespace Ost_OMXIL_Performance
+ {
+
+ // Enumerates all the OMX commands that are traced for performance,
+ enum OMX_PERFORMANCE_USECASES
+ {
+ E_Init = 0,
+ E_DeInit,
+ E_GetHandle,
+ E_GetParam,
+ E_SetParam,
+ E_SendCommand,
+ E_SetupTunnel,
+ E_GetConfig,
+ E_SetConfig,
+ E_FreeHandle,
+ E_Event,
+ E_GetContentPipe,
+ E_GetComponentsOfRole,
+ E_GetRolesOfComponent,
+ E_ComponentNameEnum,
+ E_AllocateBuffer,
+ E_EmptyThisBuffer,
+ E_ComponentTunnelRequest,
+ E_FillThisBuffer,
+ E_FreeBuffer,
+ E_UseBuffer,
+ E_GetComponentVersion,
+ E_GetExtensionIndex,
+ E_ComponentDeInit,
+ E_SetCallbacks,
+ E_EmptyBufferDone,
+ E_FillBufferDone
+ };
+
+ /* This defines the format of the performance trace packets
+ * %d :TTraceID
+ * %s :OMX_PERFORMANCE_USE_CASES (this is still a C style string at the moment)
+ * %d :ErrorCode
+ * %S :Additional information [Optional]
+ */
+ _LIT8(K_OMX_PerformanceTraceFormat,"%u;%s;%u;%S");
+
+
+ /* This defines the format of the performance trace packets (minimum) usually used for OMX-IL API start
+ * %d :TTraceID
+ * %s :OMX_PERFORMANCE_USE_CASES (this is still a C style string at the moment)
+ */
+ _LIT8(K_OMX_PerformanceTraceFormatMin,"%u;%s;");
+
+ /* This defines the format of the performance trace packets to mark use case start and End
+ * %d :TTraceID
+ * %S :OMX_PERFORMANCE_USE_CASES
+ */
+ _LIT8(K_OMX_UseCasePerformanceTraceFormat, "%u;%S");
+
+
+ //****************** Additional information trace packet format ****************
+ /* This defines the format of the performance trace packets
+ * %s :role
+ * %u :number of components
+ */
+ _LIT8(K_RoleInfo,"%s;%u");
+
+ /* This defines format of the additional information section of the EMeasurementEnd:E_GetHandle
+ * get handle packet
+ * %u :Component Handle
+ * %s :component Name
+
+ */
+ _LIT8(K_HandleInfo, "%u;%s");
+
+ /* This defines format of the additional information section of the EMeasurementEnd:E_SendCommand
+ * get handle packet
+ * %u :Component Handle
+ * %d :Command
+ * %d :aParam1
+ */
+ _LIT8(K_OMXSendCommandInfo, "%u;%u;%u");
+
+
+ /* This defines format of the additional information section of the EMeasurementEnd:E_GetHandle
+ * get handle packet
+ * %u : component
+ * %d : OmxIndex Type
+ *
+ * NOTE: This shares additional info packet format as EMeasurementEnd:SetParameter
+ * This shares additional info packet format as EMeasurementEnd:GetConfig
+ * This shares additional info packet format as EMeasurementEnd:SetConfig
+ */
+ _LIT8(K_GetParameterInfo, "%u;%u");
+
+
+ /* This defines format of the additional information section of the EMeasurementEnd:E_Event
+ * get handle packet
+ * %u :Component Handle
+ * %u :Event
+ * %u :aParam1
+ * %u :aParam2
+ */
+ _LIT8(K_OMXEventNotificationInfo, "%u;%u;%u;%u");
+
+
+
+ /* This defines format of the additional information section of the EMeasurementEnd:K_TunnelSetupInfo
+ * get handle packet
+ * %u :Source Component Handle
+ * %u :source port
+ * %u :Sink Component Handle
+ * %u :sink port
+ */
+ _LIT8(K_TunnelSetupInfo, "%u;%u;%u;%u");
+
+
+ /* This defines format of the additional information section of the EMeasurementEnd:E_FreeHandle
+ * get handle packet
+ * %u :Component Handle
+ */
+ _LIT8(K_HandleOnlyInfo, "%u");
+
+
+ enum TTraceId
+ {
+ /**
+ This format is used in all performance trace packets generated by OMX-IL
+
+ SymTraceFormatString "%d;%s;%s"
+ */
+ EMeasurementStart = KInitialClientFormat,
+
+ /**
+ This format is used in performance trace packets generated by OMX-IL
+ SymTraceFormatString "%d;%s;%s"
+ */
+ EMeasurementEnd,
+
+ /**
+ This format is used in performance trace packets generated by OMX-IL to mark
+ Where the higher level test. started from.
+
+ SymTraceFormatString "%d;%s"
+ */
+ EUseCaseStart,
+
+ /**
+ This format is used in performance trace packets generated by OMX-IL to mark
+ Where the higher level test ends.
+
+
+ SymTraceFormatString "%d;%s"
+ */
+ EUseCaseEnd,
+
+
+ /**
+ Provided to allow the following compile time assert.
+ */
+ ETraceIdHighWaterMark,
+ };
+ __ASSERT_COMPILE(ETraceIdHighWaterMark <= KMaxTraceId + 1);
+
+ } // end of namespace OstComponentOSTDemo
+
+
+// Normal PC and ContextId Defaults
+// Note these are the same as the ones provided by OST
+#define EXECUTABLE_DEFAULT_HAS_THREAD_IDENTIFICATION EAddThreadIdentification
+#define EXECUTABLE_DEFAULT_HAS_PC ENoPc
+#include <opensystemtrace.h>
+
+
+#endif //SYMBIAN_PERF_TRACE_OMX_IL
+#endif //OSTOMXILFRAMEWORKTRACE_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcore/src/core/log.h Wed Aug 25 12:40:50 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_CORESERVER_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, "[ core ] ");
+ _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, "[ core ] ");
+ _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/omxil_generic/omxilcore/src/core/omxilcomponentapiperformancetrace.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,1174 @@
+/*
+* 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 class is provides performance trace wrappers around OpenMax IL APIs.
+* This class shall not be instantiated.
+*
+*/
+
+#include "omxilcomponentapiperformancetrace.h"
+#include <e32base.h>
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+#include "..\..\traces\OstTraceDefinitions.h"
+
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "omxilComponentapiperformancetraceTraces.h"
+#endif
+
+#endif
+
+
+
+
+OMX_ERRORTYPE OMXILAPITraceWrapper::Trace_GetConfig(
+ OMX_IN OMX_HANDLETYPE ahComponent,
+ OMX_IN OMX_INDEXTYPE anIndex,
+ OMX_INOUT OMX_PTR apComponentConfigStructure)
+ {
+ OMX_ERRORTYPE error = OMX_ErrorBadParameter;
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ OstTrace0( TRACE_API, _GetConfig1, "GetConfig >" );
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormatMin,
+ Ost_OMXIL_Performance::EMeasurementStart, MAKESTRING(E_GetConfig) );
+#endif
+
+ if(ahComponent)
+ {
+ OMX_COMPONENTTYPE* pComp = ResolveCallsToComponent(ahComponent);
+ error = pComp->GetConfig(pComp, anIndex, apComponentConfigStructure);
+ }
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ TBuf8<ADDITIONAL_INFO_SIZE> GetConfigInfo;
+ // uses the shares same additional information format as the GetParameter measurement End format.
+ GetConfigInfo.Format(Ost_OMXIL_Performance::K_GetParameterInfo , ahComponent, anIndex);
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormat,
+ Ost_OMXIL_Performance::EMeasurementEnd, MAKESTRING(E_GetConfig), error ,&GetConfigInfo);
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ OstTraceExt4(TRACE_API, _GetConfig2, "GetConfig < ReturnVal=%{OMX_ERRORTYPE} Component=%p Index=%{OMX_INDEXTYPE} pComponentConfigStructure=%p",
+ (TUint)error, ahComponent, (TUint)anIndex, apComponentConfigStructure);
+ if (apComponentConfigStructure)
+ {
+ OMX_U32* const pStructSize =
+ reinterpret_cast<OMX_U32*>(apComponentConfigStructure);
+ OstTraceData(TRACE_API_DUMP_STRUCT, _GetConfig3, "Config Struct: %{hex8[]}", apComponentConfigStructure, (TUint)(*pStructSize)) ;
+ }
+#endif
+
+ return error;
+ }
+
+
+OMX_ERRORTYPE OMXILAPITraceWrapper::Trace_SetConfig(
+ OMX_IN OMX_HANDLETYPE ahComponent,
+ OMX_IN OMX_INDEXTYPE anIndex,
+ OMX_IN OMX_PTR apComponentConfigStructure)
+ {
+ OMX_ERRORTYPE error = OMX_ErrorBadParameter;
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ OstTrace0( TRACE_API, _SetConfig1, "SetConfig >" );
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormatMin,
+ Ost_OMXIL_Performance::EMeasurementStart, MAKESTRING(E_SetConfig) );
+#endif
+ if(ahComponent)
+ {
+ OMX_COMPONENTTYPE* pComp = ResolveCallsToComponent(ahComponent);
+ error = pComp->SetConfig(pComp, anIndex, apComponentConfigStructure);
+ }
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ TBuf8<ADDITIONAL_INFO_SIZE> SetConfigInfo;
+ // uses the shares same additional information format as the GetParameter measurement End format.
+ SetConfigInfo.Format(Ost_OMXIL_Performance::K_GetParameterInfo , ahComponent, anIndex);
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormat,
+ Ost_OMXIL_Performance::EMeasurementEnd, MAKESTRING(E_SetConfig), error ,&SetConfigInfo);
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ OstTraceExt4(TRACE_API, _SetConfig2, "SetConfig < ReturnVal=%{OMX_ERRORTYPE} Component=%p Index=%{OMX_INDEXTYPE} pComponentConfigStructure=%p",
+ (TUint)error, ahComponent, (TUint)anIndex, apComponentConfigStructure) ;
+ if (apComponentConfigStructure)
+ {
+ OMX_U32* const pStructSize =
+ reinterpret_cast<OMX_U32*>(apComponentConfigStructure);
+
+ OstTraceData(TRACE_API_DUMP_STRUCT, _SetConfig3, "Config Struct: %{hex8[]}", apComponentConfigStructure, (TUint)(*pStructSize)) ;
+ }
+
+#endif
+
+ return error;
+}
+
+
+OMX_ERRORTYPE OMXILAPITraceWrapper::Trace_GetState(
+ OMX_IN OMX_HANDLETYPE ahComponent,
+ OMX_OUT OMX_STATETYPE* apState)
+ {
+ OMX_ERRORTYPE error = OMX_ErrorBadParameter;
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ OstTrace0( TRACE_API, _GetState1, "GetState >" );
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormatMin,
+ Ost_OMXIL_Performance::EMeasurementStart, MAKESTRING(E_GetState));
+#endif
+ if(ahComponent)
+ {
+ OMX_COMPONENTTYPE* pComp = ResolveCallsToComponent(ahComponent);
+ error = pComp->GetState(pComp, apState);
+ }
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ TBuf8<ADDITIONAL_INFO_SIZE> SetStateInfo;
+ // uses the shares same additional information format as the GetParameter measurement End format.
+ SetStateInfo.Format(Ost_OMXIL_Performance::K_GetParameterInfo , ahComponent, apState);
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormat,
+ Ost_OMXIL_Performance::EMeasurementEnd, MAKESTRING(E_GetState), error ,&SetStateInfo);
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ OstTraceExt3( TRACE_API, _GetState2, "GetState < ReturnVal=%{OMX_ERRORTYPE} Component=%p pState=%{OMX_STATETYPE}",
+ (TUint)error, ahComponent, (TUint)(apState)? *apState:0 );
+#endif
+
+ return error;
+ }
+
+
+OMX_ERRORTYPE OMXILAPITraceWrapper::Trace_GetParameter(
+ OMX_IN OMX_HANDLETYPE ahComponent,
+ OMX_IN OMX_INDEXTYPE anParamIndex,
+ OMX_INOUT OMX_PTR aComponentParameterStructure)
+{
+ OMX_ERRORTYPE error = OMX_ErrorBadParameter;
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ OstTrace0( TRACE_API, _GetParameter1, "GetParameter >" );
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormatMin,
+ Ost_OMXIL_Performance::EMeasurementStart, MAKESTRING(E_GetParam));
+#endif
+ if(ahComponent)
+ {
+ OMX_COMPONENTTYPE* pComp = ResolveCallsToComponent(ahComponent);
+ error = pComp->GetParameter(pComp, anParamIndex, aComponentParameterStructure);
+ }
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ // uses the shares same additional information format as the GetParameter measurement End format.
+ TBuf8<ADDITIONAL_INFO_SIZE> GetParamerInfo;
+ GetParamerInfo.Format(Ost_OMXIL_Performance::K_GetParameterInfo , ahComponent, anParamIndex);
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormat,
+ Ost_OMXIL_Performance::EMeasurementEnd, MAKESTRING(E_GetParam), error ,&GetParamerInfo);
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ if (anParamIndex == OMX_IndexParamPortDefinition)
+ {
+ OMX_PARAM_PORTDEFINITIONTYPE* portPtr = static_cast<OMX_PARAM_PORTDEFINITIONTYPE*>(aComponentParameterStructure);
+
+ OstTraceExt5( TRACE_API, _GetParameter2, "GetParameter(OMX_IndexParamPortDefinition) < ReturnVal=%{OMX_ERRORTYPE} Component=%p nPortIndex=%u nBufferCountActual=%u nBufferSize=%u",
+ (TUint)error, ahComponent, (TUint)(portPtr->nPortIndex), (TUint)(portPtr->nBufferCountActual), (TUint)(portPtr->nBufferSize));
+ }
+ else if (anParamIndex == OMX_IndexParamCompBufferSupplier)
+ {
+ OMX_PARAM_BUFFERSUPPLIERTYPE* bufPtr = static_cast<OMX_PARAM_BUFFERSUPPLIERTYPE*>(aComponentParameterStructure);
+ OstTraceExt4( TRACE_API, _GetParameter3, "GetParameter(OMX_IndexParamCompBufferSupplier) < ReturnVal=%{OMX_ERRORTYPE} Component=%p nPortIndex=%u eBufferSupplier=%{OMX_BUFFERSUPPLIERTYPE}",
+ (TUint)error, ahComponent, (TUint)(bufPtr->nPortIndex), (TUint)(bufPtr->eBufferSupplier));
+ }
+ else if (anParamIndex > OMX_IndexKhronosExtensions)
+ {
+ OstTraceExt4( TRACE_API, _GetParameter4, "GetParameter(Vendor specific index)< ReturnVal=%{OMX_ERRORTYPE} Component=%p nParamIndex=%u aComponentParameterStructure=%p",
+ (TUint)error, ahComponent, (TUint)(anParamIndex), aComponentParameterStructure );
+ }
+ else
+ {
+ OstTraceExt4( TRACE_API, _GetParameter5, "GetParameter < ReturnVal=%{OMX_ERRORTYPE} Component=%p nParamIndex=%{OMX_INDEXTYPE} aComponentParameterStructure=%p",
+ (TUint)error, ahComponent, (TUint)(anParamIndex), aComponentParameterStructure );
+ }
+ if (aComponentParameterStructure)
+ {
+ OMX_U32* const pStructSize =
+ reinterpret_cast<OMX_U32*>(aComponentParameterStructure);
+ OstTraceData(TRACE_API_DUMP_STRUCT, _GetParameter6, "Param Struct: %{hex8[]}", aComponentParameterStructure, (TUint)(*pStructSize)) ;
+ }
+#endif
+
+ return error;
+}
+
+
+OMX_ERRORTYPE OMXILAPITraceWrapper::PrepareTraceStructuresL( OMX_INOUT OMX_HANDLETYPE& aClientHandle,
+ OMX_INOUT OMX_CALLBACKTYPE*& aTraceCallBack,
+ COMPONENT_REF*& aCompRefToClient,
+ COMPONENT_REF*& aCompRefToTrace)
+ {
+
+ // create a new OMX_COMPONENTTYPE that will be handed to the client
+ aClientHandle = reinterpret_cast<OMX_HANDLETYPE>( new (ELeave) OMX_COMPONENTTYPE );
+
+ CleanupStack::PushL(aClientHandle);
+ aTraceCallBack = new (ELeave)OMX_CALLBACKTYPE;
+ CleanupStack::PushL(aTraceCallBack);
+ // create the structure to glue the clients Handle and the callback
+ aCompRefToClient = new (ELeave) COMPONENT_REF;
+ CleanupStack::PushL(aCompRefToClient);
+ aCompRefToTrace = new (ELeave) COMPONENT_REF;
+
+
+ CleanupStack::Pop(3, aClientHandle);
+
+ //populate the callback structure with the Trace functions
+ aTraceCallBack->EventHandler = Trace_EventHandler;
+ aTraceCallBack->EmptyBufferDone = Trace_EmptyBufferDone;
+ aTraceCallBack->FillBufferDone = Trace_FillBufferDone;
+
+ return OMX_ErrorNone;
+ }
+
+
+OMX_ERRORTYPE OMXILAPITraceWrapper::UndoPrepareTraceStructures( OMX_INOUT OMX_HANDLETYPE& aClientHandle,
+ OMX_INOUT OMX_CALLBACKTYPE*& aTraceCallBack,
+ COMPONENT_REF*& aCompRefToClient,
+ COMPONENT_REF*& aCompRefToTrace)
+ {
+ //
+
+ delete aTraceCallBack;
+ aTraceCallBack= NULL;
+ delete aClientHandle;
+ aClientHandle= NULL;
+ delete aCompRefToClient;
+ aCompRefToClient=NULL;
+ delete aCompRefToTrace ;
+ aCompRefToTrace=NULL;
+ return OMX_ErrorNone;
+ }
+
+TInt OMXILAPITraceWrapper::PatchStructures( OMX_IN OMX_HANDLETYPE ahClientComp,
+ OMX_IN OMX_CALLBACKTYPE* apClientCallBack,
+ OMX_IN OMX_HANDLETYPE ahTraceComp,
+ OMX_INOUT OMX_CALLBACKTYPE* apTraceCallBack,
+ COMPONENT_REF*& aCompRefToClient,
+ COMPONENT_REF*& aCompRefToTrace)
+ {
+
+ OMX_COMPONENTTYPE *pClientComp = reinterpret_cast< OMX_COMPONENTTYPE *>(ahClientComp);
+ OMX_COMPONENTTYPE *pTraceComp = reinterpret_cast< OMX_COMPONENTTYPE *>(ahTraceComp);
+
+ aCompRefToClient->pComponentIF = pClientComp;
+ aCompRefToClient->pCallbacks = apClientCallBack;
+
+ aCompRefToTrace->pComponentIF = pTraceComp;
+ aCompRefToTrace->pCallbacks = apTraceCallBack;
+
+ // the client component reference is stored in the Trace Handle's pApplicationPrivate
+ pTraceComp->pApplicationPrivate = reinterpret_cast<OMX_PTR>(aCompRefToClient);
+
+ pClientComp->nSize = sizeof(OMX_COMPONENTTYPE);
+ pClientComp->nVersion = pTraceComp->nVersion;
+ // the trace component reference is stored in the client's Handle pComponentPrivate
+ pClientComp->pComponentPrivate = reinterpret_cast<OMX_PTR>(aCompRefToTrace);
+
+
+ /* Set function pointers to wrapper functions */
+ pClientComp->AllocateBuffer = OMXILAPITraceWrapper::Trace_AllocateBuffer;
+ pClientComp->ComponentTunnelRequest = OMXILAPITraceWrapper::Trace_ComponentTunnelRequest;
+ pClientComp->EmptyThisBuffer = OMXILAPITraceWrapper::Trace_EmptyThisBuffer;
+ pClientComp->FillThisBuffer = OMXILAPITraceWrapper::Trace_FillThisBuffer;
+ pClientComp->FreeBuffer = OMXILAPITraceWrapper::Trace_FreeBuffer;
+ pClientComp->GetComponentVersion = OMXILAPITraceWrapper::Trace_GetComponentVersionL;
+ pClientComp->GetExtensionIndex = OMXILAPITraceWrapper::Trace_GetExtensionIndexL;
+ pClientComp->ComponentDeInit = OMXILAPITraceWrapper::Trace_ComponentDeInit;
+ pClientComp->SetCallbacks = OMXILAPITraceWrapper::Trace_SetCallbacks;
+ pClientComp->UseBuffer = OMXILAPITraceWrapper::Trace_UseBuffer;
+
+ pClientComp->GetConfig = OMXILAPITraceWrapper::Trace_GetConfig;
+ pClientComp->GetParameter = OMXILAPITraceWrapper::Trace_GetParameter;
+ pClientComp->GetState = OMXILAPITraceWrapper::Trace_GetState;
+ pClientComp->SendCommand = OMXILAPITraceWrapper::Trace_SendCommand;
+ pClientComp->SetConfig = OMXILAPITraceWrapper::Trace_SetConfig;
+ pClientComp->SetParameter = OMXILAPITraceWrapper::Trace_SetParameter;
+
+ pClientComp->UseEGLImage = OMXILAPITraceWrapper::Trace_UseEGLImage;
+ pClientComp->ComponentRoleEnum = OMXILAPITraceWrapper::Trace_ComponentRoleEnum;
+
+ return KErrNone;
+ }
+
+TInt OMXILAPITraceWrapper::ComponentTracerDestroy(OMX_IN OMX_HANDLETYPE ahClientComp)
+ {
+ // resolve the wrapper callbacks used by the component and delete it
+ COMPONENT_REF* pTraceCompRef = reinterpret_cast<COMPONENT_REF*> ((reinterpret_cast<OMX_COMPONENTTYPE*>(ahClientComp))->pComponentPrivate );
+ delete pTraceCompRef->pCallbacks;
+
+ //resolve and delete the OMX_COMPONENTTYPE structure passed to the client
+ COMPONENT_REF* pClientCompRef = reinterpret_cast<COMPONENT_REF*> ((pTraceCompRef->pComponentIF)->pApplicationPrivate);
+ delete ahClientComp;
+
+ // delete the glues
+ delete pClientCompRef;
+ pClientCompRef=NULL;
+ delete pTraceCompRef;
+ pTraceCompRef=NULL;
+
+ return KErrNone;
+ }
+
+
+OMX_ERRORTYPE OMXILAPITraceWrapper::Trace_SetParameter(
+ OMX_IN OMX_HANDLETYPE ahComponent,
+ OMX_IN OMX_INDEXTYPE anIndex,
+ OMX_IN OMX_PTR aComponentParameterStructure)
+ {
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ OstTrace0( TRACE_API, _SetParameter1, "SetParameter >" );
+#endif
+
+ OMX_ERRORTYPE omxError = OMX_ErrorBadParameter;
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormatMin,
+ Ost_OMXIL_Performance::EMeasurementStart, MAKESTRING(E_SetParam) );
+#endif
+ if(ahComponent)
+ {
+ OMX_COMPONENTTYPE *pComp = ResolveCallsToComponent(ahComponent);
+ omxError = pComp->SetParameter(pComp, anIndex, aComponentParameterStructure);
+ }
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ TBuf8<ADDITIONAL_INFO_SIZE> setParamerInfo;
+ setParamerInfo.Format(Ost_OMXIL_Performance::K_GetParameterInfo , ahComponent, anIndex);
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormat,
+ Ost_OMXIL_Performance::EMeasurementEnd, MAKESTRING(E_SetParam), omxError ,&setParamerInfo);
+
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ if (anIndex == OMX_IndexParamPortDefinition)
+ {
+ OMX_PARAM_PORTDEFINITIONTYPE* portPtr = static_cast<OMX_PARAM_PORTDEFINITIONTYPE*>(aComponentParameterStructure);
+
+ OstTraceExt5( TRACE_API, _SetParameter2, "SetParameter(OMX_IndexParamPortDefinition) < ReturnVal=%{OMX_ERRORTYPE} Component=%p nPortIndex=%u nBufferCountActual=%u nBufferSize=%u",
+ (TUint)omxError, ahComponent, (TUint)(portPtr->nPortIndex), (TUint)(portPtr->nBufferCountActual), (TUint)(portPtr->nBufferSize));
+ }
+ else if (anIndex == OMX_IndexParamCompBufferSupplier)
+ {
+ OMX_PARAM_BUFFERSUPPLIERTYPE* bufPtr = static_cast<OMX_PARAM_BUFFERSUPPLIERTYPE*>(aComponentParameterStructure);
+ OstTraceExt4( TRACE_API, _SetParameter3, "SetParameter(OMX_IndexParamCompBufferSupplier) < ReturnVal=%{OMX_ERRORTYPE} Component=%p nPortIndex=%u eBufferSupplier=%{OMX_BUFFERSUPPLIERTYPE}",
+ (TUint)omxError, ahComponent, (TUint)(bufPtr->nPortIndex), (TUint)(bufPtr->eBufferSupplier));
+ }
+ else if (anIndex > OMX_IndexKhronosExtensions)
+ {
+ OstTraceExt4( TRACE_API, _SetParameter4, "SetParameter(Vendor specific index) < ReturnVal=%u Component=%p nParamIndex=%u aComponentParameterStructure=%p",
+ (TUint)omxError, ahComponent, (TUint)(anIndex), aComponentParameterStructure );
+ }
+ else
+ {
+ OstTraceExt4( TRACE_API, _SetParameter5, "SetParameter < ReturnVal=%u Component=%p nParamIndex=%{OMX_INDEXTYPE} aComponentParameterStructure=%p",
+ (TUint)omxError, ahComponent, (TUint)(anIndex), aComponentParameterStructure );
+ }
+
+ if (aComponentParameterStructure)
+ {
+ OMX_U32* const pStructSize =
+ reinterpret_cast<OMX_U32*>(aComponentParameterStructure);
+ OstTraceData(TRACE_API_DUMP_STRUCT, _SetParameter6, "Param Struct: %{hex8[]}", aComponentParameterStructure, (TUint)(*pStructSize)) ;
+ }
+#endif
+
+ return omxError;
+ }
+
+OMX_ERRORTYPE OMXILAPITraceWrapper::Trace_SendCommand(
+ OMX_IN OMX_HANDLETYPE ahComponent,
+ OMX_IN OMX_COMMANDTYPE aCmd,
+ OMX_IN OMX_U32 anParam1,
+ OMX_IN OMX_PTR apCmdData)
+ {
+ OMX_ERRORTYPE omxError = OMX_ErrorBadParameter;
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ OstTrace0( TRACE_API, _SendCommand1, "SendCommand >" );
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormatMin,
+ Ost_OMXIL_Performance::EMeasurementStart, MAKESTRING(E_SendCommand));
+#endif
+ if(ahComponent)
+ {
+ OMX_COMPONENTTYPE *pComp = ResolveCallsToComponent(ahComponent);
+ omxError = pComp->SendCommand(pComp, aCmd, anParam1, apCmdData);
+ }
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ TBuf8<ADDITIONAL_INFO_SIZE> SendCmdInfo;
+ SendCmdInfo.Format(Ost_OMXIL_Performance::K_OMXSendCommandInfo, ahComponent, aCmd, anParam1);
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormat,
+ Ost_OMXIL_Performance::EMeasurementEnd, MAKESTRING(E_SendCommand), omxError ,&SendCmdInfo);
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ switch (aCmd)
+ {
+ case OMX_CommandStateSet:
+ {
+ OstTraceExt5( TRACE_API, _SendCommand2,
+ "SendCommand < ReturnVal=%{OMX_ERRORTYPE} Component=%p aCmd=%{OMX_COMMANDTYPE} anParam1=%{OMX_STATETYPE} apCmdData=%p",
+ (TUint)omxError, ahComponent, (TUint)aCmd, (TUint)anParam1, apCmdData);
+ }
+ break;
+ case OMX_CommandFlush:
+ case OMX_CommandPortDisable:
+ case OMX_CommandPortEnable:
+ case OMX_CommandMarkBuffer:
+ {
+ if (anParam1 == OMX_ALL)
+ {
+ OstTraceExt4( TRACE_API, _SendCommand3,
+ "SendCommand < ReturnVal=%{OMX_ERRORTYPE} Component=%p aCmd=%{OMX_COMMANDTYPE} anParam1=OMX_ALL apCmdData=%p",
+ (TUint)omxError, ahComponent, (TUint)aCmd, apCmdData);
+ }
+ else
+ {
+ OstTraceExt5( TRACE_API, _SendCommand4,
+ "SendCommand < ReturnVal=%{OMX_ERRORTYPE} Component=%p aCmd=%{OMX_COMMANDTYPE} anParam1=%u apCmdData=%p",
+ (TUint)omxError, ahComponent, (TUint)aCmd, (TUint)anParam1, apCmdData);
+ }
+ }
+ break;
+ default:
+ {
+ OstTraceExt5( TRACE_API, _SendCommand6,
+ "SendCommand < ReturnVal=%{OMX_ERRORTYPE} Component=%p aCmd=%{OMX_COMMANDTYPE} anParam1=%u apCmdData=%p",
+ (TUint)omxError, ahComponent, (TUint)aCmd, (TUint)anParam1, apCmdData);
+ }
+ };
+#endif
+
+ return omxError;
+ }
+
+
+OMX_ERRORTYPE OMXILAPITraceWrapper::Trace_AllocateBuffer(
+ OMX_IN OMX_HANDLETYPE ahComponent,
+ OMX_INOUT OMX_BUFFERHEADERTYPE** apBuffer,
+ OMX_IN OMX_U32 anPortIndex,
+ OMX_IN OMX_PTR apAppPrivate,
+ OMX_IN OMX_U32 anSizeBytes)
+ {
+ OMX_ERRORTYPE omxError = OMX_ErrorBadParameter;
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ OstTrace0( TRACE_API_BUFFER, _AllocateBuffer1, "AllocateBuffer >" );
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormatMin,
+ Ost_OMXIL_Performance::EMeasurementStart, MAKESTRING(E_AllocateBuffer));
+#endif
+
+ if(ahComponent)
+ {
+ OMX_COMPONENTTYPE *pComp = ResolveCallsToComponent(ahComponent);
+ omxError = pComp->AllocateBuffer(pComp, apBuffer, anPortIndex, apAppPrivate, anSizeBytes);
+ }
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ TBuf8<ADDITIONAL_INFO_SIZE> Info;
+ Info.Format(Ost_OMXIL_Performance::K_HandleOnlyInfo, ahComponent );
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormat,
+ Ost_OMXIL_Performance::EMeasurementEnd, MAKESTRING(E_AllocateBuffer), omxError ,&Info);
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ OstTraceExt5( TRACE_API_BUFFER, _AllocateBuffer2, "AllocateBuffer < ReturnVal=%{OMX_ERRORTYPE} Component=%p nPortIndex=%u pBuffer=%p nSizeBytes=%u ",
+ (TUint)omxError, ahComponent, (TUint)anPortIndex, (apBuffer)? *apBuffer:0, (TUint)anSizeBytes );
+#endif
+ return omxError;
+ }
+
+OMX_ERRORTYPE OMXILAPITraceWrapper::Trace_EmptyThisBuffer(
+ OMX_IN OMX_HANDLETYPE ahComponent,
+ OMX_IN OMX_BUFFERHEADERTYPE* apBuffer)
+ {
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ OstTrace0( TRACE_API_BUFFER, _EmptyThisBuffer1, "EmptyThisBuffer >" );
+#endif
+ OMX_ERRORTYPE omxError =OMX_ErrorBadParameter;
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormatMin,
+ Ost_OMXIL_Performance::EMeasurementStart, MAKESTRING(E_EmptyThisBuffer));
+#endif
+ if(ahComponent)
+ {
+ OMX_COMPONENTTYPE *pComp = ResolveCallsToComponent(ahComponent);
+ omxError = pComp->EmptyThisBuffer(pComp, apBuffer);
+ }
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ TBuf8<ADDITIONAL_INFO_SIZE> Info;
+ Info.Format(Ost_OMXIL_Performance::K_HandleOnlyInfo, ahComponent );
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormat,
+ Ost_OMXIL_Performance::EMeasurementEnd, MAKESTRING(E_EmptyThisBuffer), omxError ,&Info);
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ if (apBuffer)
+ {
+ OstTraceExt5( TRACE_API_BUFFER, _EmptyThisBuffer2,
+ "EmptyThisBuffer < ReturnVal=%{OMX_ERRORTYPE} Component=%p pBufferHeader=%p nPortIndex=%u nFilledLen=%u",
+ (TUint)omxError, ahComponent, apBuffer, (TUint)apBuffer->nOutputPortIndex, (TUint)apBuffer->nFilledLen );
+ OstTraceData(TRACE_API_DUMP_STRUCT, _EmptyThisBuffer3,
+ "Buffer Header Struct: %{hex8[]}",
+ apBuffer, (TUint)(apBuffer->nSize)) ;
+ }
+#endif
+
+ return omxError;
+ }
+
+OMX_ERRORTYPE OMXILAPITraceWrapper::Trace_ComponentTunnelRequest(
+ OMX_IN OMX_HANDLETYPE ahComp,
+ OMX_IN OMX_U32 anPort,
+ OMX_IN OMX_HANDLETYPE ahTunneledComp,
+ OMX_IN OMX_U32 anTunneledPort,
+ OMX_INOUT OMX_TUNNELSETUPTYPE* apTunnelSetup)
+ {
+ OMX_ERRORTYPE omxError =OMX_ErrorBadParameter;
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ OstTrace0( TRACE_API, _ComponentTunnelRequest1, "ComponentTunnelRequest >" );
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormatMin,
+ Ost_OMXIL_Performance::EMeasurementStart, MAKESTRING(E_ComponentTunnelRequest));
+#endif
+ if(ahComp)
+ {
+ OMX_COMPONENTTYPE *pComp = ResolveCallsToComponent(ahComp);
+ omxError = pComp->ComponentTunnelRequest(pComp, anPort, ahTunneledComp, anTunneledPort, apTunnelSetup);
+ }
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ TBuf8<ADDITIONAL_INFO_SIZE> Info;
+ Info.Format(Ost_OMXIL_Performance::K_HandleOnlyInfo, ahComp );
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormat,
+ Ost_OMXIL_Performance::EMeasurementEnd, MAKESTRING(E_ComponentTunnelRequest), omxError ,&Info);
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ OstTraceExt5( TRACE_API, _ComponentTunnelRequest2, "ComponentTunnelRequest < ReturnVal=%{OMX_ERRORTYPE} Component=%p nPort=%u hTunneledComp=%u nTunneledPort=%u",
+ (TUint)omxError, ahComp, (TUint)anPort, ahTunneledComp, (TUint)anTunneledPort );
+#endif
+
+ return omxError;
+ }
+
+OMX_ERRORTYPE OMXILAPITraceWrapper::Trace_FillThisBuffer(
+ OMX_IN OMX_HANDLETYPE ahComponent,
+ OMX_IN OMX_BUFFERHEADERTYPE* apBuffer)
+ {
+
+ OMX_ERRORTYPE omxError =OMX_ErrorBadParameter;
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ OstTrace0( TRACE_API_BUFFER, _FillThisBuffer1, "FillThisBuffer >" );
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormatMin,
+ Ost_OMXIL_Performance::EMeasurementStart, MAKESTRING(E_FillThisBuffer));
+#endif
+
+ if(ahComponent)
+ {
+ OMX_COMPONENTTYPE *pComp = ResolveCallsToComponent(ahComponent);
+ omxError = pComp->FillThisBuffer(pComp, apBuffer);
+ }
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ TBuf8<ADDITIONAL_INFO_SIZE> Info;
+ Info.Format(Ost_OMXIL_Performance::K_HandleOnlyInfo, ahComponent );
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormat,
+ Ost_OMXIL_Performance::EMeasurementEnd, MAKESTRING(E_FillThisBuffer), omxError ,&Info);
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ if (apBuffer)
+ {
+ OstTraceExt5( TRACE_API_BUFFER, _FillThisBuffer2,
+ "FillThisBuffer < ReturnVal=%{OMX_ERRORTYPE} Component=%p pBufferHeader=%p nPortIndex=%u nFilledLen=%u",
+ (TUint)omxError, ahComponent, apBuffer, (TUint)apBuffer->nOutputPortIndex, (TUint)apBuffer->nFilledLen );
+ OstTraceData(TRACE_API_DUMP_STRUCT, _FillThisBuffer3,
+ "Buffer Header Struct: %{hex8[]}",
+ apBuffer, (TUint)(apBuffer->nSize)) ;
+ }
+#endif
+ return omxError;
+ }
+
+
+OMX_ERRORTYPE OMXILAPITraceWrapper::Trace_FreeBuffer(
+ OMX_IN OMX_HANDLETYPE ahComponent,
+ OMX_IN OMX_U32 anPortIndex,
+ OMX_IN OMX_BUFFERHEADERTYPE* apBuffer)
+ {
+ OMX_ERRORTYPE omxError = OMX_ErrorBadParameter;
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ OstTrace0( TRACE_API_BUFFER, _FreeBuffer1, "FreeBuffer >" );
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormatMin,
+ Ost_OMXIL_Performance::EMeasurementStart, MAKESTRING(E_FreeBuffer));
+#endif
+
+ if(ahComponent)
+ {
+ OMX_COMPONENTTYPE *pComp = ResolveCallsToComponent(ahComponent);
+ omxError = pComp->FreeBuffer(pComp, anPortIndex, apBuffer);
+ }
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ TBuf8<ADDITIONAL_INFO_SIZE> Info;
+ Info.Format(Ost_OMXIL_Performance::K_HandleOnlyInfo, ahComponent );
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormat,
+ Ost_OMXIL_Performance::EMeasurementEnd, MAKESTRING(E_FreeBuffer), omxError ,&Info);
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ if (apBuffer)
+ {
+ OstTraceExt4( TRACE_API_BUFFER, _FreeBuffer2, "FreeBuffer < ReturnVal=%{OMX_ERRORTYPE} Component=%p nPortIndex=%u pBufferHeader=%p",
+ (TUint)omxError,ahComponent, (TUint)anPortIndex ,apBuffer );
+ OstTraceData(TRACE_API_DUMP_STRUCT, _FreeBuffer3,
+ "Buffer Header Struct: %{hex8[]}",
+ apBuffer, (TUint)(apBuffer->nSize)) ;
+ }
+#endif
+
+ return omxError;
+ }
+
+
+OMX_ERRORTYPE OMXILAPITraceWrapper::Trace_UseBuffer(
+ OMX_IN OMX_HANDLETYPE ahComponent,
+ OMX_INOUT OMX_BUFFERHEADERTYPE** appBufferHdr,
+ OMX_IN OMX_U32 anPortIndex,
+ OMX_IN OMX_PTR apAppPrivate,
+ OMX_IN OMX_U32 anSizeBytes,
+ OMX_IN OMX_U8* apBuffer)
+ {
+ OMX_ERRORTYPE omxError = OMX_ErrorBadParameter;
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ OstTrace0( TRACE_API_BUFFER, _UseBuffer1, "UseBuffer >" );
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormatMin,
+ Ost_OMXIL_Performance::EMeasurementStart, MAKESTRING(E_UseBuffer));
+#endif
+ if(ahComponent)
+ {
+ OMX_COMPONENTTYPE *pComp = ResolveCallsToComponent(ahComponent);
+ omxError = pComp->UseBuffer(pComp, appBufferHdr, anPortIndex, apAppPrivate, anSizeBytes, apBuffer);
+ }
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ TBuf8<ADDITIONAL_INFO_SIZE> Info;
+ Info.Format(Ost_OMXIL_Performance::K_HandleOnlyInfo, ahComponent );
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormat,
+ Ost_OMXIL_Performance::EMeasurementEnd, MAKESTRING(E_UseBuffer), omxError ,&Info);
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ OstTraceExt5( TRACE_API_BUFFER, _UseBuffer2, "UseBuffer < ReturnVal=%{OMX_ERRORTYPE} Component=%p nPortIndex=%u pBuffer=%p nSizeBytes=%u ",
+ (TUint)omxError, ahComponent, (TUint)anPortIndex, (apBuffer)? *apBuffer:0, (TUint)anSizeBytes );
+#endif
+
+ return omxError;
+ }
+
+OMX_ERRORTYPE OMXILAPITraceWrapper::Trace_GetComponentVersionL(
+ OMX_IN OMX_HANDLETYPE ahComponent,
+ OMX_OUT OMX_STRING apComponentName,
+ OMX_OUT OMX_VERSIONTYPE* apComponentVersion,
+ OMX_OUT OMX_VERSIONTYPE* apSpecVersion,
+ OMX_OUT OMX_UUIDTYPE* apComponentUUID)
+ {
+ OMX_ERRORTYPE omxError = OMX_ErrorBadParameter;
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ OstTrace0( TRACE_API, _GetComponentVersion1, "GetComponentVersion >" );
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormatMin,
+ Ost_OMXIL_Performance::EMeasurementStart, MAKESTRING(E_GetComponentVersion));
+#endif
+ if(ahComponent)
+ {
+ OMX_COMPONENTTYPE *pComp = ResolveCallsToComponent(ahComponent);
+ omxError = pComp->GetComponentVersion(pComp, apComponentName, apComponentVersion, apSpecVersion, apComponentUUID);
+ }
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ TBuf8<ADDITIONAL_INFO_SIZE> Info;
+ Info.Format(Ost_OMXIL_Performance::K_HandleOnlyInfo, ahComponent );
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormat,
+ Ost_OMXIL_Performance::EMeasurementEnd, MAKESTRING(E_GetComponentVersion), omxError ,&Info);
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ RBuf8 ComponentInfo;
+ ComponentInfo.CleanupClosePushL();
+
+ TPtrC8 componentNamePtr(const_cast<const TUint8*>(reinterpret_cast<TUint8*>(apComponentName)));
+
+ TInt len = componentNamePtr.Length();
+
+ if (len < 0)
+ {
+ CleanupStack::PopAndDestroy(&ComponentInfo);
+ return OMX_ErrorInvalidComponent;
+ }
+
+ if (ComponentInfo.Create(len))
+ {
+ CleanupStack::PopAndDestroy(&ComponentInfo);
+ return OMX_ErrorInsufficientResources;
+ }
+
+ ComponentInfo = reinterpret_cast<TUint8 *>(apComponentName);
+ OstTraceExt5( TRACE_API, _GetComponentVersion2, "GetComponentVersion < ReturnVal=%u Component=%p pComponentName=%s pComponentVersion=%u, pSpecVersion=%u",
+ (TUint)omxError, ahComponent, ComponentInfo, (TUint)((apComponentVersion)? apComponentVersion->nVersion:0), (TUint)((apSpecVersion)?apSpecVersion->nVersion:0) );
+ CleanupStack::PopAndDestroy(&ComponentInfo);
+#endif
+ return omxError;
+ }
+
+OMX_ERRORTYPE OMXILAPITraceWrapper::Trace_ComponentDeInit(
+ OMX_IN OMX_HANDLETYPE ahComponent)
+ {
+ OMX_ERRORTYPE omxError = OMX_ErrorBadParameter;
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ OstTrace0( TRACE_API, _ComponentDeInit1, "ComponentDeInit >" );
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormatMin,
+ Ost_OMXIL_Performance::EMeasurementStart, MAKESTRING(E_ComponentDeInit));
+#endif
+ if(ahComponent)
+ {
+ OMX_COMPONENTTYPE *pComp = ResolveCallsToComponent(ahComponent);
+ omxError = pComp->ComponentDeInit(pComp);
+ }
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ TBuf8<ADDITIONAL_INFO_SIZE> Info;
+ Info.Format(Ost_OMXIL_Performance::K_HandleOnlyInfo, ahComponent );
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormat,
+ Ost_OMXIL_Performance::EMeasurementEnd, MAKESTRING(E_ComponentDeInit), omxError ,&Info);
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ OstTraceExt1( TRACE_API, _ComponentDeInit2, "ComponentDeInit < hComponent=%p", ahComponent );
+#endif
+ return omxError;
+ }
+
+
+OMX_ERRORTYPE OMXILAPITraceWrapper::Trace_GetExtensionIndexL(
+ OMX_IN OMX_HANDLETYPE ahComponent,
+ OMX_IN OMX_STRING acParameterName,
+ OMX_OUT OMX_INDEXTYPE* apIndexType)
+ {
+ OMX_ERRORTYPE omxError = OMX_ErrorBadParameter;
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ OstTrace0( TRACE_API, _GetExtensionIndex1, "GetExtensionIndex >" );
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormatMin,
+ Ost_OMXIL_Performance::EMeasurementStart, MAKESTRING(E_GetExtensionIndex));
+#endif
+
+ if(ahComponent)
+ {
+ OMX_COMPONENTTYPE *pComp = ResolveCallsToComponent(ahComponent);
+ omxError = pComp-> GetExtensionIndex(pComp, acParameterName, apIndexType);
+ }
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ TBuf8<ADDITIONAL_INFO_SIZE> Info;
+ Info.Format(Ost_OMXIL_Performance::K_HandleOnlyInfo, ahComponent );
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormat,
+ Ost_OMXIL_Performance::EMeasurementEnd, MAKESTRING(E_GetExtensionIndex), omxError ,&Info);
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ RBuf8 ParamInfo;
+
+ ParamInfo.CleanupClosePushL();
+
+ TPtrC8 parameterNamePtr(const_cast<const TUint8*>(reinterpret_cast<TUint8*>(acParameterName)));
+
+ TInt len = parameterNamePtr.Length();
+
+ if (len < 0)
+ {
+ CleanupStack::PopAndDestroy(&ParamInfo);
+ return OMX_ErrorInvalidComponent;
+ }
+
+ if (ParamInfo.Create(len))
+ {
+ CleanupStack::PopAndDestroy(&ParamInfo);
+ return OMX_ErrorInsufficientResources;
+ }
+
+ ParamInfo = reinterpret_cast<TUint8 *>(acParameterName);
+
+ OstTraceExt4( TRACE_API, _GetExtensionIndex2, "GetComponentVersion < ReturnVal=%x Component=%p pComponentName=%s pIndexType=%{OMX_INDEXTYPE}",
+ (TUint)omxError, ahComponent, ParamInfo, (TUint)((apIndexType)? apIndexType:0) );
+
+ CleanupStack::PopAndDestroy(&ParamInfo);
+#endif
+
+ return omxError;
+ }
+
+OMX_ERRORTYPE OMXILAPITraceWrapper::Trace_SetCallbacks(
+ OMX_IN OMX_HANDLETYPE ahComponent,
+ OMX_IN OMX_CALLBACKTYPE* apCallbacks,
+ OMX_IN OMX_PTR apAppData)
+ {
+ OMX_ERRORTYPE omxError = OMX_ErrorBadParameter;
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ OstTrace0( TRACE_API, _SetCallbacks1, "SetCallbacks >" );
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormatMin,
+ Ost_OMXIL_Performance::EMeasurementStart, MAKESTRING(E_SetCallbacks));
+#endif
+
+ if(ahComponent)
+ {
+ // need to access the reference to the internal trace inteface
+ COMPONENT_REF* pTraceCompRef = reinterpret_cast<COMPONENT_REF*>(reinterpret_cast<OMX_COMPONENTTYPE*>(ahComponent)->pComponentPrivate ) ;
+
+ // now access the client's interface and repopulate its callback
+ COMPONENT_REF* pClientCompRef = reinterpret_cast<COMPONENT_REF*>(pTraceCompRef->pComponentIF->pApplicationPrivate);
+
+ pClientCompRef->pCallbacks->EmptyBufferDone = apCallbacks->EmptyBufferDone;
+ pClientCompRef->pCallbacks->EventHandler = apCallbacks->EventHandler;
+ pClientCompRef->pCallbacks->FillBufferDone = apCallbacks->FillBufferDone;
+
+ // send pAppData to the component. The callback sent to the component does not change as this is internally
+ // maintained , the client has no visibility of this trace wrapper interface callback
+ omxError = pTraceCompRef->pComponentIF->SetCallbacks(pTraceCompRef->pComponentIF, pTraceCompRef->pCallbacks, apAppData);
+ }
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ TBuf8<ADDITIONAL_INFO_SIZE> Info;
+ Info.Format(Ost_OMXIL_Performance::K_HandleOnlyInfo, ahComponent );
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormat,
+ Ost_OMXIL_Performance::EMeasurementEnd, MAKESTRING(E_SetCallbacks), 0 ,&Info);
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ OstTraceExt4( TRACE_API, _SetCallbacks2, "SetCallbacks < ReturnVal=%{OMX_ERRORTYPE} Component=%p pCallbacks=%p pAppData=%p",
+ (TUint)omxError,ahComponent, apCallbacks ,apAppData );
+#endif
+
+ return omxError;
+ }
+
+
+OMX_ERRORTYPE OMXILAPITraceWrapper::Trace_EventHandler(
+ OMX_IN OMX_HANDLETYPE ahComponent,
+ OMX_IN OMX_PTR apAppData,
+ OMX_IN OMX_EVENTTYPE aeEvent,
+ OMX_IN OMX_U32 anData1,
+ OMX_IN OMX_U32 anData2,
+ OMX_IN OMX_PTR apEventData)
+ {
+ OMX_ERRORTYPE omxError = OMX_ErrorBadParameter;
+ COMPONENT_REF* pCompRef = NULL;
+ OMX_COMPONENTTYPE* hComponent = NULL;
+
+ if(ahComponent)
+ {
+ pCompRef = ResolveCallsFromComponent(ahComponent);
+
+ if (pCompRef)
+ {
+ hComponent = pCompRef->pComponentIF;
+ omxError = OMX_ErrorNone;
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ TBuf8<ADDITIONAL_INFO_SIZE> CmdNotificationInfo;
+ CmdNotificationInfo.Format(Ost_OMXIL_Performance::K_OMXEventNotificationInfo, hComponent, aeEvent, anData1, anData2 );
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID,ESystemCharacteristicMetrics), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormat,
+ Ost_OMXIL_Performance::EMeasurementEnd, MAKESTRING(E_Event),omxError ,&CmdNotificationInfo);
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ switch(aeEvent)
+ {
+ case OMX_EventCmdComplete:
+ {
+ if (anData1 == OMX_CommandStateSet)
+ {
+ OstTraceExt5( TRACE_API, _EventHandler2,
+ "EventHandler < ReturnVal=%{OMX_ERRORTYPE} Component=%p eEvent=%{OMX_EVENTTYPE} anData1=%{OMX_COMMANDTYPE} nData2=%{OMX_STATETYPE}",
+ (TUint)omxError,hComponent,(TUint)aeEvent,(TUint)anData1, (TUint)anData2 );
+ }
+ else if (anData1 == OMX_CommandPortDisable || anData1 == OMX_CommandPortEnable || anData1 == OMX_CommandFlush)
+ {
+ if (anData2 == OMX_ALL)
+ {
+ OstTraceExt4( TRACE_API, _EventHandler3,
+ "EventHandler < ReturnVal=%{OMX_ERRORTYPE} Component=%p eEvent=%{OMX_EVENTTYPE} anData1=%{OMX_COMMANDTYPE} nData2=OMX_ALL",
+ (TUint)omxError,hComponent,(TUint)aeEvent,(TUint)anData1 );
+ }
+ else
+ {
+ OstTraceExt5( TRACE_API, _EventHandler4,
+ "EventHandler < ReturnVal=%{OMX_ERRORTYPE} Component=%p eEvent=%{OMX_EVENTTYPE} anData1=%{OMX_COMMANDTYPE} nData2=%u",
+ (TUint)omxError,hComponent,(TUint)aeEvent,(TUint)anData1, (TUint)anData2 );
+ }
+ }
+ else
+ {
+ OstTraceExt5( TRACE_API, _EventHandler5,
+ "EventHandler < ReturnVal=%{OMX_ERRORTYPE} Component=%p eEvent=%{OMX_EVENTTYPE} anData1=%{OMX_COMMANDTYPE} nData2=%u",
+ (TUint)omxError,hComponent,(TUint)aeEvent,(TUint)anData1, (TUint)anData2 );
+ }
+ }
+ break;
+ case OMX_EventError:
+ {
+ OstTraceExt5( TRACE_API, _EventHandler6,
+ "EventHandler < ReturnVal=%{OMX_ERRORTYPE} Component=%p eEvent=%{OMX_EVENTTYPE} anData1=%{OMX_ERRORTYPE} nData2=%u",
+ (TUint)omxError,hComponent,(TUint)aeEvent,(TUint)anData1, (TUint)anData2 );
+ }
+ break;
+ case OMX_EventMark:
+ {
+ OstTraceExt4( TRACE_API, _EventHandler7,
+ "EventHandler < ReturnVal=%{OMX_ERRORTYPE} Component=%p eEvent=%{OMX_EVENTTYPE} pEventData=%p",
+ (TUint)omxError,hComponent,(TUint)aeEvent, apEventData );
+ }
+ break;
+ case OMX_EventPortSettingsChanged:
+ {
+ OstTraceExt5( TRACE_API, _EventHandler8,
+ "EventHandler < ReturnVal=%{OMX_ERRORTYPE} Component=%p eEvent=%{OMX_EVENTTYPE} anData1=%u nData2=%u",
+ (TUint)omxError,hComponent,(TUint)aeEvent,(TUint)anData1, (TUint)anData2 );
+ }
+ break;
+ case OMX_EventBufferFlag:
+ {
+ OstTraceExt5( TRACE_API, _EventHandler9,
+ "EventHandler < ReturnVal=%{OMX_ERRORTYPE} Component=%p eEvent=%{OMX_EVENTTYPE} anData1=%u nData2=%x",
+ (TUint)omxError,hComponent,(TUint)aeEvent,(TUint)anData1, (TUint)anData2 );
+ }
+ break;
+ default:
+ {
+ OstTraceExt5( TRACE_API, _EventHandler10,
+ "EventHandler < ReturnVal=%{OMX_ERRORTYPE} Component=%p eEvent=%{OMX_EVENTTYPE} anData1=%u nData2=%u",
+ (TUint)omxError,hComponent,(TUint)aeEvent,(TUint)anData1, (TUint)anData2 );
+ }
+ };
+#endif
+ }
+ }
+
+ if(ahComponent)
+ {
+ omxError = pCompRef->pCallbacks->EventHandler(hComponent, apAppData, aeEvent, anData1, anData2, apEventData);
+ }
+ return omxError;
+ }
+
+OMX_ERRORTYPE OMXILAPITraceWrapper::Trace_EmptyBufferDone(
+ OMX_OUT OMX_HANDLETYPE ahComponent,
+ OMX_OUT OMX_PTR apAppData,
+ OMX_OUT OMX_BUFFERHEADERTYPE* apBuffer)
+ {
+ OMX_ERRORTYPE omxError = OMX_ErrorBadParameter;
+ COMPONENT_REF* pCompRef = NULL;
+ OMX_COMPONENTTYPE* hComponent = NULL;
+
+ if(ahComponent)
+ {
+ pCompRef = ResolveCallsFromComponent(ahComponent);
+
+ if (pCompRef)
+ {
+ hComponent = pCompRef->pComponentIF;
+ omxError = OMX_ErrorNone;
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ OstTraceExt4( TRACE_API_BUFFER, _EmptyBufferDone2,
+ "EmptyBufferDone < ReturnVal=%{OMX_ERRORTYPE} Component=%p apAppData=%p apBufferHeader=%p",
+ (TUint)omxError,hComponent,apAppData, apBuffer );
+ if (apBuffer)
+ {
+ OstTraceData(TRACE_API_DUMP_STRUCT, _EmptyBufferDone3,
+ "Buffer Header Struct: %{hex8[]}",
+ apBuffer, (TUint)(apBuffer->nSize)) ;
+ }
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ TBuf8<ADDITIONAL_INFO_SIZE> Info;
+ Info.Format(Ost_OMXIL_Performance::K_HandleOnlyInfo, hComponent);
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID,ESystemCharacteristicMetrics), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormat,
+ Ost_OMXIL_Performance::EMeasurementEnd, MAKESTRING(E_EmptyBufferDone),omxError ,&Info);
+#endif
+ }
+
+ }
+
+ if(ahComponent)
+ {
+ omxError = pCompRef->pCallbacks->EmptyBufferDone(hComponent, apAppData, apBuffer);
+ }
+
+ return omxError;
+ }
+
+OMX_ERRORTYPE OMXILAPITraceWrapper::Trace_FillBufferDone(
+ OMX_OUT OMX_HANDLETYPE ahComponent,
+ OMX_OUT OMX_PTR apAppData,
+ OMX_OUT OMX_BUFFERHEADERTYPE* apBuffer)
+{
+ OMX_ERRORTYPE omxError = OMX_ErrorBadParameter;
+ COMPONENT_REF* pCompRef = NULL;
+ OMX_COMPONENTTYPE* hComponent = NULL;
+
+ if(ahComponent)
+ {
+ pCompRef = ResolveCallsFromComponent(ahComponent);
+
+ if (pCompRef)
+ {
+ hComponent = pCompRef->pComponentIF;
+ omxError = OMX_ErrorNone;
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+
+ TBuf8<ADDITIONAL_INFO_SIZE> Info;
+ Info.Format(Ost_OMXIL_Performance::K_HandleOnlyInfo, hComponent);
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID,ESystemCharacteristicMetrics), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormat,
+ Ost_OMXIL_Performance::EMeasurementEnd, MAKESTRING(E_FillBufferDone),omxError ,&Info);
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ OstTraceExt4( TRACE_API_BUFFER, _FillBufferDone2,
+ "FillBufferDone < ReturnVal=%{OMX_ERRORTYPE} Component=%p apAppData=%p apBufferHeader=%p",
+ (TUint)omxError, hComponent,apAppData, apBuffer );
+ if (apBuffer)
+ {
+ OstTraceData(TRACE_API_DUMP_STRUCT, _FillBufferDone3,
+ "Buffer Header Struct: %{hex8[]}",
+ apBuffer, (TUint)(apBuffer->nSize)) ;
+ }
+#endif
+ }
+ }
+
+ if(ahComponent)
+ {
+ omxError = pCompRef->pCallbacks->FillBufferDone(pCompRef->pComponentIF, apAppData, apBuffer);
+ }
+ return omxError;
+}
+
+OMX_ERRORTYPE OMXILAPITraceWrapper::Trace_UseEGLImage(
+ OMX_IN OMX_HANDLETYPE ahComponent,
+ OMX_INOUT OMX_BUFFERHEADERTYPE** appBufferHdr,
+ OMX_IN OMX_U32 aPortIndex,
+ OMX_IN OMX_PTR apAppPrivate,
+ OMX_IN void* aeglImage)
+ {
+ OMX_ERRORTYPE omxError = OMX_ErrorBadParameter;
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ OstTrace0( TRACE_API, _UseEGLImage1, "UseEGLImage >" );
+#endif
+
+ if(ahComponent)
+ {
+ OMX_COMPONENTTYPE *pComp = ResolveCallsToComponent(ahComponent);
+ omxError = pComp->UseEGLImage(ahComponent, appBufferHdr, aPortIndex, apAppPrivate, aeglImage );
+ }
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ OstTraceExt5( TRACE_API, _UseEGLImage2, "UseEGLImage < ReturnVal=%{OMX_ERRORTYPE} Component=%p appBufferHdr=%p nIndex=%u aeglImage=%p",
+ (TUint)omxError, ahComponent, (appBufferHdr)?*appBufferHdr: 0, (TUint)aPortIndex, aeglImage );
+#endif
+ return omxError;
+ }
+
+OMX_ERRORTYPE OMXILAPITraceWrapper::Trace_ComponentRoleEnum(
+ OMX_IN OMX_HANDLETYPE ahComponent,
+ OMX_OUT OMX_U8 *aRole,
+ OMX_IN OMX_U32 aIndex)
+ {
+ OMX_ERRORTYPE omxError = OMX_ErrorBadParameter;
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ OstTrace0( TRACE_API, _ComponentRoleEnum1, "ComponentRoleEnum >" );
+#endif
+
+ if(ahComponent)
+ {
+ OMX_COMPONENTTYPE *pComp = ResolveCallsToComponent(ahComponent);
+ omxError = pComp->ComponentRoleEnum(pComp, aRole, aIndex);
+ }
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ OstTraceExt4( TRACE_API, _ComponentRoleEnum2, "ComponentRoleEnum < ReturnVal=%{OMX_ERRORTYPE} Component=%p cRole=%p nIndex=%u ",
+ (TUint)omxError, ahComponent, aRole, (TUint)aIndex );
+#endif
+ return omxError;
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcore/src/core/omxilcomponentapiperformancetrace.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,144 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: This class is provides performance trace wrappers around OpenMax IL APIs.
+* This class shall not be instantiated.
+*
+*/
+
+
+#ifndef __OMXILCOMPONENTAPIPERFORMANCETRACE_H
+#define __OMXILCOMPONENTAPIPERFORMANCETRACE_H
+
+#include <openmax/il/khronos/v1_x/OMX_Types.h>
+#include <openmax/il/khronos/v1_x/OMX_Component.h>
+#include <openmax/il/khronos/v1_x/OMX_Core.h>
+#include <e32def.h>
+#include <e32std.h>
+#include "OSTOMXILFrameworkTrace.h"
+
+
+struct COMPONENT_REF
+ {
+ OMX_COMPONENTTYPE* pComponentIF;
+ OMX_CALLBACKTYPE* pCallbacks;
+ };
+
+/**
+@publishedAll
+@released
+
+This class is provides performance trace wrappers around OpenMax IL APIs.
+This class shall not be instantiated.
+*/
+class OMXILAPITraceWrapper
+ {
+private:
+ // This class shall not be instantiated or inherited
+ OMXILAPITraceWrapper ();
+ OMXILAPITraceWrapper(OMXILAPITraceWrapper& tracewrapper);
+
+public:
+ static OMX_ERRORTYPE Trace_ComponentDeInit(OMX_IN OMX_HANDLETYPE hComponent);
+ static OMX_ERRORTYPE Trace_SetCallbacks(OMX_IN OMX_HANDLETYPE ahComponent,OMX_IN OMX_CALLBACKTYPE* apCallbacks,OMX_IN OMX_PTR apAppData);
+ static OMX_ERRORTYPE Trace_GetExtensionIndexL(OMX_IN OMX_HANDLETYPE ahComponent,OMX_IN OMX_STRING acParameterName,OMX_OUT OMX_INDEXTYPE* apIndexType);
+ static OMX_ERRORTYPE Trace_GetComponentVersionL(OMX_IN OMX_HANDLETYPE ahComponent,OMX_OUT OMX_STRING apComponentName,OMX_OUT OMX_VERSIONTYPE* apComponentVersion,OMX_OUT OMX_VERSIONTYPE* apSpecVersion, OMX_OUT OMX_UUIDTYPE* apComponentUUID);
+ static OMX_ERRORTYPE Trace_UseBuffer(OMX_IN OMX_HANDLETYPE ahComponent, OMX_INOUT OMX_BUFFERHEADERTYPE** appBufferHdr,OMX_IN OMX_U32 anPortIndex, OMX_IN OMX_PTR apAppPrivate, OMX_IN OMX_U32 anSizeBytes,OMX_IN OMX_U8* apBuffer);
+ static OMX_ERRORTYPE Trace_FreeBuffer(OMX_IN OMX_HANDLETYPE ahComponent, OMX_IN OMX_U32 anPortIndex,OMX_IN OMX_BUFFERHEADERTYPE* apBuffer);
+ static OMX_ERRORTYPE Trace_FillThisBuffer(OMX_IN OMX_HANDLETYPE ahComponent,OMX_IN OMX_BUFFERHEADERTYPE* apBuffer);
+ static OMX_ERRORTYPE Trace_ComponentTunnelRequest(OMX_IN OMX_HANDLETYPE ahComp,OMX_IN OMX_U32 anPort,OMX_IN OMX_HANDLETYPE ahTunneledComp,OMX_IN OMX_U32 anTunneledPort,OMX_INOUT OMX_TUNNELSETUPTYPE* apTunnelSetup);
+ static OMX_ERRORTYPE Trace_EmptyThisBuffer( OMX_IN OMX_HANDLETYPE ahComponent,OMX_IN OMX_BUFFERHEADERTYPE* apBuffer);
+ static OMX_ERRORTYPE Trace_AllocateBuffer(OMX_IN OMX_HANDLETYPE ahComponent,OMX_INOUT OMX_BUFFERHEADERTYPE** apBuffer,OMX_IN OMX_U32 anPortIndex,OMX_IN OMX_PTR apAppPrivate,OMX_IN OMX_U32 anSizeBytes);
+ static OMX_ERRORTYPE Trace_FillBufferDone(OMX_OUT OMX_HANDLETYPE ahComponent,OMX_OUT OMX_PTR apAppData,OMX_OUT OMX_BUFFERHEADERTYPE* apBuffer);
+ static OMX_ERRORTYPE Trace_GetConfig(OMX_IN OMX_HANDLETYPE ahComponent,OMX_IN OMX_INDEXTYPE anIndex,OMX_INOUT OMX_PTR apComponentConfigStructure);
+ static OMX_ERRORTYPE Trace_SetConfig(OMX_IN OMX_HANDLETYPE ahComponent,OMX_IN OMX_INDEXTYPE anIndex,OMX_IN OMX_PTR apComponentConfigStructure);
+ static OMX_ERRORTYPE Trace_GetState(OMX_IN OMX_HANDLETYPE ahComponent,OMX_OUT OMX_STATETYPE* apState);
+ static OMX_ERRORTYPE Trace_SendCommand(OMX_IN OMX_HANDLETYPE ahComponent,OMX_IN OMX_COMMANDTYPE aCmd,OMX_IN OMX_U32 anParam1,OMX_IN OMX_PTR apCmdData);
+ static OMX_ERRORTYPE Trace_EmptyBufferDone(OMX_OUT OMX_HANDLETYPE ahComponent,OMX_OUT OMX_PTR pAppData,OMX_OUT OMX_BUFFERHEADERTYPE* pBuffer);
+ static OMX_ERRORTYPE Trace_EventHandler(OMX_IN OMX_HANDLETYPE ahComponent,OMX_IN OMX_PTR apAppData,OMX_IN OMX_EVENTTYPE aeEvent,OMX_IN OMX_U32 anData1,OMX_IN OMX_U32 anData2,OMX_IN OMX_PTR apEventData);
+ static OMX_ERRORTYPE Trace_SetParameter( OMX_IN OMX_HANDLETYPE ahComponent, OMX_IN OMX_INDEXTYPE anIndex, OMX_IN OMX_PTR aComponentParameterStructure);
+ static OMX_ERRORTYPE Trace_GetParameter( OMX_IN OMX_HANDLETYPE ahComponent, OMX_IN OMX_INDEXTYPE anParamIndex,OMX_INOUT OMX_PTR aComponentParameterStructure);
+ static OMX_ERRORTYPE Trace_UseEGLImage( OMX_IN OMX_HANDLETYPE ahComponent, OMX_INOUT OMX_BUFFERHEADERTYPE** appBufferHdr,OMX_IN OMX_U32 aPortIndex,OMX_IN OMX_PTR apAppPrivate,OMX_IN void* aeglImage);
+ static OMX_ERRORTYPE Trace_ComponentRoleEnum (OMX_IN OMX_HANDLETYPE ahComponent, OMX_OUT OMX_U8 *aRole, OMX_IN OMX_U32 aIndex);
+
+ /**
+ Creates all the objects required to make the tracetrampoline work
+
+ @param aClientHandle Trace component handle will be passed passed to the client
+ @param aTraceCallBack Trace callback structure that is passed to the component
+ @param aCompRefToClient Keeps track of the real callback and component handle structure
+ @param aCompRefToTrace Keeps track of the trace callback and component handle structure
+ */
+
+ static OMX_ERRORTYPE PrepareTraceStructuresL( OMX_INOUT OMX_HANDLETYPE& aClientHandle, OMX_INOUT OMX_CALLBACKTYPE*& aTraceCallBack, COMPONENT_REF*& aCompRefToClient, COMPONENT_REF*& aCompRefToTrace);
+
+ /**
+ Cleans up all the objects created for the trace trampoline
+
+ @param aClientHandle Trace component handle that is passed to the client
+ @param aTraceCallBack Trace callback structure that is passed to the component
+ @param aCompRefToClient Keeps track of the real callback and component handle structure
+ @param aCompRefToTrace Keeps track of the trace callback and component handle structure
+ */
+ static OMX_ERRORTYPE UndoPrepareTraceStructures( OMX_INOUT OMX_HANDLETYPE& aClientHandle, OMX_INOUT OMX_CALLBACKTYPE*& aTraceCallBack, COMPONENT_REF*& aCompRefToClient, COMPONENT_REF*& aCompRefToTrace);
+
+ /**
+ Create a map of the Trace wrapper interface OMX_COMPONENTTYPE handle + OMX_CALLBACKTYPE and the client's
+ OMX_COMPONENTTYPE handle + OMX_CALLBACKTYPE
+
+ OMX_COMPONENTTYPE:pComponentPrivate is required by the component
+ OMX_COMPONENTTYPE:pApplicationPrivate is required by the application
+ This function stores the reference(COMPONENT_REF) to the real OMX_COMPONENTTYPE handle + OMX_CALLBACKTYPE
+ in the client's OMX_COMPONENTTYPE:pComponentPrivate.
+ It also stores the clients OMX_COMPONENTTYPE and OMX_CALLBACKTYPE structures which point to the Trace wrapper function pointers
+ in the Trace Interface's pApplicationPrivate.
+
+ @param ahClientComp original component handle from client
+ @param apClientCallBack original callback structure from Client
+ @param ahTraceComp Trace component handle that is passed to the client
+ @param apTraceCallBack Trace callback structure that is passed to the component
+ @param aCompRefToClient Keeps track of the real callback and component handle structure
+ @param aCompRefToTrace Keeps track of the trace callback and component handle structure
+ */
+ static TInt PatchStructures( OMX_IN OMX_HANDLETYPE ahClientComp, OMX_IN OMX_CALLBACKTYPE* apClientCallBack, OMX_IN OMX_HANDLETYPE ahTraceComp, OMX_INOUT OMX_CALLBACKTYPE* apTraceCallBack,COMPONENT_REF*& aCompRefToClient, COMPONENT_REF*& aCompRefToTrace);
+
+
+ /**
+
+ The function destroys the extra object that were created for the function tracing. Before the destruction
+ it has to resolve the resolve the real component handle from the trace component handle.
+
+ @param ahClientComp ahTraceComp Trace component handle that was passed to the client
+ */
+ static TInt ComponentTracerDestroy(OMX_IN OMX_HANDLETYPE ahClientComp);
+
+ /**
+ This function resolves the bridge between the client's handle to a trace wrapper OMX_COMPONENTTYPE
+ structure and the real OMX_HANDLETYPE structure populated by the component.
+
+ @param ahComponent Trace component handle that was passed to the client
+ */
+ inline static OMX_COMPONENTTYPE* ResolveCallsToComponent(OMX_IN OMX_HANDLETYPE ahComponent);
+
+ /**
+ This function resolves the bridge between the components's handle to a trace wrapper OMX_CALLBACKTYPE structure
+ and the real clients OMX_CALLBACKTYPE structure
+
+ @param ahComponent component handle that was passed to the component
+ */
+ inline static COMPONENT_REF* ResolveCallsFromComponent(OMX_IN OMX_HANDLETYPE ahComponent);
+ };
+
+#include "omxilcomponentapiperformancetrace.inl"
+
+#endif //__OMXILCOMPONENTAPIPERFORMANCETRACE_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcore/src/core/omxilcomponentapiperformancetrace.inl Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,41 @@
+/*
+* 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: Inline fuction used is OMXILAPITraceWrapper class
+*
+*/
+
+
+
+#ifndef __OMXILCOMPONENTAPIPERFORMANCETRACE_INL
+#define __OMXILCOMPONENTAPIPERFORMANCETRACE_INL
+
+inline OMX_COMPONENTTYPE* OMXILAPITraceWrapper::ResolveCallsToComponent(OMX_IN OMX_HANDLETYPE ahComponent)
+ {
+ OMX_COMPONENTTYPE* pComp = NULL;
+ if(ahComponent)
+ {
+ COMPONENT_REF* pTRaceRef = reinterpret_cast<COMPONENT_REF*> ((reinterpret_cast<OMX_COMPONENTTYPE*>(ahComponent))->pComponentPrivate );
+ pComp = pTRaceRef->pComponentIF;
+ }
+ return pComp;
+ }
+
+inline COMPONENT_REF* OMXILAPITraceWrapper::ResolveCallsFromComponent(OMX_IN OMX_HANDLETYPE ahComponent)
+ {
+ ASSERT(ahComponent);
+ return reinterpret_cast<COMPONENT_REF*> ((reinterpret_cast<OMX_COMPONENTTYPE*>(ahComponent))->pApplicationPrivate );
+ }
+
+
+#endif //__OMXILCOMPONENTAPIPERFORMANCETRACE_INL
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcore/src/core/omxilcore.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,1182 @@
+// 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/ecom.h>
+#include <string.h>
+#include <openmax/il/khronos/v1_x/OMX_Core.h>
+#include <openmax/il/khronos/v1_x/OMX_Component.h>
+#include <uri8.h>
+#include <e32des8.h>
+
+#include "log.h"
+#include "omxilcore.h"
+#include "omxiluids.hrh"
+#include <openmax/il/core/omxilloaderif.h>
+#include <openmax/il/core/omxilloaderif.hrh>
+#include <openmax/il/core/omxilcontentpipeif.h>
+#include <openmax/il/core/omxilcontentpipeif.hrh>
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+#define ENABLE_OMXIL_TRACING
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+#define ENABLE_OMXIL_TRACING
+#endif
+
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+#include "..\..\traces\OstTraceDefinitions.h"
+
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "OmxilcoreTraces.h"
+#endif
+
+#endif
+
+#ifdef ENABLE_OMXIL_TRACING
+#include "OmxilComponentAPIPerformanceTrace.h"
+#endif
+
+
+
+#ifdef _DEBUG
+// This used only in debug build, for now...
+_LIT(KOmxILCorePanic, "OmxILCore Panic");
+#endif
+
+const TInt KLoadersGranularity = 1;
+const TInt KContentPipesGranularity = 1;
+
+const TUint8 COmxILCore::iSpecVersionMajor;
+const TUint8 COmxILCore::iSpecVersionMinor;
+const TUint8 COmxILCore::iSpecVersionRevision;
+const TUint8 COmxILCore::iSpecVersionStep;
+
+
+COmxILCore::COmxILCore()
+ :
+ iLoaders(KLoadersGranularity),
+ iContentPipes(KContentPipesGranularity)
+ {
+ DEBUG_PRINTF(_L8("COmxILCore::COmxILCore"));
+ }
+
+COmxILCore::~COmxILCore()
+ {
+ DEBUG_PRINTF(_L8("COmxILCore::~COmxILCore"));
+ }
+
+OMX_ERRORTYPE COmxILCore::ListLoaders()
+ {
+ DEBUG_PRINTF(_L8("COmxILCore::ListLoaders"));
+
+ RImplInfoPtrArray ecomArray;
+ OMX_ERRORTYPE omxError = OMX_ErrorNone;
+ TInt error = KErrNone;
+ TRAP(error, REComSession::ListImplementationsL(
+ TUid::Uid(KUidOmxILLoaderInterface),ecomArray));
+
+ if(KErrNone == error)
+ {
+ const TInt ecomCount = ecomArray.Count();
+ const TInt loadersCount = iLoaders.Count();
+
+ // We only consider a situation where loader plugins are added to the
+ // system...
+ if(ecomCount > loadersCount)
+ {
+ TOmxLoaderInfo loader;
+ CImplementationInformation* info;
+ TInt indexLoaders;
+ for(TInt index=0; index<ecomCount; ++index)
+ {
+ info = ecomArray[index];
+ for( indexLoaders=0;
+ (indexLoaders<loadersCount)
+ &&(info->ImplementationUid()!=
+ iLoaders[indexLoaders].iUid);
+ ++indexLoaders )
+ {}
+
+ if(indexLoaders>=loadersCount)
+ {
+ loader.iUid = info->ImplementationUid();
+ loader.iLoader = NULL;
+
+ // We load loader plugins here, instead of "on-demand"...
+ omxError = LoadAndInitLoader(loader.iUid,
+ loader.iLoader);
+ if (OMX_ErrorNone == omxError)
+ {
+ error = iLoaders.Append(loader);
+ if(KErrNone != error)
+ {
+ __ASSERT_DEBUG(loader.iLoader != NULL,
+ User::Panic(KOmxILCorePanic, 1));
+ OMX_LOADERTYPE* omx_loader =
+ reinterpret_cast<OMX_LOADERTYPE*>(loader.iLoader->Handle());
+ __ASSERT_DEBUG(omx_loader != NULL,
+ User::Panic(KOmxILCorePanic, 1));
+ omx_loader->UnInitializeComponentLoader(omx_loader);
+ delete loader.iLoader;
+ break;
+ }
+ }
+ else
+ {
+ DEBUG_PRINTF3(_L8("COmxILCore::ListLoaders : Loader [%d] returned OMX Error [%d]"), index, omxError);
+ // Check whether there's any point on continuing with
+ // the next loader...
+ if (OMX_ErrorInsufficientResources == omxError)
+ {
+ error=KErrNoMemory;
+ break;
+ }
+ else
+ {
+ DEBUG_PRINTF3(_L8("COmxILCore::ListLoaders : Loader [%d] returned OMX Error [%d] Ignoring error code as it's no considered critical!"), index, omxError);
+ omxError=OMX_ErrorNone; //ignore any non-critical errors
+ }
+ }
+ }
+ }
+ }
+
+ }
+
+ if (KErrNone != error)
+ {
+ if (KErrNoMemory == error)
+ {
+ omxError = OMX_ErrorInsufficientResources;
+ }
+ else
+ {
+ // We should return an OMX error that at least is allowed by the
+ // spec during OMX_Init()
+ omxError = OMX_ErrorTimeout;
+ }
+ }
+
+ ecomArray.ResetAndDestroy();
+ return omxError;
+ }
+
+TBool VerifyComponentName(const OMX_STRING aComponentName)
+ {
+ const TInt KComponentNamePrefixLen = 4;
+ return strncmp(aComponentName,"OMX.", KComponentNamePrefixLen) == 0;
+ }
+EXPORT_C OMX_ERRORTYPE COmxILCore::LoadComponent(
+ const OMX_STRING aComponentName,
+ OMX_HANDLETYPE* aHandle,
+ OMX_PTR aAppData,
+ OMX_CALLBACKTYPE* aCallBacks)
+ {
+ OMX_CALLBACKTYPE* pLocCallBacks = aCallBacks;
+ OMX_ERRORTYPE error = OMX_ErrorNone;
+ DEBUG_PRINTF(_L8("COmxILCore::LoadComponent"));
+
+#ifdef ENABLE_OMXIL_TRACING
+ OMX_HANDLETYPE hClientHandle ;
+ TBool IsPrepareTraceStructuresLFailure=EFalse;
+ COMPONENT_REF* pCompRefToClient;
+ COMPONENT_REF* pCompRefToTrace;
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ OstTrace0( TRACE_API, _LoadComponent1, "OMX_GetHandle >" );
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormatMin,
+ Ost_OMXIL_Performance::EMeasurementStart, MAKESTRING(E_GetHandle));
+#endif
+
+
+ if(error == OMX_ErrorNone)
+ {
+ if(!aHandle || !aComponentName)
+ {
+ error = OMX_ErrorBadParameter;
+ }
+ else
+ {
+ if( !VerifyComponentName(aComponentName))
+ {
+ error = OMX_ErrorInvalidComponentName;
+ }
+ else
+ {
+#ifdef ENABLE_OMXIL_TRACING
+ TRAPD(Err, OMXILAPITraceWrapper::PrepareTraceStructuresL(hClientHandle, pLocCallBacks, pCompRefToClient, pCompRefToTrace) );
+ if(Err != KErrNone)
+ {
+ IsPrepareTraceStructuresLFailure = ETrue;
+ error = OMX_ErrorInsufficientResources;
+ }
+#endif
+ }
+ }
+ }
+
+ if(error == OMX_ErrorNone)
+ {
+ error = OMX_ErrorComponentNotFound;
+ OMX_LOADERTYPE* loader;
+
+ const TInt count = iLoaders.Count();
+ for( TInt index=0; index<count; ++index )
+ {
+ loader = reinterpret_cast<OMX_LOADERTYPE*>(
+ iLoaders[index].iLoader->Handle());
+ __ASSERT_DEBUG(loader != NULL, User::Panic(KOmxILCorePanic, 1));
+ error = loader->LoadComponent(loader, aHandle,
+ aComponentName,
+ aAppData, pLocCallBacks);
+ // if loading the component succeeded we can return else we disregard
+ // the error on this loader and search for the component with the next
+ // loader. If this is the last loader the error will be returned at
+ // the bottom of the function. We return also if there are no resoruces
+ // available...
+ if( OMX_ErrorNone == error || OMX_ErrorInsufficientResources == error)
+ {
+ break;
+ }
+ }
+ }
+#ifdef ENABLE_OMXIL_TRACING
+ if(error == OMX_ErrorNone)
+ {
+ OMXILAPITraceWrapper::PatchStructures(hClientHandle, aCallBacks, *aHandle, pLocCallBacks, pCompRefToClient, pCompRefToTrace);
+ *aHandle = hClientHandle;
+ }
+ else
+ {
+ if(!IsPrepareTraceStructuresLFailure)
+ {
+ // this means the component was not loaded, do cleanup
+ OMXILAPITraceWrapper::UndoPrepareTraceStructures(hClientHandle, pLocCallBacks, pCompRefToClient, pCompRefToTrace);
+ }
+ }
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ TBuf8<ADDITIONAL_INFO_SIZE> HandleInfomation;
+
+ HandleInfomation.Format(Ost_OMXIL_Performance::K_HandleInfo, (aHandle)?(*aHandle):0, (!aHandle || !aComponentName)?"" :aComponentName);
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormat,
+ Ost_OMXIL_Performance::EMeasurementEnd, MAKESTRING(E_GetHandle), error ,&HandleInfomation);
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ TPtrC8 ComponentInfo(const_cast<const TUint8*>(reinterpret_cast<TUint8*>(aComponentName)));
+ OstTraceExt5( TRACE_API, _LoadComponent2, "OMX_GetHandle < ReturnVal=%{OMX_ERRORTYPE} Component=%p aComponentName=%s pAppData=%p aCallBacks=%p",
+ (TUint)error, *aHandle, ComponentInfo, aAppData, aCallBacks );
+
+#endif
+
+ return error;
+ }
+
+OMX_ERRORTYPE COmxILCore::LoadAndInitLoader(
+ const TUid& aUid, COmxComponentLoaderIf*& aLoader)
+ {
+ DEBUG_PRINTF(_L8("COmxILCore::LoadAndInitLoader"));
+
+ COmxComponentLoaderIf* loader = NULL;
+ TRAPD(err, loader = COmxComponentLoaderIf::CreateImplementationL(aUid));
+ if(err != KErrNone)
+ {
+ if (err == KErrNoMemory)
+ {
+ return OMX_ErrorInsufficientResources;
+ }
+ return OMX_ErrorInvalidComponent;
+ }
+
+ OMX_HANDLETYPE handle = loader->Handle();
+ if (!handle)
+ {
+ delete loader;
+ return OMX_ErrorUndefined;
+ }
+
+ OMX_LOADERTYPE* omx_loader = reinterpret_cast<OMX_LOADERTYPE*>(handle);
+ __ASSERT_DEBUG(omx_loader != NULL, User::Panic(KOmxILCorePanic, 1));
+ OMX_ERRORTYPE error = omx_loader->InitializeComponentLoader(omx_loader);
+ if(error != OMX_ErrorNone)
+ {
+ // We should call UnInitializeComponentLoader before deletion, just in
+ // case...returned error is irrelevant now...
+ omx_loader->UnInitializeComponentLoader(omx_loader);
+ delete loader;
+ return error;
+ }
+
+ aLoader = loader;
+ return error;
+ }
+
+void COmxILCore::DeinitCore()
+ {
+ DEBUG_PRINTF(_L8("COmxILCore::DeinitCore"));
+
+ TInt index;
+ COmxComponentLoaderIf* loader;
+
+ const TInt KLoaderCount = iLoaders.Count();
+ for( index = 0; index<KLoaderCount; ++index )
+ {
+ loader = iLoaders[index].iLoader;
+ // Check this in case the loader has not been initialized yet...
+ if(loader)
+ {
+ OMX_HANDLETYPE handle = loader->Handle();
+ OMX_LOADERTYPE* omx_loader =
+ reinterpret_cast<OMX_LOADERTYPE*>(handle);
+ __ASSERT_DEBUG(omx_loader != NULL,
+ User::Panic(KOmxILCorePanic, 1));
+ OMX_ERRORTYPE error =
+ omx_loader->UnInitializeComponentLoader(omx_loader);
+ delete loader;
+ }
+ }
+ iLoaders.Close();
+ iContentPipes.ResetAndDestroy();
+ }
+
+
+EXPORT_C OMX_ERRORTYPE COmxILCore::ComponentNameEnum(
+ OMX_STRING aComponentName,
+ OMX_U32 aNameLength,
+ const OMX_U32 aIndex)
+ {
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ OstTrace0( TRACE_API, _ComponentNameEnum1, "OMX_ComponentNameEnum >" );
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormatMin,
+ Ost_OMXIL_Performance::EMeasurementStart, MAKESTRING(E_ComponentNameEnum));
+#endif
+
+ DEBUG_PRINTF(_L8("COmxILCore::ComponentNameEnum"));
+
+ OMX_ERRORTYPE error = OMX_ErrorNone;
+
+ if( aNameLength == 0 || aComponentName == NULL )
+ {
+ error= OMX_ErrorBadParameter;
+ }
+ else
+ {
+ const TInt KLoadersCount = iLoaders.Count();
+ if (KLoadersCount == 0)
+ {
+ // There are no loaders in the system...
+ DEBUG_PRINTF2(_L8("COmxILCore::ComponentNameEnum (index = %d) : No loaders present..."), aIndex);
+ error = OMX_ErrorNoMore;
+ }
+ else
+ {
+ const TInt KIndexForPopulateList = 0;
+ // if aIndex is 0 (i.e. KIndexForPopulateList) the redescovery of
+ // components is triggered in the client library
+ if( aIndex == KIndexForPopulateList )
+ {
+ TBool found=EFalse;
+ char tempComponentName[OMX_MAX_STRINGNAME_SIZE];
+
+ // each loader should rediscover its components
+ for( TInt index=0; index < KLoadersCount; ++index )
+ {
+ OMX_LOADERTYPE* loader = reinterpret_cast<OMX_LOADERTYPE*>(
+ iLoaders[index].iLoader->Handle());
+ __ASSERT_DEBUG(loader != NULL, User::Panic(KOmxILCorePanic, 1));
+
+ // Index 0 means two things according to the standard: core (through its loader(s)) has to discover components (populate component list)
+ // and also the component name at 0 index has to be returned
+ // As there are multiple loaders present and there is no information which loader has any components
+ // we must go through all loaders inputting 0 index and see which loaders returns anything at index 0 first
+ // Once we've found the 0 index we can just ignore any component names returned from subsequent calls to loaders
+ error = loader->ComponentNameEnum(loader,
+ tempComponentName,
+ aNameLength,aIndex);
+ if(OMX_ErrorNone==error)
+ {
+ if(!found)//component hasn't been found yet
+ {
+ strncpy(aComponentName, tempComponentName, aNameLength - 1);
+ found=ETrue; //now it's found
+ }
+ }
+ else
+ {
+ // We must continue with the next loader if the current loader
+ // has no components... or if there is some other error
+ // condition in the current loader...
+ if( OMX_ErrorNoMore == error )
+ {
+ DEBUG_PRINTF2(_L8("COmxILCore::ComponentNameEnum (index = 0) : Loader [%d] has 0 components..."), index);
+ }
+ else
+ {
+ // In case the loader returned with some other error condition,
+ // we log the situation...
+ DEBUG_PRINTF3(_L8("COmxILCore::ComponentNameEnum (index = 0) : Loader [%d] returned OMX error [%d].. ignoring loader..."), index, error);
+ // Check whether there's any point on continuing with the
+ // next loader...
+ if (OMX_ErrorInsufficientResources == error)
+ {
+ error = OMX_ErrorInsufficientResources;
+ break;
+ }
+ }
+ }
+ }
+ error= (found ? OMX_ErrorNone : OMX_ErrorNoMore);
+ }
+ else
+ {
+ RArray<TInt> componentCountPerLoader;
+ TInt err=KErrNone;
+
+ //init componentCountPerLoader array with -1; this array tells how many components a particular loader has
+ for(TInt loaderIndex=0; loaderIndex < KLoadersCount; ++loaderIndex)
+ {
+ //first check if loader is available
+ if( iLoaders[loaderIndex].iLoader == NULL )
+ {
+ // We are considering here that ComponentNameEnum with index =
+ // 0 must have been called previously... the spec is not
+ // completely clear here...We return ErrorNotReady although
+ // this is not a legal return code for this IL Core function...
+ componentCountPerLoader.Close();
+ error = OMX_ErrorNotReady;
+ break;
+ }
+ err=componentCountPerLoader.Append(-1);
+ switch(err)
+ {
+ case KErrNone:
+ //do nothing
+ error = OMX_ErrorNone;
+ break;
+ case KErrNoMemory:
+ componentCountPerLoader.Close();
+ error = OMX_ErrorInsufficientResources;
+ break;
+ default:
+ componentCountPerLoader.Close();
+ error = OMX_ErrorUndefined;
+ }
+ if(error != OMX_ErrorNone)
+ {
+ break;
+ }
+ }
+
+ if(error == OMX_ErrorNone)
+ {
+ for(TInt loaderIndex=0; loaderIndex < KLoadersCount; ++loaderIndex)
+ {
+ //fist acquire the actual loader
+ OMX_LOADERTYPE* loader = reinterpret_cast<OMX_LOADERTYPE*>(iLoaders[loaderIndex].iLoader->Handle());
+ __ASSERT_DEBUG(loader != NULL, User::Panic(KOmxILCorePanic, 1));
+
+ //then count how many components the previous loaders have in total
+ //obviously for the first loader this loop won't do anything (ie: for loaderIndex==0)
+ //for the second loader it will count the first loader's component count, etc....
+ TInt totalComponentCount(0);
+ for(TInt l=0; l<loaderIndex; ++l)
+ {
+ totalComponentCount+=componentCountPerLoader[l];
+ }
+
+ //then calculate the relative index, which is the index in the actual loader if the component
+ //was not found in previous loaders
+ //eg: if the query index is 8, and the first loader has 6 components, the second has 1 component, then
+ //the relative index is 8-(6+1)=1, that's we are querying the component at index 1 (which is in fact the second one as the indexing is zero based) of the 3rd loader
+ TInt relativeIndex = aIndex-totalComponentCount;
+ error = loader->ComponentNameEnum(loader,
+ aComponentName,
+ aNameLength, relativeIndex);
+ TBool IsReturn = ETrue;
+ switch(error)
+ {
+ case OMX_ErrorNone:
+ //this loader has component at this index (ie: at relativeIndex)
+ componentCountPerLoader.Close(); //free array before return
+ break;
+
+ case OMX_ErrorNoMore:
+ if((KLoadersCount-1)==loaderIndex) //if this is the last loader then the component at this index index obviously does not exist
+ {
+ componentCountPerLoader.Close(); //free array before return
+ break;
+ }
+ //this loader has not this many components, so find out how many it actually has
+ //and then update the correponding item in the componentCountPerLoader array
+ if(0==relativeIndex)//if this loader has no component at index 0, then it has no components at all
+ {
+ componentCountPerLoader[loaderIndex]=0;
+ IsReturn = EFalse;
+ break;
+ }
+
+ for(TInt m=relativeIndex-1; m>=0;--m) //try to figure the first available index (counting down)
+ {
+ OMX_ERRORTYPE tempError = loader->ComponentNameEnum(loader,
+ aComponentName,
+ aNameLength, m);
+ if(OMX_ErrorNone==tempError)
+ {
+ //this is the first index (counting down) where this loader has component
+ componentCountPerLoader[loaderIndex]=m+1; //eg: index==4, then component count is 5 (because of zero based indexing)
+ IsReturn = EFalse;
+ break;
+ }
+ else if(OMX_ErrorInsufficientResources==tempError)
+ {
+ //critical error; free array before return
+ componentCountPerLoader.Close();
+ error = OMX_ErrorInsufficientResources;
+ break;
+ }
+ //ignore any non-critical error (ie: other than OMX_ErrorInsufficientResources) and go one index down
+ }
+
+ //if after the last loop (ie: m==0) the count was still not set for some reasons, then set to zero
+ if(!IsReturn && (-1==componentCountPerLoader[loaderIndex] ))
+ {
+ componentCountPerLoader[loaderIndex]=0;
+ }
+ break;
+ case OMX_ErrorInsufficientResources:
+ componentCountPerLoader.Close(); //free array before return
+ break;
+ default:
+ //some unknown error happened to the loader therefore we can't count how many component it has, assume zero
+ DEBUG_PRINTF4(_L8("COmxILCore::ComponentNameEnum (index = %d) : Loader [%d] returned OMX error [%d].. ignoring loader (ie: assuming ZERO components)..."), aIndex, loaderIndex, error);
+ componentCountPerLoader[loaderIndex]=0;
+ IsReturn = EFalse;
+ break;
+ }
+
+ if(IsReturn)
+ {
+ break;
+ }
+
+ }//end of for
+
+ } // error == OMX_ErrorNone
+ componentCountPerLoader.Close(); //free array before return
+ } // else
+ }
+ }
+
+ if (OMX_ErrorInsufficientResources == error)
+ {
+ error = OMX_ErrorUndefined;
+ }
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ TBuf8<1> Infomation;
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormat,
+ Ost_OMXIL_Performance::EMeasurementEnd, MAKESTRING(E_ComponentNameEnum),error ,&Infomation);
+#endif
+
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ TPtrC8 componentNamePtr(const_cast<const TUint8*>(reinterpret_cast<TUint8*>(aComponentName)));
+ OstTraceExt4( TRACE_API, _ComponentNameEnum2, "OMX_ComponentNameEnum < ReturnVal=%{OMX_ERRORTYPE} aComponentName=%s aNameLength=%u aIndex=%u",
+ (TUint)error, componentNamePtr, (TUint)aNameLength, (TUint)aIndex );
+
+#endif
+
+ return error;
+ }
+
+
+EXPORT_C OMX_ERRORTYPE COmxILCore::FreeHandle(OMX_HANDLETYPE aComponent) const
+ {
+ DEBUG_PRINTF2(_L8("COmxILCore::FreeHandle : Component Handle [%X]"), aComponent);
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ OstTrace0( TRACE_API, _FreeHandle1, "OMX_FreeHandle >" );
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormatMin,
+ Ost_OMXIL_Performance::EMeasurementStart, MAKESTRING(E_FreeHandle));
+#endif
+ OMX_ERRORTYPE error = OMX_ErrorNone;
+ if( aComponent == NULL )
+ {
+ error = OMX_ErrorBadParameter;
+ }
+ else
+ {
+
+#ifdef ENABLE_OMXIL_TRACING
+ // resolve the handle to be passed to the component
+ OMX_HANDLETYPE ComponentTemp = OMXILAPITraceWrapper::ResolveCallsToComponent(aComponent);
+ // delete the temporatry reference objects
+ OMXILAPITraceWrapper::ComponentTracerDestroy(aComponent);
+ aComponent = ComponentTemp;
+#endif
+ OMX_LOADERTYPE* loader;
+ error = OMX_ErrorComponentNotFound;
+
+ const TInt KLoadersCount = iLoaders.Count();
+ for(TInt index=0; index < KLoadersCount; ++index)
+ {
+ // Check this just in case the loader has not been initialized yet...
+ if(iLoaders[index].iLoader != NULL)
+ {
+ loader = reinterpret_cast<OMX_LOADERTYPE*>(iLoaders[index].iLoader->Handle());
+ __ASSERT_DEBUG(loader != NULL, User::Panic(KOmxILCorePanic, 1));
+ error = loader->UnloadComponent(loader, aComponent);
+ if( OMX_ErrorNone == error )
+ {
+ // Success case... otherwise, continue with next loader...
+ break;
+ }
+ #ifdef _DEBUG
+ if( OMX_ErrorComponentNotFound != error )
+ {
+ // Another error occured... log the situation...
+ DEBUG_PRINTF3(_L8("COmxILCore::FreeHandle : Loader [%d] returned OMX error [%d].. continuing with next loader..."), index, error);
+ }
+ #endif
+ }
+ }
+ }
+
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ OstTraceExt2( TRACE_API, _FreeHandle2, "OMX_FreeHandle < ReturnVal=%x Component=%p",
+ (TUint)error, aComponent );
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ TBuf8<ADDITIONAL_INFO_SIZE> FreeHandleInfo;
+ FreeHandleInfo.Format(Ost_OMXIL_Performance::K_HandleOnlyInfo , aComponent);
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormat,
+ Ost_OMXIL_Performance::EMeasurementEnd, MAKESTRING(E_FreeHandle), error,&FreeHandleInfo);
+#endif
+
+
+ return error;
+ }
+
+EXPORT_C OMX_ERRORTYPE COmxILCore::SetupTunnel(OMX_HANDLETYPE aHandleOutput,
+ OMX_U32 aPortOutput,
+ OMX_HANDLETYPE aHandleInput,
+ OMX_U32 aPortInput)
+ {
+ DEBUG_PRINTF(_L8("COmxILCore::SetupTunnel"));
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ OstTrace0( TRACE_API, _SetupTunnel1, "OMX_SetupTunnel >" );
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormatMin,
+ Ost_OMXIL_Performance::EMeasurementStart, MAKESTRING(E_SetupTunnel));
+#endif
+ OMX_ERRORTYPE error = OMX_ErrorNone;
+ if (!aHandleOutput && !aHandleInput )
+ {
+ error= OMX_ErrorBadParameter;
+ }
+ else
+ {
+ OMX_COMPONENTTYPE *componentInput, *componentOutput;
+ componentInput = reinterpret_cast<OMX_COMPONENTTYPE*>(aHandleInput);
+ componentOutput = reinterpret_cast<OMX_COMPONENTTYPE*>(aHandleOutput);
+
+ OMX_TUNNELSETUPTYPE tunnelSetup;
+ OMX_PARAM_PORTDEFINITIONTYPE portDefinitionType;
+
+ tunnelSetup.nTunnelFlags = 0;
+ tunnelSetup.eSupplier = OMX_BufferSupplyUnspecified;
+
+ if(componentOutput)
+ {
+ // Check that the output port is actually an output port
+ portDefinitionType.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE);
+ portDefinitionType.nVersion.s.nVersionMajor = COmxILCore::iSpecVersionMajor;
+ portDefinitionType.nVersion.s.nVersionMinor = COmxILCore::iSpecVersionMinor;
+ portDefinitionType.nVersion.s.nRevision = COmxILCore::iSpecVersionRevision;
+ portDefinitionType.nVersion.s.nStep = COmxILCore::iSpecVersionStep;
+ portDefinitionType.nPortIndex = aPortOutput;
+ if (OMX_ErrorNone != (error = componentOutput->GetParameter(
+ componentOutput,
+ OMX_IndexParamPortDefinition,
+ &portDefinitionType)))
+ {
+ error = TOmxILCoreUtils::ConvertErrorGetParameterToSetupTunnel(error);
+ }
+ else
+ {
+ if (OMX_DirOutput != portDefinitionType.eDir)
+ {
+ error = OMX_ErrorBadParameter;
+ }
+ else
+ {
+ error = componentOutput->ComponentTunnelRequest(componentOutput,
+ aPortOutput,
+ componentInput,
+ aPortInput,
+ &tunnelSetup);
+
+ }
+ }
+
+
+ }
+
+ if(error == OMX_ErrorNone && componentInput)
+ {
+ // Check that the input port is actually an input port. Set again the
+ // structure values just in case they were overwritten in the previous
+ // GetParameter call...
+ portDefinitionType.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE);
+ portDefinitionType.nVersion.s.nVersionMajor = COmxILCore::iSpecVersionMajor;
+ portDefinitionType.nVersion.s.nVersionMinor = COmxILCore::iSpecVersionMinor;
+ portDefinitionType.nVersion.s.nRevision = COmxILCore::iSpecVersionRevision;
+ portDefinitionType.nVersion.s.nStep = COmxILCore::iSpecVersionStep;
+ portDefinitionType.nPortIndex = aPortInput;
+ if (OMX_ErrorNone != (error = componentInput->GetParameter(
+ componentInput,
+ OMX_IndexParamPortDefinition,
+ &portDefinitionType)))
+ {
+ error = TOmxILCoreUtils::ConvertErrorGetParameterToSetupTunnel(error);
+ }
+ else
+ {
+ if (OMX_DirInput != portDefinitionType.eDir)
+ {
+ error= OMX_ErrorBadParameter;
+ }
+ else
+ {
+ error = componentInput->ComponentTunnelRequest(componentInput,
+ aPortInput,
+ componentOutput,
+ aPortOutput,
+ &tunnelSetup);
+
+ }
+
+ if(OMX_ErrorNone != error)
+ {
+ if(componentOutput)
+ {
+ if( OMX_ErrorNone != componentOutput->ComponentTunnelRequest(
+ componentOutput,
+ aPortOutput,
+ NULL,
+ 0,
+ &tunnelSetup) )
+ {
+ error = OMX_ErrorUndefined;
+ }
+ }
+ }
+ }
+ }
+ }
+
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ TBuf8<ADDITIONAL_INFO_SIZE> TunnelInfomation;
+ TunnelInfomation.Format(Ost_OMXIL_Performance::K_TunnelSetupInfo, aHandleOutput, aPortOutput, aHandleInput, aPortInput);
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormat,
+ Ost_OMXIL_Performance::EMeasurementEnd, MAKESTRING(E_SetupTunnel), error ,&TunnelInfomation);
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ OstTraceExt5( TRACE_API, _SetupTunnel2, "OMX_SetupTunnel < ReturnVal=%{OMX_ERRORTYPE} aHandleOutput=%p aPortOutput=%u aHandleInput=%p aPortInput=%u",
+ (TUint)error, aHandleOutput, (TUint) aPortOutput, aHandleInput, (TUint)aPortInput );
+#endif
+ return error;
+ }
+
+EXPORT_C OMX_ERRORTYPE COmxILCore::GetContentPipe(
+ OMX_HANDLETYPE *aPipe,const OMX_STRING aURI)
+ {
+ DEBUG_PRINTF(_L8("COmxILCore::GetContentPipe"));
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ OstTrace0( TRACE_API, _GetContentPipe1, "OMX_GetContentPipe >" );
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormatMin,
+ Ost_OMXIL_Performance::EMeasurementStart, MAKESTRING(E_GetContentPipe));
+#endif
+
+ OMX_ERRORTYPE omxError = OMX_ErrorNone;
+ if( aURI == NULL )
+ {
+ omxError = OMX_ErrorBadParameter;
+ }
+ else
+ {
+ RImplInfoPtrArray ecomArray;
+ TRAPD(error,REComSession::ListImplementationsL(
+ TUid::Uid(KUidOmxILContentPipeIf), ecomArray));
+ if( error != KErrNone )
+ {
+ ecomArray.ResetAndDestroy();
+ omxError= OMX_ErrorUndefined;
+ }
+ else
+ {
+ const TInt KEcomArrayCount = ecomArray.Count();
+ if(!KEcomArrayCount)
+ {
+ ecomArray.Close();
+ omxError= OMX_ErrorBadParameter;
+ }
+ else
+ {
+ HBufC8* convert = NULL;
+ TPtr8 luri(reinterpret_cast<TUint8 *>(aURI), strlen(aURI), strlen(aURI));
+
+ TRAPD(error, (convert = HBufC8::NewL(strlen(aURI))));
+ if( error != KErrNone )
+ {
+ ecomArray.ResetAndDestroy();
+ omxError = OMX_ErrorUndefined;
+ }
+ else
+ {
+ TUriParser8 parser;// Uri parser object
+ TInt result;
+ // Extract the scheme component from the parsed URI
+ const TDesC8& scheme = parser.Extract(EUriScheme);
+
+ *convert = luri;
+ result = parser.Parse(*convert);// parse the Uri descriptor
+ if( result != KErrNone )
+ {
+ ecomArray.ResetAndDestroy();
+ omxError = OMX_ErrorBadParameter;
+ }
+ else
+ {
+ TInt index;
+ CImplementationInformation* info;
+ COmxILContentPipeIf* cpipe = NULL;
+ omxError = OMX_ErrorBadParameter;
+ for(index=0; index < KEcomArrayCount; ++index)
+ {
+ info = ecomArray[index];
+ if(info->DataType().Find(scheme) != KErrNotFound )
+ {
+ //found
+ TRAPD(error, cpipe = COmxILContentPipeIf::CreateImplementationL(
+ info->ImplementationUid()));
+ if(error != KErrNone)
+ {
+ omxError = OMX_ErrorUndefined;
+ break;
+ }
+ error = cpipe->GetHandle(aPipe);
+ if(error != KErrNone)
+ {
+ omxError = OMX_ErrorUndefined;
+ break;
+ }
+
+ error = iContentPipes.Append(cpipe);
+ if(error != KErrNone)
+ {
+ omxError = OMX_ErrorUndefined;
+ break;
+ }
+
+ omxError = OMX_ErrorNone;
+ break;
+ }
+ }
+
+ if (OMX_ErrorNone != omxError)
+ {
+ delete cpipe;
+ aPipe = NULL;
+ }
+ }
+ }
+ //
+ delete convert;
+ }
+ }
+ ecomArray.ResetAndDestroy();
+ }
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ TBuf8<ADDITIONAL_INFO_SIZE> HandleInfomation;
+ HandleInfomation.Format(Ost_OMXIL_Performance::K_HandleInfo, ( (aPipe)? *aPipe :0 ), aURI);
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormat,
+ Ost_OMXIL_Performance::EMeasurementEnd, MAKESTRING(E_GetContentPipe), omxError ,&HandleInfomation);
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ TPtrC8 URIPtr(const_cast<const TUint8*>(reinterpret_cast<TUint8*>(aURI)));
+ OstTraceExt3( TRACE_API, _GetContentPipe2, "OMX_GetContentPipe < ReturnVal=%{OMX_ERRORTYPE} aPipe=%p, aURI=%s",
+ (TUint)omxError, (aPipe)? *aPipe :0 , URIPtr );
+
+#endif
+ return omxError;
+ }
+
+EXPORT_C OMX_ERRORTYPE COmxILCore::GetComponentsOfRole (
+ const OMX_STRING aRole, OMX_U32 *aNumComps, OMX_U8 **aCompNames)
+ {
+ DEBUG_PRINTF(_L8("COmxILCore::GetComponentsOfRole"));
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ OstTrace0( TRACE_API, _GetComponentsOfRole1, "OMX_GetComponentsOfRole >" );
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormatMin,
+ Ost_OMXIL_Performance::EMeasurementStart, MAKESTRING(E_GetComponentsOfRole));
+#endif
+
+ OMX_ERRORTYPE error = OMX_ErrorNone;
+ if (aNumComps == NULL)
+ {
+ error = OMX_ErrorBadParameter;
+ }
+ else
+ {
+ if (aCompNames != NULL && *aNumComps == 0)
+ {
+ error = OMX_ErrorBadParameter;
+ }
+ else
+ {
+ OMX_LOADERTYPE* loader;
+ error = OMX_ErrorComponentNotFound;
+ OMX_U32 numAllComps = 0;
+ OMX_U32 maxNumComps = *aNumComps;
+ OMX_U32 tempNumComps = maxNumComps;
+ OMX_U8 **compNames = aCompNames;
+
+ const TInt KLoadersCount = iLoaders.Count();
+ for(TInt index=0; index < KLoadersCount; ++index)
+ {
+ loader = reinterpret_cast<OMX_LOADERTYPE*>(
+ iLoaders[index].iLoader->Handle());
+ __ASSERT_DEBUG(loader != NULL, User::Panic(KOmxILCorePanic, 1));
+ error = loader->GetComponentsOfRole(loader,
+ aRole,
+ &tempNumComps,
+ compNames);
+ if(OMX_ErrorNone == error)
+ {
+ numAllComps += tempNumComps;
+ if(aCompNames != NULL && KLoadersCount > 1)
+ {
+ // Update tempNumComps in case there is a next iteration...
+ tempNumComps = maxNumComps - tempNumComps;
+ if (numAllComps >= maxNumComps)
+ {
+ if (numAllComps > maxNumComps)
+ {
+ DEBUG_PRINTF2(_L8("COmxILCore::GetComponentsOfRole : Loader [%d] returned a bad number of component roles... correcting"), index);
+ numAllComps = maxNumComps;
+ }
+
+ // The array of component names is full...
+ break;
+ }
+
+ compNames = &(aCompNames[numAllComps]);
+ if (*compNames == NULL)
+ {
+ *aNumComps = 0;
+ error = OMX_ErrorBadParameter;
+ break;
+ }
+ } // if(aCompNames != NULL && KLoadersCount > 1)
+ } // if(OMX_ErrorNone == error)
+ } // for(TInt index=0; index < KLoadersCount; ++index)
+
+ // Update the number of components value to be returned to the client...
+ *aNumComps = numAllComps;
+ }
+ }
+ if (error == OMX_ErrorInsufficientResources)
+ {
+ error = OMX_ErrorUndefined;
+ }
+
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ TBuf8<ADDITIONAL_INFO_SIZE> Infomation;
+ Infomation.Format(Ost_OMXIL_Performance::K_RoleInfo, aRole, (aNumComps)?*aNumComps:0);
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormat,
+ Ost_OMXIL_Performance::EMeasurementEnd, MAKESTRING(E_GetComponentsOfRole), error ,&Infomation);
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ TPtrC8 RolePtr(const_cast<const TUint8*>(reinterpret_cast<TUint8*>(aRole)));
+ OstTraceExt3( TRACE_API, _GetComponentsOfRole2, "OMX_GetComponentsOfRole < ReturnVal=%{OMX_ERRORTYPE} aRoleInfo=%s aNumComps=%u",
+ (TUint)error, RolePtr, (TUint)((aNumComps)?*aNumComps:0));
+
+#endif
+
+ return error;
+ }
+
+EXPORT_C OMX_ERRORTYPE COmxILCore::GetRolesOfComponent (
+ const OMX_STRING aCompName, OMX_U32 *aNumRoles, OMX_U8 **aRoles)
+ {
+ DEBUG_PRINTF(_L8("COmxILCore::GetRolesOfComponent"));
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ OstTrace0( TRACE_API, _GetRolesOfComponent1, "OMX_GetRolesOfComponent >" );
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormatMin,
+ Ost_OMXIL_Performance::EMeasurementStart, MAKESTRING(E_GetRolesOfComponent));
+#endif
+
+ OMX_ERRORTYPE error = OMX_ErrorNone;
+
+ if (aNumRoles == NULL)
+ {
+ error = OMX_ErrorBadParameter;
+ }
+ else
+ {
+ if (aRoles != NULL && *aNumRoles == 0)
+ {
+ error = OMX_ErrorBadParameter;
+ }
+ else
+ {
+ if( !VerifyComponentName(aCompName))
+ {
+ error = OMX_ErrorInvalidComponentName;
+ }
+ else
+ {
+ TInt numRolesCopy = *aNumRoles;
+ OMX_LOADERTYPE* loader;
+ error = OMX_ErrorComponentNotFound;
+ const TInt KLoadersCount = iLoaders.Count();
+ for(TInt index=0; index < KLoadersCount; ++index)
+ {
+ loader = reinterpret_cast<OMX_LOADERTYPE*>(
+ iLoaders[index].iLoader->Handle());
+ __ASSERT_DEBUG(loader != NULL, User::Panic(KOmxILCorePanic, 1));
+ error = loader->GetRolesOfComponent(loader,
+ aCompName,
+ aNumRoles,
+ aRoles);
+ if(OMX_ErrorNone == error)
+ {
+ if ((aRoles != NULL) && (*aNumRoles > numRolesCopy))
+ {
+ // Just in case...
+ DEBUG_PRINTF2(_L8("COmxILCore::GetRolesOfComponent : Loader [%d] returned a bad number of roles... correcting"), index);
+ *aNumRoles = numRolesCopy;
+ }
+ break;
+ }
+
+ if((index+1 < KLoadersCount) && (aRoles != NULL))
+ {
+ // If we have other loaders after this, reset aNumRoles to the
+ // value suplied by the client.
+ *aNumRoles = numRolesCopy;
+ }
+ }
+ }
+ }
+ }
+
+ // Make sure that even if loader does not conform to the set of errors required by the standard, we will
+ if (KErrNone != error && (OMX_ErrorUndefined != error && OMX_ErrorInvalidComponentName != error &&
+ OMX_ErrorInvalidComponent != error && OMX_ErrorBadParameter != error) )
+ {
+ error = OMX_ErrorUndefined;
+ }
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ TBuf8<ADDITIONAL_INFO_SIZE> Infomation;
+ Infomation.Format(Ost_OMXIL_Performance::K_RoleInfo, aCompName, (aNumRoles)?*aNumRoles:0);
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormat,
+ Ost_OMXIL_Performance::EMeasurementEnd, MAKESTRING(E_GetRolesOfComponent), error ,&Infomation);
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ TPtrC8 CompNamePtr(const_cast<const TUint8*>(reinterpret_cast<TUint8*>(aCompName)));
+ OstTraceExt3( TRACE_API, _GetRolesOfComponent2, "OMX_GetRolesOfComponent < ReturnVal=%{OMX_ERRORTYPE} aCompName=%s aNumRoles=%u",
+ (TUint)error, CompNamePtr, (TUint)((aNumRoles)?*aNumRoles:0));
+#endif
+
+ return error;
+ }
+
+/**
+ Converts an error returned by GetParameter to a permitted error to be
+ returned by OMX_SetupTunnel.
+
+ @param aGetParameterError An error code returned by the GetParameter API
+
+ @return An OMX_ERRORTYPE from the list of permitted errors in
+ OMX_SetupTunnel
+*/
+OMX_ERRORTYPE TOmxILCoreUtils::ConvertErrorGetParameterToSetupTunnel(
+ OMX_ERRORTYPE aGetParameterError)
+ {
+ switch(aGetParameterError)
+ {
+ // These are the common errors allowed in GetParameter and
+ // OMX_SetupTunnel
+ case OMX_ErrorInvalidComponent:
+ case OMX_ErrorBadParameter:
+ case OMX_ErrorInvalidState:
+ case OMX_ErrorVersionMismatch:
+ case OMX_ErrorTimeout:
+ case OMX_ErrorBadPortIndex:
+ return aGetParameterError;
+
+ // These are the errors supported by GetParameter and not supported by
+ // OMX_SetupTunnel
+ case OMX_ErrorUndefined:
+ case OMX_ErrorNoMore:
+ case OMX_ErrorNotReady:
+ case OMX_ErrorUnsupportedIndex:
+ case OMX_ErrorSeperateTablesUsed:
+ default:
+ // Return something that is actually allowed...
+ return OMX_ErrorBadParameter;
+ };
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcore/src/core/omxilcore.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,89 @@
+//
+// Copyright (c) 2005-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 OMXILCORE_H
+#define OMXILCORE_H
+
+#include <e32base.h>
+#include <openmax/il/khronos/v1_x/OMX_Core.h>
+
+// Forward declarations
+class COmxComponentLoaderIf;
+class COmxILContentPipeIf;
+
+NONSHARABLE_CLASS(COmxILCore): public CBase
+ {
+public:
+
+ static const TUint8 iSpecVersionMajor = OMX_VERSION_MAJOR;
+ static const TUint8 iSpecVersionMinor = OMX_VERSION_MINOR;
+ static const TUint8 iSpecVersionRevision = OMX_VERSION_REVISION;
+ static const TUint8 iSpecVersionStep = OMX_VERSION_STEP;
+
+public:
+
+ COmxILCore();
+ ~COmxILCore();
+
+ OMX_ERRORTYPE ListLoaders();
+ void DeinitCore();
+ IMPORT_C OMX_ERRORTYPE LoadComponent(const OMX_STRING aComponentName, OMX_HANDLETYPE* aHandle, OMX_PTR aAppData,OMX_CALLBACKTYPE* aCallBacks);
+ IMPORT_C OMX_ERRORTYPE ComponentNameEnum(OMX_STRING aComponentName, OMX_U32 aNameLength, const OMX_U32 aIndex);
+ IMPORT_C OMX_ERRORTYPE FreeHandle(OMX_HANDLETYPE aComponent) const;
+ IMPORT_C static OMX_ERRORTYPE SetupTunnel(OMX_HANDLETYPE aHandleOutput, OMX_U32 aPortOutput,
+ OMX_HANDLETYPE aHandleInput, OMX_U32 aPortInput);
+ IMPORT_C OMX_ERRORTYPE GetContentPipe(OMX_HANDLETYPE* aPipe,const OMX_STRING aURI);
+ IMPORT_C OMX_ERRORTYPE GetComponentsOfRole ( const OMX_STRING aRole, OMX_U32* aNumComps, OMX_U8** aCompNames );
+ IMPORT_C OMX_ERRORTYPE GetRolesOfComponent ( const OMX_STRING aCompName, OMX_U32* aNumRoles, OMX_U8** aRoles);
+
+private:
+
+ class TOmxLoaderInfo
+ {
+ public:
+ TOmxLoaderInfo();
+ public:
+ TUid iUid;
+ COmxComponentLoaderIf* iLoader;
+ };
+
+private:
+
+ OMX_ERRORTYPE LoadAndInitLoader(const TUid& aUid, COmxComponentLoaderIf*& aLoader);
+
+private:
+ RArray<TOmxLoaderInfo> iLoaders;
+ RPointerArray<COmxILContentPipeIf> iContentPipes;
+ };
+
+inline COmxILCore::TOmxLoaderInfo::TOmxLoaderInfo():
+ iUid(TUid::Uid(0)),iLoader(NULL)
+ {
+ }
+
+/**
+ Utility functions
+ */
+class TOmxILCoreUtils
+ {
+public:
+
+ static OMX_ERRORTYPE ConvertErrorGetParameterToSetupTunnel(
+ OMX_ERRORTYPE aGetParameterError);
+
+ };
+
+#endif /* OMXILCORE_H */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcore/src/core/omxilsymbiancontentpipeif.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,85 @@
+// 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 <e32base.h>
+#include <openmax/il/core/omxilsymbiancontentpipeif.h>
+
+/**
+ Content pipe entry point
+ This function initialises the CP_PIPETYPE structure and return it in its first argument
+
+ @return KErrNone if successful, otherwise another system-wide error codes
+ @param aContentPipe Returns a pointer to the content pipe handle
+
+ @publishedPartner
+ @prototype
+*/
+TInt ContentPipeInit(OMX_HANDLETYPE* aContentPipe);
+
+/**
+ Content pipe exit point
+ This function deinitialises the CP_PIPETYPE structure passed as first argument
+
+ @return KErrNone if successful, otherwise another system-wide error codes
+ @param aContentPipe A pointer to the content pipe handle that will be deinitialised
+
+ @publishedPartner
+ @prototype
+*/
+TInt ContentPipeDeInit(OMX_HANDLETYPE aContentPipe);
+
+/**
+ Constructor
+*/
+COmxILSymbianContentPipeIf::COmxILSymbianContentPipeIf()
+ {
+ }
+
+/**
+ Constructs a new instance of COmxILSymbianContentPipeIf.
+ @return COmxILSymbianContentPipeIf* A pointer to the newly constructed COmxILSymbianContentPipeIf.
+
+ @internalTechnology
+*/
+COmxILSymbianContentPipeIf* COmxILSymbianContentPipeIf::NewL()
+ {
+ return new(ELeave)COmxILSymbianContentPipeIf;
+ }
+
+/**
+ Destructor
+
+ @internalTechnology
+*/
+COmxILSymbianContentPipeIf::~COmxILSymbianContentPipeIf()
+ {
+ ContentPipeDeInit(iHandle);
+ }
+
+TInt COmxILSymbianContentPipeIf::GetHandle(OMX_HANDLETYPE* aContentPipe)
+ {
+ if(iHandle)
+ { // Content Pipe already created
+ *aContentPipe = iHandle;
+ return KErrNone;
+ }
+
+ TInt err = ContentPipeInit(aContentPipe);
+ if(err == KErrNone)
+ {
+ iHandle = reinterpret_cast<CP_PIPETYPE*>(*aContentPipe);
+ }
+ return err;
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcore/src/core/omxilsymbianloaderif.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,98 @@
+// 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/core/omxilsymbianloaderif.h>
+
+/**
+Entry point routine that Component Loaders have to implement to populate the actual
+structure represented by the handle passed as argument.
+@param aLoader
+ The handle to the OMX_LOADERTYPE structure to be populated.
+@return An OpenMAX defined error. OMX_ErrorNone if successful.
+
+@publishedPartner
+@prototype
+*/
+OMX_ERRORTYPE OMX_LoaderSetup(OMX_HANDLETYPE aLoader);
+
+/**
+Constructor of this interface.
+*/
+COmxSymbianLoaderIf::COmxSymbianLoaderIf()
+ {
+ }
+
+/**
+Static method to create this interface.
+The actual OMX_LOADERTYPE structure should be allocated and populated as part
+of the construction of this interface.
+
+@return A pointer to the newly constructed COmxSymbianLoaderIf.
+
+@internalTechnology
+*/
+COmxSymbianLoaderIf* COmxSymbianLoaderIf::NewL()
+ {
+ COmxSymbianLoaderIf* self = new(ELeave)COmxSymbianLoaderIf;
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ CleanupStack::Pop(self);
+ return self;
+ }
+
+/**
+Constructs and populates the OMX_LOADERTYPE structure encapsulated within this interface.
+*/
+void COmxSymbianLoaderIf::ConstructL()
+ {
+ iHandle = new(ELeave)OMX_LOADERTYPE;
+
+ OMX_ERRORTYPE error = OMX_ErrorInsufficientResources;
+ error = ::OMX_LoaderSetup(iHandle);
+
+ if ( error != OMX_ErrorNone )
+ {
+ if( error == OMX_ErrorInsufficientResources )
+ {
+ User::Leave(KErrNoMemory);
+ }
+ else
+ {
+ User::Leave(KErrGeneral);
+ }
+ }
+ }
+
+/**
+Destructor of this interface.
+Deletes this loader's OMX_LOADERTYPE structure.
+
+@internalTechnology
+*/
+COmxSymbianLoaderIf::~COmxSymbianLoaderIf()
+ {
+ delete iHandle;
+ }
+
+/**
+Gets the valid handle of the already populated OMX_LOADERTYPE struct.
+
+@return The loader's handle
+*/
+OMX_HANDLETYPE COmxSymbianLoaderIf::Handle()
+ {
+ return iHandle;
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcore/src/core/omxiluids.hrh Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,34 @@
+// 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 OMXILUIDS_HRH
+#define OMXILUIDS_HRH
+
+#define KSharedLibraryUidDefine 0x1000008D
+#define KUidECOM 0x10009D8D
+
+// OpenMax IL Core client library
+#define KUidOmxILCoreClientDll 0x1028349C
+
+// OpenMax IL Core server library
+#define KUidOmxILCoreServerDll 0x10285D1E
+
+// OpenMax IL Loader Static Library
+#define KUidOmxILLoaderLib 0x1028349E
+
+// Symbian OpenMax IL Content Pipe Interface
+#define KUidOmxILSymbianContentPipeIfLib 0x102834B8
+
+#endif /*OMXILUIDS_HRH*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcore/src/omxilcoreclient/log.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,145 @@
+// 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>
+
+namespace DSD
+{
+
+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);
+ }
+
+#ifdef _DEBUG
+
+#ifdef _OMXIL_CORECLIENT_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, "[corecl] ");
+ _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, "[corecl] ");
+ _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/omxil_generic/omxilcore/src/omxilcoreclient/omxilcoreclientsession.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,1272 @@
+/*
+* 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/khronos/v1_x/OMX_Core.h>
+
+#include "log.h"
+#include "omxilcoreclientsession.h"
+#include "omxilcoreclientserver.h"
+#include "omxilcore.h"
+
+#ifdef __WINSCW__
+#include <pls.h>
+#include "../core/omxiluids.hrh"
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+#include "OSTOMXILFrameworkTrace.h"
+#endif
+
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+
+#include "../../traces/OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "omxilcoreclientsessionTraces.h"
+#endif
+#endif
+
+
+_LIT(KOmxILCoreClientPanic, "OmxILCoreClient Panic");
+const TInt KOpenSeverSessionMaxRetries = 3;
+
+namespace
+ {
+/*
+ This class is used to provide a global cache of a reference to the COmxILCore
+ object. A mutex is provided to serialize the access to the IL Core
+ reference. A global object of this class is intended to be used only through
+ the IL Core Client library which in turn is used by any thread in the process
+ that needs to access the OpenMAX IL Core services.
+
+*/
+ class XGlobalILCoreCache
+ {
+ public:
+ inline XGlobalILCoreCache();
+ inline ~XGlobalILCoreCache();
+
+ inline static XGlobalILCoreCache* IlCoreCache();
+ inline void SetILCore(COmxILCore* aILCore);
+ inline COmxILCore* ILCore();
+
+ inline RServer2 &ServerHandle();
+ inline TInt SetServerHandle(TUint32 aServerHandle);
+
+ inline void Lock();
+ inline void Unlock();
+
+ private:
+
+ RMutex iMutex;
+ TInt iError;
+ COmxILCore* iILCore;
+ RServer2 iServerHandle;
+ };
+
+#ifndef __WINSCW__
+XGlobalILCoreCache gGlobalILCoreCache;
+#endif
+
+ } // unnamed namespace
+
+XGlobalILCoreCache* XGlobalILCoreCache::IlCoreCache()
+ {
+#ifdef __WINSCW__
+ const TUid KUidOmxILCoreClientDllUid = { KUidOmxILCoreClientDll };
+ XGlobalILCoreCache* pGlobalIlCoreCache = 0;
+ if (NULL == (pGlobalIlCoreCache =
+ Pls<XGlobalILCoreCache>(KUidOmxILCoreClientDllUid, NULL)))
+ {
+ return NULL;
+ }
+
+ XGlobalILCoreCache& gGlobalILCoreCache = *pGlobalIlCoreCache;
+#endif
+ return (gGlobalILCoreCache.iError == KErrNone) ? &gGlobalILCoreCache : NULL;
+ }
+
+inline XGlobalILCoreCache::XGlobalILCoreCache()
+ : iMutex(), iError(KErrNone), iILCore(NULL), iServerHandle()
+ {
+ DEBUG_PRINTF(_L8("XGlobalILCoreCache::XGlobalILCoreCache"));
+ iError = iMutex.CreateLocal(EOwnerProcess);
+ }
+
+inline XGlobalILCoreCache::~XGlobalILCoreCache()
+ {
+ DEBUG_PRINTF(_L8("XGlobalILCoreCache::~XGlobalILCoreCache"));
+ iMutex.Close();
+ iServerHandle.Close();
+ }
+
+inline COmxILCore* XGlobalILCoreCache::ILCore()
+ {
+ __ASSERT_ALWAYS(iError == KErrNone,
+ User::Panic(KOmxILCoreClientPanic, KErrNotReady));
+
+ return iILCore;
+ }
+
+inline void XGlobalILCoreCache::SetILCore(COmxILCore* aILCore)
+ {
+ __ASSERT_ALWAYS(iError == KErrNone,
+ User::Panic(KOmxILCoreClientPanic, KErrNotReady));
+ __ASSERT_ALWAYS(iMutex.IsHeld(),
+ User::Panic(KOmxILCoreClientPanic, KErrNotReady));
+
+ iILCore = aILCore;
+ }
+
+inline RServer2 &XGlobalILCoreCache::ServerHandle()
+ {
+ return iServerHandle;
+ }
+
+inline TInt XGlobalILCoreCache::SetServerHandle(TUint32 aServerHandle)
+ {
+ iServerHandle.Close();
+ iServerHandle.SetHandle(aServerHandle);
+ return KErrNone;
+ }
+
+inline void XGlobalILCoreCache::Lock()
+ {
+ __ASSERT_ALWAYS(iError == KErrNone,
+ User::Panic(KOmxILCoreClientPanic, KErrNotReady));
+ iMutex.Wait();
+ }
+
+inline void XGlobalILCoreCache::Unlock()
+ {
+ __ASSERT_ALWAYS(iError == KErrNone,
+ User::Panic(KOmxILCoreClientPanic, KErrNotReady));
+ __ASSERT_ALWAYS(iMutex.IsHeld(),
+ User::Panic(KOmxILCoreClientPanic, KErrNotReady));
+ iMutex.Signal();
+ }
+
+
+ROmxILCoreClientSession::ROmxILCoreClientSession()
+ {
+ DEBUG_PRINTF(_L8("ROmxILCoreClientSession::ROmxILCoreClientSession"));
+ }
+
+/**
+ *
+ */
+ROmxILCoreClientSession::~ROmxILCoreClientSession()
+ {
+ DEBUG_PRINTF(_L8("ROmxILCoreClientSession::~ROmxILCoreClientSession"));
+
+ }
+
+/**
+ Starts the separate IL Core server thread if not already started
+
+ @return KErrAlreadyExists if the IL Core server has already been
+ started. System-wide error if the creation of the session with the IL Core
+ server did not succeed.
+*/
+TInt ROmxILCoreClientSession::Connect()
+ {
+ DEBUG_PRINTF(_L8("ROmxILCoreClientSession::Connect"));
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormatMin,
+ Ost_OMXIL_Performance::EMeasurementStart, MAKESTRING(E_Init));
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ OstTrace0( TRACE_API, _Connect1, "OMX_Init >" );
+#endif
+
+ TInt err = KErrNotFound;
+ XGlobalILCoreCache *glbCache = XGlobalILCoreCache::IlCoreCache();
+ if(!glbCache)
+ {
+ err = KErrGeneral;
+ }
+ else
+ {
+ if(glbCache->ServerHandle().Handle() != KNullHandle)
+ {
+ err = CreateSession(glbCache->ServerHandle(), TVersion(1,0,0));
+ }
+
+ if(err == KErrNotFound)
+ {
+ // Server not running
+ TUint32 serverHandle = KNullHandle;
+ if (KErrNone == (err = StartOmxILCoreServer(&serverHandle)))
+ {
+ if (KErrNone == (err = glbCache->SetServerHandle(serverHandle) ))
+ {
+ if(glbCache->ServerHandle().Handle() == KNullHandle)
+ {
+ err = KErrNotFound;
+ }
+ else
+ {
+ err = CreateSession(glbCache->ServerHandle(), TVersion(1,0,0));
+ }
+ }
+ }
+ }
+ else
+ {
+ // The server exists already... close the session and return...
+ RHandleBase::Close();
+ err = KErrAlreadyExists;
+ }
+ }
+
+#if defined(SYMBIAN_PERF_TRACE_OMX_IL) || defined(SYMBIAN_PERF_TRACE_OMX_IL_OSTV1)
+ OMX_ERRORTYPE omxError = OMX_ErrorNone;
+ if(KErrNone != err)
+ {
+ omxError = OMX_ErrorUndefined;
+ }
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ TBufC8<1> InitStr;
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormat,
+ Ost_OMXIL_Performance::EMeasurementEnd, MAKESTRING(E_Init),omxError,&InitStr);
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ OstTrace1( TRACE_API, _Connect2, "OMX_Init < ReturnVal=%u", omxError );
+#endif
+
+ return err;
+
+ }
+
+/**
+ Opens a session to the IL Core server thread that should already be started
+
+ @return KErrNone if successful, otherwise one of the other system-wide error
+ codes
+*/
+TInt ROmxILCoreClientSession::Open()
+ {
+ DEBUG_PRINTF(_L8("ROmxILCoreClientSession::Open"));
+
+ XGlobalILCoreCache *glbCache = XGlobalILCoreCache::IlCoreCache();
+ if(glbCache->ServerHandle().Handle() == KNullHandle)
+ {
+ return KErrNotFound;
+ }
+ return CreateSession(glbCache->ServerHandle(), TVersion(1,0,0));
+
+ }
+
+/**
+ Closes the session to the IL Core server thread.
+*/
+void ROmxILCoreClientSession::Close()
+ {
+ DEBUG_PRINTF(_L8("ROmxILCoreClientSession::Close"));
+
+ RHandleBase::Close();
+
+ }
+
+/**
+ Requests initialization of the OpenMAX IL Core loaders.
+
+ @return OMX_ERRORTYPE
+ */
+OMX_ERRORTYPE ROmxILCoreClientSession::ListLoaders()
+ {
+ DEBUG_PRINTF(_L8("ROmxILCoreClientSession::ListLoaders"));
+
+ // Param 0
+ OMX_ERRORTYPE err = OMX_ErrorNone;
+ TPckgBuf<OMX_ERRORTYPE> pckg0;
+
+ TIpcArgs arg(&pckg0);
+ SendReceive(EOmxILCoreListLoaders, arg);
+
+ // Extract the output values returned from the server.
+ err = pckg0();
+ return err;
+
+ }
+
+/**
+ Requests de-initialization of the OpenMAX IL core. It closes the session to
+ the IL Core server.
+
+ @return OMX_ERRORTYPE
+ */
+OMX_ERRORTYPE ROmxILCoreClientSession::DeinitAndClose()
+ {
+ DEBUG_PRINTF(_L8("ROmxILCoreClientSession::DeinitAndClose"));
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormatMin,
+ Ost_OMXIL_Performance::EMeasurementStart, MAKESTRING(E_DeInit));
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ OstTrace0( TRACE_API, _DeinitAndClose1, "OMX_Deinit >" );
+#endif
+
+ // Param 0
+ OMX_ERRORTYPE err = OMX_ErrorNone;
+ TPckgBuf<OMX_ERRORTYPE> pckg0;
+
+ // Param 1
+ TUint64 serverThreadId = 0;
+ TPckgBuf<TUint64> pckg1;
+
+ TIpcArgs arg(&pckg0, &pckg1);
+ SendReceive(EOmxILCoreDeinit, arg);
+
+ // Extract the output values returned from the server.
+ err = pckg0();
+ serverThreadId = pckg1();
+
+ RHandleBase::Close();
+
+ // Release server handle so it will exit cleanly.
+ XGlobalILCoreCache* pGlobalILCoreCache = XGlobalILCoreCache::IlCoreCache();
+
+ __ASSERT_ALWAYS(pGlobalILCoreCache != NULL,
+ User::Panic(KOmxILCoreClientPanic, KErrNotReady));
+
+ pGlobalILCoreCache->SetServerHandle(KNullHandle);
+
+ RThread serverThread;
+ TInt ret = serverThread.Open(TThreadId(serverThreadId));
+
+ if ((KErrNone == ret) && (serverThread.Handle() != KNullHandle))
+ {
+ DEBUG_PRINTF2(_L8("ROmxILCoreClientSession::DeinitAndClose : serverThread.Handle =[%d]"), serverThread.Handle());
+ TBool logoffFailed = EFalse;
+ TRequestStatus logoffStatus;
+ serverThread.Logon(logoffStatus);
+
+ if (logoffStatus == KErrNoMemory)
+ {
+ logoffFailed = ETrue;
+ }
+
+ if (!logoffFailed)
+ {
+ if (logoffStatus == KRequestPending)
+ {
+ User::WaitForRequest(logoffStatus);
+ }
+ else
+ {
+ serverThread.LogonCancel(logoffStatus);
+ User::WaitForRequest(logoffStatus);
+ }
+ }
+ else
+ {
+ serverThread.Kill(KErrDied);
+ }
+ }
+
+ serverThread.Close();
+
+#if defined(SYMBIAN_PERF_TRACE_OMX_IL) || defined(SYMBIAN_PERF_TRACE_OMX_IL_OSTV1)
+ OMX_ERRORTYPE omxError = OMX_ErrorNone;
+ if(KErrNone != err)
+ {
+ omxError = OMX_ErrorUndefined;
+ }
+#endif
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL
+ TBuf8<1> DeInitStr;
+ OstPrintf(TTraceContext(KTracePerformanceTraceUID, EPerFormanceTraceClassification), Ost_OMXIL_Performance::K_OMX_PerformanceTraceFormat,
+ Ost_OMXIL_Performance::EMeasurementEnd, MAKESTRING(E_DeInit), omxError,&DeInitStr);
+#endif
+
+#ifdef SYMBIAN_PERF_TRACE_OMX_IL_OSTV1
+ OstTrace1( TRACE_API, _DeinitAndClose2, "OMX_Deinit < ReturnVal=%u", omxError );
+#endif
+
+ return err;
+
+ }
+
+
+/**
+ Obtains the IL Core pointer stored in the IL Core thread.
+
+ @return COmxILCore&
+
+ */
+COmxILCore& ROmxILCoreClientSession::ILCore()
+ {
+ DEBUG_PRINTF(_L8("ROmxILCoreClientSession::ILCore"));
+
+ // Param 0
+ TPckgBuf<OMX_ERRORTYPE> pckg0;
+
+ TPckgBuf<COmxILCore*> pckg1;
+
+ TIpcArgs arg(&pckg0, &pckg1);
+ SendReceive(EOmxILCoreGetILCore, arg);
+
+ // Extract the output values returned from the server.
+ // OMX error is not relevant...
+ __ASSERT_ALWAYS(pckg1() != NULL,
+ User::Panic(KOmxILCoreClientPanic, KErrNotReady));
+
+ return *pckg1();
+
+ }
+
+
+/**
+ Requests OMX_ComponentNameEnum to the OpenMAX IL core.
+
+ @return OMX_ERRORTYPE
+
+ */
+OMX_ERRORTYPE ROmxILCoreClientSession::ComponentNameEnum(
+ OMX_STRING cComponentName,
+ OMX_U32 nNameLength,
+ OMX_U32 nIndex)
+ {
+ DEBUG_PRINTF(_L8("ROmxILCoreClientSession::ComponentNameEnum"));
+
+ // Param 0
+ OMX_ERRORTYPE err = OMX_ErrorNone;
+ TPckgBuf<OMX_ERRORTYPE> pckg0;
+
+ // Param 1
+ TComponentNameEnum arg1;
+ arg1.cComponentName = cComponentName;
+ arg1.nNameLength = nNameLength;
+ arg1.nIndex = nIndex;
+
+ TIpcArgs arg(&pckg0, &arg1);
+ SendReceive(EOmxILCoreComponentNameEnum, arg);
+
+ // Extract the output values returned from the server.
+ err = pckg0();
+ return err;
+
+ }
+
+/**
+ Requests OMX_GetHandle to the OpenMAX IL core.
+
+ @return OMX_ERRORTYPE
+
+ */
+OMX_ERRORTYPE ROmxILCoreClientSession::GetHandle(
+ OMX_HANDLETYPE* pHandle,
+ OMX_STRING cComponentName,
+ OMX_PTR pAppData,
+ OMX_CALLBACKTYPE* pCallBacks)
+ {
+ DEBUG_PRINTF(_L8("ROmxILCoreClientSession::GetHandle"));
+
+ // Param 0
+ OMX_ERRORTYPE err = OMX_ErrorNone;
+ TPckgBuf<OMX_ERRORTYPE> pckg0;
+
+
+ // Param 1
+ TGetHandle arg1;
+ arg1.pHandle = pHandle;
+ arg1.cComponentName = cComponentName;
+ arg1.pAppData = pAppData;
+ arg1.pCallBacks = pCallBacks;
+
+ TIpcArgs arg(&pckg0, &arg1);
+ SendReceive(EOmxILCoreGetHandle, arg);
+
+ // Extract the output values returned from the server.
+ err = pckg0();
+ return err;
+
+ }
+
+/**
+ Requests OMX_FreeHandle to the OpenMAX IL core.
+
+ @return OMX_ERRORTYPE
+
+ */
+OMX_ERRORTYPE ROmxILCoreClientSession::FreeHandle(
+ OMX_HANDLETYPE hComponent)
+ {
+ DEBUG_PRINTF(_L8("ROmxILCoreClientSession::FreeHandle"));
+
+ // Param 0
+ OMX_ERRORTYPE err = OMX_ErrorNone;
+ TPckgBuf<OMX_ERRORTYPE> pckg0;
+
+ TIpcArgs arg(&pckg0, hComponent);
+ SendReceive(EOmxILCoreFreeHandle, arg);
+
+ // Extract the output values returned from the server.
+ err = pckg0();
+ return err;
+
+ }
+
+/**
+ Requests OMX_SetupTunnel to the OpenMAX IL core.
+
+ @return OMX_ERRORTYPE
+
+ */
+OMX_ERRORTYPE ROmxILCoreClientSession::SetupTunnel(
+ OMX_HANDLETYPE hOutput,
+ OMX_U32 nPortOutput,
+ OMX_HANDLETYPE hInput,
+ OMX_U32 nPortInput)
+ {
+ DEBUG_PRINTF(_L8("ROmxILCoreClientSession::SetupTunnel"));
+
+ // Param 0
+ OMX_ERRORTYPE err = OMX_ErrorNone;
+ TPckgBuf<OMX_ERRORTYPE> pckg0;
+
+ TSetupTunnel arg1;
+ arg1.hOutput = hOutput;
+ arg1.nPortOutput = nPortOutput;
+ arg1.hInput = hInput;
+ arg1.nPortInput = nPortInput;
+
+ TIpcArgs arg(&pckg0, &arg1);
+ SendReceive(EOmxILCoreSetupTunnel, arg);
+
+ // Extract the output values returned from the server.
+ err = pckg0();
+ return err;
+
+ }
+
+/**
+ Requests OMX_GetContentPipe to the OpenMAX IL core.
+
+ @return OMX_ERRORTYPE
+
+ */
+OMX_ERRORTYPE ROmxILCoreClientSession::GetContentPipe(
+ OMX_HANDLETYPE* hPipe,
+ OMX_STRING szURI)
+ {
+ DEBUG_PRINTF(_L8("ROmxILCoreClientSession::GetContentPipe"));
+
+ // Param 0
+ OMX_ERRORTYPE err = OMX_ErrorNone;
+ TPckgBuf<OMX_ERRORTYPE> pckg0;
+
+ // Param 1
+ TGetContentPipe arg1;
+ arg1.hPipe = hPipe;
+ arg1.szURI = szURI;
+
+ TIpcArgs arg(&pckg0, &arg1);
+ SendReceive(EOmxILCoreGetContentPipe, arg);
+
+ // Extract the output values returned from the server.
+ err = pckg0();
+ return err;
+
+ }
+
+/**
+ Requests OMX_GetComponentsOfRole to the OpenMAX IL core.
+
+ @return OMX_ERRORTYPE
+
+ */
+OMX_ERRORTYPE ROmxILCoreClientSession::GetComponentsOfRole(
+ OMX_STRING role,
+ OMX_U32* pNumComps,
+ OMX_U8** compNames)
+ {
+ DEBUG_PRINTF(_L8("ROmxILCoreClientSession::GetComponentsOfRole"));
+
+ // Param 0
+ OMX_ERRORTYPE err = OMX_ErrorNone;
+ TPckgBuf<OMX_ERRORTYPE> pckg0;
+
+ TGetComponentsOfRole arg1;
+ arg1.role = role;
+ arg1.pNumComps = pNumComps;
+ arg1.compNames = compNames;
+
+ TIpcArgs arg(&pckg0, &arg1);
+ SendReceive(EOmxILCoreGetComponentsOfRole, arg);
+
+ // Extract the output values returned from the server.
+ err = pckg0();
+ return err;
+
+ }
+
+/**
+ Requests OMX_GetRolesOfComponent to the OpenMAX IL core.
+
+ @return OMX_ERRORTYPE
+
+ */
+OMX_ERRORTYPE ROmxILCoreClientSession::GetRolesOfComponent(
+ OMX_STRING compName,
+ OMX_U32 *pNumRoles,
+ OMX_U8 **roles)
+ {
+ DEBUG_PRINTF(_L8("ROmxILCoreClientSession::GetRolesOfComponent"));
+
+ // Param 0
+ OMX_ERRORTYPE err = OMX_ErrorNone;
+ TPckgBuf<OMX_ERRORTYPE> pckg0;
+
+ TGetRolesOfComponent arg1;
+ arg1.compName = compName;
+ arg1.pNumRoles = pNumRoles;
+ arg1.roles = roles;
+
+ TIpcArgs arg(&pckg0, &arg1);
+ SendReceive(EOmxILCoreGetRolesOfComponent, arg);
+
+ // Extract the output values returned from the server.
+ err = pckg0();
+ return err;
+
+ }
+
+
+//
+// OMX IL Operations...
+//
+
+/**
+ The OMX_Init method initializes the OpenMAX IL core. OMX_Init shall be the
+ first call made into OpenMAX IL and should be executed only one time without
+ an intervening OMX_Deinit call. If OMX_Init is called twice, OMX_ErrorNone
+ is returned but the init request is ignored.
+
+ @return OMX_ERRORTYPE
+ */
+OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_Init()
+ {
+ XGlobalILCoreCache* pGlobalILCoreCache = XGlobalILCoreCache::IlCoreCache();
+ __ASSERT_ALWAYS(pGlobalILCoreCache != NULL,
+ User::Panic(KOmxILCoreClientPanic, KErrNotReady));
+ pGlobalILCoreCache->Lock();
+
+ // OMX_Init may be called several times, only the first time must have an
+ // effect....
+ OMX_ERRORTYPE omxError = OMX_ErrorNone;
+ if (pGlobalILCoreCache->ILCore() != NULL)
+ {
+ omxError = OMX_ErrorNone;
+ }
+ else
+ {
+ // Connect will create the server side thread the first time it is
+ // called... The IL Core object will be instantiated at the sever
+ // side...
+ ROmxILCoreClientSession coresession;
+ TInt err = coresession.Connect();
+ // There should not exist a client thread already created at this
+ // point...
+ __ASSERT_ALWAYS(err != KErrAlreadyExists,
+ User::Panic(KOmxILCoreClientPanic,
+ KErrNotReady));
+ if (KErrNone == err)
+ {
+ // Obtain the ILCore from the server side...
+ COmxILCore& ilCore = coresession.ILCore();
+ //... and cache it globally so the client library doesn't need to
+ // access the server every time the IL Core is needed...
+ pGlobalILCoreCache->SetILCore(&ilCore);
+
+ // This will call COmxILCore::ListLoaders()...We want to initialize
+ // loader ecom plugins in the IL Core thread, so we can make sure
+ // they get destroyed in the same thread, the IL Core thread.
+ omxError = coresession.ListLoaders();
+ }
+ else
+ {
+ // This is to make sure we return something that conforms with
+ // table 3-9 in the spec.
+ switch(err)
+ {
+ case KErrTimedOut:
+ {
+ omxError = OMX_ErrorTimeout;
+ }
+ break;
+ case KErrNoMemory:
+ default:
+ {
+ omxError = OMX_ErrorInsufficientResources;
+ }
+ };
+ }
+ coresession.Close();
+
+ if (omxError != OMX_ErrorNone)
+ {
+ ROmxILCoreClientSession coresession;
+ TInt openRetryCounter = KOpenSeverSessionMaxRetries;
+ TInt err = KErrNone;
+ // Try to connect to the server several times...
+ do
+ {
+ err = coresession.Open();
+ }
+ while(KErrNone != err && --openRetryCounter > 0);
+
+ if (KErrNone == err)
+ {
+ // IL Core deinitialization in the server thread to make sure that
+ // loader plugins are destroyed in the same thread...
+ coresession.DeinitAndClose();
+ // At this point, the IL Core has been successfully
+ // deinitialized...remove the cached reference...
+ pGlobalILCoreCache->SetILCore(NULL);
+ }
+
+ coresession.Close();
+ }
+ }
+
+ pGlobalILCoreCache->Unlock();
+ return omxError;
+
+ }
+
+/**
+ The OMX_Deinit method de-initializes the OpenMAX core. OMX_Deinit should be
+ the last call made into the OpenMAX core after all OpenMAX-related resources have
+ been released
+
+ @return OMX_ERRORTYPE
+ */
+OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_Deinit()
+ {
+ XGlobalILCoreCache* pGlobalILCoreCache = XGlobalILCoreCache::IlCoreCache();
+ __ASSERT_ALWAYS(pGlobalILCoreCache != NULL,
+ User::Panic(KOmxILCoreClientPanic, KErrNotReady));
+ pGlobalILCoreCache->Lock();
+
+ // OMX_Deinit may be called several times.... only the first time will
+ // remove the IL Core and the remaining ones must simply have no effect...
+ OMX_ERRORTYPE omxError = OMX_ErrorNone;
+ if (pGlobalILCoreCache->ILCore() == NULL)
+ {
+ omxError = OMX_ErrorNone;
+ }
+ else
+ {
+ ROmxILCoreClientSession coresession;
+ TInt openRetryCounter = KOpenSeverSessionMaxRetries;
+ TInt err = KErrNone;
+ // Try to connect to the server several times...
+ do
+ {
+ err = coresession.Open();
+ __ASSERT_ALWAYS(KErrNotFound != err,
+ User::Panic(KOmxILCoreClientPanic,
+ KErrNotReady));
+ }
+ while(KErrNone != err && --openRetryCounter > 0);
+
+ if (KErrNone == err)
+ {
+ // IL Core deinitialization in the server thread to make sure that
+ // loader plugins are destroyed in the same thread...
+ omxError = coresession.DeinitAndClose();
+ // At this point, the IL Core has been successfully
+ // deinitialized...remove the cached reference...
+ if (omxError == OMX_ErrorNone)
+ {
+ pGlobalILCoreCache->SetILCore(NULL);
+ }
+ }
+ else
+ {
+ // This is to make sure we return something that conforms with
+ // table 3-9 in the spec.
+ switch(err)
+ {
+ case KErrTimedOut:
+ {
+ omxError = OMX_ErrorTimeout;
+ }
+ break;
+ default:
+ {
+ omxError = OMX_ErrorNone;
+ }
+ };
+ }
+
+ coresession.Close();
+ }
+
+ pGlobalILCoreCache->Unlock();
+ return omxError;
+
+ }
+
+/**
+ The OMX_ComponentNameEnum method will enumerate through all the names of
+ recognized components in the system to detect all the components in the system
+ run-time.
+
+ @return OMX_ERRORTYPE
+ */
+OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_ComponentNameEnum(
+ OMX_OUT OMX_STRING cComponentName,
+ OMX_IN OMX_U32 nNameLength,
+ OMX_IN OMX_U32 nIndex)
+ {
+ XGlobalILCoreCache* pGlobalILCoreCache = XGlobalILCoreCache::IlCoreCache();
+ __ASSERT_ALWAYS(pGlobalILCoreCache != NULL,
+ User::Panic(KOmxILCoreClientPanic, KErrNotReady));
+ pGlobalILCoreCache->Lock();
+
+ // OpenMAX IL mandates that OMX_Init must be the first OMX call made into
+ // the IL Core...
+ __ASSERT_ALWAYS(pGlobalILCoreCache->ILCore() != NULL,
+ User::Panic(KOmxILCoreClientPanic,
+ KErrNotReady));
+
+
+ ROmxILCoreClientSession coresession;
+ OMX_ERRORTYPE omxError = OMX_ErrorNone;
+ TInt err = coresession.Open();
+ __ASSERT_ALWAYS(KErrNotFound != err,
+ User::Panic(KOmxILCoreClientPanic,
+ KErrNotReady));
+
+ // As mandated by the spec, we list and initialize loaders if the index is
+ // 0.
+ if (0 == nIndex && KErrNone == err)
+ {
+ // Ignore if any error...
+ coresession.ListLoaders();
+ }
+
+ if (CActiveScheduler::Current())
+ {
+ COmxILCore& ilCore = *pGlobalILCoreCache->ILCore();
+ omxError = ilCore.ComponentNameEnum(
+ cComponentName,
+ nNameLength,
+ nIndex);
+ }
+ else
+ {
+ if (KErrNone == err)
+ {
+ omxError = coresession.ComponentNameEnum(
+ cComponentName,
+ nNameLength,
+ nIndex);
+ }
+ else
+ {
+ omxError = OMX_ErrorUndefined;
+ }
+
+ }
+
+ coresession.Close();
+ pGlobalILCoreCache->Unlock();
+ return omxError;
+
+ }
+
+/**
+ The OMX_GetHandle method will locate the component specified by the
+ component name given, load that component into memory, and validate it.
+
+ @return OMX_ERRORTYPE
+ */
+OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_GetHandle(
+ OMX_OUT OMX_HANDLETYPE* pHandle,
+ OMX_IN OMX_STRING cComponentName,
+ OMX_IN OMX_PTR pAppData,
+ OMX_IN OMX_CALLBACKTYPE* pCallBacks)
+ {
+ XGlobalILCoreCache* pGlobalILCoreCache = XGlobalILCoreCache::IlCoreCache();
+ __ASSERT_ALWAYS(pGlobalILCoreCache != NULL,
+ User::Panic(KOmxILCoreClientPanic, KErrNotReady));
+ pGlobalILCoreCache->Lock();
+
+ // OpenMAX IL mandates that OMX_Init must be the first OMX call made into
+ // the IL Core...
+ __ASSERT_ALWAYS(pGlobalILCoreCache->ILCore() != NULL,
+ User::Panic(KOmxILCoreClientPanic,
+ KErrNotReady));
+
+ OMX_ERRORTYPE omxError = OMX_ErrorNone;
+ if (CActiveScheduler::Current())
+ {
+ COmxILCore& ilCore = *pGlobalILCoreCache->ILCore();
+ omxError = ilCore.LoadComponent(
+ cComponentName,
+ pHandle,
+ pAppData,
+ pCallBacks);
+ }
+ else
+ {
+ ROmxILCoreClientSession coresession;
+ TInt err = coresession.Open();
+ // OMX_Init must be the first OMX call
+ __ASSERT_ALWAYS(KErrNotFound != err,
+ User::Panic(KOmxILCoreClientPanic, KErrNotReady));
+
+ if (KErrNone == err)
+ {
+ omxError = coresession.GetHandle(
+ pHandle,
+ cComponentName,
+ pAppData,
+ pCallBacks);
+ }
+ else
+ {
+ omxError = OMX_ErrorUndefined;
+ }
+
+ coresession.Close();
+ }
+
+ pGlobalILCoreCache->Unlock();
+ return omxError;
+
+ }
+
+/**
+ The OMX_FreeHandle method will free a handle allocated by the OMX_GetHandle
+ method.
+
+ @return OMX_ERRORTYPE
+*/
+OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_FreeHandle(
+ OMX_IN OMX_HANDLETYPE hComponent)
+ {
+ XGlobalILCoreCache* pGlobalILCoreCache = XGlobalILCoreCache::IlCoreCache();
+ __ASSERT_ALWAYS(pGlobalILCoreCache != NULL,
+ User::Panic(KOmxILCoreClientPanic, KErrNotReady));
+ pGlobalILCoreCache->Lock();
+
+ // OpenMAX IL mandates that OMX_Init must be the first OMX call made into
+ // the IL Core...
+ __ASSERT_ALWAYS(pGlobalILCoreCache->ILCore() != NULL,
+ User::Panic(KOmxILCoreClientPanic,
+ KErrNotReady));
+
+ OMX_ERRORTYPE omxError = OMX_ErrorNone;
+ if (CActiveScheduler::Current())
+ {
+ COmxILCore& ilCore = *pGlobalILCoreCache->ILCore();
+ omxError = ilCore.FreeHandle(hComponent);
+ }
+ else
+ {
+ ROmxILCoreClientSession coresession;
+ TInt err = coresession.Open();
+ __ASSERT_ALWAYS(KErrNotFound != err,
+ User::Panic(KOmxILCoreClientPanic,
+ KErrNotReady));
+ if (KErrNone == err)
+ {
+ omxError = coresession.FreeHandle(hComponent);
+ }
+ else
+ {
+ omxError = OMX_ErrorUndefined;
+ }
+
+ coresession.Close();
+ }
+
+ pGlobalILCoreCache->Unlock();
+ return omxError;
+
+ }
+
+/**
+ The OMX_SetupTunnel method sets up tunneled communication between an output
+ port and an input port.
+
+ @return OMX_ERRORTYPE
+ */
+OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_SetupTunnel(
+ OMX_IN OMX_HANDLETYPE hOutput,
+ OMX_IN OMX_U32 nPortOutput,
+ OMX_IN OMX_HANDLETYPE hInput,
+ OMX_IN OMX_U32 nPortInput)
+ {
+ XGlobalILCoreCache* pGlobalILCoreCache = XGlobalILCoreCache::IlCoreCache();
+ __ASSERT_ALWAYS(pGlobalILCoreCache != NULL,
+ User::Panic(KOmxILCoreClientPanic, KErrNotReady));
+ pGlobalILCoreCache->Lock();
+
+ // OpenMAX IL mandates that OMX_Init must be the first OMX call made into
+ // the IL Core...
+ __ASSERT_ALWAYS(pGlobalILCoreCache->ILCore() != NULL,
+ User::Panic(KOmxILCoreClientPanic,
+ KErrNotReady));
+
+ // SetupTunnel is reentrant and thus thread-safe, so no need to lock the
+ // IL Core instance...
+ pGlobalILCoreCache->Unlock();
+
+ OMX_ERRORTYPE omxError = OMX_ErrorNone;
+ if (CActiveScheduler::Current())
+ {
+ omxError = COmxILCore::SetupTunnel(
+ hOutput,
+ nPortOutput,
+ hInput,
+ nPortInput);
+ }
+ else
+ {
+ ROmxILCoreClientSession coresession;
+ TInt err = coresession.Open();
+ __ASSERT_ALWAYS(KErrNotFound != err,
+ User::Panic(KOmxILCoreClientPanic,
+ KErrNotReady));
+ if (KErrNone == err)
+ {
+ omxError = coresession.SetupTunnel(
+ hOutput,
+ nPortOutput,
+ hInput,
+ nPortInput);
+ }
+ else
+ {
+ // This is to make sure we return something that conforms with
+ // table 3-9 in the spec. Cannot return OMX_ErrorUndefined
+ omxError = OMX_ErrorTimeout;
+ }
+
+ coresession.Close();
+ }
+ return omxError;
+
+ }
+
+/**
+ The OMX_GetContentPipe method returns a content pipe capable of manipulating a
+ given piece of content as (specified via URI)
+
+ @return OMX_ERRORTYPE
+ */
+OMX_API OMX_ERRORTYPE OMX_GetContentPipe(
+ OMX_OUT OMX_HANDLETYPE* hPipe,
+ OMX_IN OMX_STRING szURI)
+ {
+ XGlobalILCoreCache* pGlobalILCoreCache = XGlobalILCoreCache::IlCoreCache();
+ __ASSERT_ALWAYS(pGlobalILCoreCache != NULL,
+ User::Panic(KOmxILCoreClientPanic, KErrNotReady));
+ pGlobalILCoreCache->Lock();
+
+ // OpenMAX IL mandates that OMX_Init must be the first OMX call made into
+ // the IL Core...
+ __ASSERT_ALWAYS(pGlobalILCoreCache->ILCore() != NULL,
+ User::Panic(KOmxILCoreClientPanic,
+ KErrNotReady));
+
+ OMX_ERRORTYPE omxError = OMX_ErrorNone;
+ if (CActiveScheduler::Current())
+ {
+ COmxILCore& ilCore = *pGlobalILCoreCache->ILCore();
+ omxError = ilCore.GetContentPipe(
+ hPipe,
+ szURI);
+ }
+ else
+ {
+ ROmxILCoreClientSession coresession;
+ TInt err = coresession.Open();
+ // OMX_Init needs to be the first OMX call
+ __ASSERT_ALWAYS(KErrNotFound != err,
+ User::Panic(KOmxILCoreClientPanic,
+ KErrNotReady));
+
+ if (KErrNone == err)
+ {
+ omxError = coresession.GetContentPipe(
+ hPipe,
+ szURI);
+ }
+ else
+ {
+ omxError = OMX_ErrorUndefined;
+ }
+
+ coresession.Close();
+ }
+
+ pGlobalILCoreCache->Unlock();
+ return omxError;
+
+ }
+
+/**
+ The OMX_GetComponentsOfRole function that enables the IL client to query the
+ names of all installed components that support a given role.
+
+ @return OMX_ERRORTYPE
+ */
+OMX_API OMX_ERRORTYPE OMX_GetComponentsOfRole (
+ OMX_IN OMX_STRING role,
+ OMX_INOUT OMX_U32* pNumComps,
+ OMX_INOUT OMX_U8** compNames)
+ {
+ XGlobalILCoreCache* pGlobalILCoreCache = XGlobalILCoreCache::IlCoreCache();
+ __ASSERT_ALWAYS(pGlobalILCoreCache != NULL,
+ User::Panic(KOmxILCoreClientPanic, KErrNotReady));
+ pGlobalILCoreCache->Lock();
+
+ // OpenMAX IL mandates that OMX_Init must be the first OMX call made into
+ // the IL Core...
+ __ASSERT_ALWAYS(pGlobalILCoreCache->ILCore() != NULL,
+ User::Panic(KOmxILCoreClientPanic,
+ KErrNotReady));
+
+ ROmxILCoreClientSession coresession;
+ OMX_ERRORTYPE omxError = OMX_ErrorNone;
+ TInt err = coresession.Open();
+ // OMX_Init needs to be the first OMX call
+ __ASSERT_ALWAYS(KErrNotFound != err,
+ User::Panic(KOmxILCoreClientPanic,
+ KErrNotReady));
+
+ // The OMX IL spec does not mandate this, but it probably should. We list
+ // and initialize loaders here too, if we can.
+ if (KErrNone == err)
+ {
+ // Ignore if any error...
+ coresession.ListLoaders();
+ }
+
+ if (CActiveScheduler::Current())
+ {
+ COmxILCore& ilCore = *pGlobalILCoreCache->ILCore();
+ omxError = ilCore.GetComponentsOfRole(
+ role,
+ pNumComps,
+ compNames);
+ }
+ else
+ {
+
+ if (KErrNone == err)
+ {
+ omxError = coresession.GetComponentsOfRole(
+ role,
+ pNumComps,
+ compNames);
+ }
+ else
+ {
+ omxError = OMX_ErrorUndefined;
+ }
+
+ }
+
+ coresession.Close();
+ pGlobalILCoreCache->Unlock();
+ return omxError;
+
+ }
+
+/**
+ The function that enables the IL client to query all the roles fulfilled by
+ a given a component.
+
+ @return OMX_ERRORTYPE
+ */
+OMX_API OMX_ERRORTYPE OMX_GetRolesOfComponent (
+ OMX_IN OMX_STRING compName,
+ OMX_INOUT OMX_U32* pNumRoles,
+ OMX_OUT OMX_U8** roles)
+ {
+ XGlobalILCoreCache* pGlobalILCoreCache = XGlobalILCoreCache::IlCoreCache();
+ __ASSERT_ALWAYS(pGlobalILCoreCache != NULL,
+ User::Panic(KOmxILCoreClientPanic, KErrNotReady));
+ pGlobalILCoreCache->Lock();
+
+ // OpenMAX IL mandates that OMX_Init must be the first OMX call made into
+ // the IL Core...
+ __ASSERT_ALWAYS(pGlobalILCoreCache->ILCore() != NULL,
+ User::Panic(KOmxILCoreClientPanic,
+ KErrNotReady));
+
+ ROmxILCoreClientSession coresession;
+ TInt err = coresession.Open();
+ // OMX_Init needs to be the first OMX call
+ __ASSERT_ALWAYS(KErrNotFound != err,
+ User::Panic(KOmxILCoreClientPanic,
+ KErrNotReady));
+
+ // The OMX IL spec does not mandate this, but it probably should. We list
+ // and initialize loaders here too, if we can.
+ if (KErrNone == err)
+ {
+ // Ignore if any error...
+ coresession.ListLoaders();
+ }
+
+ OMX_ERRORTYPE omxError = OMX_ErrorNone;
+ if (CActiveScheduler::Current())
+ {
+ COmxILCore& ilCore = *pGlobalILCoreCache->ILCore();
+ omxError = ilCore.GetRolesOfComponent(
+ compName,
+ pNumRoles,
+ roles);
+ }
+ else
+ {
+
+ if (KErrNone == err)
+ {
+ omxError = coresession.GetRolesOfComponent(
+ compName,
+ pNumRoles,
+ roles);
+ }
+ else
+ {
+ omxError = OMX_ErrorUndefined;
+ }
+
+ }
+
+ coresession.Close();
+ pGlobalILCoreCache->Unlock();
+ return omxError;
+
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcore/src/omxilcoreclient/omxilcoreclientsession.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,88 @@
+// 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:
+// omilcoreclientsession.h
+//
+//
+
+#ifndef OMXILCORECLIENTSESSION_H
+#define OMXILCORECLIENTSESSION_H
+
+#include <e32base.h>
+#include "omxilcoreclientserver.h"
+
+class COmxILCore;
+
+/**
+ Client-side of a an IL Client - IL Core communication
+ */
+NONSHARABLE_CLASS(ROmxILCoreClientSession) : public RSessionBase
+ {
+
+public:
+
+ ROmxILCoreClientSession();
+ ~ROmxILCoreClientSession();
+
+ TInt Connect();
+ TInt Open();
+ void Close();
+
+ // Retrieves an IL Core reference from the IL Core thread
+ COmxILCore& ILCore();
+
+ //
+ // OMX IL Operations...
+ //
+
+ OMX_ERRORTYPE ListLoaders();
+
+ OMX_ERRORTYPE DeinitAndClose();
+
+ OMX_ERRORTYPE ComponentNameEnum(
+ OMX_STRING cComponentName,
+ OMX_U32 nNameLength,
+ OMX_U32 nIndex);
+
+ OMX_ERRORTYPE GetHandle(
+ OMX_HANDLETYPE* pHandle,
+ OMX_STRING cComponentName,
+ OMX_PTR pAppData,
+ OMX_CALLBACKTYPE* pCallBacks);
+
+ OMX_ERRORTYPE FreeHandle(
+ OMX_HANDLETYPE hComponent);
+
+ OMX_ERRORTYPE SetupTunnel(
+ OMX_HANDLETYPE hOutput,
+ OMX_U32 nPortOutput,
+ OMX_HANDLETYPE hInput,
+ OMX_U32 nPortInput);
+
+ OMX_ERRORTYPE GetContentPipe(
+ OMX_HANDLETYPE *hPipe,
+ OMX_STRING szURI);
+
+ OMX_ERRORTYPE GetComponentsOfRole (
+ OMX_STRING role,
+ OMX_U32 *pNumComps,
+ OMX_U8 **compNames);
+
+ OMX_ERRORTYPE GetRolesOfComponent (
+ OMX_STRING compName,
+ OMX_U32 *pNumRoles,
+ OMX_U8 **roles);
+
+ };
+
+#endif // OMXILCORECLIENTSESSION_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcore/src/omxilcoreserver/log.h Wed Aug 25 12:40:50 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>
+
+namespace DSD
+{
+
+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);
+ }
+
+#ifdef _DEBUG
+
+#ifdef _OMXIL_CORESERVER_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, "[coresv] ");
+ _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, "[coresv] ");
+ _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/omxil_generic/omxilcore/src/omxilcoreserver/omxilcoreclientserver.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,103 @@
+// 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 OMXILCORECLIENTSERVER_H
+#define OMXILCORECLIENTSERVER_H
+
+#include <e32std.h>
+#include <openmax/il/khronos/v1_x/OMX_Core.h>
+
+_LIT(KOmxILCoreServerName,"OmxILCoreServer");
+
+// A larger stack is used due to Bellagio loader which uses ANSI C calls (fopen etc.). These calls require a large stack, and panic on ARM platforms if a default 8 KB stack is used
+const TInt KOmxILCoreServerStackSize=0x4000; // 16KB
+
+const TUint KOmxILCoreServerVersion = 1;
+const TUint KOmxILCoreServerMinorVersionNumber = 0;
+const TUint KOmxILCoreServerBuildVersionNumber = 0;
+
+// Function opcodes for client to server messaging
+enum TOmxILCoreClientToServerMessages
+ {
+ EOmxILCoreListLoaders = 0,
+ EOmxILCoreDeinit,
+ EOmxILCoreGetILCore,
+ EOmxILCoreComponentNameEnum,
+ EOmxILCoreGetHandle,
+ EOmxILCoreFreeHandle,
+ EOmxILCoreSetupTunnel,
+ EOmxILCoreGetContentPipe,
+ EOmxILCoreGetComponentsOfRole,
+ EOmxILCoreGetRolesOfComponent
+ };
+
+enum TOmxILCoreServerState
+ {
+ EOmxILCoreServerStateIdle = 0
+ };
+
+
+class TComponentNameEnum
+ {
+public:
+ OMX_STRING cComponentName;
+ OMX_U32 nNameLength;
+ OMX_U32 nIndex;
+ };
+
+class TGetHandle
+ {
+public:
+ OMX_HANDLETYPE* pHandle;
+ OMX_STRING cComponentName;
+ OMX_PTR pAppData;
+ OMX_CALLBACKTYPE* pCallBacks;
+ };
+
+class TSetupTunnel
+ {
+public:
+ OMX_HANDLETYPE hOutput;
+ OMX_U32 nPortOutput;
+ OMX_HANDLETYPE hInput;
+ OMX_U32 nPortInput;
+ };
+
+class TGetContentPipe
+ {
+public:
+ OMX_HANDLETYPE* hPipe;
+ OMX_STRING szURI;
+ };
+
+class TGetComponentsOfRole
+ {
+public:
+ OMX_STRING role;
+ OMX_U32 *pNumComps;
+ OMX_U8 **compNames;
+ };
+
+class TGetRolesOfComponent
+ {
+public:
+ OMX_STRING compName;
+ OMX_U32 *pNumRoles;
+ OMX_U8 **roles;
+ };
+
+IMPORT_C TInt StartOmxILCoreServer(TUint32 *aServerHandle);
+
+#endif // OMXILCORECLIENTSERVER_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcore/src/omxilcoreserver/omxilcoreserver.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,310 @@
+// 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 "log.h"
+#include "omxilcoreserver.h"
+#include "omxilcoreserversession.h"
+#include "omxilcoreclientserver.h"
+#include "omxilcore.h"
+#include <ecom/ecom.h>
+
+
+/**
+ * Constructor
+ */
+COmxILCoreServer::COmxILCoreServer()
+: CServer2(EPriorityStandard)
+ {
+ DEBUG_PRINTF(_L8("COmxILCoreServer::COmxILCoreServer"));
+ Cancel();
+ }
+
+/**
+ * Destructor.
+ */
+COmxILCoreServer::~COmxILCoreServer()
+ {
+ DEBUG_PRINTF(_L8("COmxILCoreServer::~COmxILCoreServer"));
+ delete ipOmxILCore;
+ delete ipStopCallback;
+ }
+
+/**
+ * Constructs, and returns a pointer to, a new COmxILCoreServer object.
+ * Leaves on failure.
+ * @return COmxILCoreServer* A pointer to newly created utlitly object.
+ */
+COmxILCoreServer* COmxILCoreServer::NewL()
+ {
+ DEBUG_PRINTF(_L8("COmxILCoreServer::NewL"));
+ COmxILCoreServer* self = NewLC();
+ CleanupStack::Pop(self);
+ return self;
+ }
+
+/**
+ * Constructs, leaves object on the cleanup stack, and returns a pointer
+ * to, a new OMX IL Core Server object.
+ * Leaves on failure.
+ * @return COmxILCoreServer* A pointer to newly created utlitly object.
+ */
+COmxILCoreServer* COmxILCoreServer::NewLC()
+ {
+ DEBUG_PRINTF(_L8("COmxILCoreServer::NewLC"));
+ COmxILCoreServer* self = new(ELeave) COmxILCoreServer;
+ CleanupStack::PushL(self);
+ self->ConstructL();
+
+ return self;
+ }
+
+/**
+ Symbian 2nd phase constructor.
+ */
+void COmxILCoreServer::ConstructL()
+ {
+ DEBUG_PRINTF(_L8("COmxILCoreServer::ConstructL"));
+
+ // Create the OpenMAX IL Core
+ ipOmxILCore = new (ELeave) COmxILCore;
+
+ // Create the server termination callback object...
+ TCallBack callbackStop (COmxILCoreServer::StopServer, this);
+ ipStopCallback =
+ new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow);
+
+ }
+
+/**
+ From CServer2. Creates a server-side client session object. Creates a new
+ session. This function may leave with one of the system-wide error codes.
+
+ @param const TVersion& aVersion The version number of the session.
+
+ @param const RMessage2& aMessage
+
+ @return A pointer to the new session.
+ */
+CSession2* COmxILCoreServer::NewSessionL(const TVersion& aVersion,
+ const RMessage2& aMessage) const
+ {
+
+ RThread clientThread;
+ aMessage.Client(clientThread);
+ RProcess clientProcess;
+ clientThread.Process(clientProcess);
+ RProcess thisProcess;
+
+ DEBUG_PRINTF3(_L8("COmxILCoreServer::NewSessionL : this process [%d] - client process [%d]"), thisProcess.Id().operator TUint(), clientProcess.Id().operator TUint());
+
+ // Only allow sessions from clients running in the server process
+ if (thisProcess.Id() != clientProcess.Id())
+ {
+ clientThread.Close();
+ clientProcess.Close();
+ thisProcess.Close();
+ User::Leave(KErrAccessDenied);
+ }
+
+ clientThread.Close();
+ clientProcess.Close();
+ thisProcess.Close();
+
+ if(!User::QueryVersionSupported(TVersion(KOmxILCoreServerVersion,
+ KOmxILCoreServerMinorVersionNumber,
+ KOmxILCoreServerBuildVersionNumber),
+ aVersion))
+ {
+ User::Leave(KErrNotSupported);
+ }
+
+ if (iDeinitInProgress)
+ {
+ User::Leave(KErrNotReady);
+ }
+
+ COmxILCoreServerSession* omxilcoreSession =
+ COmxILCoreServerSession::NewL(*ipOmxILCore,
+ const_cast<COmxILCoreServer&>(*this));
+
+ return omxilcoreSession;
+ }
+
+TInt COmxILCoreServer::StopServer(TAny* aPtr)
+ {
+ DEBUG_PRINTF(_L8("COmxILCoreServer::StopServer"));
+ COmxILCoreServer* self =
+ static_cast<COmxILCoreServer*> (aPtr);
+ self->DoStopServer();
+ return KErrNone;
+
+ }
+
+void COmxILCoreServer::DoStopServer()
+ {
+ DEBUG_PRINTF(_L8("COmxILCoreServer::DoStopServer"));
+ CActiveScheduler::Stop();
+ }
+
+
+void COmxILCoreServer::SetDeinitInProgress()
+ {
+ DEBUG_PRINTF(_L8("COmxILCoreServer::SetDeinitInProgress"));
+
+ iDeinitInProgress = ETrue;
+
+ }
+
+void COmxILCoreServer::SessionOpened()
+ {
+ DEBUG_PRINTF(_L8("COmxILCoreServer::SessionOpened"));
+
+ iSessionCounter++;
+
+ }
+
+
+void COmxILCoreServer::SessionClosed()
+ {
+ DEBUG_PRINTF(_L8("COmxILCoreServer::SessionClosed"));
+
+ iSessionCounter--;
+
+ if (iSessionCounter == 0 && iDeinitInProgress)
+ {
+ DEBUG_PRINTF(_L8("COmxILCoreServer::SessionClosed : iSessionCounter = 0 and DeinitInProgress = TRUE"));
+ ipStopCallback->Call();
+ }
+
+ }
+
+
+TInt COmxILCoreServer::ThreadFunctionL(TAny* aServerHandle)
+ {
+ // create an active scheduler and server
+ CActiveScheduler* sched = new (ELeave) CActiveScheduler;
+ CleanupStack::PushL(sched);
+
+ //Install the active scheduler
+ CActiveScheduler::Install(sched);
+
+ COmxILCoreServer* server = COmxILCoreServer::NewL();
+ CleanupStack::PushL(server);
+
+ // Start the server
+ TInt err = server->Start(KNullDesC);
+ if (err != KErrNone)
+ {
+ return err;
+ }
+
+ RServer2 serverHandle = server->Server();
+ User::LeaveIfError(serverHandle.Duplicate(RThread(), EOwnerProcess));
+ // Return the handle of the server to function which created us.
+ *reinterpret_cast<TUint32 *>(aServerHandle) = serverHandle.Handle();
+
+ // Let everyone know that we are ready to
+ // deal with requests.
+ RThread::Rendezvous(KErrNone);
+
+ // And start fielding requests from client(s).
+ CActiveScheduler::Start();
+
+ CleanupStack::PopAndDestroy(2, sched); // sched, server
+
+ return KErrNone;
+ }
+
+/**
+ Create the thread that will act as the server.
+
+*/
+TInt COmxILCoreServer::ThreadFunction(TAny* aServerHandle)
+ {
+ DEBUG_PRINTF(_L8("COmxILCoreServer::ThreadFunction"));
+ // get clean-up stack
+ CTrapCleanup* cleanup = CTrapCleanup::New();
+ if (cleanup == NULL)
+ {
+ return KErrNoMemory;
+ }
+
+ TRAPD( err, ThreadFunctionL(aServerHandle) );
+
+ REComSession::FinalClose();
+
+ delete cleanup;
+ DEBUG_PRINTF(_L8("COmxILCoreServer::ThreadFunction: returning"));
+ return err;
+ }
+
+/**
+ Create the thread that will act as the server. This function is exported
+ from the DLL and called by the client.
+
+*/
+EXPORT_C TInt StartOmxILCoreServer(TUint32 *aServerHandle)
+ {
+ DEBUG_PRINTF(_L8("StartOmxILCoreServer"));
+
+ TInt res = KErrNone;
+ RThread serverThread;
+
+ // Create the thread for the server.
+ res = serverThread.Create(KNullDesC,
+ COmxILCoreServer::ThreadFunction,
+ KOmxILCoreServerStackSize,
+ &User::Heap(),
+ aServerHandle);
+
+ if (res==KErrNone)
+ {
+ DEBUG_PRINTF(_L8("StartOmxILCoreServer : Thread created"));
+ TRequestStatus rendezvousStatus;
+
+ serverThread.SetPriority(EPriorityNormal);
+
+ // Synchronise with the server
+ serverThread.Rendezvous(rendezvousStatus);
+ if (rendezvousStatus != KRequestPending)
+ {
+ serverThread.Kill(KErrDied);
+ }
+ else
+ {
+ serverThread.Resume();
+ }
+
+ User::WaitForRequest(rendezvousStatus);
+ if(rendezvousStatus != KErrNone)
+ {
+ res = rendezvousStatus.Int();
+ }
+
+ }
+ else
+ {
+ // The thread could not be created..
+ DEBUG_PRINTF2(_L8("StartOmxILCoreServer : Thread Creation error [%d]"), res);
+ res = KErrGeneral;
+ }
+
+ serverThread.Close();
+
+ return res;
+
+ }
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcore/src/omxilcoreserver/omxilcoreserver.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,72 @@
+// 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 OMXILCORESERVER_H
+#define OMXILCORESERVER_H
+
+#include <e32std.h>
+#include <e32base.h>
+#include "omxilcoreclientserver.h"
+
+class COmxILCore;
+class COmxILCoreServerSession;
+
+
+NONSHARABLE_CLASS( COmxILCoreServer ): public CServer2
+ {
+public:
+
+ static COmxILCoreServer* NewL();
+ static COmxILCoreServer* NewLC();
+ ~COmxILCoreServer();
+
+public:
+ // The thread function executed by the server
+ static TInt ThreadFunction(TAny* aServerHandle);
+
+ // Creates a new session with the server; the function
+ // implements the pure virtutal function
+ // defined in class CServer2
+ CSession2* NewSessionL(const TVersion& aVersion,const RMessage2& aMessage) const;
+
+ void SetDeinitInProgress();
+
+ void SessionClosed();
+
+ void SessionOpened();
+
+private :
+
+ COmxILCoreServer();
+ void ConstructL();
+
+ // The thread function executed by the server
+ static TInt ThreadFunctionL(TAny* aServerHandle);
+
+ static TInt StopServer(TAny* aPtr);
+
+ // Function to stop the IL Core server
+ void DoStopServer();
+
+private :
+
+ COmxILCore* ipOmxILCore;
+ CAsyncCallBack* ipStopCallback;
+ TBool iDeinitInProgress;
+ TUint iSessionCounter;
+
+ };
+
+#endif //OMXILCORESERVER_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcore/src/omxilcoreserver/omxilcoreserversession.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,263 @@
+// 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 "log.h"
+#include "omxilcore.h"
+#include "omxilcoreserver.h"
+#include "omxilcoreserversession.h"
+
+
+_LIT(KOmxILCoreServerPanic, "OmxILCoreServer Panic");
+
+/**
+ * By default Symbian 2nd phase constructor is private.
+ */
+COmxILCoreServerSession::COmxILCoreServerSession(COmxILCore& aCore, COmxILCoreServer& aCoreServer)
+ :
+ iCore(aCore),
+ iCoreServer(aCoreServer)
+ {
+ DEBUG_PRINTF(_L8("COmxILCoreServerSession::COmxILCoreServerSession"));
+
+ // Inform the server that this session is opening
+ aCoreServer.SessionOpened();
+
+ }
+
+/**
+ * Destructor
+ */
+COmxILCoreServerSession::~COmxILCoreServerSession()
+ {
+ DEBUG_PRINTF(_L8("COmxILCoreServerSession::~COmxILCoreServerSession"));
+
+ // Inform the server that this session is closed
+ iCoreServer.SessionClosed();
+
+ }
+
+/**
+ * Constructs, and returns a pointer to, a new COmxILCoreServerSession object.
+ * Leaves on failure.
+ * @return COmxILCoreServerSession* A pointer to newly created utlitly object.
+ */
+COmxILCoreServerSession* COmxILCoreServerSession::NewL(COmxILCore& aCore, COmxILCoreServer& aCoreServer)
+ {
+ DEBUG_PRINTF(_L8("COmxILCoreServerSession::NewL"));
+
+ COmxILCoreServerSession* self = new(ELeave) COmxILCoreServerSession(aCore, aCoreServer);
+ return self;
+ }
+
+/**
+ * from CSession2
+ * @param aMessage - Function and data for the session
+ */
+void COmxILCoreServerSession::ServiceL(const RMessage2& aMessage)
+ {
+ DEBUG_PRINTF(_L8("COmxILCoreServerSession::ServiceL"));
+
+ TRAPD( errL, DispatchMessageL(aMessage) );
+
+ if( errL != KErrNone )
+ {
+ ASSERT(0);
+ }
+ }
+
+/**
+ * Dispatch the message received from ServeL
+ * @param aMessage - Function and data for the session
+ * @return error code
+ * @leave in case of writeL leave or request leave
+ */
+TInt COmxILCoreServerSession::DispatchMessageL(const RMessage2& aMessage)
+ {
+
+ TInt error = KErrNone;
+ OMX_ERRORTYPE omxError = OMX_ErrorNone;
+
+ TOmxILCoreClientToServerMessages messageFunction =
+ static_cast<TOmxILCoreClientToServerMessages>(aMessage.Function());
+ __ASSERT_ALWAYS(messageFunction <= EOmxILCoreGetRolesOfComponent,
+ User::Panic(KOmxILCoreServerPanic, 0));
+
+ switch(messageFunction)
+ {
+ case EOmxILCoreListLoaders:
+ {
+ DEBUG_PRINTF(_L8("COmxILCoreServerSession::DispatchMessageL : EOmxILCoreListLoaders"));
+ omxError = iCore.ListLoaders();
+ }
+ break;
+
+ case EOmxILCoreDeinit:
+ {
+ DEBUG_PRINTF(_L8("COmxILCoreServerSession::DispatchMessageL : EOmxILCoreDeinit"));
+
+ // Flag the deinitialization ...
+ iCoreServer.SetDeinitInProgress();
+ iCore.DeinitCore();
+
+ // Write server thread id
+ RThread thisThread;
+ TPckgBuf<TUint64> p(thisThread.Id().Id());
+ aMessage.WriteL(1,p);
+ thisThread.Close();
+ }
+ break;
+
+ case EOmxILCoreGetILCore:
+ {
+ DEBUG_PRINTF(_L8("COmxILCoreServerSession::DispatchMessageL : EOmxILCoreGetILCore"));
+
+ // Write IL Core reference...
+ TPckgBuf<COmxILCore*> p(&iCore);
+ aMessage.WriteL(1,p);
+
+ }
+ break;
+
+ case EOmxILCoreComponentNameEnum:
+ {
+ DEBUG_PRINTF(_L8("COmxILCoreServerSession::DispatchMessageL : EOmxILCoreComponentNameEnum"));
+
+ TComponentNameEnum* pArg =
+ static_cast<TComponentNameEnum*>(
+ const_cast<TAny*>(aMessage.Ptr1()));
+ __ASSERT_DEBUG(pArg, User::Panic(KOmxILCoreServerPanic, 0));
+
+ omxError = iCore.ComponentNameEnum(
+ pArg->cComponentName,
+ pArg->nNameLength,
+ pArg->nIndex);
+ }
+ break;
+
+ case EOmxILCoreGetHandle:
+ {
+ DEBUG_PRINTF(_L8("COmxILCoreServerSession::DispatchMessageL : EOmxILCoreGetHandle"));
+
+ TGetHandle* pArg =
+ static_cast<TGetHandle*>(
+ const_cast<TAny*>(aMessage.Ptr1()));
+ __ASSERT_DEBUG(pArg, User::Panic(KOmxILCoreServerPanic, 0));
+
+ omxError = iCore.LoadComponent(
+ pArg->cComponentName,
+ pArg->pHandle,
+ pArg->pAppData,
+ pArg->pCallBacks);
+
+ }
+ break;
+
+ case EOmxILCoreFreeHandle:
+ {
+ DEBUG_PRINTF(_L8("COmxILCoreServerSession::DispatchMessageL : EOmxILCoreFreeHandle"));
+
+ OMX_HANDLETYPE* hComponent =
+ static_cast<OMX_HANDLETYPE*>(
+ const_cast<TAny*>(aMessage.Ptr1()));
+
+ omxError = iCore.FreeHandle(hComponent);
+
+ }
+ break;
+
+ case EOmxILCoreSetupTunnel:
+ {
+ DEBUG_PRINTF(_L8("COmxILCoreServerSession::DispatchMessageL : EOmxILCoreSetupTunnel"));
+
+ TSetupTunnel* pArg =
+ static_cast<TSetupTunnel*>(
+ const_cast<TAny*>(aMessage.Ptr1()));
+ __ASSERT_DEBUG(pArg, User::Panic(KOmxILCoreServerPanic, 0));
+
+ omxError = COmxILCore::SetupTunnel(
+ pArg->hOutput,
+ pArg->nPortOutput,
+ pArg->hInput,
+ pArg->nPortInput);
+
+ }
+ break;
+
+ case EOmxILCoreGetContentPipe:
+ {
+ DEBUG_PRINTF(_L8("COmxILCoreServerSession::DispatchMessageL : EOmxILCoreGetContentPipe"));
+
+ TGetContentPipe* pArg =
+ static_cast<TGetContentPipe*>(
+ const_cast<TAny*>(aMessage.Ptr1()));
+ __ASSERT_DEBUG(pArg, User::Panic(KOmxILCoreServerPanic, 0));
+
+ omxError = iCore.GetContentPipe(
+ pArg->hPipe,
+ pArg->szURI);
+
+ }
+ break;
+
+ case EOmxILCoreGetComponentsOfRole:
+ {
+ DEBUG_PRINTF(_L8("COmxILCoreServerSession::DispatchMessageL : EOmxILCoreGetComponentsOfRole"));
+
+ TGetComponentsOfRole* pArg =
+ static_cast<TGetComponentsOfRole*>(
+ const_cast<TAny*>(aMessage.Ptr1()));
+ __ASSERT_DEBUG(pArg, User::Panic(KOmxILCoreServerPanic, 0));
+
+ omxError = iCore.GetComponentsOfRole(
+ pArg->role,
+ pArg->pNumComps,
+ pArg->compNames);
+
+ }
+ break;
+
+ case EOmxILCoreGetRolesOfComponent:
+ {
+ DEBUG_PRINTF(_L8("COmxILCoreServerSession::DispatchMessageL : EOmxILCoreGetRolesOfComponent"));
+
+ TGetRolesOfComponent* pArg =
+ static_cast<TGetRolesOfComponent*>(
+ const_cast<TAny*>(aMessage.Ptr1()));
+ __ASSERT_DEBUG(pArg, User::Panic(KOmxILCoreServerPanic, 0));
+
+ omxError = iCore.GetRolesOfComponent(
+ pArg->compName,
+ pArg->pNumRoles,
+ pArg->roles);
+
+ }
+ break;
+
+ default:
+ {
+ // Unknown Message
+ error = KErrNotSupported;
+ }
+ break;
+ };
+
+ // Write OMX result
+ TPckgBuf<OMX_ERRORTYPE> p(omxError);
+ aMessage.WriteL(0,p);
+
+ aMessage.Complete(error);
+
+ return error;
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcore/src/omxilcoreserver/omxilcoreserversession.h Wed Aug 25 12:40:50 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:
+//
+
+#ifndef OMXILCORESERVERSESSION_H
+#define OMXILCORESERVERSESSION_H
+
+#include <e32base.h>
+#include "omxilcoreclientserver.h"
+
+class COmxILCore;
+
+NONSHARABLE_CLASS(COmxILCoreServerSession) : public CSession2
+ {
+public:
+ static COmxILCoreServerSession* NewL(COmxILCore& aCore, COmxILCoreServer& aCoreServer);
+
+ ~COmxILCoreServerSession();
+
+ // from CSession2
+ void ServiceL(const RMessage2& aMessage);
+
+private:
+ COmxILCoreServerSession(COmxILCore& aCore, COmxILCoreServer& aCoreServer);
+ TInt DispatchMessageL(const RMessage2& aMessage);
+
+private:
+
+ COmxILCore& iCore;
+ COmxILCoreServer& iCoreServer;
+
+ };
+
+#endif // OMXILCORESERVERSESSION_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcore/traces/OstTraceDefinitions.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,22 @@
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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 __OSTTRACEDEFINITIONS_H__
+#define __OSTTRACEDEFINITIONS_H__
+// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
+// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
+//#define OST_TRACE_COMPILER_IN_USE
+#include <opensystemtrace.h>
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcore/traces/fixed_id.definitions Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,593 @@
+#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
+[GROUP]TRACE_API=0x6
+[GROUP]TRACE_API_BUFFER=0x6b
+[GROUP]TRACE_API_DUMP_STRUCT=0x6a
+[TRACE]TRACE_API[0x6]__ComponentDeInit1=0x6a1
+[TRACE]TRACE_API[0x6]__ComponentDeInit2=0x6a2
+[TRACE]TRACE_API[0x6]__ComponentNameEnum1=0x6b6
+[TRACE]TRACE_API[0x6]__ComponentNameEnum2=0x6b7
+[TRACE]TRACE_API[0x6]__ComponentRoleEnum1=0x6b2
+[TRACE]TRACE_API[0x6]__ComponentRoleEnum2=0x6b3
+[TRACE]TRACE_API[0x6]__ComponentTunnelRequest1=0x69d
+[TRACE]TRACE_API[0x6]__ComponentTunnelRequest2=0x69e
+[TRACE]TRACE_API[0x6]__EventHandler10=0x6af
+[TRACE]TRACE_API[0x6]__EventHandler2=0x6a7
+[TRACE]TRACE_API[0x6]__EventHandler3=0x6a8
+[TRACE]TRACE_API[0x6]__EventHandler4=0x6a9
+[TRACE]TRACE_API[0x6]__EventHandler5=0x6aa
+[TRACE]TRACE_API[0x6]__EventHandler6=0x6ab
+[TRACE]TRACE_API[0x6]__EventHandler7=0x6ac
+[TRACE]TRACE_API[0x6]__EventHandler8=0x6ad
+[TRACE]TRACE_API[0x6]__EventHandler9=0x6ae
+[TRACE]TRACE_API[0x6]__FreeHandle1=0x6b8
+[TRACE]TRACE_API[0x6]__FreeHandle2=0x6b9
+[TRACE]TRACE_API[0x6]__GetComponentVersion1=0x69f
+[TRACE]TRACE_API[0x6]__GetComponentVersion2=0x6a0
+[TRACE]TRACE_API[0x6]__GetComponentsOfRole1=0x6be
+[TRACE]TRACE_API[0x6]__GetComponentsOfRole2=0x6bf
+[TRACE]TRACE_API[0x6]__GetConfig1=0x688
+[TRACE]TRACE_API[0x6]__GetConfig2=0x689
+[TRACE]TRACE_API[0x6]__GetContentPipe1=0x6bc
+[TRACE]TRACE_API[0x6]__GetContentPipe2=0x6bd
+[TRACE]TRACE_API[0x6]__GetExtensionIndex1=0x6a3
+[TRACE]TRACE_API[0x6]__GetExtensionIndex2=0x6a4
+[TRACE]TRACE_API[0x6]__GetParameter1=0x68e
+[TRACE]TRACE_API[0x6]__GetParameter2=0x68f
+[TRACE]TRACE_API[0x6]__GetParameter3=0x690
+[TRACE]TRACE_API[0x6]__GetParameter4=0x691
+[TRACE]TRACE_API[0x6]__GetParameter5=0x692
+[TRACE]TRACE_API[0x6]__GetRolesOfComponent1=0x6c0
+[TRACE]TRACE_API[0x6]__GetRolesOfComponent2=0x6c1
+[TRACE]TRACE_API[0x6]__GetState1=0x68c
+[TRACE]TRACE_API[0x6]__GetState2=0x68d
+[TRACE]TRACE_API[0x6]__LoadComponent1=0x6b4
+[TRACE]TRACE_API[0x6]__LoadComponent2=0x6b5
+[TRACE]TRACE_API[0x6]__SendCommand1=0x698
+[TRACE]TRACE_API[0x6]__SendCommand2=0x699
+[TRACE]TRACE_API[0x6]__SendCommand3=0x69a
+[TRACE]TRACE_API[0x6]__SendCommand4=0x69b
+[TRACE]TRACE_API[0x6]__SendCommand6=0x69c
+[TRACE]TRACE_API[0x6]__SetCallbacks1=0x6a5
+[TRACE]TRACE_API[0x6]__SetCallbacks2=0x6a6
+[TRACE]TRACE_API[0x6]__SetConfig1=0x68a
+[TRACE]TRACE_API[0x6]__SetConfig2=0x68b
+[TRACE]TRACE_API[0x6]__SetParameter1=0x693
+[TRACE]TRACE_API[0x6]__SetParameter2=0x694
+[TRACE]TRACE_API[0x6]__SetParameter3=0x695
+[TRACE]TRACE_API[0x6]__SetParameter4=0x696
+[TRACE]TRACE_API[0x6]__SetParameter5=0x697
+[TRACE]TRACE_API[0x6]__SetupTunnel1=0x6ba
+[TRACE]TRACE_API[0x6]__SetupTunnel2=0x6bb
+[TRACE]TRACE_API[0x6]__UseEGLImage1=0x6b0
+[TRACE]TRACE_API[0x6]__UseEGLImage2=0x6b1
+[TRACE]TRACE_API_BUFFER[0x6B]__AllocateBuffer1=0x1
+[TRACE]TRACE_API_BUFFER[0x6B]__AllocateBuffer2=0x2
+[TRACE]TRACE_API_BUFFER[0x6B]__EmptyBufferDone2=0xb
+[TRACE]TRACE_API_BUFFER[0x6B]__EmptyThisBuffer1=0x3
+[TRACE]TRACE_API_BUFFER[0x6B]__EmptyThisBuffer2=0x4
+[TRACE]TRACE_API_BUFFER[0x6B]__FillBufferDone2=0xc
+[TRACE]TRACE_API_BUFFER[0x6B]__FillThisBuffer1=0x5
+[TRACE]TRACE_API_BUFFER[0x6B]__FillThisBuffer2=0x6
+[TRACE]TRACE_API_BUFFER[0x6B]__FreeBuffer1=0x7
+[TRACE]TRACE_API_BUFFER[0x6B]__FreeBuffer2=0x8
+[TRACE]TRACE_API_BUFFER[0x6B]__UseBuffer1=0x9
+[TRACE]TRACE_API_BUFFER[0x6B]__UseBuffer2=0xa
+[TRACE]TRACE_API_DUMP_STRUCT[0x6A]__EmptyBufferDone3=0x8
+[TRACE]TRACE_API_DUMP_STRUCT[0x6A]__EmptyThisBuffer3=0x5
+[TRACE]TRACE_API_DUMP_STRUCT[0x6A]__FillBufferDone3=0x9
+[TRACE]TRACE_API_DUMP_STRUCT[0x6A]__FillThisBuffer3=0x6
+[TRACE]TRACE_API_DUMP_STRUCT[0x6A]__FreeBuffer3=0x7
+[TRACE]TRACE_API_DUMP_STRUCT[0x6A]__GetConfig3=0x1
+[TRACE]TRACE_API_DUMP_STRUCT[0x6A]__GetParameter6=0x3
+[TRACE]TRACE_API_DUMP_STRUCT[0x6A]__SetConfig3=0x2
+[TRACE]TRACE_API_DUMP_STRUCT[0x6A]__SetParameter6=0x4
+[[OBSOLETE]]ETE]][TRACE]TRACE_API_BUFFER[0x55]__FillBufferDone2=0xc
+[[OBSOLETE]]ETE]][TRACE]TRACE_API_BUFFER[0x57]__FillBufferDone2=0xc
+[[OBSOLETE]][0x4E]__FreeBuffer1=0x7
+[[OBSOLETE]][GROUP]TRACE_API_BUFFER=0x69
+[[OBSOLETE]][GROUP]TRACE_API_DUMP_STRUCT=0x68
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__ComponentDeInit1=0x663
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__ComponentDeInit2=0x664
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__ComponentNameEnum1=0x678
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__ComponentNameEnum2=0x679
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__ComponentRoleEnum1=0x674
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__ComponentRoleEnum2=0x675
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__ComponentTunnelRequest1=0x65f
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__ComponentTunnelRequest2=0x660
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__Connect1=0x684
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__Connect2=0x685
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__DeinitAndClose1=0x686
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__DeinitAndClose2=0x687
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__EventHandler10=0x671
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__EventHandler2=0x669
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__EventHandler3=0x66a
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__EventHandler4=0x66b
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__EventHandler5=0x66c
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__EventHandler6=0x66d
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__EventHandler7=0x66e
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__EventHandler8=0x66f
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__EventHandler9=0x670
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__FreeHandle1=0x67a
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__FreeHandle2=0x67b
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__GetComponentVersion1=0x661
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__GetComponentVersion2=0x662
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__GetComponentsOfRole1=0x680
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__GetComponentsOfRole2=0x681
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__GetConfig1=0x64a
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__GetConfig2=0x64b
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__GetContentPipe1=0x67e
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__GetContentPipe2=0x67f
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__GetExtensionIndex1=0x665
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__GetExtensionIndex2=0x666
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__GetParameter1=0x650
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__GetParameter2=0x651
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__GetParameter3=0x652
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__GetParameter4=0x653
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__GetParameter5=0x654
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__GetRolesOfComponent1=0x682
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__GetRolesOfComponent2=0x683
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__GetState1=0x64e
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__GetState2=0x64f
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__LoadComponent1=0x676
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__LoadComponent2=0x677
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__SendCommand1=0x65a
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__SendCommand2=0x65b
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__SendCommand3=0x65c
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__SendCommand4=0x65d
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__SendCommand5=0x529
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__SendCommand6=0x65e
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__SetCallbacks1=0x667
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__SetCallbacks2=0x668
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__SetConfig1=0x64c
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__SetConfig2=0x64d
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__SetParameter1=0x655
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__SetParameter2=0x656
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__SetParameter3=0x657
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__SetParameter4=0x658
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__SetParameter5=0x659
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__SetParameter6=0x45c
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__SetParameter7=0x524
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__SetupTunnel1=0x67c
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__SetupTunnel2=0x67d
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__UseEGLImage1=0x672
+[[OBSOLETE]][TRACE]TRACE_API[0x6]__UseEGLImage2=0x673
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x40]__AllocateBuffer1=0x1
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x40]__AllocateBuffer2=0x2
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x40]__EmptyBufferDone2=0xb
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x40]__EmptyThisBuffer1=0x3
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x40]__EmptyThisBuffer2=0x4
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x40]__FillBufferDone2=0xc
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x40]__FillThisBuffer1=0x5
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x40]__FillThisBuffer2=0x6
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x40]__FreeBuffer1=0x7
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x40]__FreeBuffer2=0x8
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x40]__UseBuffer1=0x9
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x40]__UseBuffer2=0xa
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x41]__AllocateBuffer1=0x1
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x41]__AllocateBuffer2=0x2
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x41]__EmptyBufferDone2=0xb
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x41]__EmptyThisBuffer1=0x3
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x41]__EmptyThisBuffer2=0x4
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x41]__FillBufferDone2=0xc
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x41]__FillThisBuffer1=0x5
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x41]__FillThisBuffer2=0x6
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x41]__FreeBuffer1=0x7
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x41]__FreeBuffer2=0x8
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x41]__UseBuffer1=0x9
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x41]__UseBuffer2=0xa
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x42]__AllocateBuffer1=0x1
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x42]__AllocateBuffer2=0x2
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x42]__EmptyBufferDone2=0xb
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x42]__EmptyThisBuffer1=0x3
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x42]__EmptyThisBuffer2=0x4
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x42]__FillBufferDone2=0xc
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x42]__FillThisBuffer1=0x5
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x42]__FillThisBuffer2=0x6
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x42]__FreeBuffer1=0x7
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x42]__FreeBuffer2=0x8
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x42]__UseBuffer1=0x9
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x42]__UseBuffer2=0xa
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x43]__AllocateBuffer1=0x1
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x43]__AllocateBuffer2=0x2
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x43]__EmptyBufferDone2=0xb
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x43]__EmptyThisBuffer1=0x3
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x43]__EmptyThisBuffer2=0x4
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x43]__FillBufferDone2=0xc
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x43]__FillThisBuffer1=0x5
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x43]__FillThisBuffer2=0x6
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x43]__FreeBuffer1=0x7
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x43]__FreeBuffer2=0x8
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x43]__UseBuffer1=0x9
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x43]__UseBuffer2=0xa
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x44]__AllocateBuffer1=0x1
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x44]__AllocateBuffer2=0x2
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x44]__EmptyBufferDone2=0xb
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x44]__EmptyThisBuffer1=0x3
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x44]__EmptyThisBuffer2=0x4
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x44]__FillBufferDone2=0xc
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x44]__FillThisBuffer1=0x5
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x44]__FillThisBuffer2=0x6
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x44]__FreeBuffer1=0x7
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x44]__FreeBuffer2=0x8
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x44]__UseBuffer1=0x9
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x44]__UseBuffer2=0xa
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x45]__AllocateBuffer1=0x1
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x45]__AllocateBuffer2=0x2
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x45]__EmptyBufferDone2=0xb
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x45]__EmptyThisBuffer1=0x3
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x45]__EmptyThisBuffer2=0x4
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x45]__FillBufferDone2=0xc
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x45]__FillThisBuffer1=0x5
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x45]__FillThisBuffer2=0x6
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x45]__FreeBuffer1=0x7
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x45]__FreeBuffer2=0x8
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x45]__UseBuffer1=0x9
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x45]__UseBuffer2=0xa
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x46]__AllocateBuffer1=0x1
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x46]__AllocateBuffer2=0x2
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x46]__EmptyBufferDone2=0xb
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x46]__EmptyThisBuffer1=0x3
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x46]__EmptyThisBuffer2=0x4
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x46]__FillBufferDone2=0xc
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x46]__FillThisBuffer1=0x5
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x46]__FillThisBuffer2=0x6
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x46]__FreeBuffer1=0x7
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x46]__FreeBuffer2=0x8
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x46]__UseBuffer1=0x9
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x46]__UseBuffer2=0xa
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x47]__AllocateBuffer1=0x1
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x47]__AllocateBuffer2=0x2
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x47]__EmptyBufferDone2=0xb
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x47]__EmptyThisBuffer1=0x3
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x47]__EmptyThisBuffer2=0x4
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x47]__FillBufferDone2=0xc
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x47]__FillThisBuffer1=0x5
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x47]__FillThisBuffer2=0x6
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x47]__FreeBuffer1=0x7
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x47]__FreeBuffer2=0x8
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x47]__UseBuffer1=0x9
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x47]__UseBuffer2=0xa
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x48]__AllocateBuffer1=0x1
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x48]__AllocateBuffer2=0x2
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x48]__EmptyBufferDone2=0xb
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x48]__EmptyThisBuffer1=0x3
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x48]__EmptyThisBuffer2=0x4
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x48]__FillBufferDone2=0xc
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x48]__FillThisBuffer1=0x5
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x48]__FillThisBuffer2=0x6
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x48]__FreeBuffer1=0x7
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x48]__FreeBuffer2=0x8
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x48]__UseBuffer1=0x9
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x48]__UseBuffer2=0xa
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x49]__AllocateBuffer1=0x1
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x49]__AllocateBuffer2=0x2
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x49]__EmptyBufferDone2=0xb
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x49]__EmptyThisBuffer1=0x3
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x49]__EmptyThisBuffer2=0x4
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x49]__FillBufferDone2=0xc
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x49]__FillThisBuffer1=0x5
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x49]__FillThisBuffer2=0x6
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x49]__FreeBuffer1=0x7
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x49]__FreeBuffer2=0x8
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x49]__UseBuffer1=0x9
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x49]__UseBuffer2=0xa
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4A]__AllocateBuffer1=0x1
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4A]__AllocateBuffer2=0x2
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4A]__EmptyBufferDone2=0xb
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4A]__EmptyThisBuffer1=0x3
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4A]__EmptyThisBuffer2=0x4
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4A]__FillBufferDone2=0xc
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4A]__FillThisBuffer1=0x5
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4A]__FillThisBuffer2=0x6
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4A]__FreeBuffer1=0x7
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4A]__FreeBuffer2=0x8
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4A]__UseBuffer1=0x9
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4A]__UseBuffer2=0xa
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4B]__AllocateBuffer1=0x1
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4B]__AllocateBuffer2=0x2
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4B]__EmptyBufferDone2=0xb
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4B]__EmptyThisBuffer1=0x3
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4B]__EmptyThisBuffer2=0x4
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4B]__FillBufferDone2=0xc
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4B]__FillThisBuffer1=0x5
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4B]__FillThisBuffer2=0x6
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4B]__FreeBuffer1=0x7
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4B]__FreeBuffer2=0x8
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4B]__UseBuffer1=0x9
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4B]__UseBuffer2=0xa
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4D]__AllocateBuffer1=0x1
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4D]__AllocateBuffer2=0x2
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4D]__EmptyBufferDone2=0xb
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4D]__EmptyThisBuffer1=0x3
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4D]__EmptyThisBuffer2=0x4
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4D]__FillBufferDone2=0xc
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4D]__FillThisBuffer1=0x5
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4D]__FillThisBuffer2=0x6
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4D]__FreeBuffer1=0x7
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4D]__FreeBuffer2=0x8
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4D]__UseBuffer1=0x9
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4D]__UseBuffer2=0xa
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4E]__AllocateBuffer1=0x1
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4E]__AllocateBuffer2=0x2
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4E]__EmptyBufferDone2=0xb
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4E]__EmptyThisBuffer1=0x3
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4E]__EmptyThisBuffer2=0x4
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4E]__FillBufferDone2=0xc
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4E]__FillThisBuffer1=0x5
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4E]__FillThisBuffer2=0x6
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4E]__FreeBuffer1=0x7
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4E]__FreeBuffer2=0x8
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4E]__UseBuffer1=0x9
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4E]__UseBuffer2=0xa
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4F]__AllocateBuffer1=0x1
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4F]__AllocateBuffer2=0x2
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4F]__EmptyBufferDone2=0xb
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4F]__EmptyThisBuffer1=0x3
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4F]__EmptyThisBuffer2=0x4
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4F]__FillBufferDone2=0xc
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4F]__FillThisBuffer1=0x5
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4F]__FillThisBuffer2=0x6
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4F]__FreeBuffer1=0x7
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4F]__FreeBuffer2=0x8
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4F]__UseBuffer1=0x9
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x4F]__UseBuffer2=0xa
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x50]__AllocateBuffer1=0x1
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x50]__AllocateBuffer2=0x2
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x50]__EmptyBufferDone2=0xb
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x50]__EmptyThisBuffer1=0x3
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x50]__EmptyThisBuffer2=0x4
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x50]__FillBufferDone2=0xc
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x50]__FillThisBuffer1=0x5
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x50]__FillThisBuffer2=0x6
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x50]__FreeBuffer1=0x7
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x50]__FreeBuffer2=0x8
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x50]__UseBuffer1=0x9
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x50]__UseBuffer2=0xa
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x51]__AllocateBuffer1=0x1
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x51]__AllocateBuffer2=0x2
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x51]__EmptyBufferDone2=0xb
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x51]__EmptyThisBuffer1=0x3
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x51]__EmptyThisBuffer2=0x4
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x51]__FillBufferDone2=0xc
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x51]__FillThisBuffer1=0x5
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x51]__FillThisBuffer2=0x6
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x51]__FreeBuffer1=0x7
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x51]__FreeBuffer2=0x8
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x51]__UseBuffer1=0x9
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x51]__UseBuffer2=0xa
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x52]__AllocateBuffer1=0x1
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x52]__AllocateBuffer2=0x2
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x52]__EmptyBufferDone2=0xb
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x52]__EmptyThisBuffer1=0x3
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x52]__EmptyThisBuffer2=0x4
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x52]__FillBufferDone2=0xc
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x52]__FillThisBuffer1=0x5
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x52]__FillThisBuffer2=0x6
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x52]__FreeBuffer1=0x7
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x52]__FreeBuffer2=0x8
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x52]__UseBuffer1=0x9
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x52]__UseBuffer2=0xa
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x53]__AllocateBuffer1=0x1
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x53]__AllocateBuffer2=0x2
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x53]__EmptyBufferDone2=0xb
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x53]__EmptyThisBuffer1=0x3
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x53]__EmptyThisBuffer2=0x4
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x53]__FillBufferDone2=0xc
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x53]__FillThisBuffer1=0x5
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x53]__FillThisBuffer2=0x6
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x53]__FreeBuffer1=0x7
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x53]__FreeBuffer2=0x8
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x53]__UseBuffer1=0x9
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x53]__UseBuffer2=0xa
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x54]__AllocateBuffer1=0x1
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x54]__AllocateBuffer2=0x2
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x54]__EmptyBufferDone2=0xb
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x54]__EmptyThisBuffer1=0x3
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x54]__EmptyThisBuffer2=0x4
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x54]__FillBufferDone2=0xc
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x54]__FillThisBuffer1=0x5
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x54]__FillThisBuffer2=0x6
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x54]__FreeBuffer1=0x7
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x54]__FreeBuffer2=0x8
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x54]__UseBuffer1=0x9
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x54]__UseBuffer2=0xa
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x55]__AllocateBuffer1=0x1
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x55]__AllocateBuffer2=0x2
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x55]__EmptyBufferDone2=0xb
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x55]__EmptyThisBuffer1=0x3
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x55]__EmptyThisBuffer2=0x4
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x55]__FillBufferDone2=0xc
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x55]__FillThisBuffer1=0x5
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x55]__FillThisBuffer2=0x6
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x55]__FreeBuffer1=0x7
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x55]__FreeBuffer2=0x8
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x55]__UseBuffer1=0x9
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x55]__UseBuffer2=0xa
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x56]__AllocateBuffer1=0x1
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x56]__AllocateBuffer2=0x2
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x56]__EmptyBufferDone2=0xb
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x56]__EmptyThisBuffer1=0x3
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x56]__EmptyThisBuffer2=0x4
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x56]__FillBufferDone2=0xc
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x56]__FillThisBuffer1=0x5
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x56]__FillThisBuffer2=0x6
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x56]__FreeBuffer1=0x7
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x56]__FreeBuffer2=0x8
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x56]__UseBuffer1=0x9
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x56]__UseBuffer2=0xa
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x57]__AllocateBuffer1=0x1
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x57]__AllocateBuffer2=0x2
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x57]__EmptyBufferDone2=0xb
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x57]__EmptyThisBuffer1=0x3
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x57]__EmptyThisBuffer2=0x4
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x57]__FillBufferDone2=0xc
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x57]__FillThisBuffer1=0x5
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x57]__FillThisBuffer2=0x6
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x57]__FreeBuffer1=0x7
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x57]__FreeBuffer2=0x8
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x57]__UseBuffer1=0x9
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x57]__UseBuffer2=0xa
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x58]__AllocateBuffer1=0x1
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x58]__AllocateBuffer2=0x2
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x58]__EmptyBufferDone2=0xb
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x58]__EmptyThisBuffer1=0x3
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x58]__EmptyThisBuffer2=0x4
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x58]__FillBufferDone2=0xc
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x58]__FillThisBuffer1=0x5
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x58]__FillThisBuffer2=0xd
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x58]__FreeBuffer1=0x7
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x58]__FreeBuffer2=0x8
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x58]__UseBuffer1=0x9
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x58]__UseBuffer2=0xa
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x5B]__AllocateBuffer1=0x1
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x5B]__AllocateBuffer2=0x2
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x5B]__EmptyBufferDone2=0xb
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x5B]__EmptyThisBuffer1=0x3
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x5B]__EmptyThisBuffer2=0x4
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x5B]__FillBufferDone2=0xc
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x5B]__FillThisBuffer1=0x5
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x5B]__FillThisBuffer2=0x6
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x5B]__FreeBuffer1=0x7
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x5B]__FreeBuffer2=0x8
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x5B]__UseBuffer1=0x9
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x5B]__UseBuffer2=0xa
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x5D]__AllocateBuffer1=0x1
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x5D]__AllocateBuffer2=0x2
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x5D]__EmptyBufferDone2=0xb
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x5D]__EmptyThisBuffer1=0x3
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x5D]__EmptyThisBuffer2=0x4
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x5D]__FillBufferDone2=0xc
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x5D]__FillThisBuffer1=0x5
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x5D]__FillThisBuffer2=0x6
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x5D]__FreeBuffer1=0x7
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x5D]__FreeBuffer2=0x8
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x5D]__UseBuffer1=0x9
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x5D]__UseBuffer2=0xa
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x5F]__AllocateBuffer1=0x1
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x5F]__AllocateBuffer2=0x2
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x5F]__EmptyBufferDone2=0xb
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x5F]__EmptyThisBuffer1=0x3
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x5F]__EmptyThisBuffer2=0x4
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x5F]__FillBufferDone2=0xc
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x5F]__FillThisBuffer1=0x5
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x5F]__FillThisBuffer2=0x6
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x5F]__FreeBuffer1=0x7
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x5F]__FreeBuffer2=0x8
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x5F]__UseBuffer1=0x9
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x5F]__UseBuffer2=0xa
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x61]__AllocateBuffer1=0x1
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x61]__AllocateBuffer2=0x2
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x61]__EmptyBufferDone2=0xb
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x61]__EmptyThisBuffer1=0x3
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x61]__EmptyThisBuffer2=0x4
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x61]__FillBufferDone2=0xc
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x61]__FillThisBuffer1=0x5
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x61]__FillThisBuffer2=0x6
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x61]__FreeBuffer1=0x7
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x61]__FreeBuffer2=0x8
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x61]__UseBuffer1=0x9
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x61]__UseBuffer2=0xa
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x62]__AllocateBuffer1=0x1
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x62]__AllocateBuffer2=0x2
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x62]__EmptyBufferDone2=0xb
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x62]__EmptyThisBuffer1=0x3
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x62]__EmptyThisBuffer2=0x4
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x62]__FillBufferDone2=0xc
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x62]__FillThisBuffer1=0x5
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x62]__FillThisBuffer2=0x6
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x62]__FreeBuffer1=0x7
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x62]__FreeBuffer2=0x8
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x62]__UseBuffer1=0x9
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x62]__UseBuffer2=0xa
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x64]__AllocateBuffer1=0x1
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x64]__AllocateBuffer2=0x2
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x64]__EmptyBufferDone2=0xb
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x64]__EmptyThisBuffer1=0x3
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x64]__EmptyThisBuffer2=0x4
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x64]__FillBufferDone2=0xc
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x64]__FillThisBuffer1=0x5
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x64]__FillThisBuffer2=0x6
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x64]__FreeBuffer1=0x7
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x64]__FreeBuffer2=0x8
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x64]__UseBuffer1=0x9
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x64]__UseBuffer2=0xa
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x67]__AllocateBuffer1=0x1
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x67]__AllocateBuffer2=0x2
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x67]__EmptyBufferDone2=0xb
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x67]__EmptyThisBuffer1=0x3
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x67]__EmptyThisBuffer2=0x4
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x67]__FillBufferDone2=0xc
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x67]__FillThisBuffer1=0x5
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x67]__FillThisBuffer2=0x6
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x67]__FreeBuffer1=0x7
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x67]__FreeBuffer2=0x8
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x67]__UseBuffer1=0x9
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x67]__UseBuffer2=0xa
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x69]__AllocateBuffer1=0x1
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x69]__AllocateBuffer2=0x2
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x69]__EmptyBufferDone2=0xb
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x69]__EmptyThisBuffer1=0x3
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x69]__EmptyThisBuffer2=0x4
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x69]__EmptyThisBuffer4=0xd
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x69]__FillBufferDone2=0xc
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x69]__FillThisBuffer1=0x5
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x69]__FillThisBuffer2=0x6
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x69]__FreeBuffer1=0x7
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x69]__FreeBuffer2=0x8
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x69]__UseBuffer1=0x9
+[[OBSOLETE]][TRACE]TRACE_API_BUFFER[0x69]__UseBuffer2=0xa
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x59]__EmptyThisBuffer3=0x4
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x59]__FillThisBuffer3=0x3
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x59]__SetConfig3=0x1
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x59]__SetParameter6=0x2
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x5A]__EmptyThisBuffer3=0x3
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x5A]__FillThisBuffer3=0x4
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x5A]__SetConfig3=0x1
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x5A]__SetParameter6=0x2
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x5C]__EmptyThisBuffer3=0x3
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x5C]__FillThisBuffer3=0x4
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x5C]__SetConfig3=0x1
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x5C]__SetParameter6=0x2
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x5E]__EmptyBufferDone3=0x8
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x5E]__EmptyThisBuffer3=0x3
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x5E]__FillBufferDone3=0x9
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x5E]__FillThisBuffer3=0x4
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x5E]__FreeBuffer3=0x7
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x5E]__GetConfig3=0x5
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x5E]__GetParameter6=0x6
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x5E]__SetConfig3=0x1
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x5E]__SetParameter6=0x2
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x60]__EmptyBufferDone3=0x8
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x60]__EmptyThisBuffer3=0x5
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x60]__FillBufferDone3=0x9
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x60]__FillThisBuffer3=0x6
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x60]__FreeBuffer3=0x7
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x60]__GetConfig3=0x1
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x60]__GetParameter6=0x3
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x60]__SetConfig3=0x2
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x60]__SetParameter6=0x4
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x63]__GetConfig3=0x1
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x63]__SetConfig3=0x2
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x65]__EmptyBufferDone3=0x5
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x65]__EmptyThisBuffer3=0x1
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x65]__FillBufferDone3=0x4
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x65]__GetParameter6=0x2
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x65]__SetParameter6=0x3
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x66]__EmptyBufferDone3=0x6
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x66]__EmptyThisBuffer3=0x4
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x66]__FillBufferDone3=0x7
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x66]__FillThisBuffer3=0x5
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x66]__GetParameter6=0x2
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x66]__SetConfig3=0x1
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x66]__SetParameter6=0x3
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x68]__EmptyBufferDone3=0x6
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x68]__EmptyThisBuffer3=0x3
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x68]__FillBufferDone3=0x7
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x68]__FillThisBuffer3=0x4
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x68]__FreeBuffer3=0x5
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x68]__GetConfig3=0x8
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x68]__GetParameter6=0x1
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x68]__SetConfig3=0x9
+[[OBSOLETE]][TRACE]TRACE_API_DUMP_STRUCT[0x68]__SetParameter6=0x2
+[[OBSOLETE]][[OBSACE_API_BUFFER[0x44]__EmptyBufferDone2=0xb
+[[OBSOLETE]]ter6=0x2
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilcore/traces/trace.properties Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,256 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<trace_properties>
+<enum name="OMX_INDEXTYPE">
+<value id="16777216">OMX_IndexComponentStartUnused</value>
+<value id="16777217">OMX_IndexParamPriorityMgmt</value>
+<value id="16777218">OMX_IndexParamAudioInit</value>
+<value id="16777219">OMX_IndexParamImageInit</value>
+<value id="16777220">OMX_IndexParamVideoInit</value>
+<value id="16777221">OMX_IndexParamOtherInit</value>
+<value id="16777222">OMX_IndexParamNumAvailableStreams</value>
+<value id="16777223">OMX_IndexParamActiveStream</value>
+<value id="16777224">OMX_IndexParamSuspensionPolicy</value>
+<value id="16777225">OMX_IndexParamComponentSuspended</value>
+<value id="16777226">OMX_IndexConfigCapturing</value>
+<value id="16777227">OMX_IndexConfigCaptureMode</value>
+<value id="16777228">OMX_IndexAutoPauseAfterCapture</value>
+<value id="16777229">OMX_IndexParamContentURI</value>
+<value id="16777230">OMX_IndexParamCustomContentPipe</value>
+<value id="16777231">OMX_IndexParamDisableResourceConcealment</value>
+<value id="16777232">OMX_IndexConfigMetadataItemCount</value>
+<value id="16777233">OMX_IndexConfigContainerNodeCount</value>
+<value id="16777234">OMX_IndexConfigMetadataItem</value>
+<value id="16777235">OMX_IndexConfigCounterNodeID</value>
+<value id="16777236">OMX_IndexParamMetadataFilterType</value>
+<value id="16777237">OMX_IndexParamMetadataKeyFilter</value>
+<value id="16777238">OMX_IndexConfigPriorityMgmt</value>
+<value id="16777239">OMX_IndexParamStandardComponentRole</value>
+<value id="33554432">OMX_IndexPortStartUnused</value>
+<value id="33554433">OMX_IndexParamPortDefinition</value>
+<value id="33554434">OMX_IndexParamCompBufferSupplier</value>
+<value id="50331648">OMX_IndexReservedStartUnused</value>
+<value id="67108864">OMX_IndexAudioStartUnused</value>
+<value id="67108865">OMX_IndexParamAudioPortFormat</value>
+<value id="67108866">OMX_IndexParamAudioPcm</value>
+<value id="67108867">OMX_IndexParamAudioAac</value>
+<value id="67108868">OMX_IndexParamAudioRa</value>
+<value id="67108869">OMX_IndexParamAudioMp3</value>
+<value id="67108870">OMX_IndexParamAudioAdpcm</value>
+<value id="67108871">OMX_IndexParamAudioG723</value>
+<value id="67108872">OMX_IndexParamAudioG729</value>
+<value id="67108873">OMX_IndexParamAudioAmr</value>
+<value id="67108874">OMX_IndexParamAudioWma</value>
+<value id="67108875">OMX_IndexParamAudioSbc</value>
+<value id="67108876">OMX_IndexParamAudioMidi</value>
+<value id="67108877">OMX_IndexParamAudioGsm_FR</value>
+<value id="67108878">OMX_IndexParamAudioMidiLoadUserSound</value>
+<value id="67108879">OMX_IndexParamAudioG726</value>
+<value id="67108880">OMX_IndexParamAudioGsm_EFR</value>
+<value id="67108881">OMX_IndexParamAudioGsm_HR</value>
+<value id="67108882">OMX_IndexParamAudioPdc_FR</value>
+<value id="67108883">OMX_IndexParamAudioPdc_EFR</value>
+<value id="67108884">OMX_IndexParamAudioPdc_HR</value>
+<value id="67108885">OMX_IndexParamAudioTdma_FR</value>
+<value id="67108886">OMX_IndexParamAudioTdma_EFR</value>
+<value id="67108887">OMX_IndexParamAudioQcelp8</value>
+<value id="67108888">OMX_IndexParamAudioQcelp13</value>
+<value id="67108889">OMX_IndexParamAudioEvrc</value>
+<value id="67108890">OMX_IndexParamAudioSmv</value>
+<value id="67108891">OMX_IndexParamAudioVorbis</value>
+<value id="67108892">OMX_IndexConfigAudioMidiImmediateEvent</value>
+<value id="67108893">OMX_IndexConfigAudioMidiControl</value>
+<value id="67108894">OMX_IndexConfigAudioMidiSoundBankProgram</value>
+<value id="67108895">OMX_IndexConfigAudioMidiStatus</value>
+<value id="67108896">OMX_IndexConfigAudioMidiMetaEvent</value>
+<value id="67108897">OMX_IndexConfigAudioMidiMetaEventData</value>
+<value id="67108898">OMX_IndexConfigAudioVolume</value>
+<value id="67108899">OMX_IndexConfigAudioBalance</value>
+<value id="67108900">OMX_IndexConfigAudioChannelMute</value>
+<value id="67108901">OMX_IndexConfigAudioMute</value>
+<value id="67108902">OMX_IndexConfigAudioLoudness</value>
+<value id="67108903">OMX_IndexConfigAudioEchoCancelation</value>
+<value id="67108904">OMX_IndexConfigAudioNoiseReduction</value>
+<value id="67108905">OMX_IndexConfigAudioBass</value>
+<value id="67108906">OMX_IndexConfigAudioTreble</value>
+<value id="67108907">OMX_IndexConfigAudioStereoWidening</value>
+<value id="67108908">OMX_IndexConfigAudioChorus</value>
+<value id="67108909">OMX_IndexConfigAudioEqualizer</value>
+<value id="67108910">OMX_IndexConfigAudioReverberation</value>
+<value id="67108911">OMX_IndexConfigAudioChannelVolume</value>
+<value id="83886080">OMX_IndexImageStartUnused</value>
+<value id="83886081">OMX_IndexParamImagePortFormat</value>
+<value id="83886082">OMX_IndexParamFlashControl</value>
+<value id="83886083">OMX_IndexConfigFocusControl</value>
+<value id="83886084">OMX_IndexParamQFactor</value>
+<value id="83886085">OMX_IndexParamQuantizationTable</value>
+<value id="83886086">OMX_IndexParamHuffmanTable</value>
+<value id="83886087">OMX_IndexConfigFlashControl</value>
+<value id="100663296">OMX_IndexVideoStartUnused</value>
+<value id="100663297">OMX_IndexParamVideoPortFormat</value>
+<value id="100663298">OMX_IndexParamVideoQuantization</value>
+<value id="100663299">OMX_IndexParamVideoFastUpdate</value>
+<value id="100663300">OMX_IndexParamVideoBitrate</value>
+<value id="100663301">OMX_IndexParamVideoMotionVector</value>
+<value id="100663302">OMX_IndexParamVideoIntraRefresh</value>
+<value id="100663303">OMX_IndexParamVideoErrorCorrection</value>
+<value id="100663304">OMX_IndexParamVideoVBSMC</value>
+<value id="100663305">OMX_IndexParamVideoMpeg2</value>
+<value id="100663306">OMX_IndexParamVideoMpeg4</value>
+<value id="100663307">OMX_IndexParamVideoWmv</value>
+<value id="100663308">OMX_IndexParamVideoRv</value>
+<value id="100663309">OMX_IndexParamVideoAvc</value>
+<value id="100663310">OMX_IndexParamVideoH263</value>
+<value id="100663311">OMX_IndexParamVideoProfileLevelQuerySupported</value>
+<value id="100663312">OMX_IndexParamVideoProfileLevelCurrent</value>
+<value id="100663313">OMX_IndexConfigVideoBitrate</value>
+<value id="100663314">OMX_IndexConfigVideoFramerate</value>
+<value id="100663315">OMX_IndexConfigVideoIntraVOPRefresh</value>
+<value id="100663316">OMX_IndexConfigVideoIntraMBRefresh</value>
+<value id="100663317">OMX_IndexConfigVideoMBErrorReporting</value>
+<value id="100663318">OMX_IndexParamVideoMacroblocksPerFrame</value>
+<value id="100663319">OMX_IndexConfigVideoMacroBlockErrorMap</value>
+<value id="100663320">OMX_IndexParamVideoSliceFMO</value>
+<value id="100663321">OMX_IndexConfigVideoAVCIntraPeriod</value>
+<value id="100663322">OMX_IndexConfigVideoNalSize</value>
+<value id="117440512">OMX_IndexCommonStartUnused</value>
+<value id="117440513">OMX_IndexParamCommonDeblocking</value>
+<value id="117440514">OMX_IndexParamCommonSensorMode</value>
+<value id="117440515">OMX_IndexParamCommonInterleave</value>
+<value id="117440516">OMX_IndexConfigCommonColorFormatConversion</value>
+<value id="117440517">OMX_IndexConfigCommonScale</value>
+<value id="117440518">OMX_IndexConfigCommonImageFilter</value>
+<value id="117440519">OMX_IndexConfigCommonColorEnhancement</value>
+<value id="117440520">OMX_IndexConfigCommonColorKey</value>
+<value id="117440521">OMX_IndexConfigCommonColorBlend</value>
+<value id="117440522">OMX_IndexConfigCommonFrameStabilisation</value>
+<value id="117440523">OMX_IndexConfigCommonRotate</value>
+<value id="117440524">OMX_IndexConfigCommonMirror</value>
+<value id="117440525">OMX_IndexConfigCommonOutputPosition</value>
+<value id="117440526">OMX_IndexConfigCommonInputCrop</value>
+<value id="117440527">OMX_IndexConfigCommonOutputCrop</value>
+<value id="117440528">OMX_IndexConfigCommonDigitalZoom</value>
+<value id="117440529">OMX_IndexConfigCommonOpticalZoom</value>
+<value id="117440530">OMX_IndexConfigCommonWhiteBalance</value>
+<value id="117440531">OMX_IndexConfigCommonExposure</value>
+<value id="117440532">OMX_IndexConfigCommonContrast</value>
+<value id="117440533">OMX_IndexConfigCommonBrightness</value>
+<value id="117440534">OMX_IndexConfigCommonBacklight</value>
+<value id="117440535">OMX_IndexConfigCommonGamma</value>
+<value id="117440536">OMX_IndexConfigCommonSaturation</value>
+<value id="117440537">OMX_IndexConfigCommonLightness</value>
+<value id="117440538">OMX_IndexConfigCommonExclusionRect</value>
+<value id="117440539">OMX_IndexConfigCommonDithering</value>
+<value id="117440540">OMX_IndexConfigCommonPlaneBlend</value>
+<value id="117440541">OMX_IndexConfigCommonExposureValue</value>
+<value id="117440542">OMX_IndexConfigCommonOutputSize</value>
+<value id="117440543">OMX_IndexParamCommonExtraQuantData</value>
+<value id="117440544">OMX_IndexConfigCommonFocusRegion</value>
+<value id="117440545">OMX_IndexConfigCommonFocusStatus</value>
+<value id="117440546">OMX_IndexConfigCommonTransitionEffect</value>
+<value id="134217728">OMX_IndexOtherStartUnused</value>
+<value id="134217729">OMX_IndexParamOtherPortFormat</value>
+<value id="134217730">OMX_IndexConfigOtherPower</value>
+<value id="134217731">OMX_IndexConfigOtherStats</value>
+<value id="150994944">OMX_IndexTimeStartUnused</value>
+<value id="150994945">OMX_IndexConfigTimeScale</value>
+<value id="150994946">OMX_IndexConfigTimeClockState</value>
+<value id="150994947">OMX_IndexConfigTimeActiveRefClock</value>
+<value id="150994948">OMX_IndexConfigTimeCurrentMediaTime</value>
+<value id="150994949">OMX_IndexConfigTimeCurrentWallTime</value>
+<value id="150994950">OMX_IndexConfigTimeCurrentAudioReference</value>
+<value id="150994951">OMX_IndexConfigTimeCurrentVideoReference</value>
+<value id="150994952">OMX_IndexConfigTimeMediaTimeRequest</value>
+<value id="150994953">OMX_IndexConfigTimeClientStartTime</value>
+<value id="150994954">OMX_IndexConfigTimePosition</value>
+<value id="150994955">OMX_IndexConfigTimeSeekMode</value>
+<value id="1862270976">OMX_IndexKhronosExtensions</value>
+<value id="2130706432">OMX_IndexVendorStartUnused</value>
+<value id="2147483647">OMX_IndexMax</value>
+</enum>
+<enum name="OMX_ERRORTYPE">
+<value id="0">O</value>
+<value id="-2147479552">OMX_ErrorInsufficientResources</value>
+<value id="-2147479551">OMX_ErrorUndefined</value>
+<value id="-2147479550">OMX_ErrorInvalidComponentName</value>
+<value id="-2147479549">OMX_ErrorComponentNotFound</value>
+<value id="-2147479548">OMX_ErrorInvalidComponent</value>
+<value id="-2147479547">OMX_ErrorBadParameter</value>
+<value id="-2147479546">OMX_ErrorNotImplemented</value>
+<value id="-2147479545">OMX_ErrorUnderflow</value>
+<value id="-2147479544">OMX_ErrorOverflow</value>
+<value id="-2147479543">OMX_ErrorHardware</value>
+<value id="-2147479542">OMX_ErrorInvalidState</value>
+<value id="-2147479541">OMX_ErrorStreamCorrupt</value>
+<value id="-2147479540">OMX_ErrorPortsNotCompatible</value>
+<value id="-2147479539">OMX_ErrorResourcesLost</value>
+<value id="-2147479538">OMX_ErrorNoMore</value>
+<value id="-2147479537">OMX_ErrorVersionMismatch</value>
+<value id="-2147479536">OMX_ErrorNotReady</value>
+<value id="-2147479535">OMX_ErrorTimeout</value>
+<value id="-2147479534">OMX_ErrorSameState</value>
+<value id="-2147479533">OMX_ErrorResourcesPreempted</value>
+<value id="-2147479532">OMX_ErrorPortUnresponsiveDuringAllocation</value>
+<value id="-2147479531">OMX_ErrorPortUnresponsiveDuringDeallocation</value>
+<value id="-2147479530">OMX_ErrorPortUnresponsiveDuringStop</value>
+<value id="-2147479529">OMX_ErrorIncorrectStateTransition</value>
+<value id="-2147479528">OMX_ErrorIncorrectStateOperation</value>
+<value id="-2147479527">OMX_ErrorUnsupportedSetting</value>
+<value id="-2147479526">OMX_ErrorUnsupportedIndex</value>
+<value id="-2147479525">OMX_ErrorBadPortIndex</value>
+<value id="-2147479524">OMX_ErrorPortUnpopulated</value>
+<value id="-2147479523">OMX_ErrorComponentSuspended</value>
+<value id="-2147479522">OMX_ErrorDynamicResourcesUnavailable</value>
+<value id="-2147479521">OMX_ErrorMbErrorsInFrame</value>
+<value id="-2147479520">OMX_ErrorFormatNotDetected</value>
+<value id="-2147479519">OMX_ErrorContentPipeOpenFailed</value>
+<value id="-2147479518">OMX_ErrorContentPipeCreationFailed</value>
+<value id="-2147479517">OMX_ErrorSeperateTablesUsed</value>
+<value id="-2147479516">OMX_ErrorTunnelingUnsupported</value>
+<value id="-1895825408">OMX_ErrorKhronosExtensions</value>
+<value id="-1879048192">OMX_ErrorVendorStartUnused</value>
+<value id="2147483647">OMX_ErrorMax</value>
+</enum>
+<enum name="OMX_COMMANDTYPE">
+<value id="0">OMX_CommandStateSet</value>
+<value id="1">OMX_CommandFlush</value>
+<value id="2">OMX_CommandPortDisable</value>
+<value id="3">OMX_CommandPortEnable</value>
+<value id="4">OMX_CommandMarkBuffer</value>
+<value id="1862270976">OMX_CommandKhronosExtensions</value>
+<value id="2130706432">OMX_CommandVendorStartUnused</value>
+<value id="2147483647">OMX_CommandMax</value>
+</enum>
+<enum name="OMX_STATETYPE">
+<value id="0">OMX_StateInvalid</value>
+<value id="1">OMX_StateLoaded</value>
+<value id="2">OMX_StateIdle</value>
+<value id="3">OMX_StateExecuting</value>
+<value id="4">OMX_StatePause</value>
+<value id="5">OMX_StateWaitForResources</value>
+<value id="1862270976">OMX_StateKhronosExtensions</value>
+<value id="2130706432">OMX_StateVendorStartUnused</value>
+<value id="2147483647">OMX_StateMax</value>
+</enum>
+<enum name="OMX_EVENTTYPE">
+<value id="0">OMX_EventCmdComplete</value>
+<value id="1">OMX_EventError</value>
+<value id="2">OMX_EventMark</value>
+<value id="3">OMX_EventPortSettingsChanged</value>
+<value id="4">OMX_EventBufferFlag</value>
+<value id="5">OMX_EventResourcesAcquired</value>
+<value id="6">OMX_EventComponentResumed</value>
+<value id="7">OMX_EventDynamicResourcesAvailable</value>
+<value id="8">OMX_EventPortFormatDetected</value>
+<value id="1862270976">OMX_EventKhronosExtensions</value>
+<value id="2130706432">OMX_EventVendorStartUnused</value>
+<value id="2147483647">OMX_EventMax</value>
+</enum>
+<enum name="OMX_BUFFERSUPPLIERTYPE">
+<value id="0">OMX_BufferSupplyUnspecified</value>
+<value id="1">OMX_BufferSupplyInput</value>
+<value id="2">OMX_BufferSupplyOutput</value>
+<value id="1862270976">OMX_BufferSupplyKhronosExtensions</value>
+<value id="2130706432">OMX_BufferSupplyVendorStartUnused</value>
+<value id="2147483647">OMX_BufferSupplyMax</value>
+</enum>
+</trace_properties>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilloader/group/bld.inf Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,28 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+PRJ_PLATFORMS
+BASEDEFAULT
+
+PRJ_MMPFILES
+// Loader
+../mmpfiles/omxilsymbianloader.mmp
+../mmpfiles/omxilcomponentif.mmp
+
+PRJ_EXPORTS
+
+// Romkit include files
+omxilloader.iby /epoc32/rom/include/omxilloader.iby
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilloader/group/omxilloader.iby Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,22 @@
+// 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 OMXILLOADER_IBY
+#define OMXILLOADER_IBY
+
+// OMX IL Loader
+ECOM_PLUGIN(omxilsymbianloader.dll, omxilsymbianloader.rsc)
+
+#endif // OMXILLOADER_IBY
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilloader/mmpfiles/omxilcomponentif.mmp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,31 @@
+// 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 omxilcomponentif.lib Library used by the OMX Core to
+// allow an OMX component to be loaded as an ECom plugin.
+//
+//
+
+TARGET omxilcomponentif.lib
+TARGETTYPE LIB
+UID 0x10285C04
+VENDORID 0x70000001
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+SOURCEPATH ../src
+SOURCE omxilsymbiancomponentif.cpp
+
+
+SMPSAFE
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilloader/mmpfiles/omxilsymbianloader.mmp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,37 @@
+// 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/omxiluids.hrh"
+
+TARGET omxilsymbianloader.dll
+CAPABILITY ALL -TCB
+TARGETTYPE PLUGIN
+UID KUidECOM KUidOmxILLoaderDll
+VENDORID 0x70000001
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+OS_LAYER_ESTLIB_SYSTEMINCLUDE
+
+SOURCEPATH ../src
+SOURCE omxilsymbiancomponentloader.cpp
+RESOURCE omxilsymbianloader.rss
+
+LIBRARY euser.lib
+LIBRARY ecom.lib
+LIBRARY estlib.lib
+
+// MACRO _OMXIL_SYMBIANLOADER_DEBUG_TRACING_ON
+
+SMPSAFE
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilloader/src/log.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,149 @@
+/*
+* 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_SYMBIANLOADER_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, "[symloader] ");
+ _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, "[symloader] ");
+ _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/omxil_generic/omxilloader/src/omxilsymbiancomponentif.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,86 @@
+// 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/loader/omxilsymbiancomponentif.h>
+
+/**
+Constructor of this interface.
+*/
+COmxILSymbianComponentIf::COmxILSymbianComponentIf()
+ {
+ }
+
+/**
+Static method to create this interface.
+The actual OMX_COMPONENTTYPE structure should be allocated and populated as part
+of the construction of this interface.
+
+@return A pointer to the newly constructed COmxILSymbianComponentIf.
+
+@internalTechnology
+*/
+COmxILSymbianComponentIf* COmxILSymbianComponentIf::NewL()
+ {
+ COmxILSymbianComponentIf* self = new (ELeave) COmxILSymbianComponentIf;
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ CleanupStack::Pop(self);
+
+ return self;
+ }
+
+/**
+Constructs and populates the OMX_COMPONENTTYPE structure encapsulated within this interface.
+*/
+void COmxILSymbianComponentIf::ConstructL()
+ {
+ ipHandle = new(ELeave) OMX_COMPONENTTYPE;
+ OMX_ERRORTYPE error = OMX_ErrorInsufficientResources;
+
+ error = ::OMX_ComponentInit(ipHandle);
+ if ( OMX_ErrorNone != error )
+ {
+ if( error == OMX_ErrorInsufficientResources )
+ {
+ User::Leave(KErrNoMemory);
+ }
+ else
+ {
+ User::Leave(KErrGeneral);
+ }
+ }
+ }
+
+/**
+Destructor of this interface.
+Deletes the component's structure.
+
+@internalTechnology
+*/
+COmxILSymbianComponentIf::~COmxILSymbianComponentIf()
+ {
+ delete ipHandle;
+ }
+
+
+/**
+Gets the valid handle of the already populated OMX_HANDLETYPE structure.
+
+@return The component's handle
+*/
+OMX_HANDLETYPE COmxILSymbianComponentIf::Handle()
+ {
+ return ipHandle;
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilloader/src/omxilsymbiancomponentloader.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,443 @@
+// 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/ecom.h>
+#include <ecom/implementationproxy.h>
+#include "omxilsymbiancomponentloader.h"
+#include "omxiluids.hrh"
+#include <openmax/il/core/omxilloaderif.h>
+#include <openmax/il/khronos/v1_x/OMX_Core.h>
+#include <openmax/il/khronos/v1_x/OMX_Component.h>
+#include <string.h>
+#include <delimitedparser8.h>
+#include <openmax/il/core/omxilloaderif.hrh>
+#include <openmax/il/loader/omxilcomponentif.hrh>
+#include "log.h"
+
+OMX_ERRORTYPE OmxInitializeComponentLoader(OMX_LOADERTYPE *loader);
+OMX_ERRORTYPE OmxUnInitializeComponentLoader(OMX_LOADERTYPE *loader);
+OMX_ERRORTYPE OmxLoadComponent( OMX_LOADERTYPE *loader,
+ OMX_OUT OMX_HANDLETYPE* pHandle,
+ OMX_IN OMX_STRING cComponentName,
+ OMX_IN OMX_PTR pAppData,
+ OMX_IN OMX_CALLBACKTYPE* pCallBacks);
+OMX_ERRORTYPE OmxUnloadComponent( OMX_LOADERTYPE *loader,
+ OMX_HANDLETYPE hComponent);
+OMX_ERRORTYPE OmxComponentNameEnum( OMX_LOADERTYPE *loader,
+ OMX_OUT OMX_STRING cComponentName,
+ OMX_IN OMX_U32 nNameLength,
+ OMX_IN OMX_U32 nIndex);
+OMX_ERRORTYPE OmxGetRolesOfComponent( OMX_LOADERTYPE *loader,
+ OMX_IN OMX_STRING compName,
+ OMX_INOUT OMX_U32 *pNumRoles,
+ OMX_OUT OMX_U8 **roles);
+OMX_ERRORTYPE OmxGetComponentsOfRole( OMX_LOADERTYPE *loader,
+ OMX_IN OMX_STRING role,
+ OMX_INOUT OMX_U32 *pNumComps,
+ OMX_INOUT OMX_U8 **compNames);
+
+
+
+OMX_ERRORTYPE OmxInitializeComponentLoader(OMX_LOADERTYPE *loader)
+ {
+ return ((CSymbianOmxComponentLoader*)((OMX_LOADERTYPE*)loader)->pLoaderPrivate)->InitializeComponentLoader();
+ }
+
+OMX_ERRORTYPE OmxUnInitializeComponentLoader(OMX_LOADERTYPE *loader)
+ {
+ return ((CSymbianOmxComponentLoader*)((OMX_LOADERTYPE*)loader)->pLoaderPrivate)->UnInitializeComponentLoader(loader);
+ }
+
+OMX_ERRORTYPE OmxLoadComponent( OMX_LOADERTYPE *loader,
+ OMX_OUT OMX_HANDLETYPE* pHandle,
+ OMX_IN OMX_STRING cComponentName,
+ OMX_IN OMX_PTR pAppData,
+ OMX_IN OMX_CALLBACKTYPE* pCallBacks)
+ {
+ return ((CSymbianOmxComponentLoader*)((OMX_LOADERTYPE*)loader)->pLoaderPrivate)->LoadComponent(pHandle,cComponentName,pAppData,pCallBacks);
+ }
+
+OMX_ERRORTYPE OmxUnloadComponent( OMX_LOADERTYPE *loader,
+ OMX_HANDLETYPE hComponent)
+ {
+ return ((CSymbianOmxComponentLoader*)((OMX_LOADERTYPE*)loader)->pLoaderPrivate)->UnloadComponent(hComponent);
+ }
+
+OMX_ERRORTYPE OmxComponentNameEnum( OMX_LOADERTYPE *loader,
+ OMX_OUT OMX_STRING cComponentName,
+ OMX_IN OMX_U32 nNameLength,
+ OMX_IN OMX_U32 nIndex)
+ {
+ return ((CSymbianOmxComponentLoader*)((OMX_LOADERTYPE*)loader)->pLoaderPrivate)->ComponentNameEnum(cComponentName,nNameLength,nIndex);
+ }
+
+OMX_ERRORTYPE OmxGetRolesOfComponent( OMX_LOADERTYPE *loader,
+ OMX_IN OMX_STRING compName,
+ OMX_INOUT OMX_U32 *pNumRoles,
+ OMX_OUT OMX_U8 **roles)
+ {
+ return ((CSymbianOmxComponentLoader*)((OMX_LOADERTYPE*)loader)->pLoaderPrivate)->GetRolesOfComponent(compName,pNumRoles,roles);
+ }
+
+OMX_ERRORTYPE OmxGetComponentsOfRole( OMX_LOADERTYPE *loader,
+ OMX_IN OMX_STRING role,
+ OMX_INOUT OMX_U32 *pNumComps,
+ OMX_INOUT OMX_U8 **compNames)
+ {
+ return ((CSymbianOmxComponentLoader*)((OMX_LOADERTYPE*)loader)->pLoaderPrivate)->GetComponentsOfRole(role,pNumComps,compNames);
+ }
+
+OMX_ERRORTYPE CSymbianOmxComponentLoader::InitializeComponentLoader()
+ {
+ RImplInfoPtrArray ecomArray;
+ TRAPD(error,REComSession::ListImplementationsL(TUid::Uid(KUidOmxILSymbianComponentIf),ecomArray));
+ if( error != KErrNone )
+ {
+ ecomArray.ResetAndDestroy();
+ return OMX_ErrorInsufficientResources;
+ }
+ TInt index;
+ CImplementationInformation* info;
+
+ TOmxComponentInfo component;
+
+ iComponentNameList.Reset();
+
+ const TInt KEcomArrayCount = ecomArray.Count();
+ for( index=0; index<KEcomArrayCount && error == KErrNone; ++index )
+ {
+ info = ecomArray[index];
+ component.iUid = info->ImplementationUid();
+ if( info->DisplayName().Length() >= OMX_MAX_STRINGNAME_SIZE ||
+ info->DataType().Length() >= OMX_MAX_ROLESBUFFER_SIZE )
+ {
+ error = KErrBadName;
+ break;
+ }
+
+ component.iComponentName.Copy(info->DisplayName());
+ component.iRoles.Copy(info->DataType());
+
+ error = iComponentNameList.Append(component);
+ if(error)
+ {
+ break;
+ }
+ }
+ ecomArray.ResetAndDestroy();
+ if( error != KErrNone )
+ {
+ if( error == KErrNoMemory )
+ {
+ return OMX_ErrorInsufficientResources;
+ }
+
+ return OMX_ErrorUndefined;
+ }
+ return OMX_ErrorNone;
+ }
+
+OMX_ERRORTYPE CSymbianOmxComponentLoader::UnInitializeComponentLoader(OMX_LOADERTYPE * /*loader*/)
+ {
+ iComponentNameList.Reset();
+ iComponents.ResetAndDestroy();
+ return OMX_ErrorNone;
+ }
+
+OMX_ERRORTYPE CSymbianOmxComponentLoader::LoadComponent( OMX_HANDLETYPE* pHandle,
+ OMX_STRING cComponentName,
+ OMX_PTR pAppData,
+ OMX_CALLBACKTYPE* pCallBacks)
+ {
+ TInt index;
+ TPtrC8 lComponentName(reinterpret_cast<TUint8 *>(cComponentName), strlen(cComponentName));
+ COmxILComponentIf* component = NULL;
+ OMX_ERRORTYPE error = OMX_ErrorComponentNotFound;
+
+ const TInt KComponentNameListCount = iComponentNameList.Count();
+ for( index = 0; index < KComponentNameListCount; ++index )
+ {
+ TOmxComponentInfo& comp = iComponentNameList[index];
+ DEBUG_PRINTF3(_L8("CSymbianOmxComponentLoader::LoadComponent : comp [%index] [%S]"), index, &comp.iComponentName);
+ if( comp.iComponentName.CompareF(lComponentName) == 0 )
+ {
+ TRAPD(err, component = COmxILComponentIf::CreateImplementationL(iComponentNameList[index].iUid));
+ if( err != KErrNone )
+ {
+ if ( err == KErrNoMemory )
+ {
+ return OMX_ErrorInsufficientResources;
+ }
+ else
+ {
+ return OMX_ErrorInvalidComponent;
+ }
+ }
+
+ *pHandle = component->Handle();
+ if( !*pHandle )
+ {
+ return OMX_ErrorInvalidComponent;
+ }
+
+ error = (static_cast<OMX_COMPONENTTYPE*>(*pHandle))->SetCallbacks(*pHandle, pCallBacks, pAppData);
+
+ if(error != OMX_ErrorNone)
+ {
+ (static_cast<OMX_COMPONENTTYPE*>(*pHandle))->ComponentDeInit(*pHandle);
+ delete component;
+ return error;
+ }
+ if( iComponents.Append(component) != KErrNone )
+ {
+ (static_cast<OMX_COMPONENTTYPE*>(*pHandle))->ComponentDeInit(*pHandle);
+ delete component;
+ return OMX_ErrorInsufficientResources;
+ }
+ return error;
+ }
+ }
+ return error;
+ }
+
+OMX_ERRORTYPE CSymbianOmxComponentLoader::UnloadComponent( OMX_HANDLETYPE hComponent)
+ {
+ TInt index;
+ COmxILComponentIf* component;
+
+ const TInt KComponentsCount = iComponents.Count();
+ for( index = 0; index < KComponentsCount; ++index )
+ {
+ component = iComponents[index];
+ if( component->Handle() == hComponent )
+ {
+ (static_cast<OMX_COMPONENTTYPE*>(hComponent))->ComponentDeInit( hComponent );
+ delete component;
+ iComponents.Remove(index);
+ return OMX_ErrorNone;
+ }
+ }
+ return OMX_ErrorComponentNotFound;
+ }
+
+OMX_ERRORTYPE CSymbianOmxComponentLoader::ComponentNameEnum( OMX_STRING aComponentName,
+ OMX_U32 aNameLength,
+ OMX_U32 aIndex)
+ {
+ ASSERT(aComponentName);
+
+ const TInt KIndexForPopulateList = 0;
+ if ( aIndex == KIndexForPopulateList )
+ {
+ RImplInfoPtrArray ecomArray;
+ TRAPD(error, REComSession::ListImplementationsL(TUid::Uid(KUidOmxILSymbianComponentIf), ecomArray));
+ if (error != KErrNone)
+ {
+ return OMX_ErrorUndefined;
+ }
+ TInt index;
+ iComponentNameList.Reset();
+
+ const TInt KEcomArrayCount = ecomArray.Count();
+ // Create Controller Implementation Information for each entry
+ for (index=0; index<KEcomArrayCount; ++index)
+ {
+ CImplementationInformation& info = *(ecomArray[index]);
+ TOmxComponentInfo component;
+
+ component.iUid = info.ImplementationUid();
+ if( info.DisplayName().Length() >= OMX_MAX_STRINGNAME_SIZE ||
+ info.DataType().Length() >= OMX_MAX_ROLESBUFFER_SIZE )
+ {
+ error = KErrBadName;
+ break;
+ }
+ component.iComponentName.Copy(info.DisplayName());
+ component.iRoles.Copy(info.DataType());
+ error = iComponentNameList.Append(component);
+ if( error != KErrNone )
+ {
+ break;
+ }
+ }
+ ecomArray.ResetAndDestroy();
+ if( error != KErrNone )
+ {
+ return OMX_ErrorUndefined;
+ }
+ }
+ if (aIndex<iComponentNameList.Count())
+ {
+ TOmxComponentInfo& comp = iComponentNameList[aIndex];
+ TPtr8 ptr((TUint8*)aComponentName, 0, aNameLength);
+ ptr.Copy(comp.iComponentName);
+ ptr.PtrZ();
+ }
+ else
+ {
+ return OMX_ErrorNoMore;
+ }
+ return OMX_ErrorNone;
+ }
+
+OMX_ERRORTYPE CSymbianOmxComponentLoader::GetRolesOfComponent( OMX_STRING compName,
+ OMX_U32 *pNumRoles,
+ OMX_U8 **roles)
+ {
+ TInt index, roleindex;
+
+ ASSERT(pNumRoles);
+ if( !compName )
+ {
+ return OMX_ErrorBadParameter;
+ }
+
+ TPtrC8 tComponentName(reinterpret_cast<TUint8 *>(compName), strlen(compName));
+
+ OMX_ERRORTYPE error = OMX_ErrorInvalidComponentName;
+ const TInt KComponentNameListCount = iComponentNameList.Count();
+ for( index = 0, roleindex = 0; index < KComponentNameListCount; ++index )
+ {
+ if( iComponentNameList[index].iComponentName.Compare(tComponentName) == 0 )
+ {
+ char parser[OMX_MAX_ROLESBUFFER_SIZE], *p;
+ size_t size;
+ TInt i, j;
+
+ size = iComponentNameList[index].iRoles.Length();
+
+ strncpy(parser,
+ reinterpret_cast<char*>(const_cast<unsigned char*>(iComponentNameList[index].iRoles.Ptr())),
+ size);
+ parser[size]=0;
+
+ for( i=0, j=0, p=parser; i<size; ++i, ++j, ++p )
+ {
+ if( *p == ',' )
+ {
+ if( roles && (roleindex < *pNumRoles) )
+ {
+ roles[roleindex][j] = 0;
+ }
+ if( i < size )
+ {
+ ++roleindex;
+ j=-1;
+ }
+ }
+ else
+ {
+ if( roles && (roleindex < *pNumRoles) )
+ {
+ roles[roleindex][j] = *p;
+ }
+ }
+ }
+ if( roles && (roleindex < *pNumRoles) )
+ {
+ roles[roleindex][j] = 0;
+ }
+ ++roleindex;
+ error = OMX_ErrorNone;
+ break;
+ }
+ }
+ *pNumRoles = roleindex;
+ return error;
+ }
+
+OMX_ERRORTYPE CSymbianOmxComponentLoader::GetComponentsOfRole( OMX_STRING role,
+ OMX_U32 *pNumComps,
+ OMX_U8 **compNames)
+ {
+ TInt index, compindex;
+ TPtrC8 lRole(reinterpret_cast<TUint8 *>(role), strlen(role));
+
+ ASSERT(pNumComps);
+
+ TInt KComponentNameListCount = iComponentNameList.Count();
+ for( index = 0, compindex = 0; index < KComponentNameListCount; ++index )
+ {
+ if( iComponentNameList[index].iRoles.Find(lRole) != KErrNotFound )
+ {
+ if( compNames != NULL )
+ {
+ if( compNames[compindex]!= NULL )
+ {
+ strncpy((char*)compNames[compindex],(char*)iComponentNameList[index].iComponentName.Ptr(),iComponentNameList[index].iComponentName.Length());
+ compNames[compindex][iComponentNameList[index].iComponentName.Size()]=0;
+ }
+ else
+ {
+ return OMX_ErrorBadParameter;
+ }
+ }
+ ++compindex;
+ }
+ }
+ *pNumComps = compindex;
+ return OMX_ErrorNone;
+ }
+
+OMX_HANDLETYPE CSymbianOmxComponentLoader::Handle()
+ {
+ return iHandle;
+ }
+
+CSymbianOmxComponentLoader::CSymbianOmxComponentLoader()
+ {
+ }
+
+CSymbianOmxComponentLoader::~CSymbianOmxComponentLoader()
+ {
+ delete iHandle;
+ }
+
+void CSymbianOmxComponentLoader::ConstructL()
+ {
+ iHandle = new(ELeave) OMX_LOADERTYPE;
+
+ iHandle->InitializeComponentLoader = &::OmxInitializeComponentLoader;
+ iHandle->UnInitializeComponentLoader = &::OmxUnInitializeComponentLoader;
+ iHandle->LoadComponent = &::OmxLoadComponent;
+ iHandle->UnloadComponent = &::OmxUnloadComponent;
+ iHandle->ComponentNameEnum = &::OmxComponentNameEnum;
+ iHandle->GetRolesOfComponent = &::OmxGetRolesOfComponent;
+ iHandle->GetComponentsOfRole = &::OmxGetComponentsOfRole;
+
+ iHandle->pLoaderPrivate = this;
+ }
+
+CSymbianOmxComponentLoader* CSymbianOmxComponentLoader::NewL()
+ {
+ CSymbianOmxComponentLoader* self = new(ELeave) CSymbianOmxComponentLoader;
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ CleanupStack::Pop();
+
+ return self;
+ }
+
+// ECOM
+const TImplementationProxy ImplementationTable[] =
+ {
+ IMPLEMENTATION_PROXY_ENTRY(KUidOmxILSymbianComponentLoader, CSymbianOmxComponentLoader::NewL),
+ };
+
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+ {
+ aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+ return ImplementationTable;
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilloader/src/omxilsymbiancomponentloader.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,79 @@
+// 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 OMXILSYMBIANCOMPONENTLOADER_H
+#define OMXILSYMBIANCOMPONENTLOADER_H
+
+#include <e32base.h>
+#include <e32des8.h>
+#include <openmax/il/loader/OMX_Loader.h>
+#include <openmax/il/loader/omxilcomponentif.h>
+#include <openmax/il/core/omxilloaderif.h>
+
+class CSymbianOmxComponentLoader : private COmxComponentLoaderIf
+ {
+public:
+ class TOmxComponentInfo
+ {
+ public:
+ TOmxComponentInfo();
+ public:
+ TUid iUid;
+ TBuf8<OMX_MAX_STRINGNAME_SIZE> iComponentName;
+ TBuf8<OMX_MAX_ROLESBUFFER_SIZE> iRoles;
+ };
+
+public:
+ OMX_HANDLETYPE Handle();
+
+ static CSymbianOmxComponentLoader* NewL();
+
+ ~CSymbianOmxComponentLoader();
+
+ OMX_ERRORTYPE InitializeComponentLoader();
+ OMX_ERRORTYPE UnInitializeComponentLoader(OMX_LOADERTYPE* loader);
+ OMX_ERRORTYPE LoadComponent( OMX_HANDLETYPE* pHandle,
+ const OMX_STRING cComponentName,
+ OMX_PTR pAppData,
+ OMX_CALLBACKTYPE* pCallBacks );
+ OMX_ERRORTYPE UnloadComponent( OMX_HANDLETYPE hComponent );
+ OMX_ERRORTYPE ComponentNameEnum( OMX_STRING cComponentName,
+ OMX_U32 nNameLength,
+ const OMX_U32 nIndex );
+ OMX_ERRORTYPE GetRolesOfComponent( const OMX_STRING compName,
+ OMX_U32* pNumRoles,
+ OMX_U8** roles );
+ OMX_ERRORTYPE GetComponentsOfRole( const OMX_STRING role,
+ OMX_U32* pNumComps,
+ OMX_U8** compNames );
+
+private:
+ CSymbianOmxComponentLoader();
+ void ConstructL();
+
+private:
+ OMX_LOADERTYPE* iHandle;
+
+ RArray<TOmxComponentInfo> iComponentNameList;
+ RPointerArray<COmxILComponentIf> iComponents;
+ };
+
+inline CSymbianOmxComponentLoader::TOmxComponentInfo::TOmxComponentInfo():
+ iUid(TUid::Uid(0)),iComponentName(0),iRoles(0)
+ {
+ }
+
+
+#endif /*OMXILSYMBIANCOMPONENTLOADER_H*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilloader/src/omxilsymbianloader.rss Wed Aug 25 12:40:50 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:
+// omxilloader.rss
+//
+//
+
+#include <ecom/registryinfo.rh>
+#include "omxiluids.hrh"
+#include <openmax/il/core/omxilloaderif.hrh>
+
+RESOURCE REGISTRY_INFO theInfo
+ {
+ dll_uid = KUidOmxILLoaderDll;
+ interfaces =
+ {
+ INTERFACE_INFO
+ {
+ interface_uid = KUidOmxILLoaderInterface;
+ implementations =
+ {
+ IMPLEMENTATION_INFO
+ {
+ implementation_uid = KUidOmxILSymbianComponentLoader;
+ version_no = 1;
+ display_name = "";
+ default_data = "" ;
+ opaque_data = "";
+ }
+ };
+ }
+ };
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/omxil_generic/omxilloader/src/omxiluids.hrh Wed Aug 25 12:40:50 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:
+//
+
+#ifndef OMXILUIDS_HRH
+#define OMXILUIDS_HRH
+
+#define KUidECOM 0x10009D8D
+
+// OpenMax IL Loader Static Library
+#define KUidOmxILLoaderLib 0x1028349E
+
+// Symbian OpenMax IL loader
+#define KUidOmxILLoaderDll 0x102834CF
+#define KUidOmxILSymbianComponentLoader 0x102834D0
+
+#if 0
+#define KSharedLibraryUidDefine 0x1000008D
+
+// OpenMax IL Core client library
+#define KUidOmxILCoreClientDll 0x1028349C
+
+// OpenMax IL Core server library
+#define KUidOmxILCoreServerDll 0x10285D1E
+
+
+
+// Symbian OpenMax IL Content Pipe Interface
+#define KUidOmxILSymbianContentPipeIfLib 0x102834B8
+
+#endif
+#endif /*OMXILUIDS_HRH*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/khronos_api/group/bld.inf Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,16 @@
+// 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 "../v1_1_2/group/bld.inf"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/khronos_api/v1_1_2/OMX_Audio.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,1312 @@
+/*
+ * Copyright (c) 2008 The Khronos Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject
+ * to the following conditions:
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+/** @file
+ * OpenMax IL version 1.1.2
+ * The structures needed by Audio components to exchange
+ * parameters and configuration data with the componenmilts.
+ */
+
+#ifndef OMX_Audio_h
+#define OMX_Audio_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/* Each OMX header must include all required header files to allow the
+ * header to compile without errors. The includes below are required
+ * for this header file to compile successfully
+ */
+
+#include <openmax/il/khronos/v1_x/OMX_Core.h>
+
+/** @defgroup midi MIDI
+ * @ingroup audio
+ */
+
+/** @defgroup effects Audio effects
+ * @ingroup audio
+ */
+
+/** @defgroup audio OpenMAX IL Audio Domain
+ * Structures for OpenMAX IL Audio domain
+ * @{
+ */
+
+/** Enumeration used to define the possible audio codings.
+ * If "OMX_AUDIO_CodingUnused" is selected, the coding selection must
+ * be done in a vendor specific way. Since this is for an audio
+ * processing element this enum is relevant. However, for another
+ * type of component other enums would be in this area.
+ */
+typedef enum OMX_AUDIO_CODINGTYPE {
+ OMX_AUDIO_CodingUnused = 0, /**< Placeholder value when coding is N/A */
+ OMX_AUDIO_CodingAutoDetect, /**< auto detection of audio format */
+ OMX_AUDIO_CodingPCM, /**< Any variant of PCM coding */
+ OMX_AUDIO_CodingADPCM, /**< Any variant of ADPCM encoded data */
+ OMX_AUDIO_CodingAMR, /**< Any variant of AMR encoded data */
+ OMX_AUDIO_CodingGSMFR, /**< Any variant of GSM fullrate (i.e. GSM610) */
+ OMX_AUDIO_CodingGSMEFR, /**< Any variant of GSM Enhanced Fullrate encoded data*/
+ OMX_AUDIO_CodingGSMHR, /**< Any variant of GSM Halfrate encoded data */
+ OMX_AUDIO_CodingPDCFR, /**< Any variant of PDC Fullrate encoded data */
+ OMX_AUDIO_CodingPDCEFR, /**< Any variant of PDC Enhanced Fullrate encoded data */
+ OMX_AUDIO_CodingPDCHR, /**< Any variant of PDC Halfrate encoded data */
+ OMX_AUDIO_CodingTDMAFR, /**< Any variant of TDMA Fullrate encoded data (TIA/EIA-136-420) */
+ OMX_AUDIO_CodingTDMAEFR, /**< Any variant of TDMA Enhanced Fullrate encoded data (TIA/EIA-136-410) */
+ OMX_AUDIO_CodingQCELP8, /**< Any variant of QCELP 8kbps encoded data */
+ OMX_AUDIO_CodingQCELP13, /**< Any variant of QCELP 13kbps encoded data */
+ OMX_AUDIO_CodingEVRC, /**< Any variant of EVRC encoded data */
+ OMX_AUDIO_CodingSMV, /**< Any variant of SMV encoded data */
+ OMX_AUDIO_CodingG711, /**< Any variant of G.711 encoded data */
+ OMX_AUDIO_CodingG723, /**< Any variant of G.723 dot 1 encoded data */
+ OMX_AUDIO_CodingG726, /**< Any variant of G.726 encoded data */
+ OMX_AUDIO_CodingG729, /**< Any variant of G.729 encoded data */
+ OMX_AUDIO_CodingAAC, /**< Any variant of AAC encoded data */
+ OMX_AUDIO_CodingMP3, /**< Any variant of MP3 encoded data */
+ OMX_AUDIO_CodingSBC, /**< Any variant of SBC encoded data */
+ OMX_AUDIO_CodingVORBIS, /**< Any variant of VORBIS encoded data */
+ OMX_AUDIO_CodingWMA, /**< Any variant of WMA encoded data */
+ OMX_AUDIO_CodingRA, /**< Any variant of RA encoded data */
+ OMX_AUDIO_CodingMIDI, /**< Any variant of MIDI encoded data */
+ OMX_AUDIO_CodingKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_CodingMax = 0x7FFFFFFF
+} OMX_AUDIO_CODINGTYPE;
+
+
+/** The PortDefinition structure is used to define all of the parameters
+ * necessary for the compliant component to setup an input or an output audio
+ * path. If additional information is needed to define the parameters of the
+ * port (such as frequency), additional structures must be sent such as the
+ * OMX_AUDIO_PARAM_PCMMODETYPE structure to supply the extra parameters for the port.
+ */
+typedef struct OMX_AUDIO_PORTDEFINITIONTYPE {
+ OMX_STRING cMIMEType; /**< MIME type of data for the port */
+ OMX_NATIVE_DEVICETYPE pNativeRender; /** < platform specific reference
+ for an output device,
+ otherwise this field is 0 */
+ OMX_BOOL bFlagErrorConcealment; /**< Turns on error concealment if it is
+ supported by the OMX component */
+ OMX_AUDIO_CODINGTYPE eEncoding; /**< Type of data expected for this
+ port (e.g. PCM, AMR, MP3, etc) */
+} OMX_AUDIO_PORTDEFINITIONTYPE;
+
+
+/** Port format parameter. This structure is used to enumerate
+ * the various data input/output format supported by the port.
+ */
+typedef struct OMX_AUDIO_PARAM_PORTFORMATTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Indicates which port to set */
+ OMX_U32 nIndex; /**< Indicates the enumeration index for the format from 0x0 to N-1 */
+ OMX_AUDIO_CODINGTYPE eEncoding; /**< Type of data expected for this port (e.g. PCM, AMR, MP3, etc) */
+} OMX_AUDIO_PARAM_PORTFORMATTYPE;
+
+
+/** PCM mode type */
+typedef enum OMX_AUDIO_PCMMODETYPE {
+ OMX_AUDIO_PCMModeLinear = 0, /**< Linear PCM encoded data */
+ OMX_AUDIO_PCMModeALaw, /**< A law PCM encoded data (G.711) */
+ OMX_AUDIO_PCMModeMULaw, /**< Mu law PCM encoded data (G.711) */
+ OMX_AUDIO_PCMModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_PCMModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_PCMModeMax = 0x7FFFFFFF
+} OMX_AUDIO_PCMMODETYPE;
+
+
+typedef enum OMX_AUDIO_CHANNELTYPE {
+ OMX_AUDIO_ChannelNone = 0x0, /**< Unused or empty */
+ OMX_AUDIO_ChannelLF = 0x1, /**< Left front */
+ OMX_AUDIO_ChannelRF = 0x2, /**< Right front */
+ OMX_AUDIO_ChannelCF = 0x3, /**< Center front */
+ OMX_AUDIO_ChannelLS = 0x4, /**< Left surround */
+ OMX_AUDIO_ChannelRS = 0x5, /**< Right surround */
+ OMX_AUDIO_ChannelLFE = 0x6, /**< Low frequency effects */
+ OMX_AUDIO_ChannelCS = 0x7, /**< Back surround */
+ OMX_AUDIO_ChannelLR = 0x8, /**< Left rear. */
+ OMX_AUDIO_ChannelRR = 0x9, /**< Right rear. */
+ OMX_AUDIO_ChannelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_ChannelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_ChannelMax = 0x7FFFFFFF
+} OMX_AUDIO_CHANNELTYPE;
+
+#define OMX_AUDIO_MAXCHANNELS 16 /**< maximum number distinct audio channels that a buffer may contain */
+#define OMX_MIN_PCMPAYLOAD_MSEC 5 /**< Minimum audio buffer payload size for uncompressed (PCM) audio */
+
+/** PCM format description */
+typedef struct OMX_AUDIO_PARAM_PCMMODETYPE {
+ 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_U32 nChannels; /**< Number of channels (e.g. 2 for stereo) */
+ OMX_NUMERICALDATATYPE eNumData; /**< indicates PCM data as signed or unsigned */
+ OMX_ENDIANTYPE eEndian; /**< indicates PCM data as little or big endian */
+ OMX_BOOL bInterleaved; /**< True for normal interleaved data; false for
+ non-interleaved data (e.g. block data) */
+ OMX_U32 nBitPerSample; /**< Bit per sample */
+ OMX_U32 nSamplingRate; /**< Sampling rate of the source data. Use 0 for
+ variable or unknown sampling rate. */
+ OMX_AUDIO_PCMMODETYPE ePCMMode; /**< PCM mode enumeration */
+ OMX_AUDIO_CHANNELTYPE eChannelMapping[OMX_AUDIO_MAXCHANNELS]; /**< Slot i contains channel defined by eChannelMap[i] */
+
+} OMX_AUDIO_PARAM_PCMMODETYPE;
+
+
+/** Audio channel mode. This is used by both AAC and MP3, although the names are more appropriate
+ * for the MP3. For example, JointStereo for MP3 is CouplingChannels for AAC.
+ */
+typedef enum OMX_AUDIO_CHANNELMODETYPE {
+ OMX_AUDIO_ChannelModeStereo = 0, /**< 2 channels, the bitrate allocation between those
+ two channels changes accordingly to each channel information */
+ OMX_AUDIO_ChannelModeJointStereo, /**< mode that takes advantage of what is common between
+ 2 channels for higher compression gain */
+ OMX_AUDIO_ChannelModeDual, /**< 2 mono-channels, each channel is encoded with half
+ the bitrate of the overall bitrate */
+ OMX_AUDIO_ChannelModeMono, /**< Mono channel mode */
+ OMX_AUDIO_ChannelModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_ChannelModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_ChannelModeMax = 0x7FFFFFFF
+} OMX_AUDIO_CHANNELMODETYPE;
+
+
+typedef enum OMX_AUDIO_MP3STREAMFORMATTYPE {
+ OMX_AUDIO_MP3StreamFormatMP1Layer3 = 0, /**< MP3 Audio MPEG 1 Layer 3 Stream format */
+ OMX_AUDIO_MP3StreamFormatMP2Layer3, /**< MP3 Audio MPEG 2 Layer 3 Stream format */
+ OMX_AUDIO_MP3StreamFormatMP2_5Layer3, /**< MP3 Audio MPEG2.5 Layer 3 Stream format */
+ OMX_AUDIO_MP3StreamFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_MP3StreamFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_MP3StreamFormatMax = 0x7FFFFFFF
+} OMX_AUDIO_MP3STREAMFORMATTYPE;
+
+/** MP3 params */
+typedef struct OMX_AUDIO_PARAM_MP3TYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels */
+ OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable
+ rate or unknown bit rates */
+ OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for
+ variable or unknown sampling rate. */
+ OMX_U32 nAudioBandWidth; /**< Audio band width (in Hz) to which an encoder should
+ limit the audio signal. Use 0 to let encoder decide */
+ OMX_AUDIO_CHANNELMODETYPE eChannelMode; /**< Channel mode enumeration */
+ OMX_AUDIO_MP3STREAMFORMATTYPE eFormat; /**< MP3 stream format */
+} OMX_AUDIO_PARAM_MP3TYPE;
+
+
+typedef enum OMX_AUDIO_AACSTREAMFORMATTYPE {
+ OMX_AUDIO_AACStreamFormatMP2ADTS = 0, /**< AAC Audio Data Transport Stream 2 format */
+ OMX_AUDIO_AACStreamFormatMP4ADTS, /**< AAC Audio Data Transport Stream 4 format */
+ OMX_AUDIO_AACStreamFormatMP4LOAS, /**< AAC Low Overhead Audio Stream format */
+ OMX_AUDIO_AACStreamFormatMP4LATM, /**< AAC Low overhead Audio Transport Multiplex */
+ OMX_AUDIO_AACStreamFormatADIF, /**< AAC Audio Data Interchange Format */
+ OMX_AUDIO_AACStreamFormatMP4FF, /**< AAC inside MPEG-4/ISO File Format */
+ OMX_AUDIO_AACStreamFormatRAW, /**< AAC Raw Format */
+ OMX_AUDIO_AACStreamFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_AACStreamFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_AACStreamFormatMax = 0x7FFFFFFF
+} OMX_AUDIO_AACSTREAMFORMATTYPE;
+
+
+/** AAC mode type. Note that the term profile is used with the MPEG-2
+ * standard and the term object type and profile is used with MPEG-4 */
+typedef enum OMX_AUDIO_AACPROFILETYPE{
+ OMX_AUDIO_AACObjectNull = 0, /**< Null, not used */
+ OMX_AUDIO_AACObjectMain = 1, /**< AAC Main object */
+ OMX_AUDIO_AACObjectLC, /**< AAC Low Complexity object (AAC profile) */
+ OMX_AUDIO_AACObjectSSR, /**< AAC Scalable Sample Rate object */
+ OMX_AUDIO_AACObjectLTP, /**< AAC Long Term Prediction object */
+ OMX_AUDIO_AACObjectHE, /**< AAC High Efficiency (object type SBR, HE-AAC profile) */
+ OMX_AUDIO_AACObjectScalable, /**< AAC Scalable object */
+ OMX_AUDIO_AACObjectERLC = 17, /**< ER AAC Low Complexity object (Error Resilient AAC-LC) */
+ OMX_AUDIO_AACObjectLD = 23, /**< AAC Low Delay object (Error Resilient) */
+ OMX_AUDIO_AACObjectHE_PS = 29, /**< AAC High Efficiency with Parametric Stereo coding (HE-AAC v2, object type PS) */
+ OMX_AUDIO_AACObjectKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_AACObjectVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_AACObjectMax = 0x7FFFFFFF
+} OMX_AUDIO_AACPROFILETYPE;
+
+
+/** AAC tool usage (for nAACtools in OMX_AUDIO_PARAM_AACPROFILETYPE).
+ * Required for encoder configuration and optional as decoder info output.
+ * For MP3, OMX_AUDIO_CHANNELMODETYPE is sufficient. */
+#define OMX_AUDIO_AACToolNone 0x00000000 /**< no AAC tools allowed (encoder config) or active (decoder info output) */
+#define OMX_AUDIO_AACToolMS 0x00000001 /**< MS: Mid/side joint coding tool allowed or active */
+#define OMX_AUDIO_AACToolIS 0x00000002 /**< IS: Intensity stereo tool allowed or active */
+#define OMX_AUDIO_AACToolTNS 0x00000004 /**< TNS: Temporal Noise Shaping tool allowed or active */
+#define OMX_AUDIO_AACToolPNS 0x00000008 /**< PNS: MPEG-4 Perceptual Noise substitution tool allowed or active */
+#define OMX_AUDIO_AACToolLTP 0x00000010 /**< LTP: MPEG-4 Long Term Prediction tool allowed or active */
+#define OMX_AUDIO_AACToolAll 0x7FFFFFFF /**< all AAC tools allowed or active (*/
+
+/** MPEG-4 AAC error resilience (ER) tool usage (for nAACERtools in OMX_AUDIO_PARAM_AACPROFILETYPE).
+ * Required for ER encoder configuration and optional as decoder info output */
+#define OMX_AUDIO_AACERNone 0x00000000 /**< no AAC ER tools allowed/used */
+#define OMX_AUDIO_AACERVCB11 0x00000001 /**< VCB11: Virtual Code Books for AAC section data */
+#define OMX_AUDIO_AACERRVLC 0x00000002 /**< RVLC: Reversible Variable Length Coding */
+#define OMX_AUDIO_AACERHCR 0x00000004 /**< HCR: Huffman Codeword Reordering */
+#define OMX_AUDIO_AACERAll 0x7FFFFFFF /**< all AAC ER tools allowed/used */
+
+
+/** AAC params */
+typedef struct OMX_AUDIO_PARAM_AACPROFILETYPE {
+ 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_U32 nChannels; /**< Number of channels */
+ OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for
+ variable or unknown sampling rate. */
+ OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable
+ rate or unknown bit rates */
+ OMX_U32 nAudioBandWidth; /**< Audio band width (in Hz) to which an encoder should
+ limit the audio signal. Use 0 to let encoder decide */
+ OMX_U32 nFrameLength; /**< Frame length (in audio samples per channel) of the codec.
+ Can be 1024 or 960 (AAC-LC), 2048 (HE-AAC), 480 or 512 (AAC-LD).
+ Use 0 to let encoder decide */
+ OMX_U32 nAACtools; /**< AAC tool usage */
+ OMX_U32 nAACERtools; /**< MPEG-4 AAC error resilience tool usage */
+ OMX_AUDIO_AACPROFILETYPE eAACProfile; /**< AAC profile enumeration */
+ OMX_AUDIO_AACSTREAMFORMATTYPE eAACStreamFormat; /**< AAC stream format enumeration */
+ OMX_AUDIO_CHANNELMODETYPE eChannelMode; /**< Channel mode enumeration */
+} OMX_AUDIO_PARAM_AACPROFILETYPE;
+
+
+/** VORBIS params */
+typedef struct OMX_AUDIO_PARAM_VORBISTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels */
+ OMX_U32 nBitRate; /**< Bit rate of the encoded data data. Use 0 for variable
+ rate or unknown bit rates. Encoding is set to the
+ bitrate closest to specified value (in bps) */
+ OMX_U32 nMinBitRate; /**< Sets minimum bitrate (in bps). */
+ OMX_U32 nMaxBitRate; /**< Sets maximum bitrate (in bps). */
+
+ OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for
+ variable or unknown sampling rate. */
+ OMX_U32 nAudioBandWidth; /**< Audio band width (in Hz) to which an encoder should
+ limit the audio signal. Use 0 to let encoder decide */
+ OMX_S32 nQuality; /**< Sets encoding quality to n, between -1 (low) and 10 (high).
+ In the default mode of operation, teh quality level is 3.
+ Normal quality range is 0 - 10. */
+ OMX_BOOL bManaged; /**< Set bitrate management mode. This turns off the
+ normal VBR encoding, but allows hard or soft bitrate
+ constraints to be enforced by the encoder. This mode can
+ be slower, and may also be lower quality. It is
+ primarily useful for streaming. */
+ OMX_BOOL bDownmix; /**< Downmix input from stereo to mono (has no effect on
+ non-stereo streams). Useful for lower-bitrate encoding. */
+} OMX_AUDIO_PARAM_VORBISTYPE;
+
+
+/** WMA Version */
+typedef enum OMX_AUDIO_WMAFORMATTYPE {
+ OMX_AUDIO_WMAFormatUnused = 0, /**< format unused or unknown */
+ OMX_AUDIO_WMAFormat7, /**< Windows Media Audio format 7 */
+ OMX_AUDIO_WMAFormat8, /**< Windows Media Audio format 8 */
+ OMX_AUDIO_WMAFormat9, /**< Windows Media Audio format 9 */
+ OMX_AUDIO_WMAFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_WMAFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_WMAFormatMax = 0x7FFFFFFF
+} OMX_AUDIO_WMAFORMATTYPE;
+
+
+/** WMA Profile */
+typedef enum OMX_AUDIO_WMAPROFILETYPE {
+ OMX_AUDIO_WMAProfileUnused = 0, /**< profile unused or unknown */
+ OMX_AUDIO_WMAProfileL1, /**< Windows Media audio version 9 profile L1 */
+ OMX_AUDIO_WMAProfileL2, /**< Windows Media audio version 9 profile L2 */
+ OMX_AUDIO_WMAProfileL3, /**< Windows Media audio version 9 profile L3 */
+ OMX_AUDIO_WMAProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_WMAProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_WMAProfileMax = 0x7FFFFFFF
+} OMX_AUDIO_WMAPROFILETYPE;
+
+
+/** WMA params */
+typedef struct OMX_AUDIO_PARAM_WMATYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U16 nChannels; /**< Number of channels */
+ OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable
+ rate or unknown bit rates */
+ OMX_AUDIO_WMAFORMATTYPE eFormat; /**< Version of WMA stream / data */
+ OMX_AUDIO_WMAPROFILETYPE eProfile; /**< Profile of WMA stream / data */
+ OMX_U32 nSamplingRate; /**< Sampling rate of the source data */
+ OMX_U16 nBlockAlign; /**< is the block alignment, or block size, in bytes of the audio codec */
+ OMX_U16 nEncodeOptions; /**< WMA Type-specific data */
+ OMX_U32 nSuperBlockAlign; /**< WMA Type-specific data */
+} OMX_AUDIO_PARAM_WMATYPE;
+
+/**
+ * RealAudio format
+ */
+typedef enum OMX_AUDIO_RAFORMATTYPE {
+ OMX_AUDIO_RAFormatUnused = 0, /**< Format unused or unknown */
+ OMX_AUDIO_RA8, /**< RealAudio 8 codec */
+ OMX_AUDIO_RA9, /**< RealAudio 9 codec */
+ OMX_AUDIO_RA10_AAC, /**< MPEG-4 AAC codec for bitrates of more than 128kbps */
+ OMX_AUDIO_RA10_CODEC, /**< RealAudio codec for bitrates less than 128 kbps */
+ OMX_AUDIO_RA10_LOSSLESS, /**< RealAudio Lossless */
+ OMX_AUDIO_RA10_MULTICHANNEL, /**< RealAudio Multichannel */
+ OMX_AUDIO_RA10_VOICE, /**< RealAudio Voice for bitrates below 15 kbps */
+ OMX_AUDIO_RAFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_RAFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_VIDEO_RAFormatMax = 0x7FFFFFFF
+} OMX_AUDIO_RAFORMATTYPE;
+
+/** RA (Real Audio) params */
+typedef struct OMX_AUDIO_PARAM_RATYPE {
+ 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_U32 nChannels; /**< Number of channels */
+ OMX_U32 nSamplingRate; /**< is the sampling rate of the source data */
+ OMX_U32 nBitsPerFrame; /**< is the value for bits per frame */
+ OMX_U32 nSamplePerFrame; /**< is the value for samples per frame */
+ OMX_U32 nCouplingQuantBits; /**< is the number of coupling quantization bits in the stream */
+ OMX_U32 nCouplingStartRegion; /**< is the coupling start region in the stream */
+ OMX_U32 nNumRegions; /**< is the number of regions value */
+ OMX_AUDIO_RAFORMATTYPE eFormat; /**< is the RealAudio audio format */
+} OMX_AUDIO_PARAM_RATYPE;
+
+
+/** SBC Allocation Method Type */
+typedef enum OMX_AUDIO_SBCALLOCMETHODTYPE {
+ OMX_AUDIO_SBCAllocMethodLoudness, /**< Loudness allocation method */
+ OMX_AUDIO_SBCAllocMethodSNR, /**< SNR allocation method */
+ OMX_AUDIO_SBCAllocMethodKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_SBCAllocMethodVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_SBCAllocMethodMax = 0x7FFFFFFF
+} OMX_AUDIO_SBCALLOCMETHODTYPE;
+
+
+/** SBC params */
+typedef struct OMX_AUDIO_PARAM_SBCTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels */
+ OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable
+ rate or unknown bit rates */
+ OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for
+ variable or unknown sampling rate. */
+ OMX_U32 nBlocks; /**< Number of blocks */
+ OMX_U32 nSubbands; /**< Number of subbands */
+ OMX_U32 nBitPool; /**< Bitpool value */
+ OMX_BOOL bEnableBitrate; /**< Use bitrate value instead of bitpool */
+ OMX_AUDIO_CHANNELMODETYPE eChannelMode; /**< Channel mode enumeration */
+ OMX_AUDIO_SBCALLOCMETHODTYPE eSBCAllocType; /**< SBC Allocation method type */
+} OMX_AUDIO_PARAM_SBCTYPE;
+
+
+/** ADPCM stream format parameters */
+typedef struct OMX_AUDIO_PARAM_ADPCMTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels in the data stream (not
+ necessarily the same as the number of channels
+ to be rendered. */
+ OMX_U32 nBitsPerSample; /**< Number of bits in each sample */
+ OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for
+ variable or unknown sampling rate. */
+} OMX_AUDIO_PARAM_ADPCMTYPE;
+
+
+/** G723 rate */
+typedef enum OMX_AUDIO_G723RATE {
+ OMX_AUDIO_G723ModeUnused = 0, /**< AMRNB Mode unused / unknown */
+ OMX_AUDIO_G723ModeLow, /**< 5300 bps */
+ OMX_AUDIO_G723ModeHigh, /**< 6300 bps */
+ OMX_AUDIO_G723ModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_G723ModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_G723ModeMax = 0x7FFFFFFF
+} OMX_AUDIO_G723RATE;
+
+
+/** G723 - Sample rate must be 8 KHz */
+typedef struct OMX_AUDIO_PARAM_G723TYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels in the data stream (not
+ necessarily the same as the number of channels
+ to be rendered. */
+ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */
+ OMX_AUDIO_G723RATE eBitRate; /**< todo: Should this be moved to a config? */
+ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */
+ OMX_BOOL bPostFilter; /**< Enable Post Filter */
+} OMX_AUDIO_PARAM_G723TYPE;
+
+
+/** ITU G726 (ADPCM) rate */
+typedef enum OMX_AUDIO_G726MODE {
+ OMX_AUDIO_G726ModeUnused = 0, /**< G726 Mode unused / unknown */
+ OMX_AUDIO_G726Mode16, /**< 16 kbps */
+ OMX_AUDIO_G726Mode24, /**< 24 kbps */
+ OMX_AUDIO_G726Mode32, /**< 32 kbps, most common rate, also G721 */
+ OMX_AUDIO_G726Mode40, /**< 40 kbps */
+ OMX_AUDIO_G726ModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_G726ModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_G726ModeMax = 0x7FFFFFFF
+} OMX_AUDIO_G726MODE;
+
+
+/** G.726 stream format parameters - must be at 8KHz */
+typedef struct OMX_AUDIO_PARAM_G726TYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels in the data stream (not
+ necessarily the same as the number of channels
+ to be rendered. */
+ OMX_AUDIO_G726MODE eG726Mode;
+} OMX_AUDIO_PARAM_G726TYPE;
+
+
+/** G729 coder type */
+typedef enum OMX_AUDIO_G729TYPE {
+ OMX_AUDIO_G729 = 0, /**< ITU G.729 encoded data */
+ OMX_AUDIO_G729A, /**< ITU G.729 annex A encoded data */
+ OMX_AUDIO_G729B, /**< ITU G.729 with annex B encoded data */
+ OMX_AUDIO_G729AB, /**< ITU G.729 annexes A and B encoded data */
+ OMX_AUDIO_G729KhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_G729VendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_G729Max = 0x7FFFFFFF
+} OMX_AUDIO_G729TYPE;
+
+
+/** G729 stream format parameters - fixed 6KHz sample rate */
+typedef struct OMX_AUDIO_PARAM_G729TYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels in the data stream (not
+ necessarily the same as the number of channels
+ to be rendered. */
+ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */
+ OMX_AUDIO_G729TYPE eBitType;
+} OMX_AUDIO_PARAM_G729TYPE;
+
+
+/** AMR Frame format */
+typedef enum OMX_AUDIO_AMRFRAMEFORMATTYPE {
+ OMX_AUDIO_AMRFrameFormatConformance = 0, /**< Frame Format is AMR Conformance
+ (Standard) Format */
+ OMX_AUDIO_AMRFrameFormatIF1, /**< Frame Format is AMR Interface
+ Format 1 */
+ OMX_AUDIO_AMRFrameFormatIF2, /**< Frame Format is AMR Interface
+ Format 2*/
+ OMX_AUDIO_AMRFrameFormatFSF, /**< Frame Format is AMR File Storage
+ Format */
+ OMX_AUDIO_AMRFrameFormatRTPPayload, /**< Frame Format is AMR Real-Time
+ Transport Protocol Payload Format */
+ OMX_AUDIO_AMRFrameFormatITU, /**< Frame Format is ITU Format (added at Motorola request) */
+ OMX_AUDIO_AMRFrameFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_AMRFrameFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_AMRFrameFormatMax = 0x7FFFFFFF
+} OMX_AUDIO_AMRFRAMEFORMATTYPE;
+
+
+/** AMR band mode */
+typedef enum OMX_AUDIO_AMRBANDMODETYPE {
+ OMX_AUDIO_AMRBandModeUnused = 0, /**< AMRNB Mode unused / unknown */
+ OMX_AUDIO_AMRBandModeNB0, /**< AMRNB Mode 0 = 4750 bps */
+ OMX_AUDIO_AMRBandModeNB1, /**< AMRNB Mode 1 = 5150 bps */
+ OMX_AUDIO_AMRBandModeNB2, /**< AMRNB Mode 2 = 5900 bps */
+ OMX_AUDIO_AMRBandModeNB3, /**< AMRNB Mode 3 = 6700 bps */
+ OMX_AUDIO_AMRBandModeNB4, /**< AMRNB Mode 4 = 7400 bps */
+ OMX_AUDIO_AMRBandModeNB5, /**< AMRNB Mode 5 = 7950 bps */
+ OMX_AUDIO_AMRBandModeNB6, /**< AMRNB Mode 6 = 10200 bps */
+ OMX_AUDIO_AMRBandModeNB7, /**< AMRNB Mode 7 = 12200 bps */
+ OMX_AUDIO_AMRBandModeWB0, /**< AMRWB Mode 0 = 6600 bps */
+ OMX_AUDIO_AMRBandModeWB1, /**< AMRWB Mode 1 = 8850 bps */
+ OMX_AUDIO_AMRBandModeWB2, /**< AMRWB Mode 2 = 12650 bps */
+ OMX_AUDIO_AMRBandModeWB3, /**< AMRWB Mode 3 = 14250 bps */
+ OMX_AUDIO_AMRBandModeWB4, /**< AMRWB Mode 4 = 15850 bps */
+ OMX_AUDIO_AMRBandModeWB5, /**< AMRWB Mode 5 = 18250 bps */
+ OMX_AUDIO_AMRBandModeWB6, /**< AMRWB Mode 6 = 19850 bps */
+ OMX_AUDIO_AMRBandModeWB7, /**< AMRWB Mode 7 = 23050 bps */
+ OMX_AUDIO_AMRBandModeWB8, /**< AMRWB Mode 8 = 23850 bps */
+ OMX_AUDIO_AMRBandModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_AMRBandModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_AMRBandModeMax = 0x7FFFFFFF
+} OMX_AUDIO_AMRBANDMODETYPE;
+
+
+/** AMR Discontinuous Transmission mode */
+typedef enum OMX_AUDIO_AMRDTXMODETYPE {
+ OMX_AUDIO_AMRDTXModeOff = 0, /**< AMR Discontinuous Transmission Mode is disabled */
+ OMX_AUDIO_AMRDTXModeOnVAD1, /**< AMR Discontinuous Transmission Mode using
+ Voice Activity Detector 1 (VAD1) is enabled */
+ OMX_AUDIO_AMRDTXModeOnVAD2, /**< AMR Discontinuous Transmission Mode using
+ Voice Activity Detector 2 (VAD2) is enabled */
+ OMX_AUDIO_AMRDTXModeOnAuto, /**< The codec will automatically select between
+ Off, VAD1 or VAD2 modes */
+
+ OMX_AUDIO_AMRDTXasEFR, /**< DTX as EFR instead of AMR standard (3GPP 26.101, frame type =8,9,10) */
+
+ OMX_AUDIO_AMRDTXModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_AMRDTXModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_AMRDTXModeMax = 0x7FFFFFFF
+} OMX_AUDIO_AMRDTXMODETYPE;
+
+
+/** AMR params */
+typedef struct OMX_AUDIO_PARAM_AMRTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels */
+ OMX_U32 nBitRate; /**< Bit rate read only field */
+ OMX_AUDIO_AMRBANDMODETYPE eAMRBandMode; /**< AMR Band Mode enumeration */
+ OMX_AUDIO_AMRDTXMODETYPE eAMRDTXMode; /**< AMR DTX Mode enumeration */
+ OMX_AUDIO_AMRFRAMEFORMATTYPE eAMRFrameFormat; /**< AMR frame format enumeration */
+} OMX_AUDIO_PARAM_AMRTYPE;
+
+
+/** GSM_FR (ETSI 06.10, 3GPP 46.010) stream format parameters */
+typedef struct OMX_AUDIO_PARAM_GSMFRTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */
+ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */
+} OMX_AUDIO_PARAM_GSMFRTYPE;
+
+
+/** GSM-HR (ETSI 06.20, 3GPP 46.020) stream format parameters */
+typedef struct OMX_AUDIO_PARAM_GSMHRTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */
+ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */
+} OMX_AUDIO_PARAM_GSMHRTYPE;
+
+
+/** GSM-EFR (ETSI 06.60, 3GPP 46.060) stream format parameters */
+typedef struct OMX_AUDIO_PARAM_GSMEFRTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */
+ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */
+} OMX_AUDIO_PARAM_GSMEFRTYPE;
+
+
+/** TDMA FR (TIA/EIA-136-420, VSELP 7.95kbps coder) stream format parameters */
+typedef struct OMX_AUDIO_PARAM_TDMAFRTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels in the data stream (not
+ necessarily the same as the number of channels
+ to be rendered. */
+ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */
+ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */
+} OMX_AUDIO_PARAM_TDMAFRTYPE;
+
+
+/** TDMA EFR (TIA/EIA-136-410, ACELP 7.4kbps coder) stream format parameters */
+typedef struct OMX_AUDIO_PARAM_TDMAEFRTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels in the data stream (not
+ necessarily the same as the number of channels
+ to be rendered. */
+ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */
+ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */
+} OMX_AUDIO_PARAM_TDMAEFRTYPE;
+
+
+/** PDC FR ( RCR-27, VSELP 6.7kbps coder) stream format parameters */
+typedef struct OMX_AUDIO_PARAM_PDCFRTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels in the data stream (not
+ necessarily the same as the number of channels
+ to be rendered. */
+ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */
+ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */
+} OMX_AUDIO_PARAM_PDCFRTYPE;
+
+
+/** PDC EFR ( RCR-27, ACELP 6.7kbps coder) stream format parameters */
+typedef struct OMX_AUDIO_PARAM_PDCEFRTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels in the data stream (not
+ necessarily the same as the number of channels
+ to be rendered. */
+ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */
+ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */
+} OMX_AUDIO_PARAM_PDCEFRTYPE;
+
+/** PDC HR ( RCR-27, PSI-CELP 3.45kbps coder) stream format parameters */
+typedef struct OMX_AUDIO_PARAM_PDCHRTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels in the data stream (not
+ necessarily the same as the number of channels
+ to be rendered. */
+ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */
+ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */
+} OMX_AUDIO_PARAM_PDCHRTYPE;
+
+
+/** CDMA Rate types */
+typedef enum OMX_AUDIO_CDMARATETYPE {
+ OMX_AUDIO_CDMARateBlank = 0, /**< CDMA encoded frame is blank */
+ OMX_AUDIO_CDMARateFull, /**< CDMA encoded frame in full rate */
+ OMX_AUDIO_CDMARateHalf, /**< CDMA encoded frame in half rate */
+ OMX_AUDIO_CDMARateQuarter, /**< CDMA encoded frame in quarter rate */
+ OMX_AUDIO_CDMARateEighth, /**< CDMA encoded frame in eighth rate (DTX)*/
+ OMX_AUDIO_CDMARateErasure, /**< CDMA erasure frame */
+ OMX_AUDIO_CDMARateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_CDMARateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_CDMARateMax = 0x7FFFFFFF
+} OMX_AUDIO_CDMARATETYPE;
+
+
+/** QCELP8 (TIA/EIA-96, up to 8kbps coder) stream format parameters */
+typedef struct OMX_AUDIO_PARAM_QCELP8TYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels in the data stream (not
+ necessarily the same as the number of channels
+ to be rendered. */
+ OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable
+ rate or unknown bit rates */
+ OMX_AUDIO_CDMARATETYPE eCDMARate; /**< Frame rate */
+ OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 */
+ OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 */
+} OMX_AUDIO_PARAM_QCELP8TYPE;
+
+
+/** QCELP13 ( CDMA, EIA/TIA-733, 13.3kbps coder) stream format parameters */
+typedef struct OMX_AUDIO_PARAM_QCELP13TYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels in the data stream (not
+ necessarily the same as the number of channels
+ to be rendered. */
+ OMX_AUDIO_CDMARATETYPE eCDMARate; /**< Frame rate */
+ OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 */
+ OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 */
+} OMX_AUDIO_PARAM_QCELP13TYPE;
+
+
+/** EVRC ( CDMA, EIA/TIA-127, RCELP up to 8.55kbps coder) stream format parameters */
+typedef struct OMX_AUDIO_PARAM_EVRCTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels in the data stream (not
+ necessarily the same as the number of channels
+ to be rendered. */
+ OMX_AUDIO_CDMARATETYPE eCDMARate; /**< actual Frame rate */
+ OMX_BOOL bRATE_REDUCon; /**< RATE_REDUCtion is requested for this frame */
+ OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 */
+ OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 */
+ OMX_BOOL bHiPassFilter; /**< Enable encoder's High Pass Filter */
+ OMX_BOOL bNoiseSuppressor; /**< Enable encoder's noise suppressor pre-processing */
+ OMX_BOOL bPostFilter; /**< Enable decoder's post Filter */
+} OMX_AUDIO_PARAM_EVRCTYPE;
+
+
+/** SMV ( up to 8.55kbps coder) stream format parameters */
+typedef struct OMX_AUDIO_PARAM_SMVTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels in the data stream (not
+ necessarily the same as the number of channels
+ to be rendered. */
+ OMX_AUDIO_CDMARATETYPE eCDMARate; /**< Frame rate */
+ OMX_BOOL bRATE_REDUCon; /**< RATE_REDUCtion is requested for this frame */
+ OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 ??*/
+ OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 ??*/
+ OMX_BOOL bHiPassFilter; /**< Enable encoder's High Pass Filter ??*/
+ OMX_BOOL bNoiseSuppressor; /**< Enable encoder's noise suppressor pre-processing */
+ OMX_BOOL bPostFilter; /**< Enable decoder's post Filter ??*/
+} OMX_AUDIO_PARAM_SMVTYPE;
+
+
+/** MIDI Format
+ * @ingroup midi
+ */
+typedef enum OMX_AUDIO_MIDIFORMATTYPE
+{
+ OMX_AUDIO_MIDIFormatUnknown = 0, /**< MIDI Format unknown or don't care */
+ OMX_AUDIO_MIDIFormatSMF0, /**< Standard MIDI File Type 0 */
+ OMX_AUDIO_MIDIFormatSMF1, /**< Standard MIDI File Type 1 */
+ OMX_AUDIO_MIDIFormatSMF2, /**< Standard MIDI File Type 2 */
+ OMX_AUDIO_MIDIFormatSPMIDI, /**< SP-MIDI */
+ OMX_AUDIO_MIDIFormatXMF0, /**< eXtensible Music Format type 0 */
+ OMX_AUDIO_MIDIFormatXMF1, /**< eXtensible Music Format type 1 */
+ OMX_AUDIO_MIDIFormatMobileXMF, /**< Mobile XMF (eXtensible Music Format type 2) */
+ OMX_AUDIO_MIDIFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_MIDIFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_MIDIFormatMax = 0x7FFFFFFF
+} OMX_AUDIO_MIDIFORMATTYPE;
+
+
+/** MIDI params
+ * @ingroup midi
+ */
+typedef struct OMX_AUDIO_PARAM_MIDITYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nFileSize; /**< size of the MIDI file in bytes, where the entire
+ MIDI file passed in, otherwise if 0x0, the MIDI data
+ is merged and streamed (instead of passed as an
+ entire MIDI file) */
+ OMX_BU32 sMaxPolyphony; /**< Specifies the maximum simultaneous polyphonic
+ voices. A value of zero indicates that the default
+ polyphony of the device is used */
+ OMX_BOOL bLoadDefaultSound; /**< Whether to load default sound
+ bank at initialization */
+ OMX_AUDIO_MIDIFORMATTYPE eMidiFormat; /**< Version of the MIDI file */
+} OMX_AUDIO_PARAM_MIDITYPE;
+
+
+/** Type of the MIDI sound bank
+ * @ingroup midi
+ */
+typedef enum OMX_AUDIO_MIDISOUNDBANKTYPE {
+ OMX_AUDIO_MIDISoundBankUnused = 0, /**< unused/unknown soundbank type */
+ OMX_AUDIO_MIDISoundBankDLS1, /**< DLS version 1 */
+ OMX_AUDIO_MIDISoundBankDLS2, /**< DLS version 2 */
+ OMX_AUDIO_MIDISoundBankMobileDLSBase, /**< Mobile DLS, using the base functionality */
+ OMX_AUDIO_MIDISoundBankMobileDLSPlusOptions, /**< Mobile DLS, using the specification-defined optional feature set */
+ OMX_AUDIO_MIDISoundBankKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_MIDISoundBankVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_MIDISoundBankMax = 0x7FFFFFFF
+} OMX_AUDIO_MIDISOUNDBANKTYPE;
+
+
+/** Bank Layout describes how bank MSB & LSB are used in the DLS instrument definitions sound bank
+ * @ingroup midi
+ */
+typedef enum OMX_AUDIO_MIDISOUNDBANKLAYOUTTYPE {
+ OMX_AUDIO_MIDISoundBankLayoutUnused = 0, /**< unused/unknown soundbank type */
+ OMX_AUDIO_MIDISoundBankLayoutGM, /**< GS layout (based on bank MSB 0x00) */
+ OMX_AUDIO_MIDISoundBankLayoutGM2, /**< General MIDI 2 layout (using MSB 0x78/0x79, LSB 0x00) */
+ OMX_AUDIO_MIDISoundBankLayoutUser, /**< Does not conform to any bank numbering standards */
+ OMX_AUDIO_MIDISoundBankLayoutKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_MIDISoundBankLayoutVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_MIDISoundBankLayoutMax = 0x7FFFFFFF
+} OMX_AUDIO_MIDISOUNDBANKLAYOUTTYPE;
+
+
+/** MIDI params to load/unload user soundbank
+ * @ingroup midi
+ */
+typedef struct OMX_AUDIO_PARAM_MIDILOADUSERSOUNDTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nDLSIndex; /**< DLS file index to be loaded */
+ OMX_U32 nDLSSize; /**< Size in bytes */
+ OMX_PTR pDLSData; /**< Pointer to DLS file data */
+ OMX_AUDIO_MIDISOUNDBANKTYPE eMidiSoundBank; /**< Midi sound bank type enumeration */
+ OMX_AUDIO_MIDISOUNDBANKLAYOUTTYPE eMidiSoundBankLayout; /**< Midi sound bank layout enumeration */
+} OMX_AUDIO_PARAM_MIDILOADUSERSOUNDTYPE;
+
+
+/** Structure for Live MIDI events and MIP messages.
+ * (MIP = Maximum Instantaneous Polyphony; part of the SP-MIDI standard.)
+ * @ingroup midi
+ */
+typedef struct OMX_AUDIO_CONFIG_MIDIIMMEDIATEEVENTTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Port that this structure applies to */
+ OMX_U32 nMidiEventSize; /**< Size of immediate MIDI events or MIP message in bytes */
+ OMX_U8 nMidiEvents[1]; /**< MIDI event array to be rendered immediately, or an
+ array for the MIP message buffer, where the size is
+ indicated by nMidiEventSize */
+} OMX_AUDIO_CONFIG_MIDIIMMEDIATEEVENTTYPE;
+
+
+/** MIDI sound bank/ program pair in a given channel
+ * @ingroup midi
+ */
+typedef struct OMX_AUDIO_CONFIG_MIDISOUNDBANKPROGRAMTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Port that this structure applies to */
+ OMX_U32 nChannel; /**< Valid channel values range from 1 to 16 */
+ OMX_U16 nIDProgram; /**< Valid program ID range is 1 to 128 */
+ OMX_U16 nIDSoundBank; /**< Sound bank ID */
+ OMX_U32 nUserSoundBankIndex;/**< User soundbank index, easier to access soundbanks
+ by index if multiple banks are present */
+} OMX_AUDIO_CONFIG_MIDISOUNDBANKPROGRAMTYPE;
+
+
+/** MIDI control
+ * @ingroup midi
+ */
+typedef struct OMX_AUDIO_CONFIG_MIDICONTROLTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_BS32 sPitchTransposition; /**< Pitch transposition in semitones, stored as Q22.10
+ format based on JAVA MMAPI (JSR-135) requirement */
+ OMX_BU32 sPlayBackRate; /**< Relative playback rate, stored as Q14.17 fixed-point
+ number based on JSR-135 requirement */
+ OMX_BU32 sTempo ; /**< Tempo in beats per minute (BPM), stored as Q22.10
+ fixed-point number based on JSR-135 requirement */
+ OMX_U32 nMaxPolyphony; /**< Specifies the maximum simultaneous polyphonic
+ voices. A value of zero indicates that the default
+ polyphony of the device is used */
+ OMX_U32 nNumRepeat; /**< Number of times to repeat playback */
+ OMX_U32 nStopTime; /**< Time in milliseconds to indicate when playback
+ will stop automatically. Set to zero if not used */
+ OMX_U16 nChannelMuteMask; /**< 16 bit mask for channel mute status */
+ OMX_U16 nChannelSoloMask; /**< 16 bit mask for channel solo status */
+ OMX_U32 nTrack0031MuteMask; /**< 32 bit mask for track mute status. Note: This is for tracks 0-31 */
+ OMX_U32 nTrack3263MuteMask; /**< 32 bit mask for track mute status. Note: This is for tracks 32-63 */
+ OMX_U32 nTrack0031SoloMask; /**< 32 bit mask for track solo status. Note: This is for tracks 0-31 */
+ OMX_U32 nTrack3263SoloMask; /**< 32 bit mask for track solo status. Note: This is for tracks 32-63 */
+
+} OMX_AUDIO_CONFIG_MIDICONTROLTYPE;
+
+
+/** MIDI Playback States
+ * @ingroup midi
+ */
+typedef enum OMX_AUDIO_MIDIPLAYBACKSTATETYPE {
+ OMX_AUDIO_MIDIPlayBackStateUnknown = 0, /**< Unknown state or state does not map to
+ other defined states */
+ OMX_AUDIO_MIDIPlayBackStateClosedEngaged, /**< No MIDI resource is currently open.
+ The MIDI engine is currently processing
+ MIDI events. */
+ OMX_AUDIO_MIDIPlayBackStateParsing, /**< A MIDI resource is open and is being
+ primed. The MIDI engine is currently
+ processing MIDI events. */
+ OMX_AUDIO_MIDIPlayBackStateOpenEngaged, /**< A MIDI resource is open and primed but
+ not playing. The MIDI engine is currently
+ processing MIDI events. The transition to
+ this state is only possible from the
+ OMX_AUDIO_MIDIPlayBackStatePlaying state,
+ when the 'playback head' reaches the end
+ of media data or the playback stops due
+ to stop time set.*/
+ OMX_AUDIO_MIDIPlayBackStatePlaying, /**< A MIDI resource is open and currently
+ playing. The MIDI engine is currently
+ processing MIDI events.*/
+ OMX_AUDIO_MIDIPlayBackStatePlayingPartially, /**< Best-effort playback due to SP-MIDI/DLS
+ resource constraints */
+ OMX_AUDIO_MIDIPlayBackStatePlayingSilently, /**< Due to system resource constraints and
+ SP-MIDI content constraints, there is
+ no audible MIDI content during playback
+ currently. The situation may change if
+ resources are freed later.*/
+ OMX_AUDIO_MIDIPlayBackStateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_MIDIPlayBackStateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_MIDIPlayBackStateMax = 0x7FFFFFFF
+} OMX_AUDIO_MIDIPLAYBACKSTATETYPE;
+
+
+/** MIDI status
+ * @ingroup midi
+ */
+typedef struct OMX_AUDIO_CONFIG_MIDISTATUSTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U16 nNumTracks; /**< Number of MIDI tracks in the file, read only field.
+ NOTE: May not return a meaningful value until the entire
+ file is parsed and buffered. */
+ OMX_U32 nDuration; /**< The length of the currently open MIDI resource
+ in milliseconds. NOTE: May not return a meaningful value
+ until the entire file is parsed and buffered. */
+ OMX_U32 nPosition; /**< Current Position of the MIDI resource being played
+ in milliseconds */
+ OMX_BOOL bVibra; /**< Does Vibra track exist? NOTE: May not return a meaningful
+ value until the entire file is parsed and buffered. */
+ OMX_U32 nNumMetaEvents; /**< Total number of MIDI Meta Events in the currently
+ open MIDI resource. NOTE: May not return a meaningful value
+ until the entire file is parsed and buffered. */
+ OMX_U32 nNumActiveVoices; /**< Number of active voices in the currently playing
+ MIDI resource. NOTE: May not return a meaningful value until
+ the entire file is parsed and buffered. */
+ OMX_AUDIO_MIDIPLAYBACKSTATETYPE eMIDIPlayBackState; /**< MIDI playback state enumeration, read only field */
+} OMX_AUDIO_CONFIG_MIDISTATUSTYPE;
+
+
+/** MIDI Meta Event structure one per Meta Event.
+ * MIDI Meta Events are like audio metadata, except that they are interspersed
+ * with the MIDI content throughout the file and are not localized in the header.
+ * As such, it is necessary to retrieve information about these Meta Events from
+ * the engine, as it encounters these Meta Events within the MIDI content.
+ * For example, SMF files can have up to 14 types of MIDI Meta Events (copyright,
+ * author, default tempo, etc.) scattered throughout the file.
+ * @ingroup midi
+ */
+typedef struct OMX_AUDIO_CONFIG_MIDIMETAEVENTTYPE{
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nIndex; /**< Index of Meta Event */
+ OMX_U8 nMetaEventType; /**< Meta Event Type, 7bits (i.e. 0 - 127) */
+ OMX_U32 nMetaEventSize; /**< size of the Meta Event in bytes */
+ OMX_U32 nTrack; /**< track number for the meta event */
+ OMX_U32 nPosition; /**< Position of the meta-event in milliseconds */
+} OMX_AUDIO_CONFIG_MIDIMETAEVENTTYPE;
+
+
+/** MIDI Meta Event Data structure - one per Meta Event.
+ * @ingroup midi
+ */
+typedef struct OMX_AUDIO_CONFIG_MIDIMETAEVENTDATATYPE{
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nIndex; /**< Index of Meta Event */
+ OMX_U32 nMetaEventSize; /**< size of the Meta Event in bytes */
+ OMX_U8 nData[1]; /**< array of one or more bytes of meta data
+ as indicated by the nMetaEventSize field */
+} OMX_AUDIO_CONFIG__MIDIMETAEVENTDATATYPE;
+
+
+/** Audio Volume adjustment for a port */
+typedef struct OMX_AUDIO_CONFIG_VOLUMETYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Port index indicating which port to
+ set. Select the input port to set
+ just that port's volume. Select the
+ output port to adjust the master
+ volume. */
+ OMX_BOOL bLinear; /**< Is the volume to be set in linear (0.100)
+ or logarithmic scale (mB) */
+ OMX_BS32 sVolume; /**< Volume linear setting in the 0..100 range, OR
+ Volume logarithmic setting for this port. The values
+ for volume are in mB (millibels = 1/100 dB) relative
+ to a gain of 1 (e.g. the output is the same as the
+ input level). Values are in mB from nMax
+ (maximum volume) to nMin mB (typically negative).
+ Since the volume is "voltage"
+ and not a "power", it takes a setting of
+ -600 mB to decrease the volume by 1/2. If
+ a component cannot accurately set the
+ volume to the requested value, it must
+ set the volume to the closest value BELOW
+ the requested value. When getting the
+ volume setting, the current actual volume
+ must be returned. */
+} OMX_AUDIO_CONFIG_VOLUMETYPE;
+
+
+/** Audio Volume adjustment for a channel */
+typedef struct OMX_AUDIO_CONFIG_CHANNELVOLUMETYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Port index indicating which port to
+ set. Select the input port to set
+ just that port's volume. Select the
+ output port to adjust the master
+ volume. */
+ OMX_U32 nChannel; /**< channel to select from 0 to N-1,
+ using OMX_ALL to apply volume settings
+ to all channels */
+ OMX_BOOL bLinear; /**< Is the volume to be set in linear (0.100) or
+ logarithmic scale (mB) */
+ OMX_BS32 sVolume; /**< Volume linear setting in the 0..100 range, OR
+ Volume logarithmic setting for this port.
+ The values for volume are in mB
+ (millibels = 1/100 dB) relative to a gain
+ of 1 (e.g. the output is the same as the
+ input level). Values are in mB from nMax
+ (maximum volume) to nMin mB (typically negative).
+ Since the volume is "voltage"
+ and not a "power", it takes a setting of
+ -600 mB to decrease the volume by 1/2. If
+ a component cannot accurately set the
+ volume to the requested value, it must
+ set the volume to the closest value BELOW
+ the requested value. When getting the
+ volume setting, the current actual volume
+ must be returned. */
+ OMX_BOOL bIsMIDI; /**< TRUE if nChannel refers to a MIDI channel,
+ FALSE otherwise */
+} OMX_AUDIO_CONFIG_CHANNELVOLUMETYPE;
+
+
+/** Audio balance setting */
+typedef struct OMX_AUDIO_CONFIG_BALANCETYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Port index indicating which port to
+ set. Select the input port to set
+ just that port's balance. Select the
+ output port to adjust the master
+ balance. */
+ OMX_S32 nBalance; /**< balance setting for this port
+ (-100 to 100, where -100 indicates
+ all left, and no right */
+} OMX_AUDIO_CONFIG_BALANCETYPE;
+
+
+/** Audio Port mute */
+typedef struct OMX_AUDIO_CONFIG_MUTETYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Port index indicating which port to
+ set. Select the input port to set
+ just that port's mute. Select the
+ output port to adjust the master
+ mute. */
+ OMX_BOOL bMute; /**< Mute setting for this port */
+} OMX_AUDIO_CONFIG_MUTETYPE;
+
+
+/** Audio Channel mute */
+typedef struct OMX_AUDIO_CONFIG_CHANNELMUTETYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannel; /**< channel to select from 0 to N-1,
+ using OMX_ALL to apply mute settings
+ to all channels */
+ OMX_BOOL bMute; /**< Mute setting for this channel */
+ OMX_BOOL bIsMIDI; /**< TRUE if nChannel refers to a MIDI channel,
+ FALSE otherwise */
+} OMX_AUDIO_CONFIG_CHANNELMUTETYPE;
+
+
+
+/** Enable / Disable for loudness control, which boosts bass and to a
+ * smaller extent high end frequencies to compensate for hearing
+ * ability at the extreme ends of the audio spectrum
+ */
+typedef struct OMX_AUDIO_CONFIG_LOUDNESSTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_BOOL bLoudness; /**< Enable/disable for loudness */
+} OMX_AUDIO_CONFIG_LOUDNESSTYPE;
+
+
+/** Enable / Disable for bass, which controls low frequencies
+ */
+typedef struct OMX_AUDIO_CONFIG_BASSTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_BOOL bEnable; /**< Enable/disable for bass control */
+ OMX_S32 nBass; /**< bass setting for the port, as a
+ continuous value from -100 to 100
+ (0 means no change in bass level)*/
+} OMX_AUDIO_CONFIG_BASSTYPE;
+
+
+/** Enable / Disable for treble, which controls high frequencies tones
+ */
+typedef struct OMX_AUDIO_CONFIG_TREBLETYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_BOOL bEnable; /**< Enable/disable for treble control */
+ OMX_S32 nTreble; /**< treble setting for the port, as a
+ continuous value from -100 to 100
+ (0 means no change in treble level) */
+} OMX_AUDIO_CONFIG_TREBLETYPE;
+
+
+/** An equalizer is typically used for two reasons: to compensate for an
+ * sub-optimal frequency response of a system to make it sound more natural
+ * or to create intentionally some unnatural coloring to the sound to create
+ * an effect.
+ * @ingroup effects
+ */
+typedef struct OMX_AUDIO_CONFIG_EQUALIZERTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_BOOL bEnable; /**< Enable/disable for equalizer */
+ OMX_BU32 sBandIndex; /**< Band number to be set. Upper Limit is
+ N-1, where N is the number of bands, lower limit is 0 */
+ OMX_BU32 sCenterFreq; /**< Center frequecies in Hz. This is a
+ read only element and is used to determine
+ the lower, center and upper frequency of
+ this band. */
+ OMX_BS32 sBandLevel; /**< band level in millibels */
+} OMX_AUDIO_CONFIG_EQUALIZERTYPE;
+
+
+/** Stereo widening mode type
+ * @ingroup effects
+ */
+typedef enum OMX_AUDIO_STEREOWIDENINGTYPE {
+ OMX_AUDIO_StereoWideningHeadphones, /**< Stereo widening for loudspeakers */
+ OMX_AUDIO_StereoWideningLoudspeakers, /**< Stereo widening for closely spaced loudspeakers */
+ OMX_AUDIO_StereoWideningKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_StereoWideningVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_StereoWideningMax = 0x7FFFFFFF
+} OMX_AUDIO_STEREOWIDENINGTYPE;
+
+
+/** Control for stereo widening, which is a special 2-channel
+ * case of the audio virtualizer effect. For example, for 5.1-channel
+ * output, it translates to virtual surround sound.
+ * @ingroup effects
+ */
+typedef struct OMX_AUDIO_CONFIG_STEREOWIDENINGTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_BOOL bEnable; /**< Enable/disable for stereo widening control */
+ OMX_AUDIO_STEREOWIDENINGTYPE eWideningType; /**< Stereo widening algorithm type */
+ OMX_U32 nStereoWidening; /**< stereo widening setting for the port,
+ as a continuous value from 0 to 100 */
+} OMX_AUDIO_CONFIG_STEREOWIDENINGTYPE;
+
+
+/** The chorus effect (or ``choralizer'') is any signal processor which makes
+ * one sound source (such as a voice) sound like many such sources singing
+ * (or playing) in unison. Since performance in unison is never exact, chorus
+ * effects simulate this by making independently modified copies of the input
+ * signal. Modifications may include (1) delay, (2) frequency shift, and
+ * (3) amplitude modulation.
+ * @ingroup effects
+ */
+typedef struct OMX_AUDIO_CONFIG_CHORUSTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_BOOL bEnable; /**< Enable/disable for chorus */
+ OMX_BU32 sDelay; /**< average delay in milliseconds */
+ OMX_BU32 sModulationRate; /**< rate of modulation in millihertz */
+ OMX_U32 nModulationDepth; /**< depth of modulation as a percentage of
+ delay (i.e. 0 to 100) */
+ OMX_BU32 nFeedback; /**< Feedback from chorus output to input in percentage */
+} OMX_AUDIO_CONFIG_CHORUSTYPE;
+
+
+/** Reverberation is part of the reflected sound that follows the early
+ * reflections. In a typical room, this consists of a dense succession of
+ * echoes whose energy decays exponentially. The reverberation effect structure
+ * as defined here includes both (early) reflections as well as (late) reverberations.
+ * @ingroup effects
+ */
+typedef struct OMX_AUDIO_CONFIG_REVERBERATIONTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_BOOL bEnable; /**< Enable/disable for reverberation control */
+ OMX_BS32 sRoomLevel; /**< Intensity level for the whole room effect
+ (i.e. both early reflections and late
+ reverberation) in millibels */
+ OMX_BS32 sRoomHighFreqLevel; /**< Attenuation at high frequencies
+ relative to the intensity at low
+ frequencies in millibels */
+ OMX_BS32 sReflectionsLevel; /**< Intensity level of early reflections
+ (relative to room value), in millibels */
+ OMX_BU32 sReflectionsDelay; /**< Delay time of the first reflection relative
+ to the direct path, in milliseconds */
+ OMX_BS32 sReverbLevel; /**< Intensity level of late reverberation
+ relative to room level, in millibels */
+ OMX_BU32 sReverbDelay; /**< Time delay from the first early reflection
+ to the beginning of the late reverberation
+ section, in milliseconds */
+ OMX_BU32 sDecayTime; /**< Late reverberation decay time at low
+ frequencies, in milliseconds */
+ OMX_BU32 nDecayHighFreqRatio; /**< Ratio of high frequency decay time relative
+ to low frequency decay time in percent */
+ OMX_U32 nDensity; /**< Modal density in the late reverberation decay,
+ in percent (i.e. 0 - 100) */
+ OMX_U32 nDiffusion; /**< Echo density in the late reverberation decay,
+ in percent (i.e. 0 - 100) */
+ OMX_BU32 sReferenceHighFreq; /**< Reference high frequency in Hertz. This is
+ the frequency used as the reference for all
+ the high-frequency settings above */
+
+} OMX_AUDIO_CONFIG_REVERBERATIONTYPE;
+
+
+/** Possible settings for the Echo Cancelation structure to use
+ * @ingroup effects
+ */
+typedef enum OMX_AUDIO_ECHOCANTYPE {
+ OMX_AUDIO_EchoCanOff = 0, /**< Echo Cancellation is disabled */
+ OMX_AUDIO_EchoCanNormal, /**< Echo Cancellation normal operation -
+ echo from plastics and face */
+ OMX_AUDIO_EchoCanHFree, /**< Echo Cancellation optimized for
+ Hands Free operation */
+ OMX_AUDIO_EchoCanCarKit, /**< Echo Cancellation optimized for
+ Car Kit (longer echo) */
+ OMX_AUDIO_EchoCanKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_EchoCanVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_EchoCanMax = 0x7FFFFFFF
+} OMX_AUDIO_ECHOCANTYPE;
+
+
+/** Enable / Disable for echo cancelation, which removes undesired echo's
+ * from the audio
+ * @ingroup effects
+ */
+typedef struct OMX_AUDIO_CONFIG_ECHOCANCELATIONTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_AUDIO_ECHOCANTYPE eEchoCancelation; /**< Echo cancelation settings */
+} OMX_AUDIO_CONFIG_ECHOCANCELATIONTYPE;
+
+
+/** Enable / Disable for noise reduction, which undesired noise from
+ * the audio
+ * @ingroup effects
+ */
+typedef struct OMX_AUDIO_CONFIG_NOISEREDUCTIONTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_BOOL bNoiseReduction; /**< Enable/disable for noise reduction */
+} OMX_AUDIO_CONFIG_NOISEREDUCTIONTYPE;
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
+/* File EOF */
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/khronos_api/v1_1_2/OMX_Component.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,579 @@
+/*
+ * Copyright (c) 2008 The Khronos Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject
+ * to the following conditions:
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+/** OMX_Component.h - OpenMax IL version 1.1.2
+ * The OMX_Component header file contains the definitions used to define
+ * the public interface of a component. This header file is intended to
+ * be used by both the application and the component.
+ */
+
+#ifndef OMX_Component_h
+#define OMX_Component_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+
+/* Each OMX header must include all required header files to allow the
+ * header to compile without errors. The includes below are required
+ * for this header file to compile successfully
+ */
+
+#include <openmax/il/khronos/v1_x/OMX_Audio.h>
+#include <openmax/il/khronos/v1_x/OMX_Video.h>
+#include <openmax/il/khronos/v1_x/OMX_Image.h>
+#include <openmax/il/khronos/v1_x/OMX_Other.h>
+
+/** @ingroup comp */
+typedef enum OMX_PORTDOMAINTYPE {
+ OMX_PortDomainAudio,
+ OMX_PortDomainVideo,
+ OMX_PortDomainImage,
+ OMX_PortDomainOther,
+ OMX_PortDomainKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_PortDomainVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_PortDomainMax = 0x7ffffff
+} OMX_PORTDOMAINTYPE;
+
+/** @ingroup comp */
+typedef struct OMX_PARAM_PORTDEFINITIONTYPE {
+ OMX_U32 nSize; /**< Size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Port number the structure applies to */
+ OMX_DIRTYPE eDir; /**< Direction (input or output) of this port */
+ OMX_U32 nBufferCountActual; /**< The actual number of buffers allocated on this port */
+ OMX_U32 nBufferCountMin; /**< The minimum number of buffers this port requires */
+ OMX_U32 nBufferSize; /**< Size, in bytes, for buffers to be used for this channel */
+ OMX_BOOL bEnabled; /**< Ports default to enabled and are enabled/disabled by
+ OMX_CommandPortEnable/OMX_CommandPortDisable.
+ When disabled a port is unpopulated. A disabled port
+ is not populated with buffers on a transition to IDLE. */
+ OMX_BOOL bPopulated; /**< Port is populated with all of its buffers as indicated by
+ nBufferCountActual. A disabled port is always unpopulated.
+ An enabled port is populated on a transition to OMX_StateIdle
+ and unpopulated on a transition to loaded. */
+ OMX_PORTDOMAINTYPE eDomain; /**< Domain of the port. Determines the contents of metadata below. */
+ union {
+ OMX_AUDIO_PORTDEFINITIONTYPE audio;
+ OMX_VIDEO_PORTDEFINITIONTYPE video;
+ OMX_IMAGE_PORTDEFINITIONTYPE image;
+ OMX_OTHER_PORTDEFINITIONTYPE other;
+ } format;
+ OMX_BOOL bBuffersContiguous;
+ OMX_U32 nBufferAlignment;
+} OMX_PARAM_PORTDEFINITIONTYPE;
+
+/** @ingroup comp */
+typedef struct OMX_PARAM_U32TYPE {
+ 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_U32 nU32; /**< U32 value */
+} OMX_PARAM_U32TYPE;
+
+/** @ingroup rpm */
+typedef enum OMX_SUSPENSIONPOLICYTYPE {
+ OMX_SuspensionDisabled, /**< No suspension; v1.0 behavior */
+ OMX_SuspensionEnabled, /**< Suspension allowed */
+ OMX_SuspensionPolicyKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_SuspensionPolicyStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_SuspensionPolicyMax = 0x7fffffff
+} OMX_SUSPENSIONPOLICYTYPE;
+
+/** @ingroup rpm */
+typedef struct OMX_PARAM_SUSPENSIONPOLICYTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_SUSPENSIONPOLICYTYPE ePolicy;
+} OMX_PARAM_SUSPENSIONPOLICYTYPE;
+
+/** @ingroup rpm */
+typedef enum OMX_SUSPENSIONTYPE {
+ OMX_NotSuspended, /**< component is not suspended */
+ OMX_Suspended, /**< component is suspended */
+ OMX_SuspensionKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_SuspensionVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_SuspendMax = 0x7FFFFFFF
+} OMX_SUSPENSIONTYPE;
+
+/** @ingroup rpm */
+typedef struct OMX_PARAM_SUSPENSIONTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_SUSPENSIONTYPE eType;
+} OMX_PARAM_SUSPENSIONTYPE ;
+
+typedef struct OMX_CONFIG_BOOLEANTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_BOOL bEnabled;
+} OMX_CONFIG_BOOLEANTYPE;
+
+/* Parameter specifying the content uri to use. */
+/** @ingroup cp */
+typedef struct OMX_PARAM_CONTENTURITYPE
+{
+ OMX_U32 nSize; /**< size of the structure in bytes, including
+ actual URI name */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U8 contentURI[1]; /**< The URI name */
+} OMX_PARAM_CONTENTURITYPE;
+
+/* Parameter specifying the pipe to use. */
+/** @ingroup cp */
+typedef struct OMX_PARAM_CONTENTPIPETYPE
+{
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_HANDLETYPE hPipe; /**< The pipe handle*/
+} OMX_PARAM_CONTENTPIPETYPE;
+
+/** @ingroup rpm */
+typedef struct OMX_RESOURCECONCEALMENTTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_BOOL bResourceConcealmentForbidden; /**< disallow the use of resource concealment
+ methods (like degrading algorithm quality to
+ lower resource consumption or functional bypass)
+ on a component as a resolution to resource conflicts. */
+} OMX_RESOURCECONCEALMENTTYPE;
+
+
+/** @ingroup metadata */
+typedef enum OMX_METADATACHARSETTYPE {
+ OMX_MetadataCharsetUnknown = 0,
+ OMX_MetadataCharsetASCII,
+ OMX_MetadataCharsetBinary,
+ OMX_MetadataCharsetCodePage1252,
+ OMX_MetadataCharsetUTF8,
+ OMX_MetadataCharsetJavaConformantUTF8,
+ OMX_MetadataCharsetUTF7,
+ OMX_MetadataCharsetImapUTF7,
+ OMX_MetadataCharsetUTF16LE,
+ OMX_MetadataCharsetUTF16BE,
+ OMX_MetadataCharsetGB12345,
+ OMX_MetadataCharsetHZGB2312,
+ OMX_MetadataCharsetGB2312,
+ OMX_MetadataCharsetGB18030,
+ OMX_MetadataCharsetGBK,
+ OMX_MetadataCharsetBig5,
+ OMX_MetadataCharsetISO88591,
+ OMX_MetadataCharsetISO88592,
+ OMX_MetadataCharsetISO88593,
+ OMX_MetadataCharsetISO88594,
+ OMX_MetadataCharsetISO88595,
+ OMX_MetadataCharsetISO88596,
+ OMX_MetadataCharsetISO88597,
+ OMX_MetadataCharsetISO88598,
+ OMX_MetadataCharsetISO88599,
+ OMX_MetadataCharsetISO885910,
+ OMX_MetadataCharsetISO885913,
+ OMX_MetadataCharsetISO885914,
+ OMX_MetadataCharsetISO885915,
+ OMX_MetadataCharsetShiftJIS,
+ OMX_MetadataCharsetISO2022JP,
+ OMX_MetadataCharsetISO2022JP1,
+ OMX_MetadataCharsetISOEUCJP,
+ OMX_MetadataCharsetSMS7Bit,
+ OMX_MetadataCharsetKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_MetadataCharsetVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_MetadataCharsetTypeMax= 0x7FFFFFFF
+} OMX_METADATACHARSETTYPE;
+
+/** @ingroup metadata */
+typedef enum OMX_METADATASCOPETYPE
+{
+ OMX_MetadataScopeAllLevels,
+ OMX_MetadataScopeTopLevel,
+ OMX_MetadataScopePortLevel,
+ OMX_MetadataScopeNodeLevel,
+ OMX_MetadataScopeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_MetadataScopeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_MetadataScopeTypeMax = 0x7fffffff
+} OMX_METADATASCOPETYPE;
+
+/** @ingroup metadata */
+typedef enum OMX_METADATASEARCHMODETYPE
+{
+ OMX_MetadataSearchValueSizeByIndex,
+ OMX_MetadataSearchItemByIndex,
+ OMX_MetadataSearchNextItemByKey,
+ OMX_MetadataSearchKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_MetadataSearchVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_MetadataSearchTypeMax = 0x7fffffff
+} OMX_METADATASEARCHMODETYPE;
+/** @ingroup metadata */
+typedef struct OMX_CONFIG_METADATAITEMCOUNTTYPE
+{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_METADATASCOPETYPE eScopeMode;
+ OMX_U32 nScopeSpecifier;
+ OMX_U32 nMetadataItemCount;
+} OMX_CONFIG_METADATAITEMCOUNTTYPE;
+
+/** @ingroup metadata */
+typedef struct OMX_CONFIG_METADATAITEMTYPE
+{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_METADATASCOPETYPE eScopeMode;
+ OMX_U32 nScopeSpecifier;
+ OMX_U32 nMetadataItemIndex;
+ OMX_METADATASEARCHMODETYPE eSearchMode;
+ OMX_METADATACHARSETTYPE eKeyCharset;
+ OMX_U8 nKeySizeUsed;
+ OMX_U8 nKey[128];
+ OMX_METADATACHARSETTYPE eValueCharset;
+ OMX_STRING sLanguageCountry;
+ OMX_U32 nValueMaxSize;
+ OMX_U32 nValueSizeUsed;
+ OMX_U8 nValue[1];
+} OMX_CONFIG_METADATAITEMTYPE;
+
+/* @ingroup metadata */
+typedef struct OMX_CONFIG_CONTAINERNODECOUNTTYPE
+{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_BOOL bAllKeys;
+ OMX_U32 nParentNodeID;
+ OMX_U32 nNumNodes;
+} OMX_CONFIG_CONTAINERNODECOUNTTYPE;
+
+/** @ingroup metadata */
+typedef struct OMX_CONFIG_CONTAINERNODEIDTYPE
+{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_BOOL bAllKeys;
+ OMX_U32 nParentNodeID;
+ OMX_U32 nNodeIndex;
+ OMX_U32 nNodeID;
+ OMX_STRING cNodeName;
+ OMX_BOOL bIsLeafType;
+} OMX_CONFIG_CONTAINERNODEIDTYPE;
+
+/** @ingroup metadata */
+typedef struct OMX_PARAM_METADATAFILTERTYPE
+{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_BOOL bAllKeys; /* if true then this structure refers to all keys and
+ * the three key fields below are ignored */
+ OMX_METADATACHARSETTYPE eKeyCharset;
+ OMX_U32 nKeySizeUsed;
+ OMX_U8 nKey [128];
+ OMX_U32 nLanguageCountrySizeUsed;
+ OMX_U8 nLanguageCountry[128];
+ OMX_BOOL bEnabled; /* if true then key is part of filter (e.g.
+ * retained for query later). If false then
+ * key is not part of filter */
+} OMX_PARAM_METADATAFILTERTYPE;
+
+/** The OMX_HANDLETYPE structure defines the component handle. The component
+ * handle is used to access all of the component's public methods and also
+ * contains pointers to the component's private data area. The component
+ * handle is initialized by the OMX core (with help from the component)
+ * during the process of loading the component. After the component is
+ * successfully loaded, the application can safely access any of the
+ * component's public functions (although some may return an error because
+ * the state is inappropriate for the access).
+ *
+ * @ingroup comp
+ */
+typedef struct OMX_COMPONENTTYPE
+{
+ /** The size of this structure, in bytes. It is the responsibility
+ of the allocator of this structure to fill in this value. Since
+ this structure is allocated by the GetHandle function, this
+ function will fill in this value. */
+ OMX_U32 nSize;
+
+ /** nVersion is the version of the OMX specification that the structure
+ is built against. It is the responsibility of the creator of this
+ structure to initialize this value and every user of this structure
+ should verify that it knows how to use the exact version of
+ this structure found herein. */
+ OMX_VERSIONTYPE nVersion;
+
+ /** pComponentPrivate is a pointer to the component private data area.
+ This member is allocated and initialized by the component when the
+ component is first loaded. The application should not access this
+ data area. */
+ OMX_PTR pComponentPrivate;
+
+ /** pApplicationPrivate is a pointer that is a parameter to the
+ OMX_GetHandle method, and contains an application private value
+ provided by the IL client. This application private data is
+ returned to the IL Client by OMX in all callbacks */
+ OMX_PTR pApplicationPrivate;
+
+ /** refer to OMX_GetComponentVersion in OMX_core.h or the OMX IL
+ specification for details on the GetComponentVersion method.
+ */
+ OMX_ERRORTYPE (*GetComponentVersion)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_OUT OMX_STRING pComponentName,
+ OMX_OUT OMX_VERSIONTYPE* pComponentVersion,
+ OMX_OUT OMX_VERSIONTYPE* pSpecVersion,
+ OMX_OUT OMX_UUIDTYPE* pComponentUUID);
+
+ /** refer to OMX_SendCommand in OMX_core.h or the OMX IL
+ specification for details on the SendCommand method.
+ */
+ OMX_ERRORTYPE (*SendCommand)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_COMMANDTYPE Cmd,
+ OMX_IN OMX_U32 nParam1,
+ OMX_IN OMX_PTR pCmdData);
+
+ /** refer to OMX_GetParameter in OMX_core.h or the OMX IL
+ specification for details on the GetParameter method.
+ */
+ OMX_ERRORTYPE (*GetParameter)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_INDEXTYPE nParamIndex,
+ OMX_INOUT OMX_PTR pComponentParameterStructure);
+
+
+ /** refer to OMX_SetParameter in OMX_core.h or the OMX IL
+ specification for details on the SetParameter method.
+ */
+ OMX_ERRORTYPE (*SetParameter)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_INDEXTYPE nIndex,
+ OMX_IN OMX_PTR pComponentParameterStructure);
+
+
+ /** refer to OMX_GetConfig in OMX_core.h or the OMX IL
+ specification for details on the GetConfig method.
+ */
+ OMX_ERRORTYPE (*GetConfig)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_INDEXTYPE nIndex,
+ OMX_INOUT OMX_PTR pComponentConfigStructure);
+
+
+ /** refer to OMX_SetConfig in OMX_core.h or the OMX IL
+ specification for details on the SetConfig method.
+ */
+ OMX_ERRORTYPE (*SetConfig)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_INDEXTYPE nIndex,
+ OMX_IN OMX_PTR pComponentConfigStructure);
+
+
+ /** refer to OMX_GetExtensionIndex in OMX_core.h or the OMX IL
+ specification for details on the GetExtensionIndex method.
+ */
+ OMX_ERRORTYPE (*GetExtensionIndex)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_STRING cParameterName,
+ OMX_OUT OMX_INDEXTYPE* pIndexType);
+
+
+ /** refer to OMX_GetState in OMX_core.h or the OMX IL
+ specification for details on the GetState method.
+ */
+ OMX_ERRORTYPE (*GetState)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_OUT OMX_STATETYPE* pState);
+
+
+ /** The ComponentTunnelRequest method will interact with another OMX
+ component to determine if tunneling is possible and to setup the
+ tunneling. The return codes for this method can be used to
+ determine if tunneling is not possible, or if tunneling is not
+ supported.
+
+ Base profile components (i.e. non-interop) do not support this
+ method and should return OMX_ErrorNotImplemented
+
+ The interop profile component MUST support tunneling to another
+ interop profile component with a compatible port parameters.
+ A component may also support proprietary communication.
+
+ If proprietary communication is supported the negotiation of
+ proprietary communication is done outside of OMX in a vendor
+ specific way. It is only required that the proper result be
+ returned and the details of how the setup is done is left
+ to the component implementation.
+
+ When this method is invoked when nPort in an output port, the
+ component will:
+ 1. Populate the pTunnelSetup structure with the output port's
+ requirements and constraints for the tunnel.
+
+ When this method is invoked when nPort in an input port, the
+ component will:
+ 1. Query the necessary parameters from the output port to
+ determine if the ports are compatible for tunneling
+ 2. If the ports are compatible, the component should store
+ the tunnel step provided by the output port
+ 3. Determine which port (either input or output) is the buffer
+ supplier, and call OMX_SetParameter on the output port to
+ indicate this selection.
+
+ The component will return from this call within 5 msec.
+
+ @param [in] hComp
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the OMX_GetHandle method.
+ @param [in] nPort
+ nPort is used to select the port on the component to be used
+ for tunneling.
+ @param [in] hTunneledComp
+ Handle of the component to tunnel with. This is the component
+ handle returned by the call to the OMX_GetHandle method. When
+ this parameter is 0x0 the component should setup the port for
+ communication with the application / IL Client.
+ @param [in] nPortOutput
+ nPortOutput is used indicate the port the component should
+ tunnel with.
+ @param [in] pTunnelSetup
+ Pointer to the tunnel setup structure. When nPort is an output port
+ the component should populate the fields of this structure. When
+ When nPort is an input port the component should review the setup
+ provided by the component with the output port.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ @ingroup tun
+ */
+
+ OMX_ERRORTYPE (*ComponentTunnelRequest)(
+ OMX_IN OMX_HANDLETYPE hComp,
+ OMX_IN OMX_U32 nPort,
+ OMX_IN OMX_HANDLETYPE hTunneledComp,
+ OMX_IN OMX_U32 nTunneledPort,
+ OMX_INOUT OMX_TUNNELSETUPTYPE* pTunnelSetup);
+
+ /** refer to OMX_UseBuffer in OMX_core.h or the OMX IL
+ specification for details on the UseBuffer method.
+ @ingroup buf
+ */
+ OMX_ERRORTYPE (*UseBuffer)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_INOUT OMX_BUFFERHEADERTYPE** ppBufferHdr,
+ OMX_IN OMX_U32 nPortIndex,
+ OMX_IN OMX_PTR pAppPrivate,
+ OMX_IN OMX_U32 nSizeBytes,
+ OMX_IN OMX_U8* pBuffer);
+
+ /** refer to OMX_AllocateBuffer in OMX_core.h or the OMX IL
+ specification for details on the AllocateBuffer method.
+ @ingroup buf
+ */
+ OMX_ERRORTYPE (*AllocateBuffer)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_INOUT OMX_BUFFERHEADERTYPE** ppBuffer,
+ OMX_IN OMX_U32 nPortIndex,
+ OMX_IN OMX_PTR pAppPrivate,
+ OMX_IN OMX_U32 nSizeBytes);
+
+ /** refer to OMX_FreeBuffer in OMX_core.h or the OMX IL
+ specification for details on the FreeBuffer method.
+ @ingroup buf
+ */
+ OMX_ERRORTYPE (*FreeBuffer)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_U32 nPortIndex,
+ OMX_IN OMX_BUFFERHEADERTYPE* pBuffer);
+
+ /** refer to OMX_EmptyThisBuffer in OMX_core.h or the OMX IL
+ specification for details on the EmptyThisBuffer method.
+ @ingroup buf
+ */
+ OMX_ERRORTYPE (*EmptyThisBuffer)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_BUFFERHEADERTYPE* pBuffer);
+
+ /** refer to OMX_FillThisBuffer in OMX_core.h or the OMX IL
+ specification for details on the FillThisBuffer method.
+ @ingroup buf
+ */
+ OMX_ERRORTYPE (*FillThisBuffer)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_BUFFERHEADERTYPE* pBuffer);
+
+ /** The SetCallbacks method is used by the core to specify the callback
+ structure from the application to the component. This is a blocking
+ call. The component will return from this call within 5 msec.
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the GetHandle function.
+ @param [in] pCallbacks
+ pointer to an OMX_CALLBACKTYPE structure used to provide the
+ callback information to the component
+ @param [in] pAppData
+ pointer to an application defined value. It is anticipated that
+ the application will pass a pointer to a data structure or a "this
+ pointer" in this area to allow the callback (in the application)
+ to determine the context of the call
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ */
+ OMX_ERRORTYPE (*SetCallbacks)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_CALLBACKTYPE* pCallbacks,
+ OMX_IN OMX_PTR pAppData);
+
+ /** ComponentDeInit method is used to deinitialize the component
+ providing a means to free any resources allocated at component
+ initialization. NOTE: After this call the component handle is
+ not valid for further use.
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the GetHandle function.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ */
+ OMX_ERRORTYPE (*ComponentDeInit)(
+ OMX_IN OMX_HANDLETYPE hComponent);
+
+ /** @ingroup buf */
+ OMX_ERRORTYPE (*UseEGLImage)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_INOUT OMX_BUFFERHEADERTYPE** ppBufferHdr,
+ OMX_IN OMX_U32 nPortIndex,
+ OMX_IN OMX_PTR pAppPrivate,
+ OMX_IN void* eglImage);
+
+ OMX_ERRORTYPE (*ComponentRoleEnum)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_OUT OMX_U8 *cRole,
+ OMX_IN OMX_U32 nIndex);
+
+} OMX_COMPONENTTYPE;
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
+/* File EOF */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/khronos_api/v1_1_2/OMX_ContentPipe.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,195 @@
+/*
+ * Copyright (c) 2008 The Khronos Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject
+ * to the following conditions:
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+/** OMX_ContentPipe.h - OpenMax IL version 1.1.2
+ * The OMX_ContentPipe header file contains the definitions used to define
+ * the public interface for content piples. This header file is intended to
+ * be used by the component.
+ */
+
+#ifndef OMX_CONTENTPIPE_H
+#define OMX_CONTENTPIPE_H
+
+#ifndef KD_EACCES
+/* OpenKODE error codes. CPResult values may be zero (indicating success
+ or one of the following values) */
+#define KD_EACCES (1)
+#define KD_EADDRINUSE (2)
+#define KD_EAGAIN (5)
+#define KD_EBADF (7)
+#define KD_EBUSY (8)
+#define KD_ECONNREFUSED (9)
+#define KD_ECONNRESET (10)
+#define KD_EDEADLK (11)
+#define KD_EDESTADDRREQ (12)
+#define KD_ERANGE (35)
+#define KD_EEXIST (13)
+#define KD_EFBIG (14)
+#define KD_EHOSTUNREACH (15)
+#define KD_EINVAL (17)
+#define KD_EIO (18)
+#define KD_EISCONN (20)
+#define KD_EISDIR (21)
+#define KD_EMFILE (22)
+#define KD_ENAMETOOLONG (23)
+#define KD_ENOENT (24)
+#define KD_ENOMEM (25)
+#define KD_ENOSPC (26)
+#define KD_ENOSYS (27)
+#define KD_ENOTCONN (28)
+#define KD_EPERM (33)
+#define KD_ETIMEDOUT (36)
+#define KD_EILSEQ (19)
+#endif
+
+/** Map types from OMX standard types only here so interface is as generic as possible. */
+typedef OMX_U32 CPresult;
+typedef char * CPstring;
+typedef void * CPhandle;
+typedef OMX_U32 CPuint;
+typedef OMX_S32 CPint;
+typedef char CPbyte;
+typedef OMX_BOOL CPbool;
+
+/** enumeration of origin types used in the CP_PIPETYPE's Seek function
+ * @ingroup cp
+ */
+typedef enum CP_ORIGINTYPE {
+ CP_OriginBegin,
+ CP_OriginCur,
+ CP_OriginEnd,
+ CP_OriginKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ CP_OriginVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ CP_OriginMax = 0X7FFFFFFF
+} CP_ORIGINTYPE;
+
+/** enumeration of contact access types used in the CP_PIPETYPE's Open function
+ * @ingroup cp
+ */
+typedef enum CP_ACCESSTYPE {
+ CP_AccessRead,
+ CP_AccessWrite,
+ CP_AccessReadWrite ,
+ CP_AccessKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ CP_AccessVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ CP_AccessMax = 0X7FFFFFFF
+} CP_ACCESSTYPE;
+
+/** enumeration of results returned by the CP_PIPETYPE's CheckAvailableBytes function
+ * @ingroup cp
+ */
+typedef enum CP_CHECKBYTESRESULTTYPE
+{
+ CP_CheckBytesOk, /**< There are at least the request number
+ of bytes available */
+ CP_CheckBytesNotReady, /**< The pipe is still retrieving bytes
+ and presently lacks sufficient bytes.
+ Client will be called when they are
+ sufficient bytes are available. */
+ CP_CheckBytesInsufficientBytes , /**< The pipe has retrieved all bytes
+ but those available are less than those
+ requested */
+ CP_CheckBytesAtEndOfStream, /**< The pipe has reached the end of stream
+ and no more bytes are available. */
+ CP_CheckBytesOutOfBuffers, /**< All read/write buffers are currently in use. */
+ CP_CheckBytesKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ CP_CheckBytesVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ CP_CheckBytesMax = 0X7FFFFFFF
+} CP_CHECKBYTESRESULTTYPE;
+
+/** enumeration of content pipe events sent to the client callback.
+ * @ingroup cp
+ */
+typedef enum CP_EVENTTYPE{
+ CP_BytesAvailable, /** bytes requested in a CheckAvailableBytes call are now available*/
+ CP_Overflow, /** enumeration of content pipe events sent to the client callback*/
+ CP_PipeDisconnected , /** enumeration of content pipe events sent to the client callback*/
+ CP_EventKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ CP_EventVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ CP_EventMax = 0X7FFFFFFF
+} CP_EVENTTYPE;
+
+/** content pipe definition
+ * @ingroup cp
+ */
+typedef struct CP_PIPETYPE
+{
+ /** Open a content stream for reading or writing. */
+ CPresult (*Open)( CPhandle* hContent, CPstring szURI, CP_ACCESSTYPE eAccess );
+
+ /** Close a content stream. */
+ CPresult (*Close)( CPhandle hContent );
+
+ /** Create a content source and open it for writing. */
+ CPresult (*Create)( CPhandle *hContent, CPstring szURI );
+
+ /** Check the that specified number of bytes are available for reading or writing (depending on access type).*/
+ CPresult (*CheckAvailableBytes)( CPhandle hContent, CPuint nBytesRequested, CP_CHECKBYTESRESULTTYPE *eResult );
+
+ /** Seek to certain position in the content relative to the specified origin. */
+ CPresult (*SetPosition)( CPhandle hContent, CPint nOffset, CP_ORIGINTYPE eOrigin);
+
+ /** Retrieve the current position relative to the start of the content. */
+ CPresult (*GetPosition)( CPhandle hContent, CPuint *pPosition);
+
+ /** Retrieve data of the specified size from the content stream (advance content pointer by size of data).
+ Note: pipe client provides pointer. This function is appropriate for small high frequency reads. */
+ CPresult (*Read)( CPhandle hContent, CPbyte *pData, CPuint nSize);
+
+ /** Retrieve a buffer allocated by the pipe that contains the requested number of bytes.
+ Buffer contains the next block of bytes, as specified by nSize, of the content. nSize also
+ returns the size of the block actually read. Content pointer advances the by the returned size.
+ Note: pipe provides pointer. This function is appropriate for large reads. The client must call
+ ReleaseReadBuffer when done with buffer.
+
+ In some cases the requested block may not reside in contiguous memory within the
+ pipe implementation. For instance if the pipe leverages a circular buffer then the requested
+ block may straddle the boundary of the circular buffer. By default a pipe implementation
+ performs a copy in this case to provide the block to the pipe client in one contiguous buffer.
+ If, however, the client sets bForbidCopy, then the pipe returns only those bytes preceding the memory
+ boundary. Here the client may retrieve the data in segments over successive calls. */
+ CPresult (*ReadBuffer)( CPhandle hContent, CPbyte **ppBuffer, CPuint *nSize, CPbool bForbidCopy);
+
+ /** Release a buffer obtained by ReadBuffer back to the pipe. */
+ CPresult (*ReleaseReadBuffer)(CPhandle hContent, CPbyte *pBuffer);
+
+ /** Write data of the specified size to the content (advance content pointer by size of data).
+ Note: pipe client provides pointer. This function is appropriate for small high frequency writes. */
+ CPresult (*Write)( CPhandle hContent, CPbyte *data, CPuint nSize);
+
+ /** Retrieve a buffer allocated by the pipe used to write data to the content.
+ Client will fill buffer with output data. Note: pipe provides pointer. This function is appropriate
+ for large writes. The client must call WriteBuffer when done it has filled the buffer with data.*/
+ CPresult (*GetWriteBuffer)( CPhandle hContent, CPbyte **ppBuffer, CPuint nSize);
+
+ /** Deliver a buffer obtained via GetWriteBuffer to the pipe. Pipe will write the
+ the contents of the buffer to content and advance content pointer by the size of the buffer */
+ CPresult (*WriteBuffer)( CPhandle hContent, CPbyte *pBuffer, CPuint nFilledSize);
+
+ /** Register a per-handle client callback with the content pipe. */
+ CPresult (*RegisterCallback)( CPhandle hContent, CPresult (*ClientCallback)(CP_EVENTTYPE eEvent, CPuint iParam));
+
+} CP_PIPETYPE;
+
+#endif
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/khronos_api/v1_1_2/OMX_Core.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,1431 @@
+/*
+ * Copyright (c) 2008 The Khronos Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject
+ * to the following conditions:
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+/** OMX_Core.h - OpenMax IL version 1.1.2
+ * The OMX_Core header file contains the definitions used by both the
+ * application and the component to access common items.
+ */
+
+#ifndef OMX_Core_h
+#define OMX_Core_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/* Each OMX header shall include all required header files to allow the
+ * header to compile without errors. The includes below are required
+ * for this header file to compile successfully
+ */
+
+#include <openmax/il/khronos/v1_x/OMX_Index.h>
+
+
+/** The OMX_COMMANDTYPE enumeration is used to specify the action in the
+ * OMX_SendCommand macro.
+ * @ingroup core
+ */
+typedef enum OMX_COMMANDTYPE
+{
+ OMX_CommandStateSet, /**< Change the component state */
+ OMX_CommandFlush, /**< Flush the data queue(s) of a component */
+ OMX_CommandPortDisable, /**< Disable a port on a component. */
+ OMX_CommandPortEnable, /**< Enable a port on a component. */
+ OMX_CommandMarkBuffer, /**< Mark a component/buffer for observation */
+ OMX_CommandKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_CommandVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_CommandMax = 0X7FFFFFFF
+} OMX_COMMANDTYPE;
+
+
+
+/** The OMX_STATETYPE enumeration is used to indicate or change the component
+ * state. This enumeration reflects the current state of the component when
+ * used with the OMX_GetState macro or becomes the parameter in a state change
+ * command when used with the OMX_SendCommand macro.
+ *
+ * The component will be in the Loaded state after the component is initially
+ * loaded into memory. In the Loaded state, the component is not allowed to
+ * allocate or hold resources other than to build it's internal parameter
+ * and configuration tables. The application will send one or more
+ * SetParameters/GetParameters and SetConfig/GetConfig commands to the
+ * component and the component will record each of these parameter and
+ * configuration changes for use later. When the application sends the
+ * Idle command, the component will acquire the resources needed for the
+ * specified configuration and will transition to the idle state if the
+ * allocation is successful. If the component cannot successfully
+ * transition to the idle state for any reason, the state of the component
+ * shall be fully rolled back to the Loaded state (e.g. all allocated
+ * resources shall be released). When the component receives the command
+ * to go to the Executing state, it shall begin processing buffers by
+ * sending all input buffers it holds to the application. While
+ * the component is in the Idle state, the application may also send the
+ * Pause command. If the component receives the pause command while in the
+ * Idle state, the component shall send all input buffers it holds to the
+ * application, but shall not begin processing buffers. This will allow the
+ * application to prefill buffers.
+ *
+ * @ingroup comp
+ */
+
+typedef enum OMX_STATETYPE
+{
+ OMX_StateInvalid, /**< component has detected that it's internal data
+ structures are corrupted to the point that
+ it cannot determine it's state properly */
+ OMX_StateLoaded, /**< component has been loaded but has not completed
+ initialization. The OMX_SetParameter macro
+ and the OMX_GetParameter macro are the only
+ valid macros allowed to be sent to the
+ component in this state. */
+ OMX_StateIdle, /**< component initialization has been completed
+ successfully and the component is ready to
+ to start. */
+ OMX_StateExecuting, /**< component has accepted the start command and
+ is processing data (if data is available) */
+ OMX_StatePause, /**< component has received pause command */
+ OMX_StateWaitForResources, /**< component is waiting for resources, either after
+ preemption or before it gets the resources requested.
+ See specification for complete details. */
+ OMX_StateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_StateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_StateMax = 0X7FFFFFFF
+} OMX_STATETYPE;
+
+/** The OMX_ERRORTYPE enumeration defines the standard OMX Errors. These
+ * errors should cover most of the common failure cases. However,
+ * vendors are free to add additional error messages of their own as
+ * long as they follow these rules:
+ * 1. Vendor error messages shall be in the range of 0x90000000 to
+ * 0x9000FFFF.
+ * 2. Vendor error messages shall be defined in a header file provided
+ * with the component. No error messages are allowed that are
+ * not defined.
+ */
+typedef enum OMX_ERRORTYPE
+{
+ OMX_ErrorNone = 0,
+
+ /** There were insufficient resources to perform the requested operation */
+ OMX_ErrorInsufficientResources = (OMX_S32) 0x80001000,
+
+ /** There was an error, but the cause of the error could not be determined */
+ OMX_ErrorUndefined = (OMX_S32) 0x80001001,
+
+ /** The component name string was not valid */
+ OMX_ErrorInvalidComponentName = (OMX_S32) 0x80001002,
+
+ /** No component with the specified name string was found */
+ OMX_ErrorComponentNotFound = (OMX_S32) 0x80001003,
+
+ /** The component specified did not have a "OMX_ComponentInit" or
+ "OMX_ComponentDeInit entry point */
+ OMX_ErrorInvalidComponent = (OMX_S32) 0x80001004,
+
+ /** One or more parameters were not valid */
+ OMX_ErrorBadParameter = (OMX_S32) 0x80001005,
+
+ /** The requested function is not implemented */
+ OMX_ErrorNotImplemented = (OMX_S32) 0x80001006,
+
+ /** The buffer was emptied before the next buffer was ready */
+ OMX_ErrorUnderflow = (OMX_S32) 0x80001007,
+
+ /** The buffer was not available when it was needed */
+ OMX_ErrorOverflow = (OMX_S32) 0x80001008,
+
+ /** The hardware failed to respond as expected */
+ OMX_ErrorHardware = (OMX_S32) 0x80001009,
+
+ /** The component is in the state OMX_StateInvalid */
+ OMX_ErrorInvalidState = (OMX_S32) 0x8000100A,
+
+ /** Stream is found to be corrupt */
+ OMX_ErrorStreamCorrupt = (OMX_S32) 0x8000100B,
+
+ /** Ports being connected are not compatible */
+ OMX_ErrorPortsNotCompatible = (OMX_S32) 0x8000100C,
+
+ /** Resources allocated to an idle component have been
+ lost resulting in the component returning to the loaded state */
+ OMX_ErrorResourcesLost = (OMX_S32) 0x8000100D,
+
+ /** No more indicies can be enumerated */
+ OMX_ErrorNoMore = (OMX_S32) 0x8000100E,
+
+ /** The component detected a version mismatch */
+ OMX_ErrorVersionMismatch = (OMX_S32) 0x8000100F,
+
+ /** The component is not ready to return data at this time */
+ OMX_ErrorNotReady = (OMX_S32) 0x80001010,
+
+ /** There was a timeout that occurred */
+ OMX_ErrorTimeout = (OMX_S32) 0x80001011,
+
+ /** This error occurs when trying to transition into the state you are already in */
+ OMX_ErrorSameState = (OMX_S32) 0x80001012,
+
+ /** Resources allocated to an executing or paused component have been
+ preempted, causing the component to return to the idle state */
+ OMX_ErrorResourcesPreempted = (OMX_S32) 0x80001013,
+
+ /** A non-supplier port sends this error to the IL client (via the EventHandler callback)
+ during the allocation of buffers (on a transition from the LOADED to the IDLE state or
+ on a port restart) when it deems that it has waited an unusually long time for the supplier
+ to send it an allocated buffer via a UseBuffer call. */
+ OMX_ErrorPortUnresponsiveDuringAllocation = (OMX_S32) 0x80001014,
+
+ /** A non-supplier port sends this error to the IL client (via the EventHandler callback)
+ during the deallocation of buffers (on a transition from the IDLE to LOADED state or
+ on a port stop) when it deems that it has waited an unusually long time for the supplier
+ to request the deallocation of a buffer header via a FreeBuffer call. */
+ OMX_ErrorPortUnresponsiveDuringDeallocation = (OMX_S32) 0x80001015,
+
+ /** A supplier port sends this error to the IL client (via the EventHandler callback)
+ during the stopping of a port (either on a transition from the IDLE to LOADED
+ state or a port stop) when it deems that it has waited an unusually long time for
+ the non-supplier to return a buffer via an EmptyThisBuffer or FillThisBuffer call. */
+ OMX_ErrorPortUnresponsiveDuringStop = (OMX_S32) 0x80001016,
+
+ /** Attempting a state transtion that is not allowed */
+ OMX_ErrorIncorrectStateTransition = (OMX_S32) 0x80001017,
+
+ /* Attempting a command that is not allowed during the present state. */
+ OMX_ErrorIncorrectStateOperation = (OMX_S32) 0x80001018,
+
+ /** The values encapsulated in the parameter or config structure are not supported. */
+ OMX_ErrorUnsupportedSetting = (OMX_S32) 0x80001019,
+
+ /** The parameter or config indicated by the given index is not supported. */
+ OMX_ErrorUnsupportedIndex = (OMX_S32) 0x8000101A,
+
+ /** The port index supplied is incorrect. */
+ OMX_ErrorBadPortIndex = (OMX_S32) 0x8000101B,
+
+ /** The port has lost one or more of its buffers and it thus unpopulated. */
+ OMX_ErrorPortUnpopulated = (OMX_S32) 0x8000101C,
+
+ /** Component suspended due to temporary loss of resources */
+ OMX_ErrorComponentSuspended = (OMX_S32) 0x8000101D,
+
+ /** Component suspended due to an inability to acquire dynamic resources */
+ OMX_ErrorDynamicResourcesUnavailable = (OMX_S32) 0x8000101E,
+
+ /** When the macroblock error reporting is enabled the component returns new error
+ for every frame that has errors */
+ OMX_ErrorMbErrorsInFrame = (OMX_S32) 0x8000101F,
+
+ /** A component reports this error when it cannot parse or determine the format of an input stream. */
+ OMX_ErrorFormatNotDetected = (OMX_S32) 0x80001020,
+
+ /** The content open operation failed. */
+ OMX_ErrorContentPipeOpenFailed = (OMX_S32) 0x80001021,
+
+ /** The content creation operation failed. */
+ OMX_ErrorContentPipeCreationFailed = (OMX_S32) 0x80001022,
+
+ /** Separate table information is being used */
+ OMX_ErrorSeperateTablesUsed = (OMX_S32) 0x80001023,
+
+ /** Tunneling is unsupported by the component*/
+ OMX_ErrorTunnelingUnsupported = (OMX_S32) 0x80001024,
+
+ OMX_ErrorKhronosExtensions = (OMX_S32)0x8F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_ErrorVendorStartUnused = (OMX_S32)0x90000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_ErrorMax = 0x7FFFFFFF
+} OMX_ERRORTYPE;
+
+/** @ingroup core */
+typedef OMX_ERRORTYPE (* OMX_COMPONENTINITTYPE)(OMX_IN OMX_HANDLETYPE hComponent);
+
+/** @ingroup core */
+typedef struct OMX_COMPONENTREGISTERTYPE
+{
+ const char * pName; /* Component name, 128 byte limit (including '\0') applies */
+ OMX_COMPONENTINITTYPE pInitialize; /* Component instance initialization function */
+} OMX_COMPONENTREGISTERTYPE;
+
+/** @ingroup core */
+extern OMX_COMPONENTREGISTERTYPE OMX_ComponentRegistered[];
+
+/** @ingroup rpm */
+typedef struct OMX_PRIORITYMGMTTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nGroupPriority; /**< Priority of the component group */
+ OMX_U32 nGroupID; /**< ID of the component group */
+} OMX_PRIORITYMGMTTYPE;
+
+/* Component name and Role names are limited to 128 characters including the terminating '\0'. */
+#define OMX_MAX_STRINGNAME_SIZE 128
+
+/** @ingroup comp */
+typedef struct OMX_PARAM_COMPONENTROLETYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U8 cRole[OMX_MAX_STRINGNAME_SIZE]; /**< name of standard component which defines component role */
+} OMX_PARAM_COMPONENTROLETYPE;
+
+/** End of Stream Buffer Flag:
+ *
+ * A component sets EOS when it has no more data to emit on a particular
+ * output port. Thus an output port shall set EOS on the last buffer it
+ * emits. A component's determination of when an output port should
+ * cease sending data is implemenation specific.
+ * @ingroup buf
+ */
+
+#define OMX_BUFFERFLAG_EOS 0x00000001
+
+/** Start Time Buffer Flag:
+ *
+ * The source of a stream (e.g. a demux component) sets the STARTTIME
+ * flag on the buffer that contains the starting timestamp for the
+ * stream. The starting timestamp corresponds to the first data that
+ * should be displayed at startup or after a seek.
+ * The first timestamp of the stream is not necessarily the start time.
+ * For instance, in the case of a seek to a particular video frame,
+ * the target frame may be an interframe. Thus the first buffer of
+ * the stream will be the intra-frame preceding the target frame and
+ * the starttime will occur with the target frame (with any other
+ * required frames required to reconstruct the target intervening).
+ *
+ * The STARTTIME flag is directly associated with the buffer's
+ * timestamp ' thus its association to buffer data and its
+ * propagation is identical to the timestamp's.
+ *
+ * When a Sync Component client receives a buffer with the
+ * STARTTIME flag it shall perform a SetConfig on its sync port
+ * using OMX_ConfigTimeClientStartTime and passing the buffer's
+ * timestamp.
+ *
+ * @ingroup buf
+ */
+
+#define OMX_BUFFERFLAG_STARTTIME 0x00000002
+
+
+
+/** Decode Only Buffer Flag:
+ *
+ * The source of a stream (e.g. a demux component) sets the DECODEONLY
+ * flag on any buffer that should shall be decoded but should not be
+ * displayed. This flag is used, for instance, when a source seeks to
+ * a target interframe that requires the decode of frames preceding the
+ * target to facilitate the target's reconstruction. In this case the
+ * source would emit the frames preceding the target downstream
+ * but mark them as decode only.
+ *
+ * The DECODEONLY is associated with buffer data and propagated in a
+ * manner identical to the buffer timestamp.
+ *
+ * A component that renders data should ignore all buffers with
+ * the DECODEONLY flag set.
+ *
+ * @ingroup buf
+ */
+
+#define OMX_BUFFERFLAG_DECODEONLY 0x00000004
+
+
+/* Data Corrupt Flag: This flag is set when the IL client believes the data in the associated buffer is corrupt
+ * @ingroup buf
+ */
+
+#define OMX_BUFFERFLAG_DATACORRUPT 0x00000008
+
+/* End of Frame: The buffer contains exactly one end of frame and no data
+ * occurs after the end of frame. This flag is an optional hint. The absence
+ * of this flag does not imply the absence of an end of frame within the buffer.
+ * @ingroup buf
+*/
+#define OMX_BUFFERFLAG_ENDOFFRAME 0x00000010
+
+/* Sync Frame Flag: This flag is set when the buffer content contains a coded sync frame '
+ * a frame that has no dependency on any other frame information
+ * @ingroup buf
+ */
+#define OMX_BUFFERFLAG_SYNCFRAME 0x00000020
+
+/* Extra data present flag: there is extra data appended to the data stream
+ * residing in the buffer
+ * @ingroup buf
+ */
+#define OMX_BUFFERFLAG_EXTRADATA 0x00000040
+
+/** Codec Config Buffer Flag:
+* OMX_BUFFERFLAG_CODECCONFIG is an optional flag that is set by an
+* output port when all bytes in the buffer form part or all of a set of
+* codec specific configuration data. Examples include SPS/PPS nal units
+* for OMX_VIDEO_CodingAVC or AudioSpecificConfig data for
+* OMX_AUDIO_CodingAAC. Any component that for a given stream sets
+* OMX_BUFFERFLAG_CODECCONFIG shall not mix codec configuration bytes
+* with frame data in the same buffer, and shall send all buffers
+* containing codec configuration bytes before any buffers containing
+* frame data that those configurations bytes describe.
+* If the stream format for a particular codec has a frame specific
+* header at the start of each frame, for example OMX_AUDIO_CodingMP3 or
+* OMX_AUDIO_CodingAAC in ADTS mode, then these shall be presented as
+* normal without setting OMX_BUFFERFLAG_CODECCONFIG.
+ * @ingroup buf
+ */
+#define OMX_BUFFERFLAG_CODECCONFIG 0x00000080
+
+
+
+/** @ingroup buf */
+typedef struct OMX_BUFFERHEADERTYPE
+{
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U8* pBuffer; /**< Pointer to actual block of memory
+ that is acting as the buffer */
+ OMX_U32 nAllocLen; /**< size of the buffer allocated, in bytes */
+ OMX_U32 nFilledLen; /**< number of bytes currently in the
+ buffer */
+ OMX_U32 nOffset; /**< start offset of valid data in bytes from
+ the start of the buffer */
+ OMX_PTR pAppPrivate; /**< pointer to any data the application
+ wants to associate with this buffer */
+ OMX_PTR pPlatformPrivate; /**< pointer to any data the platform
+ wants to associate with this buffer */
+ OMX_PTR pInputPortPrivate; /**< pointer to any data the input port
+ wants to associate with this buffer */
+ OMX_PTR pOutputPortPrivate; /**< pointer to any data the output port
+ wants to associate with this buffer */
+ OMX_HANDLETYPE hMarkTargetComponent; /**< The component that will generate a
+ mark event upon processing this buffer. */
+ OMX_PTR pMarkData; /**< Application specific data associated with
+ the mark sent on a mark event to disambiguate
+ this mark from others. */
+ OMX_U32 nTickCount; /**< Optional entry that the component and
+ application can update with a tick count
+ when they access the component. This
+ value should be in microseconds. Since
+ this is a value relative to an arbitrary
+ starting point, this value cannot be used
+ to determine absolute time. This is an
+ optional entry and not all components
+ will update it.*/
+ OMX_TICKS nTimeStamp; /**< Timestamp corresponding to the sample
+ starting at the first logical sample
+ boundary in the buffer. Timestamps of
+ successive samples within the buffer may
+ be inferred by adding the duration of the
+ of the preceding buffer to the timestamp
+ of the preceding buffer.*/
+ OMX_U32 nFlags; /**< buffer specific flags */
+ OMX_U32 nOutputPortIndex; /**< The index of the output port (if any) using
+ this buffer */
+ OMX_U32 nInputPortIndex; /**< The index of the input port (if any) using
+ this buffer */
+} OMX_BUFFERHEADERTYPE;
+
+/** The OMX_EXTRADATATYPE enumeration is used to define the
+ * possible extra data payload types.
+ * NB: this enum is binary backwards compatible with the previous
+ * OMX_EXTRADATA_QUANT define. This should be replaced with
+ * OMX_ExtraDataQuantization.
+ */
+typedef enum OMX_EXTRADATATYPE
+{
+ OMX_ExtraDataNone = 0, /**< Indicates that no more extra data sections follow */
+ OMX_ExtraDataQuantization, /**< The data payload contains quantization data */
+ OMX_ExtraDataKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_ExtraDataVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_ExtraDataMax = 0x7FFFFFFF
+} OMX_EXTRADATATYPE;
+
+
+typedef struct OMX_OTHER_EXTRADATATYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_EXTRADATATYPE eType; /* Extra Data type */
+ OMX_U32 nDataSize; /* Size of the supporting data to follow */
+ OMX_U8 data[1]; /* Supporting data hint */
+} OMX_OTHER_EXTRADATATYPE;
+
+/** @ingroup comp */
+typedef struct OMX_PORT_PARAM_TYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPorts; /**< The number of ports for this component */
+ OMX_U32 nStartPortNumber; /** first port number for this type of port */
+} OMX_PORT_PARAM_TYPE;
+
+/** @ingroup comp */
+typedef enum OMX_EVENTTYPE
+{
+ OMX_EventCmdComplete, /**< component has sucessfully completed a command */
+ OMX_EventError, /**< component has detected an error condition */
+ OMX_EventMark, /**< component has detected a buffer mark */
+ OMX_EventPortSettingsChanged, /**< component is reported a port settings change */
+ OMX_EventBufferFlag, /**< component has detected an EOS */
+ OMX_EventResourcesAcquired, /**< component has been granted resources and is
+ automatically starting the state change from
+ OMX_StateWaitForResources to OMX_StateIdle. */
+ OMX_EventComponentResumed, /**< Component resumed due to reacquisition of resources */
+ OMX_EventDynamicResourcesAvailable, /**< Component has acquired previously unavailable dynamic resources */
+ OMX_EventPortFormatDetected, /**< Component has detected a supported format. */
+ OMX_EventKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_EventVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_EventMax = 0x7FFFFFFF
+} OMX_EVENTTYPE;
+
+typedef struct OMX_CALLBACKTYPE
+{
+ /** The EventHandler method is used to notify the application when an
+ event of interest occurs. Events are defined in the OMX_EVENTTYPE
+ enumeration. Please see that enumeration for details of what will
+ be returned for each type of event. Callbacks should not return
+ an error to the component, so if an error occurs, the application
+ shall handle it internally. This is a blocking call.
+
+ The application should return from this call within 5 msec to avoid
+ blocking the component for an excessively long period of time.
+
+ @param hComponent
+ handle of the component to access. This is the component
+ handle returned by the call to the GetHandle function.
+ @param pAppData
+ pointer to an application defined value that was provided in the
+ pAppData parameter to the OMX_GetHandle method for the component.
+ This application defined value is provided so that the application
+ can have a component specific context when receiving the callback.
+ @param eEvent
+ Event that the component wants to notify the application about.
+ @param nData1
+ nData will be the OMX_ERRORTYPE for an error event and will be
+ an OMX_COMMANDTYPE for a command complete event and OMX_INDEXTYPE for a OMX_PortSettingsChanged event.
+ @param nData2
+ nData2 will hold further information related to the event. Can be OMX_STATETYPE for
+ a OMX_CommandStateSet command or port index for a OMX_PortSettingsChanged event.
+ Default value is 0 if not used. )
+ @param pEventData
+ Pointer to additional event-specific data (see spec for meaning).
+ */
+
+ OMX_ERRORTYPE (*EventHandler)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_PTR pAppData,
+ OMX_IN OMX_EVENTTYPE eEvent,
+ OMX_IN OMX_U32 nData1,
+ OMX_IN OMX_U32 nData2,
+ OMX_IN OMX_PTR pEventData);
+
+ /** The EmptyBufferDone method is used to return emptied buffers from an
+ input port back to the application for reuse. This is a blocking call
+ so the application should not attempt to refill the buffers during this
+ call, but should queue them and refill them in another thread. There
+ is no error return, so the application shall handle any errors generated
+ internally.
+
+ The application should return from this call within 5 msec.
+
+ @param hComponent
+ handle of the component to access. This is the component
+ handle returned by the call to the GetHandle function.
+ @param pAppData
+ pointer to an application defined value that was provided in the
+ pAppData parameter to the OMX_GetHandle method for the component.
+ This application defined value is provided so that the application
+ can have a component specific context when receiving the callback.
+ @param pBuffer
+ pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer
+ or AllocateBuffer indicating the buffer that was emptied.
+ @ingroup buf
+ */
+ OMX_ERRORTYPE (*EmptyBufferDone)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_PTR pAppData,
+ OMX_IN OMX_BUFFERHEADERTYPE* pBuffer);
+
+ /** The FillBufferDone method is used to return filled buffers from an
+ output port back to the application for emptying and then reuse.
+ This is a blocking call so the application should not attempt to
+ empty the buffers during this call, but should queue the buffers
+ and empty them in another thread. There is no error return, so
+ the application shall handle any errors generated internally. The
+ application shall also update the buffer header to indicate the
+ number of bytes placed into the buffer.
+
+ The application should return from this call within 5 msec.
+
+ @param hComponent
+ handle of the component to access. This is the component
+ handle returned by the call to the GetHandle function.
+ @param pAppData
+ pointer to an application defined value that was provided in the
+ pAppData parameter to the OMX_GetHandle method for the component.
+ This application defined value is provided so that the application
+ can have a component specific context when receiving the callback.
+ @param pBuffer
+ pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer
+ or AllocateBuffer indicating the buffer that was filled.
+ @ingroup buf
+ */
+ OMX_ERRORTYPE (*FillBufferDone)(
+ OMX_OUT OMX_HANDLETYPE hComponent,
+ OMX_OUT OMX_PTR pAppData,
+ OMX_OUT OMX_BUFFERHEADERTYPE* pBuffer);
+
+} OMX_CALLBACKTYPE;
+
+/** The OMX_BUFFERSUPPLIERTYPE enumeration is used to dictate port supplier
+ preference when tunneling between two ports.
+ @ingroup tun buf
+*/
+typedef enum OMX_BUFFERSUPPLIERTYPE
+{
+ OMX_BufferSupplyUnspecified = 0x0, /**< port supplying the buffers is unspecified,
+ or don't care */
+ OMX_BufferSupplyInput, /**< input port supplies the buffers */
+ OMX_BufferSupplyOutput, /**< output port supplies the buffers */
+ OMX_BufferSupplyKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_BufferSupplyVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_BufferSupplyMax = 0x7FFFFFFF
+} OMX_BUFFERSUPPLIERTYPE;
+
+
+/** buffer supplier parameter
+ * @ingroup tun
+ */
+typedef struct OMX_PARAM_BUFFERSUPPLIERTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_BUFFERSUPPLIERTYPE eBufferSupplier; /**< buffer supplier */
+} OMX_PARAM_BUFFERSUPPLIERTYPE;
+
+
+/**< indicates that buffers received by an input port of a tunnel
+ may not modify the data in the buffers
+ @ingroup tun
+ */
+#define OMX_PORTTUNNELFLAG_READONLY 0x00000001
+
+
+/** The OMX_TUNNELSETUPTYPE structure is used to pass data from an output
+ port to an input port as part the two ComponentTunnelRequest calls
+ resulting from a OMX_SetupTunnel call from the IL Client.
+ @ingroup tun
+ */
+typedef struct OMX_TUNNELSETUPTYPE
+{
+ OMX_U32 nTunnelFlags; /**< bit flags for tunneling */
+ OMX_BUFFERSUPPLIERTYPE eSupplier; /**< supplier preference */
+} OMX_TUNNELSETUPTYPE;
+
+/* OMX Component headers is included to enable the core to use
+ macros for functions into the component for OMX release 1.0.
+ Developers should not access any structures or data from within
+ the component header directly */
+/* TO BE REMOVED - #include <OMX_Component.h> */
+
+/** GetComponentVersion will return information about the component.
+ This is a blocking call. This macro will go directly from the
+ application to the component (via a core macro). The
+ component will return from this call within 5 msec.
+ @param [in] hComponent
+ handle of component to execute the command
+ @param [out] pComponentName
+ pointer to an empty string of length 128 bytes. The component
+ will write its name into this string. The name will be
+ terminated by a single zero byte. The name of a component will
+ be 127 bytes or less to leave room for the trailing zero byte.
+ An example of a valid component name is "OMX.ABC.ChannelMixer\0".
+ @param [out] pComponentVersion
+ pointer to an OMX Version structure that the component will fill
+ in. The component will fill in a value that indicates the
+ component version. NOTE: the component version is NOT the same
+ as the OMX Specification version (found in all structures). The
+ component version is defined by the vendor of the component and
+ its value is entirely up to the component vendor.
+ @param [out] pSpecVersion
+ pointer to an OMX Version structure that the component will fill
+ in. The SpecVersion is the version of the specification that the
+ component was built against. Please note that this value may or
+ may not match the structure's version. For example, if the
+ component was built against the 2.0 specification, but the
+ application (which creates the structure is built against the
+ 1.0 specification the versions would be different.
+ @param [out] pComponentUUID
+ pointer to the UUID of the component which will be filled in by
+ the component. The UUID is a unique identifier that is set at
+ RUN time for the component and is unique to each instantion of
+ the component.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ @ingroup comp
+ */
+#define OMX_GetComponentVersion( \
+ hComponent, \
+ pComponentName, \
+ pComponentVersion, \
+ pSpecVersion, \
+ pComponentUUID) \
+ ((OMX_COMPONENTTYPE*)hComponent)->GetComponentVersion( \
+ hComponent, \
+ pComponentName, \
+ pComponentVersion, \
+ pSpecVersion, \
+ pComponentUUID) /* Macro End */
+
+
+/** Send a command to the component. This call is a non-blocking call.
+ The component should check the parameters and then queue the command
+ to the component thread to be executed. The component thread shall
+ send the EventHandler() callback at the conclusion of the command.
+ This macro will go directly from the application to the component (via
+ a core macro). The component will return from this call within 5 msec.
+
+ When the command is "OMX_CommandStateSet" the component will queue a
+ state transition to the new state idenfied in nParam.
+
+ When the command is "OMX_CommandFlush", to flush a port's buffer queues,
+ the command will force the component to return all buffers NOT CURRENTLY
+ BEING PROCESSED to the application, in the order in which the buffers
+ were received.
+
+ When the command is "OMX_CommandPortDisable" or
+ "OMX_CommandPortEnable", the component's port (given by the value of
+ nParam) will be stopped or restarted.
+
+ When the command "OMX_CommandMarkBuffer" is used to mark a buffer, the
+ pCmdData will point to a OMX_MARKTYPE structure containing the component
+ handle of the component to examine the buffer chain for the mark. nParam1
+ contains the index of the port on which the buffer mark is applied.
+
+ Specification text for more details.
+
+ @param [in] hComponent
+ handle of component to execute the command
+ @param [in] Cmd
+ Command for the component to execute
+ @param [in] nParam
+ Parameter for the command to be executed. When Cmd has the value
+ OMX_CommandStateSet, value is a member of OMX_STATETYPE. When Cmd has
+ the value OMX_CommandFlush, value of nParam indicates which port(s)
+ to flush. -1 is used to flush all ports a single port index will
+ only flush that port. When Cmd has the value "OMX_CommandPortDisable"
+ or "OMX_CommandPortEnable", the component's port is given by
+ the value of nParam. When Cmd has the value "OMX_CommandMarkBuffer"
+ the components pot is given by the value of nParam.
+ @param [in] pCmdData
+ Parameter pointing to the OMX_MARKTYPE structure when Cmd has the value
+ "OMX_CommandMarkBuffer".
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ @ingroup comp
+ */
+#define OMX_SendCommand( \
+ hComponent, \
+ Cmd, \
+ nParam, \
+ pCmdData) \
+ ((OMX_COMPONENTTYPE*)hComponent)->SendCommand( \
+ hComponent, \
+ Cmd, \
+ nParam, \
+ pCmdData) /* Macro End */
+
+
+/** The OMX_GetParameter macro will get one of the current parameter
+ settings from the component. This macro cannot only be invoked when
+ the component is in the OMX_StateInvalid state. The nParamIndex
+ parameter is used to indicate which structure is being requested from
+ the component. The application shall allocate the correct structure
+ and shall fill in the structure size and version information before
+ invoking this macro. When the parameter applies to a port, the
+ caller shall fill in the appropriate nPortIndex value indicating the
+ port on which the parameter applies. If the component has not had
+ any settings changed, then the component should return a set of
+ valid DEFAULT parameters for the component. This is a blocking
+ call.
+
+ The component should return from this call within 20 msec.
+
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the OMX_GetHandle function.
+ @param [in] nParamIndex
+ Index of the structure to be filled. This value is from the
+ OMX_INDEXTYPE enumeration.
+ @param [in,out] pComponentParameterStructure
+ Pointer to application allocated structure to be filled by the
+ component.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ @ingroup comp
+ */
+#define OMX_GetParameter( \
+ hComponent, \
+ nParamIndex, \
+ pComponentParameterStructure) \
+ ((OMX_COMPONENTTYPE*)hComponent)->GetParameter( \
+ hComponent, \
+ nParamIndex, \
+ pComponentParameterStructure) /* Macro End */
+
+
+/** The OMX_SetParameter macro will send an initialization parameter
+ structure to a component. Each structure shall be sent one at a time,
+ in a separate invocation of the macro. This macro can only be
+ invoked when the component is in the OMX_StateLoaded state, or the
+ port is disabled (when the parameter applies to a port). The
+ nParamIndex parameter is used to indicate which structure is being
+ passed to the component. The application shall allocate the
+ correct structure and shall fill in the structure size and version
+ information (as well as the actual data) before invoking this macro.
+ The application is free to dispose of this structure after the call
+ as the component is required to copy any data it shall retain. This
+ is a blocking call.
+
+ The component should return from this call within 20 msec.
+
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the OMX_GetHandle function.
+ @param [in] nIndex
+ Index of the structure to be sent. This value is from the
+ OMX_INDEXTYPE enumeration.
+ @param [in] pComponentParameterStructure
+ pointer to application allocated structure to be used for
+ initialization by the component.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ @ingroup comp
+ */
+#define OMX_SetParameter( \
+ hComponent, \
+ nParamIndex, \
+ pComponentParameterStructure) \
+ ((OMX_COMPONENTTYPE*)hComponent)->SetParameter( \
+ hComponent, \
+ nParamIndex, \
+ pComponentParameterStructure) /* Macro End */
+
+
+/** The OMX_GetConfig macro will get one of the configuration structures
+ from a component. This macro can be invoked anytime after the
+ component has been loaded. The nParamIndex call parameter is used to
+ indicate which structure is being requested from the component. The
+ application shall allocate the correct structure and shall fill in the
+ structure size and version information before invoking this macro.
+ If the component has not had this configuration parameter sent before,
+ then the component should return a set of valid DEFAULT values for the
+ component. This is a blocking call.
+
+ The component should return from this call within 5 msec.
+
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the OMX_GetHandle function.
+ @param [in] nIndex
+ Index of the structure to be filled. This value is from the
+ OMX_INDEXTYPE enumeration.
+ @param [in,out] pComponentConfigStructure
+ pointer to application allocated structure to be filled by the
+ component.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ @ingroup comp
+*/
+#define OMX_GetConfig( \
+ hComponent, \
+ nConfigIndex, \
+ pComponentConfigStructure) \
+ ((OMX_COMPONENTTYPE*)hComponent)->GetConfig( \
+ hComponent, \
+ nConfigIndex, \
+ pComponentConfigStructure) /* Macro End */
+
+
+/** The OMX_SetConfig macro will send one of the configuration
+ structures to a component. Each structure shall be sent one at a time,
+ each in a separate invocation of the macro. This macro can be invoked
+ anytime after the component has been loaded. The application shall
+ allocate the correct structure and shall fill in the structure size
+ and version information (as well as the actual data) before invoking
+ this macro. The application is free to dispose of this structure after
+ the call as the component is required to copy any data it shall retain.
+ This is a blocking call.
+
+ The component should return from this call within 5 msec.
+
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the OMX_GetHandle function.
+ @param [in] nConfigIndex
+ Index of the structure to be sent. This value is from the
+ OMX_INDEXTYPE enumeration above.
+ @param [in] pComponentConfigStructure
+ pointer to application allocated structure to be used for
+ initialization by the component.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ @ingroup comp
+ */
+#define OMX_SetConfig( \
+ hComponent, \
+ nConfigIndex, \
+ pComponentConfigStructure) \
+ ((OMX_COMPONENTTYPE*)hComponent)->SetConfig( \
+ hComponent, \
+ nConfigIndex, \
+ pComponentConfigStructure) /* Macro End */
+
+
+/** The OMX_GetExtensionIndex macro will invoke a component to translate
+ a vendor specific configuration or parameter string into an OMX
+ structure index. There is no requirement for the vendor to support
+ this command for the indexes already found in the OMX_INDEXTYPE
+ enumeration (this is done to save space in small components). The
+ component shall support all vendor supplied extension indexes not found
+ in the master OMX_INDEXTYPE enumeration. This is a blocking call.
+
+ The component should return from this call within 5 msec.
+
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the GetHandle function.
+ @param [in] cParameterName
+ OMX_STRING that shall be less than 128 characters long including
+ the trailing null byte. This is the string that will get
+ translated by the component into a configuration index.
+ @param [out] pIndexType
+ a pointer to a OMX_INDEXTYPE to receive the index value.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ @ingroup comp
+ */
+#define OMX_GetExtensionIndex( \
+ hComponent, \
+ cParameterName, \
+ pIndexType) \
+ ((OMX_COMPONENTTYPE*)hComponent)->GetExtensionIndex( \
+ hComponent, \
+ cParameterName, \
+ pIndexType) /* Macro End */
+
+
+/** The OMX_GetState macro will invoke the component to get the current
+ state of the component and place the state value into the location
+ pointed to by pState.
+
+ The component should return from this call within 5 msec.
+
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the OMX_GetHandle function.
+ @param [out] pState
+ pointer to the location to receive the state. The value returned
+ is one of the OMX_STATETYPE members
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ @ingroup comp
+ */
+#define OMX_GetState( \
+ hComponent, \
+ pState) \
+ ((OMX_COMPONENTTYPE*)hComponent)->GetState( \
+ hComponent, \
+ pState) /* Macro End */
+
+
+/** The OMX_UseBuffer macro will request that the component use
+ a buffer (and allocate its own buffer header) already allocated
+ by another component, or by the IL Client. This is a blocking
+ call.
+
+ The component should return from this call within 20 msec.
+
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the OMX_GetHandle function.
+ @param [out] ppBuffer
+ pointer to an OMX_BUFFERHEADERTYPE structure used to receive the
+ pointer to the buffer header
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ @ingroup comp buf
+ */
+
+#define OMX_UseBuffer( \
+ hComponent, \
+ ppBufferHdr, \
+ nPortIndex, \
+ pAppPrivate, \
+ nSizeBytes, \
+ pBuffer) \
+ ((OMX_COMPONENTTYPE*)hComponent)->UseBuffer( \
+ hComponent, \
+ ppBufferHdr, \
+ nPortIndex, \
+ pAppPrivate, \
+ nSizeBytes, \
+ pBuffer)
+
+
+/** The OMX_AllocateBuffer macro will request that the component allocate
+ a new buffer and buffer header. The component will allocate the
+ buffer and the buffer header and return a pointer to the buffer
+ header. This is a blocking call.
+
+ The component should return from this call within 5 msec.
+
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the OMX_GetHandle function.
+ @param [out] ppBuffer
+ pointer to an OMX_BUFFERHEADERTYPE structure used to receive
+ the pointer to the buffer header
+ @param [in] nPortIndex
+ nPortIndex is used to select the port on the component the buffer will
+ be used with. The port can be found by using the nPortIndex
+ value as an index into the Port Definition array of the component.
+ @param [in] pAppPrivate
+ pAppPrivate is used to initialize the pAppPrivate member of the
+ buffer header structure.
+ @param [in] nSizeBytes
+ size of the buffer to allocate. Used when bAllocateNew is true.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ @ingroup comp buf
+ */
+#define OMX_AllocateBuffer( \
+ hComponent, \
+ ppBuffer, \
+ nPortIndex, \
+ pAppPrivate, \
+ nSizeBytes) \
+ ((OMX_COMPONENTTYPE*)hComponent)->AllocateBuffer( \
+ hComponent, \
+ ppBuffer, \
+ nPortIndex, \
+ pAppPrivate, \
+ nSizeBytes) /* Macro End */
+
+
+/** The OMX_FreeBuffer macro will release a buffer header from the component
+ which was allocated using either OMX_AllocateBuffer or OMX_UseBuffer. If
+ the component allocated the buffer (see the OMX_UseBuffer macro) then
+ the component shall free the buffer and buffer header. This is a
+ blocking call.
+
+ The component should return from this call within 20 msec.
+
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the OMX_GetHandle function.
+ @param [in] nPortIndex
+ nPortIndex is used to select the port on the component the buffer will
+ be used with.
+ @param [in] pBuffer
+ pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer
+ or AllocateBuffer.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ @ingroup comp buf
+ */
+#define OMX_FreeBuffer( \
+ hComponent, \
+ nPortIndex, \
+ pBuffer) \
+ ((OMX_COMPONENTTYPE*)hComponent)->FreeBuffer( \
+ hComponent, \
+ nPortIndex, \
+ pBuffer) /* Macro End */
+
+
+/** The OMX_EmptyThisBuffer macro will send a buffer full of data to an
+ input port of a component. The buffer will be emptied by the component
+ and returned to the application via the EmptyBufferDone call back.
+ This is a non-blocking call in that the component will record the buffer
+ and return immediately and then empty the buffer, later, at the proper
+ time. As expected, this macro may be invoked only while the component
+ is in the OMX_StateExecuting. If nPortIndex does not specify an input
+ port, the component shall return an error.
+
+ The component should return from this call within 5 msec.
+
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the OMX_GetHandle function.
+ @param [in] pBuffer
+ pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer
+ or AllocateBuffer.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ @ingroup comp buf
+ */
+#define OMX_EmptyThisBuffer( \
+ hComponent, \
+ pBuffer) \
+ ((OMX_COMPONENTTYPE*)hComponent)->EmptyThisBuffer( \
+ hComponent, \
+ pBuffer) /* Macro End */
+
+
+/** The OMX_FillThisBuffer macro will send an empty buffer to an
+ output port of a component. The buffer will be filled by the component
+ and returned to the application via the FillBufferDone call back.
+ This is a non-blocking call in that the component will record the buffer
+ and return immediately and then fill the buffer, later, at the proper
+ time. As expected, this macro may be invoked only while the component
+ is in the OMX_ExecutingState. If nPortIndex does not specify an output
+ port, the component shall return an error.
+
+ The component should return from this call within 5 msec.
+
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the OMX_GetHandle function.
+ @param [in] pBuffer
+ pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer
+ or AllocateBuffer.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ @ingroup comp buf
+ */
+#define OMX_FillThisBuffer( \
+ hComponent, \
+ pBuffer) \
+ ((OMX_COMPONENTTYPE*)hComponent)->FillThisBuffer( \
+ hComponent, \
+ pBuffer) /* Macro End */
+
+
+
+/** The OMX_UseEGLImage macro will request that the component use
+ a EGLImage provided by EGL (and allocate its own buffer header)
+ This is a blocking call.
+
+ The component should return from this call within 20 msec.
+
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the OMX_GetHandle function.
+ @param [out] ppBuffer
+ pointer to an OMX_BUFFERHEADERTYPE structure used to receive the
+ pointer to the buffer header. Note that the memory location used
+ for this buffer is NOT visible to the IL Client.
+ @param [in] nPortIndex
+ nPortIndex is used to select the port on the component the buffer will
+ be used with. The port can be found by using the nPortIndex
+ value as an index into the Port Definition array of the component.
+ @param [in] pAppPrivate
+ pAppPrivate is used to initialize the pAppPrivate member of the
+ buffer header structure.
+ @param [in] eglImage
+ eglImage contains the handle of the EGLImage to use as a buffer on the
+ specified port. The component is expected to validate properties of
+ the EGLImage against the configuration of the port to ensure the component
+ can use the EGLImage as a buffer.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ @ingroup comp buf
+ */
+#define OMX_UseEGLImage( \
+ hComponent, \
+ ppBufferHdr, \
+ nPortIndex, \
+ pAppPrivate, \
+ eglImage) \
+ ((OMX_COMPONENTTYPE*)hComponent)->UseEGLImage( \
+ hComponent, \
+ ppBufferHdr, \
+ nPortIndex, \
+ pAppPrivate, \
+ eglImage)
+
+/** The OMX_Init method is used to initialize the OMX core. It shall be the
+ first call made into OMX and it should only be executed one time without
+ an interviening OMX_Deinit call.
+
+ The core should return from this call within 20 msec.
+
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ @ingroup core
+ */
+OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_Init(void);
+
+
+/** The OMX_Deinit method is used to deinitialize the OMX core. It shall be
+ the last call made into OMX. In the event that the core determines that
+ thare are components loaded when this call is made, the core may return
+ with an error rather than try to unload the components.
+
+ The core should return from this call within 20 msec.
+
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ @ingroup core
+ */
+OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_Deinit(void);
+
+
+/** The OMX_ComponentNameEnum method will enumerate through all the names of
+ recognised valid components in the system. This function is provided
+ as a means to detect all the components in the system run-time. There is
+ no strict ordering to the enumeration order of component names, although
+ each name will only be enumerated once. If the OMX core supports run-time
+ installation of new components, it is only requried to detect newly
+ installed components when the first call to enumerate component names
+ is made (i.e. when nIndex is 0x0).
+
+ The core should return from this call in 20 msec.
+
+ @param [out] cComponentName
+ pointer to a null terminated string with the component name. The
+ names of the components are strings less than 127 bytes in length
+ plus the trailing null for a maximum size of 128 bytes. An example
+ of a valid component name is "OMX.TI.AUDIO.DSP.MIXER\0". Names are
+ assigned by the vendor, but shall start with "OMX." and then have
+ the Vendor designation next.
+ @param [in] nNameLength
+ number of characters in the cComponentName string. With all
+ component name strings restricted to less than 128 characters
+ (including the trailing null) it is recomended that the caller
+ provide a input string for the cComponentName of 128 characters.
+ @param [in] nIndex
+ number containing the enumeration index for the component.
+ Multiple calls to OMX_ComponentNameEnum with increasing values
+ of nIndex will enumerate through the component names in the
+ system until OMX_ErrorNoMore is returned. The value of nIndex
+ is 0 to (N-1), where N is the number of valid installed components
+ in the system.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. When the value of nIndex exceeds the number of
+ components in the system minus 1, OMX_ErrorNoMore will be
+ returned. Otherwise the appropriate OMX error will be returned.
+ @ingroup core
+ */
+OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_ComponentNameEnum(
+ OMX_OUT OMX_STRING cComponentName,
+ OMX_IN OMX_U32 nNameLength,
+ OMX_IN OMX_U32 nIndex);
+
+
+/** The OMX_GetHandle method will locate the component specified by the
+ component name given, load that component into memory and then invoke
+ the component's methods to create an instance of the component.
+
+ The core should return from this call within 20 msec.
+
+ @param [out] pHandle
+ pointer to an OMX_HANDLETYPE pointer to be filled in by this method.
+ @param [in] cComponentName
+ pointer to a null terminated string with the component name. The
+ names of the components are strings less than 127 bytes in length
+ plus the trailing null for a maximum size of 128 bytes. An example
+ of a valid component name is "OMX.TI.AUDIO.DSP.MIXER\0". Names are
+ assigned by the vendor, but shall start with "OMX." and then have
+ the Vendor designation next.
+ @param [in] pAppData
+ pointer to an application defined value that will be returned
+ during callbacks so that the application can identify the source
+ of the callback.
+ @param [in] pCallBacks
+ pointer to a OMX_CALLBACKTYPE structure that will be passed to the
+ component to initialize it with.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ @ingroup core
+ */
+OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_GetHandle(
+ OMX_OUT OMX_HANDLETYPE* pHandle,
+ OMX_IN OMX_STRING cComponentName,
+ OMX_IN OMX_PTR pAppData,
+ OMX_IN OMX_CALLBACKTYPE* pCallBacks);
+
+
+/** The OMX_FreeHandle method will free a handle allocated by the OMX_GetHandle
+ method. If the component reference count goes to zero, the component will
+ be unloaded from memory.
+
+ The core should return from this call within 20 msec when the component is
+ in the OMX_StateLoaded state.
+
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the GetHandle function.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ @ingroup core
+ */
+OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_FreeHandle(
+ OMX_IN OMX_HANDLETYPE hComponent);
+
+
+
+/** The OMX_SetupTunnel method will handle the necessary calls to the components
+ to setup the specified tunnel the two components. NOTE: This is
+ an actual method (not a #define macro). This method will make calls into
+ the component ComponentTunnelRequest method to do the actual tunnel
+ connection.
+
+ The ComponentTunnelRequest method on both components will be called.
+ This method shall not be called unless the component is in the
+ OMX_StateLoaded state except when the ports used for the tunnel are
+ disabled. In this case, the component may be in the OMX_StateExecuting,
+ OMX_StatePause, or OMX_StateIdle states.
+
+ The core should return from this call within 20 msec.
+
+ @param [in] hOutput
+ Handle of the component to be accessed. Also this is the handle
+ of the component whose port, specified in the nPortOutput parameter
+ will be used the source for the tunnel. This is the component handle
+ returned by the call to the OMX_GetHandle function. There is a
+ requirement that hOutput be the source for the data when
+ tunelling (i.e. nPortOutput is an output port). If 0x0, the component
+ specified in hInput will have it's port specified in nPortInput
+ setup for communication with the application / IL client.
+ @param [in] nPortOutput
+ nPortOutput is used to select the source port on component to be
+ used in the tunnel.
+ @param [in] hInput
+ This is the component to setup the tunnel with. This is the handle
+ of the component whose port, specified in the nPortInput parameter
+ will be used the destination for the tunnel. This is the component handle
+ returned by the call to the OMX_GetHandle function. There is a
+ requirement that hInput be the destination for the data when
+ tunelling (i.e. nPortInut is an input port). If 0x0, the component
+ specified in hOutput will have it's port specified in nPortPOutput
+ setup for communication with the application / IL client.
+ @param [in] nPortInput
+ nPortInput is used to select the destination port on component to be
+ used in the tunnel.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ When OMX_ErrorNotImplemented is returned, one or both components is
+ a non-interop component and does not support tunneling.
+
+ On failure, the ports of both components are setup for communication
+ with the application / IL Client.
+ @ingroup core tun
+ */
+OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_SetupTunnel(
+ OMX_IN OMX_HANDLETYPE hOutput,
+ OMX_IN OMX_U32 nPortOutput,
+ OMX_IN OMX_HANDLETYPE hInput,
+ OMX_IN OMX_U32 nPortInput);
+
+/** @ingroup cp */
+OMX_API OMX_ERRORTYPE OMX_GetContentPipe(
+ OMX_OUT OMX_HANDLETYPE *hPipe,
+ OMX_IN OMX_STRING szURI);
+
+/** The OMX_GetComponentsOfRole method will return the number of components that support the given
+ role and (if the compNames field is non-NULL) the names of those components. The call will fail if
+ an insufficiently sized array of names is supplied. To ensure the array is sufficiently sized the
+ client should:
+ * first call this function with the compNames field NULL to determine the number of component names
+ * second call this function with the compNames field pointing to an array of names allocated
+ according to the number returned by the first call.
+
+ The core should return from this call within 5 msec.
+
+ @param [in] role
+ This is generic standard component name consisting only of component class
+ name and the type within that class (e.g. 'audio_decoder.aac').
+ @param [inout] pNumComps
+ This is used both as input and output.
+
+ If compNames is NULL, the input is ignored and the output specifies how many components support
+ the given role.
+
+ If compNames is not NULL, on input it bounds the size of the input structure and
+ on output, it specifies the number of components string names listed within the compNames parameter.
+ @param [inout] compNames
+ If NULL this field is ignored. If non-NULL this points to an array of 128-byte strings which accepts
+ a list of the names of all physical components that implement the specified standard component name.
+ Each name is NULL terminated. numComps indicates the number of names.
+ @ingroup core
+ */
+OMX_API OMX_ERRORTYPE OMX_GetComponentsOfRole (
+ OMX_IN OMX_STRING role,
+ OMX_INOUT OMX_U32 *pNumComps,
+ OMX_INOUT OMX_U8 **compNames);
+
+/** The OMX_GetRolesOfComponent method will return the number of roles supported by the given
+ component and (if the roles field is non-NULL) the names of those roles. The call will fail if
+ an insufficiently sized array of names is supplied. To ensure the array is sufficiently sized the
+ client should:
+ * first call this function with the roles field NULL to determine the number of role names
+ * second call this function with the roles field pointing to an array of names allocated
+ according to the number returned by the first call.
+
+ The core should return from this call within 5 msec.
+
+ @param [in] compName
+ This is the name of the component being queried about.
+ @param [inout] pNumRoles
+ This is used both as input and output.
+
+ If roles is NULL, the input is ignored and the output specifies how many roles the component supports.
+
+ If compNames is not NULL, on input it bounds the size of the input structure and
+ on output, it specifies the number of roles string names listed within the roles parameter.
+ @param [out] roles
+ If NULL this field is ignored. If non-NULL this points to an array of 128-byte strings
+ which accepts a list of the names of all standard components roles implemented on the
+ specified component name. numComps indicates the number of names.
+ @ingroup core
+ */
+OMX_API OMX_ERRORTYPE OMX_GetRolesOfComponent (
+ OMX_IN OMX_STRING compName,
+ OMX_INOUT OMX_U32 *pNumRoles,
+ OMX_OUT OMX_U8 **roles);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
+/* File EOF */
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/khronos_api/v1_1_2/OMX_IVCommon.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,921 @@
+/**
+ * Copyright (c) 2008 The Khronos Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject
+ * to the following conditions:
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+/**
+ * @file
+ * OpenMax IL version 1.1.2
+ * The structures needed by Video and Image components to exchange
+ * parameters and configuration data with the components.
+ */
+#ifndef OMX_IVCommon_h
+#define OMX_IVCommon_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/**
+ * Each OMX header must include all required header files to allow the header
+ * to compile without errors. The includes below are required for this header
+ * file to compile successfully
+ */
+
+#include <openmax/il/khronos/v1_x/OMX_Core.h>
+
+/** @defgroup iv OpenMAX IL Imaging and Video Domain
+ * Common structures for OpenMAX IL Imaging and Video domains
+ * @{
+ */
+
+
+/**
+ * Enumeration defining possible uncompressed image/video formats.
+ *
+ * ENUMS:
+ * Unused : Placeholder value when format is N/A
+ * Monochrome : black and white
+ * 8bitRGB332 : Red 7:5, Green 4:2, Blue 1:0
+ * 12bitRGB444 : Red 11:8, Green 7:4, Blue 3:0
+ * 16bitARGB4444 : Alpha 15:12, Red 11:8, Green 7:4, Blue 3:0
+ * 16bitARGB1555 : Alpha 15, Red 14:10, Green 9:5, Blue 4:0
+ * 16bitRGB565 : Red 15:11, Green 10:5, Blue 4:0
+ * 16bitBGR565 : Blue 15:11, Green 10:5, Red 4:0
+ * 18bitRGB666 : Red 17:12, Green 11:6, Blue 5:0
+ * 18bitARGB1665 : Alpha 17, Red 16:11, Green 10:5, Blue 4:0
+ * 19bitARGB1666 : Alpha 18, Red 17:12, Green 11:6, Blue 5:0
+ * 24bitRGB888 : Red 24:16, Green 15:8, Blue 7:0
+ * 24bitBGR888 : Blue 24:16, Green 15:8, Red 7:0
+ * 24bitARGB1887 : Alpha 23, Red 22:15, Green 14:7, Blue 6:0
+ * 25bitARGB1888 : Alpha 24, Red 23:16, Green 15:8, Blue 7:0
+ * 32bitBGRA8888 : Blue 31:24, Green 23:16, Red 15:8, Alpha 7:0
+ * 32bitARGB8888 : Alpha 31:24, Red 23:16, Green 15:8, Blue 7:0
+ * YUV411Planar : U,Y are subsampled by a factor of 4 horizontally
+ * YUV411PackedPlanar : packed per payload in planar slices
+ * YUV420Planar : Three arrays Y,U,V.
+ * YUV420PackedPlanar : packed per payload in planar slices
+ * YUV420SemiPlanar : Two arrays, one is all Y, the other is U and V
+ * YUV422Planar : Three arrays Y,U,V.
+ * YUV422PackedPlanar : packed per payload in planar slices
+ * YUV422SemiPlanar : Two arrays, one is all Y, the other is U and V
+ * YCbYCr : Organized as 16bit YUYV (i.e. YCbYCr)
+ * YCrYCb : Organized as 16bit YVYU (i.e. YCrYCb)
+ * CbYCrY : Organized as 16bit UYVY (i.e. CbYCrY)
+ * CrYCbY : Organized as 16bit VYUY (i.e. CrYCbY)
+ * YUV444Interleaved : Each pixel contains equal parts YUV
+ * RawBayer8bit : SMIA camera output format
+ * RawBayer10bit : SMIA camera output format
+ * RawBayer8bitcompressed : SMIA camera output format
+ */
+typedef enum OMX_COLOR_FORMATTYPE {
+ OMX_COLOR_FormatUnused,
+ OMX_COLOR_FormatMonochrome,
+ OMX_COLOR_Format8bitRGB332,
+ OMX_COLOR_Format12bitRGB444,
+ OMX_COLOR_Format16bitARGB4444,
+ OMX_COLOR_Format16bitARGB1555,
+ OMX_COLOR_Format16bitRGB565,
+ OMX_COLOR_Format16bitBGR565,
+ OMX_COLOR_Format18bitRGB666,
+ OMX_COLOR_Format18bitARGB1665,
+ OMX_COLOR_Format19bitARGB1666,
+ OMX_COLOR_Format24bitRGB888,
+ OMX_COLOR_Format24bitBGR888,
+ OMX_COLOR_Format24bitARGB1887,
+ OMX_COLOR_Format25bitARGB1888,
+ OMX_COLOR_Format32bitBGRA8888,
+ OMX_COLOR_Format32bitARGB8888,
+ OMX_COLOR_FormatYUV411Planar,
+ OMX_COLOR_FormatYUV411PackedPlanar,
+ OMX_COLOR_FormatYUV420Planar,
+ OMX_COLOR_FormatYUV420PackedPlanar,
+ OMX_COLOR_FormatYUV420SemiPlanar,
+ OMX_COLOR_FormatYUV422Planar,
+ OMX_COLOR_FormatYUV422PackedPlanar,
+ OMX_COLOR_FormatYUV422SemiPlanar,
+ OMX_COLOR_FormatYCbYCr,
+ OMX_COLOR_FormatYCrYCb,
+ OMX_COLOR_FormatCbYCrY,
+ OMX_COLOR_FormatCrYCbY,
+ OMX_COLOR_FormatYUV444Interleaved,
+ OMX_COLOR_FormatRawBayer8bit,
+ OMX_COLOR_FormatRawBayer10bit,
+ OMX_COLOR_FormatRawBayer8bitcompressed,
+ OMX_COLOR_FormatL2,
+ OMX_COLOR_FormatL4,
+ OMX_COLOR_FormatL8,
+ OMX_COLOR_FormatL16,
+ OMX_COLOR_FormatL24,
+ OMX_COLOR_FormatL32,
+ OMX_COLOR_FormatYUV420PackedSemiPlanar,
+ OMX_COLOR_FormatYUV422PackedSemiPlanar,
+ OMX_COLOR_Format18BitBGR666,
+ OMX_COLOR_Format24BitARGB6666,
+ OMX_COLOR_Format24BitABGR6666,
+ OMX_COLOR_FormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_COLOR_FormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_COLOR_FormatMax = 0x7FFFFFFF
+} OMX_COLOR_FORMATTYPE;
+
+
+/**
+ * Defines the matrix for conversion from RGB to YUV or vice versa.
+ * iColorMatrix should be initialized with the fixed point values
+ * used in converting between formats.
+ */
+typedef struct OMX_CONFIG_COLORCONVERSIONTYPE {
+ OMX_U32 nSize; /**< Size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version info */
+ OMX_U32 nPortIndex; /**< Port that this struct applies to */
+ OMX_S32 xColorMatrix[3][3]; /**< Stored in signed Q16 format */
+ OMX_S32 xColorOffset[4]; /**< Stored in signed Q16 format */
+}OMX_CONFIG_COLORCONVERSIONTYPE;
+
+
+/**
+ * Structure defining percent to scale each frame dimension. For example:
+ * To make the width 50% larger, use fWidth = 1.5 and to make the width
+ * 1/2 the original size, use fWidth = 0.5
+ */
+typedef struct OMX_CONFIG_SCALEFACTORTYPE {
+ OMX_U32 nSize; /**< Size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version info */
+ OMX_U32 nPortIndex; /**< Port that this struct applies to */
+ OMX_S32 xWidth; /**< Fixed point value stored as Q16 */
+ OMX_S32 xHeight; /**< Fixed point value stored as Q16 */
+}OMX_CONFIG_SCALEFACTORTYPE;
+
+
+/**
+ * Enumeration of possible image filter types
+ */
+typedef enum OMX_IMAGEFILTERTYPE {
+ OMX_ImageFilterNone,
+ OMX_ImageFilterNoise,
+ OMX_ImageFilterEmboss,
+ OMX_ImageFilterNegative,
+ OMX_ImageFilterSketch,
+ OMX_ImageFilterOilPaint,
+ OMX_ImageFilterHatch,
+ OMX_ImageFilterGpen,
+ OMX_ImageFilterAntialias,
+ OMX_ImageFilterDeRing,
+ OMX_ImageFilterSolarize,
+ OMX_ImageFilterKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_ImageFilterVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_ImageFilterMax = 0x7FFFFFFF
+} OMX_IMAGEFILTERTYPE;
+
+
+/**
+ * Image filter configuration
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eImageFilter : Image filter type enumeration
+ */
+typedef struct OMX_CONFIG_IMAGEFILTERTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_IMAGEFILTERTYPE eImageFilter;
+} OMX_CONFIG_IMAGEFILTERTYPE;
+
+
+/**
+ * Customized U and V for color enhancement
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * bColorEnhancement : Enable/disable color enhancement
+ * nCustomizedU : Practical values: 16-240, range: 0-255, value set for
+ * U component
+ * nCustomizedV : Practical values: 16-240, range: 0-255, value set for
+ * V component
+ */
+typedef struct OMX_CONFIG_COLORENHANCEMENTTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bColorEnhancement;
+ OMX_U8 nCustomizedU;
+ OMX_U8 nCustomizedV;
+} OMX_CONFIG_COLORENHANCEMENTTYPE;
+
+
+/**
+ * Define color key and color key mask
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nARGBColor : 32bit Alpha, Red, Green, Blue Color
+ * nARGBMask : 32bit Mask for Alpha, Red, Green, Blue channels
+ */
+typedef struct OMX_CONFIG_COLORKEYTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nARGBColor;
+ OMX_U32 nARGBMask;
+} OMX_CONFIG_COLORKEYTYPE;
+
+
+/**
+ * List of color blend types for pre/post processing
+ *
+ * ENUMS:
+ * None : No color blending present
+ * AlphaConstant : Function is (alpha_constant * src) +
+ * (1 - alpha_constant) * dst)
+ * AlphaPerPixel : Function is (alpha * src) + (1 - alpha) * dst)
+ * Alternate : Function is alternating pixels from src and dst
+ * And : Function is (src & dst)
+ * Or : Function is (src | dst)
+ * Invert : Function is ~src
+ */
+typedef enum OMX_COLORBLENDTYPE {
+ OMX_ColorBlendNone,
+ OMX_ColorBlendAlphaConstant,
+ OMX_ColorBlendAlphaPerPixel,
+ OMX_ColorBlendAlternate,
+ OMX_ColorBlendAnd,
+ OMX_ColorBlendOr,
+ OMX_ColorBlendInvert,
+ OMX_ColorBlendKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_ColorBlendVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_ColorBlendMax = 0x7FFFFFFF
+} OMX_COLORBLENDTYPE;
+
+
+/**
+ * Color blend configuration
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nRGBAlphaConstant : Constant global alpha values when global alpha is used
+ * eColorBlend : Color blend type enumeration
+ */
+typedef struct OMX_CONFIG_COLORBLENDTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nRGBAlphaConstant;
+ OMX_COLORBLENDTYPE eColorBlend;
+} OMX_CONFIG_COLORBLENDTYPE;
+
+
+/**
+ * Hold frame dimension
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nWidth : Frame width in pixels
+ * nHeight : Frame height in pixels
+ */
+typedef struct OMX_FRAMESIZETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nWidth;
+ OMX_U32 nHeight;
+} OMX_FRAMESIZETYPE;
+
+
+/**
+ * Rotation configuration
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nRotation : +/- integer rotation value
+ */
+typedef struct OMX_CONFIG_ROTATIONTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_S32 nRotation;
+} OMX_CONFIG_ROTATIONTYPE;
+
+
+/**
+ * Possible mirroring directions for pre/post processing
+ *
+ * ENUMS:
+ * None : No mirroring
+ * Vertical : Vertical mirroring, flip on X axis
+ * Horizontal : Horizontal mirroring, flip on Y axis
+ * Both : Both vertical and horizontal mirroring
+ */
+typedef enum OMX_MIRRORTYPE {
+ OMX_MirrorNone = 0,
+ OMX_MirrorVertical,
+ OMX_MirrorHorizontal,
+ OMX_MirrorBoth,
+ OMX_MirrorKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_MirrorVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_MirrorMax = 0x7FFFFFFF
+} OMX_MIRRORTYPE;
+
+
+/**
+ * Mirroring configuration
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eMirror : Mirror type enumeration
+ */
+typedef struct OMX_CONFIG_MIRRORTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_MIRRORTYPE eMirror;
+} OMX_CONFIG_MIRRORTYPE;
+
+
+/**
+ * Position information only
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nX : X coordinate for the point
+ * nY : Y coordinate for the point
+ */
+typedef struct OMX_CONFIG_POINTTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_S32 nX;
+ OMX_S32 nY;
+} OMX_CONFIG_POINTTYPE;
+
+
+/**
+ * Frame size plus position
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nLeft : X Coordinate of the top left corner of the rectangle
+ * nTop : Y Coordinate of the top left corner of the rectangle
+ * nWidth : Width of the rectangle
+ * nHeight : Height of the rectangle
+ */
+typedef struct OMX_CONFIG_RECTTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_S32 nLeft;
+ OMX_S32 nTop;
+ OMX_U32 nWidth;
+ OMX_U32 nHeight;
+} OMX_CONFIG_RECTTYPE;
+
+
+/**
+ * Deblocking state; it is required to be set up before starting the codec
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * bDeblocking : Enable/disable deblocking mode
+ */
+typedef struct OMX_PARAM_DEBLOCKINGTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bDeblocking;
+} OMX_PARAM_DEBLOCKINGTYPE;
+
+
+/**
+ * Stabilization state
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * bStab : Enable/disable frame stabilization state
+ */
+typedef struct OMX_CONFIG_FRAMESTABTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bStab;
+} OMX_CONFIG_FRAMESTABTYPE;
+
+
+/**
+ * White Balance control type
+ *
+ * STRUCT MEMBERS:
+ * SunLight : Referenced in JSR-234
+ * Flash : Optimal for device's integrated flash
+ */
+typedef enum OMX_WHITEBALCONTROLTYPE {
+ OMX_WhiteBalControlOff = 0,
+ OMX_WhiteBalControlAuto,
+ OMX_WhiteBalControlSunLight,
+ OMX_WhiteBalControlCloudy,
+ OMX_WhiteBalControlShade,
+ OMX_WhiteBalControlTungsten,
+ OMX_WhiteBalControlFluorescent,
+ OMX_WhiteBalControlIncandescent,
+ OMX_WhiteBalControlFlash,
+ OMX_WhiteBalControlHorizon,
+ OMX_WhiteBalControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_WhiteBalControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_WhiteBalControlMax = 0x7FFFFFFF
+} OMX_WHITEBALCONTROLTYPE;
+
+
+/**
+ * White Balance control configuration
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eWhiteBalControl : White balance enumeration
+ */
+typedef struct OMX_CONFIG_WHITEBALCONTROLTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_WHITEBALCONTROLTYPE eWhiteBalControl;
+} OMX_CONFIG_WHITEBALCONTROLTYPE;
+
+
+/**
+ * Exposure control type
+ */
+typedef enum OMX_EXPOSURECONTROLTYPE {
+ OMX_ExposureControlOff = 0,
+ OMX_ExposureControlAuto,
+ OMX_ExposureControlNight,
+ OMX_ExposureControlBackLight,
+ OMX_ExposureControlSpotLight,
+ OMX_ExposureControlSports,
+ OMX_ExposureControlSnow,
+ OMX_ExposureControlBeach,
+ OMX_ExposureControlLargeAperture,
+ OMX_ExposureControlSmallApperture,
+ OMX_ExposureControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_ExposureControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_ExposureControlMax = 0x7FFFFFFF
+} OMX_EXPOSURECONTROLTYPE;
+
+
+/**
+ * White Balance control configuration
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eExposureControl : Exposure control enumeration
+ */
+typedef struct OMX_CONFIG_EXPOSURECONTROLTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_EXPOSURECONTROLTYPE eExposureControl;
+} OMX_CONFIG_EXPOSURECONTROLTYPE;
+
+
+/**
+ * Defines sensor supported mode.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nFrameRate : Single shot mode is indicated by a 0
+ * bOneShot : Enable for single shot, disable for streaming
+ * sFrameSize : Framesize
+ */
+typedef struct OMX_PARAM_SENSORMODETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nFrameRate;
+ OMX_BOOL bOneShot;
+ OMX_FRAMESIZETYPE sFrameSize;
+} OMX_PARAM_SENSORMODETYPE;
+
+
+/**
+ * Defines contrast level
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nContrast : Values allowed for contrast -100 to 100, zero means no change
+ */
+typedef struct OMX_CONFIG_CONTRASTTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_S32 nContrast;
+} OMX_CONFIG_CONTRASTTYPE;
+
+
+/**
+ * Defines brightness level
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nBrightness : 0-100%
+ */
+typedef struct OMX_CONFIG_BRIGHTNESSTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nBrightness;
+} OMX_CONFIG_BRIGHTNESSTYPE;
+
+
+/**
+ * Defines backlight level configuration for a video sink, e.g. LCD panel
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nBacklight : Values allowed for backlight 0-100%
+ * nTimeout : Number of milliseconds before backlight automatically turns
+ * off. A value of 0x0 disables backight timeout
+ */
+typedef struct OMX_CONFIG_BACKLIGHTTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nBacklight;
+ OMX_U32 nTimeout;
+} OMX_CONFIG_BACKLIGHTTYPE;
+
+
+/**
+ * Defines setting for Gamma
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nGamma : Values allowed for gamma -100 to 100, zero means no change
+ */
+typedef struct OMX_CONFIG_GAMMATYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_S32 nGamma;
+} OMX_CONFIG_GAMMATYPE;
+
+
+/**
+ * Define for setting saturation
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nSaturation : Values allowed for saturation -100 to 100, zero means
+ * no change
+ */
+typedef struct OMX_CONFIG_SATURATIONTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_S32 nSaturation;
+} OMX_CONFIG_SATURATIONTYPE;
+
+
+/**
+ * Define for setting Lightness
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nLightness : Values allowed for lightness -100 to 100, zero means no
+ * change
+ */
+typedef struct OMX_CONFIG_LIGHTNESSTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_S32 nLightness;
+} OMX_CONFIG_LIGHTNESSTYPE;
+
+
+/**
+ * Plane blend configuration
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Index of input port associated with the plane.
+ * nDepth : Depth of the plane in relation to the screen. Higher
+ * numbered depths are "behind" lower number depths.
+ * This number defaults to the Port Index number.
+ * nAlpha : Transparency blending component for the entire plane.
+ * See blending modes for more detail.
+ */
+typedef struct OMX_CONFIG_PLANEBLENDTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nDepth;
+ OMX_U32 nAlpha;
+} OMX_CONFIG_PLANEBLENDTYPE;
+
+
+/**
+ * Define interlace type
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * bEnable : Enable control variable for this functionality
+ * (see below)
+ * nInterleavePortIndex : Index of input or output port associated with
+ * the interleaved plane.
+ * pPlanarPortIndexes[4] : Index of input or output planar ports.
+ */
+typedef struct OMX_PARAM_INTERLEAVETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bEnable;
+ OMX_U32 nInterleavePortIndex;
+} OMX_PARAM_INTERLEAVETYPE;
+
+
+/**
+ * Defines the picture effect used for an input picture
+ */
+typedef enum OMX_TRANSITIONEFFECTTYPE {
+ OMX_EffectNone,
+ OMX_EffectFadeFromBlack,
+ OMX_EffectFadeToBlack,
+ OMX_EffectUnspecifiedThroughConstantColor,
+ OMX_EffectDissolve,
+ OMX_EffectWipe,
+ OMX_EffectUnspecifiedMixOfTwoScenes,
+ OMX_EffectKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_EffectVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_EffectMax = 0x7FFFFFFF
+} OMX_TRANSITIONEFFECTTYPE;
+
+
+/**
+ * Structure used to configure current transition effect
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eEffect : Effect to enable
+ */
+typedef struct OMX_CONFIG_TRANSITIONEFFECTTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_TRANSITIONEFFECTTYPE eEffect;
+} OMX_CONFIG_TRANSITIONEFFECTTYPE;
+
+
+/**
+ * Defines possible data unit types for encoded video data. The data unit
+ * types are used both for encoded video input for playback as well as
+ * encoded video output from recording.
+ */
+typedef enum OMX_DATAUNITTYPE {
+ OMX_DataUnitCodedPicture,
+ OMX_DataUnitVideoSegment,
+ OMX_DataUnitSeveralSegments,
+ OMX_DataUnitArbitraryStreamSection,
+ OMX_DataUnitKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_DataUnitVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_DataUnitMax = 0x7FFFFFFF
+} OMX_DATAUNITTYPE;
+
+
+/**
+ * Defines possible encapsulation types for coded video data unit. The
+ * encapsulation information is used both for encoded video input for
+ * playback as well as encoded video output from recording.
+ */
+typedef enum OMX_DATAUNITENCAPSULATIONTYPE {
+ OMX_DataEncapsulationElementaryStream,
+ OMX_DataEncapsulationGenericPayload,
+ OMX_DataEncapsulationRtpPayload,
+ OMX_DataEncapsulationKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_DataEncapsulationVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_DataEncapsulationMax = 0x7FFFFFFF
+} OMX_DATAUNITENCAPSULATIONTYPE;
+
+
+/**
+ * Structure used to configure the type of being decoded/encoded
+ */
+typedef struct OMX_PARAM_DATAUNITTYPE {
+ OMX_U32 nSize; /**< Size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Port that this structure applies to */
+ OMX_DATAUNITTYPE eUnitType;
+ OMX_DATAUNITENCAPSULATIONTYPE eEncapsulationType;
+} OMX_PARAM_DATAUNITTYPE;
+
+
+/**
+ * Defines dither types
+ */
+typedef enum OMX_DITHERTYPE {
+ OMX_DitherNone,
+ OMX_DitherOrdered,
+ OMX_DitherErrorDiffusion,
+ OMX_DitherOther,
+ OMX_DitherKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_DitherVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_DitherMax = 0x7FFFFFFF
+} OMX_DITHERTYPE;
+
+
+/**
+ * Structure used to configure current type of dithering
+ */
+typedef struct OMX_CONFIG_DITHERTYPE {
+ OMX_U32 nSize; /**< Size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Port that this structure applies to */
+ OMX_DITHERTYPE eDither; /**< Type of dithering to use */
+} OMX_CONFIG_DITHERTYPE;
+
+typedef struct OMX_CONFIG_CAPTUREMODETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex; /**< Port that this structure applies to */
+ OMX_BOOL bContinuous; /**< If true then ignore frame rate and emit capture
+ * data as fast as possible (otherwise obey port's frame rate). */
+ OMX_BOOL bFrameLimited; /**< If true then terminate capture after the port emits the
+ * specified number of frames (otherwise the port does not
+ * terminate the capture until instructed to do so by the client).
+ * Even if set, the client may manually terminate the capture prior
+ * to reaching the limit. */
+ OMX_U32 nFrameLimit; /**< Limit on number of frames emitted during a capture (only
+ * valid if bFrameLimited is set). */
+} OMX_CONFIG_CAPTUREMODETYPE;
+
+typedef enum OMX_METERINGTYPE {
+
+ OMX_MeteringModeAverage, /**< Center-weighted average metering. */
+ OMX_MeteringModeSpot, /**< Spot (partial) metering. */
+ OMX_MeteringModeMatrix, /**< Matrix or evaluative metering. */
+
+ OMX_MeteringKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_MeteringVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_EVModeMax = 0x7fffffff
+} OMX_METERINGTYPE;
+
+typedef struct OMX_CONFIG_EXPOSUREVALUETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_METERINGTYPE eMetering;
+ OMX_S32 xEVCompensation; /**< Fixed point value stored as Q16 */
+ OMX_U32 nApertureFNumber; /**< e.g. nApertureFNumber = 2 implies "f/2" - Q16 format */
+ OMX_BOOL bAutoAperture; /**< Whether aperture number is defined automatically */
+ OMX_U32 nShutterSpeedMsec; /**< Shutterspeed in milliseconds */
+ OMX_BOOL bAutoShutterSpeed; /**< Whether shutter speed is defined automatically */
+ OMX_U32 nSensitivity; /**< e.g. nSensitivity = 100 implies "ISO 100" */
+ OMX_BOOL bAutoSensitivity; /**< Whether sensitivity is defined automatically */
+} OMX_CONFIG_EXPOSUREVALUETYPE;
+
+/**
+ * Focus region configuration
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * bCenter : Use center region as focus region of interest
+ * bLeft : Use left region as focus region of interest
+ * bRight : Use right region as focus region of interest
+ * bTop : Use top region as focus region of interest
+ * bBottom : Use bottom region as focus region of interest
+ * bTopLeft : Use top left region as focus region of interest
+ * bTopRight : Use top right region as focus region of interest
+ * bBottomLeft : Use bottom left region as focus region of interest
+ * bBottomRight : Use bottom right region as focus region of interest
+ */
+typedef struct OMX_CONFIG_FOCUSREGIONTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bCenter;
+ OMX_BOOL bLeft;
+ OMX_BOOL bRight;
+ OMX_BOOL bTop;
+ OMX_BOOL bBottom;
+ OMX_BOOL bTopLeft;
+ OMX_BOOL bTopRight;
+ OMX_BOOL bBottomLeft;
+ OMX_BOOL bBottomRight;
+} OMX_CONFIG_FOCUSREGIONTYPE;
+
+/**
+ * Focus Status type
+ */
+typedef enum OMX_FOCUSSTATUSTYPE {
+ OMX_FocusStatusOff = 0,
+ OMX_FocusStatusRequest,
+ OMX_FocusStatusReached,
+ OMX_FocusStatusUnableToReach,
+ OMX_FocusStatusLost,
+ OMX_FocusStatusKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_FocusStatusVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_FocusStatusMax = 0x7FFFFFFF
+} OMX_FOCUSSTATUSTYPE;
+
+/**
+ * Focus status configuration
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eFocusStatus : Specifies the focus status
+ * bCenterStatus : Use center region as focus region of interest
+ * bLeftStatus : Use left region as focus region of interest
+ * bRightStatus : Use right region as focus region of interest
+ * bTopStatus : Use top region as focus region of interest
+ * bBottomStatus : Use bottom region as focus region of interest
+ * bTopLeftStatus : Use top left region as focus region of interest
+ * bTopRightStatus : Use top right region as focus region of interest
+ * bBottomLeftStatus : Use bottom left region as focus region of interest
+ * bBottomRightStatus : Use bottom right region as focus region of interest
+ */
+typedef struct OMX_PARAM_FOCUSSTATUSTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_FOCUSSTATUSTYPE eFocusStatus;
+ OMX_BOOL bCenterStatus;
+ OMX_BOOL bLeftStatus;
+ OMX_BOOL bRightStatus;
+ OMX_BOOL bTopStatus;
+ OMX_BOOL bBottomStatus;
+ OMX_BOOL bTopLeftStatus;
+ OMX_BOOL bTopRightStatus;
+ OMX_BOOL bBottomLeftStatus;
+ OMX_BOOL bBottomRightStatus;
+} OMX_PARAM_FOCUSSTATUSTYPE;
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
+/* File EOF */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/khronos_api/v1_1_2/OMX_Image.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,329 @@
+/**
+ * Copyright (c) 2008 The Khronos Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject
+ * to the following conditions:
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * @file
+ * OpenMax IL version 1.1.2
+ * The structures needed by Image components to exchange parameters and
+ * configuration data with the components.
+ */
+#ifndef OMX_Image_h
+#define OMX_Image_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/**
+ * Each OMX header must include all required header files to allow the
+ * header to compile without errors. The includes below are required
+ * for this header file to compile successfully
+ */
+
+#include <openmax/il/khronos/v1_x/OMX_IVCommon.h>
+
+/** @defgroup imaging OpenMAX IL Imaging Domain
+ * @ingroup iv
+ * Structures for OpenMAX IL Imaging domain
+ * @{
+ */
+
+/**
+ * Enumeration used to define the possible image compression coding.
+ */
+typedef enum OMX_IMAGE_CODINGTYPE {
+ OMX_IMAGE_CodingUnused, /**< Value when format is N/A */
+ OMX_IMAGE_CodingAutoDetect, /**< Auto detection of image format */
+ OMX_IMAGE_CodingJPEG, /**< JPEG/JFIF image format */
+ OMX_IMAGE_CodingJPEG2K, /**< JPEG 2000 image format */
+ OMX_IMAGE_CodingEXIF, /**< EXIF image format */
+ OMX_IMAGE_CodingTIFF, /**< TIFF image format */
+ OMX_IMAGE_CodingGIF, /**< Graphics image format */
+ OMX_IMAGE_CodingPNG, /**< PNG image format */
+ OMX_IMAGE_CodingLZW, /**< LZW image format */
+ OMX_IMAGE_CodingBMP, /**< Windows Bitmap format */
+ OMX_IMAGE_CodingKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_IMAGE_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_IMAGE_CodingMax = 0x7FFFFFFF
+} OMX_IMAGE_CODINGTYPE;
+
+
+/**
+ * Data structure used to define an image path. The number of image paths
+ * for input and output will vary by type of the image component.
+ *
+ * Input (aka Source) : Zero Inputs, one Output,
+ * Splitter : One Input, 2 or more Outputs,
+ * Processing Element : One Input, one output,
+ * Mixer : 2 or more inputs, one output,
+ * Output (aka Sink) : One Input, zero outputs.
+ *
+ * The PortDefinition structure is used to define all of the parameters
+ * necessary for the compliant component to setup an input or an output
+ * image path. If additional vendor specific data is required, it should
+ * be transmitted to the component using the CustomCommand function.
+ * Compliant components will prepopulate this structure with optimal
+ * values during the OMX_GetParameter() command.
+ *
+ * STRUCT MEMBERS:
+ * cMIMEType : MIME type of data for the port
+ * pNativeRender : Platform specific reference for a display if a
+ * sync, otherwise this field is 0
+ * nFrameWidth : Width of frame to be used on port if
+ * uncompressed format is used. Use 0 for
+ * unknown, don't care or variable
+ * nFrameHeight : Height of frame to be used on port if
+ * uncompressed format is used. Use 0 for
+ * unknown, don't care or variable
+ * nStride : Number of bytes per span of an image (i.e.
+ * indicates the number of bytes to get from
+ * span N to span N+1, where negative stride
+ * indicates the image is bottom up
+ * nSliceHeight : Height used when encoding in slices
+ * bFlagErrorConcealment : Turns on error concealment if it is supported by
+ * the OMX component
+ * eCompressionFormat : Compression format used in this instance of
+ * the component. When OMX_IMAGE_CodingUnused is
+ * specified, eColorFormat is valid
+ * eColorFormat : Decompressed format used by this component
+ * pNativeWindow : Platform specific reference for a window object if a
+ * display sink , otherwise this field is 0x0.
+ */
+typedef struct OMX_IMAGE_PORTDEFINITIONTYPE {
+ OMX_STRING cMIMEType;
+ OMX_NATIVE_DEVICETYPE pNativeRender;
+ OMX_U32 nFrameWidth;
+ OMX_U32 nFrameHeight;
+ OMX_S32 nStride;
+ OMX_U32 nSliceHeight;
+ OMX_BOOL bFlagErrorConcealment;
+ OMX_IMAGE_CODINGTYPE eCompressionFormat;
+ OMX_COLOR_FORMATTYPE eColorFormat;
+ OMX_NATIVE_WINDOWTYPE pNativeWindow;
+} OMX_IMAGE_PORTDEFINITIONTYPE;
+
+
+/**
+ * Port format parameter. This structure is used to enumerate the various
+ * data input/output format supported by the port.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Indicates which port to set
+ * nIndex : Indicates the enumeration index for the format from
+ * 0x0 to N-1
+ * eCompressionFormat : Compression format used in this instance of the
+ * component. When OMX_IMAGE_CodingUnused is specified,
+ * eColorFormat is valid
+ * eColorFormat : Decompressed format used by this component
+ */
+typedef struct OMX_IMAGE_PARAM_PORTFORMATTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nIndex;
+ OMX_IMAGE_CODINGTYPE eCompressionFormat;
+ OMX_COLOR_FORMATTYPE eColorFormat;
+} OMX_IMAGE_PARAM_PORTFORMATTYPE;
+
+
+/**
+ * Flash control type
+ *
+ * ENUMS
+ * Torch : Flash forced constantly on
+ */
+typedef enum OMX_IMAGE_FLASHCONTROLTYPE {
+ OMX_IMAGE_FlashControlOn = 0,
+ OMX_IMAGE_FlashControlOff,
+ OMX_IMAGE_FlashControlAuto,
+ OMX_IMAGE_FlashControlRedEyeReduction,
+ OMX_IMAGE_FlashControlFillin,
+ OMX_IMAGE_FlashControlTorch,
+ OMX_IMAGE_FlashControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_IMAGE_FlashControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_IMAGE_FlashControlMax = 0x7FFFFFFF
+} OMX_IMAGE_FLASHCONTROLTYPE;
+
+
+/**
+ * Flash control configuration
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eFlashControl : Flash control type
+ */
+typedef struct OMX_IMAGE_PARAM_FLASHCONTROLTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_IMAGE_FLASHCONTROLTYPE eFlashControl;
+} OMX_IMAGE_PARAM_FLASHCONTROLTYPE;
+
+
+/**
+ * Focus control type
+ */
+typedef enum OMX_IMAGE_FOCUSCONTROLTYPE {
+ OMX_IMAGE_FocusControlOn = 0,
+ OMX_IMAGE_FocusControlOff,
+ OMX_IMAGE_FocusControlAuto,
+ OMX_IMAGE_FocusControlAutoLock,
+ OMX_IMAGE_FocusControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_IMAGE_FocusControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_IMAGE_FocusControlMax = 0x7FFFFFFF
+} OMX_IMAGE_FOCUSCONTROLTYPE;
+
+
+/**
+ * Focus control configuration
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eFocusControl : Focus control
+ * nFocusSteps : Focus can take on values from 0 mm to infinity.
+ * Interest is only in number of steps over this range.
+ * nFocusStepIndex : Current focus step index
+ */
+typedef struct OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_IMAGE_FOCUSCONTROLTYPE eFocusControl;
+ OMX_U32 nFocusSteps;
+ OMX_U32 nFocusStepIndex;
+} OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE;
+
+
+/**
+ * Q Factor for JPEG compression, which controls the tradeoff between image
+ * quality and size. Q Factor provides a more simple means of controlling
+ * JPEG compression quality, without directly programming Quantization
+ * tables for chroma and luma
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nQFactor : JPEG Q factor value in the range of 1-100. A factor of 1
+ * produces the smallest, worst quality images, and a factor
+ * of 100 produces the largest, best quality images. A
+ * typical default is 75 for small good quality images
+ */
+typedef struct OMX_IMAGE_PARAM_QFACTORTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nQFactor;
+} OMX_IMAGE_PARAM_QFACTORTYPE;
+
+/**
+ * Quantization table type
+ */
+
+typedef enum OMX_IMAGE_QUANTIZATIONTABLETYPE {
+ OMX_IMAGE_QuantizationTableLuma = 0,
+ OMX_IMAGE_QuantizationTableChroma,
+ OMX_IMAGE_QuantizationTableChromaCb,
+ OMX_IMAGE_QuantizationTableChromaCr,
+ OMX_IMAGE_QuantizationTableKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_IMAGE_QuantizationTableVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_IMAGE_QuantizationTableMax = 0x7FFFFFFF
+} OMX_IMAGE_QUANTIZATIONTABLETYPE;
+
+/**
+ * JPEG quantization tables are used to determine DCT compression for
+ * YUV data, as an alternative to specifying Q factor, providing exact
+ * control of compression
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eQuantizationTable : Quantization table type
+ * nQuantizationMatrix[64] : JPEG quantization table of coefficients stored
+ * in increasing columns then by rows of data (i.e.
+ * row 1, ... row 8). Quantization values are in
+ * the range 0-255 and stored in linear order
+ * (i.e. the component will zig-zag the
+ * quantization table data if required internally)
+ */
+typedef struct OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_IMAGE_QUANTIZATIONTABLETYPE eQuantizationTable;
+ OMX_U8 nQuantizationMatrix[64];
+} OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE;
+
+
+/**
+ * Huffman table type, the same Huffman table is applied for chroma and
+ * luma component
+ */
+typedef enum OMX_IMAGE_HUFFMANTABLETYPE {
+ OMX_IMAGE_HuffmanTableAC = 0,
+ OMX_IMAGE_HuffmanTableDC,
+ OMX_IMAGE_HuffmanTableACLuma,
+ OMX_IMAGE_HuffmanTableACChroma,
+ OMX_IMAGE_HuffmanTableDCLuma,
+ OMX_IMAGE_HuffmanTableDCChroma,
+ OMX_IMAGE_HuffmanTableKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_IMAGE_HuffmanTableVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_IMAGE_HuffmanTableMax = 0x7FFFFFFF
+} OMX_IMAGE_HUFFMANTABLETYPE;
+
+/**
+ * JPEG Huffman table
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eHuffmanTable : Huffman table type
+ * nNumberOfHuffmanCodeOfLength[16] : 0-16, number of Huffman codes of each
+ * possible length
+ * nHuffmanTable[256] : 0-255, the size used for AC and DC
+ * HuffmanTable are 16 and 162
+ */
+typedef struct OMX_IMAGE_PARAM_HUFFMANTTABLETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_IMAGE_HUFFMANTABLETYPE eHuffmanTable;
+ OMX_U8 nNumberOfHuffmanCodeOfLength[16];
+ OMX_U8 nHuffmanTable[256];
+}OMX_IMAGE_PARAM_HUFFMANTTABLETYPE;
+
+/** @} */
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
+/* File EOF */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/khronos_api/v1_1_2/OMX_Index.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,259 @@
+/*
+ * Copyright (c) 2008 The Khronos Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject
+ * to the following conditions:
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+/** @file
+ * OpenMax IL version 1.1.2
+ * The OMX_Index header file contains the definitions for both applications
+ * and components .
+ */
+
+
+#ifndef OMX_Index_h
+#define OMX_Index_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/* Each OMX header must include all required header files to allow the
+ * header to compile without errors. The includes below are required
+ * for this header file to compile successfully
+ */
+#include <openmax/il/khronos/v1_x/OMX_Types.h>
+
+
+/** The OMX_INDEXTYPE enumeration is used to select a structure when either
+ * getting or setting parameters and/or configuration data. Each entry in
+ * this enumeration maps to an OMX specified structure. When the
+ * OMX_GetParameter, OMX_SetParameter, OMX_GetConfig or OMX_SetConfig methods
+ * are used, the second parameter will always be an entry from this enumeration
+ * and the third entry will be the structure shown in the comments for the entry.
+ * For example, if the application is initializing a cropping function, the
+ * OMX_SetConfig command would have OMX_IndexConfigCommonInputCrop as the second parameter
+ * and would send a pointer to an initialized OMX_RECTTYPE structure as the
+ * third parameter.
+ *
+ * The enumeration entries named with the OMX_Config prefix are sent using
+ * the OMX_SetConfig command and the enumeration entries named with the
+ * OMX_PARAM_ prefix are sent using the OMX_SetParameter command.
+ */
+typedef enum OMX_INDEXTYPE {
+
+ OMX_IndexComponentStartUnused = 0x01000000,
+ OMX_IndexParamPriorityMgmt, /**< reference: OMX_PRIORITYMGMTTYPE */
+ OMX_IndexParamAudioInit, /**< reference: OMX_PORT_PARAM_TYPE */
+ OMX_IndexParamImageInit, /**< reference: OMX_PORT_PARAM_TYPE */
+ OMX_IndexParamVideoInit, /**< reference: OMX_PORT_PARAM_TYPE */
+ OMX_IndexParamOtherInit, /**< reference: OMX_PORT_PARAM_TYPE */
+ OMX_IndexParamNumAvailableStreams, /**< reference: OMX_PARAM_U32TYPE */
+ OMX_IndexParamActiveStream, /**< reference: OMX_PARAM_U32TYPE */
+ OMX_IndexParamSuspensionPolicy, /**< reference: OMX_PARAM_SUSPENSIONPOLICYTYPE */
+ OMX_IndexParamComponentSuspended, /**< reference: OMX_PARAM_SUSPENSIONTYPE */
+ OMX_IndexConfigCapturing, /**< reference: OMX_CONFIG_BOOLEANTYPE */
+ OMX_IndexConfigCaptureMode, /**< reference: OMX_CONFIG_CAPTUREMODETYPE */
+ OMX_IndexAutoPauseAfterCapture, /**< reference: OMX_CONFIG_BOOLEANTYPE */
+ OMX_IndexParamContentURI, /**< reference: OMX_PARAM_CONTENTURITYPE */
+ OMX_IndexParamCustomContentPipe, /**< reference: OMX_PARAM_CONTENTPIPETYPE */
+ OMX_IndexParamDisableResourceConcealment, /**< reference: OMX_RESOURCECONCEALMENTTYPE */
+ OMX_IndexConfigMetadataItemCount, /**< reference: OMX_CONFIG_METADATAITEMCOUNTTYPE */
+ OMX_IndexConfigContainerNodeCount, /**< reference: OMX_CONFIG_CONTAINERNODECOUNTTYPE */
+ OMX_IndexConfigMetadataItem, /**< reference: OMX_CONFIG_METADATAITEMTYPE */
+ OMX_IndexConfigCounterNodeID, /**< reference: OMX_CONFIG_CONTAINERNODEIDTYPE */
+ OMX_IndexParamMetadataFilterType, /**< reference: OMX_PARAM_METADATAFILTERTYPE */
+ OMX_IndexParamMetadataKeyFilter, /**< reference: OMX_PARAM_METADATAFILTERTYPE */
+ OMX_IndexConfigPriorityMgmt, /**< reference: OMX_PRIORITYMGMTTYPE */
+ OMX_IndexParamStandardComponentRole, /**< reference: OMX_PARAM_COMPONENTROLETYPE */
+
+ OMX_IndexPortStartUnused = 0x02000000,
+ OMX_IndexParamPortDefinition, /**< reference: OMX_PARAM_PORTDEFINITIONTYPE */
+ OMX_IndexParamCompBufferSupplier, /**< reference: OMX_PARAM_BUFFERSUPPLIERTYPE */
+ OMX_IndexReservedStartUnused = 0x03000000,
+
+ /* Audio parameters and configurations */
+ OMX_IndexAudioStartUnused = 0x04000000,
+ OMX_IndexParamAudioPortFormat, /**< reference: OMX_AUDIO_PARAM_PORTFORMATTYPE */
+ OMX_IndexParamAudioPcm, /**< reference: OMX_AUDIO_PARAM_PCMMODETYPE */
+ OMX_IndexParamAudioAac, /**< reference: OMX_AUDIO_PARAM_AACPROFILETYPE */
+ OMX_IndexParamAudioRa, /**< reference: OMX_AUDIO_PARAM_RATYPE */
+ OMX_IndexParamAudioMp3, /**< reference: OMX_AUDIO_PARAM_MP3TYPE */
+ OMX_IndexParamAudioAdpcm, /**< reference: OMX_AUDIO_PARAM_ADPCMTYPE */
+ OMX_IndexParamAudioG723, /**< reference: OMX_AUDIO_PARAM_G723TYPE */
+ OMX_IndexParamAudioG729, /**< reference: OMX_AUDIO_PARAM_G729TYPE */
+ OMX_IndexParamAudioAmr, /**< reference: OMX_AUDIO_PARAM_AMRTYPE */
+ OMX_IndexParamAudioWma, /**< reference: OMX_AUDIO_PARAM_WMATYPE */
+ OMX_IndexParamAudioSbc, /**< reference: OMX_AUDIO_PARAM_SBCTYPE */
+ OMX_IndexParamAudioMidi, /**< reference: OMX_AUDIO_PARAM_MIDITYPE */
+ OMX_IndexParamAudioGsm_FR, /**< reference: OMX_AUDIO_PARAM_GSMFRTYPE */
+ OMX_IndexParamAudioMidiLoadUserSound, /**< reference: OMX_AUDIO_PARAM_MIDILOADUSERSOUNDTYPE */
+ OMX_IndexParamAudioG726, /**< reference: OMX_AUDIO_PARAM_G726TYPE */
+ OMX_IndexParamAudioGsm_EFR, /**< reference: OMX_AUDIO_PARAM_GSMEFRTYPE */
+ OMX_IndexParamAudioGsm_HR, /**< reference: OMX_AUDIO_PARAM_GSMHRTYPE */
+ OMX_IndexParamAudioPdc_FR, /**< reference: OMX_AUDIO_PARAM_PDCFRTYPE */
+ OMX_IndexParamAudioPdc_EFR, /**< reference: OMX_AUDIO_PARAM_PDCEFRTYPE */
+ OMX_IndexParamAudioPdc_HR, /**< reference: OMX_AUDIO_PARAM_PDCHRTYPE */
+ OMX_IndexParamAudioTdma_FR, /**< reference: OMX_AUDIO_PARAM_TDMAFRTYPE */
+ OMX_IndexParamAudioTdma_EFR, /**< reference: OMX_AUDIO_PARAM_TDMAEFRTYPE */
+ OMX_IndexParamAudioQcelp8, /**< reference: OMX_AUDIO_PARAM_QCELP8TYPE */
+ OMX_IndexParamAudioQcelp13, /**< reference: OMX_AUDIO_PARAM_QCELP13TYPE */
+ OMX_IndexParamAudioEvrc, /**< reference: OMX_AUDIO_PARAM_EVRCTYPE */
+ OMX_IndexParamAudioSmv, /**< reference: OMX_AUDIO_PARAM_SMVTYPE */
+ OMX_IndexParamAudioVorbis, /**< reference: OMX_AUDIO_PARAM_VORBISTYPE */
+
+ OMX_IndexConfigAudioMidiImmediateEvent, /**< reference: OMX_AUDIO_CONFIG_MIDIIMMEDIATEEVENTTYPE */
+ OMX_IndexConfigAudioMidiControl, /**< reference: OMX_AUDIO_CONFIG_MIDICONTROLTYPE */
+ OMX_IndexConfigAudioMidiSoundBankProgram, /**< reference: OMX_AUDIO_CONFIG_MIDISOUNDBANKPROGRAMTYPE */
+ OMX_IndexConfigAudioMidiStatus, /**< reference: OMX_AUDIO_CONFIG_MIDISTATUSTYPE */
+ OMX_IndexConfigAudioMidiMetaEvent, /**< reference: OMX_AUDIO_CONFIG_MIDIMETAEVENTTYPE */
+ OMX_IndexConfigAudioMidiMetaEventData, /**< reference: OMX_AUDIO_CONFIG_MIDIMETAEVENTDATATYPE */
+ OMX_IndexConfigAudioVolume, /**< reference: OMX_AUDIO_CONFIG_VOLUMETYPE */
+ OMX_IndexConfigAudioBalance, /**< reference: OMX_AUDIO_CONFIG_BALANCETYPE */
+ OMX_IndexConfigAudioChannelMute, /**< reference: OMX_AUDIO_CONFIG_CHANNELMUTETYPE */
+ OMX_IndexConfigAudioMute, /**< reference: OMX_AUDIO_CONFIG_MUTETYPE */
+ OMX_IndexConfigAudioLoudness, /**< reference: OMX_AUDIO_CONFIG_LOUDNESSTYPE */
+ OMX_IndexConfigAudioEchoCancelation, /**< reference: OMX_AUDIO_CONFIG_ECHOCANCELATIONTYPE */
+ OMX_IndexConfigAudioNoiseReduction, /**< reference: OMX_AUDIO_CONFIG_NOISEREDUCTIONTYPE */
+ OMX_IndexConfigAudioBass, /**< reference: OMX_AUDIO_CONFIG_BASSTYPE */
+ OMX_IndexConfigAudioTreble, /**< reference: OMX_AUDIO_CONFIG_TREBLETYPE */
+ OMX_IndexConfigAudioStereoWidening, /**< reference: OMX_AUDIO_CONFIG_STEREOWIDENINGTYPE */
+ OMX_IndexConfigAudioChorus, /**< reference: OMX_AUDIO_CONFIG_CHORUSTYPE */
+ OMX_IndexConfigAudioEqualizer, /**< reference: OMX_AUDIO_CONFIG_EQUALIZERTYPE */
+ OMX_IndexConfigAudioReverberation, /**< reference: OMX_AUDIO_CONFIG_REVERBERATIONTYPE */
+ OMX_IndexConfigAudioChannelVolume, /**< reference: OMX_AUDIO_CONFIG_CHANNELVOLUMETYPE */
+
+ /* Image specific parameters and configurations */
+ OMX_IndexImageStartUnused = 0x05000000,
+ OMX_IndexParamImagePortFormat, /**< reference: OMX_IMAGE_PARAM_PORTFORMATTYPE */
+ OMX_IndexParamFlashControl, /**< reference: OMX_IMAGE_PARAM_FLASHCONTROLTYPE */
+ OMX_IndexConfigFocusControl, /**< reference: OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE */
+ OMX_IndexParamQFactor, /**< reference: OMX_IMAGE_PARAM_QFACTORTYPE */
+ OMX_IndexParamQuantizationTable, /**< reference: OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE */
+ OMX_IndexParamHuffmanTable, /**< reference: OMX_IMAGE_PARAM_HUFFMANTTABLETYPE */
+ OMX_IndexConfigFlashControl, /**< reference: OMX_IMAGE_PARAM_FLASHCONTROLTYPE */
+
+ /* Video specific parameters and configurations */
+ OMX_IndexVideoStartUnused = 0x06000000,
+ OMX_IndexParamVideoPortFormat, /**< reference: OMX_VIDEO_PARAM_PORTFORMATTYPE */
+ OMX_IndexParamVideoQuantization, /**< reference: OMX_VIDEO_PARAM_QUANTIZATIONTYPE */
+ OMX_IndexParamVideoFastUpdate, /**< reference: OMX_VIDEO_PARAM_VIDEOFASTUPDATETYPE */
+ OMX_IndexParamVideoBitrate, /**< reference: OMX_VIDEO_PARAM_BITRATETYPE */
+ OMX_IndexParamVideoMotionVector, /**< reference: OMX_VIDEO_PARAM_MOTIONVECTORTYPE */
+ OMX_IndexParamVideoIntraRefresh, /**< reference: OMX_VIDEO_PARAM_INTRAREFRESHTYPE */
+ OMX_IndexParamVideoErrorCorrection, /**< reference: OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE */
+ OMX_IndexParamVideoVBSMC, /**< reference: OMX_VIDEO_PARAM_VBSMCTYPE */
+ OMX_IndexParamVideoMpeg2, /**< reference: OMX_VIDEO_PARAM_MPEG2TYPE */
+ OMX_IndexParamVideoMpeg4, /**< reference: OMX_VIDEO_PARAM_MPEG4TYPE */
+ OMX_IndexParamVideoWmv, /**< reference: OMX_VIDEO_PARAM_WMVTYPE */
+ OMX_IndexParamVideoRv, /**< reference: OMX_VIDEO_PARAM_RVTYPE */
+ OMX_IndexParamVideoAvc, /**< reference: OMX_VIDEO_PARAM_AVCTYPE */
+ OMX_IndexParamVideoH263, /**< reference: OMX_VIDEO_PARAM_H263TYPE */
+ OMX_IndexParamVideoProfileLevelQuerySupported, /**< reference: OMX_VIDEO_PARAM_PROFILELEVELTYPE */
+ OMX_IndexParamVideoProfileLevelCurrent, /**< reference: OMX_VIDEO_PARAM_PROFILELEVELTYPE */
+ OMX_IndexConfigVideoBitrate, /**< reference: OMX_VIDEO_CONFIG_BITRATETYPE */
+ OMX_IndexConfigVideoFramerate, /**< reference: OMX_CONFIG_FRAMERATETYPE */
+ OMX_IndexConfigVideoIntraVOPRefresh, /**< reference: OMX_CONFIG_INTRAREFRESHVOPTYPE */
+ OMX_IndexConfigVideoIntraMBRefresh, /**< reference: OMX_CONFIG_MACROBLOCKERRORMAPTYPE */
+ OMX_IndexConfigVideoMBErrorReporting, /**< reference: OMX_CONFIG_MBERRORREPORTINGTYPE */
+ OMX_IndexParamVideoMacroblocksPerFrame, /**< reference: OMX_PARAM_MACROBLOCKSTYPE */
+ OMX_IndexConfigVideoMacroBlockErrorMap, /**< reference: OMX_CONFIG_MACROBLOCKERRORMAPTYPE */
+ OMX_IndexParamVideoSliceFMO, /**< reference: OMX_VIDEO_PARAM_AVCSLICEFMO */
+ OMX_IndexConfigVideoAVCIntraPeriod, /**< reference: OMX_VIDEO_CONFIG_AVCINTRAPERIOD */
+ OMX_IndexConfigVideoNalSize, /**< reference: OMX_VIDEO_CONFIG_NALSIZE */
+
+ /* Image & Video common Configurations */
+ OMX_IndexCommonStartUnused = 0x07000000,
+ OMX_IndexParamCommonDeblocking, /**< reference: OMX_PARAM_DEBLOCKINGTYPE */
+ OMX_IndexParamCommonSensorMode, /**< reference: OMX_PARAM_SENSORMODETYPE */
+ OMX_IndexParamCommonInterleave, /**< reference: OMX_PARAM_INTERLEAVETYPE */
+ OMX_IndexConfigCommonColorFormatConversion, /**< reference: OMX_CONFIG_COLORCONVERSIONTYPE */
+ OMX_IndexConfigCommonScale, /**< reference: OMX_CONFIG_SCALEFACTORTYPE */
+ OMX_IndexConfigCommonImageFilter, /**< reference: OMX_CONFIG_IMAGEFILTERTYPE */
+ OMX_IndexConfigCommonColorEnhancement, /**< reference: OMX_CONFIG_COLORENHANCEMENTTYPE */
+ OMX_IndexConfigCommonColorKey, /**< reference: OMX_CONFIG_COLORKEYTYPE */
+ OMX_IndexConfigCommonColorBlend, /**< reference: OMX_CONFIG_COLORBLENDTYPE */
+ OMX_IndexConfigCommonFrameStabilisation,/**< reference: OMX_CONFIG_FRAMESTABTYPE */
+ OMX_IndexConfigCommonRotate, /**< reference: OMX_CONFIG_ROTATIONTYPE */
+ OMX_IndexConfigCommonMirror, /**< reference: OMX_CONFIG_MIRRORTYPE */
+ OMX_IndexConfigCommonOutputPosition, /**< reference: OMX_CONFIG_POINTTYPE */
+ OMX_IndexConfigCommonInputCrop, /**< reference: OMX_CONFIG_RECTTYPE */
+ OMX_IndexConfigCommonOutputCrop, /**< reference: OMX_CONFIG_RECTTYPE */
+ OMX_IndexConfigCommonDigitalZoom, /**< reference: OMX_CONFIG_SCALEFACTORTYPE */
+ OMX_IndexConfigCommonOpticalZoom, /**< reference: OMX_CONFIG_SCALEFACTORTYPE*/
+ OMX_IndexConfigCommonWhiteBalance, /**< reference: OMX_CONFIG_WHITEBALCONTROLTYPE */
+ OMX_IndexConfigCommonExposure, /**< reference: OMX_CONFIG_EXPOSURECONTROLTYPE */
+ OMX_IndexConfigCommonContrast, /**< reference: OMX_CONFIG_CONTRASTTYPE */
+ OMX_IndexConfigCommonBrightness, /**< reference: OMX_CONFIG_BRIGHTNESSTYPE */
+ OMX_IndexConfigCommonBacklight, /**< reference: OMX_CONFIG_BACKLIGHTTYPE */
+ OMX_IndexConfigCommonGamma, /**< reference: OMX_CONFIG_GAMMATYPE */
+ OMX_IndexConfigCommonSaturation, /**< reference: OMX_CONFIG_SATURATIONTYPE */
+ OMX_IndexConfigCommonLightness, /**< reference: OMX_CONFIG_LIGHTNESSTYPE */
+ OMX_IndexConfigCommonExclusionRect, /**< reference: OMX_CONFIG_RECTTYPE */
+ OMX_IndexConfigCommonDithering, /**< reference: OMX_CONFIG_DITHERTYPE */
+ OMX_IndexConfigCommonPlaneBlend, /**< reference: OMX_CONFIG_PLANEBLENDTYPE */
+ OMX_IndexConfigCommonExposureValue, /**< reference: OMX_CONFIG_EXPOSUREVALUETYPE */
+ OMX_IndexConfigCommonOutputSize, /**< reference: OMX_FRAMESIZETYPE */
+ OMX_IndexParamCommonExtraQuantData, /**< reference: OMX_OTHER_EXTRADATATYPE */
+ OMX_IndexConfigCommonFocusRegion, /**< reference: OMX_CONFIG_FOCUSREGIONTYPE */
+ OMX_IndexConfigCommonFocusStatus, /**< reference: OMX_PARAM_FOCUSSTATUSTYPE */
+ OMX_IndexConfigCommonTransitionEffect, /**< reference: OMX_CONFIG_TRANSITIONEFFECTTYPE */
+
+ /* Reserved Configuration range */
+ OMX_IndexOtherStartUnused = 0x08000000,
+ OMX_IndexParamOtherPortFormat, /**< reference: OMX_OTHER_PARAM_PORTFORMATTYPE */
+ OMX_IndexConfigOtherPower, /**< reference: OMX_OTHER_CONFIG_POWERTYPE */
+ OMX_IndexConfigOtherStats, /**< reference: OMX_OTHER_CONFIG_STATSTYPE */
+
+
+ /* Reserved Time range */
+ OMX_IndexTimeStartUnused = 0x09000000,
+ OMX_IndexConfigTimeScale, /**< reference: OMX_TIME_CONFIG_SCALETYPE */
+ OMX_IndexConfigTimeClockState, /**< reference: OMX_TIME_CONFIG_CLOCKSTATETYPE */
+ OMX_IndexConfigTimeActiveRefClock, /**< reference: OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE */
+ OMX_IndexConfigTimeCurrentMediaTime, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (read only) */
+ OMX_IndexConfigTimeCurrentWallTime, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (read only) */
+ OMX_IndexConfigTimeCurrentAudioReference, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (write only) */
+ OMX_IndexConfigTimeCurrentVideoReference, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (write only) */
+ OMX_IndexConfigTimeMediaTimeRequest, /**< reference: OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE (write only) */
+ OMX_IndexConfigTimeClientStartTime, /**<reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (write only) */
+ OMX_IndexConfigTimePosition, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE */
+ OMX_IndexConfigTimeSeekMode, /**< reference: OMX_TIME_CONFIG_SEEKMODETYPE */
+
+
+ OMX_IndexKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ /* Vendor specific area */
+ OMX_IndexVendorStartUnused = 0x7F000000,
+ /* Vendor specific structures should be in the range of 0x7F000000
+ to 0x7FFFFFFE. This range is not broken out by vendor, so
+ private indexes are not guaranteed unique and therefore should
+ only be sent to the appropriate component. */
+
+ OMX_IndexMax = 0x7FFFFFFF
+
+} OMX_INDEXTYPE;
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
+/* File EOF */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/khronos_api/v1_1_2/OMX_Other.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,338 @@
+/*
+ * Copyright (c) 2008 The Khronos Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject
+ * to the following conditions:
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+/** @file
+ * OpenMax IL version 1.1.2
+ * The structures needed by Other components to exchange
+ * parameters and configuration data with the components.
+ */
+
+#ifndef OMX_Other_h
+#define OMX_Other_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/* Each OMX header must include all required header files to allow the
+ * header to compile without errors. The includes below are required
+ * for this header file to compile successfully
+ */
+
+#include <openmax/il/khronos/v1_x/OMX_Core.h>
+
+
+/**
+ * Enumeration of possible data types which match to multiple domains or no
+ * domain at all. For types which are vendor specific, a value above
+ * OMX_OTHER_VENDORTSTART should be used.
+ */
+typedef enum OMX_OTHER_FORMATTYPE {
+ OMX_OTHER_FormatTime = 0, /**< Transmission of various timestamps, elapsed time,
+ time deltas, etc */
+ OMX_OTHER_FormatPower, /**< Perhaps used for enabling/disabling power
+ management, setting clocks? */
+ OMX_OTHER_FormatStats, /**< Could be things such as frame rate, frames
+ dropped, etc */
+ OMX_OTHER_FormatBinary, /**< Arbitrary binary data */
+ OMX_OTHER_FormatVendorReserved = 1000, /**< Starting value for vendor specific
+ formats */
+
+ OMX_OTHER_FormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_OTHER_FormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_OTHER_FormatMax = 0x7FFFFFFF
+} OMX_OTHER_FORMATTYPE;
+
+/**
+ * Enumeration of seek modes.
+ */
+typedef enum OMX_TIME_SEEKMODETYPE {
+ OMX_TIME_SeekModeFast = 0, /**< Prefer seeking to an approximation
+ * of the requested seek position over
+ * the actual seek position if it
+ * results in a faster seek. */
+ OMX_TIME_SeekModeAccurate, /**< Prefer seeking to the actual seek
+ * position over an approximation
+ * of the requested seek position even
+ * if it results in a slower seek. */
+ OMX_TIME_SeekModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_TIME_SeekModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_TIME_SeekModeMax = 0x7FFFFFFF
+} OMX_TIME_SEEKMODETYPE;
+
+/* Structure representing the seekmode of the component */
+typedef struct OMX_TIME_CONFIG_SEEKMODETYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_TIME_SEEKMODETYPE eType; /**< The seek mode */
+} OMX_TIME_CONFIG_SEEKMODETYPE;
+
+/** Structure representing a time stamp used with the following configs
+ * on the Clock Component (CC):
+ *
+ * OMX_IndexConfigTimeCurrentWallTime: query of the CC’s current wall
+ * time
+ * OMX_IndexConfigTimeCurrentMediaTime: query of the CC’s current media
+ * time
+ * OMX_IndexConfigTimeCurrentAudioReference and
+ * OMX_IndexConfigTimeCurrentVideoReference: audio/video reference
+ * clock sending SC its reference time
+ * OMX_IndexConfigTimeClientStartTime: a Clock Component client sends
+ * this structure to the Clock Component via a SetConfig on its
+ * client port when it receives a buffer with
+ * OMX_BUFFERFLAG_STARTTIME set. It must use the timestamp
+ * specified by that buffer for nStartTimestamp.
+ *
+ * It’s also used with the following config on components in general:
+ *
+ * OMX_IndexConfigTimePosition: IL client querying component position
+ * (GetConfig) or commanding a component to seek to the given location
+ * (SetConfig)
+ */
+typedef struct OMX_TIME_CONFIG_TIMESTAMPTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version
+ * information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_TICKS nTimestamp; /**< timestamp .*/
+} OMX_TIME_CONFIG_TIMESTAMPTYPE;
+
+/** Enumeration of possible reference clocks to the media time. */
+typedef enum OMX_TIME_UPDATETYPE {
+ OMX_TIME_UpdateRequestFulfillment, /**< Update is the fulfillment of a media time request. */
+ OMX_TIME_UpdateScaleChanged, /**< Update was generated because the scale chagned. */
+ OMX_TIME_UpdateClockStateChanged, /**< Update was generated because the clock state changed. */
+ OMX_TIME_UpdateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_TIME_UpdateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_TIME_UpdateMax = 0x7FFFFFFF
+} OMX_TIME_UPDATETYPE;
+
+/** Enumeration of possible reference clocks to the media time. */
+typedef enum OMX_TIME_REFCLOCKTYPE {
+ OMX_TIME_RefClockNone, /**< Use no references. */
+ OMX_TIME_RefClockAudio, /**< Use references sent through OMX_IndexConfigTimeCurrentAudioReference */
+ OMX_TIME_RefClockVideo, /**< Use references sent through OMX_IndexConfigTimeCurrentVideoReference */
+ OMX_TIME_RefClockKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_TIME_RefClockVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_TIME_RefClockMax = 0x7FFFFFFF
+} OMX_TIME_REFCLOCKTYPE;
+
+/** Enumeration of clock states. */
+typedef enum OMX_TIME_CLOCKSTATE {
+ OMX_TIME_ClockStateRunning, /**< Clock running. */
+ OMX_TIME_ClockStateWaitingForStartTime, /**< Clock waiting until the
+ * prescribed clients emit their
+ * start time. */
+ OMX_TIME_ClockStateStopped, /**< Clock stopped. */
+ OMX_TIME_ClockStateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_TIME_ClockStateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_TIME_ClockStateMax = 0x7FFFFFFF
+} OMX_TIME_CLOCKSTATE;
+
+/** Structure representing a media time request to the clock component.
+ *
+ * A client component sends this structure to the Clock Component via a SetConfig
+ * on its client port to specify a media timestamp the Clock Component
+ * should emit. The Clock Component should fulfill the request by sending a
+ * OMX_TIME_MEDIATIMETYPE when its media clock matches the requested
+ * timestamp.
+ *
+ * The client may require a media time request be fulfilled slightly
+ * earlier than the media time specified. In this case the client specifies
+ * an offset which is equal to the difference between wall time corresponding
+ * to the requested media time and the wall time when it will be
+ * fulfilled.
+ *
+ * A client component may uses these requests and the OMX_TIME_MEDIATIMETYPE to
+ * time events according to timestamps. If a client must perform an operation O at
+ * a time T (e.g. deliver a video frame at its corresponding timestamp), it makes a
+ * media time request at T (perhaps specifying an offset to ensure the request fulfillment
+ * is a little early). When the clock component passes the resulting OMX_TIME_MEDIATIMETYPE
+ * structure back to the client component, the client may perform operation O (perhaps having
+ * to wait a slight amount more time itself as specified by the return values).
+ */
+
+typedef struct OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_PTR pClientPrivate; /**< Client private data to disabiguate this media time
+ * from others (e.g. the number of the frame to deliver).
+ * Duplicated in the media time structure that fulfills
+ * this request. A value of zero is reserved for time scale
+ * updates. */
+ OMX_TICKS nMediaTimestamp; /**< Media timestamp requested.*/
+ OMX_TICKS nOffset; /**< Amount of wall clock time by which this
+ * request should be fulfilled early */
+} OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE;
+
+/**< Structure sent from the clock component client either when fulfilling
+ * a media time request or when the time scale has changed.
+ *
+ * In the former case the Clock Component fills this structure and times its emission
+ * to a client component (via the client port) according to the corresponding media
+ * time request sent by the client. The Clock Component should time the emission to occur
+ * when the requested timestamp matches the Clock Component's media time but also the
+ * prescribed offset early.
+ *
+ * Upon scale changes the clock component clears the nClientPrivate data, sends the current
+ * media time and sets the nScale to the new scale via the client port. It emits a
+ * OMX_TIME_MEDIATIMETYPE to all clients independent of any requests. This allows clients to
+ * alter processing to accomodate scaling. For instance a video component might skip inter-frames
+ * in the case of extreme fastforward. Likewise an audio component might add or remove samples
+ * from an audio frame to scale audio data.
+ *
+ * It is expected that some clock components may not be able to fulfill requests
+ * at exactly the prescribed time. This is acceptable so long as the request is
+ * fulfilled at least as early as described and not later. This structure provides
+ * fields the client may use to wait for the remaining time.
+ *
+ * The client may use either the nOffset or nWallTimeAtMedia fields to determine the
+ * wall time until the nMediaTimestamp actually occurs. In the latter case the
+ * client can get a more accurate value for offset by getting the current wall
+ * from the cloc component and subtracting it from nWallTimeAtMedia.
+ */
+
+typedef struct OMX_TIME_MEDIATIMETYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nClientPrivate; /**< Client private data to disabiguate this media time
+ * from others. Copied from the media time request.
+ * A value of zero is reserved for time scale updates. */
+ OMX_TIME_UPDATETYPE eUpdateType; /**< Reason for the update */
+ OMX_TICKS nMediaTimestamp; /**< Media time requested. If no media time was
+ * requested then this is the current media time. */
+ OMX_TICKS nOffset; /**< Amount of wall clock time by which this
+ * request was actually fulfilled early */
+
+ OMX_TICKS nWallTimeAtMediaTime; /**< Wall time corresponding to nMediaTimeStamp.
+ * A client may compare this value to current
+ * media time obtained from the Clock Component to determine
+ * the wall time until the media timestamp is really
+ * current. */
+ OMX_S32 xScale; /**< Current media time scale in Q16 format. */
+ OMX_TIME_CLOCKSTATE eState; /* Seeking Change. Added 7/12.*/
+ /**< State of the media time. */
+} OMX_TIME_MEDIATIMETYPE;
+
+/** Structure representing the current media time scale factor. Applicable only to clock
+ * component, other components see scale changes via OMX_TIME_MEDIATIMETYPE buffers sent via
+ * the clock component client ports. Upon recieving this config the clock component changes
+ * the rate by which the media time increases or decreases effectively implementing trick modes.
+ */
+typedef struct OMX_TIME_CONFIG_SCALETYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_S32 xScale; /**< This is a value in Q16 format which is used for
+ * scaling the media time */
+} OMX_TIME_CONFIG_SCALETYPE;
+
+/** Bits used to identify a clock port. Used in OMX_TIME_CONFIG_CLOCKSTATETYPE’s nWaitMask field */
+#define OMX_CLOCKPORT0 0x00000001
+#define OMX_CLOCKPORT1 0x00000002
+#define OMX_CLOCKPORT2 0x00000004
+#define OMX_CLOCKPORT3 0x00000008
+#define OMX_CLOCKPORT4 0x00000010
+#define OMX_CLOCKPORT5 0x00000020
+#define OMX_CLOCKPORT6 0x00000040
+#define OMX_CLOCKPORT7 0x00000080
+
+/** Structure representing the current mode of the media clock.
+ * IL Client uses this config to change or query the mode of the
+ * media clock of the clock component. Applicable only to clock
+ * component.
+ *
+ * On a SetConfig if eState is OMX_TIME_ClockStateRunning media time
+ * starts immediately at the prescribed start time. If
+ * OMX_TIME_ClockStateWaitingForStartTime the Clock Component ignores
+ * the given nStartTime and waits for all clients specified in the
+ * nWaitMask to send starttimes (via
+ * OMX_IndexConfigTimeClientStartTime). The Clock Component then starts
+ * the media clock using the earliest start time supplied. */
+typedef struct OMX_TIME_CONFIG_CLOCKSTATETYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version
+ * information */
+ OMX_TIME_CLOCKSTATE eState; /**< State of the media time. */
+ OMX_TICKS nStartTime; /**< Start time of the media time. */
+ OMX_TICKS nOffset; /**< Time to offset the media time by
+ * (e.g. preroll). Media time will be
+ * reported to be nOffset ticks earlier.
+ */
+ OMX_U32 nWaitMask; /**< Mask of OMX_CLOCKPORT values. */
+} OMX_TIME_CONFIG_CLOCKSTATETYPE;
+
+/** Structure representing the reference clock currently being used to
+ * compute media time. IL client uses this config to change or query the
+ * clock component's active reference clock */
+typedef struct OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_TIME_REFCLOCKTYPE eClock; /**< Reference clock used to compute media time */
+} OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE;
+
+/** Descriptor for setting specifics of power type.
+ * Note: this structure is listed for backwards compatibility. */
+typedef struct OMX_OTHER_CONFIG_POWERTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_BOOL bEnablePM; /**< Flag to enable Power Management */
+} OMX_OTHER_CONFIG_POWERTYPE;
+
+
+/** Descriptor for setting specifics of stats type.
+ * Note: this structure is listed for backwards compatibility. */
+typedef struct OMX_OTHER_CONFIG_STATSTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ /* what goes here */
+} OMX_OTHER_CONFIG_STATSTYPE;
+
+
+/**
+ * The PortDefinition structure is used to define all of the parameters
+ * necessary for the compliant component to setup an input or an output other
+ * path.
+ */
+typedef struct OMX_OTHER_PORTDEFINITIONTYPE {
+ OMX_OTHER_FORMATTYPE eFormat; /**< Type of data expected for this channel */
+} OMX_OTHER_PORTDEFINITIONTYPE;
+
+/** Port format parameter. This structure is used to enumerate
+ * the various data input/output format supported by the port.
+ */
+typedef struct OMX_OTHER_PARAM_PORTFORMATTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Indicates which port to set */
+ OMX_U32 nIndex; /**< Indicates the enumeration index for the format from 0x0 to N-1 */
+ OMX_OTHER_FORMATTYPE eFormat; /**< Type of data expected for this channel */
+} OMX_OTHER_PARAM_PORTFORMATTYPE;
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
+/* File EOF */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/khronos_api/v1_1_2/OMX_Types.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,359 @@
+/*
+ * Copyright (c) 2008 The Khronos Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject
+ * to the following conditions:
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+/** OMX_Types.h - OpenMax IL version 1.1.2
+ * The OMX_Types header file contains the primitive type definitions used by
+ * the core, the application and the component. This file may need to be
+ * modified to be used on systems that do not have "char" set to 8 bits,
+ * "short" set to 16 bits and "long" set to 32 bits.
+ */
+
+#ifndef OMX_Types_h
+#define OMX_Types_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/** The OMX_API and OMX_APIENTRY are platform specific definitions used
+ * to declare OMX function prototypes. They are modified to meet the
+ * requirements for a particular platform */
+#ifdef __SYMBIAN32__
+# ifdef __OMX_EXPORTS
+# define OMX_API __declspec(dllexport)
+# else
+# ifdef _WIN32
+# define OMX_API __declspec(dllexport)
+# else
+# define OMX_API __declspec(dllimport)
+# endif
+# endif
+#else
+# ifdef _WIN32
+# ifdef __OMX_EXPORTS
+# define OMX_API __declspec(dllexport)
+# else
+# define OMX_API __declspec(dllimport)
+# endif
+# else
+# ifdef __OMX_EXPORTS
+# define OMX_API
+# else
+# define OMX_API extern
+# endif
+# endif
+#endif
+
+#ifndef OMX_APIENTRY
+#define OMX_APIENTRY
+#endif
+
+/** OMX_IN is used to identify inputs to an OMX function. This designation
+ will also be used in the case of a pointer that points to a parameter
+ that is used as an output. */
+#ifndef OMX_IN
+#define OMX_IN
+#endif
+
+/** OMX_OUT is used to identify outputs from an OMX function. This
+ designation will also be used in the case of a pointer that points
+ to a parameter that is used as an input. */
+#ifndef OMX_OUT
+#define OMX_OUT
+#endif
+
+
+/** OMX_INOUT is used to identify parameters that may be either inputs or
+ outputs from an OMX function at the same time. This designation will
+ also be used in the case of a pointer that points to a parameter that
+ is used both as an input and an output. */
+#ifndef OMX_INOUT
+#define OMX_INOUT
+#endif
+
+/** OMX_ALL is used to as a wildcard to select all entities of the same type
+ * when specifying the index, or referring to a object by an index. (i.e.
+ * use OMX_ALL to indicate all N channels). When used as a port index
+ * for a config or parameter this OMX_ALL denotes that the config or
+ * parameter applies to the entire component not just one port. */
+#define OMX_ALL 0xFFFFFFFF
+
+/** In the following we define groups that help building doxygen documentation */
+
+/** @defgroup core OpenMAX IL core
+ * Functions and structure related to the OMX IL core
+ */
+
+ /** @defgroup comp OpenMAX IL component
+ * Functions and structure related to the OMX IL component
+ */
+
+/** @defgroup rpm Resource and Policy Management
+ * Structures for resource and policy management of components
+ */
+
+/** @defgroup buf Buffer Management
+ * Buffer handling functions and structures
+ */
+
+/** @defgroup tun Tunneling
+ * @ingroup core comp
+ * Structures and functions to manage tunnels among component ports
+ */
+
+/** @defgroup cp Content Pipes
+ * @ingroup core
+ */
+
+ /** @defgroup metadata Metadata handling
+ *
+ */
+
+/** OMX_U8 is an 8 bit unsigned quantity that is byte aligned */
+typedef unsigned char OMX_U8;
+
+/** OMX_S8 is an 8 bit signed quantity that is byte aligned */
+typedef signed char OMX_S8;
+
+/** OMX_U16 is a 16 bit unsigned quantity that is 16 bit word aligned */
+typedef unsigned short OMX_U16;
+
+/** OMX_S16 is a 16 bit signed quantity that is 16 bit word aligned */
+typedef signed short OMX_S16;
+
+/** OMX_U32 is a 32 bit unsigned quantity that is 32 bit word aligned */
+typedef unsigned long OMX_U32;
+
+/** OMX_S32 is a 32 bit signed quantity that is 32 bit word aligned */
+typedef signed long OMX_S32;
+
+
+/* Users with compilers that cannot accept the "long long" designation should
+ define the OMX_SKIP64BIT macro. It should be noted that this may cause
+ some components to fail to compile if the component was written to require
+ 64 bit integral types. However, these components would NOT compile anyway
+ since the compiler does not support the way the component was written.
+*/
+#ifndef OMX_SKIP64BIT
+#ifdef __SYMBIAN32__
+/** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */
+typedef unsigned long long OMX_U64;
+
+/** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */
+typedef signed long long OMX_S64;
+
+#elif defined(WIN32)
+
+/** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */
+typedef unsigned __int64 OMX_U64;
+
+/** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */
+typedef signed __int64 OMX_S64;
+
+#else /* WIN32 */
+
+/** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */
+typedef unsigned long long OMX_U64;
+
+/** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */
+typedef signed long long OMX_S64;
+
+#endif /* WIN32 */
+#endif
+
+
+/** The OMX_BOOL type is intended to be used to represent a true or a false
+ value when passing parameters to and from the OMX core and components. The
+ OMX_BOOL is a 32 bit quantity and is aligned on a 32 bit word boundary.
+ */
+typedef enum OMX_BOOL {
+ OMX_FALSE = 0,
+ OMX_TRUE = !OMX_FALSE,
+ OMX_BOOL_MAX = 0x7FFFFFFF
+} OMX_BOOL;
+
+/** The OMX_PTR type is intended to be used to pass pointers between the OMX
+ applications and the OMX Core and components. This is a 32 bit pointer and
+ is aligned on a 32 bit boundary.
+ */
+typedef void* OMX_PTR;
+
+/** The OMX_STRING type is intended to be used to pass "C" type strings between
+ the application and the core and component. The OMX_STRING type is a 32
+ bit pointer to a zero terminated string. The pointer is word aligned and
+ the string is byte aligned.
+ */
+typedef char* OMX_STRING;
+
+/** The OMX_BYTE type is intended to be used to pass arrays of bytes such as
+ buffers between the application and the component and core. The OMX_BYTE
+ type is a 32 bit pointer to a zero terminated string. The pointer is word
+ aligned and the string is byte aligned.
+ */
+typedef unsigned char* OMX_BYTE;
+
+/** OMX_UUIDTYPE is a very long unique identifier to uniquely identify
+ at runtime. This identifier should be generated by a component in a way
+ that guarantees that every instance of the identifier running on the system
+ is unique. */
+typedef unsigned char OMX_UUIDTYPE[128];
+
+/** The OMX_DIRTYPE enumeration is used to indicate if a port is an input or
+ an output port. This enumeration is common across all component types.
+ */
+typedef enum OMX_DIRTYPE
+{
+ OMX_DirInput, /**< Port is an input port */
+ OMX_DirOutput, /**< Port is an output port */
+ OMX_DirMax = 0x7FFFFFFF
+} OMX_DIRTYPE;
+
+/** The OMX_ENDIANTYPE enumeration is used to indicate the bit ordering
+ for numerical data (i.e. big endian, or little endian).
+ */
+typedef enum OMX_ENDIANTYPE
+{
+ OMX_EndianBig, /**< big endian */
+ OMX_EndianLittle, /**< little endian */
+ OMX_EndianMax = 0x7FFFFFFF
+} OMX_ENDIANTYPE;
+
+
+/** The OMX_NUMERICALDATATYPE enumeration is used to indicate if data
+ is signed or unsigned
+ */
+typedef enum OMX_NUMERICALDATATYPE
+{
+ OMX_NumericalDataSigned, /**< signed data */
+ OMX_NumericalDataUnsigned, /**< unsigned data */
+ OMX_NumercialDataMax = 0x7FFFFFFF
+} OMX_NUMERICALDATATYPE;
+
+
+/** Unsigned bounded value type */
+typedef struct OMX_BU32 {
+ OMX_U32 nValue; /**< actual value */
+ OMX_U32 nMin; /**< minimum for value (i.e. nValue >= nMin) */
+ OMX_U32 nMax; /**< maximum for value (i.e. nValue <= nMax) */
+} OMX_BU32;
+
+
+/** Signed bounded value type */
+typedef struct OMX_BS32 {
+ OMX_S32 nValue; /**< actual value */
+ OMX_S32 nMin; /**< minimum for value (i.e. nValue >= nMin) */
+ OMX_S32 nMax; /**< maximum for value (i.e. nValue <= nMax) */
+} OMX_BS32;
+
+
+/** Structure representing some time or duration in microseconds. This structure
+ * must be interpreted as a signed 64 bit value. The quantity is signed to accommodate
+ * negative deltas and preroll scenarios. The quantity is represented in microseconds
+ * to accomodate high resolution timestamps (e.g. DVD presentation timestamps based
+ * on a 90kHz clock) and to allow more accurate and synchronized delivery (e.g.
+ * individual audio samples delivered at 192 kHz). The quantity is 64 bit to
+ * accommodate a large dynamic range (signed 32 bit values would allow only for plus
+ * or minus 35 minutes).
+ *
+ * Implementations with limited precision may convert the signed 64 bit value to
+ * a signed 32 bit value internally but risk loss of precision.
+ */
+#ifndef OMX_SKIP64BIT
+typedef OMX_S64 OMX_TICKS;
+#else
+typedef struct OMX_TICKS
+{
+ OMX_U32 nLowPart; /** low bits of the signed 64 bit tick value */
+ OMX_U32 nHighPart; /** high bits of the signed 64 bit tick value */
+} OMX_TICKS;
+#endif
+#define OMX_TICKS_PER_SECOND 1000000
+
+/** Define the public interface for the OMX Handle. The core will not use
+ this value internally, but the application should only use this value.
+ */
+typedef void* OMX_HANDLETYPE;
+
+typedef struct OMX_MARKTYPE
+{
+ OMX_HANDLETYPE hMarkTargetComponent; /**< The component that will
+ generate a mark event upon
+ processing the mark. */
+ OMX_PTR pMarkData; /**< Application specific data associated with
+ the mark sent on a mark event to disambiguate
+ this mark from others. */
+} OMX_MARKTYPE;
+
+
+/** OMX_NATIVE_DEVICETYPE is used to map a OMX video port to the
+ * platform & operating specific object used to reference the display
+ * or can be used by a audio port for native audio rendering */
+typedef void* OMX_NATIVE_DEVICETYPE;
+
+/** OMX_NATIVE_WINDOWTYPE is used to map a OMX video port to the
+ * platform & operating specific object used to reference the window */
+typedef void* OMX_NATIVE_WINDOWTYPE;
+
+
+/** Define the OMX IL version that corresponds to this set of header files.
+ * We also define a combined version that can be used to write or compare
+ * values of the 32bit nVersion field, assuming a little endian architecture */
+#define OMX_VERSION_MAJOR 1
+#define OMX_VERSION_MINOR 1
+#define OMX_VERSION_REVISION 2
+#define OMX_VERSION_STEP 0
+
+#define OMX_VERSION ((OMX_VERSION_STEP<<24) | (OMX_VERSION_REVISION<<16) | (OMX_VERSION_MINOR<<8) | OMX_VERSION_MAJOR)
+
+
+/** The OMX_VERSIONTYPE union is used to specify the version for
+ a structure or component. For a component, the version is entirely
+ specified by the component vendor. Components doing the same function
+ from different vendors may or may not have the same version. For
+ structures, the version shall be set by the entity that allocates the
+ structure. For structures specified in the OMX 1.1 specification, the
+ value of the version shall be set to 1.1.0.0 in all cases. Access to the
+ OMX_VERSIONTYPE can be by a single 32 bit access (e.g. by nVersion) or
+ by accessing one of the structure elements to, for example, check only
+ the Major revision.
+ */
+typedef union OMX_VERSIONTYPE
+{
+ struct
+ {
+ OMX_U8 nVersionMajor; /**< Major version accessor element */
+ OMX_U8 nVersionMinor; /**< Minor version accessor element */
+ OMX_U8 nRevision; /**< Revision version accessor element */
+ OMX_U8 nStep; /**< Step version accessor element */
+ } s;
+ OMX_U32 nVersion; /**< 32 bit value to make accessing the
+ version easily done in a single word
+ size copy/compare operation */
+} OMX_VERSIONTYPE;
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
+/* File EOF */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/khronos_api/v1_1_2/OMX_Video.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,1060 @@
+/**
+ * Copyright (c) 2008 The Khronos Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject
+ * to the following conditions:
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+/**
+ * @file OMX_Video.h - OpenMax IL version 1.1.2
+ * The structures is needed by Video components to exchange parameters
+ * and configuration data with OMX components.
+ */
+#ifndef OMX_Video_h
+#define OMX_Video_h
+
+/** @defgroup video OpenMAX IL Video Domain
+ * @ingroup iv
+ * Structures for OpenMAX IL Video domain
+ * @{
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/**
+ * Each OMX header must include all required header files to allow the
+ * header to compile without errors. The includes below are required
+ * for this header file to compile successfully
+ */
+
+#include <openmax/il/khronos/v1_x/OMX_IVCommon.h>
+
+
+/**
+ * Enumeration used to define the possible video compression codings.
+ * NOTE: This essentially refers to file extensions. If the coding is
+ * being used to specify the ENCODE type, then additional work
+ * must be done to configure the exact flavor of the compression
+ * to be used. For decode cases where the user application can
+ * not differentiate between MPEG-4 and H.264 bit streams, it is
+ * up to the codec to handle this.
+ */
+typedef enum OMX_VIDEO_CODINGTYPE {
+ OMX_VIDEO_CodingUnused, /**< Value when coding is N/A */
+ OMX_VIDEO_CodingAutoDetect, /**< Autodetection of coding type */
+ OMX_VIDEO_CodingMPEG2, /**< AKA: H.262 */
+ OMX_VIDEO_CodingH263, /**< H.263 */
+ OMX_VIDEO_CodingMPEG4, /**< MPEG-4 */
+ OMX_VIDEO_CodingWMV, /**< all versions of Windows Media Video */
+ OMX_VIDEO_CodingRV, /**< all versions of Real Video */
+ OMX_VIDEO_CodingAVC, /**< H.264/AVC */
+ OMX_VIDEO_CodingMJPEG, /**< Motion JPEG */
+ OMX_VIDEO_CodingKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_VIDEO_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_VIDEO_CodingMax = 0x7FFFFFFF
+} OMX_VIDEO_CODINGTYPE;
+
+
+/**
+ * Data structure used to define a video path. The number of Video paths for
+ * input and output will vary by type of the Video component.
+ *
+ * Input (aka Source) : zero Inputs, one Output,
+ * Splitter : one Input, 2 or more Outputs,
+ * Processing Element : one Input, one output,
+ * Mixer : 2 or more inputs, one output,
+ * Output (aka Sink) : one Input, zero outputs.
+ *
+ * The PortDefinition structure is used to define all of the parameters
+ * necessary for the compliant component to setup an input or an output video
+ * path. If additional vendor specific data is required, it should be
+ * transmitted to the component using the CustomCommand function. Compliant
+ * components will prepopulate this structure with optimal values during the
+ * GetDefaultInitParams command.
+ *
+ * STRUCT MEMBERS:
+ * cMIMEType : MIME type of data for the port
+ * pNativeRender : Platform specific reference for a display if a
+ * sync, otherwise this field is 0
+ * nFrameWidth : Width of frame to be used on channel if
+ * uncompressed format is used. Use 0 for unknown,
+ * don't care or variable
+ * nFrameHeight : Height of frame to be used on channel if
+ * uncompressed format is used. Use 0 for unknown,
+ * don't care or variable
+ * nStride : Number of bytes per span of an image
+ * (i.e. indicates the number of bytes to get
+ * from span N to span N+1, where negative stride
+ * indicates the image is bottom up
+ * nSliceHeight : Height used when encoding in slices
+ * nBitrate : Bit rate of frame to be used on channel if
+ * compressed format is used. Use 0 for unknown,
+ * don't care or variable
+ * xFramerate : Frame rate to be used on channel if uncompressed
+ * format is used. Use 0 for unknown, don't care or
+ * variable. Units are Q16 frames per second.
+ * bFlagErrorConcealment : Turns on error concealment if it is supported by
+ * the OMX component
+ * eCompressionFormat : Compression format used in this instance of the
+ * component. When OMX_VIDEO_CodingUnused is
+ * specified, eColorFormat is used
+ * eColorFormat : Decompressed format used by this component
+ * pNativeWindow : Platform specific reference for a window object if a
+ * display sink , otherwise this field is 0x0.
+ */
+typedef struct OMX_VIDEO_PORTDEFINITIONTYPE {
+ OMX_STRING cMIMEType;
+ OMX_NATIVE_DEVICETYPE pNativeRender;
+ OMX_U32 nFrameWidth;
+ OMX_U32 nFrameHeight;
+ OMX_S32 nStride;
+ OMX_U32 nSliceHeight;
+ OMX_U32 nBitrate;
+ OMX_U32 xFramerate;
+ OMX_BOOL bFlagErrorConcealment;
+ OMX_VIDEO_CODINGTYPE eCompressionFormat;
+ OMX_COLOR_FORMATTYPE eColorFormat;
+ OMX_NATIVE_WINDOWTYPE pNativeWindow;
+} OMX_VIDEO_PORTDEFINITIONTYPE;
+
+/**
+ * Port format parameter. This structure is used to enumerate the various
+ * data input/output format supported by the port.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Indicates which port to set
+ * nIndex : Indicates the enumeration index for the format from
+ * 0x0 to N-1
+ * eCompressionFormat : Compression format used in this instance of the
+ * component. When OMX_VIDEO_CodingUnused is specified,
+ * eColorFormat is used
+ * eColorFormat : Decompressed format used by this component
+ * xFrameRate : Indicates the video frame rate in Q16 format
+ */
+typedef struct OMX_VIDEO_PARAM_PORTFORMATTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nIndex;
+ OMX_VIDEO_CODINGTYPE eCompressionFormat;
+ OMX_COLOR_FORMATTYPE eColorFormat;
+ OMX_U32 xFramerate;
+} OMX_VIDEO_PARAM_PORTFORMATTYPE;
+
+
+/**
+ * This is a structure for configuring video compression quantization
+ * parameter values. Codecs may support different QP values for different
+ * frame types.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version info
+ * nPortIndex : Port that this structure applies to
+ * nQpI : QP value to use for index frames
+ * nQpP : QP value to use for P frames
+ * nQpB : QP values to use for bidirectional frames
+ */
+typedef struct OMX_VIDEO_PARAM_QUANTIZATIONTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nQpI;
+ OMX_U32 nQpP;
+ OMX_U32 nQpB;
+} OMX_VIDEO_PARAM_QUANTIZATIONTYPE;
+
+
+/**
+ * Structure for configuration of video fast update parameters.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version info
+ * nPortIndex : Port that this structure applies to
+ * bEnableVFU : Enable/Disable video fast update
+ * nFirstGOB : Specifies the number of the first macroblock row
+ * nFirstMB : specifies the first MB relative to the specified first GOB
+ * nNumMBs : Specifies the number of MBs to be refreshed from nFirstGOB
+ * and nFirstMB
+ */
+typedef struct OMX_VIDEO_PARAM_VIDEOFASTUPDATETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bEnableVFU;
+ OMX_U32 nFirstGOB;
+ OMX_U32 nFirstMB;
+ OMX_U32 nNumMBs;
+} OMX_VIDEO_PARAM_VIDEOFASTUPDATETYPE;
+
+
+/**
+ * Enumeration of possible bitrate control types
+ */
+typedef enum OMX_VIDEO_CONTROLRATETYPE {
+ OMX_Video_ControlRateDisable,
+ OMX_Video_ControlRateVariable,
+ OMX_Video_ControlRateConstant,
+ OMX_Video_ControlRateVariableSkipFrames,
+ OMX_Video_ControlRateConstantSkipFrames,
+ OMX_Video_ControlRateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_Video_ControlRateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_Video_ControlRateMax = 0x7FFFFFFF
+} OMX_VIDEO_CONTROLRATETYPE;
+
+
+/**
+ * Structure for configuring bitrate mode of a codec.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the struct in bytes
+ * nVersion : OMX spec version info
+ * nPortIndex : Port that this struct applies to
+ * eControlRate : Control rate type enum
+ * nTargetBitrate : Target bitrate to encode with
+ */
+typedef struct OMX_VIDEO_PARAM_BITRATETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_VIDEO_CONTROLRATETYPE eControlRate;
+ OMX_U32 nTargetBitrate;
+} OMX_VIDEO_PARAM_BITRATETYPE;
+
+
+/**
+ * Enumeration of possible motion vector (MV) types
+ */
+typedef enum OMX_VIDEO_MOTIONVECTORTYPE {
+ OMX_Video_MotionVectorPixel,
+ OMX_Video_MotionVectorHalfPel,
+ OMX_Video_MotionVectorQuarterPel,
+ OMX_Video_MotionVectorEighthPel,
+ OMX_Video_MotionVectorKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_Video_MotionVectorVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_Video_MotionVectorMax = 0x7FFFFFFF
+} OMX_VIDEO_MOTIONVECTORTYPE;
+
+
+/**
+ * Structure for configuring the number of motion vectors used as well
+ * as their accuracy.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the struct in bytes
+ * nVersion : OMX spec version info
+ * nPortIndex : port that this structure applies to
+ * eAccuracy : Enumerated MV accuracy
+ * bUnrestrictedMVs : Allow unrestricted MVs
+ * bFourMV : Allow use of 4 MVs
+ * sXSearchRange : Search range in horizontal direction for MVs
+ * sYSearchRange : Search range in vertical direction for MVs
+ */
+typedef struct OMX_VIDEO_PARAM_MOTIONVECTORTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_VIDEO_MOTIONVECTORTYPE eAccuracy;
+ OMX_BOOL bUnrestrictedMVs;
+ OMX_BOOL bFourMV;
+ OMX_S32 sXSearchRange;
+ OMX_S32 sYSearchRange;
+} OMX_VIDEO_PARAM_MOTIONVECTORTYPE;
+
+
+/**
+ * Enumeration of possible methods to use for Intra Refresh
+ */
+typedef enum OMX_VIDEO_INTRAREFRESHTYPE {
+ OMX_VIDEO_IntraRefreshCyclic,
+ OMX_VIDEO_IntraRefreshAdaptive,
+ OMX_VIDEO_IntraRefreshBoth,
+ OMX_VIDEO_IntraRefreshKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_VIDEO_IntraRefreshVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_VIDEO_IntraRefreshMax = 0x7FFFFFFF
+} OMX_VIDEO_INTRAREFRESHTYPE;
+
+
+/**
+ * Structure for configuring intra refresh mode
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eRefreshMode : Cyclic, Adaptive, or Both
+ * nAirMBs : Number of intra macroblocks to refresh in a frame when
+ * AIR is enabled
+ * nAirRef : Number of times a motion marked macroblock has to be
+ * intra coded
+ * nCirMBs : Number of consecutive macroblocks to be coded as "intra"
+ * when CIR is enabled
+ */
+typedef struct OMX_VIDEO_PARAM_INTRAREFRESHTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_VIDEO_INTRAREFRESHTYPE eRefreshMode;
+ OMX_U32 nAirMBs;
+ OMX_U32 nAirRef;
+ OMX_U32 nCirMBs;
+} OMX_VIDEO_PARAM_INTRAREFRESHTYPE;
+
+
+/**
+ * Structure for enabling various error correction methods for video
+ * compression.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * bEnableHEC : Enable/disable header extension codes (HEC)
+ * bEnableResync : Enable/disable resynchronization markers
+ * nResynchMarkerSpacing : Resynch markers interval (in bits) to be
+ * applied in the stream
+ * bEnableDataPartitioning : Enable/disable data partitioning
+ * bEnableRVLC : Enable/disable reversible variable length
+ * coding
+ */
+typedef struct OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bEnableHEC;
+ OMX_BOOL bEnableResync;
+ OMX_U32 nResynchMarkerSpacing;
+ OMX_BOOL bEnableDataPartitioning;
+ OMX_BOOL bEnableRVLC;
+} OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE;
+
+
+/**
+ * Configuration of variable block-size motion compensation (VBSMC)
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * b16x16 : Enable inter block search 16x16
+ * b16x8 : Enable inter block search 16x8
+ * b8x16 : Enable inter block search 8x16
+ * b8x8 : Enable inter block search 8x8
+ * b8x4 : Enable inter block search 8x4
+ * b4x8 : Enable inter block search 4x8
+ * b4x4 : Enable inter block search 4x4
+ */
+typedef struct OMX_VIDEO_PARAM_VBSMCTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL b16x16;
+ OMX_BOOL b16x8;
+ OMX_BOOL b8x16;
+ OMX_BOOL b8x8;
+ OMX_BOOL b8x4;
+ OMX_BOOL b4x8;
+ OMX_BOOL b4x4;
+} OMX_VIDEO_PARAM_VBSMCTYPE;
+
+
+/**
+ * H.263 profile types, each profile indicates support for various
+ * performance bounds and different annexes.
+ *
+ * ENUMS:
+ * Baseline : Baseline Profile: H.263 (V1), no optional modes
+ * H320 Coding : H.320 Coding Efficiency Backward Compatibility
+ * Profile: H.263+ (V2), includes annexes I, J, L.4
+ * and T
+ * BackwardCompatible : Backward Compatibility Profile: H.263 (V1),
+ * includes annex F
+ * ISWV2 : Interactive Streaming Wireless Profile: H.263+
+ * (V2), includes annexes I, J, K and T
+ * ISWV3 : Interactive Streaming Wireless Profile: H.263++
+ * (V3), includes profile 3 and annexes V and W.6.3.8
+ * HighCompression : Conversational High Compression Profile: H.263++
+ * (V3), includes profiles 1 & 2 and annexes D and U
+ * Internet : Conversational Internet Profile: H.263++ (V3),
+ * includes profile 5 and annex K
+ * Interlace : Conversational Interlace Profile: H.263++ (V3),
+ * includes profile 5 and annex W.6.3.11
+ * HighLatency : High Latency Profile: H.263++ (V3), includes
+ * profile 6 and annexes O.1 and P.5
+ */
+typedef enum OMX_VIDEO_H263PROFILETYPE {
+ OMX_VIDEO_H263ProfileBaseline = 0x01,
+ OMX_VIDEO_H263ProfileH320Coding = 0x02,
+ OMX_VIDEO_H263ProfileBackwardCompatible = 0x04,
+ OMX_VIDEO_H263ProfileISWV2 = 0x08,
+ OMX_VIDEO_H263ProfileISWV3 = 0x10,
+ OMX_VIDEO_H263ProfileHighCompression = 0x20,
+ OMX_VIDEO_H263ProfileInternet = 0x40,
+ OMX_VIDEO_H263ProfileInterlace = 0x80,
+ OMX_VIDEO_H263ProfileHighLatency = 0x100,
+ OMX_VIDEO_H263ProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_VIDEO_H263ProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_VIDEO_H263ProfileMax = 0x7FFFFFFF
+} OMX_VIDEO_H263PROFILETYPE;
+
+
+/**
+ * H.263 level types, each level indicates support for various frame sizes,
+ * bit rates, decoder frame rates.
+ */
+typedef enum OMX_VIDEO_H263LEVELTYPE {
+ OMX_VIDEO_H263Level10 = 0x01,
+ OMX_VIDEO_H263Level20 = 0x02,
+ OMX_VIDEO_H263Level30 = 0x04,
+ OMX_VIDEO_H263Level40 = 0x08,
+ OMX_VIDEO_H263Level45 = 0x10,
+ OMX_VIDEO_H263Level50 = 0x20,
+ OMX_VIDEO_H263Level60 = 0x40,
+ OMX_VIDEO_H263Level70 = 0x80,
+ OMX_VIDEO_H263LevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_VIDEO_H263LevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_VIDEO_H263LevelMax = 0x7FFFFFFF
+} OMX_VIDEO_H263LEVELTYPE;
+
+
+/**
+ * Specifies the picture type. These values should be OR'd to signal all
+ * pictures types which are allowed.
+ *
+ * ENUMS:
+ * Generic Picture Types: I, P and B
+ * H.263 Specific Picture Types: SI and SP
+ * H.264 Specific Picture Types: EI and EP
+ * MPEG-4 Specific Picture Types: S
+ */
+typedef enum OMX_VIDEO_PICTURETYPE {
+ OMX_VIDEO_PictureTypeI = 0x01,
+ OMX_VIDEO_PictureTypeP = 0x02,
+ OMX_VIDEO_PictureTypeB = 0x04,
+ OMX_VIDEO_PictureTypeSI = 0x08,
+ OMX_VIDEO_PictureTypeSP = 0x10,
+ OMX_VIDEO_PictureTypeEI = 0x11,
+ OMX_VIDEO_PictureTypeEP = 0x12,
+ OMX_VIDEO_PictureTypeS = 0x14,
+ OMX_VIDEO_PictureTypeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_VIDEO_PictureTypeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_VIDEO_PictureTypeMax = 0x7FFFFFFF
+} OMX_VIDEO_PICTURETYPE;
+
+
+/**
+ * H.263 Params
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nPFrames : Number of P frames between each I frame
+ * nBFrames : Number of B frames between each I frame
+ * eProfile : H.263 profile(s) to use
+ * eLevel : H.263 level(s) to use
+ * bPLUSPTYPEAllowed : Indicating that it is allowed to use PLUSPTYPE
+ * (specified in the 1998 version of H.263) to
+ * indicate custom picture sizes or clock
+ * frequencies
+ * nAllowedPictureTypes : Specifies the picture types allowed in the
+ * bitstream
+ * bForceRoundingTypeToZero : value of the RTYPE bit (bit 6 of MPPTYPE) is
+ * not constrained. It is recommended to change
+ * the value of the RTYPE bit for each reference
+ * picture in error-free communication
+ * nPictureHeaderRepetition : Specifies the frequency of picture header
+ * repetition
+ * nGOBHeaderInterval : Specifies the interval of non-empty GOB
+ * headers in units of GOBs
+ */
+typedef struct OMX_VIDEO_PARAM_H263TYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nPFrames;
+ OMX_U32 nBFrames;
+ OMX_VIDEO_H263PROFILETYPE eProfile;
+ OMX_VIDEO_H263LEVELTYPE eLevel;
+ OMX_BOOL bPLUSPTYPEAllowed;
+ OMX_U32 nAllowedPictureTypes;
+ OMX_BOOL bForceRoundingTypeToZero;
+ OMX_U32 nPictureHeaderRepetition;
+ OMX_U32 nGOBHeaderInterval;
+} OMX_VIDEO_PARAM_H263TYPE;
+
+
+/**
+ * MPEG-2 profile types, each profile indicates support for various
+ * performance bounds and different annexes.
+ */
+typedef enum OMX_VIDEO_MPEG2PROFILETYPE {
+ OMX_VIDEO_MPEG2ProfileSimple = 0, /**< Simple Profile */
+ OMX_VIDEO_MPEG2ProfileMain, /**< Main Profile */
+ OMX_VIDEO_MPEG2Profile422, /**< 4:2:2 Profile */
+ OMX_VIDEO_MPEG2ProfileSNR, /**< SNR Profile */
+ OMX_VIDEO_MPEG2ProfileSpatial, /**< Spatial Profile */
+ OMX_VIDEO_MPEG2ProfileHigh, /**< High Profile */
+ OMX_VIDEO_MPEG2ProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_VIDEO_MPEG2ProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_VIDEO_MPEG2ProfileMax = 0x7FFFFFFF
+} OMX_VIDEO_MPEG2PROFILETYPE;
+
+
+/**
+ * MPEG-2 level types, each level indicates support for various frame
+ * sizes, bit rates, decoder frame rates. No need
+ */
+typedef enum OMX_VIDEO_MPEG2LEVELTYPE {
+ OMX_VIDEO_MPEG2LevelLL = 0, /**< Low Level */
+ OMX_VIDEO_MPEG2LevelML, /**< Main Level */
+ OMX_VIDEO_MPEG2LevelH14, /**< High 1440 */
+ OMX_VIDEO_MPEG2LevelHL, /**< High Level */
+ OMX_VIDEO_MPEG2LevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_VIDEO_MPEG2LevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_VIDEO_MPEG2LevelMax = 0x7FFFFFFF
+} OMX_VIDEO_MPEG2LEVELTYPE;
+
+
+/**
+ * MPEG-2 params
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nPFrames : Number of P frames between each I frame
+ * nBFrames : Number of B frames between each I frame
+ * eProfile : MPEG-2 profile(s) to use
+ * eLevel : MPEG-2 levels(s) to use
+ */
+typedef struct OMX_VIDEO_PARAM_MPEG2TYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nPFrames;
+ OMX_U32 nBFrames;
+ OMX_VIDEO_MPEG2PROFILETYPE eProfile;
+ OMX_VIDEO_MPEG2LEVELTYPE eLevel;
+} OMX_VIDEO_PARAM_MPEG2TYPE;
+
+
+/**
+ * MPEG-4 profile types, each profile indicates support for various
+ * performance bounds and different annexes.
+ *
+ * ENUMS:
+ * - Simple Profile, Levels 1-3
+ * - Simple Scalable Profile, Levels 1-2
+ * - Core Profile, Levels 1-2
+ * - Main Profile, Levels 2-4
+ * - N-bit Profile, Level 2
+ * - Scalable Texture Profile, Level 1
+ * - Simple Face Animation Profile, Levels 1-2
+ * - Simple Face and Body Animation (FBA) Profile, Levels 1-2
+ * - Basic Animated Texture Profile, Levels 1-2
+ * - Hybrid Profile, Levels 1-2
+ * - Advanced Real Time Simple Profiles, Levels 1-4
+ * - Core Scalable Profile, Levels 1-3
+ * - Advanced Coding Efficiency Profile, Levels 1-4
+ * - Advanced Core Profile, Levels 1-2
+ * - Advanced Scalable Texture, Levels 2-3
+ */
+typedef enum OMX_VIDEO_MPEG4PROFILETYPE {
+ OMX_VIDEO_MPEG4ProfileSimple = 0x01,
+ OMX_VIDEO_MPEG4ProfileSimpleScalable = 0x02,
+ OMX_VIDEO_MPEG4ProfileCore = 0x04,
+ OMX_VIDEO_MPEG4ProfileMain = 0x08,
+ OMX_VIDEO_MPEG4ProfileNbit = 0x10,
+ OMX_VIDEO_MPEG4ProfileScalableTexture = 0x20,
+ OMX_VIDEO_MPEG4ProfileSimpleFace = 0x40,
+ OMX_VIDEO_MPEG4ProfileSimpleFBA = 0x80,
+ OMX_VIDEO_MPEG4ProfileBasicAnimated = 0x100,
+ OMX_VIDEO_MPEG4ProfileHybrid = 0x200,
+ OMX_VIDEO_MPEG4ProfileAdvancedRealTime = 0x400,
+ OMX_VIDEO_MPEG4ProfileCoreScalable = 0x800,
+ OMX_VIDEO_MPEG4ProfileAdvancedCoding = 0x1000,
+ OMX_VIDEO_MPEG4ProfileAdvancedCore = 0x2000,
+ OMX_VIDEO_MPEG4ProfileAdvancedScalable = 0x4000,
+ OMX_VIDEO_MPEG4ProfileAdvancedSimple = 0x8000,
+ OMX_VIDEO_MPEG4ProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_VIDEO_MPEG4ProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_VIDEO_MPEG4ProfileMax = 0x7FFFFFFF
+} OMX_VIDEO_MPEG4PROFILETYPE;
+
+
+/**
+ * MPEG-4 level types, each level indicates support for various frame
+ * sizes, bit rates, decoder frame rates. No need
+ */
+typedef enum OMX_VIDEO_MPEG4LEVELTYPE {
+ OMX_VIDEO_MPEG4Level0 = 0x01, /**< Level 0 */
+ OMX_VIDEO_MPEG4Level0b = 0x02, /**< Level 0b */
+ OMX_VIDEO_MPEG4Level1 = 0x04, /**< Level 1 */
+ OMX_VIDEO_MPEG4Level2 = 0x08, /**< Level 2 */
+ OMX_VIDEO_MPEG4Level3 = 0x10, /**< Level 3 */
+ OMX_VIDEO_MPEG4Level4 = 0x20, /**< Level 4 */
+ OMX_VIDEO_MPEG4Level4a = 0x40, /**< Level 4a */
+ OMX_VIDEO_MPEG4Level5 = 0x80, /**< Level 5 */
+ OMX_VIDEO_MPEG4LevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_VIDEO_MPEG4LevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_VIDEO_MPEG4LevelMax = 0x7FFFFFFF
+} OMX_VIDEO_MPEG4LEVELTYPE;
+
+
+/**
+ * MPEG-4 configuration. This structure handles configuration options
+ * which are specific to MPEG4 algorithms
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nSliceHeaderSpacing : Number of macroblocks between slice header (H263+
+ * Annex K). Put zero if not used
+ * bSVH : Enable Short Video Header mode
+ * bGov : Flag to enable GOV
+ * nPFrames : Number of P frames between each I frame (also called
+ * GOV period)
+ * nBFrames : Number of B frames between each I frame
+ * nIDCVLCThreshold : Value of intra DC VLC threshold
+ * bACPred : Flag to use ac prediction
+ * nMaxPacketSize : Maximum size of packet in bytes.
+ * nTimeIncRes : Used to pass VOP time increment resolution for MPEG4.
+ * Interpreted as described in MPEG4 standard.
+ * eProfile : MPEG-4 profile(s) to use.
+ * eLevel : MPEG-4 level(s) to use.
+ * nAllowedPictureTypes : Specifies the picture types allowed in the bitstream
+ * nHeaderExtension : Specifies the number of consecutive video packet
+ * headers within a VOP
+ * bReversibleVLC : Specifies whether reversible variable length coding
+ * is in use
+ */
+typedef struct OMX_VIDEO_PARAM_MPEG4TYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nSliceHeaderSpacing;
+ OMX_BOOL bSVH;
+ OMX_BOOL bGov;
+ OMX_U32 nPFrames;
+ OMX_U32 nBFrames;
+ OMX_U32 nIDCVLCThreshold;
+ OMX_BOOL bACPred;
+ OMX_U32 nMaxPacketSize;
+ OMX_U32 nTimeIncRes;
+ OMX_VIDEO_MPEG4PROFILETYPE eProfile;
+ OMX_VIDEO_MPEG4LEVELTYPE eLevel;
+ OMX_U32 nAllowedPictureTypes;
+ OMX_U32 nHeaderExtension;
+ OMX_BOOL bReversibleVLC;
+} OMX_VIDEO_PARAM_MPEG4TYPE;
+
+
+/**
+ * WMV Versions
+ */
+typedef enum OMX_VIDEO_WMVFORMATTYPE {
+ OMX_VIDEO_WMVFormatUnused = 0x01, /**< Format unused or unknown */
+ OMX_VIDEO_WMVFormat7 = 0x02, /**< Windows Media Video format 7 */
+ OMX_VIDEO_WMVFormat8 = 0x04, /**< Windows Media Video format 8 */
+ OMX_VIDEO_WMVFormat9 = 0x08, /**< Windows Media Video format 9 */
+ OMX_VIDEO_WMFFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_VIDEO_WMFFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_VIDEO_WMVFormatMax = 0x7FFFFFFF
+} OMX_VIDEO_WMVFORMATTYPE;
+
+
+/**
+ * WMV Params
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eFormat : Version of WMV stream / data
+ */
+typedef struct OMX_VIDEO_PARAM_WMVTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_VIDEO_WMVFORMATTYPE eFormat;
+} OMX_VIDEO_PARAM_WMVTYPE;
+
+
+/**
+ * Real Video Version
+ */
+typedef enum OMX_VIDEO_RVFORMATTYPE {
+ OMX_VIDEO_RVFormatUnused = 0, /**< Format unused or unknown */
+ OMX_VIDEO_RVFormat8, /**< Real Video format 8 */
+ OMX_VIDEO_RVFormat9, /**< Real Video format 9 */
+ OMX_VIDEO_RVFormatG2, /**< Real Video Format G2 */
+ OMX_VIDEO_RVFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_VIDEO_RVFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_VIDEO_RVFormatMax = 0x7FFFFFFF
+} OMX_VIDEO_RVFORMATTYPE;
+
+
+/**
+ * Real Video Params
+ *
+ * STUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eFormat : Version of RV stream / data
+ * nBitsPerPixel : Bits per pixel coded in the frame
+ * nPaddedWidth : Padded width in pixel of a video frame
+ * nPaddedHeight : Padded Height in pixels of a video frame
+ * nFrameRate : Rate of video in frames per second
+ * nBitstreamFlags : Flags which internal information about the bitstream
+ * nBitstreamVersion : Bitstream version
+ * nMaxEncodeFrameSize: Max encoded frame size
+ * bEnablePostFilter : Turn on/off post filter
+ * bEnableTemporalInterpolation : Turn on/off temporal interpolation
+ * bEnableLatencyMode : When enabled, the decoder does not display a decoded
+ * frame until it has detected that no enhancement layer
+ * frames or dependent B frames will be coming. This
+ * detection usually occurs when a subsequent non-B
+ * frame is encountered
+ */
+typedef struct OMX_VIDEO_PARAM_RVTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_VIDEO_RVFORMATTYPE eFormat;
+ OMX_U16 nBitsPerPixel;
+ OMX_U16 nPaddedWidth;
+ OMX_U16 nPaddedHeight;
+ OMX_U32 nFrameRate;
+ OMX_U32 nBitstreamFlags;
+ OMX_U32 nBitstreamVersion;
+ OMX_U32 nMaxEncodeFrameSize;
+ OMX_BOOL bEnablePostFilter;
+ OMX_BOOL bEnableTemporalInterpolation;
+ OMX_BOOL bEnableLatencyMode;
+} OMX_VIDEO_PARAM_RVTYPE;
+
+
+/**
+ * AVC profile types, each profile indicates support for various
+ * performance bounds and different annexes.
+ */
+typedef enum OMX_VIDEO_AVCPROFILETYPE {
+ OMX_VIDEO_AVCProfileBaseline = 0x01, /**< Baseline profile */
+ OMX_VIDEO_AVCProfileMain = 0x02, /**< Main profile */
+ OMX_VIDEO_AVCProfileExtended = 0x04, /**< Extended profile */
+ OMX_VIDEO_AVCProfileHigh = 0x08, /**< High profile */
+ OMX_VIDEO_AVCProfileHigh10 = 0x10, /**< High 10 profile */
+ OMX_VIDEO_AVCProfileHigh422 = 0x20, /**< High 4:2:2 profile */
+ OMX_VIDEO_AVCProfileHigh444 = 0x40, /**< High 4:4:4 profile */
+ OMX_VIDEO_AVCProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_VIDEO_AVCProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_VIDEO_AVCProfileMax = 0x7FFFFFFF
+} OMX_VIDEO_AVCPROFILETYPE;
+
+
+/**
+ * AVC level types, each level indicates support for various frame sizes,
+ * bit rates, decoder frame rates. No need
+ */
+typedef enum OMX_VIDEO_AVCLEVELTYPE {
+ OMX_VIDEO_AVCLevel1 = 0x01, /**< Level 1 */
+ OMX_VIDEO_AVCLevel1b = 0x02, /**< Level 1b */
+ OMX_VIDEO_AVCLevel11 = 0x04, /**< Level 1.1 */
+ OMX_VIDEO_AVCLevel12 = 0x08, /**< Level 1.2 */
+ OMX_VIDEO_AVCLevel13 = 0x10, /**< Level 1.3 */
+ OMX_VIDEO_AVCLevel2 = 0x20, /**< Level 2 */
+ OMX_VIDEO_AVCLevel21 = 0x40, /**< Level 2.1 */
+ OMX_VIDEO_AVCLevel22 = 0x80, /**< Level 2.2 */
+ OMX_VIDEO_AVCLevel3 = 0x100, /**< Level 3 */
+ OMX_VIDEO_AVCLevel31 = 0x200, /**< Level 3.1 */
+ OMX_VIDEO_AVCLevel32 = 0x400, /**< Level 3.2 */
+ OMX_VIDEO_AVCLevel4 = 0x800, /**< Level 4 */
+ OMX_VIDEO_AVCLevel41 = 0x1000, /**< Level 4.1 */
+ OMX_VIDEO_AVCLevel42 = 0x2000, /**< Level 4.2 */
+ OMX_VIDEO_AVCLevel5 = 0x4000, /**< Level 5 */
+ OMX_VIDEO_AVCLevel51 = 0x8000, /**< Level 5.1 */
+ OMX_VIDEO_AVCLevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_VIDEO_AVCLevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_VIDEO_AVCLevelMax = 0x7FFFFFFF
+} OMX_VIDEO_AVCLEVELTYPE;
+
+
+/**
+ * AVC loop filter modes
+ *
+ * OMX_VIDEO_AVCLoopFilterEnable : Enable
+ * OMX_VIDEO_AVCLoopFilterDisable : Disable
+ * OMX_VIDEO_AVCLoopFilterDisableSliceBoundary : Disabled on slice boundaries
+ */
+typedef enum OMX_VIDEO_AVCLOOPFILTERTYPE {
+ OMX_VIDEO_AVCLoopFilterEnable = 0,
+ OMX_VIDEO_AVCLoopFilterDisable,
+ OMX_VIDEO_AVCLoopFilterDisableSliceBoundary,
+ OMX_VIDEO_AVCLoopFilterKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_VIDEO_AVCLoopFilterVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_VIDEO_AVCLoopFilterMax = 0x7FFFFFFF
+} OMX_VIDEO_AVCLOOPFILTERTYPE;
+
+
+/**
+ * AVC params
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nSliceHeaderSpacing : Number of macroblocks between slice header, put
+ * zero if not used
+ * nPFrames : Number of P frames between each I frame
+ * nBFrames : Number of B frames between each I frame
+ * bUseHadamard : Enable/disable Hadamard transform
+ * nRefFrames : Max number of reference frames to use for inter
+ * motion search (1-16)
+ * nRefIdxTrailing : Pic param set ref frame index (index into ref
+ * frame buffer of trailing frames list), B frame
+ * support
+ * nRefIdxForward : Pic param set ref frame index (index into ref
+ * frame buffer of forward frames list), B frame
+ * support
+ * bEnableUEP : Enable/disable unequal error protection. This
+ * is only valid of data partitioning is enabled.
+ * bEnableFMO : Enable/disable flexible macroblock ordering
+ * bEnableASO : Enable/disable arbitrary slice ordering
+ * bEnableRS : Enable/disable sending of redundant slices
+ * eProfile : AVC profile(s) to use
+ * eLevel : AVC level(s) to use
+ * nAllowedPictureTypes : Specifies the picture types allowed in the
+ * bitstream
+ * bFrameMBsOnly : specifies that every coded picture of the
+ * coded video sequence is a coded frame
+ * containing only frame macroblocks
+ * bMBAFF : Enable/disable switching between frame and
+ * field macroblocks within a picture
+ * bEntropyCodingCABAC : Entropy decoding method to be applied for the
+ * syntax elements for which two descriptors appear
+ * in the syntax tables
+ * bWeightedPPrediction : Enable/disable weighted prediction shall not
+ * be applied to P and SP slices
+ * nWeightedBipredicitonMode : Default weighted prediction is applied to B
+ * slices
+ * bconstIpred : Enable/disable intra prediction
+ * bDirect8x8Inference : Specifies the method used in the derivation
+ * process for luma motion vectors for B_Skip,
+ * B_Direct_16x16 and B_Direct_8x8 as specified
+ * in subclause 8.4.1.2 of the AVC spec
+ * bDirectSpatialTemporal : Flag indicating spatial or temporal direct
+ * mode used in B slice coding (related to
+ * bDirect8x8Inference) . Spatial direct mode is
+ * more common and should be the default.
+ * nCabacInitIdx : Index used to init CABAC contexts
+ * eLoopFilterMode : Enable/disable loop filter
+ */
+typedef struct OMX_VIDEO_PARAM_AVCTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nSliceHeaderSpacing;
+ OMX_U32 nPFrames;
+ OMX_U32 nBFrames;
+ OMX_BOOL bUseHadamard;
+ OMX_U32 nRefFrames;
+ OMX_U32 nRefIdx10ActiveMinus1;
+ OMX_U32 nRefIdx11ActiveMinus1;
+ OMX_BOOL bEnableUEP;
+ OMX_BOOL bEnableFMO;
+ OMX_BOOL bEnableASO;
+ OMX_BOOL bEnableRS;
+ OMX_VIDEO_AVCPROFILETYPE eProfile;
+ OMX_VIDEO_AVCLEVELTYPE eLevel;
+ OMX_U32 nAllowedPictureTypes;
+ OMX_BOOL bFrameMBsOnly;
+ OMX_BOOL bMBAFF;
+ OMX_BOOL bEntropyCodingCABAC;
+ OMX_BOOL bWeightedPPrediction;
+ OMX_U32 nWeightedBipredicitonMode;
+ OMX_BOOL bconstIpred ;
+ OMX_BOOL bDirect8x8Inference;
+ OMX_BOOL bDirectSpatialTemporal;
+ OMX_U32 nCabacInitIdc;
+ OMX_VIDEO_AVCLOOPFILTERTYPE eLoopFilterMode;
+} OMX_VIDEO_PARAM_AVCTYPE;
+
+typedef struct OMX_VIDEO_PARAM_PROFILELEVELTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 eProfile; /**< type is OMX_VIDEO_AVCPROFILETYPE, OMX_VIDEO_H263PROFILETYPE,
+ or OMX_VIDEO_MPEG4PROFILETYPE depending on context */
+ OMX_U32 eLevel; /**< type is OMX_VIDEO_AVCLEVELTYPE, OMX_VIDEO_H263LEVELTYPE,
+ or OMX_VIDEO_MPEG4PROFILETYPE depending on context */
+ OMX_U32 nProfileIndex; /**< Used to query for individual profile support information,
+ This parameter is valid only for
+ OMX_IndexParamVideoProfileLevelQuerySupported index,
+ For all other indices this parameter is to be ignored. */
+} OMX_VIDEO_PARAM_PROFILELEVELTYPE;
+
+/**
+ * Structure for dynamically configuring bitrate mode of a codec.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the struct in bytes
+ * nVersion : OMX spec version info
+ * nPortIndex : Port that this struct applies to
+ * nEncodeBitrate : Target average bitrate to be generated in bps
+ */
+typedef struct OMX_VIDEO_CONFIG_BITRATETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nEncodeBitrate;
+} OMX_VIDEO_CONFIG_BITRATETYPE;
+
+/**
+ * Defines Encoder Frame Rate setting
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * xEncodeFramerate : Encoding framerate represented in Q16 format
+ */
+typedef struct OMX_CONFIG_FRAMERATETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 xEncodeFramerate; /* Q16 format */
+} OMX_CONFIG_FRAMERATETYPE;
+
+typedef struct OMX_CONFIG_INTRAREFRESHVOPTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL IntraRefreshVOP;
+} OMX_CONFIG_INTRAREFRESHVOPTYPE;
+
+typedef struct OMX_CONFIG_MACROBLOCKERRORMAPTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nErrMapSize; /* Size of the Error Map in bytes */
+ OMX_U8 ErrMap[1]; /* Error map hint */
+} OMX_CONFIG_MACROBLOCKERRORMAPTYPE;
+
+typedef struct OMX_CONFIG_MBERRORREPORTINGTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bEnabled;
+} OMX_CONFIG_MBERRORREPORTINGTYPE;
+
+typedef struct OMX_PARAM_MACROBLOCKSTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nMacroblocks;
+} OMX_PARAM_MACROBLOCKSTYPE;
+
+/**
+ * AVC Slice Mode modes
+ *
+ * OMX_VIDEO_SLICEMODE_AVCDefault : Normal frame encoding, one slice per frame
+ * OMX_VIDEO_SLICEMODE_AVCMBSlice : NAL mode, number of MBs per frame
+ * OMX_VIDEO_SLICEMODE_AVCByteSlice : NAL mode, number of bytes per frame
+ */
+typedef enum OMX_VIDEO_AVCSLICEMODETYPE {
+ OMX_VIDEO_SLICEMODE_AVCDefault = 0,
+ OMX_VIDEO_SLICEMODE_AVCMBSlice,
+ OMX_VIDEO_SLICEMODE_AVCByteSlice,
+ OMX_VIDEO_SLICEMODE_AVCKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_VIDEO_SLICEMODE_AVCVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_VIDEO_SLICEMODE_AVCLevelMax = 0x7FFFFFFF
+} OMX_VIDEO_AVCSLICEMODETYPE;
+
+/**
+ * AVC FMO Slice Mode Params
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nNumSliceGroups : Specifies the number of slice groups
+ * nSliceGroupMapType : Specifies the type of slice groups
+ * eSliceMode : Specifies the type of slice
+ */
+typedef struct OMX_VIDEO_PARAM_AVCSLICEFMO {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U8 nNumSliceGroups;
+ OMX_U8 nSliceGroupMapType;
+ OMX_VIDEO_AVCSLICEMODETYPE eSliceMode;
+} OMX_VIDEO_PARAM_AVCSLICEFMO;
+
+/**
+ * AVC IDR Period Configs
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nIDRPeriod : Specifies periodicity of IDR frames
+ * nPFrames : Specifies internal of coding Intra frames
+ */
+typedef struct OMX_VIDEO_CONFIG_AVCINTRAPERIOD {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nIDRPeriod;
+ OMX_U32 nPFrames;
+} OMX_VIDEO_CONFIG_AVCINTRAPERIOD;
+
+/**
+ * AVC NAL Size Configs
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nNaluBytes : Specifies the NAL unit size
+ */
+typedef struct OMX_VIDEO_CONFIG_NALSIZE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nNaluBytes;
+} OMX_VIDEO_CONFIG_NALSIZE;
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
+/* File EOF */
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/khronos_api/v1_1_2/group/bld.inf Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,36 @@
+// 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_EXPORTS
+// Khronos OpenMAX IL API
+../OMX_Core.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/khronos/v1_x/OMX_Core.h)
+../OMX_Component.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/khronos/v1_x/OMX_Component.h)
+../OMX_Index.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/khronos/v1_x/OMX_Index.h)
+../OMX_Audio.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/khronos/v1_x/OMX_Audio.h)
+../OMX_Video.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/khronos/v1_x/OMX_Video.h)
+../OMX_IVCommon.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/khronos/v1_x/OMX_IVCommon.h)
+../OMX_Image.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/khronos/v1_x/OMX_Image.h)
+../OMX_Types.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/khronos/v1_x/OMX_Types.h)
+../OMX_Other.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/khronos/v1_x/OMX_Other.h)
+../OMX_ContentPipe.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/khronos/v1_x/OMX_ContentPipe.h)
+
+//
+// Files above are listed in \epoc32\tools\filenamepolicyexclusions.txt.
+// They are exported in CamelCase instead of lower case.
+// If a new header is added to the export, e.g. OMX_ContentPipe.h, the name
+// should be added to filenamepolicyexclusions.txt ahead of time. Otherwise
+// checksource will flag it as error.
+// filenamepolicyexclusions.txt is in \src\cedar\generic\tools\e32toolp\platform
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/symbian_api/group/bld.inf Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,35 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+//
+// Romkit include files for omxilcomplib (OMX framework)
+//
+#include "../omxilcomplib_api/group/bld.inf"
+
+//
+// Romkit include files for omxilcore
+//
+#include "../omxilcore_api/group/bld.inf"
+
+//
+// OMX IL Loader Interface
+//
+#include "../omxilloader_api/group/bld.inf"
+
+//
+// SHAI extension headers
+//
+#include "../shaiext_api/group/bld.inf"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/symbian_api/omxilcomplib_api/group/bld.inf Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,37 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+PRJ_EXPORTS
+
+//
+// Romkit include files for omxilcomplib (OMX framework)
+//
+../inc/omxilcomponent.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/common/omxilcomponent.h)
+../inc/omxilconfigmanager.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/common/omxilconfigmanager.h)
+../inc/omxilstatedefs.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/common/omxilstatedefs.h)
+../inc/omxilport.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/common/omxilport.h)
+../inc/omxilprocessingfunction.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/common/omxilprocessingfunction.h)
+../inc/omxilspecversion.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/common/omxilspecversion.h)
+../inc/omxilcallbacknotificationif.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/common/omxilcallbacknotificationif.h)
+../inc/omxilimageport.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/common/omxilimageport.h)
+../inc/omxilvideoport.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/common/omxilvideoport.h)
+../inc/omxilaudioport.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/common/omxilaudioport.h)
+../inc/omxilotherport.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/common/omxilotherport.h)
+../inc/omxilclockcomponentcmdsif.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/common/omxilclockcomponentcmdsif.h)
+../inc/omxilclientclockport.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/common/omxilclientclockport.h)
+../inc/omxilport.inl SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/common/omxilport.inl)
+../inc/omxilutil.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/common/omxilutil.h)
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/symbian_api/omxilcomplib_api/inc/omxilaudioport.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,200 @@
+// Copyright (c) 2008-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
+*/
+
+#ifndef OMXILAUDIOPORT_H
+#define OMXILAUDIOPORT_H
+
+#include <e32base.h>
+
+#include <openmax/il/khronos/v1_x/OMX_Types.h>
+#include <openmax/il/khronos/v1_x/OMX_Core.h>
+#include <openmax/il/khronos/v1_x/OMX_Component.h>
+
+#include <openmax/il/common/omxilport.h>
+
+class COmxILAudioPortImpl;
+
+/**
+ Audio Port Panic category
+*/
+_LIT(KOmxILAudioPortPanicCategory, "OmxILAudioPort");
+
+class COmxILAudioPort : public COmxILPort
+ {
+
+public:
+
+ IMPORT_C ~COmxILAudioPort();
+
+ // From COmxILPort
+ IMPORT_C OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const = 0;
+
+ // From COmxILPort
+ IMPORT_C OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const = 0;
+
+ // From COmxILPort
+ IMPORT_C OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex,
+ TAny* apComponentParameterStructure) const = 0;
+ // From COmxILPort
+ IMPORT_C OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex,
+ const TAny* apComponentParameterStructure,
+ TBool& aUpdateProcessingFunction) = 0;
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE GetConfig(OMX_INDEXTYPE aConfigIndex,
+ TAny* apComponentConfigStructure) const;
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE SetConfig(OMX_INDEXTYPE aConfigIndex,
+ const TAny* apComponentConfigStructure,
+ TBool& aUpdateProcessingFunction);
+
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE GetExtensionIndex(
+ OMX_STRING aParameterName,
+ OMX_INDEXTYPE* apIndexType) const;
+
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE PopulateBuffer(
+ OMX_BUFFERHEADERTYPE** appBufferHdr,
+ const OMX_PTR apAppPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer,
+ TBool& portPopulationCompleted);
+
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE FreeBuffer(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ TBool& portDepopulationCompleted);
+
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE TunnelRequest(
+ OMX_HANDLETYPE aTunneledComp,
+ OMX_U32 aTunneledPort,
+ OMX_TUNNELSETUPTYPE* apTunnelSetup);
+
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE PopulateTunnel(
+ TBool& portPopulationCompleted);
+
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE FreeTunnel(
+ TBool& portDepopulationCompleted);
+
+ // From COmxILPort
+ IMPORT_C virtual TBool SetBufferSent(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ TBool& aBufferMarkedWithOwnMark);
+
+ // From COmxILPort
+ IMPORT_C virtual TBool SetBufferReturned(
+ OMX_BUFFERHEADERTYPE* apBufferHeader);
+
+ // From COmxILPort
+ IMPORT_C virtual void SetTransitionToDisabled();
+
+ // From COmxILPort
+ IMPORT_C virtual void SetTransitionToEnabled();
+
+ // From COmxILPort
+ IMPORT_C virtual void SetTransitionToDisabledCompleted();
+
+ // From COmxILPort
+ IMPORT_C virtual void SetTransitionToEnabledCompleted();
+
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE StoreBufferMark(
+ const OMX_MARKTYPE* pMark);
+
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE SetComponentRoleDefaults(
+ TUint aComponentRoleIndex);
+
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE DoPortReconfiguration(
+ TUint aPortSettingsIndex,
+ const TDesC8& aPortSettings,
+ OMX_EVENTTYPE& aEventForILClient);
+
+ // From COmxILPort
+ IMPORT_C virtual TBool HasAllBuffersAtHome() const;
+
+ // From COmxILPort
+ IMPORT_C virtual TBool IsBufferAtHome(
+ OMX_BUFFERHEADERTYPE* apHeaderHeader) const;
+
+protected:
+
+ IMPORT_C COmxILAudioPort();
+ IMPORT_C void ConstructL(const TOmxILCommonPortData& aCommonPortData, const RArray<OMX_AUDIO_CODINGTYPE>& aSupportedAudioFormats);
+
+
+ // From COmxILPort
+ virtual OMX_ERRORTYPE SetFormatInPortDefinition(
+ const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition,
+ TBool& aUpdateProcessingFunction) = 0;
+
+ // From COmxILPort
+ virtual TBool IsTunnelledPortCompatible(
+ const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const = 0;
+
+ IMPORT_C virtual OMX_ERRORTYPE DoBufferAllocation(
+ OMX_U32 aSizeBytes,
+ OMX_U8*& apPortSpecificBuffer,
+ OMX_PTR& apPortPrivate,
+ OMX_PTR& apPlatformPrivate,
+ OMX_PTR apAppPrivate = 0);
+
+ IMPORT_C virtual void DoBufferDeallocation(
+ OMX_PTR apPortSpecificBuffer,
+ OMX_PTR apPortPrivate,
+ OMX_PTR apPlatformPrivate,
+ OMX_PTR apAppPrivate = 0);
+
+ IMPORT_C virtual OMX_ERRORTYPE DoBufferWrapping(
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer,
+ OMX_PTR& apPortPrivate,
+ OMX_PTR& apPlatformPrivate,
+ OMX_PTR apAppPrivate = 0);
+
+ IMPORT_C virtual void DoBufferUnwrapping(
+ OMX_PTR apPortSpecificBuffer,
+ OMX_PTR apPortPrivate,
+ OMX_PTR apPlatformPrivate,
+ OMX_PTR apAppPrivate = 0);
+
+ IMPORT_C virtual OMX_ERRORTYPE DoOmxUseBuffer(
+ OMX_HANDLETYPE aTunnelledComponent,
+ OMX_BUFFERHEADERTYPE** appBufferHdr,
+ OMX_U32 aTunnelledPortIndex,
+ OMX_PTR apPortPrivate,
+ OMX_PTR apPlatformPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer);
+
+ //From CBase
+ IMPORT_C virtual TInt Extension_(TUint aExtensionId, TAny *&a0, TAny *a1);
+
+private:
+ COmxILAudioPortImpl* ipAudioPortImpl;
+ };
+
+#endif // OMXILAUDIOPORT_H
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/symbian_api/omxilcomplib_api/inc/omxilcallbacknotificationif.h Wed Aug 25 12:40:50 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
+ @internalComponent
+*/
+
+#ifndef OMXILCALLBACKNOTIFICATIONIF_H
+#define OMXILCALLBACKNOTIFICATIONIF_H
+
+#include <e32def.h>
+
+#include <openmax/il/khronos/v1_x/OMX_Core.h>
+
+
+/**
+ Portion of CallBack Manager Interface used by Processing Function objects
+ */
+class MOmxILCallbackNotificationIf
+ {
+
+public:
+
+ /**
+ OpenMAX IL Error notification method that must be implemented by the
+ Callback manager object.
+
+ @param [in] aOmxError The error event.
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE ErrorEventNotification(
+ OMX_ERRORTYPE aOmxError) = 0;
+
+ /**
+ OpenMAX IL Buffer Done notification method that must be implemented by
+ the Callback manager object.
+
+ @param [in] apBufferHeader The header of the buffer processed.
+
+ @param [in] aLocalPortIndex Index of the port that processed the buffer.
+
+ @param [in] aLocalPortDirection The direction of the port.
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE BufferDoneNotification(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_U32 aLocalPortIndex,
+ OMX_DIRTYPE aLocalPortDirection) = 0;
+
+ /**
+ OpenMAX IL Clock Buffer Done notification method that must be
+ implemented by the Callback manager object. If queueing is implemented,
+ clock buffers will be returned with higher priority than normal buffers.
+
+ @param [in] apBufferHeader The header of the clock buffer processed.
+
+ @param [in] aLocalPortIndex Index of the port that processed the buffer.
+
+ @param [in] aLocalPortDirection The direction of the port.
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE ClockBufferDoneNotification(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_U32 aLocalPortIndex,
+ OMX_DIRTYPE aLocalPortDirection) = 0;
+
+ /**
+ Generic OpenMAX IL Event method notification method that must be
+ implemented by the Callback manager object.
+
+ @param [in] aEvent The event to be notified.
+
+ @param [in] aData1 An integer with additional event information.
+
+ @param [in] aData2 An integer with additional event information.
+
+ @param [in] aExtraInfo An optional text.
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE EventNotification(
+ OMX_EVENTTYPE aEvent,
+ TUint32 aData1,
+ TUint32 aData2,
+ OMX_STRING aExtraInfo) = 0;
+
+ /**
+ Notification method that must be implemented by the Callback manager
+ object. It is used by Processing Function objects to notify that some
+ port setting has changed during the processing of a buffer.
+
+ @param [in] aLocalPortIndex The index of the local port that needs to be
+ notified of the change.
+
+ @param [in] aPortSettingsIndex An implementation-specific identifier
+ that the implementation associates to the setting(s) that need(s)
+ updating in the port.
+
+ @param [in] aPortSettings A buffer descriptor that contains an
+ implementation-specific structure with the new setting(s) that need to
+ be updated in the port.
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE PortSettingsChangeNotification(
+ OMX_U32 aLocalPortIndex,
+ TUint aPortSettingsIndex,
+ const TDesC8& aPortSettings) = 0;
+
+ };
+
+#endif // OMXILCALLBACKNOTIFICATIONIF_H
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/symbian_api/omxilcomplib_api/inc/omxilclientclockport.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,93 @@
+// 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 OMXILCLIENTCLOCKPORT_H
+#define OMXILCLIENTCLOCKPORT_H
+
+#include <openmax/il/common/omxilotherport.h>
+#include <openmax/il/common/omxilclockcomponentcmdsif.h>
+
+NONSHARABLE_CLASS(COmxILClientClockPort) : public COmxILOtherPort, public MOmxILClockComponentCmdsIf
+ {
+public:
+ IMPORT_C static COmxILClientClockPort* NewL(const TOmxILCommonPortData& aCommonPortData,
+ const RArray<OMX_OTHER_FORMATTYPE>& aSupportedOtherFormats);
+
+ // From MOmxILClockComponentCmdsIf
+ virtual OMX_ERRORTYPE GetMediaTime(OMX_TICKS& aMediaTime) const;
+
+ // From MOmxILClockComponentCmdsIf
+ virtual OMX_ERRORTYPE GetWallTime(OMX_TICKS& aWallTime) const;
+
+ // From MOmxILClockComponentCmdsIf
+ virtual OMX_ERRORTYPE GetClockState(OMX_TIME_CONFIG_CLOCKSTATETYPE& aClockState) const;
+
+ // From MOmxILClockComponentCmdsIf
+ virtual OMX_ERRORTYPE MediaTimeRequest(const OMX_PTR apPrivate, const OMX_TICKS aMediaTime, const OMX_TICKS aOffset) const;
+
+ // From MOmxILClockComponentCmdsIf
+ virtual OMX_ERRORTYPE SetStartTime(const OMX_TICKS aStartTime) const;
+
+ // From MOmxILClockComponentCmdsIf
+ virtual OMX_ERRORTYPE SetVideoReference(const OMX_TICKS aVideRef) const;
+
+ // From MOmxILClockComponentCmdsIf
+ virtual OMX_ERRORTYPE SetAudioReference(const OMX_TICKS aAudioRef) const;
+
+ // From MOmxILClockComponentCmdsIf
+ virtual OMX_BOOL IsClockComponentAvailable() const;
+
+ // From COmxILPort
+ OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const;
+
+ // From COmxILPort
+ OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const;
+
+ // From COmxILPort
+ OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex,
+ TAny* apComponentParameterStructure) const;
+
+ // From COmxILPort
+ OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex,
+ const TAny* apComponentParameterStructure,
+ TBool& aUpdateProcessingFunction);
+
+protected:
+ // From COmxILPort
+ OMX_ERRORTYPE SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition,
+ TBool& aUpdateProcessingFunction);
+
+ // From COmxILPort
+ TBool IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const;
+
+private:
+ void ConstructL(const TOmxILCommonPortData& aCommonPortData, const RArray<OMX_OTHER_FORMATTYPE>& aSupportedOtherFormats);
+
+ COmxILClientClockPort();
+
+ OMX_ERRORTYPE GetTime(OMX_TICKS& aTime, const OMX_INDEXTYPE aTimeIndex) const;
+
+ OMX_ERRORTYPE SetTime(const OMX_TICKS aTime, const OMX_INDEXTYPE aTimeIndex) const;
+
+ const OMX_VERSIONTYPE iSpecVersion;
+ };
+
+#endif // COMXILCLIENTCLOCKPORT_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/symbian_api/omxilcomplib_api/inc/omxilclockcomponentcmdsif.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,107 @@
+// 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 OMXILCLOCKCOMPONENTCMDSIF_H
+#define OMXILCLOCKCOMPONENTCMDSIF_H
+
+#include <openmax/il/khronos/v1_x/OMX_Component.h>
+
+class MOmxILClockComponentCmdsIf
+ {
+public:
+ /**
+ This method is used to query for the current media clock time of the
+ clock component.
+
+ @param aMediaTime The clock component media time in OMX_TICKS.
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE GetMediaTime(OMX_TICKS& aMediaTime) const = 0;
+
+ /**
+ This method is used to query for the current wall clock of the clock
+ component.
+
+ @param aWallTime The clock component wall clock in OMX_TICKS.
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE GetWallTime(OMX_TICKS& aWallTime) const = 0;
+
+
+ /**
+ This method is used to query for the current state of the clock
+ component.
+
+ @param aClockState A OMX_TIME_CONFIG_CLOCKSTATETYPE structure.
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE GetClockState(OMX_TIME_CONFIG_CLOCKSTATETYPE& aClockState) const = 0;
+
+ /**
+ This method allows a client to request a particular timestamp
+
+ @param apPrivate A pointer to any private data that the client wants to
+ associate with the request.
+ @param aMediaTime A timestamp, which is associated with some
+ operation (e.g., the presentation of a frame) that
+ the client shall execute at the time requested.
+ @param aOffset Specifies the desired difference between the wall time
+ when the timestamp actually occurs and the wall time
+ when the request is to be fulfilled.
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE MediaTimeRequest(const OMX_PTR apPrivate, const OMX_TICKS aMediaTime, const OMX_TICKS aOffset) const = 0;
+
+ /**
+ This method sends the start time to the clock component
+
+ @param aStartTime The starting timestamp of the stream
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE SetStartTime(const OMX_TICKS aStartTime) const = 0;
+
+ /**
+ This method updates the clock component's video reference clock.
+
+ @param aVideoRef The media time of the video component.
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE SetVideoReference(const OMX_TICKS aVideoRef) const = 0;
+
+ /**
+ This method updates the clock component's audio reference clock.
+
+ @param aAudioRef The media time of the audio component.
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE SetAudioReference(const OMX_TICKS aAudioRef) const = 0;
+
+ /**
+ This method checks the clock component availability
+
+ @return TBool
+ */
+ virtual OMX_BOOL IsClockComponentAvailable() const = 0;
+ };
+
+#endif // OMXILCLOCKCOMPONENTCMDSIF_H
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/symbian_api/omxilcomplib_api/inc/omxilcomponent.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,94 @@
+// 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 OMXILCOMPONENT_H
+#define OMXILCOMPONENT_H
+
+#include <e32base.h>
+#include <openmax/il/khronos/v1_x/OMX_Component.h>
+
+// forward declarations
+class COmxILConfigManager;
+class COmxILProcessingFunction;
+class COmxILPort;
+class COmxILComponentImpl;
+class MOmxILCallbackNotificationIf;
+
+/**
+ Component Panic category
+*/
+_LIT(KOmxILComponentPanicCategory, "OmxILComponent");
+
+class COmxILComponent : public CBase
+ {
+public:
+ enum TCallbackManagerType
+ {
+ EOutofContext,
+ EInContext,
+ ECallbackManagerTypeMax =0xff
+ };
+ enum TPortManagerType
+ {
+ ENonBufferSharingPortManager,
+ EBufferSharingPortManager,
+ EPortManagerTypeMax =0xff
+ };
+
+public:
+ IMPORT_C virtual ~COmxILComponent();
+ IMPORT_C static OMX_ERRORTYPE SymbianErrorToGetHandleError(TInt aSymbianError);
+
+protected:
+ IMPORT_C COmxILComponent();
+ IMPORT_C void InitComponentL();
+ IMPORT_C virtual void ConstructL(OMX_HANDLETYPE aComponent);
+ IMPORT_C MOmxILCallbackNotificationIf* CreateCallbackManagerL(TCallbackManagerType aCallbackManagerType);
+ IMPORT_C void CreatePortManagerL(TPortManagerType aType,
+ const OMX_VERSIONTYPE& aOmxVersion,
+ OMX_U32 aNumberOfAudioPorts,
+ OMX_U32 aStartAudioPortNumber,
+ OMX_U32 aNumberOfImagePorts,
+ OMX_U32 aStartImagePortNumber,
+ OMX_U32 aNumberOfVideoPorts,
+ OMX_U32 aStartVideoPortNumber,
+ OMX_U32 aNumberOfOtherPorts,
+ OMX_U32 aStartOtherPortNumber,
+ OMX_BOOL aImmediateReturnTimeBuffer = OMX_TRUE);
+ IMPORT_C TInt AddPort(const COmxILPort* aPort, OMX_DIRTYPE aDirection);
+ IMPORT_C void RegisterProcessingFunction(const COmxILProcessingFunction* aProcessingFunction);
+ IMPORT_C void RegisterConfigurationManager(const COmxILConfigManager* aConfigManager);
+
+ //getters and setters
+ IMPORT_C OMX_COMPONENTTYPE* GetHandle() const;
+ IMPORT_C OMX_PTR GetAppData() const;
+ IMPORT_C OMX_CALLBACKTYPE* GetCallbacks() const;
+ IMPORT_C COmxILConfigManager* GetConfigManager() const;
+ IMPORT_C COmxILProcessingFunction* GetProcessingFunction() const;
+
+ //From CBase
+ IMPORT_C virtual TInt Extension_(TUint aExtensionId, TAny *&a0, TAny *a1);
+
+private:
+ COmxILComponentImpl* ipImpl;
+ };
+
+#endif // OMXILCOMPONENT_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/symbian_api/omxilcomplib_api/inc/omxilconfigmanager.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,123 @@
+// Copyright (c) 2008-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
+*/
+
+#ifndef OMXILCONFIGMANAGER_H
+#define OMXILCONFIGMANAGER_H
+
+#include <e32base.h>
+#include <openmax/il/khronos/v1_x/OMX_Core.h>
+#include <openmax/il/khronos/v1_x/OMX_Component.h>
+#include <openmax/il/khronos/v1_x/OMX_Types.h>
+
+/**
+ Config Manager Panic category
+*/
+_LIT(KOmxILConfigManagerPanicCategory, "OmxILConfigManager");
+
+
+// Forward declarations
+class MOmxILPortManagerIf;
+class COmxILConfigManagerImpl;
+
+/**
+ This class is a placeholder for those OpenMAX IL parameters and configs that
+ apply to the component as a whole and not to an specific port in the
+ component. The design of this class should be revisited as the OpenMAX IL
+ resource management logic is added. For now resource management-related
+ params/configs values can only be set or queried but the associated
+ functionality is missing.
+ */
+class COmxILConfigManager : public CBase
+ {
+
+public:
+
+ IMPORT_C static COmxILConfigManager* NewL(
+ const TDesC8& aComponentName,
+ const OMX_VERSIONTYPE& aComponentVersion,
+ const RPointerArray<TDesC8>& aComponentRoleList);
+
+ IMPORT_C ~COmxILConfigManager();
+
+ OMX_ERRORTYPE GetComponentVersion(
+ OMX_STRING aComponentName,
+ OMX_VERSIONTYPE* apComponentVersion,
+ OMX_VERSIONTYPE* apSpecVersion,
+ OMX_UUIDTYPE* apComponentUUID) const;
+
+ IMPORT_C virtual OMX_ERRORTYPE GetParameter(
+ OMX_INDEXTYPE aParamIndex,
+ TAny* apComponentParameterStructure) const;
+
+ IMPORT_C virtual OMX_ERRORTYPE SetParameter(
+ OMX_INDEXTYPE aParamIndex,
+ const TAny* apComponentParameterStructure,
+ OMX_BOOL aInitTime = OMX_TRUE);
+
+ IMPORT_C virtual OMX_ERRORTYPE GetConfig(
+ OMX_INDEXTYPE aConfigIndex,
+ TAny* apComponentConfigStructure) const;
+
+ IMPORT_C virtual OMX_ERRORTYPE SetConfig(
+ OMX_INDEXTYPE aConfigIndex,
+ const TAny* apComponentConfigStructure);
+
+ IMPORT_C virtual OMX_ERRORTYPE GetExtensionIndex(
+ OMX_STRING aParameterName,
+ OMX_INDEXTYPE* apIndexType) const;
+
+ OMX_ERRORTYPE ComponentRoleEnum(
+ OMX_U8* aRole,
+ OMX_U32 aIndex) const;
+
+ void SetPortManager(MOmxILPortManagerIf* aPortManager);
+
+
+ IMPORT_C void InsertParamIndexL(TUint aParamIndex);
+
+ IMPORT_C TInt FindParamIndex(TUint aParamIndex) const;
+
+ IMPORT_C void InsertConfigIndexL(TUint aConfigIndex);
+
+ IMPORT_C TInt FindConfigIndex(TUint aConfigIndex) const;
+
+
+protected:
+
+ IMPORT_C COmxILConfigManager();
+
+ IMPORT_C void ConstructL(const TDesC8& aComponentName,
+ const OMX_VERSIONTYPE& aComponentVersion,
+ const RPointerArray<TDesC8>& aComponentRoleList);
+ RArray<TUint>& ManagedParamIndexes();
+
+ IMPORT_C RArray<TUint>& ManagedConfigIndexes();
+
+
+ //From CBase
+ IMPORT_C virtual TInt Extension_(TUint aExtensionId, TAny *&a0, TAny *a1);
+
+private:
+
+ COmxILConfigManagerImpl* ipConfigManagerImpl;
+ };
+
+#endif // OMXILCONFIGMANAGER_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/symbian_api/omxilcomplib_api/inc/omxilimageport.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,208 @@
+// 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 OMXILIMAGEPORT_H
+#define OMXILIMAGEPORT_H
+
+#include <e32base.h>
+
+#include <openmax/il/khronos/v1_x/OMX_Types.h>
+#include <openmax/il/khronos/v1_x/OMX_Core.h>
+#include <openmax/il/khronos/v1_x/OMX_Component.h>
+
+#include <openmax/il/common/omxilport.h>
+
+class COmxILImagePortImpl;
+/**
+ Image Port Panic category
+*/
+_LIT(KOmxILImagePortPanicCategory, "OmxILImagePort");
+
+class COmxILImagePort : public COmxILPort
+ {
+
+public:
+
+ IMPORT_C ~COmxILImagePort();
+
+ // From COmxILPort
+ IMPORT_C OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const = 0;
+
+ // From COmxILPort
+ IMPORT_C OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const = 0;
+
+ // From COmxILPort
+ IMPORT_C OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex,
+ TAny* apComponentParameterStructure) const = 0;
+ // From COmxILPort
+ IMPORT_C OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex,
+ const TAny* apComponentParameterStructure,
+ TBool& aUpdateProcessingFunction) = 0;
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE GetConfig(OMX_INDEXTYPE aConfigIndex,
+ TAny* apComponentConfigStructure) const;
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE SetConfig(OMX_INDEXTYPE aConfigIndex,
+ const TAny* apComponentConfigStructure,
+ TBool& aUpdateProcessingFunction);
+
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE GetExtensionIndex(
+ OMX_STRING aParameterName,
+ OMX_INDEXTYPE* apIndexType) const;
+
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE PopulateBuffer(
+ OMX_BUFFERHEADERTYPE** appBufferHdr,
+ const OMX_PTR apAppPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer,
+ TBool& portPopulationCompleted);
+
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE FreeBuffer(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ TBool& portDepopulationCompleted);
+
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE TunnelRequest(
+ OMX_HANDLETYPE aTunneledComp,
+ OMX_U32 aTunneledPort,
+ OMX_TUNNELSETUPTYPE* apTunnelSetup);
+
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE PopulateTunnel(
+ TBool& portPopulationCompleted);
+
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE FreeTunnel(
+ TBool& portDepopulationCompleted);
+
+ // From COmxILPort
+ IMPORT_C virtual TBool SetBufferSent(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ TBool& aBufferMarkedWithOwnMark);
+
+ // From COmxILPort
+ IMPORT_C virtual TBool SetBufferReturned(
+ OMX_BUFFERHEADERTYPE* apBufferHeader);
+
+ // From COmxILPort
+ IMPORT_C virtual void SetTransitionToDisabled();
+
+ // From COmxILPort
+ IMPORT_C virtual void SetTransitionToEnabled();
+
+ // From COmxILPort
+ IMPORT_C virtual void SetTransitionToDisabledCompleted();
+
+ // From COmxILPort
+ IMPORT_C virtual void SetTransitionToEnabledCompleted();
+
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE StoreBufferMark(
+ const OMX_MARKTYPE* pMark);
+
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE SetComponentRoleDefaults(
+ TUint aComponentRoleIndex);
+
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE DoPortReconfiguration(
+ TUint aPortSettingsIndex,
+ const TDesC8& aPortSettings,
+ OMX_EVENTTYPE& aEventForILClient);
+
+ // From COmxILPort
+ IMPORT_C virtual TBool HasAllBuffersAtHome() const;
+
+ // From COmxILPort
+ IMPORT_C virtual TBool IsBufferAtHome(
+ OMX_BUFFERHEADERTYPE* apHeaderHeader) const;
+
+protected:
+
+ IMPORT_C COmxILImagePort();
+
+ // From COmxILPort
+ OMX_ERRORTYPE SetFormatInPortDefinition(
+ const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition,
+ TBool& aUpdateProcessingFunction) = 0;
+
+ // From COmxILPort
+ TBool IsTunnelledPortCompatible(
+ const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const = 0;
+
+ IMPORT_C void ConstructL(const TOmxILCommonPortData& aCommonPortData,
+ const RArray<OMX_IMAGE_CODINGTYPE>& aSupportedImageFormats,
+ const RArray<OMX_COLOR_FORMATTYPE>& aSupportedColorFormats);
+
+ IMPORT_C virtual OMX_ERRORTYPE DoBufferAllocation(
+ OMX_U32 aSizeBytes,
+ OMX_U8*& apPortSpecificBuffer,
+ OMX_PTR& apPortPrivate,
+ OMX_PTR& apPlatformPrivate,
+ OMX_PTR apAppPrivate = 0);
+
+ IMPORT_C virtual void DoBufferDeallocation(
+ OMX_PTR apPortSpecificBuffer,
+ OMX_PTR apPortPrivate,
+ OMX_PTR apPlatformPrivate,
+ OMX_PTR apAppPrivate = 0);
+
+ IMPORT_C virtual OMX_ERRORTYPE DoBufferWrapping(
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer,
+ OMX_PTR& apPortPrivate,
+ OMX_PTR& apPlatformPrivate,
+ OMX_PTR apAppPrivate = 0);
+
+ IMPORT_C virtual void DoBufferUnwrapping(
+ OMX_PTR apPortSpecificBuffer,
+ OMX_PTR apPortPrivate,
+ OMX_PTR apPlatformPrivate,
+ OMX_PTR apAppPrivate = 0);
+
+ IMPORT_C virtual OMX_ERRORTYPE DoOmxUseBuffer(
+ OMX_HANDLETYPE aTunnelledComponent,
+ OMX_BUFFERHEADERTYPE** appBufferHdr,
+ OMX_U32 aTunnelledPortIndex,
+ OMX_PTR apPortPrivate,
+ OMX_PTR apPlatformPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer);
+
+ IMPORT_C const RArray<OMX_IMAGE_CODINGTYPE>& GetSupportedImageFormats() const;
+ IMPORT_C const RArray<OMX_COLOR_FORMATTYPE>& GetSupportedColorFormats() const;
+ IMPORT_C const OMX_IMAGE_PARAM_PORTFORMATTYPE& GetParamImagePortFormat() const;
+
+ IMPORT_C RArray<OMX_IMAGE_CODINGTYPE>& GetSupportedImageFormats();
+ IMPORT_C RArray<OMX_COLOR_FORMATTYPE>& GetSupportedColorFormats();
+ IMPORT_C OMX_IMAGE_PARAM_PORTFORMATTYPE& GetParamImagePortFormat();
+
+ //From CBase
+ IMPORT_C virtual TInt Extension_(TUint aExtensionId, TAny *&a0, TAny *a1);
+
+private:
+ COmxILImagePortImpl* ipImagePortImpl;
+ };
+
+#endif // OMXILIMAGEPORT_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/symbian_api/omxilcomplib_api/inc/omxilotherport.h Wed Aug 25 12:40:50 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 OMXILOTHERPORT_H
+#define OMXILOTHERPORT_H
+
+#include <openmax/il/common/omxilport.h>
+#include <e32base.h>
+#include <openmax/il/khronos/v1_x/OMX_Types.h>
+#include <openmax/il/khronos/v1_x/OMX_Core.h>
+#include <openmax/il/khronos/v1_x/OMX_Component.h>
+
+class COmxILOtherPortImpl;
+/**
+ Other Port Panic category
+*/
+_LIT(KOmxILOtherPortPanicCategory, "OmxILOtherPort");
+
+class COmxILOtherPort : public COmxILPort
+ {
+public:
+ IMPORT_C ~COmxILOtherPort();
+
+ // From COmxILPort
+ IMPORT_C OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const = 0;
+
+ // From COmxILPort
+ IMPORT_C OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const = 0;
+
+ // From COmxILPort
+ IMPORT_C OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex,
+ TAny* apComponentParameterStructure) const = 0;
+
+ // From COmxILPort
+ IMPORT_C OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex,
+ const TAny* apComponentParameterStructure,
+ TBool& aUpdateProcessingFunction) = 0;
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE GetConfig(OMX_INDEXTYPE aConfigIndex,
+ TAny* apComponentConfigStructure) const;
+
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE SetConfig(OMX_INDEXTYPE aConfigIndex,
+ const TAny* apComponentConfigStructure,
+ TBool& aUpdateProcessingFunction);
+
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE GetExtensionIndex(
+ OMX_STRING aParameterName,
+ OMX_INDEXTYPE* apIndexType) const;
+
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE PopulateBuffer(
+ OMX_BUFFERHEADERTYPE** appBufferHdr,
+ const OMX_PTR apAppPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer,
+ TBool& portPopulationCompleted);
+
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE FreeBuffer(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ TBool& portDepopulationCompleted);
+
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE TunnelRequest(
+ OMX_HANDLETYPE aTunneledComp,
+ OMX_U32 aTunneledPort,
+ OMX_TUNNELSETUPTYPE* apTunnelSetup);
+
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE PopulateTunnel(
+ TBool& portPopulationCompleted);
+
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE FreeTunnel(
+ TBool& portDepopulationCompleted);
+
+ // From COmxILPort
+ IMPORT_C virtual TBool SetBufferSent(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ TBool& aBufferMarkedWithOwnMark);
+
+ // From COmxILPort
+ IMPORT_C virtual TBool SetBufferReturned(
+ OMX_BUFFERHEADERTYPE* apBufferHeader);
+
+ // From COmxILPort
+ IMPORT_C virtual void SetTransitionToDisabled();
+
+ // From COmxILPort
+ IMPORT_C virtual void SetTransitionToEnabled();
+
+ // From COmxILPort
+ IMPORT_C virtual void SetTransitionToDisabledCompleted();
+
+ // From COmxILPort
+ IMPORT_C virtual void SetTransitionToEnabledCompleted();
+
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE StoreBufferMark(
+ const OMX_MARKTYPE* pMark);
+
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE SetComponentRoleDefaults(
+ TUint aComponentRoleIndex);
+
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE DoPortReconfiguration(
+ TUint aPortSettingsIndex,
+ const TDesC8& aPortSettings,
+ OMX_EVENTTYPE& aEventForILClient);
+
+ // From COmxILPort
+ IMPORT_C virtual TBool HasAllBuffersAtHome() const;
+
+ // From COmxILPort
+ IMPORT_C virtual TBool IsBufferAtHome(
+ OMX_BUFFERHEADERTYPE* apHeaderHeader) const;
+
+protected:
+ IMPORT_C COmxILOtherPort();
+
+ IMPORT_C void ConstructL(const TOmxILCommonPortData& aCommonPortData, const RArray<OMX_OTHER_FORMATTYPE>& aSupportedOtherFormats);
+
+ // From COmxILPort
+ OMX_ERRORTYPE SetFormatInPortDefinition(
+ const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition,
+ TBool& aUpdateProcessingFunction) = 0;
+
+ // From COmxILPort
+ TBool IsTunnelledPortCompatible(
+ const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const = 0;
+
+ IMPORT_C virtual OMX_ERRORTYPE DoBufferAllocation(
+ OMX_U32 aSizeBytes,
+ OMX_U8*& apPortSpecificBuffer,
+ OMX_PTR& apPortPrivate,
+ OMX_PTR& apPlatformPrivate,
+ OMX_PTR apAppPrivate = 0);
+
+ IMPORT_C virtual void DoBufferDeallocation(
+ OMX_PTR apPortSpecificBuffer,
+ OMX_PTR apPortPrivate,
+ OMX_PTR apPlatformPrivate,
+ OMX_PTR apAppPrivate = 0);
+
+ IMPORT_C virtual OMX_ERRORTYPE DoBufferWrapping(
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer,
+ OMX_PTR& apPortPrivate,
+ OMX_PTR& apPlatformPrivate,
+ OMX_PTR apAppPrivate = 0);
+
+ IMPORT_C virtual void DoBufferUnwrapping(
+ OMX_PTR apPortSpecificBuffer,
+ OMX_PTR apPortPrivate,
+ OMX_PTR apPlatformPrivate,
+ OMX_PTR apAppPrivate = 0);
+
+ IMPORT_C virtual OMX_ERRORTYPE DoOmxUseBuffer(
+ OMX_HANDLETYPE aTunnelledComponent,
+ OMX_BUFFERHEADERTYPE** appBufferHdr,
+ OMX_U32 aTunnelledPortIndex,
+ OMX_PTR apPortPrivate,
+ OMX_PTR apPlatformPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer);
+
+ IMPORT_C const RArray<OMX_OTHER_FORMATTYPE>& GetSupportedOtherFormats() const;
+ IMPORT_C const OMX_OTHER_PARAM_PORTFORMATTYPE& GetParamOtherPortFormat() const;
+ IMPORT_C RArray<OMX_OTHER_FORMATTYPE>& GetSupportedOtherFormats();
+ IMPORT_C OMX_OTHER_PARAM_PORTFORMATTYPE& GetParamOtherPortFormat();
+
+ //From CBase
+ IMPORT_C virtual TInt Extension_(TUint aExtensionId, TAny *&a0, TAny *a1);
+
+private:
+ COmxILOtherPortImpl* ipOtherPortImpl;
+ };
+
+#endif // OMXILOTHERPORT_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/symbian_api/omxilcomplib_api/inc/omxilport.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,354 @@
+// Copyright (c) 2008-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
+*/
+
+#ifndef OMXILPORT_H
+#define OMXILPORT_H
+
+#include <e32base.h>
+#include <openmax/il/khronos/v1_x/OMX_Component.h>
+#include <openmax/il/common/omxilspecversion.h>
+
+
+/**
+ Base Port Panic category
+*/
+_LIT(KOmxILPortPanicCategory, "OmxILPort");
+
+// Forward declarations
+class COmxILPortImpl;
+
+/**
+ Structure used to pass the common information that an OpenMAX IL port needs
+ at instantiation time.
+*/
+class TOmxILCommonPortData
+ {
+
+public:
+
+ // OMX specification version information
+ OMX_VERSIONTYPE iOmxVersion;
+ // Port number the structure applies to
+ OMX_U32 iPortIndex;
+ // Direction (input or output) of this port
+ OMX_DIRTYPE iDirection;
+ // The minimum number of buffers this port requires
+ OMX_U32 iBufferCountMin;
+ // Minimum size, in bytes, for buffers to be used for this port
+ OMX_U32 iBufferSizeMin;
+ // Domain of the port
+ OMX_PORTDOMAINTYPE iPortDomain;
+ // Buffers contiguous requirement (true or false)
+ OMX_BOOL iBuffersContiguous;
+ // Buffer aligment requirements
+ OMX_U32 iBufferAlignment;
+ // Port supplier preference when tunneling between two ports
+ OMX_BUFFERSUPPLIERTYPE iBufferSupplier;
+
+ // \brief This is the associated port that will be used to propagate buffer marks
+ // found in incoming buffer headers.
+ //
+ // In general, for any output port, this parameter should be configured
+ // with constant COmxILPort::KBufferMarkPropagationPortNotNeeded except
+ // for an output port of a source component, in which case it must be used
+ // the same index of the port that this structure applies to. For an input
+ // port of a sink component,
+ // COmxILPort::KBufferMarkPropagationPortNotNeeded must also be used.
+ OMX_U32 iBufferMarkPropagationPortIndex;
+
+ // Constructor
+ IMPORT_C TOmxILCommonPortData(
+ OMX_VERSIONTYPE aOmxVersion,
+ OMX_U32 aPortIndex,
+ OMX_DIRTYPE aDirection,
+ OMX_U32 aBufferCountMin,
+ OMX_U32 aBufferSizeMin,
+ OMX_PORTDOMAINTYPE aPortDomain,
+ OMX_BOOL aBuffersContiguous,
+ OMX_U32 aBufferAlignment,
+ OMX_BUFFERSUPPLIERTYPE aBufferSupplier,
+ OMX_U32 aBufferMarkPropagationPortIndex);
+
+ };
+
+
+/**
+ OpenMAX IL component port base class.
+*/
+class COmxILPort : public CBase
+ {
+friend class COmxILPortImpl;
+
+public:
+ static const TInt KBufferMarkPropagationPortNotNeeded = 0x7FFFFFFF;
+
+ ~COmxILPort();
+
+ /**
+ This method is used to retrieve the local OpenMAX IL parameter indexes
+ managed by the specific port. The implementation should collect indexes
+ from the parent class. Local indexes should be appended in order to the
+ list received as parameter. The implementation should handle index
+ duplication as a non-error situation (i.e., the resulting list will
+ contain unique indexes).
+
+ @param aIndexArray An array of parameter indexes where the local
+ indexes are to be appended.
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE GetLocalOmxParamIndexes(
+ RArray<TUint>& aIndexArray) const = 0;
+
+ /**
+ This method is used to retrieve the local OpenMAX IL config indexes
+ managed by the specific port. The implementation should collect indexes
+ from the parent class. Local indexes should be appended in order to the
+ list received as parameter. The implementation should handle index
+ duplication as a non-error situation (i.e., the resulting list will
+ contain unique indexes).
+
+ @param aIndexArray An array of config indexes where the local indexes
+ are to be appended.
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE GetLocalOmxConfigIndexes(
+ RArray<TUint>& aIndexArray) const = 0;
+
+ /**
+ Port-specific version of the OpenMAX IL GetParameter API.
+
+ @param aParamIndex The index of the structure that is to be filled.
+ @param apComponentParameterStructure A pointer to the IL structure.
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE GetParameter(
+ OMX_INDEXTYPE aParamIndex,
+ TAny* apComponentParameterStructure) const = 0;
+
+ /**
+ Port-specific version of the OpenMAX IL SetParameter API.
+
+ @param aParamIndex The index of the structure that is to be set.
+ @param apComponentParameterStructure A pointer to the IL structure.
+ @param aUpdateProcessingFunction A flag to signal that the component's
+ processing function needs to be updated with this structure.
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE SetParameter(
+ OMX_INDEXTYPE aParamIndex,
+ const TAny* apComponentParameterStructure,
+ TBool& aUpdateProcessingFunction) = 0;
+
+ virtual OMX_ERRORTYPE GetConfig(
+ OMX_INDEXTYPE aConfigIndex,
+ TAny* apComponentConfigStructure) const;
+
+ virtual OMX_ERRORTYPE SetConfig(
+ OMX_INDEXTYPE aConfigIndex,
+ const TAny* apComponentConfigStructure,
+ TBool& aUpdateProcessingFunction);
+
+ virtual OMX_ERRORTYPE GetExtensionIndex(
+ OMX_STRING aParameterName,
+ OMX_INDEXTYPE* apIndexType) const;
+
+ virtual OMX_ERRORTYPE PopulateBuffer(
+ OMX_BUFFERHEADERTYPE** appBufferHdr,
+ const OMX_PTR apAppPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer,
+ TBool& portPopulationCompleted);
+
+ virtual OMX_ERRORTYPE FreeBuffer(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ TBool& portDepopulationCompleted);
+
+ virtual OMX_ERRORTYPE TunnelRequest(
+ OMX_HANDLETYPE aTunneledComp,
+ OMX_U32 aTunneledPort,
+ OMX_TUNNELSETUPTYPE* apTunnelSetup);
+
+ virtual OMX_ERRORTYPE PopulateTunnel(
+ TBool& portPopulationCompleted);
+
+ virtual OMX_ERRORTYPE FreeTunnel(
+ TBool& portDepopulationCompleted);
+
+ virtual TBool SetBufferSent(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ TBool& aBufferMarkedWithOwnMark);
+
+ virtual TBool SetBufferReturned(
+ OMX_BUFFERHEADERTYPE* apBufferHeader);
+
+ virtual void SetTransitionToDisabled();
+
+ virtual void SetTransitionToEnabled();
+
+ virtual void SetTransitionToDisabledCompleted();
+
+ virtual void SetTransitionToEnabledCompleted();
+
+ virtual OMX_ERRORTYPE StoreBufferMark(
+ const OMX_MARKTYPE* pMark);
+
+ virtual OMX_ERRORTYPE SetComponentRoleDefaults(
+ TUint aComponentRoleIndex);
+
+ virtual OMX_ERRORTYPE DoPortReconfiguration(
+ TUint aPortSettingsIndex,
+ const TDesC8& aPortSettings,
+ OMX_EVENTTYPE& aEventForILClient);
+
+ OMX_DIRTYPE Direction() const;
+
+ IMPORT_C TBool IsEnabled() const;
+
+ TBool IsPopulated() const;
+
+ TBool IsDePopulated() const;
+
+ TBool IsTunnelled() const;
+
+ TBool IsTunnelledAndBufferSupplier() const;
+
+ virtual TBool HasAllBuffersAtHome() const;
+
+ TBool IsTransitioningToEnabled() const;
+
+ TBool IsTransitioningToDisabled() const;
+
+ virtual TBool IsBufferAtHome(
+ OMX_BUFFERHEADERTYPE* apHeaderHeader) const;
+
+ IMPORT_C OMX_U32 Index() const;
+
+ OMX_PORTDOMAINTYPE Domain() const;
+
+ OMX_U32 Count() const;
+
+ OMX_BUFFERHEADERTYPE* const& operator[](TInt anIndex) const;
+
+ OMX_BUFFERHEADERTYPE*& operator[](TInt anIndex);
+
+ OMX_U32 BufferMarkPropagationPort() const;
+
+protected:
+
+ COmxILPort();
+ void ConstructL(const TOmxILCommonPortData& aCommonPortData);
+ /**
+ When the IL Client calls SetParameter with index
+ OMX_IndexParamPortDefinition, this method is called to set the fields in
+ the OMX_PARAM_PORTDEFINITIONTYPE (@see iParamPortDefinition) structure
+ that are specific to this port's domain.
+
+ @param aPortDefinition The OpenMAX IL structure received from the IL Client.
+ @param aUpdateProcessingFunction A flag to signal that the component's
+ processing function needs to be updated with the this structure.
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE SetFormatInPortDefinition(
+ const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition,
+ TBool& aUpdateProcessingFunction) = 0;
+
+ /**
+ On a tunnel request, this method is called to check the compatibility of
+ the fields in the OMX_PARAM_PORTDEFINITIONTYPE structure of the
+ tunnelled component that are specific to this port's domain.
+
+ @param aPortDefinition The OpenMAX IL structure received from a
+ tunnelled component.
+
+ @return ETrue if compatible, EFalse otherwise.
+ */
+ virtual TBool IsTunnelledPortCompatible(
+ const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const = 0;
+
+ virtual OMX_ERRORTYPE DoBufferAllocation(
+ OMX_U32 aSizeBytes,
+ OMX_U8*& apPortSpecificBuffer,
+ OMX_PTR& apPortPrivate,
+ OMX_PTR& apPlatformPrivate,
+ OMX_PTR apAppPrivate = 0);
+
+ virtual void DoBufferDeallocation(
+ OMX_PTR apPortSpecificBuffer,
+ OMX_PTR apPortPrivate,
+ OMX_PTR apPlatformPrivate,
+ OMX_PTR apAppPrivate = 0);
+
+ virtual OMX_ERRORTYPE DoBufferWrapping(
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer,
+ OMX_PTR& apPortPrivate,
+ OMX_PTR& apPlatformPrivate,
+ OMX_PTR apAppPrivate = 0);
+
+ virtual void DoBufferUnwrapping(
+ OMX_PTR apPortSpecificBuffer,
+ OMX_PTR apPortPrivate,
+ OMX_PTR apPlatformPrivate,
+ OMX_PTR apAppPrivate = 0);
+
+ virtual OMX_ERRORTYPE DoOmxUseBuffer(
+ OMX_HANDLETYPE aTunnelledComponent,
+ OMX_BUFFERHEADERTYPE** appBufferHdr,
+ OMX_U32 aTunnelledPortIndex,
+ OMX_PTR apPortPrivate,
+ OMX_PTR apPlatformPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer);
+
+ template<typename T>
+ inline OMX_ERRORTYPE GetParamStructureFromTunnel(
+ T& aComponentConfigStructure, OMX_INDEXTYPE aParamIndex) const;
+
+ OMX_ERRORTYPE StoreBufferMark(
+ OMX_HANDLETYPE& ipMarkTargetComponent,
+ OMX_PTR& ipMarkData);
+
+ IMPORT_C void CleanUpPort();
+
+protected:
+ IMPORT_C const OMX_PARAM_PORTDEFINITIONTYPE& GetParamPortDefinition() const;
+ IMPORT_C const OMX_HANDLETYPE& GetTunnelledComponent() const;
+ IMPORT_C const OMX_U32& GetTunnelledPort() const;
+
+ IMPORT_C OMX_PARAM_PORTDEFINITIONTYPE& GetParamPortDefinition();
+ IMPORT_C OMX_HANDLETYPE& GetTunnelledComponent();
+ IMPORT_C OMX_U32& GetTunnelledPort();
+ //From CBase
+ IMPORT_C virtual TInt Extension_(TUint aExtensionId, TAny *&a0, TAny *a1);
+
+private:
+ COmxILPortImpl* ipPortImpl;
+
+ };
+
+#include <openmax/il/common/omxilport.inl>
+
+#endif // OMXILPORT_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/symbian_api/omxilcomplib_api/inc/omxilport.inl Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,47 @@
+// Copyright (c) 2008-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
+*/
+
+template<typename T>
+inline OMX_ERRORTYPE
+COmxILPort::GetParamStructureFromTunnel(
+ T& aComponentConfigStructure, OMX_INDEXTYPE aParamIndex) const
+ {
+
+ __ASSERT_ALWAYS(GetTunnelledComponent(),
+ User::Panic(KOmxILPortPanicCategory, 1));
+
+ aComponentConfigStructure.nSize = sizeof(T);
+ aComponentConfigStructure.nVersion = TOmxILSpecVersion();
+ aComponentConfigStructure.nPortIndex = GetTunnelledPort();
+
+ if (OMX_ErrorNone !=
+ OMX_GetParameter(GetTunnelledComponent(),
+ aParamIndex,
+ &aComponentConfigStructure) )
+ {
+ return OMX_ErrorUndefined;
+ }
+
+ return OMX_ErrorNone;
+
+ }
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/symbian_api/omxilcomplib_api/inc/omxilprocessingfunction.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,181 @@
+// 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 OMXILPROCESSINGFUNCTION_H
+#define OMXILPROCESSINGFUNCTION_H
+
+#include <e32base.h>
+
+#include <openmax/il/khronos/v1_x/OMX_Core.h>
+#include <openmax/il/khronos/v1_x/OMX_Types.h>
+#include <openmax/il/khronos/v1_x/OMX_Other.h>
+
+//#include "omxilfsm.h"
+#include <openmax/il/common/omxilstatedefs.h>
+
+// Forward declarations
+class MOmxILCallbackNotificationIf;
+
+/**
+ Base class for component-specific implementations of the Processing Function
+ abstraction. Component implementations realize within a Processing Function
+ object the codec specific logic. Component implementations may choose
+ whether to implement the Processing Function functionality in an additional
+ independent thread or in-context with the framework. The interface is
+ designed to generalize the notification of the OpenMAX IL commands, OpenMAX
+ IL state changes and input/output buffer arrivals to the codec
+ itself. Implementations of this interface are intended to communicate with
+ the entity in charge of the egress component communication, the Callback
+ Manager.
+ */
+class COmxILProcessingFunction : public CBase
+ {
+
+public:
+
+ IMPORT_C ~COmxILProcessingFunction();
+
+ /**
+ Framework notification of a state transition in the component.
+
+ @param aNewState The new state.
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE StateTransitionIndication(
+ TStateIndex aNewState) = 0;
+
+ /**
+ Framework notification of a buffer flushing command.
+
+ @param aPortIndex The port that is being flushed.
+
+ @param aDirection The direction of the port that is being flushed.
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE BufferFlushingIndication(
+ TUint32 aPortIndex,
+ OMX_DIRTYPE aDirection) = 0;
+
+ /**
+ Framework notification of an OpenMAX IL Param structure change.
+
+ @param aParamIndex The index of the param structure that has changed.
+
+ @param apComponentParameterStructure The param structure.
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE ParamIndication(
+ OMX_INDEXTYPE aParamIndex,
+ const TAny* apComponentParameterStructure) = 0;
+
+ /**
+ Framework notification of an OpenMAX IL Config structure change.
+
+ @param aConfigIndex The index of the config structure that has changed.
+
+ @param apComponentConfigStructure The config structure.
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE ConfigIndication(
+ OMX_INDEXTYPE aConfigIndex,
+ const TAny* apComponentConfigStructure) = 0;
+
+ /**
+ Framework notification of a buffer arrival.
+
+ @param apBufferHeader The header of the buffer to be processed.
+
+ @param aDirection The direction of the port that has received the
+ buffer.
+
+ @return OMX_ERRORTYPE
+ */
+ virtual OMX_ERRORTYPE BufferIndication(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_DIRTYPE aDirection) = 0;
+
+ /**
+ Framework notification of a buffer removal. Here the Processing Function
+ object is being notified that a buffer needs to be removed from its
+ internal queues. At present, a synchronous implementation of this method
+ is assumed. Buffer removal notifications may be originated by the
+ framework in the following scenarios:
+
+ -# After an OMX_FreeBuffer call has been received from the IL Client or
+ from another component.
+
+ -# After a port flushing command has been received from the IL Client
+ AND the port is tunnelled and buffer supplier.
+
+ -# After a transition OMX_StateExecuting/OMX_StatePause -> OMX_StateIdle
+ has been requested by the IL Client AND the port associated to the
+ buffer is tunnelled and buffer supplier.
+
+ -# After a port disable command has been received from the IL Client AND
+ the port associated to the buffer is tunnelled and buffer supplier.
+
+ @param apBufferHeader The buffer header to be removed from internal
+ queues.
+
+ @param aDirection The direction of the port associated to the buffer.
+
+ @return OMX_BOOL Etrue if the Processing Function has successfully
+ removed the buffer header from its internal queues, EFalse otherwise.
+ */
+ virtual OMX_BOOL BufferRemovalIndication(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ OMX_DIRTYPE aDirection) = 0;
+
+ IMPORT_C virtual OMX_ERRORTYPE ComponentRoleIndication(
+ TUint aComponentRoleIndex);
+
+ /**
+ Framework notification of a buffer arrival on a OMX_PortDomainOther;
+ normally the interested component would just extract the buffer and
+ let the port manager returns the buffer to the buffer supplier
+ component via callback immediately.
+
+ @param apBufferHeader The header of the buffer to be processed.
+ @param aDirection The direction of the port that has received
+ the buffer.
+ @return OMX_ERRORTYPE
+ */
+ IMPORT_C virtual OMX_ERRORTYPE MediaTimeIndication(const OMX_TIME_MEDIATIMETYPE& );
+
+protected:
+
+ IMPORT_C COmxILProcessingFunction(
+ MOmxILCallbackNotificationIf& aCallbacks);
+
+ //From CBase
+ IMPORT_C virtual TInt Extension_(TUint aExtensionId, TAny *&a0, TAny *a1);
+
+protected:
+
+ MOmxILCallbackNotificationIf& iCallbacks;
+
+ };
+
+#endif // OMXILPROCESSINGFUNCTION_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/symbian_api/omxilcomplib_api/inc/omxilspecversion.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,72 @@
+// 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 OMXILSPECVERSION_H
+#define OMXILSPECVERSION_H
+
+#include <e32def.h>
+#include <e32const.h>
+
+#include <openmax/il/khronos/v1_x/OMX_Types.h>
+
+class TOmxILVersion
+ {
+
+public:
+
+ IMPORT_C TOmxILVersion(TUint8 aMajor,
+ TUint8 aMinor,
+ TUint8 aRev,
+ TUint8 aStep);
+
+
+ IMPORT_C operator OMX_VERSIONTYPE&();
+
+#ifdef _OMXIL_COMMON_SPEC_VERSION_CHECKS_ON
+ TBool operator!=(const OMX_VERSIONTYPE& aVer) const;
+
+ TBool operator==(const OMX_VERSIONTYPE& aVer) const;
+#endif
+
+private:
+
+ OMX_VERSIONTYPE iSpecVersion;
+
+ };
+
+class TOmxILSpecVersion : public TOmxILVersion
+ {
+
+public:
+
+ static const TUint8 KSpecVersionMajor = OMX_VERSION_MAJOR;
+ static const TUint8 KSpecVersionMinor = OMX_VERSION_MINOR;
+ static const TUint8 KSpecVersionRevision = OMX_VERSION_REVISION;
+ static const TUint8 KSpecVersionStep = OMX_VERSION_STEP;
+
+public:
+
+ IMPORT_C TOmxILSpecVersion();
+
+ };
+
+#endif // OMXILSPECVERSION_H
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/symbian_api/omxilcomplib_api/inc/omxilstatedefs.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,40 @@
+// 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
+ @internalComponent
+*/
+
+#ifndef OMXILSTATEDEFS_H
+#define OMXILSTATEDEFS_H
+
+enum TStateIndex
+ {
+ EStateInvalid = OMX_StateInvalid,
+ EStateLoaded = OMX_StateLoaded,
+ EStateIdle = OMX_StateIdle,
+ EStateExecuting = OMX_StateExecuting,
+ EStatePause = OMX_StatePause,
+ EStateWaitForResources = OMX_StateWaitForResources,
+ ESubStateLoadedToIdle,
+ ESubStateIdleToLoaded,
+ ESubStateExecutingToIdle,
+ ESubStatePauseToIdle,
+ EStateMax
+ };
+
+#endif // OMXILSTATEDEFS_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/symbian_api/omxilcomplib_api/inc/omxilutil.h Wed Aug 25 12:40:50 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:
+//
+
+
+/**
+ @file
+ @internalComponent
+*/
+
+#ifndef OMXILUTIL_H
+#define OMXILUTIL_H
+
+#include <e32def.h>
+
+#include <openmax/il/khronos/v1_x/OMX_Core.h>
+#include <openmax/il/khronos/v1_x/OMX_Types.h>
+
+
+class TOmxILUtil
+ {
+
+public:
+
+ IMPORT_C static OMX_ERRORTYPE CheckOmxStructSizeAndVersion(
+ OMX_PTR apHeader, OMX_U32 aSize);
+
+ IMPORT_C static void ClearBufferContents(
+ OMX_BUFFERHEADERTYPE* apBufferHeader);
+
+ };
+
+
+#endif // OMXILUTIL_H
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/symbian_api/omxilcomplib_api/inc/omxilvideoport.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,210 @@
+// 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 OMXILVIDEOPORT_H
+#define OMXILVIDEOPORT_H
+
+#include <e32base.h>
+
+#include <openmax/il/khronos/v1_x/OMX_Types.h>
+#include <openmax/il/khronos/v1_x/OMX_Core.h>
+#include <openmax/il/khronos/v1_x/OMX_Component.h>
+
+#include <openmax/il/common/omxilport.h>
+
+class COmxILVideoPortImpl;
+/**
+ Image Port Panic category
+*/
+_LIT(KOmxILVideoPortPanicCategory, "OmxILVideoPort");
+
+class COmxILVideoPort : public COmxILPort
+ {
+
+public:
+
+ IMPORT_C ~COmxILVideoPort();
+
+ // From COmxILPort
+ IMPORT_C OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray<TUint>& aIndexArray) const = 0;
+
+ // From COmxILPort
+ IMPORT_C OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray<TUint>& aIndexArray) const = 0;
+
+ // From COmxILPort
+ IMPORT_C OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex,
+ TAny* apComponentParameterStructure) const = 0;
+ // From COmxILPort
+ IMPORT_C OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex,
+ const TAny* apComponentParameterStructure,
+ TBool& aUpdateProcessingFunction) = 0;
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE GetConfig(OMX_INDEXTYPE aConfigIndex,
+ TAny* apComponentConfigStructure) const;
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE SetConfig(OMX_INDEXTYPE aConfigIndex,
+ const TAny* apComponentConfigStructure,
+ TBool& aUpdateProcessingFunction);
+
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE GetExtensionIndex(
+ OMX_STRING aParameterName,
+ OMX_INDEXTYPE* apIndexType) const;
+
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE PopulateBuffer(
+ OMX_BUFFERHEADERTYPE** appBufferHdr,
+ const OMX_PTR apAppPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer,
+ TBool& portPopulationCompleted);
+
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE FreeBuffer(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ TBool& portDepopulationCompleted);
+
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE TunnelRequest(
+ OMX_HANDLETYPE aTunneledComp,
+ OMX_U32 aTunneledPort,
+ OMX_TUNNELSETUPTYPE* apTunnelSetup);
+
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE PopulateTunnel(
+ TBool& portPopulationCompleted);
+
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE FreeTunnel(
+ TBool& portDepopulationCompleted);
+
+ // From COmxILPort
+ IMPORT_C virtual TBool SetBufferSent(
+ OMX_BUFFERHEADERTYPE* apBufferHeader,
+ TBool& aBufferMarkedWithOwnMark);
+
+ // From COmxILPort
+ IMPORT_C virtual TBool SetBufferReturned(
+ OMX_BUFFERHEADERTYPE* apBufferHeader);
+
+ // From COmxILPort
+ IMPORT_C virtual void SetTransitionToDisabled();
+
+ // From COmxILPort
+ IMPORT_C virtual void SetTransitionToEnabled();
+
+ // From COmxILPort
+ IMPORT_C virtual void SetTransitionToDisabledCompleted();
+
+ // From COmxILPort
+ IMPORT_C virtual void SetTransitionToEnabledCompleted();
+
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE StoreBufferMark(
+ const OMX_MARKTYPE* pMark);
+
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE SetComponentRoleDefaults(
+ TUint aComponentRoleIndex);
+
+ // From COmxILPort
+ IMPORT_C virtual OMX_ERRORTYPE DoPortReconfiguration(
+ TUint aPortSettingsIndex,
+ const TDesC8& aPortSettings,
+ OMX_EVENTTYPE& aEventForILClient);
+
+ // From COmxILPort
+ IMPORT_C virtual TBool HasAllBuffersAtHome() const;
+
+ // From COmxILPort
+ IMPORT_C virtual TBool IsBufferAtHome(
+ OMX_BUFFERHEADERTYPE* apHeaderHeader) const;
+
+protected:
+
+ IMPORT_C COmxILVideoPort();
+
+ IMPORT_C void ConstructL(const TOmxILCommonPortData& aCommonPortData,
+ const RArray<OMX_VIDEO_CODINGTYPE>& aSupportedVideoFormats,
+ const RArray<OMX_COLOR_FORMATTYPE>& aSupportedColorFormats);
+
+ // From COmxILPort
+ OMX_ERRORTYPE SetFormatInPortDefinition(
+ const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition,
+ TBool& aUpdateProcessingFunction) = 0;
+
+ // From COmxILPort
+ TBool IsTunnelledPortCompatible(
+ const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const = 0;
+
+ IMPORT_C TBool UpdateColorFormat(OMX_COLOR_FORMATTYPE& aOldColor, OMX_COLOR_FORMATTYPE aNewColor, TBool& aUpdated);
+ IMPORT_C TBool UpdateCodingType(OMX_VIDEO_CODINGTYPE& aOldCodingType, OMX_VIDEO_CODINGTYPE aNewCodingType, TBool& aUpdated);
+
+ IMPORT_C RArray<OMX_VIDEO_CODINGTYPE>& GetSupportedVideoFormats();
+ IMPORT_C RArray<OMX_COLOR_FORMATTYPE>& GetSupportedColorFormats();
+ IMPORT_C OMX_VIDEO_PARAM_PORTFORMATTYPE& GetParamVideoPortFormat();
+ IMPORT_C const RArray<OMX_VIDEO_CODINGTYPE>& GetSupportedVideoFormats() const;
+ IMPORT_C const RArray<OMX_COLOR_FORMATTYPE>& GetSupportedColorFormats() const;
+ IMPORT_C const OMX_VIDEO_PARAM_PORTFORMATTYPE& GetParamVideoPortFormat() const;
+
+ IMPORT_C virtual OMX_ERRORTYPE DoBufferAllocation(
+ OMX_U32 aSizeBytes,
+ OMX_U8*& apPortSpecificBuffer,
+ OMX_PTR& apPortPrivate,
+ OMX_PTR& apPlatformPrivate,
+ OMX_PTR apAppPrivate = 0);
+
+ IMPORT_C virtual void DoBufferDeallocation(
+ OMX_PTR apPortSpecificBuffer,
+ OMX_PTR apPortPrivate,
+ OMX_PTR apPlatformPrivate,
+ OMX_PTR apAppPrivate = 0);
+
+ IMPORT_C virtual OMX_ERRORTYPE DoBufferWrapping(
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer,
+ OMX_PTR& apPortPrivate,
+ OMX_PTR& apPlatformPrivate,
+ OMX_PTR apAppPrivate = 0);
+
+ IMPORT_C virtual void DoBufferUnwrapping(
+ OMX_PTR apPortSpecificBuffer,
+ OMX_PTR apPortPrivate,
+ OMX_PTR apPlatformPrivate,
+ OMX_PTR apAppPrivate = 0);
+
+ IMPORT_C virtual OMX_ERRORTYPE DoOmxUseBuffer(
+ OMX_HANDLETYPE aTunnelledComponent,
+ OMX_BUFFERHEADERTYPE** appBufferHdr,
+ OMX_U32 aTunnelledPortIndex,
+ OMX_PTR apPortPrivate,
+ OMX_PTR apPlatformPrivate,
+ OMX_U32 aSizeBytes,
+ OMX_U8* apBuffer);
+
+ //From CBase
+ IMPORT_C virtual TInt Extension_(TUint aExtensionId, TAny *&a0, TAny *a1);
+
+private:
+ COmxILVideoPortImpl* ipVideoPortImpl;
+ };
+
+#endif // OMXILVIDEOPORT_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/symbian_api/omxilcore_api/group/bld.inf Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,31 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+PRJ_EXPORTS
+
+//
+// Romkit include files for omxilcore
+//
+../inc/omxilloaderif.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/core/omxilloaderif.h)
+../inc/omxilloaderif.hrh SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/core/omxilloaderif.hrh)
+../inc/omxilloaderif.inl SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/core/omxilloaderif.inl)
+../inc/omxilsymbianloaderif.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/core/omxilsymbianloaderif.h)
+
+// Content Pipe Interface API
+../inc/omxilcontentpipeif.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/core/omxilcontentpipeif.h)
+../inc/omxilcontentpipeif.hrh SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/core/omxilcontentpipeif.hrh)
+../inc/omxilsymbiancontentpipeif.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/core/omxilsymbiancontentpipeif.h)
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/symbian_api/omxilcore_api/inc/omxilcontentpipeif.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,77 @@
+// 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:
+// Keep it as prototype until the end of Diran to allow time for the Symbian Content Pipe OMX IL v1.x solution to be exercised,
+// since we know this feature has recently been added to the standard and it is not yet in use.
+//
+//
+
+/**
+ @file
+ @publishedPartner
+ @prototype
+*/
+
+#ifndef OMXILCONTENTPIPEIF_H
+#define OMXILCONTENTPIPEIF_H
+
+#include <ecom/ecom.h>
+#include <ecom/implementationproxy.h>
+#include <openmax/il/khronos/v1_x/OMX_Core.h>
+#include <openmax/il/khronos/v1_x/OMX_ContentPipe.h>
+
+/**
+ Bridge to allow content pipes to be loaded as an ECOM plugin.
+ Inheritance from this class allows it
+*/
+class COmxILContentPipeIf : public CBase
+ {
+public:
+ ~COmxILContentPipeIf();
+ static COmxILContentPipeIf* CreateImplementationL(TUid aUid);
+
+ /**
+ Gets a valid content pipe handle
+
+ @return KErrNone if successful, otherwise another system-wide error codes
+ @param aContentPipe Returns a pointer to the content pipe handle
+ */
+ virtual TInt GetHandle(OMX_HANDLETYPE* aContentPipe) = 0;
+
+private:
+ /** A 32-bit instance key returned by the ECom framework */
+ TUid iDestructorKey;
+ };
+
+/**
+ Destructor
+*/
+inline COmxILContentPipeIf::~COmxILContentPipeIf()
+ {
+ REComSession::DestroyedImplementation(iDestructorKey);
+ }
+
+/**
+ This function loads the ECOM plug-in specified by the UID passed as argument and
+ return a newly created COmxContentPipeIf object
+
+ @return Newly created COmxContentPipeIf object
+ @param aImplementationUid UID of the ECOM plug-in
+*/
+inline COmxILContentPipeIf* COmxILContentPipeIf::CreateImplementationL(TUid aImplementationUid)
+ {
+ COmxILContentPipeIf* self = reinterpret_cast<COmxILContentPipeIf*>(REComSession::CreateImplementationL(aImplementationUid, _FOFF(COmxILContentPipeIf, iDestructorKey)));
+ return self;
+ }
+
+#endif // OMXILCONTENTPIPEIF_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/symbian_api/omxilcore_api/inc/omxilcontentpipeif.hrh Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,37 @@
+// 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:
+// Keep it as prototype until the end of Diran to allow time for the Symbian Content Pipe OMX IL v1.x solution to be exercised,
+// since we know this feature has recently been added to the standard and it is not yet in use.
+//
+//
+
+/**
+ @file
+ @publishedPartner
+ @prototype
+*/
+
+#ifndef OMXILCONTENTPIPEIF_HRH
+#define OMXILCONTENTPIPEIF_HRH
+
+// OpenMax IL Content Pipe Interface
+
+/**
+ This Macro defines the interface UID of an OpenMax IL content pipe.
+ All content pipes ECOM plugins must use this UID in their resource files.
+*/
+#define KUidOmxILContentPipeIf 0x102834BA
+
+#endif // OMXILCONTENTPIPEIF_HRH
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/symbian_api/omxilcore_api/inc/omxilloaderif.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,57 @@
+// 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
+ @released
+*/
+
+#ifndef OMXILLOADERIF_H
+#define OMXILLOADERIF_H
+
+#include <openmax/il/loader/OMX_Loader.h>
+#include <ecom/ecom.h>
+#include <ecom/implementationproxy.h>
+
+/**
+The COmxComponentLoaderIf class provides an interface to the Component Loader implementation.
+Component Loaders shall be installed as ECOM plug-ins implementing the COmxComponentLoaderIf
+to run under Symbian OMX IL Core.
+Symbian OMX IL Core creates a list of all the ECOM implementations of this Component Loader
+interface installed in the system.
+
+@see KUidOmxILLoaderInterface
+*/
+class COmxComponentLoaderIf : public CBase
+ {
+public:
+ inline virtual ~COmxComponentLoaderIf();
+ inline static COmxComponentLoaderIf* CreateImplementationL(TUid aUid);
+
+ /**
+ Gets the valid handle of the already populated OMX_LOADERTYPE structure.
+
+ @return The loader's handle
+ */
+ virtual OMX_HANDLETYPE Handle() = 0;
+
+private:
+ TUid iDestructorKey;
+ };
+
+#include <openmax/il/core/omxilloaderif.inl>
+
+#endif /*OMXILLOADERIF_H*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/symbian_api/omxilcore_api/inc/omxilloaderif.hrh Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,33 @@
+// 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
+ @released
+*/
+
+#ifndef OMXILLOADERIF_HRH
+#define OMXILLOADERIF_HRH
+
+
+/**
+Defines the numerical value for the Interface UID of an OpenMax IL Symbian Component Loader.
+All component loader ECOM plugins must use this interface UID in the REGISTRY_INFO of
+their resource files.
+*/
+#define KUidOmxILLoaderInterface 0x1028349D
+
+#endif // OMXILLOADERIF_HRH
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/symbian_api/omxilcore_api/inc/omxilloaderif.inl Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,37 @@
+// 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:
+// Destructor of this interface.
+//
+//
+
+inline COmxComponentLoaderIf::~COmxComponentLoaderIf()
+ {
+ REComSession::DestroyedImplementation(iDestructorKey);
+ }
+
+/**
+Static method to load the particular ECOM plugin specified by the implementation UID passed as a parameter.
+As part of the creation of this interface the actual OMX_LOADERTYPE structure should be allocated and populated.
+
+@param aUid
+ UID of the ECOM plug-in
+@return The pointer to the newly created COmxComponentLoaderIf object
+
+@see KUidOmxILLoaderInterface
+*/
+inline COmxComponentLoaderIf* COmxComponentLoaderIf::CreateImplementationL(TUid aUid)
+ {
+ COmxComponentLoaderIf* self = reinterpret_cast<COmxComponentLoaderIf*>(REComSession::CreateImplementationL(aUid, _FOFF(COmxComponentLoaderIf, iDestructorKey)));
+ return self;
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/symbian_api/omxilcore_api/inc/omxilsymbiancontentpipeif.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,114 @@
+// 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:
+// Keep it as prototype until the end of Diran to allow time for the Symbian Content Pipe OMX IL v1.x solution to be exercised,
+// since we know this feature has recently been added to the standard and it is not yet in use.
+//
+//
+
+/**
+ @file
+ @publishedPartner
+ @prototype
+*/
+
+#ifndef OMXILSYMBIANCONTENTPIPEIF_H
+#define OMXILSYMBIANCONTENTPIPEIF_H
+
+#include <openmax/il/core/omxilcontentpipeif.h>
+
+/**
+Bridge to allow content pipes to be loaded as ECOM plugins.
+
+@publishedPartner
+*/
+NONSHARABLE_CLASS(COmxILSymbianContentPipeIf) : private COmxILContentPipeIf
+ {
+public:
+ static COmxILSymbianContentPipeIf* NewL();
+ ~COmxILSymbianContentPipeIf();
+ TInt GetHandle(OMX_HANDLETYPE* aContentPipe);
+
+private:
+ COmxILSymbianContentPipeIf();
+
+private:
+ /** A handle to the CP_PIPETYPE structure */
+ CP_PIPETYPE* iHandle;
+ };
+
+/**
+ This Macro defines the ECOM plug-in entry point and must be used by the content pipe.
+
+ In order to allow a content pipe to be loaded as an ECOM plugin you must:
+ - Link the content pipe library against this component
+ - Declare the OMXIL_CONTENTPIPE_ECOM_ENTRYPOINT macro with the content pipe UID
+ - Implement the function "TInt ContentPipeInit(OMX_HANDLETYPE* aContentPipe)",
+ the content pipe entry point. This function initialises the CP_PIPETYPE structure
+ and returns it in its first argument. aContentPipe = Returns a pointer to the
+ content pipe handle. Must return KErrNone if successful, otherwise another
+ system-wide error code.
+ - Implement the function "TInt ContentPipeDeInit(OMX_HANDLETYPE aContentPipe)",
+ the content pipe exit point. This function deinitialises the CP_PIPETYPE structure
+ passed as the first argument. aContentPipe = A pointer to the content pipe handle
+ that will be deinitialised. Must return KErrNone if successful, otherwise another
+ system-wide error code.
+
+ @param aUid UID of the ECOM plug-in
+ @see ContentPipeInit
+ @see ContentPipeDeInit
+*/
+#define OMXIL_CONTENTPIPE_ECOM_ENTRYPOINT(aUid) \
+\
+const TImplementationProxy ImplementationTable[] = \
+ {\
+ IMPLEMENTATION_PROXY_ENTRY((aUid), COmxILSymbianContentPipeIf::NewL),\
+ };\
+\
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)\
+ {\
+ aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);\
+ return ImplementationTable;\
+ }
+
+/**
+ Although this is tagged as InternalAll it is effectively PublishedPartner, however
+ since it is not exported we are unable to tag it as such.
+ Any change to this function signature will be a PublishedPartner break.
+
+ Content pipe entry point
+ This function initialises the CP_PIPETYPE structure and returns it in its first argument
+
+ @return KErrNone if successful, otherwise another system-wide error code
+ @param aContentPipe Returns a pointer to the content pipe handle
+
+ @publishedPartner
+*/
+TInt ContentPipeInit(OMX_HANDLETYPE* aContentPipe);
+
+/**
+ Although this is tagged as InternalAll it is effectively PublishedPartner, however
+ since it is not exported we are unable to tag it as such.
+ Any change to this function signature will be a PublishedPartner break.
+
+ Content pipe exit point
+ This function deinitialises the CP_PIPETYPE structure passed as the first argument
+
+ @return KErrNone if successful, otherwise another system-wide error code
+ @param aContentPipe A pointer to the content pipe handle that will be deinitialised
+
+ @publishedPartner
+*/
+TInt ContentPipeDeInit(OMX_HANDLETYPE aContentPipe);
+
+#endif // OMXILSYMBIANCONTENTPIPEIF_H
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/symbian_api/omxilcore_api/inc/omxilsymbianloaderif.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,102 @@
+// 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
+ @released
+*/
+
+#ifndef OMXILSYMBIANLOADERIF_H
+#define OMXILSYMBIANLOADERIF_H
+
+#include <openmax/il/core/omxilloaderif.h>
+
+/**
+COmxSymbianLoaderIf is the Symbian implementation of the COmxComponentLoaderIf.
+The COmxComponentLoaderIf class provides an interface to the Component Loader implementation.
+Component Loaders shall be installed as ECOM plug-ins implementing the COmxComponentLoaderIf
+to run under Symbian OMX IL Core.
+
+@publishedPartner
+*/
+NONSHARABLE_CLASS( COmxSymbianLoaderIf ) : public COmxComponentLoaderIf
+ {
+public:
+ static COmxSymbianLoaderIf* NewL();
+ ~COmxSymbianLoaderIf();
+
+ // from COmxComponentLoaderIf
+ OMX_HANDLETYPE Handle();
+
+private:
+ void ConstructL();
+ COmxSymbianLoaderIf();
+
+private:
+ OMX_LOADERTYPE* iHandle;
+ };
+
+
+/**
+Macro to facilitate the entry in the ECOM's ImplementationTable of any new Component Loader ECOM implementation UID.
+
+To make easier the task of exposing Component Loaders as ECOM plug-ins, Symbian offers a static
+library that facilitates the mapping from the ECOM COmxComponentLoaderIf interface to non-ECOM
+implementations.
+The steps to wrap up a Component Loader as an ECOM plugin are:
+- Provide a .mmp project definition file specifying plugin as Targetype,
+- Link the Component Loader implementation against the omxilsymbianloaderif.lib static library.
+- Provide a .rss file with interface_uid = KUidOmxILLoaderInterface.
+- Declare the OMX_LOADER_ECOM_ENTRYPOINT macro with the particular implementation UID of the Loader.
+- Implement the function "OMX_ERRORTYPE OMX_LoaderSetup(OMX_HANDLETYPE aLoader)". This function
+is the entry point routine that Component Loaders have to implement to populate the actual structure
+represented by the handle passed as argument. aLoader = The handle to the OMX_LOADERTYPE structure
+to be populated. Must return an OpenMAX defined error, OMX_ErrorNone if successful.
+
+@param aUid UID of the ECOM plug-in
+@see KUidOmxILLoaderInterface
+@see OMX_LoaderSetup()
+*/
+#define OMX_LOADER_ECOM_ENTRYPOINT(aUid) \
+ \
+ const TImplementationProxy ImplementationTable[] = \
+ {\
+ IMPLEMENTATION_PROXY_ENTRY((aUid), COmxSymbianLoaderIf::NewL),\
+ };\
+ \
+ EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)\
+ {\
+ aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);\
+ return ImplementationTable;\
+ }
+
+/**
+Although this is tagged as InternalAll it is effectively PublishedPartner, however since it is not exported
+we are unable to tag it as such.
+Any change to this function signature will be a PublishedPartner break.
+
+Entry point routine that Component Loaders have to implement to populate the actual
+structure represented by the handle passed as argument.
+@param aLoader
+ The handle to the OMX_LOADERTYPE structure to be populated.
+@return An OpenMAX defined error. OMX_ErrorNone if successful.
+
+@publishedPartner
+*/
+OMX_ERRORTYPE OMX_LoaderSetup(OMX_HANDLETYPE aLoader);
+
+
+#endif /*OMXILSYMBIANLOADERIF_H*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/symbian_api/omxilloader_api/group/bld.inf Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,32 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+PRJ_EXPORTS
+
+
+//
+// OMX IL Loader Interface
+//
+
+// Symbian intend to push OMX_Loader.h to the OMX IL community. Hence export this
+// file in mixed case. Its name is listed in filenamepolicyexclusions.txt.
+../inc/OMX_Loader.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/loader/OMX_Loader.h)
+
+
+// OMX IL Component Interface
+../inc/omxilcomponentif.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/loader/omxilcomponentif.h)
+../inc/omxilcomponentif.hrh SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/loader/omxilcomponentif.hrh)
+../inc/omxilsymbiancomponentif.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/loader/omxilsymbiancomponentif.h)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/symbian_api/omxilloader_api/inc/OMX_Loader.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,208 @@
+// 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
+ @released
+*/
+
+#ifndef OMX_LOADER_H
+#define OMX_LOADER_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include <openmax/il/khronos/v1_x/OMX_Core.h>
+
+struct OMX_LOADERTYPE
+ {
+ /** The InitializeComponentLoader method is used to initialize the loader.
+ It shall be the first call made into the loader and it should only be executed once
+ until UnInitializeComponentLoader call is made.
+
+ @return OMX_ERRORTYPE
+ OMX_ErrorNone if the function is executed successfully,
+ OMX_ErrorInsufficientResources if the component loader fails to construct due to an
+ out of memory issue, OMX_ErrorUndefined or any other appropriate OMX error otherwise.
+ */
+ OMX_ERRORTYPE (*InitializeComponentLoader)(OMX_LOADERTYPE *loader);
+
+ /** The UnInitializeComponentLoader method is used to uninitialize the loader.
+ It shall be the last call made into the loader and should be called after all
+ OpenMAX-related resources have been released.
+
+ @return OMX_ERRORTYPE
+ It returns OMX_ErrorNone if the function is executed successfully
+ or any other appropriate OMX error otherwise.
+ */
+ OMX_ERRORTYPE (*UnInitializeComponentLoader)(OMX_LOADERTYPE *loader);
+
+ /** The LoadComponent method will locate the component specified by the
+ component name given, load that component into memory and then invoke
+ the component's methods to create an instance of the component.
+
+ @param [out] pHandle
+ pointer to an OMX_HANDLETYPE pointer to be filled in by this method.
+ @param [in] cComponentName
+ pointer to a null terminated string with the component name. The
+ names of the components are strings less than 127 bytes in length
+ plus the trailing null for a maximum size of 128 bytes. An example
+ of a valid component name is "OMX.TI.AUDIO.DSP.MIXER\0". Names are
+ assigned by the vendor, but shall start with "OMX." and then have
+ the Vendor designation next.
+ @param [in] pAppData
+ pointer to an application defined value that will be returned
+ during callbacks so that the application can identify the source
+ of the callback.
+ @param [in] pCallBacks
+ pointer to a OMX_CALLBACKTYPE structure that will be passed to the
+ component to initialize it with.
+ @return OMX_ERRORTYPE
+ It returns OMX_ErrorNone if the function is executed successfully
+ or any other appropriate OMX error otherwise.
+ */
+ OMX_ERRORTYPE (*LoadComponent)( OMX_LOADERTYPE *loader,
+ OMX_OUT OMX_HANDLETYPE* pHandle,
+ OMX_IN OMX_STRING cComponentName,
+ OMX_IN OMX_PTR pAppData,
+ OMX_IN OMX_CALLBACKTYPE* pCallBacks);
+
+
+ /** The UnloadComponent method will free a handle allocated by the LoadComponent
+ method.
+
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the GetHandle function.
+ @return OMX_ERRORTYPE
+ It returns OMX_ErrorNone if the function is executed successfully
+ OMX_ErrorComponentNotFound if the component is not found in this loader;
+ or any other appropriate OMX error otherwise.
+ */
+ OMX_ERRORTYPE (*UnloadComponent)( OMX_LOADERTYPE *loader,
+ OMX_HANDLETYPE hComponent);
+
+ /** The ComponentNameEnum method will enumerate through all the names of
+ recognised valid components in the system. This function is provided
+ as a means to detect all the components in the system run-time. There is
+ no strict ordering to the enumeration order of component names, although
+ each name will only be enumerated once. If the loader supports run-time
+ installation of new components, it is only requried to detect newly
+ installed components when the first call to enumerate component names
+ is made (i.e. when nIndex is 0x0).
+
+ @param [out] cComponentName
+ pointer to a null terminated string with the component name. The
+ names of the components are strings less than 127 bytes in length
+ plus the trailing null for a maximum size of 128 bytes. An example
+ of a valid component name is "OMX.TI.AUDIO.DSP.MIXER\0". Names are
+ assigned by the vendor, but shall start with "OMX." and then have
+ the Vendor designation next.
+ @param [in] nNameLength
+ number of characters in the cComponentName string. With all
+ component name strings restricted to less than 128 characters
+ (including the trailing null) it is recomended that the caller
+ provide a input string for the cComponentName of 128 characters.
+ @param [in] nIndex
+ number containing the enumeration index for the component.
+ Multiple calls to OMX_ComponentNameEnum with increasing values
+ of nIndex will enumerate through the component names in the
+ system until OMX_ErrorNoMore is returned. The value of nIndex
+ is 0 to (N-1), where N is the number of valid installed components
+ in the system.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. When the value of nIndex exceeds the number of
+ components in the system minus 1, OMX_ErrorNoMore will be
+ returned. Otherwise the appropriate OMX error will be returned.
+ */
+ OMX_ERRORTYPE (*ComponentNameEnum)( OMX_LOADERTYPE *loader,
+ OMX_OUT OMX_STRING cComponentName,
+ OMX_IN OMX_U32 nNameLength,
+ OMX_IN OMX_U32 nIndex);
+
+ /** The GetRolesOfComponent method will return the number of roles supported by the given
+ component and (if the roles field is non-NULL) the names of those roles. The call will fail if
+ an insufficiently sized array of names is supplied. To ensure the array is sufficiently sized the
+ client should:
+ * first call this function with the roles field NULL to determine the number of role names
+ * second call this function with the roles field pointing to an array of names allocated
+ according to the number returned by the first call.
+
+ @param [in] compName
+ This is the name of the component being queried about.
+ @param [inout] pNumRoles
+ This is used both as input and output.
+
+ If roles is NULL, the input is ignored and the output specifies how many roles the component supports.
+
+ If compNames is not NULL, on input it bounds the size of the input structure and
+ on output, it specifies the number of roles string names listed within the roles parameter.
+ @param [out] roles
+ If NULL this field is ignored. If non-NULL this points to an array of 128-byte strings
+ which accepts a list of the names of all standard components roles implemented on the
+ specified component name.
+ @return OMX_ERRORTYPE
+ It returns OMX_ErrorNone if the function is executed successfully
+ or any other appropriate OMX error otherwise.
+ */
+ OMX_ERRORTYPE (*GetRolesOfComponent)( OMX_LOADERTYPE *loader,
+ OMX_IN OMX_STRING compName,
+ OMX_INOUT OMX_U32 *pNumRoles,
+ OMX_OUT OMX_U8 **roles);
+
+ /** The GetComponentsOfRole method will return the number of components that support the given
+ role and (if the compNames field is non-NULL) the names of those components. The call will fail if
+ an insufficiently sized array of names is supplied. To ensure the array is sufficiently sized the
+ client should:
+ * first call this function with the compNames field NULL to determine the number of component names
+ * second call this function with the compNames field pointing to an array of names allocated
+ according to the number returned by the first call.
+
+ @param [in] role
+ This is generic standard component name consisting only of component class
+ name and the type within that class (e.g. 'audio_decoder.aac').
+ @param [inout] pNumComps
+ This is used both as input and output.
+
+ If compNames is NULL, the input is ignored and the output specifies how many components support
+ the given role.
+
+ If compNames is not NULL, on input it bounds the size of the input structure and
+ on output, it specifies the number of components string names listed within the compNames parameter.
+ @param [inout] compNames
+ If NULL this field is ignored. If non-NULL this points to an array of 128-byte strings which accepts
+ a list of the names of all physical components that implement the specified standard component name.
+ Each name is NULL terminated. numComps indicates the number of names.
+ @return OMX_ERRORTYPE
+ It returns OMX_ErrorNone if the function is executed successfully
+ or any other appropriate OMX error otherwise.
+ */
+ OMX_ERRORTYPE (*GetComponentsOfRole)( OMX_LOADERTYPE *loader,
+ OMX_IN OMX_STRING role,
+ OMX_INOUT OMX_U32 *pNumComps,
+ OMX_INOUT OMX_U8 **compNames);
+ OMX_PTR pLoaderPrivate;
+ };
+
+#define OMX_MAX_ROLESBUFFER_SIZE 256
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /*OMX_LOADER_H*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/symbian_api/omxilloader_api/inc/omxilcomponentif.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,81 @@
+// 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
+ @released
+*/
+
+#ifndef OMXILCOMPONENTIF_H
+#define OMXILCOMPONENTIF_H
+
+#include <ecom/ecom.h>
+#include <ecom/implementationproxy.h>
+#include <openmax/il/khronos/v1_x/OMX_Core.h>
+#include <openmax/il/khronos/v1_x/OMX_Component.h>
+
+/**
+The COmxILComponentIf class provides an interface to the OMX IL Component implementations.
+
+Symbian OS provides a Symbian Component Loader that manages OMX IL Components that are
+installed as ECOM plug-ins implementing the COmxILComponentIf. The Symbian Component Loader
+creates a list of all the ECOM implementations of this component interface (identified by
+the KUidOmxILSymbianComponentIf UID) installed in the system.
+
+@see KUidOmxILSymbianComponentIf
+*/
+class COmxILComponentIf : public CBase
+ {
+public:
+ ~COmxILComponentIf();
+ static COmxILComponentIf* CreateImplementationL(TUid aUid);
+
+ /**
+ Gets the valid handle of the already populated OMX_COMPONENTTYPE structure.
+
+ @return The component's handle
+ */
+ virtual OMX_HANDLETYPE Handle() = 0;
+
+private:
+
+ TUid iDestructorKey;
+ };
+
+/**
+Static method to load the particular ECOM plugin specified by the implementation UID passed as a parameter.
+As part of the creation of this interface the actual OMX_COMPONENTTYPE structure should be allocated and populated.
+
+@param aUid
+ UID of the ECOM plug-in
+@return The pointer to the newly created COmxILComponentIf object
+
+@see KUidOmxILSymbianComponentIf
+*/
+inline COmxILComponentIf* COmxILComponentIf::CreateImplementationL(TUid aImplementationUid)
+ {
+ COmxILComponentIf* self = reinterpret_cast<COmxILComponentIf*>( REComSession::CreateImplementationL( aImplementationUid, _FOFF(COmxILComponentIf, iDestructorKey)));
+ return self;
+ }
+
+/**
+Destructor of this interface.
+*/
+inline COmxILComponentIf::~COmxILComponentIf()
+ {
+ REComSession::DestroyedImplementation(iDestructorKey);
+ }
+#endif // OMXILCOMPONENTIF_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/symbian_api/omxilloader_api/inc/omxilcomponentif.hrh Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,32 @@
+// 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
+ @released
+*/
+
+#ifndef OMXILCOMPONENTIF_HRH
+#define OMXILCOMPONENTIF_HRH
+
+/**
+Defines the numerical value for the Interface UID of an OpenMax IL Symbian Component.
+All components to be loaded by the Symbian Component Loader should be ECOM plugins and must use
+this interface UID in the REGISTRY_INFO of their resource files.
+*/
+#define KUidOmxILSymbianComponentIf 0x10283497
+
+#endif // OMXILCOMPONENTIF_HRH
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/symbian_api/omxilloader_api/inc/omxilsymbiancomponentif.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,104 @@
+// 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
+ @released
+*/
+
+#ifndef OMXILSYMBIANCOMPONENTIF_H
+#define OMXILSYMBIANCOMPONENTIF_H
+
+#include <openmax/il/loader/omxilcomponentif.h>
+
+/**
+COmxILSymbianComponentIf is the Symbian implementation of the COmxILComponentIf.
+The COmxILComponentIf class provides an interface that the Symbian Component Loader uses to access
+Symbian OMX IL Components .
+
+
+@publishedPartner
+
+
+*/
+NONSHARABLE_CLASS(COmxILSymbianComponentIf) : private COmxILComponentIf
+ {
+public:
+ static COmxILSymbianComponentIf* NewL();
+ ~COmxILSymbianComponentIf();
+
+ // from COmxILComponentIf
+ OMX_HANDLETYPE Handle();
+
+private:
+ COmxILSymbianComponentIf();
+ void ConstructL();
+
+private:
+ OMX_COMPONENTTYPE* ipHandle;
+ };
+
+/**
+Macro to facilitate the entry in the ECOM's ImplementationTable of any new Component ECOM implementation UID.
+
+To make easier the task of exposing OMX IL Components as ECOM plug-ins, Symbian offers a static
+library that facilitates the mapping from the ECOM COmxILComponentIf interface to non-ECOM
+implementations.
+The steps to wrap up a Component as an ECOM plugin are:
+- Provide a .mmp project definition file specifying plugin as Targetype,
+- Link the Component implementation against the omxilcomponentif.lib static library.
+- Provide a .rss file with interface_uid = KUidOmxILSymbianComponentIf
+- Declare the OMXIL_COMPONENT_ECOM_ENTRYPOINT macro with the particular implementation UID of the Component.
+- Implement the function "OMX_ERRORTYPE OMX_ComponentInit(OMX_HANDLETYPE aComponent)". This function
+is the entry point routine that OMX IL Components have to implement to populate the actual structure
+represented by the handle passed as argument. aComponent = The handle to the OMX_COMPONENTTYPE
+structure to be populated. Must return an OpenMAX defined error, OMX_ErrorNone if successful.
+
+@param aUid UID of the ECOM plug-in
+@see KUidOmxILSymbianComponentIf
+@see OMX_ComponentInit()
+@see COmxComponentLoaderIf
+*/
+#define OMXIL_COMPONENT_ECOM_ENTRYPOINT(aUid) \
+\
+const TImplementationProxy ImplementationTable[] = \
+ {\
+ IMPLEMENTATION_PROXY_ENTRY((aUid), COmxILSymbianComponentIf::NewL),\
+ };\
+\
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)\
+ {\
+ aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);\
+ return ImplementationTable;\
+ }
+
+/**
+Although this is tagged as InternalAll it is effectively PublishedPartner, however
+since it is not exported we are unable to tag it as such.
+Any change to this function signature will be a PublishedPartner break.
+
+Entry point routine that OMX IL Components have to implement to populate the actual
+structure represented by the handle passed as argument.
+@param aComponent
+ The handle to the OMX_COMPONENTTYPE structure to be populated.
+@return An OpenMAX defined error. OMX_ErrorNone if successful.
+
+@publishedPartner
+*/
+OMX_ERRORTYPE OMX_ComponentInit(OMX_HANDLETYPE aComponent);
+
+
+#endif //OMXILSYMBIANCOMPONENTIF_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/symbian_api/shaiext_api/group/bld.inf Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,27 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+PRJ_EXPORTS
+
+//
+// SHAI extension headers
+//
+../inc/OMX_Symbian_AudioExt.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/shai/OMX_Symbian_AudioExt.h)
+../inc/OMX_Symbian_ComponentExt.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/shai/OMX_Symbian_ComponentExt.h)
+../inc/OMX_Symbian_CoreExt.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/shai/OMX_Symbian_CoreExt.h)
+../inc/OMX_Symbian_ExtensionNames.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/shai/OMX_Symbian_ExtensionNames.h)
+../inc/OMX_Symbian_IVCommonExt.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/shai/OMX_Symbian_IVCommonExt.h)
+../inc/OMX_Symbian_OtherExt.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/shai/OMX_Symbian_OtherExt.h)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/symbian_api/shaiext_api/inc/OMX_Symbian_AudioExt.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,1254 @@
+/*
+ OMX_Symbian_AudioExt.h
+
+ Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ All rights reserved.
+
+ This program and the accompanying materials are made available
+ under the terms of the Eclipse Public License v1.0 which accompanies
+ this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Initial Contributors:
+ Nokia Corporation - initial contribution.
+*/
+
+/** @file
+@brief Symbian OpenMAX IL Extension Data Structures in the Audio Domain.
+
+This file contains the extension structures for the Symbian IL extensions that
+pertain to audio components.
+
+@publishedDeviceAbstraction
+*/
+
+#ifndef OMX_Symbian_AudioExt_h
+#define OMX_Symbian_AudioExt_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/* Each OMX header must include all required header files to allow the
+ * header to compile without errors. The includes below are required
+ * for this header file to compile successfully
+ */
+#include <OMX_Types.h>
+#include <OMX_Audio.h>
+#include <OMX_Symbian_OtherExt.h>
+
+
+/** @name Generic Audio Control Definitions. */
+
+/*@{*/
+
+/** Simple effect enable/disable switch control.
+
+This struct can be used to control all effects that only require an on/off
+type of control.
+
+This data structure is currently used for:
+- Earpiece Active Noise Control (EANC) settings with extension string
+ "OMX.Symbian.Index.Config.Audio.EANC"
+- Algorithm for Preventing System Shutdown by Audio System (APSSAS) params
+ with extension string "OMX.Symbian.Index.Param.Audio.APSSAS".
+- Uplink algorithms configuration parameters with extension string
+ "OMX.Symbian.Index.Config.Audio.UplinkAlgorithms".
+- Downlink algorithms configuration parameters with extension string
+ "OMX.Symbian.Index.Config.Audio.DownlinkAlgorithms".
+- Automatic volume control configuration parameters with extension string
+ "OMX.Symbian.Index.Config.Audio.AutomaticVolumeControl".
+- Comfort noise generation configuration parameters with extension string
+ "OMX.Symbian.Index.Config.Audio.ComfortNoiseGeneration".
+- Multimicrophone noise control configuration parameters with extension string
+ "OMX.Symbian.Index.Config.Audio.MultiMicrophoneNoiseControl".
+- Transducer dynamic range control (DRC) configuration parameters with extension string
+ "OMX.Symbian.Index.Config.Audio.TransducerDRC".
+- Uplink level normalization configuration parameters with extension string
+ "OMX.Symbian.Index.Config.Audio.UplinkLevelNormalization".
+- Voice clarity configuration parameters with extension string
+ "OMX.Symbian.Index.Config.Audio.VoiceClarity".
+- Sidetone howling control configuration parameters with extension string
+ "OMX.Symbian.Index.Config.Audio.SidetoneHowlingControl"
+- Automatic gain control configuration parameters with extension string
+ "OMX.Symbian.Index.Config.Audio.AutomaticGainControl".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_EFFECTENABLETYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_BOOL bEnable; /**< enable (OMX_TRUE) or disable (OMX_FALSE) the effect */
+} OMX_SYMBIAN_AUDIO_CONFIG_EFFECTENABLETYPE;
+
+/*@}*/
+
+/** @name Audio Codecs Extensions */
+
+/*@{*/
+
+/** WMA params.
+
+The OMX_AUDIO_PARAM_WMAAVGBYTESTYPE structure is used to set or query
+the WMA codec related parameters. The setting can be changed using
+the OMX_SetParam() function, and the current state can be queried using
+the OMX_GetParam() function. When calling either function, the index
+specified for this structure is retrieved using OMX_GetExtensionIndex()
+with the extension string "OMX.Symbian.Index.Param.Audio.WMAAvgBytes".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_PARAM_WMAAVGBYTESTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nAvgBytesPerSec;
+} OMX_SYMBIAN_AUDIO_PARAM_WMAAVGBYTESTYPE;
+
+/** The version of the Windows Media Audio Pro codec */
+typedef enum OMX_SYMBIAN_AUDIO_WMAPROFORMATTYPE {
+ OMX_SYMBIAN_AUDIO_WMAPROFormatUnused, /**< The version of the Windows Media audio codec is
+ either not applicable or is unknown. */
+ OMX_SYMBIAN_AUDIO_WMAPROFormat9, /**< Windows Media Audio Pro version 9 */
+ OMX_SYMBIAN_AUDIO_WMAPROFormat10, /**< Windows Media Audio Pro version 10 */
+ OMX_SYMBIAN_AUDIO_WMAPROFormatMax = 0x7FFFFFFF
+} OMX_SYMBIAN_AUDIO_WMAPROFORMATTYPE;
+
+/** The profile of the Windows Media Audio Pro codec */
+typedef enum OMX_SYMBIAN_AUDIO_WMAPROPROFILETYPE {
+ OMX_SYMBIAN_AUDIO_WMAPROProfileUnused, /**< The profile of the Windows Media Audio Pro codec is
+ either not applicable or is unknown. */
+ OMX_SYMBIAN_AUDIO_WMAPROProfileM0, /**< Windows Media Audio Pro profile M0. */
+ OMX_SYMBIAN_AUDIO_WMAPROProfileM1, /**< Windows Media Audio Pro profile M1. */
+ OMX_SYMBIAN_AUDIO_WMAPROProfileM2, /**< Windows Media Audio Pro profile M2. */
+ OMX_SYMBIAN_AUDIO_WMAPROProfileM3, /**< Windows Media Audio Pro profile M3. */
+ OMX_SYMBIAN_AUDIO_WMAPROProfileMax = 0x7FFFFFFF
+} OMX_SYMBIAN_AUDIO_WMAPROPROFILETYPE;
+
+/** WMA Pro params.
+
+The OMX_SYMBIAN_AUDIO_PARAM_WMAPROTYPE structure is used to set or query
+the WMA pro codec related parameters. The setting can be changed using
+the OMX_SetParam() function, and the current state can be queried using
+the OMX_GetParam() function. When calling either function, the index
+specified for this structure is retrieved using OMX_GetExtensionIndex()
+with the extension string "OMX.Symbian.Index.Param.Audio.WMAPro".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_PARAM_WMAPROTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U16 nChannels; /**< Number of channels */
+ OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable
+ rate or unknown bit rates */
+ OMX_SYMBIAN_AUDIO_WMAPROFORMATTYPE eFormat; /**< The version of the Windows Media Audio Pro codec */
+ OMX_SYMBIAN_AUDIO_WMAPROPROFILETYPE eProfile; /**< The profile of the Windows Media Audio Pro codec */
+ OMX_U32 nSamplingRate; /**< Sampling rate of the source data. */
+ OMX_U32 nBlockAlign; /**< The block alignment, or block size (in bytes)
+ of the audio codec */
+ OMX_U32 nSuperBlockAlign; /**< WMA Type specific data. It is used only by encoder
+ and is don’t care for decoder. */
+ OMX_U32 nEncodeOptions; /**< WMA Type specific opaque data */
+ OMX_U32 nAdvancedEncodeOptions; /**< WMA pro specific opaque data (don’t care for others) */
+ OMX_U32 nAdvancedEncodeOptions2; /**< WMA pro LBR specific opaque data (don’t care for others) */
+ OMX_U32 nChannelMask; /**< Output channel configuration; used only when down mixing
+ is enabled. Channel mask for stereo down mix is 0x03. */
+} OMX_SYMBIAN_AUDIO_PARAM_WMAPROTYPE;
+
+/** AMR configs.
+
+The OMX_SYMBIAN_AUDIO_CONFIG_AMRMODETYPE structure is used to set or query
+the AMR codec related configurations. The setting can be changed using
+the OMX_SetConfig() function, and the current state can be queried using
+the OMX_GetConfig() function. When calling either function, the index
+specified for this structure is retrieved using OMX_GetExtensionIndex()
+with the extension string "OMX.Symbian.Index.Config.Audio.AMRMode".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_AMRMODETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_AUDIO_AMRBANDMODETYPE eAMRBandMode;
+} OMX_SYMBIAN_AUDIO_CONFIG_AMRMODETYPE;
+
+/** SBC configs.
+
+The OMX_SYMBIAN_AUDIO_CONFIG_SBCBITPOOLTYPE structure is used to set or query
+the SBC codec related configurations. The setting can be changed using
+the OMX_SetConfig() function, and the current state can be queried using
+the OMX_GetConfig() function. When calling either function, the index
+specified for this structure is retrieved using OMX_GetExtensionIndex()
+with the extension string "OMX.Symbian.Index.Config.Audio.SBCBitpool".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_SBCBITPOOLTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nNewBitPool;
+} OMX_SYMBIAN_AUDIO_CONFIG_SBCBITPOOLTYPE;
+
+/** iLBC params.
+
+The OMX_SYMBIAN_AUDIO_PARAM_ILBCTYPE structure is used to set or query
+the iLBC codec related parameters. The setting can be changed using
+the OMX_SetParam() function, and the current state can be queried using
+the OMX_GetParam() function. When calling either function, the index
+specified for this structure is retrieved using OMX_GetExtensionIndex()
+with the extension string "OMX.Symbian.Index.Param.Audio.ILBC".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_PARAM_ILBCTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nFrameLength;
+ OMX_BOOL bIsDTXCNGSupported;
+ OMX_BOOL bDTXCNGSelected;
+ OMX_BOOL bPLCSelected;
+} OMX_SYMBIAN_AUDIO_PARAM_ILBCTYPE;
+
+/** iLBC configs.
+
+The OMX_SYMBIAN_AUDIO_CONFIG_ILBCFRAMETYPE structure is used to set or query
+the iLBC codec related configurations. The setting can be changed using
+the OMX_SetConfig() function, and the current state can be queried using
+the OMX_GetConfig() function. When calling either function, the index
+specified for this structure is retrieved using OMX_GetExtensionIndex()
+with the extension string "OMX.Symbian.Index.Config.Audio.ILBCFrame".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_ILBCFRAMETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nFrameLength;
+} OMX_SYMBIAN_AUDIO_CONFIG_ILBCFRAMETYPE;
+
+/** G.711 params.
+
+The OMX_SYMBIAN_AUDIO_PARAM_G711TYPE structure is used to set or query
+the G.711 codec related parameters. The setting can be changed using
+the OMX_SetParam() function, and the current state can be queried using
+the OMX_GetParam() function. When calling either function, the index
+specified for this structure is retrieved using OMX_GetExtensionIndex()
+with the extension string "OMX.Symbian.Index.Param.Audio.G711".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_PARAM_G711TYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bIsDTXCNGSupported;
+ OMX_BOOL bIsPLCSupported;
+ OMX_BOOL bDTXCNGEnabled;
+ OMX_BOOL bPLCEnabled;
+ OMX_U32 nFrameLength;
+} OMX_SYMBIAN_AUDIO_PARAM_G711TYPE;
+
+/*@}*/
+
+/** @name Audio Capture Extensions */
+
+/*@{*/
+
+/*@}*/
+
+/** @name Audio Rendering Extensions */
+
+/*@{*/
+
+/** Mixer port pause config.
+
+The OMX_SYMBIAN_AUDIO_CONFIG_PORTPAUSETYPE structure is used to set or query
+the mixer/splitter related configurations. The setting can be changed using
+the OMX_SetConfig() function, and the current state can be queried using
+the OMX_GetConfig() function. When calling either function, the index
+specified for this structure is retrieved using OMX_GetExtensionIndex()
+with the extension string "OMX.Symbian.Index.Config.Audio.PortPause".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_PORTPAUSETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bIsPaused;
+} OMX_SYMBIAN_AUDIO_CONFIG_PORTPAUSETYPE;
+
+/** Mixer port synchronized param.
+
+The OMX_SYMBIAN_AUDIO_PARAM_SYNCHRONIZEDTYPE structure is used to set or query
+the mixer/splitter related parameters. The setting can be changed using
+the OMX_SetParam() function, and the current state can be queried using
+the OMX_GetParam() function. When calling either function, the index
+specified for this structure is retrieved using OMX_GetExtensionIndex()
+with the extension string "OMX.Symbian.Index.Param.Audio.Synchronized".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_PARAM_SYNCHRONIZEDTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bIsSynchronized;
+} OMX_SYMBIAN_AUDIO_PARAM_SYNCHRONIZEDTYPE;
+
+/** Output transducer setting for 3D. */
+typedef enum OMX_SYMBIAN_AUDIO_3DOUTPUTTYPE {
+ OMX_SYMBIAN_AUDIO_3DOutputHeadphones, /**< Positional 3D audio for headphones */
+ OMX_SYMBIAN_AUDIO_3DOutputLoudspeakers, /**< Positional 3D audio for two closely spaced loudspeakers */
+ OMX_SYMBIAN_AUDIO_3DOutputMax = 0x7FFFFFFF
+} OMX_SYMBIAN_AUDIO_3DOUTPUTTYPE;
+
+/** Output transducer setting for 3D.
+
+The OMX_SYMBIAN_AUDIO_CONFIG_3DOUTPUTTYPE structure is used to set or query
+the 3D mixer related configurations. The setting can be changed using
+the OMX_SetConfig() function, and the current state can be queried using
+the OMX_GetConfig() function. When calling either function, the index
+specified for this structure is retrieved using OMX_GetExtensionIndex()
+with the extension string "OMX.Symbian.Index.Config.Audio.3DOutput".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_3DOUTPUTTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_SYMBIAN_AUDIO_3DOUTPUTTYPE e3DOutputType;
+} OMX_SYMBIAN_AUDIO_CONFIG_3DOUTPUTTYPE;
+
+/** 3D location setting.
+
+The OMX_SYMBIAN_AUDIO_CONFIG_3DLOCATIONTYPE structure is used to set or query
+the 3D mixer related configurations. The setting can be changed using
+the OMX_SetConfig() function, and the current state can be queried using
+the OMX_GetConfig() function. When calling either function, the index
+specified for this structure is retrieved using OMX_GetExtensionIndex()
+with the extension string "OMX.Symbian.Index.Config.Audio.3DLocation".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_3DLOCATIONTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_S32 nX;
+ OMX_S32 nY;
+ OMX_S32 nZ;
+} OMX_SYMBIAN_AUDIO_CONFIG_3DLOCATIONTYPE;
+
+/** Doppler effect mode for 3D.
+
+The OMX_SYMBIAN_AUDIO_PARAM_3DDOPPLERMODETYPE structure is used to set or query
+the 3D mixer related parameters. The setting can be changed using
+the OMX_SetParam() function, and the current state can be queried using
+the OMX_GetParam() function. When calling either function, the index
+specified for this structure is retrieved using OMX_GetExtensionIndex()
+with the extension string "OMX.Symbian.Index.Param.Audio.3DDopplerMode".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_PARAM_3DDOPPLERMODETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bEnabled;
+} OMX_SYMBIAN_AUDIO_PARAM_3DDOPPLERMODETYPE;
+
+/** Doppler effect settings.
+
+The OMX_SYMBIAN_AUDIO_CONFIG_3DDOPPLERSETTINGSTYPE structure is used to set or query
+the 3D mixer related configurations. The setting can be changed using
+the OMX_SetConfig() function, and the current state can be queried using
+the OMX_GetConfig() function. When calling either function, the index
+specified for this structure is retrieved using OMX_GetExtensionIndex()
+with the extension string "OMX.Symbian.Index.Config.Audio.3DDopplerSettings".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_3DDOPPLERSETTINGSTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nSoundSpeed;
+ OMX_S32 nSourceVelocity;
+ OMX_S32 nListenerVelocity;
+} OMX_SYMBIAN_AUDIO_CONFIG_3DDOPPLERSETTINGSTYPE;
+
+/** 3D mixer level settings.
+
+The OMX_SYMBIAN_AUDIO_CONFIG_3DLEVELSTYPE structure is used to set or query
+the 3D mixer related configurations. The setting can be changed using
+the OMX_SetConfig() function, and the current state can be queried using
+the OMX_GetConfig() function. When calling either function, the index
+specified for this structure is retrieved using OMX_GetExtensionIndex()
+with the extension string "OMX.Symbian.Index.Config.Audio.3DLevels".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_3DLEVELSTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BS32 sDirectLevel;
+ OMX_BS32 sRoomLevel;
+} OMX_SYMBIAN_AUDIO_CONFIG_3DLEVELSTYPE;
+
+/** Distance attenuation roll-off model setting for 3D. */
+typedef enum OMX_SYMBIAN_AUDIO_ROLLOFFMODELTYPE {
+ OMX_SYMBIAN_AUDIO_RollOffExponential,
+ OMX_SYMBIAN_AUDIO_RollOffLinear,
+ OMX_SYMBIAN_AUDIO_RollOffMax = 0x7FFFFFFF
+} OMX_SYMBIAN_AUDIO_ROLLOFFMODELTYPE;
+
+/** 3D mixer distance attenuation.
+
+The OMX_SYMBIAN_AUDIO_CONFIG_3DDISTANCEATTENUATIONTYPE structure is used to set or query
+the 3D mixer related configurations. The setting can be changed using
+the OMX_SetConfig() function, and the current state can be queried using
+the OMX_GetConfig() function. When calling either function, the index
+specified for this structure is retrieved using OMX_GetExtensionIndex()
+with the extension string "OMX.Symbian.Index.Config.Audio.3DDistanceAttenuation".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_3DDISTANCEATTENUATIONTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BS32 sMinDistance;
+ OMX_BS32 sMaxDistance;
+ OMX_BS32 sRollOffFactor;
+ OMX_BS32 sRoomRollOffFactor;
+ OMX_SYMBIAN_AUDIO_ROLLOFFMODELTYPE eRollOffModel;
+ OMX_BOOL bMuteAfterMax;
+} OMX_SYMBIAN_AUDIO_CONFIG_3DDISTANCEATTENUATIONTYPE;
+
+/** 3D mixer directivity settings.
+
+The OMX_SYMBIAN_AUDIO_CONFIG_3DDIRECTIVITYSETTINGSTYPE structure is used to set or query
+the 3D mixer related configurations. The setting can be changed using
+the OMX_SetConfig() function, and the current state can be queried using
+the OMX_GetConfig() function. When calling either function, the index
+specified for this structure is retrieved using OMX_GetExtensionIndex()
+with the extension string "OMX.Symbian.Index.Config.Audio.3DDirectivitySettings".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_3DDIRECTIVITYSETTINGSTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BS32 sInnerAngle;
+ OMX_BS32 sOuterAngle;
+ OMX_BS32 sOuterLevel;
+} OMX_SYMBIAN_AUDIO_CONFIG_3DDIRECTIVITYSETTINGSTYPE;
+
+/** 3D mixer orientation setting for the directivity effect.
+
+The OMX_SYMBIAN_AUDIO_CONFIG_3DDIRECTIVITYORIENTATIONTYPE structure is used to set or query
+the 3D mixer related configurations. The setting can be changed using
+the OMX_SetConfig() function, and the current state can be queried using
+the OMX_GetConfig() function. When calling either function, the index
+specified for this structure is retrieved using OMX_GetExtensionIndex()
+with the extension string "OMX.Symbian.Index.Config.Audio.3DDirectivityOrientation".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_3DDIRECTIVITYORIENTATIONTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_S32 nXFront;
+ OMX_S32 nYFront;
+ OMX_S32 nZFront;
+} OMX_SYMBIAN_AUDIO_CONFIG_3DDIRECTIVITYORIENTATIONTYPE;
+
+/** 3D mixer orientation setting for the macroscopic effect.
+
+The OMX_SYMBIAN_AUDIO_CONFIG_3DMACROSCOPICORIENTATIONTYPE structure is used to set or query
+the 3D mixer related configurations. The setting can be changed using
+the OMX_SetConfig() function, and the current state can be queried using
+the OMX_GetConfig() function. When calling either function, the index
+specified for this structure is retrieved using OMX_GetExtensionIndex()
+with the extension string "OMX.Symbian.Index.Config.Audio.3DMacroscopicOrientation".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_3DMACROSCOPICORIENTATIONTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_S32 nXFront;
+ OMX_S32 nYFront;
+ OMX_S32 nZFront;
+ OMX_S32 nXAbove;
+ OMX_S32 nYAbove;
+ OMX_S32 nZAbove;
+} OMX_SYMBIAN_AUDIO_CONFIG_3DMACROSCOPICORIENTATIONTYPE;
+
+/** 3D mixer macroscopic effect size setting.
+
+The OMX_SYMBIAN_AUDIO_CONFIG_3DMACROSCOPICSIZETYPE structure is used to set or query
+the 3D mixer related configurations. The setting can be changed using
+the OMX_SetConfig() function, and the current state can be queried using
+the OMX_GetConfig() function. When calling either function, the index
+specified for this structure is retrieved using OMX_GetExtensionIndex()
+with the extension string "OMX.Symbian.Index.Config.Audio.3DMacroscopicSize".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_3DMACROSCOPICSIZETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_S32 nWidth;
+ OMX_S32 nHeight;
+ OMX_S32 nDepth;
+} OMX_SYMBIAN_AUDIO_CONFIG_3DMACROSCOPICSIZETYPE;
+
+
+
+/** Audio virtualizer transducer type */
+typedef enum OMX_SYMBIAN_AUDIO_VIRTUALIZERTYPE {
+ OMX_SYMBIAN_AUDIO_VirtualizerLoudspeakers, /**< Loudspeakers */
+ OMX_SYMBIAN_AUDIO_VirtualizerHeadphones, /**< Headphones */
+ OMX_SYMBIAN_AUDIO_VirtualizerMax = 0x7FFFFFFF
+} OMX_SYMBIAN_AUDIO_VIRTUALIZERTYPE;
+
+/** Virtualizer mode setting.
+
+The OMX_SYMBIAN_AUDIO_CONFIG_VIRTUALIZERTYPE structure is used to set or query
+the Virtualizer related configurations. The setting can be changed using
+the OMX_SetConfig() function, and the current state can be queried using
+the OMX_GetConfig() function. When calling either function, the index
+specified for this structure is retrieved using OMX_GetExtensionIndex()
+with the extension string "OMX.Symbian.Index.Config.Audio.Virtualizer".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_VIRTUALIZERTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bEnable;
+ OMX_SYMBIAN_AUDIO_VIRTUALIZERTYPE eVirtualizationType;
+ OMX_U32 nVirtualizationStrength;
+} OMX_SYMBIAN_AUDIO_CONFIG_VIRTUALIZERTYPE;
+
+/** Virtualizer loudspeaker angle setting.
+
+The OMX_SYMBIAN_AUDIO_CONFIG_VIRTUALIZERLOUDSPEAKERTYPE structure is used to set or query
+the Virtualizer related configurations. The setting can be changed using
+the OMX_SetConfig() function, and the current state can be queried using
+the OMX_GetConfig() function. When calling either function, the index
+specified for this structure is retrieved using OMX_GetExtensionIndex()
+with the extension string "OMX.Symbian.Index.Config.Audio.VirtualizerLoudspeaker".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_VIRTUALIZERLOUDSPEAKERTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nListeningAngle;
+} OMX_SYMBIAN_AUDIO_CONFIG_VIRTUALIZERLOUDSPEAKERTYPE;
+
+/** Audio visualizer mode type */
+typedef enum OMX_SYMBIAN_AUDIO_VISUALIZATIONTYPE {
+ OMX_SYMBIAN_AUDIO_VisualizationPresetNone,
+ OMX_SYMBIAN_AUDIO_VisualizationPresetWaveform,
+ OMX_SYMBIAN_AUDIO_VisualizationPresetSpectrum,
+ OMX_SYMBIAN_AUDIO_VisualizationPresetWaveformAndSpectrum,
+ OMX_SYMBIAN_AUDIO_VisualizationPresetMax = 0x7FFFFFFF
+} OMX_SYMBIAN_AUDIO_VISUALIZATIONTYPE;
+
+/** Audio visualizer mode setting.
+
+The OMX_SYMBIAN_AUDIO_CONFIG_VISUALIZATIONTYPE structure is used to set or query
+the Audio visualizer related configurations. The setting can be changed using
+the OMX_SetConfig() function, and the current state can be queried using
+the OMX_GetConfig() function. When calling either function, the index
+specified for this structure is retrieved using OMX_GetExtensionIndex()
+with the extension string "OMX.Symbian.Index.Config.Audio.Visualization".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_VISUALIZATIONTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bEnable;
+ OMX_SYMBIAN_AUDIO_VISUALIZATIONTYPE ePreset;
+ OMX_BU32 sRate;
+} OMX_SYMBIAN_AUDIO_CONFIG_VISUALIZATIONTYPE;
+
+/** Audio visualizer settings for the spectral mode.
+
+The OMX_SYMBIAN_AUDIO_CONFIG_VISUALIZATIONSPECTRALTYPE structure is used to set or query
+the Audio visualizer related configurations. The setting can be changed using
+the OMX_SetConfig() function, and the current state can be queried using
+the OMX_GetConfig() function. When calling either function, the index
+specified for this structure is retrieved using OMX_GetExtensionIndex()
+with the extension string "OMX.Symbian.Index.Config.Audio.VisualizationSpectral".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_VISUALIZATIONSPECTRALTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BU32 sBandIndex;
+ OMX_BU32 sCenterFreq;
+ OMX_U32 nType;
+} OMX_SYMBIAN_AUDIO_CONFIG_VISUALIZATIONSPECTRALTYPE;
+
+/** Audio visualizer settings for the waveform mode.
+
+The OMX_SYMBIAN_AUDIO_CONFIG_VISUALIZATIONWAVEFORMTYPE structure is used to set or query
+the Audio visualizer related configurations. The setting can be changed using
+the OMX_SetConfig() function, and the current state can be queried using
+the OMX_GetConfig() function. When calling either function, the index
+specified for this structure is retrieved using OMX_GetExtensionIndex()
+with the extension string "OMX.Symbian.Index.Config.Audio.VisualizationWaveform".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_VISUALIZATIONWAVEFORMTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BU32 sWaveformLength;
+} OMX_SYMBIAN_AUDIO_CONFIG_VISUALIZATIONWAVEFORMTYPE;
+
+/*@}*/
+
+/** @name Audio Transducer Processing Extensions */
+
+/*@{*/
+
+/** Equalizer filter type */
+typedef enum OMX_SYMBIAN_AUDIO_FILTERTYPE {
+ OMX_SYMBIAN_AUDIO_FilterNotDefined,
+ OMX_SYMBIAN_AUDIO_FilterPeaking,
+ OMX_SYMBIAN_AUDIO_FilterLowpass,
+ OMX_SYMBIAN_AUDIO_FilterHighpass,
+ OMX_SYMBIAN_AUDIO_FilterLowshelf,
+ OMX_SYMBIAN_AUDIO_FilterHighshelf,
+ OMX_SYMBIAN_AUDIO_FilterMax = 0x7FFFFFFF
+} OMX_SYMBIAN_AUDIO_FILTERTYPE;
+
+/** IIR Transducer EQ settings.
+
+The OMX_SYMBIAN_AUDIO_CONFIG_IIREQUALIZERTYPE structure is used to set or query
+the Transducer EQ related configurations. The setting can be changed using
+the OMX_SetConfig() function, and the current state can be queried using
+the OMX_GetConfig() function. When calling either function, the index
+specified for this structure is retrieved using OMX_GetExtensionIndex()
+with the extension string "OMX.Symbian.Index.Config.Audio.IIREqualizer".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_IIREQTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nChannel;
+ OMX_BU32 sBandIndex ;
+ OMX_SYMBIAN_AUDIO_FILTERTYPE eFilterType;
+ OMX_U32 nFilterCenterCutoffFrequency;
+ OMX_S32 nFilterGain;
+ OMX_U32 nFilterBandwidth;
+} OMX_SYMBIAN_AUDIO_CONFIG_IIREQTYPE;
+
+
+/** The maximum number of frequency response points for the FIR EQ */
+#define OMX_SYMBIAN_AUDIO_MAX_FIR_RESPONSE_POINTS 100
+
+/** FIR Transducer EQ configs.
+
+The OMX_SYMBIAN_AUDIO_CONFIG_FIRRESPONSETYPE structure is used to set or query
+the Transducer EQ related configurations. The setting can be changed using
+the OMX_SetConfig() function, and the current state can be queried using
+the OMX_GetConfig() function. When calling either function, the index
+specified for this structure is retrieved using OMX_GetExtensionIndex()
+with the extension string "OMX.Symbian.Index.Config.Audio.FIRResponse".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_FIRRESPONSETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nChannel;
+ OMX_U32 nFrequencyPoints;
+ OMX_S32 nFrequencies[OMX_SYMBIAN_AUDIO_MAX_FIR_RESPONSE_POINTS];
+ OMX_S32 nGains[OMX_SYMBIAN_AUDIO_MAX_FIR_RESPONSE_POINTS];
+} OMX_SYMBIAN_AUDIO_CONFIG_FIRRESPONSETYPE;
+
+/** Phase response enum */
+typedef enum OMX_SYMBIAN_AUDIO_PHASERESPONSETYPE {
+ OMX_SYMBIAN_AUDIO_PhaseNotDefined,
+ OMX_SYMBIAN_AUDIO_LinearPhase,
+ OMX_SYMBIAN_AUDIO_MinimumPhase,
+} OMX_SYMBIAN_AUDIO_PHASERESPONSETYPE;
+
+/** Transducer EQ main settings.
+
+The OMX_SYMBIAN_AUDIO_CONFIG_TRANSDUCEREQUALIZERTYPE structure is used to set or query
+the Transducer EQ related configurations. The setting can be changed using
+the OMX_SetConfig() function, and the current state can be queried using
+the OMX_GetConfig() function. When calling either function, the index
+specified for this structure is retrieved using OMX_GetExtensionIndex()
+with the extension string "OMX.Symbian.Index.Config.Audio.TransducerEqualizer".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_TRANSDUCEREQUALIZERTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bEnableFir;
+ OMX_BOOL bEnableIir;
+ OMX_U32 nChannel;
+ OMX_SYMBIAN_AUDIO_PHASERESPONSETYPE ePhaseResponseTargetFir;
+ OMX_SYMBIAN_AUDIO_PHASERESPONSETYPE ePhaseResponseTargetIir;
+ OMX_U32 nIIREqualizerBlocks;
+ OMX_U32 nIIREqualizerGain;
+} OMX_SYMBIAN_AUDIO_CONFIG_TRANSDUCEREQUALIZERTYPE;
+
+/** Multi-band DRC settings.
+
+The OMX_SYMBIAN_AUDIO_CONFIG_MDRCTYPE structure is used to set or query
+the MDRC related configurations. The setting can be changed using
+the OMX_SetConfig() function, and the current state can be queried using
+the OMX_GetConfig() function. When calling either function, the index
+specified for this structure is retrieved using OMX_GetExtensionIndex()
+with the extension string "OMX.Symbian.Index.Config.Audio.MDRC".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_MDRCTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nChannel;
+ OMX_BOOL bEnable;
+ OMX_BU32 sBandIndex;
+ OMX_BU32 sBandRange;
+ OMX_BU32 sBandLevel;
+ OMX_BU32 sKneePoints;
+ OMX_U32 nDynamicResponse[10][2];
+ OMX_BU32 sAttackTime;
+ OMX_BU32 sReleaseTime;
+} OMX_SYMBIAN_AUDIO_CONFIG_MDRCTYPE;
+
+/** Transducer protection settings.
+
+The OMX_SYMBIAN_AUDIO_CONFIG_LSPROTECTIONTYPE structure is used to set or query
+the Transducer protection related configurations. The setting can be changed using
+the OMX_SetConfig() function, and the current state can be queried using
+the OMX_GetConfig() function. When calling either function, the index
+specified for this structure is retrieved using OMX_GetExtensionIndex()
+with the extension string "OMX.Symbian.Index.Config.Audio.LSProtection".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_LSPROTECTIONTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_AUDIO_CHANNELTYPE eChannel;
+ OMX_BOOL bEnable;
+} OMX_SYMBIAN_AUDIO_CONFIG_LSPROTECTIONTYPE;
+
+/** Transducer SPL limiting mode*/
+typedef enum OMX_SYMBIAN_AUDIO_SPLLIMITTYPE {
+ OMX_SYMBIAN_AUDIO_SPLLimitation,
+ OMX_SYMBIAN_AUDIO_SPLNormalization,
+ OMX_SYMBIAN_AUDIO_SPLMax = 0x7FFFFFFF
+} OMX_SYMBIAN_AUDIO_SPLLIMITTYPE;
+
+/** SPL Limiter configs.
+
+The OMX_SYMBIAN_AUDIO_CONFIG_SPLLIMITTYPE structure is used to set or query
+the SPL Limiter related configurations. The setting can be changed using
+the OMX_SetConfig() function, and the current state can be queried using
+the OMX_GetConfig() function. When calling either function, the index
+specified for this structure is retrieved using OMX_GetExtensionIndex()
+with the extension string "OMX.Symbian.Index.Config.Audio.SPLLimit".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_SPLLIMITTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bEnable;
+ OMX_SYMBIAN_AUDIO_SPLLIMITTYPE eMode;
+ OMX_S32 nSplLimit;
+ OMX_S32 nGain;
+} OMX_SYMBIAN_AUDIO_CONFIG_SPLLIMITTYPE;
+
+/** Click Removal settings.
+
+The OMX_SYMBIAN_AUDIO_CONFIG_CLICKREMOVALTYPE structure is used to set or query
+the Click Removal related configurations. The setting can be changed using
+the OMX_SetConfig() function, and the current state can be queried using
+the OMX_GetConfig() function. When calling either function, the index
+specified for this structure is retrieved using OMX_GetExtensionIndex()
+with the extension string "OMX.Symbian.Index.Config.Audio.ClickRemoval".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_CLICKREMOVALTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bEnable;
+ OMX_BU32 sClickControl;
+} OMX_SYMBIAN_AUDIO_CONFIG_CLICKREMOVALTYPE;
+
+/** APSSAS configs.
+
+The OMX_SYMBIAN_AUDIO_CONFIG_BATTERYVOLTAGETYPE structure is used to set or query
+the APSSAS related configurations. The setting can be changed using
+the OMX_SetConfig() function, and the current state can be queried using
+the OMX_GetConfig() function. When calling either function, the index
+specified for this structure is retrieved using OMX_GetExtensionIndex()
+with the extension string "OMX.Symbian.Index.Config.Audio.BatteryVoltage".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_BATTERYVOLTAGETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nBattVol;
+} OMX_SYMBIAN_AUDIO_CONFIG_BATTERYVOLTAGETYPE;
+
+/*@}*/
+
+/** HDMI related configuration structure. */
+typedef struct OMX_SYMBIAN_AUDIO_PARAM_HDMITYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nSubFrameSize;
+ OMX_U32 nVaildBitsPerSample;
+ OMX_U32 nQFormat;
+} OMX_SYMBIAN_AUDIO_PARAM_HDMITYPE;
+
+
+/** Tone generation mode enum. */
+typedef enum OMX_SYMBIAN_AUDIO_TONEGENTONETYPE {
+ OMX_SYMBIAN_AUDIO_TonegenNormal, /**< Normal Tone */
+ OMX_SYMBIAN_AUDIO_TonegenDtmf, /**< DTMF Tone */
+ OMX_SYMBIAN_AUDIO_TonegenMax = 0x7FFFFFFF
+} OMX_SYMBIAN_AUDIO_TONEGENTONETYPE;
+
+/** Tone generator configs.
+
+The OMX_SYMBIAN_AUDIO_CONFIG_TONEGENERATORTYPE structure is used to set or query
+the Tone generator related configurations. The setting can be changed using
+the OMX_SetConfig() function, and the current state can be queried using
+the OMX_GetConfig() function. When calling either function, the index
+specified for this structure is retrieved using OMX_GetExtensionIndex()
+with the extension string "OMX.Symbian.Index.Config.Audio.ToneGenerator".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_TONEGENERATORTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bEnable;
+ OMX_SYMBIAN_AUDIO_TONEGENTONETYPE eTonetype;
+ OMX_U32 nFrequency[2];
+ OMX_U32 nDigit;
+} OMX_SYMBIAN_AUDIO_CONFIG_TONEGENERATORTYPE;
+
+/*@}*/
+
+/** @name Audio Telephony Extensions */
+
+/*@{*/
+
+/** Speech decoder status information.
+
+The index specified for this structure is retrieved using
+OMX_GetExtensionIndex() with the extension string
+"OMX.Symbian.Index.Config.Audio.DecoderStatus".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_DECODERSTATUSTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion ;
+ OMX_AUDIO_CODINGTYPE nCoding;
+ OMX_U32 nBitrate;
+} OMX_SYMBIAN_AUDIO_CONFIG_DECODERSTATUSTYPE;
+
+/** Speech encoder status information.
+
+The index specified for this structure is retrieved using
+OMX_GetExtensionIndex() with the extension string
+"OMX.Symbian.Index.Config.Audio.EncoderStatus".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_ENCODERSTATUSTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion ;
+ OMX_AUDIO_CODINGTYPE nCoding;
+ OMX_U32 nBitrate;
+ OMX_BOOL bDtx;
+ OMX_BOOL bAudioActivityControl;
+ OMX_BOOL bNsync;
+} OMX_SYMBIAN_AUDIO_CONFIG_ENCODERSTATUSTYPE;
+
+/** Uplink timing control.
+
+The index specified for this structure is retrieved using
+OMX_GetExtensionIndex() with the extension string
+"OMX.Symbian.Index.Config.Audio.UplinkTiming".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_UPLINKTIMINGTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nDeliveryTime;
+ OMX_U32 nModemProcessingTime;
+} OMX_SYMBIAN_AUDIO_CONFIG_UPLINKTIMINGTYPE;
+
+/** RF-TX Power information.
+
+The index specified for this structure is retrieved using
+OMX_GetExtensionIndex() with the extension string
+"OMX.Symbian.Index.Config.Audio.RFTxPower".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_RFTXPOWERTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPower;
+ OMX_U32 nTime;
+} OMX_SYMBIAN_AUDIO_CONFIG_RFTXPOWERTYPE;
+
+/** Uplink timing information.
+
+The index specified for this structure is retrieved using
+OMX_GetExtensionIndex() with the extension string
+"OMX.Symbian.Index.Config.Audio.UplinkTimingInfo".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_UPLINKTIMINGINFOTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_S32 nMaxTime;
+ OMX_S32 nAverageTime;
+ OMX_S32 nMinTime;
+} OMX_SYMBIAN_AUDIO_CONFIG_UPLINKTIMINGINFOTYPE;
+
+/** Uplink delay information.
+
+The index specified for this structure is retrieved using
+OMX_GetExtensionIndex() with the extension string
+"OMX.Symbian.Index.Config.Audio.UplinkDelayInfo".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_UPLINKDELAYINFOTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_S32 nMaxDelay;
+ OMX_S32 nAverageDelay;
+ OMX_S32 nMinDelay;
+} OMX_SYMBIAN_AUDIO_CONFIG_UPLINKDELAYINFOTYPE;
+
+/** Acoustic echo control configuration parameters.
+
+The index specified for this structure is retrieved using
+OMX_GetExtensionIndex() with the extension string
+"OMX.Symbian.Index.Config.Audio.AcousticEchoControl".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_ACOUSTICECHOCONTROLTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bEnable;
+ OMX_S32 sEchoGain;
+ OMX_U32 nEchoMinDelay;
+ OMX_U32 nEchoMaxDelay;
+} OMX_SYMBIAN_AUDIO_CONFIG_ACOUSTICECHOCONTROLTYPE;
+
+/** Artificial bandwidth expansion configuration parameters.
+
+The index specified for this structure is retrieved using
+OMX_GetExtensionIndex() with the extension string
+"OMX.Symbian.Index.Config.Audio.BandwidthExpansion".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_BANDWIDTHEXPANSIONTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bEnable;
+ OMX_BU32 nStrength;
+} OMX_SYMBIAN_AUDIO_CONFIG_BANDWIDTHEXPANSIONTYPE;
+
+/** Background noise control configuration parameters.
+
+The index specified for this structure is retrieved using
+OMX_GetExtensionIndex() with the extension string
+"OMX.Symbian.Index.Config.Audio.BackgroundNoiseControl".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_BACKGROUNDNOISECONTROLTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bEnable;
+ OMX_BU32 nAttenuation;
+} OMX_SYMBIAN_AUDIO_CONFIG_BACKGROUNDNOISECONTROLTYPE;
+
+/** Downlink noise control configuration parameters.
+
+The index specified for this structure is retrieved using
+OMX_GetExtensionIndex() with the extension string
+"OMX.Symbian.Index.Config.Audio.DownLinkNoiseControl".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_DOWNLINKNOISECONTROLTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bEnable;
+ OMX_BU32 nStrength;
+} OMX_SYMBIAN_AUDIO_CONFIG_DOWNLINKNOISECONTROLTYPE;
+
+/** Wind noise control configuration parameters.
+
+The index specified for this structure is retrieved using
+OMX_GetExtensionIndex() with the extension string
+"OMX.Symbian.Index.Config.Audio.WindNoiseControl".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_WINDNOISECONTROLTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bEnable;
+ OMX_BU32 nSensitivity;
+} OMX_SYMBIAN_AUDIO_CONFIG_WINDNOISECONTROLTYPE;
+
+
+/** Downlink speech information extra data type. */
+typedef struct OMX_SYMBIAN_AUDIO_EXTRADATA_DLSPEECHINFOTYPE {
+ OMX_SYMBIAN_OTHER_EXTRADATABASETYPE base;
+ OMX_BOOL bComfortNoiseFrame;
+ OMX_BOOL bCorruptedFrame;
+} OMX_SYMBIAN_AUDIO_EXTRADATA_DLSPEECHINFOTYPE;
+
+/** DA-AD timing difference information extra data type. */
+typedef struct OMX_SYMBIAN_AUDIO_EXTRADATA_DAADTIMINGDIFFTYPE {
+ OMX_SYMBIAN_OTHER_EXTRADATABASETYPE base;
+ OMX_TICKS nDaAdTimingDifference;
+} OMX_SYMBIAN_AUDIO_EXTRADATA_DAADTIMINGDIFFTYPE;
+
+/** Voice Activity Detection information extra data type. */
+typedef struct OMX_SYMBIAN_AUDIO_EXTRADATA_VADINFOTYPE {
+ OMX_SYMBIAN_OTHER_EXTRADATABASETYPE base;
+ OMX_BOOL bUplinkVad;
+ OMX_BOOL bDownlinkVad;
+} OMX_SYMBIAN_AUDIO_EXTRADATA_VADINFOTYPE;
+
+/** Audio tuning data type.
+
+Audio tuning data type is used for passing tuning parameters via the OpenMAX IL
+component API to audio algorithms. The audio tuning parameters form an opaque
+data block, which only the sender and the algorithm understand.
+
+The index specified for this structure is retrieved using
+OMX_GetExtensionIndex() with the extension string
+"OMX.Symbian.Index.Config.Audio.TuningData".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_TUNINGDATATYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nChannel;
+ OMX_U8 nData[1];
+} OMX_SYMBIAN_AUDIO_CONFIG_TUNINGDATATYPE;
+
+/** Speech path loops control type.
+
+Loop control for speech signal path.
+
+The index specified for this structure is retrieved using
+OMX_GetExtensionIndex() with the extension string
+"OMX.Symbian.Index.Config.Audio.SpeechLoops".
+*/
+
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_SPEECHLOOPSTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_BOOL bLoopUplinkDownlink;
+ OMX_BOOL bLoopUplinkDownlinkAlg;
+ OMX_BOOL bLoopDownlinkUplink;
+ OMX_BOOL bLoopDownlinkUplinkAlg;
+} OMX_SYMBIAN_AUDIO_CONFIG_SPEECHLOOPSTYPE;
+
+/** Sidetone attenuation info type.
+
+The index specified for this structure is retrieved using
+OMX_GetExtensionIndex() with the extension string "OMX.Symbian.Index.Config.Audio.SidetoneAttenuationInfo"
+*/
+typedef OMX_AUDIO_CONFIG_VOLUMETYPE OMX_AUDIO_CONFIG_SIDETONEATTENUATIONINFOTYPE;
+
+/** Volume info type.
+
+This struct can be used to control sidetone attenuation.
+
+This data structure is currently used for reading volume info with extension string
+ "OMX.Symbian.Index.Config.Audio.VolumeInfo"
+*/
+typedef OMX_AUDIO_CONFIG_VOLUMETYPE OMX_AUDIO_CONFIG_VOLUMEINFOTYPE;
+
+
+/*@}*/
+
+/** @name Audio HW Control Extensions */
+
+/*@{*/
+
+/** Audio power control.
+
+The index specified for this structure is retrieved using
+OMX_GetExtensionIndex() with the extension string
+"OMX.Symbian.Index.Config.Audio.Power".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_POWERTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nChannel;
+ OMX_BOOL bPower;
+} OMX_SYMBIAN_AUDIO_CONFIG_POWERTYPE;
+
+/** Audio volume ramp control.
+
+The index specified for this structure is retrieved using
+OMX_GetExtensionIndex() with the extension string
+"OMX.Symbian.Index.Config.Audio.VolumeRamp".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_VOLUMERAMPTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nChannel;
+ OMX_BOOL bLinear;
+ OMX_BS32 sStartVolume;
+ OMX_BS32 sEndVolume;
+ OMX_TICKS nRampDuration;
+ OMX_BOOL bRampTerminate;
+ OMX_BS32 sCurrentVolume;
+ OMX_TICKS nRampCurrentTime;
+ OMX_TICKS nRampMinDuration;
+ OMX_TICKS nRampMaxDuration;
+ OMX_U32 nVolumeStep;
+} OMX_SYMBIAN_AUDIO_CONFIG_VOLUMERAMPTYPE;
+
+/** Audio register bank query.
+
+The index specified for this structure is retrieved using
+OMX_GetExtensionIndex() with the extension string
+"OMX.Symbian.Index.Config.Audio.RegisterBankQuery".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_REGISTERBANKQUERYTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U16 nNumRegisterBanks;
+} OMX_SYMBIAN_AUDIO_CONFIG_REGISTERBANKQUERYTYPE;
+
+
+typedef enum OMX_SYMBIAN_AUDIO_HWREGISTERTYPE {
+ OMX_SYMBIAN_AUDIO_RegisterIO = 0,
+ OMX_SYMBIAN_AUDIO_RegisterI2C,
+ OMX_SYMBIAN_AUDIO_RegisterSlimbus,
+ OMX_SYMBIAN_AUDIO_RegisterCBUS = 0xFFFF,
+ OMX_SYMBIAN_AUDIO_RegisterMax = 0x7FFFFFFF
+} OMX_SYMBIAN_AUDIO_HWREGISTERTYPE;
+
+typedef struct OMX_SYMBIAN_AUDIO_REGBANKDESCRIPTORTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nRegBankIndex;
+ OMX_U32 nLogicalStartAddr;
+ OMX_U32 nLogicalEndAddr;
+ OMX_SYMBIAN_AUDIO_HWREGISTERTYPE eRegBankType;
+} OMX_SYMBIAN_AUDIO_REGBANKDESCRIPTORTYPE;
+
+/** Audio register bank table control.
+
+The index specified for this structure is retrieved using
+OMX_GetExtensionIndex() with the extension string
+"OMX.Symbian.Index.Config.Audio.RegisterBankTable".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_REGISTERBANKTABLETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U16 nNumRegisterBanks;
+ OMX_SYMBIAN_AUDIO_REGBANKDESCRIPTORTYPE RegBankDescriptorTable;
+} OMX_SYMBIAN_AUDIO_CONFIG_REGISTERBANKTABLETYPE;
+
+
+typedef enum OMX_SYMBIAN_AUDIO_HWCTRLSTATUSTYPE {
+ OMX_SYMBIAN_AUDIO_HWCtrlStatusOk = 0,
+ OMX_SYMBIAN_AUDIO_HWCtrlStatusFail,
+ /* if callback facility is somehow solved in OpenMAX IL for getconfig/setconfig parameter calls, it is expected */
+ /* to have here extra status information that can be returned for e.g. multi-read/write commands */
+ OMX_SYMBIAN_AUDIO_HWCtrlStatusNotSupported = 0xFFFF,
+ OMX_SYMBIAN_AUDIO_HWCtrlStatusMax = 0x7FFFFFFF
+} OMX_SYMBIAN_AUDIO_HWCTRLSTATUSTYPE;
+
+typedef enum OMX_SYMBIAN_AUDIO_HWOPERATIONTYPE {
+ OMX_SYMBIAN_AUDIO_HWOperationNoOp = 0,
+ OMX_SYMBIAN_AUDIO_HWOperation8BitSingleRead,
+ OMX_SYMBIAN_AUDIO_HWOperation8BitSingleWrite,
+ OMX_SYMBIAN_AUDIO_HWOperation16BitSingleRead,
+ OMX_SYMBIAN_AUDIO_HWOperation16BitSingleWrite,
+ OMX_SYMBIAN_AUDIO_HWOperation32BitSingleRead,
+ OMX_SYMBIAN_AUDIO_HWOperation32BitSingleWrite,
+ OMX_SYMBIAN_AUDIO_HWOperation8BitMultiRead,
+ OMX_SYMBIAN_AUDIO_HWOperation8BitMultiWrite,
+ OMX_SYMBIAN_AUDIO_HWOperation16BitMultiRead,
+ OMX_SYMBIAN_AUDIO_HWOperation16BitMultiWrite,
+ OMX_SYMBIAN_AUDIO_HWOperation32BitMultiRead,
+ OMX_SYMBIAN_AUDIO_HWOperation32BitMultiWrite,
+ OMX_SYMBIAN_AUDIO_HWOperation8BitBurstMultiRead,
+ OMX_SYMBIAN_AUDIO_HWOperation8BitBurstMultiWrite,
+ OMX_SYMBIAN_AUDIO_HWOperation16BitBurstMultiRead,
+ OMX_SYMBIAN_AUDIO_HWOperation16BitBurstMultiWrite,
+ OMX_SYMBIAN_AUDIO_HWOperation32BitBurstMultiRead,
+ OMX_SYMBIAN_AUDIO_HWOperation32BitBurstMultiWrite = 0xFFFF,
+ OMX_SYMBIAN_AUDIO_HWOperationMax = 0x7FFFFFFF
+} OMX_SYMBIAN_AUDIO_HWOPERATIONTYPE;
+
+/** Custom audio HW control.
+
+The index specified for this structure is retrieved using
+OMX_GetExtensionIndex() with the extension string
+"OMX.Symbian.Index.Config.Audio.CustomHwControl".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_CUSTOMHWCONTROLTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_SYMBIAN_AUDIO_HWCTRLSTATUSTYPE eStatus;
+ OMX_SYMBIAN_AUDIO_HWOPERATIONTYPE eHwOperation;
+ OMX_SYMBIAN_AUDIO_HWREGISTERTYPE eRegisterType;
+ OMX_U16 nDataCount;
+ OMX_U8 nAddressDataSequence[1];
+} OMX_SYMBIAN_AUDIO_CONFIG_CUSTOMHWCONTROLTYPE;
+
+
+typedef enum OMX_SYMBIAN_AUDIO_HWLOOPTYPE {
+ OMX_SYMBIAN_AUDIO_HWLoopNone = 0,
+ OMX_SYMBIAN_AUDIO_HWLoopSidetone = 0xFFFF,
+ /* rest of HW loops are to be defined on a vendor specific basis */
+ OMX_SYMBIAN_AUDIO_HWLoopMax = 0x7FFFFFFF
+} OMX_SYMBIAN_AUDIO_HWLOOPTYPE;
+
+/** Audio HW loop support query.
+
+The index specified for this structure is retrieved using
+OMX_GetExtensionIndex() with the extension string
+"OMX.Symbian.Index.Config.Audio.HwLoopSupport".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_HWLOOPSUPPORTTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nSupportedLoops;
+ OMX_SYMBIAN_AUDIO_HWLOOPTYPE eLoopIndex;
+} OMX_SYMBIAN_AUDIO_CONFIG_HWLOOPSUPPORTTYPE;
+
+/** Audio HW loop control.
+
+The index specified for this structure is retrieved using
+OMX_GetExtensionIndex() with the extension string
+"OMX.Symbian.Index.Config.Audio.HwLoopControl".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_CONFIG_HWLOOPCONTROLTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_SYMBIAN_AUDIO_HWLOOPTYPE eLoopIndex;
+ OMX_U32 nChannel;
+ OMX_BOOL bControlSwitch;
+ OMX_BOOL bLinear;
+ OMX_BS32 sLoopVolume;
+} OMX_SYMBIAN_AUDIO_CONFIG_HWLOOPCONTROLTYPE;
+
+/*@}*/
+
+/** @name Haptics Extensions */
+
+/*@{*/
+
+/** Haptics driver properties query.
+
+The index specified for this structure is retrieved using
+OMX_GetExtensionIndex() with the extension string
+"OMX.Symbian.Index.Param.Audio.HapticsDriverProperties".
+*/
+typedef struct OMX_SYMBIAN_AUDIO_PARAM_HAPTICSDRIVERPROPERTIESTYPE
+{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nNativeSamplingRate;
+ OMX_U32 nHapticsDriverNominalVoltage;
+ OMX_U32 nHapticsDriverImpedance;
+} OMX_SYMBIAN_AUDIO_PARAM_HAPTICSDRIVERPROPERTIESTYPE;
+
+/*@}*/
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* OMX_Symbian_AudioExt_h */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/symbian_api/shaiext_api/inc/OMX_Symbian_ComponentExt.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,137 @@
+/*
+ OMX_Symbian_ComponentExt.h
+
+ Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ All rights reserved.
+
+ This program and the accompanying materials are made available
+ under the terms of the Eclipse Public License v1.0 which accompanies
+ this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Initial Contributors:
+ Nokia Corporation - initial contribution.
+*/
+
+/** @file
+@brief Symbian OpenMAX IL Extension Data Structures for the 'Component' types.
+
+This file contains the extension structures for the Symbian IL extensions that
+pertain to common component functionality.
+
+@publishedDeviceAbstraction
+*/
+
+#ifndef OMX_Symbian_ComponentExt_h
+#define OMX_Symbian_ComponentExt_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/* Each OMX header must include all required header files to allow the
+ * header to compile without errors. The includes below are required
+ * for this header file to compile successfully
+ */
+#include <openmax/il/khronos/v1_x/OMX_Types.h>
+
+
+/** @name Deferred mode control */
+
+/*@{*/
+
+/** Commit mode selection struct.
+
+The index specified for this structure is retrieved using
+OMX_GetExtensionIndex() with the extension string
+"OMX.Symbian.Index.Config.CommitMode".
+*/
+typedef struct OMX_SYMBIAN_CONFIG_COMMITMODETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_BOOL bDeferred;
+} OMX_SYMBIAN_CONFIG_COMMITMODETYPE;
+
+/** Explicit commit struct.
+
+The index specified for this structure is retrieved using
+OMX_GetExtensionIndex() with the extension string
+"OMX.Symbian.Index.Config.Commit".
+*/
+typedef struct OMX_SYMBIAN_CONFIG_COMMITTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+} OMX_SYMBIAN_CONFIG_COMMITTYPE;
+
+/*@}*/
+
+/** @name Thread Priority Control */
+
+/*@{*/
+
+/** Symbian OS thread priority control.
+
+The index specified for this structure is retrieved using
+OMX_GetExtensionIndex() with the extension string
+"OMX.Symbian.Index.Config.SymbianThreadPriority".
+*/
+typedef struct OMX_SYMBIAN_CONFIG_SYMBIANTHREADPRIORITYTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nThreadID; /**< Implementation specific thread ID */
+ OMX_S32 nThreadPriority; /**< The actual priority value */
+} OMX_SYMBIAN_CONFIG_SYMBIANTHREADPRIORITYTYPE;
+
+/*@}*/
+
+/** @name Shared Chunk Metadata Extension */
+
+/*@{*/
+
+/** Symbian OS shared chunk metadata config type.
+
+The index specified for this structure is retrieved using
+OMX_GetExtensionIndex() with the extension string
+"OMX.Symbian.Index.Config.Sharedchunkmetadata".
+*/
+typedef struct OMX_SYMBIAN_CONFIG_SHAREDCHUNKMETADATATYPE
+{
+ 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_U32 nHandleId; /**< This is a handle id of the shared chunk */
+ OMX_U64 nOwnerThreadId; /**< This is thread that contains the handle */
+} OMX_SYMBIAN_CONFIG_SHAREDCHUNKMETADATATYPE;
+
+/*@}*/
+
+/** @name GPS Positioning Extension */
+
+/*@{*/
+
+/** GPS location config.
+*/
+typedef struct OMX_SYMBIAN_CONFIG_GPSLOCATIONTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U64 nLatitudeDegrees;
+ OMX_U64 nLatitudeMinutes;
+ OMX_U64 nLatitudeSeconds;
+ OMX_U64 nLongitudeDegrees;
+ OMX_U64 nLongitudeMinutes;
+ OMX_U64 nLongitudeSeconds;
+ OMX_U64 nAltitudeMeters;
+ OMX_BOOL bLatitudeRefNorth;
+ OMX_BOOL bLongitudeRefEast;
+ OMX_BOOL bAltitudeRefAboveSea;
+ OMX_BOOL bLocationKnown;
+} OMX_SYMBIAN_CONFIG_GPSLOCATIONTYPE;
+
+/*@}*/
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* OMX_Symbian_ComponentExt_h */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/symbian_api/shaiext_api/inc/OMX_Symbian_CoreExt.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,51 @@
+/*
+ OMX_Symbian_CoreExt.h
+
+ Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ All rights reserved.
+
+ This program and the accompanying materials are made available
+ under the terms of the Eclipse Public License v1.0 which accompanies
+ this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Initial Contributors:
+ Nokia Corporation - initial contribution.
+*/
+
+/** @file
+@brief Symbian OpenMAX IL Extension Data Structures for the 'Core' types.
+
+This file contains the extension structures for the Symbian IL extensions that
+pertain to core functionality.
+
+@publishedDeviceAbstraction
+*/
+
+#ifndef OMX_Symbian_CoreExt_h
+#define OMX_Symbian_CoreExt_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/* Each OMX header must include all required header files to allow the
+ * header to compile without errors. The includes below are required
+ * for this header file to compile successfully
+ */
+#include <OMX_Core.h>
+
+
+/** Extensions to the standard IL errors. */
+typedef enum OMX_SYMBIAN_ERRORTYPE
+{
+ OMX_Symbian_ErrorInvalidMode = (OMX_S32) (OMX_ErrorVendorStartUnused + 0x00A00001),
+ OMX_Symbian_ErrorMax = 0x7FFFFFFF
+} OMX_SYMBIAN_ERRORTYPE;
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* OMX_Symbian_CoreExt_h */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/symbian_api/shaiext_api/inc/OMX_Symbian_ExtensionNames.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,179 @@
+/*
+ OMX_Symbian_ExtensionNames.h
+
+ Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ All rights reserved.
+
+ This program and the accompanying materials are made available
+ under the terms of the Eclipse Public License v1.0 which accompanies
+ this distribution" and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Initial Contributors:
+ Nokia Corporation - initial contribution.
+*/
+
+/** @file
+@brief Symbian OpenMAX IL Extension Names.
+
+This header file lists Symbian's extensions to OpenMAX IL.
+
+@publishedDeviceAbstraction
+*/
+
+#ifndef OMX_Symbian_ExtensionNames_h
+#define OMX_Symbian_ExtensionNames_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/* Component extensions */
+
+#define OMX_SYMBIAN_INDEX_CONFIG_COMMITMODE_NAME "OMX.Symbian.Index.Config.CommitMode"
+#define OMX_SYMBIAN_INDEX_CONFIG_COMMIT_NAME "OMX.Symbian.Index.Config.Commit"
+#define OMX_SYMBIAN_INDEX_CONFIG_SYMBIANTHREADPRIORITY_NAME "OMX.Symbian.Index.Config.SymbianThreadPriority"
+#define OMX_SYMBIAN_INDEX_CONFIG_GPSLOCATION_NAME "OMX.Symbian.Index.Config.GpsLocation"
+#define OMX_SYMBIAN_INDEX_CONFIG_SHAREDCHUNKMETADATA_NAME "OMX.Symbian.Index.Config.Sharedchunkmetadata"
+
+/* Audio parameters and configurations */
+#define OMX_SYMBIAN_INDEX_PARAM_AUDIO_WMAAVGBYTES_NAME "OMX.Symbian.Index.Param.Audio.WmaAvgBytes"
+#define OMX_SYMBIAN_INDEX_PARAM_AUDIO_WMAPRO_NAME "OMX.Symbian.Index.Param.Audio.WmaPro"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_AMRMODE_NAME "OMX.Symbian.Index.Config.Audio.AmrMode"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_SBCBITPOOL_NAME "OMX.Symbian.Index.Config.Audio.SbcBitpool"
+#define OMX_SYMBIAN_INDEX_PARAM_AUDIO_G711_NAME "OMX.Symbian.Index.Param.Audio.G711"
+#define OMX_SYMBIAN_INDEX_PARAM_AUDIO_ILBC_NAME "OMX.Symbian.Index.Param.Audio.Ilbc"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_ILBCFRAME_NAME "OMX.Symbian.Index.Config.Audio.IlbcFrame"
+#define OMX_SYMBIAN_INDEX_PARAM_AUDIO_SYNCHRONIZED_NAME "OMX.Symbian.Index.Param.Audio.Synchronized"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_PORTPAUSE_NAME "OMX.Symbian.Index.Config.Audio.PortPause"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_3DOUTPUT_NAME "OMX.Symbian.Index.Config.Audio.3DOutput"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_3DLOCATION_NAME "OMX.Symbian.Index.Config.Audio.3DLocation"
+#define OMX_SYMBIAN_INDEX_PARAM_AUDIO_3DDOPPLERMODE_NAME "OMX.Symbian.Index.Param.Audio.3DDopplerMode"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_3DDOPPLERSETTINGS_NAME "OMX.Symbian.Index.Config.Audio.3DDopplerSettings"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_3DLEVELS_NAME "OMX.Symbian.Index.Config.Audio.3DLevels"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_3DDISTANCEATTENUATION_NAME "OMX.Symbian.Index.Config.Audio.3DDistanceAttenuation"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_3DDIRECTIVITYSETTINGS_NAME "OMX.Symbian.Index.Config.Audio.3DDirectivitySettings"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_3DDIRECTIVITYORIENTATION_NAME "OMX.Symbian.Index.Config.Audio.3DDirectivityOrientation"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_3DMACROSCOPICORIENTATION_NAME "OMX.Symbian.Index.Config.Audio.3DMacroscopicOrientation"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_3DMACROSCOPICSIZE_NAME "OMX.Symbian.Index.Config.Audio.3DMacroscopicSize"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_VIRTUALIZER_NAME "OMX.Symbian.Index.Config.Audio.Virtualizer"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_VIRTUALIZERLOUDSPEAKER_NAME "OMX.Symbian.Index.Config.Audio.VirtualizerLoudspeaker"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_VISUALIZATION_NAME "OMX.Symbian.Index.Config.Audio.Visualization"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_VISUALIZATIONSPECTRAL_NAME "OMX.Symbian.Index.Config.Audio.VisualizationSpectral"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_VISUALIZATIONWAVEFORM_NAME "OMX.Symbian.Index.Config.Audio.VisualizationWaveform"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_TRANSEQUALIZER_NAME "OMX.Symbian.Index.Config.Audio.TransEqualizer"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_TRANSEQUALIZERIIREQ_NAME "OMX.Symbian.Index.Config.Audio.TransEqualizerIirEq"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_TRANSEQUALIZERFIRRESPONSE_NAME "OMX.Symbian.Index.Config.Audio.TransEqualizerFirResponse"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_MDRC_NAME "OMX.Symbian.Index.Config.Audio.Mdrc"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_LSPROT_NAME "OMX.Symbian.Index.Config.Audio.LsProt"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_SPLLIMIT_NAME "OMX.Symbian.Index.Config.Audio.SplLimit"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_CLICKREMOVAL_NAME "OMX.Symbian.Index.Config.Audio.ClickRemoval"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_EANC_NAME "OMX.Symbian.Index.Config.Audio.Eanc"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_APSSAS_NAME "OMX.Symbian.Index.Config.Audio.Apssas"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_BATTERYVOLTAGE_NAME "OMX.Symbian.Index.Config.Audio.BatteryVoltage"
+#define OMX_SYMBIAN_INDEX_PARAM_AUDIO_HDMI_NAME "OMX.Symbian.Index.Param.Audio.Hdmi"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_TONEGENERATOR_NAME "OMX.Symbian.Index.Config.Audio.ToneGenerator"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_POWER_NAME "OMX.Symbian.Index.Config.Audio.Power"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_VOLUMERAMP_NAME "OMX.Symbian.Index.Config.Audio.VolumeRamp"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_REGISTERBANKQUERY_NAME "OMX.Symbian.Index.Config.Audio.RegisterBankQuery"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_REGISTERBANKTABLE_NAME "OMX.Symbian.Index.Config.Audio.RegisterBankTable"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_CUSTOMHWCONTROL_NAME "OMX.Symbian.Index.Config.Audio.CustomHwControl"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_HWLOOPSUPPORT_NAME "OMX.Symbian.Index.Config.Audio.HwLoopSupport"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_HWLOOPCONTROL_NAME "OMX.Symbian.Index.Config.Audio.HwLoopControl"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_DECODERSTATUS_NAME "OMX.Symbian.Index.Config.Audio.DecoderStatus"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_ENCODERSTATUS_NAME "OMX.Symbian.Index.Config.Audio.EncoderStatus"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_UPLINKTIMIMG_NAME "OMX.Symbian.Index.Config.Audio.UplinkTiming"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_RFTXPOWER_NAME "OMX.Symbian.Index.Config.Audio.RfTxPower"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_UPLINKTIMINGINFO_NAME "OMX.Symbian.Index.Config.Audio.UplinkTimingInfo"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_UPLINKDELAYINFO_NAME "OMX.Symbian.Index.Config.Audio.UplinkDelayInfo"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_UPLINKALGORITHMS_NAME "OMX.Symbian.Index.Config.Audio.UplinkAlgorithms"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_DOWNLINKALGORITHMS_NAME "OMX.Symbian.Index.Config.Audio.DownlinkAlgorithms"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_ACOUSTICECHOCONTROL_NAME "OMX.Symbian.Index.Config.Audio.AcousticEchoControl"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_BANDWIDTHEXPANSION_NAME "OMX.Symbian.Index.Config.Audio.BandwidthExpansion"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_AUTOMATICVOLUMECONTROL_NAME "OMX.Symbian.Index.Config.Audio.AutomaticVolumeControl"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_BACKGROUNDNOISECONTROL_NAME "OMX.Symbian.Index.Config.Audio.BackgroundNoiseControl"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_COMFORTNOISEGENERATION_NAME "OMX.Symbian.Index.Config.Audio.ComfortNoiseGeneration"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_DOWNLINKNOISECONTROL_NAME "OMX.Symbian.Index.Config.Audio.DownLinkNoiseControl"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_MULTIMICNOISECONTROL_NAME "OMX.Symbian.Index.Config.Audio.MultiMicNoiseControl"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_SIDETONEHOWLINGCONTROL_NAME "OMX.Symbian.Index.Config.Audio.SidetoneHowlingControl"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_SIDETONEGAIN_NAME "OMX.Symbian.Index.Config.Audio.SidetoneGain"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_SIDETONEATTENUATION_NAME "OMX.Symbian.Index.Config.Audio.SidetoneAttenuation"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_TRANSDUCERDRC_NAME "OMX.Symbian.Index.Config.Audio.TransducerDrc"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_UPLINKLEVELNORMALIZATION_NAME "OMX.Symbian.Index.Config.Audio.UplinkLevelNormalization"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_VOICECLARITY_NAME "OMX.Symbian.Index.Config.Audio.VoiceClarity"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_WINDNOISECONTROL_NAME "OMX.Symbian.Index.Config.Audio.WindNoiseControl"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_TUNINGDATA_NAME "OMX.Symbian.Index.Config.Audio.TuningData"
+#define OMX_SYMBIAN_INDEX_PARAM_AUDIO_HAPTICSDRIVERPROPERTIES_NAME "OMX.Symbian.Index.Param.Audio.HapticsDriverProperties"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_SPEECHCODECENABLED_NAME "OMX.Symbian.Index.Config.Audio.SpeechCodecEnabled"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_SPEECHCODECDISABLED_NAME "OMX.Symbian.Index.Config.Audio.SpeechCodecDisabled"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_AUTOMATICGAINCONTROL_NAME "OMX.Symbian.Index.Config.Audio.AutomaticGainControl"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_MULTIMICROPHONENOISECONTROL_NAME "OMX.Symbian.Index.Config.Audio.MultiMicrophoneNoiseControl"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_SPEECHLOOPS_NAME "OMX.Symbian.Index.Config.Audio.SpeechLoops"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_SIDETONEATTENUATIONINFO_NAME "OMX.Symbian.Index.Config.Audio.SidetoneAttenuationInfo"
+#define OMX_SYMBIAN_INDEX_CONFIG_AUDIO_VOLUMEINFO_NAME "OMX.Symbian.Index.Config.Audio.VolumeInfo"
+
+/* Image parameters and configurations */
+#define OMX_SYMBIAN_INDEX_CONFIG_IMAGE_MAXJPEGSIZE_NAME "OMX.Symbian.Index.Config.Image.MaxJpegSize"
+
+/* Video parameters and configurations */
+#define OMX_SYMBIAN_INDEX_PARAM_VIDEO_SEQUENCEHEADER_NAME "OMX.Symbian.Index.Param.Video.SequenceHeader"
+#define OMX_SYMBIAN_INDEX_PARAM_VIDEO_AVCSEI_NAME "OMX.Symbian.Index.Param.Video.AvcSei"
+#define OMX_SYMBIAN_INDEX_PARAM_VIDEO_AVCOUTPUTORDER_NAME "OMX.Symbian.Index.Param.Video.AvcOutputOrder"
+#define OMX_SYMBIAN_INDEX_CONFIG_VIDEO_REFRESHMODE_NAME "OMX.Symbian.Index.Config.Video.RefreshMode"
+#define OMX_SYMBIAN_INDEX_CONFIG_VIDEO_OUTPUTRECT_NAME "OMX.Symbian.Index.Config.Video.OutputRect"
+#define OMX_SYMBIAN_INDEX_PARAM_VIDEO_VC1_NAME "OMX.Symbian.Index.Param.Video.Vc1"
+#define OMX_SYMBIAN_INDEX_PARAM_VIDEO_VC6_NAME "OMX.Symbian.Index.Param.Video.Vp6"
+
+/* Image & Video common configurations */
+#define OMX_SYMBIAN_INDEX_PARAM_COMMON_PIXELASPECTRATIO_NAME "OMX.Symbian.Index.Param.Common.PixelAspectRatio"
+#define OMX_SYMBIAN_INDEX_PARAM_COMMON_COLORPRIMARY_NAME "OMX.Symbian.Index.Param.Common.ColorPrimary"
+#define OMX_SYMBIAN_INDEX_CONFIG_COMMON_CAMERAFUNCTESTSELECT_NAME "OMX.Symbian.Index.Config.Common.CameraFuncTestSelect"
+#define OMX_SYMBIAN_INDEX_CONFIG_COMMON_CAMERASELFTESTSELECT_NAME "OMX.Symbian.Index.Config.Common.CameraSelfTestSelect"
+#define OMX_SYMBIAN_INDEX_CONFIG_COMMON_CAMERATESTING_NAME "OMX.Symbian.Index.Config.Common.CameraTesting"
+#define OMX_SYMBIAN_INDEX_CONFIG_COMMON_SCENEMODE_NAME "OMX.Symbian.Index.Config.Common.SceneMode"
+#define OMX_SYMBIAN_INDEX_CONFIG_COMMON_RGBHISTOGRAM_NAME "OMX.Symbian.Index.Config.Common.RgbHistogram"
+#define OMX_SYMBIAN_INDEX_CONFIG_COMMON_HISTOGRAMCONTROL_NAME "OMX.Symbian.Index.Config.Common.HistogramControl"
+#define OMX_SYMBIAN_INDEX_CONFIG_COMMON_XENONLIFECOUNTER_NAME "OMX.Symbian.Index.Config.Common.XenonLifeCounter"
+#define OMX_SYMBIAN_INDEX_CONFIG_COMMON_ROISELECTION_NAME "OMX.Symbian.Index.Config.Common.RoiSelection"
+#define OMX_SYMBIAN_INDEX_CONFIG_COMMON_REDCOMPLEXITY_NAME "OMX.Symbian.Index.Config.Common.RedComplexity"
+#define OMX_SYMBIAN_INDEX_CONFIG_COMMON_REDEYEREMOVAL_NAME "OMX.Symbian.Index.Config.Common.RedEyeRemoval"
+#define OMX_SYMBIAN_INDEX_CONFIG_COMMON_ORIENTATIONSCENE_NAME "OMX.Symbian.Index.Config.Common.OrientationScene"
+#define OMX_SYMBIAN_INDEX_PARAM_COMMON_REVERTASPECTRATIO_NAME "OMX.Symbian.Index.Param.Common.RevertAspectRatio"
+#define OMX_SYMBIAN_INDEX_CONFIG_COMMON_NDFILTERCONTROL_NAME "OMX.Symbian.Index.Config.Common.NdFilterControl"
+#define OMX_SYMBIAN_INDEX_CONFIG_COMMON_EXPOSURELOCK_NAME "OMX.Symbian.Index.Config.Common.ExposureLock"
+#define OMX_SYMBIAN_INDEX_CONFIG_COMMON_WHITEBALANCELOCK_NAME "OMX.Symbian.Index.Config.Common.WhiteBalanceLock"
+#define OMX_SYMBIAN_INDEX_CONFIG_COMMON_FOCUSLOCK_NAME "OMX.Symbian.Index.Config.Common.FocusLock"
+#define OMX_SYMBIAN_INDEX_CONFIG_COMMON_ALLLOCK_NAME "OMX.Symbian.Index.Config.Common.AllLock"
+#define OMX_SYMBIAN_INDEX_CONFIG_COMMON_CENTERFIELDOFVIEW_NAME "OMX.Symbian.Index.Config.Common.CenterFieldOfView"
+#define OMX_SYMBIAN_INDEX_CONFIG_COMMON_EXTDIGITALZOOM_NAME "OMX.Symbian.Index.Config.Common.ExtDigitalZoom"
+#define OMX_SYMBIAN_INDEX_CONFIG_COMMON_EXTOPTICALZOOM_NAME "OMX.Symbian.Index.Config.Common.ExtOpticalZoom"
+#define OMX_SYMBIAN_INDEX_CONFIG_COMMON_FOCUSRANGE_NAME "OMX.Symbian.Index.Config.Common.FocusRange"
+#define OMX_SYMBIAN_INDEX_CONFIG_COMMON_EXTFOCUSSTATUS_NAME "OMX.Symbian.Index.Config.Common.ExtFocusStatus"
+#define OMX_SYMBIAN_INDEX_CONFIG_COMMON_FLICKERREMOVAL_NAME "OMX.Symbian.Index.Config.Common.FlickerRemoval"
+#define OMX_SYMBIAN_INDEX_CONFIG_COMMON_FLASHCONTROL_NAME "OMX.Symbian.Index.Config.Common.FlashControl"
+#define OMX_SYMBIAN_INDEX_CONFIG_COMMON_AFASSISTANTLIGHT_NAME "OMX.Symbian.Index.Config.Common.AfAssistantLight"
+#define OMX_SYMBIAN_INDEX_CONFIG_COMMON_HINTPOWERVSQUALITY_NAME "OMX.Symbian.Index.Config.Common.HintPowerVsQuality"
+#define OMX_SYMBIAN_INDEX_CONFIG_COMMON_HINTDEPTHOFFIELD_NAME "OMX.Symbian.Index.Config.Common.HintDepthOfField"
+#define OMX_SYMBIAN_INDEX_CONFIG_COMMON_FOCUSREGION_NAME "OMX.Symbian.Index.Config.Common.FocusRegion"
+#define OMX_SYMBIAN_INDEX_CONFIG_COMMON_ROI_NAME "OMX.Symbian.Index.Config.Common.Roi"
+#define OMX_SYMBIAN_INDEX_CONFIG_COMMON_CAMERASENSORINFO_NAME "OMX.Symbian.Index.Config.Common.CameraSensorInfo"
+#define OMX_SYMBIAN_INDEX_CONFIG_COMMON_FLASHGUNINFO_NAME "OMX.Symbian.Index.Config.Common.FlashGunInfo"
+#define OMX_SYMBIAN_INDEX_CONFIG_COMMON_MOTIONLEVEL_NAME "OMX.Symbian.Index.Config.Common.MotionLevel"
+#define OMX_SYMBIAN_INDEX_CONFIG_COMMON_SHARPNESS_NAME "OMX.Symbian.Index.Config.Common.Sharpness"
+#define OMX_SYMBIAN_INDEX_CONFIG_COMMON_EXTCAPTURING_NAME "OMX.Symbian.Index.Config.Common.ExtCapturing"
+#define OMX_SYMBIAN_INDEX_CONFIG_COMMON_EXTCAPTUREMODE_NAME "OMX.Symbian.Index.Config.Common.ExtCaptureMode"
+#define OMX_SYMBIAN_INDEX_CONFIG_COMMON_XENONFLASHSTATUS_NAME "OMX.Symbian.Index.Config.Common.XenonFlashStatus"
+#define OMX_SYMBIAN_INDEX_CONFIG_COMMON_PRECAPTUREEXPOSURETIME_NAME "OMX.Symbian.Index.Config.Common.PreCaptureExposureTime"
+#define OMX_SYMBIAN_INDEX_CONFIG_COMMON_EXPOSUREINITIATED_NAME "OMX.Symbian.Index.Config.Common.ExposureInitiated"
+#define OMX_SYMBIAN_INDEX_CONFIG_COMMON_BRACKETING_NAME "OMX.Symbian.Index.Config.Common.Bracketing"
+#define OMX_SYMBIAN_INDEX_CONFIG_COMMON_RAWPRESET_NAME "OMX.Symbian.Index.Config.Common.RawPreset"
+#define OMX_SYMBIAN_INDEX_CONFIG_COMMON_APPLYUSERSETTINGS_NAME "OMX.Symbian.Index.Config.Common.ApplyUserSettings"
+#define OMX_SYMBIAN_INDEX_CONFIG_COMMON_VIDEOLIGHT_NAME "OMX.Symbian.Index.Config.Common.VideoLight"
+
+/* Other configurations */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* OMX_Symbian_ExtensionNames_h */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/symbian_api/shaiext_api/inc/OMX_Symbian_IVCommonExt.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,272 @@
+/*
+ OMX_Symbian_IVCommonExt.h
+
+ Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ All rights reserved.
+
+ This program and the accompanying materials are made available
+ under the terms of the Eclipse Public License v1.0 which accompanies
+ this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Initial Contributors:
+ Nokia Corporation - initial contribution.
+*/
+
+/** @file
+@brief Symbian OpenMAX IL Extension Data Structures Common for Imaging and Video.
+
+This file contains the extension structures for the Symbian IL extensions that
+are common to Imaging and Video domains.
+
+@publishedDeviceAbstraction
+*/
+
+#ifndef OMX_Symbian_IVCommonExt_h
+#define OMX_Symbian_IVCommonExt_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/* Each OMX header must include all required header files to allow the
+ * header to compile without errors. The includes below are required
+ * for this header file to compile successfully
+ */
+#include <openmax/il/khronos/v1_x/OMX_Types.h>
+#include <openmax/il/khronos/v1_x/OMX_Core.h>
+#include <openmax/il/khronos/v1_x/OMX_IVCommon.h>
+#include <openmax/il/khronos/v1_x/OMX_Image.h>
+
+
+/* Extensions to standard enums */
+/* ---------------------------- */
+
+
+/**
+ * Offset to Symbian extensions
+ */
+#define OMX_SYMBIAN_IV_COMMON_EXTENSIONS_START_OFFSET 0x00A00000
+#define OMX_SYMBIAN_CAMERA_EXTENSIONS_START_OFFSET 0x00B00000
+#define OMX_SYMBIAN_VIDEO_EXTENSIONS_START_OFFSET 0x00C00000
+
+/* Extended generic types */
+/* ---------------------- */
+
+
+/**
+ * Generic point type
+ * Point coordinates in 2D space
+*/
+typedef struct OMX_SYMBIAN_POINTTYPE {
+ OMX_S32 nX;
+ OMX_S32 nY;
+} OMX_SYMBIAN_POINTTYPE;
+
+/**
+ * Generic size type
+ * Size of rectangle in 2D space
+*/
+typedef struct OMX_SYMBIAN_SIZETYPE {
+ OMX_S32 nWidth;
+ OMX_S32 nHeight;
+} OMX_SYMBIAN_SIZETYPE;
+
+/**
+ * Generic rectangle type.
+ * Rectangle represented by top left corner coordinates
+ * and the size of the rectangle
+ * There exist also a rectangle config defined in the OMX IL standard.
+ * The purpose of this addition is to provide a generic rectangle type to
+ * be used by other configs and params.
+*/
+typedef struct OMX_SYMBIAN_RECTTYPE {
+ OMX_SYMBIAN_POINTTYPE sTopLeft;
+ OMX_SYMBIAN_SIZETYPE sSize;
+} OMX_SYMBIAN_RECTTYPE;
+
+/**
+ * Relative rectangle type.
+ * The purpose of this type is to represent a rectangular
+ * region relative to certain reference size.
+ *
+ * Example:
+ * The location of an object detected in camera scene can be represendted
+ * with relative rect. Let the object be located in rectangular are which has
+ * top left coordintes (10,20) and size (90,120). The object detection algorithm
+ * has used 320x240 sized image for analysis and that will be used as the
+ * reference size in the relative rect. The object location in 2 megapixel
+ * (1600x1200 pixels) captured image can be calculated by scaling the top left
+ * X-coordinate and rectangle width with reference size's width's faction 1600/320=5.
+ * Likewise for the Y-coordinate and height 1200/240=5. In the captured image
+ * the object is located inside a rectangular region that has top left coordinates
+ * (10*5, 20*5) = (50, 100) and size (90*5, 120*5) = (450, 600).
+*/
+typedef struct OMX_SYMBIAN_RELATIVERECTTYPE {
+ OMX_SYMBIAN_RECTTYPE sRect; /**< Rectangle represented as concerete top left coordinates and size */
+ OMX_SYMBIAN_SIZETYPE sReference; /**< Reference size. Since sRect is relative to this reference size
+ it can be scaled up or down to represent the same rectangular
+ region in relation to bigger or smaller reference sizes */
+} OMX_SYMBIAN_RELATIVERECTTYPE;
+
+
+
+/* Extended generic config and param structs */
+/* ----------------------------------------- */
+
+
+/**
+ * Generic signed 32-bit integer config struct.
+*/
+typedef struct OMX_SYMBIAN_CONFIG_S32TYPE {
+ OMX_U32 nSize; /**< Size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Port that this structure applies to */
+ OMX_S32 nValue; /**< signed 32-bit value */
+} OMX_SYMBIAN_CONFIG_S32TYPE;
+
+/**
+ * Generic unsigned 32-bit integer param struct.
+*/
+typedef OMX_SYMBIAN_CONFIG_S32TYPE OMX_SYMBIAN_PARAM_S32TYPE;
+
+/**
+ * Generic unsigned 32-bit integer config struct.
+*/
+typedef struct OMX_SYMBIAN_CONFIG_U32TYPE {
+ OMX_U32 nSize; /**< Size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Port that this structure applies to */
+ OMX_U32 nValue; /**< Unsigned 32-bit value */
+} OMX_SYMBIAN_CONFIG_U32TYPE;
+
+/**
+ * Generic unsigned 32-bit integer param struct.
+*/
+typedef OMX_SYMBIAN_CONFIG_U32TYPE OMX_SYMBIAN_PARAM_U32TYPE;
+
+/**
+ * Port specific generic boolean config struct
+ * OMX spec already has boolean config but
+ * without port index
+*/
+typedef struct OMX_SYMBIAN_CONFIG_BOOLEANTYPE {
+ OMX_U32 nSize; /**< Size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Port that this structure applies to */
+ OMX_BOOL bEnabled; /**< Boolean value */
+} OMX_SYMBIAN_CONFIG_BOOLEANTYPE;
+
+/**
+ * Generic point config struct
+*/
+typedef struct OMX_SYMBIAN_CONFIG_POINTTYPE {
+ OMX_U32 nSize; /**< Size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Port that this structure applies to */
+ OMX_SYMBIAN_POINTTYPE sPoint; /**< Point coordinates */
+} OMX_SYMBIAN_CONFIG_POINTTYPE;
+
+
+
+/* Extended params and configs */
+/* --------------------------- */
+
+/**
+ * Enumeration of possible flicker removal values
+ */
+typedef enum OMX_SYMBIAN_FLICKERREMOVALTYPE {
+ OMX_SYMBIAN_FlickerRemovalOff, /**< Flicker removal disabled */
+ OMX_SYMBIAN_FlickerRemovalAuto, /**< Automatically detected AC frequency */
+ OMX_SYMBIAN_FlickerRemoval50, /**< Flicker removal for 50 Hz AC frequency */
+ OMX_SYMBIAN_FlickerRemoval60, /**< Flicker removal for 60 Hz AC frequency */
+ OMX_SYMBIAN_FlickerRemovalMax = 0x7FFFFFFF
+} OMX_SYMBIAN_FLICKERREMOVALTYPE;
+
+/**
+ * Flicker Removal.
+*/
+typedef struct OMX_SYMBIAN_CONFIG_FLICKERREMOVALTYPE {
+ OMX_U32 nSize; /**< Size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Port that this structure applies to */
+ OMX_SYMBIAN_FLICKERREMOVALTYPE eFlickerRemoval; /**< Flicker removal mode */
+}OMX_SYMBIAN_CONFIG_FLICKERREMOVALTYPE;
+
+/**
+ * Classification of algorithm comlexity values
+ */
+typedef enum OMX_SYMBIAN_ALGORITHMCOMPLEXITYTYPE {
+ OMX_SYMBIAN_AlgComplexityLow,
+ OMX_SYMBIAN_AlgComplexityMedium,
+ OMX_SYMBIAN_AlgComplexityHigh,
+ OMX_SYMBIAN_AlgComplexityMax = 0x7FFFFFFF
+} OMX_SYMBIAN_ALGORITHMCOMPLEXITYTYPE;
+
+/**
+ * Algorithm complexity config
+ */
+typedef struct OMX_SYMBIAN_CONFIG_ALGORITHMCOMPLEXITYTYPE {
+ OMX_U32 nSize; /**< Size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Port that this structure applies to */
+ OMX_SYMBIAN_ALGORITHMCOMPLEXITYTYPE eComplexity; /**< Algorithm complexity to use */
+} OMX_SYMBIAN_CONFIG_ALGORITHMCOMPLEXITYTYPE;
+
+/** Color format extensions. */
+typedef enum OMX_SYMBIAN_COLOR_FORMATTYPE {
+ OMX_SYMBIAN_COLOR_FormatYUV420MBPackedSemiPlanar = OMX_COLOR_FormatVendorStartUnused + OMX_SYMBIAN_IV_COMMON_EXTENSIONS_START_OFFSET,
+ OMX_SYMBIAN_COLOR_FormatRawBayer12bit,
+ OMX_SYMBIAN_COLOR_FormatMax = 0x7FFFFFFF
+} OMX_SYMBIAN_COLOR_FORMATTYPE;
+
+/** Primary color enumeration. */
+typedef enum OMX_SYMBIAN_COLORPRIMARYTYPE {
+ OMX_SYMBIAN_ColorPrimaryBT601FullRange,
+ OMX_SYMBIAN_ColorPrimaryBT601LimitedRange,
+ OMX_SYMBIAN_ColorPrimaryBT709FullRange,
+ OMX_SYMBIAN_ColorPrimaryBT709LimitedRange,
+ OMX_SYMBIAN_ColorMax = 0x7FFFFFFF
+} OMX_SYMBIAN_COLORPRIMARYTYPE;
+
+/** YUV data color range.
+
+The index specified for this structure is retrieved using
+OMX_GetExtensionIndex() with the extension string
+"OMX.Symbian.Index.Param.Common.ColorPrimary".
+*/
+typedef struct OMX_SYMBIAN_PARAM_COLORPRIMARYTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_SYMBIAN_COLORPRIMARYTYPE eColorPrimary;
+} OMX_SYMBIAN_PARAM_COLORPRIMARYTYPE;
+
+
+/** Extradata type extensions.
+
+The index used to query or enable the generation of this payload is retrieved using
+OMX_GetExtensionIndex() with the extension string
+"OMX.Symbian.Index.Config.Common.ExtraVideoStabilizationData".
+*/
+typedef enum OMX_SYMBIAN_EXTRADATATYPE {
+ OMX_SYMBIAN_ExtraDataVideoStabilization = OMX_ExtraDataVendorStartUnused + OMX_SYMBIAN_IV_COMMON_EXTENSIONS_START_OFFSET,
+ OMX_SYMBIAN_ExtraDataMax = 0x7FFFFFFF
+} OMX_SYMBIAN_EXTRADATATYPE;
+
+/** Video stabilization extradata content struct */
+typedef struct OMX_SYMBIAN_DIGITALVIDEOSTABTYPE {
+ OMX_BOOL bState; //**< The state of digital image stabilization */
+ OMX_U32 nTopLeftCropVectorX; //**< Horizontal coordinate of the crop vector from top left angle, absolute wrt overscanning width */
+ OMX_U32 nTopLeftCropVectorY; //**< Vertical coordinate of the crop vector from top left angle, absolute wrt overscanning height */
+ OMX_U32 nMaxOverscannedWidth; //**< Max W+30% */
+ OMX_U32 nMaxOverscannedHeight; //**< Max H+30% */
+} OMX_SYMBIAN_DIGITALVIDEOSTABTYPE;
+
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* OMX_Symbian_IVCommonExt_h */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/symbian_api/shaiext_api/inc/OMX_Symbian_OtherExt.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,63 @@
+/*
+ OMX_Symbian_OtherExt.h
+
+ Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ All rights reserved.
+
+ This program and the accompanying materials are made available
+ under the terms of the Eclipse Public License v1.0 which accompanies
+ this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Initial Contributors:
+ Nokia Corporation - initial contribution.
+*/
+
+/** @file
+@brief Symbian OpenMAX IL Extension Data Structures for the 'Other' Domain.
+
+This file contains the extension structures for the Symbian IL extensions in the
+'Other' domain.
+
+@publishedDeviceAbstraction
+*/
+
+#ifndef OMX_Symbian_OtherExt_h
+#define OMX_Symbian_OtherExt_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/* Each OMX header must include all required header files to allow the
+ * header to compile without errors. The includes below are required
+ * for this header file to compile successfully
+ */
+#include <OMX_Core.h>
+
+
+/** @name Extradata extension */
+
+/*@{*/
+
+/** Extradata base type.
+
+This is a helper struct that can be used as part of the definitions of
+Symbian-specific extra data types. It is exactly the same as the standard
+OMX_OTHER_EXTRADATATYPE save for the missing data field.
+*/
+typedef struct OMX_SYMBIAN_OTHER_EXTRADATABASETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_EXTRADATATYPE eType;
+ OMX_U32 nDataSize;
+} OMX_SYMBIAN_OTHER_EXTRADATABASETYPE;
+
+/*@}*/
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* OMX_Symbian_OtherExt_h */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/test_api/group/bld.inf Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,30 @@
+// 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
+
+//
+// Test headers
+//
+../inc/omxiltestmd5param.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/extensions/test/omxiltestmd5param.h)
+../inc/warning.txt SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/extensions/test/warning.txt)
+
+PRJ_EXPORTS
+
+// Obsolete extensions for NGMA buffer src/sink components
+../inc/mmfbuffershared.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(multimedia/mmfbuffershared.h)
+../inc/omxilsymbianbuffersextensions.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/extensions/omxilsymbianbuffersextensions.h)
+../inc/omxilsymbiansharedchunkextensions.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/extensions/omxilsymbiansharedchunkextensions.h)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/test_api/inc/mmfbuffershared.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,70 @@
+/*
+* 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:
+*
+*/
+
+
+/**
+ @file
+ @internalComponent
+*/
+
+#ifndef MMFBUFFERSHARED_H
+#define MMFBUFFERSHARED_H
+
+#include <e32cmn.h>
+
+const TInt KMinBuffers = 1;
+const TInt KMinBufferSize = 4000;
+
+/**
+ * The T class holds the filled buffer information for each buffer.
+ */
+class TFilledBufferHeaderV2
+ {
+public:
+ /** Amount of buffer filled with actual data */
+ TUint iFilledLength;
+ /** Any timestamp associated with the buffer */
+ TInt64 iTimeStamp;
+ /** Combination of OMX_BUFFERFLAG_*, specified at page 68 in the OpenMAX spec. */
+ TUint iFlags;
+ /** offset **/
+ TUint32 iOffset;
+ };
+
+/** Shared chunk buffers information. It can be set by the user. */
+class TMMSharedChunkBufConfig
+ {
+public:
+ /** The number of buffers. */
+ TInt iNumBuffers;
+ /** The size of each buffer in bytes. */
+ TInt iBufferSizeInBytes;
+ };
+
+struct TBufSrcComponentHandles
+ {
+ /** The descriptor containing the name of the global chunk to be opened */
+ TName iChunkName;
+ /** The descriptor containing the name of the global message queue
+ for the available buffer notification */
+ TName iBufferAvailMsgQueue;
+ /** The descriptor containing the name of the global message queue
+ for the filled buffer */
+ TName iBufferFilledMsgQueue;
+ };
+
+#endif // MMFBUFFERSHARED_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/test_api/inc/omxilsymbianbuffersextensions.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,90 @@
+/*
+* 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:
+*
+*/
+
+
+/**
+ @file
+ @internalComponent
+*/
+
+#ifndef OMXILSYMBIANBUFFERSOURCEEXTENSIONS_H
+#define OMXILSYMBIANBUFFERSOURCEEXTENSIONS_H
+
+#include <openmax/il/khronos/v1_x/OMX_Types.h>
+
+/**
+ * The string that the Symbian's OpenMAX IL Buffer components will
+ * translate into a 32-bit OpenMAX IL index to support the message queue communication
+ * with user client
+ */
+#if 1
+const char sOmxSymbianBufferMsgQueue [] = "OMX.SYMBIAN.INDEX.PARAM.BUFFERMSGQUEUE";
+#endif
+const char sOmxSymbianBufferSize[] = "OMX.SYMBIAN.INDEX.PARAM.BUFFERSIZE";
+const char sOmxSymbianBufferChunk[] = "OMX.SYMBIAN.INDEX.PARAM.BUFFERCHUNK";
+
+/*
+ * Custom index used by Symbian's OpenMAX IL Buffers to select the
+ * structure for getting message queue global names
+ *
+ * Vendor specific structures should be in the range of 0x7F000000 to 0x7FFFFFFE.
+ * This range is not broken out by vendor, so private indexes are not guaranteed unique
+ * and therefore should only be sent to the appropriate component.
+ */
+#if 1
+#define OMX_SymbianIndexParamBufferMsgQueueData 0x7F000006 // TBC
+#endif
+#define OMX_SymbianIndexParamBufferSize 0x7F000007
+#define OMX_SymbianIndexParam3PlaneBufferChunk 0x7F000008
+
+#if 1
+/**
+ * Custom OpenMAX IL structure to be used as a container for message queue global names
+ */
+struct OMX_SYMBIAN_PARAM_BUFFER_MSGQUEUE
+ {
+ 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_PTR pBufSrcComponentHandles; /** This is a pointer to TBufSrcComponentHandles */
+ };
+#endif
+
+/**
+ Custom OpenMAX IL structure used as container for buffer size on RChunk backed buffers
+ */
+
+struct OMX_SYMBIAN_PARAM_BUFFER_SIZE
+ {
+ 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_S32 nBufferSize; /**< Buffer size in bytes */
+ };
+
+struct OMX_SYMBIAN_PARAM_3PLANE_CHUNK_DATA
+ {
+ 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_U32 nChunk; /**< Chunk */
+ OMX_U32 nFilledBufferQueue; /**< FilledBufferQueue */
+ OMX_U32 nAvailableBufferQueue; /**< AVailableBufferQueue */
+ OMX_U64 nThreadId; /**< The thread which creates the chunk */
+ };
+
+#endif // OMXILSYMBIANBUFFERSOURCEEXTENSIONS_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/test_api/inc/omxilsymbiansharedchunkextensions.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,66 @@
+/*
+* 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:
+*
+*/
+
+
+/**
+ @file
+ @internalComponent
+*/
+
+#ifndef OMXILSYMBIANSHAREDCHUNKTENSIONS_H
+#define OMXILSYMBIANSHAREDCHUNKTENSIONS_H
+
+#include <openmax/il/khronos/v1_x/OMX_Types.h>
+
+/**
+ * The string that the OpenMAX IL component will translate into a 32-bit
+ * OpenMAX IL index to support the communication of Symbian shared chunk
+ * metadata with a tunnelled component
+ */
+const char sOmxSymbianSharedChunkMetadata [] = "OMX.SYMBIAN.INDEX.CONFIG.SHAREDCHUNKMETADATA";
+
+
+/*
+ * Custom index used by an OpenMAX IL component to select the structure for
+ * getting/setting the Symbian share chunk metadata
+ *
+ * Vendor specific structures should be in the range of 0x7F000000 to 0x7FFFFFFE.
+ * This range is not broken out by vendor, so private indexes are not guaranteed unique
+ * and therefore should only be sent to the appropriate component.
+ */
+#define OMX_SymbianIndexConfigSharedChunkMetadata 0x7FD19E5C // TBC
+
+/*
+ * This constant defines the max number of share chunk offsets
+ */
+#define OMX_SYMBIAN_SHARED_CHUNK_OFFSETS_MAX 128
+
+/**
+ * Custom OpenMAX IL structure to be used as a container for Symbian shared
+ * chunk related information
+ */
+struct OMX_SYMBIAN_CONFIG_SHARED_CHUNK_METADATA
+ {
+ 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_U32 nHandleId; /** This is a handle id of the shared chunk */
+ OMX_U64 nOwnerThreadId; /** This is thread that contains the handle */
+ };
+
+#endif // OMXILSYMBIANSHAREDCHUNKTENSIONS_H
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/test_api/inc/omxiltestmd5param.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,42 @@
+/*
+* 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:
+*
+* WARNING - This is a test extension which
+* a) Maybe REMOVED without warning
+* b) Maybe CHANGED without warning
+* c) Is only intended for use by internal test code, and should NEVER be used by production code or in a real device
+*
+*/
+
+
+/**
+@file
+@internalComponent
+*/
+
+#ifndef OMXILTESTMD5PARAM_H
+#define OMXILTESTMD5PARAM_H
+
+#include <openmax/il/khronos/v1_x/OMX_Index.h>
+
+const OMX_INDEXTYPE OMX_IndexParam_Symbian_MD5 = static_cast<OMX_INDEXTYPE>(0x7FD19E5C);
+
+struct OMX_PARAM_SYMBIAN_MD5TYPE
+ {
+ OMX_VERSIONTYPE nVersion;
+ OMX_U8 pHash[16];
+ };
+
+#endif //OMXILTESTMD5PARAM_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/openmaxil_plat/test_api/inc/warning.txt Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,4 @@
+This directory contains test extension headers which
+ a) Maybe REMOVED without warning
+ b) Maybe CHANGED without warning
+ c) Are only intended for use by internal test code, and should NEVER be used by production code or in a real device
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/package_definition.xml Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<SystemDefinition schema="3.0.1">
+ <package id="openmaxil" name="openmaxil" levels="adaptation hw-if device-fw devices middleware app-if">
+
+
+ <collection id="openmaxil_plat" name="OpenMAX IL Platform Exports" level="hw-if">
+ <component id="khronos_api" name="OpenMAX IL API" introduced="^3" purpose="mandatory" class="api">
+ <unit version="1" bldFile="openmaxil_plat/khronos_api/group"/>
+ </component>
+ <component id="symbian_api" name="OpenMAX IL Symbian API" introduced="^3" purpose="mandatory" class="api">
+ <unit version="1" bldFile="openmaxil_plat/symbian_api/group"/>
+ </component>
+ <component id="test_api" name="OpenMAX IL test headers" introduced="^3" purpose="development" class="api">
+ <unit version="1" bldFile="openmaxil_plat/test_api/group"/>
+ </component>
+ </collection>
+
+ <collection id="omxil_generic" name="OpenMAX IL Implementation" level="device-fw">
+ <component id="omxilcomplib" name="OpenMAX IL Component Framework" introduced="^3" purpose="optional">
+ <unit version="1" bldFile="omxil_generic/omxilcomplib/group"/>
+ </component>
+ <component id="omxilcore" name="OpenMAX IL Core" introduced="^3" purpose="mandatory">
+ <unit version="1" bldFile="omxil_generic/omxilcore/group"/>
+ </component>
+ <component id="omxilloader" name="OpenMAX IL Loader" introduced="^3" purpose="mandatory">
+ <unit version="1" bldFile="omxil_generic/omxilloader/group"/>
+ </component>
+ </collection>
+
+ <collection id="tsrc" name="OpenMAX IL Test code" level="hw-if">
+ <component id="xmltestharness" name="OpenMAX IL XML Test Harness" introduced="^3" purpose="development">
+ <unit version="1" bldFile="tsrc/xmltestharness/group"/>
+ </component>
+ </collection>
+
+ </package>
+</SystemDefinition>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/package_map.xml Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,1 @@
+<PackageMap root="sf" layer="os"/>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysdef_1_4_0.dtd Wed Aug 25 12:40:50 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>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/group/bld.inf Wed Aug 25 12:40:50 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:
+*
+*/
+#include "../tools/t_videoframesupplier/group/bld.inf"
+#include "../xmlclient/group/bld.inf"
+#include "../te_xmlomxclient/group/bld.inf"
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/layers.sysdef.xml Wed Aug 25 12:40:50 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:
+
+-->
+
+<!DOCTYPE SystemDefinition SYSTEM "sysdef_1_4_0.dtd" [
+ <!ENTITY layer_real_source_path "/ncp_sw/corecom/xmltestharness" >
+]>
+
+<SystemDefinition name="xmltestharness" schema="1.4.0">
+ <systemModel>
+ <layer name="test_ncp_layer">
+ <module name="corecom">
+ <component name="xmltestharness">
+ <unit unitID="xmltestharness.xmlclient" mrp="" name="xmltestharness_xmlclient" bldFile="&layer_real_source_path;/xmlclient/group"/>
+ <unit unitID="xmltestharness.te_xmlomxclient" mrp="" name="xmltestharness_te_xmlomxclient" bldFile="&layer_real_source_path;/te_xmlomxclient/group"/>
+ <unit unitID="xmltestharness.t_videoframesupplier" mrp="" name="xmltestharness_t_videoframesupplier" bldFile="&layer_real_source_path;/tools/t_videoframesupplier/group"/>
+ </component>
+ </module>
+ </layer>
+ </systemModel>
+</SystemDefinition>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/te_xmlomxclient/group/bld.inf Wed Aug 25 12:40:50 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:
+*
+*/
+
+
+PRJ_TESTEXPORTS
+./te_xmlomxclient.iby /epoc32/rom/include/te_xmlomxclient.iby
+
+../scripts/te_xmlomxclient.ini z:/mm/omx/te_xmlomxclient.ini
+
+../scripts/audio/te_omx_audio_dm_play.script z:/mm/omx/te_omx_audio_dm_play.script
+../scripts/audio/te_omx_audio_dm_play.xml z:/mm/omx/te_omx_audio_dm_play.xml
+../scripts/audio/te_omx_audio_dm_play_symbian.xml z:/mm/omx/te_omx_audio_dm_play_symbian.xml
+
+PRJ_TESTMMPFILES
+te_xmlomxclient.mmp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/te_xmlomxclient/group/component_test.pkg Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,46 @@
+;
+; 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 the License "Symbian Foundation License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:
+;
+
+
+"\epoc32\release\armv5\urel\te_xmlomxclient.exe"-"c:\sys\bin\te_xmlomxclient.exe"
+
+"\sf\adapt\openmaxil.nokia\omxilcomp\omxilgeneric\filesink\tests\unit\te_omx_filesink.ini"-"c:\omxil\tef\te_omx_filesink.ini"
+"\sf\adapt\openmaxil.nokia\omxilcomp\omxilgeneric\filesink\tests\unit\te_omx_filesink_audio.script"-"c:\omxil\tef\te_omx_filesink_audio.script"
+"\sf\adapt\openmaxil.nokia\omxilcomp\omxilgeneric\filesink\tests\unit\te_omx_filesink_audio.xml"-"c:\omxil\tef\te_omx_filesink_audio.xml"
+"\sf\adapt\openmaxil.nokia\omxilcomp\omxilgeneric\filesink\tests\unit\te_omx_filesink_image.script"-"c:\omxil\tef\te_omx_filesink_image.script"
+"\sf\adapt\openmaxil.nokia\omxilcomp\omxilgeneric\filesink\tests\unit\te_omx_filesink_image.xml"-"c:\omxil\tef\te_omx_filesink_image.xml"
+"\sf\adapt\openmaxil.nokia\omxilcomp\omxilgeneric\filesink\tests\unit\te_omx_filesink_other.script"-"c:\omxil\tef\te_omx_filesink_other.script"
+"\sf\adapt\openmaxil.nokia\omxilcomp\omxilgeneric\filesink\tests\unit\te_omx_filesink_other.xml"-"c:\omxil\tef\te_omx_filesink_other.xml"
+"\sf\adapt\openmaxil.nokia\omxilcomp\omxilgeneric\filesink\tests\unit\te_omx_filesink_video.script"-"c:\omxil\tef\te_omx_filesink_video.script"
+"\sf\adapt\openmaxil.nokia\omxilcomp\omxilgeneric\filesink\tests\unit\te_omx_filesink_video.xml"-"c:\omxil\tef\te_omx_filesink_video.xml"
+
+; The following is commented out because we don't have OMX.SYMBIAN.OTHER.CONTAINER_DEMUXER.3GP in Vasco
+; "\sf\adapt\openmaxil.nokia\omxilcomp\omxilgeneric\filesink\tests\unit\te_omx_filesink_video_compatibility.script"-"c:\omxil\tef\te_omx_filesink_video_compatibility.script"
+; "\sf\adapt\openmaxil.nokia\omxilcomp\omxilgeneric\filesink\tests\unit\te_omx_filesink_video_compatibility.xml"-"c:\omxil\tef\te_omx_filesink_video_compatibility.xml"
+
+"\sf\adapt\openmaxil.nokia\omxilcomp\omxilgeneric\filesource\tests\unit\te_omx_filesource_audio.script"-"c:\omxil\tef\te_omx_filesource_audio.script"
+"\sf\adapt\openmaxil.nokia\omxilcomp\omxilgeneric\filesource\tests\unit\te_omx_filesource_audio.xml"-"c:\omxil\tef\te_omx_filesource_audio.xml"
+"\sf\adapt\openmaxil.nokia\omxilcomp\omxilgeneric\filesource\tests\unit\te_omx_filesource_image.script"-"c:\omxil\tef\te_omx_filesource_image.script"
+"\sf\adapt\openmaxil.nokia\omxilcomp\omxilgeneric\filesource\tests\unit\te_omx_filesource_image.xml"-"c:\omxil\tef\te_omx_filesource_image.xml"
+"\sf\adapt\openmaxil.nokia\omxilcomp\omxilgeneric\filesource\tests\unit\te_omx_filesource_other.script"-"c:\omxil\tef\te_omx_filesource_other.script"
+"\sf\adapt\openmaxil.nokia\omxilcomp\omxilgeneric\filesource\tests\unit\te_omx_filesource_other.xml"-"c:\omxil\tef\te_omx_filesource_other.xml"
+"\sf\adapt\openmaxil.nokia\omxilcomp\omxilgeneric\filesource\tests\unit\te_omx_filesource_video.script"-"c:\omxil\tef\te_omx_filesource_video.script"
+"\sf\adapt\openmaxil.nokia\omxilcomp\omxilgeneric\filesource\tests\unit\te_omx_filesource_video.xml"-"c:\omxil\tef\te_omx_filesource_video.xml"
+"\sf\adapt\openmaxil.nokia\omxilcomp\omxilgeneric\filesource\tests\unit\te_omx_filesrc.ini"-"c:\omxil\tef\te_omx_filesrc.ini"
+
+"\ext\os\openmaxil_ext\omxiltests\khronosconf\data\aac.stream"-"c:\omxil\data\aac.stream"
+"\ext\os\openmaxil_ext\omxiltests\khronosconf\data\aac.stream.length"-"c:\omxil\data\aac.stream.length"
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/te_xmlomxclient/group/te_xmlomxclient.iby Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#ifndef TE_XMLOMXCLIENT_IBY
+#define TE_XMLOMXCLIENT_IBY
+
+#include <testexecute.iby>
+#include <xmlomxclient.iby>
+
+file=ABI_DIR\BUILD_DIR\te_xmlomxclient.exe sys\bin\te_xmlomxclient.exe
+
+data=EPOCROOT##epoc32\data\z\mm\omx\te_xmlomxclient.ini \mm\omx\te_xmlomxclient.ini
+
+#endif //TE_XMLOMXCLIENT_IBY
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/te_xmlomxclient/group/te_xmlomxclient.mmp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+TARGET te_xmlomxclient.exe
+TARGETTYPE exe
+UID 0x1000007A 0x1028668B
+CAPABILITY ALL -TCB
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+USERINCLUDE ..\src
+
+SOURCEPATH ..\src
+SOURCE te_xmlomxclient.cpp
+SOURCE omxxmltestblockcontroller.cpp
+SOURCE omxxmltestwrapper.cpp
+SOURCE omxxmltestrunner.cpp
+
+LIBRARY euser.lib
+LIBRARY testexecuteutils.lib
+LIBRARY xmlomxclient.lib
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/te_xmlomxclient/scripts/audio/te_omx_audio_dm_play.script Wed Aug 25 12:40:50 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:
+//
+
+LOAD_SUITE te_xmlomxclient
+
+PRINT Using Bellagio components where possible...
+
+START_TESTCASE TEST-OMX-DM-AUDIO-001
+ START_TEST_BLOCK !Heap=1572864 1000 te_xmlomxclient z:\mm\omx\te_xmlomxclient.ini
+ CREATE_OBJECT OmxXmlTestWrapper InstanceName
+ COMMAND InstanceName New z:\mm\omx\te_omx_audio_dm_play.xml
+ COMMAND InstanceName RunTest DemuxMuxAAC_LC
+ END_TEST_BLOCK
+
+
+ START_TEST_BLOCK !Heap=1572864 1000 te_xmlomxclient z:\mm\omx\te_xmlomxclient.ini
+ CREATE_OBJECT OmxXmlTestWrapper InstanceName
+ COMMAND InstanceName New z:\mm\omx\te_omx_audio_dm_play.xml
+ COMMAND InstanceName RunTest PlayAAC_LC
+ END_TEST_BLOCK
+END_TESTCASE TEST-OMX-DM-AUDIO-001
+
+
+START_TESTCASE TEST-OMX-DM-AUDIO-001
+ START_TEST_BLOCK !Heap=1572864 1000 te_xmlomxclient z:\mm\omx\te_xmlomxclient.ini
+ CREATE_OBJECT OmxXmlTestWrapper InstanceName
+ COMMAND InstanceName New z:\mm\omx\te_omx_audio_dm_play.xml
+ COMMAND InstanceName RunTest DemuxMuxAAC_SBR
+ END_TEST_BLOCK
+
+
+ START_TEST_BLOCK !Heap=1572864 1000 te_xmlomxclient z:\mm\omx\te_xmlomxclient.ini
+ CREATE_OBJECT OmxXmlTestWrapper InstanceName
+ COMMAND InstanceName New z:\mm\omx\te_omx_audio_dm_play.xml
+ COMMAND InstanceName RunTest PlayAAC_SBR
+ END_TEST_BLOCK
+END_TESTCASE TEST-OMX-DM-AUDIO-001
+
+
+START_TESTCASE TEST-OMX-DM-AUDIO-001
+ START_TEST_BLOCK !Heap=1572864 1000 te_xmlomxclient z:\mm\omx\te_xmlomxclient.ini
+ CREATE_OBJECT OmxXmlTestWrapper InstanceName
+ COMMAND InstanceName New z:\mm\omx\te_omx_audio_dm_play.xml
+ COMMAND InstanceName RunTest DemuxMuxAAC_HEv2
+ END_TEST_BLOCK
+
+
+ START_TEST_BLOCK !Heap=1572864 1000 te_xmlomxclient z:\mm\omx\te_xmlomxclient.ini
+ CREATE_OBJECT OmxXmlTestWrapper InstanceName
+ COMMAND InstanceName New z:\mm\omx\te_omx_audio_dm_play.xml
+ COMMAND InstanceName RunTest PlayAAC_HEv2
+ END_TEST_BLOCK
+END_TESTCASE TEST-OMX-DM-AUDIO-001
+
+
+PRINT Using Symbian components where possible...
+
+START_TESTCASE TEST-OMX-DM-AUDIO-001-SYM
+ START_TEST_BLOCK !Heap=1572864 1000 te_xmlomxclient z:\mm\omx\te_xmlomxclient.ini
+ CREATE_OBJECT OmxXmlTestWrapper InstanceName
+ COMMAND InstanceName New z:\mm\omx\te_omx_audio_dm_play_symbian.xml
+ COMMAND InstanceName RunTest DemuxMuxAAC_LC_Symbian
+ END_TEST_BLOCK
+
+
+ START_TEST_BLOCK !Heap=1572864 1000 te_xmlomxclient z:\mm\omx\te_xmlomxclient.ini
+ CREATE_OBJECT OmxXmlTestWrapper InstanceName
+ COMMAND InstanceName New z:\mm\omx\te_omx_audio_dm_play_symbian.xml
+ COMMAND InstanceName RunTest PlayAAC_LC_Symbian
+ END_TEST_BLOCK
+END_TESTCASE TEST-OMX-DM-AUDIO-001-SYM
+
+
+START_TESTCASE TEST-OMX-DM-AUDIO-001-SYM
+ START_TEST_BLOCK !Heap=1572864 1000 te_xmlomxclient z:\mm\omx\te_xmlomxclient.ini
+ CREATE_OBJECT OmxXmlTestWrapper InstanceName
+ COMMAND InstanceName New z:\mm\omx\te_omx_audio_dm_play_symbian.xml
+ COMMAND InstanceName RunTest DemuxMuxAAC_SBR_Symbian
+ END_TEST_BLOCK
+
+
+ START_TEST_BLOCK !Heap=1572864 1000 te_xmlomxclient z:\mm\omx\te_xmlomxclient.ini
+ CREATE_OBJECT OmxXmlTestWrapper InstanceName
+ COMMAND InstanceName New z:\mm\omx\te_omx_audio_dm_play_symbian.xml
+ COMMAND InstanceName RunTest PlayAAC_SBR_Symbian
+ END_TEST_BLOCK
+END_TESTCASE TEST-OMX-DM-AUDIO-001-SYM
+
+
+START_TESTCASE TEST-OMX-DM-AUDIO-001-SYM
+ START_TEST_BLOCK !Heap=1572864 1000 te_xmlomxclient z:\mm\omx\te_xmlomxclient.ini
+ CREATE_OBJECT OmxXmlTestWrapper InstanceName
+ COMMAND InstanceName New z:\mm\omx\te_omx_audio_dm_play_symbian.xml
+ COMMAND InstanceName RunTest DemuxMuxAAC_HEv2_Symbian
+ END_TEST_BLOCK
+
+
+ START_TEST_BLOCK !Heap=1572864 1000 te_xmlomxclient z:\mm\omx\te_xmlomxclient.ini
+ CREATE_OBJECT OmxXmlTestWrapper InstanceName
+ COMMAND InstanceName New z:\mm\omx\te_omx_audio_dm_play_symbian.xml
+ COMMAND InstanceName RunTest PlayAAC_HEv2_Symbian
+ END_TEST_BLOCK
+END_TESTCASE TEST-OMX-DM-AUDIO-001-SYM
+
+PRINT Complete te_omx_audio Tests
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/te_xmlomxclient/scripts/audio/te_omx_audio_dm_play.xml Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,273 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ All rights reserved.
+ This component and the accompanying materials are made available
+ under the terms of "Eclipse Public License v1.0"
+ which accompanies this distribution, and is available
+ at the URL "http://www.eclipse.org/legal/epl-v10.html".
+
+ Initial Contributors:
+ Nokia Corporation - initial contribution.
+
+ Contributors:
+
+ Description:
+
+ Audio playback tests for OpenMAX IL.
+
+-->
+<TestSet>
+ <!--
+ 3GP Demuxer -> 3GP Muxer
+
+ Demux a MP4 file and mux it back to a MP4 file
+ -->
+ <Test name="DemuxMuxAAC_LC">
+ <!-- Note: for now the load order will be the state transition order, and it is assumed 3GP is a non-supplier -->
+ <LoadComponent comp="3gpd" name="OMX.SYMBIAN.OTHER.CONTAINER_DEMUXER.3GP" />
+ <LoadComponent comp="3gpm" name="OMX.SYMBIAN.OTHER.CONTAINER_MUXER.3GP" />
+
+ <!-- Disable video port -->
+ <DisablePort port="3gpd:1"/>
+ <!-- Expect port disabled event (nData=2) on port 1 -->
+ <ExpectEvent comp="3gpd" event="CmdComplete" nData1="PortDisable" nData2="1" />
+ <!-- Disable clock port -->
+ <DisablePort port="3gpd:2"/>
+ <!-- Expect port disabled event (nData=2) on port 2 -->
+ <ExpectEvent comp="3gpd" event="CmdComplete" nData1="PortDisable" nData2="2" />
+
+ <!-- Disable video port -->
+ <DisablePort port="3gpm:1"/>
+ <!-- Expect port disabled event (nData=2) on port 1 -->
+ <ExpectEvent comp="3gpm" event="CmdComplete" nData1="PortDisable" nData2="1" />
+
+ <BufferSupplierOverride output="3gpd:1" input="3gpm:0" supplier="input" />
+
+ <SetBufferCount port="3gpd:0" count="1" />
+ <SetBufferCount port="3gpm:0" count="1" />
+
+ <SetupTunnel output="3gpd:0" input="3gpm:0" />
+
+ <SetFilename comp="3gpd" filename="c:\mm\omx\away_lc_15sec.m4a" />
+ <SetFilename comp="3gpm" filename="c:\mm\omx\away_lc_muxer.m4a" />
+
+ <SetAudioPortDef port="3gpd:0" codingType="autodetect" />
+ <AllTransition state="idle" />
+ <ExpectEvent comp="3gpd" event="PortFormatDetected" nData1="0" nData2="0" />
+ <ExpectEvent comp="3gpd" event="PortSettingsChanged" nData1="0x02000001" nData2="0" />
+
+
+ <AllTransition state="executing" />
+ <WaitEOS />
+ <AllTransition state="idle" />
+ <AllTransition state="loaded" />
+ </Test>
+
+ <!--
+ 3GP Demuxer -> AAC Decoder -> PCM Renderer
+
+ Play an MPEG4 stream from a 3GP or MP4 file, terminating on the End Of Stream flag.
+ -->
+ <Test name="PlayAAC_LC">
+ <!-- Note: for now the load order will be the state transition order, and it is assumed 3GP is a non-supplier -->
+ <LoadComponent comp="3gp" name="OMX.SYMBIAN.OTHER.CONTAINER_DEMUXER.3GP" />
+ <LoadComponent comp="aacdec" name="OMX.Nokia.audio_decoder.aac.mcu" />
+ <LoadComponent comp="pcmren" name="OMX.NOKIA.AUDIO.RENDERER.PCM" />
+ <!-- Disable unused client clock ports -->
+ <DisablePort port="pcmren:1"/>
+ <ExpectEvent comp="pcmren" event="CmdComplete" nData1="PortDisable" nData2="1" />
+ <!-- Disable video port -->
+ <DisablePort port="3gp:1"/>
+ <!-- Expect port disabled event (nData=2) on port 1 -->
+ <ExpectEvent comp="3gp" event="CmdComplete" nData1="PortDisable" nData2="1" />
+ <!-- Disable clock port -->
+ <DisablePort port="3gp:2"/>
+ <!-- Expect port disabled event (nData=2) on port 2 -->
+ <ExpectEvent comp="3gp" event="CmdComplete" nData1="PortDisable" nData2="2" />
+ <BufferSupplierOverride output="3gp:1" input="aacdec:0" supplier="input" />
+ <SetBufferCount port="3gp:0" count="2" />
+ <SetBufferCount port="aacdec:0" count="2" />
+ <SetupTunnel output="3gp:0" input="aacdec:0" />
+ <BufferSupplierOverride output="aacdec:1" input="pcmren:0" supplier="input" />
+ <SetBufferCount port="aacdec:1" count="2" />
+ <SetBufferCount port="pcmren:0" count="2" />
+ <SetPcmAudioPortDef port="aacdec:1" channels="2" samplingrate="44100" bitspersample="16"/>
+ <SetPcmAudioPortDef port="pcmren:0" channels="2" samplingrate="44100" bitspersample="16"/>
+ <SetupTunnel output="aacdec:1" input="pcmren:0" />
+ <SetFilename comp="3gp" filename="c:\mm\omx\away_lc_muxer.m4a" />
+ <SetAudioPortDef port="3gp:0" codingType="autodetect" />
+ <AllTransition state="idle" />
+ <ExpectEvent comp="3gp" event="PortFormatDetected" nData1="0" nData2="0" />
+ <ExpectEvent comp="3gp" event="PortSettingsChanged" nData1="0x02000001" nData2="0" />
+ <IgnoreEvent comp="pcmren" event="Error" nData1="Underflow" nData2="0" />
+
+ <ExpectEvent comp="aacdec" event="PortSettingsChanged" nData1="1" nData2="0" />
+
+ <AllTransition state="executing" />
+ <WaitEOS />
+ <AllTransition state="idle" />
+ <AllTransition state="loaded" />
+ </Test>
+ <Test name="DemuxMuxAAC_SBR">
+ <!-- Note: for now the load order will be the state transition order, and it is assumed 3GP is a non-supplier -->
+ <LoadComponent comp="3gpd" name="OMX.SYMBIAN.OTHER.CONTAINER_DEMUXER.3GP" />
+ <LoadComponent comp="3gpm" name="OMX.SYMBIAN.OTHER.CONTAINER_MUXER.3GP" />
+
+ <!-- Disable video port -->
+ <DisablePort port="3gpd:1"/>
+ <!-- Expect port disabled event (nData=2) on port 1 -->
+ <ExpectEvent comp="3gpd" event="CmdComplete" nData1="PortDisable" nData2="1" />
+ <!-- Disable clock port -->
+ <DisablePort port="3gpd:2"/>
+ <!-- Expect port disabled event (nData=2) on port 2 -->
+ <ExpectEvent comp="3gpd" event="CmdComplete" nData1="PortDisable" nData2="2" />
+
+ <!-- Disable video port -->
+ <DisablePort port="3gpm:1"/>
+ <!-- Expect port disabled event (nData=2) on port 1 -->
+ <ExpectEvent comp="3gpm" event="CmdComplete" nData1="PortDisable" nData2="1" />
+
+ <BufferSupplierOverride output="3gpd:1" input="3gpm:0" supplier="input" />
+
+ <SetBufferCount port="3gpd:0" count="1" />
+ <SetBufferCount port="3gpm:0" count="1" />
+
+ <SetupTunnel output="3gpd:0" input="3gpm:0" />
+
+ <SetFilename comp="3gpd" filename="c:\mm\omx\away_sbr.m4a" />
+ <SetFilename comp="3gpm" filename="c:\mm\omx\away_sbr_muxer.m4a" />
+
+ <SetAudioPortDef port="3gpd:0" codingType="autodetect" />
+ <AllTransition state="idle" />
+ <ExpectEvent comp="3gpd" event="PortFormatDetected" nData1="0" nData2="0" />
+ <ExpectEvent comp="3gpd" event="PortSettingsChanged" nData1="0x02000001" nData2="0" />
+
+
+ <AllTransition state="executing" />
+ <WaitEOS />
+ <AllTransition state="idle" />
+ <AllTransition state="loaded" />
+ </Test>
+ <Test name="PlayAAC_SBR">
+ <!-- Note: for now the load order will be the state transition order, and it is assumed 3GP is a non-supplier -->
+ <LoadComponent comp="3gp" name="OMX.SYMBIAN.OTHER.CONTAINER_DEMUXER.3GP" />
+ <LoadComponent comp="aacdec" name="OMX.Nokia.audio_decoder.aac.mcu" />
+ <LoadComponent comp="pcmren" name="OMX.NOKIA.AUDIO.RENDERER.PCM" />
+ <!-- Disable unused client clock ports -->
+ <DisablePort port="pcmren:1"/>
+ <ExpectEvent comp="pcmren" event="CmdComplete" nData1="PortDisable" nData2="1" />
+ <!-- Disable video port -->
+ <DisablePort port="3gp:1"/>
+ <!-- Expect port disabled event (nData=2) on port 1 -->
+ <ExpectEvent comp="3gp" event="CmdComplete" nData1="PortDisable" nData2="1" />
+ <!-- Disable clock port -->
+ <DisablePort port="3gp:2"/>
+ <!-- Expect port disabled event (nData=2) on port 2 -->
+ <ExpectEvent comp="3gp" event="CmdComplete" nData1="PortDisable" nData2="2" />
+ <BufferSupplierOverride output="3gp:1" input="aacdec:0" supplier="input" />
+ <SetBufferCount port="3gp:0" count="2" />
+ <SetBufferCount port="aacdec:0" count="2" />
+ <SetupTunnel output="3gp:0" input="aacdec:0" />
+ <BufferSupplierOverride output="aacdec:1" input="pcmren:0" supplier="input" />
+ <SetBufferCount port="aacdec:1" count="2" />
+ <SetBufferCount port="pcmren:0" count="2" />
+ <SetPcmAudioPortDef port="aacdec:1" channels="2" samplingrate="44100" bitspersample="16"/>
+ <SetPcmAudioPortDef port="pcmren:0" channels="2" samplingrate="44100" bitspersample="16"/>
+ <SetupTunnel output="aacdec:1" input="pcmren:0" />
+ <SetFilename comp="3gp" filename="c:\mm\omx\away_sbr.m4a" />
+ <SetAudioPortDef port="3gp:0" codingType="autodetect" />
+ <AllTransition state="idle" />
+ <ExpectEvent comp="3gp" event="PortFormatDetected" nData1="0" nData2="0" />
+ <ExpectEvent comp="3gp" event="PortSettingsChanged" nData1="0x02000001" nData2="0" />
+ <IgnoreEvent comp="pcmren" event="Error" nData1="Underflow" nData2="0" />
+
+ <ExpectEvent comp="aacdec" event="PortSettingsChanged" nData1="1" nData2="0" />
+
+ <AllTransition state="executing" />
+ <WaitEOS />
+ <AllTransition state="idle" />
+ <AllTransition state="loaded" />
+ </Test>
+ <Test name="DemuxMuxAAC_HEv2">
+ <!-- Note: for now the load order will be the state transition order, and it is assumed 3GP is a non-supplier -->
+ <LoadComponent comp="3gpd" name="OMX.SYMBIAN.OTHER.CONTAINER_DEMUXER.3GP" />
+ <LoadComponent comp="3gpm" name="OMX.SYMBIAN.OTHER.CONTAINER_MUXER.3GP" />
+
+ <!-- Disable video port -->
+ <DisablePort port="3gpd:1"/>
+ <!-- Expect port disabled event (nData=2) on port 1 -->
+ <ExpectEvent comp="3gpd" event="CmdComplete" nData1="PortDisable" nData2="1" />
+ <!-- Disable clock port -->
+ <DisablePort port="3gpd:2"/>
+ <!-- Expect port disabled event (nData=2) on port 2 -->
+ <ExpectEvent comp="3gpd" event="CmdComplete" nData1="PortDisable" nData2="2" />
+
+ <!-- Disable video port -->
+ <DisablePort port="3gpm:1"/>
+ <!-- Expect port disabled event (nData=2) on port 1 -->
+ <ExpectEvent comp="3gpm" event="CmdComplete" nData1="PortDisable" nData2="1" />
+
+ <BufferSupplierOverride output="3gpd:1" input="3gpm:0" supplier="input" />
+
+ <SetBufferCount port="3gpd:0" count="1" />
+ <SetBufferCount port="3gpm:0" count="1" />
+
+ <SetupTunnel output="3gpd:0" input="3gpm:0" />
+
+ <SetFilename comp="3gpd" filename="c:\mm\omx\pretender_hev2.m4a" />
+ <SetFilename comp="3gpm" filename="c:\mm\omx\pretender_hev2_muxer.m4a" />
+
+ <SetAudioPortDef port="3gpd:0" codingType="autodetect" />
+ <AllTransition state="idle" />
+ <ExpectEvent comp="3gpd" event="PortFormatDetected" nData1="0" nData2="0" />
+ <ExpectEvent comp="3gpd" event="PortSettingsChanged" nData1="0x02000001" nData2="0" />
+
+
+ <AllTransition state="executing" />
+ <WaitEOS />
+ <AllTransition state="idle" />
+ <AllTransition state="loaded" />
+ </Test>
+ <Test name="PlayAAC_HEv2">
+ <!-- Note: for now the load order will be the state transition order, and it is assumed 3GP is a non-supplier -->
+ <LoadComponent comp="3gp" name="OMX.SYMBIAN.OTHER.CONTAINER_DEMUXER.3GP" />
+ <LoadComponent comp="aacdec" name="OMX.Nokia.audio_decoder.aac.mcu" />
+ <LoadComponent comp="pcmren" name="OMX.NOKIA.AUDIO.RENDERER.PCM" />
+ <!-- Disable unused client clock ports -->
+ <DisablePort port="pcmren:1"/>
+ <ExpectEvent comp="pcmren" event="CmdComplete" nData1="PortDisable" nData2="1" />
+ <!-- Disable video port -->
+ <DisablePort port="3gp:1"/>
+ <!-- Expect port disabled event (nData=2) on port 1 -->
+ <ExpectEvent comp="3gp" event="CmdComplete" nData1="PortDisable" nData2="1" />
+ <!-- Disable clock port -->
+ <DisablePort port="3gp:2"/>
+ <!-- Expect port disabled event (nData=2) on port 2 -->
+ <ExpectEvent comp="3gp" event="CmdComplete" nData1="PortDisable" nData2="2" />
+ <BufferSupplierOverride output="3gp:1" input="aacdec:0" supplier="input" />
+ <SetBufferCount port="3gp:0" count="2" />
+ <SetBufferCount port="aacdec:0" count="2" />
+ <SetupTunnel output="3gp:0" input="aacdec:0" />
+ <BufferSupplierOverride output="aacdec:1" input="pcmren:0" supplier="input" />
+ <SetBufferCount port="aacdec:1" count="2" />
+ <SetBufferCount port="pcmren:0" count="2" />
+ <SetPcmAudioPortDef port="aacdec:1" channels="2" samplingrate="44100" bitspersample="16"/>
+ <SetPcmAudioPortDef port="pcmren:0" channels="2" samplingrate="44100" bitspersample="16"/>
+ <SetupTunnel output="aacdec:1" input="pcmren:0" />
+ <SetFilename comp="3gp" filename="c:\mm\omx\pretender_hev2_muxer.m4a" />
+ <SetAudioPortDef port="3gp:0" codingType="autodetect" />
+ <AllTransition state="idle" />
+ <ExpectEvent comp="3gp" event="PortFormatDetected" nData1="0" nData2="0" />
+ <ExpectEvent comp="3gp" event="PortSettingsChanged" nData1="0x02000001" nData2="0" />
+ <IgnoreEvent comp="pcmren" event="Error" nData1="Underflow" nData2="0" />
+
+ <ExpectEvent comp="aacdec" event="PortSettingsChanged" nData1="1" nData2="0" />
+
+ <AllTransition state="executing" />
+ <WaitEOS />
+ <AllTransition state="idle" />
+ <AllTransition state="loaded" />
+ </Test>
+
+</TestSet>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/te_xmlomxclient/scripts/audio/te_omx_audio_dm_play_symbian.xml Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,265 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+
+ Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ All rights reserved.
+ This component and the accompanying materials are made available
+ under the terms of "Eclipse Public License v1.0"
+ which accompanies this distribution, and is available
+ at the URL "http://www.eclipse.org/legal/epl-v10.html".
+
+ Initial Contributors:
+ Nokia Corporation - initial contribution.
+
+ Contributors:
+
+ Description:
+
+ Audio playback tests for OpenMAX IL.
+
+-->
+<TestSet>
+ <!--
+ 3GP Demuxer -> 3GP Muxer
+
+ Demux a MP4 file and mux it back to a MP4 file
+ -->
+ <Test name="DemuxMuxAAC_LC_Symbian">
+ <!-- Note: for now the load order will be the state transition order, and it is assumed 3GP is a non-supplier -->
+ <LoadComponent comp="3gpd" name="OMX.SYMBIAN.OTHER.CONTAINER_DEMUXER.3GP" />
+ <LoadComponent comp="3gpm" name="OMX.SYMBIAN.OTHER.CONTAINER_MUXER.3GP" />
+
+ <!-- Disable video port -->
+ <DisablePort port="3gpd:1"/>
+ <!-- Expect port disabled event (nData=2) on port 1 -->
+ <ExpectEvent comp="3gpd" event="CmdComplete" nData1="PortDisable" nData2="1" />
+ <!-- Disable clock port -->
+ <DisablePort port="3gpd:2"/>
+ <!-- Expect port disabled event (nData=2) on port 2 -->
+ <ExpectEvent comp="3gpd" event="CmdComplete" nData1="PortDisable" nData2="2" />
+
+ <!-- Disable video port -->
+ <DisablePort port="3gpm:1"/>
+ <!-- Expect port disabled event (nData=2) on port 1 -->
+ <ExpectEvent comp="3gpm" event="CmdComplete" nData1="PortDisable" nData2="1" />
+
+ <BufferSupplierOverride output="3gpd:1" input="3gpm:0" supplier="input" />
+
+ <SetBufferCount port="3gpd:0" count="1" />
+ <SetBufferCount port="3gpm:0" count="1" />
+
+ <SetupTunnel output="3gpd:0" input="3gpm:0" />
+
+ <SetFilename comp="3gpd" filename="c:\mm\omx\away_lc_15sec.m4a" />
+ <SetFilename comp="3gpm" filename="c:\mm\omx\away_lc_muxer.m4a" />
+
+ <SetAudioPortDef port="3gpd:0" codingType="autodetect" />
+ <AllTransition state="idle" />
+ <ExpectEvent comp="3gpd" event="PortFormatDetected" nData1="0" nData2="0" />
+ <ExpectEvent comp="3gpd" event="PortSettingsChanged" nData1="0x02000001" nData2="0" />
+
+
+ <AllTransition state="executing" />
+ <WaitEOS />
+ <AllTransition state="idle" />
+ <AllTransition state="loaded" />
+ </Test>
+
+ <!--
+ 3GP Demuxer -> AAC Decoder -> PCM Renderer
+
+ Play an MPEG4 stream from a 3GP or MP4 file, terminating on the End Of Stream flag.
+ -->
+ <Test name="PlayAAC_LC_Symbian">
+ <!-- Note: for now the load order will be the state transition order, and it is assumed 3GP is a non-supplier -->
+ <LoadComponent comp="3gp" name="OMX.SYMBIAN.OTHER.CONTAINER_DEMUXER.3GP" />
+ <LoadComponent comp="aacdec" name="OMX.SYMBIAN.AUDIO.DECODER.AAC" />
+ <LoadComponent comp="pcmren" name="OMX.NOKIA.AUDIO.RENDERER.PCM" />
+ <!-- Disable unused client clock ports -->
+ <DisablePort port="pcmren:1"/>
+ <ExpectEvent comp="pcmren" event="CmdComplete" nData1="PortDisable" nData2="1" />
+ <!-- Disable video port -->
+ <DisablePort port="3gp:1"/>
+ <!-- Expect port disabled event (nData=2) on port 1 -->
+ <ExpectEvent comp="3gp" event="CmdComplete" nData1="PortDisable" nData2="1" />
+ <!-- Disable clock port -->
+ <DisablePort port="3gp:2"/>
+ <!-- Expect port disabled event (nData=2) on port 2 -->
+ <ExpectEvent comp="3gp" event="CmdComplete" nData1="PortDisable" nData2="2" />
+ <BufferSupplierOverride output="3gp:1" input="aacdec:0" supplier="input" />
+ <SetBufferCount port="3gp:0" count="1" />
+ <SetBufferCount port="aacdec:0" count="1" />
+ <SetupTunnel output="3gp:0" input="aacdec:0" />
+ <BufferSupplierOverride output="aacdec:1" input="pcmren:0" supplier="input" />
+ <SetBufferCount port="aacdec:1" count="2" />
+ <SetBufferCount port="pcmren:0" count="2" />
+ <SetPcmAudioPortDef port="aacdec:1" channels="2" samplingrate="44100" bitspersample="16"/>
+ <SetPcmAudioPortDef port="pcmren:0" channels="2" samplingrate="44100" bitspersample="16"/>
+ <SetupTunnel output="aacdec:1" input="pcmren:0" />
+ <SetFilename comp="3gp" filename="c:\mm\omx\away_lc_muxer.m4a" />
+ <SetAudioPortDef port="3gp:0" codingType="autodetect" />
+ <AllTransition state="idle" />
+ <ExpectEvent comp="3gp" event="PortFormatDetected" nData1="0" nData2="0" />
+ <ExpectEvent comp="3gp" event="PortSettingsChanged" nData1="0x02000001" nData2="0" />
+ <IgnoreEvent comp="pcmren" event="Error" nData1="Underflow" nData2="0" />
+ <AllTransition state="executing" />
+ <WaitEOS />
+ <AllTransition state="idle" />
+ <AllTransition state="loaded" />
+ </Test>
+ <Test name="DemuxMuxAAC_SBR_Symbian">
+ <!-- Note: for now the load order will be the state transition order, and it is assumed 3GP is a non-supplier -->
+ <LoadComponent comp="3gpd" name="OMX.SYMBIAN.OTHER.CONTAINER_DEMUXER.3GP" />
+ <LoadComponent comp="3gpm" name="OMX.SYMBIAN.OTHER.CONTAINER_MUXER.3GP" />
+
+ <!-- Disable video port -->
+ <DisablePort port="3gpd:1"/>
+ <!-- Expect port disabled event (nData=2) on port 1 -->
+ <ExpectEvent comp="3gpd" event="CmdComplete" nData1="PortDisable" nData2="1" />
+ <!-- Disable clock port -->
+ <DisablePort port="3gpd:2"/>
+ <!-- Expect port disabled event (nData=2) on port 2 -->
+ <ExpectEvent comp="3gpd" event="CmdComplete" nData1="PortDisable" nData2="2" />
+
+ <!-- Disable video port -->
+ <DisablePort port="3gpm:1"/>
+ <!-- Expect port disabled event (nData=2) on port 1 -->
+ <ExpectEvent comp="3gpm" event="CmdComplete" nData1="PortDisable" nData2="1" />
+
+ <BufferSupplierOverride output="3gpd:1" input="3gpm:0" supplier="input" />
+
+ <SetBufferCount port="3gpd:0" count="1" />
+ <SetBufferCount port="3gpm:0" count="1" />
+
+ <SetupTunnel output="3gpd:0" input="3gpm:0" />
+
+ <SetFilename comp="3gpd" filename="c:\mm\omx\away_sbr.m4a" />
+ <SetFilename comp="3gpm" filename="c:\mm\omx\away_sbr_muxer.m4a" />
+
+ <SetAudioPortDef port="3gpd:0" codingType="autodetect" />
+ <AllTransition state="idle" />
+ <ExpectEvent comp="3gpd" event="PortFormatDetected" nData1="0" nData2="0" />
+ <ExpectEvent comp="3gpd" event="PortSettingsChanged" nData1="0x02000001" nData2="0" />
+
+
+ <AllTransition state="executing" />
+ <WaitEOS />
+ <AllTransition state="idle" />
+ <AllTransition state="loaded" />
+ </Test>
+ <Test name="PlayAAC_SBR_Symbian">
+ <!-- Note: for now the load order will be the state transition order, and it is assumed 3GP is a non-supplier -->
+ <LoadComponent comp="3gp" name="OMX.SYMBIAN.OTHER.CONTAINER_DEMUXER.3GP" />
+ <LoadComponent comp="aacdec" name="OMX.SYMBIAN.AUDIO.DECODER.AAC" />
+ <LoadComponent comp="pcmren" name="OMX.NOKIA.AUDIO.RENDERER.PCM" />
+ <!-- Disable unused client clock ports -->
+ <DisablePort port="pcmren:1"/>
+ <ExpectEvent comp="pcmren" event="CmdComplete" nData1="PortDisable" nData2="1" />
+ <!-- Disable video port -->
+ <DisablePort port="3gp:1"/>
+ <!-- Expect port disabled event (nData=2) on port 1 -->
+ <ExpectEvent comp="3gp" event="CmdComplete" nData1="PortDisable" nData2="1" />
+ <!-- Disable clock port -->
+ <DisablePort port="3gp:2"/>
+ <!-- Expect port disabled event (nData=2) on port 2 -->
+ <ExpectEvent comp="3gp" event="CmdComplete" nData1="PortDisable" nData2="2" />
+ <BufferSupplierOverride output="3gp:1" input="aacdec:0" supplier="input" />
+ <SetBufferCount port="3gp:0" count="1" />
+ <SetBufferCount port="aacdec:0" count="1" />
+ <SetupTunnel output="3gp:0" input="aacdec:0" />
+ <BufferSupplierOverride output="aacdec:1" input="pcmren:0" supplier="input" />
+ <SetBufferCount port="aacdec:1" count="2" />
+ <SetBufferCount port="pcmren:0" count="2" />
+ <SetPcmAudioPortDef port="aacdec:1" channels="2" samplingrate="44100" bitspersample="16"/>
+ <SetPcmAudioPortDef port="pcmren:0" channels="2" samplingrate="44100" bitspersample="16"/>
+ <SetupTunnel output="aacdec:1" input="pcmren:0" />
+ <SetFilename comp="3gp" filename="c:\mm\omx\away_sbr_muxer.m4a" />
+ <SetAudioPortDef port="3gp:0" codingType="autodetect" />
+ <AllTransition state="idle" />
+ <ExpectEvent comp="3gp" event="PortFormatDetected" nData1="0" nData2="0" />
+ <ExpectEvent comp="3gp" event="PortSettingsChanged" nData1="0x02000001" nData2="0" />
+ <IgnoreEvent comp="pcmren" event="Error" nData1="Underflow" nData2="0" />
+ <AllTransition state="executing" />
+ <WaitEOS />
+ <AllTransition state="idle" />
+ <AllTransition state="loaded" />
+ </Test>
+ <Test name="DemuxMuxAAC_HEv2_Symbian">
+ <!-- Note: for now the load order will be the state transition order, and it is assumed 3GP is a non-supplier -->
+ <LoadComponent comp="3gpd" name="OMX.SYMBIAN.OTHER.CONTAINER_DEMUXER.3GP" />
+ <LoadComponent comp="3gpm" name="OMX.SYMBIAN.OTHER.CONTAINER_MUXER.3GP" />
+
+ <!-- Disable video port -->
+ <DisablePort port="3gpd:1"/>
+ <!-- Expect port disabled event (nData=2) on port 1 -->
+ <ExpectEvent comp="3gpd" event="CmdComplete" nData1="PortDisable" nData2="1" />
+ <!-- Disable clock port -->
+ <DisablePort port="3gpd:2"/>
+ <!-- Expect port disabled event (nData=2) on port 2 -->
+ <ExpectEvent comp="3gpd" event="CmdComplete" nData1="PortDisable" nData2="2" />
+
+ <!-- Disable video port -->
+ <DisablePort port="3gpm:1"/>
+ <!-- Expect port disabled event (nData=2) on port 1 -->
+ <ExpectEvent comp="3gpm" event="CmdComplete" nData1="PortDisable" nData2="1" />
+
+ <BufferSupplierOverride output="3gpd:1" input="3gpm:0" supplier="input" />
+
+ <SetBufferCount port="3gpd:0" count="1" />
+ <SetBufferCount port="3gpm:0" count="1" />
+
+ <SetupTunnel output="3gpd:0" input="3gpm:0" />
+
+ <SetFilename comp="3gpd" filename="c:\mm\omx\pretender_hev2.m4a" />
+ <SetFilename comp="3gpm" filename="c:\mm\omx\pretender_hev2_muxer.m4a" />
+
+ <SetAudioPortDef port="3gpd:0" codingType="autodetect" />
+ <AllTransition state="idle" />
+ <ExpectEvent comp="3gpd" event="PortFormatDetected" nData1="0" nData2="0" />
+ <ExpectEvent comp="3gpd" event="PortSettingsChanged" nData1="0x02000001" nData2="0" />
+
+
+ <AllTransition state="executing" />
+ <WaitEOS />
+ <AllTransition state="idle" />
+ <AllTransition state="loaded" />
+ </Test>
+ <Test name="PlayAAC_HEv2_Symbian">
+ <!-- Note: for now the load order will be the state transition order, and it is assumed 3GP is a non-supplier -->
+ <LoadComponent comp="3gp" name="OMX.SYMBIAN.OTHER.CONTAINER_DEMUXER.3GP" />
+ <LoadComponent comp="aacdec" name="OMX.SYMBIAN.AUDIO.DECODER.AAC" />
+ <LoadComponent comp="pcmren" name="OMX.NOKIA.AUDIO.RENDERER.PCM" />
+ <!-- Disable unused client clock ports -->
+ <DisablePort port="pcmren:1"/>
+ <ExpectEvent comp="pcmren" event="CmdComplete" nData1="PortDisable" nData2="1" />
+ <!-- Disable video port -->
+ <DisablePort port="3gp:1"/>
+ <!-- Expect port disabled event (nData=2) on port 1 -->
+ <ExpectEvent comp="3gp" event="CmdComplete" nData1="PortDisable" nData2="1" />
+ <!-- Disable clock port -->
+ <DisablePort port="3gp:2"/>
+ <!-- Expect port disabled event (nData=2) on port 2 -->
+ <ExpectEvent comp="3gp" event="CmdComplete" nData1="PortDisable" nData2="2" />
+ <BufferSupplierOverride output="3gp:1" input="aacdec:0" supplier="input" />
+ <SetBufferCount port="3gp:0" count="1" />
+ <SetBufferCount port="aacdec:0" count="1" />
+ <SetupTunnel output="3gp:0" input="aacdec:0" />
+ <BufferSupplierOverride output="aacdec:1" input="pcmren:0" supplier="input" />
+ <SetBufferCount port="aacdec:1" count="2" />
+ <SetBufferCount port="pcmren:0" count="2" />
+ <SetPcmAudioPortDef port="aacdec:1" channels="2" samplingrate="44100" bitspersample="16"/>
+ <SetPcmAudioPortDef port="pcmren:0" channels="2" samplingrate="44100" bitspersample="16"/>
+ <SetupTunnel output="aacdec:1" input="pcmren:0" />
+ <SetFilename comp="3gp" filename="c:\mm\omx\pretender_hev2_muxer.m4a" />
+ <SetAudioPortDef port="3gp:0" codingType="autodetect" />
+ <AllTransition state="idle" />
+ <ExpectEvent comp="3gp" event="PortFormatDetected" nData1="0" nData2="0" />
+ <ExpectEvent comp="3gp" event="PortSettingsChanged" nData1="0x02000001" nData2="0" />
+ <IgnoreEvent comp="pcmren" event="Error" nData1="Underflow" nData2="0" />
+ <AllTransition state="executing" />
+ <WaitEOS />
+ <AllTransition state="idle" />
+ <AllTransition state="loaded" />
+ </Test>
+
+</TestSet>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/te_xmlomxclient/scripts/te_xmlomxclient.ini Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,2 @@
+[InstanceName]
+name=OmxXmlTestObject
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/te_xmlomxclient/src/omxxmltestblockcontroller.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "omxxmltestblockcontroller.h"
+#include "omxxmltestwrapper.h"
+
+_LIT(KOmxXmlTestWrapper, "OmxXmlTestWrapper");
+
+COmxXmlTestBlockController* COmxXmlTestBlockController::NewL()
+ {
+ return new(ELeave) COmxXmlTestBlockController();
+ }
+
+COmxXmlTestBlockController::COmxXmlTestBlockController()
+ {
+
+ }
+
+CDataWrapper* COmxXmlTestBlockController::CreateDataL(const TDesC& aData)
+ {
+ CDataWrapper* wrapper = NULL;
+ if(aData == KOmxXmlTestWrapper)
+ {
+ wrapper = COmxXmlTestWrapper::NewL();
+ }
+ return wrapper;
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/te_xmlomxclient/src/omxxmltestblockcontroller.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#ifndef OMXXMLTESTBLOCKCONTROLLER_H
+#define OMXXMLTESTBLOCKCONTROLLER_H
+
+#include <test/testblockcontroller.h>
+
+class COmxXmlTestBlockController : public CTestBlockController
+ {
+public:
+ static COmxXmlTestBlockController* NewL();
+
+ CDataWrapper* CreateDataL(const TDesC& aData);
+
+private:
+ COmxXmlTestBlockController();
+ };
+
+#endif ///OMXXMLTESTBLOCKCONTROLLER_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/te_xmlomxclient/src/omxxmltestrunner.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include "omxxmltestrunner.h"
+#include <test/testexecutelogger.h>
+
+COmxXmlTestRunner* COmxXmlTestRunner::NewL(CTestExecuteLogger& aLogger)
+ {
+ COmxXmlTestRunner* self = new(ELeave) COmxXmlTestRunner(aLogger);
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ CleanupStack::Pop(self);
+ return self;
+ }
+
+COmxXmlTestRunner::COmxXmlTestRunner(CTestExecuteLogger& aLogger):
+iTestExecuteLogger(aLogger)
+ {
+ }
+
+void COmxXmlTestRunner::ConstructL()
+ {
+ iScript = COmxXmlScript::NewL(*this);
+ }
+
+COmxXmlTestRunner::~COmxXmlTestRunner()
+ {
+ delete iFilename;
+ delete iScript;
+ }
+
+void COmxXmlTestRunner::SetFilenameL(const TDesC& aFilename)
+ {
+ iFilename = aFilename.AllocL();
+ }
+
+void COmxXmlTestRunner::RunTestL(const TDesC& aSectionName)
+ {
+ // TODO check for memory leaks
+ // TODO how to fail test block without causing E32USER-CBase 47 panic
+ iScript->RunScriptL(*iFilename, aSectionName);
+ }
+
+void COmxXmlTestRunner::Log(const TText8* aFile, TInt aLine, TOmxScriptSeverity aSeverity, const TDes& aMessage)
+ {
+ // TEF Severity values are not the same as OMX Script
+ TLogSeverity tefSeverity;
+ switch(aSeverity)
+ {
+ case EOmxScriptSevErr:
+ tefSeverity = ESevrErr;
+ break;
+ case EOmxScriptSevWarn:
+ tefSeverity = ESevrWarn;
+ break;
+ case EOmxScriptSevInfo:
+ tefSeverity = ESevrInfo;
+ break;
+ default:
+ tefSeverity = ESevrAll;
+ }
+
+ iTestExecuteLogger.LogExtra(aFile, aLine, tefSeverity, aMessage);
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/te_xmlomxclient/src/omxxmltestrunner.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#ifndef OMXXMLTESTRUNNER_H
+#define OMXXMLTESTRUNNER_H
+
+#include <e32base.h>
+#include <multimedia/omx_xml_script.h>
+
+class CTestExecuteLogger;
+
+class COmxXmlTestRunner : public CBase, public MOmxScriptTestLogger
+ {
+public:
+ static COmxXmlTestRunner* NewL(CTestExecuteLogger& aLogger);
+ ~COmxXmlTestRunner();
+
+ void SetFilenameL(const TDesC& aFilename);
+ void RunTestL(const TDesC& aSectionName);
+
+ // from MOmxScriptTestLogger
+ void Log(const TText8* aFile, TInt aLine, TOmxScriptSeverity aSeverity, const TDes& aMessage);
+
+private:
+ COmxXmlTestRunner(CTestExecuteLogger& aLogger);
+ void ConstructL();
+
+ CTestExecuteLogger& iTestExecuteLogger;
+ HBufC* iFilename;
+ COmxXmlScript* iScript;
+ };
+
+#endif //OMXXMLTESTRUNNER_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/te_xmlomxclient/src/omxxmltestwrapper.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,106 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include "omxxmltestwrapper.h"
+#include "omxxmltestrunner.h"
+
+// SCRIPT commands
+_LIT(KNewCmd, "New");
+_LIT(KRunTestCmd, "RunTest");
+
+COmxXmlTestWrapper* COmxXmlTestWrapper::NewL()
+ {
+ COmxXmlTestWrapper* self = new(ELeave) COmxXmlTestWrapper();
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ CleanupStack::Pop(self);
+ return self;
+ }
+
+COmxXmlTestWrapper::COmxXmlTestWrapper()
+ {
+
+ }
+
+void COmxXmlTestWrapper::ConstructL()
+ {
+ iActiveCallback = CActiveCallback::NewL(*this);
+ }
+
+COmxXmlTestWrapper::~COmxXmlTestWrapper()
+ {
+ delete iTestRunner;
+ delete iActiveCallback;
+ }
+
+TBool COmxXmlTestWrapper::DoCommandL(const TTEFFunction& aCommand,
+ const TTEFSectionName& aSection,
+ const TInt /*aAsyncErrorIndex*/)
+ {
+ TBool ret = ETrue;
+ TInt err = KErrNone;
+ if(aCommand == KNewCmd())
+ {
+ // XML file name is specified in aSection
+ TRAP(err, DoNewCmdL(aSection));
+ }
+ else if(aCommand == KRunTestCmd())
+ {
+ // XML section name is specified in aSection
+ TRAP(err, DoRunTestCmdL(aSection));
+ }
+ else
+ {
+ ERR_PRINTF2(_L("Unrecognized command %S"), &aCommand);
+ ret = EFalse;
+ }
+
+ if(err != KErrNone)
+ {
+ ret = EFalse;
+ }
+
+ return ret;
+ }
+
+TAny* COmxXmlTestWrapper::GetObject()
+ {
+ return iTestRunner;
+ }
+
+void COmxXmlTestWrapper::DoNewCmdL(const TDesC& aFilename)
+ {
+ COmxXmlTestRunner* newRunner = COmxXmlTestRunner::NewL(Logger());
+ CleanupStack::PushL(newRunner);
+ newRunner->SetFilenameL(aFilename);
+ CleanupStack::Pop(newRunner);
+ delete iTestRunner;
+ iTestRunner = newRunner;
+ }
+
+void COmxXmlTestWrapper::DoRunTestCmdL(const TDesC& aSectionName)
+ {
+ iTestRunner->RunTestL(aSectionName);
+ }
+
+void COmxXmlTestWrapper::RunL(CActive* aActive, TInt aIndex)
+ {
+ TInt err = aActive->iStatus.Int();
+ SetAsyncError(aIndex, err);
+ DecOutstanding();
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/te_xmlomxclient/src/omxxmltestwrapper.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#ifndef OMXXMLTESTWRAPPER_H
+#define OMXXMLTESTWRAPPER_H
+
+#include <test/datawrapper.h>
+
+class COmxXmlTestRunner;
+
+class COmxXmlTestWrapper : public CDataWrapper
+ {
+public:
+ static COmxXmlTestWrapper* NewL();
+ ~COmxXmlTestWrapper();
+
+ TBool DoCommandL(const TTEFFunction& aCommand,
+ const TTEFSectionName& aSection,
+ const TInt aAsyncErrorIndex);
+
+ TAny* GetObject();
+
+ void RunL(CActive* aActive, TInt aIndex);
+
+private:
+ COmxXmlTestWrapper();
+ void ConstructL();
+
+ void DoNewCmdL(const TDesC& aFilename);
+ void DoRunTestCmdL(const TDesC& aScriptSection);
+
+ CActiveCallback* iActiveCallback;
+ COmxXmlTestRunner* iTestRunner;
+ };
+
+#endif //OMXXMLTESTWRAPPER_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/te_xmlomxclient/src/te_xmlomxclient.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,104 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include "te_xmlomxclient.h"
+#include "omxxmltestblockcontroller.h"
+
+CTe_XmlOmxClient* CTe_XmlOmxClient::NewL()
+/**
+ * @return - Instance of the test server
+ * Same code for Secure and non-secure variants
+ * Called inside the MainL() function to create and start the
+ * CTestServer derived server.
+ */
+ {
+ CTe_XmlOmxClient * server = new (ELeave) CTe_XmlOmxClient();
+ CleanupStack::PushL(server);
+ server->ConstructL();
+ CleanupStack::Pop(server);
+ return server;
+ }
+
+
+// Secure variants much simpler
+// For EKA2, just an E32Main and a MainL()
+LOCAL_C void MainL()
+/**
+ * Secure variant
+ * Much simpler, uses the new Rendezvous() call to sync with the client
+ */
+ {
+ // Leave the hooks in for platform security
+#if (defined __DATA_CAGING__)
+ RProcess().DataCaging(RProcess::EDataCagingOn);
+ RProcess().DataCaging(RProcess::ESecureApiOn);
+#endif
+ CActiveScheduler* sched=NULL;
+ sched=new(ELeave) CActiveScheduler;
+ CActiveScheduler::Install(sched);
+ CTe_XmlOmxClient* server = NULL;
+ // Create the CTestServer derived server
+ TRAPD(err,server = CTe_XmlOmxClient::NewL());
+ if(!err)
+ {
+ // Sync with the client and enter the active scheduler
+ RProcess::Rendezvous(KErrNone);
+ sched->Start();
+ }
+ delete server;
+ delete sched;
+ }
+
+
+
+GLDEF_C TInt E32Main()
+/**
+ * @return - Standard Epoc error code on process exit
+ * Secure variant only
+ * Process entry point. Called by client using RProcess API
+ */
+ {
+ __UHEAP_MARK;
+ CTrapCleanup* cleanup = CTrapCleanup::New();
+ if(cleanup == NULL)
+ {
+ return KErrNoMemory;
+ }
+ TRAPD(err,MainL());
+ delete cleanup;
+ __UHEAP_MARKEND;
+ return err;
+ }
+
+
+CTestStep* CTe_XmlOmxClient::CreateTestStep(const TDesC& /*aStepName*/)
+/**
+ * @return - A CTestStep derived instance
+ * Secure and non-secure variants
+ * Implementation of CTestServer pure virtual
+ */
+ {
+ return NULL;
+ }
+
+CTestBlockController* CTe_XmlOmxClient::CreateTestBlock()
+ {
+ CTestBlockController* controller = NULL;
+ TRAP_IGNORE(controller = COmxXmlTestBlockController::NewL());
+ return controller;
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/te_xmlomxclient/src/te_xmlomxclient.h Wed Aug 25 12:40:50 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:
+*
+*/
+
+
+#ifndef TE_XMLOMXCLIENT_H
+#define TE_XMLOMXCLIENT_H
+
+#include <test/testserver2.h>
+
+class CTe_XmlOmxClient : public CTestServer2
+ {
+public:
+ static CTe_XmlOmxClient* NewL();
+ // Base class pure virtual override
+ virtual CTestStep* CreateTestStep(const TDesC& aStepName);
+
+ CTestBlockController* CreateTestBlock();
+ };
+
+#endif //TE_XMLOMXCLIENT_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/tools/group/bld.inf Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,18 @@
+/*
+* 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 "../t_videoframesupplier/group/bld.inf"
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/tools/t_videoframesupplier/bwins/t_videoframesupplieru.def Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,8 @@
+EXPORTS
+ ?NewL@CVideoFrameSupplier@@SAPAV1@ABVTDesC16@@W4TVideoFileType@1@@Z @ 1 NONAME ; class CVideoFrameSupplier * CVideoFrameSupplier::NewL(class TDesC16 const &, enum CVideoFrameSupplier::TVideoFileType)
+ ?LargestFrameSize@CVideoFrameSupplier@@QBEHXZ @ 2 NONAME ; int CVideoFrameSupplier::LargestFrameSize(void) const
+ ??1CVideoFrameSupplier@@UAE@XZ @ 3 NONAME ; CVideoFrameSupplier::~CVideoFrameSupplier(void)
+ ?NextFrameData@CVideoFrameSupplier@@QAEHPAEAAH@Z @ 4 NONAME ; int CVideoFrameSupplier::NextFrameData(unsigned char *, int &)
+ ?IsLastFrame@CVideoFrameSupplier@@QBEHXZ @ 5 NONAME ; int CVideoFrameSupplier::IsLastFrame(void) const
+ ?CurrentFrame@CVideoFrameSupplier@@QBEHXZ @ 6 NONAME ; int CVideoFrameSupplier::CurrentFrame(void) const
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/tools/t_videoframesupplier/eabi/t_videoframesupplieru.def Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,12 @@
+EXPORTS
+ _ZN19CVideoFrameSupplier13NextFrameDataEPhRi @ 1 NONAME
+ _ZN19CVideoFrameSupplier4NewLERK7TDesC16NS_14TVideoFileTypeE @ 2 NONAME
+ _ZN19CVideoFrameSupplierD0Ev @ 3 NONAME
+ _ZN19CVideoFrameSupplierD1Ev @ 4 NONAME
+ _ZN19CVideoFrameSupplierD2Ev @ 5 NONAME
+ _ZNK19CVideoFrameSupplier11IsLastFrameEv @ 6 NONAME
+ _ZNK19CVideoFrameSupplier12CurrentFrameEv @ 7 NONAME
+ _ZNK19CVideoFrameSupplier16LargestFrameSizeEv @ 8 NONAME
+ _ZTI19CVideoFrameSupplier @ 9 NONAME
+ _ZTV19CVideoFrameSupplier @ 10 NONAME
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/tools/t_videoframesupplier/group/bld.inf Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+PRJ_PLATFORMS
+DEFAULT
+ARMv6
+
+PRJ_TESTEXPORTS
+..\inc\t_videoframesupplier.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(multimedia/t_videoframesupplier.h)
+t_videoframesupplier.iby /epoc32/rom/include/t_videoframesupplier.iby
+
+PRJ_TESTMMPFILES
+t_videoframesupplier.mmp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/tools/t_videoframesupplier/group/t_videoframesupplier.iby Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,23 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 __T_VIDEOFRAMESUPPLIER_IBY__
+#define __T_VIDEOFRAMESUPPLIER_IBY__
+
+file=ABI_DIR\BUILD_DIR\t_videoframesupplier.dll System\Libs\t_videoframesupplier.dll
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/tools/t_videoframesupplier/group/t_videoframesupplier.mmp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,38 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+TARGET t_videoframesupplier.dll
+TARGETTYPE dll
+UID 0x1000008d 0xEDB08359
+CAPABILITY All -TCB
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+USERINCLUDE ..\inc
+
+SOURCEPATH ..\src
+
+SOURCE t_videoframesupplier.cpp
+SOURCE t_videoframesupplierDllMain.cpp
+
+LIBRARY euser.lib
+LIBRARY efsrv.lib
+
+#ifdef ENABLE_ABIV2_MODE
+ DEBUGGABLE_UDEBONLY
+#endif
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/tools/t_videoframesupplier/inc/t_videoframesupplier.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 __T_VIDEOFRAMESUPPLIER_H__
+#define __T_VIDEOFRAMESUPPLIER_H__
+
+
+#include <e32base.h>
+#include <e32std.h>
+#include <f32file.h>
+
+typedef struct
+ {
+ TInt iPosition; // From start of the file.
+ TInt iLength;
+ }
+TFrameData;
+
+typedef enum
+ {
+ ESearchForZero = 0,
+ ESearchForZeroZero,
+ ESearchForZeroZeroOne,
+ ESearchForStartCode,
+ EBeginningOfFrame
+ }
+TMPEG4ParseState;
+
+//
+//
+//
+class CVideoFrameSupplier : public CBase
+ {
+public:
+
+ typedef enum
+ {
+ EVideoFileTypeMPEG4
+ }
+ TVideoFileType;
+
+ IMPORT_C static CVideoFrameSupplier* NewL(const TDesC& aFileName, TVideoFileType aFileType);
+ IMPORT_C ~CVideoFrameSupplier();
+
+public:
+ IMPORT_C TInt LargestFrameSize() const;
+ IMPORT_C TInt CurrentFrame() const;
+ IMPORT_C TInt NextFrameData(TUint8* aPtr, TInt& aFrameLength);
+ IMPORT_C TBool IsLastFrame() const;
+
+private:
+ CVideoFrameSupplier();
+ void ConstructL(const TDesC& aFileName, TVideoFileType aFileType);
+ void ParseMPEG4FileL();
+ TInt AppendFrameData(TInt aPosition, TInt aLength);
+ TInt ProcessMPEG4Byte(TUint8 aByte, TInt aBytePosition);
+
+private:
+ RFs iFs;
+ RFile iFile;
+ RArray<TFrameData> iFrames;
+ TInt iLargestFrameSize;
+ TInt iCurrentFrame;
+ TMPEG4ParseState iState;
+ TInt iFrameStartPosition;
+ };
+
+#endif // __T_VIDEOFRAMESUPPLIER_H__
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/tools/t_videoframesupplier/src/t_videoframesupplier.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,260 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "t_videoframesupplier.h"
+
+
+//
+//
+//
+CVideoFrameSupplier::CVideoFrameSupplier()
+ : iLargestFrameSize(KErrNotFound)
+ {
+ }
+
+//
+//
+//
+EXPORT_C CVideoFrameSupplier::~CVideoFrameSupplier()
+ {
+ iFrames.Close();
+ iFile.Close();
+ iFs.Close();
+ }
+
+
+//
+//
+//
+EXPORT_C CVideoFrameSupplier* CVideoFrameSupplier::NewL(const TDesC& aFileName, TVideoFileType aFileType)
+ {
+ CVideoFrameSupplier* self = new(ELeave) CVideoFrameSupplier();
+ CleanupStack::PushL(self);
+ self->ConstructL(aFileName, aFileType);
+ CleanupStack::Pop(self);
+ return self;
+ }
+
+
+//
+//
+//
+void CVideoFrameSupplier::ConstructL(const TDesC& aFileName, TVideoFileType aFileType)
+ {
+ User::LeaveIfError(iFs.Connect());
+ TInt err = iFile.Open(iFs, aFileName, EFileRead);
+ if (err != KErrNone)
+ {
+ RDebug::Print(_L("*** CVideoFrameSupplier: Error %d opening file %S"), err, &aFileName);
+ User::Leave(err);
+ }
+
+ switch (aFileType)
+ {
+ case EVideoFileTypeMPEG4:
+ ParseMPEG4FileL();
+ break;
+
+ default:
+ User::Leave(KErrNotSupported);
+ }
+ }
+
+
+//
+//
+//
+EXPORT_C TInt CVideoFrameSupplier::LargestFrameSize() const
+ {
+ return iLargestFrameSize;
+ }
+
+
+//
+//
+//
+EXPORT_C TInt CVideoFrameSupplier::CurrentFrame() const
+ {
+ return iCurrentFrame;
+ }
+
+
+//
+//
+//
+EXPORT_C TBool CVideoFrameSupplier::IsLastFrame() const
+ {
+ return iCurrentFrame >= (iFrames.Count() - 1);
+ }
+
+
+//
+//
+//
+EXPORT_C TInt CVideoFrameSupplier::NextFrameData(TUint8* aPtr, TInt& aFrameLength)
+ {
+ aFrameLength = KErrNotFound;
+
+ if (!aPtr)
+ {
+ return KErrArgument;
+ }
+
+ if (iCurrentFrame >= iFrames.Count())
+ {
+ return KErrEof;
+ }
+
+ TFrameData data = iFrames[iCurrentFrame++];
+ TInt pos = data.iPosition;
+ TInt err = iFile.Seek(ESeekStart, pos);
+ if (err == KErrNone)
+ {
+ TPtr8 des(aPtr, data.iLength);
+ err = iFile.Read(des);
+ if (err == KErrNone)
+ {
+ aFrameLength = data.iLength;
+ }
+ }
+
+ return err;
+ }
+
+
+//
+//
+//
+TInt CVideoFrameSupplier::AppendFrameData(TInt aPosition, TInt aLength)
+ {
+ ASSERT(aPosition >= 0);
+ ASSERT(aLength > 0);
+
+ TFrameData data;
+ data.iPosition = aPosition;
+ data.iLength = aLength;
+
+ if (aLength > iLargestFrameSize)
+ {
+ iLargestFrameSize = aLength;
+ }
+
+ return iFrames.Append(data);
+ }
+
+
+//
+//
+//
+void CVideoFrameSupplier::ParseMPEG4FileL()
+ {
+ iFrames.Reset();
+
+ const TInt KBufferSize = 1024;
+
+ iState = ESearchForZero;
+ iLargestFrameSize = KErrNotFound;
+ iFrameStartPosition = KErrNotFound;
+
+ TBuf8<KBufferSize> data;
+ TInt filePosition = 0;
+ TBool lastBuffer = EFalse;
+ TInt err = KErrNone;
+
+ do
+ {
+ data.Zero();
+ err = iFile.Read(data);
+ lastBuffer = (data.Length() != KBufferSize);
+
+ if (err == KErrNone)
+ {
+ for (TInt i = 0; i < data.Length(); i++)
+ {
+ err = ProcessMPEG4Byte(data[i], filePosition + i);
+ }
+
+ filePosition += KBufferSize;
+ }
+ }
+ while (!lastBuffer);
+ }
+
+
+//
+//
+//
+TInt CVideoFrameSupplier::ProcessMPEG4Byte(TUint8 aByte, TInt aBytePosition)
+ {
+ ASSERT(aBytePosition >= 0);
+
+ TInt err = KErrNone;
+
+ switch (iState)
+ {
+ case ESearchForZero:
+ iState = (aByte == 0x00 ? ESearchForZeroZero : iState);
+ break;
+
+ case ESearchForZeroZero:
+ iState = (aByte == 0x00 ? ESearchForZeroZeroOne : ESearchForZero);
+ break;
+
+ case ESearchForZeroZeroOne:
+ if (aByte == 0x00)
+ {
+ // Do nothing. It is allowed to have more than two leading zero bytes.
+ break;
+ }
+
+ iState = (aByte == 0x01 ? ESearchForStartCode : ESearchForZero);
+ break;
+
+ case ESearchForStartCode:
+ if (iFrameStartPosition != KErrNotFound)
+ {
+ // If we are currently in a frame then it ends at this start code.
+ TInt length = (aBytePosition - 3) - iFrameStartPosition;
+ err = AppendFrameData(iFrameStartPosition, length);
+ iFrameStartPosition = KErrNotFound;
+ }
+
+ iState = (aByte == 0xB6 ? EBeginningOfFrame : ESearchForZero);
+ break;
+
+ case EBeginningOfFrame:
+ iFrameStartPosition = aBytePosition - 4; // The 0x000001B6 bytes count too.
+ if (iFrames.Count() == 0)
+ {
+ if (iFrameStartPosition != 0)
+ {
+ // There was a header before the frame. The ST-E decoder
+ // requires that this data is prepended to the frame data (first frame only).
+ // We assume that all bytes before this frame are valid header bytes!
+ iFrameStartPosition = 0;
+ }
+ }
+
+ iState = ESearchForZero;
+ break;
+
+ default:
+ ASSERT(EFalse);
+ }
+
+ return err;
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/tools/t_videoframesupplier/src/t_videoframesupplierDllMain.cpp Wed Aug 25 12:40:50 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:
+*
+*/
+
+#include <e32std.h>
+
+
+#ifndef EKA2 // for EKA1 only
+EXPORT_C TInt E32Dll(TDllReason /*aReason*/)
+// Called when the DLL is loaded and unloaded. Note: have to define
+// epoccalldllentrypoints in MMP file to get this called in THUMB.
+ {
+ return KErrNone;
+ }
+#endif
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/bwins/xmlomxclient.def Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,4 @@
+EXPORTS
+ ?RunScriptL@COmxXmlScript@@QAEXABVTDesC16@@0@Z @ 1 NONAME ; void COmxXmlScript::RunScriptL(class TDesC16 const &, class TDesC16 const &)
+ ?NewL@COmxXmlScript@@SAPAV1@AAVMOmxScriptTestLogger@@@Z @ 2 NONAME ; class COmxXmlScript * COmxXmlScript::NewL(class MOmxScriptTestLogger &)
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/eabi/xmlomxclient.def Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,8 @@
+EXPORTS
+ _ZN13COmxXmlScript10RunScriptLERK7TDesC16S2_ @ 1 NONAME
+ _ZN13COmxXmlScript4NewLER20MOmxScriptTestLogger @ 2 NONAME
+ _ZTI14CWindowManager @ 3 NONAME
+ _ZTI15CThreadedLogger @ 4 NONAME
+ _ZTV14CWindowManager @ 5 NONAME
+ _ZTV15CThreadedLogger @ 6 NONAME
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/group/bld.inf Wed Aug 25 12:40:50 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_PLATFORMS
+DEFAULT
+ARMv6
+
+PRJ_TESTMMPFILES
+xmlclient.mmp
+omxscript.mmp
+
+PRJ_TESTEXPORTS
+../inc/omx_xml_script.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(multimedia/omx_xml_script.h)
+xmlomxclient.iby /epoc32/rom/include/xmlomxclient.iby
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/group/omxscript.mmp Wed Aug 25 12:40:50 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:
+*
+*/
+
+
+TARGET omxscript.exe
+TARGETTYPE exe
+UID 0 0x1028668F
+CAPABILITY MultimediaDD UserEnvironment ReadUserData WriteUserData WriteDeviceData ProtServ NetworkControl
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+SOURCEPATH ..\src
+SOURCE omxscript.cpp
+
+LIBRARY euser.lib
+LIBRARY xmlomxclient.lib 3gplibrary.lib
+
+#ifdef ENABLE_ABIV2_MODE
+DEBUGGABLE
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/group/xmlclient.mmp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,72 @@
+/*
+* 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:
+*
+*/
+
+
+TARGET xmlomxclient.dll
+TARGETTYPE DLL
+UID 0 0x10286694
+CAPABILITY All -TCB
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+OS_LAYER_LIBC_SYSTEMINCLUDE
+
+USERINCLUDE ../inc
+USERINCLUDE ../src
+
+
+SOURCEPATH ../src
+SOURCE omx_xml_script.cpp
+SOURCE asbreakeventhandler.cpp
+SOURCE paramconversion.cpp
+SOURCE statedes.cpp
+SOURCE omxscriptparser.cpp
+SOURCE omxscripttest.cpp
+SOURCE omxutil.cpp
+SOURCE nontunneledhandler.cpp
+SOURCE videotesttimer.cpp
+SOURCE videobufferhandler.cpp
+SOURCE videobuffersinkhandler.cpp
+SOURCE videobufferhandler_mpeg4.cpp
+SOURCE transition.cpp
+SOURCE parsemap.c
+SOURCE baseprofilehandler.cpp
+SOURCE baseprofiletimestamping.cpp
+SOURCE omxthreadrequest.cpp
+SOURCE portbufferhandler.cpp
+SOURCE threadedlogger.cpp
+SOURCE windowmanager.cpp
+
+#ifdef ENABLE_ABIV2_MODE
+DEBUGGABLE
+#endif
+
+LIBRARY euser.lib
+LIBRARY omxilcoreclient.lib
+LIBRARY t_videoframesupplier.lib
+
+NOSTRICTDEF
+
+LIBRARY 3gpmp4lib.lib
+LIBRARY hash.lib
+LIBRARY inetprotutil.lib
+LIBRARY ws32.lib
+LIBRARY efsrv.lib
+LIBRARY ecom.lib
+LIBRARY xmlframework.lib
+LIBRARY bafl.lib
+LIBRARY charconv.lib
+LIBRARY libc.lib 3gplibrary.lib
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/group/xmlomxclient.iby Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#ifndef XML_OMX_CLIENT_IBY
+#define XML_OMX_CLIENT_IBY
+
+#include <omxilcore.iby>
+#include <t_videoframesupplier.iby>
+#include <xml.iby>
+#include <3gplibrary.iby>
+#include <3gpmp4lib.iby>
+
+file=ABI_DIR\DEBUG_DIR\xmlomxclient.dll System\Libs\xmlomxclient.dll
+file=ABI_DIR\DEBUG_DIR\omxscript.exe Sys\Bin\omxscript.exe
+
+#endif //XML_OMX_CLIENT_IBY
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/inc/omx_xml_script.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#ifndef OMX_XML_SCRIPT_H_
+#define OMX_XML_SCRIPT_H_
+
+#include <e32base.h>
+
+/**
+ * Bitmask flags for logging severity levels.
+ */
+enum TOmxScriptSeverity
+ {
+ EOmxScriptSevErr = 0x0001,
+ EOmxScriptSevWarn = 0x0002,
+ EOmxScriptSevInfo = 0x0004,
+ EOmxScriptSevVer = 0x0007,
+ EOmxScriptSevAll = 0x0007
+ };
+
+/**
+ * Interface to receive messages from ROmxScriptTest.
+ */
+NONSHARABLE_CLASS(MOmxScriptTestLogger)
+ {
+public:
+ IMPORT_C virtual void Log(const TText8* aFile, TInt aLine, TOmxScriptSeverity aSeverity, const TDes& aMessage) = 0;
+ };
+
+NONSHARABLE_CLASS(COmxXmlScript) : public CBase
+ {
+public:
+ IMPORT_C static COmxXmlScript* NewL(MOmxScriptTestLogger& aLogger);
+ ~COmxXmlScript();
+
+ IMPORT_C void RunScriptL(const TDesC& aScriptFilename, const TDesC& aScriptSection);
+
+private:
+ COmxXmlScript(MOmxScriptTestLogger& aLogger);
+
+private:
+ MOmxScriptTestLogger& iLogger;
+ };
+
+#endif /*OMX_XML_SCRIPT_H_*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/inc/omxildroppedframeeventextension.h Wed Aug 25 12:40:50 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:
+*
+*/
+
+
+/**
+@file
+@ipublishedPartner
+*/
+
+#ifndef OMXILDROPPEDFRAMEEVENTEXTENSION_H_
+#define OMXILDROPPEDFRAMEEVENTEXTENSION_H_
+
+#include <openmax/il/khronos/v1_x/OMX_Types.h>
+
+/**
+ * The string that can be passed to get the index for the dropped frame event extension
+ */
+const char sOmxNokiaIndexParamDroppedFrameEvent [] = "OMX.NOKIA.INDEX.PARAM.DROPPEDFRAMEEVENT";
+
+/**
+ * Custom OpenMAX IL structure for the dropped frame error extension.
+ */
+struct OMX_NOKIA_PARAM_DROPPEDFRAMEEVENT
+ {
+ 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_BOOL bEnabled; /** Flag to indicate whether to generate the event */
+ };
+
+#endif /* OMXILDROPPEDFRAMEEVENTEXTENSION_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/inc/omxilsymbianvideographicsinkextensions.h Wed Aug 25 12:40:50 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:
+*
+*/
+
+/**
+ @file
+ @internalComponent
+*/
+
+#ifndef OMXILSYMBIANVIDEOGRAPHICSINKEXTENSIONS_H
+#define OMXILSYMBIANVIDEOGRAPHICSINKEXTENSIONS_H
+
+
+#include <openmax/il/khronos/v1_x/OMX_Types.h>
+
+
+/**
+ * The string that the Symbian's OpenMAX IL Graphic Sink component will
+ * translate into a 32-bit OpenMAX IL index to support the TSurfaceConfig class
+ */
+const char sOmxSymbianGfxSurfaceConfig [] = "OMX.SYMBIAN.INDEX.PARAM.VIDEO.GFX.SURFACECONFIG";
+
+
+/**
+ * Custom OpenMAX IL structure to be used as a container for an
+ * TSurfaceConfig class
+ */
+struct OMX_SYMBIAN_VIDEO_PARAM_SURFACECONFIGURATION
+ {
+ 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_PTR pSurfaceConfig; // This is a pointer to TSurfaceConfig class
+ };
+
+
+#endif // OMXILSYMBIANVIDEOGRAPHICSINKEXTENSIONS_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/src/asbreakeventhandler.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,219 @@
+/*
+* 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 <e32debug.h>
+#include "asbreakeventhandler.h"
+
+const TDesC* StateDes(OMX_STATETYPE);
+
+RASBreakEventHandler::RASBreakEventHandler(MASBreakCallback& aHandler):
+iHandler(aHandler),
+iCounter(0),
+iMode(EIdle)
+ {
+ iOmxCallbackType.EventHandler = EventHandler;
+
+ // do nothing function is set for these callbacks, rather than using NULL
+ iOmxCallbackType.EmptyBufferDone = EmptyBufferDone;
+ iOmxCallbackType.FillBufferDone = FillBufferDone;
+ }
+
+TInt RASBreakEventHandler::Create()
+ {
+ return iMutex.CreateLocal();
+ }
+
+void RASBreakEventHandler::Close()
+ {
+ for(TInt aIndex = 0, aCount = iComponents.Count(); aIndex < aCount; aIndex++)
+ {
+ delete iComponents[aIndex].iName;
+ }
+ iComponents.Close();
+ iCounter = 0;
+ iMode = EIdle;
+ iMutex.Close();
+ }
+
+void RASBreakEventHandler::AddComponentL(OMX_COMPONENTTYPE* aComponent, const TDesC& aName)
+ {
+ ASSERT(iMode == EIdle);
+ TComponentInfo componentInfo;
+ componentInfo.iHandle = aComponent;
+ componentInfo.iName = HBufC::NewLC(aName.Length());
+ *(componentInfo.iName) = aName;
+ componentInfo.iComplete = EFalse;
+ User::LeaveIfError(iComponents.Append(componentInfo));
+ CleanupStack::Pop(componentInfo.iName);
+ }
+
+OMX_ERRORTYPE RASBreakEventHandler::FillBufferDone(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_PTR pAppData,
+ OMX_IN OMX_BUFFERHEADERTYPE* pBuffer)
+ {
+ return reinterpret_cast<RASBreakEventHandler*>(pAppData)->DoBufferDone(reinterpret_cast<OMX_COMPONENTTYPE*>(hComponent), pBuffer, ETrue);
+ }
+
+OMX_ERRORTYPE RASBreakEventHandler::EmptyBufferDone(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_PTR pAppData,
+ OMX_IN OMX_BUFFERHEADERTYPE* pBuffer)
+ {
+ return reinterpret_cast<RASBreakEventHandler*>(pAppData)->DoBufferDone(reinterpret_cast<OMX_COMPONENTTYPE*>(hComponent), pBuffer, EFalse);
+ }
+
+OMX_ERRORTYPE RASBreakEventHandler::DoBufferDone(OMX_COMPONENTTYPE* aComponent, OMX_BUFFERHEADERTYPE* aBufHdr, TBool aSource)
+ {
+ iHandler.BufferDone(aComponent, aBufHdr, aSource);
+ return OMX_ErrorNone;
+ }
+
+OMX_ERRORTYPE RASBreakEventHandler::EventHandler(OMX_HANDLETYPE hComponent,
+ OMX_PTR pAppData,
+ OMX_EVENTTYPE eEvent,
+ OMX_U32 nData1,
+ OMX_U32 nData2,
+ OMX_PTR pEventData)
+ {
+ return reinterpret_cast<RASBreakEventHandler*>(pAppData)->DoEventHandler(reinterpret_cast<OMX_COMPONENTTYPE*>(hComponent), eEvent, nData1, nData2, pEventData);
+ }
+
+OMX_ERRORTYPE RASBreakEventHandler::DoEventHandler(OMX_COMPONENTTYPE* aComponent, OMX_EVENTTYPE aEvent, TUint32 aData1, TUint32 aData2, TAny* aEventData)
+ {
+ iMutex.Wait();
+ if((iMode == EAwaitingTransition || iMode == EAwaitingSingleTransition) && aEvent == OMX_EventCmdComplete && aData1 == OMX_CommandStateSet)
+ {
+ StateSet(aComponent, (OMX_STATETYPE) aData2);
+ }
+ else if(iMode == EAwaitingEOS && aEvent == OMX_EventBufferFlag && aData2 & OMX_BUFFERFLAG_EOS)
+ {
+ EndOfStream(aComponent);
+ }
+ else
+ {
+ iHandler.EventReceived(aComponent, aEvent, aData1, aData2, aEventData);
+ }
+ iMutex.Signal();
+ return OMX_ErrorNone;
+ }
+
+void RASBreakEventHandler::StateSet(OMX_COMPONENTTYPE* aComponent, OMX_STATETYPE aState)
+ {
+ RDebug::Print(_L("State transition: component %S is in state %S\n"), ComponentName(aComponent), StateDes(aState));
+ if(iMode == EAwaitingTransition)
+ {
+ __ASSERT_ALWAYS(aState == iNewState, User::Panic(_L("RASBreakEventHandler"), 2));
+ if(--iCounter == 0)
+ {
+ iMode = EIdle;
+ iHandler.AllComponentsTransitioned(iNewState, iOldState);
+ }
+ }
+ else if (iMode == EAwaitingSingleTransition)
+ {
+ __ASSERT_ALWAYS(aState == iNewState, User::Panic(_L("RASBreakEventHandler"), 2));
+ iMode = EIdle;
+ iHandler.ComponentTransitioned(iNewState, iOldState);
+ }
+ }
+
+void RASBreakEventHandler::EndOfStream(OMX_COMPONENTTYPE* aComponent)
+ {
+ RDebug::Print(_L("End of stream from component %S\n"), ComponentName(aComponent));
+ if(iMode == EAwaitingEOS)
+ {
+ TInt index = iComponents.Find(aComponent, TComponentInfo::CompareHandle);
+ // panic if component was not found
+ __ASSERT_ALWAYS(index >= 0, User::Invariant());
+
+ // only respond to EOS changing state, to allow potential duplicates
+ if(!iComponents[index].iComplete)
+ {
+ iComponents[index].iComplete = ETrue;
+ iCounter--;
+ // if iEOSComponent is NULL, wait for all components, otherwise wait for individual component
+ if(iEOSComponent == NULL && iCounter == 0 || iEOSComponent == aComponent)
+ {
+ iMode = EIdle;
+ iHandler.AllComponentsEOS();
+ }
+ }
+ }
+ }
+
+void RASBreakEventHandler::AwaitTransition(OMX_STATETYPE aNewState, OMX_STATETYPE aOldState)
+ {
+ RDebug::Print(_L("Awaiting all components to transition from %S to %S\n"), StateDes(aOldState), StateDes(aNewState));
+ ASSERT(iMode == EIdle);
+ iMode = EAwaitingTransition;
+ iNewState = aNewState;
+ iOldState = aOldState;
+ iCounter = iComponents.Count();
+ }
+
+void RASBreakEventHandler::AwaitSingleTransition(OMX_COMPONENTTYPE* aComponent, OMX_STATETYPE aNewState, OMX_STATETYPE aOldState)
+ {
+ RDebug::Print(_L("Awaiting %S components to transition from %S to %S\n"), ComponentName(aComponent), StateDes(aOldState), StateDes(aNewState));
+ ASSERT(iMode == EIdle);
+ iMode = EAwaitingSingleTransition;
+ iNewState = aNewState;
+ iOldState = aOldState;
+ }
+
+void RASBreakEventHandler::AwaitEOS()
+ {
+ RDebug::Print(_L("Awaiting End Of Stream flag from all components\n"));
+ ASSERT(iMode == EIdle);
+ iMode = EAwaitingEOS;
+ iEOSComponent = NULL; // wait for all components, not an individual component
+ for(iCounter = 0; iCounter < iComponents.Count(); iCounter++)
+ {
+ iComponents[iCounter].iComplete = EFalse;
+ }
+ }
+
+void RASBreakEventHandler::AwaitEOS(OMX_COMPONENTTYPE* aComponent)
+ {
+ RDebug::Print(_L("Awaiting End Of Stream flag from component %S\n"), ComponentName(aComponent));
+ ASSERT(iMode == EIdle);
+ iMode = EAwaitingEOS;
+ iEOSComponent = aComponent;
+ for(iCounter = 0; iCounter < iComponents.Count(); iCounter++)
+ {
+ iComponents[iCounter].iComplete = EFalse;
+ }
+ }
+
+const TDesC* RASBreakEventHandler::ComponentName(OMX_COMPONENTTYPE* aComponent)
+ {
+ TInt index = iComponents.Find(aComponent, TComponentInfo::CompareHandle);
+ if(index == KErrNotFound)
+ {
+ return NULL;
+ }
+ return iComponents[index].iName;
+ }
+
+OMX_CALLBACKTYPE& RASBreakEventHandler::CallbackStruct()
+ {
+ return iOmxCallbackType;
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/src/asbreakeventhandler.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,115 @@
+/*
+* 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:
+*
+*/
+
+
+/**
+@file
+@internalComponent
+*/
+
+#ifndef ASBREAKEVENTHANDLER_H_
+#define ASBREAKEVENTHANDLER_H_
+
+#include <e32base.h>
+
+#include <openmax/il/khronos/v1_x/OMX_Component.h>
+
+class MASBreakCallback
+ {
+public:
+ virtual void AllComponentsEOS() = 0;
+ virtual void AllComponentsTransitioned(OMX_STATETYPE aNewState,
+ OMX_STATETYPE aOldState) = 0;
+ virtual void EventReceived(OMX_COMPONENTTYPE* aComponent, OMX_EVENTTYPE aEvent, TUint32 aData1, TUint32 aData2, TAny* aEventData) = 0;
+ virtual void ComponentTransitioned(OMX_STATETYPE aNewState,
+ OMX_STATETYPE aOldState) = 0;
+ virtual void BufferDone(OMX_COMPONENTTYPE* aComp, OMX_BUFFERHEADERTYPE* aBufHdr, TBool aSource) = 0;
+ };
+
+class RASBreakEventHandler
+ {
+public:
+ RASBreakEventHandler(MASBreakCallback& aHandler);
+ TInt Create();
+ void Close();
+
+ void InstallIntoL(OMX_COMPONENTTYPE* aComponent, const TDesC& aName);
+ void AddComponentL(OMX_COMPONENTTYPE* aComponent, const TDesC& aName);
+
+ void AwaitTransition(OMX_STATETYPE aNewState, OMX_STATETYPE aOldState);
+ void AwaitEOS();
+ void AwaitEOS(OMX_COMPONENTTYPE* aComponent);
+ void AwaitSingleTransition(OMX_COMPONENTTYPE* aComponent, OMX_STATETYPE aNewState, OMX_STATETYPE aOldState);
+
+ OMX_CALLBACKTYPE& CallbackStruct();
+
+ static OMX_ERRORTYPE EventHandler(OMX_HANDLETYPE hComponent,
+ OMX_PTR pAppData,
+ OMX_EVENTTYPE eEvent,
+ OMX_U32 nData1,
+ OMX_U32 nData2,
+ OMX_PTR pEventData);
+ static OMX_ERRORTYPE FillBufferDone(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_PTR pAppData,
+ OMX_IN OMX_BUFFERHEADERTYPE* pBuffer);
+ static OMX_ERRORTYPE EmptyBufferDone(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_PTR pAppData,
+ OMX_IN OMX_BUFFERHEADERTYPE* pBuffer);
+
+private:
+ void StateSet(OMX_COMPONENTTYPE* aComponent, OMX_STATETYPE aState);
+ void EndOfStream(OMX_COMPONENTTYPE* aComponent);
+ OMX_ERRORTYPE DoBufferDone(OMX_COMPONENTTYPE* aComponent,
+ OMX_BUFFERHEADERTYPE* aBufHdr,
+ TBool aSource);
+ OMX_ERRORTYPE DoEventHandler(OMX_COMPONENTTYPE* aComponent,
+ OMX_EVENTTYPE aEvent,
+ OMX_U32 aData1,
+ OMX_U32 aData2,
+ OMX_PTR aEventData);
+ const TDesC* ComponentName(OMX_COMPONENTTYPE* aComponent);
+
+ OMX_CALLBACKTYPE iOmxCallbackType;
+
+ OMX_STATETYPE iNewState;
+ OMX_STATETYPE iOldState;
+
+ enum TMode { EIdle, EAwaitingTransition, EAwaitingEOS, EAwaitingSingleTransition };
+ MASBreakCallback& iHandler;
+
+ class TComponentInfo
+ {
+ public:
+ static TBool CompareHandle(OMX_COMPONENTTYPE* const * a1, const TComponentInfo& a2)
+ {
+ return (*a1) == a2.iHandle;
+ }
+
+ OMX_COMPONENTTYPE* iHandle;
+ TBool iComplete;
+ HBufC* iName;
+ };
+
+ RArray<TComponentInfo> iComponents;
+ TInt iCounter;
+ TMode iMode;
+ RMutex iMutex;
+
+ OMX_COMPONENTTYPE* iEOSComponent; // from which component we expect EOS. all components if NULL
+ };
+
+#endif /*ASBREAKEVENTHANDLER_H_*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/src/baseprofilehandler.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,359 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include "baseprofilehandler.h"
+
+_LIT(KErrDialogInvalidPortIndex, "Base Profile support command called on port not configured for base profile comms, component: %S, port: %d");
+_LIT(KErrDialogBufferNumber, "Test script specified %d buffers, less than the port's minimum of %d, component: %S, port: %d");
+_LIT(KErrDialogFillBufferInvalidBufIndex, "Test script specified invalid buffer index on a FillThisBuffer call, component: %S, port: %d, buffer index passed: %d");
+_LIT(KErrDialogEmptyBufferInvalidBufIndex, "Test script specified invalid buffer index on a EmptyThisBuffer call, component: %S, port: %d, buffer index passed: %d");
+
+
+CBaseProfileHandler::CBaseProfileHandler(ROmxScriptTest& aTestOwner, RASBreakEventHandler& aParentEventHandler)
+: iErrorCallbacks(aTestOwner), iEventHandlerCallbacks(aParentEventHandler)
+ {
+ iOmxCallbacks.EmptyBufferDone = EmptyBufferDone;
+ iOmxCallbacks.EventHandler = EventHandler;
+ iOmxCallbacks.FillBufferDone = FillBufferDone;
+ iMutex.CreateLocal();
+ }
+
+CBaseProfileHandler::~CBaseProfileHandler()
+ {
+ iMutex.Close();
+ delete iXmlName;
+ iBufferHeaders.ResetAndDestroy();
+ iPortsUsingBaseProfile.Close();
+ }
+
+void CBaseProfileHandler::AddPortSupportL(TInt aPortIndex)
+ {
+ TPortInfo portInfo;
+ portInfo.iPortIndex = aPortIndex;
+ portInfo.iAutoMode = EFalse;
+ portInfo.iWeAreBufferSupplier = ETrue;
+ iPortsUsingBaseProfile.AppendL(portInfo);
+ }
+
+void CBaseProfileHandler::SetBufferSupplier(TInt aPortIndex, TBool aComponentBufferSupplier)
+ {
+ TInt portIndex = iPortsUsingBaseProfile.Find(aPortIndex, CBaseProfileHandler::PortIndexMatchComparison);
+ if (portIndex == KErrNotFound)
+ {
+ TBuf<140> errorString;
+ errorString.Format(KErrDialogInvalidPortIndex, iXmlName, aPortIndex);
+ iErrorCallbacks.FailTest(errorString);
+ return;
+ }
+ iPortsUsingBaseProfile[portIndex].iWeAreBufferSupplier = !aComponentBufferSupplier;
+ }
+
+void CBaseProfileHandler::SetAutoMode(TInt aPortIndex, TBool aAutoMode)
+ {
+ TInt portIndex = iPortsUsingBaseProfile.Find(aPortIndex, CBaseProfileHandler::PortIndexMatchComparison);
+ if (portIndex == KErrNotFound)
+ {
+ TBuf<140> errorString;
+ errorString.Format(KErrDialogInvalidPortIndex, iXmlName, aPortIndex);
+ iErrorCallbacks.FailTest(errorString);
+ return;
+ }
+ iPortsUsingBaseProfile[portIndex].iAutoMode = aAutoMode;
+ }
+
+TInt CBaseProfileHandler::LocateBufferForPort(TInt aPortIndex, TInt aBufferIndexInPort)
+ {
+ //Implementation based on the fact that:
+ //-All the buffers for a port are allocated and appended to iBufferHeaders
+ //in a single contiguous block.
+ //-So once the first relevant buffer is found this index marks the zero index
+ //for the set of indexed buffers relevant to that port.
+
+ TInt result = -1;
+ TInt bufferCount = iBufferHeaders.Count();
+ for (TInt bufferIndex = 0; bufferIndex < bufferCount; bufferIndex++)
+ {
+ if (iBufferHeaders[bufferIndex]->iPortIndex != aPortIndex)
+ {
+ continue;
+ }
+
+ //Safety check that the script hasn't made a manual Fill/Empty call on
+ //an invalid buffer index
+ if (iBufferHeaders[bufferIndex]->iPortIndex == iBufferHeaders[(bufferIndex + aBufferIndexInPort)]->iPortIndex)
+ {
+ result = bufferIndex + aBufferIndexInPort;
+ }
+ break;
+ }
+ return result;
+ }
+
+void CBaseProfileHandler::FillThisBuffer(TInt aPortIndex, TInt aBufferIndexInPort)
+ {
+ TInt bufHeaderIndex = LocateBufferForPort(aPortIndex, aBufferIndexInPort);
+ if (bufHeaderIndex >= 0)
+ {
+ iBufferHeaders[bufHeaderIndex]->iBufferAvailable = EFalse;
+ iOmxComponent->FillThisBuffer(iOmxComponent, iBufferHeaders[bufHeaderIndex]->iBufferHeader);
+ }
+ else
+ {
+ TBuf<140> errorString;
+ errorString.Format(KErrDialogFillBufferInvalidBufIndex, iXmlName, aPortIndex, aBufferIndexInPort);
+ iErrorCallbacks.FailTest(errorString);
+ }
+ }
+
+void CBaseProfileHandler::EmptyThisBuffer(TInt aPortIndex, TInt aBufferIndexInPort)
+ {
+ TInt bufHeaderIndex = LocateBufferForPort(aPortIndex, aBufferIndexInPort);
+ if (bufHeaderIndex >= 0)
+ {
+ iBufferHeaders[bufHeaderIndex]->iBufferAvailable = EFalse;
+ iOmxComponent->EmptyThisBuffer(iOmxComponent, iBufferHeaders[bufHeaderIndex]->iBufferHeader);
+ }
+ else
+ {
+ TBuf<140> errorString;
+ errorString.Format(KErrDialogEmptyBufferInvalidBufIndex, iXmlName, aPortIndex, aBufferIndexInPort);
+ iErrorCallbacks.FailTest(errorString);
+ }
+ }
+
+void CBaseProfileHandler::WaitForBufferCompletion(TInt aPortIndex, TInt aBufferIndexInPort)
+ {
+ TInt bufHeaderIndex = LocateBufferForPort(aPortIndex, aBufferIndexInPort);
+ iMutex.Wait();
+ if (iBufferHeaders[bufHeaderIndex]->iBufferAvailable)
+ {
+ //Buffer has already completed either while waiting on another buffer or as a result of test command processing delay, no need to wait
+ iMutex.Signal();
+ }
+ else
+ {
+ iWaitingOnBuffer = iBufferHeaders[bufHeaderIndex]->iBufferHeader;
+ iMutex.Signal();
+ iErrorCallbacks.BeginWait();
+ }
+
+ }
+
+OMX_ERRORTYPE CBaseProfileHandler::EventHandler(OMX_HANDLETYPE /*hComponent*/, OMX_PTR pAppData, OMX_EVENTTYPE eEvent, OMX_U32 nData1, OMX_U32 nData2, OMX_PTR pEventData)
+ {
+ reinterpret_cast<CBaseProfileHandler*>(pAppData)->HandleEventReceived(eEvent, nData1, nData2, pEventData);
+ return OMX_ErrorNone;
+ }
+
+OMX_ERRORTYPE CBaseProfileHandler::FillBufferDone(OMX_IN OMX_HANDLETYPE /*hComponent*/, OMX_IN OMX_PTR pAppData, OMX_IN OMX_BUFFERHEADERTYPE* pBuffer)
+ {
+ reinterpret_cast<CBaseProfileHandler*>(pAppData)->HandleFillBufferDone(pBuffer);
+ return OMX_ErrorNone;
+ }
+
+OMX_ERRORTYPE CBaseProfileHandler::EmptyBufferDone(OMX_IN OMX_HANDLETYPE /*hComponent*/, OMX_IN OMX_PTR pAppData, OMX_IN OMX_BUFFERHEADERTYPE* pBuffer)
+ {
+ reinterpret_cast<CBaseProfileHandler*>(pAppData)->HandleEmptyBufferDone(pBuffer);
+ return OMX_ErrorNone;
+ }
+
+void CBaseProfileHandler::HandleEventReceived(OMX_EVENTTYPE aeEvent, OMX_U32 anData1, OMX_U32 anData2, OMX_PTR apEventData)
+ {
+ DoEventReceived(aeEvent, anData1, anData2, apEventData);
+ iEventHandlerCallbacks.EventHandler(iOmxComponent, &iEventHandlerCallbacks, aeEvent, anData1, anData2, apEventData);
+ }
+
+void CBaseProfileHandler::HandleFillBufferDone(OMX_IN OMX_BUFFERHEADERTYPE* aFilledBuffer)
+ {
+ iMutex.Wait();
+ DoFillBufferDone(aFilledBuffer);
+ TInt bufferIndex = iBufferHeaders.Find(*aFilledBuffer, CBaseProfileHandler::BufferHeaderMatchComparison);
+ iBufferHeaders[bufferIndex]->iBufferAvailable = ETrue;
+ TInt portIndex = iPortsUsingBaseProfile.Find((*iBufferHeaders[bufferIndex]).iPortIndex, CBaseProfileHandler::PortIndexMatchComparison);
+
+ if (iPortsUsingBaseProfile[portIndex].iAutoMode)
+ {
+ iBufferHeaders[bufferIndex]->iBufferAvailable = EFalse;
+ iOmxComponent->FillThisBuffer(iOmxComponent, aFilledBuffer);
+ }
+
+ if (iWaitingOnBuffer == iBufferHeaders[bufferIndex]->iBufferHeader)
+ {
+ iWaitingOnBuffer = NULL;
+ iErrorCallbacks.EndWait();
+ }
+
+ iMutex.Signal();
+ }
+
+void CBaseProfileHandler::HandleEmptyBufferDone(OMX_IN OMX_BUFFERHEADERTYPE* aEmptiedBuffer)
+ {
+ iMutex.Wait();
+ DoEmptyBufferDone(aEmptiedBuffer);
+ TInt bufferIndex = iBufferHeaders.Find(*aEmptiedBuffer, CBaseProfileHandler::BufferHeaderMatchComparison);
+ iBufferHeaders[bufferIndex]->iBufferAvailable = ETrue;
+ TInt portIndex = iPortsUsingBaseProfile.Find((*iBufferHeaders[bufferIndex]).iPortIndex, CBaseProfileHandler::PortIndexMatchComparison);
+
+ if (iPortsUsingBaseProfile[portIndex].iAutoMode)
+ {
+ iBufferHeaders[bufferIndex]->iBufferAvailable = EFalse;
+ iOmxComponent->EmptyThisBuffer(iOmxComponent, aEmptiedBuffer);
+ }
+
+ if (iWaitingOnBuffer == iBufferHeaders[bufferIndex]->iBufferHeader)
+ {
+ iWaitingOnBuffer = NULL;
+ iErrorCallbacks.EndWait();
+ }
+
+ iMutex.Signal();
+ }
+
+OMX_COMPONENTTYPE* CBaseProfileHandler::LoadComponentL(const TDesC8& aTestSpecificName, const TDesC8& aOmxName)
+ {
+
+ iXmlName = HBufC::NewL(aTestSpecificName.Length());
+ iXmlName->Des().Copy(aTestSpecificName);
+ // allow room for the '\0' used in call to OMX_GetHandle
+ HBufC8* omxNameToLoad = HBufC8::NewL(aOmxName.Length() + 1);
+ *omxNameToLoad = aOmxName;
+
+ OMX_ERRORTYPE error = OMX_GetHandle((TAny**) &iOmxComponent, (OMX_STRING) omxNameToLoad->Des().PtrZ(), this, &iOmxCallbacks);
+ delete omxNameToLoad;
+ if (error != OMX_ErrorNone)
+ {
+ iErrorCallbacks.FailWithOmxError(_L("OMX_GetHandle()"), error);
+ }
+
+ return iOmxComponent;
+ }
+
+void CBaseProfileHandler::FreeAllocatedBuffersL()
+ {
+ for (TInt i = 0; i < iBufferHeaders.Count(); ++i)
+ {
+ delete iBufferHeaders[i];
+ }
+ iBufferHeaders.Reset();
+ }
+
+void CBaseProfileHandler::SetupBuffersL(TInt aPortIndex, TInt aNumberBuffers)
+ {
+ TInt portInfoIndex = iPortsUsingBaseProfile.Find(aPortIndex, CBaseProfileHandler::PortIndexMatchComparison);
+ if (portInfoIndex == KErrNotFound)
+ {
+ TBuf<140> errorString;
+ errorString.Format(KErrDialogInvalidPortIndex, iXmlName, aPortIndex);
+ iErrorCallbacks.FailTest(errorString);
+ return;
+ }
+
+ OMX_PARAM_PORTDEFINITIONTYPE portDef;
+ portDef.nSize = sizeof(portDef);
+ portDef.nVersion = KOmxVersion;
+ portDef.nPortIndex = aPortIndex;
+ OMX_ERRORTYPE error = iOmxComponent->GetParameter(iOmxComponent, OMX_IndexParamPortDefinition, &portDef);
+ if(error != OMX_ErrorNone)
+ {
+ iErrorCallbacks.FailWithOmxError(_L("GetParameter"), error);
+ return;
+ }
+
+ if (aNumberBuffers < portDef.nBufferCountMin)
+ {
+ TBuf<140> errorString;
+ errorString.Format(KErrDialogBufferNumber, aNumberBuffers, portDef.nBufferCountMin, iXmlName, aPortIndex);
+ iErrorCallbacks.FailTest(errorString);
+ return;
+ }
+
+ TInt bufSize = portDef.nBufferSize;
+
+ for (TInt bufIndex=0; bufIndex < aNumberBuffers; bufIndex++)
+ {
+ CBufferHeaderInfo* headerInfo = new (ELeave) CBufferHeaderInfo(*this);
+ iBufferHeaders.AppendL(headerInfo);
+ headerInfo->iPortIndex = aPortIndex;
+
+ if (iPortsUsingBaseProfile[portInfoIndex].iWeAreBufferSupplier)
+ {
+ OMX_U8* buffer = new (ELeave) OMX_U8[bufSize];
+ iOmxComponent->UseBuffer(iOmxComponent, &(headerInfo->iBufferHeader), aPortIndex, NULL, bufSize, buffer);
+ }
+ else
+ {
+ iOmxComponent->AllocateBuffer(iOmxComponent, &(headerInfo->iBufferHeader), aPortIndex, NULL, bufSize);
+ }
+ }
+ }
+
+void CBaseProfileHandler::DoEventReceived(OMX_EVENTTYPE /*aeEvent*/, OMX_U32 /*anData1*/, OMX_U32 /*anData2*/, OMX_PTR /*apEventData*/)
+ {
+ //Uninterested
+ }
+
+void CBaseProfileHandler::DoFillBufferDone(OMX_BUFFERHEADERTYPE* /*aFilledBuffer*/)
+ {
+ //Uninterested
+ }
+
+void CBaseProfileHandler::DoEmptyBufferDone(OMX_BUFFERHEADERTYPE* /*aEmptiedBuffer*/)
+ {
+ //Uninterested
+ }
+
+CBaseProfileHandler::CBufferHeaderInfo::CBufferHeaderInfo(CBaseProfileHandler& aParent)
+: iBufferAvailable(ETrue), iParent(aParent)
+ {
+ }
+
+CBaseProfileHandler::CBufferHeaderInfo::~CBufferHeaderInfo()
+ {
+ OMX_U8* buffer = iBufferHeader->pBuffer;
+ OMX_ERRORTYPE error = iParent.iOmxComponent->FreeBuffer(iParent.iOmxComponent, iPortIndex, iBufferHeader);
+ if (error != OMX_ErrorNone)
+ {
+ iParent.iErrorCallbacks.FailWithOmxError(_L("OMX_FreeBuffer()"), error);
+ return;
+ }
+
+ TInt portInfoIndex = iParent.iPortsUsingBaseProfile.Find(iPortIndex, CBaseProfileHandler::PortIndexMatchComparison);
+ if (iParent.iPortsUsingBaseProfile[portInfoIndex].iWeAreBufferSupplier)
+ {
+ delete[] buffer;
+ }
+ }
+
+TBool CBaseProfileHandler::PortIndexMatchComparison(const TInt* aPortIndex, const TPortInfo& aPortInfo)
+ {
+ if (*aPortIndex == aPortInfo.iPortIndex)
+ {
+ return ETrue;
+ }
+ return EFalse;
+ }
+
+TBool CBaseProfileHandler::BufferHeaderMatchComparison(const OMX_BUFFERHEADERTYPE* aBufferHeader, const CBufferHeaderInfo& aBufferHeaderInfo)
+ {
+ if (aBufferHeader == aBufferHeaderInfo.iBufferHeader)
+ {
+ return ETrue;
+ }
+ return EFalse;
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/src/baseprofilehandler.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,107 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#ifndef BASEPROFILEHANDLER_H_
+#define BASEPROFILEHANDLER_H_
+
+#include <e32base.h>
+
+#include <openmax/il/khronos/v1_x/OMX_Core.h>
+#include <openmax/il/khronos/v1_x/OMX_Component.h>
+
+#include "asbreakeventhandler.h"
+#include "omxscripttest.h"
+
+
+NONSHARABLE_CLASS(CBaseProfileHandler) : public CBase
+ {
+public:
+ CBaseProfileHandler(ROmxScriptTest& aTestOwner, RASBreakEventHandler& aParentEventHandler);
+ ~CBaseProfileHandler();
+
+ OMX_COMPONENTTYPE* LoadComponentL(const TDesC8& aTestSpecificName, const TDesC8& aOmxName);
+
+ void AddPortSupportL(TInt aPortIndex);
+ void SetBufferSupplier(TInt aPortIndex, TBool aComponentBufferSupplier);
+ void SetAutoMode(TInt aPortIndex, TBool aAutoMode);
+ void SetupBuffersL(TInt aPortIndex, TInt aNumberBuffers);
+ void FreeAllocatedBuffersL();
+ void FillThisBuffer(TInt aPortIndex, TInt aBufferIndexInPort);
+ void EmptyThisBuffer(TInt aPortIndex, TInt aBufferIndexInPort);
+ void WaitForBufferCompletion(TInt aPortIndex, TInt aBufferIndexInPort);
+
+ //OpenMAX IL callbacks
+ static OMX_ERRORTYPE EventHandler(OMX_HANDLETYPE hComponent, OMX_PTR pAppData, OMX_EVENTTYPE eEvent, OMX_U32 nData1, OMX_U32 nData2, OMX_PTR pEventData);
+ static OMX_ERRORTYPE FillBufferDone(OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_PTR pAppData, OMX_IN OMX_BUFFERHEADERTYPE* pBuffer);
+ static OMX_ERRORTYPE EmptyBufferDone(OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_PTR pAppData, OMX_IN OMX_BUFFERHEADERTYPE* pBuffer);
+
+ void HandleEventReceived(OMX_EVENTTYPE aeEvent, OMX_U32 anData1, OMX_U32 anData2, OMX_PTR apEventData);
+ void HandleFillBufferDone(OMX_IN OMX_BUFFERHEADERTYPE* aFilledBuffer);
+ void HandleEmptyBufferDone(OMX_IN OMX_BUFFERHEADERTYPE* aEmptiedBuffer);
+
+protected:
+
+ NONSHARABLE_CLASS(CBufferHeaderInfo) : public CBase
+ {
+ public:
+ CBufferHeaderInfo(CBaseProfileHandler& aParent);
+ ~CBufferHeaderInfo();
+
+ public:
+ OMX_BUFFERHEADERTYPE* iBufferHeader;
+ TBool iBufferAvailable; //EFalse if buffer currently with IL Component
+ TInt iPortIndex; //Port the buffer is assigned to
+ CBaseProfileHandler& iParent;
+ };
+
+ struct TPortInfo
+ {
+ TInt iPortIndex;
+ TBool iWeAreBufferSupplier;
+ TBool iAutoMode;
+ };
+
+ virtual void DoEventReceived(OMX_EVENTTYPE aeEvent, OMX_U32 anData1, OMX_U32 anData2, OMX_PTR apEventData);
+ virtual void DoFillBufferDone(OMX_IN OMX_BUFFERHEADERTYPE* aFilledBuffer);
+ virtual void DoEmptyBufferDone(OMX_IN OMX_BUFFERHEADERTYPE* aEmptiedBuffer);
+
+ static TBool PortIndexMatchComparison(const TInt* aPortIndex, const TPortInfo& aPortInfo);
+ static TBool BufferHeaderMatchComparison(const OMX_BUFFERHEADERTYPE* aBufferHeader, const CBufferHeaderInfo& aBufferHeaderInfo);
+
+ //aBufferIndexInPort starts at 0 for the first buffer
+ TInt LocateBufferForPort(TInt aPortIndex, TInt aBufferIndexInPort);
+
+protected:
+ OMX_CALLBACKTYPE iOmxCallbacks;
+ OMX_COMPONENTTYPE* iOmxComponent; //Not owned
+
+ RPointerArray<CBufferHeaderInfo> iBufferHeaders;
+
+ RArray<TPortInfo> iPortsUsingBaseProfile;
+
+ HBufC* iXmlName;
+
+ ROmxScriptTest& iErrorCallbacks;
+ RASBreakEventHandler& iEventHandlerCallbacks;
+
+ OMX_BUFFERHEADERTYPE* iWaitingOnBuffer; //Not owned, only ever one wait request pending at any one time so this suffices
+
+ RMutex iMutex; //Used to ensure serialised execution of buffer completions and calls to wait on buffer completions
+ };
+
+#endif /* BASEPROFILEHANDLER_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/src/baseprofiletimestamping.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,117 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include "baseprofiletimestamping.h"
+
+_LIT(KErrDialogTimestampCheckFailed, "A timestamp check failed on Component: %S, Port: %d. Expected time: %u +/- %u, actual: %Lu");
+_LIT(KErrDialogTimestampComparisonFailed, "A timestamp compare with clock media time failed on Component: %S, Port: %d. Media time: %Lu, delay allowed: %u, actual: %Lu");
+
+CBaseProfileTimestampHandling::CBaseProfileTimestampHandling(ROmxScriptTest& aTestOwner, RASBreakEventHandler& aParentEventHandler)
+: CBaseProfileHandler(aTestOwner, aParentEventHandler)
+ {
+ }
+
+CBaseProfileTimestampHandling::~CBaseProfileTimestampHandling()
+ {
+ iPendingTimestampChecks.Close();
+ }
+
+void CBaseProfileTimestampHandling::SetClockComponent(OMX_COMPONENTTYPE* aClockComponent)
+ {
+ iClockComponent = aClockComponent;
+ }
+
+void CBaseProfileTimestampHandling::QueueTimestampCheckL(TInt aPortIndex, TUint aTime, TUint aTolerance)
+ {
+ TTimestampCheckingInfo timestampCheck;
+ timestampCheck.iPortIndex = aPortIndex;
+ timestampCheck.iExpectedTime = aTime;
+ timestampCheck.iTolerance = aTolerance;
+ timestampCheck.iCompareWithRefClock = EFalse;
+
+ iPendingTimestampChecks.AppendL(timestampCheck);
+ }
+
+void CBaseProfileTimestampHandling::QueueCompareWithRefClockL(TInt aPortIndex, TUint aTolerance)
+ {
+ TTimestampCheckingInfo timestampCheck;
+ timestampCheck.iPortIndex = aPortIndex;
+ timestampCheck.iExpectedTime = 0;
+ timestampCheck.iTolerance = aTolerance;
+ timestampCheck.iCompareWithRefClock = ETrue;
+
+ iPendingTimestampChecks.AppendL(timestampCheck);
+ }
+
+void CBaseProfileTimestampHandling::DoFillBufferDone(OMX_BUFFERHEADERTYPE* aFilledBuffer)
+ {
+ CheckTimestamp(aFilledBuffer);
+ }
+
+void CBaseProfileTimestampHandling::DoEmptyBufferDone(OMX_BUFFERHEADERTYPE* aEmptiedBuffer)
+ {
+ CheckTimestamp(aEmptiedBuffer);
+ }
+
+void CBaseProfileTimestampHandling::CheckTimestamp(OMX_BUFFERHEADERTYPE* aBuffer)
+ {
+ TInt bufferIndex = iBufferHeaders.Find(*aBuffer, CBaseProfileHandler::BufferHeaderMatchComparison);
+
+ for (TInt index=0; index < iPendingTimestampChecks.Count(); index++)
+ {
+ if (iBufferHeaders[bufferIndex]->iPortIndex != iPendingTimestampChecks[index].iPortIndex)
+ {
+ continue;
+ }
+ TTimestampCheckingInfo passCriteria = iPendingTimestampChecks[index];
+ iPendingTimestampChecks.Remove(index);
+
+ if (passCriteria.iCompareWithRefClock)
+ {
+ OMX_TIME_CONFIG_TIMESTAMPTYPE timeInfo;
+ timeInfo.nSize = sizeof(timeInfo);
+ timeInfo.nVersion = KOmxVersion;
+ timeInfo.nPortIndex = passCriteria.iPortIndex;
+
+ OMX_ERRORTYPE error = iClockComponent->GetConfig(iClockComponent, OMX_IndexConfigTimeCurrentMediaTime, &timeInfo);
+
+ if (error != OMX_ErrorNone)
+ {
+ iErrorCallbacks.FailWithOmxError(_L("OMX_GetConfig(OMX_IndexConfigTimeCurrentMediaTime)"), error);
+ }
+ else if ((aBuffer->nTimeStamp > timeInfo.nTimestamp) || (aBuffer->nTimeStamp < (timeInfo.nTimestamp - passCriteria.iTolerance)))
+ {
+ TBuf<200> errorString;
+ errorString.Format(KErrDialogTimestampComparisonFailed, iXmlName, passCriteria.iPortIndex, timeInfo.nTimestamp, passCriteria.iTolerance, aBuffer->nTimeStamp);
+ iErrorCallbacks.FailTest(errorString);
+ }
+ }
+ else
+ {
+ if ((aBuffer->nTimeStamp < (passCriteria.iExpectedTime - passCriteria.iTolerance)) || (aBuffer->nTimeStamp > (passCriteria.iExpectedTime + passCriteria.iTolerance)))
+ {
+ TBuf<200> errorString;
+ errorString.Format(KErrDialogTimestampCheckFailed, iXmlName, passCriteria.iPortIndex, passCriteria.iExpectedTime, passCriteria.iTolerance, aBuffer->nTimeStamp);
+ iErrorCallbacks.FailTest(errorString);
+ }
+ }
+
+ break;
+ }
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/src/baseprofiletimestamping.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#ifndef BASEPROFILETIMESTAMPING_H_
+#define BASEPROFILETIMESTAMPING_H_
+
+#include "baseprofilehandler.h"
+
+NONSHARABLE_CLASS(CBaseProfileTimestampHandling) : public CBaseProfileHandler
+ {
+public:
+ CBaseProfileTimestampHandling(ROmxScriptTest& aTestOwner, RASBreakEventHandler& aParentEventHandler);
+ ~CBaseProfileTimestampHandling();
+
+ void SetClockComponent(OMX_COMPONENTTYPE* aClockComponent);
+ void QueueTimestampCheckL(TInt aPortIndex, TUint aTime, TUint aTolerance);
+ void QueueCompareWithRefClockL(TInt aPortIndex, TUint aTolerance);
+
+protected:
+
+ struct TTimestampCheckingInfo
+ {
+ TInt iPortIndex; //Index in the component
+ TUint iExpectedTime;
+ TUint iTolerance;
+ TBool iCompareWithRefClock;
+ };
+
+ virtual void DoFillBufferDone(OMX_BUFFERHEADERTYPE* aFilledBuffer);
+ virtual void DoEmptyBufferDone(OMX_BUFFERHEADERTYPE* aEmptiedBuffer);
+
+ void CheckTimestamp(OMX_BUFFERHEADERTYPE* aBuffer);
+
+
+
+private:
+ OMX_COMPONENTTYPE* iClockComponent; //Not owned, if non null used as the reference clock for cmparison with the current set of timestamps
+ RArray<TTimestampCheckingInfo> iPendingTimestampChecks;
+
+ };
+
+#endif /* BASEPROFILETIMESTAMPING_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/src/log.h Wed Aug 25 12:40:50 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:
+*
+*/
+
+#ifndef LOG_H_
+#define LOG_H_
+
+#include "omx_xml_script.h"
+
+#define __FILE8__ REINTERPRET_CAST(const TText8*, __FILE__)
+
+#define INFO_PRINTF1(p1) LogExtra(__FILE8__, __LINE__, EOmxScriptSevInfo, (p1))
+#define INFO_PRINTF2(p1, p2) LogExtra(__FILE8__, __LINE__, EOmxScriptSevInfo, (p1), (p2))
+#define INFO_PRINTF3(p1, p2, p3) LogExtra(__FILE8__, __LINE__, EOmxScriptSevInfo, (p1), (p2), (p3))
+#define INFO_PRINTF4(p1, p2, p3, p4) LogExtra(__FILE8__, __LINE__, EOmxScriptSevInfo, (p1), (p2), (p3), (p4))
+#define INFO_PRINTF5(p1, p2, p3, p4, p5) LogExtra(__FILE8__, __LINE__, EOmxScriptSevInfo, (p1), (p2), (p3), (p4), (p5))
+#define INFO_PRINTF6(p1, p2, p3, p4, p5, p6) LogExtra(__FILE8__, __LINE__, EOmxScriptSevInfo, (p1), (p2), (p3), (p4), (p5), (p6))
+#define INFO_PRINTF7(p1, p2, p3, p4, p5, p6, p7) LogExtra(__FILE8__, __LINE__, EOmxScriptSevInfo, (p1), (p2), (p3), (p4), (p5), (p6), (p7))
+#define INFO_PRINTF8(p1, p2, p3, p4, p5, p6, p7, p8) LogExtra(__FILE8__, __LINE__, EOmxScriptSevInfo, (p1), (p2), (p3), (p4), (p5), (p6), (p7), (p8))
+#define INFO_PRINTF9(p1, p2, p3, p4, p5, p6, p7, p8, p9) LogExtra(__FILE8__, __LINE__, EOmxScriptSevInfo, (p1), (p2), (p3), (p4), (p5), (p6), (p7), (p8), (p9))
+
+#define WARN_PRINTF1(p1) LogExtra(__FILE8__, __LINE__, EOmxScriptSevWarn, (p1))
+#define WARN_PRINTF2(p1, p2) LogExtra(__FILE8__, __LINE__, EOmxScriptSevWarn, (p1), (p2))
+#define WARN_PRINTF3(p1, p2, p3) LogExtra(__FILE8__, __LINE__, EOmxScriptSevWarn, (p1), (p2), (p3))
+#define WARN_PRINTF4(p1, p2, p3, p4) LogExtra(__FILE8__, __LINE__, EOmxScriptSevWarn, (p1), (p2), (p3), (p4))
+#define WARN_PRINTF5(p1, p2, p3, p4, p5) LogExtra(__FILE8__, __LINE__, EOmxScriptSevWarn, (p1), (p2), (p3), (p4), (p5))
+#define WARN_PRINTF6(p1, p2, p3, p4, p5, p6) LogExtra(__FILE8__, __LINE__, EOmxScriptSevWarn, (p1), (p2), (p3), (p4), (p5), (p6))
+#define WARN_PRINTF7(p1, p2, p3, p4, p5, p6, p7) LogExtra(__FILE8__, __LINE__, EOmxScriptSevWarn, (p1), (p2), (p3), (p4), (p5), (p6), (p7))
+
+#define ERR_PRINTF1(p1) LogExtra(__FILE8__, __LINE__, EOmxScriptSevErr, (p1))
+#define ERR_PRINTF2(p1, p2) LogExtra(__FILE8__, __LINE__, EOmxScriptSevErr, (p1), (p2))
+#define ERR_PRINTF3(p1, p2, p3) LogExtra(__FILE8__, __LINE__, EOmxScriptSevErr, (p1), (p2), (p3)) ;
+#define ERR_PRINTF4(p1, p2, p3, p4) LogExtra(__FILE8__, __LINE__, EOmxScriptSevErr, (p1), (p2), (p3), (p4))
+#define ERR_PRINTF5(p1, p2, p3, p4, p5) LogExtra(__FILE8__, __LINE__, EOmxScriptSevErr, (p1), (p2), (p3), (p4), (p5))
+#define ERR_PRINTF6(p1, p2, p3, p4, p5, p6) LogExtra(__FILE8__, __LINE__, EOmxScriptSevErr, (p1), (p2), (p3), (p4), (p5), (p6))
+#define ERR_PRINTF7(p1, p2, p3, p4, p5, p6, p7) LogExtra(__FILE8__, __LINE__, EOmxScriptSevErr, (p1), (p2), (p3), (p4), (p5), (p6), (p7))
+
+#endif /* LOG_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/src/nontunneledhandler.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,417 @@
+/*
+* 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:
+*
+*/
+
+
+#include "nontunneledhandler.h"
+
+CNonTunneledHandler::CNonTunneledHandler()
+ {
+ }
+
+CNonTunneledHandler::~CNonTunneledHandler()
+ {
+ }
+
+void CNonTunneledHandler::AddLinkL(OMX_COMPONENTTYPE* aSourceComp,
+ TInt aSourcePort,
+ OMX_COMPONENTTYPE* aSinkComp,
+ TInt aSinkPort,
+ OMX_BUFFERSUPPLIERTYPE aSupplier,
+ TInt aNumBufs, TInt aBufSize)
+ {
+ CComponentInfo* compInfo = NULL;
+ TInt pos = iComponents.Find(*aSourceComp, CComponentInfo::CompareComp);
+ if (pos >= 0)
+ {
+ compInfo = iComponents[pos];
+ }
+ else
+ {
+ compInfo = new (ELeave) CComponentInfo(aSourceComp);
+ CleanupStack::PushL(compInfo);
+ iComponents.AppendL(compInfo);
+ CleanupStack::Pop(compInfo);
+ }
+
+ CPortInfo* sourcePortInfo = compInfo->AddPortL(aSourcePort, ETrue, aNumBufs, aBufSize, aSupplier);
+
+ pos = iComponents.Find(*aSinkComp, CComponentInfo::CompareComp);
+ if (pos >= 0)
+ {
+ compInfo = iComponents[pos];
+ }
+ else
+ {
+ compInfo = new (ELeave) CComponentInfo(aSinkComp);
+ CleanupStack::PushL(compInfo);
+ iComponents.AppendL(compInfo);
+ CleanupStack::Pop(compInfo);
+ }
+
+ CPortInfo* sinkPortInfo = compInfo->AddPortL(aSinkPort, EFalse, aNumBufs, aBufSize, aSupplier);
+
+ sourcePortInfo->SetPeer(sinkPortInfo);
+ sinkPortInfo->SetPeer(sourcePortInfo);
+ }
+
+void CNonTunneledHandler::AllocateBuffersL(OMX_COMPONENTTYPE* aComp)
+ {
+ TInt pos = iComponents.Find(*aComp, CComponentInfo::CompareComp);
+ if (pos >= 0)
+ {
+ iComponents[pos]->AllocateBuffersL();
+ }
+ }
+
+void CNonTunneledHandler::FillBuffers(OMX_COMPONENTTYPE* aComp)
+ {
+ TInt pos = iComponents.Find(*aComp, CComponentInfo::CompareComp);
+ if (pos >= 0)
+ {
+ iComponents[pos]->FillBuffers();
+ }
+ }
+
+void CNonTunneledHandler::BufferDone(OMX_COMPONENTTYPE* aComp, OMX_BUFFERHEADERTYPE* aBufHdr, TBool aSource)
+ {
+ TInt pos = iComponents.Find(*aComp, CComponentInfo::CompareComp);
+ if (pos >= 0)
+ {
+ iComponents[pos]->BufferDone(aBufHdr, aSource);
+ }
+ }
+
+void CNonTunneledHandler::HoldBuffers(OMX_COMPONENTTYPE* aComp)
+ {
+ TInt pos = iComponents.Find(*aComp, CComponentInfo::CompareComp);
+ if (pos >= 0)
+ {
+ iComponents[pos]->HoldBuffers();
+ }
+ }
+
+void CNonTunneledHandler::FreeBuffers(OMX_COMPONENTTYPE* aComp)
+ {
+ TInt pos = iComponents.Find(*aComp, CComponentInfo::CompareComp);
+ if (pos >= 0)
+ {
+ iComponents[pos]->FreeBuffers();
+ }
+ }
+
+CNonTunneledHandler::CComponentInfo::CComponentInfo(OMX_COMPONENTTYPE* aComp) :
+ iComp(aComp)
+ {
+ }
+
+CNonTunneledHandler::CComponentInfo::~CComponentInfo()
+ {
+ iPorts.ResetAndDestroy();
+ }
+
+CNonTunneledHandler::CPortInfo* CNonTunneledHandler::CComponentInfo::AddPortL(TInt aPortNum, TBool aSource, TInt aNumBufs, TInt aBufSize, OMX_BUFFERSUPPLIERTYPE aSupplier)
+ {
+ __ASSERT_ALWAYS(iPorts.Find(aPortNum, CPortInfo::ComparePortNum) == KErrNotFound, User::Invariant());
+
+ CPortInfo* portInfo = new (ELeave) CPortInfo(iComp, aPortNum, aSource, aNumBufs, aBufSize, aSupplier);
+ CleanupStack::PushL(portInfo);
+ iPorts.AppendL(portInfo);
+ CleanupStack::Pop(portInfo);
+
+ return portInfo;
+ }
+
+void CNonTunneledHandler::CComponentInfo::AllocateBuffersL()
+ {
+ TInt numPorts = iPorts.Count();
+
+ for (TInt port = 0; port < numPorts; ++port)
+ {
+ iPorts[port]->AllocateBuffersL();
+ }
+ }
+
+void CNonTunneledHandler::CComponentInfo::FillBuffers()
+ {
+ TInt numPorts = iPorts.Count();
+
+ for (TInt port = 0; port < numPorts; ++port)
+ {
+ iPorts[port]->FillBuffers();
+ }
+ }
+
+void CNonTunneledHandler::CComponentInfo::BufferDone(OMX_BUFFERHEADERTYPE* aBufHdr, TBool aSource)
+ {
+ TInt pos = KErrNotFound;
+
+ if (aSource)
+ {
+ pos = iPorts.Find(static_cast<TInt>(aBufHdr->nOutputPortIndex), CPortInfo::ComparePortNum);
+ }
+ else
+ {
+ pos = iPorts.Find(static_cast<TInt>(aBufHdr->nInputPortIndex), CPortInfo::ComparePortNum);
+ }
+
+ __ASSERT_ALWAYS(pos != KErrNotFound, User::Invariant());
+
+ iPorts[pos]->BufferDone(aBufHdr);
+ }
+
+void CNonTunneledHandler::CComponentInfo::HoldBuffers()
+ {
+ for (TInt port = 0; port < iPorts.Count(); ++port)
+ {
+ iPorts[port]->HoldBuffers();
+ }
+ }
+
+void CNonTunneledHandler::CComponentInfo::FreeBuffers()
+ {
+ for (TInt port = 0; port < iPorts.Count(); ++port)
+ {
+ iPorts[port]->FreeBuffers();
+ }
+ }
+
+TBool CNonTunneledHandler::CComponentInfo::CompareComp(const OMX_COMPONENTTYPE* aComp, const CComponentInfo& aComponentInfo)
+ {
+ return (aComp == aComponentInfo.iComp);
+ }
+
+CNonTunneledHandler::CPortInfo::CPortInfo(OMX_COMPONENTTYPE* aComp, TInt aPortNum, TBool aSource, TInt aNumBufs, TInt aBufSize, OMX_BUFFERSUPPLIERTYPE aSupplier) :
+ iComp(aComp),
+ iPortNum(aPortNum),
+ iSource(aSource),
+ iNumBufs(aNumBufs),
+ iBufSize(aBufSize),
+ iSupplier(aSupplier),
+ iEosSignalledtoInput(FALSE)
+ {
+ }
+
+CNonTunneledHandler::CPortInfo::~CPortInfo()
+ {
+ DeleteAllBuffers();
+ }
+
+void CNonTunneledHandler::CPortInfo::SetPeer(CPortInfo* aPeer)
+ {
+ iPeer = aPeer;
+ }
+
+void CNonTunneledHandler::CPortInfo::AllocateBuffersL()
+ {
+ OMX_BUFFERHEADERTYPE* bufHdr = NULL;
+
+ if (iSource)
+ {
+ if (iSupplier == OMX_BufferSupplyUnspecified)
+ {
+ OMX_U8* newBuffer = NULL;
+
+ for (TInt buf = 0; buf < iNumBufs; ++buf)
+ {
+ newBuffer = new (ELeave) OMX_U8[iBufSize];
+ CleanupStack::PushL(newBuffer);
+ iBuffers.AppendL(newBuffer);
+ CleanupStack::Pop(newBuffer);
+ iComp->UseBuffer(iComp, &bufHdr, iPortNum, NULL, iBufSize, newBuffer);
+ iBufferHeaders.AppendL(bufHdr);
+ SendAllocatedBufferToPeerL(newBuffer);
+ }
+ }
+ else if (iSupplier == OMX_BufferSupplyOutput)
+ {
+ for (TInt buf = 0; buf < iNumBufs; ++buf)
+ {
+ iComp->AllocateBuffer(iComp, &bufHdr, iPortNum, NULL, iBufSize);
+ iBufferHeaders.AppendL(bufHdr);
+ SendAllocatedBufferToPeerL(bufHdr->pBuffer);
+ }
+ }
+ else
+ {
+ TInt bufCount = iBuffers.Count();
+
+ for (TInt buf = 0; buf < bufCount; ++buf)
+ {
+ iComp->UseBuffer(iComp, &bufHdr, iPortNum, NULL, iBufSize, iBuffers[buf]);
+ iBufferHeaders.AppendL(bufHdr);
+ }
+
+ if (bufCount < iNumBufs)
+ {
+ iWaitingForBuffers = ETrue;
+ }
+ }
+ }
+ else
+ {
+ if (iSupplier == OMX_BufferSupplyInput)
+ {
+ for (TInt buf = 0; buf < iNumBufs; ++buf)
+ {
+ iComp->AllocateBuffer(iComp, &bufHdr, iPortNum, NULL, iBufSize);
+ iBufferHeaders.AppendL(bufHdr);
+ SendAllocatedBufferToPeerL(bufHdr->pBuffer);
+ }
+ }
+ else
+ {
+ TInt bufCount = iBuffers.Count();
+
+ for (TInt buf = 0; buf < bufCount; ++buf)
+ {
+ iComp->UseBuffer(iComp, &bufHdr, iPortNum, NULL, iBufSize, iBuffers[buf]);
+ iBufferHeaders.AppendL(bufHdr);
+ }
+
+ if (bufCount < iNumBufs)
+ {
+ iWaitingForBuffers = ETrue;
+ }
+ }
+ }
+ }
+
+void CNonTunneledHandler::CPortInfo::SendAllocatedBufferToPeerL(OMX_U8* aBuffer)
+ {
+ __ASSERT_ALWAYS(iPeer, User::Invariant());
+
+ iPeer->ReceiveAllocatedBufferFromPeerL(aBuffer);
+ }
+
+void CNonTunneledHandler::CPortInfo::ReceiveAllocatedBufferFromPeerL(OMX_U8* aBuffer)
+ {
+ if (iWaitingForBuffers)
+ {
+ OMX_BUFFERHEADERTYPE* bufHdr = NULL;
+
+ iComp->UseBuffer(iComp, &bufHdr, iPortNum, NULL, iBufSize, aBuffer);
+ iBufferHeaders.AppendL(bufHdr);
+
+ if (iBufferHeaders.Count() == iNumBufs)
+ {
+ iWaitingForBuffers = EFalse;
+ }
+ }
+ else
+ {
+ iBuffers.AppendL(aBuffer);
+ }
+ }
+
+void CNonTunneledHandler::CPortInfo::FillBuffers()
+ {
+ iHoldingBuffers = EFalse;
+ if (iSource)
+ {
+ for (TInt buf = 0; buf < iNumBufs; ++buf)
+ {
+ iComp->FillThisBuffer(iComp, iBufferHeaders[buf]);
+ }
+ }
+ }
+
+void CNonTunneledHandler::CPortInfo::BufferDone(OMX_BUFFERHEADERTYPE* aBufHdr)
+ {
+ for (TInt buf = 0; buf < iNumBufs; ++buf)
+ {
+ if (iBufferHeaders[buf] == aBufHdr)
+ {
+ iPeer->ReceiveBufferFromPeer(buf, aBufHdr);
+ }
+ }
+ }
+
+void CNonTunneledHandler::CPortInfo::SendBufferToPeer(TInt aBufHdrOffset, OMX_BUFFERHEADERTYPE* aPeerBufHdr)
+ {
+ __ASSERT_ALWAYS(iPeer, User::Invariant());
+
+ iPeer->ReceiveBufferFromPeer(aBufHdrOffset, aPeerBufHdr);
+ }
+
+void CNonTunneledHandler::CPortInfo::ReceiveBufferFromPeer(TInt aBufHdrOffset, OMX_BUFFERHEADERTYPE* aPeerBufHdr)
+ {
+ __ASSERT_ALWAYS(aBufHdrOffset < iNumBufs, User::Invariant());
+
+ if (!iHoldingBuffers)
+ {
+ iBufferHeaders[aBufHdrOffset]->nOffset = aPeerBufHdr->nOffset;
+ iBufferHeaders[aBufHdrOffset]->nFilledLen = aPeerBufHdr->nFilledLen;
+
+ if (iSource)
+ {
+ iComp->FillThisBuffer(iComp, iBufferHeaders[aBufHdrOffset]);
+ }
+ else
+ {
+ iBufferHeaders[aBufHdrOffset]->hMarkTargetComponent = aPeerBufHdr->hMarkTargetComponent;
+ iBufferHeaders[aBufHdrOffset]->pMarkData = aPeerBufHdr->pMarkData;
+ iBufferHeaders[aBufHdrOffset]->nTimeStamp = aPeerBufHdr->nTimeStamp;
+ iBufferHeaders[aBufHdrOffset]->nFlags = aPeerBufHdr->nFlags;
+
+ if(aPeerBufHdr->nFlags & OMX_BUFFERFLAG_EOS)
+ {
+ // TODO Logic for EOS
+ if(iEosSignalledtoInput == FALSE)
+ {
+ iComp->EmptyThisBuffer(iComp, iBufferHeaders[aBufHdrOffset]);
+ iEosSignalledtoInput = TRUE;
+ }
+ return;
+ }
+ iComp->EmptyThisBuffer(iComp, iBufferHeaders[aBufHdrOffset]);
+ }
+ }
+ }
+
+void CNonTunneledHandler::CPortInfo::HoldBuffers()
+ {
+ iHoldingBuffers = ETrue;
+ }
+
+void CNonTunneledHandler::CPortInfo::FreeBuffers()
+ {
+ for (TInt buf = 0; buf < iNumBufs; ++buf)
+ {
+ iComp->FreeBuffer(iComp, iPortNum, iBufferHeaders[buf]);
+ }
+
+ DeleteAllBuffers();
+ }
+
+void CNonTunneledHandler::CPortInfo::DeleteAllBuffers()
+ {
+ iBufferHeaders.Reset();
+
+ if (iSource && iSupplier == OMX_BufferSupplyUnspecified)
+ {
+ iBuffers.ResetAndDestroy();
+ }
+ else
+ {
+ iBuffers.Reset();
+ }
+ }
+
+TBool CNonTunneledHandler::CPortInfo::ComparePortNum(const TInt* aPortNum, const CPortInfo& aPortInfo)
+ {
+ return (*aPortNum == aPortInfo.iPortNum);
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/src/nontunneledhandler.h Wed Aug 25 12:40:50 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:
+*
+*/
+
+
+#ifndef NONTUNNELEDHANDLER_H
+#define NONTUNNELEDHANDLER_H
+
+#include <e32base.h>
+#include <openmax/il/khronos/v1_x/OMX_Component.h>
+
+NONSHARABLE_CLASS(CNonTunneledHandler) : public CBase
+ {
+public:
+ CNonTunneledHandler();
+ ~CNonTunneledHandler();
+
+ void AddLinkL(OMX_COMPONENTTYPE* aSourceComp, TInt aSourcePort,
+ OMX_COMPONENTTYPE* aSinkComp, TInt aSinkPort,
+ OMX_BUFFERSUPPLIERTYPE aSupplier, TInt aNumBufs, TInt aBufSize);
+ void AllocateBuffersL(OMX_COMPONENTTYPE* aComp);
+ void FillBuffers(OMX_COMPONENTTYPE* aComp);
+ void BufferDone(OMX_COMPONENTTYPE* aComp, OMX_BUFFERHEADERTYPE* aBufHdr, TBool aSource);
+ void HoldBuffers(OMX_COMPONENTTYPE* aComp);
+ void FreeBuffers(OMX_COMPONENTTYPE* aComp);
+
+private:
+ NONSHARABLE_CLASS(CPortInfo) : public CBase
+ {
+ public:
+ CPortInfo(OMX_COMPONENTTYPE* aComp, TInt aPortNum, TBool aSource, TInt aNumBufs, TInt aBufSize, OMX_BUFFERSUPPLIERTYPE aSupplier);
+ ~CPortInfo();
+ void SetPeer(CPortInfo* aPeer);
+ void AllocateBuffersL();
+ void FillBuffers();
+ void SendAllocatedBufferToPeerL(OMX_U8* aBuffer);
+ void ReceiveAllocatedBufferFromPeerL(OMX_U8* aBuffer);
+ void BufferDone(OMX_BUFFERHEADERTYPE* aBufHdr);
+ void SendBufferToPeer(TInt aBufHdrOffset, OMX_BUFFERHEADERTYPE* aPeerBufHdr);
+ void ReceiveBufferFromPeer(TInt aBufHdrOffset, OMX_BUFFERHEADERTYPE* aPeerBufHdr);
+ void HoldBuffers();
+ void FreeBuffers();
+ void DeleteAllBuffers();
+ static TBool ComparePortNum(const TInt* aPortNum, const CPortInfo& aPortInfo);
+
+ private:
+ OMX_COMPONENTTYPE* iComp;
+ TInt iPortNum;
+ TBool iSource;
+ TInt iNumBufs;
+ TInt iBufSize;
+ OMX_BUFFERSUPPLIERTYPE iSupplier;
+ RPointerArray<OMX_U8> iBuffers;
+ RPointerArray<OMX_BUFFERHEADERTYPE> iBufferHeaders;
+ CPortInfo* iPeer;
+ TBool iWaitingForBuffers;
+ TBool iHoldingBuffers;
+ TBool iEosSignalledtoInput;
+ };
+
+ NONSHARABLE_CLASS(CComponentInfo) : public CBase
+ {
+ public:
+ CComponentInfo(OMX_COMPONENTTYPE* aComp);
+ ~CComponentInfo();
+ CPortInfo* AddPortL(TInt aPortNum, TBool aSource, TInt aNumBufs, TInt aBufSize, OMX_BUFFERSUPPLIERTYPE aSupplier);
+ void AllocateBuffersL();
+ void FillBuffers();
+ void BufferDone(OMX_BUFFERHEADERTYPE* aBufHdr, TBool aSource);
+ void HoldBuffers();
+ void FreeBuffers();
+ static TBool CompareComp(const OMX_COMPONENTTYPE* aSource, const CComponentInfo& aComponentInfo);
+
+ private:
+ OMX_COMPONENTTYPE* iComp;
+ RPointerArray<CPortInfo> iPorts;
+ };
+
+ RPointerArray<CComponentInfo> iComponents;
+ };
+
+#endif // NONTUNNELEDHANDLER_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/src/omx_xml_script.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include "omx_xml_script.h"
+#include "omxscripttest.h"
+#include "threadedlogger.h"
+
+EXPORT_C COmxXmlScript* COmxXmlScript::NewL(MOmxScriptTestLogger& aLogger)
+ {
+ return new(ELeave) COmxXmlScript(aLogger);
+ }
+
+COmxXmlScript::COmxXmlScript(MOmxScriptTestLogger& aLogger):
+iLogger(aLogger)
+ {
+ }
+
+COmxXmlScript::~COmxXmlScript()
+ {
+ // do nothing
+ }
+
+EXPORT_C void COmxXmlScript::RunScriptL(const TDesC& aScriptFilename, const TDesC& aScriptSection)
+ {
+ CThreadedLogger* threadedLogger = CThreadedLogger::NewLC(iLogger);
+ ROmxScriptTest impl(*threadedLogger);
+ CleanupClosePushL(impl);
+ impl.RunTestL(aScriptFilename, aScriptSection);
+ CleanupStack::PopAndDestroy(2, threadedLogger);
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/src/omxscript.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,263 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <e32base.h>
+#include <e32std.h>
+#include <e32cons.h> // Console
+#include <e32debug.h>
+#include <multimedia/omx_xml_script.h>
+
+// Constants
+
+_LIT(KTextConsoleTitle, "Console");
+_LIT(KTextFailed, " failed, leave code = %d");
+_LIT(KTextPressAnyKey, " [press any key]\n");
+
+// Global Variables
+
+LOCAL_D CConsoleBase* console; // write all messages to this
+
+
+// Local Functions
+
+/**
+ * Logs script output to console and RDebug.
+ */
+class TConsoleLogger : public MOmxScriptTestLogger
+ {
+ void Log(const TText8* aFile, TInt aLine, TOmxScriptSeverity /*aSeverity*/, const TDes& aMessage)
+ {
+ TPtrC8 fileDes8(aFile);
+ TBuf<255> fileDes;
+ fileDes.Copy(fileDes8);
+ console->Printf(_L("%S:%d %S\n"), &fileDes, aLine, &aMessage);
+ RDebug::Print(_L("%S:%d %S"), &fileDes, aLine, &aMessage);
+ }
+ };
+
+LOCAL_C void ShowUsage()
+ {
+ console->Write(_L("Usage: omxscript <filename> <section>\n"));
+ }
+
+LOCAL_C TInt ParseSize(const TDesC& aDes)
+ {
+ TLex lex(aDes);
+ TInt val;
+ if(lex.Val(val) != KErrNone || val < 0)
+ {
+ return KErrArgument;
+ }
+ switch(lex.Get())
+ {
+ case 0: // no modifier
+ break;
+ case 'K':
+ val <<= 10;
+ break;
+ case 'M':
+ val <<= 20;
+ break;
+ default: // bad modifier
+ return KErrArgument;
+ }
+ if(lex.Get() != 0)
+ {
+ // trailing text
+ return KErrArgument;
+ }
+ return val;
+ }
+
+/**
+ * Extracts parameters from the command line.
+ * This method must not use the cleanup stack; there may not be one allocated since we may be switching heaps.
+ */
+LOCAL_C TInt ParseCommandLineArgs(TDes& commandLine, TPtrC& aFilename, TPtrC& aSection, TInt &aHeapSize)
+ {
+ // copy the command line
+ if(User::CommandLineLength() > commandLine.MaxLength())
+ {
+ return KErrTooBig;
+ }
+ User::CommandLine(commandLine);
+
+ // parse filename, section and other args from the command line
+ TInt heapSize = KErrNotFound;
+ TPtrC filename(KNullDesC);
+ TPtrC section(KNullDesC);
+ TLex lex(commandLine);
+ lex.SkipSpaceAndMark();
+ while(!lex.Eos())
+ {
+ lex.SkipCharacters();
+ TPtrC arg = lex.MarkedToken();
+ lex.SkipSpaceAndMark();
+ if(arg == _L("-heap"))
+ {
+ if(lex.Eos())
+ {
+ // no param following
+ return KErrArgument;
+ }
+ lex.SkipCharacters();
+ TPtrC heapArg = lex.MarkedToken();
+ lex.SkipSpaceAndMark();
+ heapSize = ParseSize(heapArg);
+ if(heapSize == KErrArgument)
+ {
+ return KErrArgument;
+ }
+ }
+ else if(filename.Length() == 0)
+ {
+ filename.Set(arg);
+ }
+ else if(section.Length() == 0)
+ {
+ section.Set(arg);
+ }
+ else
+ {
+ // to many unnamed params
+ return KErrArgument;
+ }
+ }
+ if(section.Length() == 0)
+ {
+ return KErrArgument;
+ }
+ aHeapSize = heapSize;
+ aFilename.Set(filename);
+ aSection.Set(section);
+ return KErrNone;
+ }
+
+LOCAL_C void MainL()
+ {
+ RBuf commandLine;
+ commandLine.CreateL(User::CommandLineLength());
+ CleanupClosePushL(commandLine);
+ TPtrC filename(KNullDesC);
+ TPtrC section(KNullDesC);
+ TInt heapSize = KErrNotFound;
+ TInt error = ParseCommandLineArgs(commandLine, filename, section, heapSize);
+ if(error)
+ {
+ ShowUsage();
+ User::Leave(error);
+ }
+
+ //logs script output to console and RDebug
+ TConsoleLogger logger;
+
+ COmxXmlScript* script = COmxXmlScript::NewL(logger);
+ CleanupStack::PushL(script);
+ script->RunScriptL(filename, section);
+ CleanupStack::PopAndDestroy(2, &commandLine);
+ }
+
+LOCAL_C void DoStartL()
+ {
+ // Create active scheduler (to run active objects)
+ CActiveScheduler* scheduler = new (ELeave) CActiveScheduler();
+ CleanupStack::PushL(scheduler);
+ CActiveScheduler::Install(scheduler);
+
+ MainL();
+
+ // Delete active scheduler
+ CleanupStack::PopAndDestroy(scheduler);
+ }
+
+/**
+ * Invokes ParseCommandLineArgs() to retrieve any heap size specified on the command line.
+ * The command line descriptor is allocated on the stack (since we are avoiding heap allocations at this point).
+ * The descriptors are then thrown away (to avoid consuming too much stack space).
+ * Later, the command line will be parsed again but on the heap.
+ */
+LOCAL_C TInt ParseHeapSize()
+ {
+ TInt heapSize = KErrNotFound;
+ TPtrC filename(KNullDesC);
+ TPtrC section(KNullDesC);
+ TBuf<255> commandLine;
+ // ignore error
+ ParseCommandLineArgs(commandLine, filename, section, heapSize);
+ return heapSize;
+ }
+
+// Global Functions
+
+GLDEF_C TInt E32Main()
+ {
+
+
+ TInt heapSize = ParseHeapSize();
+
+
+ // switch heap if specified
+ RHeap* oldHeap = NULL;
+ RHeap* newHeap = NULL;
+
+ if(heapSize != KErrNotFound)
+ {
+ const TInt KMinHeapGrowBy = 1;
+ const TInt KByteAlignment = 0;
+ const TBool KSingleThreaded = EFalse;
+ newHeap = User::ChunkHeap(NULL, heapSize, heapSize, KMinHeapGrowBy, KByteAlignment, KSingleThreaded);
+ if(newHeap == NULL)
+ {
+ return KErrNoMemory;
+ }
+ oldHeap = User::SwitchHeap(newHeap);
+ }
+
+ // Create cleanup stack
+ __UHEAP_MARK;
+ CTrapCleanup* cleanup = CTrapCleanup::New();
+
+ // Create output console
+ TRAPD(createError, console = Console::NewL(KTextConsoleTitle, TSize(KConsFullScreen,KConsFullScreen)));
+ if (createError)
+ return createError;
+
+ // Run application code inside TRAP harness, wait keypress when terminated
+ TRAPD(mainError, DoStartL());
+
+
+ if(mainError)
+ {
+ console->Printf(KTextFailed, mainError);
+ }
+ console->Printf(KTextPressAnyKey);
+ console->Getch();
+
+ delete console;
+ delete cleanup;
+ __UHEAP_MARKEND;
+
+ if(newHeap != NULL)
+ {
+ User::SwitchHeap(oldHeap);
+ newHeap->Close();
+ }
+
+ return KErrNone;
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/src/omxscriptparser.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,2236 @@
+/*
+* 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 "omxscriptparser.h"
+#include <xml/parser.h>
+#include <utf.h>
+#include "parsemap.h"
+//#include <openmax/il/khronos/v1_x/OMX_CoreExt_Nokia.h>
+
+#if defined(NCP_COMMON_BRIDGE_FAMILY) && !defined(__WINSCW__)
+// These definitions are from /epoc32/include/osi/video/VFM_Types.h
+// We can't include the header itself because it does not obey symbian foundation
+// rules on header file inclusion paths.
+const TInt OMX_COLOR_FormatSTYUV420PackedSemiPlanarMB = (OMX_COLOR_FormatMax-1);
+const TInt OMX_COLOR_FormatSTYUV422PackedSemiPlanarMB = (OMX_COLOR_FormatMax-2);
+#endif
+
+///////////////////////////////////////////////////////////////////////////////
+// Temporary work-around for floating point issues on HREF 8500 ED hardware
+// Using this macro, code that uses TReal will be #defined out if running on ED.
+// TODO: Remove HREF_ED_WITHOUT_FLOATING_POINT and all of its conditional code
+// once the floating point issue has been solved.
+#if defined(NCP_COMMON_BRIDGE_FAMILY) && !defined(__WINSCW__)
+#define HREF_ED_WITHOUT_FLOATING_POINT
+#endif
+
+using Xml::CParser;
+
+COmxScriptParser* COmxScriptParser::NewL(RFs& aFs, const TDesC& aFilename, MOmxScriptIf& aCallback)
+ {
+ COmxScriptParser* self = new(ELeave) COmxScriptParser(aFs, aCallback);
+ CleanupStack::PushL(self);
+ self->ConstructL(aFilename);
+ CleanupStack::Pop(self);
+ return self;
+ }
+
+COmxScriptParser::~COmxScriptParser()
+ {
+ iFilename.Close();
+ }
+
+COmxScriptParser::COmxScriptParser(RFs& aFs, MOmxScriptIf& aCallback):
+iFs(aFs), iCallback(aCallback)
+ {
+
+ }
+
+void COmxScriptParser::ConstructL(const TDesC& aFilename)
+ {
+ User::LeaveIfError(iFilename.Create(aFilename.Length()));
+ iFilename = aFilename;
+ }
+
+TBool COmxScriptParser::RunScriptL(const TDesC& aSectionName)
+ {
+ CParser* parser = CParser::NewLC(_L8("text/xml"), *this);
+ iSectionName = &aSectionName;
+ iInTest = EFalse;
+ iFoundTest = EFalse;
+ iCallbackAborted = EFalse;
+ TInt error = KErrNone;
+ TInt size = iFilename.Length();
+
+ TRAP(error, Xml::ParseL(*parser, iFs, iFilename));
+ CleanupStack::PopAndDestroy(parser);
+
+ if(error == KErrAbort && iCallbackAborted)
+ {
+ return EFalse;
+ }
+ User::LeaveIfError(error);
+ if(!iFoundTest)
+ {
+ User::Leave(KErrNotFound);
+ }
+ return ETrue;
+ }
+
+void COmxScriptParser::OnStartDocumentL(const RDocumentParameters& /*aDocParam*/, TInt /*aErrorCode*/)
+ {
+ // do nothing
+ }
+
+void COmxScriptParser::OnEndDocumentL(TInt /*aErrorCode*/)
+ {
+ // do nothing
+ }
+
+void COmxScriptParser::OnContentL(const TDesC8& /*aBytes*/, TInt /*aErrorCode*/)
+ {
+ // do nothing
+ }
+
+void COmxScriptParser::OnStartPrefixMappingL(const RString& /*aPrefix*/, const RString& /*aUri*/,
+ TInt /*aErrorCode*/)
+ {
+ // do nothing
+ }
+
+void COmxScriptParser::OnEndPrefixMappingL(const RString& /*aPrefix*/, TInt /*aErrorCode*/)
+ {
+ // do nothing
+ }
+
+void COmxScriptParser::OnIgnorableWhiteSpaceL(const TDesC8& /*aBytes*/, TInt /*aErrorCode*/)
+ {
+ // do nothing
+ }
+
+void COmxScriptParser::OnSkippedEntityL(const RString& /*aName*/, TInt /*aErrorCode*/)
+ {
+ User::Invariant();
+ }
+
+void COmxScriptParser::OnProcessingInstructionL(const TDesC8& /*aTarget*/, const TDesC8& /*aData*/,
+ TInt /*aErrorCode*/)
+ {
+ // do nothing
+ }
+
+void COmxScriptParser::OnError(TInt aErrorCode)
+ {
+ (void) aErrorCode; // avoid unused parameter warning. useful to give parameter a name when debugging.
+ User::Invariant();
+ }
+
+TAny* COmxScriptParser::GetExtendedInterface(const TInt32 /*aUid*/)
+ {
+ return 0;
+ }
+
+void COmxScriptParser::OnStartElementL(const RTagInfo& aElement,
+ const RAttributeArray& aAttributes,
+ TInt /*aErrorCode*/)
+ {
+ const TDesC8& elemName = aElement.LocalName().DesC();
+ if(!iInTest)
+ {
+ if(elemName == _L8("Test"))
+ {
+ const TDesC8* testName8Bit = FindAttribute(aAttributes, _L8("name"));
+ if(testName8Bit)
+ {
+ HBufC* testName = HBufC::NewLC(testName8Bit->Length());
+ testName->Des().Copy(*testName8Bit);
+ if(*testName == *iSectionName)
+ {
+ __ASSERT_ALWAYS(!iFoundTest, User::Invariant());
+ iFoundTest = ETrue;
+ iInTest = ETrue;
+ }
+ CleanupStack::PopAndDestroy(testName);
+ }
+ }
+ }
+ else
+ {
+ // to trace out which command has been passed from xml file
+ TBuf<32> elemNameCopy;
+ elemNameCopy.Copy(elemName);
+ TBuf<44> message;
+ message.Append(_L("command: "));
+ message.Append(elemNameCopy);
+ iCallback.MosParseError(message);
+
+ if(elemName == _L8("LoadComponent"))
+ {
+ const TDesC8& comp = FindAttributeL(aAttributes, _L8("comp"));
+ const TDesC8& name = FindAttributeL(aAttributes, _L8("name"));
+
+ TBool baseEnabled = EFalse;
+ const TDesC8* baseImpl = NULL;
+ const TDesC8* baseEnabledAttr = FindAttribute(aAttributes, _L8("baseprofilesupport"));
+ if (baseEnabledAttr != NULL)
+ {
+ baseEnabled = ParseBoolean(*baseEnabledAttr);
+ baseImpl = &(FindAttributeL(aAttributes, _L8("baseprofileimpl")));
+ }
+
+ TBool loadInCoreServerThread = EFalse;
+ const TDesC8* loadInCoreServerThreadAttr = FindAttribute(aAttributes, _L8("loadincoreserverthread"));
+ if(loadInCoreServerThreadAttr != NULL)
+ {
+ loadInCoreServerThread = ParseBoolean(*loadInCoreServerThreadAttr);
+ }
+
+ CheckForAbortL(iCallback.MosLoadComponentL(comp, name, baseEnabled, baseImpl, loadInCoreServerThread));
+ }
+ else if(elemName == _L8("LogAllEvents")) //utility
+ {
+ CheckForAbortL(iCallback.MosLogAllEventsL());
+ }
+
+ else if(elemName == _L8("SetSensorModeType")) //camera
+ {
+ const TDesC8& compPort = FindAttributeL(aAttributes, _L8("port"));
+
+ TPtrC8 comp;
+ TInt port = 0;
+ ParseCompPortL(compPort, comp, port);
+
+ TInt frameRate = ParseOptionalIntL(aAttributes, _L8("frameRate"), -1);
+
+ const TDesC8& oneShotStr = FindAttributeL(aAttributes, _L8("oneShot"));
+ TBool oneShot = ParseBooleanL(oneShotStr);
+ TInt width = ParseOptionalIntL(aAttributes, _L8("width"), -1);
+ TInt height = ParseOptionalIntL(aAttributes, _L8("height"), -1);
+
+ CheckForAbortL(iCallback.MosSetSensorModeTypeL(comp, port, frameRate, oneShot, width, height));
+ }
+ else if(elemName == _L8("DeleteFile")) //utility
+ {
+ const TDesC8& fileName8 = FindAttributeL(aAttributes, _L8("filename"));
+
+ HBufC* fileName = HBufC::NewLC(fileName8.Length() + 1);
+ fileName->Des().Copy(fileName8);
+ fileName->Des().ZeroTerminate();
+
+ TBool fileMustExist = EFalse;
+ const TDesC8* fileMustExistAttr = FindAttribute(aAttributes, _L8("fileMustExist"));
+ if (fileMustExistAttr != NULL)
+ {
+ fileMustExist = ParseBoolean(*fileMustExistAttr);
+ }
+
+ CheckForAbortL(iCallback.MosDeleteFileL(*fileName, fileMustExist));
+ CleanupStack::PopAndDestroy(fileName);
+ }
+ else if(elemName == _L8("SetupTunnel"))
+ {
+ const TDesC8& source = FindAttributeL(aAttributes, _L8("output"));
+ const TDesC8& sink = FindAttributeL(aAttributes, _L8("input"));
+
+ const TDesC8* expectedError = FindAttribute(aAttributes, _L8("expectedomxerr"));
+ OMX_ERRORTYPE expectedErrorInt = OMX_ErrorNone;
+ if (expectedError)
+ {
+ expectedErrorInt = ParseOmxErrorCode(*expectedError);
+ }
+
+ TPtrC8 sourceComp;
+ TPtrC8 sinkComp;
+ TInt sourcePort = 0;
+ TInt sinkPort = 0;
+ _LIT8(KTemp, "");
+ const TDesC8& temp = KTemp;
+ if (source.Compare(temp))
+ {
+ ParseCompPortL(source, sourceComp, sourcePort);
+ }
+ if(sink.Compare(temp))
+ {
+ ParseCompPortL(sink, sinkComp, sinkPort);
+ }
+ CheckForAbortL(iCallback.MosSetupTunnel(sourceComp, sourcePort, sinkComp, sinkPort, expectedErrorInt));
+ }
+
+ else if (elemName == _L8("SetupNonTunnel"))
+ {
+ const TDesC8& source = FindAttributeL(aAttributes, _L8("output"));
+ const TDesC8& sink = FindAttributeL(aAttributes, _L8("input"));
+ const TDesC8& supplierDes = FindAttributeL(aAttributes, _L8("supplier"));
+ TPtrC8 sourceComp;
+ TPtrC8 sinkComp;
+ TInt sourcePort;
+ TInt sinkPort;
+ ParseCompPortL(source, sourceComp, sourcePort);
+ ParseCompPortL(sink, sinkComp, sinkPort);
+ OMX_BUFFERSUPPLIERTYPE supplier = ParseOmxSupplierL(supplierDes, ETrue);
+ CheckForAbortL(iCallback.MosSetupNonTunnel(sourceComp, sourcePort, sinkComp, sinkPort, supplier));
+ }
+ else if (elemName == _L8("SetBufferForPort"))
+ {
+ const TDesC8& compPort = FindAttributeL(aAttributes, _L8("port"));
+ TPtrC8 comp;
+ TInt port;
+ ParseCompPortL(compPort, comp, port);
+
+ const TDesC8& filename8Bit = FindAttributeL(aAttributes, _L8("filename"));
+ HBufC* filename = HBufC::NewLC(filename8Bit.Length());
+ filename->Des().Copy(filename8Bit);
+ TInt headerlength = KErrNone;
+ headerlength = ParseOptionalIntL(aAttributes, _L8("headerlength"), -1);
+
+ const TDesC8* supplierDes = FindAttribute(aAttributes, _L8("supplier"));
+ OMX_BUFFERSUPPLIERTYPE supplier = OMX_BufferSupplyUnspecified;
+ if(supplierDes)
+ {
+ supplier = ParseOmxSupplierL(*supplierDes);
+ }
+ CheckForAbortL(iCallback.MosSetupBufferForPortL(comp,port,*filename,headerlength,supplier));
+ CleanupStack::PopAndDestroy(filename);
+ }
+ else if(elemName == _L8("SetWindow"))
+ {
+ const TDesC8& comp = FindAttributeL(aAttributes, _L8("comp"));
+ CheckForAbortL(iCallback.MosSetWindowL(comp));
+ }
+ else if(elemName == _L8("AllTransition"))
+ {
+ const TDesC8& stateDes = FindAttributeL(aAttributes, _L8("state"));
+ OMX_STATETYPE state = ParseOmxStateL(stateDes);
+ const TDesC8* expectedError = FindAttribute(aAttributes, _L8("expectedomxerr"));
+ OMX_ERRORTYPE expectedErrorInt = OMX_ErrorNone;
+ const TDesC8* orderDes = FindAttribute(aAttributes, _L8("order"));
+ TTransitionOrder order = ELoadOrder;
+ if(orderDes != NULL)
+ {
+ if(*orderDes == _L8("auto"))
+ {
+ order = EAutoOrder;
+ }
+ else
+ {
+ User::Leave(KErrArgument);
+ }
+ }
+ if (expectedError)
+ {
+ expectedErrorInt = ParseOmxErrorCode(*expectedError);
+ }
+ CheckForAbortL(iCallback.MosAllTransitionL(state, expectedErrorInt, order));
+ }
+ else if(elemName == _L8("Transition"))
+ {
+ const TDesC8& comp = FindAttributeL(aAttributes, _L8("comp"));
+ const TDesC8& stateDes = FindAttributeL(aAttributes, _L8("state"));
+ TBool async_behaviour = ParseOptionalBooleanL(aAttributes, _L8("async"), EFalse);
+ OMX_STATETYPE state = ParseOmxStateL(stateDes);
+ CheckForAbortL(iCallback.MosTransition(comp, state, async_behaviour));
+ }
+ else if(elemName == _L8("FailingTransition"))
+ {
+ const TDesC8& comp = FindAttributeL(aAttributes, _L8("comp"));
+ const TDesC8& stateDes = FindAttributeL(aAttributes, _L8("state"));
+ const TDesC8* expectedError = FindAttribute(aAttributes, _L8("expectederr"));
+ OMX_ERRORTYPE expectedErrorInt = OMX_ErrorNone;
+ if (expectedError)
+ {
+ expectedErrorInt = ParseOmxErrorCode(*expectedError);
+ }
+ OMX_STATETYPE state = ParseOmxStateL(stateDes);
+ CheckForAbortL(iCallback.MosFailingTransition(comp, state, expectedErrorInt));
+ }
+ else if(elemName == _L8("WaitEOS"))
+ {
+ const TDesC8* comp = FindAttribute(aAttributes, _L8("comp"));
+ if(comp == NULL)
+ {
+ CheckForAbortL(iCallback.MosWaitEOS());
+ }
+ else
+ {
+ CheckForAbortL(iCallback.MosWaitEOS(*comp));
+ }
+ }
+ else if(elemName == _L8("Wait"))
+ {
+ const TDesC8& delay = FindAttributeL(aAttributes, _L8("delaytime"));
+ TLex8 lex(delay);
+ TInt delayInt;
+ User::LeaveIfError(lex.Val(delayInt));
+ CheckForAbortL(iCallback.MosWaitL(delayInt));
+ }
+ else if(elemName == _L8("WaitForAllEvents"))
+ {
+ CheckForAbortL(iCallback.MosWaitForAllEventsL());
+ }
+ else if(elemName == _L8("SetFilename"))
+ {
+ const TDesC8& comp = FindAttributeL(aAttributes, _L8("comp"));
+ const TDesC8& filename8Bit = FindAttributeL(aAttributes, _L8("filename"));
+ HBufC* filename = HBufC::NewLC(filename8Bit.Length());
+ filename->Des().Copy(filename8Bit);
+ CheckForAbortL(iCallback.MosSetFilename(comp, *filename));
+ CleanupStack::PopAndDestroy(filename);
+ }
+ else if(elemName == _L8("SetFilename_Bellagio"))
+ {
+ const TDesC8& comp = FindAttributeL(aAttributes, _L8("comp"));
+ const TDesC8& filename8Bit = FindAttributeL(aAttributes, _L8("filename"));
+ char filepath[100];
+ int i;
+ for(i=0;i<filename8Bit.Length();i++)
+ filepath[i]=filename8Bit.Ptr()[i];
+ filepath[i]='\0';
+ CheckForAbortL(iCallback.MosSetFilename_bellagio(comp, filepath));
+ //CleanupStack::PopAndDestroy(filename8Bit);
+ }
+ else if(elemName == _L8("SetDroppedFrameEvent"))
+ {
+ const TDesC8& comp = FindAttributeL(aAttributes, _L8("comp"));
+ const TDesC8& action = FindAttributeL(aAttributes, _L8("action"));
+
+ CheckForAbortL(iCallback.MosSetDroppedFrameEvent(comp, action));
+ }
+ else if(elemName == _L8("SetBadFilename"))
+ {
+ const TDesC8& comp = FindAttributeL(aAttributes, _L8("comp"));
+ CheckForAbortL(iCallback.MosSetBadFilename(comp));
+
+ }
+ else if(elemName == _L8("GetFilename"))
+ {
+ const TDesC8& comp = FindAttributeL(aAttributes, _L8("comp"));
+ const TDesC8& filename8Bit = FindAttributeL(aAttributes, _L8("filename"));
+ HBufC* filename = HBufC::NewLC(filename8Bit.Length());
+ filename->Des().Copy(filename8Bit);
+
+ const TDesC8* expectedError = FindAttribute(aAttributes, _L8("expectedomxerr"));
+ OMX_ERRORTYPE expectedErrorInt = OMX_ErrorNone;
+ if (expectedError)
+ {
+ expectedErrorInt = ParseOmxErrorCode(*expectedError);
+ }
+ CheckForAbortL(iCallback.MosGetFilename(comp, *filename, expectedErrorInt));
+ CleanupStack::PopAndDestroy(filename);
+ }
+
+ else if(elemName == _L8("SetBufferCount"))
+ {
+ const TDesC8& port = FindAttributeL(aAttributes, _L8("port"));
+ const TDesC8& count = FindAttributeL(aAttributes, _L8("count"));
+ const TDesC8* expectedError = FindAttribute(aAttributes, _L8("expectedomxerr"));
+ OMX_ERRORTYPE expectedErrorInt = OMX_ErrorNone;
+ if (expectedError)
+ {
+ expectedErrorInt = ParseOmxErrorCode(*expectedError);
+ }
+
+ TPtrC8 comp;
+ TInt portIndex = 0;
+ ParseCompPortL(port, comp, portIndex);
+ TLex8 lex(count);
+ TInt countInt;
+ User::LeaveIfError(lex.Val(countInt));
+ CheckForAbortL(iCallback.MosSetBufferCount(comp, portIndex, countInt, expectedErrorInt));
+ }
+ else if(elemName == _L8("CompareFiles"))
+ {
+ const TDesC8& file18Bit = FindAttributeL(aAttributes, _L8("file1"));
+ const TDesC8& file28Bit = FindAttributeL(aAttributes, _L8("file2"));
+ TBuf<64> file1, file2;
+ file1.Copy(file18Bit);
+ file2.Copy(file28Bit);
+ CheckForAbortL(iCallback.MosCompareFilesL(file1, file2));
+ }
+ else if(elemName == _L8("FilterAndCompareFiles"))
+ {
+
+ const TDesC8& file18Bit = FindAttributeL(aAttributes, _L8("file1"));
+ const TDesC8& file28Bit = FindAttributeL(aAttributes, _L8("file2"));
+ TBuf<64> file1, file2;
+ file1.Copy(file18Bit);
+ file2.Copy(file28Bit);
+
+ const TDesC8* f1filter1 = FindAttribute(aAttributes, _L8("file1filter1"));
+ const TDesC8* f1filter2 = FindAttribute(aAttributes, _L8("file1filter2"));
+ const TDesC8* f1filter3 = FindAttribute(aAttributes, _L8("file1filter3"));
+
+ const TDesC8* f2filter1 = FindAttribute(aAttributes, _L8("file2filter1"));
+ const TDesC8* f2filter2 = FindAttribute(aAttributes, _L8("file2filter2"));
+ const TDesC8* f2filter3 = FindAttribute(aAttributes, _L8("file2filter3"));
+
+ CheckForAbortL(
+ iCallback.MosFilterAndCompareFilesL(file1, f1filter1 ? *f1filter1 : KNullDesC8, f1filter2 ? *f1filter2 : KNullDesC8, f1filter3 ? *f1filter3 : KNullDesC8,
+ file2, f2filter1 ? *f2filter1 : KNullDesC8, f2filter2 ? *f2filter2 : KNullDesC8, f2filter3 ? *f2filter3 : KNullDesC8)
+ );
+ }
+ else if(elemName == _L8("BufferSupplierOverride"))
+ {
+ const TDesC8& output = FindAttributeL(aAttributes, _L8("output"));
+ const TDesC8& input = FindAttributeL(aAttributes, _L8("input"));
+ const TDesC8& supplierDes = FindAttributeL(aAttributes, _L8("supplier"));
+ const TDesC8* expectedError1 = FindAttribute(aAttributes, _L8("expectedomxerr1"));
+ OMX_ERRORTYPE expectedError1Int = OMX_ErrorNone;
+ if (expectedError1)
+ {
+ expectedError1Int = ParseOmxErrorCode(*expectedError1);
+ }
+ const TDesC8* expectedError2 = FindAttribute(aAttributes, _L8("expectedomxerr2"));
+ OMX_ERRORTYPE expectedError2Int = OMX_ErrorNone;
+ if (expectedError2)
+ {
+ expectedError2Int = ParseOmxErrorCode(*expectedError2);
+ }
+ TPtrC8 sourceComp;
+ TPtrC8 sinkComp;
+ TInt sourcePort = 0;
+ TInt sinkPort = 0;
+ ParseCompPortL(output, sourceComp, sourcePort);
+ ParseCompPortL(input, sinkComp, sinkPort);
+ OMX_BUFFERSUPPLIERTYPE supplier = ParseOmxSupplierL(supplierDes);
+ CheckForAbortL(iCallback.MosBufferSupplierOverrideL(sourceComp, sourcePort, sinkComp, sinkPort, supplier, expectedError1Int, expectedError2Int));
+ }
+ else if(elemName == _L8("SetCameraOneShot"))
+ {
+ //TODO DL
+ const TDesC8& comp = FindAttributeL(aAttributes, _L8("comp"));
+ TInt isOneShot = ParseOptionalIntL(aAttributes, _L8("isoneshot"), 1);
+ OMX_ERRORTYPE expectedErrorInt = OMX_ErrorNone;
+ CheckForAbortL(iCallback.MosSetCameraOneShotL(comp, isOneShot, expectedErrorInt));
+ }
+ else if(elemName == _L8("SetCameraCapture"))
+ {
+ //TODO DL
+ const TDesC8& comp = FindAttributeL(aAttributes, _L8("comp"));
+ TInt isCapturing = ParseOptionalIntL(aAttributes, _L8("iscapturing"), 1);
+ const TDesC8& port = FindAttributeL(aAttributes, _L8("port"));
+ TPtrC8 comp1;
+ TInt portIndex = 0;
+ ParseCompPortL(port, comp1, portIndex);
+
+ OMX_ERRORTYPE expectedErrorInt = OMX_ErrorNone;
+ CheckForAbortL(iCallback.MosSetCameraCaptureL(comp, portIndex, isCapturing, expectedErrorInt));
+ }
+ else if(elemName == _L8("SetVideoPortDef"))
+ {
+ const TDesC8& compPort = FindAttributeL(aAttributes, _L8("port"));
+ TPtrC8 comp;
+ TInt port;
+ ParseCompPortL(compPort, comp, port);
+ TInt width = ParseOptionalIntL(aAttributes, _L8("width"), -1);
+ TInt height = ParseOptionalIntL(aAttributes, _L8("height"), -1);
+ OMX_COLOR_FORMATTYPE colorFormat = OMX_COLOR_FormatMax;
+ OMX_COLOR_FORMATTYPE* colorFormatPtr = NULL;
+ const TDesC8* colorFormatDes = FindAttribute(aAttributes, _L8("colorFormat"));
+ if(colorFormatDes)
+ {
+ colorFormat = ParseOmxColorFormatL(*colorFormatDes);
+ colorFormatPtr = &colorFormat;
+ }
+ OMX_VIDEO_CODINGTYPE codingType = OMX_VIDEO_CodingMax;
+ OMX_VIDEO_CODINGTYPE* codingTypePtr = NULL;
+ const TDesC8* codingDes = FindAttribute(aAttributes, _L8("codingType"));
+ if(codingDes)
+ {
+ codingType = ParseOmxVideoCodingL(*codingDes);
+ codingTypePtr = &codingType;
+ }
+ TInt stride = ParseOptionalIntL(aAttributes, _L8("stride"), -1);
+
+ const TDesC8* expectedError = FindAttribute(aAttributes, _L8("expectedomxerr"));
+ OMX_ERRORTYPE expectedErrorInt = OMX_ErrorNone;
+ if (expectedError)
+ {
+ expectedErrorInt = ParseOmxErrorCode(*expectedError);
+ }
+
+#ifdef HREF_ED_WITHOUT_FLOATING_POINT
+ CheckForAbortL(iCallback.MosSetVideoPortDefL(comp, port, width, height, colorFormatPtr, codingTypePtr, stride, 0, expectedErrorInt));
+#else
+ TReal32 fps = ParseOptionalRealL(aAttributes, _L8("fps"), -1);
+ CheckForAbortL(iCallback.MosSetVideoPortDefL(comp, port, width, height, colorFormatPtr, codingTypePtr, stride, fps, expectedErrorInt));
+#endif //HREF_ED_WITHOUT_FLOATING_POINT
+ }
+ else if(elemName == _L8("ExpectEvent"))
+ {
+ const TDesC8& comp = FindAttributeL(aAttributes, _L8("comp"));
+ const TDesC8& eventDes = FindAttributeL(aAttributes, _L8("event"));
+ const TDesC8& nData1Des = FindAttributeL(aAttributes, _L8("nData1"));
+ const TDesC8& nData2Des = FindAttributeL(aAttributes, _L8("nData2"));
+ TLex8 lex(nData1Des);
+ TUint32 nData1;
+ OMX_EVENTTYPE event = ParseOmxEventL(eventDes);
+ switch(event)
+ {
+ // ParseOmxErrorL and ParseOmxCommandL will also parse literal integers
+ case OMX_EventError:
+ nData1 = static_cast<TUint32>(ParseOmxErrorL(nData1Des));
+ break;
+ case OMX_EventCmdComplete:
+ nData1 = static_cast<TUint32>(ParseOmxCommandL(nData1Des));
+ break;
+ default:
+ nData1 = ParseUint32L(nData1Des);
+ break;
+ }
+ TUint32 nData2 = ParseUint32L(nData2Des);
+ CheckForAbortL(iCallback.MosExpectEventL(comp, event, nData1, nData2));
+ }
+ else if(elemName == _L8("CheckState"))
+ {
+ const TDesC8& comp = FindAttributeL(aAttributes, _L8("comp"));
+ const TDesC8& stateDes = FindAttributeL(aAttributes, _L8("state"));
+ OMX_STATETYPE state = ParseOmxStateL(stateDes);
+ CheckForAbortL(iCallback.MosCheckStateL(comp, state));
+ }
+ else if(elemName == _L8("CheckVideoPortDef"))
+ {
+ const TDesC8& compPort = FindAttributeL(aAttributes, _L8("port"));
+ TPtrC8 comp;
+ TInt port;
+ ParseCompPortL(compPort, comp, port);
+ const TDesC8& widthDes = FindAttributeL(aAttributes, _L8("width"));
+ const TDesC8& heightDes = FindAttributeL(aAttributes, _L8("height"));
+ TInt width;
+ TInt height;
+ TLex8 lex(widthDes);
+ User::LeaveIfError(lex.Val(width));
+ lex = TLex8(heightDes);
+ User::LeaveIfError(lex.Val(height));
+ const TDesC8& codingDes = FindAttributeL(aAttributes, _L8("coding"));
+ OMX_VIDEO_CODINGTYPE coding = ParseOmxVideoCodingL(codingDes);
+ const TDesC8& colorFormatDes = FindAttributeL(aAttributes, _L8("colorFormat"));
+ OMX_COLOR_FORMATTYPE colorFormat = ParseOmxColorFormatL(colorFormatDes);
+ CheckForAbortL(iCallback.MosCheckVideoPortDefL(comp, port, width, height, coding, colorFormat));
+ }
+ else if(elemName == _L8("CheckMetaData"))
+ {
+ const TDesC8& compPort = FindAttributeL(aAttributes, _L8("port"));
+ TPtrC8 comp;
+ TInt port;
+ ParseCompPortL(compPort, comp, port);
+ const TDesC8& scopeDes = FindAttributeL(aAttributes, _L8("scope"));
+ OMX_METADATASCOPETYPE scope = ParseOmxScopeTypeL(scopeDes);
+ const TDesC8& atomType = FindAttributeL(aAttributes, _L8("atomType"));
+ const TDesC8& atomIndexDes = FindAttributeL(aAttributes, _L8("atomIndex"));
+ TLex8 lex(atomIndexDes);
+ TUint32 atomIndex = ParseUint32L(atomIndexDes);
+ const TDesC8& data = FindAttributeL(aAttributes, _L8("data"));
+ CheckForAbortL(iCallback.MosCheckMetaDataL(comp, port, scope, atomType, atomIndex, data));
+ }
+ else if(elemName == _L8("GetParameterUnknownType"))
+ {
+ const TDesC8& compPort = FindAttributeL(aAttributes, _L8("port"));
+ TPtrC8 comp;
+ TInt port;
+ ParseCompPortL(compPort, comp, port);
+ const TDesC8& scopeDes = FindAttributeL(aAttributes, _L8("scope"));
+ OMX_METADATASCOPETYPE scope = ParseOmxScopeTypeL(scopeDes);
+ const TDesC8& atomType = FindAttributeL(aAttributes, _L8("atomType"));
+ const TDesC8& atomIndexDes = FindAttributeL(aAttributes, _L8("atomIndex"));
+ TLex8 lex(atomIndexDes);
+ TUint32 atomIndex = ParseUint32L(atomIndexDes);
+ const TDesC8& data = FindAttributeL(aAttributes, _L8("data"));
+ CheckForAbortL(iCallback.MosGetParameterUnknownIndexTypeL(comp, port, scope, atomType, atomIndex, data));
+ }
+ else if(elemName == _L8("SetParameterUnknownType"))
+ {
+ const TDesC8& compPort = FindAttributeL(aAttributes, _L8("port"));
+ TPtrC8 comp;
+ TInt port;
+ ParseCompPortL(compPort, comp, port);
+ const TDesC8& scopeDes = FindAttributeL(aAttributes, _L8("scope"));
+ OMX_METADATASCOPETYPE scope = ParseOmxScopeTypeL(scopeDes);
+ const TDesC8& atomType = FindAttributeL(aAttributes, _L8("atomType"));
+ const TDesC8& atomIndexDes = FindAttributeL(aAttributes, _L8("atomIndex"));
+ TLex8 lex(atomIndexDes);
+ TUint32 atomIndex = ParseUint32L(atomIndexDes);
+ const TDesC8& data = FindAttributeL(aAttributes, _L8("data"));
+ CheckForAbortL(iCallback.MosSetParameterUnknownIndexTypeL(comp, port, scope, atomType, atomIndex, data));
+ }
+ else if(elemName == _L8("DisablePort"))
+ {
+ const TDesC8& port = FindAttributeL(aAttributes, _L8("port"));
+ TPtrC8 comp;
+ TInt portIndex;
+ ParseCompPortL(port, comp, portIndex);
+ CheckForAbortL(iCallback.MosDisablePort(comp, portIndex));
+ }
+ else if(elemName == _L8("EnablePort"))
+ {
+ const TDesC8& port = FindAttributeL(aAttributes, _L8("port"));
+ TPtrC8 comp;
+ TInt portIndex;
+ ParseCompPortL(port, comp, portIndex);
+ CheckForAbortL(iCallback.MosEnablePort(comp, portIndex));
+ }
+ else if(elemName == _L8("IgnoreEvent"))
+ {
+ const TDesC8& comp = FindAttributeL(aAttributes, _L8("comp"));
+ const TDesC8& eventDes = FindAttributeL(aAttributes, _L8("event"));
+ const TDesC8& nData1Des = FindAttributeL(aAttributes, _L8("nData1"));
+ const TDesC8& nData2Des = FindAttributeL(aAttributes, _L8("nData2"));
+ TLex8 lex(nData1Des);
+ TUint32 nData1;
+ OMX_EVENTTYPE event = ParseOmxEventL(eventDes);
+ switch(event)
+ {
+ // ParseOmxErrorL and ParseOmxCommandL will also parse literal integers
+ case OMX_EventError:
+ nData1 = static_cast<TUint32>(ParseOmxErrorL(nData1Des));
+ break;
+ case OMX_EventCmdComplete:
+ nData1 = static_cast<TUint32>(ParseOmxCommandL(nData1Des));
+ break;
+ default:
+ nData1 = ParseUint32L(nData1Des);
+ break;
+ }
+ TUint32 nData2 = ParseUint32L(nData2Des);
+ CheckForAbortL(iCallback.MosIgnoreEventL(comp, event, nData1, nData2));
+ }
+ else if(elemName == _L8("SetAudioPortDef"))
+ {
+ const TDesC8& compPort = FindAttributeL(aAttributes, _L8("port"));
+ TPtrC8 comp;
+ TInt port;
+ ParseCompPortL(compPort, comp, port);
+ OMX_AUDIO_CODINGTYPE codingType = OMX_AUDIO_CodingMax;
+ OMX_AUDIO_CODINGTYPE* codingTypePtr = NULL;
+ const TDesC8* codingDes = FindAttribute(aAttributes, _L8("codingType"));
+ if(codingDes)
+ {
+ codingType = ParseOmxAudioCodingL(*codingDes);
+ codingTypePtr = &codingType;
+ }
+
+ const TDesC8* expectedError = FindAttribute(aAttributes, _L8("expectedomxerr"));
+ OMX_ERRORTYPE expectedErrorInt = OMX_ErrorNone;
+ if (expectedError)
+ {
+ expectedErrorInt = ParseOmxErrorCode(*expectedError);
+ }
+
+ CheckForAbortL(iCallback.MosSetAudioPortDefL(comp, port, codingTypePtr, expectedErrorInt));
+ }
+ else if(elemName == _L8("SetAACProfile"))
+ {
+ const TDesC8& compPort = FindAttributeL(aAttributes, _L8("port"));
+ TPtrC8 comp;
+ TInt port;
+ ParseCompPortL(compPort, comp, port);
+ // TODO allow some values to be unspecified (preserved from existing settings)
+ TInt channels = ParseUint32L(FindAttributeL(aAttributes, _L8("channels")));
+ TInt samplingrate = ParseUint32L(FindAttributeL(aAttributes, _L8("samplingrate")));
+ TInt bitrate = ParseUint32L(FindAttributeL(aAttributes, _L8("bitrate")));
+ TInt audioBandwidth = ParseUint32L(FindAttributeL(aAttributes, _L8("bandwidth")));
+ TInt frameLength = ParseUint32L(FindAttributeL(aAttributes, _L8("frameLength")));
+ // TODO allow multiple flags in disjunctive form
+ TInt aacTools = ParseUint32L(FindAttributeL(aAttributes, _L8("aacTools")));
+ TInt aacerTools = ParseUint32L(FindAttributeL(aAttributes, _L8("aacerTools")));
+ OMX_AUDIO_AACPROFILETYPE profile = ParseOmxAACProfileL(FindAttributeL(aAttributes, _L8("profile")));
+ OMX_AUDIO_AACSTREAMFORMATTYPE streamFormat = ParseOmxAACStreamFormatL(FindAttributeL(aAttributes, _L8("streamFormat")));
+ OMX_AUDIO_CHANNELMODETYPE channelMode = ParseOmxAudioChannelModeL(FindAttributeL(aAttributes, _L8("channelMode")));
+
+ CheckForAbortL(iCallback.MosSetAACProfileL(comp, port, channels, samplingrate, bitrate, audioBandwidth, frameLength, aacTools, aacerTools, profile, streamFormat, channelMode));
+ }
+ else if(elemName == _L8("SetPcmAudioPortDef"))
+ {
+ const TDesC8& compPort = FindAttributeL(aAttributes, _L8("port"));
+ TPtrC8 comp;
+ TInt port;
+ ParseCompPortL(compPort, comp, port);
+ TInt channels = ParseOptionalIntL(aAttributes, _L8("channels"), -1);
+ TInt samplingrate = ParseOptionalIntL(aAttributes, _L8("samplingrate"), -1);
+ TInt bitspersample = ParseOptionalIntL(aAttributes, _L8("bitspersample"), -1);
+ OMX_NUMERICALDATATYPE numData = OMX_NumercialDataMax;
+ const TDesC8* des = FindAttribute(aAttributes, _L8("numericalData"));
+ if(des != NULL)
+ {
+ numData = ParseNumericalDataL(*des);
+ }
+ else
+ {
+ numData = static_cast<OMX_NUMERICALDATATYPE>(-1);
+ }
+ OMX_ENDIANTYPE endian = OMX_EndianMax;
+ des = FindAttribute(aAttributes, _L8("endian"));
+ if(des != NULL)
+ {
+ endian = ParseEndianL(*des);
+ }
+ else
+ {
+ endian = static_cast<OMX_ENDIANTYPE>(-1);
+ }
+ OMX_BOOL* interleaved = NULL;
+ OMX_BOOL interleavedData;
+ des = FindAttribute(aAttributes, _L8("interleaved"));
+ if(des != NULL)
+ {
+ interleavedData = ParseBoolL(*des);
+ interleaved = &interleavedData;
+ }
+ const TDesC8* encoding = FindAttribute(aAttributes, _L8("encoding"));
+ CheckForAbortL(iCallback.MosSetPcmAudioPortDefL(comp, port, channels, samplingrate, bitspersample, numData, endian, interleaved, encoding));
+ }
+ else if(elemName == _L8("SetAudioMute"))
+ {
+ const TDesC8& compPort = FindAttributeL(aAttributes, _L8("port"));
+ TPtrC8 comp;
+ TInt port;
+ ParseCompPortL(compPort, comp, port);
+ TBool mute = EFalse;
+ const TDesC8* muteAttr = FindAttribute(aAttributes, _L8("mute"));
+ if (muteAttr != NULL)
+ {
+ mute = ParseBooleanL(*muteAttr);
+ }
+ else
+ {
+ User::Leave(KErrArgument);
+ }
+ CheckForAbortL(iCallback.MosSetConfigAudioMuteL(comp, port, mute));
+ }
+ else if(elemName == _L8("CheckAudioMute"))
+ {
+ const TDesC8& compPort = FindAttributeL(aAttributes, _L8("port"));
+ TPtrC8 comp;
+ TInt port;
+ ParseCompPortL(compPort, comp, port);
+ TBool mute = EFalse;
+ const TDesC8* muteAttr = FindAttribute(aAttributes, _L8("mute"));
+ if (muteAttr != NULL)
+ {
+ mute = ParseBooleanL(*muteAttr);
+ }
+ else
+ {
+ User::Leave(KErrArgument);
+ }
+ CheckForAbortL(iCallback.MosCheckConfigAudioMuteL(comp, port, mute));
+ }
+ else if(elemName == _L8("SetAudioVolume"))
+ {
+ const TDesC8& compPort = FindAttributeL(aAttributes, _L8("port"));
+ TPtrC8 comp;
+ TInt port;
+ ParseCompPortL(compPort, comp, port);
+ TBool linear = EFalse;
+ const TDesC8* linearScaleAttr = FindAttribute(aAttributes, _L8("linearscale"));
+ if (linearScaleAttr != NULL)
+ {
+ linear = ParseBooleanL(*linearScaleAttr);
+ }
+ TInt minVolume = ParseOptionalIntL(aAttributes, _L8("min"), -1);
+ TInt maxVolume = ParseOptionalIntL(aAttributes, _L8("max"), -1);
+ TInt volume = ParseOptionalIntL(aAttributes, _L8("volume"), -1);
+ const TDesC8* expectedError = FindAttribute(aAttributes, _L8("expectedomxerr"));
+ OMX_ERRORTYPE expectedErrorInt = OMX_ErrorNone;
+ if (expectedError)
+ {
+ expectedErrorInt = ParseOmxErrorCode(*expectedError);
+ }
+
+ CheckForAbortL(iCallback.MosSetConfigAudioVolumeL(comp, port, linear, minVolume, maxVolume, volume, expectedErrorInt));
+ }
+ else if(elemName == _L8("CheckAudioVolume"))
+ {
+ const TDesC8& compPort = FindAttributeL(aAttributes, _L8("port"));
+ TPtrC8 comp;
+ TInt port;
+ ParseCompPortL(compPort, comp, port);
+ TBool linear = EFalse;
+ const TDesC8* linearScaleAttr = FindAttribute(aAttributes, _L8("linearscale"));
+ if (linearScaleAttr != NULL)
+ {
+ linear = ParseBooleanL(*linearScaleAttr);
+ }
+ TInt minVolume = ParseOptionalIntL(aAttributes, _L8("min"), -1);
+ TInt maxVolume = ParseOptionalIntL(aAttributes, _L8("max"), -1);
+ TInt volume = ParseOptionalIntL(aAttributes, _L8("volume"), -1);
+ CheckForAbortL(iCallback.MosCheckConfigAudioVolumeL(comp, port, linear, minVolume, maxVolume, volume));
+ }
+ else if(elemName == _L8("SetAacAudioPortDef"))
+ {
+ const TDesC8& compPort = FindAttributeL(aAttributes, _L8("port"));
+ TPtrC8 comp;
+ TInt port;
+ ParseCompPortL(compPort, comp, port);
+ TInt channels = ParseOptionalIntL(aAttributes, _L8("channels"), -1);
+ TInt samplingRate = ParseOptionalIntL(aAttributes, _L8("samplingrate"), -1);
+ TInt bitRate = ParseOptionalIntL(aAttributes, _L8("bitrate"), -1);
+ TInt audioBandwidth = ParseOptionalIntL(aAttributes, _L8("audiobandwidth"), -1);
+ TInt frameLength = ParseOptionalIntL(aAttributes, _L8("framelength"), -1);
+ TInt aacTools = ParseOptionalIntL(aAttributes, _L8("aactools"), -1);
+ TInt aacErTools = ParseOptionalIntL(aAttributes, _L8("aacertools"), -1);
+
+ OMX_AUDIO_AACPROFILETYPE profile;
+ const TDesC8* attbval = FindAttribute(aAttributes, _L8("profile"));
+ if ( NULL != attbval )
+ {
+ profile = ParseOmxAACProfileL( *attbval );
+ }
+ else
+ {
+ profile = static_cast <OMX_AUDIO_AACPROFILETYPE>(-1);
+ }
+ OMX_AUDIO_AACSTREAMFORMATTYPE streamFormat = ParseOmxAACStreamFormatL(FindAttributeL(aAttributes, _L8("streamFormat")));
+ OMX_AUDIO_CHANNELMODETYPE channelMode = ParseOmxAudioChannelModeL(FindAttributeL(aAttributes, _L8("channelMode")));
+
+ CheckForAbortL(iCallback.MosSetAacAudioPortDefL(comp, port, channels, samplingRate, bitRate, audioBandwidth, frameLength, aacTools, aacErTools, profile, streamFormat, channelMode));
+ }
+ else if(elemName == _L8("SetClockReference"))
+ {
+ const TDesC8& comp = FindAttributeL(aAttributes, _L8("comp"));
+ const TDesC8& refDes = FindAttributeL(aAttributes, _L8("ref"));
+ OMX_TIME_REFCLOCKTYPE refClockType = ParseOmxRefClockTypeL(refDes);
+ CheckForAbortL(iCallback.MosSetRefClockTypeL(comp, refClockType));
+ }
+ else if(elemName == _L8("SetClockState"))
+ {
+ const TDesC8& comp = FindAttributeL(aAttributes, _L8("comp"));
+ const TDesC8& stateDes = FindAttributeL(aAttributes, _L8("state"));
+ OMX_TIME_CLOCKSTATE clockState = ParseOmxClockStateL(stateDes);
+ const TDesC8& maskDes = FindAttributeL(aAttributes, _L8("mask"));
+ TUint32 mask = ParseUint32L(maskDes);
+ TInt startTime = ParseOptionalIntL(aAttributes, _L8("start"), 0);
+ TInt offset = ParseOptionalIntL(aAttributes, _L8("offset"), 0);
+ CheckForAbortL(iCallback.MosSetClockStateL(comp, clockState, startTime, offset, mask));
+ }
+ else if(elemName == _L8("SetVideoFitMode"))
+ {
+ const TDesC8& modeDes = FindAttributeL(aAttributes, _L8("mode"));
+ TVideoFitMode mode = ParseVideoFitModeL(modeDes);
+ CheckForAbortL(iCallback.MosSetVideoFitModeL(mode));
+ }
+ else if(elemName == _L8("SetActiveStream"))
+ {
+ const TDesC8& comp = FindAttributeL(aAttributes, _L8("comp"));
+ const TDesC8& id = FindAttributeL(aAttributes, _L8("id"));
+ TLex8 lex(id);
+ TInt streamId;
+ User::LeaveIfError(lex.Val(streamId));
+ CheckForAbortL(iCallback.MosSetActiveStream(comp, streamId));
+ }
+ else if(elemName == _L8("GetActiveStream"))
+ {
+ const TDesC8& comp = FindAttributeL(aAttributes, _L8("comp"));
+ const TDesC8& id = FindAttributeL(aAttributes, _L8("id"));
+ TLex8 lex(id);
+ TInt streamId;
+ User::LeaveIfError(lex.Val(streamId));
+ CheckForAbortL(iCallback.MosGetActiveStream(comp, streamId));
+ }
+ else if(elemName == _L8("LoadBufferHandler"))
+ {
+ // Load buffer component handler
+ // Buffer component tests
+ const TDesC8& comp = FindAttributeL(aAttributes, _L8("comp"));
+ const TDesC8& filename = FindAttributeL(aAttributes, _L8("filename"));
+ const TDesC8* type = FindAttribute(aAttributes, _L8("type"));
+ TBuf<KMaxFileName> name;
+ User::LeaveIfError(CnvUtfConverter::ConvertToUnicodeFromUtf8(name,filename));
+
+ // Call test script to create buffer handler
+ CheckForAbortL(iCallback.InitialiseBufferHandlerL(comp, name, type));
+ }
+ else if(elemName == _L8("StartBufferHandler"))
+ {
+ iCallback.StartBufferHandler();
+ }
+ else if (elemName == _L8("SendInvalidBufferId"))
+ {
+ const TDesC8& id = FindAttributeL(aAttributes, _L8("id"));
+ TInt idValue = ParseUint32L(id);
+ iCallback.SendInvalidBufferId(idValue);
+ }
+ else if(elemName == _L8("EndBufferHandler"))
+ {
+ iCallback.StopBufferHandler();
+ }
+ else if(elemName == _L8("LoadBufferSinkHandler"))
+ {
+ // Load buffer component handler
+ // Buffer component tests
+ const TDesC8& comp = FindAttributeL(aAttributes, _L8("comp"));
+ const TDesC8& filename = FindAttributeL(aAttributes, _L8("filename"));
+ TBuf<KMaxFileName> name;
+ User::LeaveIfError(CnvUtfConverter::ConvertToUnicodeFromUtf8(name,filename));
+
+ // Call test script to create buffer handler
+ CheckForAbortL(iCallback.InitialiseBufferSinkHandlerL(comp, name));
+ }
+ else if (elemName == _L8("StartBufferSinkHandler"))
+ {
+ iCallback.StartBufferSinkHandler();
+ }
+ else if (elemName == _L8("EndBufferSinkHandler"))
+ {
+ iCallback.StopBufferSinkHandler();
+ }
+ else if(elemName == _L8("NegativeSetDataChunk"))
+ {
+ const TDesC8& comp = FindAttributeL(aAttributes, _L8("comp"));
+
+ const TDesC8* expectedError = FindAttribute(aAttributes, _L8("expectedomxerr"));
+ OMX_ERRORTYPE expectedErrorInt = OMX_ErrorNone;
+ if (expectedError)
+ {
+ expectedErrorInt = ParseOmxErrorCode(*expectedError);
+ }
+
+ const TDesC8* expectedSystemError = FindAttribute(aAttributes, _L8("expectederror"));
+ TInt expectedSystemErrorInt = KErrNone;
+ if (expectedSystemError)
+ {
+ expectedSystemErrorInt = ParseSystemErrorCode(*expectedSystemError);
+ }
+
+ CheckForAbortL(iCallback.MosNegativeSetDataChunk(comp, expectedErrorInt, expectedSystemErrorInt));
+ }
+ else if(elemName == _L8("SetBufferSize"))
+ {
+ const TDesC8& port = FindAttributeL(aAttributes, _L8("port"));
+ const TDesC8& value = FindAttributeL(aAttributes, _L8("size"));
+ const TDesC8* expectedError = FindAttribute(aAttributes, _L8("expectedomxerr"));
+ OMX_ERRORTYPE expectedErrorInt = OMX_ErrorNone;
+ if (expectedError)
+ {
+ expectedErrorInt = ParseOmxErrorCode(*expectedError);
+ }
+ TInt portIndex = 0;
+ TPtrC8 comp;
+ ParseCompPortL(port, comp, portIndex);
+ TLex8 lex(value);
+ TInt valInt = 0;
+ User::LeaveIfError(lex.Val(valInt));
+ CheckForAbortL(iCallback.MosSetBufferSize(comp, portIndex, valInt, expectedErrorInt));
+ }
+ else if(elemName == _L8("GetAndCompareBufferCount"))
+ {
+ const TDesC8& port = FindAttributeL(aAttributes, _L8("port"));
+ const TDesC8& value = FindAttributeL(aAttributes, _L8("count"));
+ TInt portIndex = 0;
+ TPtrC8 comp;
+ ParseCompPortL(port, comp, portIndex);
+ TLex8 lex(value);
+ TInt countInt = 0;
+ User::LeaveIfError(lex.Val(countInt));
+ CheckForAbortL(iCallback.MosGetAndCompareBufferCount(comp, portIndex, countInt));
+ }
+ else if(elemName == _L8("GetAndCompareBufferSize"))
+ {
+ const TDesC8& port = FindAttributeL(aAttributes, _L8("port"));
+ const TDesC8& value = FindAttributeL(aAttributes, _L8("size"));
+ TInt portIndex = 0;
+ TPtrC8 comp;
+ ParseCompPortL(port, comp, portIndex);
+ TLex8 lex(value);
+ TInt valInt = 0;
+ User::LeaveIfError(lex.Val(valInt));
+ CheckForAbortL(iCallback.MosGetAndCompareBufferSize(comp, portIndex, valInt));
+ }
+ else if(elemName == _L8("FlushBuffer"))
+ {
+ const TDesC8& expectedError = FindAttributeL(aAttributes, _L8("expectedomxerr"));
+ OMX_ERRORTYPE expectedErrorInt = ParseOmxErrorCode(expectedError);
+
+ const TDesC8& port = FindAttributeL(aAttributes, _L8("port"));
+ TPtrC8 comp;
+ TInt portIndex = 0;
+ ParseCompPortL(port, comp, portIndex);
+ CheckForAbortL(iCallback.MosFlushBuffer(comp, portIndex, expectedErrorInt));
+ }
+ else if(elemName == _L8("ForceBufferSourceFlushBuffer"))
+ {
+ const TDesC8& expectedError = FindAttributeL(aAttributes, _L8("expectedomxerr"));
+ OMX_ERRORTYPE expectedErrorInt = ParseOmxErrorCode(expectedError);
+
+ const TDesC8& port = FindAttributeL(aAttributes, _L8("port"));
+ TPtrC8 comp;
+ TInt portIndex = 0;
+ ParseCompPortL(port, comp, portIndex);
+ CheckForAbortL(iCallback.MosForceBufferSourceFlushBufferL(comp, portIndex, expectedErrorInt));
+ }
+ else if(elemName == _L8("ForceBufferSinkFlushBuffer"))
+ {
+ const TDesC8& expectedError = FindAttributeL(aAttributes, _L8("expectedomxerr"));
+ OMX_ERRORTYPE expectedErrorInt = ParseOmxErrorCode(expectedError);
+
+ const TDesC8& port = FindAttributeL(aAttributes, _L8("port"));
+ TPtrC8 comp;
+ TInt portIndex = 0;
+ ParseCompPortL(port, comp, portIndex);
+ CheckForAbortL(iCallback.MosForceBufferSinkFlushBuffer(comp, portIndex, expectedErrorInt));
+ }
+ else if(elemName == _L8("SetVideoEncQuant"))
+ {
+ const TDesC8& compPort = FindAttributeL(aAttributes, _L8("port"));
+ TPtrC8 comp;
+ TInt port;
+ ParseCompPortL(compPort, comp, port);
+
+ TInt qpb = ParseOptionalIntL(aAttributes, _L8("qpb"), -1);
+
+ CheckForAbortL(iCallback.MosSetVideoEncQuantL(comp, port,qpb));
+ }
+ else if(elemName == _L8("SetVideoEncMotionVect"))
+ {
+ const TDesC8& compPort = FindAttributeL(aAttributes, _L8("port"));
+ TPtrC8 comp;
+ TInt port;
+ ParseCompPortL(compPort, comp, port);
+
+ TInt accuracy = ParseOptionalIntL(aAttributes, _L8("accuracy"), -1);
+ TInt sxsearchrange = ParseOptionalIntL(aAttributes, _L8("sxsearchrange"), -1);
+ TInt sysearchrange = ParseOptionalIntL(aAttributes, _L8("sysearchrange"), -1);
+
+ const TDesC8* expectedError = FindAttribute(aAttributes, _L8("expectedomxerr"));
+ OMX_ERRORTYPE expectedOmxError = OMX_ErrorNone;
+ if (expectedError)
+ {
+ expectedOmxError = ParseOmxErrorCode(*expectedError);
+ }
+
+ CheckForAbortL(iCallback.MosSetVideoEncMotionVectL(comp, port, accuracy, sxsearchrange, sysearchrange, expectedOmxError));
+ }
+ else if(elemName == _L8("SetVideoEncMpeg4Type"))
+ {
+ const TDesC8& compPort = FindAttributeL(aAttributes, _L8("port"));
+ TPtrC8 comp;
+ TInt port;
+ ParseCompPortL(compPort, comp, port);
+ const TDesC8* mpeg4Profile = FindAttribute(aAttributes, _L8("mpeg4profile"));
+ OMX_VIDEO_MPEG4PROFILETYPE profile = OMX_VIDEO_MPEG4ProfileMax;
+ if (mpeg4Profile)
+ {
+ profile = ParseOmxMpeg4ProfileL(*mpeg4Profile);
+ }
+
+ OMX_VIDEO_MPEG4LEVELTYPE level = OMX_VIDEO_MPEG4LevelMax;
+ const TDesC8* mpeg4Level = FindAttribute(aAttributes, _L8("mpeg4level"));
+ if (mpeg4Level)
+ {
+ level = ParseOmxMpeg4LevelL(*mpeg4Level);
+ }
+ const TDesC8* expectedError = FindAttribute(aAttributes, _L8("expectedomxerr"));
+ OMX_ERRORTYPE expectedOmxError = OMX_ErrorNone;
+ if (expectedError)
+ {
+ expectedOmxError = ParseOmxErrorCode(*expectedError);
+ }
+
+ CheckForAbortL(iCallback.MosSetVideoEncMpeg4TypeL(comp, port, profile, level, expectedOmxError));
+ }
+ else if(elemName == _L8("SetVideoEncBitRate"))
+ {
+ const TDesC8& compPort = FindAttributeL(aAttributes, _L8("port"));
+ TPtrC8 comp;
+ TInt port;
+ ParseCompPortL(compPort, comp, port);
+
+ const TDesC8* controlRate = FindAttribute(aAttributes, _L8("controlrate"));
+ OMX_VIDEO_CONTROLRATETYPE omxControlRate = OMX_Video_ControlRateMax;
+ if (controlRate)
+ {
+ omxControlRate = ParseOmxControlRateL(*controlRate);
+ }
+
+ TInt targetBitrate = ParseOptionalIntL(aAttributes, _L8("targetbitrate"), -1);
+
+ const TDesC8* expectedError = FindAttribute(aAttributes, _L8("expectedomxerr"));
+ OMX_ERRORTYPE expectedOmxError = OMX_ErrorNone;
+ if (expectedError)
+ {
+ expectedOmxError = ParseOmxErrorCode(*expectedError);
+ }
+
+ CheckForAbortL(iCallback.MosSetVideoEncBitRateL(comp, port, omxControlRate, targetBitrate, expectedOmxError));
+ }
+ else if(elemName == _L8("ChangeFilledBufferLength"))
+ {
+ const TDesC8& comp = FindAttributeL(aAttributes, _L8("comp"));
+ const TDesC8& value = FindAttributeL(aAttributes, _L8("data"));
+ TLex8 lex(value);
+ TInt valInt = 0;
+ User::LeaveIfError(lex.Val(valInt));
+ CheckForAbortL(iCallback.MosChangeFilledBufferLength(comp, valInt));
+ }
+ else if(elemName == _L8("SetOMX_SymbianIndexParamBufferMsgQueueData"))
+ {
+ const TDesC8& comp = FindAttributeL(aAttributes, _L8("comp"));
+ const TDesC8& expectedError = FindAttributeL(aAttributes, _L8("expectedomxerr"));
+ OMX_ERRORTYPE expectedErrorInt = ParseOmxErrorCode(expectedError);
+
+ CheckForAbortL(iCallback.MosSetOMX_SymbianIndexParamBufferMsgQueueData(comp, expectedErrorInt));
+ }
+ else if(elemName == _L8("GetExtensionIndex"))
+ {
+ const TDesC8& comp = FindAttributeL(aAttributes, _L8("comp"));
+ const TDesC8& paramName = FindAttributeL(aAttributes, _L8("parametername"));
+
+ const TDesC8* expectedError = FindAttribute(aAttributes, _L8("expectedomxerr"));
+ OMX_ERRORTYPE expectedErrorInt = OMX_ErrorNone;
+ if (expectedError)
+ {
+ expectedErrorInt = ParseOmxErrorCode(*expectedError);
+ }
+
+ CheckForAbortL(iCallback.MosGetExtensionIndex(comp, paramName, expectedErrorInt));
+ }
+ else if(elemName == _L8("SetCaptureModeType"))
+ {
+ const TDesC8& compPort = FindAttributeL(aAttributes, _L8("port"));
+
+ TPtrC8 comp;
+ TInt port = 0;
+ ParseCompPortL(compPort, comp, port);
+
+ const TDesC8& continuousStr = FindAttributeL(aAttributes, _L8("continuous"));
+ TBool continuous = ParseBooleanL(continuousStr);
+ const TDesC8& framelimitedStr = FindAttributeL(aAttributes, _L8("framelimited"));
+ TBool framelimited = ParseBooleanL(framelimitedStr);
+ TInt framelimit = ParseOptionalIntL(aAttributes, _L8("framelimit"), -1);
+
+ CheckForAbortL(iCallback.MosSetCaptureModeTypeL(comp, port, continuous, framelimited, framelimit));
+ }
+
+ else if(elemName == _L8("GetTimeClockState"))
+ {
+ const TDesC8& comp = FindAttributeL(aAttributes, _L8("comp"));
+ const TDesC8& expectedState = FindAttributeL(aAttributes, _L8("expectedstate"));
+ OMX_TIME_CLOCKSTATE expectedStateInt = ParseOmxClockStateL(expectedState);
+
+ CheckForAbortL(iCallback.MosCheckTimeClockState(comp, expectedStateInt));
+ }
+ else if(elemName == _L8("CheckMediaTime"))
+ {
+ const TDesC8& compPort = FindAttributeL(aAttributes, _L8("port"));
+ TPtrC8 comp;
+ TInt port;
+
+ ParseCompPortL(compPort, comp, port);
+
+ TBool moreThan = ETrue;
+ const TDesC8* mediatime = FindAttribute(aAttributes, _L8("mediatimelessthan"));
+
+ if (mediatime)
+ {
+ moreThan = EFalse;
+ }
+ else
+ {
+ const TDesC8& mTime = FindAttributeL(aAttributes, _L8("mediatimemorethan"));
+ mediatime = &mTime;
+ }
+
+
+ OMX_TICKS mediatimeTick;
+ TLex8 lex(*mediatime);
+ User::LeaveIfError(lex.Val(mediatimeTick));
+ CheckForAbortL(iCallback.MosCheckMediaTime(comp, port, mediatimeTick, moreThan));
+ }
+ else if(elemName == _L8("SetClockTimeScale"))
+ {
+ const TDesC8& comp = FindAttributeL(aAttributes, _L8("comp"));
+ const TDesC8& scale = FindAttributeL(aAttributes, _L8("scale"));
+
+ TReal32 xscale = ParseReal32L(scale);
+
+ CheckForAbortL(iCallback.MosSetClockTimeScale(comp,xscale * 65536));
+ }
+ else if(elemName == _L8("Base_AddPortSupport"))
+ {
+ const TDesC8& portValue = FindAttributeL(aAttributes, _L8("port"));
+ TPtrC8 comp;
+ TInt portIndex;
+ ParseCompPortL(portValue, comp, portIndex);
+ CheckForAbortL(iCallback.MosBaseSupportPortL(comp, portIndex));
+ }
+ else if(elemName == _L8("Base_SetAutonomous"))
+ {
+ const TDesC8& portValue = FindAttributeL(aAttributes, _L8("port"));
+ TPtrC8 comp;
+ TInt portIndex;
+ ParseCompPortL(portValue, comp, portIndex);
+ const TDesC8& enabledValue = FindAttributeL(aAttributes, _L8("enabled"));
+ TBool enabled = ParseBooleanL(enabledValue);
+ CheckForAbortL(iCallback.MosBaseSetAutonomous(comp, portIndex, enabled));
+ }
+ else if(elemName == _L8("Base_AllocateBuffers"))
+ {
+ const TDesC8& portValue = FindAttributeL(aAttributes, _L8("port"));
+ TPtrC8 comp;
+ TInt portIndex;
+ ParseCompPortL(portValue, comp, portIndex);
+
+ const TDesC8& numberValue = FindAttributeL(aAttributes, _L8("number"));
+ TInt numberBuffs;
+ TLex8 lex(numberValue);
+ User::LeaveIfError(lex.Val(numberBuffs));
+
+ CheckForAbortL(iCallback.MosBaseAllocateBuffersL(comp, portIndex, numberBuffs));
+ }
+ else if(elemName == _L8("Base_FreeAllocatedBuffers"))
+ {
+ const TDesC8& comp = FindAttributeL(aAttributes, _L8("comp"));
+
+ CheckForAbortL(iCallback.MosBaseFreeAllocatedBuffersL(comp));
+ }
+ else if(elemName == _L8("Base_SetBufSupplierPref"))
+ {
+ const TDesC8& portValue = FindAttributeL(aAttributes, _L8("port"));
+ TPtrC8 comp;
+ TInt portIndex;
+ ParseCompPortL(portValue, comp, portIndex);
+
+ const TDesC8& componentSupplierValue = FindAttributeL(aAttributes, _L8("iscomponentsupplier"));
+ TBool componentSupplier = ParseBooleanL(componentSupplierValue);
+ CheckForAbortL(iCallback.MosBaseSetBufSupplier(comp, portIndex, componentSupplier));
+ }
+ else if(elemName == _L8("Base_FillThisBuffer"))
+ {
+ const TDesC8& portValue = FindAttributeL(aAttributes, _L8("port"));
+ TPtrC8 comp;
+ TInt portIndex;
+ ParseCompPortL(portValue, comp, portIndex);
+
+ const TDesC8& bufIndexValue = FindAttributeL(aAttributes, _L8("portrelativebufferindex"));
+ TInt bufIndex;
+ TLex8 lex(bufIndexValue);
+ User::LeaveIfError(lex.Val(bufIndex));
+
+ CheckForAbortL(iCallback.MosBaseFillThisBuffer(comp, portIndex, bufIndex));
+ }
+ else if(elemName == _L8("Base_EmptyThisBuffer"))
+ {
+ const TDesC8& portValue = FindAttributeL(aAttributes, _L8("port"));
+ TPtrC8 comp;
+ TInt portIndex;
+ ParseCompPortL(portValue, comp, portIndex);
+
+ const TDesC8& bufIndexValue = FindAttributeL(aAttributes, _L8("portrelativebufferindex"));
+ TInt bufIndex;
+ TLex8 lex(bufIndexValue);
+ User::LeaveIfError(lex.Val(bufIndex));
+
+ CheckForAbortL(iCallback.MosBaseEmptyThisBuffer(comp, portIndex, bufIndex));
+ }
+ else if(elemName == _L8("Base_WaitForBuffer"))
+ {
+ const TDesC8& portValue = FindAttributeL(aAttributes, _L8("port"));
+ TPtrC8 comp;
+ TInt portIndex;
+ ParseCompPortL(portValue, comp, portIndex);
+
+ const TDesC8& bufIndexValue = FindAttributeL(aAttributes, _L8("bufferindexinport"));
+ TInt bufIndex;
+ TLex8 lex(bufIndexValue);
+ User::LeaveIfError(lex.Val(bufIndex));
+
+ CheckForAbortL(iCallback.MosBaseWaitForBuffer(comp, portIndex, bufIndex));
+ }
+ else if(elemName == _L8("BaseTimestamp_PassClockHandle"))
+ {
+ const TDesC8& receivingComp = FindAttributeL(aAttributes, _L8("receiver"));
+ const TDesC8& clockToPass = FindAttributeL(aAttributes, _L8("handle"));
+
+ CheckForAbortL(iCallback.MosBaseTimestampPassClock(receivingComp, clockToPass));
+ }
+ else if(elemName == _L8("BaseTimestamp_CheckTimestamp"))
+ {
+ const TDesC8& portValue = FindAttributeL(aAttributes, _L8("port"));
+ TPtrC8 comp;
+ TInt portIndex;
+ ParseCompPortL(portValue, comp, portIndex);
+
+ const TDesC8& timeValue = FindAttributeL(aAttributes, _L8("time"));
+ TUint time;
+ TLex8 lex(timeValue);
+ User::LeaveIfError(lex.Val(time));
+
+ const TDesC8& toleranceValue = FindAttributeL(aAttributes, _L8("tolerance"));
+ TUint tolerance;
+ lex.Assign(toleranceValue);
+ User::LeaveIfError(lex.Val(tolerance));
+
+ CheckForAbortL(iCallback.MosBaseTimestampCheckTimestampL(comp, portIndex, time, tolerance));
+ }
+ else if(elemName == _L8("BaseTimestamp_CompareWithRefClock"))
+ {
+ const TDesC8& portValue = FindAttributeL(aAttributes, _L8("port"));
+ TPtrC8 comp;
+ TInt portIndex;
+ ParseCompPortL(portValue, comp, portIndex);
+
+ const TDesC8& toleranceValue = FindAttributeL(aAttributes, _L8("tolerance"));
+ TUint tolerance;
+ TLex8 lex(toleranceValue);
+ User::LeaveIfError(lex.Val(tolerance));
+
+ CheckForAbortL(iCallback.MosBaseTimestampCompareWithRefClockL(comp, portIndex, tolerance));
+ }
+ else if(elemName == _L8("CheckClockState"))
+ {
+ const TDesC8& comp = FindAttributeL(aAttributes, _L8("comp"));
+ const TDesC8& stateDes = FindAttributeL(aAttributes, _L8("clockstate"));
+ OMX_TIME_CLOCKSTATE clockState = ParseOmxClockStateL(stateDes);
+ CheckForAbortL(iCallback.MosCheckClockStateL(comp, clockState));
+ }
+ else if(elemName == _L8("CheckTimePosition"))
+ {
+ // Use with caution: increments position as a side-effect.
+ const TDesC8& port = FindAttributeL(aAttributes, _L8("port"));
+ TPtrC8 comp;
+ TInt portIndex;
+ ParseCompPortL(port, comp, portIndex);
+
+ TInt timestamp = ParseOptionalIntL(aAttributes, _L8("timestamp"), 0);
+
+ CheckForAbortL(iCallback.MosCheckTimePositionL(comp, portIndex, timestamp));
+ }
+ else if(elemName == _L8("SetTimePosition"))
+ {
+ const TDesC8& port = FindAttributeL(aAttributes, _L8("port"));
+ TPtrC8 comp;
+ TInt portIndex;
+ ParseCompPortL(port, comp, portIndex);
+
+ TInt timestamp = ParseOptionalIntL(aAttributes, _L8("timestamp"), 0);
+
+ CheckForAbortL(iCallback.MosSetTimePositionL(comp, portIndex, timestamp));
+ }
+ else if(elemName == _L8("StartBuffersforPort"))
+ {
+ const TDesC8& compPort = FindAttributeL(aAttributes, _L8("port"));
+ TPtrC8 comp;
+ TInt port;
+ ParseCompPortL(compPort, comp, port);
+
+ CheckForAbortL(iCallback.MosStartBuffersforPort( comp,port));
+ }
+ else if(elemName == _L8("CheckFrameCount"))
+ {
+ const TDesC8& fileName8 = FindAttributeL(aAttributes, _L8("filename"));
+ TInt count = ParseOptionalIntL(aAttributes, _L8("count"), 0);
+
+ HBufC* fileName = HBufC::NewLC(fileName8.Length());
+ fileName->Des().Copy(fileName8);
+ CheckForAbortL(iCallback.MosCheckFrameCountL(*fileName, count));
+ CleanupStack::PopAndDestroy(fileName);
+ }
+
+ else if(elemName == _L8("MarkBuffer"))
+ {
+ const TDesC8& port = FindAttributeL(aAttributes, _L8("port"));
+ TPtrC8 comp;
+ TInt portIndex;
+ ParseCompPortL(port, comp, portIndex);
+ const TDesC8& targetComp = FindAttributeL(aAttributes, _L8("targetComp"));
+ TInt markData = ParseOptionalIntL(aAttributes, _L8("markData"), 0);
+ CheckForAbortL(iCallback.MosMarkBuffer(comp, portIndex, targetComp, markData));
+ }
+#ifdef OLD_ADPCM_EXTENSION
+ else if (elemName == _L8("SetAdPcmAudioPortDef"))
+ {
+ const TDesC8& compPort = FindAttributeL(aAttributes, _L8("port"));
+ TPtrC8 comp;
+ TInt port;
+ ParseCompPortL(compPort, comp, port);
+ TInt channels = ParseOptionalIntL(aAttributes, _L8("channels"), -1);
+ TInt samplingrate = ParseOptionalIntL(aAttributes, _L8("samplingrate"), -1);
+ TInt bitspersample = ParseOptionalIntL(aAttributes, _L8("bitspersample"), -1);
+ CheckForAbortL(iCallback.MosSetAdPcmAudioPortDefL(comp, port, channels, samplingrate, bitspersample));
+ }
+ else if (elemName == _L8("SetAdPcmDecoderBlockAlign"))
+ {
+ const TDesC8& comp = FindAttributeL(aAttributes, _L8("comp"));
+ const TDesC8& blockAlign = FindAttributeL(aAttributes, _L8("blockalign"));
+ TLex8 lex(blockAlign);
+ TInt blockAlignValue;
+ User::LeaveIfError(lex.Val(blockAlignValue));
+ CheckForAbortL(iCallback.MosConfigAdPcmDecoderBlockAlign(comp, blockAlignValue));
+ }
+#endif
+ else
+ {
+ // element name is not recognized
+ TBuf<32> elemNameCopy;
+ elemNameCopy.Copy(elemName);
+ TBuf<44> message;
+ message.Append(_L("Unrecognized command: "));
+ message.Append(elemNameCopy);
+ iCallback.MosParseError(message);
+ User::Leave(KErrArgument);
+ }
+ }
+ }
+
+TInt COmxScriptParser::ParseSystemErrorCode(const TDesC8& aErrorCode)
+ {
+ TInt error = KErrNone;
+
+ if (aErrorCode == _L8("KErrNotFound"))
+ {
+ error = KErrNotFound;
+ }
+
+ // TODO: the other error code will be added in demand
+
+ return error;
+ }
+
+// TODO duplication with ParseOmxErrorL
+OMX_ERRORTYPE COmxScriptParser::ParseOmxErrorCode(const TDesC8& aErrorCode)
+ {
+ #define DEFERR(e) if(aErrorCode == _L8(#e)) return e;
+
+ DEFERR(OMX_ErrorNone);
+ DEFERR(OMX_ErrorInsufficientResources);
+ DEFERR(OMX_ErrorUndefined);
+ DEFERR(OMX_ErrorInvalidComponentName);
+ DEFERR(OMX_ErrorComponentNotFound);
+ DEFERR(OMX_ErrorInvalidComponent);
+ DEFERR(OMX_ErrorBadParameter);
+ DEFERR(OMX_ErrorNotImplemented);
+ DEFERR(OMX_ErrorUnderflow);
+ DEFERR(OMX_ErrorOverflow);
+ DEFERR(OMX_ErrorHardware);
+ DEFERR(OMX_ErrorInvalidState);
+ DEFERR(OMX_ErrorStreamCorrupt);
+ DEFERR(OMX_ErrorPortsNotCompatible);
+ DEFERR(OMX_ErrorResourcesLost);
+ DEFERR(OMX_ErrorNoMore);
+ DEFERR(OMX_ErrorVersionMismatch);
+ DEFERR(OMX_ErrorNotReady);
+ DEFERR(OMX_ErrorTimeout);
+ DEFERR(OMX_ErrorSameState);
+ DEFERR(OMX_ErrorResourcesPreempted);
+ DEFERR(OMX_ErrorPortUnresponsiveDuringAllocation);
+ DEFERR(OMX_ErrorPortUnresponsiveDuringDeallocation);
+ DEFERR(OMX_ErrorPortUnresponsiveDuringStop);
+ DEFERR(OMX_ErrorIncorrectStateTransition);
+ DEFERR(OMX_ErrorIncorrectStateOperation);
+ DEFERR(OMX_ErrorUnsupportedSetting);
+ DEFERR(OMX_ErrorUnsupportedIndex);
+ DEFERR(OMX_ErrorBadPortIndex);
+ DEFERR(OMX_ErrorPortUnpopulated);
+ DEFERR(OMX_ErrorComponentSuspended);
+ DEFERR(OMX_ErrorDynamicResourcesUnavailable);
+ DEFERR(OMX_ErrorMbErrorsInFrame);
+ DEFERR(OMX_ErrorFormatNotDetected);
+ DEFERR(OMX_ErrorContentPipeOpenFailed);
+ DEFERR(OMX_ErrorContentPipeCreationFailed);
+ DEFERR(OMX_ErrorSeperateTablesUsed);
+ DEFERR(OMX_ErrorTunnelingUnsupported);
+ DEFERR(OMX_ErrorKhronosExtensions);
+ DEFERR(OMX_ErrorVendorStartUnused);
+ #undef DEFERR
+
+ return OMX_ErrorMax;
+ }
+
+void COmxScriptParser::OnEndElementL(const RTagInfo& aElement, TInt /*aErrorCode*/)
+ {
+ if(iInTest)
+ {
+ const TDesC8& elemName = aElement.LocalName().DesC();
+ if(elemName == _L8("Test"))
+ {
+ iInTest = EFalse;
+ }
+ }
+ }
+
+const TDesC8* COmxScriptParser::FindAttribute(const RArray<RAttribute>& aArray, const TDesC8& aAttribName)
+ {
+ for(TInt index = 0, count = aArray.Count(); index < count; index++)
+ {
+ const RAttribute& attribute = aArray[index];
+ const TDesC8& name = attribute.Attribute().LocalName().DesC();
+ if(name == aAttribName)
+ {
+ return &(attribute.Value().DesC());
+ }
+ }
+ return NULL;
+ }
+
+const TDesC8& COmxScriptParser::FindAttributeL(const RArray<RAttribute>& aArray, const TDesC8& aAttribName)
+ {
+ const TDesC8* result = FindAttribute(aArray, aAttribName);
+ if(!result)
+ {
+ TBuf<32> nameCopy;
+ nameCopy.Copy(aAttribName);
+ TBuf<52> msg;
+ msg.Append(_L("Attribute "));
+ msg.Append(nameCopy);
+ msg.Append(_L(" not found"));
+ iCallback.MosParseError(msg);
+ User::Leave(KErrNotFound);
+ }
+ return *result;
+ }
+
+void COmxScriptParser::ParseCompPortL(const TDesC8& aInput, TPtrC8& aNameOut, TInt& aPortOut)
+ {
+ TInt offset = aInput.Locate(':');
+ User::LeaveIfError(offset);
+ aNameOut.Set(aInput.Left(offset));
+ TPtrC8 port = aInput.Right(aInput.Length() - offset - 1);
+ if (port == _L8("all"))
+ {
+ aPortOut = static_cast<TInt>(OMX_ALL);
+ }
+ else
+ {
+ TLex8 lex(port);
+ User::LeaveIfError(lex.Val(aPortOut));
+ }
+ }
+
+
+// The order of these entries does not matter, but for clarity's sake please
+// maintain alphabetical order
+
+PARSE_MAP_START(OMX_AUDIO_AACPROFILETYPE)
+ PARSE_MAP_PREFIXENTRY(OMX_AUDIO_AACObject, ERLC),
+ PARSE_MAP_PREFIXENTRY(OMX_AUDIO_AACObject, HE),
+ PARSE_MAP_PREFIXENTRY(OMX_AUDIO_AACObject, HE_PS),
+ PARSE_MAP_PREFIXENTRY(OMX_AUDIO_AACObject, LC),
+ PARSE_MAP_PREFIXENTRY(OMX_AUDIO_AACObject, LD),
+ PARSE_MAP_PREFIXENTRY(OMX_AUDIO_AACObject, LTP),
+ PARSE_MAP_PREFIXENTRY(OMX_AUDIO_AACObject, Main),
+ PARSE_MAP_PREFIXENTRY(OMX_AUDIO_AACObject, Null),
+ PARSE_MAP_PREFIXENTRY(OMX_AUDIO_AACObject, Scalable),
+ PARSE_MAP_PREFIXENTRY(OMX_AUDIO_AACObject, SSR)
+PARSE_MAP_END(OMX_AUDIO_AACPROFILETYPE)
+
+PARSE_MAP_START(OMX_AUDIO_AACSTREAMFORMATTYPE)
+ PARSE_MAP_PREFIXENTRY(OMX_AUDIO_AACStreamFormat, ADIF),
+ PARSE_MAP_PREFIXENTRY(OMX_AUDIO_AACStreamFormat, MP2ADTS),
+ PARSE_MAP_PREFIXENTRY(OMX_AUDIO_AACStreamFormat, MP4ADTS),
+ PARSE_MAP_PREFIXENTRY(OMX_AUDIO_AACStreamFormat, MP4FF),
+ PARSE_MAP_PREFIXENTRY(OMX_AUDIO_AACStreamFormat, MP4LATM),
+ PARSE_MAP_PREFIXENTRY(OMX_AUDIO_AACStreamFormat, MP4LOAS),
+ PARSE_MAP_PREFIXENTRY(OMX_AUDIO_AACStreamFormat, RAW)
+PARSE_MAP_END(OMX_AUDIO_AACSTREAMFORMATTYPE)
+
+PARSE_MAP_START(OMX_AUDIO_CHANNELMODETYPE)
+ PARSE_MAP_PREFIXENTRY(OMX_AUDIO_ChannelMode, Dual),
+ PARSE_MAP_PREFIXENTRY(OMX_AUDIO_ChannelMode, JointStereo),
+ PARSE_MAP_PREFIXENTRY(OMX_AUDIO_ChannelMode, Mono),
+ PARSE_MAP_PREFIXENTRY(OMX_AUDIO_ChannelMode, Stereo)
+PARSE_MAP_END(OMX_AUDIO_CHANNELMODETYPE)
+
+PARSE_MAP_START(OMX_COMMANDTYPE)
+ PARSE_MAP_PREFIXENTRY(OMX_Command, StateSet),
+ PARSE_MAP_PREFIXENTRY(OMX_Command, Flush),
+ PARSE_MAP_PREFIXENTRY(OMX_Command, PortDisable),
+ PARSE_MAP_PREFIXENTRY(OMX_Command, PortEnable),
+ PARSE_MAP_PREFIXENTRY(OMX_Command, MarkBuffer)
+PARSE_MAP_END(OMX_COMMANDTYPE)
+
+PARSE_MAP_START(OMX_COLOR_FORMATTYPE)
+ PARSE_MAP_PREFIXENTRY(OMX_COLOR_Format, Unused),
+ PARSE_MAP_PREFIXENTRY(OMX_COLOR_Format, Max),
+ PARSE_MAP_PREFIXENTRY(OMX_COLOR_Format, 12bitRGB444),
+ PARSE_MAP_PREFIXENTRY(OMX_COLOR_Format, 16bitRGB565),
+ PARSE_MAP_PREFIXENTRY(OMX_COLOR_Format, 24bitBGR888),
+ PARSE_MAP_PREFIXENTRY(OMX_COLOR_Format, 32bitARGB8888),
+ PARSE_MAP_PREFIXENTRY(OMX_COLOR_Format, 32bitBGRA8888),
+ PARSE_MAP_PREFIXENTRY(OMX_COLOR_Format, CbYCrY),
+ PARSE_MAP_PREFIXENTRY(OMX_COLOR_Format, YCbYCr),
+ PARSE_MAP_PREFIXENTRY(OMX_COLOR_Format, YCrYCb),
+ PARSE_MAP_PREFIXENTRY(OMX_COLOR_Format, YUV420PackedPlanar),
+ PARSE_MAP_PREFIXENTRY(OMX_COLOR_Format, YUV422PackedPlanar),
+ PARSE_MAP_PREFIXENTRY(OMX_COLOR_Format, YUV420Planar),
+#if defined(NCP_COMMON_BRIDGE_FAMILY) && !defined(__WINSCW__)
+ PARSE_MAP_PREFIXENTRY(OMX_COLOR_Format, YUV422Planar),
+ PARSE_MAP_PREFIXENTRY(OMX_COLOR_Format, STYUV420PackedSemiPlanarMB),
+ PARSE_MAP_PREFIXENTRY(OMX_COLOR_Format, STYUV422PackedSemiPlanarMB)
+#else
+ PARSE_MAP_PREFIXENTRY(OMX_COLOR_Format, YUV422Planar)
+#endif //NCP_COMMON_BRIDGE_FAMILY
+PARSE_MAP_END(OMX_COLOR_FORMATTYPE)
+
+PARSE_MAP_START(OMX_ERRORTYPE)
+ PARSE_MAP_PREFIXENTRY(OMX_Error, BadParameter),
+ PARSE_MAP_PREFIXENTRY(OMX_Error, BadPortIndex),
+ PARSE_MAP_PREFIXENTRY(OMX_Error, ContentPipeOpenFailed),
+ PARSE_MAP_PREFIXENTRY(OMX_Error, Hardware),
+ PARSE_MAP_PREFIXENTRY(OMX_Error, IncorrectStateOperation),
+ PARSE_MAP_PREFIXENTRY(OMX_Error, None),
+ PARSE_MAP_PREFIXENTRY(OMX_Error, NotReady),
+ PARSE_MAP_PREFIXENTRY(OMX_Error, PortsNotCompatible),
+ PARSE_MAP_PREFIXENTRY(OMX_Error, Underflow),
+ PARSE_MAP_PREFIXENTRY(OMX_Error, UnsupportedIndex),
+ PARSE_MAP_PREFIXENTRY(OMX_Error, UnsupportedSetting)
+PARSE_MAP_END(OMX_ERRORTYPE)
+
+PARSE_MAP_START(OMX_EVENTTYPE)
+ PARSE_MAP_PREFIXENTRY(OMX_Event, BufferFlag),
+ PARSE_MAP_PREFIXENTRY(OMX_Event, CmdComplete),
+ PARSE_MAP_PREFIXENTRY(OMX_Event, Error),
+ PARSE_MAP_PREFIXENTRY(OMX_Event, Mark),
+ PARSE_MAP_PREFIXENTRY(OMX_Event, PortFormatDetected),
+ PARSE_MAP_PREFIXENTRY(OMX_Event, PortSettingsChanged),
+PARSE_MAP_END(OMX_EVENTTYPE)
+
+// PARSE_MAP_PREFIXENTRY(OMX_EventNokia, FirstFrameDisplayed),
+// PARSE_MAP_PREFIXENTRY(OMX_EventNokia, DroppedFrame)
+
+
+PARSE_MAP_START(OMX_STATETYPE)
+ PARSE_MAP_PREFIXENTRY(OMX_State, Loaded),
+ PARSE_MAP_PREFIXENTRY(OMX_State, Idle),
+ PARSE_MAP_PREFIXENTRY(OMX_State, Executing),
+ PARSE_MAP_PREFIXENTRY(OMX_State, Pause),
+ PARSE_MAP_PREFIXENTRY(OMX_State, WaitForResources),
+ PARSE_MAP_PREFIXENTRY(OMX_State, Invalid)
+PARSE_MAP_END(OMX_STATETYPE)
+
+/**
+ * Templated wrapper to a plain-C function generated by PARSE_MAP
+ * Accepts a descriptor as input and leaves with KErrArgument if parse fails.
+ */
+template<typename T> T ParseL(const TDesC8& aDes, TInt (*parseFunc)(const char*, T*))
+ {
+ if(aDes.Length() >= 64)
+ {
+ User::Leave(KErrArgument);
+ }
+ TBuf8<64> buf = aDes;
+ T result = (T) 0;
+ TInt success = parseFunc((char*) buf.PtrZ(), &result);
+ if(!success)
+ {
+ // value not recognized
+ // maybe add it to the PARSE_MAP ?
+ __BREAKPOINT();
+ User::Leave(KErrArgument);
+ }
+ return result;
+ }
+
+OMX_AUDIO_AACPROFILETYPE COmxScriptParser::ParseOmxAACProfileL(const TDesC8& aProfileDes)
+ {
+ return ParseL(aProfileDes, parse_OMX_AUDIO_AACPROFILETYPE);
+ }
+
+OMX_AUDIO_AACSTREAMFORMATTYPE COmxScriptParser::ParseOmxAACStreamFormatL(const TDesC8& aFormatDes)
+ {
+ return ParseL(aFormatDes, parse_OMX_AUDIO_AACSTREAMFORMATTYPE);
+ }
+
+OMX_AUDIO_CHANNELMODETYPE COmxScriptParser::ParseOmxAudioChannelModeL(const TDesC8& aChannelModeDes)
+ {
+ return ParseL(aChannelModeDes, parse_OMX_AUDIO_CHANNELMODETYPE);
+ }
+
+OMX_STATETYPE COmxScriptParser::ParseOmxStateL(const TDesC8& aStateDes)
+ {
+ return ParseL(aStateDes, parse_OMX_STATETYPE);
+ }
+
+OMX_METADATASCOPETYPE COmxScriptParser::ParseOmxScopeTypeL(const TDesC8& aScopeDes)
+ {
+ if(aScopeDes == _L8("all"))
+ {
+ return OMX_MetadataScopeAllLevels;
+ }
+ else if(aScopeDes == _L8("top"))
+ {
+ return OMX_MetadataScopeTopLevel;
+ }
+ else if(aScopeDes == _L8("port"))
+ {
+ return OMX_MetadataScopePortLevel;
+ }
+ else
+ {
+ User::Leave(KErrArgument);
+ return OMX_MetadataScopeTypeMax; // unreachable, prevents compiler warning
+ }
+ }
+
+OMX_BUFFERSUPPLIERTYPE COmxScriptParser::ParseOmxSupplierL(const TDesC8& aSupplierDes, TBool aAllowUnspecified)
+ {
+ if(aSupplierDes == _L8("input"))
+ {
+ return OMX_BufferSupplyInput;
+ }
+ else if(aSupplierDes == _L8("output"))
+ {
+ return OMX_BufferSupplyOutput;
+ }
+ else if (aAllowUnspecified && aSupplierDes == _L8("unspecified"))
+ {
+ return OMX_BufferSupplyUnspecified;
+ }
+ else
+ {
+ User::Leave(KErrArgument);
+ return OMX_BufferSupplyInput; // unreachable, prevents compiler warning
+ }
+ }
+
+void COmxScriptParser::CheckForAbortL(TBool success)
+ {
+ if(!success)
+ {
+ iCallbackAborted = ETrue;
+ User::Leave(KErrAbort);
+ }
+ }
+
+TInt COmxScriptParser::ParseOptionalIntL(const RArray<RAttribute>& aArray, const TDesC8& aAttribName, TInt aDefaultValue)
+ {
+ const TDesC8* des = FindAttribute(aArray, aAttribName);
+ if(des == NULL)
+ {
+ return aDefaultValue;
+ }
+ else
+ {
+ TInt result;
+ TLex8 lex(*des);
+ User::LeaveIfError(lex.Val(result));
+ return result;
+ }
+ }
+
+TReal COmxScriptParser::ParseOptionalRealL(const RArray<RAttribute>& aArray, const TDesC8& aAttribName, TReal aDefaultValue)
+ {
+ const TDesC8* des = FindAttribute(aArray, aAttribName);
+ if(des == NULL)
+ {
+ return aDefaultValue;
+ }
+ else
+ {
+ TReal result;
+ TLex8 lex(*des);
+ User::LeaveIfError(lex.Val(result));
+ return result;
+ }
+ }
+
+OMX_COLOR_FORMATTYPE COmxScriptParser::ParseOmxColorFormatL(const TDesC8& aDes)
+ {
+ return ParseL(aDes, parse_OMX_COLOR_FORMATTYPE);
+ }
+
+
+OMX_COMMANDTYPE COmxScriptParser::ParseOmxCommandL(const TDesC8& aDes)
+ {
+ return ParseL(aDes, parse_OMX_COMMANDTYPE);
+ }
+
+OMX_ERRORTYPE COmxScriptParser::ParseOmxErrorL(const TDesC8& aDes)
+ {
+ return ParseL(aDes, parse_OMX_ERRORTYPE);
+ }
+
+OMX_EVENTTYPE COmxScriptParser::ParseOmxEventL(const TDesC8& aDes)
+ {
+ return ParseL(aDes, parse_OMX_EVENTTYPE);
+ }
+
+TBool COmxScriptParser::ParseOptionalBooleanL(const RArray<RAttribute>& aArray, const TDesC8& aAttribName, TBool aDefaultValue)
+ {
+ const TDesC8* des = FindAttribute(aArray, aAttribName);
+ if(des == NULL)
+ {
+ return aDefaultValue;
+ }
+
+ return ParseBooleanL(*des);
+ }
+
+TBool COmxScriptParser::ParseBooleanL(const TDesC8& aBool)
+ {
+ if ((aBool == _L8("true")) ||
+ (aBool == _L8("yes")) ||
+ (aBool == _L8("1")) ||
+ (aBool == _L8("ETrue")) ||
+ (aBool == _L8("OMX_TRUE")))
+ {
+ return ETrue;
+ }
+
+ if ((aBool == _L8("false")) ||
+ (aBool == _L8("no")) ||
+ (aBool == _L8("0")) ||
+ (aBool == _L8("EFalse")) ||
+ (aBool == _L8("OMX_FALSE")))
+ {
+ return EFalse;
+ }
+
+ User::Leave(KErrArgument);
+ return EFalse;
+ }
+
+
+TUint32 COmxScriptParser::ParseUint32L(const TDesC8& aDes)
+ {
+ TUint32 result;
+ if(aDes.Find(_L8("0x")) == 0)
+ {
+ TLex8 lex(aDes.Mid(2));
+ User::LeaveIfError(lex.Val(result, EHex));
+ }
+ else
+ {
+ TLex8 lex(aDes);
+ User::LeaveIfError(lex.Val(result, EDecimal));
+ }
+ return result;
+ }
+
+TBool COmxScriptParser::ParseBoolean(const TDesC8& aDes)
+ {
+ if (aDes == _L8("true"))
+ {
+ return ETrue;
+ }
+ return EFalse;
+ }
+
+TReal32 COmxScriptParser::ParseReal32L(const TDesC8& aDes)
+ {
+ TReal32 result;
+ TLex8 lex(aDes);
+ User::LeaveIfError(lex.Val(result));
+ return result;
+ }
+
+OMX_VIDEO_CODINGTYPE COmxScriptParser::ParseOmxVideoCodingL(const TDesC8& aDes)
+ {
+ if(aDes == _L8("unused"))
+ {
+ return OMX_VIDEO_CodingUnused;
+ }
+ else if (aDes == _L8("autodetect"))
+ {
+ return OMX_VIDEO_CodingAutoDetect;
+ }
+ else if(aDes == _L8("mpeg4"))
+ {
+ return OMX_VIDEO_CodingMPEG4;
+ }
+ else if(aDes == _L8("avc"))
+ {
+ return OMX_VIDEO_CodingAVC;
+ }
+ else if(aDes == _L8("max"))
+ {
+ return OMX_VIDEO_CodingMax;
+ }
+ else
+ {
+ __BREAKPOINT();
+ User::Leave(KErrArgument);
+ }
+
+ return OMX_VIDEO_CodingUnused;
+ }
+
+OMX_AUDIO_CODINGTYPE COmxScriptParser::ParseOmxAudioCodingL(const TDesC8& aDes)
+ {
+ if(aDes == _L8("unused"))
+ {
+ return OMX_AUDIO_CodingUnused;
+ }
+ else if (aDes == _L8("autodetect"))
+ {
+ return OMX_AUDIO_CodingAutoDetect;
+ }
+ else if(aDes == _L8("pcm"))
+ {
+ return OMX_AUDIO_CodingPCM;
+ }
+ else if(aDes == _L8("aac"))
+ {
+ return OMX_AUDIO_CodingAAC;
+ }
+ else if(aDes == _L8("max"))
+ {
+ return OMX_AUDIO_CodingMax;
+ }
+ else
+ {
+ __BREAKPOINT();
+ User::Leave(KErrArgument);
+ }
+
+ return OMX_AUDIO_CodingUnused;
+ }
+
+OMX_TIME_REFCLOCKTYPE COmxScriptParser::ParseOmxRefClockTypeL(const TDesC8& aDes)
+ {
+ if(aDes == _L8("none"))
+ {
+ return OMX_TIME_RefClockNone;
+ }
+ else if (aDes == _L8("audio"))
+ {
+ return OMX_TIME_RefClockAudio;
+ }
+ else if(aDes == _L8("video"))
+ {
+ return OMX_TIME_RefClockVideo;
+ }
+ else
+ {
+ __BREAKPOINT();
+ User::Leave(KErrArgument);
+ }
+
+ return OMX_TIME_RefClockNone;
+ }
+
+OMX_TIME_CLOCKSTATE COmxScriptParser::ParseOmxClockStateL(const TDesC8& aDes)
+ {
+ if(aDes == _L8("stopped"))
+ {
+ return OMX_TIME_ClockStateStopped;
+ }
+ else if (aDes == _L8("waiting"))
+ {
+ return OMX_TIME_ClockStateWaitingForStartTime;
+ }
+ else if(aDes == _L8("running"))
+ {
+ return OMX_TIME_ClockStateRunning;
+ }
+ else
+ {
+ __BREAKPOINT();
+ User::Leave(KErrArgument);
+ return OMX_TIME_ClockStateMax; // unreachable, to prevent compiler warning
+ }
+ }
+
+TVideoFitMode COmxScriptParser::ParseVideoFitModeL(const TDesC8& aMode)
+ {
+ if(aMode == _L8("centre"))
+ {
+ return EVideoFitCentre;
+ }
+ else if(aMode == _L8("scaleAndCentre"))
+ {
+ return EVideoFitScaleAndCentre;
+ }
+ else if(aMode == _L8("rotateScaleAndCentre"))
+ {
+ return EVideoFitRotateScaleAndCentre;
+ }
+ else
+ {
+ __BREAKPOINT();
+ User::Leave(KErrArgument);
+ return EVideoFitCentre; // unreachable, prevent compiler warning
+ }
+ }
+
+OMX_VIDEO_MPEG4PROFILETYPE COmxScriptParser::ParseOmxMpeg4ProfileL(const TDesC8& aDes)
+ {
+ if(aDes == _L8("simple"))
+ {
+ return OMX_VIDEO_MPEG4ProfileSimple;
+ }
+ else if(aDes == _L8("main"))
+ {
+ return OMX_VIDEO_MPEG4ProfileMain;
+ }
+ else if (aDes == _L8("advancedrealtime"))
+ {
+ return OMX_VIDEO_MPEG4ProfileAdvancedRealTime;
+ }
+ else if (aDes == _L8("advancedcoding"))
+ {
+ return OMX_VIDEO_MPEG4ProfileAdvancedCoding;
+ }
+ else if (aDes == _L8("core"))
+ {
+ return OMX_VIDEO_MPEG4ProfileCore;
+ }
+ else
+ {
+ __BREAKPOINT();
+ User::Leave(KErrArgument);
+ }
+ return OMX_VIDEO_MPEG4ProfileMax; // unreachable, prevents compiler warning
+ }
+
+OMX_VIDEO_MPEG4LEVELTYPE COmxScriptParser::ParseOmxMpeg4LevelL(const TDesC8& aDes)
+ {
+ if(aDes == _L8("level0"))
+ {
+ return OMX_VIDEO_MPEG4Level0;
+ }
+ else if(aDes == _L8("level0b"))
+ {
+ return OMX_VIDEO_MPEG4Level0b;
+ }
+ else if (aDes == _L8("level1"))
+ {
+ return OMX_VIDEO_MPEG4Level1;
+ }
+ else if (aDes == _L8("level2"))
+ {
+ return OMX_VIDEO_MPEG4Level2;
+ }
+ else if (aDes == _L8("level3"))
+ {
+ return OMX_VIDEO_MPEG4Level3;
+ }
+ else if(aDes == _L8("level4"))
+ {
+ return OMX_VIDEO_MPEG4Level4;
+ }
+ else if (aDes == _L8("level5"))
+ {
+ return OMX_VIDEO_MPEG4Level5;
+ }
+ else
+ {
+ __BREAKPOINT();
+ User::Leave(KErrArgument);
+ }
+ return OMX_VIDEO_MPEG4LevelMax; // unreachable, prevents compiler warning
+ }
+
+OMX_VIDEO_CONTROLRATETYPE COmxScriptParser::ParseOmxControlRateL(const TDesC8& aDes)
+ {
+ if(aDes == _L8("disable"))
+ {
+ return OMX_Video_ControlRateDisable;
+ }
+ else if(aDes == _L8("variable"))
+ {
+ return OMX_Video_ControlRateVariable;
+ }
+ else if (aDes == _L8("constant"))
+ {
+ return OMX_Video_ControlRateConstant;
+ }
+ else
+ {
+ __BREAKPOINT();
+ User::Leave(KErrArgument);
+ }
+ return OMX_Video_ControlRateMax; // unreachable, prevents compiler warning
+ }
+
+OMX_AUDIO_AACSTREAMFORMATTYPE COmxScriptParser::ParseAacStreamFormatL(const TDesC8& aStreamFormatStr)
+ {
+ if(aStreamFormatStr == _L8("mp2adts"))
+ {
+ return OMX_AUDIO_AACStreamFormatMP2ADTS;
+ }
+ else if(aStreamFormatStr == _L8("mp4adts"))
+ {
+ return OMX_AUDIO_AACStreamFormatMP4ADTS;
+ }
+ else if(aStreamFormatStr == _L8("mp4loas"))
+ {
+ return OMX_AUDIO_AACStreamFormatMP4LOAS;
+ }
+ else if(aStreamFormatStr == _L8("mp4latm"))
+ {
+ return OMX_AUDIO_AACStreamFormatMP4LATM;
+ }
+ else if(aStreamFormatStr == _L8("adif"))
+ {
+ return OMX_AUDIO_AACStreamFormatADIF;
+ }
+ else if(aStreamFormatStr == _L8("mp4ff"))
+ {
+ return OMX_AUDIO_AACStreamFormatMP4FF;
+ }
+ else if(aStreamFormatStr == _L8("raw"))
+ {
+ return OMX_AUDIO_AACStreamFormatRAW;
+ }
+ else
+ {
+ User::Leave(KErrArgument);
+ return OMX_AUDIO_AACStreamFormatMax;
+ }
+ }
+
+ OMX_NUMERICALDATATYPE COmxScriptParser::ParseNumericalDataL(const TDesC8& aDes)
+ {
+ if(aDes == _L8("signed"))
+ {
+ return OMX_NumericalDataSigned;
+ }
+ else if(aDes == _L8("unsigned"))
+ {
+ return OMX_NumericalDataUnsigned;
+ }
+ else
+ {
+ User::Leave(KErrArgument);
+ return OMX_NumercialDataMax;
+ }
+ }
+
+ OMX_ENDIANTYPE COmxScriptParser::ParseEndianL(const TDesC8& aDes)
+ {
+ if(aDes == _L8("big"))
+ {
+ return OMX_EndianBig;
+ }
+ else if(aDes == _L8("little"))
+ {
+ return OMX_EndianLittle;
+ }
+ else
+ {
+ User::Leave(KErrArgument);
+ return OMX_EndianMax;
+ }
+ }
+
+ OMX_BOOL COmxScriptParser::ParseBoolL(const TDesC8& aDes)
+ {
+ if(aDes == _L8("true"))
+ {
+ return OMX_TRUE;
+ }
+ else if(aDes == _L8("false"))
+ {
+ return OMX_FALSE;
+ }
+ else
+ {
+ User::Leave(KErrArgument);
+ return OMX_FALSE;
+ }
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/src/omxscriptparser.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,262 @@
+/*
+* 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 OMXSCRIPTPARSER_H_
+#define OMXSCRIPTPARSER_H_
+
+#include <f32file.h>
+#include <xml/contenthandler.h>
+#include <xml/documentparameters.h>
+
+#include <openmax/il/khronos/v1_x/OMX_Component.h>
+
+
+// a bit naughty, bit it will do for now
+using namespace Xml;
+
+enum TVideoFitMode
+ {
+ EVideoFitCentre,
+ EVideoFitScaleAndCentre,
+ EVideoFitRotateScaleAndCentre
+ };
+
+enum TTransitionOrder
+ {
+ ELoadOrder,
+ EAutoOrder
+ };
+
+/**
+ * High-level elementary test actions. This interface can be driven by the COmxScriptParser.
+ */
+class MOmxScriptIf
+ {
+public:
+ virtual TBool MosLoadComponentL(const TDesC8& aComp, const TDesC8& aName, TBool aBaseProfile, const TDesC8* aBaseImpl, TBool aLoadInCoreServerThread) = 0;
+ virtual TBool MosSetupTunnel(const TDesC8& aSourceComp, TInt aSourcePort,
+ const TDesC8& aSinkComp, TInt aSinkPort, OMX_ERRORTYPE aExpectedError) = 0;
+ virtual TBool MosSetupNonTunnel(const TDesC8& aSourceComp, TInt aSourcePort,
+ const TDesC8& aSinkComp, TInt aSinkPort,
+ OMX_BUFFERSUPPLIERTYPE aSupplier) = 0;
+ virtual TBool MosSetWindowL(const TDesC8& aComp) = 0;
+ virtual TBool MosAllTransitionL(OMX_STATETYPE aState,OMX_ERRORTYPE aExpectedError, TTransitionOrder order) = 0;
+ virtual TBool MosTransition(const TDesC8& aComp, OMX_STATETYPE aState, TBool aAsync) = 0;
+ virtual TBool MosFailingTransition(const TDesC8& aComp, OMX_STATETYPE aState, OMX_ERRORTYPE aExpectedError) = 0;
+ virtual TBool MosWaitEOS() = 0;
+ virtual TBool MosSetFilename(const TDesC8& aComp, const TDesC& aFilename) = 0;
+ //meena
+ virtual TBool MosSetFilename_bellagio(const TDesC8& aComp, char *aFilename) = 0;
+
+ virtual TBool MosGetFilename(const TDesC8& aComp, TDesC& aFilename, OMX_ERRORTYPE aExpectedError) = 0;
+ virtual TBool MosSetBadFilename(const TDesC8& aComp) = 0;
+
+ virtual TBool MosSetBufferCount(const TDesC8& aComp, TInt aPortIndex, TInt aCount, OMX_ERRORTYPE aExpectedError) = 0;
+ virtual TBool MosCompareFilesL(const TDesC& aFileOne, const TDesC& aFileTwo) = 0;
+ virtual TBool MosFilterAndCompareFilesL(const TDesC& aFileOne, const TDesC8& aFile1Filter1, const TDesC8& aFile1Filter2, const TDesC8& aFile1Filter3,
+ const TDesC& aFileTwo, const TDesC8& aFile2Filter1, const TDesC8& aFile2Filter2, const TDesC8& aFile2Filter3) = 0;
+ virtual TBool MosBufferSupplierOverrideL(const TDesC8& aSourceComp, TInt aSourcePort,
+ const TDesC8& aSinkComp, TInt aSinkPort,
+ OMX_BUFFERSUPPLIERTYPE aSupplier,
+ OMX_ERRORTYPE aExpectedSourceError, OMX_ERRORTYPE aExpectedSinkError) = 0;
+ virtual TBool MosSetVideoPortDefL(const TDesC8& aComp, TInt aPortIndex, TInt aWidth, TInt aHeight, OMX_COLOR_FORMATTYPE* aColorFormat, OMX_VIDEO_CODINGTYPE* aCodingType, TInt aStride, TReal aFps, OMX_ERRORTYPE aExpectedError) = 0;
+ virtual TBool MosSetCameraOneShotL(const TDesC8& aComp, TInt aIsOneShot, OMX_ERRORTYPE aExpectedError) = 0;
+ virtual TBool MosSetCameraCaptureL(const TDesC8& aComp, TInt aPortIndex, TInt aIsCapturing, OMX_ERRORTYPE aExpectedError) = 0;
+ virtual void MosParseError(const TDesC& aError) = 0;
+ virtual TBool MosWaitL(TTimeIntervalMicroSeconds32 aDelay) = 0;
+ virtual TBool MosExpectEventL(const TDesC8& aComp, OMX_EVENTTYPE aEvent, TUint32 nData1, TUint32 nData2) = 0;
+ virtual TBool MosWaitForAllEventsL() = 0;
+ virtual TBool MosCheckStateL(const TDesC8& aComp, OMX_STATETYPE aState) = 0;
+ virtual TBool MosCheckVideoPortDefL(const TDesC8& aComp, TInt aPortIndex, TInt aWidth, TInt aHeight, OMX_VIDEO_CODINGTYPE aCoding, OMX_COLOR_FORMATTYPE aColorFormat) = 0;
+ virtual TBool MosCheckMetaDataL(const TDesC8& aComp, TInt aPortIndex, OMX_METADATASCOPETYPE aScope, const TDesC8& aAtomType, TUint32 aAtomIndex, const TDesC8& aData) = 0;
+ virtual TBool MosGetParameterUnknownIndexTypeL(const TDesC8& aComp, TInt aPortIndex, OMX_METADATASCOPETYPE aScope, const TDesC8& aAtomType, TUint32 aAtomIndex, const TDesC8& aData) = 0;
+ virtual TBool MosSetParameterUnknownIndexTypeL(const TDesC8& aComp, TInt aPortIndex, OMX_METADATASCOPETYPE aScope, const TDesC8& aAtomType, TUint32 aAtomIndex, const TDesC8& aData) = 0;
+
+ virtual TBool MosDisablePort(const TDesC8& aComp, TInt aPortIndex) = 0;
+ virtual TBool MosEnablePort(const TDesC8& aComp, TInt aPortIndex) = 0;
+ virtual TBool MosIgnoreEventL(const TDesC8& aComp, OMX_EVENTTYPE aEvent, TUint32 nData1, TUint32 nData2) = 0;
+ virtual TBool MosSetPcmAudioPortDefL(const TDesC8& aComp, TInt aPortIndex, TInt aNumChannels, TInt aSamplingRate, TInt aBitsperSample, OMX_NUMERICALDATATYPE aNumData, OMX_ENDIANTYPE aEndian, OMX_BOOL* aInterleaved, const TDesC8* aEncoding) = 0;
+ virtual TBool MosSetConfigAudioVolumeL(const TDesC8& aComp, TInt aPortIndex, TBool aLinear, TInt aMinVolume, TInt aMaxVolume, TInt aVolume, OMX_ERRORTYPE aExpectedError) = 0;
+ virtual TBool MosCheckConfigAudioVolumeL(const TDesC8& aComp, TInt aPortIndex, TBool aLinear, TInt aMinVolume, TInt aMaxVolume, TInt aVolume) = 0;
+ virtual TBool MosCheckConfigAudioMuteL(const TDesC8& aComp, TInt aPortIndex, TBool aMute) = 0;
+ virtual TBool MosSetConfigAudioMuteL(const TDesC8& aComp, TInt aPortIndex, TBool aMute) = 0;
+ virtual TBool MosSetAacAudioPortDefL(const TDesC8& aComp, TInt aPortIndex, TInt aNumChannels, TInt aSamplingRate, TInt aBitRate, TInt aAudioBandwidth, TInt aFrameLength, TInt aAacTools, TInt aAacErTools, TInt aProfile, TInt aStreamFormat, TInt aChannelMode) = 0;
+ virtual TBool MosSetAudioPortDefL(const TDesC8& aComp, TInt aPortIndex, OMX_AUDIO_CODINGTYPE* aCodingType, OMX_ERRORTYPE aExpectedError) = 0;
+ virtual TBool MosSetRefClockTypeL(const TDesC8& aComp, OMX_TIME_REFCLOCKTYPE aRefClockType) = 0;
+ virtual TBool MosSetClockTimeScale(const TDesC8& aComp, OMX_S32 aScale) = 0;
+ virtual TBool MosSetClockStateL(const TDesC8& aComp, OMX_TIME_CLOCKSTATE aClockState, TInt aStartTime, TInt aOffset, TUint32 aWaitMask) = 0;
+ virtual TBool MosCheckClockStateL(const TDesC8& aComp, OMX_TIME_CLOCKSTATE aClockState) = 0;
+ virtual TBool MosCheckTimePositionL(const TDesC8& aComp, TInt aPortIndex, TInt aTimestamp) = 0;
+ virtual TBool MosSetTimePositionL(const TDesC8& aComp, TInt aPortIndex, TInt aTimestamp) = 0;
+ virtual TBool MosSetClientStartTimeL(const TDesC8& aComp, TInt aPortIndex, TInt aTimestamp) = 0;
+ virtual TBool MosSetCurrentAudioReferenceTimeL(const TDesC8& aComp, TInt aPortIndex, TInt aTimestamp) = 0;
+ virtual TBool MosSetVideoFitModeL(TVideoFitMode aVideoFitMode) = 0;
+ virtual TBool MosNegativeSetDataChunk(const TDesC8& aComp, OMX_ERRORTYPE aExpectedError, TInt aExpectedSystemError) = 0;
+ virtual TBool MosSetBufferSize(const TDesC8& aComp, TInt aPortIndex, TInt aCount, OMX_ERRORTYPE aExpectedError) = 0;
+ virtual TBool MosGetAndCompareBufferCount(const TDesC8& aComp, TInt aPortIndex, TInt aDataToCompare) = 0;
+ virtual TBool MosGetAndCompareBufferSize(const TDesC8& aComp, TInt aPortIndex, TInt aDataToCompare) = 0;
+ virtual TBool MosFlushBuffer(const TDesC8& aComp, TInt aPortIndex, OMX_ERRORTYPE aExpectedError) = 0;
+ virtual TBool MosForceBufferSourceFlushBufferL(const TDesC8& aComp, TInt aPortIndex, OMX_ERRORTYPE aExpectedError) = 0;
+ virtual TBool MosForceBufferSinkFlushBuffer(const TDesC8& aComp, TInt aPortIndex, OMX_ERRORTYPE aExpectedError) = 0;
+ virtual TBool MosSetActiveStream(const TDesC8& aComp, TUint32 aPortIndex)= 0;
+ virtual TBool MosGetActiveStream(const TDesC8& aComp, TUint32 aPortIndex) = 0;
+ virtual TBool MosSetDroppedFrameEvent(const TDesC8& aComp, const TDesC8& aAction) = 0;
+ virtual TBool MosCheckFrameCountL(const TDesC& aFilename, TInt aCount) = 0;
+ virtual TBool MosMarkBuffer(const TDesC8& aComp, TInt aPortIndex, const TDesC8& aTargetComp, TInt markData) = 0;
+ // mpeg4 encoder component
+ virtual TBool MosSetVideoEncQuantL(const TDesC8& aComp, TInt aPortIndex, TInt aQpb) = 0;
+ virtual TBool MosSetVideoEncMotionVectL(const TDesC8& aComp, TInt aPortIndex, TInt aAccuracy, TInt aSxSearchrange, TInt aSySearchrange, OMX_ERRORTYPE aExpectedError) = 0;
+ virtual TBool MosSetVideoEncMpeg4TypeL(const TDesC8& aComp, TInt aPortIndex, OMX_VIDEO_MPEG4PROFILETYPE aMpeg4Profile, OMX_VIDEO_MPEG4LEVELTYPE aMpeg4Level, OMX_ERRORTYPE aExpectedError) = 0;
+ virtual TBool MosSetVideoEncBitRateL(const TDesC8& aComp, TInt aPortIndex, OMX_VIDEO_CONTROLRATETYPE aControlRate, TInt aTargetBitrate, OMX_ERRORTYPE aExpectedError) = 0;
+ virtual TBool MosChangeFilledBufferLength(const TDesC8& aComp, TInt aValue) = 0;
+ virtual TBool MosSetOMX_SymbianIndexParamBufferMsgQueueData(const TDesC8& aComp, OMX_ERRORTYPE aExpectedError) = 0;
+ virtual TBool MosGetExtensionIndex(const TDesC8& aComp, const TDesC8& aParameterName, OMX_ERRORTYPE aExpectedError) = 0;
+
+ virtual TBool MosCheckTimeClockState(const TDesC8& aComp, OMX_TIME_CLOCKSTATE aExpectedState) = 0;
+ virtual TBool MosCheckMediaTime(const TDesC8& aComp, TInt aPortIndex, OMX_TICKS aMediaTime, TBool aMoreThan) = 0;
+
+ // Buffer component handler
+ virtual TBool InitialiseBufferHandlerL(const TDesC8& aComp, TDesC& aName, const TDesC8* aType) = 0;
+ virtual void StartBufferHandler() = 0;
+ virtual void StopBufferHandler() = 0;
+ virtual TBool InitialiseBufferSinkHandlerL(const TDesC8& aComp, TDesC& aName) = 0;
+ virtual void StartBufferSinkHandler() = 0;
+ virtual void StopBufferSinkHandler() = 0;
+ virtual void SendInvalidBufferId(TInt aInvalidId) = 0;
+
+ virtual TBool MosWaitEOS(const TDesC8& aComp) = 0;
+
+ virtual TBool MosSetAACProfileL(const TDesC8& aComp, TInt aPortIndex, TInt aChannels, TInt aSamplingRate, TInt aBitRate, TInt aAudioBandwidth, TInt aFrameLength, TInt aAACTools, TInt aAACERTools, OMX_AUDIO_AACPROFILETYPE aProfile, OMX_AUDIO_AACSTREAMFORMATTYPE aStreamFormat, OMX_AUDIO_CHANNELMODETYPE aChannelMode) = 0;
+ virtual TBool MosSetupBufferForPortL(const TDesC8& comp,TInt aPortIndex, const TDesC& aFileName,TInt aHeaderLength,OMX_BUFFERSUPPLIERTYPE aSupplier) = 0;
+
+ // Camera
+
+ virtual TBool MosSetSensorModeTypeL(const TDesC8& aComp, TInt aPort, TInt aFrameRate, TBool aOneShot, TInt aWidth, TInt aHeight) = 0;
+ virtual TBool MosSetCaptureModeTypeL(const TDesC8& aComp, TInt aPort, TBool aContinuous, TBool aFrameLimited, TInt aFrameLimit) = 0;
+
+
+ // Debugging/Utility functions.
+ virtual TBool MosDeleteFileL(const TDesC& aFileName, TBool aFileMustExist) = 0;
+ virtual TBool MosLogAllEventsL() = 0;
+
+ // Methods supporting generic Base Profile communications support with components
+ virtual TBool MosBaseSupportPortL(const TDesC8& aComp, TInt aPortIndex) = 0;
+ virtual TBool MosBaseSetAutonomous(const TDesC8& aComp, TInt aPortIndex, TBool aEnabled) = 0;
+ virtual TBool MosBaseAllocateBuffersL(const TDesC8& aComp, TInt aPortIndex, TInt aNumberBuffers) = 0;
+ virtual TBool MosBaseFreeAllocatedBuffersL(const TDesC8& aComp) = 0;
+ virtual TBool MosBaseSetBufSupplier(const TDesC8& aComp, TInt aPortIndex, TBool aComponentSupplier) = 0;
+ virtual TBool MosBaseFillThisBuffer(const TDesC8& aComp, TInt aPortIndex, TInt aPortRelBufIndex) = 0;
+ virtual TBool MosBaseEmptyThisBuffer(const TDesC8& aComp, TInt aPortIndex, TInt aPortRelBufIndex) = 0;
+ virtual TBool MosBaseWaitForBuffer(const TDesC8& aComp, TInt aPortIndex, TInt aPortRelBufIndex) = 0;
+
+ // Methods supporting the Timestamp checking implementation for Base Profile testing
+ virtual TBool MosBaseTimestampPassClock(const TDesC8& aCompReceiving, const TDesC8& aClockCompToPass) = 0;
+ virtual TBool MosBaseTimestampCheckTimestampL(const TDesC8& aComp, TInt aPortIndex, TUint aExpectedTime, TUint aTolerance) = 0;
+ virtual TBool MosBaseTimestampCompareWithRefClockL(const TDesC8& aComp, TInt aPortIndex, TUint aTolerance) = 0;
+
+ virtual TBool MosStartBuffersforPort( const TDesC8& aComp, TInt aPortIndex) = 0;
+#ifdef OLD_ADPCM_EXTENSION
+ virtual TBool MosSetAdPcmAudioPortDefL(const TDesC8& aComp, TInt aPortIndex, TInt aNumChannels, TInt aSamplingRate, TInt aBitsperSample) = 0;
+ virtual TBool MosConfigAdPcmDecoderBlockAlign(const TDesC8& aComp, OMX_S32 aBlockAlign) = 0;
+#endif
+ };
+
+/**
+ * This parses an XML file to drive the operation of a MOmxScriptIf.
+ */
+NONSHARABLE_CLASS(COmxScriptParser) : public CBase, public Xml::MContentHandler
+ {
+public:
+ static COmxScriptParser* NewL(RFs& aFs, const TDesC& aFilename, MOmxScriptIf& aCallback);
+ ~COmxScriptParser();
+
+ TBool RunScriptL(const TDesC& aSectionName);
+
+ // Xml::MContentHandler interface
+ void OnStartDocumentL(const RDocumentParameters& aDocParam, TInt aErrorCode);
+ void OnEndDocumentL(TInt aErrorCode);
+ void OnStartElementL(const RTagInfo& aElement, const RAttributeArray& aAttributes,
+ TInt aErrorCode);
+ void OnEndElementL(const RTagInfo& aElement, TInt aErrorCode);
+ void OnContentL(const TDesC8& aBytes, TInt aErrorCode);
+ void OnStartPrefixMappingL(const RString& aPrefix, const RString& aUri,
+ TInt aErrorCode);
+ void OnEndPrefixMappingL(const RString& aPrefix, TInt aErrorCode);
+ void OnIgnorableWhiteSpaceL(const TDesC8& aBytes, TInt aErrorCode);
+ void OnSkippedEntityL(const RString& aName, TInt aErrorCode);
+ void OnProcessingInstructionL(const TDesC8& aTarget, const TDesC8& aData,
+ TInt aErrorCode);
+ void OnError(TInt aErrorCode);
+ TAny* GetExtendedInterface(const TInt32 aUid);
+
+protected:
+ COmxScriptParser(RFs& aFs, MOmxScriptIf& aCallback);
+ void ConstructL(const TDesC& aFilename);
+
+private:
+ static const TDesC8* FindAttribute(const RArray<RAttribute>& aArray, const TDesC8& aAttribName);
+ const TDesC8& FindAttributeL(const RArray<RAttribute>& aArray, const TDesC8& aAttribName);
+ static void ParseCompPortL(const TDesC8& aInput, TPtrC8& aNameOut, TInt& aPortOut);
+ static OMX_STATETYPE ParseOmxStateL(const TDesC8& aStateDes);
+ static OMX_BUFFERSUPPLIERTYPE ParseOmxSupplierL(const TDesC8& aSupplierDes, TBool aAllowUnspecified = EFalse);
+ void CheckForAbortL(TBool success);
+ static TInt ParseOptionalIntL(const RArray<RAttribute>& aArray, const TDesC8& aAttribName, TInt aDefaultValue);
+ static TReal ParseOptionalRealL(const RArray<RAttribute>& aArray, const TDesC8& aAttribName, TReal aDefaultValue);
+ static OMX_COLOR_FORMATTYPE ParseOmxColorFormatL(const TDesC8& aDes);
+ static OMX_EVENTTYPE ParseOmxEventL(const TDesC8& aEventDes);
+ static TUint32 ParseUint32L(const TDesC8& aDes);
+ static TReal32 ParseReal32L(const TDesC8& aDes);
+ static OMX_VIDEO_CODINGTYPE ParseOmxVideoCodingL(const TDesC8& aDes);
+ static TBool ParseOptionalBooleanL(const RArray<RAttribute>& aArray, const TDesC8& aAttribName, TBool aDefaultValue);
+ static TBool ParseBooleanL(const TDesC8& aBool);
+
+ static OMX_METADATASCOPETYPE ParseOmxScopeTypeL(const TDesC8& aScopeDes);
+ static OMX_AUDIO_CODINGTYPE ParseOmxAudioCodingL(const TDesC8& aDes);
+ static OMX_TIME_REFCLOCKTYPE ParseOmxRefClockTypeL(const TDesC8& aDes);
+ static OMX_TIME_CLOCKSTATE ParseOmxClockStateL(const TDesC8& aDes);
+ static TVideoFitMode ParseVideoFitModeL(const TDesC8& aMode);
+ static OMX_COMMANDTYPE ParseOmxCommandL(const TDesC8& aDes);
+ static OMX_ERRORTYPE ParseOmxErrorL(const TDesC8& aDes);
+ static TBool ParseBoolean(const TDesC8& aDes);
+
+ static OMX_ERRORTYPE ParseOmxErrorCode(const TDesC8& aErrorCode);
+ static OMX_VIDEO_MPEG4PROFILETYPE ParseOmxMpeg4ProfileL(const TDesC8& aDes);
+ static OMX_VIDEO_MPEG4LEVELTYPE ParseOmxMpeg4LevelL(const TDesC8& aDes);
+ static OMX_VIDEO_CONTROLRATETYPE ParseOmxControlRateL(const TDesC8& aDes);
+ static OMX_AUDIO_AACPROFILETYPE ParseOmxAACProfileL(const TDesC8& aProfileDes);
+ static OMX_AUDIO_AACSTREAMFORMATTYPE ParseOmxAACStreamFormatL(const TDesC8& aFormatDes);
+ static OMX_AUDIO_CHANNELMODETYPE ParseOmxAudioChannelModeL(const TDesC8& aChannelModeDes);
+ static TInt ParseSystemErrorCode(const TDesC8& aErrorCode);
+ static OMX_AUDIO_AACSTREAMFORMATTYPE ParseAacStreamFormatL(const TDesC8& aStreamFormatStr);
+ static OMX_NUMERICALDATATYPE ParseNumericalDataL(const TDesC8& aDes);
+ static OMX_ENDIANTYPE ParseEndianL(const TDesC8& aDes);
+ static OMX_BOOL ParseBoolL(const TDesC8& aDes);
+
+private:
+ RFs& iFs;
+ RBuf iFilename;
+ MOmxScriptIf& iCallback;
+
+ // state to allow filtering for a specific section within the XML document
+ const TDesC* iSectionName; // not owned
+ TBool iInTest;
+ TBool iFoundTest;
+ TBool iCallbackAborted;
+ };
+
+#endif /*OMXSCRIPTPARSER_H_*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/src/omxscripttest.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,4118 @@
+/*
+* 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 "omxscripttest.h"
+#include "paramconversion.h"
+#include "statedes.h"
+
+#include "omxilsymbianvideographicsinkextensions.h"
+#include <openmax/il/shai/OMX_Symbian_IVCommonExt.h>
+#include <graphics/surfaceconfiguration.h>
+#include <hash.h>
+#include "omxutil.h"
+#include "nontunneledhandler.h"
+#include "videobufferhandler.h"
+#include "videobufferhandler_mpeg4.h" // for mpeg4
+#include "videobuffersinkhandler.h"
+#include "log.h"
+#include "omx_xml_script.h"
+#include "transition.h"
+#include "parsemap.h"
+#include <uri8.h>
+#include "omxildroppedframeeventextension.h"
+#include <c3gplibrary.h>
+#include "baseprofilehandler.h"
+#include "baseprofiletimestamping.h"
+#include "windowmanager.h"
+#ifdef OLD_ADPCM_EXTENSION
+#include <openmax/il/extensions/omxilsymbianadpcmdecoderextensions.h>
+#endif
+
+///////////////////////////////////////////////////////////////////////////////
+// Temporary work-around for floating point issues on HREF 8500 ED hardware
+// Using this macro, code that uses TReal will be #defined out if running on ED.
+// TODO: Remove HREF_ED_WITHOUT_FLOATING_POINT and all of its conditional code
+// once the floating point issue has been solved.
+#if defined(NCP_COMMON_BRIDGE_FAMILY) && !defined(__WINSCW__)
+#define HREF_ED_WITHOUT_FLOATING_POINT
+#endif
+
+DECL_PARSETYPE(OMX_EVENTTYPE);
+
+_LIT8(KILTypeString, "LOGICAL");
+
+static TInt StopScheduler(TAny* unused);
+
+/**
+ * Runs an OMX test specified in an XML file.
+ * @param aScriptFilename path to XML file
+ * @param aScriptSection section name in XML file
+ */
+void ROmxScriptTest::RunTestL(const TDesC& aScriptFilename, const TDesC& aScriptSection)
+ {
+ User::LeaveIfError(iEventHandler.Create());
+ iStopSchedulerCallback = new(ELeave) CAsyncCallBack(StopScheduler, CActive::EPriorityHigh);
+
+ RFs fs;
+ User::LeaveIfError(fs.Connect());
+ CleanupClosePushL(fs);
+
+ INFO_PRINTF3(_L("Executing test steps in section %S of %S"), &aScriptSection, &aScriptFilename);
+
+ TPtrC filename;
+ COmxScriptParser* parser = COmxScriptParser::NewL(fs, aScriptFilename, *this);
+ CleanupStack::PushL(parser);
+
+ // this drives the methods from MOmxScriptIf
+ TBool success = parser->RunScriptL(aScriptSection);
+ if(success)
+ {
+ StopTest(EPass);
+ }
+ else
+ {
+ ERR_PRINTF1(_L("Script did not complete"));
+ StopTest(EFail);
+ }
+
+ CleanupStack::PopAndDestroy(2, &fs); // fs, parser
+
+ User::LeaveIfError(Reason());
+ }
+
+/**
+ * Constructs an object to parse and execute an OMX test case specified in
+ * an XML file.
+ * @param reference to logger interface to receive test messages
+ */
+ROmxScriptTest::ROmxScriptTest(MOmxScriptTestLogger& aLogger):
+ iCoreLoaded(EFalse),
+ iEventHandler(*this),
+ iState(OMX_StateLoaded),
+ iWindowManager(NULL),
+ iVideoFitMode(EVideoFitRotateScaleAndCentre),
+ iTimer(NULL),
+ iWaitingForEvents(EFalse),
+ iNonTunneledHandler(NULL),
+ iBufferHandler(NULL),
+ iBufferSinkHandler(NULL),
+ iReason(KErrNone),
+ iVerdict(EPending),
+ iLogger(aLogger),
+ iStopSchedulerCallback(NULL),
+ iPortBufferHandler(NULL)
+ {
+ }
+
+/**
+ * Destroys all resources created by this object.
+ */
+void ROmxScriptTest::Close()
+ {
+ // release memory and unload components
+ // ~CComponentInfo unloads component in correct thread
+ iComponents.ResetAndDestroy();
+
+ if(iCoreLoaded)
+ {
+ INFO_PRINTF1(_L("OMX_Deinit()"));
+ iCoreLoaded = EFalse;
+ OMX_ERRORTYPE error = OMX_Deinit();
+ if(error)
+ {
+ FailWithOmxError(_L("OMX_Deinit"), error);
+ }
+ }
+ REComSession::FinalClose();
+ iEventHandler.Close();
+ delete iWindowManager;
+ iWindowManager = NULL;
+ iState = OMX_StateLoaded;
+
+ if (iTimer)
+ {
+ iTimer->Cancel();
+ delete iTimer;
+ iTimer = NULL;
+ }
+
+ iExpectedEvents.Close();
+ iIgnoredEvents.Close();
+
+ if (iNonTunneledHandler)
+ {
+ delete iNonTunneledHandler;
+ iNonTunneledHandler = NULL;
+ }
+
+ if(iPortBufferHandler)
+ {
+ delete iPortBufferHandler;
+ iPortBufferHandler = NULL;
+ }
+
+ // Buffer component
+ delete iBufferHandler;
+ iBufferHandler = NULL;
+
+ delete iBufferSinkHandler;
+ iBufferSinkHandler = NULL;
+
+ delete iStopSchedulerCallback;
+ iStopSchedulerCallback = NULL;
+
+ iTunnels.Close();
+ }
+
+// allows OMX components to be placed on the cleanup stack
+//void ROmxScriptTest::CleanupOmxComponent(TAny* aPtr)
+// {
+// OMX_COMPONENTTYPE* component = static_cast<OMX_COMPONENTTYPE*>(aPtr);
+// OMX_ERRORTYPE error = OMX_FreeHandle(component);
+// // if this method is called, we are already in an error condition,
+// // but OMX_FreeHandle should still succeed. Perhaps a cleaner way of
+// // reporting any error is desired, but this is a static method so we
+// // lack the context to call the standard logging mechanism.
+// __ASSERT_DEBUG(!error, User::Invariant());
+// }
+
+TBool ROmxScriptTest::MosLoadComponentL(const TDesC8& aComp, const TDesC8& aName, TBool aBaseProfile, const TDesC8* aBaseImpl, TBool aLoadInCoreServerThread)
+ {
+ if(!iCoreLoaded)
+ {
+ INFO_PRINTF1(_L("OMX_Init()"));
+ OMX_ERRORTYPE error = OMX_Init();
+ if(error)
+ {
+ CleanupStack::PopAndDestroy(2);
+ FailWithOmxError(_L("OMX_Init()"), error);
+ return EFalse;
+ }
+ iCoreLoaded = ETrue;
+ }
+
+ // convert from 8-bit descriptor for logging
+ TBuf<64> nameCopy;
+ nameCopy.Copy(aName);
+ INFO_PRINTF2(_L("Loading component %S"), &nameCopy);
+
+ CComponentInfo* componentInfo = CComponentInfo::NewL(*this);
+ CleanupStack::PushL(componentInfo);
+ componentInfo->iShortName = HBufC8::NewL(aComp.Length());
+ *(componentInfo->iShortName) = aComp;
+ // allow room for the '\0' used in call to OMX_GetHandle
+ componentInfo->iComponentName = HBufC8::NewL(aName.Length() + 1);
+ *(componentInfo->iComponentName) = aName;
+
+
+ OMX_ERRORTYPE error = OMX_ErrorNone;
+ if (aBaseProfile)
+ {
+ if (*aBaseImpl == _L8("base"))
+ {
+ componentInfo->iBaseHandler = new (ELeave) CBaseProfileHandler(*this, iEventHandler);
+ componentInfo->iComponent = componentInfo->iBaseHandler->LoadComponentL(*componentInfo->iShortName, *componentInfo->iComponentName);
+
+ }
+ else if (*aBaseImpl == _L8("timestampcheck"))
+ {
+ componentInfo->iBaseHandler = new (ELeave) CBaseProfileTimestampHandling(*this, iEventHandler);
+ componentInfo->iComponent = componentInfo->iBaseHandler->LoadComponentL(*componentInfo->iShortName, *componentInfo->iComponentName);
+
+ }
+
+ }
+ else
+ {
+ OMX_CALLBACKTYPE& callbacks = iEventHandler.CallbackStruct();
+ // NOTE componentInfo.iShortName and componentInfo.iComponentName still on the cleanup stack
+
+ if(aLoadInCoreServerThread)
+ {
+ INFO_PRINTF2(_L("Loading component %S in Core Server thread"), &nameCopy);
+ if(componentInfo->iThreadRequest == NULL)
+ {
+ componentInfo->iThreadRequest = COmxThreadRequest::NewL();
+ }
+ error = componentInfo->iThreadRequest->GetHandle((TAny**) &(componentInfo->iComponent), (OMX_STRING) componentInfo->iComponentName->Des().PtrZ(), &iEventHandler, &callbacks);
+ }
+ else
+ {
+ INFO_PRINTF2(_L("Loading component %S in Client thread"), &nameCopy);
+ error = OMX_GetHandle((TAny**) &(componentInfo->iComponent), (OMX_STRING) componentInfo->iComponentName->Des().PtrZ(), &iEventHandler, &callbacks);
+ }
+ }
+ if(error || (componentInfo->iComponent == NULL))
+ {
+ CleanupStack::PopAndDestroy(); // delete component info
+ FailWithOmxError(_L("OMX_GetHandle()"), error);
+ return EFalse;
+ }
+
+ RDebug::Print(_L("OMX_GetHandle name=%S handle=0x%08X"), &nameCopy, componentInfo->iComponent);
+ iEventHandler.AddComponentL(componentInfo->iComponent, nameCopy);
+ iComponents.AppendL(componentInfo);
+ CleanupStack::Pop(1, componentInfo);
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosSetupTunnel(const TDesC8& aSourceComp, TInt aSourcePort,
+ const TDesC8& aSinkComp, TInt aSinkPort, OMX_ERRORTYPE aExpectedError)
+ {
+ OMX_COMPONENTTYPE* source = NULL;
+ OMX_COMPONENTTYPE* sink = NULL;
+ if(aSourceComp!=KNullDesC8)
+ {
+ source = ComponentByName(aSourceComp);
+ }
+
+ if(aSinkComp!=KNullDesC8)
+ {
+ sink = ComponentByName(aSinkComp);
+ }
+
+ //support for testing tunnel breakup
+ if(source || sink)
+ {
+ OMX_ERRORTYPE error = OMX_SetupTunnel(source, aSourcePort, sink, aSinkPort);
+ // TODO check tunnel reconfiguration
+ if(error == OMX_ErrorNone)
+ {
+ RegisterTunnel(source, aSourcePort, sink, aSinkPort);
+ }
+ if(error != aExpectedError)
+ {
+ ERR_PRINTF3(_L("MosSetupTunnel OMX_SetupTunnel: Error 0x%X does not match expected error 0x%X"), error, aExpectedError);
+ TBuf8<64> msg8;
+ msg8.Format(_L8("source=%S:%d sink=%S:%d"), &aSourceComp, aSourcePort, &aSinkComp, aSinkPort);
+ TBuf<64> msg;
+ msg.Copy(msg8);
+ INFO_PRINTF1(msg);
+ return EFalse;
+ }
+ return ETrue;
+ }
+ else
+ {
+ // source or sink names not recognized
+ return EFalse;
+ }
+ }
+
+TBool ROmxScriptTest::MosSetupNonTunnel(const TDesC8& aSourceComp, TInt aSourcePort,
+ const TDesC8& aSinkComp, TInt aSinkPort,
+ OMX_BUFFERSUPPLIERTYPE aSupplier)
+ {
+ OMX_COMPONENTTYPE* source = ComponentByName(aSourceComp);
+ OMX_COMPONENTTYPE* sink = ComponentByName(aSinkComp);
+ if(source && sink)
+ {
+ OMX_PARAM_PORTDEFINITIONTYPE portDef;
+ portDef.nSize = sizeof(portDef);
+ portDef.nVersion = KOmxVersion;
+ portDef.nPortIndex = aSourcePort;
+ OMX_ERRORTYPE error = source->GetParameter(source, OMX_IndexParamPortDefinition, &portDef);
+ if(error != OMX_ErrorNone)
+ {
+ FailWithOmxError(_L("GetParameter"), error);
+ return EFalse;
+ }
+
+ TInt numBufs = portDef.nBufferCountActual;
+ TInt bufSize = portDef.nBufferSize;
+
+ portDef.nPortIndex = aSinkPort;
+ error = sink->GetParameter(sink, OMX_IndexParamPortDefinition, &portDef);
+ if(error != OMX_ErrorNone)
+ {
+ FailWithOmxError(_L("GetParameter"), error);
+ return EFalse;
+ }
+
+ if (portDef.nBufferCountActual != numBufs)
+ {
+ ERR_PRINTF1(_L("Number of buffers does not match for non tunneled setup"));
+ return EFalse;
+ }
+
+ if (portDef.nBufferSize > bufSize)
+ {
+ bufSize = portDef.nBufferSize;
+ }
+
+ if (!iNonTunneledHandler)
+ {
+ iNonTunneledHandler = new CNonTunneledHandler();
+
+ if (!iNonTunneledHandler)
+ {
+ return EFalse;
+ }
+ }
+
+ TRAPD(err, iNonTunneledHandler->AddLinkL(source, aSourcePort, sink, aSinkPort, aSupplier, numBufs, bufSize));
+ if (err != KErrNone)
+ return EFalse;
+
+ return ETrue;
+ }
+ else
+ {
+ // source or sink names not recognized
+ return EFalse;
+ }
+ }
+
+
+TBool ROmxScriptTest::MosSetupBufferForPortL(const TDesC8& aComp,TInt aPortIndex, const TDesC& aFileName,TInt aHeaderLength,OMX_BUFFERSUPPLIERTYPE aSupplier)
+ {
+ TBuf<64> compConverted;
+ compConverted.Copy(aComp);
+ INFO_PRINTF3(_L("MosSetupBufferForPort comp %S port %d"), &compConverted, aPortIndex);
+ OMX_COMPONENTTYPE* comp = ComponentByName(aComp);
+
+ if(comp)
+ {
+ OMX_PARAM_PORTDEFINITIONTYPE portDef;
+ portDef.nSize = sizeof(portDef);
+ portDef.nVersion = KOmxVersion;
+ portDef.nPortIndex = aPortIndex;
+ OMX_ERRORTYPE error = comp->GetParameter(comp, OMX_IndexParamPortDefinition, &portDef);
+ if(error != OMX_ErrorNone)
+ {
+ FailWithOmxError(_L("GetParameter"), error);
+ return EFalse;
+ }
+
+ OMX_DIRTYPE portDirType = portDef.eDir;
+
+ if(!iPortBufferHandler)
+ {
+ iPortBufferHandler = new (ELeave)CPortBufferHandler;
+ }
+
+ iPortBufferHandler->AddPortL(comp,aPortIndex,aFileName,aSupplier,portDirType,iLogger,aHeaderLength);
+ }
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosSetWindowL(const TDesC8& aComp)
+ {
+ if(iWindowManager)
+ {
+ delete iWindowManager;
+ iWindowManager = NULL;
+ }
+ iWindowManager = CWindowManager::NewL();
+ TSize screenSize = iWindowManager->ScreenSize();
+ INFO_PRINTF3(_L("Screen size is %dx%d"), screenSize.iWidth, screenSize.iHeight);
+
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+ iGraphicSink = component;
+
+ OMX_ERRORTYPE error = OMX_GetExtensionIndex(component, const_cast<char*>(sOmxSymbianGfxSurfaceConfig), &iExtSurfaceConfigIndex);
+ if(error != OMX_ErrorNone)
+ {
+ FailWithOmxError(_L("GetExtensionIndex(sOmxSymbianGfxSurfaceConfig)"), error);
+ return EFalse;
+ }
+
+ //Temporary Hack: This is for Logical IL Video Tests: SurfaceId is supposed to be set in response to PortSettingsChanged event from
+ //MMHP. Currently, there is no support for it. Hence, we are temporarily setting here
+ OMX_PARAM_PORTDEFINITIONTYPE portDef;
+ portDef.nSize = sizeof(portDef);
+ portDef.nVersion = KOmxVersion;
+ portDef.nPortIndex = 0;
+ error = component->GetParameter(component, OMX_IndexParamPortDefinition, &portDef);
+ if(error)
+ {
+ FailWithOmxError(_L("GetParameter"), error);
+ return EFalse;
+ }
+ error = component->SetParameter(component, OMX_IndexParamPortDefinition, &portDef);
+
+ if(error==OMX_ErrorIncorrectStateOperation)
+ {
+ OMX_SYMBIAN_VIDEO_PARAM_SURFACECONFIGURATION surfaceConfigParam;
+ surfaceConfigParam.nSize = sizeof(OMX_SYMBIAN_VIDEO_PARAM_SURFACECONFIGURATION);
+ surfaceConfigParam.nVersion = KOmxVersion;
+ surfaceConfigParam.nPortIndex = 0;
+
+ // define must be removed when hack is removed - OMX_GetExtensionIndex() should be used but hack for when this
+ // returns an error
+ #define OMX_SymbianIndexParamVideoGFXSurfaceConfig 0x7F000011
+ OMX_ERRORTYPE omxError = component->GetParameter(component, (OMX_INDEXTYPE) OMX_SymbianIndexParamVideoGFXSurfaceConfig, &surfaceConfigParam);
+ if(omxError != OMX_ErrorNone)
+ {
+ FailWithOmxError(_L("GetParameter(OMX_SymbianIndexParamVideoGFXSurfaceConfig)"), omxError);
+ return EFalse;
+ }
+
+ TSurfaceConfiguration& surfaceConfig = *reinterpret_cast<TSurfaceConfiguration*>(surfaceConfigParam.pSurfaceConfig);
+
+ TRect rect(0,0,320,240);
+ TInt err = surfaceConfig.SetExtent(rect);
+ if (err == KErrNone)
+ {
+ err =iWindowManager->SetBackgroundSurface(surfaceConfig, ETrue);
+ }
+
+ if(err)
+ {
+ FailWithOmxError(_L("SetParameter"), error);
+ return EFalse;
+ }
+ }
+ else if(error)
+ {
+ FailWithOmxError(_L("SetParameter"), error);
+ return EFalse;
+ }
+
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosSetDroppedFrameEvent(const TDesC8& aComp, const TDesC8& aAction)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+ TBuf8<80> extension;
+
+ if (aAction == _L8("invalidextension"))
+ {
+ extension.Append(_L8("OMX.NOKIA.INDEX.PARAM.INVALIDEXTENSION"));
+ }
+ else
+ {
+ extension.Append(_L8("OMX.NOKIA.INDEX.PARAM.DROPPEDFRAMEEVENT"));
+ }
+
+ OMX_INDEXTYPE indexType = OMX_IndexMax;
+ OMX_ERRORTYPE error = component->GetExtensionIndex(component, (OMX_STRING) extension.PtrZ(), &indexType);
+
+ if (aAction == _L8("invalidextension"))
+ {
+ if (error != OMX_ErrorUnsupportedIndex)
+ {
+ ERR_PRINTF2(_L("GetExtensionIndex with invalid extension incorrectly returned error 0x%X"), error);
+ StopTest(EFail);
+ return EFalse;
+ }
+ return ETrue;
+ }
+
+ if (error != OMX_ErrorNone)
+ {
+ FailWithOmxError(_L("GetExtensionIndex"), error);
+ return EFalse;
+ }
+
+ OMX_NOKIA_PARAM_DROPPEDFRAMEEVENT exten;
+ exten.nSize = sizeof(exten);
+ exten.nVersion = KOmxVersion;
+ exten.nPortIndex = 0;
+
+ if(aAction == _L8("enable"))
+ {
+ exten.bEnabled = OMX_TRUE;
+ error = component->SetParameter(component, indexType, &exten);
+ if(error)
+ {
+ FailWithOmxError(_L("SetParameter"), error);
+ return EFalse;
+ }
+ return ETrue;
+ }
+ else
+ {
+ exten.bEnabled = OMX_FALSE;
+ error = component->SetParameter(component, indexType, &exten);
+ if(error)
+ {
+ FailWithOmxError(_L("SetParameter"), error);
+ return EFalse;
+ }
+ return ETrue;
+ }
+ }
+
+TBool ROmxScriptTest::MosAllTransitionL(OMX_STATETYPE aState, OMX_ERRORTYPE aExpectedError, TTransitionOrder aOrder)
+ {
+ INFO_PRINTF2(_L("Transitioning all components to %S"), StateDes(aState));
+ if(aOrder == ELoadOrder && aState == OMX_StateIdle && iState == OMX_StateLoaded)
+ {
+ WARN_PRINTF1(_L("Using component load order for loaded -> idle transition order"));
+ }
+ iEventHandler.AwaitTransition(aState, iState);
+ RArray<TInt> order;
+ CleanupClosePushL(order);
+ order.ReserveL(iComponents.Count());
+ if(aOrder == ELoadOrder)
+ {
+ for(TInt index = 0; index < iComponents.Count(); index++)
+ {
+ order.Append(index);
+ }
+ }
+ else if(aOrder == EAutoOrder)
+ {
+ TRAPD(error, FindTransitionOrderL(iComponents, iTunnels, order));
+ if(error != KErrNone)
+ {
+ ERR_PRINTF2(_L("Error determining transition order, error=%d"), error);
+ User::Leave(error);
+ }
+ }
+
+ if(aState == OMX_StateIdle && iState == OMX_StateExecuting)
+ {
+ // use reverse order for Idle->Executing transition
+ TInt left = 0, right = order.Count() - 1;
+ while(left < right)
+ {
+ TInt tmp = order[left];
+ order[left] = order[right];
+ order[right] = tmp;
+ left++;
+ right--;
+ }
+ }
+
+ if(aOrder == EAutoOrder)
+ {
+ TBuf<128> orderDes;
+ for(TInt index = 0, count = order.Count(); index < count; index++)
+ {
+ HBufC8* name8 = iComponents[order[index]]->iShortName;
+ TBuf<16> name;
+ name.Copy(*name8);
+ if(index > 0)
+ {
+ orderDes.Append(_L(", "));
+ }
+ orderDes.Append(name);
+ }
+ INFO_PRINTF2(_L("Auto-detected transition order: %S"), &orderDes);
+ }
+
+ TBool commandError = EFalse;
+ TBool ret = EFalse;
+ for(TInt orderIndex = 0, count = order.Count(); orderIndex < count; orderIndex++)
+ {
+ TInt index = order[orderIndex];
+ CComponentInfo* compInfo = iComponents[index];
+ OMX_COMPONENTTYPE* component = compInfo->iComponent;
+ OMX_ERRORTYPE error = component->SendCommand(component, OMX_CommandStateSet, aState, NULL);
+ if(error)
+ {
+ TBuf<128> msg;
+ msg.Format(_L("SendCommand(OMX_CommandStateSet, %S)"), StateDes(aState));
+ if(error != aExpectedError)
+ {
+ FailWithOmxError(compInfo->iShortName->Des(), msg, error);
+ ret = EFalse;
+ }
+ else //Need to stop the tests now be cause an error has occurred, even if it is expected.
+ {
+ StopTest(EPass);
+ ret = ETrue;
+ }
+ commandError = ETrue;
+ break;
+ }
+
+ if (!HandleNonTunneledBuffers(aState, component))
+ {
+ commandError = ETrue;
+ ret = EFalse;
+ break;
+ }
+ if(!HandlePortBufferHandler(aState, component))
+ {
+ return EFalse;
+ }
+ }
+ CleanupStack::PopAndDestroy(&order);
+ if(commandError)
+ {
+ return ret;
+ }
+
+ // wait for the transitions to complete
+ // use a nested loop of the active scheduler
+ // AllComponentsTransitioned() calls EndWait()
+ BeginWait();
+ return Reason() == KErrNone;
+ }
+
+TBool ROmxScriptTest::MosTransition(const TDesC8& aComp, OMX_STATETYPE aState, TBool aAsync)
+ {
+ TBuf<64> compConverted;
+ compConverted.Copy(aComp);
+ INFO_PRINTF3(_L("Transitioning %S component to %S"), &compConverted, StateDes(aState));
+
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ if (!aAsync)
+ {
+ iEventHandler.AwaitSingleTransition(component, aState, iState);
+ }
+ else
+ {
+ //Don't want to force a wait on this state transition so instead of using the event handler add the event to the expected list
+ TExpectedEvent event;
+ event.iComponent = component;
+ event.iEvent = OMX_EventCmdComplete;
+ event.iData1 = OMX_CommandStateSet;
+ event.iData2 = aState;
+ event.iEventData = NULL;
+ TRAPD(err, iExpectedEvents.AppendL(event));
+ if (err != KErrNone)
+ return EFalse;
+ }
+
+ OMX_ERRORTYPE error = component->SendCommand(component, OMX_CommandStateSet, aState, NULL);
+ if(error)
+ {
+ FailWithOmxError(_L("SendCommand(OMX_CommandStateSet)"), error);
+ return EFalse;
+ }
+
+ if (!HandleNonTunneledBuffers(aState, component))
+ {
+ return EFalse;
+ }
+
+ if(!HandlePortBufferHandler(aState, component))
+ {
+ return EFalse;
+ }
+
+ if (!aAsync)
+ {
+ BeginWait();
+ }
+ return Reason() == KErrNone;
+ }
+
+TBool ROmxScriptTest::MosFailingTransition(const TDesC8& aComp, OMX_STATETYPE aState,OMX_ERRORTYPE aExpectedError)
+ {
+ TBuf<64> compConverted;
+ compConverted.Copy(aComp);
+ INFO_PRINTF3(_L("Transitioning %S component to %S"), &compConverted, StateDes(aState));
+
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ OMX_ERRORTYPE error = component->SendCommand(component, OMX_CommandStateSet, aState, NULL);
+ if(error == aExpectedError)
+ {
+ return ETrue;
+ }
+ else
+ {
+ return EFalse;
+ }
+ }
+
+TBool ROmxScriptTest::MosWaitEOS()
+ {
+ // AllComponentsEOS() calls EndWait()
+ INFO_PRINTF1(_L("Waiting for End of Stream from all components"));
+ iEventHandler.AwaitEOS();
+ BeginWait();
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosWaitEOS(const TDesC8& aComp)
+ {
+ // AllComponentsEOS() calls EndWait()
+ TBuf<16> comp16;
+ comp16.Copy(aComp);
+ INFO_PRINTF2(_L("Waiting for End of Stream from component %S"), &comp16);
+ OMX_COMPONENTTYPE* compHandle = ComponentByName(aComp);
+ if(compHandle == NULL)
+ {
+ return EFalse;
+ }
+ iEventHandler.AwaitEOS(compHandle);
+ BeginWait();
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosWaitL(TTimeIntervalMicroSeconds32 aDelay)
+ {
+ if (iTimer)
+ {
+ iTimer->Cancel();
+ }
+ else
+ {
+ iTimer = CVideoTestTimer::NewL(*this);
+ }
+
+ iTimer->Start(aDelay);
+ BeginWait();
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosExpectEventL(const TDesC8& aComp, OMX_EVENTTYPE aEvent, TUint32 aData1, TUint32 aData2)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ TExpectedEvent event;
+ event.iComponent = component;
+ event.iEvent = aEvent;
+ event.iData1 = aData1;
+ event.iData2 = aData2;
+ event.iEventData = NULL;
+ iExpectedEvents.AppendL(event);
+
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosWaitForAllEventsL()
+ {
+ if(iExpectedEvents.Count() > 0)
+ {
+ iWaitingForEvents = ETrue;
+ BeginWait();
+ iWaitingForEvents = EFalse;
+ __ASSERT_ALWAYS(iExpectedEvents.Count() == 0, User::Invariant());
+ }
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosSetFilename(const TDesC8& aComp, const TDesC& aFilename)
+ {
+ TBuf<64> compConverted;
+ compConverted.Copy(aComp);
+ INFO_PRINTF3(_L("Setting filename on component %S to %S"), &compConverted, &aFilename);
+
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ OMX_PARAM_CONTENTURITYPE* contentURI = NULL;
+ TRAPD(err, contentURI = ParamConversion::FilenameAsContentUriStructV1_1L(aFilename));
+ if(err==KErrBadName)//logical IL tests pass just the filename. so try adding the directory path
+ {
+ TBuf<64> fileName;
+ fileName.Copy(KPortDirectoryPath);
+ fileName.Append(aFilename);
+ err=KErrNone;
+ TRAP(err, contentURI = ParamConversion::FilenameAsContentUriStructV1_1L(fileName));
+ }
+ if(err)
+ {
+ ERR_PRINTF2(_L("Error converting filename to OMX_CONTENTURI (%d)"), err);
+ return EFalse;
+ }
+ OMX_ERRORTYPE error = component->SetParameter(component, OMX_IndexParamContentURI, contentURI);
+ delete contentURI;
+ if(error)
+ {
+ FailWithOmxError(_L("SetParameter(OMX_IndexParamContentURI)"), error);
+ return EFalse;
+ }
+ else
+ {
+ return ETrue;
+ }
+ }
+
+TBool ROmxScriptTest::MosSetFilename_bellagio(const TDesC8& aComp, char *filepath)
+ {
+ TBuf<64> compConverted;
+ compConverted.Copy(aComp);
+
+ //INFO_PRINTF3(_L("Setting filename on component %S to %S"), &compConverted, filepath);
+
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+
+ if(!component)
+ {
+ return EFalse;
+ }
+ OMX_INDEXTYPE indexType;
+ OMX_ERRORTYPE omx_err;
+
+ // Setting the input file name for File Source Component
+ omx_err = OMX_GetExtensionIndex(component, "OMX.Nokia.index.config.filename",&indexType);
+
+ if(omx_err != OMX_ErrorNone)
+ {
+ return EFalse;
+ }
+
+ OMX_ERRORTYPE error = OMX_SetConfig(component,indexType,filepath);
+
+ if(error)
+ {
+ return EFalse;
+ }
+ else
+ {
+ return ETrue;
+ }
+
+ }
+
+TBool ROmxScriptTest::MosSetBadFilename(const TDesC8& aComp)
+ {
+ TBuf<64> compConverted;
+ compConverted.Copy(aComp);
+ INFO_PRINTF2(_L("Setting filename on component %S"), &compConverted);
+
+ TText8 cstr[6] = {':', 'e' ,'l' ,'l' ,'o','\0'};
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+ OMX_PARAM_CONTENTURITYPE* contentURI = reinterpret_cast<OMX_PARAM_CONTENTURITYPE*>(new TUint8[15]);
+ if (!contentURI)
+ return EFalse;
+
+ TPtr8 uriStructDes(contentURI->contentURI, sizeof(cstr));
+ uriStructDes = cstr;
+
+ OMX_ERRORTYPE error = component->SetParameter(component, OMX_IndexParamContentURI, contentURI);
+ delete contentURI;
+
+ return ETrue;
+
+ }
+
+TBool ROmxScriptTest::MosGetFilename(const TDesC8& aComp, TDesC& aFilename, OMX_ERRORTYPE aExpectedError)
+ {
+ TBuf<64> compConverted;
+ compConverted.Copy(aComp);
+ INFO_PRINTF2(_L("Getting filename on component %S"), &compConverted);
+
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+ OMX_PARAM_CONTENTURITYPE* contentURI = NULL;
+ TRAPD(err, contentURI = ParamConversion::FilenameAsContentUriStructV1_1L(aFilename));
+ if(err)
+ {
+ ERR_PRINTF2(_L("Error converting filename to OMX_CONTENTURI (%d)"), err);
+ return EFalse;
+ }
+ OMX_ERRORTYPE error = component->GetParameter(component, OMX_IndexParamContentURI, contentURI);
+ delete contentURI;
+ if((error != aExpectedError) && (error != OMX_ErrorOverflow) && (error != OMX_ErrorUnsupportedSetting))
+ {
+ TBuf<64> errorDes;
+ OMXUtil::ErrorDes(error, errorDes);
+ TBuf<64> expectedErrorDes;
+ OMXUtil::ErrorDes(aExpectedError, expectedErrorDes);
+ ERR_PRINTF3(_L("GetParameter(OMX_IndexParamContentURI) returned %S but expected %S OMX_ErrorOverflow or OMX_ErrorUnsupportedSetting"),
+ &errorDes, &expectedErrorDes);
+ StopTest(EFail);
+ return EFalse;
+ }
+ else
+ {
+ return ETrue;
+ }
+ }
+
+
+void ROmxScriptTest::FormatHex(const TDesC8& bin, TDes& hex)
+ {
+ __ASSERT_DEBUG(hex.MaxLength() == bin.Length() * 2, User::Invariant());
+ hex.SetLength(0);
+ for(TInt index = 0, length = bin.Length(); index < length; index++)
+ {
+ TUint8 octet = bin[index];
+ hex.AppendFormat(_L("%02X"), octet);
+ }
+ }
+
+TBool ROmxScriptTest::MosSetBufferCount(const TDesC8& aComp, TInt aPortIndex, TInt aCount, OMX_ERRORTYPE aExpectedError)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ OMX_PARAM_PORTDEFINITIONTYPE portDef;
+ portDef.nVersion = KOmxVersion;
+ portDef.nSize = sizeof(portDef);
+ portDef.nPortIndex = aPortIndex;
+
+ OMX_ERRORTYPE error = component->GetParameter(component, OMX_IndexParamPortDefinition, &portDef);
+ if(error)
+ {
+ FailWithOmxError(_L("OMX_GetParameter()"), error);
+ return EFalse;
+ }
+
+ portDef.nBufferCountActual = aCount;
+
+ INFO_PRINTF3(_L("MosSetBufferCount count %d; dir %d"), portDef.nBufferCountActual, portDef.eDir);
+
+ error = component->SetParameter(component, OMX_IndexParamPortDefinition, &portDef);
+ if(aExpectedError != error)
+ {
+ ERR_PRINTF3(_L("MosSetBufferCount OMX_SetParameter() error 0x%X, expecting 0x%X"), error, aExpectedError);
+ return EFalse;
+ }
+ return ETrue;
+ }
+
+
+TBool ROmxScriptTest::MosFilterAndCompareFilesL(
+ const TDesC& aFileOne, const TDesC8& aFile1Filter1, const TDesC8& aFile1Filter2, const TDesC8& aFile1Filter3,
+ const TDesC& aFileTwo, const TDesC8& aFile2Filter1, const TDesC8& aFile2Filter2, const TDesC8& aFile2Filter3)
+ {
+ TBuf8<16> aHashOne, aHashTwo;
+
+ THashFilter f1filter1 = GetHashFilterByName(aFile1Filter1);
+ THashFilter f1filter2 = GetHashFilterByName(aFile1Filter2);
+ THashFilter f1filter3 = GetHashFilterByName(aFile1Filter3);
+
+ THashFilter f2filter1 = GetHashFilterByName(aFile2Filter1);
+ THashFilter f2filter2 = GetHashFilterByName(aFile2Filter2);
+ THashFilter f2filter3 = GetHashFilterByName(aFile2Filter3);
+
+ HashFileL(aFileOne, aHashOne, f1filter1, f1filter2, f1filter3 );
+ HashFileL(aFileTwo, aHashTwo, f2filter1, f2filter2, f2filter3 );
+
+ if (aHashOne == aHashTwo)
+ {
+ INFO_PRINTF1(_L("Filter and compare files = MATCH"));
+ }
+ else
+ {
+ INFO_PRINTF1(_L("Filter and compare files = FAIL"));
+ }
+
+ return aHashOne == aHashTwo;
+ }
+
+TBool ROmxScriptTest::MosCompareFilesL(const TDesC& aFileOne, const TDesC& aFileTwo)
+ {
+ TBuf8<16> aHashOne, aHashTwo;
+ HashFileL(aFileOne, aHashOne);
+ HashFileL(aFileTwo, aHashTwo);
+ return aHashOne == aHashTwo;
+ }
+
+
+TBool ROmxScriptTest::MosBufferSupplierOverrideL(
+ const TDesC8& aSourceComp,
+ TInt aSourcePort,
+ const TDesC8& aSinkComp, TInt aSinkPort,
+ OMX_BUFFERSUPPLIERTYPE aSupplier,
+ OMX_ERRORTYPE aExpectedSourceError,
+ OMX_ERRORTYPE aExpectedSinkError
+ )
+ {
+ OMX_COMPONENTTYPE* source = ComponentByName(aSourceComp);
+ OMX_COMPONENTTYPE* sink = ComponentByName(aSinkComp);
+ if(!source || !sink)
+ {
+ return EFalse;
+ }
+
+ OMX_PARAM_BUFFERSUPPLIERTYPE param;
+ param.nSize = sizeof(param);
+ param.nVersion = KOmxVersion;
+ param.nPortIndex = aSourcePort;
+ param.eBufferSupplier = aSupplier;
+ OMX_ERRORTYPE error = source->SetParameter(source, OMX_IndexParamCompBufferSupplier, ¶m);
+ if(error != aExpectedSourceError)
+ {
+ ERR_PRINTF3(_L("MosBufferSupplierOverrideL source->SetParameter error 0x%X, expected 0x%X"), error, aExpectedSourceError);
+ return EFalse;
+ }
+
+ param.nPortIndex = aSinkPort;
+ error = sink->SetParameter(sink, OMX_IndexParamCompBufferSupplier, ¶m);
+ if(error != aExpectedSinkError)
+ {
+ ERR_PRINTF3(_L("MosBufferSupplierOverrideL sink->SetParameter error 0x%X, expected 0x%X"), error, aExpectedSinkError);
+ return EFalse;
+ }
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosSetCameraOneShotL(const TDesC8& aComp, TInt aIsOneShot, OMX_ERRORTYPE aExpectedError)
+ {
+ //TODO DL
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ OMX_PARAM_SENSORMODETYPE sensorModeType;
+ sensorModeType.nSize = sizeof(OMX_PARAM_SENSORMODETYPE);
+ sensorModeType.nVersion = KOmxVersion;
+ sensorModeType.nPortIndex = OMX_ALL;
+ OMX_ERRORTYPE error = component->GetParameter(component,OMX_IndexParamCommonSensorMode,&sensorModeType);
+ if(error)
+ {
+ FailWithOmxError(_L("GetParameter()"), error);
+ return EFalse;
+ }
+
+ sensorModeType.bOneShot = aIsOneShot ? static_cast<OMX_BOOL>(ETrue) : static_cast<OMX_BOOL>(EFalse);
+ error = component->SetParameter(component,OMX_IndexParamCommonSensorMode,&sensorModeType);
+
+ if(error != aExpectedError)
+ {
+ ERR_PRINTF3(_L("MosSetCameraOneShotL SetParameter() error 0x%X, expected 0x%X"), error, aExpectedError);
+ return EFalse;
+ }
+
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosSetCameraCaptureL(const TDesC8& aComp, TInt aPortIndex, TInt aIsCapturing, OMX_ERRORTYPE aExpectedError)
+ {
+ //TODO DL
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ OMX_SYMBIAN_CONFIG_BOOLEANTYPE isCapturing;
+ isCapturing.nSize = sizeof(OMX_SYMBIAN_CONFIG_BOOLEANTYPE);
+ isCapturing.nVersion = KOmxVersion;
+ isCapturing.nPortIndex = aPortIndex;
+ OMX_INDEXTYPE index;
+ isCapturing.bEnabled = aIsCapturing ? OMX_TRUE : OMX_FALSE;
+
+ OMX_ERRORTYPE check = OMX_GetExtensionIndex(component,"OMX.Symbian.Index.Config.Common.ExtCapturing",&index);
+
+ if(check != OMX_ErrorNone)
+ {
+ return EFalse;
+ }
+
+ OMX_ERRORTYPE error = component->SetConfig(component,/*(OMX_INDEXTYPE)*/index,&isCapturing);
+
+ if(error != aExpectedError)
+ {
+ ERR_PRINTF3(_L("MosSetCameraCaptureL SetConfig() error 0x%X, expected 0x%X"), error, aExpectedError);
+ return EFalse;
+ }
+
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosSetVideoPortDefL(const TDesC8& aComp, TInt aPortIndex, TInt aWidth, TInt aHeight, OMX_COLOR_FORMATTYPE* aColorFormat, OMX_VIDEO_CODINGTYPE* aCodingType, TInt aStride, TReal aFps, OMX_ERRORTYPE aExpectedError)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ OMX_PARAM_PORTDEFINITIONTYPE portDef;
+ portDef.nSize = sizeof(portDef);
+ portDef.nVersion = KOmxVersion;
+ portDef.nPortIndex = aPortIndex;
+ OMX_ERRORTYPE error = component->GetParameter(component, OMX_IndexParamPortDefinition, &portDef);
+ if(error)
+ {
+ FailWithOmxError(_L("GetParameter()"), error);
+ return EFalse;
+ }
+ if(aWidth != -1)
+ {
+ portDef.format.video.nFrameWidth = aWidth;
+ }
+ if(aHeight != -1)
+ {
+ portDef.format.video.nFrameHeight = aHeight;
+ }
+
+ if (aColorFormat)
+ {
+ portDef.format.video.eColorFormat = *aColorFormat;
+ }
+
+ if (aCodingType)
+ {
+ portDef.format.video.eCompressionFormat = *aCodingType;
+ }
+
+ if(aStride != -1)
+ {
+ portDef.format.video.nStride = aStride;
+ }
+#ifndef HREF_ED_WITHOUT_FLOATING_POINT
+ if(aFps != -1)
+ {
+ //TODO Fixup by removing below camera case, once camera team make appropiate changes to validateframerate function.
+ //Currently the camera function only allows fps >=15 AND <=120 and it isnt in the Q16 format that is required.
+ //Leave in the next two lines uncommented.
+ //TUint32 fpsQ16 = (TUint32) (aFps * 65536 + 0.5);
+ //portDef.format.video.xFramerate = fpsQ16;
+ //Changed xml file from 10fps to 15fps due to camera constraint.Will need to be changed back also
+ //BEGIN HACK CODE
+ _LIT8(KCamera,"OMX.SYMBIAN.VIDEO.CAMERASOURCE");
+ _LIT8(KLogicalILCamera,"OMX.SYMBIAN.LOGICAL.VIDEO.CAMERASOURCE");
+ TBool cameraTest = EFalse;
+ for(TInt index = 0, count = iComponents.Count(); index < count; index++)
+ {
+ const CComponentInfo* componentInfo = iComponents[index];
+ if(componentInfo->iComponent == component)
+ {
+ if((*(componentInfo->iComponentName) == KCamera)||(*(componentInfo->iComponentName) == KLogicalILCamera))
+ {
+ portDef.format.video.xFramerate = aFps;
+ cameraTest = ETrue;
+ }
+ break;
+ }
+ }
+ if(cameraTest == EFalse)
+ {
+ TUint32 fpsQ16 = (TUint32) (aFps * 65536 + 0.5);
+ portDef.format.video.xFramerate = fpsQ16;
+ }
+ }
+ //END HACK CODE.
+#else
+ portDef.format.video.xFramerate = 0;
+#endif //HREF_ED_WITHOUT_FLOATING_POINT
+ error = component->SetParameter(component, OMX_IndexParamPortDefinition, &portDef);
+ if(error != aExpectedError)
+ {
+ ERR_PRINTF3(_L("MosSetVideoPortDefL SetParameter() error 0x%X, expected 0x%X"), error, aExpectedError);
+ return EFalse;
+ }
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosCheckStateL(const TDesC8& aComp, OMX_STATETYPE aState)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+ OMX_STATETYPE state;
+ OMX_ERRORTYPE error = component->GetState(component, &state);
+ if(error)
+ {
+ FailWithOmxError(_L("GetState()"), error);
+ return EFalse;
+ }
+ if(state != aState)
+ {
+ TBuf<64> compConverted;
+ compConverted.Copy(aComp);
+ ERR_PRINTF4(_L("Expected component %S to be in state %S, actually in %S"), &compConverted, StateDes(aState), StateDes(state));
+ StopTest(EFail);
+ return EFalse;
+ }
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosCheckVideoPortDefL(const TDesC8& aComp, TInt aPortIndex, TInt aWidth, TInt aHeight, OMX_VIDEO_CODINGTYPE aCoding, OMX_COLOR_FORMATTYPE aColorFormat)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+ OMX_PARAM_PORTDEFINITIONTYPE portDef;
+ portDef.nSize = sizeof(portDef);
+ portDef.nVersion = KOmxVersion;
+ portDef.nPortIndex = aPortIndex;
+ OMX_ERRORTYPE error = component->GetParameter(component, OMX_IndexParamPortDefinition, &portDef);
+ if(error)
+ {
+ FailWithOmxError(_L("GetParameter()"), error);
+ return EFalse;
+ }
+ OMX_VIDEO_PORTDEFINITIONTYPE& vidDef = portDef.format.video;
+ if( vidDef.nFrameWidth == aWidth &&
+ vidDef.nFrameHeight == aHeight &&
+ vidDef.eCompressionFormat == aCoding &&
+ vidDef.eColorFormat == aColorFormat)
+ {
+ return ETrue;
+ }
+ else
+ {
+ ERR_PRINTF1(_L("video port definition did not match expected values"));
+ StopTest(EFail);
+ return EFalse;
+ }
+ }
+
+TBool ROmxScriptTest::MosCheckMetaDataL(const TDesC8& aComp, TInt aPortIndex, OMX_METADATASCOPETYPE aScope, const TDesC8& aAtomType, TUint32 aAtomIndex, const TDesC8& aData)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ OMX_CONFIG_METADATAITEMTYPE* metadata = reinterpret_cast<OMX_CONFIG_METADATAITEMTYPE*>(new(ELeave) TUint8[102400]);
+ CleanupStack::PushL(metadata);
+
+ metadata->nSize = 102400;
+ metadata->nVersion = KOmxVersion;
+ metadata->eScopeMode = aScope;
+ metadata->nScopeSpecifier = aPortIndex;
+ metadata->nMetadataItemIndex = aAtomIndex;
+ metadata->nKeySizeUsed = aAtomType.Length();
+
+ TPtr8 keyDes(metadata->nKey, metadata->nKeySizeUsed);
+ keyDes = aAtomType;
+
+ metadata->nValueMaxSize = metadata->nSize - _FOFF(OMX_CONFIG_METADATAITEMTYPE, nValue);
+
+ OMX_ERRORTYPE error = component->GetParameter(component, OMX_IndexConfigMetadataItem, metadata);
+ if(error)
+ {
+ CleanupStack::PopAndDestroy(metadata);
+ FailWithOmxError(_L("GetParameter()"), error);
+ return EFalse;
+ }
+
+ TPtrC8 valueDes(metadata->nValue, metadata->nValueSizeUsed);
+ if(valueDes.Compare(aData) == 0)
+ {
+ CleanupStack::PopAndDestroy(metadata);
+ return ETrue;
+ }
+ else
+ {
+ ERR_PRINTF1(_L("Did not read metedata"));
+ CleanupStack::PopAndDestroy(metadata);
+ StopTest(EFail);
+ return EFalse;
+ }
+ }
+
+TBool ROmxScriptTest::MosGetParameterUnknownIndexTypeL(const TDesC8& aComp, TInt aPortIndex, OMX_METADATASCOPETYPE aScope, const TDesC8& aAtomType, TUint32 aAtomIndex, const TDesC8& /*aData*/)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ OMX_CONFIG_METADATAITEMTYPE* metadata = reinterpret_cast<OMX_CONFIG_METADATAITEMTYPE*>(new(ELeave) TUint8[102400]);
+ CleanupStack::PushL(metadata);
+
+ metadata->nSize = 102400;
+ metadata->nVersion = KOmxVersion;
+ metadata->eScopeMode = aScope;
+ metadata->nScopeSpecifier = aPortIndex;
+ metadata->nMetadataItemIndex = aAtomIndex;
+ metadata->nKeySizeUsed = aAtomType.Length();
+
+ TPtr8 keyDes(metadata->nKey, metadata->nKeySizeUsed);
+ keyDes = aAtomType;
+
+ metadata->nValueMaxSize = metadata->nSize - _FOFF(OMX_CONFIG_METADATAITEMTYPE, nValue);
+
+ OMX_ERRORTYPE error = component->GetParameter(component, OMX_IndexParamAudioG723, metadata);
+ INFO_PRINTF2(_L("MosGetParameterUnknownIndexTypeL: %d"), error);
+
+ CleanupStack::PopAndDestroy(metadata);
+
+ if(error)
+ {
+ // This is what we expected
+ return ETrue;
+ }
+
+ ERR_PRINTF1(_L("MosGetParameterUnknownIndexTypeL unexpectedly received OMX_ErrorNone"));
+ StopTest(EFail);
+ return EFalse;
+ }
+
+TBool ROmxScriptTest::MosSetParameterUnknownIndexTypeL(const TDesC8& aComp, TInt aPortIndex, OMX_METADATASCOPETYPE aScope, const TDesC8& aAtomType, TUint32 aAtomIndex, const TDesC8& /*aData*/)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ OMX_CONFIG_METADATAITEMTYPE* metadata = reinterpret_cast<OMX_CONFIG_METADATAITEMTYPE*>(new(ELeave) TUint8[102400]);
+ CleanupStack::PushL(metadata);
+
+ metadata->nSize = 102400;
+ metadata->nVersion = KOmxVersion;
+ metadata->eScopeMode = aScope;
+ metadata->nScopeSpecifier = aPortIndex;
+ metadata->nMetadataItemIndex = aAtomIndex;
+ metadata->nKeySizeUsed = aAtomType.Length();
+
+ TPtr8 keyDes(metadata->nKey, metadata->nKeySizeUsed);
+ keyDes = aAtomType;
+
+ metadata->nValueMaxSize = metadata->nSize - _FOFF(OMX_CONFIG_METADATAITEMTYPE, nValue);
+
+ OMX_ERRORTYPE error = component->SetParameter(component, OMX_IndexParamAudioG723, metadata);
+
+ CleanupStack::PopAndDestroy(metadata);
+
+ if(error)
+ {
+ // This is what we expected
+ return ETrue;
+ }
+
+ ERR_PRINTF1(_L("MosSetParameterUnknownIndexTypeL unexpectedly received OMX_ErrorNone"));
+ StopTest(EFail);
+ return EFalse;
+ }
+TBool ROmxScriptTest::MosDisablePort(const TDesC8& aComp, TInt aPortIndex)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ OMX_ERRORTYPE error = component->SendCommand(component, OMX_CommandPortDisable, aPortIndex, NULL);
+ if(error)
+ {
+ FailWithOmxError(aComp, _L("OMX_SendCommand(OMX_CommandPortDisable)"), error);
+ return EFalse;
+ }
+
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosEnablePort(const TDesC8& aComp, TInt aPortIndex)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ OMX_ERRORTYPE error = component->SendCommand(component, OMX_CommandPortEnable, aPortIndex, NULL);
+ if(error)
+ {
+ FailWithOmxError(aComp, _L("OMX_SendCommand(OMX_CommandPortEnable)"), error);
+ return EFalse;
+ }
+
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosIgnoreEventL(const TDesC8& aComp, OMX_EVENTTYPE aEvent, TUint32 aData1, TUint32 aData2)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ TExpectedEvent event;
+ event.iComponent = component;
+ event.iEvent = aEvent;
+ event.iData1 = aData1;
+ event.iData2 = aData2;
+ event.iEventData = NULL;
+ iIgnoredEvents.AppendL(event);
+
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosSetPcmAudioPortDefL(const TDesC8& aComp,
+ TInt aPortIndex,
+ TInt aNumChannels,
+ TInt aSamplingRate,
+ TInt aBitsperSample,
+ OMX_NUMERICALDATATYPE aNumData,
+ OMX_ENDIANTYPE aEndian,
+ OMX_BOOL* aInterleaved,
+ const TDesC8* aEncoding )
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ OMX_AUDIO_PARAM_PCMMODETYPE pcmModeType;
+ pcmModeType.nSize = sizeof(pcmModeType);
+ pcmModeType.nVersion = KOmxVersion;
+ pcmModeType.nPortIndex = aPortIndex;
+ OMX_ERRORTYPE error = component->GetParameter(component, OMX_IndexParamAudioPcm, &pcmModeType);
+ if(error)
+ {
+ FailWithOmxError(_L("GetParameter()"), error);
+ return EFalse;
+ }
+ if(aNumChannels != KErrNotFound)
+ {
+ pcmModeType.nChannels = aNumChannels;
+ }
+ if(aSamplingRate != KErrNotFound)
+ {
+ pcmModeType.nSamplingRate = aSamplingRate;
+ }
+ if(aBitsperSample != KErrNotFound)
+ {
+ pcmModeType.nBitPerSample = aBitsperSample;
+ }
+ if((aNumData != OMX_NumercialDataMax) && (aNumData != KErrNotFound))
+ {
+ pcmModeType.eNumData = aNumData;
+ }
+ if((aEndian != OMX_EndianMax) && (aEndian != KErrNotFound))
+ {
+ pcmModeType.eEndian = aEndian;
+ }
+ if(aInterleaved != NULL)
+ {
+ pcmModeType.bInterleaved = *aInterleaved;
+ }
+ if (aEncoding)
+ {
+ if (*aEncoding==_L8("linear")) pcmModeType.ePCMMode = OMX_AUDIO_PCMModeLinear;
+ else if (*aEncoding==_L8("alaw")) pcmModeType.ePCMMode = OMX_AUDIO_PCMModeALaw;
+ else if (*aEncoding==_L8("mulaw")) pcmModeType.ePCMMode = OMX_AUDIO_PCMModeMULaw;
+ else FailWithOmxError(_L("Invalid PCM encoding parameter"), OMX_ErrorBadParameter);
+ }
+ error = component->SetParameter(component, OMX_IndexParamAudioPcm, &pcmModeType);
+ if(error)
+ {
+ FailWithOmxError(_L("SetParameter()"), error);
+ return EFalse;
+ }
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosSetConfigAudioMuteL(const TDesC8& aComp,
+ TInt aPortIndex,
+ TBool aMute)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ OMX_AUDIO_CONFIG_MUTETYPE audioMuteType;
+ audioMuteType.nSize = sizeof(audioMuteType);
+ audioMuteType.nVersion = KOmxVersion;
+ audioMuteType.nPortIndex = aPortIndex;
+ OMX_ERRORTYPE error = component->GetConfig(component, OMX_IndexConfigAudioMute, &audioMuteType);
+ if(error)
+ {
+ FailWithOmxError(_L("GetConfig()"), error);
+ return EFalse;
+ }
+ audioMuteType.bMute = (aMute ? OMX_TRUE : OMX_FALSE);
+
+ error = component->SetConfig(component, OMX_IndexConfigAudioMute, &audioMuteType);
+ if(error)
+ {
+ FailWithOmxError(_L("SetConfig()"), error);
+ return EFalse;
+ }
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosCheckConfigAudioMuteL(const TDesC8& aComp,
+ TInt aPortIndex,
+ TBool aMute)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ User::Leave(KErrGeneral);
+ }
+
+ OMX_AUDIO_CONFIG_MUTETYPE audioMuteType;
+ audioMuteType.nSize = sizeof(audioMuteType);
+ audioMuteType.nVersion = KOmxVersion;
+ audioMuteType.nPortIndex = aPortIndex;
+ OMX_ERRORTYPE error = component->GetConfig(component, OMX_IndexConfigAudioMute, &audioMuteType);
+ if(error)
+ {
+ FailWithOmxError(_L("GetConfig()"), error);
+ return EFalse;
+ }
+
+ if(audioMuteType.bMute != aMute)
+ {
+ ERR_PRINTF1(_L("Mute not what expected."));
+ StopTest(KErrGeneral, EFail);
+ return EFalse;
+ }
+ return ETrue;
+ }
+
+
+
+
+TBool ROmxScriptTest::MosSetConfigAudioVolumeL(const TDesC8& aComp,
+ TInt aPortIndex,
+ TBool aLinear,
+ TInt aMinVolume,
+ TInt aMaxVolume,
+ TInt aVolume,
+ OMX_ERRORTYPE aExpectedError)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ OMX_AUDIO_CONFIG_VOLUMETYPE audioVolumeType;
+ audioVolumeType.nSize = sizeof(audioVolumeType);
+ audioVolumeType.nVersion = KOmxVersion;
+ audioVolumeType.nPortIndex = aPortIndex;
+ OMX_ERRORTYPE error = component->GetConfig(component, OMX_IndexConfigAudioVolume, &audioVolumeType);
+ if(error)
+ {
+ FailWithOmxError(_L("GetConfig()"), error);
+ return EFalse;
+ }
+ if(aMinVolume != -1)
+ {
+ audioVolumeType.sVolume.nMin = aMinVolume;
+ }
+ if(aMaxVolume != -1)
+ {
+ audioVolumeType.sVolume.nMax = aMaxVolume;
+ }
+ if(aVolume != -1)
+ {
+ audioVolumeType.sVolume.nValue = aVolume;
+ }
+ audioVolumeType.bLinear = (aLinear ? OMX_TRUE : OMX_FALSE);
+
+ error = component->SetConfig(component, OMX_IndexConfigAudioVolume, &audioVolumeType);
+ if(error != aExpectedError)
+ {
+ FailWithOmxError(_L("SetConfig()"), error);
+ return EFalse;
+ }
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosCheckConfigAudioVolumeL(const TDesC8& aComp,
+ TInt aPortIndex,
+ TBool aLinear,
+ TInt aMinVolume,
+ TInt aMaxVolume,
+ TInt aVolume)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ User::Leave(KErrGeneral);
+ }
+
+ OMX_AUDIO_CONFIG_VOLUMETYPE audioVolumeType;
+ audioVolumeType.nSize = sizeof(audioVolumeType);
+ audioVolumeType.nVersion = KOmxVersion;
+ audioVolumeType.nPortIndex = aPortIndex;
+ OMX_ERRORTYPE error = component->GetConfig(component, OMX_IndexConfigAudioVolume, &audioVolumeType);
+ if(error)
+ {
+ FailWithOmxError(_L("GetConfig()"), error);
+ User::Leave(KErrGeneral);
+ }
+ if(aMinVolume != -1)
+ {
+ if (audioVolumeType.sVolume.nMin != aMinVolume)
+ {
+ ERR_PRINTF1(_L("Min volume not what expected."));
+ StopTest(KErrGeneral, EFail);
+ return EFalse;
+ }
+ }
+ if(aMaxVolume != -1)
+ {
+ if (audioVolumeType.sVolume.nMax != aMaxVolume)
+ {
+ ERR_PRINTF1(_L("Max volume not what expected."));
+ StopTest(KErrGeneral, EFail);
+ return EFalse;
+ }
+ }
+ if(aVolume != -1)
+ {
+ if (audioVolumeType.sVolume.nValue != aVolume)
+ {
+ ERR_PRINTF1(_L("Volume not what expected."));
+ StopTest(KErrGeneral, EFail);
+ return EFalse;
+ }
+ }
+ if(audioVolumeType.bLinear != aLinear)
+ {
+ ERR_PRINTF1(_L("Linear not what expected."));
+ StopTest(KErrGeneral, EFail);
+ return EFalse;
+ }
+ return ETrue;
+ }
+
+
+TBool ROmxScriptTest::MosSetAacAudioPortDefL(const TDesC8& aComp, TInt aPortIndex, TInt aNumChannels, TInt aSamplingRate, TInt aBitRate, TInt aAudioBandwidth, TInt aFrameLength, TInt aAacTools, TInt aAacErTools, TInt aProfile, TInt aStreamFormat, TInt aChannelMode)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ OMX_AUDIO_PARAM_AACPROFILETYPE aacProfile;
+ aacProfile.nSize = sizeof(aacProfile);
+ aacProfile.nVersion = KOmxVersion;
+ aacProfile.nPortIndex = aPortIndex;
+ OMX_ERRORTYPE error = component->GetParameter(component, OMX_IndexParamAudioAac, &aacProfile);
+ if(error)
+ {
+ FailWithOmxError(_L("GetParameter()"), error);
+ return EFalse;
+ }
+
+ if(aNumChannels != -1)
+ {
+ aacProfile.nChannels = aNumChannels;
+ }
+ if(aSamplingRate != -1)
+ {
+ aacProfile.nSampleRate = aSamplingRate;
+ }
+ if(aBitRate != -1)
+ {
+ aacProfile.nBitRate = aBitRate;
+ }
+ if(aAudioBandwidth != -1)
+ {
+ aacProfile.nAudioBandWidth = aAudioBandwidth;
+ }
+ if(aFrameLength != -1)
+ {
+ aacProfile.nFrameLength = aFrameLength;
+ }
+ if(aAacTools != -1)
+ {
+ aacProfile.nAACtools = aAacTools;
+ }
+ if(aAacErTools != -1)
+ {
+ aacProfile.nAACERtools = aAacErTools;
+ }
+ if(aProfile != -1)
+ {
+ aacProfile.eAACProfile = static_cast<OMX_AUDIO_AACPROFILETYPE>(aProfile);
+ }
+ if(aStreamFormat != -1)
+ {
+ aacProfile.eAACStreamFormat = static_cast<OMX_AUDIO_AACSTREAMFORMATTYPE>(aStreamFormat);
+ }
+ if(aChannelMode != -1)
+ {
+ aacProfile.eChannelMode = static_cast<OMX_AUDIO_CHANNELMODETYPE>(aChannelMode);
+ }
+
+ error = component->SetParameter(component, OMX_IndexParamAudioAac, &aacProfile);
+ if(error)
+ {
+ FailWithOmxError(_L("SetParameter()"), error);
+ return EFalse;
+ }
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosSetAudioPortDefL(const TDesC8& aComp, TInt aPortIndex, OMX_AUDIO_CODINGTYPE* aCodingType, OMX_ERRORTYPE aExpectedError)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ OMX_PARAM_PORTDEFINITIONTYPE portDef;
+ portDef.nSize = sizeof(portDef);
+ portDef.nVersion = KOmxVersion;
+ portDef.nPortIndex = aPortIndex;
+ OMX_ERRORTYPE error = component->GetParameter(component, OMX_IndexParamPortDefinition, &portDef);
+ if(error)
+ {
+ FailWithOmxError(_L("GetParameter()"), error);
+ return EFalse;
+ }
+ if(aCodingType)
+ {
+ portDef.format.audio.eEncoding = *aCodingType;
+ }
+ error = component->SetParameter(component, OMX_IndexParamPortDefinition, &portDef);
+ if(error != aExpectedError)
+ {
+ TBuf<64> errorDes;
+ OMXUtil::ErrorDes(error, errorDes);
+ TBuf<64> expectedErrorDes;
+ OMXUtil::ErrorDes(aExpectedError, expectedErrorDes);
+ ERR_PRINTF4(_L("SetParameter(OMX_IndexParamPortDefinition) portDef.format.audio.eEncoding %d returned %S but expected %S OMX_ErrorOverflow or OMX_ErrorUnsupportedSetting"),
+ portDef.format.audio.eEncoding, &errorDes, &expectedErrorDes);
+ StopTest(EFail);
+ return EFalse;
+ }
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosSetRefClockTypeL(const TDesC8& aComp, OMX_TIME_REFCLOCKTYPE aRefClockType)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE conf;
+ conf.nVersion = KOmxVersion;
+ conf.nSize = sizeof(conf);
+ conf.eClock = aRefClockType;
+
+ OMX_ERRORTYPE error = component->SetConfig(component, OMX_IndexConfigTimeActiveRefClock, &conf);
+ if(error != OMX_ErrorNone)
+ {
+ FailWithOmxError(_L("OMX_SetConfig(OMX_IndexConfigTimeActiveRefClock)"), error);
+ return EFalse;
+ }
+
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosSetClockTimeScale(const TDesC8& aComp, OMX_S32 aScale)
+{
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ INFO_PRINTF2(_L("MosSetClockTimeScale %d"), aScale);
+
+ OMX_TIME_CONFIG_SCALETYPE conf;
+ conf.nSize = sizeof(conf);
+ conf.nVersion = KOmxVersion;
+ conf.xScale = aScale;
+
+ OMX_ERRORTYPE error = component->SetConfig(component, OMX_IndexConfigTimeScale, &conf);
+ if(error != OMX_ErrorNone)
+ {
+ FailWithOmxError(_L("OMX_SetConfig(OMX_IndexConfigTimeClockState)"), error);
+ return EFalse;
+ }
+
+ return ETrue;
+}
+
+TBool ROmxScriptTest::MosSetClockStateL(const TDesC8& aComp, OMX_TIME_CLOCKSTATE aClockState, TInt aStartTime, TInt aOffset, TUint32 aWaitMask)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ OMX_TIME_CONFIG_CLOCKSTATETYPE conf;
+ conf.nVersion = KOmxVersion;
+ conf.nSize = sizeof(conf);
+ conf.eState = aClockState;
+ conf.nStartTime = aStartTime;
+ conf.nOffset = aOffset;
+ conf.nWaitMask = aWaitMask;
+
+ OMX_ERRORTYPE error = component->SetConfig(component, OMX_IndexConfigTimeClockState, &conf);
+ if(error != OMX_ErrorNone)
+ {
+ FailWithOmxError(_L("OMX_SetConfig(OMX_IndexConfigTimeClockState)"), error);
+ return EFalse;
+ }
+
+ return ETrue;
+ }
+
+// Buffer component handler
+TBool ROmxScriptTest::InitialiseBufferHandlerL(const TDesC8& aComp, TDesC& aName, const TDesC8* aType)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ // Buffer component
+ _LIT8(extensionBuf1, "OMX.SYMBIAN.INDEX.PARAM.BUFFERCHUNK");
+ TBuf8<45> extension;
+ extension.Copy(extensionBuf1);
+
+ OMX_INDEXTYPE indexType = OMX_IndexMax;
+ OMX_ERRORTYPE error = component->GetExtensionIndex(component, (OMX_STRING) extension.PtrZ(), &indexType);
+ if (error != OMX_ErrorNone)
+ {
+ FailWithOmxError(_L("GetExtensionIndex"), error);
+ return EFalse;
+ }
+
+ OMX_SYMBIAN_PARAM_3PLANE_CHUNK_DATA chunkData;
+ chunkData.nSize = sizeof(chunkData);
+ chunkData.nVersion = KOmxVersion;
+ chunkData.nPortIndex = 0;
+ error = component->GetParameter(component, indexType, &chunkData);
+ if (error != OMX_ErrorNone)
+ {
+ FailWithOmxError(_L("GetParameter"), error);
+ return EFalse;
+ }
+
+ OMX_PARAM_PORTDEFINITIONTYPE portDef;
+ portDef.nSize = sizeof(portDef);
+ portDef.nVersion = KOmxVersion;
+ portDef.nPortIndex = 0;
+
+ error = component->GetParameter(component, OMX_IndexParamPortDefinition, &portDef);
+ if(error != OMX_ErrorNone)
+ {
+ FailWithOmxError(_L("GetParameter"), error);
+ return EFalse;
+ }
+
+ OMX_SYMBIAN_PARAM_BUFFER_SIZE bufferSize;
+ bufferSize.nSize = sizeof(bufferSize);
+ bufferSize.nVersion = KOmxVersion;
+ bufferSize.nPortIndex = 0;
+
+ error = component->GetParameter(component, static_cast<OMX_INDEXTYPE>(OMX_SymbianIndexParamBufferSize), &bufferSize);
+
+ if(error != OMX_ErrorNone)
+ {
+ FailWithOmxError(_L("GetParameter"), error);
+ return EFalse;
+ }
+
+ if ((aType != NULL) && (*aType == _L8("mpeg4")))
+ {
+ iBufferHandler = CVideoBufferHandlerMPEG4::NewL(aName, chunkData, bufferSize, portDef);
+ }
+ else
+ {
+ iBufferHandler = CVideoBufferHandler::NewL(aName, chunkData, bufferSize, portDef);
+ }
+
+ return ETrue;
+ }
+
+void ROmxScriptTest::StartBufferHandler()
+ {
+ if ( !iBufferHandler )
+ {
+ ERR_PRINTF1(_L("ROmxScriptTest::StartBufferHander() Exception: Buffer handler not created"));
+ StopTest(EFail);
+ }
+
+ iBufferHandler->Start();
+ }
+
+
+void ROmxScriptTest::SendInvalidBufferId(TInt aInvalidId)
+ {
+ if ( !iBufferHandler )
+ {
+ ERR_PRINTF1(_L("ROmxScriptTest::SendInvalidBufferId() Exception: Buffer handler not created"));
+ StopTest(EFail);
+ }
+
+ iBufferHandler->SetSendInvalidBufferId(aInvalidId);
+ iBufferHandler->Start();
+ }
+
+
+
+
+void ROmxScriptTest::StopBufferHandler()
+ {
+ if ( !iBufferHandler )
+ {
+ ERR_PRINTF1(_L("ROmxScriptTest::StopBufferHandler() Exception: Buffer handler not stopped"));
+ StopTest(EFail);
+ }
+
+ iBufferHandler->Cancel();
+ }
+
+// Buffer sink component handler
+TBool ROmxScriptTest::InitialiseBufferSinkHandlerL(const TDesC8& aComp, TDesC& aName)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ // Buffer component
+ _LIT8(extensionBuf1, "OMX.SYMBIAN.INDEX.PARAM.BUFFERCHUNK");
+ TBuf8<45> extension;
+ extension.Copy(extensionBuf1);
+
+ OMX_INDEXTYPE indexType = OMX_IndexMax;
+ OMX_ERRORTYPE error = component->GetExtensionIndex(component, (OMX_STRING) extension.PtrZ(), &indexType);
+ if (error != OMX_ErrorNone)
+ {
+ FailWithOmxError(_L("GetExtensionIndex"), error);
+ return EFalse;
+ }
+
+ OMX_SYMBIAN_PARAM_3PLANE_CHUNK_DATA chunkData;
+ chunkData.nSize = sizeof(chunkData);
+ chunkData.nVersion = KOmxVersion;
+ chunkData.nPortIndex = 0;
+ error = component->GetParameter(component, indexType, &chunkData);
+ if (error != OMX_ErrorNone)
+ {
+ FailWithOmxError(_L("GetParameter"), error);
+ return EFalse;
+ }
+
+ OMX_PARAM_PORTDEFINITIONTYPE portDef;
+ portDef.nSize = sizeof(portDef);
+ portDef.nVersion = KOmxVersion;
+ portDef.nPortIndex = 0;
+
+ error = component->GetParameter(component, OMX_IndexParamPortDefinition, &portDef);
+ if(error != OMX_ErrorNone)
+ {
+ FailWithOmxError(_L("GetParameter"), error);
+ return EFalse;
+ }
+
+ OMX_SYMBIAN_PARAM_BUFFER_SIZE bufferSize;
+ bufferSize.nSize = sizeof(bufferSize);
+ bufferSize.nVersion = KOmxVersion;
+ bufferSize.nPortIndex = 0;
+
+ error = component->GetParameter(component, static_cast<OMX_INDEXTYPE>(OMX_SymbianIndexParamBufferSize), &bufferSize);
+
+ if(error != OMX_ErrorNone)
+ {
+ FailWithOmxError(_L("GetParameter"), error);
+ return EFalse;
+ }
+
+ iBufferSinkHandler = CVideoBufferSinkHandler::NewL(aName, chunkData, bufferSize, portDef);
+
+ return ETrue;
+ }
+
+void ROmxScriptTest::StartBufferSinkHandler()
+ {
+ if ( !iBufferSinkHandler )
+ {
+ ERR_PRINTF1(_L("ROmxScriptTest::StartBufferSinkHandler() Exception: Buffer sink handler not created"));
+ StopTest(EFail);
+ }
+
+ iBufferSinkHandler->Start();
+ }
+
+void ROmxScriptTest::StopBufferSinkHandler()
+ {
+ if ( !iBufferSinkHandler )
+ {
+ ERR_PRINTF1(_L("ROmxScriptTest::StopBufferSinkHandler() Exception: Buffer sink handler not stopped"));
+ StopTest(EFail);
+ }
+
+ iBufferSinkHandler->Cancel();
+ }
+
+TBool ROmxScriptTest::MosNegativeSetDataChunk(const TDesC8& aComp, OMX_ERRORTYPE aExpectedError, TInt /*aExpectedSystemError*/)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ // Buffer component
+ _LIT8(extensionBuf1, "OMX.SYMBIAN.INDEX.PARAM.BUFFERCHUNK");
+ TBuf8<45> extension;
+ extension.Copy(extensionBuf1);
+
+ OMX_INDEXTYPE indexType = OMX_IndexMax;
+ OMX_ERRORTYPE error = component->GetExtensionIndex(component, (OMX_STRING) extension.PtrZ(), &indexType);
+ if (error != OMX_ErrorNone)
+ {
+ FailWithOmxError(_L("GetExtensionIndex"), error);
+ return EFalse;
+ }
+
+ OMX_SYMBIAN_PARAM_3PLANE_CHUNK_DATA chunkData;
+ chunkData.nSize = sizeof(chunkData);
+ chunkData.nVersion = KOmxVersion;
+ chunkData.nPortIndex = 0;
+ error = component->GetParameter(component, indexType, &chunkData);
+
+ if (error != OMX_ErrorNone)
+ {
+ FailWithOmxError(_L("GetParameter"), error);
+ return EFalse;
+ }
+
+ if (NULL == chunkData.nChunk )
+ {
+ FailWithOmxError(_L("NULL TBufSrcComponentHandles"), OMX_ErrorInvalidState);
+ return EFalse;
+ }
+
+ chunkData.nChunk = 666;
+ error = component->SetParameter(component, indexType , &chunkData);
+
+ if (aExpectedError != error)
+ {
+ FailWithOmxError(_L("SetParameter"), error);
+ return EFalse;
+ }
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosChangeFilledBufferLength(const TDesC8& aComp, TInt aValue)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ iBufferHandler->ChangeFilledBufferLength(aValue);
+
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosSetOMX_SymbianIndexParamBufferMsgQueueData(const TDesC8& aComp, OMX_ERRORTYPE aExpectedError)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ OMX_SYMBIAN_PARAM_BUFFER_MSGQUEUE bufferMsgQueue;
+ bufferMsgQueue.nSize = sizeof(bufferMsgQueue);
+ bufferMsgQueue.nVersion = KOmxVersion;
+ bufferMsgQueue.nPortIndex = 0;
+
+ OMX_ERRORTYPE error = component->SetParameter(component, static_cast<OMX_INDEXTYPE>(OMX_SymbianIndexParamBufferMsgQueueData), &bufferMsgQueue);
+ if(aExpectedError != error)
+ {
+ ERR_PRINTF3(_L("MosSetOMX_SymbianIndexParamBufferMsgQueueData SetParameter() error 0x%X, expected 0x%X"), error, aExpectedError);
+ return EFalse;
+ }
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosSetBufferSize(const TDesC8& aComp, TInt aPortIndex, TInt aData, OMX_ERRORTYPE aExpectedError)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+ OMX_SYMBIAN_PARAM_BUFFER_SIZE bufferSize;
+ bufferSize.nSize = sizeof(bufferSize);
+ bufferSize.nVersion = KOmxVersion;
+ bufferSize.nPortIndex = aPortIndex;
+ bufferSize.nBufferSize = aData;
+
+ OMX_ERRORTYPE error = component->SetParameter(component, static_cast<OMX_INDEXTYPE>(OMX_SymbianIndexParamBufferSize), &bufferSize);
+ if(aExpectedError != error)
+ {
+ ERR_PRINTF3(_L("MosSetBufferSize SetParameter() error 0x%X, expected 0x%X"), error, aExpectedError);
+ return EFalse;
+ }
+ return ETrue;
+ }
+
+
+TBool ROmxScriptTest::MosGetAndCompareBufferCount(const TDesC8& aComp, TInt aPortIndex, TInt aDataToCompare)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ OMX_PARAM_PORTDEFINITIONTYPE portDef;
+ portDef.nVersion = KOmxVersion;
+ portDef.nSize = sizeof(portDef);
+ portDef.nPortIndex = aPortIndex;
+
+ OMX_ERRORTYPE error = component->GetParameter(component, OMX_IndexParamPortDefinition, &portDef);
+ if(error)
+ {
+ FailWithOmxError(_L("OMX_GetParameter()"), error);
+ return EFalse;
+ }
+ if (aDataToCompare != portDef.nBufferCountActual)
+ {
+ ERR_PRINTF3(_L("Compare buffer source count - expecting %d, actual %d"), aDataToCompare, portDef.nBufferCountActual);
+ return EFalse;
+ }
+
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosGetAndCompareBufferSize(const TDesC8& aComp, TInt aPortIndex, TInt aDataToCompare)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ OMX_SYMBIAN_PARAM_BUFFER_SIZE bufferSize;
+ bufferSize.nSize = sizeof(bufferSize);
+ bufferSize.nVersion = KOmxVersion;
+ bufferSize.nPortIndex = aPortIndex;
+
+ OMX_ERRORTYPE error = component->GetParameter(component, static_cast<OMX_INDEXTYPE>(OMX_SymbianIndexParamBufferSize), &bufferSize);
+ if(error)
+ {
+ FailWithOmxError(_L("OMX_GetParameter()"), error);
+ return EFalse;
+ }
+ if (bufferSize.nBufferSize != aDataToCompare)
+ {
+ ERR_PRINTF3(_L("Compare buffer source size - expecting %d, actual %d"), aDataToCompare, bufferSize.nBufferSize);
+ return EFalse;
+ }
+
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosSetVideoEncQuantL(const TDesC8& aComp, TInt aPortIndex, TInt aQpb)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ OMX_VIDEO_PARAM_QUANTIZATIONTYPE videoQuantization;
+ videoQuantization.nSize = sizeof(videoQuantization);
+ videoQuantization.nVersion = KOmxVersion;
+ videoQuantization.nPortIndex = aPortIndex;
+ videoQuantization.nQpB = aQpb;
+
+ OMX_ERRORTYPE error = component->SetParameter(component, static_cast<OMX_INDEXTYPE>(OMX_IndexParamVideoQuantization), &videoQuantization);
+ if(error)
+ {
+ FailWithOmxError(_L("MosSetVideoEncQuantL SetParameter()"), error);
+ return EFalse;
+ }
+
+ error = component->GetParameter(component, OMX_IndexParamVideoQuantization, &videoQuantization);
+ if(error)
+ {
+ FailWithOmxError(_L("MosSetVideoEncQuantL GetParameter()"), error);
+ return EFalse;
+ }
+
+ if (videoQuantization.nQpB != aQpb)
+ {
+ ERR_PRINTF3(_L("MosSetVideoEncQuantL Compare QPB failed - Got %d, Expected %d"), videoQuantization.nQpB, aQpb);
+ return EFalse;
+ }
+
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosSetVideoEncMotionVectL(const TDesC8& aComp, TInt aPortIndex,
+ TInt aAccuracy, TInt aSxSearchrange, TInt aSySearchrange, OMX_ERRORTYPE aExpectedError)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ OMX_VIDEO_PARAM_MOTIONVECTORTYPE motionVect;
+ motionVect.nSize = sizeof(motionVect);
+ motionVect.nVersion = KOmxVersion;
+ motionVect.nPortIndex = aPortIndex;
+ motionVect.eAccuracy = (OMX_VIDEO_MOTIONVECTORTYPE)aAccuracy;
+ motionVect.sXSearchRange = aSxSearchrange;
+ motionVect.sYSearchRange = aSySearchrange;
+
+ OMX_ERRORTYPE error = component->SetParameter(component, static_cast<OMX_INDEXTYPE>(OMX_IndexParamVideoMotionVector), &motionVect);
+ if(aExpectedError != error)
+ {
+ ERR_PRINTF3(_L("MosSetVideoEncMotionVectL SetParameter() returned error 0x%X, expected error 0x%X"), error, aExpectedError);
+ return EFalse;
+ }
+
+ if (aExpectedError)
+ {
+ return ETrue;
+ }
+
+ error = component->GetParameter(component, OMX_IndexParamVideoMotionVector, &motionVect);
+ if(error)
+ {
+ FailWithOmxError(_L("MosSetVideoEncMotionVectL GetParameter()"), error);
+ return EFalse;
+ }
+
+ if (motionVect.eAccuracy != aAccuracy || motionVect.sXSearchRange != aSxSearchrange ||
+ motionVect.sYSearchRange != aSySearchrange)
+ {
+ ERR_PRINTF1(_L("MosSetVideoEncMotionVectL GetParameter() did not return expeccted value"));
+ return EFalse;
+ }
+
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosSetVideoEncMpeg4TypeL(const TDesC8& aComp, TInt aPortIndex,
+ OMX_VIDEO_MPEG4PROFILETYPE aMpeg4Profile, OMX_VIDEO_MPEG4LEVELTYPE aMpeg4Level, OMX_ERRORTYPE aExpectedError)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ OMX_VIDEO_PARAM_MPEG4TYPE mpeg4;
+ mpeg4.nSize = sizeof(mpeg4);
+ mpeg4.nVersion = KOmxVersion;
+ mpeg4.nPortIndex = aPortIndex;
+ mpeg4.eProfile = aMpeg4Profile;
+ mpeg4.eLevel = aMpeg4Level;
+
+ OMX_ERRORTYPE error = component->SetParameter(component, static_cast<OMX_INDEXTYPE>(OMX_IndexParamVideoMpeg4), &mpeg4);
+ if(aExpectedError != error)
+ {
+ ERR_PRINTF3(_L("MosSetVideoEncMpeg4TypeL SetParameter() returned error 0x%X, expected error 0x%X"), error, aExpectedError);
+ return EFalse;
+ }
+ if (aExpectedError)
+ {
+ return ETrue;
+ }
+
+ error = component->GetParameter(component, OMX_IndexParamVideoMpeg4, &mpeg4);
+ if(error)
+ {
+ FailWithOmxError(_L("MosSetVideoEncMpeg4TypeL GetParameter()"), error);
+ return EFalse;
+ }
+
+ if (mpeg4.eProfile != aMpeg4Profile || mpeg4.eLevel != aMpeg4Level)
+ {
+ ERR_PRINTF1(_L("MosSetVideoEncMpeg4TypeL GetParameter() did not return expeccted value"));
+ return EFalse;
+ }
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosSetVideoEncBitRateL(const TDesC8& aComp, TInt aPortIndex,
+ OMX_VIDEO_CONTROLRATETYPE aControlRate, TInt aTargetBitrate, OMX_ERRORTYPE aExpectedError)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ OMX_VIDEO_PARAM_BITRATETYPE bitRate;
+ bitRate.nSize = sizeof(bitRate);
+ bitRate.nVersion = KOmxVersion;
+ bitRate.nPortIndex = aPortIndex;
+ bitRate.eControlRate = aControlRate;
+ bitRate.nTargetBitrate = aTargetBitrate;
+
+ OMX_ERRORTYPE error = component->SetParameter(component, static_cast<OMX_INDEXTYPE>(OMX_IndexParamVideoBitrate), &bitRate);
+ if(aExpectedError != error)
+ {
+ ERR_PRINTF3(_L("MosSetVideoEncBitRateL SetParameter() returned error 0x%X, expected error 0x%X"), error, aExpectedError);
+ return EFalse;
+ }
+ if (aExpectedError)
+ {
+ return ETrue;
+ }
+
+ error = component->GetParameter(component, OMX_IndexParamVideoBitrate, &bitRate);
+ if(error)
+ {
+ FailWithOmxError(_L("MosSetVideoEncBitRateL GetParameter()"), error);
+ return EFalse;
+ }
+
+ if (bitRate.eControlRate != aControlRate || bitRate.nTargetBitrate != aTargetBitrate)
+ {
+ ERR_PRINTF1(_L("MosSetVideoEncBitRateL GetParameter() did not return expeccted value"));
+ return EFalse;
+ }
+ return ETrue;
+ }
+
+void ROmxScriptTest::WriteInt32(TUint8* aPtr, TInt32 aData)
+ {
+ aPtr[0] = TUint8(aData>>24);
+ aPtr[1] = TUint8(aData>>16);
+ aPtr[2] = TUint8(aData>>8);
+ aPtr[3] = TUint8(aData);
+ }
+
+
+TBool ROmxScriptTest::ShortNameMatchComparison(const TDesC8* aShortName, const CComponentInfo& aComponentInfo)
+ {
+ if (*aShortName == *aComponentInfo.iShortName)
+ {
+ return ETrue;
+ }
+ return EFalse;
+ }
+
+TBool ROmxScriptTest::ComponentLogicalIL(const TDesC8& aName)
+ {
+ for(TInt index = 0, count = iComponents.Count(); index < count; index++)
+ {
+ CComponentInfo* component = iComponents[index];
+ if(*(component->iShortName) == aName)
+ {
+ if(component->iComponentName->FindC(KILTypeString()) == KErrNotFound)
+ {
+ // is not LIL
+ return EFalse;
+ }
+ else
+ {
+ // is LIL
+ return ETrue;
+ }
+ }
+ }
+ ERR_PRINTF1(_L("LogicalILComponent() - Component not found"));
+ StopTest(EFail);
+
+ return EFalse;
+ }
+
+TBool ROmxScriptTest::ComponentPhysicalIL(const TDesC8& aName)
+ {
+ for(TInt index = 0, count = iComponents.Count(); index < count; index++)
+ {
+ CComponentInfo* component = iComponents[index];
+ if(*(component->iShortName) == aName)
+ {
+ if(component->iComponentName->FindC(KILTypeString) == KErrNotFound)
+ {
+ // is PIL
+ return ETrue;
+ }
+ else
+ {
+ // is not PIL
+ return EFalse;
+ }
+ }
+ }
+ ERR_PRINTF1(_L("PhysicalILComponent() - Component not found"));
+ StopTest(EFail);
+
+ return EFalse;
+ }
+
+OMX_COMPONENTTYPE* ROmxScriptTest::ComponentByName(const TDesC8& aName)
+ {
+ for(TInt index = 0, count = iComponents.Count(); index < count; index++)
+ {
+ CComponentInfo* component = iComponents[index];
+ if(*(component->iShortName) == aName)
+ {
+ return component->iComponent;
+ }
+ }
+ HBufC* name = HBufC::New(aName.Length());
+ if(!name)
+ {
+ ERR_PRINTF1(_L("Component not found"));
+ StopTest(EFail);
+ }
+ else
+ {
+ name->Des().Copy(aName);
+ ERR_PRINTF2(_L("Component %S not found"), name);
+ delete name;
+ StopTest(EFail);
+ }
+ return NULL;
+ }
+
+
+
+void ROmxScriptTest::GetComponentName(const OMX_COMPONENTTYPE* aHandle, TDes& aName)
+ {
+ for(TInt index = 0, count = iComponents.Count(); index < count; index++)
+ {
+ const CComponentInfo* component = iComponents[index];
+ if(component->iComponent == aHandle)
+ {
+ aName.Copy(*(component->iShortName));
+ return;
+ }
+ }
+ ERR_PRINTF1(_L("Invalid component handle"));
+ StopTest(EFail);
+ aName = _L("<invalid handle>");
+ }
+
+void ROmxScriptTest::FailWithOmxError(const TDesC& aOperation, OMX_ERRORTYPE aError)
+ {
+ if(aError != OMX_ErrorNone)
+ {
+ TBuf<64> errorDes;
+ OMXUtil::ErrorDes(aError, errorDes);
+ ERR_PRINTF3(_L("%S returned %S"), &aOperation, &errorDes);
+ StopTest(EFail);
+ }
+ }
+
+void ROmxScriptTest::FailWithOmxError(const TDesC8& aComponent, const TDesC& aOperation, OMX_ERRORTYPE aError)
+ {
+ if(aError != OMX_ErrorNone)
+ {
+ TBuf<64> errorDes;
+ TBuf<64> componentDes16;
+ componentDes16.Copy(aComponent);
+ OMXUtil::ErrorDes(aError, errorDes);
+ ERR_PRINTF4(_L("%S->%S returned %S"), &componentDes16, &aOperation, &errorDes);
+ StopTest(EFail);
+ }
+ }
+
+void ROmxScriptTest::AllComponentsEOS()
+ {
+ EndWait();
+ }
+
+void ROmxScriptTest::AllComponentsTransitioned(OMX_STATETYPE aNewState,
+ OMX_STATETYPE aOldState)
+ {
+ __ASSERT_ALWAYS(aOldState == iState, User::Invariant());
+ iState = aNewState;
+ EndWait();
+ }
+
+void ROmxScriptTest::EventReceived(OMX_COMPONENTTYPE* aComponent, OMX_EVENTTYPE aEvent, TUint32 aData1, TUint32 aData2, TAny* aEventData)
+ {
+
+ if ((iMsgQueue.Handle()) && (aEvent == OMX_EventCmdComplete))
+ {
+ iMsgQueue.Close();
+ }
+
+
+ // If the Graphic Sink has created a surface, assign it to the window
+ if(aEvent == OMX_EventPortSettingsChanged)
+ {
+ if(aComponent == iGraphicSink)
+ {
+ if (aData1 == iExtSurfaceConfigIndex ||
+ aData1 == OMX_IndexConfigCommonScale ||
+ aData1 == OMX_IndexConfigCommonOutputSize ||
+ aData1 == OMX_IndexConfigCommonInputCrop ||
+ aData1 == OMX_IndexConfigCommonOutputCrop ||
+ aData1 == OMX_IndexConfigCommonExclusionRect)
+ {
+ INFO_PRINTF1(_L("Surface configuration changed"));
+
+ OMX_SYMBIAN_VIDEO_PARAM_SURFACECONFIGURATION surfaceConfigParam;
+ surfaceConfigParam.nSize = sizeof(OMX_SYMBIAN_VIDEO_PARAM_SURFACECONFIGURATION);
+ surfaceConfigParam.nVersion = KOmxVersion;
+ surfaceConfigParam.nPortIndex = 0;
+
+ OMX_ERRORTYPE omxError = aComponent->GetParameter(aComponent, iExtSurfaceConfigIndex, &surfaceConfigParam);
+ if(omxError != OMX_ErrorNone)
+ {
+ FailWithOmxError(_L("GetParameter(OMX_SymbianIndexParamVideoGFXSurfaceConfig)"), omxError);
+ return;
+ }
+ TSurfaceConfiguration& surfaceConfig = *reinterpret_cast<TSurfaceConfiguration*>(surfaceConfigParam.pSurfaceConfig);
+
+ OMX_PARAM_PORTDEFINITIONTYPE portDef;
+ portDef.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE);
+ portDef.nVersion = KOmxVersion;
+ portDef.nPortIndex = 0;
+ omxError = aComponent->GetParameter(aComponent, OMX_IndexParamPortDefinition, &portDef);
+ if(omxError != OMX_ErrorNone)
+ {
+ FailWithOmxError(_L("GetParameter(OMX_IndexParamPortDefinition)"), omxError);
+ return;
+ }
+ TSize inputSize(portDef.format.video.nFrameWidth, portDef.format.video.nFrameHeight);
+ INFO_PRINTF3(_L("Input size is %dx%d"), inputSize.iWidth, inputSize.iHeight);
+
+ TSurfaceId surfaceId;
+ surfaceConfig.GetSurfaceId(surfaceId);
+ TInt err = iWindowManager->RegisterSurface(surfaceId);
+ if(KErrNone != err)
+ {
+ ERR_PRINTF1(_L("RegisterSurface failed"));
+ StopTest(err, EFail);
+ }
+
+ // scale, rotate and centre to fit
+ // assumes square pixels
+
+ TSize screenSize = iWindowManager->ScreenSize();
+
+ TBool iInputLandscape = inputSize.iWidth > inputSize.iHeight;
+ TBool iScreenLandscape = screenSize.iWidth > screenSize.iHeight;
+
+ if (iVideoFitMode == EVideoFitRotateScaleAndCentre &&
+ (iInputLandscape ^ iScreenLandscape))
+ {
+ surfaceConfig.SetOrientation(CFbsBitGc::EGraphicsOrientationRotated270);
+ TInt tmp = inputSize.iWidth;
+ inputSize.iWidth = inputSize.iHeight;
+ inputSize.iHeight = tmp;
+ }
+
+ TRect rect;
+ if( iVideoFitMode == EVideoFitScaleAndCentre ||
+ iVideoFitMode == EVideoFitRotateScaleAndCentre)
+ {
+ if(!iScreenLandscape)
+ {
+ TInt displayHeight = screenSize.iWidth * inputSize.iHeight / inputSize.iWidth;
+ TInt top = screenSize.iHeight - displayHeight >> 1;
+ TInt bottom = top + displayHeight;
+ rect = TRect(0, top, screenSize.iWidth, bottom);
+ }
+ else
+ {
+ TInt displayWidth = screenSize.iHeight * inputSize.iWidth / inputSize.iHeight;
+ TInt left = screenSize.iWidth - displayWidth >> 1;
+ TInt right = left + displayWidth;
+ rect = TRect(left, 0, right, screenSize.iHeight);
+ }
+ }
+ else
+ {
+ TInt left = screenSize.iWidth - inputSize.iWidth >> 1;
+ TInt top = screenSize.iHeight - inputSize.iHeight >> 1;
+ rect = TRect(left, top, left + inputSize.iWidth, top + inputSize.iHeight);
+ }
+
+ surfaceConfig.SetExtent(rect);
+
+ err = iWindowManager->SetBackgroundSurface(surfaceConfig, ETrue);
+ if(KErrNone != err)
+ {
+ ERR_PRINTF2(_L("SetBackgroundSurface failed (%d)"), err);
+ StopTest(err, EFail);
+ return;
+ }
+ INFO_PRINTF1(_L("SetBackgroundSurface OK"));
+ iWindowManager->Flush();
+ return;
+ }
+ }
+ }
+
+ // ignore buffer flag events except EOS
+ if((aEvent == OMX_EventBufferFlag && (aData2 & OMX_BUFFERFLAG_EOS) == 0) /*|| (aEvent == OMX_EventNokiaFirstFrameDisplayed)*/)
+ {
+ return;
+ }
+
+ TInt index = 0;
+ TInt count = iExpectedEvents.Count();
+ for(; index < count; index++)
+ {
+ const TExpectedEvent& event = iExpectedEvents[index];
+ if( event.iComponent == aComponent &&
+ event.iEvent == aEvent &&
+ event.iData1 == aData1 &&
+ event.iData2 == aData2 &&
+ event.iEventData == aEventData)
+ {
+ break;
+ }
+ }
+ if(index == count)
+ {
+ // event was not expected, see if we can ignore this event
+ TInt count1 = iIgnoredEvents.Count();
+ TInt index1 = 0;
+ for(; index1 < count1; index1++)
+ {
+ const TExpectedEvent& event = iIgnoredEvents[index1];
+ if( event.iComponent == aComponent &&
+ event.iEvent == aEvent &&
+ event.iData1 == aData1 &&
+ event.iData2 == aData2 &&
+ event.iEventData == aEventData)
+ {
+ return;
+ }
+ }
+
+ // event was not expected and we can't ignore the event, so fail the test
+ TBuf<64> name;
+ GetComponentName(aComponent, name);
+ char hexBuf[11];
+ TBuf<32> eventWideChar;
+ eventWideChar.Copy(TPtrC8((unsigned char*) format_OMX_EVENTTYPE(aEvent, hexBuf)));
+ ERR_PRINTF2(_L("Unexpected event received from component %S"), &name);
+ ERR_PRINTF5(_L("aEvent=%S aData1=0x%08X aData2=0x%08X, aEventData=0x%08X"), &eventWideChar, aData1, aData2, aEventData);
+ StopTest(EFail);
+ return;
+ }
+ iExpectedEvents.Remove(index);
+ if(iWaitingForEvents && iExpectedEvents.Count() == 0)
+ {
+ EndWait();
+ }
+ }
+
+void ROmxScriptTest::ComponentTransitioned(OMX_STATETYPE aNewState,
+ OMX_STATETYPE aOldState)
+ {
+ __ASSERT_ALWAYS(aOldState == iState, User::Invariant());
+ iState = aNewState;
+ EndWait();
+ }
+
+void ROmxScriptTest::BufferDone(OMX_COMPONENTTYPE* aComponent, OMX_BUFFERHEADERTYPE* aBufHdr, TBool aSource)
+ {
+ if (iNonTunneledHandler)
+ {
+ iNonTunneledHandler->BufferDone(aComponent, aBufHdr, aSource);
+ }
+
+ if(iPortBufferHandler)
+ {
+ iPortBufferHandler->BufferDone(aComponent, aBufHdr, aSource);
+ }
+
+ }
+
+void ROmxScriptTest::TimerExpired()
+ {
+ EndWait();
+ }
+
+void ROmxScriptTest::HashFileL(const TDesC& aFileName, TDes8& aHash, void (*aFilter1)(RBuf8&), void (*aFilter2)(RBuf8&), void (*aFilter3)(RBuf8&))
+ {
+ const TInt KBufferSize = 1024;
+
+ RFs fs;
+ User::LeaveIfError(fs.Connect());
+ CleanupClosePushL(fs);
+
+ RFile file;
+ User::LeaveIfError(file.Open(fs, aFileName, EFileRead | EFileShareReadersOnly));
+ CleanupClosePushL(file);
+
+ RBuf8 buf;
+ User::LeaveIfError(buf.Create(KBufferSize));
+ CleanupClosePushL(buf);
+
+ CMD5* md5 = CMD5::NewL();
+ CleanupStack::PushL(md5);
+
+ while(true)
+ {
+ User::LeaveIfError(file.Read(buf));
+ if(buf.Length() == 0)
+ {
+ break;
+ }
+
+ if (aFilter1) aFilter1(buf);
+ if (aFilter2) aFilter2(buf);
+ if (aFilter3) aFilter3(buf);
+
+ md5->Hash(buf);
+ }
+
+ aHash = md5->Final();
+
+ CleanupStack::PopAndDestroy(4); // fs, file, buf, md5
+ }
+
+
+
+TBool ROmxScriptTest::HandleNonTunneledBuffers(OMX_STATETYPE aNewState, OMX_COMPONENTTYPE* aComp)
+ {
+ if (iNonTunneledHandler)
+ {
+ if (iState == OMX_StateLoaded && aNewState == OMX_StateIdle)
+ {
+ TRAPD(err, iNonTunneledHandler->AllocateBuffersL(aComp));
+ if (err != KErrNone)
+ {
+ ERR_PRINTF2(_L("Non-tunneled AllocateBuffersL failed (%d)"), err);
+ return EFalse;
+ }
+ }
+ else if (iState == OMX_StateIdle && aNewState == OMX_StateExecuting)
+ {
+ TRAPD(err, iNonTunneledHandler->FillBuffers(aComp));
+ if (err != KErrNone)
+ {
+ ERR_PRINTF2(_L("Non-tunneled FillBuffersL failed (%d)"), err);
+ return EFalse;
+ }
+ }
+ else if (iState == OMX_StateExecuting && aNewState == OMX_StateIdle)
+ {
+ TRAPD(err, iNonTunneledHandler->HoldBuffers(aComp));
+ if (err != KErrNone)
+ {
+ ERR_PRINTF2(_L("Non-tunneled HoldBuffersL failed (%d)"), err);
+ return EFalse;
+ }
+ }
+ else if (iState == OMX_StateIdle && aNewState == OMX_StateLoaded)
+ {
+ TRAPD(err, iNonTunneledHandler->FreeBuffers(aComp));
+ if (err != KErrNone)
+ {
+ ERR_PRINTF2(_L("Non-tunneled FreeBuffersL failed (%d)"), err);
+ return EFalse;
+ }
+ }
+ }
+
+ return ETrue;
+ }
+
+
+TBool ROmxScriptTest::HandlePortBufferHandler(OMX_STATETYPE aNewState, OMX_COMPONENTTYPE* aComp)
+ {
+ if(iPortBufferHandler)
+ {
+ if (iState == OMX_StateLoaded && aNewState == OMX_StateIdle)
+ {
+ TRAPD(err, iPortBufferHandler->AllocateBuffersL(aComp));
+ if (err != KErrNone)
+ {
+ ERR_PRINTF2(_L("PortBufferHandler AllocateBuffersL failed (%d)"), err);
+ return EFalse;
+ }
+ }
+ else if (iState == OMX_StateIdle && aNewState == OMX_StateExecuting)
+ {
+
+ }
+ else if (iState == OMX_StateExecuting && aNewState == OMX_StateIdle)
+ {
+ }
+ else if (iState == OMX_StateIdle && aNewState == OMX_StateLoaded)
+ {
+ TRAPD(err, iPortBufferHandler->FreeBuffers(aComp));
+ if (err != KErrNone)
+ {
+ ERR_PRINTF2(_L("PortBufferHandler FreeBuffersL failed (%d)"), err);
+ return EFalse;
+ }
+ }
+ }
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosFlushBuffer(const TDesC8& aComp, TInt aPortIndex, OMX_ERRORTYPE aExpectedError)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ OMX_ERRORTYPE error = component->SendCommand(component, OMX_CommandFlush, aPortIndex, NULL);
+ if(error != aExpectedError)
+ {
+ ERR_PRINTF3(_L("MosFlushBuffer SendCommand() error 0x%X, expected 0x%X"), error, aExpectedError);
+ return EFalse;
+ }
+
+ return ETrue;
+ }
+
+/*
+ * This is a test to force the buffer(s) to require being flushed.
+ */
+TBool ROmxScriptTest::MosForceBufferSourceFlushBufferL(const TDesC8& aComp, TInt aPortIndex, OMX_ERRORTYPE aExpectedError)
+ {
+ // setup the msg queue
+ TBuf<255> compWide;
+ compWide.Copy(aComp);
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ _LIT8(extensionBuf1, "OMX.SYMBIAN.INDEX.PARAM.BUFFERCHUNK");
+ TBuf8<45> extension;
+ extension.Copy(extensionBuf1);
+
+ OMX_INDEXTYPE indexType = OMX_IndexMax;
+ OMX_ERRORTYPE error = component->GetExtensionIndex(component, (OMX_STRING) extension.PtrZ(), &indexType);
+
+ if (error != OMX_ErrorNone)
+ {
+ FailWithOmxError(_L("GetExtensionIndex"), error);
+ return EFalse;
+ }
+
+ OMX_SYMBIAN_PARAM_3PLANE_CHUNK_DATA chunkData;
+
+ chunkData.nSize = sizeof(chunkData);
+ chunkData.nVersion = KOmxVersion;
+ chunkData.nPortIndex = 0;
+ error = component->GetParameter(component, indexType, &chunkData);
+
+ if (error != OMX_ErrorNone)
+ {
+ FailWithOmxError(_L("GetParameter"), error);
+ return EFalse;
+ }
+
+ if (NULL == chunkData.nChunk )
+ {
+ FailWithOmxError(_L("NULL TBufSrcComponentHandles"), OMX_ErrorInvalidState);
+ return EFalse;
+ }
+
+ OMX_SYMBIAN_PARAM_BUFFER_SIZE bufferSize;
+ bufferSize.nSize = sizeof(bufferSize);
+ bufferSize.nVersion = KOmxVersion;
+ bufferSize.nPortIndex = 0;
+ error = component->GetParameter(component, static_cast<OMX_INDEXTYPE>(OMX_SymbianIndexParamBufferSize), &bufferSize);
+
+ if(error != OMX_ErrorNone)
+ {
+ FailWithOmxError(_L("GetParameter"), error);
+ return EFalse;
+ }
+
+ RChunk msgsChunk;
+ msgsChunk.SetHandle(chunkData.nChunk);
+ CleanupClosePushL(msgsChunk);
+ User::LeaveIfError(msgsChunk.Duplicate(RThread()));
+
+ iMsgQueue.SetHandle(chunkData.nFilledBufferQueue);
+ User::LeaveIfError(iMsgQueue.Duplicate(RThread()));
+
+ // fill it up with 2 messages
+ TInt numMessages = 2; // change this to alter the number of buffers stacked up.
+ TInt message = 0;
+ TMMSharedChunkBufConfig bufConfig;
+ bufConfig.iNumBuffers = numMessages;
+ bufConfig.iBufferSizeInBytes = bufferSize.nBufferSize; //passed into ConstructL()
+ TUint8* chunkBase = msgsChunk.Base();
+ __ASSERT_ALWAYS(message < numMessages, User::Invariant());
+
+ TUint8* bufBase1 = chunkBase + (message * (bufConfig.iBufferSizeInBytes));
+ TFilledBufferHeaderV2 header1;
+ header1.iOffset = bufBase1 - chunkBase;
+ header1.iFilledLength = 3;
+ header1.iTimeStamp = 0;
+ header1.iFlags = ETrue ? OMX_BUFFERFLAG_STARTTIME : 0; //is the first buffer.
+
+ TInt sendError = iMsgQueue.Send(header1);
+
+ if (sendError != KErrNone)
+ {
+ ERR_PRINTF2(_L("MosForceBufferSourceFlushBuffer MsgQueue Send() error 0x%X"), sendError);
+ iMsgQueue.Close();
+ CleanupStack::PopAndDestroy(); // msgsChunk
+ return EFalse;
+ }
+
+ message++;
+ TUint8* bufBase2 = chunkBase + (message * (bufConfig.iBufferSizeInBytes));
+ TFilledBufferHeaderV2 header2;
+ header2.iOffset = bufBase2 - chunkBase;
+ header2.iFilledLength = 3;
+ header2.iTimeStamp = 0;
+ header2.iFlags = EFalse ? OMX_BUFFERFLAG_STARTTIME : 0; //is NOT the first buffer.
+ User::LeaveIfError(iMsgQueue.Send(header2));
+
+ // flush them while they're still outstanding
+ error = component->SendCommand(component, OMX_CommandFlush, aPortIndex, NULL);
+ if(error != aExpectedError)
+ {
+ ERR_PRINTF3(_L("MosForceBufferSourceFlushBuffer SendCommand() error 0x%X, expected 0x%X"), error, aExpectedError);
+ iMsgQueue.Close();
+ CleanupStack::PopAndDestroy(); // msgsChunk
+ return EFalse;
+ }
+
+ CleanupStack::PopAndDestroy(); // msgsChunk
+ return ETrue;
+ }
+
+
+
+TBool ROmxScriptTest::MosForceBufferSinkFlushBuffer(const TDesC8& aComp, TInt aPortIndex, OMX_ERRORTYPE aExpectedError)
+ {
+
+
+ TBuf<255> compWide;
+ compWide.Copy(aComp);
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+
+ OMX_ERRORTYPE error = component->SendCommand(component, OMX_CommandFlush, aPortIndex, NULL);
+ if(error != aExpectedError)
+ {
+ ERR_PRINTF3(_L("MosForceFlushBufferSinkBuffer error 0x%X, expected 0x%X"), error, aExpectedError);
+ iMsgQueue.Close();
+ return EFalse;
+ }
+
+ return ETrue;
+ }
+
+
+
+TBool ROmxScriptTest::MosSetActiveStream(const TDesC8& aComp, TUint32 aPortIndex)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ OMX_PARAM_PORTDEFINITIONTYPE portDef;
+ portDef.nVersion = KOmxVersion;
+ portDef.nSize = sizeof(portDef);
+ portDef.nPortIndex = aPortIndex;
+
+ OMX_ERRORTYPE error = component->GetParameter(component, OMX_IndexParamPortDefinition, &portDef);
+ if(error)
+ {
+ FailWithOmxError(_L("OMX_GetParameter()"), error);
+ return EFalse;
+ }
+
+ error = component->SetParameter(component, OMX_IndexParamActiveStream, &portDef);
+ if((error != OMX_ErrorNone) && (error != OMX_ErrorUnsupportedSetting))
+ {
+ FailWithOmxError(_L("SetParameter"), error);
+ return EFalse;
+ }
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosGetActiveStream(const TDesC8& aComp, TUint32 aPortIndex)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ OMX_PARAM_PORTDEFINITIONTYPE portDef;
+ portDef.nVersion = KOmxVersion;
+ portDef.nSize = sizeof(portDef);
+ portDef.nPortIndex = aPortIndex;
+
+ OMX_ERRORTYPE error = component->GetParameter(component, OMX_IndexParamActiveStream, &portDef);
+ if(error)
+ {
+ FailWithOmxError(_L("OMX_GetParameter()"), error);
+ return EFalse;
+ }
+
+ return ETrue;
+ }
+
+
+TBool ROmxScriptTest::MosSetVideoFitModeL(TVideoFitMode aVideoFitMode)
+ {
+ iVideoFitMode = aVideoFitMode;
+ return ETrue;
+ }
+
+// FIXME duplication with MosSetAacAudioPortDefL
+TBool ROmxScriptTest::MosSetAACProfileL(const TDesC8& aComp, TInt aPortIndex, TInt aChannels, TInt aSamplingRate, TInt aBitRate, TInt aAudioBandwidth, TInt aFrameLength, TInt aAACTools, TInt aAACERTools, OMX_AUDIO_AACPROFILETYPE aProfile, OMX_AUDIO_AACSTREAMFORMATTYPE aStreamFormat, OMX_AUDIO_CHANNELMODETYPE aChannelMode)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ OMX_AUDIO_PARAM_AACPROFILETYPE param;
+ param.nSize = sizeof(param);
+ param.nVersion = KOmxVersion;
+ param.nPortIndex = aPortIndex;
+
+ OMX_ERRORTYPE error = OMX_GetParameter(component, OMX_IndexParamAudioAac, ¶m);
+ if(error)
+ {
+ FailWithOmxError(_L("OMX_GetParameter(AudioAAC)"), error);
+ return EFalse;
+ }
+
+ // TODO don't overwrite unspecified values
+ param.nChannels = aChannels;
+ param.nSampleRate = aSamplingRate;
+ param.nBitRate = aBitRate;
+ param.nAudioBandWidth = aAudioBandwidth;
+ param.nFrameLength = aFrameLength;
+ param.nAACtools = aAACTools;
+ param.nAACERtools = aAACERTools;
+ param.eAACProfile = aProfile;
+ param.eAACStreamFormat = aStreamFormat;
+ param.eChannelMode = aChannelMode;
+
+ error = OMX_SetParameter(component, OMX_IndexParamAudioAac, ¶m);
+ if(error)
+ {
+ FailWithOmxError(_L("OMX_SetParameter(AudioAAC)"), error);
+ return EFalse;
+ }
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosGetExtensionIndex(const TDesC8& aComp, const TDesC8& aParameterName, OMX_ERRORTYPE aExpectedError)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ TBuf8<128> extension;
+ extension.Copy(aParameterName);
+
+ OMX_INDEXTYPE indexType = OMX_IndexMax;
+ OMX_ERRORTYPE error = component->GetExtensionIndex(component, (OMX_STRING) extension.PtrZ(), &indexType);
+ if(error != aExpectedError)
+ {
+ ERR_PRINTF3(_L("MosGetExtensionIndex GetExtensionIndex() error 0x%X, expected 0x%X"), error, aExpectedError);
+ return EFalse;
+ }
+
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosCheckTimeClockState(const TDesC8& aComp, OMX_TIME_CLOCKSTATE aExpectedState)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+
+ if (!component)
+ {
+ StopTest(EFail);
+ return EFalse;
+ }
+
+ OMX_TIME_CONFIG_CLOCKSTATETYPE timeClockState;
+ timeClockState.nSize = sizeof(timeClockState);
+ timeClockState.nVersion = KOmxVersion;
+
+ if(component->GetConfig(component, OMX_IndexConfigTimeClockState, &timeClockState) != OMX_ErrorNone)
+ {
+ StopTest(EFail);
+ return EFalse;
+ }
+
+ if (timeClockState.eState != aExpectedState)
+ {
+ ERR_PRINTF3(_L("Clock state %d does not match expected %d"), timeClockState.eState, aExpectedState);
+ StopTest(EFail);
+ return EFalse;
+ }
+
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosCheckMediaTime(const TDesC8& aComp, TInt aPortIndex, OMX_TICKS aMediaTime, TBool aMoreThan)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+
+ if (!component)
+ {
+ StopTest(EFail);
+ return EFalse;
+ }
+
+ OMX_TIME_CONFIG_TIMESTAMPTYPE timeInfo;
+ timeInfo.nSize = sizeof(timeInfo);
+ timeInfo.nVersion = KOmxVersion;
+ timeInfo.nPortIndex = aPortIndex;
+
+ if (component->GetConfig(component, OMX_IndexConfigTimeCurrentMediaTime, &timeInfo) != OMX_ErrorNone)
+ {
+ StopTest(EFail);
+ return EFalse;
+ }
+
+ if (aMoreThan)
+ {
+ INFO_PRINTF3(_L("MosCheckMediaTime() %ld > %ld"), timeInfo.nTimestamp, aMediaTime);
+
+ if (timeInfo.nTimestamp < aMediaTime)
+ {
+ INFO_PRINTF3(_L("FAILED! MosCheckMediaTime() Expecting %ld > %ld"), timeInfo.nTimestamp, aMediaTime);
+ StopTest(EFail);
+ return EFalse;
+ }
+ }
+ else
+ {
+ INFO_PRINTF3(_L("MosCheckMediaTime() %ld < %ld"), timeInfo.nTimestamp, aMediaTime);
+
+ if (timeInfo.nTimestamp > aMediaTime)
+ {
+ INFO_PRINTF3(_L("FAILED! MosCheckMediaTime() expecting %ld < %ld"), timeInfo.nTimestamp, aMediaTime);
+ StopTest(EFail);
+ return EFalse;
+ }
+ }
+
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosBaseSupportPortL(const TDesC8& aComp, TInt aPortIndex)
+ {
+ TInt componentIndex = iComponents.Find(aComp, ROmxScriptTest::ShortNameMatchComparison);
+ if (componentIndex == KErrNotFound)
+ {
+ return EFalse;
+ }
+ iComponents[componentIndex]->iBaseHandler->AddPortSupportL(aPortIndex);
+
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosBaseSetAutonomous(const TDesC8& aComp, TInt aPortIndex, TBool aEnabled)
+ {
+ TInt componentIndex = iComponents.Find(aComp, ROmxScriptTest::ShortNameMatchComparison);
+ if (componentIndex == KErrNotFound)
+ {
+ return EFalse;
+ }
+ iComponents[componentIndex]->iBaseHandler->SetAutoMode(aPortIndex, aEnabled);
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosBaseAllocateBuffersL(const TDesC8& aComp, TInt aPortIndex, TInt aNumberBuffers)
+ {
+ TInt componentIndex = iComponents.Find(aComp, ROmxScriptTest::ShortNameMatchComparison);
+ if (componentIndex == KErrNotFound)
+ {
+ return EFalse;
+ }
+ iComponents[componentIndex]->iBaseHandler->SetupBuffersL(aPortIndex,aNumberBuffers);
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosBaseFreeAllocatedBuffersL(const TDesC8& aComp)
+ {
+ TInt componentIndex = iComponents.Find(aComp, ROmxScriptTest::ShortNameMatchComparison);
+ if (componentIndex == KErrNotFound)
+ {
+ return EFalse;
+ }
+ iComponents[componentIndex]->iBaseHandler->FreeAllocatedBuffersL();
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosBaseSetBufSupplier(const TDesC8& aComp, TInt aPortIndex, TBool aComponentSupplier)
+ {
+ TInt componentIndex = iComponents.Find(aComp, ROmxScriptTest::ShortNameMatchComparison);
+ if (componentIndex == KErrNotFound)
+ {
+ return EFalse;
+ }
+ iComponents[componentIndex]->iBaseHandler->SetBufferSupplier(aPortIndex, aComponentSupplier);
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosBaseFillThisBuffer(const TDesC8& aComp, TInt aPortIndex, TInt aPortRelBufIndex)
+ {
+ TInt componentIndex = iComponents.Find(aComp, ROmxScriptTest::ShortNameMatchComparison);
+ if (componentIndex == KErrNotFound)
+ {
+ return EFalse;
+ }
+ iComponents[componentIndex]->iBaseHandler->FillThisBuffer(aPortIndex, aPortRelBufIndex);
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosBaseEmptyThisBuffer(const TDesC8& aComp, TInt aPortIndex, TInt aPortRelBufIndex)
+ {
+ TInt componentIndex = iComponents.Find(aComp, ROmxScriptTest::ShortNameMatchComparison);
+ if (componentIndex == KErrNotFound)
+ {
+ return EFalse;
+ }
+ iComponents[componentIndex]->iBaseHandler->EmptyThisBuffer(aPortIndex, aPortRelBufIndex);
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosBaseWaitForBuffer(const TDesC8& aComp, TInt aPortIndex, TInt aPortRelBufIndex)
+ {
+ TInt componentIndex = iComponents.Find(aComp, ROmxScriptTest::ShortNameMatchComparison);
+ if (componentIndex == KErrNotFound)
+ {
+ return EFalse;
+ }
+ iComponents[componentIndex]->iBaseHandler->WaitForBufferCompletion(aPortIndex, aPortRelBufIndex);
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosBaseTimestampPassClock(const TDesC8& aCompReceiving, const TDesC8& aClockCompToPass)
+ {
+ TInt receiveCompIndex = iComponents.Find(aCompReceiving, ROmxScriptTest::ShortNameMatchComparison);
+ if (receiveCompIndex == KErrNotFound)
+ {
+ return EFalse;
+ }
+
+ TInt clockCompIndex = iComponents.Find(aClockCompToPass, ROmxScriptTest::ShortNameMatchComparison);
+ if (clockCompIndex == KErrNotFound)
+ {
+ return EFalse;
+ }
+
+ CBaseProfileTimestampHandling* timestampBaseHandler = static_cast<CBaseProfileTimestampHandling*>(iComponents[receiveCompIndex]->iBaseHandler);
+ timestampBaseHandler->SetClockComponent(iComponents[clockCompIndex]->iComponent);
+
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosBaseTimestampCheckTimestampL(const TDesC8& aComp, TInt aPortIndex, TUint aExpectedTime, TUint aTolerance)
+ {
+ TInt componentIndex = iComponents.Find(aComp, ROmxScriptTest::ShortNameMatchComparison);
+ if (componentIndex == KErrNotFound)
+ {
+ return EFalse;
+ }
+
+ CBaseProfileTimestampHandling* timestampBaseHandler = static_cast<CBaseProfileTimestampHandling*>(iComponents[componentIndex]->iBaseHandler);
+ timestampBaseHandler->QueueTimestampCheckL(aPortIndex, aExpectedTime, aTolerance);
+
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosBaseTimestampCompareWithRefClockL(const TDesC8& aComp, TInt aPortIndex, TUint aTolerance)
+ {
+ TInt componentIndex = iComponents.Find(aComp, ROmxScriptTest::ShortNameMatchComparison);
+ if (componentIndex == KErrNotFound)
+ {
+ return EFalse;
+ }
+
+ CBaseProfileTimestampHandling* timestampBaseHandler = static_cast<CBaseProfileTimestampHandling*>(iComponents[componentIndex]->iBaseHandler);
+ timestampBaseHandler->QueueCompareWithRefClockL(aPortIndex, aTolerance);
+
+ return ETrue;
+ }
+
+
+TBool ROmxScriptTest::MosStartBuffersforPort( const TDesC8& aComp, TInt aPortIndex)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ if(iPortBufferHandler)
+ {
+ iPortBufferHandler->Start(component,aPortIndex);
+ }
+ return ETrue;
+ }
+
+void ROmxScriptTest::BeginWait()
+ {
+ CActiveScheduler::Start();
+ }
+
+void ROmxScriptTest::EndWait()
+ {
+ // use a CAsyncCallBack to call CActiveScheduler::Stop
+ // the main reason for doing this is to allow EndWait
+ // to be called from any thread but to stop the scheduler
+ // of the script parser thread.
+ iStopSchedulerCallback->CallBack();
+ }
+
+
+
+//
+TBool ROmxScriptTest::MosDeleteFileL(const TDesC& aFileName, TBool aFileMustExist)
+ {
+ RFs fs;
+
+ User::LeaveIfError(fs.Connect());
+ CleanupClosePushL(fs);
+ TInt err = fs.Delete(aFileName);
+ if (err != KErrNone)
+ {
+ if (err != KErrNotFound || aFileMustExist)
+ {
+ ERR_PRINTF3(_L("Error %d deleting file %S"), err, &aFileName);
+ User::Leave(err);
+ }
+ }
+
+ INFO_PRINTF2(_L("Deleted file %S"), &aFileName);
+
+ CleanupStack::PopAndDestroy(&fs);
+ return ETrue;
+ }
+
+//
+//
+//
+TBool ROmxScriptTest::MosLogAllEventsL()
+ {
+ return ETrue;
+ }
+
+//
+//
+//
+TBool ROmxScriptTest::MosSetSensorModeTypeL(const TDesC8& aComp, TInt aPort, TInt aFrameRate, TBool aOneShot, TInt aWidth, TInt aHeight)
+ {
+ OMX_COMPONENTTYPE* comp = ComponentByName(aComp);
+ if (!comp)
+ {
+ return EFalse;
+ }
+
+ OMX_PARAM_SENSORMODETYPE sensor;
+ sensor.nVersion = KOmxVersion;
+ sensor.nSize = sizeof(OMX_PARAM_SENSORMODETYPE);
+ sensor.nPortIndex = aPort;
+ sensor.sFrameSize.nSize = sizeof(OMX_FRAMESIZETYPE);
+ sensor.sFrameSize.nVersion = KOmxVersion;
+ sensor.sFrameSize.nPortIndex = aPort;
+
+ OMX_ERRORTYPE omxErr = comp->GetParameter(comp, OMX_IndexParamCommonSensorMode, &sensor);
+ if (omxErr != OMX_ErrorNone)
+ {
+ ERR_PRINTF2(_L("Error %08X returned from GetParameter"), omxErr);
+ return EFalse;
+ }
+
+ sensor.bOneShot = (aOneShot ? OMX_TRUE : OMX_FALSE);
+ if (aFrameRate != -1) sensor.nFrameRate = aFrameRate;
+ if (aWidth != -1) sensor.sFrameSize.nWidth = aWidth;
+ if (aHeight != -1) sensor.sFrameSize.nHeight = aHeight;
+
+ omxErr = comp->SetParameter(comp, OMX_IndexParamCommonSensorMode, &sensor);
+ if (omxErr != OMX_ErrorNone)
+ {
+ ERR_PRINTF2(_L("Error %08X returned from SetParameter"), omxErr);
+ }
+
+ return (omxErr == OMX_ErrorNone);
+ }
+
+//
+//
+//
+TBool ROmxScriptTest::MosSetCaptureModeTypeL(const TDesC8& aComp, TInt aPort, TBool aContinuous, TBool aFrameLimited, TInt aFrameLimit)
+ {
+ OMX_COMPONENTTYPE* comp = ComponentByName(aComp);
+ if (!comp)
+ {
+ return EFalse;
+ }
+
+ OMX_CONFIG_CAPTUREMODETYPE captureModeType;
+ captureModeType.nSize = sizeof(OMX_CONFIG_CAPTUREMODETYPE);
+ captureModeType.nVersion = KOmxVersion;
+ captureModeType.nPortIndex = aPort;
+ captureModeType.bContinuous = (aContinuous ? OMX_TRUE : OMX_FALSE);
+ captureModeType.bFrameLimited = (aFrameLimited ? OMX_TRUE : OMX_FALSE);
+ captureModeType.nFrameLimit = aFrameLimit;
+ OMX_ERRORTYPE omxErr = comp->SetConfig(comp,OMX_IndexConfigCaptureMode,&captureModeType);
+
+ if (omxErr != OMX_ErrorNone)
+ {
+ ERR_PRINTF2(_L("Error %08X returned from SetConfig"), omxErr);
+ }
+
+ return (omxErr == OMX_ErrorNone);
+ }
+
+//
+
+static TInt StopScheduler(TAny* /*unused*/)
+ {
+ CActiveScheduler::Stop();
+ return 0;
+ }
+
+void ROmxScriptTest::StopTest(TOmxScriptTestVerdict aVerdict)
+ {
+ switch(aVerdict)
+ {
+ case EPass:
+ StopTest(KErrNone, EPass);
+ break;
+ case EFail:
+ StopTest(KErrGeneral, EFail);
+ break;
+ default:
+ User::Invariant();
+ }
+ }
+
+/**
+ * Stores the result of the test case. If called multiple times, the first
+ * case of EFail will persist.
+ * @param aError system-wide error code
+ * @param aVerdict either EPass or EFail
+ */
+void ROmxScriptTest::StopTest(TInt aError, TOmxScriptTestVerdict aVerdict)
+ {
+ __ASSERT_ALWAYS(aVerdict != EPending, User::Invariant());
+ // first negative result persists
+ if(iVerdict != EFail)
+ {
+ iReason = aError;
+ iVerdict = aVerdict;
+ }
+ }
+
+void ROmxScriptTest::FailTest(const TDesC& aErrorMsg)
+ {
+ ERR_PRINTF1(aErrorMsg);
+ StopTest(EFail);
+ }
+
+/**
+ * @return the error code set via StopTest. Defaults to KErrNone.
+ */
+TInt ROmxScriptTest::Reason() const
+ {
+ return iReason;
+ }
+
+/**
+ * @return the verdict set via StopTest. Defaults to EPending.
+ */
+ROmxScriptTest::TOmxScriptTestVerdict ROmxScriptTest::Verdict() const
+ {
+ return iVerdict;
+ }
+
+/**
+ * Overflow handler to generate a warning message if a log line will not fit
+ * in the descriptor.
+ */
+class TOverflowHandler : public TDes16Overflow
+ {
+public:
+ void Overflow(TDes& aDes)
+ {
+ _LIT(KWarning, "[truncated]");
+ if(aDes.Length() + KWarning().Length() > aDes.MaxLength())
+ {
+ aDes.SetLength(aDes.Length() - KWarning().Length());
+ }
+ aDes.Append(KWarning);
+ }
+ };
+
+/**
+ * Target of ERR_PRINTFx, INFO_PRINTFx, WARN_PRINTFx macros.
+ * Message is formatted then passed to the MOmxScriptTestLogger.
+ */
+void ROmxScriptTest::LogExtra(const TText8* aFile, TInt aLine, TOmxScriptSeverity aSeverity,
+ TRefByValue<const TDesC16> aFmt,...)
+ {
+ VA_LIST aList;
+ VA_START(aList, aFmt);
+
+ TOverflowHandler overflow;
+ TBuf<255> msg;
+ msg.AppendFormatList(aFmt, aList, &overflow);
+
+ iLogger.Log(aFile, aLine, aSeverity, msg);
+
+ VA_END(aList);
+ }
+
+void ROmxScriptTest::RegisterTunnel(OMX_COMPONENTTYPE* aSourceComp, TInt aSourcePort, OMX_COMPONENTTYPE* aSinkComp, TInt aSinkPort)
+ {
+ // delete previous registration
+ for(TInt index = 0, count = iTunnels.Count(); index < count; index++)
+ {
+ const TTunnelInfo& info = iTunnels[index];
+ if(info.iSourceComponent == aSourceComp && info.iSourcePort == aSourcePort ||
+ info.iSinkComponent == aSinkComp && info.iSinkPort == aSinkPort)
+ {
+ iTunnels.Remove(index);
+ index--;
+ count--;
+ }
+ }
+
+ TTunnelInfo info;
+ info.iSourceComponent = aSourceComp;
+ info.iSourcePort = aSourcePort;
+ info.iSinkComponent = aSinkComp;
+ info.iSinkPort = aSinkPort;
+ TInt error = iTunnels.Append(info);
+ if(error)
+ {
+ User::Panic(_L("omxscript"), KErrNoMemory);
+ }
+ }
+
+void ROmxScriptTest::FindTransitionOrderL(const RPointerArray<CComponentInfo>& aComponents,
+ const RTunnelRelations& aTunnelRelations,
+ RArray<TInt>& aOrder)
+ {
+ RPointerArray<OMX_COMPONENTTYPE> componentsSimple;
+ CleanupClosePushL(componentsSimple);
+ componentsSimple.ReserveL(aComponents.Count());
+ for(TInt index = 0, count = aComponents.Count(); index < count; index++)
+ {
+ componentsSimple.AppendL(aComponents[index]->iComponent);
+ }
+ RSupplierRelations supplierRelations;
+ CleanupStack::PushL(TCleanupItem(CloseSupplierRelations, &supplierRelations));
+ TInt numComponents = aComponents.Count();
+ supplierRelations.ReserveL(numComponents);
+ for(TInt index = 0; index < numComponents; index++)
+ {
+ supplierRelations.Append(RArray<TInt>());
+ }
+ TInt numTunnels = aTunnelRelations.Count();
+ for(TInt index = 0; index < numTunnels; index++)
+ {
+ const TTunnelInfo& tunnelInfo = aTunnelRelations[index];
+ TInt outputCompIndex = componentsSimple.Find(tunnelInfo.iSourceComponent);
+ User::LeaveIfError(outputCompIndex);
+ TInt inputCompIndex = componentsSimple.Find(tunnelInfo.iSinkComponent);
+ User::LeaveIfError(inputCompIndex);
+
+ OMX_PARAM_BUFFERSUPPLIERTYPE supplier;
+ supplier.nSize = sizeof(supplier);
+ supplier.nVersion = KOmxVersion;
+ supplier.nPortIndex = tunnelInfo.iSourcePort;
+ OMX_ERRORTYPE error = OMX_GetParameter(tunnelInfo.iSourceComponent,
+ OMX_IndexParamCompBufferSupplier,
+ &supplier);
+ if(error != OMX_ErrorNone)
+ {
+ User::Leave(KErrGeneral);
+ }
+ if(supplier.eBufferSupplier == OMX_BufferSupplyInput)
+ {
+ supplierRelations[inputCompIndex].AppendL(outputCompIndex);
+ }
+ else if(supplier.eBufferSupplier == OMX_BufferSupplyOutput)
+ {
+ supplierRelations[outputCompIndex].AppendL(inputCompIndex);
+ }
+ else
+ {
+ User::Leave(KErrArgument);
+ }
+ }
+
+ ::FindTransitionOrderL(supplierRelations, aOrder);
+
+ CleanupStack::PopAndDestroy(2, &componentsSimple);
+ }
+
+TBool ROmxScriptTest::MosCheckClockStateL(const TDesC8& aComp, OMX_TIME_CLOCKSTATE aClockState)
+ {
+ /*
+ TODO: Verify that this is a clock component?
+ */
+
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ OMX_TIME_CONFIG_CLOCKSTATETYPE conf;
+ conf.nVersion = KOmxVersion;
+ conf.nSize = sizeof(conf);
+ /*
+ Completed by GetConfig()
+
+ conf.eState
+ conf.nStartTime
+ conf.nOffset
+ conf.nWaitMask
+ */
+
+ OMX_ERRORTYPE error = component->GetConfig(component, OMX_IndexConfigTimeClockState, &conf);
+ if(error != OMX_ErrorNone)
+ {
+ FailWithOmxError(_L("OMX_GetConfig(OMX_IndexConfigTimeClockState)"), error);
+ return EFalse;
+ }
+
+ if(conf.eState != aClockState)
+ {
+// TODO: What about the other values?
+ ERR_PRINTF3(_L("Clock component expected to be in clock state %S, is actually in %S"), ClockStateDes(aClockState), ClockStateDes(conf.eState));
+ StopTest(EFail);
+ return EFalse;
+ }
+
+ TBuf<64> compConverted;
+ compConverted.Copy(aComp);
+ INFO_PRINTF3(_L("State of %S is %S"), &compConverted, ClockStateDes(aClockState));
+
+ return ETrue;
+ }
+
+// for debugging...
+TBool ROmxScriptTest::MosCheckTimePositionL(const TDesC8& aComp, TInt aPortIndex, TInt aTimestamp)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ OMX_TIME_CONFIG_TIMESTAMPTYPE conf;
+ conf.nVersion = KOmxVersion;
+ conf.nSize = sizeof(conf);
+ conf.nPortIndex = aPortIndex;
+ /*
+ To be filled by GetConfig()
+ conf.nTimestamp;
+ */
+
+ OMX_ERRORTYPE error = component->GetConfig(component, OMX_IndexConfigTimePosition, &conf);
+ if(error != OMX_ErrorNone)
+ {
+ FailWithOmxError(_L("OMX_GetConfig(OMX_IndexConfigTimePosition)"), error);
+ return EFalse;
+ }
+ if(conf.nTimestamp != aTimestamp)
+ {
+ TBuf<64> compConverted;
+ compConverted.Copy(aComp);
+ ERR_PRINTF5(_L("Port %d of component %S time position expected to be %d, but is actually %d"), aPortIndex, &compConverted, aTimestamp, conf.nTimestamp);
+ StopTest(EFail);
+ return EFalse;
+ }
+
+ TBuf<64> compConverted;
+ compConverted.Copy(aComp);
+ INFO_PRINTF4(_L("Port %d of component %S time position verified to be %d"), aPortIndex, &compConverted, conf.nTimestamp);
+
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosSetTimePositionL(const TDesC8& aComp, TInt aPortIndex, TInt aTimestamp)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ OMX_TIME_CONFIG_TIMESTAMPTYPE conf;
+ conf.nVersion = KOmxVersion;
+ conf.nSize = sizeof(conf);
+ conf.nPortIndex = aPortIndex;
+ conf.nTimestamp = aTimestamp;
+
+ OMX_ERRORTYPE error = component->SetConfig(component, OMX_IndexConfigTimePosition, &conf);
+ if(error != OMX_ErrorNone)
+ {
+ FailWithOmxError(_L("OMX_SetConfig(OMX_IndexConfigTimePosition)"), error);
+ return EFalse;
+ }
+
+ TBuf<64> compConverted;
+ compConverted.Copy(aComp);
+ INFO_PRINTF4(_L("Port %d of component %S time position set to %d"), aPortIndex, &compConverted, aTimestamp);
+
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosCheckFrameCountL(const TDesC& aFilename, TInt aCount)
+ {
+ C3GPParse* parser = C3GPParse::NewL();
+ CleanupStack::PushL(parser);
+ TInt err = parser->Open(aFilename);
+ if(err)
+ {
+ CleanupStack::PopAndDestroy(parser);
+ return EFalse;
+ }
+ else
+ {
+ TUint num;
+ err = parser->GetNumberOfVideoFrames(num);
+ CleanupStack::PopAndDestroy(parser);
+ if(err)
+ {
+ ERR_PRINTF1(_L("aParser->GetNumberOfVideoFrames() failed"));
+ return EFalse;
+ }
+ else
+ {
+ //assume 20 dropped frames is accepted normally
+ //if the frame count is smaller than 20, we just allow 10 dropped frames
+ TInt tmp = (aCount > 20) ? (aCount - 20): (aCount - 10);
+ if(num < tmp)
+ {
+ ERR_PRINTF1(_L("too many dropped frames, ROmxScriptTest->MosCheckFrameCountL() failed"));
+ return EFalse;
+ }
+ }
+ }
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosMarkBuffer(const TDesC8& aComp, TInt aPortIndex, const TDesC8& aTargetComp, TInt markData)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ OMX_COMPONENTTYPE* targetComponent = ComponentByName(aTargetComp);
+ if(component == NULL || targetComponent == NULL)
+ {
+ return EFalse;
+ }
+
+ OMX_MARKTYPE mark;
+ mark.hMarkTargetComponent = targetComponent;
+ mark.pMarkData = reinterpret_cast<TAny*>(markData);
+
+ OMX_ERRORTYPE error = OMX_SendCommand(component, OMX_CommandMarkBuffer, aPortIndex, &mark);
+ if(error)
+ {
+ FailWithOmxError(aComp, _L("SendCommand(MarkBuffer)"), error);
+ return EFalse;
+ }
+ else
+ {
+ return ETrue;
+ }
+ }
+
+void ROmxScriptTest::MosParseError(const TDesC& aError)
+ {
+ ERR_PRINTF1(aError);
+ }
+
+ROmxScriptTest::CComponentInfo* ROmxScriptTest::CComponentInfo::NewL(ROmxScriptTest& aTestController)
+ {
+ CComponentInfo* self = new (ELeave) CComponentInfo(aTestController);
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ CleanupStack::Pop(self);
+ return self;
+ }
+
+void ROmxScriptTest::CComponentInfo::ConstructL()
+ {
+ }
+
+TBool ROmxScriptTest::MosSetClientStartTimeL(const TDesC8& aComp, TInt aPortIndex, TInt aTimestamp)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ OMX_TIME_CONFIG_TIMESTAMPTYPE conf;
+ conf.nVersion = KOmxVersion;
+ conf.nSize = sizeof(conf);
+ conf.nPortIndex = aPortIndex;
+ conf.nTimestamp = aTimestamp;
+
+ OMX_ERRORTYPE error = component->SetConfig(component, OMX_IndexConfigTimeClientStartTime, &conf);
+ if(error != OMX_ErrorNone)
+ {
+ FailWithOmxError(_L("OMX_SetConfig(OMX_IndexConfigTimeClientStartTime)"), error);
+ return EFalse;
+ }
+
+ TBuf<64> compConverted;
+ compConverted.Copy(aComp);
+ INFO_PRINTF4(_L("Port %d of component %S time position set to %d"), aPortIndex, &compConverted, aTimestamp);
+
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosSetCurrentAudioReferenceTimeL(const TDesC8& aComp, TInt aPortIndex, TInt aTimestamp)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ OMX_TIME_CONFIG_TIMESTAMPTYPE conf;
+ conf.nVersion = KOmxVersion;
+ conf.nSize = sizeof(conf);
+ conf.nPortIndex = aPortIndex;
+ conf.nTimestamp = aTimestamp;
+
+ OMX_ERRORTYPE error = component->SetConfig(component, OMX_IndexConfigTimeCurrentAudioReference, &conf);
+ if(error != OMX_ErrorNone)
+ {
+ FailWithOmxError(_L("OMX_SetConfig(OMX_IndexConfigTimeCurrentAudioReference)"), error);
+ return EFalse;
+ }
+
+ TBuf<64> compConverted;
+ compConverted.Copy(aComp);
+ INFO_PRINTF4(_L("Port %d of component %S time position set to %d"), aPortIndex, &compConverted, aTimestamp);
+
+ return ETrue;
+ }
+#ifdef OLD_ADPCM_EXTENSION
+TBool ROmxScriptTest::MosSetAdPcmAudioPortDefL(const TDesC8& aComp,
+ TInt aPortIndex,
+ TInt aNumChannels,
+ TInt aSamplingRate,
+ TInt aBitsperSample)
+ {
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+ if(!component)
+ {
+ return EFalse;
+ }
+
+ OMX_AUDIO_PARAM_ADPCMTYPE pcmModeType;
+ pcmModeType.nSize = sizeof(pcmModeType);
+ pcmModeType.nVersion = KOmxVersion;
+ pcmModeType.nPortIndex = aPortIndex;
+ OMX_ERRORTYPE error = component->GetParameter(component, OMX_IndexParamAudioAdpcm, &pcmModeType);
+ if(error)
+ {
+ FailWithOmxError(_L("GetParameter()"), error);
+ return EFalse;
+ }
+ if(aNumChannels != -1)
+ {
+ pcmModeType.nChannels = aNumChannels;
+ }
+ if(aSamplingRate != -1)
+ {
+ pcmModeType.nSampleRate = aSamplingRate;
+ }
+ if(aBitsperSample != -1)
+ {
+ pcmModeType.nBitsPerSample = aBitsperSample;
+ }
+ error = component->SetParameter(component, OMX_IndexParamAudioAdpcm, &pcmModeType);
+ if(error)
+ {
+ FailWithOmxError(_L("SetParameter()"), error);
+ return EFalse;
+ }
+ return ETrue;
+ }
+
+TBool ROmxScriptTest::MosConfigAdPcmDecoderBlockAlign(const TDesC8& aComp, OMX_S32 aBlockAlign)
+ {
+ // Create param
+ OMX_SYMBIAN_AUDIO_PARAM_ADPCMDECODER_BLOCKALIGN param;
+ param.nSize = sizeof(param);
+ param.nVersion = KAdPcmDecoderConfigVersion;
+ param.nPortIndex = 0;
+ param.nBlockAlign = aBlockAlign;
+
+ // Show debugging info
+ INFO_PRINTF2(_L("Setting the size of the AdPcm block to %d"), aBlockAlign);
+
+ // Get component
+ OMX_COMPONENTTYPE* component = ComponentByName(aComp);
+
+ // Check component
+ if(!component)
+ return EFalse;
+
+ // Set the config
+ OMX_ERRORTYPE error = component->SetParameter(component, static_cast<OMX_INDEXTYPE>(OMX_SymbianIndexParamAudioAdPcmDecoderBlockAlign), ¶m);
+ if(error)
+ {
+ FailWithOmxError(_L("SetParameter(OMX_SymbianIndexParamAudioAdPcmDecoderBlockAlign)"), error);
+ return EFalse;
+ }
+ else
+ {
+ return ETrue;
+ }
+ }
+#endif
+
+ROmxScriptTest::CComponentInfo::CComponentInfo(ROmxScriptTest& aTestController)
+: iTestController(aTestController)
+ {
+ }
+
+ROmxScriptTest::CComponentInfo::~CComponentInfo()
+ {
+ // convert from 8-bit descriptors for logging
+ TBuf<64> shortName;
+ TBuf<64> compName;
+ shortName.Copy(*iShortName);
+ compName.Copy(*iComponentName);
+ OMX_ERRORTYPE error = OMX_ErrorNone;
+ if(iComponent != NULL)
+ {
+ iTestController.INFO_PRINTF3(_L("Unloading component %S (%S)"), &shortName, &compName);
+ if(iThreadRequest != NULL)
+ {
+ error = iThreadRequest->FreeHandle(iComponent);
+ delete iShortName;
+ delete iComponentName;
+ delete iBaseHandler;
+ }
+ else
+ {
+ delete iShortName;
+ delete iComponentName;
+ delete iBaseHandler;
+ error = OMX_FreeHandle(iComponent);
+ }
+ }
+
+ if(error)
+ {
+ iTestController.FailWithOmxError(_L("OMX_FreeHandle()"), error);
+ }
+ delete iThreadRequest;
+ }
+void HashFilter_16bit_EndianSwap(RBuf8& aBuf)
+ {
+ for (TInt i=0;i<aBuf.Length();i+=2)
+ {
+ TUint8 tmp = aBuf[i];
+ aBuf[i] = aBuf[i+1];
+ aBuf[i+1] = tmp;
+ }
+ }
+
+void HashFilter_16bit_BE_SignednessSwap(RBuf8& aBuf)
+ {
+ for (TInt i=0;i<aBuf.Length();i+=2)
+ {
+ aBuf[i] ^= 0x80;
+ }
+ }
+
+void HashFilter_16bit_LE_SignednessSwap(RBuf8& aBuf)
+ {
+ for (TInt i=0;i<aBuf.Length();i+=2)
+ {
+ aBuf[i+1] ^= 0x80;
+ }
+ }
+
+void HashFilter_16bit_BE_MsbOnly(RBuf8& aBuf)
+ {
+ TInt src = 0;
+ TInt dest = 0;
+
+ while (src<aBuf.Length())
+ {
+ aBuf[dest] = aBuf[src];
+ src+=2;
+ dest++;
+ }
+
+ aBuf.SetLength(dest);
+ }
+
+void HashFilter_16bit_LE_MsbOnly(RBuf8& aBuf)
+ {
+ TInt src = 1;
+ TInt dest = 0;
+
+ while (src<aBuf.Length())
+ {
+ aBuf[dest] = aBuf[src];
+ src+=2;
+ dest++;
+ }
+
+ aBuf.SetLength(dest);
+ }
+
+ROmxScriptTest::THashFilter ROmxScriptTest::GetHashFilterByName(const TDesC8& aName)
+ {
+ if (aName.Length()==0) return NULL;
+ else if (aName==_L8("endianswap")) return &HashFilter_16bit_EndianSwap;
+ else if (aName==_L8("signswap16be")) return &HashFilter_16bit_BE_SignednessSwap;
+ else if (aName==_L8("signswap16le")) return &HashFilter_16bit_LE_SignednessSwap;
+ else if (aName==_L8("msbonly16be")) return &HashFilter_16bit_BE_MsbOnly;
+ else if (aName==_L8("msbonly16le")) return &HashFilter_16bit_LE_MsbOnly;
+ else User::Invariant();
+ return NULL; // Inaccessible
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/src/omxscripttest.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,328 @@
+/*
+* 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 OMXSCRIPTTEST_H_
+#define OMXSCRIPTTEST_H_
+
+#include "omxscriptparser.h"
+#include "asbreakeventhandler.h"
+#include "videotesttimer.h"
+#include <e32msgqueue.h>
+#include "omxthreadrequest.h"
+#include "omx_xml_script.h"
+//#include <multimedia/mmfbuffershared.h>
+#include <openmax/il/khronos/v1_x/OMX_IVCommon.h>
+#include <openmax/il/khronos/v1_x/OMX_Types.h>
+#include "portbufferhandler.h"
+
+class CNonTunneledHandler;
+class CVideoBufferHandler;
+class CVideoBufferSinkHandler;
+class CBaseProfileHandler;
+class CWindowManager;
+
+const OMX_VERSIONTYPE KOmxVersion = { OMX_VERSION_MAJOR, OMX_VERSION_MINOR, OMX_VERSION_REVISION, OMX_VERSION_STEP };
+
+/**
+ * Class to parse and execute an OMX test case specified in
+ * an XML file.
+ */
+NONSHARABLE_CLASS(ROmxScriptTest) : public MOmxScriptIf, public MASBreakCallback, public MTimerObserver
+ {
+public:
+
+ NONSHARABLE_CLASS(CComponentInfo) : public CBase
+ {
+ public:
+ static CComponentInfo* NewL(ROmxScriptTest& aTestController);
+ ~CComponentInfo();
+
+ private:
+ CComponentInfo(ROmxScriptTest& aTestController);
+ void ConstructL();
+
+ public:
+ HBufC8* iShortName;
+ HBufC8* iComponentName;
+ OMX_COMPONENTTYPE* iComponent;
+ CBaseProfileHandler* iBaseHandler; //NULL if not being used via OMX IL Base Profile
+ COmxThreadRequest* iThreadRequest;
+
+ private:
+ ROmxScriptTest& iTestController;
+ };
+
+ class TExpectedEvent
+ {
+ public:
+ OMX_COMPONENTTYPE* iComponent;
+ OMX_EVENTTYPE iEvent;
+ TUint32 iData1;
+ TUint32 iData2;
+ TAny* iEventData;
+ };
+ typedef void (*THashFilter)(RBuf8&);
+ THashFilter GetHashFilterByName(const TDesC8& aName);
+
+ ROmxScriptTest(MOmxScriptTestLogger& aLogger);
+ void Close();
+
+ void RunTestL(const TDesC& aScriptFilename, const TDesC& aScriptSection);
+
+ // MOmxScriptIf
+ TBool MosLoadComponentL(const TDesC8& aComp, const TDesC8& aName, TBool aBaseProfile, const TDesC8* aBaseImpl, TBool aLoadInCoreServerThread);
+ TBool MosSetupTunnel(const TDesC8& aSourceComp, TInt aSourcePort,
+ const TDesC8& aSinkComp, TInt aSinkPort, OMX_ERRORTYPE aExpectedError);
+ TBool MosSetupNonTunnel(const TDesC8& aSourceComp, TInt aSourcePort,
+ const TDesC8& aSinkComp, TInt aSinkPort,
+ OMX_BUFFERSUPPLIERTYPE aSupplier);
+ TBool MosSetWindowL(const TDesC8& aComp);
+ TBool MosSetDroppedFrameEvent(const TDesC8& aComp, const TDesC8& aAction);
+ TBool MosAllTransitionL(OMX_STATETYPE aState,OMX_ERRORTYPE aExpectedError, TTransitionOrder aOrder);
+ TBool MosWaitEOS();
+ TBool MosWaitEOS(const TDesC8& aComp);
+ TBool MosSetFilename(const TDesC8& aComp, const TDesC& aFilename);
+
+ TBool MosSetFilename_bellagio(const TDesC8& aComp, char *filepath);
+
+ TBool MosSetBadFilename(const TDesC8& aComp);
+ TBool MosGetFilename(const TDesC8& aComp, TDesC& aFilename, OMX_ERRORTYPE aExpectedError);
+
+ TBool MosSetBufferCount(const TDesC8& aComp, TInt aPortIndex, TInt aCount, OMX_ERRORTYPE aExpectedError);
+ TBool MosCompareFilesL(const TDesC& aFileOne, const TDesC& aFileTwo);
+ TBool MosFilterAndCompareFilesL(
+ const TDesC& aFileOne, const TDesC8& aFile1Filter1, const TDesC8& aFile1Filter2, const TDesC8& aFile1Filter3,
+ const TDesC& aFileTwo, const TDesC8& aFile2Filter1, const TDesC8& aFile2Filter2, const TDesC8& aFile2Filter3);
+ TBool MosBufferSupplierOverrideL(const TDesC8& aSourceComp, TInt aSourcePort,
+ const TDesC8& aSinkComp, TInt aSinkPort,
+ OMX_BUFFERSUPPLIERTYPE aSupplier,
+ OMX_ERRORTYPE aExpectedSourceError, OMX_ERRORTYPE aExpectedSinkError);
+ TBool MosSetVideoPortDefL(const TDesC8& aComp, TInt aPortIndex, TInt aWidth, TInt aHeight, OMX_COLOR_FORMATTYPE* aColorFormat, OMX_VIDEO_CODINGTYPE* aCodingType, TInt aStride, TReal aFps, OMX_ERRORTYPE aExpectedError);
+ TBool MosSetCameraOneShotL(const TDesC8& aComp, TInt aIsOneShot, OMX_ERRORTYPE aExpectedError);
+ TBool MosSetCameraCaptureL(const TDesC8& aComp, TInt aPortIndex, TInt aIsCapturing, OMX_ERRORTYPE aExpectedError);
+ void MosParseError(const TDesC& aError);
+ TBool MosWaitL(TTimeIntervalMicroSeconds32 aDelay);
+ TBool MosExpectEventL(const TDesC8& aComp, OMX_EVENTTYPE aEvent, TUint32 nData1, TUint32 nData2);
+ TBool MosWaitForAllEventsL();
+ TBool MosTransition(const TDesC8& aComp, OMX_STATETYPE aState, TBool aAsync);
+ TBool MosFailingTransition(const TDesC8& aComp, OMX_STATETYPE aState,OMX_ERRORTYPE aExpectedError);
+ TBool MosCheckStateL(const TDesC8& aComp, OMX_STATETYPE aState);
+ TBool MosCheckVideoPortDefL(const TDesC8& aComp, TInt aPortIndex, TInt aWidth, TInt aHeight, OMX_VIDEO_CODINGTYPE aCoding, OMX_COLOR_FORMATTYPE aColorFormat);
+ TBool MosCheckMetaDataL(const TDesC8& aComp, TInt aPortIndex, OMX_METADATASCOPETYPE aScope, const TDesC8& aAtomType, TUint32 aAtomIndex, const TDesC8& aData);
+ TBool MosGetParameterUnknownIndexTypeL(const TDesC8& aComp, TInt aPortIndex, OMX_METADATASCOPETYPE aScope, const TDesC8& aAtomType, TUint32 aAtomIndex, const TDesC8& aData);
+ TBool MosSetParameterUnknownIndexTypeL(const TDesC8& aComp, TInt aPortIndex, OMX_METADATASCOPETYPE aScope, const TDesC8& aAtomType, TUint32 aAtomIndex, const TDesC8& aData);
+
+ TBool MosDisablePort(const TDesC8& aComp, TInt aPortIndex);
+ TBool MosEnablePort(const TDesC8& aComp, TInt aPortIndex);
+ TBool MosIgnoreEventL(const TDesC8& aComp, OMX_EVENTTYPE aEvent, TUint32 nData1, TUint32 nData2);
+ TBool MosSetPcmAudioPortDefL(const TDesC8& aComp, TInt aPortIndex, TInt aNumChannels, TInt aSamplingRate, TInt aBitsperSample, OMX_NUMERICALDATATYPE aNumData, OMX_ENDIANTYPE aEndian, OMX_BOOL* aInterleaved, const TDesC8* aEncoding);
+ TBool MosSetConfigAudioVolumeL(const TDesC8& aComp, TInt aPortIndex, TBool aLinear, TInt aMinVolume, TInt aMaxVolume, TInt aVolume, OMX_ERRORTYPE aExpectedError);
+ TBool MosCheckConfigAudioVolumeL(const TDesC8& aComp, TInt aPortIndex, TBool aLinear, TInt aMinVolume, TInt aMaxVolume, TInt aVolume);
+ TBool MosCheckConfigAudioMuteL(const TDesC8& aComp, TInt aPortIndex, TBool aMute);
+ TBool MosSetConfigAudioMuteL(const TDesC8& aComp, TInt aPortIndex, TBool aMute);
+ TBool MosSetAacAudioPortDefL(const TDesC8& aComp, TInt aPortIndex, TInt aNumChannels, TInt aSamplingRate, TInt aBitRate, TInt aAudioBandwidth, TInt aFrameLength, TInt aAacTools, TInt aAacErTools, TInt aProfile, TInt aStreamFormat, TInt aChannelMode);
+ TBool MosSetAudioPortDefL(const TDesC8& aComp, TInt aPortIndex, OMX_AUDIO_CODINGTYPE* aCodingType, OMX_ERRORTYPE aExpectedError);
+ TBool MosSetRefClockTypeL(const TDesC8& aComp, OMX_TIME_REFCLOCKTYPE aRefClockType);
+ TBool MosSetClockTimeScale(const TDesC8& aComp, OMX_S32 aScale);
+ TBool MosSetClockStateL(const TDesC8& aComp, OMX_TIME_CLOCKSTATE aClockState, TInt aStartTime, TInt aOffset, TUint32 aWaitMask);
+ TBool MosCheckClockStateL(const TDesC8& aComp, OMX_TIME_CLOCKSTATE aClockState);
+ TBool MosCheckTimePositionL(const TDesC8& aComp, TInt aPortIndex, TInt aTimestamp);
+ TBool MosSetTimePositionL(const TDesC8& aComp, TInt aPortIndex, TInt aTimestamp);
+ TBool MosSetClientStartTimeL(const TDesC8& aComp, TInt aPortIndex, TInt aTimestamp);
+ TBool MosSetCurrentAudioReferenceTimeL(const TDesC8& aComp, TInt aPortIndex, TInt aTimestamp);
+ TBool MosSetVideoFitModeL(TVideoFitMode aVideoFitMode);
+ TBool MosNegativeSetDataChunk(const TDesC8& aComp, OMX_ERRORTYPE aExpectedError, TInt aExpectedSystemError);
+ TBool MosCheckFrameCountL(const TDesC& aFilename, TInt aCount);
+ TBool InitialiseBufferHandlerL(const TDesC8& aComp, TDesC& aName, const TDesC8* aType);
+ void StartBufferHandler();
+ void StopBufferHandler();
+ void SendInvalidBufferId(TInt aInvalidId);
+ TBool InitialiseBufferSinkHandlerL(const TDesC8& aComp, TDesC& aName);
+ void StartBufferSinkHandler();
+ void StopBufferSinkHandler();
+
+ TBool MosSetBufferSize(const TDesC8& aComp, TInt aPortIndex, TInt aCount, OMX_ERRORTYPE aExpectedError);
+ TBool MosGetAndCompareBufferCount(const TDesC8& aComp, TInt aPortIndex, TInt aDataToCompare);
+ TBool MosGetAndCompareBufferSize(const TDesC8& aComp, TInt aPortIndex, TInt aDataToCompare);
+ TBool MosFlushBuffer(const TDesC8& aComp, TInt aPortIndex, OMX_ERRORTYPE aExpectedError);
+ TBool MosForceFlushBuffer(const TDesC8& aComp, TInt aPortIndex, OMX_ERRORTYPE aExpectedError);
+ TBool MosSetActiveStream(const TDesC8& aComp, TUint32 aPortIndex);
+ TBool MosGetActiveStream(const TDesC8& aComp, TUint32 aPortIndex);
+ TBool MosChangeFilledBufferLength(const TDesC8& aComp, TInt aValue);
+ TBool MosSetOMX_SymbianIndexParamBufferMsgQueueData(const TDesC8& aComp, OMX_ERRORTYPE aExpectedError);
+ TBool MosGetExtensionIndex(const TDesC8& aComp, const TDesC8& aParameterName, OMX_ERRORTYPE aExpectedError);
+
+ TBool MosCheckTimeClockState(const TDesC8& aComp, OMX_TIME_CLOCKSTATE aExpectedState);
+ TBool MosCheckMediaTime(const TDesC8& aComp, TInt aPortIndex, OMX_TICKS aMediaTime, TBool aMoreThan);
+ TBool MosBaseSupportPortL(const TDesC8& aComp, TInt aPortIndex);
+ TBool MosBaseSetAutonomous(const TDesC8& aComp, TInt aPortIndex, TBool aEnabled);
+ TBool MosBaseAllocateBuffersL(const TDesC8& aComp, TInt aPortIndex, TInt aNumberBuffers);
+ TBool MosBaseFreeAllocatedBuffersL(const TDesC8& aComp);
+ TBool MosBaseSetBufSupplier(const TDesC8& aComp, TInt aPortIndex, TBool aComponentSupplier);
+ TBool MosBaseFillThisBuffer(const TDesC8& aComp, TInt aPortIndex, TInt aPortRelBufIndex);
+ TBool MosBaseEmptyThisBuffer(const TDesC8& aComp, TInt aPortIndex, TInt aPortRelBufIndex);
+ TBool MosBaseWaitForBuffer(const TDesC8& aComp, TInt aPortIndex, TInt aPortRelBufIndex);
+ TBool MosBaseTimestampPassClock(const TDesC8& aCompReceiving, const TDesC8& aClockCompToPass);
+ TBool MosBaseTimestampCheckTimestampL(const TDesC8& aComp, TInt aPortIndex, TUint aExpectedTime, TUint aTolerance);
+ TBool MosBaseTimestampCompareWithRefClockL(const TDesC8& aComp, TInt aPortIndex, TUint aTolerance);
+ TBool MosMarkBuffer(const TDesC8& aComp, TInt aPortIndex, const TDesC8& aTargetComp, TInt markData);
+
+ // mpeg4 encoder component
+ TBool MosSetVideoEncQuantL(const TDesC8& aComp, TInt aPortIndex, TInt aQpb);
+ TBool MosSetVideoEncMotionVectL(const TDesC8& aComp, TInt aPortIndex, TInt aAccuracy, TInt aSxSearchrange, TInt aSySearchrange, OMX_ERRORTYPE aExpectedError);
+ TBool MosSetVideoEncMpeg4TypeL(const TDesC8& aComp, TInt aPortIndex, OMX_VIDEO_MPEG4PROFILETYPE aMpeg4Profile, OMX_VIDEO_MPEG4LEVELTYPE aMpeg4Level, OMX_ERRORTYPE aExpectedError);
+ TBool MosSetVideoEncBitRateL(const TDesC8& aComp, TInt aPortIndex, OMX_VIDEO_CONTROLRATETYPE aControlRate, TInt aTargetBitrate, OMX_ERRORTYPE aExpectedError);
+
+ TBool MosSetAACProfileL(const TDesC8& aComp, TInt aPortIndex, TInt aChannels, TInt aSamplingRate, TInt aBitRate, TInt aAudioBandwidth, TInt aFrameLength, TInt aAACTools, TInt aAACERTools, OMX_AUDIO_AACPROFILETYPE aProfile, OMX_AUDIO_AACSTREAMFORMATTYPE aStreamFormat, OMX_AUDIO_CHANNELMODETYPE aChannelMode);
+
+ // Camera
+
+ TBool MosSetSensorModeTypeL(const TDesC8& aComp, TInt aPort, TInt aFrameRate, TBool aOneShot, TInt aWidth, TInt aHeight);
+ TBool MosSetCaptureModeTypeL(const TDesC8& aComp, TInt aPort, TBool aContinuous, TBool aFrameLimited, TInt aFrameLimit);
+
+
+ // Debugging/Utility functions.
+ TBool MosDeleteFileL(const TDesC& aFileName, TBool aFileMustExist);
+ TBool MosLogAllEventsL();
+
+ // MASBreakCallback
+ void AllComponentsEOS();
+ void AllComponentsTransitioned(OMX_STATETYPE aNewState,
+ OMX_STATETYPE aOldState);
+ void EventReceived(OMX_COMPONENTTYPE* aComponent, OMX_EVENTTYPE aEvent, TUint32 aData1, TUint32 aData2, TAny* aEventData);
+ void ComponentTransitioned(OMX_STATETYPE aNewState,
+ OMX_STATETYPE aOldState);
+ void BufferDone(OMX_COMPONENTTYPE* aComponent, OMX_BUFFERHEADERTYPE* aBufHdr, TBool aSource);
+
+ // MTimerObserver
+ void TimerExpired();
+
+ TBool MosSetupBufferForPortL(const TDesC8& comp,TInt aPortIndex, const TDesC& aFileName,TInt aHeaderLength,OMX_BUFFERSUPPLIERTYPE aSupplier);
+ TBool MosStartBuffersforPort(const TDesC8& aComp, TInt aPortIndex);
+#ifdef OLD_ADPCM_EXTENSION
+ TBool MosSetAdPcmAudioPortDefL(const TDesC8& aComp, TInt aPortIndex, TInt aNumChannels, TInt aSamplingRate, TInt aBitsperSample);
+ TBool MosConfigAdPcmDecoderBlockAlign(const TDesC8& aComp, OMX_S32 aBlockAlign);
+#endif
+
+public:
+ enum TOmxScriptTestVerdict
+ {
+ EPass, EFail, EPending
+ };
+
+ TInt Reason() const;
+ TOmxScriptTestVerdict Verdict() const;
+ void FailWithOmxError(const TDesC& aOperation, OMX_ERRORTYPE aError);
+ void StopTest(TOmxScriptTestVerdict aVerdict);
+ void StopTest(TInt aError, TOmxScriptTestVerdict aVerdict);
+ void FailTest(const TDesC& aErrorMsg);
+
+ TBool MosForceBufferSourceFlushBufferL(const TDesC8& aComp, TInt aPortIndex, OMX_ERRORTYPE aExpectedError);
+ TBool MosForceBufferSinkFlushBuffer(const TDesC8& aComp, TInt aPortIndex, OMX_ERRORTYPE aExpectedError);
+
+ static TBool ShortNameMatchComparison(const TDesC8* aShortName, const ROmxScriptTest::CComponentInfo& aComponentInfo);
+
+ void BeginWait();
+ void EndWait();
+
+private:
+ TBool ComponentLogicalIL(const TDesC8& aName);
+ TBool ComponentPhysicalIL(const TDesC8& aName);
+ OMX_COMPONENTTYPE* ComponentByName(const TDesC8& aName);
+ void GetComponentName(const OMX_COMPONENTTYPE* aHandle, TDes& aName);
+ void FailWithOmxError(const TDesC8& aComponent, const TDesC& aOperation, OMX_ERRORTYPE aError);
+ // static void CleanupOmxComponent(TAny*);
+ static void FormatHex(const TDesC8& bin, TDes& hex);
+ void WriteInt32(TUint8* aPtr, TInt32 aData);
+ void HashFileL(const TDesC& aFileName, TDes8& aHash, void (*aFilter1)(RBuf8&) = NULL, void (*aFilter2)(RBuf8&) = NULL, void (*aFilter3)(RBuf8&) = NULL );
+ TBool HandleNonTunneledBuffers(OMX_STATETYPE aNewState, OMX_COMPONENTTYPE* aComp);
+ TBool HandlePortBufferHandler(OMX_STATETYPE aNewState, OMX_COMPONENTTYPE* aComp);
+
+ void LogExtra(const TText8* aFile, TInt aLine, TOmxScriptSeverity aSeverity,
+ TRefByValue<const TDesC16> aFmt,...);
+ void RegisterTunnel(OMX_COMPONENTTYPE* aSourceComp, TInt aSourcePort, OMX_COMPONENTTYPE* aSinkComp, TInt aSinkPort);
+
+ class TComponentInfo
+ {
+ public:
+ HBufC8* iShortName;
+ HBufC8* iComponentName;
+ OMX_COMPONENTTYPE* iComponent;
+ };
+class TFilledBufferHeaderV2
+ {
+public:
+ /** Amount of buffer filled with actual data */
+ TUint iFilledLength;
+ /** Any timestamp associated with the buffer */
+ TInt64 iTimeStamp;
+ /** Combination of OMX_BUFFERFLAG_*, specified at page 68 in the OpenMAX spec. */
+ TUint iFlags;
+ /** offset **/
+ TUint32 iOffset;
+ };
+ class TTunnelInfo
+ {
+ public:
+ OMX_COMPONENTTYPE* iSourceComponent;
+ TInt iSourcePort;
+ OMX_COMPONENTTYPE* iSinkComponent;
+ TInt iSinkPort;
+ };
+
+ RArray<TTunnelInfo> iTunnels;
+ typedef RArray<TTunnelInfo> RTunnelRelations;
+ void FindTransitionOrderL(const RPointerArray<CComponentInfo>& aComponents,
+ const RTunnelRelations& aTunnelRelations,
+ RArray<TInt>& aOrder);
+
+private:
+ TBool iCoreLoaded;
+ RPointerArray<CComponentInfo> iComponents;
+ RASBreakEventHandler iEventHandler;
+ OMX_STATETYPE iState;
+
+ // Symbian graphic sink specialisation
+ CWindowManager* iWindowManager;
+ TVideoFitMode iVideoFitMode;
+ OMX_INDEXTYPE iExtSurfaceConfigIndex;
+ OMX_COMPONENTTYPE* iGraphicSink;
+
+ CVideoTestTimer *iTimer;
+
+ RArray<TExpectedEvent> iExpectedEvents;
+ TBool iWaitingForEvents;
+
+ CNonTunneledHandler* iNonTunneledHandler;
+ RArray<TExpectedEvent> iIgnoredEvents;
+
+ // Buffer component handler
+ CVideoBufferHandler* iBufferHandler;
+ CVideoBufferSinkHandler* iBufferSinkHandler;
+
+ TInt iReason;
+ TOmxScriptTestVerdict iVerdict;
+ MOmxScriptTestLogger& iLogger;
+
+ CAsyncCallBack* iStopSchedulerCallback;
+
+ RMsgQueue<TFilledBufferHeaderV2> iMsgQueue;
+ CPortBufferHandler* iPortBufferHandler;
+ };
+
+#endif /*OMXSCRIPTTEST_H_*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/src/omxthreadrequest.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,255 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "omxthreadrequest.h"
+
+COmxThreadRequest* COmxThreadRequest::NewL()
+ {
+ COmxThreadRequest* self = new (ELeave) COmxThreadRequest();
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ CleanupStack::Pop(self);
+ return self;
+ }
+
+COmxThreadRequest::COmxThreadRequest()
+ {
+ }
+
+void COmxThreadRequest::ConstructL()
+ {
+ //Parameters to send to the sub thread
+ TThreadParam param;
+ param.iThreadRequestObj = this;
+
+ //Get a reference to this thread's heap
+ RHeap& thisHeap = User::Heap();
+
+ //Get the id of this thread
+ RThread thisThread;
+ TThreadId thisThreadId = thisThread.Id();
+ param.iMainThreadId = thisThreadId;
+
+ //Get a request to signal for setup completion
+ TRequestStatus setupComplete = KRequestPending;
+ param.iSetupComplete = &setupComplete;
+
+ //current time and the "this" pointer for a unique key
+ _LIT(KFormatString,"%S.%020Lu.%08X");
+ TName threadName;
+ TTime now;
+ now.UniversalTime();
+ threadName.Format(KFormatString, &KXMLClientOMXThreadName, now.Int64(), reinterpret_cast<TUint>(this));
+
+ //Create a new thread using the same heap as this thread
+ TInt result = iRequestThread.Create(threadName,
+ ThreadCreateFunction,
+ KDefaultStackSize,
+ &thisHeap,
+ ¶m);
+ User::LeaveIfError(result);
+
+ //Run the thread under high priority
+ iRequestThread.SetPriority(EPriorityNormal);
+
+ //Wait for thread startup to complete
+ TRequestStatus threadStatus = KRequestPending;
+ iRequestThread.Logon(threadStatus);
+
+ //Start the thread
+ iRequestThread.Resume();
+ User::WaitForRequest(threadStatus, setupComplete);
+ if(threadStatus != KRequestPending)
+ {
+ //Thread creation failed
+ TInt reason = iRequestThread.ExitReason();
+ User::Leave(reason);
+ }
+
+ // Thread creation was successfull
+ TInt error = iRequestThread.LogonCancel(threadStatus);
+ User::LeaveIfError(error); // There is no outstanding request
+ User::WaitForRequest(threadStatus); // Consume the signal
+
+ iThreadCreated = ETrue;
+ User::LeaveIfError(setupComplete.Int());
+ }
+
+/**
+Main thread entry point for the omx sub-thread.
+Create a cleanup stack for the thread and process the commands
+inside a trap for cleanup behaviour.
+@internalComponent
+
+@param aPtr Parameters to be used for creating the thread.
+@return The error code for thread termination.
+*/
+TInt COmxThreadRequest::ThreadCreateFunction(TAny* aPtr)
+ {
+ TInt error = KErrNone;
+
+ // Create a cleanup stack for the thread
+ CTrapCleanup* cleanupStack = CTrapCleanup::New();
+ if (cleanupStack)
+ {
+ if(error == KErrNone)
+ {
+ TRAP(error, ThreadTrapFunctionL(aPtr));
+ }
+ }
+ else
+ {
+ error = KErrNoMemory;
+ }
+
+ delete cleanupStack;
+ return error;
+ }
+
+/**
+Function for thread execution. If the thread is successfully created signal
+the main thread that the thread creation was successfull. Then enter OMX
+request loop.
+
+@internalComponent
+
+@param aPtr A pointer to a TThreadParam object containing the startup parameters
+ for the thread.
+*/
+void COmxThreadRequest::ThreadTrapFunctionL(TAny* aPtr)
+ {
+ TThreadParam* param = static_cast<TThreadParam*>(aPtr);
+ COmxThreadRequest* iThreadRequestObj = param->iThreadRequestObj;
+
+ // tell main thread that setup is complete
+ RThread mainThread;
+ mainThread.Open(param->iMainThreadId);
+ mainThread.RequestComplete(param->iSetupComplete, KErrNone);
+ mainThread.Close();
+
+ // loop to execute OMX commands in own thread
+ while(iThreadRequestObj->iFunction != EOMXFunctionCodeTerminate)
+ {
+ iThreadRequestObj->iRequestThreadStatus = KRequestPending;
+
+ // block until client request is made
+ User::WaitForRequest(iThreadRequestObj->iRequestThreadStatus);
+ switch(iThreadRequestObj->iFunction)
+ {
+ case EOMXFunctionCodeGetHandle:
+ iThreadRequestObj->iErrorType = OMX_GetHandle(
+ iThreadRequestObj->ipHandle,
+ iThreadRequestObj->icComponentName,
+ iThreadRequestObj->ipAppData,
+ iThreadRequestObj->ipCallBacks);
+ break;
+
+ case EOMXFunctionCodeFreeHandle:
+ iThreadRequestObj->iErrorType = OMX_FreeHandle(
+ iThreadRequestObj->ihComponent);
+ break;
+
+ case EOMXFunctionCodeTerminate:
+ break;
+
+ default:
+ // should never be reached
+ User::Panic(_L("COmxThreadRequest"), KErrNotSupported);
+ }
+
+ // complete client request
+ TRequestStatus *status = iThreadRequestObj->iCallingStatus;
+ RThread callingThread;
+ callingThread.Open(iThreadRequestObj->iCallingThreadId);
+ callingThread.RequestComplete(status, KErrNone);
+ callingThread.Close();
+ }
+ }
+
+COmxThreadRequest::~COmxThreadRequest()
+ {
+ if(iThreadCreated)
+ {
+ TRequestStatus status;
+ // Logon to ensure thread has completely terminated, not just broken out of message handling loop.
+ // In particular this ensures the cleanup stack is destroyed before the heap marks are inspected.
+ iRequestThread.Logon(status);
+ Terminate();
+ User::WaitForRequest(status);
+ iThreadCreated = EFalse;
+ iRequestThread.Close();
+ }
+ }
+
+OMX_ERRORTYPE COmxThreadRequest::GetHandle(
+ OMX_OUT OMX_HANDLETYPE* pHandle,
+ OMX_IN OMX_STRING cComponentName,
+ OMX_IN OMX_PTR pAppData,
+ OMX_IN OMX_CALLBACKTYPE* pCallBacks)
+ {
+ ipHandle = pHandle;
+ icComponentName = cComponentName;
+ ipAppData = pAppData;
+ ipCallBacks = pCallBacks;
+
+ iFunction = EOMXFunctionCodeGetHandle;
+ DoRequest();
+
+ return iErrorType;
+ }
+
+OMX_ERRORTYPE COmxThreadRequest::FreeHandle(
+ OMX_IN OMX_HANDLETYPE hComponent)
+ {
+ ihComponent = hComponent;
+
+ iFunction = EOMXFunctionCodeFreeHandle;
+ DoRequest();
+
+ return iErrorType;
+ }
+
+void COmxThreadRequest::Terminate()
+ {
+ iFunction = EOMXFunctionCodeTerminate;
+ DoRequest();
+ }
+
+void COmxThreadRequest::DoRequest()
+ {
+ RThread me;
+ iCallingThreadId = me.Id();
+
+ TRequestStatus callingRequestStatus = KRequestPending;
+ iCallingStatus = &callingRequestStatus;
+
+ // send request to request thread
+ RThread requestThread;
+ requestThread.Open(iRequestThread.Id());
+ TRequestStatus* requestStatus = &iRequestThreadStatus;
+ requestThread.RequestComplete(requestStatus, KErrNone);
+ requestThread.Close();
+
+ // block calling request until OMX request completes
+ User::WaitForRequest(callingRequestStatus);
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/src/omxthreadrequest.h Wed Aug 25 12:40:50 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 <e32base.h>
+#include <openmax/il/khronos/v1_x/OMX_Core.h>
+
+#ifndef OMXTHREADREQUEST_H
+#define OMXTHREADREQUEST_H
+
+_LIT(KXMLClientOMXThreadName, "XMLClientOMXThread");
+
+NONSHARABLE_CLASS(COmxThreadRequest) : public CBase
+ {
+public:
+ static COmxThreadRequest * NewL();
+ ~COmxThreadRequest();
+
+ OMX_ERRORTYPE GetHandle(
+ OMX_OUT OMX_HANDLETYPE* pHandle,
+ OMX_IN OMX_STRING cComponentName,
+ OMX_IN OMX_PTR pAppData,
+ OMX_IN OMX_CALLBACKTYPE* pCallBacks);
+
+ OMX_ERRORTYPE FreeHandle(OMX_IN OMX_HANDLETYPE hComponent);
+
+private:
+ enum TOMXCoreFunctionCode
+ {
+ EOMXFunctionCodeNone,
+ EOMXFunctionCodeGetHandle,
+ EOMXFunctionCodeFreeHandle,
+ EOMXFunctionCodeTerminate
+
+ // ... more to be added when required
+ };
+private:
+ COmxThreadRequest();
+ void ConstructL();
+ void Terminate();
+ void DoRequest();
+
+ static TInt ThreadCreateFunction(TAny* aPtr);
+ static void ThreadTrapFunctionL(TAny* aPtr);
+
+private:
+
+ TOMXCoreFunctionCode iFunction;
+
+ RThread iRequestThread;
+ TRequestStatus iRequestThreadStatus;
+ //TThreadId iRequestThreadId;
+ TBool iThreadCreated;
+
+ TRequestStatus* iCallingStatus; // not owned
+ TThreadId iCallingThreadId;
+
+ OMX_ERRORTYPE iErrorType; // not owned
+ OMX_HANDLETYPE* ipHandle; // not owned
+ OMX_STRING icComponentName; // not owned
+ OMX_PTR ipAppData; // not owned
+ OMX_CALLBACKTYPE* ipCallBacks; // not owned
+ OMX_HANDLETYPE ihComponent; // not owned
+ };
+
+/** Internal class for passing parameter to OMX thread */
+class TThreadParam
+ {
+public:
+ TThreadId iMainThreadId;
+ TRequestStatus* iSetupComplete; //Not owned
+ COmxThreadRequest* iThreadRequestObj; //Not owned
+ };
+
+#endif //OMXTHREADREQUEST_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/src/omxutil.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,71 @@
+/*
+* 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:
+*
+*/
+
+
+#include "omxutil.h"
+
+void OMXUtil::ErrorDes(OMX_ERRORTYPE aError, TBuf<64>& aErrorDes)
+ {
+ switch(aError)
+ {
+#define DEFERR(x) case x: aErrorDes = _L(#x); break;
+ DEFERR(OMX_ErrorNone);
+ DEFERR(OMX_ErrorInsufficientResources);
+ DEFERR(OMX_ErrorUndefined);
+ DEFERR(OMX_ErrorInvalidComponentName);
+ DEFERR(OMX_ErrorComponentNotFound);
+ DEFERR(OMX_ErrorInvalidComponent);
+ DEFERR(OMX_ErrorBadParameter);
+ DEFERR(OMX_ErrorNotImplemented);
+ DEFERR(OMX_ErrorUnderflow);
+ DEFERR(OMX_ErrorOverflow);
+ DEFERR(OMX_ErrorHardware);
+ DEFERR(OMX_ErrorInvalidState);
+ DEFERR(OMX_ErrorStreamCorrupt);
+ DEFERR(OMX_ErrorPortsNotCompatible);
+ DEFERR(OMX_ErrorResourcesLost);
+ DEFERR(OMX_ErrorNoMore);
+ DEFERR(OMX_ErrorVersionMismatch);
+ DEFERR(OMX_ErrorNotReady);
+ DEFERR(OMX_ErrorTimeout);
+ DEFERR(OMX_ErrorSameState);
+ DEFERR(OMX_ErrorResourcesPreempted);
+ DEFERR(OMX_ErrorPortUnresponsiveDuringAllocation);
+ DEFERR(OMX_ErrorPortUnresponsiveDuringDeallocation);
+ DEFERR(OMX_ErrorPortUnresponsiveDuringStop);
+ DEFERR(OMX_ErrorIncorrectStateTransition);
+ DEFERR(OMX_ErrorIncorrectStateOperation);
+ DEFERR(OMX_ErrorUnsupportedSetting);
+ DEFERR(OMX_ErrorUnsupportedIndex);
+ DEFERR(OMX_ErrorBadPortIndex);
+ DEFERR(OMX_ErrorPortUnpopulated);
+ DEFERR(OMX_ErrorComponentSuspended);
+ DEFERR(OMX_ErrorDynamicResourcesUnavailable);
+ DEFERR(OMX_ErrorMbErrorsInFrame);
+ DEFERR(OMX_ErrorFormatNotDetected);
+ DEFERR(OMX_ErrorContentPipeOpenFailed);
+ DEFERR(OMX_ErrorContentPipeCreationFailed);
+ DEFERR(OMX_ErrorSeperateTablesUsed);
+ DEFERR(OMX_ErrorTunnelingUnsupported);
+ DEFERR(OMX_ErrorKhronosExtensions);
+ DEFERR(OMX_ErrorVendorStartUnused);
+#undef DEFERR
+ default:
+ aErrorDes.Format(_L("%u"), aError);
+ break;
+ }
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/src/omxutil.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,31 @@
+/*
+* 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 OMXUTIL_H_
+#define OMXUTIL_H_
+
+#include <e32cmn.h>
+#include <openmax/il/khronos/v1_x/OMX_Core.h>
+
+class OMXUtil
+ {
+public:
+ static void ErrorDes(OMX_ERRORTYPE aError, TBuf<64>& aErrorDes);
+ };
+
+#endif /*OMXUTIL_H_*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/src/paramconversion.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,69 @@
+/*
+* 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:
+*
+*/
+
+
+/**
+@file
+@internalComponent
+*/
+
+#include "paramconversion.h"
+#include <uri8.h>
+#include <openmax/il/khronos/v1_x/OMX_Component.h>
+
+OMX_PARAM_CONTENTURITYPE* ParamConversion::FilenameAsContentUriStructV1_0L(const TDesC& aFileName)
+ {
+ CUri8* aFileUri = CUri8::CreateFileUriL(aFileName);
+ CleanupStack::PushL(aFileUri);
+ const TDesC8& aUriDes = aFileUri->Uri().UriDes();
+ if(aUriDes.Length() > 255)
+ {
+ User::Leave(KErrTooBig);
+ }
+ OMX_PARAM_CONTENTURITYPE* aUriStruct = reinterpret_cast<OMX_PARAM_CONTENTURITYPE*>(new(ELeave) TUint8[264]);
+ aUriStruct->nSize = 264;
+ aUriStruct->nVersion.s.nVersionMajor = 1;
+ aUriStruct->nVersion.s.nVersionMinor = 0;
+ aUriStruct->nVersion.s.nRevision = 0;
+ aUriStruct->nVersion.s.nStep = 0;
+ TPtr8 aUriStructDes(aUriStruct->contentURI, aUriDes.Length()+1);
+ aUriStructDes = aUriDes;
+ aUriStructDes.Append('\0');
+ CleanupStack::PopAndDestroy(aFileUri);
+ return aUriStruct;
+ }
+
+OMX_PARAM_CONTENTURITYPE* ParamConversion::FilenameAsContentUriStructV1_1L(const TDesC& aFileName)
+ {
+ CUri8* aFileUri = CUri8::CreateFileUriL(aFileName);
+ CleanupStack::PushL(aFileUri);
+ const TDesC8& aUriDes = aFileUri->Uri().UriDes();
+ // sizeof(OMX_PARAM_CONTENTURITYPE) includes 1 byte for the URI name. counting this as well leaves room for a null terminator.
+ TInt aStructSize = 9 + aUriDes.Length();
+ TUint8* aUriBytes = new(ELeave) TUint8[aStructSize];
+ OMX_PARAM_CONTENTURITYPE* aUriStruct = reinterpret_cast<OMX_PARAM_CONTENTURITYPE*>(aUriBytes);
+ aUriStruct->nSize = aStructSize;
+ aUriStruct->nVersion.s.nVersionMajor = OMX_VERSION_MAJOR;
+ aUriStruct->nVersion.s.nVersionMinor = OMX_VERSION_MINOR;
+ aUriStruct->nVersion.s.nRevision = OMX_VERSION_REVISION;
+ aUriStruct->nVersion.s.nStep = OMX_VERSION_STEP;
+ TPtr8 aUriStructDes(aUriStruct->contentURI, aUriDes.Length()+1);
+ aUriStructDes = aUriDes;
+ aUriStructDes.Append('\0');
+ CleanupStack::PopAndDestroy(aFileUri);
+ return aUriStruct;
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/src/paramconversion.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,53 @@
+/*
+* 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:
+*
+*/
+
+
+/**
+@file
+@internalComponent
+*/
+
+#ifndef PARAMCONVERSION_H_
+#define PARAMCONVERSION_H_
+
+#include <e32cmn.h>
+
+struct OMX_PARAM_CONTENTURITYPE;
+
+class ParamConversion
+ {
+public:
+ /**
+ * Converts a file name to a URI, then allocates and fills an
+ * OMX_PARAM_CONTENTURITYPE structure for OpenMAX IL v1.0. In OpenMax IL
+ * v1.0, this structure cannot contain URIs larger than 256 bytes
+ * (including the null terminator). If the converted URI exceeds this
+ * limit, this method leaves with KErrTooBig.
+ */
+ static OMX_PARAM_CONTENTURITYPE*
+ FilenameAsContentUriStructV1_0L(const TDesC& aFileName);
+
+ /**
+ * Converts a file name to a URI, then allocates and fills an
+ * OMX_PARAM_CONTENTURITYPE structure for OpenMAX IL v1.1. In OpenMax IL
+ * v1.1, this structure can contain URIs of arbitrary length.
+ */
+ static OMX_PARAM_CONTENTURITYPE*
+ FilenameAsContentUriStructV1_1L(const TDesC& aFileName);
+ };
+
+#endif /*PARAMCONVERSION_H_*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/src/parsemap.c Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,76 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include "parsemap.h"
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <errno.h>
+
+/* function that searches untyped parseMap_XXX tables. also performs literal integer parsing. */
+PARSEMAP_LINKAGE int ParseMapSearch(const char* text, int* result, ParseMapEntry* entries, int numEntries)
+{
+ int textlen = strlen(text);
+ int i;
+ char* endptr = 0;
+
+ /* search the parse map for the matching string */
+ for(i = 0; i < numEntries; i++) {
+ if(entries[i].length == textlen && strcasecmp(text, entries[i].text) == 0) {
+ *result = entries[i].value;
+ return 1;
+ }
+ }
+ /* match not found */
+
+ /* try to parse string as an integer */
+ errno = 0;
+ i = strtol(text, &endptr, 0);
+ if(errno == ERANGE)
+ {
+ errno = 0;
+ i = (int) strtoul(text, &endptr, 0);
+ if(errno == ERANGE)
+ {
+ return 0;
+ }
+ }
+ if(endptr == (text + textlen)) /* all of string must be part of number */
+ {
+ *result = i;
+ return 1;
+ }
+
+ /* fail */
+ return 0;
+}
+
+PARSEMAP_LINKAGE const char* ParseMapSearchReverse(int value, char not_found_buf[11], ParseMapEntry* entries, int numEntries) {
+ int i;
+
+ /* search the parse map for the matching value */
+ for(i = 0; i < numEntries; i++) {
+ if(entries[i].value == value) {
+ return entries[i].text;
+ }
+ }
+
+ /* value not found in table, format hex string */
+ sprintf(not_found_buf, "0x%08X", value);
+ return not_found_buf;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/src/parsemap.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,77 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#ifndef PARSEMAP_H_
+#define PARSEMAP_H_
+
+/* define PARSEMAP_LINKAGE to prepend extern "C" in front of symbols if using a C++ compiler */
+#ifdef __cplusplus
+#define PARSEMAP_LINKAGE extern "C"
+#else
+#define PARSEMAP_LINKAGE
+#endif
+
+/* the structure used in the parseMap_XXX tables */
+typedef struct
+{
+ int value; /* numeric value */
+ const char* text; /* textual equivalent of value */
+ int length; /* length of text. avoids heavy use of strlen */
+} ParseMapEntry;
+
+/* function that searches untyped parseMap_XXX tables. also performs literal integer parsing. */
+PARSEMAP_LINKAGE int ParseMapSearch(const char* text, int* result, ParseMapEntry* entries, int numEntries);
+PARSEMAP_LINKAGE const char* ParseMapSearchReverse(int value, char not_found_buf[11], ParseMapEntry* entries, int numEntries);
+
+/* macro to declare a parser function of type T */
+#define DECL_PARSETYPE(T) \
+PARSEMAP_LINKAGE int parse_##T(const char* text, T* result); \
+PARSEMAP_LINKAGE const char* format_##T(T value, char not_found_buf[11])
+
+/* macro to begin a parseMap definition of type T */
+#define PARSE_MAP_START(T) \
+const ParseMapEntry parseMap_##T[] = {
+
+/* macro to add a ParseMapEntry struct to a parseMap table. preprocessor is used to generate text and length values. */
+#define PARSE_MAP_ENTRY(x) \
+{ x, #x, sizeof(#x)-1 }
+
+/* macro to create a ParseMapEntry where the text is not identical to the C identifier. */
+#define PARSE_MAP_ALIAS(val, alias) \
+{ val, alias, sizeof(alias)-1 }
+
+#define PARSE_MAP_PREFIXENTRY(prefix, tail) \
+PARSE_MAP_ENTRY(prefix##tail), \
+PARSE_MAP_ALIAS(prefix##tail, #tail)
+
+/* macro to end a parseMap definition. also defines the typed parser function */
+#define PARSE_MAP_END(T) \
+}; \
+\
+PARSEMAP_LINKAGE int parse_##T(const char* text, T* result) \
+ { \
+ return ParseMapSearch(text, (int*) result, (ParseMapEntry*) parseMap_##T, sizeof(parseMap_##T) / sizeof(ParseMapEntry)); \
+ } \
+\
+PARSEMAP_LINKAGE const char* format_##T(T value, char not_found_buf[11]) \
+ { \
+ return ParseMapSearchReverse((int) value, not_found_buf, (ParseMapEntry*) parseMap_##T, sizeof(parseMap_##T) / sizeof(ParseMapEntry)); \
+ } \
+
+
+#endif /* PARSEMAP_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/src/portbufferhandler.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,616 @@
+// 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 "portbufferhandler.h"
+#include "log.h" // currently needed for INFO_PRINTF etc macros
+
+/**
+ * Overflow handler to generate a warning message if a log line will not fit
+ * in the descriptor.
+ */
+class TOverflowHandler : public TDes16Overflow
+ {
+public:
+ void Overflow(TDes& aDes)
+ {
+ _LIT(KWarning, "[truncated]");
+ if(aDes.Length() + KWarning().Length() > aDes.MaxLength())
+ {
+ aDes.SetLength(aDes.Length() - KWarning().Length());
+ }
+ aDes.Append(KWarning);
+ }
+ };
+
+CPortBufferHandler::CPortBufferHandler()
+ {
+ }
+
+CPortBufferHandler::~CPortBufferHandler()
+ {
+ }
+
+void CPortBufferHandler::AddPortL(OMX_COMPONENTTYPE* aComp,
+ TInt aPortNum,
+ const TDesC& aFileName,
+ OMX_BUFFERSUPPLIERTYPE aSupplier,
+ OMX_DIRTYPE aPortDir,
+ MOmxScriptTestLogger& aLogger,
+ TInt aHeaderLength)
+ {
+
+ CComponentInfo* compInfo = NULL;
+ TInt pos = iComponents.Find(*aComp, CComponentInfo::CompareComp);
+ if (pos >= 0)
+ {
+ compInfo = iComponents[pos];
+ }
+ else
+ {
+ compInfo = new (ELeave) CComponentInfo(aComp);
+ CleanupStack::PushL(compInfo);
+ iComponents.AppendL(compInfo);
+ CleanupStack::Pop(compInfo);
+ }
+
+
+ CPortInfo* portInfo = compInfo->AddPortL(aPortNum,aFileName,aSupplier,aPortDir,aLogger,aHeaderLength);
+ }
+
+void CPortBufferHandler::AllocateBuffersL(OMX_COMPONENTTYPE* aComp)
+ {
+ TInt pos = iComponents.Find(*aComp, CComponentInfo::CompareComp);
+ if (pos >= 0)
+ {
+ iComponents[pos]->AllocateBuffersL();
+ }
+ }
+
+void CPortBufferHandler::Start(OMX_COMPONENTTYPE* aComp, TInt aPortNum)
+ {
+ TInt pos = iComponents.Find(*aComp, CComponentInfo::CompareComp);
+ if (pos >= 0)
+ {
+ iComponents[pos]->Start(aPortNum);
+ }
+ }
+
+void CPortBufferHandler::Resume(OMX_COMPONENTTYPE* aComp, TInt aPortNum)
+ {
+ TInt pos = iComponents.Find(*aComp, CComponentInfo::CompareComp);
+ if (pos >= 0)
+ {
+ iComponents[pos]->Resume(aPortNum);
+ }
+ }
+
+void CPortBufferHandler::BufferDone(OMX_COMPONENTTYPE* aComp, OMX_BUFFERHEADERTYPE* aBufHdr, TBool aSource)
+ {
+ TInt pos = iComponents.Find(*aComp, CComponentInfo::CompareComp);
+ if (pos >= 0)
+ {
+ iComponents[pos]->BufferDone(aBufHdr, aSource);
+ }
+ }
+
+void CPortBufferHandler::Stop(OMX_COMPONENTTYPE* aComp, TInt aPortNum)
+ {
+ TInt pos = iComponents.Find(*aComp, CComponentInfo::CompareComp);
+ if (pos >= 0)
+ {
+ iComponents[pos]->Stop(aPortNum);
+ }
+ }
+
+
+void CPortBufferHandler::Pause(OMX_COMPONENTTYPE* aComp, TInt aPortNum)
+ {
+ TInt pos = iComponents.Find(*aComp, CComponentInfo::CompareComp);
+ if (pos >= 0)
+ {
+ iComponents[pos]->Pause(aPortNum);
+ }
+ }
+
+void CPortBufferHandler::FreeBuffers(OMX_COMPONENTTYPE* aComp)
+ {
+ TInt pos = iComponents.Find(*aComp, CComponentInfo::CompareComp);
+ if (pos >= 0)
+ {
+ iComponents[pos]->FreeBuffers();
+ }
+ }
+
+CPortBufferHandler::CComponentInfo::CComponentInfo(OMX_COMPONENTTYPE* aComp) :
+ iComp(aComp),iState(OMX_StateLoaded)
+ {
+ }
+
+CPortBufferHandler::CComponentInfo::~CComponentInfo()
+ {
+ iPorts.ResetAndDestroy();
+ }
+
+CPortBufferHandler::CPortInfo* CPortBufferHandler::CComponentInfo::AddPortL(TInt aPortNum, const TDesC& aFileName,OMX_BUFFERSUPPLIERTYPE aSupplier, OMX_DIRTYPE aPortDir, MOmxScriptTestLogger& aLogger, TInt aHeaderLength)
+ {
+ __ASSERT_ALWAYS(iPorts.Find(aPortNum, CPortInfo::ComparePortNum) == KErrNotFound, User::Invariant());
+
+ CPortInfo* portInfo = CPortInfo::NewL(iComp, aPortNum, aFileName, aSupplier, aPortDir, aLogger, aHeaderLength);
+ CleanupStack::PushL(portInfo);
+ iPorts.AppendL(portInfo);
+ CleanupStack::Pop(portInfo);
+
+ return portInfo;
+ }
+
+void CPortBufferHandler::CComponentInfo::AllocateBuffersL()
+ {
+ TInt numPorts = iPorts.Count();
+
+ for (TInt port = 0; port < numPorts; ++port)
+ {
+ iPorts[port]->AllocateBuffersL();
+ }
+ iState = OMX_StateIdle;
+ }
+
+void CPortBufferHandler::CComponentInfo::Start(TInt aPortNum)
+ {
+ TInt numPorts = iPorts.Count();
+
+ if(aPortNum == -1)
+ {
+ for (TInt port = 0; port < numPorts; ++port)
+ {
+ iPorts[port]->Start();
+ }
+ }
+ else
+ {
+ TInt pos = iPorts.Find(aPortNum, CPortInfo::ComparePortNum);
+ iPorts[pos]->Start();
+ }
+ iState = OMX_StateExecuting;
+ }
+
+void CPortBufferHandler::CComponentInfo::Resume(TInt aPortNum)
+ {
+ if(aPortNum == -1)
+ {
+ TInt numPorts = iPorts.Count();
+
+ for (TInt port = 0; port < numPorts; ++port)
+ {
+ iPorts[port]->Resume();
+ }
+ }
+ else
+ {
+ TInt pos = iPorts.Find(aPortNum, CPortInfo::ComparePortNum);
+ iPorts[pos]->Resume();
+ }
+ iState = OMX_StateExecuting;
+ }
+
+void CPortBufferHandler::CComponentInfo::BufferDone(OMX_BUFFERHEADERTYPE* aBufHdr, TBool aSource)
+ {
+ TInt pos = KErrNotFound;
+
+ if (aSource)
+ {
+ pos = iPorts.Find(static_cast<TInt>(aBufHdr->nOutputPortIndex), CPortInfo::ComparePortNum);
+ }
+ else
+ {
+ pos = iPorts.Find(static_cast<TInt>(aBufHdr->nInputPortIndex), CPortInfo::ComparePortNum);
+ }
+
+ __ASSERT_ALWAYS(pos != KErrNotFound, User::Invariant());
+
+ iPorts[pos]->BufferDone(aBufHdr);
+ }
+
+void CPortBufferHandler::CComponentInfo::Stop(TInt aPortNum)
+ {
+ if(aPortNum == -1)
+ {
+ for (TInt port = 0; port < iPorts.Count(); ++port)
+ {
+ iPorts[port]->Stop();
+ }
+ }
+ else
+ {
+ TInt pos = iPorts.Find(aPortNum, CPortInfo::ComparePortNum);
+ iPorts[pos]->Stop();
+ }
+ iState = OMX_StateIdle;
+ }
+
+void CPortBufferHandler::CComponentInfo::Pause(TInt aPortNum)
+ {
+ if(aPortNum == -1)
+ {
+ for (TInt port = 0; port < iPorts.Count(); ++port)
+ {
+ iPorts[port]->Pause();
+ }
+ }
+ else
+ {
+ TInt pos = iPorts.Find(aPortNum, CPortInfo::ComparePortNum);
+ iPorts[pos]->Pause();
+ }
+ iState = OMX_StatePause;
+ }
+
+void CPortBufferHandler::CComponentInfo::FreeBuffers()
+ {
+ for (TInt port = 0; port < iPorts.Count(); ++port)
+ {
+ iPorts[port]->FreeBuffers();
+ }
+ iState = OMX_StateLoaded;
+ }
+
+TBool CPortBufferHandler::CComponentInfo::CompareComp(const OMX_COMPONENTTYPE* aComp, const CComponentInfo& aComponentInfo)
+ {
+ return (aComp == aComponentInfo.iComp);
+ }
+
+
+CPortBufferHandler::CPortInfo::CPortInfo( OMX_COMPONENTTYPE* aComp,
+ TInt aPortNum,
+ OMX_BUFFERSUPPLIERTYPE aSupplier,
+ OMX_DIRTYPE aPortDir,
+ MOmxScriptTestLogger& aLogger,
+ TInt aHeaderLength):
+ iComp(aComp),
+ iPortNum(aPortNum),
+ iSupplier(aSupplier),
+ iPortDir(aPortDir),
+ iPosInputData(0),
+ iFileHeaderLength(0),
+ iFileFillingLength(0),
+ iLogger(aLogger),
+ iEOSReached(FALSE),
+ iTimeStamp(0)
+ {
+ if(aHeaderLength > -1)
+ {
+ iFileHeaderLength = aHeaderLength;
+ }
+ }
+
+CPortBufferHandler::CPortInfo* CPortBufferHandler::CPortInfo::NewL( OMX_COMPONENTTYPE* aComp,
+ TInt aPortNum,
+ const TDesC& aFileName,
+ OMX_BUFFERSUPPLIERTYPE aSupplier,
+ OMX_DIRTYPE aPortDir,
+ MOmxScriptTestLogger& aLogger,
+ TInt aHeaderLength)
+ {
+ CPortInfo* self = new (ELeave) CPortInfo(aComp,aPortNum,aSupplier,aPortDir,aLogger,aHeaderLength);
+ CleanupStack::PushL(self);
+
+ self->iFileName.Copy(KPortDirectoryPath);
+ self->iFileName.Append(aFileName);
+
+ User::LeaveIfError(self->iFs.Connect());
+ if(self->iPortDir == OMX_DirInput)
+ {
+ User::LeaveIfError(self->iFileObject.Open(self->iFs, self->iFileName, EFileShareExclusive|EFileRead));
+ }
+ else if(self->iPortDir == OMX_DirOutput)
+ {
+ User::LeaveIfError(self->iFileObject.Replace(self->iFs, self->iFileName, EFileWrite));
+ }
+ else
+ {
+ User::LeaveIfError(KErrNotFound);
+ }
+
+ CleanupStack::Pop(self);
+ return self;
+ }
+
+CPortBufferHandler::CPortInfo::~CPortInfo()
+ {
+ DeleteAllBuffers();
+ iFileObject.Close();
+ iFs.Close();
+ }
+
+void CPortBufferHandler::CPortInfo::AllocateBuffersL()
+ {
+ OMX_BUFFERHEADERTYPE* bufHdr = NULL;
+
+ if (iComp)
+ {
+
+ OMX_PARAM_PORTDEFINITIONTYPE portDef;
+ portDef.nSize = sizeof(portDef);
+ portDef.nVersion = KOmxLILVersion;
+ portDef.nPortIndex = iPortNum;
+ OMX_ERRORTYPE error = iComp->GetParameter(iComp, OMX_IndexParamPortDefinition, &portDef);
+ if(error != OMX_ErrorNone)
+ {
+ User::Leave(error);
+ }
+
+ iNumBufs = portDef.nBufferCountActual;
+ TInt bufSize = portDef.nBufferSize;
+
+ if(iFileHeaderLength <=0)
+ {
+ iFileHeaderLength = bufSize;
+ }
+
+ //fix for video partial tunnelling
+ //mpeg4decoder needs timestamp info in each frame.
+ //Buffer size approximately adjusted to framesize and timestamps added for each buffer
+ //this change is done for all video components(needed only for mpeg4decoder)
+
+ if(portDef.eDomain == OMX_PortDomainVideo)
+ {
+ iFileFillingLength = 1600; //bufSize;
+ }
+ else
+ {
+ iFileFillingLength = bufSize;
+ }
+
+ if (iSupplier == OMX_BufferSupplyInput)
+ {
+ for (TInt buf = 0; buf < iNumBufs; ++buf)
+ {
+ iComp->AllocateBuffer(iComp, &bufHdr, iPortNum, NULL, bufSize);
+ bufHdr->pAppPrivate = (OMX_PTR)EBufferFree;
+ iBufferHeaders.AppendL(bufHdr);
+ }
+ }
+ else
+ {
+ OMX_U8* newBuffer = NULL;
+
+ for (TInt buf = 0; buf < iNumBufs; ++buf)
+ {
+ newBuffer = new (ELeave) OMX_U8[bufSize];
+ CleanupStack::PushL(newBuffer);
+ iBuffers.AppendL(newBuffer);
+ CleanupStack::Pop(newBuffer);
+
+ OMX_ERRORTYPE err = iComp->UseBuffer(iComp, &bufHdr, iPortNum, NULL, bufSize, newBuffer);
+ if(err != OMX_ErrorNone)
+ {
+ //error encountered in allocating.
+ }
+ bufHdr->pAppPrivate = (OMX_PTR)EBufferFree;
+ iBufferHeaders.AppendL(bufHdr);
+ }
+ }
+ }
+ }
+
+void CPortBufferHandler::CPortInfo::BufferDone(OMX_BUFFERHEADERTYPE* aBufHdr)
+ {
+ for (TInt buf = 0; buf < iNumBufs; ++buf)
+ {
+ if (iBufferHeaders[buf] == aBufHdr)
+ {
+ aBufHdr->pAppPrivate = (OMX_PTR)EBufferFree;
+ if(iPortDir == OMX_DirInput)
+ {
+ TPtr8 data(aBufHdr->pBuffer,aBufHdr->nAllocLen);
+ Mem::FillZ(aBufHdr->pBuffer,aBufHdr->nAllocLen);
+ // Read data to this buffer.
+ TInt err = iFileObject.Read(iPosInputData,data,iFileFillingLength);
+ iPosInputData += iFileFillingLength;
+ if(err != KErrNone)
+ {
+ return; //error return.
+ }
+
+ aBufHdr->nTimeStamp = iTimeStamp* 1000;
+ iTimeStamp += 100;
+ if(!iEOSReached)
+ {
+ aBufHdr->nFilledLen = data.Size();
+ aBufHdr->nOffset = 0;
+ aBufHdr->nInputPortIndex = iPortNum;
+ aBufHdr->nOutputPortIndex = OMX_ErrorMax;
+
+ //Send buffer to port and mark that it is under use.
+ aBufHdr->pAppPrivate = (OMX_PTR)EBufferUnderUse;
+ if((data.Size() < aBufHdr->nAllocLen)&&(data.Size() < iFileFillingLength))
+ {
+ //INFO_PRINTF1(_L("EOS detected on Input Port"));
+ aBufHdr->nFlags |= OMX_BUFFERFLAG_EOS;
+ iEOSReached = ETrue;
+ }
+ iComp->EmptyThisBuffer(iComp, aBufHdr);
+ }
+ }
+ else
+ {
+ //create a pointer into buffer
+ // using ptr , write buffer data to File.
+ TPtr8 data( aBufHdr->pBuffer+aBufHdr->nOffset, aBufHdr->nFilledLen, aBufHdr->nAllocLen );
+ TInt err = iFileObject.Write(data);
+ if(err != KErrNone)
+ {
+ return; //error return.
+ }
+ err = iFileObject.Flush();
+ if(err != KErrNone)
+ {
+ return; //error return.
+ }
+ aBufHdr->pAppPrivate = (OMX_PTR)EBufferFree;
+ aBufHdr->nFilledLen = 0;
+ aBufHdr->nOffset = 0;
+ aBufHdr->nOutputPortIndex = iPortNum;
+ aBufHdr->nInputPortIndex = OMX_ErrorMax;
+ if(aBufHdr->nFlags & OMX_BUFFERFLAG_EOS)
+ {
+ // TODO Logic for EOS
+ return;
+ }
+ else
+ {
+ iComp->FillThisBuffer(iComp, aBufHdr);
+ }
+
+ }
+ }
+ }
+ }
+void CPortBufferHandler::CPortInfo::Start()
+ {
+ for (TInt buf = 0; buf < iNumBufs; ++buf)
+ {
+ OMX_BUFFERHEADERTYPE *bufferHdr = iBufferHeaders[buf];
+
+ if (bufferHdr->pAppPrivate == (OMX_PTR)EBufferFree)
+ {
+ if(iPortDir == OMX_DirInput)
+ {
+ TPtr8 data(bufferHdr->pBuffer,bufferHdr->nAllocLen);
+ // Read data to this buffer.
+ TInt err =0;
+ if(buf == 0)
+ {
+ err = iFileObject.Read(iPosInputData,data,iFileHeaderLength);
+ iPosInputData += iFileHeaderLength;
+ bufferHdr->nFlags |= OMX_BUFFERFLAG_STARTTIME;
+ }
+ else
+ {
+ err = iFileObject.Read(iPosInputData,data,iFileFillingLength);
+ iPosInputData += iFileFillingLength;
+ }
+ if(err != KErrNone)
+ {
+ return; //error return.
+ }
+
+ bufferHdr->nTimeStamp = iTimeStamp * 1000;
+ iTimeStamp += 100;
+ if(data.Size())
+ {
+ bufferHdr->nFilledLen = data.Size();
+ bufferHdr->nOffset = 0;
+
+ //Send buffer to port and mark that it is under use.
+ bufferHdr->pAppPrivate = (OMX_PTR)EBufferUnderUse;
+ //CHeck for EOF
+ if(buf > 0)
+ {
+ if(data.Size() < iFileFillingLength)
+ {
+ bufferHdr->nFlags |= OMX_BUFFERFLAG_EOS;
+ }
+ }
+
+ if(buf == 0)
+ {
+ if(data.Size() < iFileHeaderLength)
+ {
+ ASSERT(0);
+ return;
+ }
+ }
+
+ iComp->EmptyThisBuffer(iComp, bufferHdr);
+ }
+ }
+ else
+ {
+ bufferHdr->pAppPrivate = (OMX_PTR)EBufferUnderUse;
+ bufferHdr->nFilledLen = 0;
+ bufferHdr->nOffset = 0;
+ iComp->FillThisBuffer(iComp, bufferHdr);
+ }
+ }
+
+ }
+ }
+
+void CPortBufferHandler::CPortInfo::Stop()
+ {
+//Todo: implement any stop functionality required.
+ }
+
+void CPortBufferHandler::CPortInfo::Resume()
+ {
+//Todo: implement any resume functionality required.
+ }
+
+
+void CPortBufferHandler::CPortInfo::Pause()
+ {
+//Todo: implement any resume functionality required.
+ }
+
+void CPortBufferHandler::CPortInfo::FreeBuffers()
+ {
+ for (TInt buf = 0; buf < iNumBufs; ++buf)
+ {
+ iComp->FreeBuffer(iComp, iPortNum, iBufferHeaders[buf]);
+ }
+
+ DeleteAllBuffers();
+ }
+
+void CPortBufferHandler::CPortInfo::DeleteAllBuffers()
+ {
+ iBufferHeaders.Reset();
+
+ if (iComp && iSupplier != OMX_BufferSupplyInput)
+ {
+ iBuffers.ResetAndDestroy();
+ }
+ else
+ {
+ iBuffers.Reset();
+ }
+ }
+
+TBool CPortBufferHandler::CPortInfo::ComparePortNum(const TInt* aPortNum, const CPortInfo& aPortInfo)
+ {
+ //return (aComp == aPortInfo.iComp);
+ return (*aPortNum == aPortInfo.iPortNum);
+ }
+
+OMX_DIRTYPE& CPortBufferHandler::CPortInfo::PortDir()
+ {
+ return iPortDir;
+ }
+
+void CPortBufferHandler::CPortInfo::LogExtra(const TText8* aFile, TInt aLine, TOmxScriptSeverity aSeverity,
+ TRefByValue<const TDesC16> aFmt,...)
+ {
+ VA_LIST aList;
+ VA_START(aList, aFmt);
+
+ TOverflowHandler overflow;
+ TBuf<255> msg;
+ msg.AppendFormatList(aFmt, aList, &overflow);
+
+ iLogger.Log(aFile, aLine, aSeverity, msg);
+
+ VA_END(aList);
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/src/portbufferhandler.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,143 @@
+// 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 PORTBUFFERHANDLER_H
+#define PORTBUFFERHANDLER_H
+
+#include <e32base.h>
+#include <f32file.h>
+#include <openmax/il/khronos/v1_x/OMX_Core.h>
+#include <openmax/il/khronos/v1_x/OMX_Component.h>
+#include <openmax/il/khronos/v1_x/OMX_Types.h>
+
+#include "omx_xml_script.h"
+
+#if defined(__WINSCW__)
+_LIT(KPortDirectoryPath, "c:\\mm\\omxlogicalil\\");
+#else
+_LIT(KPortDirectoryPath, "e:\\unittest\\mm\\omxlogicalil\\");
+#endif
+
+const OMX_VERSIONTYPE KOmxLILVersion = { 1, 1, 1, 0 };
+
+NONSHARABLE_CLASS(CPortBufferHandler) : public CBase
+ {
+public:
+ void AddPortL( OMX_COMPONENTTYPE* aComp,
+ TInt aPortNum,
+ const TDesC& aFileName,
+ OMX_BUFFERSUPPLIERTYPE aSupplier,
+ OMX_DIRTYPE aPortDir,
+ MOmxScriptTestLogger& aLogger,
+ TInt aHeaderLength);
+
+ void AllocateBuffersL(OMX_COMPONENTTYPE* aComp);
+ void BufferDone(OMX_COMPONENTTYPE* aComp, OMX_BUFFERHEADERTYPE* aBufHdr, TBool aSource);
+ void FreeBuffers(OMX_COMPONENTTYPE* aComp);
+ void Start(OMX_COMPONENTTYPE* aComp, TInt aPortNum);
+ void Resume(OMX_COMPONENTTYPE* aComp, TInt aPortNum);
+ void Pause(OMX_COMPONENTTYPE* aComp, TInt aPortNum);
+ void Stop(OMX_COMPONENTTYPE* aComp, TInt aPortNum);
+
+ CPortBufferHandler();
+ ~CPortBufferHandler();
+
+private:
+ NONSHARABLE_CLASS(CPortInfo) : public CBase
+ {
+ public:
+ static CPortInfo* NewL( OMX_COMPONENTTYPE* aComp,
+ TInt aPortNum,
+ const TDesC& aFileName,
+ OMX_BUFFERSUPPLIERTYPE aSupplier,
+ OMX_DIRTYPE aPortDir,
+ MOmxScriptTestLogger& aLogger,
+ TInt aHeaderLength);
+
+ CPortInfo( OMX_COMPONENTTYPE* aComp,
+ TInt aPortNum,
+ OMX_BUFFERSUPPLIERTYPE aSupplier,
+ OMX_DIRTYPE aPortDir,
+ MOmxScriptTestLogger& aLogger,
+ TInt aHeaderLength);
+ ~CPortInfo();
+ void AllocateBuffersL();
+ void BufferDone(OMX_BUFFERHEADERTYPE* aBufHdr);
+ void FreeBuffers();
+ void DeleteAllBuffers();
+ static TBool ComparePortNum(const TInt* aPortNum, const CPortInfo& aPortInfo);
+ void Start();
+ void Stop();
+ void Resume();
+ void Pause();
+ OMX_DIRTYPE& PortDir();
+ void LogExtra(const TText8* aFile, TInt aLine, TOmxScriptSeverity aSeverity,
+ TRefByValue<const TDesC16> aFmt,...);
+
+ enum
+ {
+ EBufferFree,
+ EBufferUnderUse
+ };
+
+ private:
+ TBuf<KMaxFileName> iFileName;
+ RFs iFs;
+ RFile iFileObject;
+ OMX_COMPONENTTYPE* iComp;
+ TInt iPortNum;
+ TInt iNumBufs;
+ OMX_BUFFERSUPPLIERTYPE iSupplier;
+ RPointerArray<OMX_U8> iBuffers;
+ RPointerArray<OMX_BUFFERHEADERTYPE> iBufferHeaders;
+ OMX_DIRTYPE iPortDir;
+ TInt iPosInputData;
+ TInt iFileHeaderLength;
+ TInt iFileFillingLength;
+ MOmxScriptTestLogger& iLogger;
+ TBool iEOSReached;
+ TUint32 iTimeStamp;
+ };
+
+ NONSHARABLE_CLASS(CComponentInfo) : public CBase
+ {
+ public:
+ CComponentInfo(OMX_COMPONENTTYPE* aComp);
+ ~CComponentInfo();
+ CPortInfo* AddPortL(TInt aPortNum, const TDesC& aFileName,OMX_BUFFERSUPPLIERTYPE aSupplier, OMX_DIRTYPE aPortDir, MOmxScriptTestLogger& aLogger, TInt aHeaderLength);
+ void AllocateBuffersL();
+ void FillBuffers();
+ void BufferDone(OMX_BUFFERHEADERTYPE* aBufHdr, TBool aSource);
+ void HoldBuffers();
+ void FreeBuffers();
+ static TBool CompareComp(const OMX_COMPONENTTYPE* aSource, const CComponentInfo& aComponentInfo);
+
+ void Start(TInt aPortNum);
+ void Stop(TInt aPortNum);
+ void Resume(TInt aPortNum);
+ void Pause(TInt aPortNum);
+
+ private:
+ OMX_COMPONENTTYPE* iComp;
+ RPointerArray<CPortInfo> iPorts;
+ OMX_STATETYPE iState;
+ };
+
+
+ RPointerArray<CComponentInfo> iComponents;
+ };
+
+#endif // PORTBUFFERHANDLER_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/src/statedes.cpp Wed Aug 25 12:40:50 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
+*/
+
+#include "statedes.h"
+
+_LIT(KStateLoaded, "LOADED");
+_LIT(KStateIdle, "IDLE");
+_LIT(KStateExecuting, "EXECUTING");
+_LIT(KStatePause, "PAUSE");
+_LIT(KStateWaitForResources, "WAIT_FOR_RESOURCES");
+_LIT(KStateStateInvalid, "STATEINVALID");
+_LIT(KBadState, "?");
+
+_LIT(KClockStateRunning, "CLOCKSTATE_RUNNING");
+_LIT(KClockStateWaitingForStartTime, "CLOCKSTATE_WAITINGFORSTARTTIME");
+_LIT(KClockStateStopped, "CLOCKSTATE_STOPPED");
+_LIT(KClockStateUnknown, "CLOCKSTATE_UNKNOWN");
+
+const TDesC* StateDes(OMX_STATETYPE aState)
+ {
+ switch(aState)
+ {
+ case OMX_StateLoaded:
+ return &KStateLoaded;
+ case OMX_StateIdle:
+ return &KStateIdle;
+ case OMX_StateExecuting:
+ return &KStateExecuting;
+ case OMX_StatePause:
+ return &KStatePause;
+ case OMX_StateWaitForResources:
+ return &KStateWaitForResources;
+ case OMX_StateInvalid:
+ return &KStateStateInvalid;
+ default:
+ return &KBadState;
+ }
+ }
+
+const TDesC* ClockStateDes(OMX_TIME_CLOCKSTATE aClockState)
+ {
+ switch(aClockState)
+ {
+ case OMX_TIME_ClockStateRunning:
+ return &KClockStateRunning;
+ case OMX_TIME_ClockStateWaitingForStartTime:
+ return &KClockStateWaitingForStartTime;
+ case OMX_TIME_ClockStateStopped:
+ return &KClockStateStopped;
+ default:
+ return &KClockStateUnknown;
+ }
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/src/statedes.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,34 @@
+/*
+* 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 STATEDES_H_
+#define STATEDES_H_
+
+#include <e32cmn.h>
+#include <openmax/il/khronos/v1_x/OMX_Core.h>
+#include <openmax/il/khronos/v1_x/OMX_Other.h>
+
+const TDesC* StateDes(OMX_STATETYPE aState);
+const TDesC* ClockStateDes(OMX_TIME_CLOCKSTATE aClockState);
+
+#endif /*STATEDES_H_*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/src/threadedlogger.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,104 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "threadedlogger.h"
+
+CThreadedLogger* CThreadedLogger::NewLC(MOmxScriptTestLogger& aRealLogger)
+ {
+ CThreadedLogger* self = new(ELeave) CThreadedLogger(aRealLogger);
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ return self;
+ }
+
+CThreadedLogger::CThreadedLogger(MOmxScriptTestLogger& aRealLogger):
+CActive(EPriorityHigh),
+iRealLogger(aRealLogger)
+ {
+ iCreatorThreadId = iCreatorThread.Id();
+ }
+
+void CThreadedLogger::ConstructL()
+ {
+ User::LeaveIfError(iCreatorThread.Open(iCreatorThreadId));
+ User::LeaveIfError(iMutex.CreateLocal());
+ User::LeaveIfError(iSemaphore.CreateLocal(0));
+ CActiveScheduler::Add(this);
+ iStatus = KRequestPending;
+ SetActive();
+ }
+
+CThreadedLogger::~CThreadedLogger()
+ {
+ Cancel();
+ iSemaphore.Close();
+ iMutex.Close();
+ iCreatorThread.Close();
+ }
+
+void CThreadedLogger::Log(const TText8* aFile, TInt aLine, TOmxScriptSeverity aSeverity, const TDes& aMessage)
+ {
+ if(RThread().Id() == iCreatorThreadId)
+ {
+ iRealLogger.Log(aFile, aLine, aSeverity, aMessage);
+ }
+ else
+ {
+ // proxy the log to creator thread
+
+ // mutex prevents multiple threads to proxy at the same time
+ iMutex.Wait();
+
+ // const_cast is regrettable but all we do is pass the params onto a another MOmxScriptTestLogger which will
+ // also treat the args as const
+ iFile = const_cast<TText8*>(aFile);
+ iLine = aLine;
+ iSeverity = aSeverity;
+ iMessage = &const_cast<TDes&>(aMessage);
+
+ // signal the creator thread (waking the Active Object)
+ TRequestStatus* statusPtr = &iStatus;
+ iCreatorThread.RequestComplete(statusPtr, KErrNone);
+
+ // wait for creator thread to signal back
+
+ iSemaphore.Wait();
+ iMutex.Signal();
+ }
+ }
+
+void CThreadedLogger::RunL()
+ {
+ if(iStatus.Int() == KErrCancel)
+ {
+ return;
+ }
+ iRealLogger.Log(iFile, iLine, iSeverity, *iMessage);
+ iFile = NULL;
+ iLine = 0;
+ iSeverity = (TOmxScriptSeverity) 0;
+ iMessage = NULL;
+ iStatus = KRequestPending;
+ SetActive();
+ iSemaphore.Signal(); // signal the requestor thread
+ }
+
+void CThreadedLogger::DoCancel()
+ {
+ TRequestStatus* statusPtr = &iStatus;
+ User::RequestComplete(statusPtr, KErrCancel);
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/src/threadedlogger.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef THREADEDLOGGER_H_
+#define THREADEDLOGGER_H_
+
+#include "omx_xml_script.h"
+
+/**
+ * Adapter class that serializes all Log() calls on the underlying logger into the same thread.
+ * That is, a call to Log() from a thread that did not create this AO will block until the AO has
+ * completed the log in the AS thread.
+ *
+ * This class is provided to allow the use of loggers that would otherwise KERN-EXEC 0 panic if
+ * used by multiple threads.
+ */
+class CThreadedLogger : public CActive, public MOmxScriptTestLogger
+ {
+public:
+ static CThreadedLogger* NewLC(MOmxScriptTestLogger& aRealLogger);
+ ~CThreadedLogger();
+
+ void Log(const TText8* aFile, TInt aLine, TOmxScriptSeverity aSeverity, const TDes& aMessage);
+
+private:
+ CThreadedLogger(MOmxScriptTestLogger& aRealLogger);
+ void ConstructL();
+
+ void RunL();
+ void DoCancel();
+
+private:
+ MOmxScriptTestLogger& iRealLogger;
+ RThread iCreatorThread;
+ RMutex iMutex;
+ RSemaphore iSemaphore;
+ TThreadId iCreatorThreadId;
+
+ TText8* iFile;
+ TInt iLine;
+ TOmxScriptSeverity iSeverity;
+ TDes* iMessage;
+ };
+
+#endif /* THREADEDLOGGER_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/src/transition.cpp Wed Aug 25 12:40:50 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:
+*
+*/
+
+
+#include "transition.h"
+#include <openmax/il/khronos/v1_x/OMX_Component.h>
+
+void CloseSupplierRelations(TAny* aPtr)
+ {
+ RSupplierRelations& links = *reinterpret_cast<RSupplierRelations*>(aPtr);
+ for(TInt i = 0, count = links.Count(); i < count; i++)
+ {
+ links[i].Close();
+ }
+ links.Close();
+ }
+
+/**
+ * Finds a transition order in which no component is transitioned until all components it suppliers to have been transitioned.
+ * If no such order exists (this happens if and only if a cyclic buffer supply chain exists in the graph), this method leaves
+ * with KErrNotFound.
+ *
+ * The result of this algorithm is appropriate for transitioning components from the Loaded state to the Idle state without incurring
+ * errors calling OMX_UseBuffer. For transitions Executing->Idle and Executing->Paused, the reverse order can be used.
+ *
+ * @leave KErrNoMemory
+ * @leave KErrNotFound iff a transition order for the graph does not exist
+ * @leave KErrArgument if aOrder passed in is not empty
+ */
+void FindTransitionOrderL(const RSupplierRelations& aSupplierRelations, RArray<TInt>& aOrder)
+ {
+ if(aOrder.Count() > 0)
+ {
+ User::Leave(KErrArgument);
+ }
+
+ TInt numComponents = aSupplierRelations.Count();
+ TInt numPendingComponents = numComponents;
+ RArray<TBool> pendingComponents;
+ CleanupClosePushL(pendingComponents);
+ for(TInt i = 0; i < numComponents; i++)
+ {
+ pendingComponents.AppendL(ETrue);
+ }
+
+ while(numPendingComponents > 0)
+ {
+ TInt nextComponent = KErrNotFound;
+ for(TInt i = 0; i < numComponents && nextComponent == KErrNotFound; i++)
+ {
+ // try each component not yet transitioned
+ if(pendingComponents[i])
+ {
+ // have all this component's non-supplier peers been transitioned?
+ nextComponent = i;
+ for(TInt j = 0, numSupplied = aSupplierRelations[i].Count(); j < numSupplied && nextComponent != KErrNotFound; j++)
+ {
+ if(pendingComponents[aSupplierRelations[i][j]])
+ {
+ // no, this component can't transition yet
+ nextComponent = KErrNotFound;
+ }
+ }
+ }
+ }
+ // couldn't find a component to transition? so no solution
+ if(nextComponent == KErrNotFound)
+ {
+ aOrder.Reset();
+ User::Leave(KErrNotFound);
+ }
+
+ // this component can transition
+ aOrder.AppendL(nextComponent);
+ pendingComponents[nextComponent] = EFalse;
+ numPendingComponents--;
+ }
+
+ CleanupStack::PopAndDestroy(&pendingComponents);
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/src/transition.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#ifndef TRANSITION_H_
+#define TRANSITION_H_
+
+#include <e32base.h>
+
+/** RSupplierRelations represents the buffer supplier links in a graph */
+typedef RArray<RArray<TInt> > RSupplierRelations;
+
+void CloseSupplierRelations(TAny* aPtr);
+
+/*
+
+For example, consider the following graph: (<-- indicates direction of buffer supply)
+
+ | 0 | <-- 1 <-- 2
+ | 0 | --> 3 <-- 4 --> 5
+
+ The supplier relations table is:
+
+ 0: 3
+ 1: 0
+ 2: 1
+ 3:
+ 4: 3, 5
+ 5:
+
+ A valid transition order for this graph is { 3, 0, 1, 2, 5, 4 }
+
+*/
+
+void FindTransitionOrderL(const RSupplierRelations& aSupplierRelations, RArray<TInt>& aOrder);
+
+#endif /*TRANSITION_H_*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/src/videobufferhandler.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,156 @@
+/*
+* 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:
+*
+*/
+
+
+#include <gdi.h>
+#include "videobufferhandler.h"
+#include <openmax/il/khronos/v1_x/OMX_Core.h>
+
+const TInt KDefaultTimeInterval = 100000;
+
+CVideoBufferHandler* CVideoBufferHandler::NewL(
+ TDesC& aFilename,
+ OMX_SYMBIAN_PARAM_3PLANE_CHUNK_DATA& aChunkDataMsg,
+ const OMX_SYMBIAN_PARAM_BUFFER_SIZE& aBufferSize,
+ OMX_PARAM_PORTDEFINITIONTYPE& portDef)
+ {
+ CVideoBufferHandler* handler = new (ELeave) CVideoBufferHandler(aFilename);
+ CleanupStack::PushL(handler);
+ handler->ConstructL(aChunkDataMsg, aBufferSize, portDef);
+ CleanupStack::Pop(handler);
+
+ return handler;
+ }
+
+CVideoBufferHandler::~CVideoBufferHandler()
+ {
+ iReceiveBuffer.Close();
+ iSendBuffer.Close();
+ iBufferChunk.Close();
+ iFileSource.Close();
+ iFs.Close();
+ }
+
+void CVideoBufferHandler::DoCancel()
+ {
+ iReceiveBuffer.CancelDataAvailable();
+ }
+
+CVideoBufferHandler::CVideoBufferHandler(TDesC& aFilename):
+ CActive(EPriorityStandard),
+ iReadDes(NULL, 0, 0),
+ iFirstBuffer(ETrue)
+ {
+ CActiveScheduler::Add(this);
+ iFileName.Append(aFilename);
+ }
+
+void CVideoBufferHandler::ChangeFilledBufferLength(TInt aLength)
+ {
+ if (!iChangeFileBufferLength)
+ {
+ iChangeFileBufferLength = ETrue;
+ }
+ iFileBufferLengthTestValue = aLength;
+ }
+
+
+void CVideoBufferHandler::SetSendInvalidBufferId(TInt aSendInvalidBufferId)
+ {
+ iSendInvalidBufferId = aSendInvalidBufferId;
+ }
+
+void CVideoBufferHandler::RunL()
+ {
+ // Timer has expired check for new messages...
+ TFilledBufferHeaderV2 header;
+ User::LeaveIfError(iReceiveBuffer.Receive(header));
+ TUint8* chunkBase = iBufferChunk.Base();
+
+ TUint8* bufBase = chunkBase + header.iOffset;
+
+ iReadDes.Set(bufBase, 0, iBufConfig.iBufferSizeInBytes);
+ iFileSource.Read(iReadDes);
+
+ if (iChangeFileBufferLength)
+ {
+ // this is negative test case. COmxILCallbackManager::BufferDoneNotification() will panic
+ header.iFilledLength = iFileBufferLengthTestValue;
+ }
+ else
+ {
+ header.iFilledLength = iReadDes.Length();
+ }
+
+ iTimeStamp += KDefaultTimeInterval;
+ header.iTimeStamp = iTimeStamp;
+
+ if (iReadDes.Length() != 0)
+ {
+ // there is more to read from file source, request for more buffer
+ header.iFlags = iFirstBuffer ? OMX_BUFFERFLAG_STARTTIME : 0;
+ iReceiveBuffer.NotifyDataAvailable(iStatus);
+ SetActive();
+ }
+ else
+ {
+ header.iFlags = OMX_BUFFERFLAG_EOS;
+ }
+
+ if (iSendInvalidBufferId)
+ {
+ header.iOffset=KMaxTUint32;
+ User::LeaveIfError(iSendBuffer.Send(header));
+ iSendInvalidBufferId = 0;
+ }
+ else
+ User::LeaveIfError(iSendBuffer.Send(header));
+ }
+
+void CVideoBufferHandler::ConstructL(OMX_SYMBIAN_PARAM_3PLANE_CHUNK_DATA& aChunkDataMsg, const OMX_SYMBIAN_PARAM_BUFFER_SIZE& aBufferSize, OMX_PARAM_PORTDEFINITIONTYPE& portDef)
+
+ {
+ iBufferChunk.SetHandle(aChunkDataMsg.nChunk);
+ User::LeaveIfError(iBufferChunk.Duplicate(RThread()));
+
+ iReceiveBuffer.SetHandle(aChunkDataMsg.nAvailableBufferQueue );
+ User::LeaveIfError(iReceiveBuffer.Duplicate(RThread()));
+
+ iSendBuffer.SetHandle(aChunkDataMsg.nFilledBufferQueue);
+ User::LeaveIfError(iSendBuffer.Duplicate(RThread()));
+
+ if (portDef.nBufferCountActual <= 0 || portDef.nBufferSize <= 0)
+ {
+ User::Leave(KErrArgument);
+ }
+
+ iBufConfig.iNumBuffers = portDef.nBufferCountActual;
+ iBufConfig.iBufferSizeInBytes = aBufferSize.nBufferSize;
+
+ // Open datafile
+ User::LeaveIfError(iFs.Connect());
+ User::LeaveIfError(iFileSource.Open(iFs, iFileName, EFileShareExclusive|EFileRead));
+ }
+
+void CVideoBufferHandler::Start()
+ {
+ // Start streaming
+ iFirstBuffer = ETrue;
+ iReceiveBuffer.NotifyDataAvailable(iStatus);
+ iTimeStamp = KDefaultTimeInterval;
+ SetActive();
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/src/videobufferhandler.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,68 @@
+/*
+* 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 VIDEOBUFFERHANDLER_H
+#define VIDEOBUFFERHANDLER_H
+
+#include <e32base.h>
+#include <e32msgqueue.h>
+#include <f32file.h>
+#include <openmax/il/extensions/omxilsymbianbuffersextensions.h>
+#include <multimedia/mmfbuffershared.h>
+#include <openmax/il/khronos/v1_x/OMX_Component.h>
+
+NONSHARABLE_CLASS(CVideoBufferHandler) : public CActive
+ {
+public:
+ virtual ~CVideoBufferHandler();
+ static CVideoBufferHandler* NewL(TDesC& aFilename, OMX_SYMBIAN_PARAM_3PLANE_CHUNK_DATA& aChunkDataMsg, const OMX_SYMBIAN_PARAM_BUFFER_SIZE& aBufferSize, OMX_PARAM_PORTDEFINITIONTYPE& portDef);
+
+public:
+ void Start();
+ void ChangeFilledBufferLength(TInt aLength);
+ void SetSendInvalidBufferId(TInt aSendInvalidBufferId);
+
+protected:
+ CVideoBufferHandler(TDesC& aFilename);
+
+private:
+ void ConstructL(OMX_SYMBIAN_PARAM_3PLANE_CHUNK_DATA& aChunkDataMsg, const OMX_SYMBIAN_PARAM_BUFFER_SIZE& aBufferSize, OMX_PARAM_PORTDEFINITIONTYPE& portDef);
+
+ // From CActive
+ void RunL();
+ void DoCancel();
+
+protected:
+ RMsgQueue<TFilledBufferHeaderV2> iReceiveBuffer;
+ RMsgQueue<TFilledBufferHeaderV2> iSendBuffer;
+ TMMSharedChunkBufConfig iBufConfig;
+ TPtr8 iReadDes;
+
+ RChunk iBufferChunk;
+ TBuf<KMaxFileName> iFileName;
+ RFile iFileSource;
+ RFs iFs;
+ TBool iFirstBuffer;
+ TBool iChangeFileBufferLength;
+ TInt iFileBufferLengthTestValue;
+ TInt iSendInvalidBufferId;
+ TInt iTimeStamp;
+ };
+
+#endif // VIDEOBUFFERHANDLER_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/src/videobufferhandler_mpeg4.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,151 @@
+/*
+* 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:
+*
+*/
+
+
+#include <gdi.h>
+#include "videobufferhandler_mpeg4.h"
+#include <openmax/il/khronos/v1_x/OMX_Core.h>
+#include <e32debug.h>
+
+
+CVideoBufferHandlerMPEG4* CVideoBufferHandlerMPEG4::NewL(
+ TDesC& aFilename,
+ OMX_SYMBIAN_PARAM_3PLANE_CHUNK_DATA& aChunkDataMsg,
+ const OMX_SYMBIAN_PARAM_BUFFER_SIZE& aBufferSize,
+ OMX_PARAM_PORTDEFINITIONTYPE& portDef)
+ {
+ CVideoBufferHandlerMPEG4* handler = new (ELeave) CVideoBufferHandlerMPEG4(aFilename);
+ CleanupStack::PushL(handler);
+ handler->ConstructL(aChunkDataMsg, aBufferSize, portDef);
+ CleanupStack::Pop(handler);
+
+ return handler;
+ }
+
+CVideoBufferHandlerMPEG4::~CVideoBufferHandlerMPEG4()
+ {
+ delete iFrameSupplier;
+ }
+
+CVideoBufferHandlerMPEG4::CVideoBufferHandlerMPEG4(TDesC& aFilename):
+ CVideoBufferHandler(aFilename)
+ {
+ }
+
+void CVideoBufferHandlerMPEG4::RunL()
+ {
+ // Timer has expired check for new messages...
+ TFilledBufferHeaderV2 header;
+
+ User::LeaveIfError(iReceiveBuffer.Receive(header));
+ TUint8* chunkBase = iBufferChunk.Base();
+ //__ASSERT_ALWAYS(message < iBufConfig.iNumBuffers, User::Invariant());
+
+ TUint8* bufBase = chunkBase + header.iOffset;
+
+ TInt frameLength = 0;
+ TInt err = iFrameSupplier->NextFrameData(bufBase, frameLength);
+ if (err != KErrNone)
+ {
+ User::Leave(err);
+ }
+
+ if (iChangeFileBufferLength)
+ {
+ // this is negative test case. COmxILCallbackManager::BufferDoneNotification() will panic
+ header.iFilledLength = iFileBufferLengthTestValue;
+ }
+ else
+ {
+ header.iFilledLength = frameLength;
+ }
+
+ if (!iFrameSupplier->IsLastFrame())
+ {
+ // there is more to read from file source, request for more buffer
+ header.iTimeStamp = 0;
+ header.iFlags = (iFrameSupplier->CurrentFrame() == 0 ? OMX_BUFFERFLAG_STARTTIME : 0);
+ iReceiveBuffer.NotifyDataAvailable(iStatus);
+ SetActive();
+ }
+ else
+ {
+ header.iFlags = OMX_BUFFERFLAG_EOS;
+ }
+
+ if (iSendInvalidBufferId)
+ {
+ User::LeaveIfError(iSendBuffer.Send(header));
+ iSendInvalidBufferId = 0;
+ }
+ else
+ {
+ User::LeaveIfError(iSendBuffer.Send(header));
+ }
+ }
+
+
+void CVideoBufferHandlerMPEG4::ConstructL(OMX_SYMBIAN_PARAM_3PLANE_CHUNK_DATA& aChunkDataMsg, const OMX_SYMBIAN_PARAM_BUFFER_SIZE& aBufferSize, OMX_PARAM_PORTDEFINITIONTYPE& portDef)
+ {
+ RThread chunkOwnerThread;
+
+ TInt error = chunkOwnerThread.Open(TThreadId(aChunkDataMsg.nThreadId));
+ iBufferChunk.SetHandle(aChunkDataMsg.nChunk);
+ User::LeaveIfError(iBufferChunk.Duplicate(chunkOwnerThread));
+
+ iReceiveBuffer.SetHandle(aChunkDataMsg.nAvailableBufferQueue);
+ User::LeaveIfError(iReceiveBuffer.Duplicate(RThread()));
+
+ iSendBuffer.SetHandle(aChunkDataMsg.nFilledBufferQueue);
+ User::LeaveIfError(iSendBuffer.Duplicate(RThread()));
+
+ if ((portDef.nBufferCountActual <= 0) || (portDef.nBufferSize <= 0))
+ {
+ User::Leave(KErrArgument);
+ }
+
+ iFrameSupplier = CVideoFrameSupplier::NewL(iFileName, CVideoFrameSupplier::EVideoFileTypeMPEG4);
+
+ iBufConfig.iNumBuffers = portDef.nBufferCountActual;
+ iBufConfig.iBufferSizeInBytes = aBufferSize.nBufferSize;
+ }
+
+
+void CVideoBufferHandlerMPEG4::SetChunkDetailAndOpenL(TInt aChunkHandleId, TUint64 aThreadId)
+ {
+ RThread chunkOwnerThread;
+
+ TInt err = chunkOwnerThread.Open(TThreadId(aThreadId));
+ if (err != KErrNone)
+ {
+ User::LeaveIfError(err);
+ }
+
+ CleanupClosePushL(chunkOwnerThread);
+
+ iBufferChunk.SetHandle(aChunkHandleId);
+ err = iBufferChunk.Duplicate(chunkOwnerThread);
+ if (err != KErrNone)
+ {
+ User::LeaveIfError(err);
+ }
+
+ CleanupStack::PopAndDestroy(&chunkOwnerThread);
+ }
+
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/src/videobufferhandler_mpeg4.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,64 @@
+/*
+* 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 VIDEOBUFFERHANDLERMPEG4_H
+#define VIDEOBUFFERHANDLERMPEG4_H
+
+#include <e32base.h>
+#include <e32msgqueue.h>
+#include <f32file.h>
+#include <openmax/il/extensions/omxilsymbianbuffersextensions.h>
+#include <multimedia/mmfbuffershared.h>
+#include <openmax/il/khronos/v1_x/OMX_Component.h>
+#include <multimedia/t_videoframesupplier.h>
+#include "videobufferhandler.h"
+
+const TInt KVideoBufferLength=102400;
+
+typedef struct
+ {
+ // Maybe these should be 64-bit variables for large video files.
+ TInt iPosition;
+ TInt iLength;
+ }
+TFrameLocation;
+
+NONSHARABLE_CLASS(CVideoBufferHandlerMPEG4) : public CVideoBufferHandler
+ {
+public:
+
+ ~CVideoBufferHandlerMPEG4();
+ static CVideoBufferHandlerMPEG4* NewL(TDesC& aFilename, OMX_SYMBIAN_PARAM_3PLANE_CHUNK_DATA& aChunkDataMsg, const OMX_SYMBIAN_PARAM_BUFFER_SIZE& aBufferSize, OMX_PARAM_PORTDEFINITIONTYPE& portDef);
+
+private:
+ CVideoBufferHandlerMPEG4(TDesC& aFilename);
+ void ConstructL(OMX_SYMBIAN_PARAM_3PLANE_CHUNK_DATA& aChunkDataMsg, const OMX_SYMBIAN_PARAM_BUFFER_SIZE& aBufferSize, OMX_PARAM_PORTDEFINITIONTYPE& portDef);
+
+ void SetChunkDetailAndOpenL(TInt aChunkHandleId, TUint64 aThreadId);
+
+ // From CActive
+ void RunL();
+
+private:
+ CVideoFrameSupplier* iFrameSupplier;
+
+
+ };
+
+#endif // VIDEOBUFFERHANDLERMPEG4_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/src/videobuffersinkhandler.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,116 @@
+/*
+* 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:
+*
+*/
+
+
+#include <gdi.h>
+#include "videobuffersinkhandler.h"
+#include <openmax/il/khronos/v1_x/OMX_Core.h>
+
+CVideoBufferSinkHandler* CVideoBufferSinkHandler::NewL(
+ TDesC& aFilename,
+ OMX_SYMBIAN_PARAM_3PLANE_CHUNK_DATA& aChunkDataMsg,
+ const OMX_SYMBIAN_PARAM_BUFFER_SIZE& aBufferSize,
+ OMX_PARAM_PORTDEFINITIONTYPE& portDef)
+ {
+ CVideoBufferSinkHandler* handler = new (ELeave) CVideoBufferSinkHandler(aFilename);
+ CleanupStack::PushL(handler);
+ handler->ConstructL(aChunkDataMsg, aBufferSize, portDef);
+ CleanupStack::Pop(handler);
+
+ return handler;
+ }
+
+CVideoBufferSinkHandler::~CVideoBufferSinkHandler()
+ {
+ iReceiveBuffer.Close();
+ iSendBuffer.Close();
+ iBufferChunk.Close();
+ iFileSink.Close();
+ iFs.Close();
+ }
+
+CVideoBufferSinkHandler::CVideoBufferSinkHandler(TDesC& aFilename):
+ CActive(EPriorityStandard),
+ iWriteDes(NULL, 0, 0)
+ {
+ CActiveScheduler::Add(this);
+ iFileName.Append(aFilename);
+ }
+
+void CVideoBufferSinkHandler::ConstructL(OMX_SYMBIAN_PARAM_3PLANE_CHUNK_DATA& aChunkDataMsg, const OMX_SYMBIAN_PARAM_BUFFER_SIZE& aBufferSize, OMX_PARAM_PORTDEFINITIONTYPE& portDef)
+ {
+ iBufferChunk.SetHandle(aChunkDataMsg.nChunk);
+ User::LeaveIfError(iBufferChunk.Duplicate(RThread()));
+
+ iReceiveBuffer.SetHandle(aChunkDataMsg.nFilledBufferQueue );
+ User::LeaveIfError(iReceiveBuffer.Duplicate(RThread()));
+
+ iSendBuffer.SetHandle(aChunkDataMsg.nAvailableBufferQueue);
+ User::LeaveIfError(iSendBuffer.Duplicate(RThread()));
+
+ if (portDef.nBufferCountActual <= 0 || portDef.nBufferSize <= 0)
+ {
+ User::Leave(KErrArgument);
+ }
+
+ iBufConfig.iNumBuffers = portDef.nBufferCountActual;
+ iBufConfig.iBufferSizeInBytes = aBufferSize.nBufferSize;
+
+ // Open datafile
+ User::LeaveIfError(iFs.Connect());
+ User::LeaveIfError(iFileSink.Replace(iFs, iFileName, EFileShareExclusive|EFileWrite));
+ }
+
+void CVideoBufferSinkHandler::Start()
+ {
+ // Start streaming
+ iReceiveBuffer.NotifyDataAvailable(iStatus);
+ SetActive();
+ }
+
+void CVideoBufferSinkHandler::RunL()
+ {
+ TFilledBufferHeaderV2 header;
+ User::LeaveIfError(iReceiveBuffer.Receive(header));
+
+ TUint8* chunkBase = iBufferChunk.Base();
+
+ TUint8* bufBase = chunkBase + header.iOffset;
+
+ iWriteDes.Set(bufBase, header.iFilledLength, iBufConfig.iBufferSizeInBytes);
+
+ __ASSERT_ALWAYS(header.iFilledLength <= iWriteDes.Length(), User::Invariant());
+
+ iFileSink.Write(iWriteDes);
+
+ if (header.iFlags != OMX_BUFFERFLAG_EOS)
+ {
+ // there is no more to read from file source, request for more buffer
+ iReceiveBuffer.NotifyDataAvailable(iStatus);
+ SetActive();
+ }
+
+ User::LeaveIfError(iSendBuffer.Send(header));
+ }
+
+void CVideoBufferSinkHandler::DoCancel()
+ {
+ iReceiveBuffer.CancelDataAvailable();
+ }
+
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/src/videobuffersinkhandler.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,61 @@
+/*
+* 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 VIDEOBUFFERSINKHANDLER_H
+#define VIDEOBUFFERSINKHANDLER_H
+
+#include <e32base.h>
+#include <e32msgqueue.h>
+#include <f32file.h>
+#include <openmax/il/extensions/omxilsymbianbuffersextensions.h>
+#include <multimedia/mmfbuffershared.h>
+#include <openmax/il/khronos/v1_x/OMX_Component.h>
+
+NONSHARABLE_CLASS(CVideoBufferSinkHandler) : public CActive
+ {
+public:
+ ~CVideoBufferSinkHandler();
+ static CVideoBufferSinkHandler* NewL(TDesC& aFilename, OMX_SYMBIAN_PARAM_3PLANE_CHUNK_DATA& aChunkDataMsg, const OMX_SYMBIAN_PARAM_BUFFER_SIZE& aBufferSize, OMX_PARAM_PORTDEFINITIONTYPE& portDef);
+
+
+public:
+ void Start();
+
+private:
+ CVideoBufferSinkHandler(TDesC& aFilename);
+ void ConstructL(OMX_SYMBIAN_PARAM_3PLANE_CHUNK_DATA& aChunkDataMsg, const OMX_SYMBIAN_PARAM_BUFFER_SIZE& aBufferSize, OMX_PARAM_PORTDEFINITIONTYPE& portDef);
+
+ // From CActive
+ void RunL();
+ void DoCancel();
+
+private:
+ RMsgQueue<TFilledBufferHeaderV2> iReceiveBuffer;
+ RMsgQueue<TFilledBufferHeaderV2> iSendBuffer;
+ TMMSharedChunkBufConfig iBufConfig;
+ TPtr8 iWriteDes;
+
+
+ RChunk iBufferChunk;
+ TBuf<KMaxFileName> iFileName;
+ RFile iFileSink;
+ RFs iFs;
+ };
+
+#endif // VIDEOBUFFERSINKHANDLER_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/src/videotesttimer.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,56 @@
+/*
+* 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:
+*
+*/
+
+
+
+#include "videotesttimer.h"
+
+
+CVideoTestTimer::CVideoTestTimer(MTimerObserver& aTimerObserver)
+: CTimer(EPriorityHigh), iTimerObserver(aTimerObserver)
+ {
+ CActiveScheduler::Add(this);
+ }
+
+CVideoTestTimer* CVideoTestTimer::NewL(MTimerObserver& aTimerObserver)
+ {
+ CVideoTestTimer* self = new (ELeave) CVideoTestTimer(aTimerObserver);
+ CleanupStack::PushL(self);
+ self->ConstructL(); // this call CTimer::ConstructL
+ CleanupStack::Pop(self);
+ return self;
+ }
+
+CVideoTestTimer::~CVideoTestTimer()
+ {
+ // cancel is called by CTimer destructor
+ }
+
+/** Start the timer */
+void CVideoTestTimer::Start(TTimeIntervalMicroSeconds32 aDelay)
+ {
+ HighRes(aDelay);
+ }
+
+/** Handle completion */
+void CVideoTestTimer::RunL()
+ {
+ if (iStatus == KErrNone)
+ {
+ iTimerObserver.TimerExpired();
+ }
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/src/videotesttimer.h Wed Aug 25 12:40:50 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:
+*
+*/
+
+
+
+#ifndef VIDEOTESTTIMER_H
+#define VIDEOTESTTIMER_H
+
+#include <e32base.h>
+
+
+
+
+class MTimerObserver
+ {
+public:
+ virtual void TimerExpired() = 0;
+ };
+
+NONSHARABLE_CLASS(CVideoTestTimer) : public CTimer
+ {
+public:
+ ~CVideoTestTimer();
+ static CVideoTestTimer* NewL(MTimerObserver& aTimerObserver);
+ void Start(TTimeIntervalMicroSeconds32 aDelay);
+
+private:
+ CVideoTestTimer(MTimerObserver& aTimerObserver);
+ void RunL();
+
+private:
+ MTimerObserver& iTimerObserver;
+ };
+
+#endif // VIDEOTESTTIMER_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/src/windowmanager.cpp Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,181 @@
+/*
+* 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:
+*
+*/
+
+
+/**
+@file
+@internalComponent
+*/
+
+#include "windowmanager.h"
+
+CWindowManager* CWindowManager::NewL()
+ {
+ CWindowManager* self = new(ELeave) CWindowManager();
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ CleanupStack::Pop(self);
+ return self;
+ }
+
+CWindowManager::CWindowManager():
+CActive(EPriorityStandard)
+ {
+ CActiveScheduler::Add(this);
+ }
+
+void CWindowManager::ConstructL()
+ {
+ User::LeaveIfError(iMsgQueue.CreateLocal(1));
+ User::LeaveIfError(iSemaphore.CreateLocal(0));
+
+ User::LeaveIfError(iWsSession.Connect());
+ // Create the Screen device for the WServ session.
+ iWsSd = new (ELeave) CWsScreenDevice(iWsSession);
+ User::LeaveIfError(iWsSd->Construct());
+ // Create a Window Group.
+ iWindowGroup = RWindowGroup(iWsSession);
+ User::LeaveIfError(iWindowGroup.Construct((TUint32)this, ETrue));
+ iWindow = new (ELeave) RWindow(iWsSession);
+ User::LeaveIfError(iWindow->Construct(iWindowGroup, ((TUint32)(this)) + 1));
+
+ // Reset the screen mode.
+ if(iWsSd->CurrentScreenMode() != 0)
+ {
+ iWsSd->SetAppScreenMode(0);
+ iWsSd->SetScreenMode(0);
+ }
+
+ iScreenSize = iWsSd->SizeInPixels();
+ iWindow->SetExtent(TPoint(0,0), iScreenSize);
+ iWindow->SetVisible(ETrue);
+ iWindow->Activate();
+
+ User::LeaveIfError(iWindow->SetRequiredDisplayMode(EColor16MA));
+
+ // TODO - this forcing of transparency may not be needed, as there is
+ // a defect in the graphics component right now
+ // force the transparency change to take place
+ iWindow->SetBackgroundColor(TRgb(0x000000, 0));
+ iWindow->BeginRedraw();
+ iWindow->EndRedraw();
+ iWsSession.Flush();
+
+ iCreatorThreadId = RThread().Id();
+
+ SetActive();
+ iMsgQueue.NotifyDataAvailable(iStatus);
+ }
+
+CWindowManager::~CWindowManager()
+ {
+ Cancel();
+ if(iWindow)
+ {
+ iWindow->Close();
+ delete iWindow;
+ }
+ iWindowGroup.Close();
+ delete iWsSd;
+ iWsSession.Close();
+
+ iSemaphore.Close();
+ iMsgQueue.Close();
+ }
+
+void CWindowManager::RunL()
+ {
+ TMessage msg;
+ TInt err = iMsgQueue.Receive(msg);
+ if(err != KErrNone && err != KErrUnderflow)
+ {
+ iReturnCode = err;
+ }
+ else
+ {
+ iReturnCode = DoCommand(msg.iCommand, msg.iParam1, msg.iParam2);
+ }
+ SetActive();
+ iMsgQueue.NotifyDataAvailable(iStatus);
+ iSemaphore.Signal();
+ }
+
+void CWindowManager::DoCancel()
+ {
+ iMsgQueue.CancelDataAvailable();
+ }
+
+TInt CWindowManager::RegisterSurface(TSurfaceId& aSurfaceId)
+ {
+ return RunCommand(ERegisterSurface, &aSurfaceId);
+ }
+
+TInt CWindowManager::SetBackgroundSurface(TSurfaceConfiguration& aSurfaceConfig, TBool aTriggerRedraw)
+ {
+ return RunCommand(ESetBackgroundSurface, &aSurfaceConfig, aTriggerRedraw);
+ }
+
+TInt CWindowManager::RunCommand(TCommand aCommand, TAny* aParam1, TInt aParam2)
+ {
+ if(RThread().Id() == iCreatorThreadId)
+ {
+ return DoCommand(aCommand, aParam1, aParam2);
+ }
+ else
+ {
+ TMessage msg;
+ msg.iCommand = aCommand;
+ msg.iParam1 = aParam1;
+ msg.iParam2 = aParam2;
+ iMsgQueue.SendBlocking(msg);
+ iSemaphore.Wait();
+ return iReturnCode;
+ }
+ }
+
+TInt CWindowManager::DoCommand(TCommand aCommand, TAny* aParam1, TInt aParam2)
+ {
+ switch(aCommand)
+ {
+ case ERegisterSurface:
+ {
+ TSurfaceId& surfaceId = *reinterpret_cast<TSurfaceId*>(aParam1);
+ return iWsSession.RegisterSurface(iWsSd->GetScreenNumber(), surfaceId);
+ }
+ case ESetBackgroundSurface:
+ {
+ TSurfaceConfiguration& surfaceConfig = *reinterpret_cast<TSurfaceConfiguration*>(aParam1);
+ TBool triggerRedraw = aParam2;
+ return iWindow->SetBackgroundSurface(surfaceConfig, triggerRedraw);
+ }
+ default:
+ {
+ User::Invariant();
+ return KErrNone;
+ }
+ }
+ }
+
+TSize CWindowManager::ScreenSize() const
+ {
+ return iScreenSize;
+ }
+
+void CWindowManager::Flush()
+ {
+ iWsSession.Flush();
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tsrc/xmltestharness/xmlclient/src/windowmanager.h Wed Aug 25 12:40:50 2010 +0300
@@ -0,0 +1,83 @@
+/*
+* 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:
+*
+*/
+
+
+/**
+@file
+@internalComponent
+*/
+
+#ifndef WINDOWMANAGER_H_
+#define WINDOWMANAGER_H_
+
+#include <e32msgqueue.h>
+#include <w32std.h>
+
+/**
+ * Encapsulates the resources used to provide a window to render to via Graphic Surfaces.
+ * Proxies certain methods so that they can be used by arbitary threads.
+ */
+class CWindowManager : public CActive
+ {
+private:
+ enum TCommand
+ {
+ ERegisterSurface,
+ ESetBackgroundSurface
+ };
+
+ struct TMessage
+ {
+ TCommand iCommand;
+ TAny* iParam1;
+ TInt iParam2;
+ };
+
+public:
+ static CWindowManager* NewL();
+ ~CWindowManager();
+
+ TSize ScreenSize() const;
+
+ TInt RegisterSurface(TSurfaceId& aSurfaceId);
+ TInt SetBackgroundSurface(TSurfaceConfiguration& aSurfaceConfig, TBool aTriggerRedraw);
+ void Flush();
+
+private:
+ CWindowManager();
+ void ConstructL();
+
+ void RunL();
+ void DoCancel();
+
+ TInt RunCommand(TCommand aCommand, TAny* aParam1, TInt aParam2 = 0);
+ TInt DoCommand(TCommand aCommand, TAny* aParam1, TInt aParam2);
+
+private:
+ RMsgQueue<TMessage> iMsgQueue;
+ RSemaphore iSemaphore;
+ TInt iReturnCode;
+ TThreadId iCreatorThreadId;
+
+ RWsSession iWsSession;
+ CWsScreenDevice* iWsSd; // Screen Device for this WServ session.
+ RWindowGroup iWindowGroup; // Window group of the AO windows.
+ RWindow* iWindow;
+ TSize iScreenSize;
+ };
+
+#endif /* WINDOWMANAGER_H_ */