# HG changeset patch # User Jeremy Murray-Wakefield # Date 1273245923 -3600 # Node ID eedf2dcd43c6ea0226fb0d4677241a542cc8c578 # Parent c1e808730d6c8e8986a79462342459bf3bb0be0f Implementation of OpenMAX-IL with SHAI diff -r c1e808730d6c -r eedf2dcd43c6 omxil/.cproject --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/.cproject Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/.project --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/.project Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,20 @@ + + + omxil + + + + + + com.nokia.carbide.cdt.builder.carbideCPPBuilder + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + com.nokia.carbide.cdt.builder.carbideCPPBuilderNature + com.nokia.carbide.cdt.builder.carbideSBSv2BuilderNature + + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/group/bld.inf Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,1 @@ +#include "../mcar_symbian_il_components/adpcmcodec/group/bld.inf" diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/adpcmcodec/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/adpcmcodec/group/bld.inf Fri May 07 16:25:23 2010 +0100 @@ -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: +* +*/ + + +PRJ_MMPFILES +// Components +../mmpfiles/omxiladpcmdecoder.mmp +../mmpfiles/omxiladpcmencoder.mmp diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/adpcmcodec/inc/omxilsymbianadpcmdecoderextensions.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/adpcmcodec/inc/omxilsymbianadpcmdecoderextensions.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,65 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +/** + @file + @internalComponent +*/ + +#ifndef OMXILSYMBIANADPCMDECODEREXTENSIONS_H +#define OMXILSYMBIANADPCMDECODEREXTENSIONS_H + +#include + +/** + * Current version of the AdPcm decoder config. + */ +const OMX_VERSIONTYPE KAdPcmDecoderConfigVersion = { 1, 0, 0, 0 }; + +/** + * Custom index used by Symbian's ADPCM Decoder to set the size of AdPcm blocks + * @C OMX_SYMBIAN_AUDIO_PARAM_ADPCMDECODER_SAMPLESPERBLOCK . + */ +#define OMX_SymbianIndexParamAudioAdPcmDecoderBlockAlign 0x7FD19E5D + +/** + * Custom OpenMAX IL structure for the AdPcm decoder. + * Use with ID @C OMX_SymbianIndexParamAudioAdPcmDecoderSamplesPerBlock . + * Sets the size of AdPcm blocks. + */ +struct OMX_SYMBIAN_AUDIO_PARAM_ADPCMDECODER_BLOCKALIGN + { + /** + * Set to the size of this structure, in bytes. + */ + OMX_U32 nSize; + + /** + * Set to OMX specification version information. + */ + OMX_VERSIONTYPE nVersion; + + /**< Port that this structure applies to */ + OMX_U32 nPortIndex; + + /** + * Sets the size of AdPcm blocks. + */ + OMX_U32 nBlockAlign; + }; +#endif //OMXILSYMBIANADPCMDECODEREXTENSIONS_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/adpcmcodec/mmpfiles/omxiladpcmdecoder.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/adpcmcodec/mmpfiles/omxiladpcmdecoder.mmp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,63 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +/* +@file +@SYMPurpose omxiladpcmdecoder.dll +*/ + +#include "../src/decoder/omxiladpcmdecoder.hrh" + + +TARGET omxiladpcmdecoder.dll +CAPABILITY ALL -TCB +TARGETTYPE plugin +UID 0x10009D8D KUidSymbianOmxILAdPcmDecoderDll +VENDORID 0x70000001 + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN + + +USERINCLUDE ../../common +USERINCLUDE ../src/common +USERINCLUDE ../src/decoder +USERINCLUDE ../inc +USERINCLUDE ../../../../omxilcomponentcommon/src/common +USERINCLUDE ../../../../omxilcore/traces + + + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY omxilcomponentcommon.lib +STATICLIBRARY omxilcomponentif.lib + +SOURCEPATH ../src/common +SOURCE omxiladpcmcodecprocessingfunctioncore.cpp +SOURCE omxiladpcmcodecport.cpp +SOURCE OmxILPcmPortAdPcmVariant.cpp +SOURCE omxiladpcmcodecprocessingfunction.cpp + +SOURCEPATH ../src/decoder +RESOURCE omxiladpcmdecoder.rss +SOURCE omxiladpcmdecoder.cpp +SOURCE omxiladpcmcodecprocessingfunctioncoreadpcmtopcm.cpp +SOURCE omxiladpcmdecoderport.cpp + +SOURCEPATH ../../common +SOURCE OmxILPcmPortBase.cpp diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/adpcmcodec/mmpfiles/omxiladpcmencoder.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/adpcmcodec/mmpfiles/omxiladpcmencoder.mmp Fri May 07 16:25:23 2010 +0100 @@ -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 +@SYMPurpose omxiladpcmencoder.dll +*/ + +#include "../src/encoder/omxiladpcmencoder.hrh" + +TARGET omxiladpcmencoder.dll +CAPABILITY ALL -TCB +TARGETTYPE plugin +UID 0x10009D8D KUidSymbianOmxILAdPcmEncoderDll +VENDORID 0x70000001 + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN + +USERINCLUDE ../../common/ +USERINCLUDE ../src/common/ +USERINCLUDE ../src/encoder/ +USERINCLUDE ../inc +USERINCLUDE ../../../../omxilcomponentcommon/src/common +USERINCLUDE ../../../../omxilcore/traces + + + + + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY omxilcomponentcommon.lib +STATICLIBRARY omxilcomponentif.lib + +SOURCEPATH ../src/common +SOURCE omxiladpcmcodecprocessingfunctioncore.cpp +SOURCE omxiladpcmcodecport.cpp +SOURCE OmxILPcmPortAdPcmVariant.cpp +SOURCE omxiladpcmcodecprocessingfunction.cpp + +SOURCEPATH ../src/encoder +RESOURCE omxiladpcmencoder.rss +SOURCE omxiladpcmencoder.cpp +SOURCE omxiladpcmcodecprocessingfunctioncorepcmtoadpcm.cpp + +SOURCEPATH ../../common +SOURCE OmxILPcmPortBase.cpp diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/adpcmcodec/src/common/OmxILAdPcmCodecConsts.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/adpcmcodec/src/common/OmxILAdPcmCodecConsts.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef OmxILAdPcmCodecConsts_H +#define OmxILAdPcmCodecConsts_H +#include + +const TInt KClamp = 32768; +const TInt KMaskSign16bit = 0x8000; +const TInt KMaskSign8bit = 0x80; +const TInt KAndMask8bit = 0xff; +const TInt KMaxImaAdpcmTableEntries = 88; +const TUint KImaAdpcmBlockAlign = 256; +const TUint KImaAdpcmMinBlockAlign = 32; +const TUint KImaAdpcmMaxBlockAlign = 2048; +//samples per block = [((block align - (4 * nChannels)) * 8) / (bits per sample * nChannels)] + 1 +const TUint KImaAdpcmSamplesPerBlock = ((KImaAdpcmBlockAlign - 4)*2) + 1; //505 +const TUint KImaAdpcmStereoSamplesPerBlock = (KImaAdpcmBlockAlign - 8) + 1; //249 +const TUint KImaAdpcmTempBufferSize = KImaAdpcmSamplesPerBlock*2; +const TUint KImaAdpcmStereoTempBufferSize = KImaAdpcmStereoSamplesPerBlock*4; + +//Gsm coded Frame size +const TInt KCodedBufferSize = 152; + +#endif //OmxILAdPcmCodecConsts_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/adpcmcodec/src/common/OmxILPcmPortAdPcmVariant.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/adpcmcodec/src/common/OmxILPcmPortAdPcmVariant.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,86 @@ +/* +* 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 +*/ + +// Self +#include "OmxILPcmPortAdPcmVariant.h" + +// Project (MMP) +/* None */ + +// Local (INF) +#include + +#include "log.h" +#include "omxilutil.h" + + +// System +/* None */ + +COmxILPcmPortAdPcmVariant* COmxILPcmPortAdPcmVariant::NewL(const TOmxILCommonPortData& aCommonPortData, const RArray& aSupportedAudioFormats, const OMX_AUDIO_PARAM_PCMMODETYPE& aPcmModeType) + { + DEBUG_PRINTF(_L8("COmxILPcmPortAdPcmVariant::NewL")); + + COmxILPcmPortAdPcmVariant* self = new(ELeave)COmxILPcmPortAdPcmVariant(aCommonPortData, aPcmModeType); + + CleanupStack::PushL(self); + self->ConstructL(aSupportedAudioFormats); + CleanupStack::Pop(); + + return self; + } + +COmxILPcmPortAdPcmVariant::COmxILPcmPortAdPcmVariant(const TOmxILCommonPortData& aCommonPortData, const OMX_AUDIO_PARAM_PCMMODETYPE& aPcmModeType) + : COmxILPcmPortBase(aCommonPortData, aPcmModeType) + { + DEBUG_PRINTF(_L8("COmxILPcmPortAdPcmVariant::COmxILPcmPortAdPcmVariant")); + + // No action + } + +void COmxILPcmPortAdPcmVariant::ConstructL(const RArray& aSupportedAudioFormats) + { + DEBUG_PRINTF(_L8("COmxILPcmPortAdPcmVariant::ConstructL")); + + // Call base class + COmxILPcmPortBase::ConstructL(aSupportedAudioFormats); + } + +COmxILPcmPortAdPcmVariant::~COmxILPcmPortAdPcmVariant() + { + DEBUG_PRINTF(_L8("COmxILPcmPortAdPcmVariant::~COmxILPcmDecoderAPB0Port")); + // No action + } + +TBool COmxILPcmPortAdPcmVariant::ValidatePcmModeParams(const OMX_AUDIO_PARAM_PCMMODETYPE& aPcmModeType) const + { + OMX_AUDIO_PARAM_PCMMODETYPE type = ModeType(); + DEBUG_PRINTF(_L8("COmxILPcmPortAdPcmVariant::ValidatePcmModeParams")); + return (aPcmModeType.nBitPerSample == 16) + && (aPcmModeType.nPortIndex == ModeType().nPortIndex) //port number changes are not allowed + && (aPcmModeType.nChannels == 1) // only mono is supported by the core encoder/decoder functions + && (aPcmModeType.eChannelMapping[0] == OMX_AUDIO_ChannelLF) + && (aPcmModeType.eChannelMapping[1] == OMX_AUDIO_ChannelRF) // interleaving is ignored since only mono is supported + && (static_cast(aPcmModeType.nSamplingRate) > 0) // sample rate must be positive + ; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/adpcmcodec/src/common/OmxILPcmPortAdPcmVariant.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/adpcmcodec/src/common/OmxILPcmPortAdPcmVariant.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,57 @@ +/* +* 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 OMXILPCMPORTADPCMVARIANT_H +#define OMXILPCMPORTADPCMVARIANT_H + +#include "OmxILPcmPortBase.h" + +class COmxILPcmPortAdPcmVariant : public COmxILPcmPortBase + { + public: + /** + * Constructor. + * @return Newly created COmxILPcmPortAdPcmVariant. + */ + static COmxILPcmPortAdPcmVariant* NewL(const TOmxILCommonPortData& aCommonPortData, const RArray& aSupportedAudioFormats, const OMX_AUDIO_PARAM_PCMMODETYPE& aPcmModeType); + + ~COmxILPcmPortAdPcmVariant(); + + + private: + COmxILPcmPortAdPcmVariant(const TOmxILCommonPortData& aCommonPortData, const OMX_AUDIO_PARAM_PCMMODETYPE& aPcmModeType); + + /** + * Second stage constructor. + * See @C NewL for details. + */ + void ConstructL(const RArray& aSupportedAudioFormats); + + /** + * From OmxILPcmPortBase. + */ + TBool ValidatePcmModeParams(const OMX_AUDIO_PARAM_PCMMODETYPE& aPcmModeType) const; + }; + + +#endif diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/adpcmcodec/src/common/omxiladpcmcodecport.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/adpcmcodec/src/common/omxiladpcmcodecport.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,218 @@ +/* +* 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 +#include "log.h" +#include "omxilutil.h" +#include "omxiladpcmcodecport.h" + + +_LIT8(KMimeTypeAudioImaAdpcm, "audio/ima.adpcm"); // There is no valid mime type + +COmxILAdPcmCodecPort* COmxILAdPcmCodecPort::NewL( + const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedAudioFormats, + const OMX_AUDIO_PARAM_ADPCMTYPE& aPcmModeType) + { + DEBUG_PRINTF(_L8("COmxILAdPcmCodecPort::NewL")); + + COmxILAdPcmCodecPort* self = + new(ELeave)COmxILAdPcmCodecPort(aCommonPortData, aPcmModeType); + + CleanupStack::PushL(self); + self->ConstructL(aSupportedAudioFormats); + CleanupStack::Pop(); + + return self; + } + + +COmxILAdPcmCodecPort::COmxILAdPcmCodecPort(const TOmxILCommonPortData& aCommonPortData, + const OMX_AUDIO_PARAM_ADPCMTYPE& aPcmModeType) + : COmxILAudioPort(aCommonPortData), + iParamAudioAdPcm(aPcmModeType) + { + DEBUG_PRINTF(_L8("COmxILAdPcmCodecPort::NewL")); + } + + +void COmxILAdPcmCodecPort::ConstructL(const RArray& aSupportedAudioFormats) + { + DEBUG_PRINTF(_L8("COmxILAdPcmCodecPort::ConstructL")); + + // Debug checks (release version will leave in ConstructL instead) + ASSERT(aSupportedAudioFormats.Count() == 1); + ASSERT(aSupportedAudioFormats[0] == OMX_AUDIO_CodingADPCM); + + if (aSupportedAudioFormats.Count() != 1 || aSupportedAudioFormats[0] != OMX_AUDIO_CodingADPCM) + { + User::Leave(KErrNotSupported); + } + + COmxILAudioPort::ConstructL(aSupportedAudioFormats); + + // before constructL comlpetes, we must be finished with the iParamPortDefinition + iParamPortDefinition.eDomain = OMX_PortDomainAudio; + + TUint8* mimeptr = const_cast(KMimeTypeAudioImaAdpcm().Ptr()); // KMimeTypeAudioPcm is already nul-terminated since it's made from a literal C-style string + + iParamPortDefinition.format.audio.cMIMEType = reinterpret_cast(mimeptr); + + iParamPortDefinition.format.audio.bFlagErrorConcealment = OMX_FALSE; + iParamPortDefinition.format.audio.eEncoding = OMX_AUDIO_CodingADPCM; + } + + +COmxILAdPcmCodecPort::~COmxILAdPcmCodecPort() + { + DEBUG_PRINTF(_L8("COmxILAdPcmCodecPort::~COmxILAdPcmDecoderAPB0Port")); + // nothing to do + } + +OMX_ERRORTYPE COmxILAdPcmCodecPort::GetLocalOmxParamIndexes(RArray& aIndexArray) const + { + DEBUG_PRINTF(_L8("COmxILAdPcmCodecPort::GetLocalOmxParamIndexes")); + + // Always collect param indexes from parent + OMX_ERRORTYPE omxRetValue = COmxILAudioPort::GetLocalOmxParamIndexes(aIndexArray); + if (OMX_ErrorNone != omxRetValue) + { + return omxRetValue; + } + + TInt err = aIndexArray.InsertInOrder(OMX_IndexParamAudioAdpcm); + if (KErrNone != err && KErrAlreadyExists != err) // Note that index duplication is OK. + { + return OMX_ErrorInsufficientResources; + } + + return OMX_ErrorNone; + } + +OMX_ERRORTYPE COmxILAdPcmCodecPort::GetLocalOmxConfigIndexes(RArray& aIndexArray) const + { + DEBUG_PRINTF(_L8("COmxILAdPcmDecoderAPB0Port::GetLocalOmxConfigIndexes")); + return COmxILAudioPort::GetLocalOmxConfigIndexes(aIndexArray); + } + +OMX_ERRORTYPE COmxILAdPcmCodecPort::GetParameter(OMX_INDEXTYPE aParamIndex, TAny* apComponentParameterStructure) const + { + DEBUG_PRINTF(_L8("COmxILAdPcmCodecPort::GetParameter")); + + // we only have OMX_IndexParamAudioAdpcm - pass all other requests to our parent + if (aParamIndex!=OMX_IndexParamAudioAdpcm) + { + return COmxILAudioPort::GetParameter(aParamIndex, apComponentParameterStructure); + } + + OMX_ERRORTYPE err = TOmxILUtil::CheckOmxStructSizeAndVersion( apComponentParameterStructure, sizeof iParamAudioAdPcm ); + if (err==OMX_ErrorNone) + { + // export our PCM mode settings + OMX_AUDIO_PARAM_ADPCMTYPE* const pcmmode = static_cast(apComponentParameterStructure); + *pcmmode = iParamAudioAdPcm; + } + + return err; + } + + +OMX_ERRORTYPE COmxILAdPcmCodecPort::SetParameter(OMX_INDEXTYPE aParamIndex, const TAny* apComponentParameterStructure, TBool& aUpdateProcessingFunction) + { + DEBUG_PRINTF(_L8("COmxILAdPcmCodecPort::SetParameter")); + + // we only have OMX_IndexParamAudioAdpcm - pass all other requests to our parent + if (aParamIndex!=OMX_IndexParamAudioAdpcm) + { + return COmxILAudioPort::SetParameter(aParamIndex, apComponentParameterStructure, aUpdateProcessingFunction); + } + + OMX_ERRORTYPE err = TOmxILUtil::CheckOmxStructSizeAndVersion( const_cast(apComponentParameterStructure), sizeof iParamAudioAdPcm ); + if (err!=OMX_ErrorNone) + { + return err; + } + + // get and sanity check the new settings + const OMX_AUDIO_PARAM_ADPCMTYPE* pcmmode = static_cast(apComponentParameterStructure); + if (!CheckPcmModeParamsAreSane(*pcmmode)) + { + return OMX_ErrorBadParameter; + } + + // preserve the new settings and update the processing function + iParamAudioAdPcm = *pcmmode; + aUpdateProcessingFunction = EFalse;//no need to update processing function as we handle ALL changes for AdPcm here + + return OMX_ErrorNone; + } + + +OMX_ERRORTYPE COmxILAdPcmCodecPort::SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, TBool& aUpdateProcessingFunction) + { + DEBUG_PRINTF(_L8("COmxILAdPcmCodecPort::SetFormatInPortDefinition")); + + // Currently not changing cMIMEType type of this port + // Same thing for pNativeRender and eEncoding + iParamPortDefinition.format.audio.bFlagErrorConcealment = aPortDefinition.format.audio.bFlagErrorConcealment; + + // Error concealment not currently needed at the processing function + aUpdateProcessingFunction = EFalse; + + return OMX_ErrorNone; + } + +TBool COmxILAdPcmCodecPort::IsTunnelledPortCompatible( const OMX_PARAM_PORTDEFINITIONTYPE& /*aPortDefinition*/) const + { + return ETrue; + //TODO: Restore proper port compatibility chek + /* + DEBUG_PRINTF(_L8("COmxILAdPcmCodecPort::IsTunnelledPortCompatible")); + + if(aPortDefinition.eDomain != iParamPortDefinition.eDomain + || aPortDefinition.format.audio.eEncoding != iParamPortDefinition.format.audio.eEncoding) + { + return EFalse; + } + + // check that the MIME types match + TPtrC8 tunnelMimeType( reinterpret_cast(aPortDefinition.format.audio.cMIMEType), User::StringLength(reinterpret_cast(aPortDefinition.format.audio.cMIMEType)) ); + TPtrC8 myMimeType( reinterpret_cast(iParamPortDefinition.format.audio.cMIMEType), User::StringLength(reinterpret_cast(iParamPortDefinition.format.audio.cMIMEType)) ); + + if (tunnelMimeType != myMimeType) + { + return EFalse; + } + + return ETrue; + */ + } + + +TBool COmxILAdPcmCodecPort::CheckPcmModeParamsAreSane(const OMX_AUDIO_PARAM_ADPCMTYPE& aPcmModeType) const + { + return (aPcmModeType.nBitsPerSample == 4) + && (aPcmModeType.nPortIndex == iParamAudioAdPcm.nPortIndex)//port number changes are not allowed + && (aPcmModeType.nChannels == 1 || aPcmModeType.nChannels == 2) + ; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/adpcmcodec/src/common/omxiladpcmcodecport.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/adpcmcodec/src/common/omxiladpcmcodecport.h Fri May 07 16:25:23 2010 +0100 @@ -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 OMXILADPCMCODECPORT_H +#define OMXILADPCMCODECPORT_H +#include "omxilaudioport.h" + +class COmxILAdPcmCodecPort : public COmxILAudioPort + { +public: + static COmxILAdPcmCodecPort* NewL(const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedAudioFormats, + const OMX_AUDIO_PARAM_ADPCMTYPE& aPcmModeType); + + ~COmxILAdPcmCodecPort(); + + // From COmxILPort + OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray& aIndexArray) const; + OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray& aIndexArray) const; + OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex, + TAny* apComponentParameterStructure) const; + OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex, + const TAny* apComponentParameterStructure, + TBool& aUpdateProcessingFunction); + + inline const OMX_AUDIO_PARAM_ADPCMTYPE& ModeType() const; + +protected: + COmxILAdPcmCodecPort(const TOmxILCommonPortData& aCommonPortData, + const OMX_AUDIO_PARAM_ADPCMTYPE& aPcmModeType); + + void ConstructL(const RArray& aSupportedAudioFormats); + +private: + // From COmxILPort + OMX_ERRORTYPE SetFormatInPortDefinition( + const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, + TBool& aUpdateProcessingFunction); + TBool IsTunnelledPortCompatible( + const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const; + + TBool CheckPcmModeParamsAreSane(const OMX_AUDIO_PARAM_ADPCMTYPE& aPcmModeType) const; + +private: + OMX_AUDIO_PARAM_ADPCMTYPE iParamAudioAdPcm; + }; + +#include "omxiladpcmcodecport.inl" +#endif diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/adpcmcodec/src/common/omxiladpcmcodecport.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/adpcmcodec/src/common/omxiladpcmcodecport.inl Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,27 @@ +/* +* 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 +*/ + +const OMX_AUDIO_PARAM_ADPCMTYPE& COmxILAdPcmCodecPort::ModeType() const + { + return iParamAudioAdPcm; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/adpcmcodec/src/common/omxiladpcmcodecprocessingfunction.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/adpcmcodec/src/common/omxiladpcmcodecprocessingfunction.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,333 @@ +/* +* 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 "omxiladpcmcodecprocessingfunction.h" +#include "OmxILAdPcmCodecConsts.h" +#include "omxilsymbianadpcmdecoderextensions.h" +#include "omxilcallbacknotificationif.h" +#include "log.h" + +COmxILAdPcmCodecProcessingFunction* COmxILAdPcmCodecProcessingFunction::NewL(COmxILAdPcmCodecProcessingFunctionCore* aCore, MOmxILCallbackNotificationIf& aCallbacks) + { + COmxILAdPcmCodecProcessingFunction* self = new(ELeave)COmxILAdPcmCodecProcessingFunction(aCore, aCallbacks); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + + return self; + } + +COmxILAdPcmCodecProcessingFunction::COmxILAdPcmCodecProcessingFunction(COmxILAdPcmCodecProcessingFunctionCore* aCore, MOmxILCallbackNotificationIf& aCallbacks) + : COmxILProcessingFunction(aCallbacks) + , iCore( aCore ) + { + iCore->SetObserver( this ); + } + +void COmxILAdPcmCodecProcessingFunction::ConstructL() + { + + } + +COmxILAdPcmCodecProcessingFunction::~COmxILAdPcmCodecProcessingFunction() + { + //we do not own iCore; + + iBuffersToEmpty.Reset();//we don't own the buffers + iBuffersToFill.Reset();//we don't own the buffers + } + + +OMX_ERRORTYPE COmxILAdPcmCodecProcessingFunction::StateTransitionIndication(COmxILFsm::TStateIndex aNewState) + { + OMX_ERRORTYPE err = OMX_ErrorNone; + + switch(aNewState) + { + case COmxILFsm::EStateIdle: + { + iCore->Reset(); + // + TInt symerr = iCore->CheckConversion(); + if (symerr == KErrNone ) + { + symerr = iCore->Configure(); + } + if (symerr == KErrNotSupported) + { + err = OMX_ErrorUnsupportedSetting; + } + else if(symerr!=KErrNone) + { + err = OMX_ErrorUndefined; + } + + } + break; + + case COmxILFsm::EStateExecuting: + iCore->Start(); + break; + + case COmxILFsm::EStateInvalid: + case COmxILFsm::EStateLoaded: + case COmxILFsm::EStateWaitForResources: + iCore->Reset(); + break; + + case COmxILFsm::EStatePause: + iCore->Stop(); + break; + + case COmxILFsm::ESubStateLoadedToIdle: + case COmxILFsm::ESubStateIdleToLoaded://Deinitalization + case COmxILFsm::ESubStateExecutingToIdle: + case COmxILFsm::ESubStatePauseToIdle: + // do nothing + break; + } + + iState = aNewState; + return err; + } + +OMX_ERRORTYPE COmxILAdPcmCodecProcessingFunction::BufferFlushingIndication(TUint32 aPortIndex, OMX_DIRTYPE aDirection) + { + TBool portflushed = EFalse; + + // flush the input buffers if requested + if ((aPortIndex == OMX_ALL && aDirection == OMX_DirMax) || + (aPortIndex == 0 && aDirection == OMX_DirInput)) + { + // reset the core to release any in use buffers + iCore->Reset(); + + // send notification for each input buffer + for (TInt i=0; iReset(); + + // send notification for each input buffer + for (TInt i=0; i( + apComponentParameterStructure); + + err = iCore->SetBlockAlign(pAdPcmDecoderParam->nBlockAlign); + } + break; + + default: + // ignore + break; + } + + return err; + } + +OMX_ERRORTYPE COmxILAdPcmCodecProcessingFunction::ConfigIndication(OMX_INDEXTYPE /*aConfigIndex*/, const TAny* /*apComponentConfigStructure*/) + { + // no configs are processable for this codec... + return OMX_ErrorUnsupportedSetting; + + } + +OMX_ERRORTYPE COmxILAdPcmCodecProcessingFunction::BufferIndication(OMX_BUFFERHEADERTYPE* apBufferHeader, OMX_DIRTYPE aDirection) + { + if (!apBufferHeader) + { + return OMX_ErrorBadParameter; + } + + OMX_ERRORTYPE err = OMX_ErrorNone; + if (aDirection == OMX_DirInput) + { + //Buffers must be a multiple of block align. Artifact of CMMFImaAdpcmToPcm16Codec::CheckPreconditions + //EXECEPT for the last buffer when we will just throw away extra data + TBool lastBuffer = apBufferHeader->nFlags & OMX_BUFFERFLAG_EOS ? ETrue : EFalse; + if( ( apBufferHeader->nFilledLen % iCore->BlockAlign() ) != 0) + { + if( !lastBuffer && iCore->ForgetNotAlignedInputBuffers()) //don't deal with partial input buffers (decoder) apart from the last one + { + return OMX_ErrorBadParameter; + } + } + + TInt symerr = iBuffersToEmpty.Append(apBufferHeader); + if (symerr!=KErrNone) + { + err = OMX_ErrorInsufficientResources; + } + } + else if (aDirection == OMX_DirOutput) + { + + TInt symerr = iBuffersToFill.Append(apBufferHeader); + if (symerr!=KErrNone) + { + err = OMX_ErrorInsufficientResources; + } + } + else + { + // direction is neither input or output... bad parameter! + err = OMX_ErrorBadParameter; + } + + // on success, and if we're in a running state, (re)start the core to process the buffers + if (err==OMX_ErrorNone && (iBuffersToEmpty.Count()>0 || iBuffersToFill.Count()>0) && iState==OMX_StateExecuting) + { + iCore->Start(); + } + + return err; + } + +OMX_BOOL COmxILAdPcmCodecProcessingFunction::BufferRemovalIndication(OMX_BUFFERHEADERTYPE* apBufferHeader, OMX_DIRTYPE aDirection) + { + OMX_BOOL headerreleased = OMX_FALSE; + + // select which buffer array to process based on direction + RPointerArray* bufarray = NULL; + if (aDirection==OMX_DirInput) + { + bufarray = &iBuffersToEmpty; + } + else if (aDirection==OMX_DirOutput) + { + bufarray = &iBuffersToFill; + } + + + // find the buffer in the array + TInt pos = bufarray->Find(apBufferHeader); + if (pos!=KErrNotFound) + { + // if this buffer is at the head of the array, and the core is active, then the core may be using it... + // in this case we want to reset the core (to stop it using the buffer), release the buffer, and then restart the core + TBool bufinuse = (pos==0 && iCore->IsRunning()); + if (bufinuse) + { + iCore->Reset(); + } + + // remove the buffer + bufarray->Remove(pos); + headerreleased = OMX_TRUE; + + // if the core was reset, restart it + if (bufinuse) + { + iCore->Start(); + } + } + + return headerreleased; + } + +OMX_BUFFERHEADERTYPE* COmxILAdPcmCodecProcessingFunction::NextInputBuffer() + { + return (iBuffersToEmpty.Count()>0) ? iBuffersToEmpty[0] : NULL ; + } + +OMX_BUFFERHEADERTYPE* COmxILAdPcmCodecProcessingFunction::NextOutputBuffer() + { + return (iBuffersToFill.Count()>0) ? iBuffersToFill[0] : NULL; + } + +void COmxILAdPcmCodecProcessingFunction::InputBufferConsumed(OMX_BUFFERHEADERTYPE* aBuffer) + { + ASSERT(iBuffersToEmpty.Count()>0); + ASSERT(iBuffersToEmpty[0]==aBuffer); + + iBuffersToEmpty.Remove(0); + + iCallbacks.BufferDoneNotification(aBuffer, 0, OMX_DirInput); + } + +void COmxILAdPcmCodecProcessingFunction::OutputBufferFilled(OMX_BUFFERHEADERTYPE* aBuffer, TBool aMarkWithEos) + { + DEBUG_PRINTF(_L8("COmxILPcmDecoderProcessingFunction::OutputBufferFilled")); + + ASSERT(iBuffersToFill.Count()>0); + ASSERT(iBuffersToFill[0]==aBuffer); + + iBuffersToFill.Remove(0); + + if (aMarkWithEos) + { + // Propagate the EOS flag + aBuffer->nFlags |= OMX_BUFFERFLAG_EOS; + } + + OMX_U32 flags = aBuffer->nFlags; + iCallbacks.BufferDoneNotification(aBuffer, 1, OMX_DirOutput); + + if (aMarkWithEos) + { + iCallbacks.EventNotification( + OMX_EventBufferFlag, + 1, + flags, + 0); + } + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/adpcmcodec/src/common/omxiladpcmcodecprocessingfunction.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/adpcmcodec/src/common/omxiladpcmcodecprocessingfunction.h Fri May 07 16:25:23 2010 +0100 @@ -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 OMXILADPCMCODECPOCESSINGFUNCTION_H +#define OMXILADPCMCODECPOCESSINGFUNCTION_H + +#include +#include +#include "omxilprocessingfunction.h" +#include "omxiladpcmcodecprocessingfunctioncore.h" + +class COmxILAdPcmCodecProcessingFunction : public COmxILProcessingFunction, private MOmxILAdPcmCodecProcessingFunctionCoreContext + { +public: + static COmxILAdPcmCodecProcessingFunction* NewL(COmxILAdPcmCodecProcessingFunctionCore* aCore, MOmxILCallbackNotificationIf& aCallbacks); + ~COmxILAdPcmCodecProcessingFunction(); + + // from COmxILProcessingFunction + OMX_ERRORTYPE StateTransitionIndication(COmxILFsm::TStateIndex aNewState); + OMX_ERRORTYPE BufferFlushingIndication(TUint32 aPortIndex, OMX_DIRTYPE aDirection); + OMX_ERRORTYPE ParamIndication(OMX_INDEXTYPE aParamIndex, const TAny* apComponentParameterStructure); + OMX_ERRORTYPE ConfigIndication(OMX_INDEXTYPE aConfigIndex, const TAny* apComponentConfigStructure); + OMX_ERRORTYPE BufferIndication(OMX_BUFFERHEADERTYPE* apBufferHeader, OMX_DIRTYPE aDirection); + OMX_BOOL BufferRemovalIndication(OMX_BUFFERHEADERTYPE* apBufferHeader, OMX_DIRTYPE aDirection); + +private: + COmxILAdPcmCodecProcessingFunction(COmxILAdPcmCodecProcessingFunctionCore* aCore, MOmxILCallbackNotificationIf& aCallbacks); + void ConstructL(); + + // from MOmxILAdPcmCodecProcessingFunctionCoreContext + OMX_BUFFERHEADERTYPE* NextInputBuffer(); + OMX_BUFFERHEADERTYPE* NextOutputBuffer(); + void InputBufferConsumed(OMX_BUFFERHEADERTYPE* aBuffer); + void OutputBufferFilled(OMX_BUFFERHEADERTYPE* aBuffer, TBool aMarkWithEos); + + +private: + COmxILFsm::TStateIndex iState; + COmxILAdPcmCodecProcessingFunctionCore* iCore; + + RPointerArray iBuffersToEmpty; + RPointerArray iBuffersToFill; + }; + + +#endif /*OMXILADPCMCODECPOCESSINGFUNCTION_H_*/ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/adpcmcodec/src/common/omxiladpcmcodecprocessingfunctioncore.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/adpcmcodec/src/common/omxiladpcmcodecprocessingfunctioncore.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,275 @@ +/* +* 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 "log.h" +#include "omxiladpcmcodecprocessingfunctioncore.h" + +COmxILAdPcmCodecProcessingFunctionCore::COmxILAdPcmCodecProcessingFunctionCore() + :CAsyncOneShot( EPriorityUserInput ) + { + } + +COmxILAdPcmCodecProcessingFunctionCore::~COmxILAdPcmCodecProcessingFunctionCore() + { + //we do not own iContext + Cancel(); + iLock.Close(); + + delete [] iInternalOutputBuffer; + } + +void COmxILAdPcmCodecProcessingFunctionCore::ConstructL() + { + User::LeaveIfError(iLock.CreateLocal()); + } + +void COmxILAdPcmCodecProcessingFunctionCore::SetObserver( MOmxILAdPcmCodecProcessingFunctionCoreContext* aContext ) + { + iContext = aContext; + } + +void COmxILAdPcmCodecProcessingFunctionCore::Start() + { + DEBUG_PRINTF(_L8("COmxILAdPcmCodecProcessingFunctionCore::Start")); + + iLock.Wait(); + + iIsRunning = ETrue; + + CompleteSelf(); + + iLock.Signal(); + } + +void COmxILAdPcmCodecProcessingFunctionCore::Stop() + { + DEBUG_PRINTF(_L8("COmxILAdPcmCodecProcessingFunctionCore::Stop")); + + iLock.Wait(); + iIsRunning = EFalse; + iLock.Signal(); + } + +void COmxILAdPcmCodecProcessingFunctionCore::Reset() + { + iLock.Wait(); + + iIsRunning = EFalse; + + iInputBuffer = NULL; + iOutputBuffer = NULL; + iInternalOutputBufferHasDataToCopy = EFalse; + iBlockAlign = KImaAdpcmBlockAlign; + iSamplesPerBlock = KImaAdpcmSamplesPerBlock; + + delete [] iInternalOutputBuffer; + iInternalOutputBuffer = NULL; + iInternalOutputBufferSize = 0; + + iLock.Signal(); + } + + +TBool COmxILAdPcmCodecProcessingFunctionCore::IsRunning() + { + DEBUG_PRINTF(_L8("COmxILAdPcmCodecProcessingFunctionCore::IsRunning")); + + iLock.Wait(); + TBool retval = iIsRunning; + iLock.Signal(); + + return retval; + } + +void COmxILAdPcmCodecProcessingFunctionCore::CompleteSelf() + { + DEBUG_PRINTF(_L8("COmxILAdPcmCodecProcessingFunctionCore::CompleteSelf")); + + // MUST HAVE ALREADY ACQUIRED THE LOCK + if (!iSignalledToRun) + { + iSignalledToRun = ETrue; + Call(); + } + } + + +void COmxILAdPcmCodecProcessingFunctionCore::DoCancel() + { + // do nothing + } + +void COmxILAdPcmCodecProcessingFunctionCore::RunL() + { + iLock.Wait(); // acquire the lock. This prevents other threads from changing run-state while we're actively processing + iSignalledToRun = EFalse; + + if (iIsRunning && iStatus==KErrNone)//iStatus is always KErrNone, except for canceling + { + // if we don't have any input or output buffers, obtain them + if (!iInputBuffer) + { + iInputBuffer = iContext->NextInputBuffer(); + } + if (!iOutputBuffer) + { + iOutputBuffer = iContext->NextOutputBuffer(); + } + + //try to flush data with + TryToFlushTheResultsIfNeeded( EFalse );//it cannot be the last output buffer + + // if we STILL don't have an input and an output buffer, then we can't do any conversion, and don't activate ourselves + // also if there is something to flush and there is not space in the buffers we cannot proceed + if (!(iInputBuffer && iOutputBuffer && !iInternalOutputBufferHasDataToCopy )) + + { + iIsRunning = EFalse; + } + else + { + OMX_U8* inbuf = GetInBuf(); + + if( inbuf ) + { + //Note that iInternalOutputBuffer needs to be flushed to the output buffers before we call Convert, otherwise the data is lost + Convert( inbuf, iInternalOutputBuffer, iSamplesPerBlock); + //offsets in the input is moved in GetInBuf(); + iInternalOutputBufferOffset = 0; + iInternalOutputBufferHasDataToCopy = ETrue;//convert always fills the whole buffer + } + + // we're processing our last buffer if the input buffer is EOS flagged + TBool lastBuffer = iInputBuffer->nFlags & OMX_BUFFERFLAG_EOS ? ETrue : EFalse; + TBool lastOutputBuffer = EFalse; // we may have multiple output buffers for each input. This flag will be set when we know we're done so we may propogate the EOS. + + //Start: flash input buffer if done with it + if( 0 == iInputBuffer->nFilledLen )//we ate all src + { + DEBUG_PRINTF(_L8("COmxILAdPcmCodecProcessingFunctionCore::RunL finished with an Input buffer")); + OMX_BUFFERHEADERTYPE* buf = iInputBuffer; + + iInputBuffer = NULL; + + iContext->InputBufferConsumed( buf ); + // if we're done with our EOS marked input buffer, then our output buffer is the last one + + lastOutputBuffer = lastBuffer; + } + //End: flash input buffer if done with it + + TryToFlushTheResultsIfNeeded( lastOutputBuffer ); + + // complete ourselves - will cyummspaintontinue with the next buffer(s) if any + CompleteSelf(); + } + } + iLock.Signal(); // release the lock - although we may be set to run, our runstate may be changed as long as we're not actually processing + } + + +void COmxILAdPcmCodecProcessingFunctionCore::TryToFlushTheResultsIfNeeded( TBool aLastOutputBuffer ) + { + //the code below assumes that the output buffer is '%4=0' type + if (iInternalOutputBufferHasDataToCopy && iOutputBuffer ) + { + const TUint internalOutputBufferSize = InternalOutputBufferSize(); + const TUint outputBufferCapacity = (iOutputBuffer->nAllocLen- (iOutputBuffer->nFilledLen + iOutputBuffer->nOffset) ); + if ( outputBufferCapacity > 0)//if there is space in the output buffer + { + const TInt bytesLeftInTheInternalBuffer = internalOutputBufferSize - iInternalOutputBufferOffset; + const TInt bytesToCopy = (outputBufferCapacity > bytesLeftInTheInternalBuffer) ? bytesLeftInTheInternalBuffer : outputBufferCapacity; + //if there is space in the output buffer for the whole reminder of the internal buffer + Mem::Copy( iOutputBuffer->pBuffer+iOutputBuffer->nOffset+iOutputBuffer->nFilledLen//target + , iInternalOutputBuffer + iInternalOutputBufferOffset//source + , bytesToCopy);//length + iOutputBuffer->nFilledLen += bytesToCopy; + + iInternalOutputBufferOffset += bytesToCopy; + if (iInternalOutputBufferOffset >= internalOutputBufferSize )//reached the end of internal buffer + { + iInternalOutputBufferHasDataToCopy = EFalse; + } + } + } + // if the output buffer is full, release it + if ( iOutputBuffer && + ( aLastOutputBuffer || ( iOutputBuffer->nOffset+iOutputBuffer->nFilledLen == iOutputBuffer->nAllocLen ) ) ) + { + DEBUG_PRINTF4(_L8("COmxILAdPcmCodecProcessingFunctionCore::RunL finished with an Output buffer: off %d, filled %d, alloc %d"), iOutputBuffer->nOffset, iOutputBuffer->nFilledLen,iOutputBuffer->nAllocLen); + OMX_BUFFERHEADERTYPE* buf = iOutputBuffer; + iOutputBuffer = NULL; + + iContext->OutputBufferFilled(buf, aLastOutputBuffer ); + } + } + +OMX_U8* COmxILAdPcmCodecProcessingFunctionCore::GetInBuf() + { + //we assume here inputBuffer is pointing to something (checked in another place) + const TUint howMuchOneConvertEats = HowMuchOneConvertEats(); + if (ForgetNotAlignedInputBuffers()) + {//we don't deal with partial input buffers (decoder) + if (iInputBuffer->nFilledLen < howMuchOneConvertEats)//there is less left than a full block ->use a temp buffer; + { + iInputBuffer->nOffset += iInputBuffer->nFilledLen; + iInputBuffer->nFilledLen = 0;//-= iInputBuffer->nFilledLen; + return 0; + } + else//there is at least one full block left + { + OMX_U8* const buf = iInputBuffer->pBuffer + iInputBuffer->nOffset; + iInputBuffer->nOffset += howMuchOneConvertEats; + iInputBuffer->nFilledLen -= howMuchOneConvertEats; + return buf; + } + } + else + {//so we deal with partial input buffers (encoder) + const TUint inputLeft = iInputBuffer->nFilledLen; + if ( inputLeft > 0)//if there is space in the output buffer + { + const TInt spaceLeftInTempSrcBuffer = howMuchOneConvertEats - iTempSrcBufferOffset; + const TInt bytesToCopy = (inputLeft > spaceLeftInTempSrcBuffer) ? spaceLeftInTempSrcBuffer : inputLeft;//min + + Mem::Copy( iTempSrcBuffer+iTempSrcBufferOffset//target + , iInputBuffer->pBuffer+iInputBuffer->nOffset//source + , bytesToCopy);//length + iTempSrcBufferOffset += bytesToCopy; + iInputBuffer->nOffset += bytesToCopy; + iInputBuffer->nFilledLen -= bytesToCopy; + } + if ( iTempSrcBufferOffset == howMuchOneConvertEats )//input buffer ready? + { + iTempSrcBufferOffset = 0; + return iTempSrcBuffer; + } + } + return 0; + } + +TInt COmxILAdPcmCodecProcessingFunctionCore::RunError(TInt aError) + { + // shouldn't be possible to reach here - just return the error + return aError; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/adpcmcodec/src/common/omxiladpcmcodecprocessingfunctioncore.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/adpcmcodec/src/common/omxiladpcmcodecprocessingfunctioncore.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,120 @@ +/* +* 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 OMXILADPCMDECODERPROCESSINGFUNCTIONCORE_H +#define OMXILADPCMDECODERPROCESSINGFUNCTIONCORE_H + +#include +#include "OmxILAdPcmCodecConsts.h" + +#include +#include + +class MOmxILAdPcmCodecProcessingFunctionCoreContext + { +public: + // provide the core with the next input buffer to process, or NULL if there are no more + virtual OMX_BUFFERHEADERTYPE* NextInputBuffer() = 0; + + // provide the core with the next output buffer to fill, or NULL if there are no more + virtual OMX_BUFFERHEADERTYPE* NextOutputBuffer() = 0; + + // callback from core when an input buffer has been consumed + virtual void InputBufferConsumed(OMX_BUFFERHEADERTYPE* aBuffer) = 0; + + // callback from core when an output buffer has been filled + virtual void OutputBufferFilled(OMX_BUFFERHEADERTYPE* aBuffer, TBool aMarkWithEos) = 0; + }; + +class COmxILAdPcmCodecProcessingFunctionCore : public CAsyncOneShot + { +public: + ~COmxILAdPcmCodecProcessingFunctionCore(); + + void SetObserver(MOmxILAdPcmCodecProcessingFunctionCoreContext* aContext); + // May be called from any thread. + void Start(); + void Stop(); + virtual void Reset(); + virtual TInt Configure() = 0; + + TBool IsRunning(); + void SetSamplesPerBlock(TInt aSamples ) { iSamplesPerBlock = aSamples; } + + virtual TInt CheckConversion() = 0; + virtual TUint BitsPerSample() const = 0; + virtual TUint SampleRate() const = 0; + virtual TUint Channels() const = 0; + virtual TUint InternalOutputBufferSize() const = 0; + virtual TUint HowMuchOneConvertEats() const = 0; + virtual TBool ForgetNotAlignedInputBuffers() const = 0; + virtual OMX_ERRORTYPE SetBlockAlign(TInt aBlockAlign) = 0; + TInt BlockAlign() const { return iBlockAlign; } + +protected: + virtual void Convert( const TAny* aSrc, TAny* aDst, TInt aSamples ) = 0; + +protected: + COmxILAdPcmCodecProcessingFunctionCore(); + void ConstructL(); + + void CompleteSelf(); + + // from CActive / CAsyncOneShot + void DoCancel(); + void RunL(); + TInt RunError(TInt aError); + + // make some CActive public methods private since they're unsafe to use from different threads + using CActive::Cancel; + using CActive::IsActive; + + TUint iBlockAlign; + TUint iSamplesPerBlock; + + OMX_U8* iInternalOutputBuffer; + TInt iInternalOutputBufferSize; + +private: + OMX_U8* GetInBuf(); + void TryToFlushTheResultsIfNeeded( TBool aLastBuffer ); + +private: + MOmxILAdPcmCodecProcessingFunctionCoreContext* iContext;//not owned + + OMX_BUFFERHEADERTYPE* iInputBuffer; + OMX_BUFFERHEADERTYPE* iOutputBuffer; + + OMX_U8 iTempSrcBuffer[KImaAdpcmTempBufferSize]; + TUint iTempSrcBufferOffset; + TUint iInternalOutputBufferOffset; + TBool iInternalOutputBufferHasDataToCopy; + + RMutex iLock; // mutex to allow starting and stopping safely from differing threads + + TBool iIsRunning; // mutex protected - MUST ACQUIRE LOCK BEFORE USE + TBool iSignalledToRun; // mutex protected - MUST ACQUIRE LOCK BEFORE USE + + }; + +#endif// OMXILADPCMDECODERPROCESSINGFUNCTIONCORE_H_ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/adpcmcodec/src/decoder/omxiladpcmcodecprocessingfunctioncoreadpcmtopcm.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/adpcmcodec/src/decoder/omxiladpcmcodecprocessingfunctioncoreadpcmtopcm.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,309 @@ +/* +* 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 "omxiladpcmcodecprocessingfunctioncoreadpcmtopcm.h" + + + +// IMA-ADPCM step variation table +const TInt COmxILAdPcmCodecProcessingFunctionCoreAdPcmToPcm::KIndexTable[] = + { + -1, -1, -1, -1, 2, 4, 6, 8, + -1, -1, -1, -1, 2, 4, 6, 8 + }; + +const TInt COmxILAdPcmCodecProcessingFunctionCoreAdPcmToPcm::KStepSizeTable[89] = + { + 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, + 19, 21, 23, 25, 28, 31, 34, 37, 41, 45, + 50, 55, 60, 66, 73, 80, 88, 97, 107, 118, + 130, 143, 157, 173, 190, 209, 230, 253, 279, 307, + 337, 371, 408, 449, 494, 544, 598, 658, 724, 796, + 876, 963, 1060, 1166, 1282, 1411, 1552, 1707, 1878, 2066, + 2272, 2499, 2749, 3024, 3327, 3660, 4026, 4428, 4871, 5358, + 5894, 6484, 7132, 7845, 8630, 9493, 10442, 11487, 12635, 13899, + 15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767 + }; + + +COmxILAdPcmCodecProcessingFunctionCoreAdPcmToPcm* COmxILAdPcmCodecProcessingFunctionCoreAdPcmToPcm::NewL(COmxILAdPcmCodecPort& aPb0Port, COmxILPcmPortAdPcmVariant& aPb1Port ) + { + COmxILAdPcmCodecProcessingFunctionCoreAdPcmToPcm* self + = new(ELeave)COmxILAdPcmCodecProcessingFunctionCoreAdPcmToPcm(aPb0Port, aPb1Port); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +COmxILAdPcmCodecProcessingFunctionCoreAdPcmToPcm::COmxILAdPcmCodecProcessingFunctionCoreAdPcmToPcm(COmxILAdPcmCodecPort& aPb0Port, COmxILPcmPortAdPcmVariant& aPb1Port ) + : ipb0Port( aPb0Port ) + , ipb1Port( aPb1Port ) + { + } + +COmxILAdPcmCodecProcessingFunctionCoreAdPcmToPcm::~COmxILAdPcmCodecProcessingFunctionCoreAdPcmToPcm() + { + } + +TUint COmxILAdPcmCodecProcessingFunctionCoreAdPcmToPcm::BitsPerSample() const + { + return ipb0Port.ModeType().nBitsPerSample; + } + +TUint COmxILAdPcmCodecProcessingFunctionCoreAdPcmToPcm::Channels() const + { + return ipb0Port.ModeType().nChannels; + } + +TUint COmxILAdPcmCodecProcessingFunctionCoreAdPcmToPcm::SampleRate() const + { + return ipb0Port.ModeType().nSampleRate; + } + +TUint COmxILAdPcmCodecProcessingFunctionCoreAdPcmToPcm::InternalOutputBufferSize() const + { + return (Channels() == 1 ) ? iInternalOutputBufferSize : KImaAdpcmStereoTempBufferSize ; + } + +TUint COmxILAdPcmCodecProcessingFunctionCoreAdPcmToPcm::HowMuchOneConvertEats() const + { + return iBlockAlign; + } + +TBool COmxILAdPcmCodecProcessingFunctionCoreAdPcmToPcm::ForgetNotAlignedInputBuffers() const + { + return ETrue; + } + +TInt COmxILAdPcmCodecProcessingFunctionCoreAdPcmToPcm::CheckConversion() + { + //SetParameter checks if number bits per sample is 4 + + TInt err = KErrNone; + // verify that sample rates and channel assignments match + if ( (ipb0Port.ModeType().nSampleRate != ipb1Port.ModeType().nSamplingRate) + || (ipb0Port.ModeType().nChannels != ipb1Port.ModeType().nChannels) + //|| (ipb0Port.ModeType().nBitsPerSample != ipb1Port.ModeType().nBitPerSample) + || !ipb1Port.ModeType().bInterleaved + ) + { + err = KErrNotSupported; + } + + return err; + } + +/** +* +* Convert +* @param aSrc +* @param aDst +* @param aSamples +* +*/ +void COmxILAdPcmCodecProcessingFunctionCoreAdPcmToPcm::Convert(const TAny* aSrc, TAny* aDst, TInt aSamples ) + { + //const TInt samples = ipb0Port.ModeType().nChannels == 2 ? KImaAdpcmStereoSamplesPerBlock : KImaAdpcmSamplesPerBlock; + Convert( static_cast(aSrc), static_cast(aDst), aSamples ); + } + +/** +* +* Convert +* This is the orginial version from +* //EPOC/DV3/team/2008/multimedia/personal/extianwoods2/EmccOmxILProject/MMF/Codecs/Src/MMFCodecCommon/ +* Changes: aSrc was made const +* @param aSrc +* @param aDst +* @param aSamples +* +*/ +void COmxILAdPcmCodecProcessingFunctionCoreAdPcmToPcm::Convert(const TUint8* aSrc, TUint8* aDst, TInt aSamples) + { + TInt delta; // Current adpcm output value + TInt step; // Stepsize + TInt valpred; // Predicted value + TInt vpdiff; // Current change to valpred + TInt index; // Current step change index + + //[Read first sample and index from block header + // we do not need to store the information across calls + //since we process the entire block here] + valpred = (*aSrc++) & KAndMask8bit; + valpred |= STATIC_CAST(TInt16, ((*aSrc++) << 8)); + index = *aSrc++; + TUint8* dst=aDst; + + aSrc++; //skip reserved header byte + + //Write first sample to dest + *aDst++ = STATIC_CAST( TUint8, valpred); + *aDst++ = STATIC_CAST( TUint8, valpred >> 8); + dst += 2; + aSamples --; + + TBool theBufferStep = ETrue; + TInt bufferValue = 0; + for ( ; aSamples > 0 ; aSamples-- ) + { + // Step 1 - get the delta value + if ( theBufferStep) + { + bufferValue = *aSrc++; + delta = bufferValue & 0xf; + } + else + { + delta = (bufferValue >> 4) & 0xf; + } + + theBufferStep = !theBufferStep; + + ASSERT(index >= 0); + step = KStepSizeTable[index]; + + vpdiff = step>>3; + if ( delta & 4 ) + { + vpdiff += step; + } + if ( delta & 2 ) + { + vpdiff += step>>1; + } + if ( delta & 1 ) + { + vpdiff += step>>2; + } + + if ( delta & 8 ) + { + valpred -= vpdiff; + } + else + { + valpred += vpdiff; + } + + if ( valpred > (KClamp - 1) ) + { + valpred = (KClamp - 1); + } + else if ( valpred < -KClamp ) + { + valpred = -KClamp; + } + + index += KIndexTable[delta]; + if ( index < 0 ) + { + index = 0; + } + if ( index > KMaxImaAdpcmTableEntries ) + { + index = KMaxImaAdpcmTableEntries; + } + + *dst++ = STATIC_CAST( TUint8, valpred&KAndMask8bit); + *dst++ = STATIC_CAST( TUint8, (valpred>>8) ); + } + } + + +//from TInt CMMFImaAdpcmToPcm16Codec::Configure(TUint aChannels, TUint aSampleRate, TUint aBlockAlign) +TInt COmxILAdPcmCodecProcessingFunctionCoreAdPcmToPcm::Configure() + { + TUint channels = Channels(); + TUint sampleRate = SampleRate(); + + // TODO: The logic below should be revised when refactoring the whole encoder/decoder code. + // This logic doesn't allow for setting blocks smaller than 256. However, it seems this limitation + // doesn't adhere to the standard that allows for smaller blocks. Therefore, the logic has been + // overwritten for the SetBlockAlign() calls. + if (iCustomBlockAlign > 0) + { + iBlockAlign = iCustomBlockAlign; + } + else + { + if (iBlockAlign < 256) + { + switch (sampleRate * channels) + { + case 8000: // fall through, same as 11025 + case 11025: + case 16000: + iBlockAlign = 256; + break; + case 22050: + iBlockAlign = 512; + break; + + case 44100: + iBlockAlign = 1024; + break; + + case 88200: + iBlockAlign = 2048; + break; + + default: + return KErrArgument; + } + } + } + + const TUint KImaAdpcmBitsPerSample = 4; + iSamplesPerBlock = (iBlockAlign - 4 * channels) * 8 / (KImaAdpcmBitsPerSample * channels) + 1; + + if (iInternalOutputBuffer == NULL || (iInternalOutputBufferSize != iSamplesPerBlock*2)) + { + iInternalOutputBufferSize = iSamplesPerBlock*2; + delete [] iInternalOutputBuffer; + iInternalOutputBuffer = new OMX_U8[iInternalOutputBufferSize]; + if (iInternalOutputBuffer == NULL) + { + iInternalOutputBufferSize = 0; + return KErrNoMemory; + } + + } + + return KErrNone; + } + +OMX_ERRORTYPE COmxILAdPcmCodecProcessingFunctionCoreAdPcmToPcm::SetBlockAlign(TInt aBlockAlign) + { + if (aBlockAlign < KImaAdpcmMinBlockAlign || + aBlockAlign > KImaAdpcmMaxBlockAlign || + aBlockAlign % KImaAdpcmMinBlockAlign != 0) + { + return OMX_ErrorBadParameter; + } + + iCustomBlockAlign = aBlockAlign; + + return OMX_ErrorNone; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/adpcmcodec/src/decoder/omxiladpcmcodecprocessingfunctioncoreadpcmtopcm.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/adpcmcodec/src/decoder/omxiladpcmcodecprocessingfunctioncoreadpcmtopcm.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,75 @@ +/* +* 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 OMXILADPCMDECODERPROCESSINGFUNCTIONCOREADPCMTOPCM_H +#define OMXILADPCMDECODERPROCESSINGFUNCTIONCOREADPCMTOPCM_H + +#include "OmxILAdPcmCodecConsts.h" +#include "omxiladpcmcodecprocessingfunctioncore.h" +#include "omxiladpcmcodecport.h" +#include "OmxILPcmPortAdPcmVariant.h" + + +#include +#include +#include + + +const TInt KIndexTableSize = 16; +const TInt KStepTableSize = 89; + +class COmxILAdPcmCodecProcessingFunctionCoreAdPcmToPcm : public COmxILAdPcmCodecProcessingFunctionCore + { +public: + + static COmxILAdPcmCodecProcessingFunctionCoreAdPcmToPcm* NewL( COmxILAdPcmCodecPort& aPb0Port, COmxILPcmPortAdPcmVariant& aPb1Port ); + ~COmxILAdPcmCodecProcessingFunctionCoreAdPcmToPcm(); + + //from COmxILAdPcmCodecProcessingFunctionCore + virtual TInt Configure(); + virtual TInt CheckConversion(); + virtual TUint BitsPerSample() const; + virtual TUint SampleRate() const; + virtual TUint Channels() const; + virtual TUint InternalOutputBufferSize() const; + virtual TUint HowMuchOneConvertEats() const; + virtual TBool ForgetNotAlignedInputBuffers() const; + virtual OMX_ERRORTYPE SetBlockAlign(TInt aBlockAlign); + +private: + COmxILAdPcmCodecProcessingFunctionCoreAdPcmToPcm(COmxILAdPcmCodecPort& aPb0Port, COmxILPcmPortAdPcmVariant& CPb1Port ); + virtual void Convert( const TAny* aIn, TAny* aOut, TInt aSamples ); + void Convert( const TUint8* aSrc, TUint8* aDst, TInt aSamples); + +private: + static const TInt KIndexTable[KIndexTableSize]; + static const TInt KStepSizeTable[KStepTableSize]; + + //not owned + COmxILAdPcmCodecPort& ipb0Port; + COmxILPcmPortAdPcmVariant& ipb1Port; + + TUint iCustomBlockAlign; + }; + +#endif// OMXILADPCMDECODERPROCESSINGFUNCTIONCOREADPCMTOPCM_H_ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/adpcmcodec/src/decoder/omxiladpcmdecoder.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/adpcmcodec/src/decoder/omxiladpcmdecoder.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,298 @@ +/* +* 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 + +#include "log.h" +#include "omxilfsm.h" +#include "omxilcallbackmanager.h" +#include "omxilportmanager.h" +#include "omxilconfigmanager.h" +#include "omxilspecversion.h" + + +#include "omxiladpcmdecoder.h" + +#include "omxiladpcmdecoder.hrh" +#include + +#include "omxiladpcmdecoderport.h" +#include "OmxILPcmPortAdPcmVariant.h" +#include "omxiladpcmcodecprocessingfunction.h" +#include "omxiladpcmcodecprocessingfunctioncoreadpcmtopcm.h" + +_LIT8(KSymbianOmxILAdPcmDecoderNameLit, KSymbianOmxILAdPcmDecoderName ); +_LIT8(KSymbianOmxILAdPcmDecoderRoleLit, KSymbianOmxILAdPcmDecoderRole ); + +const TUint8 COmxILAdPcmDecoder::iComponentVersionMajor; +const TUint8 COmxILAdPcmDecoder::iComponentVersionMinor; +const TUint8 COmxILAdPcmDecoder::iComponentVersionRevision; +const TUint8 COmxILAdPcmDecoder::iComponentVersionStep; + + +OMXIL_COMPONENT_ECOM_ENTRYPOINT(KUidSymbianOmxILAdPcmDecoder); + + +// Component Entry Point +OMX_ERRORTYPE OMX_ComponentInit(OMX_HANDLETYPE aComponent) + { + TInt err = COmxILAdPcmDecoder::CreateComponent(aComponent); + + // This method should be called as a result of a OMX_GetHandle call. Let's + // return something that is consistent with the return codes allowed for + // that API call. + + switch (err) + { + case KErrNone: + return OMX_ErrorNone; + case KErrNoMemory: + return OMX_ErrorInsufficientResources; + case KErrArgument: + return OMX_ErrorBadParameter; + }; + + return OMX_ErrorUndefined; + } + +TInt COmxILAdPcmDecoder::CreateComponent(OMX_HANDLETYPE aComponent) + { + DEBUG_PRINTF(_L8("COmxILAdPcmDecoder::CreateComponent")); + + COmxILAdPcmDecoder* self = new COmxILAdPcmDecoder(); + if (!self) + { + return KErrNoMemory; + } + + TRAPD(err, self->ConstructL(aComponent)); + if (err != KErrNone) + { + delete self; + } + + return err; + } + +void COmxILAdPcmDecoder::ConstructL(OMX_HANDLETYPE aComponent) + { + DEBUG_PRINTF(_L8("COmxILAdPcmDecoder::ConstructL")); + + // STEP 1: Initialize the data received from the IL Core + ipHandle = static_cast(aComponent); + ipAppData = 0; + ipCallbacks = 0; + + // STEP 2: Create the call backs manager... + ipCallbackManager = COmxILCallbackManager::NewL(ipHandle, ipAppData, ipCallbacks); + + // STEP 3: Create the decoder-specific Processing Function... + ConstructPortsL();//this must be called before iCore is constructed + + iCore = COmxILAdPcmCodecProcessingFunctionCoreAdPcmToPcm::NewL( *ipb0Port, *ipb1Port ); + ipProcessingFunction = COmxILAdPcmCodecProcessingFunction::NewL(iCore, *ipCallbackManager); + + // STEP 4: Create Port manager... + ipPortManager = COmxILPortManager::NewL( + *ipProcessingFunction, // The component's processing function + *ipCallbackManager, // The call back manager object + iOmxILVersion, // OMX Version + 2, // The number of audio ports in this component + 0, // The starting audio port index + 0, // The number of image ports in this component + 0, // The starting image port index + 0, // The number of video ports in this component + 0, // The starting video port index + 0, // The number of other ports in this component + 0 // The starting other port index + ); + + + // .. and add them to the port manager... + User::LeaveIfError( AddPorts()) ; + + // STEP 5: Create the non-port related configuration manager... + RPointerArray componentRoles; + CleanupClosePushL(componentRoles); + User::LeaveIfError(componentRoles.Append(&KSymbianOmxILAdPcmDecoderRoleLit())); + + ipConfigManager = COmxILConfigManager::NewL( + *ipPortManager, + KSymbianOmxILAdPcmDecoderNameLit, + TOmxILVersion(iComponentVersionMajor, + iComponentVersionMinor, + iComponentVersionRevision, + iComponentVersionStep), + componentRoles); + + CleanupStack::Pop(); // componentRoles + componentRoles.Close(); // Must not destroy pointers + + // STEP 6: Create the FSM object... + ipFsm = COmxILFsm::NewL(*this, + *ipProcessingFunction, + *ipPortManager, + *ipConfigManager, + *ipCallbackManager); + + // And finally, let's get everything started + InitComponentL(); + } + +TInt COmxILAdPcmDecoder::AddPorts() + { + // TODO: remove workaround when unnecessary - BUG IN FRAMEWORK + // Workaround: in some cases, AddPort returns KErrGeneral in OOM cases. In order to get OOM tests for this component to run + // successfully, leave with OOM if KErrGeneral is returned. + + TInt err = ipPortManager->AddPort(ipb0Port, OMX_DirInput); + if (!err) + { + err = ipPortManager->AddPort(ipb1Port, OMX_DirOutput); + } + + if (err==KErrGeneral) + { + err= KErrNoMemory; + } + return err; + } + +COmxILAdPcmDecoder::COmxILAdPcmDecoder() + : iOmxILVersion(TOmxILSpecVersion()) + { + DEBUG_PRINTF(_L8("COmxILAdPcmDecoder::COmxILAdPcmDecoder")); + } + +COmxILAdPcmDecoder::~COmxILAdPcmDecoder() + { + DEBUG_PRINTF(_L8("COmxILAdPcmDecoder::~COmxILAdPcmDecoder")); + + delete ipProcessingFunction; + delete ipPortManager; + delete ipb0Port; + delete ipb1Port; + delete ipConfigManager; + delete ipFsm; + delete ipCallbackManager; + delete iCore; + } + + +void COmxILAdPcmDecoder::ConstructPortsL() + { + DEBUG_PRINTF(_L8("COmxILAdPcmDecoder::ConstructPortsL")); + + //STEP 1. Input adpcm port + ConstructAdPcmPortL( ipb0Port, OMX_DirInput, 0 ); + //STEP 2. Output port + ConstructPcmPortL( ipb1Port, OMX_DirOutput, 1 ); + } + +void COmxILAdPcmDecoder::ConstructPcmPortL( COmxILPcmPortAdPcmVariant*& aPort, OMX_DIRTYPE aDirection, TInt aPortIndex ) + { + DEBUG_PRINTF(_L8("COmxILAdPcmDecoder::ConstructPcmPortL")); + + OMX_AUDIO_PARAM_PCMMODETYPE profile = + { + sizeof profile, /**< Size of this structure, in Bytes */ + iOmxILVersion, /**< OMX specification version information */ + aPortIndex, /**< port that this structure applies to */ + 1, /**< Number of channels (e.g. 2 for stereo) */ + OMX_NumericalDataSigned, /**< indicates PCM data as signed or unsigned */ + OMX_EndianLittle, /**< indicates PCM data as little or big endian */ + OMX_TRUE, /**< True for normal interleaved data; false for + non-interleaved data (e.g. block data) */ + 16, /**< Bit per sample */ + 8000, /**< Sampling rate of the source data. Use 0 for + variable or unknown sampling rate. */ + OMX_AUDIO_PCMModeLinear, /**< PCM mode enumeration */ + + { OMX_AUDIO_ChannelLF, OMX_AUDIO_ChannelRF } // all other entries will be 0 due to aggregate initialisation rules (C++98, 8.5.1 clause 7) + }; + + const OMX_BUFFERSUPPLIERTYPE bufferSupplydirection = ( aDirection == OMX_DirInput ) ? OMX_BufferSupplyInput : OMX_BufferSupplyOutput; + + TOmxILCommonPortData portdata( + iOmxILVersion, // OMX specification version information + aPortIndex, // Port number the structure applies to + aDirection, // Direction of this port + 1, // The minimum number of buffers this port requires + 4096, // Minimum size, in bytes, for buffers to be used for this port + OMX_PortDomainAudio, // Domain of the port + OMX_FALSE, // Buffers contiguous requirement (true or false) + 0, // Buffer aligment requirements + bufferSupplydirection, // supplier preference when tunneling between two ports + aPortIndex == 1 ? 1 : 0 // This is the index of the compoent's port that will + // propagate buffer marks received in this port + ); + + RArray supportedOutputFormats; + CleanupClosePushL(supportedOutputFormats); + supportedOutputFormats.AppendL(OMX_AUDIO_CodingPCM); + + aPort = COmxILPcmPortAdPcmVariant::NewL( portdata,supportedOutputFormats,profile ); + CleanupStack::PopAndDestroy(&supportedOutputFormats); + } + + +void COmxILAdPcmDecoder::ConstructAdPcmPortL( COmxILAdPcmCodecPort*& aPort, OMX_DIRTYPE aDirection, TInt aPortIndex ) + { + DEBUG_PRINTF(_L8("COmxILAdPcmDecoder::ConstructAdPcmPortL")); + + // profile and port data for input port at index 0 + OMX_AUDIO_PARAM_ADPCMTYPE profile = { + sizeof profile, //OMX_U32 nSize; /**< size of the structure in bytes */ + iOmxILVersion, //OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + aPortIndex, //OMX_U32 nPortIndex; /**< port that this structure applies to */ + 1, //OMX_U32 nChannels; /**< Number of channels in the data stream (not + // necessarily the same as the number of channels + // to be rendered. */ + 4,//always 4 for adpcm //OMX_U32 nBitsPerSample; /**< Number of bits in each sample */ + 8000, //OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for + // variable or unknown sampling rate. */ + }; + + const OMX_BUFFERSUPPLIERTYPE bufferSupplydirection = ( aDirection == OMX_DirInput ) ? OMX_BufferSupplyInput : OMX_BufferSupplyOutput; + + TOmxILCommonPortData portdata( + iOmxILVersion, // OMX specification version information + aPortIndex, // Port number the structure applies to + aDirection, // Direction of this port + 1, // The minimum number of buffers this port requires + 22528, // Minimum size, in bytes, for buffers to be used for this port. The buffer size must be a multiplier of KImaAdpcmMaxBlockAlign (2048). + OMX_PortDomainAudio, // Domain of the port + OMX_FALSE, // Buffers contiguous requirement (true or false) + 0, // Buffer aligment requirements + bufferSupplydirection, // supplier preference when tunneling between two ports + aPortIndex == 1 ? 0 : 1 // This is the index of the compoent's port that will + // propagate buffer marks received in this port + ); + + RArray supportedInputFormats; + CleanupClosePushL(supportedInputFormats); + supportedInputFormats.AppendL(OMX_AUDIO_CodingADPCM); + + aPort = COmxILAdPcmDecoderPort::NewL(portdata, supportedInputFormats, profile); + CleanupStack::PopAndDestroy(&supportedInputFormats); + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/adpcmcodec/src/decoder/omxiladpcmdecoder.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/adpcmcodec/src/decoder/omxiladpcmdecoder.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,72 @@ +/* +* 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 OMXILADPCMDECODER_H +#define OMXILADPCMDECODER_H +#include "omxilcomponent.h" + + +// Forward declarations +class COmxILAdPcmCodecPort; +class COmxILPcmPortAdPcmVariant; +class COmxILAdPcmCodecProcessingFunctionCoreAdPcmToPcm; + + +NONSHARABLE_CLASS(COmxILAdPcmDecoder) : public COmxILComponent + { + +public: + + static const TUint8 iComponentVersionMajor = 1; + static const TUint8 iComponentVersionMinor = 0; + static const TUint8 iComponentVersionRevision = 0; + static const TUint8 iComponentVersionStep = 0; + +public: + + static TInt CreateComponent(OMX_HANDLETYPE aComponent); + + ~COmxILAdPcmDecoder(); + +private: + + COmxILAdPcmDecoder(); + void ConstructL(OMX_HANDLETYPE aComponent); + void ConstructPortsL(); + TInt AddPorts(); + void ConstructAdPcmPortL( COmxILAdPcmCodecPort*& aPort, OMX_DIRTYPE aDirection, TInt aPortIndex ); + void ConstructPcmPortL( COmxILPcmPortAdPcmVariant*& aPort, OMX_DIRTYPE aDirection, TInt aPortIndex ); + + +private: + + const OMX_VERSIONTYPE iOmxILVersion; + + //owns + COmxILAdPcmCodecPort* ipb0Port; + COmxILPcmPortAdPcmVariant* ipb1Port; + COmxILAdPcmCodecProcessingFunctionCoreAdPcmToPcm* iCore; + + }; + +#endif /*OMXILADPCMDECODER_H_*/ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/adpcmcodec/src/decoder/omxiladpcmdecoder.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/adpcmcodec/src/decoder/omxiladpcmdecoder.hrh Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,30 @@ +/* +* 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 OMXILADPCMDECODER_HRH_ +#define OMXILADPCMDECODER_HRH_ + +// TODO: assign proper UIDs +#define KUidSymbianOmxILAdPcmDecoderDll 0x10287089 +#define KUidSymbianOmxILAdPcmDecoder 0x1028708A + +#define KSymbianOmxILAdPcmDecoderName "OMX.SYMBIAN.AUDIO.DECODER.ADPCM" //This is used in the rss (REGISTRY_INFO) AND to create ipConfigManager +#define KSymbianOmxILAdPcmDecoderRole "audio_decoder.adpcm" //This is used in the rss (REGISTRY_INFO) AND to create ipConfigManager + +#endif /*OMXILADPCMDECODER_HRH_*/ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/adpcmcodec/src/decoder/omxiladpcmdecoder.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/adpcmcodec/src/decoder/omxiladpcmdecoder.rss Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,50 @@ +/* +* 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 +#include +#include "omxiladpcmdecoder.hrh" + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = KUidSymbianOmxILAdPcmDecoderDll; + interfaces = + { + INTERFACE_INFO + { + interface_uid = KUidOmxILSymbianComponentIf; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KUidSymbianOmxILAdPcmDecoder; + version_no = 1; + display_name = KSymbianOmxILAdPcmDecoderName; + default_data = KSymbianOmxILAdPcmDecoderRole; + opaque_data = ""; + } + }; + } + }; + } + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/adpcmcodec/src/decoder/omxiladpcmdecoderconverter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/adpcmcodec/src/decoder/omxiladpcmdecoderconverter.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,139 @@ +/* +* Copyright (c) 2003-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 "OmxILAdPcmDecoderConverter.h" + +/** +* +* Convert +* @param aSrc +* @param aDst +* @param aSamples +* +*/ +void TOmxILAdPcmDecoderConverter::Convert(TUint8* aSrc, TUint8* aDst, TInt aSamples) + { + TInt delta; // Current adpcm output value + TInt step; // Stepsize + TInt valpred; // Predicted value + TInt vpdiff; // Current change to valpred + TInt index; // Current step change index + + //[Read first sample and index from block header + // we do not need to store the information across calls + //since we process the entire block here] + valpred = (*aSrc++) & KAndMask8bit; + valpred |= STATIC_CAST(TInt16, ((*aSrc++) << 8)); + index = *aSrc++; + TUint8* dst=aDst; + + aSrc++; //skip reserved header byte + + //Write first sample to dest + *aDst++ = STATIC_CAST( TUint8, valpred); + *aDst++ = STATIC_CAST( TUint8, valpred >> 8); + dst += 2; + aSamples --; + + TBool theBufferStep = ETrue; + TInt bufferValue = 0; + for ( ; aSamples > 0 ; aSamples-- ) + { + // Step 1 - get the delta value + if ( theBufferStep) + { + bufferValue = *aSrc++; + delta = bufferValue & 0xf; + } + else + { + delta = (bufferValue >> 4) & 0xf; + } + + theBufferStep = !theBufferStep; + + ASSERT(index >= 0); + step = KStepSizeTable[index]; + + vpdiff = step>>3; + if ( delta & 4 ) + { + vpdiff += step; + } + if ( delta & 2 ) + { + vpdiff += step>>1; + } + if ( delta & 1 ) + { + vpdiff += step>>2; + } + + if ( delta & 8 ) + { + valpred -= vpdiff; + } + else + { + valpred += vpdiff; + } + + if ( valpred > (KClamp - 1) ) + { + valpred = (KClamp - 1); + } + else if ( valpred < -KClamp ) + { + valpred = -KClamp; + } + + index += KIndexTable[delta]; + if ( index < 0 ) + { + index = 0; + } + if ( index > KMaxImaAdpcmTableEntries ) + { + index = KMaxImaAdpcmTableEntries; + } + + *dst++ = STATIC_CAST( TUint8, valpred&KAndMask8bit); + *dst++ = STATIC_CAST( TUint8, (valpred>>8) ); + } + } + + + +// IMA-ADPCM step variation table +const TInt TOmxILAdPcmDecoderConverter::KIndexTable[] = + { + -1, -1, -1, -1, 2, 4, 6, 8, + -1, -1, -1, -1, 2, 4, 6, 8 + }; + +const TInt TOmxILAdPcmDecoderConverter::KStepSizeTable[89] = + { + 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, + 19, 21, 23, 25, 28, 31, 34, 37, 41, 45, + 50, 55, 60, 66, 73, 80, 88, 97, 107, 118, + 130, 143, 157, 173, 190, 209, 230, 253, 279, 307, + 337, 371, 408, 449, 494, 544, 598, 658, 724, 796, + 876, 963, 1060, 1166, 1282, 1411, 1552, 1707, 1878, 2066, + 2272, 2499, 2749, 3024, 3327, 3660, 4026, 4428, 4871, 5358, + 5894, 6484, 7132, 7845, 8630, 9493, 10442, 11487, 12635, 13899, + 15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767 + }; diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/adpcmcodec/src/decoder/omxiladpcmdecoderconverter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/adpcmcodec/src/decoder/omxiladpcmdecoderconverter.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2002-2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 __MMF_TMMFAUDIO_IMAADPCM_TO_S16PCM_CODEC_H__ +#define __MMF_TMMFAUDIO_IMAADPCM_TO_S16PCM_CODEC_H__ +#include +#include "OmxILAdPcmCodecConverterBase.h" + +/* +* +* class TOmxILAdPcmDecoderConverter +* +*/ +const TInt KIndexTableSize = 16; +const TInt KStepTableSize = 89; +class TOmxILAdPcmDecoderConverter : public TOmxILAdPcmCodecConverterBase + { +public: + virtual void Convert(TUint8* aSrc, TUint8* aDst, TInt aSamples); +private: + static const TInt KIndexTable[KIndexTableSize]; + static const TInt KStepSizeTable[KStepTableSize]; + }; + +#endif //__MMF_TMMFAUDIO_IMAADPCM_TO_S16PCM_CODEC_H__ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/adpcmcodec/src/decoder/omxiladpcmdecoderport.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/adpcmcodec/src/decoder/omxiladpcmdecoderport.cpp Fri May 07 16:25:23 2010 +0100 @@ -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: +* +*/ + + +/** + @file + @internalComponent +*/ + +#include + + +#include "omxiladpcmdecoderport.h" +#include "omxilsymbianadpcmdecoderextensions.h" +#include "log.h" +#include "omxilutil.h" + + +COmxILAdPcmDecoderPort* COmxILAdPcmDecoderPort::NewL( + const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedAudioFormats, + const OMX_AUDIO_PARAM_ADPCMTYPE& aPcmModeType) + { + DEBUG_PRINTF(_L8("COmxILAdPcmDecoderPort::NewL")); + + COmxILAdPcmDecoderPort* self = new(ELeave)COmxILAdPcmDecoderPort(aCommonPortData, aPcmModeType); + + CleanupStack::PushL(self); + self->ConstructL(aSupportedAudioFormats); + CleanupStack::Pop(); + + return self; + } + + +COmxILAdPcmDecoderPort::COmxILAdPcmDecoderPort(const TOmxILCommonPortData& aCommonPortData, + const OMX_AUDIO_PARAM_ADPCMTYPE& aPcmModeType) + : COmxILAdPcmCodecPort(aCommonPortData, aPcmModeType) + { + DEBUG_PRINTF(_L8("COmxILAdPcmDecoderPort::NewL")); + } + + +COmxILAdPcmDecoderPort::~COmxILAdPcmDecoderPort() + { + DEBUG_PRINTF(_L8("COmxILAdPcmDecoderPort::~COmxILAdPcmDecoderPort")); + } + + +OMX_ERRORTYPE COmxILAdPcmDecoderPort::GetLocalOmxParamIndexes(RArray& aIndexArray) const + { + DEBUG_PRINTF(_L8("COmxILAdPcmDecoderPort::GetLocalOmxParamIndexes")); + + // Always collect param indexes from parent + OMX_ERRORTYPE omxRetValue = COmxILAdPcmCodecPort::GetLocalOmxParamIndexes(aIndexArray); + if (OMX_ErrorNone != omxRetValue) + { + return omxRetValue; + } + + TInt err = aIndexArray.InsertInOrder(OMX_SymbianIndexParamAudioAdPcmDecoderBlockAlign); + if (KErrNone != err && KErrAlreadyExists != err) // Note that index duplication is OK. + { + return OMX_ErrorInsufficientResources; + } + + return OMX_ErrorNone; + } + + +OMX_ERRORTYPE COmxILAdPcmDecoderPort::SetParameter(OMX_INDEXTYPE aParamIndex, const TAny* apComponentParameterStructure, TBool& aUpdateProcessingFunction) + { + DEBUG_PRINTF(_L8("COmxILAdPcmDecoderPort::SetParameter")); + + // we only have OMX_SymbianIndexParamAudioAdPcmDecoderSamplesPerBlock - pass all other requests to our parent + switch (aParamIndex) + { + case OMX_SymbianIndexParamAudioAdPcmDecoderBlockAlign: + { + aUpdateProcessingFunction = ETrue; + } + break; + + default: + return COmxILAdPcmCodecPort::SetParameter(aParamIndex, apComponentParameterStructure, aUpdateProcessingFunction); + } + + return OMX_ErrorNone; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/adpcmcodec/src/decoder/omxiladpcmdecoderport.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/adpcmcodec/src/decoder/omxiladpcmdecoderport.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +/** + @file + @internalComponent +*/ + + +#ifndef OMXILADPCMDECODERPORT_H +#define OMXILADPCMDECODERPORT_H + +#include "omxiladpcmcodecport.h" + +class COmxILAdPcmDecoderPort : public COmxILAdPcmCodecPort + { +public: + static COmxILAdPcmDecoderPort* NewL(const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedAudioFormats, + const OMX_AUDIO_PARAM_ADPCMTYPE& aPcmModeType); + + ~COmxILAdPcmDecoderPort(); + + // From COmxILPort + OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray& aIndexArray) const; + OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex, + const TAny* apComponentParameterStructure, + TBool& aUpdateProcessingFunction); + +private: + COmxILAdPcmDecoderPort(const TOmxILCommonPortData& aCommonPortData, + const OMX_AUDIO_PARAM_ADPCMTYPE& aPcmModeType); + }; + +#endif // OMXILADPCMDECODERPORT_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/adpcmcodec/src/encoder/omxiladpcmcodecprocessingfunctioncorepcmtoadpcm.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/adpcmcodec/src/encoder/omxiladpcmcodecprocessingfunctioncorepcmtoadpcm.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,299 @@ +/* +* 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 "omxiladpcmcodecprocessingfunctioncorepcmtoadpcm.h" + +// IMA-ADPCM step variation table +const TInt COmxILAdPcmCodecProcessingFunctionCorePcmToAdPcm::KIndexTable[] = + { + -1, -1, -1, -1, 2, 4, 6, 8, + -1, -1, -1, -1, 2, 4, 6, 8 + }; + +const TInt COmxILAdPcmCodecProcessingFunctionCorePcmToAdPcm::KStepSizeTable[] = + { + 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, + 19, 21, 23, 25, 28, 31, 34, 37, 41, 45, + 50, 55, 60, 66, 73, 80, 88, 97, 107, 118, + 130, 143, 157, 173, 190, 209, 230, 253, 279, 307, + 337, 371, 408, 449, 494, 544, 598, 658, 724, 796, + 876, 963, 1060, 1166, 1282, 1411, 1552, 1707, 1878, 2066, + 2272, 2499, 2749, 3024, 3327, 3660, 4026, 4428, 4871, 5358, + 5894, 6484, 7132, 7845, 8630, 9493, 10442, 11487, 12635, 13899, + 15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767 + }; + +COmxILAdPcmCodecProcessingFunctionCorePcmToAdPcm* COmxILAdPcmCodecProcessingFunctionCorePcmToAdPcm::NewL(COmxILPcmPortAdPcmVariant& aPb0Port, COmxILAdPcmCodecPort& aPb1Port ) + { + COmxILAdPcmCodecProcessingFunctionCorePcmToAdPcm* self + = new(ELeave)COmxILAdPcmCodecProcessingFunctionCorePcmToAdPcm(aPb0Port, aPb1Port); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +COmxILAdPcmCodecProcessingFunctionCorePcmToAdPcm::COmxILAdPcmCodecProcessingFunctionCorePcmToAdPcm( COmxILPcmPortAdPcmVariant& aPb0Port, COmxILAdPcmCodecPort& aPb1Port ) + : iBufferStep(ETrue), iBuffer(0)//copied directly from TMMFAudioPcm16ToImaAdpcmCodec + , ipb0Port( aPb0Port ) + , ipb1Port( aPb1Port ) + { + } + +COmxILAdPcmCodecProcessingFunctionCorePcmToAdPcm::~COmxILAdPcmCodecProcessingFunctionCorePcmToAdPcm() + { + } + +TUint COmxILAdPcmCodecProcessingFunctionCorePcmToAdPcm::BitsPerSample() const + { + return ipb1Port.ModeType().nBitsPerSample; + } + +TUint COmxILAdPcmCodecProcessingFunctionCorePcmToAdPcm::Channels() const + { + return ipb1Port.ModeType().nChannels; + } + +TUint COmxILAdPcmCodecProcessingFunctionCorePcmToAdPcm::SampleRate() const + { + return ipb1Port.ModeType().nSampleRate; + } + +void COmxILAdPcmCodecProcessingFunctionCorePcmToAdPcm::Reset() + { + COmxILAdPcmCodecProcessingFunctionCore::Reset(); + iBufferStep = ETrue; + iBuffer = 0; + iState = TOmxILAdPcmCodecState(); + } + +TUint COmxILAdPcmCodecProcessingFunctionCorePcmToAdPcm::InternalOutputBufferSize() const + { + return KImaAdpcmBlockAlign; + } + +TUint COmxILAdPcmCodecProcessingFunctionCorePcmToAdPcm::HowMuchOneConvertEats() const + { + return (Channels() == 1 ) ? KImaAdpcmTempBufferSize : KImaAdpcmStereoTempBufferSize ; + } + +TBool COmxILAdPcmCodecProcessingFunctionCorePcmToAdPcm::ForgetNotAlignedInputBuffers() const + { + return EFalse; + } + +TInt COmxILAdPcmCodecProcessingFunctionCorePcmToAdPcm::CheckConversion() + { + //The port already check if the number of bits ber samples is 4 + + + TInt err = KErrNone; + // verify that sample rates and channel assignments match + if ( (ipb0Port.ModeType().nSamplingRate!= ipb1Port.ModeType().nSampleRate ) + ||(ipb0Port.ModeType().nChannels != ipb1Port.ModeType().nChannels) + || (!ipb0Port.ModeType().bInterleaved) + ) + { + err = KErrNotSupported; + } + + return err; + } + +TInt COmxILAdPcmCodecProcessingFunctionCorePcmToAdPcm::Configure() + { + //from void CMMFPcm16ToImaAdpcmCodec::ProcessBuffers + const TUint KSourceFrameSize = KImaAdpcmSamplesPerBlock * 2; + // calculate number of pcm samples per source frame + const TInt KSamplesPerFrame = KSourceFrameSize/(sizeof(TInt16)); + SetSamplesPerBlock(KSamplesPerFrame); + + // Allocate internal output buffer + delete [] iInternalOutputBuffer; + iInternalOutputBuffer = new OMX_U8[KImaAdpcmTempBufferSize]; + if (iInternalOutputBuffer == NULL) + { + return KErrNoMemory; + } + + return KErrNone; + } + + +/** +* +* Convert +* @param aSrc +* @param aDst +* @param aSamples +* +*/ +void COmxILAdPcmCodecProcessingFunctionCorePcmToAdPcm::Convert(const TAny* aSrc, TAny* aDst, TInt aSamples ) + { + //const TInt samples = ipb0Port.ModeType().nChannels == 2 ? KImaAdpcmStereoSamplesPerBlock : KImaAdpcmSamplesPerBlock; + Convert( static_cast(aSrc), static_cast(aDst), aSamples ); + } + + +/** +* +* Convert +* This is the orginial version from +* //EPOC/DV3/team/2008/multimedia/personal/extianwoods2/EmccOmxILProject/MMF/Codecs/Src/MMFCodecCommon/ +* Changes: aSrc, srcPtr and src were made const +* @param aSrc +* @param aDst +* @param aSamples +* +*/ +void COmxILAdPcmCodecProcessingFunctionCorePcmToAdPcm::Convert(const TUint8* aSrc, TUint8* aDst, TInt aSamples) + { + TInt val; // Current input sample value + TInt sign; // Current adpcm sign bit + TInt delta; // Current adpcm output value + TInt diff; // Difference between val and valprev + TInt step; // Stepsize + TInt valpred; // Predicted value + TInt vpdiff; // Current change to valpred + TInt index; // Current step change index + + const TInt16* srcPtr=REINTERPRET_CAST(const TInt16*, aSrc); + const TInt16* src=srcPtr; + + iState.iPredicted = *aSrc++; + iState.iPredicted |= STATIC_CAST(TInt16, ((*aSrc++) << 8)); + + valpred = iState.iPredicted; + index = iState.iIndex; + ASSERT(index >= 0); + step = KStepSizeTable[index]; + + //Write block header + *aDst++ = STATIC_CAST( TUint8, valpred); + *aDst++ = STATIC_CAST( TUint8, valpred >> 8); + *aDst++ = STATIC_CAST( TUint8, index); + *aDst++ = 0; //reserved byte + src++; + aSamples --; + + for (; aSamples > 0; aSamples--) + { + val = *src; + src++; + + step = KStepSizeTable[index]; + + // Step 1 - compute difference with previous value + diff = val - valpred; + sign = (diff < 0) ? 8 : 0; + if ( sign ) + { + diff = (-diff); + } + + // Step 2 - Divide and clamp + // Note: + // This code *approximately* computes: + // delta = diff*4/step; + // vpdiff = (delta+0.5)*step/4; + // but in shift step bits are dropped. The net result of this is + // that even if you have fast mul/div hardware you cannot put it to + // good use since the fixup would be too expensive. + // + delta = 0; + vpdiff = (step >> 3); + + if ( diff >= step ) + { + delta = 4; + diff -= step; + vpdiff += step; + } + step >>= 1; + if ( diff >= step ) + { + delta |= 2; + diff -= step; + vpdiff += step; + } + step >>= 1; + if ( diff >= step ) + { + delta |= 1; + vpdiff += step; + } + + // Step 3 - Update previous value + if ( sign ) + { + valpred -= vpdiff; + } + else + { + valpred += vpdiff; + } + + // Step 4 - Clamp previous value to 16 bits + if ( valpred > KClamp - 1 ) + { + valpred = KClamp - 1; + } + else if ( valpred < - KClamp ) + { + valpred = - KClamp; + } + + // Step 5 - Assemble value, update index and step values + delta |= sign; + + index += KIndexTable[delta]; + if ( index < 0 ) + { + index = 0; + } + if ( index > 88 ) + { + index = 88; + } + + // Step 6 - Output value + if (iBufferStep) + { + iBuffer = delta & 0x0f; + } + else + { + *aDst++ = STATIC_CAST( TInt8, ((delta << 4) & 0xf0) | iBuffer); + } + + iBufferStep = !iBufferStep; + } + + iState.iPredicted = STATIC_CAST(TInt16, valpred); + iState.iIndex = STATIC_CAST(TUint8, index); + } + +OMX_ERRORTYPE COmxILAdPcmCodecProcessingFunctionCorePcmToAdPcm::SetBlockAlign(TInt /*aBlockAlign*/) + { + return OMX_ErrorUnsupportedIndex; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/adpcmcodec/src/encoder/omxiladpcmcodecprocessingfunctioncorepcmtoadpcm.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/adpcmcodec/src/encoder/omxiladpcmcodecprocessingfunctioncorepcmtoadpcm.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,89 @@ +/* +* 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 OMXILADPCMDECODERPROCESSINGFUNCTIONCOREPCMTOADPCM_H +#define OMXILADPCMDECODERPROCESSINGFUNCTIONCOREPCMTOADPCM_H + +#include "OmxILAdPcmCodecConsts.h" +#include "omxiladpcmcodecprocessingfunctioncore.h" +#include "omxiladpcmcodecport.h" +#include "OmxILPcmPortAdPcmVariant.h" + +#include +#include +#include + +const TInt KImaAdpcmCodecIndexTableSize = 16; +const TInt KImaAdpcmCodecStepTableSize = 89; + +/* +* +* class TOmxILAdPcmCodecState +* +*/ +class TOmxILAdPcmCodecState + { +public: + TInt16 iPredicted; // Previous output value + TUint8 iIndex; // Index into stepsize table + }; + +class COmxILAdPcmCodecProcessingFunctionCorePcmToAdPcm : public COmxILAdPcmCodecProcessingFunctionCore + { +public: + + static COmxILAdPcmCodecProcessingFunctionCorePcmToAdPcm* NewL( COmxILPcmPortAdPcmVariant& aPb0Port, COmxILAdPcmCodecPort& aPb1Port ); + ~COmxILAdPcmCodecProcessingFunctionCorePcmToAdPcm(); + +private: + COmxILAdPcmCodecProcessingFunctionCorePcmToAdPcm( COmxILPcmPortAdPcmVariant& aPb0Port, COmxILAdPcmCodecPort& aPb1Port ); + + //from COmxILAdPcmCodecProcessingFunctionCore + virtual void Convert( const TAny* aIn, TAny* aOut, TInt aSamples); + virtual void Reset(); + virtual TInt CheckConversion(); + virtual TUint BitsPerSample() const; + virtual TUint SampleRate() const; + virtual TUint Channels() const; + virtual TUint InternalOutputBufferSize() const; + virtual TUint HowMuchOneConvertEats() const; + virtual TInt Configure(); + virtual TBool ForgetNotAlignedInputBuffers() const; + virtual OMX_ERRORTYPE SetBlockAlign(TInt aBlockAlign); + + //original from the MMF folder + void Convert(const TUint8* aSrc, TUint8* aDst, TInt aSamples); + +private: + TOmxILAdPcmCodecState iState; //supports mono only //original comment from the MMF folder + static const TInt KIndexTable[KImaAdpcmCodecIndexTableSize]; + static const TInt KStepSizeTable[KImaAdpcmCodecStepTableSize]; + TBool iBufferStep; + TInt iBuffer; + + //not owned + COmxILPcmPortAdPcmVariant& ipb0Port; + COmxILAdPcmCodecPort& ipb1Port; + }; + +#endif// OMXILADPCMDECODERPROCESSINGFUNCTIONCOREPCMTOADPCM_H_ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/adpcmcodec/src/encoder/omxiladpcmencoder.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/adpcmcodec/src/encoder/omxiladpcmencoder.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,298 @@ +/* +* 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 + +#include "log.h" +#include "omxilfsm.h" +#include "omxilcallbackmanager.h" +#include "omxilportmanager.h" +#include "omxilconfigmanager.h" +#include "omxilspecversion.h" + +#include "omxiladpcmencoder.h" + +#include "omxiladpcmencoder.hrh" +#include + +#include "omxiladpcmcodecport.h" +#include "OmxILPcmPortAdPcmVariant.h" +#include "omxiladpcmcodecprocessingfunction.h" +#include "omxiladpcmcodecprocessingfunctioncorepcmtoadpcm.h" + + +_LIT8(KSymbianOmxILAdPcmEncoderNameLit, KSymbianOmxILAdPcmEncoderName); +_LIT8(KSymbianOmxILAdPcmEncoderRoleLit, KSymbianOmxILAdPcmEncoderRole); + + +const TUint8 COmxILAdPcmEncoder::iComponentVersionMajor; +const TUint8 COmxILAdPcmEncoder::iComponentVersionMinor; +const TUint8 COmxILAdPcmEncoder::iComponentVersionRevision; +const TUint8 COmxILAdPcmEncoder::iComponentVersionStep; + + +OMXIL_COMPONENT_ECOM_ENTRYPOINT(KUidSymbianOmxILAdPcmEncoder); + + +// Component Entry Point +OMX_ERRORTYPE OMX_ComponentInit(OMX_HANDLETYPE aComponent) + { + TInt err = COmxILAdPcmEncoder::CreateComponent(aComponent); + + // This method should be called as a result of a OMX_GetHandle call. Let's + // return something that is consistent with the return codes allowed for + // that API call. + + switch(err) + { + case KErrNone: + return OMX_ErrorNone; + case KErrNoMemory: + return OMX_ErrorInsufficientResources; + case KErrArgument: + return OMX_ErrorBadParameter; + }; + + return OMX_ErrorUndefined; + } + +TInt COmxILAdPcmEncoder::CreateComponent(OMX_HANDLETYPE aComponent) + { + DEBUG_PRINTF(_L8("COmxILAdPcmEncoder::CreateComponent")); + + COmxILAdPcmEncoder* self = new COmxILAdPcmEncoder(); + if (!self) + { + return KErrNoMemory; + } + + TRAPD(err, self->ConstructL(aComponent)); + if (err != KErrNone) + { + delete self; + } + + return err; + } + +void COmxILAdPcmEncoder::ConstructL(OMX_HANDLETYPE aComponent) + { + DEBUG_PRINTF(_L8("COmxILAdPcmEncoder::ConstructL")); + + // STEP 1: Initialize the data received from the IL Core + ipHandle = static_cast(aComponent); + ipAppData = 0; + ipCallbacks = 0; + + // STEP 2: Create the call backs manager... + ipCallbackManager = COmxILCallbackManager::NewL(ipHandle, ipAppData, ipCallbacks); + + // STEP 3: Create the decoder-specific Processing Function... + ConstructPortsL();//this has to be called before iCore is constructed + iCore = COmxILAdPcmCodecProcessingFunctionCorePcmToAdPcm::NewL( *ipb0Port, *ipb1Port); + ipProcessingFunction = COmxILAdPcmCodecProcessingFunction::NewL(iCore, *ipCallbackManager); + + + // STEP 4: Create Port manager... + ipPortManager = COmxILPortManager::NewL( + *ipProcessingFunction, // The component's processing function + *ipCallbackManager, // The call back manager object + iOmxILVersion, // OMX Version + 2, // The number of audio ports in this component + 0, // The starting audio port index + 0, // The number of image ports in this component + 0, // The starting image port index + 0, // The number of video ports in this component + 0, // The starting video port index + 0, // The number of other ports in this component + 0 // The starting other port index + ); + + + + // .. and add them to the port manager... + User::LeaveIfError( AddPorts() ); + + // STEP 5: Create the non-port related configuration manager... + RPointerArray componentRoles; + CleanupClosePushL(componentRoles); + User::LeaveIfError(componentRoles.Append(&KSymbianOmxILAdPcmEncoderRoleLit())); + + ipConfigManager = COmxILConfigManager::NewL( + *ipPortManager, + KSymbianOmxILAdPcmEncoderNameLit, + TOmxILVersion(iComponentVersionMajor, + iComponentVersionMinor, + iComponentVersionRevision, + iComponentVersionStep), + componentRoles); + + CleanupStack::Pop(); // componentRoles + componentRoles.Close(); // Must not destroy pointers + + // STEP 6: Create the FSM object... + ipFsm = COmxILFsm::NewL(*this, + *ipProcessingFunction, + *ipPortManager, + *ipConfigManager, + *ipCallbackManager); + + // And finally, let's get everything started + InitComponentL(); + } + +TInt COmxILAdPcmEncoder::AddPorts() + { + // TODO: remove workaround when unnecessary - BUG IN FRAMEWORK + // Workaround: in some cases, AddPort returns KErrGeneral in OOM cases. In order to get OOM tests for this component to run + // successfully, leave with OOM if KErrGeneral is returned. + + TInt err = ipPortManager->AddPort(ipb0Port, OMX_DirInput); + if (!err) + { + err = ipPortManager->AddPort(ipb1Port, OMX_DirOutput); + } + + if (err==KErrGeneral) + { + err= KErrNoMemory; + } + return err; + } + +COmxILAdPcmEncoder::COmxILAdPcmEncoder() + : iOmxILVersion(TOmxILSpecVersion()) + { + DEBUG_PRINTF(_L8("COmxILAdPcmEncoder::COmxILAdPcmEncoder")); + } + +COmxILAdPcmEncoder::~COmxILAdPcmEncoder() + { + DEBUG_PRINTF(_L8("COmxILAdPcmEncoder::~COmxILAdPcmEncoder")); + + delete ipProcessingFunction; + delete ipPortManager; + delete ipb0Port; + delete ipb1Port; + delete ipConfigManager; + delete ipFsm; + delete ipCallbackManager; + delete iCore; + } + + +void COmxILAdPcmEncoder::ConstructPortsL() + { + //STEP 1. Input pcm port + ConstructPcmPortL( ipb0Port, OMX_DirInput, 0 ); + //STEP 2. Output adpcm port + ConstructAdPcmPortL( ipb1Port, OMX_DirOutput, 1 ); + } + +void COmxILAdPcmEncoder::ConstructPcmPortL( COmxILPcmPortAdPcmVariant*& aPort, OMX_DIRTYPE aDirection, TInt aPortIndex ) + { + DEBUG_PRINTF(_L8("COmxILAdPcmEncoder::ConstructPcmPortL")); + + OMX_AUDIO_PARAM_PCMMODETYPE profile = + { + sizeof profile, /**< Size of this structure, in Bytes */ + iOmxILVersion, /**< OMX specification version information */ + aPortIndex, /**< port that this structure applies to */ + 1, /**< Number of channels (e.g. 2 for stereo) */ + OMX_NumericalDataSigned, /**< indicates PCM data as signed or unsigned */ + OMX_EndianLittle, /**< indicates PCM data as little or big endian */ + OMX_TRUE, /**< True for normal interleaved data; false for + non-interleaved data (e.g. block data) */ + 16, /**< Bit per sample */ + 8000, /**< Sampling rate of the source data. Use 0 for + variable or unknown sampling rate. */ + OMX_AUDIO_PCMModeLinear, /**< PCM mode enumeration */ + + { OMX_AUDIO_ChannelLF, OMX_AUDIO_ChannelRF } // all other entries will be 0 due to aggregate initialisation rules (C++98, 8.5.1 clause 7) + }; + + const OMX_BUFFERSUPPLIERTYPE bufferSupplydirection = ( aDirection == OMX_DirInput ) ? OMX_BufferSupplyInput : OMX_BufferSupplyOutput; + + TOmxILCommonPortData portdata( + iOmxILVersion, // OMX specification version information + aPortIndex, // Port number the structure applies to + aDirection, // Direction of this port + 1, // The minimum number of buffers this port requires + 4096, // Minimum size, in bytes, for buffers to be used for this port + OMX_PortDomainAudio, // Domain of the port + OMX_FALSE, // Buffers contiguous requirement (true or false) + 0, // Buffer aligment requirements + bufferSupplydirection, // supplier preference when tunneling between two ports + aPortIndex == 1 ? 1 : 0 // This is the index of the compoent's port that will + // propagate buffer marks received in this port + ); + + RArray supportedOutputFormats; + CleanupClosePushL(supportedOutputFormats); + supportedOutputFormats.AppendL(OMX_AUDIO_CodingPCM); + + aPort = COmxILPcmPortAdPcmVariant::NewL( portdata,supportedOutputFormats,profile ); + CleanupStack::PopAndDestroy(&supportedOutputFormats); + } + + +void COmxILAdPcmEncoder::ConstructAdPcmPortL( COmxILAdPcmCodecPort*& aPort, OMX_DIRTYPE aDirection, TInt aPortIndex ) + { + DEBUG_PRINTF(_L8("COmxILAdPcmEncoder::ConstructAdPcmPortL")); + + // profile and port data for input port at index 0 + OMX_AUDIO_PARAM_ADPCMTYPE profile = { + sizeof profile, //OMX_U32 nSize; /**< size of the structure in bytes */ + iOmxILVersion, //OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + aPortIndex, //OMX_U32 nPortIndex; /**< port that this structure applies to */ + 1, //OMX_U32 nChannels; /**< Number of channels in the data stream (not + // necessarily the same as the number of channels + // to be rendered. */ + 4,//always 4 for adpcm //OMX_U32 nBitsPerSample; /**< Number of bits in each sample */ + 8000, //OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for + // variable or unknown sampling rate. */ + }; + + const OMX_BUFFERSUPPLIERTYPE bufferSupplydirection = ( aDirection == OMX_DirInput ) ? OMX_BufferSupplyInput : OMX_BufferSupplyOutput; + + TOmxILCommonPortData portdata( + iOmxILVersion, // OMX specification version information + aPortIndex, // Port number the structure applies to + aDirection, // Direction of this port + 1, // The minimum number of buffers this port requires + 22272, // Minimum size, in bytes, for buffers to be used for this port + OMX_PortDomainAudio, // Domain of the port + OMX_FALSE, // Buffers contiguous requirement (true or false) + 0, // Buffer aligment requirements + bufferSupplydirection, // supplier preference when tunneling between two ports + aPortIndex == 1 ? 0 : 1 // This is the index of the compoent's port that will + // propagate buffer marks received in this port + ); + + RArray supportedInputFormats; + CleanupClosePushL(supportedInputFormats); + supportedInputFormats.AppendL(OMX_AUDIO_CodingADPCM); + + aPort = COmxILAdPcmCodecPort::NewL(portdata, supportedInputFormats, profile); + CleanupStack::PopAndDestroy(&supportedInputFormats); + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/adpcmcodec/src/encoder/omxiladpcmencoder.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/adpcmcodec/src/encoder/omxiladpcmencoder.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,68 @@ +/* +* 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 OMXILADPCMENCODER_H +#define OMXILADPCMENCODER_H +#include "omxilcomponent.h" + + +// Forward declarations +class COmxILAdPcmCodecPort; +class COmxILPcmPortAdPcmVariant; +class COmxILAdPcmCodecProcessingFunctionCorePcmToAdPcm; + + +NONSHARABLE_CLASS(COmxILAdPcmEncoder) : public COmxILComponent + { + +public: + + static const TUint8 iComponentVersionMajor = 1; + static const TUint8 iComponentVersionMinor = 0; + static const TUint8 iComponentVersionRevision = 0; + static const TUint8 iComponentVersionStep = 0; + +public: + + static TInt CreateComponent(OMX_HANDLETYPE aComponent); + + ~COmxILAdPcmEncoder(); + +private: + + COmxILAdPcmEncoder(); + void ConstructL(OMX_HANDLETYPE aComponent); + void ConstructPortsL(); + TInt AddPorts(); + void ConstructAdPcmPortL( COmxILAdPcmCodecPort*& aPort, OMX_DIRTYPE aDirection, TInt aPortIndex ); + void ConstructPcmPortL( COmxILPcmPortAdPcmVariant*& aPort, OMX_DIRTYPE aDirection, TInt aPortIndex ); + + +private: + const OMX_VERSIONTYPE iOmxILVersion; + COmxILPcmPortAdPcmVariant* ipb0Port; + COmxILAdPcmCodecPort* ipb1Port; + COmxILAdPcmCodecProcessingFunctionCorePcmToAdPcm* iCore; + }; + +#endif /*OMXILADPCMENCODER_H_*/ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/adpcmcodec/src/encoder/omxiladpcmencoder.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/adpcmcodec/src/encoder/omxiladpcmencoder.hrh Fri May 07 16:25:23 2010 +0100 @@ -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 OMXILADPCMENCODER_HRH_ +#define OMXILADPCMENCODER_HRH_ + +// TODO: assign proper UIDs +#define KUidSymbianOmxILAdPcmEncoderDll 0x1028708B +#define KUidSymbianOmxILAdPcmEncoder 0x1028708C + +#define KSymbianOmxILAdPcmEncoderName "OMX.SYMBIAN.AUDIO.ENCODER.ADPCM" //This is used in the rss (REGISTRY_INFO) AND to create ipConfigManager +#define KSymbianOmxILAdPcmEncoderRole "audio_encoder.adpcm" //This is used in the rss (REGISTRY_INFO) AND to create ipConfigManager + + +#endif /*OMXILADPCMENCODER_HRH_*/ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/adpcmcodec/src/encoder/omxiladpcmencoder.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/adpcmcodec/src/encoder/omxiladpcmencoder.rss Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,50 @@ +/* +* 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 +#include +#include "omxiladpcmencoder.hrh" + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = KUidSymbianOmxILAdPcmEncoderDll; + interfaces = + { + INTERFACE_INFO + { + interface_uid = KUidOmxILSymbianComponentIf; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KUidSymbianOmxILAdPcmEncoder; + version_no = 1; + display_name = KSymbianOmxILAdPcmEncoderName; + default_data = KSymbianOmxILAdPcmEncoderRole; + opaque_data = ""; + } + }; + } + }; + } + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/common/OmxILPcmPortBase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/common/OmxILPcmPortBase.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,311 @@ +/* +* 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 +*/ + +// Self +#include "OmxILPcmPortBase.h" + +// Project (MMP) +/* None */ + +// Solution (INF) +#include +#if defined(NCP_COMMON_MM_3PA_ENABLED) || defined(SYMBIAN_MULTIMEDIA_THREEPLANEARCH) +#include +#include +#else +#include "log.h" +#include "omxilutil.h" +#endif + +// System +/* None */ + +_LIT8(KMimeTypeAudioPcm, "audio/pcm"); + +/** + * Constructor. + * Derived classes must call this function. + */ +COmxILPcmPortBase::COmxILPcmPortBase(const TOmxILCommonPortData& aCommonPortData, const OMX_AUDIO_PARAM_PCMMODETYPE& aPcmModeType) + : COmxILAudioPort(aCommonPortData), iParamAudioPcm(aPcmModeType) + { + DEBUG_PRINTF(_L8("COmxILPcmDecoderPort::NewL")); + } + +/** + * Second stage constructor. + * Note: Derived classes must call this function as part of construction. + */ +void COmxILPcmPortBase::ConstructL(const RArray& aSupportedAudioFormats) + { + DEBUG_PRINTF(_L8("COmxILPcmDecoderPort::ConstructL")); + // Debug checks (release will leave in ConstructL instead) + ASSERT(aSupportedAudioFormats.Count() == 1); + ASSERT(aSupportedAudioFormats[0] == OMX_AUDIO_CodingPCM); + if (aSupportedAudioFormats.Count() != 1 || aSupportedAudioFormats[0] != OMX_AUDIO_CodingPCM) + { + User::Leave(KErrNotSupported); + } + + COmxILAudioPort::ConstructL(aSupportedAudioFormats); + // + // Setup the iParamPortDefinition (output info) + + // Before constructL completes, we must have set (and be finished with) the iParamPortDefinition + iParamPortDefinition.eDomain = OMX_PortDomainAudio; + + TUint8* mimeptr = const_cast(KMimeTypeAudioPcm().Ptr()); // KMimeTypeAudioPcm is already null-terminated since it's made from a literal C-style string + iParamPortDefinition.format.audio.cMIMEType = reinterpret_cast(mimeptr); + + iParamPortDefinition.format.audio.bFlagErrorConcealment = OMX_FALSE; + iParamPortDefinition.format.audio.eEncoding = OMX_AUDIO_CodingPCM; + } + +/** + * Destructor. + */ +COmxILPcmPortBase::~COmxILPcmPortBase() + { + DEBUG_PRINTF(_L8("COmxILPcmDecoderPort::~COmxILPcmDecoderAPB0Port")); + // nothing to do + } + +/** + * From COmxILPort. + * Note: Derived classes should call this function if implementing it themselves. + * @param aIndexArray + * @return + */ +OMX_ERRORTYPE COmxILPcmPortBase::GetLocalOmxParamIndexes(RArray& aIndexArray) const + { + DEBUG_PRINTF(_L8("COmxILPcmDecoderPort::GetLocalOmxParamIndexes")); + + // Always collect param indexes from parent + OMX_ERRORTYPE omxRetValue = COmxILAudioPort::GetLocalOmxParamIndexes(aIndexArray); + if (OMX_ErrorNone != omxRetValue) + { + return omxRetValue; + } + + TInt err = aIndexArray.InsertInOrder(OMX_IndexParamAudioPcm); + if (KErrNone != err && KErrAlreadyExists != err) // Note that index duplication is OK. + { + return OMX_ErrorInsufficientResources; + } + + return OMX_ErrorNone; + } + +/** + * From COmxILPort. + * Note: Derived classes should call this function if implementing it themselves. + * @param aIndexArray + * @return + */ +OMX_ERRORTYPE COmxILPcmPortBase::GetLocalOmxConfigIndexes(RArray& aIndexArray) const + { + DEBUG_PRINTF(_L8("OmxILPcmPortBase::GetLocalOmxConfigIndexes")); + + // Call parent + return COmxILAudioPort::GetLocalOmxConfigIndexes(aIndexArray); + } + +/** + * From COmxILPort. + * Note: Derived classes should call this function if implementing it themselves. + * @param aParamIndex + * @param apComponentParameterStructure + * @return + */ +OMX_ERRORTYPE COmxILPcmPortBase::GetParameter(OMX_INDEXTYPE aParamIndex, TAny* apComponentParameterStructure) const + { + DEBUG_PRINTF(_L8("OmxILPcmPortBase::GetParameter")); + + // We only have one parameter - OMX_IndexParamAudioPcm - pass all other requests to our parent + if (aParamIndex != OMX_IndexParamAudioPcm) + { + return COmxILAudioPort::GetParameter(aParamIndex, apComponentParameterStructure); + } + + OMX_ERRORTYPE err = TOmxILUtil::CheckOmxStructSizeAndVersion( apComponentParameterStructure, sizeof iParamAudioPcm ); + if (err==OMX_ErrorNone) + { + // export our PCM mode settings + OMX_AUDIO_PARAM_PCMMODETYPE* pcmmode = static_cast(apComponentParameterStructure); + *pcmmode = iParamAudioPcm; + } + + return err; + } + +/** + * From COmxILPort. + * Note: Derived classes should call this function if implementing it themselves. + * @param aParamIndex + * @param apComponentParameterStructure + * @param aUpdateProcessingFunction + * @return + */ +OMX_ERRORTYPE COmxILPcmPortBase::SetParameter(OMX_INDEXTYPE aParamIndex, const TAny* apComponentParameterStructure, TBool& aUpdateProcessingFunction) + { + DEBUG_PRINTF(_L8("OmxILPcmPortBase::SetParameter")); + + // We only have one parameter - OMX_IndexParamAudioPcm - pass all other requests to our parent + if (aParamIndex != OMX_IndexParamAudioPcm) + { + return COmxILAudioPort::SetParameter(aParamIndex, apComponentParameterStructure, aUpdateProcessingFunction); + } + + OMX_ERRORTYPE err = TOmxILUtil::CheckOmxStructSizeAndVersion( const_cast(apComponentParameterStructure), sizeof iParamAudioPcm ); + if (err!=OMX_ErrorNone) + { + return err; + } + + // get and sanity check the new settings + const OMX_AUDIO_PARAM_PCMMODETYPE* pcmmode = static_cast(apComponentParameterStructure); + if (!CheckPcmModeParamsAreSane(*pcmmode)) + { + return OMX_ErrorBadParameter; + } + + // preserve the new settings and update the processing function + iParamAudioPcm = *pcmmode; + aUpdateProcessingFunction = ETrue; + + return OMX_ErrorNone; + } + +/** + * From COmxILPort. + * @param aPortDefinition + * @param aUpdateProcessingFunction + * @return + */ +OMX_ERRORTYPE COmxILPcmPortBase::SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, TBool& aUpdateProcessingFunction) + { + DEBUG_PRINTF(_L8("OmxILPcmPortBase::SetFormatInPortDefinition")); + + // Currently not changing cMIMEType type of this port + // Same thing for pNativeRender and eEncoding + iParamPortDefinition.format.audio.bFlagErrorConcealment = aPortDefinition.format.audio.bFlagErrorConcealment; + + // Error concealment not currently needed at the processing function + aUpdateProcessingFunction = EFalse; + + return OMX_ErrorNone; + } + +/** + * From COmxILPort. + * @param aPortDefinition + * @return + */ +TBool COmxILPcmPortBase::IsTunnelledPortCompatible( const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const + { + DEBUG_PRINTF(_L8("OmxILPcmPortBase::IsTunnelledPortCompatible")); + + #ifdef OMXIL_PERMISSIVE_PORT_TUNNELING + + // TODO: Enable correct compatibility check + (void) aPortDefinition; + return ETrue; + + #else + + // Check the domain and encodings match + // Note: OMX_AUDIO_CodingUnused is permitted for interoperability with the test filesource and filesink components + + if(aPortDefinition.eDomain != iParamPortDefinition.eDomain + || ( aPortDefinition.format.audio.eEncoding != OMX_AUDIO_CodingUnused && aPortDefinition.format.audio.eEncoding != iParamPortDefinition.format.audio.eEncoding)) + { + return EFalse; + } + + #ifdef OMXIL_VERIFY_MIME_TYPE + // TODO: Consider removing this check completely + // check that the MIME types match + // Note: cMIMEType==NULL is permitted for interoperability with the test filesource and filesink components + if (aPortDefinition.format.audio.cMIMEType) + { + TPtrC8 tunnelMimeType( reinterpret_cast(aPortDefinition.format.audio.cMIMEType), User::StringLength(reinterpret_cast(aPortDefinition.format.audio.cMIMEType)) ); + TPtrC8 myMimeType( reinterpret_cast(iParamPortDefinition.format.audio.cMIMEType), User::StringLength(reinterpret_cast(iParamPortDefinition.format.audio.cMIMEType)) ); + + if (tunnelMimeType != myMimeType) + { + return EFalse; + } + } + #endif + + return ETrue; + + #endif + } + +/** + * Validates that parameters are valid symanticly. + * Any further checks should be called in + * @param aPcmModeType + * @return + */ +TBool COmxILPcmPortBase::CheckPcmModeParamsAreSane(const OMX_AUDIO_PARAM_PCMMODETYPE& aPcmModeType) const + { + // Verify enums are below their maximum values ( as of the v1.1.1 ) + if (!( aPcmModeType.nPortIndex == iParamAudioPcm.nPortIndex + && aPcmModeType.eNumData <= OMX_NumericalDataUnsigned + && aPcmModeType.eEndian <= OMX_EndianLittle + && (aPcmModeType.nBitPerSample == 8 + || aPcmModeType.nBitPerSample == 16) + && aPcmModeType.ePCMMode <= OMX_AUDIO_PCMModeMULaw)) + { + return EFalse; + } + + // Verify anything more specific in the derived class + if (!ValidatePcmModeParams(aPcmModeType)) + { + return EFalse; + } + + // All OK + return ETrue; + } + +/** + * Non-operational in base class @C COmxILPcmPortBase. + * + * A derived class can (though is not required to) override this function. + * Use to implement any further checking of parameters beyond that + * provided in @C CheckPcmModeParamsAreSane. + * + * Called from @C CheckPcmModeParamsAreSane. + * + * @param aPcmModeType Parameters to check + * @return Should return @C ETrue if valid, else @C EFalse. + */ +TBool COmxILPcmPortBase::ValidatePcmModeParams(const OMX_AUDIO_PARAM_PCMMODETYPE& /*aPcmModeType*/) const + { + // Perform no further validation in this class. + return ETrue; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/common/OmxILPcmPortBase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/common/OmxILPcmPortBase.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,60 @@ +/* +* 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 OMXILPCMPORTBASE_H +#define OMXILPCMPORTBASE_H +#if defined(NCP_COMMON_MM_3PA_ENABLED) || defined(SYMBIAN_MULTIMEDIA_THREEPLANEARCH) +#include +#else +#include "omxilaudioport.h" +#endif + +/** + * Base class for PCM port. + */ +class COmxILPcmPortBase : public COmxILAudioPort + { + public: + ~COmxILPcmPortBase(); + OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray& aIndexArray) const; + OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray& aIndexArray) const; + OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex, TAny* apComponentParameterStructure) const; + OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex, const TAny* apComponentParameterStructure, TBool& aUpdateProcessingFunction); + inline const OMX_AUDIO_PARAM_PCMMODETYPE& ModeType() const; + + protected: + COmxILPcmPortBase(const TOmxILCommonPortData& aCommonPortData, const OMX_AUDIO_PARAM_PCMMODETYPE& aPcmModeType); + virtual void ConstructL(const RArray& aSupportedAudioFormats); + + private: + OMX_ERRORTYPE SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, TBool& aUpdateProcessingFunction); + TBool IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const; + TBool CheckPcmModeParamsAreSane(const OMX_AUDIO_PARAM_PCMMODETYPE& aPcmModeType) const; + virtual TBool ValidatePcmModeParams(const OMX_AUDIO_PARAM_PCMMODETYPE& aPcmModeType) const; + + protected: + OMX_AUDIO_PARAM_PCMMODETYPE iParamAudioPcm; + }; + +#include "omxilpcmportbase.inl" +#endif diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/common/omxilpcmportbase.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/common/omxilpcmportbase.inl Fri May 07 16:25:23 2010 +0100 @@ -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: +* +*/ + + +/** + @file + @internalComponent +*/ + +/** + * NOT from COmxILPort. + * @return type structure + */ +const OMX_AUDIO_PARAM_PCMMODETYPE& COmxILPcmPortBase::ModeType() const + { + return iParamAudioPcm; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/pcmprocessor/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/pcmprocessor/group/bld.inf Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,22 @@ +/* +* 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: +* +*/ + + +PRJ_MMPFILES +// Components +../mmpfiles/omxilpcmprocessor.mmp + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/pcmprocessor/mmpfiles/omxilpcmprocessor.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/pcmprocessor/mmpfiles/omxilpcmprocessor.mmp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,69 @@ +/* +* 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 omxilpcmprocessor.dll +*/ + +#include "../src/omxilpcmprocessor.hrh" + +TARGET omxilpcmprocessor.dll +CAPABILITY ALL -TCB +TARGETTYPE plugin +UID 0x10009D8D KUidSymbianOmxILPcmProcessorDll +VENDORID 0x70000001 + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN + + +USERINCLUDE ../src/ +USERINCLUDE ../../common +USERINCLUDE ../../../../omxilcomponentcommon/src/common +USERINCLUDE ../../../../omxilcore/traces + + + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY omxilcomponentcommon.lib +STATICLIBRARY omxilcomponentif.lib + + +SOURCEPATH ../../common +SOURCE OmxILPcmPortBase.cpp + +SOURCEPATH ../src/ + +SOURCE omxilpcmprocessor.cpp +SOURCE omxilpcmprocessorport.cpp +SOURCE omxilpcmprocessorprocessingfunction.cpp +SOURCE omxilpcmprocessorconverters.cpp +SOURCE omxilpcmprocessorecomentrypoint.cpp +RESOURCE omxilpcmprocessor.rss + + +// Uncomment to activate debug tracing in this module +MACRO _OMXIL_COMMON_DEBUG_TRACING_ON + +// Uncomment to disable audio format checking when tunneling ports together +// This is necessary, for instance, when using the file source and sink components +// since their port information is mostly unknown. +MACRO OMXIL_PERMISSIVE_PORT_TUNNELING + + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/pcmprocessor/src/omxilpcmprocessor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/pcmprocessor/src/omxilpcmprocessor.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,257 @@ +/* +* 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 + +#if defined(NCP_COMMON_MM_3PA_ENABLED) || defined(SYMBIAN_MULTIMEDIA_THREEPLANEARCH) +#include +#include +#include +#include +#include +#include +#else +#include "log.h" +#include "omxilfsm.h" +#include "omxilcallbackmanager.h" +#include "omxilportmanager.h" +#include "omxilconfigmanager.h" +#include "omxilspecversion.h" +#endif + +#include "omxilpcmprocessor.h" + +#include "omxilpcmprocessor.hrh" +#include + +#include "omxilpcmprocessorport.h" +#include "omxilpcmprocessorprocessingfunction.h" + + + +const TUint8 COmxILPcmProcessor::iComponentVersionMajor; +const TUint8 COmxILPcmProcessor::iComponentVersionMinor; +const TUint8 COmxILPcmProcessor::iComponentVersionRevision; +const TUint8 COmxILPcmProcessor::iComponentVersionStep; + +TInt COmxILPcmProcessor::CreateComponent(OMX_HANDLETYPE aComponent, const TDesC8& aComponentName, const TDesC8& aComponentRole) + { + DEBUG_PRINTF(_L8("COmxILPcmProcessor::CreateComponent")); + + COmxILPcmProcessor* self = new COmxILPcmProcessor(); + if (!self) + { + return KErrNoMemory; + } + + TRAPD(err, self->ConstructL(aComponent, aComponentName, aComponentRole)); + if (err != KErrNone) + { + delete self; + } + + return err; + } + +void COmxILPcmProcessor::ConstructL(OMX_HANDLETYPE aComponent, const TDesC8& aComponentName, const TDesC8& aComponentRole) + { + DEBUG_PRINTF(_L8("COmxILPcmProcessor::ConstructL")); + + // STEP 1: Initialize the data received from the IL Core + ipHandle = static_cast(aComponent); + ipAppData = 0; + ipCallbacks = 0; + + // STEP 2: Create the call backs manager... + ipCallbackManager = COmxILCallbackManager::NewL(ipHandle, ipAppData, ipCallbacks); + + // STEP 3: Create the decoder-specific Processing Function... + ipProcessingFunction = COmxILPcmProcessorProcessingFunction::NewL(*ipCallbackManager); + + // STEP 4: Create Port manager... + ipPortManager = COmxILPortManager::NewL( + *ipProcessingFunction, // The component's processing function + *ipCallbackManager, // The call back manager object + iOmxILVersion, // OMX Version + 2, // The number of audio ports in this component + 0, // The starting audio port index + 0, // The number of image ports in this component + 0, // The starting image port index + 0, // The number of video ports in this component + 0, // The starting video port index + 0, // The number of other ports in this component + 0 // The starting other port index + ); + + // ... create the decoder component ports... + ConstructPortsL(); + + // .. and add them to the port manager... + // TODO: remove workaround when unnecessary - BUG IN FRAMEWORK + // Workaround: in some cases, AddPort returns KErrGeneral in OOM cases. In order to get OOM tests for this component to run + // successfully, leave with OOM if KErrGeneral is returned. + TInt err = ipPortManager->AddPort(ipb0Port, OMX_DirInput); + if (!err) + { + err = ipPortManager->AddPort(ipb1Port, OMX_DirOutput); + } + + if (err==KErrGeneral) + { + err= KErrNoMemory; + } + User::LeaveIfError(err); + + // STEP 5: Create the non-port related configuration manager... + RPointerArray componentRoles; + CleanupClosePushL(componentRoles); + User::LeaveIfError(componentRoles.Append(&aComponentRole)); + + ipConfigManager = COmxILConfigManager::NewL( + *ipPortManager, + aComponentName, + TOmxILVersion(iComponentVersionMajor, + iComponentVersionMinor, + iComponentVersionRevision, + iComponentVersionStep), + componentRoles); + + CleanupStack::Pop(); // componentRoles + componentRoles.Close(); // Must not destroy pointers + + // STEP 6: Create the FSM object... + ipFsm = COmxILFsm::NewL(*this, + *ipProcessingFunction, + *ipPortManager, + *ipConfigManager, + *ipCallbackManager); + + // And finally, let's get everything started + InitComponentL(); + } + +COmxILPcmProcessor::COmxILPcmProcessor() + : iOmxILVersion(TOmxILSpecVersion()) + { + DEBUG_PRINTF(_L8("COmxILPcmProcessor::COmxILPcmProcessor")); + } + +COmxILPcmProcessor::~COmxILPcmProcessor() + { + DEBUG_PRINTF(_L8("COmxILPcmProcessor::~COmxILPcmProcessor")); + + delete ipProcessingFunction; + delete ipPortManager; + delete ipb0Port; + delete ipb1Port; + delete ipConfigManager; + delete ipFsm; + delete ipCallbackManager; + } + + +void COmxILPcmProcessor::ConstructPortsL() + { + DEBUG_PRINTF(_L8("COmxILPcmProcessor::ConstructPortsL")); + + + // profile and port data for input port at index 0 + OMX_AUDIO_PARAM_PCMMODETYPE profile = + { + sizeof profile, /**< Size of this structure, in Bytes */ + iOmxILVersion, /**< OMX specification version information */ + 0, /* !!! changed for port 1 */ + /**< port that this structure applies to */ + 2, /**< Number of channels (e.g. 2 for stereo) */ + OMX_NumericalDataSigned, /**< indicates PCM data as signed or unsigned */ + OMX_EndianLittle, /**< indicates PCM data as little or big endian */ + OMX_TRUE, /**< True for normal interleaved data; false for + non-interleaved data (e.g. block data) */ + 16, /**< Bit per sample */ + 48000, /**< Sampling rate of the source data. Use 0 for + variable or unknown sampling rate. */ + OMX_AUDIO_PCMModeLinear, /**< PCM mode enumeration */ + + { OMX_AUDIO_ChannelLF, OMX_AUDIO_ChannelRF } // all other entries will be 0 due to aggregate initialisation rules (C++98, 8.5.1 clause 7) + }; + + TOmxILCommonPortData port0data( + iOmxILVersion, // OMX specification version information + 0, // Port number the structure applies to + OMX_DirInput, // Direction of this port + 1, // The minimum number of buffers this port requires + 2048, // Minimum size, in bytes, for buffers to be used for this port + OMX_PortDomainAudio, // Domain of the port + OMX_FALSE, // Buffers contiguous requirement (true or false) + 0, // Buffer aligment requirements + OMX_BufferSupplyUnspecified, // supplier preference when tunneling between two ports + 1 // This is the index of the compoent's port that will + // propagate buffer marks received in this port + ); + + + // create the supported format list for port 0 + RArray supportedAudioFormats0; + CleanupClosePushL(supportedAudioFormats0); + supportedAudioFormats0.AppendL(OMX_AUDIO_CodingPCM); + + // create port 0 + ipb0Port = COmxILPcmProcessorPort::NewL( + port0data, + supportedAudioFormats0, + profile + ); + + CleanupStack::PopAndDestroy(&supportedAudioFormats0); + + // update the profile and port data for + TOmxILCommonPortData port1data( + iOmxILVersion, // OMX specification version information + 1, // Port number the structure applies to + OMX_DirOutput, // Direction of this port + 1, // The minimum number of buffers this port requires + 2048, // Minimum size, in bytes, for buffers to be used for this port + OMX_PortDomainAudio, // Domain of the port + OMX_FALSE, // Buffers contiguous requirement (true or false) + 0, // Buffer aligment requirements + OMX_BufferSupplyUnspecified, // supplier preference when tunneling between two ports + // This component is not a source component so there's no need + // propagate buffer marks received on output ports + COmxILPort:: KBufferMarkPropagationPortNotNeeded + ); + + // create the supported format list for port 1 + RArray supportedAudioFormats1; + CleanupClosePushL(supportedAudioFormats1); + supportedAudioFormats1.AppendL(OMX_AUDIO_CodingPCM); + + // adjust profile and create port 1 + profile.nPortIndex = 1; + ipb1Port = COmxILPcmProcessorPort::NewL( + port1data, + supportedAudioFormats1, + profile + ); + + CleanupStack::PopAndDestroy(&supportedAudioFormats1); + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/pcmprocessor/src/omxilpcmprocessor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/pcmprocessor/src/omxilpcmprocessor.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,61 @@ +/* +* 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 OMXILPCMPROCESSOR_H +#define OMXILPCMPROCESSOR_H +#if defined(NCP_COMMON_MM_3PA_ENABLED) || defined(SYMBIAN_MULTIMEDIA_THREEPLANEARCH) +#include +#else +#include "omxilcomponent.h" +#endif + +class COmxILPcmProcessorPort; + + +NONSHARABLE_CLASS(COmxILPcmProcessor) : public COmxILComponent + { +public: + static const TUint8 iComponentVersionMajor = 1; + static const TUint8 iComponentVersionMinor = 0; + static const TUint8 iComponentVersionRevision = 0; + static const TUint8 iComponentVersionStep = 0; + +public: + + static TInt CreateComponent(OMX_HANDLETYPE aComponent, const TDesC8& aComponentName, const TDesC8& aComponentRole); + ~COmxILPcmProcessor(); + +private: + + COmxILPcmProcessor(); + void ConstructL(OMX_HANDLETYPE aComponent, const TDesC8& aComponentName, const TDesC8& aComponentRole); + void ConstructPortsL(); + +private: + + const OMX_VERSIONTYPE iOmxILVersion; + COmxILPcmProcessorPort* ipb0Port; + COmxILPcmProcessorPort* ipb1Port; + }; + +#endif diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/pcmprocessor/src/omxilpcmprocessor.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/pcmprocessor/src/omxilpcmprocessor.hrh Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,28 @@ +/* +* 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 OMXILPCMDECODER_HRH_ +#define OMXILPCMDECODER_HRH_ + +// TODO: assign proper UIDs +#define KUidSymbianOmxILPcmProcessorDll 0x10287086 +#define KUidSymbianOmxILPcmDecoder 0x10287087 +#define KUidSymbianOmxILPcmEncoder 0x10287088 + +#endif /*OMXILPCMDECODER_HRH_*/ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/pcmprocessor/src/omxilpcmprocessor.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/pcmprocessor/src/omxilpcmprocessor.rss Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,64 @@ +/* +* 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 +#include +#include "omxilpcmprocessor.hrh" + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = KUidSymbianOmxILPcmProcessorDll; + interfaces = + { + INTERFACE_INFO + { + interface_uid = KUidOmxILSymbianComponentIf; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KUidSymbianOmxILPcmDecoder; + version_no = 1; + display_name = "OMX.SYMBIAN.AUDIO.DECODER.PCM"; + default_data = "audio_decoder.pcm"; + opaque_data = ""; + } + }; + }, + INTERFACE_INFO + { + interface_uid = KUidOmxILSymbianComponentIf; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KUidSymbianOmxILPcmEncoder; + version_no = 1; + display_name = "OMX.SYMBIAN.AUDIO.ENCODER.PCM"; + default_data = "audio_encoder.pcm"; + opaque_data = ""; + } + }; + } + }; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/pcmprocessor/src/omxilpcmprocessorconverters.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/pcmprocessor/src/omxilpcmprocessorconverters.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,488 @@ +/* +* 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 +#include "omxilpcmprocessorconverters.h" + +// +// PCM encoding conversion functions +// + +namespace NOmxILPcmProcessorConverters +{ + + const TInt KMaskSign16bit = 0x8000; + const TInt KMaskSign8bit = 0x80; + const TInt KAndMask8bit = 0xff; + + // PCM converter for cases where no conversion is necessary + void PCMConverterNoConversion(const TAny* aIn, TUint aInLength, TAny* aOut, TUint aOutLength, TUint& aInConsumed, TUint& aOutUsed) + { + TUint maxcopy = Min(aInLength, aOutLength); + Mem::Copy(aOut, aIn, maxcopy); + + aInConsumed = aOutUsed = maxcopy; + } + + + // Convert from unsigned 8 to signed 16. This conversion is regardless of endianness! + void PCMConverterU8toS16(const TAny* aIn, TUint aInLength, TAny* aOut, TUint aOutLength, TUint& aInConsumed, TUint& aOutUsed) + { + const TUint8* src = static_cast(aIn); + TUint8* dest = static_cast(aOut); + + // samples is the number of input samples. Each input byte produces 2 output bytes. + TUint samples = Min(aInLength, aOutLength/2); + + aInConsumed = samples; + aOutUsed = samples*2; + + while (samples--) + { + *dest++ = STATIC_CAST( TUint8, *src^KMaskSign8bit ); + *dest++ = STATIC_CAST( TUint8, *src++^KMaskSign8bit ); + } + } + + // Convert from unsigned 16 LE to signed 16 LE + void PCMConverterU16LEtoS16LE(const TAny* aIn, TUint aInLength, TAny* aOut, TUint aOutLength, TUint& aInConsumed, TUint& aOutUsed) + { + const TUint8* src = static_cast(aIn); + TInt8* dest = static_cast(aOut); + + // samples is the number of input or output samples. Each input byte produces 1 output byte. + TUint samples = Min(aInLength/2, aOutLength/2); + aInConsumed = aOutUsed = samples*2; + + TInt s16; + while (samples--) + { + s16 = (src[0]+(src[1]<<8))-KMaskSign16bit; + *dest++ = STATIC_CAST( TInt8, s16&KAndMask8bit); + *dest++ = STATIC_CAST( TInt8, (s16>>8)&KAndMask8bit); + src+=2; + } + } + + // Convert from Signed 16bit LE to Unsigned 8bit + void PCMConverterS16LEtoU8(const TAny* aIn, TUint aInLength, TAny* aOut, TUint aOutLength, TUint& aInConsumed, TUint& aOutUsed) + { + const TUint8* src = static_cast(aIn); + TUint8* dest = static_cast(aOut); + + // samples is the number of output samples. Each 2 input bytes produces 1 output byte. + TUint samples = Min(aInLength/2, aOutLength); + + aInConsumed = samples*2; + aOutUsed = samples; + + while (samples--) + { + src++; + *dest++ = STATIC_CAST( TUint8, (*src++) - KMaskSign8bit); + } + } + + // Convert from Unsigned 16 BE to Signed 16 LE + void PCMConverterU16BEtoS16LE(const TAny* aIn, TUint aInLength, TAny* aOut, TUint aOutLength, TUint& aInConsumed, TUint& aOutUsed) + { + const TUint8* src = static_cast(aIn); + TInt8* dest = static_cast(aOut); + + // samples is the number of input or output samples. Each input byte produces 1 output byte. + TUint samples = Min(aInLength/2, aOutLength/2); + aInConsumed = aOutUsed = samples*2; + + TInt s16; + while (samples--) + { + s16 = ((src[0]<<8)+src[1])-KMaskSign16bit; + *dest++ = STATIC_CAST( TInt8, s16&KAndMask8bit); + *dest++ = STATIC_CAST( TInt8, (s16>>8)&KAndMask8bit); + src+=2; + } + } + + // Convert from Signed 16 LE to Signed 8 bit + void PCMConverterS16LEtoS8(const TAny* aIn, TUint aInLength, TAny* aOut, TUint aOutLength, TUint& aInConsumed, TUint& aOutUsed) + { + const TUint8* src = static_cast(aIn); + TInt8* dest = static_cast(aOut); + + // samples is the number of output samples. Each 2 input bytes produces 1 output byte. + TUint samples = Min(aInLength/2, aOutLength); + + aInConsumed = samples*2; + aOutUsed = samples; + + while (samples--) + { + *dest++ = STATIC_CAST( TInt8, (src[0]+(src[1]<<8))>>8); + src += 2; + } + } + + // Convert from Signed 8bit to Signed 16bit LE + void PCMConverterS8toS16LE(const TAny* aIn, TUint aInLength, TAny* aOut, TUint aOutLength, TUint& aInConsumed, TUint& aOutUsed) + { + const TInt8* src = static_cast(aIn); + TUint8* dest = static_cast(aOut); + + // samples is the number of input samples. Each input byte produces 2 output bytes. + TUint samples = Min(aInLength, aOutLength/2); + + aInConsumed = samples; + aOutUsed = samples*2; + + TInt16 s16; + while (samples--) + { + s16 = static_cast((*src++)<<8); + *dest++ = STATIC_CAST( TUint8, s16&KAndMask8bit); + *dest++ = STATIC_CAST( TUint8, (s16>>8)&KAndMask8bit); + } + } + + // Convert from Signed 16bit LE to Unsigned 16bit LE + void PCMConverterS16LEtoU16LE(const TAny* aIn, TUint aInLength, TAny* aOut, TUint aOutLength, TUint& aInConsumed, TUint& aOutUsed) + { + const TUint8* src = static_cast(aIn); + TInt8* dest = static_cast(aOut); + + // samples is the number of input or output samples. Each input byte produces 1 output byte. + TUint samples = Min(aInLength/2, aOutLength/2); + aInConsumed = aOutUsed = samples*2; + + TInt s16; + while (samples--) + { + s16 = ((src[1]<<8)+src[0])-KMaskSign16bit; + *dest++ = STATIC_CAST( TInt8, s16&KAndMask8bit); + *dest++ = STATIC_CAST( TInt8, (s16>>8)&KAndMask8bit); + src += 2; + } + } + + // Convert from Signed 16bit LE to Unsigned 16bit BE + void PCMConverterS16LEtoU16BE(const TAny* aIn, TUint aInLength, TAny* aOut, TUint aOutLength, TUint& aInConsumed, TUint& aOutUsed) + { + const TUint8* src = static_cast(aIn); + TInt8* dest = static_cast(aOut); + + // samples is the number of input or output samples. Each input byte produces 1 output byte. + TUint samples = Min(aInLength/2, aOutLength/2); + aInConsumed = aOutUsed = samples*2; + + TInt s16; + while (samples--) + { + s16 = ((src[1]<<8)+src[0])+KMaskSign16bit; + *dest++ = STATIC_CAST( TInt8, (s16>>8)&KAndMask8bit); + *dest++ = STATIC_CAST( TInt8, s16&KAndMask8bit); + src += 2; + } + } + + // Convert from Signed 16 bit toggling endiannes (i.e. LE to BE, BE to LE) + void PCMConverterS16SwapEndianness(const TAny* aIn, TUint aInLength, TAny* aOut, TUint aOutLength, TUint& aInConsumed, TUint& aOutUsed) + { + const TUint8* src = static_cast(aIn); + TUint8* dest = static_cast(aOut); + + // samples is the number of input or output samples. Each input byte produces 1 output byte. + TUint samples = Min(aInLength/2, aOutLength/2); + aInConsumed = aOutUsed = samples*2; + + while (samples--) + { + *dest++ = src[1]; + *dest++ = src[0]; + src += 2; + } + } + + // + // ALaw conversions + // + + // unnamed namespace to make Alaw snigle sample functions private + namespace + { + TInt AlawSampleToPcm(TUint8 aAlaw) + { + const TInt KExpLutSize = 8; + const TInt KExpLut[KExpLutSize] = + { + 0, 264, 528, 1056, 2112, 4224, 8448, 16896 + }; + + TInt sign, exponent, mantissa, sample; + + aAlaw ^= 0x55; //will leave this as is, more readable + sign = ( aAlaw & KMaskSign8bit ); + aAlaw &= 0x7f; /* get magnitude */ + if (aAlaw >= 16) + { + exponent = (aAlaw >> 4 ) & 0x07; + mantissa = aAlaw & 0x0F; + sample = KExpLut[exponent] + ( mantissa << ( exponent + 3 ) ); + } + else + sample = (aAlaw << 4) + 8; + + if ( sign == 0 ) + { + sample = -sample; + } + + return sample; + } + + TUint8 PcmSampleToAlaw(TInt aPcm) + { + const TInt KMda16PcmToAlawClip = 31744; + + //[ conversion look up table pcm16 to alaw ] + const TInt KExpLutSize = 128; + const TInt8 KExpLut[KExpLutSize] = + { + 1,1,2,2,3,3,3,3, + 4,4,4,4,4,4,4,4, + 5,5,5,5,5,5,5,5, + 5,5,5,5,5,5,5,5, + 6,6,6,6,6,6,6,6, + 6,6,6,6,6,6,6,6, + 6,6,6,6,6,6,6,6, + 6,6,6,6,6,6,6,6, + 7,7,7,7,7,7,7,7, + 7,7,7,7,7,7,7,7, + 7,7,7,7,7,7,7,7, + 7,7,7,7,7,7,7,7, + 7,7,7,7,7,7,7,7, + 7,7,7,7,7,7,7,7, + 7,7,7,7,7,7,7,7, + 7,7,7,7,7,7,7,7 + }; + + TInt sign; + TInt exponent; + TInt mantissa; + TUint8 alawbyte; + + sign = ((~aPcm) >> 8) & KMaskSign8bit; + if (sign == 0) + { + aPcm = -aPcm; + } + if (aPcm > KMda16PcmToAlawClip) + { + aPcm = KMda16PcmToAlawClip; + } + + if (aPcm >= 256) + { + exponent = KExpLut[( aPcm >> 8 ) & 0x7F]; + mantissa = ( aPcm >> ( exponent + 3 ) ) & 0x0F; + alawbyte = STATIC_CAST( TUint8, (( exponent << 4 ) | mantissa)); + } + else + { + alawbyte = STATIC_CAST( TUint8, aPcm >> 4); + } + + alawbyte ^= (sign ^ 0x55); + + return alawbyte; + } + } + + + + // Convert from 8 bit ALaw to Signed 16 LE + void PCMConverterALawtoS16LE(const TAny* aIn, TUint aInLength, TAny* aOut, TUint aOutLength, TUint& aInConsumed, TUint& aOutUsed) + { + const TUint8* src = static_cast(aIn); + TUint8* dest = static_cast(aOut); + + // samples is the number of input samples. Each input byte produces 2 output bytes. + TUint samples = Min(aInLength, aOutLength/2); + + aInConsumed = samples; + aOutUsed = samples*2; + + TInt pcm; + while (samples--) + { + pcm = AlawSampleToPcm(*src++); + *dest++ = STATIC_CAST( TUint8, pcm&KAndMask8bit); + *dest++ = STATIC_CAST( TUint8, pcm>>8); + } + } + + // Convert from Signed 16 LE to 8 bit ALaw + void PCMConverterS16LEtoALaw(const TAny* aIn, TUint aInLength, TAny* aOut, TUint aOutLength, TUint& aInConsumed, TUint& aOutUsed) + { + TUint8* dest = static_cast(aOut); + TInt16* src = (TInt16*)aIn; + + // samples is the number of output samples. Each 2 input bytes produces 1 output byte. + TUint samples = Min(aInLength/2, aOutLength); + + aInConsumed = samples*2; + aOutUsed = samples; + + while (samples--) + { + *dest++ = PcmSampleToAlaw(*src++); + } + } + + + + // + // MuLaw conversions + // + + namespace + { + + TInt MulawSampleToPcm(TUint8 aMulaw) + { + const TInt KExpLutSize = 8; + const TInt KExpLut[KExpLutSize] = + { + 0, 132, 396, 924, 1980, 4092, 8316, 16764 + }; + + TInt sign, exponent, mantissa, sample; + + aMulaw = STATIC_CAST( TUint8, ~aMulaw); + sign = ( aMulaw & KMaskSign8bit ); + exponent = ( aMulaw >> 4 ) & 0x07; + mantissa = aMulaw & 0x0F; + sample = KExpLut[exponent] + ( mantissa << ( exponent + 3 ) ); + if ( sign != 0 ) + sample = -sample; + + return sample; + } + + + + TUint8 PcmSampleToMuLaw(TInt aPcm) + { + const TInt KMda16PcmToMulawClip = 32635; + const TInt KMda16PcmToMulawBias = 0x84; + + //[ conversion look up table pcm16 to Mulaw ] + const TInt KExpLutSize = 256; + const TInt8 KExpLut[KExpLutSize] = + { + 0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3, + 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, + 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, + 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, + 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, + 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, + 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, + 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, + 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, + 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, + 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, + 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, + 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, + 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, + 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, + 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7 + }; + + TInt sign, exponent, mantissa; + TUint8 ulawbyte; + + sign = (aPcm >> 8) & KMaskSign8bit; + if ( sign != 0 ) + { + aPcm = STATIC_CAST( TUint16,-aPcm); + } + if ( STATIC_CAST(TUint , aPcm) > STATIC_CAST(TUint , KMda16PcmToMulawClip )) + { + aPcm = KMda16PcmToMulawClip; + } + + aPcm = STATIC_CAST(TInt16 , aPcm + KMda16PcmToMulawBias); + exponent = KExpLut[( aPcm >> 7 ) & KAndMask8bit]; + mantissa = ( aPcm >> ( exponent + 3 ) ) & 0x0F; + ulawbyte = STATIC_CAST( TUint8, ~ ( sign | ( exponent << 4 ) | mantissa )); + + return ulawbyte; + } + + } + + + // Convert from 8 bit MuLaw to Signed 16 LE + void PCMConverterMuLawtoS16LE(const TAny* aIn, TUint aInLength, TAny* aOut, TUint aOutLength, TUint& aInConsumed, TUint& aOutUsed) + { + const TUint8* src = static_cast(aIn); + TUint8* dest = static_cast(aOut); + + // samples is the number of input samples. Each input byte produces 2 output bytes. + TUint samples = Min(aInLength, aOutLength/2); + + aInConsumed = samples; + aOutUsed = samples*2; + + TInt pcm; + while (samples--) + { + pcm = MulawSampleToPcm(*src++); + *dest++ = STATIC_CAST( TUint8, pcm&KAndMask8bit); + *dest++ = STATIC_CAST( TUint8, pcm>>8); + } + } + + + // Convert from Signed 16 LE to 8 bit MuLaw + void PCMConverterS16LEtoMuLaw(const TAny* aIn, TUint aInLength, TAny* aOut, TUint aOutLength, TUint& aInConsumed, TUint& aOutUsed) + { + const TUint8* src = static_cast(aIn); + TUint8* dest = static_cast(aOut); + + // samples is the number of output samples. Each 2 input bytes produces 1 output byte. + TUint samples = Min(aInLength/2, aOutLength); + + aInConsumed = samples*2; + aOutUsed = samples; + + TInt pcm; + while (samples--) + { + pcm = (src[0]+(src[1]<<8)); + *dest++ = PcmSampleToMuLaw(STATIC_CAST(TInt16 , pcm)); + src+=2; + } + } + + + +} diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/pcmprocessor/src/omxilpcmprocessorconverters.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/pcmprocessor/src/omxilpcmprocessorconverters.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,60 @@ +/* +* 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 OMXILPCMPROCESSORCONVERTERS_H_ +#define OMXILPCMPROCESSORCONVERTERS_H_ + + +namespace NOmxILPcmProcessorConverters + { + + // All functions have the common prototype: + // + // void function(const TAny* aIn, TUint aInLength, TAny* aOut, TUint aOutLength, + // TUint& aInConsumed, TUint& aOutUsed ); + // + // where aIn and aOut are the input and output buffers + // aInLength is the length in bytes of the input buffer data + // aOutLength is the maximum length in bytes of the output data buffer + // and on return + // aInConsumed is the number of bytes from the input buffer consumed + // aOutUsed is the number of bytes from the output buffer used + + void PCMConverterNoConversion(const TAny* aIn, TUint aInLength, TAny* aOut, TUint aOutLength, TUint& aInConsumed, TUint& aOutUsed); + void PCMConverterU8toS16(const TAny* aIn, TUint aInLength, TAny* aOut, TUint aOutLength, TUint& aInConsumed, TUint& aOutUsed); + void PCMConverterU16LEtoS16LE(const TAny* aIn, TUint aInLength, TAny* aOut, TUint aOutLength, TUint& aInConsumed, TUint& aOutUsed); + void PCMConverterS16LEtoU8(const TAny* aIn, TUint aInLength, TAny* aOut, TUint aOutLength, TUint& aInConsumed, TUint& aOutUsed); + void PCMConverterU16BEtoS16LE(const TAny* aIn, TUint aInLength, TAny* aOut, TUint aOutLength, TUint& aInConsumed, TUint& aOutUsed); + void PCMConverterS16LEtoS8(const TAny* aIn, TUint aInLength, TAny* aOut, TUint aOutLength, TUint& aInConsumed, TUint& aOutUsed); + void PCMConverterS8toS16LE(const TAny* aIn, TUint aInLength, TAny* aOut, TUint aOutLength, TUint& aInConsumed, TUint& aOutUsed); + void PCMConverterS16LEtoU16LE(const TAny* aIn, TUint aInLength, TAny* aOut, TUint aOutLength, TUint& aInConsumed, TUint& aOutUsed); + void PCMConverterS16LEtoU16BE(const TAny* aIn, TUint aInLength, TAny* aOut, TUint aOutLength, TUint& aInConsumed, TUint& aOutUsed); + void PCMConverterS16SwapEndianness(const TAny* aIn, TUint aInLength, TAny* aOut, TUint aOutLength, TUint& aInConsumed, TUint& aOutUsed); + void PCMConverterALawtoS16LE(const TAny* aIn, TUint aInLength, TAny* aOut, TUint aOutLength, TUint& aInConsumed, TUint& aOutUsed); + void PCMConverterS16LEtoALaw(const TAny* aIn, TUint aInLength, TAny* aOut, TUint aOutLength, TUint& aInConsumed, TUint& aOutUsed); + void PCMConverterMuLawtoS16LE(const TAny* aIn, TUint aInLength, TAny* aOut, TUint aOutLength, TUint& aInConsumed, TUint& aOutUsed); + void PCMConverterS16LEtoMuLaw(const TAny* aIn, TUint aInLength, TAny* aOut, TUint aOutLength, TUint& aInConsumed, TUint& aOutUsed); + } + +#include "omxilpcmprocessorconverters.inl" +#endif diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/pcmprocessor/src/omxilpcmprocessorconverters.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/pcmprocessor/src/omxilpcmprocessorconverters.inl Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,33 @@ +/* +* 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 +*/ + +namespace +{ + // local definition of Min + // this is to avoid ambiguous overload issues with the templated Min definitions in e32cmn.h + inline TUint Min(TUint left, TUint right) + { + return left < right ? left : right; + } + +} diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/pcmprocessor/src/omxilpcmprocessorecomentrypoint.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/pcmprocessor/src/omxilpcmprocessorecomentrypoint.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,148 @@ +/* +* 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 +#include + +#include + +#include "omxilpcmprocessor.h" +#include "omxilpcmprocessor.hrh" + + +_LIT8(KSymbianOmxILPcmDecoderName, "OMX.SYMBIAN.AUDIO.DECODER.PCM"); +_LIT8(KSymbianOmxILPcmDecoderRole, "audio_decoder.pcm"); + +_LIT8(KSymbianOmxILPcmEncoderName, "OMX.SYMBIAN.AUDIO.ENCODER.PCM"); +_LIT8(KSymbianOmxILPcmEncoderRole, "audio_encoder.pcm"); + + + +// +// This component doesn't use the OMXIL_COMPONENT_ECOM_ENTRYPOINT. +// The macro isn't used because it restricts the ECOM plugin DLL to only implementing a single named component. +// This plugin is intended to act the same whether it's used as if it were a "pcm decoder" or a "pcm encoder" and +// implements two interfaces so that it can be used as either of those roles. +// + + + + + + + + + +// This is a clone of the non-sharable COmxILSymbianComponentIf that allows parameterisation of component name and role +class COmxILPcmTranscoderComponentIf : public COmxILComponentIf + { +public: + static COmxILPcmTranscoderComponentIf* NewL(const TDesC8& aComponentName, const TDesC8& aComponentRole) + { + COmxILPcmTranscoderComponentIf* self = new (ELeave) COmxILPcmTranscoderComponentIf; + CleanupStack::PushL(self); + self->ConstructL(aComponentName, aComponentRole); + CleanupStack::Pop(self); + return self; + } + + ~COmxILPcmTranscoderComponentIf() + { + delete ipHandle; + } + + // from COmxILComponentIf + OMX_HANDLETYPE Handle() + { + return ipHandle; + } + +private: + COmxILPcmTranscoderComponentIf() + { + } + + + void ConstructL(const TDesC8& aComponentName, const TDesC8& aComponentRole) + { + ipHandle = new(ELeave) OMX_COMPONENTTYPE; + User::LeaveIfError(COmxILPcmProcessor::CreateComponent(ipHandle, aComponentName, aComponentRole)); + } + +private: + OMX_COMPONENTTYPE* ipHandle; + }; + + +#if 0 + +// Disabled. Since this isn't exported, and the + +// Component Entry Point +OMX_ERRORTYPE OMX_ComponentInit(OMX_HANDLETYPE aComponent) + { + TInt err = COmxILPcmProcessor::CreateComponent(aComponent, KSymbianOmxILPcmDecoderName, KSymbianOmxILPcmDecoderRole ); + + // This method should be called as a result of a OMX_GetHandle call. Let's + // return something that is consistent with the return codes allowed for + // that API call. + + switch(err) + { + case KErrNone: + return OMX_ErrorNone; + case KErrNoMemory: + return OMX_ErrorInsufficientResources; + case KErrArgument: + return OMX_ErrorBadParameter; + }; + + return OMX_ErrorUndefined; + } + +#endif + +COmxILComponentIf* ConstructPcmDecoderL() + { + return COmxILPcmTranscoderComponentIf::NewL(KSymbianOmxILPcmDecoderName, KSymbianOmxILPcmDecoderRole); + } + +COmxILComponentIf* ConstructPcmEncoderL() + { + return COmxILPcmTranscoderComponentIf::NewL(KSymbianOmxILPcmEncoderName, KSymbianOmxILPcmEncoderRole); + } + + +const TImplementationProxy ImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY(KUidSymbianOmxILPcmDecoder, ConstructPcmDecoderL), + IMPLEMENTATION_PROXY_ENTRY(KUidSymbianOmxILPcmEncoder, ConstructPcmEncoderL) + }; + +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) + { + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + return ImplementationTable; + } + + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/pcmprocessor/src/omxilpcmprocessorport.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/pcmprocessor/src/omxilpcmprocessorport.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,78 @@ +/* +* 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 + +#include "omxilpcmprocessorport.h" +#if defined(NCP_COMMON_MM_3PA_ENABLED) || defined(SYMBIAN_MULTIMEDIA_THREEPLANEARCH) +#include +#include +#else +#include "log.h" +#include "omxilutil.h" +#endif + + +/** + * Constructor. + * @return Newly created COmxILPcmProcessorPort. + */ +COmxILPcmProcessorPort* COmxILPcmProcessorPort::NewL(const TOmxILCommonPortData& aCommonPortData, const RArray& aSupportedAudioFormats, const OMX_AUDIO_PARAM_PCMMODETYPE& aPcmModeType) + { + DEBUG_PRINTF(_L8("COmxILPcmProcessorPort::NewL")); + + COmxILPcmProcessorPort* self = new(ELeave)COmxILPcmProcessorPort(aCommonPortData, aPcmModeType); + + CleanupStack::PushL(self); + self->ConstructL(aSupportedAudioFormats); + CleanupStack::Pop(); + + return self; + } + + +COmxILPcmProcessorPort::COmxILPcmProcessorPort(const TOmxILCommonPortData& aCommonPortData, const OMX_AUDIO_PARAM_PCMMODETYPE& aPcmModeType) + : COmxILPcmPortBase(aCommonPortData, aPcmModeType) + { + DEBUG_PRINTF(_L8("COmxILPcmProcessorPort::NewL")); + + // No action + } + +/** + * Second stage constructor. + * See @C NewL for details. + */ +void COmxILPcmProcessorPort::ConstructL(const RArray& aSupportedAudioFormats) + { + DEBUG_PRINTF(_L8("COmxILPcmProcessorPort::ConstructL")); + + // Call base class + COmxILPcmPortBase::ConstructL(aSupportedAudioFormats); + } + +COmxILPcmProcessorPort::~COmxILPcmProcessorPort() + { + + // No action + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/pcmprocessor/src/omxilpcmprocessorport.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/pcmprocessor/src/omxilpcmprocessorport.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,41 @@ +/* +* 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 OMXILPCMPROCESSORPORT_H +#define OMXILPCMPROCESSORPORT_H + +#include "OmxILPcmPortBase.h" + +class COmxILPcmProcessorPort : public COmxILPcmPortBase + { + public: + static COmxILPcmProcessorPort* NewL(const TOmxILCommonPortData& aCommonPortData, const RArray& aSupportedAudioFormats, const OMX_AUDIO_PARAM_PCMMODETYPE& aPcmModeType); + ~COmxILPcmProcessorPort(); + + private: + COmxILPcmProcessorPort(const TOmxILCommonPortData& aCommonPortData, const OMX_AUDIO_PARAM_PCMMODETYPE& aPcmModeType); + void ConstructL(const RArray& aSupportedAudioFormats); + }; + + +#endif diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/pcmprocessor/src/omxilpcmprocessorprocessingfunction.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/pcmprocessor/src/omxilpcmprocessorprocessingfunction.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,751 @@ +/* +* 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 +*/ +#if defined(NCP_COMMON_MM_3PA_ENABLED) || defined(SYMBIAN_MULTIMEDIA_THREEPLANEARCH) +#include +#include +#else +#include "log.h" +#include "omxilcallbacknotificationif.h" +#endif + +#include "omxilpcmprocessorprocessingfunction.h" +#include "omxilpcmprocessorconverters.h" + + +#include "omxilpcmprocessor.h" +#include + +// Will install itself in the constructing threads ActiveScheduler. +COmxILPcmProcessorProcessingFunction::COmxILPcmProcessorProcessingFunctionCore* COmxILPcmProcessorProcessingFunction::COmxILPcmProcessorProcessingFunctionCore::NewL(MOmxILPcmProcessorProcessingFunctionCoreContext& aContext) + { + DEBUG_PRINTF(_L8("COmxILPcmProcessorProcessingFunctionCore::NewL")); + + + COmxILPcmProcessorProcessingFunctionCore* self = new(ELeave)COmxILPcmProcessorProcessingFunctionCore(aContext); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +COmxILPcmProcessorProcessingFunction::COmxILPcmProcessorProcessingFunctionCore::COmxILPcmProcessorProcessingFunctionCore(MOmxILPcmProcessorProcessingFunctionCoreContext& aContext) + : CAsyncOneShot(EPriorityUserInput), iContext(aContext) + { + DEBUG_PRINTF(_L8("COmxILPcmProcessorProcessingFunctionCore::COmxILPcmProcessorProcessingFunctionCore")); + } + +void COmxILPcmProcessorProcessingFunction::COmxILPcmProcessorProcessingFunctionCore::ConstructL() + { + DEBUG_PRINTF(_L8("COmxILPcmProcessorProcessingFunctionCore::ConstructL")); + User::LeaveIfError(iLock.CreateLocal()); + } + + +COmxILPcmProcessorProcessingFunction::COmxILPcmProcessorProcessingFunctionCore::~COmxILPcmProcessorProcessingFunctionCore() + { + DEBUG_PRINTF(_L8("COmxILPcmProcessorProcessingFunctionCore::~COmxILPcmProcessorProcessingFunctionCore")); + Cancel(); + iLock.Close(); + } + +// Set the input and output encodings. Returns KErrNone on success, or KErrNotSupported if the conversion isn't supported +// May be done by any thread but only while the core is inactive +TInt COmxILPcmProcessorProcessingFunction::COmxILPcmProcessorProcessingFunctionCore::SetEncodings(const TPcmEncodingType& aInputEncoding, const TPcmEncodingType& aOutputEncoding) + { + DEBUG_PRINTF(_L8("COmxILPcmProcessorProcessingFunctionCore::SetEncodings")); + + // select the conversion function based on the input and output encodings + // this uses the unique hash values for the encodings + + TUint32 inputhash = aInputEncoding.Hash(); + TUint32 outputhash = aOutputEncoding.Hash(); + + // if our input and output are the same, then no conversion is necessary + if (inputhash==outputhash) + { + iConverter = &NOmxILPcmProcessorConverters::PCMConverterNoConversion; + } + else + { + TUint32 combinedhash = TPcmEncodingType::PcmPairHash( inputhash, outputhash ); + + if (combinedhash == TPcmEncodingType::PcmPairHash(TPcmEncodingType::PcmEncodingHash(TPcmEncodingType::EPcmEncodingLinear, TPcmEncodingType::EPcmWidth8bit, TPcmEncodingType::EPcmUnsigned), TPcmEncodingType::PcmEncodingHash(TPcmEncodingType::EPcmEncodingLinear, TPcmEncodingType::EPcmWidth16bitLE, TPcmEncodingType::EPcmSigned)) + || combinedhash == TPcmEncodingType::PcmPairHash(TPcmEncodingType::PcmEncodingHash(TPcmEncodingType::EPcmEncodingLinear, TPcmEncodingType::EPcmWidth8bit, TPcmEncodingType::EPcmUnsigned), TPcmEncodingType::PcmEncodingHash(TPcmEncodingType::EPcmEncodingLinear, TPcmEncodingType::EPcmWidth16bitBE, TPcmEncodingType::EPcmSigned))) + { + iConverter = &NOmxILPcmProcessorConverters::PCMConverterU8toS16; + } + + else if (combinedhash == TPcmEncodingType::PcmPairHash(TPcmEncodingType::PcmEncodingHash(TPcmEncodingType::EPcmEncodingLinear, TPcmEncodingType::EPcmWidth16bitLE, TPcmEncodingType::EPcmUnsigned), TPcmEncodingType::PcmEncodingHash(TPcmEncodingType::EPcmEncodingLinear, TPcmEncodingType::EPcmWidth16bitLE, TPcmEncodingType::EPcmSigned))) + { + iConverter = &NOmxILPcmProcessorConverters::PCMConverterU16LEtoS16LE; + } + + else if (combinedhash == TPcmEncodingType::PcmPairHash(TPcmEncodingType::PcmEncodingHash(TPcmEncodingType::EPcmEncodingLinear, TPcmEncodingType::EPcmWidth16bitLE, TPcmEncodingType::EPcmSigned), TPcmEncodingType::PcmEncodingHash(TPcmEncodingType::EPcmEncodingLinear, TPcmEncodingType::EPcmWidth8bit, TPcmEncodingType::EPcmUnsigned))) + { + iConverter = &NOmxILPcmProcessorConverters::PCMConverterS16LEtoU8; + } + + else if (combinedhash == TPcmEncodingType::PcmPairHash(TPcmEncodingType::PcmEncodingHash(TPcmEncodingType::EPcmEncodingLinear, TPcmEncodingType::EPcmWidth16bitBE, TPcmEncodingType::EPcmUnsigned), TPcmEncodingType::PcmEncodingHash(TPcmEncodingType::EPcmEncodingLinear, TPcmEncodingType::EPcmWidth16bitLE, TPcmEncodingType::EPcmSigned))) + { + iConverter = &NOmxILPcmProcessorConverters::PCMConverterU16BEtoS16LE; + } + + else if (combinedhash == TPcmEncodingType::PcmPairHash(TPcmEncodingType::PcmEncodingHash(TPcmEncodingType::EPcmEncodingLinear, TPcmEncodingType::EPcmWidth16bitLE, TPcmEncodingType::EPcmSigned), TPcmEncodingType::PcmEncodingHash(TPcmEncodingType::EPcmEncodingLinear, TPcmEncodingType::EPcmWidth8bit, TPcmEncodingType::EPcmSigned))) + { + iConverter = &NOmxILPcmProcessorConverters::PCMConverterS16LEtoS8; + } + + else if (combinedhash == TPcmEncodingType::PcmPairHash(TPcmEncodingType::PcmEncodingHash(TPcmEncodingType::EPcmEncodingLinear, TPcmEncodingType::EPcmWidth8bit, TPcmEncodingType::EPcmSigned), TPcmEncodingType::PcmEncodingHash(TPcmEncodingType::EPcmEncodingLinear, TPcmEncodingType::EPcmWidth16bitLE, TPcmEncodingType::EPcmSigned))) + { + iConverter = &NOmxILPcmProcessorConverters::PCMConverterS8toS16LE; + } + + else if (combinedhash == TPcmEncodingType::PcmPairHash(TPcmEncodingType::PcmEncodingHash(TPcmEncodingType::EPcmEncodingLinear, TPcmEncodingType::EPcmWidth16bitLE, TPcmEncodingType::EPcmSigned), TPcmEncodingType::PcmEncodingHash(TPcmEncodingType::EPcmEncodingLinear, TPcmEncodingType::EPcmWidth16bitLE, TPcmEncodingType::EPcmUnsigned))) + { + iConverter = &NOmxILPcmProcessorConverters::PCMConverterS16LEtoU16LE; + } + + else if (combinedhash == TPcmEncodingType::PcmPairHash(TPcmEncodingType::PcmEncodingHash(TPcmEncodingType::EPcmEncodingLinear, TPcmEncodingType::EPcmWidth16bitLE, TPcmEncodingType::EPcmSigned), TPcmEncodingType::PcmEncodingHash(TPcmEncodingType::EPcmEncodingLinear, TPcmEncodingType::EPcmWidth16bitBE, TPcmEncodingType::EPcmUnsigned))) + { + iConverter = &NOmxILPcmProcessorConverters::PCMConverterS16LEtoU16BE; + } + + else if (combinedhash == TPcmEncodingType::PcmPairHash(TPcmEncodingType::PcmEncodingHash(TPcmEncodingType::EPcmEncodingLinear, TPcmEncodingType::EPcmWidth16bitLE, TPcmEncodingType::EPcmSigned), TPcmEncodingType::PcmEncodingHash(TPcmEncodingType::EPcmEncodingLinear, TPcmEncodingType::EPcmWidth16bitBE, TPcmEncodingType::EPcmSigned)) + || combinedhash == TPcmEncodingType::PcmPairHash(TPcmEncodingType::PcmEncodingHash(TPcmEncodingType::EPcmEncodingLinear, TPcmEncodingType::EPcmWidth16bitBE, TPcmEncodingType::EPcmSigned), TPcmEncodingType::PcmEncodingHash(TPcmEncodingType::EPcmEncodingLinear, TPcmEncodingType::EPcmWidth16bitLE, TPcmEncodingType::EPcmSigned)) + || combinedhash == TPcmEncodingType::PcmPairHash(TPcmEncodingType::PcmEncodingHash(TPcmEncodingType::EPcmEncodingLinear, TPcmEncodingType::EPcmWidth16bitLE, TPcmEncodingType::EPcmUnsigned), TPcmEncodingType::PcmEncodingHash(TPcmEncodingType::EPcmEncodingLinear, TPcmEncodingType::EPcmWidth16bitBE, TPcmEncodingType::EPcmUnsigned)) + || combinedhash == TPcmEncodingType::PcmPairHash(TPcmEncodingType::PcmEncodingHash(TPcmEncodingType::EPcmEncodingLinear, TPcmEncodingType::EPcmWidth16bitBE, TPcmEncodingType::EPcmUnsigned), TPcmEncodingType::PcmEncodingHash(TPcmEncodingType::EPcmEncodingLinear, TPcmEncodingType::EPcmWidth16bitLE, TPcmEncodingType::EPcmUnsigned))) + { + iConverter = &NOmxILPcmProcessorConverters::PCMConverterS16SwapEndianness; + } + + else if (combinedhash == TPcmEncodingType::PcmPairHash(TPcmEncodingType::PcmEncodingHash(TPcmEncodingType::EPcmEncodingALaw, TPcmEncodingType::EPcmWidth8bit, TPcmEncodingType::EPcmUnsigned), TPcmEncodingType::PcmEncodingHash(TPcmEncodingType::EPcmEncodingLinear, TPcmEncodingType::EPcmWidth16bitLE, TPcmEncodingType::EPcmSigned)) + || combinedhash == TPcmEncodingType::PcmPairHash(TPcmEncodingType::PcmEncodingHash(TPcmEncodingType::EPcmEncodingALaw, TPcmEncodingType::EPcmWidth8bit, TPcmEncodingType::EPcmSigned), TPcmEncodingType::PcmEncodingHash(TPcmEncodingType::EPcmEncodingLinear, TPcmEncodingType::EPcmWidth16bitLE, TPcmEncodingType::EPcmSigned))) + { + iConverter = &NOmxILPcmProcessorConverters::PCMConverterALawtoS16LE; + } + + else if (combinedhash == TPcmEncodingType::PcmPairHash(TPcmEncodingType::PcmEncodingHash(TPcmEncodingType::EPcmEncodingLinear, TPcmEncodingType::EPcmWidth16bitLE, TPcmEncodingType::EPcmSigned), TPcmEncodingType::PcmEncodingHash(TPcmEncodingType::EPcmEncodingALaw, TPcmEncodingType::EPcmWidth8bit, TPcmEncodingType::EPcmUnsigned)) + || combinedhash == TPcmEncodingType::PcmPairHash(TPcmEncodingType::PcmEncodingHash(TPcmEncodingType::EPcmEncodingLinear, TPcmEncodingType::EPcmWidth16bitLE, TPcmEncodingType::EPcmSigned), TPcmEncodingType::PcmEncodingHash(TPcmEncodingType::EPcmEncodingALaw, TPcmEncodingType::EPcmWidth8bit, TPcmEncodingType::EPcmSigned))) + { + iConverter = &NOmxILPcmProcessorConverters::PCMConverterS16LEtoALaw; + } + + else if (combinedhash == TPcmEncodingType::PcmPairHash(TPcmEncodingType::PcmEncodingHash(TPcmEncodingType::EPcmEncodingMuLaw, TPcmEncodingType::EPcmWidth8bit, TPcmEncodingType::EPcmUnsigned), TPcmEncodingType::PcmEncodingHash(TPcmEncodingType::EPcmEncodingLinear, TPcmEncodingType::EPcmWidth16bitLE, TPcmEncodingType::EPcmSigned)) + || combinedhash == TPcmEncodingType::PcmPairHash(TPcmEncodingType::PcmEncodingHash(TPcmEncodingType::EPcmEncodingMuLaw, TPcmEncodingType::EPcmWidth8bit, TPcmEncodingType::EPcmSigned), TPcmEncodingType::PcmEncodingHash(TPcmEncodingType::EPcmEncodingLinear, TPcmEncodingType::EPcmWidth16bitLE, TPcmEncodingType::EPcmSigned))) + { + iConverter = &NOmxILPcmProcessorConverters::PCMConverterMuLawtoS16LE; + } + + else if (combinedhash == TPcmEncodingType::PcmPairHash(TPcmEncodingType::PcmEncodingHash(TPcmEncodingType::EPcmEncodingLinear, TPcmEncodingType::EPcmWidth16bitLE, TPcmEncodingType::EPcmSigned), TPcmEncodingType::PcmEncodingHash(TPcmEncodingType::EPcmEncodingMuLaw, TPcmEncodingType::EPcmWidth8bit, TPcmEncodingType::EPcmUnsigned)) + || combinedhash == TPcmEncodingType::PcmPairHash(TPcmEncodingType::PcmEncodingHash(TPcmEncodingType::EPcmEncodingLinear, TPcmEncodingType::EPcmWidth16bitLE, TPcmEncodingType::EPcmSigned), TPcmEncodingType::PcmEncodingHash(TPcmEncodingType::EPcmEncodingMuLaw, TPcmEncodingType::EPcmWidth8bit, TPcmEncodingType::EPcmSigned))) + { + iConverter = &NOmxILPcmProcessorConverters::PCMConverterS16LEtoMuLaw; + } + else + { + return KErrNotSupported; + } + } + + return KErrNone; + } + +void COmxILPcmProcessorProcessingFunction::COmxILPcmProcessorProcessingFunctionCore::Start() + { + DEBUG_PRINTF(_L8("COmxILPcmProcessorProcessingFunctionCore::Start")); + + iLock.Wait(); + + iIsRunning = ETrue; + CompleteSelf(); + + iLock.Signal(); + } + +void COmxILPcmProcessorProcessingFunction::COmxILPcmProcessorProcessingFunctionCore::Stop() + { + DEBUG_PRINTF(_L8("COmxILPcmProcessorProcessingFunctionCore::Stop")); + + iLock.Wait(); + iIsRunning = EFalse; + iLock.Signal(); + } + +void COmxILPcmProcessorProcessingFunction::COmxILPcmProcessorProcessingFunctionCore::Reset() + { + DEBUG_PRINTF(_L8("COmxILPcmProcessorProcessingFunctionCore::Reset")); + + Stop(); + } + +TBool COmxILPcmProcessorProcessingFunction::COmxILPcmProcessorProcessingFunctionCore::IsRunning() + { + DEBUG_PRINTF(_L8("COmxILPcmProcessorProcessingFunctionCore::IsRunning")); + + iLock.Wait(); + TBool retval = iIsRunning; + iLock.Signal(); + + return retval; + } + +void COmxILPcmProcessorProcessingFunction::COmxILPcmProcessorProcessingFunctionCore::CompleteSelf() + { + DEBUG_PRINTF(_L8("COmxILPcmProcessorProcessingFunctionCore::CompleteSelf")); + + // MUST HAVE ALREADY ACQUIRED THE LOCK + if (!iSignalledToRun) + { + iSignalledToRun = ETrue; + Call(); + } + } + +void COmxILPcmProcessorProcessingFunction::COmxILPcmProcessorProcessingFunctionCore::DoCancel() + { + DEBUG_PRINTF(_L8("COmxILPcmProcessorProcessingFunctionCore::DoCancel")); + // do nothing + } + +void COmxILPcmProcessorProcessingFunction::COmxILPcmProcessorProcessingFunctionCore::RunL() + { + DEBUG_PRINTF(_L8("COmxILPcmProcessorProcessingFunctionCore::RunL")); + + iLock.Wait(); // acquire the lock. This prevents other threads from changing run-state while we're actively processing + iSignalledToRun = EFalse; + + if (iIsRunning && iStatus==KErrNone) + { + + // obtain the input or output buffers + OMX_BUFFERHEADERTYPE* inputbuffer = iContext.NextInputBuffer(); + OMX_BUFFERHEADERTYPE* outputbuffer = iContext.NextOutputBuffer(); + + // if we STILL don't have an input and an output buffer, then stop + // otherwise, process the buffers + if (!inputbuffer || !outputbuffer) + { + iIsRunning = EFalse; + } + else + { + // convert + OMX_U8* inbuf = inputbuffer->pBuffer + inputbuffer->nOffset; + TUint inlen = inputbuffer->nFilledLen; + + OMX_U8* outbuf = outputbuffer->pBuffer + outputbuffer->nFilledLen; + TUint outlen = outputbuffer->nAllocLen - outputbuffer->nFilledLen; + + // copy the timestamp from the input to the output buffer header + outputbuffer->nTimeStamp = inputbuffer->nTimeStamp; + + // we're processing our last buffer if the input buffer is EOS flagged + TBool lastBuffer = inputbuffer->nFlags & OMX_BUFFERFLAG_EOS ? ETrue : EFalse; + if ((inlen == 0 && !lastBuffer) || outlen == 0) + { + iContext.ErrorCallback(OMX_ErrorUnderflow); + iLock.Signal(); + return; + } + + TUint inconsumed = 0; + TUint outused = 0; + iConverter(inbuf, inlen, outbuf, outlen, inconsumed, outused); + ASSERT((inconsumed && outused) || lastBuffer); + + // adjust input consumed offset and remaining length + inputbuffer->nOffset += inconsumed; + inputbuffer->nFilledLen -= inconsumed; + + // adjust output used filled length + outputbuffer->nFilledLen += outused; + + TBool lastOutputBuffer = EFalse; // we may have multiple output buffers for each input. This flag will be set when we know we're done so we may propogate the EOS. + + // if the input buffer is completely consumed, release it + if (0 == inputbuffer->nFilledLen) + { + iContext.InputBufferConsumed(inputbuffer); + + // if we're done with our EOS marked input buffer, then our output buffer is the last one + lastOutputBuffer = lastBuffer; + } + + // if the output buffer is full, or it is the last one, release it + if ( lastOutputBuffer || + (outputbuffer->nFilledLen == outputbuffer->nAllocLen) + ) + { + iContext.OutputBufferFilled(outputbuffer, lastOutputBuffer); + } + + // complete ourselves to continue with the next buffer(s) if any + CompleteSelf(); + } + } + + iLock.Signal(); // release the lock - although we may be set to run, our runstate may be changed as long as we're not actually processing + } + +TInt COmxILPcmProcessorProcessingFunction::COmxILPcmProcessorProcessingFunctionCore::RunError(TInt aError) + { + // shouldn't be possible to reach here - just return the error + return aError; + } + +COmxILPcmProcessorProcessingFunction* COmxILPcmProcessorProcessingFunction::NewL(MOmxILCallbackNotificationIf& aCallbacks) + { + DEBUG_PRINTF(_L8("COmxILPcmProcessorProcessingFunction::NewL")); + + COmxILPcmProcessorProcessingFunction* self = new(ELeave)COmxILPcmProcessorProcessingFunction(aCallbacks); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + + return self; + } + +COmxILPcmProcessorProcessingFunction::COmxILPcmProcessorProcessingFunction(MOmxILCallbackNotificationIf& aCallbacks) + : COmxILProcessingFunction(aCallbacks) + { + DEBUG_PRINTF(_L8("COmxILPcmProcessorProcessingFunction::COmxILPcmProcessorProcessingFunction")); + } + +void COmxILPcmProcessorProcessingFunction::ConstructL() + { + DEBUG_PRINTF(_L8("COmxILPcmProcessorProcessingFunction::ConstructL")); + + // Default settings + OMX_VERSIONTYPE ver = TOmxILSpecVersion(); // CONSTANT + iInputMode.nSize = sizeof(OMX_AUDIO_PARAM_PCMMODETYPE); + iInputMode.nVersion = ver; + iInputMode.nPortIndex = 0; + iInputMode.nChannels = 1; + iInputMode.eNumData = OMX_NumericalDataSigned; + iInputMode.eEndian = OMX_EndianLittle; + iInputMode.bInterleaved = OMX_TRUE; + iInputMode.nBitPerSample = 16; + iInputMode.nSamplingRate = 48000; + iInputMode.ePCMMode = OMX_AUDIO_PCMModeLinear; + iInputMode.eChannelMapping[0] = OMX_AUDIO_ChannelLF; + iInputMode.eChannelMapping[1] = OMX_AUDIO_ChannelRF; + + // Same default settings for output mode, except port + iOutputMode = iInputMode; + iOutputMode.nPortIndex = 1; + + iCore = COmxILPcmProcessorProcessingFunctionCore::NewL(*this); + } + +COmxILPcmProcessorProcessingFunction::~COmxILPcmProcessorProcessingFunction() + { + DEBUG_PRINTF(_L8("COmxILPcmProcessorProcessingFunction::~COmxILPcmProcessorProcessingFunction")); + + delete iCore; + + iBuffersToEmpty.Reset(); + iBuffersToFill.Reset(); + } + + +OMX_ERRORTYPE COmxILPcmProcessorProcessingFunction::StateTransitionIndication(COmxILFsm::TStateIndex aNewState) + { + DEBUG_PRINTF(_L8("COmxILPcmProcessorProcessingFunction::StateTransitionIndication")); + + OMX_ERRORTYPE err = OMX_ErrorNone; + switch(aNewState) + { + + case COmxILFsm::EStateIdle: + { + iCore->Reset(); + + // Make sure settings have been applied + // This should never fail since the settings are defaults or + // have already been checked. + TInt symerr = CheckAndSetConversion(); + ASSERT(symerr ==KErrNone); + + } + break; + + case COmxILFsm::EStateExecuting: + iCore->Start(); + break; + + case COmxILFsm::EStateInvalid: + case COmxILFsm::EStateLoaded: + case COmxILFsm::EStateWaitForResources: + iCore->Reset(); + break; + + case COmxILFsm::EStatePause: + iCore->Stop(); + break; + + case COmxILFsm::ESubStateLoadedToIdle: + case COmxILFsm::ESubStateIdleToLoaded: + case COmxILFsm::ESubStateExecutingToIdle: + case COmxILFsm::ESubStatePauseToIdle: + // do nothing + break; + } + + iState = aNewState; + return err; + } + +OMX_ERRORTYPE COmxILPcmProcessorProcessingFunction::BufferFlushingIndication(TUint32 aPortIndex, OMX_DIRTYPE aDirection) + { + DEBUG_PRINTF(_L8("COmxILPcmProcessorProcessingFunction::BufferFlushingIndication")); + + TBool portflushed = EFalse; + + // flush the input buffers if requested + if ((aPortIndex == OMX_ALL && aDirection == OMX_DirMax) || + (aPortIndex == 0 && aDirection == OMX_DirInput)) + { + // reset the core to release any in use buffers + iCore->Reset(); + + // send notification for each input buffer + for (TInt i=0; iReset(); + + // send notification for each input buffer + for (TInt i=0; i(apComponentParameterStructure); + + // check the static settings + // settings which must match between input and output (i.e. sample rate) are checked by CheckAndSetConversion() + ASSERT ((pPcmProfile->nPortIndex == 0 || pPcmProfile->nPortIndex == 1) + && (pPcmProfile->nChannels == 1 || pPcmProfile->nChannels == 2) + && (pPcmProfile->nBitPerSample == 8 || pPcmProfile->nBitPerSample == 16) + && (pPcmProfile->eChannelMapping[0] == OMX_AUDIO_ChannelLF) + && (pPcmProfile->eChannelMapping[1] == OMX_AUDIO_ChannelRF) + ); + + // Rememeber the original settings in case we need to revert + OMX_AUDIO_PARAM_PCMMODETYPE origPortIn = iInputMode; + OMX_AUDIO_PARAM_PCMMODETYPE origPortOut = iOutputMode; + + // Preserve the settings + if (pPcmProfile->nPortIndex == 0) + { + iInputMode = *pPcmProfile; + DEBUG_PRINTF(_L8("INFO: Input port changed.")); + } + else + { + iOutputMode = *pPcmProfile; + DEBUG_PRINTF(_L8("INFO: Output port changed.")); + } + + // Apply the settings + TInt validSettings = CheckAndSetConversion(); + + // If the settings do not match modify the other port (the one that + // has not just been set) to match the current port, since the + // conversion between like and like is always valid. + if (validSettings != KErrNone) + { + if (pPcmProfile->nPortIndex == 0) + { + iOutputMode = *pPcmProfile; + DEBUG_PRINTF2(_L8("WARNING: Port mismatch (code %d), had to reconfigure output port."), validSettings); + } + else + { + iInputMode = *pPcmProfile; + DEBUG_PRINTF2(_L8("WARNING: Port mismatch (code %d), had to reconfigure input port."), validSettings); + } + + // Apply the settings again + validSettings = CheckAndSetConversion(); + + // If the settings still aren't valid restore the original + // settings and return a failiure. + if (validSettings != KErrNone) + { + DEBUG_PRINTF2(_L8("WARNING: Port changes invalid (code %d), reverting."), validSettings); + iInputMode = origPortIn; + iOutputMode = origPortOut; + return OMX_ErrorBadParameter; + } + + // Generate an event informing the user the settings have been + // changed on both ports. + iCallbacks.EventNotification(OMX_EventPortSettingsChanged, OMX_IndexParamPortDefinition, 0, NULL); + iCallbacks.EventNotification(OMX_EventPortSettingsChanged, OMX_IndexParamPortDefinition, 1, NULL); + } + else + { + DEBUG_PRINTF(_L8("INFO: Port changed successfully.")); + // Generate an event informing the user the settings have been + // changed on the requested port. + iCallbacks.EventNotification(OMX_EventPortSettingsChanged, OMX_IndexParamPortDefinition, pPcmProfile->nPortIndex, NULL); + } + } + break; + + default: + { + // Ignore + } + break; + } + + return err; + } + +OMX_ERRORTYPE COmxILPcmProcessorProcessingFunction::ConfigIndication(OMX_INDEXTYPE /*aConfigIndex*/, const TAny* /*apComponentConfigStructure*/) + { + DEBUG_PRINTF(_L8("COmxILPcmProcessorProcessingFunction::ConfigIndication")); + + // no configs are processable for this codec... just return success + return OMX_ErrorNone; + } + +OMX_ERRORTYPE COmxILPcmProcessorProcessingFunction::BufferIndication(OMX_BUFFERHEADERTYPE* apBufferHeader, OMX_DIRTYPE aDirection) + { + DEBUG_PRINTF(_L8("COmxILPcmProcessorProcessingFunction::BufferIndication")); + + // Assert valid parameters + ASSERT(apBufferHeader); + ASSERT(apBufferHeader->nOffset == 0); + ASSERT(aDirection == OMX_DirInput || aDirection == OMX_DirOutput); + + OMX_ERRORTYPE err = OMX_ErrorNone; + if (aDirection == OMX_DirInput) + { + TInt symerr = iBuffersToEmpty.Append(apBufferHeader); + if (symerr!=KErrNone) + { + err = OMX_ErrorInsufficientResources; + } + } + else if (aDirection == OMX_DirOutput) + { + // Clear the flags for output buffers. We'll set them as necessary before sending them along + apBufferHeader->nFlags=0; + TInt symerr = iBuffersToFill.Append(apBufferHeader); + if (symerr!=KErrNone) + { + err = OMX_ErrorInsufficientResources; + } + } + + // on success, and if we're in a running state, (re)start the core to process the buffers + if (err==OMX_ErrorNone && iBuffersToEmpty.Count()>0 && iBuffersToFill.Count()>0 && iState==OMX_StateExecuting) + { + iCore->Start(); + } + + return err; + } + +OMX_BOOL COmxILPcmProcessorProcessingFunction::BufferRemovalIndication(OMX_BUFFERHEADERTYPE* apBufferHeader, OMX_DIRTYPE aDirection) + { + DEBUG_PRINTF(_L8("COmxILPcmProcessorProcessingFunction::BufferRemovalIndication")); + // TODO: Check whether headerreleased is required + //OMX_BOOL headerreleased = OMX_FALSE; + + // select which buffer array to process based on direction + RPointerArray* bufarray = NULL; + if (aDirection==OMX_DirInput) + { + bufarray = &iBuffersToEmpty; + } + else if (aDirection==OMX_DirOutput) + { + bufarray = &iBuffersToFill; + } + + + // find the buffer in the array + TInt pos = bufarray->Find(apBufferHeader); + if (pos!=KErrNotFound) + { + // if this buffer is at the head of the array, and the core is active, then the core may be using it... + // in this case we want to reset the core (to stop it using the buffer), release the buffer, and then restart the core + TBool bufinuse = (pos==0 && iCore->IsRunning()); + if (bufinuse) + { + iCore->Reset(); + } + + // remove the buffer + bufarray->Remove(pos); + //headerreleased = OMX_TRUE; + + // if the core was reset, restart it + if (bufinuse) + { + iCore->Start(); + } + } + + //DEBUG_PRINTF2(_L8("COmxILPcmProcessorProcessingFunction::BufferRemovalIndication buffer removed [%d]"), (TInt)headerreleased); + //------HACK------- + //return headerreleased; + return OMX_TRUE; + //----------------- + } + +TInt COmxILPcmProcessorProcessingFunction::CheckAndSetConversion() + { + DEBUG_PRINTF(_L8("COmxILPcmProcessorProcessingFunction::CheckAndSetConversion")); + + // Assert ports are incompatible + if ((iInputMode.nSamplingRate != iOutputMode.nSamplingRate) + || (iInputMode.nChannels != iOutputMode.nChannels) + || (iInputMode.bInterleaved != iOutputMode.bInterleaved)) + { + return KErrNotSupported; + } + + // create TPcmEncodingType objects for input and output and set the conversion to use on the core + TInt err = KErrNone; + TPcmEncodingType in; + TPcmEncodingType out; + + if (!err) + { + err = in.SetFromPcmMode(iInputMode.ePCMMode, iInputMode.nBitPerSample, iInputMode.eEndian, iInputMode.eNumData); + } + if (!err) + { + err = out.SetFromPcmMode(iOutputMode.ePCMMode, iOutputMode.nBitPerSample, iOutputMode.eEndian, iOutputMode.eNumData); + } + + if (!err) + { + err = iCore->SetEncodings(in, out); + } + + return err; + } + +OMX_BUFFERHEADERTYPE* COmxILPcmProcessorProcessingFunction::NextInputBuffer() + { + DEBUG_PRINTF(_L8("COmxILPcmProcessorProcessingFunction::NextInputBuffer")); + + if (iBuffersToEmpty.Count()>0) return iBuffersToEmpty[0]; + else return NULL; + } + +OMX_BUFFERHEADERTYPE* COmxILPcmProcessorProcessingFunction::NextOutputBuffer() + { + DEBUG_PRINTF(_L8("COmxILPcmProcessorProcessingFunction::NextOutputBuffer")); + + if (iBuffersToFill.Count()>0) return iBuffersToFill[0]; + else return NULL; + } + +void COmxILPcmProcessorProcessingFunction::InputBufferConsumed(OMX_BUFFERHEADERTYPE* aBuffer) + { + DEBUG_PRINTF(_L8("COmxILPcmProcessorProcessingFunction::InputBufferConsumed")); + + ASSERT(iBuffersToEmpty.Count()>0); + ASSERT(iBuffersToEmpty[0]==aBuffer); + + iBuffersToEmpty.Remove(0); + // Reset the offset back to 0, it was used for marking the read position in the processing loop + aBuffer->nOffset = 0; + iCallbacks.BufferDoneNotification(aBuffer, 0, OMX_DirInput); + } + +void COmxILPcmProcessorProcessingFunction::OutputBufferFilled(OMX_BUFFERHEADERTYPE* aBuffer, TBool aMarkWithEos) + { + DEBUG_PRINTF(_L8("COmxILPcmProcessorProcessingFunction::OutputBufferFilled")); + + ASSERT(iBuffersToFill.Count()>0); + ASSERT(iBuffersToFill[0]==aBuffer); + + iBuffersToFill.Remove(0); + + if (aMarkWithEos) + { + // Propagate the EOS flag + aBuffer->nFlags |= OMX_BUFFERFLAG_EOS; + } + + iCallbacks.BufferDoneNotification(aBuffer, 1, OMX_DirOutput); + + if (aMarkWithEos) + { + OMX_U32 flags = aBuffer->nFlags; + iCallbacks.EventNotification( + OMX_EventBufferFlag, + 1, + flags, + 0); + } + } + +void COmxILPcmProcessorProcessingFunction::ErrorCallback(OMX_ERRORTYPE aOmxError) + { + iCallbacks.ErrorEventNotification(aOmxError); + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/pcmprocessor/src/omxilpcmprocessorprocessingfunction.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/pcmprocessor/src/omxilpcmprocessorprocessingfunction.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,193 @@ +/* +* 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 OMXILPCMDECODERPROCESSINGFUNCTION_H +#define OMXILPCMDECODERPROCESSINGFUNCTION_H + +#include +#include +#if defined(NCP_COMMON_MM_3PA_ENABLED) || defined(SYMBIAN_MULTIMEDIA_THREEPLANEARCH) +#include +#else +#include "omxilprocessingfunction.h" +#endif + +class COmxILPcmProcessorProcessingFunctionCore; + +class MOmxILPcmProcessorProcessingFunctionCoreContext + { + public: + // provide the core with the next input buffer to process, or NULL if there are no more + virtual OMX_BUFFERHEADERTYPE* NextInputBuffer() = 0; + + // provide the core with the next output buffer to fill, or NULL if there are no more + virtual OMX_BUFFERHEADERTYPE* NextOutputBuffer() = 0; + + // callback from core when an input buffer has been consumed + virtual void InputBufferConsumed(OMX_BUFFERHEADERTYPE* aBuffer) = 0; + + // callback from core when an output buffer has been filled + virtual void OutputBufferFilled(OMX_BUFFERHEADERTYPE* aBuffer, TBool aMarkWithEos) = 0; + + // callback from core on processing error + virtual void ErrorCallback(OMX_ERRORTYPE aOmxError) = 0; + }; + +class COmxILPcmProcessorProcessingFunction : public COmxILProcessingFunction, private MOmxILPcmProcessorProcessingFunctionCoreContext + { + private: + class TPcmEncodingType + { + public: + enum TEncoding + { + EPcmEncodingLinear = 0, + EPcmEncodingMuLaw, + EPcmEncodingALaw, + EPcmEncodingMax + }; + + enum TWidthAndEndianness + { + EPcmWidth8bit = 0, + EPcmWidth16bitLE, // only for linear encodings + EPcmWidth16bitBE, // only for linear encodings + EPcmWidthMax + }; + + enum TSignedness + { + EPcmSigned = 0, // only meaningful for linear encodings + EPcmUnsigned, // only meaningful or linear encodings + EPcmSignednessMax + }; + + public: + inline TPcmEncodingType(); + inline TPcmEncodingType(TEncoding aEncoding, TWidthAndEndianness aWidth, TSignedness aSignedness); + inline TInt SetFromPcmMode(OMX_AUDIO_PCMMODETYPE aPCMMode, OMX_U32 aBitsPerSample, OMX_ENDIANTYPE aEndian, OMX_NUMERICALDATATYPE aSigned); + inline TUint32 Hash() const; + + public: + // Produces a unique value for any valid PCM encoding + // This is an arithmetic hash + template + inline static TUint PcmEncodingHash(T1 aEncoding, T2 aWidth, T3 aSignedness) + { + return + static_cast(aEncoding) + + static_cast(TPcmEncodingType::EPcmEncodingMax) + * ( static_cast(aWidth) + + static_cast(TPcmEncodingType::EPcmWidthMax) + * static_cast(aSignedness) ); + } + + inline static TUint PcmMaxHash(); + inline static TUint PcmPairHash(TUint aLeft, TUint aRight); + + public: + TEncoding iEncoding; + TWidthAndEndianness iWidth; + TSignedness iSignedness; + }; + + class COmxILPcmProcessorProcessingFunctionCore : public CAsyncOneShot + { + public: + // MUST be done from the same thread: + + static COmxILPcmProcessorProcessingFunctionCore* NewL(MOmxILPcmProcessorProcessingFunctionCoreContext& aContext); + ~COmxILPcmProcessorProcessingFunctionCore(); + + + TInt SetEncodings(const TPcmEncodingType& aInputEncoding, const TPcmEncodingType& aOutputEncoding); + + // May be called from any thread: + void Start(); + void Stop(); + void Reset(); + + TBool IsRunning(); + + private: + COmxILPcmProcessorProcessingFunctionCore(MOmxILPcmProcessorProcessingFunctionCoreContext& aContext); + void ConstructL(); + + void CompleteSelf(); + + // from CActive / CAsyncOneShot + void DoCancel(); + void RunL(); + TInt RunError(TInt aError); + + // make some CActive public methods private since they're unsafe to use from different threads + using CActive::Cancel; + using CActive::IsActive; + + private: + RMutex iLock; // mutex to allow starting and stopping safely from differing threads + TBool iIsRunning; // mutex protected - MUST ACQUIRE LOCK BEFORE USE + TBool iSignalledToRun; // mutex protected - MUST ACQUIRE LOCK BEFORE USE + MOmxILPcmProcessorProcessingFunctionCoreContext& iContext; + void (*iConverter)(const TAny* aIn, TUint aInLength, TAny* aOut, TUint aOutLength, TUint& aInConsumed, TUint& aOutUsed ); + }; + + public: + static COmxILPcmProcessorProcessingFunction* NewL(MOmxILCallbackNotificationIf& aCallbacks); + ~COmxILPcmProcessorProcessingFunction(); + + // from COmxILProcessingFunction + OMX_ERRORTYPE StateTransitionIndication(COmxILFsm::TStateIndex aNewState); + OMX_ERRORTYPE BufferFlushingIndication(TUint32 aPortIndex, OMX_DIRTYPE aDirection); + OMX_ERRORTYPE ParamIndication(OMX_INDEXTYPE aParamIndex, const TAny* apComponentParameterStructure); + OMX_ERRORTYPE ConfigIndication(OMX_INDEXTYPE aConfigIndex, const TAny* apComponentConfigStructure); + OMX_ERRORTYPE BufferIndication(OMX_BUFFERHEADERTYPE* apBufferHeader, OMX_DIRTYPE aDirection); + OMX_BOOL BufferRemovalIndication(OMX_BUFFERHEADERTYPE* apBufferHeader, OMX_DIRTYPE aDirection); + + private: + COmxILPcmProcessorProcessingFunction(MOmxILCallbackNotificationIf& aCallbacks); + void ConstructL(); + + TBool CheckAndSetConversion(); + + // from MOmxILPcmProcessorProcessingFunctionCoreContext + OMX_BUFFERHEADERTYPE* NextInputBuffer(); + OMX_BUFFERHEADERTYPE* NextOutputBuffer(); + void InputBufferConsumed(OMX_BUFFERHEADERTYPE* aBuffer); + void OutputBufferFilled(OMX_BUFFERHEADERTYPE* aBuffer, TBool aMarkWithEos); + void ErrorCallback(OMX_ERRORTYPE aOmxError); + + + private: + COmxILFsm::TStateIndex iState; + COmxILPcmProcessorProcessingFunctionCore* iCore; + + OMX_AUDIO_PARAM_PCMMODETYPE iInputMode; + OMX_AUDIO_PARAM_PCMMODETYPE iOutputMode; + + RPointerArray iBuffersToEmpty; + RPointerArray iBuffersToFill; + }; + +#include "omxilpcmprocessorprocessingfunction.inl" +#endif diff -r c1e808730d6c -r eedf2dcd43c6 omxil/audio/mcar_symbian_il_components/pcmprocessor/src/omxilpcmprocessorprocessingfunction.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/audio/mcar_symbian_il_components/pcmprocessor/src/omxilpcmprocessorprocessingfunction.inl Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,119 @@ +/* +* 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 +*/ + +COmxILPcmProcessorProcessingFunction::TPcmEncodingType::TPcmEncodingType() : iEncoding(EPcmEncodingLinear), iWidth(EPcmWidth16bitLE), iSignedness(EPcmSigned) + { + } + +COmxILPcmProcessorProcessingFunction::TPcmEncodingType::TPcmEncodingType(TEncoding aEncoding, TWidthAndEndianness aWidth, TSignedness aSignedness) + : iEncoding(aEncoding), iWidth(aWidth), iSignedness(aSignedness) + { + } + +TInt COmxILPcmProcessorProcessingFunction::TPcmEncodingType::SetFromPcmMode(OMX_AUDIO_PCMMODETYPE aPCMMode, OMX_U32 aBitsPerSample, OMX_ENDIANTYPE aEndian, OMX_NUMERICALDATATYPE aSigned) + { + TInt err = KErrNone; + + // set the encoding type + if (aPCMMode == OMX_AUDIO_PCMModeLinear) + { + iEncoding = EPcmEncodingLinear; + } + else if (aPCMMode == OMX_AUDIO_PCMModeMULaw) + { + iEncoding = EPcmEncodingMuLaw; + } + else if (aPCMMode == OMX_AUDIO_PCMModeALaw) + { + iEncoding = EPcmEncodingALaw; + } + else + { + err = KErrNotSupported; + } + + // if this is alaw or mulaw encoded PCM, set the width + if (aPCMMode == OMX_AUDIO_PCMModeALaw || aPCMMode == OMX_AUDIO_PCMModeMULaw ) + { + if (aBitsPerSample==8) + { + iWidth = EPcmWidth8bit; + } + else + { + err = KErrNotSupported; + } + } + + // if this is linear encoded PCM, set width and endianness + if ( aPCMMode == OMX_AUDIO_PCMModeLinear ) + { + if (aBitsPerSample == 8) + { + iWidth = EPcmWidth8bit; + } + else if (aBitsPerSample==16 && aEndian==OMX_EndianBig) + { + iWidth = EPcmWidth16bitBE; + } + else if (aBitsPerSample==16 && aEndian==OMX_EndianLittle) + { + iWidth = EPcmWidth16bitLE; + } + else + { + err = KErrNotSupported; + } + } + + // set the signedness + if (iEncoding==EPcmEncodingLinear) + { + iSignedness = (aSigned == OMX_NumericalDataSigned ? EPcmSigned : EPcmUnsigned ); + } + else + { + iSignedness = EPcmSigned; + } + + return err; + } + +TUint32 COmxILPcmProcessorProcessingFunction::TPcmEncodingType::Hash() const + { + return TPcmEncodingType::PcmEncodingHash(iEncoding, iWidth, iSignedness); + } + +// The maximum value of a PCM encoding hash value +TUint COmxILPcmProcessorProcessingFunction::TPcmEncodingType::PcmMaxHash() + { + return static_cast(TPcmEncodingType::EPcmEncodingMax) + * static_cast(TPcmEncodingType::EPcmWidthMax) + * static_cast(TPcmEncodingType::EPcmSignednessMax); + } + +// Combines two valid PCM encoding hash values into a single value +TUint COmxILPcmProcessorProcessingFunction::TPcmEncodingType::PcmPairHash(TUint aLeft, TUint aRight ) + { + return aLeft + (TPcmEncodingType::PcmMaxHash() * aRight); + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/group/bld.inf Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,2 @@ +#include "../omxilfilesink/group/bld.inf" +#include "../omxilfilesource/group/bld.inf" diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesink/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesink/group/bld.inf Fri May 07 16:25:23 2010 +0100 @@ -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: +// + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +omxilotherfilesink.iby /epoc32/rom/include/omxilotherfilesink.iby +omxilaudiofilesink.iby /epoc32/rom/include/omxilaudiofilesink.iby +omxilvideofilesink.iby /epoc32/rom/include/omxilvideofilesink.iby +omxilimagefilesink.iby /epoc32/rom/include/omxilimagefilesink.iby + +PRJ_MMPFILES +../mmpfiles/omxilotherfilesink.mmp +../mmpfiles/omxilaudiofilesink.mmp +../mmpfiles/omxilvideofilesink.mmp +../mmpfiles/omxilimagefilesink.mmp diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesink/group/omxilaudiofilesink.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesink/group/omxilaudiofilesink.iby Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef OMXILAUDIOFILESINK_IBY_ +#define OMXILAUDIOFILESINK_IBY_ + +#include + +ECOM_PLUGIN(omxilaudiofilesink.dll, omxilaudiofilesink.rsc) + +#endif /*OMXILAUDIOFILESINK_IBY_*/ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesink/group/omxilimagefilesink.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesink/group/omxilimagefilesink.iby Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef OMXILIMAGEFILESINK_IBY_ +#define OMXILIMAGEFILESINK_IBY_ + +#include + +ECOM_PLUGIN(omxilimagefilesink.dll, omxilimagefilesink.rsc) + +#endif /*OMXILIMAGEFILESINK_IBY_*/ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesink/group/omxilotherfilesink.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesink/group/omxilotherfilesink.iby Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef OMXILFILESINK_IBY_ +#define OMXILFILESINK_IBY_ + +#include + +ECOM_PLUGIN(omxilfilesink.dll, omxilfilesink.rsc) + +#endif /*OMXILFILESINK_IBY_*/ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesink/group/omxilvideofilesink.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesink/group/omxilvideofilesink.iby Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef OMXILVIDEOFILESINK_IBY_ +#define OMXILVIDEOFILESINK_IBY_ + +#include + +ECOM_PLUGIN(omxilvideofilesink.dll, omxilvideofilesink.rsc) + +#endif /*OMXILVIDEOFILESINK_IBY_*/ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesink/inc/omxilaudiofilesinkopb0port.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesink/inc/omxilaudiofilesinkopb0port.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,59 @@ +// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + + + +/** + * @file + * @internalTechnology + */ + +#ifndef OMXILAUDIOFILESINKOPB0PORT_H +#define OMXILAUDIOFILESINKOPB0PORT_H + +#include "omxilaudioport.h" +#include "omxilfilesinkprocessingfunction.h" +#include + +class COmxILAudioFileSinkOPB0Port : public COmxILAudioPort + { +public: + static COmxILAudioFileSinkOPB0Port* NewL(const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedAudioFormats, + const COmxILFileSinkProcessingFunction& aFileSinkPF); + ~COmxILAudioFileSinkOPB0Port(); + + OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray& aIndexArray) const; + OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray& aIndexArray) const; + + OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex, + TAny* apComponentParameterStructure) const; + OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex, + const TAny* apComponentParameterStructure, + TBool& aUpdateProcessingFunction); + +private: + COmxILAudioFileSinkOPB0Port(const TOmxILCommonPortData& aCommonPortData, + const COmxILFileSinkProcessingFunction& aFileSinkPF); + void ConstructL(const RArray& aSupportedAudioFormats); + OMX_ERRORTYPE SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, + TBool& aUpdateProcessingFunction); + TBool IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const; + +private: + const COmxILFileSinkProcessingFunction& iFileSinkPF; + }; + +#endif // OMXILAUDIOFILESINKOPB0PORT_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesink/inc/omxilfilesink.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesink/inc/omxilfilesink.h Fri May 07 16:25:23 2010 +0100 @@ -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 + * @internalTechnology + */ + +#ifndef OMXILFILESINK_H +#define OMXILFILESINK_H + +#include "omxilcomponent.h" + +class COmxILPort; +class COmxILFileSinkProcessingFunction; + +NONSHARABLE_CLASS(COmxILFileSink) : public COmxILComponent + { +public: + static void CreateComponentL(OMX_HANDLETYPE aComponent); + ~COmxILFileSink(); + +private: + COmxILFileSink(); + void ConstructL(OMX_HANDLETYPE aComponent); + COmxILPort* ConstructOPB0PortL() const; + +private: + COmxILPort* iOPB0Port; + COmxILFileSinkProcessingFunction* ipProcessingFunction; + }; + +#endif // OMXILFILESINK_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesink/inc/omxilfilesink.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesink/inc/omxilfilesink.hrh Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,39 @@ +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + + + +#ifndef OMXILFILESINK_HRH_ +#define OMXILFILESINK_HRH_ + + +#define KUidNokiaOmxILAudioFileSinkDll 0x2002EAA4 +#define KUidNokiaOmxILAudioFileSink 0x2002EAA5 + + +#define KUidNokiaOmxILVideoFileSinkDll 0x2002EAA6 +#define KUidNokiaOmxILVideoFileSink 0x2002EAA7 + + +#define KUidNokiaOmxILImageFileSinkDll 0x2002EAA8 +#define KUidNokiaOmxILImageFileSink 0x2002EAA9 + + +#define KUidSymbianOmxIOtherLFileSinkDll 0x10285C92 +#define KUidSymbianOmxILOtherFileSink 0x10285C93 + + + +#endif /*OMXILFILESINK_HRH_*/ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesink/inc/omxilfilesinkconfigmanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesink/inc/omxilfilesinkconfigmanager.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,53 @@ +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + + + +/** + * @file + * @internalTechnology + */ + +#ifndef OMXILFILESINKCONFIGMANAGER_H +#define OMXILFILESINKCONFIGMANAGER_H + +#include "omxilconfigmanager.h" + +class COmxILFileSinkProcessingFunction; + +NONSHARABLE_CLASS(COmxILFileSinkConfigManager) : public COmxILConfigManager + { +public: + static COmxILFileSinkConfigManager* NewL( + MOmxILPortManagerIf& aPortManager, + const TDesC8& aComponentName, + const OMX_VERSIONTYPE& aComponentVersion, + const RPointerArray& aComponentRoleList, + COmxILFileSinkProcessingFunction& aFileSinkPF); + + ~COmxILFileSinkConfigManager(); + + OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex, TAny* apComponentParameterStructure) const; + OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex, const TAny* apComponentParameterStructure, OMX_BOOL aInitTime = OMX_TRUE); + +private: + COmxILFileSinkConfigManager(MOmxILPortManagerIf& aPortManager, COmxILFileSinkProcessingFunction& aFileSinkPF); + void ConstructL(const TDesC8& aComponentName, const OMX_VERSIONTYPE& aComponentVersion, const RPointerArray& aComponentRoleList); + +private: + COmxILFileSinkProcessingFunction& iFileSinkPF; + }; + +#endif // OMXILFILESINKCONFIGMANAGER_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesink/inc/omxilfilesinkopb0port.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesink/inc/omxilfilesinkopb0port.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,59 @@ +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + + + +/** + * @file + * @internalTechnology + */ + +#ifndef OMXILFILESINKOPB0PORT_H +#define OMXILFILESINKOPB0PORT_H + +#include "omxilotherport.h" +#include "omxilfilesinkprocessingfunction.h" +#include + +class COmxILOtherFileSinkOPB0Port : public COmxILOtherPort + { +public: + static COmxILOtherFileSinkOPB0Port* NewL(const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedOtherFormats, + const COmxILFileSinkProcessingFunction& aFileSinkPF); + ~COmxILOtherFileSinkOPB0Port(); + + OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray& aIndexArray) const; + OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray& aIndexArray) const; + + OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex, + TAny* apComponentParameterStructure) const; + OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex, + const TAny* apComponentParameterStructure, + TBool& aUpdateProcessingFunction); + +private: + COmxILOtherFileSinkOPB0Port(const TOmxILCommonPortData& aCommonPortData, + const COmxILFileSinkProcessingFunction& aFileSinkPF); + void ConstructL(const RArray& aSupportedOtherFormats); + OMX_ERRORTYPE SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, + TBool& aUpdateProcessingFunction); + TBool IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const; + +private: + const COmxILFileSinkProcessingFunction& iFileSinkPF; + }; + +#endif // OMXILFILESINKOPB0PORT_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesink/inc/omxilfilesinkprocessingfunction.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesink/inc/omxilfilesinkprocessingfunction.h Fri May 07 16:25:23 2010 +0100 @@ -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: +// + + + +/** + * @file + * @internalTechnology + */ + +#ifndef OMXILFILESINKPROCESSINGFUNCTION_H +#define OMXILFILESINKPROCESSINGFUNCTION_H + +#include "omxilprocessingfunction.h" +#include +#include +#include + +class COmxILFileSinkProcessingFunction : public COmxILProcessingFunction + { +public: + static COmxILFileSinkProcessingFunction* NewL(MOmxILCallbackNotificationIf& aCallbacks); + ~COmxILFileSinkProcessingFunction(); + + OMX_ERRORTYPE StateTransitionIndication(COmxILFsm::TStateIndex aNewState); + OMX_ERRORTYPE BufferFlushingIndication(TUint32 aPortIndex, OMX_DIRTYPE aDirection); + OMX_ERRORTYPE ParamIndication(OMX_INDEXTYPE aParamIndex, const TAny* apComponentParameterStructure); + OMX_ERRORTYPE ConfigIndication(OMX_INDEXTYPE aConfigIndex, const TAny* apComponentConfigStructure); + OMX_ERRORTYPE BufferIndication(OMX_BUFFERHEADERTYPE* apBufferHeader, OMX_DIRTYPE aDirection); + OMX_BOOL BufferRemovalIndication(OMX_BUFFERHEADERTYPE* apBufferHeader, OMX_DIRTYPE aDirection); + + MOmxILCallbackNotificationIf& GetCallbacks(); + + /** can return NULL if parameter has not been set. */ + const HBufC* FileName() const; + const HBufC8* Uri() const; + +private: + COmxILFileSinkProcessingFunction(MOmxILCallbackNotificationIf& aCallbacks); + void ConstructL(); + + void InitFileAndUriL(); + OMX_ERRORTYPE SetFileName(const OMX_PARAM_CONTENTURITYPE* aContentUriType); + +private: + RPointerArray iBuffersToEmpty; + OMX_STATETYPE iState; + HBufC8* iUri; + HBufC* iFileName; + +private: + class CPFHelper; + class CFileSinkAccess : public CActive + { + friend class CPFHelper; + public: + static CFileSinkAccess* NewL(COmxILFileSinkProcessingFunction& aParent); + ~CFileSinkAccess(); + + // from CActive + void RunL(); + void DoCancel(); + + TInt Execute(); + void Pause(); + void Stop(); + void Idle(); + + TInt ProcessNextBuffer(); + + private: + CFileSinkAccess(COmxILFileSinkProcessingFunction& aParent); + void ConstructL(); + + private: + COmxILFileSinkProcessingFunction& iParent; + OMX_BUFFERHEADERTYPE* iCurrentBuffer; + + RFs iFs; + RFile iFileHandle; + TInt iBufferOffset; + TPtr8 iWriteBuffer; + + } *iFileSinkAccess; + + class CPFHelper : public CActive + { + public: + static CPFHelper* NewL(COmxILFileSinkProcessingFunction& aParent, CFileSinkAccess& aFileSinkAccess); + ~CPFHelper(); + + static OMX_ERRORTYPE ConvertSymbianErrorType(TInt aError); + + // from CActive + void RunL(); + void DoCancel(); + + TInt ExecuteAsync(); + TInt StopAsync(); + TInt PauseAsync(); + void StopSync(); + TInt IdleAsync(); + TInt BufferIndication(OMX_BUFFERHEADERTYPE* apBufferHeader); + + enum TMessageType + { + EExecuteCommand, + EStopCommand, + EPauseCommand, + ECancelCommand, + EBufferIndication, + EIdleCommand + }; + + class TProcMessage + { + public: + TMessageType iType; + TAny* iPtr; + }; + + RMsgQueue iMsgQueue; + + private: + CPFHelper(COmxILFileSinkProcessingFunction& aParent, CFileSinkAccess& aFileSinkAccess); + void ConstructL(); + + TInt ProcessQueue(); + + private: + COmxILFileSinkProcessingFunction& iParent; + CFileSinkAccess& iFileSinkAccess; + } *iPFHelper; + }; + +#endif // OMXILFILESINKPROCESSINGFUNCTION_H + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesink/inc/omxilimagefilesinkopb0port.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesink/inc/omxilimagefilesinkopb0port.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,63 @@ +// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + + + +/** + * @file + * @internalTechnology + */ + +#ifndef OMXILIMAGEFILESINKOPB0PORT_H +#define OMXILIMAGEFILESINKOPB0PORT_H + +#include "omxilimageport.h" +#include "omxilfilesinkprocessingfunction.h" +#include + +class COmxILImageFileSinkOPB0Port : public COmxILImagePort + { +public: + static COmxILImageFileSinkOPB0Port* NewL(const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedImageFormats, + const RArray& aSupportedColorFormats, + const COmxILFileSinkProcessingFunction& aFileSinkPF); + + ~COmxILImageFileSinkOPB0Port(); + + OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray& aIndexArray) const; + OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray& aIndexArray) const; + + OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex, + TAny* apComponentParameterStructure) const; + OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex, + const TAny* apComponentParameterStructure, + TBool& aUpdateProcessingFunction); + +private: + COmxILImageFileSinkOPB0Port(const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedImageFormats, + const RArray& aSupportedColorFormats, + const COmxILFileSinkProcessingFunction& aFileSinkPF); + void ConstructL(); + OMX_ERRORTYPE SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, + TBool& aUpdateProcessingFunction); + TBool IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const; + +private: + const COmxILFileSinkProcessingFunction& iFileSinkPF; + }; + +#endif // OMXILIMAGEFILESINKOPB0PORT_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesink/inc/omxilotherfilesinkopb0port.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesink/inc/omxilotherfilesinkopb0port.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,59 @@ +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + + + +/** + * @file + * @internalTechnology + */ + +#ifndef OMXILFILESINKOPB0PORT_H +#define OMXILFILESINKOPB0PORT_H + +#include "omxilotherport.h" +#include "omxilfilesinkprocessingfunction.h" +#include + +class COmxILOtherFileSinkOPB0Port : public COmxILOtherPort + { +public: + static COmxILOtherFileSinkOPB0Port* NewL(const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedOtherFormats, + const COmxILFileSinkProcessingFunction& aFileSinkPF); + ~COmxILOtherFileSinkOPB0Port(); + + OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray& aIndexArray) const; + OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray& aIndexArray) const; + + OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex, + TAny* apComponentParameterStructure) const; + OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex, + const TAny* apComponentParameterStructure, + TBool& aUpdateProcessingFunction); + +private: + COmxILOtherFileSinkOPB0Port(const TOmxILCommonPortData& aCommonPortData, + const COmxILFileSinkProcessingFunction& aFileSinkPF); + void ConstructL(const RArray& aSupportedOtherFormats); + OMX_ERRORTYPE SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, + TBool& aUpdateProcessingFunction); + TBool IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const; + +private: + const COmxILFileSinkProcessingFunction& iFileSinkPF; + }; + +#endif // OMXILFILESINKOPB0PORT_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesink/inc/omxilvideofilesinkopb0port.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesink/inc/omxilvideofilesinkopb0port.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,63 @@ +// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + + + +/** + * @file + * @internalTechnology + */ + +#ifndef OMXILVIDEOFILESINKOPB0PORT_H +#define OMXILVIDEOFILESINKOPB0PORT_H + +#include "omxilvideoport.h" +#include "omxilfilesinkprocessingfunction.h" +#include + +class COmxILVideoFileSinkOPB0Port : public COmxILVideoPort + { +public: + static COmxILVideoFileSinkOPB0Port* NewL(const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedCodings, + const RArray& aSupportedColourFormats, + const COmxILFileSinkProcessingFunction& aFileSinkPF); + + ~COmxILVideoFileSinkOPB0Port(); + + OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray& aIndexArray) const; + OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray& aIndexArray) const; + + OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex, + TAny* apComponentParameterStructure) const; + OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex, + const TAny* apComponentParameterStructure, + TBool& aUpdateProcessingFunction); + +private: + COmxILVideoFileSinkOPB0Port(const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedCodings, + const RArray& aSupportedColourFormats, + const COmxILFileSinkProcessingFunction& aFileSinkPF); + void ConstructL(); + OMX_ERRORTYPE SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, + TBool& aUpdateProcessingFunction); + TBool IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const; + +private: + const COmxILFileSinkProcessingFunction& iFileSinkPF; + }; + +#endif // OMXILVIDEOFILESINKOPB0PORT_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesink/mmpfiles/omxilaudiofilesink.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesink/mmpfiles/omxilaudiofilesink.mmp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,45 @@ +// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +MACRO OMXIL_AUDIO_FILESINK + +#include "../inc/omxilfilesink.hrh" + +TARGET omxilaudiofilesink.dll +CAPABILITY ALL -TCB // TODO restrict capabilities, as writing to file +TARGETTYPE PLUGIN +UID 0x10009D8D KUidNokiaOmxILAudioFileSinkDll +VENDORID 0x70000001 + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN + +USERINCLUDE ../inc +USERINCLUDE ../../../omxilcomponentcommon/src/common + +SOURCEPATH ../src + +SOURCE omxilfilesink.cpp +SOURCE omxilAudiofilesinkopb0port.cpp +SOURCE omxilfilesinkprocessingfunction.cpp +SOURCE omxilfilesinkconfigmanager.cpp + +RESOURCE omxilaudiofilesink.rss + +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY inetprotutil.lib +LIBRARY ecom.lib +LIBRARY omxilcomponentcommon.lib +STATICLIBRARY omxilcomponentif.lib diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesink/mmpfiles/omxilfilesink.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesink/mmpfiles/omxilfilesink.mmp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,46 @@ +// 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: +// + +MACRO OMXIL_OTHER_FILESINK + +#include "../inc/omxilfilesink.hrh" + +TARGET omxilfilesink.dll +CAPABILITY ALL -TCB // TODO restrict capabilities, as writing to file +TARGETTYPE PLUGIN +UID 0x10009D8D KUidSymbianOmxILFileSinkDll +VENDORID 0x70000001 + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN + + +USERINCLUDE ../inc +USERINCLUDE ../../../omxilcomponentcommon/src/common + +SOURCEPATH ../src + +SOURCE omxilfilesink.cpp +SOURCE omxilfilesinkopb0port.cpp +SOURCE omxilfilesinkprocessingfunction.cpp +SOURCE omxilfilesinkconfigmanager.cpp + +RESOURCE omxilfilesink.rss + +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY inetprotutil.lib +LIBRARY ecom.lib +LIBRARY omxilcomponentcommon.lib +STATICLIBRARY omxilcomponentif.lib diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesink/mmpfiles/omxilimagefilesink.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesink/mmpfiles/omxilimagefilesink.mmp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,45 @@ +// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +MACRO OMXIL_IMAGE_FILESINK + +#include "../inc/omxilfilesink.hrh" + +TARGET omxilimagefilesink.dll +CAPABILITY ALL -TCB // TODO restrict capabilities, as writing to file +TARGETTYPE PLUGIN +UID 0x10009D8D KUidNokiaOmxILImageFileSinkDll +VENDORID 0x70000001 + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN + +USERINCLUDE ../inc +USERINCLUDE ../../../omxilcomponentcommon/src/common + +SOURCEPATH ../src + +SOURCE omxilfilesink.cpp +SOURCE omxilimagefilesinkopb0port.cpp +SOURCE omxilfilesinkprocessingfunction.cpp +SOURCE omxilfilesinkconfigmanager.cpp + +RESOURCE omxilimagefilesink.rss + +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY inetprotutil.lib +LIBRARY ecom.lib +LIBRARY omxilcomponentcommon.lib +STATICLIBRARY omxilcomponentif.lib diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesink/mmpfiles/omxilotherfilesink.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesink/mmpfiles/omxilotherfilesink.mmp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,46 @@ +// 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: +// + +MACRO OMXIL_OTHER_FILESINK + +#include "../inc/omxilfilesink.hrh" + +TARGET omxilotherfilesink.dll +CAPABILITY ALL -TCB // TODO restrict capabilities, as writing to file +TARGETTYPE PLUGIN +UID 0x10009D8D KUidSymbianOmxIOtherLFileSinkDll +VENDORID 0x70000001 + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN + + +USERINCLUDE ../inc +USERINCLUDE ../../../omxilcomponentcommon/src/common + +SOURCEPATH ../src + +SOURCE omxilfilesink.cpp +SOURCE omxilotherfilesinkopb0port.cpp +SOURCE omxilfilesinkprocessingfunction.cpp +SOURCE omxilfilesinkconfigmanager.cpp + +RESOURCE omxilotherfilesink.rss + +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY inetprotutil.lib +LIBRARY ecom.lib +LIBRARY omxilcomponentcommon.lib +STATICLIBRARY omxilcomponentif.lib diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesink/mmpfiles/omxilvideofilesink.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesink/mmpfiles/omxilvideofilesink.mmp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,45 @@ +// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +MACRO OMXIL_VIDEO_FILESINK + +#include "../inc/omxilfilesink.hrh" + +TARGET omxilvideofilesink.dll +CAPABILITY ALL -TCB // TODO restrict capabilities, as writing to file +TARGETTYPE PLUGIN +UID 0x10009D8D KUidNokiaOmxILVideoFileSinkDll +VENDORID 0x70000001 + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN + +USERINCLUDE ../inc +USERINCLUDE ../../../omxilcomponentcommon/src/common + +SOURCEPATH ../src + +SOURCE omxilfilesink.cpp +SOURCE omxilvideofilesinkopb0port.cpp +SOURCE omxilfilesinkprocessingfunction.cpp +SOURCE omxilfilesinkconfigmanager.cpp + +RESOURCE omxilvideofilesink.rss + +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY inetprotutil.lib +LIBRARY ecom.lib +LIBRARY omxilcomponentcommon.lib +STATICLIBRARY omxilcomponentif.lib diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesink/src/omxilaudiofilesink.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesink/src/omxilaudiofilesink.rss Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,43 @@ +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + + + +#include +#include +#include "omxilfilesink.hrh" + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = KUidNokiaOmxILAudioFileSinkDll; + interfaces = + { + INTERFACE_INFO + { + interface_uid = KUidOmxILSymbianComponentIf; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KUidNokiaOmxILAudioFileSink; + version_no = 1; + display_name = "OMX.NOKIA.AUDIO.FILESINK"; + default_data = "audio_writer.binary"; + } + }; + } + }; + } + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesink/src/omxilaudiofilesinkopb0port.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesink/src/omxilaudiofilesinkopb0port.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,102 @@ +// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + + + +/** + * @file + * @internalTechnology + */ + +#include "omxilaudiofilesinkopb0port.h" +#include "omxilfilesinkprocessingfunction.h" +#include + +COmxILAudioFileSinkOPB0Port* COmxILAudioFileSinkOPB0Port::NewL(const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedAudioFormats, + const COmxILFileSinkProcessingFunction& aFileSinkPF) + { + COmxILAudioFileSinkOPB0Port* self = new (ELeave) COmxILAudioFileSinkOPB0Port(aCommonPortData, aFileSinkPF); + CleanupStack::PushL(self); + self->ConstructL(aSupportedAudioFormats); + CleanupStack::Pop(self); + return self; + } + +void COmxILAudioFileSinkOPB0Port::ConstructL(const RArray& aSupportedAudioFormats) + { + iParamPortDefinition.eDomain = OMX_PortDomainAudio; + + // base + COmxILAudioPort::ConstructL(aSupportedAudioFormats); + } + +COmxILAudioFileSinkOPB0Port::COmxILAudioFileSinkOPB0Port(const TOmxILCommonPortData& aCommonPortData, + const COmxILFileSinkProcessingFunction& aFileSinkPF) + : COmxILAudioPort(aCommonPortData), + iFileSinkPF(aFileSinkPF) + { + } + +COmxILAudioFileSinkOPB0Port::~COmxILAudioFileSinkOPB0Port() + { + CleanUpPort(); + } + +OMX_ERRORTYPE COmxILAudioFileSinkOPB0Port::GetLocalOmxParamIndexes(RArray& aIndexArray) const + { + return COmxILAudioPort::GetLocalOmxParamIndexes(aIndexArray); + } + +OMX_ERRORTYPE COmxILAudioFileSinkOPB0Port::GetLocalOmxConfigIndexes(RArray& aIndexArray) const + { + return COmxILAudioPort::GetLocalOmxConfigIndexes(aIndexArray); + } + +OMX_ERRORTYPE COmxILAudioFileSinkOPB0Port::GetParameter(OMX_INDEXTYPE aParamIndex, + TAny* apComponentParameterStructure) const + { + return COmxILAudioPort::GetParameter(aParamIndex, apComponentParameterStructure); + } + +OMX_ERRORTYPE COmxILAudioFileSinkOPB0Port::SetParameter(OMX_INDEXTYPE aParamIndex, + const TAny* apComponentParameterStructure, + TBool& aUpdateProcessingFunction) + { + return COmxILAudioPort::SetParameter(aParamIndex, + apComponentParameterStructure, + aUpdateProcessingFunction); + } + +OMX_ERRORTYPE COmxILAudioFileSinkOPB0Port::SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, + TBool& /*aUpdateProcessingFunction*/) + { + iParamPortDefinition.format.audio = aPortDefinition.format.audio; + return OMX_ErrorNone; + } + +TBool COmxILAudioFileSinkOPB0Port::IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const + { + if(aPortDefinition.eDomain != iParamPortDefinition.eDomain) + { + return EFalse; + } + + if (aPortDefinition.format.audio.eEncoding == OMX_AUDIO_CodingMax) + { + return EFalse; + } + return ETrue; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesink/src/omxilfilesink.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesink/src/omxilfilesink.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,309 @@ +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + + + +/** + * @file + * @internalTechnology + */ + +#include "omxilport.h" + +#include "omxilfsm.h" +#include "omxilportmanager.h" +#include "omxilcallbackmanager.h" +#include "omxilspecversion.h" +#include + +#include "omxilfilesink.h" +#include "omxilfilesinkprocessingfunction.h" +#include "omxilfilesinkconfigmanager.h" +#include "omxilfilesink.hrh" + + +#ifdef OMXIL_AUDIO_FILESINK +#include "omxilaudiofilesinkopb0port.h" +_LIT8(KNokiaOMXFileSinkComponentName, "OMX.NOKIA.AUDIO.FILESINK"); +_LIT8(KNokiaOMXFileSinkRole, "audio_writer.binary"); +OMXIL_COMPONENT_ECOM_ENTRYPOINT(KUidNokiaOmxILAudioFileSink); + +#elif defined(OMXIL_VIDEO_FILESINK) +#include "omxilvideofilesinkopb0port.h" +_LIT8(KNokiaOMXFileSinkComponentName, "OMX.NOKIA.VIDEO.FILESINK"); +_LIT8(KNokiaOMXFileSinkRole, "video_writer.binary"); +OMXIL_COMPONENT_ECOM_ENTRYPOINT(KUidNokiaOmxILVideoFileSink); + +#elif defined(OMXIL_IMAGE_FILESINK) +#include "omxilimagefilesinkopb0port.h" +_LIT8(KNokiaOMXFileSinkComponentName, "OMX.NOKIA.IMAGE.FILESINK"); +_LIT8(KNokiaOMXFileSinkRole, "image_writer.binary"); +OMXIL_COMPONENT_ECOM_ENTRYPOINT(KUidNokiaOmxILImageFileSink); + +#elif defined(OMXIL_OTHER_FILESINK) +#include "omxilotherfilesinkopb0port.h" +_LIT8(KNokiaOMXFileSinkComponentName, "OMX.NOKIA.OTHER.FILESINK"); +_LIT8(KNokiaOMXFileSinkRole, "other_writer.binary"); +OMXIL_COMPONENT_ECOM_ENTRYPOINT(KUidSymbianOmxILOtherFileSink); + +#endif + +const TUint8 KComponentVersionMajor = 1; +const TUint8 KComponentVersionMinor = 1; +const TUint8 KComponentVersionRevision = 0; +const TUint8 KComponentVersionStep = 0; + +static const TInt KMinBuffers = 1; +static const TInt KMinBufferSize = 15360; + + +// Component Entry Point +OMX_ERRORTYPE OMX_ComponentInit(OMX_HANDLETYPE aComponent) + { + TRAPD(err, COmxILFileSink::CreateComponentL(aComponent)); + if (err == KErrNone) + { + return OMX_ErrorNone; + } + else + { + return err == KErrNoMemory ? OMX_ErrorInsufficientResources : OMX_ErrorUndefined; + } + } + +void COmxILFileSink::CreateComponentL(OMX_HANDLETYPE aComponent) + { + COmxILFileSink* self = new (ELeave) COmxILFileSink(); + CleanupStack::PushL(self); + self->ConstructL(aComponent); + CleanupStack::Pop(self); + } + +COmxILFileSink::COmxILFileSink() + { + // nothing to do + } + +COmxILFileSink::~COmxILFileSink() + { + delete ipCallbackManager; + delete ipProcessingFunction; + delete ipPortManager; + delete iOPB0Port; + delete ipConfigManager; + delete ipFsm; + } + +void COmxILFileSink::ConstructL(OMX_HANDLETYPE aComponent) + { + // STEP 1: Initialize the data received from the IL Core + ipHandle = static_cast(aComponent); + ipAppData = 0; + ipCallbacks = 0; + + // STEP 2: Create the call backs manager... + ipCallbackManager = COmxILCallbackManager::NewL(ipHandle, ipAppData, ipCallbacks); + + // STEP 3: Create the file sink-specific Processing Function... + ipProcessingFunction = COmxILFileSinkProcessingFunction::NewL(*ipCallbackManager); + + // STEP 4: Create Port manager... + +#ifdef OMXIL_AUDIO_FILESINK + ipPortManager = COmxILPortManager::NewL( + *ipProcessingFunction, // The component's processing function + *ipCallbackManager, // The call back manager object + TOmxILSpecVersion(), // OMX Version + 1, // The number of audio ports in this component + 0, // The starting audio port index + 0, // The number of image ports in this component + 0, // The starting image port index + 0, // The number of video ports in this component + 0, // The starting video port index + 0, // The number of other ports in this component + 0 // The starting other port index + ); + +#elif defined(OMXIL_VIDEO_FILESINK) + ipPortManager = COmxILPortManager::NewL( + *ipProcessingFunction, // The component's processing function + *ipCallbackManager, // The call back manager object + TOmxILSpecVersion(), // OMX Version + 0, // The number of audio ports in this component + 0, // The starting audio port index + 0, // The number of image ports in this component + 0, // The starting image port index + 1, // The number of video ports in this component + 0, // The starting video port index + 0, // The number of other ports in this component + 0 // The starting other port index + ); + +#elif defined(OMXIL_IMAGE_FILESINK) + ipPortManager = COmxILPortManager::NewL( + *ipProcessingFunction, // The component's processing function + *ipCallbackManager, // The call back manager object + TOmxILSpecVersion(), // OMX Version + 0, // The number of audio ports in this component + 0, // The starting audio port index + 1, // The number of image ports in this component + 0, // The starting image port index + 0, // The number of video ports in this component + 0, // The starting video port index + 0, // The number of other ports in this component + 0 // The starting other port index + ); + + +#elif defined(OMXIL_OTHER_FILESINK) + ipPortManager = COmxILPortManager::NewL( + *ipProcessingFunction, // The component's processing function + *ipCallbackManager, // The call back manager object + TOmxILSpecVersion(), // OMX Version + 0, // The number of audio ports in this component + 0, // The starting audio port index + 0, // The number of image ports in this component + 0, // The starting image port index + 0, // The number of video ports in this component + 0, // The starting video port index + 1, // The number of other ports in this component + 0 // The starting other port index + ); +#endif + + // STEP 5: Create the File Sink component port... + iOPB0Port = ConstructOPB0PortL(); + + // STEP 6: Add to the port manager... + User::LeaveIfError(ipPortManager->AddPort(iOPB0Port, OMX_DirInput)); + + // STEP 7: Create the non-port related configuration manager... + RPointerArray componentRoles; + CleanupClosePushL(componentRoles); + + componentRoles.AppendL(&KNokiaOMXFileSinkRole); + ipConfigManager = COmxILFileSinkConfigManager::NewL( + *ipPortManager, + KNokiaOMXFileSinkComponentName, + TOmxILVersion(KComponentVersionMajor, + KComponentVersionMinor, + KComponentVersionRevision, + KComponentVersionStep), + componentRoles, + *ipProcessingFunction); + + CleanupStack::PopAndDestroy(&componentRoles); + + // STEP 8: Create the FSM object... + ipFsm = COmxILFsm::NewL(*this, *ipProcessingFunction, *ipPortManager, *ipConfigManager, *ipCallbackManager); + + // STEP 9: Finally, let's get everything started + InitComponentL(); + } + +COmxILPort* COmxILFileSink::ConstructOPB0PortL() const + { + OMX_U32 thisPortIndex = 0; + //const TUint32 KBufferAlignment = 4; +#ifdef OMXIL_AUDIO_FILESINK + RArray supportedAudioFormats; + CleanupClosePushL(supportedAudioFormats); + supportedAudioFormats.AppendL(OMX_AUDIO_CodingUnused); + COmxILAudioFileSinkOPB0Port* opb0Port = COmxILAudioFileSinkOPB0Port::NewL( + TOmxILCommonPortData ( + TOmxILSpecVersion(), // OMX specification version information + thisPortIndex, // Port number the structure applies to + OMX_DirInput, // Direction of this port + KMinBuffers, // The minimum number of buffers this port requires + KMinBufferSize, // Minimum size, in bytes, for buffers to be used for this port + OMX_PortDomainAudio, // Domain of the port + OMX_FALSE, // Buffers contiguous requirement (true or false) + 0, // Buffer aligment requirements + OMX_BufferSupplyOutput, // supplier preference when tunneling between two ports + COmxILPort::KBufferMarkPropagationPortNotNeeded), + supportedAudioFormats, + *ipProcessingFunction); + CleanupStack::PopAndDestroy(&supportedAudioFormats); + return opb0Port; + +#elif defined(OMXIL_VIDEO_FILESINK) + RArray supportedVideoFormats; + CleanupClosePushL(supportedVideoFormats); + RArray supportedColourFormats; + CleanupClosePushL(supportedColourFormats); + COmxILVideoFileSinkOPB0Port* opb0Port = COmxILVideoFileSinkOPB0Port::NewL( + TOmxILCommonPortData ( + TOmxILSpecVersion(), // OMX specification version information + thisPortIndex, // Port number the structure applies to + OMX_DirInput, // Direction of this port + KMinBuffers, // The minimum number of buffers this port requires + KMinBufferSize, // Minimum size, in bytes, for buffers to be used for this port + OMX_PortDomainVideo, // Domain of the port + OMX_FALSE, // Buffers contiguous requirement (true or false) + 0, // Buffer aligment requirements + OMX_BufferSupplyOutput, // supplier preference when tunneling between two ports + COmxILPort::KBufferMarkPropagationPortNotNeeded), + supportedVideoFormats, + supportedColourFormats, + *ipProcessingFunction); + CleanupStack::PopAndDestroy(2); + return opb0Port; + +#elif defined(OMXIL_IMAGE_FILESINK) + RArray supportedImageFormats; + CleanupClosePushL(supportedImageFormats); + RArray supportedColourFormats; + CleanupClosePushL(supportedColourFormats); + COmxILImageFileSinkOPB0Port* opb0Port = COmxILImageFileSinkOPB0Port::NewL( + TOmxILCommonPortData ( + TOmxILSpecVersion(), // OMX specification version information + thisPortIndex, // Port number the structure applies to + OMX_DirInput, // Direction of this port + KMinBuffers, // The minimum number of buffers this port requires + KMinBufferSize, // Minimum size, in bytes, for buffers to be used for this port + OMX_PortDomainImage, // Domain of the port + OMX_FALSE, // Buffers contiguous requirement (true or false) + 0, // Buffer aligment requirements + OMX_BufferSupplyOutput, // supplier preference when tunneling between two ports + COmxILPort::KBufferMarkPropagationPortNotNeeded), + supportedImageFormats, + supportedColourFormats, + *ipProcessingFunction); + CleanupStack::PopAndDestroy(2); + return opb0Port; + +#elif defined(OMXIL_OTHER_FILESINK) + RArray supportedOtherFormats; + CleanupClosePushL(supportedOtherFormats); + supportedOtherFormats.AppendL(OMX_OTHER_FormatBinary); + COmxILOtherFileSinkOPB0Port* opb0Port = COmxILOtherFileSinkOPB0Port::NewL( + TOmxILCommonPortData ( + TOmxILSpecVersion(), // OMX specification version information + thisPortIndex, // Port number the structure applies to + OMX_DirInput, // Direction of this port + KMinBuffers, // The minimum number of buffers this port requires + KMinBufferSize, // Minimum size, in bytes, for buffers to be used for this port + OMX_PortDomainOther, // Domain of the port + OMX_FALSE, // Buffers contiguous requirement (true or false) + 0, // Buffer aligment requirements + OMX_BufferSupplyOutput, // supplier preference when tunneling between two ports + COmxILPort::KBufferMarkPropagationPortNotNeeded), + supportedOtherFormats, + *ipProcessingFunction); + CleanupStack::PopAndDestroy(&supportedOtherFormats); + return opb0Port; + +#endif + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesink/src/omxilfilesinkconfigmanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesink/src/omxilfilesinkconfigmanager.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,125 @@ +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + + + +/** + * @file + * @internalTechnology + */ + +#include "omxilfilesinkconfigmanager.h" +#include "omxilfilesinkprocessingfunction.h" +#include "omxilspecversion.h" + +COmxILFileSinkConfigManager* COmxILFileSinkConfigManager::NewL( + MOmxILPortManagerIf& aPortManager, + const TDesC8& aComponentName, + const OMX_VERSIONTYPE& aComponentVersion, + const RPointerArray& aComponentRoleList, + COmxILFileSinkProcessingFunction& aFileSinkPF) + { + COmxILFileSinkConfigManager* self = new(ELeave) COmxILFileSinkConfigManager(aPortManager, aFileSinkPF); + CleanupStack::PushL(self); + self->ConstructL(aComponentName, aComponentVersion, aComponentRoleList); + CleanupStack::Pop(self); + return self; + } + +COmxILFileSinkConfigManager::COmxILFileSinkConfigManager(MOmxILPortManagerIf& aPortManager, COmxILFileSinkProcessingFunction& aFileSinkPF) + :COmxILConfigManager(aPortManager), + iFileSinkPF(aFileSinkPF) + { + } + +void COmxILFileSinkConfigManager::ConstructL( + const TDesC8& aComponentName, + const OMX_VERSIONTYPE& aComponentVersion, + const RPointerArray& aComponentRoleList) + { + COmxILConfigManager::ConstructL(aComponentName, aComponentVersion, aComponentRoleList); + + InsertParamIndexL(OMX_IndexParamContentURI); + } + +COmxILFileSinkConfigManager::~COmxILFileSinkConfigManager() + { + } + +OMX_ERRORTYPE COmxILFileSinkConfigManager::GetParameter(OMX_INDEXTYPE aParamIndex, TAny* aPtr) const + { + TInt index = FindParamIndex(aParamIndex); + if (KErrNotFound == index) + { + return OMX_ErrorUnsupportedIndex; + } + + switch (aParamIndex) + { + case OMX_IndexParamContentURI: + { + OMX_PARAM_CONTENTURITYPE* param = reinterpret_cast(aPtr); + const HBufC8* uriData = iFileSinkPF.Uri(); + if (!uriData) + { + return OMX_ErrorNotReady; + } + + const OMX_PARAM_CONTENTURITYPE* uri = reinterpret_cast(uriData->Ptr()); + if (uri->nSize > param->nSize) + { + return OMX_ErrorBadParameter; + } + + // The client's structure is guaranteed to be big enough. + Mem::Copy(param, uri, uri->nSize); + } + break; + + default: + { + return COmxILConfigManager::GetParameter(aParamIndex, aPtr); + } + } + + return OMX_ErrorNone; + } + +OMX_ERRORTYPE COmxILFileSinkConfigManager::SetParameter(OMX_INDEXTYPE aParamIndex, const TAny* aPtr, OMX_BOOL aInitTime) + { + TInt index = FindParamIndex(aParamIndex); + if (KErrNotFound == index) + { + return OMX_ErrorUnsupportedIndex; + } + + OMX_ERRORTYPE omxErr = OMX_ErrorNone; + + switch (aParamIndex) + { + case OMX_IndexParamContentURI: + { + omxErr = iFileSinkPF.ParamIndication(aParamIndex, aPtr); + break; + } + default: + { + omxErr = COmxILConfigManager::SetParameter(aParamIndex, aPtr, aInitTime); + break; + } + } + + return omxErr; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesink/src/omxilfilesinkopb0port.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesink/src/omxilfilesinkopb0port.cpp Fri May 07 16:25:23 2010 +0100 @@ -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 + * @internalTechnology + */ + +#include "omxilfilesinkopb0port.h" +#include "omxilfilesinkprocessingfunction.h" +#include + +COmxILOtherFileSinkOPB0Port* COmxILOtherFileSinkOPB0Port::NewL(const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedOtherFormats, + const COmxILFileSinkProcessingFunction& aFileSinkPF) + { + COmxILOtherFileSinkOPB0Port* self = new (ELeave) COmxILOtherFileSinkOPB0Port(aCommonPortData, aFileSinkPF); + CleanupStack::PushL(self); + self->ConstructL(aSupportedOtherFormats); + CleanupStack::Pop(self); + return self; + } + +void COmxILOtherFileSinkOPB0Port::ConstructL(const RArray& aSupportedOtherFormats) + { + iParamPortDefinition.eDomain = OMX_PortDomainOther; + iParamPortDefinition.format.other.eFormat = OMX_OTHER_FormatBinary; + + // base + COmxILOtherPort::ConstructL(aSupportedOtherFormats); + } + +COmxILOtherFileSinkOPB0Port::COmxILOtherFileSinkOPB0Port(const TOmxILCommonPortData& aCommonPortData, + const COmxILFileSinkProcessingFunction& aFileSinkPF) + : COmxILOtherPort(aCommonPortData), + iFileSinkPF(aFileSinkPF) + { + } + +COmxILOtherFileSinkOPB0Port::~COmxILOtherFileSinkOPB0Port() + { + CleanUpPort(); + } + +OMX_ERRORTYPE COmxILOtherFileSinkOPB0Port::GetLocalOmxParamIndexes(RArray& aIndexArray) const + { + return COmxILOtherPort::GetLocalOmxParamIndexes(aIndexArray); + } + +OMX_ERRORTYPE COmxILOtherFileSinkOPB0Port::GetLocalOmxConfigIndexes(RArray& aIndexArray) const + { + return COmxILOtherPort::GetLocalOmxConfigIndexes(aIndexArray); + } + +OMX_ERRORTYPE COmxILOtherFileSinkOPB0Port::GetParameter(OMX_INDEXTYPE aParamIndex, + TAny* apComponentParameterStructure) const + { + return COmxILOtherPort::GetParameter(aParamIndex, apComponentParameterStructure); + } + +OMX_ERRORTYPE COmxILOtherFileSinkOPB0Port::SetParameter(OMX_INDEXTYPE aParamIndex, + const TAny* apComponentParameterStructure, + TBool& aUpdateProcessingFunction) + { + return COmxILOtherPort::SetParameter(aParamIndex, + apComponentParameterStructure, + aUpdateProcessingFunction); + } + +OMX_ERRORTYPE COmxILOtherFileSinkOPB0Port::SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, + TBool& /*aUpdateProcessingFunction*/) + { + iParamPortDefinition.format.other = aPortDefinition.format.other; + return OMX_ErrorNone; + } + +TBool COmxILOtherFileSinkOPB0Port::IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const + { + if(aPortDefinition.eDomain != iParamPortDefinition.eDomain) + { + return EFalse; + } + + if (aPortDefinition.format.other.eFormat == OMX_OTHER_FormatMax) + { + return EFalse; + } + + return ETrue; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesink/src/omxilfilesinkprocessingfunction.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesink/src/omxilfilesinkprocessingfunction.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,645 @@ +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + + + +/** + * @file + * @internalTechnology + */ + +#include +#include "omxilcallbackmanager.h" +#include "omxilfilesinkprocessingfunction.h" + +const TInt KMaxMsgQueueEntries = 25; + +COmxILFileSinkProcessingFunction* COmxILFileSinkProcessingFunction::NewL(MOmxILCallbackNotificationIf& aCallbacks) + { + COmxILFileSinkProcessingFunction* self = new (ELeave) COmxILFileSinkProcessingFunction(aCallbacks); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +COmxILFileSinkProcessingFunction::COmxILFileSinkProcessingFunction(MOmxILCallbackNotificationIf& aCallbacks) +: COmxILProcessingFunction(aCallbacks) + { + } + +void COmxILFileSinkProcessingFunction::ConstructL() + { + iState = OMX_StateLoaded; + iFileSinkAccess = CFileSinkAccess::NewL(*this); + iPFHelper = CPFHelper::NewL(*this, *iFileSinkAccess); + } + +COmxILFileSinkProcessingFunction::~COmxILFileSinkProcessingFunction() + { + if(iPFHelper && + (iState == OMX_StateInvalid || + iState == OMX_StateExecuting || + iState == OMX_StatePause)) + { + iPFHelper->StopSync(); + } + + delete iPFHelper; + delete iFileSinkAccess; + delete iUri; + delete iFileName; + + // Buffer headers are not owned by the processing function + iBuffersToEmpty.Close(); + } + +OMX_ERRORTYPE COmxILFileSinkProcessingFunction::StateTransitionIndication(COmxILFsm::TStateIndex aNewState) + { + OMX_ERRORTYPE err = OMX_ErrorNone; + switch(aNewState) + { + case COmxILFsm::EStateExecuting: + { + if (iPFHelper->ExecuteAsync() != KErrNone) + { + err = OMX_ErrorInsufficientResources; + } + } + break; + + case COmxILFsm::EStateInvalid: + { + if (iPFHelper && iPFHelper->StopAsync() != KErrNone) + { + err = OMX_ErrorInsufficientResources; + } + } + break; + + case COmxILFsm::EStatePause: + { + iPFHelper->PauseAsync(); + } + break; + + case COmxILFsm::EStateIdle: + { + iPFHelper->IdleAsync(); + } + break; + + case COmxILFsm::EStateLoaded: + case COmxILFsm::EStateWaitForResources: + { + if (iPFHelper && iPFHelper->StopAsync() != KErrNone) + { + err = OMX_ErrorInsufficientResources; + } + } + break; + + case COmxILFsm::ESubStateExecutingToIdle: + { + iPFHelper->StopAsync(); + } + break; + + case COmxILFsm::ESubStateLoadedToIdle: + case COmxILFsm::ESubStateIdleToLoaded: + case COmxILFsm::ESubStatePauseToIdle: + break; + + default: + { + err = OMX_ErrorIncorrectStateTransition; + } + }; + return err; + } + +OMX_ERRORTYPE COmxILFileSinkProcessingFunction::BufferFlushingIndication(TUint32 aPortIndex, OMX_DIRTYPE aDirection) + { + OMX_ERRORTYPE err = OMX_ErrorNone; + if ((aPortIndex == OMX_ALL && aDirection == OMX_DirMax) || + (aPortIndex == 0 && aDirection == OMX_DirInput)) + { + // Send BufferDone notifications for each bufer... + for (TUint i=0, bufferCount=iBuffersToEmpty.Count(); inInputPortIndex, + OMX_DirInput); + } + // Empty buffer lists... + iBuffersToEmpty.Reset(); + } + else + { + err = OMX_ErrorBadParameter; + } + return err; + } + +OMX_ERRORTYPE COmxILFileSinkProcessingFunction::ParamIndication(OMX_INDEXTYPE aParamIndex, const TAny* apComponentParameterStructure) + { + OMX_ERRORTYPE err = OMX_ErrorNone; + switch(aParamIndex) + { + case OMX_IndexParamPortDefinition: + { + //const OMX_PARAM_PORTDEFINITIONTYPE* portDefinition = static_cast(apComponentParameterStructure); + //nothing to do + // + //the number of buffers may change depending on capture mode (single shot vs burst mode) + //in that case, we need to do something for PF... + break; + } + + case OMX_IndexParamContentURI: + { + const OMX_PARAM_CONTENTURITYPE* contentUriType = reinterpret_cast(apComponentParameterStructure); + err = SetFileName(contentUriType); + break; + } + default: + { + err = OMX_ErrorUnsupportedIndex; + } + } + return err; + } + +OMX_ERRORTYPE COmxILFileSinkProcessingFunction::ConfigIndication(OMX_INDEXTYPE /*aConfigIndex*/, const TAny* /*apComponentConfigStructure*/) + { + return OMX_ErrorNone; + } + +OMX_ERRORTYPE COmxILFileSinkProcessingFunction::BufferIndication(OMX_BUFFERHEADERTYPE* apBufferHeader, OMX_DIRTYPE aDirection) + { + if (aDirection == OMX_DirInput) + { + if (iPFHelper->BufferIndication(apBufferHeader) != KErrNone) + { + return OMX_ErrorInsufficientResources; + } + } + else + { + return OMX_ErrorBadParameter; + } + + return OMX_ErrorNone; + } + +OMX_BOOL COmxILFileSinkProcessingFunction::BufferRemovalIndication(OMX_BUFFERHEADERTYPE* apBufferHeader, OMX_DIRTYPE /*aDirection*/) + { + OMX_BOOL headerDeletionResult = OMX_TRUE; + + TInt headerIndexInArray = KErrNotFound; + if (KErrNotFound != (headerIndexInArray = iBuffersToEmpty.Find(apBufferHeader))) + { + iBuffersToEmpty.Remove(headerIndexInArray); + } + else + { + headerDeletionResult = OMX_FALSE; + } + + return headerDeletionResult; + } + +MOmxILCallbackNotificationIf& COmxILFileSinkProcessingFunction::GetCallbacks() + { + return iCallbacks; + } + +OMX_ERRORTYPE COmxILFileSinkProcessingFunction::SetFileName(const OMX_PARAM_CONTENTURITYPE* aContentUriType) + { + ASSERT(aContentUriType); + delete iFileName; + iFileName = NULL; + delete iUri; + iUri = NULL; + + //TInt dataLength = aContentUriType->nSize - sizeof(OMX_PARAM_CONTENTURITYPE) + 4; + TInt sizeOfUri = aContentUriType->nSize - _FOFF(OMX_PARAM_CONTENTURITYPE, contentURI); //Actual size of URI + if (sizeOfUri <= 0) + { + return OMX_ErrorBadParameter; + } + + // Don't include the zero character at the end. + //TPtrC8 uriDes(reinterpret_cast(&aContentUriType->contentURI), dataLength - 1); + TPtrC8 uriDes(aContentUriType->contentURI,sizeOfUri); + + TInt err = KErrNone; + do + { + TUriParser8 parser; + err = parser.Parse(uriDes); + if (err != KErrNone) + { + break; + } + + TRAP(err, iFileName = parser.GetFileNameL()); + if (err != KErrNone) + { + break; + } + + // Remove Null charcter '\0' if any. + TPtr filePtr(iFileName->Des()); + TInt index = filePtr.LocateReverse('\0'); + if (index != KErrNotFound && index == filePtr.Length()-1) + { + filePtr.Delete(index,1); + } + + uriDes.Set(reinterpret_cast(aContentUriType), aContentUriType->nSize ); + iUri = uriDes.Alloc(); + if (!iUri) + { + err = KErrNoMemory; + break; + } + + return OMX_ErrorNone; + } + while (EFalse); + + // Something failed. + ASSERT(err != KErrNone); + delete iFileName; + iFileName = NULL; + delete iUri; + iUri = NULL; + return (err == KErrNoMemory ? OMX_ErrorInsufficientResources : OMX_ErrorBadParameter); + } + + +const HBufC* COmxILFileSinkProcessingFunction::FileName() const + { + return iFileName; + } + +const HBufC8* COmxILFileSinkProcessingFunction::Uri() const + { + return iUri; + } + +COmxILFileSinkProcessingFunction::CFileSinkAccess* COmxILFileSinkProcessingFunction::CFileSinkAccess::NewL(COmxILFileSinkProcessingFunction& aParent) + { + CFileSinkAccess* self = new (ELeave) CFileSinkAccess(aParent); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +COmxILFileSinkProcessingFunction::CFileSinkAccess::CFileSinkAccess(COmxILFileSinkProcessingFunction& aParent) + : CActive(EPriorityStandard), + iParent(aParent), + iBufferOffset(0), + iWriteBuffer(0,0) + { + CActiveScheduler::Add(this); + } + +void COmxILFileSinkProcessingFunction::CFileSinkAccess::ConstructL() + { + User::LeaveIfError(iFs.Connect()); + } + +COmxILFileSinkProcessingFunction::CFileSinkAccess::~CFileSinkAccess() + { + Cancel(); + + iFileHandle.Close(); + iFs.Close(); + } + +void COmxILFileSinkProcessingFunction::CFileSinkAccess::RunL() + { + // The buffer is not on the list implies that they have already been flushed/spotted + // via BufferFlushingIndication/BufferRemovalIndication + TInt index = iParent.iBuffersToEmpty.Find(iCurrentBuffer); + if (KErrNotFound != index) + { + switch(iStatus.Int()) + { + case KErrNone: + { + // Consumed all data completely + if(OMX_BUFFERFLAG_EOS & iCurrentBuffer->nFlags) + { + iFileHandle.Close(); + iParent.GetCallbacks().EventNotification(OMX_EventBufferFlag, iCurrentBuffer->nInputPortIndex, OMX_BUFFERFLAG_EOS, NULL); + } + iCurrentBuffer->nFilledLen = 0; + iCurrentBuffer->nOffset = 0; + iCurrentBuffer->nFlags = 0; + iCurrentBuffer->nTimeStamp = 0; + break; + } + default: + { + // Leave actual value of iCurrentBuffer->nFilledLen + } + }; + + iParent.GetCallbacks().BufferDoneNotification(iCurrentBuffer,iCurrentBuffer->nInputPortIndex,OMX_DirInput); + iParent.iBuffersToEmpty.Remove(index); + iCurrentBuffer = NULL; + if(iFileHandle.SubSessionHandle() != 0) + { + ProcessNextBuffer(); + } + } + } + +TInt COmxILFileSinkProcessingFunction::CFileSinkAccess::ProcessNextBuffer() + { + if ((iParent.iBuffersToEmpty.Count() > 0) && !IsActive() && iParent.iState == OMX_StateExecuting) + { + iCurrentBuffer = iParent.iBuffersToEmpty[0]; + iWriteBuffer.Set(iCurrentBuffer->pBuffer, iCurrentBuffer->nFilledLen, iCurrentBuffer->nAllocLen); + + // If the buffer is empty, we should not invoke RFile::Write, but self-complete instead + if (iCurrentBuffer->nFilledLen == 0 || iFileHandle.SubSessionHandle() == 0) + { + SetActive(); + TRequestStatus* status(&iStatus); + User::RequestComplete(status, KErrNone); + } + else + { + iFileHandle.Write(iWriteBuffer, iCurrentBuffer->nFilledLen, iStatus); + SetActive(); + } + } + + return KErrNone; + } + +void COmxILFileSinkProcessingFunction::CFileSinkAccess::DoCancel() + { + if (iFileHandle.SubSessionHandle() != 0) + { + iFileHandle.Close(); + } + iCurrentBuffer = NULL; + } + +TInt COmxILFileSinkProcessingFunction::CFileSinkAccess::Execute() + { + iParent.iState = OMX_StateExecuting; + return ProcessNextBuffer(); + } + +void COmxILFileSinkProcessingFunction::CFileSinkAccess::Pause() + { + iParent.iState = OMX_StatePause; + Cancel(); + } + +void COmxILFileSinkProcessingFunction::CFileSinkAccess::Idle() + { + iParent.iBuffersToEmpty.Reset(); + iParent.iState = OMX_StateIdle; + } + +void COmxILFileSinkProcessingFunction::CFileSinkAccess::Stop() + { + if(iParent.iState == OMX_StateExecuting || iParent.iState == OMX_StatePause) + { + Cancel(); + iParent.iState = OMX_StateIdle; + } + } + +COmxILFileSinkProcessingFunction::CPFHelper* COmxILFileSinkProcessingFunction::CPFHelper::NewL(COmxILFileSinkProcessingFunction& aParent, CFileSinkAccess& aFileSinkAccess) + { + CPFHelper* self = new (ELeave) CPFHelper(aParent, aFileSinkAccess); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +COmxILFileSinkProcessingFunction::CPFHelper::CPFHelper(COmxILFileSinkProcessingFunction& aParent, CFileSinkAccess& aFileSinkAccess) +: CActive(EPriorityStandard), + iParent(aParent), + iFileSinkAccess(aFileSinkAccess) + { + CActiveScheduler::Add(this); + } + +void COmxILFileSinkProcessingFunction::CPFHelper::ConstructL() + { + User::LeaveIfError(iMsgQueue.CreateLocal(KMaxMsgQueueEntries)); + SetActive(); + iMsgQueue.NotifyDataAvailable(iStatus); + } + +COmxILFileSinkProcessingFunction::CPFHelper::~CPFHelper() + { + Cancel(); + iMsgQueue.Close(); + } + +void COmxILFileSinkProcessingFunction::CPFHelper::RunL() + { + TInt err = ProcessQueue(); + if (err != KErrNone) + { + iParent.GetCallbacks().ErrorEventNotification( ConvertSymbianErrorType(err)); + } + + // setup for next callbacks + SetActive(); + iMsgQueue.NotifyDataAvailable(iStatus); + } + +void COmxILFileSinkProcessingFunction::CPFHelper::DoCancel() + { + if (iMsgQueue.Handle()) + { + ProcessQueue(); // TODO: ignore the error? + iMsgQueue.CancelDataAvailable(); + } + } + +TInt COmxILFileSinkProcessingFunction::CPFHelper::ProcessQueue() + { + TProcMessage msg; + TInt err = KErrNone; + + while (iMsgQueue.Receive(msg) == KErrNone) + { + switch (msg.iType) + { + case EExecuteCommand: + { + const HBufC* fileName = iParent.FileName(); + if (fileName) + { + TUint fileMode = EFileWrite | EFileShareExclusive; + if(iFileSinkAccess.iFileHandle.SubSessionHandle() == 0) + { + err = iFileSinkAccess.iFileHandle.Replace(iFileSinkAccess.iFs, *fileName, fileMode); + } + } + if ( err == KErrNone) + { + err = iFileSinkAccess.Execute(); + } + break; + } + + case EStopCommand: + { + iFileSinkAccess.Stop(); + break; + } + + case EPauseCommand: + { + iFileSinkAccess.Pause(); + break; + } + + case EIdleCommand: + { + iFileSinkAccess.Idle(); + break; + } + + case EBufferIndication: + { + OMX_BUFFERHEADERTYPE* bufferHeader = reinterpret_cast(msg.iPtr); + if ( bufferHeader && (iParent.iState == OMX_StateExecuting || iParent.iState == OMX_StatePause + || iParent.iState == OMX_StateIdle) ) + { + err = iParent.iBuffersToEmpty.Append(bufferHeader); + if(err == KErrNone) + { + if(iParent.iState != OMX_StateIdle) + { + err = iFileSinkAccess.ProcessNextBuffer(); + } + } + else + { + // to prevent potential buffer leakage if the Append operation fails + iParent.GetCallbacks().BufferDoneNotification(bufferHeader, bufferHeader->nInputPortIndex,OMX_DirInput); + } + } + break; + } + default: + { + break; + } + } + + if (err) + { + break; + } + } + return err; + } + +TInt COmxILFileSinkProcessingFunction::CPFHelper::ExecuteAsync() + { + TProcMessage message; + message.iType = EExecuteCommand; + return iMsgQueue.Send(message); + } + +TInt COmxILFileSinkProcessingFunction::CPFHelper::StopAsync() + { + TProcMessage message; + message.iType = EStopCommand; + return iMsgQueue.Send(message); + } + +TInt COmxILFileSinkProcessingFunction::CPFHelper::PauseAsync() + { + TProcMessage message; + message.iType = EPauseCommand; + return iMsgQueue.Send(message); + } + +TInt COmxILFileSinkProcessingFunction::CPFHelper::BufferIndication(OMX_BUFFERHEADERTYPE* apBufferHeader) + { + TProcMessage message; + message.iType = EBufferIndication; + message.iPtr = apBufferHeader; + return iMsgQueue.Send(message); + } + +void COmxILFileSinkProcessingFunction::CPFHelper::StopSync() + { + // Cancel to process the existing queue before handling this command + Cancel(); + iFileSinkAccess.Stop(); + + // setup for next callbacks + SetActive(); + iMsgQueue.NotifyDataAvailable(iStatus); + } + +TInt COmxILFileSinkProcessingFunction::CPFHelper::IdleAsync() + { + TProcMessage message; + message.iType = EIdleCommand; + return iMsgQueue.Send(message); + } +/** + Converts a Symbian error code to an OpenMAX error code. + @param aError The Symbian error code. + @return The OpenMAX error code. + */ +OMX_ERRORTYPE COmxILFileSinkProcessingFunction::CPFHelper::ConvertSymbianErrorType(TInt aError) + { + // In the current implementation this function is only used for the return code in the + // callback methods. Currently the only expected errors KErrNone and KErrOverflow. + + OMX_ERRORTYPE err = OMX_ErrorNone; + switch (aError) + { + case KErrNone: + err = OMX_ErrorNone; + break; + case KErrOverflow: + case KErrNoMemory: + err = OMX_ErrorInsufficientResources; + break; + case KErrNotSupported: + err = OMX_ErrorNotImplemented; + break; + case KErrNotReady: + err = OMX_ErrorNotReady; + break; + case KErrGeneral: + default: + err = OMX_ErrorUndefined; + } + return err; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesink/src/omxilimagefilesink.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesink/src/omxilimagefilesink.rss Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,43 @@ +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + + + +#include +#include +#include "omxilfilesink.hrh" + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = KUidNokiaOmxILImageFileSinkDll; + interfaces = + { + INTERFACE_INFO + { + interface_uid = KUidOmxILSymbianComponentIf; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KUidNokiaOmxILImageFileSink; + version_no = 1; + display_name = "OMX.NOKIA.IMAGE.FILESINK"; + default_data = "image_writer.binary"; + } + }; + } + }; + } + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesink/src/omxilimagefilesinkopb0port.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesink/src/omxilimagefilesinkopb0port.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,105 @@ +// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + + + +/** + * @file + * @internalTechnology + */ + +#include "omxilimagefilesinkopb0port.h" +#include "omxilfilesinkprocessingfunction.h" +#include + +COmxILImageFileSinkOPB0Port* COmxILImageFileSinkOPB0Port::NewL(const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedImageFormats, + const RArray& aSupportedColorFormats, + const COmxILFileSinkProcessingFunction& aFileSinkPF) + { + COmxILImageFileSinkOPB0Port* self = new (ELeave) COmxILImageFileSinkOPB0Port(aCommonPortData, + aSupportedImageFormats, + aSupportedColorFormats, + aFileSinkPF); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +void COmxILImageFileSinkOPB0Port::ConstructL() + { + iParamPortDefinition.eDomain = OMX_PortDomainImage; + } + +COmxILImageFileSinkOPB0Port::COmxILImageFileSinkOPB0Port(const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedImageFormats, + const RArray& aSupportedColorFormats, + const COmxILFileSinkProcessingFunction& aFileSinkPF) + : COmxILImagePort(aCommonPortData, aSupportedImageFormats, aSupportedColorFormats), + iFileSinkPF(aFileSinkPF) + { + } + +COmxILImageFileSinkOPB0Port::~COmxILImageFileSinkOPB0Port() + { + CleanUpPort(); + } + +OMX_ERRORTYPE COmxILImageFileSinkOPB0Port::GetLocalOmxParamIndexes(RArray& aIndexArray) const + { + return COmxILImagePort::GetLocalOmxParamIndexes(aIndexArray); + } + +OMX_ERRORTYPE COmxILImageFileSinkOPB0Port::GetLocalOmxConfigIndexes(RArray& aIndexArray) const + { + return COmxILImagePort::GetLocalOmxConfigIndexes(aIndexArray); + } + +OMX_ERRORTYPE COmxILImageFileSinkOPB0Port::GetParameter(OMX_INDEXTYPE aParamIndex, + TAny* apComponentParameterStructure) const + { + return COmxILImagePort::GetParameter(aParamIndex, apComponentParameterStructure); + } + +OMX_ERRORTYPE COmxILImageFileSinkOPB0Port::SetParameter(OMX_INDEXTYPE aParamIndex, + const TAny* apComponentParameterStructure, + TBool& aUpdateProcessingFunction) + { + return COmxILImagePort::SetParameter(aParamIndex, + apComponentParameterStructure, + aUpdateProcessingFunction); + } + +OMX_ERRORTYPE COmxILImageFileSinkOPB0Port::SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, + TBool& /*aUpdateProcessingFunction*/) + { + iParamPortDefinition.format.image = aPortDefinition.format.image; + return OMX_ErrorNone; + } + +TBool COmxILImageFileSinkOPB0Port::IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const + { + if(aPortDefinition.eDomain != iParamPortDefinition.eDomain) + { + return EFalse; + } + + if (aPortDefinition.format.image.eCompressionFormat == OMX_IMAGE_CodingMax) + { + return EFalse; + } + return ETrue; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesink/src/omxilotherfilesink.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesink/src/omxilotherfilesink.rss Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,43 @@ +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + + + +#include +#include +#include "omxilfilesink.hrh" + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = KUidSymbianOmxIOtherLFileSinkDll; + interfaces = + { + INTERFACE_INFO + { + interface_uid = KUidOmxILSymbianComponentIf; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KUidSymbianOmxILOtherFileSink; + version_no = 1; + display_name = "OMX.NOKIA.OTHER.FILESINK"; + default_data = "other_writer.binary"; + } + }; + } + }; + } + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesink/src/omxilotherfilesinkopb0port.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesink/src/omxilotherfilesinkopb0port.cpp Fri May 07 16:25:23 2010 +0100 @@ -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 + * @internalTechnology + */ + +#include "omxilotherfilesinkopb0port.h" +#include "omxilfilesinkprocessingfunction.h" +#include + +COmxILOtherFileSinkOPB0Port* COmxILOtherFileSinkOPB0Port::NewL(const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedOtherFormats, + const COmxILFileSinkProcessingFunction& aFileSinkPF) + { + COmxILOtherFileSinkOPB0Port* self = new (ELeave) COmxILOtherFileSinkOPB0Port(aCommonPortData, aFileSinkPF); + CleanupStack::PushL(self); + self->ConstructL(aSupportedOtherFormats); + CleanupStack::Pop(self); + return self; + } + +void COmxILOtherFileSinkOPB0Port::ConstructL(const RArray& aSupportedOtherFormats) + { + iParamPortDefinition.eDomain = OMX_PortDomainOther; + iParamPortDefinition.format.other.eFormat = OMX_OTHER_FormatBinary; + + // base + COmxILOtherPort::ConstructL(aSupportedOtherFormats); + } + +COmxILOtherFileSinkOPB0Port::COmxILOtherFileSinkOPB0Port(const TOmxILCommonPortData& aCommonPortData, + const COmxILFileSinkProcessingFunction& aFileSinkPF) + : COmxILOtherPort(aCommonPortData), + iFileSinkPF(aFileSinkPF) + { + } + +COmxILOtherFileSinkOPB0Port::~COmxILOtherFileSinkOPB0Port() + { + CleanUpPort(); + } + +OMX_ERRORTYPE COmxILOtherFileSinkOPB0Port::GetLocalOmxParamIndexes(RArray& aIndexArray) const + { + return COmxILOtherPort::GetLocalOmxParamIndexes(aIndexArray); + } + +OMX_ERRORTYPE COmxILOtherFileSinkOPB0Port::GetLocalOmxConfigIndexes(RArray& aIndexArray) const + { + return COmxILOtherPort::GetLocalOmxConfigIndexes(aIndexArray); + } + +OMX_ERRORTYPE COmxILOtherFileSinkOPB0Port::GetParameter(OMX_INDEXTYPE aParamIndex, + TAny* apComponentParameterStructure) const + { + return COmxILOtherPort::GetParameter(aParamIndex, apComponentParameterStructure); + } + +OMX_ERRORTYPE COmxILOtherFileSinkOPB0Port::SetParameter(OMX_INDEXTYPE aParamIndex, + const TAny* apComponentParameterStructure, + TBool& aUpdateProcessingFunction) + { + return COmxILOtherPort::SetParameter(aParamIndex, + apComponentParameterStructure, + aUpdateProcessingFunction); + } + +OMX_ERRORTYPE COmxILOtherFileSinkOPB0Port::SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, + TBool& /*aUpdateProcessingFunction*/) + { + iParamPortDefinition.format.other = aPortDefinition.format.other; + return OMX_ErrorNone; + } + +TBool COmxILOtherFileSinkOPB0Port::IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const + { + if(aPortDefinition.eDomain != iParamPortDefinition.eDomain) + { + return EFalse; + } + + if (aPortDefinition.format.other.eFormat == OMX_OTHER_FormatMax) + { + return EFalse; + } + + return ETrue; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesink/src/omxilvideofilesink.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesink/src/omxilvideofilesink.rss Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,43 @@ +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + + + +#include +#include +#include "omxilfilesink.hrh" + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = KUidNokiaOmxILVideoFileSinkDll; + interfaces = + { + INTERFACE_INFO + { + interface_uid = KUidOmxILSymbianComponentIf; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KUidNokiaOmxILVideoFileSink; + version_no = 1; + display_name = "OMX.NOKIA.VIDEO.FILESINK"; + default_data = "video_writer.binary"; + } + }; + } + }; + } + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesink/src/omxilvideofilesinkopb0port.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesink/src/omxilvideofilesinkopb0port.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,105 @@ +// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + + + +/** + * @file + * @internalTechnology + */ + +#include "omxilvideofilesinkopb0port.h" +#include "omxilfilesinkprocessingfunction.h" +#include + +COmxILVideoFileSinkOPB0Port* COmxILVideoFileSinkOPB0Port::NewL(const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedCodings, + const RArray& aSupportedColourFormats, + const COmxILFileSinkProcessingFunction& aFileSinkPF) + { + COmxILVideoFileSinkOPB0Port* self = new (ELeave) COmxILVideoFileSinkOPB0Port(aCommonPortData, + aSupportedCodings, + aSupportedColourFormats, + aFileSinkPF); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +void COmxILVideoFileSinkOPB0Port::ConstructL() + { + iParamPortDefinition.eDomain = OMX_PortDomainVideo; + } + +COmxILVideoFileSinkOPB0Port::COmxILVideoFileSinkOPB0Port(const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedCodings, + const RArray& aSupportedColourFormats, + const COmxILFileSinkProcessingFunction& aFileSinkPF) + : COmxILVideoPort(aCommonPortData, aSupportedCodings, aSupportedColourFormats), + iFileSinkPF(aFileSinkPF) + { + } + +COmxILVideoFileSinkOPB0Port::~COmxILVideoFileSinkOPB0Port() + { + CleanUpPort(); + } + +OMX_ERRORTYPE COmxILVideoFileSinkOPB0Port::GetLocalOmxParamIndexes(RArray& aIndexArray) const + { + return COmxILVideoPort::GetLocalOmxParamIndexes(aIndexArray); + } + +OMX_ERRORTYPE COmxILVideoFileSinkOPB0Port::GetLocalOmxConfigIndexes(RArray& aIndexArray) const + { + return COmxILVideoPort::GetLocalOmxConfigIndexes(aIndexArray); + } + +OMX_ERRORTYPE COmxILVideoFileSinkOPB0Port::GetParameter(OMX_INDEXTYPE aParamIndex, + TAny* apComponentParameterStructure) const + { + return COmxILVideoPort::GetParameter(aParamIndex, apComponentParameterStructure); + } + +OMX_ERRORTYPE COmxILVideoFileSinkOPB0Port::SetParameter(OMX_INDEXTYPE aParamIndex, + const TAny* apComponentParameterStructure, + TBool& aUpdateProcessingFunction) + { + return COmxILVideoPort::SetParameter(aParamIndex, + apComponentParameterStructure, + aUpdateProcessingFunction); + } + +OMX_ERRORTYPE COmxILVideoFileSinkOPB0Port::SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, + TBool& /*aUpdateProcessingFunction*/) + { + iParamPortDefinition.format.video = aPortDefinition.format.video; + return OMX_ErrorNone; + } + +TBool COmxILVideoFileSinkOPB0Port::IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const + { + if(aPortDefinition.eDomain != iParamPortDefinition.eDomain) + { + return EFalse; + } + + if (aPortDefinition.format.video.eCompressionFormat == OMX_VIDEO_CodingMax) + { + return EFalse; + } + return ETrue; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesink/tests/khronos_conformance/Khronos_file_sink_audio.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesink/tests/khronos_conformance/Khronos_file_sink_audio.txt Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,87 @@ +;; cc : conformance test component (sets appropriate flags, adds all tests, tests component) +;; st : OMX_CONF_SetTraceflags(); +;; ol : OMX_OSAL_OpenLogfile(); +;; cl : OMX_OSAL_CloseLogfile(); +;; at : OMX_CONF_AddTest(); +;; rt : OMX_CONF_RemoveTest(); +;; mi : OMX_CONF_MapInputfile(,); +;; tc : OMX_CONF_TestComponent(); +;; ps: OMX_CONF_PrintSettings(); +;; h: OMX_CONF_PrintHelp(); +;; lt: list all available tests. +;; lc: list all available components. + + +; setup tracing, open logfile +st 0x7F ; (OMX_OSAL_TRACE_PASSFAIL|OMX_OSAL_TRACE_CALLSEQUENCE|OMX_OSAL_TRACE_PARAMTERS|OMX_OSAL_TRACE_INFO|OMX_OSAL_TRACE_ERROR|OMX_OSAL_TRACE_BUFFER|OMX_OSAL_TRACE_WARNING) +ol c:\file_sink_audio_output.txt + +; add tests + +; Base Profile Tests + +;; ============ +;; Passed tests +;; vvvvvvvvvvvv +at StateTransitionTest +at ComponentNameTest +at BaseParameterTest +at BufferTest +at BufferFlagTest +at FlushTest +at BaseMultiThreadedTest +at PortCommunicationTest +at ResourceExhaustionTest +;; ^^^^^^^^^^^^ +;; Passed tests +;; ============ + + + +; Interop Profile Tests + + +;; ============ +;; Passed tests +;; vvvvvvvvvvvv +at InteropParameterTest +at ValidInputOutputTest +at InvalidInputOutputTest +at PortBufferSupplierTest +at PortDisableEnableTest +at IncompleteStopTest +at MinPayloadSizeTest +at InteropMultiThreadedTest +at TunnelledUnitTest +;; ^^^^^^^^^^^^ +;; Passed tests +;; ============ + + + +;; Problem Resource Manager : Functionality not existent +; at ResourcePreemptionTest +; at WaitForResourcesTest + +;; Non-applicable tests +; at ClockComponentTest +; at SeekingComponentTest + +; Standard Component Class Tests + +;; ============ +;; Passed tests +;; vvvvvvvvvvvv +at StdBinaryAudioWriterTest +;; ^^^^^^^^^^^^ +;; Passed tests +;; ============ + +mi c:\aac.stream 0 + +; test components +tc OMX.NOKIA.AUDIO.FILESINK + + +; close logfile +cl diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesink/tests/khronos_conformance/Khronos_file_sink_image.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesink/tests/khronos_conformance/Khronos_file_sink_image.txt Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,87 @@ +;; cc : conformance test component (sets appropriate flags, adds all tests, tests component) +;; st : OMX_CONF_SetTraceflags(); +;; ol : OMX_OSAL_OpenLogfile(); +;; cl : OMX_OSAL_CloseLogfile(); +;; at : OMX_CONF_AddTest(); +;; rt : OMX_CONF_RemoveTest(); +;; mi : OMX_CONF_MapInputfile(,); +;; tc : OMX_CONF_TestComponent(); +;; ps: OMX_CONF_PrintSettings(); +;; h: OMX_CONF_PrintHelp(); +;; lt: list all available tests. +;; lc: list all available components. + + +; setup tracing, open logfile +st 0x7F ; (OMX_OSAL_TRACE_PASSFAIL|OMX_OSAL_TRACE_CALLSEQUENCE|OMX_OSAL_TRACE_PARAMTERS|OMX_OSAL_TRACE_INFO|OMX_OSAL_TRACE_ERROR|OMX_OSAL_TRACE_BUFFER|OMX_OSAL_TRACE_WARNING) +ol c:\file_sink_image_output.txt + +; add tests + +; Base Profile Tests + +;; ============ +;; Passed tests +;; vvvvvvvvvvvv +at StateTransitionTest +at ComponentNameTest +at BaseParameterTest +at BufferTest +at BufferFlagTest +at FlushTest +at BaseMultiThreadedTest +at PortCommunicationTest +at ResourceExhaustionTest +;; ^^^^^^^^^^^^ +;; Passed tests +;; ============ + + + +; Interop Profile Tests + + +;; ============ +;; Passed tests +;; vvvvvvvvvvvv +at InteropParameterTest +at ValidInputOutputTest +at InvalidInputOutputTest +at PortBufferSupplierTest +at PortDisableEnableTest +at IncompleteStopTest +at MinPayloadSizeTest +at InteropMultiThreadedTest +at TunnelledUnitTest +;; ^^^^^^^^^^^^ +;; Passed tests +;; ============ + + + +;; Problem Resource Manager : Functionality not existent +; at ResourcePreemptionTest +; at WaitForResourcesTest + +;; Non-applicable tests +; at ClockComponentTest +; at SeekingComponentTest + +; Standard Component Class Tests + +;; ============ +;; Passed tests +;; vvvvvvvvvvvv +at StdBinaryImageWriterTest +;; ^^^^^^^^^^^^ +;; Passed tests +;; ============ + + +mi c:\aac.stream 0 + +; test components +tc OMX.NOKIA.IMAGE.FILESINK + +; close logfile +cl diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesink/tests/khronos_conformance/Khronos_file_sink_other.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesink/tests/khronos_conformance/Khronos_file_sink_other.txt Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,86 @@ +;; cc : conformance test component (sets appropriate flags, adds all tests, tests component) +;; st : OMX_CONF_SetTraceflags(); +;; ol : OMX_OSAL_OpenLogfile(); +;; cl : OMX_OSAL_CloseLogfile(); +;; at : OMX_CONF_AddTest(); +;; rt : OMX_CONF_RemoveTest(); +;; mi : OMX_CONF_MapInputfile(,); +;; tc : OMX_CONF_TestComponent(); +;; ps: OMX_CONF_PrintSettings(); +;; h: OMX_CONF_PrintHelp(); +;; lt: list all available tests. +;; lc: list all available components. + + +; setup tracing, open logfile +st 0x7F ; (OMX_OSAL_TRACE_PASSFAIL|OMX_OSAL_TRACE_CALLSEQUENCE|OMX_OSAL_TRACE_PARAMTERS|OMX_OSAL_TRACE_INFO|OMX_OSAL_TRACE_ERROR|OMX_OSAL_TRACE_BUFFER|OMX_OSAL_TRACE_WARNING) +ol c:\file_sink_other_output.txt + +; add tests + +; Base Profile Tests + +;; ============ +;; Passed tests +;; vvvvvvvvvvvv +at StateTransitionTest +at ComponentNameTest +at BaseParameterTest +at BufferTest +at BufferFlagTest +at FlushTest +at BaseMultiThreadedTest +at PortCommunicationTest +at ResourceExhaustionTest +;; ^^^^^^^^^^^^ +;; Passed tests +;; ============ + + + +; Interop Profile Tests + + +;; ============ +;; Passed tests +;; vvvvvvvvvvvv +at InteropParameterTest +at ValidInputOutputTest +at InvalidInputOutputTest +at PortBufferSupplierTest +at PortDisableEnableTest +at IncompleteStopTest +at MinPayloadSizeTest +at InteropMultiThreadedTest +at TunnelledUnitTest +;; ^^^^^^^^^^^^ +;; Passed tests +;; ============ + + + +;; Problem Resource Manager : Functionality not existent +; at ResourcePreemptionTest +; at WaitForResourcesTest + +;; Non-applicable tests +; at ClockComponentTest +; at SeekingComponentTest + +; Standard Component Class Tests + +;; ============ +;; Passed tests +;; vvvvvvvvvvvv +at StdWriterTest +;; ^^^^^^^^^^^^ +;; Passed tests +;; ============ + +mi c:\aac.stream 0 + +; test components +tc OMX.NOKIA.OTHER.FILESINK + +; close logfile +cl diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesink/tests/khronos_conformance/Khronos_file_sink_video.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesink/tests/khronos_conformance/Khronos_file_sink_video.txt Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,87 @@ +;; cc : conformance test component (sets appropriate flags, adds all tests, tests component) +;; st : OMX_CONF_SetTraceflags(); +;; ol : OMX_OSAL_OpenLogfile(); +;; cl : OMX_OSAL_CloseLogfile(); +;; at : OMX_CONF_AddTest(); +;; rt : OMX_CONF_RemoveTest(); +;; mi : OMX_CONF_MapInputfile(,); +;; tc : OMX_CONF_TestComponent(); +;; ps: OMX_CONF_PrintSettings(); +;; h: OMX_CONF_PrintHelp(); +;; lt: list all available tests. +;; lc: list all available components. + + +; setup tracing, open logfile +st 0x7F ; (OMX_OSAL_TRACE_PASSFAIL|OMX_OSAL_TRACE_CALLSEQUENCE|OMX_OSAL_TRACE_PARAMTERS|OMX_OSAL_TRACE_INFO|OMX_OSAL_TRACE_ERROR|OMX_OSAL_TRACE_BUFFER|OMX_OSAL_TRACE_WARNING) +ol c:\file_sink_video_output.txt + +; add tests + +; Base Profile Tests + +;; ============ +;; Passed tests +;; vvvvvvvvvvvv +at StateTransitionTest +at ComponentNameTest +at BaseParameterTest +at BufferTest +at BufferFlagTest +at FlushTest +at BaseMultiThreadedTest +at PortCommunicationTest +at ResourceExhaustionTest +;; ^^^^^^^^^^^^ +;; Passed tests +;; ============ + + + +; Interop Profile Tests + + +;; ============ +;; Passed tests +;; vvvvvvvvvvvv +at InteropParameterTest +at ValidInputOutputTest +at InvalidInputOutputTest +at PortBufferSupplierTest +at PortDisableEnableTest +at IncompleteStopTest +at MinPayloadSizeTest +at InteropMultiThreadedTest +at TunnelledUnitTest +;; ^^^^^^^^^^^^ +;; Passed tests +;; ============ + + + +;; Problem Resource Manager : Functionality not existent +; at ResourcePreemptionTest +; at WaitForResourcesTest + +;; Non-applicable tests +; at ClockComponentTest +; at SeekingComponentTest + +; Standard Component Class Tests + +;; ============ +;; Passed tests +;; vvvvvvvvvvvv +at StdBinaryVideoWriterTest +;; ^^^^^^^^^^^^ +;; Passed tests +;; ============ + +mi c:\aac.stream 0 + +; test components +tc OMX.NOKIA.VIDEO.FILESINK + + +; close logfile +cl diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesink/tests/khronos_conformance/aac.stream Binary file omxil/generic/omxilfilesink/tests/khronos_conformance/aac.stream has changed diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesink/tests/khronos_conformance/aac.stream.length --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesink/tests/khronos_conformance/aac.stream.length Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,247 @@ +0 +0 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 +1600 diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesink/tests/unittest/te_omx_filesinksrc.script --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesink/tests/unittest/te_omx_filesinksrc.script Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,29 @@ +// +// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + + + +LOAD_SUITE te_xmlomxclient + +START_TESTCASE MM-AUDIO-OMX-FILESINKSRC-001-HP + START_TEST_BLOCK 30 te_xmlomxclient c:\te_xmlomxclient.ini + CREATE_OBJECT OmxXmlTestWrapper InstanceName + COMMAND InstanceName New c:\te_omx_filesinksrc.xml + COMMAND InstanceName RunTest Testcase1 + END_TEST_BLOCK +END_TESTCASE MM-AUDIO-OMX-FILESINKSRC-001-HP + + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesink/tests/unittest/te_omx_filesinksrc.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesink/tests/unittest/te_omx_filesinksrc.xml Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesource/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesource/group/bld.inf Fri May 07 16:25:23 2010 +0100 @@ -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: +// + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +PRJ_EXPORTS + +omxilotherfilesource.iby /epoc32/rom/include/omxilotherfilesource.iby +omxilaudiofilesource.iby /epoc32/rom/include/omxilaudiofilesource.iby +omxilvideofilesource.iby /epoc32/rom/include/omxilvideofilesource.iby +omxilimagefilesource.iby /epoc32/rom/include/omxilimagefilesource.iby + +PRJ_MMPFILES +../mmpfiles/omxilotherfilesource.mmp +../mmpfiles/omxilaudiofilesource.mmp +../mmpfiles/omxilimagefilesource.mmp +../mmpfiles/omxilvideofilesource.mmp \ No newline at end of file diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesource/group/omxilaudiofilesource.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesource/group/omxilaudiofilesource.iby Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef OMXILAUDIOFILESOURCE_IBY_ +#define OMXILAUDIOFILESOURCE_IBY_ + +#include + +ECOM_PLUGIN(omxilaudiofilesource.dll, omxilaudiofilesource.rsc) + +#endif /*OMXILAUDIOFILESOURCE_IBY_*/ \ No newline at end of file diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesource/group/omxilimagefilesource.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesource/group/omxilimagefilesource.iby Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef OMXILIMAGEFILESOURCE_IBY_ +#define OMXILIMAGEFILESOURCE_IBY_ + +#include + +ECOM_PLUGIN(omxilimagefilesource.dll, omxilimagefilesource.rsc) + +#endif /*OMXILIMAGEFILESOURCE_IBY_*/ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesource/group/omxilotherfilesource.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesource/group/omxilotherfilesource.iby Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef OMXILFILESOURCE_IBY_ +#define OMXILFILESOURCE_IBY_ + +#include + +ECOM_PLUGIN(omxilfilesource.dll, omxilfilesource.rsc) + +#endif /*OMXILFILESOURCE_IBY_*/ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesource/group/omxilvideofilesource.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesource/group/omxilvideofilesource.iby Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef OMXILVIDEOFILESOURCE_IBY_ +#define OMXILVIDEOFILESOURCE_IBY_ + +#include + +ECOM_PLUGIN(omxilvideofilesource.dll, omxilvideofilesource.rsc) + +#endif /*OMXILVIDEOFILESOURCE_IBY_*/ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesource/inc/omxilaudiofilesourceopb0port.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesource/inc/omxilaudiofilesourceopb0port.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,59 @@ +// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + + + +/** + * @file + * @internalTechnology + */ + +#ifndef OMXILAUDIOFILESOURCEOPB0PORT_H +#define OMXILAUDIOFILESOURCEOPB0PORT_H + +#include "omxilaudioport.h" +#include "omxilfilesourceprocessingfunction.h" +#include + +class COmxILAudioFileSourceOPB0Port : public COmxILAudioPort + { +public: + static COmxILAudioFileSourceOPB0Port* NewL(const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedAudioFormats, + const COmxILFileSourceProcessingFunction& aFileSourcePF); + ~COmxILAudioFileSourceOPB0Port(); + + OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray& aIndexArray) const; + OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray& aIndexArray) const; + + OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex, + TAny* apComponentParameterStructure) const; + OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex, + const TAny* apComponentParameterStructure, + TBool& aUpdateProcessingFunction); + +private: + COmxILAudioFileSourceOPB0Port(const TOmxILCommonPortData& aCommonPortData, + const COmxILFileSourceProcessingFunction& aFileSourcePF); + void ConstructL(const RArray& aSupportedAudioFormats); + OMX_ERRORTYPE SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, + TBool& aUpdateProcessingFunction); + TBool IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const; + +private: + const COmxILFileSourceProcessingFunction& iFileSourcePF; + }; + +#endif // OMXILAUDIOFILESOURCEOPB0PORT_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesource/inc/omxilfilesource.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesource/inc/omxilfilesource.h Fri May 07 16:25:23 2010 +0100 @@ -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 + * @internalTechnology + */ + +#ifndef OMXILFILESOURCE_H +#define OMXILFILESOURCE_H + +#include "omxilcomponent.h" + +class COmxILPort; +class COmxILFileSourceProcessingFunction; + +NONSHARABLE_CLASS(COmxILFileSource) : public COmxILComponent + { +public: + static void CreateComponentL(OMX_HANDLETYPE aComponent); + ~COmxILFileSource(); + +private: + COmxILFileSource(); + void ConstructL(OMX_HANDLETYPE aComponent); + COmxILPort* ConstructOPB0PortL() const; + +private: + COmxILPort* iOPB0Port; + COmxILFileSourceProcessingFunction* ipProcessingFunction; + }; + +#endif // OMXILFILESOURCE_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesource/inc/omxilfilesource.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesource/inc/omxilfilesource.hrh Fri May 07 16:25:23 2010 +0100 @@ -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 OMXILFILESOURCE_HRH_ +#define OMXILFILESOURCE_HRH_ + + +#define KUidNokiaOmxILAudioFileSourceDll 0x2002EAAA +#define KUidNokiaOmxILAudioFileSource 0x2002EAAB + +#define KUidNokiaOmxILVideoFileSourceDll 0x2002EAAC +#define KUidNokiaOmxILVideoFileSource 0x2002EAAD + +#define KUidNokiaOmxILImageFileSourceDll 0x2002EAAE +#define KUidNokiaOmxILImageFileSource 0x2002EAAF + +#define KUidNokiaOmxILOtherFileSourceDll 0x2002EAB0 +#define KUidNokiaOmxILOtherFileSource 0x2002EAB1 + +#endif /*OMXILFILESOURCE_HRH_*/ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesource/inc/omxilfilesourceconfigmanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesource/inc/omxilfilesourceconfigmanager.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,53 @@ +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + + + +/** + * @file + * @internalTechnology + */ + +#ifndef OMXILFILESOURCECONFIGMANAGER_H +#define OMXILFILESOURCECONFIGMANAGER_H + +#include "omxilconfigmanager.h" + +class COmxILFileSourceProcessingFunction; + +NONSHARABLE_CLASS(COmxILFileSourceConfigManager) : public COmxILConfigManager + { +public: + static COmxILFileSourceConfigManager* NewL( + MOmxILPortManagerIf& aPortManager, + const TDesC8& aComponentName, + const OMX_VERSIONTYPE& aComponentVersion, + const RPointerArray& aComponentRoleList, + COmxILFileSourceProcessingFunction& aFileSourcePF); + + ~COmxILFileSourceConfigManager(); + + OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex, TAny* apComponentParameterStructure) const; + OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex, const TAny* apComponentParameterStructure, OMX_BOOL aInitTime = OMX_TRUE); + +private: + COmxILFileSourceConfigManager(MOmxILPortManagerIf& aPortManager, COmxILFileSourceProcessingFunction& aFileSourcePF); + void ConstructL(const TDesC8& aComponentName, const OMX_VERSIONTYPE& aComponentVersion, const RPointerArray& aComponentRoleList); + +private: + COmxILFileSourceProcessingFunction& iFileSourcePF; + }; + +#endif // OMXILFILESOURCECONFIGMANAGER_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesource/inc/omxilfilesourceopb0port.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesource/inc/omxilfilesourceopb0port.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,59 @@ +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + + + +/** + * @file + * @internalTechnology + */ + +#ifndef OMXILFILESOURCEOPB0PORT_H +#define OMXILFILESOURCEOPB0PORT_H + +#include "omxilotherport.h" +#include "omxilfilesourceprocessingfunction.h" +#include + +class COmxILOtherFileSourceOPB0Port : public COmxILOtherPort + { +public: + static COmxILOtherFileSourceOPB0Port* NewL(const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedOtherFormats, + const COmxILFileSourceProcessingFunction& aFileSourcePF); + ~COmxILOtherFileSourceOPB0Port(); + + OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray& aIndexArray) const; + OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray& aIndexArray) const; + + OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex, + TAny* apComponentParameterStructure) const; + OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex, + const TAny* apComponentParameterStructure, + TBool& aUpdateProcessingFunction); + +private: + COmxILOtherFileSourceOPB0Port(const TOmxILCommonPortData& aCommonPortData, + const COmxILFileSourceProcessingFunction& aFileSourcePF); + void ConstructL(const RArray& aSupportedOtherFormats); + OMX_ERRORTYPE SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, + TBool& aUpdateProcessingFunction); + TBool IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const; + +private: + const COmxILFileSourceProcessingFunction& iFileSourcePF; + }; + +#endif // OMXILFILESOURCEOPB0PORT_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesource/inc/omxilfilesourceprocessingfunction.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesource/inc/omxilfilesourceprocessingfunction.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,150 @@ +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + + + +/** + * @file + * @internalTechnology + */ + +#ifndef OMXILFILESOURCEPROCESSINGFUNCTION_H +#define OMXILFILESOURCEPROCESSINGFUNCTION_H + +#include "omxilprocessingfunction.h" +#include +#include +#include + + +class COmxILFileSourceProcessingFunction : public COmxILProcessingFunction + { +public: + static COmxILFileSourceProcessingFunction* NewL(MOmxILCallbackNotificationIf& aCallbacks); + ~COmxILFileSourceProcessingFunction(); + + OMX_ERRORTYPE StateTransitionIndication(COmxILFsm::TStateIndex aNewState); + OMX_ERRORTYPE BufferFlushingIndication(TUint32 aPortIndex, OMX_DIRTYPE aDirection); + OMX_ERRORTYPE ParamIndication(OMX_INDEXTYPE aParamIndex, const TAny* apComponentParameterStructure); + OMX_ERRORTYPE ConfigIndication(OMX_INDEXTYPE aConfigIndex, const TAny* apComponentConfigStructure); + OMX_ERRORTYPE BufferIndication(OMX_BUFFERHEADERTYPE* apBufferHeader, OMX_DIRTYPE aDirection); + OMX_BOOL BufferRemovalIndication(OMX_BUFFERHEADERTYPE* apBufferHeader, OMX_DIRTYPE aDirection); + + MOmxILCallbackNotificationIf& GetCallbacks(); + + /** can return NULL if parameter has not been set. */ + const HBufC* FileName() const; + const HBufC8* Uri() const; + +private: + COmxILFileSourceProcessingFunction(MOmxILCallbackNotificationIf& aCallbacks); + void ConstructL(); + + void InitFileAndUriL(); + OMX_ERRORTYPE SetFileName(const OMX_PARAM_CONTENTURITYPE* aContentUriType); + +private: + RPointerArray iBuffersToFill; + OMX_STATETYPE iState; + HBufC8* iUri; + HBufC* iFileName; + +private: + class CPFHelper; + class CFileSourceAccess : public CActive + { + friend class CPFHelper; + public: + static CFileSourceAccess* NewL(COmxILFileSourceProcessingFunction& aParent); + ~CFileSourceAccess(); + + // from CActive + void RunL(); + void DoCancel(); + + TInt Execute(); + void Pause(); + void Stop(); + void Idle(); + + TInt ProcessNextBuffer(); + + private: + CFileSourceAccess(COmxILFileSourceProcessingFunction& aParent); + void ConstructL(); + + private: + COmxILFileSourceProcessingFunction& iParent; + OMX_BUFFERHEADERTYPE* iCurrentBuffer; + + RFs iFs; + RFile iFileHandle; + TInt iBufferOffset; + TPtr8 iReadBuffer; + + } *iFileSourceAccess; + + class CPFHelper : public CActive + { + public: + static CPFHelper* NewL(COmxILFileSourceProcessingFunction& aParent, CFileSourceAccess& aFileSourceAccess); + ~CPFHelper(); + + static OMX_ERRORTYPE ConvertSymbianErrorType(TInt aError); + + // from CActive + void RunL(); + void DoCancel(); + + TInt ExecuteAsync(); + TInt StopAsync(); + TInt PauseAsync(); + void StopSync(); + TInt IdleAsync(); + TInt BufferIndication(OMX_BUFFERHEADERTYPE* apBufferHeader); + + enum TMessageType + { + EExecuteCommand, + EStopCommand, + EPauseCommand, + ECancelCommand, + EBufferIndication, + EIdleCommand + }; + + class TProcMessage + { + public: + TMessageType iType; + TAny* iPtr; + }; + + RMsgQueue iMsgQueue; + + private: + CPFHelper(COmxILFileSourceProcessingFunction& aParent, CFileSourceAccess& aFileSourceAccess); + void ConstructL(); + + TInt ProcessQueue(); + + private: + COmxILFileSourceProcessingFunction& iParent; + CFileSourceAccess& iFileSourceAccess; + } *iPFHelper; + }; + +#endif // OMXILFILESOURCEPROCESSINGFUNCTION_H + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesource/inc/omxilimagefilesourceopb0port.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesource/inc/omxilimagefilesourceopb0port.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,63 @@ +// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + + + +/** + * @file + * @internalTechnology + */ + +#ifndef OMXILIMAGEFILESOURCEOPB0PORT_H +#define OMXILIMAGEFILESOURCEOPB0PORT_H + +#include "omxilimageport.h" +#include "omxilfilesourceprocessingfunction.h" +#include + +class COmxILImageFileSourceOPB0Port : public COmxILImagePort + { +public: + static COmxILImageFileSourceOPB0Port* NewL(const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedImageFormats, + const RArray& aSupportedColorFormats, + const COmxILFileSourceProcessingFunction& aFileSourcePF); + + ~COmxILImageFileSourceOPB0Port(); + + OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray& aIndexArray) const; + OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray& aIndexArray) const; + + OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex, + TAny* apComponentParameterStructure) const; + OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex, + const TAny* apComponentParameterStructure, + TBool& aUpdateProcessingFunction); + +private: + COmxILImageFileSourceOPB0Port(const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedImageFormats, + const RArray& aSupportedColorFormats, + const COmxILFileSourceProcessingFunction& aFileSourcePF); + void ConstructL(); + OMX_ERRORTYPE SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, + TBool& aUpdateProcessingFunction); + TBool IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const; + +private: + const COmxILFileSourceProcessingFunction& iFileSourcePF; + }; + +#endif // OMXILIMAGEFILESOURCEOPB0PORT_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesource/inc/omxilotherfilesourceopb0port.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesource/inc/omxilotherfilesourceopb0port.h Fri May 07 16:25:23 2010 +0100 @@ -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 OMXILFILESOURCEOPB0PORT_H +#define OMXILFILESOURCEOPB0PORT_H + +#include "omxilotherport.h" +#include "omxilfilesourceprocessingfunction.h" +#include + +class COmxILOtherFileSourceOPB0Port : public COmxILOtherPort + { +public: + static COmxILOtherFileSourceOPB0Port* NewL(const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedOtherFormats, + const COmxILFileSourceProcessingFunction& aFileSourcePF); + ~COmxILOtherFileSourceOPB0Port(); + + OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray& aIndexArray) const; + OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray& aIndexArray) const; + + OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex, + TAny* apComponentParameterStructure) const; + OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex, + const TAny* apComponentParameterStructure, + TBool& aUpdateProcessingFunction); + + +private: + COmxILOtherFileSourceOPB0Port(const TOmxILCommonPortData& aCommonPortData, + const COmxILFileSourceProcessingFunction& aFileSourcePF); + void ConstructL(const RArray& aSupportedOtherFormats); + OMX_ERRORTYPE SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, + TBool& aUpdateProcessingFunction); + TBool IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const; + +private: + const COmxILFileSourceProcessingFunction& iFileSourcePF; + }; + +#endif // OMXILFILESOURCEOPB0PORT_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesource/inc/omxilvideofilesourceopb0port.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesource/inc/omxilvideofilesourceopb0port.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,63 @@ +// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + + + +/** + * @file + * @internalTechnology + */ + +#ifndef OMXILVIDEOFILESOURCEOPB0PORT_H +#define OMXILVIDEOFILESOURCEOPB0PORT_H + +#include "omxilvideoport.h" +#include "omxilfilesourceprocessingfunction.h" +#include + +class COmxILVideoFileSourceOPB0Port : public COmxILVideoPort + { +public: + static COmxILVideoFileSourceOPB0Port* NewL(const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedCodings, + const RArray& aSupportedColourFormats, + const COmxILFileSourceProcessingFunction& aFileSourcePF); + + ~COmxILVideoFileSourceOPB0Port(); + + OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray& aIndexArray) const; + OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray& aIndexArray) const; + + OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex, + TAny* apComponentParameterStructure) const; + OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex, + const TAny* apComponentParameterStructure, + TBool& aUpdateProcessingFunction); + +private: + COmxILVideoFileSourceOPB0Port(const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedCodings, + const RArray& aSupportedColourFormats, + const COmxILFileSourceProcessingFunction& aFileSourcePF); + void ConstructL(); + OMX_ERRORTYPE SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, + TBool& aUpdateProcessingFunction); + TBool IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const; + +private: + const COmxILFileSourceProcessingFunction& iFileSourcePF; + }; + +#endif // OMXILVIDEOFILESOURCEOPB0PORT_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesource/mmpfiles/omxilaudiofilesource.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesource/mmpfiles/omxilaudiofilesource.mmp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,45 @@ +// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +MACRO OMXIL_AUDIO_FILESOURCE + +#include "../inc/omxilfilesource.hrh" + +TARGET omxilaudiofilesource.dll +CAPABILITY ALL -TCB // TODO restrict capabilities, as writing to file +TARGETTYPE PLUGIN +UID 0x10009D8D KUidNokiaOmxILAudioFileSourceDll +VENDORID 0x70000001 + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN + +USERINCLUDE ../../../omxilcomponentcommon/src/common +USERINCLUDE ../inc + +SOURCEPATH ../src + +SOURCE omxilfilesource.cpp +SOURCE omxilAudiofilesourceopb0port.cpp +SOURCE omxilfilesourceprocessingfunction.cpp +SOURCE omxilfilesourceconfigmanager.cpp + +RESOURCE omxilaudiofilesource.rss + +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY inetprotutil.lib +LIBRARY ecom.lib +LIBRARY omxilcomponentcommon.lib +STATICLIBRARY omxilcomponentif.lib diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesource/mmpfiles/omxilfilesource.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesource/mmpfiles/omxilfilesource.mmp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,46 @@ +// 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: +// + +MACRO OMXIL_OTHER_FILESOURCE + +#include "../inc/omxilfilesource.hrh" + +TARGET omxilfilesource.dll +CAPABILITY ALL -TCB // TODO restrict capabilities, as writing to file +TARGETTYPE PLUGIN +UID 0x10009D8D KUidNokiaOmxILFileSourceDll +VENDORID 0x70000001 + + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN + +USERINCLUDE ../../../omxilcomponentcommon/src/common +USERINCLUDE ../inc + +SOURCEPATH ../src + +SOURCE omxilfilesource.cpp +SOURCE omxilfilesourceopb0port.cpp +SOURCE omxilfilesourceprocessingfunction.cpp +SOURCE omxilfilesourceconfigmanager.cpp omxilaudiofilesourceopb0port.cpp omxilimagefilesourceopb0port.cpp omxilvideofilesourceopb0port.cpp + +RESOURCE omxilfilesource.rss + +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY inetprotutil.lib +LIBRARY ecom.lib +LIBRARY omxilcomponentcommon.lib +STATICLIBRARY omxilcomponentif.lib diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesource/mmpfiles/omxilimagefilesource.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesource/mmpfiles/omxilimagefilesource.mmp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,45 @@ +// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +MACRO OMXIL_IMAGE_FILESOURCE + +#include "../inc/omxilfilesource.hrh" + +TARGET omxilimagefilesource.dll +CAPABILITY ALL -TCB // TODO restrict capabilities, as writing to file +TARGETTYPE PLUGIN +UID 0x10009D8D KUidNokiaOmxILImageFileSourceDll +VENDORID 0x70000001 + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN + +USERINCLUDE ../../../omxilcomponentcommon/src/common +USERINCLUDE ../inc + +SOURCEPATH ../src + +SOURCE omxilfilesource.cpp +SOURCE omxilimagefilesourceopb0port.cpp +SOURCE omxilfilesourceprocessingfunction.cpp +SOURCE omxilfilesourceconfigmanager.cpp + +RESOURCE omxilimagefilesource.rss + +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY inetprotutil.lib +LIBRARY ecom.lib +LIBRARY omxilcomponentcommon.lib +STATICLIBRARY omxilcomponentif.lib diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesource/mmpfiles/omxilotherfilesource.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesource/mmpfiles/omxilotherfilesource.mmp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,46 @@ +// 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: +// + +MACRO OMXIL_OTHER_FILESOURCE + +#include "../inc/omxilfilesource.hrh" + +TARGET omxilotherfilesource.dll +CAPABILITY ALL -TCB // TODO restrict capabilities, as writing to file +TARGETTYPE PLUGIN +UID 0x10009D8D KUidNokiaOmxILOtherFileSourceDll +VENDORID 0x70000001 + + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN + +USERINCLUDE ../../../omxilcomponentcommon/src/common +USERINCLUDE ../inc + +SOURCEPATH ../src + +SOURCE omxilfilesource.cpp +SOURCE omxilfilesourceprocessingfunction.cpp +SOURCE omxilfilesourceconfigmanager.cpp +SOURCE omxilotherfilesourceopb0port.cpp + +RESOURCE omxilotherfilesource.rss + +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY inetprotutil.lib +LIBRARY ecom.lib +LIBRARY omxilcomponentcommon.lib +STATICLIBRARY omxilcomponentif.lib diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesource/mmpfiles/omxilvideofilesource.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesource/mmpfiles/omxilvideofilesource.mmp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,45 @@ +// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +MACRO OMXIL_VIDEO_FILESOURCE + +#include "../inc/omxilfilesource.hrh" + +TARGET omxilvideofilesource.dll +CAPABILITY ALL -TCB // TODO restrict capabilities, as writing to file +TARGETTYPE PLUGIN +UID 0x10009D8D KUidNokiaOmxILVideoFileSourceDll +VENDORID 0x70000001 + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN + +USERINCLUDE ../../../omxilcomponentcommon/src/common +USERINCLUDE ../inc + +SOURCEPATH ../src + +SOURCE omxilfilesource.cpp +SOURCE omxilvideofilesourceopb0port.cpp +SOURCE omxilfilesourceprocessingfunction.cpp +SOURCE omxilfilesourceconfigmanager.cpp + +RESOURCE omxilvideofilesource.rss + +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY inetprotutil.lib +LIBRARY ecom.lib +LIBRARY omxilcomponentcommon.lib +STATICLIBRARY omxilcomponentif.lib diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesource/src/omxilaudiofilesource.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesource/src/omxilaudiofilesource.rss Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,43 @@ +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + + + +#include +#include +#include "omxilfilesource.hrh" + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = KUidNokiaOmxILAudioFileSourceDll; + interfaces = + { + INTERFACE_INFO + { + interface_uid = KUidOmxILSymbianComponentIf; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KUidNokiaOmxILAudioFileSource; + version_no = 1; + display_name = "OMX.NOKIA.AUDIO.FILESOURCE"; + default_data = "audio_reader.binary"; + } + }; + } + }; + } + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesource/src/omxilaudiofilesourceopb0port.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesource/src/omxilaudiofilesourceopb0port.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,104 @@ +// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + + + +/** + * @file + * @internalTechnology + */ + +#include "omxilaudiofilesourceopb0port.h" +#include "omxilfilesourceprocessingfunction.h" +#include + +COmxILAudioFileSourceOPB0Port* COmxILAudioFileSourceOPB0Port::NewL(const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedAudioFormats, + const COmxILFileSourceProcessingFunction& aFileSourcePF) + { + COmxILAudioFileSourceOPB0Port* self = new (ELeave) COmxILAudioFileSourceOPB0Port(aCommonPortData, aFileSourcePF); + CleanupStack::PushL(self); + self->ConstructL(aSupportedAudioFormats); + CleanupStack::Pop(self); + return self; + } + +void COmxILAudioFileSourceOPB0Port::ConstructL(const RArray& aSupportedAudioFormats) + { + iParamPortDefinition.eDomain = OMX_PortDomainAudio; + + // base + COmxILAudioPort::ConstructL(aSupportedAudioFormats); + } + +COmxILAudioFileSourceOPB0Port::COmxILAudioFileSourceOPB0Port(const TOmxILCommonPortData& aCommonPortData, + const COmxILFileSourceProcessingFunction& aFileSourcePF) + : COmxILAudioPort(aCommonPortData), + iFileSourcePF(aFileSourcePF) + { + } + +COmxILAudioFileSourceOPB0Port::~COmxILAudioFileSourceOPB0Port() + { + CleanUpPort(); + } + +OMX_ERRORTYPE COmxILAudioFileSourceOPB0Port::GetLocalOmxParamIndexes(RArray& aIndexArray) const + { + return COmxILAudioPort::GetLocalOmxParamIndexes(aIndexArray); + } + +OMX_ERRORTYPE COmxILAudioFileSourceOPB0Port::GetLocalOmxConfigIndexes(RArray& aIndexArray) const + { + return COmxILAudioPort::GetLocalOmxConfigIndexes(aIndexArray); + } + +OMX_ERRORTYPE COmxILAudioFileSourceOPB0Port::GetParameter(OMX_INDEXTYPE aParamIndex, + TAny* apComponentParameterStructure) const + { + return COmxILAudioPort::GetParameter(aParamIndex, apComponentParameterStructure); + } + +OMX_ERRORTYPE COmxILAudioFileSourceOPB0Port::SetParameter(OMX_INDEXTYPE aParamIndex, + const TAny* apComponentParameterStructure, + TBool& aUpdateProcessingFunction) + { + return COmxILAudioPort::SetParameter(aParamIndex, + apComponentParameterStructure, + aUpdateProcessingFunction); + } + +OMX_ERRORTYPE COmxILAudioFileSourceOPB0Port::SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, + TBool& /*aUpdateProcessingFunction*/) + { + iParamPortDefinition.format.audio = aPortDefinition.format.audio; + return OMX_ErrorNone; + } + +TBool COmxILAudioFileSourceOPB0Port::IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const + { + + if(aPortDefinition.eDomain != iParamPortDefinition.eDomain) + { + return EFalse; + } + + if (aPortDefinition.format.audio.eEncoding == OMX_AUDIO_CodingMax) + { + return EFalse; + } + + return ETrue; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesource/src/omxilfilesource.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesource/src/omxilfilesource.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,308 @@ +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + + + +/** + * @file + * @internalTechnology + */ + +#include "omxilport.h" + +#include "omxilfsm.h" +#include "omxilportmanager.h" +#include "omxilcallbackmanager.h" +#include "omxilspecversion.h" +#include + +#include "omxilfilesource.h" +#include "omxilotherfilesourceopb0port.h" +#include "omxilfilesourceprocessingfunction.h" +#include "omxilfilesourceconfigmanager.h" +#include "omxilfilesource.hrh" + +#ifdef OMXIL_AUDIO_FILESOURCE +#include "omxilaudiofilesourceopb0port.h" +_LIT8(KNokiaOMXFileSourceComponentName, "OMX.NOKIA.AUDIO.FILESOURCE"); +_LIT8(KNokiaOMXFileSourceRole, "audio_reader.binary"); +OMXIL_COMPONENT_ECOM_ENTRYPOINT(KUidNokiaOmxILAudioFileSource); + +#elif defined(OMXIL_VIDEO_FILESOURCE) +#include "omxilvideofilesourceopb0port.h" +_LIT8(KNokiaOMXFileSourceComponentName, "OMX.NOKIA.VIDEO.FILESOURCE"); +_LIT8(KNokiaOMXFileSourceRole, "video_reader.binary"); +OMXIL_COMPONENT_ECOM_ENTRYPOINT(KUidNokiaOmxILVideoFileSource); + +#elif defined(OMXIL_IMAGE_FILESOURCE) +#include "omxilimagefilesourceopb0port.h" +_LIT8(KNokiaOMXFileSourceComponentName, "OMX.NOKIA.IMAGE.FILESOURCE"); +_LIT8(KNokiaOMXFileSourceRole, "image_reader.binary"); +OMXIL_COMPONENT_ECOM_ENTRYPOINT(KUidNokiaOmxILImageFileSource); + +#elif defined(OMXIL_OTHER_FILESOURCE) +#include "omxilotherfilesourceopb0port.h" +_LIT8(KNokiaOMXFileSourceComponentName, "OMX.NOKIA.OTHER.FILESOURCE"); +_LIT8(KNokiaOMXFileSourceRole, "other_reader.binary"); +OMXIL_COMPONENT_ECOM_ENTRYPOINT(KUidNokiaOmxILOtherFileSource); + +#endif + +const TUint8 KComponentVersionMajor = 1; +const TUint8 KComponentVersionMinor = 1; +const TUint8 KComponentVersionRevision = 0; +const TUint8 KComponentVersionStep = 0; + +static const TInt KMinBuffers = 1; +static const TInt KMinBufferSize = 15360; + + +// Component Entry Point +OMX_ERRORTYPE OMX_ComponentInit(OMX_HANDLETYPE aComponent) + { + TRAPD(err, COmxILFileSource::CreateComponentL(aComponent)); + if (err == KErrNone) + { + return OMX_ErrorNone; + } + else + { + return err == KErrNoMemory ? OMX_ErrorInsufficientResources : OMX_ErrorUndefined; + } + } + +void COmxILFileSource::CreateComponentL(OMX_HANDLETYPE aComponent) + { + COmxILFileSource* self = new (ELeave) COmxILFileSource(); + CleanupStack::PushL(self); + self->ConstructL(aComponent); + CleanupStack::Pop(self); + } + +COmxILFileSource::COmxILFileSource() + { + // nothing to do + } + +COmxILFileSource::~COmxILFileSource() + { + delete ipCallbackManager; + delete ipProcessingFunction; + delete ipPortManager; + delete iOPB0Port; + delete ipConfigManager; + delete ipFsm; + } + +void COmxILFileSource::ConstructL(OMX_HANDLETYPE aComponent) + { + // STEP 1: Initialize the data received from the IL Core + ipHandle = static_cast(aComponent); + ipAppData = 0; + ipCallbacks = 0; + + // STEP 2: Create the call backs manager... + ipCallbackManager = COmxILCallbackManager::NewL(ipHandle, ipAppData, ipCallbacks); + + // STEP 3: Create the file source-specific Processing Function... + ipProcessingFunction = COmxILFileSourceProcessingFunction::NewL(*ipCallbackManager); + + // STEP 4: Create Port manager... + +#ifdef OMXIL_AUDIO_FILESOURCE + ipPortManager = COmxILPortManager::NewL( + *ipProcessingFunction, // The component's processing function + *ipCallbackManager, // The call back manager object + TOmxILSpecVersion(), // OMX Version + 1, // The number of audio ports in this component + 0, // The starting audio port index + 0, // The number of image ports in this component + 0, // The starting image port index + 0, // The number of video ports in this component + 0, // The starting video port index + 0, // The number of other ports in this component + 0 // The starting other port index + ); + +#elif defined(OMXIL_VIDEO_FILESOURCE) + ipPortManager = COmxILPortManager::NewL( + *ipProcessingFunction, // The component's processing function + *ipCallbackManager, // The call back manager object + TOmxILSpecVersion(), // OMX Version + 0, // The number of audio ports in this component + 0, // The starting audio port index + 0, // The number of image ports in this component + 0, // The starting image port index + 1, // The number of video ports in this component + 0, // The starting video port index + 0, // The number of other ports in this component + 0 // The starting other port index + ); + +#elif defined(OMXIL_IMAGE_FILESOURCE) + ipPortManager = COmxILPortManager::NewL( + *ipProcessingFunction, // The component's processing function + *ipCallbackManager, // The call back manager object + TOmxILSpecVersion(), // OMX Version + 0, // The number of audio ports in this component + 0, // The starting audio port index + 1, // The number of image ports in this component + 0, // The starting image port index + 0, // The number of video ports in this component + 0, // The starting video port index + 0, // The number of other ports in this component + 0 // The starting other port index + ); + + +#elif defined(OMXIL_OTHER_FILESOURCE) + ipPortManager = COmxILPortManager::NewL( + *ipProcessingFunction, // The component's processing function + *ipCallbackManager, // The call back manager object + TOmxILSpecVersion(), // OMX Version + 0, // The number of audio ports in this component + 0, // The starting audio port index + 0, // The number of image ports in this component + 0, // The starting image port index + 0, // The number of video ports in this component + 0, // The starting video port index + 1, // The number of other ports in this component + 0 // The starting other port index + ); +#endif + + // STEP 5: Create the File Source component port... + iOPB0Port = ConstructOPB0PortL(); + + // STEP 6: Add to the port manager... + User::LeaveIfError(ipPortManager->AddPort(iOPB0Port, OMX_DirOutput)); + + // STEP 7: Create the non-port related configuration manager... + RPointerArray componentRoles; + CleanupClosePushL(componentRoles); + componentRoles.AppendL(&KNokiaOMXFileSourceRole); + ipConfigManager = COmxILFileSourceConfigManager::NewL( + *ipPortManager, + KNokiaOMXFileSourceComponentName, + TOmxILVersion(KComponentVersionMajor, + KComponentVersionMinor, + KComponentVersionRevision, + KComponentVersionStep), + componentRoles, + *ipProcessingFunction); + + CleanupStack::PopAndDestroy(&componentRoles); + + // STEP 8: Create the FSM object... + ipFsm = COmxILFsm::NewL(*this, *ipProcessingFunction, *ipPortManager, *ipConfigManager, *ipCallbackManager); + + // STEP 9: Finally, let's get everything started + InitComponentL(); + } + +COmxILPort* COmxILFileSource::ConstructOPB0PortL() const + { + OMX_U32 thisPortIndex = 0; +#ifdef OMXIL_AUDIO_FILESOURCE + RArray supportedAudioFormats; + CleanupClosePushL(supportedAudioFormats); + supportedAudioFormats.AppendL(OMX_AUDIO_CodingUnused); + COmxILAudioFileSourceOPB0Port* opb0Port = COmxILAudioFileSourceOPB0Port::NewL( + TOmxILCommonPortData ( + TOmxILSpecVersion(), // OMX specification version information + thisPortIndex, // Port number the structure applies to + OMX_DirOutput, // Direction of this port + KMinBuffers, // The minimum number of buffers this port requires + KMinBufferSize, // Minimum size, in bytes, for buffers to be used for this port + OMX_PortDomainAudio, // Domain of the port + OMX_FALSE, // Buffers contiguous requirement (true or false) + 0, // Buffer aligment requirements + OMX_BufferSupplyUnspecified, // supplier preference when tunneling between two ports + COmxILPort::KBufferMarkPropagationPortNotNeeded), + supportedAudioFormats, + *ipProcessingFunction); + CleanupStack::PopAndDestroy(&supportedAudioFormats); + return opb0Port; +#elif defined(OMXIL_VIDEO_FILESOURCE) + RArray supportedVideoFormats; + CleanupClosePushL(supportedVideoFormats); + RArray supportedColourFormats; + CleanupClosePushL(supportedColourFormats); + COmxILVideoFileSourceOPB0Port* opb0Port = COmxILVideoFileSourceOPB0Port::NewL( + TOmxILCommonPortData ( + TOmxILSpecVersion(), // OMX specification version information + thisPortIndex, // Port number the structure applies to + OMX_DirOutput, // Direction of this port + KMinBuffers, // The minimum number of buffers this port requires + KMinBufferSize, // Minimum size, in bytes, for buffers to be used for this port + OMX_PortDomainVideo, // Domain of the port + OMX_FALSE,//OMX_TRUE, // Buffers contiguous requirement (true or false) + 0,//KBufferAlignment, // Buffer aligment requirements + OMX_BufferSupplyUnspecified, // supplier preference when tunneling between two ports + COmxILPort::KBufferMarkPropagationPortNotNeeded), + supportedVideoFormats, + supportedColourFormats, + *ipProcessingFunction); + CleanupStack::PopAndDestroy(2); + return opb0Port; +#elif defined(OMXIL_IMAGE_FILESOURCE) + + RArray supportedImageFormats; + CleanupClosePushL(supportedImageFormats); + RArray supportedColourFormats; + CleanupClosePushL(supportedColourFormats); + COmxILImageFileSourceOPB0Port* opb0Port = COmxILImageFileSourceOPB0Port::NewL( + TOmxILCommonPortData ( + TOmxILSpecVersion(), // OMX specification version information + thisPortIndex, // Port number the structure applies to + OMX_DirOutput, // Direction of this port + KMinBuffers, // The minimum number of buffers this port requires + KMinBufferSize, // Minimum size, in bytes, for buffers to be used for this port + OMX_PortDomainImage, // Domain of the port + OMX_FALSE, // Buffers contiguous requirement (true or false) + 0, // Buffer aligment requirements + OMX_BufferSupplyUnspecified, // supplier preference when tunneling between two ports + COmxILPort::KBufferMarkPropagationPortNotNeeded), + supportedImageFormats, + supportedColourFormats, + *ipProcessingFunction); + CleanupStack::PopAndDestroy(2); + return opb0Port; + +#elif defined(OMXIL_OTHER_FILESOURCE) + RArray supportedOtherFormats; + + CleanupClosePushL(supportedOtherFormats); + supportedOtherFormats.AppendL(OMX_OTHER_FormatBinary); + + COmxILOtherFileSourceOPB0Port* opb0Port = COmxILOtherFileSourceOPB0Port::NewL( + TOmxILCommonPortData ( + TOmxILSpecVersion(), // OMX specification version information + thisPortIndex, // Port number the structure applies to + OMX_DirOutput, // Direction of this port + KMinBuffers, // The minimum number of buffers this port requires + KMinBufferSize, // Minimum size, in bytes, for buffers to be used for this port + OMX_PortDomainOther, // Domain of the port + OMX_FALSE, // Buffers contiguous requirement (true or false) + 0, // Buffer aligment requirements + OMX_BufferSupplyUnspecified, // supplier preference when tunneling between two ports + COmxILPort::KBufferMarkPropagationPortNotNeeded), + supportedOtherFormats, + *ipProcessingFunction); + + CleanupStack::PopAndDestroy(&supportedOtherFormats); + return opb0Port; +#endif + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesource/src/omxilfilesourceconfigmanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesource/src/omxilfilesourceconfigmanager.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,125 @@ +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + + + +/** + * @file + * @internalTechnology + */ + +#include "omxilfilesourceconfigmanager.h" +#include "omxilfilesourceprocessingfunction.h" +#include "omxilspecversion.h" + +COmxILFileSourceConfigManager* COmxILFileSourceConfigManager::NewL( + MOmxILPortManagerIf& aPortManager, + const TDesC8& aComponentName, + const OMX_VERSIONTYPE& aComponentVersion, + const RPointerArray& aComponentRoleList, + COmxILFileSourceProcessingFunction& aFileSourcePF) + { + COmxILFileSourceConfigManager* self = new(ELeave) COmxILFileSourceConfigManager(aPortManager, aFileSourcePF); + CleanupStack::PushL(self); + self->ConstructL(aComponentName, aComponentVersion, aComponentRoleList); + CleanupStack::Pop(self); + return self; + } + +COmxILFileSourceConfigManager::COmxILFileSourceConfigManager(MOmxILPortManagerIf& aPortManager, COmxILFileSourceProcessingFunction& aFileSourcePF) + :COmxILConfigManager(aPortManager), + iFileSourcePF(aFileSourcePF) + { + } + +void COmxILFileSourceConfigManager::ConstructL( + const TDesC8& aComponentName, + const OMX_VERSIONTYPE& aComponentVersion, + const RPointerArray& aComponentRoleList) + { + COmxILConfigManager::ConstructL(aComponentName, aComponentVersion, aComponentRoleList); + + InsertParamIndexL(OMX_IndexParamContentURI); + } + +COmxILFileSourceConfigManager::~COmxILFileSourceConfigManager() + { + } + +OMX_ERRORTYPE COmxILFileSourceConfigManager::GetParameter(OMX_INDEXTYPE aParamIndex, TAny* aPtr) const + { + TInt index = FindParamIndex(aParamIndex); + if (KErrNotFound == index) + { + return OMX_ErrorUnsupportedIndex; + } + + switch (aParamIndex) + { + case OMX_IndexParamContentURI: + { + OMX_PARAM_CONTENTURITYPE* param = reinterpret_cast(aPtr); + const HBufC8* uriData = iFileSourcePF.Uri(); + if (!uriData) + { + return OMX_ErrorNotReady; + } + + const OMX_PARAM_CONTENTURITYPE* uri = reinterpret_cast(uriData->Ptr()); + if (uri->nSize > param->nSize) + { + return OMX_ErrorBadParameter; + } + + // The client's structure is guaranteed to be big enough. + Mem::Copy(param, uri, uri->nSize); + } + break; + + default: + { + return COmxILConfigManager::GetParameter(aParamIndex, aPtr); + } + } + + return OMX_ErrorNone; + } + +OMX_ERRORTYPE COmxILFileSourceConfigManager::SetParameter(OMX_INDEXTYPE aParamIndex, const TAny* aPtr, OMX_BOOL aInitTime) + { + TInt index = FindParamIndex(aParamIndex); + if (KErrNotFound == index) + { + return OMX_ErrorUnsupportedIndex; + } + + OMX_ERRORTYPE omxErr = OMX_ErrorNone; + + switch (aParamIndex) + { + case OMX_IndexParamContentURI: + { + omxErr = iFileSourcePF.ParamIndication(aParamIndex, aPtr); + break; + } + default: + { + omxErr = COmxILConfigManager::SetParameter(aParamIndex, aPtr, aInitTime); + break; + } + } + + return omxErr; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesource/src/omxilfilesourceopb0port.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesource/src/omxilfilesourceopb0port.cpp Fri May 07 16:25:23 2010 +0100 @@ -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 + * @internalTechnology + */ + +#include "omxilfilesourceopb0port.h" +#include "omxilfilesourceprocessingfunction.h" +#include + +COmxILOtherFileSourceOPB0Port* COmxILOtherFileSourceOPB0Port::NewL(const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedOtherFormats, + const COmxILFileSourceProcessingFunction& aFileSourcePF) + { + COmxILOtherFileSourceOPB0Port* self = new (ELeave) COmxILOtherFileSourceOPB0Port(aCommonPortData, aFileSourcePF); + CleanupStack::PushL(self); + self->ConstructL(aSupportedOtherFormats); + CleanupStack::Pop(self); + return self; + } + +void COmxILOtherFileSourceOPB0Port::ConstructL(const RArray& aSupportedOtherFormats) + { + iParamPortDefinition.eDomain = OMX_PortDomainOther; + iParamPortDefinition.format.other.eFormat = OMX_OTHER_FormatBinary; + + // base + COmxILOtherPort::ConstructL(aSupportedOtherFormats); + } + +COmxILOtherFileSourceOPB0Port::COmxILOtherFileSourceOPB0Port(const TOmxILCommonPortData& aCommonPortData, + const COmxILFileSourceProcessingFunction& aFileSourcePF) + : COmxILOtherPort(aCommonPortData), + iFileSourcePF(aFileSourcePF) + { + } + +COmxILOtherFileSourceOPB0Port::~COmxILOtherFileSourceOPB0Port() + { + CleanUpPort(); + } + +OMX_ERRORTYPE COmxILOtherFileSourceOPB0Port::GetLocalOmxParamIndexes(RArray& aIndexArray) const + { + return COmxILOtherPort::GetLocalOmxParamIndexes(aIndexArray); + } + +OMX_ERRORTYPE COmxILOtherFileSourceOPB0Port::GetLocalOmxConfigIndexes(RArray& aIndexArray) const + { + return COmxILOtherPort::GetLocalOmxConfigIndexes(aIndexArray); + } + +OMX_ERRORTYPE COmxILOtherFileSourceOPB0Port::GetParameter(OMX_INDEXTYPE aParamIndex, + TAny* apComponentParameterStructure) const + { + return COmxILOtherPort::GetParameter(aParamIndex, apComponentParameterStructure); + } + +OMX_ERRORTYPE COmxILOtherFileSourceOPB0Port::SetParameter(OMX_INDEXTYPE aParamIndex, + const TAny* apComponentParameterStructure, + TBool& aUpdateProcessingFunction) + { + return COmxILOtherPort::SetParameter(aParamIndex, + apComponentParameterStructure, + aUpdateProcessingFunction); + } + +OMX_ERRORTYPE COmxILOtherFileSourceOPB0Port::SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, + TBool& /*aUpdateProcessingFunction*/) + { + + iParamPortDefinition.format.other = aPortDefinition.format.other; + return OMX_ErrorNone; + } + +TBool COmxILOtherFileSourceOPB0Port::IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const + { + if(aPortDefinition.eDomain != iParamPortDefinition.eDomain) + { + return EFalse; + } + + + if (aPortDefinition.format.other.eFormat == OMX_OTHER_FormatMax) + { + return EFalse; + } + + + return ETrue; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesource/src/omxilfilesourceprocessingfunction.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesource/src/omxilfilesourceprocessingfunction.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,656 @@ +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + + + +/** + * @file + * @internalTechnology + */ + +#include +#include "omxilcallbackmanager.h" +#include "omxilfilesourceprocessingfunction.h" + +const TInt KMaxMsgQueueEntries = 25; + + +COmxILFileSourceProcessingFunction* COmxILFileSourceProcessingFunction::NewL(MOmxILCallbackNotificationIf& aCallbacks) + { + COmxILFileSourceProcessingFunction* self = new (ELeave) COmxILFileSourceProcessingFunction(aCallbacks); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +COmxILFileSourceProcessingFunction::COmxILFileSourceProcessingFunction(MOmxILCallbackNotificationIf& aCallbacks) +: COmxILProcessingFunction(aCallbacks) + { + } + +void COmxILFileSourceProcessingFunction::ConstructL() + { + iState = OMX_StateLoaded; + iFileSourceAccess = CFileSourceAccess::NewL(*this); + iPFHelper = CPFHelper::NewL(*this, *iFileSourceAccess); + } + +COmxILFileSourceProcessingFunction::~COmxILFileSourceProcessingFunction() + { + if(iPFHelper && + (iState == OMX_StateInvalid || + iState == OMX_StateExecuting || + iState == OMX_StatePause)) + { + iPFHelper->StopSync(); + } + + delete iPFHelper; + delete iFileSourceAccess; + delete iUri; + delete iFileName; + + // Buffer headers are not owned by the processing function + iBuffersToFill.Close(); + } + +OMX_ERRORTYPE COmxILFileSourceProcessingFunction::StateTransitionIndication(COmxILFsm::TStateIndex aNewState) + { + OMX_ERRORTYPE err = OMX_ErrorNone; + switch(aNewState) + { + case COmxILFsm::EStateExecuting: + { + if (iPFHelper->ExecuteAsync() != KErrNone) + { + err = OMX_ErrorInsufficientResources; + } + } + break; + + case COmxILFsm::EStateInvalid: + { + if (iPFHelper && iPFHelper->StopAsync() != KErrNone) + { + err = OMX_ErrorInsufficientResources; + } + + } + break; + + case COmxILFsm::EStatePause: + { + iPFHelper->PauseAsync(); + } + break; + + case COmxILFsm::EStateIdle: + { + iPFHelper->IdleAsync(); + } + break; + + case COmxILFsm::EStateLoaded: + case COmxILFsm::EStateWaitForResources: + { + if (iPFHelper && iPFHelper->StopAsync() != KErrNone) + { + err = OMX_ErrorInsufficientResources; + } + } + break; + + case COmxILFsm::ESubStateExecutingToIdle: + { + iPFHelper->StopAsync(); + } + break; + case COmxILFsm::ESubStatePauseToIdle: + case COmxILFsm::ESubStateLoadedToIdle: + case COmxILFsm::ESubStateIdleToLoaded: + break; + + default: + { + err = OMX_ErrorIncorrectStateTransition; + } + }; + + return err; + } + +OMX_ERRORTYPE COmxILFileSourceProcessingFunction::BufferFlushingIndication(TUint32 aPortIndex, OMX_DIRTYPE aDirection) + { + OMX_ERRORTYPE err = OMX_ErrorNone; + if ((aPortIndex == OMX_ALL && aDirection == OMX_DirMax) || + (aPortIndex == 0 && aDirection == OMX_DirOutput)) + { + // Send BufferDone notifications for each bufer... + for (TUint i=0, bufferCount=iBuffersToFill.Count(); inOutputPortIndex, + OMX_DirOutput); + } + // Empty buffer lists... + iBuffersToFill.Reset(); + } + else + { + err = OMX_ErrorBadParameter; + } + return err; + } + +OMX_ERRORTYPE COmxILFileSourceProcessingFunction::ParamIndication(OMX_INDEXTYPE aParamIndex, const TAny* apComponentParameterStructure) + { + OMX_ERRORTYPE err = OMX_ErrorNone; + switch(aParamIndex) + { + case OMX_IndexParamPortDefinition: + { + //const OMX_PARAM_PORTDEFINITIONTYPE* portDefinition = static_cast(apComponentParameterStructure); + //nothing to do + // + //the number of buffers may change depending on capture mode (single shot vs burst mode) + //in that case, we need to do something for PF... + break; + } + case OMX_IndexParamContentURI: + { + const OMX_PARAM_CONTENTURITYPE* contentUriType = reinterpret_cast(apComponentParameterStructure); + err = SetFileName(contentUriType); + break; + } + default: + { + err = OMX_ErrorUnsupportedIndex; + } + } + return err; + } + +OMX_ERRORTYPE COmxILFileSourceProcessingFunction::ConfigIndication(OMX_INDEXTYPE /*aConfigIndex*/, const TAny* /*apComponentConfigStructure*/) + { + return OMX_ErrorNone; + } + +OMX_ERRORTYPE COmxILFileSourceProcessingFunction::BufferIndication(OMX_BUFFERHEADERTYPE* apBufferHeader, OMX_DIRTYPE aDirection) + { + if (aDirection == OMX_DirOutput) + { + if (iPFHelper->BufferIndication(apBufferHeader) != KErrNone) + { + return OMX_ErrorInsufficientResources; + } + } + else + { + return OMX_ErrorBadParameter; + } + + return OMX_ErrorNone; + } + +OMX_BOOL COmxILFileSourceProcessingFunction::BufferRemovalIndication(OMX_BUFFERHEADERTYPE* apBufferHeader, OMX_DIRTYPE /*aDirection*/) + { + OMX_BOOL headerDeletionResult = OMX_TRUE; + + TInt headerIndexInArray = KErrNotFound; + if (KErrNotFound !=(headerIndexInArray = iBuffersToFill.Find(apBufferHeader))) + { + iBuffersToFill.Remove(headerIndexInArray); + } + else + { + headerDeletionResult = OMX_FALSE; + } + + return headerDeletionResult; + } + +MOmxILCallbackNotificationIf& COmxILFileSourceProcessingFunction::GetCallbacks() + { + return iCallbacks; + } + +OMX_ERRORTYPE COmxILFileSourceProcessingFunction::SetFileName(const OMX_PARAM_CONTENTURITYPE* aContentUriType) + { + ASSERT(aContentUriType); + delete iFileName; + iFileName = NULL; + delete iUri; + iUri = NULL; + + TInt sizeOfUri = aContentUriType->nSize - _FOFF(OMX_PARAM_CONTENTURITYPE, contentURI); //Actual size of URI + if (sizeOfUri <= 0) + { + return OMX_ErrorBadParameter; + } + + // Don't include the zero character at the end. + TPtrC8 uriDes(aContentUriType->contentURI,sizeOfUri); + + TInt err = KErrNone; + do + { + TUriParser8 parser; + err = parser.Parse(uriDes); + if (err != KErrNone) + { + break; + } + + TRAP(err, iFileName = parser.GetFileNameL()); + if (err != KErrNone) + { + break; + } + + // Remove Null charcter '\0' if any. + TPtr filePtr(iFileName->Des()); + TInt index = filePtr.LocateReverse('\0'); + if (index != KErrNotFound && index == filePtr.Length()-1) + { + filePtr.Delete(index,1); + } + + uriDes.Set(reinterpret_cast(aContentUriType), aContentUriType->nSize ); + iUri = uriDes.Alloc(); + if (!iUri) + { + err = KErrNoMemory; + break; + } + + return OMX_ErrorNone; + } + while (EFalse); + + // Something failed. + ASSERT(err != KErrNone); + delete iFileName; + iFileName = NULL; + delete iUri; + iUri = NULL; + return (err == KErrNoMemory ? OMX_ErrorInsufficientResources : OMX_ErrorBadParameter); + } + + +const HBufC* COmxILFileSourceProcessingFunction::FileName() const + { + return iFileName; + } + +const HBufC8* COmxILFileSourceProcessingFunction::Uri() const + { + return iUri; + } + +COmxILFileSourceProcessingFunction::CFileSourceAccess* COmxILFileSourceProcessingFunction::CFileSourceAccess::NewL(COmxILFileSourceProcessingFunction& aParent) + { + CFileSourceAccess* self = new (ELeave) CFileSourceAccess(aParent); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +COmxILFileSourceProcessingFunction::CFileSourceAccess::CFileSourceAccess(COmxILFileSourceProcessingFunction& aParent) + : CActive(EPriorityStandard), + iParent(aParent), + iBufferOffset(0), + iReadBuffer(0,0) + { + CActiveScheduler::Add(this); + } + +void COmxILFileSourceProcessingFunction::CFileSourceAccess::ConstructL() + { + User::LeaveIfError(iFs.Connect()); + } + +COmxILFileSourceProcessingFunction::CFileSourceAccess::~CFileSourceAccess() + { + Cancel(); + + iFileHandle.Close(); + iFs.Close(); + } + +void COmxILFileSourceProcessingFunction::CFileSourceAccess::RunL() + { + // The buffer is not on the list implies that they have already been flushed/spotted + // via BufferFlushingIndication/BufferRemovalIndication + TInt index = iParent.iBuffersToFill.Find(iCurrentBuffer); + if (KErrNotFound != index) + { + switch(iStatus.Int()) + { + case KErrNone: + { + if (iReadBuffer.Length()==0) //the end of the file + { + iFileHandle.Close(); + iCurrentBuffer->nFlags |= OMX_BUFFERFLAG_EOS; + iParent.GetCallbacks().EventNotification(OMX_EventBufferFlag, iCurrentBuffer->nOutputPortIndex, OMX_BUFFERFLAG_EOS, NULL); + } + iCurrentBuffer->nFilledLen=iReadBuffer.Length(); + iCurrentBuffer->nOffset = 0; + break; + } + default: + { + User::Leave(iStatus.Int()); + } + }; + + iParent.GetCallbacks().BufferDoneNotification(iCurrentBuffer,iCurrentBuffer->nOutputPortIndex,OMX_DirOutput); + iParent.iBuffersToFill.Remove(index); + iCurrentBuffer = NULL; + if(iFileHandle.SubSessionHandle() != 0) + { + ProcessNextBuffer(); + } + } + } + +TInt COmxILFileSourceProcessingFunction::CFileSourceAccess::ProcessNextBuffer() + { + TInt err = KErrNone; + if ((iParent.iBuffersToFill.Count() > 0) && !IsActive() && iParent.iState == OMX_StateExecuting) + { + iCurrentBuffer = iParent.iBuffersToFill[0]; + iReadBuffer.Set(iCurrentBuffer->pBuffer, iCurrentBuffer->nAllocLen, iCurrentBuffer->nAllocLen); + if (iFileHandle.SubSessionHandle() == 0) + { + SetActive(); + TRequestStatus* status(&iStatus); + User::RequestComplete(status, KErrNone); + } + else + { + iFileHandle.Read(iReadBuffer, iCurrentBuffer->nAllocLen, iStatus); + SetActive(); + } + } + + return err; + } + +void COmxILFileSourceProcessingFunction::CFileSourceAccess::DoCancel() + { + if (iFileHandle.SubSessionHandle() != 0) + { + iFileHandle.Close(); + } + iCurrentBuffer = NULL; + } + +TInt COmxILFileSourceProcessingFunction::CFileSourceAccess::Execute() + { + iParent.iState = OMX_StateExecuting; + return ProcessNextBuffer(); + } + +void COmxILFileSourceProcessingFunction::CFileSourceAccess::Pause() + { + iParent.iState = OMX_StatePause; + } + +void COmxILFileSourceProcessingFunction::CFileSourceAccess::Idle() + { + iParent.iState = OMX_StateIdle; + iParent.iBuffersToFill.Reset(); + } + + + +void COmxILFileSourceProcessingFunction::CFileSourceAccess::Stop() + { + if(iParent.iState == OMX_StateExecuting || iParent.iState == OMX_StatePause) + { + Cancel(); + iParent.iState = OMX_StateIdle; + } + } + +COmxILFileSourceProcessingFunction::CPFHelper* COmxILFileSourceProcessingFunction::CPFHelper::NewL(COmxILFileSourceProcessingFunction& aParent, CFileSourceAccess& aFileSourceAccess) + { + CPFHelper* self = new (ELeave) CPFHelper(aParent, aFileSourceAccess); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +COmxILFileSourceProcessingFunction::CPFHelper::CPFHelper(COmxILFileSourceProcessingFunction& aParent, CFileSourceAccess& aFileSourceAccess) +: CActive(EPriorityStandard), + iParent(aParent), + iFileSourceAccess(aFileSourceAccess) + { + CActiveScheduler::Add(this); + } + +void COmxILFileSourceProcessingFunction::CPFHelper::ConstructL() + { + User::LeaveIfError(iMsgQueue.CreateLocal(KMaxMsgQueueEntries)); + SetActive(); + iMsgQueue.NotifyDataAvailable(iStatus); + } + +COmxILFileSourceProcessingFunction::CPFHelper::~CPFHelper() + { + Cancel(); + iMsgQueue.Close(); + } + + + +void COmxILFileSourceProcessingFunction::CPFHelper::RunL() + { + TInt err = ProcessQueue(); + if (err != KErrNone) + { + iParent.GetCallbacks().ErrorEventNotification( ConvertSymbianErrorType(err) ); + } + + // setup for next callbacks + SetActive(); + iMsgQueue.NotifyDataAvailable(iStatus); + } + +void COmxILFileSourceProcessingFunction::CPFHelper::DoCancel() + { + if (iMsgQueue.Handle()) + { + ProcessQueue(); + iMsgQueue.CancelDataAvailable(); + } + } + +TInt COmxILFileSourceProcessingFunction::CPFHelper::ProcessQueue() + { + TProcMessage msg; + TInt err = KErrNone; + + while (iMsgQueue.Receive(msg) == KErrNone) + { + switch (msg.iType) + { + case EExecuteCommand: + { + const HBufC* fileName = iParent.FileName(); + if (fileName && iFileSourceAccess.iFileHandle.SubSessionHandle() == 0) + { + err = iFileSourceAccess.iFileHandle.Open(iFileSourceAccess.iFs, *fileName, EFileRead | EFileShareReadersOnly); + } + else + { +//#define KHRONOS_CONFORMANCE +// The KHRONOS_CONFORMANCE is required to pass the following khronos conformance component tests (FlushTest, +// BaseMultiThreadedTest, StateTransitionTest, PortDisableEnableTest, IncompleteStopTest and PortCommunicationTest) +// that expects no error to be returned when a filesource filename is not set. + +#ifdef KHRONOS_CONFORMANCE +// do nothing, don't report any error +#else + err = KErrPathNotFound; +#endif + } + if ( err == KErrNone) + { + err = iFileSourceAccess.Execute(); + } + break; + } + + case EStopCommand: + { + iFileSourceAccess.Stop(); + break; + } + + case EPauseCommand: + { + iFileSourceAccess.Pause(); + break; + } + + case EIdleCommand: + { + iFileSourceAccess.Idle(); + break; + } + case EBufferIndication: + { + OMX_BUFFERHEADERTYPE* bufferHeader = reinterpret_cast(msg.iPtr); + + if ( bufferHeader && (iParent.iState == OMX_StateExecuting || + iParent.iState == OMX_StatePause || iParent.iState == OMX_StateIdle) ) + { + err = iParent.iBuffersToFill.Append(bufferHeader); + if(err == KErrNone) + { + if(iParent.iState != OMX_StateIdle) + { + err = iFileSourceAccess.ProcessNextBuffer(); + } + } + else + { + // to prevent potential buffer leakage if the Append operation fails + iParent.GetCallbacks().BufferDoneNotification(bufferHeader, bufferHeader->nOutputPortIndex,OMX_DirOutput); + } + } + break; + } + default: + { + break; + } + } + + if (err) + { + break; + } + } + return err; + } + +TInt COmxILFileSourceProcessingFunction::CPFHelper::ExecuteAsync() + { + TProcMessage message; + message.iType = EExecuteCommand; + return iMsgQueue.Send(message); + } + +TInt COmxILFileSourceProcessingFunction::CPFHelper::StopAsync() + { + TProcMessage message; + message.iType = EStopCommand; + return iMsgQueue.Send(message); + } + +TInt COmxILFileSourceProcessingFunction::CPFHelper::PauseAsync() + { + TProcMessage message; + message.iType = EPauseCommand; + return iMsgQueue.Send(message); + } + + +TInt COmxILFileSourceProcessingFunction::CPFHelper::BufferIndication(OMX_BUFFERHEADERTYPE* apBufferHeader) + { + TProcMessage message; + message.iType = EBufferIndication; + message.iPtr = apBufferHeader; + return iMsgQueue.Send(message); + } + +void COmxILFileSourceProcessingFunction::CPFHelper::StopSync() + { + // Cancel to process the existing queue before handling this command + Cancel(); + iFileSourceAccess.Stop(); + + // setup for next callbacks + SetActive(); + iMsgQueue.NotifyDataAvailable(iStatus); + } + +TInt COmxILFileSourceProcessingFunction::CPFHelper::IdleAsync() + { + TProcMessage message; + message.iType = EIdleCommand; + return iMsgQueue.Send(message); + } + + +/** + Converts a Symbian error code to an OpenMAX error code. + @param aError The Symbian error code. + @return The OpenMAX error code. + */ +OMX_ERRORTYPE COmxILFileSourceProcessingFunction::CPFHelper::ConvertSymbianErrorType(TInt aError) + { + // In the current implementation this function is only used for the return code in the + // callback methods. Currently the only expected errors KErrNone and KErrOverflow. + + OMX_ERRORTYPE err = OMX_ErrorNone; + switch (aError) + { + case KErrNone: + err = OMX_ErrorNone; + break; + case KErrOverflow: + case KErrNoMemory: + err = OMX_ErrorInsufficientResources; + break; + case KErrNotSupported: + err = OMX_ErrorNotImplemented; + break; + case KErrNotReady: + err = OMX_ErrorNotReady; + break; + case KErrGeneral: + default: + err = OMX_ErrorUndefined; + } + return err; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesource/src/omxilimagefilesource.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesource/src/omxilimagefilesource.rss Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,43 @@ +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + + + +#include +#include +#include "omxilfilesource.hrh" + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = KUidNokiaOmxILImageFileSourceDll; + interfaces = + { + INTERFACE_INFO + { + interface_uid = KUidOmxILSymbianComponentIf; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KUidNokiaOmxILImageFileSource; + version_no = 1; + display_name = "OMX.NOKIA.IMAGE.FILESOURCE"; + default_data = "image_reader.binary"; + } + }; + } + }; + } + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesource/src/omxilimagefilesourceopb0port.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesource/src/omxilimagefilesourceopb0port.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,105 @@ +// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + + + +/** + * @file + * @internalTechnology + */ + +#include "omxilimagefilesourceopb0port.h" +#include "omxilfilesourceprocessingfunction.h" +#include + +COmxILImageFileSourceOPB0Port* COmxILImageFileSourceOPB0Port::NewL(const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedImageFormats, + const RArray& aSupportedColorFormats, + const COmxILFileSourceProcessingFunction& aFileSourcePF) + { + COmxILImageFileSourceOPB0Port* self = new (ELeave) COmxILImageFileSourceOPB0Port(aCommonPortData, + aSupportedImageFormats, + aSupportedColorFormats, + aFileSourcePF); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +void COmxILImageFileSourceOPB0Port::ConstructL() + { + iParamPortDefinition.eDomain = OMX_PortDomainImage; + } + +COmxILImageFileSourceOPB0Port::COmxILImageFileSourceOPB0Port(const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedImageFormats, + const RArray& aSupportedColorFormats, + const COmxILFileSourceProcessingFunction& aFileSourcePF) + : COmxILImagePort(aCommonPortData, aSupportedImageFormats, aSupportedColorFormats), + iFileSourcePF(aFileSourcePF) + { + } + +COmxILImageFileSourceOPB0Port::~COmxILImageFileSourceOPB0Port() + { + CleanUpPort(); + } + +OMX_ERRORTYPE COmxILImageFileSourceOPB0Port::GetLocalOmxParamIndexes(RArray& aIndexArray) const + { + return COmxILImagePort::GetLocalOmxParamIndexes(aIndexArray); + } + +OMX_ERRORTYPE COmxILImageFileSourceOPB0Port::GetLocalOmxConfigIndexes(RArray& aIndexArray) const + { + return COmxILImagePort::GetLocalOmxConfigIndexes(aIndexArray); + } + +OMX_ERRORTYPE COmxILImageFileSourceOPB0Port::GetParameter(OMX_INDEXTYPE aParamIndex, + TAny* apComponentParameterStructure) const + { + return COmxILImagePort::GetParameter(aParamIndex, apComponentParameterStructure); + } + +OMX_ERRORTYPE COmxILImageFileSourceOPB0Port::SetParameter(OMX_INDEXTYPE aParamIndex, + const TAny* apComponentParameterStructure, + TBool& aUpdateProcessingFunction) + { + return COmxILImagePort::SetParameter(aParamIndex, + apComponentParameterStructure, + aUpdateProcessingFunction); + } + +OMX_ERRORTYPE COmxILImageFileSourceOPB0Port::SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, + TBool& /*aUpdateProcessingFunction*/) + { + iParamPortDefinition.format.image = aPortDefinition.format.image; + return OMX_ErrorNone; + } + +TBool COmxILImageFileSourceOPB0Port::IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const + { + if(aPortDefinition.eDomain != iParamPortDefinition.eDomain) + { + return EFalse; + } + + if (aPortDefinition.format.image.eCompressionFormat == OMX_IMAGE_CodingMax) + { + return EFalse; + } + return ETrue; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesource/src/omxilotherfilesource.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesource/src/omxilotherfilesource.rss Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,43 @@ +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + + + +#include +#include +#include "omxilfilesource.hrh" + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = KUidNokiaOmxILOtherFileSourceDll; + interfaces = + { + INTERFACE_INFO + { + interface_uid = KUidOmxILSymbianComponentIf; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KUidNokiaOmxILOtherFileSource; + version_no = 1; + display_name = "OMX.NOKIA.OTHER.FILESOURCE"; + default_data = "other_reader.binary"; + } + }; + } + }; + } + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesource/src/omxilotherfilesourceopb0port.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesource/src/omxilotherfilesourceopb0port.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,108 @@ +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + + + +/** + * @file + * @internalTechnology + */ + +#include "omxilotherfilesourceopb0port.h" +#include "omxilfilesourceprocessingfunction.h" +#include + +COmxILOtherFileSourceOPB0Port* COmxILOtherFileSourceOPB0Port::NewL(const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedOtherFormats, + const COmxILFileSourceProcessingFunction& aFileSourcePF) + { + COmxILOtherFileSourceOPB0Port* self = new (ELeave) COmxILOtherFileSourceOPB0Port(aCommonPortData, aFileSourcePF); + CleanupStack::PushL(self); + self->ConstructL(aSupportedOtherFormats); + CleanupStack::Pop(self); + return self; + } + +void COmxILOtherFileSourceOPB0Port::ConstructL(const RArray& aSupportedOtherFormats) + { + iParamPortDefinition.eDomain = OMX_PortDomainOther; + iParamPortDefinition.format.other.eFormat = OMX_OTHER_FormatBinary; + + // base + COmxILOtherPort::ConstructL(aSupportedOtherFormats); + } + +COmxILOtherFileSourceOPB0Port::COmxILOtherFileSourceOPB0Port(const TOmxILCommonPortData& aCommonPortData, + const COmxILFileSourceProcessingFunction& aFileSourcePF) + : COmxILOtherPort(aCommonPortData), + iFileSourcePF(aFileSourcePF) + { + } + +COmxILOtherFileSourceOPB0Port::~COmxILOtherFileSourceOPB0Port() + { + CleanUpPort(); + } + +OMX_ERRORTYPE COmxILOtherFileSourceOPB0Port::GetLocalOmxParamIndexes(RArray& aIndexArray) const + { + return COmxILOtherPort::GetLocalOmxParamIndexes(aIndexArray); + } + +OMX_ERRORTYPE COmxILOtherFileSourceOPB0Port::GetLocalOmxConfigIndexes(RArray& aIndexArray) const + { + return COmxILOtherPort::GetLocalOmxConfigIndexes(aIndexArray); + } + +OMX_ERRORTYPE COmxILOtherFileSourceOPB0Port::GetParameter(OMX_INDEXTYPE aParamIndex, + TAny* apComponentParameterStructure) const + { + return COmxILOtherPort::GetParameter(aParamIndex, apComponentParameterStructure); + } + +OMX_ERRORTYPE COmxILOtherFileSourceOPB0Port::SetParameter(OMX_INDEXTYPE aParamIndex, + const TAny* apComponentParameterStructure, + TBool& aUpdateProcessingFunction) + { + return COmxILOtherPort::SetParameter(aParamIndex, + apComponentParameterStructure, + aUpdateProcessingFunction); + } + + +OMX_ERRORTYPE COmxILOtherFileSourceOPB0Port::SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, + TBool& /*aUpdateProcessingFunction*/) + { + + iParamPortDefinition.format.other = aPortDefinition.format.other; + return OMX_ErrorNone; + } + +TBool COmxILOtherFileSourceOPB0Port::IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const + { + if(aPortDefinition.eDomain != iParamPortDefinition.eDomain) + { + return EFalse; + } + + + if (aPortDefinition.format.other.eFormat == OMX_OTHER_FormatMax) + { + return EFalse; + } + + + return ETrue; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesource/src/omxilvideofilesource.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesource/src/omxilvideofilesource.rss Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,43 @@ +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + + + +#include +#include +#include "omxilfilesource.hrh" + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = KUidNokiaOmxILVideoFileSourceDll; + interfaces = + { + INTERFACE_INFO + { + interface_uid = KUidOmxILSymbianComponentIf; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KUidNokiaOmxILVideoFileSource; + version_no = 1; + display_name = "OMX.NOKIA.VIDEO.FILESOURCE"; + default_data = "video_reader.binary"; + } + }; + } + }; + } + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesource/src/omxilvideofilesourceopb0port.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesource/src/omxilvideofilesourceopb0port.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,105 @@ +// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + + + +/** + * @file + * @internalTechnology + */ + +#include "omxilvideofilesourceopb0port.h" +#include "omxilfilesourceprocessingfunction.h" +#include + +COmxILVideoFileSourceOPB0Port* COmxILVideoFileSourceOPB0Port::NewL(const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedCodings, + const RArray& aSupportedColourFormats, + const COmxILFileSourceProcessingFunction& aFileSourcePF) + { + COmxILVideoFileSourceOPB0Port* self = new (ELeave) COmxILVideoFileSourceOPB0Port(aCommonPortData, + aSupportedCodings, + aSupportedColourFormats, + aFileSourcePF); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +void COmxILVideoFileSourceOPB0Port::ConstructL() + { + iParamPortDefinition.eDomain = OMX_PortDomainVideo; + } + +COmxILVideoFileSourceOPB0Port::COmxILVideoFileSourceOPB0Port(const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedCodings, + const RArray& aSupportedColourFormats, + const COmxILFileSourceProcessingFunction& aFileSourcePF) + : COmxILVideoPort(aCommonPortData, aSupportedCodings, aSupportedColourFormats), + iFileSourcePF(aFileSourcePF) + { + } + +COmxILVideoFileSourceOPB0Port::~COmxILVideoFileSourceOPB0Port() + { + CleanUpPort(); + } + +OMX_ERRORTYPE COmxILVideoFileSourceOPB0Port::GetLocalOmxParamIndexes(RArray& aIndexArray) const + { + return COmxILVideoPort::GetLocalOmxParamIndexes(aIndexArray); + } + +OMX_ERRORTYPE COmxILVideoFileSourceOPB0Port::GetLocalOmxConfigIndexes(RArray& aIndexArray) const + { + return COmxILVideoPort::GetLocalOmxConfigIndexes(aIndexArray); + } + +OMX_ERRORTYPE COmxILVideoFileSourceOPB0Port::GetParameter(OMX_INDEXTYPE aParamIndex, + TAny* apComponentParameterStructure) const + { + return COmxILVideoPort::GetParameter(aParamIndex, apComponentParameterStructure); + } + +OMX_ERRORTYPE COmxILVideoFileSourceOPB0Port::SetParameter(OMX_INDEXTYPE aParamIndex, + const TAny* apComponentParameterStructure, + TBool& aUpdateProcessingFunction) + { + return COmxILVideoPort::SetParameter(aParamIndex, + apComponentParameterStructure, + aUpdateProcessingFunction); + } + +OMX_ERRORTYPE COmxILVideoFileSourceOPB0Port::SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, + TBool& /*aUpdateProcessingFunction*/) + { + iParamPortDefinition.format.video = aPortDefinition.format.video; + return OMX_ErrorNone; + } + +TBool COmxILVideoFileSourceOPB0Port::IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const + { + if(aPortDefinition.eDomain != iParamPortDefinition.eDomain) + { + return EFalse; + } + + if (aPortDefinition.format.video.eCompressionFormat == OMX_VIDEO_CodingMax) + { + return EFalse; + } + return ETrue; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesource/tests/khronos_conformance/Khronos_file_source_audio.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesource/tests/khronos_conformance/Khronos_file_source_audio.txt Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,84 @@ +;; cc : conformance test component (sets appropriate flags, adds all tests, tests component) +;; st : OMX_CONF_SetTraceflags(); +;; ol : OMX_OSAL_OpenLogfile(); +;; cl : OMX_OSAL_CloseLogfile(); +;; at : OMX_CONF_AddTest(); +;; rt : OMX_CONF_RemoveTest(); +;; mi : OMX_CONF_MapInputfile(,); +;; tc : OMX_CONF_TestComponent(); +;; ps: OMX_CONF_PrintSettings(); +;; h: OMX_CONF_PrintHelp(); +;; lt: list all available tests. +;; lc: list all available components. + + +; setup tracing, open logfile +st 0x7F ; (OMX_OSAL_TRACE_PASSFAIL|OMX_OSAL_TRACE_CALLSEQUENCE|OMX_OSAL_TRACE_PARAMTERS|OMX_OSAL_TRACE_INFO|OMX_OSAL_TRACE_ERROR|OMX_OSAL_TRACE_BUFFER|OMX_OSAL_TRACE_WARNING) +ol c:\file_source_audio_output.txt + +; add tests + +; Base Profile Tests + +;; ============ +;; Passed tests +;; vvvvvvvvvvvv +at StateTransitionTest +at ComponentNameTest +at BaseParameterTest +at BufferTest +at BufferFlagTest +at FlushTest +at BaseMultiThreadedTest +at PortCommunicationTest +at ResourceExhaustionTest +;; ^^^^^^^^^^^^ +;; Passed tests +;; ============ + + + +; Interop Profile Tests + + +;; ============ +;; Passed tests +;; vvvvvvvvvvvv +at InteropParameterTest +at ValidInputOutputTest +at InvalidInputOutputTest +at PortBufferSupplierTest +at PortDisableEnableTest +at IncompleteStopTest +at MinPayloadSizeTest +at InteropMultiThreadedTest +at TunnelledUnitTest +;; ^^^^^^^^^^^^ +;; Passed tests +;; ============ + + + +;; Problem Resource Manager : Functionality not existent +; at ResourcePreemptionTest +; at WaitForResourcesTest + +;; Non-applicable tests +; at ClockComponentTest +; at SeekingComponentTest + +; Standard Component Class Tests + +;; ============ +;; Passed tests +;; vvvvvvvvvvvv +at StdBinaryAudioReaderTest +;; ^^^^^^^^^^^^ +;; Passed tests +;; ============ + +; test components +tc OMX.NOKIA.AUDIO.FILESOURCE + +; close logfile +cl diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesource/tests/khronos_conformance/Khronos_file_source_image.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesource/tests/khronos_conformance/Khronos_file_source_image.txt Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,85 @@ +;; cc : conformance test component (sets appropriate flags, adds all tests, tests component) +;; st : OMX_CONF_SetTraceflags(); +;; ol : OMX_OSAL_OpenLogfile(); +;; cl : OMX_OSAL_CloseLogfile(); +;; at : OMX_CONF_AddTest(); +;; rt : OMX_CONF_RemoveTest(); +;; mi : OMX_CONF_MapInputfile(,); +;; tc : OMX_CONF_TestComponent(); +;; ps: OMX_CONF_PrintSettings(); +;; h: OMX_CONF_PrintHelp(); +;; lt: list all available tests. +;; lc: list all available components. + + +; setup tracing, open logfile +st 0x7F ; (OMX_OSAL_TRACE_PASSFAIL|OMX_OSAL_TRACE_CALLSEQUENCE|OMX_OSAL_TRACE_PARAMTERS|OMX_OSAL_TRACE_INFO|OMX_OSAL_TRACE_ERROR|OMX_OSAL_TRACE_BUFFER|OMX_OSAL_TRACE_WARNING) +ol c:\file_source_image_output.txt + +; add tests + +; Base Profile Tests + +;; ============ +;; Passed tests +;; vvvvvvvvvvvv +at StateTransitionTest +at ComponentNameTest +at BaseParameterTest +at BufferTest +at BufferFlagTest +at FlushTest +at BaseMultiThreadedTest +at PortCommunicationTest +at ResourceExhaustionTest +;; ^^^^^^^^^^^^ +;; Passed tests +;; ============ + + + +; Interop Profile Tests + + +;; ============ +;; Passed tests +;; vvvvvvvvvvvv +at InteropParameterTest +at ValidInputOutputTest +at InvalidInputOutputTest +at PortBufferSupplierTest +at PortDisableEnableTest +at IncompleteStopTest +at MinPayloadSizeTest +at InteropMultiThreadedTest +at TunnelledUnitTest +;; ^^^^^^^^^^^^ +;; Passed tests +;; ============ + + + +;; Problem Resource Manager : Functionality not existent +; at ResourcePreemptionTest +; at WaitForResourcesTest + +;; Non-applicable tests +; at ClockComponentTest +; at SeekingComponentTest + +; Standard Component Class Tests + +;; ============ +;; Passed tests +;; vvvvvvvvvvvv +at StdBinaryImageReaderTest +;; ^^^^^^^^^^^^ +;; Passed tests +;; ============ + + +; test components +tc OMX.NOKIA.IMAGE.FILESOURCE + +; close logfile +cl diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesource/tests/khronos_conformance/Khronos_file_source_other.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesource/tests/khronos_conformance/Khronos_file_source_other.txt Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,85 @@ +;; cc : conformance test component (sets appropriate flags, adds all tests, tests component) +;; st : OMX_CONF_SetTraceflags(); +;; ol : OMX_OSAL_OpenLogfile(); +;; cl : OMX_OSAL_CloseLogfile(); +;; at : OMX_CONF_AddTest(); +;; rt : OMX_CONF_RemoveTest(); +;; mi : OMX_CONF_MapInputfile(,); +;; tc : OMX_CONF_TestComponent(); +;; ps: OMX_CONF_PrintSettings(); +;; h: OMX_CONF_PrintHelp(); +;; lt: list all available tests. +;; lc: list all available components. + + +; setup tracing, open logfile +st 0x7F ; (OMX_OSAL_TRACE_PASSFAIL|OMX_OSAL_TRACE_CALLSEQUENCE|OMX_OSAL_TRACE_PARAMTERS|OMX_OSAL_TRACE_INFO|OMX_OSAL_TRACE_ERROR|OMX_OSAL_TRACE_BUFFER|OMX_OSAL_TRACE_WARNING) +ol c:\file_source_other_output.txt + +; add tests + +; Base Profile Tests + +;; ============ +;; Passed tests +;; vvvvvvvvvvvv +at StateTransitionTest +at ComponentNameTest +at BaseParameterTest +at BufferTest +at BufferFlagTest +at FlushTest +at BaseMultiThreadedTest +at PortCommunicationTest +at ResourceExhaustionTest +;; ^^^^^^^^^^^^ +;; Passed tests +;; ============ + + + +; Interop Profile Tests + + +;; ============ +;; Passed tests +;; vvvvvvvvvvvv +at InteropParameterTest +at ValidInputOutputTest +at InvalidInputOutputTest +at PortBufferSupplierTest +at PortDisableEnableTest +at IncompleteStopTest +at MinPayloadSizeTest +at InteropMultiThreadedTest +at TunnelledUnitTest +;; ^^^^^^^^^^^^ +;; Passed tests +;; ============ + + + +;; Problem Resource Manager : Functionality not existent +; at ResourcePreemptionTest +; at WaitForResourcesTest + +;; Non-applicable tests +; at ClockComponentTest +; at SeekingComponentTest + +; Standard Component Class Tests + +;; ============ +;; Passed tests +;; vvvvvvvvvvvv +at StdReaderTest +;; ^^^^^^^^^^^^ +;; Passed tests +;; ============ + + +; test components +tc OMX.NOKIA.OTHER.FILESOURCE + +; close logfile +cl diff -r c1e808730d6c -r eedf2dcd43c6 omxil/generic/omxilfilesource/tests/khronos_conformance/Khronos_file_source_video.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/generic/omxilfilesource/tests/khronos_conformance/Khronos_file_source_video.txt Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,86 @@ +;; cc : conformance test component (sets appropriate flags, adds all tests, tests component) +;; st : OMX_CONF_SetTraceflags(); +;; ol : OMX_OSAL_OpenLogfile(); +;; cl : OMX_OSAL_CloseLogfile(); +;; at : OMX_CONF_AddTest(); +;; rt : OMX_CONF_RemoveTest(); +;; mi : OMX_CONF_MapInputfile(,); +;; tc : OMX_CONF_TestComponent(); +;; ps: OMX_CONF_PrintSettings(); +;; h: OMX_CONF_PrintHelp(); +;; lt: list all available tests. +;; lc: list all available components. + + +; setup tracing, open logfile +st 0x7F ; (OMX_OSAL_TRACE_PASSFAIL|OMX_OSAL_TRACE_CALLSEQUENCE|OMX_OSAL_TRACE_PARAMTERS|OMX_OSAL_TRACE_INFO|OMX_OSAL_TRACE_ERROR|OMX_OSAL_TRACE_BUFFER|OMX_OSAL_TRACE_WARNING) +ol c:\file_source_video_output.txt + +; add tests + +; Base Profile Tests + +;; ============ +;; Passed tests +;; vvvvvvvvvvvv +at StateTransitionTest +at ComponentNameTest +at BaseParameterTest +at BufferTest +at BufferFlagTest +at FlushTest +at BaseMultiThreadedTest +at PortCommunicationTest +at ResourceExhaustionTest +;; ^^^^^^^^^^^^ +;; Passed tests +;; ============ + + + +; Interop Profile Tests + + +;; ============ +;; Passed tests +;; vvvvvvvvvvvv +at InteropParameterTest +at ValidInputOutputTest +at InvalidInputOutputTest +at PortBufferSupplierTest +at PortDisableEnableTest +at IncompleteStopTest +at MinPayloadSizeTest +at InteropMultiThreadedTest +at TunnelledUnitTest +;; ^^^^^^^^^^^^ +;; Passed tests +;; ============ + + + +;; Problem Resource Manager : Functionality not existent +; at ResourcePreemptionTest +; at WaitForResourcesTest + +;; Non-applicable tests +; at ClockComponentTest +; at SeekingComponentTest + +; Standard Component Class Tests + +;; ============ +;; Passed tests +;; vvvvvvvvvvvv +at StdBinaryVideoReaderTest +;; ^^^^^^^^^^^^ +;; Passed tests +;; ============ + + +; test components +tc OMX.NOKIA.VIDEO.FILESOURCE + + +; close logfile +cl diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/group/bld.inf --- a/omxil/mmilapi/group/bld.inf Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/group/bld.inf Fri May 07 16:25:23 2010 +0100 @@ -1,20 +1,20 @@ -// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies 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 refomxil and unit test subcomponent bld.inf's -#include "../refomxil/group/bld.inf" -#include "../unittest/group/bld.inf" - +// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies 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 refomxil and unit test subcomponent bld.inf's +#include "../refomxil/group/bld.inf" +#include "../unittest/group/bld.inf" + // End of file \ No newline at end of file diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/group/multimedia_il_api.mrp --- a/omxil/mmilapi/group/multimedia_il_api.mrp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/group/multimedia_il_api.mrp Fri May 07 16:25:23 2010 +0100 @@ -1,28 +1,28 @@ -# multimedia_il_api.mrp -# -# 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: -# - -component multimedia_il_api - -source \sf\os\mm\omxil\mmilapi\ - -binary \sf\os\mm\omxil\mmilapi\group all - -exports \sf\os\mm\omxil\mmilapi\group - -notes_source \component_defs\release.src - -ipr T +# multimedia_il_api.mrp +# +# 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: +# + +component multimedia_il_api + +source \sf\os\mm\omxil\mmilapi\ + +binary \sf\os\mm\omxil\mmilapi\group all + +exports \sf\os\mm\omxil\mmilapi\group + +notes_source \component_defs\release.src + +ipr T diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/ilif/inc/ilaudioconfigstructs.h --- a/omxil/mmilapi/ilif/inc/ilaudioconfigstructs.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/ilif/inc/ilaudioconfigstructs.h Fri May 07 16:25:23 2010 +0100 @@ -1,159 +1,159 @@ -// 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 ILAUDIOCONFIGSTRUCTS_H -#define ILAUDIOCONFIGSTRUCTS_H - -#include - -/** -@file -@internalTechnology -@prototype -*/ - -/** -This is the structure to be used by implementations of the MMMFDevSoundCustomInterfaceSpecificConfig::SetFormatSpecificConfigL() -method to pass the AudioSpecificConfig configuration data blindly to the codec. -*/ -class TAudioSpecificConfigType -{ -public: - /** The pointer to the AudioSpecificConfig chunk of data. - */ - TUint8* iAudioSpecificConfig; - - /** The length of the data encapsulated in this structure.. - */ - TUint32 iAudioSpecificConfigLength; - -}; - - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* The rest of this file defines some structures that are not publishedPartner yet. -/* They have been defined for internal used only as a proof of concept for testing -/* the varios possible MILIF implementations. -/* These definition could be upgraded to publishedPartner when the need for Symbian -/* support of these particular params arises. -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/** -A typedef to symbianize the OpenMAX IL PORTFORMATTYPE parameter structure. -*/ -typedef OMX_AUDIO_PARAM_PORTFORMATTYPE TAudioPortFormatType; - - -/** -A typedef to symbianize the OpenMAX IL VORBISTYPE parameter structure. - -@internalTechnology -@prototype -*/ -typedef OMX_AUDIO_PARAM_VORBISTYPE TPortVorbisType; - -/** -A typedef to symbianize the OpenMAX IL PCMMODETYPE parameter structure. - -@internalTechnology -@prototype -*/ -typedef OMX_AUDIO_PARAM_PCMMODETYPE TPortPCMModeType; - -/** -A typedef to symbianize the OpenMAX IL AACPROFILETYPE parameter structure. - -@internalTechnology -@prototype -*/ -typedef OMX_AUDIO_PARAM_AACPROFILETYPE TPortAACProfileType; - -/** -A typedef to symbianize the OpenMAX IL VOLUMETYPE parameter structure. - -@internalTechnology -@prototype -*/ -typedef OMX_AUDIO_CONFIG_VOLUMETYPE TPortVolumeType; - -/** -A typedef to symbianize the OpenMAX IL MUTETYPE parameter structure. - -@internalTechnology -@prototype -*/ -typedef OMX_AUDIO_CONFIG_MUTETYPE TPortMuteType; - - -/** -This is the structure to be used by implementations of the MMMFDevSoundCustomInterfaceSpecificConfig::SetFormatSpecificConfigL() -method to extract configuration data from the AudioSpecificConfig. - -@internalTechnology -@prototype -*/ -class TAacConfig - { -public: - inline TAacConfig(); - - inline TAacConfig(TUint8 aAudioType, TUint8 aSamplingRateIndex, TUint32 aNumChannels, TInt aStereoMode); - -public: - /** The audio object type - */ - TUint8 iAudioType; - - /** The rate index of the audio data. - */ - TUint8 iSamplingRateIndex; - - /** Number of channels of the underlying AAC coded stream - */ - TUint32 iNumChannels; - - /** The type of stereo audio data. - */ - TInt iStereoMode; - }; - -inline -TAacConfig::TAacConfig() - : - iAudioType(0), - iSamplingRateIndex(0), - iNumChannels(0), - iStereoMode(0) - { - } - -inline -TAacConfig::TAacConfig( - TUint8 aAudioType, - TUint8 aSamplingRateIndex, - TUint32 aNumChannels, - TInt aStereoMode - ) - : - iAudioType(aAudioType), - iSamplingRateIndex(aSamplingRateIndex), - iNumChannels(aNumChannels), - iStereoMode(aStereoMode) - { - } - - - -#endif // ILAUDIOCONFIGSTRUCTS_H +// 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 ILAUDIOCONFIGSTRUCTS_H +#define ILAUDIOCONFIGSTRUCTS_H + +#include + +/** +@file +@internalTechnology +@prototype +*/ + +/** +This is the structure to be used by implementations of the MMMFDevSoundCustomInterfaceSpecificConfig::SetFormatSpecificConfigL() +method to pass the AudioSpecificConfig configuration data blindly to the codec. +*/ +class TAudioSpecificConfigType +{ +public: + /** The pointer to the AudioSpecificConfig chunk of data. + */ + TUint8* iAudioSpecificConfig; + + /** The length of the data encapsulated in this structure.. + */ + TUint32 iAudioSpecificConfigLength; + +}; + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/* The rest of this file defines some structures that are not publishedPartner yet. +/* They have been defined for internal used only as a proof of concept for testing +/* the varios possible MILIF implementations. +/* These definition could be upgraded to publishedPartner when the need for Symbian +/* support of these particular params arises. +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/** +A typedef to symbianize the OpenMAX IL PORTFORMATTYPE parameter structure. +*/ +typedef OMX_AUDIO_PARAM_PORTFORMATTYPE TAudioPortFormatType; + + +/** +A typedef to symbianize the OpenMAX IL VORBISTYPE parameter structure. + +@internalTechnology +@prototype +*/ +typedef OMX_AUDIO_PARAM_VORBISTYPE TPortVorbisType; + +/** +A typedef to symbianize the OpenMAX IL PCMMODETYPE parameter structure. + +@internalTechnology +@prototype +*/ +typedef OMX_AUDIO_PARAM_PCMMODETYPE TPortPCMModeType; + +/** +A typedef to symbianize the OpenMAX IL AACPROFILETYPE parameter structure. + +@internalTechnology +@prototype +*/ +typedef OMX_AUDIO_PARAM_AACPROFILETYPE TPortAACProfileType; + +/** +A typedef to symbianize the OpenMAX IL VOLUMETYPE parameter structure. + +@internalTechnology +@prototype +*/ +typedef OMX_AUDIO_CONFIG_VOLUMETYPE TPortVolumeType; + +/** +A typedef to symbianize the OpenMAX IL MUTETYPE parameter structure. + +@internalTechnology +@prototype +*/ +typedef OMX_AUDIO_CONFIG_MUTETYPE TPortMuteType; + + +/** +This is the structure to be used by implementations of the MMMFDevSoundCustomInterfaceSpecificConfig::SetFormatSpecificConfigL() +method to extract configuration data from the AudioSpecificConfig. + +@internalTechnology +@prototype +*/ +class TAacConfig + { +public: + inline TAacConfig(); + + inline TAacConfig(TUint8 aAudioType, TUint8 aSamplingRateIndex, TUint32 aNumChannels, TInt aStereoMode); + +public: + /** The audio object type + */ + TUint8 iAudioType; + + /** The rate index of the audio data. + */ + TUint8 iSamplingRateIndex; + + /** Number of channels of the underlying AAC coded stream + */ + TUint32 iNumChannels; + + /** The type of stereo audio data. + */ + TInt iStereoMode; + }; + +inline +TAacConfig::TAacConfig() + : + iAudioType(0), + iSamplingRateIndex(0), + iNumChannels(0), + iStereoMode(0) + { + } + +inline +TAacConfig::TAacConfig( + TUint8 aAudioType, + TUint8 aSamplingRateIndex, + TUint32 aNumChannels, + TInt aStereoMode + ) + : + iAudioType(aAudioType), + iSamplingRateIndex(aSamplingRateIndex), + iNumChannels(aNumChannels), + iStereoMode(aStereoMode) + { + } + + + +#endif // ILAUDIOCONFIGSTRUCTS_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/ilif/inc/ilconfigstructs.h --- a/omxil/mmilapi/ilif/inc/ilconfigstructs.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/ilif/inc/ilconfigstructs.h Fri May 07 16:25:23 2010 +0100 @@ -1,34 +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 - @internalTechnology - @prototype -*/ - -#ifndef ILCONFIGSTRUCTS_H -#define ILCONFIGSTRUCTS_H - -#include - - -/** - A typedef to symbianize the OpenMAX IL PORTDEFINITIONTYPE parameter structure. - */ -typedef OMX_PARAM_PORTDEFINITIONTYPE TPortDefinitionType; - - -#endif // ILCONFIGSTRUCTS_H +// 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 + @prototype +*/ + +#ifndef ILCONFIGSTRUCTS_H +#define ILCONFIGSTRUCTS_H + +#include + + +/** + A typedef to symbianize the OpenMAX IL PORTDEFINITIONTYPE parameter structure. + */ +typedef OMX_PARAM_PORTDEFINITIONTYPE TPortDefinitionType; + + +#endif // ILCONFIGSTRUCTS_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/ilif/inc/ilifbase.h --- a/omxil/mmilapi/ilif/inc/ilifbase.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/ilif/inc/ilifbase.h Fri May 07 16:25:23 2010 +0100 @@ -1,284 +1,284 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// - -/** - @file - @internalTechnology - @prototype -*/ - -#ifndef ILIFBASE_H -#define ILIFBASE_H - -#include - - -/** - Enumeration used to indicate IL Component internal state. -*/ -enum TILComponentState - { - /** - Component invalid state - */ - EComponentInvalid = 0, - /** - Component loaded state - */ - EComponentLoaded, - /** - Component idle state - */ - EComponentIdle, - /** - Component executing state - */ - EComponentExecuting, - /** - Component paused state - */ - EComponentPaused, - /** - Component waiting for resources state - */ - EComponentWaitingForResources, - /** - Component loading state - */ - EComponentLoading, - /** - Component initializing state - */ - EComponentInitializing, - - EComponentMax = 0X7FFFFFFF - }; - - -/** -Enumeration used to indicate if a port is an input or an output port -*/ -enum TPortDirection -{ - /** - Port is an input port - */ - EDirInput, - /** - Port is an output port - */ - EDirOutput -}; - - -/** - Enumeration used to define the various types of IL Events - This enumeration matches the possible component events as defined in the - OpenMAX v1.1 specification - */ -enum TILEventTypes - { - /** - Component has completed the execution of a command. - */ - EEventCmdComplete = 0, - /** - Component has detected an error condition. - */ - EEventError, - /** - A buffer mark has reached the target component, and the IL client has - received this event with the private data pointer of the mark. - */ - EEventMark, - /** - Component has changed port settings. For example, the component has - changed port settings resulting from bit stream parsing. - */ - EEventPortSettingsChanged, - /** - The event that a component sends when it detects the end of a stream. - */ - EEventBufferFlag, - /** - The component has been granted resources and is transitioning from the - OMX_StateWaitForResources state to the OMX_StateIdle state. - */ - EEventResourcesAcquired, - /** - The component has been resumed (i.e. no longer suspended) due to - reacquisition of resources. - */ - EEventDynamicResourcesAvailable, - - EEventMax = 0X7FFFFFFF - }; - - -/** -Event structure representing the events and data sent from the IL component to the IL client. -*/ -class TILEvent - { -public: - inline TILEvent(); - - inline TILEvent(TILEventTypes aEvent, TUint32 aData1, TUint32 aData2, TAny* aExtraData); - -public: - /** - Event the component wants to notify the application about. - */ - TILEventTypes iEvent; - /** - The first integer event-specific parameter. - */ - TUint32 iData1; - /** - The second integer event-specific parameter. - */ - TUint32 iData2; - /** - A pointer to additional event-specific data the component wants to send to the application. - The component owns the memory. - */ - TAny* iExtraData; - }; - -/** - Enumeration used to define commands sent to the IL component - This enumeration defines commands as defined in the OpenMAX v1.1 specification - that are not alredy covered by the Symbian IL API - */ -enum TILCommandTypes - { - /** - Change the component state command. - */ - ECommandStateSet, - /** - Flush the data queue(s) of a component. - */ - ECommandFlush, - /** - Disable a port on a component. - */ - ECommandPortDisable, - /** - Enable a port on a component. - */ - ECommandPortEnable, - /** - Mark a component/buffer for observation. - */ - ECommandMarkBuffer, - /** - Invalid command. - */ - ECommandInvalid = 0X7FFFFFFF - }; - -/** -Command structure representing the command's data sent to the IL component by the IL client -*/ -class TILCommand - { -public: - inline TILCommand(); - - inline TILCommand(TILCommandTypes iCmd, TUint32 aData1, TAny* aExtraData); - -public: - /** - Command that the application wants to send to the component. - */ - TILCommandTypes iCmd; - /** - The integer command-specific parameter. - */ - TUint32 iData1; - /** - A pointer to additional command-specific data the application wants to send to the component. - The application owns the memory. - */ - TAny* iExtraData; - }; - - -/** -Structure encapsulating the various fields needed to represent a version of some content. -*/ -class TILVersion - { -public: - inline TILVersion(); - - inline TILVersion(TUint8 aMajor, TUint8 aMinor, TUint8 aRev, TUint8 aStep); - - inline TBool operator==(TILVersion aVersion); - - inline TBool operator!=(TILVersion aVersion); - -public: - /** - Integer representing the Major version number. - */ - TUint8 iMajor; - /** - Integer representing the Minor version number. - */ - TUint8 iMinor; - /** - Integer representing the Revision version number. - */ - TUint8 iRev; - /** - Integer representing the Step version number. - */ - TUint8 iStep; - }; - -/** -Structure encapsulating the various fields needed to represent a version of an IL component. -This structure is based on the arguments required by the OMX_GetComponentVersion OMX API MACRO. -*/ -class TILComponentVersion - { -public: - inline TILComponentVersion(TPtr8& aPtr); - -public: - /** - The component name to which the structure applies. - */ - TPtr8 iComponentName; - /** - The version of the component to which structure applies. - */ - TILVersion iComponentVersion; - /** - The version of the specification that was used to build this component. - */ - TILVersion iSpecVersion; - /** - The unique identifier for the particular instance of the component to which structure applies. - */ - TUint32 iComponentUniqueID; - }; - - -#include "ilifbase.inl" - -#endif // ILIFBASE_H +// 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 + @prototype +*/ + +#ifndef ILIFBASE_H +#define ILIFBASE_H + +#include + + +/** + Enumeration used to indicate IL Component internal state. +*/ +enum TILComponentState + { + /** + Component invalid state + */ + EComponentInvalid = 0, + /** + Component loaded state + */ + EComponentLoaded, + /** + Component idle state + */ + EComponentIdle, + /** + Component executing state + */ + EComponentExecuting, + /** + Component paused state + */ + EComponentPaused, + /** + Component waiting for resources state + */ + EComponentWaitingForResources, + /** + Component loading state + */ + EComponentLoading, + /** + Component initializing state + */ + EComponentInitializing, + + EComponentMax = 0X7FFFFFFF + }; + + +/** +Enumeration used to indicate if a port is an input or an output port +*/ +enum TPortDirection +{ + /** + Port is an input port + */ + EDirInput, + /** + Port is an output port + */ + EDirOutput +}; + + +/** + Enumeration used to define the various types of IL Events + This enumeration matches the possible component events as defined in the + OpenMAX v1.1 specification + */ +enum TILEventTypes + { + /** + Component has completed the execution of a command. + */ + EEventCmdComplete = 0, + /** + Component has detected an error condition. + */ + EEventError, + /** + A buffer mark has reached the target component, and the IL client has + received this event with the private data pointer of the mark. + */ + EEventMark, + /** + Component has changed port settings. For example, the component has + changed port settings resulting from bit stream parsing. + */ + EEventPortSettingsChanged, + /** + The event that a component sends when it detects the end of a stream. + */ + EEventBufferFlag, + /** + The component has been granted resources and is transitioning from the + OMX_StateWaitForResources state to the OMX_StateIdle state. + */ + EEventResourcesAcquired, + /** + The component has been resumed (i.e. no longer suspended) due to + reacquisition of resources. + */ + EEventDynamicResourcesAvailable, + + EEventMax = 0X7FFFFFFF + }; + + +/** +Event structure representing the events and data sent from the IL component to the IL client. +*/ +class TILEvent + { +public: + inline TILEvent(); + + inline TILEvent(TILEventTypes aEvent, TUint32 aData1, TUint32 aData2, TAny* aExtraData); + +public: + /** + Event the component wants to notify the application about. + */ + TILEventTypes iEvent; + /** + The first integer event-specific parameter. + */ + TUint32 iData1; + /** + The second integer event-specific parameter. + */ + TUint32 iData2; + /** + A pointer to additional event-specific data the component wants to send to the application. + The component owns the memory. + */ + TAny* iExtraData; + }; + +/** + Enumeration used to define commands sent to the IL component + This enumeration defines commands as defined in the OpenMAX v1.1 specification + that are not alredy covered by the Symbian IL API + */ +enum TILCommandTypes + { + /** + Change the component state command. + */ + ECommandStateSet, + /** + Flush the data queue(s) of a component. + */ + ECommandFlush, + /** + Disable a port on a component. + */ + ECommandPortDisable, + /** + Enable a port on a component. + */ + ECommandPortEnable, + /** + Mark a component/buffer for observation. + */ + ECommandMarkBuffer, + /** + Invalid command. + */ + ECommandInvalid = 0X7FFFFFFF + }; + +/** +Command structure representing the command's data sent to the IL component by the IL client +*/ +class TILCommand + { +public: + inline TILCommand(); + + inline TILCommand(TILCommandTypes iCmd, TUint32 aData1, TAny* aExtraData); + +public: + /** + Command that the application wants to send to the component. + */ + TILCommandTypes iCmd; + /** + The integer command-specific parameter. + */ + TUint32 iData1; + /** + A pointer to additional command-specific data the application wants to send to the component. + The application owns the memory. + */ + TAny* iExtraData; + }; + + +/** +Structure encapsulating the various fields needed to represent a version of some content. +*/ +class TILVersion + { +public: + inline TILVersion(); + + inline TILVersion(TUint8 aMajor, TUint8 aMinor, TUint8 aRev, TUint8 aStep); + + inline TBool operator==(TILVersion aVersion); + + inline TBool operator!=(TILVersion aVersion); + +public: + /** + Integer representing the Major version number. + */ + TUint8 iMajor; + /** + Integer representing the Minor version number. + */ + TUint8 iMinor; + /** + Integer representing the Revision version number. + */ + TUint8 iRev; + /** + Integer representing the Step version number. + */ + TUint8 iStep; + }; + +/** +Structure encapsulating the various fields needed to represent a version of an IL component. +This structure is based on the arguments required by the OMX_GetComponentVersion OMX API MACRO. +*/ +class TILComponentVersion + { +public: + inline TILComponentVersion(TPtr8& aPtr); + +public: + /** + The component name to which the structure applies. + */ + TPtr8 iComponentName; + /** + The version of the component to which structure applies. + */ + TILVersion iComponentVersion; + /** + The version of the specification that was used to build this component. + */ + TILVersion iSpecVersion; + /** + The unique identifier for the particular instance of the component to which structure applies. + */ + TUint32 iComponentUniqueID; + }; + + +#include "ilifbase.inl" + +#endif // ILIFBASE_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/ilif/inc/ilifbase.inl --- a/omxil/mmilapi/ilif/inc/ilifbase.inl Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/ilif/inc/ilifbase.inl Fri May 07 16:25:23 2010 +0100 @@ -1,117 +1,117 @@ -// 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 - @prototype -*/ - -#ifndef ILIFBASE_INL -#define ILIFBASE_INL - -inline -TILEvent::TILEvent() - : - iEvent(EEventMax), - iData1(0), - iData2(0), - iExtraData(0) - { - } - -inline -TILEvent::TILEvent( - TILEventTypes aEvent, - TUint32 aData1, - TUint32 aData2, - TAny* aExtraData - ) - : - iEvent(aEvent), - iData1(aData1), - iData2(aData2), - iExtraData(aExtraData) - { - } - -inline -TILCommand::TILCommand() - : - iCmd(ECommandInvalid), - iData1(0), - iExtraData(0) - { - } - -inline -TILCommand::TILCommand( - TILCommandTypes aCmd, - TUint32 aData1, - TAny* aExtraData - ) - : - iCmd(aCmd), - iData1(aData1), - iExtraData(aExtraData) - { - } - -inline TILVersion::TILVersion() - : - iMajor(0), - iMinor(0), - iRev(0), - iStep(0) - { - } - -inline TILVersion::TILVersion( - TUint8 aMajor, - TUint8 aMinor, - TUint8 aRev, - TUint8 aStep - ) - : - iMajor(aMajor), - iMinor(aMinor), - iRev(aRev), - iStep(aStep) - { - } - -inline TBool TILVersion::operator==(TILVersion aVersion) - { - return (!(operator!=(aVersion))); - } - -inline TBool TILVersion::operator!=(TILVersion aVersion) - { - return ((aVersion.iMajor != iMajor) || (aVersion.iMinor != iMinor) || (aVersion.iRev != iRev) || (aVersion.iStep != iStep)); - } - -inline TILComponentVersion::TILComponentVersion( - TPtr8& aPtr - ) - : - iComponentName(aPtr), - iComponentVersion(), - iSpecVersion(), - iComponentUniqueID(0) - { - } - - -#endif // ILIFBASE_INL +// 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 + @prototype +*/ + +#ifndef ILIFBASE_INL +#define ILIFBASE_INL + +inline +TILEvent::TILEvent() + : + iEvent(EEventMax), + iData1(0), + iData2(0), + iExtraData(0) + { + } + +inline +TILEvent::TILEvent( + TILEventTypes aEvent, + TUint32 aData1, + TUint32 aData2, + TAny* aExtraData + ) + : + iEvent(aEvent), + iData1(aData1), + iData2(aData2), + iExtraData(aExtraData) + { + } + +inline +TILCommand::TILCommand() + : + iCmd(ECommandInvalid), + iData1(0), + iExtraData(0) + { + } + +inline +TILCommand::TILCommand( + TILCommandTypes aCmd, + TUint32 aData1, + TAny* aExtraData + ) + : + iCmd(aCmd), + iData1(aData1), + iExtraData(aExtraData) + { + } + +inline TILVersion::TILVersion() + : + iMajor(0), + iMinor(0), + iRev(0), + iStep(0) + { + } + +inline TILVersion::TILVersion( + TUint8 aMajor, + TUint8 aMinor, + TUint8 aRev, + TUint8 aStep + ) + : + iMajor(aMajor), + iMinor(aMinor), + iRev(aRev), + iStep(aStep) + { + } + +inline TBool TILVersion::operator==(TILVersion aVersion) + { + return (!(operator!=(aVersion))); + } + +inline TBool TILVersion::operator!=(TILVersion aVersion) + { + return ((aVersion.iMajor != iMajor) || (aVersion.iMinor != iMinor) || (aVersion.iRev != iRev) || (aVersion.iStep != iStep)); + } + +inline TILComponentVersion::TILComponentVersion( + TPtr8& aPtr + ) + : + iComponentName(aPtr), + iComponentVersion(), + iSpecVersion(), + iComponentUniqueID(0) + { + } + + +#endif // ILIFBASE_INL diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/ilif/inc/ilifuids.h --- a/omxil/mmilapi/ilif/inc/ilifuids.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/ilif/inc/ilifuids.h Fri May 07 16:25:23 2010 +0100 @@ -1,33 +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 - @internalTechnology - @prototype -*/ - -#ifndef ILIFUIDS_H -#define ILIFUIDS_H - -#include "ilifuids.hrh" - -/** -UID used to identify the MILComponentIf API. -@see KILComponentIfUid -*/ -const TUid KUidILComponentIf = { KILComponentIfUid }; - +// 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 + @prototype +*/ + +#ifndef ILIFUIDS_H +#define ILIFUIDS_H + +#include "ilifuids.hrh" + +/** +UID used to identify the MILComponentIf API. +@see KILComponentIfUid +*/ +const TUid KUidILComponentIf = { KILComponentIfUid }; + #endif // ILIFUIDS_H \ No newline at end of file diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/ilif/inc/ilifuids.hrh --- a/omxil/mmilapi/ilif/inc/ilifuids.hrh Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/ilif/inc/ilifuids.hrh Fri May 07 16:25:23 2010 +0100 @@ -1,32 +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 - @internalTechnology - @prototype -*/ - -#ifndef ILIFUIDS_HRH -#define ILIFUIDS_HRH - -/** -Defines the numerical value for KUidILComponentIf. -@see KUidILComponentIf -*/ -#define KILComponentIfUid 0x10285C08 - -#endif // ILIFUIDS_HRH - +// 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 + @prototype +*/ + +#ifndef ILIFUIDS_HRH +#define ILIFUIDS_HRH + +/** +Defines the numerical value for KUidILComponentIf. +@see KUidILComponentIf +*/ +#define KILComponentIfUid 0x10285C08 + +#endif // ILIFUIDS_HRH + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/ilif/inc/iltypeuids.h --- a/omxil/mmilapi/ilif/inc/iltypeuids.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/ilif/inc/iltypeuids.h Fri May 07 16:25:23 2010 +0100 @@ -1,139 +1,139 @@ -// 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 ILTYPEUIDS_H -#define ILTYPEUIDS_H - -/** -@file -@internalTechnology -@prototype -*/ - -/** -The UID to identify the specific TOMXILStructParam type of IL structs. -@see TOMXILStructParam -*/ -const TInt KUidOMXILStructType = 0x10285C09; - -/** -The UID to identify the TTaskConfig encapsulated in the TILStruct. -@see TILTaskConfig -*/ -const TInt KUidMMFTTaskConfig = 0x10285C0A; - -/** -The UID to identify the TAudioSpecificConfigType encapsulated in the TILStruct. -@see TILAudioSpecificConfig -*/ -const TInt KUidMMFAudioSpecificConfigType = 0x10285C7E; - -/** -The UID to identify the TTimeIntervalMicroSeconds encapsulated in the TILStruct. -@see TILVolumeRamp -*/ -const TInt KUidMMFVolumeRampType = 0x10285CC7; - -/** -The UID to identify the TUint encapsulated in the TILStruct representing the Volume. -@see TILVolume -*/ -const TInt KUidMMFVolumeType = 0x10285D18; - -/** -The UID to identify the TUint encapsulated in the TILStruct representing the number of bytes played. -@see TILBytesPlayed -*/ -const TInt KUidMMFBytesPlayedType = 0x10285CC8; - -/** -The UID to identify the TPortDefinitionType encapsulated in the TILStruct. -@see TILPortDefinition -*/ -const TInt KUidTPortDefinitionType = 0x10285C0B; - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* The rest of this file defines some UIDs that are not publishedPartner yet. -/* They have been defined for internal used only as a proof of concept for testing -/* the varios possible MILIF implementations. -/* These definition could be upgraded to publishedPartner when the need for Symbian -/* support of these particular params arises. -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/** -The UID to identify the TAacConfig encapsulated in the TILStruct. -@see TILAacConfig - -@internalTechnology -@prototype -*/ -const TInt KUidMMFTAacConfig = 0x10285C25; - -/** -The UID to identify the TAudioPortFormatType encapsulated in the TILStruct. -@see TILAudioPortFormat - -@internalTechnology -@prototype -*/ -const TInt KUidTAudioPortFormatType = 0x10285C0C; - -/** -The UID to identify the TPortVorbisType encapsulated in the TILStruct. -@see TILPortVorbis - -@internalTechnology -@prototype -*/ -const TInt KUidTPortVorbisType = 0x10285C0D; - -/** -The UID to identify the TPortPCMModeType encapsulated in the TILStruct. -@see TILPortModePCM - -@internalTechnology -@prototype -*/ -const TInt KUidTPortPCMModeType = 0x10285C0E; - -/** -The UID to identify the TPortAACProfileType encapsulated in the TILStruct. -@see TILPortAACProfile - -@internalTechnology -@prototype -*/ -const TInt KUidTPortAACProfileType = 0x10285C0F; - -/** -The UID to identify the TPortVolumeType encapsulated in the TILStruct. -@see TILPortVolume - -@internalTechnology -@prototype -*/ -const TInt KUidTPortVolumeType = 0x10285C10; - -/** -The UID to identify the TPortMuteType encapsulated in the TILStruct. -@see TILPortMute - -@internalTechnology -@prototype -*/ -const TInt KUidTPortMuteType = 0x10285C11; - - +// 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 ILTYPEUIDS_H +#define ILTYPEUIDS_H + +/** +@file +@internalTechnology +@prototype +*/ + +/** +The UID to identify the specific TOMXILStructParam type of IL structs. +@see TOMXILStructParam +*/ +const TInt KUidOMXILStructType = 0x10285C09; + +/** +The UID to identify the TTaskConfig encapsulated in the TILStruct. +@see TILTaskConfig +*/ +const TInt KUidMMFTTaskConfig = 0x10285C0A; + +/** +The UID to identify the TAudioSpecificConfigType encapsulated in the TILStruct. +@see TILAudioSpecificConfig +*/ +const TInt KUidMMFAudioSpecificConfigType = 0x10285C7E; + +/** +The UID to identify the TTimeIntervalMicroSeconds encapsulated in the TILStruct. +@see TILVolumeRamp +*/ +const TInt KUidMMFVolumeRampType = 0x10285CC7; + +/** +The UID to identify the TUint encapsulated in the TILStruct representing the Volume. +@see TILVolume +*/ +const TInt KUidMMFVolumeType = 0x10285D18; + +/** +The UID to identify the TUint encapsulated in the TILStruct representing the number of bytes played. +@see TILBytesPlayed +*/ +const TInt KUidMMFBytesPlayedType = 0x10285CC8; + +/** +The UID to identify the TPortDefinitionType encapsulated in the TILStruct. +@see TILPortDefinition +*/ +const TInt KUidTPortDefinitionType = 0x10285C0B; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/* The rest of this file defines some UIDs that are not publishedPartner yet. +/* They have been defined for internal used only as a proof of concept for testing +/* the varios possible MILIF implementations. +/* These definition could be upgraded to publishedPartner when the need for Symbian +/* support of these particular params arises. +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/** +The UID to identify the TAacConfig encapsulated in the TILStruct. +@see TILAacConfig + +@internalTechnology +@prototype +*/ +const TInt KUidMMFTAacConfig = 0x10285C25; + +/** +The UID to identify the TAudioPortFormatType encapsulated in the TILStruct. +@see TILAudioPortFormat + +@internalTechnology +@prototype +*/ +const TInt KUidTAudioPortFormatType = 0x10285C0C; + +/** +The UID to identify the TPortVorbisType encapsulated in the TILStruct. +@see TILPortVorbis + +@internalTechnology +@prototype +*/ +const TInt KUidTPortVorbisType = 0x10285C0D; + +/** +The UID to identify the TPortPCMModeType encapsulated in the TILStruct. +@see TILPortModePCM + +@internalTechnology +@prototype +*/ +const TInt KUidTPortPCMModeType = 0x10285C0E; + +/** +The UID to identify the TPortAACProfileType encapsulated in the TILStruct. +@see TILPortAACProfile + +@internalTechnology +@prototype +*/ +const TInt KUidTPortAACProfileType = 0x10285C0F; + +/** +The UID to identify the TPortVolumeType encapsulated in the TILStruct. +@see TILPortVolume + +@internalTechnology +@prototype +*/ +const TInt KUidTPortVolumeType = 0x10285C10; + +/** +The UID to identify the TPortMuteType encapsulated in the TILStruct. +@see TILPortMute + +@internalTechnology +@prototype +*/ +const TInt KUidTPortMuteType = 0x10285C11; + + #endif // ILTYPEUIDS_H \ No newline at end of file diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/ilif/inc/milcomponentif.h --- a/omxil/mmilapi/ilif/inc/milcomponentif.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/ilif/inc/milcomponentif.h Fri May 07 16:25:23 2010 +0100 @@ -1,334 +1,334 @@ -// 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 - @prototype -*/ - -#ifndef MILCOMPONENTIF_H -#define MILCOMPONENTIF_H - -#include -#include "ilifbase.h" -#include "tilstruct.h" - -class MILIfObserver; -class MILComponentPortIf; - -/** -IL Component interface class -*/ -class MILComponentIf - { -public: - - /** - Synchronous method which creates the physical IL Component. - - @param aComponentName - The string identifying the name of the component. - @param aComponentObserver - The class to receive asynchronous component events. - @leave System wide error. - */ - virtual void CreateComponentL(const TDesC8& aComponentName, MILIfObserver& aComponentObserver) = 0; - - /** - Synchronous method which creates the physical IL Component. - - @param aComponentUID - The UIF identifying a particular component implementation. - @param aComponentObserver - The class to receive asynchronous component events. - @leave System wide error. - */ - virtual void CreateComponentL(const TUid& aComponentUID, MILIfObserver& aComponentObserver) = 0; - - /** - Called by the IL client to release the component associated to this interface - */ - virtual void ReleaseComponent() = 0; - - /** - Synchronous method which returns the input ports a component holds. - The array is cleared before appending ports. - - @param aComponentPorts - The array to which the input ports will be appended. - @return An error code indicating if the function call was successful. KErrNone on success, otherwise - another of the system-wide error codes. - */ - virtual TInt GetComponentInputPorts(RPointerArray& aComponentPorts) const = 0; - - /** - Synchronous method which returns the output ports a component holds. - The array is cleared before appending ports. - - @param aComponentPorts - The array to which the output ports will be appended. - @return An error code indicating if the function call was successful. KErrNone on success, otherwise - another of the system-wide error codes. - */ - virtual TInt GetComponentOutputPorts(RPointerArray& aComponentPorts) const = 0; - - /** - Synchronous method which sets the configuration for a Component. - Note that in the omx implementation of this interface this function will be used for both SetParameter() - and SetConfig() - - @param aConfig - The reference to the structure that contains the configuration data. - @param aComponentPort - The component's port to be configured when needed, otherwise NULL. - @return An error code indicating if the function call was successful. KErrNone on success, otherwise - another of the system-wide error codes. - @see TILStruct - */ - virtual TInt SetConfig(const TILStruct& aConfig, const MILComponentPortIf* aComponentPort = NULL) = 0; - - /** - Synchronous method which gets a configuration structure from a component. - Note that in the omx implementation of this interface this function will be used for both GetParameter() - and GetConfig() - - @param aConfig - The reference to the structure that is to contain the configuration information. - @param aComponentPort - The component's port to be queried when needed, otherwise NULL. - @return An error code indicating if the function call was successful. KErrNone on success, otherwise - another of the system-wide error codes. - @see TILStruct - */ - virtual TInt GetConfig(TILStruct& aConfig, const MILComponentPortIf* aComponentPort = NULL) const = 0; - - /** - Asynchronous method which instructs the Component to start the initialization. - An event is sent to the component's observer on completion. - - @return An error code indicating if the function call was successful. KErrNone on success, otherwise - another of the system-wide error codes. - @see MILIfObserver::MsgFromILComponent() - */ - virtual TInt Initialize() = 0; - - /** - Asynchronous method which instructs the Component to start the execution. - An event is sent to the component's observer on completion. - - @return An error code indicating if the function call was successful. KErrNone on success, otherwise - another of the system-wide error codes. - @see MILIfObserver::MsgFromILComponent() - */ - virtual TInt Execute() = 0; - - /** - Asynchronous method which pauses the current on-going task. - An event is sent to the component's observer on completion. - - @return An error code indicating if the function call was successful. KErrNone on success, otherwise - another of the system-wide error codes. - @see MILIfObserver::MsgFromILComponent() - */ - virtual TInt Pause() = 0; - - /** - Asynchronous method which stops the current on-going task. - An event is sent to the component's observer on completion. - - @return An error code indicating if the function call was successful. KErrNone on success, otherwise - another of the system-wide error codes. - @see MILIfObserver::MsgFromILComponent() - */ - virtual TInt Stop() = 0; - - /** - Asynchronous method which moves the component back to its uninitialized state. - An event is sent to the component's observer on completion. - - @return An error code indicating if the function call was successful. KErrNone on success, otherwise - another of the system-wide error codes. - @see MILIfObserver::MsgFromILComponent() - */ - virtual TInt UnInitialize() = 0; - - /** - Synchronous method which returns the current state of the Component. - - @param aState - The current state of the Component. - @return An error code indicating if the function call was successful. KErrNone on success, otherwise - another of the system-wide error codes. - */ - virtual TInt GetState(TILComponentState& aState) const = 0; - - /** - Synchronous method which sends a command to the component. - - @param aCommand - The reference to the structure that is to contain the command to be executed by the component. - @return An error code indicating if the function call was successful. KErrNone on success, otherwise - another of the system-wide error codes. - @see TILCommand - */ - virtual TInt SendCommand(const TILCommand& aCommand) = 0; - - /** - Asynchronous function used to flush all component ports. - An event is sent to the component's observer on completion. - - @return An error code indicating if the function call was successful. KErrNone on success, otherwise - another of the system-wide error codes. - */ - virtual TInt FlushAllPorts() = 0; - - /** - Called by the IL client to query the component about the roles it supports. - A component role is a string identifying the behaviour of the component. - - @param aComponentRole - The pointer to the string returned identifying the role of the component. - @param aIndex - The index of the component's role being queried. - @return An error code indicating if the function call was successful. KErrNone on success, otherwise - another of the system-wide error codes. - */ - virtual TInt ComponentRoleEnum(TPtr8& aComponentRole, TUint32 aIndex) const = 0; - - - /** - Called by the IL client to query the component's version. - - @param aVersion - The reference to the structure that is to contain the version of the component - @return An error code indicating if the function call was successful. KErrNone on success, otherwise - another of the system-wide error codes. - @see TILComponentVersion - */ - virtual TInt GetComponentVersion(TILComponentVersion& aVersion) const = 0; - - /** - Synchronous method which uses a standardized OpenMAX or vendor-specific extension string - to set a particular component configuration. - Note that in the OMX implementation of this interface this function will be used for both - SetParameter() and SetConfig(). - - @param aParameterName - The string that identifies the data container. - @param aConfig - The reference to the structure that allows access to the data container used for this - particular component configuration - @param aComponentPort - The component's port to which the config command is targeted to. - @return An error code indicating if the function call was successful. KErrNone on success, otherwise - another of the system-wide error codes. - @see TILStruct - */ - virtual TInt SetExtConfig(const TDesC8& aParameterName, const TILStruct& aConfig, const MILComponentPortIf* aComponentPort = NULL) = 0; - - /** - Synchronous method which uses a standardized OpenMAX or vendor-specific extension string - to get a particular component configuration. - - @param aParameterName - The string that identifies the data container. - @param aConfig - The reference to the structure to access the component's configuration data. - @param aComponentPort - The component's port to which the config command is targeted to. - @return An error code indicating if the function call was successful. KErrNone on success, otherwise - another of the system-wide error codes. - @see TILStruct - */ - virtual TInt GetExtConfig(const TDesC8& aParameterName, TILStruct& aConfig, const MILComponentPortIf* aComponentPort = NULL) const = 0; - - - /** - Synchronous method to set a particular instance of this interface to the specific role passed as a parameter. - A single implementation of this API may support various component roles. It is necessary for the - implementation to know what type of component is configuring so that the appropriate translation of - configuration parameters can be chosen. - The role UIDs may be defined by the client application and can be mapped be the implementation of this API - to roles the components under this layer understand. - - @param aFormat - The UID identifying the role to be played by the implementation of this API. - @return An error code indicating if the function call was successful. KErrNone on success, otherwise - another of the system-wide error codes. - */ - virtual TInt SetComponentIfRole(const TUid& aComponentRole) = 0; - - /** - Synchronous method to set a particular instance of this interface to the specific role passed as a parameter. - A single implementation of this API may support various component roles. It is necessary for the - implementation to know what type of component is configuring so that the appropriate translation of - configuration parameters can be chosen. - Usually the component role names are defined by a known standard body. For instance role names are defined - for OpenMAX IL Standard Components by Khronos Group. - - @param aComponentRole - The string identifying the role to be played by the implementation of this API. - @return An error code indicating if the function call was successful. KErrNone on success, otherwise - another of the system-wide error codes. - */ - virtual TInt SetComponentIfRole(const TDesC8& aComponentRole) = 0; - - /** - Synchronous method to query about the particular role the interface is set to. - A single implementation of this API can support various roles, however the role of the interface - is that of the physical component instantiated under this interface. - The role of the interface is set by the client after the component creation by calling SetComponentIfRole. - The role UIDs may be defined by the client application and can be mapped be the implementation of this API - to roles the components under this layer understand. - - @param aComponentRole - The UID identifying this interface's role which is to be passed back to the caller. - @return An error code indicating if the function call was successful. KErrNone on success, otherwise - another of the system-wide error codes. - */ - virtual TInt GetComponentIfRole(TUid& aComponentRole) const = 0; - - /** - Synchronous method to query about the particular role the interface is set to. - A single implementation of this API can support various roles, however the role of the interface - is that of the [hysical component instantiated under this interface. - The role of the interface is set by the client after the component creation by calling SetComponentIfRole. - Usually the component role names are defined by a known standard body. For instance role names are defined - for OpenMAX IL Standard Components by Khronos Group. - - @param aComponentRole - The string identifying this interface's role which is to be passed back to the caller. - @return An error code indicating if the function call was successful. KErrNone on success, otherwise - another of the system-wide error codes. - */ - virtual TInt GetComponentIfRole(TDes8& aComponentRole) const = 0; - - /** - Synchronous method used to identify a particular interface implementation. - It takes as a parameter the UID identifying the type of the interface requested and - it returns a pointer to the specified interface or NULL if it does not exist. - Must be cast to correct type by the user - - @param aInterfaceId - The UID associated with the interface requested. - @return A pointer to the specified interface or NULL if it has not be implemented. - */ - virtual TAny* CustomInterface(TUid aInterfaceId) = 0; - - }; - - -#endif // MILCOMPONENTIF_H +// 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 + @prototype +*/ + +#ifndef MILCOMPONENTIF_H +#define MILCOMPONENTIF_H + +#include +#include "ilifbase.h" +#include "tilstruct.h" + +class MILIfObserver; +class MILComponentPortIf; + +/** +IL Component interface class +*/ +class MILComponentIf + { +public: + + /** + Synchronous method which creates the physical IL Component. + + @param aComponentName + The string identifying the name of the component. + @param aComponentObserver + The class to receive asynchronous component events. + @leave System wide error. + */ + virtual void CreateComponentL(const TDesC8& aComponentName, MILIfObserver& aComponentObserver) = 0; + + /** + Synchronous method which creates the physical IL Component. + + @param aComponentUID + The UIF identifying a particular component implementation. + @param aComponentObserver + The class to receive asynchronous component events. + @leave System wide error. + */ + virtual void CreateComponentL(const TUid& aComponentUID, MILIfObserver& aComponentObserver) = 0; + + /** + Called by the IL client to release the component associated to this interface + */ + virtual void ReleaseComponent() = 0; + + /** + Synchronous method which returns the input ports a component holds. + The array is cleared before appending ports. + + @param aComponentPorts + The array to which the input ports will be appended. + @return An error code indicating if the function call was successful. KErrNone on success, otherwise + another of the system-wide error codes. + */ + virtual TInt GetComponentInputPorts(RPointerArray& aComponentPorts) const = 0; + + /** + Synchronous method which returns the output ports a component holds. + The array is cleared before appending ports. + + @param aComponentPorts + The array to which the output ports will be appended. + @return An error code indicating if the function call was successful. KErrNone on success, otherwise + another of the system-wide error codes. + */ + virtual TInt GetComponentOutputPorts(RPointerArray& aComponentPorts) const = 0; + + /** + Synchronous method which sets the configuration for a Component. + Note that in the omx implementation of this interface this function will be used for both SetParameter() + and SetConfig() + + @param aConfig + The reference to the structure that contains the configuration data. + @param aComponentPort + The component's port to be configured when needed, otherwise NULL. + @return An error code indicating if the function call was successful. KErrNone on success, otherwise + another of the system-wide error codes. + @see TILStruct + */ + virtual TInt SetConfig(const TILStruct& aConfig, const MILComponentPortIf* aComponentPort = NULL) = 0; + + /** + Synchronous method which gets a configuration structure from a component. + Note that in the omx implementation of this interface this function will be used for both GetParameter() + and GetConfig() + + @param aConfig + The reference to the structure that is to contain the configuration information. + @param aComponentPort + The component's port to be queried when needed, otherwise NULL. + @return An error code indicating if the function call was successful. KErrNone on success, otherwise + another of the system-wide error codes. + @see TILStruct + */ + virtual TInt GetConfig(TILStruct& aConfig, const MILComponentPortIf* aComponentPort = NULL) const = 0; + + /** + Asynchronous method which instructs the Component to start the initialization. + An event is sent to the component's observer on completion. + + @return An error code indicating if the function call was successful. KErrNone on success, otherwise + another of the system-wide error codes. + @see MILIfObserver::MsgFromILComponent() + */ + virtual TInt Initialize() = 0; + + /** + Asynchronous method which instructs the Component to start the execution. + An event is sent to the component's observer on completion. + + @return An error code indicating if the function call was successful. KErrNone on success, otherwise + another of the system-wide error codes. + @see MILIfObserver::MsgFromILComponent() + */ + virtual TInt Execute() = 0; + + /** + Asynchronous method which pauses the current on-going task. + An event is sent to the component's observer on completion. + + @return An error code indicating if the function call was successful. KErrNone on success, otherwise + another of the system-wide error codes. + @see MILIfObserver::MsgFromILComponent() + */ + virtual TInt Pause() = 0; + + /** + Asynchronous method which stops the current on-going task. + An event is sent to the component's observer on completion. + + @return An error code indicating if the function call was successful. KErrNone on success, otherwise + another of the system-wide error codes. + @see MILIfObserver::MsgFromILComponent() + */ + virtual TInt Stop() = 0; + + /** + Asynchronous method which moves the component back to its uninitialized state. + An event is sent to the component's observer on completion. + + @return An error code indicating if the function call was successful. KErrNone on success, otherwise + another of the system-wide error codes. + @see MILIfObserver::MsgFromILComponent() + */ + virtual TInt UnInitialize() = 0; + + /** + Synchronous method which returns the current state of the Component. + + @param aState + The current state of the Component. + @return An error code indicating if the function call was successful. KErrNone on success, otherwise + another of the system-wide error codes. + */ + virtual TInt GetState(TILComponentState& aState) const = 0; + + /** + Synchronous method which sends a command to the component. + + @param aCommand + The reference to the structure that is to contain the command to be executed by the component. + @return An error code indicating if the function call was successful. KErrNone on success, otherwise + another of the system-wide error codes. + @see TILCommand + */ + virtual TInt SendCommand(const TILCommand& aCommand) = 0; + + /** + Asynchronous function used to flush all component ports. + An event is sent to the component's observer on completion. + + @return An error code indicating if the function call was successful. KErrNone on success, otherwise + another of the system-wide error codes. + */ + virtual TInt FlushAllPorts() = 0; + + /** + Called by the IL client to query the component about the roles it supports. + A component role is a string identifying the behaviour of the component. + + @param aComponentRole + The pointer to the string returned identifying the role of the component. + @param aIndex + The index of the component's role being queried. + @return An error code indicating if the function call was successful. KErrNone on success, otherwise + another of the system-wide error codes. + */ + virtual TInt ComponentRoleEnum(TPtr8& aComponentRole, TUint32 aIndex) const = 0; + + + /** + Called by the IL client to query the component's version. + + @param aVersion + The reference to the structure that is to contain the version of the component + @return An error code indicating if the function call was successful. KErrNone on success, otherwise + another of the system-wide error codes. + @see TILComponentVersion + */ + virtual TInt GetComponentVersion(TILComponentVersion& aVersion) const = 0; + + /** + Synchronous method which uses a standardized OpenMAX or vendor-specific extension string + to set a particular component configuration. + Note that in the OMX implementation of this interface this function will be used for both + SetParameter() and SetConfig(). + + @param aParameterName + The string that identifies the data container. + @param aConfig + The reference to the structure that allows access to the data container used for this + particular component configuration + @param aComponentPort + The component's port to which the config command is targeted to. + @return An error code indicating if the function call was successful. KErrNone on success, otherwise + another of the system-wide error codes. + @see TILStruct + */ + virtual TInt SetExtConfig(const TDesC8& aParameterName, const TILStruct& aConfig, const MILComponentPortIf* aComponentPort = NULL) = 0; + + /** + Synchronous method which uses a standardized OpenMAX or vendor-specific extension string + to get a particular component configuration. + + @param aParameterName + The string that identifies the data container. + @param aConfig + The reference to the structure to access the component's configuration data. + @param aComponentPort + The component's port to which the config command is targeted to. + @return An error code indicating if the function call was successful. KErrNone on success, otherwise + another of the system-wide error codes. + @see TILStruct + */ + virtual TInt GetExtConfig(const TDesC8& aParameterName, TILStruct& aConfig, const MILComponentPortIf* aComponentPort = NULL) const = 0; + + + /** + Synchronous method to set a particular instance of this interface to the specific role passed as a parameter. + A single implementation of this API may support various component roles. It is necessary for the + implementation to know what type of component is configuring so that the appropriate translation of + configuration parameters can be chosen. + The role UIDs may be defined by the client application and can be mapped be the implementation of this API + to roles the components under this layer understand. + + @param aFormat + The UID identifying the role to be played by the implementation of this API. + @return An error code indicating if the function call was successful. KErrNone on success, otherwise + another of the system-wide error codes. + */ + virtual TInt SetComponentIfRole(const TUid& aComponentRole) = 0; + + /** + Synchronous method to set a particular instance of this interface to the specific role passed as a parameter. + A single implementation of this API may support various component roles. It is necessary for the + implementation to know what type of component is configuring so that the appropriate translation of + configuration parameters can be chosen. + Usually the component role names are defined by a known standard body. For instance role names are defined + for OpenMAX IL Standard Components by Khronos Group. + + @param aComponentRole + The string identifying the role to be played by the implementation of this API. + @return An error code indicating if the function call was successful. KErrNone on success, otherwise + another of the system-wide error codes. + */ + virtual TInt SetComponentIfRole(const TDesC8& aComponentRole) = 0; + + /** + Synchronous method to query about the particular role the interface is set to. + A single implementation of this API can support various roles, however the role of the interface + is that of the physical component instantiated under this interface. + The role of the interface is set by the client after the component creation by calling SetComponentIfRole. + The role UIDs may be defined by the client application and can be mapped be the implementation of this API + to roles the components under this layer understand. + + @param aComponentRole + The UID identifying this interface's role which is to be passed back to the caller. + @return An error code indicating if the function call was successful. KErrNone on success, otherwise + another of the system-wide error codes. + */ + virtual TInt GetComponentIfRole(TUid& aComponentRole) const = 0; + + /** + Synchronous method to query about the particular role the interface is set to. + A single implementation of this API can support various roles, however the role of the interface + is that of the [hysical component instantiated under this interface. + The role of the interface is set by the client after the component creation by calling SetComponentIfRole. + Usually the component role names are defined by a known standard body. For instance role names are defined + for OpenMAX IL Standard Components by Khronos Group. + + @param aComponentRole + The string identifying this interface's role which is to be passed back to the caller. + @return An error code indicating if the function call was successful. KErrNone on success, otherwise + another of the system-wide error codes. + */ + virtual TInt GetComponentIfRole(TDes8& aComponentRole) const = 0; + + /** + Synchronous method used to identify a particular interface implementation. + It takes as a parameter the UID identifying the type of the interface requested and + it returns a pointer to the specified interface or NULL if it does not exist. + Must be cast to correct type by the user + + @param aInterfaceId + The UID associated with the interface requested. + @return A pointer to the specified interface or NULL if it has not be implemented. + */ + virtual TAny* CustomInterface(TUid aInterfaceId) = 0; + + }; + + +#endif // MILCOMPONENTIF_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/ilif/inc/milcomponentportif.h --- a/omxil/mmilapi/ilif/inc/milcomponentportif.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/ilif/inc/milcomponentportif.h Fri May 07 16:25:23 2010 +0100 @@ -1,153 +1,153 @@ -// 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 - @prototype -*/ - -#ifndef MILCOMPONENTPORTIF_H -#define MILCOMPONENTPORTIF_H - -#include -#include "ilifbase.h" -#include "milcomponentif.h" - -class MILComponentPortIf; -class MILComponentPortIfObserver; - -class CMMFBuffer; - -/** -IL Component Port interface class -*/ -class MILComponentPortIf - { -public: - - /** - Asynchronous function used to get data from an output Port. - - @param aBuffer - Reference to the buffer to be filled. - @return An error code indicating if the function call was successful. KErrNone on success, otherwise - another of the system-wide error codes. - */ - virtual TInt FillThisBuffer(CMMFBuffer& aBuffer) = 0; - - /** - Asynchronous function used to deliver data to an input Port. - - @param aBuffer - Reference to the buffer to be emptied. - @return An error code indicating if the function call was successful. KErrNone on success, otherwise - another of the system-wide error codes. - */ - virtual TInt EmptyThisBuffer(const CMMFBuffer& aBuffer) = 0; - - /** - Called by an IL client to request tunnelling between the component's port represented by this - interface and the component's port represented by the port interface passed as a parameter. - It can also be called by an IL client to request tearing down an existing tunnel by passing a NULL - port argument. - - @param aPort - The port interface representing the port to be tunelled to, or NULL to disconnect tunnel. - @return An error code indicating if the function call was successful. KErrNone on success, otherwise - another of the system-wide error codes. - */ - virtual TInt TunnelRequest(MILComponentPortIf* aPort) = 0; - - /** - Called by a component to get the index of this port. - - @return An integer specifying the index of this port. - */ - virtual TInt PortIndex() const = 0; - - /** - Called by a component to get the direction of this port. - - @return The direction of this port - */ - virtual TPortDirection PortDirection() const = 0; - - /** - Synchronous function used to instruct the port to create a buffer. - - @param aBufferSize - The size of the buffer to be created. - @leave KErrNoMemory if not sufficient memory available when creating the buffer. - @return A pointer to the newly created buffer. - */ - virtual CMMFBuffer* CreateBufferL(TInt aBufferSize) = 0; - - /** - Synchronous function used to instruct the Port to use the buffer passed - in the function's argument. - - @param aBuffer - A reference to the buffer to be used by the Port. - @return An error code indicating if the function call was successful. - KErrNone on success, otherwise another of the system-wide error codes. - */ - virtual TInt UseBuffer(CMMFBuffer& aBuffer) = 0; - - /** - Synchronous function used to instruct the port to free the buffer passed - in the function's argument. - - @param aBuffer - The buffer to be freed - @return An error code indicating if the function call was successful. - KErrNone on success, otherwise another of the system-wide error codes. - */ - virtual TInt FreeBuffer(CMMFBuffer* aBuffer) = 0; - - /** - Asynchronous function used to flush this port. - - @return An error code indicating if the function call was successful. - KErrNone on success, otherwise another of the system-wide error codes. - */ - virtual TInt FlushPort() = 0; - - /** - Asynchronous function used to enable this port. - - @return An error code indicating if the function call was successful. - KErrNone on success, otherwise another of the system-wide error codes. - */ - virtual TInt EnablePort() = 0; - - /** - Asynchronous function used to disable this port. - - @return An error code indicating if the function call was successful. - KErrNone on success, otherwise another of the system-wide error codes. - */ - virtual TInt DisablePort() = 0; - - /** - Synchronous function that returns a pointer to a component owning this port. - - @return A pointer to this port's component - */ - virtual MILComponentIf* PortComponent() const = 0; - - }; - -#endif // MILCOMPONENTPORTIF_H +// 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 + @prototype +*/ + +#ifndef MILCOMPONENTPORTIF_H +#define MILCOMPONENTPORTIF_H + +#include +#include "ilifbase.h" +#include "milcomponentif.h" + +class MILComponentPortIf; +class MILComponentPortIfObserver; + +class CMMFBuffer; + +/** +IL Component Port interface class +*/ +class MILComponentPortIf + { +public: + + /** + Asynchronous function used to get data from an output Port. + + @param aBuffer + Reference to the buffer to be filled. + @return An error code indicating if the function call was successful. KErrNone on success, otherwise + another of the system-wide error codes. + */ + virtual TInt FillThisBuffer(CMMFBuffer& aBuffer) = 0; + + /** + Asynchronous function used to deliver data to an input Port. + + @param aBuffer + Reference to the buffer to be emptied. + @return An error code indicating if the function call was successful. KErrNone on success, otherwise + another of the system-wide error codes. + */ + virtual TInt EmptyThisBuffer(const CMMFBuffer& aBuffer) = 0; + + /** + Called by an IL client to request tunnelling between the component's port represented by this + interface and the component's port represented by the port interface passed as a parameter. + It can also be called by an IL client to request tearing down an existing tunnel by passing a NULL + port argument. + + @param aPort + The port interface representing the port to be tunelled to, or NULL to disconnect tunnel. + @return An error code indicating if the function call was successful. KErrNone on success, otherwise + another of the system-wide error codes. + */ + virtual TInt TunnelRequest(MILComponentPortIf* aPort) = 0; + + /** + Called by a component to get the index of this port. + + @return An integer specifying the index of this port. + */ + virtual TInt PortIndex() const = 0; + + /** + Called by a component to get the direction of this port. + + @return The direction of this port + */ + virtual TPortDirection PortDirection() const = 0; + + /** + Synchronous function used to instruct the port to create a buffer. + + @param aBufferSize + The size of the buffer to be created. + @leave KErrNoMemory if not sufficient memory available when creating the buffer. + @return A pointer to the newly created buffer. + */ + virtual CMMFBuffer* CreateBufferL(TInt aBufferSize) = 0; + + /** + Synchronous function used to instruct the Port to use the buffer passed + in the function's argument. + + @param aBuffer + A reference to the buffer to be used by the Port. + @return An error code indicating if the function call was successful. + KErrNone on success, otherwise another of the system-wide error codes. + */ + virtual TInt UseBuffer(CMMFBuffer& aBuffer) = 0; + + /** + Synchronous function used to instruct the port to free the buffer passed + in the function's argument. + + @param aBuffer + The buffer to be freed + @return An error code indicating if the function call was successful. + KErrNone on success, otherwise another of the system-wide error codes. + */ + virtual TInt FreeBuffer(CMMFBuffer* aBuffer) = 0; + + /** + Asynchronous function used to flush this port. + + @return An error code indicating if the function call was successful. + KErrNone on success, otherwise another of the system-wide error codes. + */ + virtual TInt FlushPort() = 0; + + /** + Asynchronous function used to enable this port. + + @return An error code indicating if the function call was successful. + KErrNone on success, otherwise another of the system-wide error codes. + */ + virtual TInt EnablePort() = 0; + + /** + Asynchronous function used to disable this port. + + @return An error code indicating if the function call was successful. + KErrNone on success, otherwise another of the system-wide error codes. + */ + virtual TInt DisablePort() = 0; + + /** + Synchronous function that returns a pointer to a component owning this port. + + @return A pointer to this port's component + */ + virtual MILComponentIf* PortComponent() const = 0; + + }; + +#endif // MILCOMPONENTPORTIF_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/ilif/inc/milifobserver.h --- a/omxil/mmilapi/ilif/inc/milifobserver.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/ilif/inc/milifobserver.h Fri May 07 16:25:23 2010 +0100 @@ -1,68 +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: -// - -/** - @file - @internalTechnology - @prototype -*/ - -#ifndef MILIFOBSERVER_H -#define MILIFOBSERVER_H - -#include -#include "ilifbase.h" - -class CMMFBuffer; -class MILComponentIf; - -/** -IL Component observer class -*/ -class MILIfObserver - { -public: - /** - Callback function to send an event/message to the component observer, i.e. the IL client. - - @param aComponent - The IL Component which sent the callback. - @param aEvent - A reference to the structure that contains the event data. - Any implementation of this function should be able to handle expected and unexpected events. - @return An error code indicating if the function call was successful. KErrNone on success, otherwise - another of the system-wide error codes. - @see TILEvent - */ - virtual TInt MsgFromILComponent(const MILComponentIf* aComponent, const TILEvent& aEvent) = 0; - - /** - Callback function to return to the component port observer the buffer that has been delivered. - The observer is usually the IL client or another port. - - Note that for some implementations this is essentially equivalent to EmptyBufferDone() from input - ports and FillBufferDone() from output ports. - - @param aPort - The interface from the port which sent the callback. - @param aBuffer - The buffer returned by the IL component. - @return An error code indicating if the function call was successful. KErrNone on success, otherwise - another of the system-wide error codes. - */ - virtual TInt BufferDelivered(const MILComponentPortIf* aPort, const CMMFBuffer* aBuffer) = 0; - }; - -#endif // MILIFOBSERVER_H +// 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 + @prototype +*/ + +#ifndef MILIFOBSERVER_H +#define MILIFOBSERVER_H + +#include +#include "ilifbase.h" + +class CMMFBuffer; +class MILComponentIf; + +/** +IL Component observer class +*/ +class MILIfObserver + { +public: + /** + Callback function to send an event/message to the component observer, i.e. the IL client. + + @param aComponent + The IL Component which sent the callback. + @param aEvent + A reference to the structure that contains the event data. + Any implementation of this function should be able to handle expected and unexpected events. + @return An error code indicating if the function call was successful. KErrNone on success, otherwise + another of the system-wide error codes. + @see TILEvent + */ + virtual TInt MsgFromILComponent(const MILComponentIf* aComponent, const TILEvent& aEvent) = 0; + + /** + Callback function to return to the component port observer the buffer that has been delivered. + The observer is usually the IL client or another port. + + Note that for some implementations this is essentially equivalent to EmptyBufferDone() from input + ports and FillBufferDone() from output ports. + + @param aPort + The interface from the port which sent the callback. + @param aBuffer + The buffer returned by the IL component. + @return An error code indicating if the function call was successful. KErrNone on success, otherwise + another of the system-wide error codes. + */ + virtual TInt BufferDelivered(const MILComponentPortIf* aPort, const CMMFBuffer* aBuffer) = 0; + }; + +#endif // MILIFOBSERVER_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/ilif/inc/tilstruct.h --- a/omxil/mmilapi/ilif/inc/tilstruct.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/ilif/inc/tilstruct.h Fri May 07 16:25:23 2010 +0100 @@ -1,61 +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: -// - -/** - @file - @internalTechnology - @prototype -*/ - -#ifndef TILSTRUCT_H -#define TILSTRUCT_H - -#include - -/** -Configuration structure base class. -Represents a configuration structure identified by a base class. -*/ -class TILStruct - { -public: - inline const TUid& Uid() const; - -protected: - inline TILStruct(); - -protected: - TUid iUid; - }; - -/** -Template class to create a TILStruct configuration given a structure and an unique UID to identify it. -*/ -template -class TILStructParam : public TILStruct - { -public: - inline TILStructParam(const T& aParameterStructure); - inline TILStructParam(); - inline operator T&(); - inline static const T* GetStructure(const TILStruct& aConfig); - inline static T* GetStructure(TILStruct& aConfig); -private: - TPckgBuf iBuf; - }; - -#include "tilstruct.inl" - -#endif // TILSTRUCT_H +// 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 + @prototype +*/ + +#ifndef TILSTRUCT_H +#define TILSTRUCT_H + +#include + +/** +Configuration structure base class. +Represents a configuration structure identified by a base class. +*/ +class TILStruct + { +public: + inline const TUid& Uid() const; + +protected: + inline TILStruct(); + +protected: + TUid iUid; + }; + +/** +Template class to create a TILStruct configuration given a structure and an unique UID to identify it. +*/ +template +class TILStructParam : public TILStruct + { +public: + inline TILStructParam(const T& aParameterStructure); + inline TILStructParam(); + inline operator T&(); + inline static const T* GetStructure(const TILStruct& aConfig); + inline static T* GetStructure(TILStruct& aConfig); +private: + TPckgBuf iBuf; + }; + +#include "tilstruct.inl" + +#endif // TILSTRUCT_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/ilif/inc/tilstruct.inl --- a/omxil/mmilapi/ilif/inc/tilstruct.inl Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/ilif/inc/tilstruct.inl Fri May 07 16:25:23 2010 +0100 @@ -1,99 +1,99 @@ -// 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 - @prototype -*/ - -#ifndef TILSTRUCT_INL -#define TILSTRUCT_INL - -/** -Constructor -*/ -inline TILStruct::TILStruct() - : - iUid(KNullUid) - { - } - -/** -Obtain the UID identifying the structure. -@return The identifying UID of the structure. -*/ -inline const TUid& TILStruct::Uid() const - { - return iUid; - } - -/** -Constructor -@param aParameterStructure The structure to store -*/ -template -inline TILStructParam::TILStructParam(const T& aParameterStructure) - { - iUid = TUid::Uid(U); - iBuf = TPckgBuf(aParameterStructure); - } - -/** -Default Constructor -*/ -template -inline TILStructParam::TILStructParam() - { - iUid = TUid::Uid(U); - } - -/** -Operator to return the structure represented by the class. -@return The structure represented by the class. -*/ -template -inline TILStructParam::operator T&() - { - return iBuf(); - } - -/** -Static method to return the structure represented by TILStruct. -@param A const reference to the base structure. -@return A const pointer to the structure represented by the class. -*/ -template -inline const T* TILStructParam::GetStructure(const TILStruct& aConfig) - { - const T* ptr = &((static_cast& >(aConfig)).iBuf()); - return ptr; - } - -/** -Static method to return the structure represented by TILStruct. -@param A reference to the base structure. -@return A pointer to the structure represented by the class. -*/ -template -inline T* TILStructParam::GetStructure(TILStruct& aConfig) - { - T* ptr = &((static_cast& >(aConfig)).iBuf()); - return ptr; - } - - - -#endif // TILSTRUCT_INL +// 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 + @prototype +*/ + +#ifndef TILSTRUCT_INL +#define TILSTRUCT_INL + +/** +Constructor +*/ +inline TILStruct::TILStruct() + : + iUid(KNullUid) + { + } + +/** +Obtain the UID identifying the structure. +@return The identifying UID of the structure. +*/ +inline const TUid& TILStruct::Uid() const + { + return iUid; + } + +/** +Constructor +@param aParameterStructure The structure to store +*/ +template +inline TILStructParam::TILStructParam(const T& aParameterStructure) + { + iUid = TUid::Uid(U); + iBuf = TPckgBuf(aParameterStructure); + } + +/** +Default Constructor +*/ +template +inline TILStructParam::TILStructParam() + { + iUid = TUid::Uid(U); + } + +/** +Operator to return the structure represented by the class. +@return The structure represented by the class. +*/ +template +inline TILStructParam::operator T&() + { + return iBuf(); + } + +/** +Static method to return the structure represented by TILStruct. +@param A const reference to the base structure. +@return A const pointer to the structure represented by the class. +*/ +template +inline const T* TILStructParam::GetStructure(const TILStruct& aConfig) + { + const T* ptr = &((static_cast& >(aConfig)).iBuf()); + return ptr; + } + +/** +Static method to return the structure represented by TILStruct. +@param A reference to the base structure. +@return A pointer to the structure represented by the class. +*/ +template +inline T* TILStructParam::GetStructure(TILStruct& aConfig) + { + T* ptr = &((static_cast& >(aConfig)).iBuf()); + return ptr; + } + + + +#endif // TILSTRUCT_INL diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/ilif/inc/tilstructtypes.h --- a/omxil/mmilapi/ilif/inc/tilstructtypes.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/ilif/inc/tilstructtypes.h Fri May 07 16:25:23 2010 +0100 @@ -1,154 +1,154 @@ -// 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 - @prototype -*/ - -#ifndef TILSTRUCTTYPES_H -#define TILSTRUCTTYPES_H - -#include "tilstruct.h" -#include "iltypeuids.h" -#include "ilconfigstructs.h" -#include "ilaudioconfigstructs.h" -#include - - -/** -TILStruct to encapsulate TTaskConfig -see KUidMMFTTaskConfig -see TILStructParam -*/ -typedef TILStructParam TILTaskConfig; - -/** -TILStruct to encapsulate TAudioSpecificConfigType -see KUidMMFAudioSpecificConfigType -see TILStructParam -*/ -typedef TILStructParam TILAudioSpecificConfig; - -/** -TILStruct to encapsulate TPortDefinitionType -see KUidTPortDefinitionType -see TILStructParam -*/ -typedef TILStructParam TILPortDefinition; - -/** -TILStruct to encapsulate TTimeIntervalMicroSeconds containing the volume ramping interval -see KUidMMFVorlumeRampType -see TILStructParam -*/ -typedef TILStructParam TILVolumeRamp; - -/** -TILStruct to encapsulate the TUint containing the volume setting -see KUidMMFVolumeType -see TILStructParam -*/ -typedef TILStructParam TILVolume; - -/** -TILStruct to encapsulate the TUint containing the number of bytes played -see KUidMMFBytesPlayedType -see TILStructParam -*/ -typedef TILStructParam TILBytesPlayed; - - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* The rest of this file defines some structures that are not publishedPartner yet. -/* They have been defined for internal used only as a proof of concept for testing -/* the various possible MILIF implementations. -/* These definition could be upgraded to publishedPartner when the need for Symbian -/* support of these particular params arises. -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - - -/** -TILStruct to encapsulate TAacConfig -see KUidMMFTAacConfig -see TILStructParam - -@internalTechnology -@prototype -*/ -typedef TILStructParam TILAacConfig; - -/** -TILStruct to encapsulate TAudioPortFormatType -see KUidTAudioPortFormatType -see TILStructParam - -@internalTechnology -@prototype -*/ -typedef TILStructParam TILAudioPortFormat; - -/** -TILStruct to encapsulate TPortVorbisType -see KUidTPortVorbisType -see TILStructParam - -@internalTechnology -@prototype -*/ -typedef TILStructParam TILPortVorbis; - -/** -TILStruct to encapsulate TPortPCMModeType -see KUidTPortPCMModeType -see TILStructParam - -@internalTechnology -@prototype -*/ -typedef TILStructParam TILPortPCMMode; - -/** -TILStruct to encapsulate TPortAACProfileType -see KUidTPortAACProfileType -see TILStructParam - -@internalTechnology -@prototype -*/ -typedef TILStructParam TILPortAACProfile; - -/** -TILStruct to encapsulate TPortVolumeType -see KUidTPortVolumeType -see TILStructParam - -@internalTechnology -@prototype -*/ -typedef TILStructParam TILPortVolume; - -/** -TILStruct to encapsulate TPortMuteType -see KUidTPortMuteType -see TILStructParam - -@internalTechnology -@prototype -*/ -typedef TILStructParam TILPortMute; - +// 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 + @prototype +*/ + +#ifndef TILSTRUCTTYPES_H +#define TILSTRUCTTYPES_H + +#include "tilstruct.h" +#include "iltypeuids.h" +#include "ilconfigstructs.h" +#include "ilaudioconfigstructs.h" +#include + + +/** +TILStruct to encapsulate TTaskConfig +see KUidMMFTTaskConfig +see TILStructParam +*/ +typedef TILStructParam TILTaskConfig; + +/** +TILStruct to encapsulate TAudioSpecificConfigType +see KUidMMFAudioSpecificConfigType +see TILStructParam +*/ +typedef TILStructParam TILAudioSpecificConfig; + +/** +TILStruct to encapsulate TPortDefinitionType +see KUidTPortDefinitionType +see TILStructParam +*/ +typedef TILStructParam TILPortDefinition; + +/** +TILStruct to encapsulate TTimeIntervalMicroSeconds containing the volume ramping interval +see KUidMMFVorlumeRampType +see TILStructParam +*/ +typedef TILStructParam TILVolumeRamp; + +/** +TILStruct to encapsulate the TUint containing the volume setting +see KUidMMFVolumeType +see TILStructParam +*/ +typedef TILStructParam TILVolume; + +/** +TILStruct to encapsulate the TUint containing the number of bytes played +see KUidMMFBytesPlayedType +see TILStructParam +*/ +typedef TILStructParam TILBytesPlayed; + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/* The rest of this file defines some structures that are not publishedPartner yet. +/* They have been defined for internal used only as a proof of concept for testing +/* the various possible MILIF implementations. +/* These definition could be upgraded to publishedPartner when the need for Symbian +/* support of these particular params arises. +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + +/** +TILStruct to encapsulate TAacConfig +see KUidMMFTAacConfig +see TILStructParam + +@internalTechnology +@prototype +*/ +typedef TILStructParam TILAacConfig; + +/** +TILStruct to encapsulate TAudioPortFormatType +see KUidTAudioPortFormatType +see TILStructParam + +@internalTechnology +@prototype +*/ +typedef TILStructParam TILAudioPortFormat; + +/** +TILStruct to encapsulate TPortVorbisType +see KUidTPortVorbisType +see TILStructParam + +@internalTechnology +@prototype +*/ +typedef TILStructParam TILPortVorbis; + +/** +TILStruct to encapsulate TPortPCMModeType +see KUidTPortPCMModeType +see TILStructParam + +@internalTechnology +@prototype +*/ +typedef TILStructParam TILPortPCMMode; + +/** +TILStruct to encapsulate TPortAACProfileType +see KUidTPortAACProfileType +see TILStructParam + +@internalTechnology +@prototype +*/ +typedef TILStructParam TILPortAACProfile; + +/** +TILStruct to encapsulate TPortVolumeType +see KUidTPortVolumeType +see TILStructParam + +@internalTechnology +@prototype +*/ +typedef TILStructParam TILPortVolume; + +/** +TILStruct to encapsulate TPortMuteType +see KUidTPortMuteType +see TILStructParam + +@internalTechnology +@prototype +*/ +typedef TILStructParam TILPortMute; + #endif // TILSTRUCTTYPES_H \ No newline at end of file diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/ilif/inc/tomxilstruct.h --- a/omxil/mmilapi/ilif/inc/tomxilstruct.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/ilif/inc/tomxilstruct.h Fri May 07 16:25:23 2010 +0100 @@ -1,52 +1,52 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// - -/** - @file - @internalTechnology - @prototype -*/ - -#ifndef TOMXILSTRUCT_H -#define TOMXILSTRUCT_H - -#include "tilstruct.h" -#include - -/** -A typedef to symbianize the OpenMAX IL index type structure. -*/ -typedef OMX_INDEXTYPE TILStructIndex; - - -/** -Derived class to create a TILStruct configuration given an index and a pointer to a parameter structure. -The index identifies the param structure -*/ -class TOMXILStructParam : public TILStruct - { -public: - inline TOMXILStructParam(TAny* aParam, TILStructIndex aIndex); - inline TAny* Param() const; - inline TILStructIndex Index() const; - -private: - TAny* iParam; // Not owned - TILStructIndex iIndex; - }; - -#include "tomxilstruct.inl" - -#endif // TOMXILSTRUCT_H +// 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 + @prototype +*/ + +#ifndef TOMXILSTRUCT_H +#define TOMXILSTRUCT_H + +#include "tilstruct.h" +#include + +/** +A typedef to symbianize the OpenMAX IL index type structure. +*/ +typedef OMX_INDEXTYPE TILStructIndex; + + +/** +Derived class to create a TILStruct configuration given an index and a pointer to a parameter structure. +The index identifies the param structure +*/ +class TOMXILStructParam : public TILStruct + { +public: + inline TOMXILStructParam(TAny* aParam, TILStructIndex aIndex); + inline TAny* Param() const; + inline TILStructIndex Index() const; + +private: + TAny* iParam; // Not owned + TILStructIndex iIndex; + }; + +#include "tomxilstruct.inl" + +#endif // TOMXILSTRUCT_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/ilif/inc/tomxilstruct.inl --- a/omxil/mmilapi/ilif/inc/tomxilstruct.inl Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/ilif/inc/tomxilstruct.inl Fri May 07 16:25:23 2010 +0100 @@ -1,68 +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: -// - -/** - @file - @internalTechnology - @prototype -*/ - -#ifndef TOMXILSTRUCT_INL -#define TOMXILSTRUCT_INL - - -/** -Constructor - -@param aParam - The pointer to the structure associated to the particular index stored in this wrapper class. -@param aIndex - An index to identify the definition of the structure pointed to by this wrapper class. -*/ -inline TOMXILStructParam::TOMXILStructParam(TAny* aParam, TILStructIndex aIndex) - : iParam(aParam), iIndex(aIndex) -{ - ASSERT(aParam); - - iUid = TUid::Uid(KUidOMXILStructType); -} - - -/** -Method to return the pointer to the structure represented by the index stored in this TOMXILStructParam. -The pointer should be cast to the structure associated to the TILStructIndex stored TOMXILStructParam - -@return A pointer to the OMX IL structure represented by this particular instance of the TOMXILStructParam -*/ -inline TAny* TOMXILStructParam::Param() const -{ - // This is not a const method. The fields in Param could be modified by the client. - return iParam; -} - - -/** -Method to return the TILStructIndex. - -@return A TILStructIndex index -@see TILStructIndex -*/ -inline TILStructIndex TOMXILStructParam::Index() const -{ - return iIndex; -} - - -#endif // TOMXILSTRUCT_INL +// 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 + @prototype +*/ + +#ifndef TOMXILSTRUCT_INL +#define TOMXILSTRUCT_INL + + +/** +Constructor + +@param aParam + The pointer to the structure associated to the particular index stored in this wrapper class. +@param aIndex + An index to identify the definition of the structure pointed to by this wrapper class. +*/ +inline TOMXILStructParam::TOMXILStructParam(TAny* aParam, TILStructIndex aIndex) + : iParam(aParam), iIndex(aIndex) +{ + ASSERT(aParam); + + iUid = TUid::Uid(KUidOMXILStructType); +} + + +/** +Method to return the pointer to the structure represented by the index stored in this TOMXILStructParam. +The pointer should be cast to the structure associated to the TILStructIndex stored TOMXILStructParam + +@return A pointer to the OMX IL structure represented by this particular instance of the TOMXILStructParam +*/ +inline TAny* TOMXILStructParam::Param() const +{ + // This is not a const method. The fields in Param could be modified by the client. + return iParam; +} + + +/** +Method to return the TILStructIndex. + +@return A TILStructIndex index +@see TILStructIndex +*/ +inline TILStructIndex TOMXILStructParam::Index() const +{ + return iIndex; +} + + +#endif // TOMXILSTRUCT_INL diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/refomxil/bwins/omxilgenericilif.def --- a/omxil/mmilapi/refomxil/bwins/omxilgenericilif.def Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/refomxil/bwins/omxilgenericilif.def Fri May 07 16:25:23 2010 +0100 @@ -1,36 +1,36 @@ -EXPORTS - ??0COmxILGenericILIF@@IAE@XZ @ 1 NONAME ; COmxILGenericILIF::COmxILGenericILIF(void) - ??1COmxILGenericILIF@@UAE@XZ @ 2 NONAME ; COmxILGenericILIF::~COmxILGenericILIF(void) - ?ComponentRoleEnum@COmxILGenericILIF@@UBEHAAVTPtr8@@K@Z @ 3 NONAME ; int COmxILGenericILIF::ComponentRoleEnum(class TPtr8 &, unsigned long) const - ?CreateComponentL@COmxILGenericILIF@@UAEXABVTDesC8@@AAVMILIfObserver@@@Z @ 4 NONAME ; void COmxILGenericILIF::CreateComponentL(class TDesC8 const &, class MILIfObserver &) - ?CreateComponentL@COmxILGenericILIF@@UAEXABVTUid@@AAVMILIfObserver@@@Z @ 5 NONAME ; void COmxILGenericILIF::CreateComponentL(class TUid const &, class MILIfObserver &) - ?CustomInterface@COmxILGenericILIF@@UAEPAXVTUid@@@Z @ 6 NONAME ; void * COmxILGenericILIF::CustomInterface(class TUid) - ?EmptyBufferDone@COmxILGenericILIF@@UAEHPBVCMMFBuffer@@H@Z @ 7 NONAME ; int COmxILGenericILIF::EmptyBufferDone(class CMMFBuffer const *, int) - ?EventHandler@COmxILGenericILIF@@UAEHW4OMX_EVENTTYPE@@KKPAX@Z @ 8 NONAME ; int COmxILGenericILIF::EventHandler(enum OMX_EVENTTYPE, unsigned long, unsigned long, void *) - ?Execute@COmxILGenericILIF@@UAEHXZ @ 9 NONAME ; int COmxILGenericILIF::Execute(void) - ?FillBufferDone@COmxILGenericILIF@@UAEHPAVCMMFBuffer@@H@Z @ 10 NONAME ; int COmxILGenericILIF::FillBufferDone(class CMMFBuffer *, int) - ?FlushAllPorts@COmxILGenericILIF@@UAEHXZ @ 11 NONAME ; int COmxILGenericILIF::FlushAllPorts(void) - ?GetComponentIfRole@COmxILGenericILIF@@UBEHAAVTDes8@@@Z @ 12 NONAME ; int COmxILGenericILIF::GetComponentIfRole(class TDes8 &) const - ?GetComponentIfRole@COmxILGenericILIF@@UBEHAAVTUid@@@Z @ 13 NONAME ; int COmxILGenericILIF::GetComponentIfRole(class TUid &) const - ?GetComponentInputPorts@COmxILGenericILIF@@UBEHAAV?$RPointerArray@VMILComponentPortIf@@@@@Z @ 14 NONAME ; int COmxILGenericILIF::GetComponentInputPorts(class RPointerArray &) const - ?GetComponentOutputPorts@COmxILGenericILIF@@UBEHAAV?$RPointerArray@VMILComponentPortIf@@@@@Z @ 15 NONAME ; int COmxILGenericILIF::GetComponentOutputPorts(class RPointerArray &) const - ?GetComponentVersion@COmxILGenericILIF@@UBEHAAVTILComponentVersion@@@Z @ 16 NONAME ; int COmxILGenericILIF::GetComponentVersion(class TILComponentVersion &) const - ?GetConfig@COmxILGenericILIF@@UBEHAAVTILStruct@@PBVMILComponentPortIf@@@Z @ 17 NONAME ; int COmxILGenericILIF::GetConfig(class TILStruct &, class MILComponentPortIf const *) const - ?GetExtConfig@COmxILGenericILIF@@UBEHABVTDesC8@@AAVTILStruct@@PBVMILComponentPortIf@@@Z @ 18 NONAME ; int COmxILGenericILIF::GetExtConfig(class TDesC8 const &, class TILStruct &, class MILComponentPortIf const *) const - ?GetState@COmxILGenericILIF@@UBEHAAW4TILComponentState@@@Z @ 19 NONAME ; int COmxILGenericILIF::GetState(enum TILComponentState &) const - ?Initialize@COmxILGenericILIF@@UAEHXZ @ 20 NONAME ; int COmxILGenericILIF::Initialize(void) - ?OmxGetConfig@COmxILGenericILIF@@IBEHW4OMX_INDEXTYPE@@PAX@Z @ 21 NONAME ; int COmxILGenericILIF::OmxGetConfig(enum OMX_INDEXTYPE, void *) const - ?OmxGetExtensionIndex@COmxILGenericILIF@@IBEHABVTDesC8@@PAW4OMX_INDEXTYPE@@@Z @ 22 NONAME ; int COmxILGenericILIF::OmxGetExtensionIndex(class TDesC8 const &, enum OMX_INDEXTYPE *) const - ?OmxGetParameter@COmxILGenericILIF@@IBEHW4OMX_INDEXTYPE@@PAX@Z @ 23 NONAME ; int COmxILGenericILIF::OmxGetParameter(enum OMX_INDEXTYPE, void *) const - ?OmxSetConfig@COmxILGenericILIF@@IAEHW4OMX_INDEXTYPE@@PAX@Z @ 24 NONAME ; int COmxILGenericILIF::OmxSetConfig(enum OMX_INDEXTYPE, void *) - ?OmxSetParameter@COmxILGenericILIF@@IAEHW4OMX_INDEXTYPE@@PAX@Z @ 25 NONAME ; int COmxILGenericILIF::OmxSetParameter(enum OMX_INDEXTYPE, void *) - ?Pause@COmxILGenericILIF@@UAEHXZ @ 26 NONAME ; int COmxILGenericILIF::Pause(void) - ?ReleaseComponent@COmxILGenericILIF@@UAEXXZ @ 27 NONAME ; void COmxILGenericILIF::ReleaseComponent(void) - ?SendCommand@COmxILGenericILIF@@UAEHABVTILCommand@@@Z @ 28 NONAME ; int COmxILGenericILIF::SendCommand(class TILCommand const &) - ?SetComponentIfRole@COmxILGenericILIF@@UAEHABVTDesC8@@@Z @ 29 NONAME ; int COmxILGenericILIF::SetComponentIfRole(class TDesC8 const &) - ?SetComponentIfRole@COmxILGenericILIF@@UAEHABVTUid@@@Z @ 30 NONAME ; int COmxILGenericILIF::SetComponentIfRole(class TUid const &) - ?SetConfig@COmxILGenericILIF@@UAEHABVTILStruct@@PBVMILComponentPortIf@@@Z @ 31 NONAME ; int COmxILGenericILIF::SetConfig(class TILStruct const &, class MILComponentPortIf const *) - ?SetExtConfig@COmxILGenericILIF@@UAEHABVTDesC8@@ABVTILStruct@@PBVMILComponentPortIf@@@Z @ 32 NONAME ; int COmxILGenericILIF::SetExtConfig(class TDesC8 const &, class TILStruct const &, class MILComponentPortIf const *) - ?Stop@COmxILGenericILIF@@UAEHXZ @ 33 NONAME ; int COmxILGenericILIF::Stop(void) - ?UnInitialize@COmxILGenericILIF@@UAEHXZ @ 34 NONAME ; int COmxILGenericILIF::UnInitialize(void) - +EXPORTS + ??0COmxILGenericILIF@@IAE@XZ @ 1 NONAME ; COmxILGenericILIF::COmxILGenericILIF(void) + ??1COmxILGenericILIF@@UAE@XZ @ 2 NONAME ; COmxILGenericILIF::~COmxILGenericILIF(void) + ?ComponentRoleEnum@COmxILGenericILIF@@UBEHAAVTPtr8@@K@Z @ 3 NONAME ; int COmxILGenericILIF::ComponentRoleEnum(class TPtr8 &, unsigned long) const + ?CreateComponentL@COmxILGenericILIF@@UAEXABVTDesC8@@AAVMILIfObserver@@@Z @ 4 NONAME ; void COmxILGenericILIF::CreateComponentL(class TDesC8 const &, class MILIfObserver &) + ?CreateComponentL@COmxILGenericILIF@@UAEXABVTUid@@AAVMILIfObserver@@@Z @ 5 NONAME ; void COmxILGenericILIF::CreateComponentL(class TUid const &, class MILIfObserver &) + ?CustomInterface@COmxILGenericILIF@@UAEPAXVTUid@@@Z @ 6 NONAME ; void * COmxILGenericILIF::CustomInterface(class TUid) + ?EmptyBufferDone@COmxILGenericILIF@@UAEHPBVCMMFBuffer@@H@Z @ 7 NONAME ; int COmxILGenericILIF::EmptyBufferDone(class CMMFBuffer const *, int) + ?EventHandler@COmxILGenericILIF@@UAEHW4OMX_EVENTTYPE@@KKPAX@Z @ 8 NONAME ; int COmxILGenericILIF::EventHandler(enum OMX_EVENTTYPE, unsigned long, unsigned long, void *) + ?Execute@COmxILGenericILIF@@UAEHXZ @ 9 NONAME ; int COmxILGenericILIF::Execute(void) + ?FillBufferDone@COmxILGenericILIF@@UAEHPAVCMMFBuffer@@H@Z @ 10 NONAME ; int COmxILGenericILIF::FillBufferDone(class CMMFBuffer *, int) + ?FlushAllPorts@COmxILGenericILIF@@UAEHXZ @ 11 NONAME ; int COmxILGenericILIF::FlushAllPorts(void) + ?GetComponentIfRole@COmxILGenericILIF@@UBEHAAVTDes8@@@Z @ 12 NONAME ; int COmxILGenericILIF::GetComponentIfRole(class TDes8 &) const + ?GetComponentIfRole@COmxILGenericILIF@@UBEHAAVTUid@@@Z @ 13 NONAME ; int COmxILGenericILIF::GetComponentIfRole(class TUid &) const + ?GetComponentInputPorts@COmxILGenericILIF@@UBEHAAV?$RPointerArray@VMILComponentPortIf@@@@@Z @ 14 NONAME ; int COmxILGenericILIF::GetComponentInputPorts(class RPointerArray &) const + ?GetComponentOutputPorts@COmxILGenericILIF@@UBEHAAV?$RPointerArray@VMILComponentPortIf@@@@@Z @ 15 NONAME ; int COmxILGenericILIF::GetComponentOutputPorts(class RPointerArray &) const + ?GetComponentVersion@COmxILGenericILIF@@UBEHAAVTILComponentVersion@@@Z @ 16 NONAME ; int COmxILGenericILIF::GetComponentVersion(class TILComponentVersion &) const + ?GetConfig@COmxILGenericILIF@@UBEHAAVTILStruct@@PBVMILComponentPortIf@@@Z @ 17 NONAME ; int COmxILGenericILIF::GetConfig(class TILStruct &, class MILComponentPortIf const *) const + ?GetExtConfig@COmxILGenericILIF@@UBEHABVTDesC8@@AAVTILStruct@@PBVMILComponentPortIf@@@Z @ 18 NONAME ; int COmxILGenericILIF::GetExtConfig(class TDesC8 const &, class TILStruct &, class MILComponentPortIf const *) const + ?GetState@COmxILGenericILIF@@UBEHAAW4TILComponentState@@@Z @ 19 NONAME ; int COmxILGenericILIF::GetState(enum TILComponentState &) const + ?Initialize@COmxILGenericILIF@@UAEHXZ @ 20 NONAME ; int COmxILGenericILIF::Initialize(void) + ?OmxGetConfig@COmxILGenericILIF@@IBEHW4OMX_INDEXTYPE@@PAX@Z @ 21 NONAME ; int COmxILGenericILIF::OmxGetConfig(enum OMX_INDEXTYPE, void *) const + ?OmxGetExtensionIndex@COmxILGenericILIF@@IBEHABVTDesC8@@PAW4OMX_INDEXTYPE@@@Z @ 22 NONAME ; int COmxILGenericILIF::OmxGetExtensionIndex(class TDesC8 const &, enum OMX_INDEXTYPE *) const + ?OmxGetParameter@COmxILGenericILIF@@IBEHW4OMX_INDEXTYPE@@PAX@Z @ 23 NONAME ; int COmxILGenericILIF::OmxGetParameter(enum OMX_INDEXTYPE, void *) const + ?OmxSetConfig@COmxILGenericILIF@@IAEHW4OMX_INDEXTYPE@@PAX@Z @ 24 NONAME ; int COmxILGenericILIF::OmxSetConfig(enum OMX_INDEXTYPE, void *) + ?OmxSetParameter@COmxILGenericILIF@@IAEHW4OMX_INDEXTYPE@@PAX@Z @ 25 NONAME ; int COmxILGenericILIF::OmxSetParameter(enum OMX_INDEXTYPE, void *) + ?Pause@COmxILGenericILIF@@UAEHXZ @ 26 NONAME ; int COmxILGenericILIF::Pause(void) + ?ReleaseComponent@COmxILGenericILIF@@UAEXXZ @ 27 NONAME ; void COmxILGenericILIF::ReleaseComponent(void) + ?SendCommand@COmxILGenericILIF@@UAEHABVTILCommand@@@Z @ 28 NONAME ; int COmxILGenericILIF::SendCommand(class TILCommand const &) + ?SetComponentIfRole@COmxILGenericILIF@@UAEHABVTDesC8@@@Z @ 29 NONAME ; int COmxILGenericILIF::SetComponentIfRole(class TDesC8 const &) + ?SetComponentIfRole@COmxILGenericILIF@@UAEHABVTUid@@@Z @ 30 NONAME ; int COmxILGenericILIF::SetComponentIfRole(class TUid const &) + ?SetConfig@COmxILGenericILIF@@UAEHABVTILStruct@@PBVMILComponentPortIf@@@Z @ 31 NONAME ; int COmxILGenericILIF::SetConfig(class TILStruct const &, class MILComponentPortIf const *) + ?SetExtConfig@COmxILGenericILIF@@UAEHABVTDesC8@@ABVTILStruct@@PBVMILComponentPortIf@@@Z @ 32 NONAME ; int COmxILGenericILIF::SetExtConfig(class TDesC8 const &, class TILStruct const &, class MILComponentPortIf const *) + ?Stop@COmxILGenericILIF@@UAEHXZ @ 33 NONAME ; int COmxILGenericILIF::Stop(void) + ?UnInitialize@COmxILGenericILIF@@UAEHXZ @ 34 NONAME ; int COmxILGenericILIF::UnInitialize(void) + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/refomxil/eabi/omxilgenericilif.def --- a/omxil/mmilapi/refomxil/eabi/omxilgenericilif.def Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/refomxil/eabi/omxilgenericilif.def Fri May 07 16:25:23 2010 +0100 @@ -1,73 +1,73 @@ -EXPORTS - _ZN17COmxILGenericILIF10InitializeEv @ 1 NONAME - _ZN17COmxILGenericILIF11SendCommandERK10TILCommand @ 2 NONAME - _ZN17COmxILGenericILIF12EventHandlerE13OMX_EVENTTYPEmmPv @ 3 NONAME - _ZN17COmxILGenericILIF12OmxSetConfigE13OMX_INDEXTYPEPv @ 4 NONAME - _ZN17COmxILGenericILIF12SetExtConfigERK6TDesC8RK9TILStructPK18MILComponentPortIf @ 5 NONAME - _ZN17COmxILGenericILIF12UnInitializeEv @ 6 NONAME - _ZN17COmxILGenericILIF13FlushAllPortsEv @ 7 NONAME - _ZN17COmxILGenericILIF14FillBufferDoneEP10CMMFBufferi @ 8 NONAME - _ZN17COmxILGenericILIF15CustomInterfaceE4TUid @ 9 NONAME - _ZN17COmxILGenericILIF15EmptyBufferDoneEPK10CMMFBufferi @ 10 NONAME - _ZN17COmxILGenericILIF15OmxSetParameterE13OMX_INDEXTYPEPv @ 11 NONAME - _ZN17COmxILGenericILIF16CreateComponentLERK4TUidR13MILIfObserver @ 12 NONAME - _ZN17COmxILGenericILIF16CreateComponentLERK6TDesC8R13MILIfObserver @ 13 NONAME - _ZN17COmxILGenericILIF16ReleaseComponentEv @ 14 NONAME - _ZN17COmxILGenericILIF18SetComponentIfRoleERK4TUid @ 15 NONAME - _ZN17COmxILGenericILIF18SetComponentIfRoleERK6TDesC8 @ 16 NONAME - _ZN17COmxILGenericILIF4StopEv @ 17 NONAME - _ZN17COmxILGenericILIF5PauseEv @ 18 NONAME - _ZN17COmxILGenericILIF7ExecuteEv @ 19 NONAME - _ZN17COmxILGenericILIF9SetConfigERK9TILStructPK18MILComponentPortIf @ 20 NONAME - _ZN17COmxILGenericILIFC2Ev @ 21 NONAME - _ZN17COmxILGenericILIFD0Ev @ 22 NONAME - _ZN17COmxILGenericILIFD1Ev @ 23 NONAME - _ZN17COmxILGenericILIFD2Ev @ 24 NONAME - _ZNK17COmxILGenericILIF12GetExtConfigERK6TDesC8R9TILStructPK18MILComponentPortIf @ 25 NONAME - _ZNK17COmxILGenericILIF12OmxGetConfigE13OMX_INDEXTYPEPv @ 26 NONAME - _ZNK17COmxILGenericILIF15OmxGetParameterE13OMX_INDEXTYPEPv @ 27 NONAME - _ZNK17COmxILGenericILIF17ComponentRoleEnumER5TPtr8m @ 28 NONAME - _ZNK17COmxILGenericILIF18GetComponentIfRoleER4TUid @ 29 NONAME - _ZNK17COmxILGenericILIF18GetComponentIfRoleER5TDes8 @ 30 NONAME - _ZNK17COmxILGenericILIF19GetComponentVersionER19TILComponentVersion @ 31 NONAME - _ZNK17COmxILGenericILIF20OmxGetExtensionIndexERK6TDesC8P13OMX_INDEXTYPE @ 32 NONAME - _ZNK17COmxILGenericILIF22GetComponentInputPortsER13RPointerArrayI18MILComponentPortIfE @ 33 NONAME - _ZNK17COmxILGenericILIF23GetComponentOutputPortsER13RPointerArrayI18MILComponentPortIfE @ 34 NONAME - _ZNK17COmxILGenericILIF8GetStateER17TILComponentState @ 35 NONAME - _ZNK17COmxILGenericILIF9GetConfigER9TILStructPK18MILComponentPortIf @ 36 NONAME - _ZTI13COmxCallbacks @ 37 NONAME - _ZTI17COmxBufferManager @ 38 NONAME - _ZTI17COmxILGenericILIF @ 39 NONAME - _ZTI21COmxILGenericPortILIF @ 40 NONAME - _ZTIN17COmxBufferManager10COmxBufferE @ 41 NONAME - _ZTIN17COmxILGenericILIF5CBodyE @ 42 NONAME - _ZTV13COmxCallbacks @ 43 NONAME - _ZTV17COmxBufferManager @ 44 NONAME - _ZTV17COmxILGenericILIF @ 45 NONAME - _ZTV21COmxILGenericPortILIF @ 46 NONAME - _ZTVN17COmxBufferManager10COmxBufferE @ 47 NONAME - _ZTVN17COmxILGenericILIF5CBodyE @ 48 NONAME - _ZThn4_N17COmxILGenericILIF10InitializeEv @ 49 NONAME - _ZThn4_N17COmxILGenericILIF11SendCommandERK10TILCommand @ 50 NONAME - _ZThn4_N17COmxILGenericILIF12UnInitializeEv @ 51 NONAME - _ZThn4_N17COmxILGenericILIF13FlushAllPortsEv @ 52 NONAME - _ZThn4_N17COmxILGenericILIF15CustomInterfaceE4TUid @ 53 NONAME - _ZThn4_N17COmxILGenericILIF16CreateComponentLERK4TUidR13MILIfObserver @ 54 NONAME - _ZThn4_N17COmxILGenericILIF16CreateComponentLERK6TDesC8R13MILIfObserver @ 55 NONAME - _ZThn4_N17COmxILGenericILIF16ReleaseComponentEv @ 56 NONAME - _ZThn4_N17COmxILGenericILIF18SetComponentIfRoleERK4TUid @ 57 NONAME - _ZThn4_N17COmxILGenericILIF18SetComponentIfRoleERK6TDesC8 @ 58 NONAME - _ZThn4_N17COmxILGenericILIF4StopEv @ 59 NONAME - _ZThn4_N17COmxILGenericILIF5PauseEv @ 60 NONAME - _ZThn4_N17COmxILGenericILIF7ExecuteEv @ 61 NONAME - _ZThn4_NK17COmxILGenericILIF17ComponentRoleEnumER5TPtr8m @ 62 NONAME - _ZThn4_NK17COmxILGenericILIF18GetComponentIfRoleER4TUid @ 63 NONAME - _ZThn4_NK17COmxILGenericILIF18GetComponentIfRoleER5TDes8 @ 64 NONAME - _ZThn4_NK17COmxILGenericILIF19GetComponentVersionER19TILComponentVersion @ 65 NONAME - _ZThn4_NK17COmxILGenericILIF22GetComponentInputPortsER13RPointerArrayI18MILComponentPortIfE @ 66 NONAME - _ZThn4_NK17COmxILGenericILIF23GetComponentOutputPortsER13RPointerArrayI18MILComponentPortIfE @ 67 NONAME - _ZThn4_NK17COmxILGenericILIF8GetStateER17TILComponentState @ 68 NONAME - _ZThn8_N17COmxILGenericILIF12EventHandlerE13OMX_EVENTTYPEmmPv @ 69 NONAME - _ZThn8_N17COmxILGenericILIF14FillBufferDoneEP10CMMFBufferi @ 70 NONAME - _ZThn8_N17COmxILGenericILIF15EmptyBufferDoneEPK10CMMFBufferi @ 71 NONAME - +EXPORTS + _ZN17COmxILGenericILIF10InitializeEv @ 1 NONAME + _ZN17COmxILGenericILIF11SendCommandERK10TILCommand @ 2 NONAME + _ZN17COmxILGenericILIF12EventHandlerE13OMX_EVENTTYPEmmPv @ 3 NONAME + _ZN17COmxILGenericILIF12OmxSetConfigE13OMX_INDEXTYPEPv @ 4 NONAME + _ZN17COmxILGenericILIF12SetExtConfigERK6TDesC8RK9TILStructPK18MILComponentPortIf @ 5 NONAME + _ZN17COmxILGenericILIF12UnInitializeEv @ 6 NONAME + _ZN17COmxILGenericILIF13FlushAllPortsEv @ 7 NONAME + _ZN17COmxILGenericILIF14FillBufferDoneEP10CMMFBufferi @ 8 NONAME + _ZN17COmxILGenericILIF15CustomInterfaceE4TUid @ 9 NONAME + _ZN17COmxILGenericILIF15EmptyBufferDoneEPK10CMMFBufferi @ 10 NONAME + _ZN17COmxILGenericILIF15OmxSetParameterE13OMX_INDEXTYPEPv @ 11 NONAME + _ZN17COmxILGenericILIF16CreateComponentLERK4TUidR13MILIfObserver @ 12 NONAME + _ZN17COmxILGenericILIF16CreateComponentLERK6TDesC8R13MILIfObserver @ 13 NONAME + _ZN17COmxILGenericILIF16ReleaseComponentEv @ 14 NONAME + _ZN17COmxILGenericILIF18SetComponentIfRoleERK4TUid @ 15 NONAME + _ZN17COmxILGenericILIF18SetComponentIfRoleERK6TDesC8 @ 16 NONAME + _ZN17COmxILGenericILIF4StopEv @ 17 NONAME + _ZN17COmxILGenericILIF5PauseEv @ 18 NONAME + _ZN17COmxILGenericILIF7ExecuteEv @ 19 NONAME + _ZN17COmxILGenericILIF9SetConfigERK9TILStructPK18MILComponentPortIf @ 20 NONAME + _ZN17COmxILGenericILIFC2Ev @ 21 NONAME + _ZN17COmxILGenericILIFD0Ev @ 22 NONAME + _ZN17COmxILGenericILIFD1Ev @ 23 NONAME + _ZN17COmxILGenericILIFD2Ev @ 24 NONAME + _ZNK17COmxILGenericILIF12GetExtConfigERK6TDesC8R9TILStructPK18MILComponentPortIf @ 25 NONAME + _ZNK17COmxILGenericILIF12OmxGetConfigE13OMX_INDEXTYPEPv @ 26 NONAME + _ZNK17COmxILGenericILIF15OmxGetParameterE13OMX_INDEXTYPEPv @ 27 NONAME + _ZNK17COmxILGenericILIF17ComponentRoleEnumER5TPtr8m @ 28 NONAME + _ZNK17COmxILGenericILIF18GetComponentIfRoleER4TUid @ 29 NONAME + _ZNK17COmxILGenericILIF18GetComponentIfRoleER5TDes8 @ 30 NONAME + _ZNK17COmxILGenericILIF19GetComponentVersionER19TILComponentVersion @ 31 NONAME + _ZNK17COmxILGenericILIF20OmxGetExtensionIndexERK6TDesC8P13OMX_INDEXTYPE @ 32 NONAME + _ZNK17COmxILGenericILIF22GetComponentInputPortsER13RPointerArrayI18MILComponentPortIfE @ 33 NONAME + _ZNK17COmxILGenericILIF23GetComponentOutputPortsER13RPointerArrayI18MILComponentPortIfE @ 34 NONAME + _ZNK17COmxILGenericILIF8GetStateER17TILComponentState @ 35 NONAME + _ZNK17COmxILGenericILIF9GetConfigER9TILStructPK18MILComponentPortIf @ 36 NONAME + _ZTI13COmxCallbacks @ 37 NONAME + _ZTI17COmxBufferManager @ 38 NONAME + _ZTI17COmxILGenericILIF @ 39 NONAME + _ZTI21COmxILGenericPortILIF @ 40 NONAME + _ZTIN17COmxBufferManager10COmxBufferE @ 41 NONAME + _ZTIN17COmxILGenericILIF5CBodyE @ 42 NONAME + _ZTV13COmxCallbacks @ 43 NONAME + _ZTV17COmxBufferManager @ 44 NONAME + _ZTV17COmxILGenericILIF @ 45 NONAME + _ZTV21COmxILGenericPortILIF @ 46 NONAME + _ZTVN17COmxBufferManager10COmxBufferE @ 47 NONAME + _ZTVN17COmxILGenericILIF5CBodyE @ 48 NONAME + _ZThn4_N17COmxILGenericILIF10InitializeEv @ 49 NONAME + _ZThn4_N17COmxILGenericILIF11SendCommandERK10TILCommand @ 50 NONAME + _ZThn4_N17COmxILGenericILIF12UnInitializeEv @ 51 NONAME + _ZThn4_N17COmxILGenericILIF13FlushAllPortsEv @ 52 NONAME + _ZThn4_N17COmxILGenericILIF15CustomInterfaceE4TUid @ 53 NONAME + _ZThn4_N17COmxILGenericILIF16CreateComponentLERK4TUidR13MILIfObserver @ 54 NONAME + _ZThn4_N17COmxILGenericILIF16CreateComponentLERK6TDesC8R13MILIfObserver @ 55 NONAME + _ZThn4_N17COmxILGenericILIF16ReleaseComponentEv @ 56 NONAME + _ZThn4_N17COmxILGenericILIF18SetComponentIfRoleERK4TUid @ 57 NONAME + _ZThn4_N17COmxILGenericILIF18SetComponentIfRoleERK6TDesC8 @ 58 NONAME + _ZThn4_N17COmxILGenericILIF4StopEv @ 59 NONAME + _ZThn4_N17COmxILGenericILIF5PauseEv @ 60 NONAME + _ZThn4_N17COmxILGenericILIF7ExecuteEv @ 61 NONAME + _ZThn4_NK17COmxILGenericILIF17ComponentRoleEnumER5TPtr8m @ 62 NONAME + _ZThn4_NK17COmxILGenericILIF18GetComponentIfRoleER4TUid @ 63 NONAME + _ZThn4_NK17COmxILGenericILIF18GetComponentIfRoleER5TDes8 @ 64 NONAME + _ZThn4_NK17COmxILGenericILIF19GetComponentVersionER19TILComponentVersion @ 65 NONAME + _ZThn4_NK17COmxILGenericILIF22GetComponentInputPortsER13RPointerArrayI18MILComponentPortIfE @ 66 NONAME + _ZThn4_NK17COmxILGenericILIF23GetComponentOutputPortsER13RPointerArrayI18MILComponentPortIfE @ 67 NONAME + _ZThn4_NK17COmxILGenericILIF8GetStateER17TILComponentState @ 68 NONAME + _ZThn8_N17COmxILGenericILIF12EventHandlerE13OMX_EVENTTYPEmmPv @ 69 NONAME + _ZThn8_N17COmxILGenericILIF14FillBufferDoneEP10CMMFBufferi @ 70 NONAME + _ZThn8_N17COmxILGenericILIF15EmptyBufferDoneEPK10CMMFBufferi @ 71 NONAME + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/refomxil/group/bld.inf --- a/omxil/mmilapi/refomxil/group/bld.inf Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/refomxil/group/bld.inf Fri May 07 16:25:23 2010 +0100 @@ -1,28 +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: -// - -#ifdef SYMBIAN_MULTIMEDIA_A3FDEVSOUND - - -PRJ_MMPFILES -../mmpfiles/omxilgenericilif.mmp - -PRJ_EXPORTS -// IBY FILE -milif.iby /epoc32/rom/include/milif.iby - -#endif // SYMBIAN_MULTIMEDIA_A3FDEVSOUND - -// End of file +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +#ifdef SYMBIAN_MULTIMEDIA_A3FDEVSOUND + + +PRJ_MMPFILES +../mmpfiles/omxilgenericilif.mmp + +PRJ_EXPORTS +// IBY FILE +milif.iby /epoc32/rom/include/milif.iby + +#endif // SYMBIAN_MULTIMEDIA_A3FDEVSOUND + +// End of file diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/refomxil/group/milif.iby --- a/omxil/mmilapi/refomxil/group/milif.iby Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/refomxil/group/milif.iby Fri May 07 16:25:23 2010 +0100 @@ -1,26 +1,26 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// - -#ifndef MILIF_IBY -#define MILIF_IBY - -#ifdef SYMBIAN_MULTIMEDIA_A3FDEVSOUND - -// OMX IL Generic IL Interface -file=ABI_DIR\BUILD_DIR\omxilgenericilif.dll System\Libs\omxilgenericilif.dll - -#endif // SYMBIAN_MULTIMEDIA_A3FDEVSOUND - +// 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 MILIF_IBY +#define MILIF_IBY + +#ifdef SYMBIAN_MULTIMEDIA_A3FDEVSOUND + +// OMX IL Generic IL Interface +file=ABI_DIR\BUILD_DIR\omxilgenericilif.dll System\Libs\omxilgenericilif.dll + +#endif // SYMBIAN_MULTIMEDIA_A3FDEVSOUND + #endif // MILIF_IBY \ No newline at end of file diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/refomxil/inc/momxilcomponentifobserver.h --- a/omxil/mmilapi/refomxil/inc/momxilcomponentifobserver.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/refomxil/inc/momxilcomponentifobserver.h Fri May 07 16:25:23 2010 +0100 @@ -1,76 +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: -// - -#ifndef MOMXILCOMPONENTIFOBSERVER_H -#define MOMXILCOMPONENTIFOBSERVER_H - -#include -#include - -class CMMFBuffer; - -/** -OpenMAX component interface observer class. -This is an internal interface class that encapsulates and represents the OpenMAX callback API as defined by the OpenMAX specification. -*/ -class MOmxILComponentIfObserver - { -public: - - /** - Callback method that returns the buffer that has been filled. - - @param aBuffer - The buffer returned by the OpenMAX component. - @param aPortIndex - The OpenMAX component's port index returning the buffer. - @return - KErrNone, if successful; otherwise one of the other system-wide error codes. - */ - - virtual TInt FillBufferDone(CMMFBuffer* aBuffer, TInt aPortIndex) = 0; - - /** - Callback method that returns the buffer that has been emptied. - - @param aBuffer - The buffer returned by the OpenMAX component. - @param aPortIndex - The OpenMAX component's port index returning the buffer. - @return - KErrNone, if successful; otherwise one of the other system-wide error codes. - */ - virtual TInt EmptyBufferDone(const CMMFBuffer* aBuffer, TInt aPortIndex) = 0; - - /** - Callback method used by the component to notify the client application of a particular event. - - @param aEvent - Event the component wants to notify the application about. - @param aData1 - The first integer event-specific parameter. - @param aData2 - The second integer event-specific parameter. - @param aExtraInfo - A pointer to additional event-specific data the component wants to send to the application. - The component owns the memory. - @return - KErrNone, if successful; otherwise one of the other system-wide error codes. - */ - virtual TInt EventHandler(OMX_EVENTTYPE aEvent, TUint32 aData1, TUint32 aData2, TAny* aExtraInfo) = 0; - }; - -#endif // MOMXILCOMPONENTIFOBSERVER_H - +// 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 MOMXILCOMPONENTIFOBSERVER_H +#define MOMXILCOMPONENTIFOBSERVER_H + +#include +#include + +class CMMFBuffer; + +/** +OpenMAX component interface observer class. +This is an internal interface class that encapsulates and represents the OpenMAX callback API as defined by the OpenMAX specification. +*/ +class MOmxILComponentIfObserver + { +public: + + /** + Callback method that returns the buffer that has been filled. + + @param aBuffer + The buffer returned by the OpenMAX component. + @param aPortIndex + The OpenMAX component's port index returning the buffer. + @return + KErrNone, if successful; otherwise one of the other system-wide error codes. + */ + + virtual TInt FillBufferDone(CMMFBuffer* aBuffer, TInt aPortIndex) = 0; + + /** + Callback method that returns the buffer that has been emptied. + + @param aBuffer + The buffer returned by the OpenMAX component. + @param aPortIndex + The OpenMAX component's port index returning the buffer. + @return + KErrNone, if successful; otherwise one of the other system-wide error codes. + */ + virtual TInt EmptyBufferDone(const CMMFBuffer* aBuffer, TInt aPortIndex) = 0; + + /** + Callback method used by the component to notify the client application of a particular event. + + @param aEvent + Event the component wants to notify the application about. + @param aData1 + The first integer event-specific parameter. + @param aData2 + The second integer event-specific parameter. + @param aExtraInfo + A pointer to additional event-specific data the component wants to send to the application. + The component owns the memory. + @return + KErrNone, if successful; otherwise one of the other system-wide error codes. + */ + virtual TInt EventHandler(OMX_EVENTTYPE aEvent, TUint32 aData1, TUint32 aData2, TAny* aExtraInfo) = 0; + }; + +#endif // MOMXILCOMPONENTIFOBSERVER_H + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/refomxil/inc/omxilcoreutils.h --- a/omxil/mmilapi/refomxil/inc/omxilcoreutils.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/refomxil/inc/omxilcoreutils.h Fri May 07 16:25:23 2010 +0100 @@ -1,72 +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 OMXILCOREUTILS_H -#define OMXILCOREUTILS_H - -#include "ilifbase.h" -#include -#include - - -const TInt KSymbianErrors[] = - { - KErrNoMemory, /*OMX_ErrorInsufficientResources*/ - KErrUnknown, /*OMX_ErrorUndefined*/ - KErrBadName, /*OMX_ErrorInvalidComponentName*/ - KErrNotFound, /*OMX_ErrorComponentNotFound*/ - KErrGeneral, /*OMX_ErrorInvalidComponent*/ - KErrArgument, /*OMX_ErrorBadParameter*/ - KErrNotSupported, /*OMX_ErrorNotImplemented*/ - KErrUnderflow, /*OMX_ErrorUnderflow*/ - KErrOverflow, /*OMX_ErrorOverflow*/ - KErrHardwareNotAvailable, /* OMX_ErrorHardware*/ - KErrGeneral, /*OMX_ErrorInvalidState*/ - KErrCorrupt, /*OMX_ErrorStreamCorrupt*/ - KErrArgument, /*OMX_ErrorPortsNotCompatible*/ - KErrHardwareNotAvailable, /*OMX_ErrorResourcesLost*/ - KErrCompletion, /*OMX_ErrorNoMore*/ - KErrGeneral, /*OMX_ErrorVersionMismatch*/ - KErrNotReady, /*OMX_ErrorNotReady*/ - KErrTimedOut, /*OMX_ErrorTimeout*/ - KErrNone, /*OMX_ErrorSameState*/ - KErrNotReady, /*OMX_ErrorResourcesPreempted*/ - KErrNotReady, /*OMX_ErrorPortUnresponsiveDuringAllocation*/ - KErrNotReady, /*OMX_ErrorPortUnresponsiveDuringDeallocation*/ - KErrNotReady, /*OMX_ErrorPortUnresponsiveDuringStop*/ - KErrNotReady, /*OMX_ErrorIncorrectStateTransition*/ - KErrNotReady, /*OMX_ErrorIncorrectStateOperation*/ - KErrNotSupported, /*OMX_ErrorUnsupportedSetting*/ - KErrNotSupported, /*OMX_ErrorUnsupportedIndex*/ - KErrArgument, /*OMX_ErrorBadPortIndex*/ - KErrNotReady, /*OMX_ErrorPortUnpopulated*/ - KErrNotReady, /*OMX_ErrorComponentSuspended*/ - KErrNotReady, /*OMX_ErrorDynamicResourcesUnavailable*/ - KErrCorrupt, /*OMX_ErrorMbErrorsInFrame*/ - KErrNotSupported, /*OMX_ErrorFormatNotDetected*/ - KErrGeneral, /*OMX_ErrorContentPipeOpenFailed*/ - KErrGeneral, /*OMX_ErrorContentPipeCreationFailed*/ - KErrCorrupt, /*OMX_ErrorSeperateTablesUsed*/ - KErrNotSupported, /*OMX_ErrorTunnelingUnsupported*/ - }; - - -TInt ConvertOmxErrorType(OMX_ERRORTYPE aErrorType); -OMX_ERRORTYPE ConvertSymbianErrorType(TInt aError); -TILComponentState ConvertOmxState(OMX_STATETYPE aState); -OMX_COMMANDTYPE ConvertSymbianCommandType(TILCommandTypes aCmd); - -#endif // OMXILCOREUTILS_H - +// 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 OMXILCOREUTILS_H +#define OMXILCOREUTILS_H + +#include "ilifbase.h" +#include +#include + + +const TInt KSymbianErrors[] = + { + KErrNoMemory, /*OMX_ErrorInsufficientResources*/ + KErrUnknown, /*OMX_ErrorUndefined*/ + KErrBadName, /*OMX_ErrorInvalidComponentName*/ + KErrNotFound, /*OMX_ErrorComponentNotFound*/ + KErrGeneral, /*OMX_ErrorInvalidComponent*/ + KErrArgument, /*OMX_ErrorBadParameter*/ + KErrNotSupported, /*OMX_ErrorNotImplemented*/ + KErrUnderflow, /*OMX_ErrorUnderflow*/ + KErrOverflow, /*OMX_ErrorOverflow*/ + KErrHardwareNotAvailable, /* OMX_ErrorHardware*/ + KErrGeneral, /*OMX_ErrorInvalidState*/ + KErrCorrupt, /*OMX_ErrorStreamCorrupt*/ + KErrArgument, /*OMX_ErrorPortsNotCompatible*/ + KErrHardwareNotAvailable, /*OMX_ErrorResourcesLost*/ + KErrCompletion, /*OMX_ErrorNoMore*/ + KErrGeneral, /*OMX_ErrorVersionMismatch*/ + KErrNotReady, /*OMX_ErrorNotReady*/ + KErrTimedOut, /*OMX_ErrorTimeout*/ + KErrNone, /*OMX_ErrorSameState*/ + KErrNotReady, /*OMX_ErrorResourcesPreempted*/ + KErrNotReady, /*OMX_ErrorPortUnresponsiveDuringAllocation*/ + KErrNotReady, /*OMX_ErrorPortUnresponsiveDuringDeallocation*/ + KErrNotReady, /*OMX_ErrorPortUnresponsiveDuringStop*/ + KErrNotReady, /*OMX_ErrorIncorrectStateTransition*/ + KErrNotReady, /*OMX_ErrorIncorrectStateOperation*/ + KErrNotSupported, /*OMX_ErrorUnsupportedSetting*/ + KErrNotSupported, /*OMX_ErrorUnsupportedIndex*/ + KErrArgument, /*OMX_ErrorBadPortIndex*/ + KErrNotReady, /*OMX_ErrorPortUnpopulated*/ + KErrNotReady, /*OMX_ErrorComponentSuspended*/ + KErrNotReady, /*OMX_ErrorDynamicResourcesUnavailable*/ + KErrCorrupt, /*OMX_ErrorMbErrorsInFrame*/ + KErrNotSupported, /*OMX_ErrorFormatNotDetected*/ + KErrGeneral, /*OMX_ErrorContentPipeOpenFailed*/ + KErrGeneral, /*OMX_ErrorContentPipeCreationFailed*/ + KErrCorrupt, /*OMX_ErrorSeperateTablesUsed*/ + KErrNotSupported, /*OMX_ErrorTunnelingUnsupported*/ + }; + + +TInt ConvertOmxErrorType(OMX_ERRORTYPE aErrorType); +OMX_ERRORTYPE ConvertSymbianErrorType(TInt aError); +TILComponentState ConvertOmxState(OMX_STATETYPE aState); +OMX_COMMANDTYPE ConvertSymbianCommandType(TILCommandTypes aCmd); + +#endif // OMXILCOREUTILS_H + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/refomxil/inc/omxilgenericilif.h --- a/omxil/mmilapi/refomxil/inc/omxilgenericilif.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/refomxil/inc/omxilgenericilif.h Fri May 07 16:25:23 2010 +0100 @@ -1,98 +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: -// - -#ifndef OMXILGENERICILIF_H -#define OMXILGENERICILIF_H - - -#include "milcomponentif.h" -#include "momxilcomponentifobserver.h" -#include -#include - -/** -Implementation of the MILComponentIf specific to OpenMAX specification. -This is the base class implementing the generic parts of the interface and it should be -further extended by derivation with the settings of the specific implementation -*/ -class COmxILGenericILIF : public CBase, - public MILComponentIf, - public MOmxILComponentIfObserver - { -friend class COmxILGenericPortILIF; - -public: - // from MILComponentIf - IMPORT_C void CreateComponentL(const TDesC8& aComponentName, MILIfObserver& aComponentIfObserver); - IMPORT_C void CreateComponentL(const TUid& aUid, MILIfObserver& ComponentIfObserver); - IMPORT_C void ReleaseComponent(); - IMPORT_C TInt GetComponentInputPorts(RPointerArray& aComponentPorts) const; - IMPORT_C TInt GetComponentOutputPorts(RPointerArray& aComponentPorts) const; - IMPORT_C virtual TInt SetConfig(const TILStruct& aConfig, const MILComponentPortIf* aComponentPort = NULL) = 0; - IMPORT_C virtual TInt GetConfig(TILStruct& aConfig, const MILComponentPortIf* aComponentPort = NULL) const = 0; - IMPORT_C TInt Initialize(); - IMPORT_C TInt Execute(); - IMPORT_C TInt Pause(); - IMPORT_C TInt Stop(); - IMPORT_C TInt UnInitialize(); - IMPORT_C TInt GetState(TILComponentState& aState) const; - IMPORT_C TInt SendCommand(const TILCommand& aCommand); - IMPORT_C TInt FlushAllPorts(); - IMPORT_C TInt ComponentRoleEnum(TPtr8& aComponentRole, TUint32 aIndex) const; - IMPORT_C TInt GetComponentVersion(TILComponentVersion& aVersion) const; - IMPORT_C TInt SetComponentIfRole(const TUid& aComponentRole); - IMPORT_C TInt SetComponentIfRole(const TDesC8& aComponentRole); - IMPORT_C TInt GetComponentIfRole(TUid& aComponentRole) const; - IMPORT_C TInt GetComponentIfRole(TDes8& aComponentRole) const; - IMPORT_C virtual TInt SetExtConfig(const TDesC8& aParameterName, const TILStruct& aConfig, const MILComponentPortIf* aComponentPort = NULL) = 0; - IMPORT_C virtual TInt GetExtConfig(const TDesC8& aParameterName, TILStruct& aConfig, const MILComponentPortIf* aComponentPort = NULL) const = 0; - IMPORT_C TAny* CustomInterface(TUid aUid); - - // from MOmxILComponentIfObserver - IMPORT_C TInt FillBufferDone(CMMFBuffer* aBuffer, TInt aPortIndex); - IMPORT_C TInt EmptyBufferDone(const CMMFBuffer* aBuffer, TInt aPortIndex); - IMPORT_C TInt EventHandler(OMX_EVENTTYPE aEvent, TUint32 aData1, TUint32 aData2, TAny* aExtraInfo); - - IMPORT_C ~COmxILGenericILIF(); - -protected: - IMPORT_C COmxILGenericILIF(); - - IMPORT_C TInt OmxGetParameter(OMX_INDEXTYPE aParamIndex, TAny* aComponentParameterStructure) const; - IMPORT_C TInt OmxSetParameter(OMX_INDEXTYPE aParamIndex, TAny* aComponentParameterStructure); - IMPORT_C TInt OmxGetConfig(OMX_INDEXTYPE aConfigIndex, TAny* aValue) const; - IMPORT_C TInt OmxSetConfig(OMX_INDEXTYPE aConfigIndex, TAny* aValue); - IMPORT_C TInt OmxGetExtensionIndex(const TDesC8& aParameterName, OMX_INDEXTYPE* aIndexType) const; - -private: - // Internal implementation. Only meant to be used by the component's port interface. - TInt OmxSendCommand(OMX_COMMANDTYPE aCmd, TUint32 aParam1, TAny* aCmdData); - TInt OmxComponentTunnelRequest(TUint32 aPortInput, OMX_HANDLETYPE aOutput, TUint32 aPortOutput); - TInt OmxComponentDisconnectTunnel(TUint32 aPortInput, OMX_HANDLETYPE aOutput, TUint32 aPortOutput); - TInt OmxUseBuffer(CMMFBuffer* aBuffer, TUint32 aPortIndex); - CMMFBuffer* OmxAllocateBufferL(TUint32 aPortIndex, TUint32 aSizeBytes); - TInt OmxFreeBuffer(CMMFBuffer* aBuffer); - TInt OmxEmptyThisBuffer(const CMMFBuffer* aBuffer, MOmxILComponentIfObserver* aObserver); - TInt OmxFillThisBuffer(CMMFBuffer* aBuffer, MOmxILComponentIfObserver* aObserver); - OMX_COMPONENTTYPE* OmxHandle() const; - -private: - class CBody; - - CBody* iBody; - }; - -#endif // OMXILGENERICILIF_H - +// 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 OMXILGENERICILIF_H +#define OMXILGENERICILIF_H + + +#include "milcomponentif.h" +#include "momxilcomponentifobserver.h" +#include +#include + +/** +Implementation of the MILComponentIf specific to OpenMAX specification. +This is the base class implementing the generic parts of the interface and it should be +further extended by derivation with the settings of the specific implementation +*/ +class COmxILGenericILIF : public CBase, + public MILComponentIf, + public MOmxILComponentIfObserver + { +friend class COmxILGenericPortILIF; + +public: + // from MILComponentIf + IMPORT_C void CreateComponentL(const TDesC8& aComponentName, MILIfObserver& aComponentIfObserver); + IMPORT_C void CreateComponentL(const TUid& aUid, MILIfObserver& ComponentIfObserver); + IMPORT_C void ReleaseComponent(); + IMPORT_C TInt GetComponentInputPorts(RPointerArray& aComponentPorts) const; + IMPORT_C TInt GetComponentOutputPorts(RPointerArray& aComponentPorts) const; + IMPORT_C virtual TInt SetConfig(const TILStruct& aConfig, const MILComponentPortIf* aComponentPort = NULL) = 0; + IMPORT_C virtual TInt GetConfig(TILStruct& aConfig, const MILComponentPortIf* aComponentPort = NULL) const = 0; + IMPORT_C TInt Initialize(); + IMPORT_C TInt Execute(); + IMPORT_C TInt Pause(); + IMPORT_C TInt Stop(); + IMPORT_C TInt UnInitialize(); + IMPORT_C TInt GetState(TILComponentState& aState) const; + IMPORT_C TInt SendCommand(const TILCommand& aCommand); + IMPORT_C TInt FlushAllPorts(); + IMPORT_C TInt ComponentRoleEnum(TPtr8& aComponentRole, TUint32 aIndex) const; + IMPORT_C TInt GetComponentVersion(TILComponentVersion& aVersion) const; + IMPORT_C TInt SetComponentIfRole(const TUid& aComponentRole); + IMPORT_C TInt SetComponentIfRole(const TDesC8& aComponentRole); + IMPORT_C TInt GetComponentIfRole(TUid& aComponentRole) const; + IMPORT_C TInt GetComponentIfRole(TDes8& aComponentRole) const; + IMPORT_C virtual TInt SetExtConfig(const TDesC8& aParameterName, const TILStruct& aConfig, const MILComponentPortIf* aComponentPort = NULL) = 0; + IMPORT_C virtual TInt GetExtConfig(const TDesC8& aParameterName, TILStruct& aConfig, const MILComponentPortIf* aComponentPort = NULL) const = 0; + IMPORT_C TAny* CustomInterface(TUid aUid); + + // from MOmxILComponentIfObserver + IMPORT_C TInt FillBufferDone(CMMFBuffer* aBuffer, TInt aPortIndex); + IMPORT_C TInt EmptyBufferDone(const CMMFBuffer* aBuffer, TInt aPortIndex); + IMPORT_C TInt EventHandler(OMX_EVENTTYPE aEvent, TUint32 aData1, TUint32 aData2, TAny* aExtraInfo); + + IMPORT_C ~COmxILGenericILIF(); + +protected: + IMPORT_C COmxILGenericILIF(); + + IMPORT_C TInt OmxGetParameter(OMX_INDEXTYPE aParamIndex, TAny* aComponentParameterStructure) const; + IMPORT_C TInt OmxSetParameter(OMX_INDEXTYPE aParamIndex, TAny* aComponentParameterStructure); + IMPORT_C TInt OmxGetConfig(OMX_INDEXTYPE aConfigIndex, TAny* aValue) const; + IMPORT_C TInt OmxSetConfig(OMX_INDEXTYPE aConfigIndex, TAny* aValue); + IMPORT_C TInt OmxGetExtensionIndex(const TDesC8& aParameterName, OMX_INDEXTYPE* aIndexType) const; + +private: + // Internal implementation. Only meant to be used by the component's port interface. + TInt OmxSendCommand(OMX_COMMANDTYPE aCmd, TUint32 aParam1, TAny* aCmdData); + TInt OmxComponentTunnelRequest(TUint32 aPortInput, OMX_HANDLETYPE aOutput, TUint32 aPortOutput); + TInt OmxComponentDisconnectTunnel(TUint32 aPortInput, OMX_HANDLETYPE aOutput, TUint32 aPortOutput); + TInt OmxUseBuffer(CMMFBuffer* aBuffer, TUint32 aPortIndex); + CMMFBuffer* OmxAllocateBufferL(TUint32 aPortIndex, TUint32 aSizeBytes); + TInt OmxFreeBuffer(CMMFBuffer* aBuffer); + TInt OmxEmptyThisBuffer(const CMMFBuffer* aBuffer, MOmxILComponentIfObserver* aObserver); + TInt OmxFillThisBuffer(CMMFBuffer* aBuffer, MOmxILComponentIfObserver* aObserver); + OMX_COMPONENTTYPE* OmxHandle() const; + +private: + class CBody; + + CBody* iBody; + }; + +#endif // OMXILGENERICILIF_H + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/refomxil/inc/omxilgenericilifbodyimpl.h --- a/omxil/mmilapi/refomxil/inc/omxilgenericilifbodyimpl.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/refomxil/inc/omxilgenericilifbodyimpl.h Fri May 07 16:25:23 2010 +0100 @@ -1,146 +1,146 @@ -// 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 OMXILGENERICILIFBODYIMPL_H -#define OMXILGENERICILIFBODYIMPL_H - -#include "momxilcomponentifobserver.h" -#include -#include - - -class COmxBufferManager : public CBase - { -public: - - class COmxBuffer : public CBase - { - public: - static COmxBuffer* NewL(OMX_BUFFERHEADERTYPE* aBufferHeader, CMMFBuffer* aBuffer); - ~COmxBuffer(); - - CMMFBuffer* MmfBuffer() const; - OMX_BUFFERHEADERTYPE* BufferHeader() const; - - void SetPortObserver(MOmxILComponentIfObserver* aObserver); - MOmxILComponentIfObserver* PortObserver() const; - - private: - COmxBuffer(); - void ConstructL(OMX_BUFFERHEADERTYPE* aBufferHeader, CMMFBuffer* aBuffer); - - OMX_BUFFERHEADERTYPE* iBufferHeader; - CMMFBuffer* iMmfBuffer; - - TBool iOwnsMmfBuffer; - - MOmxILComponentIfObserver* iPortObserver; - }; - -public: - COmxBufferManager(OMX_COMPONENTTYPE* aHandle); - ~COmxBufferManager(); - - // Buffer lookup - COmxBuffer* FindBuffer(const CMMFBuffer* aBuffer) const; - COmxBuffer* FindBuffer(OMX_BUFFERHEADERTYPE* aBuffer) const; - - // OMX Calls - TInt UseBuffer(CMMFBuffer& aBuffer, TUint nPortIndex); - CMMFBuffer* AllocateBufferL(TUint nPortIndex, TUint nSizeBytes); - TInt FreeBuffer(CMMFBuffer* aBuffer); - - TInt EmptyThisBuffer(const CMMFBuffer* aBuffer, MOmxILComponentIfObserver* aObserver); - TInt FillThisBuffer(CMMFBuffer* aBuffer, MOmxILComponentIfObserver* aObserver); - - // Store OMX buffer pointer - void StoreBufferL(OMX_BUFFERHEADERTYPE* aBufferHeader, CMMFBuffer* aBuffer); - -private: - RPointerArray iBuffers; - OMX_COMPONENTTYPE* iHandle; - }; - -class COmxCallbacks : public CActive - { -public: - enum TMessageType - { - EFillBufferCallback, - EEmptyBufferCallback, - EEventCallback - }; - - class TEventParams - { - public: - OMX_EVENTTYPE iEvent; - TUint32 iData1; - TUint32 iData2; - TAny* iExtraData; - }; - - class TOmxMessage - { - public: - TMessageType iType; - OMX_HANDLETYPE iComponent; - union - { - COmxBufferManager::COmxBuffer* iBuffer; - TEventParams iEventParams; - }; - }; -public: - static COmxCallbacks* NewL(MOmxILComponentIfObserver& aObserver); - operator OMX_CALLBACKTYPE*(); - void RunL(); - void DoCancel(); - - TInt FillBufferDone(OMX_HANDLETYPE aComponent, COmxBufferManager::COmxBuffer* aBuffer); - TInt EmptyBufferDone(OMX_HANDLETYPE aComponent, COmxBufferManager::COmxBuffer* aBuffer); - TInt EventHandler(OMX_HANDLETYPE aComponent, const TEventParams& aParams); - virtual ~COmxCallbacks(); - -private: - void ConstructL(); - COmxCallbacks(MOmxILComponentIfObserver& aObserver); - -private: - OMX_CALLBACKTYPE iHandle; - RMsgQueue iMsgQueue; - MOmxILComponentIfObserver& iParent; - }; - - -// OMX callback handler functions -OMX_ERRORTYPE EventHandler(OMX_OUT OMX_HANDLETYPE aComponent, - OMX_OUT TAny* aAppData, - OMX_OUT OMX_EVENTTYPE aEvent, - OMX_OUT TUint32 aData1, - OMX_OUT TUint32 aData2, - OMX_OUT TAny* aExtra); - -OMX_ERRORTYPE EmptyBufferDone( - OMX_HANDLETYPE aComponent, - TAny* aAppData, - OMX_BUFFERHEADERTYPE* aBuffer); - -OMX_ERRORTYPE FillBufferDone( - OMX_HANDLETYPE aComponent, - TAny* aAppData, - OMX_BUFFERHEADERTYPE* aBuffer); - -#endif // OMXILGENERICILIFBODYIMPL_H +// 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 OMXILGENERICILIFBODYIMPL_H +#define OMXILGENERICILIFBODYIMPL_H + +#include "momxilcomponentifobserver.h" +#include +#include + + +class COmxBufferManager : public CBase + { +public: + + class COmxBuffer : public CBase + { + public: + static COmxBuffer* NewL(OMX_BUFFERHEADERTYPE* aBufferHeader, CMMFBuffer* aBuffer); + ~COmxBuffer(); + + CMMFBuffer* MmfBuffer() const; + OMX_BUFFERHEADERTYPE* BufferHeader() const; + + void SetPortObserver(MOmxILComponentIfObserver* aObserver); + MOmxILComponentIfObserver* PortObserver() const; + + private: + COmxBuffer(); + void ConstructL(OMX_BUFFERHEADERTYPE* aBufferHeader, CMMFBuffer* aBuffer); + + OMX_BUFFERHEADERTYPE* iBufferHeader; + CMMFBuffer* iMmfBuffer; + + TBool iOwnsMmfBuffer; + + MOmxILComponentIfObserver* iPortObserver; + }; + +public: + COmxBufferManager(OMX_COMPONENTTYPE* aHandle); + ~COmxBufferManager(); + + // Buffer lookup + COmxBuffer* FindBuffer(const CMMFBuffer* aBuffer) const; + COmxBuffer* FindBuffer(OMX_BUFFERHEADERTYPE* aBuffer) const; + + // OMX Calls + TInt UseBuffer(CMMFBuffer& aBuffer, TUint nPortIndex); + CMMFBuffer* AllocateBufferL(TUint nPortIndex, TUint nSizeBytes); + TInt FreeBuffer(CMMFBuffer* aBuffer); + + TInt EmptyThisBuffer(const CMMFBuffer* aBuffer, MOmxILComponentIfObserver* aObserver); + TInt FillThisBuffer(CMMFBuffer* aBuffer, MOmxILComponentIfObserver* aObserver); + + // Store OMX buffer pointer + void StoreBufferL(OMX_BUFFERHEADERTYPE* aBufferHeader, CMMFBuffer* aBuffer); + +private: + RPointerArray iBuffers; + OMX_COMPONENTTYPE* iHandle; + }; + +class COmxCallbacks : public CActive + { +public: + enum TMessageType + { + EFillBufferCallback, + EEmptyBufferCallback, + EEventCallback + }; + + class TEventParams + { + public: + OMX_EVENTTYPE iEvent; + TUint32 iData1; + TUint32 iData2; + TAny* iExtraData; + }; + + class TOmxMessage + { + public: + TMessageType iType; + OMX_HANDLETYPE iComponent; + union + { + COmxBufferManager::COmxBuffer* iBuffer; + TEventParams iEventParams; + }; + }; +public: + static COmxCallbacks* NewL(MOmxILComponentIfObserver& aObserver); + operator OMX_CALLBACKTYPE*(); + void RunL(); + void DoCancel(); + + TInt FillBufferDone(OMX_HANDLETYPE aComponent, COmxBufferManager::COmxBuffer* aBuffer); + TInt EmptyBufferDone(OMX_HANDLETYPE aComponent, COmxBufferManager::COmxBuffer* aBuffer); + TInt EventHandler(OMX_HANDLETYPE aComponent, const TEventParams& aParams); + virtual ~COmxCallbacks(); + +private: + void ConstructL(); + COmxCallbacks(MOmxILComponentIfObserver& aObserver); + +private: + OMX_CALLBACKTYPE iHandle; + RMsgQueue iMsgQueue; + MOmxILComponentIfObserver& iParent; + }; + + +// OMX callback handler functions +OMX_ERRORTYPE EventHandler(OMX_OUT OMX_HANDLETYPE aComponent, + OMX_OUT TAny* aAppData, + OMX_OUT OMX_EVENTTYPE aEvent, + OMX_OUT TUint32 aData1, + OMX_OUT TUint32 aData2, + OMX_OUT TAny* aExtra); + +OMX_ERRORTYPE EmptyBufferDone( + OMX_HANDLETYPE aComponent, + TAny* aAppData, + OMX_BUFFERHEADERTYPE* aBuffer); + +OMX_ERRORTYPE FillBufferDone( + OMX_HANDLETYPE aComponent, + TAny* aAppData, + OMX_BUFFERHEADERTYPE* aBuffer); + +#endif // OMXILGENERICILIFBODYIMPL_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/refomxil/inc/omxilgenericportilif.h --- a/omxil/mmilapi/refomxil/inc/omxilgenericportilif.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/refomxil/inc/omxilgenericportilif.h Fri May 07 16:25:23 2010 +0100 @@ -1,59 +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: -// - -#ifndef OMXILGENERICPORTILIF_H -#define OMXILGENERICPORTILIF_H - -#include "milcomponentportif.h" -#include "omxilgenericilif.h" - - -/** -Concrete implementation of the MILComponentPortIf that encapsulates the -component's port specific behaviour according to OpenMAX specification. -*/ -class COmxILGenericPortILIF : public CBase, - public MILComponentPortIf - { -public: - static COmxILGenericPortILIF* NewL(COmxILGenericILIF& aParent, TPortDirection aPortDirection, TInt aIndex); - - // MILComponentPortIf - TInt FillThisBuffer(CMMFBuffer& aBuffer); - TInt EmptyThisBuffer(const CMMFBuffer& aBuffer); - TInt TunnelRequest(MILComponentPortIf* aPort); - TInt PortIndex() const; - TPortDirection PortDirection() const; - CMMFBuffer* CreateBufferL(TInt aBufferSize); - TInt UseBuffer(CMMFBuffer& aBuffer); - TInt FreeBuffer(CMMFBuffer* aBuffer); - TInt FlushPort(); - TInt EnablePort(); - TInt DisablePort(); - MILComponentIf* PortComponent() const; - - void SetPortConnectedTo(COmxILGenericPortILIF* aPort); - -private: - COmxILGenericPortILIF(COmxILGenericILIF& aParent, TPortDirection aPortDirection, TInt aIndex); - -private: - TPortDirection iPortDirection; - TInt iPortIndex; - COmxILGenericILIF& iPortComponent; - COmxILGenericPortILIF* iTunneledPort; - }; - -#endif // OMXILGENERICPORTILIF_H +// 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 OMXILGENERICPORTILIF_H +#define OMXILGENERICPORTILIF_H + +#include "milcomponentportif.h" +#include "omxilgenericilif.h" + + +/** +Concrete implementation of the MILComponentPortIf that encapsulates the +component's port specific behaviour according to OpenMAX specification. +*/ +class COmxILGenericPortILIF : public CBase, + public MILComponentPortIf + { +public: + static COmxILGenericPortILIF* NewL(COmxILGenericILIF& aParent, TPortDirection aPortDirection, TInt aIndex); + + // MILComponentPortIf + TInt FillThisBuffer(CMMFBuffer& aBuffer); + TInt EmptyThisBuffer(const CMMFBuffer& aBuffer); + TInt TunnelRequest(MILComponentPortIf* aPort); + TInt PortIndex() const; + TPortDirection PortDirection() const; + CMMFBuffer* CreateBufferL(TInt aBufferSize); + TInt UseBuffer(CMMFBuffer& aBuffer); + TInt FreeBuffer(CMMFBuffer* aBuffer); + TInt FlushPort(); + TInt EnablePort(); + TInt DisablePort(); + MILComponentIf* PortComponent() const; + + void SetPortConnectedTo(COmxILGenericPortILIF* aPort); + +private: + COmxILGenericPortILIF(COmxILGenericILIF& aParent, TPortDirection aPortDirection, TInt aIndex); + +private: + TPortDirection iPortDirection; + TInt iPortIndex; + COmxILGenericILIF& iPortComponent; + COmxILGenericPortILIF* iTunneledPort; + }; + +#endif // OMXILGENERICPORTILIF_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/refomxil/inc/omxilspecversion.h --- a/omxil/mmilapi/refomxil/inc/omxilspecversion.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/refomxil/inc/omxilspecversion.h Fri May 07 16:25:23 2010 +0100 @@ -1,31 +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: -// - -#ifndef OMXILSPECVERSION_H -#define OMXILSPECVERSION_H - -#include - - -// OMX IL v1.1.1 used for this implementation -const TUint8 KOMXILSpecVersionMajor = 1; -const TUint8 KOMXILSpecVersionMinor = 1; -const TUint8 KOMXILSpecVersionRevision = 1; -const TUint8 KOMXILSpecVersionStep = 0; - -const OMX_VERSIONTYPE KOMXILSpecVersion = { KOMXILSpecVersionMajor, KOMXILSpecVersionMinor, KOMXILSpecVersionRevision, KOMXILSpecVersionStep }; - - +// 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 OMXILSPECVERSION_H +#define OMXILSPECVERSION_H + +#include + + +// OMX IL v1.1.1 used for this implementation +const TUint8 KOMXILSpecVersionMajor = 1; +const TUint8 KOMXILSpecVersionMinor = 1; +const TUint8 KOMXILSpecVersionRevision = 1; +const TUint8 KOMXILSpecVersionStep = 0; + +const OMX_VERSIONTYPE KOMXILSpecVersion = { KOMXILSpecVersionMajor, KOMXILSpecVersionMinor, KOMXILSpecVersionRevision, KOMXILSpecVersionStep }; + + #endif // OMXILSPECVERSION_H \ No newline at end of file diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/refomxil/mmpfiles/omxilgenericilif.mmp --- a/omxil/mmilapi/refomxil/mmpfiles/omxilgenericilif.mmp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/refomxil/mmpfiles/omxilgenericilif.mmp Fri May 07 16:25:23 2010 +0100 @@ -1,49 +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: -// - -#include "../src/omxilgenericilif/omxilgenericilif.hrh" - -TARGET omxilgenericilif.dll -TARGETTYPE dll - -CAPABILITY All -TCB - -UID KSharedLibraryUidDefine KUidOmxILGenericILIFDll -VENDORID 0x70000001 - - -SOURCEPATH ../src/omxilgenericilif -SOURCE omxilgenericilif.cpp -SOURCE omxilgenericilifbody.cpp -SOURCE omxilgenericilifbodyimpl.cpp -SOURCE omxilgenericportilif.cpp -SOURCE omxilcoreutils.cpp - -USERINCLUDE ../src/omxilgenericilif -USERINCLUDE ../inc -USERINCLUDE ../../ilif/inc - -OS_LAYER_SYSTEMINCLUDE_SYMBIAN - -LIBRARY euser.lib -LIBRARY mmfserverbaseclasses.lib -LIBRARY omxilcoreclient.lib - - -DEFFILE omxilgenericilif.def -NOSTRICTDEF - - -SMPSAFE +// 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/omxilgenericilif/omxilgenericilif.hrh" + +TARGET omxilgenericilif.dll +TARGETTYPE dll + +CAPABILITY All -TCB + +UID KSharedLibraryUidDefine KUidOmxILGenericILIFDll +VENDORID 0x70000001 + + +SOURCEPATH ../src/omxilgenericilif +SOURCE omxilgenericilif.cpp +SOURCE omxilgenericilifbody.cpp +SOURCE omxilgenericilifbodyimpl.cpp +SOURCE omxilgenericportilif.cpp +SOURCE omxilcoreutils.cpp + +USERINCLUDE ../src/omxilgenericilif +USERINCLUDE ../inc +USERINCLUDE ../../ilif/inc + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN + +LIBRARY euser.lib +LIBRARY mmfserverbaseclasses.lib +LIBRARY omxilcoreclient.lib + + +DEFFILE omxilgenericilif.def +NOSTRICTDEF + + +SMPSAFE diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/refomxil/src/omxilgenericilif/omxilcoreutils.cpp --- a/omxil/mmilapi/refomxil/src/omxilgenericilif/omxilcoreutils.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/refomxil/src/omxilgenericilif/omxilcoreutils.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,135 +1,135 @@ -// 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 "omxilcoreutils.h" - - -/** - Converts an OpenMAX error code to a Symbian error code. - @param aErrorType The OpenMAX error code. - @return The Symbian error code. - */ -TInt ConvertOmxErrorType(OMX_ERRORTYPE aErrorType) - { - if (aErrorType == OMX_ErrorNone) - { - return KErrNone; - } - else if (aErrorType >= OMX_ErrorInsufficientResources && - aErrorType <= OMX_ErrorTunnelingUnsupported) - { - return KSymbianErrors[aErrorType - OMX_ErrorInsufficientResources]; - } - else - { - return KErrGeneral; - } - } - -/** - Converts a Symbian error code to an OpenMAX error code. - @param aError The Symbian error code. - @return The OpenMAX error code. - */ -OMX_ERRORTYPE ConvertSymbianErrorType(TInt aError) - { - // In the current implementation this function is only used for the return code in the - // callback methods. Currently the only expected errors KErrNone and KErrOverflow. - - OMX_ERRORTYPE err = OMX_ErrorNone; - switch (aError) - { - case KErrNone: - err = OMX_ErrorNone; - break; - case KErrOverflow: - case KErrNoMemory: - err = OMX_ErrorInsufficientResources; - break; - case KErrNotSupported: - err = OMX_ErrorNotImplemented; - break; - case KErrNotReady: - err = OMX_ErrorNotReady; - break; - case KErrGeneral: - default: - err = OMX_ErrorUndefined; - } - return err; - } - -/** - Converts an OpenMAX state to a Symbian state. - @param aState - The OpenMAX error code. - @return The Symbian state. - @see TILComponentState - */ -TILComponentState ConvertOmxState(OMX_STATETYPE aState) - { - TILComponentState state = EComponentInvalid; - switch (aState) - { - case OMX_StateInvalid: - state = EComponentInvalid; - break; - case OMX_StateLoaded: - state = EComponentLoaded; - break; - case OMX_StateIdle: - state = EComponentIdle; - break; - case OMX_StateExecuting: - state = EComponentExecuting; - break; - case OMX_StatePause: - state = EComponentPaused; - break; - case OMX_StateWaitForResources: - state = EComponentWaitingForResources; - break; - default: - state = EComponentInvalid; - } - return state; - } - - -OMX_COMMANDTYPE ConvertSymbianCommandType(TILCommandTypes aCmd) - { - OMX_COMMANDTYPE omxcommand = OMX_CommandMax; - switch (aCmd) - { - case ECommandStateSet: - omxcommand = OMX_CommandStateSet; - break; - case ECommandFlush: - omxcommand = OMX_CommandFlush; - break; - case ECommandPortDisable: - omxcommand = OMX_CommandPortDisable; - break; - case ECommandPortEnable: - omxcommand = OMX_CommandPortEnable; - break; - case ECommandMarkBuffer: - omxcommand = OMX_CommandMarkBuffer; - break; - default: - omxcommand = OMX_CommandMax; - } - return omxcommand; - } +// 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 "omxilcoreutils.h" + + +/** + Converts an OpenMAX error code to a Symbian error code. + @param aErrorType The OpenMAX error code. + @return The Symbian error code. + */ +TInt ConvertOmxErrorType(OMX_ERRORTYPE aErrorType) + { + if (aErrorType == OMX_ErrorNone) + { + return KErrNone; + } + else if (aErrorType >= OMX_ErrorInsufficientResources && + aErrorType <= OMX_ErrorTunnelingUnsupported) + { + return KSymbianErrors[aErrorType - OMX_ErrorInsufficientResources]; + } + else + { + return KErrGeneral; + } + } + +/** + Converts a Symbian error code to an OpenMAX error code. + @param aError The Symbian error code. + @return The OpenMAX error code. + */ +OMX_ERRORTYPE ConvertSymbianErrorType(TInt aError) + { + // In the current implementation this function is only used for the return code in the + // callback methods. Currently the only expected errors KErrNone and KErrOverflow. + + OMX_ERRORTYPE err = OMX_ErrorNone; + switch (aError) + { + case KErrNone: + err = OMX_ErrorNone; + break; + case KErrOverflow: + case KErrNoMemory: + err = OMX_ErrorInsufficientResources; + break; + case KErrNotSupported: + err = OMX_ErrorNotImplemented; + break; + case KErrNotReady: + err = OMX_ErrorNotReady; + break; + case KErrGeneral: + default: + err = OMX_ErrorUndefined; + } + return err; + } + +/** + Converts an OpenMAX state to a Symbian state. + @param aState + The OpenMAX error code. + @return The Symbian state. + @see TILComponentState + */ +TILComponentState ConvertOmxState(OMX_STATETYPE aState) + { + TILComponentState state = EComponentInvalid; + switch (aState) + { + case OMX_StateInvalid: + state = EComponentInvalid; + break; + case OMX_StateLoaded: + state = EComponentLoaded; + break; + case OMX_StateIdle: + state = EComponentIdle; + break; + case OMX_StateExecuting: + state = EComponentExecuting; + break; + case OMX_StatePause: + state = EComponentPaused; + break; + case OMX_StateWaitForResources: + state = EComponentWaitingForResources; + break; + default: + state = EComponentInvalid; + } + return state; + } + + +OMX_COMMANDTYPE ConvertSymbianCommandType(TILCommandTypes aCmd) + { + OMX_COMMANDTYPE omxcommand = OMX_CommandMax; + switch (aCmd) + { + case ECommandStateSet: + omxcommand = OMX_CommandStateSet; + break; + case ECommandFlush: + omxcommand = OMX_CommandFlush; + break; + case ECommandPortDisable: + omxcommand = OMX_CommandPortDisable; + break; + case ECommandPortEnable: + omxcommand = OMX_CommandPortEnable; + break; + case ECommandMarkBuffer: + omxcommand = OMX_CommandMarkBuffer; + break; + default: + omxcommand = OMX_CommandMax; + } + return omxcommand; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/refomxil/src/omxilgenericilif/omxilgenericilif.cpp --- a/omxil/mmilapi/refomxil/src/omxilgenericilif/omxilgenericilif.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/refomxil/src/omxilgenericilif/omxilgenericilif.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,299 +1,299 @@ -// 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 "omxilgenericilif.h" -#include "omxilgenericilifbody.h" -#include "omxilcoreutils.h" -#include "ilifuids.h" -#include - - -const TUint32 KOMXALL = 0xFFFFFFFF; - - -EXPORT_C COmxILGenericILIF::COmxILGenericILIF() - { - } - -EXPORT_C COmxILGenericILIF::~COmxILGenericILIF() - { - if (iBody) - { - delete iBody; - } - } - -EXPORT_C void COmxILGenericILIF::CreateComponentL(const TDesC8& aComponentName, - MILIfObserver& aComponentIfObserver) - { - iBody = CBody::NewL(*this, aComponentIfObserver, aComponentName); - - User::LeaveIfError(iBody->SetPortsL()); - } - -EXPORT_C void COmxILGenericILIF::CreateComponentL(const TUid& /*aUid*/, - MILIfObserver& /*ComponentIfObserver*/) - { - // OMX Versions do not use this method of creation - User::Leave(KErrNotSupported); - } - -EXPORT_C void COmxILGenericILIF::ReleaseComponent() - { - delete iBody; - iBody = NULL; - - delete this; - } - -EXPORT_C TInt COmxILGenericILIF::GetComponentInputPorts(RPointerArray& aComponentPorts) const - { - return (iBody->GetComponentPorts(aComponentPorts, OMX_DirInput)); - } - -EXPORT_C TInt COmxILGenericILIF::GetComponentOutputPorts(RPointerArray& aComponentPorts) const - { - return (iBody->GetComponentPorts(aComponentPorts, OMX_DirOutput)); - } - -EXPORT_C TInt COmxILGenericILIF::SetConfig(const TILStruct& /*aConfig*/, - const MILComponentPortIf* /*aComponentPort*/) - { - // It should be implemented in the derived class - return (KErrNotSupported); - } - -EXPORT_C TInt COmxILGenericILIF::GetConfig(TILStruct& /*aConfig*/, - const MILComponentPortIf* /*aComponentPort*/) const - { - // It should be implemented in the derived class - return (KErrNotSupported); - } - -EXPORT_C TInt COmxILGenericILIF::Initialize() - { - return (iBody->OmxSendCommand(OMX_CommandStateSet, OMX_StateIdle, NULL)); - } - -EXPORT_C TInt COmxILGenericILIF::Execute() - { - return (iBody->OmxSendCommand(OMX_CommandStateSet, OMX_StateExecuting, NULL)); - } - -EXPORT_C TInt COmxILGenericILIF::Pause() - { - return (iBody->OmxSendCommand(OMX_CommandStateSet, OMX_StatePause, NULL)); - } - -EXPORT_C TInt COmxILGenericILIF::Stop() - { - return (iBody->OmxSendCommand(OMX_CommandStateSet, OMX_StateIdle, NULL)); - } - -EXPORT_C TInt COmxILGenericILIF::UnInitialize() - { - return (iBody->OmxSendCommand(OMX_CommandStateSet, OMX_StateLoaded, NULL)); - } - -EXPORT_C TInt COmxILGenericILIF::GetState(TILComponentState& aState) const - { - TInt error; - OMX_STATETYPE state; - error = iBody->OmxGetState(&state); - aState = ConvertOmxState(state); - return error; - } - -EXPORT_C TInt COmxILGenericILIF::SendCommand(const TILCommand& aCommand) - { - OMX_COMMANDTYPE command = ConvertSymbianCommandType(aCommand.iCmd); - return (iBody->OmxSendCommand(command, aCommand.iData1, aCommand.iExtraData)); - } - -EXPORT_C TInt COmxILGenericILIF::FlushAllPorts() - { - return (iBody->OmxSendCommand(OMX_CommandFlush, KOMXALL, NULL)); - } - -EXPORT_C TInt COmxILGenericILIF::ComponentRoleEnum(TPtr8& aComponentRole, - TUint32 aIndex) const - { - return (iBody->OmxComponentRoleEnum(aComponentRole, aIndex)); - } - -EXPORT_C TInt COmxILGenericILIF::GetComponentVersion(TILComponentVersion& aVersion) const - { - return (iBody->OmxGetComponentVersion(aVersion.iComponentName, - (OMX_VERSIONTYPE*)&aVersion.iComponentVersion, - (OMX_VERSIONTYPE*)&aVersion.iSpecVersion, - (OMX_UUIDTYPE*)&aVersion.iComponentUniqueID)); - } - -EXPORT_C TInt COmxILGenericILIF::SetComponentIfRole(const TUid& aComponentRole) - { - return (iBody->SetIfToRole(aComponentRole)); - } - -EXPORT_C TInt COmxILGenericILIF::SetComponentIfRole(const TDesC8& /*aComponentRole*/) - { - // Under A3F the roles are identified by Format Uid rather than role names. - return (KErrNotSupported); - } - -EXPORT_C TInt COmxILGenericILIF::GetComponentIfRole(TUid& aComponentRole) const - { - return (iBody->GetIfRole(aComponentRole)); - } - -EXPORT_C TInt COmxILGenericILIF::GetComponentIfRole(TDes8& /*aComponentRole*/) const - { - // Under A3F the roles are identified by Format Uid rather than role names. - return (KErrNotSupported); - } - -EXPORT_C TInt COmxILGenericILIF::SetExtConfig(const TDesC8& /*aParameterName*/, - const TILStruct& /*aConfig*/, - const MILComponentPortIf* /*aComponentPort*/) - { - // It should be implemented in the derived class - return (KErrNotSupported); - } - -EXPORT_C TInt COmxILGenericILIF::GetExtConfig(const TDesC8& /*aParameterName*/, - TILStruct& /*aConfig*/, - const MILComponentPortIf* /*aComponentPort*/) const - { - // It should be implemented in the derived class - return (KErrNotSupported); - } - -EXPORT_C TAny* COmxILGenericILIF::CustomInterface(TUid aUid) - { - if (aUid == KUidILComponentIf) - { - MILComponentIf* componentIf = this; - return componentIf; - } - else - { - return NULL; - } - } - -EXPORT_C TInt COmxILGenericILIF::FillBufferDone(CMMFBuffer* aBuffer, - TInt aPortIndex) - { - return (iBody->FillBufferDone(aBuffer, aPortIndex)); - } - -EXPORT_C TInt COmxILGenericILIF::EmptyBufferDone(const CMMFBuffer* aBuffer, - TInt aPortIndex) - { - return (iBody->EmptyBufferDone(aBuffer, aPortIndex)); - } - -EXPORT_C TInt COmxILGenericILIF::EventHandler(OMX_EVENTTYPE aEvent, - TUint32 aData1, - TUint32 aData2, - TAny* aExtraInfo) - { - return (iBody->EventHandler(aEvent, aData1, aData2, aExtraInfo)); - } - -EXPORT_C TInt COmxILGenericILIF::OmxGetParameter(OMX_INDEXTYPE aParamIndex, - TAny* aComponentParameterStructure) const - { - return (iBody->OmxGetParameter(aParamIndex, aComponentParameterStructure)); - } - -EXPORT_C TInt COmxILGenericILIF::OmxSetParameter(OMX_INDEXTYPE aParamIndex, - TAny* aComponentParameterStructure) - { - return (iBody->OmxSetParameter(aParamIndex, aComponentParameterStructure)); - } - -EXPORT_C TInt COmxILGenericILIF::OmxGetConfig(OMX_INDEXTYPE aConfigIndex, - TAny* aValue) const - { - return (iBody->OmxGetConfig(aConfigIndex, aValue)); - } - -EXPORT_C TInt COmxILGenericILIF::OmxSetConfig(OMX_INDEXTYPE aConfigIndex, - TAny* aValue) - { - return (iBody->OmxSetConfig(aConfigIndex, aValue)); - } - -EXPORT_C TInt COmxILGenericILIF::OmxGetExtensionIndex(const TDesC8& aParameterName, - OMX_INDEXTYPE* aIndexType) const - { - return (iBody->OmxGetExtensionIndex(aParameterName, aIndexType)); - } - -TInt COmxILGenericILIF::OmxSendCommand(OMX_COMMANDTYPE aCmd, - TUint32 aParam1, - TAny* aCmdData) - { - return (iBody->OmxSendCommand(aCmd, aParam1, aCmdData)); - } - -TInt COmxILGenericILIF::OmxComponentTunnelRequest(TUint32 aPortInput, - OMX_HANDLETYPE aOutput, - TUint32 aPortOutput) - { - return (iBody->OmxComponentTunnelRequest(aPortInput, aOutput, aPortOutput)); - } - -TInt COmxILGenericILIF::OmxComponentDisconnectTunnel(TUint32 aPortInput, - OMX_HANDLETYPE aOutput, - TUint32 aPortOutput) - { - return (iBody->OmxComponentDisconnectTunnel(aPortInput, aOutput, aPortOutput)); - } - -TInt COmxILGenericILIF::OmxUseBuffer(CMMFBuffer* aBuffer, - TUint32 aPortIndex) - { - return (iBody->OmxUseBuffer(aBuffer, aPortIndex)); - } - -CMMFBuffer* COmxILGenericILIF::OmxAllocateBufferL(TUint32 aPortIndex, - TUint32 aSizeBytes) - { - return (iBody->OmxAllocateBufferL(aPortIndex, aSizeBytes)); - } - -TInt COmxILGenericILIF::OmxFreeBuffer(CMMFBuffer* aBuffer) - { - return (iBody->OmxFreeBuffer(aBuffer)); - } - -TInt COmxILGenericILIF::OmxEmptyThisBuffer(const CMMFBuffer* aBuffer, - MOmxILComponentIfObserver* aObserver) - { - return (iBody->OmxEmptyThisBuffer(aBuffer, aObserver)); - } - -TInt COmxILGenericILIF::OmxFillThisBuffer(CMMFBuffer* aBuffer, - MOmxILComponentIfObserver* aObserver) - { - return (iBody->OmxFillThisBuffer(aBuffer, aObserver)); - } - - -OMX_COMPONENTTYPE* COmxILGenericILIF::OmxHandle() const - { - return (iBody->Handle()); - } +// 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 "omxilgenericilif.h" +#include "omxilgenericilifbody.h" +#include "omxilcoreutils.h" +#include "ilifuids.h" +#include + + +const TUint32 KOMXALL = 0xFFFFFFFF; + + +EXPORT_C COmxILGenericILIF::COmxILGenericILIF() + { + } + +EXPORT_C COmxILGenericILIF::~COmxILGenericILIF() + { + if (iBody) + { + delete iBody; + } + } + +EXPORT_C void COmxILGenericILIF::CreateComponentL(const TDesC8& aComponentName, + MILIfObserver& aComponentIfObserver) + { + iBody = CBody::NewL(*this, aComponentIfObserver, aComponentName); + + User::LeaveIfError(iBody->SetPortsL()); + } + +EXPORT_C void COmxILGenericILIF::CreateComponentL(const TUid& /*aUid*/, + MILIfObserver& /*ComponentIfObserver*/) + { + // OMX Versions do not use this method of creation + User::Leave(KErrNotSupported); + } + +EXPORT_C void COmxILGenericILIF::ReleaseComponent() + { + delete iBody; + iBody = NULL; + + delete this; + } + +EXPORT_C TInt COmxILGenericILIF::GetComponentInputPorts(RPointerArray& aComponentPorts) const + { + return (iBody->GetComponentPorts(aComponentPorts, OMX_DirInput)); + } + +EXPORT_C TInt COmxILGenericILIF::GetComponentOutputPorts(RPointerArray& aComponentPorts) const + { + return (iBody->GetComponentPorts(aComponentPorts, OMX_DirOutput)); + } + +EXPORT_C TInt COmxILGenericILIF::SetConfig(const TILStruct& /*aConfig*/, + const MILComponentPortIf* /*aComponentPort*/) + { + // It should be implemented in the derived class + return (KErrNotSupported); + } + +EXPORT_C TInt COmxILGenericILIF::GetConfig(TILStruct& /*aConfig*/, + const MILComponentPortIf* /*aComponentPort*/) const + { + // It should be implemented in the derived class + return (KErrNotSupported); + } + +EXPORT_C TInt COmxILGenericILIF::Initialize() + { + return (iBody->OmxSendCommand(OMX_CommandStateSet, OMX_StateIdle, NULL)); + } + +EXPORT_C TInt COmxILGenericILIF::Execute() + { + return (iBody->OmxSendCommand(OMX_CommandStateSet, OMX_StateExecuting, NULL)); + } + +EXPORT_C TInt COmxILGenericILIF::Pause() + { + return (iBody->OmxSendCommand(OMX_CommandStateSet, OMX_StatePause, NULL)); + } + +EXPORT_C TInt COmxILGenericILIF::Stop() + { + return (iBody->OmxSendCommand(OMX_CommandStateSet, OMX_StateIdle, NULL)); + } + +EXPORT_C TInt COmxILGenericILIF::UnInitialize() + { + return (iBody->OmxSendCommand(OMX_CommandStateSet, OMX_StateLoaded, NULL)); + } + +EXPORT_C TInt COmxILGenericILIF::GetState(TILComponentState& aState) const + { + TInt error; + OMX_STATETYPE state; + error = iBody->OmxGetState(&state); + aState = ConvertOmxState(state); + return error; + } + +EXPORT_C TInt COmxILGenericILIF::SendCommand(const TILCommand& aCommand) + { + OMX_COMMANDTYPE command = ConvertSymbianCommandType(aCommand.iCmd); + return (iBody->OmxSendCommand(command, aCommand.iData1, aCommand.iExtraData)); + } + +EXPORT_C TInt COmxILGenericILIF::FlushAllPorts() + { + return (iBody->OmxSendCommand(OMX_CommandFlush, KOMXALL, NULL)); + } + +EXPORT_C TInt COmxILGenericILIF::ComponentRoleEnum(TPtr8& aComponentRole, + TUint32 aIndex) const + { + return (iBody->OmxComponentRoleEnum(aComponentRole, aIndex)); + } + +EXPORT_C TInt COmxILGenericILIF::GetComponentVersion(TILComponentVersion& aVersion) const + { + return (iBody->OmxGetComponentVersion(aVersion.iComponentName, + (OMX_VERSIONTYPE*)&aVersion.iComponentVersion, + (OMX_VERSIONTYPE*)&aVersion.iSpecVersion, + (OMX_UUIDTYPE*)&aVersion.iComponentUniqueID)); + } + +EXPORT_C TInt COmxILGenericILIF::SetComponentIfRole(const TUid& aComponentRole) + { + return (iBody->SetIfToRole(aComponentRole)); + } + +EXPORT_C TInt COmxILGenericILIF::SetComponentIfRole(const TDesC8& /*aComponentRole*/) + { + // Under A3F the roles are identified by Format Uid rather than role names. + return (KErrNotSupported); + } + +EXPORT_C TInt COmxILGenericILIF::GetComponentIfRole(TUid& aComponentRole) const + { + return (iBody->GetIfRole(aComponentRole)); + } + +EXPORT_C TInt COmxILGenericILIF::GetComponentIfRole(TDes8& /*aComponentRole*/) const + { + // Under A3F the roles are identified by Format Uid rather than role names. + return (KErrNotSupported); + } + +EXPORT_C TInt COmxILGenericILIF::SetExtConfig(const TDesC8& /*aParameterName*/, + const TILStruct& /*aConfig*/, + const MILComponentPortIf* /*aComponentPort*/) + { + // It should be implemented in the derived class + return (KErrNotSupported); + } + +EXPORT_C TInt COmxILGenericILIF::GetExtConfig(const TDesC8& /*aParameterName*/, + TILStruct& /*aConfig*/, + const MILComponentPortIf* /*aComponentPort*/) const + { + // It should be implemented in the derived class + return (KErrNotSupported); + } + +EXPORT_C TAny* COmxILGenericILIF::CustomInterface(TUid aUid) + { + if (aUid == KUidILComponentIf) + { + MILComponentIf* componentIf = this; + return componentIf; + } + else + { + return NULL; + } + } + +EXPORT_C TInt COmxILGenericILIF::FillBufferDone(CMMFBuffer* aBuffer, + TInt aPortIndex) + { + return (iBody->FillBufferDone(aBuffer, aPortIndex)); + } + +EXPORT_C TInt COmxILGenericILIF::EmptyBufferDone(const CMMFBuffer* aBuffer, + TInt aPortIndex) + { + return (iBody->EmptyBufferDone(aBuffer, aPortIndex)); + } + +EXPORT_C TInt COmxILGenericILIF::EventHandler(OMX_EVENTTYPE aEvent, + TUint32 aData1, + TUint32 aData2, + TAny* aExtraInfo) + { + return (iBody->EventHandler(aEvent, aData1, aData2, aExtraInfo)); + } + +EXPORT_C TInt COmxILGenericILIF::OmxGetParameter(OMX_INDEXTYPE aParamIndex, + TAny* aComponentParameterStructure) const + { + return (iBody->OmxGetParameter(aParamIndex, aComponentParameterStructure)); + } + +EXPORT_C TInt COmxILGenericILIF::OmxSetParameter(OMX_INDEXTYPE aParamIndex, + TAny* aComponentParameterStructure) + { + return (iBody->OmxSetParameter(aParamIndex, aComponentParameterStructure)); + } + +EXPORT_C TInt COmxILGenericILIF::OmxGetConfig(OMX_INDEXTYPE aConfigIndex, + TAny* aValue) const + { + return (iBody->OmxGetConfig(aConfigIndex, aValue)); + } + +EXPORT_C TInt COmxILGenericILIF::OmxSetConfig(OMX_INDEXTYPE aConfigIndex, + TAny* aValue) + { + return (iBody->OmxSetConfig(aConfigIndex, aValue)); + } + +EXPORT_C TInt COmxILGenericILIF::OmxGetExtensionIndex(const TDesC8& aParameterName, + OMX_INDEXTYPE* aIndexType) const + { + return (iBody->OmxGetExtensionIndex(aParameterName, aIndexType)); + } + +TInt COmxILGenericILIF::OmxSendCommand(OMX_COMMANDTYPE aCmd, + TUint32 aParam1, + TAny* aCmdData) + { + return (iBody->OmxSendCommand(aCmd, aParam1, aCmdData)); + } + +TInt COmxILGenericILIF::OmxComponentTunnelRequest(TUint32 aPortInput, + OMX_HANDLETYPE aOutput, + TUint32 aPortOutput) + { + return (iBody->OmxComponentTunnelRequest(aPortInput, aOutput, aPortOutput)); + } + +TInt COmxILGenericILIF::OmxComponentDisconnectTunnel(TUint32 aPortInput, + OMX_HANDLETYPE aOutput, + TUint32 aPortOutput) + { + return (iBody->OmxComponentDisconnectTunnel(aPortInput, aOutput, aPortOutput)); + } + +TInt COmxILGenericILIF::OmxUseBuffer(CMMFBuffer* aBuffer, + TUint32 aPortIndex) + { + return (iBody->OmxUseBuffer(aBuffer, aPortIndex)); + } + +CMMFBuffer* COmxILGenericILIF::OmxAllocateBufferL(TUint32 aPortIndex, + TUint32 aSizeBytes) + { + return (iBody->OmxAllocateBufferL(aPortIndex, aSizeBytes)); + } + +TInt COmxILGenericILIF::OmxFreeBuffer(CMMFBuffer* aBuffer) + { + return (iBody->OmxFreeBuffer(aBuffer)); + } + +TInt COmxILGenericILIF::OmxEmptyThisBuffer(const CMMFBuffer* aBuffer, + MOmxILComponentIfObserver* aObserver) + { + return (iBody->OmxEmptyThisBuffer(aBuffer, aObserver)); + } + +TInt COmxILGenericILIF::OmxFillThisBuffer(CMMFBuffer* aBuffer, + MOmxILComponentIfObserver* aObserver) + { + return (iBody->OmxFillThisBuffer(aBuffer, aObserver)); + } + + +OMX_COMPONENTTYPE* COmxILGenericILIF::OmxHandle() const + { + return (iBody->Handle()); + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/refomxil/src/omxilgenericilif/omxilgenericilif.hrh --- a/omxil/mmilapi/refomxil/src/omxilgenericilif/omxilgenericilif.hrh Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/refomxil/src/omxilgenericilif/omxilgenericilif.hrh Fri May 07 16:25:23 2010 +0100 @@ -1,26 +1,26 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// - -#ifndef OMXILGENERICILIF_HRH -#define OMXILGENERICILIF_HRH - -#define KSharedLibraryUidDefine 0x1000008D - -// UID to identify the generic OMX MILIF Dll. -// This DLL is part of the reference milif implementation. -#define KUidOmxILGenericILIFDll 0x10285C7C - -#endif // OMXILGENERICILIF_HRH - +// 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 OMXILGENERICILIF_HRH +#define OMXILGENERICILIF_HRH + +#define KSharedLibraryUidDefine 0x1000008D + +// UID to identify the generic OMX MILIF Dll. +// This DLL is part of the reference milif implementation. +#define KUidOmxILGenericILIFDll 0x10285C7C + +#endif // OMXILGENERICILIF_HRH + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/refomxil/src/omxilgenericilif/omxilgenericilifbody.cpp --- a/omxil/mmilapi/refomxil/src/omxilgenericilif/omxilgenericilifbody.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/refomxil/src/omxilgenericilif/omxilgenericilifbody.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,430 +1,430 @@ -// 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 "omxilgenericilifbody.h" -#include "omxilcoreutils.h" -#include "omxilspecversion.h" -#include "milifobserver.h" -#include "tilstructtypes.h" - - -const TInt KMaxComponentNameLength = 128; - - -COmxILGenericILIF::CBody::CBody(COmxILGenericILIF& aParent, - MILIfObserver& aComponentIfObserver) - : - iParent(aParent), - iIfObserver(aComponentIfObserver) - - { - } - -COmxILGenericILIF::CBody::~CBody() - { - iInputPorts.ResetAndDestroy(); - iInputPorts.Close(); - iOutputPorts.ResetAndDestroy(); - iOutputPorts.Close(); - delete iBufferManager; - delete iCallbacks; - - ::OMX_FreeHandle(reinterpret_cast(iHandle)); - } - -COmxILGenericILIF::CBody* COmxILGenericILIF::CBody::NewL(COmxILGenericILIF& aParent, - MILIfObserver& aComponentIfObserver, - const TDesC8& aComponentName) - { - CBody* self = new (ELeave) CBody(aParent, aComponentIfObserver); - CleanupStack::PushL(self); - self->ConstructL(aComponentName); - CleanupStack::Pop(self); - return self; - } - -void COmxILGenericILIF::CBody::ConstructL(const TDesC8& aComponentName) - { - iCallbacks = COmxCallbacks::NewL(iParent); - - RBuf8 buf; - buf.CleanupClosePushL(); - buf.CreateL(aComponentName, KMaxComponentNameLength); - TUint8* name = const_cast(buf.PtrZ()); - - OMX_ERRORTYPE errorType = ::OMX_GetHandle(reinterpret_cast(&iHandle), - reinterpret_cast(name), - iCallbacks, - *iCallbacks); - CleanupStack::PopAndDestroy(&buf); - - User::LeaveIfError(ConvertOmxErrorType(errorType)); - - iBufferManager = new (ELeave) COmxBufferManager(iHandle); - } - -OMX_COMPONENTTYPE* COmxILGenericILIF::CBody::Handle() const - { - return iHandle; - } - -TInt COmxILGenericILIF::CBody::OmxGetComponentVersion(TPtr8 aComponentName, - OMX_VERSIONTYPE* aComponentVersion, - OMX_VERSIONTYPE* aSpecVersion, - OMX_UUIDTYPE* aComponentUUID) - { - ASSERT(aComponentVersion); - ASSERT(aSpecVersion); - ASSERT(aComponentUUID); - - TUint8* cname = const_cast(aComponentName.PtrZ()); - OMX_ERRORTYPE error = iHandle->GetComponentVersion(reinterpret_cast(iHandle), - reinterpret_cast(cname), aComponentVersion, aSpecVersion, aComponentUUID); - - TLex8 lex(cname); - TInt length; - for( length = 0; !lex.Eos(); ++length ) - { - lex.Inc(); - } - aComponentName.SetLength(length); - - return ConvertOmxErrorType(error); - } - -TInt COmxILGenericILIF::CBody::OmxSendCommand(OMX_COMMANDTYPE aCmd, - TUint32 aParam, - TAny* aCmdData) - { - OMX_ERRORTYPE error = iHandle->SendCommand(reinterpret_cast(iHandle), aCmd, aParam, aCmdData); - return ConvertOmxErrorType(error); - } - -TInt COmxILGenericILIF::CBody::OmxGetParameter(OMX_INDEXTYPE aParamIndex, - TAny* aValue) - { - ASSERT(aValue); - - OMX_ERRORTYPE error = iHandle->GetParameter(reinterpret_cast(iHandle), aParamIndex, aValue); - return ConvertOmxErrorType(error); - } - -TInt COmxILGenericILIF::CBody::OmxSetParameter(OMX_INDEXTYPE aIndex, - TAny* aValue) - { - ASSERT(aValue); - - OMX_ERRORTYPE error = iHandle->SetParameter(reinterpret_cast(iHandle), aIndex, aValue); - return ConvertOmxErrorType(error); - } - -TInt COmxILGenericILIF::CBody::OmxGetConfig(OMX_INDEXTYPE aIndex, - TAny* aValue) - { - ASSERT(aValue); - - OMX_ERRORTYPE error = iHandle->GetConfig(reinterpret_cast(iHandle), aIndex, aValue); - return ConvertOmxErrorType(error); - } - -TInt COmxILGenericILIF::CBody::OmxSetConfig(OMX_INDEXTYPE aIndex, - TAny* aValue) - { - ASSERT(aValue); - - OMX_ERRORTYPE error = iHandle->SetConfig(reinterpret_cast(iHandle), aIndex, aValue); - return ConvertOmxErrorType(error); - } - -TInt COmxILGenericILIF::CBody::OmxGetExtensionIndex(const TDesC8& aParameterName, - OMX_INDEXTYPE* aIndexType) - { - HBufC8* buf = HBufC8::New(aParameterName.Length()+1); - if (buf == NULL) - { - return KErrNoMemory; - } - else - { - *buf = aParameterName; - TUint8* cstring = const_cast(buf->Des().PtrZ()); - OMX_ERRORTYPE error = iHandle->GetExtensionIndex(reinterpret_cast(iHandle), reinterpret_cast(cstring), aIndexType); - delete buf; - return ConvertOmxErrorType(error); - } - } - -TInt COmxILGenericILIF::CBody::OmxGetState(OMX_STATETYPE* aState) - { - - OMX_ERRORTYPE error = iHandle->GetState(reinterpret_cast(iHandle), aState); - return ConvertOmxErrorType(error); - } - -TInt COmxILGenericILIF::CBody::OmxComponentTunnelRequest(TUint32 aPortInput, - OMX_HANDLETYPE aOutput, - TUint32 aPortOutput) - { - OMX_ERRORTYPE error = ::OMX_SetupTunnel(aOutput, aPortOutput, reinterpret_cast(iHandle), aPortInput); - return ConvertOmxErrorType(error); - } - -TInt COmxILGenericILIF::CBody::OmxComponentDisconnectTunnel(TUint32 aPortInput, - OMX_HANDLETYPE aOutput, - TUint32 aPortOutput) - { - OMX_ERRORTYPE error = ::OMX_SetupTunnel(aOutput, aPortOutput, 0, 0); - if (error == OMX_ErrorNone) - { - error = ::OMX_SetupTunnel(0, 0, reinterpret_cast(iHandle), aPortInput); - } - return ConvertOmxErrorType(error); - } - -TInt COmxILGenericILIF::CBody::OmxUseBuffer(CMMFBuffer* aBuffer, - TUint32 aPortIndex) - { - ASSERT(aBuffer); - - return (iBufferManager->UseBuffer(*aBuffer, aPortIndex)); - } - -CMMFBuffer* COmxILGenericILIF::CBody::OmxAllocateBufferL(TUint32 aPortIndex, - TUint32 aSizeBytes) - { - return (iBufferManager->AllocateBufferL(aPortIndex, aSizeBytes)); - } - -TInt COmxILGenericILIF::CBody::OmxFreeBuffer(CMMFBuffer* aBuffer) - { - ASSERT(aBuffer); - - return (iBufferManager->FreeBuffer(aBuffer)); - } - -TInt COmxILGenericILIF::CBody::OmxEmptyThisBuffer(const CMMFBuffer* aBuffer, - MOmxILComponentIfObserver* aObserver) - { - ASSERT(aBuffer); - - return (iBufferManager->EmptyThisBuffer(aBuffer, aObserver)); - } - -TInt COmxILGenericILIF::CBody::OmxFillThisBuffer(CMMFBuffer* aBuffer, - MOmxILComponentIfObserver* aObserver) - { - ASSERT(aBuffer); - - return (iBufferManager->FillThisBuffer(aBuffer, aObserver)); - } - -TInt COmxILGenericILIF::CBody::OmxComponentRoleEnum(TPtr8& aComponentRole, - TUint32 aIndex) - { - TUint8* role = const_cast (aComponentRole.PtrZ()); - OMX_ERRORTYPE error = iHandle->ComponentRoleEnum(reinterpret_cast(iHandle), reinterpret_cast(role), aIndex); - - TLex8 lex(role); - TInt length; - for( length = 0; !lex.Eos(); ++length ) - { - lex.Inc(); - } - aComponentRole.SetLength(length); - - return ConvertOmxErrorType(error); - } - -TInt COmxILGenericILIF::CBody::SetIfToRole(const TUid& aComponentRole) - { - iFormat = aComponentRole; - return KErrNone; - } - -TInt COmxILGenericILIF::CBody::GetIfRole(TUid& aComponentRole) const - { - aComponentRole = iFormat; - return KErrNone; - } - -TInt COmxILGenericILIF::CBody::SetPortsL() - { - OMX_PORT_PARAM_TYPE param; - param.nVersion = KOMXILSpecVersion; - param.nSize = sizeof(OMX_PORT_PARAM_TYPE); - TInt err = OmxGetParameter(OMX_IndexParamAudioInit, ¶m); - - if (err == KErrNone) - { - for (TInt i=0; i < param.nPorts && err == KErrNone; i++ ) - { - OMX_PARAM_PORTDEFINITIONTYPE portInfo; - portInfo.nPortIndex = i; - portInfo.nVersion = KOMXILSpecVersion; - portInfo.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE); - err = OmxGetParameter(OMX_IndexParamPortDefinition, &portInfo); - if (err == KErrNone) - { - if (portInfo.eDir == OMX_DirInput) - { - COmxILGenericPortILIF* inputPort = COmxILGenericPortILIF::NewL(iParent, EDirInput, portInfo.nPortIndex); - err = iInputPorts.Append(inputPort); - } - else - { - COmxILGenericPortILIF* outputPort = COmxILGenericPortILIF::NewL(iParent, EDirOutput, portInfo.nPortIndex); - err = iOutputPorts.Append(outputPort); - } - } - } - } - return err; - } - -TInt COmxILGenericILIF::CBody::GetComponentPorts(RPointerArray& aComponentPorts, - OMX_DIRTYPE aDirection) - { - TInt err = KErrNone; - if (aDirection == OMX_DirInput) - { - const TInt counter = iInputPorts.Count(); - for (TInt i=0; i < counter && err == KErrNone; i++ ) - { - err = aComponentPorts.Append(iInputPorts[i]); - } - } - else if (aDirection == OMX_DirOutput) - { - const TInt counter = iOutputPorts.Count(); - for (TInt i=0; i < counter && err == KErrNone; i++ ) - { - err = aComponentPorts.Append(iOutputPorts[i]); - } - } - else - { - err = KErrNotSupported; - } - return err; - } - -TInt COmxILGenericILIF::CBody::FillBufferDone(CMMFBuffer* aBuffer, - TInt aPortIndex) - { - ASSERT(aBuffer); - - // Loop through all output ports to search for the interface associated to this port index - const TInt counter = iOutputPorts.Count(); - for (TInt i=0; i < counter; i++ ) - { - if (iOutputPorts[i]->PortIndex() == aPortIndex) - { - return (iIfObserver.BufferDelivered(iOutputPorts[i], aBuffer)); - } - } - - return KErrNotFound; - } - -TInt COmxILGenericILIF::CBody::EmptyBufferDone(const CMMFBuffer* aBuffer, - TInt aPortIndex) - { - ASSERT(aBuffer); - - // Loop through all input ports to search for the interface associated to this port index - const TInt counter = iInputPorts.Count(); - for (TInt i=0; i < counter; i++ ) - { - if (iInputPorts[i]->PortIndex() == aPortIndex) - { - return (iIfObserver.BufferDelivered(iInputPorts[i], aBuffer)); - } - } - - return KErrNotFound; - } - -TInt COmxILGenericILIF::CBody::EventHandler(OMX_EVENTTYPE aEvent, - TUint32 aData1, - TUint32 aData2, - TAny* /*aExtraInfo*/) - { - TInt err = KErrNone; - TILEvent thisEvent; - - switch (aEvent) - { - case OMX_EventCmdComplete: - { - thisEvent.iEvent = EEventCmdComplete; - if (aData1 == OMX_CommandStateSet) - { - thisEvent.iData1 = ECommandStateSet; - OMX_STATETYPE state = static_cast(aData2); - thisEvent.iData2 = ConvertOmxState(state); - err = iIfObserver.MsgFromILComponent(&iParent, thisEvent); - break; - } - else if (aData1 == OMX_CommandFlush) - { - thisEvent.iData1 = ECommandFlush; - thisEvent.iData2 = aData2; // Port index - err = iIfObserver.MsgFromILComponent(&iParent, thisEvent); - } - else if (aData1 == OMX_CommandPortDisable) - { - thisEvent.iData1 = ECommandPortDisable; - thisEvent.iData2 = aData2; // Port index - err = iIfObserver.MsgFromILComponent(&iParent, thisEvent); - } - else if (aData1 == OMX_CommandPortEnable) - { - thisEvent.iData1 = ECommandPortEnable; - thisEvent.iData2 = aData2; // Port index - err = iIfObserver.MsgFromILComponent(&iParent, thisEvent); - } - else - { - err = KErrNotSupported; - } - - break; - } - case OMX_EventBufferFlag: - { - // Propagate the EOF up to client as KErrUnderflow - thisEvent.iEvent = EEventBufferFlag; - thisEvent.iData1 = aData1; - thisEvent.iData2 = static_cast(KErrUnderflow); - err = iIfObserver.MsgFromILComponent(&iParent, thisEvent); - break; - } - case OMX_EventError: - { - // Propagate the error up to client - thisEvent.iEvent = EEventError; - OMX_ERRORTYPE errorx = static_cast(aData1); - thisEvent.iData1 = ConvertOmxErrorType(errorx); - err = iIfObserver.MsgFromILComponent(&iParent, thisEvent); - break; - } - default: - { - err = KErrNotSupported; - } - } - return err; - } +// 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 "omxilgenericilifbody.h" +#include "omxilcoreutils.h" +#include "omxilspecversion.h" +#include "milifobserver.h" +#include "tilstructtypes.h" + + +const TInt KMaxComponentNameLength = 128; + + +COmxILGenericILIF::CBody::CBody(COmxILGenericILIF& aParent, + MILIfObserver& aComponentIfObserver) + : + iParent(aParent), + iIfObserver(aComponentIfObserver) + + { + } + +COmxILGenericILIF::CBody::~CBody() + { + iInputPorts.ResetAndDestroy(); + iInputPorts.Close(); + iOutputPorts.ResetAndDestroy(); + iOutputPorts.Close(); + delete iBufferManager; + delete iCallbacks; + + ::OMX_FreeHandle(reinterpret_cast(iHandle)); + } + +COmxILGenericILIF::CBody* COmxILGenericILIF::CBody::NewL(COmxILGenericILIF& aParent, + MILIfObserver& aComponentIfObserver, + const TDesC8& aComponentName) + { + CBody* self = new (ELeave) CBody(aParent, aComponentIfObserver); + CleanupStack::PushL(self); + self->ConstructL(aComponentName); + CleanupStack::Pop(self); + return self; + } + +void COmxILGenericILIF::CBody::ConstructL(const TDesC8& aComponentName) + { + iCallbacks = COmxCallbacks::NewL(iParent); + + RBuf8 buf; + buf.CleanupClosePushL(); + buf.CreateL(aComponentName, KMaxComponentNameLength); + TUint8* name = const_cast(buf.PtrZ()); + + OMX_ERRORTYPE errorType = ::OMX_GetHandle(reinterpret_cast(&iHandle), + reinterpret_cast(name), + iCallbacks, + *iCallbacks); + CleanupStack::PopAndDestroy(&buf); + + User::LeaveIfError(ConvertOmxErrorType(errorType)); + + iBufferManager = new (ELeave) COmxBufferManager(iHandle); + } + +OMX_COMPONENTTYPE* COmxILGenericILIF::CBody::Handle() const + { + return iHandle; + } + +TInt COmxILGenericILIF::CBody::OmxGetComponentVersion(TPtr8 aComponentName, + OMX_VERSIONTYPE* aComponentVersion, + OMX_VERSIONTYPE* aSpecVersion, + OMX_UUIDTYPE* aComponentUUID) + { + ASSERT(aComponentVersion); + ASSERT(aSpecVersion); + ASSERT(aComponentUUID); + + TUint8* cname = const_cast(aComponentName.PtrZ()); + OMX_ERRORTYPE error = iHandle->GetComponentVersion(reinterpret_cast(iHandle), + reinterpret_cast(cname), aComponentVersion, aSpecVersion, aComponentUUID); + + TLex8 lex(cname); + TInt length; + for( length = 0; !lex.Eos(); ++length ) + { + lex.Inc(); + } + aComponentName.SetLength(length); + + return ConvertOmxErrorType(error); + } + +TInt COmxILGenericILIF::CBody::OmxSendCommand(OMX_COMMANDTYPE aCmd, + TUint32 aParam, + TAny* aCmdData) + { + OMX_ERRORTYPE error = iHandle->SendCommand(reinterpret_cast(iHandle), aCmd, aParam, aCmdData); + return ConvertOmxErrorType(error); + } + +TInt COmxILGenericILIF::CBody::OmxGetParameter(OMX_INDEXTYPE aParamIndex, + TAny* aValue) + { + ASSERT(aValue); + + OMX_ERRORTYPE error = iHandle->GetParameter(reinterpret_cast(iHandle), aParamIndex, aValue); + return ConvertOmxErrorType(error); + } + +TInt COmxILGenericILIF::CBody::OmxSetParameter(OMX_INDEXTYPE aIndex, + TAny* aValue) + { + ASSERT(aValue); + + OMX_ERRORTYPE error = iHandle->SetParameter(reinterpret_cast(iHandle), aIndex, aValue); + return ConvertOmxErrorType(error); + } + +TInt COmxILGenericILIF::CBody::OmxGetConfig(OMX_INDEXTYPE aIndex, + TAny* aValue) + { + ASSERT(aValue); + + OMX_ERRORTYPE error = iHandle->GetConfig(reinterpret_cast(iHandle), aIndex, aValue); + return ConvertOmxErrorType(error); + } + +TInt COmxILGenericILIF::CBody::OmxSetConfig(OMX_INDEXTYPE aIndex, + TAny* aValue) + { + ASSERT(aValue); + + OMX_ERRORTYPE error = iHandle->SetConfig(reinterpret_cast(iHandle), aIndex, aValue); + return ConvertOmxErrorType(error); + } + +TInt COmxILGenericILIF::CBody::OmxGetExtensionIndex(const TDesC8& aParameterName, + OMX_INDEXTYPE* aIndexType) + { + HBufC8* buf = HBufC8::New(aParameterName.Length()+1); + if (buf == NULL) + { + return KErrNoMemory; + } + else + { + *buf = aParameterName; + TUint8* cstring = const_cast(buf->Des().PtrZ()); + OMX_ERRORTYPE error = iHandle->GetExtensionIndex(reinterpret_cast(iHandle), reinterpret_cast(cstring), aIndexType); + delete buf; + return ConvertOmxErrorType(error); + } + } + +TInt COmxILGenericILIF::CBody::OmxGetState(OMX_STATETYPE* aState) + { + + OMX_ERRORTYPE error = iHandle->GetState(reinterpret_cast(iHandle), aState); + return ConvertOmxErrorType(error); + } + +TInt COmxILGenericILIF::CBody::OmxComponentTunnelRequest(TUint32 aPortInput, + OMX_HANDLETYPE aOutput, + TUint32 aPortOutput) + { + OMX_ERRORTYPE error = ::OMX_SetupTunnel(aOutput, aPortOutput, reinterpret_cast(iHandle), aPortInput); + return ConvertOmxErrorType(error); + } + +TInt COmxILGenericILIF::CBody::OmxComponentDisconnectTunnel(TUint32 aPortInput, + OMX_HANDLETYPE aOutput, + TUint32 aPortOutput) + { + OMX_ERRORTYPE error = ::OMX_SetupTunnel(aOutput, aPortOutput, 0, 0); + if (error == OMX_ErrorNone) + { + error = ::OMX_SetupTunnel(0, 0, reinterpret_cast(iHandle), aPortInput); + } + return ConvertOmxErrorType(error); + } + +TInt COmxILGenericILIF::CBody::OmxUseBuffer(CMMFBuffer* aBuffer, + TUint32 aPortIndex) + { + ASSERT(aBuffer); + + return (iBufferManager->UseBuffer(*aBuffer, aPortIndex)); + } + +CMMFBuffer* COmxILGenericILIF::CBody::OmxAllocateBufferL(TUint32 aPortIndex, + TUint32 aSizeBytes) + { + return (iBufferManager->AllocateBufferL(aPortIndex, aSizeBytes)); + } + +TInt COmxILGenericILIF::CBody::OmxFreeBuffer(CMMFBuffer* aBuffer) + { + ASSERT(aBuffer); + + return (iBufferManager->FreeBuffer(aBuffer)); + } + +TInt COmxILGenericILIF::CBody::OmxEmptyThisBuffer(const CMMFBuffer* aBuffer, + MOmxILComponentIfObserver* aObserver) + { + ASSERT(aBuffer); + + return (iBufferManager->EmptyThisBuffer(aBuffer, aObserver)); + } + +TInt COmxILGenericILIF::CBody::OmxFillThisBuffer(CMMFBuffer* aBuffer, + MOmxILComponentIfObserver* aObserver) + { + ASSERT(aBuffer); + + return (iBufferManager->FillThisBuffer(aBuffer, aObserver)); + } + +TInt COmxILGenericILIF::CBody::OmxComponentRoleEnum(TPtr8& aComponentRole, + TUint32 aIndex) + { + TUint8* role = const_cast (aComponentRole.PtrZ()); + OMX_ERRORTYPE error = iHandle->ComponentRoleEnum(reinterpret_cast(iHandle), reinterpret_cast(role), aIndex); + + TLex8 lex(role); + TInt length; + for( length = 0; !lex.Eos(); ++length ) + { + lex.Inc(); + } + aComponentRole.SetLength(length); + + return ConvertOmxErrorType(error); + } + +TInt COmxILGenericILIF::CBody::SetIfToRole(const TUid& aComponentRole) + { + iFormat = aComponentRole; + return KErrNone; + } + +TInt COmxILGenericILIF::CBody::GetIfRole(TUid& aComponentRole) const + { + aComponentRole = iFormat; + return KErrNone; + } + +TInt COmxILGenericILIF::CBody::SetPortsL() + { + OMX_PORT_PARAM_TYPE param; + param.nVersion = KOMXILSpecVersion; + param.nSize = sizeof(OMX_PORT_PARAM_TYPE); + TInt err = OmxGetParameter(OMX_IndexParamAudioInit, ¶m); + + if (err == KErrNone) + { + for (TInt i=0; i < param.nPorts && err == KErrNone; i++ ) + { + OMX_PARAM_PORTDEFINITIONTYPE portInfo; + portInfo.nPortIndex = i; + portInfo.nVersion = KOMXILSpecVersion; + portInfo.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE); + err = OmxGetParameter(OMX_IndexParamPortDefinition, &portInfo); + if (err == KErrNone) + { + if (portInfo.eDir == OMX_DirInput) + { + COmxILGenericPortILIF* inputPort = COmxILGenericPortILIF::NewL(iParent, EDirInput, portInfo.nPortIndex); + err = iInputPorts.Append(inputPort); + } + else + { + COmxILGenericPortILIF* outputPort = COmxILGenericPortILIF::NewL(iParent, EDirOutput, portInfo.nPortIndex); + err = iOutputPorts.Append(outputPort); + } + } + } + } + return err; + } + +TInt COmxILGenericILIF::CBody::GetComponentPorts(RPointerArray& aComponentPorts, + OMX_DIRTYPE aDirection) + { + TInt err = KErrNone; + if (aDirection == OMX_DirInput) + { + const TInt counter = iInputPorts.Count(); + for (TInt i=0; i < counter && err == KErrNone; i++ ) + { + err = aComponentPorts.Append(iInputPorts[i]); + } + } + else if (aDirection == OMX_DirOutput) + { + const TInt counter = iOutputPorts.Count(); + for (TInt i=0; i < counter && err == KErrNone; i++ ) + { + err = aComponentPorts.Append(iOutputPorts[i]); + } + } + else + { + err = KErrNotSupported; + } + return err; + } + +TInt COmxILGenericILIF::CBody::FillBufferDone(CMMFBuffer* aBuffer, + TInt aPortIndex) + { + ASSERT(aBuffer); + + // Loop through all output ports to search for the interface associated to this port index + const TInt counter = iOutputPorts.Count(); + for (TInt i=0; i < counter; i++ ) + { + if (iOutputPorts[i]->PortIndex() == aPortIndex) + { + return (iIfObserver.BufferDelivered(iOutputPorts[i], aBuffer)); + } + } + + return KErrNotFound; + } + +TInt COmxILGenericILIF::CBody::EmptyBufferDone(const CMMFBuffer* aBuffer, + TInt aPortIndex) + { + ASSERT(aBuffer); + + // Loop through all input ports to search for the interface associated to this port index + const TInt counter = iInputPorts.Count(); + for (TInt i=0; i < counter; i++ ) + { + if (iInputPorts[i]->PortIndex() == aPortIndex) + { + return (iIfObserver.BufferDelivered(iInputPorts[i], aBuffer)); + } + } + + return KErrNotFound; + } + +TInt COmxILGenericILIF::CBody::EventHandler(OMX_EVENTTYPE aEvent, + TUint32 aData1, + TUint32 aData2, + TAny* /*aExtraInfo*/) + { + TInt err = KErrNone; + TILEvent thisEvent; + + switch (aEvent) + { + case OMX_EventCmdComplete: + { + thisEvent.iEvent = EEventCmdComplete; + if (aData1 == OMX_CommandStateSet) + { + thisEvent.iData1 = ECommandStateSet; + OMX_STATETYPE state = static_cast(aData2); + thisEvent.iData2 = ConvertOmxState(state); + err = iIfObserver.MsgFromILComponent(&iParent, thisEvent); + break; + } + else if (aData1 == OMX_CommandFlush) + { + thisEvent.iData1 = ECommandFlush; + thisEvent.iData2 = aData2; // Port index + err = iIfObserver.MsgFromILComponent(&iParent, thisEvent); + } + else if (aData1 == OMX_CommandPortDisable) + { + thisEvent.iData1 = ECommandPortDisable; + thisEvent.iData2 = aData2; // Port index + err = iIfObserver.MsgFromILComponent(&iParent, thisEvent); + } + else if (aData1 == OMX_CommandPortEnable) + { + thisEvent.iData1 = ECommandPortEnable; + thisEvent.iData2 = aData2; // Port index + err = iIfObserver.MsgFromILComponent(&iParent, thisEvent); + } + else + { + err = KErrNotSupported; + } + + break; + } + case OMX_EventBufferFlag: + { + // Propagate the EOF up to client as KErrUnderflow + thisEvent.iEvent = EEventBufferFlag; + thisEvent.iData1 = aData1; + thisEvent.iData2 = static_cast(KErrUnderflow); + err = iIfObserver.MsgFromILComponent(&iParent, thisEvent); + break; + } + case OMX_EventError: + { + // Propagate the error up to client + thisEvent.iEvent = EEventError; + OMX_ERRORTYPE errorx = static_cast(aData1); + thisEvent.iData1 = ConvertOmxErrorType(errorx); + err = iIfObserver.MsgFromILComponent(&iParent, thisEvent); + break; + } + default: + { + err = KErrNotSupported; + } + } + return err; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/refomxil/src/omxilgenericilif/omxilgenericilifbody.h --- a/omxil/mmilapi/refomxil/src/omxilgenericilif/omxilgenericilifbody.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/refomxil/src/omxilgenericilif/omxilgenericilifbody.h Fri May 07 16:25:23 2010 +0100 @@ -1,86 +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: -// - -#ifndef OMXILGENERICILIFBODY_H -#define OMXILGENERICILIFBODY_H - - -#include "omxilgenericilif.h" -#include "omxilgenericportilif.h" -#include "omxilgenericilifbodyimpl.h" -#include -#include - - -/** -Body implementation of the COmxILGenericILIF specific to OpenMAX specification. -*/ -class COmxILGenericILIF::CBody : public CBase - { -public: - static CBody* NewL(COmxILGenericILIF& aParent, - MILIfObserver& aComponentIfObserver, - const TDesC8& aComponentName); - ~CBody(); - - OMX_COMPONENTTYPE* Handle() const; - - TInt OmxGetComponentVersion(TPtr8 aComponentName, OMX_VERSIONTYPE* aComponentVersion, OMX_VERSIONTYPE* aSpecVersion, OMX_UUIDTYPE* aComponentUUID); - TInt OmxSendCommand(OMX_COMMANDTYPE aCmd, TUint32 aParam1, TAny* aCmdData); - TInt OmxGetParameter(OMX_INDEXTYPE aParamIndex, TAny* aComponentParameterStructure); - TInt OmxSetParameter(OMX_INDEXTYPE aIndex, TAny* aComponentParameterStructure); - TInt OmxGetConfig(OMX_INDEXTYPE aIndex, TAny* aValue); - TInt OmxSetConfig(OMX_INDEXTYPE aIndex, TAny* aValue); - TInt OmxGetExtensionIndex(const TDesC8& aParameterName, OMX_INDEXTYPE* aIndexType); - TInt OmxGetState(OMX_STATETYPE* aState); - TInt OmxComponentTunnelRequest(TUint32 aPortInput, OMX_HANDLETYPE aOutput, TUint32 aPortOutput); - TInt OmxComponentDisconnectTunnel(TUint32 aPortInput, OMX_HANDLETYPE aOutput, TUint32 aPortOutput); - TInt OmxUseBuffer(CMMFBuffer* aBuffer, TUint32 aPortIndex); - CMMFBuffer* OmxAllocateBufferL(TUint32 aPortIndex, TUint32 aSizeBytes); - TInt OmxFreeBuffer(CMMFBuffer* aBuffer); - TInt OmxEmptyThisBuffer(const CMMFBuffer* aBuffer, MOmxILComponentIfObserver* aObserver); - TInt OmxFillThisBuffer(CMMFBuffer* aBuffer, MOmxILComponentIfObserver* aObserver); - TInt OmxComponentRoleEnum(TPtr8& aComponentRole, TUint32 aIndex); - TInt SetIfToRole(const TUid& aComponentRole); - TInt GetIfRole(TUid& aComponentRole) const; - TInt GetComponentPorts(RPointerArray& aComponentPorts, OMX_DIRTYPE); - TInt SetPortsL(); - - TInt FillBufferDone(CMMFBuffer* aBuffer, TInt aPortIndex); - TInt EmptyBufferDone(const CMMFBuffer* aBuffer, TInt aPortIndex); - TInt EventHandler(OMX_EVENTTYPE aEvent, TUint32 aData1, TUint32 aData2, TAny* aExtraInfo); - -private: - CBody(COmxILGenericILIF& aParent, MILIfObserver& aComponentIfObserver); - void ConstructL(const TDesC8& aComponentName); - -private: - - OMX_COMPONENTTYPE* iHandle; - - RPointerArray iInputPorts; - RPointerArray iOutputPorts; - - COmxBufferManager* iBufferManager; - COmxCallbacks* iCallbacks; - - COmxILGenericILIF& iParent; - MILIfObserver& iIfObserver; - - TUid iFormat; - }; - -#endif // OMXILGENERICILIFBODY_H - +// 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 OMXILGENERICILIFBODY_H +#define OMXILGENERICILIFBODY_H + + +#include "omxilgenericilif.h" +#include "omxilgenericportilif.h" +#include "omxilgenericilifbodyimpl.h" +#include +#include + + +/** +Body implementation of the COmxILGenericILIF specific to OpenMAX specification. +*/ +class COmxILGenericILIF::CBody : public CBase + { +public: + static CBody* NewL(COmxILGenericILIF& aParent, + MILIfObserver& aComponentIfObserver, + const TDesC8& aComponentName); + ~CBody(); + + OMX_COMPONENTTYPE* Handle() const; + + TInt OmxGetComponentVersion(TPtr8 aComponentName, OMX_VERSIONTYPE* aComponentVersion, OMX_VERSIONTYPE* aSpecVersion, OMX_UUIDTYPE* aComponentUUID); + TInt OmxSendCommand(OMX_COMMANDTYPE aCmd, TUint32 aParam1, TAny* aCmdData); + TInt OmxGetParameter(OMX_INDEXTYPE aParamIndex, TAny* aComponentParameterStructure); + TInt OmxSetParameter(OMX_INDEXTYPE aIndex, TAny* aComponentParameterStructure); + TInt OmxGetConfig(OMX_INDEXTYPE aIndex, TAny* aValue); + TInt OmxSetConfig(OMX_INDEXTYPE aIndex, TAny* aValue); + TInt OmxGetExtensionIndex(const TDesC8& aParameterName, OMX_INDEXTYPE* aIndexType); + TInt OmxGetState(OMX_STATETYPE* aState); + TInt OmxComponentTunnelRequest(TUint32 aPortInput, OMX_HANDLETYPE aOutput, TUint32 aPortOutput); + TInt OmxComponentDisconnectTunnel(TUint32 aPortInput, OMX_HANDLETYPE aOutput, TUint32 aPortOutput); + TInt OmxUseBuffer(CMMFBuffer* aBuffer, TUint32 aPortIndex); + CMMFBuffer* OmxAllocateBufferL(TUint32 aPortIndex, TUint32 aSizeBytes); + TInt OmxFreeBuffer(CMMFBuffer* aBuffer); + TInt OmxEmptyThisBuffer(const CMMFBuffer* aBuffer, MOmxILComponentIfObserver* aObserver); + TInt OmxFillThisBuffer(CMMFBuffer* aBuffer, MOmxILComponentIfObserver* aObserver); + TInt OmxComponentRoleEnum(TPtr8& aComponentRole, TUint32 aIndex); + TInt SetIfToRole(const TUid& aComponentRole); + TInt GetIfRole(TUid& aComponentRole) const; + TInt GetComponentPorts(RPointerArray& aComponentPorts, OMX_DIRTYPE); + TInt SetPortsL(); + + TInt FillBufferDone(CMMFBuffer* aBuffer, TInt aPortIndex); + TInt EmptyBufferDone(const CMMFBuffer* aBuffer, TInt aPortIndex); + TInt EventHandler(OMX_EVENTTYPE aEvent, TUint32 aData1, TUint32 aData2, TAny* aExtraInfo); + +private: + CBody(COmxILGenericILIF& aParent, MILIfObserver& aComponentIfObserver); + void ConstructL(const TDesC8& aComponentName); + +private: + + OMX_COMPONENTTYPE* iHandle; + + RPointerArray iInputPorts; + RPointerArray iOutputPorts; + + COmxBufferManager* iBufferManager; + COmxCallbacks* iCallbacks; + + COmxILGenericILIF& iParent; + MILIfObserver& iIfObserver; + + TUid iFormat; + }; + +#endif // OMXILGENERICILIFBODY_H + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/refomxil/src/omxilgenericilif/omxilgenericilifbodyimpl.cpp --- a/omxil/mmilapi/refomxil/src/omxilgenericilif/omxilgenericilifbodyimpl.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/refomxil/src/omxilgenericilif/omxilgenericilifbodyimpl.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,441 +1,441 @@ -// 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: -// omxilgenericifilbodyimpl.cpp -// -// - -#include "omxilgenericilifbodyimpl.h" -#include "omxilcoreutils.h" -#include -#include -#include - - -const TInt KMaxMsgQueueEntries = 10; - -COmxBufferManager::COmxBufferManager(OMX_COMPONENTTYPE* aHandle) - : iHandle(aHandle) - { - } - -COmxBufferManager::COmxBuffer::COmxBuffer() - { - } - - -COmxBufferManager::COmxBuffer* COmxBufferManager::COmxBuffer::NewL(OMX_BUFFERHEADERTYPE* aBufferHeader, - CMMFBuffer* aBuffer) - { - COmxBuffer* self = new (ELeave) COmxBuffer; - CleanupStack::PushL(self); - self->ConstructL(aBufferHeader, aBuffer); - CleanupStack::Pop(self); - return self; - } - -COmxBufferManager::COmxBuffer::~COmxBuffer() - { - if (iOwnsMmfBuffer) - { - delete iMmfBuffer; - } - } - -CMMFBuffer* COmxBufferManager::COmxBuffer::MmfBuffer() const - { - return iMmfBuffer; - } - -OMX_BUFFERHEADERTYPE* COmxBufferManager::COmxBuffer::BufferHeader() const - { - return iBufferHeader; - } - -void COmxBufferManager::COmxBuffer::SetPortObserver(MOmxILComponentIfObserver* aObserver) - { - iPortObserver = aObserver; - } - -MOmxILComponentIfObserver* COmxBufferManager::COmxBuffer::PortObserver() const - { - return iPortObserver; - } - -COmxBufferManager::COmxBuffer* COmxBufferManager::FindBuffer(const CMMFBuffer* aBuffer) const - { - COmxBuffer* buffer = NULL; - for (TInt i=0;iMmfBuffer() == aBuffer) - { - buffer = iBuffers[i]; - } - } - return buffer; - } - -COmxBufferManager::COmxBuffer* COmxBufferManager::FindBuffer(OMX_BUFFERHEADERTYPE* aBuffer) const - { - return reinterpret_cast(aBuffer->pAppPrivate); - } - - TInt COmxBufferManager::UseBuffer(CMMFBuffer& aBuffer, TUint aPortIndex) - { - if (CMMFBuffer::IsSupportedDataBuffer(aBuffer.Type())) - { - OMX_BUFFERHEADERTYPE* buffer; - CMMFDataBuffer& dataBuffer = static_cast(aBuffer); - - TDes8& aBufferDes = dataBuffer.Data(); - OMX_ERRORTYPE error = iHandle->UseBuffer(static_cast(iHandle), &buffer, aPortIndex, (void*)&aBuffer, aBufferDes.MaxLength(), const_cast(aBufferDes.Ptr())); - if (error != OMX_ErrorNone) - { - return ConvertOmxErrorType(error); - } - TRAPD(err, StoreBufferL(buffer, &aBuffer)); - return err; - } - else - { - return KErrNotSupported; - } - } - - - CMMFBuffer* COmxBufferManager::AllocateBufferL(TUint aPortIndex, - TUint aSizeBytes) - { - OMX_BUFFERHEADERTYPE* buffer; - OMX_ERRORTYPE error = iHandle->AllocateBuffer(static_cast(iHandle), &buffer, aPortIndex, NULL, aSizeBytes); - User::LeaveIfError(ConvertOmxErrorType(error)); - - StoreBufferL(buffer,NULL); // transfers ownership - - return FindBuffer(buffer)->MmfBuffer(); - } - - - TInt COmxBufferManager::FreeBuffer(CMMFBuffer* aBuffer) - { - COmxBuffer* buffer; - for (TInt i=0;iMmfBuffer() == aBuffer) - { - iBuffers.Remove(i); - OMX_ERRORTYPE err = iHandle->FreeBuffer(static_cast(iHandle), 0, buffer->BufferHeader()); - delete buffer; - return err; - } - } - return KErrNotFound; - } - -void COmxBufferManager::COmxBuffer::ConstructL(OMX_BUFFERHEADERTYPE* aBufferHeader, - CMMFBuffer* aBuffer) - { - - // Now if CMMFBuffer is NULL, this is been called from allocate buffer, and we need to - // Allocate a ptr buffer to correspond to the buffer created by OMX - ASSERT(aBufferHeader); - iBufferHeader = aBufferHeader; - if (aBuffer == NULL) - { - TPtr8 ptr(iBufferHeader->pBuffer, iBufferHeader->nFilledLen, iBufferHeader->nAllocLen); - CMMFBuffer* mmfBuffer = CMMFPtrBuffer::NewL(ptr); - iMmfBuffer = mmfBuffer; - iOwnsMmfBuffer = ETrue; - } - else - { - iMmfBuffer = aBuffer; - } - - // store pointer to element in array - iBufferHeader->pAppPrivate = this; - } - -void COmxBufferManager::StoreBufferL(OMX_BUFFERHEADERTYPE* aBufferHeader, - CMMFBuffer* aBuffer) - { - COmxBuffer* buf = COmxBuffer::NewL(aBufferHeader, aBuffer); - CleanupStack::PushL(buf); - iBuffers.AppendL(buf); - CleanupStack::Pop(buf); - } - - TInt COmxBufferManager::EmptyThisBuffer(const CMMFBuffer* aBuffer, - MOmxILComponentIfObserver* aObserver) - { - if (CMMFBuffer::IsSupportedDataBuffer(aBuffer->Type())) - { - COmxBuffer* omxBuffer = FindBuffer(aBuffer); - if (!omxBuffer) - { - return KErrNotFound; - } - - omxBuffer->SetPortObserver(aObserver); - OMX_BUFFERHEADERTYPE* bufferHeader = omxBuffer->BufferHeader(); - const CMMFDataBuffer* buf = static_cast(aBuffer); - const TDesC8& des = buf->Data(); - bufferHeader->nFilledLen = des.Length(); - bufferHeader->nFlags = 0; - if (aBuffer->LastBuffer()) - { - bufferHeader->nFlags |= OMX_BUFFERFLAG_EOS; - } - else - { - bufferHeader->nFlags &= ~OMX_BUFFERFLAG_EOS; - } - return ConvertOmxErrorType(iHandle->EmptyThisBuffer(static_cast(iHandle), bufferHeader)); - } - else - { - return KErrNotSupported; - } - } - - - TInt COmxBufferManager::FillThisBuffer(CMMFBuffer* aBuffer, - MOmxILComponentIfObserver* aObserver) - { - if (CMMFBuffer::IsSupportedDataBuffer(aBuffer->Type())) - { - COmxBuffer* omxBuffer = FindBuffer(aBuffer); - if (!omxBuffer) - { - return KErrNotFound; - } - omxBuffer->SetPortObserver(aObserver); - OMX_BUFFERHEADERTYPE* bufferHeader = omxBuffer->BufferHeader(); - - bufferHeader->nFilledLen = 0; - // clear last buffer flag - bufferHeader->nFlags &= ~OMX_BUFFERFLAG_EOS; - return ConvertOmxErrorType(iHandle->FillThisBuffer(static_cast(iHandle), bufferHeader)); - } - else - { - return KErrNotSupported; - } - } - - - -COmxBufferManager::~COmxBufferManager() - { - for (TInt i=0;iFreeBuffer(static_cast(iHandle), 0, omxBuffer->BufferHeader()); - delete omxBuffer; - } - iBuffers.Close(); - } - - -COmxCallbacks* COmxCallbacks::NewL(MOmxILComponentIfObserver& aObserver) - { - COmxCallbacks* self = new (ELeave) COmxCallbacks(aObserver); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } - - -void COmxCallbacks::ConstructL() - { - OMX_CALLBACKTYPE h = - { - &::EventHandler, - &::EmptyBufferDone, - &::FillBufferDone - }; - - iHandle = h; - CActiveScheduler::Add(this); - - User::LeaveIfError(iMsgQueue.CreateLocal(KMaxMsgQueueEntries)); - iMsgQueue.NotifyDataAvailable(iStatus); - SetActive(); - } - -COmxCallbacks::COmxCallbacks(MOmxILComponentIfObserver& aObserver) - : CActive(EPriorityStandard), - iParent(aObserver) - { - } - - -COmxCallbacks::operator OMX_CALLBACKTYPE*() - { - return &iHandle; - } - - -void COmxCallbacks::RunL() - { - TOmxMessage msg; - - while (iMsgQueue.Receive(msg)==KErrNone) - { - switch (msg.iType) - { - case EEmptyBufferCallback: - { - MOmxILComponentIfObserver* callback = msg.iBuffer->PortObserver(); - const CMMFBuffer* buffer = msg.iBuffer->MmfBuffer(); - OMX_BUFFERHEADERTYPE* bufferHeader = msg.iBuffer->BufferHeader(); - TInt portIndex = static_cast(bufferHeader->nInputPortIndex); - User::LeaveIfError(callback->EmptyBufferDone(buffer, portIndex)); - break; - } - - case EFillBufferCallback: - { - CMMFBuffer* mmfBuffer = msg.iBuffer->MmfBuffer(); - OMX_BUFFERHEADERTYPE* bufferHeader = msg.iBuffer->BufferHeader(); - - if (CMMFBuffer::IsSupportedDataBuffer(mmfBuffer->Type())) - { - CMMFDataBuffer* dataBuffer = static_cast(mmfBuffer); - TDes8& aBufferDes = dataBuffer->Data(); - aBufferDes.SetLength(bufferHeader->nFilledLen); - mmfBuffer->SetLastBuffer(bufferHeader->nFlags & OMX_BUFFERFLAG_EOS); - } - else - { - ASSERT(EFalse); - } - MOmxILComponentIfObserver* callback = msg.iBuffer->PortObserver(); - bufferHeader = msg.iBuffer->BufferHeader(); - TInt portIndex = static_cast(bufferHeader->nOutputPortIndex); - User::LeaveIfError(callback->FillBufferDone(mmfBuffer, portIndex)); - break; - } - case EEventCallback: - { - TInt err = KErrNone; - err = iParent.EventHandler(msg.iEventParams.iEvent, - msg.iEventParams.iData1, - msg.iEventParams.iData2, - msg.iEventParams.iExtraData); - if (err != KErrNone) - { - // Very possible the event is not supported by the IL Client. - // Ignore for now - // ASSERT(EFalse); // Uncomment this line if interested in catching this case on debug mode. - } - break; - } - default: - { - // This is an invalid state - ASSERT(EFalse); - } - }; - } - - // setup for next callbacks - iStatus = KRequestPending; - iMsgQueue.NotifyDataAvailable(iStatus); - SetActive(); - } - -COmxCallbacks::~COmxCallbacks() - { - Cancel(); - iMsgQueue.Close(); - } - - -void COmxCallbacks::DoCancel() - { - if (iMsgQueue.Handle()!=NULL) - { - iMsgQueue.CancelDataAvailable(); - } - } - - -TInt COmxCallbacks::FillBufferDone(OMX_HANDLETYPE aComponent, - COmxBufferManager::COmxBuffer* aBuffer) - { - TOmxMessage message; - message.iType = EFillBufferCallback; - message.iComponent = aComponent; - message.iBuffer = aBuffer; - return iMsgQueue.Send(message); - } - -TInt COmxCallbacks::EmptyBufferDone(OMX_HANDLETYPE aComponent, - COmxBufferManager::COmxBuffer* aBuffer) - { - TOmxMessage message; - message.iType = EEmptyBufferCallback; - message.iComponent = aComponent; - message.iBuffer = aBuffer; - return iMsgQueue.Send(message); - } - -TInt COmxCallbacks::EventHandler(OMX_HANDLETYPE aComponent, - const TEventParams& aEventParams) - { - TOmxMessage message; - message.iType = EEventCallback; - message.iComponent = aComponent; - message.iEventParams = aEventParams; - return iMsgQueue.Send(message); - } - - - -OMX_ERRORTYPE EventHandler(OMX_OUT OMX_HANDLETYPE aComponent, - OMX_OUT TAny* aAppData, - OMX_OUT OMX_EVENTTYPE aEvent, - OMX_OUT TUint32 aData1, - OMX_OUT TUint32 aData2, - OMX_OUT TAny* aExtra) - { - COmxCallbacks::TEventParams eventParams; - eventParams.iEvent = aEvent; - eventParams.iData1 = aData1; - eventParams.iData2 = aData2; - eventParams.iExtraData = aExtra; - TInt error = static_cast(aAppData)->EventHandler(aComponent, eventParams); - return ConvertSymbianErrorType(error); - } - -OMX_ERRORTYPE EmptyBufferDone(OMX_HANDLETYPE aComponent, - TAny* aAppData, - OMX_BUFFERHEADERTYPE* aBuffer) - { - COmxBufferManager::COmxBuffer* buffer = static_cast(aBuffer->pAppPrivate); - TInt error = static_cast(aAppData)->EmptyBufferDone(aComponent, buffer); - return ConvertSymbianErrorType(error); - } - -OMX_ERRORTYPE FillBufferDone(OMX_HANDLETYPE aComponent, - TAny* aAppData, - OMX_BUFFERHEADERTYPE* aBuffer) - { - COmxBufferManager::COmxBuffer* buffer = static_cast(aBuffer->pAppPrivate); - TInt error = static_cast(aAppData)->FillBufferDone(aComponent, buffer); - return ConvertSymbianErrorType(error); - } - +// 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: +// omxilgenericifilbodyimpl.cpp +// +// + +#include "omxilgenericilifbodyimpl.h" +#include "omxilcoreutils.h" +#include +#include +#include + + +const TInt KMaxMsgQueueEntries = 10; + +COmxBufferManager::COmxBufferManager(OMX_COMPONENTTYPE* aHandle) + : iHandle(aHandle) + { + } + +COmxBufferManager::COmxBuffer::COmxBuffer() + { + } + + +COmxBufferManager::COmxBuffer* COmxBufferManager::COmxBuffer::NewL(OMX_BUFFERHEADERTYPE* aBufferHeader, + CMMFBuffer* aBuffer) + { + COmxBuffer* self = new (ELeave) COmxBuffer; + CleanupStack::PushL(self); + self->ConstructL(aBufferHeader, aBuffer); + CleanupStack::Pop(self); + return self; + } + +COmxBufferManager::COmxBuffer::~COmxBuffer() + { + if (iOwnsMmfBuffer) + { + delete iMmfBuffer; + } + } + +CMMFBuffer* COmxBufferManager::COmxBuffer::MmfBuffer() const + { + return iMmfBuffer; + } + +OMX_BUFFERHEADERTYPE* COmxBufferManager::COmxBuffer::BufferHeader() const + { + return iBufferHeader; + } + +void COmxBufferManager::COmxBuffer::SetPortObserver(MOmxILComponentIfObserver* aObserver) + { + iPortObserver = aObserver; + } + +MOmxILComponentIfObserver* COmxBufferManager::COmxBuffer::PortObserver() const + { + return iPortObserver; + } + +COmxBufferManager::COmxBuffer* COmxBufferManager::FindBuffer(const CMMFBuffer* aBuffer) const + { + COmxBuffer* buffer = NULL; + for (TInt i=0;iMmfBuffer() == aBuffer) + { + buffer = iBuffers[i]; + } + } + return buffer; + } + +COmxBufferManager::COmxBuffer* COmxBufferManager::FindBuffer(OMX_BUFFERHEADERTYPE* aBuffer) const + { + return reinterpret_cast(aBuffer->pAppPrivate); + } + + TInt COmxBufferManager::UseBuffer(CMMFBuffer& aBuffer, TUint aPortIndex) + { + if (CMMFBuffer::IsSupportedDataBuffer(aBuffer.Type())) + { + OMX_BUFFERHEADERTYPE* buffer; + CMMFDataBuffer& dataBuffer = static_cast(aBuffer); + + TDes8& aBufferDes = dataBuffer.Data(); + OMX_ERRORTYPE error = iHandle->UseBuffer(static_cast(iHandle), &buffer, aPortIndex, (void*)&aBuffer, aBufferDes.MaxLength(), const_cast(aBufferDes.Ptr())); + if (error != OMX_ErrorNone) + { + return ConvertOmxErrorType(error); + } + TRAPD(err, StoreBufferL(buffer, &aBuffer)); + return err; + } + else + { + return KErrNotSupported; + } + } + + + CMMFBuffer* COmxBufferManager::AllocateBufferL(TUint aPortIndex, + TUint aSizeBytes) + { + OMX_BUFFERHEADERTYPE* buffer; + OMX_ERRORTYPE error = iHandle->AllocateBuffer(static_cast(iHandle), &buffer, aPortIndex, NULL, aSizeBytes); + User::LeaveIfError(ConvertOmxErrorType(error)); + + StoreBufferL(buffer,NULL); // transfers ownership + + return FindBuffer(buffer)->MmfBuffer(); + } + + + TInt COmxBufferManager::FreeBuffer(CMMFBuffer* aBuffer) + { + COmxBuffer* buffer; + for (TInt i=0;iMmfBuffer() == aBuffer) + { + iBuffers.Remove(i); + OMX_ERRORTYPE err = iHandle->FreeBuffer(static_cast(iHandle), 0, buffer->BufferHeader()); + delete buffer; + return err; + } + } + return KErrNotFound; + } + +void COmxBufferManager::COmxBuffer::ConstructL(OMX_BUFFERHEADERTYPE* aBufferHeader, + CMMFBuffer* aBuffer) + { + + // Now if CMMFBuffer is NULL, this is been called from allocate buffer, and we need to + // Allocate a ptr buffer to correspond to the buffer created by OMX + ASSERT(aBufferHeader); + iBufferHeader = aBufferHeader; + if (aBuffer == NULL) + { + TPtr8 ptr(iBufferHeader->pBuffer, iBufferHeader->nFilledLen, iBufferHeader->nAllocLen); + CMMFBuffer* mmfBuffer = CMMFPtrBuffer::NewL(ptr); + iMmfBuffer = mmfBuffer; + iOwnsMmfBuffer = ETrue; + } + else + { + iMmfBuffer = aBuffer; + } + + // store pointer to element in array + iBufferHeader->pAppPrivate = this; + } + +void COmxBufferManager::StoreBufferL(OMX_BUFFERHEADERTYPE* aBufferHeader, + CMMFBuffer* aBuffer) + { + COmxBuffer* buf = COmxBuffer::NewL(aBufferHeader, aBuffer); + CleanupStack::PushL(buf); + iBuffers.AppendL(buf); + CleanupStack::Pop(buf); + } + + TInt COmxBufferManager::EmptyThisBuffer(const CMMFBuffer* aBuffer, + MOmxILComponentIfObserver* aObserver) + { + if (CMMFBuffer::IsSupportedDataBuffer(aBuffer->Type())) + { + COmxBuffer* omxBuffer = FindBuffer(aBuffer); + if (!omxBuffer) + { + return KErrNotFound; + } + + omxBuffer->SetPortObserver(aObserver); + OMX_BUFFERHEADERTYPE* bufferHeader = omxBuffer->BufferHeader(); + const CMMFDataBuffer* buf = static_cast(aBuffer); + const TDesC8& des = buf->Data(); + bufferHeader->nFilledLen = des.Length(); + bufferHeader->nFlags = 0; + if (aBuffer->LastBuffer()) + { + bufferHeader->nFlags |= OMX_BUFFERFLAG_EOS; + } + else + { + bufferHeader->nFlags &= ~OMX_BUFFERFLAG_EOS; + } + return ConvertOmxErrorType(iHandle->EmptyThisBuffer(static_cast(iHandle), bufferHeader)); + } + else + { + return KErrNotSupported; + } + } + + + TInt COmxBufferManager::FillThisBuffer(CMMFBuffer* aBuffer, + MOmxILComponentIfObserver* aObserver) + { + if (CMMFBuffer::IsSupportedDataBuffer(aBuffer->Type())) + { + COmxBuffer* omxBuffer = FindBuffer(aBuffer); + if (!omxBuffer) + { + return KErrNotFound; + } + omxBuffer->SetPortObserver(aObserver); + OMX_BUFFERHEADERTYPE* bufferHeader = omxBuffer->BufferHeader(); + + bufferHeader->nFilledLen = 0; + // clear last buffer flag + bufferHeader->nFlags &= ~OMX_BUFFERFLAG_EOS; + return ConvertOmxErrorType(iHandle->FillThisBuffer(static_cast(iHandle), bufferHeader)); + } + else + { + return KErrNotSupported; + } + } + + + +COmxBufferManager::~COmxBufferManager() + { + for (TInt i=0;iFreeBuffer(static_cast(iHandle), 0, omxBuffer->BufferHeader()); + delete omxBuffer; + } + iBuffers.Close(); + } + + +COmxCallbacks* COmxCallbacks::NewL(MOmxILComponentIfObserver& aObserver) + { + COmxCallbacks* self = new (ELeave) COmxCallbacks(aObserver); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + + +void COmxCallbacks::ConstructL() + { + OMX_CALLBACKTYPE h = + { + &::EventHandler, + &::EmptyBufferDone, + &::FillBufferDone + }; + + iHandle = h; + CActiveScheduler::Add(this); + + User::LeaveIfError(iMsgQueue.CreateLocal(KMaxMsgQueueEntries)); + iMsgQueue.NotifyDataAvailable(iStatus); + SetActive(); + } + +COmxCallbacks::COmxCallbacks(MOmxILComponentIfObserver& aObserver) + : CActive(EPriorityStandard), + iParent(aObserver) + { + } + + +COmxCallbacks::operator OMX_CALLBACKTYPE*() + { + return &iHandle; + } + + +void COmxCallbacks::RunL() + { + TOmxMessage msg; + + while (iMsgQueue.Receive(msg)==KErrNone) + { + switch (msg.iType) + { + case EEmptyBufferCallback: + { + MOmxILComponentIfObserver* callback = msg.iBuffer->PortObserver(); + const CMMFBuffer* buffer = msg.iBuffer->MmfBuffer(); + OMX_BUFFERHEADERTYPE* bufferHeader = msg.iBuffer->BufferHeader(); + TInt portIndex = static_cast(bufferHeader->nInputPortIndex); + User::LeaveIfError(callback->EmptyBufferDone(buffer, portIndex)); + break; + } + + case EFillBufferCallback: + { + CMMFBuffer* mmfBuffer = msg.iBuffer->MmfBuffer(); + OMX_BUFFERHEADERTYPE* bufferHeader = msg.iBuffer->BufferHeader(); + + if (CMMFBuffer::IsSupportedDataBuffer(mmfBuffer->Type())) + { + CMMFDataBuffer* dataBuffer = static_cast(mmfBuffer); + TDes8& aBufferDes = dataBuffer->Data(); + aBufferDes.SetLength(bufferHeader->nFilledLen); + mmfBuffer->SetLastBuffer(bufferHeader->nFlags & OMX_BUFFERFLAG_EOS); + } + else + { + ASSERT(EFalse); + } + MOmxILComponentIfObserver* callback = msg.iBuffer->PortObserver(); + bufferHeader = msg.iBuffer->BufferHeader(); + TInt portIndex = static_cast(bufferHeader->nOutputPortIndex); + User::LeaveIfError(callback->FillBufferDone(mmfBuffer, portIndex)); + break; + } + case EEventCallback: + { + TInt err = KErrNone; + err = iParent.EventHandler(msg.iEventParams.iEvent, + msg.iEventParams.iData1, + msg.iEventParams.iData2, + msg.iEventParams.iExtraData); + if (err != KErrNone) + { + // Very possible the event is not supported by the IL Client. + // Ignore for now + // ASSERT(EFalse); // Uncomment this line if interested in catching this case on debug mode. + } + break; + } + default: + { + // This is an invalid state + ASSERT(EFalse); + } + }; + } + + // setup for next callbacks + iStatus = KRequestPending; + iMsgQueue.NotifyDataAvailable(iStatus); + SetActive(); + } + +COmxCallbacks::~COmxCallbacks() + { + Cancel(); + iMsgQueue.Close(); + } + + +void COmxCallbacks::DoCancel() + { + if (iMsgQueue.Handle()!=NULL) + { + iMsgQueue.CancelDataAvailable(); + } + } + + +TInt COmxCallbacks::FillBufferDone(OMX_HANDLETYPE aComponent, + COmxBufferManager::COmxBuffer* aBuffer) + { + TOmxMessage message; + message.iType = EFillBufferCallback; + message.iComponent = aComponent; + message.iBuffer = aBuffer; + return iMsgQueue.Send(message); + } + +TInt COmxCallbacks::EmptyBufferDone(OMX_HANDLETYPE aComponent, + COmxBufferManager::COmxBuffer* aBuffer) + { + TOmxMessage message; + message.iType = EEmptyBufferCallback; + message.iComponent = aComponent; + message.iBuffer = aBuffer; + return iMsgQueue.Send(message); + } + +TInt COmxCallbacks::EventHandler(OMX_HANDLETYPE aComponent, + const TEventParams& aEventParams) + { + TOmxMessage message; + message.iType = EEventCallback; + message.iComponent = aComponent; + message.iEventParams = aEventParams; + return iMsgQueue.Send(message); + } + + + +OMX_ERRORTYPE EventHandler(OMX_OUT OMX_HANDLETYPE aComponent, + OMX_OUT TAny* aAppData, + OMX_OUT OMX_EVENTTYPE aEvent, + OMX_OUT TUint32 aData1, + OMX_OUT TUint32 aData2, + OMX_OUT TAny* aExtra) + { + COmxCallbacks::TEventParams eventParams; + eventParams.iEvent = aEvent; + eventParams.iData1 = aData1; + eventParams.iData2 = aData2; + eventParams.iExtraData = aExtra; + TInt error = static_cast(aAppData)->EventHandler(aComponent, eventParams); + return ConvertSymbianErrorType(error); + } + +OMX_ERRORTYPE EmptyBufferDone(OMX_HANDLETYPE aComponent, + TAny* aAppData, + OMX_BUFFERHEADERTYPE* aBuffer) + { + COmxBufferManager::COmxBuffer* buffer = static_cast(aBuffer->pAppPrivate); + TInt error = static_cast(aAppData)->EmptyBufferDone(aComponent, buffer); + return ConvertSymbianErrorType(error); + } + +OMX_ERRORTYPE FillBufferDone(OMX_HANDLETYPE aComponent, + TAny* aAppData, + OMX_BUFFERHEADERTYPE* aBuffer) + { + COmxBufferManager::COmxBuffer* buffer = static_cast(aBuffer->pAppPrivate); + TInt error = static_cast(aAppData)->FillBufferDone(aComponent, buffer); + return ConvertSymbianErrorType(error); + } + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/refomxil/src/omxilgenericilif/omxilgenericportilif.cpp --- a/omxil/mmilapi/refomxil/src/omxilgenericilif/omxilgenericportilif.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/refomxil/src/omxilgenericilif/omxilgenericportilif.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,180 +1,180 @@ -// 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 "omxilgenericportilif.h" - -/** -class COmxILGenericPortILIF -Concrete implementation of the MILComponentPortIf that encapsulates the -component's port specific behaviour according to OpenMAX specification. -*/ -COmxILGenericPortILIF::COmxILGenericPortILIF(COmxILGenericILIF& aParent, - TPortDirection aPortDirection, - TInt aIndex) - : - iPortDirection (aPortDirection), - iPortIndex (aIndex), - iPortComponent(aParent) - { - } - -COmxILGenericPortILIF* COmxILGenericPortILIF::NewL(COmxILGenericILIF& aParent, - TPortDirection aPortDirection, - TInt aIndex) - { - COmxILGenericPortILIF* self = new (ELeave) COmxILGenericPortILIF(aParent, aPortDirection, aIndex); - return self; - } - -TInt COmxILGenericPortILIF::FillThisBuffer(CMMFBuffer& aBuffer) - { - if (iPortDirection == EDirOutput) - { - return iPortComponent.OmxFillThisBuffer(&aBuffer, &iPortComponent); - } - else - { - return KErrCorrupt; - } - } - -TInt COmxILGenericPortILIF::EmptyThisBuffer(const CMMFBuffer& aBuffer) - { - if (iPortDirection == EDirInput) - { - return iPortComponent.OmxEmptyThisBuffer(&aBuffer, &iPortComponent); - } - else - { - return KErrCorrupt; - } - } - -TInt COmxILGenericPortILIF::TunnelRequest(MILComponentPortIf* aPort) - { - TInt error = KErrNotSupported; - - if (aPort) - // This is the connet tunnel request - { - TPortDirection otherPortDir = aPort->PortDirection(); - COmxILGenericILIF* otherPortComponent = static_cast(aPort->PortComponent()); - - if (iPortDirection != otherPortDir) - { - if (iPortDirection == EDirInput) - { - error = iPortComponent.OmxComponentTunnelRequest(iPortIndex, - otherPortComponent->OmxHandle(), - aPort->PortIndex()); - - } - else - { - error = otherPortComponent->OmxComponentTunnelRequest(aPort->PortIndex(), - iPortComponent.OmxHandle(), - iPortIndex); - } - - if (error == KErrNone) - { - iTunneledPort = static_cast(aPort); - iTunneledPort->SetPortConnectedTo(this); - } - } - } - else - // This is the disconnet tunnel request - { - TPortDirection otherPortDir = iTunneledPort->PortDirection(); - COmxILGenericILIF* otherPortComponent = static_cast (iTunneledPort->PortComponent()); - - if (iPortDirection != otherPortDir) - { - if (iPortDirection == EDirInput) - { - error = iPortComponent.OmxComponentDisconnectTunnel(iPortIndex, - otherPortComponent->OmxHandle(), - iTunneledPort->PortIndex()); - } - else - { - error = otherPortComponent->OmxComponentDisconnectTunnel(iTunneledPort->PortIndex(), - iPortComponent.OmxHandle(), - iPortIndex); - } - - if (error == KErrNone) - { - iTunneledPort->SetPortConnectedTo(NULL); - iTunneledPort = NULL; - } - } - } - - return error; - } - -TInt COmxILGenericPortILIF::PortIndex() const - { - return iPortIndex; - } - -TPortDirection COmxILGenericPortILIF::PortDirection() const - { - return iPortDirection; - } - -CMMFBuffer* COmxILGenericPortILIF::CreateBufferL(TInt aBufferSize) - { - return iPortComponent.OmxAllocateBufferL(iPortIndex, aBufferSize); - } - -TInt COmxILGenericPortILIF::UseBuffer(CMMFBuffer& aBuffer) - { - return iPortComponent.OmxUseBuffer(&aBuffer, iPortIndex); - } - -TInt COmxILGenericPortILIF::FreeBuffer(CMMFBuffer* aBuffer) - { - return iPortComponent.OmxFreeBuffer(aBuffer); - } - -TInt COmxILGenericPortILIF::FlushPort() - { - return iPortComponent.OmxSendCommand(OMX_CommandFlush, iPortIndex, NULL); - } - -TInt COmxILGenericPortILIF::EnablePort() - { - return iPortComponent.OmxSendCommand(OMX_CommandPortEnable, iPortIndex, NULL); - } - -TInt COmxILGenericPortILIF::DisablePort() - { - return iPortComponent.OmxSendCommand(OMX_CommandPortDisable, iPortIndex, NULL); - } - -MILComponentIf* COmxILGenericPortILIF::PortComponent() const - { - return &iPortComponent; - } - -void COmxILGenericPortILIF::SetPortConnectedTo(COmxILGenericPortILIF* aPort) - { - iTunneledPort = aPort; - } - - +// 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 "omxilgenericportilif.h" + +/** +class COmxILGenericPortILIF +Concrete implementation of the MILComponentPortIf that encapsulates the +component's port specific behaviour according to OpenMAX specification. +*/ +COmxILGenericPortILIF::COmxILGenericPortILIF(COmxILGenericILIF& aParent, + TPortDirection aPortDirection, + TInt aIndex) + : + iPortDirection (aPortDirection), + iPortIndex (aIndex), + iPortComponent(aParent) + { + } + +COmxILGenericPortILIF* COmxILGenericPortILIF::NewL(COmxILGenericILIF& aParent, + TPortDirection aPortDirection, + TInt aIndex) + { + COmxILGenericPortILIF* self = new (ELeave) COmxILGenericPortILIF(aParent, aPortDirection, aIndex); + return self; + } + +TInt COmxILGenericPortILIF::FillThisBuffer(CMMFBuffer& aBuffer) + { + if (iPortDirection == EDirOutput) + { + return iPortComponent.OmxFillThisBuffer(&aBuffer, &iPortComponent); + } + else + { + return KErrCorrupt; + } + } + +TInt COmxILGenericPortILIF::EmptyThisBuffer(const CMMFBuffer& aBuffer) + { + if (iPortDirection == EDirInput) + { + return iPortComponent.OmxEmptyThisBuffer(&aBuffer, &iPortComponent); + } + else + { + return KErrCorrupt; + } + } + +TInt COmxILGenericPortILIF::TunnelRequest(MILComponentPortIf* aPort) + { + TInt error = KErrNotSupported; + + if (aPort) + // This is the connet tunnel request + { + TPortDirection otherPortDir = aPort->PortDirection(); + COmxILGenericILIF* otherPortComponent = static_cast(aPort->PortComponent()); + + if (iPortDirection != otherPortDir) + { + if (iPortDirection == EDirInput) + { + error = iPortComponent.OmxComponentTunnelRequest(iPortIndex, + otherPortComponent->OmxHandle(), + aPort->PortIndex()); + + } + else + { + error = otherPortComponent->OmxComponentTunnelRequest(aPort->PortIndex(), + iPortComponent.OmxHandle(), + iPortIndex); + } + + if (error == KErrNone) + { + iTunneledPort = static_cast(aPort); + iTunneledPort->SetPortConnectedTo(this); + } + } + } + else + // This is the disconnet tunnel request + { + TPortDirection otherPortDir = iTunneledPort->PortDirection(); + COmxILGenericILIF* otherPortComponent = static_cast (iTunneledPort->PortComponent()); + + if (iPortDirection != otherPortDir) + { + if (iPortDirection == EDirInput) + { + error = iPortComponent.OmxComponentDisconnectTunnel(iPortIndex, + otherPortComponent->OmxHandle(), + iTunneledPort->PortIndex()); + } + else + { + error = otherPortComponent->OmxComponentDisconnectTunnel(iTunneledPort->PortIndex(), + iPortComponent.OmxHandle(), + iPortIndex); + } + + if (error == KErrNone) + { + iTunneledPort->SetPortConnectedTo(NULL); + iTunneledPort = NULL; + } + } + } + + return error; + } + +TInt COmxILGenericPortILIF::PortIndex() const + { + return iPortIndex; + } + +TPortDirection COmxILGenericPortILIF::PortDirection() const + { + return iPortDirection; + } + +CMMFBuffer* COmxILGenericPortILIF::CreateBufferL(TInt aBufferSize) + { + return iPortComponent.OmxAllocateBufferL(iPortIndex, aBufferSize); + } + +TInt COmxILGenericPortILIF::UseBuffer(CMMFBuffer& aBuffer) + { + return iPortComponent.OmxUseBuffer(&aBuffer, iPortIndex); + } + +TInt COmxILGenericPortILIF::FreeBuffer(CMMFBuffer* aBuffer) + { + return iPortComponent.OmxFreeBuffer(aBuffer); + } + +TInt COmxILGenericPortILIF::FlushPort() + { + return iPortComponent.OmxSendCommand(OMX_CommandFlush, iPortIndex, NULL); + } + +TInt COmxILGenericPortILIF::EnablePort() + { + return iPortComponent.OmxSendCommand(OMX_CommandPortEnable, iPortIndex, NULL); + } + +TInt COmxILGenericPortILIF::DisablePort() + { + return iPortComponent.OmxSendCommand(OMX_CommandPortDisable, iPortIndex, NULL); + } + +MILComponentIf* COmxILGenericPortILIF::PortComponent() const + { + return &iPortComponent; + } + +void COmxILGenericPortILIF::SetPortConnectedTo(COmxILGenericPortILIF* aPort) + { + iTunneledPort = aPort; + } + + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/unittest/bwins/omxildummybaseilif.def --- a/omxil/mmilapi/unittest/bwins/omxildummybaseilif.def Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/unittest/bwins/omxildummybaseilif.def Fri May 07 16:25:23 2010 +0100 @@ -1,36 +1,36 @@ -EXPORTS - ??0COmxILDummyBaseILIF@@IAE@XZ @ 1 NONAME ; COmxILDummyBaseILIF::COmxILDummyBaseILIF(void) - ??1COmxILDummyBaseILIF@@UAE@XZ @ 2 NONAME ; COmxILDummyBaseILIF::~COmxILDummyBaseILIF(void) - ?ComponentRoleEnum@COmxILDummyBaseILIF@@UBEHAAVTPtr8@@K@Z @ 3 NONAME ; int COmxILDummyBaseILIF::ComponentRoleEnum(class TPtr8 &, unsigned long) const - ?CreateComponentL@COmxILDummyBaseILIF@@UAEXABVTDesC8@@AAVMILIfObserver@@@Z @ 4 NONAME ; void COmxILDummyBaseILIF::CreateComponentL(class TDesC8 const &, class MILIfObserver &) - ?CreateComponentL@COmxILDummyBaseILIF@@UAEXABVTUid@@AAVMILIfObserver@@@Z @ 5 NONAME ; void COmxILDummyBaseILIF::CreateComponentL(class TUid const &, class MILIfObserver &) - ?CustomInterface@COmxILDummyBaseILIF@@UAEPAXVTUid@@@Z @ 6 NONAME ; void * COmxILDummyBaseILIF::CustomInterface(class TUid) - ?EmptyBufferDone@COmxILDummyBaseILIF@@UAEHPBVCMMFBuffer@@H@Z @ 7 NONAME ; int COmxILDummyBaseILIF::EmptyBufferDone(class CMMFBuffer const *, int) - ?EventHandler@COmxILDummyBaseILIF@@UAEHW4OMX_EVENTTYPE@@KKPAX@Z @ 8 NONAME ; int COmxILDummyBaseILIF::EventHandler(enum OMX_EVENTTYPE, unsigned long, unsigned long, void *) - ?Execute@COmxILDummyBaseILIF@@UAEHXZ @ 9 NONAME ; int COmxILDummyBaseILIF::Execute(void) - ?FillBufferDone@COmxILDummyBaseILIF@@UAEHPAVCMMFBuffer@@H@Z @ 10 NONAME ; int COmxILDummyBaseILIF::FillBufferDone(class CMMFBuffer *, int) - ?FlushAllPorts@COmxILDummyBaseILIF@@UAEHXZ @ 11 NONAME ; int COmxILDummyBaseILIF::FlushAllPorts(void) - ?GetComponentIfRole@COmxILDummyBaseILIF@@UBEHAAVTDes8@@@Z @ 12 NONAME ; int COmxILDummyBaseILIF::GetComponentIfRole(class TDes8 &) const - ?GetComponentIfRole@COmxILDummyBaseILIF@@UBEHAAVTUid@@@Z @ 13 NONAME ; int COmxILDummyBaseILIF::GetComponentIfRole(class TUid &) const - ?GetComponentInputPorts@COmxILDummyBaseILIF@@UBEHAAV?$RPointerArray@VMILComponentPortIf@@@@@Z @ 14 NONAME ; int COmxILDummyBaseILIF::GetComponentInputPorts(class RPointerArray &) const - ?GetComponentOutputPorts@COmxILDummyBaseILIF@@UBEHAAV?$RPointerArray@VMILComponentPortIf@@@@@Z @ 15 NONAME ; int COmxILDummyBaseILIF::GetComponentOutputPorts(class RPointerArray &) const - ?GetComponentVersion@COmxILDummyBaseILIF@@UBEHAAVTILComponentVersion@@@Z @ 16 NONAME ; int COmxILDummyBaseILIF::GetComponentVersion(class TILComponentVersion &) const - ?GetConfig@COmxILDummyBaseILIF@@UBEHAAVTILStruct@@PBVMILComponentPortIf@@@Z @ 17 NONAME ; int COmxILDummyBaseILIF::GetConfig(class TILStruct &, class MILComponentPortIf const *) const - ?GetExtConfig@COmxILDummyBaseILIF@@UBEHABVTDesC8@@AAVTILStruct@@PBVMILComponentPortIf@@@Z @ 18 NONAME ; int COmxILDummyBaseILIF::GetExtConfig(class TDesC8 const &, class TILStruct &, class MILComponentPortIf const *) const - ?GetState@COmxILDummyBaseILIF@@UBEHAAW4TILComponentState@@@Z @ 19 NONAME ; int COmxILDummyBaseILIF::GetState(enum TILComponentState &) const - ?Initialize@COmxILDummyBaseILIF@@UAEHXZ @ 20 NONAME ; int COmxILDummyBaseILIF::Initialize(void) - ?OmxGetConfig@COmxILDummyBaseILIF@@IBEHW4OMX_INDEXTYPE@@PAX@Z @ 21 NONAME ; int COmxILDummyBaseILIF::OmxGetConfig(enum OMX_INDEXTYPE, void *) const - ?OmxGetExtensionIndex@COmxILDummyBaseILIF@@IBEHABVTDesC8@@PAW4OMX_INDEXTYPE@@@Z @ 22 NONAME ; int COmxILDummyBaseILIF::OmxGetExtensionIndex(class TDesC8 const &, enum OMX_INDEXTYPE *) const - ?OmxGetParameter@COmxILDummyBaseILIF@@IBEHW4OMX_INDEXTYPE@@PAX@Z @ 23 NONAME ; int COmxILDummyBaseILIF::OmxGetParameter(enum OMX_INDEXTYPE, void *) const - ?OmxSetConfig@COmxILDummyBaseILIF@@IAEHW4OMX_INDEXTYPE@@PAX@Z @ 24 NONAME ; int COmxILDummyBaseILIF::OmxSetConfig(enum OMX_INDEXTYPE, void *) - ?OmxSetParameter@COmxILDummyBaseILIF@@IAEHW4OMX_INDEXTYPE@@PAX@Z @ 25 NONAME ; int COmxILDummyBaseILIF::OmxSetParameter(enum OMX_INDEXTYPE, void *) - ?Pause@COmxILDummyBaseILIF@@UAEHXZ @ 26 NONAME ; int COmxILDummyBaseILIF::Pause(void) - ?ReleaseComponent@COmxILDummyBaseILIF@@UAEXXZ @ 27 NONAME ; void COmxILDummyBaseILIF::ReleaseComponent(void) - ?SendCommand@COmxILDummyBaseILIF@@UAEHABVTILCommand@@@Z @ 28 NONAME ; int COmxILDummyBaseILIF::SendCommand(class TILCommand const &) - ?SetComponentIfRole@COmxILDummyBaseILIF@@UAEHABVTDesC8@@@Z @ 29 NONAME ; int COmxILDummyBaseILIF::SetComponentIfRole(class TDesC8 const &) - ?SetComponentIfRole@COmxILDummyBaseILIF@@UAEHABVTUid@@@Z @ 30 NONAME ; int COmxILDummyBaseILIF::SetComponentIfRole(class TUid const &) - ?SetConfig@COmxILDummyBaseILIF@@UAEHABVTILStruct@@PBVMILComponentPortIf@@@Z @ 31 NONAME ; int COmxILDummyBaseILIF::SetConfig(class TILStruct const &, class MILComponentPortIf const *) - ?SetExtConfig@COmxILDummyBaseILIF@@UAEHABVTDesC8@@ABVTILStruct@@PBVMILComponentPortIf@@@Z @ 32 NONAME ; int COmxILDummyBaseILIF::SetExtConfig(class TDesC8 const &, class TILStruct const &, class MILComponentPortIf const *) - ?Stop@COmxILDummyBaseILIF@@UAEHXZ @ 33 NONAME ; int COmxILDummyBaseILIF::Stop(void) - ?UnInitialize@COmxILDummyBaseILIF@@UAEHXZ @ 34 NONAME ; int COmxILDummyBaseILIF::UnInitialize(void) - +EXPORTS + ??0COmxILDummyBaseILIF@@IAE@XZ @ 1 NONAME ; COmxILDummyBaseILIF::COmxILDummyBaseILIF(void) + ??1COmxILDummyBaseILIF@@UAE@XZ @ 2 NONAME ; COmxILDummyBaseILIF::~COmxILDummyBaseILIF(void) + ?ComponentRoleEnum@COmxILDummyBaseILIF@@UBEHAAVTPtr8@@K@Z @ 3 NONAME ; int COmxILDummyBaseILIF::ComponentRoleEnum(class TPtr8 &, unsigned long) const + ?CreateComponentL@COmxILDummyBaseILIF@@UAEXABVTDesC8@@AAVMILIfObserver@@@Z @ 4 NONAME ; void COmxILDummyBaseILIF::CreateComponentL(class TDesC8 const &, class MILIfObserver &) + ?CreateComponentL@COmxILDummyBaseILIF@@UAEXABVTUid@@AAVMILIfObserver@@@Z @ 5 NONAME ; void COmxILDummyBaseILIF::CreateComponentL(class TUid const &, class MILIfObserver &) + ?CustomInterface@COmxILDummyBaseILIF@@UAEPAXVTUid@@@Z @ 6 NONAME ; void * COmxILDummyBaseILIF::CustomInterface(class TUid) + ?EmptyBufferDone@COmxILDummyBaseILIF@@UAEHPBVCMMFBuffer@@H@Z @ 7 NONAME ; int COmxILDummyBaseILIF::EmptyBufferDone(class CMMFBuffer const *, int) + ?EventHandler@COmxILDummyBaseILIF@@UAEHW4OMX_EVENTTYPE@@KKPAX@Z @ 8 NONAME ; int COmxILDummyBaseILIF::EventHandler(enum OMX_EVENTTYPE, unsigned long, unsigned long, void *) + ?Execute@COmxILDummyBaseILIF@@UAEHXZ @ 9 NONAME ; int COmxILDummyBaseILIF::Execute(void) + ?FillBufferDone@COmxILDummyBaseILIF@@UAEHPAVCMMFBuffer@@H@Z @ 10 NONAME ; int COmxILDummyBaseILIF::FillBufferDone(class CMMFBuffer *, int) + ?FlushAllPorts@COmxILDummyBaseILIF@@UAEHXZ @ 11 NONAME ; int COmxILDummyBaseILIF::FlushAllPorts(void) + ?GetComponentIfRole@COmxILDummyBaseILIF@@UBEHAAVTDes8@@@Z @ 12 NONAME ; int COmxILDummyBaseILIF::GetComponentIfRole(class TDes8 &) const + ?GetComponentIfRole@COmxILDummyBaseILIF@@UBEHAAVTUid@@@Z @ 13 NONAME ; int COmxILDummyBaseILIF::GetComponentIfRole(class TUid &) const + ?GetComponentInputPorts@COmxILDummyBaseILIF@@UBEHAAV?$RPointerArray@VMILComponentPortIf@@@@@Z @ 14 NONAME ; int COmxILDummyBaseILIF::GetComponentInputPorts(class RPointerArray &) const + ?GetComponentOutputPorts@COmxILDummyBaseILIF@@UBEHAAV?$RPointerArray@VMILComponentPortIf@@@@@Z @ 15 NONAME ; int COmxILDummyBaseILIF::GetComponentOutputPorts(class RPointerArray &) const + ?GetComponentVersion@COmxILDummyBaseILIF@@UBEHAAVTILComponentVersion@@@Z @ 16 NONAME ; int COmxILDummyBaseILIF::GetComponentVersion(class TILComponentVersion &) const + ?GetConfig@COmxILDummyBaseILIF@@UBEHAAVTILStruct@@PBVMILComponentPortIf@@@Z @ 17 NONAME ; int COmxILDummyBaseILIF::GetConfig(class TILStruct &, class MILComponentPortIf const *) const + ?GetExtConfig@COmxILDummyBaseILIF@@UBEHABVTDesC8@@AAVTILStruct@@PBVMILComponentPortIf@@@Z @ 18 NONAME ; int COmxILDummyBaseILIF::GetExtConfig(class TDesC8 const &, class TILStruct &, class MILComponentPortIf const *) const + ?GetState@COmxILDummyBaseILIF@@UBEHAAW4TILComponentState@@@Z @ 19 NONAME ; int COmxILDummyBaseILIF::GetState(enum TILComponentState &) const + ?Initialize@COmxILDummyBaseILIF@@UAEHXZ @ 20 NONAME ; int COmxILDummyBaseILIF::Initialize(void) + ?OmxGetConfig@COmxILDummyBaseILIF@@IBEHW4OMX_INDEXTYPE@@PAX@Z @ 21 NONAME ; int COmxILDummyBaseILIF::OmxGetConfig(enum OMX_INDEXTYPE, void *) const + ?OmxGetExtensionIndex@COmxILDummyBaseILIF@@IBEHABVTDesC8@@PAW4OMX_INDEXTYPE@@@Z @ 22 NONAME ; int COmxILDummyBaseILIF::OmxGetExtensionIndex(class TDesC8 const &, enum OMX_INDEXTYPE *) const + ?OmxGetParameter@COmxILDummyBaseILIF@@IBEHW4OMX_INDEXTYPE@@PAX@Z @ 23 NONAME ; int COmxILDummyBaseILIF::OmxGetParameter(enum OMX_INDEXTYPE, void *) const + ?OmxSetConfig@COmxILDummyBaseILIF@@IAEHW4OMX_INDEXTYPE@@PAX@Z @ 24 NONAME ; int COmxILDummyBaseILIF::OmxSetConfig(enum OMX_INDEXTYPE, void *) + ?OmxSetParameter@COmxILDummyBaseILIF@@IAEHW4OMX_INDEXTYPE@@PAX@Z @ 25 NONAME ; int COmxILDummyBaseILIF::OmxSetParameter(enum OMX_INDEXTYPE, void *) + ?Pause@COmxILDummyBaseILIF@@UAEHXZ @ 26 NONAME ; int COmxILDummyBaseILIF::Pause(void) + ?ReleaseComponent@COmxILDummyBaseILIF@@UAEXXZ @ 27 NONAME ; void COmxILDummyBaseILIF::ReleaseComponent(void) + ?SendCommand@COmxILDummyBaseILIF@@UAEHABVTILCommand@@@Z @ 28 NONAME ; int COmxILDummyBaseILIF::SendCommand(class TILCommand const &) + ?SetComponentIfRole@COmxILDummyBaseILIF@@UAEHABVTDesC8@@@Z @ 29 NONAME ; int COmxILDummyBaseILIF::SetComponentIfRole(class TDesC8 const &) + ?SetComponentIfRole@COmxILDummyBaseILIF@@UAEHABVTUid@@@Z @ 30 NONAME ; int COmxILDummyBaseILIF::SetComponentIfRole(class TUid const &) + ?SetConfig@COmxILDummyBaseILIF@@UAEHABVTILStruct@@PBVMILComponentPortIf@@@Z @ 31 NONAME ; int COmxILDummyBaseILIF::SetConfig(class TILStruct const &, class MILComponentPortIf const *) + ?SetExtConfig@COmxILDummyBaseILIF@@UAEHABVTDesC8@@ABVTILStruct@@PBVMILComponentPortIf@@@Z @ 32 NONAME ; int COmxILDummyBaseILIF::SetExtConfig(class TDesC8 const &, class TILStruct const &, class MILComponentPortIf const *) + ?Stop@COmxILDummyBaseILIF@@UAEHXZ @ 33 NONAME ; int COmxILDummyBaseILIF::Stop(void) + ?UnInitialize@COmxILDummyBaseILIF@@UAEHXZ @ 34 NONAME ; int COmxILDummyBaseILIF::UnInitialize(void) + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/unittest/bwins/tsu_milif_omxilif.def --- a/omxil/mmilapi/unittest/bwins/tsu_milif_omxilif.def Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/unittest/bwins/tsu_milif_omxilif.def Fri May 07 16:25:23 2010 +0100 @@ -1,3 +1,3 @@ -EXPORTS - ?NewTestSuiteL@CTestSuiteMILIF@@SAPAV1@XZ @ 1 NONAME ; class CTestSuiteMILIF * CTestSuiteMILIF::NewTestSuiteL(void) - +EXPORTS + ?NewTestSuiteL@CTestSuiteMILIF@@SAPAV1@XZ @ 1 NONAME ; class CTestSuiteMILIF * CTestSuiteMILIF::NewTestSuiteL(void) + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/unittest/eabi/omxildummybaseilif.def --- a/omxil/mmilapi/unittest/eabi/omxildummybaseilif.def Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/unittest/eabi/omxildummybaseilif.def Fri May 07 16:25:23 2010 +0100 @@ -1,78 +1,78 @@ -EXPORTS - _ZN19COmxILDummyBaseILIF10InitializeEv @ 1 NONAME - _ZN19COmxILDummyBaseILIF11SendCommandERK10TILCommand @ 2 NONAME - _ZN19COmxILDummyBaseILIF12EventHandlerE13OMX_EVENTTYPEmmPv @ 3 NONAME - _ZN19COmxILDummyBaseILIF12OmxSetConfigE13OMX_INDEXTYPEPv @ 4 NONAME - _ZN19COmxILDummyBaseILIF12SetExtConfigERK6TDesC8RK9TILStructPK18MILComponentPortIf @ 5 NONAME - _ZN19COmxILDummyBaseILIF12UnInitializeEv @ 6 NONAME - _ZN19COmxILDummyBaseILIF13FlushAllPortsEv @ 7 NONAME - _ZN19COmxILDummyBaseILIF14FillBufferDoneEP10CMMFBufferi @ 8 NONAME - _ZN19COmxILDummyBaseILIF15CustomInterfaceE4TUid @ 9 NONAME - _ZN19COmxILDummyBaseILIF15EmptyBufferDoneEPK10CMMFBufferi @ 10 NONAME - _ZN19COmxILDummyBaseILIF15OmxSetParameterE13OMX_INDEXTYPEPv @ 11 NONAME - _ZN19COmxILDummyBaseILIF16CreateComponentLERK4TUidR13MILIfObserver @ 12 NONAME - _ZN19COmxILDummyBaseILIF16CreateComponentLERK6TDesC8R13MILIfObserver @ 13 NONAME - _ZN19COmxILDummyBaseILIF16ReleaseComponentEv @ 14 NONAME - _ZN19COmxILDummyBaseILIF18SetComponentIfRoleERK4TUid @ 15 NONAME - _ZN19COmxILDummyBaseILIF18SetComponentIfRoleERK6TDesC8 @ 16 NONAME - _ZN19COmxILDummyBaseILIF4StopEv @ 17 NONAME - _ZN19COmxILDummyBaseILIF5PauseEv @ 18 NONAME - _ZN19COmxILDummyBaseILIF7ExecuteEv @ 19 NONAME - _ZN19COmxILDummyBaseILIF9SetConfigERK9TILStructPK18MILComponentPortIf @ 20 NONAME - _ZN19COmxILDummyBaseILIFC1Ev @ 21 NONAME - _ZN19COmxILDummyBaseILIFC2Ev @ 22 NONAME - _ZN19COmxILDummyBaseILIFD0Ev @ 23 NONAME - _ZN19COmxILDummyBaseILIFD1Ev @ 24 NONAME - _ZN19COmxILDummyBaseILIFD2Ev @ 25 NONAME - _ZNK19COmxILDummyBaseILIF12GetExtConfigERK6TDesC8R9TILStructPK18MILComponentPortIf @ 26 NONAME - _ZNK19COmxILDummyBaseILIF12OmxGetConfigE13OMX_INDEXTYPEPv @ 27 NONAME - _ZNK19COmxILDummyBaseILIF15OmxGetParameterE13OMX_INDEXTYPEPv @ 28 NONAME - _ZNK19COmxILDummyBaseILIF17ComponentRoleEnumER5TPtr8m @ 29 NONAME - _ZNK19COmxILDummyBaseILIF18GetComponentIfRoleER4TUid @ 30 NONAME - _ZNK19COmxILDummyBaseILIF18GetComponentIfRoleER5TDes8 @ 31 NONAME - _ZNK19COmxILDummyBaseILIF19GetComponentVersionER19TILComponentVersion @ 32 NONAME - _ZNK19COmxILDummyBaseILIF20OmxGetExtensionIndexERK6TDesC8P13OMX_INDEXTYPE @ 33 NONAME - _ZNK19COmxILDummyBaseILIF22GetComponentInputPortsER13RPointerArrayI18MILComponentPortIfE @ 34 NONAME - _ZNK19COmxILDummyBaseILIF23GetComponentOutputPortsER13RPointerArrayI18MILComponentPortIfE @ 35 NONAME - _ZNK19COmxILDummyBaseILIF8GetStateER17TILComponentState @ 36 NONAME - _ZNK19COmxILDummyBaseILIF9GetConfigER9TILStructPK18MILComponentPortIf @ 37 NONAME - _ZTI13COmxCallbacks @ 38 NONAME - _ZTI17COmxBufferManager @ 39 NONAME - _ZTI19COmxILDummyBaseILIF @ 40 NONAME - _ZTI23COmxILDummyBasePortILIF @ 41 NONAME - _ZTIN17COmxBufferManager10COmxBufferE @ 42 NONAME - _ZTIN19COmxILDummyBaseILIF5CBodyE @ 43 NONAME - _ZTV13COmxCallbacks @ 44 NONAME - _ZTV17COmxBufferManager @ 45 NONAME - _ZTV19COmxILDummyBaseILIF @ 46 NONAME - _ZTV23COmxILDummyBasePortILIF @ 47 NONAME - _ZTVN17COmxBufferManager10COmxBufferE @ 48 NONAME - _ZTVN19COmxILDummyBaseILIF5CBodyE @ 49 NONAME - _ZThn12_N19COmxILDummyBaseILIF12EventHandlerE13OMX_EVENTTYPEmmPv @ 50 NONAME - _ZThn12_N19COmxILDummyBaseILIF14FillBufferDoneEP10CMMFBufferi @ 51 NONAME - _ZThn12_N19COmxILDummyBaseILIF15EmptyBufferDoneEPK10CMMFBufferi @ 52 NONAME - _ZThn4_N19COmxILDummyBaseILIF10InitializeEv @ 53 NONAME - _ZThn4_N19COmxILDummyBaseILIF11SendCommandERK10TILCommand @ 54 NONAME - _ZThn4_N19COmxILDummyBaseILIF12SetExtConfigERK6TDesC8RK9TILStructPK18MILComponentPortIf @ 55 NONAME - _ZThn4_N19COmxILDummyBaseILIF12UnInitializeEv @ 56 NONAME - _ZThn4_N19COmxILDummyBaseILIF13FlushAllPortsEv @ 57 NONAME - _ZThn4_N19COmxILDummyBaseILIF15CustomInterfaceE4TUid @ 58 NONAME - _ZThn4_N19COmxILDummyBaseILIF16CreateComponentLERK4TUidR13MILIfObserver @ 59 NONAME - _ZThn4_N19COmxILDummyBaseILIF16CreateComponentLERK6TDesC8R13MILIfObserver @ 60 NONAME - _ZThn4_N19COmxILDummyBaseILIF16ReleaseComponentEv @ 61 NONAME - _ZThn4_N19COmxILDummyBaseILIF18SetComponentIfRoleERK4TUid @ 62 NONAME - _ZThn4_N19COmxILDummyBaseILIF18SetComponentIfRoleERK6TDesC8 @ 63 NONAME - _ZThn4_N19COmxILDummyBaseILIF4StopEv @ 64 NONAME - _ZThn4_N19COmxILDummyBaseILIF5PauseEv @ 65 NONAME - _ZThn4_N19COmxILDummyBaseILIF7ExecuteEv @ 66 NONAME - _ZThn4_N19COmxILDummyBaseILIF9SetConfigERK9TILStructPK18MILComponentPortIf @ 67 NONAME - _ZThn4_NK19COmxILDummyBaseILIF12GetExtConfigERK6TDesC8R9TILStructPK18MILComponentPortIf @ 68 NONAME - _ZThn4_NK19COmxILDummyBaseILIF17ComponentRoleEnumER5TPtr8m @ 69 NONAME - _ZThn4_NK19COmxILDummyBaseILIF18GetComponentIfRoleER4TUid @ 70 NONAME - _ZThn4_NK19COmxILDummyBaseILIF18GetComponentIfRoleER5TDes8 @ 71 NONAME - _ZThn4_NK19COmxILDummyBaseILIF19GetComponentVersionER19TILComponentVersion @ 72 NONAME - _ZThn4_NK19COmxILDummyBaseILIF22GetComponentInputPortsER13RPointerArrayI18MILComponentPortIfE @ 73 NONAME - _ZThn4_NK19COmxILDummyBaseILIF23GetComponentOutputPortsER13RPointerArrayI18MILComponentPortIfE @ 74 NONAME - _ZThn4_NK19COmxILDummyBaseILIF8GetStateER17TILComponentState @ 75 NONAME - _ZThn4_NK19COmxILDummyBaseILIF9GetConfigER9TILStructPK18MILComponentPortIf @ 76 NONAME - +EXPORTS + _ZN19COmxILDummyBaseILIF10InitializeEv @ 1 NONAME + _ZN19COmxILDummyBaseILIF11SendCommandERK10TILCommand @ 2 NONAME + _ZN19COmxILDummyBaseILIF12EventHandlerE13OMX_EVENTTYPEmmPv @ 3 NONAME + _ZN19COmxILDummyBaseILIF12OmxSetConfigE13OMX_INDEXTYPEPv @ 4 NONAME + _ZN19COmxILDummyBaseILIF12SetExtConfigERK6TDesC8RK9TILStructPK18MILComponentPortIf @ 5 NONAME + _ZN19COmxILDummyBaseILIF12UnInitializeEv @ 6 NONAME + _ZN19COmxILDummyBaseILIF13FlushAllPortsEv @ 7 NONAME + _ZN19COmxILDummyBaseILIF14FillBufferDoneEP10CMMFBufferi @ 8 NONAME + _ZN19COmxILDummyBaseILIF15CustomInterfaceE4TUid @ 9 NONAME + _ZN19COmxILDummyBaseILIF15EmptyBufferDoneEPK10CMMFBufferi @ 10 NONAME + _ZN19COmxILDummyBaseILIF15OmxSetParameterE13OMX_INDEXTYPEPv @ 11 NONAME + _ZN19COmxILDummyBaseILIF16CreateComponentLERK4TUidR13MILIfObserver @ 12 NONAME + _ZN19COmxILDummyBaseILIF16CreateComponentLERK6TDesC8R13MILIfObserver @ 13 NONAME + _ZN19COmxILDummyBaseILIF16ReleaseComponentEv @ 14 NONAME + _ZN19COmxILDummyBaseILIF18SetComponentIfRoleERK4TUid @ 15 NONAME + _ZN19COmxILDummyBaseILIF18SetComponentIfRoleERK6TDesC8 @ 16 NONAME + _ZN19COmxILDummyBaseILIF4StopEv @ 17 NONAME + _ZN19COmxILDummyBaseILIF5PauseEv @ 18 NONAME + _ZN19COmxILDummyBaseILIF7ExecuteEv @ 19 NONAME + _ZN19COmxILDummyBaseILIF9SetConfigERK9TILStructPK18MILComponentPortIf @ 20 NONAME + _ZN19COmxILDummyBaseILIFC1Ev @ 21 NONAME + _ZN19COmxILDummyBaseILIFC2Ev @ 22 NONAME + _ZN19COmxILDummyBaseILIFD0Ev @ 23 NONAME + _ZN19COmxILDummyBaseILIFD1Ev @ 24 NONAME + _ZN19COmxILDummyBaseILIFD2Ev @ 25 NONAME + _ZNK19COmxILDummyBaseILIF12GetExtConfigERK6TDesC8R9TILStructPK18MILComponentPortIf @ 26 NONAME + _ZNK19COmxILDummyBaseILIF12OmxGetConfigE13OMX_INDEXTYPEPv @ 27 NONAME + _ZNK19COmxILDummyBaseILIF15OmxGetParameterE13OMX_INDEXTYPEPv @ 28 NONAME + _ZNK19COmxILDummyBaseILIF17ComponentRoleEnumER5TPtr8m @ 29 NONAME + _ZNK19COmxILDummyBaseILIF18GetComponentIfRoleER4TUid @ 30 NONAME + _ZNK19COmxILDummyBaseILIF18GetComponentIfRoleER5TDes8 @ 31 NONAME + _ZNK19COmxILDummyBaseILIF19GetComponentVersionER19TILComponentVersion @ 32 NONAME + _ZNK19COmxILDummyBaseILIF20OmxGetExtensionIndexERK6TDesC8P13OMX_INDEXTYPE @ 33 NONAME + _ZNK19COmxILDummyBaseILIF22GetComponentInputPortsER13RPointerArrayI18MILComponentPortIfE @ 34 NONAME + _ZNK19COmxILDummyBaseILIF23GetComponentOutputPortsER13RPointerArrayI18MILComponentPortIfE @ 35 NONAME + _ZNK19COmxILDummyBaseILIF8GetStateER17TILComponentState @ 36 NONAME + _ZNK19COmxILDummyBaseILIF9GetConfigER9TILStructPK18MILComponentPortIf @ 37 NONAME + _ZTI13COmxCallbacks @ 38 NONAME + _ZTI17COmxBufferManager @ 39 NONAME + _ZTI19COmxILDummyBaseILIF @ 40 NONAME + _ZTI23COmxILDummyBasePortILIF @ 41 NONAME + _ZTIN17COmxBufferManager10COmxBufferE @ 42 NONAME + _ZTIN19COmxILDummyBaseILIF5CBodyE @ 43 NONAME + _ZTV13COmxCallbacks @ 44 NONAME + _ZTV17COmxBufferManager @ 45 NONAME + _ZTV19COmxILDummyBaseILIF @ 46 NONAME + _ZTV23COmxILDummyBasePortILIF @ 47 NONAME + _ZTVN17COmxBufferManager10COmxBufferE @ 48 NONAME + _ZTVN19COmxILDummyBaseILIF5CBodyE @ 49 NONAME + _ZThn12_N19COmxILDummyBaseILIF12EventHandlerE13OMX_EVENTTYPEmmPv @ 50 NONAME + _ZThn12_N19COmxILDummyBaseILIF14FillBufferDoneEP10CMMFBufferi @ 51 NONAME + _ZThn12_N19COmxILDummyBaseILIF15EmptyBufferDoneEPK10CMMFBufferi @ 52 NONAME + _ZThn4_N19COmxILDummyBaseILIF10InitializeEv @ 53 NONAME + _ZThn4_N19COmxILDummyBaseILIF11SendCommandERK10TILCommand @ 54 NONAME + _ZThn4_N19COmxILDummyBaseILIF12SetExtConfigERK6TDesC8RK9TILStructPK18MILComponentPortIf @ 55 NONAME + _ZThn4_N19COmxILDummyBaseILIF12UnInitializeEv @ 56 NONAME + _ZThn4_N19COmxILDummyBaseILIF13FlushAllPortsEv @ 57 NONAME + _ZThn4_N19COmxILDummyBaseILIF15CustomInterfaceE4TUid @ 58 NONAME + _ZThn4_N19COmxILDummyBaseILIF16CreateComponentLERK4TUidR13MILIfObserver @ 59 NONAME + _ZThn4_N19COmxILDummyBaseILIF16CreateComponentLERK6TDesC8R13MILIfObserver @ 60 NONAME + _ZThn4_N19COmxILDummyBaseILIF16ReleaseComponentEv @ 61 NONAME + _ZThn4_N19COmxILDummyBaseILIF18SetComponentIfRoleERK4TUid @ 62 NONAME + _ZThn4_N19COmxILDummyBaseILIF18SetComponentIfRoleERK6TDesC8 @ 63 NONAME + _ZThn4_N19COmxILDummyBaseILIF4StopEv @ 64 NONAME + _ZThn4_N19COmxILDummyBaseILIF5PauseEv @ 65 NONAME + _ZThn4_N19COmxILDummyBaseILIF7ExecuteEv @ 66 NONAME + _ZThn4_N19COmxILDummyBaseILIF9SetConfigERK9TILStructPK18MILComponentPortIf @ 67 NONAME + _ZThn4_NK19COmxILDummyBaseILIF12GetExtConfigERK6TDesC8R9TILStructPK18MILComponentPortIf @ 68 NONAME + _ZThn4_NK19COmxILDummyBaseILIF17ComponentRoleEnumER5TPtr8m @ 69 NONAME + _ZThn4_NK19COmxILDummyBaseILIF18GetComponentIfRoleER4TUid @ 70 NONAME + _ZThn4_NK19COmxILDummyBaseILIF18GetComponentIfRoleER5TDes8 @ 71 NONAME + _ZThn4_NK19COmxILDummyBaseILIF19GetComponentVersionER19TILComponentVersion @ 72 NONAME + _ZThn4_NK19COmxILDummyBaseILIF22GetComponentInputPortsER13RPointerArrayI18MILComponentPortIfE @ 73 NONAME + _ZThn4_NK19COmxILDummyBaseILIF23GetComponentOutputPortsER13RPointerArrayI18MILComponentPortIfE @ 74 NONAME + _ZThn4_NK19COmxILDummyBaseILIF8GetStateER17TILComponentState @ 75 NONAME + _ZThn4_NK19COmxILDummyBaseILIF9GetConfigER9TILStructPK18MILComponentPortIf @ 76 NONAME + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/unittest/eabi/tsu_milif_omxilif.def --- a/omxil/mmilapi/unittest/eabi/tsu_milif_omxilif.def Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/unittest/eabi/tsu_milif_omxilif.def Fri May 07 16:25:23 2010 +0100 @@ -1,23 +1,23 @@ -EXPORTS - _ZN15CTestSuiteMILIF13NewTestSuiteLEv @ 1 NONAME - _ZTI15CTestSuiteMILIF @ 2 NONAME - _ZTI18RTestStepMILIFBase @ 3 NONAME - _ZTI19RTestStepMILIFPorts @ 4 NONAME - _ZTI20RTestStepMILIFConfig @ 5 NONAME - _ZTI20RTestStepMILIFStates @ 6 NONAME - _ZTI21RTestStepMILIFVersion @ 7 NONAME ABSENT - _ZTI22RTestStepMILIFCommands @ 8 NONAME - _ZTI24RTestStepMILIFExtensions @ 9 NONAME - _ZTI24RTestStepMILIFTunnelling @ 10 NONAME ABSENT - _ZTI27RTestStepMILIFComponentRole @ 11 NONAME - _ZTV15CTestSuiteMILIF @ 12 NONAME - _ZTV18RTestStepMILIFBase @ 13 NONAME - _ZTV19RTestStepMILIFPorts @ 14 NONAME - _ZTV20RTestStepMILIFConfig @ 15 NONAME - _ZTV20RTestStepMILIFStates @ 16 NONAME - _ZTV21RTestStepMILIFVersion @ 17 NONAME ABSENT - _ZTV22RTestStepMILIFCommands @ 18 NONAME - _ZTV24RTestStepMILIFExtensions @ 19 NONAME - _ZTV24RTestStepMILIFTunnelling @ 20 NONAME ABSENT - _ZTV27RTestStepMILIFComponentRole @ 21 NONAME - +EXPORTS + _ZN15CTestSuiteMILIF13NewTestSuiteLEv @ 1 NONAME + _ZTI15CTestSuiteMILIF @ 2 NONAME + _ZTI18RTestStepMILIFBase @ 3 NONAME + _ZTI19RTestStepMILIFPorts @ 4 NONAME + _ZTI20RTestStepMILIFConfig @ 5 NONAME + _ZTI20RTestStepMILIFStates @ 6 NONAME + _ZTI21RTestStepMILIFVersion @ 7 NONAME ABSENT + _ZTI22RTestStepMILIFCommands @ 8 NONAME + _ZTI24RTestStepMILIFExtensions @ 9 NONAME + _ZTI24RTestStepMILIFTunnelling @ 10 NONAME ABSENT + _ZTI27RTestStepMILIFComponentRole @ 11 NONAME + _ZTV15CTestSuiteMILIF @ 12 NONAME + _ZTV18RTestStepMILIFBase @ 13 NONAME + _ZTV19RTestStepMILIFPorts @ 14 NONAME + _ZTV20RTestStepMILIFConfig @ 15 NONAME + _ZTV20RTestStepMILIFStates @ 16 NONAME + _ZTV21RTestStepMILIFVersion @ 17 NONAME ABSENT + _ZTV22RTestStepMILIFCommands @ 18 NONAME + _ZTV24RTestStepMILIFExtensions @ 19 NONAME + _ZTV24RTestStepMILIFTunnelling @ 20 NONAME ABSENT + _ZTV27RTestStepMILIFComponentRole @ 21 NONAME + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/unittest/group/bld.inf --- a/omxil/mmilapi/unittest/group/bld.inf Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/unittest/group/bld.inf Fri May 07 16:25:23 2010 +0100 @@ -1,38 +1,38 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// - -#ifdef SYMBIAN_MULTIMEDIA_A3FDEVSOUND - -PRJ_TESTMMPFILES -../mmpfiles/omxildummybaseilif.mmp -../mmpfiles/omxildummyaudiodecilif.mmp -../mmpfiles/omxildummyaudiodec.mmp -../mmpfiles/dummypcmrenderer.mmp - -../mmpfiles/omxilvorbdechwdevice.mmp - -../mmpfiles/tsu_milif_omxilif.mmp - -PRJ_TESTEXPORTS -../scripts/tsu_milif_omxilif.script c:/omxil/tsu_milif_omxilif.script - -// DEF FILES - -// IBY FILE -milifunittests.iby /epoc32/rom/include/milifunittests.iby - -#endif // SYMBIAN_MULTIMEDIA_A3FDEVSOUND - -// End of file +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +#ifdef SYMBIAN_MULTIMEDIA_A3FDEVSOUND + +PRJ_TESTMMPFILES +../mmpfiles/omxildummybaseilif.mmp +../mmpfiles/omxildummyaudiodecilif.mmp +../mmpfiles/omxildummyaudiodec.mmp +../mmpfiles/dummypcmrenderer.mmp + +../mmpfiles/omxilvorbdechwdevice.mmp + +../mmpfiles/tsu_milif_omxilif.mmp + +PRJ_TESTEXPORTS +../scripts/tsu_milif_omxilif.script c:/omxil/tsu_milif_omxilif.script + +// DEF FILES + +// IBY FILE +milifunittests.iby /epoc32/rom/include/milifunittests.iby + +#endif // SYMBIAN_MULTIMEDIA_A3FDEVSOUND + +// End of file diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/unittest/group/milifunittests.iby --- a/omxil/mmilapi/unittest/group/milifunittests.iby Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/unittest/group/milifunittests.iby Fri May 07 16:25:23 2010 +0100 @@ -1,44 +1,44 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// - -#ifndef MILIFUNITTESTS_IBY -#define MILIFUNITTESTS_IBY - -#ifdef SYMBIAN_MULTIMEDIA_A3FDEVSOUND - -// Dummy Pcm Renderer -ECOM_PLUGIN(dummypcmrenderer.dll, dummypcmrenderer.rsc) - -// OMX IL Dummy Audio Decoder -ECOM_PLUGIN(omxildummyaudiodec.dll, omxildummyaudiodec.rsc) - -// OMX IL Dummy Audio Decoder IL Interface -ECOM_PLUGIN(omxildummyaudiodecilif.dll, omxildummyaudiodecilif.rsc) - -// OMX IL Dummy Base IL Interface -file=ABI_DIR\BUILD_DIR\omxildummybaseilif.dll System\Libs\omxildummybaseilif.dll - -// OMX IL Vorbis Decoder HwDevice -ECOM_PLUGIN(omxilvorbdechwdevice.dll, omxilvorbdechwdevice.rsc) - -// OMX IL MILIF Unit tests -file=ABI_DIR\BUILD_DIR\tsu_milif_omxilif.dll System\Libs\tsu_milif_omxilif.dll - -// scripts -data=EPOCROOT##epoc32\data\c\omxil\tsu_milif_omxilif.script \omxil\tsu_milif_omxilif.script - -#endif // SYMBIAN_MULTIMEDIA_A3FDEVSOUND - +// 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 MILIFUNITTESTS_IBY +#define MILIFUNITTESTS_IBY + +#ifdef SYMBIAN_MULTIMEDIA_A3FDEVSOUND + +// Dummy Pcm Renderer +ECOM_PLUGIN(dummypcmrenderer.dll, dummypcmrenderer.rsc) + +// OMX IL Dummy Audio Decoder +ECOM_PLUGIN(omxildummyaudiodec.dll, omxildummyaudiodec.rsc) + +// OMX IL Dummy Audio Decoder IL Interface +ECOM_PLUGIN(omxildummyaudiodecilif.dll, omxildummyaudiodecilif.rsc) + +// OMX IL Dummy Base IL Interface +file=ABI_DIR\BUILD_DIR\omxildummybaseilif.dll System\Libs\omxildummybaseilif.dll + +// OMX IL Vorbis Decoder HwDevice +ECOM_PLUGIN(omxilvorbdechwdevice.dll, omxilvorbdechwdevice.rsc) + +// OMX IL MILIF Unit tests +file=ABI_DIR\BUILD_DIR\tsu_milif_omxilif.dll System\Libs\tsu_milif_omxilif.dll + +// scripts +data=EPOCROOT##epoc32\data\c\omxil\tsu_milif_omxilif.script \omxil\tsu_milif_omxilif.script + +#endif // SYMBIAN_MULTIMEDIA_A3FDEVSOUND + #endif // MILIFUNITTESTS_IBY \ No newline at end of file diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/unittest/inc/ilcomponentif.h --- a/omxil/mmilapi/unittest/inc/ilcomponentif.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/unittest/inc/ilcomponentif.h Fri May 07 16:25:23 2010 +0100 @@ -1,42 +1,42 @@ -// 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 ILCOMPONENTIF_H -#define ILCOMPONENTIF_H - -#include -#include - -#include "milcomponentif.h" - -/** - Generic ECom plugin class for creating MILComponentIf instances. - @see MILComponentIf -*/ -class CILComponentIf : public CBase, - public MILComponentIf - { -public: - inline static CILComponentIf* CreateImplementationL(TUid aImplementationUid); - - inline virtual ~CILComponentIf(); - -private: - TUid iDtor_ID_Key; - }; - -#include "ilcomponentif.inl" - -#endif // ILCOMPONENTIF_H +// 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 ILCOMPONENTIF_H +#define ILCOMPONENTIF_H + +#include +#include + +#include "milcomponentif.h" + +/** + Generic ECom plugin class for creating MILComponentIf instances. + @see MILComponentIf +*/ +class CILComponentIf : public CBase, + public MILComponentIf + { +public: + inline static CILComponentIf* CreateImplementationL(TUid aImplementationUid); + + inline virtual ~CILComponentIf(); + +private: + TUid iDtor_ID_Key; + }; + +#include "ilcomponentif.inl" + +#endif // ILCOMPONENTIF_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/unittest/inc/ilcomponentif.inl --- a/omxil/mmilapi/unittest/inc/ilcomponentif.inl Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/unittest/inc/ilcomponentif.inl Fri May 07 16:25:23 2010 +0100 @@ -1,46 +1,46 @@ -// 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 ILCOMPONENTIF_INL -#define ILCOMPONENTIF_INL - -#include - -#include "ilcomponentif.h" - -/** - Create a CILComponentIf object with a known implementation Uid. - Asks ECOM plugin framework to instantiate this concret plugin implementation. - Will leave if it is not found (KErrNotFound). - @param aUid - The Uid of a plugin implementation - @return An instantiated CILComponentIf derived object from ECom. - */ -inline CILComponentIf* CILComponentIf::CreateImplementationL(TUid aImplementationUid) - { - TAny* ptr = REComSession::CreateImplementationL(aImplementationUid , _FOFF(CILComponentIf, iDtor_ID_Key)); - return static_cast(ptr); - } - -/** - Interface base class destructor -*/ -inline CILComponentIf::~CILComponentIf() - { - // Destroy any instance variables and then inform ecom that this specific - // instance of the interface has been destroyed. - REComSession::DestroyedImplementation(iDtor_ID_Key); - } - -#endif // ILCOMPONENTIF_INL +// 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 ILCOMPONENTIF_INL +#define ILCOMPONENTIF_INL + +#include + +#include "ilcomponentif.h" + +/** + Create a CILComponentIf object with a known implementation Uid. + Asks ECOM plugin framework to instantiate this concret plugin implementation. + Will leave if it is not found (KErrNotFound). + @param aUid - The Uid of a plugin implementation + @return An instantiated CILComponentIf derived object from ECom. + */ +inline CILComponentIf* CILComponentIf::CreateImplementationL(TUid aImplementationUid) + { + TAny* ptr = REComSession::CreateImplementationL(aImplementationUid , _FOFF(CILComponentIf, iDtor_ID_Key)); + return static_cast(ptr); + } + +/** + Interface base class destructor +*/ +inline CILComponentIf::~CILComponentIf() + { + // Destroy any instance variables and then inform ecom that this specific + // instance of the interface has been destroyed. + REComSession::DestroyedImplementation(iDtor_ID_Key); + } + +#endif // ILCOMPONENTIF_INL diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/unittest/inc/iltestuids.hrh --- a/omxil/mmilapi/unittest/inc/iltestuids.hrh Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/unittest/inc/iltestuids.hrh Fri May 07 16:25:23 2010 +0100 @@ -1,39 +1,39 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// - -#ifndef ILTESTUIDS_HRH -#define ILTESTUIDS_HRH - -#define KSharedLibraryUidDefine 0x1000008D //standard UID for dlls -#define KECOMPluginUidDefine 0x10009D8D //standard UID for ECOM plugins - -#define KUidOmxILVorbDecHwDeviceDll 0x10285C12 -#define KUidOmxILVorbDecHwDevice 0x10285C13 - -#define KUidDummyPcmRendererMILIFPluginDll 0x10285C16 -#define KUidDummyPcmRendererMILIFPlugin 0x10285C17 - -#define KUidOmxILDummyBaseMILIFPluginDll 0x10285C18 -#define KUidOmxILDummyAudioDecMILIFPluginDll 0x10285C19 -#define KUidOmxILDummyAudioDecMILIFPlugin 0x10285C1A - -#define KUidOmxILDummyAudioDecDll 0x10285C1B -#define KUidOmxILDummyAudioDec 0x10285C1C - -#define KUidMILIFTestSuite 0x10285C1D -#define KUidMILIFAacTestSuite 0x10287048 - -#endif // ILTESTUIDS_HRH - +// 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 ILTESTUIDS_HRH +#define ILTESTUIDS_HRH + +#define KSharedLibraryUidDefine 0x1000008D //standard UID for dlls +#define KECOMPluginUidDefine 0x10009D8D //standard UID for ECOM plugins + +#define KUidOmxILVorbDecHwDeviceDll 0x10285C12 +#define KUidOmxILVorbDecHwDevice 0x10285C13 + +#define KUidDummyPcmRendererMILIFPluginDll 0x10285C16 +#define KUidDummyPcmRendererMILIFPlugin 0x10285C17 + +#define KUidOmxILDummyBaseMILIFPluginDll 0x10285C18 +#define KUidOmxILDummyAudioDecMILIFPluginDll 0x10285C19 +#define KUidOmxILDummyAudioDecMILIFPlugin 0x10285C1A + +#define KUidOmxILDummyAudioDecDll 0x10285C1B +#define KUidOmxILDummyAudioDec 0x10285C1C + +#define KUidMILIFTestSuite 0x10285C1D +#define KUidMILIFAacTestSuite 0x10287048 + +#endif // ILTESTUIDS_HRH + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/unittest/inc/omxildummybaseilif.h --- a/omxil/mmilapi/unittest/inc/omxildummybaseilif.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/unittest/inc/omxildummybaseilif.h Fri May 07 16:25:23 2010 +0100 @@ -1,98 +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: -// - -#ifndef OMXILDUMMYBASEILIF_H -#define OMXILDUMMYBASEILIF_H - -#include -#include - -#include "ilcomponentif.h" -#include "momxilcomponentifobserver.h" - -/** -Test component. -Implementation of the generic parts of the MILIF API specific to OpenMAX IL specification when implemented as a plugin. -*/ -class COmxILDummyBaseILIF : public CILComponentIf, - public MOmxILComponentIfObserver - { -friend class COmxILDummyBasePortILIF; - -public: - class CBody; - -public: - - // from MILComponentIf - IMPORT_C void CreateComponentL(const TDesC8& aComponentName, MILIfObserver& aComponentIfObserver); - IMPORT_C void CreateComponentL(const TUid& aUid, MILIfObserver& aComponentIfObserver); - IMPORT_C void ReleaseComponent(); - IMPORT_C TInt GetComponentInputPorts(RPointerArray& aComponentPorts) const; - IMPORT_C TInt GetComponentOutputPorts(RPointerArray& aComponentPorts) const; - IMPORT_C TInt SetConfig(const TILStruct& aConfig, const MILComponentPortIf* aComponentPort); - IMPORT_C TInt GetConfig(TILStruct& aConfig, const MILComponentPortIf* aComponentPort) const; - IMPORT_C TInt Initialize(); - IMPORT_C TInt Execute(); - IMPORT_C TInt Pause(); - IMPORT_C TInt Stop(); - IMPORT_C TInt UnInitialize(); - IMPORT_C TInt GetState(TILComponentState& aState) const; - IMPORT_C TInt SendCommand(const TILCommand& aCommand); - IMPORT_C TInt FlushAllPorts(); - IMPORT_C TInt ComponentRoleEnum(TPtr8& aComponentRole, TUint32 aIndex) const; - IMPORT_C TInt GetComponentVersion(TILComponentVersion& aVersion) const; - IMPORT_C TInt SetComponentIfRole(const TUid& aComponentRole); - IMPORT_C TInt SetComponentIfRole(const TDesC8& aComponentRole); - IMPORT_C TInt GetComponentIfRole(TUid& aComponentRole) const; - IMPORT_C TInt GetComponentIfRole(TDes8& aComponentRole) const; - IMPORT_C TInt SetExtConfig(const TDesC8& aParameterName, const TILStruct& aConfig, const MILComponentPortIf* aComponentPort); - IMPORT_C TInt GetExtConfig(const TDesC8& aParameterName, TILStruct& aConfig, const MILComponentPortIf* aComponentPort) const; - IMPORT_C TAny* CustomInterface(TUid aUid); - - // from MOmxILComponentIfObserver - IMPORT_C TInt FillBufferDone(CMMFBuffer* aBuffer,TInt aPortIndex); - IMPORT_C TInt EmptyBufferDone(const CMMFBuffer* aBuffer,TInt aPortIndex); - IMPORT_C TInt EventHandler(OMX_EVENTTYPE aEvent, TUint32 aData1, TUint32 aData2, TAny* aExtraInfo); - - IMPORT_C ~COmxILDummyBaseILIF(); - -protected: - IMPORT_C COmxILDummyBaseILIF(); - - IMPORT_C TInt OmxGetParameter(OMX_INDEXTYPE aParamIndex, TAny* aComponentParameterStructure) const; - IMPORT_C TInt OmxSetParameter(OMX_INDEXTYPE aParamIndex, TAny* aComponentParameterStructure); - IMPORT_C TInt OmxGetConfig(OMX_INDEXTYPE aConfigIndex, TAny* aValue) const; - IMPORT_C TInt OmxSetConfig(OMX_INDEXTYPE aConfigIndex, TAny* aValue); - IMPORT_C TInt OmxGetExtensionIndex(const TDesC8& aParameterName, OMX_INDEXTYPE* aIndexType) const; - -private: - // Internal implementation. Only meant to be used by the component's port interface. - TInt OmxSendCommand(OMX_COMMANDTYPE aCmd, TUint32 aParam1, TAny* aCmdData); - TInt OmxComponentTunnelRequest(TUint32 aPortInput, OMX_HANDLETYPE aOutput, TUint32 aPortOutput); - TInt OmxComponentDisconnectTunnel(TUint32 aPortInput, OMX_HANDLETYPE aOutput, TUint32 aPortOutput); - TInt OmxUseBuffer(CMMFBuffer* aBuffer, TUint32 aPortIndex); - CMMFBuffer* OmxAllocateBufferL(TUint32 aPortIndex, TUint32 aSizeBytes); - TInt OmxFreeBuffer(CMMFBuffer* aBuffer); - TInt OmxEmptyThisBuffer(const CMMFBuffer* aBuffer, MOmxILComponentIfObserver* aObserver); - TInt OmxFillThisBuffer(CMMFBuffer* aBuffer, MOmxILComponentIfObserver* aObserver); - OMX_COMPONENTTYPE* OmxHandle() const; - -private: - CBody* iBody; - }; - -#endif // OMXILDUMMYBASEILIF_H - +// 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 OMXILDUMMYBASEILIF_H +#define OMXILDUMMYBASEILIF_H + +#include +#include + +#include "ilcomponentif.h" +#include "momxilcomponentifobserver.h" + +/** +Test component. +Implementation of the generic parts of the MILIF API specific to OpenMAX IL specification when implemented as a plugin. +*/ +class COmxILDummyBaseILIF : public CILComponentIf, + public MOmxILComponentIfObserver + { +friend class COmxILDummyBasePortILIF; + +public: + class CBody; + +public: + + // from MILComponentIf + IMPORT_C void CreateComponentL(const TDesC8& aComponentName, MILIfObserver& aComponentIfObserver); + IMPORT_C void CreateComponentL(const TUid& aUid, MILIfObserver& aComponentIfObserver); + IMPORT_C void ReleaseComponent(); + IMPORT_C TInt GetComponentInputPorts(RPointerArray& aComponentPorts) const; + IMPORT_C TInt GetComponentOutputPorts(RPointerArray& aComponentPorts) const; + IMPORT_C TInt SetConfig(const TILStruct& aConfig, const MILComponentPortIf* aComponentPort); + IMPORT_C TInt GetConfig(TILStruct& aConfig, const MILComponentPortIf* aComponentPort) const; + IMPORT_C TInt Initialize(); + IMPORT_C TInt Execute(); + IMPORT_C TInt Pause(); + IMPORT_C TInt Stop(); + IMPORT_C TInt UnInitialize(); + IMPORT_C TInt GetState(TILComponentState& aState) const; + IMPORT_C TInt SendCommand(const TILCommand& aCommand); + IMPORT_C TInt FlushAllPorts(); + IMPORT_C TInt ComponentRoleEnum(TPtr8& aComponentRole, TUint32 aIndex) const; + IMPORT_C TInt GetComponentVersion(TILComponentVersion& aVersion) const; + IMPORT_C TInt SetComponentIfRole(const TUid& aComponentRole); + IMPORT_C TInt SetComponentIfRole(const TDesC8& aComponentRole); + IMPORT_C TInt GetComponentIfRole(TUid& aComponentRole) const; + IMPORT_C TInt GetComponentIfRole(TDes8& aComponentRole) const; + IMPORT_C TInt SetExtConfig(const TDesC8& aParameterName, const TILStruct& aConfig, const MILComponentPortIf* aComponentPort); + IMPORT_C TInt GetExtConfig(const TDesC8& aParameterName, TILStruct& aConfig, const MILComponentPortIf* aComponentPort) const; + IMPORT_C TAny* CustomInterface(TUid aUid); + + // from MOmxILComponentIfObserver + IMPORT_C TInt FillBufferDone(CMMFBuffer* aBuffer,TInt aPortIndex); + IMPORT_C TInt EmptyBufferDone(const CMMFBuffer* aBuffer,TInt aPortIndex); + IMPORT_C TInt EventHandler(OMX_EVENTTYPE aEvent, TUint32 aData1, TUint32 aData2, TAny* aExtraInfo); + + IMPORT_C ~COmxILDummyBaseILIF(); + +protected: + IMPORT_C COmxILDummyBaseILIF(); + + IMPORT_C TInt OmxGetParameter(OMX_INDEXTYPE aParamIndex, TAny* aComponentParameterStructure) const; + IMPORT_C TInt OmxSetParameter(OMX_INDEXTYPE aParamIndex, TAny* aComponentParameterStructure); + IMPORT_C TInt OmxGetConfig(OMX_INDEXTYPE aConfigIndex, TAny* aValue) const; + IMPORT_C TInt OmxSetConfig(OMX_INDEXTYPE aConfigIndex, TAny* aValue); + IMPORT_C TInt OmxGetExtensionIndex(const TDesC8& aParameterName, OMX_INDEXTYPE* aIndexType) const; + +private: + // Internal implementation. Only meant to be used by the component's port interface. + TInt OmxSendCommand(OMX_COMMANDTYPE aCmd, TUint32 aParam1, TAny* aCmdData); + TInt OmxComponentTunnelRequest(TUint32 aPortInput, OMX_HANDLETYPE aOutput, TUint32 aPortOutput); + TInt OmxComponentDisconnectTunnel(TUint32 aPortInput, OMX_HANDLETYPE aOutput, TUint32 aPortOutput); + TInt OmxUseBuffer(CMMFBuffer* aBuffer, TUint32 aPortIndex); + CMMFBuffer* OmxAllocateBufferL(TUint32 aPortIndex, TUint32 aSizeBytes); + TInt OmxFreeBuffer(CMMFBuffer* aBuffer); + TInt OmxEmptyThisBuffer(const CMMFBuffer* aBuffer, MOmxILComponentIfObserver* aObserver); + TInt OmxFillThisBuffer(CMMFBuffer* aBuffer, MOmxILComponentIfObserver* aObserver); + OMX_COMPONENTTYPE* OmxHandle() const; + +private: + CBody* iBody; + }; + +#endif // OMXILDUMMYBASEILIF_H + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/unittest/mmpfiles/dummypcmrenderer.mmp --- a/omxil/mmilapi/unittest/mmpfiles/dummypcmrenderer.mmp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/unittest/mmpfiles/dummypcmrenderer.mmp Fri May 07 16:25:23 2010 +0100 @@ -1,53 +1,53 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// - -#include "../inc/iltestuids.hrh" - -TARGET dummypcmrenderer.dll -TARGETTYPE plugin - -CAPABILITY ALL -TCB - -UID KECOMPluginUidDefine KUidDummyPcmRendererMILIFPluginDll -VENDORID 0x70000001 - -#ifdef SYMBIAN_MDF_SHAREDCHUNK_SOUNDDRIVER -USERINCLUDE ../../../../mmdevicefw/mdf/src/audio/mdasoundadapter -#endif - -SOURCEPATH ../test_plugins/dummypcmrenderer -SOURCE dummypcmrenderer.cpp - -USERINCLUDE ../test_plugins/dummypcmrenderer -USERINCLUDE ../inc -USERINCLUDE ../../ilif/inc - -OS_LAYER_SYSTEMINCLUDE_SYMBIAN - -RESOURCE dummypcmrenderer.rss - -LIBRARY euser.lib -LIBRARY ecom.lib -LIBRARY mmfserverbaseclasses.lib - - -#ifdef SYMBIAN_MDF_SHAREDCHUNK_SOUNDDRIVER -LIBRARY mdasoundadapter.lib -#endif - - - - -SMPSAFE +// 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 "../inc/iltestuids.hrh" + +TARGET dummypcmrenderer.dll +TARGETTYPE plugin + +CAPABILITY ALL -TCB + +UID KECOMPluginUidDefine KUidDummyPcmRendererMILIFPluginDll +VENDORID 0x70000001 + +#ifdef SYMBIAN_MDF_SHAREDCHUNK_SOUNDDRIVER +USERINCLUDE ../../../../mmdevicefw/mdf/src/audio/mdasoundadapter +#endif + +SOURCEPATH ../test_plugins/dummypcmrenderer +SOURCE dummypcmrenderer.cpp + +USERINCLUDE ../test_plugins/dummypcmrenderer +USERINCLUDE ../inc +USERINCLUDE ../../ilif/inc + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN + +RESOURCE dummypcmrenderer.rss + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY mmfserverbaseclasses.lib + + +#ifdef SYMBIAN_MDF_SHAREDCHUNK_SOUNDDRIVER +LIBRARY mdasoundadapter.lib +#endif + + + + +SMPSAFE diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/unittest/mmpfiles/omxildummyaudiodec.mmp --- a/omxil/mmilapi/unittest/mmpfiles/omxildummyaudiodec.mmp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/unittest/mmpfiles/omxildummyaudiodec.mmp Fri May 07 16:25:23 2010 +0100 @@ -1,43 +1,43 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// - -#include "../inc/iltestuids.hrh" - -TARGET omxildummyaudiodec.dll -TARGETTYPE PLUGIN - -CAPABILITY ALL -TCB - -UID KECOMPluginUidDefine KUidOmxILDummyAudioDecDll -VENDORID 0x70000001 - -SOURCEPATH ../test_plugins/omxildummyaudiodec -SOURCE omximpl.cpp -SOURCE omxildummyaudiodec.cpp - -USERINCLUDE ../inc -USERINCLUDE ../test_plugins/omxildummyaudiodec - -OS_LAYER_SYSTEMINCLUDE_SYMBIAN - -RESOURCE omxildummyaudiodec.rss - -LIBRARY euser.lib -LIBRARY ecom.lib -LIBRARY mmfserverbaseclasses.lib - -STATICLIBRARY omxilcomponentif.lib - -SMPSAFE +// 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 "../inc/iltestuids.hrh" + +TARGET omxildummyaudiodec.dll +TARGETTYPE PLUGIN + +CAPABILITY ALL -TCB + +UID KECOMPluginUidDefine KUidOmxILDummyAudioDecDll +VENDORID 0x70000001 + +SOURCEPATH ../test_plugins/omxildummyaudiodec +SOURCE omximpl.cpp +SOURCE omxildummyaudiodec.cpp + +USERINCLUDE ../inc +USERINCLUDE ../test_plugins/omxildummyaudiodec + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN + +RESOURCE omxildummyaudiodec.rss + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY mmfserverbaseclasses.lib + +STATICLIBRARY omxilcomponentif.lib + +SMPSAFE diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/unittest/mmpfiles/omxildummyaudiodecilif.mmp --- a/omxil/mmilapi/unittest/mmpfiles/omxildummyaudiodecilif.mmp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/unittest/mmpfiles/omxildummyaudiodecilif.mmp Fri May 07 16:25:23 2010 +0100 @@ -1,45 +1,45 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// - -#include "../inc/iltestuids.hrh" - -TARGET omxildummyaudiodecilif.dll -TARGETTYPE plugin - -CAPABILITY All -TCB - -UID KECOMPluginUidDefine KUidOmxILDummyAudioDecMILIFPluginDll -VENDORID 0x70000001 - - -SOURCEPATH ../test_plugins/omxildummyaudiodecilif -SOURCE omxildummyaudiodecilif.cpp - -USERINCLUDE ../test_plugins/omxildummyaudiodecilif -USERINCLUDE ../inc // CILComponentIf -USERINCLUDE ../../refomxil/inc // omxilcomponent headers -USERINCLUDE ../../ilif/inc - -OS_LAYER_SYSTEMINCLUDE_SYMBIAN - -RESOURCE omxildummyaudiodecilif.rss - -LIBRARY euser.lib -LIBRARY ecom.lib -LIBRARY omxildummybaseilif.lib - - - -SMPSAFE +// 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 "../inc/iltestuids.hrh" + +TARGET omxildummyaudiodecilif.dll +TARGETTYPE plugin + +CAPABILITY All -TCB + +UID KECOMPluginUidDefine KUidOmxILDummyAudioDecMILIFPluginDll +VENDORID 0x70000001 + + +SOURCEPATH ../test_plugins/omxildummyaudiodecilif +SOURCE omxildummyaudiodecilif.cpp + +USERINCLUDE ../test_plugins/omxildummyaudiodecilif +USERINCLUDE ../inc // CILComponentIf +USERINCLUDE ../../refomxil/inc // omxilcomponent headers +USERINCLUDE ../../ilif/inc + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN + +RESOURCE omxildummyaudiodecilif.rss + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY omxildummybaseilif.lib + + + +SMPSAFE diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/unittest/mmpfiles/omxildummybaseilif.mmp --- a/omxil/mmilapi/unittest/mmpfiles/omxildummybaseilif.mmp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/unittest/mmpfiles/omxildummybaseilif.mmp Fri May 07 16:25:23 2010 +0100 @@ -1,50 +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: -// - -#include "../inc/iltestuids.hrh" - -TARGET omxildummybaseilif.dll -TARGETTYPE dll - -CAPABILITY All -TCB - -UID KSharedLibraryUidDefine KUidOmxILDummyBaseMILIFPluginDll -VENDORID 0x70000001 - - -SOURCEPATH ../../refomxil/src/omxilgenericilif -SOURCE omxilgenericilifbodyimpl.cpp -SOURCE omxilcoreutils.cpp -SOURCEPATH ../test_plugins/omxildummybaseilif -SOURCE omxildummybaseilif.cpp -SOURCE omxildummybaseilifbody.cpp -SOURCE omxildummybaseportilif.cpp - -USERINCLUDE ../test_plugins/omxildummybaseilif -USERINCLUDE ../inc -USERINCLUDE ../../refomxil/inc -USERINCLUDE ../../ilif/inc - -OS_LAYER_SYSTEMINCLUDE_SYMBIAN - -LIBRARY euser.lib -LIBRARY ecom.lib -LIBRARY mmfserverbaseclasses.lib -LIBRARY omxilcoreclient.lib - - -NOSTRICTDEF - -SMPSAFE +// 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 "../inc/iltestuids.hrh" + +TARGET omxildummybaseilif.dll +TARGETTYPE dll + +CAPABILITY All -TCB + +UID KSharedLibraryUidDefine KUidOmxILDummyBaseMILIFPluginDll +VENDORID 0x70000001 + + +SOURCEPATH ../../refomxil/src/omxilgenericilif +SOURCE omxilgenericilifbodyimpl.cpp +SOURCE omxilcoreutils.cpp +SOURCEPATH ../test_plugins/omxildummybaseilif +SOURCE omxildummybaseilif.cpp +SOURCE omxildummybaseilifbody.cpp +SOURCE omxildummybaseportilif.cpp + +USERINCLUDE ../test_plugins/omxildummybaseilif +USERINCLUDE ../inc +USERINCLUDE ../../refomxil/inc +USERINCLUDE ../../ilif/inc + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY mmfserverbaseclasses.lib +LIBRARY omxilcoreclient.lib + + +NOSTRICTDEF + +SMPSAFE diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/unittest/mmpfiles/omxilvorbdechwdevice.mmp --- a/omxil/mmilapi/unittest/mmpfiles/omxilvorbdechwdevice.mmp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/unittest/mmpfiles/omxilvorbdechwdevice.mmp Fri May 07 16:25:23 2010 +0100 @@ -1,49 +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: -// - -#include "../inc/iltestuids.hrh" - -TARGET omxilvorbdechwdevice.dll -TARGETTYPE plugin - -CAPABILITY All -TCB - -UID KECOMPluginUidDefine KUidOmxILVorbDecHwDeviceDll -VENDORID 0x70000001 - -SOURCEPATH ../test_plugins/audioilhwdevice_mvs_test/omxilvorbdechwdevice -SOURCE omxilvorbdechwdevice.cpp - -USERINCLUDE ../test_plugins/audioilhwdevice_mvs_test/omxilvorbdechwdevice -USERINCLUDE ../test_plugins/omxildummybaseilif // Generic implementation of milif API for OMX as a plugin -USERINCLUDE ../test_plugins/dummypcmrenderer // CDummyPcmRenderer plugin -USERINCLUDE ../inc // CILComponentIf -USERINCLUDE ../../refomxil/inc // omxilcomponent headers -USERINCLUDE ../../ilif/inc - - -OS_LAYER_SYSTEMINCLUDE_SYMBIAN - -RESOURCE omxilvorbdechwdevice.rss - -LIBRARY euser.lib -LIBRARY ecom.lib -LIBRARY mmcommonutils.lib -LIBRARY mmfserverbaseclasses.lib -LIBRARY omxilcoreclient.lib - - - -SMPSAFE +// 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 "../inc/iltestuids.hrh" + +TARGET omxilvorbdechwdevice.dll +TARGETTYPE plugin + +CAPABILITY All -TCB + +UID KECOMPluginUidDefine KUidOmxILVorbDecHwDeviceDll +VENDORID 0x70000001 + +SOURCEPATH ../test_plugins/audioilhwdevice_mvs_test/omxilvorbdechwdevice +SOURCE omxilvorbdechwdevice.cpp + +USERINCLUDE ../test_plugins/audioilhwdevice_mvs_test/omxilvorbdechwdevice +USERINCLUDE ../test_plugins/omxildummybaseilif // Generic implementation of milif API for OMX as a plugin +USERINCLUDE ../test_plugins/dummypcmrenderer // CDummyPcmRenderer plugin +USERINCLUDE ../inc // CILComponentIf +USERINCLUDE ../../refomxil/inc // omxilcomponent headers +USERINCLUDE ../../ilif/inc + + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN + +RESOURCE omxilvorbdechwdevice.rss + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY mmcommonutils.lib +LIBRARY mmfserverbaseclasses.lib +LIBRARY omxilcoreclient.lib + + + +SMPSAFE diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/unittest/mmpfiles/tsu_milif_omxilif.mmp --- a/omxil/mmilapi/unittest/mmpfiles/tsu_milif_omxilif.mmp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/unittest/mmpfiles/tsu_milif_omxilif.mmp Fri May 07 16:25:23 2010 +0100 @@ -1,45 +1,45 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// - -#include "../inc/iltestuids.hrh" - -TARGET tsu_milif_omxilif.dll -TARGETTYPE dll - -CAPABILITY All -TCB - -UID 0x1000008d KUidMILIFTestSuite -VENDORID 0x70000001 - -SOURCEPATH ../src -SOURCE tsu_milif_omxiliftests.cpp -SOURCE tsu_milif_testsuite.cpp - -USERINCLUDE ../src -USERINCLUDE ../inc // CILComponentIf -USERINCLUDE ../../refomxil/inc -USERINCLUDE ../../ilif/inc - -OS_LAYER_SYSTEMINCLUDE_SYMBIAN - -LIBRARY euser.lib -LIBRARY ecom.lib -LIBRARY testframeworkclient.lib -LIBRARY omxilcoreclient.lib - -NOSTRICTDEF - - -SMPSAFE +// 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 "../inc/iltestuids.hrh" + +TARGET tsu_milif_omxilif.dll +TARGETTYPE dll + +CAPABILITY All -TCB + +UID 0x1000008d KUidMILIFTestSuite +VENDORID 0x70000001 + +SOURCEPATH ../src +SOURCE tsu_milif_omxiliftests.cpp +SOURCE tsu_milif_testsuite.cpp + +USERINCLUDE ../src +USERINCLUDE ../inc // CILComponentIf +USERINCLUDE ../../refomxil/inc +USERINCLUDE ../../ilif/inc + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY testframeworkclient.lib +LIBRARY omxilcoreclient.lib + +NOSTRICTDEF + + +SMPSAFE diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/unittest/scripts/tsu_milif_omxilif.script --- a/omxil/mmilapi/unittest/scripts/tsu_milif_omxilif.script Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/unittest/scripts/tsu_milif_omxilif.script Fri May 07 16:25:23 2010 +0100 @@ -1,126 +1,126 @@ -// -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// - -LOAD_SUITE TSU_MILIF_OMXILIF.dll - -//------------------------------------------------------------------------------------------// -// Test Suite for the Generic Multimedia Integration Layer Interface // -// -// This test suite is based on the generic DLL implementation of the MILIF interface that has -// been specialized to make use of a generic plugin implementation of the MILIF interface for -// OMX audio decoders -// -// Test Cases: MM-MILIF-DUMMYOMXILIF-U-0001 to MM-MILIF-DUMMYOMXILIF-U-0006 -// -//------------------------------------------------------------------------------------------// - - -//------------------------------------------------------------------------------------------// -// TEST STEP: TSU_MILIF_OMXILIF MM-MILIF-DUMMYOMXILIF-U-0001 -// RTestStepMILIFPorts: To test access to IL component ports through MILIF. -// 1. Create an instance of the KUidOmxILAudioDecGenericIf test ECOM plugin interface. -// 2. Use the interface to instanciate a dummy omx component. -// 3. Set the role of the interface to "aac decoder". -// 4. Get Component Input ports through interface. -// 5. Get Component Output ports through interface. -//------------------------------------------------------------------------------------------// -//! @SYMTestCaseID MM-MILIF-DUMMYOMXILIF-U-0001 - -RUN_TEST_STEP -1 TSU_MILIF_OMXILIF MM-MILIF-DUMMYOMXILIF-U-0001 -TEST_COMPLETE - -//------------------------------------------------------------------------------------------// -// TEST STEP: TSU_MILIF_OMXILIF MM-MILIF-DUMMYOMXILIF-U-0002 -// RTestStepMILIFConfig: To test configuration of IL component through MILIF. -// 1. Create an instance of the KUidOmxILAudioDecGenericIf test ECOM plugin interface. -// 2. Use the interface to instanciate a dummy omx component. -// 3. Set the role of the interface to "aac decoder". -// 4. Get Component Input ports through interface. -// 5a. Set a (partial) config port parameter through the interface. -// 5b. Now Get the TPortDefinitionType config parameter through the interface. -// 6a. Configure component through the interface. -// 6b. Now Get the TOMXILStructParam config parameter through the interface. -//------------------------------------------------------------------------------------------// -//! @SYMTestCaseID MM-MILIF-DUMMYOMXILIF-U-0002 - -RUN_TEST_STEP -1 TSU_MILIF_OMXILIF MM-MILIF-DUMMYOMXILIF-U-0002 -TEST_COMPLETE - -//------------------------------------------------------------------------------------------// -// TEST STEP: TSU_MILIF_OMXILIF MM-MILIF-DUMMYOMXILIF-U-0003 -// RTestStepMILIFStates: To test driving the IL component state machine through MILIF. -// 1. Create an instance of the KUidOmxILAudioDecGenericIf test ECOM plugin interface. -// 2. Use the interface to instanciate a dummy omx component. -// 3. Set the role of the interface to "aac decoder". -// 4. Trigger transition from Load to Idle in component by calling Initialize() -// 5a. Check the component was left in the correct state after EEventInitComplete event -// 5b. Trigger transition from Idle to Execute in component by calling Execute() -// 6a. Check the component was left in the correct state after EEventExecuteComplete event -// 6b. Trigger transition from Executing to Pause in component by calling Pause() -// 7a. Check the component was left in the correct state after EEventPauseComplete event -// 7b. Trigger transition from Pause to Idle in component by calling Stop() -// 8. Check the component was left in the correct state after EEventStopComplete event -//------------------------------------------------------------------------------------------// -//! @SYMTestCaseID MM-MILIF-DUMMYOMXILIF-U-0003 - -RUN_TEST_STEP -1 TSU_MILIF_OMXILIF MM-MILIF-DUMMYOMXILIF-U-0003 -TEST_COMPLETE - -//------------------------------------------------------------------------------------------// -// TEST STEP: TSU_MILIF_OMXILIF MM-MILIF-DUMMYOMXILIF-U-0004 -// RTestStepMILIFCommands: To test sending commands to the IL component through MILIF. -// 1. Create an instance of the KUidOmxILAudioDecGenericIf test ECOM plugin interface. -// 2. Use the interface to instanciate a dummy omx component. -// 3. Set the role of the interface to "aac decoder". -// 4. Trigger FlushAllPorts -// 5. Trigger SendCommand() with ECommandPortDisable -//------------------------------------------------------------------------------------------// -//! @SYMTestCaseID MM-MILIF-DUMMYOMXILIF-U-0004 - -RUN_TEST_STEP -1 TSU_MILIF_OMXILIF MM-MILIF-DUMMYOMXILIF-U-0004 -TEST_COMPLETE - -//------------------------------------------------------------------------------------------// -// TEST STEP: TSU_MILIF_OMXILIF MM-MILIF-DUMMYOMXILIF-U-0005 -// RTestStepMILIFExtensions: To test configuration of the IL component with extended params through MILIF. -// 1. Create an instance of the KUidOmxILAudioDecGenericIf test ECOM plugin interface. -// 2. Use the interface to instanciate a dummy omx component. -// 3. Set the role of the interface to "aac decoder". -// 4. Get Component Input ports through interface. -// 5a. Set a (partial) config port parameter through the interface's extension mechanism. -// 5b. Get the parameter set in 5a through the interface's extension mechanism. -//------------------------------------------------------------------------------------------// -//! @SYMTestCaseID MM-MILIF-DUMMYOMXILIF-U-0005 - -RUN_TEST_STEP -1 TSU_MILIF_OMXILIF MM-MILIF-DUMMYOMXILIF-U-0005 -TEST_COMPLETE - -//------------------------------------------------------------------------------------------// -// TEST STEP: TSU_MILIF_OMXILIF MM-MILIF-DUMMYOMXILIF-U-0006 -// RTestStepMILIFComponentRole: To test access to the IL component role through MILIF. -// 1. Create an instance of the KUidOmxILAudioDecGenericIf test ECOM plugin interface. -// 2. Use the interface to instanciate a dummy omx component. -// 3. Set the role of the interface to "aac decoder". -// 4. Get component role through interface. -// 5. Check the component's role returned is the expected role -//------------------------------------------------------------------------------------------// -//! @SYMTestCaseID MM-MILIF-DUMMYOMXILIF-U-0006 - -RUN_TEST_STEP -1 TSU_MILIF_OMXILIF MM-MILIF-DUMMYOMXILIF-U-0006 -TEST_COMPLETE - - -// End of Test Script +// +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +LOAD_SUITE TSU_MILIF_OMXILIF.dll + +//------------------------------------------------------------------------------------------// +// Test Suite for the Generic Multimedia Integration Layer Interface // +// +// This test suite is based on the generic DLL implementation of the MILIF interface that has +// been specialized to make use of a generic plugin implementation of the MILIF interface for +// OMX audio decoders +// +// Test Cases: MM-MILIF-DUMMYOMXILIF-U-0001 to MM-MILIF-DUMMYOMXILIF-U-0006 +// +//------------------------------------------------------------------------------------------// + + +//------------------------------------------------------------------------------------------// +// TEST STEP: TSU_MILIF_OMXILIF MM-MILIF-DUMMYOMXILIF-U-0001 +// RTestStepMILIFPorts: To test access to IL component ports through MILIF. +// 1. Create an instance of the KUidOmxILAudioDecGenericIf test ECOM plugin interface. +// 2. Use the interface to instanciate a dummy omx component. +// 3. Set the role of the interface to "aac decoder". +// 4. Get Component Input ports through interface. +// 5. Get Component Output ports through interface. +//------------------------------------------------------------------------------------------// +//! @SYMTestCaseID MM-MILIF-DUMMYOMXILIF-U-0001 + +RUN_TEST_STEP -1 TSU_MILIF_OMXILIF MM-MILIF-DUMMYOMXILIF-U-0001 +TEST_COMPLETE + +//------------------------------------------------------------------------------------------// +// TEST STEP: TSU_MILIF_OMXILIF MM-MILIF-DUMMYOMXILIF-U-0002 +// RTestStepMILIFConfig: To test configuration of IL component through MILIF. +// 1. Create an instance of the KUidOmxILAudioDecGenericIf test ECOM plugin interface. +// 2. Use the interface to instanciate a dummy omx component. +// 3. Set the role of the interface to "aac decoder". +// 4. Get Component Input ports through interface. +// 5a. Set a (partial) config port parameter through the interface. +// 5b. Now Get the TPortDefinitionType config parameter through the interface. +// 6a. Configure component through the interface. +// 6b. Now Get the TOMXILStructParam config parameter through the interface. +//------------------------------------------------------------------------------------------// +//! @SYMTestCaseID MM-MILIF-DUMMYOMXILIF-U-0002 + +RUN_TEST_STEP -1 TSU_MILIF_OMXILIF MM-MILIF-DUMMYOMXILIF-U-0002 +TEST_COMPLETE + +//------------------------------------------------------------------------------------------// +// TEST STEP: TSU_MILIF_OMXILIF MM-MILIF-DUMMYOMXILIF-U-0003 +// RTestStepMILIFStates: To test driving the IL component state machine through MILIF. +// 1. Create an instance of the KUidOmxILAudioDecGenericIf test ECOM plugin interface. +// 2. Use the interface to instanciate a dummy omx component. +// 3. Set the role of the interface to "aac decoder". +// 4. Trigger transition from Load to Idle in component by calling Initialize() +// 5a. Check the component was left in the correct state after EEventInitComplete event +// 5b. Trigger transition from Idle to Execute in component by calling Execute() +// 6a. Check the component was left in the correct state after EEventExecuteComplete event +// 6b. Trigger transition from Executing to Pause in component by calling Pause() +// 7a. Check the component was left in the correct state after EEventPauseComplete event +// 7b. Trigger transition from Pause to Idle in component by calling Stop() +// 8. Check the component was left in the correct state after EEventStopComplete event +//------------------------------------------------------------------------------------------// +//! @SYMTestCaseID MM-MILIF-DUMMYOMXILIF-U-0003 + +RUN_TEST_STEP -1 TSU_MILIF_OMXILIF MM-MILIF-DUMMYOMXILIF-U-0003 +TEST_COMPLETE + +//------------------------------------------------------------------------------------------// +// TEST STEP: TSU_MILIF_OMXILIF MM-MILIF-DUMMYOMXILIF-U-0004 +// RTestStepMILIFCommands: To test sending commands to the IL component through MILIF. +// 1. Create an instance of the KUidOmxILAudioDecGenericIf test ECOM plugin interface. +// 2. Use the interface to instanciate a dummy omx component. +// 3. Set the role of the interface to "aac decoder". +// 4. Trigger FlushAllPorts +// 5. Trigger SendCommand() with ECommandPortDisable +//------------------------------------------------------------------------------------------// +//! @SYMTestCaseID MM-MILIF-DUMMYOMXILIF-U-0004 + +RUN_TEST_STEP -1 TSU_MILIF_OMXILIF MM-MILIF-DUMMYOMXILIF-U-0004 +TEST_COMPLETE + +//------------------------------------------------------------------------------------------// +// TEST STEP: TSU_MILIF_OMXILIF MM-MILIF-DUMMYOMXILIF-U-0005 +// RTestStepMILIFExtensions: To test configuration of the IL component with extended params through MILIF. +// 1. Create an instance of the KUidOmxILAudioDecGenericIf test ECOM plugin interface. +// 2. Use the interface to instanciate a dummy omx component. +// 3. Set the role of the interface to "aac decoder". +// 4. Get Component Input ports through interface. +// 5a. Set a (partial) config port parameter through the interface's extension mechanism. +// 5b. Get the parameter set in 5a through the interface's extension mechanism. +//------------------------------------------------------------------------------------------// +//! @SYMTestCaseID MM-MILIF-DUMMYOMXILIF-U-0005 + +RUN_TEST_STEP -1 TSU_MILIF_OMXILIF MM-MILIF-DUMMYOMXILIF-U-0005 +TEST_COMPLETE + +//------------------------------------------------------------------------------------------// +// TEST STEP: TSU_MILIF_OMXILIF MM-MILIF-DUMMYOMXILIF-U-0006 +// RTestStepMILIFComponentRole: To test access to the IL component role through MILIF. +// 1. Create an instance of the KUidOmxILAudioDecGenericIf test ECOM plugin interface. +// 2. Use the interface to instanciate a dummy omx component. +// 3. Set the role of the interface to "aac decoder". +// 4. Get component role through interface. +// 5. Check the component's role returned is the expected role +//------------------------------------------------------------------------------------------// +//! @SYMTestCaseID MM-MILIF-DUMMYOMXILIF-U-0006 + +RUN_TEST_STEP -1 TSU_MILIF_OMXILIF MM-MILIF-DUMMYOMXILIF-U-0006 +TEST_COMPLETE + + +// End of Test Script diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/unittest/src/tsu_milif_omxiliftests.cpp --- a/omxil/mmilapi/unittest/src/tsu_milif_omxiliftests.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/unittest/src/tsu_milif_omxiliftests.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,1093 +1,1093 @@ -// 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: -// Implementation of Unit test step classes for MILIF testing. -// -// - -#include "tsu_milif_omxiliftests.h" -#include "iltestuids.hrh" -#include "ilcomponentif.h" -#include "tilstructtypes.h" -#include "tomxilstruct.h" -#include - -_LIT8(KDummyDecoderILComponentName,"OMX.SYMBIAN.AUDIO.DECODER.DUMMY"); -_LIT8(KExtensionPortDefinitionName,"OMX.CompanyXYZ.index.param.PortDefinition"); -_LIT8(KFakeRole,"audio_decoder.vrb"); - -const TUid KUidFormatAAC = {0x1028347C}; - -const TInt KMaxComponentRoleLength = 128; - -const TInt KZerothPort = 0; - - -// -// RTestStepMILIFBase: Base class for all RTestStepMILIF* tests -// - -/* - * - * RTestStepMILIFBase - Test step constructor - * - */ -RTestStepMILIFBase::RTestStepMILIFBase(const TDesC& aTestName) -:RAsyncTestStep() - { - iTestStepName = aTestName; - } - -/* - * - * KickoffTestL - Starts the test - * - */ -void RTestStepMILIFBase::KickoffTestL() - { - __MM_HEAP_MARK; - - DoKickoffTestL(); - DoTestBody(); - } - -/* - * - * DoKickoffTestL - * - */ -void RTestStepMILIFBase::DoKickoffTestL() - { - OMX_Init(); - - if ((iTestStepName == _L("MM-MILIF-DUMMYOMXILIF-U-0001"))|| - (iTestStepName == _L("MM-MILIF-DUMMYOMXILIF-U-0002"))|| - (iTestStepName == _L("MM-MILIF-DUMMYOMXILIF-U-0003"))|| - (iTestStepName == _L("MM-MILIF-DUMMYOMXILIF-U-0004"))|| - (iTestStepName == _L("MM-MILIF-DUMMYOMXILIF-U-0005"))|| - (iTestStepName == _L("MM-MILIF-DUMMYOMXILIF-U-0006"))) - { - INFO_PRINTF1(_L("1. Create an instance of the KUidOmxILAudioDecGenericIf test ECOM plugin interface.")); - TRAPD(error, iDummyComponent = CILComponentIf::CreateImplementationL(TUid::Uid(KUidOmxILDummyAudioDecMILIFPlugin))); - if(error != KErrNone) - { - ERR_PRINTF2(_L(" ERROR! - Could not instantiate the generic audio decoder OMX IL test ECOM plugin interface: error = %d"), error); - StopTest(error, EFail); - return; - } - - INFO_PRINTF1(_L("2. Use the interface to instanciate a dummy omx component.")); - TRAP(error, iDummyComponent->CreateComponentL(KDummyDecoderILComponentName, *this)); - if(error != KErrNone) - { - ERR_PRINTF2(_L(" ERROR! - Could not create omx component: error = %d"), error); - StopTest(error, EFail); - return; - } - - INFO_PRINTF1(_L("3. Set the role of the interface.")); - error = iDummyComponent->SetComponentIfRole(KUidFormatAAC); - if(error != KErrNone) - { - ERR_PRINTF2(_L(" ERROR! - Could not set the role of the interface: error = %d"), error); - StopTest(error, EFail); - } - } - else - { - StopTest(KErrGeneral, EFail); - } - } - -/* - * - * DoTestBodyL - * - */ -void RTestStepMILIFBase::DoTestBody() - { - // Nothing to do in the base class - } - -/* - * - * CloseTest - * - */ -void RTestStepMILIFBase::CloseTest() - { - if (iDummyComponent) - { - iDummyComponent->ReleaseComponent(); - iDummyComponent = NULL; - } - - iComponentInPortIf = NULL; - iComponentOutPortIf = NULL; - - OMX_Deinit(); - - __MM_HEAP_MARKEND; - } - -/* - * - * MsgFromILComponent - Callback from component for component events - * - */ -TInt RTestStepMILIFBase::MsgFromILComponent(const MILComponentIf* /*aComponent*/, const TILEvent& /*aEvent*/) - { - // Nothing to do in the base class - return KErrNotSupported; - } - -/* - * - * BufferDelivered - Callback from component for buffer delivered events - * - */ -TInt RTestStepMILIFBase::BufferDelivered(const MILComponentPortIf* /*aPort*/, const CMMFBuffer* /*aBuffer*/) - { - // Nothing to do in the base class - return KErrNotSupported; - } - - -// -// RTestStepMILIFPorts: To test access to IL component ports through MILIF. -// - -/* - * - * RTestStepMILIFPorts - Test step constructor - * - */ -RTestStepMILIFPorts::RTestStepMILIFPorts(const TDesC& aTestName) - :RTestStepMILIFBase(aTestName) - { - } - -/* - * - * NewL - * - */ -RTestStepMILIFPorts* RTestStepMILIFPorts::NewL(const TDesC& aTestName) - { - return (new (ELeave) RTestStepMILIFPorts(aTestName)); - } - -/* - * - * DoKickoffTestL - * - */ -void RTestStepMILIFPorts::DoKickoffTestL() - { - INFO_PRINTF1(_L("RTestStepMILIFPorts: To test access to IL component ports through MILIF interface.")); - - RTestStepMILIFBase::DoKickoffTestL(); - } - -/* - * - * DoTestBodyL - * - */ -void RTestStepMILIFPorts::DoTestBody() - { - RPointerArray ifPorts; - - INFO_PRINTF1(_L("4. Get Component Input ports through MILIF interface.")); - TInt error = iDummyComponent->GetComponentInputPorts(ifPorts); - if (error == KErrNone && ifPorts.Count() == 1) - { - iComponentInPortIf = ifPorts[KZerothPort]; - ifPorts.Close(); - } - else - { - if (ifPorts.Count() != 1) - { - error = KErrNotFound; - } - ifPorts.Close(); - ERR_PRINTF2(_L(" ERROR! - Fail to grab input ports: error = %d"), error); - StopTest(error, EFail); - return; - } - - - INFO_PRINTF1(_L("5. Get Component Output ports through MILIF interface.")); - error = iDummyComponent->GetComponentOutputPorts(ifPorts); - if (error == KErrNone && ifPorts.Count() > 0) - { - iComponentOutPortIf = ifPorts[KZerothPort]; - ifPorts.Close(); - } - else - { - if (ifPorts.Count() != 1) - { - error = KErrNotFound; - } - ifPorts.Close(); - ERR_PRINTF2(_L(" ERROR! - Fail to grab output ports: error = %d"), error); - StopTest(error, EFail); - return; - } - StopTest(KErrNone); - } - - -// -// RTestStepMILIFConfig: To test configuration of IL component through MILIF. -// - -/* - * - * RTestStepMILIFConfig - Test step constructor - * - */ -RTestStepMILIFConfig::RTestStepMILIFConfig(const TDesC& aTestName) -:RTestStepMILIFBase(aTestName) - { - } - -/* - * - * NewL - * - */ -RTestStepMILIFConfig* RTestStepMILIFConfig::NewL(const TDesC& aTestName) - { - RTestStepMILIFConfig* self = new (ELeave) RTestStepMILIFConfig(aTestName); - return self; - } - -/* - * - * DoKickoffTestL - * - */ -void RTestStepMILIFConfig::DoKickoffTestL() - { - INFO_PRINTF1(_L("RTestStepMILIFConfig: To test configuration of the IL component through MILIF interface.")); - - RTestStepMILIFBase::DoKickoffTestL(); - } - -/* - * - * DoTestBodyL - - * - */ -void RTestStepMILIFConfig::DoTestBody() - { - TInt error = KErrNone; - - INFO_PRINTF1(_L("4. Get Component Input ports through MILIF interface.")); - RPointerArray ifPorts; - error = iDummyComponent->GetComponentInputPorts(ifPorts); - if (error == KErrNone && ifPorts.Count() == 1) - { - iComponentInPortIf = ifPorts[KZerothPort]; - ifPorts.Close(); - } - else - { - if (ifPorts.Count() != 1) - { - error = KErrNotFound; - } - ifPorts.Close(); - ERR_PRINTF2(_L(" ERROR! - Fail to grab input ports: error = %d"), error); - StopTest(error, EFail); - return; - } - - INFO_PRINTF1(_L("5a. Set a (partial) config port parameter through the interface.")); - INFO_PRINTF1(_L(" Using TPortDefinitionType and TILPortDefinition.")); - TPortDefinitionType partialConfig_s; - partialConfig_s.nBufferCountActual = 1; - TILPortDefinition paramStruct_s(partialConfig_s); - error = iDummyComponent->SetConfig(paramStruct_s, iComponentInPortIf); - if (error != KErrNone) - { - ERR_PRINTF2(_L(" ERROR! - Fail to set TILPortDefinition: error = %d"), error); - StopTest(error, EFail); - return; - } - - INFO_PRINTF1(_L("5b. Now Get the TPortDefinitionType config parameter through the interface.")); - TILPortDefinition paramStruct_g; - TPortDefinitionType* partialConfig_g = NULL; - error = iDummyComponent->GetConfig(paramStruct_g, iComponentInPortIf); - if (error != KErrNone) - { - ERR_PRINTF2(_L(" ERROR! - Fail to get TILPortDefinition: error = %d"), error); - StopTest(error, EFail); - return; - } - partialConfig_g = TILPortDefinition::GetStructure(paramStruct_g); - if(partialConfig_g->nBufferCountActual != 1) - { - ERR_PRINTF1(_L(" ERROR! - Unexpected value. The get value does not match the value set.")); - StopTest(KErrCorrupt, EFail); - return; - } - - if ((iTestStepName == _L("MM-MILIF-DUMMYOMXILIF-U-0002"))) - { - INFO_PRINTF1(_L("6a. Configure component through the interface.")); - INFO_PRINTF1(_L(" Using TOMXILStructParam and TILPortDefinition.")); - OMX_PARAM_PORTDEFINITIONTYPE omxconfig_s; - omxconfig_s.nBufferCountActual = 3; - TOMXILStructParam omxParamStruct_s(&omxconfig_s, OMX_IndexParamPortDefinition); - error = iDummyComponent->SetConfig(omxParamStruct_s, iComponentInPortIf); - if (error != KErrNone) - { - ERR_PRINTF2(_L(" ERROR! - Fail to set TOMXILStructParam: error = %d"), error); - StopTest(error, EFail); - return; - } - - INFO_PRINTF1(_L("6b. Now Get the TOMXILStructParam config parameter through the interface.")); - OMX_PARAM_PORTDEFINITIONTYPE omxconfig_g; - TOMXILStructParam omxParamStruct_g(&omxconfig_g, OMX_IndexParamPortDefinition); - error = iDummyComponent->GetConfig(omxParamStruct_g, iComponentInPortIf); - if (error != KErrNone) - { - ERR_PRINTF2(_L(" ERROR! - Fail to get TOMXILStructParam: error = %d"), error); - StopTest(error, EFail); - return; - } - if(omxconfig_g.nBufferCountActual != 3) - { - ERR_PRINTF1(_L(" ERROR! - Unexpected value. The get value does not match the value set.")); - StopTest(KErrCorrupt, EFail); - return; - } - } - - StopTest(KErrNone); - } - - -// -// RTestStepMILIFStates: To test driving the IL component state machine through MILIF. -// - -/* - * - * RTestStepMILIFStates - Test step constructor - * - */ -RTestStepMILIFStates::RTestStepMILIFStates(const TDesC& aTestName) -:RTestStepMILIFBase(aTestName) - { - } - -/* - * - * NewL - * - */ -RTestStepMILIFStates* RTestStepMILIFStates::NewL(const TDesC& aTestName) - { - RTestStepMILIFStates* self = new (ELeave) RTestStepMILIFStates(aTestName); - return self; - } - -/* - * - * DoKickoffTestL - * - */ -void RTestStepMILIFStates::DoKickoffTestL() - { - INFO_PRINTF1(_L("RTestStepMILIFStates: To test driving the IL component state machine through MILIF interface.")); - - RTestStepMILIFBase::DoKickoffTestL(); - } - -/* - * - * DoTestBodyL - - * - */ -void RTestStepMILIFStates::DoTestBody() - { - Fsm(EEventInit, KErrNone); - } - -/* - * - * Fsm - Executes this test events in sequence - * - * - */ -void RTestStepMILIFStates::Fsm(TTestEvents aEvent, TInt aError) - { - TInt error = KErrNone; - - switch (iTestState) - { - case ETestStateStart: - { - if (aEvent == EEventInit) - { - INFO_PRINTF1(_L("4. Trigger transition from Load to Idle in component by calling Initialize()")); - error = iDummyComponent->Initialize(); - if (error != KErrNone) - { - ERR_PRINTF2(_L(" ERROR! - MILComponentIf::Initialize() error = %d"), error); - StopTest(error, EFail); - break; - } - INFO_PRINTF1(_L(" -> Test State: EStatePlayInitializing")); - iTestState = ETestStateInitializing; - } - else - { - ERR_PRINTF2(_L(" ERROR! - ETestStateStart did not received expected event. Received event: %d"), aEvent); - StopTest(aError, EFail); - } - break; - } - - case ETestStateInitializing: - { - if (aEvent == EEventInitComplete) - { - INFO_PRINTF1(_L("5a. Check the component was left in the correct state after EEventInitComplete event")); - TILComponentState aState; - error = iDummyComponent->GetState(aState); - if ((error != KErrNone) || (aState != EComponentIdle)) - { - ERR_PRINTF3(_L(" ERROR! - MILComponentIf::GetState Incorrect state = %d, error = %d."), error, aState); - if (aState != EComponentIdle) - { - error = KErrGeneral; - } - StopTest(error, EFail); - break; - } - - INFO_PRINTF1(_L("5b. Trigger transition from Idle to Execute in component by calling Execute()")); - error = iDummyComponent->Execute(); - if (error != KErrNone) - { - ERR_PRINTF2(_L(" ERROR! - MILComponentIf::Execute() error = %d"), error); - StopTest(error, EFail); - break; - } - INFO_PRINTF1(_L(" -> Test State: EStatePlayInitialized")); - iTestState = ETestStateInitialized; - } - else - { - ERR_PRINTF2(_L(" ERROR! - ETestStateInitializing did not received expected event. Received event: %d"), aEvent); - StopTest(aError, EFail); - } - break; - } - - case ETestStateInitialized: - { - if (aEvent == EEventExecuteComplete) - { - INFO_PRINTF1(_L("6a. Check the component was left in the correct state after EEventExecuteComplete event")); - TILComponentState aState; - error = iDummyComponent->GetState(aState); - if ((error != KErrNone) || (aState != EComponentExecuting)) - { - ERR_PRINTF3(_L(" ERROR! - MILComponentIf::GetState Incorrect state = %d, error = %d."), error, aState); - if (aState != EComponentExecuting) - { - error = KErrGeneral; - } - StopTest(error, EFail); - break; - } - - INFO_PRINTF1(_L("6b. Trigger transition from Executing to Pause in component by calling Pause()")); - error = iDummyComponent->Pause(); - if (error != KErrNone) - { - ERR_PRINTF2(_L(" ERROR! - MILComponentIf::Pause() error = %d"), error); - StopTest(error, EFail); - break; - } - INFO_PRINTF1(_L(" -> Test State: EStatePlayPausing")); - iTestState = ETestStatePausing; - } - else - { - ERR_PRINTF2(_L(" ERROR! - ETestStateInitialized did not received expected event. Received event: %d"), aEvent); - StopTest(aError, EFail); - } - break; - } - - case ETestStatePausing: - { - if (aEvent == EEventPauseComplete) - { - INFO_PRINTF1(_L("7a. Check the component was left in the correct state after EEventPauseComplete event")); - TILComponentState aState; - error = iDummyComponent->GetState(aState); - if ((error != KErrNone) || (aState != EComponentPaused)) - { - ERR_PRINTF3(_L(" ERROR! - MILComponentIf::GetState error = %d, state = %d"), error, aState); - if (aState != EComponentPaused) - { - error = KErrGeneral; - } - StopTest(error, EFail); - break; - } - - INFO_PRINTF1(_L("7b. Trigger transition from Pause to Idle in component by calling Stop()")); - error = iDummyComponent->Stop(); - if (error != KErrNone) - { - ERR_PRINTF2(_L(" ERROR! - MILComponentIf::Stop() error = %d"), error); - StopTest(error, EFail); - break; - } - INFO_PRINTF1(_L(" -> Test State: ETestStateStopping")); - iTestState = ETestStateStopping; - } - else - { - ERR_PRINTF2(_L(" ERROR! - ETestStatePausing did not received expected event. Received event: %d"), aEvent); - StopTest(aError, EFail); - } - break; - } - - case ETestStateStopping: - { - if (aEvent == EEventStopComplete) - { - INFO_PRINTF1(_L("8. Check the component was left in the correct state after EEventStopComplete event")); - TILComponentState aState; - error = iDummyComponent->GetState(aState); - if ((error != KErrNone) || (aState != EComponentIdle)) - { - ERR_PRINTF3(_L(" ERROR! - MILComponentIf::GetState error = %d, state = %d"), error, aState); - if (aState != EComponentIdle) - { - error = KErrGeneral; - } - StopTest(error, EFail); - break; - } - StopTest(KErrNone); - } - else - { - ERR_PRINTF2(_L(" ERROR! - ETestStateStopping did not received expected event. Received event: %d"), aEvent); - StopTest(aError, EFail); - } - break; - } - - default: - { - ERR_PRINTF2(_L(" ERROR! - Invalid state received: %d"), iTestState); - StopTest(KErrGeneral, EFail); - } - } - - } - -/* - * - * MsgFromILComponent - - * - */ -TInt RTestStepMILIFStates::MsgFromILComponent(const MILComponentIf* aComponent, const TILEvent& aEvent) - { - TInt error = KErrNone; - - if (aComponent != iDummyComponent) - { - ERR_PRINTF1(_L(" ERROR! - Invalid callback received")); - StopTest(KErrGeneral, EFail); - return KErrGeneral; - } - - switch (aEvent.iEvent) - { - case EEventCmdComplete: - { - if (aEvent.iData1 == ECommandStateSet) - { - if (aEvent.iData2 == EComponentIdle) - { - INFO_PRINTF1(_L(" MsgFromILComponent:EEventCmdComplete -> EComponentIdle received")); - if (iTestState == ETestStateInitializing) - { - Fsm(EEventInitComplete, KErrNone); - } - else if (iTestState == ETestStateStopping) - { - Fsm(EEventStopComplete, KErrNone); - } - else - { - ERR_PRINTF1(_L(" ERROR! - Unexpected callback received")); - error = KErrGeneral; - } - } - else if(aEvent.iData2 == EComponentExecuting) - { - INFO_PRINTF1(_L(" MsgFromILComponent:EEventCmdComplete -> EComponentExecuting received")); - if (iTestState == ETestStateInitialized) - { - Fsm(EEventExecuteComplete, KErrNone); - } - else - { - ERR_PRINTF1(_L(" ERROR! - Unexpected callback received")); - error = KErrGeneral; - } - } - else if(aEvent.iData2 == EComponentPaused) - { - INFO_PRINTF1(_L(" MsgFromILComponent:EEventCmdComplete -> EComponentPaused received")); - if (iTestState == ETestStatePausing) - { - Fsm(EEventPauseComplete, KErrNone); - } - else - { - ERR_PRINTF1(_L(" ERROR! - Unexpected callback received")); - error = KErrGeneral; - } - } - else - { - ERR_PRINTF1(_L(" ERROR! - Unexpected callback received")); - error = KErrGeneral; - } - break; - } - } - default: - { - ERR_PRINTF1(_L(" ERROR! - Unexpected callback received")); - error = KErrNotSupported; - } - } - - if (error != KErrNone) - { - StopTest(error, EFail); - } - return error; - } - - -// -// RTestStepMILIFCommands: To test sending commands to the IL component through MILIF. -// - -/* - * - * RTestStepMILIFCommands - Test step constructor - * - */ -RTestStepMILIFCommands::RTestStepMILIFCommands(const TDesC& aTestName) -:RTestStepMILIFBase(aTestName) - { - } - -/* - * - * NewL - * - */ -RTestStepMILIFCommands* RTestStepMILIFCommands::NewL(const TDesC& aTestName) - { - RTestStepMILIFCommands* self = new (ELeave) RTestStepMILIFCommands(aTestName); - return self; - } - -/* - * - * DoKickoffTestL - * - */ -void RTestStepMILIFCommands::DoKickoffTestL() - { - INFO_PRINTF1(_L("RTestStepMILIFCommands: To test sending commands to the IL component through MILIF interface.")); - - RTestStepMILIFBase::DoKickoffTestL(); - } - -/* - * - * DoTestBodyL - - * - */ -void RTestStepMILIFCommands::DoTestBody() - { - Fsm(EEventInit, KErrNone); - } - -/* - * - * Fsm - Executes this test events in sequence - * - */ -void RTestStepMILIFCommands::Fsm(TTestEvents aEvent, TInt aError) - { - TInt error = KErrNone; - - switch (iTestState) - { - case ETestStateStart: - { - if (aEvent == EEventInit) - { - INFO_PRINTF1(_L("4. Trigger FlushAllPorts")); - error = iDummyComponent->FlushAllPorts(); - if (error != KErrNone) - { - ERR_PRINTF2(_L(" ERROR! - MILComponentIf::FlushAllPorts error = %d"), error); - StopTest(error, EFail); - break; - } - INFO_PRINTF1(_L(" -> Test State: ETestStateFlushing")); - iTestState = ETestStateFlushing; - } - else - { - ERR_PRINTF2(_L(" ERROR! - ETestStateFlushing did not received expected event. Received event: %d"), aEvent); - StopTest(aError, EFail); - } - break; - } - - case ETestStateFlushing: - { - if (aEvent == EEventFlushComplete) - { - INFO_PRINTF1(_L(" Flush Command partially completed.")); - INFO_PRINTF1(_L(" -> Test State: ETestStateFirstPortFlushed")); - iTestState = ETestStateFirstPortFlushed; - } - else - { - ERR_PRINTF2(_L(" ERROR! - ETestStateFlushing did not received expected event. Received event: %d"), aEvent); - StopTest(aError, EFail); - } - break; - } - - case ETestStateFirstPortFlushed: - { - if (aEvent == EEventFlushComplete) - { - INFO_PRINTF1(_L(" Flush Command completed.")); - INFO_PRINTF1(_L("5. Trigger SendCommand() with ECommandPortDisable")); - TILCommand aCommand; - aCommand.iCmd = ECommandPortDisable; - aCommand.iData1 = 0; - aCommand.iExtraData = NULL; - error = iDummyComponent->SendCommand(aCommand); - - INFO_PRINTF1(_L(" -> Test State: ETestStateDisablingPort")); - iTestState = ETestStateDisablingPort; - } - else - { - ERR_PRINTF2(_L(" ERROR! - ETestStateFirstPortFlushed did not received expected event. Received event: %d"), aEvent); - StopTest(aError, EFail); - } - break; - } - - case ETestStateDisablingPort: - { - if (aEvent == EEventPortDisableComplete) - { - INFO_PRINTF1(_L(" -> Test State: Port Disabled. Fisnished Test")); - StopTest(KErrNone); - } - else - { - ERR_PRINTF2(_L(" ERROR! - ETestStateInitialized did not received expected event. Received event: %d"), aEvent); - StopTest(aError, EFail); - } - break; - } - - default: - { - ERR_PRINTF2(_L(" ERROR! - Invalid state received: %d"), iTestState); - StopTest(KErrGeneral, EFail); - } - } - } - -/* - * - * MsgFromILComponent - - * - */ -TInt RTestStepMILIFCommands::MsgFromILComponent(const MILComponentIf* aComponent, const TILEvent& aEvent) - { - TInt error = KErrNone; - - if (aComponent != iDummyComponent) - { - ERR_PRINTF1(_L(" ERROR! - Invalid callback received")); - StopTest(KErrGeneral, EFail); - return KErrGeneral; - } - - switch (aEvent.iEvent) - { - case EEventCmdComplete: - { - if (aEvent.iData1 == ECommandFlush) - { - INFO_PRINTF1(_L(" MsgFromILComponent:EEventCmdComplete -> ECommandFlush received")); - Fsm(EEventFlushComplete, KErrNone); - } - else if (aEvent.iData1 == ECommandPortDisable) - { - INFO_PRINTF1(_L(" MsgFromILComponent:EEventCmdComplete -> ECommandPortDisable received")); - Fsm(EEventPortDisableComplete, KErrNone); - } - else - { - ERR_PRINTF1(_L(" ERROR! - Unexpected callback received")); - error = KErrGeneral; - } - break; - } - default: - { - ERR_PRINTF1(_L(" ERROR! - Unexpected callback received")); - error = KErrNotSupported; - } - } - - if (error != KErrNone) - { - StopTest(error, EFail); - } - return error; - } - - -// -// RTestStepMILIFExtensions: To test configuration of the IL component with extended params through MILIF. -// - -/* - * - * RTestStepMILIFExtensions - Test step constructor - * - */ -RTestStepMILIFExtensions::RTestStepMILIFExtensions(const TDesC& aTestName) -:RTestStepMILIFBase(aTestName) - { - } - -/* - * - * NewL - * - */ -RTestStepMILIFExtensions* RTestStepMILIFExtensions::NewL(const TDesC& aTestName) - { - RTestStepMILIFExtensions* self = new (ELeave) RTestStepMILIFExtensions(aTestName); - return self; - } - -/* - * - * DoKickoffTestL - * - */ -void RTestStepMILIFExtensions::DoKickoffTestL() - { - INFO_PRINTF1(_L("RTestStepMILIFExtensions: To test configuration of the IL component with extended params through MILIF interface.")); - - RTestStepMILIFBase::DoKickoffTestL(); - } - -/* - * - * DoTestBodyL - - * - */ -void RTestStepMILIFExtensions::DoTestBody() - { - - TInt error = KErrNone; - - INFO_PRINTF1(_L("4. Get Component Input ports through MILIF interface.")); - RPointerArray ifPorts; - error = iDummyComponent->GetComponentInputPorts(ifPorts); - if (error == KErrNone && ifPorts.Count() == 1) - { - iComponentInPortIf = ifPorts[KZerothPort]; - ifPorts.Close(); - } - else - { - if (ifPorts.Count() != 1) - { - error = KErrNotFound; - } - ifPorts.Close(); - StopTest(error, EFail); - return; - } - - INFO_PRINTF1(_L("5a. Set a (partial) config port parameter through the interface's extension mechanism.")); - TPortDefinitionType partialConfig_s; - partialConfig_s.nBufferCountActual = 1; - TILPortDefinition paramStruct_s(partialConfig_s); - error = iDummyComponent->SetExtConfig(KExtensionPortDefinitionName, paramStruct_s, iComponentInPortIf); - if ((iTestStepName == _L("MM-MILIF-DUMMYOMXILIF-U-0005"))) - { - if (error != KErrNone) - { - ERR_PRINTF2(_L(" ERROR! - Fail to set extension: error = %d"), error); - StopTest(error, EFail); - return; - } - } - else - { - StopTest(KErrGeneral, EFail); - } - - INFO_PRINTF1(_L("5b. Get the parameter set in 5a through the interface's extension mechanism.")); - TILPortDefinition paramStruct_g; - TPortDefinitionType* partialConfig_g = NULL; - error = iDummyComponent->GetExtConfig(KExtensionPortDefinitionName, paramStruct_g, iComponentInPortIf); - if ((iTestStepName == _L("MM-MILIF-DUMMYOMXILIF-U-0005"))) - { - if (error != KErrNone) - { - ERR_PRINTF2(_L(" ERROR! - Fail to get TILPortDefinition: error = %d"), error); - StopTest(error, EFail); - return; - } - partialConfig_g = TILPortDefinition::GetStructure(paramStruct_g); - if(partialConfig_g->nBufferCountActual != 1) - { - ERR_PRINTF1(_L(" ERROR! - Unexpected value. The get value does not match the value set.")); - StopTest(KErrCorrupt, EFail); - return; - } - } - else - { - StopTest(KErrGeneral, EFail); - return; - } - - StopTest(KErrNone); - } - - -// -// RTestStepMILIFComponentRole: To test access to the IL component role through MILIF. -// - -/* - * - * RTestStepMILIFComponentRole - Test step constructor - * - */ -RTestStepMILIFComponentRole::RTestStepMILIFComponentRole(const TDesC& aTestName) -:RTestStepMILIFBase(aTestName) - { - } - -/* - * - * NewL - * - */ -RTestStepMILIFComponentRole* RTestStepMILIFComponentRole::NewL(const TDesC& aTestName) - { - RTestStepMILIFComponentRole* self = new (ELeave) RTestStepMILIFComponentRole(aTestName); - return self; - } - -/* - * - * DoKickoffTestL - * - */ -void RTestStepMILIFComponentRole::DoKickoffTestL() - { - INFO_PRINTF1(_L("RTestStepMILIFComponentRole: To test access to the IL component role through MILIF interface.")); - - RTestStepMILIFBase::DoKickoffTestL(); - } - -/* - * - * DoTestBodyL - - * - */ -void RTestStepMILIFComponentRole::DoTestBody() - { - TInt error = KErrNone; - TInt index = 0; - - HBufC8* buf = HBufC8::New(KMaxComponentRoleLength); - if (buf == NULL) - { - StopTest(KErrNoMemory, EFail); - } - else - { - TPtr8 componentRole = buf->Des(); - - INFO_PRINTF1(_L("4. Get component role through MILIF interface.")); - error = iDummyComponent->ComponentRoleEnum(componentRole, index); - - INFO_PRINTF1(_L("5. Check the component's role returned is the expected role.")); - if (error != KErrNone) - { - ERR_PRINTF2(_L(" ERROR! - MILComponentIf::ComponentRoleEnum failed. Error returned = %d"), error); - StopTest(error, EFail); - delete buf; - return; - } - else if (buf->Compare(KFakeRole) != 0 ) - { - ERR_PRINTF1(_L(" ERROR! - MILComponentIf::ComponentRoleEnum failed. Unexpected role.")); - StopTest(error, EFail); - delete buf; - return; - } - StopTest(KErrNone); - - delete buf; - } - } - +// 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: +// Implementation of Unit test step classes for MILIF testing. +// +// + +#include "tsu_milif_omxiliftests.h" +#include "iltestuids.hrh" +#include "ilcomponentif.h" +#include "tilstructtypes.h" +#include "tomxilstruct.h" +#include + +_LIT8(KDummyDecoderILComponentName,"OMX.SYMBIAN.AUDIO.DECODER.DUMMY"); +_LIT8(KExtensionPortDefinitionName,"OMX.CompanyXYZ.index.param.PortDefinition"); +_LIT8(KFakeRole,"audio_decoder.vrb"); + +const TUid KUidFormatAAC = {0x1028347C}; + +const TInt KMaxComponentRoleLength = 128; + +const TInt KZerothPort = 0; + + +// +// RTestStepMILIFBase: Base class for all RTestStepMILIF* tests +// + +/* + * + * RTestStepMILIFBase - Test step constructor + * + */ +RTestStepMILIFBase::RTestStepMILIFBase(const TDesC& aTestName) +:RAsyncTestStep() + { + iTestStepName = aTestName; + } + +/* + * + * KickoffTestL - Starts the test + * + */ +void RTestStepMILIFBase::KickoffTestL() + { + __MM_HEAP_MARK; + + DoKickoffTestL(); + DoTestBody(); + } + +/* + * + * DoKickoffTestL + * + */ +void RTestStepMILIFBase::DoKickoffTestL() + { + OMX_Init(); + + if ((iTestStepName == _L("MM-MILIF-DUMMYOMXILIF-U-0001"))|| + (iTestStepName == _L("MM-MILIF-DUMMYOMXILIF-U-0002"))|| + (iTestStepName == _L("MM-MILIF-DUMMYOMXILIF-U-0003"))|| + (iTestStepName == _L("MM-MILIF-DUMMYOMXILIF-U-0004"))|| + (iTestStepName == _L("MM-MILIF-DUMMYOMXILIF-U-0005"))|| + (iTestStepName == _L("MM-MILIF-DUMMYOMXILIF-U-0006"))) + { + INFO_PRINTF1(_L("1. Create an instance of the KUidOmxILAudioDecGenericIf test ECOM plugin interface.")); + TRAPD(error, iDummyComponent = CILComponentIf::CreateImplementationL(TUid::Uid(KUidOmxILDummyAudioDecMILIFPlugin))); + if(error != KErrNone) + { + ERR_PRINTF2(_L(" ERROR! - Could not instantiate the generic audio decoder OMX IL test ECOM plugin interface: error = %d"), error); + StopTest(error, EFail); + return; + } + + INFO_PRINTF1(_L("2. Use the interface to instanciate a dummy omx component.")); + TRAP(error, iDummyComponent->CreateComponentL(KDummyDecoderILComponentName, *this)); + if(error != KErrNone) + { + ERR_PRINTF2(_L(" ERROR! - Could not create omx component: error = %d"), error); + StopTest(error, EFail); + return; + } + + INFO_PRINTF1(_L("3. Set the role of the interface.")); + error = iDummyComponent->SetComponentIfRole(KUidFormatAAC); + if(error != KErrNone) + { + ERR_PRINTF2(_L(" ERROR! - Could not set the role of the interface: error = %d"), error); + StopTest(error, EFail); + } + } + else + { + StopTest(KErrGeneral, EFail); + } + } + +/* + * + * DoTestBodyL + * + */ +void RTestStepMILIFBase::DoTestBody() + { + // Nothing to do in the base class + } + +/* + * + * CloseTest + * + */ +void RTestStepMILIFBase::CloseTest() + { + if (iDummyComponent) + { + iDummyComponent->ReleaseComponent(); + iDummyComponent = NULL; + } + + iComponentInPortIf = NULL; + iComponentOutPortIf = NULL; + + OMX_Deinit(); + + __MM_HEAP_MARKEND; + } + +/* + * + * MsgFromILComponent - Callback from component for component events + * + */ +TInt RTestStepMILIFBase::MsgFromILComponent(const MILComponentIf* /*aComponent*/, const TILEvent& /*aEvent*/) + { + // Nothing to do in the base class + return KErrNotSupported; + } + +/* + * + * BufferDelivered - Callback from component for buffer delivered events + * + */ +TInt RTestStepMILIFBase::BufferDelivered(const MILComponentPortIf* /*aPort*/, const CMMFBuffer* /*aBuffer*/) + { + // Nothing to do in the base class + return KErrNotSupported; + } + + +// +// RTestStepMILIFPorts: To test access to IL component ports through MILIF. +// + +/* + * + * RTestStepMILIFPorts - Test step constructor + * + */ +RTestStepMILIFPorts::RTestStepMILIFPorts(const TDesC& aTestName) + :RTestStepMILIFBase(aTestName) + { + } + +/* + * + * NewL + * + */ +RTestStepMILIFPorts* RTestStepMILIFPorts::NewL(const TDesC& aTestName) + { + return (new (ELeave) RTestStepMILIFPorts(aTestName)); + } + +/* + * + * DoKickoffTestL + * + */ +void RTestStepMILIFPorts::DoKickoffTestL() + { + INFO_PRINTF1(_L("RTestStepMILIFPorts: To test access to IL component ports through MILIF interface.")); + + RTestStepMILIFBase::DoKickoffTestL(); + } + +/* + * + * DoTestBodyL + * + */ +void RTestStepMILIFPorts::DoTestBody() + { + RPointerArray ifPorts; + + INFO_PRINTF1(_L("4. Get Component Input ports through MILIF interface.")); + TInt error = iDummyComponent->GetComponentInputPorts(ifPorts); + if (error == KErrNone && ifPorts.Count() == 1) + { + iComponentInPortIf = ifPorts[KZerothPort]; + ifPorts.Close(); + } + else + { + if (ifPorts.Count() != 1) + { + error = KErrNotFound; + } + ifPorts.Close(); + ERR_PRINTF2(_L(" ERROR! - Fail to grab input ports: error = %d"), error); + StopTest(error, EFail); + return; + } + + + INFO_PRINTF1(_L("5. Get Component Output ports through MILIF interface.")); + error = iDummyComponent->GetComponentOutputPorts(ifPorts); + if (error == KErrNone && ifPorts.Count() > 0) + { + iComponentOutPortIf = ifPorts[KZerothPort]; + ifPorts.Close(); + } + else + { + if (ifPorts.Count() != 1) + { + error = KErrNotFound; + } + ifPorts.Close(); + ERR_PRINTF2(_L(" ERROR! - Fail to grab output ports: error = %d"), error); + StopTest(error, EFail); + return; + } + StopTest(KErrNone); + } + + +// +// RTestStepMILIFConfig: To test configuration of IL component through MILIF. +// + +/* + * + * RTestStepMILIFConfig - Test step constructor + * + */ +RTestStepMILIFConfig::RTestStepMILIFConfig(const TDesC& aTestName) +:RTestStepMILIFBase(aTestName) + { + } + +/* + * + * NewL + * + */ +RTestStepMILIFConfig* RTestStepMILIFConfig::NewL(const TDesC& aTestName) + { + RTestStepMILIFConfig* self = new (ELeave) RTestStepMILIFConfig(aTestName); + return self; + } + +/* + * + * DoKickoffTestL + * + */ +void RTestStepMILIFConfig::DoKickoffTestL() + { + INFO_PRINTF1(_L("RTestStepMILIFConfig: To test configuration of the IL component through MILIF interface.")); + + RTestStepMILIFBase::DoKickoffTestL(); + } + +/* + * + * DoTestBodyL - + * + */ +void RTestStepMILIFConfig::DoTestBody() + { + TInt error = KErrNone; + + INFO_PRINTF1(_L("4. Get Component Input ports through MILIF interface.")); + RPointerArray ifPorts; + error = iDummyComponent->GetComponentInputPorts(ifPorts); + if (error == KErrNone && ifPorts.Count() == 1) + { + iComponentInPortIf = ifPorts[KZerothPort]; + ifPorts.Close(); + } + else + { + if (ifPorts.Count() != 1) + { + error = KErrNotFound; + } + ifPorts.Close(); + ERR_PRINTF2(_L(" ERROR! - Fail to grab input ports: error = %d"), error); + StopTest(error, EFail); + return; + } + + INFO_PRINTF1(_L("5a. Set a (partial) config port parameter through the interface.")); + INFO_PRINTF1(_L(" Using TPortDefinitionType and TILPortDefinition.")); + TPortDefinitionType partialConfig_s; + partialConfig_s.nBufferCountActual = 1; + TILPortDefinition paramStruct_s(partialConfig_s); + error = iDummyComponent->SetConfig(paramStruct_s, iComponentInPortIf); + if (error != KErrNone) + { + ERR_PRINTF2(_L(" ERROR! - Fail to set TILPortDefinition: error = %d"), error); + StopTest(error, EFail); + return; + } + + INFO_PRINTF1(_L("5b. Now Get the TPortDefinitionType config parameter through the interface.")); + TILPortDefinition paramStruct_g; + TPortDefinitionType* partialConfig_g = NULL; + error = iDummyComponent->GetConfig(paramStruct_g, iComponentInPortIf); + if (error != KErrNone) + { + ERR_PRINTF2(_L(" ERROR! - Fail to get TILPortDefinition: error = %d"), error); + StopTest(error, EFail); + return; + } + partialConfig_g = TILPortDefinition::GetStructure(paramStruct_g); + if(partialConfig_g->nBufferCountActual != 1) + { + ERR_PRINTF1(_L(" ERROR! - Unexpected value. The get value does not match the value set.")); + StopTest(KErrCorrupt, EFail); + return; + } + + if ((iTestStepName == _L("MM-MILIF-DUMMYOMXILIF-U-0002"))) + { + INFO_PRINTF1(_L("6a. Configure component through the interface.")); + INFO_PRINTF1(_L(" Using TOMXILStructParam and TILPortDefinition.")); + OMX_PARAM_PORTDEFINITIONTYPE omxconfig_s; + omxconfig_s.nBufferCountActual = 3; + TOMXILStructParam omxParamStruct_s(&omxconfig_s, OMX_IndexParamPortDefinition); + error = iDummyComponent->SetConfig(omxParamStruct_s, iComponentInPortIf); + if (error != KErrNone) + { + ERR_PRINTF2(_L(" ERROR! - Fail to set TOMXILStructParam: error = %d"), error); + StopTest(error, EFail); + return; + } + + INFO_PRINTF1(_L("6b. Now Get the TOMXILStructParam config parameter through the interface.")); + OMX_PARAM_PORTDEFINITIONTYPE omxconfig_g; + TOMXILStructParam omxParamStruct_g(&omxconfig_g, OMX_IndexParamPortDefinition); + error = iDummyComponent->GetConfig(omxParamStruct_g, iComponentInPortIf); + if (error != KErrNone) + { + ERR_PRINTF2(_L(" ERROR! - Fail to get TOMXILStructParam: error = %d"), error); + StopTest(error, EFail); + return; + } + if(omxconfig_g.nBufferCountActual != 3) + { + ERR_PRINTF1(_L(" ERROR! - Unexpected value. The get value does not match the value set.")); + StopTest(KErrCorrupt, EFail); + return; + } + } + + StopTest(KErrNone); + } + + +// +// RTestStepMILIFStates: To test driving the IL component state machine through MILIF. +// + +/* + * + * RTestStepMILIFStates - Test step constructor + * + */ +RTestStepMILIFStates::RTestStepMILIFStates(const TDesC& aTestName) +:RTestStepMILIFBase(aTestName) + { + } + +/* + * + * NewL + * + */ +RTestStepMILIFStates* RTestStepMILIFStates::NewL(const TDesC& aTestName) + { + RTestStepMILIFStates* self = new (ELeave) RTestStepMILIFStates(aTestName); + return self; + } + +/* + * + * DoKickoffTestL + * + */ +void RTestStepMILIFStates::DoKickoffTestL() + { + INFO_PRINTF1(_L("RTestStepMILIFStates: To test driving the IL component state machine through MILIF interface.")); + + RTestStepMILIFBase::DoKickoffTestL(); + } + +/* + * + * DoTestBodyL - + * + */ +void RTestStepMILIFStates::DoTestBody() + { + Fsm(EEventInit, KErrNone); + } + +/* + * + * Fsm - Executes this test events in sequence + * + * + */ +void RTestStepMILIFStates::Fsm(TTestEvents aEvent, TInt aError) + { + TInt error = KErrNone; + + switch (iTestState) + { + case ETestStateStart: + { + if (aEvent == EEventInit) + { + INFO_PRINTF1(_L("4. Trigger transition from Load to Idle in component by calling Initialize()")); + error = iDummyComponent->Initialize(); + if (error != KErrNone) + { + ERR_PRINTF2(_L(" ERROR! - MILComponentIf::Initialize() error = %d"), error); + StopTest(error, EFail); + break; + } + INFO_PRINTF1(_L(" -> Test State: EStatePlayInitializing")); + iTestState = ETestStateInitializing; + } + else + { + ERR_PRINTF2(_L(" ERROR! - ETestStateStart did not received expected event. Received event: %d"), aEvent); + StopTest(aError, EFail); + } + break; + } + + case ETestStateInitializing: + { + if (aEvent == EEventInitComplete) + { + INFO_PRINTF1(_L("5a. Check the component was left in the correct state after EEventInitComplete event")); + TILComponentState aState; + error = iDummyComponent->GetState(aState); + if ((error != KErrNone) || (aState != EComponentIdle)) + { + ERR_PRINTF3(_L(" ERROR! - MILComponentIf::GetState Incorrect state = %d, error = %d."), error, aState); + if (aState != EComponentIdle) + { + error = KErrGeneral; + } + StopTest(error, EFail); + break; + } + + INFO_PRINTF1(_L("5b. Trigger transition from Idle to Execute in component by calling Execute()")); + error = iDummyComponent->Execute(); + if (error != KErrNone) + { + ERR_PRINTF2(_L(" ERROR! - MILComponentIf::Execute() error = %d"), error); + StopTest(error, EFail); + break; + } + INFO_PRINTF1(_L(" -> Test State: EStatePlayInitialized")); + iTestState = ETestStateInitialized; + } + else + { + ERR_PRINTF2(_L(" ERROR! - ETestStateInitializing did not received expected event. Received event: %d"), aEvent); + StopTest(aError, EFail); + } + break; + } + + case ETestStateInitialized: + { + if (aEvent == EEventExecuteComplete) + { + INFO_PRINTF1(_L("6a. Check the component was left in the correct state after EEventExecuteComplete event")); + TILComponentState aState; + error = iDummyComponent->GetState(aState); + if ((error != KErrNone) || (aState != EComponentExecuting)) + { + ERR_PRINTF3(_L(" ERROR! - MILComponentIf::GetState Incorrect state = %d, error = %d."), error, aState); + if (aState != EComponentExecuting) + { + error = KErrGeneral; + } + StopTest(error, EFail); + break; + } + + INFO_PRINTF1(_L("6b. Trigger transition from Executing to Pause in component by calling Pause()")); + error = iDummyComponent->Pause(); + if (error != KErrNone) + { + ERR_PRINTF2(_L(" ERROR! - MILComponentIf::Pause() error = %d"), error); + StopTest(error, EFail); + break; + } + INFO_PRINTF1(_L(" -> Test State: EStatePlayPausing")); + iTestState = ETestStatePausing; + } + else + { + ERR_PRINTF2(_L(" ERROR! - ETestStateInitialized did not received expected event. Received event: %d"), aEvent); + StopTest(aError, EFail); + } + break; + } + + case ETestStatePausing: + { + if (aEvent == EEventPauseComplete) + { + INFO_PRINTF1(_L("7a. Check the component was left in the correct state after EEventPauseComplete event")); + TILComponentState aState; + error = iDummyComponent->GetState(aState); + if ((error != KErrNone) || (aState != EComponentPaused)) + { + ERR_PRINTF3(_L(" ERROR! - MILComponentIf::GetState error = %d, state = %d"), error, aState); + if (aState != EComponentPaused) + { + error = KErrGeneral; + } + StopTest(error, EFail); + break; + } + + INFO_PRINTF1(_L("7b. Trigger transition from Pause to Idle in component by calling Stop()")); + error = iDummyComponent->Stop(); + if (error != KErrNone) + { + ERR_PRINTF2(_L(" ERROR! - MILComponentIf::Stop() error = %d"), error); + StopTest(error, EFail); + break; + } + INFO_PRINTF1(_L(" -> Test State: ETestStateStopping")); + iTestState = ETestStateStopping; + } + else + { + ERR_PRINTF2(_L(" ERROR! - ETestStatePausing did not received expected event. Received event: %d"), aEvent); + StopTest(aError, EFail); + } + break; + } + + case ETestStateStopping: + { + if (aEvent == EEventStopComplete) + { + INFO_PRINTF1(_L("8. Check the component was left in the correct state after EEventStopComplete event")); + TILComponentState aState; + error = iDummyComponent->GetState(aState); + if ((error != KErrNone) || (aState != EComponentIdle)) + { + ERR_PRINTF3(_L(" ERROR! - MILComponentIf::GetState error = %d, state = %d"), error, aState); + if (aState != EComponentIdle) + { + error = KErrGeneral; + } + StopTest(error, EFail); + break; + } + StopTest(KErrNone); + } + else + { + ERR_PRINTF2(_L(" ERROR! - ETestStateStopping did not received expected event. Received event: %d"), aEvent); + StopTest(aError, EFail); + } + break; + } + + default: + { + ERR_PRINTF2(_L(" ERROR! - Invalid state received: %d"), iTestState); + StopTest(KErrGeneral, EFail); + } + } + + } + +/* + * + * MsgFromILComponent - + * + */ +TInt RTestStepMILIFStates::MsgFromILComponent(const MILComponentIf* aComponent, const TILEvent& aEvent) + { + TInt error = KErrNone; + + if (aComponent != iDummyComponent) + { + ERR_PRINTF1(_L(" ERROR! - Invalid callback received")); + StopTest(KErrGeneral, EFail); + return KErrGeneral; + } + + switch (aEvent.iEvent) + { + case EEventCmdComplete: + { + if (aEvent.iData1 == ECommandStateSet) + { + if (aEvent.iData2 == EComponentIdle) + { + INFO_PRINTF1(_L(" MsgFromILComponent:EEventCmdComplete -> EComponentIdle received")); + if (iTestState == ETestStateInitializing) + { + Fsm(EEventInitComplete, KErrNone); + } + else if (iTestState == ETestStateStopping) + { + Fsm(EEventStopComplete, KErrNone); + } + else + { + ERR_PRINTF1(_L(" ERROR! - Unexpected callback received")); + error = KErrGeneral; + } + } + else if(aEvent.iData2 == EComponentExecuting) + { + INFO_PRINTF1(_L(" MsgFromILComponent:EEventCmdComplete -> EComponentExecuting received")); + if (iTestState == ETestStateInitialized) + { + Fsm(EEventExecuteComplete, KErrNone); + } + else + { + ERR_PRINTF1(_L(" ERROR! - Unexpected callback received")); + error = KErrGeneral; + } + } + else if(aEvent.iData2 == EComponentPaused) + { + INFO_PRINTF1(_L(" MsgFromILComponent:EEventCmdComplete -> EComponentPaused received")); + if (iTestState == ETestStatePausing) + { + Fsm(EEventPauseComplete, KErrNone); + } + else + { + ERR_PRINTF1(_L(" ERROR! - Unexpected callback received")); + error = KErrGeneral; + } + } + else + { + ERR_PRINTF1(_L(" ERROR! - Unexpected callback received")); + error = KErrGeneral; + } + break; + } + } + default: + { + ERR_PRINTF1(_L(" ERROR! - Unexpected callback received")); + error = KErrNotSupported; + } + } + + if (error != KErrNone) + { + StopTest(error, EFail); + } + return error; + } + + +// +// RTestStepMILIFCommands: To test sending commands to the IL component through MILIF. +// + +/* + * + * RTestStepMILIFCommands - Test step constructor + * + */ +RTestStepMILIFCommands::RTestStepMILIFCommands(const TDesC& aTestName) +:RTestStepMILIFBase(aTestName) + { + } + +/* + * + * NewL + * + */ +RTestStepMILIFCommands* RTestStepMILIFCommands::NewL(const TDesC& aTestName) + { + RTestStepMILIFCommands* self = new (ELeave) RTestStepMILIFCommands(aTestName); + return self; + } + +/* + * + * DoKickoffTestL + * + */ +void RTestStepMILIFCommands::DoKickoffTestL() + { + INFO_PRINTF1(_L("RTestStepMILIFCommands: To test sending commands to the IL component through MILIF interface.")); + + RTestStepMILIFBase::DoKickoffTestL(); + } + +/* + * + * DoTestBodyL - + * + */ +void RTestStepMILIFCommands::DoTestBody() + { + Fsm(EEventInit, KErrNone); + } + +/* + * + * Fsm - Executes this test events in sequence + * + */ +void RTestStepMILIFCommands::Fsm(TTestEvents aEvent, TInt aError) + { + TInt error = KErrNone; + + switch (iTestState) + { + case ETestStateStart: + { + if (aEvent == EEventInit) + { + INFO_PRINTF1(_L("4. Trigger FlushAllPorts")); + error = iDummyComponent->FlushAllPorts(); + if (error != KErrNone) + { + ERR_PRINTF2(_L(" ERROR! - MILComponentIf::FlushAllPorts error = %d"), error); + StopTest(error, EFail); + break; + } + INFO_PRINTF1(_L(" -> Test State: ETestStateFlushing")); + iTestState = ETestStateFlushing; + } + else + { + ERR_PRINTF2(_L(" ERROR! - ETestStateFlushing did not received expected event. Received event: %d"), aEvent); + StopTest(aError, EFail); + } + break; + } + + case ETestStateFlushing: + { + if (aEvent == EEventFlushComplete) + { + INFO_PRINTF1(_L(" Flush Command partially completed.")); + INFO_PRINTF1(_L(" -> Test State: ETestStateFirstPortFlushed")); + iTestState = ETestStateFirstPortFlushed; + } + else + { + ERR_PRINTF2(_L(" ERROR! - ETestStateFlushing did not received expected event. Received event: %d"), aEvent); + StopTest(aError, EFail); + } + break; + } + + case ETestStateFirstPortFlushed: + { + if (aEvent == EEventFlushComplete) + { + INFO_PRINTF1(_L(" Flush Command completed.")); + INFO_PRINTF1(_L("5. Trigger SendCommand() with ECommandPortDisable")); + TILCommand aCommand; + aCommand.iCmd = ECommandPortDisable; + aCommand.iData1 = 0; + aCommand.iExtraData = NULL; + error = iDummyComponent->SendCommand(aCommand); + + INFO_PRINTF1(_L(" -> Test State: ETestStateDisablingPort")); + iTestState = ETestStateDisablingPort; + } + else + { + ERR_PRINTF2(_L(" ERROR! - ETestStateFirstPortFlushed did not received expected event. Received event: %d"), aEvent); + StopTest(aError, EFail); + } + break; + } + + case ETestStateDisablingPort: + { + if (aEvent == EEventPortDisableComplete) + { + INFO_PRINTF1(_L(" -> Test State: Port Disabled. Fisnished Test")); + StopTest(KErrNone); + } + else + { + ERR_PRINTF2(_L(" ERROR! - ETestStateInitialized did not received expected event. Received event: %d"), aEvent); + StopTest(aError, EFail); + } + break; + } + + default: + { + ERR_PRINTF2(_L(" ERROR! - Invalid state received: %d"), iTestState); + StopTest(KErrGeneral, EFail); + } + } + } + +/* + * + * MsgFromILComponent - + * + */ +TInt RTestStepMILIFCommands::MsgFromILComponent(const MILComponentIf* aComponent, const TILEvent& aEvent) + { + TInt error = KErrNone; + + if (aComponent != iDummyComponent) + { + ERR_PRINTF1(_L(" ERROR! - Invalid callback received")); + StopTest(KErrGeneral, EFail); + return KErrGeneral; + } + + switch (aEvent.iEvent) + { + case EEventCmdComplete: + { + if (aEvent.iData1 == ECommandFlush) + { + INFO_PRINTF1(_L(" MsgFromILComponent:EEventCmdComplete -> ECommandFlush received")); + Fsm(EEventFlushComplete, KErrNone); + } + else if (aEvent.iData1 == ECommandPortDisable) + { + INFO_PRINTF1(_L(" MsgFromILComponent:EEventCmdComplete -> ECommandPortDisable received")); + Fsm(EEventPortDisableComplete, KErrNone); + } + else + { + ERR_PRINTF1(_L(" ERROR! - Unexpected callback received")); + error = KErrGeneral; + } + break; + } + default: + { + ERR_PRINTF1(_L(" ERROR! - Unexpected callback received")); + error = KErrNotSupported; + } + } + + if (error != KErrNone) + { + StopTest(error, EFail); + } + return error; + } + + +// +// RTestStepMILIFExtensions: To test configuration of the IL component with extended params through MILIF. +// + +/* + * + * RTestStepMILIFExtensions - Test step constructor + * + */ +RTestStepMILIFExtensions::RTestStepMILIFExtensions(const TDesC& aTestName) +:RTestStepMILIFBase(aTestName) + { + } + +/* + * + * NewL + * + */ +RTestStepMILIFExtensions* RTestStepMILIFExtensions::NewL(const TDesC& aTestName) + { + RTestStepMILIFExtensions* self = new (ELeave) RTestStepMILIFExtensions(aTestName); + return self; + } + +/* + * + * DoKickoffTestL + * + */ +void RTestStepMILIFExtensions::DoKickoffTestL() + { + INFO_PRINTF1(_L("RTestStepMILIFExtensions: To test configuration of the IL component with extended params through MILIF interface.")); + + RTestStepMILIFBase::DoKickoffTestL(); + } + +/* + * + * DoTestBodyL - + * + */ +void RTestStepMILIFExtensions::DoTestBody() + { + + TInt error = KErrNone; + + INFO_PRINTF1(_L("4. Get Component Input ports through MILIF interface.")); + RPointerArray ifPorts; + error = iDummyComponent->GetComponentInputPorts(ifPorts); + if (error == KErrNone && ifPorts.Count() == 1) + { + iComponentInPortIf = ifPorts[KZerothPort]; + ifPorts.Close(); + } + else + { + if (ifPorts.Count() != 1) + { + error = KErrNotFound; + } + ifPorts.Close(); + StopTest(error, EFail); + return; + } + + INFO_PRINTF1(_L("5a. Set a (partial) config port parameter through the interface's extension mechanism.")); + TPortDefinitionType partialConfig_s; + partialConfig_s.nBufferCountActual = 1; + TILPortDefinition paramStruct_s(partialConfig_s); + error = iDummyComponent->SetExtConfig(KExtensionPortDefinitionName, paramStruct_s, iComponentInPortIf); + if ((iTestStepName == _L("MM-MILIF-DUMMYOMXILIF-U-0005"))) + { + if (error != KErrNone) + { + ERR_PRINTF2(_L(" ERROR! - Fail to set extension: error = %d"), error); + StopTest(error, EFail); + return; + } + } + else + { + StopTest(KErrGeneral, EFail); + } + + INFO_PRINTF1(_L("5b. Get the parameter set in 5a through the interface's extension mechanism.")); + TILPortDefinition paramStruct_g; + TPortDefinitionType* partialConfig_g = NULL; + error = iDummyComponent->GetExtConfig(KExtensionPortDefinitionName, paramStruct_g, iComponentInPortIf); + if ((iTestStepName == _L("MM-MILIF-DUMMYOMXILIF-U-0005"))) + { + if (error != KErrNone) + { + ERR_PRINTF2(_L(" ERROR! - Fail to get TILPortDefinition: error = %d"), error); + StopTest(error, EFail); + return; + } + partialConfig_g = TILPortDefinition::GetStructure(paramStruct_g); + if(partialConfig_g->nBufferCountActual != 1) + { + ERR_PRINTF1(_L(" ERROR! - Unexpected value. The get value does not match the value set.")); + StopTest(KErrCorrupt, EFail); + return; + } + } + else + { + StopTest(KErrGeneral, EFail); + return; + } + + StopTest(KErrNone); + } + + +// +// RTestStepMILIFComponentRole: To test access to the IL component role through MILIF. +// + +/* + * + * RTestStepMILIFComponentRole - Test step constructor + * + */ +RTestStepMILIFComponentRole::RTestStepMILIFComponentRole(const TDesC& aTestName) +:RTestStepMILIFBase(aTestName) + { + } + +/* + * + * NewL + * + */ +RTestStepMILIFComponentRole* RTestStepMILIFComponentRole::NewL(const TDesC& aTestName) + { + RTestStepMILIFComponentRole* self = new (ELeave) RTestStepMILIFComponentRole(aTestName); + return self; + } + +/* + * + * DoKickoffTestL + * + */ +void RTestStepMILIFComponentRole::DoKickoffTestL() + { + INFO_PRINTF1(_L("RTestStepMILIFComponentRole: To test access to the IL component role through MILIF interface.")); + + RTestStepMILIFBase::DoKickoffTestL(); + } + +/* + * + * DoTestBodyL - + * + */ +void RTestStepMILIFComponentRole::DoTestBody() + { + TInt error = KErrNone; + TInt index = 0; + + HBufC8* buf = HBufC8::New(KMaxComponentRoleLength); + if (buf == NULL) + { + StopTest(KErrNoMemory, EFail); + } + else + { + TPtr8 componentRole = buf->Des(); + + INFO_PRINTF1(_L("4. Get component role through MILIF interface.")); + error = iDummyComponent->ComponentRoleEnum(componentRole, index); + + INFO_PRINTF1(_L("5. Check the component's role returned is the expected role.")); + if (error != KErrNone) + { + ERR_PRINTF2(_L(" ERROR! - MILComponentIf::ComponentRoleEnum failed. Error returned = %d"), error); + StopTest(error, EFail); + delete buf; + return; + } + else if (buf->Compare(KFakeRole) != 0 ) + { + ERR_PRINTF1(_L(" ERROR! - MILComponentIf::ComponentRoleEnum failed. Unexpected role.")); + StopTest(error, EFail); + delete buf; + return; + } + StopTest(KErrNone); + + delete buf; + } + } + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/unittest/src/tsu_milif_omxiliftests.h --- a/omxil/mmilapi/unittest/src/tsu_milif_omxiliftests.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/unittest/src/tsu_milif_omxiliftests.h Fri May 07 16:25:23 2010 +0100 @@ -1,189 +1,189 @@ -// 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: -// Declarations of Unit test step classes for MILIF testing. -// -// - -#ifndef TSI_MILIF_OMXILIFTESTS_H -#define TSI_MILIF_OMXILIFTESTS_H - -#include -#include - -#include "milcomponentportif.h" -#include "milifobserver.h" - -enum TTestEvents - { - EEventInit = 0, - EEventInitComplete, - EEventExecuteComplete, - EEventPauseComplete, - EEventStopComplete, - EEventFlushComplete, - EEventPortDisableComplete - }; - -enum TTestState - { - ETestStateStart = 0, - ETestStateInitializing, - ETestStateInitialized, - ETestStatePausing, - ETestStateStopping, - ETestStateFlushing, - ETestStateFirstPortFlushed, - ETestStateDisablingPort - }; - - -/* - * - * RTestStepMILIFBase - * - */ -class RTestStepMILIFBase : public RAsyncTestStep, - public MILIfObserver - { -public: - // From RAsyncTestStep - virtual void KickoffTestL(); - virtual void CloseTest(); - - // from MILIfObserver - virtual TInt MsgFromILComponent(const MILComponentIf* aComponent, const TILEvent& aEvent); - virtual TInt BufferDelivered(const MILComponentPortIf* aPort, const CMMFBuffer* aBuffer); - -protected: - RTestStepMILIFBase(const TDesC& aTestName); - - virtual void DoTestBody(); - virtual void DoKickoffTestL(); - -protected: - MILComponentIf* iDummyComponent; - MILComponentPortIf* iComponentInPortIf; // Not owned - MILComponentPortIf* iComponentOutPortIf;// Not owned - TTestState iTestState; - }; - -/* - * - * RTestStepMILIFPorts - * - */ -class RTestStepMILIFPorts : public RTestStepMILIFBase - { -public: - static RTestStepMILIFPorts* NewL(const TDesC& aTestName); - -private: - RTestStepMILIFPorts(const TDesC& aTestName); - - virtual void DoKickoffTestL(); - virtual void DoTestBody(); - }; - -/* - * - * RTestStepMILIFConfig - * - */ -class RTestStepMILIFConfig : public RTestStepMILIFBase - { -public: - static RTestStepMILIFConfig* NewL(const TDesC& aTestName); - -private: - RTestStepMILIFConfig(const TDesC& aTestName); - - virtual void DoTestBody(); - virtual void DoKickoffTestL(); - }; - -/* - * - * RTestStepMILIFStates - * - */ -class RTestStepMILIFStates : public RTestStepMILIFBase - { -public: - static RTestStepMILIFStates* NewL(const TDesC& aTestName); - -private: - RTestStepMILIFStates(const TDesC& aTestName); - - virtual void DoKickoffTestL(); - virtual void DoTestBody(); - - virtual TInt MsgFromILComponent(const MILComponentIf* aComponent, const TILEvent& aEvent); - virtual void Fsm(TTestEvents aEvent, TInt aError); - }; - -/* - * - * RTestStepMILIFCommands - * - */ -class RTestStepMILIFCommands : public RTestStepMILIFBase - { -public: - static RTestStepMILIFCommands* NewL(const TDesC& aTestName); - -private: - RTestStepMILIFCommands(const TDesC& aTestName); - - virtual void DoKickoffTestL(); - virtual void DoTestBody(); - - virtual TInt MsgFromILComponent(const MILComponentIf* aComponent, const TILEvent& aEvent); - virtual void Fsm(TTestEvents aEvent, TInt aError); - }; - -/* - * - * RTestStepMILIFExtensions - * - */ -class RTestStepMILIFExtensions : public RTestStepMILIFBase - { -public: - static RTestStepMILIFExtensions* NewL(const TDesC& aTestName); - -private: - RTestStepMILIFExtensions(const TDesC& aTestName); - - virtual void DoKickoffTestL(); - virtual void DoTestBody(); - }; - -/* - * - * RTestStepMILIFComponentRole - * - */ -class RTestStepMILIFComponentRole : public RTestStepMILIFBase - { -public: - static RTestStepMILIFComponentRole* NewL(const TDesC& aTestName); - -private: - RTestStepMILIFComponentRole(const TDesC& aTestName); - - virtual void DoKickoffTestL(); - virtual void DoTestBody(); - }; - -#endif // TSI_MILIF_OMXILIFTESTS_H +// 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: +// Declarations of Unit test step classes for MILIF testing. +// +// + +#ifndef TSI_MILIF_OMXILIFTESTS_H +#define TSI_MILIF_OMXILIFTESTS_H + +#include +#include + +#include "milcomponentportif.h" +#include "milifobserver.h" + +enum TTestEvents + { + EEventInit = 0, + EEventInitComplete, + EEventExecuteComplete, + EEventPauseComplete, + EEventStopComplete, + EEventFlushComplete, + EEventPortDisableComplete + }; + +enum TTestState + { + ETestStateStart = 0, + ETestStateInitializing, + ETestStateInitialized, + ETestStatePausing, + ETestStateStopping, + ETestStateFlushing, + ETestStateFirstPortFlushed, + ETestStateDisablingPort + }; + + +/* + * + * RTestStepMILIFBase + * + */ +class RTestStepMILIFBase : public RAsyncTestStep, + public MILIfObserver + { +public: + // From RAsyncTestStep + virtual void KickoffTestL(); + virtual void CloseTest(); + + // from MILIfObserver + virtual TInt MsgFromILComponent(const MILComponentIf* aComponent, const TILEvent& aEvent); + virtual TInt BufferDelivered(const MILComponentPortIf* aPort, const CMMFBuffer* aBuffer); + +protected: + RTestStepMILIFBase(const TDesC& aTestName); + + virtual void DoTestBody(); + virtual void DoKickoffTestL(); + +protected: + MILComponentIf* iDummyComponent; + MILComponentPortIf* iComponentInPortIf; // Not owned + MILComponentPortIf* iComponentOutPortIf;// Not owned + TTestState iTestState; + }; + +/* + * + * RTestStepMILIFPorts + * + */ +class RTestStepMILIFPorts : public RTestStepMILIFBase + { +public: + static RTestStepMILIFPorts* NewL(const TDesC& aTestName); + +private: + RTestStepMILIFPorts(const TDesC& aTestName); + + virtual void DoKickoffTestL(); + virtual void DoTestBody(); + }; + +/* + * + * RTestStepMILIFConfig + * + */ +class RTestStepMILIFConfig : public RTestStepMILIFBase + { +public: + static RTestStepMILIFConfig* NewL(const TDesC& aTestName); + +private: + RTestStepMILIFConfig(const TDesC& aTestName); + + virtual void DoTestBody(); + virtual void DoKickoffTestL(); + }; + +/* + * + * RTestStepMILIFStates + * + */ +class RTestStepMILIFStates : public RTestStepMILIFBase + { +public: + static RTestStepMILIFStates* NewL(const TDesC& aTestName); + +private: + RTestStepMILIFStates(const TDesC& aTestName); + + virtual void DoKickoffTestL(); + virtual void DoTestBody(); + + virtual TInt MsgFromILComponent(const MILComponentIf* aComponent, const TILEvent& aEvent); + virtual void Fsm(TTestEvents aEvent, TInt aError); + }; + +/* + * + * RTestStepMILIFCommands + * + */ +class RTestStepMILIFCommands : public RTestStepMILIFBase + { +public: + static RTestStepMILIFCommands* NewL(const TDesC& aTestName); + +private: + RTestStepMILIFCommands(const TDesC& aTestName); + + virtual void DoKickoffTestL(); + virtual void DoTestBody(); + + virtual TInt MsgFromILComponent(const MILComponentIf* aComponent, const TILEvent& aEvent); + virtual void Fsm(TTestEvents aEvent, TInt aError); + }; + +/* + * + * RTestStepMILIFExtensions + * + */ +class RTestStepMILIFExtensions : public RTestStepMILIFBase + { +public: + static RTestStepMILIFExtensions* NewL(const TDesC& aTestName); + +private: + RTestStepMILIFExtensions(const TDesC& aTestName); + + virtual void DoKickoffTestL(); + virtual void DoTestBody(); + }; + +/* + * + * RTestStepMILIFComponentRole + * + */ +class RTestStepMILIFComponentRole : public RTestStepMILIFBase + { +public: + static RTestStepMILIFComponentRole* NewL(const TDesC& aTestName); + +private: + RTestStepMILIFComponentRole(const TDesC& aTestName); + + virtual void DoKickoffTestL(); + virtual void DoTestBody(); + }; + +#endif // TSI_MILIF_OMXILIFTESTS_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/unittest/src/tsu_milif_testsuite.cpp --- a/omxil/mmilapi/unittest/src/tsu_milif_testsuite.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/unittest/src/tsu_milif_testsuite.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,73 +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: -// This file contains the test suite class implementation for MILIF unit tests. -// -// - -#include "tsu_milif_testsuite.h" -#include "tsu_milif_omxiliftests.h" - -// Entry function - create a test suite object -EXPORT_C CTestSuiteMILIF* CTestSuiteMILIF::NewTestSuiteL() - { - CTestSuiteMILIF* result = new (ELeave) CTestSuiteMILIF(); - CleanupStack::PushL(result); - result->ConstructL(); - CleanupStack::Pop(result); - return result; - } - -/* - * - * CTestSuiteMILIF - Constructor - * - */ -CTestSuiteMILIF::CTestSuiteMILIF() - { - iSuiteName = _L("TSU_MILIF_OMXILIF"); - } - -/* - * - * ~CTestSuiteMILIF - Destructor - * - */ -CTestSuiteMILIF::~CTestSuiteMILIF() - { - } - -/* - * GetVersion - Get test suite version - * - */ -TPtrC CTestSuiteMILIF::GetVersion() const - { - _LIT(KTxtVersion, "1.0"); - return KTxtVersion(); - } - -/* - * - * InitialiseL - Creates all the test steps and stores them inside CTestSuiteMILIF - * - */ -void CTestSuiteMILIF::InitialiseL() - { - AddTestStepL(RTestStepMILIFPorts::NewL(_L("MM-MILIF-DUMMYOMXILIF-U-0001"))); - AddTestStepL(RTestStepMILIFConfig::NewL(_L("MM-MILIF-DUMMYOMXILIF-U-0002"))); - AddTestStepL(RTestStepMILIFStates::NewL(_L("MM-MILIF-DUMMYOMXILIF-U-0003"))); - AddTestStepL(RTestStepMILIFCommands::NewL(_L("MM-MILIF-DUMMYOMXILIF-U-0004"))); - AddTestStepL(RTestStepMILIFExtensions::NewL(_L("MM-MILIF-DUMMYOMXILIF-U-0005"))); - AddTestStepL(RTestStepMILIFComponentRole::NewL(_L("MM-MILIF-DUMMYOMXILIF-U-0006"))); - } +// 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 file contains the test suite class implementation for MILIF unit tests. +// +// + +#include "tsu_milif_testsuite.h" +#include "tsu_milif_omxiliftests.h" + +// Entry function - create a test suite object +EXPORT_C CTestSuiteMILIF* CTestSuiteMILIF::NewTestSuiteL() + { + CTestSuiteMILIF* result = new (ELeave) CTestSuiteMILIF(); + CleanupStack::PushL(result); + result->ConstructL(); + CleanupStack::Pop(result); + return result; + } + +/* + * + * CTestSuiteMILIF - Constructor + * + */ +CTestSuiteMILIF::CTestSuiteMILIF() + { + iSuiteName = _L("TSU_MILIF_OMXILIF"); + } + +/* + * + * ~CTestSuiteMILIF - Destructor + * + */ +CTestSuiteMILIF::~CTestSuiteMILIF() + { + } + +/* + * GetVersion - Get test suite version + * + */ +TPtrC CTestSuiteMILIF::GetVersion() const + { + _LIT(KTxtVersion, "1.0"); + return KTxtVersion(); + } + +/* + * + * InitialiseL - Creates all the test steps and stores them inside CTestSuiteMILIF + * + */ +void CTestSuiteMILIF::InitialiseL() + { + AddTestStepL(RTestStepMILIFPorts::NewL(_L("MM-MILIF-DUMMYOMXILIF-U-0001"))); + AddTestStepL(RTestStepMILIFConfig::NewL(_L("MM-MILIF-DUMMYOMXILIF-U-0002"))); + AddTestStepL(RTestStepMILIFStates::NewL(_L("MM-MILIF-DUMMYOMXILIF-U-0003"))); + AddTestStepL(RTestStepMILIFCommands::NewL(_L("MM-MILIF-DUMMYOMXILIF-U-0004"))); + AddTestStepL(RTestStepMILIFExtensions::NewL(_L("MM-MILIF-DUMMYOMXILIF-U-0005"))); + AddTestStepL(RTestStepMILIFComponentRole::NewL(_L("MM-MILIF-DUMMYOMXILIF-U-0006"))); + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/unittest/src/tsu_milif_testsuite.h --- a/omxil/mmilapi/unittest/src/tsu_milif_testsuite.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/unittest/src/tsu_milif_testsuite.h Fri May 07 16:25:23 2010 +0100 @@ -1,45 +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: -// This file contains the test suite class declaration for MILIF unit tests. -// -// - -#ifndef TSU_MILIF_TESTSUITE_H -#define TSU_MILIF_TESTSUITE_H - -#include -#include - -/* - * - * CTestSuiteMILIF - * - Test suite class - * - */ -class CTestSuiteMILIF : public CTestSuite - { -public: - virtual ~CTestSuiteMILIF(); - - // From CTestSuite - void InitialiseL(); - TPtrC GetVersion() const; - - IMPORT_C static CTestSuiteMILIF* NewTestSuiteL(); - -private: - CTestSuiteMILIF(); - }; - -#endif // TSU_MILIF_TESTSUITE_H +// 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 file contains the test suite class declaration for MILIF unit tests. +// +// + +#ifndef TSU_MILIF_TESTSUITE_H +#define TSU_MILIF_TESTSUITE_H + +#include +#include + +/* + * + * CTestSuiteMILIF + * - Test suite class + * + */ +class CTestSuiteMILIF : public CTestSuite + { +public: + virtual ~CTestSuiteMILIF(); + + // From CTestSuite + void InitialiseL(); + TPtrC GetVersion() const; + + IMPORT_C static CTestSuiteMILIF* NewTestSuiteL(); + +private: + CTestSuiteMILIF(); + }; + +#endif // TSU_MILIF_TESTSUITE_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/unittest/test_plugins/audioilhwdevice_mvs_test/omxilvorbdechwdevice/omxilvorbdechwdevice.cpp --- a/omxil/mmilapi/unittest/test_plugins/audioilhwdevice_mvs_test/omxilvorbdechwdevice/omxilvorbdechwdevice.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/unittest/test_plugins/audioilhwdevice_mvs_test/omxilvorbdechwdevice/omxilvorbdechwdevice.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,677 +1,677 @@ -// 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: -// vorbisdecilhwdevice.cpp -// -// - -#include "omxilvorbdechwdevice.h" - -#include -#include -#include -#include - -#include "tilstructtypes.h" -#include "ilcomponentif.h" -#include "iltestuids.hrh" - - - -_LIT8(KNULLName,""); -_LIT8(KVorbisDecoderILComponentName,"OMX.SYMBIAN.AUDIO.DECODER.VORBIS"); - -const TInt KZerothPort = 0; -const TInt KInputPortIndex = 0; -const TInt KMaxNumberPort = 1; - -// _________________________________________________________________________________ -// Map the interface implementation KUidAudioDecILHwDevice UID to the implementation - -const TImplementationProxy ImplementationTable[] = - { - IMPLEMENTATION_PROXY_ENTRY(KUidOmxILVorbDecHwDevice , COmxILVorbDecHwDevice::NewL) - }; - -EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) - { - aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); - - return ImplementationTable; - } -// _________________________________________________________________________________ - - -/* -The destructor. Releases the components and frees any owned buffers. -@see CMMFHwDevice::~CMMFHwDevice() -*/ -COmxILVorbDecHwDevice::~COmxILVorbDecHwDevice() - { - Stop(); - - if (iCodecIf) - { - iCodecIf->ReleaseComponent(); - iCodecIf = NULL; - } - if (iRendererIf) - { - iRendererIf->ReleaseComponent(); - iRendererIf = NULL; - } - - iCodecInPortIf = NULL; - iCodecOutPortIf = NULL; - iRendererInPortIf = NULL; - - delete iInBuffer; - iInBuffer = NULL; - delete iOutBuffer; - iOutBuffer = NULL; - - delete iActiveWait; - - OMX_Deinit(); - } - -/** -Creates a new COmxILVorbDecHwDevice object. -The COmxILVorbDecHwDevice state is set to EILHwDeviceLoaderLoaded. -@see TILHwDevState -*/ -COmxILVorbDecHwDevice* COmxILVorbDecHwDevice::NewL() - { - COmxILVorbDecHwDevice* self = new (ELeave) COmxILVorbDecHwDevice; - CleanupStack::PushL (self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } - -/* -Default constructor. -*/ -COmxILVorbDecHwDevice::COmxILVorbDecHwDevice() - { - } - -/* -Second phase constructor -*/ -void COmxILVorbDecHwDevice::ConstructL() - { - iActiveWait = new (ELeave) CActiveSchedulerWait; - iState = EILHwDeviceCreated; - OMX_Init(); - - iCodecIf = CILComponentIf::CreateImplementationL(TUid::Uid(KUidOmxILDummyAudioDecMILIFPlugin)); - iCodecIf->CreateComponentL(KVorbisDecoderILComponentName, *this); - User::LeaveIfError(iCodecIf->SetComponentIfRole(KUidFormatOGG)); - - iRendererIf = CILComponentIf::CreateImplementationL(TUid::Uid(KUidDummyPcmRendererMILIFPlugin)); - iRendererIf->CreateComponentL(KNULLName, *this); // - - } - -/* -@see CMMFHwDevice::Start() -@see TDeviceFunc -*/ -TInt COmxILVorbDecHwDevice::Start(TDeviceFunc aFuncCmd, TDeviceFlow /*aFlowCmd*/) - { - if (!((aFuncCmd == EDevDecode)|(aFuncCmd == EDevNullFunc))) - { - return KErrArgument; - } - - TInt err = KErrNone; - switch(aFuncCmd) - { - case EDevDecode: - { - err = StartDecode(); - break; - } - default: - { - err = KErrNotSupported; - } - } - - return err; - } - - -/* -Starts the execution of the decode operation, and sets the state -of the COmxILVorbDecHwDevice to EILHwDeviceExecuting. -@return An error code indicating if the function call was successful. -KErrNone on success, otherwise another of the system-wide error codes. -*/ -TInt COmxILVorbDecHwDevice::StartExecuting() - { - TInt err = KErrNone; - iCodecOutPortIf->FillThisBuffer(*iOutBuffer); - err = iHwDeviceObserver->FillThisHwBuffer(*iInBuffer); - if(err != KErrNone) - { - return err; - } - - iState = EILHwDeviceExecuting; - - iCodecIf->Execute(); - iRendererIf->Execute(); - - return err; - } - -/* -Initialises the decode operation, and set the state of the COmxILVorbDecHwDevice -to EILHwDeviceInitializing. -@return An error code indicating if the function call was successful. -KErrNone on success, otherwise another of the system-wide error codes. -*/ -TInt COmxILVorbDecHwDevice::InitializeDecode() - { - ASSERT(iCodecOutPortIf && iRendererInPortIf); - - //GetConfig from codec input port; - TILPortDefinition paramStruct; - TPortDefinitionType* config = NULL; - TInt err =iCodecIf->GetConfig(paramStruct, iCodecInPortIf); - if (err != KErrNone) - { - return err; - } - config = TILPortDefinition::GetStructure(paramStruct); - TRAP(err, iInBuffer = CMMFDescriptorBuffer::NewL(config->nBufferSize)); - if(err != KErrNone) - { - return err; - } - iCodecInPortIf->UseBuffer(*iInBuffer); - - //GetConfig from codec output port; - err =iCodecIf->GetConfig(paramStruct, iCodecOutPortIf); - if (err != KErrNone) - { - return err; - } - config = TILPortDefinition::GetStructure(paramStruct); - TRAP(err, iOutBuffer = CMMFDescriptorBuffer::NewL(config->nBufferSize)); - if(err != KErrNone) - { - return err; - } - iCodecOutPortIf->UseBuffer(*iOutBuffer); - - iState = EILHwDeviceInitializing; - - iCodecIf->Initialize(); - iRendererIf->Initialize(); - - iActiveWait->Start(); - return KErrNone; - } - -/* -Starts the decode operation, providing that the intial state of the -COmxILVorbDecHwDevice is EILHwDeviceLoaded. -@return An error code indicating if the function call was successful. -KErrNone on success, otherwise another of the system-wide error codes. -*/ -TInt COmxILVorbDecHwDevice::StartDecode() - { - TInt err = KErrNone; - if (iState == EILHwDeviceLoaded) - { - err = InitializeDecode(); - } - if (err != KErrNone) - { - return err; - } - if (iState == EILHwDeviceIdle) - { - // Ensure that the LastBuffer flags are reset. - iInBuffer->SetLastBuffer(EFalse); - iOutBuffer->SetLastBuffer(EFalse); - } - return StartExecuting(); - } - -/* -@see CMMFHwDevice::Stop() -*/ -TInt COmxILVorbDecHwDevice::Stop() - { - if(iState == EILHwDeviceExecuting || iState == EILHwDevicePaused) - { - iStopping = ETrue; - - // reset the flags - iCodecCallbackComplete = EFalse; - iRendererCallbackComplete = EFalse; - - if(iRendererIf) - { - iRendererIf->Stop(); - } - if(iCodecIf) - { - iCodecIf->Stop(); - } - - iState = EILHwDeviceIdle; - } - return KErrNone; - } - -/* -@see CMMFHwDevice::Pause() -*/ -TInt COmxILVorbDecHwDevice::Pause() - { - TInt err = KErrNone; - if(iState != EILHwDevicePaused) - { - if(iRendererIf) - { - err = iRendererIf->Pause(); - } - iState = EILHwDevicePaused; - } - return err; - } - -/* -@see CMMFHwDevice::Init() -*/ -TInt COmxILVorbDecHwDevice::Init(THwDeviceInitParams& aDevInfo) - { - RPointerArray ifPorts; - - if(!aDevInfo.iHwDeviceObserver) - { - return KErrArgument; - } - iHwDeviceObserver = aDevInfo.iHwDeviceObserver; - - if(!iCodecIf) - { - return KErrNotSupported; - } - - // Get decoder input port. For this particular scenario expects one single port. - TInt err = iCodecIf->GetComponentInputPorts(ifPorts); - if (err == KErrNone && ifPorts.Count() == KMaxNumberPort) - { - iCodecInPortIf = ifPorts[KZerothPort]; - ifPorts.Close(); - } - else - { - if (!ifPorts.Count() != KMaxNumberPort) - { - err = KErrNotFound; - } - ifPorts.Close(); - return err; - } - - // Get decoder ouput port. For this particular scenario expects one single port. - err = iCodecIf->GetComponentOutputPorts(ifPorts); - if (err == KErrNone && ifPorts.Count() == KMaxNumberPort) - { - iCodecOutPortIf = ifPorts[KZerothPort]; - ifPorts.Close(); - } - else - { - if (!ifPorts.Count() != KMaxNumberPort) - { - err = KErrNotFound; - } - ifPorts.Close(); - return err; - } - - if(!iRendererIf) - { - return KErrNotSupported; - } - - // Get renderer inport port. For this particular scenario expects one single port. - err = iRendererIf->GetComponentInputPorts(ifPorts); - if (err == KErrNone && ifPorts.Count() == KMaxNumberPort) - { - iRendererInPortIf = ifPorts[KZerothPort]; - ifPorts.Close(); - } - else - { - if (!ifPorts.Count() != KMaxNumberPort) - { - err = KErrNotFound; - } - ifPorts.Close(); - return err; - } - - iState = EILHwDeviceLoaded; - return KErrNone; - } - -/* -@see CMMFHwDevice::CustomInterface() -*/ -TAny* COmxILVorbDecHwDevice::CustomInterface(TUid aInterfaceId) - { - if (aInterfaceId.iUid == KMmfPlaySettingsCustomInterface) - { - return iRendererIf->CustomInterface(aInterfaceId); - } - else - { - return NULL; - } - } - -/* -@see CMMFHwDevice::ThisHwBufferFilled() -*/ -TInt COmxILVorbDecHwDevice::ThisHwBufferFilled(CMMFBuffer& aFillBufferPtr) - { - aFillBufferPtr.SetStatus(EFull); - iCodecInPortIf->EmptyThisBuffer(aFillBufferPtr); - return KErrNone; - } - -/* -@see CMMFHwDevice::ThisHwBufferEmptied() -*/ -TInt COmxILVorbDecHwDevice::ThisHwBufferEmptied(CMMFBuffer& /*aEmptyBufferPtr*/) - { - // Not used while decoding - return KErrNotSupported; - } - -/* -@see CMMFHwDevice::SetConfig() -*/ -TInt COmxILVorbDecHwDevice::SetConfig(TTaskConfig& aConfig) - { - TInt err = KErrNone; - - // Configure the Codec component - TILTaskConfig configStruct(aConfig); - err = iCodecIf->SetConfig(configStruct, iCodecInPortIf); - if(err != KErrNone) - { - return err; - } - err = iCodecIf->SetConfig(configStruct, iCodecOutPortIf); - if(err != KErrNone) - { - return err; - } - err = iRendererIf->SetConfig(configStruct, iCodecInPortIf); - if(err != KErrNone) - { - return err; - } - - return KErrNone; - } - -/* -@see CMMFHwDevice::StopAndDeleteCodec() -*/ -TInt COmxILVorbDecHwDevice::StopAndDeleteCodec() - { - TInt stopError = Stop(); - TInt deleteError = DeleteCodec(); - - if (stopError != KErrNone) - { - return stopError; - } - else - { - return deleteError; - } - } - -/* -Unloads all components, and deletes any locally owned buffers. -State is set to EILHwDeviceLoaderLoaded. - -@see CMMFHwDevice::DeleteCodec() -*/ -TInt COmxILVorbDecHwDevice::DeleteCodec() - { - Stop(); - if (iCodecIf) - { - iCodecIf->ReleaseComponent(); - iCodecIf = NULL; - } - if (iRendererIf) - { - iRendererIf->ReleaseComponent(); - iRendererIf = NULL; - } - - iCodecInPortIf = NULL; - iCodecOutPortIf = NULL; - iRendererInPortIf = NULL; - - delete iInBuffer; - iInBuffer = NULL; - delete iOutBuffer; - iOutBuffer = NULL; - - iState = EILHwDeviceCreated; - - return KErrNone; - } - -/* -Called to indicate that the Hardware Device has been stopped, leading -to callbacks to the observer. -@see MMMFHwDeviceObserver::Stopped() -@see MMMFHwDeviceObserver::Error() -*/ -void COmxILVorbDecHwDevice::StopHwDevice(TInt error) - { - iHwDeviceObserver->Stopped(); - iHwDeviceObserver->Error(error); - } - -/* -Called to process messages from the IL components -*/ -TInt COmxILVorbDecHwDevice::MsgFromILComponent(const MILComponentIf* aComponent, const TILEvent& aEvent) - { - TInt err = KErrNone; - switch (aEvent.iEvent) - { - case EEventCmdComplete: - { - if (aEvent.iData1 == ECommandStateSet) - { - if (aEvent.iData2 == EComponentIdle) - { - if (iState == EILHwDeviceInitializing) - { - InitializeComplete(aComponent, KErrNone); - } - else - { - ExecuteComplete(aComponent, KErrNone); - } - } - else if(aEvent.iData2 == EComponentExecuting) - { - ExecuteComplete(aComponent, KErrNone); - } - else - { - StopHwDevice(KErrNotSupported); - } - break; - } - else if (aEvent.iData1 == ECommandFlush) - { - //Command Flush completed - err = KErrNotSupported; // check what a3f should do here if anything - break; - } - } - case EEventBufferFlag: - { - if (aEvent.iData1 == KInputPortIndex) - { - if (iState == EILHwDeviceExecuting) - { - StopHwDevice(aEvent.iData2); - iState = EILHwDeviceIdle; - } - } - else - { - err = KErrNotSupported; - } - break; - } - default: - { - err = KErrNotSupported; - StopHwDevice(err); - } - } - return err; - } - -/* -Called to indicate that the buffer has been delivered. -*/ -TInt COmxILVorbDecHwDevice::BufferDelivered(const MILComponentPortIf* aPort, const CMMFBuffer* aBuffer) - { - TInt err = KErrNone; - - if(aPort == iCodecInPortIf) - { - if (!aBuffer->LastBuffer()) - { - // if the device is idle (having been Stopped) then - // FillThisHwBuffer will cause a kern-exec, - // as the DevSoundSession no longer has a buffer - if(iState == EILHwDeviceExecuting) - { - err = iHwDeviceObserver->FillThisHwBuffer(const_cast(*aBuffer)); - if(err != KErrNone) - { - StopHwDevice(err); - } - } - } - } - else if (aPort == iRendererInPortIf) - { - if (!aBuffer->LastBuffer()) - { - err = iCodecOutPortIf->FillThisBuffer(*iOutBuffer); - } - } - else if(aPort == iCodecOutPortIf) - { - err = iRendererInPortIf->EmptyThisBuffer(*aBuffer); - } - else - { - err = KErrNotSupported; - } - return err; - } - -void COmxILVorbDecHwDevice::InitializeComplete(const MILComponentIf* aComponent, TInt aErrorCode) - { - if(aErrorCode != KErrNone) - { - // stop waiting on the active scheduler if we were doing so - if (iState == EILHwDeviceInitializing) - { - // change state back to loaded - iState = EILHwDeviceLoaded; - iActiveWait->AsyncStop(); - } - return; - } - - if(aComponent == iCodecIf) - { - iCodecCallbackComplete = ETrue; - } - else if(aComponent == iRendererIf) - { - iRendererCallbackComplete = ETrue; - } - - if(iCodecCallbackComplete && iRendererCallbackComplete) - { - // reset the flags - iCodecCallbackComplete = EFalse; - iRendererCallbackComplete = EFalse; - - // Both components initialised OK - if (iState == EILHwDeviceInitializing) - { - iActiveWait->AsyncStop(); - } - iState = EILHwDeviceIdle; - } - } - -void COmxILVorbDecHwDevice::ExecuteComplete(const MILComponentIf* aComponent, TInt aErrorCode) - { - - if(aComponent == iCodecIf) - { - iCodecCallbackComplete = ETrue; - } - else if(aComponent == iRendererIf) - { - iRendererCallbackComplete = ETrue; - } - - if (iCodecCallbackComplete && iRendererCallbackComplete) - { - if (iStopping) - { - StopHwDevice(aErrorCode); - iState = EILHwDeviceIdle; - iStopping = EFalse; - } - else if((aErrorCode != KErrNone ) && (iState == EILHwDeviceExecuting)) - { - // stop the hardware device if we are still executing - StopHwDevice(aErrorCode); - - iCodecCallbackComplete = EFalse; - iRendererCallbackComplete = EFalse; - } - } - } +// 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: +// vorbisdecilhwdevice.cpp +// +// + +#include "omxilvorbdechwdevice.h" + +#include +#include +#include +#include + +#include "tilstructtypes.h" +#include "ilcomponentif.h" +#include "iltestuids.hrh" + + + +_LIT8(KNULLName,""); +_LIT8(KVorbisDecoderILComponentName,"OMX.SYMBIAN.AUDIO.DECODER.VORBIS"); + +const TInt KZerothPort = 0; +const TInt KInputPortIndex = 0; +const TInt KMaxNumberPort = 1; + +// _________________________________________________________________________________ +// Map the interface implementation KUidAudioDecILHwDevice UID to the implementation + +const TImplementationProxy ImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY(KUidOmxILVorbDecHwDevice , COmxILVorbDecHwDevice::NewL) + }; + +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) + { + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + + return ImplementationTable; + } +// _________________________________________________________________________________ + + +/* +The destructor. Releases the components and frees any owned buffers. +@see CMMFHwDevice::~CMMFHwDevice() +*/ +COmxILVorbDecHwDevice::~COmxILVorbDecHwDevice() + { + Stop(); + + if (iCodecIf) + { + iCodecIf->ReleaseComponent(); + iCodecIf = NULL; + } + if (iRendererIf) + { + iRendererIf->ReleaseComponent(); + iRendererIf = NULL; + } + + iCodecInPortIf = NULL; + iCodecOutPortIf = NULL; + iRendererInPortIf = NULL; + + delete iInBuffer; + iInBuffer = NULL; + delete iOutBuffer; + iOutBuffer = NULL; + + delete iActiveWait; + + OMX_Deinit(); + } + +/** +Creates a new COmxILVorbDecHwDevice object. +The COmxILVorbDecHwDevice state is set to EILHwDeviceLoaderLoaded. +@see TILHwDevState +*/ +COmxILVorbDecHwDevice* COmxILVorbDecHwDevice::NewL() + { + COmxILVorbDecHwDevice* self = new (ELeave) COmxILVorbDecHwDevice; + CleanupStack::PushL (self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +/* +Default constructor. +*/ +COmxILVorbDecHwDevice::COmxILVorbDecHwDevice() + { + } + +/* +Second phase constructor +*/ +void COmxILVorbDecHwDevice::ConstructL() + { + iActiveWait = new (ELeave) CActiveSchedulerWait; + iState = EILHwDeviceCreated; + OMX_Init(); + + iCodecIf = CILComponentIf::CreateImplementationL(TUid::Uid(KUidOmxILDummyAudioDecMILIFPlugin)); + iCodecIf->CreateComponentL(KVorbisDecoderILComponentName, *this); + User::LeaveIfError(iCodecIf->SetComponentIfRole(KUidFormatOGG)); + + iRendererIf = CILComponentIf::CreateImplementationL(TUid::Uid(KUidDummyPcmRendererMILIFPlugin)); + iRendererIf->CreateComponentL(KNULLName, *this); // + + } + +/* +@see CMMFHwDevice::Start() +@see TDeviceFunc +*/ +TInt COmxILVorbDecHwDevice::Start(TDeviceFunc aFuncCmd, TDeviceFlow /*aFlowCmd*/) + { + if (!((aFuncCmd == EDevDecode)|(aFuncCmd == EDevNullFunc))) + { + return KErrArgument; + } + + TInt err = KErrNone; + switch(aFuncCmd) + { + case EDevDecode: + { + err = StartDecode(); + break; + } + default: + { + err = KErrNotSupported; + } + } + + return err; + } + + +/* +Starts the execution of the decode operation, and sets the state +of the COmxILVorbDecHwDevice to EILHwDeviceExecuting. +@return An error code indicating if the function call was successful. +KErrNone on success, otherwise another of the system-wide error codes. +*/ +TInt COmxILVorbDecHwDevice::StartExecuting() + { + TInt err = KErrNone; + iCodecOutPortIf->FillThisBuffer(*iOutBuffer); + err = iHwDeviceObserver->FillThisHwBuffer(*iInBuffer); + if(err != KErrNone) + { + return err; + } + + iState = EILHwDeviceExecuting; + + iCodecIf->Execute(); + iRendererIf->Execute(); + + return err; + } + +/* +Initialises the decode operation, and set the state of the COmxILVorbDecHwDevice +to EILHwDeviceInitializing. +@return An error code indicating if the function call was successful. +KErrNone on success, otherwise another of the system-wide error codes. +*/ +TInt COmxILVorbDecHwDevice::InitializeDecode() + { + ASSERT(iCodecOutPortIf && iRendererInPortIf); + + //GetConfig from codec input port; + TILPortDefinition paramStruct; + TPortDefinitionType* config = NULL; + TInt err =iCodecIf->GetConfig(paramStruct, iCodecInPortIf); + if (err != KErrNone) + { + return err; + } + config = TILPortDefinition::GetStructure(paramStruct); + TRAP(err, iInBuffer = CMMFDescriptorBuffer::NewL(config->nBufferSize)); + if(err != KErrNone) + { + return err; + } + iCodecInPortIf->UseBuffer(*iInBuffer); + + //GetConfig from codec output port; + err =iCodecIf->GetConfig(paramStruct, iCodecOutPortIf); + if (err != KErrNone) + { + return err; + } + config = TILPortDefinition::GetStructure(paramStruct); + TRAP(err, iOutBuffer = CMMFDescriptorBuffer::NewL(config->nBufferSize)); + if(err != KErrNone) + { + return err; + } + iCodecOutPortIf->UseBuffer(*iOutBuffer); + + iState = EILHwDeviceInitializing; + + iCodecIf->Initialize(); + iRendererIf->Initialize(); + + iActiveWait->Start(); + return KErrNone; + } + +/* +Starts the decode operation, providing that the intial state of the +COmxILVorbDecHwDevice is EILHwDeviceLoaded. +@return An error code indicating if the function call was successful. +KErrNone on success, otherwise another of the system-wide error codes. +*/ +TInt COmxILVorbDecHwDevice::StartDecode() + { + TInt err = KErrNone; + if (iState == EILHwDeviceLoaded) + { + err = InitializeDecode(); + } + if (err != KErrNone) + { + return err; + } + if (iState == EILHwDeviceIdle) + { + // Ensure that the LastBuffer flags are reset. + iInBuffer->SetLastBuffer(EFalse); + iOutBuffer->SetLastBuffer(EFalse); + } + return StartExecuting(); + } + +/* +@see CMMFHwDevice::Stop() +*/ +TInt COmxILVorbDecHwDevice::Stop() + { + if(iState == EILHwDeviceExecuting || iState == EILHwDevicePaused) + { + iStopping = ETrue; + + // reset the flags + iCodecCallbackComplete = EFalse; + iRendererCallbackComplete = EFalse; + + if(iRendererIf) + { + iRendererIf->Stop(); + } + if(iCodecIf) + { + iCodecIf->Stop(); + } + + iState = EILHwDeviceIdle; + } + return KErrNone; + } + +/* +@see CMMFHwDevice::Pause() +*/ +TInt COmxILVorbDecHwDevice::Pause() + { + TInt err = KErrNone; + if(iState != EILHwDevicePaused) + { + if(iRendererIf) + { + err = iRendererIf->Pause(); + } + iState = EILHwDevicePaused; + } + return err; + } + +/* +@see CMMFHwDevice::Init() +*/ +TInt COmxILVorbDecHwDevice::Init(THwDeviceInitParams& aDevInfo) + { + RPointerArray ifPorts; + + if(!aDevInfo.iHwDeviceObserver) + { + return KErrArgument; + } + iHwDeviceObserver = aDevInfo.iHwDeviceObserver; + + if(!iCodecIf) + { + return KErrNotSupported; + } + + // Get decoder input port. For this particular scenario expects one single port. + TInt err = iCodecIf->GetComponentInputPorts(ifPorts); + if (err == KErrNone && ifPorts.Count() == KMaxNumberPort) + { + iCodecInPortIf = ifPorts[KZerothPort]; + ifPorts.Close(); + } + else + { + if (!ifPorts.Count() != KMaxNumberPort) + { + err = KErrNotFound; + } + ifPorts.Close(); + return err; + } + + // Get decoder ouput port. For this particular scenario expects one single port. + err = iCodecIf->GetComponentOutputPorts(ifPorts); + if (err == KErrNone && ifPorts.Count() == KMaxNumberPort) + { + iCodecOutPortIf = ifPorts[KZerothPort]; + ifPorts.Close(); + } + else + { + if (!ifPorts.Count() != KMaxNumberPort) + { + err = KErrNotFound; + } + ifPorts.Close(); + return err; + } + + if(!iRendererIf) + { + return KErrNotSupported; + } + + // Get renderer inport port. For this particular scenario expects one single port. + err = iRendererIf->GetComponentInputPorts(ifPorts); + if (err == KErrNone && ifPorts.Count() == KMaxNumberPort) + { + iRendererInPortIf = ifPorts[KZerothPort]; + ifPorts.Close(); + } + else + { + if (!ifPorts.Count() != KMaxNumberPort) + { + err = KErrNotFound; + } + ifPorts.Close(); + return err; + } + + iState = EILHwDeviceLoaded; + return KErrNone; + } + +/* +@see CMMFHwDevice::CustomInterface() +*/ +TAny* COmxILVorbDecHwDevice::CustomInterface(TUid aInterfaceId) + { + if (aInterfaceId.iUid == KMmfPlaySettingsCustomInterface) + { + return iRendererIf->CustomInterface(aInterfaceId); + } + else + { + return NULL; + } + } + +/* +@see CMMFHwDevice::ThisHwBufferFilled() +*/ +TInt COmxILVorbDecHwDevice::ThisHwBufferFilled(CMMFBuffer& aFillBufferPtr) + { + aFillBufferPtr.SetStatus(EFull); + iCodecInPortIf->EmptyThisBuffer(aFillBufferPtr); + return KErrNone; + } + +/* +@see CMMFHwDevice::ThisHwBufferEmptied() +*/ +TInt COmxILVorbDecHwDevice::ThisHwBufferEmptied(CMMFBuffer& /*aEmptyBufferPtr*/) + { + // Not used while decoding + return KErrNotSupported; + } + +/* +@see CMMFHwDevice::SetConfig() +*/ +TInt COmxILVorbDecHwDevice::SetConfig(TTaskConfig& aConfig) + { + TInt err = KErrNone; + + // Configure the Codec component + TILTaskConfig configStruct(aConfig); + err = iCodecIf->SetConfig(configStruct, iCodecInPortIf); + if(err != KErrNone) + { + return err; + } + err = iCodecIf->SetConfig(configStruct, iCodecOutPortIf); + if(err != KErrNone) + { + return err; + } + err = iRendererIf->SetConfig(configStruct, iCodecInPortIf); + if(err != KErrNone) + { + return err; + } + + return KErrNone; + } + +/* +@see CMMFHwDevice::StopAndDeleteCodec() +*/ +TInt COmxILVorbDecHwDevice::StopAndDeleteCodec() + { + TInt stopError = Stop(); + TInt deleteError = DeleteCodec(); + + if (stopError != KErrNone) + { + return stopError; + } + else + { + return deleteError; + } + } + +/* +Unloads all components, and deletes any locally owned buffers. +State is set to EILHwDeviceLoaderLoaded. + +@see CMMFHwDevice::DeleteCodec() +*/ +TInt COmxILVorbDecHwDevice::DeleteCodec() + { + Stop(); + if (iCodecIf) + { + iCodecIf->ReleaseComponent(); + iCodecIf = NULL; + } + if (iRendererIf) + { + iRendererIf->ReleaseComponent(); + iRendererIf = NULL; + } + + iCodecInPortIf = NULL; + iCodecOutPortIf = NULL; + iRendererInPortIf = NULL; + + delete iInBuffer; + iInBuffer = NULL; + delete iOutBuffer; + iOutBuffer = NULL; + + iState = EILHwDeviceCreated; + + return KErrNone; + } + +/* +Called to indicate that the Hardware Device has been stopped, leading +to callbacks to the observer. +@see MMMFHwDeviceObserver::Stopped() +@see MMMFHwDeviceObserver::Error() +*/ +void COmxILVorbDecHwDevice::StopHwDevice(TInt error) + { + iHwDeviceObserver->Stopped(); + iHwDeviceObserver->Error(error); + } + +/* +Called to process messages from the IL components +*/ +TInt COmxILVorbDecHwDevice::MsgFromILComponent(const MILComponentIf* aComponent, const TILEvent& aEvent) + { + TInt err = KErrNone; + switch (aEvent.iEvent) + { + case EEventCmdComplete: + { + if (aEvent.iData1 == ECommandStateSet) + { + if (aEvent.iData2 == EComponentIdle) + { + if (iState == EILHwDeviceInitializing) + { + InitializeComplete(aComponent, KErrNone); + } + else + { + ExecuteComplete(aComponent, KErrNone); + } + } + else if(aEvent.iData2 == EComponentExecuting) + { + ExecuteComplete(aComponent, KErrNone); + } + else + { + StopHwDevice(KErrNotSupported); + } + break; + } + else if (aEvent.iData1 == ECommandFlush) + { + //Command Flush completed + err = KErrNotSupported; // check what a3f should do here if anything + break; + } + } + case EEventBufferFlag: + { + if (aEvent.iData1 == KInputPortIndex) + { + if (iState == EILHwDeviceExecuting) + { + StopHwDevice(aEvent.iData2); + iState = EILHwDeviceIdle; + } + } + else + { + err = KErrNotSupported; + } + break; + } + default: + { + err = KErrNotSupported; + StopHwDevice(err); + } + } + return err; + } + +/* +Called to indicate that the buffer has been delivered. +*/ +TInt COmxILVorbDecHwDevice::BufferDelivered(const MILComponentPortIf* aPort, const CMMFBuffer* aBuffer) + { + TInt err = KErrNone; + + if(aPort == iCodecInPortIf) + { + if (!aBuffer->LastBuffer()) + { + // if the device is idle (having been Stopped) then + // FillThisHwBuffer will cause a kern-exec, + // as the DevSoundSession no longer has a buffer + if(iState == EILHwDeviceExecuting) + { + err = iHwDeviceObserver->FillThisHwBuffer(const_cast(*aBuffer)); + if(err != KErrNone) + { + StopHwDevice(err); + } + } + } + } + else if (aPort == iRendererInPortIf) + { + if (!aBuffer->LastBuffer()) + { + err = iCodecOutPortIf->FillThisBuffer(*iOutBuffer); + } + } + else if(aPort == iCodecOutPortIf) + { + err = iRendererInPortIf->EmptyThisBuffer(*aBuffer); + } + else + { + err = KErrNotSupported; + } + return err; + } + +void COmxILVorbDecHwDevice::InitializeComplete(const MILComponentIf* aComponent, TInt aErrorCode) + { + if(aErrorCode != KErrNone) + { + // stop waiting on the active scheduler if we were doing so + if (iState == EILHwDeviceInitializing) + { + // change state back to loaded + iState = EILHwDeviceLoaded; + iActiveWait->AsyncStop(); + } + return; + } + + if(aComponent == iCodecIf) + { + iCodecCallbackComplete = ETrue; + } + else if(aComponent == iRendererIf) + { + iRendererCallbackComplete = ETrue; + } + + if(iCodecCallbackComplete && iRendererCallbackComplete) + { + // reset the flags + iCodecCallbackComplete = EFalse; + iRendererCallbackComplete = EFalse; + + // Both components initialised OK + if (iState == EILHwDeviceInitializing) + { + iActiveWait->AsyncStop(); + } + iState = EILHwDeviceIdle; + } + } + +void COmxILVorbDecHwDevice::ExecuteComplete(const MILComponentIf* aComponent, TInt aErrorCode) + { + + if(aComponent == iCodecIf) + { + iCodecCallbackComplete = ETrue; + } + else if(aComponent == iRendererIf) + { + iRendererCallbackComplete = ETrue; + } + + if (iCodecCallbackComplete && iRendererCallbackComplete) + { + if (iStopping) + { + StopHwDevice(aErrorCode); + iState = EILHwDeviceIdle; + iStopping = EFalse; + } + else if((aErrorCode != KErrNone ) && (iState == EILHwDeviceExecuting)) + { + // stop the hardware device if we are still executing + StopHwDevice(aErrorCode); + + iCodecCallbackComplete = EFalse; + iRendererCallbackComplete = EFalse; + } + } + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/unittest/test_plugins/audioilhwdevice_mvs_test/omxilvorbdechwdevice/omxilvorbdechwdevice.h --- a/omxil/mmilapi/unittest/test_plugins/audioilhwdevice_mvs_test/omxilvorbdechwdevice/omxilvorbdechwdevice.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/unittest/test_plugins/audioilhwdevice_mvs_test/omxilvorbdechwdevice/omxilvorbdechwdevice.h Fri May 07 16:25:23 2010 +0100 @@ -1,124 +1,124 @@ -// 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 OMXILVORBDECHWDEVICE_H -#define OMXILVORBDECHWDEVICE_H - -#include -#include -#include - -#include "milcomponentportif.h" -#include "milifobserver.h" - -class CMMFBuffer; - -/** -Audio Decoder IL Hardware Device class that uses IL Components in order to decode audio data. -@see CMMFHwDevice -@see MMdfHwDeviceSetup -@see MILIfObserver -*/ -class COmxILVorbDecHwDevice : public CMMFHwDevice, - public MILIfObserver - { -public: - /* - The current state of the IL Hardware Device. - */ - enum TILHwDevState - { - /* - The HwDevice has just been created. - */ - EILHwDeviceCreated, - /* - The components have been loaded. - */ - EILHwDeviceLoaded, - /* - The components are currently being initialised. - */ - EILHwDeviceInitializing, - /* - The components are currently in the idle state. - */ - EILHwDeviceIdle, - /* - The components are currently in the executing state. - */ - EILHwDeviceExecuting, - /* - The components are currently in the paused state. - */ - EILHwDevicePaused - }; - -public: - static COmxILVorbDecHwDevice* NewL(); - - // from CMMFHwDevice - TInt Start(TDeviceFunc aFuncCmd, TDeviceFlow aFlowCmd); - TInt Stop(); - TInt Pause(); - TInt Init(THwDeviceInitParams& aDevInfo); - TAny* CustomInterface(TUid aInterfaceId); - TInt ThisHwBufferFilled(CMMFBuffer& aFillBufferPtr); - TInt ThisHwBufferEmptied(CMMFBuffer& aEmptyBufferPtr); - TInt SetConfig(TTaskConfig& aConfig); - TInt StopAndDeleteCodec(); - TInt DeleteCodec(); - ~COmxILVorbDecHwDevice(); - - // from MILIfObserver - TInt MsgFromILComponent(const MILComponentIf* aComponent,const TILEvent& aEvent); - TInt BufferDelivered(const MILComponentPortIf* aPort, const CMMFBuffer* aBuffer); - - -private: - COmxILVorbDecHwDevice(); - void ConstructL(); - TInt CreateBuffers(); - TInt StartDecode(); - TInt InitializeDecode(); - TInt StartExecuting(); - void StopHwDevice(TInt error); - - void InitializeComplete(const MILComponentIf* aComponent, TInt aErrorCode); - void ExecuteComplete(const MILComponentIf* aComponent, TInt aErrorCode); - -private: - MILComponentIf* iCodecIf; - MILComponentIf* iRendererIf; - MILComponentPortIf* iCodecInPortIf; - MILComponentPortIf* iCodecOutPortIf; - MILComponentPortIf* iRendererInPortIf; - CMMFBuffer* iInBuffer; - CMMFBuffer* iOutBuffer; - TBool iCodecCallbackComplete; - TBool iRendererCallbackComplete; - - TILHwDevState iState; - TBool iStopping; - - CActiveSchedulerWait* iActiveWait; - }; - -#endif // OMXILVORBDECHWDEVICE_H +// 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 OMXILVORBDECHWDEVICE_H +#define OMXILVORBDECHWDEVICE_H + +#include +#include +#include + +#include "milcomponentportif.h" +#include "milifobserver.h" + +class CMMFBuffer; + +/** +Audio Decoder IL Hardware Device class that uses IL Components in order to decode audio data. +@see CMMFHwDevice +@see MMdfHwDeviceSetup +@see MILIfObserver +*/ +class COmxILVorbDecHwDevice : public CMMFHwDevice, + public MILIfObserver + { +public: + /* + The current state of the IL Hardware Device. + */ + enum TILHwDevState + { + /* + The HwDevice has just been created. + */ + EILHwDeviceCreated, + /* + The components have been loaded. + */ + EILHwDeviceLoaded, + /* + The components are currently being initialised. + */ + EILHwDeviceInitializing, + /* + The components are currently in the idle state. + */ + EILHwDeviceIdle, + /* + The components are currently in the executing state. + */ + EILHwDeviceExecuting, + /* + The components are currently in the paused state. + */ + EILHwDevicePaused + }; + +public: + static COmxILVorbDecHwDevice* NewL(); + + // from CMMFHwDevice + TInt Start(TDeviceFunc aFuncCmd, TDeviceFlow aFlowCmd); + TInt Stop(); + TInt Pause(); + TInt Init(THwDeviceInitParams& aDevInfo); + TAny* CustomInterface(TUid aInterfaceId); + TInt ThisHwBufferFilled(CMMFBuffer& aFillBufferPtr); + TInt ThisHwBufferEmptied(CMMFBuffer& aEmptyBufferPtr); + TInt SetConfig(TTaskConfig& aConfig); + TInt StopAndDeleteCodec(); + TInt DeleteCodec(); + ~COmxILVorbDecHwDevice(); + + // from MILIfObserver + TInt MsgFromILComponent(const MILComponentIf* aComponent,const TILEvent& aEvent); + TInt BufferDelivered(const MILComponentPortIf* aPort, const CMMFBuffer* aBuffer); + + +private: + COmxILVorbDecHwDevice(); + void ConstructL(); + TInt CreateBuffers(); + TInt StartDecode(); + TInt InitializeDecode(); + TInt StartExecuting(); + void StopHwDevice(TInt error); + + void InitializeComplete(const MILComponentIf* aComponent, TInt aErrorCode); + void ExecuteComplete(const MILComponentIf* aComponent, TInt aErrorCode); + +private: + MILComponentIf* iCodecIf; + MILComponentIf* iRendererIf; + MILComponentPortIf* iCodecInPortIf; + MILComponentPortIf* iCodecOutPortIf; + MILComponentPortIf* iRendererInPortIf; + CMMFBuffer* iInBuffer; + CMMFBuffer* iOutBuffer; + TBool iCodecCallbackComplete; + TBool iRendererCallbackComplete; + + TILHwDevState iState; + TBool iStopping; + + CActiveSchedulerWait* iActiveWait; + }; + +#endif // OMXILVORBDECHWDEVICE_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/unittest/test_plugins/audioilhwdevice_mvs_test/omxilvorbdechwdevice/omxilvorbdechwdevice.rss --- a/omxil/mmilapi/unittest/test_plugins/audioilhwdevice_mvs_test/omxilvorbdechwdevice/omxilvorbdechwdevice.rss Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/unittest/test_plugins/audioilhwdevice_mvs_test/omxilvorbdechwdevice/omxilvorbdechwdevice.rss Fri May 07 16:25:23 2010 +0100 @@ -1,41 +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: -// - -#include -#include // for Mmf Plugin Interface HwDevice UID -#include "iltestuids.hrh" - -RESOURCE REGISTRY_INFO theInfo - { - dll_uid = KUidOmxILVorbDecHwDeviceDll; - interfaces = - { - INTERFACE_INFO - { - interface_uid = KMmfUidPluginInterfaceHwDevice; - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = KUidOmxILVorbDecHwDevice; - version_no = 1; - display_name = "OMX IL Vorbis Decoder Hw Device"; - default_data = "VRBT, P16" ; // four CC code is a dummy VRBT = Vorb Test - opaque_data = ""; - } - }; - } - }; - } +// 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 +#include // for Mmf Plugin Interface HwDevice UID +#include "iltestuids.hrh" + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = KUidOmxILVorbDecHwDeviceDll; + interfaces = + { + INTERFACE_INFO + { + interface_uid = KMmfUidPluginInterfaceHwDevice; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KUidOmxILVorbDecHwDevice; + version_no = 1; + display_name = "OMX IL Vorbis Decoder Hw Device"; + default_data = "VRBT, P16" ; // four CC code is a dummy VRBT = Vorb Test + opaque_data = ""; + } + }; + } + }; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/unittest/test_plugins/dummypcmrenderer/dummypcmrenderer.cpp --- a/omxil/mmilapi/unittest/test_plugins/dummypcmrenderer/dummypcmrenderer.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/unittest/test_plugins/dummypcmrenderer/dummypcmrenderer.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,532 +1,532 @@ -// 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 "dummypcmrenderer.h" -#include "iltestuids.hrh" -#include "tilstructtypes.h" -#include -#include - - -#define KDummyPCM16FormatUid 0x10111126 //dummy - -const TInt KBufferSize = 16384; // we need 16k to hold a pcm packet - -const TInt KDefaultSampleRate = 8000; -const TInt KDefaultNumberChannels = 1; - -const TInt KInputPortIndex = 0; - - -// ------------------------------------------------------------------------------------------ -// CDummyPcmRenderer::CInputPort Implementation - -CDummyPcmRenderer::CInputPort::CInputPort(CDummyPcmRenderer& aParent) - : CActive(EPriorityNormal), - iParent(aParent), - iSampleRate(KDefaultSampleRate), - iChannels(KDefaultNumberChannels), - iBufferSize(KBufferSize) - { - CActiveScheduler::Add(this); - } - -CDummyPcmRenderer::CInputPort::~CInputPort() - { - Cancel(); - iBuffers.Close(); - } - -CDummyPcmRenderer::CInputPort* CDummyPcmRenderer::CInputPort::NewL(CDummyPcmRenderer& aParent) - { - CInputPort* self = new (ELeave) CInputPort(aParent); - return self; - } - -TInt CDummyPcmRenderer::CInputPort::FillThisBuffer(CMMFBuffer& /*aInputBuffer*/) - { - return KErrNotSupported; - } - -TInt CDummyPcmRenderer::CInputPort::EmptyThisBuffer(const CMMFBuffer& aInputBuffer) - { - TInt err = iBuffers.Append(&aInputBuffer); - if (err == KErrNone) - { - TILComponentState state; - if (iParent.GetState(state) != KErrNone) - { - return EComponentInvalid; - } - if (state == EComponentExecuting && !IsActive()) - { - SetActive(); - TRequestStatus* status = &iStatus; - User::RequestComplete(status, KErrNone); - } - } - return err; - } - -TInt CDummyPcmRenderer::CInputPort::TunnelRequest(MILComponentPortIf* aPort) - { - TILComponentState state; - if (iParent.GetState(state) != KErrNone) - { - return EComponentInvalid; - } - if (( state != EComponentLoaded) && (!iStopped)) - { - return EComponentInvalid; - } - - if (iPortConnectedTo) - { - // the port is already connected, return an error - return EPortAlreadyTunnelled; - } - iPortConnectedTo = const_cast(aPort); - return KErrNone; - } - -TInt CDummyPcmRenderer::CInputPort::DisconnectTunnel(MILComponentPortIf* /*aPort*/) - { - return KErrNotSupported; - } - -TInt CDummyPcmRenderer::CInputPort::PortIndex() const - { - return KInputPortIndex; - } - -TPortDirection CDummyPcmRenderer::CInputPort::PortDirection() const - { - return EDirInput; - } - - -CMMFBuffer* CDummyPcmRenderer::CInputPort::CreateBufferL(TInt /*aBufferSize*/) - { - User::Leave(KErrNotSupported); - return NULL; - } - -TInt CDummyPcmRenderer::CInputPort::UseBuffer(CMMFBuffer& /*aBuffer*/) - { - return KErrNotSupported; - } - -TInt CDummyPcmRenderer::CInputPort::FreeBuffer(CMMFBuffer* /*aBuffer*/) - { - return KErrNotSupported; - } - -TInt CDummyPcmRenderer::CInputPort::FlushPort() - { - return KErrNotSupported; - } - -TInt CDummyPcmRenderer::CInputPort::EnablePort() - { - return KErrNotSupported; - } - -TInt CDummyPcmRenderer::CInputPort::DisablePort() - { - return KErrNotSupported; - } - -MILComponentIf* CDummyPcmRenderer::CInputPort::PortComponent() const - { - return &iParent; - } - -void CDummyPcmRenderer::CInputPort::SetVolume(TUint aVolume) - { - iVolume = aVolume; - } - -TUint CDummyPcmRenderer::CInputPort::Volume() - { - return iVolume; - } - -TUint CDummyPcmRenderer::CInputPort::BytesPlayed() - { - return iBytesPlayed; - } - -void CDummyPcmRenderer::CInputPort::SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration) - { - iRampDuration = aRampDuration; - } - -TTimeIntervalMicroSeconds& CDummyPcmRenderer::CInputPort::VolumeRamp() - { - return iRampDuration; - } - -TInt CDummyPcmRenderer::CInputPort::SampleRate() - { - return iSampleRate; - } - -TInt CDummyPcmRenderer::CInputPort::Channels() - { - return iChannels; - } - -TUint32 CDummyPcmRenderer::CInputPort::BufferSize() const - { - return iBufferSize; - } - -void CDummyPcmRenderer::CInputPort::Execute() - { - if (!IsActive() && iBuffers.Count()>0) - { - SetActive(); - TRequestStatus* status = &iStatus; - User::RequestComplete(status, KErrNone); - } - } - -void CDummyPcmRenderer::CInputPort::Pause() - { - if (iParent.SoundDevice().Handle()) - { - iParent.SoundDevice().PausePlayBuffer(); - } - } - -void CDummyPcmRenderer::CInputPort::Stop() - { - Cancel(); - } - -void CDummyPcmRenderer::CInputPort::RunL() - { - - if (iCurrentBuffer != NULL) - { - // If we've been signalled with a buffer, callback that we've completed the writing of the - // buffer - if (iParent.Observer()) - { - iParent.Observer()->BufferDelivered(this, iCurrentBuffer); - if (iCurrentBuffer->LastBuffer()) - { - TILEvent thisEvent; - thisEvent.iEvent = EEventBufferFlag; - thisEvent.iData1 = PortIndex(); - thisEvent.iData2 = static_cast(KErrUnderflow); - iParent.Observer()->MsgFromILComponent(&iParent, thisEvent); - iParent.SoundDevice().Close(); - } - } - iCurrentBuffer = NULL; - } - - // only process the next buffer if there is no error - // error callbacks were handled in the previous block - if (iStatus == KErrNone) - { - if (iBuffers.Count()>0) - { - iCurrentBuffer = iBuffers[0]; - iBuffers.Remove(0); - - if (CMMFBuffer::IsSupportedDataBuffer(iCurrentBuffer->Type())) - { - TDes8& aBufferDes = (static_cast(iCurrentBuffer))->Data(); - iStatus = KRequestPending; - iParent.SoundDevice().PlayData(iStatus, aBufferDes); - SetActive(); - } - } - } - else - { - // In the real implementation here should be sending an error event back to the client - } - } - -void CDummyPcmRenderer::CInputPort::DoCancel() - { - if (iParent.SoundDevice().Handle()) - { - iParent.SoundDevice().CancelPlayData(); - iParent.SoundDevice().FlushPlayBuffer(); - } - } - -// ------------------------------------------------------------------------------------------ -// CDummyPcmRenderer Implementation - -CDummyPcmRenderer::CDummyPcmRenderer() - { - } - -CDummyPcmRenderer::~CDummyPcmRenderer() - { - delete iInputPort; - iSoundDevice.Close(); - } - -CDummyPcmRenderer* CDummyPcmRenderer::NewL() - { - CDummyPcmRenderer* self = new (ELeave) CDummyPcmRenderer; - return self; - } - -void CDummyPcmRenderer::CreateComponentL(const TDesC8& /*aComponentName*/, MILIfObserver& aComponentIfObserver) - { - iObserver = &aComponentIfObserver; - iInputPort = CInputPort::NewL(*this); - iState = EComponentLoaded; - } - -void CDummyPcmRenderer::CreateComponentL(const TUid& /*aUid*/, MILIfObserver& /*aComponentIfObserver*/) - { - User::LeaveIfError(KErrNotSupported); - }; - -void CDummyPcmRenderer::ReleaseComponent() - { - delete this; - } - -TInt CDummyPcmRenderer::GetComponentInputPorts(RPointerArray& aComponentPorts) const - { - return aComponentPorts.Append(iInputPort); - } - -TInt CDummyPcmRenderer::GetComponentOutputPorts(RPointerArray& /*aComponentPorts*/) const - { - return KErrNotSupported; - } - -TInt CDummyPcmRenderer::SetConfig(const TILStruct& aConfig, const MILComponentPortIf* /*aComponentPort*/) - { - if (aConfig.Uid() == TUid::Uid(KUidMMFTTaskConfig)) - { - const TTaskConfig* config = TILTaskConfig::GetStructure(aConfig); - ASSERT(config); - iInputPort->iSampleRate = config->iRate; - iInputPort->iChannels = (config->iStereoMode & ETaskMono)? 1 : 2; - iInputPort->iInterleaved = (config->iStereoMode & ETaskInterleaved)?ETrue : EFalse; - return KErrNone; - } - - return KErrNotSupported; - } - -TInt CDummyPcmRenderer::GetConfig(TILStruct& /*aConfig*/, const MILComponentPortIf* /*aComponentPort*/) const - { - return KErrNotSupported; - } - -TInt CDummyPcmRenderer::Initialize() - { - ASSERT(iObserver); - - TILEvent thisEvent; - thisEvent.iEvent = EEventCmdComplete; - thisEvent.iData1 = ECommandStateSet; - thisEvent.iData2 = EComponentIdle; - iObserver->MsgFromILComponent(this, thisEvent); - - iState = EComponentIdle; - return KErrNone; - } - -TInt CDummyPcmRenderer::UnInitialize() - { - ASSERT(iObserver); - - TILEvent thisEvent; - thisEvent.iEvent = EEventCmdComplete; - thisEvent.iData1 = ECommandStateSet; - thisEvent.iData2 = EComponentLoaded; - iObserver->MsgFromILComponent(this, thisEvent); - - iState = EComponentLoaded; - return KErrNone; - } - -TInt CDummyPcmRenderer::Execute() - { - ASSERT(iObserver); - TInt err = KErrNone; - if(!iSoundDevice.Handle()) - { - err = iSoundDevice.Open(); - } - - RMdaDevSound::TCurrentSoundFormatBuf buf; - if (err == KErrNone) - { - if(iState == EComponentPaused) - { - iSoundDevice.ResumePlaying(); - } - else - { - // Set play format (for input port) - iSoundDevice.GetPlayFormat(buf); - buf().iRate = iInputPort->SampleRate(); - buf().iChannels = iInputPort->Channels(); - buf().iBufferSize = KBufferSize; - buf().iEncoding = RMdaDevSound::EMdaSoundEncoding16BitPCM; - err = iSoundDevice.SetPlayFormat(buf); - } - } - iState = EComponentExecuting; - - TILEvent thisEvent; - thisEvent.iEvent = EEventCmdComplete; - thisEvent.iData1 = ECommandStateSet; - thisEvent.iData2 = EComponentExecuting; - iObserver->MsgFromILComponent(this, thisEvent); - - return err; - } - -TInt CDummyPcmRenderer::Pause() - { - iState = EComponentPaused; - iInputPort->Pause(); - return KErrNone; - } - -TInt CDummyPcmRenderer::Stop() - { - if(iState == EComponentExecuting || iState == EComponentPaused) - { - // Cancel and flush the device driver - iInputPort->Stop(); - - TILEvent thisEvent; - thisEvent.iEvent = EEventCmdComplete; - thisEvent.iData1 = ECommandStateSet; - thisEvent.iData2 = EComponentIdle; - iObserver->MsgFromILComponent(this, thisEvent); - - iState = EComponentIdle; - - // Close the sound device - iSoundDevice.Close(); - - return KErrNone; - } - else - { - // invalid state - return EComponentInvalid; - } - } - -TInt CDummyPcmRenderer::GetState(TILComponentState& aState) const - { - aState = iState; - return KErrNone; - } - -TInt CDummyPcmRenderer::SendCommand(const TILCommand& /*aCommand*/) - { - return KErrNotSupported; - } - -TInt CDummyPcmRenderer::FlushAllPorts() - { - return KErrNotSupported; - } - -TInt CDummyPcmRenderer::ComponentRoleEnum(TPtr8& /*aComponentRole*/, TUint32 /*aIndex*/) const - { - return KErrNotSupported; - } - -TInt CDummyPcmRenderer::GetComponentVersion(TILComponentVersion& /*aVersion*/) const - { - return KErrNotSupported; - } - -TInt CDummyPcmRenderer::SetComponentIfRole(const TDesC8& /*aComponentRole*/) - { - return KErrNotSupported; - } - -TInt CDummyPcmRenderer::GetComponentIfRole(TDes8& /*aComponentRole*/) const - { - return KErrNotSupported; - } - -TInt CDummyPcmRenderer::SetComponentIfRole(const TUid& /*aFormat*/) - { - // This interface is specific writen to support only this PCM renderer role - return KErrNotSupported; - } - -TInt CDummyPcmRenderer::GetComponentIfRole(TUid& aFormat) const - { - aFormat = TUid::Uid(KDummyPCM16FormatUid); - return KErrNone; - } - -TAny* CDummyPcmRenderer::CustomInterface(TUid aUid) - { - if (aUid.iUid == KMmfPlaySettingsCustomInterface) - { - return static_cast(iInputPort); - } - return NULL; - } - -TInt CDummyPcmRenderer::SetExtConfig(const TDesC8& /*aParameterName*/, const TILStruct& /*aConfig*/, const MILComponentPortIf* /*aComponentPort*/) - { - return KErrNotSupported; - } - -TInt CDummyPcmRenderer::GetExtConfig(const TDesC8& /*aParameterName*/, TILStruct& /*aConfig*/, const MILComponentPortIf* /*aComponentPort*/) const - { - return KErrNotSupported; - } - - -MILIfObserver* CDummyPcmRenderer::Observer() const - { - return iObserver; - } - -RMdaDevSound& CDummyPcmRenderer::SoundDevice() - { - return iSoundDevice; - } - - -// ------------------------------------------------------------------------------------------ -// ECOM Implementation table entry - -const TImplementationProxy ImplementationTable[] = - { - IMPLEMENTATION_PROXY_ENTRY(KUidDummyPcmRendererMILIFPlugin, CDummyPcmRenderer::NewL), - }; - -EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) - { - aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); - return ImplementationTable; - } +// 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 "dummypcmrenderer.h" +#include "iltestuids.hrh" +#include "tilstructtypes.h" +#include +#include + + +#define KDummyPCM16FormatUid 0x10111126 //dummy + +const TInt KBufferSize = 16384; // we need 16k to hold a pcm packet + +const TInt KDefaultSampleRate = 8000; +const TInt KDefaultNumberChannels = 1; + +const TInt KInputPortIndex = 0; + + +// ------------------------------------------------------------------------------------------ +// CDummyPcmRenderer::CInputPort Implementation + +CDummyPcmRenderer::CInputPort::CInputPort(CDummyPcmRenderer& aParent) + : CActive(EPriorityNormal), + iParent(aParent), + iSampleRate(KDefaultSampleRate), + iChannels(KDefaultNumberChannels), + iBufferSize(KBufferSize) + { + CActiveScheduler::Add(this); + } + +CDummyPcmRenderer::CInputPort::~CInputPort() + { + Cancel(); + iBuffers.Close(); + } + +CDummyPcmRenderer::CInputPort* CDummyPcmRenderer::CInputPort::NewL(CDummyPcmRenderer& aParent) + { + CInputPort* self = new (ELeave) CInputPort(aParent); + return self; + } + +TInt CDummyPcmRenderer::CInputPort::FillThisBuffer(CMMFBuffer& /*aInputBuffer*/) + { + return KErrNotSupported; + } + +TInt CDummyPcmRenderer::CInputPort::EmptyThisBuffer(const CMMFBuffer& aInputBuffer) + { + TInt err = iBuffers.Append(&aInputBuffer); + if (err == KErrNone) + { + TILComponentState state; + if (iParent.GetState(state) != KErrNone) + { + return EComponentInvalid; + } + if (state == EComponentExecuting && !IsActive()) + { + SetActive(); + TRequestStatus* status = &iStatus; + User::RequestComplete(status, KErrNone); + } + } + return err; + } + +TInt CDummyPcmRenderer::CInputPort::TunnelRequest(MILComponentPortIf* aPort) + { + TILComponentState state; + if (iParent.GetState(state) != KErrNone) + { + return EComponentInvalid; + } + if (( state != EComponentLoaded) && (!iStopped)) + { + return EComponentInvalid; + } + + if (iPortConnectedTo) + { + // the port is already connected, return an error + return EPortAlreadyTunnelled; + } + iPortConnectedTo = const_cast(aPort); + return KErrNone; + } + +TInt CDummyPcmRenderer::CInputPort::DisconnectTunnel(MILComponentPortIf* /*aPort*/) + { + return KErrNotSupported; + } + +TInt CDummyPcmRenderer::CInputPort::PortIndex() const + { + return KInputPortIndex; + } + +TPortDirection CDummyPcmRenderer::CInputPort::PortDirection() const + { + return EDirInput; + } + + +CMMFBuffer* CDummyPcmRenderer::CInputPort::CreateBufferL(TInt /*aBufferSize*/) + { + User::Leave(KErrNotSupported); + return NULL; + } + +TInt CDummyPcmRenderer::CInputPort::UseBuffer(CMMFBuffer& /*aBuffer*/) + { + return KErrNotSupported; + } + +TInt CDummyPcmRenderer::CInputPort::FreeBuffer(CMMFBuffer* /*aBuffer*/) + { + return KErrNotSupported; + } + +TInt CDummyPcmRenderer::CInputPort::FlushPort() + { + return KErrNotSupported; + } + +TInt CDummyPcmRenderer::CInputPort::EnablePort() + { + return KErrNotSupported; + } + +TInt CDummyPcmRenderer::CInputPort::DisablePort() + { + return KErrNotSupported; + } + +MILComponentIf* CDummyPcmRenderer::CInputPort::PortComponent() const + { + return &iParent; + } + +void CDummyPcmRenderer::CInputPort::SetVolume(TUint aVolume) + { + iVolume = aVolume; + } + +TUint CDummyPcmRenderer::CInputPort::Volume() + { + return iVolume; + } + +TUint CDummyPcmRenderer::CInputPort::BytesPlayed() + { + return iBytesPlayed; + } + +void CDummyPcmRenderer::CInputPort::SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration) + { + iRampDuration = aRampDuration; + } + +TTimeIntervalMicroSeconds& CDummyPcmRenderer::CInputPort::VolumeRamp() + { + return iRampDuration; + } + +TInt CDummyPcmRenderer::CInputPort::SampleRate() + { + return iSampleRate; + } + +TInt CDummyPcmRenderer::CInputPort::Channels() + { + return iChannels; + } + +TUint32 CDummyPcmRenderer::CInputPort::BufferSize() const + { + return iBufferSize; + } + +void CDummyPcmRenderer::CInputPort::Execute() + { + if (!IsActive() && iBuffers.Count()>0) + { + SetActive(); + TRequestStatus* status = &iStatus; + User::RequestComplete(status, KErrNone); + } + } + +void CDummyPcmRenderer::CInputPort::Pause() + { + if (iParent.SoundDevice().Handle()) + { + iParent.SoundDevice().PausePlayBuffer(); + } + } + +void CDummyPcmRenderer::CInputPort::Stop() + { + Cancel(); + } + +void CDummyPcmRenderer::CInputPort::RunL() + { + + if (iCurrentBuffer != NULL) + { + // If we've been signalled with a buffer, callback that we've completed the writing of the + // buffer + if (iParent.Observer()) + { + iParent.Observer()->BufferDelivered(this, iCurrentBuffer); + if (iCurrentBuffer->LastBuffer()) + { + TILEvent thisEvent; + thisEvent.iEvent = EEventBufferFlag; + thisEvent.iData1 = PortIndex(); + thisEvent.iData2 = static_cast(KErrUnderflow); + iParent.Observer()->MsgFromILComponent(&iParent, thisEvent); + iParent.SoundDevice().Close(); + } + } + iCurrentBuffer = NULL; + } + + // only process the next buffer if there is no error + // error callbacks were handled in the previous block + if (iStatus == KErrNone) + { + if (iBuffers.Count()>0) + { + iCurrentBuffer = iBuffers[0]; + iBuffers.Remove(0); + + if (CMMFBuffer::IsSupportedDataBuffer(iCurrentBuffer->Type())) + { + TDes8& aBufferDes = (static_cast(iCurrentBuffer))->Data(); + iStatus = KRequestPending; + iParent.SoundDevice().PlayData(iStatus, aBufferDes); + SetActive(); + } + } + } + else + { + // In the real implementation here should be sending an error event back to the client + } + } + +void CDummyPcmRenderer::CInputPort::DoCancel() + { + if (iParent.SoundDevice().Handle()) + { + iParent.SoundDevice().CancelPlayData(); + iParent.SoundDevice().FlushPlayBuffer(); + } + } + +// ------------------------------------------------------------------------------------------ +// CDummyPcmRenderer Implementation + +CDummyPcmRenderer::CDummyPcmRenderer() + { + } + +CDummyPcmRenderer::~CDummyPcmRenderer() + { + delete iInputPort; + iSoundDevice.Close(); + } + +CDummyPcmRenderer* CDummyPcmRenderer::NewL() + { + CDummyPcmRenderer* self = new (ELeave) CDummyPcmRenderer; + return self; + } + +void CDummyPcmRenderer::CreateComponentL(const TDesC8& /*aComponentName*/, MILIfObserver& aComponentIfObserver) + { + iObserver = &aComponentIfObserver; + iInputPort = CInputPort::NewL(*this); + iState = EComponentLoaded; + } + +void CDummyPcmRenderer::CreateComponentL(const TUid& /*aUid*/, MILIfObserver& /*aComponentIfObserver*/) + { + User::LeaveIfError(KErrNotSupported); + }; + +void CDummyPcmRenderer::ReleaseComponent() + { + delete this; + } + +TInt CDummyPcmRenderer::GetComponentInputPorts(RPointerArray& aComponentPorts) const + { + return aComponentPorts.Append(iInputPort); + } + +TInt CDummyPcmRenderer::GetComponentOutputPorts(RPointerArray& /*aComponentPorts*/) const + { + return KErrNotSupported; + } + +TInt CDummyPcmRenderer::SetConfig(const TILStruct& aConfig, const MILComponentPortIf* /*aComponentPort*/) + { + if (aConfig.Uid() == TUid::Uid(KUidMMFTTaskConfig)) + { + const TTaskConfig* config = TILTaskConfig::GetStructure(aConfig); + ASSERT(config); + iInputPort->iSampleRate = config->iRate; + iInputPort->iChannels = (config->iStereoMode & ETaskMono)? 1 : 2; + iInputPort->iInterleaved = (config->iStereoMode & ETaskInterleaved)?ETrue : EFalse; + return KErrNone; + } + + return KErrNotSupported; + } + +TInt CDummyPcmRenderer::GetConfig(TILStruct& /*aConfig*/, const MILComponentPortIf* /*aComponentPort*/) const + { + return KErrNotSupported; + } + +TInt CDummyPcmRenderer::Initialize() + { + ASSERT(iObserver); + + TILEvent thisEvent; + thisEvent.iEvent = EEventCmdComplete; + thisEvent.iData1 = ECommandStateSet; + thisEvent.iData2 = EComponentIdle; + iObserver->MsgFromILComponent(this, thisEvent); + + iState = EComponentIdle; + return KErrNone; + } + +TInt CDummyPcmRenderer::UnInitialize() + { + ASSERT(iObserver); + + TILEvent thisEvent; + thisEvent.iEvent = EEventCmdComplete; + thisEvent.iData1 = ECommandStateSet; + thisEvent.iData2 = EComponentLoaded; + iObserver->MsgFromILComponent(this, thisEvent); + + iState = EComponentLoaded; + return KErrNone; + } + +TInt CDummyPcmRenderer::Execute() + { + ASSERT(iObserver); + TInt err = KErrNone; + if(!iSoundDevice.Handle()) + { + err = iSoundDevice.Open(); + } + + RMdaDevSound::TCurrentSoundFormatBuf buf; + if (err == KErrNone) + { + if(iState == EComponentPaused) + { + iSoundDevice.ResumePlaying(); + } + else + { + // Set play format (for input port) + iSoundDevice.GetPlayFormat(buf); + buf().iRate = iInputPort->SampleRate(); + buf().iChannels = iInputPort->Channels(); + buf().iBufferSize = KBufferSize; + buf().iEncoding = RMdaDevSound::EMdaSoundEncoding16BitPCM; + err = iSoundDevice.SetPlayFormat(buf); + } + } + iState = EComponentExecuting; + + TILEvent thisEvent; + thisEvent.iEvent = EEventCmdComplete; + thisEvent.iData1 = ECommandStateSet; + thisEvent.iData2 = EComponentExecuting; + iObserver->MsgFromILComponent(this, thisEvent); + + return err; + } + +TInt CDummyPcmRenderer::Pause() + { + iState = EComponentPaused; + iInputPort->Pause(); + return KErrNone; + } + +TInt CDummyPcmRenderer::Stop() + { + if(iState == EComponentExecuting || iState == EComponentPaused) + { + // Cancel and flush the device driver + iInputPort->Stop(); + + TILEvent thisEvent; + thisEvent.iEvent = EEventCmdComplete; + thisEvent.iData1 = ECommandStateSet; + thisEvent.iData2 = EComponentIdle; + iObserver->MsgFromILComponent(this, thisEvent); + + iState = EComponentIdle; + + // Close the sound device + iSoundDevice.Close(); + + return KErrNone; + } + else + { + // invalid state + return EComponentInvalid; + } + } + +TInt CDummyPcmRenderer::GetState(TILComponentState& aState) const + { + aState = iState; + return KErrNone; + } + +TInt CDummyPcmRenderer::SendCommand(const TILCommand& /*aCommand*/) + { + return KErrNotSupported; + } + +TInt CDummyPcmRenderer::FlushAllPorts() + { + return KErrNotSupported; + } + +TInt CDummyPcmRenderer::ComponentRoleEnum(TPtr8& /*aComponentRole*/, TUint32 /*aIndex*/) const + { + return KErrNotSupported; + } + +TInt CDummyPcmRenderer::GetComponentVersion(TILComponentVersion& /*aVersion*/) const + { + return KErrNotSupported; + } + +TInt CDummyPcmRenderer::SetComponentIfRole(const TDesC8& /*aComponentRole*/) + { + return KErrNotSupported; + } + +TInt CDummyPcmRenderer::GetComponentIfRole(TDes8& /*aComponentRole*/) const + { + return KErrNotSupported; + } + +TInt CDummyPcmRenderer::SetComponentIfRole(const TUid& /*aFormat*/) + { + // This interface is specific writen to support only this PCM renderer role + return KErrNotSupported; + } + +TInt CDummyPcmRenderer::GetComponentIfRole(TUid& aFormat) const + { + aFormat = TUid::Uid(KDummyPCM16FormatUid); + return KErrNone; + } + +TAny* CDummyPcmRenderer::CustomInterface(TUid aUid) + { + if (aUid.iUid == KMmfPlaySettingsCustomInterface) + { + return static_cast(iInputPort); + } + return NULL; + } + +TInt CDummyPcmRenderer::SetExtConfig(const TDesC8& /*aParameterName*/, const TILStruct& /*aConfig*/, const MILComponentPortIf* /*aComponentPort*/) + { + return KErrNotSupported; + } + +TInt CDummyPcmRenderer::GetExtConfig(const TDesC8& /*aParameterName*/, TILStruct& /*aConfig*/, const MILComponentPortIf* /*aComponentPort*/) const + { + return KErrNotSupported; + } + + +MILIfObserver* CDummyPcmRenderer::Observer() const + { + return iObserver; + } + +RMdaDevSound& CDummyPcmRenderer::SoundDevice() + { + return iSoundDevice; + } + + +// ------------------------------------------------------------------------------------------ +// ECOM Implementation table entry + +const TImplementationProxy ImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY(KUidDummyPcmRendererMILIFPlugin, CDummyPcmRenderer::NewL), + }; + +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) + { + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + return ImplementationTable; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/unittest/test_plugins/dummypcmrenderer/dummypcmrenderer.h --- a/omxil/mmilapi/unittest/test_plugins/dummypcmrenderer/dummypcmrenderer.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/unittest/test_plugins/dummypcmrenderer/dummypcmrenderer.h Fri May 07 16:25:23 2010 +0100 @@ -1,159 +1,159 @@ -// 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 DUMMYPCMRENDERER_H -#define DUMMYPCMRENDERER_H - -#include -#include -#include - -#include "milcomponentportif.h" -#include "milifobserver.h" -#include "ilcomponentif.h" - -#ifdef SYMBIAN_MDF_SHAREDCHUNK_SOUNDDRIVER - #include "mdasoundadapter.h" -#else - #include -#endif - -class CMMFBuffer; - -/* -PCM sink renderer component (this is just a simple non-omx component for testing) -This component is used together with the omxilvorbdechwdevice and the OMXVorbisDecoder -for testing when requesting a HwDevice supporting VRB2 fourCC. -*/ -class CDummyPcmRenderer : public CILComponentIf - { -public: - /* - PCM sink input port - */ - class CInputPort: public CActive, - public MILComponentPortIf, - public MPlayCustomInterface - { - friend class CDummyPcmRenderer; - - public: - static CInputPort* NewL(CDummyPcmRenderer& aParent); - - // MILComponentPortIf - TInt FillThisBuffer(CMMFBuffer& aBuffer); - TInt EmptyThisBuffer(const CMMFBuffer& aBuffer); - TInt TunnelRequest(MILComponentPortIf* aPort); - TInt DisconnectTunnel(MILComponentPortIf* aPort); - TInt PortIndex() const; - TPortDirection PortDirection() const; - CMMFBuffer* CreateBufferL(TInt aBufferSize); - TInt UseBuffer(CMMFBuffer& aBuffer); - TInt FreeBuffer(CMMFBuffer* aBuffer); - TInt FlushPort(); - TInt EnablePort(); - TInt DisablePort(); - MILComponentIf* PortComponent() const; - - // from MPlayCustomInterface - void SetVolume(TUint aVolume); - TUint Volume(); - TUint BytesPlayed(); - void SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration); - TTimeIntervalMicroSeconds& VolumeRamp(); - TInt SampleRate(); - TInt Channels(); - - // from CActive - void RunL(); - void DoCancel(); - - // Internal - TUint32 BufferSize() const; - void Execute(); - void Pause(); - void Stop(); - ~CInputPort(); - - private: - explicit CInputPort(CDummyPcmRenderer& aParent); - - private: - CDummyPcmRenderer& iParent; - MILComponentPortIf* iPortConnectedTo; - CMMFBuffer* iCurrentBuffer; - RPointerArray iBuffers; - TInt iSampleRate; - TInt iChannels; - TBool iInterleaved; - TUint iVolume; - TTimeIntervalMicroSeconds iRampDuration; - TUint iBytesPlayed; - TBool iPaused; - TBool iStopped; - TUint iBufferSize; - }; -public: - static CDummyPcmRenderer* NewL(); - - // from MILComponentIf - void CreateComponentL(const TDesC8& aComponentName, MILIfObserver& aComponentIfObserver); - void CreateComponentL(const TUid& aUid, MILIfObserver& aComponentIfObserver); - void ReleaseComponent(); - TInt GetComponentInputPorts(RPointerArray& aComponentPorts) const; - TInt GetComponentOutputPorts(RPointerArray& aComponentPorts) const; - TInt SetConfig(const TILStruct& aConfig, const MILComponentPortIf* aComponentPort); - TInt GetConfig(TILStruct& aConfig, const MILComponentPortIf* aComponentPort) const; - TInt Initialize(); - TInt Execute(); - TInt Pause(); - TInt Stop(); - TInt UnInitialize(); - TInt GetState(TILComponentState& aState) const; - TInt SendCommand(const TILCommand& aCommand); - TInt FlushAllPorts(); - TInt ComponentRoleEnum(TPtr8& aComponentRole, TUint32 aIndex) const; - TInt GetComponentVersion(TILComponentVersion& aVersion) const; - TInt SetComponentIfRole(const TUid& aFormat); - TInt SetComponentIfRole(const TDesC8& aComponentRole); - TInt GetComponentIfRole(TUid& aFormat) const; - TInt GetComponentIfRole(TDes8& aComponentRole) const; - TInt SetExtConfig(const TDesC8& aParameterName, const TILStruct& aConfig, const MILComponentPortIf* aComponentPort); - TInt GetExtConfig(const TDesC8& aParameterName, TILStruct& aConfig, const MILComponentPortIf* aComponentPort) const; - TAny* CustomInterface(TUid aUid); - - - ~CDummyPcmRenderer(); - -private: - CDummyPcmRenderer(); - - RMdaDevSound& SoundDevice(); - MILIfObserver* Observer() const; - -private: - RMdaDevSound iSoundDevice; - TILComponentState iState; - - CInputPort* iInputPort; - MILIfObserver* iObserver; // Not owned - }; - -#endif // DUMMYPCMRENDERER_H +// 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 DUMMYPCMRENDERER_H +#define DUMMYPCMRENDERER_H + +#include +#include +#include + +#include "milcomponentportif.h" +#include "milifobserver.h" +#include "ilcomponentif.h" + +#ifdef SYMBIAN_MDF_SHAREDCHUNK_SOUNDDRIVER + #include "mdasoundadapter.h" +#else + #include +#endif + +class CMMFBuffer; + +/* +PCM sink renderer component (this is just a simple non-omx component for testing) +This component is used together with the omxilvorbdechwdevice and the OMXVorbisDecoder +for testing when requesting a HwDevice supporting VRB2 fourCC. +*/ +class CDummyPcmRenderer : public CILComponentIf + { +public: + /* + PCM sink input port + */ + class CInputPort: public CActive, + public MILComponentPortIf, + public MPlayCustomInterface + { + friend class CDummyPcmRenderer; + + public: + static CInputPort* NewL(CDummyPcmRenderer& aParent); + + // MILComponentPortIf + TInt FillThisBuffer(CMMFBuffer& aBuffer); + TInt EmptyThisBuffer(const CMMFBuffer& aBuffer); + TInt TunnelRequest(MILComponentPortIf* aPort); + TInt DisconnectTunnel(MILComponentPortIf* aPort); + TInt PortIndex() const; + TPortDirection PortDirection() const; + CMMFBuffer* CreateBufferL(TInt aBufferSize); + TInt UseBuffer(CMMFBuffer& aBuffer); + TInt FreeBuffer(CMMFBuffer* aBuffer); + TInt FlushPort(); + TInt EnablePort(); + TInt DisablePort(); + MILComponentIf* PortComponent() const; + + // from MPlayCustomInterface + void SetVolume(TUint aVolume); + TUint Volume(); + TUint BytesPlayed(); + void SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration); + TTimeIntervalMicroSeconds& VolumeRamp(); + TInt SampleRate(); + TInt Channels(); + + // from CActive + void RunL(); + void DoCancel(); + + // Internal + TUint32 BufferSize() const; + void Execute(); + void Pause(); + void Stop(); + ~CInputPort(); + + private: + explicit CInputPort(CDummyPcmRenderer& aParent); + + private: + CDummyPcmRenderer& iParent; + MILComponentPortIf* iPortConnectedTo; + CMMFBuffer* iCurrentBuffer; + RPointerArray iBuffers; + TInt iSampleRate; + TInt iChannels; + TBool iInterleaved; + TUint iVolume; + TTimeIntervalMicroSeconds iRampDuration; + TUint iBytesPlayed; + TBool iPaused; + TBool iStopped; + TUint iBufferSize; + }; +public: + static CDummyPcmRenderer* NewL(); + + // from MILComponentIf + void CreateComponentL(const TDesC8& aComponentName, MILIfObserver& aComponentIfObserver); + void CreateComponentL(const TUid& aUid, MILIfObserver& aComponentIfObserver); + void ReleaseComponent(); + TInt GetComponentInputPorts(RPointerArray& aComponentPorts) const; + TInt GetComponentOutputPorts(RPointerArray& aComponentPorts) const; + TInt SetConfig(const TILStruct& aConfig, const MILComponentPortIf* aComponentPort); + TInt GetConfig(TILStruct& aConfig, const MILComponentPortIf* aComponentPort) const; + TInt Initialize(); + TInt Execute(); + TInt Pause(); + TInt Stop(); + TInt UnInitialize(); + TInt GetState(TILComponentState& aState) const; + TInt SendCommand(const TILCommand& aCommand); + TInt FlushAllPorts(); + TInt ComponentRoleEnum(TPtr8& aComponentRole, TUint32 aIndex) const; + TInt GetComponentVersion(TILComponentVersion& aVersion) const; + TInt SetComponentIfRole(const TUid& aFormat); + TInt SetComponentIfRole(const TDesC8& aComponentRole); + TInt GetComponentIfRole(TUid& aFormat) const; + TInt GetComponentIfRole(TDes8& aComponentRole) const; + TInt SetExtConfig(const TDesC8& aParameterName, const TILStruct& aConfig, const MILComponentPortIf* aComponentPort); + TInt GetExtConfig(const TDesC8& aParameterName, TILStruct& aConfig, const MILComponentPortIf* aComponentPort) const; + TAny* CustomInterface(TUid aUid); + + + ~CDummyPcmRenderer(); + +private: + CDummyPcmRenderer(); + + RMdaDevSound& SoundDevice(); + MILIfObserver* Observer() const; + +private: + RMdaDevSound iSoundDevice; + TILComponentState iState; + + CInputPort* iInputPort; + MILIfObserver* iObserver; // Not owned + }; + +#endif // DUMMYPCMRENDERER_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/unittest/test_plugins/dummypcmrenderer/dummypcmrenderer.rss --- a/omxil/mmilapi/unittest/test_plugins/dummypcmrenderer/dummypcmrenderer.rss Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/unittest/test_plugins/dummypcmrenderer/dummypcmrenderer.rss Fri May 07 16:25:23 2010 +0100 @@ -1,41 +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: -// - -#include -#include "ilifuids.hrh" -#include "iltestuids.hrh" - -RESOURCE REGISTRY_INFO theInfo - { - dll_uid = KUidDummyPcmRendererMILIFPluginDll; - interfaces = - { - INTERFACE_INFO - { - interface_uid = KILComponentIfUid; - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = KUidDummyPcmRendererMILIFPlugin; - version_no = 1; - display_name = "PCM Renderer"; - default_data = "" ; - opaque_data = ""; - } - }; - } - }; - } +// 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 +#include "ilifuids.hrh" +#include "iltestuids.hrh" + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = KUidDummyPcmRendererMILIFPluginDll; + interfaces = + { + INTERFACE_INFO + { + interface_uid = KILComponentIfUid; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KUidDummyPcmRendererMILIFPlugin; + version_no = 1; + display_name = "PCM Renderer"; + default_data = "" ; + opaque_data = ""; + } + }; + } + }; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/unittest/test_plugins/omxildummyaudiodec/omxildummyaudiodec.cpp --- a/omxil/mmilapi/unittest/test_plugins/omxildummyaudiodec/omxildummyaudiodec.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/unittest/test_plugins/omxildummyaudiodec/omxildummyaudiodec.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,544 +1,544 @@ -// 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 "omxildummyaudiodec.h" -#include "iltestuids.hrh" -#include -#include - -_LIT8(KDummyDecoderILComponentName,"OMX.SYMBIAN.AUDIO.DECODER.DUMMY"); -const TInt KMaxComponentNameLength = 128; - -OMXIL_COMPONENT_ECOM_ENTRYPOINT(KUidOmxILDummyAudioDec); - -const TUint32 KOMXALL = 0xFFFFFFFF; - -const TInt KMaxComponentRoleLength = 128; - -const TInt KIndexInputPort = 0; -const TInt KIndexOutputPort = 1; - -// Set some dummy input and output buffer sizes -const TInt KDummyDecoderInputBufferSize = 0x2000; -const TInt KDummyDecoderOutputBufferSize = 0x4000; - -//_LIT(KDummyDecoder, "DummyDecoder"); - - - -TInt COmxIlDummyAudioDec::CreateComponent(OMX_HANDLETYPE hComponent) - { - COmxIlDummyAudioDec* self = new COmxIlDummyAudioDec(hComponent); - if (self==NULL) - { - return KErrNoMemory; - - } - else - { - return KErrNone; - } - } - -OMX_ERRORTYPE COmxIlDummyAudioDec::GetComponentVersion( - OMX_STRING pComponentName, - OMX_VERSIONTYPE* pComponentVersion, - OMX_VERSIONTYPE* pSpecVersion, - OMX_UUIDTYPE* pComponentUUID) - { - TPtr8 name(reinterpret_cast(pComponentName), - KMaxComponentNameLength); - name.Copy(KDummyDecoderILComponentName); - name.PtrZ(); - - OMX_VERSIONTYPE compVer = { 1,0,0,0 }; - OMX_VERSIONTYPE specVer = { 1,1,1,0 }; - - (*pComponentVersion) = compVer; - (*pSpecVersion) = specVer; - - TPtr8 thisUid(reinterpret_cast(*pComponentUUID), 128); //Maxsize fixed by Khronos; - thisUid = TPtr8(reinterpret_cast(this), sizeof(TUint32)); - - return OMX_ErrorNone; - } - - -COmxIlDummyAudioDec::COmxIlDummyAudioDec(OMX_HANDLETYPE hComponent) - :COmxComponentImpl(hComponent) - { - iState = OMX_StateLoaded; - } - -COmxIlDummyAudioDec::~COmxIlDummyAudioDec() - { - if (iState == OMX_StateExecuting) - { - iState = OMX_StateIdle; - } - } - -OMX_ERRORTYPE COmxIlDummyAudioDec::SendCommand( - OMX_COMMANDTYPE Cmd, - TUint32 nParam1, - TAny* /*pCmdData*/) - { - OMX_ERRORTYPE error = OMX_ErrorNone; - switch (Cmd) - { - case OMX_CommandStateSet: - { - OMX_STATETYPE state = (OMX_STATETYPE)nParam1; - if (state == iState) - { - error = OMX_ErrorSameState; - } - else - { - // notify client of the state change - switch (state) - { - case OMX_StateIdle: - case OMX_StatePause: - case OMX_StateExecuting: - break; - }; - iState = state; - - EventHandlerCallback( - OMX_EventCmdComplete, - OMX_CommandStateSet, - iState, - NULL); - } - break; - } - - case OMX_CommandFlush: - { - if(nParam1 == KOMXALL) - { - EventHandlerCallback( - OMX_EventCmdComplete, - OMX_CommandFlush, - 0, - NULL); - - EventHandlerCallback( - OMX_EventCmdComplete, - OMX_CommandFlush, - 1, - NULL); - } - else - { - EventHandlerCallback( - OMX_EventCmdComplete, - OMX_CommandFlush, - nParam1, - NULL); - } - - break; - } - case OMX_CommandPortDisable: - { - if(nParam1 == KOMXALL) - { - EventHandlerCallback( - OMX_EventCmdComplete, - OMX_CommandPortDisable, - 0, - NULL); - - EventHandlerCallback( - OMX_EventCmdComplete, - OMX_CommandPortDisable, - 1, - NULL); - } - else - { - EventHandlerCallback( - OMX_EventCmdComplete, - OMX_CommandPortDisable, - nParam1, - NULL); - } - break; - } - } - return error; - } - -OMX_ERRORTYPE COmxIlDummyAudioDec::GetParameter( - OMX_INDEXTYPE nParamIndex, - TAny* ComponentParameterStructure) - { - switch (nParamIndex) - { - case OMX_IndexParamAudioInit : - { - OMX_PORT_PARAM_TYPE* param = static_cast(ComponentParameterStructure); - param->nPorts = 2; - } - break; - case OMX_IndexParamPortDefinition: - { - OMX_PARAM_PORTDEFINITIONTYPE* portDef = static_cast(ComponentParameterStructure); - if (portDef->nPortIndex==0) - { - portDef->eDir = OMX_DirInput; - portDef->nBufferSize = KDummyDecoderInputBufferSize; - portDef->nBufferCountActual = iBufferCountActual0; - } - else - { - portDef->eDir = OMX_DirOutput; - portDef->nBufferSize = KDummyDecoderOutputBufferSize; - portDef->nBufferCountActual = iBufferCountActual1; - } - } - break; - default: - return OMX_ErrorUnsupportedIndex; - } - return OMX_ErrorNone; - } - -OMX_ERRORTYPE COmxIlDummyAudioDec::SetParameter( - OMX_INDEXTYPE nIndex, - TAny* ComponentParameterStructure) - { - ASSERT(iState == OMX_StateLoaded); - switch (nIndex) - { - case OMX_IndexParamAudioVorbis: - { - // Fake this is Audio Vorbis decoder for the purpose of testing - OMX_AUDIO_PARAM_VORBISTYPE* param = static_cast(ComponentParameterStructure); - switch(param->nPortIndex) - { - case 0: // Input port - { - // nothing to set - return OMX_ErrorNone; - } - case 1: // Output port - default: - { - return OMX_ErrorUnsupportedIndex; - } - }; - } - case OMX_IndexParamAudioPcm: - { - OMX_AUDIO_PARAM_PCMMODETYPE* param = static_cast(ComponentParameterStructure); - switch(param->nPortIndex) - { - case 1: // Output port = PCM - { - return OMX_ErrorNone; - } - case 0: // Input port - default: - { - return OMX_ErrorUnsupportedIndex; - } - }; - } - case OMX_IndexParamPortDefinition: - { - OMX_PARAM_PORTDEFINITIONTYPE* portDef = static_cast(ComponentParameterStructure); - if (portDef->nPortIndex==0) - { - iBufferCountActual0 = portDef->nBufferCountActual; - } - else - { - iBufferCountActual1 = portDef->nBufferCountActual; - } - return OMX_ErrorNone; - } - default: - { - return OMX_ErrorUnsupportedIndex; - } - }; - } - -OMX_ERRORTYPE COmxIlDummyAudioDec::GetConfig( - OMX_INDEXTYPE /*nIndex*/, - TAny* /*value*/) - { - return OMX_ErrorUnsupportedIndex; - } - -OMX_ERRORTYPE COmxIlDummyAudioDec::SetConfig( - OMX_INDEXTYPE /*nIndex*/, - TAny* /*value*/) - { - return OMX_ErrorUnsupportedIndex; - } - -OMX_ERRORTYPE COmxIlDummyAudioDec::GetExtensionIndex( - OMX_STRING /*parameterName*/, - OMX_INDEXTYPE* pIndexType) - { - // This test component returns always OMX_IndexParamPortDefinition - *pIndexType = OMX_IndexParamPortDefinition; - - return OMX_ErrorNone; - } - -OMX_ERRORTYPE COmxIlDummyAudioDec::GetState( - OMX_STATETYPE* pState) - { - *pState = iState; - return OMX_ErrorNone; - } - -// To be implemented for DM4 -OMX_ERRORTYPE COmxIlDummyAudioDec::ComponentTunnelRequest( - OMX_HANDLETYPE /*hInput*/, - TUint32 /*nInputPort*/, - OMX_HANDLETYPE /*hOutput*/, - TUint32 /*nOutputPort*/, - OMX_TUNNELSETUPTYPE* /*pTunnelSetup*/) - { - - // Fake everything as if it went fine - return OMX_ErrorNone; - } - -OMX_ERRORTYPE COmxIlDummyAudioDec::UseBuffer( - OMX_BUFFERHEADERTYPE** ppBufferHeader, - TUint32 nPortIndex, - TAny* pAppPrivate, - TUint32 nSizeBytes, - TUint8* pBuffer) - { - ASSERT(iState == OMX_StateLoaded); - *ppBufferHeader = new OMX_BUFFERHEADERTYPE; - if (*ppBufferHeader != NULL) - { - (*ppBufferHeader)->pBuffer = pBuffer; - (*ppBufferHeader)->pAppPrivate = pAppPrivate; - (*ppBufferHeader)->nAllocLen = nSizeBytes; - (*ppBufferHeader)->nFilledLen = 0; - (*ppBufferHeader)->nFlags = 0; - (*ppBufferHeader)->pInputPortPrivate = NULL; - (*ppBufferHeader)->pOutputPortPrivate = NULL; - } - - - - if (*ppBufferHeader) - { - TPtr8 ptr(pBuffer,nSizeBytes,nSizeBytes); - CMMFBuffer* buffer = NULL; - TRAPD(err, buffer = CMMFPtrBuffer::NewL(ptr)); - if (err != KErrNone) - { - return OMX_ErrorInsufficientResources; - } - switch (nPortIndex) - { - case KIndexInputPort: - { - (*ppBufferHeader)->pInputPortPrivate = buffer; - (*ppBufferHeader)->nInputPortIndex = nPortIndex; - } - break; - case KIndexOutputPort: - { - (*ppBufferHeader)->pOutputPortPrivate = buffer; - (*ppBufferHeader)->nOutputPortIndex = nPortIndex; - } - break; - - } - return OMX_ErrorNone; - } - else - { - return OMX_ErrorInsufficientResources; - } - } - -OMX_ERRORTYPE COmxIlDummyAudioDec::AllocateBuffer( - OMX_BUFFERHEADERTYPE** pBuffer, - TUint32 nPortIndex, - TAny* pAppData, - TUint32 nSizeBytes) - { - ASSERT(iState == OMX_StateLoaded); - - *pBuffer = new OMX_BUFFERHEADERTYPE; - if (*pBuffer != NULL) - { - CMMFDescriptorBuffer* buffer = NULL; - TRAPD(err, buffer = CMMFDescriptorBuffer::NewL(nSizeBytes)); - if (err != KErrNone) - { - return OMX_ErrorInsufficientResources; - } - (*pBuffer)->pBuffer = const_cast(buffer->Data().Ptr()); - // store our allocated memory in component's private store - switch (nPortIndex) - { - case KIndexInputPort: - (*pBuffer)->pInputPortPrivate = buffer; - (*pBuffer)->pOutputPortPrivate = NULL; - break; - case KIndexOutputPort: - (*pBuffer)->pOutputPortPrivate = buffer; - (*pBuffer)->pInputPortPrivate = NULL; - break; - }; - - - (*pBuffer)->nAllocLen = nSizeBytes; - (*pBuffer)->nFilledLen = 0; - (*pBuffer)->pAppPrivate = pAppData; - } - - if (*pBuffer && (*pBuffer)->pBuffer) - { - return OMX_ErrorNone; - } - else - { - return OMX_ErrorInsufficientResources; - } - } - -OMX_ERRORTYPE COmxIlDummyAudioDec::FreeBuffer( - TUint32 nPortIndex, - OMX_BUFFERHEADERTYPE* pBuffer) - { - switch (nPortIndex) - { - case KIndexInputPort: - { - delete (static_cast(pBuffer->pInputPortPrivate)); - pBuffer->pInputPortPrivate = NULL; - break; - } - case KIndexOutputPort: - delete (static_cast(pBuffer->pOutputPortPrivate)); - pBuffer->pOutputPortPrivate = NULL; - break; - - } - delete pBuffer; - return OMX_ErrorNone; - } -OMX_ERRORTYPE COmxIlDummyAudioDec::EmptyThisBuffer( - OMX_BUFFERHEADERTYPE* pBuffer) - { - ASSERT(iState == OMX_StateExecuting || - iState == OMX_StateIdle || - iState == OMX_StatePause); - EmptyBufferDoneCallback(pBuffer); - return OMX_ErrorNone; - } -OMX_ERRORTYPE COmxIlDummyAudioDec::FillThisBuffer( - OMX_BUFFERHEADERTYPE* pBuffer) - { - ASSERT(iState == OMX_StateExecuting || - iState == OMX_StateIdle || - iState == OMX_StatePause); - - FillBufferDoneCallback(pBuffer); - return OMX_ErrorNone; - } - -OMX_ERRORTYPE COmxIlDummyAudioDec::SetCallbacks( - OMX_CALLBACKTYPE* pCallbacks, - TAny* pAppData) - { - iCallback = pCallbacks; - iAppData = pAppData; - return OMX_ErrorNone; - } - -OMX_ERRORTYPE COmxIlDummyAudioDec::ComponentRoleEnum( - OMX_OUT OMX_U8 *aRole, - OMX_IN OMX_U32 aIndex) - { - _LIT8(KFakeRole,"audio_decoder.vrb"); - - if (aIndex == 0) - { - TPtr8 ptr((TUint8*)aRole, 0, KMaxComponentRoleLength); - ptr.Copy(KFakeRole); - ptr.PtrZ(); - - return OMX_ErrorNone; - } - else - { - return OMX_ErrorBadParameter; - } - } - -// Callbacks for the Dummy Audio Decoder -void COmxIlDummyAudioDec::EventHandlerCallback( - OMX_OUT OMX_EVENTTYPE eEvent, - OMX_OUT TUint32 nData1, - OMX_OUT TUint32 nData2, - OMX_OUT OMX_STRING cExtraInfo) - { - iCallback->EventHandler( - this, - iAppData, - eEvent, - nData1, - nData2, - cExtraInfo); - } - -void COmxIlDummyAudioDec::FillBufferDoneCallback(OMX_BUFFERHEADERTYPE* aBuffer) - { - iCallback->FillBufferDone( - *this, - iAppData, - aBuffer); - } - -void COmxIlDummyAudioDec::EmptyBufferDoneCallback(OMX_BUFFERHEADERTYPE* aBuffer) - { - iCallback->EmptyBufferDone( - *this, - iAppData, - aBuffer); - } - -// Component Entry Point -OMX_ERRORTYPE OMX_ComponentInit(OMX_HANDLETYPE hComponent) - { - TInt err = COmxIlDummyAudioDec::CreateComponent(hComponent); - if (err == KErrNone) - return OMX_ErrorNone; - else - { - // return some problem - return OMX_ErrorInsufficientResources; - - } - } - +// 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 "omxildummyaudiodec.h" +#include "iltestuids.hrh" +#include +#include + +_LIT8(KDummyDecoderILComponentName,"OMX.SYMBIAN.AUDIO.DECODER.DUMMY"); +const TInt KMaxComponentNameLength = 128; + +OMXIL_COMPONENT_ECOM_ENTRYPOINT(KUidOmxILDummyAudioDec); + +const TUint32 KOMXALL = 0xFFFFFFFF; + +const TInt KMaxComponentRoleLength = 128; + +const TInt KIndexInputPort = 0; +const TInt KIndexOutputPort = 1; + +// Set some dummy input and output buffer sizes +const TInt KDummyDecoderInputBufferSize = 0x2000; +const TInt KDummyDecoderOutputBufferSize = 0x4000; + +//_LIT(KDummyDecoder, "DummyDecoder"); + + + +TInt COmxIlDummyAudioDec::CreateComponent(OMX_HANDLETYPE hComponent) + { + COmxIlDummyAudioDec* self = new COmxIlDummyAudioDec(hComponent); + if (self==NULL) + { + return KErrNoMemory; + + } + else + { + return KErrNone; + } + } + +OMX_ERRORTYPE COmxIlDummyAudioDec::GetComponentVersion( + OMX_STRING pComponentName, + OMX_VERSIONTYPE* pComponentVersion, + OMX_VERSIONTYPE* pSpecVersion, + OMX_UUIDTYPE* pComponentUUID) + { + TPtr8 name(reinterpret_cast(pComponentName), + KMaxComponentNameLength); + name.Copy(KDummyDecoderILComponentName); + name.PtrZ(); + + OMX_VERSIONTYPE compVer = { 1,0,0,0 }; + OMX_VERSIONTYPE specVer = { 1,1,1,0 }; + + (*pComponentVersion) = compVer; + (*pSpecVersion) = specVer; + + TPtr8 thisUid(reinterpret_cast(*pComponentUUID), 128); //Maxsize fixed by Khronos; + thisUid = TPtr8(reinterpret_cast(this), sizeof(TUint32)); + + return OMX_ErrorNone; + } + + +COmxIlDummyAudioDec::COmxIlDummyAudioDec(OMX_HANDLETYPE hComponent) + :COmxComponentImpl(hComponent) + { + iState = OMX_StateLoaded; + } + +COmxIlDummyAudioDec::~COmxIlDummyAudioDec() + { + if (iState == OMX_StateExecuting) + { + iState = OMX_StateIdle; + } + } + +OMX_ERRORTYPE COmxIlDummyAudioDec::SendCommand( + OMX_COMMANDTYPE Cmd, + TUint32 nParam1, + TAny* /*pCmdData*/) + { + OMX_ERRORTYPE error = OMX_ErrorNone; + switch (Cmd) + { + case OMX_CommandStateSet: + { + OMX_STATETYPE state = (OMX_STATETYPE)nParam1; + if (state == iState) + { + error = OMX_ErrorSameState; + } + else + { + // notify client of the state change + switch (state) + { + case OMX_StateIdle: + case OMX_StatePause: + case OMX_StateExecuting: + break; + }; + iState = state; + + EventHandlerCallback( + OMX_EventCmdComplete, + OMX_CommandStateSet, + iState, + NULL); + } + break; + } + + case OMX_CommandFlush: + { + if(nParam1 == KOMXALL) + { + EventHandlerCallback( + OMX_EventCmdComplete, + OMX_CommandFlush, + 0, + NULL); + + EventHandlerCallback( + OMX_EventCmdComplete, + OMX_CommandFlush, + 1, + NULL); + } + else + { + EventHandlerCallback( + OMX_EventCmdComplete, + OMX_CommandFlush, + nParam1, + NULL); + } + + break; + } + case OMX_CommandPortDisable: + { + if(nParam1 == KOMXALL) + { + EventHandlerCallback( + OMX_EventCmdComplete, + OMX_CommandPortDisable, + 0, + NULL); + + EventHandlerCallback( + OMX_EventCmdComplete, + OMX_CommandPortDisable, + 1, + NULL); + } + else + { + EventHandlerCallback( + OMX_EventCmdComplete, + OMX_CommandPortDisable, + nParam1, + NULL); + } + break; + } + } + return error; + } + +OMX_ERRORTYPE COmxIlDummyAudioDec::GetParameter( + OMX_INDEXTYPE nParamIndex, + TAny* ComponentParameterStructure) + { + switch (nParamIndex) + { + case OMX_IndexParamAudioInit : + { + OMX_PORT_PARAM_TYPE* param = static_cast(ComponentParameterStructure); + param->nPorts = 2; + } + break; + case OMX_IndexParamPortDefinition: + { + OMX_PARAM_PORTDEFINITIONTYPE* portDef = static_cast(ComponentParameterStructure); + if (portDef->nPortIndex==0) + { + portDef->eDir = OMX_DirInput; + portDef->nBufferSize = KDummyDecoderInputBufferSize; + portDef->nBufferCountActual = iBufferCountActual0; + } + else + { + portDef->eDir = OMX_DirOutput; + portDef->nBufferSize = KDummyDecoderOutputBufferSize; + portDef->nBufferCountActual = iBufferCountActual1; + } + } + break; + default: + return OMX_ErrorUnsupportedIndex; + } + return OMX_ErrorNone; + } + +OMX_ERRORTYPE COmxIlDummyAudioDec::SetParameter( + OMX_INDEXTYPE nIndex, + TAny* ComponentParameterStructure) + { + ASSERT(iState == OMX_StateLoaded); + switch (nIndex) + { + case OMX_IndexParamAudioVorbis: + { + // Fake this is Audio Vorbis decoder for the purpose of testing + OMX_AUDIO_PARAM_VORBISTYPE* param = static_cast(ComponentParameterStructure); + switch(param->nPortIndex) + { + case 0: // Input port + { + // nothing to set + return OMX_ErrorNone; + } + case 1: // Output port + default: + { + return OMX_ErrorUnsupportedIndex; + } + }; + } + case OMX_IndexParamAudioPcm: + { + OMX_AUDIO_PARAM_PCMMODETYPE* param = static_cast(ComponentParameterStructure); + switch(param->nPortIndex) + { + case 1: // Output port = PCM + { + return OMX_ErrorNone; + } + case 0: // Input port + default: + { + return OMX_ErrorUnsupportedIndex; + } + }; + } + case OMX_IndexParamPortDefinition: + { + OMX_PARAM_PORTDEFINITIONTYPE* portDef = static_cast(ComponentParameterStructure); + if (portDef->nPortIndex==0) + { + iBufferCountActual0 = portDef->nBufferCountActual; + } + else + { + iBufferCountActual1 = portDef->nBufferCountActual; + } + return OMX_ErrorNone; + } + default: + { + return OMX_ErrorUnsupportedIndex; + } + }; + } + +OMX_ERRORTYPE COmxIlDummyAudioDec::GetConfig( + OMX_INDEXTYPE /*nIndex*/, + TAny* /*value*/) + { + return OMX_ErrorUnsupportedIndex; + } + +OMX_ERRORTYPE COmxIlDummyAudioDec::SetConfig( + OMX_INDEXTYPE /*nIndex*/, + TAny* /*value*/) + { + return OMX_ErrorUnsupportedIndex; + } + +OMX_ERRORTYPE COmxIlDummyAudioDec::GetExtensionIndex( + OMX_STRING /*parameterName*/, + OMX_INDEXTYPE* pIndexType) + { + // This test component returns always OMX_IndexParamPortDefinition + *pIndexType = OMX_IndexParamPortDefinition; + + return OMX_ErrorNone; + } + +OMX_ERRORTYPE COmxIlDummyAudioDec::GetState( + OMX_STATETYPE* pState) + { + *pState = iState; + return OMX_ErrorNone; + } + +// To be implemented for DM4 +OMX_ERRORTYPE COmxIlDummyAudioDec::ComponentTunnelRequest( + OMX_HANDLETYPE /*hInput*/, + TUint32 /*nInputPort*/, + OMX_HANDLETYPE /*hOutput*/, + TUint32 /*nOutputPort*/, + OMX_TUNNELSETUPTYPE* /*pTunnelSetup*/) + { + + // Fake everything as if it went fine + return OMX_ErrorNone; + } + +OMX_ERRORTYPE COmxIlDummyAudioDec::UseBuffer( + OMX_BUFFERHEADERTYPE** ppBufferHeader, + TUint32 nPortIndex, + TAny* pAppPrivate, + TUint32 nSizeBytes, + TUint8* pBuffer) + { + ASSERT(iState == OMX_StateLoaded); + *ppBufferHeader = new OMX_BUFFERHEADERTYPE; + if (*ppBufferHeader != NULL) + { + (*ppBufferHeader)->pBuffer = pBuffer; + (*ppBufferHeader)->pAppPrivate = pAppPrivate; + (*ppBufferHeader)->nAllocLen = nSizeBytes; + (*ppBufferHeader)->nFilledLen = 0; + (*ppBufferHeader)->nFlags = 0; + (*ppBufferHeader)->pInputPortPrivate = NULL; + (*ppBufferHeader)->pOutputPortPrivate = NULL; + } + + + + if (*ppBufferHeader) + { + TPtr8 ptr(pBuffer,nSizeBytes,nSizeBytes); + CMMFBuffer* buffer = NULL; + TRAPD(err, buffer = CMMFPtrBuffer::NewL(ptr)); + if (err != KErrNone) + { + return OMX_ErrorInsufficientResources; + } + switch (nPortIndex) + { + case KIndexInputPort: + { + (*ppBufferHeader)->pInputPortPrivate = buffer; + (*ppBufferHeader)->nInputPortIndex = nPortIndex; + } + break; + case KIndexOutputPort: + { + (*ppBufferHeader)->pOutputPortPrivate = buffer; + (*ppBufferHeader)->nOutputPortIndex = nPortIndex; + } + break; + + } + return OMX_ErrorNone; + } + else + { + return OMX_ErrorInsufficientResources; + } + } + +OMX_ERRORTYPE COmxIlDummyAudioDec::AllocateBuffer( + OMX_BUFFERHEADERTYPE** pBuffer, + TUint32 nPortIndex, + TAny* pAppData, + TUint32 nSizeBytes) + { + ASSERT(iState == OMX_StateLoaded); + + *pBuffer = new OMX_BUFFERHEADERTYPE; + if (*pBuffer != NULL) + { + CMMFDescriptorBuffer* buffer = NULL; + TRAPD(err, buffer = CMMFDescriptorBuffer::NewL(nSizeBytes)); + if (err != KErrNone) + { + return OMX_ErrorInsufficientResources; + } + (*pBuffer)->pBuffer = const_cast(buffer->Data().Ptr()); + // store our allocated memory in component's private store + switch (nPortIndex) + { + case KIndexInputPort: + (*pBuffer)->pInputPortPrivate = buffer; + (*pBuffer)->pOutputPortPrivate = NULL; + break; + case KIndexOutputPort: + (*pBuffer)->pOutputPortPrivate = buffer; + (*pBuffer)->pInputPortPrivate = NULL; + break; + }; + + + (*pBuffer)->nAllocLen = nSizeBytes; + (*pBuffer)->nFilledLen = 0; + (*pBuffer)->pAppPrivate = pAppData; + } + + if (*pBuffer && (*pBuffer)->pBuffer) + { + return OMX_ErrorNone; + } + else + { + return OMX_ErrorInsufficientResources; + } + } + +OMX_ERRORTYPE COmxIlDummyAudioDec::FreeBuffer( + TUint32 nPortIndex, + OMX_BUFFERHEADERTYPE* pBuffer) + { + switch (nPortIndex) + { + case KIndexInputPort: + { + delete (static_cast(pBuffer->pInputPortPrivate)); + pBuffer->pInputPortPrivate = NULL; + break; + } + case KIndexOutputPort: + delete (static_cast(pBuffer->pOutputPortPrivate)); + pBuffer->pOutputPortPrivate = NULL; + break; + + } + delete pBuffer; + return OMX_ErrorNone; + } +OMX_ERRORTYPE COmxIlDummyAudioDec::EmptyThisBuffer( + OMX_BUFFERHEADERTYPE* pBuffer) + { + ASSERT(iState == OMX_StateExecuting || + iState == OMX_StateIdle || + iState == OMX_StatePause); + EmptyBufferDoneCallback(pBuffer); + return OMX_ErrorNone; + } +OMX_ERRORTYPE COmxIlDummyAudioDec::FillThisBuffer( + OMX_BUFFERHEADERTYPE* pBuffer) + { + ASSERT(iState == OMX_StateExecuting || + iState == OMX_StateIdle || + iState == OMX_StatePause); + + FillBufferDoneCallback(pBuffer); + return OMX_ErrorNone; + } + +OMX_ERRORTYPE COmxIlDummyAudioDec::SetCallbacks( + OMX_CALLBACKTYPE* pCallbacks, + TAny* pAppData) + { + iCallback = pCallbacks; + iAppData = pAppData; + return OMX_ErrorNone; + } + +OMX_ERRORTYPE COmxIlDummyAudioDec::ComponentRoleEnum( + OMX_OUT OMX_U8 *aRole, + OMX_IN OMX_U32 aIndex) + { + _LIT8(KFakeRole,"audio_decoder.vrb"); + + if (aIndex == 0) + { + TPtr8 ptr((TUint8*)aRole, 0, KMaxComponentRoleLength); + ptr.Copy(KFakeRole); + ptr.PtrZ(); + + return OMX_ErrorNone; + } + else + { + return OMX_ErrorBadParameter; + } + } + +// Callbacks for the Dummy Audio Decoder +void COmxIlDummyAudioDec::EventHandlerCallback( + OMX_OUT OMX_EVENTTYPE eEvent, + OMX_OUT TUint32 nData1, + OMX_OUT TUint32 nData2, + OMX_OUT OMX_STRING cExtraInfo) + { + iCallback->EventHandler( + this, + iAppData, + eEvent, + nData1, + nData2, + cExtraInfo); + } + +void COmxIlDummyAudioDec::FillBufferDoneCallback(OMX_BUFFERHEADERTYPE* aBuffer) + { + iCallback->FillBufferDone( + *this, + iAppData, + aBuffer); + } + +void COmxIlDummyAudioDec::EmptyBufferDoneCallback(OMX_BUFFERHEADERTYPE* aBuffer) + { + iCallback->EmptyBufferDone( + *this, + iAppData, + aBuffer); + } + +// Component Entry Point +OMX_ERRORTYPE OMX_ComponentInit(OMX_HANDLETYPE hComponent) + { + TInt err = COmxIlDummyAudioDec::CreateComponent(hComponent); + if (err == KErrNone) + return OMX_ErrorNone; + else + { + // return some problem + return OMX_ErrorInsufficientResources; + + } + } + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/unittest/test_plugins/omxildummyaudiodec/omxildummyaudiodec.h --- a/omxil/mmilapi/unittest/test_plugins/omxildummyaudiodec/omxildummyaudiodec.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/unittest/test_plugins/omxildummyaudiodec/omxildummyaudiodec.h Fri May 07 16:25:23 2010 +0100 @@ -1,109 +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: -// - -#ifndef OMXILDUMMYAUDIODEC_H -#define OMXILDUMMYAUDIODEC_H - -#include "omximpl.h" - -// Test component. Dummy omx il decoder used by the MILIF test suite. -class COmxIlDummyAudioDec : public COmxComponentImpl - { -public: - friend class CCodecDummyProcessor; - friend class CCodecCallbacks; - - static TInt CreateComponent(OMX_HANDLETYPE hComponent); - ~COmxIlDummyAudioDec(); - - OMX_ERRORTYPE GetComponentVersion( - OMX_STRING pComponentName, - OMX_VERSIONTYPE* pComponentVersion, - OMX_VERSIONTYPE* pSpecVersion, - OMX_UUIDTYPE* pComponentUUID); - OMX_ERRORTYPE SendCommand( - OMX_COMMANDTYPE Cmd, - TUint32 nParam1, - TAny* pCmdData); - OMX_ERRORTYPE GetParameter( - OMX_INDEXTYPE nParamIndex, - TAny* ComponentParameterStructure); - OMX_ERRORTYPE SetParameter( - OMX_INDEXTYPE nIndex, - TAny* ComponentParameterStructure); - OMX_ERRORTYPE GetConfig( - OMX_INDEXTYPE nIndex, - TAny* value); - OMX_ERRORTYPE SetConfig( - OMX_INDEXTYPE nIndex, - TAny* value); - OMX_ERRORTYPE GetExtensionIndex( - OMX_STRING ParameterName, - OMX_INDEXTYPE* pIndexType); - OMX_ERRORTYPE GetState( - OMX_STATETYPE* pState); - OMX_ERRORTYPE ComponentTunnelRequest( - OMX_HANDLETYPE hInput, - TUint32 nInputPort, - OMX_HANDLETYPE hOutput, - TUint32 nOutputPort, - OMX_TUNNELSETUPTYPE* pTunnelSetup); - virtual OMX_ERRORTYPE UseBuffer( - OMX_BUFFERHEADERTYPE** pBufferHdr, - TUint32 nPortIndex, - TAny* pAppPrivate, - TUint32 nSizeBytes, - TUint8* pBuffer); - virtual OMX_ERRORTYPE AllocateBuffer( - OMX_BUFFERHEADERTYPE** pBuffer, - TUint32 nPortIndex, - TAny* pAppData, - TUint32 nSizeBytes); - OMX_ERRORTYPE FreeBuffer( - TUint32 nPortIndex, - OMX_BUFFERHEADERTYPE* pBuffer); - OMX_ERRORTYPE EmptyThisBuffer( - OMX_BUFFERHEADERTYPE* pBuffer); - OMX_ERRORTYPE FillThisBuffer( - OMX_BUFFERHEADERTYPE* pBuffer); - OMX_ERRORTYPE SetCallbacks( - OMX_CALLBACKTYPE* pCallbacks, - TAny* pAppData); - OMX_ERRORTYPE ComponentRoleEnum( - OMX_OUT OMX_U8 *cRole, - OMX_IN OMX_U32 nIndex); - - - void EventHandlerCallback( - OMX_EVENTTYPE eEvent, - TUint32 nData1, - TUint32 nData2, - OMX_STRING cExtraInfo); - void FillBufferDoneCallback(OMX_BUFFERHEADERTYPE* pBuffer); - void EmptyBufferDoneCallback(OMX_BUFFERHEADERTYPE* pBuffer); - -private: - COmxIlDummyAudioDec(OMX_HANDLETYPE hComponent); - -private: - OMX_CALLBACKTYPE* iCallback; - TAny* iAppData; - OMX_STATETYPE iState; - - TInt iBufferCountActual0; - TInt iBufferCountActual1; - }; - -#endif // OMXILDUMMYAUDIODEC_H +// 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 OMXILDUMMYAUDIODEC_H +#define OMXILDUMMYAUDIODEC_H + +#include "omximpl.h" + +// Test component. Dummy omx il decoder used by the MILIF test suite. +class COmxIlDummyAudioDec : public COmxComponentImpl + { +public: + friend class CCodecDummyProcessor; + friend class CCodecCallbacks; + + static TInt CreateComponent(OMX_HANDLETYPE hComponent); + ~COmxIlDummyAudioDec(); + + OMX_ERRORTYPE GetComponentVersion( + OMX_STRING pComponentName, + OMX_VERSIONTYPE* pComponentVersion, + OMX_VERSIONTYPE* pSpecVersion, + OMX_UUIDTYPE* pComponentUUID); + OMX_ERRORTYPE SendCommand( + OMX_COMMANDTYPE Cmd, + TUint32 nParam1, + TAny* pCmdData); + OMX_ERRORTYPE GetParameter( + OMX_INDEXTYPE nParamIndex, + TAny* ComponentParameterStructure); + OMX_ERRORTYPE SetParameter( + OMX_INDEXTYPE nIndex, + TAny* ComponentParameterStructure); + OMX_ERRORTYPE GetConfig( + OMX_INDEXTYPE nIndex, + TAny* value); + OMX_ERRORTYPE SetConfig( + OMX_INDEXTYPE nIndex, + TAny* value); + OMX_ERRORTYPE GetExtensionIndex( + OMX_STRING ParameterName, + OMX_INDEXTYPE* pIndexType); + OMX_ERRORTYPE GetState( + OMX_STATETYPE* pState); + OMX_ERRORTYPE ComponentTunnelRequest( + OMX_HANDLETYPE hInput, + TUint32 nInputPort, + OMX_HANDLETYPE hOutput, + TUint32 nOutputPort, + OMX_TUNNELSETUPTYPE* pTunnelSetup); + virtual OMX_ERRORTYPE UseBuffer( + OMX_BUFFERHEADERTYPE** pBufferHdr, + TUint32 nPortIndex, + TAny* pAppPrivate, + TUint32 nSizeBytes, + TUint8* pBuffer); + virtual OMX_ERRORTYPE AllocateBuffer( + OMX_BUFFERHEADERTYPE** pBuffer, + TUint32 nPortIndex, + TAny* pAppData, + TUint32 nSizeBytes); + OMX_ERRORTYPE FreeBuffer( + TUint32 nPortIndex, + OMX_BUFFERHEADERTYPE* pBuffer); + OMX_ERRORTYPE EmptyThisBuffer( + OMX_BUFFERHEADERTYPE* pBuffer); + OMX_ERRORTYPE FillThisBuffer( + OMX_BUFFERHEADERTYPE* pBuffer); + OMX_ERRORTYPE SetCallbacks( + OMX_CALLBACKTYPE* pCallbacks, + TAny* pAppData); + OMX_ERRORTYPE ComponentRoleEnum( + OMX_OUT OMX_U8 *cRole, + OMX_IN OMX_U32 nIndex); + + + void EventHandlerCallback( + OMX_EVENTTYPE eEvent, + TUint32 nData1, + TUint32 nData2, + OMX_STRING cExtraInfo); + void FillBufferDoneCallback(OMX_BUFFERHEADERTYPE* pBuffer); + void EmptyBufferDoneCallback(OMX_BUFFERHEADERTYPE* pBuffer); + +private: + COmxIlDummyAudioDec(OMX_HANDLETYPE hComponent); + +private: + OMX_CALLBACKTYPE* iCallback; + TAny* iAppData; + OMX_STATETYPE iState; + + TInt iBufferCountActual0; + TInt iBufferCountActual1; + }; + +#endif // OMXILDUMMYAUDIODEC_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/unittest/test_plugins/omxildummyaudiodec/omxildummyaudiodec.rss --- a/omxil/mmilapi/unittest/test_plugins/omxildummyaudiodec/omxildummyaudiodec.rss Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/unittest/test_plugins/omxildummyaudiodec/omxildummyaudiodec.rss Fri May 07 16:25:23 2010 +0100 @@ -1,42 +1,42 @@ -// 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 -#include -#include "iltestuids.hrh" - - -RESOURCE REGISTRY_INFO theInfo - { - dll_uid = KUidOmxILDummyAudioDecDll; - interfaces = - { - INTERFACE_INFO - { - interface_uid = KUidOmxILSymbianComponentIf; - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = KUidOmxILDummyAudioDec; - version_no = 1; - display_name = "OMX.SYMBIAN.AUDIO.DECODER.DUMMY" ; // Dummy Component name - default_data = "Symbian IL Dummy OMX component"; - opaque_data = ""; - } - }; - } - }; - } +// 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 +#include +#include "iltestuids.hrh" + + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = KUidOmxILDummyAudioDecDll; + interfaces = + { + INTERFACE_INFO + { + interface_uid = KUidOmxILSymbianComponentIf; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KUidOmxILDummyAudioDec; + version_no = 1; + display_name = "OMX.SYMBIAN.AUDIO.DECODER.DUMMY" ; // Dummy Component name + default_data = "Symbian IL Dummy OMX component"; + opaque_data = ""; + } + }; + } + }; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/unittest/test_plugins/omxildummyaudiodec/omximpl.cpp --- a/omxil/mmilapi/unittest/test_plugins/omxildummyaudiodec/omximpl.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/unittest/test_plugins/omxildummyaudiodec/omximpl.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,279 +1,279 @@ -// 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 -#include "omximpl.h" - -OMX_ERRORTYPE OMXComponentGetComponentVersion( - 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); -OMX_ERRORTYPE OMXComponentSendCommand( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_COMMANDTYPE Cmd, - OMX_IN OMX_U32 nParam1, - OMX_IN OMX_PTR pCmdData); -OMX_ERRORTYPE OMXComponentGetParameter( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_INDEXTYPE nParamIndex, - OMX_INOUT OMX_PTR ComponentParameterStructure); -OMX_ERRORTYPE OMXComponentSetParameter( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_INDEXTYPE nIndex, - OMX_IN OMX_PTR ComponentParameterStructure); -OMX_ERRORTYPE OMXComponentGetConfig( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_INDEXTYPE nIndex, - OMX_INOUT OMX_PTR value); -OMX_ERRORTYPE OMXComponentSetConfig( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_INDEXTYPE nIndex, - OMX_IN OMX_PTR value); -OMX_ERRORTYPE OMXComponentGetExtensionIndex( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_STRING ParameterName, - OMX_OUT OMX_INDEXTYPE* pIndexType); -OMX_ERRORTYPE OMXComponentGetState( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_OUT OMX_STATETYPE* pState); -OMX_ERRORTYPE OMXComponentComponentTunnelRequest( - OMX_IN OMX_HANDLETYPE hInput, - OMX_IN OMX_U32 nPortInput, - OMX_IN OMX_HANDLETYPE hOutput, - OMX_IN OMX_U32 nPortOutput, - OMX_IN OMX_TUNNELSETUPTYPE* pTunnelSetup); -OMX_ERRORTYPE OMXComponentUseBuffer( - 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); -OMX_ERRORTYPE OMXComponentAllocateBuffer( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_INOUT OMX_BUFFERHEADERTYPE** pBuffer, - OMX_IN OMX_U32 nPortIndex, - OMX_IN OMX_PTR pAppData, - OMX_IN OMX_U32 nSizeBytes); -OMX_ERRORTYPE OMXComponentFreeBuffer( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_U32 nPortIndex, - OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); -OMX_ERRORTYPE OMXComponentEmptyThisBuffer( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); -OMX_ERRORTYPE OMXComponentFillThisBuffer( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); -OMX_ERRORTYPE OMXComponentSetCallbacks( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_CALLBACKTYPE* pCallbacks, - OMX_IN OMX_PTR pAppData); -OMX_ERRORTYPE OMXComponentDeInit(OMX_IN OMX_HANDLETYPE hComponent); - -OMX_ERRORTYPE OMXComponentRoleEnum( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_OUT OMX_U8 *cRole, - OMX_IN OMX_U32 nIndex); - - -void EventHandler(OMX_OUT OMX_HANDLETYPE hComponent, - OMX_OUT OMX_PTR pAppData, - OMX_OUT OMX_EVENTTYPE eEvent, - OMX_OUT OMX_U32 Data, - OMX_OUT OMX_STRING cExtraInfo); - -void InputBufferCallback( - OMX_OUT OMX_HANDLETYPE hComponent, - OMX_OUT OMX_PTR pAppData, - OMX_OUT OMX_BUFFERHEADERTYPE* pBuffer); - -void OutputBufferCallback( - OMX_OUT OMX_HANDLETYPE hComponent, - OMX_OUT OMX_PTR pAppData, - OMX_OUT OMX_BUFFERHEADERTYPE* pBuffer); - - - COmxComponentImpl::COmxComponentImpl(OMX_HANDLETYPE hComponent) - { - iHandle = static_cast(hComponent); - OMX_VERSIONTYPE ver = { 1,0,0,0 }; - - // fill in handle structure - - iHandle->nVersion = ver; - iHandle->pComponentPrivate = this; - iHandle->GetComponentVersion = &::OMXComponentGetComponentVersion; - iHandle->SendCommand = &::OMXComponentSendCommand; - iHandle->GetParameter = &::OMXComponentGetParameter; - iHandle->SetParameter = &::OMXComponentSetParameter; - iHandle->GetConfig = &::OMXComponentGetConfig; - iHandle->SetConfig = &::OMXComponentSetConfig; - iHandle->GetExtensionIndex = &::OMXComponentGetExtensionIndex; - iHandle->GetState = &::OMXComponentGetState; - iHandle->ComponentTunnelRequest = &::OMXComponentComponentTunnelRequest; - iHandle->UseBuffer = &::OMXComponentUseBuffer; - iHandle->AllocateBuffer = &::OMXComponentAllocateBuffer; - iHandle->FreeBuffer = &::OMXComponentFreeBuffer; - iHandle->EmptyThisBuffer = &::OMXComponentEmptyThisBuffer; - iHandle->FillThisBuffer = &::OMXComponentFillThisBuffer; - iHandle->SetCallbacks = &::OMXComponentSetCallbacks; - iHandle->ComponentRoleEnum = &::OMXComponentRoleEnum; - iHandle->ComponentDeInit = &::OMXComponentDeInit; - } - - COmxComponentImpl::~COmxComponentImpl() - { - - } - COmxComponentImpl::operator OMX_HANDLETYPE() - { - return (OMX_HANDLETYPE)&iHandle; - } - - -OMX_ERRORTYPE OMXComponentGetComponentVersion( - 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) - { - return ((COmxComponentImpl*)((OMX_COMPONENTTYPE*)hComponent)->pComponentPrivate)->GetComponentVersion(pComponentName,pComponentVersion,pSpecVersion, pComponentUUID); - } - - -OMX_ERRORTYPE OMXComponentSendCommand( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_COMMANDTYPE Cmd, - OMX_IN OMX_U32 nParam1, - OMX_IN OMX_PTR pCmdData) - { - return ((COmxComponentImpl*)((OMX_COMPONENTTYPE*)hComponent)->pComponentPrivate)->SendCommand(Cmd ,nParam1, pCmdData); - - } -OMX_ERRORTYPE OMXComponentGetParameter( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_INDEXTYPE nParamIndex, - OMX_INOUT OMX_PTR ComponentParameterStructure) - { - return ((COmxComponentImpl*)((OMX_COMPONENTTYPE*)hComponent)->pComponentPrivate)->GetParameter(nParamIndex, ComponentParameterStructure); - } -OMX_ERRORTYPE OMXComponentSetParameter( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_INDEXTYPE nIndex, - OMX_IN OMX_PTR ComponentParameterStructure) - { - return ((COmxComponentImpl*)((OMX_COMPONENTTYPE*)hComponent)->pComponentPrivate)->SetParameter(nIndex, ComponentParameterStructure); - } -OMX_ERRORTYPE OMXComponentGetConfig( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_INDEXTYPE nIndex, - OMX_INOUT OMX_PTR value) - { - return ((COmxComponentImpl*)((OMX_COMPONENTTYPE*)hComponent)->pComponentPrivate)->GetConfig(nIndex, value); - } -OMX_ERRORTYPE OMXComponentSetConfig( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_INDEXTYPE nIndex, - OMX_IN OMX_PTR value) - { - return ((COmxComponentImpl*)((OMX_COMPONENTTYPE*)hComponent)->pComponentPrivate)->SetConfig(nIndex, value); - } -OMX_ERRORTYPE OMXComponentGetExtensionIndex( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_STRING ParameterName, - OMX_OUT OMX_INDEXTYPE* pIndexType) - { - return ((COmxComponentImpl*)((OMX_COMPONENTTYPE*)hComponent)->pComponentPrivate)->GetExtensionIndex(ParameterName, pIndexType); - } -OMX_ERRORTYPE OMXComponentGetState( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_OUT OMX_STATETYPE* pState) - { - return ((COmxComponentImpl*)((OMX_COMPONENTTYPE*)hComponent)->pComponentPrivate)->GetState(pState); - } -OMX_ERRORTYPE OMXComponentComponentTunnelRequest( - OMX_IN OMX_HANDLETYPE hInput, - OMX_IN OMX_U32 nInputPort, - OMX_IN OMX_HANDLETYPE hOutput, - OMX_IN OMX_U32 nOutputPort, - OMX_IN OMX_TUNNELSETUPTYPE* pTunnelSetup) - { - return ((COmxComponentImpl*)((OMX_COMPONENTTYPE*)hInput)->pComponentPrivate)->ComponentTunnelRequest(hInput, nInputPort, hOutput, nOutputPort, pTunnelSetup); - } -OMX_ERRORTYPE OMXComponentUseBuffer( - 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) - { - return ((COmxComponentImpl*)((OMX_COMPONENTTYPE*)hComponent)->pComponentPrivate)->UseBuffer(ppBufferHdr, nPortIndex, pAppPrivate, nSizeBytes, pBuffer); - } - -OMX_ERRORTYPE OMXComponentAllocateBuffer( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_INOUT OMX_BUFFERHEADERTYPE** pBuffer, - OMX_IN OMX_U32 nPortIndex, - OMX_IN OMX_PTR pAppData, - OMX_IN OMX_U32 nSizeBytes) - { - return ((COmxComponentImpl*)((OMX_COMPONENTTYPE*)hComponent)->pComponentPrivate)->AllocateBuffer(pBuffer, nPortIndex, pAppData, nSizeBytes); - } - -OMX_ERRORTYPE OMXComponentFreeBuffer( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_U32 nPortIndex, - OMX_IN OMX_BUFFERHEADERTYPE* pBuffer) - { - return ((COmxComponentImpl*)((OMX_COMPONENTTYPE*)hComponent)->pComponentPrivate)->FreeBuffer(nPortIndex, pBuffer); - } -OMX_ERRORTYPE OMXComponentEmptyThisBuffer( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_BUFFERHEADERTYPE* pBuffer) - { - return ((COmxComponentImpl*)((OMX_COMPONENTTYPE*)hComponent)->pComponentPrivate)->EmptyThisBuffer(pBuffer); - } -OMX_ERRORTYPE OMXComponentFillThisBuffer( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_BUFFERHEADERTYPE* pBuffer) - { - return ((COmxComponentImpl*)((OMX_COMPONENTTYPE*)hComponent)->pComponentPrivate)->FillThisBuffer(pBuffer); - } -OMX_ERRORTYPE OMXComponentSetCallbacks( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_CALLBACKTYPE* pCallbacks, - OMX_IN OMX_PTR pAppData) - { - return ((COmxComponentImpl*)((OMX_COMPONENTTYPE*)hComponent)->pComponentPrivate)->SetCallbacks(pCallbacks, pAppData); - } - -OMX_ERRORTYPE OMXComponentDeInit(OMX_IN OMX_HANDLETYPE hComponent) - { - delete ((COmxComponentImpl*)((OMX_COMPONENTTYPE*)hComponent)->pComponentPrivate); - return OMX_ErrorNone; - } - -OMX_ERRORTYPE OMXComponentRoleEnum( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_OUT OMX_U8 *cRole, - OMX_IN OMX_U32 nIndex) - { - return ((COmxComponentImpl*)((OMX_COMPONENTTYPE*)hComponent)->pComponentPrivate)->ComponentRoleEnum(cRole, nIndex); - } +// 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 +#include "omximpl.h" + +OMX_ERRORTYPE OMXComponentGetComponentVersion( + 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); +OMX_ERRORTYPE OMXComponentSendCommand( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_IN OMX_COMMANDTYPE Cmd, + OMX_IN OMX_U32 nParam1, + OMX_IN OMX_PTR pCmdData); +OMX_ERRORTYPE OMXComponentGetParameter( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_IN OMX_INDEXTYPE nParamIndex, + OMX_INOUT OMX_PTR ComponentParameterStructure); +OMX_ERRORTYPE OMXComponentSetParameter( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_IN OMX_INDEXTYPE nIndex, + OMX_IN OMX_PTR ComponentParameterStructure); +OMX_ERRORTYPE OMXComponentGetConfig( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_IN OMX_INDEXTYPE nIndex, + OMX_INOUT OMX_PTR value); +OMX_ERRORTYPE OMXComponentSetConfig( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_IN OMX_INDEXTYPE nIndex, + OMX_IN OMX_PTR value); +OMX_ERRORTYPE OMXComponentGetExtensionIndex( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_IN OMX_STRING ParameterName, + OMX_OUT OMX_INDEXTYPE* pIndexType); +OMX_ERRORTYPE OMXComponentGetState( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_OUT OMX_STATETYPE* pState); +OMX_ERRORTYPE OMXComponentComponentTunnelRequest( + OMX_IN OMX_HANDLETYPE hInput, + OMX_IN OMX_U32 nPortInput, + OMX_IN OMX_HANDLETYPE hOutput, + OMX_IN OMX_U32 nPortOutput, + OMX_IN OMX_TUNNELSETUPTYPE* pTunnelSetup); +OMX_ERRORTYPE OMXComponentUseBuffer( + 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); +OMX_ERRORTYPE OMXComponentAllocateBuffer( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_INOUT OMX_BUFFERHEADERTYPE** pBuffer, + OMX_IN OMX_U32 nPortIndex, + OMX_IN OMX_PTR pAppData, + OMX_IN OMX_U32 nSizeBytes); +OMX_ERRORTYPE OMXComponentFreeBuffer( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_IN OMX_U32 nPortIndex, + OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); +OMX_ERRORTYPE OMXComponentEmptyThisBuffer( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); +OMX_ERRORTYPE OMXComponentFillThisBuffer( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); +OMX_ERRORTYPE OMXComponentSetCallbacks( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_IN OMX_CALLBACKTYPE* pCallbacks, + OMX_IN OMX_PTR pAppData); +OMX_ERRORTYPE OMXComponentDeInit(OMX_IN OMX_HANDLETYPE hComponent); + +OMX_ERRORTYPE OMXComponentRoleEnum( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_OUT OMX_U8 *cRole, + OMX_IN OMX_U32 nIndex); + + +void EventHandler(OMX_OUT OMX_HANDLETYPE hComponent, + OMX_OUT OMX_PTR pAppData, + OMX_OUT OMX_EVENTTYPE eEvent, + OMX_OUT OMX_U32 Data, + OMX_OUT OMX_STRING cExtraInfo); + +void InputBufferCallback( + OMX_OUT OMX_HANDLETYPE hComponent, + OMX_OUT OMX_PTR pAppData, + OMX_OUT OMX_BUFFERHEADERTYPE* pBuffer); + +void OutputBufferCallback( + OMX_OUT OMX_HANDLETYPE hComponent, + OMX_OUT OMX_PTR pAppData, + OMX_OUT OMX_BUFFERHEADERTYPE* pBuffer); + + + COmxComponentImpl::COmxComponentImpl(OMX_HANDLETYPE hComponent) + { + iHandle = static_cast(hComponent); + OMX_VERSIONTYPE ver = { 1,0,0,0 }; + + // fill in handle structure + + iHandle->nVersion = ver; + iHandle->pComponentPrivate = this; + iHandle->GetComponentVersion = &::OMXComponentGetComponentVersion; + iHandle->SendCommand = &::OMXComponentSendCommand; + iHandle->GetParameter = &::OMXComponentGetParameter; + iHandle->SetParameter = &::OMXComponentSetParameter; + iHandle->GetConfig = &::OMXComponentGetConfig; + iHandle->SetConfig = &::OMXComponentSetConfig; + iHandle->GetExtensionIndex = &::OMXComponentGetExtensionIndex; + iHandle->GetState = &::OMXComponentGetState; + iHandle->ComponentTunnelRequest = &::OMXComponentComponentTunnelRequest; + iHandle->UseBuffer = &::OMXComponentUseBuffer; + iHandle->AllocateBuffer = &::OMXComponentAllocateBuffer; + iHandle->FreeBuffer = &::OMXComponentFreeBuffer; + iHandle->EmptyThisBuffer = &::OMXComponentEmptyThisBuffer; + iHandle->FillThisBuffer = &::OMXComponentFillThisBuffer; + iHandle->SetCallbacks = &::OMXComponentSetCallbacks; + iHandle->ComponentRoleEnum = &::OMXComponentRoleEnum; + iHandle->ComponentDeInit = &::OMXComponentDeInit; + } + + COmxComponentImpl::~COmxComponentImpl() + { + + } + COmxComponentImpl::operator OMX_HANDLETYPE() + { + return (OMX_HANDLETYPE)&iHandle; + } + + +OMX_ERRORTYPE OMXComponentGetComponentVersion( + 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) + { + return ((COmxComponentImpl*)((OMX_COMPONENTTYPE*)hComponent)->pComponentPrivate)->GetComponentVersion(pComponentName,pComponentVersion,pSpecVersion, pComponentUUID); + } + + +OMX_ERRORTYPE OMXComponentSendCommand( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_IN OMX_COMMANDTYPE Cmd, + OMX_IN OMX_U32 nParam1, + OMX_IN OMX_PTR pCmdData) + { + return ((COmxComponentImpl*)((OMX_COMPONENTTYPE*)hComponent)->pComponentPrivate)->SendCommand(Cmd ,nParam1, pCmdData); + + } +OMX_ERRORTYPE OMXComponentGetParameter( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_IN OMX_INDEXTYPE nParamIndex, + OMX_INOUT OMX_PTR ComponentParameterStructure) + { + return ((COmxComponentImpl*)((OMX_COMPONENTTYPE*)hComponent)->pComponentPrivate)->GetParameter(nParamIndex, ComponentParameterStructure); + } +OMX_ERRORTYPE OMXComponentSetParameter( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_IN OMX_INDEXTYPE nIndex, + OMX_IN OMX_PTR ComponentParameterStructure) + { + return ((COmxComponentImpl*)((OMX_COMPONENTTYPE*)hComponent)->pComponentPrivate)->SetParameter(nIndex, ComponentParameterStructure); + } +OMX_ERRORTYPE OMXComponentGetConfig( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_IN OMX_INDEXTYPE nIndex, + OMX_INOUT OMX_PTR value) + { + return ((COmxComponentImpl*)((OMX_COMPONENTTYPE*)hComponent)->pComponentPrivate)->GetConfig(nIndex, value); + } +OMX_ERRORTYPE OMXComponentSetConfig( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_IN OMX_INDEXTYPE nIndex, + OMX_IN OMX_PTR value) + { + return ((COmxComponentImpl*)((OMX_COMPONENTTYPE*)hComponent)->pComponentPrivate)->SetConfig(nIndex, value); + } +OMX_ERRORTYPE OMXComponentGetExtensionIndex( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_IN OMX_STRING ParameterName, + OMX_OUT OMX_INDEXTYPE* pIndexType) + { + return ((COmxComponentImpl*)((OMX_COMPONENTTYPE*)hComponent)->pComponentPrivate)->GetExtensionIndex(ParameterName, pIndexType); + } +OMX_ERRORTYPE OMXComponentGetState( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_OUT OMX_STATETYPE* pState) + { + return ((COmxComponentImpl*)((OMX_COMPONENTTYPE*)hComponent)->pComponentPrivate)->GetState(pState); + } +OMX_ERRORTYPE OMXComponentComponentTunnelRequest( + OMX_IN OMX_HANDLETYPE hInput, + OMX_IN OMX_U32 nInputPort, + OMX_IN OMX_HANDLETYPE hOutput, + OMX_IN OMX_U32 nOutputPort, + OMX_IN OMX_TUNNELSETUPTYPE* pTunnelSetup) + { + return ((COmxComponentImpl*)((OMX_COMPONENTTYPE*)hInput)->pComponentPrivate)->ComponentTunnelRequest(hInput, nInputPort, hOutput, nOutputPort, pTunnelSetup); + } +OMX_ERRORTYPE OMXComponentUseBuffer( + 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) + { + return ((COmxComponentImpl*)((OMX_COMPONENTTYPE*)hComponent)->pComponentPrivate)->UseBuffer(ppBufferHdr, nPortIndex, pAppPrivate, nSizeBytes, pBuffer); + } + +OMX_ERRORTYPE OMXComponentAllocateBuffer( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_INOUT OMX_BUFFERHEADERTYPE** pBuffer, + OMX_IN OMX_U32 nPortIndex, + OMX_IN OMX_PTR pAppData, + OMX_IN OMX_U32 nSizeBytes) + { + return ((COmxComponentImpl*)((OMX_COMPONENTTYPE*)hComponent)->pComponentPrivate)->AllocateBuffer(pBuffer, nPortIndex, pAppData, nSizeBytes); + } + +OMX_ERRORTYPE OMXComponentFreeBuffer( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_IN OMX_U32 nPortIndex, + OMX_IN OMX_BUFFERHEADERTYPE* pBuffer) + { + return ((COmxComponentImpl*)((OMX_COMPONENTTYPE*)hComponent)->pComponentPrivate)->FreeBuffer(nPortIndex, pBuffer); + } +OMX_ERRORTYPE OMXComponentEmptyThisBuffer( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_IN OMX_BUFFERHEADERTYPE* pBuffer) + { + return ((COmxComponentImpl*)((OMX_COMPONENTTYPE*)hComponent)->pComponentPrivate)->EmptyThisBuffer(pBuffer); + } +OMX_ERRORTYPE OMXComponentFillThisBuffer( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_IN OMX_BUFFERHEADERTYPE* pBuffer) + { + return ((COmxComponentImpl*)((OMX_COMPONENTTYPE*)hComponent)->pComponentPrivate)->FillThisBuffer(pBuffer); + } +OMX_ERRORTYPE OMXComponentSetCallbacks( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_IN OMX_CALLBACKTYPE* pCallbacks, + OMX_IN OMX_PTR pAppData) + { + return ((COmxComponentImpl*)((OMX_COMPONENTTYPE*)hComponent)->pComponentPrivate)->SetCallbacks(pCallbacks, pAppData); + } + +OMX_ERRORTYPE OMXComponentDeInit(OMX_IN OMX_HANDLETYPE hComponent) + { + delete ((COmxComponentImpl*)((OMX_COMPONENTTYPE*)hComponent)->pComponentPrivate); + return OMX_ErrorNone; + } + +OMX_ERRORTYPE OMXComponentRoleEnum( + OMX_IN OMX_HANDLETYPE hComponent, + OMX_OUT OMX_U8 *cRole, + OMX_IN OMX_U32 nIndex) + { + return ((COmxComponentImpl*)((OMX_COMPONENTTYPE*)hComponent)->pComponentPrivate)->ComponentRoleEnum(cRole, nIndex); + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/unittest/test_plugins/omxildummyaudiodec/omximpl.h --- a/omxil/mmilapi/unittest/test_plugins/omxildummyaudiodec/omximpl.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/unittest/test_plugins/omxildummyaudiodec/omximpl.h Fri May 07 16:25:23 2010 +0100 @@ -1,94 +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: -// - -#ifndef OMXIMPL_H -#define OMXIMPL_H - -#include -#include - - -class COmxComponentImpl : public CBase - { -public: - COmxComponentImpl(OMX_HANDLETYPE hComponent); - virtual ~COmxComponentImpl(); - - virtual OMX_ERRORTYPE GetComponentVersion( - OMX_STRING pComponentName, - OMX_VERSIONTYPE* pComponentVersion, - OMX_VERSIONTYPE* pSpecVersion, - OMX_UUIDTYPE* pComponentUUID)=0; - - virtual OMX_ERRORTYPE SendCommand( - OMX_COMMANDTYPE Cmd, - TUint32 nParam1, - TAny* pCmdData)=0; - virtual OMX_ERRORTYPE GetParameter( - OMX_INDEXTYPE nParamIndex, - TAny* ComponentParameterStructure)=0; - virtual OMX_ERRORTYPE SetParameter( - OMX_INDEXTYPE nIndex, - TAny* ComponentParameterStructure)=0; - virtual OMX_ERRORTYPE GetConfig( - OMX_INDEXTYPE nIndex, - TAny* value)=0; - virtual OMX_ERRORTYPE SetConfig( - OMX_INDEXTYPE nIndex, - TAny* value)=0; - virtual OMX_ERRORTYPE GetExtensionIndex( - OMX_STRING ParameterName, - OMX_INDEXTYPE* pIndexType)=0; - virtual OMX_ERRORTYPE GetState( - OMX_STATETYPE* pState)=0; - virtual OMX_ERRORTYPE ComponentTunnelRequest( - OMX_HANDLETYPE hInput, - TUint32 nPortInput, - OMX_HANDLETYPE hOutput, - TUint32 nPortOutput, - OMX_TUNNELSETUPTYPE* pTunnelSetup) = 0; - virtual OMX_ERRORTYPE UseBuffer( - OMX_BUFFERHEADERTYPE** ppBufferHdr, - TUint32 nPortIndex, - TAny* pAppPrivate, - TUint32 nSizeBytes, - TUint8* pBuffer)=0; - virtual OMX_ERRORTYPE AllocateBuffer( - OMX_BUFFERHEADERTYPE** pBuffer, - TUint32 nPortIndex, - TAny* pAppData, - TUint32 nSizeBytes)=0; - virtual OMX_ERRORTYPE FreeBuffer( - TUint32 nPortIndex, - OMX_BUFFERHEADERTYPE* pBuffer)=0; - virtual OMX_ERRORTYPE EmptyThisBuffer( - OMX_BUFFERHEADERTYPE* pBuffer)=0; - virtual OMX_ERRORTYPE FillThisBuffer( - OMX_BUFFERHEADERTYPE* pBuffer)=0; - virtual OMX_ERRORTYPE SetCallbacks( - OMX_CALLBACKTYPE* pCallbacks, - TAny* pAppData)=0; - virtual OMX_ERRORTYPE ComponentRoleEnum( - OMX_OUT OMX_U8 *cRole, - OMX_IN OMX_U32 nIndex)=0; - - operator OMX_HANDLETYPE(); - -private: - OMX_COMPONENTTYPE* iHandle; - }; - - -#endif // OMXIMPL_H +// 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 OMXIMPL_H +#define OMXIMPL_H + +#include +#include + + +class COmxComponentImpl : public CBase + { +public: + COmxComponentImpl(OMX_HANDLETYPE hComponent); + virtual ~COmxComponentImpl(); + + virtual OMX_ERRORTYPE GetComponentVersion( + OMX_STRING pComponentName, + OMX_VERSIONTYPE* pComponentVersion, + OMX_VERSIONTYPE* pSpecVersion, + OMX_UUIDTYPE* pComponentUUID)=0; + + virtual OMX_ERRORTYPE SendCommand( + OMX_COMMANDTYPE Cmd, + TUint32 nParam1, + TAny* pCmdData)=0; + virtual OMX_ERRORTYPE GetParameter( + OMX_INDEXTYPE nParamIndex, + TAny* ComponentParameterStructure)=0; + virtual OMX_ERRORTYPE SetParameter( + OMX_INDEXTYPE nIndex, + TAny* ComponentParameterStructure)=0; + virtual OMX_ERRORTYPE GetConfig( + OMX_INDEXTYPE nIndex, + TAny* value)=0; + virtual OMX_ERRORTYPE SetConfig( + OMX_INDEXTYPE nIndex, + TAny* value)=0; + virtual OMX_ERRORTYPE GetExtensionIndex( + OMX_STRING ParameterName, + OMX_INDEXTYPE* pIndexType)=0; + virtual OMX_ERRORTYPE GetState( + OMX_STATETYPE* pState)=0; + virtual OMX_ERRORTYPE ComponentTunnelRequest( + OMX_HANDLETYPE hInput, + TUint32 nPortInput, + OMX_HANDLETYPE hOutput, + TUint32 nPortOutput, + OMX_TUNNELSETUPTYPE* pTunnelSetup) = 0; + virtual OMX_ERRORTYPE UseBuffer( + OMX_BUFFERHEADERTYPE** ppBufferHdr, + TUint32 nPortIndex, + TAny* pAppPrivate, + TUint32 nSizeBytes, + TUint8* pBuffer)=0; + virtual OMX_ERRORTYPE AllocateBuffer( + OMX_BUFFERHEADERTYPE** pBuffer, + TUint32 nPortIndex, + TAny* pAppData, + TUint32 nSizeBytes)=0; + virtual OMX_ERRORTYPE FreeBuffer( + TUint32 nPortIndex, + OMX_BUFFERHEADERTYPE* pBuffer)=0; + virtual OMX_ERRORTYPE EmptyThisBuffer( + OMX_BUFFERHEADERTYPE* pBuffer)=0; + virtual OMX_ERRORTYPE FillThisBuffer( + OMX_BUFFERHEADERTYPE* pBuffer)=0; + virtual OMX_ERRORTYPE SetCallbacks( + OMX_CALLBACKTYPE* pCallbacks, + TAny* pAppData)=0; + virtual OMX_ERRORTYPE ComponentRoleEnum( + OMX_OUT OMX_U8 *cRole, + OMX_IN OMX_U32 nIndex)=0; + + operator OMX_HANDLETYPE(); + +private: + OMX_COMPONENTTYPE* iHandle; + }; + + +#endif // OMXIMPL_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/unittest/test_plugins/omxildummyaudiodecilif/omxildummyaudiodecilif.cpp --- a/omxil/mmilapi/unittest/test_plugins/omxildummyaudiodecilif/omxildummyaudiodecilif.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/unittest/test_plugins/omxildummyaudiodecilif/omxildummyaudiodecilif.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,512 +1,512 @@ -// 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 "omxildummyaudiodecilif.h" -#include "iltestuids.hrh" -#include "omxilspecversion.h" -#include "tilstructtypes.h" -#include "tomxilstruct.h" -#include "milcomponentportif.h" -#include -#include - - -// _________________________________________________________________________________ - -const TImplementationProxy ImplementationTable[] = - { - IMPLEMENTATION_PROXY_ENTRY(KUidOmxILDummyAudioDecMILIFPlugin , COmxILDummyAudioDecILIF::NewL) - }; - -EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) - { - aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); - - return ImplementationTable; - }; -// _________________________________________________________________________________ - - -const TUint KMonoChannel = 1; -const TUint KStereoChannel = 2; -const TInt KPcm16BitsPerSample = 16; - - -COmxILDummyAudioDecILIF* COmxILDummyAudioDecILIF::NewL() - { - COmxILDummyAudioDecILIF* self = new (ELeave) COmxILDummyAudioDecILIF; - return self; - } - -COmxILDummyAudioDecILIF::COmxILDummyAudioDecILIF() - { - } - -COmxILDummyAudioDecILIF::~COmxILDummyAudioDecILIF() - { - } - - - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - -Mandatory params across all standard components -=============================================== - OMX_IndexParamPortDefinition OMX_PARAM_PORTDEFINITIONTYPE (KUidTPortDefinitionType, TPortDefinitionType) - OMX_IndexParamAudioInit - OMX_IndexParamCompBufferSupplier - -Mandatory params across all audio standard components -===================================================== - OMX_IndexParamAudioPortFormat OMX_AUDIO_PARAM_PORTFORMATTYPE (KUidTAudioPortFormatType, TAudioPortFormatType) - -Component role: audio_decoder.aac -================================= -- APB+0: Accepts encoded audio - OMX_IndexParamAudioAac OMX_AUDIO_PARAM_AACPROFILETYPE (KUidTPortAACProfileType, TPortAACProfileType) -- APB+1: Emits decoded audio - OMX_IndexParamAudioPcm OMX_AUDIO_PARAM_PCMMODETYPE (KUidTPortPCMType, TPortPCMType) - -Component role: audio_renderer.pcm -================================== -- APB+0: Accepts audio for rendering: - (OMX_IndexParamAudioPcm, OMX_AUDIO_PARAM_PCMMODETYPE) (KUidTPortPCMType, TPortPCMType) - (OMX_IndexConfigAudioVolume, OMX_AUDIO_CONFIG_VOLUMETYPE) (KUidTPortVolumeType, TPortVolumeType) - (OMX_IndexConfigAudioMute, OMX_AUDIO_CONFIG_MUTETYPE) (KUidTPortMuteType, TPortMuteType) - -* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -TInt COmxILDummyAudioDecILIF::SetConfig(const TILStruct& aConfig, - const MILComponentPortIf* aComponentPort) - { - - TInt portIndex = 0xFF; // Initialize to invalid port index - if (aComponentPort) - { - portIndex = aComponentPort->PortIndex(); - } - else - { - // All parameters and configs are targetted to the port. - return KErrArgument; - } - - TInt error = KErrNone; - - switch (aConfig.Uid().iUid) - { - case KUidOMXILStructType: - { - const TOMXILStructParam* omxILStructParam = static_cast (&aConfig); - switch (omxILStructParam->Index()) - { - case OMX_IndexParamPortDefinition: - { - OMX_PARAM_PORTDEFINITIONTYPE* config = reinterpret_cast( - const_cast(omxILStructParam)->Param()); - ASSERT(config); - config->nPortIndex = portIndex; - config->nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE); - error = OmxSetParameter(OMX_IndexParamPortDefinition, config); - break; - } - default: - { - error = KErrNotSupported; - } - } - break; - } - - case KUidMMFTTaskConfig: - { - const TTaskConfig* config = TILTaskConfig::GetStructure(aConfig); - ASSERT(config); - - TInt sampleRate = config->iRate; - TInt channels = (config->iStereoMode & ETaskMono)? KMonoChannel : KStereoChannel; - TBool interleaved = (config->iStereoMode & ETaskInterleaved)?ETrue : EFalse; - - TUid format; - error = GetComponentIfRole(format); - if (error != KErrNone) - { - break; - } - - if (format == KUidFormatOGG) - { - if (aComponentPort->PortDirection()== EDirOutput) - { - // Set Output Port (PCM16) - OMX_AUDIO_PARAM_PCMMODETYPE pcm; - pcm.nVersion = KOMXILSpecVersion; - pcm.nSize = sizeof(OMX_AUDIO_PARAM_PCMMODETYPE); - pcm.nPortIndex = portIndex; - pcm.nSamplingRate = sampleRate; - pcm.ePCMMode = OMX_AUDIO_PCMModeLinear; - pcm.eNumData = OMX_NumericalDataSigned; - pcm.nBitPerSample = KPcm16BitsPerSample; - pcm.nChannels = channels; - pcm.bInterleaved = (OMX_BOOL)interleaved; - - error = OmxSetParameter(OMX_IndexParamAudioPcm, &pcm); - } - else if (aComponentPort->PortDirection() == EDirInput) - { - // Set Input Port (Vorbis) - OMX_AUDIO_PARAM_VORBISTYPE vorbis; - vorbis.nVersion = KOMXILSpecVersion; - vorbis.nSize = sizeof(OMX_AUDIO_PARAM_VORBISTYPE); - vorbis.nPortIndex = portIndex; - - error = OmxSetParameter(OMX_IndexParamAudioVorbis, &vorbis); - } - } - else if (format == KUidFormatPCM16) - { - if (aComponentPort->PortDirection()== EDirInput) - { - // Set Input Port (PCM16) - OMX_AUDIO_PARAM_PCMMODETYPE pcm; - pcm.nVersion = KOMXILSpecVersion; - pcm.nSize = sizeof(OMX_AUDIO_PARAM_PCMMODETYPE); - pcm.nPortIndex = portIndex; - pcm.nSamplingRate = sampleRate; - pcm.ePCMMode = OMX_AUDIO_PCMModeLinear; - pcm.eNumData = OMX_NumericalDataSigned; - pcm.nBitPerSample = KPcm16BitsPerSample; - pcm.nChannels = channels; - pcm.bInterleaved = (OMX_BOOL)interleaved; - - error = OmxSetParameter(OMX_IndexParamAudioPcm, &pcm); - } - else - { - error = KErrNotSupported; - } - } - else - { - error = KErrNotSupported; - } - break; - } - case KUidTPortDefinitionType: - { - OMX_PARAM_PORTDEFINITIONTYPE* config = const_cast( - TILPortDefinition::GetStructure(aConfig)); - ASSERT(config); - config->nVersion = KOMXILSpecVersion; - config->nSize = sizeof(OMX_AUDIO_PARAM_PORTFORMATTYPE); - config->nPortIndex = portIndex; - error = OmxSetParameter(OMX_IndexParamPortDefinition, config); - break; - } - case KUidTAudioPortFormatType: - { - OMX_AUDIO_PARAM_PORTFORMATTYPE* config = const_cast( - TILAudioPortFormat::GetStructure(aConfig)); - ASSERT(config); - config->nVersion = KOMXILSpecVersion; - config->nSize = sizeof(OMX_AUDIO_PARAM_PORTFORMATTYPE); - config->nPortIndex = portIndex; - error = OmxSetParameter(OMX_IndexParamAudioPortFormat, config); - break; - } - case KUidTPortPCMModeType: - { - OMX_AUDIO_PARAM_PCMMODETYPE* config = const_cast( - TILPortPCMMode::GetStructure(aConfig)); - ASSERT(config); - config->nVersion = KOMXILSpecVersion; - config->nSize = sizeof(OMX_AUDIO_PARAM_PCMMODETYPE); - config->nPortIndex = portIndex; - error = OmxSetParameter(OMX_IndexParamAudioPcm, config); - break; - } - case KUidTPortAACProfileType: - { - OMX_AUDIO_PARAM_AACPROFILETYPE* config = const_cast( - TILPortAACProfile::GetStructure(aConfig)); - ASSERT(config); - config->nVersion = KOMXILSpecVersion; - config->nSize = sizeof(OMX_AUDIO_PARAM_AACPROFILETYPE); - config->nPortIndex = portIndex; - error = OmxSetParameter(OMX_IndexParamAudioAac, config); - break; - } - case KUidTPortVorbisType: - { - OMX_AUDIO_PARAM_VORBISTYPE* config = const_cast( - TILPortVorbis::GetStructure(aConfig)); - ASSERT(config); - config->nVersion = KOMXILSpecVersion; - config->nSize = sizeof(OMX_AUDIO_PARAM_VORBISTYPE); - config->nPortIndex = portIndex; - error = OmxSetParameter(OMX_IndexParamAudioVorbis, config); - break; - } - case KUidTPortVolumeType: - { - OMX_AUDIO_CONFIG_VOLUMETYPE* config = const_cast( - TILPortVolume::GetStructure(aConfig)); - ASSERT(config); - config->nVersion = KOMXILSpecVersion; - config->nSize = sizeof(OMX_AUDIO_CONFIG_VOLUMETYPE); - config->nPortIndex = portIndex; - error = OmxSetConfig(OMX_IndexConfigAudioVolume, config); - break; - } - case KUidTPortMuteType: - { - OMX_AUDIO_CONFIG_MUTETYPE* config = const_cast( - TILPortMute::GetStructure(aConfig)); - ASSERT(config); - config->nVersion = KOMXILSpecVersion; - config->nSize = sizeof(OMX_AUDIO_CONFIG_MUTETYPE); - config->nPortIndex = portIndex; - error = OmxSetConfig(OMX_IndexConfigAudioMute, config); - break; - } - default: - { - error = KErrNotSupported; - } - } - return error; - } - - -TInt COmxILDummyAudioDecILIF::GetConfig(TILStruct& aConfig, - const MILComponentPortIf* aComponentPort) const - { - TInt portIndex = 0xFF; // Initialize to invalid port index - if (aComponentPort) - { - portIndex = aComponentPort->PortIndex(); - } - else - { - // All parameters and configs are targetted to the port. - return KErrArgument; - } - - TInt error = KErrNone; - - switch (aConfig.Uid().iUid) - { - case KUidOMXILStructType: - { - TOMXILStructParam* omxILStructParam = static_cast (&aConfig); - switch (omxILStructParam->Index()) - { - case OMX_IndexParamPortDefinition: - { - OMX_PARAM_PORTDEFINITIONTYPE* config = reinterpret_cast(omxILStructParam->Param()); - ASSERT(config); - config->nVersion = KOMXILSpecVersion; - config->nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE); - config->nPortIndex = portIndex; - error = OmxGetParameter(OMX_IndexParamPortDefinition, config); - break; - } - default: - { - error = KErrNotSupported; - } - } - break; - } - - case KUidTPortDefinitionType: - { - OMX_PARAM_PORTDEFINITIONTYPE* config = TILPortDefinition::GetStructure(aConfig); - ASSERT(config); - config->nVersion = KOMXILSpecVersion; - config->nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE); - config->nPortIndex = portIndex; - error = OmxGetParameter(OMX_IndexParamPortDefinition, config); - break; - } - case KUidTAudioPortFormatType: - { - OMX_AUDIO_PARAM_PORTFORMATTYPE* config = TILAudioPortFormat::GetStructure(aConfig); - ASSERT(config); - config->nVersion = KOMXILSpecVersion; - config->nSize = sizeof(OMX_AUDIO_PARAM_PORTFORMATTYPE); - config->nPortIndex = portIndex; - error = OmxGetParameter(OMX_IndexParamAudioPortFormat, config); - break; - } - case KUidTPortPCMModeType: - { - OMX_AUDIO_PARAM_PCMMODETYPE* config = TILPortPCMMode::GetStructure(aConfig); - ASSERT(config); - config->nVersion = KOMXILSpecVersion; - config->nSize = sizeof(OMX_AUDIO_PARAM_PCMMODETYPE); - config->nPortIndex = portIndex; - error = OmxGetParameter(OMX_IndexParamAudioPcm, config); - break; - } - case KUidTPortAACProfileType: - { - OMX_AUDIO_PARAM_AACPROFILETYPE* config = TILPortAACProfile::GetStructure(aConfig); - ASSERT(config); - config->nVersion = KOMXILSpecVersion; - config->nSize = sizeof(OMX_AUDIO_PARAM_AACPROFILETYPE); - config->nPortIndex = portIndex; - error = OmxGetParameter(OMX_IndexParamAudioAac, config); - break; - } - case KUidTPortVorbisType: - { - OMX_AUDIO_PARAM_VORBISTYPE* config = TILPortVorbis::GetStructure(aConfig); - ASSERT(config); - config->nVersion = KOMXILSpecVersion; - config->nSize = sizeof(OMX_AUDIO_PARAM_VORBISTYPE); - config->nPortIndex = portIndex; - error = OmxGetParameter(OMX_IndexParamAudioVorbis, config); - break; - } - case KUidTPortVolumeType: - { - OMX_AUDIO_CONFIG_VOLUMETYPE* config = TILPortVolume::GetStructure(aConfig); - ASSERT(config); - config->nVersion = KOMXILSpecVersion; - config->nSize = sizeof(OMX_AUDIO_CONFIG_VOLUMETYPE); - config->nPortIndex = portIndex; - error = OmxGetConfig(OMX_IndexConfigAudioVolume, config); - break; - } - case KUidTPortMuteType: - { - OMX_AUDIO_CONFIG_MUTETYPE* config = TILPortMute::GetStructure(aConfig); - ASSERT(config); - config->nVersion = KOMXILSpecVersion; - config->nSize = sizeof(OMX_AUDIO_CONFIG_MUTETYPE); - config->nPortIndex = portIndex; - error = OmxGetConfig(OMX_IndexConfigAudioMute, config); - break; - } - default: - { - error = KErrNotSupported; - } - } - - return error; - } - -TInt COmxILDummyAudioDecILIF::SetExtConfig(const TDesC8& aParameterName, - const TILStruct& aConfig, - const MILComponentPortIf* aComponentPort) - { - TInt portIndex = 0xFF; // Initialize to invalid port index - if (aComponentPort) - { - portIndex = aComponentPort->PortIndex(); - } - else - { - // All parameters and configs are targetted to the port. - return KErrArgument; - } - - OMX_INDEXTYPE indexType; - TInt error = KErrNone; - error = OmxGetExtensionIndex(aParameterName, &indexType); - - if (error == KErrNone) - { - switch (aConfig.Uid().iUid) - { - case KUidTPortDefinitionType: - { - OMX_PARAM_PORTDEFINITIONTYPE* config = const_cast(TILPortDefinition::GetStructure(aConfig)); - ASSERT(config); - config->nVersion = KOMXILSpecVersion; - config->nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE); - config->nPortIndex = portIndex; - error = OmxSetParameter(OMX_IndexParamPortDefinition, config); - break; - } - default: - { - error = KErrNotSupported; - } - } - } - - - return error; - } - -TInt COmxILDummyAudioDecILIF::GetExtConfig(const TDesC8& aParameterName, - TILStruct& aConfig, - const MILComponentPortIf* aComponentPort) const - { - TInt portIndex = 0xFF; // Initialize to invalid port index - if (aComponentPort) - { - portIndex = aComponentPort->PortIndex(); - } - else - { - // All parameters and configs are targetted to the port. - return KErrArgument; - } - - OMX_INDEXTYPE indexType; - - TInt error = KErrNone; - error = OmxGetExtensionIndex(aParameterName, &indexType); - - if (error == KErrNone) - { - switch (aConfig.Uid().iUid) - { - case KUidTPortDefinitionType: - { - OMX_PARAM_PORTDEFINITIONTYPE* config = TILPortDefinition::GetStructure(aConfig); - ASSERT(config); - config->nVersion = KOMXILSpecVersion; - config->nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE); - config->nPortIndex = portIndex; - error = OmxGetParameter(indexType, config); - break; - } - default: - { - error = KErrNotSupported; - } - } - } - return error; - } - -TInt COmxILDummyAudioDecILIF::SetComponentIfRole(const TUid& aComponentRole) - { - if ((aComponentRole == KUidFormatAAC) || - (aComponentRole == KUidFormatOGG) || - (aComponentRole == KUidFormatPCM16)) - { - return (COmxILDummyBaseILIF::SetComponentIfRole(aComponentRole)); - } - else - { - return KErrNotSupported; - } - } +// 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 "omxildummyaudiodecilif.h" +#include "iltestuids.hrh" +#include "omxilspecversion.h" +#include "tilstructtypes.h" +#include "tomxilstruct.h" +#include "milcomponentportif.h" +#include +#include + + +// _________________________________________________________________________________ + +const TImplementationProxy ImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY(KUidOmxILDummyAudioDecMILIFPlugin , COmxILDummyAudioDecILIF::NewL) + }; + +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) + { + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + + return ImplementationTable; + }; +// _________________________________________________________________________________ + + +const TUint KMonoChannel = 1; +const TUint KStereoChannel = 2; +const TInt KPcm16BitsPerSample = 16; + + +COmxILDummyAudioDecILIF* COmxILDummyAudioDecILIF::NewL() + { + COmxILDummyAudioDecILIF* self = new (ELeave) COmxILDummyAudioDecILIF; + return self; + } + +COmxILDummyAudioDecILIF::COmxILDummyAudioDecILIF() + { + } + +COmxILDummyAudioDecILIF::~COmxILDummyAudioDecILIF() + { + } + + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + +Mandatory params across all standard components +=============================================== + OMX_IndexParamPortDefinition OMX_PARAM_PORTDEFINITIONTYPE (KUidTPortDefinitionType, TPortDefinitionType) + OMX_IndexParamAudioInit + OMX_IndexParamCompBufferSupplier + +Mandatory params across all audio standard components +===================================================== + OMX_IndexParamAudioPortFormat OMX_AUDIO_PARAM_PORTFORMATTYPE (KUidTAudioPortFormatType, TAudioPortFormatType) + +Component role: audio_decoder.aac +================================= +- APB+0: Accepts encoded audio + OMX_IndexParamAudioAac OMX_AUDIO_PARAM_AACPROFILETYPE (KUidTPortAACProfileType, TPortAACProfileType) +- APB+1: Emits decoded audio + OMX_IndexParamAudioPcm OMX_AUDIO_PARAM_PCMMODETYPE (KUidTPortPCMType, TPortPCMType) + +Component role: audio_renderer.pcm +================================== +- APB+0: Accepts audio for rendering: + (OMX_IndexParamAudioPcm, OMX_AUDIO_PARAM_PCMMODETYPE) (KUidTPortPCMType, TPortPCMType) + (OMX_IndexConfigAudioVolume, OMX_AUDIO_CONFIG_VOLUMETYPE) (KUidTPortVolumeType, TPortVolumeType) + (OMX_IndexConfigAudioMute, OMX_AUDIO_CONFIG_MUTETYPE) (KUidTPortMuteType, TPortMuteType) + +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +TInt COmxILDummyAudioDecILIF::SetConfig(const TILStruct& aConfig, + const MILComponentPortIf* aComponentPort) + { + + TInt portIndex = 0xFF; // Initialize to invalid port index + if (aComponentPort) + { + portIndex = aComponentPort->PortIndex(); + } + else + { + // All parameters and configs are targetted to the port. + return KErrArgument; + } + + TInt error = KErrNone; + + switch (aConfig.Uid().iUid) + { + case KUidOMXILStructType: + { + const TOMXILStructParam* omxILStructParam = static_cast (&aConfig); + switch (omxILStructParam->Index()) + { + case OMX_IndexParamPortDefinition: + { + OMX_PARAM_PORTDEFINITIONTYPE* config = reinterpret_cast( + const_cast(omxILStructParam)->Param()); + ASSERT(config); + config->nPortIndex = portIndex; + config->nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE); + error = OmxSetParameter(OMX_IndexParamPortDefinition, config); + break; + } + default: + { + error = KErrNotSupported; + } + } + break; + } + + case KUidMMFTTaskConfig: + { + const TTaskConfig* config = TILTaskConfig::GetStructure(aConfig); + ASSERT(config); + + TInt sampleRate = config->iRate; + TInt channels = (config->iStereoMode & ETaskMono)? KMonoChannel : KStereoChannel; + TBool interleaved = (config->iStereoMode & ETaskInterleaved)?ETrue : EFalse; + + TUid format; + error = GetComponentIfRole(format); + if (error != KErrNone) + { + break; + } + + if (format == KUidFormatOGG) + { + if (aComponentPort->PortDirection()== EDirOutput) + { + // Set Output Port (PCM16) + OMX_AUDIO_PARAM_PCMMODETYPE pcm; + pcm.nVersion = KOMXILSpecVersion; + pcm.nSize = sizeof(OMX_AUDIO_PARAM_PCMMODETYPE); + pcm.nPortIndex = portIndex; + pcm.nSamplingRate = sampleRate; + pcm.ePCMMode = OMX_AUDIO_PCMModeLinear; + pcm.eNumData = OMX_NumericalDataSigned; + pcm.nBitPerSample = KPcm16BitsPerSample; + pcm.nChannels = channels; + pcm.bInterleaved = (OMX_BOOL)interleaved; + + error = OmxSetParameter(OMX_IndexParamAudioPcm, &pcm); + } + else if (aComponentPort->PortDirection() == EDirInput) + { + // Set Input Port (Vorbis) + OMX_AUDIO_PARAM_VORBISTYPE vorbis; + vorbis.nVersion = KOMXILSpecVersion; + vorbis.nSize = sizeof(OMX_AUDIO_PARAM_VORBISTYPE); + vorbis.nPortIndex = portIndex; + + error = OmxSetParameter(OMX_IndexParamAudioVorbis, &vorbis); + } + } + else if (format == KUidFormatPCM16) + { + if (aComponentPort->PortDirection()== EDirInput) + { + // Set Input Port (PCM16) + OMX_AUDIO_PARAM_PCMMODETYPE pcm; + pcm.nVersion = KOMXILSpecVersion; + pcm.nSize = sizeof(OMX_AUDIO_PARAM_PCMMODETYPE); + pcm.nPortIndex = portIndex; + pcm.nSamplingRate = sampleRate; + pcm.ePCMMode = OMX_AUDIO_PCMModeLinear; + pcm.eNumData = OMX_NumericalDataSigned; + pcm.nBitPerSample = KPcm16BitsPerSample; + pcm.nChannels = channels; + pcm.bInterleaved = (OMX_BOOL)interleaved; + + error = OmxSetParameter(OMX_IndexParamAudioPcm, &pcm); + } + else + { + error = KErrNotSupported; + } + } + else + { + error = KErrNotSupported; + } + break; + } + case KUidTPortDefinitionType: + { + OMX_PARAM_PORTDEFINITIONTYPE* config = const_cast( + TILPortDefinition::GetStructure(aConfig)); + ASSERT(config); + config->nVersion = KOMXILSpecVersion; + config->nSize = sizeof(OMX_AUDIO_PARAM_PORTFORMATTYPE); + config->nPortIndex = portIndex; + error = OmxSetParameter(OMX_IndexParamPortDefinition, config); + break; + } + case KUidTAudioPortFormatType: + { + OMX_AUDIO_PARAM_PORTFORMATTYPE* config = const_cast( + TILAudioPortFormat::GetStructure(aConfig)); + ASSERT(config); + config->nVersion = KOMXILSpecVersion; + config->nSize = sizeof(OMX_AUDIO_PARAM_PORTFORMATTYPE); + config->nPortIndex = portIndex; + error = OmxSetParameter(OMX_IndexParamAudioPortFormat, config); + break; + } + case KUidTPortPCMModeType: + { + OMX_AUDIO_PARAM_PCMMODETYPE* config = const_cast( + TILPortPCMMode::GetStructure(aConfig)); + ASSERT(config); + config->nVersion = KOMXILSpecVersion; + config->nSize = sizeof(OMX_AUDIO_PARAM_PCMMODETYPE); + config->nPortIndex = portIndex; + error = OmxSetParameter(OMX_IndexParamAudioPcm, config); + break; + } + case KUidTPortAACProfileType: + { + OMX_AUDIO_PARAM_AACPROFILETYPE* config = const_cast( + TILPortAACProfile::GetStructure(aConfig)); + ASSERT(config); + config->nVersion = KOMXILSpecVersion; + config->nSize = sizeof(OMX_AUDIO_PARAM_AACPROFILETYPE); + config->nPortIndex = portIndex; + error = OmxSetParameter(OMX_IndexParamAudioAac, config); + break; + } + case KUidTPortVorbisType: + { + OMX_AUDIO_PARAM_VORBISTYPE* config = const_cast( + TILPortVorbis::GetStructure(aConfig)); + ASSERT(config); + config->nVersion = KOMXILSpecVersion; + config->nSize = sizeof(OMX_AUDIO_PARAM_VORBISTYPE); + config->nPortIndex = portIndex; + error = OmxSetParameter(OMX_IndexParamAudioVorbis, config); + break; + } + case KUidTPortVolumeType: + { + OMX_AUDIO_CONFIG_VOLUMETYPE* config = const_cast( + TILPortVolume::GetStructure(aConfig)); + ASSERT(config); + config->nVersion = KOMXILSpecVersion; + config->nSize = sizeof(OMX_AUDIO_CONFIG_VOLUMETYPE); + config->nPortIndex = portIndex; + error = OmxSetConfig(OMX_IndexConfigAudioVolume, config); + break; + } + case KUidTPortMuteType: + { + OMX_AUDIO_CONFIG_MUTETYPE* config = const_cast( + TILPortMute::GetStructure(aConfig)); + ASSERT(config); + config->nVersion = KOMXILSpecVersion; + config->nSize = sizeof(OMX_AUDIO_CONFIG_MUTETYPE); + config->nPortIndex = portIndex; + error = OmxSetConfig(OMX_IndexConfigAudioMute, config); + break; + } + default: + { + error = KErrNotSupported; + } + } + return error; + } + + +TInt COmxILDummyAudioDecILIF::GetConfig(TILStruct& aConfig, + const MILComponentPortIf* aComponentPort) const + { + TInt portIndex = 0xFF; // Initialize to invalid port index + if (aComponentPort) + { + portIndex = aComponentPort->PortIndex(); + } + else + { + // All parameters and configs are targetted to the port. + return KErrArgument; + } + + TInt error = KErrNone; + + switch (aConfig.Uid().iUid) + { + case KUidOMXILStructType: + { + TOMXILStructParam* omxILStructParam = static_cast (&aConfig); + switch (omxILStructParam->Index()) + { + case OMX_IndexParamPortDefinition: + { + OMX_PARAM_PORTDEFINITIONTYPE* config = reinterpret_cast(omxILStructParam->Param()); + ASSERT(config); + config->nVersion = KOMXILSpecVersion; + config->nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE); + config->nPortIndex = portIndex; + error = OmxGetParameter(OMX_IndexParamPortDefinition, config); + break; + } + default: + { + error = KErrNotSupported; + } + } + break; + } + + case KUidTPortDefinitionType: + { + OMX_PARAM_PORTDEFINITIONTYPE* config = TILPortDefinition::GetStructure(aConfig); + ASSERT(config); + config->nVersion = KOMXILSpecVersion; + config->nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE); + config->nPortIndex = portIndex; + error = OmxGetParameter(OMX_IndexParamPortDefinition, config); + break; + } + case KUidTAudioPortFormatType: + { + OMX_AUDIO_PARAM_PORTFORMATTYPE* config = TILAudioPortFormat::GetStructure(aConfig); + ASSERT(config); + config->nVersion = KOMXILSpecVersion; + config->nSize = sizeof(OMX_AUDIO_PARAM_PORTFORMATTYPE); + config->nPortIndex = portIndex; + error = OmxGetParameter(OMX_IndexParamAudioPortFormat, config); + break; + } + case KUidTPortPCMModeType: + { + OMX_AUDIO_PARAM_PCMMODETYPE* config = TILPortPCMMode::GetStructure(aConfig); + ASSERT(config); + config->nVersion = KOMXILSpecVersion; + config->nSize = sizeof(OMX_AUDIO_PARAM_PCMMODETYPE); + config->nPortIndex = portIndex; + error = OmxGetParameter(OMX_IndexParamAudioPcm, config); + break; + } + case KUidTPortAACProfileType: + { + OMX_AUDIO_PARAM_AACPROFILETYPE* config = TILPortAACProfile::GetStructure(aConfig); + ASSERT(config); + config->nVersion = KOMXILSpecVersion; + config->nSize = sizeof(OMX_AUDIO_PARAM_AACPROFILETYPE); + config->nPortIndex = portIndex; + error = OmxGetParameter(OMX_IndexParamAudioAac, config); + break; + } + case KUidTPortVorbisType: + { + OMX_AUDIO_PARAM_VORBISTYPE* config = TILPortVorbis::GetStructure(aConfig); + ASSERT(config); + config->nVersion = KOMXILSpecVersion; + config->nSize = sizeof(OMX_AUDIO_PARAM_VORBISTYPE); + config->nPortIndex = portIndex; + error = OmxGetParameter(OMX_IndexParamAudioVorbis, config); + break; + } + case KUidTPortVolumeType: + { + OMX_AUDIO_CONFIG_VOLUMETYPE* config = TILPortVolume::GetStructure(aConfig); + ASSERT(config); + config->nVersion = KOMXILSpecVersion; + config->nSize = sizeof(OMX_AUDIO_CONFIG_VOLUMETYPE); + config->nPortIndex = portIndex; + error = OmxGetConfig(OMX_IndexConfigAudioVolume, config); + break; + } + case KUidTPortMuteType: + { + OMX_AUDIO_CONFIG_MUTETYPE* config = TILPortMute::GetStructure(aConfig); + ASSERT(config); + config->nVersion = KOMXILSpecVersion; + config->nSize = sizeof(OMX_AUDIO_CONFIG_MUTETYPE); + config->nPortIndex = portIndex; + error = OmxGetConfig(OMX_IndexConfigAudioMute, config); + break; + } + default: + { + error = KErrNotSupported; + } + } + + return error; + } + +TInt COmxILDummyAudioDecILIF::SetExtConfig(const TDesC8& aParameterName, + const TILStruct& aConfig, + const MILComponentPortIf* aComponentPort) + { + TInt portIndex = 0xFF; // Initialize to invalid port index + if (aComponentPort) + { + portIndex = aComponentPort->PortIndex(); + } + else + { + // All parameters and configs are targetted to the port. + return KErrArgument; + } + + OMX_INDEXTYPE indexType; + TInt error = KErrNone; + error = OmxGetExtensionIndex(aParameterName, &indexType); + + if (error == KErrNone) + { + switch (aConfig.Uid().iUid) + { + case KUidTPortDefinitionType: + { + OMX_PARAM_PORTDEFINITIONTYPE* config = const_cast(TILPortDefinition::GetStructure(aConfig)); + ASSERT(config); + config->nVersion = KOMXILSpecVersion; + config->nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE); + config->nPortIndex = portIndex; + error = OmxSetParameter(OMX_IndexParamPortDefinition, config); + break; + } + default: + { + error = KErrNotSupported; + } + } + } + + + return error; + } + +TInt COmxILDummyAudioDecILIF::GetExtConfig(const TDesC8& aParameterName, + TILStruct& aConfig, + const MILComponentPortIf* aComponentPort) const + { + TInt portIndex = 0xFF; // Initialize to invalid port index + if (aComponentPort) + { + portIndex = aComponentPort->PortIndex(); + } + else + { + // All parameters and configs are targetted to the port. + return KErrArgument; + } + + OMX_INDEXTYPE indexType; + + TInt error = KErrNone; + error = OmxGetExtensionIndex(aParameterName, &indexType); + + if (error == KErrNone) + { + switch (aConfig.Uid().iUid) + { + case KUidTPortDefinitionType: + { + OMX_PARAM_PORTDEFINITIONTYPE* config = TILPortDefinition::GetStructure(aConfig); + ASSERT(config); + config->nVersion = KOMXILSpecVersion; + config->nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE); + config->nPortIndex = portIndex; + error = OmxGetParameter(indexType, config); + break; + } + default: + { + error = KErrNotSupported; + } + } + } + return error; + } + +TInt COmxILDummyAudioDecILIF::SetComponentIfRole(const TUid& aComponentRole) + { + if ((aComponentRole == KUidFormatAAC) || + (aComponentRole == KUidFormatOGG) || + (aComponentRole == KUidFormatPCM16)) + { + return (COmxILDummyBaseILIF::SetComponentIfRole(aComponentRole)); + } + else + { + return KErrNotSupported; + } + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/unittest/test_plugins/omxildummyaudiodecilif/omxildummyaudiodecilif.h --- a/omxil/mmilapi/unittest/test_plugins/omxildummyaudiodecilif/omxildummyaudiodecilif.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/unittest/test_plugins/omxildummyaudiodecilif/omxildummyaudiodecilif.h Fri May 07 16:25:23 2010 +0100 @@ -1,45 +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 OMXILDUMMYAUDIODECILIF_H -#define OMXILDUMMYAUDIODECILIF_H - -#include "omxildummybaseilif.h" - -/** -Test component. -Concrete implementation of the MILIF API when implemented as a plugin -and specific to the AAC and Vorbis decoder and the PCM renderer OMX IL component specifications. - -*/ -class COmxILDummyAudioDecILIF : public COmxILDummyBaseILIF - { -public: - static COmxILDummyAudioDecILIF* NewL(); - - // from COmxILDummyBaseILIF - TInt SetConfig(const TILStruct& aConfig, const MILComponentPortIf* aComponentPort); - TInt GetConfig(TILStruct& aConfig, const MILComponentPortIf* aComponentPort) const; - TInt SetExtConfig(const TDesC8& aParameterName, const TILStruct& aConfig, const MILComponentPortIf* aComponentPort); - TInt GetExtConfig(const TDesC8& aParameterName, TILStruct& aConfig, const MILComponentPortIf* aComponentPort) const; - TInt SetComponentIfRole(const TUid& aComponentRole); - -private: - COmxILDummyAudioDecILIF(); - ~COmxILDummyAudioDecILIF(); - }; - -#endif // OMXILDUMMYAUDIODECILIF_H - +// 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 OMXILDUMMYAUDIODECILIF_H +#define OMXILDUMMYAUDIODECILIF_H + +#include "omxildummybaseilif.h" + +/** +Test component. +Concrete implementation of the MILIF API when implemented as a plugin +and specific to the AAC and Vorbis decoder and the PCM renderer OMX IL component specifications. + +*/ +class COmxILDummyAudioDecILIF : public COmxILDummyBaseILIF + { +public: + static COmxILDummyAudioDecILIF* NewL(); + + // from COmxILDummyBaseILIF + TInt SetConfig(const TILStruct& aConfig, const MILComponentPortIf* aComponentPort); + TInt GetConfig(TILStruct& aConfig, const MILComponentPortIf* aComponentPort) const; + TInt SetExtConfig(const TDesC8& aParameterName, const TILStruct& aConfig, const MILComponentPortIf* aComponentPort); + TInt GetExtConfig(const TDesC8& aParameterName, TILStruct& aConfig, const MILComponentPortIf* aComponentPort) const; + TInt SetComponentIfRole(const TUid& aComponentRole); + +private: + COmxILDummyAudioDecILIF(); + ~COmxILDummyAudioDecILIF(); + }; + +#endif // OMXILDUMMYAUDIODECILIF_H + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/unittest/test_plugins/omxildummyaudiodecilif/omxildummyaudiodecilif.rss --- a/omxil/mmilapi/unittest/test_plugins/omxildummyaudiodecilif/omxildummyaudiodecilif.rss Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/unittest/test_plugins/omxildummyaudiodecilif/omxildummyaudiodecilif.rss Fri May 07 16:25:23 2010 +0100 @@ -1,43 +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: -// comxilaudiodecgenericif.rss -// -// - -#include -#include "ilifuids.hrh" -#include "iltestuids.hrh" - -RESOURCE REGISTRY_INFO theInfo - { - dll_uid = KUidOmxILDummyAudioDecMILIFPluginDll; - interfaces = - { - INTERFACE_INFO - { - interface_uid = KILComponentIfUid; - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = KUidOmxILDummyAudioDecMILIFPlugin; - version_no = 1; - display_name = "Symbian OMX IL v1.1 AudioDec I/F"; - default_data = "audio_decoder.vorbis, audio_decoder.aac, audio_renderer.pcm"; - opaque_data = ""; - } - }; - } - }; - } +// 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: +// comxilaudiodecgenericif.rss +// +// + +#include +#include "ilifuids.hrh" +#include "iltestuids.hrh" + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = KUidOmxILDummyAudioDecMILIFPluginDll; + interfaces = + { + INTERFACE_INFO + { + interface_uid = KILComponentIfUid; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KUidOmxILDummyAudioDecMILIFPlugin; + version_no = 1; + display_name = "Symbian OMX IL v1.1 AudioDec I/F"; + default_data = "audio_decoder.vorbis, audio_decoder.aac, audio_renderer.pcm"; + opaque_data = ""; + } + }; + } + }; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/unittest/test_plugins/omxildummybaseilif/omxildummybaseilif.cpp --- a/omxil/mmilapi/unittest/test_plugins/omxildummybaseilif/omxildummybaseilif.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/unittest/test_plugins/omxildummybaseilif/omxildummybaseilif.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,298 +1,298 @@ -// 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 "omxildummybaseilif.h" -#include "omxildummybaseilifbody.h" -#include "omxilcoreutils.h" -#include "iltestuids.hrh" -#include "milcomponentportif.h" -#include "ilifuids.h" -#include - -const TUint32 KOMXALL = 0xFFFFFFFF; - - -EXPORT_C COmxILDummyBaseILIF::COmxILDummyBaseILIF() - { - } - -EXPORT_C COmxILDummyBaseILIF::~COmxILDummyBaseILIF() - { - if (iBody) - { - delete iBody; - } - } - -EXPORT_C void COmxILDummyBaseILIF::CreateComponentL(const TDesC8& aComponentName, - MILIfObserver& aComponentIfObserver) - { - iBody = CBody::NewL(*this, aComponentIfObserver, aComponentName); - - User::LeaveIfError(iBody->SetPortsL()); - } - -EXPORT_C void COmxILDummyBaseILIF::CreateComponentL(const TUid& /*aUid*/, - MILIfObserver& /*ComponentIfObserver*/) - { - // OMX Versions do not use this method of creation - User::Leave(KErrNotSupported); - } - -EXPORT_C void COmxILDummyBaseILIF::ReleaseComponent() - { - delete iBody; - iBody = NULL; - - delete this; - } - -EXPORT_C TInt COmxILDummyBaseILIF::GetComponentInputPorts(RPointerArray& aComponentPorts) const - { - return (iBody->GetComponentPorts(aComponentPorts, OMX_DirInput)); - } - -EXPORT_C TInt COmxILDummyBaseILIF::GetComponentOutputPorts(RPointerArray& aComponentPorts) const - { - return (iBody->GetComponentPorts(aComponentPorts, OMX_DirOutput)); - } - -EXPORT_C TInt COmxILDummyBaseILIF::SetConfig(const TILStruct& /*aConfig*/, - const MILComponentPortIf* /*aComponentPort*/) - { - // It should be implemented in the derived class - return KErrNotSupported; - } - -EXPORT_C TInt COmxILDummyBaseILIF::GetConfig(TILStruct& /*aConfig*/, - const MILComponentPortIf* /*aComponentPort*/) const - { - // It should be implemented in the derived class - return (KErrNotSupported); - } - -EXPORT_C TInt COmxILDummyBaseILIF::Initialize() - { - return (iBody->OmxSendCommand(OMX_CommandStateSet, OMX_StateIdle, NULL)); - } - -EXPORT_C TInt COmxILDummyBaseILIF::Execute() - { - return (iBody->OmxSendCommand(OMX_CommandStateSet, OMX_StateExecuting, NULL)); - } - -EXPORT_C TInt COmxILDummyBaseILIF::Pause() - { - return (iBody->OmxSendCommand(OMX_CommandStateSet, OMX_StatePause, NULL)); - } - -EXPORT_C TInt COmxILDummyBaseILIF::Stop() - { - return (iBody->OmxSendCommand(OMX_CommandStateSet, OMX_StateIdle, NULL)); - } - -EXPORT_C TInt COmxILDummyBaseILIF::UnInitialize() - { - return (iBody->OmxSendCommand(OMX_CommandStateSet, OMX_StateLoaded, NULL)); - } - -EXPORT_C TInt COmxILDummyBaseILIF::GetState(TILComponentState& aState) const - { - TInt error; - OMX_STATETYPE state; - error = iBody->OmxGetState(&state); - aState = ConvertOmxState(state); - return error; - } - -EXPORT_C TInt COmxILDummyBaseILIF::SendCommand(const TILCommand& aCommand) - { - OMX_COMMANDTYPE command = ConvertSymbianCommandType(aCommand.iCmd); - return (iBody->OmxSendCommand(command, aCommand.iData1, aCommand.iExtraData)); - } - -EXPORT_C TInt COmxILDummyBaseILIF::FlushAllPorts() - { - return (iBody->OmxSendCommand(OMX_CommandFlush, KOMXALL, NULL)); - } - -EXPORT_C TInt COmxILDummyBaseILIF::ComponentRoleEnum(TPtr8& aComponentRole, - TUint32 aIndex) const - { - return (iBody->OmxComponentRoleEnum(aComponentRole, aIndex)); - } - -EXPORT_C TInt COmxILDummyBaseILIF::GetComponentVersion(TILComponentVersion& aVersion) const - { - return (iBody->OmxGetComponentVersion(aVersion.iComponentName, - (OMX_VERSIONTYPE*)&aVersion.iComponentVersion, - (OMX_VERSIONTYPE*)&aVersion.iSpecVersion, - (OMX_UUIDTYPE*)&aVersion.iComponentUniqueID)); - } - -EXPORT_C TInt COmxILDummyBaseILIF::SetComponentIfRole(const TUid& aComponentRole) - { - return (iBody->SetIfToRole(aComponentRole)); - } - -EXPORT_C TInt COmxILDummyBaseILIF::SetComponentIfRole(const TDesC8& /*aComponentRole*/) - { - return (KErrNotSupported); - } - -EXPORT_C TInt COmxILDummyBaseILIF::GetComponentIfRole(TUid& aComponentRole) const - { - return (iBody->GetIfRole(aComponentRole)); - } - -EXPORT_C TInt COmxILDummyBaseILIF::GetComponentIfRole(TDes8& /*aComponentRole*/) const - { - return (KErrNotSupported); - } - -EXPORT_C TInt COmxILDummyBaseILIF::SetExtConfig(const TDesC8& /*aParameterName*/, - const TILStruct& /*aConfig*/, - const MILComponentPortIf* /*aComponentPort*/) - { - // It should be implemented in the derived class - return (KErrNotSupported); - } - -EXPORT_C TInt COmxILDummyBaseILIF::GetExtConfig(const TDesC8& /*aParameterName*/, - TILStruct& /*aConfig*/, - const MILComponentPortIf* /*aComponentPort*/) const - { - // It should be implemented in the derived class - return (KErrNotSupported); - } -EXPORT_C TAny* COmxILDummyBaseILIF::CustomInterface(TUid aUid) - { - if (aUid == KUidILComponentIf) - { - MILComponentIf* componentIf = this; - return componentIf; - } - else - { - return NULL; - } - } - - -EXPORT_C TInt COmxILDummyBaseILIF::FillBufferDone(CMMFBuffer* aBuffer, - TInt aPortIndex) - { - return (iBody->FillBufferDone(aBuffer, aPortIndex)); - } - -EXPORT_C TInt COmxILDummyBaseILIF::EmptyBufferDone(const CMMFBuffer* aBuffer, - TInt aPortIndex) - { - return (iBody->EmptyBufferDone(aBuffer, aPortIndex)); - } - -EXPORT_C TInt COmxILDummyBaseILIF::EventHandler(OMX_EVENTTYPE aEvent, - TUint32 aData1, - TUint32 aData2, - TAny* aExtraInfo) - { - return (iBody->EventHandler(aEvent, aData1, aData2, aExtraInfo)); - } - -EXPORT_C TInt COmxILDummyBaseILIF::OmxGetParameter(OMX_INDEXTYPE aParamIndex, - TAny* aComponentParameterStructure) const - { - return (iBody->OmxGetParameter(aParamIndex, aComponentParameterStructure)); - } - -EXPORT_C TInt COmxILDummyBaseILIF::OmxSetParameter(OMX_INDEXTYPE aParamIndex, - TAny* aComponentParameterStructure) - { - return (iBody->OmxSetParameter(aParamIndex, aComponentParameterStructure)); - } - -EXPORT_C TInt COmxILDummyBaseILIF::OmxGetConfig(OMX_INDEXTYPE aConfigIndex, - TAny* aValue) const - { - return (iBody->OmxGetConfig(aConfigIndex, aValue)); - } - -EXPORT_C TInt COmxILDummyBaseILIF::OmxSetConfig(OMX_INDEXTYPE aConfigIndex, - TAny* aValue) - { - return (iBody->OmxSetConfig(aConfigIndex, aValue)); - } - -EXPORT_C TInt COmxILDummyBaseILIF::OmxGetExtensionIndex(const TDesC8& aParameterName, - OMX_INDEXTYPE* aIndexType) const - { - return (iBody->OmxGetExtensionIndex(aParameterName, aIndexType)); - } - -TInt COmxILDummyBaseILIF::OmxSendCommand(OMX_COMMANDTYPE aCmd, - TUint32 aParam1, - TAny* aCmdData) - { - return (iBody->OmxSendCommand(aCmd, aParam1, aCmdData)); - } - -TInt COmxILDummyBaseILIF::OmxComponentTunnelRequest(TUint32 aPortInput, - OMX_HANDLETYPE aOutput, - TUint32 aPortOutput) - { - return (iBody->OmxComponentTunnelRequest(aPortInput, aOutput, aPortOutput)); - } - -TInt COmxILDummyBaseILIF::OmxComponentDisconnectTunnel(TUint32 aPortInput, - OMX_HANDLETYPE aOutput, - TUint32 aPortOutput) - { - return (iBody->OmxComponentDisconnectTunnel(aPortInput, aOutput, aPortOutput)); - } - -TInt COmxILDummyBaseILIF::OmxUseBuffer(CMMFBuffer* aBuffer, - TUint32 aPortIndex) - { - return (iBody->OmxUseBuffer(aBuffer, aPortIndex)); - } - -CMMFBuffer* COmxILDummyBaseILIF::OmxAllocateBufferL(TUint32 aPortIndex, - TUint32 aSizeBytes) - { - return (iBody->OmxAllocateBufferL(aPortIndex, aSizeBytes)); - } - -TInt COmxILDummyBaseILIF::OmxFreeBuffer(CMMFBuffer* aBuffer) - { - return (iBody->OmxFreeBuffer(aBuffer)); - } - -TInt COmxILDummyBaseILIF::OmxEmptyThisBuffer(const CMMFBuffer* aBuffer, - MOmxILComponentIfObserver* aObserver) - { - return (iBody->OmxEmptyThisBuffer(aBuffer, aObserver)); - } - -TInt COmxILDummyBaseILIF::OmxFillThisBuffer(CMMFBuffer* aBuffer, - MOmxILComponentIfObserver* aObserver) - { - return (iBody->OmxFillThisBuffer(aBuffer, aObserver)); - } - -OMX_COMPONENTTYPE* COmxILDummyBaseILIF::OmxHandle() const - { - return (iBody->Handle()); - } +// 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 "omxildummybaseilif.h" +#include "omxildummybaseilifbody.h" +#include "omxilcoreutils.h" +#include "iltestuids.hrh" +#include "milcomponentportif.h" +#include "ilifuids.h" +#include + +const TUint32 KOMXALL = 0xFFFFFFFF; + + +EXPORT_C COmxILDummyBaseILIF::COmxILDummyBaseILIF() + { + } + +EXPORT_C COmxILDummyBaseILIF::~COmxILDummyBaseILIF() + { + if (iBody) + { + delete iBody; + } + } + +EXPORT_C void COmxILDummyBaseILIF::CreateComponentL(const TDesC8& aComponentName, + MILIfObserver& aComponentIfObserver) + { + iBody = CBody::NewL(*this, aComponentIfObserver, aComponentName); + + User::LeaveIfError(iBody->SetPortsL()); + } + +EXPORT_C void COmxILDummyBaseILIF::CreateComponentL(const TUid& /*aUid*/, + MILIfObserver& /*ComponentIfObserver*/) + { + // OMX Versions do not use this method of creation + User::Leave(KErrNotSupported); + } + +EXPORT_C void COmxILDummyBaseILIF::ReleaseComponent() + { + delete iBody; + iBody = NULL; + + delete this; + } + +EXPORT_C TInt COmxILDummyBaseILIF::GetComponentInputPorts(RPointerArray& aComponentPorts) const + { + return (iBody->GetComponentPorts(aComponentPorts, OMX_DirInput)); + } + +EXPORT_C TInt COmxILDummyBaseILIF::GetComponentOutputPorts(RPointerArray& aComponentPorts) const + { + return (iBody->GetComponentPorts(aComponentPorts, OMX_DirOutput)); + } + +EXPORT_C TInt COmxILDummyBaseILIF::SetConfig(const TILStruct& /*aConfig*/, + const MILComponentPortIf* /*aComponentPort*/) + { + // It should be implemented in the derived class + return KErrNotSupported; + } + +EXPORT_C TInt COmxILDummyBaseILIF::GetConfig(TILStruct& /*aConfig*/, + const MILComponentPortIf* /*aComponentPort*/) const + { + // It should be implemented in the derived class + return (KErrNotSupported); + } + +EXPORT_C TInt COmxILDummyBaseILIF::Initialize() + { + return (iBody->OmxSendCommand(OMX_CommandStateSet, OMX_StateIdle, NULL)); + } + +EXPORT_C TInt COmxILDummyBaseILIF::Execute() + { + return (iBody->OmxSendCommand(OMX_CommandStateSet, OMX_StateExecuting, NULL)); + } + +EXPORT_C TInt COmxILDummyBaseILIF::Pause() + { + return (iBody->OmxSendCommand(OMX_CommandStateSet, OMX_StatePause, NULL)); + } + +EXPORT_C TInt COmxILDummyBaseILIF::Stop() + { + return (iBody->OmxSendCommand(OMX_CommandStateSet, OMX_StateIdle, NULL)); + } + +EXPORT_C TInt COmxILDummyBaseILIF::UnInitialize() + { + return (iBody->OmxSendCommand(OMX_CommandStateSet, OMX_StateLoaded, NULL)); + } + +EXPORT_C TInt COmxILDummyBaseILIF::GetState(TILComponentState& aState) const + { + TInt error; + OMX_STATETYPE state; + error = iBody->OmxGetState(&state); + aState = ConvertOmxState(state); + return error; + } + +EXPORT_C TInt COmxILDummyBaseILIF::SendCommand(const TILCommand& aCommand) + { + OMX_COMMANDTYPE command = ConvertSymbianCommandType(aCommand.iCmd); + return (iBody->OmxSendCommand(command, aCommand.iData1, aCommand.iExtraData)); + } + +EXPORT_C TInt COmxILDummyBaseILIF::FlushAllPorts() + { + return (iBody->OmxSendCommand(OMX_CommandFlush, KOMXALL, NULL)); + } + +EXPORT_C TInt COmxILDummyBaseILIF::ComponentRoleEnum(TPtr8& aComponentRole, + TUint32 aIndex) const + { + return (iBody->OmxComponentRoleEnum(aComponentRole, aIndex)); + } + +EXPORT_C TInt COmxILDummyBaseILIF::GetComponentVersion(TILComponentVersion& aVersion) const + { + return (iBody->OmxGetComponentVersion(aVersion.iComponentName, + (OMX_VERSIONTYPE*)&aVersion.iComponentVersion, + (OMX_VERSIONTYPE*)&aVersion.iSpecVersion, + (OMX_UUIDTYPE*)&aVersion.iComponentUniqueID)); + } + +EXPORT_C TInt COmxILDummyBaseILIF::SetComponentIfRole(const TUid& aComponentRole) + { + return (iBody->SetIfToRole(aComponentRole)); + } + +EXPORT_C TInt COmxILDummyBaseILIF::SetComponentIfRole(const TDesC8& /*aComponentRole*/) + { + return (KErrNotSupported); + } + +EXPORT_C TInt COmxILDummyBaseILIF::GetComponentIfRole(TUid& aComponentRole) const + { + return (iBody->GetIfRole(aComponentRole)); + } + +EXPORT_C TInt COmxILDummyBaseILIF::GetComponentIfRole(TDes8& /*aComponentRole*/) const + { + return (KErrNotSupported); + } + +EXPORT_C TInt COmxILDummyBaseILIF::SetExtConfig(const TDesC8& /*aParameterName*/, + const TILStruct& /*aConfig*/, + const MILComponentPortIf* /*aComponentPort*/) + { + // It should be implemented in the derived class + return (KErrNotSupported); + } + +EXPORT_C TInt COmxILDummyBaseILIF::GetExtConfig(const TDesC8& /*aParameterName*/, + TILStruct& /*aConfig*/, + const MILComponentPortIf* /*aComponentPort*/) const + { + // It should be implemented in the derived class + return (KErrNotSupported); + } +EXPORT_C TAny* COmxILDummyBaseILIF::CustomInterface(TUid aUid) + { + if (aUid == KUidILComponentIf) + { + MILComponentIf* componentIf = this; + return componentIf; + } + else + { + return NULL; + } + } + + +EXPORT_C TInt COmxILDummyBaseILIF::FillBufferDone(CMMFBuffer* aBuffer, + TInt aPortIndex) + { + return (iBody->FillBufferDone(aBuffer, aPortIndex)); + } + +EXPORT_C TInt COmxILDummyBaseILIF::EmptyBufferDone(const CMMFBuffer* aBuffer, + TInt aPortIndex) + { + return (iBody->EmptyBufferDone(aBuffer, aPortIndex)); + } + +EXPORT_C TInt COmxILDummyBaseILIF::EventHandler(OMX_EVENTTYPE aEvent, + TUint32 aData1, + TUint32 aData2, + TAny* aExtraInfo) + { + return (iBody->EventHandler(aEvent, aData1, aData2, aExtraInfo)); + } + +EXPORT_C TInt COmxILDummyBaseILIF::OmxGetParameter(OMX_INDEXTYPE aParamIndex, + TAny* aComponentParameterStructure) const + { + return (iBody->OmxGetParameter(aParamIndex, aComponentParameterStructure)); + } + +EXPORT_C TInt COmxILDummyBaseILIF::OmxSetParameter(OMX_INDEXTYPE aParamIndex, + TAny* aComponentParameterStructure) + { + return (iBody->OmxSetParameter(aParamIndex, aComponentParameterStructure)); + } + +EXPORT_C TInt COmxILDummyBaseILIF::OmxGetConfig(OMX_INDEXTYPE aConfigIndex, + TAny* aValue) const + { + return (iBody->OmxGetConfig(aConfigIndex, aValue)); + } + +EXPORT_C TInt COmxILDummyBaseILIF::OmxSetConfig(OMX_INDEXTYPE aConfigIndex, + TAny* aValue) + { + return (iBody->OmxSetConfig(aConfigIndex, aValue)); + } + +EXPORT_C TInt COmxILDummyBaseILIF::OmxGetExtensionIndex(const TDesC8& aParameterName, + OMX_INDEXTYPE* aIndexType) const + { + return (iBody->OmxGetExtensionIndex(aParameterName, aIndexType)); + } + +TInt COmxILDummyBaseILIF::OmxSendCommand(OMX_COMMANDTYPE aCmd, + TUint32 aParam1, + TAny* aCmdData) + { + return (iBody->OmxSendCommand(aCmd, aParam1, aCmdData)); + } + +TInt COmxILDummyBaseILIF::OmxComponentTunnelRequest(TUint32 aPortInput, + OMX_HANDLETYPE aOutput, + TUint32 aPortOutput) + { + return (iBody->OmxComponentTunnelRequest(aPortInput, aOutput, aPortOutput)); + } + +TInt COmxILDummyBaseILIF::OmxComponentDisconnectTunnel(TUint32 aPortInput, + OMX_HANDLETYPE aOutput, + TUint32 aPortOutput) + { + return (iBody->OmxComponentDisconnectTunnel(aPortInput, aOutput, aPortOutput)); + } + +TInt COmxILDummyBaseILIF::OmxUseBuffer(CMMFBuffer* aBuffer, + TUint32 aPortIndex) + { + return (iBody->OmxUseBuffer(aBuffer, aPortIndex)); + } + +CMMFBuffer* COmxILDummyBaseILIF::OmxAllocateBufferL(TUint32 aPortIndex, + TUint32 aSizeBytes) + { + return (iBody->OmxAllocateBufferL(aPortIndex, aSizeBytes)); + } + +TInt COmxILDummyBaseILIF::OmxFreeBuffer(CMMFBuffer* aBuffer) + { + return (iBody->OmxFreeBuffer(aBuffer)); + } + +TInt COmxILDummyBaseILIF::OmxEmptyThisBuffer(const CMMFBuffer* aBuffer, + MOmxILComponentIfObserver* aObserver) + { + return (iBody->OmxEmptyThisBuffer(aBuffer, aObserver)); + } + +TInt COmxILDummyBaseILIF::OmxFillThisBuffer(CMMFBuffer* aBuffer, + MOmxILComponentIfObserver* aObserver) + { + return (iBody->OmxFillThisBuffer(aBuffer, aObserver)); + } + +OMX_COMPONENTTYPE* COmxILDummyBaseILIF::OmxHandle() const + { + return (iBody->Handle()); + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/unittest/test_plugins/omxildummybaseilif/omxildummybaseilifbody.cpp --- a/omxil/mmilapi/unittest/test_plugins/omxildummybaseilif/omxildummybaseilifbody.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/unittest/test_plugins/omxildummybaseilif/omxildummybaseilifbody.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,415 +1,415 @@ -// 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 "omxildummybaseilifbody.h" -#include "omxilcoreutils.h" -#include "omxilspecversion.h" -#include "milifobserver.h" -#include "tilstructtypes.h" - - -const TInt KMaxComponentNameLength = 128; - - -COmxILDummyBaseILIF::CBody::CBody(COmxILDummyBaseILIF& aParent, - MILIfObserver& aComponentIfObserver) - : - iParent(aParent), - iIfObserver(aComponentIfObserver) - { - } - -COmxILDummyBaseILIF::CBody::~CBody() - { - iInputPorts.ResetAndDestroy(); - iInputPorts.Close(); - iOutputPorts.ResetAndDestroy(); - iOutputPorts.Close(); - delete iBufferManager; - delete iCallbacks; - - ::OMX_FreeHandle(reinterpret_cast(iHandle)); - } - -COmxILDummyBaseILIF::CBody* COmxILDummyBaseILIF::CBody::NewL(COmxILDummyBaseILIF& aParent, - MILIfObserver& aComponentIfObserver, - const TDesC8& aComponentName) - { - CBody* self = new (ELeave) CBody(aParent, aComponentIfObserver); - CleanupStack::PushL(self); - self->ConstructL(aComponentName); - CleanupStack::Pop(self); - return self; - } - -void COmxILDummyBaseILIF::CBody::ConstructL(const TDesC8& aComponentName) - { - iCallbacks = COmxCallbacks::NewL(iParent); - - RBuf8 buf; - buf.CleanupClosePushL(); - buf.CreateL(aComponentName, KMaxComponentNameLength); - TUint8* name = const_cast(buf.PtrZ()); - - OMX_ERRORTYPE errorType = ::OMX_GetHandle(reinterpret_cast(&iHandle), - reinterpret_cast(name), - iCallbacks, - *iCallbacks); - CleanupStack::PopAndDestroy(&buf); - - User::LeaveIfError(ConvertOmxErrorType(errorType)); - - iBufferManager = new (ELeave) COmxBufferManager(iHandle); - } - -OMX_COMPONENTTYPE* COmxILDummyBaseILIF::CBody::Handle() const - { - return iHandle; - } - -TInt COmxILDummyBaseILIF::CBody::OmxGetComponentVersion(TPtr8 aComponentName, - OMX_VERSIONTYPE* aComponentVersion, - OMX_VERSIONTYPE* aSpecVersion, - OMX_UUIDTYPE* aComponentUUID) - { - ASSERT(aComponentVersion); - ASSERT(aSpecVersion); - ASSERT(aComponentUUID); - TUint8* cname = const_cast(aComponentName.PtrZ()); - OMX_ERRORTYPE error = iHandle->GetComponentVersion(reinterpret_cast(iHandle), - reinterpret_cast(cname), aComponentVersion, aSpecVersion, aComponentUUID); - - TLex8 lex(cname); - TInt length; - for( length = 0; !lex.Eos(); ++length ) - { - lex.Inc(); - } - aComponentName.SetLength(length); - return ConvertOmxErrorType(error); - } - -TInt COmxILDummyBaseILIF::CBody::OmxSendCommand(OMX_COMMANDTYPE aCmd, - TUint32 aParam, - TAny* aCmdData) - { - OMX_ERRORTYPE error = iHandle->SendCommand(reinterpret_cast(iHandle), aCmd, aParam, aCmdData); - return ConvertOmxErrorType(error); - } - -TInt COmxILDummyBaseILIF::CBody::OmxGetParameter(OMX_INDEXTYPE aParamIndex, - TAny* aValue) - { - ASSERT(aValue); - OMX_ERRORTYPE error = iHandle->GetParameter(reinterpret_cast(iHandle), aParamIndex, aValue); - return ConvertOmxErrorType(error); - } - -TInt COmxILDummyBaseILIF::CBody::OmxSetParameter(OMX_INDEXTYPE aIndex, - TAny* aValue) - { - ASSERT(aValue); - OMX_ERRORTYPE error = iHandle->SetParameter(reinterpret_cast(iHandle), aIndex, aValue); - return ConvertOmxErrorType(error); - } - -TInt COmxILDummyBaseILIF::CBody::OmxGetConfig(OMX_INDEXTYPE aIndex, - TAny* aValue) - { - ASSERT(aValue); - OMX_ERRORTYPE error = iHandle->GetConfig(reinterpret_cast(iHandle), aIndex, aValue); - return ConvertOmxErrorType(error); - } - -TInt COmxILDummyBaseILIF::CBody::OmxSetConfig(OMX_INDEXTYPE aIndex, - TAny* aValue) - { - ASSERT(aValue); - OMX_ERRORTYPE error = iHandle->SetConfig(reinterpret_cast(iHandle), aIndex, aValue); - return ConvertOmxErrorType(error); - } - -TInt COmxILDummyBaseILIF::CBody::OmxGetExtensionIndex(const TDesC8& aParameterName, - OMX_INDEXTYPE* aIndexType) -{ - HBufC8* buf = HBufC8::New(aParameterName.Length()+1); - if (buf == NULL) - { - return KErrNoMemory; - } - else - { - *buf = aParameterName; - TUint8* cstring = const_cast(buf->Des().PtrZ()); - OMX_ERRORTYPE error = iHandle->GetExtensionIndex(reinterpret_cast(iHandle), reinterpret_cast(cstring), aIndexType); - delete buf; - return ConvertOmxErrorType(error); - } - } - -TInt COmxILDummyBaseILIF::CBody::OmxGetState(OMX_STATETYPE* aState) - { - OMX_ERRORTYPE error = iHandle->GetState(reinterpret_cast(iHandle), aState); - return ConvertOmxErrorType(error); - } - -TInt COmxILDummyBaseILIF::CBody::OmxComponentTunnelRequest(TUint32 aPortInput, - OMX_HANDLETYPE aOutput, - TUint32 aPortOutput) - { - OMX_ERRORTYPE error = ::OMX_SetupTunnel(aOutput, aPortOutput, reinterpret_cast(iHandle), aPortInput); - return ConvertOmxErrorType(error); - } - -TInt COmxILDummyBaseILIF::CBody::OmxComponentDisconnectTunnel(TUint32 aPortInput, - OMX_HANDLETYPE aOutput, - TUint32 aPortOutput) - { - OMX_ERRORTYPE error = ::OMX_SetupTunnel(aOutput, aPortOutput, 0, 0); - if (error == OMX_ErrorNone) - { - error = ::OMX_SetupTunnel(0, 0, reinterpret_cast(iHandle), aPortInput); - } - return ConvertOmxErrorType(error); - } - -TInt COmxILDummyBaseILIF::CBody::OmxUseBuffer(CMMFBuffer* aBuffer, - TUint32 aPortIndex) - { - ASSERT(aBuffer); - return (iBufferManager->UseBuffer(*aBuffer, aPortIndex)); - } - -CMMFBuffer* COmxILDummyBaseILIF::CBody::OmxAllocateBufferL(TUint32 aPortIndex, - TUint32 aSizeBytes) - { - return (iBufferManager->AllocateBufferL(aPortIndex, aSizeBytes)); - } - -TInt COmxILDummyBaseILIF::CBody::OmxFreeBuffer(CMMFBuffer* aBuffer) - { - ASSERT(aBuffer); - return (iBufferManager->FreeBuffer(aBuffer)); - } - -TInt COmxILDummyBaseILIF::CBody::OmxEmptyThisBuffer(const CMMFBuffer* aBuffer, - MOmxILComponentIfObserver* aObserver) - { - ASSERT(aBuffer); - return (iBufferManager->EmptyThisBuffer(aBuffer, aObserver)); - } - -TInt COmxILDummyBaseILIF::CBody::OmxFillThisBuffer(CMMFBuffer* aBuffer, - MOmxILComponentIfObserver* aObserver) - { - ASSERT(aBuffer); - return (iBufferManager->FillThisBuffer(aBuffer, aObserver)); - } - -TInt COmxILDummyBaseILIF::CBody::OmxComponentRoleEnum(TPtr8& aComponentRole, - TUint32 aIndex) - { - TUint8* role = const_cast (aComponentRole.PtrZ()); - OMX_ERRORTYPE error = iHandle->ComponentRoleEnum(reinterpret_cast(iHandle), reinterpret_cast(role), aIndex); - - TLex8 lex(role); - TInt length; - for( length = 0; !lex.Eos(); ++length ) - { - lex.Inc(); - } - aComponentRole.SetLength(length); - - return ConvertOmxErrorType(error); - } - -TInt COmxILDummyBaseILIF::CBody::SetIfToRole(const TUid& aComponentRole) - { - iFormat = aComponentRole; - return KErrNone; - } - -TInt COmxILDummyBaseILIF::CBody::GetIfRole(TUid& aComponentRole) const - { - aComponentRole = iFormat; - return KErrNone; - } - -TInt COmxILDummyBaseILIF::CBody::SetPortsL() - { - OMX_PORT_PARAM_TYPE param; - param.nVersion = KOMXILSpecVersion; - param.nSize = sizeof(OMX_PORT_PARAM_TYPE); - TInt err = OmxGetParameter(OMX_IndexParamAudioInit, ¶m); - - if (err == KErrNone) - { - for (TInt i=0; i < param.nPorts && err == KErrNone; i++ ) - { - OMX_PARAM_PORTDEFINITIONTYPE portInfo; - portInfo.nPortIndex = i; - portInfo.nVersion = KOMXILSpecVersion; - portInfo.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE); - err = OmxGetParameter(OMX_IndexParamPortDefinition, &portInfo); - if (err == KErrNone) - { - if (portInfo.eDir == OMX_DirInput) - { - COmxILDummyBasePortILIF* inputPort = COmxILDummyBasePortILIF::NewL(iParent, EDirInput, portInfo.nPortIndex); - err = iInputPorts.Append(inputPort); - } - else - { - COmxILDummyBasePortILIF* outputPort = COmxILDummyBasePortILIF::NewL(iParent, EDirOutput, portInfo.nPortIndex); - err = iOutputPorts.Append(outputPort); - } - } - } - } - return err; - } - -TInt COmxILDummyBaseILIF::CBody::GetComponentPorts(RPointerArray& aComponentPorts, - OMX_DIRTYPE aDirection) - { - TInt err = KErrNone; - if (aDirection == OMX_DirInput) - { - const TInt counter = iInputPorts.Count(); - for (TInt i=0; i < counter && err == KErrNone; i++ ) - { - err = aComponentPorts.Append(iInputPorts[i]); - } - } - else if (aDirection == OMX_DirOutput) - { - const TInt counter = iOutputPorts.Count(); - for (TInt i=0; i < counter && err == KErrNone; i++ ) - { - err = aComponentPorts.Append(iOutputPorts[i]); - } - } - else - { - err = KErrNotSupported; - } - return err; - } - -TInt COmxILDummyBaseILIF::CBody::FillBufferDone(CMMFBuffer* aBuffer, - TInt aPortIndex) - { - ASSERT(aBuffer); - // Loop through all output ports to search for the interface associated to this port index - const TInt counter = iOutputPorts.Count(); - for (TInt i=0; i < counter; i++ ) - { - if (iOutputPorts[i]->PortIndex() == aPortIndex) - { - return (iIfObserver.BufferDelivered(iOutputPorts[i], aBuffer)); - } - } - - return KErrNotFound; - } - -TInt COmxILDummyBaseILIF::CBody::EmptyBufferDone(const CMMFBuffer* aBuffer, - TInt aPortIndex) - { - ASSERT(aBuffer); - // Loop through all input ports to search for the interface associated to this port index - const TInt counter = iInputPorts.Count(); - for (TInt i=0; i < counter; i++ ) - { - if (iInputPorts[i]->PortIndex() == aPortIndex) - { - return (iIfObserver.BufferDelivered(iInputPorts[i], aBuffer)); - } - } - - return KErrNotFound; - } - -TInt COmxILDummyBaseILIF::CBody::EventHandler(OMX_EVENTTYPE aEvent, - TUint32 aData1, - TUint32 aData2, - TAny* /*aExtraInfo*/) - { - TInt err = KErrNone; - TILEvent thisEvent; - - switch (aEvent) - { - case OMX_EventCmdComplete: - { - thisEvent.iEvent = EEventCmdComplete; - if (aData1 == OMX_CommandStateSet) - { - thisEvent.iData1 = ECommandStateSet; - OMX_STATETYPE state = static_cast(aData2); - thisEvent.iData2 = ConvertOmxState(state); - err = iIfObserver.MsgFromILComponent(&iParent, thisEvent); - break; - } - else if (aData1 == OMX_CommandFlush) - { - thisEvent.iData1 = ECommandFlush; - thisEvent.iData2 = aData2; // Port index - err = iIfObserver.MsgFromILComponent(&iParent, thisEvent); - } - else if (aData1 == OMX_CommandPortDisable) - { - thisEvent.iData1 = ECommandPortDisable; - thisEvent.iData2 = aData2; // Port index - err = iIfObserver.MsgFromILComponent(&iParent, thisEvent); - } - else if (aData1 == OMX_CommandPortEnable) - { - thisEvent.iData1 = ECommandPortEnable; - thisEvent.iData2 = aData2; // Port index - err = iIfObserver.MsgFromILComponent(&iParent, thisEvent); - } - else - { - err = KErrNotSupported; - } - - break; - } - case OMX_EventBufferFlag: - { - // Propagate the EOF up to client as KErrUnderflow - thisEvent.iEvent = EEventBufferFlag; - thisEvent.iData1 = aData1; - thisEvent.iData2 = static_cast(KErrUnderflow); - err = iIfObserver.MsgFromILComponent(&iParent, thisEvent); - break; - } - case OMX_EventError: - { - // Propagate the error up to client - thisEvent.iEvent = EEventError; - OMX_ERRORTYPE errorx = static_cast(aData1); - thisEvent.iData1 = ConvertOmxErrorType(errorx); - err = iIfObserver.MsgFromILComponent(&iParent, thisEvent); - break; - } - default: - { - err = KErrNotSupported; - } - } - return err; - } +// 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 "omxildummybaseilifbody.h" +#include "omxilcoreutils.h" +#include "omxilspecversion.h" +#include "milifobserver.h" +#include "tilstructtypes.h" + + +const TInt KMaxComponentNameLength = 128; + + +COmxILDummyBaseILIF::CBody::CBody(COmxILDummyBaseILIF& aParent, + MILIfObserver& aComponentIfObserver) + : + iParent(aParent), + iIfObserver(aComponentIfObserver) + { + } + +COmxILDummyBaseILIF::CBody::~CBody() + { + iInputPorts.ResetAndDestroy(); + iInputPorts.Close(); + iOutputPorts.ResetAndDestroy(); + iOutputPorts.Close(); + delete iBufferManager; + delete iCallbacks; + + ::OMX_FreeHandle(reinterpret_cast(iHandle)); + } + +COmxILDummyBaseILIF::CBody* COmxILDummyBaseILIF::CBody::NewL(COmxILDummyBaseILIF& aParent, + MILIfObserver& aComponentIfObserver, + const TDesC8& aComponentName) + { + CBody* self = new (ELeave) CBody(aParent, aComponentIfObserver); + CleanupStack::PushL(self); + self->ConstructL(aComponentName); + CleanupStack::Pop(self); + return self; + } + +void COmxILDummyBaseILIF::CBody::ConstructL(const TDesC8& aComponentName) + { + iCallbacks = COmxCallbacks::NewL(iParent); + + RBuf8 buf; + buf.CleanupClosePushL(); + buf.CreateL(aComponentName, KMaxComponentNameLength); + TUint8* name = const_cast(buf.PtrZ()); + + OMX_ERRORTYPE errorType = ::OMX_GetHandle(reinterpret_cast(&iHandle), + reinterpret_cast(name), + iCallbacks, + *iCallbacks); + CleanupStack::PopAndDestroy(&buf); + + User::LeaveIfError(ConvertOmxErrorType(errorType)); + + iBufferManager = new (ELeave) COmxBufferManager(iHandle); + } + +OMX_COMPONENTTYPE* COmxILDummyBaseILIF::CBody::Handle() const + { + return iHandle; + } + +TInt COmxILDummyBaseILIF::CBody::OmxGetComponentVersion(TPtr8 aComponentName, + OMX_VERSIONTYPE* aComponentVersion, + OMX_VERSIONTYPE* aSpecVersion, + OMX_UUIDTYPE* aComponentUUID) + { + ASSERT(aComponentVersion); + ASSERT(aSpecVersion); + ASSERT(aComponentUUID); + TUint8* cname = const_cast(aComponentName.PtrZ()); + OMX_ERRORTYPE error = iHandle->GetComponentVersion(reinterpret_cast(iHandle), + reinterpret_cast(cname), aComponentVersion, aSpecVersion, aComponentUUID); + + TLex8 lex(cname); + TInt length; + for( length = 0; !lex.Eos(); ++length ) + { + lex.Inc(); + } + aComponentName.SetLength(length); + return ConvertOmxErrorType(error); + } + +TInt COmxILDummyBaseILIF::CBody::OmxSendCommand(OMX_COMMANDTYPE aCmd, + TUint32 aParam, + TAny* aCmdData) + { + OMX_ERRORTYPE error = iHandle->SendCommand(reinterpret_cast(iHandle), aCmd, aParam, aCmdData); + return ConvertOmxErrorType(error); + } + +TInt COmxILDummyBaseILIF::CBody::OmxGetParameter(OMX_INDEXTYPE aParamIndex, + TAny* aValue) + { + ASSERT(aValue); + OMX_ERRORTYPE error = iHandle->GetParameter(reinterpret_cast(iHandle), aParamIndex, aValue); + return ConvertOmxErrorType(error); + } + +TInt COmxILDummyBaseILIF::CBody::OmxSetParameter(OMX_INDEXTYPE aIndex, + TAny* aValue) + { + ASSERT(aValue); + OMX_ERRORTYPE error = iHandle->SetParameter(reinterpret_cast(iHandle), aIndex, aValue); + return ConvertOmxErrorType(error); + } + +TInt COmxILDummyBaseILIF::CBody::OmxGetConfig(OMX_INDEXTYPE aIndex, + TAny* aValue) + { + ASSERT(aValue); + OMX_ERRORTYPE error = iHandle->GetConfig(reinterpret_cast(iHandle), aIndex, aValue); + return ConvertOmxErrorType(error); + } + +TInt COmxILDummyBaseILIF::CBody::OmxSetConfig(OMX_INDEXTYPE aIndex, + TAny* aValue) + { + ASSERT(aValue); + OMX_ERRORTYPE error = iHandle->SetConfig(reinterpret_cast(iHandle), aIndex, aValue); + return ConvertOmxErrorType(error); + } + +TInt COmxILDummyBaseILIF::CBody::OmxGetExtensionIndex(const TDesC8& aParameterName, + OMX_INDEXTYPE* aIndexType) +{ + HBufC8* buf = HBufC8::New(aParameterName.Length()+1); + if (buf == NULL) + { + return KErrNoMemory; + } + else + { + *buf = aParameterName; + TUint8* cstring = const_cast(buf->Des().PtrZ()); + OMX_ERRORTYPE error = iHandle->GetExtensionIndex(reinterpret_cast(iHandle), reinterpret_cast(cstring), aIndexType); + delete buf; + return ConvertOmxErrorType(error); + } + } + +TInt COmxILDummyBaseILIF::CBody::OmxGetState(OMX_STATETYPE* aState) + { + OMX_ERRORTYPE error = iHandle->GetState(reinterpret_cast(iHandle), aState); + return ConvertOmxErrorType(error); + } + +TInt COmxILDummyBaseILIF::CBody::OmxComponentTunnelRequest(TUint32 aPortInput, + OMX_HANDLETYPE aOutput, + TUint32 aPortOutput) + { + OMX_ERRORTYPE error = ::OMX_SetupTunnel(aOutput, aPortOutput, reinterpret_cast(iHandle), aPortInput); + return ConvertOmxErrorType(error); + } + +TInt COmxILDummyBaseILIF::CBody::OmxComponentDisconnectTunnel(TUint32 aPortInput, + OMX_HANDLETYPE aOutput, + TUint32 aPortOutput) + { + OMX_ERRORTYPE error = ::OMX_SetupTunnel(aOutput, aPortOutput, 0, 0); + if (error == OMX_ErrorNone) + { + error = ::OMX_SetupTunnel(0, 0, reinterpret_cast(iHandle), aPortInput); + } + return ConvertOmxErrorType(error); + } + +TInt COmxILDummyBaseILIF::CBody::OmxUseBuffer(CMMFBuffer* aBuffer, + TUint32 aPortIndex) + { + ASSERT(aBuffer); + return (iBufferManager->UseBuffer(*aBuffer, aPortIndex)); + } + +CMMFBuffer* COmxILDummyBaseILIF::CBody::OmxAllocateBufferL(TUint32 aPortIndex, + TUint32 aSizeBytes) + { + return (iBufferManager->AllocateBufferL(aPortIndex, aSizeBytes)); + } + +TInt COmxILDummyBaseILIF::CBody::OmxFreeBuffer(CMMFBuffer* aBuffer) + { + ASSERT(aBuffer); + return (iBufferManager->FreeBuffer(aBuffer)); + } + +TInt COmxILDummyBaseILIF::CBody::OmxEmptyThisBuffer(const CMMFBuffer* aBuffer, + MOmxILComponentIfObserver* aObserver) + { + ASSERT(aBuffer); + return (iBufferManager->EmptyThisBuffer(aBuffer, aObserver)); + } + +TInt COmxILDummyBaseILIF::CBody::OmxFillThisBuffer(CMMFBuffer* aBuffer, + MOmxILComponentIfObserver* aObserver) + { + ASSERT(aBuffer); + return (iBufferManager->FillThisBuffer(aBuffer, aObserver)); + } + +TInt COmxILDummyBaseILIF::CBody::OmxComponentRoleEnum(TPtr8& aComponentRole, + TUint32 aIndex) + { + TUint8* role = const_cast (aComponentRole.PtrZ()); + OMX_ERRORTYPE error = iHandle->ComponentRoleEnum(reinterpret_cast(iHandle), reinterpret_cast(role), aIndex); + + TLex8 lex(role); + TInt length; + for( length = 0; !lex.Eos(); ++length ) + { + lex.Inc(); + } + aComponentRole.SetLength(length); + + return ConvertOmxErrorType(error); + } + +TInt COmxILDummyBaseILIF::CBody::SetIfToRole(const TUid& aComponentRole) + { + iFormat = aComponentRole; + return KErrNone; + } + +TInt COmxILDummyBaseILIF::CBody::GetIfRole(TUid& aComponentRole) const + { + aComponentRole = iFormat; + return KErrNone; + } + +TInt COmxILDummyBaseILIF::CBody::SetPortsL() + { + OMX_PORT_PARAM_TYPE param; + param.nVersion = KOMXILSpecVersion; + param.nSize = sizeof(OMX_PORT_PARAM_TYPE); + TInt err = OmxGetParameter(OMX_IndexParamAudioInit, ¶m); + + if (err == KErrNone) + { + for (TInt i=0; i < param.nPorts && err == KErrNone; i++ ) + { + OMX_PARAM_PORTDEFINITIONTYPE portInfo; + portInfo.nPortIndex = i; + portInfo.nVersion = KOMXILSpecVersion; + portInfo.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE); + err = OmxGetParameter(OMX_IndexParamPortDefinition, &portInfo); + if (err == KErrNone) + { + if (portInfo.eDir == OMX_DirInput) + { + COmxILDummyBasePortILIF* inputPort = COmxILDummyBasePortILIF::NewL(iParent, EDirInput, portInfo.nPortIndex); + err = iInputPorts.Append(inputPort); + } + else + { + COmxILDummyBasePortILIF* outputPort = COmxILDummyBasePortILIF::NewL(iParent, EDirOutput, portInfo.nPortIndex); + err = iOutputPorts.Append(outputPort); + } + } + } + } + return err; + } + +TInt COmxILDummyBaseILIF::CBody::GetComponentPorts(RPointerArray& aComponentPorts, + OMX_DIRTYPE aDirection) + { + TInt err = KErrNone; + if (aDirection == OMX_DirInput) + { + const TInt counter = iInputPorts.Count(); + for (TInt i=0; i < counter && err == KErrNone; i++ ) + { + err = aComponentPorts.Append(iInputPorts[i]); + } + } + else if (aDirection == OMX_DirOutput) + { + const TInt counter = iOutputPorts.Count(); + for (TInt i=0; i < counter && err == KErrNone; i++ ) + { + err = aComponentPorts.Append(iOutputPorts[i]); + } + } + else + { + err = KErrNotSupported; + } + return err; + } + +TInt COmxILDummyBaseILIF::CBody::FillBufferDone(CMMFBuffer* aBuffer, + TInt aPortIndex) + { + ASSERT(aBuffer); + // Loop through all output ports to search for the interface associated to this port index + const TInt counter = iOutputPorts.Count(); + for (TInt i=0; i < counter; i++ ) + { + if (iOutputPorts[i]->PortIndex() == aPortIndex) + { + return (iIfObserver.BufferDelivered(iOutputPorts[i], aBuffer)); + } + } + + return KErrNotFound; + } + +TInt COmxILDummyBaseILIF::CBody::EmptyBufferDone(const CMMFBuffer* aBuffer, + TInt aPortIndex) + { + ASSERT(aBuffer); + // Loop through all input ports to search for the interface associated to this port index + const TInt counter = iInputPorts.Count(); + for (TInt i=0; i < counter; i++ ) + { + if (iInputPorts[i]->PortIndex() == aPortIndex) + { + return (iIfObserver.BufferDelivered(iInputPorts[i], aBuffer)); + } + } + + return KErrNotFound; + } + +TInt COmxILDummyBaseILIF::CBody::EventHandler(OMX_EVENTTYPE aEvent, + TUint32 aData1, + TUint32 aData2, + TAny* /*aExtraInfo*/) + { + TInt err = KErrNone; + TILEvent thisEvent; + + switch (aEvent) + { + case OMX_EventCmdComplete: + { + thisEvent.iEvent = EEventCmdComplete; + if (aData1 == OMX_CommandStateSet) + { + thisEvent.iData1 = ECommandStateSet; + OMX_STATETYPE state = static_cast(aData2); + thisEvent.iData2 = ConvertOmxState(state); + err = iIfObserver.MsgFromILComponent(&iParent, thisEvent); + break; + } + else if (aData1 == OMX_CommandFlush) + { + thisEvent.iData1 = ECommandFlush; + thisEvent.iData2 = aData2; // Port index + err = iIfObserver.MsgFromILComponent(&iParent, thisEvent); + } + else if (aData1 == OMX_CommandPortDisable) + { + thisEvent.iData1 = ECommandPortDisable; + thisEvent.iData2 = aData2; // Port index + err = iIfObserver.MsgFromILComponent(&iParent, thisEvent); + } + else if (aData1 == OMX_CommandPortEnable) + { + thisEvent.iData1 = ECommandPortEnable; + thisEvent.iData2 = aData2; // Port index + err = iIfObserver.MsgFromILComponent(&iParent, thisEvent); + } + else + { + err = KErrNotSupported; + } + + break; + } + case OMX_EventBufferFlag: + { + // Propagate the EOF up to client as KErrUnderflow + thisEvent.iEvent = EEventBufferFlag; + thisEvent.iData1 = aData1; + thisEvent.iData2 = static_cast(KErrUnderflow); + err = iIfObserver.MsgFromILComponent(&iParent, thisEvent); + break; + } + case OMX_EventError: + { + // Propagate the error up to client + thisEvent.iEvent = EEventError; + OMX_ERRORTYPE errorx = static_cast(aData1); + thisEvent.iData1 = ConvertOmxErrorType(errorx); + err = iIfObserver.MsgFromILComponent(&iParent, thisEvent); + break; + } + default: + { + err = KErrNotSupported; + } + } + return err; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/unittest/test_plugins/omxildummybaseilif/omxildummybaseilifbody.h --- a/omxil/mmilapi/unittest/test_plugins/omxildummybaseilif/omxildummybaseilifbody.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/unittest/test_plugins/omxildummybaseilif/omxildummybaseilifbody.h Fri May 07 16:25:23 2010 +0100 @@ -1,90 +1,90 @@ -// 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: -// omxildummybaseifilbody.h -// -// - -#ifndef OMXILDUMMYBASEIFILBODY_H -#define OMXILDUMMYBASEIFILBODY_H - - -#include "omxildummybaseilif.h" -#include "omxildummybaseportilif.h" -#include "omxilgenericilifbodyimpl.h" -#include -#include - - -/** -Body implementation of the COmxILDummyBaseILIF specific to OpenMAX specification. -*/ -class COmxILDummyBaseILIF::CBody : public CBase - { -public: - static CBody* NewL(COmxILDummyBaseILIF& aParent, - MILIfObserver& aComponentIfObserver, - const TDesC8& aComponentName); - ~CBody(); - - OMX_COMPONENTTYPE* Handle() const; - - TInt OmxGetComponentVersion(TPtr8 aComponentName, OMX_VERSIONTYPE* aComponentVersion, OMX_VERSIONTYPE* aSpecVersion, OMX_UUIDTYPE* aComponentUUID); - TInt OmxSendCommand(OMX_COMMANDTYPE aCmd, TUint32 aParam1, TAny* aCmdData); - TInt OmxGetParameter(OMX_INDEXTYPE aParamIndex, TAny* aComponentParameterStructure); - TInt OmxSetParameter(OMX_INDEXTYPE aIndex, TAny* aComponentParameterStructure); - TInt OmxGetConfig(OMX_INDEXTYPE aIndex, TAny* aValue); - TInt OmxSetConfig(OMX_INDEXTYPE aIndex, TAny* aValue); - TInt OmxGetExtensionIndex(const TDesC8& aParameterName, OMX_INDEXTYPE* aIndexType); - TInt OmxGetState(OMX_STATETYPE* aState); - TInt OmxComponentTunnelRequest(TUint32 aPortInput, OMX_HANDLETYPE aOutput, TUint32 aPortOutput); - TInt OmxComponentDisconnectTunnel(TUint32 aPortInput, OMX_HANDLETYPE aOutput, TUint32 aPortOutput); - TInt OmxUseBuffer(CMMFBuffer* aBuffer, TUint32 aPortIndex); - CMMFBuffer* OmxAllocateBufferL(TUint32 aPortIndex, TUint32 aSizeBytes); - TInt OmxFreeBuffer(CMMFBuffer* aBuffer); - TInt OmxEmptyThisBuffer(const CMMFBuffer* aBuffer, MOmxILComponentIfObserver* aObserver); - TInt OmxFillThisBuffer(CMMFBuffer* aBuffer, MOmxILComponentIfObserver* aObserver); - TInt OmxComponentRoleEnum(TPtr8& aComponentRole, TUint32 aIndex); - - TInt SetIfToRole(const TUid& aComponentRole); - TInt GetIfRole(TUid& aComponentRole) const; - - TInt GetComponentPorts(RPointerArray& aComponentPorts, OMX_DIRTYPE); - TInt SetPortsL(); - - TInt FillBufferDone(CMMFBuffer* aBuffer, TInt aPortIndex); - TInt EmptyBufferDone(const CMMFBuffer* aBuffer, TInt aPortIndex); - TInt EventHandler(OMX_EVENTTYPE aEvent, TUint32 aData1, TUint32 aData2, TAny* aExtraInfo); - -private: - CBody(COmxILDummyBaseILIF& aParent, MILIfObserver& aComponentIfObserver); - void ConstructL(const TDesC8& aComponentName); - -private: - - OMX_COMPONENTTYPE* iHandle; - - RPointerArray iInputPorts; - RPointerArray iOutputPorts; - - COmxBufferManager* iBufferManager; - COmxCallbacks* iCallbacks; - - COmxILDummyBaseILIF& iParent; - MILIfObserver& iIfObserver; - - TUid iFormat; - }; - -#endif // OMXILDUMMYBASEIFILBODY_H - +// 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: +// omxildummybaseifilbody.h +// +// + +#ifndef OMXILDUMMYBASEIFILBODY_H +#define OMXILDUMMYBASEIFILBODY_H + + +#include "omxildummybaseilif.h" +#include "omxildummybaseportilif.h" +#include "omxilgenericilifbodyimpl.h" +#include +#include + + +/** +Body implementation of the COmxILDummyBaseILIF specific to OpenMAX specification. +*/ +class COmxILDummyBaseILIF::CBody : public CBase + { +public: + static CBody* NewL(COmxILDummyBaseILIF& aParent, + MILIfObserver& aComponentIfObserver, + const TDesC8& aComponentName); + ~CBody(); + + OMX_COMPONENTTYPE* Handle() const; + + TInt OmxGetComponentVersion(TPtr8 aComponentName, OMX_VERSIONTYPE* aComponentVersion, OMX_VERSIONTYPE* aSpecVersion, OMX_UUIDTYPE* aComponentUUID); + TInt OmxSendCommand(OMX_COMMANDTYPE aCmd, TUint32 aParam1, TAny* aCmdData); + TInt OmxGetParameter(OMX_INDEXTYPE aParamIndex, TAny* aComponentParameterStructure); + TInt OmxSetParameter(OMX_INDEXTYPE aIndex, TAny* aComponentParameterStructure); + TInt OmxGetConfig(OMX_INDEXTYPE aIndex, TAny* aValue); + TInt OmxSetConfig(OMX_INDEXTYPE aIndex, TAny* aValue); + TInt OmxGetExtensionIndex(const TDesC8& aParameterName, OMX_INDEXTYPE* aIndexType); + TInt OmxGetState(OMX_STATETYPE* aState); + TInt OmxComponentTunnelRequest(TUint32 aPortInput, OMX_HANDLETYPE aOutput, TUint32 aPortOutput); + TInt OmxComponentDisconnectTunnel(TUint32 aPortInput, OMX_HANDLETYPE aOutput, TUint32 aPortOutput); + TInt OmxUseBuffer(CMMFBuffer* aBuffer, TUint32 aPortIndex); + CMMFBuffer* OmxAllocateBufferL(TUint32 aPortIndex, TUint32 aSizeBytes); + TInt OmxFreeBuffer(CMMFBuffer* aBuffer); + TInt OmxEmptyThisBuffer(const CMMFBuffer* aBuffer, MOmxILComponentIfObserver* aObserver); + TInt OmxFillThisBuffer(CMMFBuffer* aBuffer, MOmxILComponentIfObserver* aObserver); + TInt OmxComponentRoleEnum(TPtr8& aComponentRole, TUint32 aIndex); + + TInt SetIfToRole(const TUid& aComponentRole); + TInt GetIfRole(TUid& aComponentRole) const; + + TInt GetComponentPorts(RPointerArray& aComponentPorts, OMX_DIRTYPE); + TInt SetPortsL(); + + TInt FillBufferDone(CMMFBuffer* aBuffer, TInt aPortIndex); + TInt EmptyBufferDone(const CMMFBuffer* aBuffer, TInt aPortIndex); + TInt EventHandler(OMX_EVENTTYPE aEvent, TUint32 aData1, TUint32 aData2, TAny* aExtraInfo); + +private: + CBody(COmxILDummyBaseILIF& aParent, MILIfObserver& aComponentIfObserver); + void ConstructL(const TDesC8& aComponentName); + +private: + + OMX_COMPONENTTYPE* iHandle; + + RPointerArray iInputPorts; + RPointerArray iOutputPorts; + + COmxBufferManager* iBufferManager; + COmxCallbacks* iCallbacks; + + COmxILDummyBaseILIF& iParent; + MILIfObserver& iIfObserver; + + TUid iFormat; + }; + +#endif // OMXILDUMMYBASEIFILBODY_H + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/unittest/test_plugins/omxildummybaseilif/omxildummybaseportilif.cpp --- a/omxil/mmilapi/unittest/test_plugins/omxildummybaseilif/omxildummybaseportilif.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/unittest/test_plugins/omxildummybaseilif/omxildummybaseportilif.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,179 +1,179 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// - -#include "omxildummybaseportilif.h" - -/** -class COmxILDummyBasePortILIF -Concrete implementation of the MILComponentPortIf that encapsulates the -component's port specific behaviour according to OpenMAX specification. -*/ -COmxILDummyBasePortILIF::COmxILDummyBasePortILIF(COmxILDummyBaseILIF& aParent, - TPortDirection aPortDirection, - TInt aIndex) - : - iPortDirection (aPortDirection), - iPortIndex (aIndex), - iPortComponent(aParent), - iTunneledPort(NULL) - { - } - -COmxILDummyBasePortILIF* COmxILDummyBasePortILIF::NewL(COmxILDummyBaseILIF& aParent, - TPortDirection aPortDirection, - TInt aIndex) - { - COmxILDummyBasePortILIF* self = new (ELeave) COmxILDummyBasePortILIF(aParent, aPortDirection, aIndex); - return self; - } -TInt COmxILDummyBasePortILIF::FillThisBuffer(CMMFBuffer& aBuffer) - { - if (iPortDirection == EDirOutput) - { - return iPortComponent.OmxFillThisBuffer(&aBuffer, &iPortComponent); - } - else - { - return KErrCorrupt; - } - } - -TInt COmxILDummyBasePortILIF::EmptyThisBuffer(const CMMFBuffer& aBuffer) - { - if (iPortDirection == EDirInput) - { - return iPortComponent.OmxEmptyThisBuffer(&aBuffer, &iPortComponent); - } - else - { - return KErrCorrupt; - } - } - -TInt COmxILDummyBasePortILIF::TunnelRequest(MILComponentPortIf* aPort) - { - TInt error = KErrNotSupported; - - if (aPort) - // This is the connet tunnel request - { - TPortDirection otherPortDir = aPort->PortDirection(); - COmxILDummyBaseILIF* otherPortComponent = static_cast (aPort->PortComponent()); - - if (iPortDirection != otherPortDir) - { - if (iPortDirection == EDirInput) - { - error = iPortComponent.OmxComponentTunnelRequest(iPortIndex, - otherPortComponent->OmxHandle(), - aPort->PortIndex()); - } - else - { - error = otherPortComponent->OmxComponentTunnelRequest(aPort->PortIndex(), - iPortComponent.OmxHandle(), - iPortIndex); - } - - if (error == KErrNone) - { - iTunneledPort = static_cast(aPort); - iTunneledPort->SetPortConnectedTo(this); - } - } - } - else - // This is the disconnet tunnel request - { - - TPortDirection otherPortDir = iTunneledPort->PortDirection(); - COmxILDummyBaseILIF* otherPortComponent = static_cast (iTunneledPort->PortComponent()); - - if (iPortDirection != otherPortDir) - { - if (iPortDirection == EDirInput) - { - error = iPortComponent.OmxComponentDisconnectTunnel(iPortIndex, - otherPortComponent->OmxHandle(), - iTunneledPort->PortIndex()); - } - else - { - error = otherPortComponent->OmxComponentDisconnectTunnel(iTunneledPort->PortIndex(), - iPortComponent.OmxHandle(), - iPortIndex); - } - - if (error == KErrNone) - { - iTunneledPort->SetPortConnectedTo(NULL); - iTunneledPort = NULL; - } - } - } - return error; - } - -TInt COmxILDummyBasePortILIF::PortIndex() const - { - return iPortIndex; - } - -TPortDirection COmxILDummyBasePortILIF::PortDirection() const - { - return iPortDirection; - } - -CMMFBuffer* COmxILDummyBasePortILIF::CreateBufferL(TInt aBufferSize) - { - return iPortComponent.OmxAllocateBufferL(iPortIndex, aBufferSize); - } - -TInt COmxILDummyBasePortILIF::UseBuffer(CMMFBuffer& aBuffer) - { - return iPortComponent.OmxUseBuffer(&aBuffer, iPortIndex); - } - -TInt COmxILDummyBasePortILIF::FreeBuffer(CMMFBuffer* aBuffer) - { - return iPortComponent.OmxFreeBuffer(aBuffer); - } - -TInt COmxILDummyBasePortILIF::FlushPort() - { - return iPortComponent.OmxSendCommand(OMX_CommandFlush, iPortIndex, NULL); - } - -TInt COmxILDummyBasePortILIF::EnablePort() - { - return iPortComponent.OmxSendCommand(OMX_CommandPortEnable, iPortIndex, NULL); - } - -TInt COmxILDummyBasePortILIF::DisablePort() - { - return iPortComponent.OmxSendCommand(OMX_CommandPortDisable, iPortIndex, NULL); - } - -MILComponentIf* COmxILDummyBasePortILIF::PortComponent() const - { - return &iPortComponent; - } - - -void COmxILDummyBasePortILIF::SetPortConnectedTo(COmxILDummyBasePortILIF* aPort) - { - iTunneledPort = aPort; - } - +// 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 "omxildummybaseportilif.h" + +/** +class COmxILDummyBasePortILIF +Concrete implementation of the MILComponentPortIf that encapsulates the +component's port specific behaviour according to OpenMAX specification. +*/ +COmxILDummyBasePortILIF::COmxILDummyBasePortILIF(COmxILDummyBaseILIF& aParent, + TPortDirection aPortDirection, + TInt aIndex) + : + iPortDirection (aPortDirection), + iPortIndex (aIndex), + iPortComponent(aParent), + iTunneledPort(NULL) + { + } + +COmxILDummyBasePortILIF* COmxILDummyBasePortILIF::NewL(COmxILDummyBaseILIF& aParent, + TPortDirection aPortDirection, + TInt aIndex) + { + COmxILDummyBasePortILIF* self = new (ELeave) COmxILDummyBasePortILIF(aParent, aPortDirection, aIndex); + return self; + } +TInt COmxILDummyBasePortILIF::FillThisBuffer(CMMFBuffer& aBuffer) + { + if (iPortDirection == EDirOutput) + { + return iPortComponent.OmxFillThisBuffer(&aBuffer, &iPortComponent); + } + else + { + return KErrCorrupt; + } + } + +TInt COmxILDummyBasePortILIF::EmptyThisBuffer(const CMMFBuffer& aBuffer) + { + if (iPortDirection == EDirInput) + { + return iPortComponent.OmxEmptyThisBuffer(&aBuffer, &iPortComponent); + } + else + { + return KErrCorrupt; + } + } + +TInt COmxILDummyBasePortILIF::TunnelRequest(MILComponentPortIf* aPort) + { + TInt error = KErrNotSupported; + + if (aPort) + // This is the connet tunnel request + { + TPortDirection otherPortDir = aPort->PortDirection(); + COmxILDummyBaseILIF* otherPortComponent = static_cast (aPort->PortComponent()); + + if (iPortDirection != otherPortDir) + { + if (iPortDirection == EDirInput) + { + error = iPortComponent.OmxComponentTunnelRequest(iPortIndex, + otherPortComponent->OmxHandle(), + aPort->PortIndex()); + } + else + { + error = otherPortComponent->OmxComponentTunnelRequest(aPort->PortIndex(), + iPortComponent.OmxHandle(), + iPortIndex); + } + + if (error == KErrNone) + { + iTunneledPort = static_cast(aPort); + iTunneledPort->SetPortConnectedTo(this); + } + } + } + else + // This is the disconnet tunnel request + { + + TPortDirection otherPortDir = iTunneledPort->PortDirection(); + COmxILDummyBaseILIF* otherPortComponent = static_cast (iTunneledPort->PortComponent()); + + if (iPortDirection != otherPortDir) + { + if (iPortDirection == EDirInput) + { + error = iPortComponent.OmxComponentDisconnectTunnel(iPortIndex, + otherPortComponent->OmxHandle(), + iTunneledPort->PortIndex()); + } + else + { + error = otherPortComponent->OmxComponentDisconnectTunnel(iTunneledPort->PortIndex(), + iPortComponent.OmxHandle(), + iPortIndex); + } + + if (error == KErrNone) + { + iTunneledPort->SetPortConnectedTo(NULL); + iTunneledPort = NULL; + } + } + } + return error; + } + +TInt COmxILDummyBasePortILIF::PortIndex() const + { + return iPortIndex; + } + +TPortDirection COmxILDummyBasePortILIF::PortDirection() const + { + return iPortDirection; + } + +CMMFBuffer* COmxILDummyBasePortILIF::CreateBufferL(TInt aBufferSize) + { + return iPortComponent.OmxAllocateBufferL(iPortIndex, aBufferSize); + } + +TInt COmxILDummyBasePortILIF::UseBuffer(CMMFBuffer& aBuffer) + { + return iPortComponent.OmxUseBuffer(&aBuffer, iPortIndex); + } + +TInt COmxILDummyBasePortILIF::FreeBuffer(CMMFBuffer* aBuffer) + { + return iPortComponent.OmxFreeBuffer(aBuffer); + } + +TInt COmxILDummyBasePortILIF::FlushPort() + { + return iPortComponent.OmxSendCommand(OMX_CommandFlush, iPortIndex, NULL); + } + +TInt COmxILDummyBasePortILIF::EnablePort() + { + return iPortComponent.OmxSendCommand(OMX_CommandPortEnable, iPortIndex, NULL); + } + +TInt COmxILDummyBasePortILIF::DisablePort() + { + return iPortComponent.OmxSendCommand(OMX_CommandPortDisable, iPortIndex, NULL); + } + +MILComponentIf* COmxILDummyBasePortILIF::PortComponent() const + { + return &iPortComponent; + } + + +void COmxILDummyBasePortILIF::SetPortConnectedTo(COmxILDummyBasePortILIF* aPort) + { + iTunneledPort = aPort; + } + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/mmilapi/unittest/test_plugins/omxildummybaseilif/omxildummybaseportilif.h --- a/omxil/mmilapi/unittest/test_plugins/omxildummybaseilif/omxildummybaseportilif.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/mmilapi/unittest/test_plugins/omxildummybaseilif/omxildummybaseportilif.h Fri May 07 16:25:23 2010 +0100 @@ -1,59 +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: -// - -#ifndef OMXILDUMMYBASEPORTILIF_H -#define OMXILDUMMYBASEPORTILIF_H - -#include "milcomponentportif.h" -#include "omxildummybaseilif.h" - - -/** -Concrete implementation of the MILComponentPortIf that encapsulates the -component's port specific behaviour according to OpenMAX specification. -*/ -class COmxILDummyBasePortILIF : public CBase, - public MILComponentPortIf - { -public: - static COmxILDummyBasePortILIF* NewL(COmxILDummyBaseILIF& aParent, TPortDirection aPortDirection, TInt aIndex); - - // MILComponentPortIf - TInt FillThisBuffer(CMMFBuffer& aBuffer); - TInt EmptyThisBuffer(const CMMFBuffer& aBuffer); - TInt TunnelRequest(MILComponentPortIf* aPort); - TInt PortIndex() const; - TPortDirection PortDirection() const; - CMMFBuffer* CreateBufferL(TInt aBufferSize); - TInt UseBuffer(CMMFBuffer& aBuffer); - TInt FreeBuffer(CMMFBuffer* aBuffer); - TInt FlushPort(); - TInt EnablePort(); - TInt DisablePort(); - MILComponentIf* PortComponent() const; - - void SetPortConnectedTo(COmxILDummyBasePortILIF* aPort); -private: - COmxILDummyBasePortILIF(COmxILDummyBaseILIF& aParent, TPortDirection aPortDirection, TInt aIndex); - -private: - TPortDirection iPortDirection; - TInt iPortIndex; - - COmxILDummyBaseILIF& iPortComponent; - COmxILDummyBasePortILIF* iTunneledPort; - }; - -#endif // OMXILDUMMYBASEPORTILIF_H +// 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 OMXILDUMMYBASEPORTILIF_H +#define OMXILDUMMYBASEPORTILIF_H + +#include "milcomponentportif.h" +#include "omxildummybaseilif.h" + + +/** +Concrete implementation of the MILComponentPortIf that encapsulates the +component's port specific behaviour according to OpenMAX specification. +*/ +class COmxILDummyBasePortILIF : public CBase, + public MILComponentPortIf + { +public: + static COmxILDummyBasePortILIF* NewL(COmxILDummyBaseILIF& aParent, TPortDirection aPortDirection, TInt aIndex); + + // MILComponentPortIf + TInt FillThisBuffer(CMMFBuffer& aBuffer); + TInt EmptyThisBuffer(const CMMFBuffer& aBuffer); + TInt TunnelRequest(MILComponentPortIf* aPort); + TInt PortIndex() const; + TPortDirection PortDirection() const; + CMMFBuffer* CreateBufferL(TInt aBufferSize); + TInt UseBuffer(CMMFBuffer& aBuffer); + TInt FreeBuffer(CMMFBuffer* aBuffer); + TInt FlushPort(); + TInt EnablePort(); + TInt DisablePort(); + MILComponentIf* PortComponent() const; + + void SetPortConnectedTo(COmxILDummyBasePortILIF* aPort); +private: + COmxILDummyBasePortILIF(COmxILDummyBaseILIF& aParent, TPortDirection aPortDirection, TInt aIndex); + +private: + TPortDirection iPortDirection; + TInt iPortIndex; + + COmxILDummyBaseILIF& iPortComponent; + COmxILDummyBasePortILIF* iTunneledPort; + }; + +#endif // OMXILDUMMYBASEPORTILIF_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilapi/group/bld.inf --- a/omxil/omxilapi/group/bld.inf Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilapi/group/bld.inf Fri May 07 16:25:23 2010 +0100 @@ -1,36 +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: -// - - -PRJ_EXPORTS -// Khronos OpenMAX IL API -../v1_x/OMX_Core.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/khronos/v1_x/OMX_Core.h) -../v1_x/OMX_Component.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/khronos/v1_x/OMX_Component.h) -../v1_x/OMX_Index.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/khronos/v1_x/OMX_Index.h) -../v1_x/OMX_Audio.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/khronos/v1_x/OMX_Audio.h) -../v1_x/OMX_Video.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/khronos/v1_x/OMX_Video.h) -../v1_x/OMX_IVCommon.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/khronos/v1_x/OMX_IVCommon.h) -../v1_x/OMX_Image.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/khronos/v1_x/OMX_Image.h) -../v1_x/OMX_Types.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/khronos/v1_x/OMX_Types.h) -../v1_x/OMX_Other.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/khronos/v1_x/OMX_Other.h) -../v1_x/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 +// 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 +../v1_x/OMX_Core.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/khronos/v1_x/OMX_Core.h) +../v1_x/OMX_Component.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/khronos/v1_x/OMX_Component.h) +../v1_x/OMX_Index.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/khronos/v1_x/OMX_Index.h) +../v1_x/OMX_Audio.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/khronos/v1_x/OMX_Audio.h) +../v1_x/OMX_Video.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/khronos/v1_x/OMX_Video.h) +../v1_x/OMX_IVCommon.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/khronos/v1_x/OMX_IVCommon.h) +../v1_x/OMX_Image.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/khronos/v1_x/OMX_Image.h) +../v1_x/OMX_Types.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/khronos/v1_x/OMX_Types.h) +../v1_x/OMX_Other.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/khronos/v1_x/OMX_Other.h) +../v1_x/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 + +../shai/OMX_Symbian_AudioExt.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/shai/OMX_Symbian_AudioExt.h) +../shai/OMX_Symbian_ComponentExt.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/shai/OMX_Symbian_ComponentExt.h) +../shai/OMX_Symbian_CoreExt.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/shai/OMX_Symbian_CoreExt.h) +../shai/OMX_Symbian_ExtensionNames.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/shai/OMX_Symbian_ExtensionNames.h) +../shai/OMX_Symbian_ImageExt.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/shai/OMX_Symbian_ImageExt.h) +../shai/OMX_Symbian_IVCommonExt.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/shai/OMX_Symbian_IVCommonExt.h) +../shai/OMX_Symbian_OtherExt.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/shai/OMX_Symbian_OtherExt.h) +../shai/OMX_Symbian_VideoExt.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/shai/OMX_Symbian_VideoExt.h) diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilapi/group/multimedia_omx_il_api.mrp --- a/omxil/omxilapi/group/multimedia_omx_il_api.mrp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilapi/group/multimedia_omx_il_api.mrp Fri May 07 16:25:23 2010 +0100 @@ -1,29 +1,29 @@ -# multimedia_omx_il_api.mrp -# -# 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: -# - -component multimedia_omx_il_api - -source \sf\os\mm\omxil\omxilapi - -# no binaries - -exports \sf\os\mm\omxil\omxilapi\group - -notes_source \component_defs\release.src - - -ipr E +# multimedia_omx_il_api.mrp +# +# 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: +# + +component multimedia_omx_il_api + +source \sf\os\mm\omxil\omxilapi + +# no binaries + +exports \sf\os\mm\omxil\omxilapi\group + +notes_source \component_defs\release.src + + +ipr E diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilapi/shai/OMX_Symbian_AudioExt.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/omxilapi/shai/OMX_Symbian_AudioExt.h Fri May 07 16:25:23 2010 +0100 @@ -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 +#include +#include + + +/** @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 */ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilapi/shai/OMX_Symbian_ComponentExt.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/omxilapi/shai/OMX_Symbian_ComponentExt.h Fri May 07 16:25:23 2010 +0100 @@ -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 + + +/** @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 */ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilapi/shai/OMX_Symbian_CoreExt.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/omxilapi/shai/OMX_Symbian_CoreExt.h Fri May 07 16:25:23 2010 +0100 @@ -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 + + +/** 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 */ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilapi/shai/OMX_Symbian_ExtensionNames.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/omxilapi/shai/OMX_Symbian_ExtensionNames.h Fri May 07 16:25:23 2010 +0100 @@ -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 */ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilapi/shai/OMX_Symbian_IVCommonExt.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/omxilapi/shai/OMX_Symbian_IVCommonExt.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,827 @@ +/* + 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 +#include +#include + + +/* Extensions to standard enums */ +/* ---------------------------- */ + + +/** + * Offset to Symbian extensions + */ +#define OMX_SYMBIAN_EXTENSION_START_OFFSET 0x00A00000 + + +/** + * Exposure Control extensions + */ +typedef enum OMX_SYMBIAN_EXPOSURECONTROLTYPE { + OMX_SYMBIAN_ExposureControlCenter = OMX_ExposureControlVendorStartUnused + OMX_SYMBIAN_EXTENSION_START_OFFSET, + OMX_SYMBIAN_ExposureControlVeryLong, + OMX_SYMBIAN_ExposureControlHwFunctionalTesting, + OMX_SYMBIAN_ExposureControlMax = 0x7FFFFFFF +} OMX_SYMBIAN_EXPOSURECONTROLTYPE; + +/** + * Image Filter extensions + */ +typedef enum OMX_SYMBIAN_IMAGEFILTERTYPE { + OMX_SYMBIAN_ImageFilterSepia = OMX_ImageFilterVendorStartUnused + OMX_SYMBIAN_EXTENSION_START_OFFSET, + OMX_SYMBIAN_ImageFilterGrayScale, + OMX_SYMBIAN_ImageFilterNatural, + OMX_SYMBIAN_ImageFilterVivid, + OMX_SYMBIAN_ImageFilterMax = 0x7FFFFFFF +} OMX_SYMBIAN_IMAGEFILTERTYPE; + + +/* 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 */ +/* --------------------------- */ + + +/** + * High level control type classification. +*/ +typedef enum OMX_SYMBIAN_HIGHLEVELCONTROLTYPE { + OMX_SYMBIAN_ControlOff, /**< Explicitly turn feature off */ + OMX_SYMBIAN_ControlOn, /**< Explicitly turn feature on */ + OMX_SYMBIAN_ControlAuto, /**< Let feature to be turned on or off automatically */ + OMX_SYMBIAN_ControlMax = 0x7FFFFFFF +} OMX_SYMBIAN_HIGHLEVELCONTROLTYPE; + +/** + * Generic high level control config struct. + * +*/ +typedef struct OMX_SYMBIAN_CONFIG_HIGHLEVELCONTROLTYPE { + 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_HIGHLEVELCONTROLTYPE eControl; /**< High level control for given feature */ +} OMX_SYMBIAN_CONFIG_HIGHLEVELCONTROLTYPE; + + + +/** + * Zoom Factor config struct. + * + * Note: Zoom factor is not the same as scale factor. + * The zoom factor actually tells how much field of view + * is decreased i.e. when zoom factor is 2x the + * FoV is decreased to half (1/2) of the original. + * The scaling factor caused by decreasing the FoV is + * dependent on the output resolution. +*/ +typedef struct OMX_SYMBIAN_CONFIG_ZOOMFACTORTYPE { + 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 xZoomFactor; /**< Zoom factor in unsigned Q16 format */ +}OMX_SYMBIAN_CONFIG_ZOOMFACTORTYPE; + +/** + * Enumeration of possible focus ranges + */ +typedef enum OMX_SYMBIAN_FOCUSRANGETYPE { + OMX_SYMBIAN_FocusRangeAuto, /**< Focus range automatically decided by implementation */ + OMX_SYMBIAN_FocusRangeHyperfocal, /**< Focus range hyperfocal */ + OMX_SYMBIAN_FocusRangeSuperMacro, /**< Focus range supermacro */ + OMX_SYMBIAN_FocusRangeMacro, /**< Focus range macro */ + OMX_SYMBIAN_FocusRangeInfinity, /**< Focus range infinity */ + OMX_SYMBIAN_FocusRangeMax = 0x7FFFFFFF +} OMX_SYMBIAN_FOCUSRANGETYPE; + +/** + * Focus Range config struct. +*/ +typedef struct OMX_SYMBIAN_CONFIG_FOCUSRANGETYPE { + 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_FOCUSRANGETYPE eFocusRange; /**< Focus range */ +} OMX_SYMBIAN_CONFIG_FOCUSRANGETYPE; + +/** + * Focus Status. +*/ +typedef struct OMX_SYMBIAN_CONFIG_EXTFOCUSSTATUSTYPE { + 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_FOCUSSTATUSTYPE eFocusStatus; /**< Focus status */ +} OMX_SYMBIAN_CONFIG_EXTFOCUSSTATUSTYPE; + +/** + * 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; + +/** + * Enumeration of possible power versus image quality choices + */ +typedef enum OMX_SYMBIAN_QUALITYHINTTYPE { + OMX_SYMBIAN_QualityNotSpecified = 0, /**< Not specified, component decides by itself */ + OMX_SYMBIAN_QualityLow, /**< Power consumption priorized over quality */ + OMX_SYMBIAN_QualityBalanced, /**< Balanced between quality and power consumption */ + OMX_SYMBIAN_QualityHigh, /**< High quality priorized over power consumption */ + OMX_SYMBIAN_QualityMax = 0x7FFFFFFF +} OMX_SYMBIAN_QUALITYHINTTYPE; + +/** + * Power versus quality hint provided by IL client to implementation. +*/ +typedef struct OMX_SYMBIAN_CONFIG_HINTPOWERVSQUALITYTYPE { + 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_QUALITYHINTTYPE eQHint; /**< Power vs quality hint */ +} OMX_SYMBIAN_CONFIG_HINTPOWERVSQUALITYTYPE; + +/** + * Enumeration of possible depth of field choices + */ +typedef enum OMX_SYMBIAN_DOFHINTTYPE { + OMX_SYMBIAN_DoFNotSpecified = 0, /**< Not specified, component decides by itself */ + OMX_SYMBIAN_DoFSmall, /**< Small DoF */ + OMX_SYMBIAN_DoFMedium, /**< Medium DoF */ + OMX_SYMBIAN_DoFLarge, /**< Large DoF */ + OMX_SYMBIAN_DoFMax = 0x7FFFFFFF +} OMX_SYMBIAN_DOFHINTTYPE; + +/** + * Depth of field hint provided by IL client to implementation. + * +*/ +typedef struct OMX_SYMBIAN_CONFIG_HINTDOFTYPE { + 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_DOFHINTTYPE eDoFHint; /**< DoF hint */ +} OMX_SYMBIAN_CONFIG_HINTDOFTYPE; + +/** + * HW information retrieval struct. +*/ +typedef struct OMX_SYMBIAN_CONFIG_HWINFOTYPE { + 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 nVersion1; /**< For camera sensor filled like this: + Bits 0...7 Sensor Manufacturer (8 bits). + Bits 8...15 Sensor Version/Revision (8 bit). + Bits 16...31 Sensor Model (16 bits). + For flashgun filled like this: + Bits 0-7 Flash IC Info + Bits 8-15 Flash IC revision + Bits 16-17 Flash Module Info A as present in Module Info Reg.A of flash HW + (Only valid for some Xenon flash, leave as 0 for LED and even for Xenon if not available) + Bits 24-31 Flash Module Info B as present in Module Info Reg.B of flash HW + (Only valid for some Xenon flash, leave as 0 for LED and even for Xenon if not available) */ + OMX_U32 nVersion2; /**< Not filled for camera + For flashgun filled in same way as nVersion1 but containin information for secondary flash IC connected to same camera. + Leave as 0s if there is only single flash IC*/ + OMX_STRING cInfoString; /**< Additional information string */ +} OMX_SYMBIAN_CONFIG_HWINFOTYPE; + +/** + * Capture mode extension. + * + * Capture mode is extended to allow additional capture modes + * like time nudge and bracketing +*/ +typedef struct OMX_SYMBIAN_CONFIG_EXTCAPTUREMODETYPE { + 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 nFrameBefore; /**< Number of frames to be stored before capture bit is set */ + OMX_BOOL bPrepareCapture; /**< Enables capturing frames into ring buffer before capture bit is set */ + OMX_BOOL bEnableBracketing; /**< Enables bracketing mode where settings are changed for each captured frame */ +}OMX_SYMBIAN_CONFIG_EXTCAPTUREMODETYPE; + +/** + * Enumeration of possible rotation angles + */ +typedef enum OMX_SYMBIAN_ROTATIONANGLETYPE { + OMX_SYMBIAN_RotationCW0 = 0, /**< Rotation angle zero degrees clockwise */ + OMX_SYMBIAN_RotationCW90, /**< Rotation angle 90 degrees clockwise */ + OMX_SYMBIAN_RotationCW180, /**< Rotation angle 180 degrees clockwise */ + OMX_SYMBIAN_RotationCW270, /**< Rotation angle 270 degrees clockwise */ + OMX_SYMBIAN_RotationMax = 0x7FFFFFFF +} OMX_SYMBIAN_ROTATIONANGLETYPE; + +/** + * Enumeration of possible image orientation values + * The orientation values are same as the ones defined + * for Exif orientation tag. + */ +typedef enum OMX_SYMBIAN_ORIENTATIONORIGINTYPE +{ + OMX_SYMBIAN_OrientationNotSpecified = 0x0, /**< Orientatio of frame is not specified */ + OMX_SYMBIAN_OrientationRowTopColumnLeft, /**< Frame is in normal orientation */ + OMX_SYMBIAN_OrientationRowTopColumnRight, /**< Frame is mirrored */ + OMX_SYMBIAN_OrientationRowBottomColumnRight, /**< Frame is 180 degrees CW rotated (=mirrored and flipped) */ + OMX_SYMBIAN_OrientationRowBottomColumnLeft, /**< Frame is flipped */ + OMX_SYMBIAN_OrientationRowLeftColumnTop, /**< Frame is 90 degrees CW rotated and mirrored */ + OMX_SYMBIAN_OrientationRowRightColumnTop, /**< Frame is 270 degrees CW rotated */ + OMX_SYMBIAN_OrientationRowRightColumnBottom, /**< Frame is 270 degrees CW rotated and mirrored */ + OMX_SYMBIAN_OrientationRowLeftColumnBottom, /**< Frame is 90 degrees CW rotated */ + OMX_SYMBIAN_OrientationMax = 0x7FFFFFFF +} OMX_SYMBIAN_ORIENTATIONORIGINTYPE; + +/** + * Orientation Configuration. +*/ +typedef struct OMX_SYMBIAN_CONFIG_ORIENTATIONTYPE { + 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_ORIENTATIONORIGINTYPE eOrientation; /**< Frame orientation */ +} OMX_SYMBIAN_CONFIG_ORIENTATIONTYPE; + +/** + * Maximum number of ROIs in config + */ +#define OMX_SYMBIAN_MAX_NUMBER_OF_ROIS 10 + +/** + * Tracking object type classification. +*/ +typedef enum OMX_SYMBIAN_ROIOBJECTTYPE { + OMX_SYMBIAN_RoiObjectNone, /**< Unspecified object type */ + OMX_SYMBIAN_RoiObjectTypeFace, /**< Object type face */ + OMX_SYMBIAN_RoiObjectTypeObject, /**< Object type generic object */ + OMX_SYMBIAN_RoiObjectMax = 0x7FFFFFFF +} OMX_SYMBIAN_ROIOBJECTTYPE; + +/** + * Pricipal 3D orientation type + */ +typedef struct OMX_SYMBIAN_3DORIENTATIONYTYPE { + OMX_U32 nYaw; /**< Yaw rotation angle in degrees, 0xFFFFFFFF if unknown */ + OMX_U32 nPitch; /**< Pitch rotation angle in degrees, 0xFFFFFFFF if unknown */ + OMX_U32 nRoll; /**< Roll rotation angle in degrees, 0xFFFFFFFF if unknown */ +} OMX_SYMBIAN_3DORIENTATIONYTYPE; + +/** + * Object information structure + */ +typedef struct OMX_SYMBIAN_ROIOBJECTINFOTYPE{ + OMX_SYMBIAN_RELATIVERECTTYPE sROI; /**< Region where the object is located in the scene */ + OMX_U32 nROIID; /**< Identification number for ROI if available, zero by default */ + OMX_U32 nPriority; /**< ROI priority, 0 being the highest priority */ + OMX_SYMBIAN_ROIOBJECTTYPE eObjectType; /**< Type of object in this ROI */ + OMX_SYMBIAN_3DORIENTATIONYTYPE nOrientation; /**< 3D orientation of the object in the ROI */ +} OMX_SYMBIAN_ROIOBJECTINFOTYPE; + +/** + * Regions of interest config + * + * Used to indicate number of regions of interest within the image + * Also some additional information about the object in the ROI + * can be embedded but is not mandatory +*/ +typedef struct OMX_SYMBIAN_CONFIG_ROITYPE { + 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 nNumberOfROIs; /**< Number of ROIs included in this config */ + OMX_SYMBIAN_ROIOBJECTINFOTYPE sROIs[OMX_SYMBIAN_MAX_NUMBER_OF_ROIS]; /**< Array of ROIs */ +} OMX_SYMBIAN_CONFIG_ROITYPE; + +/** + * Enumeration of possible xenon flash status values + */ +typedef enum OMX_SYMBIAN_XENONFLASHSTATUSTYPE +{ + OMX_SYMBIAN_XenonFlashUnknown = 0x0, /**< Xenon flash status is unknown */ + OMX_SYMBIAN_XenonFlashDischarged, /**< Xenon flash is discharged */ + OMX_SYMBIAN_XenonFlashCharging, /**< Xenon flash is charging */ + OMX_SYMBIAN_XenonFlashReady, /**< Xenon flash is ready to be used */ + OMX_SYMBIAN_XenonFlashNotAvailable, /**< Xenon flash can not be used at the moment + (temporarily overheated etc...) */ + OMX_SYMBIAN_XenonFlashMax = 0x7FFFFFFF +} OMX_SYMBIAN_XENONFLASHSTATUSTYPE; + +/** + * Xenon flash status Config. +*/ +typedef struct OMX_SYMBIAN_CONFIG_XENONFLASHSTATUSTYPE { + 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_XENONFLASHSTATUSTYPE eFlashStatus; /**< Xenon flash status */ +} OMX_SYMBIAN_CONFIG_XENONFLASHSTATUSTYPE; + + +/** + * Enumeration of possible pre capture exposure time estimates + * + * This enumeration is used to implement pre-capture warning about + * low or high exposure time which could lead to bad quality images + */ +typedef enum OMX_SYMBIAN_PRECAPTUREEXPOSURETIMETYPE +{ + OMX_SYMBIAN_PreCaptureExposureNoneOrOngoing = 0x0, /**< Exposure time not known or exposure already started */ + OMX_SYMBIAN_PreCaptureExposureNormal, /**< Exposure time is within normal limits */ + OMX_SYMBIAN_PreCaptureExposureShort, /**< Exposure time is short, risk of underexposing the images */ + OMX_SYMBIAN_PreCaptureExposureLong, /**< Exposure time is long, risk of blurry image */ + OMX_SYMBIAN_PreCaptureExposureMax = 0x7FFFFFFF +} OMX_SYMBIAN_PRECAPTUREEXPOSURETIMETYPE; + +/** + * Pre-Capture Exposure Time Config. +*/ +typedef struct OMX_SYMBIAN_CONFIG_PRECAPTUREEXPOSURETIMETYPE { + 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_PRECAPTUREEXPOSURETIMETYPE eExposureTime; /**< Estimated exposure time */ +} OMX_SYMBIAN_CONFIG_PRECAPTUREEXPOSURETIMETYPE; + +/** + * Enumeration of possible bracket mode values + */ +typedef enum OMX_SYMBIAN_BRACKETMODETYPE { + OMX_SYMBIAN_BracketExposureRelativeInEV, /**< Exposure value is changed relative to + the value set by automatic exposure. + nBracketValues are in Q16. Increment is additive. */ + OMX_SYMBIAN_BracketMax = 0x7FFFFFFF +} OMX_SYMBIAN_BRACKETMODETYPE; + +/** + * Bracketing Config. +*/ +typedef struct OMX_SYMBIAN_CONFIG_BRACKETINGTYPE { + 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_BRACKETMODETYPE eBracketMode; /**< Bracketing mode - what values are changed during bracket capture */ + OMX_U32 nNbrBracketingValues; /**< Number of bracketing values */ + OMX_U32 nBracketValues[5]; /**< Bracketing values in an array */ +} OMX_SYMBIAN_CONFIG_BRACKETINGTYPE; + +/** + * Enumeration of possible levels of RAW processing + */ +typedef enum OMX_SYMBIAN_RAWIMAGEPRESETTYPE { + OMX_SYMBIAN_RawImageUnprocessed, /**< RAW data is unprocessed */ + OMX_SYMBIAN_RawImageProcessed, /**< RAW data has some processing enabled */ + OMX_SYMBIAN_RawImageMax = 0x7FFFFFFF +} OMX_SYMBIAN_RAWIMAGEPRESETTYPE; + +/** + * RAW Preset Config. +*/ +typedef struct OMX_SYMBIAN_CONFIG_RAWPRESETTYPE { + 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_RAWIMAGEPRESETTYPE ePreset; /**< RAW processing preset */ +} OMX_SYMBIAN_CONFIG_RAWPRESETTYPE; + +/** + * Image Parameters Lock. +*/ +typedef struct OMX_SYMBIAN_CONFIG_LOCKTYPE { + 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 bLock; /**< Setting this true will lock the setting and + its value is not automatically updated anymore */ + OMX_BOOL bAtCapture; /**< Setting this true will lock the setting value only + when next capture occurs */ +} OMX_SYMBIAN_CONFIG_LOCKTYPE; + +/** + * Image Flash Control Config. + * + * Extended because in standard flash control is a param +*/ +typedef struct OMX_SYMBIAN_CONFIG_FLASHCONTROLTYPE { + 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_IMAGE_FLASHCONTROLTYPE eFlashControl; /**< Flash mode setting */ +}OMX_SYMBIAN_CONFIG_FLASHCONTROLTYPE; + +/** + * Enumeration of possible focus region control values + */ +typedef enum OMX_SYMBIAN_FOCUSREGIONCONTROL { + OMX_SYMBIAN_FocusRegionAuto, /**< Focus region decided by AF algorithm */ + OMX_SYMBIAN_FocusRegionManual, /**< Manual focus region selected by user */ + OMX_SYMBIAN_FocusRegionFacePriority, /**< ROI with priority face (if available) should be used as focus region, otherwise automatically selected by AF algorithm */ + OMX_SYMBIAN_FocusRegionObjectPriority, /**< ROI with priority object (if available) should be used as focus region, otherwise automatically selected by AF algorithm */ + OMX_SYMBIAN_FocusRegionMax = 0x7FFFFFFF +} OMX_SYMBIAN_FOCUSREGIONCONTROL; + +/** + * Focus Region Control Config. +*/ +typedef struct OMX_SYMBIAN_CONFIG_FOCUSREGIONTYPE { + 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_FOCUSREGIONCONTROL eFocusRegionControl; /**< Focus region selection */ + OMX_SYMBIAN_RELATIVERECTTYPE sFocusRegion; /**< Focus region if focus region control is manual */ +} OMX_SYMBIAN_CONFIG_FOCUSREGIONTYPE; + +/** + * Enumeration of possible camera self tests + */ +typedef enum OMX_SYMBIAN_CAMERASELFTESTTYPE +{ + OMX_SYMBIAN_CameraSelfTestNone = 0, + OMX_SYMBIAN_CameraSelfTestSensor, /**< Verifies command and data bus connections of camera sensor */ + OMX_SYMBIAN_CameraSelfTestHwa, /**< Verifies command bus and data bus connections between host and camera HWA */ + OMX_SYMBIAN_CameraSelfTestFocus, /**< Verifies that focus lens is able to move. This test typically requires HW's + ability to measure lens position. Test can be done e.g. by moving lens to + two different positions and reading back the lens position */ + + OMX_SYMBIAN_CamearSelfTestOpticalZoom, /**< Verifies that optical zoom lens is able to move. This test typically requires + HW's ability to measure lens position. Test can be done e.g. by moving lens to + two different positions and reading back the lens position */ + OMX_SYMBIAN_CameraSelfTestFlashDriverPrimaryL, /**< tests connections to primary flash driver IC */ + OMX_SYMBIAN_CameraSelfTestFlashDriverSecondaryL, /**< tests connections to secondary flash driver IC */ + OMX_SYMBIAN_CameraSelfTestFlashL, /**< tests capture flash without using strobe signal from camera */ + OMX_SYMBIAN_CameraSelfTestFlashWithStrobe, /**< tests capture flash using strobe signal from camera: ONLY + this one needs to be done in idle state from flash tests cases */ + OMX_SYMBIAN_CameraSelfTestVideoLightL, /**< tests video light */ + OMX_SYMBIAN_CameraSelfTestAfLightL, /**< tests AF assistance light */ + OMX_SYMBIAN_CameraSelfTestIndicatorLightL, /**< tests capture indicator light */ + OMX_SYMBIAN_CameraSelfTestFlashTorchL, /**< tests flash in torch mode */ + OMX_SYMBIAN_CameraSelfTestHwaControl, /**< Verifies HWA command bus connection */ + OMX_SYMBIAN_CameraSelfTestHwaOTP, /**< Sanity check for HWA OTP programming */ + OMX_SYMBIAN_CameraSelfTestHwaSDRAM, /**< Verifies HWA SDRAM bus connections */ + OMX_SYMBIAN_CameraSelfTestHwaSleep, /**< Verifies HWA ability to sleep/wakeup */ + OMX_SYMBIAN_CameraSelfTestHwaPmControl, /**< Verifies HWA power managment control */ + OMX_SYMBIAN_CameraSelfTestSensorControl, /**< Verifies sensor command bus connection */ + OMX_SYMBIAN_CameraSelfTestSensorNVM, /**< Verifies sensor non-volatile memory is readable */ + OMX_SYMBIAN_CameraSelfTestLensDrvControl, /**< Verifies lens driver IC command bus connection */ + OMX_SYMBIAN_CameraSelfTestShutter, /**< Verifies shutter operation */ + OMX_SYMBIAN_CameraSelfTestNDFilter, /**< Verifies ND filter */ + OMX_SYMBIAN_CameraSelfTestGlobalReset, /**< Verifies global reset signal (from camera to host) connection */ + OMX_SYMBIAN_CameraSelfTestMax = 0x7FFFFFFF +} OMX_SYMBIAN_CAMERASELFTESTTYPE; + +/** + * Self test type and result struct + */ +typedef struct OMX_SYMBIAN_CAMERASELFTESTRESULTTYPE { + OMX_SYMBIAN_CAMERASELFTESTTYPE eTestId; /**< Test id */ + OMX_ERRORTYPE eResult; /**< Test result */ +} OMX_SYMBIAN_CAMERASELFTESTRESULTTYPE; + +#define OMX_SYMBIAN_MAX_SELF_TESTS_PER_REQUEST 20 + +/** + * Self test select config + */ +typedef struct OMX_SYMBIAN_CONFIG_CAMERASELFTESTSELECTTYPE { + 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 nFlashHwFaultRegister1; + OMX_U32 nFlashHwFaultRegister2; + OMX_U16 nTestSelectMaxSizeUsed; + OMX_SYMBIAN_CAMERASELFTESTRESULTTYPE eSelfTests[OMX_SYMBIAN_MAX_SELF_TESTS_PER_REQUEST]; /**< Self test results */ +} OMX_SYMBIAN_CONFIG_CAMERASELFTESTSELECTTYPE; + +/** + * Enumeration of functional tests + */ +typedef enum OMX_SYMBIAN_CAMERAHWFUNCTEST { + OMX_SYMBIAN_CameraFuncTestNone = 0, + OMX_SYMBIAN_CameraFuncTestDeadPixels, + OMX_SYMBIAN_CameraFuncTestCouplet, + OMX_SYMBIAN_CameraFuncTestBrightness, + OMX_SYMBIAN_CameraFuncTestVignetting, + OMX_SYMBIAN_CameraFuncTestNdFilter, + OMX_SYMBIAN_CameraFuncTestFocus, + OMX_SYMBIAN_CameraFuncTestIris, + OMX_SYMBIAN_CameraFuncTestFlash, + OMX_SYMBIAN_CameraFuncTestIndicatorLed, + OMX_SYMBIAN_CameraFuncTestVideoLight, + OMX_SYMBIAN_CameraFuncTestBlemish, + OMX_SYMBIAN_CameraFuncTestShutter, + OMX_SYMBIAN_CameraFuncTestMax = 0x7FFFFFFF +} OMX_SYMBIAN_CAMERAHWFUNCTEST; + +#define OMX_SYMBIAN_MAX_FUNC_TESTS_PER_REQUEST 20 + +/** + * Functional test selection config + */ +typedef struct OMX_SYMBIAN_CONFIG_CAMERAHWFUNCTESTSELECTTYPE { + 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 nTestSelectMaxSizeUsed; /**< Number of entries in eFuncTests */ + OMX_SYMBIAN_CAMERAHWFUNCTEST eFuncTests[OMX_SYMBIAN_MAX_FUNC_TESTS_PER_REQUEST]; /**< Array of selected tests */ + OMX_BOOL bTestImageOutput; /**< If set OMX_TRUE, NRW format test image is outputted in addition to test results */ +}OMX_SYMBIAN_CONFIG_CAMERAHWFUNCTESTSELECTTYPE; + +/** + * Enumeration of scene modes + */ +typedef enum OMX_SYMBIAN_SCENEMODETYPE { + OMX_SYMBIAN_SceneAuto = 0, /**< Camera settings automatically selected by camera */ + OMX_SYMBIAN_ScenePortrait, /**< Use camera settings suitable for taking portrait images */ + OMX_SYMBIAN_SceneLandscape, /**< Use camera settings suitable for taking landscae images */ + OMX_SYMBIAN_SceneNight, /**< Use camera settings suitable for taking low light images */ + OMX_SYMBIAN_SceneNightPortrait, /**< Use camera settings suitable for taking portrait images in low light */ + OMX_SYMBIAN_SceneSport, /**< Use camera settings suitable for taking images when there is fast movement in the scene */ + OMX_SYMBIAN_SceneMacro, /**< Use camera settings suitable for taking close-up images */ + OMX_SYMBIAN_SceneMax = 0x7FFFFFFF +} OMX_SYMBIAN_SCENEMODETYPE; + +/** + * Scene mode config + */ +typedef struct OMX_SYMBIAN_CONFIG_SCENEMODETYPE { + 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_SCENEMODETYPE eSceneType; /**< Scene mode selection */ +} OMX_SYMBIAN_CONFIG_SCENEMODETYPE; + +/** + * RGB histogram returned using this config + */ +typedef struct OMX_SYMBIAN_CONFIG_RGBHISTOGRAM { + 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 nRed[256]; /**< Histogram for red color */ + OMX_U32 nGreen[256]; /**< Histogram for green color */ + OMX_U32 nBlue[256]; /**< Histogram for blue color */ +} OMX_SYMBIAN_CONFIG_RGBHISTOGRAM; + +/** + * Histogram control config + */ +typedef struct OMX_SYMBIAN_CONFIG_HISTOGRAMCONTROLTYPE { + 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 bMeasure; /**< Set OMX_TRUE to start histogram measurement */ + OMX_U32 nBins; /**< Number of bins */ + OMX_U32 nBytesPerBin; /**< Number of bytes / bin */ +} OMX_SYMBIAN_CONFIG_HISTOGRAMCONTROLTYPE; + +/** + * Region of interest selection config + */ +typedef struct OMX_SYMBIAN_CONFIG_ROISELECTIONTYPE { + 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 bReset; /**< OMX_TRUE = reset all selections done. Rest of the fields are not used */ + OMX_BOOL bSelect; /**< OMX_TRUE = select / OMX_FALSE = deselect */ + OMX_SYMBIAN_RELATIVERECTTYPE sROI; /**< Indicates the region where the object to be selected is located in the scene */ + OMX_U32 nROIID; /**< This field can contain the ID of object in order to assist + object selection. 0 means undefined and is the default value. */ + OMX_SYMBIAN_ROIOBJECTTYPE eObjectType; /**< Indicates the type of object to be selected. */ +} OMX_SYMBIAN_CONFIG_ROISELECTIONTYPE; + +/** + * 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_EXTENSION_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_ColorPrimaryFullRange, + OMX_SYMBIAN_ColorPrimaryBT601, + OMX_SYMBIAN_ColorPrimaryBT709, + 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; + + +/** Pixel Aspect Ratio. + +The index specified for this structure is retrieved using +OMX_GetExtensionIndex() with the extension string +"OMX.Symbian.Index.Param.Common.PixelAspectRatio". +*/ +typedef struct OMX_SYMBIAN_PARAM_PIXELASPECTRATIOTYPE +{ + 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_U8 nHorizontal; /**< Width of pixel. nHorizontal is 4 is For 4:3 PAR */ + OMX_U8 nVertical; /**< Height of pixel. nVertical is 3 is For 4:3 PAR */ + OMX_TICKS nTimestamp; /**< Time when PAR change should happen */ +} OMX_SYMBIAN_PARAM_PIXELASPECTRATIOTYPE; + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* OMX_Symbian_IVCommonExt_h */ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilapi/shai/OMX_Symbian_ImageExt.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/omxilapi/shai/OMX_Symbian_ImageExt.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,78 @@ +/* + OMX_Symbian_ImageExt.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 Image Domain. + +This file contains the extension structures for the Symbian IL extensions that +pertain to imaaging components. + +@publishedDeviceAbstraction +*/ + +#ifndef OMX_Symbian_ImageExt_h +#define OMX_Symbian_ImageExt_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 +#include + +/* Extensions to standard enums */ +/* ---------------------------- */ + + +/** + * Offset to Symbian extensions + */ +#define OMX_SYMBIAN_EXTENSION_START_OFFSET 0x00A00000 + + +/** + * Focus Control extensions + */ +typedef enum OMX_SYMBIAN_IMAGE_FOCUSCONTROLTYPE { + OMX_SYMBIAN_IMAGE_FocusControlRestPosition = OMX_IMAGE_FocusControlVendorStartUnused + OMX_SYMBIAN_EXTENSION_START_OFFSET, + /**< Drives focus to rest position for minimal power consumption but should still be usable at least for view finder **/ + OMX_SYMBIAN_IMAGE_FocusControlMax = 0x7FFFFFFF +} OMX_SYMBIAN_IMAGE_FOCUSCONTROLTYPE; + +/** + * Flash Control extensions + */ +typedef enum OMX_SYMBIAN_IMAGE_FLASHCONTROLTYPE { + OMX_SYMBIAN_IMAGE_FlashControlSlowFrontSync = OMX_IMAGE_FlashControlVendorStartUnused + OMX_SYMBIAN_EXTENSION_START_OFFSET, + OMX_SYMBIAN_IMAGE_FlashControlSlowRearSync, + OMX_SYMBIAN_IMAGE_FlashControlOnTest, /**< Allows production testing of the flash with a higher flash intensity + than the torch (may be that of a normal flash) and test (some) HW that + it turns OFF flash when automatic fail-safe happens (or capacitor + discharge in case of Xenon */ + OMX_SYMBIAN_IMAGE_FlashControlTorchOnTest, /**< Turns on flash in torch mode */ + OMX_SYMBIAN_IMAGE_FlashControlIndicatorLightOnTest, /**< Turns on indicator light */ + OMX_SYMBIAN_IMAGE_FlashControlMax = 0x7FFFFFFF +} OMX_SYMBIAN_IMAGE_FLASHCONTROLTYPE; + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* OMX_Symbian_ImageExt_h */ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilapi/shai/OMX_Symbian_OtherExt.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/omxilapi/shai/OMX_Symbian_OtherExt.h Fri May 07 16:25:23 2010 +0100 @@ -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 + + +/** @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 */ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilapi/shai/OMX_Symbian_VideoExt.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/omxilapi/shai/OMX_Symbian_VideoExt.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,253 @@ +/* + OMX_Symbian_VideoExt.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 Video Domain. + +This file contains the extension structures for the Symbian IL extensions that +pertain to video components. + +@publishedDeviceAbstraction +*/ + +#ifndef OMX_Symbian_VideoExt_h +#define OMX_Symbian_VideoExt_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 +#include + + +/** Video format extensions. */ +typedef enum OMX_SYMBIAN_VIDEO_CODINGTYPE { + OMX_SYMBIAN_VIDEO_CodingVC1 = OMX_VIDEO_CodingVendorStartUnused + 0x1, + OMX_SYMBIAN_VIDEO_CodingVP6, + OMX_SYMBIAN_VIDEO_CodingMax = 0x7FFFFFFF +} OMX_SYMBIAN_VIDEO_CODINGTYPE; + +/** Sequence Headers. + +The index specified for this structure is retrieved using +OMX_GetExtensionIndex() with the extension string +"OMX.Symbian.Index.Param.Video.SequenceHeader". + */ +typedef struct OMX_SYMBIAN_VIDEO_PARAM_SEQUENCEHEADERTYPE +{ + 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 nSequenceHeaderSize; /**< Size of the sequence header in bytes */ + OMX_U8 SequenceHeader[1]; /**< Sequence header. VOS, VO and VOL for MPEG-4. SPS and PPS for AVC */ +} OMX_SYMBIAN_VIDEO_PARAM_SEQUENCEHEADERTYPE; + + +typedef enum OMX_SYMBIAN_VIDEO_AVCSEITYPE { + OMX_SYMBIAN_VIDEO_AvcSeiBufferinPeriod = 0x01, + OMX_SYMBIAN_VIDEO_AvcSeiPictureTiming = 0x02, + OMX_SYMBIAN_VIDEO_AvcSeiPanScanRectangle = 0x04, + OMX_SYMBIAN_VIDEO_AvcSeiFillerPayload = 0x08, + OMX_SYMBIAN_VIDEO_AvcSeiUserDataRegisteredByITUT35 = 0x10, + OMX_SYMBIAN_VIDEO_AvcSeiUserDataUnregistered = 0x20, + OMX_SYMBIAN_VIDEO_AvcSeiRecoveryPoint = 0x40, + OMX_SYMBIAN_VIDEO_AvcSeiDecReferencePictureMarkingRepetition = 0x80, + OMX_SYMBIAN_VIDEO_AvcSeiSparePicture = 0x100, + OMX_SYMBIAN_VIDEO_AvcSeiSceneInformation = 0x200, + OMX_SYMBIAN_VIDEO_AvcSeiSubSequenceInformation = 0x400, + OMX_SYMBIAN_VIDEO_AvcSeiSubSequenceLayerCharacteristics = 0x800, + OMX_SYMBIAN_VIDEO_AvcSeiSubSequenceCharacteristics = 0x1000, + OMX_SYMBIAN_VIDEO_AvcSeiFullFrameFreeze = 0x2000, + OMX_SYMBIAN_VIDEO_AvcSeiFullFrameFreezeRelease = 0x4000, + OMX_SYMBIAN_VIDEO_AvcSeiFullFrameSnaphot = 0x8000, + OMX_SYMBIAN_VIDEO_AvcSeiProgressiveRefinementSegmentStart = 0x10000, + OMX_SYMBIAN_VIDEO_AvcSeiProgressiveRefinementSegmentEnd = 0x20000, + OMX_SYMBIAN_VIDEO_AvcSeiMotionContstrainedSliceGroup = 0x40000, + OMX_SYMBIAN_VIDEO_AvcSeiFilmGrainCharacteristics = 0x80000, + OMX_SYMBIAN_VIDEO_AvcSeiDeblockingFilterDispPreference = 0x100000, + OMX_SYMBIAN_VIDEO_AvcSeiStereoVideoInformation = 0x200000, + OMX_SYMBIAN_VIDEO_AvcSeiMax = 0x7FFFFFFF +} OMX_SYMBIAN_VIDEO_AVCSEITYPE; + +/** SEI messages. + +The index specified for this structure is retrieved using +OMX_GetExtensionIndex() with the extension string +"OMX.Symbian.Index.Param.Video.AVCSei". +*/ +typedef struct OMX_SYMBIAN_VIDEO_PARAM_AVCSEITYPE +{ + 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 bEnableSEI; /**< Enable SEI messages */ + OMX_SYMBIAN_VIDEO_AVCSEITYPE eSEI; /**< Requested SEI messages. Several messages can be requested. */ +} OMX_SYMBIAN_VIDEO_PARAM_AVCSEITYPE; + +/** AVC output order. + +The index specified for this structure is retrieved using +OMX_GetExtensionIndex() with the extension string +"OMX.Symbian.Index.Param.Video.AVCOutputOrder". +*/ +typedef struct OMX_SYMBIAN_VIDEO_PARAM_AVCOUTPUTORDERTYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_BOOL bOutputInDisplayOrder; +} OMX_SYMBIAN_VIDEO_PARAM_AVCOUTPUTORDERTYPE; + + +/** Refresh mode. + +The index specified for this structure is retrieved using +OMX_GetExtensionIndex() with the extension string +"OMX.Symbian.Index.Config.Video.RefreshMode". +*/ +typedef struct OMX_SYMBIAN_VIDEO_CONFIG_REFRESHMODETYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_BOOL bRefreshLatestOutputFrame; +} OMX_SYMBIAN_VIDEO_CONFIG_REFRESHMODETYPE; + +/** VC1 profile enum. */ +typedef enum OMX_SYMBIAN_VIDEO_VC1PROFILETYPE { + OMX_SYMBIAN_VIDEO_VC1ProfileSimple, + OMX_SYMBIAN_VIDEO_VC1ProfileMain, + OMX_SYMBIAN_VIDEO_VC1ProfileAdvanced, + OMX_SYMBIAN_VIDEO_VC1ProfileMax = 0x7FFFFFFF +} OMX_SYMBIAN_VIDEO_VC1PROFILETYPE; + +/** VC1 level enum. */ +typedef enum OMX_SYMBIAN_VIDEO_VC1LEVELTYPE { + OMX_SYMBIAN_VIDEO_VC1LevelLow, + OMX_SYMBIAN_VIDEO_VC1LevelMedium, + OMX_SYMBIAN_VIDEO_VC1LevelHigh, + OMX_SYMBIAN_VIDEO_VC1LevelL0, + OMX_SYMBIAN_VIDEO_VC1LevelL1, + OMX_SYMBIAN_VIDEO_VC1LevelL2, + OMX_SYMBIAN_VIDEO_VC1LevelL3, + OMX_SYMBIAN_VIDEO_VC1LevelL4, + OMX_SYMBIAN_VIDEO_VC1LevelMax = 0x7FFFFFFF +} OMX_SYMBIAN_VIDEO_VC1LEVELTYPE; + +/** VC1 parameters for simple and main profiles. */ +typedef struct OMX_SYMBIAN_VIDEO_VC1SIMPLEMAINPROFILETYPE { + OMX_U32 nHRDBufferSize; + OMX_U32 nHRDBufferRate; + OMX_BOOL bEnableLoopFilter; + OMX_BOOL bEnableMultiRes; + OMX_BOOL bEnableFastUVMC; + OMX_BOOL bEnableExtendedMV; + OMX_U32 bDQuant; + OMX_BOOL bEnableVSTransform; + OMX_BOOL bEnableOverlap; + OMX_BOOL bEnableSyncMarker; + OMX_BOOL bEnableRangeRed; + OMX_U32 nMaxBFrames; + OMX_U32 bQuantizer; +} OMX_SYMBIAN_VIDEO_VC1SIMPLEMAINPROFILETYPE; + +/** VC1 parameters for the advaanced profile. */ +typedef struct OMX_SYMBIAN_VIDEO_VC1ADVANCEDPROFILETYPE { + OMX_U32 nColorDifferenceFormat; + OMX_BOOL bPostProcFlag; + OMX_U32 nMaxCodedWidth; + OMX_U32 nMaxCodedHeight; + OMX_BOOL bPullDown; + OMX_BOOL bInterlace; + OMX_BOOL bTFCounterFlag; + OMX_BOOL bProgressiveSegmentedFrame; + OMX_BOOL bDisplayExtensionFlag; + OMX_U32 nDisplayHorizontalSize; + OMX_U32 nDisplayVerticalSize; + OMX_BOOL bAspectRatioFlag; + OMX_U32 nAspectRatio; + OMX_U32 nAspectHorizontalSize; + OMX_U32 nAspectVerticalSize; + OMX_BOOL bFrameRateFlag; + OMX_BOOL bFrameRateIndicator; + OMX_U32 nFrameRateNumerator; + OMX_U32 nFrameRateDenominator; + OMX_U32 nFrameRateExplicit; + OMX_BOOL bColorFormatFlag; + OMX_U32 nColorPrimaries; + OMX_U32 nTransferCharacteristics; + OMX_U32 nMatrixCoefficients; + OMX_BOOL bHRDIndicatorFlag; + OMX_U32 nHRDNumberOfLeakyBuckets; + OMX_U32 nHRDRateExponent; + OMX_U32 nHRDBufferExponent; +} OMX_SYMBIAN_VIDEO_VC1ADVANCEDPROFILETYPE; + +/** VC1 settings. + +The index specified for this structure is retrieved using +OMX_GetExtensionIndex() with the extension string +"OMX.Symbian.Index.Config.Video.Vc1". +*/ +typedef struct OMX_SYMBIAN_VIDEO_PARAM_VC1TYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_SYMBIAN_VIDEO_VC1PROFILETYPE eProfile; + OMX_SYMBIAN_VIDEO_VC1LEVELTYPE eLevel; + OMX_U32 bFrmRtQPostProc; + OMX_U32 bBitRtQPostProc; + OMX_BOOL bEnableFInterpFlag; + union { + OMX_SYMBIAN_VIDEO_VC1SIMPLEMAINPROFILETYPE simple; + OMX_SYMBIAN_VIDEO_VC1ADVANCEDPROFILETYPE advanced; + } profile; +} OMX_SYMBIAN_VIDEO_PARAM_VC1TYPE; + +/** VP6 profile enum. */ +typedef enum OMX_SYMBIAN_VIDEO_VP6PROFILETYPE { + OMX_SYMBIAN_VIDEO_VP6ProfileSimple, + OMX_SYMBIAN_VIDEO_VP6ProfileAdvanced, + OMX_SYMBIAN_VIDEO_VP6ProfileHeightenedSharpness, + OMX_SYMBIAN_VIDEO_VP6ProfileMax = 0x7FFFFFFF +} OMX_SYMBIAN_VIDEO_VP6PROFILETYPE; + +/** VP6 level enum. */ +typedef enum OMX_SYMBIAN_VIDEO_VP6LEVELTYPE { + OMX_SYMBIAN_VIDEO_VP6LevelMax = 0x7FFFFFFF +} OMX_SYMBIAN_VIDEO_VP6LEVELTYPE; + +/** VP6 settings. + +The index specified for this structure is retrieved using +OMX_GetExtensionIndex() with the extension string +"OMX.Symbian.Index.Config.Video.Vc6". +*/ +typedef struct OMX_SYMBIAN_VIDEO_PARAM_VP6TYPE { + OMX_U32 nSize; + OMX_VERSIONTYPE nVersion; + OMX_U32 nPortIndex; + OMX_SYMBIAN_VIDEO_VP6PROFILETYPE eProfile; + OMX_SYMBIAN_VIDEO_VP6LEVELTYPE eLevel; +} OMX_SYMBIAN_VIDEO_PARAM_VP6TYPE; + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* OMX_Symbian_VideoExt_h */ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilapi/v1_x/OMX_Audio.h --- a/omxil/omxilapi/v1_x/OMX_Audio.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilapi/v1_x/OMX_Audio.h Fri May 07 16:25:23 2010 +0100 @@ -1,1312 +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 - -/** @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 */ - +/* + * 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 + +/** @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 */ + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilapi/v1_x/OMX_Component.h --- a/omxil/omxilapi/v1_x/OMX_Component.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilapi/v1_x/OMX_Component.h Fri May 07 16:25:23 2010 +0100 @@ -1,579 +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 -#include -#include -#include - -/** @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 */ +/* + * 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 +#include +#include +#include + +/** @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 */ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilapi/v1_x/OMX_ContentPipe.h --- a/omxil/omxilapi/v1_x/OMX_ContentPipe.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilapi/v1_x/OMX_ContentPipe.h Fri May 07 16:25:23 2010 +0100 @@ -1,195 +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 - +/* + * 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 + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilapi/v1_x/OMX_Core.h --- a/omxil/omxilapi/v1_x/OMX_Core.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilapi/v1_x/OMX_Core.h Fri May 07 16:25:23 2010 +0100 @@ -1,1431 +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 - - -/** 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 */ - -/** 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 */ - +/* + * 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 + + +/** 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 */ + +/** 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 */ + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilapi/v1_x/OMX_IVCommon.h --- a/omxil/omxilapi/v1_x/OMX_IVCommon.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilapi/v1_x/OMX_IVCommon.h Fri May 07 16:25:23 2010 +0100 @@ -1,921 +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 - -/** @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 */ +/** + * 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 + +/** @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 */ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilapi/v1_x/OMX_Image.h --- a/omxil/omxilapi/v1_x/OMX_Image.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilapi/v1_x/OMX_Image.h Fri May 07 16:25:23 2010 +0100 @@ -1,329 +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 - -/** @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 */ +/** + * 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 + +/** @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 */ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilapi/v1_x/OMX_Index.h --- a/omxil/omxilapi/v1_x/OMX_Index.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilapi/v1_x/OMX_Index.h Fri May 07 16:25:23 2010 +0100 @@ -1,259 +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 - - -/** 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, /** + + +/** 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, /** - - -/** - * 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 */ +/* + * 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 + + +/** + * 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 */ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilapi/v1_x/OMX_Types.h --- a/omxil/omxilapi/v1_x/OMX_Types.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilapi/v1_x/OMX_Types.h Fri May 07 16:25:23 2010 +0100 @@ -1,359 +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 */ +/* + * 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 */ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilapi/v1_x/OMX_Video.h --- a/omxil/omxilapi/v1_x/OMX_Video.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilapi/v1_x/OMX_Video.h Fri May 07 16:25:23 2010 +0100 @@ -1,1060 +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 - - -/** - * 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 */ - +/** + * 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 + + +/** + * 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 */ + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/bwins/omxilcomponentcommon.def --- a/omxil/omxilcomponentcommon/bwins/omxilcomponentcommon.def Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/bwins/omxilcomponentcommon.def Fri May 07 16:25:23 2010 +0100 @@ -1,147 +1,139 @@ -EXPORTS - ?DoSetFsm@XOmxILCallbackManagerIfImpl@@MAEXAAVCOmxILFsm@@@Z @ 1 NONAME ; void XOmxILCallbackManagerIfImpl::DoSetFsm(class COmxILFsm &) - ?SetPortManager@COmxILCallbackManager@@UAEXAAVCOmxILPortManager@@@Z @ 2 NONAME ; void COmxILCallbackManager::SetPortManager(class COmxILPortManager &) - ?DoRegisterTunnelCallback@XOmxILCallbackManagerIfImpl@@MAE?AW4OMX_ERRORTYPE@@KW4OMX_DIRTYPE@@PAXK@Z @ 3 NONAME ; enum OMX_ERRORTYPE XOmxILCallbackManagerIfImpl::DoRegisterTunnelCallback(unsigned long, enum OMX_DIRTYPE, void *, unsigned long) - ?SetConfig@COmxILConfigManager@@UAE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PBX@Z @ 4 NONAME ; enum OMX_ERRORTYPE COmxILConfigManager::SetConfig(enum OMX_INDEXTYPE, void const *) - ?NewL@COmxILFsm@@SAPAV1@AAVCOmxILComponent@@AAVCOmxILProcessingFunction@@AAVCOmxILPortManager@@AAVCOmxILConfigManager@@AAVMOmxILCallbackManagerIf@@@Z @ 5 NONAME ; class COmxILFsm * COmxILFsm::NewL(class COmxILComponent &, class COmxILProcessingFunction &, class COmxILPortManager &, class COmxILConfigManager &, class MOmxILCallbackManagerIf &) - ?SetTransitionToDisabledCompleted@COmxILPort@@UAEXXZ @ 6 NONAME ; void COmxILPort::SetTransitionToDisabledCompleted(void) - ??0COmxILConfigManager@@IAE@AAVCOmxILPortManager@@@Z @ 7 NONAME ; COmxILConfigManager::COmxILConfigManager(class COmxILPortManager &) - ?GetParameter@COmxILOtherPort@@UBE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PAX@Z @ 8 NONAME ; enum OMX_ERRORTYPE COmxILOtherPort::GetParameter(enum OMX_INDEXTYPE, void *) const - ??1COmxILImagePort@@UAE@XZ @ 9 NONAME ; COmxILImagePort::~COmxILImagePort(void) - ?StoreBufferMark@COmxILPort@@IAE?AW4OMX_ERRORTYPE@@AAPAX0@Z @ 10 NONAME ; enum OMX_ERRORTYPE COmxILPort::StoreBufferMark(void * &, void * &) - ??1COmxILCallbackManager@@UAE@XZ @ 11 NONAME ; COmxILCallbackManager::~COmxILCallbackManager(void) - ?ClockBufferDoneNotification@COmxILCallbackManager@@UAE?AW4OMX_ERRORTYPE@@PAUOMX_BUFFERHEADERTYPE@@KW4OMX_DIRTYPE@@@Z @ 12 NONAME ; enum OMX_ERRORTYPE COmxILCallbackManager::ClockBufferDoneNotification(struct OMX_BUFFERHEADERTYPE *, unsigned long, enum OMX_DIRTYPE) - ?RegisterILClientCallbacks@COmxILInContextCallbackManager@@UAE?AW4OMX_ERRORTYPE@@PBUOMX_CALLBACKTYPE@@PAX@Z @ 13 NONAME ; enum OMX_ERRORTYPE COmxILInContextCallbackManager::RegisterILClientCallbacks(struct OMX_CALLBACKTYPE const *, void *) - ?DoCommandCompleteNotification@XOmxILCallbackManagerIfImpl@@MAE?AW4OMX_ERRORTYPE@@W4OMX_COMMANDTYPE@@K@Z @ 14 NONAME ; enum OMX_ERRORTYPE XOmxILCallbackManagerIfImpl::DoCommandCompleteNotification(enum OMX_COMMANDTYPE, unsigned long) - ?DoTransitionCompleteNotification@XOmxILCallbackManagerIfImpl@@MAE?AW4OMX_ERRORTYPE@@W4OMX_STATETYPE@@@Z @ 15 NONAME ; enum OMX_ERRORTYPE XOmxILCallbackManagerIfImpl::DoTransitionCompleteNotification(enum OMX_STATETYPE) - ?SetTransitionToDisabled@COmxILPort@@UAEXXZ @ 16 NONAME ; void COmxILPort::SetTransitionToDisabled(void) - ?IsClockComponentAvailable@COmxILClientClockPort@@UBE?AW4OMX_BOOL@@XZ @ 17 NONAME ; enum OMX_BOOL COmxILClientClockPort::IsClockComponentAvailable(void) const - ?SymbianErrorToGetHandleError@COmxILComponent@@SA?AW4OMX_ERRORTYPE@@H@Z @ 18 NONAME ; enum OMX_ERRORTYPE COmxILComponent::SymbianErrorToGetHandleError(int) - ?SetConfig@COmxILPort@@UAE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PBXAAH@Z @ 19 NONAME ; enum OMX_ERRORTYPE COmxILPort::SetConfig(enum OMX_INDEXTYPE, void const *, int &) - ?GetParameter@COmxILPort@@UBE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PAX@Z @ 20 NONAME ; enum OMX_ERRORTYPE COmxILPort::GetParameter(enum OMX_INDEXTYPE, void *) const - ?SetPortManager@COmxILInContextCallbackManager@@UAEXAAVCOmxILPortManager@@@Z @ 21 NONAME ; void COmxILInContextCallbackManager::SetPortManager(class COmxILPortManager &) - ?GetLocalOmxConfigIndexes@COmxILPort@@UBE?AW4OMX_ERRORTYPE@@AAV?$RArray@I@@@Z @ 22 NONAME ; enum OMX_ERRORTYPE COmxILPort::GetLocalOmxConfigIndexes(class RArray &) const - ?GetWallTime@COmxILClientClockPort@@UBE?AW4OMX_ERRORTYPE@@AA_J@Z @ 23 NONAME ; enum OMX_ERRORTYPE COmxILClientClockPort::GetWallTime(long long &) const - ?SetBufferSent@COmxILPort@@UAEHPAUOMX_BUFFERHEADERTYPE@@AAH@Z @ 24 NONAME ; int COmxILPort::SetBufferSent(struct OMX_BUFFERHEADERTYPE *, int &) - ?ComponentRoleIndication@COmxILProcessingFunction@@UAE?AW4OMX_ERRORTYPE@@I@Z @ 25 NONAME ; enum OMX_ERRORTYPE COmxILProcessingFunction::ComponentRoleIndication(unsigned int) - ??0TOmxILCommonPortData@@QAE@TOMX_VERSIONTYPE@@KW4OMX_DIRTYPE@@KKW4OMX_PORTDOMAINTYPE@@W4OMX_BOOL@@KW4OMX_BUFFERSUPPLIERTYPE@@K@Z @ 26 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) - ?DoOmxUseBuffer@COmxILPort@@MAE?AW4OMX_ERRORTYPE@@PAXPAPAUOMX_BUFFERHEADERTYPE@@K00KPAE@Z @ 27 NONAME ; enum OMX_ERRORTYPE COmxILPort::DoOmxUseBuffer(void *, struct OMX_BUFFERHEADERTYPE * *, unsigned long, void *, void *, unsigned long, unsigned char *) - ?EventNotification@COmxILCallbackManager@@UAE?AW4OMX_ERRORTYPE@@W4OMX_EVENTTYPE@@KKPAD@Z @ 28 NONAME ; enum OMX_ERRORTYPE COmxILCallbackManager::EventNotification(enum OMX_EVENTTYPE, unsigned long, unsigned long, char *) - ?SetTransitionToEnabledCompleted@COmxILPort@@UAEXXZ @ 29 NONAME ; void COmxILPort::SetTransitionToEnabledCompleted(void) - ?GetConfig@COmxILConfigManager@@UBE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PAX@Z @ 30 NONAME ; enum OMX_ERRORTYPE COmxILConfigManager::GetConfig(enum OMX_INDEXTYPE, void *) const - ?SetParameter@COmxILConfigManager@@UAE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PBXW4OMX_BOOL@@@Z @ 31 NONAME ; enum OMX_ERRORTYPE COmxILConfigManager::SetParameter(enum OMX_INDEXTYPE, void const *, enum OMX_BOOL) - ?RegisterTunnelCallback@COmxILInContextCallbackManager@@UAE?AW4OMX_ERRORTYPE@@KW4OMX_DIRTYPE@@PAXK@Z @ 32 NONAME ; enum OMX_ERRORTYPE COmxILInContextCallbackManager::RegisterTunnelCallback(unsigned long, enum OMX_DIRTYPE, void *, unsigned long) - ?InitComponentL@COmxILComponent@@IAEXXZ @ 33 NONAME ; void COmxILComponent::InitComponentL(void) - ?RegisterComponentHandle@COmxILCallbackManager@@UAE?AW4OMX_ERRORTYPE@@PAX@Z @ 34 NONAME ; enum OMX_ERRORTYPE COmxILCallbackManager::RegisterComponentHandle(void *) - ?HandleInsufficientResources@XOmxILCallbackManagerIfImpl@@MAEXXZ @ 35 NONAME ; void XOmxILCallbackManagerIfImpl::HandleInsufficientResources(void) - ?DoRegisterILClientCallbacks@XOmxILCallbackManagerIfImpl@@MAE?AW4OMX_ERRORTYPE@@PBUOMX_CALLBACKTYPE@@PAX@Z @ 36 NONAME ; enum OMX_ERRORTYPE XOmxILCallbackManagerIfImpl::DoRegisterILClientCallbacks(struct OMX_CALLBACKTYPE const *, void *) - ?Compare@TBufferInfo@COmxILPort@@SAHABV12@0@Z @ 37 NONAME ; int COmxILPort::TBufferInfo::Compare(class COmxILPort::TBufferInfo const &, class COmxILPort::TBufferInfo const &) - ?RunL@COmxILCallbackManager@@UAEXXZ @ 38 NONAME ABSENT ; void COmxILCallbackManager::RunL(void) - ?SetParameter@COmxILVideoPort@@UAE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PBXAAH@Z @ 39 NONAME ; enum OMX_ERRORTYPE COmxILVideoPort::SetParameter(enum OMX_INDEXTYPE, void const *, int &) - ?RegisterBufferMarkPropagationPort@COmxILInContextCallbackManager@@UAE?AW4OMX_ERRORTYPE@@KK@Z @ 40 NONAME ; enum OMX_ERRORTYPE COmxILInContextCallbackManager::RegisterBufferMarkPropagationPort(unsigned long, unsigned long) - ?MediaTimeIndication@COmxILProcessingFunction@@UAE?AW4OMX_ERRORTYPE@@ABUOMX_TIME_MEDIATIMETYPE@@@Z @ 41 NONAME ; enum OMX_ERRORTYPE COmxILProcessingFunction::MediaTimeIndication(struct OMX_TIME_MEDIATIMETYPE const &) - ?StoreBufferMark@COmxILPort@@UAE?AW4OMX_ERRORTYPE@@PBUOMX_MARKTYPE@@@Z @ 42 NONAME ; enum OMX_ERRORTYPE COmxILPort::StoreBufferMark(struct OMX_MARKTYPE const *) - ?GetLocalOmxParamIndexes@COmxILAudioPort@@UBE?AW4OMX_ERRORTYPE@@AAV?$RArray@I@@@Z @ 43 NONAME ; enum OMX_ERRORTYPE COmxILAudioPort::GetLocalOmxParamIndexes(class RArray &) const - ??0COmxILPort@@IAE@ABVTOmxILCommonPortData@@@Z @ 44 NONAME ; COmxILPort::COmxILPort(class TOmxILCommonPortData const &) - ??1XOmxILCallbackManagerIfImpl@@MAE@XZ @ 45 NONAME ; XOmxILCallbackManagerIfImpl::~XOmxILCallbackManagerIfImpl(void) - ?RegisterBufferMarkPropagationPort@COmxILCallbackManager@@UAE?AW4OMX_ERRORTYPE@@KK@Z @ 46 NONAME ; enum OMX_ERRORTYPE COmxILCallbackManager::RegisterBufferMarkPropagationPort(unsigned long, unsigned long) - ??0COmxILImagePort@@IAE@ABVTOmxILCommonPortData@@ABV?$RArray@W4OMX_IMAGE_CODINGTYPE@@@@ABV?$RArray@W4OMX_COLOR_FORMATTYPE@@@@@Z @ 47 NONAME ; COmxILImagePort::COmxILImagePort(class TOmxILCommonPortData const &, class RArray const &, class RArray const &) - ?GetExtensionIndex@COmxILPort@@UBE?AW4OMX_ERRORTYPE@@PADPAW4OMX_INDEXTYPE@@@Z @ 48 NONAME ; enum OMX_ERRORTYPE COmxILPort::GetExtensionIndex(char *, enum OMX_INDEXTYPE *) const - ?NewL@COmxILCallbackManager@@SAPAV1@PAX0PAUOMX_CALLBACKTYPE@@@Z @ 49 NONAME ; class COmxILCallbackManager * COmxILCallbackManager::NewL(void *, void *, struct OMX_CALLBACKTYPE *) - ??1COmxILPort@@UAE@XZ @ 50 NONAME ; COmxILPort::~COmxILPort(void) - ?PortSettingsChangeNotification@COmxILCallbackManager@@UAE?AW4OMX_ERRORTYPE@@KIABVTDesC8@@@Z @ 51 NONAME ; enum OMX_ERRORTYPE COmxILCallbackManager::PortSettingsChangeNotification(unsigned long, unsigned int, class TDesC8 const &) - ??1COmxILVideoPort@@UAE@XZ @ 52 NONAME ; COmxILVideoPort::~COmxILVideoPort(void) - ?SetFsm@COmxILCallbackManager@@UAEXAAVCOmxILFsm@@@Z @ 53 NONAME ; void COmxILCallbackManager::SetFsm(class COmxILFsm &) - ?ErrorEventNotification@COmxILInContextCallbackManager@@UAE?AW4OMX_ERRORTYPE@@W42@@Z @ 54 NONAME ; enum OMX_ERRORTYPE COmxILInContextCallbackManager::ErrorEventNotification(enum OMX_ERRORTYPE) - ?SetStartTime@COmxILClientClockPort@@UBE?AW4OMX_ERRORTYPE@@_J@Z @ 55 NONAME ; enum OMX_ERRORTYPE COmxILClientClockPort::SetStartTime(long long) const - ?GetParameter@COmxILVideoPort@@UBE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PAX@Z @ 56 NONAME ; enum OMX_ERRORTYPE COmxILVideoPort::GetParameter(enum OMX_INDEXTYPE, void *) const - ?BufferDoneNotification@COmxILInContextCallbackManager@@UAE?AW4OMX_ERRORTYPE@@PAUOMX_BUFFERHEADERTYPE@@KW4OMX_DIRTYPE@@@Z @ 57 NONAME ; enum OMX_ERRORTYPE COmxILInContextCallbackManager::BufferDoneNotification(struct OMX_BUFFERHEADERTYPE *, unsigned long, enum OMX_DIRTYPE) - ?GetComponentVersion@COmxILConfigManager@@UBE?AW4OMX_ERRORTYPE@@PADPATOMX_VERSIONTYPE@@1PAY0IA@E@Z @ 58 NONAME ; enum OMX_ERRORTYPE COmxILConfigManager::GetComponentVersion(char *, union OMX_VERSIONTYPE *, union OMX_VERSIONTYPE *, unsigned char [128] *) const - ?DoEventNotification@XOmxILCallbackManagerIfImpl@@MAE?AW4OMX_ERRORTYPE@@W4OMX_EVENTTYPE@@KKPAD@Z @ 59 NONAME ; enum OMX_ERRORTYPE XOmxILCallbackManagerIfImpl::DoEventNotification(enum OMX_EVENTTYPE, unsigned long, unsigned long, char *) - ?DoCancel@COmxILCallbackManager@@UAEXXZ @ 60 NONAME ABSENT ; void COmxILCallbackManager::DoCancel(void) - ?SetParameter@COmxILOtherPort@@UAE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PBXAAH@Z @ 61 NONAME ; enum OMX_ERRORTYPE COmxILOtherPort::SetParameter(enum OMX_INDEXTYPE, void const *, int &) - ??1COmxILAudioPort@@UAE@XZ @ 62 NONAME ; COmxILAudioPort::~COmxILAudioPort(void) - ?RegisterComponentHandle@COmxILInContextCallbackManager@@UAE?AW4OMX_ERRORTYPE@@PAX@Z @ 63 NONAME ; enum OMX_ERRORTYPE COmxILInContextCallbackManager::RegisterComponentHandle(void *) - ?SetParameter@COmxILAudioPort@@UAE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PBXAAH@Z @ 64 NONAME ; enum OMX_ERRORTYPE COmxILAudioPort::SetParameter(enum OMX_INDEXTYPE, void const *, int &) - ?DoRegisterComponentHandle@XOmxILCallbackManagerIfImpl@@MAE?AW4OMX_ERRORTYPE@@PAX@Z @ 65 NONAME ; enum OMX_ERRORTYPE XOmxILCallbackManagerIfImpl::DoRegisterComponentHandle(void *) - ?PortSettingsChangeNotification@COmxILInContextCallbackManager@@UAE?AW4OMX_ERRORTYPE@@KIABVTDesC8@@@Z @ 66 NONAME ; enum OMX_ERRORTYPE COmxILInContextCallbackManager::PortSettingsChangeNotification(unsigned long, unsigned int, class TDesC8 const &) - ?SetVideoReference@COmxILClientClockPort@@UBE?AW4OMX_ERRORTYPE@@_J@Z @ 67 NONAME ; enum OMX_ERRORTYPE COmxILClientClockPort::SetVideoReference(long long) const - ?GetLocalOmxConfigIndexes@COmxILAudioPort@@UBE?AW4OMX_ERRORTYPE@@AAV?$RArray@I@@@Z @ 68 NONAME ; enum OMX_ERRORTYPE COmxILAudioPort::GetLocalOmxConfigIndexes(class RArray &) const - ??1COmxILConfigManager@@UAE@XZ @ 69 NONAME ; COmxILConfigManager::~COmxILConfigManager(void) - ?ConstructL@COmxILConfigManager@@IAEXABVTDesC8@@ABTOMX_VERSIONTYPE@@ABV?$RPointerArray@VTDesC8@@@@@Z @ 70 NONAME ; void COmxILConfigManager::ConstructL(class TDesC8 const &, union OMX_VERSIONTYPE const &, class RPointerArray const &) - ?RegisterILClientCallbacks@COmxILCallbackManager@@UAE?AW4OMX_ERRORTYPE@@PBUOMX_CALLBACKTYPE@@PAX@Z @ 71 NONAME ; enum OMX_ERRORTYPE COmxILCallbackManager::RegisterILClientCallbacks(struct OMX_CALLBACKTYPE const *, void *) - ?NewL@COmxILClientClockPort@@SAPAV1@ABVTOmxILCommonPortData@@ABV?$RArray@W4OMX_OTHER_FORMATTYPE@@@@@Z @ 72 NONAME ; class COmxILClientClockPort * COmxILClientClockPort::NewL(class TOmxILCommonPortData const &, class RArray const &) - ?GetExtensionIndex@COmxILConfigManager@@UBE?AW4OMX_ERRORTYPE@@PADPAW4OMX_INDEXTYPE@@@Z @ 73 NONAME ; enum OMX_ERRORTYPE COmxILConfigManager::GetExtensionIndex(char *, enum OMX_INDEXTYPE *) const - ?GetLocalOmxParamIndexes@COmxILVideoPort@@UBE?AW4OMX_ERRORTYPE@@AAV?$RArray@I@@@Z @ 74 NONAME ; enum OMX_ERRORTYPE COmxILVideoPort::GetLocalOmxParamIndexes(class RArray &) const - ?DoBufferAllocation@COmxILPort@@MAE?AW4OMX_ERRORTYPE@@KAAPAEAAPAX1PAX@Z @ 75 NONAME ; enum OMX_ERRORTYPE COmxILPort::DoBufferAllocation(unsigned long, unsigned char * &, void * &, void * &, void *) - ?EventNotification@COmxILInContextCallbackManager@@UAE?AW4OMX_ERRORTYPE@@W4OMX_EVENTTYPE@@KKPAD@Z @ 76 NONAME ; enum OMX_ERRORTYPE COmxILInContextCallbackManager::EventNotification(enum OMX_EVENTTYPE, unsigned long, unsigned long, char *) - ?GetClockState@COmxILClientClockPort@@UBE?AW4OMX_ERRORTYPE@@AAUOMX_TIME_CONFIG_CLOCKSTATETYPE@@@Z @ 77 NONAME ; enum OMX_ERRORTYPE COmxILClientClockPort::GetClockState(struct OMX_TIME_CONFIG_CLOCKSTATETYPE &) const - ??0COmxILComponent@@IAE@XZ @ 78 NONAME ; COmxILComponent::COmxILComponent(void) - ?DoSetPortManager@XOmxILCallbackManagerIfImpl@@MAEXAAVCOmxILPortManager@@@Z @ 79 NONAME ; void XOmxILCallbackManagerIfImpl::DoSetPortManager(class COmxILPortManager &) - ?FreeTunnel@COmxILPort@@UAE?AW4OMX_ERRORTYPE@@AAH@Z @ 80 NONAME ; enum OMX_ERRORTYPE COmxILPort::FreeTunnel(int &) - ?RegisterTunnelCallback@COmxILCallbackManager@@UAE?AW4OMX_ERRORTYPE@@KW4OMX_DIRTYPE@@PAXK@Z @ 81 NONAME ; enum OMX_ERRORTYPE COmxILCallbackManager::RegisterTunnelCallback(unsigned long, enum OMX_DIRTYPE, void *, unsigned long) - ?HasAllBuffersAtHome@COmxILPort@@UBEHXZ @ 82 NONAME ; int COmxILPort::HasAllBuffersAtHome(void) const - ?SetComponentRoleDefaults@COmxILPort@@UAE?AW4OMX_ERRORTYPE@@I@Z @ 83 NONAME ; enum OMX_ERRORTYPE COmxILPort::SetComponentRoleDefaults(unsigned int) - ?BufferDoneNotification@COmxILCallbackManager@@UAE?AW4OMX_ERRORTYPE@@PAUOMX_BUFFERHEADERTYPE@@KW4OMX_DIRTYPE@@@Z @ 84 NONAME ; enum OMX_ERRORTYPE COmxILCallbackManager::BufferDoneNotification(struct OMX_BUFFERHEADERTYPE *, unsigned long, enum OMX_DIRTYPE) - ?GetParameter@COmxILAudioPort@@UBE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PAX@Z @ 85 NONAME ; enum OMX_ERRORTYPE COmxILAudioPort::GetParameter(enum OMX_INDEXTYPE, void *) const - ?GetParameter@COmxILImagePort@@UBE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PAX@Z @ 86 NONAME ; enum OMX_ERRORTYPE COmxILImagePort::GetParameter(enum OMX_INDEXTYPE, void *) const - ?NewL@COmxILPortManager@@SAPAV1@AAVCOmxILProcessingFunction@@AAVMOmxILCallbackManagerIf@@ABTOMX_VERSIONTYPE@@KKKKKKKKW4OMX_BOOL@@@Z @ 87 NONAME ; class COmxILPortManager * COmxILPortManager::NewL(class COmxILProcessingFunction &, class MOmxILCallbackManagerIf &, union OMX_VERSIONTYPE const &, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, enum OMX_BOOL) - ?GetMediaTime@COmxILClientClockPort@@UBE?AW4OMX_ERRORTYPE@@AA_J@Z @ 88 NONAME ; enum OMX_ERRORTYPE COmxILClientClockPort::GetMediaTime(long long &) const - ?PopulateTunnel@COmxILPort@@UAE?AW4OMX_ERRORTYPE@@AAH@Z @ 89 NONAME ; enum OMX_ERRORTYPE COmxILPort::PopulateTunnel(int &) - ?AddPort@COmxILPortManager@@QAEHPBVCOmxILPort@@W4OMX_DIRTYPE@@@Z @ 90 NONAME ; int COmxILPortManager::AddPort(class COmxILPort const *, enum OMX_DIRTYPE) - ?GetLocalOmxParamIndexes@COmxILImagePort@@UBE?AW4OMX_ERRORTYPE@@AAV?$RArray@I@@@Z @ 91 NONAME ; enum OMX_ERRORTYPE COmxILImagePort::GetLocalOmxParamIndexes(class RArray &) const - ?SetAudioReference@COmxILClientClockPort@@UBE?AW4OMX_ERRORTYPE@@_J@Z @ 92 NONAME ; enum OMX_ERRORTYPE COmxILClientClockPort::SetAudioReference(long long) const - ?TransitionCompleteNotification@COmxILInContextCallbackManager@@UAE?AW4OMX_ERRORTYPE@@W4OMX_STATETYPE@@@Z @ 93 NONAME ; enum OMX_ERRORTYPE COmxILInContextCallbackManager::TransitionCompleteNotification(enum OMX_STATETYPE) - ?CommandCompleteNotification@COmxILInContextCallbackManager@@UAE?AW4OMX_ERRORTYPE@@W4OMX_COMMANDTYPE@@K@Z @ 94 NONAME ; enum OMX_ERRORTYPE COmxILInContextCallbackManager::CommandCompleteNotification(enum OMX_COMMANDTYPE, unsigned long) - ?CommandCompleteNotification@COmxILCallbackManager@@UAE?AW4OMX_ERRORTYPE@@W4OMX_COMMANDTYPE@@K@Z @ 95 NONAME ; enum OMX_ERRORTYPE COmxILCallbackManager::CommandCompleteNotification(enum OMX_COMMANDTYPE, unsigned long) - ?CheckOmxStructSizeAndVersion@TOmxILUtil@@SA?AW4OMX_ERRORTYPE@@PAXK@Z @ 96 NONAME ; enum OMX_ERRORTYPE TOmxILUtil::CheckOmxStructSizeAndVersion(void *, unsigned long) - ?IsBufferAtHome@COmxILPort@@UBEHPAUOMX_BUFFERHEADERTYPE@@@Z @ 97 NONAME ; int COmxILPort::IsBufferAtHome(struct OMX_BUFFERHEADERTYPE *) const - ?ConstructL@COmxILAudioPort@@MAEXABV?$RArray@W4OMX_AUDIO_CODINGTYPE@@@@@Z @ 98 NONAME ; void COmxILAudioPort::ConstructL(class RArray const &) - ?GetLocalOmxConfigIndexes@COmxILVideoPort@@UBE?AW4OMX_ERRORTYPE@@AAV?$RArray@I@@@Z @ 99 NONAME ; enum OMX_ERRORTYPE COmxILVideoPort::GetLocalOmxConfigIndexes(class RArray &) const - ?ClockBufferDoneNotification@COmxILInContextCallbackManager@@UAE?AW4OMX_ERRORTYPE@@PAUOMX_BUFFERHEADERTYPE@@KW4OMX_DIRTYPE@@@Z @ 100 NONAME ; enum OMX_ERRORTYPE COmxILInContextCallbackManager::ClockBufferDoneNotification(struct OMX_BUFFERHEADERTYPE *, unsigned long, enum OMX_DIRTYPE) - ??0COmxILProcessingFunction@@IAE@AAVMOmxILCallbackNotificationIf@@@Z @ 101 NONAME ; COmxILProcessingFunction::COmxILProcessingFunction(class MOmxILCallbackNotificationIf &) - ?DoPortReconfiguration@COmxILPort@@UAE?AW4OMX_ERRORTYPE@@IABVTDesC8@@AAW4OMX_EVENTTYPE@@@Z @ 102 NONAME ; enum OMX_ERRORTYPE COmxILPort::DoPortReconfiguration(unsigned int, class TDesC8 const &, enum OMX_EVENTTYPE &) - ?DoPortSettingsChangeNotification@XOmxILCallbackManagerIfImpl@@MAE?AW4OMX_ERRORTYPE@@KIABVTDesC8@@@Z @ 103 NONAME ; enum OMX_ERRORTYPE XOmxILCallbackManagerIfImpl::DoPortSettingsChangeNotification(unsigned long, unsigned int, class TDesC8 const &) - ?PopulateBuffer@COmxILPort@@UAE?AW4OMX_ERRORTYPE@@PAPAUOMX_BUFFERHEADERTYPE@@PAXKPAEAAH@Z @ 104 NONAME ; enum OMX_ERRORTYPE COmxILPort::PopulateBuffer(struct OMX_BUFFERHEADERTYPE * *, void *, unsigned long, unsigned char *, int &) - ??0COmxILVideoPort@@IAE@ABVTOmxILCommonPortData@@ABV?$RArray@W4OMX_VIDEO_CODINGTYPE@@@@ABV?$RArray@W4OMX_COLOR_FORMATTYPE@@@@@Z @ 105 NONAME ; COmxILVideoPort::COmxILVideoPort(class TOmxILCommonPortData const &, class RArray const &, class RArray const &) - ??1COmxILOtherPort@@UAE@XZ @ 106 NONAME ; COmxILOtherPort::~COmxILOtherPort(void) - ??1COmxILInContextCallbackManager@@UAE@XZ @ 107 NONAME ; COmxILInContextCallbackManager::~COmxILInContextCallbackManager(void) - ?GetLocalOmxParamIndexes@COmxILPort@@UBE?AW4OMX_ERRORTYPE@@AAV?$RArray@I@@@Z @ 108 NONAME ; enum OMX_ERRORTYPE COmxILPort::GetLocalOmxParamIndexes(class RArray &) const - ?CleanUpPort@COmxILPort@@IAEXXZ @ 109 NONAME ; void COmxILPort::CleanUpPort(void) - ?FreeBuffer@COmxILPort@@UAE?AW4OMX_ERRORTYPE@@PAUOMX_BUFFERHEADERTYPE@@AAH@Z @ 110 NONAME ; enum OMX_ERRORTYPE COmxILPort::FreeBuffer(struct OMX_BUFFERHEADERTYPE *, int &) - ?TunnelRequest@COmxILPort@@UAE?AW4OMX_ERRORTYPE@@PAXKPAUOMX_TUNNELSETUPTYPE@@@Z @ 111 NONAME ; enum OMX_ERRORTYPE COmxILPort::TunnelRequest(void *, unsigned long, struct OMX_TUNNELSETUPTYPE *) - ?GetParameter@COmxILConfigManager@@UBE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PAX@Z @ 112 NONAME ; enum OMX_ERRORTYPE COmxILConfigManager::GetParameter(enum OMX_INDEXTYPE, void *) const - ?SetFsm@COmxILInContextCallbackManager@@UAEXAAVCOmxILFsm@@@Z @ 113 NONAME ; void COmxILInContextCallbackManager::SetFsm(class COmxILFsm &) - ?ConstructL@COmxILOtherPort@@MAEXABV?$RArray@W4OMX_OTHER_FORMATTYPE@@@@@Z @ 114 NONAME ; void COmxILOtherPort::ConstructL(class RArray const &) - ?GetLocalOmxConfigIndexes@COmxILImagePort@@UBE?AW4OMX_ERRORTYPE@@AAV?$RArray@I@@@Z @ 115 NONAME ; enum OMX_ERRORTYPE COmxILImagePort::GetLocalOmxConfigIndexes(class RArray &) const - ?ClearBufferContents@TOmxILUtil@@SAXPAUOMX_BUFFERHEADERTYPE@@@Z @ 116 NONAME ; void TOmxILUtil::ClearBufferContents(struct OMX_BUFFERHEADERTYPE *) - ?SetParameter@COmxILImagePort@@UAE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PBXAAH@Z @ 117 NONAME ; enum OMX_ERRORTYPE COmxILImagePort::SetParameter(enum OMX_INDEXTYPE, void const *, int &) - ?DoBufferDoneNotification@XOmxILCallbackManagerIfImpl@@MAE?AW4OMX_ERRORTYPE@@PAUOMX_BUFFERHEADERTYPE@@KW4OMX_DIRTYPE@@@Z @ 118 NONAME ; enum OMX_ERRORTYPE XOmxILCallbackManagerIfImpl::DoBufferDoneNotification(struct OMX_BUFFERHEADERTYPE *, unsigned long, enum OMX_DIRTYPE) - ?GetLocalOmxParamIndexes@COmxILOtherPort@@UBE?AW4OMX_ERRORTYPE@@AAV?$RArray@I@@@Z @ 119 NONAME ; enum OMX_ERRORTYPE COmxILOtherPort::GetLocalOmxParamIndexes(class RArray &) const - ?TransitionCompleteNotification@COmxILCallbackManager@@UAE?AW4OMX_ERRORTYPE@@W4OMX_STATETYPE@@@Z @ 120 NONAME ; enum OMX_ERRORTYPE COmxILCallbackManager::TransitionCompleteNotification(enum OMX_STATETYPE) - ?BufferRemovalIndication@COmxILInContextCallbackManager@@UAEHPAUOMX_BUFFERHEADERTYPE@@W4OMX_DIRTYPE@@@Z @ 121 NONAME ; int COmxILInContextCallbackManager::BufferRemovalIndication(struct OMX_BUFFERHEADERTYPE *, enum OMX_DIRTYPE) - ?SignalOrPropagateBufferMarks@XOmxILCallbackManagerIfImpl@@MAEXPAUOMX_BUFFERHEADERTYPE@@K@Z @ 122 NONAME ; void XOmxILCallbackManagerIfImpl::SignalOrPropagateBufferMarks(struct OMX_BUFFERHEADERTYPE *, unsigned long) - ?DeregisterTunnelCallback@COmxILInContextCallbackManager@@UAE?AW4OMX_ERRORTYPE@@K@Z @ 123 NONAME ; enum OMX_ERRORTYPE COmxILInContextCallbackManager::DeregisterTunnelCallback(unsigned long) - ?DoBufferUnwrapping@COmxILPort@@MAEXPAX000@Z @ 124 NONAME ; void COmxILPort::DoBufferUnwrapping(void *, void *, void *, void *) - ?ComponentRoleEnum@COmxILConfigManager@@QBE?AW4OMX_ERRORTYPE@@PAEK@Z @ 125 NONAME ; enum OMX_ERRORTYPE COmxILConfigManager::ComponentRoleEnum(unsigned char *, unsigned long) const - ?DoRegisterBufferMarkPropagationPort@XOmxILCallbackManagerIfImpl@@MAE?AW4OMX_ERRORTYPE@@KK@Z @ 126 NONAME ; enum OMX_ERRORTYPE XOmxILCallbackManagerIfImpl::DoRegisterBufferMarkPropagationPort(unsigned long, unsigned long) - ??0COmxILOtherPort@@IAE@ABVTOmxILCommonPortData@@@Z @ 127 NONAME ; COmxILOtherPort::COmxILOtherPort(class TOmxILCommonPortData const &) - ?MediaTimeRequest@COmxILClientClockPort@@UBE?AW4OMX_ERRORTYPE@@PAX_J1@Z @ 128 NONAME ; enum OMX_ERRORTYPE COmxILClientClockPort::MediaTimeRequest(void *, long long, long long) const - ?GetConfig@COmxILPort@@UBE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PAX@Z @ 129 NONAME ; enum OMX_ERRORTYPE COmxILPort::GetConfig(enum OMX_INDEXTYPE, void *) const - ??0XOmxILCallbackManagerIfImpl@@IAE@PAX0PAUOMX_CALLBACKTYPE@@@Z @ 130 NONAME ; XOmxILCallbackManagerIfImpl::XOmxILCallbackManagerIfImpl(void *, void *, struct OMX_CALLBACKTYPE *) - ??0COmxILAudioPort@@IAE@ABVTOmxILCommonPortData@@@Z @ 131 NONAME ; COmxILAudioPort::COmxILAudioPort(class TOmxILCommonPortData const &) - ?DoErrorEventNotification@XOmxILCallbackManagerIfImpl@@MAE?AW4OMX_ERRORTYPE@@W42@@Z @ 132 NONAME ; enum OMX_ERRORTYPE XOmxILCallbackManagerIfImpl::DoErrorEventNotification(enum OMX_ERRORTYPE) - ?DeregisterTunnelCallback@COmxILCallbackManager@@UAE?AW4OMX_ERRORTYPE@@K@Z @ 133 NONAME ; enum OMX_ERRORTYPE COmxILCallbackManager::DeregisterTunnelCallback(unsigned long) - ??1COmxILProcessingFunction@@UAE@XZ @ 134 NONAME ; COmxILProcessingFunction::~COmxILProcessingFunction(void) - ?NewL@COmxILConfigManager@@SAPAV1@AAVCOmxILPortManager@@ABVTDesC8@@ABTOMX_VERSIONTYPE@@ABV?$RPointerArray@VTDesC8@@@@@Z @ 135 NONAME ; class COmxILConfigManager * COmxILConfigManager::NewL(class COmxILPortManager &, class TDesC8 const &, union OMX_VERSIONTYPE const &, class RPointerArray const &) - ?NewL@COmxILInContextCallbackManager@@SAPAV1@PAX0PAUOMX_CALLBACKTYPE@@@Z @ 136 NONAME ; class COmxILInContextCallbackManager * COmxILInContextCallbackManager::NewL(void *, void *, struct OMX_CALLBACKTYPE *) - ?SetParameter@COmxILPort@@UAE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PBXAAH@Z @ 137 NONAME ; enum OMX_ERRORTYPE COmxILPort::SetParameter(enum OMX_INDEXTYPE, void const *, int &) - ?SetTransitionToEnabled@COmxILPort@@UAEXXZ @ 138 NONAME ; void COmxILPort::SetTransitionToEnabled(void) - ??1COmxILComponent@@UAE@XZ @ 139 NONAME ; COmxILComponent::~COmxILComponent(void) - ?DoBufferWrapping@COmxILPort@@MAE?AW4OMX_ERRORTYPE@@KPAEAAPAX1PAX@Z @ 140 NONAME ; enum OMX_ERRORTYPE COmxILPort::DoBufferWrapping(unsigned long, unsigned char *, void * &, void * &, void *) - ?BufferRemovalIndication@COmxILCallbackManager@@UAEHPAUOMX_BUFFERHEADERTYPE@@W4OMX_DIRTYPE@@@Z @ 141 NONAME ; int COmxILCallbackManager::BufferRemovalIndication(struct OMX_BUFFERHEADERTYPE *, enum OMX_DIRTYPE) - ?ErrorEventNotification@COmxILCallbackManager@@UAE?AW4OMX_ERRORTYPE@@W42@@Z @ 142 NONAME ; enum OMX_ERRORTYPE COmxILCallbackManager::ErrorEventNotification(enum OMX_ERRORTYPE) - ?SetBufferReturned@COmxILPort@@UAEHPAUOMX_BUFFERHEADERTYPE@@@Z @ 143 NONAME ; int COmxILPort::SetBufferReturned(struct OMX_BUFFERHEADERTYPE *) - ?DoBufferDeallocation@COmxILPort@@MAEXPAX000@Z @ 144 NONAME ; void COmxILPort::DoBufferDeallocation(void *, void *, void *, void *) - ?GetLocalOmxConfigIndexes@COmxILOtherPort@@UBE?AW4OMX_ERRORTYPE@@AAV?$RArray@I@@@Z @ 145 NONAME ; enum OMX_ERRORTYPE COmxILOtherPort::GetLocalOmxConfigIndexes(class RArray &) const - +EXPORTS + ?DoSetFsm@XOmxILCallbackManagerIfImpl@@MAEXAAVCOmxILFsm@@@Z @ 1 NONAME ; void XOmxILCallbackManagerIfImpl::DoSetFsm(class COmxILFsm &) + ?DoRegisterTunnelCallback@XOmxILCallbackManagerIfImpl@@MAE?AW4OMX_ERRORTYPE@@KW4OMX_DIRTYPE@@PAXK@Z @ 2 NONAME ; enum OMX_ERRORTYPE XOmxILCallbackManagerIfImpl::DoRegisterTunnelCallback(unsigned long, enum OMX_DIRTYPE, void *, unsigned long) + ?SetConfig@COmxILConfigManager@@UAE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PBX@Z @ 3 NONAME ; enum OMX_ERRORTYPE COmxILConfigManager::SetConfig(enum OMX_INDEXTYPE, void const *) + ??0COmxILConfigManager@@IAE@AAVMOmxILPortManagerIf@@@Z @ 4 NONAME ; COmxILConfigManager::COmxILConfigManager(class MOmxILPortManagerIf &) + ?SetTransitionToDisabledCompleted@COmxILPort@@UAEXXZ @ 5 NONAME ; void COmxILPort::SetTransitionToDisabledCompleted(void) + ?GetParameter@COmxILOtherPort@@UBE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PAX@Z @ 6 NONAME ; enum OMX_ERRORTYPE COmxILOtherPort::GetParameter(enum OMX_INDEXTYPE, void *) const + ??1COmxILImagePort@@UAE@XZ @ 7 NONAME ; COmxILImagePort::~COmxILImagePort(void) + ?StoreBufferMark@COmxILPort@@IAE?AW4OMX_ERRORTYPE@@AAPAX0@Z @ 8 NONAME ; enum OMX_ERRORTYPE COmxILPort::StoreBufferMark(void * &, void * &) + ??1COmxILCallbackManager@@UAE@XZ @ 9 NONAME ; COmxILCallbackManager::~COmxILCallbackManager(void) + ?ClockBufferDoneNotification@COmxILCallbackManager@@UAE?AW4OMX_ERRORTYPE@@PAUOMX_BUFFERHEADERTYPE@@KW4OMX_DIRTYPE@@@Z @ 10 NONAME ; enum OMX_ERRORTYPE COmxILCallbackManager::ClockBufferDoneNotification(struct OMX_BUFFERHEADERTYPE *, unsigned long, enum OMX_DIRTYPE) + ?RegisterILClientCallbacks@COmxILInContextCallbackManager@@UAE?AW4OMX_ERRORTYPE@@PBUOMX_CALLBACKTYPE@@PAX@Z @ 11 NONAME ; enum OMX_ERRORTYPE COmxILInContextCallbackManager::RegisterILClientCallbacks(struct OMX_CALLBACKTYPE const *, void *) + ?DoCommandCompleteNotification@XOmxILCallbackManagerIfImpl@@MAE?AW4OMX_ERRORTYPE@@W4OMX_COMMANDTYPE@@K@Z @ 12 NONAME ; enum OMX_ERRORTYPE XOmxILCallbackManagerIfImpl::DoCommandCompleteNotification(enum OMX_COMMANDTYPE, unsigned long) + ?DoTransitionCompleteNotification@XOmxILCallbackManagerIfImpl@@MAE?AW4OMX_ERRORTYPE@@W4OMX_STATETYPE@@@Z @ 13 NONAME ; enum OMX_ERRORTYPE XOmxILCallbackManagerIfImpl::DoTransitionCompleteNotification(enum OMX_STATETYPE) + ?SetTransitionToDisabled@COmxILPort@@UAEXXZ @ 14 NONAME ; void COmxILPort::SetTransitionToDisabled(void) + ?SymbianErrorToGetHandleError@COmxILComponent@@SA?AW4OMX_ERRORTYPE@@H@Z @ 15 NONAME ; enum OMX_ERRORTYPE COmxILComponent::SymbianErrorToGetHandleError(int) + ?SetConfig@COmxILPort@@UAE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PBXAAH@Z @ 16 NONAME ; enum OMX_ERRORTYPE COmxILPort::SetConfig(enum OMX_INDEXTYPE, void const *, int &) + ?GetParameter@COmxILPort@@UBE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PAX@Z @ 17 NONAME ; enum OMX_ERRORTYPE COmxILPort::GetParameter(enum OMX_INDEXTYPE, void *) const + ?GetLocalOmxConfigIndexes@COmxILPort@@UBE?AW4OMX_ERRORTYPE@@AAV?$RArray@I@@@Z @ 18 NONAME ; enum OMX_ERRORTYPE COmxILPort::GetLocalOmxConfigIndexes(class RArray &) const + ?SetBufferSent@COmxILPort@@UAEHPAUOMX_BUFFERHEADERTYPE@@AAH@Z @ 19 NONAME ; int COmxILPort::SetBufferSent(struct OMX_BUFFERHEADERTYPE *, int &) + ?ComponentRoleIndication@COmxILProcessingFunction@@UAE?AW4OMX_ERRORTYPE@@I@Z @ 20 NONAME ; enum OMX_ERRORTYPE COmxILProcessingFunction::ComponentRoleIndication(unsigned int) + ?AddPort@COmxILPortManager@@UAEHPBVCOmxILPort@@W4OMX_DIRTYPE@@@Z @ 21 NONAME ; int COmxILPortManager::AddPort(class COmxILPort const *, enum OMX_DIRTYPE) + ??0TOmxILCommonPortData@@QAE@TOMX_VERSIONTYPE@@KW4OMX_DIRTYPE@@KKW4OMX_PORTDOMAINTYPE@@W4OMX_BOOL@@KW4OMX_BUFFERSUPPLIERTYPE@@K@Z @ 22 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) + ?DoOmxUseBuffer@COmxILPort@@MAE?AW4OMX_ERRORTYPE@@PAXPAPAUOMX_BUFFERHEADERTYPE@@K00KPAE@Z @ 23 NONAME ; enum OMX_ERRORTYPE COmxILPort::DoOmxUseBuffer(void *, struct OMX_BUFFERHEADERTYPE * *, unsigned long, void *, void *, unsigned long, unsigned char *) + ?EventNotification@COmxILCallbackManager@@UAE?AW4OMX_ERRORTYPE@@W4OMX_EVENTTYPE@@KKPAD@Z @ 24 NONAME ; enum OMX_ERRORTYPE COmxILCallbackManager::EventNotification(enum OMX_EVENTTYPE, unsigned long, unsigned long, char *) + ?SetTransitionToEnabledCompleted@COmxILPort@@UAEXXZ @ 25 NONAME ; void COmxILPort::SetTransitionToEnabledCompleted(void) + ?GetConfig@COmxILConfigManager@@UBE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PAX@Z @ 26 NONAME ; enum OMX_ERRORTYPE COmxILConfigManager::GetConfig(enum OMX_INDEXTYPE, void *) const + ?SetParameter@COmxILConfigManager@@UAE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PBXW4OMX_BOOL@@@Z @ 27 NONAME ; enum OMX_ERRORTYPE COmxILConfigManager::SetParameter(enum OMX_INDEXTYPE, void const *, enum OMX_BOOL) + ?RegisterTunnelCallback@COmxILInContextCallbackManager@@UAE?AW4OMX_ERRORTYPE@@KW4OMX_DIRTYPE@@PAXK@Z @ 28 NONAME ; enum OMX_ERRORTYPE COmxILInContextCallbackManager::RegisterTunnelCallback(unsigned long, enum OMX_DIRTYPE, void *, unsigned long) + ?InitComponentL@COmxILComponent@@IAEXXZ @ 29 NONAME ; void COmxILComponent::InitComponentL(void) + ?RegisterComponentHandle@COmxILCallbackManager@@UAE?AW4OMX_ERRORTYPE@@PAX@Z @ 30 NONAME ; enum OMX_ERRORTYPE COmxILCallbackManager::RegisterComponentHandle(void *) + ?HandleInsufficientResources@XOmxILCallbackManagerIfImpl@@MAEXXZ @ 31 NONAME ; void XOmxILCallbackManagerIfImpl::HandleInsufficientResources(void) + ?DoRegisterILClientCallbacks@XOmxILCallbackManagerIfImpl@@MAE?AW4OMX_ERRORTYPE@@PBUOMX_CALLBACKTYPE@@PAX@Z @ 32 NONAME ; enum OMX_ERRORTYPE XOmxILCallbackManagerIfImpl::DoRegisterILClientCallbacks(struct OMX_CALLBACKTYPE const *, void *) + ?Compare@TBufferInfo@COmxILPort@@SAHABV12@0@Z @ 33 NONAME ; int COmxILPort::TBufferInfo::Compare(class COmxILPort::TBufferInfo const &, class COmxILPort::TBufferInfo const &) + ?SetParameter@COmxILVideoPort@@UAE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PBXAAH@Z @ 34 NONAME ; enum OMX_ERRORTYPE COmxILVideoPort::SetParameter(enum OMX_INDEXTYPE, void const *, int &) + ?RegisterBufferMarkPropagationPort@COmxILInContextCallbackManager@@UAE?AW4OMX_ERRORTYPE@@KK@Z @ 35 NONAME ; enum OMX_ERRORTYPE COmxILInContextCallbackManager::RegisterBufferMarkPropagationPort(unsigned long, unsigned long) + ?MediaTimeIndication@COmxILProcessingFunction@@UAE?AW4OMX_ERRORTYPE@@ABUOMX_TIME_MEDIATIMETYPE@@@Z @ 36 NONAME ; enum OMX_ERRORTYPE COmxILProcessingFunction::MediaTimeIndication(struct OMX_TIME_MEDIATIMETYPE const &) + ?StoreBufferMark@COmxILPort@@UAE?AW4OMX_ERRORTYPE@@PBUOMX_MARKTYPE@@@Z @ 37 NONAME ; enum OMX_ERRORTYPE COmxILPort::StoreBufferMark(struct OMX_MARKTYPE const *) + ?GetLocalOmxParamIndexes@COmxILAudioPort@@UBE?AW4OMX_ERRORTYPE@@AAV?$RArray@I@@@Z @ 38 NONAME ; enum OMX_ERRORTYPE COmxILAudioPort::GetLocalOmxParamIndexes(class RArray &) const + ??0COmxILPort@@IAE@ABVTOmxILCommonPortData@@@Z @ 39 NONAME ; COmxILPort::COmxILPort(class TOmxILCommonPortData const &) + ??1XOmxILCallbackManagerIfImpl@@MAE@XZ @ 40 NONAME ; XOmxILCallbackManagerIfImpl::~XOmxILCallbackManagerIfImpl(void) + ?RegisterBufferMarkPropagationPort@COmxILCallbackManager@@UAE?AW4OMX_ERRORTYPE@@KK@Z @ 41 NONAME ; enum OMX_ERRORTYPE COmxILCallbackManager::RegisterBufferMarkPropagationPort(unsigned long, unsigned long) + ??0COmxILImagePort@@IAE@ABVTOmxILCommonPortData@@ABV?$RArray@W4OMX_IMAGE_CODINGTYPE@@@@ABV?$RArray@W4OMX_COLOR_FORMATTYPE@@@@@Z @ 42 NONAME ; COmxILImagePort::COmxILImagePort(class TOmxILCommonPortData const &, class RArray const &, class RArray const &) + ?GetExtensionIndex@COmxILPort@@UBE?AW4OMX_ERRORTYPE@@PADPAW4OMX_INDEXTYPE@@@Z @ 43 NONAME ; enum OMX_ERRORTYPE COmxILPort::GetExtensionIndex(char *, enum OMX_INDEXTYPE *) const + ?NewL@COmxILCallbackManager@@SAPAV1@PAX0PAUOMX_CALLBACKTYPE@@@Z @ 44 NONAME ; class COmxILCallbackManager * COmxILCallbackManager::NewL(void *, void *, struct OMX_CALLBACKTYPE *) + ??1COmxILPort@@UAE@XZ @ 45 NONAME ; COmxILPort::~COmxILPort(void) + ?PortSettingsChangeNotification@COmxILCallbackManager@@UAE?AW4OMX_ERRORTYPE@@KIABVTDesC8@@@Z @ 46 NONAME ; enum OMX_ERRORTYPE COmxILCallbackManager::PortSettingsChangeNotification(unsigned long, unsigned int, class TDesC8 const &) + ?NewL@COmxILFsm@@SAPAV1@AAVCOmxILComponent@@AAVCOmxILProcessingFunction@@AAVMOmxILPortManagerIf@@AAVCOmxILConfigManager@@AAVMOmxILCallbackManagerIf@@@Z @ 47 NONAME ; class COmxILFsm * COmxILFsm::NewL(class COmxILComponent &, class COmxILProcessingFunction &, class MOmxILPortManagerIf &, class COmxILConfigManager &, class MOmxILCallbackManagerIf &) + ??1COmxILVideoPort@@UAE@XZ @ 48 NONAME ; COmxILVideoPort::~COmxILVideoPort(void) + ?SetFsm@COmxILCallbackManager@@UAEXAAVCOmxILFsm@@@Z @ 49 NONAME ; void COmxILCallbackManager::SetFsm(class COmxILFsm &) + ?ErrorEventNotification@COmxILInContextCallbackManager@@UAE?AW4OMX_ERRORTYPE@@W42@@Z @ 50 NONAME ; enum OMX_ERRORTYPE COmxILInContextCallbackManager::ErrorEventNotification(enum OMX_ERRORTYPE) + ?GetParameter@COmxILVideoPort@@UBE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PAX@Z @ 51 NONAME ; enum OMX_ERRORTYPE COmxILVideoPort::GetParameter(enum OMX_INDEXTYPE, void *) const + ?BufferDoneNotification@COmxILInContextCallbackManager@@UAE?AW4OMX_ERRORTYPE@@PAUOMX_BUFFERHEADERTYPE@@KW4OMX_DIRTYPE@@@Z @ 52 NONAME ; enum OMX_ERRORTYPE COmxILInContextCallbackManager::BufferDoneNotification(struct OMX_BUFFERHEADERTYPE *, unsigned long, enum OMX_DIRTYPE) + ?GetComponentVersion@COmxILConfigManager@@UBE?AW4OMX_ERRORTYPE@@PADPATOMX_VERSIONTYPE@@1PAY0IA@E@Z @ 53 NONAME ; enum OMX_ERRORTYPE COmxILConfigManager::GetComponentVersion(char *, union OMX_VERSIONTYPE *, union OMX_VERSIONTYPE *, unsigned char [128] *) const + ?DoEventNotification@XOmxILCallbackManagerIfImpl@@MAE?AW4OMX_ERRORTYPE@@W4OMX_EVENTTYPE@@KKPAD@Z @ 54 NONAME ; enum OMX_ERRORTYPE XOmxILCallbackManagerIfImpl::DoEventNotification(enum OMX_EVENTTYPE, unsigned long, unsigned long, char *) + ?SetParameter@COmxILOtherPort@@UAE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PBXAAH@Z @ 55 NONAME ; enum OMX_ERRORTYPE COmxILOtherPort::SetParameter(enum OMX_INDEXTYPE, void const *, int &) + ??1COmxILAudioPort@@UAE@XZ @ 56 NONAME ; COmxILAudioPort::~COmxILAudioPort(void) + ?RegisterComponentHandle@COmxILInContextCallbackManager@@UAE?AW4OMX_ERRORTYPE@@PAX@Z @ 57 NONAME ; enum OMX_ERRORTYPE COmxILInContextCallbackManager::RegisterComponentHandle(void *) + ?SetParameter@COmxILAudioPort@@UAE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PBXAAH@Z @ 58 NONAME ; enum OMX_ERRORTYPE COmxILAudioPort::SetParameter(enum OMX_INDEXTYPE, void const *, int &) + ?DoRegisterComponentHandle@XOmxILCallbackManagerIfImpl@@MAE?AW4OMX_ERRORTYPE@@PAX@Z @ 59 NONAME ; enum OMX_ERRORTYPE XOmxILCallbackManagerIfImpl::DoRegisterComponentHandle(void *) + ?PortSettingsChangeNotification@COmxILInContextCallbackManager@@UAE?AW4OMX_ERRORTYPE@@KIABVTDesC8@@@Z @ 60 NONAME ; enum OMX_ERRORTYPE COmxILInContextCallbackManager::PortSettingsChangeNotification(unsigned long, unsigned int, class TDesC8 const &) + ?GetLocalOmxConfigIndexes@COmxILAudioPort@@UBE?AW4OMX_ERRORTYPE@@AAV?$RArray@I@@@Z @ 61 NONAME ; enum OMX_ERRORTYPE COmxILAudioPort::GetLocalOmxConfigIndexes(class RArray &) const + ??1COmxILConfigManager@@UAE@XZ @ 62 NONAME ; COmxILConfigManager::~COmxILConfigManager(void) + ?ConstructL@COmxILConfigManager@@IAEXABVTDesC8@@ABTOMX_VERSIONTYPE@@ABV?$RPointerArray@VTDesC8@@@@@Z @ 63 NONAME ; void COmxILConfigManager::ConstructL(class TDesC8 const &, union OMX_VERSIONTYPE const &, class RPointerArray const &) + ?RegisterILClientCallbacks@COmxILCallbackManager@@UAE?AW4OMX_ERRORTYPE@@PBUOMX_CALLBACKTYPE@@PAX@Z @ 64 NONAME ; enum OMX_ERRORTYPE COmxILCallbackManager::RegisterILClientCallbacks(struct OMX_CALLBACKTYPE const *, void *) + ?NewL@COmxILClientClockPort@@SAPAV1@ABVTOmxILCommonPortData@@ABV?$RArray@W4OMX_OTHER_FORMATTYPE@@@@@Z @ 65 NONAME ; class COmxILClientClockPort * COmxILClientClockPort::NewL(class TOmxILCommonPortData const &, class RArray const &) + ?NewL@COmxILConfigManager@@SAPAV1@AAVMOmxILPortManagerIf@@ABVTDesC8@@ABTOMX_VERSIONTYPE@@ABV?$RPointerArray@VTDesC8@@@@@Z @ 66 NONAME ; class COmxILConfigManager * COmxILConfigManager::NewL(class MOmxILPortManagerIf &, class TDesC8 const &, union OMX_VERSIONTYPE const &, class RPointerArray const &) + ?GetExtensionIndex@COmxILConfigManager@@UBE?AW4OMX_ERRORTYPE@@PADPAW4OMX_INDEXTYPE@@@Z @ 67 NONAME ; enum OMX_ERRORTYPE COmxILConfigManager::GetExtensionIndex(char *, enum OMX_INDEXTYPE *) const + ?GetLocalOmxParamIndexes@COmxILVideoPort@@UBE?AW4OMX_ERRORTYPE@@AAV?$RArray@I@@@Z @ 68 NONAME ; enum OMX_ERRORTYPE COmxILVideoPort::GetLocalOmxParamIndexes(class RArray &) const + ?DoBufferAllocation@COmxILPort@@MAE?AW4OMX_ERRORTYPE@@KAAPAEAAPAX1PAX@Z @ 69 NONAME ; enum OMX_ERRORTYPE COmxILPort::DoBufferAllocation(unsigned long, unsigned char * &, void * &, void * &, void *) + ?EventNotification@COmxILInContextCallbackManager@@UAE?AW4OMX_ERRORTYPE@@W4OMX_EVENTTYPE@@KKPAD@Z @ 70 NONAME ; enum OMX_ERRORTYPE COmxILInContextCallbackManager::EventNotification(enum OMX_EVENTTYPE, unsigned long, unsigned long, char *) + ??0COmxILComponent@@IAE@XZ @ 71 NONAME ; COmxILComponent::COmxILComponent(void) + ?SetPortManager@COmxILInContextCallbackManager@@UAEXAAVMOmxILPortManagerIf@@@Z @ 72 NONAME ; void COmxILInContextCallbackManager::SetPortManager(class MOmxILPortManagerIf &) + ?FreeTunnel@COmxILPort@@UAE?AW4OMX_ERRORTYPE@@AAH@Z @ 73 NONAME ; enum OMX_ERRORTYPE COmxILPort::FreeTunnel(int &) + ?RegisterTunnelCallback@COmxILCallbackManager@@UAE?AW4OMX_ERRORTYPE@@KW4OMX_DIRTYPE@@PAXK@Z @ 74 NONAME ; enum OMX_ERRORTYPE COmxILCallbackManager::RegisterTunnelCallback(unsigned long, enum OMX_DIRTYPE, void *, unsigned long) + ?HasAllBuffersAtHome@COmxILPort@@UBEHXZ @ 75 NONAME ; int COmxILPort::HasAllBuffersAtHome(void) const + ?SetComponentRoleDefaults@COmxILPort@@UAE?AW4OMX_ERRORTYPE@@I@Z @ 76 NONAME ; enum OMX_ERRORTYPE COmxILPort::SetComponentRoleDefaults(unsigned int) + ?BufferDoneNotification@COmxILCallbackManager@@UAE?AW4OMX_ERRORTYPE@@PAUOMX_BUFFERHEADERTYPE@@KW4OMX_DIRTYPE@@@Z @ 77 NONAME ; enum OMX_ERRORTYPE COmxILCallbackManager::BufferDoneNotification(struct OMX_BUFFERHEADERTYPE *, unsigned long, enum OMX_DIRTYPE) + ?GetParameter@COmxILAudioPort@@UBE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PAX@Z @ 78 NONAME ; enum OMX_ERRORTYPE COmxILAudioPort::GetParameter(enum OMX_INDEXTYPE, void *) const + ?DoSetPortManager@XOmxILCallbackManagerIfImpl@@MAEXAAVMOmxILPortManagerIf@@@Z @ 79 NONAME ; void XOmxILCallbackManagerIfImpl::DoSetPortManager(class MOmxILPortManagerIf &) + ?GetParameter@COmxILImagePort@@UBE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PAX@Z @ 80 NONAME ; enum OMX_ERRORTYPE COmxILImagePort::GetParameter(enum OMX_INDEXTYPE, void *) const + ?NewL@COmxILPortManager@@SAPAV1@AAVCOmxILProcessingFunction@@AAVMOmxILCallbackManagerIf@@ABTOMX_VERSIONTYPE@@KKKKKKKKW4OMX_BOOL@@@Z @ 81 NONAME ; class COmxILPortManager * COmxILPortManager::NewL(class COmxILProcessingFunction &, class MOmxILCallbackManagerIf &, union OMX_VERSIONTYPE const &, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, enum OMX_BOOL) + ?PopulateTunnel@COmxILPort@@UAE?AW4OMX_ERRORTYPE@@AAH@Z @ 82 NONAME ; enum OMX_ERRORTYPE COmxILPort::PopulateTunnel(int &) + ?GetLocalOmxParamIndexes@COmxILImagePort@@UBE?AW4OMX_ERRORTYPE@@AAV?$RArray@I@@@Z @ 83 NONAME ; enum OMX_ERRORTYPE COmxILImagePort::GetLocalOmxParamIndexes(class RArray &) const + ?TransitionCompleteNotification@COmxILInContextCallbackManager@@UAE?AW4OMX_ERRORTYPE@@W4OMX_STATETYPE@@@Z @ 84 NONAME ; enum OMX_ERRORTYPE COmxILInContextCallbackManager::TransitionCompleteNotification(enum OMX_STATETYPE) + ?CommandCompleteNotification@COmxILInContextCallbackManager@@UAE?AW4OMX_ERRORTYPE@@W4OMX_COMMANDTYPE@@K@Z @ 85 NONAME ; enum OMX_ERRORTYPE COmxILInContextCallbackManager::CommandCompleteNotification(enum OMX_COMMANDTYPE, unsigned long) + ?SetPortManager@COmxILCallbackManager@@UAEXAAVMOmxILPortManagerIf@@@Z @ 86 NONAME ; void COmxILCallbackManager::SetPortManager(class MOmxILPortManagerIf &) + ?CommandCompleteNotification@COmxILCallbackManager@@UAE?AW4OMX_ERRORTYPE@@W4OMX_COMMANDTYPE@@K@Z @ 87 NONAME ; enum OMX_ERRORTYPE COmxILCallbackManager::CommandCompleteNotification(enum OMX_COMMANDTYPE, unsigned long) + ?CheckOmxStructSizeAndVersion@TOmxILUtil@@SA?AW4OMX_ERRORTYPE@@PAXK@Z @ 88 NONAME ; enum OMX_ERRORTYPE TOmxILUtil::CheckOmxStructSizeAndVersion(void *, unsigned long) + ?IsBufferAtHome@COmxILPort@@UBEHPAUOMX_BUFFERHEADERTYPE@@@Z @ 89 NONAME ; int COmxILPort::IsBufferAtHome(struct OMX_BUFFERHEADERTYPE *) const + ?ConstructL@COmxILAudioPort@@MAEXABV?$RArray@W4OMX_AUDIO_CODINGTYPE@@@@@Z @ 90 NONAME ; void COmxILAudioPort::ConstructL(class RArray const &) + ?GetLocalOmxConfigIndexes@COmxILVideoPort@@UBE?AW4OMX_ERRORTYPE@@AAV?$RArray@I@@@Z @ 91 NONAME ; enum OMX_ERRORTYPE COmxILVideoPort::GetLocalOmxConfigIndexes(class RArray &) const + ?ClockBufferDoneNotification@COmxILInContextCallbackManager@@UAE?AW4OMX_ERRORTYPE@@PAUOMX_BUFFERHEADERTYPE@@KW4OMX_DIRTYPE@@@Z @ 92 NONAME ; enum OMX_ERRORTYPE COmxILInContextCallbackManager::ClockBufferDoneNotification(struct OMX_BUFFERHEADERTYPE *, unsigned long, enum OMX_DIRTYPE) + ??0COmxILProcessingFunction@@IAE@AAVMOmxILCallbackNotificationIf@@@Z @ 93 NONAME ; COmxILProcessingFunction::COmxILProcessingFunction(class MOmxILCallbackNotificationIf &) + ?DoPortReconfiguration@COmxILPort@@UAE?AW4OMX_ERRORTYPE@@IABVTDesC8@@AAW4OMX_EVENTTYPE@@@Z @ 94 NONAME ; enum OMX_ERRORTYPE COmxILPort::DoPortReconfiguration(unsigned int, class TDesC8 const &, enum OMX_EVENTTYPE &) + ?DoPortSettingsChangeNotification@XOmxILCallbackManagerIfImpl@@MAE?AW4OMX_ERRORTYPE@@KIABVTDesC8@@@Z @ 95 NONAME ; enum OMX_ERRORTYPE XOmxILCallbackManagerIfImpl::DoPortSettingsChangeNotification(unsigned long, unsigned int, class TDesC8 const &) + ?PopulateBuffer@COmxILPort@@UAE?AW4OMX_ERRORTYPE@@PAPAUOMX_BUFFERHEADERTYPE@@PAXKPAEAAH@Z @ 96 NONAME ; enum OMX_ERRORTYPE COmxILPort::PopulateBuffer(struct OMX_BUFFERHEADERTYPE * *, void *, unsigned long, unsigned char *, int &) + ??0COmxILVideoPort@@IAE@ABVTOmxILCommonPortData@@ABV?$RArray@W4OMX_VIDEO_CODINGTYPE@@@@ABV?$RArray@W4OMX_COLOR_FORMATTYPE@@@@@Z @ 97 NONAME ; COmxILVideoPort::COmxILVideoPort(class TOmxILCommonPortData const &, class RArray const &, class RArray const &) + ??1COmxILOtherPort@@UAE@XZ @ 98 NONAME ; COmxILOtherPort::~COmxILOtherPort(void) + ??1COmxILInContextCallbackManager@@UAE@XZ @ 99 NONAME ; COmxILInContextCallbackManager::~COmxILInContextCallbackManager(void) + ?GetLocalOmxParamIndexes@COmxILPort@@UBE?AW4OMX_ERRORTYPE@@AAV?$RArray@I@@@Z @ 100 NONAME ; enum OMX_ERRORTYPE COmxILPort::GetLocalOmxParamIndexes(class RArray &) const + ?CleanUpPort@COmxILPort@@IAEXXZ @ 101 NONAME ; void COmxILPort::CleanUpPort(void) + ?FreeBuffer@COmxILPort@@UAE?AW4OMX_ERRORTYPE@@PAUOMX_BUFFERHEADERTYPE@@AAH@Z @ 102 NONAME ; enum OMX_ERRORTYPE COmxILPort::FreeBuffer(struct OMX_BUFFERHEADERTYPE *, int &) + ?TunnelRequest@COmxILPort@@UAE?AW4OMX_ERRORTYPE@@PAXKPAUOMX_TUNNELSETUPTYPE@@@Z @ 103 NONAME ; enum OMX_ERRORTYPE COmxILPort::TunnelRequest(void *, unsigned long, struct OMX_TUNNELSETUPTYPE *) + ?GetParameter@COmxILConfigManager@@UBE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PAX@Z @ 104 NONAME ; enum OMX_ERRORTYPE COmxILConfigManager::GetParameter(enum OMX_INDEXTYPE, void *) const + ?SetFsm@COmxILInContextCallbackManager@@UAEXAAVCOmxILFsm@@@Z @ 105 NONAME ; void COmxILInContextCallbackManager::SetFsm(class COmxILFsm &) + ?ConstructL@COmxILOtherPort@@MAEXABV?$RArray@W4OMX_OTHER_FORMATTYPE@@@@@Z @ 106 NONAME ; void COmxILOtherPort::ConstructL(class RArray const &) + ?GetLocalOmxConfigIndexes@COmxILImagePort@@UBE?AW4OMX_ERRORTYPE@@AAV?$RArray@I@@@Z @ 107 NONAME ; enum OMX_ERRORTYPE COmxILImagePort::GetLocalOmxConfigIndexes(class RArray &) const + ?ClearBufferContents@TOmxILUtil@@SAXPAUOMX_BUFFERHEADERTYPE@@@Z @ 108 NONAME ; void TOmxILUtil::ClearBufferContents(struct OMX_BUFFERHEADERTYPE *) + ?SetParameter@COmxILImagePort@@UAE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PBXAAH@Z @ 109 NONAME ; enum OMX_ERRORTYPE COmxILImagePort::SetParameter(enum OMX_INDEXTYPE, void const *, int &) + ?DoBufferDoneNotification@XOmxILCallbackManagerIfImpl@@MAE?AW4OMX_ERRORTYPE@@PAUOMX_BUFFERHEADERTYPE@@KW4OMX_DIRTYPE@@@Z @ 110 NONAME ; enum OMX_ERRORTYPE XOmxILCallbackManagerIfImpl::DoBufferDoneNotification(struct OMX_BUFFERHEADERTYPE *, unsigned long, enum OMX_DIRTYPE) + ?GetLocalOmxParamIndexes@COmxILOtherPort@@UBE?AW4OMX_ERRORTYPE@@AAV?$RArray@I@@@Z @ 111 NONAME ; enum OMX_ERRORTYPE COmxILOtherPort::GetLocalOmxParamIndexes(class RArray &) const + ?TransitionCompleteNotification@COmxILCallbackManager@@UAE?AW4OMX_ERRORTYPE@@W4OMX_STATETYPE@@@Z @ 112 NONAME ; enum OMX_ERRORTYPE COmxILCallbackManager::TransitionCompleteNotification(enum OMX_STATETYPE) + ?BufferRemovalIndication@COmxILInContextCallbackManager@@UAEHPAUOMX_BUFFERHEADERTYPE@@W4OMX_DIRTYPE@@@Z @ 113 NONAME ; int COmxILInContextCallbackManager::BufferRemovalIndication(struct OMX_BUFFERHEADERTYPE *, enum OMX_DIRTYPE) + ?SignalOrPropagateBufferMarks@XOmxILCallbackManagerIfImpl@@MAEXPAUOMX_BUFFERHEADERTYPE@@K@Z @ 114 NONAME ; void XOmxILCallbackManagerIfImpl::SignalOrPropagateBufferMarks(struct OMX_BUFFERHEADERTYPE *, unsigned long) + ?DeregisterTunnelCallback@COmxILInContextCallbackManager@@UAE?AW4OMX_ERRORTYPE@@K@Z @ 115 NONAME ; enum OMX_ERRORTYPE COmxILInContextCallbackManager::DeregisterTunnelCallback(unsigned long) + ?DoBufferUnwrapping@COmxILPort@@MAEXPAX000@Z @ 116 NONAME ; void COmxILPort::DoBufferUnwrapping(void *, void *, void *, void *) + ?ComponentRoleEnum@COmxILConfigManager@@QBE?AW4OMX_ERRORTYPE@@PAEK@Z @ 117 NONAME ; enum OMX_ERRORTYPE COmxILConfigManager::ComponentRoleEnum(unsigned char *, unsigned long) const + ?UpdateColorFormat@COmxILVideoPort@@IAEHAAW4OMX_COLOR_FORMATTYPE@@W42@AAH@Z @ 118 NONAME ; int COmxILVideoPort::UpdateColorFormat(enum OMX_COLOR_FORMATTYPE &, enum OMX_COLOR_FORMATTYPE, int &) + ?DoRegisterBufferMarkPropagationPort@XOmxILCallbackManagerIfImpl@@MAE?AW4OMX_ERRORTYPE@@KK@Z @ 119 NONAME ; enum OMX_ERRORTYPE XOmxILCallbackManagerIfImpl::DoRegisterBufferMarkPropagationPort(unsigned long, unsigned long) + ??0COmxILOtherPort@@IAE@ABVTOmxILCommonPortData@@@Z @ 120 NONAME ; COmxILOtherPort::COmxILOtherPort(class TOmxILCommonPortData const &) + ?GetConfig@COmxILPort@@UBE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PAX@Z @ 121 NONAME ; enum OMX_ERRORTYPE COmxILPort::GetConfig(enum OMX_INDEXTYPE, void *) const + ??0COmxILAudioPort@@IAE@ABVTOmxILCommonPortData@@@Z @ 122 NONAME ; COmxILAudioPort::COmxILAudioPort(class TOmxILCommonPortData const &) + ??0XOmxILCallbackManagerIfImpl@@IAE@PAX0PAUOMX_CALLBACKTYPE@@@Z @ 123 NONAME ; XOmxILCallbackManagerIfImpl::XOmxILCallbackManagerIfImpl(void *, void *, struct OMX_CALLBACKTYPE *) + ?UpdateCodingType@COmxILVideoPort@@IAEHAAW4OMX_VIDEO_CODINGTYPE@@W42@AAH@Z @ 124 NONAME ; int COmxILVideoPort::UpdateCodingType(enum OMX_VIDEO_CODINGTYPE &, enum OMX_VIDEO_CODINGTYPE, int &) + ?DoErrorEventNotification@XOmxILCallbackManagerIfImpl@@MAE?AW4OMX_ERRORTYPE@@W42@@Z @ 125 NONAME ; enum OMX_ERRORTYPE XOmxILCallbackManagerIfImpl::DoErrorEventNotification(enum OMX_ERRORTYPE) + ?DeregisterTunnelCallback@COmxILCallbackManager@@UAE?AW4OMX_ERRORTYPE@@K@Z @ 126 NONAME ; enum OMX_ERRORTYPE COmxILCallbackManager::DeregisterTunnelCallback(unsigned long) + ??1COmxILProcessingFunction@@UAE@XZ @ 127 NONAME ; COmxILProcessingFunction::~COmxILProcessingFunction(void) + ?NewL@COmxILInContextCallbackManager@@SAPAV1@PAX0PAUOMX_CALLBACKTYPE@@@Z @ 128 NONAME ; class COmxILInContextCallbackManager * COmxILInContextCallbackManager::NewL(void *, void *, struct OMX_CALLBACKTYPE *) + ?SetParameter@COmxILPort@@UAE?AW4OMX_ERRORTYPE@@W4OMX_INDEXTYPE@@PBXAAH@Z @ 129 NONAME ; enum OMX_ERRORTYPE COmxILPort::SetParameter(enum OMX_INDEXTYPE, void const *, int &) + ??1COmxILComponent@@UAE@XZ @ 130 NONAME ; COmxILComponent::~COmxILComponent(void) + ?SetTransitionToEnabled@COmxILPort@@UAEXXZ @ 131 NONAME ; void COmxILPort::SetTransitionToEnabled(void) + ?DoBufferWrapping@COmxILPort@@MAE?AW4OMX_ERRORTYPE@@KPAEAAPAX1PAX@Z @ 132 NONAME ; enum OMX_ERRORTYPE COmxILPort::DoBufferWrapping(unsigned long, unsigned char *, void * &, void * &, void *) + ?BufferRemovalIndication@COmxILCallbackManager@@UAEHPAUOMX_BUFFERHEADERTYPE@@W4OMX_DIRTYPE@@@Z @ 133 NONAME ; int COmxILCallbackManager::BufferRemovalIndication(struct OMX_BUFFERHEADERTYPE *, enum OMX_DIRTYPE) + ?ErrorEventNotification@COmxILCallbackManager@@UAE?AW4OMX_ERRORTYPE@@W42@@Z @ 134 NONAME ; enum OMX_ERRORTYPE COmxILCallbackManager::ErrorEventNotification(enum OMX_ERRORTYPE) + ?SetBufferReturned@COmxILPort@@UAEHPAUOMX_BUFFERHEADERTYPE@@@Z @ 135 NONAME ; int COmxILPort::SetBufferReturned(struct OMX_BUFFERHEADERTYPE *) + ?DoBufferDeallocation@COmxILPort@@MAEXPAX000@Z @ 136 NONAME ; void COmxILPort::DoBufferDeallocation(void *, void *, void *, void *) + ?GetLocalOmxConfigIndexes@COmxILOtherPort@@UBE?AW4OMX_ERRORTYPE@@AAV?$RArray@I@@@Z @ 137 NONAME ; enum OMX_ERRORTYPE COmxILOtherPort::GetLocalOmxConfigIndexes(class RArray &) const + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/eabi/omxilcomponentcommon.def --- a/omxil/omxilcomponentcommon/eabi/omxilcomponentcommon.def Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/eabi/omxilcomponentcommon.def Fri May 07 16:25:23 2010 +0100 @@ -1,274 +1,262 @@ -EXPORTS - _ZN10COmxILPort10FreeBufferEP20OMX_BUFFERHEADERTYPERi @ 1 NONAME - _ZN10COmxILPort10FreeTunnelERi @ 2 NONAME - _ZN10COmxILPort11CleanUpPortEv @ 3 NONAME - _ZN10COmxILPort11TBufferInfo7CompareERKS0_S2_ @ 4 NONAME - _ZN10COmxILPort12SetParameterE13OMX_INDEXTYPEPKvRi @ 5 NONAME - _ZN10COmxILPort13SetBufferSentEP20OMX_BUFFERHEADERTYPERi @ 6 NONAME - _ZN10COmxILPort13TunnelRequestEPvmP19OMX_TUNNELSETUPTYPE @ 7 NONAME - _ZN10COmxILPort14DoOmxUseBufferEPvPP20OMX_BUFFERHEADERTYPEmS0_S0_mPh @ 8 NONAME - _ZN10COmxILPort14PopulateBufferEPP20OMX_BUFFERHEADERTYPEPvmPhRi @ 9 NONAME - _ZN10COmxILPort14PopulateTunnelERi @ 10 NONAME - _ZN10COmxILPort15StoreBufferMarkEPK12OMX_MARKTYPE @ 11 NONAME - _ZN10COmxILPort15StoreBufferMarkERPvS1_ @ 12 NONAME - _ZN10COmxILPort16DoBufferWrappingEmPhRPvS2_S1_ @ 13 NONAME - _ZN10COmxILPort17SetBufferReturnedEP20OMX_BUFFERHEADERTYPE @ 14 NONAME - _ZN10COmxILPort18DoBufferAllocationEmRPhRPvS3_S2_ @ 15 NONAME - _ZN10COmxILPort18DoBufferUnwrappingEPvS0_S0_S0_ @ 16 NONAME - _ZN10COmxILPort20DoBufferDeallocationEPvS0_S0_S0_ @ 17 NONAME - _ZN10COmxILPort21DoPortReconfigurationEjRK6TDesC8R13OMX_EVENTTYPE @ 18 NONAME - _ZN10COmxILPort22SetTransitionToEnabledEv @ 19 NONAME - _ZN10COmxILPort23SetTransitionToDisabledEv @ 20 NONAME - _ZN10COmxILPort24SetComponentRoleDefaultsEj @ 21 NONAME - _ZN10COmxILPort31SetTransitionToEnabledCompletedEv @ 22 NONAME - _ZN10COmxILPort32SetTransitionToDisabledCompletedEv @ 23 NONAME - _ZN10COmxILPort9SetConfigE13OMX_INDEXTYPEPKvRi @ 24 NONAME - _ZN10COmxILPortC2ERK20TOmxILCommonPortData @ 25 NONAME - _ZN10COmxILPortD0Ev @ 26 NONAME - _ZN10COmxILPortD1Ev @ 27 NONAME - _ZN10COmxILPortD2Ev @ 28 NONAME - _ZN10TOmxILUtil19ClearBufferContentsEP20OMX_BUFFERHEADERTYPE @ 29 NONAME - _ZN10TOmxILUtil28CheckOmxStructSizeAndVersionEPvm @ 30 NONAME - _ZN15COmxILAudioPort10ConstructLERK6RArrayI20OMX_AUDIO_CODINGTYPEE @ 31 NONAME - _ZN15COmxILAudioPort12SetParameterE13OMX_INDEXTYPEPKvRi @ 32 NONAME - _ZN15COmxILAudioPortC2ERK20TOmxILCommonPortData @ 33 NONAME - _ZN15COmxILAudioPortD0Ev @ 34 NONAME - _ZN15COmxILAudioPortD1Ev @ 35 NONAME - _ZN15COmxILAudioPortD2Ev @ 36 NONAME - _ZN15COmxILComponent14InitComponentLEv @ 37 NONAME - _ZN15COmxILComponent28SymbianErrorToGetHandleErrorEi @ 38 NONAME - _ZN15COmxILComponentC1Ev @ 39 NONAME - _ZN15COmxILComponentC2Ev @ 40 NONAME - _ZN15COmxILComponentD0Ev @ 41 NONAME - _ZN15COmxILComponentD1Ev @ 42 NONAME - _ZN15COmxILComponentD2Ev @ 43 NONAME - _ZN15COmxILImagePort12SetParameterE13OMX_INDEXTYPEPKvRi @ 44 NONAME - _ZN15COmxILImagePortC2ERK20TOmxILCommonPortDataRK6RArrayI20OMX_IMAGE_CODINGTYPEERKS3_I20OMX_COLOR_FORMATTYPEE @ 45 NONAME - _ZN15COmxILImagePortD0Ev @ 46 NONAME - _ZN15COmxILImagePortD1Ev @ 47 NONAME - _ZN15COmxILImagePortD2Ev @ 48 NONAME - _ZN15COmxILOtherPort10ConstructLERK6RArrayI20OMX_OTHER_FORMATTYPEE @ 49 NONAME - _ZN15COmxILOtherPort12SetParameterE13OMX_INDEXTYPEPKvRi @ 50 NONAME - _ZN15COmxILOtherPortC2ERK20TOmxILCommonPortData @ 51 NONAME - _ZN15COmxILOtherPortD0Ev @ 52 NONAME - _ZN15COmxILOtherPortD1Ev @ 53 NONAME - _ZN15COmxILOtherPortD2Ev @ 54 NONAME - _ZN15COmxILVideoPort12SetParameterE13OMX_INDEXTYPEPKvRi @ 55 NONAME - _ZN15COmxILVideoPortC2ERK20TOmxILCommonPortDataRK6RArrayI20OMX_VIDEO_CODINGTYPEERKS3_I20OMX_COLOR_FORMATTYPEE @ 56 NONAME - _ZN15COmxILVideoPortD0Ev @ 57 NONAME - _ZN15COmxILVideoPortD1Ev @ 58 NONAME - _ZN15COmxILVideoPortD2Ev @ 59 NONAME - _ZN17COmxILPortManager4NewLER24COmxILProcessingFunctionR23MOmxILCallbackManagerIfRK15OMX_VERSIONTYPEmmmmmmmm8OMX_BOOL @ 60 NONAME - _ZN17COmxILPortManager7AddPortEPK10COmxILPort11OMX_DIRTYPE @ 61 NONAME - _ZN19COmxILConfigManager10ConstructLERK6TDesC8RK15OMX_VERSIONTYPERK13RPointerArrayIS0_E @ 62 NONAME - _ZN19COmxILConfigManager12SetParameterE13OMX_INDEXTYPEPKv8OMX_BOOL @ 63 NONAME - _ZN19COmxILConfigManager4NewLER17COmxILPortManagerRK6TDesC8RK15OMX_VERSIONTYPERK13RPointerArrayIS2_E @ 64 NONAME - _ZN19COmxILConfigManager9SetConfigE13OMX_INDEXTYPEPKv @ 65 NONAME - _ZN19COmxILConfigManagerC1ER17COmxILPortManager @ 66 NONAME - _ZN19COmxILConfigManagerC2ER17COmxILPortManager @ 67 NONAME - _ZN19COmxILConfigManagerD0Ev @ 68 NONAME - _ZN19COmxILConfigManagerD1Ev @ 69 NONAME - _ZN19COmxILConfigManagerD2Ev @ 70 NONAME - _ZN20TOmxILCommonPortDataC1E15OMX_VERSIONTYPEm11OMX_DIRTYPEmm18OMX_PORTDOMAINTYPE8OMX_BOOLm22OMX_BUFFERSUPPLIERTYPEm @ 71 NONAME - _ZN20TOmxILCommonPortDataC2E15OMX_VERSIONTYPEm11OMX_DIRTYPEmm18OMX_PORTDOMAINTYPE8OMX_BOOLm22OMX_BUFFERSUPPLIERTYPEm @ 72 NONAME - _ZN21COmxILCallbackManager14SetPortManagerER17COmxILPortManager @ 73 NONAME - _ZN21COmxILCallbackManager17EventNotificationE13OMX_EVENTTYPEmmPc @ 74 NONAME - _ZN21COmxILCallbackManager22BufferDoneNotificationEP20OMX_BUFFERHEADERTYPEm11OMX_DIRTYPE @ 75 NONAME - _ZN21COmxILCallbackManager22ErrorEventNotificationE13OMX_ERRORTYPE @ 76 NONAME - _ZN21COmxILCallbackManager22RegisterTunnelCallbackEm11OMX_DIRTYPEPvm @ 77 NONAME - _ZN21COmxILCallbackManager23BufferRemovalIndicationEP20OMX_BUFFERHEADERTYPE11OMX_DIRTYPE @ 78 NONAME - _ZN21COmxILCallbackManager23RegisterComponentHandleEPv @ 79 NONAME - _ZN21COmxILCallbackManager24DeregisterTunnelCallbackEm @ 80 NONAME - _ZN21COmxILCallbackManager25RegisterILClientCallbacksEPK16OMX_CALLBACKTYPEPv @ 81 NONAME - _ZN21COmxILCallbackManager27ClockBufferDoneNotificationEP20OMX_BUFFERHEADERTYPEm11OMX_DIRTYPE @ 82 NONAME - _ZN21COmxILCallbackManager27CommandCompleteNotificationE15OMX_COMMANDTYPEm @ 83 NONAME - _ZN21COmxILCallbackManager30PortSettingsChangeNotificationEmjRK6TDesC8 @ 84 NONAME - _ZN21COmxILCallbackManager30TransitionCompleteNotificationE13OMX_STATETYPE @ 85 NONAME - _ZN21COmxILCallbackManager33RegisterBufferMarkPropagationPortEmm @ 86 NONAME - _ZN21COmxILCallbackManager4NewLEPvS0_P16OMX_CALLBACKTYPE @ 87 NONAME - _ZN21COmxILCallbackManager6SetFsmER9COmxILFsm @ 88 NONAME - _ZN21COmxILCallbackManagerD0Ev @ 89 NONAME - _ZN21COmxILCallbackManagerD1Ev @ 90 NONAME - _ZN21COmxILCallbackManagerD2Ev @ 91 NONAME - _ZN21COmxILClientClockPort4NewLERK20TOmxILCommonPortDataRK6RArrayI20OMX_OTHER_FORMATTYPEE @ 92 NONAME - _ZN24COmxILProcessingFunction19MediaTimeIndicationERK22OMX_TIME_MEDIATIMETYPE @ 93 NONAME - _ZN24COmxILProcessingFunction23ComponentRoleIndicationEj @ 94 NONAME - _ZN24COmxILProcessingFunctionC2ER28MOmxILCallbackNotificationIf @ 95 NONAME - _ZN24COmxILProcessingFunctionD0Ev @ 96 NONAME - _ZN24COmxILProcessingFunctionD1Ev @ 97 NONAME - _ZN24COmxILProcessingFunctionD2Ev @ 98 NONAME - _ZN27XOmxILCallbackManagerIfImpl16DoSetPortManagerER17COmxILPortManager @ 99 NONAME - _ZN27XOmxILCallbackManagerIfImpl19DoEventNotificationE13OMX_EVENTTYPEmmPc @ 100 NONAME - _ZN27XOmxILCallbackManagerIfImpl24DoBufferDoneNotificationEP20OMX_BUFFERHEADERTYPEm11OMX_DIRTYPE @ 101 NONAME - _ZN27XOmxILCallbackManagerIfImpl24DoErrorEventNotificationE13OMX_ERRORTYPE @ 102 NONAME - _ZN27XOmxILCallbackManagerIfImpl24DoRegisterTunnelCallbackEm11OMX_DIRTYPEPvm @ 103 NONAME - _ZN27XOmxILCallbackManagerIfImpl25DoRegisterComponentHandleEPv @ 104 NONAME - _ZN27XOmxILCallbackManagerIfImpl27DoRegisterILClientCallbacksEPK16OMX_CALLBACKTYPEPv @ 105 NONAME - _ZN27XOmxILCallbackManagerIfImpl27HandleInsufficientResourcesEv @ 106 NONAME - _ZN27XOmxILCallbackManagerIfImpl28SignalOrPropagateBufferMarksEP20OMX_BUFFERHEADERTYPEm @ 107 NONAME - _ZN27XOmxILCallbackManagerIfImpl29DoCommandCompleteNotificationE15OMX_COMMANDTYPEm @ 108 NONAME - _ZN27XOmxILCallbackManagerIfImpl32DoPortSettingsChangeNotificationEmjRK6TDesC8 @ 109 NONAME - _ZN27XOmxILCallbackManagerIfImpl32DoTransitionCompleteNotificationE13OMX_STATETYPE @ 110 NONAME - _ZN27XOmxILCallbackManagerIfImpl35DoRegisterBufferMarkPropagationPortEmm @ 111 NONAME - _ZN27XOmxILCallbackManagerIfImpl8DoSetFsmER9COmxILFsm @ 112 NONAME - _ZN27XOmxILCallbackManagerIfImplC1EPvS0_P16OMX_CALLBACKTYPE @ 113 NONAME - _ZN27XOmxILCallbackManagerIfImplC2EPvS0_P16OMX_CALLBACKTYPE @ 114 NONAME - _ZN27XOmxILCallbackManagerIfImplD0Ev @ 115 NONAME - _ZN27XOmxILCallbackManagerIfImplD1Ev @ 116 NONAME - _ZN27XOmxILCallbackManagerIfImplD2Ev @ 117 NONAME - _ZN30COmxILInContextCallbackManager14SetPortManagerER17COmxILPortManager @ 118 NONAME - _ZN30COmxILInContextCallbackManager17EventNotificationE13OMX_EVENTTYPEmmPc @ 119 NONAME - _ZN30COmxILInContextCallbackManager22BufferDoneNotificationEP20OMX_BUFFERHEADERTYPEm11OMX_DIRTYPE @ 120 NONAME - _ZN30COmxILInContextCallbackManager22ErrorEventNotificationE13OMX_ERRORTYPE @ 121 NONAME - _ZN30COmxILInContextCallbackManager22RegisterTunnelCallbackEm11OMX_DIRTYPEPvm @ 122 NONAME - _ZN30COmxILInContextCallbackManager23BufferRemovalIndicationEP20OMX_BUFFERHEADERTYPE11OMX_DIRTYPE @ 123 NONAME - _ZN30COmxILInContextCallbackManager23RegisterComponentHandleEPv @ 124 NONAME - _ZN30COmxILInContextCallbackManager24DeregisterTunnelCallbackEm @ 125 NONAME - _ZN30COmxILInContextCallbackManager25RegisterILClientCallbacksEPK16OMX_CALLBACKTYPEPv @ 126 NONAME - _ZN30COmxILInContextCallbackManager27ClockBufferDoneNotificationEP20OMX_BUFFERHEADERTYPEm11OMX_DIRTYPE @ 127 NONAME - _ZN30COmxILInContextCallbackManager27CommandCompleteNotificationE15OMX_COMMANDTYPEm @ 128 NONAME - _ZN30COmxILInContextCallbackManager30PortSettingsChangeNotificationEmjRK6TDesC8 @ 129 NONAME - _ZN30COmxILInContextCallbackManager30TransitionCompleteNotificationE13OMX_STATETYPE @ 130 NONAME - _ZN30COmxILInContextCallbackManager33RegisterBufferMarkPropagationPortEmm @ 131 NONAME - _ZN30COmxILInContextCallbackManager4NewLEPvS0_P16OMX_CALLBACKTYPE @ 132 NONAME - _ZN30COmxILInContextCallbackManager6SetFsmER9COmxILFsm @ 133 NONAME - _ZN30COmxILInContextCallbackManagerD0Ev @ 134 NONAME - _ZN30COmxILInContextCallbackManagerD1Ev @ 135 NONAME - _ZN30COmxILInContextCallbackManagerD2Ev @ 136 NONAME - _ZN9COmxILFsm4NewLER15COmxILComponentR24COmxILProcessingFunctionR17COmxILPortManagerR19COmxILConfigManagerR23MOmxILCallbackManagerIf @ 137 NONAME - _ZNK10COmxILPort12GetParameterE13OMX_INDEXTYPEPv @ 138 NONAME - _ZNK10COmxILPort14IsBufferAtHomeEP20OMX_BUFFERHEADERTYPE @ 139 NONAME - _ZNK10COmxILPort17GetExtensionIndexEPcP13OMX_INDEXTYPE @ 140 NONAME - _ZNK10COmxILPort19HasAllBuffersAtHomeEv @ 141 NONAME - _ZNK10COmxILPort23GetLocalOmxParamIndexesER6RArrayIjE @ 142 NONAME - _ZNK10COmxILPort24GetLocalOmxConfigIndexesER6RArrayIjE @ 143 NONAME - _ZNK10COmxILPort9GetConfigE13OMX_INDEXTYPEPv @ 144 NONAME - _ZNK15COmxILAudioPort12GetParameterE13OMX_INDEXTYPEPv @ 145 NONAME - _ZNK15COmxILAudioPort23GetLocalOmxParamIndexesER6RArrayIjE @ 146 NONAME - _ZNK15COmxILAudioPort24GetLocalOmxConfigIndexesER6RArrayIjE @ 147 NONAME - _ZNK15COmxILImagePort12GetParameterE13OMX_INDEXTYPEPv @ 148 NONAME - _ZNK15COmxILImagePort23GetLocalOmxParamIndexesER6RArrayIjE @ 149 NONAME - _ZNK15COmxILImagePort24GetLocalOmxConfigIndexesER6RArrayIjE @ 150 NONAME - _ZNK15COmxILOtherPort12GetParameterE13OMX_INDEXTYPEPv @ 151 NONAME - _ZNK15COmxILOtherPort23GetLocalOmxParamIndexesER6RArrayIjE @ 152 NONAME - _ZNK15COmxILOtherPort24GetLocalOmxConfigIndexesER6RArrayIjE @ 153 NONAME - _ZNK15COmxILVideoPort12GetParameterE13OMX_INDEXTYPEPv @ 154 NONAME - _ZNK15COmxILVideoPort23GetLocalOmxParamIndexesER6RArrayIjE @ 155 NONAME - _ZNK15COmxILVideoPort24GetLocalOmxConfigIndexesER6RArrayIjE @ 156 NONAME - _ZNK19COmxILConfigManager12GetParameterE13OMX_INDEXTYPEPv @ 157 NONAME - _ZNK19COmxILConfigManager17ComponentRoleEnumEPhm @ 158 NONAME - _ZNK19COmxILConfigManager17GetExtensionIndexEPcP13OMX_INDEXTYPE @ 159 NONAME - _ZNK19COmxILConfigManager19GetComponentVersionEPcP15OMX_VERSIONTYPES2_PA128_h @ 160 NONAME - _ZNK19COmxILConfigManager9GetConfigE13OMX_INDEXTYPEPv @ 161 NONAME - _ZNK21COmxILClientClockPort11GetWallTimeERx @ 162 NONAME - _ZNK21COmxILClientClockPort12GetMediaTimeERx @ 163 NONAME - _ZNK21COmxILClientClockPort12SetStartTimeEx @ 164 NONAME - _ZNK21COmxILClientClockPort13GetClockStateER30OMX_TIME_CONFIG_CLOCKSTATETYPE @ 165 NONAME - _ZNK21COmxILClientClockPort16MediaTimeRequestEPvxx @ 166 NONAME - _ZNK21COmxILClientClockPort17SetAudioReferenceEx @ 167 NONAME - _ZNK21COmxILClientClockPort17SetVideoReferenceEx @ 168 NONAME - _ZNK21COmxILClientClockPort25IsClockComponentAvailableEv @ 169 NONAME - _ZTI10COmxILPort @ 170 NONAME - _ZTI15COmxILAudioPort @ 171 NONAME - _ZTI15COmxILComponent @ 172 NONAME - _ZTI15COmxILImagePort @ 173 NONAME - _ZTI15COmxILOtherPort @ 174 NONAME - _ZTI15COmxILVideoPort @ 175 NONAME - _ZTI19COmxILConfigManager @ 176 NONAME - _ZTI24COmxILProcessingFunction @ 177 NONAME - _ZTI27XOmxILCallbackManagerIfImpl @ 178 NONAME - _ZTIN21COmxILCallbackManager16CCallbackCommandE @ 179 NONAME - _ZTIN21COmxILCallbackManager21CBufferRemovalCommandE @ 180 NONAME - _ZTIN21COmxILCallbackManager21CEventCallbackCommandE @ 181 NONAME - _ZTIN21COmxILCallbackManager26CBufferDoneCallbackCommandE @ 182 NONAME - _ZTIN21COmxILCallbackManager26CPortSettingsChangeCommandE @ 183 NONAME - _ZTIN21COmxILCallbackManager30CCompHandleRegistrationCommandE @ 184 NONAME - _ZTIN21COmxILCallbackManager34CTunnelCallbackRegistrationCommandE @ 185 NONAME - _ZTIN21COmxILCallbackManager35CClientCallbacksRegistrationCommandE @ 186 NONAME - _ZTIN21COmxILCallbackManager41CBufferMarkPropagationRegistrationCommandE @ 187 NONAME - _ZTIN9COmxILFsm11COmxILStateE @ 188 NONAME - _ZTIN9COmxILFsm15COmxILStateIdleE @ 189 NONAME - _ZTIN9COmxILFsm16COmxILStatePauseE @ 190 NONAME - _ZTIN9COmxILFsm17COmxILStateLoadedE @ 191 NONAME - _ZTIN9COmxILFsm18COmxILStateInvalidE @ 192 NONAME - _ZTIN9COmxILFsm20COmxILStateExecutingE @ 193 NONAME - _ZTIN9COmxILFsm22COmxILStatePauseToIdleE @ 194 NONAME - _ZTIN9COmxILFsm23COmxILStateIdleToLoadedE @ 195 NONAME - _ZTIN9COmxILFsm23COmxILStateLoadedToIdleE @ 196 NONAME - _ZTIN9COmxILFsm26COmxILStateExecutingToIdleE @ 197 NONAME - _ZTIN9COmxILFsm27COmxILStateWaitForResourcesE @ 198 NONAME - _ZTV10COmxILPort @ 199 NONAME - _ZTV15COmxILAudioPort @ 200 NONAME - _ZTV15COmxILComponent @ 201 NONAME - _ZTV15COmxILImagePort @ 202 NONAME - _ZTV15COmxILOtherPort @ 203 NONAME - _ZTV15COmxILVideoPort @ 204 NONAME - _ZTV19COmxILConfigManager @ 205 NONAME - _ZTV24COmxILProcessingFunction @ 206 NONAME - _ZTV27XOmxILCallbackManagerIfImpl @ 207 NONAME - _ZTVN21COmxILCallbackManager16CCallbackCommandE @ 208 NONAME - _ZTVN21COmxILCallbackManager21CBufferRemovalCommandE @ 209 NONAME - _ZTVN21COmxILCallbackManager21CEventCallbackCommandE @ 210 NONAME - _ZTVN21COmxILCallbackManager26CBufferDoneCallbackCommandE @ 211 NONAME - _ZTVN21COmxILCallbackManager26CPortSettingsChangeCommandE @ 212 NONAME - _ZTVN21COmxILCallbackManager30CCompHandleRegistrationCommandE @ 213 NONAME - _ZTVN21COmxILCallbackManager34CTunnelCallbackRegistrationCommandE @ 214 NONAME - _ZTVN21COmxILCallbackManager35CClientCallbacksRegistrationCommandE @ 215 NONAME - _ZTVN21COmxILCallbackManager41CBufferMarkPropagationRegistrationCommandE @ 216 NONAME - _ZTVN9COmxILFsm11COmxILStateE @ 217 NONAME - _ZTVN9COmxILFsm15COmxILStateIdleE @ 218 NONAME - _ZTVN9COmxILFsm16COmxILStatePauseE @ 219 NONAME - _ZTVN9COmxILFsm17COmxILStateLoadedE @ 220 NONAME - _ZTVN9COmxILFsm18COmxILStateInvalidE @ 221 NONAME - _ZTVN9COmxILFsm20COmxILStateExecutingE @ 222 NONAME - _ZTVN9COmxILFsm22COmxILStatePauseToIdleE @ 223 NONAME - _ZTVN9COmxILFsm23COmxILStateIdleToLoadedE @ 224 NONAME - _ZTVN9COmxILFsm23COmxILStateLoadedToIdleE @ 225 NONAME - _ZTVN9COmxILFsm26COmxILStateExecutingToIdleE @ 226 NONAME - _ZTVN9COmxILFsm27COmxILStateWaitForResourcesE @ 227 NONAME - _ZThn232_NK21COmxILClientClockPort11GetWallTimeERx @ 228 NONAME - _ZThn232_NK21COmxILClientClockPort12GetMediaTimeERx @ 229 NONAME - _ZThn232_NK21COmxILClientClockPort12SetStartTimeEx @ 230 NONAME - _ZThn232_NK21COmxILClientClockPort13GetClockStateER30OMX_TIME_CONFIG_CLOCKSTATETYPE @ 231 NONAME - _ZThn232_NK21COmxILClientClockPort16MediaTimeRequestEPvxx @ 232 NONAME - _ZThn232_NK21COmxILClientClockPort17SetAudioReferenceEx @ 233 NONAME - _ZThn232_NK21COmxILClientClockPort17SetVideoReferenceEx @ 234 NONAME - _ZThn232_NK21COmxILClientClockPort25IsClockComponentAvailableEv @ 235 NONAME - _ZThn28_N21COmxILCallbackManager14SetPortManagerER17COmxILPortManager @ 236 NONAME - _ZThn28_N21COmxILCallbackManager17EventNotificationE13OMX_EVENTTYPEmmPc @ 237 NONAME - _ZThn28_N21COmxILCallbackManager22BufferDoneNotificationEP20OMX_BUFFERHEADERTYPEm11OMX_DIRTYPE @ 238 NONAME - _ZThn28_N21COmxILCallbackManager22ErrorEventNotificationE13OMX_ERRORTYPE @ 239 NONAME - _ZThn28_N21COmxILCallbackManager22RegisterTunnelCallbackEm11OMX_DIRTYPEPvm @ 240 NONAME - _ZThn28_N21COmxILCallbackManager23BufferRemovalIndicationEP20OMX_BUFFERHEADERTYPE11OMX_DIRTYPE @ 241 NONAME - _ZThn28_N21COmxILCallbackManager23RegisterComponentHandleEPv @ 242 NONAME - _ZThn28_N21COmxILCallbackManager24DeregisterTunnelCallbackEm @ 243 NONAME - _ZThn28_N21COmxILCallbackManager25RegisterILClientCallbacksEPK16OMX_CALLBACKTYPEPv @ 244 NONAME - _ZThn28_N21COmxILCallbackManager27ClockBufferDoneNotificationEP20OMX_BUFFERHEADERTYPEm11OMX_DIRTYPE @ 245 NONAME - _ZThn28_N21COmxILCallbackManager27CommandCompleteNotificationE15OMX_COMMANDTYPEm @ 246 NONAME - _ZThn28_N21COmxILCallbackManager30PortSettingsChangeNotificationEmjRK6TDesC8 @ 247 NONAME - _ZThn28_N21COmxILCallbackManager30TransitionCompleteNotificationE13OMX_STATETYPE @ 248 NONAME - _ZThn28_N21COmxILCallbackManager33RegisterBufferMarkPropagationPortEmm @ 249 NONAME - _ZThn28_N21COmxILCallbackManager6SetFsmER9COmxILFsm @ 250 NONAME - _ZThn28_N21COmxILCallbackManagerD0Ev @ 251 NONAME - _ZThn28_N21COmxILCallbackManagerD1Ev @ 252 NONAME - _ZThn32_N21COmxILCallbackManagerD0Ev @ 253 NONAME - _ZThn32_N21COmxILCallbackManagerD1Ev @ 254 NONAME - _ZThn4_N30COmxILInContextCallbackManager14SetPortManagerER17COmxILPortManager @ 255 NONAME - _ZThn4_N30COmxILInContextCallbackManager17EventNotificationE13OMX_EVENTTYPEmmPc @ 256 NONAME - _ZThn4_N30COmxILInContextCallbackManager22BufferDoneNotificationEP20OMX_BUFFERHEADERTYPEm11OMX_DIRTYPE @ 257 NONAME - _ZThn4_N30COmxILInContextCallbackManager22ErrorEventNotificationE13OMX_ERRORTYPE @ 258 NONAME - _ZThn4_N30COmxILInContextCallbackManager22RegisterTunnelCallbackEm11OMX_DIRTYPEPvm @ 259 NONAME - _ZThn4_N30COmxILInContextCallbackManager23BufferRemovalIndicationEP20OMX_BUFFERHEADERTYPE11OMX_DIRTYPE @ 260 NONAME - _ZThn4_N30COmxILInContextCallbackManager23RegisterComponentHandleEPv @ 261 NONAME - _ZThn4_N30COmxILInContextCallbackManager24DeregisterTunnelCallbackEm @ 262 NONAME - _ZThn4_N30COmxILInContextCallbackManager25RegisterILClientCallbacksEPK16OMX_CALLBACKTYPEPv @ 263 NONAME - _ZThn4_N30COmxILInContextCallbackManager27ClockBufferDoneNotificationEP20OMX_BUFFERHEADERTYPEm11OMX_DIRTYPE @ 264 NONAME - _ZThn4_N30COmxILInContextCallbackManager27CommandCompleteNotificationE15OMX_COMMANDTYPEm @ 265 NONAME - _ZThn4_N30COmxILInContextCallbackManager30PortSettingsChangeNotificationEmjRK6TDesC8 @ 266 NONAME - _ZThn4_N30COmxILInContextCallbackManager30TransitionCompleteNotificationE13OMX_STATETYPE @ 267 NONAME - _ZThn4_N30COmxILInContextCallbackManager33RegisterBufferMarkPropagationPortEmm @ 268 NONAME - _ZThn4_N30COmxILInContextCallbackManager6SetFsmER9COmxILFsm @ 269 NONAME - _ZThn4_N30COmxILInContextCallbackManagerD0Ev @ 270 NONAME - _ZThn4_N30COmxILInContextCallbackManagerD1Ev @ 271 NONAME - _ZThn8_N30COmxILInContextCallbackManagerD0Ev @ 272 NONAME - _ZThn8_N30COmxILInContextCallbackManagerD1Ev @ 273 NONAME \ No newline at end of file +EXPORTS + _ZN10COmxILPort10FreeBufferEP20OMX_BUFFERHEADERTYPERi @ 1 NONAME + _ZN10COmxILPort10FreeTunnelERi @ 2 NONAME + _ZN10COmxILPort11CleanUpPortEv @ 3 NONAME + _ZN10COmxILPort11TBufferInfo7CompareERKS0_S2_ @ 4 NONAME + _ZN10COmxILPort12SetParameterE13OMX_INDEXTYPEPKvRi @ 5 NONAME + _ZN10COmxILPort13SetBufferSentEP20OMX_BUFFERHEADERTYPERi @ 6 NONAME + _ZN10COmxILPort13TunnelRequestEPvmP19OMX_TUNNELSETUPTYPE @ 7 NONAME + _ZN10COmxILPort14DoOmxUseBufferEPvPP20OMX_BUFFERHEADERTYPEmS0_S0_mPh @ 8 NONAME + _ZN10COmxILPort14PopulateBufferEPP20OMX_BUFFERHEADERTYPEPvmPhRi @ 9 NONAME + _ZN10COmxILPort14PopulateTunnelERi @ 10 NONAME + _ZN10COmxILPort15StoreBufferMarkEPK12OMX_MARKTYPE @ 11 NONAME + _ZN10COmxILPort15StoreBufferMarkERPvS1_ @ 12 NONAME + _ZN10COmxILPort16DoBufferWrappingEmPhRPvS2_S1_ @ 13 NONAME + _ZN10COmxILPort17SetBufferReturnedEP20OMX_BUFFERHEADERTYPE @ 14 NONAME + _ZN10COmxILPort18DoBufferAllocationEmRPhRPvS3_S2_ @ 15 NONAME + _ZN10COmxILPort18DoBufferUnwrappingEPvS0_S0_S0_ @ 16 NONAME + _ZN10COmxILPort20DoBufferDeallocationEPvS0_S0_S0_ @ 17 NONAME + _ZN10COmxILPort21DoPortReconfigurationEjRK6TDesC8R13OMX_EVENTTYPE @ 18 NONAME + _ZN10COmxILPort22SetTransitionToEnabledEv @ 19 NONAME + _ZN10COmxILPort23SetTransitionToDisabledEv @ 20 NONAME + _ZN10COmxILPort24SetComponentRoleDefaultsEj @ 21 NONAME + _ZN10COmxILPort31SetTransitionToEnabledCompletedEv @ 22 NONAME + _ZN10COmxILPort32SetTransitionToDisabledCompletedEv @ 23 NONAME + _ZN10COmxILPort9SetConfigE13OMX_INDEXTYPEPKvRi @ 24 NONAME + _ZN10COmxILPortC2ERK20TOmxILCommonPortData @ 25 NONAME + _ZN10COmxILPortD0Ev @ 26 NONAME + _ZN10COmxILPortD1Ev @ 27 NONAME + _ZN10COmxILPortD2Ev @ 28 NONAME + _ZN10TOmxILUtil19ClearBufferContentsEP20OMX_BUFFERHEADERTYPE @ 29 NONAME + _ZN10TOmxILUtil28CheckOmxStructSizeAndVersionEPvm @ 30 NONAME + _ZN15COmxILAudioPort10ConstructLERK6RArrayI20OMX_AUDIO_CODINGTYPEE @ 31 NONAME + _ZN15COmxILAudioPort12SetParameterE13OMX_INDEXTYPEPKvRi @ 32 NONAME + _ZN15COmxILAudioPortC2ERK20TOmxILCommonPortData @ 33 NONAME + _ZN15COmxILAudioPortD0Ev @ 34 NONAME + _ZN15COmxILAudioPortD1Ev @ 35 NONAME + _ZN15COmxILAudioPortD2Ev @ 36 NONAME + _ZN15COmxILComponent14InitComponentLEv @ 37 NONAME + _ZN15COmxILComponent28SymbianErrorToGetHandleErrorEi @ 38 NONAME + _ZN15COmxILComponentC1Ev @ 39 NONAME + _ZN15COmxILComponentC2Ev @ 40 NONAME + _ZN15COmxILComponentD0Ev @ 41 NONAME + _ZN15COmxILComponentD1Ev @ 42 NONAME + _ZN15COmxILComponentD2Ev @ 43 NONAME + _ZN15COmxILImagePort12SetParameterE13OMX_INDEXTYPEPKvRi @ 44 NONAME + _ZN15COmxILImagePortC2ERK20TOmxILCommonPortDataRK6RArrayI20OMX_IMAGE_CODINGTYPEERKS3_I20OMX_COLOR_FORMATTYPEE @ 45 NONAME + _ZN15COmxILImagePortD0Ev @ 46 NONAME + _ZN15COmxILImagePortD1Ev @ 47 NONAME + _ZN15COmxILImagePortD2Ev @ 48 NONAME + _ZN15COmxILOtherPort10ConstructLERK6RArrayI20OMX_OTHER_FORMATTYPEE @ 49 NONAME + _ZN15COmxILOtherPort12SetParameterE13OMX_INDEXTYPEPKvRi @ 50 NONAME + _ZN15COmxILOtherPortC2ERK20TOmxILCommonPortData @ 51 NONAME + _ZN15COmxILOtherPortD0Ev @ 52 NONAME + _ZN15COmxILOtherPortD1Ev @ 53 NONAME + _ZN15COmxILOtherPortD2Ev @ 54 NONAME + _ZN15COmxILVideoPort12SetParameterE13OMX_INDEXTYPEPKvRi @ 55 NONAME + _ZN15COmxILVideoPort16UpdateCodingTypeER20OMX_VIDEO_CODINGTYPES0_Ri @ 56 NONAME + _ZN15COmxILVideoPort17UpdateColorFormatER20OMX_COLOR_FORMATTYPES0_Ri @ 57 NONAME + _ZN15COmxILVideoPortC2ERK20TOmxILCommonPortDataRK6RArrayI20OMX_VIDEO_CODINGTYPEERKS3_I20OMX_COLOR_FORMATTYPEE @ 58 NONAME + _ZN15COmxILVideoPortD0Ev @ 59 NONAME + _ZN15COmxILVideoPortD1Ev @ 60 NONAME + _ZN15COmxILVideoPortD2Ev @ 61 NONAME + _ZN17COmxILPortManager4NewLER24COmxILProcessingFunctionR23MOmxILCallbackManagerIfRK15OMX_VERSIONTYPEmmmmmmmm8OMX_BOOL @ 62 NONAME + _ZN17COmxILPortManager7AddPortEPK10COmxILPort11OMX_DIRTYPE @ 63 NONAME + _ZN19COmxILConfigManager10ConstructLERK6TDesC8RK15OMX_VERSIONTYPERK13RPointerArrayIS0_E @ 64 NONAME + _ZN19COmxILConfigManager12SetParameterE13OMX_INDEXTYPEPKv8OMX_BOOL @ 65 NONAME + _ZN19COmxILConfigManager4NewLER19MOmxILPortManagerIfRK6TDesC8RK15OMX_VERSIONTYPERK13RPointerArrayIS2_E @ 66 NONAME + _ZN19COmxILConfigManager9SetConfigE13OMX_INDEXTYPEPKv @ 67 NONAME + _ZN19COmxILConfigManagerC1ER19MOmxILPortManagerIf @ 68 NONAME + _ZN19COmxILConfigManagerC2ER19MOmxILPortManagerIf @ 69 NONAME + _ZN19COmxILConfigManagerD0Ev @ 70 NONAME + _ZN19COmxILConfigManagerD1Ev @ 71 NONAME + _ZN19COmxILConfigManagerD2Ev @ 72 NONAME + _ZN20TOmxILCommonPortDataC1E15OMX_VERSIONTYPEm11OMX_DIRTYPEmm18OMX_PORTDOMAINTYPE8OMX_BOOLm22OMX_BUFFERSUPPLIERTYPEm @ 73 NONAME + _ZN20TOmxILCommonPortDataC2E15OMX_VERSIONTYPEm11OMX_DIRTYPEmm18OMX_PORTDOMAINTYPE8OMX_BOOLm22OMX_BUFFERSUPPLIERTYPEm @ 74 NONAME + _ZN21COmxILCallbackManager14SetPortManagerER19MOmxILPortManagerIf @ 75 NONAME + _ZN21COmxILCallbackManager17EventNotificationE13OMX_EVENTTYPEmmPc @ 76 NONAME + _ZN21COmxILCallbackManager22BufferDoneNotificationEP20OMX_BUFFERHEADERTYPEm11OMX_DIRTYPE @ 77 NONAME + _ZN21COmxILCallbackManager22ErrorEventNotificationE13OMX_ERRORTYPE @ 78 NONAME + _ZN21COmxILCallbackManager22RegisterTunnelCallbackEm11OMX_DIRTYPEPvm @ 79 NONAME + _ZN21COmxILCallbackManager23BufferRemovalIndicationEP20OMX_BUFFERHEADERTYPE11OMX_DIRTYPE @ 80 NONAME + _ZN21COmxILCallbackManager23RegisterComponentHandleEPv @ 81 NONAME + _ZN21COmxILCallbackManager24DeregisterTunnelCallbackEm @ 82 NONAME + _ZN21COmxILCallbackManager25RegisterILClientCallbacksEPK16OMX_CALLBACKTYPEPv @ 83 NONAME + _ZN21COmxILCallbackManager27ClockBufferDoneNotificationEP20OMX_BUFFERHEADERTYPEm11OMX_DIRTYPE @ 84 NONAME + _ZN21COmxILCallbackManager27CommandCompleteNotificationE15OMX_COMMANDTYPEm @ 85 NONAME + _ZN21COmxILCallbackManager30PortSettingsChangeNotificationEmjRK6TDesC8 @ 86 NONAME + _ZN21COmxILCallbackManager30TransitionCompleteNotificationE13OMX_STATETYPE @ 87 NONAME + _ZN21COmxILCallbackManager33RegisterBufferMarkPropagationPortEmm @ 88 NONAME + _ZN21COmxILCallbackManager4NewLEPvS0_P16OMX_CALLBACKTYPE @ 89 NONAME + _ZN21COmxILCallbackManager6SetFsmER9COmxILFsm @ 90 NONAME + _ZN21COmxILCallbackManagerD0Ev @ 91 NONAME + _ZN21COmxILCallbackManagerD1Ev @ 92 NONAME + _ZN21COmxILCallbackManagerD2Ev @ 93 NONAME + _ZN21COmxILClientClockPort4NewLERK20TOmxILCommonPortDataRK6RArrayI20OMX_OTHER_FORMATTYPEE @ 94 NONAME + _ZN24COmxILProcessingFunction19MediaTimeIndicationERK22OMX_TIME_MEDIATIMETYPE @ 95 NONAME + _ZN24COmxILProcessingFunction23ComponentRoleIndicationEj @ 96 NONAME + _ZN24COmxILProcessingFunctionC2ER28MOmxILCallbackNotificationIf @ 97 NONAME + _ZN24COmxILProcessingFunctionD0Ev @ 98 NONAME + _ZN24COmxILProcessingFunctionD1Ev @ 99 NONAME + _ZN24COmxILProcessingFunctionD2Ev @ 100 NONAME + _ZN27XOmxILCallbackManagerIfImpl16DoSetPortManagerER19MOmxILPortManagerIf @ 101 NONAME + _ZN27XOmxILCallbackManagerIfImpl19DoEventNotificationE13OMX_EVENTTYPEmmPc @ 102 NONAME + _ZN27XOmxILCallbackManagerIfImpl24DoBufferDoneNotificationEP20OMX_BUFFERHEADERTYPEm11OMX_DIRTYPE @ 103 NONAME + _ZN27XOmxILCallbackManagerIfImpl24DoErrorEventNotificationE13OMX_ERRORTYPE @ 104 NONAME + _ZN27XOmxILCallbackManagerIfImpl24DoRegisterTunnelCallbackEm11OMX_DIRTYPEPvm @ 105 NONAME + _ZN27XOmxILCallbackManagerIfImpl25DoRegisterComponentHandleEPv @ 106 NONAME + _ZN27XOmxILCallbackManagerIfImpl27DoRegisterILClientCallbacksEPK16OMX_CALLBACKTYPEPv @ 107 NONAME + _ZN27XOmxILCallbackManagerIfImpl27HandleInsufficientResourcesEv @ 108 NONAME + _ZN27XOmxILCallbackManagerIfImpl28SignalOrPropagateBufferMarksEP20OMX_BUFFERHEADERTYPEm @ 109 NONAME + _ZN27XOmxILCallbackManagerIfImpl29DoCommandCompleteNotificationE15OMX_COMMANDTYPEm @ 110 NONAME + _ZN27XOmxILCallbackManagerIfImpl32DoPortSettingsChangeNotificationEmjRK6TDesC8 @ 111 NONAME + _ZN27XOmxILCallbackManagerIfImpl32DoTransitionCompleteNotificationE13OMX_STATETYPE @ 112 NONAME + _ZN27XOmxILCallbackManagerIfImpl35DoRegisterBufferMarkPropagationPortEmm @ 113 NONAME + _ZN27XOmxILCallbackManagerIfImpl8DoSetFsmER9COmxILFsm @ 114 NONAME + _ZN27XOmxILCallbackManagerIfImplC1EPvS0_P16OMX_CALLBACKTYPE @ 115 NONAME + _ZN27XOmxILCallbackManagerIfImplC2EPvS0_P16OMX_CALLBACKTYPE @ 116 NONAME + _ZN27XOmxILCallbackManagerIfImplD0Ev @ 117 NONAME + _ZN27XOmxILCallbackManagerIfImplD1Ev @ 118 NONAME + _ZN27XOmxILCallbackManagerIfImplD2Ev @ 119 NONAME + _ZN30COmxILInContextCallbackManager14SetPortManagerER19MOmxILPortManagerIf @ 120 NONAME + _ZN30COmxILInContextCallbackManager17EventNotificationE13OMX_EVENTTYPEmmPc @ 121 NONAME + _ZN30COmxILInContextCallbackManager22BufferDoneNotificationEP20OMX_BUFFERHEADERTYPEm11OMX_DIRTYPE @ 122 NONAME + _ZN30COmxILInContextCallbackManager22ErrorEventNotificationE13OMX_ERRORTYPE @ 123 NONAME + _ZN30COmxILInContextCallbackManager22RegisterTunnelCallbackEm11OMX_DIRTYPEPvm @ 124 NONAME + _ZN30COmxILInContextCallbackManager23BufferRemovalIndicationEP20OMX_BUFFERHEADERTYPE11OMX_DIRTYPE @ 125 NONAME + _ZN30COmxILInContextCallbackManager23RegisterComponentHandleEPv @ 126 NONAME + _ZN30COmxILInContextCallbackManager24DeregisterTunnelCallbackEm @ 127 NONAME + _ZN30COmxILInContextCallbackManager25RegisterILClientCallbacksEPK16OMX_CALLBACKTYPEPv @ 128 NONAME + _ZN30COmxILInContextCallbackManager27ClockBufferDoneNotificationEP20OMX_BUFFERHEADERTYPEm11OMX_DIRTYPE @ 129 NONAME + _ZN30COmxILInContextCallbackManager27CommandCompleteNotificationE15OMX_COMMANDTYPEm @ 130 NONAME + _ZN30COmxILInContextCallbackManager30PortSettingsChangeNotificationEmjRK6TDesC8 @ 131 NONAME + _ZN30COmxILInContextCallbackManager30TransitionCompleteNotificationE13OMX_STATETYPE @ 132 NONAME + _ZN30COmxILInContextCallbackManager33RegisterBufferMarkPropagationPortEmm @ 133 NONAME + _ZN30COmxILInContextCallbackManager4NewLEPvS0_P16OMX_CALLBACKTYPE @ 134 NONAME + _ZN30COmxILInContextCallbackManager6SetFsmER9COmxILFsm @ 135 NONAME + _ZN30COmxILInContextCallbackManagerD0Ev @ 136 NONAME + _ZN30COmxILInContextCallbackManagerD1Ev @ 137 NONAME + _ZN30COmxILInContextCallbackManagerD2Ev @ 138 NONAME + _ZN9COmxILFsm4NewLER15COmxILComponentR24COmxILProcessingFunctionR19MOmxILPortManagerIfR19COmxILConfigManagerR23MOmxILCallbackManagerIf @ 139 NONAME + _ZNK10COmxILPort12GetParameterE13OMX_INDEXTYPEPv @ 140 NONAME + _ZNK10COmxILPort14IsBufferAtHomeEP20OMX_BUFFERHEADERTYPE @ 141 NONAME + _ZNK10COmxILPort17GetExtensionIndexEPcP13OMX_INDEXTYPE @ 142 NONAME + _ZNK10COmxILPort19HasAllBuffersAtHomeEv @ 143 NONAME + _ZNK10COmxILPort23GetLocalOmxParamIndexesER6RArrayIjE @ 144 NONAME + _ZNK10COmxILPort24GetLocalOmxConfigIndexesER6RArrayIjE @ 145 NONAME + _ZNK10COmxILPort9GetConfigE13OMX_INDEXTYPEPv @ 146 NONAME + _ZNK15COmxILAudioPort12GetParameterE13OMX_INDEXTYPEPv @ 147 NONAME + _ZNK15COmxILAudioPort23GetLocalOmxParamIndexesER6RArrayIjE @ 148 NONAME + _ZNK15COmxILAudioPort24GetLocalOmxConfigIndexesER6RArrayIjE @ 149 NONAME + _ZNK15COmxILImagePort12GetParameterE13OMX_INDEXTYPEPv @ 150 NONAME + _ZNK15COmxILImagePort23GetLocalOmxParamIndexesER6RArrayIjE @ 151 NONAME + _ZNK15COmxILImagePort24GetLocalOmxConfigIndexesER6RArrayIjE @ 152 NONAME + _ZNK15COmxILOtherPort12GetParameterE13OMX_INDEXTYPEPv @ 153 NONAME + _ZNK15COmxILOtherPort23GetLocalOmxParamIndexesER6RArrayIjE @ 154 NONAME + _ZNK15COmxILOtherPort24GetLocalOmxConfigIndexesER6RArrayIjE @ 155 NONAME + _ZNK15COmxILVideoPort12GetParameterE13OMX_INDEXTYPEPv @ 156 NONAME + _ZNK15COmxILVideoPort23GetLocalOmxParamIndexesER6RArrayIjE @ 157 NONAME + _ZNK15COmxILVideoPort24GetLocalOmxConfigIndexesER6RArrayIjE @ 158 NONAME + _ZNK19COmxILConfigManager12GetParameterE13OMX_INDEXTYPEPv @ 159 NONAME + _ZNK19COmxILConfigManager17ComponentRoleEnumEPhm @ 160 NONAME + _ZNK19COmxILConfigManager17GetExtensionIndexEPcP13OMX_INDEXTYPE @ 161 NONAME + _ZNK19COmxILConfigManager19GetComponentVersionEPcP15OMX_VERSIONTYPES2_PA128_h @ 162 NONAME + _ZNK19COmxILConfigManager9GetConfigE13OMX_INDEXTYPEPv @ 163 NONAME + _ZTI10COmxILPort @ 164 NONAME + _ZTI15COmxILAudioPort @ 165 NONAME + _ZTI15COmxILComponent @ 166 NONAME + _ZTI15COmxILImagePort @ 167 NONAME + _ZTI15COmxILOtherPort @ 168 NONAME + _ZTI15COmxILVideoPort @ 169 NONAME + _ZTI19COmxILConfigManager @ 170 NONAME + _ZTI24COmxILProcessingFunction @ 171 NONAME + _ZTI27XOmxILCallbackManagerIfImpl @ 172 NONAME + _ZTIN21COmxILCallbackManager16CCallbackCommandE @ 173 NONAME + _ZTIN21COmxILCallbackManager21CBufferRemovalCommandE @ 174 NONAME + _ZTIN21COmxILCallbackManager21CEventCallbackCommandE @ 175 NONAME + _ZTIN21COmxILCallbackManager26CBufferDoneCallbackCommandE @ 176 NONAME + _ZTIN21COmxILCallbackManager26CPortSettingsChangeCommandE @ 177 NONAME + _ZTIN21COmxILCallbackManager30CCompHandleRegistrationCommandE @ 178 NONAME + _ZTIN21COmxILCallbackManager34CTunnelCallbackRegistrationCommandE @ 179 NONAME + _ZTIN21COmxILCallbackManager35CClientCallbacksRegistrationCommandE @ 180 NONAME + _ZTIN21COmxILCallbackManager41CBufferMarkPropagationRegistrationCommandE @ 181 NONAME + _ZTIN9COmxILFsm11COmxILStateE @ 182 NONAME + _ZTIN9COmxILFsm15COmxILStateIdleE @ 183 NONAME + _ZTIN9COmxILFsm16COmxILStatePauseE @ 184 NONAME + _ZTIN9COmxILFsm17COmxILStateLoadedE @ 185 NONAME + _ZTIN9COmxILFsm18COmxILStateInvalidE @ 186 NONAME + _ZTIN9COmxILFsm20COmxILStateExecutingE @ 187 NONAME + _ZTIN9COmxILFsm22COmxILStatePauseToIdleE @ 188 NONAME + _ZTIN9COmxILFsm23COmxILStateIdleToLoadedE @ 189 NONAME + _ZTIN9COmxILFsm23COmxILStateLoadedToIdleE @ 190 NONAME + _ZTIN9COmxILFsm26COmxILStateExecutingToIdleE @ 191 NONAME + _ZTIN9COmxILFsm27COmxILStateWaitForResourcesE @ 192 NONAME + _ZTV10COmxILPort @ 193 NONAME + _ZTV15COmxILAudioPort @ 194 NONAME + _ZTV15COmxILComponent @ 195 NONAME + _ZTV15COmxILImagePort @ 196 NONAME + _ZTV15COmxILOtherPort @ 197 NONAME + _ZTV15COmxILVideoPort @ 198 NONAME + _ZTV19COmxILConfigManager @ 199 NONAME + _ZTV24COmxILProcessingFunction @ 200 NONAME + _ZTV27XOmxILCallbackManagerIfImpl @ 201 NONAME + _ZTVN21COmxILCallbackManager16CCallbackCommandE @ 202 NONAME + _ZTVN21COmxILCallbackManager21CBufferRemovalCommandE @ 203 NONAME + _ZTVN21COmxILCallbackManager21CEventCallbackCommandE @ 204 NONAME + _ZTVN21COmxILCallbackManager26CBufferDoneCallbackCommandE @ 205 NONAME + _ZTVN21COmxILCallbackManager26CPortSettingsChangeCommandE @ 206 NONAME + _ZTVN21COmxILCallbackManager30CCompHandleRegistrationCommandE @ 207 NONAME + _ZTVN21COmxILCallbackManager34CTunnelCallbackRegistrationCommandE @ 208 NONAME + _ZTVN21COmxILCallbackManager35CClientCallbacksRegistrationCommandE @ 209 NONAME + _ZTVN21COmxILCallbackManager41CBufferMarkPropagationRegistrationCommandE @ 210 NONAME + _ZTVN9COmxILFsm11COmxILStateE @ 211 NONAME + _ZTVN9COmxILFsm15COmxILStateIdleE @ 212 NONAME + _ZTVN9COmxILFsm16COmxILStatePauseE @ 213 NONAME + _ZTVN9COmxILFsm17COmxILStateLoadedE @ 214 NONAME + _ZTVN9COmxILFsm18COmxILStateInvalidE @ 215 NONAME + _ZTVN9COmxILFsm20COmxILStateExecutingE @ 216 NONAME + _ZTVN9COmxILFsm22COmxILStatePauseToIdleE @ 217 NONAME + _ZTVN9COmxILFsm23COmxILStateIdleToLoadedE @ 218 NONAME + _ZTVN9COmxILFsm23COmxILStateLoadedToIdleE @ 219 NONAME + _ZTVN9COmxILFsm26COmxILStateExecutingToIdleE @ 220 NONAME + _ZTVN9COmxILFsm27COmxILStateWaitForResourcesE @ 221 NONAME + _ZThn28_N21COmxILCallbackManager14SetPortManagerER19MOmxILPortManagerIf @ 222 NONAME + _ZThn28_N21COmxILCallbackManager17EventNotificationE13OMX_EVENTTYPEmmPc @ 223 NONAME + _ZThn28_N21COmxILCallbackManager22BufferDoneNotificationEP20OMX_BUFFERHEADERTYPEm11OMX_DIRTYPE @ 224 NONAME + _ZThn28_N21COmxILCallbackManager22ErrorEventNotificationE13OMX_ERRORTYPE @ 225 NONAME + _ZThn28_N21COmxILCallbackManager22RegisterTunnelCallbackEm11OMX_DIRTYPEPvm @ 226 NONAME + _ZThn28_N21COmxILCallbackManager23BufferRemovalIndicationEP20OMX_BUFFERHEADERTYPE11OMX_DIRTYPE @ 227 NONAME + _ZThn28_N21COmxILCallbackManager23RegisterComponentHandleEPv @ 228 NONAME + _ZThn28_N21COmxILCallbackManager24DeregisterTunnelCallbackEm @ 229 NONAME + _ZThn28_N21COmxILCallbackManager25RegisterILClientCallbacksEPK16OMX_CALLBACKTYPEPv @ 230 NONAME + _ZThn28_N21COmxILCallbackManager27ClockBufferDoneNotificationEP20OMX_BUFFERHEADERTYPEm11OMX_DIRTYPE @ 231 NONAME + _ZThn28_N21COmxILCallbackManager27CommandCompleteNotificationE15OMX_COMMANDTYPEm @ 232 NONAME + _ZThn28_N21COmxILCallbackManager30PortSettingsChangeNotificationEmjRK6TDesC8 @ 233 NONAME + _ZThn28_N21COmxILCallbackManager30TransitionCompleteNotificationE13OMX_STATETYPE @ 234 NONAME + _ZThn28_N21COmxILCallbackManager33RegisterBufferMarkPropagationPortEmm @ 235 NONAME + _ZThn28_N21COmxILCallbackManager6SetFsmER9COmxILFsm @ 236 NONAME + _ZThn28_N21COmxILCallbackManagerD0Ev @ 237 NONAME + _ZThn28_N21COmxILCallbackManagerD1Ev @ 238 NONAME + _ZThn32_N21COmxILCallbackManagerD0Ev @ 239 NONAME + _ZThn32_N21COmxILCallbackManagerD1Ev @ 240 NONAME + _ZThn4_N30COmxILInContextCallbackManager14SetPortManagerER19MOmxILPortManagerIf @ 241 NONAME + _ZThn4_N30COmxILInContextCallbackManager17EventNotificationE13OMX_EVENTTYPEmmPc @ 242 NONAME + _ZThn4_N30COmxILInContextCallbackManager22BufferDoneNotificationEP20OMX_BUFFERHEADERTYPEm11OMX_DIRTYPE @ 243 NONAME + _ZThn4_N30COmxILInContextCallbackManager22ErrorEventNotificationE13OMX_ERRORTYPE @ 244 NONAME + _ZThn4_N30COmxILInContextCallbackManager22RegisterTunnelCallbackEm11OMX_DIRTYPEPvm @ 245 NONAME + _ZThn4_N30COmxILInContextCallbackManager23BufferRemovalIndicationEP20OMX_BUFFERHEADERTYPE11OMX_DIRTYPE @ 246 NONAME + _ZThn4_N30COmxILInContextCallbackManager23RegisterComponentHandleEPv @ 247 NONAME + _ZThn4_N30COmxILInContextCallbackManager24DeregisterTunnelCallbackEm @ 248 NONAME + _ZThn4_N30COmxILInContextCallbackManager25RegisterILClientCallbacksEPK16OMX_CALLBACKTYPEPv @ 249 NONAME + _ZThn4_N30COmxILInContextCallbackManager27ClockBufferDoneNotificationEP20OMX_BUFFERHEADERTYPEm11OMX_DIRTYPE @ 250 NONAME + _ZThn4_N30COmxILInContextCallbackManager27CommandCompleteNotificationE15OMX_COMMANDTYPEm @ 251 NONAME + _ZThn4_N30COmxILInContextCallbackManager30PortSettingsChangeNotificationEmjRK6TDesC8 @ 252 NONAME + _ZThn4_N30COmxILInContextCallbackManager30TransitionCompleteNotificationE13OMX_STATETYPE @ 253 NONAME + _ZThn4_N30COmxILInContextCallbackManager33RegisterBufferMarkPropagationPortEmm @ 254 NONAME + _ZThn4_N30COmxILInContextCallbackManager6SetFsmER9COmxILFsm @ 255 NONAME + _ZThn4_N30COmxILInContextCallbackManagerD0Ev @ 256 NONAME + _ZThn4_N30COmxILInContextCallbackManagerD1Ev @ 257 NONAME + _ZThn52_N17COmxILPortManager7AddPortEPK10COmxILPort11OMX_DIRTYPE @ 258 NONAME + _ZThn8_N30COmxILInContextCallbackManagerD0Ev @ 259 NONAME + _ZThn8_N30COmxILInContextCallbackManagerD1Ev @ 260 NONAME + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/group/bld.inf --- a/omxil/omxilcomponentcommon/group/bld.inf Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/group/bld.inf Fri May 07 16:25:23 2010 +0100 @@ -1,25 +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_EXPORTS -// OMX IL Component Extensions -omxilcomp.iby /epoc32/rom/include/omxilcomp.iby - -PRJ_MMPFILES -// Component common framework -../mmpfiles/omxilcomponentcommon.mmp - - +// 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 + + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/group/multimedia_omx_il_comp.mrp --- a/omxil/omxilcomponentcommon/group/multimedia_omx_il_comp.mrp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/group/multimedia_omx_il_comp.mrp Fri May 07 16:25:23 2010 +0100 @@ -1,27 +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: -# - - -component multimedia_omx_il_comp - -source \sf\os\mm\omxil\omxilcomponentcommon - -binary \sf\os\mm\omxil\omxilcomponentcommon\group all - -exports \sf\os\mm\omxil\omxilcomponentcommon\group - -notes_source \component_defs\release.src - -ipr E +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + + +component multimedia_omx_il_comp + +source \sf\os\mm\omxil\omxilcomponentcommon + +binary \sf\os\mm\omxil\omxilcomponentcommon\group all + +exports \sf\os\mm\omxil\omxilcomponentcommon\group + +notes_source \component_defs\release.src + +ipr E diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/group/omxilcomp.iby --- a/omxil/omxilcomponentcommon/group/omxilcomp.iby Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/group/omxilcomp.iby Fri May 07 16:25:23 2010 +0100 @@ -1,28 +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 +// 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 diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/mmpfiles/omxilcomponentcommon.mmp --- a/omxil/omxilcomponentcommon/mmpfiles/omxilcomponentcommon.mmp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/mmpfiles/omxilcomponentcommon.mmp Fri May 07 16:25:23 2010 +0100 @@ -1,63 +1,63 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// -#include -#include "../src/common/omxilcomponent.hrh" // get UIDs - -TARGET omxilcomponentcommon.dll -CAPABILITY ALL -TCB -TARGETTYPE dll -UID KSharedLibraryUidDefine KUidSymbianOmxILComponentCommonDll -VENDORID 0x70000001 - -OS_LAYER_SYSTEMINCLUDE_SYMBIAN - -USERINCLUDE ../src/common/ - -SOURCEPATH ../src/common/ -SOURCE omxilcomponent.cpp -SOURCE omxilcallbackmanagerifimpl.cpp -SOURCE omxilcallbackmanager.cpp -SOURCE omxilconfigmanager.cpp -SOURCE omxilincontextcallbackmanager.cpp -SOURCE omxilfsm.cpp -SOURCE omxilport.cpp -SOURCE omxilaudioport.cpp -SOURCE omxilportmanager.cpp -SOURCE omxilprocessingfunction.cpp -SOURCE omxilstate.cpp -SOURCE omxilspecversion.cpp -SOURCE omxilutil.cpp -SOURCE omxilimageport.cpp -SOURCE omxilvideoport.cpp -SOURCE omxilotherport.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 - -NOSTRICTDEF - -SMPSAFE +// 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 +#include "../src/common/omxilcomponent.hrh" // get UIDs + +TARGET omxilcomponentcommon.dll +CAPABILITY ALL -TCB +TARGETTYPE dll +UID KSharedLibraryUidDefine KUidSymbianOmxILComponentCommonDll +VENDORID 0x70000001 + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN + +USERINCLUDE ../src/common/ ../../omxilcore/traces + +SOURCEPATH ../src/common/ +SOURCE omxilcomponent.cpp +SOURCE omxilcallbackmanagerifimpl.cpp +SOURCE omxilcallbackmanager.cpp +SOURCE omxilconfigmanager.cpp +SOURCE omxilincontextcallbackmanager.cpp +SOURCE omxilfsm.cpp +SOURCE omxilport.cpp +SOURCE omxilaudioport.cpp +SOURCE omxilportmanager.cpp +SOURCE omxilprocessingfunction.cpp +SOURCE omxilstate.cpp +SOURCE omxilspecversion.cpp +SOURCE omxilutil.cpp +SOURCE omxilimageport.cpp +SOURCE omxilvideoport.cpp +SOURCE omxilotherport.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 + +NOSTRICTDEF + +SMPSAFE diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/log.h --- a/omxil/omxilcomponentcommon/src/common/log.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/log.h Fri May 07 16:25:23 2010 +0100 @@ -1,149 +1,150 @@ -// 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 -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 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 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__ +// 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 "OMX_Trace.h" + +#include +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 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 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__ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilaudioport.cpp --- a/omxil/omxilcomponentcommon/src/common/omxilaudioport.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilaudioport.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,205 +1,205 @@ -// 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 "omxilaudioport.h" -#include "omxilutil.h" - -EXPORT_C -COmxILAudioPort::~COmxILAudioPort() - { - DEBUG_PRINTF(_L8("COmxILAudioPort::~COmxILAudioPort")); - - iSupportedAudioFormats.Close(); - } - - -EXPORT_C -COmxILAudioPort::COmxILAudioPort(const TOmxILCommonPortData& aCommonPortData) -: COmxILPort(aCommonPortData) - { - DEBUG_PRINTF(_L8("COmxILAudioPort::COmxILAudioPort")); - iParamAudioPortFormat.nSize = sizeof(OMX_AUDIO_PARAM_PORTFORMATTYPE); - iParamAudioPortFormat.nVersion = aCommonPortData.iOmxVersion; - iParamAudioPortFormat.nPortIndex = aCommonPortData.iPortIndex; - iParamAudioPortFormat.nIndex = 0; - } - - -// [YYC]: proposal for deep copy, virtual & called from derived CostructL -EXPORT_C void COmxILAudioPort::ConstructL(const RArray& aSupportedAudioFormats) - { - TUint count = aSupportedAudioFormats.Count(); - for (TInt i = 0; i < count; i++) - { - iSupportedAudioFormats.AppendL(aSupportedAudioFormats[i]); - } - iParamAudioPortFormat.eEncoding = count ? iSupportedAudioFormats[0] : OMX_AUDIO_CodingUnused; - } - -EXPORT_C OMX_ERRORTYPE -COmxILAudioPort::GetLocalOmxParamIndexes(RArray& 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& 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")); - - 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(apComponentParameterStructure); - - if (pParamAudioPortFormat->nIndex >= - iSupportedAudioFormats.Count()) - { - return OMX_ErrorNoMore; - } - - pParamAudioPortFormat->eEncoding = - iSupportedAudioFormats[pParamAudioPortFormat->nIndex]; - } - break; - - default: - { - // Try the parent's indexes - return COmxILPort::GetParameter(aParamIndex, apComponentParameterStructure); - } - }; - - return OMX_ErrorNone; - - } - -EXPORT_C OMX_ERRORTYPE -COmxILAudioPort::SetParameter(OMX_INDEXTYPE aParamIndex, - const TAny* apComponentParameterStructure, - TBool& aUpdateProcessingFunction) - { - DEBUG_PRINTF(_L8("COmxILAudioPort::SetParameter")); - - aUpdateProcessingFunction = EFalse; - - OMX_ERRORTYPE omxRetValue = OMX_ErrorNone; - switch(aParamIndex) - { - case OMX_IndexParamAudioPortFormat: - { - if (OMX_ErrorNone != (omxRetValue = - TOmxILUtil::CheckOmxStructSizeAndVersion( - const_cast(apComponentParameterStructure), - sizeof(OMX_AUDIO_PARAM_PORTFORMATTYPE)))) - { - return omxRetValue; - } - - const OMX_AUDIO_PARAM_PORTFORMATTYPE* pParamAudioPortFormat - = static_cast( - apComponentParameterStructure); - - // Check in case the specified format is not actually supported by this - // port - OMX_AUDIO_CODINGTYPE newDefaultCodingType = - pParamAudioPortFormat->eEncoding; - - // OMX_AUDIO_CodingMIDI is the last of the supported values as of - // v1.1.1 - if (newDefaultCodingType > OMX_AUDIO_CodingMIDI) - { - 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: - { - // Try the parent's indexes - return COmxILPort::SetParameter(aParamIndex, - apComponentParameterStructure, - aUpdateProcessingFunction); - } - }; - - return OMX_ErrorNone; - - } +// 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 "omxilaudioport.h" +#include "omxilutil.h" + +EXPORT_C +COmxILAudioPort::~COmxILAudioPort() + { + DEBUG_PRINTF(_L8("COmxILAudioPort::~COmxILAudioPort")); + + iSupportedAudioFormats.Close(); + } + + +EXPORT_C +COmxILAudioPort::COmxILAudioPort(const TOmxILCommonPortData& aCommonPortData) +: COmxILPort(aCommonPortData) + { + DEBUG_PRINTF(_L8("COmxILAudioPort::COmxILAudioPort")); + iParamAudioPortFormat.nSize = sizeof(OMX_AUDIO_PARAM_PORTFORMATTYPE); + iParamAudioPortFormat.nVersion = aCommonPortData.iOmxVersion; + iParamAudioPortFormat.nPortIndex = aCommonPortData.iPortIndex; + iParamAudioPortFormat.nIndex = 0; + } + + +// [YYC]: proposal for deep copy, virtual & called from derived CostructL +EXPORT_C void COmxILAudioPort::ConstructL(const RArray& aSupportedAudioFormats) + { + TUint count = aSupportedAudioFormats.Count(); + for (TInt i = 0; i < count; i++) + { + iSupportedAudioFormats.AppendL(aSupportedAudioFormats[i]); + } + iParamAudioPortFormat.eEncoding = count ? iSupportedAudioFormats[0] : OMX_AUDIO_CodingUnused; + } + +EXPORT_C OMX_ERRORTYPE +COmxILAudioPort::GetLocalOmxParamIndexes(RArray& 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& 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")); + + 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(apComponentParameterStructure); + + if (pParamAudioPortFormat->nIndex >= + iSupportedAudioFormats.Count()) + { + return OMX_ErrorNoMore; + } + + pParamAudioPortFormat->eEncoding = + iSupportedAudioFormats[pParamAudioPortFormat->nIndex]; + } + break; + + default: + { + // Try the parent's indexes + return COmxILPort::GetParameter(aParamIndex, apComponentParameterStructure); + } + }; + + return OMX_ErrorNone; + + } + +EXPORT_C OMX_ERRORTYPE +COmxILAudioPort::SetParameter(OMX_INDEXTYPE aParamIndex, + const TAny* apComponentParameterStructure, + TBool& aUpdateProcessingFunction) + { + DEBUG_PRINTF(_L8("COmxILAudioPort::SetParameter")); + + aUpdateProcessingFunction = EFalse; + + OMX_ERRORTYPE omxRetValue = OMX_ErrorNone; + switch(aParamIndex) + { + case OMX_IndexParamAudioPortFormat: + { + if (OMX_ErrorNone != (omxRetValue = + TOmxILUtil::CheckOmxStructSizeAndVersion( + const_cast(apComponentParameterStructure), + sizeof(OMX_AUDIO_PARAM_PORTFORMATTYPE)))) + { + return omxRetValue; + } + + const OMX_AUDIO_PARAM_PORTFORMATTYPE* pParamAudioPortFormat + = static_cast( + apComponentParameterStructure); + + // Check in case the specified format is not actually supported by this + // port + OMX_AUDIO_CODINGTYPE newDefaultCodingType = + pParamAudioPortFormat->eEncoding; + + // OMX_AUDIO_CodingMIDI is the last of the supported values as of + // v1.1.1 + if (newDefaultCodingType > OMX_AUDIO_CodingMIDI) + { + 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: + { + // Try the parent's indexes + return COmxILPort::SetParameter(aParamIndex, + apComponentParameterStructure, + aUpdateProcessingFunction); + } + }; + + return OMX_ErrorNone; + + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilaudioport.h --- a/omxil/omxilcomponentcommon/src/common/omxilaudioport.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilaudioport.h Fri May 07 16:25:23 2010 +0100 @@ -1,77 +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: -// - - -/** - @file - @internalComponent -*/ - -#ifndef OMXILAUDIOPORT_H -#define OMXILAUDIOPORT_H - -#include - -#include -#include -#include - -#include "omxilport.h" - -class COmxILAudioPort : public COmxILPort - { - -public: - - IMPORT_C ~COmxILAudioPort(); - - // From COmxILPort - IMPORT_C OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray& aIndexArray) const = 0; - - // From COmxILPort - IMPORT_C OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray& 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; - -protected: - - IMPORT_C COmxILAudioPort(const TOmxILCommonPortData& aCommonPortData); - IMPORT_C virtual void ConstructL(const RArray& aSupportedAudioFormats); - - - // From COmxILPort - IMPORT_C OMX_ERRORTYPE SetFormatInPortDefinition( - const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, - TBool& aUpdateProcessingFunction) = 0; - - // From COmxILPort - IMPORT_C TBool IsTunnelledPortCompatible( - const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const = 0; - -protected: - - RArray iSupportedAudioFormats; - OMX_AUDIO_PARAM_PORTFORMATTYPE iParamAudioPortFormat; - - }; - -#endif // OMXILAUDIOPORT_H - +// 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 OMXILAUDIOPORT_H +#define OMXILAUDIOPORT_H + +#include + +#include +#include +#include + +#include "omxilport.h" + +class COmxILAudioPort : public COmxILPort + { + +public: + + IMPORT_C ~COmxILAudioPort(); + + // From COmxILPort + IMPORT_C OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray& aIndexArray) const = 0; + + // From COmxILPort + IMPORT_C OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray& 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; + +protected: + + IMPORT_C COmxILAudioPort(const TOmxILCommonPortData& aCommonPortData); + IMPORT_C virtual void ConstructL(const RArray& aSupportedAudioFormats); + + + // From COmxILPort + IMPORT_C OMX_ERRORTYPE SetFormatInPortDefinition( + const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, + TBool& aUpdateProcessingFunction) = 0; + + // From COmxILPort + IMPORT_C TBool IsTunnelledPortCompatible( + const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const = 0; + +protected: + + RArray iSupportedAudioFormats; + OMX_AUDIO_PARAM_PORTFORMATTYPE iParamAudioPortFormat; + + }; + +#endif // OMXILAUDIOPORT_H + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilcallbackmanager.cpp --- a/omxil/omxilcomponentcommon/src/common/omxilcallbackmanager.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilcallbackmanager.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,1046 +1,1047 @@ -// 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 "omxilportmanager.h" -#include "omxilfsm.h" -#include "omxilutil.h" - -const TInt COmxILCallbackManager::KMaxMsgQueueEntries; - - -EXPORT_C 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(apComponentHandle), - apAppData, - apCallbacks), - iCommandQueue(), - iPendingQueue(), - iFlushPendingQueue(EFalse), - iCurrentState(OMX_StateLoaded), - iPreviousState(OMX_StateLoaded) - { - DEBUG_PRINTF(_L8("COmxILCallbackManager::COmxILCallbackManager")); - } - -EXPORT_C -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(); - - } - - -EXPORT_C void -COmxILCallbackManager::SetPortManager(COmxILPortManager& apPortManager) - { - DoSetPortManager(apPortManager); - } - -EXPORT_C void -COmxILCallbackManager::SetFsm(COmxILFsm& apFsm) - { - DoSetFsm(apFsm); - } - -EXPORT_C 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 - */ -EXPORT_C 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; - - } - -EXPORT_C 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; - - } - -EXPORT_C OMX_ERRORTYPE -COmxILCallbackManager::DeregisterTunnelCallback( - OMX_U32 aLocalPortIndex) - { - - DEBUG_PRINTF(_L8("COmxILCallbackManager::DeregisterTunnelCallback")); - - return RegisterTunnelCallback(aLocalPortIndex, - OMX_DirMax, - 0, - 0); - - } - -EXPORT_C 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; - - } - -EXPORT_C 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; - - } - -EXPORT_C OMX_ERRORTYPE -COmxILCallbackManager::TransitionCompleteNotification(OMX_STATETYPE aOmxState) - { - DEBUG_PRINTF(_L8("COmxILCallbackManager::TransitionCompleteNotification")); - - return EventNotificationImpl(OMX_EventCmdComplete, - OMX_CommandStateSet, - aOmxState, - 0); - - } - - -EXPORT_C OMX_ERRORTYPE -COmxILCallbackManager::CommandCompleteNotification(OMX_COMMANDTYPE aOmxCommand, - OMX_U32 aOmxPortIndex) - { - DEBUG_PRINTF(_L8("COmxILCallbackManager::CommandCompleteNotification")); - - return EventNotification(OMX_EventCmdComplete, - aOmxCommand, - aOmxPortIndex, - 0); - - } - - -EXPORT_C OMX_ERRORTYPE -COmxILCallbackManager::ErrorEventNotification(OMX_ERRORTYPE aOmxError) - { - DEBUG_PRINTF2(_L8("COmxILCallbackManager::ErrorEventNotification : aOmxError[%X] "), aOmxError); - - return EventNotification(OMX_EventError, - aOmxError, - 0, - 0); - - } - -EXPORT_C 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; - - } - - -EXPORT_C 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); - - } - -EXPORT_C 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); - - } - -EXPORT_C 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 frontQueueIter(iFrontQueue); - TFrontQueueElement* pLastElement = iFrontQueue.Last(); - TFrontQueueElement* pCurrentElement = 0; - - do - { - pCurrentElement = frontQueueIter++; - __ASSERT_DEBUG(pCurrentElement && pCurrentElement->ipInfo, - User::Panic(KOmxILCallbackManagerPanicCategory, 1)); - removed = reinterpret_cast( - const_cast(pCurrentElement->ipInfo))-> - DoRemoveBufferDoneCbCommandByBufferHeader(aCbMgr, - apBufferHeader, - aDirection); - if (removed) - { - pCurrentElement->iLink.Deque(); - delete reinterpret_cast( - const_cast(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 frontQueueIter(iFrontQueue); - TFrontQueueElement* pLastElement = iFrontQueue.Last(); - TFrontQueueElement* pCurrentElement = 0; - - do - { - pCurrentElement = frontQueueIter++; - __ASSERT_DEBUG(pCurrentElement && pCurrentElement->ipInfo, - User::Panic(KOmxILCallbackManagerPanicCategory, 1)); - removed = reinterpret_cast( - const_cast(pCurrentElement->ipInfo))-> - DoRemoveBufferDoneCbCommandByPortIndex(aCbMgr, - aLocalPortIndex); - if (removed) - { - somethingRemoved = ETrue; - pCurrentElement->iLink.Deque(); - delete reinterpret_cast( - const_cast(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 frontQueueIter(iFrontQueue); - TFrontQueueElement* pLastElement = iFrontQueue.Last(); - TFrontQueueElement* pCurrentElement = 0; - - do - { - pCurrentElement = frontQueueIter++; - __ASSERT_DEBUG(pCurrentElement && pCurrentElement->ipInfo, - User::Panic(KOmxILCallbackManagerPanicCategory, 1)); - executed = reinterpret_cast( - const_cast(pCurrentElement->ipInfo))-> - DoExecuteBufferDoneCbCommandByPortIndex(aCbMgr, - aLocalPortIndex); - if (executed) - { - somethingExecuted = ETrue; - pCurrentElement->iLink.Deque(); - delete reinterpret_cast( - const_cast(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(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(apBufferHeader)); - - if (aDirection == OMX_DirInput) - { - aCbMgr.ipFsm->EmptyThisBuffer( - const_cast(apBufferHeader)); - } - else - { - aCbMgr.ipFsm->FillThisBuffer( - const_cast(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(); - } - - } +// 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 "omxilutil.h" +#include "omxilportmanagerif.h" + +const TInt COmxILCallbackManager::KMaxMsgQueueEntries; + + +EXPORT_C 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(apComponentHandle), + apAppData, + apCallbacks), + iCommandQueue(), + iPendingQueue(), + iFlushPendingQueue(EFalse), + iCurrentState(OMX_StateLoaded), + iPreviousState(OMX_StateLoaded) + { + DEBUG_PRINTF(_L8("COmxILCallbackManager::COmxILCallbackManager")); + } + +EXPORT_C +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(); + + } + + +EXPORT_C void +COmxILCallbackManager::SetPortManager(MOmxILPortManagerIf& apPortManager) + { + DoSetPortManager(apPortManager); + } + +EXPORT_C void +COmxILCallbackManager::SetFsm(COmxILFsm& apFsm) + { + DoSetFsm(apFsm); + } + +EXPORT_C 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 + */ +EXPORT_C 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; + + } + +EXPORT_C 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; + + } + +EXPORT_C OMX_ERRORTYPE +COmxILCallbackManager::DeregisterTunnelCallback( + OMX_U32 aLocalPortIndex) + { + + DEBUG_PRINTF(_L8("COmxILCallbackManager::DeregisterTunnelCallback")); + + return RegisterTunnelCallback(aLocalPortIndex, + OMX_DirMax, + 0, + 0); + + } + +EXPORT_C 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; + + } + +EXPORT_C 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; + + } + +EXPORT_C OMX_ERRORTYPE +COmxILCallbackManager::TransitionCompleteNotification(OMX_STATETYPE aOmxState) + { + DEBUG_PRINTF(_L8("COmxILCallbackManager::TransitionCompleteNotification")); + + return EventNotificationImpl(OMX_EventCmdComplete, + OMX_CommandStateSet, + aOmxState, + 0); + + } + + +EXPORT_C OMX_ERRORTYPE +COmxILCallbackManager::CommandCompleteNotification(OMX_COMMANDTYPE aOmxCommand, + OMX_U32 aOmxPortIndex) + { + DEBUG_PRINTF(_L8("COmxILCallbackManager::CommandCompleteNotification")); + + return EventNotification(OMX_EventCmdComplete, + aOmxCommand, + aOmxPortIndex, + 0); + + } + +EXPORT_C OMX_ERRORTYPE +COmxILCallbackManager::ErrorEventNotification(OMX_ERRORTYPE aOmxError) + { + DEBUG_PRINTF2(_L8("COmxILCallbackManager::ErrorEventNotification : aOmxError[%X] "), aOmxError); + + return EventNotification(OMX_EventError, + aOmxError, + 0, + 0); + + } + +EXPORT_C 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; + + } + + +EXPORT_C 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); + + } + +EXPORT_C 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); + + } + +EXPORT_C 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 frontQueueIter(iFrontQueue); + TFrontQueueElement* pLastElement = iFrontQueue.Last(); + TFrontQueueElement* pCurrentElement = 0; + + do + { + pCurrentElement = frontQueueIter++; + __ASSERT_DEBUG(pCurrentElement && pCurrentElement->ipInfo, + User::Panic(KOmxILCallbackManagerPanicCategory, 1)); + removed = reinterpret_cast( + const_cast(pCurrentElement->ipInfo))-> + DoRemoveBufferDoneCbCommandByBufferHeader(aCbMgr, + apBufferHeader, + aDirection); + if (removed) + { + pCurrentElement->iLink.Deque(); + delete reinterpret_cast( + const_cast(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 frontQueueIter(iFrontQueue); + TFrontQueueElement* pLastElement = iFrontQueue.Last(); + TFrontQueueElement* pCurrentElement = 0; + + do + { + pCurrentElement = frontQueueIter++; + __ASSERT_DEBUG(pCurrentElement && pCurrentElement->ipInfo, + User::Panic(KOmxILCallbackManagerPanicCategory, 1)); + removed = reinterpret_cast( + const_cast(pCurrentElement->ipInfo))-> + DoRemoveBufferDoneCbCommandByPortIndex(aCbMgr, + aLocalPortIndex); + if (removed) + { + somethingRemoved = ETrue; + pCurrentElement->iLink.Deque(); + delete reinterpret_cast( + const_cast(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 frontQueueIter(iFrontQueue); + TFrontQueueElement* pLastElement = iFrontQueue.Last(); + TFrontQueueElement* pCurrentElement = 0; + + do + { + pCurrentElement = frontQueueIter++; + __ASSERT_DEBUG(pCurrentElement && pCurrentElement->ipInfo, + User::Panic(KOmxILCallbackManagerPanicCategory, 1)); + executed = reinterpret_cast( + const_cast(pCurrentElement->ipInfo))-> + DoExecuteBufferDoneCbCommandByPortIndex(aCbMgr, + aLocalPortIndex); + if (executed) + { + somethingExecuted = ETrue; + pCurrentElement->iLink.Deque(); + delete reinterpret_cast( + const_cast(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(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(apBufferHeader)); + + if (aDirection == OMX_DirInput) + { + aCbMgr.ipFsm->EmptyThisBuffer( + const_cast(apBufferHeader)); + } + else + { + aCbMgr.ipFsm->FillThisBuffer( + const_cast(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(); + } + + } + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilcallbackmanager.h --- a/omxil/omxilcomponentcommon/src/common/omxilcallbackmanager.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilcallbackmanager.h Fri May 07 16:25:23 2010 +0100 @@ -1,495 +1,495 @@ -// 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 - -#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; - - // 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; - -public: - - IMPORT_C static COmxILCallbackManager* NewL( - OMX_HANDLETYPE apComponentHandle, - OMX_PTR apAppData, - OMX_CALLBACKTYPE* apCallbacks); - - IMPORT_C ~COmxILCallbackManager(); - - IMPORT_C void SetPortManager(COmxILPortManager& apPortManager); - - IMPORT_C void SetFsm(COmxILFsm& apFsm); - - - // - // Methods for Callback Registration (from MOmxILCallbackManagerIf) - // - - IMPORT_C OMX_ERRORTYPE RegisterComponentHandle( - OMX_HANDLETYPE aComponentHandle); - - IMPORT_C OMX_ERRORTYPE RegisterILClientCallbacks( - const OMX_CALLBACKTYPE* apCallbacks, - const OMX_PTR apAppData); - - IMPORT_C OMX_ERRORTYPE RegisterTunnelCallback( - OMX_U32 aLocalPortIndex, - OMX_DIRTYPE aLocalPortDirection, - OMX_HANDLETYPE aTunnelledComponentHandle, - OMX_U32 aTunnelledPortIndex - ); - - IMPORT_C OMX_ERRORTYPE DeregisterTunnelCallback( - OMX_U32 aLocalPortIndex); - - IMPORT_C OMX_ERRORTYPE RegisterBufferMarkPropagationPort( - OMX_U32 aPortIndex, - OMX_U32 aPropagationPortIndex); - - IMPORT_C TBool BufferRemovalIndication( - OMX_BUFFERHEADERTYPE* apBufferHeader, - OMX_DIRTYPE aDirection); - - - // - // Methods for Callback Notification (from MOmxILCallbackManagerIf) - // - - IMPORT_C OMX_ERRORTYPE TransitionCompleteNotification( - OMX_STATETYPE aOmxState); - - IMPORT_C OMX_ERRORTYPE CommandCompleteNotification( - OMX_COMMANDTYPE aOmxCommand, - OMX_U32 aOmxPortIndex); - - // - // Methods for Callback Notification (from MOmxILCallbackManagerIf) - // - - IMPORT_C OMX_ERRORTYPE ErrorEventNotification( - OMX_ERRORTYPE aOmxError); - - IMPORT_C OMX_ERRORTYPE EventNotification( - OMX_EVENTTYPE aEvent, - TUint32 aData1, - TUint32 aData2, - OMX_STRING aExtraInfo); - - IMPORT_C OMX_ERRORTYPE BufferDoneNotification( - OMX_BUFFERHEADERTYPE* apBufferHeader, - OMX_U32 aLocalPortIndex, - OMX_DIRTYPE aLocalPortDirection); - - IMPORT_C OMX_ERRORTYPE ClockBufferDoneNotification( - OMX_BUFFERHEADERTYPE* apBufferHeader, - OMX_U32 aLocalPortIndex, - OMX_DIRTYPE aLocalPortDirection); - - IMPORT_C OMX_ERRORTYPE PortSettingsChangeNotification( - OMX_U32 aLocalPortIndex, - TUint aPortSettingsIndex, - const TDesC8& aPortSettings); - - // - // From CActive - // -private: - void RunL(); - void DoCancel(); - -private: - - // Convenience typedef - typedef RPriMsgQueue 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 - - }; - -#include "omxilcallbackmanager.inl" - -#endif // OMXILCALLBACKMANAGER_H +// 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 + +#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; + + // 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; + +public: + + IMPORT_C static COmxILCallbackManager* NewL( + OMX_HANDLETYPE apComponentHandle, + OMX_PTR apAppData, + OMX_CALLBACKTYPE* apCallbacks); + + IMPORT_C ~COmxILCallbackManager(); + + IMPORT_C void SetPortManager(MOmxILPortManagerIf& apPortManager); + + IMPORT_C void SetFsm(COmxILFsm& apFsm); + + + // + // Methods for Callback Registration (from MOmxILCallbackManagerIf) + // + + IMPORT_C OMX_ERRORTYPE RegisterComponentHandle( + OMX_HANDLETYPE aComponentHandle); + + IMPORT_C OMX_ERRORTYPE RegisterILClientCallbacks( + const OMX_CALLBACKTYPE* apCallbacks, + const OMX_PTR apAppData); + + IMPORT_C OMX_ERRORTYPE RegisterTunnelCallback( + OMX_U32 aLocalPortIndex, + OMX_DIRTYPE aLocalPortDirection, + OMX_HANDLETYPE aTunnelledComponentHandle, + OMX_U32 aTunnelledPortIndex + ); + + IMPORT_C OMX_ERRORTYPE DeregisterTunnelCallback( + OMX_U32 aLocalPortIndex); + + IMPORT_C OMX_ERRORTYPE RegisterBufferMarkPropagationPort( + OMX_U32 aPortIndex, + OMX_U32 aPropagationPortIndex); + + IMPORT_C TBool BufferRemovalIndication( + OMX_BUFFERHEADERTYPE* apBufferHeader, + OMX_DIRTYPE aDirection); + + + // + // Methods for Callback Notification (from MOmxILCallbackManagerIf) + // + + IMPORT_C OMX_ERRORTYPE TransitionCompleteNotification( + OMX_STATETYPE aOmxState); + + IMPORT_C OMX_ERRORTYPE CommandCompleteNotification( + OMX_COMMANDTYPE aOmxCommand, + OMX_U32 aOmxPortIndex); + + // + // Methods for Callback Notification (from MOmxILCallbackManagerIf) + // + + IMPORT_C OMX_ERRORTYPE ErrorEventNotification( + OMX_ERRORTYPE aOmxError); + + IMPORT_C OMX_ERRORTYPE EventNotification( + OMX_EVENTTYPE aEvent, + TUint32 aData1, + TUint32 aData2, + OMX_STRING aExtraInfo); + + IMPORT_C OMX_ERRORTYPE BufferDoneNotification( + OMX_BUFFERHEADERTYPE* apBufferHeader, + OMX_U32 aLocalPortIndex, + OMX_DIRTYPE aLocalPortDirection); + + IMPORT_C OMX_ERRORTYPE ClockBufferDoneNotification( + OMX_BUFFERHEADERTYPE* apBufferHeader, + OMX_U32 aLocalPortIndex, + OMX_DIRTYPE aLocalPortDirection); + + IMPORT_C OMX_ERRORTYPE PortSettingsChangeNotification( + OMX_U32 aLocalPortIndex, + TUint aPortSettingsIndex, + const TDesC8& aPortSettings); + + // + // From CActive + // +private: + void RunL(); + void DoCancel(); + +private: + + // Convenience typedef + typedef RPriMsgQueue 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 + + }; + +#include "omxilcallbackmanager.inl" + +#endif // OMXILCALLBACKMANAGER_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilcallbackmanager.inl --- a/omxil/omxilcomponentcommon/src/common/omxilcallbackmanager.inl Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilcallbackmanager.inl Fri May 07 16:25:23 2010 +0100 @@ -1,135 +1,135 @@ -// 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(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) - { - } - +// 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(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) + { + } + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilcallbackmanagerif.h --- a/omxil/omxilcomponentcommon/src/common/omxilcallbackmanagerif.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilcallbackmanagerif.h Fri May 07 16:25:23 2010 +0100 @@ -1,181 +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 OMXILCALLBACKMANAGERIF_H -#define OMXILCALLBACKMANAGERIF_H - -#include - -#include "omxilcallbacknotificationif.h" - -// Forward declarations -class COmxILPortManager; -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(COmxILPortManager& 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; - - }; - -#include "omxilcallbackmanagerif.inl" - -#endif // OMXILCALLBACKMANAGERIF_H +// 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 + +#include "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; + + }; + +#include "omxilcallbackmanagerif.inl" + +#endif // OMXILCALLBACKMANAGERIF_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilcallbackmanagerif.inl --- a/omxil/omxilcomponentcommon/src/common/omxilcallbackmanagerif.inl Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilcallbackmanagerif.inl Fri May 07 16:25:23 2010 +0100 @@ -1,24 +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() - { - } +// 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() + { + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilcallbackmanagerifimpl.cpp --- a/omxil/omxilcomponentcommon/src/common/omxilcallbackmanagerifimpl.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilcallbackmanagerifimpl.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,502 +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 -*/ - -#include "log.h" -#include "omxilcallbackmanagerifimpl.h" -#include "omxilportmanager.h" -#include "omxilfsm.h" - - -EXPORT_C -XOmxILCallbackManagerIfImpl::XOmxILCallbackManagerIfImpl(OMX_HANDLETYPE apComponentHandle, - OMX_PTR apAppData, - OMX_CALLBACKTYPE* apCallbacks) - : - ipHandle(static_cast(apComponentHandle)), - ipAppData(apAppData), - ipCallbacks(apCallbacks), - iRegisteredTunnels(), - iBufferMarkPropagationPorts(), - iBufferMarks(), - ipPortManager(0), - ipFsm(0) - { - DEBUG_PRINTF(_L8("XOmxILCallbackManagerIfImpl::XOmxILCallbackManagerIfImpl")); - } - -EXPORT_C -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; - - } - -EXPORT_C void -XOmxILCallbackManagerIfImpl::DoSetPortManager(COmxILPortManager& apPortManager) - { - ipPortManager = &apPortManager; - } - -EXPORT_C void -XOmxILCallbackManagerIfImpl::DoSetFsm(COmxILFsm& apFsm) - { - ipFsm = &apFsm; - } - -EXPORT_C OMX_ERRORTYPE -XOmxILCallbackManagerIfImpl::DoRegisterComponentHandle(OMX_HANDLETYPE aComponentHandle) - { - DEBUG_PRINTF(_L8("XOmxILCallbackManagerIfImpl::DoRegisterComponentHandle")); - - __ASSERT_DEBUG(aComponentHandle, - User::Panic(KOmxILCallbackManagerIfImplPanicCategory, 1)); - - ipHandle = static_cast(aComponentHandle); - - return OMX_ErrorNone; - - } - - -EXPORT_C OMX_ERRORTYPE -XOmxILCallbackManagerIfImpl::DoRegisterILClientCallbacks(const OMX_CALLBACKTYPE* apCallbacks, - const OMX_PTR apAppData) - { - DEBUG_PRINTF(_L8("XOmxILCallbackManagerIfImpl::DoRegisterILClientCallbacks")); - - ipAppData = const_cast(apAppData); - ipCallbacks = const_cast(apCallbacks); - - return OMX_ErrorNone; - - } - -EXPORT_C 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; iEventHandler(ipHandle, - ipAppData, - aEvent, - aData1, - aData2, - aExtraInfo); - return OMX_ErrorNone; - - } - - -EXPORT_C 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( - 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. - fp2CBackHandler(ipHandle, - ipAppData, - apBufferHeader); - } - - return OMX_ErrorNone; - - } - -EXPORT_C 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; - - } - -EXPORT_C 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::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::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); - } - } - - } - - - } - -EXPORT_C 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); - } - } +// 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 "omxilspecversion.h" + + +EXPORT_C +XOmxILCallbackManagerIfImpl::XOmxILCallbackManagerIfImpl(OMX_HANDLETYPE apComponentHandle, + OMX_PTR apAppData, + OMX_CALLBACKTYPE* apCallbacks) + : + ipHandle(static_cast(apComponentHandle)), + ipAppData(apAppData), + ipCallbacks(apCallbacks), + iRegisteredTunnels(), + iBufferMarkPropagationPorts(), + iBufferMarks(), + ipPortManager(0), + ipFsm(0) + { + DEBUG_PRINTF(_L8("XOmxILCallbackManagerIfImpl::XOmxILCallbackManagerIfImpl")); + } + +EXPORT_C +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; + + } + +EXPORT_C void +XOmxILCallbackManagerIfImpl::DoSetPortManager(MOmxILPortManagerIf& apPortManager) + { + ipPortManager = &apPortManager; + } + +EXPORT_C void +XOmxILCallbackManagerIfImpl::DoSetFsm(COmxILFsm& apFsm) + { + ipFsm = &apFsm; + } + +EXPORT_C OMX_ERRORTYPE +XOmxILCallbackManagerIfImpl::DoRegisterComponentHandle(OMX_HANDLETYPE aComponentHandle) + { + DEBUG_PRINTF(_L8("XOmxILCallbackManagerIfImpl::DoRegisterComponentHandle")); + + __ASSERT_DEBUG(aComponentHandle, + User::Panic(KOmxILCallbackManagerIfImplPanicCategory, 1)); + + ipHandle = static_cast(aComponentHandle); + + return OMX_ErrorNone; + + } + + +EXPORT_C OMX_ERRORTYPE +XOmxILCallbackManagerIfImpl::DoRegisterILClientCallbacks(const OMX_CALLBACKTYPE* apCallbacks, + const OMX_PTR apAppData) + { + DEBUG_PRINTF(_L8("XOmxILCallbackManagerIfImpl::DoRegisterILClientCallbacks")); + + ipAppData = const_cast(apAppData); + ipCallbacks = const_cast(apCallbacks); + + return OMX_ErrorNone; + + } + +EXPORT_C 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; iEventHandler(ipHandle, + ipAppData, + aEvent, + aData1, + aData2, + aExtraInfo); + OMX_TRACE_EVENTHANDLER_OUT(ipHandle, ipAppData, aEvent, aData1, aData2, aExtraInfo, OMX_ErrorNone); + return OMX_ErrorNone; + + } + + +EXPORT_C 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( + 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; + + } + +EXPORT_C 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; + + } + +EXPORT_C 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::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::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); + } + } + + } + + + } + +EXPORT_C 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); + } + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilcallbackmanagerifimpl.h --- a/omxil/omxilcomponentcommon/src/common/omxilcallbackmanagerifimpl.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilcallbackmanagerifimpl.h Fri May 07 16:25:23 2010 +0100 @@ -1,231 +1,231 @@ -// 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 - -/** - Call Back ManagerIf Impl Panic category -*/ -_LIT(KOmxILCallbackManagerIfImplPanicCategory, "OmxILCallbackManagerIfImpl"); - -// Forward declarations -class COmxILPortManager; -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: - - IMPORT_C XOmxILCallbackManagerIfImpl(OMX_HANDLETYPE apComponentHandle, - OMX_PTR apAppData, - OMX_CALLBACKTYPE* apCallbacks); - - IMPORT_C virtual ~XOmxILCallbackManagerIfImpl(); - - IMPORT_C virtual void DoSetPortManager(COmxILPortManager& apPortManager); - - IMPORT_C virtual void DoSetFsm(COmxILFsm& apFsm); - - // - // Methods for Callback Registration - // - IMPORT_C virtual OMX_ERRORTYPE DoRegisterComponentHandle( - OMX_HANDLETYPE aComponentHandle); - - IMPORT_C virtual OMX_ERRORTYPE DoRegisterILClientCallbacks( - const OMX_CALLBACKTYPE* apCallbacks, - const OMX_PTR apAppData); - - IMPORT_C virtual OMX_ERRORTYPE DoRegisterTunnelCallback( - OMX_U32 aLocalPortIndex, - OMX_DIRTYPE aLocalPortDirection, - OMX_HANDLETYPE aTunnelledComponentHandle, - OMX_U32 aTunnelledPortIndex); - - IMPORT_C virtual OMX_ERRORTYPE DoRegisterBufferMarkPropagationPort( - OMX_U32 aPortIndex, - OMX_U32 aPropagationPortIndex); - - // - // Methods for Callback Notification - // - - IMPORT_C virtual OMX_ERRORTYPE DoTransitionCompleteNotification( - OMX_STATETYPE aOmxState); - - IMPORT_C virtual OMX_ERRORTYPE DoCommandCompleteNotification( - OMX_COMMANDTYPE aOmxCommand, - OMX_U32 aOmxPortIndex); - - // - // Methods for Callback Notification - // - - IMPORT_C virtual OMX_ERRORTYPE DoErrorEventNotification( - OMX_ERRORTYPE aOmxError); - - IMPORT_C virtual OMX_ERRORTYPE DoEventNotification( - OMX_EVENTTYPE aEvent, - TUint32 aData1, - TUint32 aData2, - OMX_STRING aExtraInfo); - - IMPORT_C virtual OMX_ERRORTYPE DoBufferDoneNotification( - OMX_BUFFERHEADERTYPE* apBufferHeader, - OMX_U32 aLocalPortIndex, - OMX_DIRTYPE aLocalPortDirection); - - IMPORT_C virtual OMX_ERRORTYPE DoPortSettingsChangeNotification( - OMX_U32 aLocalPortIndex, - TUint aPortSettingsIndex, - const TDesC8& aPortSettings); - - IMPORT_C virtual void SignalOrPropagateBufferMarks(OMX_BUFFERHEADERTYPE* apBufferHeader, - OMX_U32 aLocalPortIndex); - - IMPORT_C 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 iRegisteredTunnels; - - // Associations between input and output ports to be used in buffer marks - // propagation - RArray iBufferMarkPropagationPorts; - - // Temporary store of buffer marks waiting to go out in the next output - // buffer - RArray iBufferMarks; - - // Port manager - COmxILPortManager* 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 +// 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 + +/** + 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: + + IMPORT_C XOmxILCallbackManagerIfImpl(OMX_HANDLETYPE apComponentHandle, + OMX_PTR apAppData, + OMX_CALLBACKTYPE* apCallbacks); + + IMPORT_C virtual ~XOmxILCallbackManagerIfImpl(); + + IMPORT_C virtual void DoSetPortManager(MOmxILPortManagerIf& apPortManager); + + IMPORT_C virtual void DoSetFsm(COmxILFsm& apFsm); + + // + // Methods for Callback Registration + // + IMPORT_C virtual OMX_ERRORTYPE DoRegisterComponentHandle( + OMX_HANDLETYPE aComponentHandle); + + IMPORT_C virtual OMX_ERRORTYPE DoRegisterILClientCallbacks( + const OMX_CALLBACKTYPE* apCallbacks, + const OMX_PTR apAppData); + + IMPORT_C virtual OMX_ERRORTYPE DoRegisterTunnelCallback( + OMX_U32 aLocalPortIndex, + OMX_DIRTYPE aLocalPortDirection, + OMX_HANDLETYPE aTunnelledComponentHandle, + OMX_U32 aTunnelledPortIndex); + + IMPORT_C virtual OMX_ERRORTYPE DoRegisterBufferMarkPropagationPort( + OMX_U32 aPortIndex, + OMX_U32 aPropagationPortIndex); + + // + // Methods for Callback Notification + // + + IMPORT_C virtual OMX_ERRORTYPE DoTransitionCompleteNotification( + OMX_STATETYPE aOmxState); + + IMPORT_C virtual OMX_ERRORTYPE DoCommandCompleteNotification( + OMX_COMMANDTYPE aOmxCommand, + OMX_U32 aOmxPortIndex); + + // + // Methods for Callback Notification + // + + IMPORT_C virtual OMX_ERRORTYPE DoErrorEventNotification( + OMX_ERRORTYPE aOmxError); + + IMPORT_C virtual OMX_ERRORTYPE DoEventNotification( + OMX_EVENTTYPE aEvent, + TUint32 aData1, + TUint32 aData2, + OMX_STRING aExtraInfo); + + IMPORT_C virtual OMX_ERRORTYPE DoBufferDoneNotification( + OMX_BUFFERHEADERTYPE* apBufferHeader, + OMX_U32 aLocalPortIndex, + OMX_DIRTYPE aLocalPortDirection); + + IMPORT_C virtual OMX_ERRORTYPE DoPortSettingsChangeNotification( + OMX_U32 aLocalPortIndex, + TUint aPortSettingsIndex, + const TDesC8& aPortSettings); + + IMPORT_C virtual void SignalOrPropagateBufferMarks(OMX_BUFFERHEADERTYPE* apBufferHeader, + OMX_U32 aLocalPortIndex); + + IMPORT_C 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 iRegisteredTunnels; + + // Associations between input and output ports to be used in buffer marks + // propagation + RArray iBufferMarkPropagationPorts; + + // Temporary store of buffer marks waiting to go out in the next output + // buffer + RArray 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 diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilcallbackmanagerifimpl.inl --- a/omxil/omxilcomponentcommon/src/common/omxilcallbackmanagerifimpl.inl Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilcallbackmanagerifimpl.inl Fri May 07 16:25:23 2010 +0100 @@ -1,78 +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) - { - } +// 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) + { + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilcallbacknotificationif.h --- a/omxil/omxilcomponentcommon/src/common/omxilcallbacknotificationif.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilcallbacknotificationif.h Fri May 07 16:25:23 2010 +0100 @@ -1,130 +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 - -#include - - -/** - 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 - - +// 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 + +#include + + +/** + 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 + + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilclientclockport.cpp --- a/omxil/omxilcomponentcommon/src/common/omxilclientclockport.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilclientclockport.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,225 +1,225 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// - - -/** - @file - @internalComponent -*/ - -#include "omxilclientclockport.h" -#include "log.h" - - -EXPORT_C COmxILClientClockPort* COmxILClientClockPort::NewL(const TOmxILCommonPortData& aCommonPortData, - const RArray& aSupportedOtherFormats) - { - COmxILClientClockPort* self = new(ELeave) COmxILClientClockPort(aCommonPortData); - CleanupStack::PushL(self); - self->COmxILOtherPort::ConstructL(aSupportedOtherFormats); - CleanupStack::Pop(); - return self; - } - -COmxILClientClockPort::COmxILClientClockPort(const TOmxILCommonPortData& aCommonPortData) - : COmxILOtherPort(aCommonPortData), - iSpecVersion(TOmxILSpecVersion()) - { - DEBUG_PRINTF(_L8("COmxILClientClockPort::COmxILClientClockPort")); - } - -OMX_ERRORTYPE COmxILClientClockPort::GetLocalOmxParamIndexes(RArray& aIndexArray) const - { - DEBUG_PRINTF(_L8("COmxILClientClockPort::GetLocalOmxParamIndexes")); - return COmxILOtherPort::GetLocalOmxParamIndexes(aIndexArray); - } - - -OMX_ERRORTYPE COmxILClientClockPort::GetLocalOmxConfigIndexes(RArray& 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 != iParamPortDefinition.eDomain) - { - return EFalse; - } - - // Format check - if (aPortDefinition.format.other.eFormat != iParamPortDefinition.format.other.eFormat) - { - return EFalse; - } - - return ETrue; - } - - -EXPORT_C OMX_ERRORTYPE COmxILClientClockPort::GetMediaTime(OMX_TICKS& aMediaTime) const - { - DEBUG_PRINTF(_L8("COmxILClientClockPort::GetMediaTime")); - return GetTime(aMediaTime, OMX_IndexConfigTimeCurrentMediaTime); - } - - -EXPORT_C OMX_ERRORTYPE COmxILClientClockPort::GetWallTime(OMX_TICKS& aWallTime) const - { - DEBUG_PRINTF(_L8("COmxILClientClockPort::GetWallTime")); - return GetTime(aWallTime, OMX_IndexConfigTimeCurrentWallTime); - } - - -EXPORT_C 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(iTunnelledComponent, OMX_IndexConfigTimeClockState, &aClockState); - } - - return OMX_ErrorIncorrectStateOperation; - - } - -EXPORT_C 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 = iTunnelledPort; - timeInfo.pClientPrivate = apPrivate; - timeInfo.nMediaTimestamp = aMediaTime; - timeInfo.nOffset = aOffset; - - if (IsClockComponentAvailable()) - { - return OMX_SetConfig(iTunnelledComponent, OMX_IndexConfigTimeMediaTimeRequest, &timeInfo); - } - - return OMX_ErrorIncorrectStateOperation; - } - - -EXPORT_C OMX_ERRORTYPE COmxILClientClockPort::SetStartTime(const OMX_TICKS aStartTime) const - { - DEBUG_PRINTF(_L8("COmxILClientClockPort::SetStartTime")); - return SetTime(aStartTime, OMX_IndexConfigTimeClientStartTime); - } - - -EXPORT_C OMX_ERRORTYPE COmxILClientClockPort::SetVideoReference(const OMX_TICKS aVideoRef) const - { - DEBUG_PRINTF(_L8("COmxILClientClockPort::SetVideoReference")); - return SetTime(aVideoRef, OMX_IndexConfigTimeCurrentVideoReference); - } - - -EXPORT_C OMX_ERRORTYPE COmxILClientClockPort::SetAudioReference(const OMX_TICKS aAudioRef) const - { - DEBUG_PRINTF(_L8("COmxILClientClockPort::SetAudioReference")); - return SetTime(aAudioRef, OMX_IndexConfigTimeCurrentAudioReference); - } - -EXPORT_C OMX_BOOL COmxILClientClockPort::IsClockComponentAvailable() const -{ - if (iTunnelledComponent != NULL && iParamPortDefinition.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 = iTunnelledPort; - - if (!IsClockComponentAvailable()) - { - return OMX_ErrorIncorrectStateOperation; - } - - OMX_ERRORTYPE error = OMX_GetConfig(iTunnelledComponent, 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 = iTunnelledPort; - timeInfo.nTimestamp = aStartTime; - - if (IsClockComponentAvailable()) - { - return OMX_SetConfig(iTunnelledComponent, aTimeIndex, &timeInfo); - } - - return OMX_ErrorIncorrectStateOperation; - } +// 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 "omxilclientclockport.h" +#include "log.h" + + +EXPORT_C COmxILClientClockPort* COmxILClientClockPort::NewL(const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedOtherFormats) + { + COmxILClientClockPort* self = new(ELeave) COmxILClientClockPort(aCommonPortData); + CleanupStack::PushL(self); + self->COmxILOtherPort::ConstructL(aSupportedOtherFormats); + CleanupStack::Pop(); + return self; + } + +COmxILClientClockPort::COmxILClientClockPort(const TOmxILCommonPortData& aCommonPortData) + : COmxILOtherPort(aCommonPortData), + iSpecVersion(TOmxILSpecVersion()) + { + DEBUG_PRINTF(_L8("COmxILClientClockPort::COmxILClientClockPort")); + } + +OMX_ERRORTYPE COmxILClientClockPort::GetLocalOmxParamIndexes(RArray& aIndexArray) const + { + DEBUG_PRINTF(_L8("COmxILClientClockPort::GetLocalOmxParamIndexes")); + return COmxILOtherPort::GetLocalOmxParamIndexes(aIndexArray); + } + + +OMX_ERRORTYPE COmxILClientClockPort::GetLocalOmxConfigIndexes(RArray& 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 != iParamPortDefinition.eDomain) + { + return EFalse; + } + + // Format check + if (aPortDefinition.format.other.eFormat != iParamPortDefinition.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(iTunnelledComponent, 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 = iTunnelledPort; + timeInfo.pClientPrivate = apPrivate; + timeInfo.nMediaTimestamp = aMediaTime; + timeInfo.nOffset = aOffset; + + if (IsClockComponentAvailable()) + { + return OMX_SetConfig(iTunnelledComponent, 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 (iTunnelledComponent != NULL && iParamPortDefinition.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 = iTunnelledPort; + + if (!IsClockComponentAvailable()) + { + return OMX_ErrorIncorrectStateOperation; + } + + OMX_ERRORTYPE error = OMX_GetConfig(iTunnelledComponent, 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 = iTunnelledPort; + timeInfo.nTimestamp = aStartTime; + + if (IsClockComponentAvailable()) + { + return OMX_SetConfig(iTunnelledComponent, aTimeIndex, &timeInfo); + } + + return OMX_ErrorIncorrectStateOperation; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilclientclockport.h --- a/omxil/omxilcomponentcommon/src/common/omxilclientclockport.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilclientclockport.h Fri May 07 16:25:23 2010 +0100 @@ -1,92 +1,92 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// - - -/** - @file - @internalComponent -*/ - -#ifndef OMXILCLIENTCLOCKPORT_H -#define OMXILCLIENTCLOCKPORT_H - -#include "omxilotherport.h" -#include "omxilclockcomponentcmdsif.h" - -NONSHARABLE_CLASS(COmxILClientClockPort) : public COmxILOtherPort, public MOmxILClockComponentCmdsIf - { -public: - IMPORT_C static COmxILClientClockPort* NewL(const TOmxILCommonPortData& aCommonPortData, - const RArray& aSupportedOtherFormats); - - // From MOmxILClockComponentCmdsIf - IMPORT_C OMX_ERRORTYPE GetMediaTime(OMX_TICKS& aMediaTime) const; - - // From MOmxILClockComponentCmdsIf - IMPORT_C OMX_ERRORTYPE GetWallTime(OMX_TICKS& aWallTime) const; - - // From MOmxILClockComponentCmdsIf - IMPORT_C OMX_ERRORTYPE GetClockState(OMX_TIME_CONFIG_CLOCKSTATETYPE& aClockState) const; - - // From MOmxILClockComponentCmdsIf - IMPORT_C OMX_ERRORTYPE MediaTimeRequest(const OMX_PTR apPrivate, const OMX_TICKS aMediaTime, const OMX_TICKS aOffset) const; - - // From MOmxILClockComponentCmdsIf - IMPORT_C OMX_ERRORTYPE SetStartTime(const OMX_TICKS aStartTime) const; - - // From MOmxILClockComponentCmdsIf - IMPORT_C OMX_ERRORTYPE SetVideoReference(const OMX_TICKS aVideRef) const; - - // From MOmxILClockComponentCmdsIf - IMPORT_C OMX_ERRORTYPE SetAudioReference(const OMX_TICKS aAudioRef) const; - - // From MOmxILClockComponentCmdsIf - IMPORT_C OMX_BOOL IsClockComponentAvailable() const; - - // From COmxILPort - OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray& aIndexArray) const; - - // From COmxILPort - OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray& 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: - - COmxILClientClockPort(const TOmxILCommonPortData& aCommonPortData); - - 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 +// 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 "omxilotherport.h" +#include "omxilclockcomponentcmdsif.h" + +NONSHARABLE_CLASS(COmxILClientClockPort) : public COmxILOtherPort, public MOmxILClockComponentCmdsIf + { +public: + IMPORT_C static COmxILClientClockPort* NewL(const TOmxILCommonPortData& aCommonPortData, + const RArray& 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& aIndexArray) const; + + // From COmxILPort + OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray& 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: + + COmxILClientClockPort(const TOmxILCommonPortData& aCommonPortData); + + 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 diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilclockcomponentcmdsif.h --- a/omxil/omxilcomponentcommon/src/common/omxilclockcomponentcmdsif.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilclockcomponentcmdsif.h Fri May 07 16:25:23 2010 +0100 @@ -1,107 +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 - -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 - +// 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 + +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 + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilcommand.h --- a/omxil/omxilcomponentcommon/src/common/omxilcommand.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilcommand.h Fri May 07 16:25:23 2010 +0100 @@ -1,54 +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 - -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 +// 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 + +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 diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilcomponent.cpp --- a/omxil/omxilcomponentcommon/src/common/omxilcomponent.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilcomponent.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,395 +1,431 @@ -// 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 "omxilcomponent.h" -#include "omxilfsm.h" -#include "omxilcallbackmanager.h" -#include "omxilconfigmanager.h" - - -EXPORT_C -COmxILComponent::COmxILComponent() - { - DEBUG_PRINTF(_L8("COmxILComponent::COmxILComponent")); - - } - - -EXPORT_C -COmxILComponent::~COmxILComponent() - { - DEBUG_PRINTF2(_L8("COmxILComponent::~COmxILComponent : Handle[%X]"), ipHandle); - iComponentName.Close(); - } - - -EXPORT_C void -COmxILComponent::InitComponentL() - { - DEBUG_PRINTF2(_L8("COmxILComponent::InitComponent : Handle[%X]"), ipHandle); - - __ASSERT_ALWAYS(ipHandle && ipFsm && ipConfigManager, User::Invariant()); - - 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(reinterpret_cast(componentNamebuffer)); - iComponentName.CreateL(componentNameBuf8, componentNameBuf8.Length() + 1); - iComponentName.PtrZ(); - DEBUG_PRINTF2(_L8("COmxILComponent::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->GetComponentVersion = COmxILComponent::GetComponentVersion; - ipHandle->SendCommand = COmxILComponent::SendCommand; - ipHandle->GetParameter = COmxILComponent::GetParameter; - ipHandle->SetParameter = COmxILComponent::SetParameter; - ipHandle->GetConfig = COmxILComponent::GetConfig; - ipHandle->SetConfig = COmxILComponent::SetConfig; - ipHandle->GetExtensionIndex = COmxILComponent::GetExtensionIndex; - ipHandle->GetState = COmxILComponent::GetState; - ipHandle->ComponentTunnelRequest = COmxILComponent::ComponentTunnelRequest; - ipHandle->UseBuffer = COmxILComponent::UseBuffer; - ipHandle->AllocateBuffer = COmxILComponent::AllocateBuffer; - ipHandle->FreeBuffer = COmxILComponent::FreeBuffer; - ipHandle->EmptyThisBuffer = COmxILComponent::EmptyThisBuffer; - ipHandle->FillThisBuffer = COmxILComponent::FillThisBuffer; - ipHandle->SetCallbacks = COmxILComponent::SetCallbacks; - ipHandle->ComponentDeInit = COmxILComponent::ComponentDeInit; - ipHandle->UseEGLImage = COmxILComponent::UseEGLImage; - ipHandle->ComponentRoleEnum = COmxILComponent::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(); - - } - -OMX_ERRORTYPE -COmxILComponent::GetComponentVersion( - OMX_HANDLETYPE aComponent, - OMX_STRING aComponentName, - OMX_VERSIONTYPE* apComponentVersion, - OMX_VERSIONTYPE* apSpecVersion, - OMX_UUIDTYPE* apComponentUUID) - { - DEBUG_PRINTF2(_L8("COmxILComponent::GetComponentVersion : Handle[%X]"), aComponent); - OMX_ERRORTYPE omxError; - omxError = (static_cast - ((static_cast(aComponent))->pComponentPrivate))-> - GetComponentVersion(aComponentName, apComponentVersion, - apSpecVersion, apComponentUUID); - return omxError; - } - -OMX_ERRORTYPE -COmxILComponent::SendCommand( - OMX_HANDLETYPE aComponent, - OMX_COMMANDTYPE aCmd, - OMX_U32 aParam1, - OMX_PTR aCmdData) - { - DEBUG_PRINTF2(_L8("COmxILComponent::SendCommand : Handle[%X]"), aComponent); - OMX_ERRORTYPE omxError; - omxError = (static_cast - ((static_cast(aComponent))->pComponentPrivate))-> - SendCommand(aCmd ,aParam1, aCmdData); - - return omxError; - } - -OMX_ERRORTYPE -COmxILComponent::GetParameter( - OMX_HANDLETYPE aComponent, - OMX_INDEXTYPE aParamIndex, - OMX_PTR aComponentParameterStructure) - { - DEBUG_PRINTF3(_L8("COmxILComponent::GetParameter : Handle[%X]; ParamIndex[0x%X]"), aComponent, aParamIndex); - - OMX_ERRORTYPE omxError; - omxError = (static_cast - ((static_cast(aComponent))->pComponentPrivate))-> - GetParameter(aParamIndex, aComponentParameterStructure); - - return omxError; - } - -OMX_ERRORTYPE -COmxILComponent::SetParameter( - OMX_HANDLETYPE aComponent, - OMX_INDEXTYPE aIndex, - OMX_PTR aComponentParameterStructure) - { - DEBUG_PRINTF3(_L8("COmxILComponent::SetParameter : Handle[%X]; ParamIndex[0x%X]"), aComponent, aIndex); - - OMX_ERRORTYPE omxError; - omxError = (static_cast - ((static_cast(aComponent))->pComponentPrivate))-> - SetParameter(aIndex, - const_cast(aComponentParameterStructure)); - - return omxError; - } - -OMX_ERRORTYPE -COmxILComponent::GetConfig( - OMX_HANDLETYPE aComponent, - OMX_INDEXTYPE aIndex, - OMX_PTR aComponentParameterStructure) - { - DEBUG_PRINTF3(_L8("COmxILComponent::GetConfig : Handle[%X]; ConfigIndex[0x%X]"), aComponent, aIndex); - OMX_ERRORTYPE omxError; - omxError = (static_cast - ((static_cast(aComponent))->pComponentPrivate))-> - GetConfig(aIndex, aComponentParameterStructure); - return omxError; - } - -OMX_ERRORTYPE -COmxILComponent::SetConfig( - OMX_HANDLETYPE aComponent, - OMX_INDEXTYPE aIndex, - OMX_PTR aComponentConfigStructure) - { - DEBUG_PRINTF3(_L8("COmxILComponent::SetConfig : Handle[%X]; ConfigIndex[0x%X]"), aComponent, aIndex); - OMX_ERRORTYPE omxError; - omxError = (static_cast - ((static_cast(aComponent))->pComponentPrivate))-> - SetConfig(aIndex, const_cast(aComponentConfigStructure)); - return omxError; - } - -OMX_ERRORTYPE -COmxILComponent::GetExtensionIndex( - OMX_HANDLETYPE aComponent, - OMX_STRING aParameterName, - OMX_INDEXTYPE* aIndexType) - { - DEBUG_PRINTF2(_L8("COmxILComponent::GetExtensionIndex : Handle[%X]"), aComponent); - OMX_ERRORTYPE omxError; - omxError = (static_cast - ((static_cast(aComponent))->pComponentPrivate))-> - GetExtensionIndex(aParameterName, aIndexType); - return omxError; - } - -OMX_ERRORTYPE -COmxILComponent::GetState( - OMX_HANDLETYPE aComponent, - OMX_STATETYPE* aState) - { - DEBUG_PRINTF2(_L8("COmxILComponent::GetState : Handle[%X]"), aComponent); - OMX_ERRORTYPE omxError; - omxError = (static_cast - ((static_cast(aComponent))->pComponentPrivate))-> - GetState(aState); - return omxError; - } - -OMX_ERRORTYPE -COmxILComponent::ComponentTunnelRequest( - OMX_HANDLETYPE aComponent, - OMX_U32 aPort, - OMX_HANDLETYPE aTunneledComp, - OMX_U32 aTunneledPort, - OMX_TUNNELSETUPTYPE* aTunnelSetup) - { - DEBUG_PRINTF2(_L8("COmxILComponent::ComponentTunnelRequest : Handle[%X]"), aComponent); - OMX_ERRORTYPE omxError; - omxError = (static_cast - ((static_cast(aComponent))->pComponentPrivate))-> - ComponentTunnelRequest(aPort, aTunneledComp, - aTunneledPort, aTunnelSetup); - return omxError; - } - -OMX_ERRORTYPE -COmxILComponent::UseBuffer( - OMX_HANDLETYPE aComponent, - OMX_BUFFERHEADERTYPE** appBufferHdr, - OMX_U32 aPortIndex, - OMX_PTR apAppPrivate, - OMX_U32 aSizeBytes, - OMX_U8* aBuffer) - { - DEBUG_PRINTF2(_L8("COmxILComponent::UseBuffer : Handle[%X]"), aComponent); - OMX_ERRORTYPE omxError; - omxError = (static_cast - ((static_cast(aComponent))->pComponentPrivate))-> - UseBuffer(appBufferHdr, aPortIndex, apAppPrivate, aSizeBytes, aBuffer); - return omxError; - } - -OMX_ERRORTYPE -COmxILComponent::AllocateBuffer( - OMX_HANDLETYPE aComponent, - OMX_BUFFERHEADERTYPE** apBuffer, - OMX_U32 aPortIndex, - OMX_PTR aAppData, - OMX_U32 aSizeBytes) - { - DEBUG_PRINTF2(_L8("COmxILComponent::AllocateBuffer : Handle[%X]"), aComponent); - OMX_ERRORTYPE omxError; - omxError = (static_cast - ((static_cast(aComponent))->pComponentPrivate))-> - AllocateBuffer(apBuffer, aPortIndex, aAppData, aSizeBytes); - return omxError; - } - -OMX_ERRORTYPE -COmxILComponent::FreeBuffer( - OMX_HANDLETYPE aComponent, - OMX_U32 aPortIndex, - OMX_BUFFERHEADERTYPE* aBuffer) - { - DEBUG_PRINTF2(_L8("COmxILComponent::FreeBuffer : Handle[%X]"), aComponent); - OMX_ERRORTYPE omxError; - omxError = (static_cast - ((static_cast(aComponent))->pComponentPrivate))-> - FreeBuffer(aPortIndex, aBuffer); - return omxError; - } - -OMX_ERRORTYPE -COmxILComponent::EmptyThisBuffer( - OMX_HANDLETYPE aComponent, - OMX_BUFFERHEADERTYPE* aBuffer) - { - DEBUG_PRINTF2(_L8("COmxILComponent::EmptyThisBuffer : Handle[%X]"), aComponent); -#ifdef _OMXIL_COMMON_BUFFER_TRACING_ON - RDebug::Print(_L("COmxILComponent::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 - ((static_cast(aComponent))->pComponentPrivate))-> - EmptyThisBuffer(aBuffer); - - return omxError; - } - -OMX_ERRORTYPE -COmxILComponent::FillThisBuffer( - OMX_HANDLETYPE aComponent, - OMX_BUFFERHEADERTYPE* aBuffer) - { - DEBUG_PRINTF2(_L8("COmxILComponent::FillThisBuffer : Handle[%X]"), aComponent); -#ifdef _OMXIL_COMMON_BUFFER_TRACING_ON - RDebug::Print(_L("COmxILComponent::FillThisBuffer component=0x%08X header=0x%08X port=%d"), aComponent, aBuffer, aBuffer->nOutputPortIndex); -#endif - - OMX_ERRORTYPE omxError; - omxError = (static_cast - ((static_cast(aComponent))->pComponentPrivate))-> - FillThisBuffer(aBuffer); - - return omxError; - } - -OMX_ERRORTYPE -COmxILComponent::SetCallbacks( - OMX_HANDLETYPE aComponent, - OMX_CALLBACKTYPE* aCallbacks, - OMX_PTR aAppData) - { - DEBUG_PRINTF2(_L8("COmxILComponent::SetCallbacks : Handle[%X]"), aComponent); - OMX_ERRORTYPE omxError; - omxError = (static_cast - ((static_cast(aComponent))->pComponentPrivate))-> - SetCallbacks(const_cast(aCallbacks), aAppData); - return omxError; - } - -OMX_ERRORTYPE -COmxILComponent::ComponentDeInit( - OMX_HANDLETYPE aComponent) - { - DEBUG_PRINTF2(_L8("COmxILComponent::ComponentDeInit : Handle[%X]"), aComponent); - delete (static_cast( - (static_cast( - (static_cast(aComponent))-> - pComponentPrivate))->GetComponent())); - return OMX_ErrorNone; - } - -OMX_ERRORTYPE -COmxILComponent::UseEGLImage( - OMX_HANDLETYPE aComponent, - OMX_BUFFERHEADERTYPE** appBufferHdr, - OMX_U32 aPortIndex, - OMX_PTR aAppPrivate, - void* eglImage) - { - DEBUG_PRINTF2(_L8("COmxILComponent::UseEGLImage : Handle[%X]"), aComponent); - OMX_ERRORTYPE omxError; - omxError = (static_cast - ((static_cast(aComponent))->pComponentPrivate))-> - UseEGLImage(appBufferHdr, aPortIndex, aAppPrivate, eglImage); - return omxError; - } - -OMX_ERRORTYPE -COmxILComponent::ComponentRoleEnum( - OMX_HANDLETYPE aComponent, - OMX_U8* aRole, - OMX_U32 aIndex) - { - DEBUG_PRINTF2(_L8("COmxILComponent::ComponentRoleEnum : Handle[%X]"), aComponent); - OMX_ERRORTYPE omxError; - omxError = (static_cast - ((static_cast(aComponent))->pComponentPrivate))-> - ComponentRoleEnum(aRole, aIndex); - return omxError; - } - -/*static*/ 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; - } +// 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 "omxilcomponent.h" +#include "omxilfsm.h" +#include "omxilcallbackmanager.h" +#include "omxilconfigmanager.h" + + +EXPORT_C +COmxILComponent::COmxILComponent() + { + DEBUG_PRINTF(_L8("COmxILComponent::COmxILComponent")); + + } + + +EXPORT_C +COmxILComponent::~COmxILComponent() + { + DEBUG_PRINTF2(_L8("COmxILComponent::~COmxILComponent : Handle[%08X]"), ipHandle); + iComponentName.Close(); + } + + +EXPORT_C void +COmxILComponent::InitComponentL() + { + DEBUG_PRINTF2(_L8("COmxILComponent::InitComponent : Handle[%08X]"), ipHandle); + + __ASSERT_ALWAYS(ipHandle && ipFsm && ipConfigManager, User::Invariant()); + + 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(reinterpret_cast(componentNamebuffer)); + iComponentName.CreateL(componentNameBuf8, componentNameBuf8.Length() + 1); + iComponentName.PtrZ(); + DEBUG_PRINTF2(_L8("COmxILComponent::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->GetComponentVersion = COmxILComponent::GetComponentVersion; + ipHandle->SendCommand = COmxILComponent::SendCommand; + ipHandle->GetParameter = COmxILComponent::GetParameter; + ipHandle->SetParameter = COmxILComponent::SetParameter; + ipHandle->GetConfig = COmxILComponent::GetConfig; + ipHandle->SetConfig = COmxILComponent::SetConfig; + ipHandle->GetExtensionIndex = COmxILComponent::GetExtensionIndex; + ipHandle->GetState = COmxILComponent::GetState; + ipHandle->ComponentTunnelRequest = COmxILComponent::ComponentTunnelRequest; + ipHandle->UseBuffer = COmxILComponent::UseBuffer; + ipHandle->AllocateBuffer = COmxILComponent::AllocateBuffer; + ipHandle->FreeBuffer = COmxILComponent::FreeBuffer; + ipHandle->EmptyThisBuffer = COmxILComponent::EmptyThisBuffer; + ipHandle->FillThisBuffer = COmxILComponent::FillThisBuffer; + ipHandle->SetCallbacks = COmxILComponent::SetCallbacks; + ipHandle->ComponentDeInit = COmxILComponent::ComponentDeInit; + ipHandle->UseEGLImage = COmxILComponent::UseEGLImage; + ipHandle->ComponentRoleEnum = COmxILComponent::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(); + + } + +OMX_ERRORTYPE +COmxILComponent::GetComponentVersion( + OMX_HANDLETYPE aComponent, + OMX_STRING aComponentName, + OMX_VERSIONTYPE* apComponentVersion, + OMX_VERSIONTYPE* apSpecVersion, + OMX_UUIDTYPE* apComponentUUID) + { + OMX_TRACE_GETCOMPONENTVERSION_IN(aComponent, aComponentName, aComponentVersion, aSpecVersion, aComponentUUID); + DEBUG_PRINTF2(_L8("COmxILComponent::GetComponentVersion : Handle[%08X]"), aComponent); + OMX_ERRORTYPE omxError; + omxError = (static_cast + ((static_cast(aComponent))->pComponentPrivate))-> + GetComponentVersion(aComponentName, apComponentVersion, + apSpecVersion, apComponentUUID); + OMX_TRACE_GETCOMPONENTVERSION_OUT(aComponent, aComponentName, aComponentVersion, aSpecVersion, aComponentUUID, omxError); + return omxError; + } + +OMX_ERRORTYPE +COmxILComponent::SendCommand( + OMX_HANDLETYPE aComponent, + OMX_COMMANDTYPE aCmd, + OMX_U32 aParam1, + OMX_PTR aCmdData) + { + OMX_TRACE_SENDCOMMAND_IN(aComponent, aCmd, aParam1, aCmdData); + DEBUG_PRINTF2(_L8("COmxILComponent::SendCommand : Handle[%08X]"), aComponent); + OMX_ERRORTYPE omxError; + omxError = (static_cast + ((static_cast(aComponent))->pComponentPrivate))-> + SendCommand(aCmd ,aParam1, aCmdData); + + OMX_TRACE_SENDCOMMAND_OUT(aComponent, aCmd, aParam1, aCmdData, omxError); + return omxError; + } + +OMX_ERRORTYPE +COmxILComponent::GetParameter( + OMX_HANDLETYPE aComponent, + OMX_INDEXTYPE aParamIndex, + OMX_PTR aComponentParameterStructure) + { + OMX_TRACE_GETPARAMETER_IN(aComponent, aParamIndex, aComponentParameterStructure); + DEBUG_PRINTF3(_L8("COmxILComponent::GetParameter : Handle[%08X]; ParamIndex[0x%08X]"), aComponent, aParamIndex); + + OMX_ERRORTYPE omxError; + omxError = (static_cast + ((static_cast(aComponent))->pComponentPrivate))-> + GetParameter(aParamIndex, aComponentParameterStructure); + + OMX_TRACE_GETPARAMETER_OUT(aComponent, aParamIndex, aComponentParameterStructure, omxError); + return omxError; + } + +OMX_ERRORTYPE +COmxILComponent::SetParameter( + OMX_HANDLETYPE aComponent, + OMX_INDEXTYPE aIndex, + OMX_PTR aComponentParameterStructure) + { + OMX_TRACE_SETPARAMETER_IN(aComponent, aIndex, aComponentParameterStructure); + DEBUG_PRINTF3(_L8("COmxILComponent::SetParameter : Handle[%08X]; ParamIndex[0x%08X]"), aComponent, aIndex); + + OMX_ERRORTYPE omxError; + omxError = (static_cast + ((static_cast(aComponent))->pComponentPrivate))-> + SetParameter(aIndex, + const_cast(aComponentParameterStructure)); + + OMX_TRACE_SETPARAMETER_OUT(aComponent, aIndex, aComponentParameterStructure, omxError); + return omxError; + } + +OMX_ERRORTYPE +COmxILComponent::GetConfig( + OMX_HANDLETYPE aComponent, + OMX_INDEXTYPE aIndex, + OMX_PTR aComponentParameterStructure) + { + OMX_TRACE_GETCONFIG_IN(aComponent, aIndex, aComponentParameterStructure); + DEBUG_PRINTF3(_L8("COmxILComponent::GetConfig : Handle[%08X]; ConfigIndex[0x%08X]"), aComponent, aIndex); + OMX_ERRORTYPE omxError; + omxError = (static_cast + ((static_cast(aComponent))->pComponentPrivate))-> + GetConfig(aIndex, aComponentParameterStructure); + OMX_TRACE_GETCONFIG_OUT(aComponent, aIndex, aComponentParameterStructure, omxError); + return omxError; + } + +OMX_ERRORTYPE +COmxILComponent::SetConfig( + OMX_HANDLETYPE aComponent, + OMX_INDEXTYPE aIndex, + OMX_PTR aComponentConfigStructure) + { + OMX_TRACE_SETCONFIG_IN(aComponent, aIndex, aComponentConfigStructure); + DEBUG_PRINTF3(_L8("COmxILComponent::SetConfig : Handle[%08X]; ConfigIndex[0x%08X]"), aComponent, aIndex); + OMX_ERRORTYPE omxError; + omxError = (static_cast + ((static_cast(aComponent))->pComponentPrivate))-> + SetConfig(aIndex, const_cast(aComponentConfigStructure)); + OMX_TRACE_SETCONFIG_OUT(aComponent, aIndex, aComponentConfigStructure, omxError); + return omxError; + } + +OMX_ERRORTYPE +COmxILComponent::GetExtensionIndex( + OMX_HANDLETYPE aComponent, + OMX_STRING aParameterName, + OMX_INDEXTYPE* aIndexType) + { + OMX_TRACE_GETEXTENSIONINDEX_IN(aComponent, aParameterName, aIndexType); + DEBUG_PRINTF2(_L8("COmxILComponent::GetExtensionIndex : Handle[%08X]"), aComponent); + OMX_ERRORTYPE omxError; + omxError = (static_cast + ((static_cast(aComponent))->pComponentPrivate))-> + GetExtensionIndex(aParameterName, aIndexType); + OMX_TRACE_GETEXTENSIONINDEX_OUT(aComponent, aParameterName, aIndexType, omxError); + return omxError; + } + +OMX_ERRORTYPE +COmxILComponent::GetState( + OMX_HANDLETYPE aComponent, + OMX_STATETYPE* aState) + { + OMX_TRACE_GETSTATE_IN(aComponent, aState); + DEBUG_PRINTF2(_L8("COmxILComponent::GetState : Handle[%08X]"), aComponent); + OMX_ERRORTYPE omxError; + omxError = (static_cast + ((static_cast(aComponent))->pComponentPrivate))-> + GetState(aState); + OMX_TRACE_GETSTATE_OUT(aComponent, aState, omxError); + return omxError; + } + +OMX_ERRORTYPE +COmxILComponent::ComponentTunnelRequest( + OMX_HANDLETYPE aComponent, + OMX_U32 aPort, + OMX_HANDLETYPE aTunneledComp, + OMX_U32 aTunneledPort, + OMX_TUNNELSETUPTYPE* aTunnelSetup) + { + OMX_TRACE_COMPONENTTUNNELREQUEST_IN(aComponent, aPort, aTunneledComp, aTunneledPort, aTunnelSetup); + DEBUG_PRINTF2(_L8("COmxILComponent::ComponentTunnelRequest : Handle[%08X]"), aComponent); + OMX_ERRORTYPE omxError; + omxError = (static_cast + ((static_cast(aComponent))->pComponentPrivate))-> + ComponentTunnelRequest(aPort, aTunneledComp, + aTunneledPort, aTunnelSetup); + OMX_TRACE_COMPONENTTUNNELREQUEST_OUT(aComponent, aPort, aTunneledComp, aTunneledPort, aTunnelSetup, omxError); + return omxError; + } + +OMX_ERRORTYPE +COmxILComponent::UseBuffer( + OMX_HANDLETYPE aComponent, + OMX_BUFFERHEADERTYPE** appBufferHdr, + OMX_U32 aPortIndex, + OMX_PTR apAppPrivate, + OMX_U32 aSizeBytes, + OMX_U8* aBuffer) + { + OMX_TRACE_USEBUFFER_IN(aComponent, appBufferHdr, aPortIndex, apAppPrivate, aSizeBytes, aBuffer); + DEBUG_PRINTF2(_L8("COmxILComponent::UseBuffer : Handle[%08X]"), aComponent); + OMX_ERRORTYPE omxError; + omxError = (static_cast + ((static_cast(aComponent))->pComponentPrivate))-> + UseBuffer(appBufferHdr, aPortIndex, apAppPrivate, aSizeBytes, aBuffer); + OMX_TRACE_USEBUFFER_OUT(aComponent, appBufferHdr, aPortIndex, apAppPrivate, aSizeBytes, aBuffer, omxError); + return omxError; + } + +OMX_ERRORTYPE +COmxILComponent::AllocateBuffer( + OMX_HANDLETYPE aComponent, + OMX_BUFFERHEADERTYPE** apBuffer, + OMX_U32 aPortIndex, + OMX_PTR aAppData, + OMX_U32 aSizeBytes) + { + OMX_TRACE_ALLOCATEBUFFER_IN(aComponent, apBuffer, aPortIndex, aAppData, aSizeBytes); + DEBUG_PRINTF2(_L8("COmxILComponent::AllocateBuffer : Handle[%08X]"), aComponent); + OMX_ERRORTYPE omxError; + omxError = (static_cast + ((static_cast(aComponent))->pComponentPrivate))-> + AllocateBuffer(apBuffer, aPortIndex, aAppData, aSizeBytes); + OMX_TRACE_ALLOCATEBUFFER_OUT(aComponent, apBuffer, aPortIndex, aAppData, aSizeBytes, omxError); + return omxError; + } + +OMX_ERRORTYPE +COmxILComponent::FreeBuffer( + OMX_HANDLETYPE aComponent, + OMX_U32 aPortIndex, + OMX_BUFFERHEADERTYPE* aBuffer) + { + OMX_TRACE_FREEBUFFER_IN(aComponent, aPortIndex, aBuffer); + DEBUG_PRINTF2(_L8("COmxILComponent::FreeBuffer : Handle[%08X]"), aComponent); + OMX_ERRORTYPE omxError; + omxError = (static_cast + ((static_cast(aComponent))->pComponentPrivate))-> + FreeBuffer(aPortIndex, aBuffer); + OMX_TRACE_FREEBUFFER_OUT(aComponent, aPortIndex, aBuffer, omxError); + return omxError; + } + +OMX_ERRORTYPE +COmxILComponent::EmptyThisBuffer( + OMX_HANDLETYPE aComponent, + OMX_BUFFERHEADERTYPE* aBuffer) + { + OMX_TRACE_EMPTYTHISBUFFER_IN(aComponent, aBuffer); + DEBUG_PRINTF2(_L8("COmxILComponent::EmptyThisBuffer : Handle[%08X]"), aComponent); +#ifdef _OMXIL_COMMON_BUFFER_TRACING_ON + RDebug::Print(_L("COmxILComponent::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 + ((static_cast(aComponent))->pComponentPrivate))-> + EmptyThisBuffer(aBuffer); + + OMX_TRACE_EMPTYTHISBUFFER_OUT(aComponent, aBuffer, omxError); + return omxError; + } + +OMX_ERRORTYPE +COmxILComponent::FillThisBuffer( + OMX_HANDLETYPE aComponent, + OMX_BUFFERHEADERTYPE* aBuffer) + { + OMX_TRACE_FILLTHISBUFFER_IN(aComponent, aBuffer); + DEBUG_PRINTF2(_L8("COmxILComponent::FillThisBuffer : Handle[%08X]"), aComponent); +#ifdef _OMXIL_COMMON_BUFFER_TRACING_ON + RDebug::Print(_L("COmxILComponent::FillThisBuffer component=0x%08X header=0x%08X port=%d"), aComponent, aBuffer, aBuffer->nOutputPortIndex); +#endif + + OMX_ERRORTYPE omxError; + omxError = (static_cast + ((static_cast(aComponent))->pComponentPrivate))-> + FillThisBuffer(aBuffer); + + OMX_TRACE_FILLTHISBUFFER_OUT(aComponent, aBuffer, omxError); + return omxError; + } + +OMX_ERRORTYPE +COmxILComponent::SetCallbacks( + OMX_HANDLETYPE aComponent, + OMX_CALLBACKTYPE* aCallbacks, + OMX_PTR aAppData) + { + OMX_TRACE_SETCALLBACKS_IN(aComponent, aCallbacks, aAppData); + DEBUG_PRINTF2(_L8("COmxILComponent::SetCallbacks : Handle[%08X]"), aComponent); + OMX_ERRORTYPE omxError; + omxError = (static_cast + ((static_cast(aComponent))->pComponentPrivate))-> + SetCallbacks(const_cast(aCallbacks), aAppData); + OMX_TRACE_SETCALLBACKS_OUT(aComponent, aCallbacks, aAppData, omxError); + return omxError; + } + +OMX_ERRORTYPE +COmxILComponent::ComponentDeInit( + OMX_HANDLETYPE aComponent) + { + OMX_TRACE_COMPONENTDEINIT_IN(aComponent); + DEBUG_PRINTF2(_L8("COmxILComponent::ComponentDeInit : Handle[%08X]"), aComponent); + delete (static_cast( + (static_cast( + (static_cast(aComponent))-> + pComponentPrivate))->GetComponent())); + OMX_TRACE_COMPONENTDEINIT_OUT(aComponent, OMX_ErrorNone); + return OMX_ErrorNone; + } + +OMX_ERRORTYPE +COmxILComponent::UseEGLImage( + OMX_HANDLETYPE aComponent, + OMX_BUFFERHEADERTYPE** appBufferHdr, + OMX_U32 aPortIndex, + OMX_PTR aAppPrivate, + void* eglImage) + { + OMX_TRACE_USEEGLIMAGE_IN(aComponent, appBufferHdr, aPortIndex, aAppPrivate, eglImage); + DEBUG_PRINTF2(_L8("COmxILComponent::UseEGLImage : Handle[%08X]"), aComponent); + OMX_ERRORTYPE omxError; + omxError = (static_cast + ((static_cast(aComponent))->pComponentPrivate))-> + UseEGLImage(appBufferHdr, aPortIndex, aAppPrivate, eglImage); + OMX_TRACE_USEEGLIMAGE_OUT(aComponent, appBufferHdr, aPortIndex, aAppPrivate, eglImage, omxError); + return omxError; + } + +OMX_ERRORTYPE +COmxILComponent::ComponentRoleEnum( + OMX_HANDLETYPE aComponent, + OMX_U8* aRole, + OMX_U32 aIndex) + { + OMX_TRACE_COMPONENTROLEENUM_IN(aComponent, aRole, aIndex); + DEBUG_PRINTF2(_L8("COmxILComponent::ComponentRoleEnum : Handle[%08X]"), aComponent); + OMX_ERRORTYPE omxError; + omxError = (static_cast + ((static_cast(aComponent))->pComponentPrivate))-> + ComponentRoleEnum(aRole, aIndex); + OMX_TRACE_COMPONENTROLEENUM_OUT(aComponent, aRole, aIndex, omxError); + return omxError; + } + +/*static*/ 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; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilcomponent.h --- a/omxil/omxilcomponentcommon/src/common/omxilcomponent.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilcomponent.h Fri May 07 16:25:23 2010 +0100 @@ -1,165 +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 -*/ - -#ifndef OMXILCOMPONENT_H -#define OMXILCOMPONENT_H - -#include -#include - - -// forward declarations -class COmxILFsm; -class COmxILConfigManager; -class MOmxILCallbackManagerIf; -class COmxILPortManager; -class COmxILProcessingFunction; - - -class COmxILComponent : public CBase - { - -public: - - IMPORT_C virtual ~COmxILComponent(); - - 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); - - IMPORT_C static OMX_ERRORTYPE SymbianErrorToGetHandleError(TInt aSymbianError); - -protected: - - IMPORT_C COmxILComponent(); - - IMPORT_C void InitComponentL(); - -protected: - - RBuf8 iComponentName; - - OMX_COMPONENTTYPE* ipHandle; - OMX_PTR ipAppData; - OMX_CALLBACKTYPE* ipCallbacks; - - COmxILFsm* ipFsm; - COmxILConfigManager* ipConfigManager; - MOmxILCallbackManagerIf* ipCallbackManager; - COmxILPortManager* ipPortManager; - COmxILProcessingFunction* ipProcessingFunction; - - }; - -#endif // OMXILCOMPONENT_H +// 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 +#include + + +// forward declarations +class COmxILFsm; +class COmxILConfigManager; +class MOmxILCallbackManagerIf; +class MOmxILPortManagerIf; +class COmxILProcessingFunction; + + +class COmxILComponent : public CBase + { + +public: + + IMPORT_C virtual ~COmxILComponent(); + + 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); + + IMPORT_C static OMX_ERRORTYPE SymbianErrorToGetHandleError(TInt aSymbianError); + +protected: + + IMPORT_C COmxILComponent(); + + IMPORT_C void InitComponentL(); + +protected: + + RBuf8 iComponentName; + + OMX_COMPONENTTYPE* ipHandle; + OMX_PTR ipAppData; + OMX_CALLBACKTYPE* ipCallbacks; + + COmxILFsm* ipFsm; + COmxILConfigManager* ipConfigManager; + MOmxILCallbackManagerIf* ipCallbackManager; + MOmxILPortManagerIf* ipPortManager; + COmxILProcessingFunction* ipProcessingFunction; + + }; + +#endif // OMXILCOMPONENT_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilcomponent.hrh --- a/omxil/omxilcomponentcommon/src/common/omxilcomponent.hrh Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilcomponent.hrh Fri May 07 16:25:23 2010 +0100 @@ -1,23 +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 - +// 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 + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilconfigmanager.cpp --- a/omxil/omxilcomponentcommon/src/common/omxilconfigmanager.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilconfigmanager.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,553 +1,553 @@ -// 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 -#include - -#include "log.h" -#include "omxilconfigmanager.h" -#include "omxilportmanager.h" -#include "omxilspecversion.h" -#include "omxilutil.h" - - -// NOTE: OMX_UUIDTYPE[128] is defined in OMX_Types.h -#define KMAX_UUIDTYPE_SIZE 128 - -EXPORT_C COmxILConfigManager* -COmxILConfigManager::NewL( - COmxILPortManager& aPortManager, - const TDesC8& aComponentName, - const OMX_VERSIONTYPE& aComponentVersion, - const RPointerArray& aComponentRoleList) - { - DEBUG_PRINTF(_L8("COmxILConfigManager::NewL")); - __ASSERT_DEBUG(aComponentName.Length() && aComponentRoleList.Count(), - User::Panic(KOmxILConfigManagerPanicCategory, 1)); - - COmxILConfigManager* self = new (ELeave)COmxILConfigManager(aPortManager); - 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& aComponentRoleList) - { - DEBUG_PRINTF(_L8("COmxILConfigManager::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; iAllocLC()); - CleanupStack::Pop(); - } - - - InsertParamIndexL(OMX_IndexParamDisableResourceConcealment); - InsertParamIndexL(OMX_IndexParamSuspensionPolicy); - InsertParamIndexL(OMX_IndexParamStandardComponentRole); - InsertParamIndexL(OMX_IndexParamPriorityMgmt); - InsertConfigIndexL(OMX_IndexConfigPriorityMgmt); - - } - -EXPORT_C -COmxILConfigManager::COmxILConfigManager(COmxILPortManager& aPortManager) - : - iPortManager(aPortManager), - iComponentName(), - iComponentRoleList(), - iCurrentRoleIndex(0) - - { - DEBUG_PRINTF(_L8("COmxILConfigManager::COmxILConfigManager")); - - 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; - - } - -EXPORT_C -COmxILConfigManager::~COmxILConfigManager() - { - DEBUG_PRINTF(_L8("COmxILConfigManager::~COmxILConfigManager")); - - iComponentName.Close(); - iComponentRoleList.ResetAndDestroy(); - - } - -EXPORT_C OMX_ERRORTYPE -COmxILConfigManager::GetComponentVersion(OMX_STRING aComponentName, - OMX_VERSIONTYPE* apComponentVersion, - OMX_VERSIONTYPE* apSpecVersion, - OMX_UUIDTYPE* apComponentUUID) const - { - DEBUG_PRINTF(_L8("COmxILConfigManager::GetComponentVersion")); - - TPtr8 name(reinterpret_cast(aComponentName), - OMX_MAX_STRINGNAME_SIZE); - name.Copy(iComponentName); - name.PtrZ(); - - (*apComponentVersion) = iComponentVersion; - (*apSpecVersion) = TOmxILSpecVersion(); - - // Generate a component uuid - TUint32 uid = reinterpret_cast(this); - TPtr8 uidPtr(reinterpret_cast(*apComponentUUID), - KMAX_UUIDTYPE_SIZE); - uidPtr = TPtr8(reinterpret_cast(uid), sizeof(uid)); - - return OMX_ErrorNone; - - } - -EXPORT_C OMX_ERRORTYPE -COmxILConfigManager::GetParameter(OMX_INDEXTYPE aParamIndex, - TAny* apComponentParameterStructure) const - { - DEBUG_PRINTF(_L8("COmxILConfigManager::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( - apComponentParameterStructure); - - // Here, the role returned must be the role that this component is - // currently assuming - TPtr8 role(reinterpret_cast(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( - 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( - apComponentParameterStructure); - - *pSuspensionPolicy = iParamSuspensionPolicy; - - } - break; - - case OMX_IndexParamPriorityMgmt: - { - if (OMX_ErrorNone != (omxRetValue = - TOmxILUtil::CheckOmxStructSizeAndVersion( - apComponentParameterStructure, - sizeof(OMX_PRIORITYMGMTTYPE)))) - { - return omxRetValue; - } - - OMX_PRIORITYMGMTTYPE* pPriorityMgmt - = static_cast( - apComponentParameterStructure); - - *pPriorityMgmt = iConfigPriorityMgmt; - - } - break; - - default: - { - __ASSERT_ALWAYS(EFalse, - User::Panic(KOmxILConfigManagerPanicCategory, 1)); - } - }; - - return OMX_ErrorNone; - - } - -EXPORT_C OMX_ERRORTYPE -COmxILConfigManager::SetParameter(OMX_INDEXTYPE aParamIndex, - const TAny* apComponentParameterStructure, - OMX_BOOL aInitTime /* = OMX_TRUE */) - { - DEBUG_PRINTF(_L8("COmxILConfigManager::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(apComponentParameterStructure), - sizeof(OMX_PARAM_COMPONENTROLETYPE)))) - { - return omxRetValue; - } - - const OMX_PARAM_COMPONENTROLETYPE* pComponentRole - = static_cast( - apComponentParameterStructure); - - TPtrC8 roleToFindPtr( - static_cast(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( - &COmxILConfigManager::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 = - iPortManager.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(apComponentParameterStructure), - sizeof(OMX_RESOURCECONCEALMENTTYPE)))) - { - return omxRetValue; - } - - const OMX_RESOURCECONCEALMENTTYPE* pResConceal - = static_cast( - apComponentParameterStructure); - - iParamDisableResourceConcealment = *pResConceal; - - } - break; - - case OMX_IndexParamSuspensionPolicy: - { - if (!aInitTime) - { - return OMX_ErrorIncorrectStateOperation; - } - - if (OMX_ErrorNone != (omxRetValue = - TOmxILUtil::CheckOmxStructSizeAndVersion( - const_cast(apComponentParameterStructure), - sizeof(OMX_PARAM_SUSPENSIONPOLICYTYPE)))) - { - return omxRetValue; - } - - const OMX_PARAM_SUSPENSIONPOLICYTYPE* pSuspensionPolicy - = static_cast( - 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(apComponentParameterStructure), - sizeof(OMX_PRIORITYMGMTTYPE)))) - { - return omxRetValue; - } - - - const OMX_PRIORITYMGMTTYPE* pPriorityMgmt - = static_cast( - apComponentParameterStructure); - - iConfigPriorityMgmt = *pPriorityMgmt; - - } - break; - - default: - { - __ASSERT_ALWAYS(EFalse, - User::Panic(KOmxILConfigManagerPanicCategory, 1)); - } - }; - - return OMX_ErrorNone; - - } - -EXPORT_C OMX_ERRORTYPE -COmxILConfigManager::GetConfig(OMX_INDEXTYPE aConfigIndex, - TAny* apComponentConfigStructure) const - { - DEBUG_PRINTF(_L8("COmxILConfigManager::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( - apComponentConfigStructure); - - *pPriorityMgmt = iConfigPriorityMgmt; - - } - break; - default: - { - __ASSERT_ALWAYS(EFalse, - User::Panic(KOmxILConfigManagerPanicCategory, 1)); - } - }; - - return OMX_ErrorNone; - - } - -EXPORT_C OMX_ERRORTYPE -COmxILConfigManager::SetConfig(OMX_INDEXTYPE aConfigIndex, - const TAny* apComponentConfigStructure) - - { - DEBUG_PRINTF(_L8("COmxILConfigManager::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(apComponentConfigStructure), - sizeof(OMX_PRIORITYMGMTTYPE)))) - { - return omxRetValue; - } - - const OMX_PRIORITYMGMTTYPE* pPriorityMgmt - = static_cast( - apComponentConfigStructure); - - iConfigPriorityMgmt = *pPriorityMgmt; - - } - break; - default: - { - __ASSERT_ALWAYS(EFalse, - User::Panic(KOmxILConfigManagerPanicCategory, 1)); - } - }; - - return OMX_ErrorNone; - - } - -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; - } - -EXPORT_C OMX_ERRORTYPE -COmxILConfigManager::ComponentRoleEnum(OMX_U8* aRole, - OMX_U32 aIndex) const - { - DEBUG_PRINTF(_L8("COmxILConfigManager::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(aRole), - OMX_MAX_STRINGNAME_SIZE); - role = *pRole; - role.PtrZ(); - - return OMX_ErrorNone; - - } - -TBool -COmxILConfigManager::CompareRoles( - const HBufC8& aRole1, const HBufC8& aRole2) - { - return (aRole1 == aRole2); - } +// 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 +#include + +#include "log.h" +#include "omxilconfigmanager.h" +#include "omxilspecversion.h" +#include "omxilutil.h" +#include "omxilportmanagerif.h" + + +// NOTE: OMX_UUIDTYPE[128] is defined in OMX_Types.h +#define KMAX_UUIDTYPE_SIZE 128 + +EXPORT_C COmxILConfigManager* +COmxILConfigManager::NewL( + MOmxILPortManagerIf& aPortManager, + const TDesC8& aComponentName, + const OMX_VERSIONTYPE& aComponentVersion, + const RPointerArray& aComponentRoleList) + { + DEBUG_PRINTF(_L8("COmxILConfigManager::NewL")); + __ASSERT_DEBUG(aComponentName.Length() && aComponentRoleList.Count(), + User::Panic(KOmxILConfigManagerPanicCategory, 1)); + + COmxILConfigManager* self = new (ELeave)COmxILConfigManager(aPortManager); + 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& aComponentRoleList) + { + DEBUG_PRINTF(_L8("COmxILConfigManager::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; iAllocLC()); + CleanupStack::Pop(); + } + + + InsertParamIndexL(OMX_IndexParamDisableResourceConcealment); + InsertParamIndexL(OMX_IndexParamSuspensionPolicy); + InsertParamIndexL(OMX_IndexParamStandardComponentRole); + InsertParamIndexL(OMX_IndexParamPriorityMgmt); + InsertConfigIndexL(OMX_IndexConfigPriorityMgmt); + + } + +EXPORT_C +COmxILConfigManager::COmxILConfigManager(MOmxILPortManagerIf& aPortManager) + : + iPortManager(aPortManager), + iComponentName(), + iComponentRoleList(), + iCurrentRoleIndex(0) + + { + DEBUG_PRINTF(_L8("COmxILConfigManager::COmxILConfigManager")); + + 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; + + } + +EXPORT_C +COmxILConfigManager::~COmxILConfigManager() + { + DEBUG_PRINTF(_L8("COmxILConfigManager::~COmxILConfigManager")); + + iComponentName.Close(); + iComponentRoleList.ResetAndDestroy(); + + } + +EXPORT_C OMX_ERRORTYPE +COmxILConfigManager::GetComponentVersion(OMX_STRING aComponentName, + OMX_VERSIONTYPE* apComponentVersion, + OMX_VERSIONTYPE* apSpecVersion, + OMX_UUIDTYPE* apComponentUUID) const + { + DEBUG_PRINTF(_L8("COmxILConfigManager::GetComponentVersion")); + + TPtr8 name(reinterpret_cast(aComponentName), + OMX_MAX_STRINGNAME_SIZE); + name.Copy(iComponentName); + name.PtrZ(); + + (*apComponentVersion) = iComponentVersion; + (*apSpecVersion) = TOmxILSpecVersion(); + + // Generate a component uuid + TUint32 uid = reinterpret_cast(this); + TPtr8 uidPtr(reinterpret_cast(*apComponentUUID), + KMAX_UUIDTYPE_SIZE); + uidPtr = TPtr8(reinterpret_cast(uid), sizeof(uid)); + + return OMX_ErrorNone; + + } + +EXPORT_C OMX_ERRORTYPE +COmxILConfigManager::GetParameter(OMX_INDEXTYPE aParamIndex, + TAny* apComponentParameterStructure) const + { + DEBUG_PRINTF(_L8("COmxILConfigManager::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( + apComponentParameterStructure); + + // Here, the role returned must be the role that this component is + // currently assuming + TPtr8 role(reinterpret_cast(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( + 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( + apComponentParameterStructure); + + *pSuspensionPolicy = iParamSuspensionPolicy; + + } + break; + + case OMX_IndexParamPriorityMgmt: + { + if (OMX_ErrorNone != (omxRetValue = + TOmxILUtil::CheckOmxStructSizeAndVersion( + apComponentParameterStructure, + sizeof(OMX_PRIORITYMGMTTYPE)))) + { + return omxRetValue; + } + + OMX_PRIORITYMGMTTYPE* pPriorityMgmt + = static_cast( + apComponentParameterStructure); + + *pPriorityMgmt = iConfigPriorityMgmt; + + } + break; + + default: + { + __ASSERT_ALWAYS(EFalse, + User::Panic(KOmxILConfigManagerPanicCategory, 1)); + } + }; + + return OMX_ErrorNone; + + } + +EXPORT_C OMX_ERRORTYPE +COmxILConfigManager::SetParameter(OMX_INDEXTYPE aParamIndex, + const TAny* apComponentParameterStructure, + OMX_BOOL aInitTime /* = OMX_TRUE */) + { + DEBUG_PRINTF(_L8("COmxILConfigManager::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(apComponentParameterStructure), + sizeof(OMX_PARAM_COMPONENTROLETYPE)))) + { + return omxRetValue; + } + + const OMX_PARAM_COMPONENTROLETYPE* pComponentRole + = static_cast( + apComponentParameterStructure); + + TPtrC8 roleToFindPtr( + static_cast(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( + &COmxILConfigManager::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 = + iPortManager.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(apComponentParameterStructure), + sizeof(OMX_RESOURCECONCEALMENTTYPE)))) + { + return omxRetValue; + } + + const OMX_RESOURCECONCEALMENTTYPE* pResConceal + = static_cast( + apComponentParameterStructure); + + iParamDisableResourceConcealment = *pResConceal; + + } + break; + + case OMX_IndexParamSuspensionPolicy: + { + if (!aInitTime) + { + return OMX_ErrorIncorrectStateOperation; + } + + if (OMX_ErrorNone != (omxRetValue = + TOmxILUtil::CheckOmxStructSizeAndVersion( + const_cast(apComponentParameterStructure), + sizeof(OMX_PARAM_SUSPENSIONPOLICYTYPE)))) + { + return omxRetValue; + } + + const OMX_PARAM_SUSPENSIONPOLICYTYPE* pSuspensionPolicy + = static_cast( + 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(apComponentParameterStructure), + sizeof(OMX_PRIORITYMGMTTYPE)))) + { + return omxRetValue; + } + + + const OMX_PRIORITYMGMTTYPE* pPriorityMgmt + = static_cast( + apComponentParameterStructure); + + iConfigPriorityMgmt = *pPriorityMgmt; + + } + break; + + default: + { + __ASSERT_ALWAYS(EFalse, + User::Panic(KOmxILConfigManagerPanicCategory, 1)); + } + }; + + return OMX_ErrorNone; + + } + +EXPORT_C OMX_ERRORTYPE +COmxILConfigManager::GetConfig(OMX_INDEXTYPE aConfigIndex, + TAny* apComponentConfigStructure) const + { + DEBUG_PRINTF(_L8("COmxILConfigManager::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( + apComponentConfigStructure); + + *pPriorityMgmt = iConfigPriorityMgmt; + + } + break; + default: + { + __ASSERT_ALWAYS(EFalse, + User::Panic(KOmxILConfigManagerPanicCategory, 1)); + } + }; + + return OMX_ErrorNone; + + } + +EXPORT_C OMX_ERRORTYPE +COmxILConfigManager::SetConfig(OMX_INDEXTYPE aConfigIndex, + const TAny* apComponentConfigStructure) + + { + DEBUG_PRINTF(_L8("COmxILConfigManager::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(apComponentConfigStructure), + sizeof(OMX_PRIORITYMGMTTYPE)))) + { + return omxRetValue; + } + + const OMX_PRIORITYMGMTTYPE* pPriorityMgmt + = static_cast( + apComponentConfigStructure); + + iConfigPriorityMgmt = *pPriorityMgmt; + + } + break; + default: + { + __ASSERT_ALWAYS(EFalse, + User::Panic(KOmxILConfigManagerPanicCategory, 1)); + } + }; + + return OMX_ErrorNone; + + } + +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; + } + +EXPORT_C OMX_ERRORTYPE +COmxILConfigManager::ComponentRoleEnum(OMX_U8* aRole, + OMX_U32 aIndex) const + { + DEBUG_PRINTF(_L8("COmxILConfigManager::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(aRole), + OMX_MAX_STRINGNAME_SIZE); + role = *pRole; + role.PtrZ(); + + return OMX_ErrorNone; + + } + +TBool +COmxILConfigManager::CompareRoles( + const HBufC8& aRole1, const HBufC8& aRole2) + { + return (aRole1 == aRole2); + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilconfigmanager.h --- a/omxil/omxilcomponentcommon/src/common/omxilconfigmanager.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilconfigmanager.h Fri May 07 16:25:23 2010 +0100 @@ -1,138 +1,138 @@ -// 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 OMXILCONFIGMANAGER_H -#define OMXILCONFIGMANAGER_H - -#include -#include -#include -#include - -#include "omxilindexmanager.h" - -/** - Config Manager Panic category -*/ -_LIT(KOmxILConfigManagerPanicCategory, "OmxILConfigManager"); - - -// Forward declarations -class COmxILPortManager; - - -/** - 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 COmxILIndexManager - { - -public: - - IMPORT_C static COmxILConfigManager* NewL( - COmxILPortManager& aPortManager, - const TDesC8& aComponentName, - const OMX_VERSIONTYPE& aComponentVersion, - const RPointerArray& aComponentRoleList); - - IMPORT_C ~COmxILConfigManager(); - - IMPORT_C virtual 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; - - IMPORT_C OMX_ERRORTYPE ComponentRoleEnum( - OMX_U8* aRole, - OMX_U32 aIndex) const; - -protected: - - IMPORT_C explicit COmxILConfigManager(COmxILPortManager& aPortManager); - - IMPORT_C void ConstructL(const TDesC8& aComponentName, - const OMX_VERSIONTYPE& aComponentVersion, - const RPointerArray& aComponentRoleList); - - - static TBool CompareRoles(const HBufC8& aRole1, const HBufC8& aRole2); - - -protected: - - // Reference to the component's port manager - COmxILPortManager& iPortManager; - - // Reference to the component's port manager - RBuf8 iComponentName; - - // The list of OpenMAX IL roles supported by the component - RPointerArray 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 // OMXILCONFIGMANAGER_H +// 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 OMXILCONFIGMANAGER_H +#define OMXILCONFIGMANAGER_H + +#include +#include +#include +#include + +#include "omxilindexmanager.h" + +/** + Config Manager Panic category +*/ +_LIT(KOmxILConfigManagerPanicCategory, "OmxILConfigManager"); + + +// Forward declarations +class MOmxILPortManagerIf; + + +/** + 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 COmxILIndexManager + { + +public: + + IMPORT_C static COmxILConfigManager* NewL( + MOmxILPortManagerIf& aPortManager, + const TDesC8& aComponentName, + const OMX_VERSIONTYPE& aComponentVersion, + const RPointerArray& aComponentRoleList); + + IMPORT_C ~COmxILConfigManager(); + + IMPORT_C virtual 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; + + IMPORT_C OMX_ERRORTYPE ComponentRoleEnum( + OMX_U8* aRole, + OMX_U32 aIndex) const; + +protected: + + IMPORT_C explicit COmxILConfigManager(MOmxILPortManagerIf& aPortManager); + + IMPORT_C void ConstructL(const TDesC8& aComponentName, + const OMX_VERSIONTYPE& aComponentVersion, + const RPointerArray& aComponentRoleList); + + + static TBool CompareRoles(const HBufC8& aRole1, const HBufC8& aRole2); + + +protected: + + // Reference to the component's port manager + MOmxILPortManagerIf& iPortManager; + + // Reference to the component's port manager + RBuf8 iComponentName; + + // The list of OpenMAX IL roles supported by the component + RPointerArray 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 // OMXILCONFIGMANAGER_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilfsm.cpp --- a/omxil/omxilcomponentcommon/src/common/omxilfsm.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilfsm.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,783 +1,783 @@ -// 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 "omxilportmanager.h" -#include "omxilconfigmanager.h" -#include "omxilcallbackmanager.h" -#include "omxilprocessingfunction.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; - -EXPORT_C COmxILFsm* -COmxILFsm::NewL(COmxILComponent& aComponent, - COmxILProcessingFunction& aProcFunction, - COmxILPortManager& 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, - COmxILPortManager& 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(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(this)->SendOmxErrorEventIfNeeded(aError); - - } +// 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 "omxilconfigmanager.h" +#include "omxilcallbackmanager.h" +#include "omxilprocessingfunction.h" +#include "omxilportmanagerif.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; + +EXPORT_C 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(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(this)->SendOmxErrorEventIfNeeded(aError); + + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilfsm.h --- a/omxil/omxilcomponentcommon/src/common/omxilfsm.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilfsm.h Fri May 07 16:25:23 2010 +0100 @@ -1,221 +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 -*/ - -#ifndef OMXILFSM_H -#define OMXILFSM_H - - -#include -#include -#include - -#include "omxilcommand.h" - -// forward declarations -class COmxILPortManager; -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; - - 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 - }; - - -public: - - IMPORT_C static COmxILFsm* NewL(COmxILComponent& aComponent, - COmxILProcessingFunction& aProcFunction, - COmxILPortManager& 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, - COmxILPortManager& 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; - COmxILPortManager& iPortManager; - COmxILConfigManager& iConfigManager; - MOmxILCallbackManagerIf& iCallbacks; - - RPointerArray iStates; - TStateIndex iCurrentStateIndex; - COmxILState* ipCurrentState; - - }; - - -#endif // OMXILFSM_H +// 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 +#include +#include + +#include "omxilcommand.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; + + 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 + }; + + +public: + + IMPORT_C 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 iStates; + TStateIndex iCurrentStateIndex; + COmxILState* ipCurrentState; + + }; + + +#endif // OMXILFSM_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilimageport.cpp --- a/omxil/omxilcomponentcommon/src/common/omxilimageport.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilimageport.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,210 +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 - @internalComponent - */ - -#include "omxilimageport.h" -#include "omxilutil.h" -#include "log.h" - -EXPORT_C -COmxILImagePort::COmxILImagePort( - const TOmxILCommonPortData& aCommonPortData, - const RArray& aSupportedImageFormats, - const RArray& aSupportedColorFormats) -:COmxILPort(aCommonPortData), -//[YYC]: bitwise copy is unsafe, there should be a protected ConstructL or alike for array deep copy -iSupportedImageFormats(aSupportedImageFormats), -iSupportedColorFormats(aSupportedColorFormats) - { - DEBUG_PRINTF(_L8("COmxILImagePort::COmxILImagePort")); - - 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; - } - -EXPORT_C -COmxILImagePort::~COmxILImagePort() - { - DEBUG_PRINTF(_L8("COmxILImagePort::~COmxILImagePort")); - iSupportedImageFormats.Close(); - iSupportedColorFormats.Close(); - } - -EXPORT_C OMX_ERRORTYPE -COmxILImagePort::GetLocalOmxParamIndexes(RArray& 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& 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: - { - if (OMX_ErrorNone != (omxRetValue = - TOmxILUtil::CheckOmxStructSizeAndVersion( - const_cast(apComponentParameterStructure), - sizeof(OMX_IMAGE_PARAM_PORTFORMATTYPE)))) - { - return omxRetValue; - } - - OMX_IMAGE_PARAM_PORTFORMATTYPE* imagePortDefinition = static_cast(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: - { - // Try the parent's indexes - return COmxILPort::GetParameter(aParamIndex, apComponentParameterStructure); - } - }; - - return OMX_ErrorNone; - } - -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: - { - if (OMX_ErrorNone != (omxRetValue = - TOmxILUtil::CheckOmxStructSizeAndVersion( - const_cast(apComponentParameterStructure), - sizeof(OMX_IMAGE_PARAM_PORTFORMATTYPE)))) - { - return omxRetValue; - } - - const OMX_IMAGE_PARAM_PORTFORMATTYPE *componentParameterStructure = static_cast(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: - { - // Try the parent's indexes - return COmxILPort::SetParameter(aParamIndex, apComponentParameterStructure, aUpdateProcessingFunction); - } - }; - return OMX_ErrorNone; - } +// 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 "omxilimageport.h" +#include "omxilutil.h" +#include "log.h" + +EXPORT_C +COmxILImagePort::COmxILImagePort( + const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedImageFormats, + const RArray& aSupportedColorFormats) +:COmxILPort(aCommonPortData), +//[YYC]: bitwise copy is unsafe, there should be a protected ConstructL or alike for array deep copy +iSupportedImageFormats(aSupportedImageFormats), +iSupportedColorFormats(aSupportedColorFormats) + { + DEBUG_PRINTF(_L8("COmxILImagePort::COmxILImagePort")); + + 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; + } + +EXPORT_C +COmxILImagePort::~COmxILImagePort() + { + DEBUG_PRINTF(_L8("COmxILImagePort::~COmxILImagePort")); + iSupportedImageFormats.Close(); + iSupportedColorFormats.Close(); + } + +EXPORT_C OMX_ERRORTYPE +COmxILImagePort::GetLocalOmxParamIndexes(RArray& 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& 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: + { + if (OMX_ErrorNone != (omxRetValue = + TOmxILUtil::CheckOmxStructSizeAndVersion( + const_cast(apComponentParameterStructure), + sizeof(OMX_IMAGE_PARAM_PORTFORMATTYPE)))) + { + return omxRetValue; + } + + OMX_IMAGE_PARAM_PORTFORMATTYPE* imagePortDefinition = static_cast(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: + { + // Try the parent's indexes + return COmxILPort::GetParameter(aParamIndex, apComponentParameterStructure); + } + }; + + return OMX_ErrorNone; + } + +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: + { + if (OMX_ErrorNone != (omxRetValue = + TOmxILUtil::CheckOmxStructSizeAndVersion( + const_cast(apComponentParameterStructure), + sizeof(OMX_IMAGE_PARAM_PORTFORMATTYPE)))) + { + return omxRetValue; + } + + const OMX_IMAGE_PARAM_PORTFORMATTYPE *componentParameterStructure = static_cast(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: + { + // Try the parent's indexes + return COmxILPort::SetParameter(aParamIndex, apComponentParameterStructure, aUpdateProcessingFunction); + } + }; + return OMX_ErrorNone; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilimageport.h --- a/omxil/omxilcomponentcommon/src/common/omxilimageport.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilimageport.h Fri May 07 16:25:23 2010 +0100 @@ -1,76 +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 - * @internalTechnology - */ - -#ifndef OMXILIMAGEPORT_H -#define OMXILIMAGEPORT_H - -#include - -#include -#include -#include - -#include "omxilport.h" - -class COmxILImagePort : public COmxILPort - { - -public: - - IMPORT_C ~COmxILImagePort(); - - // From COmxILPort - IMPORT_C OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray& aIndexArray) const = 0; - - // From COmxILPort - IMPORT_C OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray& 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; - -protected: - - IMPORT_C COmxILImagePort(const TOmxILCommonPortData& aCommonPortData, - const RArray& aSupportedImageFormats, - const RArray& aSupportedColorFormats); - - // From COmxILPort - IMPORT_C OMX_ERRORTYPE SetFormatInPortDefinition( - const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, - TBool& aUpdateProcessingFunction) = 0; - - // From COmxILPort - IMPORT_C TBool IsTunnelledPortCompatible( - const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const = 0; - -protected: - - RArray iSupportedImageFormats; - RArray iSupportedColorFormats; - OMX_IMAGE_PARAM_PORTFORMATTYPE iParamImagePortFormat; - }; - -#endif // OMXILIMAGEPORT_H +// 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 + +#include +#include +#include + +#include "omxilport.h" + +class COmxILImagePort : public COmxILPort + { + +public: + + IMPORT_C ~COmxILImagePort(); + + // From COmxILPort + IMPORT_C OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray& aIndexArray) const = 0; + + // From COmxILPort + IMPORT_C OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray& 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; + +protected: + + IMPORT_C COmxILImagePort(const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedImageFormats, + const RArray& aSupportedColorFormats); + + // From COmxILPort + IMPORT_C OMX_ERRORTYPE SetFormatInPortDefinition( + const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, + TBool& aUpdateProcessingFunction) = 0; + + // From COmxILPort + IMPORT_C TBool IsTunnelledPortCompatible( + const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const = 0; + +protected: + + RArray iSupportedImageFormats; + RArray iSupportedColorFormats; + OMX_IMAGE_PARAM_PORTFORMATTYPE iParamImagePortFormat; + }; + +#endif // OMXILIMAGEPORT_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilincontextcallbackmanager.cpp --- a/omxil/omxilcomponentcommon/src/common/omxilincontextcallbackmanager.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilincontextcallbackmanager.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,768 +1,767 @@ -// 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 "omxilutil.h" - -EXPORT_C 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(apComponentHandle), - apAppData, - apCallbacks), - iLock(), - iPendingQueue(), - iFlushPendingQueue(EFalse), - iCurrentState(OMX_StateLoaded), - iPreviousState(OMX_StateLoaded) - { - DEBUG_PRINTF(_L8("COmxILInContextCallbackManager::COmxILInContextCallbackManager")); - } - -EXPORT_C -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(); - } - -EXPORT_C void -COmxILInContextCallbackManager::SetPortManager(COmxILPortManager& apPortManager) - { - LockCallbackManager(); - DoSetPortManager(apPortManager); - UnlockCallbackManager(); - } - -EXPORT_C void -COmxILInContextCallbackManager::SetFsm(COmxILFsm& apFsm) - { - LockCallbackManager(); - DoSetFsm(apFsm); - UnlockCallbackManager(); - } - -EXPORT_C 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 - */ -EXPORT_C 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; - - } - -EXPORT_C 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; - - } - -EXPORT_C 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; - - } - -EXPORT_C 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; - - } - -EXPORT_C TBool -COmxILInContextCallbackManager::BufferRemovalIndication( - OMX_BUFFERHEADERTYPE* apBufferHeader, - OMX_DIRTYPE aDirection) - { - DEBUG_PRINTF(_L8("COmxILInContextCallbackManager::BufferRemovalIndication")); - - return RemoveBuffersByBufferHeader( - iPendingQueue, apBufferHeader, aDirection); - - } - -EXPORT_C 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; - - } - - -EXPORT_C 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; - - } - - -EXPORT_C 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; - - } - -EXPORT_C 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(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; - - } - - -EXPORT_C 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( - 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::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::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(); - - } - - - } - -EXPORT_C OMX_ERRORTYPE -COmxILInContextCallbackManager::ClockBufferDoneNotification(OMX_BUFFERHEADERTYPE* apBufferHeader, - OMX_U32 aLocalPortIndex, - OMX_DIRTYPE aLocalPortDirection) - { - DEBUG_PRINTF(_L8("COmxILInContextCallbackManager::ClockBufferDoneNotification")); - - return BufferDoneNotification(apBufferHeader, - aLocalPortIndex, - aLocalPortDirection); - - } - -EXPORT_C 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; - - } - - -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(apBufferHeader)); - } - else - { - ipFsm->FillThisBuffer( - const_cast(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(); - - } - +// 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 "omxilutil.h" + +EXPORT_C 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(apComponentHandle), + apAppData, + apCallbacks), + iLock(), + iPendingQueue(), + iFlushPendingQueue(EFalse), + iCurrentState(OMX_StateLoaded), + iPreviousState(OMX_StateLoaded) + { + DEBUG_PRINTF(_L8("COmxILInContextCallbackManager::COmxILInContextCallbackManager")); + } + +EXPORT_C +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(); + } + +EXPORT_C void +COmxILInContextCallbackManager::SetPortManager(MOmxILPortManagerIf& apPortManager) + { + LockCallbackManager(); + DoSetPortManager(apPortManager); + UnlockCallbackManager(); + } + +EXPORT_C void +COmxILInContextCallbackManager::SetFsm(COmxILFsm& apFsm) + { + LockCallbackManager(); + DoSetFsm(apFsm); + UnlockCallbackManager(); + } + +EXPORT_C 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 + */ +EXPORT_C 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; + + } + +EXPORT_C 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; + + } + +EXPORT_C 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; + + } + +EXPORT_C 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; + + } + +EXPORT_C TBool +COmxILInContextCallbackManager::BufferRemovalIndication( + OMX_BUFFERHEADERTYPE* apBufferHeader, + OMX_DIRTYPE aDirection) + { + DEBUG_PRINTF(_L8("COmxILInContextCallbackManager::BufferRemovalIndication")); + + return RemoveBuffersByBufferHeader( + iPendingQueue, apBufferHeader, aDirection); + + } + +EXPORT_C 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; + + } + + +EXPORT_C 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; + + } + + +EXPORT_C 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; + + } + +EXPORT_C 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(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; + + } + + +EXPORT_C 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( + 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::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::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(); + + } + + + } + +EXPORT_C OMX_ERRORTYPE +COmxILInContextCallbackManager::ClockBufferDoneNotification(OMX_BUFFERHEADERTYPE* apBufferHeader, + OMX_U32 aLocalPortIndex, + OMX_DIRTYPE aLocalPortDirection) + { + DEBUG_PRINTF(_L8("COmxILInContextCallbackManager::ClockBufferDoneNotification")); + + return BufferDoneNotification(apBufferHeader, + aLocalPortIndex, + aLocalPortDirection); + + } + +EXPORT_C 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; + + } + +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(apBufferHeader)); + } + else + { + ipFsm->FillThisBuffer( + const_cast(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(); + + } + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilincontextcallbackmanager.h --- a/omxil/omxilcomponentcommon/src/common/omxilincontextcallbackmanager.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilincontextcallbackmanager.h Fri May 07 16:25:23 2010 +0100 @@ -1,217 +1,217 @@ -// 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: - - IMPORT_C static COmxILInContextCallbackManager* NewL( - OMX_HANDLETYPE apComponentHandle, - OMX_PTR apAppData, - OMX_CALLBACKTYPE* apCallbacks); - - IMPORT_C ~COmxILInContextCallbackManager(); - - IMPORT_C void SetPortManager(COmxILPortManager& apPortManager); - - IMPORT_C void SetFsm(COmxILFsm& apFsm); - - // - // Methods for Callback Registration (from MOmxILCallbackManagerIf) - // - IMPORT_C OMX_ERRORTYPE RegisterComponentHandle( - OMX_HANDLETYPE aComponentHandle); - - IMPORT_C OMX_ERRORTYPE RegisterILClientCallbacks( - const OMX_CALLBACKTYPE* apCallbacks, - const OMX_PTR apAppData); - - IMPORT_C OMX_ERRORTYPE RegisterTunnelCallback( - OMX_U32 aLocalPortIndex, - OMX_DIRTYPE aLocalPortDirection, - OMX_HANDLETYPE aTunnelledComponentHandle, - OMX_U32 aTunnelledPortIndex - ); - - IMPORT_C OMX_ERRORTYPE DeregisterTunnelCallback( - OMX_U32 aLocalPortIndex); - - IMPORT_C OMX_ERRORTYPE RegisterBufferMarkPropagationPort( - OMX_U32 aPortIndex, - OMX_U32 aPropagationPortIndex); - - IMPORT_C TBool BufferRemovalIndication( - OMX_BUFFERHEADERTYPE* apBufferHeader, - OMX_DIRTYPE aDirection); - - - // - // Methods for Callback Notification (from MOmxILCallbackManagerIf) - // - - IMPORT_C OMX_ERRORTYPE TransitionCompleteNotification( - OMX_STATETYPE aOmxState); - - IMPORT_C OMX_ERRORTYPE CommandCompleteNotification( - OMX_COMMANDTYPE aOmxCommand, - OMX_U32 aOmxPortIndex); - - // - // Methods for Callback Notification (from MOmxILCallbackManagerIf) - // - - IMPORT_C OMX_ERRORTYPE ErrorEventNotification( - OMX_ERRORTYPE aOmxError); - - IMPORT_C OMX_ERRORTYPE EventNotification( - OMX_EVENTTYPE aEvent, - TUint32 aData1, - TUint32 aData2, - OMX_STRING aExtraInfo); - - IMPORT_C OMX_ERRORTYPE BufferDoneNotification( - OMX_BUFFERHEADERTYPE* apBufferHeader, - OMX_U32 aLocalPortIndex, - OMX_DIRTYPE aLocalPortDirection); - - IMPORT_C OMX_ERRORTYPE ClockBufferDoneNotification( - OMX_BUFFERHEADERTYPE* apBufferHeader, - OMX_U32 aLocalPortIndex, - OMX_DIRTYPE aLocalPortDirection); - - IMPORT_C 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 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 +// 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: + + IMPORT_C static COmxILInContextCallbackManager* NewL( + OMX_HANDLETYPE apComponentHandle, + OMX_PTR apAppData, + OMX_CALLBACKTYPE* apCallbacks); + + IMPORT_C ~COmxILInContextCallbackManager(); + + IMPORT_C void SetPortManager(MOmxILPortManagerIf& apPortManager); + + IMPORT_C void SetFsm(COmxILFsm& apFsm); + + // + // Methods for Callback Registration (from MOmxILCallbackManagerIf) + // + IMPORT_C OMX_ERRORTYPE RegisterComponentHandle( + OMX_HANDLETYPE aComponentHandle); + + IMPORT_C OMX_ERRORTYPE RegisterILClientCallbacks( + const OMX_CALLBACKTYPE* apCallbacks, + const OMX_PTR apAppData); + + IMPORT_C OMX_ERRORTYPE RegisterTunnelCallback( + OMX_U32 aLocalPortIndex, + OMX_DIRTYPE aLocalPortDirection, + OMX_HANDLETYPE aTunnelledComponentHandle, + OMX_U32 aTunnelledPortIndex + ); + + IMPORT_C OMX_ERRORTYPE DeregisterTunnelCallback( + OMX_U32 aLocalPortIndex); + + IMPORT_C OMX_ERRORTYPE RegisterBufferMarkPropagationPort( + OMX_U32 aPortIndex, + OMX_U32 aPropagationPortIndex); + + IMPORT_C TBool BufferRemovalIndication( + OMX_BUFFERHEADERTYPE* apBufferHeader, + OMX_DIRTYPE aDirection); + + + // + // Methods for Callback Notification (from MOmxILCallbackManagerIf) + // + + IMPORT_C OMX_ERRORTYPE TransitionCompleteNotification( + OMX_STATETYPE aOmxState); + + IMPORT_C OMX_ERRORTYPE CommandCompleteNotification( + OMX_COMMANDTYPE aOmxCommand, + OMX_U32 aOmxPortIndex); + + // + // Methods for Callback Notification (from MOmxILCallbackManagerIf) + // + + IMPORT_C OMX_ERRORTYPE ErrorEventNotification( + OMX_ERRORTYPE aOmxError); + + IMPORT_C OMX_ERRORTYPE EventNotification( + OMX_EVENTTYPE aEvent, + TUint32 aData1, + TUint32 aData2, + OMX_STRING aExtraInfo); + + IMPORT_C OMX_ERRORTYPE BufferDoneNotification( + OMX_BUFFERHEADERTYPE* apBufferHeader, + OMX_U32 aLocalPortIndex, + OMX_DIRTYPE aLocalPortDirection); + + IMPORT_C OMX_ERRORTYPE ClockBufferDoneNotification( + OMX_BUFFERHEADERTYPE* apBufferHeader, + OMX_U32 aLocalPortIndex, + OMX_DIRTYPE aLocalPortDirection); + + IMPORT_C 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 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 diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilindexmanager.h --- a/omxil/omxilcomponentcommon/src/common/omxilindexmanager.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilindexmanager.h Fri May 07 16:25:23 2010 +0100 @@ -1,63 +1,63 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// - - -/** - @file - @internalComponent -*/ - -#ifndef OMXILINDEXMANAGER_H -#define OMXILINDEXMANAGER_H - -#include - -// 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; - -protected: - - COmxILIndexManager(); - - inline RArray& ManagedParamIndexes(); - - inline RArray& ManagedConfigIndexes(); - -protected: - - RArray iManagedOmxParamIndexes; - RArray iManagedOmxConfigIndexes; - - }; - -#include "omxilindexmanager.inl" - -#endif // OMXILINDEXMANAGER_H - +// 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 + +// 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; + +protected: + + COmxILIndexManager(); + + inline RArray& ManagedParamIndexes(); + + inline RArray& ManagedConfigIndexes(); + +protected: + + RArray iManagedOmxParamIndexes; + RArray iManagedOmxConfigIndexes; + + }; + +#include "omxilindexmanager.inl" + +#endif // OMXILINDEXMANAGER_H + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilindexmanager.inl --- a/omxil/omxilcomponentcommon/src/common/omxilindexmanager.inl Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilindexmanager.inl Fri May 07 16:25:23 2010 +0100 @@ -1,86 +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& -COmxILIndexManager::ManagedParamIndexes() - { - return iManagedOmxParamIndexes; - } - -inline RArray& -COmxILIndexManager::ManagedConfigIndexes() - { - return iManagedOmxConfigIndexes; - } - - +// 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& +COmxILIndexManager::ManagedParamIndexes() + { + return iManagedOmxParamIndexes; + } + +inline RArray& +COmxILIndexManager::ManagedConfigIndexes() + { + return iManagedOmxConfigIndexes; + } + + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilotherport.cpp --- a/omxil/omxilcomponentcommon/src/common/omxilotherport.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilotherport.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,171 +1,171 @@ -// 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 "omxilotherport.h" -#include "omxilutil.h" - -EXPORT_C COmxILOtherPort::COmxILOtherPort(const TOmxILCommonPortData& aCommonPortData) - : COmxILPort(aCommonPortData) - { - iParamOtherPortFormat.nSize = sizeof(OMX_OTHER_PARAM_PORTFORMATTYPE); - iParamOtherPortFormat.nVersion = aCommonPortData.iOmxVersion; - iParamOtherPortFormat.nPortIndex = aCommonPortData.iPortIndex; - iParamOtherPortFormat.nIndex = 0; - } - -// [YYC]: proposal for deep copy, virtual & called from derived CostructL -EXPORT_C void COmxILOtherPort::ConstructL(const RArray& aSupportedOtherFormats) - { - TUint count = aSupportedOtherFormats.Count(); - for (TInt i = 0; i < count; i++) - { - iSupportedOtherFormats.AppendL(aSupportedOtherFormats[i]); - } - iParamOtherPortFormat.eFormat = count ? iSupportedOtherFormats[0] : OMX_OTHER_FormatMax; - } - -EXPORT_C COmxILOtherPort::~COmxILOtherPort() - { - iSupportedOtherFormats.Close(); - } - -EXPORT_C OMX_ERRORTYPE COmxILOtherPort::GetLocalOmxParamIndexes(RArray& 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& aIndexArray) const - { - // Always collect local indexes from parent - return COmxILPort::GetLocalOmxConfigIndexes(aIndexArray); - } - -EXPORT_C OMX_ERRORTYPE COmxILOtherPort::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(apComponentParameterStructure); - - if (pParamOtherPortFormat->nIndex >= iSupportedOtherFormats.Count()) - { - return OMX_ErrorNoMore; - } - - pParamOtherPortFormat->eFormat = iSupportedOtherFormats[pParamOtherPortFormat->nIndex]; - } - break; - default: - { - // Try the parent's indexes - return COmxILPort::GetParameter(aParamIndex, apComponentParameterStructure); - } - }; - - return OMX_ErrorNone; - } - -EXPORT_C OMX_ERRORTYPE COmxILOtherPort::SetParameter(OMX_INDEXTYPE aParamIndex, - const TAny* apComponentParameterStructure, - TBool& aUpdateProcessingFunction) - { - aUpdateProcessingFunction = EFalse; - - switch(aParamIndex) - { - case OMX_IndexParamOtherPortFormat: - { - OMX_ERRORTYPE omxRetValue = TOmxILUtil::CheckOmxStructSizeAndVersion(const_cast(apComponentParameterStructure), - sizeof(OMX_OTHER_PARAM_PORTFORMATTYPE)); - - if (omxRetValue != OMX_ErrorNone) - { - return omxRetValue; - } - - const OMX_OTHER_PARAM_PORTFORMATTYPE* pParamOtherPortFormat = - static_cast(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: - { - // Try the parent's indexes - return COmxILPort::SetParameter(aParamIndex, - apComponentParameterStructure, - aUpdateProcessingFunction); - } - }; - - return OMX_ErrorNone; - } +// 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 "omxilotherport.h" +#include "omxilutil.h" + +EXPORT_C COmxILOtherPort::COmxILOtherPort(const TOmxILCommonPortData& aCommonPortData) + : COmxILPort(aCommonPortData) + { + iParamOtherPortFormat.nSize = sizeof(OMX_OTHER_PARAM_PORTFORMATTYPE); + iParamOtherPortFormat.nVersion = aCommonPortData.iOmxVersion; + iParamOtherPortFormat.nPortIndex = aCommonPortData.iPortIndex; + iParamOtherPortFormat.nIndex = 0; + } + +// [YYC]: proposal for deep copy, virtual & called from derived CostructL +EXPORT_C void COmxILOtherPort::ConstructL(const RArray& aSupportedOtherFormats) + { + TUint count = aSupportedOtherFormats.Count(); + for (TInt i = 0; i < count; i++) + { + iSupportedOtherFormats.AppendL(aSupportedOtherFormats[i]); + } + iParamOtherPortFormat.eFormat = count ? iSupportedOtherFormats[0] : OMX_OTHER_FormatMax; + } + +EXPORT_C COmxILOtherPort::~COmxILOtherPort() + { + iSupportedOtherFormats.Close(); + } + +EXPORT_C OMX_ERRORTYPE COmxILOtherPort::GetLocalOmxParamIndexes(RArray& 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& aIndexArray) const + { + // Always collect local indexes from parent + return COmxILPort::GetLocalOmxConfigIndexes(aIndexArray); + } + +EXPORT_C OMX_ERRORTYPE COmxILOtherPort::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(apComponentParameterStructure); + + if (pParamOtherPortFormat->nIndex >= iSupportedOtherFormats.Count()) + { + return OMX_ErrorNoMore; + } + + pParamOtherPortFormat->eFormat = iSupportedOtherFormats[pParamOtherPortFormat->nIndex]; + } + break; + default: + { + // Try the parent's indexes + return COmxILPort::GetParameter(aParamIndex, apComponentParameterStructure); + } + }; + + return OMX_ErrorNone; + } + +EXPORT_C OMX_ERRORTYPE COmxILOtherPort::SetParameter(OMX_INDEXTYPE aParamIndex, + const TAny* apComponentParameterStructure, + TBool& aUpdateProcessingFunction) + { + aUpdateProcessingFunction = EFalse; + + switch(aParamIndex) + { + case OMX_IndexParamOtherPortFormat: + { + OMX_ERRORTYPE omxRetValue = TOmxILUtil::CheckOmxStructSizeAndVersion(const_cast(apComponentParameterStructure), + sizeof(OMX_OTHER_PARAM_PORTFORMATTYPE)); + + if (omxRetValue != OMX_ErrorNone) + { + return omxRetValue; + } + + const OMX_OTHER_PARAM_PORTFORMATTYPE* pParamOtherPortFormat = + static_cast(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: + { + // Try the parent's indexes + return COmxILPort::SetParameter(aParamIndex, + apComponentParameterStructure, + aUpdateProcessingFunction); + } + }; + + return OMX_ErrorNone; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilotherport.h --- a/omxil/omxilcomponentcommon/src/common/omxilotherport.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilotherport.h Fri May 07 16:25:23 2010 +0100 @@ -1,72 +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 - @internalTechnology -*/ - -#ifndef OMXILOTHERPORT_H -#define OMXILOTHERPORT_H - -#include "omxilport.h" -#include -#include -#include -#include - -class COmxILOtherPort : public COmxILPort - { -public: - IMPORT_C ~COmxILOtherPort(); - - // From COmxILPort - IMPORT_C OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray& aIndexArray) const = 0; - - // From COmxILPort - IMPORT_C OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray& 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; - -protected: - IMPORT_C COmxILOtherPort(const TOmxILCommonPortData& aCommonPortData); - - IMPORT_C virtual void ConstructL(const RArray& aSupportedOtherFormats); - - // From COmxILPort - IMPORT_C OMX_ERRORTYPE SetFormatInPortDefinition( - const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, - TBool& aUpdateProcessingFunction) = 0; - - // From COmxILPort - IMPORT_C TBool IsTunnelledPortCompatible( - const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const = 0; - -protected: - // To indicate the supported formats - RArray iSupportedOtherFormats; - - OMX_OTHER_PARAM_PORTFORMATTYPE iParamOtherPortFormat; - }; - -#endif // OMXILOTHERPORT_H +// 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 "omxilport.h" +#include +#include +#include +#include + +class COmxILOtherPort : public COmxILPort + { +public: + IMPORT_C ~COmxILOtherPort(); + + // From COmxILPort + IMPORT_C OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray& aIndexArray) const = 0; + + // From COmxILPort + IMPORT_C OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray& 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; + +protected: + IMPORT_C COmxILOtherPort(const TOmxILCommonPortData& aCommonPortData); + + IMPORT_C virtual void ConstructL(const RArray& aSupportedOtherFormats); + + // From COmxILPort + IMPORT_C OMX_ERRORTYPE SetFormatInPortDefinition( + const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, + TBool& aUpdateProcessingFunction) = 0; + + // From COmxILPort + IMPORT_C TBool IsTunnelledPortCompatible( + const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const = 0; + +protected: + // To indicate the supported formats + RArray iSupportedOtherFormats; + + OMX_OTHER_PARAM_PORTFORMATTYPE iParamOtherPortFormat; + }; + +#endif // OMXILOTHERPORT_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilport.cpp --- a/omxil/omxilcomponentcommon/src/common/omxilport.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilport.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,1471 +1,1492 @@ -// 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 -#include - -#include "log.h" -#include "omxilport.h" -#include "omxilutil.h" - - -const TInt COmxILPort::KMaxBufferMarksQueueSize; -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) - { - } - - -EXPORT_C -COmxILPort::COmxILPort(const TOmxILCommonPortData& aCommonPortData) - : - iTunnelledComponent(0), - iTunnelledPort(0), - iBufferHeaders(), - iBufferMarks(_FOFF(TBufferMarkInfo, iLink)), - iTransitionState(EPortNotTransitioning), - iBufferMarkPropagationPortIndex( - aCommonPortData.iBufferMarkPropagationPortIndex) - { - DEBUG_PRINTF(_L8("COmxILPort::COmxILPort")); - - __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)); - - // 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; - - } - -EXPORT_C -COmxILPort::~COmxILPort() - { - DEBUG_PRINTF(_L8("COmxILPort::~COmxILPort")); - -#ifdef _DEBUG - const TInt headerCount = iBufferHeaders.Count(); - if (headerCount > 0) - { - DEBUG_PRINTF(_L8("COmxILPort::~COmxILPort :: ------------------------------- WARNING --------------------------------------- ")); - DEBUG_PRINTF2(_L8("COmxILPort::~COmxILPort :: [%d] Buffer headers still exist"), headerCount); - DEBUG_PRINTF(_L8("COmxILPort::~COmxILPort :: CleanUpPort() may be used from the most derived port class to delete them")); - DEBUG_PRINTF(_L8("COmxILPort::~COmxILPort :: ------------------------------- WARNING --------------------------------------- ")); - } -#endif - - iBufferHeaders.Close(); - iBufferMarks.ResetAndDestroy(); - - } - -EXPORT_C OMX_ERRORTYPE -COmxILPort::GetLocalOmxParamIndexes(RArray& 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; - - } - -EXPORT_C OMX_ERRORTYPE -COmxILPort::GetLocalOmxConfigIndexes(RArray& /*aIndexArray*/) const - { - DEBUG_PRINTF(_L8("COmxILPort::GetLocalOmxConfigIndexes")); - - return OMX_ErrorNone; - - } - - -EXPORT_C OMX_ERRORTYPE -COmxILPort::GetParameter(OMX_INDEXTYPE aParamIndex, - TAny* apComponentParameterStructure) const - { - DEBUG_PRINTF(_L8("COmxILPort::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( - 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( - apComponentParameterStructure); - - pBufferSupplier->eBufferSupplier = - iParamCompBufferSupplier.eBufferSupplier; - } - break; - - default: - { - return OMX_ErrorUnsupportedIndex; - } - }; - - return OMX_ErrorNone; - - } - -EXPORT_C OMX_ERRORTYPE -COmxILPort::SetParameter(OMX_INDEXTYPE aParamIndex, - const TAny* apComponentParameterStructure, - TBool& aUpdateProcessingFunction) - { - DEBUG_PRINTF(_L8("COmxILPort::SetParameter")); - - aUpdateProcessingFunction = EFalse; - - OMX_ERRORTYPE omxRetValue = OMX_ErrorNone; - switch(aParamIndex) - { - case OMX_IndexParamPortDefinition: - { - if (OMX_ErrorNone != (omxRetValue = - TOmxILUtil::CheckOmxStructSizeAndVersion( - const_cast(apComponentParameterStructure), - sizeof(OMX_PARAM_PORTDEFINITIONTYPE)))) - { - return omxRetValue; - } - - const OMX_PARAM_PORTDEFINITIONTYPE* pPortDefinition - = static_cast( - apComponentParameterStructure); - - // Port Format must be set by the concrete port... - if (OMX_ErrorNone != - (omxRetValue = - 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; - } - iParamPortDefinition.nBufferCountActual = - pPortDefinition->nBufferCountActual; - aUpdateProcessingFunction = ETrue; - } - - } - break; - - case OMX_IndexParamCompBufferSupplier: - { - if (OMX_ErrorNone != (omxRetValue = - TOmxILUtil::CheckOmxStructSizeAndVersion( - const_cast(apComponentParameterStructure), - sizeof(OMX_PARAM_BUFFERSUPPLIERTYPE)))) - { - return omxRetValue; - } - - const OMX_PARAM_BUFFERSUPPLIERTYPE* pBufferSupplier - = static_cast( - 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; - } - } - iParamCompBufferSupplier.eBufferSupplier = - pBufferSupplier->eBufferSupplier; - } - - } - break; - default: - { - return OMX_ErrorUnsupportedIndex; - } - }; - - return OMX_ErrorNone; - - } - - -EXPORT_C OMX_ERRORTYPE -COmxILPort::GetConfig(OMX_INDEXTYPE /*aConfigIndex*/, - TAny* /*apComponentConfigStructure*/) const - { - DEBUG_PRINTF(_L8("COmxILPort::GetConfig")); - return OMX_ErrorUnsupportedIndex; - } - -EXPORT_C OMX_ERRORTYPE -COmxILPort::SetConfig(OMX_INDEXTYPE /*aConfigIndex*/, - const TAny* /*apComponentConfigStructure*/, - TBool& /*aUpdateProcessingFunction*/) - { - DEBUG_PRINTF(_L8("COmxILPort::SetConfig")); - return OMX_ErrorUnsupportedIndex; - } - -EXPORT_C 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; - } - -EXPORT_C OMX_ERRORTYPE -COmxILPort::PopulateBuffer(OMX_BUFFERHEADERTYPE** appBufferHdr, - const OMX_PTR apAppPrivate, - OMX_U32 aSizeBytes, - OMX_U8* apBuffer, - TBool& portPopulationCompleted) - { - DEBUG_PRINTF(_L8("COmxILPort::PopulateBuffer")); - - 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; - } - - // 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 = DoBufferWrapping(aSizeBytes, - apBuffer, - pPortPrivate, - pPlatformPrivate, - apAppPrivate); - } - else - { - // ... (AllocateBuffer) Do the port-specific buffer allocation ... - portSpecificErr = 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) - { - DoBufferUnwrapping( - apBuffer, - pPortPrivate, - pPlatformPrivate, - apAppPrivate); - - } - else - { - 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; - - } - - -EXPORT_C OMX_ERRORTYPE -COmxILPort::FreeBuffer(OMX_BUFFERHEADERTYPE* apBufferHeader, - TBool& portDepopulationCompleted) - { - DEBUG_PRINTF2(_L8("COmxILPort::FreeBuffer : BUFFER [%X]"), apBufferHeader); - - portDepopulationCompleted = EFalse; - - TInt headerIndex = 0; - if (KErrNotFound == - (headerIndex = - iBufferHeaders.Find(TBufferInfo(apBufferHeader), - TIdentityRelation( - &TBufferInfo::Compare)))) - { - return OMX_ErrorBadParameter; - } - - - OMX_PTR pPortPrivate = - OMX_DirInput == iParamPortDefinition.eDir ? - apBufferHeader->pInputPortPrivate : - apBufferHeader->pOutputPortPrivate; - - if (iBufferHeaders[headerIndex].IsBufferOwned()) - { - DoBufferDeallocation( - apBufferHeader->pBuffer, - pPortPrivate, - apBufferHeader->pPlatformPrivate, - apBufferHeader->pAppPrivate); - } - else - { - 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; - } - - return OMX_ErrorNone; - - } - - -EXPORT_C OMX_ERRORTYPE -COmxILPort::TunnelRequest(OMX_HANDLETYPE aTunneledComp, - OMX_U32 aTunneledPort, - OMX_TUNNELSETUPTYPE* apTunnelSetup) - { - DEBUG_PRINTF(_L8("COmxILPort::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 (!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; - - } - - -EXPORT_C OMX_ERRORTYPE -COmxILPort::PopulateTunnel(TBool& portPopulationCompleted) - { - DEBUG_PRINTF(_L8("COmxILPort::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("COmxILPort::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("COmxILPort::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("COmxILPort::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; ipInputPortPrivate = 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))) - { - 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; - - } - - -EXPORT_C OMX_ERRORTYPE -COmxILPort::FreeTunnel(TBool& portDepopulationCompleted) - { - DEBUG_PRINTF(_L8("COmxILPort::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; ipBuffer; - OMX_PTR pPortPrivate = - OMX_DirInput == iParamPortDefinition.eDir ? - pBufferHeader->pInputPortPrivate : - pBufferHeader->pOutputPortPrivate; - OMX_PTR pAppPrivate = pBufferHeader->pAppPrivate; - OMX_PTR pPlatformPrivate = pBufferHeader->pPlatformPrivate; - - DEBUG_PRINTF2(_L8("COmxILPort::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....) - - 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; - - } - - - -EXPORT_C TBool -COmxILPort::SetBufferSent(OMX_BUFFERHEADERTYPE* apBufferHeader, - TBool& aBufferMarkedWithOwnMark) - { - DEBUG_PRINTF(_L8("COmxILPort::SetBufferSent")); - - __ASSERT_DEBUG(apBufferHeader, User::Panic(KOmxILPortPanicCategory, 1)); - - aBufferMarkedWithOwnMark = EFalse; - - TInt index = 0; - if (KErrNotFound == - (index = - iBufferHeaders.Find(TBufferInfo(apBufferHeader), - TIdentityRelation( - &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; - - } - -EXPORT_C TBool -COmxILPort::SetBufferReturned(OMX_BUFFERHEADERTYPE* apBufferHeader) - { - DEBUG_PRINTF(_L8("COmxILPort::SetBufferReturned")); - - __ASSERT_DEBUG(apBufferHeader, User::Panic(KOmxILPortPanicCategory, 1)); - - TInt index = 0; - if (KErrNotFound == - (index = - iBufferHeaders.Find(TBufferInfo(apBufferHeader), - TIdentityRelation( - &TBufferInfo::Compare)))) - { - return EFalse; - } - - iBufferHeaders[index].SetBufferAtHome(); - - return ETrue; - - } - -EXPORT_C void -COmxILPort::SetTransitionToEnabled() - { - DEBUG_PRINTF(_L8("COmxILPort::SetTransitionToEnabled")); - - iTransitionState = EPortTransitioningToEnabled; - iParamPortDefinition.bEnabled = OMX_TRUE; - - } - -EXPORT_C void -COmxILPort::SetTransitionToDisabled() - { - DEBUG_PRINTF(_L8("COmxILPort::SetTransitionToDisabled")); - - iTransitionState = EPortTransitioningToDisabled; - iParamPortDefinition.bEnabled = OMX_FALSE; - - } - -EXPORT_C void -COmxILPort::SetTransitionToDisabledCompleted() - { - DEBUG_PRINTF(_L8("COmxILPort::SetTransitionToDisabledCompleted")); - - iTransitionState = EPortNotTransitioning; - iParamPortDefinition.bEnabled = OMX_FALSE; - - } - -EXPORT_C void -COmxILPort::SetTransitionToEnabledCompleted() - { - DEBUG_PRINTF(_L8("COmxILPort::SetTransitionToEnabledCompleted")); - - iTransitionState = EPortNotTransitioning; - iParamPortDefinition.bEnabled = OMX_TRUE; - - } - -EXPORT_C OMX_ERRORTYPE -COmxILPort::StoreBufferMark(const OMX_MARKTYPE* apMark) - { - DEBUG_PRINTF(_L8("COmxILPort::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. - - */ -EXPORT_C void -COmxILPort::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 tempHeadersArray; - for (TInt i=0; i tempHeadersArray; - for (TInt i=0; i( - &TBufferInfo::Compare)))) - { - User::Panic(KOmxILPortPanicCategory, 1); - } - - DEBUG_PRINTF2(_L8("COmxILPort::IsBufferAtHome : [%s]"), iBufferHeaders[headerIndex].IsBufferAtHome() ? "YES" : "NO"); - - return iBufferHeaders[headerIndex].IsBufferAtHome(); - - } - - -/** - 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. - - @param 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 -*/ -EXPORT_C 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(pDescBuffer->Data().Ptr()); - apPortPrivate = static_cast(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. - -*/ -EXPORT_C 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(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 -*/ -EXPORT_C 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. - -*/ -EXPORT_C 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(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 - - @param aSizeBytes The size in bytes of the to be allocated buffer - - @param apBuffer A pointer to the allocated buffer - - @return OMX_ERRORTYPE - -*/ -EXPORT_C 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); - - } - -EXPORT_C TBool -COmxILPort::TBufferInfo::Compare(const TBufferInfo& aBi1, - const TBufferInfo& aBi2) - { - return (aBi1.GetHeader() == aBi2.GetHeader() ? ETrue : EFalse); - } +// 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 +#include + +#include "log.h" +#include "omxilport.h" +#include "omxilutil.h" + + +const TInt COmxILPort::KMaxBufferMarksQueueSize; +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) + { + } + + +EXPORT_C +COmxILPort::COmxILPort(const TOmxILCommonPortData& aCommonPortData) + : + iTunnelledComponent(0), + iTunnelledPort(0), + iBufferHeaders(), + iBufferMarks(_FOFF(TBufferMarkInfo, iLink)), + iTransitionState(EPortNotTransitioning), + iBufferMarkPropagationPortIndex( + aCommonPortData.iBufferMarkPropagationPortIndex), + aFirstUseBufferHasBeenReceived(OMX_FALSE) + { + DEBUG_PRINTF(_L8("COmxILPort::COmxILPort")); + + __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)); + + // 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; + + } + +EXPORT_C +COmxILPort::~COmxILPort() + { + DEBUG_PRINTF(_L8("COmxILPort::~COmxILPort")); + +#ifdef _DEBUG + const TInt headerCount = iBufferHeaders.Count(); + if (headerCount > 0) + { + DEBUG_PRINTF(_L8("COmxILPort::~COmxILPort :: ------------------------------- WARNING --------------------------------------- ")); + DEBUG_PRINTF2(_L8("COmxILPort::~COmxILPort :: [%d] Buffer headers still exist"), headerCount); + DEBUG_PRINTF(_L8("COmxILPort::~COmxILPort :: CleanUpPort() may be used from the most derived port class to delete them")); + DEBUG_PRINTF(_L8("COmxILPort::~COmxILPort :: ------------------------------- WARNING --------------------------------------- ")); + } +#endif + + iBufferHeaders.Close(); + iBufferMarks.ResetAndDestroy(); + + } + +EXPORT_C OMX_ERRORTYPE +COmxILPort::GetLocalOmxParamIndexes(RArray& 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; + + } + +EXPORT_C OMX_ERRORTYPE +COmxILPort::GetLocalOmxConfigIndexes(RArray& /*aIndexArray*/) const + { + DEBUG_PRINTF(_L8("COmxILPort::GetLocalOmxConfigIndexes")); + + return OMX_ErrorNone; + + } + + +EXPORT_C OMX_ERRORTYPE +COmxILPort::GetParameter(OMX_INDEXTYPE aParamIndex, + TAny* apComponentParameterStructure) const + { + DEBUG_PRINTF(_L8("COmxILPort::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( + 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( + apComponentParameterStructure); + + pBufferSupplier->eBufferSupplier = + iParamCompBufferSupplier.eBufferSupplier; + } + break; + + default: + { + return OMX_ErrorUnsupportedIndex; + } + }; + + return OMX_ErrorNone; + + } + +EXPORT_C OMX_ERRORTYPE +COmxILPort::SetParameter(OMX_INDEXTYPE aParamIndex, + const TAny* apComponentParameterStructure, + TBool& aUpdateProcessingFunction) + { + DEBUG_PRINTF(_L8("COmxILPort::SetParameter")); + + aUpdateProcessingFunction = EFalse; + + + if (OMX_TRUE == aFirstUseBufferHasBeenReceived) + { + DEBUG_PRINTF2(_L8("COmxILPort::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(apComponentParameterStructure), + sizeof(OMX_PARAM_PORTDEFINITIONTYPE)))) + { + return omxRetValue; + } + + const OMX_PARAM_PORTDEFINITIONTYPE* pPortDefinition + = static_cast( + apComponentParameterStructure); + + // Port Format must be set by the concrete port... + if (OMX_ErrorNone != + (omxRetValue = + 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("COmxILPort::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(apComponentParameterStructure), + sizeof(OMX_PARAM_BUFFERSUPPLIERTYPE)))) + { + return omxRetValue; + } + + const OMX_PARAM_BUFFERSUPPLIERTYPE* pBufferSupplier + = static_cast( + 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("COmxILPort::SetParameter : old.eBufferSupplier [%u] new.eBufferSupplier [%u]"), + iParamCompBufferSupplier.eBufferSupplier, pBufferSupplier->eBufferSupplier); + iParamCompBufferSupplier.eBufferSupplier = + pBufferSupplier->eBufferSupplier; + } + + } + break; + default: + { + return OMX_ErrorUnsupportedIndex; + } + }; + + return OMX_ErrorNone; + + } + + +EXPORT_C OMX_ERRORTYPE +COmxILPort::GetConfig(OMX_INDEXTYPE /*aConfigIndex*/, + TAny* /*apComponentConfigStructure*/) const + { + DEBUG_PRINTF(_L8("COmxILPort::GetConfig")); + return OMX_ErrorUnsupportedIndex; + } + +EXPORT_C OMX_ERRORTYPE +COmxILPort::SetConfig(OMX_INDEXTYPE /*aConfigIndex*/, + const TAny* /*apComponentConfigStructure*/, + TBool& /*aUpdateProcessingFunction*/) + { + DEBUG_PRINTF(_L8("COmxILPort::SetConfig")); + return OMX_ErrorUnsupportedIndex; + } + +EXPORT_C 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; + } + +EXPORT_C OMX_ERRORTYPE +COmxILPort::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_PRINTF3(_L8("COmxILPort::PopulateBuffer : BUFFER[%X] PORT[%u]"), pHeader, iParamPortDefinition.nPortIndex); + + // 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 = DoBufferWrapping(aSizeBytes, + apBuffer, + pPortPrivate, + pPlatformPrivate, + apAppPrivate); + + aFirstUseBufferHasBeenReceived = OMX_TRUE; + } + else + { + // ... (AllocateBuffer) Do the port-specific buffer allocation ... + portSpecificErr = 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) + { + DoBufferUnwrapping( + apBuffer, + pPortPrivate, + pPlatformPrivate, + apAppPrivate); + + } + else + { + 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; + + } + + +EXPORT_C OMX_ERRORTYPE +COmxILPort::FreeBuffer(OMX_BUFFERHEADERTYPE* apBufferHeader, + TBool& portDepopulationCompleted) + { + DEBUG_PRINTF2(_L8("COmxILPort::FreeBuffer : BUFFER [%X]"), apBufferHeader); + + portDepopulationCompleted = EFalse; + + TInt headerIndex = 0; + if (KErrNotFound == + (headerIndex = + iBufferHeaders.Find(TBufferInfo(apBufferHeader), + TIdentityRelation( + &TBufferInfo::Compare)))) + { + return OMX_ErrorBadParameter; + } + + + OMX_PTR pPortPrivate = + OMX_DirInput == iParamPortDefinition.eDir ? + apBufferHeader->pInputPortPrivate : + apBufferHeader->pOutputPortPrivate; + + if (iBufferHeaders[headerIndex].IsBufferOwned()) + { + DoBufferDeallocation( + apBufferHeader->pBuffer, + pPortPrivate, + apBufferHeader->pPlatformPrivate, + apBufferHeader->pAppPrivate); + } + else + { + 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; + + } + + +EXPORT_C OMX_ERRORTYPE +COmxILPort::TunnelRequest(OMX_HANDLETYPE aTunneledComp, + OMX_U32 aTunneledPort, + OMX_TUNNELSETUPTYPE* apTunnelSetup) + { + DEBUG_PRINTF(_L8("COmxILPort::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 (!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; + + } + + +EXPORT_C OMX_ERRORTYPE +COmxILPort::PopulateTunnel(TBool& portPopulationCompleted) + { + DEBUG_PRINTF(_L8("COmxILPort::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("COmxILPort::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("COmxILPort::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("COmxILPort::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; ipInputPortPrivate = 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))) + { + 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; + + } + + +EXPORT_C OMX_ERRORTYPE +COmxILPort::FreeTunnel(TBool& portDepopulationCompleted) + { + DEBUG_PRINTF(_L8("COmxILPort::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; ipBuffer; + OMX_PTR pPortPrivate = + OMX_DirInput == iParamPortDefinition.eDir ? + pBufferHeader->pInputPortPrivate : + pBufferHeader->pOutputPortPrivate; + OMX_PTR pAppPrivate = pBufferHeader->pAppPrivate; + OMX_PTR pPlatformPrivate = pBufferHeader->pPlatformPrivate; + + DEBUG_PRINTF2(_L8("COmxILPort::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....) + + 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; + + } + + + +EXPORT_C TBool +COmxILPort::SetBufferSent(OMX_BUFFERHEADERTYPE* apBufferHeader, + TBool& aBufferMarkedWithOwnMark) + { + DEBUG_PRINTF(_L8("COmxILPort::SetBufferSent")); + + __ASSERT_DEBUG(apBufferHeader, User::Panic(KOmxILPortPanicCategory, 1)); + + aBufferMarkedWithOwnMark = EFalse; + + TInt index = 0; + if (KErrNotFound == + (index = + iBufferHeaders.Find(TBufferInfo(apBufferHeader), + TIdentityRelation( + &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; + + } + +EXPORT_C TBool +COmxILPort::SetBufferReturned(OMX_BUFFERHEADERTYPE* apBufferHeader) + { + DEBUG_PRINTF(_L8("COmxILPort::SetBufferReturned")); + + __ASSERT_DEBUG(apBufferHeader, User::Panic(KOmxILPortPanicCategory, 1)); + + TInt index = 0; + if (KErrNotFound == + (index = + iBufferHeaders.Find(TBufferInfo(apBufferHeader), + TIdentityRelation( + &TBufferInfo::Compare)))) + { + return EFalse; + } + + iBufferHeaders[index].SetBufferAtHome(); + + return ETrue; + + } + +EXPORT_C void +COmxILPort::SetTransitionToEnabled() + { + DEBUG_PRINTF(_L8("COmxILPort::SetTransitionToEnabled")); + + iTransitionState = EPortTransitioningToEnabled; + iParamPortDefinition.bEnabled = OMX_TRUE; + + } + +EXPORT_C void +COmxILPort::SetTransitionToDisabled() + { + DEBUG_PRINTF(_L8("COmxILPort::SetTransitionToDisabled")); + + iTransitionState = EPortTransitioningToDisabled; + iParamPortDefinition.bEnabled = OMX_FALSE; + + } + +EXPORT_C void +COmxILPort::SetTransitionToDisabledCompleted() + { + DEBUG_PRINTF(_L8("COmxILPort::SetTransitionToDisabledCompleted")); + + iTransitionState = EPortNotTransitioning; + iParamPortDefinition.bEnabled = OMX_FALSE; + + } + +EXPORT_C void +COmxILPort::SetTransitionToEnabledCompleted() + { + DEBUG_PRINTF(_L8("COmxILPort::SetTransitionToEnabledCompleted")); + + iTransitionState = EPortNotTransitioning; + iParamPortDefinition.bEnabled = OMX_TRUE; + + } + +EXPORT_C OMX_ERRORTYPE +COmxILPort::StoreBufferMark(const OMX_MARKTYPE* apMark) + { + DEBUG_PRINTF(_L8("COmxILPort::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. + + */ +EXPORT_C void +COmxILPort::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 tempHeadersArray; + for (TInt i=0; i tempHeadersArray; + for (TInt i=0; i( + &TBufferInfo::Compare)))) + { + User::Panic(KOmxILPortPanicCategory, 1); + } + + DEBUG_PRINTF2(_L8("COmxILPort::IsBufferAtHome : [%s]"), iBufferHeaders[headerIndex].IsBufferAtHome() ? "YES" : "NO"); + + return iBufferHeaders[headerIndex].IsBufferAtHome(); + + } + + +/** + 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 +*/ +EXPORT_C 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(pDescBuffer->Data().Ptr()); + apPortPrivate = static_cast(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. + +*/ +EXPORT_C 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(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 +*/ +EXPORT_C 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. + +*/ +EXPORT_C 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(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 + +*/ +EXPORT_C 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); + + } + +EXPORT_C TBool +COmxILPort::TBufferInfo::Compare(const TBufferInfo& aBi1, + const TBufferInfo& aBi2) + { + return (aBi1.GetHeader() == aBi2.GetHeader() ? ETrue : EFalse); + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilport.h --- a/omxil/omxilcomponentcommon/src/common/omxilport.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilport.h Fri May 07 16:25:23 2010 +0100 @@ -1,545 +1,550 @@ -// 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 OMXILPORT_H -#define OMXILPORT_H - -#include - -#include -#include "omxilspecversion.h" - - -/** - Base Port Panic category -*/ -_LIT(KOmxILPortPanicCategory, "OmxILPort"); - - -// Forward declarations -class TOmxILCommonPortData; - -/** - OpenMAX IL component port base class. -*/ -class COmxILPort : public CBase - { - -public: - - static const TInt KMaxBufferMarksQueueSize = 10; - static const TInt KBufferMarkPropagationPortNotNeeded = 0x7FFFFFFF; - -public: - - IMPORT_C ~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 - */ - IMPORT_C virtual OMX_ERRORTYPE GetLocalOmxParamIndexes( - RArray& 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 - */ - IMPORT_C virtual OMX_ERRORTYPE GetLocalOmxConfigIndexes( - RArray& 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 - */ - IMPORT_C 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 - */ - IMPORT_C virtual OMX_ERRORTYPE SetParameter( - OMX_INDEXTYPE aParamIndex, - const TAny* apComponentParameterStructure, - TBool& aUpdateProcessingFunction) = 0; - - IMPORT_C virtual OMX_ERRORTYPE GetConfig( - OMX_INDEXTYPE aConfigIndex, - TAny* apComponentConfigStructure) const; - - IMPORT_C virtual OMX_ERRORTYPE SetConfig( - OMX_INDEXTYPE aConfigIndex, - const TAny* apComponentConfigStructure, - TBool& aUpdateProcessingFunction); - - IMPORT_C virtual OMX_ERRORTYPE GetExtensionIndex( - OMX_STRING aParameterName, - OMX_INDEXTYPE* apIndexType) const; - - IMPORT_C virtual OMX_ERRORTYPE PopulateBuffer( - OMX_BUFFERHEADERTYPE** appBufferHdr, - const OMX_PTR apAppPrivate, - OMX_U32 aSizeBytes, - OMX_U8* apBuffer, - TBool& portPopulationCompleted); - - IMPORT_C virtual OMX_ERRORTYPE FreeBuffer( - OMX_BUFFERHEADERTYPE* apBufferHeader, - TBool& portDepopulationCompleted); - - IMPORT_C virtual OMX_ERRORTYPE TunnelRequest( - OMX_HANDLETYPE aTunneledComp, - OMX_U32 aTunneledPort, - OMX_TUNNELSETUPTYPE* apTunnelSetup); - - IMPORT_C virtual OMX_ERRORTYPE PopulateTunnel( - TBool& portPopulationCompleted); - - IMPORT_C virtual OMX_ERRORTYPE FreeTunnel( - TBool& portDepopulationCompleted); - - IMPORT_C virtual TBool SetBufferSent( - OMX_BUFFERHEADERTYPE* apBufferHeader, - TBool& aBufferMarkedWithOwnMark); - - IMPORT_C virtual TBool SetBufferReturned( - OMX_BUFFERHEADERTYPE* apBufferHeader); - - IMPORT_C virtual void SetTransitionToDisabled(); - - IMPORT_C virtual void SetTransitionToEnabled(); - - IMPORT_C virtual void SetTransitionToDisabledCompleted(); - - IMPORT_C virtual void SetTransitionToEnabledCompleted(); - - IMPORT_C virtual OMX_ERRORTYPE StoreBufferMark( - const OMX_MARKTYPE* pMark); - - IMPORT_C virtual OMX_ERRORTYPE SetComponentRoleDefaults( - TUint aComponentRoleIndex); - - IMPORT_C virtual 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; - - IMPORT_C virtual TBool HasAllBuffersAtHome() const; - - inline TBool IsTransitioningToEnabled() const; - - inline TBool IsTransitioningToDisabled() const; - - IMPORT_C 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 - { - - public: - - // Convenience typedef.... - typedef TSglQue 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; - -protected: - - enum TPortIntermediateState - { - EPortNotTransitioning, - EPortTransitioningToDisabled, - EPortTransitioningToEnabled - }; - - -protected: - - IMPORT_C explicit COmxILPort(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; - - 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); - - template - inline OMX_ERRORTYPE GetParamStructureFromTunnel( - T& aComponentConfigStructure, OMX_INDEXTYPE aParamIndex) const; - - IMPORT_C OMX_ERRORTYPE StoreBufferMark( - OMX_HANDLETYPE& ipMarkTargetComponent, - OMX_PTR& ipMarkData); - - IMPORT_C void CleanUpPort(); - -protected: - - // Tunnelled component - OMX_HANDLETYPE iTunnelledComponent; - - // Tunnelled component's port - OMX_U32 iTunnelledPort; - - // Buffer headers store - RArray 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; - - // OpenMAX IL port definition structure - OMX_PARAM_PORTDEFINITIONTYPE iParamPortDefinition; - - // OpenMAX IL buffer supplier structure - OMX_PARAM_BUFFERSUPPLIERTYPE iParamCompBufferSupplier; - - }; - - -/** - 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); - - }; - -/** - Buffer mark info structure -*/ -class COmxILPort::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 COmxILPort::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); - - IMPORT_C 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 "omxilport.inl" - -#endif // OMXILPORT_H +// 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 OMXILPORT_H +#define OMXILPORT_H + +#include + +#include +#include "omxilspecversion.h" + + +/** + Base Port Panic category +*/ +_LIT(KOmxILPortPanicCategory, "OmxILPort"); + + +// Forward declarations +class TOmxILCommonPortData; + +/** + OpenMAX IL component port base class. +*/ +class COmxILPort : public CBase + { + +public: + + static const TInt KMaxBufferMarksQueueSize = 10; + static const TInt KBufferMarkPropagationPortNotNeeded = 0x7FFFFFFF; + +public: + + IMPORT_C ~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 + */ + IMPORT_C virtual OMX_ERRORTYPE GetLocalOmxParamIndexes( + RArray& 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 + */ + IMPORT_C virtual OMX_ERRORTYPE GetLocalOmxConfigIndexes( + RArray& 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 + */ + IMPORT_C 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 + */ + IMPORT_C virtual OMX_ERRORTYPE SetParameter( + OMX_INDEXTYPE aParamIndex, + const TAny* apComponentParameterStructure, + TBool& aUpdateProcessingFunction) = 0; + + IMPORT_C virtual OMX_ERRORTYPE GetConfig( + OMX_INDEXTYPE aConfigIndex, + TAny* apComponentConfigStructure) const; + + IMPORT_C virtual OMX_ERRORTYPE SetConfig( + OMX_INDEXTYPE aConfigIndex, + const TAny* apComponentConfigStructure, + TBool& aUpdateProcessingFunction); + + IMPORT_C virtual OMX_ERRORTYPE GetExtensionIndex( + OMX_STRING aParameterName, + OMX_INDEXTYPE* apIndexType) const; + + IMPORT_C virtual OMX_ERRORTYPE PopulateBuffer( + OMX_BUFFERHEADERTYPE** appBufferHdr, + const OMX_PTR apAppPrivate, + OMX_U32 aSizeBytes, + OMX_U8* apBuffer, + TBool& portPopulationCompleted); + + IMPORT_C virtual OMX_ERRORTYPE FreeBuffer( + OMX_BUFFERHEADERTYPE* apBufferHeader, + TBool& portDepopulationCompleted); + + IMPORT_C virtual OMX_ERRORTYPE TunnelRequest( + OMX_HANDLETYPE aTunneledComp, + OMX_U32 aTunneledPort, + OMX_TUNNELSETUPTYPE* apTunnelSetup); + + IMPORT_C virtual OMX_ERRORTYPE PopulateTunnel( + TBool& portPopulationCompleted); + + IMPORT_C virtual OMX_ERRORTYPE FreeTunnel( + TBool& portDepopulationCompleted); + + IMPORT_C virtual TBool SetBufferSent( + OMX_BUFFERHEADERTYPE* apBufferHeader, + TBool& aBufferMarkedWithOwnMark); + + IMPORT_C virtual TBool SetBufferReturned( + OMX_BUFFERHEADERTYPE* apBufferHeader); + + IMPORT_C virtual void SetTransitionToDisabled(); + + IMPORT_C virtual void SetTransitionToEnabled(); + + IMPORT_C virtual void SetTransitionToDisabledCompleted(); + + IMPORT_C virtual void SetTransitionToEnabledCompleted(); + + IMPORT_C virtual OMX_ERRORTYPE StoreBufferMark( + const OMX_MARKTYPE* pMark); + + IMPORT_C virtual OMX_ERRORTYPE SetComponentRoleDefaults( + TUint aComponentRoleIndex); + + IMPORT_C virtual 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; + + IMPORT_C virtual TBool HasAllBuffersAtHome() const; + + inline TBool IsTransitioningToEnabled() const; + + inline TBool IsTransitioningToDisabled() const; + + IMPORT_C 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 + { + + public: + + // Convenience typedef.... + typedef TSglQue 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; + +protected: + + enum TPortIntermediateState + { + EPortNotTransitioning, + EPortTransitioningToDisabled, + EPortTransitioningToEnabled + }; + + +protected: + + IMPORT_C explicit COmxILPort(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; + + 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); + + template + inline OMX_ERRORTYPE GetParamStructureFromTunnel( + T& aComponentConfigStructure, OMX_INDEXTYPE aParamIndex) const; + + IMPORT_C OMX_ERRORTYPE StoreBufferMark( + OMX_HANDLETYPE& ipMarkTargetComponent, + OMX_PTR& ipMarkData); + + IMPORT_C void CleanUpPort(); + +protected: + + // Tunnelled component + OMX_HANDLETYPE iTunnelledComponent; + + // Tunnelled component's port + OMX_U32 iTunnelledPort; + + // Buffer headers store + RArray 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; + + }; + + +/** + 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); + + }; + +/** + Buffer mark info structure +*/ +class COmxILPort::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 COmxILPort::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); + + IMPORT_C 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 "omxilport.inl" + +#endif // OMXILPORT_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilport.inl --- a/omxil/omxilcomponentcommon/src/common/omxilport.inl Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilport.inl Fri May 07 16:25:23 2010 +0100 @@ -1,372 +1,372 @@ -// 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_DIRTYPE -COmxILPort::Direction() const - { - return iParamPortDefinition.eDir; - } - -inline TBool -COmxILPort::IsEnabled() const - { - return iParamPortDefinition.bEnabled; - } - -inline TBool -COmxILPort::IsPopulated() const - { - return (OMX_TRUE == iParamPortDefinition.bPopulated ? ETrue : EFalse); - } - -inline TBool -COmxILPort::IsDePopulated() const - { - return (iBufferHeaders.Count() == 0 ? ETrue : EFalse); - } - -inline TBool -COmxILPort::IsTunnelled() const - { - return (iTunnelledComponent != 0 ? ETrue : EFalse); - } - -inline TBool -COmxILPort::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 -COmxILPort::IsTransitioningToEnabled() const - { - return (iTransitionState == EPortTransitioningToEnabled ? ETrue : EFalse); - } - -inline TBool -COmxILPort::IsTransitioningToDisabled() const - { - return (iTransitionState == EPortTransitioningToDisabled ? ETrue : EFalse); - } - -inline OMX_U32 -COmxILPort::Index() const - { - return iParamPortDefinition.nPortIndex; - } - -inline OMX_PORTDOMAINTYPE -COmxILPort::Domain() const - { - return iParamPortDefinition.eDomain; - } - -inline OMX_U32 -COmxILPort::Count() const - { - return iBufferHeaders.Count(); - } - -inline OMX_BUFFERHEADERTYPE* const& -COmxILPort::operator[](TInt anIndex) const - { - return this->operator[](anIndex); - } - -inline OMX_BUFFERHEADERTYPE*& -COmxILPort::operator[](TInt anIndex) - { - __ASSERT_ALWAYS((anIndex>=0 && anIndex -inline OMX_ERRORTYPE -COmxILPort::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 -COmxILPort::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 -COmxILPort::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 -COmxILPort::TBufferMarkInfoQue::TBufferMarkInfoQue(TInt aOffset) - : - Tq(aOffset), - iNumElements(0) - { - } - -inline COmxILPort::TBufferMarkInfo* -COmxILPort::TBufferMarkInfoQue::First() const - { - return Tq::First(); - } - -inline void -COmxILPort::TBufferMarkInfoQue::AddLast(COmxILPort::TBufferMarkInfo& aRef) - { - Tq::AddLast(aRef); - ++iNumElements; - } - -inline void -COmxILPort::TBufferMarkInfoQue::Remove(COmxILPort::TBufferMarkInfo& aRef) - { - Tq::Remove(aRef); - --iNumElements; - } - -inline TInt -COmxILPort::TBufferMarkInfoQue::Elements() const - { - return iNumElements; - } - -inline void -COmxILPort::TBufferMarkInfoQue::ResetAndDestroy() - { - while (!Tq::IsEmpty()) - { - COmxILPort::TBufferMarkInfo* pMark = Tq::First(); - __ASSERT_DEBUG(pMark, User::Panic(KOmxILPortPanicCategory, 1)); - Tq::Remove(*pMark); - delete pMark; - } - iNumElements = 0; - } - - -inline -COmxILPort::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 -COmxILPort::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* -COmxILPort::TBufferInfo::GetHeader() const - { - return ipHeader; - } - -inline OMX_BUFFERHEADERTYPE* -COmxILPort::TBufferInfo::GetHeader() - { - return ipHeader; - } - -inline -COmxILPort::TBufferInfo::operator OMX_BUFFERHEADERTYPE*&() - { - return ipHeader; - } - -inline -COmxILPort::TBufferInfo::operator OMX_BUFFERHEADERTYPE* const&() const - { - return ipHeader; - } - -inline OMX_U8* -COmxILPort::TBufferInfo::GetBufferPointer() const - { - return ipBuffer; - } - -inline OMX_U8* -COmxILPort::TBufferInfo::GetBufferPointer() - { - return ipBuffer; - } - -inline OMX_PTR -COmxILPort::TBufferInfo::GetPortPointer() const - { - return ipPort; - } - -inline OMX_PTR -COmxILPort::TBufferInfo::GetPortPointer() - { - return ipPort; - } - -inline OMX_PTR -COmxILPort::TBufferInfo::GetPlatformPointer() const - { - return ipPlatform; - } - -inline OMX_PTR -COmxILPort::TBufferInfo::GetPlatformPointer() - { - return ipPlatform; - } - -inline OMX_PTR -COmxILPort::TBufferInfo::GetAppPointer() const - { - return ipApp; - } - -inline OMX_PTR -COmxILPort::TBufferInfo::GetAppPointer() - { - return ipApp; - } - -inline void -COmxILPort::TBufferInfo::SetBufferAtHome() - { - iBufferProperties |= EBufferAtHome; - } - -inline void -COmxILPort::TBufferInfo::SetBufferAway() - { - iBufferProperties &= EBufferAwayMask; - } - -inline void -COmxILPort::TBufferInfo::SetBufferOwned() - { - iBufferProperties |= EBufferOwned; - } - -inline void -COmxILPort::TBufferInfo::SetBufferNotOwned() - { - iBufferProperties &= EBufferNotOwnedMask; - } - -inline TBool -COmxILPort::TBufferInfo::IsBufferAtHome() const - { - return ((iBufferProperties & EBufferAtHome) != 0x0 ? ETrue : EFalse); - } - -inline TBool -COmxILPort::TBufferInfo::IsBufferOwned() const - { - return ((iBufferProperties & EBufferOwned) != 0x0 ? ETrue : EFalse); - } - - +// 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_DIRTYPE +COmxILPort::Direction() const + { + return iParamPortDefinition.eDir; + } + +inline TBool +COmxILPort::IsEnabled() const + { + return iParamPortDefinition.bEnabled; + } + +inline TBool +COmxILPort::IsPopulated() const + { + return (OMX_TRUE == iParamPortDefinition.bPopulated ? ETrue : EFalse); + } + +inline TBool +COmxILPort::IsDePopulated() const + { + return (iBufferHeaders.Count() == 0 ? ETrue : EFalse); + } + +inline TBool +COmxILPort::IsTunnelled() const + { + return (iTunnelledComponent != 0 ? ETrue : EFalse); + } + +inline TBool +COmxILPort::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 +COmxILPort::IsTransitioningToEnabled() const + { + return (iTransitionState == EPortTransitioningToEnabled ? ETrue : EFalse); + } + +inline TBool +COmxILPort::IsTransitioningToDisabled() const + { + return (iTransitionState == EPortTransitioningToDisabled ? ETrue : EFalse); + } + +inline OMX_U32 +COmxILPort::Index() const + { + return iParamPortDefinition.nPortIndex; + } + +inline OMX_PORTDOMAINTYPE +COmxILPort::Domain() const + { + return iParamPortDefinition.eDomain; + } + +inline OMX_U32 +COmxILPort::Count() const + { + return iBufferHeaders.Count(); + } + +inline OMX_BUFFERHEADERTYPE* const& +COmxILPort::operator[](TInt anIndex) const + { + return this->operator[](anIndex); + } + +inline OMX_BUFFERHEADERTYPE*& +COmxILPort::operator[](TInt anIndex) + { + __ASSERT_ALWAYS((anIndex>=0 && anIndex +inline OMX_ERRORTYPE +COmxILPort::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 +COmxILPort::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 +COmxILPort::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 +COmxILPort::TBufferMarkInfoQue::TBufferMarkInfoQue(TInt aOffset) + : + Tq(aOffset), + iNumElements(0) + { + } + +inline COmxILPort::TBufferMarkInfo* +COmxILPort::TBufferMarkInfoQue::First() const + { + return Tq::First(); + } + +inline void +COmxILPort::TBufferMarkInfoQue::AddLast(COmxILPort::TBufferMarkInfo& aRef) + { + Tq::AddLast(aRef); + ++iNumElements; + } + +inline void +COmxILPort::TBufferMarkInfoQue::Remove(COmxILPort::TBufferMarkInfo& aRef) + { + Tq::Remove(aRef); + --iNumElements; + } + +inline TInt +COmxILPort::TBufferMarkInfoQue::Elements() const + { + return iNumElements; + } + +inline void +COmxILPort::TBufferMarkInfoQue::ResetAndDestroy() + { + while (!Tq::IsEmpty()) + { + COmxILPort::TBufferMarkInfo* pMark = Tq::First(); + __ASSERT_DEBUG(pMark, User::Panic(KOmxILPortPanicCategory, 1)); + Tq::Remove(*pMark); + delete pMark; + } + iNumElements = 0; + } + + +inline +COmxILPort::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 +COmxILPort::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* +COmxILPort::TBufferInfo::GetHeader() const + { + return ipHeader; + } + +inline OMX_BUFFERHEADERTYPE* +COmxILPort::TBufferInfo::GetHeader() + { + return ipHeader; + } + +inline +COmxILPort::TBufferInfo::operator OMX_BUFFERHEADERTYPE*&() + { + return ipHeader; + } + +inline +COmxILPort::TBufferInfo::operator OMX_BUFFERHEADERTYPE* const&() const + { + return ipHeader; + } + +inline OMX_U8* +COmxILPort::TBufferInfo::GetBufferPointer() const + { + return ipBuffer; + } + +inline OMX_U8* +COmxILPort::TBufferInfo::GetBufferPointer() + { + return ipBuffer; + } + +inline OMX_PTR +COmxILPort::TBufferInfo::GetPortPointer() const + { + return ipPort; + } + +inline OMX_PTR +COmxILPort::TBufferInfo::GetPortPointer() + { + return ipPort; + } + +inline OMX_PTR +COmxILPort::TBufferInfo::GetPlatformPointer() const + { + return ipPlatform; + } + +inline OMX_PTR +COmxILPort::TBufferInfo::GetPlatformPointer() + { + return ipPlatform; + } + +inline OMX_PTR +COmxILPort::TBufferInfo::GetAppPointer() const + { + return ipApp; + } + +inline OMX_PTR +COmxILPort::TBufferInfo::GetAppPointer() + { + return ipApp; + } + +inline void +COmxILPort::TBufferInfo::SetBufferAtHome() + { + iBufferProperties |= EBufferAtHome; + } + +inline void +COmxILPort::TBufferInfo::SetBufferAway() + { + iBufferProperties &= EBufferAwayMask; + } + +inline void +COmxILPort::TBufferInfo::SetBufferOwned() + { + iBufferProperties |= EBufferOwned; + } + +inline void +COmxILPort::TBufferInfo::SetBufferNotOwned() + { + iBufferProperties &= EBufferNotOwnedMask; + } + +inline TBool +COmxILPort::TBufferInfo::IsBufferAtHome() const + { + return ((iBufferProperties & EBufferAtHome) != 0x0 ? ETrue : EFalse); + } + +inline TBool +COmxILPort::TBufferInfo::IsBufferOwned() const + { + return ((iBufferProperties & EBufferOwned) != 0x0 ? ETrue : EFalse); + } + + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilportmanager.cpp --- a/omxil/omxilcomponentcommon/src/common/omxilportmanager.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilportmanager.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,1953 +1,1993 @@ -// 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 "omxilprocessingfunction.h" -#include "omxilcallbackmanager.h" -#include "omxilutil.h" - -EXPORT_C 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, - aOmxVersion, - aNumberOfAudioPorts, - aStartAudioPortNumber, - aNumberOfImagePorts, - aStartImagePortNumber, - aNumberOfVideoPorts, - aStartVideoPortNumber, - aNumberOfOtherPorts, - aStartOtherPortNumber, - aImmediateReturnTimeBuffer); - - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } - -void -COmxILPortManager::ConstructL() - { - DEBUG_PRINTF(_L8("COmxILPortManager::ConstructL")); - - 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, - 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) - : - iProcessingFunction(aProcessingFunction), - iCallbacks(aCallbacks), - iAllPorts(), - iImmediateReturnTimeBuffer(aImmediateReturnTimeBuffer) - { - DEBUG_PRINTF(_L8("COmxILPortManager::COmxILPortManager")); - - 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; - - } - -COmxILPortManager::~COmxILPortManager() - { - DEBUG_PRINTF(_L8("COmxILPortManager::~COmxILPortManager")); - iAllPorts.Reset(); // data not owned here - 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; iIndex() >= aPort->Index()) - { - User::Panic(KOmxILPortManagerPanicCategory, 1); - } - } - iAllPorts.AppendL(aPort); - } - - iTimePorts.AppendL(timePort); - } - -/** - 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. -*/ -EXPORT_C 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; - } - - TRAPD(err, AppendPortL(aPort)); - if (KErrNone != err) - { - return err; - } - - 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; - } - } - - // 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) - { - 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; jIsBufferAtHome(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(apComponentParameterStructure), - sizeof(OMX_PORT_PARAM_TYPE)))) - { - return omxRetValue; - } - - OMX_PORT_PARAM_TYPE* - pPortParamType - = static_cast( - 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; - } - - // 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")); - - 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; - } - - 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]; - - 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; - } - - // 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_PRINTF2(_L8("COmxILPortManager::FreeBuffer : BUFFER [%X]"), 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; iIsEnabled() && 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 */) - { - 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() && 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; jIsBufferAtHome(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; jIsEnabled() && 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 */) - { - DEBUG_PRINTF2(_L8("COmxILPortManager::BufferIndication : BUFFER [%X]"), apBufferHeader); - - OMX_U32 portIndex = aDirection == OMX_DirInput ? - apBufferHeader->nInputPortIndex : apBufferHeader->nOutputPortIndex; - - // 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() && - !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; - } - - 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->IsTransitioningToDisabled()) - - - // 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(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) - { - DEBUG_PRINTF2(_L8("COmxILPortManager::BufferReturnIndication : [%X]"), apBufferHeader); - - aAllBuffersReturned = EFalse; - - OMX_U32 portIndex = aDirection == OMX_DirInput ? - apBufferHeader->nInputPortIndex : apBufferHeader->nOutputPortIndex; - - // 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[%d]"), aPortIndex); - - // Check the index of the port.. - if ((OMX_ALL != aPortIndex) && (CheckPortIndex(aPortIndex) != OMX_ErrorNone)) - { - return OMX_ErrorBadPortIndex; - } - - OMX_ERRORTYPE omxRetValue = OMX_ErrorNone; - RPointerArray portsToFlush; - RPointerArray 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 (pPort->IsTunnelledAndBufferSupplier() && - !pPort->HasAllBuffersAtHome()) - { - // 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... - if ((omxRetValue = InitiateTunnellingDataFlow()) - != OMX_ErrorNone) - { - // The flush has failed, we need to notify the IL Cient - // via EventHandler... - iCallbacks.ErrorEventNotification(omxRetValue); - flushSuccessful = EFalse; - } - } - - } - else - { - 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; iIndex(), - pPort->Direction()); - } - } - - for (i=0; iIndex()); - } - - 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; iIsEnabled() && 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; - } - continue; - } - - if (OMX_ErrorNone != - (omxRetValue = iProcessingFunction.BufferFlushingIndication( - pPort->Index(), - pPort->Direction()))) - { - return omxRetValue; - } - } - } - - if (!foundBufferSupplierThatNeedsToWait) - { - aAllBuffersReturnedToSuppliers = ETrue; - } - - return OMX_ErrorNone; - - } - -OMX_ERRORTYPE -COmxILPortManager::PortEnableIndication( - TUint32 aPortIndex, - TBool aIndicationIsFinal) - { - DEBUG_PRINTF3(_L8("COmxILPortManager::PortEnableIndication: PORT[%d] 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[%d] "), 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... - } - 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) - { - if (OMX_ErrorNone != - (omxRetValue = - iProcessingFunction.BufferFlushingIndication( - portIndex, - pPort->Direction()))) - { - return omxRetValue; - } - - // 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[%d] "), aPortIndex); - - // Check the index of the port.. - if (CheckPortIndex(aPortIndex) != OMX_ErrorNone) - { - return OMX_ErrorBadPortIndex; - } - - const OMX_MARKTYPE* pMark = static_cast(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); - - } - -OMX_ERRORTYPE -COmxILPortManager::ComponentRoleIndication(TUint aComponentRoleIndex) - { - DEBUG_PRINTF2(_L8("COmxILPortManager::ComponentRoleIndication : aComponentRoleIndex[%d]"), 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[%d] "), 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; iIsEnabled()) - { - 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; iIsDePopulated()) - { - 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; iIsTunnelledAndBufferSupplier()) - { - if (!iAllPorts[i]->HasAllBuffersAtHome()) - { - DEBUG_PRINTF(_L8("COmxILPortManager::AllBuffersAtHome : [FALSE]")); - return EFalse; - } - } - } - - DEBUG_PRINTF(_L8("COmxILPortManager::AllBuffersAtHome : [TRUE]")); - return ETrue; - - } +// 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 "omxilprocessingfunction.h" +#include "omxilcallbackmanager.h" +#include "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. + */ +EXPORT_C 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.Reset(); // data not owned here + 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; iIndex() >= aPort->Index()) + { + User::Panic(KOmxILPortManagerPanicCategory, 1); + } + } + iAllPorts.AppendL(aPort); + } + + iTimePorts.AppendL(timePort); + } + +/** + 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. +*/ +EXPORT_C 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; + } + + TRAPD(err, AppendPortL(aPort)); + if (KErrNone != err) + { + return err; + } + + 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; + } + } + + // 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) + { + 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; jIsBufferAtHome(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(apComponentParameterStructure), + sizeof(OMX_PORT_PARAM_TYPE)))) + { + return omxRetValue; + } + + OMX_PORT_PARAM_TYPE* + pPortParamType + = static_cast( + 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")); + + 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]; + + 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; + } + + // 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; iIsEnabled() && 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; jIsBufferAtHome(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; jIsEnabled() && 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; + } + + 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()) + + // 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(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 portsToFlush; + RPointerArray 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; iIndex(), + pPort->Direction()); + } + } + + for (i=0; iIndex()); + } + + 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; iCount()) + { + 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; + } + continue; + } + if (OMX_ErrorNone != + (omxRetValue = iProcessingFunction.BufferFlushingIndication( + pPort->Index(), + pPort->Direction()))) + { + return omxRetValue; + } + } + } + + 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... + } + 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) + { + if (OMX_ErrorNone != + (omxRetValue = + iProcessingFunction.BufferFlushingIndication( + portIndex, + pPort->Direction()))) + { + return omxRetValue; + } + + // 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(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); + + } + +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; iIsEnabled()) + { + 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; iIsDePopulated()) + { + 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; iIsTunnelledAndBufferSupplier()) + { + if (!iAllPorts[i]->HasAllBuffersAtHome()) + { + DEBUG_PRINTF(_L8("COmxILPortManager::AllBuffersAtHome : [FALSE]")); + return EFalse; + } + } + } + + DEBUG_PRINTF(_L8("COmxILPortManager::AllBuffersAtHome : [TRUE]")); + return ETrue; + + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilportmanager.h --- a/omxil/omxilcomponentcommon/src/common/omxilportmanager.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilportmanager.h Fri May 07 16:25:23 2010 +0100 @@ -1,218 +1,216 @@ -// 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 - -#include "omxilport.h" -#include "omxilindexmanager.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: - /* - @param aImmediateReturnTimeBuffer Indicates whether the component needs to - return the arriving buffer to the sender immediately or not . This is particularly - related to time port (e.g. COmxILClientClockPort), where notification - could be requested on every frame. Returning the buffer immediately to the - the sender (e.g. Clock Component) would avoid the sender from buffer starvation. - By default, time related component will need to return the buffer sooner, except - Clock Component (the buffer sender) - */ - IMPORT_C 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(); - - IMPORT_C 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_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); - - 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, - 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); - - void ConstructL(); - - void AppendPortL(const COmxILPort* aPort); - - 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 iAllPorts; - RArray 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 +// 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 + +#include "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: + + IMPORT_C 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(); + + IMPORT_C 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); + + 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); + + 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 iAllPorts; + RArray 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 diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilportmanager.inl --- a/omxil/omxilcomponentcommon/src/common/omxilportmanager.inl Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilportmanager.inl Fri May 07 16:25:23 2010 +0100 @@ -1,76 +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(apComponentParameterStructure), aIndex); - } - - -inline OMX_ERRORTYPE -COmxILPortManager::GetPortIndexFromOmxStruct( - const TAny*& apComponentParameterStructure, - OMX_U32& aIndex) const - { - OMX_U32* const pPortIndex = - reinterpret_cast( - const_cast(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; - - } - +// 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(apComponentParameterStructure), aIndex); + } + + +inline OMX_ERRORTYPE +COmxILPortManager::GetPortIndexFromOmxStruct( + const TAny*& apComponentParameterStructure, + OMX_U32& aIndex) const + { + OMX_U32* const pPortIndex = + reinterpret_cast( + const_cast(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; + + } + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilportmanagerif.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/omxilcomponentcommon/src/common/omxilportmanagerif.h Fri May 07 16:25:23 2010 +0100 @@ -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 + +// 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 diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilportmanagerif.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/omxilcomponentcommon/src/common/omxilportmanagerif.inl Fri May 07 16:25:23 2010 +0100 @@ -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() + { + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilprocessingfunction.cpp --- a/omxil/omxilcomponentcommon/src/common/omxilprocessingfunction.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilprocessingfunction.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,66 +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 - @internalComponent -*/ - -#include "log.h" -#include "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; - } +// 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 "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; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilprocessingfunction.h --- a/omxil/omxilcomponentcommon/src/common/omxilprocessingfunction.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilprocessingfunction.h Fri May 07 16:25:23 2010 +0100 @@ -1,177 +1,177 @@ -// 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 - -#include -#include -#include - -#include "omxilfsm.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( - COmxILFsm::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); - -protected: - - MOmxILCallbackNotificationIf& iCallbacks; - - }; - -#endif // OMXILPROCESSINGFUNCTION_H +// 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 + +#include +#include +#include + +#include "omxilfsm.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( + COmxILFsm::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); + +protected: + + MOmxILCallbackNotificationIf& iCallbacks; + + }; + +#endif // OMXILPROCESSINGFUNCTION_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilspecversion.cpp --- a/omxil/omxilcomponentcommon/src/common/omxilspecversion.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilspecversion.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,27 +1,27 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// - - -/** - @file - @internalComponent -*/ - -#include "omxilspecversion.h" - -const TUint8 TOmxILSpecVersion::KSpecVersionMajor; -const TUint8 TOmxILSpecVersion::KSpecVersionMinor; -const TUint8 TOmxILSpecVersion::KSpecVersionRevision; -const TUint8 TOmxILSpecVersion::KSpecVersionStep; +// 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 "omxilspecversion.h" + +const TUint8 TOmxILSpecVersion::KSpecVersionMajor; +const TUint8 TOmxILSpecVersion::KSpecVersionMinor; +const TUint8 TOmxILSpecVersion::KSpecVersionRevision; +const TUint8 TOmxILSpecVersion::KSpecVersionStep; diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilspecversion.h --- a/omxil/omxilcomponentcommon/src/common/omxilspecversion.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilspecversion.h Fri May 07 16:25:23 2010 +0100 @@ -1,123 +1,123 @@ -// 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 -#include - -#include - -class TOmxILVersion - { - -public: - - inline TOmxILVersion(TUint8 aMajor, - TUint8 aMinor, - TUint8 aRev, - TUint8 aStep); - - - inline operator OMX_VERSIONTYPE&(); - -#ifdef _OMXIL_COMMON_SPEC_VERSION_CHECKS_ON - inline TBool operator!=(const OMX_VERSIONTYPE& aVer) const; - - inline 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: - - inline TOmxILSpecVersion(); - - }; - -inline -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; - } - -inline -TOmxILVersion::operator OMX_VERSIONTYPE&() - { - return iSpecVersion; - } - -#ifdef _OMXIL_COMMON_SPEC_VERSION_CHECKS_ON -inline TBool -TOmxILVersion::operator!=( - const OMX_VERSIONTYPE& aVer) const - { - return !operator==(aVer); - } - -inline 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 - -inline -TOmxILSpecVersion::TOmxILSpecVersion() - : - TOmxILVersion(KSpecVersionMajor, - KSpecVersionMinor, - KSpecVersionRevision, - KSpecVersionStep) - { - } - -#endif // OMXILSPECVERSION_H - +// 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 +#include + +#include + +class TOmxILVersion + { + +public: + + inline TOmxILVersion(TUint8 aMajor, + TUint8 aMinor, + TUint8 aRev, + TUint8 aStep); + + + inline operator OMX_VERSIONTYPE&(); + +#ifdef _OMXIL_COMMON_SPEC_VERSION_CHECKS_ON + inline TBool operator!=(const OMX_VERSIONTYPE& aVer) const; + + inline 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: + + inline TOmxILSpecVersion(); + + }; + +inline +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; + } + +inline +TOmxILVersion::operator OMX_VERSIONTYPE&() + { + return iSpecVersion; + } + +#ifdef _OMXIL_COMMON_SPEC_VERSION_CHECKS_ON +inline TBool +TOmxILVersion::operator!=( + const OMX_VERSIONTYPE& aVer) const + { + return !operator==(aVer); + } + +inline 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 + +inline +TOmxILSpecVersion::TOmxILSpecVersion() + : + TOmxILVersion(KSpecVersionMajor, + KSpecVersionMinor, + KSpecVersionRevision, + KSpecVersionStep) + { + } + +#endif // OMXILSPECVERSION_H + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilstate.cpp --- a/omxil/omxilcomponentcommon/src/common/omxilstate.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilstate.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,1964 +1,1937 @@ -// 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 "omxilcommand.h" -#include "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")); - - // 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); - - } - - -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")); - - return COmxILState::EmptyThisBuffer(aFsm, - apBuffer); - - } - -OMX_ERRORTYPE -COmxILFsm::COmxILStateLoaded::FillThisBuffer(COmxILFsm& aFsm, - OMX_BUFFERHEADERTYPE* apBuffer) - { - DEBUG_PRINTF(_L8("COmxILStateLoaded::FillThisBuffer")); - - 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. - COmxILFsm::TStateIndex nextState = COmxILFsm::EStateMax; - switch(aCommand.iParam1) - { - case OMX_StateIdle: - { - nextState = COmxILFsm::ESubStateLoadedToIdle; - } - break; - case OMX_StateWaitForResources: - { - nextState = COmxILFsm::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 (COmxILFsm::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(COmxILFsm::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::SetParameter( - COmxILFsm& aFsm, - OMX_INDEXTYPE aParamIndex, - const TAny* apComponentParameterStructure) - { - - // In this transitional state, OMX_SetParameter is allowed only if - // OMX_UseBuffer has not been received yet... - if (iUseBufferReceived) - { - return OMX_ErrorIncorrectStateOperation; - } - - - return COmxILStateLoaded::SetParameter(aFsm, - aParamIndex, - apComponentParameterStructure); - - } - -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) - { - // Flag that OMX_UseBuffer has been called in LoadedToIdle state. This - // will be used to know if an OMX_SetParameter call will be allowed in - // this state... It will be allowed only if false... - iUseBufferReceived = ETrue; - } - - 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(COmxILFsm::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")); - - return COmxILState::EmptyThisBuffer(aFsm, - apBuffer); - - - } - -OMX_ERRORTYPE -COmxILFsm::COmxILStateWaitForResources::FillThisBuffer( - COmxILFsm& aFsm, - OMX_BUFFERHEADERTYPE* apBuffer) - { - DEBUG_PRINTF(_L8("COmxILStateWaitForResources::FillThisBuffer")); - - 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... - COmxILFsm::TStateIndex nextState = COmxILFsm::EStateMax; - switch(aCommand.iParam1) - { - case OMX_StateLoaded: - { - nextState = COmxILFsm::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)); - - COmxILFsm::TStateIndex nextState = COmxILFsm::EStateInvalid; - switch(aCommand.iParam1) - { - case OMX_StateLoaded: - { - nextState = COmxILFsm::ESubStateIdleToLoaded; - } - break; - case OMX_StateExecuting: - { - nextState = COmxILFsm::EStateExecuting; - } - break; - case OMX_StatePause: - { - nextState = COmxILFsm::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 (COmxILFsm::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(COmxILFsm::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(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)); - - COmxILFsm::TStateIndex nextState = COmxILFsm::EStateMax; - switch(aCommand.iParam1) - { - case OMX_StateIdle: - { - nextState = COmxILFsm::ESubStateExecutingToIdle; - } - break; - case OMX_StatePause: - { - nextState = COmxILFsm::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 (COmxILFsm::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(COmxILFsm::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(COmxILFsm::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)); - - COmxILFsm::TStateIndex nextState = COmxILFsm::EStateInvalid; - switch(aCommand.iParam1) - { - case OMX_StateIdle: - { - nextState = COmxILFsm::ESubStatePauseToIdle; - } - break; - case OMX_StateExecuting: - { - nextState = COmxILFsm::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 (COmxILFsm::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(COmxILFsm::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; - } - }; - - } - - +// 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 "omxilcommand.h" +#include "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")); + + // 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); + } + + +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")); + + return COmxILState::EmptyThisBuffer(aFsm, + apBuffer); + + } + +OMX_ERRORTYPE +COmxILFsm::COmxILStateLoaded::FillThisBuffer(COmxILFsm& aFsm, + OMX_BUFFERHEADERTYPE* apBuffer) + { + DEBUG_PRINTF(_L8("COmxILStateLoaded::FillThisBuffer")); + + 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. + COmxILFsm::TStateIndex nextState = COmxILFsm::EStateMax; + switch(aCommand.iParam1) + { + case OMX_StateIdle: + { + nextState = COmxILFsm::ESubStateLoadedToIdle; + } + break; + case OMX_StateWaitForResources: + { + nextState = COmxILFsm::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 (COmxILFsm::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(COmxILFsm::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(COmxILFsm::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")); + + return COmxILState::EmptyThisBuffer(aFsm, + apBuffer); + + + } + +OMX_ERRORTYPE +COmxILFsm::COmxILStateWaitForResources::FillThisBuffer( + COmxILFsm& aFsm, + OMX_BUFFERHEADERTYPE* apBuffer) + { + DEBUG_PRINTF(_L8("COmxILStateWaitForResources::FillThisBuffer")); + + 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... + COmxILFsm::TStateIndex nextState = COmxILFsm::EStateMax; + switch(aCommand.iParam1) + { + case OMX_StateLoaded: + { + nextState = COmxILFsm::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)); + + COmxILFsm::TStateIndex nextState = COmxILFsm::EStateInvalid; + switch(aCommand.iParam1) + { + case OMX_StateLoaded: + { + nextState = COmxILFsm::ESubStateIdleToLoaded; + } + break; + case OMX_StateExecuting: + { + nextState = COmxILFsm::EStateExecuting; + } + break; + case OMX_StatePause: + { + nextState = COmxILFsm::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 (COmxILFsm::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(COmxILFsm::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(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)); + + COmxILFsm::TStateIndex nextState = COmxILFsm::EStateMax; + switch(aCommand.iParam1) + { + case OMX_StateIdle: + { + nextState = COmxILFsm::ESubStateExecutingToIdle; + } + break; + case OMX_StatePause: + { + nextState = COmxILFsm::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 (COmxILFsm::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(COmxILFsm::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(COmxILFsm::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)); + + COmxILFsm::TStateIndex nextState = COmxILFsm::EStateInvalid; + switch(aCommand.iParam1) + { + case OMX_StateIdle: + { + nextState = COmxILFsm::ESubStatePauseToIdle; + } + break; + case OMX_StateExecuting: + { + nextState = COmxILFsm::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 (COmxILFsm::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(COmxILFsm::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; + } + }; + + } + + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilstate.h --- a/omxil/omxilcomponentcommon/src/common/omxilstate.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilstate.h Fri May 07 16:25:23 2010 +0100 @@ -1,756 +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 -#include - -#include "omxilfsm.h" -#include "omxilportmanager.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 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 CommandStateSet( - COmxILFsm& aFsm, - const TOmxILCommand& aCommand); - - OMX_ERRORTYPE CommandPortEnable( - COmxILFsm& aFsm, - const TOmxILCommand& aCommand); - -private: - - TBool iUseBufferReceived; - - }; - -/** - 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 - - +// 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 +#include + +#include "omxilfsm.h" +#include "omxilportmanager.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 + + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilstate.inl --- a/omxil/omxilcomponentcommon/src/common/omxilstate.inl Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilstate.inl Fri May 07 16:25:23 2010 +0100 @@ -1,213 +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 - ); - } - +// 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 + ); + } + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilutil.cpp --- a/omxil/omxilcomponentcommon/src/common/omxilutil.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilutil.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,109 +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 "omxilutil.h" -#include "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(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( - 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; - - } +// 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 "omxilutil.h" +#include "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(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( + 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; + + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilutil.h --- a/omxil/omxilcomponentcommon/src/common/omxilutil.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilutil.h Fri May 07 16:25:23 2010 +0100 @@ -1,47 +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 - -#include -#include - - -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 - - +// 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 + +#include +#include + + +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 + + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilvideoport.cpp --- a/omxil/omxilcomponentcommon/src/common/omxilvideoport.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilvideoport.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,219 +1,218 @@ -// 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 "omxilvideoport.h" -#include "omxilutil.h" -#include "log.h" - -EXPORT_C -COmxILVideoPort::COmxILVideoPort( - const TOmxILCommonPortData& aCommonPortData, - const RArray& aSupportedVideoFormats, - const RArray& aSupportedColorFormats) -: -COmxILPort(aCommonPortData) - { - DEBUG_PRINTF(_L8("COmxILVideoPort::COmxILVideoPort")); - - // Performing a deep copy of these arrays inside a C++ constructor is unsafe. - // Items should be added to these arrays directly inside the derived class' ConstructL(). - __ASSERT_ALWAYS(aSupportedVideoFormats.Count() == 0 && aSupportedColorFormats.Count() == 0, User::Invariant()); - 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???; - - } - -EXPORT_C -COmxILVideoPort::~COmxILVideoPort() - { - DEBUG_PRINTF(_L8("COmxILVideoPort::~COmxILVideoPort")); - iSupportedVideoFormats.Close(); - iSupportedColorFormats.Close(); - } - -EXPORT_C OMX_ERRORTYPE -COmxILVideoPort::GetLocalOmxParamIndexes(RArray& 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& 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: - { - if (OMX_ErrorNone != (omxRetValue = - TOmxILUtil::CheckOmxStructSizeAndVersion( - const_cast(apComponentParameterStructure), - sizeof(OMX_VIDEO_PARAM_PORTFORMATTYPE)))) - { - return omxRetValue; - } - - OMX_VIDEO_PARAM_PORTFORMATTYPE* videoPortDefinition = static_cast(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: - { - // Try the parent's indexes - return COmxILPort::GetParameter(aParamIndex, apComponentParameterStructure); - } - }; - - return OMX_ErrorNone; - } - -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: - { - if (OMX_ErrorNone != (omxRetValue = - TOmxILUtil::CheckOmxStructSizeAndVersion( - const_cast(apComponentParameterStructure), - sizeof(OMX_VIDEO_PARAM_PORTFORMATTYPE)))) - { - return omxRetValue; - } - - const OMX_VIDEO_PARAM_PORTFORMATTYPE *componentParameterStructure = static_cast(apComponentParameterStructure); - - if(OMX_VIDEO_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(iParamVideoPortFormat.eColorFormat != componentParameterStructure->eColorFormat) - { - if(KErrNotFound == iSupportedColorFormats.Find(componentParameterStructure->eColorFormat)) - { - return OMX_ErrorUnsupportedSetting; - } - else - { - iParamVideoPortFormat.eColorFormat = componentParameterStructure->eColorFormat; - } - aUpdateProcessingFunction = ETrue; - } - - if(iParamVideoPortFormat.xFramerate != componentParameterStructure->xFramerate) - { - iParamVideoPortFormat.xFramerate = componentParameterStructure->xFramerate; - 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 (iParamVideoPortFormat.eCompressionFormat != componentParameterStructure->eCompressionFormat) - { - if(KErrNotFound == iSupportedVideoFormats.Find(componentParameterStructure->eCompressionFormat)) - { - return OMX_ErrorUnsupportedSetting; - } - else - { - iParamVideoPortFormat.eCompressionFormat = componentParameterStructure->eCompressionFormat; - aUpdateProcessingFunction = ETrue; - } - } - } - break; - } - default: - { - // Try the parent's indexes - return COmxILPort::SetParameter(aParamIndex, apComponentParameterStructure, aUpdateProcessingFunction); - } - }; - return OMX_ErrorNone; - } +// 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 "omxilvideoport.h" +#include "omxilutil.h" +#include "log.h" + +EXPORT_C +COmxILVideoPort::COmxILVideoPort( + const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedVideoFormats, + const RArray& aSupportedColorFormats) +: +COmxILPort(aCommonPortData) + { + DEBUG_PRINTF(_L8("COmxILVideoPort::COmxILVideoPort")); + + // Performing a deep copy of these arrays inside a C++ constructor is unsafe. + // Items should be added to these arrays directly inside the derived class' ConstructL(). + __ASSERT_ALWAYS(aSupportedVideoFormats.Count() == 0 && aSupportedColorFormats.Count() == 0, User::Invariant()); + 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???; + + } + +EXPORT_C +COmxILVideoPort::~COmxILVideoPort() + { + DEBUG_PRINTF(_L8("COmxILVideoPort::~COmxILVideoPort")); + iSupportedVideoFormats.Close(); + iSupportedColorFormats.Close(); + } + +EXPORT_C OMX_ERRORTYPE +COmxILVideoPort::GetLocalOmxParamIndexes(RArray& 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& 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: + { + if (OMX_ErrorNone != (omxRetValue = + TOmxILUtil::CheckOmxStructSizeAndVersion( + const_cast(apComponentParameterStructure), + sizeof(OMX_VIDEO_PARAM_PORTFORMATTYPE)))) + { + return omxRetValue; + } + + OMX_VIDEO_PARAM_PORTFORMATTYPE* videoPortDefinition = static_cast(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: + { + // Try the parent's indexes + return COmxILPort::GetParameter(aParamIndex, apComponentParameterStructure); + } + }; + + return OMX_ErrorNone; + } + +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: + { + if (OMX_ErrorNone != (omxRetValue = + TOmxILUtil::CheckOmxStructSizeAndVersion( + const_cast(apComponentParameterStructure), + sizeof(OMX_VIDEO_PARAM_PORTFORMATTYPE)))) + { + return omxRetValue; + } + + const OMX_VIDEO_PARAM_PORTFORMATTYPE *componentParameterStructure = static_cast(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: + { + // Try the parent's indexes + return COmxILPort::SetParameter(aParamIndex, apComponentParameterStructure, aUpdateProcessingFunction); + } + }; + return OMX_ErrorNone; + } + +EXPORT_C TBool COmxILVideoPort::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; + } + +EXPORT_C TBool COmxILVideoPort::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; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/omxilvideoport.h --- a/omxil/omxilcomponentcommon/src/common/omxilvideoport.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/omxilvideoport.h Fri May 07 16:25:23 2010 +0100 @@ -1,77 +1,80 @@ -// 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 - -#include -#include -#include - -#include "omxilport.h" - -class COmxILVideoPort : public COmxILPort - { - -public: - - IMPORT_C ~COmxILVideoPort(); - - // From COmxILPort - IMPORT_C OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray& aIndexArray) const = 0; - - // From COmxILPort - IMPORT_C OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray& 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; - -protected: - - IMPORT_C COmxILVideoPort(const TOmxILCommonPortData& aCommonPortData, - const RArray& aSupportedVideoFormats, - const RArray& aSupportedColorFormats); - - // From COmxILPort - IMPORT_C OMX_ERRORTYPE SetFormatInPortDefinition( - const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, - TBool& aUpdateProcessingFunction) = 0; - - // From COmxILPort - IMPORT_C TBool IsTunnelledPortCompatible( - const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const = 0; - -protected: - - RArray iSupportedVideoFormats; - RArray iSupportedColorFormats; - RArray iSupportedFrameRates; - OMX_VIDEO_PARAM_PORTFORMATTYPE iParamVideoPortFormat; - }; - -#endif // OMXILVIDEOPORT_H +// 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 + +#include +#include +#include + +#include "omxilport.h" + +class COmxILVideoPort : public COmxILPort + { + +public: + + IMPORT_C ~COmxILVideoPort(); + + // From COmxILPort + IMPORT_C OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray& aIndexArray) const = 0; + + // From COmxILPort + IMPORT_C OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray& 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; + +protected: + + IMPORT_C COmxILVideoPort(const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedVideoFormats, + const RArray& aSupportedColorFormats); + + // From COmxILPort + IMPORT_C OMX_ERRORTYPE SetFormatInPortDefinition( + const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, + TBool& aUpdateProcessingFunction) = 0; + + // From COmxILPort + IMPORT_C 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); + +protected: + + RArray iSupportedVideoFormats; + RArray iSupportedColorFormats; + RArray iSupportedFrameRates; + OMX_VIDEO_PARAM_PORTFORMATTYPE iParamVideoPortFormat; + }; + +#endif // OMXILVIDEOPORT_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/primsgqueue.h --- a/omxil/omxilcomponentcommon/src/common/primsgqueue.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/primsgqueue.h Fri May 07 16:25:23 2010 +0100 @@ -1,87 +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 -#include - -/** - 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 -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 iFrontQueue; - - }; - -#include "primsgqueue.inl" - -#endif // PRIMSGQUEUE_H +// 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 +#include + +/** + 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 +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 iFrontQueue; + + }; + +#include "primsgqueue.inl" + +#endif // PRIMSGQUEUE_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcomponentcommon/src/common/primsgqueue.inl --- a/omxil/omxilcomponentcommon/src/common/primsgqueue.inl Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcomponentcommon/src/common/primsgqueue.inl Fri May 07 16:25:23 2010 +0100 @@ -1,156 +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 -inline RPriMsgQueue::TFrontQueueElement::TFrontQueueElement( - const TAny* apInfo) - : - ipInfo(apInfo) - { - iLink.iPriority = 0; - } - -template -inline RPriMsgQueue::TFrontQueueElement::TFrontQueueElement( - const TAny* apInfo, TInt aPriority) - : - ipInfo(apInfo) - { - iLink.iPriority = aPriority; - } - -template -inline TInt RPriMsgQueue::CreateLocal(TInt aSize, TOwnerType aOwner) - { - iFrontQueue.SetOffset(_FOFF(TFrontQueueElement, iLink)); - return iBackQueue.CreateLocal(aSize, sizeof(T), aOwner); - } - -template -inline TInt RPriMsgQueue::Handle() const - { - return iBackQueue.Handle(); - } - -template -inline TInt RPriMsgQueue::Send(const T& aMsg) - { - ASSERT(aMsg); - return iBackQueue.Send(&aMsg, sizeof(T)); - } - -template -inline TInt RPriMsgQueue::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(const_cast(pElement->ipInfo)); - delete pElement; - } - - return err; - - } - -template -inline void RPriMsgQueue::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(const_cast(pFQElement->ipInfo)); - delete pElement; - delete pFQElement; - } - - } - -template -inline void RPriMsgQueue::NotifyDataAvailable(TRequestStatus& aStatus) - { - iBackQueue.NotifyDataAvailable(aStatus); - } - -template -inline void RPriMsgQueue::CancelDataAvailable() - { - iBackQueue.CancelDataAvailable(); - } - -template -TInt RPriMsgQueue::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; - - } +// 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 +inline RPriMsgQueue::TFrontQueueElement::TFrontQueueElement( + const TAny* apInfo) + : + ipInfo(apInfo) + { + iLink.iPriority = 0; + } + +template +inline RPriMsgQueue::TFrontQueueElement::TFrontQueueElement( + const TAny* apInfo, TInt aPriority) + : + ipInfo(apInfo) + { + iLink.iPriority = aPriority; + } + +template +inline TInt RPriMsgQueue::CreateLocal(TInt aSize, TOwnerType aOwner) + { + iFrontQueue.SetOffset(_FOFF(TFrontQueueElement, iLink)); + return iBackQueue.CreateLocal(aSize, sizeof(T), aOwner); + } + +template +inline TInt RPriMsgQueue::Handle() const + { + return iBackQueue.Handle(); + } + +template +inline TInt RPriMsgQueue::Send(const T& aMsg) + { + ASSERT(aMsg); + return iBackQueue.Send(&aMsg, sizeof(T)); + } + +template +inline TInt RPriMsgQueue::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(const_cast(pElement->ipInfo)); + delete pElement; + } + + return err; + + } + +template +inline void RPriMsgQueue::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(const_cast(pFQElement->ipInfo)); + delete pElement; + delete pFQElement; + } + + } + +template +inline void RPriMsgQueue::NotifyDataAvailable(TRequestStatus& aStatus) + { + iBackQueue.NotifyDataAvailable(aStatus); + } + +template +inline void RPriMsgQueue::CancelDataAvailable() + { + iBackQueue.CancelDataAvailable(); + } + +template +TInt RPriMsgQueue::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; + + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/bwins/omxilcoreclient.def --- a/omxil/omxilcore/bwins/omxilcoreclient.def Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/bwins/omxilcoreclient.def Fri May 07 16:25:23 2010 +0100 @@ -1,11 +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 - +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 + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/bwins/omxilcoreserver.def --- a/omxil/omxilcore/bwins/omxilcoreserver.def Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/bwins/omxilcoreserver.def Fri May 07 16:25:23 2010 +0100 @@ -1,11 +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 *) - +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 *) + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/eabi/omxilcoreclient.def --- a/omxil/omxilcore/eabi/omxilcoreclient.def Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/eabi/omxilcoreclient.def Fri May 07 16:25:23 2010 +0100 @@ -1,11 +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 - +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 + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/eabi/omxilcoreserver.def --- a/omxil/omxilcore/eabi/omxilcoreserver.def Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/eabi/omxilcoreserver.def Fri May 07 16:25:23 2010 +0100 @@ -1,11 +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 - +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 + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/group/bld.inf --- a/omxil/omxilcore/group/bld.inf Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/group/bld.inf Fri May 07 16:25:23 2010 +0100 @@ -1,54 +1,56 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// - - -PRJ_MMPFILES -// Core and Loader -../mmpfiles/omxilsymbianloaderif.mmp -../mmpfiles/omxilsymbianloader.mmp -../mmpfiles/omxilcomponentif.mmp -../mmpfiles/omxilsymbiancontentpipeif.mmp -../mmpfiles/omxilcoreserver.mmp -../mmpfiles/omxilcoreclient.mmp - - - - -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/loader/OMX_Loader.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/loader/OMX_Loader.h) - -../inc/core/omxilloaderif.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/core/omxilloaderif.h) -../inc/core/omxilloaderif.hrh /epoc32/include/openmax/il/core/omxilloaderif.hrh -../inc/core/omxilloaderif.inl SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/core/omxilloaderif.inl) -../inc/core/omxilsymbianloaderif.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/core/omxilsymbianloaderif.h) - -// OMX IL Component Interface -../inc/loader/omxilcomponentif.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/loader/omxilcomponentif.h) -../inc/loader/omxilcomponentif.hrh /epoc32/include/openmax/il/loader/omxilcomponentif.hrh -../inc/loader/omxilsymbiancomponentif.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/loader/omxilsymbiancomponentif.h) - -// Content Pipe Interface API -../inc/core/omxilcontentpipeif.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/core/omxilcontentpipeif.h) -../inc/core/omxilcontentpipeif.hrh /epoc32/include/openmax/il/core/omxilcontentpipeif.hrh -../inc/core/omxilsymbiancontentpipeif.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/core/omxilsymbiancontentpipeif.h) - - -// Romkit include files -omxilcore.iby /epoc32/rom/include/omxilcore.iby - +// 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/omxilsymbianloader.mmp +../mmpfiles/omxilcomponentif.mmp +../mmpfiles/omxilsymbiancontentpipeif.mmp +../mmpfiles/omxilcoreserver.mmp +../mmpfiles/omxilcoreclient.mmp + + + + +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/loader/OMX_Loader.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/loader/OMX_Loader.h) + +../inc/core/omxilloaderif.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/core/omxilloaderif.h) +../inc/core/omxilloaderif.hrh /epoc32/include/openmax/il/core/omxilloaderif.hrh +../inc/core/omxilloaderif.inl SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/core/omxilloaderif.inl) +../inc/core/omxilsymbianloaderif.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/core/omxilsymbianloaderif.h) + +// OMX IL Component Interface +../inc/loader/omxilcomponentif.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/loader/omxilcomponentif.h) +../inc/loader/omxilcomponentif.hrh /epoc32/include/openmax/il/loader/omxilcomponentif.hrh +../inc/loader/omxilsymbiancomponentif.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/loader/omxilsymbiancomponentif.h) + +// Content Pipe Interface API +../inc/core/omxilcontentpipeif.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/core/omxilcontentpipeif.h) +../inc/core/omxilcontentpipeif.hrh /epoc32/include/openmax/il/core/omxilcontentpipeif.hrh +../inc/core/omxilsymbiancontentpipeif.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/core/omxilsymbiancontentpipeif.h) + + +// Romkit include files +omxilcore.iby /epoc32/rom/include/omxilcore.iby + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/group/multimedia_omx_il_core.mrp --- a/omxil/omxilcore/group/multimedia_omx_il_core.mrp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/group/multimedia_omx_il_core.mrp Fri May 07 16:25:23 2010 +0100 @@ -1,28 +1,28 @@ -# multimedia_omx_il_core.mrp -# -# 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: -# - -component multimedia_omx_il_core - -source \sf\os\mm\omxil\omxilcore - -binary \sf\os\mm\omxil\omxilcore\group all - -exports \sf\os\mm\omxil\omxilcore\group - -notes_source \component_defs\release.src - -ipr E +# multimedia_omx_il_core.mrp +# +# 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: +# + +component multimedia_omx_il_core + +source \sf\os\mm\omxil\omxilcore + +binary \sf\os\mm\omxil\omxilcore\group all + +exports \sf\os\mm\omxil\omxilcore\group + +notes_source \component_defs\release.src + +ipr E diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/group/omxilcore.iby --- a/omxil/omxilcore/group/omxilcore.iby Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/group/omxilcore.iby Fri May 07 16:25:23 2010 +0100 @@ -1,26 +1,26 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// - -#ifndef 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 - -// OMX IL Loader -ECOM_PLUGIN(omxilsymbianloader.dll, omxilsymbianloader.rsc) - -#endif // OMXILCORE_IBY +// 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 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 + +// OMX IL Loader +ECOM_PLUGIN(omxilsymbianloader.dll, omxilsymbianloader.rsc) + +#endif // OMXILCORE_IBY diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/inc/core/omxilcontentpipeif.h --- a/omxil/omxilcore/inc/core/omxilcontentpipeif.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/inc/core/omxilcontentpipeif.h Fri May 07 16:25:23 2010 +0100 @@ -1,77 +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 -#include -#include -#include - -/** - 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(REComSession::CreateImplementationL(aImplementationUid, _FOFF(COmxILContentPipeIf, iDestructorKey))); - return self; - } - -#endif // OMXILCONTENTPIPEIF_H +// 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 +#include +#include +#include + +/** + 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(REComSession::CreateImplementationL(aImplementationUid, _FOFF(COmxILContentPipeIf, iDestructorKey))); + return self; + } + +#endif // OMXILCONTENTPIPEIF_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/inc/core/omxilcontentpipeif.hrh --- a/omxil/omxilcore/inc/core/omxilcontentpipeif.hrh Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/inc/core/omxilcontentpipeif.hrh Fri May 07 16:25:23 2010 +0100 @@ -1,37 +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 - +// 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 + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/inc/core/omxilloaderif.h --- a/omxil/omxilcore/inc/core/omxilloaderif.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/inc/core/omxilloaderif.h Fri May 07 16:25:23 2010 +0100 @@ -1,57 +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 -#include -#include - -/** -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 - -#endif /*OMXILLOADERIF_H*/ +// 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 +#include +#include + +/** +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 + +#endif /*OMXILLOADERIF_H*/ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/inc/core/omxilloaderif.hrh --- a/omxil/omxilcore/inc/core/omxilloaderif.hrh Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/inc/core/omxilloaderif.hrh Fri May 07 16:25:23 2010 +0100 @@ -1,33 +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 +// 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 diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/inc/core/omxilloaderif.inl --- a/omxil/omxilcore/inc/core/omxilloaderif.inl Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/inc/core/omxilloaderif.inl Fri May 07 16:25:23 2010 +0100 @@ -1,37 +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(REComSession::CreateImplementationL(aUid, _FOFF(COmxComponentLoaderIf, iDestructorKey))); - return self; - } +// 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(REComSession::CreateImplementationL(aUid, _FOFF(COmxComponentLoaderIf, iDestructorKey))); + return self; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/inc/core/omxilsymbiancontentpipeif.h --- a/omxil/omxilcore/inc/core/omxilsymbiancontentpipeif.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/inc/core/omxilsymbiancontentpipeif.h Fri May 07 16:25:23 2010 +0100 @@ -1,114 +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 - -/** -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); - +// 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 + +/** +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 diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/inc/core/omxilsymbianloaderif.h --- a/omxil/omxilcore/inc/core/omxilsymbianloaderif.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/inc/core/omxilsymbianloaderif.h Fri May 07 16:25:23 2010 +0100 @@ -1,102 +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 - -/** -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*/ +// 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 + +/** +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*/ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/inc/loader/OMX_Loader.h --- a/omxil/omxilcore/inc/loader/OMX_Loader.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/inc/loader/OMX_Loader.h Fri May 07 16:25:23 2010 +0100 @@ -1,208 +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 - -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*/ +// 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 + +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*/ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/inc/loader/omxilcomponentif.h --- a/omxil/omxilcore/inc/loader/omxilcomponentif.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/inc/loader/omxilcomponentif.h Fri May 07 16:25:23 2010 +0100 @@ -1,81 +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 -#include -#include -#include - -/** -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( REComSession::CreateImplementationL( aImplementationUid, _FOFF(COmxILComponentIf, iDestructorKey))); - return self; - } - -/** -Destructor of this interface. -*/ -inline COmxILComponentIf::~COmxILComponentIf() - { - REComSession::DestroyedImplementation(iDestructorKey); - } -#endif // OMXILCOMPONENTIF_H +// 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 +#include +#include +#include + +/** +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( REComSession::CreateImplementationL( aImplementationUid, _FOFF(COmxILComponentIf, iDestructorKey))); + return self; + } + +/** +Destructor of this interface. +*/ +inline COmxILComponentIf::~COmxILComponentIf() + { + REComSession::DestroyedImplementation(iDestructorKey); + } +#endif // OMXILCOMPONENTIF_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/inc/loader/omxilcomponentif.hrh --- a/omxil/omxilcore/inc/loader/omxilcomponentif.hrh Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/inc/loader/omxilcomponentif.hrh Fri May 07 16:25:23 2010 +0100 @@ -1,32 +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 +// 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 diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/inc/loader/omxilsymbiancomponentif.h --- a/omxil/omxilcore/inc/loader/omxilsymbiancomponentif.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/inc/loader/omxilsymbiancomponentif.h Fri May 07 16:25:23 2010 +0100 @@ -1,104 +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 - -/** -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 +// 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 + +/** +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 diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/mmpfiles/OSTOMXILFrameworkTrace.mmh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/omxilcore/mmpfiles/OSTOMXILFrameworkTrace.mmh Fri May 07 16:25:23 2010 +0100 @@ -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 +#endif // SYMBIAN_PERF_TRACE_OMX_IL + +#endif //SHAREDOSTOMXILFRAMEWORKTRACE_HRH diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/mmpfiles/omxilcomponentif.mmp --- a/omxil/omxilcore/mmpfiles/omxilcomponentif.mmp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/mmpfiles/omxilcomponentif.mmp Fri May 07 16:25:23 2010 +0100 @@ -1,31 +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/loader -SOURCE omxilsymbiancomponentif.cpp - - -SMPSAFE +// 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/loader +SOURCE omxilsymbiancomponentif.cpp + + +SMPSAFE diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/mmpfiles/omxilcoreclient.mmp --- a/omxil/omxilcore/mmpfiles/omxilcoreclient.mmp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/mmpfiles/omxilcoreclient.mmp Fri May 07 16:25:23 2010 +0100 @@ -1,51 +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 "../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 +// 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 ../traces + +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 diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/mmpfiles/omxilcoreserver.mmp --- a/omxil/omxilcore/mmpfiles/omxilcoreserver.mmp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/mmpfiles/omxilcoreserver.mmp Fri May 07 16:25:23 2010 +0100 @@ -1,49 +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 "../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 - -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 +// 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 ../traces + +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 diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/mmpfiles/omxilsymbiancontentpipeif.mmp --- a/omxil/omxilcore/mmpfiles/omxilsymbiancontentpipeif.mmp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/mmpfiles/omxilsymbiancontentpipeif.mmp Fri May 07 16:25:23 2010 +0100 @@ -1,28 +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 +// 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 diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/mmpfiles/omxilsymbianloader.mmp --- a/omxil/omxilcore/mmpfiles/omxilsymbianloader.mmp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/mmpfiles/omxilsymbianloader.mmp Fri May 07 16:25:23 2010 +0100 @@ -1,37 +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/core/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/loader -SOURCE omxilsymbiancomponentloader.cpp -RESOURCE omxilsymbianloader.rss - -LIBRARY euser.lib -LIBRARY ecom.lib -LIBRARY estlib.lib - -// MACRO _OMXIL_SYMBIANLOADER_DEBUG_TRACING_ON - -SMPSAFE +// 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 omxilsymbianloader.dll +CAPABILITY ALL -TCB +TARGETTYPE PLUGIN +UID KUidECOM KUidOmxILLoaderDll +VENDORID 0x70000001 + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN +OS_LAYER_ESTLIB_SYSTEMINCLUDE + +SOURCEPATH ../src/loader +SOURCE omxilsymbiancomponentloader.cpp +RESOURCE omxilsymbianloader.rss + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY estlib.lib + +// MACRO _OMXIL_SYMBIANLOADER_DEBUG_TRACING_ON + +SMPSAFE diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/mmpfiles/omxilsymbianloaderif.mmp --- a/omxil/omxilcore/mmpfiles/omxilsymbianloaderif.mmp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/mmpfiles/omxilsymbianloaderif.mmp Fri May 07 16:25:23 2010 +0100 @@ -1,28 +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 +// 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 diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/src/core/OSTOMXILFrameworkTrace.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/omxilcore/src/core/OSTOMXILFrameworkTrace.h Fri May 07 16:25:23 2010 +0100 @@ -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 + * Include this header file from exe specific header file that defines EXECUTABLE_DEFAULT_COMPONENTID + */ + +#include +#include + +#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 + + +#endif //SYMBIAN_PERF_TRACE_OMX_IL +#endif //OSTOMXILFRAMEWORKTRACE_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/src/core/log.h --- a/omxil/omxilcore/src/core/log.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/src/core/log.h Fri May 07 16:25:23 2010 +0100 @@ -1,146 +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 - -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 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 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__ +// 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 + +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 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 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__ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/src/core/omxilcomponentapiperformancetrace.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/omxilcore/src/core/omxilcomponentapiperformancetrace.cpp Fri May 07 16:25:23 2010 +0100 @@ -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 + +#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 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(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 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(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 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 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(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(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(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( 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(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(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 ((reinterpret_cast(ahClientComp))->pComponentPrivate ); + delete pTraceCompRef->pCallbacks; + + //resolve and delete the OMX_COMPONENTTYPE structure passed to the client + COMPONENT_REF* pClientCompRef = reinterpret_cast ((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 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(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(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(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 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 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 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 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 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 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 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 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(reinterpret_cast(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(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 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 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(reinterpret_cast(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(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(reinterpret_cast(ahComponent)->pComponentPrivate ) ; + + // now access the client's interface and repopulate its callback + COMPONENT_REF* pClientCompRef = reinterpret_cast(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 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 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 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 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; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/src/core/omxilcomponentapiperformancetrace.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/omxilcore/src/core/omxilcomponentapiperformancetrace.h Fri May 07 16:25:23 2010 +0100 @@ -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 +#include +#include +#include +#include +#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 diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/src/core/omxilcomponentapiperformancetrace.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/omxilcore/src/core/omxilcomponentapiperformancetrace.inl Fri May 07 16:25:23 2010 +0100 @@ -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 ((reinterpret_cast(ahComponent))->pComponentPrivate ); + pComp = pTRaceRef->pComponentIF; + } + return pComp; + } + +inline COMPONENT_REF* OMXILAPITraceWrapper::ResolveCallsFromComponent(OMX_IN OMX_HANDLETYPE ahComponent) + { + ASSERT(ahComponent); + return reinterpret_cast ((reinterpret_cast(ahComponent))->pApplicationPrivate ); + } + + +#endif //__OMXILCOMPONENTAPIPERFORMANCETRACE_INL diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/src/core/omxilcore.cpp --- a/omxil/omxilcore/src/core/omxilcore.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/src/core/omxilcore.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,894 +1,1183 @@ -// 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 -#include -#include -#include -#include -#include - -#include "log.h" -#include "omxilcore.h" -#include "omxiluids.hrh" -#include -#include -#include -#include - -#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; indexImplementationUid()!= - 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(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) - { - DEBUG_PRINTF(_L8("COmxILCore::LoadComponent")); - - if(!aHandle || !aComponentName) - { - return OMX_ErrorBadParameter; - } - - if( !VerifyComponentName(aComponentName)) - { - return OMX_ErrorInvalidComponentName; - } - - OMX_ERRORTYPE error = OMX_ErrorComponentNotFound; - OMX_LOADERTYPE* loader; - - const TInt count = iLoaders.Count(); - for( TInt index=0; index( - iLoaders[index].iLoader->Handle()); - __ASSERT_DEBUG(loader != NULL, User::Panic(KOmxILCorePanic, 1)); - error = loader->LoadComponent(loader, aHandle, - aComponentName, - aAppData, aCallBacks); - // 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) - { - return error; - } - } - 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(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; indexHandle(); - OMX_LOADERTYPE* omx_loader = - reinterpret_cast(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) - { - DEBUG_PRINTF(_L8("COmxILCore::ComponentNameEnum")); - - if( aNameLength == 0 || aComponentName == NULL ) - { - return OMX_ErrorBadParameter; - } - - 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); - return OMX_ErrorNoMore; - } - - OMX_ERRORTYPE error = OMX_ErrorNone; - 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( - 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 - { - strcpy(aComponentName, tempComponentName); - 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) - { - return OMX_ErrorInsufficientResources; - } - } - } - } - error= (found ? OMX_ErrorNone : OMX_ErrorNoMore); - } - else - { - RArray 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(); - return OMX_ErrorNotReady; - } - err=componentCountPerLoader.Append(-1); - switch(err) - { - case KErrNone: - //do nothing - break; - - case KErrNoMemory: - componentCountPerLoader.Close(); - return OMX_ErrorInsufficientResources; - - default: - componentCountPerLoader.Close(); - return OMX_ErrorUndefined; - } - } - - for(TInt loaderIndex=0; loaderIndex < KLoadersCount; ++loaderIndex) - { - //fist acquire the actual loader - OMX_LOADERTYPE* loader = reinterpret_cast(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; lComponentNameEnum(loader, - aComponentName, - aNameLength, relativeIndex); - - - switch(error) - { - case OMX_ErrorNone: - //this loader has component at this index (ie: at relativeIndex) - componentCountPerLoader.Close(); //free array before return - return OMX_ErrorNone; - - 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 - return OMX_ErrorNoMore; - } - //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; - 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) - break; - } - else if(OMX_ErrorInsufficientResources==tempError) - { - //critical error; free array before return - componentCountPerLoader.Close(); - return OMX_ErrorInsufficientResources; - } - //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(-1==componentCountPerLoader[loaderIndex]) - { - componentCountPerLoader[loaderIndex]=0; - } - break; - case OMX_ErrorInsufficientResources: - componentCountPerLoader.Close(); //free array before return - return OMX_ErrorInsufficientResources; - 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; - break; - } - }//end of for - componentCountPerLoader.Close(); //free array before return - } // else - - - if (OMX_ErrorInsufficientResources == error) - { - return OMX_ErrorUndefined; - } - else - { - return error; - } - } - - -EXPORT_C OMX_ERRORTYPE COmxILCore::FreeHandle(OMX_HANDLETYPE aComponent) const - { - DEBUG_PRINTF2(_L8("COmxILCore::FreeHandle : Component Handle [%X]"), aComponent); - - if( aComponent == NULL ) - { - return OMX_ErrorBadParameter; - } - - OMX_LOADERTYPE* loader; - OMX_ERRORTYPE 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(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 - } - } - - 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")); - - if (!aHandleOutput && !aHandleInput ) - { - return OMX_ErrorBadParameter; - } - - OMX_COMPONENTTYPE *componentInput, *componentOutput; - componentInput = reinterpret_cast(aHandleInput); - componentOutput = reinterpret_cast(aHandleOutput); - - OMX_TUNNELSETUPTYPE tunnelSetup; - OMX_ERRORTYPE error; - 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))) - { - return TOmxILCoreUtils::ConvertErrorGetParameterToSetupTunnel(error); - } - - if (OMX_DirOutput != portDefinitionType.eDir) - { - return OMX_ErrorBadParameter; - } - - error = componentOutput->ComponentTunnelRequest(componentOutput, - aPortOutput, - componentInput, - aPortInput, - &tunnelSetup); - if(OMX_ErrorNone != error) - { - return error; - } - } - - if(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))) - { - return TOmxILCoreUtils::ConvertErrorGetParameterToSetupTunnel(error); - } - - if (OMX_DirInput != portDefinitionType.eDir) - { - return OMX_ErrorBadParameter; - } - - error = componentInput->ComponentTunnelRequest(componentInput, - aPortInput, - componentOutput, - aPortOutput, - &tunnelSetup); - - if(OMX_ErrorNone != error) - { - if(!componentOutput) - { - return error; - } - - if( OMX_ErrorNone != componentOutput->ComponentTunnelRequest( - componentOutput, - aPortOutput, - NULL, - 0, - &tunnelSetup) ) - { - return OMX_ErrorUndefined; - } - return error; - } - } - return OMX_ErrorNone; - } - -EXPORT_C OMX_ERRORTYPE COmxILCore::GetContentPipe( - OMX_HANDLETYPE *aPipe,const OMX_STRING aURI) - { - DEBUG_PRINTF(_L8("COmxILCore::GetContentPipe")); - - if( aURI == NULL ) - { - return OMX_ErrorBadParameter; - } - - RImplInfoPtrArray ecomArray; - TRAPD(error,REComSession::ListImplementationsL( - TUid::Uid(KUidOmxILContentPipeIf), ecomArray)); - if( error != KErrNone ) - { - ecomArray.ResetAndDestroy(); - return OMX_ErrorUndefined; - } - - const TInt KEcomArrayCount = ecomArray.Count(); - if(!KEcomArrayCount) - { - ecomArray.Close(); - return OMX_ErrorBadParameter; - } - - HBufC8* convert = NULL; - TPtr8 luri(reinterpret_cast(aURI), strlen(aURI), strlen(aURI)); - - TRAP(error, (convert = HBufC8::NewL(strlen(aURI)))); - if( error != KErrNone ) - { - ecomArray.ResetAndDestroy(); - return OMX_ErrorUndefined; - } - - 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 ) - { - delete convert; - ecomArray.ResetAndDestroy(); - return OMX_ErrorBadParameter; - } - - TInt index; - CImplementationInformation* info; - COmxILContentPipeIf* cpipe = NULL; - OMX_ERRORTYPE omxError = OMX_ErrorBadParameter; - for(index=0; index < KEcomArrayCount; ++index) - { - info = ecomArray[index]; - if(info->DataType().Find(scheme) != KErrNotFound ) - { - //found - TRAP(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(); - return omxError; - } - -EXPORT_C OMX_ERRORTYPE COmxILCore::GetComponentsOfRole ( - const OMX_STRING aRole, OMX_U32 *aNumComps, OMX_U8 **aCompNames) - { - DEBUG_PRINTF(_L8("COmxILCore::GetComponentsOfRole")); - - if (aNumComps == NULL) - { - return OMX_ErrorBadParameter; - } - - if (aCompNames != NULL && *aNumComps == 0) - { - return OMX_ErrorBadParameter; - } - - OMX_LOADERTYPE* loader; - OMX_ERRORTYPE 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( - 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; - return OMX_ErrorBadParameter; - } - } // 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) - { - return OMX_ErrorUndefined; - } - else - { - return error; - } - } - -EXPORT_C OMX_ERRORTYPE COmxILCore::GetRolesOfComponent ( - const OMX_STRING aCompName, OMX_U32 *aNumRoles, OMX_U8 **aRoles) - { - DEBUG_PRINTF(_L8("COmxILCore::GetRolesOfComponent")); - - if (aNumRoles == NULL) - { - return OMX_ErrorBadParameter; - } - - if (aRoles != NULL && *aNumRoles == 0) - { - return OMX_ErrorBadParameter; - } - if( !VerifyComponentName(aCompName)) - { - return OMX_ErrorInvalidComponentName; - } - TInt numRolesCopy = *aNumRoles; - OMX_LOADERTYPE* loader; - OMX_ERRORTYPE error = OMX_ErrorComponentNotFound; - const TInt KLoadersCount = iLoaders.Count(); - for(TInt index=0; index < KLoadersCount; ++index) - { - loader = reinterpret_cast( - 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; - } - return OMX_ErrorNone; - } - - 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 (OMX_ErrorUndefined != error && OMX_ErrorInvalidComponentName != error && - OMX_ErrorInvalidComponent != error && OMX_ErrorBadParameter != error) - { - return OMX_ErrorUndefined; - } - else - { - 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; - }; - } +// 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 +#include +#include +#include +#include +#include + +#include "log.h" +#include "omxilcore.h" +#include "omxiluids.hrh" +#include +#include +#include +#include + +#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; indexImplementationUid()!= + 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(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( + 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 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(reinterpret_cast(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(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; indexHandle(); + OMX_LOADERTYPE* omx_loader = + reinterpret_cast(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( + 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 + { + strcpy(aComponentName, tempComponentName); + 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 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(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; lComponentNameEnum(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(reinterpret_cast(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(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 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(aHandleInput); + componentOutput = reinterpret_cast(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 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(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 ) + { + delete convert; + 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 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(reinterpret_cast(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( + 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 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(reinterpret_cast(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( + 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 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(reinterpret_cast(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; + }; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/src/core/omxilcore.h --- a/omxil/omxilcore/src/core/omxilcore.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/src/core/omxilcore.h Fri May 07 16:25:23 2010 +0100 @@ -1,89 +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 -#include - -// 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 iLoaders; - RPointerArray 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 */ +// +// 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 +#include + +// 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 iLoaders; + RPointerArray 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 */ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/src/core/omxilsymbiancontentpipeif.cpp --- a/omxil/omxilcore/src/core/omxilsymbiancontentpipeif.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/src/core/omxilsymbiancontentpipeif.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,85 +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 -#include - -/** - 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(*aContentPipe); - } - return err; - } +// 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 +#include + +/** + 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(*aContentPipe); + } + return err; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/src/core/omxilsymbianloaderif.cpp --- a/omxil/omxilcore/src/core/omxilsymbianloaderif.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/src/core/omxilsymbianloaderif.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,98 +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 - -/** -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; - } - +// 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 + +/** +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; + } + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/src/core/omxiluids.hrh --- a/omxil/omxilcore/src/core/omxiluids.hrh Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/src/core/omxiluids.hrh Fri May 07 16:25:23 2010 +0100 @@ -1,38 +1,38 @@ -// 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 loader -#define KUidOmxILLoaderDll 0x102834CF -#define KUidOmxILSymbianComponentLoader 0x102834D0 - -// Symbian OpenMax IL Content Pipe Interface -#define KUidOmxILSymbianContentPipeIfLib 0x102834B8 - -#endif /*OMXILUIDS_HRH*/ +// 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 loader +#define KUidOmxILLoaderDll 0x102834CF +#define KUidOmxILSymbianComponentLoader 0x102834D0 + +// Symbian OpenMax IL Content Pipe Interface +#define KUidOmxILSymbianContentPipeIfLib 0x102834B8 + +#endif /*OMXILUIDS_HRH*/ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/src/loader/log.h --- a/omxil/omxilcore/src/loader/log.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/src/loader/log.h Fri May 07 16:25:23 2010 +0100 @@ -1,149 +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 - -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 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 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__ +/* +* 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 + +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 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 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__ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/src/loader/omxilsymbiancomponentif.cpp --- a/omxil/omxilcore/src/loader/omxilsymbiancomponentif.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/src/loader/omxilsymbiancomponentif.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,86 +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 - -/** -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; - } +// 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 + +/** +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; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/src/loader/omxilsymbiancomponentloader.cpp --- a/omxil/omxilcore/src/loader/omxilsymbiancomponentloader.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/src/loader/omxilsymbiancomponentloader.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,443 +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 -#include -#include "omxilsymbiancomponentloader.h" -#include "../core/omxiluids.hrh" -#include -#include -#include -#include -#include -#include -#include -#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; indexImplementationUid(); - 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(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(*pHandle))->SetCallbacks(*pHandle, pCallBacks, pAppData); - - if(error != OMX_ErrorNone) - { - (static_cast(*pHandle))->ComponentDeInit(*pHandle); - delete component; - return error; - } - if( iComponents.Append(component) != KErrNone ) - { - (static_cast(*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(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= 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(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(const_cast(iComponentNameList[index].iRoles.Ptr())), - size); - parser[size]=0; - - for( i=0, j=0, p=parser; i(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; - } +// 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 +#include +#include "omxilsymbiancomponentloader.h" +#include "../core/omxiluids.hrh" +#include +#include +#include +#include +#include +#include +#include +#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; indexImplementationUid(); + 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(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(*pHandle))->SetCallbacks(*pHandle, pCallBacks, pAppData); + + if(error != OMX_ErrorNone) + { + (static_cast(*pHandle))->ComponentDeInit(*pHandle); + delete component; + return error; + } + if( iComponents.Append(component) != KErrNone ) + { + (static_cast(*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(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= 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(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(const_cast(iComponentNameList[index].iRoles.Ptr())), + size); + parser[size]=0; + + for( i=0, j=0, p=parser; i(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; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/src/loader/omxilsymbiancomponentloader.h --- a/omxil/omxilcore/src/loader/omxilsymbiancomponentloader.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/src/loader/omxilsymbiancomponentloader.h Fri May 07 16:25:23 2010 +0100 @@ -1,79 +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 -#include -#include -#include -#include - -class CSymbianOmxComponentLoader : private COmxComponentLoaderIf - { -public: - class TOmxComponentInfo - { - public: - TOmxComponentInfo(); - public: - TUid iUid; - TBuf8 iComponentName; - TBuf8 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 iComponentNameList; - RPointerArray iComponents; - }; - -inline CSymbianOmxComponentLoader::TOmxComponentInfo::TOmxComponentInfo(): - iUid(TUid::Uid(0)),iComponentName(0),iRoles(0) - { - } - - -#endif /*OMXILSYMBIANCOMPONENTLOADER_H*/ +// 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 +#include +#include +#include +#include + +class CSymbianOmxComponentLoader : private COmxComponentLoaderIf + { +public: + class TOmxComponentInfo + { + public: + TOmxComponentInfo(); + public: + TUid iUid; + TBuf8 iComponentName; + TBuf8 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 iComponentNameList; + RPointerArray iComponents; + }; + +inline CSymbianOmxComponentLoader::TOmxComponentInfo::TOmxComponentInfo(): + iUid(TUid::Uid(0)),iComponentName(0),iRoles(0) + { + } + + +#endif /*OMXILSYMBIANCOMPONENTLOADER_H*/ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/src/loader/omxilsymbianloader.rss --- a/omxil/omxilcore/src/loader/omxilsymbianloader.rss Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/src/loader/omxilsymbianloader.rss Fri May 07 16:25:23 2010 +0100 @@ -1,43 +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 -#include "../core/omxiluids.hrh" -#include - -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 = ""; - } - }; - } - }; - } +// 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 +#include "../core/omxiluids.hrh" +#include + +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 = ""; + } + }; + } + }; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/src/omxilcoreclient/log.h --- a/omxil/omxilcore/src/omxilcoreclient/log.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/src/omxilcoreclient/log.h Fri May 07 16:25:23 2010 +0100 @@ -1,145 +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 - -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 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 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__ +// 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 +#include "OMX_Trace.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 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 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__ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/src/omxilcoreclient/omxilcoreclientsession.cpp --- a/omxil/omxilcore/src/omxilcoreclient/omxilcoreclientsession.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/src/omxilcoreclient/omxilcoreclientsession.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,1212 +1,1290 @@ -// 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 - -#include "log.h" -#include "omxilcoreclientsession.h" -#include "omxilcoreclientserver.h" -#include "omxilcore.h" - -#ifdef __WINSCW__ -#include -#include "../core/omxiluids.hrh" -#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(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")); - - TInt err = KErrNotFound; - XGlobalILCoreCache *glbCache = XGlobalILCoreCache::IlCoreCache(); - if(!glbCache) - { - return KErrGeneral; - } - 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))) - { - return err; - } - err = glbCache->SetServerHandle(serverHandle); - } - else - { - // The server exists already... close the session and return... - RHandleBase::Close(); - return KErrAlreadyExists; - } - - if(glbCache->ServerHandle().Handle() == KNullHandle) - { - return KErrNotFound; - } - - // Now, create the session... - if (KErrNone == err) - { - err = CreateSession(glbCache->ServerHandle(), TVersion(1,0,0)); - } - - 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 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")); - - // Param 0 - OMX_ERRORTYPE err = OMX_ErrorNone; - TPckgBuf pckg0; - - // Param 1 - TUint64 serverThreadId = 0; - TPckgBuf 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(); - - 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 pckg0; - - TPckgBuf 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 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 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 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 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 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 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 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; - - } +/* +* 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 + +#include "log.h" +#include "omxilcoreclientsession.h" +#include "omxilcoreclientserver.h" +#include "omxilcore.h" + +#ifdef __WINSCW__ +#include +#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(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 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 pckg0; + + // Param 1 + TUint64 serverThreadId = 0; + TPckgBuf 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 pckg0; + + TPckgBuf 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 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 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 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 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 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 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 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() + { + OMX_TRACE_INIT_IN(); + 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(); + OMX_TRACE_INIT_OUT(omxError); + 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() + { + OMX_TRACE_DEINIT_IN(); + 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(); + OMX_TRACE_DEINIT_OUT(omxError); + 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) + { + OMX_TRACE_COMPONENTNAMEENUM_IN(cComponentName, nNameLength, 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(); + OMX_TRACE_COMPONENTNAMEENUM_OUT(cComponentName, nNameLength, nIndex, omxError); + 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) + { + OMX_TRACE_GETHANDLE_IN(*pHandle, cComponentName, pAppData, 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(); + OMX_TRACE_GETHANDLE_OUT(*pHandle, cComponentName, pAppData, pCallBacks, omxError); + 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) + { + OMX_TRACE_FREEHANDLE_IN(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(); + OMX_TRACE_FREEHANDLE_OUT(hComponent, omxError); + 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) + { + OMX_TRACE_SETUPTUNNEL_IN(hOutput, nPortOutput, hInput, 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(); + } + OMX_TRACE_SETUPTUNNEL_OUT(hOutput, nPortOutput, hInput, nPortInput, omxError); + 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) + { + OMX_TRACE_GETCONTENTPIPE_IN(hPipe, 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(); + OMX_TRACE_GETCONTENTPIPE_OUT(hPipe, szURI, omxError); + 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) + { + OMX_TRACE_GETCOMPONENTSOFROLE_IN(role, pNumComps, 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(); + OMX_TRACE_GETCOMPONENTSOFROLE_OUT(role, pNumComps, compNames, omxError); + 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) + { + OMX_TRACE_GETROLESOFCOMPONENT_IN(compName, pNumRoles, 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(); + OMX_TRACE_GETROLESOFCOMPONENT_OUT(compName, pNumRoles, roles, omxError); + return omxError; + + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/src/omxilcoreclient/omxilcoreclientsession.h --- a/omxil/omxilcore/src/omxilcoreclient/omxilcoreclientsession.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/src/omxilcoreclient/omxilcoreclientsession.h Fri May 07 16:25:23 2010 +0100 @@ -1,88 +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 -#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 +// 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 +#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 diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/src/omxilcoreserver/log.h --- a/omxil/omxilcore/src/omxilcoreserver/log.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/src/omxilcoreserver/log.h Fri May 07 16:25:23 2010 +0100 @@ -1,146 +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 - -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 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 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__ +// 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 + +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 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 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__ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/src/omxilcoreserver/omxilcoreclientserver.h --- a/omxil/omxilcore/src/omxilcoreserver/omxilcoreclientserver.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/src/omxilcoreserver/omxilcoreclientserver.h Fri May 07 16:25:23 2010 +0100 @@ -1,103 +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 -#include - -_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 +// 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 +#include + +_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 diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/src/omxilcoreserver/omxilcoreserver.cpp --- a/omxil/omxilcore/src/omxilcoreserver/omxilcoreserver.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/src/omxilcoreserver/omxilcoreserver.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,310 +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 - - -/** - * 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(*this)); - - return omxilcoreSession; - } - -TInt COmxILCoreServer::StopServer(TAny* aPtr) - { - DEBUG_PRINTF(_L8("COmxILCoreServer::StopServer")); - COmxILCoreServer* self = - static_cast (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(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 +// 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 + + +/** + * 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(*this)); + + return omxilcoreSession; + } + +TInt COmxILCoreServer::StopServer(TAny* aPtr) + { + DEBUG_PRINTF(_L8("COmxILCoreServer::StopServer")); + COmxILCoreServer* self = + static_cast (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(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 diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/src/omxilcoreserver/omxilcoreserver.h --- a/omxil/omxilcore/src/omxilcoreserver/omxilcoreserver.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/src/omxilcoreserver/omxilcoreserver.h Fri May 07 16:25:23 2010 +0100 @@ -1,72 +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 -#include -#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 +// 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 +#include +#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 diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/src/omxilcoreserver/omxilcoreserversession.cpp --- a/omxil/omxilcore/src/omxilcoreserver/omxilcoreserversession.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/src/omxilcoreserver/omxilcoreserversession.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,263 +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(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 p(thisThread.Id().Id()); - aMessage.WriteL(1,p); - thisThread.Close(); - } - break; - - case EOmxILCoreGetILCore: - { - DEBUG_PRINTF(_L8("COmxILCoreServerSession::DispatchMessageL : EOmxILCoreGetILCore")); - - // Write IL Core reference... - TPckgBuf p(&iCore); - aMessage.WriteL(1,p); - - } - break; - - case EOmxILCoreComponentNameEnum: - { - DEBUG_PRINTF(_L8("COmxILCoreServerSession::DispatchMessageL : EOmxILCoreComponentNameEnum")); - - TComponentNameEnum* pArg = - static_cast( - const_cast(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( - const_cast(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( - const_cast(aMessage.Ptr1())); - - omxError = iCore.FreeHandle(hComponent); - - } - break; - - case EOmxILCoreSetupTunnel: - { - DEBUG_PRINTF(_L8("COmxILCoreServerSession::DispatchMessageL : EOmxILCoreSetupTunnel")); - - TSetupTunnel* pArg = - static_cast( - const_cast(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( - const_cast(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( - const_cast(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( - const_cast(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 p(omxError); - aMessage.WriteL(0,p); - - aMessage.Complete(error); - - return error; - } +// 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(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 p(thisThread.Id().Id()); + aMessage.WriteL(1,p); + thisThread.Close(); + } + break; + + case EOmxILCoreGetILCore: + { + DEBUG_PRINTF(_L8("COmxILCoreServerSession::DispatchMessageL : EOmxILCoreGetILCore")); + + // Write IL Core reference... + TPckgBuf p(&iCore); + aMessage.WriteL(1,p); + + } + break; + + case EOmxILCoreComponentNameEnum: + { + DEBUG_PRINTF(_L8("COmxILCoreServerSession::DispatchMessageL : EOmxILCoreComponentNameEnum")); + + TComponentNameEnum* pArg = + static_cast( + const_cast(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( + const_cast(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( + const_cast(aMessage.Ptr1())); + + omxError = iCore.FreeHandle(hComponent); + + } + break; + + case EOmxILCoreSetupTunnel: + { + DEBUG_PRINTF(_L8("COmxILCoreServerSession::DispatchMessageL : EOmxILCoreSetupTunnel")); + + TSetupTunnel* pArg = + static_cast( + const_cast(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( + const_cast(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( + const_cast(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( + const_cast(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 p(omxError); + aMessage.WriteL(0,p); + + aMessage.Complete(error); + + return error; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/src/omxilcoreserver/omxilcoreserversession.h --- a/omxil/omxilcore/src/omxilcoreserver/omxilcoreserversession.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilcore/src/omxilcoreserver/omxilcoreserversession.h Fri May 07 16:25:23 2010 +0100 @@ -1,45 +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 -#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 +// 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 +#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 diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/traces/OMX_Trace.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/omxilcore/traces/OMX_Trace.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,337 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 OMX_TRACE_H_ +#define OMX_TRACE_H_ + +#ifdef OMX_DEBUG_TRACING_ON +/* COMPONENT ENTRY POINTS */ + +#define OMX_TRACE_GETCOMPONENTVERSION_IN(hComponent, pComponentName, pComponentVersion, pSpecVersion, pComponentUUID) RDebug::Printf("DBGOMX_GetComponentVersion %X", hComponent) +//TODO [DL] this is dodgy, what is it fails and then try write pCompnentName as a string +#define OMX_TRACE_GETCOMPONENTVERSION_OUT(hComponent, pComponentName, pComponentVersion, pSpecVersion, pComponentUUID, error) RDebug::Printf("DBGOMX_OUT_GetComponentVersion %X %d", hComponent, error) + +#define OMX_TRACE_SENDCOMMAND_IN(hComponent, Cmd, nParam1, pCmdData) RDebug::Printf("DBGOMX_SendCommand %X %d %u", hComponent, Cmd, nParam1) +#define OMX_TRACE_SENDCOMMAND_OUT(hComponent, Cmd, nParam1, pCmdData, error) RDebug::Printf("DBGOMX_OUT_SendCommand %X %d %u %d", hComponent, Cmd, nParam1, error) + +#define OMX_TRACE_GETPARAMETER_IN(hComponent, nParamIndex, pComponentParameterStructure) RDebug::Printf("DBGOMX_GetParameter %X %d %X", hComponent, nParamIndex, pComponentParameterStructure) +#define OMX_TRACE_GETPARAMETER_OUT(hComponent, nParamIndex, pComponentParameterStructure, error) RDebug::Printf("DBGOMX_OUT_GetParameter %X %d %X %d",hComponent, nParamIndex, pComponentParameterStructure, error) + +#define OMX_TRACE_SETPARAMETER_IN(hComponent, nParamIndex, pComponentParameterStructure) RDebug::Printf("DBGOMX_SetParameter %X %d %X", hComponent, nParamIndex, pComponentParameterStructure) +#define OMX_TRACE_SETPARAMETER_OUT(hComponent, nParamIndex, pComponentParameterStructure, error) RDebug::Printf("DBGOMX_OUT_SetParameter %X %d %X %d", hComponent, nParamIndex, pComponentParameterStructure, error) + +#define OMX_TRACE_GETCONFIG_IN(hComponent, nParamIndex, pComponentConfigStructure) RDebug::Printf("DBGOMX_GetConfig %X %d %X",hComponent, nParamIndex, pComponentConfigStructure) +#define OMX_TRACE_GETCONFIG_OUT(hComponent, nParamIndex, pComponentConfigStructure, error) RDebug::Printf("DBGOMX_OUT_GetConfig %X %d %X %d",hComponent, nParamIndex, pComponentConfigStructure, error) + +#define OMX_TRACE_SETCONFIG_IN(hComponent, nParamIndex, pComponentConfigStructure) RDebug::Printf("DBGOMX_SetConfig %X %d %X",hComponent, nParamIndex, pComponentConfigStructure) +#define OMX_TRACE_SETCONFIG_OUT(hComponent, nParamIndex, pComponentConfigStructure, error) RDebug::Printf("DBGOMX_OUT_SetConfig %X %d %X %d",hComponent, nParamIndex, pComponentConfigStructure, error) + +#define OMX_TRACE_GETEXTENSIONINDEX_IN(hComponent, cParameterName, pIndexType) RDebug::Printf("DBGOMX_GetExtensionIndex %X %s", hComponent, cParameterName) +#define OMX_TRACE_GETEXTENSIONINDEX_OUT(hComponent, cParameterName, pIndexType, error) RDebug::Printf("DBGOMX_OUT_GetExtensionIndex %X %s %d",hComponent, cParameterName, error) + +#define OMX_TRACE_GETSTATE_IN(hComponent, pState) RDebug::Printf("DBGOMX_GetState %X", hComponent) +#define OMX_TRACE_GETSTATE_OUT(hComponent, pState, error) RDebug::Printf("DBGOMX_OUT_GetState %X %d %d", hComponent, *pState, error) + +#define OMX_TRACE_COMPONENTTUNNELREQUEST_IN(hComp, nPort, hTunneledComp, nTunneledPort, pTunnelSetup) RDebug::Printf("DBGOMX_ComponentTunnelRequest %X %u %X %u", hComp, nPort, hTunneledComp, nTunneledPort) +#define OMX_TRACE_COMPONENTTUNNELREQUEST_OUT(hComp, nPort, hTunneledComp, nTunneledPort, pTunnelSetup, error) RDebug::Printf("DBGOMX_OUT_ComponentTunnelRequest %X %u %X %u %d",hComp, nPort, hTunneledComp, nTunneledPort, error) + +#define OMX_TRACE_USEBUFFER_IN(hComponent, ppBufferHdr, nPortIndex, pAppPrivate, nSizeBytes, pBuffer) RDebug::Printf("DBGOMX_UseBuffer %X %u %u %X", hComponent, nPortIndex, nSizeBytes, pBuffer ) +#define OMX_TRACE_USEBUFFER_OUT(hComponent, ppBufferHdr, nPortIndex, pAppPrivate, nSizeBytes, pBuffer, error) RDebug::Printf("DBGOMX_OUT_UseBuffer %X %X %u %u %X %d", hComponent, *ppBufferHdr, nPortIndex, nSizeBytes, pBuffer, error) + +#define OMX_TRACE_ALLOCATEBUFFER_IN(hComponent, ppBuffer, nPortIndex, pAppPrivate, nSizeBytes) RDebug::Printf("DBGOMX_AllocateBuffer %X %u %u", hComponent, nPortIndex, nSizeBytes) +#define OMX_TRACE_ALLOCATEBUFFER_OUT(hComponent, ppBuffer, nPortIndex, pAppPrivate, nSizeBytes, error) RDebug::Printf("DBGOMX_OUT_AllocateBuffer %X %X %u %u %d", hComponent, *ppBuffer, nPortIndex, nSizeBytes, error) + +#define OMX_TRACE_FREEBUFFER_IN(hComponent, nPortIndex, pBuffer) RDebug::Printf("DBGOMX_FreeBuffer %X %u %X", hComponent, nPortIndex, pBuffer) +#define OMX_TRACE_FREEBUFFER_OUT(hComponent, nPortIndex, pBuffer, error) RDebug::Printf("DBGOMX_OUT_FreeBuffer %X %u %X %d", hComponent, nPortIndex, pBuffer, error) + +#define OMX_TRACE_EMPTYTHISBUFFER_IN(hComponent, pBuffer) RDebug::Printf("DBGOMX OMX_EmptyThisBuffer %X %X %u %u %u %X %u %Lu %u %u %u 0", hComponent, pBuffer, pBuffer->nAllocLen, pBuffer->nFilledLen, pBuffer->nOffset, pBuffer->hMarkTargetComponent, pBuffer->nTickCount, pBuffer->nTimeStamp, pBuffer->nFlags, pBuffer->nOutputPortIndex, pBuffer->nInputPortIndex) +#define OMX_TRACE_EMPTYTHISBUFFER_OUT(hComponent, pBuffer, error) RDebug::Printf("DBGOMX_OUT_EmptyThisBuffer %X %X %d", hComponent, pBuffer, error) + +#define OMX_TRACE_FILLTHISBUFFER_IN(hComponent, pBuffer) RDebug::Printf("DBGOMX OMX_FillThisBuffer %X %X %u %u %u %X %u %Lu %u %u %u 0", hComponent, pBuffer, pBuffer->nAllocLen, pBuffer->nFilledLen, pBuffer->nOffset, pBuffer->hMarkTargetComponent, pBuffer->nTickCount, pBuffer->nTimeStamp, pBuffer->nFlags, pBuffer->nOutputPortIndex, pBuffer->nInputPortIndex) +#define OMX_TRACE_FILLTHISBUFFER_OUT(hComponent, pBuffer, error) RDebug::Printf("DBGOMX_OUT_FillThisBuffer %X %X %d", hComponent, pBuffer, error) + +#define OMX_TRACE_SETCALLBACKS_IN(hComponent, pCallbacks, pAppData) RDebug::Printf("DBGOMX_SetCallBacks %X %X", hComponent, pCallbacks) +#define OMX_TRACE_SETCALLBACKS_OUT(hComponent, pCallbacks, pAppData, error) RDebug::Printf("DBGOMX_OUT_SetCallBacks %X %X %d", hComponent, pCallbacks, error) + +#define OMX_TRACE_COMPONENTDEINIT_IN(hComponent) RDebug::Printf("DBGOMX_ComponentDeinit %X", hComponent ) +#define OMX_TRACE_COMPONENTDEINIT_OUT(hComponent, error) RDebug::Printf("DBGOMX_OUT_ComponentDeinit %X %d", hComponent, error) + +#define OMX_TRACE_USEEGLIMAGE_IN(hComponent, ppBufferHdr, nPortIndex, pAppPrivate, eglImage) RDebug::Printf("DBGOMX_UseGLImage %X", hComponent) +#define OMX_TRACE_USEEGLIMAGE_OUT(hComponent, ppBufferHdr, nPortIndex, pAppPrivate, eglImage, error) RDebug::Printf("DBGOMX_OUT_UseGLImage %X %d", hComponent, error) + +#define OMX_TRACE_COMPONENTROLEENUM_IN(hComponent, cRole, nIndex) RDebug::Printf("DBGOMX_ComponentRoleEnum %X %s %u", hComponent, cRole, nIndex ) +#define OMX_TRACE_COMPONENTROLEENUM_OUT(hComponent, cRole, nIndex, error) RDebug::Printf("DBGOMX_OUT_ComponentRoleEnum %X %s %u %d", hComponent, cRole, nIndex, error) + + +/* IL CLIENT CALLBACKS */ + + +#define OMX_TRACE_EVENTHANDLER_IN(hComponent, pAppData, eEvent, nData1, nData2, pEventData) RDebug::Printf("DBGOMX_EventHandler %X %d %u %u", hComponent, eEvent, nData1, nData2) +#define OMX_TRACE_EVENTHANDLER_OUT(hComponent, pAppData, eEvent, nData1, nData2, pEventData, error) RDebug::Printf("DBGOMX_OUT_EventHandler %X %d %u %u %d", hComponent, eEvent, nData1, nData2, error) + +#define OMX_TRACE_EMPTYBUFFERDONE_IN(hComponent, pAppData, pBuffer) RDebug::Printf("DBGOMX_EmptyBufferDone %X %X", hComponent, pBuffer ) +#define OMX_TRACE_EMPTYBUFFERDONE_OUT(hComponent, pAppData, pBuffer, error) RDebug::Printf("DBGOMX_OUT_EmptyBufferDone %X %X %d", hComponent, pBuffer, error) + +#define OMX_TRACE_FILLBUFFERDONE_IN(hComponent, pAppData, pBuffer) RDebug::Printf("DBGOMX_FillBufferDone %X %X", hComponent, pBuffer) +#define OMX_TRACE_FILLBUFFERDONE_OUT(hComponent, pAppData, pBuffer, error) RDebug::Printf("DBGOMX_OUT_FillBufferDone %X %X %d", hComponent, pBuffer, error) + + +/* CORE METHODS */ + + +#define OMX_TRACE_INIT_IN() RDebug::Printf("DBGOMX_Init") +#define OMX_TRACE_INIT_OUT(error) RDebug::Printf("DBGOMX_OUT_Init %d", error) + +#define OMX_TRACE_DEINIT_IN() RDebug::Printf("DBGOMX_Deinit") +#define OMX_TRACE_DEINIT_OUT(error) RDebug::Printf("DBGOMX_OUT_Deinit %d", error) + +#define OMX_TRACE_COMPONENTNAMEENUM_IN(cComponentName, nNameLength, nIndex) RDebug::Printf("DBGOMX_ComponentNameEnum %u %u", nNameLength, nIndex ) +#define OMX_TRACE_COMPONENTNAMEENUM_OUT(cComponentName, nNameLength, nIndex, error) RDebug::Printf("DBGOMX_OUT_ComponentNameEnum %u %u %d", nNameLength, nIndex, error) + +#define OMX_TRACE_GETHANDLE_IN(pHandle, cComponentName, pAppData, pCallBacks) RDebug::Printf("DBGOMX_GetHandle %s", cComponentName) +#define OMX_TRACE_GETHANDLE_OUT(pHandle, cComponentName, pAppData, pCallBacks, error) RDebug::Printf("DBGOMX_GetHandle %s %X %d", cComponentName, pHandle, error) + +#define OMX_TRACE_FREEHANDLE_IN(hComponent) RDebug::Printf("DBGOMX_FreeHandle %X 0", hComponent) +#define OMX_TRACE_FREEHANDLE_OUT(hComponent, error) RDebug::Printf("DBGOMX_OUT_FreeHandle %X %d", hComponent, error) + +#define OMX_TRACE_SETUPTUNNEL_IN(hOutput, nPortOutput, hInput, nPortInput) RDebug::Printf("DBGOMX_SetupTunnel %X %d %X %d 0", hOutput, nPortOutput, hInput, nPortInput) +#define OMX_TRACE_SETUPTUNNEL_OUT(hOutput, nPortOutput, hInput, nPortInput, error) RDebug::Printf("DBGOMX_OUT_SetupTunnel %X %d %X %d %d", hOutput, nPortOutput, hInput, nPortInput, error) + +#define OMX_TRACE_GETCONTENTPIPE_IN(hPipe, szURI) RDebug::Printf("DBGOMX_GetContentPipe") +#define OMX_TRACE_GETCONTENTPIPE_OUT(hPipe, szURI, error) RDebug::Printf("DBGOMX_OUT_GetConentPipe %d", error) + +#define OMX_TRACE_GETCOMPONENTSOFROLE_IN(role, pNumComps, compNames) RDebug::Printf("DBGOMX_GetComponentsOfRole %s", role) +#define OMX_TRACE_GETCOMPONENTSOFROLE_OUT(role, pNumComps, compNames, error) RDebug::Printf("DBGOMX_OUT_GetComponentsOfRole %s %d", role, error) + +#define OMX_TRACE_GETROLESOFCOMPONENT_IN(compName, pNumRoles, roles) RDebug::Printf("DBGOMX_GetRolesOfComponent %s", compName) +#define OMX_TRACE_GETROLESOFCOMPONENT_OUT(compName, pNumRoles, roles, error) RDebug::Printf("DBGOMX_OUT_GetRolesOfComponent %s %d", compName, error) + +#elif defined(SYMBIAN_MULTIMEDIA_TURN_TIMING_TRACING_ON) + +#include + +/* COMPONENT ENTRY POINTS */ + +#define OMX_TRACE_GETCOMPONENTVERSION_IN(hComponent, pComponentName, pComponentVersion, pSpecVersion, pComponentUUID) +#define OMX_TRACE_GETCOMPONENTVERSION_OUT(hComponent, pComponentName, pComponentVersion, pSpecVersion, pComponentUUID, error) + +#define OMX_TRACE_SENDCOMMAND_IN(hComponent, Cmd, nParam1, pCmdData) +#define OMX_TRACE_SENDCOMMAND_OUT(hComponent, Cmd, nParam1, pCmdData, error) + +#define OMX_TRACE_GETPARAMETER_IN(hComponent, nParamIndex, pComponentParameterStructure) +#define OMX_TRACE_GETPARAMETER_OUT(hComponent, nParamIndex, pComponentParameterStructure, error) + +#define OMX_TRACE_SETPARAMETER_IN(hComponent, nParamIndex, pComponentParameterStructure) +#define OMX_TRACE_SETPARAMETER_OUT(hComponent, nParamIndex, pComponentParameterStructure, error) + +#define OMX_TRACE_GETCONFIG_IN(hComponent, nParamIndex, pComponentConfigStructure) +#define OMX_TRACE_GETCONFIG_OUT(hComponent, nParamIndex, pComponentConfigStructure, error) + +#define OMX_TRACE_SETCONFIG_IN(hComponent, nParamIndex, pComponentConfigStructure) +#define OMX_TRACE_SETCONFIG_OUT(hComponent, nParamIndex, pComponentConfigStructure, error) + +#define OMX_TRACE_GETEXTENSIONINDEX_IN(hComponent, cParameterName, pIndexType) +#define OMX_TRACE_GETEXTENSIONINDEX_OUT(hComponent, cParameterName, pIndexType, error) + +#define OMX_TRACE_GETSTATE_IN(hComponent, pState) +#define OMX_TRACE_GETSTATE_OUT(hComponent, pState, error) + +#define OMX_TRACE_COMPONENTTUNNELREQUEST_IN(hComp, nPort, hTunneledComp, nTunneledPort, pTunnelSetup) +#define OMX_TRACE_COMPONENTTUNNELREQUEST_OUT(hComp, nPort, hTunneledComp, nTunneledPort, pTunnelSetup, error) + +#define OMX_TRACE_USEBUFFER_IN(hComponent, ppBufferHdr, nPortIndex, pAppPrivate, nSizeBytes, pBuffer) +#define OMX_TRACE_USEBUFFER_OUT(hComponent, ppBufferHdr, nPortIndex, pAppPrivate, nSizeBytes, pBuffer, error) + +#define OMX_TRACE_ALLOCATEBUFFER_IN(hComponent, ppBuffer, nPortIndex, pAppPrivate, nSizeBytes) +#define OMX_TRACE_ALLOCATEBUFFER_OUT(hComponent, ppBuffer, nPortIndex, pAppPrivate, nSizeBytes, error) + +#define OMX_TRACE_FREEBUFFER_IN(hComponent, nPortIndex, pBuffer) +#define OMX_TRACE_FREEBUFFER_OUT(hComponent, nPortIndex, pBuffer, error) + +#define OMX_TRACE_EMPTYTHISBUFFER_IN(hComponent, pBuffer) +#define OMX_TRACE_EMPTYTHISBUFFER_OUT(hComponent, pBuffer, error) + +#define OMX_TRACE_FILLTHISBUFFER_IN(hComponent, pBuffer) +#define OMX_TRACE_FILLTHISBUFFER_OUT(hComponent, pBuffer, error) + +#define OMX_TRACE_SETCALLBACKS_IN(hComponent, pCallbacks, pAppData) +#define OMX_TRACE_SETCALLBACKS_OUT(hComponent, pCallbacks, pAppData, error) + +#define OMX_TRACE_COMPONENTDEINIT_IN(hComponent) +#define OMX_TRACE_COMPONENTDEINIT_OUT(hComponent, error) + +#define OMX_TRACE_USEEGLIMAGE_IN(hComponent, ppBufferHdr, nPortIndex, pAppPrivate, eglImage) +#define OMX_TRACE_USEEGLIMAGE_OUT(hComponent, ppBufferHdr, nPortIndex, pAppPrivate, eglImage, error) + +#define OMX_TRACE_COMPONENTROLEENUM_IN(hComponent, cRole, nIndex) +#define OMX_TRACE_COMPONENTROLEENUM_OUT(hComponent, cRole, nIndex, error) + + +/* IL CLIENT CALLBACKS */ + + +#define OMX_TRACE_EVENTHANDLER_IN(hComponent, pAppData, eEvent, nData1, nData2, pEventData) +#define OMX_TRACE_EVENTHANDLER_OUT(hComponent, pAppData, eEvent, nData1, nData2, pEventData, error) + +#define OMX_TRACE_EMPTYBUFFERDONE_IN(hComponent, pAppData, pBuffer) +#define OMX_TRACE_EMPTYBUFFERDONE_OUT(hComponent, pAppData, pBuffer, error) + +#define OMX_TRACE_FILLBUFFERDONE_IN(hComponent, pAppData, pBuffer) +#define OMX_TRACE_FILLBUFFERDONE_OUT(hComponent, pAppData, pBuffer, error) + + +/* CORE METHODS */ + + +#define OMX_TRACE_INIT_IN() +#define OMX_TRACE_INIT_OUT(error) + +#define OMX_TRACE_DEINIT_IN() +#define OMX_TRACE_DEINIT_OUT(error) + +#define OMX_TRACE_COMPONENTNAMEENUM_IN(cComponentName, nNameLength, nIndex) +#define OMX_TRACE_COMPONENTNAMEENUM_OUT(cComponentName, nNameLength, nIndex, error) + +#define OMX_TRACE_GETHANDLE_IN(pHandle, cComponentName, pAppData, pCallBacks) TUTrace::PrintfPrimary(KTestTraceFilterId, 0, 0, "VPT %x", ETestTraceIdOmxPerformanceTraceGetHandleIn) +#define OMX_TRACE_GETHANDLE_OUT(pHandle, cComponentName, pAppData, pCallBacks, error) TUTrace::PrintfPrimary(KTestTraceFilterId, 0, 0, "VPT %x %x %s", ETestTraceIdOmxPerformanceTraceGetHandleOut, pHandle, cComponentName) + +#define OMX_TRACE_FREEHANDLE_IN(hComponent) +#define OMX_TRACE_FREEHANDLE_OUT(hComponent, error) + +#define OMX_TRACE_SETUPTUNNEL_IN(hOutput, nPortOutput, hInput, nPortInput) TUTrace::PrintfPrimary(KTestTraceFilterId, 0, 0, "VPT %x %x %x %x %x", ETestTraceIdOmxPerformanceTraceSetupTunnelIn, hOutput, nPortOutput, hInput, nPortInput) +#define OMX_TRACE_SETUPTUNNEL_OUT(hOutput, nPortOutput, hInput, nPortInput, error) TUTrace::PrintfPrimary(KTestTraceFilterId, 0, 0, "VPT %x", ETestTraceIdOmxPerformanceTraceSetupTunnelOut) + +#define OMX_TRACE_GETCONTENTPIPE_IN(hPipe, szURI) +#define OMX_TRACE_GETCONTENTPIPE_OUT(hPipe, szURI, error) + +#define OMX_TRACE_GETCOMPONENTSOFROLE_IN(role, pNumComps, compNames) +#define OMX_TRACE_GETCOMPONENTSOFROLE_OUT(role, pNumComps, compNames, error) + +#define OMX_TRACE_GETROLESOFCOMPONENT_IN(compName, pNumRoles, roles) +#define OMX_TRACE_GETROLESOFCOMPONENT_OUT(compName, pNumRoles, roles, error) + +#else + +/* COMPONENT ENTRY POINTS */ + +#define OMX_TRACE_GETCOMPONENTVERSION_IN(hComponent, pComponentName, pComponentVersion, pSpecVersion, pComponentUUID) +#define OMX_TRACE_GETCOMPONENTVERSION_OUT(hComponent, pComponentName, pComponentVersion, pSpecVersion, pComponentUUID, error) + +#define OMX_TRACE_SENDCOMMAND_IN(hComponent, Cmd, nParam1, pCmdData) +#define OMX_TRACE_SENDCOMMAND_OUT(hComponent, Cmd, nParam1, pCmdData, error) + +#define OMX_TRACE_GETPARAMETER_IN(hComponent, nParamIndex, pComponentParameterStructure) +#define OMX_TRACE_GETPARAMETER_OUT(hComponent, nParamIndex, pComponentParameterStructure, error) + +#define OMX_TRACE_SETPARAMETER_IN(hComponent, nParamIndex, pComponentParameterStructure) +#define OMX_TRACE_SETPARAMETER_OUT(hComponent, nParamIndex, pComponentParameterStructure, error) + +#define OMX_TRACE_GETCONFIG_IN(hComponent, nParamIndex, pComponentConfigStructure) +#define OMX_TRACE_GETCONFIG_OUT(hComponent, nParamIndex, pComponentConfigStructure, error) + +#define OMX_TRACE_SETCONFIG_IN(hComponent, nParamIndex, pComponentConfigStructure) +#define OMX_TRACE_SETCONFIG_OUT(hComponent, nParamIndex, pComponentConfigStructure, error) + +#define OMX_TRACE_GETEXTENSIONINDEX_IN(hComponent, cParameterName, pIndexType) +#define OMX_TRACE_GETEXTENSIONINDEX_OUT(hComponent, cParameterName, pIndexType, error) + +#define OMX_TRACE_GETSTATE_IN(hComponent, pState) +#define OMX_TRACE_GETSTATE_OUT(hComponent, pState, error) + +#define OMX_TRACE_COMPONENTTUNNELREQUEST_IN(hComp, nPort, hTunneledComp, nTunneledPort, pTunnelSetup) +#define OMX_TRACE_COMPONENTTUNNELREQUEST_OUT(hComp, nPort, hTunneledComp, nTunneledPort, pTunnelSetup, error) + +#define OMX_TRACE_USEBUFFER_IN(hComponent, ppBufferHdr, nPortIndex, pAppPrivate, nSizeBytes, pBuffer) +#define OMX_TRACE_USEBUFFER_OUT(hComponent, ppBufferHdr, nPortIndex, pAppPrivate, nSizeBytes, pBuffer, error) + +#define OMX_TRACE_ALLOCATEBUFFER_IN(hComponent, ppBuffer, nPortIndex, pAppPrivate, nSizeBytes) +#define OMX_TRACE_ALLOCATEBUFFER_OUT(hComponent, ppBuffer, nPortIndex, pAppPrivate, nSizeBytes, error) + +#define OMX_TRACE_FREEBUFFER_IN(hComponent, nPortIndex, pBuffer) +#define OMX_TRACE_FREEBUFFER_OUT(hComponent, nPortIndex, pBuffer, error) + +#define OMX_TRACE_EMPTYTHISBUFFER_IN(hComponent, pBuffer) +#define OMX_TRACE_EMPTYTHISBUFFER_OUT(hComponent, pBuffer, error) + +#define OMX_TRACE_FILLTHISBUFFER_IN(hComponent, pBuffer) +#define OMX_TRACE_FILLTHISBUFFER_OUT(hComponent, pBuffer, error) + +#define OMX_TRACE_SETCALLBACKS_IN(hComponent, pCallbacks, pAppData) +#define OMX_TRACE_SETCALLBACKS_OUT(hComponent, pCallbacks, pAppData, error) + +#define OMX_TRACE_COMPONENTDEINIT_IN(hComponent) +#define OMX_TRACE_COMPONENTDEINIT_OUT(hComponent, error) + +#define OMX_TRACE_USEEGLIMAGE_IN(hComponent, ppBufferHdr, nPortIndex, pAppPrivate, eglImage) +#define OMX_TRACE_USEEGLIMAGE_OUT(hComponent, ppBufferHdr, nPortIndex, pAppPrivate, eglImage, error) + +#define OMX_TRACE_COMPONENTROLEENUM_IN(hComponent, cRole, nIndex) +#define OMX_TRACE_COMPONENTROLEENUM_OUT(hComponent, cRole, nIndex, error) + + +/* IL CLIENT CALLBACKS */ + + +#define OMX_TRACE_EVENTHANDLER_IN(hComponent, pAppData, eEvent, nData1, nData2, pEventData) +#define OMX_TRACE_EVENTHANDLER_OUT(hComponent, pAppData, eEvent, nData1, nData2, pEventData, error) + +#define OMX_TRACE_EMPTYBUFFERDONE_IN(hComponent, pAppData, pBuffer) +#define OMX_TRACE_EMPTYBUFFERDONE_OUT(hComponent, pAppData, pBuffer, error) + +#define OMX_TRACE_FILLBUFFERDONE_IN(hComponent, pAppData, pBuffer) +#define OMX_TRACE_FILLBUFFERDONE_OUT(hComponent, pAppData, pBuffer, error) + + +/* CORE METHODS */ + + +#define OMX_TRACE_INIT_IN() +#define OMX_TRACE_INIT_OUT(error) + +#define OMX_TRACE_DEINIT_IN() +#define OMX_TRACE_DEINIT_OUT(error) + +#define OMX_TRACE_COMPONENTNAMEENUM_IN(cComponentName, nNameLength, nIndex) +#define OMX_TRACE_COMPONENTNAMEENUM_OUT(cComponentName, nNameLength, nIndex, error) + +#define OMX_TRACE_GETHANDLE_IN(pHandle, cComponentName, pAppData, pCallBacks) +#define OMX_TRACE_GETHANDLE_OUT(pHandle, cComponentName, pAppData, pCallBacks, error) + +#define OMX_TRACE_FREEHANDLE_IN(hComponent) +#define OMX_TRACE_FREEHANDLE_OUT(hComponent, error) + +#define OMX_TRACE_SETUPTUNNEL_IN(hOutput, nPortOutput, hInput, nPortInput) +#define OMX_TRACE_SETUPTUNNEL_OUT(hOutput, nPortOutput, hInput, nPortInput, error) + +#define OMX_TRACE_GETCONTENTPIPE_IN(hPipe, szURI) +#define OMX_TRACE_GETCONTENTPIPE_OUT(hPipe, szURI, error) + +#define OMX_TRACE_GETCOMPONENTSOFROLE_IN(role, pNumComps, compNames) +#define OMX_TRACE_GETCOMPONENTSOFROLE_OUT(role, pNumComps, compNames, error) + +#define OMX_TRACE_GETROLESOFCOMPONENT_IN(compName, pNumRoles, roles) +#define OMX_TRACE_GETROLESOFCOMPONENT_OUT(compName, pNumRoles, roles, error) + +#endif + +#endif // OMX_TRACE_H_ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/traces/OstTraceDefinitions.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/omxilcore/traces/OstTraceDefinitions.h Fri May 07 16:25:23 2010 +0100 @@ -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 +#endif diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/traces/fixed_id.definitions --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/omxilcore/traces/fixed_id.definitions Fri May 07 16:25:23 2010 +0100 @@ -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 diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilcore/traces/trace.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/omxilcore/traces/trace.properties Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,256 @@ + + + +OMX_IndexComponentStartUnused +OMX_IndexParamPriorityMgmt +OMX_IndexParamAudioInit +OMX_IndexParamImageInit +OMX_IndexParamVideoInit +OMX_IndexParamOtherInit +OMX_IndexParamNumAvailableStreams +OMX_IndexParamActiveStream +OMX_IndexParamSuspensionPolicy +OMX_IndexParamComponentSuspended +OMX_IndexConfigCapturing +OMX_IndexConfigCaptureMode +OMX_IndexAutoPauseAfterCapture +OMX_IndexParamContentURI +OMX_IndexParamCustomContentPipe +OMX_IndexParamDisableResourceConcealment +OMX_IndexConfigMetadataItemCount +OMX_IndexConfigContainerNodeCount +OMX_IndexConfigMetadataItem +OMX_IndexConfigCounterNodeID +OMX_IndexParamMetadataFilterType +OMX_IndexParamMetadataKeyFilter +OMX_IndexConfigPriorityMgmt +OMX_IndexParamStandardComponentRole +OMX_IndexPortStartUnused +OMX_IndexParamPortDefinition +OMX_IndexParamCompBufferSupplier +OMX_IndexReservedStartUnused +OMX_IndexAudioStartUnused +OMX_IndexParamAudioPortFormat +OMX_IndexParamAudioPcm +OMX_IndexParamAudioAac +OMX_IndexParamAudioRa +OMX_IndexParamAudioMp3 +OMX_IndexParamAudioAdpcm +OMX_IndexParamAudioG723 +OMX_IndexParamAudioG729 +OMX_IndexParamAudioAmr +OMX_IndexParamAudioWma +OMX_IndexParamAudioSbc +OMX_IndexParamAudioMidi +OMX_IndexParamAudioGsm_FR +OMX_IndexParamAudioMidiLoadUserSound +OMX_IndexParamAudioG726 +OMX_IndexParamAudioGsm_EFR +OMX_IndexParamAudioGsm_HR +OMX_IndexParamAudioPdc_FR +OMX_IndexParamAudioPdc_EFR +OMX_IndexParamAudioPdc_HR +OMX_IndexParamAudioTdma_FR +OMX_IndexParamAudioTdma_EFR +OMX_IndexParamAudioQcelp8 +OMX_IndexParamAudioQcelp13 +OMX_IndexParamAudioEvrc +OMX_IndexParamAudioSmv +OMX_IndexParamAudioVorbis +OMX_IndexConfigAudioMidiImmediateEvent +OMX_IndexConfigAudioMidiControl +OMX_IndexConfigAudioMidiSoundBankProgram +OMX_IndexConfigAudioMidiStatus +OMX_IndexConfigAudioMidiMetaEvent +OMX_IndexConfigAudioMidiMetaEventData +OMX_IndexConfigAudioVolume +OMX_IndexConfigAudioBalance +OMX_IndexConfigAudioChannelMute +OMX_IndexConfigAudioMute +OMX_IndexConfigAudioLoudness +OMX_IndexConfigAudioEchoCancelation +OMX_IndexConfigAudioNoiseReduction +OMX_IndexConfigAudioBass +OMX_IndexConfigAudioTreble +OMX_IndexConfigAudioStereoWidening +OMX_IndexConfigAudioChorus +OMX_IndexConfigAudioEqualizer +OMX_IndexConfigAudioReverberation +OMX_IndexConfigAudioChannelVolume +OMX_IndexImageStartUnused +OMX_IndexParamImagePortFormat +OMX_IndexParamFlashControl +OMX_IndexConfigFocusControl +OMX_IndexParamQFactor +OMX_IndexParamQuantizationTable +OMX_IndexParamHuffmanTable +OMX_IndexConfigFlashControl +OMX_IndexVideoStartUnused +OMX_IndexParamVideoPortFormat +OMX_IndexParamVideoQuantization +OMX_IndexParamVideoFastUpdate +OMX_IndexParamVideoBitrate +OMX_IndexParamVideoMotionVector +OMX_IndexParamVideoIntraRefresh +OMX_IndexParamVideoErrorCorrection +OMX_IndexParamVideoVBSMC +OMX_IndexParamVideoMpeg2 +OMX_IndexParamVideoMpeg4 +OMX_IndexParamVideoWmv +OMX_IndexParamVideoRv +OMX_IndexParamVideoAvc +OMX_IndexParamVideoH263 +OMX_IndexParamVideoProfileLevelQuerySupported +OMX_IndexParamVideoProfileLevelCurrent +OMX_IndexConfigVideoBitrate +OMX_IndexConfigVideoFramerate +OMX_IndexConfigVideoIntraVOPRefresh +OMX_IndexConfigVideoIntraMBRefresh +OMX_IndexConfigVideoMBErrorReporting +OMX_IndexParamVideoMacroblocksPerFrame +OMX_IndexConfigVideoMacroBlockErrorMap +OMX_IndexParamVideoSliceFMO +OMX_IndexConfigVideoAVCIntraPeriod +OMX_IndexConfigVideoNalSize +OMX_IndexCommonStartUnused +OMX_IndexParamCommonDeblocking +OMX_IndexParamCommonSensorMode +OMX_IndexParamCommonInterleave +OMX_IndexConfigCommonColorFormatConversion +OMX_IndexConfigCommonScale +OMX_IndexConfigCommonImageFilter +OMX_IndexConfigCommonColorEnhancement +OMX_IndexConfigCommonColorKey +OMX_IndexConfigCommonColorBlend +OMX_IndexConfigCommonFrameStabilisation +OMX_IndexConfigCommonRotate +OMX_IndexConfigCommonMirror +OMX_IndexConfigCommonOutputPosition +OMX_IndexConfigCommonInputCrop +OMX_IndexConfigCommonOutputCrop +OMX_IndexConfigCommonDigitalZoom +OMX_IndexConfigCommonOpticalZoom +OMX_IndexConfigCommonWhiteBalance +OMX_IndexConfigCommonExposure +OMX_IndexConfigCommonContrast +OMX_IndexConfigCommonBrightness +OMX_IndexConfigCommonBacklight +OMX_IndexConfigCommonGamma +OMX_IndexConfigCommonSaturation +OMX_IndexConfigCommonLightness +OMX_IndexConfigCommonExclusionRect +OMX_IndexConfigCommonDithering +OMX_IndexConfigCommonPlaneBlend +OMX_IndexConfigCommonExposureValue +OMX_IndexConfigCommonOutputSize +OMX_IndexParamCommonExtraQuantData +OMX_IndexConfigCommonFocusRegion +OMX_IndexConfigCommonFocusStatus +OMX_IndexConfigCommonTransitionEffect +OMX_IndexOtherStartUnused +OMX_IndexParamOtherPortFormat +OMX_IndexConfigOtherPower +OMX_IndexConfigOtherStats +OMX_IndexTimeStartUnused +OMX_IndexConfigTimeScale +OMX_IndexConfigTimeClockState +OMX_IndexConfigTimeActiveRefClock +OMX_IndexConfigTimeCurrentMediaTime +OMX_IndexConfigTimeCurrentWallTime +OMX_IndexConfigTimeCurrentAudioReference +OMX_IndexConfigTimeCurrentVideoReference +OMX_IndexConfigTimeMediaTimeRequest +OMX_IndexConfigTimeClientStartTime +OMX_IndexConfigTimePosition +OMX_IndexConfigTimeSeekMode +OMX_IndexKhronosExtensions +OMX_IndexVendorStartUnused +OMX_IndexMax + + +O +OMX_ErrorInsufficientResources +OMX_ErrorUndefined +OMX_ErrorInvalidComponentName +OMX_ErrorComponentNotFound +OMX_ErrorInvalidComponent +OMX_ErrorBadParameter +OMX_ErrorNotImplemented +OMX_ErrorUnderflow +OMX_ErrorOverflow +OMX_ErrorHardware +OMX_ErrorInvalidState +OMX_ErrorStreamCorrupt +OMX_ErrorPortsNotCompatible +OMX_ErrorResourcesLost +OMX_ErrorNoMore +OMX_ErrorVersionMismatch +OMX_ErrorNotReady +OMX_ErrorTimeout +OMX_ErrorSameState +OMX_ErrorResourcesPreempted +OMX_ErrorPortUnresponsiveDuringAllocation +OMX_ErrorPortUnresponsiveDuringDeallocation +OMX_ErrorPortUnresponsiveDuringStop +OMX_ErrorIncorrectStateTransition +OMX_ErrorIncorrectStateOperation +OMX_ErrorUnsupportedSetting +OMX_ErrorUnsupportedIndex +OMX_ErrorBadPortIndex +OMX_ErrorPortUnpopulated +OMX_ErrorComponentSuspended +OMX_ErrorDynamicResourcesUnavailable +OMX_ErrorMbErrorsInFrame +OMX_ErrorFormatNotDetected +OMX_ErrorContentPipeOpenFailed +OMX_ErrorContentPipeCreationFailed +OMX_ErrorSeperateTablesUsed +OMX_ErrorTunnelingUnsupported +OMX_ErrorKhronosExtensions +OMX_ErrorVendorStartUnused +OMX_ErrorMax + + +OMX_CommandStateSet +OMX_CommandFlush +OMX_CommandPortDisable +OMX_CommandPortEnable +OMX_CommandMarkBuffer +OMX_CommandKhronosExtensions +OMX_CommandVendorStartUnused +OMX_CommandMax + + +OMX_StateInvalid +OMX_StateLoaded +OMX_StateIdle +OMX_StateExecuting +OMX_StatePause +OMX_StateWaitForResources +OMX_StateKhronosExtensions +OMX_StateVendorStartUnused +OMX_StateMax + + +OMX_EventCmdComplete +OMX_EventError +OMX_EventMark +OMX_EventPortSettingsChanged +OMX_EventBufferFlag +OMX_EventResourcesAcquired +OMX_EventComponentResumed +OMX_EventDynamicResourcesAvailable +OMX_EventPortFormatDetected +OMX_EventKhronosExtensions +OMX_EventVendorStartUnused +OMX_EventMax + + +OMX_BufferSupplyUnspecified +OMX_BufferSupplyInput +OMX_BufferSupplyOutput +OMX_BufferSupplyKhronosExtensions +OMX_BufferSupplyVendorStartUnused +OMX_BufferSupplyMax + + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilrefcomps/ref_components/audio/pcmrenderer/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/omxilrefcomps/ref_components/audio/pcmrenderer/group/bld.inf Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,25 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +PRJ_MMPFILES +// Components +../mmpfiles/omxilpcmrenderer.mmp + +PRJ_EXPORTS +// Romkit include files +../inc/omxilsymbianaudiopcmextensions.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/extensions/omxilsymbianaudiopcmextensions.h) diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilrefcomps/ref_components/audio/pcmrenderer/inc/omxilsymbianaudiopcmextensions.h --- a/omxil/omxilrefcomps/ref_components/audio/pcmrenderer/inc/omxilsymbianaudiopcmextensions.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilrefcomps/ref_components/audio/pcmrenderer/inc/omxilsymbianaudiopcmextensions.h Fri May 07 16:25:23 2010 +0100 @@ -1,91 +1,91 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -/** - @file - @publishedPartner@prototype -*/ - -#ifndef OMXILSYMBIANAUDIOPCMEXTENSIONS_H -#define OMXILSYMBIANAUDIOPCMEXTENSIONS_H - - -#include - - -/** - * The string that the Symbian's OpenMAX IL PCM Renderer component will - * translate into a 32-bit OpenMAX IL index (@see - * OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP) to support the - * Volume Ramp feature of the MPlayCustomInterface CI - */ -const char sOmxSymbianPcmVolumeRamp [] = - "OMX.Symbian.index.config.audio.pcm.volumeramp"; - - -/** - * Custom index used by Symbian's OpenMAX IL PCM renderer to select the - * structure for setting/getting a Volume Ramp configuration data item - */ -#define OMX_SymbianIndexConfigAudioPcmVolumeRamp 0x7F000002 - - -/** - * Custom OpenMAX IL structure to be used as a container for an - * Volume Ramp configuration data item - */ -struct OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP - { - OMX_U32 nSize; /**< Size of this structure, in Bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Port that this structure applies to */ - OMX_U64 nRampDuration; /**< the period, in microseconds, over which the volume level is - to rise smoothly from nothing to the - required volume level */ - }; - -/** - * The string that the Symbian's OpenMAX IL PCM Renderer component will - * translate into a 32-bit OpenMAX IL index (@see - * OMX_SYMBIAN_AUDIO_CONFIG_PCM_BYTESPLAYED) to support the - * Bytes Played feature of the MPlayCustomInterface CI - */ -const char sOmxSymbianPcmBytesPlayed [] = - "OMX.Symbian.index.config.audio.pcm.bytesplayed"; - - -/** - * Custom index used by Symbian's OpenMAX IL PCM renderer to select the - * structure for getting a Bytes Played configuration data item - */ -#define OMX_SymbianIndexConfigAudioBytesPlayed 0x7F000003 - - -/** - * Custom OpenMAX IL structure to be used as a container for an - * Bytes Played configuration data item - */ -struct OMX_SYMBIAN_AUDIO_CONFIG_PCM_BYTESPLAYED - { - OMX_U32 nSize; /**< Size of this structure, in Bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nBytesPlayed; /**< the number of bytes played */ - }; - - -#endif // OMXILSYMBIANAUDIOPCMEXTENSIONS_H +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +/** + @file + @publishedPartner@prototype +*/ + +#ifndef OMXILSYMBIANAUDIOPCMEXTENSIONS_H +#define OMXILSYMBIANAUDIOPCMEXTENSIONS_H + + +#include + + +/** + * The string that the Symbian's OpenMAX IL PCM Renderer component will + * translate into a 32-bit OpenMAX IL index (@see + * OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP) to support the + * Volume Ramp feature of the MPlayCustomInterface CI + */ +const char sOmxSymbianPcmVolumeRamp [] = + "OMX.Symbian.index.config.audio.pcm.volumeramp"; + + +/** + * Custom index used by Symbian's OpenMAX IL PCM renderer to select the + * structure for setting/getting a Volume Ramp configuration data item + */ +#define OMX_SymbianIndexConfigAudioPcmVolumeRamp 0x7F000002 + + +/** + * Custom OpenMAX IL structure to be used as a container for an + * Volume Ramp configuration data item + */ +struct OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP + { + OMX_U32 nSize; /**< Size of this structure, in Bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nPortIndex; /**< Port that this structure applies to */ + OMX_U64 nRampDuration; /**< the period, in microseconds, over which the volume level is + to rise smoothly from nothing to the + required volume level */ + }; + +/** + * The string that the Symbian's OpenMAX IL PCM Renderer component will + * translate into a 32-bit OpenMAX IL index (@see + * OMX_SYMBIAN_AUDIO_CONFIG_PCM_BYTESPLAYED) to support the + * Bytes Played feature of the MPlayCustomInterface CI + */ +const char sOmxSymbianPcmBytesPlayed [] = + "OMX.Symbian.index.config.audio.pcm.bytesplayed"; + + +/** + * Custom index used by Symbian's OpenMAX IL PCM renderer to select the + * structure for getting a Bytes Played configuration data item + */ +#define OMX_SymbianIndexConfigAudioBytesPlayed 0x7F000003 + + +/** + * Custom OpenMAX IL structure to be used as a container for an + * Bytes Played configuration data item + */ +struct OMX_SYMBIAN_AUDIO_CONFIG_PCM_BYTESPLAYED + { + OMX_U32 nSize; /**< Size of this structure, in Bytes */ + OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ + OMX_U32 nBytesPlayed; /**< the number of bytes played */ + }; + + +#endif // OMXILSYMBIANAUDIOPCMEXTENSIONS_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilrefcomps/ref_components/audio/pcmrenderer/mmpfiles/omxilpcmrenderer.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/omxilrefcomps/ref_components/audio/pcmrenderer/mmpfiles/omxilpcmrenderer.mmp Fri May 07 16:25:23 2010 +0100 @@ -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: +// @file +// @SYMPurpose +// +// + +#include "../src/omxilpcmrenderer.hrh" + +TARGET omxilpcmrenderer.dll +CAPABILITY ALL -TCB +TARGETTYPE plugin +UID 0x10009D8D KUidSymbianOmxILPcmRendererDll +VENDORID 0x70000001 + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN + +USERINCLUDE ../src +USERINCLUDE ../inc +USERINCLUDE ../../../../../omxilcomponentcommon/src/common + +// the following is an internalTechnology link +USERINCLUDE ../../../../../../../mm/mmdevicefw/mdf/src/audio/mdasoundadapter + +SOURCEPATH ../src +SOURCE omxilpcmrenderer.cpp +SOURCE omxilpcmrendererapb0port.cpp +SOURCE omxilpcmrendererprocessingfunction.cpp +SOURCE omxilpcmrendererconfigmanager.cpp + +RESOURCE omxilpcmrenderer.rss + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY omxilcomponentcommon.lib +STATICLIBRARY omxilcomponentif.lib +#ifdef SYMBIAN_MDF_SHAREDCHUNK_SOUNDDRIVER +LIBRARY mdasoundadapter.lib + +#endif + +// Uncomment to activate debug tracing in this module +// MACRO _OMXIL_PCMRENDERER_DEBUG_TRACING_ON + +// Uncomment to enable MIME type checking during tunnel compatibility checks +// MACRO _OMXIL_PCMRENDERER_CHECK_MIME_TYPE_ON + +// MACRO _OMXIL_PCMRENDERER_INCONTEXT_CALLBACKMANAGER_ON + +SMPSAFE diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilrefcomps/ref_components/audio/pcmrenderer/src/log.h --- a/omxil/omxilrefcomps/ref_components/audio/pcmrenderer/src/log.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilrefcomps/ref_components/audio/pcmrenderer/src/log.h Fri May 07 16:25:23 2010 +0100 @@ -1,153 +1,153 @@ -/* -* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef __PCMRENDERER_LOG_H__ -#define __PCMRENDERER_LOG_H__ - -#include - -namespace DSD -{ - -#ifdef _DEBUG - -#ifdef _OMXIL_PCMRENDERER_DEBUG_TRACING_ON - -#define DEBUG_PRINTF(a) {DSD::DebugPrintf(__LINE__, __FILE__, a);} -#define DEBUG_PRINTF2(a, b) {DSD::DebugPrintf(__LINE__, __FILE__, a, b);} -#define DEBUG_PRINTF3(a, b, c) {DSD::DebugPrintf(__LINE__, __FILE__, a, b, c);} -#define DEBUG_PRINTF4(a, b, c, d) {DSD::DebugPrintf(__LINE__, __FILE__, a, b, c, d);} -#define DEBUG_PRINTF5(a, b, c, d, e) {DSD::DebugPrintf(__LINE__, __FILE__, a, b, c, d, e);} - -#define DEBUG_CODE_SECTION(a) TRAP_IGNORE({ a; }) - -class TTruncateOverflowHandler16 : public TDes16Overflow - { - public: - virtual void Overflow( TDes16& aDes ); - }; - -inline void TTruncateOverflowHandler16::Overflow( TDes16& aDes) - { - _LIT(KErrOverflowMsg,"Descriptor Overflow, hence value truncated"); - if( aDes.MaxLength() >= KErrOverflowMsg().Length() + aDes.Length() ) - aDes.Append(KErrOverflowMsg); - } - -class TTruncateOverflowHandler8 : public TDes8Overflow - { - public: - virtual void Overflow( TDes8& aDes ); - }; - -inline void TTruncateOverflowHandler8::Overflow( TDes8& aDes) - { - _LIT(KErrOverflowMsg,"Descriptor Overflow, hence value truncated"); - if( aDes.MaxLength() >= KErrOverflowMsg().Length() + aDes.Length() ) - aDes.Append(KErrOverflowMsg); - } - -// UTF-8 overload of the DebufPrintf method. Should be used by default, -// since it's cheaper both in CPU cycles and stack space. - -inline void DebugPrintf(TInt aLine, char* aFile, TRefByValue aFormat, ...) - { - TTruncateOverflowHandler8 overflowHandler8; - VA_LIST list; - //coverity[var_decl] - // Disabled Coverity warning, since it does not support vararg and throws a warning - VA_START(list, aFormat); - - TTime now; - now.HomeTime(); - - TBuf8<1024> buffer; - _LIT8(KSwiLogPrefix, "[pcmrend] "); - _LIT8(KSwiLineFileFormat, "TID[%d] : [%s:%d] -- "); - buffer.Append(KSwiLogPrefix); - RThread thread; - TUint threadId = thread.Id(); - thread.Close(); - RProcess proc; - TFileName fName = proc.FileName(); - proc.Close(); - buffer.AppendFormat(KSwiLineFileFormat, threadId, aFile, aLine); - buffer.AppendFormatList(aFormat, list ,&overflowHandler8 ); - // coverity[uninit_use_in_call] - // See comment on Coverity at the start of the function. The comment above silences a Coverity false positive - buffer.Append(_L8("\r\n")); - - RDebug::RawPrint(buffer); - - VA_END(list); - } - -// Unicode DebufPrintf overload - -inline void DebugPrintf(TInt aLine, char* aFile, TRefByValue aFormat, ...) - { - TTruncateOverflowHandler16 overflowHandler16; - VA_LIST list; - VA_START(list, aFormat); - - TTime now; - now.HomeTime(); - - TBuf8<256> header; - _LIT8(KSwiLogPrefix, "[pcmrenderer] "); - _LIT8(KSwiLineFileFormat, "%Ld Line: % 5d, File: %s -- "); - header.Append(KSwiLogPrefix); - header.AppendFormat(KSwiLineFileFormat, now.Int64(), aLine, aFile); - - TBuf<1024> buffer; - buffer.Copy(header); - buffer.AppendFormatList(aFormat, list ,&overflowHandler16); - buffer.Append(_L("\r\n")); - - RDebug::RawPrint(buffer); - - VA_END(list); - } -#else - -#define DEBUG_PRINTF(a) -#define DEBUG_PRINTF2(a, b) -#define DEBUG_PRINTF3(a, b, c) -#define DEBUG_PRINTF4(a, b, c, d) -#define DEBUG_PRINTF5(a, b, c, d, e) - -#define DEBUG_CODE_SECTION(a) - -#endif - -#else - -#define DEBUG_PRINTF(a) -#define DEBUG_PRINTF2(a, b) -#define DEBUG_PRINTF3(a, b, c) -#define DEBUG_PRINTF4(a, b, c, d) -#define DEBUG_PRINTF5(a, b, c, d, e) - -#define DEBUG_CODE_SECTION(a) - -#endif - - -} // namespace DSD - -#endif // __PCMRENDERER_LOG_H__ +/* +* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef __PCMRENDERER_LOG_H__ +#define __PCMRENDERER_LOG_H__ + +#include + +namespace DSD +{ + +#ifdef _DEBUG + +#ifdef _OMXIL_PCMRENDERER_DEBUG_TRACING_ON + +#define DEBUG_PRINTF(a) {DSD::DebugPrintf(__LINE__, __FILE__, a);} +#define DEBUG_PRINTF2(a, b) {DSD::DebugPrintf(__LINE__, __FILE__, a, b);} +#define DEBUG_PRINTF3(a, b, c) {DSD::DebugPrintf(__LINE__, __FILE__, a, b, c);} +#define DEBUG_PRINTF4(a, b, c, d) {DSD::DebugPrintf(__LINE__, __FILE__, a, b, c, d);} +#define DEBUG_PRINTF5(a, b, c, d, e) {DSD::DebugPrintf(__LINE__, __FILE__, a, b, c, d, e);} + +#define DEBUG_CODE_SECTION(a) TRAP_IGNORE({ a; }) + +class TTruncateOverflowHandler16 : public TDes16Overflow + { + public: + virtual void Overflow( TDes16& aDes ); + }; + +inline void TTruncateOverflowHandler16::Overflow( TDes16& aDes) + { + _LIT(KErrOverflowMsg,"Descriptor Overflow, hence value truncated"); + if( aDes.MaxLength() >= KErrOverflowMsg().Length() + aDes.Length() ) + aDes.Append(KErrOverflowMsg); + } + +class TTruncateOverflowHandler8 : public TDes8Overflow + { + public: + virtual void Overflow( TDes8& aDes ); + }; + +inline void TTruncateOverflowHandler8::Overflow( TDes8& aDes) + { + _LIT(KErrOverflowMsg,"Descriptor Overflow, hence value truncated"); + if( aDes.MaxLength() >= KErrOverflowMsg().Length() + aDes.Length() ) + aDes.Append(KErrOverflowMsg); + } + +// UTF-8 overload of the DebufPrintf method. Should be used by default, +// since it's cheaper both in CPU cycles and stack space. + +inline void DebugPrintf(TInt aLine, char* aFile, TRefByValue aFormat, ...) + { + TTruncateOverflowHandler8 overflowHandler8; + VA_LIST list; + //coverity[var_decl] + // Disabled Coverity warning, since it does not support vararg and throws a warning + VA_START(list, aFormat); + + TTime now; + now.HomeTime(); + + TBuf8<1024> buffer; + _LIT8(KSwiLogPrefix, "[pcmrend] "); + _LIT8(KSwiLineFileFormat, "TID[%d] : [%s:%d] -- "); + buffer.Append(KSwiLogPrefix); + RThread thread; + TUint threadId = thread.Id(); + thread.Close(); + RProcess proc; + TFileName fName = proc.FileName(); + proc.Close(); + buffer.AppendFormat(KSwiLineFileFormat, threadId, aFile, aLine); + buffer.AppendFormatList(aFormat, list ,&overflowHandler8 ); + // coverity[uninit_use_in_call] + // See comment on Coverity at the start of the function. The comment above silences a Coverity false positive + buffer.Append(_L8("\r\n")); + + RDebug::RawPrint(buffer); + + VA_END(list); + } + +// Unicode DebufPrintf overload + +inline void DebugPrintf(TInt aLine, char* aFile, TRefByValue aFormat, ...) + { + TTruncateOverflowHandler16 overflowHandler16; + VA_LIST list; + VA_START(list, aFormat); + + TTime now; + now.HomeTime(); + + TBuf8<256> header; + _LIT8(KSwiLogPrefix, "[pcmrenderer] "); + _LIT8(KSwiLineFileFormat, "%Ld Line: % 5d, File: %s -- "); + header.Append(KSwiLogPrefix); + header.AppendFormat(KSwiLineFileFormat, now.Int64(), aLine, aFile); + + TBuf<1024> buffer; + buffer.Copy(header); + buffer.AppendFormatList(aFormat, list ,&overflowHandler16); + buffer.Append(_L("\r\n")); + + RDebug::RawPrint(buffer); + + VA_END(list); + } +#else + +#define DEBUG_PRINTF(a) +#define DEBUG_PRINTF2(a, b) +#define DEBUG_PRINTF3(a, b, c) +#define DEBUG_PRINTF4(a, b, c, d) +#define DEBUG_PRINTF5(a, b, c, d, e) + +#define DEBUG_CODE_SECTION(a) + +#endif + +#else + +#define DEBUG_PRINTF(a) +#define DEBUG_PRINTF2(a, b) +#define DEBUG_PRINTF3(a, b, c) +#define DEBUG_PRINTF4(a, b, c, d) +#define DEBUG_PRINTF5(a, b, c, d, e) + +#define DEBUG_CODE_SECTION(a) + +#endif + + +} // namespace DSD + +#endif // __PCMRENDERER_LOG_H__ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilrefcomps/ref_components/audio/pcmrenderer/src/omxilpcmrenderer.cpp --- a/omxil/omxilrefcomps/ref_components/audio/pcmrenderer/src/omxilpcmrenderer.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilrefcomps/ref_components/audio/pcmrenderer/src/omxilpcmrenderer.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,259 +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: -* -*/ - - -/** - @file - @internalComponent -*/ - -#include "omxilcallbackmanager.h" -#include "omxilfsm.h" -#include "omxilportmanager.h" -#include "omxilspecversion.h" -#include "omxilclientclockport.h" -#include -#include "log.h" -#include "omxilpcmrenderer.h" -#include "omxilpcmrendererapb0port.h" -#include "omxilpcmrendererprocessingfunction.h" -#include "omxilpcmrendererconfigmanager.h" -#include "omxilpcmrenderer.hrh" - - -const TUint8 COmxILPcmRenderer::iComponentVersionMajor; -const TUint8 COmxILPcmRenderer::iComponentVersionMinor; -const TUint8 COmxILPcmRenderer::iComponentVersionRevision; -const TUint8 COmxILPcmRenderer::iComponentVersionStep; - - -OMXIL_COMPONENT_ECOM_ENTRYPOINT(KUidSymbianOmxILPcmRenderer); - -// Component Entry Point -OMX_ERRORTYPE OMX_ComponentInit(OMX_HANDLETYPE aComponent) - { - // This method should be called as a result of a OMX_GetHandle call. Let's - // return something that is consistent with the return codes allowed for - // that API call. - return COmxILComponent::SymbianErrorToGetHandleError(COmxILPcmRenderer::CreateComponent(aComponent)); - } - - -TInt COmxILPcmRenderer::CreateComponent(OMX_HANDLETYPE aComponent) - { - DEBUG_PRINTF(_L8("COmxILPcmRenderer::CreateComponent")); - - COmxILPcmRenderer* self = new COmxILPcmRenderer(); - - if (!self) - { - return KErrNoMemory; - } - - TRAPD(err, self->ConstructL(aComponent)); - if (err != KErrNone) - { - delete self; - } - return err; - - } - -void COmxILPcmRenderer::ConstructL(OMX_HANDLETYPE aComponent) - { - DEBUG_PRINTF(_L8("COmxILPcmRenderer::ConstructL")); - - // STEP 1: Initialize the data received from the IL Core - ipHandle = static_cast(aComponent); - ipAppData = 0; - ipCallbacks = 0; - - // STEP 2: Create the call backs manager... - -#ifdef _OMXIL_PCMRENDERER_INCONTEXT_CALLBACKMANAGER_ON - ipCallbackManager = - COmxILInContextCallbackManager::NewL(ipHandle, ipAppData, ipCallbacks); -#else - ipCallbackManager = - COmxILCallbackManager::NewL(ipHandle, ipAppData, ipCallbacks); -#endif - - // STEP 3: Create the PCM renderer-specific Processing Function... - - // ...create PCM renderer component Client Clock port - iClientClockPort = ConstructClientClockPortL(); - - ipProcessingFunction = - COmxILPcmRendererProcessingFunction::NewL(*ipCallbackManager, *iClientClockPort); - - // STEP 4: Create Port manager... - ipPortManager = COmxILPortManager::NewL - ( - *ipProcessingFunction, // The component's processing function - *ipCallbackManager, // The call back manager object - iOmxILVersion, // Component's OMX Version - 1, // The number of audio ports in this component - KPCMRENDERER_APB0PORT_INDEX, // The starting audio port index - 0, // The number of image ports in this component - 0, // The starting image port index - 0, // The number of video ports in this component - 0, // The starting video port index - 1, // The number of other ports in this component - KPCMRENDERER_OPB0PORT_INDEX // The starting other port index - ); - - // ...create PCM renderer component ports (no OPB0 port) - ipb0Port = ConstructAPB0PortL(); - - // .. and add them to the port manager... - User::LeaveIfError(ipPortManager->AddPort(ipb0Port, OMX_DirInput)); - - User::LeaveIfError(ipPortManager->AddPort(iClientClockPort, OMX_DirInput)); - - // STEP 5: Create the non-port related configuration manager... - RPointerArray componentRoles; - CleanupClosePushL(componentRoles); - User::LeaveIfError(componentRoles.Append(&KSymbianOmxILPcmRendererRole())); - - ipConfigManager = COmxILPcmRendererConfigManager::NewL( - *ipPortManager, - *static_cast(ipProcessingFunction), - KSymbianOmxILPcmRendererName, - TOmxILVersion(iComponentVersionMajor, - iComponentVersionMinor, - iComponentVersionRevision, - iComponentVersionStep), - componentRoles); - - CleanupStack::Pop(); // componentRoles - componentRoles.Close(); // Must not destroy pointers - - // STEP 6: Create the FSM object... - ipFsm = COmxILFsm::NewL(*this, - *ipProcessingFunction, - *ipPortManager, - *ipConfigManager, - *ipCallbackManager); - - // And finally, let's get everything started - InitComponentL(); - - } - -COmxILPcmRenderer::COmxILPcmRenderer() - : - iOmxILVersion(TOmxILSpecVersion()) - { - DEBUG_PRINTF(_L8("COmxILPcmRenderer::COmxILPcmRenderer")); - } - -COmxILPcmRenderer::~COmxILPcmRenderer() - { - DEBUG_PRINTF(_L8("COmxILPcmRenderer::~COmxILPcmRenderer")); - - delete ipProcessingFunction; - delete ipPortManager; - delete ipb0Port; - delete iClientClockPort; - delete ipConfigManager; - delete ipFsm; - delete ipCallbackManager; - } - - -COmxILPcmRendererAPB0Port* COmxILPcmRenderer::ConstructAPB0PortL() const - { - DEBUG_PRINTF(_L8("COmxILPcmRenderer::ConstructAPB0PortL")); - - RArray supportedAudioFormats; - CleanupClosePushL(supportedAudioFormats); - supportedAudioFormats.AppendL(OMX_AUDIO_CodingPCM); - - OMX_AUDIO_PARAM_PCMMODETYPE paramPcmModeType; - paramPcmModeType.nSize = sizeof(OMX_AUDIO_PARAM_PCMMODETYPE); - paramPcmModeType.nVersion = iOmxILVersion; - paramPcmModeType.nPortIndex = KPCMRENDERER_APB0PORT_INDEX; - paramPcmModeType.nChannels = KDefaultNumberChannels; - paramPcmModeType.eNumData = OMX_NumericalDataSigned; - paramPcmModeType.eEndian = OMX_EndianBig; - paramPcmModeType.bInterleaved = OMX_TRUE; - paramPcmModeType.nBitPerSample = KDefaultBitPerSample; - paramPcmModeType.nSamplingRate = KDefaultSampleRate; - paramPcmModeType.ePCMMode = OMX_AUDIO_PCMModeLinear; - paramPcmModeType.eChannelMapping[0] = OMX_AUDIO_ChannelLF; - paramPcmModeType.eChannelMapping[1] = OMX_AUDIO_ChannelRF; - - OMX_AUDIO_CONFIG_VOLUMETYPE configAudioVolume; - configAudioVolume.nSize = sizeof(OMX_AUDIO_CONFIG_VOLUMETYPE); - configAudioVolume.nVersion = iOmxILVersion; - configAudioVolume.nPortIndex = KPCMRENDERER_APB0PORT_INDEX; - configAudioVolume.bLinear = OMX_FALSE; - configAudioVolume.sVolume.nValue = 50; - configAudioVolume.sVolume.nMin = 0; - configAudioVolume.sVolume.nMax = 100; - - OMX_AUDIO_CONFIG_MUTETYPE configAudioMute; - configAudioMute.nSize = sizeof(OMX_AUDIO_CONFIG_MUTETYPE); - configAudioMute.nVersion = iOmxILVersion; - configAudioMute.nPortIndex = KPCMRENDERER_APB0PORT_INDEX; - configAudioMute.bMute = OMX_FALSE; - TOmxILCommonPortData portData(iOmxILVersion, // OMX specification version information - KPCMRENDERER_APB0PORT_INDEX,// Port number the structure applies to - OMX_DirInput, // Direction of this port - 1, // The minimum number of buffers this port requires - 15360, // Minimum size, in bytes, for buffers to be used for this port - OMX_PortDomainAudio, // Domain of the port - OMX_FALSE, // Buffers contiguous requirement (true or false) - 0, // Buffer aligment requirements - OMX_BufferSupplyInput, // supplier preference when tunneling between two ports - // This component is a sink component so there's no need to - // propagate buffer marks received on input ports - COmxILPort:: KBufferMarkPropagationPortNotNeeded); - - COmxILPcmRendererAPB0Port* apb0Port = COmxILPcmRendererAPB0Port::NewL(portData, - supportedAudioFormats, - paramPcmModeType, - configAudioVolume, - configAudioMute); - - CleanupStack::PopAndDestroy(&supportedAudioFormats); - return apb0Port; - } - -COmxILClientClockPort* COmxILPcmRenderer::ConstructClientClockPortL() const - { - DEBUG_PRINTF(_L8("COmxILPcmRenderer::ConstructClientClockPortL")); - - TOmxILCommonPortData portData(iOmxILVersion, - KPCMRENDERER_OPB0PORT_INDEX, // port index - OMX_DirInput, - 4, // minimum number of buffers - sizeof(OMX_TIME_MEDIATIMETYPE), // minimum buffer size, in bytes - OMX_PortDomainOther, - OMX_FALSE, // do not need contigious buffers - 0, // byte alignment - OMX_BufferSupplyUnspecified, - COmxILPort::KBufferMarkPropagationPortNotNeeded); - - RArray supportedOtherFormats; - CleanupClosePushL(supportedOtherFormats); - supportedOtherFormats.AppendL(OMX_OTHER_FormatTime); - COmxILClientClockPort* aClientClockPort = COmxILClientClockPort::NewL(portData, supportedOtherFormats); - CleanupStack::PopAndDestroy(&supportedOtherFormats); - - return aClientClockPort; - } +/* +* 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 +*/ + +#ifdef _OMXIL_PCMRENDERER_INCONTEXT_CALLBACKMANAGER_ON +#include "omxilincontextcallbackmanager.h" +#else +#include "omxilcallbackmanager.h" +#endif +#include "omxilfsm.h" +#include "omxilportmanager.h" +#include "omxilspecversion.h" +#include "omxilclientclockport.h" +#include +#include "log.h" +#include "omxilpcmrenderer.h" +#include "omxilpcmrendererapb0port.h" +#include "omxilpcmrendererprocessingfunction.h" +#include "omxilpcmrendererconfigmanager.h" +#include "omxilpcmrenderer.hrh" + + +const TUint8 COmxILPcmRenderer::iComponentVersionMajor; +const TUint8 COmxILPcmRenderer::iComponentVersionMinor; +const TUint8 COmxILPcmRenderer::iComponentVersionRevision; +const TUint8 COmxILPcmRenderer::iComponentVersionStep; + + +OMXIL_COMPONENT_ECOM_ENTRYPOINT(KUidSymbianOmxILPcmRenderer); + +// Component Entry Point +OMX_ERRORTYPE OMX_ComponentInit(OMX_HANDLETYPE aComponent) + { + // This method should be called as a result of a OMX_GetHandle call. Let's + // return something that is consistent with the return codes allowed for + // that API call. + return COmxILComponent::SymbianErrorToGetHandleError(COmxILPcmRenderer::CreateComponent(aComponent)); + } + + +TInt COmxILPcmRenderer::CreateComponent(OMX_HANDLETYPE aComponent) + { + DEBUG_PRINTF(_L8("COmxILPcmRenderer::CreateComponent")); + + COmxILPcmRenderer* self = new COmxILPcmRenderer(); + + if (!self) + { + return KErrNoMemory; + } + + TRAPD(err, self->ConstructL(aComponent)); + if (err != KErrNone) + { + delete self; + } + return err; + + } + +void COmxILPcmRenderer::ConstructL(OMX_HANDLETYPE aComponent) + { + DEBUG_PRINTF(_L8("COmxILPcmRenderer::ConstructL")); + + // STEP 1: Initialize the data received from the IL Core + ipHandle = static_cast(aComponent); + ipAppData = 0; + ipCallbacks = 0; + + // STEP 2: Create the call backs manager... + +#ifdef _OMXIL_PCMRENDERER_INCONTEXT_CALLBACKMANAGER_ON + ipCallbackManager = + COmxILInContextCallbackManager::NewL(ipHandle, ipAppData, ipCallbacks); +#else + ipCallbackManager = + COmxILCallbackManager::NewL(ipHandle, ipAppData, ipCallbacks); +#endif + + // STEP 3: Create the PCM renderer-specific Processing Function... + + // ...create PCM renderer component Client Clock port + iClientClockPort = ConstructClientClockPortL(); + + ipProcessingFunction = + COmxILPcmRendererProcessingFunction::NewL(*ipCallbackManager, *iClientClockPort); + + // STEP 4: Create Port manager... + ipPortManager = COmxILPortManager::NewL + ( + *ipProcessingFunction, // The component's processing function + *ipCallbackManager, // The call back manager object + iOmxILVersion, // Component's OMX Version + 1, // The number of audio ports in this component + KPCMRENDERER_APB0PORT_INDEX, // The starting audio port index + 0, // The number of image ports in this component + 0, // The starting image port index + 0, // The number of video ports in this component + 0, // The starting video port index + 1, // The number of other ports in this component + KPCMRENDERER_OPB0PORT_INDEX // The starting other port index + ); + + // ...create PCM renderer component ports (no OPB0 port) + ipb0Port = ConstructAPB0PortL(); + + // .. and add them to the port manager... + User::LeaveIfError(ipPortManager->AddPort(ipb0Port, OMX_DirInput)); + + User::LeaveIfError(ipPortManager->AddPort(iClientClockPort, OMX_DirInput)); + + // STEP 5: Create the non-port related configuration manager... + RPointerArray componentRoles; + CleanupClosePushL(componentRoles); + User::LeaveIfError(componentRoles.Append(&KSymbianOmxILPcmRendererRole())); + + ipConfigManager = COmxILPcmRendererConfigManager::NewL( + *ipPortManager, + *static_cast(ipProcessingFunction), + KSymbianOmxILPcmRendererName, + TOmxILVersion(iComponentVersionMajor, + iComponentVersionMinor, + iComponentVersionRevision, + iComponentVersionStep), + componentRoles); + + CleanupStack::Pop(); // componentRoles + componentRoles.Close(); // Must not destroy pointers + + // STEP 6: Create the FSM object... + ipFsm = COmxILFsm::NewL(*this, + *ipProcessingFunction, + *ipPortManager, + *ipConfigManager, + *ipCallbackManager); + + // And finally, let's get everything started + InitComponentL(); + + } + +COmxILPcmRenderer::COmxILPcmRenderer() + : + iOmxILVersion(TOmxILSpecVersion()) + { + DEBUG_PRINTF(_L8("COmxILPcmRenderer::COmxILPcmRenderer")); + } + +COmxILPcmRenderer::~COmxILPcmRenderer() + { + DEBUG_PRINTF(_L8("COmxILPcmRenderer::~COmxILPcmRenderer")); + + delete ipProcessingFunction; + delete ipPortManager; + delete ipb0Port; + delete iClientClockPort; + delete ipConfigManager; + delete ipFsm; + delete ipCallbackManager; + } + + +COmxILPcmRendererAPB0Port* COmxILPcmRenderer::ConstructAPB0PortL() const + { + DEBUG_PRINTF(_L8("COmxILPcmRenderer::ConstructAPB0PortL")); + + RArray supportedAudioFormats; + CleanupClosePushL(supportedAudioFormats); + supportedAudioFormats.AppendL(OMX_AUDIO_CodingPCM); + + OMX_AUDIO_PARAM_PCMMODETYPE paramPcmModeType; + paramPcmModeType.nSize = sizeof(OMX_AUDIO_PARAM_PCMMODETYPE); + paramPcmModeType.nVersion = iOmxILVersion; + paramPcmModeType.nPortIndex = KPCMRENDERER_APB0PORT_INDEX; + paramPcmModeType.nChannels = KDefaultNumberChannels; + paramPcmModeType.eNumData = OMX_NumericalDataSigned; + paramPcmModeType.eEndian = OMX_EndianBig; + paramPcmModeType.bInterleaved = OMX_TRUE; + paramPcmModeType.nBitPerSample = KDefaultBitPerSample; + paramPcmModeType.nSamplingRate = KDefaultSampleRate; + paramPcmModeType.ePCMMode = OMX_AUDIO_PCMModeLinear; + paramPcmModeType.eChannelMapping[0] = OMX_AUDIO_ChannelLF; + paramPcmModeType.eChannelMapping[1] = OMX_AUDIO_ChannelRF; + + OMX_AUDIO_CONFIG_VOLUMETYPE configAudioVolume; + configAudioVolume.nSize = sizeof(OMX_AUDIO_CONFIG_VOLUMETYPE); + configAudioVolume.nVersion = iOmxILVersion; + configAudioVolume.nPortIndex = KPCMRENDERER_APB0PORT_INDEX; + configAudioVolume.bLinear = OMX_FALSE; + configAudioVolume.sVolume.nValue = 50; + configAudioVolume.sVolume.nMin = 0; + configAudioVolume.sVolume.nMax = 100; + + OMX_AUDIO_CONFIG_MUTETYPE configAudioMute; + configAudioMute.nSize = sizeof(OMX_AUDIO_CONFIG_MUTETYPE); + configAudioMute.nVersion = iOmxILVersion; + configAudioMute.nPortIndex = KPCMRENDERER_APB0PORT_INDEX; + configAudioMute.bMute = OMX_FALSE; + TOmxILCommonPortData portData(iOmxILVersion, // OMX specification version information + KPCMRENDERER_APB0PORT_INDEX,// Port number the structure applies to + OMX_DirInput, // Direction of this port + 1, // The minimum number of buffers this port requires + 15360, // Minimum size, in bytes, for buffers to be used for this port + OMX_PortDomainAudio, // Domain of the port + OMX_FALSE, // Buffers contiguous requirement (true or false) + 0, // Buffer aligment requirements + OMX_BufferSupplyInput, // supplier preference when tunneling between two ports + // This component is a sink component so there's no need to + // propagate buffer marks received on input ports + COmxILPort:: KBufferMarkPropagationPortNotNeeded); + + COmxILPcmRendererAPB0Port* apb0Port = COmxILPcmRendererAPB0Port::NewL(portData, + supportedAudioFormats, + paramPcmModeType, + configAudioVolume, + configAudioMute); + + CleanupStack::PopAndDestroy(&supportedAudioFormats); + return apb0Port; + } + +COmxILClientClockPort* COmxILPcmRenderer::ConstructClientClockPortL() const + { + DEBUG_PRINTF(_L8("COmxILPcmRenderer::ConstructClientClockPortL")); + + TOmxILCommonPortData portData(iOmxILVersion, + KPCMRENDERER_OPB0PORT_INDEX, // port index + OMX_DirInput, + 4, // minimum number of buffers + sizeof(OMX_TIME_MEDIATIMETYPE), // minimum buffer size, in bytes + OMX_PortDomainOther, + OMX_FALSE, // do not need contigious buffers + 0, // byte alignment + OMX_BufferSupplyUnspecified, + COmxILPort::KBufferMarkPropagationPortNotNeeded); + + RArray supportedOtherFormats; + CleanupClosePushL(supportedOtherFormats); + supportedOtherFormats.AppendL(OMX_OTHER_FormatTime); + COmxILClientClockPort* aClientClockPort = COmxILClientClockPort::NewL(portData, supportedOtherFormats); + CleanupStack::PopAndDestroy(&supportedOtherFormats); + + return aClientClockPort; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilrefcomps/ref_components/audio/pcmrenderer/src/omxilpcmrenderer.h --- a/omxil/omxilrefcomps/ref_components/audio/pcmrenderer/src/omxilpcmrenderer.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilrefcomps/ref_components/audio/pcmrenderer/src/omxilpcmrenderer.h Fri May 07 16:25:23 2010 +0100 @@ -1,65 +1,65 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -/** - @file - @internalComponent -*/ - -#ifndef OMXILPCMRENDERER_H -#define OMXILPCMRENDERER_H - -#include "omxilcomponent.h" - -// Forward declarations -class COmxILPcmRendererAPB0Port; -class COmxILClientClockPort; - -NONSHARABLE_CLASS(COmxILPcmRenderer) : public COmxILComponent - { - -public: - - static const TUint8 iComponentVersionMajor = 1; - static const TUint8 iComponentVersionMinor = 0; - static const TUint8 iComponentVersionRevision = 0; - static const TUint8 iComponentVersionStep = 0; - -public: - - static TInt CreateComponent(OMX_HANDLETYPE aComponent); - - ~COmxILPcmRenderer(); - -private: - - COmxILPcmRenderer(); - - void ConstructL(OMX_HANDLETYPE aComponent); - - COmxILPcmRendererAPB0Port* ConstructAPB0PortL() const; - COmxILClientClockPort* ConstructClientClockPortL() const; - -private: - - const OMX_VERSIONTYPE iOmxILVersion; - COmxILPcmRendererAPB0Port* ipb0Port; - COmxILClientClockPort* iClientClockPort; - }; - -#endif // OMXILPCMRENDERER_H +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +/** + @file + @internalComponent +*/ + +#ifndef OMXILPCMRENDERER_H +#define OMXILPCMRENDERER_H + +#include "omxilcomponent.h" + +// Forward declarations +class COmxILPcmRendererAPB0Port; +class COmxILClientClockPort; + +NONSHARABLE_CLASS(COmxILPcmRenderer) : public COmxILComponent + { + +public: + + static const TUint8 iComponentVersionMajor = 1; + static const TUint8 iComponentVersionMinor = 0; + static const TUint8 iComponentVersionRevision = 0; + static const TUint8 iComponentVersionStep = 0; + +public: + + static TInt CreateComponent(OMX_HANDLETYPE aComponent); + + ~COmxILPcmRenderer(); + +private: + + COmxILPcmRenderer(); + + void ConstructL(OMX_HANDLETYPE aComponent); + + COmxILPcmRendererAPB0Port* ConstructAPB0PortL() const; + COmxILClientClockPort* ConstructClientClockPortL() const; + +private: + + const OMX_VERSIONTYPE iOmxILVersion; + COmxILPcmRendererAPB0Port* ipb0Port; + COmxILClientClockPort* iClientClockPort; + }; + +#endif // OMXILPCMRENDERER_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilrefcomps/ref_components/audio/pcmrenderer/src/omxilpcmrenderer.hrh --- a/omxil/omxilrefcomps/ref_components/audio/pcmrenderer/src/omxilpcmrenderer.hrh Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilrefcomps/ref_components/audio/pcmrenderer/src/omxilpcmrenderer.hrh Fri May 07 16:25:23 2010 +0100 @@ -1,25 +1,25 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef OMXILPCMRENDERER_HRH -#define OMXILPCMRENDERER_HRH - -#define KUidSymbianOmxILPcmRendererDll 0x1028349B -#define KUidSymbianOmxILPcmRenderer 0x1028349F - -#endif // OMXILPCMRENDERER_HRH +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef OMXILPCMRENDERER_HRH +#define OMXILPCMRENDERER_HRH + +#define KUidSymbianOmxILPcmRendererDll 0x1028349B +#define KUidSymbianOmxILPcmRenderer 0x1028349F + +#endif // OMXILPCMRENDERER_HRH diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilrefcomps/ref_components/audio/pcmrenderer/src/omxilpcmrenderer.rss --- a/omxil/omxilrefcomps/ref_components/audio/pcmrenderer/src/omxilpcmrenderer.rss Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilrefcomps/ref_components/audio/pcmrenderer/src/omxilpcmrenderer.rss Fri May 07 16:25:23 2010 +0100 @@ -1,45 +1,45 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#include -#include -#include "omxilpcmrenderer.hrh" - -RESOURCE REGISTRY_INFO theInfo - { - dll_uid = KUidSymbianOmxILPcmRendererDll; - interfaces = - { - INTERFACE_INFO - { - interface_uid = KUidOmxILSymbianComponentIf; - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = KUidSymbianOmxILPcmRenderer; - version_no = 1; - display_name = "OMX.SYMBIAN.AUDIO.RENDERER.PCM"; - default_data = "audio_renderer.pcm"; - opaque_data = ""; - } - }; - } - }; - } - +/* +* 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 +#include +#include "omxilpcmrenderer.hrh" + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = KUidSymbianOmxILPcmRendererDll; + interfaces = + { + INTERFACE_INFO + { + interface_uid = KUidOmxILSymbianComponentIf; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KUidSymbianOmxILPcmRenderer; + version_no = 1; + display_name = "OMX.SYMBIAN.AUDIO.RENDERER.PCM"; + default_data = "audio_renderer.pcm"; + opaque_data = ""; + } + }; + } + }; + } + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilrefcomps/ref_components/audio/pcmrenderer/src/omxilpcmrendererapb0port.cpp --- a/omxil/omxilrefcomps/ref_components/audio/pcmrenderer/src/omxilpcmrendererapb0port.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilrefcomps/ref_components/audio/pcmrenderer/src/omxilpcmrendererapb0port.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,582 +1,582 @@ -/* -* 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 -#include "omxilutil.h" -#include "log.h" -#include "omxilpcmrendererapb0port.h" -#include "omxilpcmrendererconst.h" - - -COmxILPcmRendererAPB0Port* -COmxILPcmRendererAPB0Port::NewL( - const TOmxILCommonPortData& aCommonPortData, - const RArray& aSupportedAudioFormats, - const OMX_AUDIO_PARAM_PCMMODETYPE& aParamAudioPcm, - const OMX_AUDIO_CONFIG_VOLUMETYPE& aConfigAudioVolume, - const OMX_AUDIO_CONFIG_MUTETYPE& aConfigAudioMute) - { - DEBUG_PRINTF(_L8("COmxILPcmRendererAPB0Port::NewL")); - - COmxILPcmRendererAPB0Port* self = new (ELeave)COmxILPcmRendererAPB0Port( - aCommonPortData, - aParamAudioPcm, - aConfigAudioVolume, - aConfigAudioMute); - - CleanupStack::PushL(self); - self->ConstructL(aSupportedAudioFormats); - CleanupStack::Pop(self); - return self; - - } - - -void -COmxILPcmRendererAPB0Port::ConstructL(const RArray& aSupportedAudioFormats) - { - DEBUG_PRINTF(_L8("COmxILPcmRendererAPB0Port::ConstructL")); - COmxILAudioPort::ConstructL(aSupportedAudioFormats); - // We have to finish with iParamPortDefinition - iParamPortDefinition.eDomain = OMX_PortDomainAudio; - iParamPortDefinition.format.audio.pNativeRender = 0; - - iMimeTypeBuf.CreateL(KMimeTypeAudioPcm(), KMimeTypeAudioPcm().Length() + 1); - - TUint8* pTUint2 = const_cast(iMimeTypeBuf.PtrZ()); - iParamPortDefinition.format.audio.cMIMEType = reinterpret_cast(pTUint2); - - iParamPortDefinition.format.audio.bFlagErrorConcealment = OMX_FALSE; - iParamPortDefinition.format.audio.eEncoding = OMX_AUDIO_CodingPCM; - - // Init iParamVolumeRamp here... - iConfigVolumeRamp.nSize = sizeof(OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP); - iConfigVolumeRamp.nVersion = TOmxILSpecVersion(); - iConfigVolumeRamp.nPortIndex = iParamPortDefinition.nPortIndex; - iConfigVolumeRamp.nRampDuration = 0; - } - - -COmxILPcmRendererAPB0Port::COmxILPcmRendererAPB0Port( - const TOmxILCommonPortData& aCommonPortData, - const OMX_AUDIO_PARAM_PCMMODETYPE& aParamAudioPcm, - const OMX_AUDIO_CONFIG_VOLUMETYPE& aConfigAudioVolume, - const OMX_AUDIO_CONFIG_MUTETYPE& aConfigAudioMute) - : - COmxILAudioPort(aCommonPortData), - iParamAudioPcm(aParamAudioPcm), - iConfigAudioVolume(aConfigAudioVolume), - iConfigAudioMute(aConfigAudioMute) - { - DEBUG_PRINTF(_L8("COmxILPcmRendererAPB0Port::COmxILPcmRendererAPB0Port")); - } - - -COmxILPcmRendererAPB0Port::~COmxILPcmRendererAPB0Port() - { - DEBUG_PRINTF(_L8("COmxILPcmRendererAPB0Port::~COmxILPcmRendererAPB0Port")); - - CleanUpPort(); - iMimeTypeBuf.Close(); - - } - - -OMX_ERRORTYPE -COmxILPcmRendererAPB0Port::SetFormatInPortDefinition( - const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, - TBool& aUpdateProcessingFunction) - { - DEBUG_PRINTF(_L8("COmxILPcmRendererAPB0Port::SetFormatInPortDefinition")); - // There's no point on chaging the cMIMEType type of this port - // Same thing for pNativeRender and eEncoding - iParamPortDefinition.format.audio.bFlagErrorConcealment = - aPortDefinition.format.audio.bFlagErrorConcealment; - // Error concealment not currently needed at the processing function - aUpdateProcessingFunction = EFalse; - - return OMX_ErrorNone; - - } - - -TBool -COmxILPcmRendererAPB0Port::IsTunnelledPortCompatible( - const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const - { - DEBUG_PRINTF(_L8("COmxILPcmRendererAPB0Port::IsTunnelledPortCompatible")); - - // First, the easy checks... - if(aPortDefinition.eDomain != iParamPortDefinition.eDomain) - { - return EFalse; - } - - if(aPortDefinition.format.audio.eEncoding != OMX_AUDIO_CodingPCM) - { - return EFalse; - } - - TBool retValue = ETrue; - -#ifdef _OMXIL_PCMRENDERER_CHECK_MIME_TYPE_ON - RBuf8 tunnelMimeTypeBuf; - tunnelMimeTypeBuf.Create(KMimeTypeAudioPcm().Length() + 1); - tunnelMimeTypeBuf = - const_cast( - reinterpret_cast(aPortDefinition.format.audio.cMIMEType)); - - - if (iMimeTypeBuf != tunnelMimeTypeBuf) - { - retValue = EFalse; - } - - tunnelMimeTypeBuf.Close(); -#endif - - return retValue; - } - - -OMX_ERRORTYPE -COmxILPcmRendererAPB0Port::GetLocalOmxParamIndexes(RArray& aIndexArray) const - { - DEBUG_PRINTF(_L8("COmxILPcmRendererAPB0Port::GetLocalOmxParamIndexes")); - - // Always collect local indexes from parent - OMX_ERRORTYPE omxRetValue = - COmxILAudioPort::GetLocalOmxParamIndexes(aIndexArray); - - if (OMX_ErrorNone != omxRetValue) - { - return omxRetValue; - } - - TInt err = aIndexArray.InsertInOrder(OMX_IndexParamAudioPcm); - - // Note that index duplication is OK. - if (KErrNone != err && KErrAlreadyExists != err) - { - return OMX_ErrorInsufficientResources; - } - - return OMX_ErrorNone; - - } - -OMX_ERRORTYPE -COmxILPcmRendererAPB0Port::GetLocalOmxConfigIndexes(RArray& aIndexArray) const - { - DEBUG_PRINTF(_L8("COmxILPcmRendererAPB0Port::GetLocalOmxConfigIndexes")); - - // Always collect local indexes from parent - OMX_ERRORTYPE omxRetValue = - COmxILAudioPort::GetLocalOmxConfigIndexes(aIndexArray); - - if (OMX_ErrorNone != omxRetValue) - { - return omxRetValue; - } - - TInt err = aIndexArray.InsertInOrder(OMX_IndexConfigAudioVolume); - - // Note that index duplication is OK. - if (KErrNone == err || KErrAlreadyExists == err) - { - err = aIndexArray.InsertInOrder(OMX_IndexConfigAudioMute); - - if (KErrNone == err || KErrAlreadyExists == err) - { - err = aIndexArray.InsertInOrder( - OMX_SymbianIndexConfigAudioPcmVolumeRamp); - } - - } - - if (KErrNone != err && KErrAlreadyExists != err) - { - return OMX_ErrorInsufficientResources; - } - - return OMX_ErrorNone; - - } - - -OMX_ERRORTYPE -COmxILPcmRendererAPB0Port::GetParameter(OMX_INDEXTYPE aParamIndex, - TAny* apComponentParameterStructure) const - { - DEBUG_PRINTF(_L8("COmxILPcmRendererAPB0Port::GetParameter")); - - OMX_ERRORTYPE omxRetValue = OMX_ErrorNone; - switch(aParamIndex) - { - case OMX_IndexParamAudioPcm: - { - if (OMX_ErrorNone != - (omxRetValue = - TOmxILUtil::CheckOmxStructSizeAndVersion( - apComponentParameterStructure, - sizeof(OMX_AUDIO_PARAM_PCMMODETYPE)))) - { - return omxRetValue; - } - - OMX_AUDIO_PARAM_PCMMODETYPE* pPcmMode - = static_cast( - apComponentParameterStructure); - - *pPcmMode = iParamAudioPcm; - } - break; - - default: - { - // Try the parent's indexes - return COmxILAudioPort::GetParameter(aParamIndex, - apComponentParameterStructure); - } - }; - - return OMX_ErrorNone; - - } - - -OMX_ERRORTYPE -COmxILPcmRendererAPB0Port::SetParameter(OMX_INDEXTYPE aParamIndex, - const TAny* apComponentParameterStructure, - TBool& aUpdateProcessingFunction) - { - DEBUG_PRINTF(_L8("COmxILPcmRendererAPB0Port::SetParameter")); - - aUpdateProcessingFunction = EFalse; - - OMX_ERRORTYPE omxRetValue = OMX_ErrorNone; - switch(aParamIndex) - { - case OMX_IndexParamAudioPcm: - { - if (OMX_ErrorNone != - (omxRetValue = - TOmxILUtil::CheckOmxStructSizeAndVersion( - const_cast(apComponentParameterStructure), - sizeof(OMX_AUDIO_PARAM_PCMMODETYPE)))) - { - return omxRetValue; - } - - const OMX_AUDIO_PARAM_PCMMODETYPE* pPcmMode - = static_cast( - apComponentParameterStructure); - - switch (pPcmMode->nSamplingRate) - { - case 8000 : - case 11025 : - case 12000 : - case 16000 : - case 22050 : - case 24000 : - case 32000 : - case 44100 : - case 48000 : - break; - default: - return OMX_ErrorBadParameter; - } - - switch (pPcmMode->nBitPerSample) - { - case 8 : - case 16 : - break; - default: - return OMX_ErrorBadParameter; - } - - // Set the new default values - if (iParamAudioPcm.nChannels != pPcmMode->nChannels || - iParamAudioPcm.eNumData != pPcmMode->eNumData || - iParamAudioPcm.eEndian != pPcmMode->eEndian || - iParamAudioPcm.bInterleaved != pPcmMode->bInterleaved || - iParamAudioPcm.nBitPerSample != pPcmMode->nBitPerSample || - iParamAudioPcm.nSamplingRate != pPcmMode->nSamplingRate || - iParamAudioPcm.ePCMMode != pPcmMode->ePCMMode) - { - iParamAudioPcm.nChannels = pPcmMode->nChannels; - iParamAudioPcm.eNumData = pPcmMode->eNumData; - iParamAudioPcm.eEndian = pPcmMode->eEndian; - iParamAudioPcm.bInterleaved = pPcmMode->bInterleaved; - iParamAudioPcm.nBitPerSample = pPcmMode->nBitPerSample; - iParamAudioPcm.nSamplingRate = pPcmMode->nSamplingRate; - iParamAudioPcm.ePCMMode = pPcmMode->ePCMMode; - // This is an indication to the PortManager that the processing - // function needs to get updated - aUpdateProcessingFunction = ETrue; - } - - for (TInt i=0; ieChannelMapping[i]) - { - iParamAudioPcm.eChannelMapping[i] = pPcmMode->eChannelMapping[i]; - // This is an indication to the PortManager that the processing - // function needs to get updated - aUpdateProcessingFunction = ETrue; - } - } - - } - break; - default: - { - // Try the parent's indexes - return COmxILAudioPort::SetParameter(aParamIndex, - apComponentParameterStructure, - aUpdateProcessingFunction); - } - }; - - return OMX_ErrorNone; - - } - - -OMX_ERRORTYPE -COmxILPcmRendererAPB0Port::GetConfig(OMX_INDEXTYPE aConfigIndex, - TAny* apComponentConfigStructure) const - { - DEBUG_PRINTF(_L8("COmxILPcmRendererAPB0Port::GetConfig")); - - OMX_ERRORTYPE omxRetValue = OMX_ErrorNone; - switch(aConfigIndex) - { - case OMX_SymbianIndexConfigAudioPcmVolumeRamp: - { - if (OMX_ErrorNone != - (omxRetValue = - TOmxILUtil::CheckOmxStructSizeAndVersion( - apComponentConfigStructure, - sizeof(OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP)))) - { - return omxRetValue; - } - - OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP* - pPcmVolumeRamp - = static_cast< - OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP*>( - apComponentConfigStructure); - - *pPcmVolumeRamp = iConfigVolumeRamp; - } - break; - - case OMX_IndexConfigAudioVolume: - { - if (OMX_ErrorNone != - (omxRetValue = - TOmxILUtil::CheckOmxStructSizeAndVersion( - apComponentConfigStructure, - sizeof(OMX_AUDIO_CONFIG_VOLUMETYPE)))) - { - return omxRetValue; - } - - OMX_AUDIO_CONFIG_VOLUMETYPE* pConfigVolume - = static_cast( - apComponentConfigStructure); - - *pConfigVolume = iConfigAudioVolume; - } - break; - - case OMX_IndexConfigAudioMute: - { - if (OMX_ErrorNone != - (omxRetValue = - TOmxILUtil::CheckOmxStructSizeAndVersion( - apComponentConfigStructure, - sizeof(OMX_AUDIO_CONFIG_MUTETYPE)))) - { - return omxRetValue; - } - - OMX_AUDIO_CONFIG_MUTETYPE* pConfigMute - = static_cast( - apComponentConfigStructure); - - *pConfigMute = iConfigAudioMute; - } - break; - - default: - { - // There's no need to try the parent indexes as we know there isn't any - // other config in the parent audio classes - return OMX_ErrorUnsupportedIndex; - } - }; - - return OMX_ErrorNone; - - } - -OMX_ERRORTYPE -COmxILPcmRendererAPB0Port::SetConfig(OMX_INDEXTYPE aConfigIndex, - const TAny* apComponentConfigStructure, - TBool& aUpdateProcessingFunction) - { - DEBUG_PRINTF(_L8("COmxILPcmRendererAPB0Port::SetConfig")); - - aUpdateProcessingFunction = EFalse; - - OMX_ERRORTYPE omxRetValue = OMX_ErrorNone; - switch(aConfigIndex) - { - case OMX_SymbianIndexConfigAudioPcmVolumeRamp: - { - if (OMX_ErrorNone != - (omxRetValue = - TOmxILUtil::CheckOmxStructSizeAndVersion( - const_cast(apComponentConfigStructure), - sizeof(OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP)))) - { - return omxRetValue; - } - - const OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP* - pPcmVolumeRamp - = static_cast< - const OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP*>( - apComponentConfigStructure); - - if (iConfigVolumeRamp.nRampDuration != pPcmVolumeRamp->nRampDuration) - { - // This is an indication to the PortManager that the processing - // function needs to get updated - aUpdateProcessingFunction = ETrue; - - iConfigVolumeRamp.nRampDuration = pPcmVolumeRamp->nRampDuration; - } - - } - break; - - case OMX_IndexConfigAudioVolume: - { - if (OMX_ErrorNone != - (omxRetValue = - TOmxILUtil::CheckOmxStructSizeAndVersion( - const_cast(apComponentConfigStructure), - sizeof(OMX_AUDIO_CONFIG_VOLUMETYPE)))) - { - return omxRetValue; - } - - const OMX_AUDIO_CONFIG_VOLUMETYPE* pConfigVolume - = static_cast( - apComponentConfigStructure); - - // Set the new default values - if (iConfigAudioVolume.bLinear != pConfigVolume->bLinear || - iConfigAudioVolume.sVolume.nValue != pConfigVolume->sVolume.nValue || - iConfigAudioVolume.sVolume.nMin != pConfigVolume->sVolume.nMin || - iConfigAudioVolume.sVolume.nMax != pConfigVolume->sVolume.nMax) - { - iConfigAudioVolume.bLinear = pConfigVolume->bLinear; - iConfigAudioVolume.sVolume.nValue = pConfigVolume->sVolume.nValue; - iConfigAudioVolume.sVolume.nMin = pConfigVolume->sVolume.nMin; - iConfigAudioVolume.sVolume.nMax = pConfigVolume->sVolume.nMax; - // This is an indication to the PortManager that the processing - // function needs to get updated - aUpdateProcessingFunction = ETrue; - } - - } - break; - case OMX_IndexConfigAudioMute: - { - if (OMX_ErrorNone != - (omxRetValue = - TOmxILUtil::CheckOmxStructSizeAndVersion( - const_cast(apComponentConfigStructure), - sizeof(OMX_AUDIO_CONFIG_MUTETYPE)))) - { - return omxRetValue; - } - - const OMX_AUDIO_CONFIG_MUTETYPE* pConfigMute - = static_cast( - apComponentConfigStructure); - - if (iConfigAudioMute.bMute != pConfigMute->bMute) - { - iConfigAudioMute.bMute = pConfigMute->bMute; - // This is an indication to the PortManager that the processing - // function needs to get updated - aUpdateProcessingFunction = ETrue; - } - - } - break; - default: - { - // There's no need to try the parent indexes as we know there isn't any - // other config in the parent audio classes - return OMX_ErrorUnsupportedIndex; - } - }; - - return OMX_ErrorNone; - } - -OMX_ERRORTYPE -COmxILPcmRendererAPB0Port::GetExtensionIndex( - OMX_STRING aParameterName, - OMX_INDEXTYPE* apIndexType) const - { - DEBUG_PRINTF(_L8("COmxILPcmRendererAPB0Port::GetExtensionIndex")); - - TPtrC8 requestedParameterNamePtr( - const_cast( - reinterpret_cast(aParameterName))); - - TPtrC8 parameterNamePtr( - reinterpret_cast(sOmxSymbianPcmVolumeRamp)); - - if (requestedParameterNamePtr == parameterNamePtr) - { - *apIndexType = - static_cast( - OMX_SymbianIndexConfigAudioPcmVolumeRamp); - - return OMX_ErrorNone; - } - - *apIndexType = OMX_IndexMax; - return OMX_ErrorUnsupportedIndex; - } +/* +* 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 +#include "omxilutil.h" +#include "log.h" +#include "omxilpcmrendererapb0port.h" +#include "omxilpcmrendererconst.h" + + +COmxILPcmRendererAPB0Port* +COmxILPcmRendererAPB0Port::NewL( + const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedAudioFormats, + const OMX_AUDIO_PARAM_PCMMODETYPE& aParamAudioPcm, + const OMX_AUDIO_CONFIG_VOLUMETYPE& aConfigAudioVolume, + const OMX_AUDIO_CONFIG_MUTETYPE& aConfigAudioMute) + { + DEBUG_PRINTF(_L8("COmxILPcmRendererAPB0Port::NewL")); + + COmxILPcmRendererAPB0Port* self = new (ELeave)COmxILPcmRendererAPB0Port( + aCommonPortData, + aParamAudioPcm, + aConfigAudioVolume, + aConfigAudioMute); + + CleanupStack::PushL(self); + self->ConstructL(aSupportedAudioFormats); + CleanupStack::Pop(self); + return self; + + } + + +void +COmxILPcmRendererAPB0Port::ConstructL(const RArray& aSupportedAudioFormats) + { + DEBUG_PRINTF(_L8("COmxILPcmRendererAPB0Port::ConstructL")); + COmxILAudioPort::ConstructL(aSupportedAudioFormats); + // We have to finish with iParamPortDefinition + iParamPortDefinition.eDomain = OMX_PortDomainAudio; + iParamPortDefinition.format.audio.pNativeRender = 0; + + iMimeTypeBuf.CreateL(KMimeTypeAudioPcm(), KMimeTypeAudioPcm().Length() + 1); + + TUint8* pTUint2 = const_cast(iMimeTypeBuf.PtrZ()); + iParamPortDefinition.format.audio.cMIMEType = reinterpret_cast(pTUint2); + + iParamPortDefinition.format.audio.bFlagErrorConcealment = OMX_FALSE; + iParamPortDefinition.format.audio.eEncoding = OMX_AUDIO_CodingPCM; + + // Init iParamVolumeRamp here... + iConfigVolumeRamp.nSize = sizeof(OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP); + iConfigVolumeRamp.nVersion = TOmxILSpecVersion(); + iConfigVolumeRamp.nPortIndex = iParamPortDefinition.nPortIndex; + iConfigVolumeRamp.nRampDuration = 0; + } + + +COmxILPcmRendererAPB0Port::COmxILPcmRendererAPB0Port( + const TOmxILCommonPortData& aCommonPortData, + const OMX_AUDIO_PARAM_PCMMODETYPE& aParamAudioPcm, + const OMX_AUDIO_CONFIG_VOLUMETYPE& aConfigAudioVolume, + const OMX_AUDIO_CONFIG_MUTETYPE& aConfigAudioMute) + : + COmxILAudioPort(aCommonPortData), + iParamAudioPcm(aParamAudioPcm), + iConfigAudioVolume(aConfigAudioVolume), + iConfigAudioMute(aConfigAudioMute) + { + DEBUG_PRINTF(_L8("COmxILPcmRendererAPB0Port::COmxILPcmRendererAPB0Port")); + } + + +COmxILPcmRendererAPB0Port::~COmxILPcmRendererAPB0Port() + { + DEBUG_PRINTF(_L8("COmxILPcmRendererAPB0Port::~COmxILPcmRendererAPB0Port")); + + CleanUpPort(); + iMimeTypeBuf.Close(); + + } + + +OMX_ERRORTYPE +COmxILPcmRendererAPB0Port::SetFormatInPortDefinition( + const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, + TBool& aUpdateProcessingFunction) + { + DEBUG_PRINTF(_L8("COmxILPcmRendererAPB0Port::SetFormatInPortDefinition")); + // There's no point on chaging the cMIMEType type of this port + // Same thing for pNativeRender and eEncoding + iParamPortDefinition.format.audio.bFlagErrorConcealment = + aPortDefinition.format.audio.bFlagErrorConcealment; + // Error concealment not currently needed at the processing function + aUpdateProcessingFunction = EFalse; + + return OMX_ErrorNone; + + } + + +TBool +COmxILPcmRendererAPB0Port::IsTunnelledPortCompatible( + const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const + { + DEBUG_PRINTF(_L8("COmxILPcmRendererAPB0Port::IsTunnelledPortCompatible")); + + // First, the easy checks... + if(aPortDefinition.eDomain != iParamPortDefinition.eDomain) + { + return EFalse; + } + + if(aPortDefinition.format.audio.eEncoding != OMX_AUDIO_CodingPCM) + { + return EFalse; + } + + TBool retValue = ETrue; + +#ifdef _OMXIL_PCMRENDERER_CHECK_MIME_TYPE_ON + RBuf8 tunnelMimeTypeBuf; + tunnelMimeTypeBuf.Create(KMimeTypeAudioPcm().Length() + 1); + tunnelMimeTypeBuf = + const_cast( + reinterpret_cast(aPortDefinition.format.audio.cMIMEType)); + + + if (iMimeTypeBuf != tunnelMimeTypeBuf) + { + retValue = EFalse; + } + + tunnelMimeTypeBuf.Close(); +#endif + + return retValue; + } + + +OMX_ERRORTYPE +COmxILPcmRendererAPB0Port::GetLocalOmxParamIndexes(RArray& aIndexArray) const + { + DEBUG_PRINTF(_L8("COmxILPcmRendererAPB0Port::GetLocalOmxParamIndexes")); + + // Always collect local indexes from parent + OMX_ERRORTYPE omxRetValue = + COmxILAudioPort::GetLocalOmxParamIndexes(aIndexArray); + + if (OMX_ErrorNone != omxRetValue) + { + return omxRetValue; + } + + TInt err = aIndexArray.InsertInOrder(OMX_IndexParamAudioPcm); + + // Note that index duplication is OK. + if (KErrNone != err && KErrAlreadyExists != err) + { + return OMX_ErrorInsufficientResources; + } + + return OMX_ErrorNone; + + } + +OMX_ERRORTYPE +COmxILPcmRendererAPB0Port::GetLocalOmxConfigIndexes(RArray& aIndexArray) const + { + DEBUG_PRINTF(_L8("COmxILPcmRendererAPB0Port::GetLocalOmxConfigIndexes")); + + // Always collect local indexes from parent + OMX_ERRORTYPE omxRetValue = + COmxILAudioPort::GetLocalOmxConfigIndexes(aIndexArray); + + if (OMX_ErrorNone != omxRetValue) + { + return omxRetValue; + } + + TInt err = aIndexArray.InsertInOrder(OMX_IndexConfigAudioVolume); + + // Note that index duplication is OK. + if (KErrNone == err || KErrAlreadyExists == err) + { + err = aIndexArray.InsertInOrder(OMX_IndexConfigAudioMute); + + if (KErrNone == err || KErrAlreadyExists == err) + { + err = aIndexArray.InsertInOrder( + OMX_SymbianIndexConfigAudioPcmVolumeRamp); + } + + } + + if (KErrNone != err && KErrAlreadyExists != err) + { + return OMX_ErrorInsufficientResources; + } + + return OMX_ErrorNone; + + } + + +OMX_ERRORTYPE +COmxILPcmRendererAPB0Port::GetParameter(OMX_INDEXTYPE aParamIndex, + TAny* apComponentParameterStructure) const + { + DEBUG_PRINTF(_L8("COmxILPcmRendererAPB0Port::GetParameter")); + + OMX_ERRORTYPE omxRetValue = OMX_ErrorNone; + switch(aParamIndex) + { + case OMX_IndexParamAudioPcm: + { + if (OMX_ErrorNone != + (omxRetValue = + TOmxILUtil::CheckOmxStructSizeAndVersion( + apComponentParameterStructure, + sizeof(OMX_AUDIO_PARAM_PCMMODETYPE)))) + { + return omxRetValue; + } + + OMX_AUDIO_PARAM_PCMMODETYPE* pPcmMode + = static_cast( + apComponentParameterStructure); + + *pPcmMode = iParamAudioPcm; + } + break; + + default: + { + // Try the parent's indexes + return COmxILAudioPort::GetParameter(aParamIndex, + apComponentParameterStructure); + } + }; + + return OMX_ErrorNone; + + } + + +OMX_ERRORTYPE +COmxILPcmRendererAPB0Port::SetParameter(OMX_INDEXTYPE aParamIndex, + const TAny* apComponentParameterStructure, + TBool& aUpdateProcessingFunction) + { + DEBUG_PRINTF(_L8("COmxILPcmRendererAPB0Port::SetParameter")); + + aUpdateProcessingFunction = EFalse; + + OMX_ERRORTYPE omxRetValue = OMX_ErrorNone; + switch(aParamIndex) + { + case OMX_IndexParamAudioPcm: + { + if (OMX_ErrorNone != + (omxRetValue = + TOmxILUtil::CheckOmxStructSizeAndVersion( + const_cast(apComponentParameterStructure), + sizeof(OMX_AUDIO_PARAM_PCMMODETYPE)))) + { + return omxRetValue; + } + + const OMX_AUDIO_PARAM_PCMMODETYPE* pPcmMode + = static_cast( + apComponentParameterStructure); + + switch (pPcmMode->nSamplingRate) + { + case 8000 : + case 11025 : + case 12000 : + case 16000 : + case 22050 : + case 24000 : + case 32000 : + case 44100 : + case 48000 : + break; + default: + return OMX_ErrorBadParameter; + } + + switch (pPcmMode->nBitPerSample) + { + case 8 : + case 16 : + break; + default: + return OMX_ErrorBadParameter; + } + + // Set the new default values + if (iParamAudioPcm.nChannels != pPcmMode->nChannels || + iParamAudioPcm.eNumData != pPcmMode->eNumData || + iParamAudioPcm.eEndian != pPcmMode->eEndian || + iParamAudioPcm.bInterleaved != pPcmMode->bInterleaved || + iParamAudioPcm.nBitPerSample != pPcmMode->nBitPerSample || + iParamAudioPcm.nSamplingRate != pPcmMode->nSamplingRate || + iParamAudioPcm.ePCMMode != pPcmMode->ePCMMode) + { + iParamAudioPcm.nChannels = pPcmMode->nChannels; + iParamAudioPcm.eNumData = pPcmMode->eNumData; + iParamAudioPcm.eEndian = pPcmMode->eEndian; + iParamAudioPcm.bInterleaved = pPcmMode->bInterleaved; + iParamAudioPcm.nBitPerSample = pPcmMode->nBitPerSample; + iParamAudioPcm.nSamplingRate = pPcmMode->nSamplingRate; + iParamAudioPcm.ePCMMode = pPcmMode->ePCMMode; + // This is an indication to the PortManager that the processing + // function needs to get updated + aUpdateProcessingFunction = ETrue; + } + + for (TInt i=0; ieChannelMapping[i]) + { + iParamAudioPcm.eChannelMapping[i] = pPcmMode->eChannelMapping[i]; + // This is an indication to the PortManager that the processing + // function needs to get updated + aUpdateProcessingFunction = ETrue; + } + } + + } + break; + default: + { + // Try the parent's indexes + return COmxILAudioPort::SetParameter(aParamIndex, + apComponentParameterStructure, + aUpdateProcessingFunction); + } + }; + + return OMX_ErrorNone; + + } + + +OMX_ERRORTYPE +COmxILPcmRendererAPB0Port::GetConfig(OMX_INDEXTYPE aConfigIndex, + TAny* apComponentConfigStructure) const + { + DEBUG_PRINTF(_L8("COmxILPcmRendererAPB0Port::GetConfig")); + + OMX_ERRORTYPE omxRetValue = OMX_ErrorNone; + switch(aConfigIndex) + { + case OMX_SymbianIndexConfigAudioPcmVolumeRamp: + { + if (OMX_ErrorNone != + (omxRetValue = + TOmxILUtil::CheckOmxStructSizeAndVersion( + apComponentConfigStructure, + sizeof(OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP)))) + { + return omxRetValue; + } + + OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP* + pPcmVolumeRamp + = static_cast< + OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP*>( + apComponentConfigStructure); + + *pPcmVolumeRamp = iConfigVolumeRamp; + } + break; + + case OMX_IndexConfigAudioVolume: + { + if (OMX_ErrorNone != + (omxRetValue = + TOmxILUtil::CheckOmxStructSizeAndVersion( + apComponentConfigStructure, + sizeof(OMX_AUDIO_CONFIG_VOLUMETYPE)))) + { + return omxRetValue; + } + + OMX_AUDIO_CONFIG_VOLUMETYPE* pConfigVolume + = static_cast( + apComponentConfigStructure); + + *pConfigVolume = iConfigAudioVolume; + } + break; + + case OMX_IndexConfigAudioMute: + { + if (OMX_ErrorNone != + (omxRetValue = + TOmxILUtil::CheckOmxStructSizeAndVersion( + apComponentConfigStructure, + sizeof(OMX_AUDIO_CONFIG_MUTETYPE)))) + { + return omxRetValue; + } + + OMX_AUDIO_CONFIG_MUTETYPE* pConfigMute + = static_cast( + apComponentConfigStructure); + + *pConfigMute = iConfigAudioMute; + } + break; + + default: + { + // There's no need to try the parent indexes as we know there isn't any + // other config in the parent audio classes + return OMX_ErrorUnsupportedIndex; + } + }; + + return OMX_ErrorNone; + + } + +OMX_ERRORTYPE +COmxILPcmRendererAPB0Port::SetConfig(OMX_INDEXTYPE aConfigIndex, + const TAny* apComponentConfigStructure, + TBool& aUpdateProcessingFunction) + { + DEBUG_PRINTF(_L8("COmxILPcmRendererAPB0Port::SetConfig")); + + aUpdateProcessingFunction = EFalse; + + OMX_ERRORTYPE omxRetValue = OMX_ErrorNone; + switch(aConfigIndex) + { + case OMX_SymbianIndexConfigAudioPcmVolumeRamp: + { + if (OMX_ErrorNone != + (omxRetValue = + TOmxILUtil::CheckOmxStructSizeAndVersion( + const_cast(apComponentConfigStructure), + sizeof(OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP)))) + { + return omxRetValue; + } + + const OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP* + pPcmVolumeRamp + = static_cast< + const OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP*>( + apComponentConfigStructure); + + if (iConfigVolumeRamp.nRampDuration != pPcmVolumeRamp->nRampDuration) + { + // This is an indication to the PortManager that the processing + // function needs to get updated + aUpdateProcessingFunction = ETrue; + + iConfigVolumeRamp.nRampDuration = pPcmVolumeRamp->nRampDuration; + } + + } + break; + + case OMX_IndexConfigAudioVolume: + { + if (OMX_ErrorNone != + (omxRetValue = + TOmxILUtil::CheckOmxStructSizeAndVersion( + const_cast(apComponentConfigStructure), + sizeof(OMX_AUDIO_CONFIG_VOLUMETYPE)))) + { + return omxRetValue; + } + + const OMX_AUDIO_CONFIG_VOLUMETYPE* pConfigVolume + = static_cast( + apComponentConfigStructure); + + // Set the new default values + if (iConfigAudioVolume.bLinear != pConfigVolume->bLinear || + iConfigAudioVolume.sVolume.nValue != pConfigVolume->sVolume.nValue || + iConfigAudioVolume.sVolume.nMin != pConfigVolume->sVolume.nMin || + iConfigAudioVolume.sVolume.nMax != pConfigVolume->sVolume.nMax) + { + iConfigAudioVolume.bLinear = pConfigVolume->bLinear; + iConfigAudioVolume.sVolume.nValue = pConfigVolume->sVolume.nValue; + iConfigAudioVolume.sVolume.nMin = pConfigVolume->sVolume.nMin; + iConfigAudioVolume.sVolume.nMax = pConfigVolume->sVolume.nMax; + // This is an indication to the PortManager that the processing + // function needs to get updated + aUpdateProcessingFunction = ETrue; + } + + } + break; + case OMX_IndexConfigAudioMute: + { + if (OMX_ErrorNone != + (omxRetValue = + TOmxILUtil::CheckOmxStructSizeAndVersion( + const_cast(apComponentConfigStructure), + sizeof(OMX_AUDIO_CONFIG_MUTETYPE)))) + { + return omxRetValue; + } + + const OMX_AUDIO_CONFIG_MUTETYPE* pConfigMute + = static_cast( + apComponentConfigStructure); + + if (iConfigAudioMute.bMute != pConfigMute->bMute) + { + iConfigAudioMute.bMute = pConfigMute->bMute; + // This is an indication to the PortManager that the processing + // function needs to get updated + aUpdateProcessingFunction = ETrue; + } + + } + break; + default: + { + // There's no need to try the parent indexes as we know there isn't any + // other config in the parent audio classes + return OMX_ErrorUnsupportedIndex; + } + }; + + return OMX_ErrorNone; + } + +OMX_ERRORTYPE +COmxILPcmRendererAPB0Port::GetExtensionIndex( + OMX_STRING aParameterName, + OMX_INDEXTYPE* apIndexType) const + { + DEBUG_PRINTF(_L8("COmxILPcmRendererAPB0Port::GetExtensionIndex")); + + TPtrC8 requestedParameterNamePtr( + const_cast( + reinterpret_cast(aParameterName))); + + TPtrC8 parameterNamePtr( + reinterpret_cast(sOmxSymbianPcmVolumeRamp)); + + if (requestedParameterNamePtr == parameterNamePtr) + { + *apIndexType = + static_cast( + OMX_SymbianIndexConfigAudioPcmVolumeRamp); + + return OMX_ErrorNone; + } + + *apIndexType = OMX_IndexMax; + return OMX_ErrorUnsupportedIndex; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilrefcomps/ref_components/audio/pcmrenderer/src/omxilpcmrendererapb0port.h --- a/omxil/omxilrefcomps/ref_components/audio/pcmrenderer/src/omxilpcmrendererapb0port.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilrefcomps/ref_components/audio/pcmrenderer/src/omxilpcmrendererapb0port.h Fri May 07 16:25:23 2010 +0100 @@ -1,93 +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 OMXILPCMRENDERERAPB0PORT_H -#define OMXILPCMRENDERERAPB0PORT_H - -#include "omxilaudioport.h" -#include "omxilsymbianaudiopcmextensions.h" - -class COmxILPcmRendererAPB0Port : public COmxILAudioPort - { - -public: - - static COmxILPcmRendererAPB0Port* NewL( - const TOmxILCommonPortData& aCommonPortData, - const RArray& aSupportedAudioFormats, - const OMX_AUDIO_PARAM_PCMMODETYPE& aParamAudioPcm, - const OMX_AUDIO_CONFIG_VOLUMETYPE& aConfigAudioVolume, - const OMX_AUDIO_CONFIG_MUTETYPE& aConfigAudioMute); - - - ~COmxILPcmRendererAPB0Port(); - - OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray& aIndexArray) const; - - OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray& aIndexArray) const; - - OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex, - TAny* apComponentParameterStructure) const; - - OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex, - const TAny* apComponentParameterStructure, - TBool& aUpdateProcessingFunction); - - OMX_ERRORTYPE GetConfig(OMX_INDEXTYPE aConfigIndex, - TAny* apComponentConfigStructure) const; - - OMX_ERRORTYPE SetConfig(OMX_INDEXTYPE aConfigIndex, - const TAny* apComponentConfigStructure, - TBool& aUpdateProcessingFunction); - - OMX_ERRORTYPE GetExtensionIndex(OMX_STRING aParameterName, - OMX_INDEXTYPE* apIndexType) const; - -protected: - - COmxILPcmRendererAPB0Port( - const TOmxILCommonPortData& aCommonPortData, - const OMX_AUDIO_PARAM_PCMMODETYPE& aParamAudioPcm, - const OMX_AUDIO_CONFIG_VOLUMETYPE& aConfigAudioVolume, - const OMX_AUDIO_CONFIG_MUTETYPE& aConfigAudioMute); - - void ConstructL(const RArray& aSupportedAudioFormats); - - OMX_ERRORTYPE SetFormatInPortDefinition( - const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, - TBool& aUpdateProcessingFunction); - - TBool IsTunnelledPortCompatible( - const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const; - -protected: - - OMX_AUDIO_PARAM_PCMMODETYPE iParamAudioPcm; - OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP iConfigVolumeRamp; - OMX_AUDIO_CONFIG_VOLUMETYPE iConfigAudioVolume; - OMX_AUDIO_CONFIG_MUTETYPE iConfigAudioMute; - RBuf8 iMimeTypeBuf; - - }; - -#endif // OMXILPCMRENDERERAPB0PORT_H +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +/** + @file + @internalComponent +*/ + +#ifndef OMXILPCMRENDERERAPB0PORT_H +#define OMXILPCMRENDERERAPB0PORT_H + +#include "omxilaudioport.h" +#include "omxilsymbianaudiopcmextensions.h" + +class COmxILPcmRendererAPB0Port : public COmxILAudioPort + { + +public: + + static COmxILPcmRendererAPB0Port* NewL( + const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedAudioFormats, + const OMX_AUDIO_PARAM_PCMMODETYPE& aParamAudioPcm, + const OMX_AUDIO_CONFIG_VOLUMETYPE& aConfigAudioVolume, + const OMX_AUDIO_CONFIG_MUTETYPE& aConfigAudioMute); + + + ~COmxILPcmRendererAPB0Port(); + + OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray& aIndexArray) const; + + OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray& aIndexArray) const; + + OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex, + TAny* apComponentParameterStructure) const; + + OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex, + const TAny* apComponentParameterStructure, + TBool& aUpdateProcessingFunction); + + OMX_ERRORTYPE GetConfig(OMX_INDEXTYPE aConfigIndex, + TAny* apComponentConfigStructure) const; + + OMX_ERRORTYPE SetConfig(OMX_INDEXTYPE aConfigIndex, + const TAny* apComponentConfigStructure, + TBool& aUpdateProcessingFunction); + + OMX_ERRORTYPE GetExtensionIndex(OMX_STRING aParameterName, + OMX_INDEXTYPE* apIndexType) const; + +protected: + + COmxILPcmRendererAPB0Port( + const TOmxILCommonPortData& aCommonPortData, + const OMX_AUDIO_PARAM_PCMMODETYPE& aParamAudioPcm, + const OMX_AUDIO_CONFIG_VOLUMETYPE& aConfigAudioVolume, + const OMX_AUDIO_CONFIG_MUTETYPE& aConfigAudioMute); + + void ConstructL(const RArray& aSupportedAudioFormats); + + OMX_ERRORTYPE SetFormatInPortDefinition( + const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, + TBool& aUpdateProcessingFunction); + + TBool IsTunnelledPortCompatible( + const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const; + +protected: + + OMX_AUDIO_PARAM_PCMMODETYPE iParamAudioPcm; + OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP iConfigVolumeRamp; + OMX_AUDIO_CONFIG_VOLUMETYPE iConfigAudioVolume; + OMX_AUDIO_CONFIG_MUTETYPE iConfigAudioMute; + RBuf8 iMimeTypeBuf; + + }; + +#endif // OMXILPCMRENDERERAPB0PORT_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilrefcomps/ref_components/audio/pcmrenderer/src/omxilpcmrendererconfigmanager.cpp --- a/omxil/omxilrefcomps/ref_components/audio/pcmrenderer/src/omxilpcmrendererconfigmanager.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilrefcomps/ref_components/audio/pcmrenderer/src/omxilpcmrendererconfigmanager.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,183 +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 -*/ - -#include "omxilutil.h" -#include "omxilsymbianaudiopcmextensions.h" -#include "log.h" -#include "omxilpcmrendererconfigmanager.h" -#include "omxilpcmrendererprocessingfunction.h" - - - -COmxILPcmRendererConfigManager* -COmxILPcmRendererConfigManager::NewL( - COmxILPortManager& aPortManager, - COmxILPcmRendererProcessingFunction& aProcessingFunction, - const TDesC8& aComponentName, - const OMX_VERSIONTYPE& aComponentVersion, - const RPointerArray& aComponentRoleList) - { - DEBUG_PRINTF(_L8("COmxILPcmRendererConfigManager::NewL")); - ASSERT(aComponentName.Length() && aComponentRoleList.Count()); - - COmxILPcmRendererConfigManager* self = new (ELeave)COmxILPcmRendererConfigManager(aPortManager, aProcessingFunction); - CleanupStack::PushL(self); - self->ConstructL(aComponentName, - aComponentVersion, - aComponentRoleList); - CleanupStack::Pop(self); - return self; - - } - -void -COmxILPcmRendererConfigManager::ConstructL(const TDesC8& aComponentName, - const OMX_VERSIONTYPE& aComponentVersion, - const RPointerArray& aComponentRoleList) - { - DEBUG_PRINTF(_L8("COmxILPcmRendererConfigManager::ConstructL")); - - COmxILConfigManager::ConstructL(aComponentName, aComponentVersion, aComponentRoleList); - - ManagedConfigIndexes().InsertInOrderL(OMX_SymbianIndexConfigAudioBytesPlayed); - } - -COmxILPcmRendererConfigManager::COmxILPcmRendererConfigManager(COmxILPortManager& aPortManager, - COmxILPcmRendererProcessingFunction& aProcessingFunction) - : - COmxILConfigManager(aPortManager), - iProcessingFunction(aProcessingFunction) - { - DEBUG_PRINTF(_L8("COmxILPcmRendererConfigManager::COmxILPcmRendererConfigManager")); - - } - -COmxILPcmRendererConfigManager::~COmxILPcmRendererConfigManager() - { - DEBUG_PRINTF(_L8("COmxILPcmRendererConfigManager::~COmxILPcmRendererConfigManager")); - - } - -OMX_ERRORTYPE -COmxILPcmRendererConfigManager::GetConfig(OMX_INDEXTYPE aConfigIndex, - TAny* apComponentConfigStructure) const - { - DEBUG_PRINTF(_L8("COmxILPcmRendererConfigManager::GetConfig")); - - TInt index = FindConfigIndex(aConfigIndex); - if (KErrNotFound == index) - { - return OMX_ErrorUnsupportedIndex; - } - - OMX_ERRORTYPE omxRetValue = OMX_ErrorNone; - switch(aConfigIndex) - { - case OMX_SymbianIndexConfigAudioBytesPlayed: - { - if (OMX_ErrorNone != - (omxRetValue = - TOmxILUtil::CheckOmxStructSizeAndVersion( - apComponentConfigStructure, - sizeof(OMX_SYMBIAN_AUDIO_CONFIG_PCM_BYTESPLAYED)))) - { - return omxRetValue; - } - - OMX_SYMBIAN_AUDIO_CONFIG_PCM_BYTESPLAYED* - pPcmBytesPlayed - = static_cast< - OMX_SYMBIAN_AUDIO_CONFIG_PCM_BYTESPLAYED*>( - apComponentConfigStructure); - - pPcmBytesPlayed->nBytesPlayed = iProcessingFunction.GetBytesPlayed(); - } - break; - - default: - { - omxRetValue = COmxILConfigManager::GetConfig(aConfigIndex, apComponentConfigStructure); - } - }; - - return omxRetValue; - } - -OMX_ERRORTYPE -COmxILPcmRendererConfigManager::SetConfig(OMX_INDEXTYPE aConfigIndex, - const TAny* apComponentConfigStructure) - - { - DEBUG_PRINTF(_L8("COmxILPcmRendererConfigManager::SetConfig")); - - TInt index = FindConfigIndex(aConfigIndex); - if (KErrNotFound == index) - { - return OMX_ErrorUnsupportedIndex; - } - - OMX_ERRORTYPE omxRetValue = OMX_ErrorNone; - switch(aConfigIndex) - { - case OMX_SymbianIndexConfigAudioBytesPlayed: - { - omxRetValue = OMX_ErrorUnsupportedSetting; - } - break; - - default: - { - omxRetValue = COmxILConfigManager::SetConfig(aConfigIndex, apComponentConfigStructure); - } - }; - - return omxRetValue; - - } - -OMX_ERRORTYPE -COmxILPcmRendererConfigManager::GetExtensionIndex( - OMX_STRING aParameterName, - OMX_INDEXTYPE* apIndexType) const - { - DEBUG_PRINTF(_L8("COmxILPcmRendererConfigManager::GetExtensionIndex")); - - TPtrC8 requestedParameterNamePtr( - const_cast( - reinterpret_cast(aParameterName))); - - TPtrC8 parameterNamePtr( - reinterpret_cast(sOmxSymbianPcmBytesPlayed)); - - if (requestedParameterNamePtr == parameterNamePtr) - { - *apIndexType = - static_cast( - OMX_SymbianIndexConfigAudioBytesPlayed); - - return OMX_ErrorNone; - } - - *apIndexType = OMX_IndexMax; - return OMX_ErrorUnsupportedIndex; - } +/* +* 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 "omxilutil.h" +#include "omxilsymbianaudiopcmextensions.h" +#include "log.h" +#include "omxilpcmrendererconfigmanager.h" +#include "omxilpcmrendererprocessingfunction.h" + + + +COmxILPcmRendererConfigManager* +COmxILPcmRendererConfigManager::NewL( + MOmxILPortManagerIf& aPortManager, + COmxILPcmRendererProcessingFunction& aProcessingFunction, + const TDesC8& aComponentName, + const OMX_VERSIONTYPE& aComponentVersion, + const RPointerArray& aComponentRoleList) + { + DEBUG_PRINTF(_L8("COmxILPcmRendererConfigManager::NewL")); + ASSERT(aComponentName.Length() && aComponentRoleList.Count()); + + COmxILPcmRendererConfigManager* self = new (ELeave)COmxILPcmRendererConfigManager(aPortManager, aProcessingFunction); + CleanupStack::PushL(self); + self->ConstructL(aComponentName, + aComponentVersion, + aComponentRoleList); + CleanupStack::Pop(self); + return self; + + } + +void +COmxILPcmRendererConfigManager::ConstructL(const TDesC8& aComponentName, + const OMX_VERSIONTYPE& aComponentVersion, + const RPointerArray& aComponentRoleList) + { + DEBUG_PRINTF(_L8("COmxILPcmRendererConfigManager::ConstructL")); + + COmxILConfigManager::ConstructL(aComponentName, aComponentVersion, aComponentRoleList); + + ManagedConfigIndexes().InsertInOrderL(OMX_SymbianIndexConfigAudioBytesPlayed); + } + +COmxILPcmRendererConfigManager::COmxILPcmRendererConfigManager(MOmxILPortManagerIf& aPortManager, + COmxILPcmRendererProcessingFunction& aProcessingFunction) + : + COmxILConfigManager(aPortManager), + iProcessingFunction(aProcessingFunction) + { + DEBUG_PRINTF(_L8("COmxILPcmRendererConfigManager::COmxILPcmRendererConfigManager")); + + } + +COmxILPcmRendererConfigManager::~COmxILPcmRendererConfigManager() + { + DEBUG_PRINTF(_L8("COmxILPcmRendererConfigManager::~COmxILPcmRendererConfigManager")); + + } + +OMX_ERRORTYPE +COmxILPcmRendererConfigManager::GetConfig(OMX_INDEXTYPE aConfigIndex, + TAny* apComponentConfigStructure) const + { + DEBUG_PRINTF(_L8("COmxILPcmRendererConfigManager::GetConfig")); + + TInt index = FindConfigIndex(aConfigIndex); + if (KErrNotFound == index) + { + return OMX_ErrorUnsupportedIndex; + } + + OMX_ERRORTYPE omxRetValue = OMX_ErrorNone; + switch(aConfigIndex) + { + case OMX_SymbianIndexConfigAudioBytesPlayed: + { + if (OMX_ErrorNone != + (omxRetValue = + TOmxILUtil::CheckOmxStructSizeAndVersion( + apComponentConfigStructure, + sizeof(OMX_SYMBIAN_AUDIO_CONFIG_PCM_BYTESPLAYED)))) + { + return omxRetValue; + } + + OMX_SYMBIAN_AUDIO_CONFIG_PCM_BYTESPLAYED* + pPcmBytesPlayed + = static_cast< + OMX_SYMBIAN_AUDIO_CONFIG_PCM_BYTESPLAYED*>( + apComponentConfigStructure); + + pPcmBytesPlayed->nBytesPlayed = iProcessingFunction.GetBytesPlayed(); + } + break; + + default: + { + omxRetValue = COmxILConfigManager::GetConfig(aConfigIndex, apComponentConfigStructure); + } + }; + + return omxRetValue; + } + +OMX_ERRORTYPE +COmxILPcmRendererConfigManager::SetConfig(OMX_INDEXTYPE aConfigIndex, + const TAny* apComponentConfigStructure) + + { + DEBUG_PRINTF(_L8("COmxILPcmRendererConfigManager::SetConfig")); + + TInt index = FindConfigIndex(aConfigIndex); + if (KErrNotFound == index) + { + return OMX_ErrorUnsupportedIndex; + } + + OMX_ERRORTYPE omxRetValue = OMX_ErrorNone; + switch(aConfigIndex) + { + case OMX_SymbianIndexConfigAudioBytesPlayed: + { + omxRetValue = OMX_ErrorUnsupportedSetting; + } + break; + + default: + { + omxRetValue = COmxILConfigManager::SetConfig(aConfigIndex, apComponentConfigStructure); + } + }; + + return omxRetValue; + + } + +OMX_ERRORTYPE +COmxILPcmRendererConfigManager::GetExtensionIndex( + OMX_STRING aParameterName, + OMX_INDEXTYPE* apIndexType) const + { + DEBUG_PRINTF(_L8("COmxILPcmRendererConfigManager::GetExtensionIndex")); + + TPtrC8 requestedParameterNamePtr( + const_cast( + reinterpret_cast(aParameterName))); + + TPtrC8 parameterNamePtr( + reinterpret_cast(sOmxSymbianPcmBytesPlayed)); + + if (requestedParameterNamePtr == parameterNamePtr) + { + *apIndexType = + static_cast( + OMX_SymbianIndexConfigAudioBytesPlayed); + + return OMX_ErrorNone; + } + + *apIndexType = OMX_IndexMax; + return OMX_ErrorUnsupportedIndex; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilrefcomps/ref_components/audio/pcmrenderer/src/omxilpcmrendererconfigmanager.h --- a/omxil/omxilrefcomps/ref_components/audio/pcmrenderer/src/omxilpcmrendererconfigmanager.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilrefcomps/ref_components/audio/pcmrenderer/src/omxilpcmrendererconfigmanager.h Fri May 07 16:25:23 2010 +0100 @@ -1,76 +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 -*/ - -#ifndef OMXILPCMRENDERERCONFIGMANAGER_H -#define OMXILPCMRENDERERCONFIGMANAGER_H - -#include "omxilconfigmanager.h" - -// class forwarding -class COmxILPcmRendererProcessingFunction; - -/** - This class is a placeholder for those PCM Renderer parameters and configs that - apply to the component as a whole and not to a specific port in the - component. - */ -NONSHARABLE_CLASS(COmxILPcmRendererConfigManager) : public COmxILConfigManager - { - -public: - - static COmxILPcmRendererConfigManager* NewL( - COmxILPortManager& aPortManager, - COmxILPcmRendererProcessingFunction& aProcessingFunction, - const TDesC8& aComponentName, - const OMX_VERSIONTYPE& aComponentVersion, - const RPointerArray& aComponentRoleList); - - ~COmxILPcmRendererConfigManager(); - - OMX_ERRORTYPE GetConfig( - OMX_INDEXTYPE aConfigIndex, - TAny* apComponentConfigStructure) const; - - OMX_ERRORTYPE SetConfig( - OMX_INDEXTYPE aConfigIndex, - const TAny* apComponentConfigStructure); - - OMX_ERRORTYPE GetExtensionIndex( - OMX_STRING aParameterName, - OMX_INDEXTYPE* apIndexType) const; - -protected: - - COmxILPcmRendererConfigManager(COmxILPortManager& aPortManager, - COmxILPcmRendererProcessingFunction& aProcessingFunction); - - void ConstructL(const TDesC8& aComponentName, - const OMX_VERSIONTYPE& aComponentVersion, - const RPointerArray& aComponentRoleList); - -private: - COmxILPcmRendererProcessingFunction& iProcessingFunction; - }; - -#endif // OMXILPCMRENDERERCONFIGMANAGER_H +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +/** + @file + @internalComponent +*/ + +#ifndef OMXILPCMRENDERERCONFIGMANAGER_H +#define OMXILPCMRENDERERCONFIGMANAGER_H + +#include "omxilconfigmanager.h" + +// class forwarding +class COmxILPcmRendererProcessingFunction; + +/** + This class is a placeholder for those PCM Renderer parameters and configs that + apply to the component as a whole and not to a specific port in the + component. + */ +NONSHARABLE_CLASS(COmxILPcmRendererConfigManager) : public COmxILConfigManager + { + +public: + + static COmxILPcmRendererConfigManager* NewL( + MOmxILPortManagerIf& aPortManager, + COmxILPcmRendererProcessingFunction& aProcessingFunction, + const TDesC8& aComponentName, + const OMX_VERSIONTYPE& aComponentVersion, + const RPointerArray& aComponentRoleList); + + ~COmxILPcmRendererConfigManager(); + + OMX_ERRORTYPE GetConfig( + OMX_INDEXTYPE aConfigIndex, + TAny* apComponentConfigStructure) const; + + OMX_ERRORTYPE SetConfig( + OMX_INDEXTYPE aConfigIndex, + const TAny* apComponentConfigStructure); + + OMX_ERRORTYPE GetExtensionIndex( + OMX_STRING aParameterName, + OMX_INDEXTYPE* apIndexType) const; + +protected: + + COmxILPcmRendererConfigManager(MOmxILPortManagerIf& aPortManager, + COmxILPcmRendererProcessingFunction& aProcessingFunction); + + void ConstructL(const TDesC8& aComponentName, + const OMX_VERSIONTYPE& aComponentVersion, + const RPointerArray& aComponentRoleList); + +private: + COmxILPcmRendererProcessingFunction& iProcessingFunction; + }; + +#endif // OMXILPCMRENDERERCONFIGMANAGER_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilrefcomps/ref_components/audio/pcmrenderer/src/omxilpcmrendererconst.h --- a/omxil/omxilrefcomps/ref_components/audio/pcmrenderer/src/omxilpcmrendererconst.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilrefcomps/ref_components/audio/pcmrenderer/src/omxilpcmrendererconst.h Fri May 07 16:25:23 2010 +0100 @@ -1,60 +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 - @internalComponent -*/ - - -#ifndef OMXILPCMRENDERERCONST_H_ -#define OMXILPCMRENDERERCONST_H_ - -#ifdef SYMBIAN_MDF_SHAREDCHUNK_SOUNDDRIVER - #include "mdasoundadapter.h" -#else - #include -#endif - - -_LIT8(KSymbianOmxILPcmRendererName, "OMX.SYMBIAN.AUDIO.RENDERER.PCM"); -_LIT8(KSymbianOmxILPcmRendererRole, "audio_renderer.pcm"); -_LIT8(KMimeTypeAudioPcm, "audio/pcm"); - -const OMX_U32 KPCMRENDERER_APB0PORT_INDEX = 0; -const OMX_U32 KPCMRENDERER_OPB0PORT_INDEX = 1; - -const TInt KBufferSize = 16384; // we need 16k to hold a pcm packet -const TInt KDefaultSampleRate = 48000; // check out ./boardsupport/omap3variants/tiomap3bsp/variant/common/soundsc/variant_sound.cpp to find out the supporting rates -const TInt KDefaultNumberChannels = 2; -const TInt KDefaultBitPerSample = 16; -const TInt KMaxVolume = 255; -const TInt KMedianVolume = 226; -const TInt KDefaultVolume = KMedianVolume; -const TInt KMinBufferMilliseconds = 100; // Minimum number of milliseconds allowed in a buffer - -// Timeout to call RSoundSc::TimePlayed() every second -// Under normal operation, the timer will return exactly one sec. -// It is particular useful to compare the value from TimePlayed() -static const TInt KPcmRendererTimePlayedDelay = 998113; - -const TBool KDefaultMuted = EFalse; - -const RMdaDevSound::TMdaSoundEncoding KDefaultEncoding = RMdaDevSound::EMdaSoundEncoding16BitPCM; - -#endif /*OMXILPCMRENDERERCONST_H_*/ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +/** + @file + @internalComponent +*/ + + +#ifndef OMXILPCMRENDERERCONST_H_ +#define OMXILPCMRENDERERCONST_H_ + +#ifdef SYMBIAN_MDF_SHAREDCHUNK_SOUNDDRIVER + #include "mdasoundadapter.h" +#else + #include +#endif + + +_LIT8(KSymbianOmxILPcmRendererName, "OMX.SYMBIAN.AUDIO.RENDERER.PCM"); +_LIT8(KSymbianOmxILPcmRendererRole, "audio_renderer.pcm"); +_LIT8(KMimeTypeAudioPcm, "audio/pcm"); + +const OMX_U32 KPCMRENDERER_APB0PORT_INDEX = 0; +const OMX_U32 KPCMRENDERER_OPB0PORT_INDEX = 1; + +const TInt KBufferSize = 16384; // we need 16k to hold a pcm packet +const TInt KDefaultSampleRate = 48000; // check out ./boardsupport/omap3variants/tiomap3bsp/variant/common/soundsc/variant_sound.cpp to find out the supporting rates +const TInt KDefaultNumberChannels = 2; +const TInt KDefaultBitPerSample = 16; +const TInt KMaxVolume = 255; +const TInt KMedianVolume = 226; +const TInt KDefaultVolume = KMedianVolume; +const TInt KMinBufferMilliseconds = 100; // Minimum number of milliseconds allowed in a buffer + +// Timeout to call RSoundSc::TimePlayed() every second +// Under normal operation, the timer will return exactly one sec. +// It is particular useful to compare the value from TimePlayed() +static const TInt KPcmRendererTimePlayedDelay = 998113; + +const TBool KDefaultMuted = EFalse; + +const RMdaDevSound::TMdaSoundEncoding KDefaultEncoding = RMdaDevSound::EMdaSoundEncoding16BitPCM; + +#endif /*OMXILPCMRENDERERCONST_H_*/ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilrefcomps/ref_components/audio/pcmrenderer/src/omxilpcmrendererprocessingfunction.cpp --- a/omxil/omxilrefcomps/ref_components/audio/pcmrenderer/src/omxilpcmrendererprocessingfunction.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilrefcomps/ref_components/audio/pcmrenderer/src/omxilpcmrendererprocessingfunction.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,1651 +1,1691 @@ -/* -* 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 - -#ifdef SYMBIAN_MDF_SHAREDCHUNK_SOUNDDRIVER -#include -#endif //SYMBIAN_MDF_SHAREDCHUNK_SOUNDDRIVER - -#include "log.h" -#include "omxilcallbacknotificationif.h" -#include "omxilclockcomponentcmdsif.h" -#include "omxilsymbianaudiopcmextensions.h" -#include "omxilpcmrendererprocessingfunction.h" - -const TInt COmxILPcmRendererProcessingFunction::CPFHelper::KMaxMsgQueueEntries; - -COmxILPcmRendererProcessingFunction* -COmxILPcmRendererProcessingFunction::NewL(MOmxILCallbackNotificationIf& aCallbacks, - MOmxILClockComponentCmdsIf& aClientClockPort) - { - DEBUG_PRINTF(_L8("COmxILPcmRendererProcessingFunction::NewL")); - - COmxILPcmRendererProcessingFunction* self = - new (ELeave)COmxILPcmRendererProcessingFunction(aCallbacks, aClientClockPort); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - - } - -void -COmxILPcmRendererProcessingFunction::ConstructL() - { - DEBUG_PRINTF(_L8("COmxILPcmRendererProcessingFunction::ConstructL")); - - iAudioDevice = CAudioDevice::NewL(*this); - iPFHelper = CPFHelper::NewL(*iAudioDevice); - } - -COmxILPcmRendererProcessingFunction::COmxILPcmRendererProcessingFunction( - MOmxILCallbackNotificationIf& aCallbacks, - MOmxILClockComponentCmdsIf& aClientClockPort) - : - COmxILProcessingFunction(aCallbacks), - iClientClockPortPtr(&aClientClockPort) - { - DEBUG_PRINTF(_L8("COmxILPcmRendererProcessingFunction::COmxILPcmRendererProcessingFunction")); - - } - -COmxILPcmRendererProcessingFunction::~COmxILPcmRendererProcessingFunction() - { - DEBUG_PRINTF(_L8("COmxILPcmRendererProcessingFunction::~COmxILPcmRendererProcessingFunction")); - - // Check in case the Sound Device has not been closed. That would happen in - // an scenario where the component is not being deleted in an orderer way. - if(iAudioDevice && iPFHelper && - (iState == OMX_StateInvalid || - iState == OMX_StateExecuting || - iState == OMX_StatePause)) - { - // Ignore error if the following call fails - iPFHelper->CloseDeviceOnError(); - } - - // Buffer headers are not owned by the processing function - iBuffersToEmpty.Close(); - iBuffersEmptied.Close(); - delete iAudioDevice; - delete iPFHelper; - } - - -OMX_ERRORTYPE -COmxILPcmRendererProcessingFunction::StateTransitionIndication(COmxILFsm::TStateIndex aNewState) - { - DEBUG_PRINTF(_L8("COmxILPcmRendererProcessingFunction::StateTransitionIndication")); - - OMX_ERRORTYPE err = OMX_ErrorNone; - switch(aNewState) - { - case COmxILFsm::EStateExecuting: - { - DEBUG_PRINTF(_L8("StateTransitionIndication : OMX_StateExecuting")); - if (iPFHelper->Execute() != KErrNone) - { - return OMX_ErrorInsufficientResources; - } - } - break; - case COmxILFsm::EStateInvalid: - { - DEBUG_PRINTF(_L8("StateTransitionIndication : OMX_StateInvalid")); - if (iPFHelper->Stop() != KErrNone) - { // InsufficientResources to stop??? - return OMX_ErrorInsufficientResources; - } - } - break; - case COmxILFsm::EStatePause: - { - DEBUG_PRINTF(_L8("StateTransitionIndication : OMX_StatePause")); - err = iAudioDevice->MoveToPausedState(); - } - break; - case COmxILFsm::EStateIdle: - { - DEBUG_PRINTF(_L8("StateTransitionIndication : OMX_StateIdle")); - iBuffersToEmpty.Reset(); - if (iPFHelper->Stop() != KErrNone) - { // InsufficientResources to stop??? - return OMX_ErrorInsufficientResources; - } - } - break; - case COmxILFsm::EStateLoaded: - case COmxILFsm::EStateWaitForResources: - { - DEBUG_PRINTF(_L8("StateTransitionIndication : OMX_StateLoaded, OMX_StateWaitForResources")); - if (iPFHelper->Stop() != KErrNone) - { // InsufficientResources to stop??? - return OMX_ErrorInsufficientResources; - } - } - break; - case COmxILFsm::ESubStateLoadedToIdle: - { - DEBUG_PRINTF(_L8("StateTransitionIndication : ESubStateLoadedToIdle")); - if (iPFHelper->OpenDevice() != KErrNone) - { - return OMX_ErrorInsufficientResources; - } - } - break; - case COmxILFsm::ESubStateIdleToLoaded: - { - DEBUG_PRINTF(_L8("StateTransitionIndication : ESubStateIdleToLoaded")); - if (iPFHelper->CloseDevice() != KErrNone) - { // InsufficientResources to close??? - return OMX_ErrorInsufficientResources; - } - } - break; - case COmxILFsm::ESubStateExecutingToIdle: - case COmxILFsm::ESubStatePauseToIdle: - { - // Ignore these transitions... - return OMX_ErrorNone; - } - default: - { - // Always ASSERT; This would be a problem in the framework. - ASSERT(0); - return OMX_ErrorIncorrectStateTransition; - } - }; - - return err; - - } - - -OMX_ERRORTYPE -COmxILPcmRendererProcessingFunction::BufferFlushingIndication( - TUint32 aPortIndex, - OMX_DIRTYPE aDirection) - { - DEBUG_PRINTF2(_L8("COmxILPcmRendererProcessingFunction::BufferFlushingIndication : aPortIndex[%d]"), aPortIndex); - - if ((aPortIndex == OMX_ALL && aDirection == OMX_DirMax) || - (aPortIndex == KPCMRENDERER_APB0PORT_INDEX && aDirection == OMX_DirInput)) - { - // If we are currently processing a buffer then cancel - if (iPFHelper->CancelDevice() != KErrNone) - { - return OMX_ErrorInsufficientResources; - } - - // Send BufferDone notifications for each emptied buffer... - FlushBufferList(iBuffersEmptied); - - // Send BufferDone notifications for each pending buffer... - FlushBufferList(iBuffersToEmpty); - - return OMX_ErrorNone; - } - else if (aPortIndex == KPCMRENDERER_OPB0PORT_INDEX && aDirection == OMX_DirInput) - { - // Since the clock port buffers are returned immediately, - // there's nothing to flush for the port - return OMX_ErrorNone; - } - else - { - // Always ASSERT; This would be a problem in the framework. - ASSERT(0); - return OMX_ErrorBadParameter; - } - } - -void -COmxILPcmRendererProcessingFunction::FlushBufferList( - RPointerArray& aBufferList) - { - DEBUG_PRINTF2(_L8("COmxILPcmRendererProcessingFunction::FlushBufferList : [%s]"), - &aBufferList == &iBuffersToEmpty ? "iBuffersToEmpty" : "iBuffersEmptied"); - - const TUint bufferCount = aBufferList.Count(); - OMX_BUFFERHEADERTYPE* pBufferHeader = 0; - // We know there is only one input port... - OMX_DIRTYPE portDirection = OMX_DirInput; - - for (TUint i=0; inFilledLen = 0; - iCallbacks. - BufferDoneNotification( - pBufferHeader, - pBufferHeader->nInputPortIndex, - portDirection - ); - } - - // Empty buffer list... - aBufferList.Reset(); - - } - - -OMX_ERRORTYPE -COmxILPcmRendererProcessingFunction::ParamIndication( - OMX_INDEXTYPE aParamIndex, - const TAny* apComponentParameterStructure) - { - DEBUG_PRINTF(_L8("COmxILPcmRendererProcessingFunction::ParamIndication")); - - OMX_ERRORTYPE err = OMX_ErrorNone; - switch(aParamIndex) - { - case OMX_IndexParamAudioPcm: - { - const OMX_AUDIO_PARAM_PCMMODETYPE* pPcmProfile - = static_cast( - apComponentParameterStructure); - - if((pPcmProfile->nChannels == 1 || pPcmProfile->nChannels == 2) && - (pPcmProfile->eNumData == OMX_NumericalDataSigned) && - (pPcmProfile->eEndian == OMX_EndianBig) && - (pPcmProfile->bInterleaved == OMX_TRUE) && - (pPcmProfile->nBitPerSample == 16) && - ((pPcmProfile->nSamplingRate == 8000) || - (pPcmProfile->nSamplingRate == 11025) || - (pPcmProfile->nSamplingRate == 12000) || - (pPcmProfile->nSamplingRate == 16000) || - (pPcmProfile->nSamplingRate == 22050) || - (pPcmProfile->nSamplingRate == 24000) || - (pPcmProfile->nSamplingRate == 32000) || - (pPcmProfile->nSamplingRate == 44100) || - (pPcmProfile->nSamplingRate == 48000)) && - (pPcmProfile->ePCMMode == OMX_AUDIO_PCMModeLinear) && - (pPcmProfile->eChannelMapping[0] == OMX_AUDIO_ChannelLF) && - (pPcmProfile->eChannelMapping[1] == OMX_AUDIO_ChannelRF)) - { - if (iPFHelper->ParamIndication(pPcmProfile) != KErrNone) - { - err = OMX_ErrorInsufficientResources; - } - } - else - { - err = OMX_ErrorBadParameter; - } - } - break; - default: - { - // Ignore other port param changes... - } - }; - - return err; - - } - -OMX_ERRORTYPE -COmxILPcmRendererProcessingFunction::ConfigIndication(OMX_INDEXTYPE aConfigIndex, - const TAny* apComponentConfigStructure) - { - DEBUG_PRINTF2(_L8("COmxILPcmRendererProcessingFunction::ConfigIndication %X"), aConfigIndex); - - OMX_ERRORTYPE err = OMX_ErrorNone; - switch(aConfigIndex) - { - case OMX_SymbianIndexConfigAudioPcmVolumeRamp: - { - const OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP* - pPcmVolumeRamp - = static_cast< - const OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP*>( - apComponentConfigStructure); - - if (iPFHelper->SetVolumeRamp(pPcmVolumeRamp->nRampDuration) != KErrNone) - { - err = OMX_ErrorInsufficientResources; - } - } - break; - - case OMX_IndexConfigAudioVolume: - { - const OMX_AUDIO_CONFIG_VOLUMETYPE* pVolumeType - = static_cast( - apComponentConfigStructure); - - if (pVolumeType->bLinear == OMX_TRUE) - { - // Some configuration structures contain read-only fields. The - // OMX_SetConfig method will preserve read-only fields in configuration - // structures that contain them, and shall not generate an error when - // the caller attempts to change the value of a read-only field. - err = OMX_ErrorNone; - break; - } - - if ((pVolumeType->sVolume.nValue <= pVolumeType->sVolume.nMax) && - (pVolumeType->sVolume.nValue >= pVolumeType->sVolume.nMin)) - { - if (iPFHelper->SetVolume(pVolumeType->sVolume.nValue) != KErrNone) - { - err = OMX_ErrorInsufficientResources; - } - } - else - { - err = OMX_ErrorBadParameter; - } - } - break; - - case OMX_IndexConfigAudioMute: - { - const OMX_AUDIO_CONFIG_MUTETYPE* pVolumeType - = static_cast( - apComponentConfigStructure); - - if (iPFHelper->SetMuted(pVolumeType->bMute) != KErrNone) - { - err = OMX_ErrorInsufficientResources; - } - } - break; - - default: - { - // Ignore other port config changes... - } - }; - - return err; - - } - -OMX_ERRORTYPE -COmxILPcmRendererProcessingFunction::BufferIndication( - OMX_BUFFERHEADERTYPE* apBufferHeader, - OMX_DIRTYPE aDirection) - { - DEBUG_PRINTF2(_L8("COmxILPcmRendererProcessingFunction::BufferIndication : [%X]"), apBufferHeader); - - if (aDirection != OMX_DirInput) - { - return OMX_ErrorBadParameter; - } - - if (iBuffersToEmpty.Append(apBufferHeader) != KErrNone) - { - return OMX_ErrorInsufficientResources; - } - - // If we are not in an executing state or if the audio device is busy, delay playing back the buffer - if (iState != OMX_StateExecuting || iAudioDevice->IsActive()) - { - return OMX_ErrorNone; - } - - if (iPFHelper->BufferIndication() != KErrNone) - { - return OMX_ErrorInsufficientResources; - } - - return OMX_ErrorNone; - } - -OMX_ERRORTYPE COmxILPcmRendererProcessingFunction::MediaTimeIndication(const OMX_TIME_MEDIATIMETYPE& aMediaTimeType) - { - // Received a requested media time notification. - DEBUG_PRINTF5(_L8("MediaTimeIndication : eUpdateType = %d eState = %d xScale = %d nMediaTimestamp = %d "), - aMediaTimeType.eUpdateType, aMediaTimeType.eState, aMediaTimeType.xScale, aMediaTimeType.nMediaTimestamp); - - iPFHelper->MediaTimeIndication(aMediaTimeType); - return OMX_ErrorNone; - } - -OMX_BOOL -COmxILPcmRendererProcessingFunction::BufferRemovalIndication( - OMX_BUFFERHEADERTYPE* apBufferHeader, - OMX_DIRTYPE /* aDirection */) - { - DEBUG_PRINTF2(_L8("COmxILPcmRendererProcessingFunction::BufferRemovalIndication : BUFFER [%X]"), apBufferHeader); - - TBool headerDeletionResult = ETrue; - // Check if the buffer we want to remove is the one is being currently processed - if (iAudioDevice->IsActive() && iAudioDevice->GetCurrentBuffer() == apBufferHeader) - { - if (iPFHelper->CancelDevice() != KErrNone) - { - return OMX_FALSE; - } - - // if you cancel the audio device then you send the buffer to the other end of the tunnel - // so you shouldn't say that you had the buffer in the processing function in this situation. - headerDeletionResult = EFalse; - } - else - { - TInt headerIndexInArray = KErrNotFound; - if (KErrNotFound != - (headerIndexInArray = - iBuffersToEmpty.Find(apBufferHeader))) - { - iBuffersToEmpty.Remove(headerIndexInArray); - } - else if(KErrNotFound != - (headerIndexInArray = - iBuffersEmptied.Find(apBufferHeader))) - { - iBuffersEmptied.Remove(headerIndexInArray); - } - else - { - headerDeletionResult = EFalse; - } - } - - DEBUG_PRINTF2(_L8("BufferRemovalIndication : Removal result [%s]"), (headerDeletionResult ? "YES" : "NO")); - return (headerDeletionResult ? OMX_TRUE : OMX_FALSE); - } - -TInt -COmxILPcmRendererProcessingFunction::GetBytesPlayed() const - { - return iAudioDevice->GetBytesPlayed(); - } - - -COmxILPcmRendererProcessingFunction::CAudioDevice* COmxILPcmRendererProcessingFunction::CAudioDevice::NewL(COmxILPcmRendererProcessingFunction& aParent) - { - CAudioDevice* self = new (ELeave) CAudioDevice(aParent); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } - -COmxILPcmRendererProcessingFunction::CAudioDevice::CAudioDevice(COmxILPcmRendererProcessingFunction& aParent) -: CActive(EPriorityUserInput), - iParent(aParent), - iSampleRate(KDefaultSampleRate), - iChannels(KDefaultNumberChannels), - iEncoding(KDefaultEncoding), - iVolume(KDefaultVolume), - iMuted(KDefaultMuted), - iBufferSize(KBufferSize), - iClockStateRunning(EFalse), - iPausedClockViaScale(EFalse), - iIsStartTimeFlagSet(EFalse) - { - CActiveScheduler::Add(this); - } - - -void COmxILPcmRendererProcessingFunction::CAudioDevice::ConstructL() - { - iCachedPlayBuffer.CreateL(0); - } - -COmxILPcmRendererProcessingFunction::CAudioDevice::~CAudioDevice() - { - delete iPeriodic; - Cancel(); - iCachedPlayBuffer.Close(); - } - -void COmxILPcmRendererProcessingFunction::CAudioDevice::RunL() - { - DEBUG_PRINTF(_L8("CAudioDevice::RunL : ")); - if (iStatus != KErrNone) - { - switch(iStatus.Int()) - { - case KErrUnderflow: - DEBUG_PRINTF(_L8("CAudioDevice::RunL : KErrUnderflow")); - iParent.iCallbacks.ErrorEventNotification(OMX_ErrorUnderflow); - break; - - case KErrOverflow: - DEBUG_PRINTF(_L8("CAudioDevice::RunL : KErrOverflow")); - iParent.iCallbacks.ErrorEventNotification(OMX_ErrorOverflow); - break; - - default: - DEBUG_PRINTF2(_L8("CAudioDevice::RunL : [%d] -> OMX_ErrorHardware"), iStatus.Int()); - iParent.iCallbacks.ErrorEventNotification(OMX_ErrorHardware); - }; - } - - ASSERT(iCurrentBuffer); - // Update the last value of bytes played... - iLastBytesPlayedValue = iSoundDevice.BytesPlayed(); - - // Return the emptied buffer to the IL Client or the tunnelled - // component.. - SignalBufferCompletion(iCurrentBuffer); - iCurrentBuffer = 0; - - // Make sure to clear the aggregated cache buffer, if it was used - iCachedPlayBuffer.Zero(); - } - -void COmxILPcmRendererProcessingFunction::CAudioDevice::SignalBufferCompletion( - OMX_BUFFERHEADERTYPE* apCurrentBuffer) - { - DEBUG_PRINTF2(_L8("CAudioDevice::SignalBufferCompletion : BUFFER = [%X]"), apCurrentBuffer); - - iParent.iBuffersEmptied.Append(apCurrentBuffer); - - // Process the queue only if in executing state... - if (iParent.iState == OMX_StateExecuting) - { - const TUint bufferCount = iParent.iBuffersEmptied.Count(); - OMX_BUFFERHEADERTYPE* pBufferHeader = 0; - for (TUint i=0; inFlags & OMX_BUFFERFLAG_EOS) - { - lastBuffer = ETrue; - } - - pBufferHeader->nFilledLen = 0; - iParent.iCallbacks.BufferDoneNotification(pBufferHeader, - pBufferHeader->nInputPortIndex, - OMX_DirInput); - if (lastBuffer) - { - pBufferHeader->nFlags |= OMX_BUFFERFLAG_EOS; - // propagate the EOS flag - iParent.iCallbacks.EventNotification( - OMX_EventBufferFlag, - KPCMRENDERER_APB0PORT_INDEX, - pBufferHeader->nFlags, - NULL); - } - } - - // Empty list... - iParent.iBuffersEmptied.Reset(); - } - - if (iParent.iBuffersToEmpty.Count() > 0) - { - DEBUG_PRINTF2(_L8("CAudioDevice::RunL : iBuffersToEmpty.Count = [%d]"), - iParent.iBuffersToEmpty.Count()); - iParent.iPFHelper->BufferIndication(); - } - - } - - -TBool COmxILPcmRendererProcessingFunction::CAudioDevice::ConstructAndStartUpdateTimer() - { - // Need this check if: - // - The component state transitions from Execution-Idle-Execution - // - The Clock's state transitions from Running-Stop-Running - if (iPeriodic == NULL) - { - iPeriodic = CPeriodic::New(EPriorityStandard); - - if (iPeriodic == NULL) - { - iParent.iCallbacks.ErrorEventNotification(OMX_ErrorInsufficientResources); - return EFalse; - } - } - - StartUpdateTimer(); - - return ETrue; - } - - -void COmxILPcmRendererProcessingFunction::CAudioDevice::ProcessNextBuffer() - { - if (iParent.iBuffersToEmpty.Count() == 0) - return; - - // To implement A/V Sync, we should start playing only once the clock component gives the appopriate command - // If the clock component is not available, we start playing immediately - // Since the PCM Renderer supplies the reference clock, we make sure to initialise the clock component with - // the reference when we receive the first buffer - - if (!iParent.iClientClockPortPtr->IsClockComponentAvailable()) - { - PlayData(); - return; - } - - OMX_BUFFERHEADERTYPE* bufferPtr = iParent.iBuffersToEmpty[0]; - - TBool bufferHasStartTime = bufferPtr->nFlags & OMX_BUFFERFLAG_STARTTIME; - - if (!iClockStateRunning) - { - if (!bufferHasStartTime) - { - // Connected with the Clock but OMX_BUFFERFLAG_STARTTIME isn't set; drop the buffer - if (!iIsStartTimeFlagSet) - { - iParent.iBuffersToEmpty.Remove(0); - SignalBufferCompletion(bufferPtr); - } - bufferPtr = NULL; - return; - } - else - { - OMX_ERRORTYPE err = iParent.iClientClockPortPtr->SetStartTime(static_cast(bufferPtr->nTimeStamp)); - - if (err == OMX_ErrorNone) - { - // Clear the returning buffer's flag - bufferPtr->nFlags &= ~OMX_BUFFERFLAG_STARTTIME; - } - else - { - // NOTE: If the Clock is not in OMX_TIME_ClockStateWaitingForStartTime, - // currently SetStartTime will return OMX_ErrorIncorrectStateOperation - - // It is not the PCM renderer to flag a Clock component error; - // therefore, ignore the error. - // - // As the Clock is not in OMX_TIME_ClockStateRunning state, the Renderer needs - // to keep the OMX_BUFFERFLAG_STARTTIME in the first buffer until the Clock - // moves into OMX_TIME_ClockStateWaitingForStartTime or OMX_TIME_ClockStateRunning - // state - DEBUG_PRINTF2(_L8("CAudioDevice::ProcessNextBuffer SetStartTime() return %d"), err); - } - - // Update the iStartMediaTime - iParent.iStartMediaTime = static_cast(bufferPtr->nTimeStamp); - iIsStartTimeFlagSet = ETrue; - } - } // (!iClockStateRunning) - else - { - if (bufferHasStartTime) - { - // The Clock moves straight into OMX_TIME_ClockStateRunning state, - // clear the returning buffer's flag. - bufferPtr->nFlags &= ~OMX_BUFFERFLAG_STARTTIME; - } - - if (!iPlayData) - { - // Not allowed to render audio. This could be due to: - // - The renderer is waiting for a time completion notification from the Clock; - return; - } - - if (!iIsStartTimeFlagSet) - { - // As the StartTimeFlag is not mandatory; therefore it might be missing from the first audio buffer - // In such a case, we use the first buffer's timestamp as the StartMediaTime. - // - // NOTE: Since the Clock is running, calling SetStartTime() to the Clock is meaningless - - // Update the iStartMediaTime - iParent.iStartMediaTime = static_cast(bufferPtr->nTimeStamp); - iIsStartTimeFlagSet = ETrue; - - // Cross checking the Clock's media timestamp with iStartMediaTime to see - // data can be rendered straight away - if (!CanPlayNow()) - { - return; - } - - if (!ConstructAndStartUpdateTimer()) - { - return; - } - } - - DEBUG_PRINTF3(_L8("ProcessNextBuffer : iStartMediaTime = %d nTimeStamp = %d"), - I64LOW(iParent.iStartMediaTime), I64LOW(bufferPtr->nTimeStamp)); - - if (!iPausedClockViaScale) //if clock scale is zero then we are effectively paused - { - PlayData(); - } - } // else - } - - -void COmxILPcmRendererProcessingFunction::CAudioDevice::PlayData() - { - DEBUG_PRINTF(_L8("COmxILPcmRendererProcessingFunction::CAudioDevice::PlayData()++")); - if (iParent.iBuffersToEmpty.Count() == 0 || iSoundDevice.Handle() == 0 || IsActive()) - { - DEBUG_PRINTF(_L8("COmxILPcmRendererProcessingFunction::CAudioDevice::PlayData() nothing to play, or there is an outstanding request")); - return; - } - - iCurrentBuffer = iParent.iBuffersToEmpty[0]; - - iParent.iBuffersToEmpty.Remove(0); - - CMMFDataBuffer* mmfSrcBuffer = static_cast(iCurrentBuffer->pInputPortPrivate); - mmfSrcBuffer->Data().SetLength(iCurrentBuffer->nFilledLen); - - // Attenuate the amplitude of the samples if volume ramping has been changed - if (iRampAudioSample) - { - iRampAudioSample = RampAudio(mmfSrcBuffer); - } - - // First, check whether the buffer length is sufficient not to cause underflows in the device driver - TBool isFilledLengthSufficient = IsBufferLengthSufficient(iCurrentBuffer->nFilledLen); - // This variable defines whether we should send the data to the driver directly, or append it to an aggregated buffer - // We append the buffer instead of sending it directly, if (i) the buffer is too small, or (ii) we have already aggregated something. - TBool appendBuffer = (!isFilledLengthSufficient || iCachedPlayBuffer.Length() > 0) ? ETrue : EFalse; - if (!appendBuffer) - { - SendBufferToSoundDevice(mmfSrcBuffer->Data()); - } - else - { - // Check if we need to allocate the cached buffer - if (iCachedPlayBuffer.MaxLength() == 0) - { - // The RMdaDevSound shim allocates the shared chunk according to the maxLength of the descriptor it receives - // For this reason, we must allocate our buffer conservatively, otherwise the chunk may be insufficient and the RMdaDevSound shim will panic - TInt err = iCachedPlayBuffer.ReAlloc(GetMinBufferLength() + iCurrentBuffer->nAllocLen); - if (err != KErrNone) - { - iParent.iCallbacks.ErrorEventNotification(OMX_ErrorInsufficientResources); - return; - } - } - - iCachedPlayBuffer.Append(mmfSrcBuffer->Data()); - - // If we have sufficient length aggregated, play the cached buffer - // Also if this is the last buffer, we have to play it now, there's nothing left to cache - if (IsBufferLengthSufficient(iCachedPlayBuffer.Length()) || iCurrentBuffer->nFlags & OMX_BUFFERFLAG_EOS) - { - SendBufferToSoundDevice(iCachedPlayBuffer); - } - // If not, make sure to notify that we notify that the buffer is done for the OMX tunnnel, so that the port will be able to reuse it - else - { - SignalBufferCompletion(iCurrentBuffer); - iCurrentBuffer = NULL; - } - } - } - -void COmxILPcmRendererProcessingFunction::CAudioDevice::SendBufferToSoundDevice(TDes8& aBuffer) - { - ASSERT(!IsActive()); - iStatus = KRequestPending; - DEBUG_PRINTF2(_L8("COmxILPcmRendererProcessingFunction::CAudioDevice::SendBufferToSoundDevice() PlayData [%d]"), aBuffer.Length()); - iSoundDevice.PlayData(iStatus, aBuffer); - SetActive(); - } - -TInt COmxILPcmRendererProcessingFunction::CAudioDevice::GetMinBufferLength() const - { - TInt minBufSize = KMinBufferMilliseconds * iSampleRate * iChannels / 1000; - if (iEncoding == RMdaDevSound::EMdaSoundEncoding16BitPCM) - { - minBufSize *= 2; // All other encodings use 1 byte per sample - } - return minBufSize; - } - -TBool COmxILPcmRendererProcessingFunction::CAudioDevice::IsBufferLengthSufficient(TInt aBufferLength) const - { - return aBufferLength >= GetMinBufferLength() ? ETrue : EFalse; - } - - -void COmxILPcmRendererProcessingFunction::CAudioDevice::ProcessMediaTimeIndication(OMX_TIME_MEDIATIMETYPE& aMediaTimeType) - { - switch (aMediaTimeType.eUpdateType) - { - case OMX_TIME_UpdateClockStateChanged: - { - HandleClockStateChanged(aMediaTimeType); - } - break; - - case OMX_TIME_UpdateRequestFulfillment: - { - // As the Clock was using another earlier start time; - // it is time for the PCM renderer to start playing the audio. - iPlayData = ETrue; - PlayData(); - - if (!ConstructAndStartUpdateTimer()) - { - return; - } - } - break; - - case OMX_TIME_UpdateScaleChanged: - { - HandleClockScaleChanged(aMediaTimeType); - } - break; - - default: - { - // Do nothing here - } - } - } - - -void COmxILPcmRendererProcessingFunction::CAudioDevice::StartUpdateTimer() - { - if (!iIsStartTimeFlagSet) - { - DEBUG_PRINTF(_L8("COmxILPcmRendererProcessingFunction::CAudioDevice::StartUpdateTimer() iIsStartTimeFlagSet == EFalse!!")); - return; - } - - // In case the timer already started - ASSERT(iPeriodic); - iPeriodic->Cancel(); - - TCallBack callback(UpdateClockMediaTime, this); - - // Start updating the Clock comp. every KPcmRendererTimePlayedDelay - iPeriodic->Start(KPcmRendererTimePlayedDelay, KPcmRendererTimePlayedDelay, callback); - } - - -TBool COmxILPcmRendererProcessingFunction::CAudioDevice::CanPlayNow() - { - if (iClockMediaTime < iParent.iStartMediaTime) - { - // Once all required Clock's clients have responded, the clock component starts - // the media clock using the earliest client start time. - // Therefore, start playing the audio only when such time comes; send a time - // completion request to the Clock component - OMX_ERRORTYPE err = iParent.iClientClockPortPtr->MediaTimeRequest(NULL, iParent.iStartMediaTime, 0); - - if (err != OMX_ErrorNone) - { - DEBUG_PRINTF2(_L8("CAudioDevice::CanPlayNow() MediaTimeRequest() return %d"), err); - } - - // Indicate that processing a new buffer should not trigger a false start on playback. - iPlayData = EFalse; - return EFalse; - } - else if (iClockMediaTime > iParent.iStartMediaTime) - { - // NOTE: The spec. states that the clock should use the minimum of the received start times - // Therefore the Clock should NOT jump forwards with timestamp greater than the PCM - // Renderer iStartMediaTime - DEBUG_PRINTF3(_L8("CanPlayNow() nMediaTimestamp(%d) > iStartMediaTime(%d) IGNORE this use case"), - I64LOW(iClockMediaTime), I64LOW(iParent.iStartMediaTime)); - - // However if the Clock sends out a timestamp greater than the buffer's timestamp - // drop the buffers that fall outside the Clock specified MediaTimestamp; - - OMX_BUFFERHEADERTYPE* bufferPtr = iParent.iBuffersToEmpty[0]; - iParent.iBuffersToEmpty.Remove(0); - SignalBufferCompletion(bufferPtr); - bufferPtr = NULL; - - // Since the iStartMediaTime doesn't make sense anymore, reset iIsStartTimeFlagSet until the buffer's timestamp - // is within the the Clock's Media timestamp - iIsStartTimeFlagSet = EFalse; - return EFalse; - } - - return ETrue; - } - - -void COmxILPcmRendererProcessingFunction::CAudioDevice::HandleClockStateChanged(const OMX_TIME_MEDIATIMETYPE& aMediaTimeType) - { - switch (aMediaTimeType.eState) - { - case OMX_TIME_ClockStateRunning: - { - iClockMediaTime = aMediaTimeType.nMediaTimestamp; - - // There are two possibilities: - // case 1 - The clock goes straight into running and the PCM renderer processes the - // StateChanged notification prior the audio buffer - - if (iIsStartTimeFlagSet) - { - // OR - // case 2 - The PCM recieves the audio buffer, and the clock StateChanged notification - // comes later - - // Clear the returning buffer's flag. - iParent.iBuffersToEmpty[0]->nFlags &= ~OMX_BUFFERFLAG_STARTTIME; - - // Cross checking the Clock's media timestamp with iStartMediaTime to see - // data can be rendered straight away - if (!CanPlayNow()) - { - break; - } - - // Start playing the audio and start updating the Clock media time regularly - PlayData(); - - if (!ConstructAndStartUpdateTimer()) - { - return; - } - } - - // Otherwise, the queue is empty; - // - // NOTE: When !iIsStartTimeFlagSet && !iClockStateRunning would drop the incoming buffers; - // if the first buffer does not have the OMX_BUFFERFLAG_STARTTIME set - } - break; - - case OMX_TIME_ClockStateWaitingForStartTime: - { - if (iClockStateRunning) - { - DEBUG_PRINTF(_L8("HandleClockStateChanged() OMX_TIME_ClockStateRunning -> OMX_TIME_ClockStateWaitingForStartTime IGNORED!!")); - } - else - { - // Let's try to process buffers (if any). - ProcessNextBuffer(); - } - } - break; - - case OMX_TIME_ClockStateStopped: - { - if (iClockStateRunning) - { - // The Clock was in "Running" state but not anymore; stop the audio - if (IsActive()) - { - Cancel(); - } - else - { - DoCancel(); - } - - iPlayData = ETrue; - if (iIsStartTimeFlagSet) - { - iIsStartTimeFlagSet = EFalse; - iPeriodic->Cancel(); - } - } - - // Otherwise, ignore other possibilities - } - - break; - - default: - { - DEBUG_PRINTF2(_L8("HandleClockStateChanged() aMediaTimeType.eState = %d IGNORED!!"), aMediaTimeType.eState); - } - break; - } - - iClockStateRunning = (aMediaTimeType.eState == OMX_TIME_ClockStateRunning) ? ETrue : EFalse; - } - - -void COmxILPcmRendererProcessingFunction::CAudioDevice::HandleClockScaleChanged(const OMX_TIME_MEDIATIMETYPE& aMediaTimeType) - { - if (aMediaTimeType.xScale == 0) - { - PauseAudio(); - iPausedClockViaScale = ETrue; - DEBUG_PRINTF2(_L8("HandleClockScaleChanged() pausing iPausedClockViaScale = %d"), iPausedClockViaScale); - } - else if (aMediaTimeType.xScale == 0x10000) - { - // The scale is a Q16 value - iPausedClockViaScale = EFalse; - DEBUG_PRINTF2(_L8("HandleClockScaleChanged() resuming iPausedClockViaScale = %d"), iPausedClockViaScale); - iSoundDevice.ResumePlaying(); - iParent.iPFHelper->BufferIndication(); //handles the race condition where both 1) iSoundDevice was paused after the last PlayData() completed and before it was passed any data & 2) BufferIndication()s came in for all the IL buffers while in this paused state - StartUpdateTimer(); - } - } - - -void COmxILPcmRendererProcessingFunction::CAudioDevice::DoCancel() - { - if (iSoundDevice.Handle() != 0) - { - iSoundDevice.CancelPlayData(); - iSoundDevice.FlushPlayBuffer(); - } - - if (iCurrentBuffer) - { - iCurrentBuffer->nFilledLen = 0; - - iParent.iCallbacks.BufferDoneNotification(iCurrentBuffer, - iCurrentBuffer->nInputPortIndex, - OMX_DirInput); - - iCachedPlayBuffer.Zero(); - iCurrentBuffer = NULL; - } - } - - -OMX_ERRORTYPE COmxILPcmRendererProcessingFunction::CAudioDevice::OpenDevice() - { - OMX_ERRORTYPE err = OMX_ErrorNone; - if(!iSoundDevice.Handle()) - { -#ifdef SYMBIAN_MDF_SHAREDCHUNK_SOUNDDRIVER - if(KErrNone != iSoundDevice.Open(KSoundScTxUnit0)) -#else //SYMBIAN_MDF_SHAREDCHUNK_SOUNDDRIVER - if(KErrNone != iSoundDevice.Open()) -#endif //SYMBIAN_MDF_SHAREDCHUNK_SOUNDDRIVER - { - err = OMX_ErrorHardware; - } - } - return err; - } - -OMX_ERRORTYPE COmxILPcmRendererProcessingFunction::CAudioDevice::CloseDevice() - { - OMX_ERRORTYPE err = OMX_ErrorNone; - if(iSoundDevice.Handle()) - { - iSoundDevice.Close(); - } - return err; - } - -OMX_ERRORTYPE COmxILPcmRendererProcessingFunction::CAudioDevice::Execute() - { - if(!iSoundDevice.Handle()) - { - if(KErrNone != iSoundDevice.Open()) - { - return OMX_ErrorHardware; - } - } - - if(iParent.iState == OMX_StatePause) - { - // Now we can send BufferDone notifications for each emptied - // buffer... - iParent.FlushBufferList(iParent.iBuffersEmptied); - iSoundDevice.ResumePlaying(); - StartUpdateTimer(); - } - else - { - // Set play format - RMdaDevSound::TCurrentSoundFormatBuf buf; - iSoundDevice.GetPlayFormat(buf); - buf().iRate = iSampleRate; - buf().iChannels = iChannels; - buf().iBufferSize = iBufferSize; - buf().iEncoding = iEncoding; - if(KErrNone != iSoundDevice.SetPlayFormat(buf)) - { - return OMX_ErrorHardware; - } - - if (iMuted) - { - iSoundDevice.SetVolume(0); - } - else - { - iSoundDevice.SetVolume(iVolume); - } - } - - iParent.iState = OMX_StateExecuting; - - // Make sure to start processing of queued up buffers (if any) - if (!IsActive() && iParent.iBuffersToEmpty.Count() > 0) - { - ProcessNextBuffer(); - } - - return OMX_ErrorNone; - } - -OMX_ERRORTYPE COmxILPcmRendererProcessingFunction::CAudioDevice::MoveToPausedState() - { - iParent.iState = OMX_StatePause; - PauseAudio(); - - return OMX_ErrorNone; - } - -OMX_ERRORTYPE COmxILPcmRendererProcessingFunction::CAudioDevice::Stop() - { - if(iParent.iState == OMX_StateExecuting || iParent.iState == OMX_StatePause) - { - // Cancel and flush the device driver - Cancel(); - - // Cancel timer to stop calling RSoundSc::TimePlayed() - if (iIsStartTimeFlagSet) - { - ASSERT(iPeriodic); - iPeriodic->Cancel(); - } - - iParent.iState = OMX_StateIdle; - - // If the audio device is still open, store the last value of bytes - // played before closing the audio device... - if(iSoundDevice.Handle() != 0) - { - iLastBytesPlayedValue = iSoundDevice.BytesPlayed(); - // Close the sound device - iSoundDevice.Close(); - } - } - - iClockStateRunning = EFalse; - iIsStartTimeFlagSet = EFalse; - iPlayData = ETrue; - - return OMX_ErrorNone; - } - - -void COmxILPcmRendererProcessingFunction::CAudioDevice::PauseAudio() - { - // Cancel timer to stop calling RSoundSc::TimePlayed() - if (iIsStartTimeFlagSet) - { - ASSERT(iPeriodic); - iPeriodic->Cancel(); - } - - if (iSoundDevice.Handle()) - { - iSoundDevice.PausePlayBuffer(); - } - } - - -OMX_ERRORTYPE COmxILPcmRendererProcessingFunction::CAudioDevice::SetChannels(TUint aChannels) - { - iChannels = aChannels; - return SetPlayFormat(); - } - -OMX_ERRORTYPE COmxILPcmRendererProcessingFunction::CAudioDevice::SetSampleRate(TUint aSampleRate) - { - iSampleRate = aSampleRate; - return SetPlayFormat(); - } - -TInt ConvertOmxToSymbianVolume(TInt aVolume) - { - // OpenMax volume is in millibels while Symbian volume is in 0.5 db increments in the [0..255] range - // We divide by 50 as 0.5 dB = 50 millibells - TInt res = KMedianVolume + aVolume / 50; - if (res < 0) - return 0; - if (res > KMaxVolume) - return KMaxVolume; - return res; - } - -OMX_ERRORTYPE COmxILPcmRendererProcessingFunction::CAudioDevice::SetVolume(TInt aVolume) - { - iVolume = ConvertOmxToSymbianVolume(aVolume); - if ((!iMuted) && (iSoundDevice.Handle() != 0)) - { - iSoundDevice.SetVolume(iVolume); - } - return OMX_ErrorNone; - } - -OMX_ERRORTYPE COmxILPcmRendererProcessingFunction::CAudioDevice::SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration) - { - iVolumeRamp = aRampDuration; - if(iVolumeRamp.Int64() != 0) - { - iRampAudioSample = ETrue; - ConfigAudioRamper( - iVolumeRamp.Int64()); - } - else - { - iRampAudioSample = EFalse; - } - return OMX_ErrorNone; - } - -OMX_ERRORTYPE COmxILPcmRendererProcessingFunction::CAudioDevice::SetMuted(TBool aMuted) - { - iMuted = aMuted; - - if (iSoundDevice.Handle() == 0) - { - // Just cache the value; the value will be set once the the device is opened - return OMX_ErrorNone; - } - - if (iMuted) - { - iSoundDevice.SetVolume(0); - } - else - { - iSoundDevice.SetVolume(iVolume); - } - return OMX_ErrorNone; - } - -OMX_ERRORTYPE COmxILPcmRendererProcessingFunction::CAudioDevice::SetPlayFormat() - { - if (iParent.iState == OMX_StateExecuting) - { - RMdaDevSound::TCurrentSoundFormatBuf buf; - iSoundDevice.GetPlayFormat(buf); - buf().iRate = iSampleRate; - buf().iChannels = iChannels; - buf().iBufferSize = iBufferSize; - buf().iEncoding = iEncoding; - if(KErrNone != iSoundDevice.SetPlayFormat(buf)) - { - return OMX_ErrorHardware; - } - } - return OMX_ErrorNone; - } - -OMX_BUFFERHEADERTYPE* COmxILPcmRendererProcessingFunction::CAudioDevice::GetCurrentBuffer() - { - return iCurrentBuffer; - } - -TInt COmxILPcmRendererProcessingFunction::CAudioDevice::GetBytesPlayed() - { - if(iSoundDevice.Handle() != 0) - { - return iSoundDevice.BytesPlayed(); - } - - return iLastBytesPlayedValue; - } - -void COmxILPcmRendererProcessingFunction::CAudioDevice::ConfigAudioRamper(TInt64 aRampTime) - { - iRampSamples = I64LOW(((TInt64(iSampleRate) * aRampTime) /1000000 )); // Add this - iRampSamplesLeft = iRampSamples; - iRampIncr = 0; - iSkip = ETrue; - } - -TBool COmxILPcmRendererProcessingFunction::CAudioDevice::RampAudio(CMMFDataBuffer* aBuffer) - { - TInt i=0; - TInt length = aBuffer->Data().Length()>>1; - if (length == 0) - { - return EFalse; - } - - TInt16* sample = REINTERPRET_CAST(TInt16*,&aBuffer->Data()[0]); - TInt64 theResult(0); - while ((i < length) && (iRampIncr < iRampSamples)) - { - theResult = sample[i]; - theResult *= iRampIncr; - theResult /= iRampSamples; - sample[i] = STATIC_CAST(TInt16, I64LOW(theResult) ); - - if ((iChannels == 1) || (!iSkip)) - { - iRampIncr++; - } - iSkip = !iSkip; - i++; - } - - if (iRampIncr < iRampSamples) - return ETrue; - else - return EFalse; - } - - -TInt COmxILPcmRendererProcessingFunction::CAudioDevice::UpdateClockMediaTime(TAny* aPtr) - { - CAudioDevice* ptr = (CAudioDevice*)aPtr; - TTimeIntervalMicroSeconds playedTime(0); - - if (ptr->iSoundDevice.GetTimePlayed(playedTime) != KErrNone) - { - ptr->iParent.iCallbacks.ErrorEventNotification(OMX_ErrorHardware); - return EFalse; - } - - OMX_ERRORTYPE err; - - // Update the clock component audio reference clock - err = ptr->iParent.iClientClockPortPtr->SetAudioReference(ptr->iParent.iStartMediaTime + playedTime.Int64()); - - if (err != OMX_ErrorNone) - { - ptr->iParent.iCallbacks.ErrorEventNotification(err); - return EFalse; - } - - DEBUG_PRINTF2(_L8("CAudioDevice::UpdateClockMediaTime : playedTime = %d"), - I64LOW(playedTime.Int64())); - - return ETrue; - } - - -void COmxILPcmRendererProcessingFunction::CAudioDevice::ProcessParamIndication(const OMX_AUDIO_PARAM_PCMMODETYPE& aPcmModeType) - { - if(SetChannels(aPcmModeType.nChannels) != OMX_ErrorNone) - { - iParent.iCallbacks.ErrorEventNotification(OMX_ErrorHardware); - return; - } - - if (SetSampleRate(aPcmModeType.nSamplingRate) != OMX_ErrorNone) - { - iParent.iCallbacks.ErrorEventNotification(OMX_ErrorHardware); - return; - } - } - -COmxILPcmRendererProcessingFunction::CPFHelper* COmxILPcmRendererProcessingFunction::CPFHelper::NewL(CAudioDevice& aAudioDevice) - { - CPFHelper* self = new (ELeave) CPFHelper(aAudioDevice); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } - -COmxILPcmRendererProcessingFunction::CPFHelper::CPFHelper(CAudioDevice& aAudioDevice) -: CActive(EPriorityUserInput), - iAudioDevice(aAudioDevice) - { - } - -void COmxILPcmRendererProcessingFunction::CPFHelper::ConstructL() - { - CActiveScheduler::Add(this); - User::LeaveIfError(iCallerSemaphore.CreateGlobal(KNullDesC, 0)); - User::LeaveIfError(iMsgQueue.CreateLocal(KMaxMsgQueueEntries)); - iMsgQueue.NotifyDataAvailable(iStatus); - RThread thisThread; - iHelperThreadId = thisThread.Id(); - thisThread.Close(); - SetActive(); - } - -COmxILPcmRendererProcessingFunction::CPFHelper::~CPFHelper() - { - Cancel(); - iMsgQueue.Close(); - iCallerSemaphore.Close(); - } - -void COmxILPcmRendererProcessingFunction::CPFHelper::RunL() - { - - TProcMessage msg; - while (iMsgQueue.Receive(msg)==KErrNone) - { - switch (msg.iType) - { - case EOpenDevice: - { - iAudioDevice.OpenDevice(); - break; - } - case ECloseDevice: - { - iAudioDevice.CloseDevice(); - break; - } - case ECloseDeviceOnError: - { - iAudioDevice.Cancel(); - iAudioDevice.CloseDevice(); - iCallerSemaphore.Signal(); - break; - } - case EExecuteCommand: - { - iAudioDevice.Execute(); - break; - } - - case EStopCommand: - { - iAudioDevice.Stop(); - break; - } - - case ECancelCommand: - { - iAudioDevice.Cancel(); - break; - } - - case EBufferIndication: - { - iAudioDevice.ProcessNextBuffer(); - break; - } - case EMediaTimeIndication: - { - iAudioDevice.ProcessMediaTimeIndication(msg.iMediaTimeType); - break; - } - case EParamIndication: - { - iAudioDevice.ProcessParamIndication(msg.iPcmModeType); - break; - } - case ESetVolumeRamp: - { - iAudioDevice.SetVolumeRamp(TTimeIntervalMicroSeconds(msg.iRampDuration)); - break; - } - case ESetVolume: - { - iAudioDevice.SetVolume(msg.iVolumeValue); - break; - } - case ESetMuted: - { - iAudioDevice.SetMuted(msg.iMuted); - break; - } - default: - { - break; - } - } - } - DEBUG_PRINTF2(_L8("COmxILPcmRendererProcessingFunction::CPFHelper::RunL : msg.iType[%d]"), msg.iType); - // setup for next callbacks - iMsgQueue.NotifyDataAvailable(iStatus); - SetActive(); - } - -void COmxILPcmRendererProcessingFunction::CPFHelper::DoCancel() - { - if (iMsgQueue.Handle()!=NULL) - { - iMsgQueue.CancelDataAvailable(); - } - } - -TInt COmxILPcmRendererProcessingFunction::CPFHelper::OpenDevice() - { - TProcMessage message; - message.iType = EOpenDevice; - return iMsgQueue.Send(message); - } - -TInt COmxILPcmRendererProcessingFunction::CPFHelper::CloseDevice() - { - DEBUG_PRINTF2(_L8("COmxILPcmRendererProcessingFunction::CPFHelper::CloseDevice : IsActive[%s]"), - (IsActive() ? "YES" : "NO")); - TProcMessage message; - message.iType = ECloseDevice; - return iMsgQueue.Send(message); - } - -TInt COmxILPcmRendererProcessingFunction::CPFHelper::CloseDeviceOnError() - { - DEBUG_PRINTF2(_L8("COmxILPcmRendererProcessingFunction::CPFHelper::CloseDeviceOnError : IsActive[%d]"), (IsActive() ? 1 : 0)); - - RThread thisThread; - if (thisThread.Id() == iHelperThreadId) - { - // Just do it... - iAudioDevice.Cancel(); - iAudioDevice.CloseDevice(); - } - else - { - - TProcMessage message; - message.iType = ECloseDeviceOnError; - TInt error = iMsgQueue.Send(message); - if (KErrNone != error) - { - // only wait if the message was sent into the queue... - iCallerSemaphore.Wait(); - } - } - - thisThread.Close(); - - return KErrNone; - - } - -TInt COmxILPcmRendererProcessingFunction::CPFHelper::Execute() - { - DEBUG_PRINTF2(_L8("CPFHelper::Execute : IsActive[%s]"), (IsActive() ? "YES" : "NO")); - TProcMessage message; - message.iType = EExecuteCommand; - return iMsgQueue.Send(message); - } - -TInt COmxILPcmRendererProcessingFunction::CPFHelper::Stop() - { - DEBUG_PRINTF2(_L8("CPFHelper::Stop : IsActive[%s]"), (IsActive() ? "YES" : "NO")); - TProcMessage message; - message.iType = EStopCommand; - return iMsgQueue.Send(message); - } - -TInt COmxILPcmRendererProcessingFunction::CPFHelper::CancelDevice() - { - DEBUG_PRINTF2(_L8("CPFHelper::CancelDevice : IsActive[%s]"), (IsActive() ? "YES" : "NO")); - TProcMessage message; - message.iType = ECancelCommand; - return iMsgQueue.Send(message); - } - -TInt COmxILPcmRendererProcessingFunction::CPFHelper::BufferIndication() - { - DEBUG_PRINTF2(_L8("CPFHelper::BufferIndication : IsActive[%s]"), (IsActive() ? "YES" : "NO")); - TProcMessage message; - message.iType = EBufferIndication; - return iMsgQueue.Send(message); - } - -TInt COmxILPcmRendererProcessingFunction::CPFHelper::MediaTimeIndication(const OMX_TIME_MEDIATIMETYPE& aMediaTimeType) - { - DEBUG_PRINTF2(_L8("CPFHelper::MediaTimeIndication : IsActive[%s]"), (IsActive() ? "YES" : "NO")); - TProcMessage message; - message.iType = EMediaTimeIndication; - message.iMediaTimeType.eUpdateType = aMediaTimeType.eUpdateType; - message.iMediaTimeType.eState = aMediaTimeType.eState; - message.iMediaTimeType.xScale = aMediaTimeType.xScale; - message.iMediaTimeType.nMediaTimestamp = aMediaTimeType.nMediaTimestamp; - - return iMsgQueue.Send(message); - } - -TInt COmxILPcmRendererProcessingFunction::CPFHelper::ParamIndication(const OMX_AUDIO_PARAM_PCMMODETYPE* aPcmModeType) - { - DEBUG_PRINTF2(_L8("CPFHelper::ParamIndication : IsActive[%s]"), (IsActive() ? "YES" : "NO")); - TProcMessage message; - message.iType = EParamIndication; - message.iPcmModeType.nChannels = aPcmModeType->nChannels; - message.iPcmModeType.nSamplingRate = aPcmModeType->nSamplingRate; - - return iMsgQueue.Send(message); - } - -TInt COmxILPcmRendererProcessingFunction::CPFHelper::SetVolumeRamp(const OMX_U64 aRampDuration) - { - DEBUG_PRINTF2(_L8("CPFHelper::SetVolumeRamp : IsActive[%s]"), (IsActive() ? "YES" : "NO")); - TProcMessage message; - message.iType = ESetVolumeRamp; - message.iRampDuration = aRampDuration; - - return iMsgQueue.Send(message); - } - -TInt COmxILPcmRendererProcessingFunction::CPFHelper::SetVolume(const OMX_S32 aVolumeValue) - { - DEBUG_PRINTF2(_L8("CPFHelper::SetVolume : IsActive[%s]"), (IsActive() ? "YES" : "NO")); - TProcMessage message; - message.iType = ESetVolume; - message.iVolumeValue = aVolumeValue; - - return iMsgQueue.Send(message); - } - -TInt COmxILPcmRendererProcessingFunction::CPFHelper::SetMuted(const OMX_BOOL aMuted) - { - DEBUG_PRINTF2(_L8("CPFHelper::SetMuted : IsActive[%s]"), (IsActive() ? "YES" : "NO")); - TProcMessage message; - message.iType = ESetMuted; - message.iMuted = aMuted; - - return iMsgQueue.Send(message); - } +/* +* 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 + +#ifdef SYMBIAN_MDF_SHAREDCHUNK_SOUNDDRIVER +#include +#endif //SYMBIAN_MDF_SHAREDCHUNK_SOUNDDRIVER + +#include "log.h" +#include "omxilcallbacknotificationif.h" +#include "omxilclockcomponentcmdsif.h" +#include "omxilsymbianaudiopcmextensions.h" +#include "omxilpcmrendererprocessingfunction.h" + +const TInt COmxILPcmRendererProcessingFunction::CPFHelper::KMaxMsgQueueEntries; + +COmxILPcmRendererProcessingFunction* +COmxILPcmRendererProcessingFunction::NewL(MOmxILCallbackNotificationIf& aCallbacks, + MOmxILClockComponentCmdsIf& aClientClockPort) + { + DEBUG_PRINTF(_L8("COmxILPcmRendererProcessingFunction::NewL")); + + COmxILPcmRendererProcessingFunction* self = + new (ELeave)COmxILPcmRendererProcessingFunction(aCallbacks, aClientClockPort); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + + } + +void +COmxILPcmRendererProcessingFunction::ConstructL() + { + DEBUG_PRINTF(_L8("COmxILPcmRendererProcessingFunction::ConstructL")); + + iAudioDevice = CAudioDevice::NewL(*this); + iPFHelper = CPFHelper::NewL(*iAudioDevice); + } + +COmxILPcmRendererProcessingFunction::COmxILPcmRendererProcessingFunction( + MOmxILCallbackNotificationIf& aCallbacks, + MOmxILClockComponentCmdsIf& aClientClockPort) + : + COmxILProcessingFunction(aCallbacks), + iClientClockPortPtr(&aClientClockPort) + { + DEBUG_PRINTF(_L8("COmxILPcmRendererProcessingFunction::COmxILPcmRendererProcessingFunction")); + + } + +COmxILPcmRendererProcessingFunction::~COmxILPcmRendererProcessingFunction() + { + DEBUG_PRINTF(_L8("COmxILPcmRendererProcessingFunction::~COmxILPcmRendererProcessingFunction")); + + // Check in case the Sound Device has not been closed. That would happen in + // an scenario where the component is not being deleted in an orderer way. + if(iAudioDevice && iPFHelper && + (iState == OMX_StateInvalid || + iState == OMX_StateExecuting || + iState == OMX_StatePause)) + { + // Ignore error if the following call fails + iPFHelper->CloseDeviceOnError(); + } + + // Buffer headers are not owned by the processing function + iBuffersToEmpty.Close(); + iBuffersEmptied.Close(); + delete iAudioDevice; + delete iPFHelper; + } + + +OMX_ERRORTYPE +COmxILPcmRendererProcessingFunction::StateTransitionIndication(COmxILFsm::TStateIndex aNewState) + { + DEBUG_PRINTF(_L8("COmxILPcmRendererProcessingFunction::StateTransitionIndication")); + + OMX_ERRORTYPE err = OMX_ErrorNone; + switch(aNewState) + { + case COmxILFsm::EStateExecuting: + { + DEBUG_PRINTF(_L8("StateTransitionIndication : OMX_StateExecuting")); + if (iPFHelper->Execute() != KErrNone) + { + return OMX_ErrorInsufficientResources; + } + } + break; + case COmxILFsm::EStateInvalid: + { + DEBUG_PRINTF(_L8("StateTransitionIndication : OMX_StateInvalid")); + if (iPFHelper->Stop() != KErrNone) + { // InsufficientResources to stop??? + return OMX_ErrorInsufficientResources; + } + } + break; + case COmxILFsm::EStatePause: + { + DEBUG_PRINTF(_L8("StateTransitionIndication : OMX_StatePause")); + err = iAudioDevice->MoveToPausedState(); + } + break; + case COmxILFsm::EStateIdle: + { + DEBUG_PRINTF(_L8("StateTransitionIndication : OMX_StateIdle")); + iBuffersToEmpty.Reset(); + if (iPFHelper->Stop() != KErrNone) + { // InsufficientResources to stop??? + return OMX_ErrorInsufficientResources; + } + } + break; + case COmxILFsm::EStateLoaded: + case COmxILFsm::EStateWaitForResources: + { + DEBUG_PRINTF(_L8("StateTransitionIndication : OMX_StateLoaded, OMX_StateWaitForResources")); + if (iPFHelper->Stop() != KErrNone) + { // InsufficientResources to stop??? + return OMX_ErrorInsufficientResources; + } + } + break; + case COmxILFsm::ESubStateLoadedToIdle: + { + DEBUG_PRINTF(_L8("StateTransitionIndication : ESubStateLoadedToIdle")); + if (iPFHelper->OpenDevice() != KErrNone) + { + return OMX_ErrorInsufficientResources; + } + } + break; + case COmxILFsm::ESubStateIdleToLoaded: + { + DEBUG_PRINTF(_L8("StateTransitionIndication : ESubStateIdleToLoaded")); + if (iPFHelper->CloseDevice() != KErrNone) + { // InsufficientResources to close??? + return OMX_ErrorInsufficientResources; + } + } + break; + case COmxILFsm::ESubStateExecutingToIdle: + case COmxILFsm::ESubStatePauseToIdle: + { + // Ignore these transitions... + return OMX_ErrorNone; + } + default: + { + // Always ASSERT; This would be a problem in the framework. + ASSERT(0); + return OMX_ErrorIncorrectStateTransition; + } + }; + + return err; + + } + + +OMX_ERRORTYPE +COmxILPcmRendererProcessingFunction::BufferFlushingIndication( + TUint32 aPortIndex, + OMX_DIRTYPE aDirection) + { + DEBUG_PRINTF2(_L8("COmxILPcmRendererProcessingFunction::BufferFlushingIndication : aPortIndex[%d]"), aPortIndex); + + if ((aPortIndex == OMX_ALL && aDirection == OMX_DirMax) || + (aPortIndex == KPCMRENDERER_APB0PORT_INDEX && aDirection == OMX_DirInput)) + { + // If we are currently processing a buffer then cancel + if (iPFHelper->CancelDevice() != KErrNone) + { + return OMX_ErrorInsufficientResources; + } + + // Send BufferDone notifications for each emptied buffer... + FlushBufferList(iBuffersEmptied); + + // Send BufferDone notifications for each pending buffer... + FlushBufferList(iBuffersToEmpty); + + return OMX_ErrorNone; + } + else if (aPortIndex == KPCMRENDERER_OPB0PORT_INDEX && aDirection == OMX_DirInput) + { + // Since the clock port buffers are returned immediately, + // there's nothing to flush for the port + return OMX_ErrorNone; + } + else + { + // Always ASSERT; This would be a problem in the framework. + ASSERT(0); + return OMX_ErrorBadParameter; + } + } + +void +COmxILPcmRendererProcessingFunction::FlushBufferList( + RPointerArray& aBufferList) + { + DEBUG_PRINTF2(_L8("COmxILPcmRendererProcessingFunction::FlushBufferList : [%s]"), + &aBufferList == &iBuffersToEmpty ? "iBuffersToEmpty" : "iBuffersEmptied"); + + const TUint bufferCount = aBufferList.Count(); + OMX_BUFFERHEADERTYPE* pBufferHeader = 0; + // We know there is only one input port... + OMX_DIRTYPE portDirection = OMX_DirInput; + + for (TUint i=0; inFilledLen = 0; + iCallbacks. + BufferDoneNotification( + pBufferHeader, + pBufferHeader->nInputPortIndex, + portDirection + ); + } + + // Empty buffer list... + aBufferList.Reset(); + + } + + +OMX_ERRORTYPE +COmxILPcmRendererProcessingFunction::ParamIndication( + OMX_INDEXTYPE aParamIndex, + const TAny* apComponentParameterStructure) + { + DEBUG_PRINTF(_L8("COmxILPcmRendererProcessingFunction::ParamIndication")); + + OMX_ERRORTYPE err = OMX_ErrorNone; + switch(aParamIndex) + { + case OMX_IndexParamAudioPcm: + { + const OMX_AUDIO_PARAM_PCMMODETYPE* pPcmProfile + = static_cast( + apComponentParameterStructure); + + if((pPcmProfile->nChannels == 1 || pPcmProfile->nChannels == 2) && + (pPcmProfile->eNumData == OMX_NumericalDataSigned) && + (pPcmProfile->eEndian == OMX_EndianBig) && + (pPcmProfile->bInterleaved == OMX_TRUE) && + (pPcmProfile->nBitPerSample == 16) && + ((pPcmProfile->nSamplingRate == 8000) || + (pPcmProfile->nSamplingRate == 11025) || + (pPcmProfile->nSamplingRate == 12000) || + (pPcmProfile->nSamplingRate == 16000) || + (pPcmProfile->nSamplingRate == 22050) || + (pPcmProfile->nSamplingRate == 24000) || + (pPcmProfile->nSamplingRate == 32000) || + (pPcmProfile->nSamplingRate == 44100) || + (pPcmProfile->nSamplingRate == 48000)) && + (pPcmProfile->ePCMMode == OMX_AUDIO_PCMModeLinear) && + (pPcmProfile->eChannelMapping[0] == OMX_AUDIO_ChannelLF) && + (pPcmProfile->eChannelMapping[1] == OMX_AUDIO_ChannelRF)) + { + if (iPFHelper->ParamIndication(pPcmProfile) != KErrNone) + { + err = OMX_ErrorInsufficientResources; + } + } + else + { + err = OMX_ErrorBadParameter; + } + } + break; + default: + { + // Ignore other port param changes... + } + }; + + return err; + + } + +OMX_ERRORTYPE +COmxILPcmRendererProcessingFunction::ConfigIndication(OMX_INDEXTYPE aConfigIndex, + const TAny* apComponentConfigStructure) + { + DEBUG_PRINTF2(_L8("COmxILPcmRendererProcessingFunction::ConfigIndication %X"), aConfigIndex); + + OMX_ERRORTYPE err = OMX_ErrorNone; + switch(aConfigIndex) + { + case OMX_SymbianIndexConfigAudioPcmVolumeRamp: + { + const OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP* + pPcmVolumeRamp + = static_cast< + const OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP*>( + apComponentConfigStructure); + + if (iPFHelper->SetVolumeRamp(pPcmVolumeRamp->nRampDuration) != KErrNone) + { + err = OMX_ErrorInsufficientResources; + } + } + break; + + case OMX_IndexConfigAudioVolume: + { + const OMX_AUDIO_CONFIG_VOLUMETYPE* pVolumeType + = static_cast( + apComponentConfigStructure); + + if (pVolumeType->bLinear == OMX_TRUE) + { + // Some configuration structures contain read-only fields. The + // OMX_SetConfig method will preserve read-only fields in configuration + // structures that contain them, and shall not generate an error when + // the caller attempts to change the value of a read-only field. + err = OMX_ErrorNone; + break; + } + + if ((pVolumeType->sVolume.nValue <= pVolumeType->sVolume.nMax) && + (pVolumeType->sVolume.nValue >= pVolumeType->sVolume.nMin)) + { + if (iPFHelper->SetVolume(pVolumeType->sVolume.nValue) != KErrNone) + { + err = OMX_ErrorInsufficientResources; + } + } + else + { + err = OMX_ErrorBadParameter; + } + } + break; + + case OMX_IndexConfigAudioMute: + { + const OMX_AUDIO_CONFIG_MUTETYPE* pVolumeType + = static_cast( + apComponentConfigStructure); + + if (iPFHelper->SetMuted(pVolumeType->bMute) != KErrNone) + { + err = OMX_ErrorInsufficientResources; + } + } + break; + + default: + { + // Ignore other port config changes... + } + }; + + return err; + + } + +OMX_ERRORTYPE +COmxILPcmRendererProcessingFunction::BufferIndication( + OMX_BUFFERHEADERTYPE* apBufferHeader, + OMX_DIRTYPE aDirection) + { + DEBUG_PRINTF2(_L8("COmxILPcmRendererProcessingFunction::BufferIndication : [%X]"), apBufferHeader); + + if (aDirection != OMX_DirInput) + { + return OMX_ErrorBadParameter; + } + + if (iBuffersToEmpty.Append(apBufferHeader) != KErrNone) + { + return OMX_ErrorInsufficientResources; + } + + // If we are not in an executing state or if the audio device is busy, delay playing back the buffer + if (iState != OMX_StateExecuting || iAudioDevice->IsActive()) + { + return OMX_ErrorNone; + } + + if (iPFHelper->BufferIndication() != KErrNone) + { + return OMX_ErrorInsufficientResources; + } + + return OMX_ErrorNone; + } + +OMX_ERRORTYPE COmxILPcmRendererProcessingFunction::MediaTimeIndication(const OMX_TIME_MEDIATIMETYPE& aMediaTimeType) + { + // Received a requested media time notification. + DEBUG_PRINTF5(_L8("MediaTimeIndication : eUpdateType = %d eState = %d xScale = %d nMediaTimestamp = %d "), + aMediaTimeType.eUpdateType, aMediaTimeType.eState, aMediaTimeType.xScale, aMediaTimeType.nMediaTimestamp); + + iPFHelper->MediaTimeIndication(aMediaTimeType); + return OMX_ErrorNone; + } + +OMX_BOOL +COmxILPcmRendererProcessingFunction::BufferRemovalIndication( + OMX_BUFFERHEADERTYPE* apBufferHeader, + OMX_DIRTYPE /* aDirection */) + { + DEBUG_PRINTF2(_L8("COmxILPcmRendererProcessingFunction::BufferRemovalIndication : BUFFER [%X]"), apBufferHeader); + + TBool headerDeletionResult = ETrue; + // Check if the buffer we want to remove is the one is being currently processed + if (iAudioDevice->IsActive() && iAudioDevice->GetCurrentBuffer() == apBufferHeader) + { + if (iPFHelper->CancelDevice() != KErrNone) + { + return OMX_FALSE; + } + + // if you cancel the audio device then you send the buffer to the other end of the tunnel + // so you shouldn't say that you had the buffer in the processing function in this situation. + headerDeletionResult = EFalse; + } + else + { + TInt headerIndexInArray = KErrNotFound; + if (KErrNotFound != + (headerIndexInArray = + iBuffersToEmpty.Find(apBufferHeader))) + { + iBuffersToEmpty.Remove(headerIndexInArray); + } + else if(KErrNotFound != + (headerIndexInArray = + iBuffersEmptied.Find(apBufferHeader))) + { + iBuffersEmptied.Remove(headerIndexInArray); + } + else + { + headerDeletionResult = EFalse; + } + } + + DEBUG_PRINTF2(_L8("BufferRemovalIndication : Removal result [%s]"), (headerDeletionResult ? "YES" : "NO")); + return (headerDeletionResult ? OMX_TRUE : OMX_FALSE); + } + +TInt +COmxILPcmRendererProcessingFunction::GetBytesPlayed() const + { + return iAudioDevice->GetBytesPlayed(); + } + + +COmxILPcmRendererProcessingFunction::CAudioDevice* COmxILPcmRendererProcessingFunction::CAudioDevice::NewL(COmxILPcmRendererProcessingFunction& aParent) + { + CAudioDevice* self = new (ELeave) CAudioDevice(aParent); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +COmxILPcmRendererProcessingFunction::CAudioDevice::CAudioDevice(COmxILPcmRendererProcessingFunction& aParent) +: CActive(EPriorityUserInput), + iParent(aParent), + iSampleRate(KDefaultSampleRate), + iChannels(KDefaultNumberChannels), + iEncoding(KDefaultEncoding), + iVolume(KDefaultVolume), + iMuted(KDefaultMuted), + iBufferSize(KBufferSize), + iClockStateRunning(EFalse), + iPausedClockViaScale(EFalse), + iIsStartTimeFlagSet(EFalse) + { + CActiveScheduler::Add(this); + } + + +void COmxILPcmRendererProcessingFunction::CAudioDevice::ConstructL() + { + iCachedPlayBuffer.CreateL(0); + } + +COmxILPcmRendererProcessingFunction::CAudioDevice::~CAudioDevice() + { + delete iPeriodic; + Cancel(); + iCachedPlayBuffer.Close(); + } + +void COmxILPcmRendererProcessingFunction::CAudioDevice::RunL() + { + DEBUG_PRINTF(_L8("CAudioDevice::RunL : ")); + if (iStatus != KErrNone) + { + switch(iStatus.Int()) + { + case KErrUnderflow: + DEBUG_PRINTF(_L8("CAudioDevice::RunL : KErrUnderflow")); + iParent.iCallbacks.ErrorEventNotification(OMX_ErrorUnderflow); + break; + + case KErrOverflow: + DEBUG_PRINTF(_L8("CAudioDevice::RunL : KErrOverflow")); + iParent.iCallbacks.ErrorEventNotification(OMX_ErrorOverflow); + break; + + default: + DEBUG_PRINTF2(_L8("CAudioDevice::RunL : [%d] -> OMX_ErrorHardware"), iStatus.Int()); + iParent.iCallbacks.ErrorEventNotification(OMX_ErrorHardware); + }; + } + + ASSERT(iCurrentBuffer); + // Update the last value of bytes played... + iLastBytesPlayedValue = iSoundDevice.BytesPlayed(); + + // Return the emptied buffer to the IL Client or the tunnelled + // component.. + SignalBufferCompletion(iCurrentBuffer); + iCurrentBuffer = 0; + + // Make sure to clear the aggregated cache buffer, if it was used + iCachedPlayBuffer.Zero(); + } + +void COmxILPcmRendererProcessingFunction::CAudioDevice::SignalBufferCompletion( + OMX_BUFFERHEADERTYPE* apCurrentBuffer) + { + DEBUG_PRINTF2(_L8("CAudioDevice::SignalBufferCompletion : BUFFER = [%X]"), apCurrentBuffer); + + iParent.iBuffersEmptied.Append(apCurrentBuffer); + + // Process the queue only if in executing state... + if (iParent.iState == OMX_StateExecuting) + { + const TUint bufferCount = iParent.iBuffersEmptied.Count(); + OMX_BUFFERHEADERTYPE* pBufferHeader = 0; + for (TUint i=0; inFlags & OMX_BUFFERFLAG_EOS) + { + lastBuffer = ETrue; + } + + pBufferHeader->nFilledLen = 0; + iParent.iCallbacks.BufferDoneNotification(pBufferHeader, + pBufferHeader->nInputPortIndex, + OMX_DirInput); + if (lastBuffer) + { + pBufferHeader->nFlags |= OMX_BUFFERFLAG_EOS; + // propagate the EOS flag + iParent.iCallbacks.EventNotification( + OMX_EventBufferFlag, + KPCMRENDERER_APB0PORT_INDEX, + pBufferHeader->nFlags, + NULL); + } + } + + // Empty list... + iParent.iBuffersEmptied.Reset(); + } + + if (iParent.iBuffersToEmpty.Count() > 0) + { + DEBUG_PRINTF2(_L8("CAudioDevice::RunL : iBuffersToEmpty.Count = [%d]"), + iParent.iBuffersToEmpty.Count()); + iParent.iPFHelper->BufferIndication(); + } + + } + + +TBool COmxILPcmRendererProcessingFunction::CAudioDevice::ConstructAndStartUpdateTimer() + { + // Need this check if: + // - The component state transitions from Execution-Idle-Execution + // - The Clock's state transitions from Running-Stop-Running + if (iPeriodic == NULL) + { + iPeriodic = CPeriodic::New(EPriorityStandard); + + if (iPeriodic == NULL) + { + iParent.iCallbacks.ErrorEventNotification(OMX_ErrorInsufficientResources); + return EFalse; + } + } + + StartUpdateTimer(); + + return ETrue; + } + + +void COmxILPcmRendererProcessingFunction::CAudioDevice::ProcessNextBuffer() + { + if (iParent.iBuffersToEmpty.Count() == 0) + return; + + // To implement A/V Sync, we should start playing only once the clock component gives the appopriate command + // If the clock component is not available, we start playing immediately + // Since the PCM Renderer supplies the reference clock, we make sure to initialise the clock component with + // the reference when we receive the first buffer + + if (!iParent.iClientClockPortPtr->IsClockComponentAvailable()) + { + PlayData(); + return; + } + + OMX_BUFFERHEADERTYPE* bufferPtr = iParent.iBuffersToEmpty[0]; + + TBool bufferHasStartTime = bufferPtr->nFlags & OMX_BUFFERFLAG_STARTTIME; + + if (!iClockStateRunning) + { + if (!bufferHasStartTime) + { + // Connected with the Clock but OMX_BUFFERFLAG_STARTTIME isn't set; simply queue the buffer + return; + } + else + { + OMX_ERRORTYPE err = iParent.iClientClockPortPtr->SetStartTime(static_cast(bufferPtr->nTimeStamp)); + + if (err == OMX_ErrorNone) + { + // Clear the returning buffer's flag + bufferPtr->nFlags &= ~OMX_BUFFERFLAG_STARTTIME; + } + else + { + // NOTE: If the Clock is not in OMX_TIME_ClockStateWaitingForStartTime, + // currently SetStartTime will return OMX_ErrorIncorrectStateOperation + + // It is not the PCM renderer to flag a Clock component error; + // therefore, ignore the error. + // + // As the Clock is not in OMX_TIME_ClockStateRunning state, the Renderer needs + // to keep the OMX_BUFFERFLAG_STARTTIME in the first buffer until the Clock + // moves into OMX_TIME_ClockStateWaitingForStartTime or OMX_TIME_ClockStateRunning + // state + DEBUG_PRINTF2(_L8("CAudioDevice::ProcessNextBuffer SetStartTime() return %d"), err); + } + + // Update the iStartMediaTime + iParent.iStartMediaTime = static_cast(bufferPtr->nTimeStamp); + iIsStartTimeFlagSet = ETrue; + } + } // (!iClockStateRunning) + else + { + if (bufferHasStartTime) + { + // The Clock moves straight into OMX_TIME_ClockStateRunning state, + // clear the returning buffer's flag. + bufferPtr->nFlags &= ~OMX_BUFFERFLAG_STARTTIME; + } + + if (!iPlayData) + { + // Not allowed to render audio. This could be due to: + // - The renderer is waiting for a time completion notification from the Clock; + return; + } + + if (!iIsStartTimeFlagSet) + { + // As the StartTimeFlag is not mandatory; therefore it might be missing from the first audio buffer + // In such a case, we use the first buffer's timestamp as the StartMediaTime. + // + // NOTE: Since the Clock is running, calling SetStartTime() to the Clock is meaningless + + // Update the iStartMediaTime + iParent.iStartMediaTime = static_cast(bufferPtr->nTimeStamp); + iIsStartTimeFlagSet = ETrue; + + // Cross checking the Clock's media timestamp with iStartMediaTime to see + // data can be rendered straight away + if (!CanPlayNow()) + { + return; + } + + if (!ConstructAndStartUpdateTimer()) + { + return; + } + } + + DEBUG_PRINTF3(_L8("ProcessNextBuffer : iStartMediaTime = %d nTimeStamp = %d"), + I64LOW(iParent.iStartMediaTime), I64LOW(bufferPtr->nTimeStamp)); + + if (!iPausedClockViaScale) //if clock scale is zero then we are effectively paused + { + PlayData(); + } + } // else + } + + +void COmxILPcmRendererProcessingFunction::CAudioDevice::PlayData() + { + DEBUG_PRINTF(_L8("COmxILPcmRendererProcessingFunction::CAudioDevice::PlayData()++")); + if (iParent.iBuffersToEmpty.Count() == 0 || iSoundDevice.Handle() == 0 || IsActive()) + { + DEBUG_PRINTF(_L8("COmxILPcmRendererProcessingFunction::CAudioDevice::PlayData() nothing to play, or there is an outstanding request")); + return; + } + + iCurrentBuffer = iParent.iBuffersToEmpty[0]; + + iParent.iBuffersToEmpty.Remove(0); + + CMMFDataBuffer* mmfSrcBuffer = static_cast(iCurrentBuffer->pInputPortPrivate); + mmfSrcBuffer->Data().SetLength(iCurrentBuffer->nFilledLen); + + // Attenuate the amplitude of the samples if volume ramping has been changed + if (iRampAudioSample) + { + iRampAudioSample = RampAudio(mmfSrcBuffer); + } + + // First, check whether the buffer length is sufficient not to cause underflows in the device driver + TBool isFilledLengthSufficient = IsBufferLengthSufficient(iCurrentBuffer->nFilledLen); + // This variable defines whether we should send the data to the driver directly, or append it to an aggregated buffer + // We append the buffer instead of sending it directly, if (i) the buffer is too small, or (ii) we have already aggregated something. + TBool appendBuffer = (!isFilledLengthSufficient || iCachedPlayBuffer.Length() > 0) ? ETrue : EFalse; + if (!appendBuffer) + { + SendBufferToSoundDevice(mmfSrcBuffer->Data()); + } + else + { + // Check if we need to allocate the cached buffer + if (iCachedPlayBuffer.MaxLength() == 0) + { + // The RMdaDevSound shim allocates the shared chunk according to the maxLength of the descriptor it receives + // For this reason, we must allocate our buffer conservatively, otherwise the chunk may be insufficient and the RMdaDevSound shim will panic + TInt err = iCachedPlayBuffer.ReAlloc(GetMinBufferLength() + iCurrentBuffer->nAllocLen); + if (err != KErrNone) + { + iParent.iCallbacks.ErrorEventNotification(OMX_ErrorInsufficientResources); + return; + } + } + + iCachedPlayBuffer.Append(mmfSrcBuffer->Data()); + + // If we have sufficient length aggregated, play the cached buffer + // Also if this is the last buffer, we have to play it now, there's nothing left to cache + if (IsBufferLengthSufficient(iCachedPlayBuffer.Length()) || iCurrentBuffer->nFlags & OMX_BUFFERFLAG_EOS) + { + SendBufferToSoundDevice(iCachedPlayBuffer); + } + // If not, make sure to notify that we notify that the buffer is done for the OMX tunnnel, so that the port will be able to reuse it + else + { + SignalBufferCompletion(iCurrentBuffer); + iCurrentBuffer = NULL; + } + } + } + +void COmxILPcmRendererProcessingFunction::CAudioDevice::SendBufferToSoundDevice(TDes8& aBuffer) + { + ASSERT(!IsActive()); + iStatus = KRequestPending; + DEBUG_PRINTF2(_L8("COmxILPcmRendererProcessingFunction::CAudioDevice::SendBufferToSoundDevice() PlayData [%d]"), aBuffer.Length()); + iSoundDevice.PlayData(iStatus, aBuffer); + if (iResumeAfterNextPlay) + { + iResumeAfterNextPlay = EFalse; + iSoundDevice.ResumePlaying(); + } + SetActive(); + } + +TInt COmxILPcmRendererProcessingFunction::CAudioDevice::GetMinBufferLength() const + { + TInt minBufSize = KMinBufferMilliseconds * iSampleRate * iChannels / 1000; + if (iEncoding == RMdaDevSound::EMdaSoundEncoding16BitPCM) + { + minBufSize *= 2; // All other encodings use 1 byte per sample + } + return minBufSize; + } + +TBool COmxILPcmRendererProcessingFunction::CAudioDevice::IsBufferLengthSufficient(TInt aBufferLength) const + { + return aBufferLength >= GetMinBufferLength() ? ETrue : EFalse; + } + + +void COmxILPcmRendererProcessingFunction::CAudioDevice::ProcessMediaTimeIndication(OMX_TIME_MEDIATIMETYPE& aMediaTimeType) + { + switch (aMediaTimeType.eUpdateType) + { + case OMX_TIME_UpdateClockStateChanged: + { + HandleClockStateChanged(aMediaTimeType); + } + break; + + case OMX_TIME_UpdateRequestFulfillment: + { + // As the Clock was using another earlier start time; + // it is time for the PCM renderer to start playing the audio. + iPlayData = ETrue; + PlayData(); + + if (!ConstructAndStartUpdateTimer()) + { + return; + } + } + break; + + case OMX_TIME_UpdateScaleChanged: + { + HandleClockScaleChanged(aMediaTimeType); + } + break; + + default: + { + // Do nothing here + } + } + } + + +void COmxILPcmRendererProcessingFunction::CAudioDevice::StartUpdateTimer() + { + if (!iIsStartTimeFlagSet) + { + DEBUG_PRINTF(_L8("COmxILPcmRendererProcessingFunction::CAudioDevice::StartUpdateTimer() iIsStartTimeFlagSet == EFalse!!")); + return; + } + + // In case the timer already started + ASSERT(iPeriodic); + iPeriodic->Cancel(); + + TCallBack callback(UpdateClockMediaTime, this); + + // Start updating the Clock comp. every KPcmRendererTimePlayedDelay + iPeriodic->Start(KPcmRendererTimePlayedDelay, KPcmRendererTimePlayedDelay, callback); + } + + +TBool COmxILPcmRendererProcessingFunction::CAudioDevice::CanPlayNow() + { + if (iParent.iState != OMX_StateExecuting) + { + return EFalse; + } + + if (iClockMediaTime < iParent.iStartMediaTime) + { + // Once all required Clock's clients have responded, the clock component starts + // the media clock using the earliest client start time. + // Therefore, start playing the audio only when such time comes; send a time + // completion request to the Clock component + OMX_ERRORTYPE err = iParent.iClientClockPortPtr->MediaTimeRequest(NULL, iParent.iStartMediaTime, 0); + + if (err != OMX_ErrorNone) + { + DEBUG_PRINTF2(_L8("CAudioDevice::CanPlayNow() MediaTimeRequest() return %d"), err); + } + + // Indicate that processing a new buffer should not trigger a false start on playback. + iPlayData = EFalse; + return EFalse; + } + else if (iClockMediaTime > iParent.iStartMediaTime) + { + // NOTE: The spec. states that the clock should use the minimum of the received start times + // Therefore the Clock should NOT jump forwards with timestamp greater than the PCM + // Renderer iStartMediaTime + DEBUG_PRINTF3(_L8("CanPlayNow() nMediaTimestamp(%d) > iStartMediaTime(%d) IGNORE this use case"), + I64LOW(iClockMediaTime), I64LOW(iParent.iStartMediaTime)); + + // However if the Clock sends out a timestamp greater than the buffer's timestamp + // drop the buffers that fall outside the Clock specified MediaTimestamp; + + OMX_BUFFERHEADERTYPE* bufferPtr = iParent.iBuffersToEmpty[0]; + iParent.iBuffersToEmpty.Remove(0); + SignalBufferCompletion(bufferPtr); + bufferPtr = NULL; + + // Since the iStartMediaTime doesn't make sense anymore, reset iIsStartTimeFlagSet until the buffer's timestamp + // is within the the Clock's Media timestamp + iIsStartTimeFlagSet = EFalse; + return EFalse; + } + + return ETrue; + } + + +void COmxILPcmRendererProcessingFunction::CAudioDevice::HandleClockStateChanged(const OMX_TIME_MEDIATIMETYPE& aMediaTimeType) + { + switch (aMediaTimeType.eState) + { + case OMX_TIME_ClockStateRunning: + { + iClockMediaTime = aMediaTimeType.nMediaTimestamp; + + // There are two possibilities: + // case 1 - The clock goes straight into running and the PCM renderer processes the + // StateChanged notification prior the audio buffer + + if (iIsStartTimeFlagSet) + { + // OR + // case 2 - The PCM recieves the audio buffer, and the clock StateChanged notification + // comes later + + // Clear the returning buffer's flag. + iParent.iBuffersToEmpty[0]->nFlags &= ~OMX_BUFFERFLAG_STARTTIME; + + // Cross checking the Clock's media timestamp with iStartMediaTime to see + // data can be rendered straight away + if (!CanPlayNow()) + { + break; + } + + // Start playing the audio and start updating the Clock media time regularly + PlayData(); + + if (!ConstructAndStartUpdateTimer()) + { + return; + } + } + else if ((!iClockStateRunning) && (iParent.iState == OMX_StateExecuting)) + { + // The clock has gone to running but no start time flag was received. This would + // indicate that the client moved it straight from stopped to running. As we may + // have received buffers while in stopped state, we need to start processing + // them now. + DEBUG_PRINTF(_L8("HandleClockStateChanged() Gone to running without start time flag set")); + iClockStateRunning = ETrue; + ProcessNextBuffer(); + } + + // Otherwise, the queue is empty; + // + // NOTE: When !iIsStartTimeFlagSet && !iClockStateRunning would drop the incoming buffers; + // if the first buffer does not have the OMX_BUFFERFLAG_STARTTIME set + } + break; + + case OMX_TIME_ClockStateWaitingForStartTime: + { + if (iClockStateRunning) + { + DEBUG_PRINTF(_L8("HandleClockStateChanged() OMX_TIME_ClockStateRunning -> OMX_TIME_ClockStateWaitingForStartTime IGNORED!!")); + } + else + { + // Let's try to process buffers (if any). + ProcessNextBuffer(); + } + } + break; + + case OMX_TIME_ClockStateStopped: + { + if (iClockStateRunning) + { + // The Clock was in "Running" state but not anymore; stop the audio + if (IsActive()) + { + Cancel(); + } + else + { + DoCancel(); + } + + iPlayData = ETrue; + if (iIsStartTimeFlagSet) + { + iIsStartTimeFlagSet = EFalse; + iPeriodic->Cancel(); + } + } + + // Otherwise, ignore other possibilities + } + + break; + + default: + { + DEBUG_PRINTF2(_L8("HandleClockStateChanged() aMediaTimeType.eState = %d IGNORED!!"), aMediaTimeType.eState); + } + break; + } + + iClockStateRunning = (aMediaTimeType.eState == OMX_TIME_ClockStateRunning) ? ETrue : EFalse; + } + + +void COmxILPcmRendererProcessingFunction::CAudioDevice::HandleClockScaleChanged(const OMX_TIME_MEDIATIMETYPE& aMediaTimeType) + { + if (aMediaTimeType.xScale == 0) + { + PauseAudio(); + iPausedClockViaScale = ETrue; + DEBUG_PRINTF2(_L8("HandleClockScaleChanged() pausing iPausedClockViaScale = %d"), iPausedClockViaScale); + } + else if (aMediaTimeType.xScale == 0x10000) + { + // The scale is a Q16 value + iPausedClockViaScale = EFalse; + DEBUG_PRINTF2(_L8("HandleClockScaleChanged() resuming iPausedClockViaScale = %d"), iPausedClockViaScale); + + // If we are active then there is an outstanding PlayData() request so we need to call ResumePlaying(). + // However calling ResumePlaying() without an outstanding PlayData() request can cause the TimePLayed() API + // to go awry, so we should defer calling ResumePlaying() until the next PlayData() call. + if (IsActive()) + { + iSoundDevice.ResumePlaying(); + } + else + { + iResumeAfterNextPlay = ETrue; + } + iParent.iPFHelper->BufferIndication(); //handles the race condition where both 1) iSoundDevice was paused after the last PlayData() completed and before it was passed any data & 2) BufferIndication()s came in for all the IL buffers while in this paused state + StartUpdateTimer(); + } + + // TODO: Handle the rest of the scale values + + } + + +void COmxILPcmRendererProcessingFunction::CAudioDevice::DoCancel() + { + if (iSoundDevice.Handle() != 0) + { + iSoundDevice.CancelPlayData(); + iSoundDevice.FlushPlayBuffer(); + } + + if (iCurrentBuffer) + { + iCurrentBuffer->nFilledLen = 0; + + iParent.iCallbacks.BufferDoneNotification(iCurrentBuffer, + iCurrentBuffer->nInputPortIndex, + OMX_DirInput); + + iCachedPlayBuffer.Zero(); + iCurrentBuffer = NULL; + } + } + + +OMX_ERRORTYPE COmxILPcmRendererProcessingFunction::CAudioDevice::OpenDevice() + { + OMX_ERRORTYPE err = OMX_ErrorNone; + if(!iSoundDevice.Handle()) + { +#ifdef SYMBIAN_MDF_SHAREDCHUNK_SOUNDDRIVER + if(KErrNone != iSoundDevice.Open(KSoundScTxUnit0)) +#else //SYMBIAN_MDF_SHAREDCHUNK_SOUNDDRIVER + if(KErrNone != iSoundDevice.Open()) +#endif //SYMBIAN_MDF_SHAREDCHUNK_SOUNDDRIVER + { + err = OMX_ErrorHardware; + } + } + return err; + } + +OMX_ERRORTYPE COmxILPcmRendererProcessingFunction::CAudioDevice::CloseDevice() + { + OMX_ERRORTYPE err = OMX_ErrorNone; + if(iSoundDevice.Handle()) + { + iSoundDevice.Close(); + iResumeAfterNextPlay = EFalse; + } + return err; + } + +OMX_ERRORTYPE COmxILPcmRendererProcessingFunction::CAudioDevice::Execute() + { + if(!iSoundDevice.Handle()) + { + if(KErrNone != iSoundDevice.Open()) + { + return OMX_ErrorHardware; + } + } + + if(iParent.iState == OMX_StatePause) + { + // Now we can send BufferDone notifications for each emptied + // buffer... + iParent.FlushBufferList(iParent.iBuffersEmptied); + // If we are active then there is an outstanding PlayData() request so we need to call ResumePlaying(). + // However calling ResumePlaying() without an outstanding PlayData() request can cause the TimePLayed() API + // to go awry, so we should defer calling ResumePlaying() until the next PlayData() call. + if (IsActive()) + { + iSoundDevice.ResumePlaying(); + } + else + { + iResumeAfterNextPlay = ETrue; + } + StartUpdateTimer(); + } + else + { + // Set play format + RMdaDevSound::TCurrentSoundFormatBuf buf; + iSoundDevice.GetPlayFormat(buf); + buf().iRate = iSampleRate; + buf().iChannels = iChannels; + buf().iBufferSize = iBufferSize; + buf().iEncoding = iEncoding; + if(KErrNone != iSoundDevice.SetPlayFormat(buf)) + { + return OMX_ErrorHardware; + } + + if (iMuted) + { + iSoundDevice.SetVolume(0); + } + else + { + iSoundDevice.SetVolume(iVolume); + } + } + + iParent.iState = OMX_StateExecuting; + + // Make sure to start processing of queued up buffers (if any) + if (!IsActive() && iParent.iBuffersToEmpty.Count() > 0) + { + ProcessNextBuffer(); + } + + return OMX_ErrorNone; + } + +OMX_ERRORTYPE COmxILPcmRendererProcessingFunction::CAudioDevice::MoveToPausedState() + { + iParent.iState = OMX_StatePause; + PauseAudio(); + + return OMX_ErrorNone; + } + +OMX_ERRORTYPE COmxILPcmRendererProcessingFunction::CAudioDevice::Stop() + { + if(iParent.iState == OMX_StateExecuting || iParent.iState == OMX_StatePause) + { + // Cancel and flush the device driver + Cancel(); + + // Cancel timer to stop calling RSoundSc::TimePlayed() + if (iIsStartTimeFlagSet) + { + ASSERT(iPeriodic); + iPeriodic->Cancel(); + } + + iParent.iState = OMX_StateIdle; + + // If the audio device is still open, store the last value of bytes + // played before closing the audio device... + if(iSoundDevice.Handle() != 0) + { + iLastBytesPlayedValue = iSoundDevice.BytesPlayed(); + // Close the sound device + iSoundDevice.Close(); + iResumeAfterNextPlay = EFalse; + } + } + + iClockStateRunning = EFalse; + iIsStartTimeFlagSet = EFalse; + iPlayData = ETrue; + + return OMX_ErrorNone; + } + + +void COmxILPcmRendererProcessingFunction::CAudioDevice::PauseAudio() + { + // Cancel timer to stop calling RSoundSc::TimePlayed() + if (iIsStartTimeFlagSet) + { + ASSERT(iPeriodic); + iPeriodic->Cancel(); + } + + if (iSoundDevice.Handle()) + { + iSoundDevice.PausePlayBuffer(); + } + } + + +OMX_ERRORTYPE COmxILPcmRendererProcessingFunction::CAudioDevice::SetChannels(TUint aChannels) + { + iChannels = aChannels; + return SetPlayFormat(); + } + +OMX_ERRORTYPE COmxILPcmRendererProcessingFunction::CAudioDevice::SetSampleRate(TUint aSampleRate) + { + iSampleRate = aSampleRate; + return SetPlayFormat(); + } + +TInt ConvertOmxToSymbianVolume(TInt aVolume) + { + // OpenMax volume is in millibels while Symbian volume is in 0.5 db increments in the [0..255] range + // We divide by 50 as 0.5 dB = 50 millibells + TInt res = KMedianVolume + aVolume / 50; + if (res < 0) + return 0; + if (res > KMaxVolume) + return KMaxVolume; + return res; + } + +OMX_ERRORTYPE COmxILPcmRendererProcessingFunction::CAudioDevice::SetVolume(TInt aVolume) + { + iVolume = ConvertOmxToSymbianVolume(aVolume); + if ((!iMuted) && (iSoundDevice.Handle() != 0)) + { + iSoundDevice.SetVolume(iVolume); + } + return OMX_ErrorNone; + } + +OMX_ERRORTYPE COmxILPcmRendererProcessingFunction::CAudioDevice::SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration) + { + iVolumeRamp = aRampDuration; + if(iVolumeRamp.Int64() != 0) + { + iRampAudioSample = ETrue; + ConfigAudioRamper( + iVolumeRamp.Int64()); + } + else + { + iRampAudioSample = EFalse; + } + return OMX_ErrorNone; + } + +OMX_ERRORTYPE COmxILPcmRendererProcessingFunction::CAudioDevice::SetMuted(TBool aMuted) + { + iMuted = aMuted; + + if (iSoundDevice.Handle() == 0) + { + // Just cache the value; the value will be set once the the device is opened + return OMX_ErrorNone; + } + + if (iMuted) + { + iSoundDevice.SetVolume(0); + } + else + { + iSoundDevice.SetVolume(iVolume); + } + return OMX_ErrorNone; + } + +OMX_ERRORTYPE COmxILPcmRendererProcessingFunction::CAudioDevice::SetPlayFormat() + { + if (iParent.iState == OMX_StateExecuting) + { + RMdaDevSound::TCurrentSoundFormatBuf buf; + iSoundDevice.GetPlayFormat(buf); + buf().iRate = iSampleRate; + buf().iChannels = iChannels; + buf().iBufferSize = iBufferSize; + buf().iEncoding = iEncoding; + if(KErrNone != iSoundDevice.SetPlayFormat(buf)) + { + return OMX_ErrorHardware; + } + } + return OMX_ErrorNone; + } + +OMX_BUFFERHEADERTYPE* COmxILPcmRendererProcessingFunction::CAudioDevice::GetCurrentBuffer() + { + return iCurrentBuffer; + } + +TInt COmxILPcmRendererProcessingFunction::CAudioDevice::GetBytesPlayed() + { + if(iSoundDevice.Handle() != 0) + { + return iSoundDevice.BytesPlayed(); + } + + return iLastBytesPlayedValue; + } + +void COmxILPcmRendererProcessingFunction::CAudioDevice::ConfigAudioRamper(TInt64 aRampTime) + { + iRampSamples = I64LOW(((TInt64(iSampleRate) * aRampTime) /1000000 )); // Add this + iRampSamplesLeft = iRampSamples; + iRampIncr = 0; + iSkip = ETrue; + } + +TBool COmxILPcmRendererProcessingFunction::CAudioDevice::RampAudio(CMMFDataBuffer* aBuffer) + { + TInt i=0; + TInt length = aBuffer->Data().Length()>>1; + if (length == 0) + { + return EFalse; + } + + TInt16* sample = REINTERPRET_CAST(TInt16*,&aBuffer->Data()[0]); + TInt64 theResult(0); + while ((i < length) && (iRampIncr < iRampSamples)) + { + theResult = sample[i]; + theResult *= iRampIncr; + theResult /= iRampSamples; + sample[i] = STATIC_CAST(TInt16, I64LOW(theResult) ); + + if ((iChannels == 1) || (!iSkip)) + { + iRampIncr++; + } + iSkip = !iSkip; + i++; + } + + if (iRampIncr < iRampSamples) + return ETrue; + else + return EFalse; + } + + +TInt COmxILPcmRendererProcessingFunction::CAudioDevice::UpdateClockMediaTime(TAny* aPtr) + { + CAudioDevice* ptr = (CAudioDevice*)aPtr; + TTimeIntervalMicroSeconds playedTime(0); + + if (ptr->iSoundDevice.GetTimePlayed(playedTime) != KErrNone) + { + ptr->iParent.iCallbacks.ErrorEventNotification(OMX_ErrorHardware); + return EFalse; + } + + OMX_ERRORTYPE err; + + // Update the clock component audio reference clock + err = ptr->iParent.iClientClockPortPtr->SetAudioReference(ptr->iParent.iStartMediaTime + playedTime.Int64()); + + if (err != OMX_ErrorNone) + { + ptr->iParent.iCallbacks.ErrorEventNotification(err); + return EFalse; + } + + DEBUG_PRINTF2(_L8("CAudioDevice::UpdateClockMediaTime : playedTime = %d"), + I64LOW(playedTime.Int64())); + + return ETrue; + } + + +void COmxILPcmRendererProcessingFunction::CAudioDevice::ProcessParamIndication(const OMX_AUDIO_PARAM_PCMMODETYPE& aPcmModeType) + { + if(SetChannels(aPcmModeType.nChannels) != OMX_ErrorNone) + { + iParent.iCallbacks.ErrorEventNotification(OMX_ErrorHardware); + return; + } + + if (SetSampleRate(aPcmModeType.nSamplingRate) != OMX_ErrorNone) + { + iParent.iCallbacks.ErrorEventNotification(OMX_ErrorHardware); + return; + } + } + +COmxILPcmRendererProcessingFunction::CPFHelper* COmxILPcmRendererProcessingFunction::CPFHelper::NewL(CAudioDevice& aAudioDevice) + { + CPFHelper* self = new (ELeave) CPFHelper(aAudioDevice); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +COmxILPcmRendererProcessingFunction::CPFHelper::CPFHelper(CAudioDevice& aAudioDevice) +: CActive(EPriorityUserInput), + iAudioDevice(aAudioDevice) + { + } + +void COmxILPcmRendererProcessingFunction::CPFHelper::ConstructL() + { + CActiveScheduler::Add(this); + User::LeaveIfError(iCallerSemaphore.CreateGlobal(KNullDesC, 0)); + User::LeaveIfError(iMsgQueue.CreateLocal(KMaxMsgQueueEntries)); + iMsgQueue.NotifyDataAvailable(iStatus); + RThread thisThread; + iHelperThreadId = thisThread.Id(); + thisThread.Close(); + SetActive(); + } + +COmxILPcmRendererProcessingFunction::CPFHelper::~CPFHelper() + { + Cancel(); + iMsgQueue.Close(); + iCallerSemaphore.Close(); + } + +void COmxILPcmRendererProcessingFunction::CPFHelper::RunL() + { + + TProcMessage msg; + while (iMsgQueue.Receive(msg)==KErrNone) + { + switch (msg.iType) + { + case EOpenDevice: + { + iAudioDevice.OpenDevice(); + break; + } + case ECloseDevice: + { + iAudioDevice.CloseDevice(); + break; + } + case ECloseDeviceOnError: + { + iAudioDevice.Cancel(); + iAudioDevice.CloseDevice(); + iCallerSemaphore.Signal(); + break; + } + case EExecuteCommand: + { + iAudioDevice.Execute(); + break; + } + + case EStopCommand: + { + iAudioDevice.Stop(); + break; + } + + case ECancelCommand: + { + iAudioDevice.Cancel(); + break; + } + + case EBufferIndication: + { + iAudioDevice.ProcessNextBuffer(); + break; + } + case EMediaTimeIndication: + { + iAudioDevice.ProcessMediaTimeIndication(msg.iMediaTimeType); + break; + } + case EParamIndication: + { + iAudioDevice.ProcessParamIndication(msg.iPcmModeType); + break; + } + case ESetVolumeRamp: + { + iAudioDevice.SetVolumeRamp(TTimeIntervalMicroSeconds(msg.iRampDuration)); + break; + } + case ESetVolume: + { + iAudioDevice.SetVolume(msg.iVolumeValue); + break; + } + case ESetMuted: + { + iAudioDevice.SetMuted(msg.iMuted); + break; + } + default: + { + break; + } + } + } + DEBUG_PRINTF2(_L8("COmxILPcmRendererProcessingFunction::CPFHelper::RunL : msg.iType[%d]"), msg.iType); + // setup for next callbacks + iMsgQueue.NotifyDataAvailable(iStatus); + SetActive(); + } + +void COmxILPcmRendererProcessingFunction::CPFHelper::DoCancel() + { + if (iMsgQueue.Handle()!=NULL) + { + iMsgQueue.CancelDataAvailable(); + } + } + +TInt COmxILPcmRendererProcessingFunction::CPFHelper::OpenDevice() + { + TProcMessage message; + message.iType = EOpenDevice; + return iMsgQueue.Send(message); + } + +TInt COmxILPcmRendererProcessingFunction::CPFHelper::CloseDevice() + { + DEBUG_PRINTF2(_L8("COmxILPcmRendererProcessingFunction::CPFHelper::CloseDevice : IsActive[%s]"), + (IsActive() ? "YES" : "NO")); + TProcMessage message; + message.iType = ECloseDevice; + return iMsgQueue.Send(message); + } + +TInt COmxILPcmRendererProcessingFunction::CPFHelper::CloseDeviceOnError() + { + DEBUG_PRINTF2(_L8("COmxILPcmRendererProcessingFunction::CPFHelper::CloseDeviceOnError : IsActive[%d]"), (IsActive() ? 1 : 0)); + + RThread thisThread; + if (thisThread.Id() == iHelperThreadId) + { + // Just do it... + iAudioDevice.Cancel(); + iAudioDevice.CloseDevice(); + } + else + { + + TProcMessage message; + message.iType = ECloseDeviceOnError; + TInt error = iMsgQueue.Send(message); + if (KErrNone != error) + { + // only wait if the message was sent into the queue... + iCallerSemaphore.Wait(); + } + } + + thisThread.Close(); + + return KErrNone; + + } + +TInt COmxILPcmRendererProcessingFunction::CPFHelper::Execute() + { + DEBUG_PRINTF2(_L8("CPFHelper::Execute : IsActive[%s]"), (IsActive() ? "YES" : "NO")); + TProcMessage message; + message.iType = EExecuteCommand; + return iMsgQueue.Send(message); + } + +TInt COmxILPcmRendererProcessingFunction::CPFHelper::Stop() + { + DEBUG_PRINTF2(_L8("CPFHelper::Stop : IsActive[%s]"), (IsActive() ? "YES" : "NO")); + TProcMessage message; + message.iType = EStopCommand; + return iMsgQueue.Send(message); + } + +TInt COmxILPcmRendererProcessingFunction::CPFHelper::CancelDevice() + { + DEBUG_PRINTF2(_L8("CPFHelper::CancelDevice : IsActive[%s]"), (IsActive() ? "YES" : "NO")); + TProcMessage message; + message.iType = ECancelCommand; + return iMsgQueue.Send(message); + } + +TInt COmxILPcmRendererProcessingFunction::CPFHelper::BufferIndication() + { + DEBUG_PRINTF2(_L8("CPFHelper::BufferIndication : IsActive[%s]"), (IsActive() ? "YES" : "NO")); + TProcMessage message; + message.iType = EBufferIndication; + return iMsgQueue.Send(message); + } + +TInt COmxILPcmRendererProcessingFunction::CPFHelper::MediaTimeIndication(const OMX_TIME_MEDIATIMETYPE& aMediaTimeType) + { + DEBUG_PRINTF2(_L8("CPFHelper::MediaTimeIndication : IsActive[%s]"), (IsActive() ? "YES" : "NO")); + TProcMessage message; + message.iType = EMediaTimeIndication; + message.iMediaTimeType.eUpdateType = aMediaTimeType.eUpdateType; + message.iMediaTimeType.eState = aMediaTimeType.eState; + message.iMediaTimeType.xScale = aMediaTimeType.xScale; + message.iMediaTimeType.nMediaTimestamp = aMediaTimeType.nMediaTimestamp; + + return iMsgQueue.Send(message); + } + +TInt COmxILPcmRendererProcessingFunction::CPFHelper::ParamIndication(const OMX_AUDIO_PARAM_PCMMODETYPE* aPcmModeType) + { + DEBUG_PRINTF2(_L8("CPFHelper::ParamIndication : IsActive[%s]"), (IsActive() ? "YES" : "NO")); + TProcMessage message; + message.iType = EParamIndication; + message.iPcmModeType.nChannels = aPcmModeType->nChannels; + message.iPcmModeType.nSamplingRate = aPcmModeType->nSamplingRate; + + return iMsgQueue.Send(message); + } + +TInt COmxILPcmRendererProcessingFunction::CPFHelper::SetVolumeRamp(const OMX_U64 aRampDuration) + { + DEBUG_PRINTF2(_L8("CPFHelper::SetVolumeRamp : IsActive[%s]"), (IsActive() ? "YES" : "NO")); + TProcMessage message; + message.iType = ESetVolumeRamp; + message.iRampDuration = aRampDuration; + + return iMsgQueue.Send(message); + } + +TInt COmxILPcmRendererProcessingFunction::CPFHelper::SetVolume(const OMX_S32 aVolumeValue) + { + DEBUG_PRINTF2(_L8("CPFHelper::SetVolume : IsActive[%s]"), (IsActive() ? "YES" : "NO")); + TProcMessage message; + message.iType = ESetVolume; + message.iVolumeValue = aVolumeValue; + + return iMsgQueue.Send(message); + } + +TInt COmxILPcmRendererProcessingFunction::CPFHelper::SetMuted(const OMX_BOOL aMuted) + { + DEBUG_PRINTF2(_L8("CPFHelper::SetMuted : IsActive[%s]"), (IsActive() ? "YES" : "NO")); + TProcMessage message; + message.iType = ESetMuted; + message.iMuted = aMuted; + + return iMsgQueue.Send(message); + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilrefcomps/ref_components/audio/pcmrenderer/src/omxilpcmrendererprocessingfunction.h --- a/omxil/omxilrefcomps/ref_components/audio/pcmrenderer/src/omxilpcmrendererprocessingfunction.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilrefcomps/ref_components/audio/pcmrenderer/src/omxilpcmrendererprocessingfunction.h Fri May 07 16:25:23 2010 +0100 @@ -1,236 +1,237 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -/** - @file - @internalComponent -*/ - -#ifndef OMXILPCMRENDERERPROCESSINGFUNCTION_H -#define OMXILPCMRENDERERPROCESSINGFUNCTION_H - -#include -#include "omxilpcmrendererconst.h" -#include "omxilprocessingfunction.h" - -// Forward declarations -class MOmxILClockComponentCmdsIf; - -NONSHARABLE_CLASS(COmxILPcmRendererProcessingFunction) : - public COmxILProcessingFunction - { - -public: - static COmxILPcmRendererProcessingFunction* NewL( - MOmxILCallbackNotificationIf& aCallbacks, - MOmxILClockComponentCmdsIf& aClientClockPort); - - ~COmxILPcmRendererProcessingFunction(); - - OMX_ERRORTYPE StateTransitionIndication(COmxILFsm::TStateIndex aNewState); - - OMX_ERRORTYPE BufferFlushingIndication(TUint32 aPortIndex, - OMX_DIRTYPE aDirection); - - OMX_ERRORTYPE ParamIndication(OMX_INDEXTYPE aParamIndex, - const TAny* apComponentParameterStructure); - - OMX_ERRORTYPE ConfigIndication(OMX_INDEXTYPE aConfigIndex, - const TAny* apComponentConfigStructure); - - OMX_ERRORTYPE BufferIndication( - OMX_BUFFERHEADERTYPE* apBufferHeader, - OMX_DIRTYPE aDirection); - - OMX_ERRORTYPE MediaTimeIndication(const OMX_TIME_MEDIATIMETYPE& aMediaTimeType); - - OMX_BOOL BufferRemovalIndication( - OMX_BUFFERHEADERTYPE* apBufferHeader, - OMX_DIRTYPE aDirection); - - TInt GetBytesPlayed() const; - -private: - - COmxILPcmRendererProcessingFunction(MOmxILCallbackNotificationIf& aCallbacks, - MOmxILClockComponentCmdsIf& aClientClockPort); - - void ConstructL(); - - void FlushBufferList(RPointerArray& aBufferList); - -private: - RPointerArray iBuffersToEmpty; - RPointerArray iBuffersEmptied; - OMX_STATETYPE iState; - MOmxILClockComponentCmdsIf* iClientClockPortPtr; - OMX_TICKS iStartMediaTime; - - class CAudioDevice : public CActive - { - public: - static CAudioDevice* NewL(COmxILPcmRendererProcessingFunction& aParent); - ~CAudioDevice(); - - // from CActive - void RunL(); - void DoCancel(); - - OMX_ERRORTYPE OpenDevice(); - OMX_ERRORTYPE CloseDevice(); - OMX_ERRORTYPE Execute(); - OMX_ERRORTYPE MoveToPausedState(); - OMX_ERRORTYPE Stop(); - - OMX_ERRORTYPE SetChannels(TUint aChannels); - OMX_ERRORTYPE SetSampleRate(TUint aSampleRate); - OMX_ERRORTYPE SetVolume(TInt aVolume); - OMX_ERRORTYPE SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration); - OMX_ERRORTYPE SetMuted(TBool aMuted); - OMX_BUFFERHEADERTYPE* GetCurrentBuffer(); - TInt GetBytesPlayed(); - void ConfigAudioRamper(TInt64 aRampTime); - TBool RampAudio(CMMFDataBuffer* aBuffer); - TBool ConstructAndStartUpdateTimer(); - void ProcessNextBuffer(); - void PlayData(); - void ProcessMediaTimeIndication(OMX_TIME_MEDIATIMETYPE& aMediaTimeType); - void ProcessParamIndication(const OMX_AUDIO_PARAM_PCMMODETYPE& aPcmModeType); - - private: - CAudioDevice(COmxILPcmRendererProcessingFunction& aParent); - void ConstructL(); - OMX_ERRORTYPE SetPlayFormat(); - void SignalBufferCompletion(OMX_BUFFERHEADERTYPE* apCurrentBuffer); - TBool IsBufferLengthSufficient(TInt aBufferLength) const; - TInt GetMinBufferLength() const; - void SendBufferToSoundDevice(TDes8& aBuffer); - void StartUpdateTimer(); - void HandleClockStateChanged(const OMX_TIME_MEDIATIMETYPE& aMediaTimeType); - TBool CanPlayNow(); - void HandleClockScaleChanged(const OMX_TIME_MEDIATIMETYPE& aMediaTimeType); - void PauseAudio(); - - // From MGenericTimerClient - static TInt UpdateClockMediaTime(TAny* aPtr ); - - private: - RMdaDevSound iSoundDevice; - OMX_BUFFERHEADERTYPE* iCurrentBuffer; - COmxILPcmRendererProcessingFunction& iParent; - TInt iSampleRate; - TInt iChannels; - RMdaDevSound::TMdaSoundEncoding iEncoding; - TUint iVolume; - TBool iMuted; - TUint iBufferSize; - TTimeIntervalMicroSeconds iVolumeRamp; - TBool iRampAudioSample; - TInt iRampSamples; - TInt iRampSamplesLeft; - TInt iRampIncr; - TBool iSkip; - TBool iClockStateRunning; - TBool iPausedClockViaScale; - TBool iIsStartTimeFlagSet; - OMX_TICKS iClockMediaTime; - TBool iPlayData; // To indicate whether it can start rendering audio or not - - /// If the component is in a state other than OMX_StateExecuting, this - /// internal variable is used to store the last value of bytes played by - /// the Sound Device. - TInt iLastBytesPlayedValue; - - /// This is used to send a media time update to the clock component - CPeriodic* iPeriodic; - - // This variable is used to optionally allocate a memory segment to cache OMX buffers if the tunnelled component does not utilise them well - // If the tunnelled components don't fill in sufficient data in the buffers, this can create underflows in the renderer, as the driver won't have enough data to play - RBuf8 iCachedPlayBuffer; - - } *iAudioDevice; - - class CPFHelper : public CActive - { - public: - static CPFHelper* NewL(CAudioDevice& aAudioDevice); - ~CPFHelper(); - - // from CActive - void RunL(); - void DoCancel(); - - TInt OpenDevice(); - TInt CloseDevice(); - TInt CloseDeviceOnError(); - TInt Execute(); - TInt Stop(); - TInt CancelDevice(); - TInt BufferIndication(); - TInt MediaTimeIndication(const OMX_TIME_MEDIATIMETYPE& aMediaTimeType); - TInt ParamIndication(const OMX_AUDIO_PARAM_PCMMODETYPE* aPcmModeType); - TInt SetVolumeRamp(const OMX_U64 aRampDuration); - TInt SetVolume(const OMX_S32 aVolumeValue); - TInt SetMuted(const OMX_BOOL aVolumeValue); - - enum TMessageType - { - EOpenDevice, - ECloseDevice, - ECloseDeviceOnError, - EExecuteCommand, - EStopCommand, - ECancelCommand, - EBufferIndication, - EMediaTimeIndication, - EParamIndication, - ESetVolumeRamp, - ESetVolume, - ESetMuted - }; - - class TProcMessage - { - public: - TMessageType iType; - OMX_TIME_MEDIATIMETYPE iMediaTimeType; - OMX_AUDIO_PARAM_PCMMODETYPE iPcmModeType; - OMX_U64 iRampDuration; - OMX_S32 iVolumeValue; - OMX_BOOL iMuted; - }; - - RMsgQueue iMsgQueue; - - private: - CPFHelper(CAudioDevice& aAudioDevice); - void ConstructL(); - - private: - - static const TInt KMaxMsgQueueEntries = 150; - - CAudioDevice& iAudioDevice; - TThreadId iHelperThreadId; - RSemaphore iCallerSemaphore; - - } *iPFHelper; - - }; - -#endif // OMXILPCMRENDERERPROCESSINGFUNCTION_H +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +/** + @file + @internalComponent +*/ + +#ifndef OMXILPCMRENDERERPROCESSINGFUNCTION_H +#define OMXILPCMRENDERERPROCESSINGFUNCTION_H + +#include +#include "omxilpcmrendererconst.h" +#include "omxilprocessingfunction.h" + +// Forward declarations +class MOmxILClockComponentCmdsIf; + +NONSHARABLE_CLASS(COmxILPcmRendererProcessingFunction) : + public COmxILProcessingFunction + { + +public: + static COmxILPcmRendererProcessingFunction* NewL( + MOmxILCallbackNotificationIf& aCallbacks, + MOmxILClockComponentCmdsIf& aClientClockPort); + + ~COmxILPcmRendererProcessingFunction(); + + OMX_ERRORTYPE StateTransitionIndication(COmxILFsm::TStateIndex aNewState); + + OMX_ERRORTYPE BufferFlushingIndication(TUint32 aPortIndex, + OMX_DIRTYPE aDirection); + + OMX_ERRORTYPE ParamIndication(OMX_INDEXTYPE aParamIndex, + const TAny* apComponentParameterStructure); + + OMX_ERRORTYPE ConfigIndication(OMX_INDEXTYPE aConfigIndex, + const TAny* apComponentConfigStructure); + + OMX_ERRORTYPE BufferIndication( + OMX_BUFFERHEADERTYPE* apBufferHeader, + OMX_DIRTYPE aDirection); + + OMX_ERRORTYPE MediaTimeIndication(const OMX_TIME_MEDIATIMETYPE& aMediaTimeType); + + OMX_BOOL BufferRemovalIndication( + OMX_BUFFERHEADERTYPE* apBufferHeader, + OMX_DIRTYPE aDirection); + + TInt GetBytesPlayed() const; + +private: + + COmxILPcmRendererProcessingFunction(MOmxILCallbackNotificationIf& aCallbacks, + MOmxILClockComponentCmdsIf& aClientClockPort); + + void ConstructL(); + + void FlushBufferList(RPointerArray& aBufferList); + +private: + RPointerArray iBuffersToEmpty; + RPointerArray iBuffersEmptied; + OMX_STATETYPE iState; + MOmxILClockComponentCmdsIf* iClientClockPortPtr; + OMX_TICKS iStartMediaTime; + + class CAudioDevice : public CActive + { + public: + static CAudioDevice* NewL(COmxILPcmRendererProcessingFunction& aParent); + ~CAudioDevice(); + + // from CActive + void RunL(); + void DoCancel(); + + OMX_ERRORTYPE OpenDevice(); + OMX_ERRORTYPE CloseDevice(); + OMX_ERRORTYPE Execute(); + OMX_ERRORTYPE MoveToPausedState(); + OMX_ERRORTYPE Stop(); + + OMX_ERRORTYPE SetChannels(TUint aChannels); + OMX_ERRORTYPE SetSampleRate(TUint aSampleRate); + OMX_ERRORTYPE SetVolume(TInt aVolume); + OMX_ERRORTYPE SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampDuration); + OMX_ERRORTYPE SetMuted(TBool aMuted); + OMX_BUFFERHEADERTYPE* GetCurrentBuffer(); + TInt GetBytesPlayed(); + void ConfigAudioRamper(TInt64 aRampTime); + TBool RampAudio(CMMFDataBuffer* aBuffer); + TBool ConstructAndStartUpdateTimer(); + void ProcessNextBuffer(); + void PlayData(); + void ProcessMediaTimeIndication(OMX_TIME_MEDIATIMETYPE& aMediaTimeType); + void ProcessParamIndication(const OMX_AUDIO_PARAM_PCMMODETYPE& aPcmModeType); + + private: + CAudioDevice(COmxILPcmRendererProcessingFunction& aParent); + void ConstructL(); + OMX_ERRORTYPE SetPlayFormat(); + void SignalBufferCompletion(OMX_BUFFERHEADERTYPE* apCurrentBuffer); + TBool IsBufferLengthSufficient(TInt aBufferLength) const; + TInt GetMinBufferLength() const; + void SendBufferToSoundDevice(TDes8& aBuffer); + void StartUpdateTimer(); + void HandleClockStateChanged(const OMX_TIME_MEDIATIMETYPE& aMediaTimeType); + TBool CanPlayNow(); + void HandleClockScaleChanged(const OMX_TIME_MEDIATIMETYPE& aMediaTimeType); + void PauseAudio(); + + // From MGenericTimerClient + static TInt UpdateClockMediaTime(TAny* aPtr ); + + private: + RMdaDevSound iSoundDevice; + OMX_BUFFERHEADERTYPE* iCurrentBuffer; + COmxILPcmRendererProcessingFunction& iParent; + TInt iSampleRate; + TInt iChannels; + RMdaDevSound::TMdaSoundEncoding iEncoding; + TUint iVolume; + TBool iMuted; + TUint iBufferSize; + TTimeIntervalMicroSeconds iVolumeRamp; + TBool iRampAudioSample; + TInt iRampSamples; + TInt iRampSamplesLeft; + TInt iRampIncr; + TBool iSkip; + TBool iClockStateRunning; + TBool iPausedClockViaScale; + TBool iIsStartTimeFlagSet; + OMX_TICKS iClockMediaTime; + TBool iPlayData; // To indicate whether it can start rendering audio or not + + /// If the component is in a state other than OMX_StateExecuting, this + /// internal variable is used to store the last value of bytes played by + /// the Sound Device. + TInt iLastBytesPlayedValue; + + /// This is used to send a media time update to the clock component + CPeriodic* iPeriodic; + + // This variable is used to optionally allocate a memory segment to cache OMX buffers if the tunnelled component does not utilise them well + // If the tunnelled components don't fill in sufficient data in the buffers, this can create underflows in the renderer, as the driver won't have enough data to play + RBuf8 iCachedPlayBuffer; + TBool iResumeAfterNextPlay; + + } *iAudioDevice; + + class CPFHelper : public CActive + { + public: + static CPFHelper* NewL(CAudioDevice& aAudioDevice); + ~CPFHelper(); + + // from CActive + void RunL(); + void DoCancel(); + + TInt OpenDevice(); + TInt CloseDevice(); + TInt CloseDeviceOnError(); + TInt Execute(); + TInt Stop(); + TInt CancelDevice(); + TInt BufferIndication(); + TInt MediaTimeIndication(const OMX_TIME_MEDIATIMETYPE& aMediaTimeType); + TInt ParamIndication(const OMX_AUDIO_PARAM_PCMMODETYPE* aPcmModeType); + TInt SetVolumeRamp(const OMX_U64 aRampDuration); + TInt SetVolume(const OMX_S32 aVolumeValue); + TInt SetMuted(const OMX_BOOL aVolumeValue); + + enum TMessageType + { + EOpenDevice, + ECloseDevice, + ECloseDeviceOnError, + EExecuteCommand, + EStopCommand, + ECancelCommand, + EBufferIndication, + EMediaTimeIndication, + EParamIndication, + ESetVolumeRamp, + ESetVolume, + ESetMuted + }; + + class TProcMessage + { + public: + TMessageType iType; + OMX_TIME_MEDIATIMETYPE iMediaTimeType; + OMX_AUDIO_PARAM_PCMMODETYPE iPcmModeType; + OMX_U64 iRampDuration; + OMX_S32 iVolumeValue; + OMX_BOOL iMuted; + }; + + RMsgQueue iMsgQueue; + + private: + CPFHelper(CAudioDevice& aAudioDevice); + void ConstructL(); + + private: + + static const TInt KMaxMsgQueueEntries = 150; + + CAudioDevice& iAudioDevice; + TThreadId iHelperThreadId; + RSemaphore iCallerSemaphore; + + } *iPFHelper; + + }; + +#endif // OMXILPCMRENDERERPROCESSINGFUNCTION_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilrefcomps/ref_components/audio/pcmrenderer/unittest/bwins/tsu_omxil_pcmrenderer_01.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/omxilrefcomps/ref_components/audio/pcmrenderer/unittest/bwins/tsu_omxil_pcmrenderer_01.def Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,3 @@ +EXPORTS + ?NewTestSuiteL@@YAPAVCTestSuiteOmxILPcmRenderer@@XZ @ 1 NONAME ; class CTestSuiteOmxILPcmRenderer * NewTestSuiteL(void) + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilrefcomps/ref_components/audio/pcmrenderer/unittest/data/pcm16stereo44khz.raw Binary file omxil/omxilrefcomps/ref_components/audio/pcmrenderer/unittest/data/pcm16stereo44khz.raw has changed diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilrefcomps/ref_components/audio/pcmrenderer/unittest/data/pcm16stereo8khz.raw Binary file omxil/omxilrefcomps/ref_components/audio/pcmrenderer/unittest/data/pcm16stereo8khz.raw has changed diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilrefcomps/ref_components/audio/pcmrenderer/unittest/eabi/tsu_omxil_pcmrenderer_01.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/omxilrefcomps/ref_components/audio/pcmrenderer/unittest/eabi/tsu_omxil_pcmrenderer_01.def Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,3 @@ +EXPORTS + _Z13NewTestSuiteLv @ 1 NONAME + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilrefcomps/ref_components/audio/pcmrenderer/unittest/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/omxilrefcomps/ref_components/audio/pcmrenderer/unittest/group/bld.inf Fri May 07 16:25:23 2010 +0100 @@ -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: +* +*/ + + +PRJ_TESTEXPORTS + +// These tests work with the 3-plane variant of the framework only + +#if defined(NCP_COMMON_MM_3PA_ENABLED) || defined(SYMBIAN_MULTIMEDIA_THREEPLANEARCH) +../scripts/tsu_omxil_pcmrenderer_01.script c:/omxil/tsu_omxil_pcmrenderer_01.script +#endif //SYMBIAN_MULTIMEDIA_THREEPLANEARCH + +// Export test files + +#if defined(NCP_COMMON_MM_3PA_ENABLED) || defined(SYMBIAN_MULTIMEDIA_THREEPLANEARCH) +../data/pcm16stereo8khz.raw c:/omxil/testfiles/pcm16stereo8khz.raw +../data/pcm16stereo44khz.raw c:/omxil/testfiles/pcm16stereo44khz.raw +#endif //SYMBIAN_MULTIMEDIA_THREEPLANEARCH + + +#if defined(NCP_COMMON_MM_3PA_ENABLED) || defined(SYMBIAN_MULTIMEDIA_THREEPLANEARCH) +tsu_omxil_components.iby /epoc32/rom/include/tsu_omxil_components.iby +#endif //SYMBIAN_MULTIMEDIA_THREEPLANEARCH + +PRJ_TESTMMPFILES + + +#if defined(NCP_COMMON_MM_3PA_ENABLED) || defined(SYMBIAN_MULTIMEDIA_THREEPLANEARCH) +../mmpfiles/tsu_omxil_pcmrenderer_01.mmp +#endif //SYMBIAN_MULTIMEDIA_THREEPLANEARCH + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilrefcomps/ref_components/audio/pcmrenderer/unittest/group/tsu_omxil_components.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/omxilrefcomps/ref_components/audio/pcmrenderer/unittest/group/tsu_omxil_components.iby Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef TSU_OMXIL_COMPONENTS_IBY +#define TSU_OMXIL_COMPONENTS_IBY + +// OMX IL Components Unit tests and scripts + +file=ABI_DIR\BUILD_DIR\tsu_omxil_pcmrenderer_01.dll System\Libs\tsu_omxil_pcmrenderer_01.dll +data=EPOCROOT##epoc32\data\c\omxil\tsu_omxil_pcmrenderer_01.script \omxil\tsu_omxil_pcmrenderer_01.script + +#endif // TSU_OMXIL_COMPONENTS_IBY \ No newline at end of file diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilrefcomps/ref_components/audio/pcmrenderer/unittest/mmpfiles/tsu_omxil_pcmrenderer_01.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/omxilrefcomps/ref_components/audio/pcmrenderer/unittest/mmpfiles/tsu_omxil_pcmrenderer_01.mmp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,51 @@ +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +#include "../src/uids.hrh" + +TARGET tsu_omxil_pcmrenderer_01.dll +CAPABILITY ALL -TCB +TARGETTYPE dll +UID KSharedLibraryUidDefine KUidTsuOmxILPcmRendererDll +VENDORID 0x70000001 + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN +OS_LAYER_ESTLIB_SYSTEMINCLUDE + +USERINCLUDE ../src +USERINCLUDE ../../src + +SOURCEPATH ../src +SOURCE tsu_omxil_component_base.cpp +SOURCE tsu_omxil_pcmrenderer_suite.cpp +SOURCE tsu_omxil_pcmrenderer_step.cpp + +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY ecom.lib +LIBRARY testframeworkclient.lib +LIBRARY omxilcomponentcommon.lib +LIBRARY mmfserverbaseclasses.lib +STATICLIBRARY omxilcomponentif.lib + +NOSTRICTDEF +#ifdef EABI +NOEXPORTLIBRARY +#endif + +// Uncomment to activate debug tracing in this module +// MACRO _OMXIL_AACUNIT_DEBUG_TRACING_ON + +SMPSAFE diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilrefcomps/ref_components/audio/pcmrenderer/unittest/scripts/tsu_omxil_pcmrenderer_01.script --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/omxilrefcomps/ref_components/audio/pcmrenderer/unittest/scripts/tsu_omxil_pcmrenderer_01.script Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,91 @@ +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +LOAD_SUITE tsu_omxil_pcmrenderer_01.dll + +//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0020-HP + +RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0020-HP +TEST_COMPLETE + +//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0021-HP + +RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0021-HP +TEST_COMPLETE + +//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0022-HP + +RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0022-HP +TEST_COMPLETE + +//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0001-HP + +RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0001-HP +TEST_COMPLETE + +//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0002-HP + +RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0002-HP +TEST_COMPLETE + +//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0003-HP + +RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0003-HP +TEST_COMPLETE + +//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0004-HP + +RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0004-HP +TEST_COMPLETE + +//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0005-HP + +RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0005-HP +TEST_COMPLETE + +//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0006-HP + +RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0006-HP +TEST_COMPLETE + +//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0007-HP + +RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0007-HP +TEST_COMPLETE + +//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0008-HP + +RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0008-HP +TEST_COMPLETE + +//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0009-HP + +RUN_TEST_STEP 30000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0009-HP +TEST_COMPLETE + +//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0010-HP + +RUN_TEST_STEP 30000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0010-HP +TEST_COMPLETE + +//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0030-HP + +RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0030-HP +TEST_COMPLETE + +//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0031-HP + +RUN_TEST_STEP 30000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0031-HP +TEST_COMPLETE diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilrefcomps/ref_components/audio/pcmrenderer/unittest/src/log.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/omxilrefcomps/ref_components/audio/pcmrenderer/unittest/src/log.h Fri May 07 16:25:23 2010 +0100 @@ -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 + +class TTruncateOverflowHandler16 : public TDes16Overflow + { + public: + virtual void Overflow( TDes16& aDes ); + }; + +inline void TTruncateOverflowHandler16::Overflow( TDes16& aDes) + { + _LIT(KErrOverflowMsg,"Descriptor Overflow, hence value truncated"); + if( aDes.MaxLength() >= KErrOverflowMsg().Length() + aDes.Length() ) + aDes.Append(KErrOverflowMsg); + } + +class TTruncateOverflowHandler8 : public TDes8Overflow + { + public: + virtual void Overflow( TDes8& aDes ); + }; + +inline void TTruncateOverflowHandler8::Overflow( TDes8& aDes) + { + _LIT(KErrOverflowMsg,"Descriptor Overflow, hence value truncated"); + if( aDes.MaxLength() >= KErrOverflowMsg().Length() + aDes.Length() ) + aDes.Append(KErrOverflowMsg); + } + +namespace DSD +{ + +#ifdef _DEBUG + +#ifdef _OMXIL_AACUNIT_DEBUG_TRACING_ON + +#define DEBUG_PRINTF(a) {DSD::DebugPrintf(__LINE__, __FILE__, a);} +#define DEBUG_PRINTF2(a, b) {DSD::DebugPrintf(__LINE__, __FILE__, a, b);} +#define DEBUG_PRINTF3(a, b, c) {DSD::DebugPrintf(__LINE__, __FILE__, a, b, c);} +#define DEBUG_PRINTF4(a, b, c, d) {DSD::DebugPrintf(__LINE__, __FILE__, a, b, c, d);} +#define DEBUG_PRINTF5(a, b, c, d, e) {DSD::DebugPrintf(__LINE__, __FILE__, a, b, c, d, e);} + +#define DEBUG_CODE_SECTION(a) TRAP_IGNORE({ a; }) + +// UTF-8 overload of the DebufPrintf method. Should be used by default, +// since it's cheaper both in CPU cycles and stack space. + +inline void DebugPrintf(TInt aLine, char* aFile, TRefByValue aFormat, ...) + { + TTruncateOverflowHandler8 overflowHandler8; + VA_LIST list; + VA_START(list, aFormat); + + TTime now; + now.HomeTime(); + + TBuf8<1024> buffer; + _LIT8(KSwiLogPrefix, "[aacunit] "); + _LIT8(KSwiLineFileFormat, "TID[%d] : [%s:%d] -- "); + buffer.Append(KSwiLogPrefix); + RThread thread; + TUint threadId = thread.Id(); + thread.Close(); + RProcess proc; + TFileName fName = proc.FileName(); + proc.Close(); + buffer.AppendFormat(KSwiLineFileFormat, threadId, aFile, aLine); + buffer.AppendFormatList(aFormat, list ,&overflowHandler8 ); + buffer.Append(_L8("\r\n")); + + RDebug::RawPrint(buffer); + + VA_END(list); + } + +// Unicode DebufPrintf overload + +inline void DebugPrintf(TInt aLine, char* aFile, TRefByValue aFormat, ...) + { + TTruncateOverflowHandler16 overflowHandler16; + VA_LIST list; + VA_START(list, aFormat); + + TTime now; + now.HomeTime(); + + TBuf8<256> header; + _LIT8(KSwiLogPrefix, "[aacunit] "); + _LIT8(KSwiLineFileFormat, "%Ld Line: % 5d, File: %s -- "); + header.Append(KSwiLogPrefix); + header.AppendFormat(KSwiLineFileFormat, now.Int64(), aLine, aFile); + + TBuf<1024> buffer; + buffer.Copy(header); + buffer.AppendFormatList(aFormat, list ,&overflowHandler16); + buffer.Append(_L("\r\n")); + + RDebug::RawPrint(buffer); + + VA_END(list); + } +#else + +#define DEBUG_PRINTF(a) +#define DEBUG_PRINTF2(a, b) +#define DEBUG_PRINTF3(a, b, c) +#define DEBUG_PRINTF4(a, b, c, d) +#define DEBUG_PRINTF5(a, b, c, d, e) + +#define DEBUG_CODE_SECTION(a) + +#endif + +#else + +#define DEBUG_PRINTF(a) +#define DEBUG_PRINTF2(a, b) +#define DEBUG_PRINTF3(a, b, c) +#define DEBUG_PRINTF4(a, b, c, d) +#define DEBUG_PRINTF5(a, b, c, d, e) + +#define DEBUG_CODE_SECTION(a) + +#endif + + +} // namespace DSD + +#endif // __SWI_LOG_H__ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilrefcomps/ref_components/audio/pcmrenderer/unittest/src/tsu_omxil_component_base.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/omxilrefcomps/ref_components/audio/pcmrenderer/unittest/src/tsu_omxil_component_base.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,861 @@ +/* +* 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 +#include + +#include +#include +#include + +#include "log.h" +#include "tsu_omxil_component_base.h" + + +const TInt CCallbackHandler::KMaxMsgQueueEntries; + + +CAacTestFile* +CAacTestFile::NewL() + { + DEBUG_PRINTF(_L8("CAacTestFile::NewL")); + CAacTestFile* self = new (ELeave) CAacTestFile(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +void +CAacTestFile::ConstructL() + { + DEBUG_PRINTF(_L8("CAacTestFile::ConstructL")); + } + +CAacTestFile::CAacTestFile() : + iSourceFile(0), + iSourceFileReadPos(0), + iFinished(EFalse) + { + DEBUG_PRINTF(_L8("CAacTestFile::CAacTestFile")); + } + +CAacTestFile::~CAacTestFile() + { + DEBUG_PRINTF(_L8("CAacTestFile::~CAacTestFile")); + + delete iSourceFile; + + } + +TInt +CAacTestFile::ReadTestFileInBuffer(const TDesC& aFileName) + { + DEBUG_PRINTF(_L8("CAacTestFile::ReadTestFileInBuffer")); + + RFs fs; + fs.Connect(); + + RFile file; + TInt err = file.Open(fs, aFileName, EFileRead); + if (err == KErrNone) + { + TInt size; + err = file.Size(size); + if (err == KErrNone) + { + iSourceFile = HBufC8::NewMax(size); + if(!iSourceFile) + { + return KErrNoMemory; + } + TPtr8 ptr = iSourceFile->Des(); + file.Read(ptr,size); + file.Close(); + } + fs.Close(); + } + + return err; + + } + + +void +CAacTestFile::ReadNextBuffer(CMMFBuffer& aDataBuffer) + { + DEBUG_PRINTF(_L8("CAacTestFile::ReadNextBuffer")); + + CMMFDataBuffer* pDataBuffer = static_cast(&aDataBuffer); + while (ETrue) + { + // check if finished + if (iFinished) + { + DEBUG_PRINTF(_L8("CAacTestFile::ReadNextBuffer : File finished")); + pDataBuffer->Data().Zero(); + return; + } + + TInt srcLength = iSourceFile->Size(); + if (iSourceFileReadPos < srcLength) + { + TInt size = srcLength; + if (size > pDataBuffer->Data().MaxLength()) + { + size = pDataBuffer->Data().MaxLength(); + } + Mem::Copy((TAny*)pDataBuffer->Data().Ptr(), (TAny*)iSourceFile->Mid(iSourceFileReadPos).Ptr(), size); + pDataBuffer->Data().SetLength(size); + iSourceFileReadPos += size; + DEBUG_PRINTF2(_L8("CAacTestFile::ReadNextBuffer : data read = [%d] bytes"), iSourceFileReadPos); + DEBUG_PRINTF2(_L8("CAacTestFile::ReadNextBuffer : pDataBuffer->BufferSize = [%u] bytes"), pDataBuffer->BufferSize()); + if (iSourceFileReadPos >= srcLength) + { + DEBUG_PRINTF(_L8("CAacTestFile::ReadNextBuffer : end of data")); + pDataBuffer->SetLastBuffer(ETrue); + iFinished = ETrue; + } + return; + + } + else + { + // no more data + DEBUG_PRINTF(_L8("CAacTestFile::ReadNextBuffer : end of data")); + iFinished = ETrue; + return; + } + } + } + +void +CAacTestFile::ResetPos() + { + iSourceFileReadPos = 0; + iFinished = EFalse; + } + +TInt +CAacTestFile::GetPos() + { + return iSourceFileReadPos; + } + + +CAacOutputTestFile* +CAacOutputTestFile::NewL() + { + DEBUG_PRINTF(_L8("CAacOutputTestFile::NewL")); + CAacOutputTestFile* self = new (ELeave) CAacOutputTestFile(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +void +CAacOutputTestFile::ConstructL() + { + DEBUG_PRINTF(_L8("CAacOutputTestFile::ConstructL")); + } + +CAacOutputTestFile::CAacOutputTestFile() : + iFileServerSession(), + iOutputFile(), + iWrittenDataTotal(0), + iBuffersWrittenCount(0) + { + DEBUG_PRINTF(_L8("CAacOutputTestFile::CAacOutputTestFile")); + } + +CAacOutputTestFile::~CAacOutputTestFile() + { + DEBUG_PRINTF(_L8("CAacOutputTestFile::~CAacOutputTestFile")); + } + +TInt +CAacOutputTestFile::SetUpOutputFile(const TDesC& aFileName) + { + DEBUG_PRINTF(_L8("CAacOutputTestFile::SetUpOutputFile")); + + iFileServerSession.Connect(); + TInt err = iOutputFile.Create(iFileServerSession, + aFileName, + EFileWrite|EFileShareExclusive); + if(err != KErrNone) + { + err = iOutputFile.Replace(iFileServerSession, + aFileName, + EFileWrite|EFileShareExclusive); + } + return err; + + } + +TInt +CAacOutputTestFile::WriteDataToFile(const CMMFBuffer& aDataBuffer) + { + DEBUG_PRINTF(_L8("CAacOutputTestFile::WriteDataToFile")); + + const CMMFDataBuffer& dataBuffer = static_cast(aDataBuffer); + const TDesC8& data = dataBuffer.Data(); + + TInt err = KErrNone; + err = iOutputFile.Write(data); + if(err != KErrNone) + { + return err; + } + // keep record of amount of data and the number of buffers written out + iWrittenDataTotal += data.Size(); + iBuffersWrittenCount++; + + DEBUG_PRINTF2(_L8("CAacOutputTestFile::WriteDataToFile : data.Size()[%d]"), data.Size()); + DEBUG_PRINTF2(_L8("CAacOutputTestFile::WriteDataToFile : iWrittenDataTotal[%d]"), iWrittenDataTotal); + DEBUG_PRINTF2(_L8("CAacOutputTestFile::WriteDataToFile : iBuffersWrittenCount[%d]"), iBuffersWrittenCount); + + return err; + + } + + +TInt +CAacOutputTestFile::AddWavHeader() + { + DEBUG_PRINTF(_L8("CAacOutputTestFile::AddWavHeader")); + + RFs fs; + fs.Connect(); + + RFile file; + TInt err = file.Open(fs, KAacDecoderOutputTestFile, EFileRead); + if (err != KErrNone) + { + return err; + } + + TInt size; + err = file.Size(size); + if (err != KErrNone) + { + return err; + } + + HBufC8* rawDecFile = HBufC8::NewMax(size); + if(!rawDecFile) + { + return KErrNoMemory; + } + + TPtr8 ptr = rawDecFile->Des(); + file.Read(ptr,size); + file.Close(); + + // add headers + err = file.Replace(fs, KAacDecoderOutputTestFile, EFileWrite); + if (err != KErrNone) + { + return err; + } + + // this is canonical WAV file format header + TInt32 chunkSize = size + KTestWavFormatPCMChunkHeaderSize; + TInt32 subchunk1size = KTestWavFormatPCMSubchunk1Size; + TInt16 audioFormat = KTestAudioFormatPCM; + TInt16 numChannels = KTestNumChannels; + TInt32 sampleRate = KTestSampleRate; + TInt16 bitsPerSample = KTestBitsPerSample; + TInt32 byteRate = sampleRate * numChannels * (bitsPerSample / 8); + TInt16 blockAlign = numChannels * (bitsPerSample / 8); + TInt32 subchunk2size = size; + + file.Write(_L8("RIFF")); + { TPtrC8 buf((TText8*)&chunkSize,sizeof(TInt32)); file.Write(buf); } + file.Write(_L8("WAVEfmt ")); + { TPtrC8 buf((TText8*)&subchunk1size,sizeof(TInt32)); file.Write(buf); } + { TPtrC8 buf((TText8*)&audioFormat,sizeof(TInt16)); file.Write(buf); } + { TPtrC8 buf((TText8*)&numChannels,sizeof(TInt16)); file.Write(buf); } + { TPtrC8 buf((TText8*)&sampleRate,sizeof(TInt32)); file.Write(buf); } + { TPtrC8 buf((TText8*)&byteRate,sizeof(TInt32)); file.Write(buf); } + { TPtrC8 buf((TText8*)&blockAlign,sizeof(TInt16)); file.Write(buf); } + { TPtrC8 buf((TText8*)&bitsPerSample,sizeof(TInt16)); file.Write(buf); } + file.Write(_L8("data")); + { TPtrC8 buf((TText8*)&subchunk2size,sizeof(TInt32)); file.Write(buf); } + file.Write(ptr,size); + + // store file size + file.Size(iWrittenDataTotal); + + file.Close(); + fs.Close(); + + delete rawDecFile; + + return KErrNone; + + } + +void +CAacOutputTestFile::CloseOutputFile() + { + DEBUG_PRINTF(_L8("CAacOutputTestFile::CloseOutputFile")); + + iOutputFile.Close(); + iFileServerSession.Close(); + + } + +// +// CUtilityTimer +// +CUtilityTimer* +CUtilityTimer::NewL(TTimeIntervalMicroSeconds32& aDelay, + MTimerObserver& aObserver) + { + CUtilityTimer* self = new (ELeave) CUtilityTimer(aObserver); + CleanupStack::PushL(self); + self->ConstructL(aDelay); + CleanupStack::Pop(self); + return self; + } + +void +CUtilityTimer::ConstructL(TTimeIntervalMicroSeconds32& aDelay) + { + CTimer::ConstructL(); + + iDelay = aDelay; + CActiveScheduler::Add(this); + } + +CUtilityTimer::~CUtilityTimer() + { + Cancel(); + } + +void +CUtilityTimer::InitializeTimer() + { + // Request another wait - assume not active + CTimer::After(iDelay); + } + +void +CUtilityTimer::RunL() + { + if (iStatus.Int() == KErrNone) + iObserver.TimerExpired(); + } + +void +CUtilityTimer::DoCancel() + { + } + + +CUtilityTimer::CUtilityTimer(MTimerObserver& aObserver) : + CTimer(CActive::EPriorityUserInput), + iObserver(aObserver) + { + } + +// +// CCallbackHandler +// +CCallbackHandler* +CCallbackHandler::NewL(RAsyncTestStepOmxILComponentBase& aDecoderTest) + { + DEBUG_PRINTF(_L8("CCallbackHandler::NewL")); + + CCallbackHandler* self = new (ELeave) CCallbackHandler(aDecoderTest); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + + } + + +void +CCallbackHandler::ConstructL() + { + DEBUG_PRINTF(_L8("CCallbackHandler::ConstructL")); + + OMX_CALLBACKTYPE h = + { + CCallbackHandler::EventHandler, + CCallbackHandler::EmptyBufferDone, + CCallbackHandler::FillBufferDone + }; + + iHandle = h; + CActiveScheduler::Add(this); + + User::LeaveIfError(iMsgQueue.CreateLocal(KMaxMsgQueueEntries)); + iMsgQueue.NotifyDataAvailable(iStatus); + SetActive(); + + } + +CCallbackHandler::CCallbackHandler(RAsyncTestStepOmxILComponentBase& aDecoderTest) + : CActive(EPriorityNormal), + iDecoderTest(aDecoderTest) + { + DEBUG_PRINTF(_L8("CCallbackHandler::CCallbackHandler")); + } + + +CCallbackHandler::operator OMX_CALLBACKTYPE*() + { + DEBUG_PRINTF(_L8("CCallbackHandler::operator OMX_CALLBACKTYPE*")); + + return &iHandle; + + } + + +void +CCallbackHandler::RunL() + { + DEBUG_PRINTF(_L8("CCallbackHandler::RunL")); + + TOmxMessage msg; + while (iMsgQueue.Receive(msg)==KErrNone) + { + switch (msg.iType) + { + case EEmptyBufferCallback: + { + iDecoderTest.DoEmptyBufferDoneL(msg.iComponent, + msg.iBuffer); + } + break; + case EFillBufferCallback: + { + iDecoderTest.DoFillBufferDoneL(msg.iComponent, + msg.iBuffer); + } + break; + case EEventCallback: + { + iDecoderTest.DoEventHandlerL(msg.iComponent, + msg.iEventParams.iEvent, + msg.iEventParams.iData1, + msg.iEventParams.iData2, + msg.iEventParams.iExtra); + } + break; + default: + { + // This is an invalid state + ASSERT(EFalse); + } + }; + } + + // setup for next callbacks + iStatus = KRequestPending; + iMsgQueue.NotifyDataAvailable(iStatus); + SetActive(); + + } + +CCallbackHandler::~CCallbackHandler() + { + DEBUG_PRINTF(_L8("CCallbackHandler::~CCallbackHandler")); + + Cancel(); + iMsgQueue.Close(); + + } + + +void +CCallbackHandler::DoCancel() + { + DEBUG_PRINTF(_L8("CCallbackHandler::DoCancel")); + + if (iMsgQueue.Handle()) + { + iMsgQueue.CancelDataAvailable(); + } + + } + +OMX_ERRORTYPE +CCallbackHandler::FillBufferDone(OMX_HANDLETYPE aComponent, + TAny* aAppData, + OMX_BUFFERHEADERTYPE* aBuffer) + { + DEBUG_PRINTF(_L8("CCallbackHandler::FillBufferDone")); + + return static_cast(aAppData)->DoFillBufferDone(aComponent, aBuffer); + + } + +OMX_ERRORTYPE +CCallbackHandler::EmptyBufferDone(OMX_HANDLETYPE aComponent, + TAny* aAppData, + OMX_BUFFERHEADERTYPE* aBuffer) + { + DEBUG_PRINTF(_L8("CCallbackHandler::EmptyBufferDone")); + + return static_cast(aAppData)->DoEmptyBufferDone(aComponent, aBuffer); + + } + +OMX_ERRORTYPE +CCallbackHandler::EventHandler(OMX_HANDLETYPE aComponent, + TAny* aAppData, + OMX_EVENTTYPE aEvent, + TUint32 aData1, + TUint32 aData2, + TAny* aExtra) + { + DEBUG_PRINTF4(_L8("CCallbackHandler::EventHandler : EVENT[%d] Data1[%d] Data2[%d]"), aExtra, aData1, aData2); + + CCallbackHandler::TEventParams eventParams; + eventParams.iEvent = aEvent; + eventParams.iData1 = aData1; + eventParams.iData2 = aData2; + eventParams.iExtra = aExtra; + return static_cast(aAppData)->DoEventHandler(aComponent, eventParams); + + } + +OMX_ERRORTYPE +CCallbackHandler::DoFillBufferDone(OMX_HANDLETYPE aComponent, + OMX_BUFFERHEADERTYPE* aBuffer) + { + DEBUG_PRINTF(_L8("CCallbackHandler::DoFillBufferDone")); + + TOmxMessage message; + message.iType = EFillBufferCallback; + message.iComponent = aComponent; + message.iBuffer = aBuffer; + return RAsyncTestStepOmxILComponentBase::ConvertSymbianErrorType( + iMsgQueue.Send(message)); + + } + +OMX_ERRORTYPE +CCallbackHandler::DoEmptyBufferDone(OMX_HANDLETYPE aComponent, + OMX_BUFFERHEADERTYPE* aBuffer) + { + DEBUG_PRINTF(_L8("CCallbackHandler::DoEmptyBufferDone")); + + TOmxMessage message; + message.iType = EEmptyBufferCallback; + message.iComponent = aComponent; + message.iBuffer = aBuffer; + return RAsyncTestStepOmxILComponentBase::ConvertSymbianErrorType( + iMsgQueue.Send(message)); + + } + +OMX_ERRORTYPE +CCallbackHandler::DoEventHandler(OMX_HANDLETYPE aComponent, + TEventParams aEventParams) + { + DEBUG_PRINTF(_L8("CCallbackHandler::DoEventHandler")); + + TOmxMessage message; + message.iType = EEventCallback; + message.iComponent = aComponent; + message.iEventParams = aEventParams; + return RAsyncTestStepOmxILComponentBase::ConvertSymbianErrorType( + iMsgQueue.Send(message)); + + } + +// +// RAsyncTestStepOmxILComponentBase +// +RAsyncTestStepOmxILComponentBase::RAsyncTestStepOmxILComponentBase(const TDesC& aTestName, TInt aComponentUid) + : + iComponentUid(), + ipKickoffAOp(0), + ipKickoffStop(0), + ipCOmxILComponent(0), + ipCallbackHandler(0), + ipTestFile(0), + iTestFileName(KAacDecoderTestFile()), + ipCompHandle(0) + { + DEBUG_PRINTF2(_L8("RAsyncTestStepOmxILComponentBase::RAsyncTestStepOmxILComponentBase: UID[%X]"), aComponentUid); + iTestStepName = aTestName; + iComponentUid = aComponentUid; + // Default heap size is 32K. Increased to avoid the KErrNoMemory for this test step. + iHeapSize = KTestHeapSize; + + } + +RAsyncTestStepOmxILComponentBase::~RAsyncTestStepOmxILComponentBase() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::~RAsyncTestStepOmxILComponentBase")); + // nothing here just yet + } + +void +RAsyncTestStepOmxILComponentBase::PrintOmxState(OMX_STATETYPE aOmxState) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::PrintOmxState")); + + switch(aOmxState) + { + case OMX_StateInvalid: + { + INFO_PRINTF1(_L("OMX STATE : OMX_StateInvalid")); + } + break; + case OMX_StateLoaded: + { + INFO_PRINTF1(_L("OMX STATE : OMX_StateLoaded")); + } + break; + case OMX_StateIdle: + { + INFO_PRINTF1(_L("OMX STATE : OMX_StateIdle")); + } + break; + case OMX_StateExecuting: + { + INFO_PRINTF1(_L("OMX STATE : OMX_StateExecuting")); + } + break; + case OMX_StatePause: + { + INFO_PRINTF1(_L("OMX STATE : OMX_StatePause")); + } + break; + case OMX_StateWaitForResources: + { + INFO_PRINTF1(_L("OMX STATE : OMX_StateWaitForResources")); + } + break; + default: + { + INFO_PRINTF1(_L("OMX STATE : Wrong state found")); + } + }; + + } + +OMX_ERRORTYPE +RAsyncTestStepOmxILComponentBase::ConvertSymbianErrorType(TInt aError) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::ConvertSymbianErrorType")); + + OMX_ERRORTYPE err = OMX_ErrorNone; + switch (aError) + { + case KErrNone: + err = OMX_ErrorNone; + break; + case KErrNoMemory: + err = OMX_ErrorInsufficientResources; + break; + case KErrGeneral: + break; + default: + err = OMX_ErrorUndefined; + } + return err; + + } + + +/** + This method is used at the beginning of the test, and initialises the + asynchronous calls that will be activated once the call returns. The + ActiveScheduler is active at this point. If this test leaves, then + StopTest() will be called with the leave value, so implicitly the test + stops. + +*/ +void +RAsyncTestStepOmxILComponentBase::KickoffTestL() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::KickoffTestL")); + + __MM_HEAP_MARK; + + // Set up an asynchronous call + TCallBack callback (ComponentBaseCallBack, this); + delete ipKickoffAOp; + ipKickoffAOp = NULL; + ipKickoffAOp = + new (ELeave) CAsyncCallBack (callback, CActive::EPriorityLow); + // Queues this active object to be run once. + ipKickoffAOp->Call(); + + } + +TInt +RAsyncTestStepOmxILComponentBase::ComponentBaseCallBack(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::ComponentBaseCallBack")); + + RAsyncTestStepOmxILComponentBase* self = static_cast (aPtr); + self->DoComponentBaseCallBack(); + return KErrNone; + + } + +void +RAsyncTestStepOmxILComponentBase::DoComponentBaseCallBack() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::DoComponentBaseCallBack")); + + TRAPD(err, ipCOmxILComponent = + COmxILComponentIf::CreateImplementationL(TUid::Uid(iComponentUid))); + + //return StopTest(err, EFail); + if (err != KErrNone) + { + INFO_PRINTF2(_L("RAsyncTestStepOmxILComponentBase::DoComponentBaseCallBack : err [%d]"), err); + if (KErrNotFound == err) + { + INFO_PRINTF1(_L("DoComponentBaseCallBack : CreateImplementationL returned KErrNotFound")); +// PacketVideo's AAC decoder libraries only provided for UDEB +#ifndef _DEBUG + INFO_PRINTF1(_L("IMPORTANT NOTE : THIS SUITE CAN ONLY BE RUN IN UDEB MODE")); + INFO_PRINTF1(_L("IMPORTANT NOTE : PACKETVIDEO'S AAC DECODER LIBRARY ONLY AVAILABLE IN UDEB MODE")); +#endif + } + return StopTest(err, EFail); + } + + ipCompHandle = static_cast(ipCOmxILComponent->Handle()); + if (!ipCompHandle) + { + return StopTest(KErrGeneral, EFail); + } + + TRAP(err, ipCallbackHandler = CCallbackHandler::NewL(*this)); + if (err != KErrNone) + { + return StopTest(err, EFail); + } + + TRAP(err, ipTestFile = CAacTestFile::NewL()); + if (err != KErrNone) + { + return StopTest(err, EFail); + } + + err = ipTestFile->ReadTestFileInBuffer(iTestFileName); + if (err != KErrNone) + { + return StopTest(err, EFail); + } + + TRAP(err, ipOutputTestFile = CAacOutputTestFile::NewL()); + if (err != KErrNone) + { + return StopTest(err, EFail); + } + + err = ipOutputTestFile->SetUpOutputFile(KAacDecoderOutputTestFile); + if (err != KErrNone) + { + return StopTest(err, EFail); + } + + + } + +TInt +RAsyncTestStepOmxILComponentBase::StopTestCallBack(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::StopTestCallBack")); + RAsyncTestStepOmxILComponentBase* self = + static_cast (aPtr); + self->DoStopTestCallBack(); + return KErrNone; + } + +void +RAsyncTestStepOmxILComponentBase::DoStopTestCallBack() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::DoStopTestCallBack")); + + StopTest(); + + } + + +void +RAsyncTestStepOmxILComponentBase::CloseTest() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::CloseTest")); + + if (ipCompHandle) + { + ipCompHandle->ComponentDeInit(ipCompHandle); + } + delete ipCOmxILComponent; + ipCOmxILComponent = 0; + ipCompHandle = 0; + + delete ipKickoffAOp; // no need to Cancel + ipKickoffAOp = 0; + + delete ipCallbackHandler; + ipCallbackHandler = 0; + + delete ipTestFile; + ipTestFile = 0; + + if (ipOutputTestFile) + { + ipOutputTestFile->CloseOutputFile(); + // We ignore here this error... + TInt err = ipOutputTestFile->AddWavHeader(); + delete ipOutputTestFile; + ipOutputTestFile = 0; + } + + REComSession::FinalClose(); + __MM_HEAP_MARKEND; + + } + +void +RAsyncTestStepOmxILComponentBase::DoFillBufferDoneL(OMX_HANDLETYPE /* aComponent */, + OMX_BUFFERHEADERTYPE* /* aBuffer */) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::DoFillBufferDoneL")); + // By default, no callback expected here... + return StopTest(KErrGeneral, EFail); + } + +void +RAsyncTestStepOmxILComponentBase::DoEmptyBufferDoneL(OMX_HANDLETYPE /* aComponent */, + OMX_BUFFERHEADERTYPE* /* aBuffer */) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::DoEmptyBufferDoneL")); + // By default, no callback expected here... + return StopTest(KErrGeneral, EFail); + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilrefcomps/ref_components/audio/pcmrenderer/unittest/src/tsu_omxil_component_base.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/omxilrefcomps/ref_components/audio/pcmrenderer/unittest/src/tsu_omxil_component_base.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,276 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +/** + @file +*/ + +#ifndef TSU_OMXIL_COMPONENT_BASE_H +#define TSU_OMXIL_COMPONENT_BASE_H + +#include +#include +#include + +#include "tsu_omxil_component_constants.h" + +// Forward declarations +class COmxILComponentIf; +struct OMX_COMPONENTTYPE; +class RAsyncTestStepOmxILComponentBase; +class CMMFBuffer; + + +class CAacTestFile : public CBase + { + +public: + + static CAacTestFile* NewL(); + + ~CAacTestFile(); + + TInt ReadTestFileInBuffer(const TDesC& aFileName); + void ReadNextBuffer(CMMFBuffer& aDataBuffer); + void ResetPos(); + TInt GetPos(); + +private: + + CAacTestFile(); + void ConstructL(); + + +private: + + HBufC8* iSourceFile; + TInt iSourceFileReadPos; + TBool iFinished; + + }; + + +class CAacOutputTestFile : public CBase + { + +public: + + static CAacOutputTestFile* NewL(); + + ~CAacOutputTestFile(); + + TInt SetUpOutputFile(const TDesC& aFileName); + TInt WriteDataToFile(const CMMFBuffer& aDataBuffer); + TInt AddWavHeader(); + void CloseOutputFile(); + +private: + + CAacOutputTestFile(); + void ConstructL(); + + +private: + + RFs iFileServerSession; + RFile iOutputFile; + TInt iWrittenDataTotal; + TInt iBuffersWrittenCount; + + }; + +class MTimerObserver + { + +public: + + virtual void TimerExpired() = 0; + + }; + +class CUtilityTimer : public CTimer + { + +public: + + static CUtilityTimer* NewL(TTimeIntervalMicroSeconds32& aDelay, + MTimerObserver& aObserver); + ~CUtilityTimer(); + + void InitializeTimer(); + +private: + + CUtilityTimer(MTimerObserver& aObserver); + void ConstructL(TTimeIntervalMicroSeconds32& aDelay); + + // from CActive + void RunL(); + void DoCancel(); + +private: + + TTimeIntervalMicroSeconds32 iDelay; + MTimerObserver& iObserver; + + }; + + +class CCallbackHandler : public CActive + { +public: + + enum TMessageType + { + EFillBufferCallback, + EEmptyBufferCallback, + EEventCallback + }; + + class TEventParams + { + public: + OMX_EVENTTYPE iEvent; + TUint iData1; + TUint iData2; + TAny* iExtra; + }; + + class TOmxMessage + { + public: + TMessageType iType; + OMX_HANDLETYPE iComponent; + union + { + OMX_BUFFERHEADERTYPE* iBuffer; + TEventParams iEventParams; + }; + }; + + + static const TInt KMaxMsgQueueEntries = 10; + +public: + + static CCallbackHandler* NewL(RAsyncTestStepOmxILComponentBase& aDecoderTest); + virtual ~CCallbackHandler(); + + operator OMX_CALLBACKTYPE*(); + + void RunL(); + void DoCancel(); + + static OMX_ERRORTYPE FillBufferDone(OMX_HANDLETYPE aComponent, + TAny* aAppData, + OMX_BUFFERHEADERTYPE* aBuffer); + + static OMX_ERRORTYPE EmptyBufferDone(OMX_HANDLETYPE aComponent, + TAny* aAppData, + OMX_BUFFERHEADERTYPE* aBuffer); + + static OMX_ERRORTYPE EventHandler(OMX_HANDLETYPE aComponent, + TAny* aAppData, + OMX_EVENTTYPE aEvent, + TUint32 aData1, + TUint32 aData2, + TAny* aExtra); + + +private: + + void ConstructL(); + CCallbackHandler(RAsyncTestStepOmxILComponentBase& aDecoderTest); + + OMX_ERRORTYPE DoFillBufferDone(OMX_HANDLETYPE aComponent, + OMX_BUFFERHEADERTYPE* aBuffer); + OMX_ERRORTYPE DoEmptyBufferDone(OMX_HANDLETYPE aComponent, + OMX_BUFFERHEADERTYPE* aBuffer); + OMX_ERRORTYPE DoEventHandler(OMX_HANDLETYPE aComponent, + TEventParams aParams); + + // + // + // + + +private: + + RAsyncTestStepOmxILComponentBase& iDecoderTest; + RMsgQueue iMsgQueue; + OMX_CALLBACKTYPE iHandle; + + }; + + +class RAsyncTestStepOmxILComponentBase : public RAsyncTestStep + { + +public: + + RAsyncTestStepOmxILComponentBase(const TDesC& aTestName, TInt aComponentUid); + + ~RAsyncTestStepOmxILComponentBase(); + + // From RAsyncTestStep + void KickoffTestL(); + void CloseTest(); + + // + virtual void DoFillBufferDoneL(OMX_HANDLETYPE aComponent, + OMX_BUFFERHEADERTYPE* aBuffer); + + virtual void DoEmptyBufferDoneL(OMX_HANDLETYPE aComponent, + OMX_BUFFERHEADERTYPE* aBuffer); + + virtual void DoEventHandlerL(OMX_HANDLETYPE aComponent, + OMX_EVENTTYPE aEvent, + TUint aData1, + TUint aData2, + TAny* aExtra) = 0; + + + static OMX_ERRORTYPE ConvertSymbianErrorType(TInt aError); + + + +protected: + + void PrintOmxState(OMX_STATETYPE aOmxState); + + // Async Call backs + static TInt ComponentBaseCallBack(TAny* aPtr); + void DoComponentBaseCallBack(); + + static TInt StopTestCallBack(TAny* aPtr); + void DoStopTestCallBack(); + +protected: + + TInt iComponentUid; + CAsyncCallBack* ipKickoffAOp; + CAsyncCallBack* ipKickoffStop; + COmxILComponentIf* ipCOmxILComponent; + CCallbackHandler* ipCallbackHandler; + CAacTestFile* ipTestFile; + TPtrC iTestFileName; + CAacOutputTestFile* ipOutputTestFile; + OMX_COMPONENTTYPE* ipCompHandle; + }; + +#endif // TSU_OMXIL_COMPONENT_BASE_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilrefcomps/ref_components/audio/pcmrenderer/unittest/src/tsu_omxil_component_constants.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/omxilrefcomps/ref_components/audio/pcmrenderer/unittest/src/tsu_omxil_component_constants.h Fri May 07 16:25:23 2010 +0100 @@ -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: +* +*/ + + +/** + @file +*/ + +#ifndef TSU_OMXIL_COMPONENT_CONSTANTS_H +#define TSU_OMXIL_COMPONENT_CONSTANTS_H + +_LIT(KAacDecoderTestFile, "c:\\omxil\\testfiles\\probando123.hev2.aac"); +_LIT(KAacDecoderOutputTestFile, "c:\\omxil\\testfiles\\omxilaacdecoderoutput.wav"); + +const TInt KTestHeapSize = 0x400000; // 4 Mb; + +// AudioSpecificConfig length (bytes) for probando123.hev2.aac +const TInt KAudioSpecificConfigLength = 7; + +// Wav header params... based on probando123.hev2.aac... +const TInt KTestWavFormatPCMChunkHeaderSize = 36; +const TInt KTestWavFormatPCMSubchunk1Size = 16; +const TInt KTestAudioFormatPCM = 1; +const TInt KTestSampleRate = 44100; +const TInt KTestNumChannels = 2; +const TInt KTestBitsPerSample = 16; +const TInt KTestBitRate = 1411000; + +// These are two numbers that identify some input/output buffers in the middle +// of the processing of a test file +const TInt KSomeInputBufferCount = 15; +const TInt KSomeOutputBufferCount = 25; + +// Some time interval that can be used for timeouts... +const TInt KTwoPointFiveSeconds = 2500000; + +// Some other time interval that can be used for timeouts... +const TInt KPointFiveSeconds = 500000; + +#endif // TSU_OMXIL_COMPONENT_CONSTANTS_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilrefcomps/ref_components/audio/pcmrenderer/unittest/src/tsu_omxil_pcmrenderer_step.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/omxilrefcomps/ref_components/audio/pcmrenderer/unittest/src/tsu_omxil_pcmrenderer_step.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,3977 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +/** + @file + @internalComponent +*/ + +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include "log.h" +#include "omxilpcmrenderer.hrh" +#include + +#include "tsu_omxil_pcmrenderer_step.h" + +_LIT8(KSymbianOmxILPcmRendererRole, "audio_renderer.pcm"); +_LIT8(KTestOmxILWrongRendererRole, "audio_renderer.wrong"); +_LIT(KPcmRendererTestFile, "c:\\omxil\\testfiles\\pcm16stereo8khz.raw"); +_LIT(KPcmRendererTestFile2, "c:\\omxil\\testfiles\\pcm16stereo44khz.raw"); + +OMX_ERRORTYPE ComponentInit(OMX_HANDLETYPE /*aComponent*/) + { + return OMX_ErrorNone; + } + + +// +// RAsyncTestStepOmxILPcmRenderer0020 +// +RAsyncTestStepOmxILPcmRenderer0020::RAsyncTestStepOmxILPcmRenderer0020(const TDesC& aTestName, TInt aComponentUid) + : + RAsyncTestStepOmxILComponentBase(aTestName, aComponentUid), + ipKickoff01(NULL), + ipKickoff02(NULL), + ipKickoff03(NULL), + ipKickoff04(NULL), + ipKickoff05(NULL), + ipKickoff06(NULL) + + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0020::RAsyncTestStepOmxILPcmRenderer0020")); + } + + +void +RAsyncTestStepOmxILPcmRenderer0020::KickoffTestL() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0020::KickoffTestL")); + + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test20 ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Init Component ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Obtain the component's state (GetState) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Obtain the component's version (GetComponentVersion) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Provide callbacks to component (SetCallbacks) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 5.- Obtain the port def params for Port #0 (GetParameter) ")); + + // This will install one callback + RAsyncTestStepOmxILComponentBase::KickoffTestL(); + + // This is the only step in this test... + TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0020Step01, this); + delete ipKickoff01; + ipKickoff01 = NULL; + ipKickoff01 = + new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); + ipKickoff01->Call(); + + // The successful termination... + TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this); + delete ipKickoffStop; + ipKickoffStop = NULL; + ipKickoffStop = + new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow); + ipKickoffStop->Call(); + + } + +void +RAsyncTestStepOmxILPcmRenderer0020::CloseTest() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0020::CloseTest")); + + delete ipKickoff01; // no need to Cancel + ipKickoff01 = NULL; + delete ipKickoff02; // no need to Cancel + ipKickoff02 = NULL; + delete ipKickoff03; // no need to Cancel + ipKickoff03 = NULL; + delete ipKickoff04; // no need to Cancel + ipKickoff04 = NULL; + delete ipKickoff05; // no need to Cancel + ipKickoff05 = NULL; + delete ipKickoff06; // no need to Cancel + ipKickoff06 = NULL; + + delete ipKickoffStop; // no need to Cancel + ipKickoffStop = 0; + + RAsyncTestStepOmxILComponentBase::CloseTest(); + + } + + +void +RAsyncTestStepOmxILPcmRenderer0020::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/, + OMX_EVENTTYPE /*aEvent*/, + TUint /*aData1*/, + TUint /*aData2*/, + TAny* /*aExtra*/) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0020::DoEventHandlerL")); + + // We don't expect here any callback + return StopTest(KErrGeneral, EFail); + + } + + +TInt +RAsyncTestStepOmxILPcmRenderer0020::RAsyncTestStepOmxILPcmRenderer0020Step01(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0020::RAsyncTestStepOmxILPcmRenderer0020Step01")); + RAsyncTestStepOmxILPcmRenderer0020* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0020Step01(); + return KErrNone; + } + +void +RAsyncTestStepOmxILPcmRenderer0020::DoRAsyncTestStepOmxILPcmRenderer0020Step01() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0020::DoRAsyncTestStepOmxILPcmRenderer0020Step01")); + + + // + // Obtain the component's state + // + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateLoaded != compState) + { + return StopTest(KErrGeneral, EFail); + } + + char componentNameArray[OMX_MAX_STRINGNAME_SIZE]; + OMX_VERSIONTYPE componentVersion; + OMX_VERSIONTYPE specVersion; + OMX_UUIDTYPE componentUUID; + + // + // Obtain the component's version + // + + if (OMX_ErrorNone != ipCompHandle->GetComponentVersion( + ipCompHandle, + componentNameArray, + &componentVersion, + &specVersion, + &componentUUID)) + { + return StopTest(KErrGeneral, EFail); + } + + TBuf8<128> componentNameBuf8; + componentNameBuf8 = const_cast(reinterpret_cast(componentNameArray)); + TBuf<128> componentNameBuf16; + INFO_PRINTF2(_L("Component Name length: %d"), componentNameBuf8.Length()); + componentNameBuf16.Copy(componentNameBuf8); + componentNameBuf16.PtrZ(); + + // INFO_PRINTF2(_L("Component Name: %s"), dst.Ptr()); + INFO_PRINTF2(_L("Component Name: %S"), &componentNameBuf16); + INFO_PRINTF2(_L("Component Version Major: %d"), componentVersion.s.nVersionMajor); + INFO_PRINTF2(_L("Component Version Minor: %d"), componentVersion.s.nVersionMinor); + INFO_PRINTF2(_L("Component Version Revision: %d"), componentVersion.s.nRevision); + INFO_PRINTF2(_L("Component Version Step: %d"), componentVersion.s.nStep); + INFO_PRINTF2(_L("OMX Version Major: %d"), specVersion.s.nVersionMajor); + INFO_PRINTF2(_L("OMX Version Minor: %d"), specVersion.s.nVersionMinor); + INFO_PRINTF2(_L("OMX Version Revision: %d"), specVersion.s.nRevision); + INFO_PRINTF2(_L("OMX Version Step: %d"), specVersion.s.nStep); + INFO_PRINTF2(_L("Component UUID: %X"), componentUUID); + + + // + // Provide callbacks to component + // + OMX_CALLBACKTYPE* omxCallbacks = *ipCallbackHandler; + + if (OMX_ErrorNone != ipCompHandle->SetCallbacks( + ipCompHandle, + omxCallbacks, + ipCallbackHandler)) + { + return StopTest(KErrGeneral, EFail); + } + + INFO_PRINTF2(_L("Component Callbacks set successfully: %X"), ipCallbackHandler); + + // + // Obtain the port def params for Port #0 + // + OMX_PARAM_PORTDEFINITIONTYPE portParamsInputPort; + portParamsInputPort.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE); + portParamsInputPort.nVersion = TOmxILSpecVersion(); + portParamsInputPort.nPortIndex = 0; + if (OMX_ErrorNone != ipCompHandle->GetParameter( + ipCompHandle, + OMX_IndexParamPortDefinition, + &portParamsInputPort)) + { + return StopTest(KErrGeneral, EFail); + } + + INFO_PRINTF2(_L("PORTDEFINITIONTYPE nPortIndex: %d"), portParamsInputPort.nPortIndex); + INFO_PRINTF2(_L("PORTDEFINITIONTYPE eDir: %d"), portParamsInputPort.eDir); + INFO_PRINTF2(_L("PORTDEFINITIONTYPE nBufferCountActual: %d"), portParamsInputPort.nBufferCountActual); + INFO_PRINTF2(_L("PORTDEFINITIONTYPE nBufferCountMin: %d"), portParamsInputPort.nBufferCountMin); + INFO_PRINTF2(_L("PORTDEFINITIONTYPE nBufferSize: %d"), portParamsInputPort.nBufferSize); + INFO_PRINTF2(_L("PORTDEFINITIONTYPE bEnabled: %d"), portParamsInputPort.bEnabled == OMX_FALSE ? 0 : 1); + INFO_PRINTF2(_L("PORTDEFINITIONTYPE bPopulated: %d"), portParamsInputPort.bPopulated == OMX_FALSE ? 0 : 1); + INFO_PRINTF2(_L("PORTDEFINITIONTYPE eDomain: %d"), portParamsInputPort.eDomain); + + TBuf8<128> cMIMEType8Input; + cMIMEType8Input = const_cast(reinterpret_cast(portParamsInputPort.format.audio.cMIMEType)); + + TBuf<128> cMIMEType16Input; + cMIMEType16Input.Copy(cMIMEType8Input); + cMIMEType16Input.PtrZ(); + + INFO_PRINTF2(_L("PORTDEFINITIONTYPE format.cMIMEType: %S"), &cMIMEType16Input); + INFO_PRINTF2(_L("PORTDEFINITIONTYPE format.pNativeRender: %X"), portParamsInputPort.format.audio.pNativeRender); + INFO_PRINTF2(_L("PORTDEFINITIONTYPE format.bFlagErrorConcealment: %d"), + portParamsInputPort.format.audio.bFlagErrorConcealment == OMX_FALSE ? 0 : 1); + INFO_PRINTF2(_L("PORTDEFINITIONTYPE format.eEncoding: %d"), portParamsInputPort.format.audio.eEncoding); + INFO_PRINTF2(_L("PORTDEFINITIONTYPE bBuffersContiguous: %d"), + portParamsInputPort.bBuffersContiguous == OMX_FALSE ? 0 : 1); + INFO_PRINTF2(_L("PORTDEFINITIONTYPE nBufferAlignment: %d"), portParamsInputPort.nBufferAlignment); + } + +// +// RAsyncTestStepOmxILPcmRenderer0021 +// +RAsyncTestStepOmxILPcmRenderer0021::RAsyncTestStepOmxILPcmRenderer0021(const TDesC& aTestName, TInt aComponentUid) + : + RAsyncTestStepOmxILComponentBase(aTestName, aComponentUid), + ipKickoff01(NULL), + ipKickoff02(NULL), + ipKickoff03(NULL), + ipKickoff04(NULL), + ipKickoff05(NULL), + ipKickoff06(NULL) + + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0021::RAsyncTestStepOmxILPcmRenderer0021")); + } + + +void +RAsyncTestStepOmxILPcmRenderer0021::KickoffTestL() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0021::KickoffTestL")); + + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test21 ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Init Component ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Provide callbacks to component (SetCallbacks) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Obtain the component's state (GetState) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Obtain component's role #1 with null string (ComponentRoleEnum fails with OMX_ErrorBadParameter) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 5.- Obtain component's role #1 (ComponentRoleEnum returns audio_renderer.pcm) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 6.- Obtain component's role #2 (ComponentRoleEnum fails with OMX_ErrorNoMore) ")); + + // This will install one callback + RAsyncTestStepOmxILComponentBase::KickoffTestL(); + + // This is the only step in this test... + TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0021Step01, this); + delete ipKickoff01; + ipKickoff01 = NULL; + ipKickoff01 = + new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); + ipKickoff01->Call(); + + // The successful termination... + TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this); + delete ipKickoffStop; + ipKickoffStop = NULL; + ipKickoffStop = + new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow); + ipKickoffStop->Call(); + + } + +void +RAsyncTestStepOmxILPcmRenderer0021::CloseTest() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0021::CloseTest")); + + delete ipKickoff01; // no need to Cancel + ipKickoff01 = NULL; + delete ipKickoff02; // no need to Cancel + ipKickoff02 = NULL; + delete ipKickoff03; // no need to Cancel + ipKickoff03 = NULL; + delete ipKickoff04; // no need to Cancel + ipKickoff04 = NULL; + delete ipKickoff05; // no need to Cancel + ipKickoff05 = NULL; + delete ipKickoff06; // no need to Cancel + ipKickoff06 = NULL; + + delete ipKickoffStop; // no need to Cancel + ipKickoffStop = 0; + + RAsyncTestStepOmxILComponentBase::CloseTest(); + + } + + +void +RAsyncTestStepOmxILPcmRenderer0021::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/, + OMX_EVENTTYPE /*aEvent*/, + TUint /*aData1*/, + TUint /*aData2*/, + TAny* /*aExtra*/) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0021::DoEventHandlerL")); + + // We don't expect here any callback + return StopTest(KErrGeneral, EFail); + + } + + +TInt +RAsyncTestStepOmxILPcmRenderer0021::RAsyncTestStepOmxILPcmRenderer0021Step01(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0021::RAsyncTestStepOmxILPcmRenderer0021Step01")); + RAsyncTestStepOmxILPcmRenderer0021* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0021Step01(); + return KErrNone; + } + +void +RAsyncTestStepOmxILPcmRenderer0021::DoRAsyncTestStepOmxILPcmRenderer0021Step01() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0021::DoRAsyncTestStepOmxILPcmRenderer0021Step01")); + + // + // Provide callbacks to component + // + OMX_CALLBACKTYPE* omxCallbacks = *ipCallbackHandler; + + if (OMX_ErrorNone != ipCompHandle->SetCallbacks( + ipCompHandle, + omxCallbacks, + ipCallbackHandler)) + { + return StopTest(KErrGeneral, EFail); + } + + // + // Obtain the component's state + // + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateLoaded != compState) + { + return StopTest(KErrGeneral, EFail); + } + + INFO_PRINTF2(_L("Component Callbacks set successfully: %X"), ipCallbackHandler); + + + // + // Try to obtain the component's first role with null string (must fail with error OMX_ErrorBadParameter) + // + OMX_U8* pNullUint = 0; + if (OMX_ErrorBadParameter != ipCompHandle->ComponentRoleEnum( + ipCompHandle, + pNullUint, + 0 // This is index # 0, the first of the component's roles + )) + { + return StopTest(KErrGeneral, EFail); + } + + // + // Obtain the component's first role (success) + // + char componentRoleArray[OMX_MAX_STRINGNAME_SIZE]; + if (OMX_ErrorNone != ipCompHandle->ComponentRoleEnum( + ipCompHandle, + reinterpret_cast(componentRoleArray), + 0 // This is index # 0, the first of the component's roles + )) + { + return StopTest(KErrGeneral, EFail); + } + + TBuf8<128> componentRoleBuf8; + componentRoleBuf8 = const_cast(reinterpret_cast(componentRoleArray)); + TBuf<128> componentRoleBuf16; + INFO_PRINTF2(_L("Component's Role length: %d"), componentRoleBuf8.Length()); + componentRoleBuf16.Copy(componentRoleBuf8); + componentRoleBuf16.PtrZ(); + + INFO_PRINTF2(_L("Component's 1st Role [%S] "), &componentRoleBuf16); + + if (componentRoleBuf8.Compare(KSymbianOmxILPcmRendererRole()) != 0) + { + return StopTest(KErrGeneral, EFail); + } + + // + // Obtain the component's second role (must fail with error OMX_ErrorNoMore) + // + if (OMX_ErrorNoMore != ipCompHandle->ComponentRoleEnum( + ipCompHandle, + reinterpret_cast(componentRoleArray), + 1 // This is index # 1, the second of the component's roles + )) + { + return StopTest(KErrGeneral, EFail); + } + + } + +// +// RAsyncTestStepOmxILPcmRenderer0022 +// +RAsyncTestStepOmxILPcmRenderer0022::RAsyncTestStepOmxILPcmRenderer0022(const TDesC& aTestName, TInt aComponentUid) + : + RAsyncTestStepOmxILComponentBase(aTestName, aComponentUid), + ipKickoff01(NULL), + ipKickoff02(NULL), + ipKickoff03(NULL), + ipKickoff04(NULL), + ipKickoff05(NULL), + ipKickoff06(NULL) + + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0022::RAsyncTestStepOmxILPcmRenderer0022")); + } + + +void +RAsyncTestStepOmxILPcmRenderer0022::KickoffTestL() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0022::KickoffTestL")); + + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test22 ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Init Component ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Provide callbacks to component (SetCallbacks) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Obtain the component's state (GetState) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Get component's current role (GetParameter(OMX_IndexParamStandardComponentRole) )")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 5.- Set unsupported audio_renderer.wrong role (SetParameter(OMX_IndexParamStandardComponentRole) )")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 5a.- SetParameter returns OMX_ErrorBadParameter (audio_renderer.wrong role not supported)")); + + // This will install one callback + RAsyncTestStepOmxILComponentBase::KickoffTestL(); + + // This is the only step in this test... + TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0022Step01, this); + delete ipKickoff01; + ipKickoff01 = NULL; + ipKickoff01 = + new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); + ipKickoff01->Call(); + + // The successful termination... + TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this); + delete ipKickoffStop; + ipKickoffStop = NULL; + ipKickoffStop = + new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow); + ipKickoffStop->Call(); + + } + +void +RAsyncTestStepOmxILPcmRenderer0022::CloseTest() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0022::CloseTest")); + + delete ipKickoff01; // no need to Cancel + ipKickoff01 = NULL; + delete ipKickoff02; // no need to Cancel + ipKickoff02 = NULL; + delete ipKickoff03; // no need to Cancel + ipKickoff03 = NULL; + delete ipKickoff04; // no need to Cancel + ipKickoff04 = NULL; + delete ipKickoff05; // no need to Cancel + ipKickoff05 = NULL; + delete ipKickoff06; // no need to Cancel + ipKickoff06 = NULL; + + delete ipKickoffStop; // no need to Cancel + ipKickoffStop = 0; + + RAsyncTestStepOmxILComponentBase::CloseTest(); + + } + + +void +RAsyncTestStepOmxILPcmRenderer0022::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/, + OMX_EVENTTYPE /*aEvent*/, + TUint /*aData1*/, + TUint /*aData2*/, + TAny* /*aExtra*/) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0022::DoEventHandlerL")); + + // We don't expect here any callback + return StopTest(KErrGeneral, EFail); + + } + + +TInt +RAsyncTestStepOmxILPcmRenderer0022::RAsyncTestStepOmxILPcmRenderer0022Step01(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0022::RAsyncTestStepOmxILPcmRenderer0022Step01")); + RAsyncTestStepOmxILPcmRenderer0022* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0022Step01(); + return KErrNone; + } + +void +RAsyncTestStepOmxILPcmRenderer0022::DoRAsyncTestStepOmxILPcmRenderer0022Step01() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0022::DoRAsyncTestStepOmxILPcmRenderer0022Step01")); + + // + // Provide callbacks to component + // + OMX_CALLBACKTYPE* omxCallbacks = *ipCallbackHandler; + + if (OMX_ErrorNone != ipCompHandle->SetCallbacks( + ipCompHandle, + omxCallbacks, + ipCallbackHandler)) + { + return StopTest(KErrGeneral, EFail); + } + + INFO_PRINTF2(_L("Component Callbacks set successfully: %X"), ipCallbackHandler); + + // + // Obtain the component's state + // + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateLoaded != compState) + { + return StopTest(KErrGeneral, EFail); + } + + // + // Get component's current standard role + // + OMX_PARAM_COMPONENTROLETYPE componentRoleType; + componentRoleType.nSize = sizeof(OMX_PARAM_COMPONENTROLETYPE); + componentRoleType.nVersion = TOmxILSpecVersion(); + if (OMX_ErrorNone != ipCompHandle->GetParameter( + ipCompHandle, + OMX_IndexParamStandardComponentRole, + &componentRoleType)) + { + return StopTest(KErrGeneral, EFail); + } + + TBuf8<128> componentRoleBuf8; + componentRoleBuf8 = const_cast(reinterpret_cast(componentRoleType.cRole)); + TBuf<128> componentRoleBuf16; + INFO_PRINTF2(_L("Component Role length: %d"), componentRoleBuf8.Length()); + componentRoleBuf16.Copy(componentRoleBuf8); + componentRoleBuf16.PtrZ(); + + INFO_PRINTF2(_L("Component's current Role: %S"), &componentRoleBuf16); + + + // + // Set unsupported standard role + // + TPtr8 role(reinterpret_cast(componentRoleType.cRole), + OMX_MAX_STRINGNAME_SIZE); + role.Copy(KTestOmxILWrongRendererRole()); + role.PtrZ(); + + if (OMX_ErrorBadParameter != ipCompHandle->SetParameter( + ipCompHandle, + OMX_IndexParamStandardComponentRole, + &componentRoleType)) + { + return StopTest(KErrGeneral, EFail); + } + + TBuf8<128> cRole8; + cRole8 = const_cast(reinterpret_cast(componentRoleType.cRole)); + + TBuf<128> cRole16; + cRole16.Copy(cRole8); + cRole16.PtrZ(); + + INFO_PRINTF2(_L("SetParameter of an unsupported standard role failed (success): %S"), &cRole16); + + } + + + +// +// RAsyncTestStepOmxILPcmRenderer0001 +// +RAsyncTestStepOmxILPcmRenderer0001::RAsyncTestStepOmxILPcmRenderer0001(const TDesC& aTestName, TInt aComponentUid) + : + RAsyncTestStepOmxILComponentBase(aTestName, aComponentUid), + ipBufferHeaderInput(0), + ipBufferHeaderOutput(0), + iTerminateNow(EFalse), + iSamplingRate(8000), + iTestState(EStateDefault), + ipKickoff01(NULL), + ipKickoff02(NULL), + ipKickoff03(NULL), + ipKickoff04(NULL), + ipKickoff05(NULL), + ipKickoff06(NULL) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0001::RAsyncTestStepOmxILPcmRenderer0001")); + } + + +void +RAsyncTestStepOmxILPcmRenderer0001::KickoffTestL() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0001::KickoffTestL")); + iTestState = EStateLoadKickoffTestLComplete; + + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test01 ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(AllocateBuffer-population) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Loaded(depopulation) ")); + + // This will install one callback + RAsyncTestStepOmxILComponentBase::KickoffTestL(); + + TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0001Step01, this); + delete ipKickoff01; + ipKickoff01 = NULL; + ipKickoff01 = + new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); + ipKickoff01->Call(); + + } + +void +RAsyncTestStepOmxILPcmRenderer0001::CloseTest() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0001::CloseTest")); + + delete ipKickoff01; // no need to Cancel + ipKickoff01 = NULL; + delete ipKickoff02; // no need to Cancel + ipKickoff02 = NULL; + delete ipKickoff03; // no need to Cancel + ipKickoff03 = NULL; + delete ipKickoff04; // no need to Cancel + ipKickoff04 = NULL; + delete ipKickoff05; // no need to Cancel + ipKickoff05 = NULL; + delete ipKickoff06; // no need to Cancel + ipKickoff06 = NULL; + + delete ipKickoffStop; // no need to Cancel + ipKickoffStop = 0; + + TInt count = ipClientClockPortBufferArray.Count(); + + for (TInt n = 0; n < count; n++) + { + delete ipClientClockPortBufferArray[n]; + } + + ipClientClockPortBufferArray.Close(); + + RAsyncTestStepOmxILComponentBase::CloseTest(); + + } + + +void +RAsyncTestStepOmxILPcmRenderer0001::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/, + OMX_EVENTTYPE /*aEvent*/, + TUint /*aData1*/, + TUint /*aData2*/, + TAny* /*aExtra*/) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0001::DoEventHandlerL")); + + if (!iTerminateNow) + { + TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0001Step02, this); + delete ipKickoff02; + ipKickoff02 = NULL; + ipKickoff02 = + new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow); + ipKickoff02->Call(); + } + else + { + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateLoaded != compState) + { + return StopTest(KErrGeneral, EFail); + } + + // The successful termination... + TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this); + delete ipKickoffStop; + ipKickoffStop = NULL; + ipKickoffStop = + new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow); + ipKickoffStop->Call(); + } + + } + + +TInt +RAsyncTestStepOmxILPcmRenderer0001::RAsyncTestStepOmxILPcmRenderer0001Step01(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0001::RAsyncTestStepOmxILPcmRenderer0001Step01")); + RAsyncTestStepOmxILPcmRenderer0001* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0001Step01(); + return KErrNone; + } + +void +RAsyncTestStepOmxILPcmRenderer0001::DoRAsyncTestStepOmxILPcmRenderer0001Step01() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0001::DoRAsyncTestStepOmxILPcmRenderer0001Step01")); + + // + // Provide callbacks to component + // + OMX_CALLBACKTYPE* omxCallbacks = *ipCallbackHandler; + + if (OMX_ErrorNone != ipCompHandle->SetCallbacks( + ipCompHandle, + omxCallbacks, + ipCallbackHandler)) + { + return StopTest(KErrGeneral, EFail); + } + + INFO_PRINTF2(_L("Component Callbacks set successfully: %X"), ipCallbackHandler); + + // + // Obtain the port def params for Port #0 + // + OMX_PARAM_PORTDEFINITIONTYPE portParamsInputPort; + portParamsInputPort.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE); + portParamsInputPort.nVersion = TOmxILSpecVersion(); + portParamsInputPort.nPortIndex = 0; + if (OMX_ErrorNone != ipCompHandle->GetParameter( + ipCompHandle, + OMX_IndexParamPortDefinition, + &portParamsInputPort)) + { + return StopTest(KErrGeneral, EFail); + } + + // + // Obtain the port def params for Client Clock Port #1 + // + OMX_PARAM_PORTDEFINITIONTYPE portParamsInputPort1; + portParamsInputPort1.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE); + portParamsInputPort1.nVersion = TOmxILSpecVersion(); + portParamsInputPort1.nPortIndex = 1; + + if (OMX_ErrorNone != ipCompHandle->GetParameter( + ipCompHandle, + OMX_IndexParamPortDefinition, + &portParamsInputPort1)) + { + return StopTest(KErrGeneral, EFail); + } + + // + // Change the sampling rate on PCM Renderer's port #0 + // + OMX_AUDIO_PARAM_PCMMODETYPE pcmMode; + pcmMode.nSize = sizeof(OMX_AUDIO_PARAM_PCMMODETYPE); + pcmMode.nVersion = TOmxILSpecVersion(); + pcmMode.nPortIndex = 0; + if (OMX_ErrorNone != ipCompHandle->GetParameter( + ipCompHandle, + OMX_IndexParamAudioPcm, + &pcmMode)) + { + return StopTest(KErrGeneral, EFail); + } + pcmMode.nSamplingRate = iSamplingRate; + if (OMX_ErrorNone != ipCompHandle->SetParameter( + ipCompHandle, + OMX_IndexParamAudioPcm, + &pcmMode)) + { + return StopTest(KErrGeneral, EFail); + } + + // + // Move component to OMX_StateIdle + // + + if (OMX_ErrorNone != ipCompHandle->SendCommand( + ipCompHandle, + OMX_CommandStateSet, + OMX_StateIdle, + 0)) + { + return StopTest(KErrGeneral, EFail); + } + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Moving component to OMX_StateIdle")); + + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateLoaded != compState) + { + return StopTest(KErrGeneral, EFail); + } + + // + // Allocate buffer on input port + // + if (OMX_ErrorNone != ipCompHandle->AllocateBuffer( + ipCompHandle, + &ipBufferHeaderInput, + 0, // input port + 0, + portParamsInputPort.nBufferSize)) + { + return StopTest(KErrGeneral, EFail); + } + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Populated buffer (AllocateBuffer) in INPUT port")); + + // + // Allocate buffer on Client Clock Port + // + TInt bufferCount = portParamsInputPort1.nBufferCountActual; + + for (TInt n = 0; n < bufferCount; n++) + { + OMX_BUFFERHEADERTYPE* clockBufPtr; + + if (OMX_ErrorNone != ipCompHandle->AllocateBuffer( + ipCompHandle, + &clockBufPtr, + 1, // Clock input port + 0, + portParamsInputPort1.nBufferSize)) + { + return StopTest(KErrGeneral, EFail); + } + + if (ipClientClockPortBufferArray.Append(clockBufPtr) != KErrNone) + { + return StopTest(KErrNoMemory, EFail); + } + } + + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Populated buffer (AllocateBuffer) in Clock INPUT port")); + } + +TInt +RAsyncTestStepOmxILPcmRenderer0001::RAsyncTestStepOmxILPcmRenderer0001Step02(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0001::RAsyncTestStepOmxILPcmRenderer0001Step02")); + RAsyncTestStepOmxILPcmRenderer0001* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0001Step02(); + return KErrNone; + } + +void +RAsyncTestStepOmxILPcmRenderer0001::DoRAsyncTestStepOmxILPcmRenderer0001Step02() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0001::DoRAsyncTestStepOmxILPcmRenderer0001Step02")); + + // + // Move component to OMX_StateLoaded + // + + if (OMX_ErrorNone != ipCompHandle->SendCommand( + ipCompHandle, + OMX_CommandStateSet, + OMX_StateLoaded, + 0)) + { + return StopTest(KErrGeneral, EFail); + } + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Moving component to OMX_StateLoaded")); + + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateIdle != compState) + { + return StopTest(KErrGeneral, EFail); + } + + // + // Free buffer on input port + // + if (OMX_ErrorNone != ipCompHandle->FreeBuffer( + ipCompHandle, + 0, // input port + ipBufferHeaderInput)) + { + return StopTest(KErrGeneral, EFail); + } + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Depopulated buffer (FreeBuffer) in INPUT port")); + + // + // Free Client Clock Port buffer on input port + // + TInt count = ipClientClockPortBufferArray.Count(); + + for (TInt n = 0; n < count; n++) + { + if (OMX_ErrorNone != ipCompHandle->FreeBuffer( + ipCompHandle, + 1, // Client Clock Port + ipClientClockPortBufferArray[0])) + { + return StopTest(KErrGeneral, EFail); + } + + ipClientClockPortBufferArray.Remove(0); + } + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Depopulated Client Clock Port buffer (FreeBuffer) in INPUT port")); + + iTerminateNow = ETrue; + + } + + +// +// RAsyncTestStepOmxILPcmRenderer0002 +// +RAsyncTestStepOmxILPcmRenderer0002::RAsyncTestStepOmxILPcmRenderer0002(const TDesC& aTestName, TInt aComponentUid) + : + RAsyncTestStepOmxILPcmRenderer0001(aTestName, aComponentUid), + ipInputBuffer(0), + ipOutputBuffer(0) + + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0002::RAsyncTestStepOmxILPcmRenderer0002")); + } + + +void +RAsyncTestStepOmxILPcmRenderer0002::KickoffTestL() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0002::KickoffTestL")); + + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test02 ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(UseBuffer-population) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Loaded(depopulation) ")); + + // This will install one callback + RAsyncTestStepOmxILComponentBase::KickoffTestL(); + + TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0002Step01, this); + delete ipKickoff01; + ipKickoff01 = NULL; + ipKickoff01 = + new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); + ipKickoff01->Call(); + + } + +void +RAsyncTestStepOmxILPcmRenderer0002::CloseTest() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0002::CloseTest")); + + delete ipInputBuffer; + ipInputBuffer = NULL; + delete ipOutputBuffer; + ipOutputBuffer = NULL; + + delete ipKickoff01; // no need to Cancel + ipKickoff01 = NULL; + delete ipKickoff02; // no need to Cancel + ipKickoff02 = NULL; + delete ipKickoff03; // no need to Cancel + ipKickoff03 = NULL; + delete ipKickoff04; // no need to Cancel + ipKickoff04 = NULL; + delete ipKickoff05; // no need to Cancel + ipKickoff05 = NULL; + delete ipKickoff06; // no need to Cancel + ipKickoff06 = NULL; + + delete ipKickoffStop; // no need to Cancel + ipKickoffStop = 0; + + ipClientClockPortBufferArray.Close(); + + TInt count = iClockPortBufferPtrArray.Count(); + + for (TInt n = 0; n < count; n++) + { + delete iClockPortBufferPtrArray[n]; + } + + iClockPortBufferPtrArray.Close(); + + RAsyncTestStepOmxILComponentBase::CloseTest(); + + } + +void +RAsyncTestStepOmxILPcmRenderer0002::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/, + OMX_EVENTTYPE /*aEvent*/, + TUint /*aData1*/, + TUint /*aData2*/, + TAny* /*aExtra*/) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0002::DoEventHandlerL")); + + if (!iTerminateNow) + { + TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0002Step02, this); + delete ipKickoff02; + ipKickoff02 = NULL; + ipKickoff02 = + new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow); + ipKickoff02->Call(); + } + + if (iTerminateNow) + { + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateLoaded != compState) + { + return StopTest(KErrGeneral, EFail); + } + + // The successful termination... + TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this); + delete ipKickoffStop; + ipKickoffStop = NULL; + ipKickoffStop = + new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow); + ipKickoffStop->Call(); + } + + } + + +TInt +RAsyncTestStepOmxILPcmRenderer0002::RAsyncTestStepOmxILPcmRenderer0002Step01(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0002::RAsyncTestStepOmxILPcmRenderer0002Step01")); + RAsyncTestStepOmxILPcmRenderer0002* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0002Step01(); + return KErrNone; + } + +void +RAsyncTestStepOmxILPcmRenderer0002::DoRAsyncTestStepOmxILPcmRenderer0002Step01() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0002::DoRAsyncTestStepOmxILPcmRenderer0002Step01")); + + // + // Provide callbacks to component + // + OMX_CALLBACKTYPE* omxCallbacks = *ipCallbackHandler; + + if (OMX_ErrorNone != ipCompHandle->SetCallbacks( + ipCompHandle, + omxCallbacks, + ipCallbackHandler)) + { + return StopTest(KErrGeneral, EFail); + } + + INFO_PRINTF2(_L("Component Callbacks set successfully: %X"), ipCallbackHandler); + + // + // Obtain the port def params for Port #0 + // + OMX_PARAM_PORTDEFINITIONTYPE portParamsInputPort; + portParamsInputPort.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE); + portParamsInputPort.nVersion = TOmxILSpecVersion(); + portParamsInputPort.nPortIndex = 0; + if (OMX_ErrorNone != ipCompHandle->GetParameter( + ipCompHandle, + OMX_IndexParamPortDefinition, + &portParamsInputPort)) + { + return StopTest(KErrGeneral, EFail); + } + + // + // Obtain the port def params for Client Clock Port #1 + // + OMX_PARAM_PORTDEFINITIONTYPE portParamsInputPort1; + portParamsInputPort1.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE); + portParamsInputPort1.nVersion = TOmxILSpecVersion(); + portParamsInputPort1.nPortIndex = 1; + + if (OMX_ErrorNone != ipCompHandle->GetParameter( + ipCompHandle, + OMX_IndexParamPortDefinition, + &portParamsInputPort1)) + { + return StopTest(KErrGeneral, EFail); + } + + // + // Move component to OMX_StateIdle + // + + if (OMX_ErrorNone != ipCompHandle->SendCommand( + ipCompHandle, + OMX_CommandStateSet, + OMX_StateIdle, + 0)) + { + return StopTest(KErrGeneral, EFail); + } + + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateLoaded != compState) + { + return StopTest(KErrGeneral, EFail); + } + + + // + // Allocate buffer on input port + // + TRAPD(err, ipInputBuffer = CMMFDescriptorBuffer::NewL(portParamsInputPort.nBufferSize)); + if(err != KErrNone) + { + return StopTest(KErrGeneral, EFail); + } + + TDes8& inputBufferDes = ipInputBuffer->Data(); + + if (OMX_ErrorNone != ipCompHandle->UseBuffer( + ipCompHandle, + &ipBufferHeaderInput, + 0, // input port + ipInputBuffer, // pAppPrivate + portParamsInputPort.nBufferSize, + const_cast(inputBufferDes.Ptr()))) + { + return StopTest(KErrGeneral, EFail); + } + INFO_PRINTF1(_L("Populated buffer (UseBuffer) in INPUT port")); + + // + // Allocate Client Clock Port buffer + // + TInt bufferCount = portParamsInputPort1.nBufferCountActual; + + for (TInt n = 0; n < bufferCount; n++) + { + CMMFDescriptorBuffer* bufPtr; + + TRAPD(err, bufPtr = CMMFDescriptorBuffer::NewL(portParamsInputPort1.nBufferSize)); + + if(err != KErrNone) + { + return StopTest(KErrGeneral, EFail); + } + + if (iClockPortBufferPtrArray.Append(bufPtr) != KErrNone) + { + delete bufPtr; + return StopTest(KErrGeneral, EFail); + } + + TDes8& inputBufferDes = bufPtr->Data(); + OMX_BUFFERHEADERTYPE* clockBufPtr; + + if (OMX_ErrorNone != ipCompHandle->UseBuffer( + ipCompHandle, + &clockBufPtr, + 1, // Clock input port + ipInputBuffer, // pAppPrivate + portParamsInputPort.nBufferSize, + const_cast(inputBufferDes.Ptr()))) + { + return StopTest(KErrGeneral, EFail); + } + + ipClientClockPortBufferArray.AppendL(clockBufPtr); + } + INFO_PRINTF1(_L("Populated buffer (UseBuffer) in Client Clock Port")); + + } + +TInt +RAsyncTestStepOmxILPcmRenderer0002::RAsyncTestStepOmxILPcmRenderer0002Step02(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0002::RAsyncTestStepOmxILPcmRenderer0002Step02")); + // NOTE, Here we reuse inherited code, to depopulate the component and make it go to OMX_StateLoaded + RAsyncTestStepOmxILPcmRenderer0002* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0001Step02(); + return KErrNone; + } + + +// +// RAsyncTestStepOmxILPcmRenderer0003 +// +RAsyncTestStepOmxILPcmRenderer0003::RAsyncTestStepOmxILPcmRenderer0003(const TDesC& aTestName, TInt aComponentUid) + : + RAsyncTestStepOmxILComponentBase(aTestName, aComponentUid), + iTerminateNow(EFalse), + ipKickoff01(NULL), + ipKickoff02(NULL), + ipKickoff03(NULL), + ipKickoff04(NULL), + ipKickoff05(NULL), + ipKickoff06(NULL) + + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0003::RAsyncTestStepOmxILPcmRenderer0003")); + } + + +void +RAsyncTestStepOmxILPcmRenderer0003::KickoffTestL() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0003::KickoffTestL")); + + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test03 ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->WaitForResources ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- WaitForResources->Loaded ")); + + // This will install one callback + RAsyncTestStepOmxILComponentBase::KickoffTestL(); + + TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0003Step01, this); + delete ipKickoff01; + ipKickoff01 = NULL; + ipKickoff01 = + new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); + ipKickoff01->Call(); + + // This will be used later in DoRAsyncTestStepOmxILPcmRenderer0003Step02 + TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this); + delete ipKickoffStop; + ipKickoffStop = NULL; + ipKickoffStop = + new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow); + + } + +void +RAsyncTestStepOmxILPcmRenderer0003::CloseTest() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0003::CloseTest")); + + delete ipKickoff01; // no need to Cancel + ipKickoff01 = NULL; + delete ipKickoff02; // no need to Cancel + ipKickoff02 = NULL; + delete ipKickoff03; // no need to Cancel + ipKickoff03 = NULL; + delete ipKickoff04; // no need to Cancel + ipKickoff04 = NULL; + delete ipKickoff05; // no need to Cancel + ipKickoff05 = NULL; + delete ipKickoff06; // no need to Cancel + ipKickoff06 = NULL; + + delete ipKickoffStop; // no need to Cancel + ipKickoffStop = 0; + + RAsyncTestStepOmxILComponentBase::CloseTest(); + + } + +void +RAsyncTestStepOmxILPcmRenderer0003::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/, + OMX_EVENTTYPE /*aEvent*/, + TUint /*aData1*/, + TUint /*aData2*/, + TAny* /*aExtra*/) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0003::DoEventHandlerL")); + + TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0003Step02, this); + delete ipKickoff02; + ipKickoff02 = NULL; + ipKickoff02 = + new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow); + ipKickoff02->Call(); + + } + + +TInt +RAsyncTestStepOmxILPcmRenderer0003::RAsyncTestStepOmxILPcmRenderer0003Step01(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0003::RAsyncTestStepOmxILPcmRenderer0003Step01")); + RAsyncTestStepOmxILPcmRenderer0003* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0003Step01(); + return KErrNone; + } + +void +RAsyncTestStepOmxILPcmRenderer0003::DoRAsyncTestStepOmxILPcmRenderer0003Step01() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0003::DoRAsyncTestStepOmxILPcmRenderer0003Step01")); + + // + // Obtain the component's state + // + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateLoaded != compState) + { + return StopTest(KErrGeneral, EFail); + } + + // + // Provide callbacks to component + // + OMX_CALLBACKTYPE* omxCallbacks = *ipCallbackHandler; + + if (OMX_ErrorNone != ipCompHandle->SetCallbacks( + ipCompHandle, + omxCallbacks, + ipCallbackHandler)) + { + return StopTest(KErrGeneral, EFail); + } + + INFO_PRINTF2(_L("Component Callbacks set successfully: %X"), ipCallbackHandler); + + // + // Move component to OMX_StateWaitForResources + // + + if (OMX_ErrorNone != ipCompHandle->SendCommand( + ipCompHandle, + OMX_CommandStateSet, + OMX_StateWaitForResources, + 0)) + { + return StopTest(KErrGeneral, EFail); + } + + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateWaitForResources != compState) + { + return StopTest(KErrGeneral, EFail); + } + + // + // The following code is to improve code coerage only + // + OMX_AUDIO_PARAM_PCMMODETYPE pcmMode; + pcmMode.nSize = sizeof(OMX_AUDIO_PARAM_PCMMODETYPE); + pcmMode.nVersion = TOmxILSpecVersion(); + pcmMode.nPortIndex = 0; + if (OMX_ErrorNone != ipCompHandle->GetParameter( + ipCompHandle, + OMX_IndexParamAudioPcm, + &pcmMode)) + { + return StopTest(KErrGeneral, EFail); + } + pcmMode.nSamplingRate = 44100; + if (OMX_ErrorNone != ipCompHandle->SetParameter( + ipCompHandle, + OMX_IndexParamAudioPcm, + &pcmMode)) + { + return StopTest(KErrGeneral, EFail); + } + OMX_BUFFERHEADERTYPE temp; + OMX_BUFFERHEADERTYPE* bufferHeaderInput=&temp; + if (OMX_ErrorIncorrectStateOperation != ipCompHandle->AllocateBuffer( + ipCompHandle, + &bufferHeaderInput, + 0, // input port + 0, + 1024)) + { + return StopTest(KErrGeneral, EFail); + } + + if (OMX_ErrorBadPortIndex != ipCompHandle->EmptyThisBuffer( + ipCompHandle, + bufferHeaderInput)) + { + return StopTest(KErrGeneral, EFail); + } + + if (OMX_ErrorBadPortIndex != ipCompHandle->FillThisBuffer( + ipCompHandle, + bufferHeaderInput)) + { + return StopTest(KErrGeneral, EFail); + } + + if (OMX_ErrorBadPortIndex != ipCompHandle->FreeBuffer( + ipCompHandle, + 2, + bufferHeaderInput)) + { + return StopTest(KErrGeneral, EFail); + } + + if (OMX_ErrorNone != ipCompHandle->SendCommand( + ipCompHandle, + OMX_CommandPortEnable, + 0, + 0)) + { + return StopTest(KErrGeneral, EFail); + } + + OMX_TUNNELSETUPTYPE tunnelSetup; + OMX_U32 outputPort = 1; + OMX_U32 inputPort = 0; + + if (OMX_ErrorIncorrectStateOperation != + ipCompHandle->ComponentTunnelRequest( + ipCompHandle, + outputPort, + ipCompHandle, + inputPort, + &tunnelSetup)) + { + return StopTest(KErrGeneral, EFail); + } + } + +TInt +RAsyncTestStepOmxILPcmRenderer0003::RAsyncTestStepOmxILPcmRenderer0003Step02(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0003::RAsyncTestStepOmxILPcmRenderer0003Step02")); + RAsyncTestStepOmxILPcmRenderer0003* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0003Step02(); + return KErrNone; + } + +void +RAsyncTestStepOmxILPcmRenderer0003::DoRAsyncTestStepOmxILPcmRenderer0003Step02() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0003::DoRAsyncTestStepOmxILPcmRenderer0003Step02")); + + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateWaitForResources != compState) + { + return StopTest(KErrGeneral, EFail); + } + + // + // Move component to OMX_StateLoaded + // + + if (OMX_ErrorNone != ipCompHandle->SendCommand( + ipCompHandle, + OMX_CommandStateSet, + OMX_StateLoaded, + 0)) + { + return StopTest(KErrGeneral, EFail); + } + + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateLoaded != compState) + { return StopTest(KErrGeneral, EFail); + } + + // The successful termination... + ipKickoffStop->Call(); + + } + + +// +// RAsyncTestStepOmxILPcmRenderer0004 +// +RAsyncTestStepOmxILPcmRenderer0004::RAsyncTestStepOmxILPcmRenderer0004(const TDesC& aTestName, TInt aComponentUid) + : + RAsyncTestStepOmxILPcmRenderer0001(aTestName, aComponentUid) + + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0004::RAsyncTestStepOmxILPcmRenderer0004")); + } + + +void +RAsyncTestStepOmxILPcmRenderer0004::KickoffTestL() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0004::KickoffTestL")); + iTestState = EStateLoadKickoffTestLComplete; + + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test04 ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(AllocateBuffer-population) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Pause ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Pause->Idle ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Idle->Loaded(depopulation) ")); + + // This will install one callback + RAsyncTestStepOmxILComponentBase::KickoffTestL(); + + TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0004Step01, this); + delete ipKickoff01; + ipKickoff01 = NULL; + ipKickoff01 = + new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); + ipKickoff01->Call(); + + } + +void +RAsyncTestStepOmxILPcmRenderer0004::CloseTest() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0004::CloseTest")); + + delete ipKickoff01; // no need to Cancel + ipKickoff01 = NULL; + delete ipKickoff02; // no need to Cancel + ipKickoff02 = NULL; + delete ipKickoff03; // no need to Cancel + ipKickoff03 = NULL; + delete ipKickoff04; // no need to Cancel + ipKickoff04 = NULL; + delete ipKickoff05; // no need to Cancel + ipKickoff05 = NULL; + delete ipKickoff06; // no need to Cancel + ipKickoff06 = NULL; + + delete ipKickoffStop; // no need to Cancel + ipKickoffStop = 0; + + TInt count = ipClientClockPortBufferArray.Count(); + + for (TInt n = 0; n < count; n++) + { + delete ipClientClockPortBufferArray[n]; + } + + ipClientClockPortBufferArray.Close(); + + RAsyncTestStepOmxILComponentBase::CloseTest(); + + } + +void +RAsyncTestStepOmxILPcmRenderer0004::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/, + OMX_EVENTTYPE aEvent, + TUint aData1, + TUint aData2, + TAny* /*aExtra*/) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0004::DoEventHandlerL")); + + switch (aEvent) + { + case OMX_EventError: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_EventError [%d]"), aData1); + return StopTest(KErrGeneral, EFail); + } + case OMX_EventCmdComplete: + { + switch(aData1) + { + case OMX_CommandStateSet: + { + switch(aData2) + { + case OMX_StateLoaded: + { + if (EStateTransitionToIdleComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateLoaded [EStateTransitionToIdleComplete]")); + iTestState = EStateTransitionToLoadedComplete; + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateLoaded != compState) + { + return StopTest(KErrGeneral, EFail); + } + + // The successful termination... + TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this); + delete ipKickoffStop; + ipKickoffStop = NULL; + ipKickoffStop = + new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow); + ipKickoffStop->Call(); + } + } + break; + case OMX_StateIdle: + { + if (EStateLoadKickoffTestLComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateLoadKickoffTestLComplete]")); + iTestState = EStateTransitionToIdleComplete; + TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0004Step02, this); + delete ipKickoff02; + ipKickoff02 = NULL; + ipKickoff02 = + new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow); + ipKickoff02->Call(); + + } + else if (EStateTransitionToPauseComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateTransitionToPauseComplete]")); + iTestState = EStateTransitionToIdleComplete; + TCallBack callback04 (RAsyncTestStepOmxILPcmRenderer0004Step04, this); + delete ipKickoff04; + ipKickoff04 = NULL; + ipKickoff04 = + new (ELeave) CAsyncCallBack (callback04, CActive::EPriorityLow); + ipKickoff04->Call(); + + } + else + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [Other]")); + return StopTest(KErrGeneral, EFail); + } + } + break; + case OMX_StatePause: + { + if (EStateTransitionToIdleComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StatePause [EStateTransitionToIdleComplete]")); + iTestState = EStateTransitionToPauseComplete; + TCallBack callback03 (RAsyncTestStepOmxILPcmRenderer0004Step03, this); + delete ipKickoff03; + ipKickoff03 = NULL; + ipKickoff03 = + new (ELeave) CAsyncCallBack (callback03, CActive::EPriorityLow); + ipKickoff03->Call(); + } + else + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StatePause [Other]")); + return StopTest(KErrGeneral, EFail); + } + } + break; + default: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_State [%d]"), aData2); + return StopTest(KErrGeneral, EFail); + } + }; + } + break; + default: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_Command [%d]"), aData1); + return StopTest(KErrGeneral, EFail); + } + }; + } + break; + default: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX Event [%d]"), aEvent); + return StopTest(KErrGeneral, EFail); + } + }; + + } + + +TInt +RAsyncTestStepOmxILPcmRenderer0004::RAsyncTestStepOmxILPcmRenderer0004Step01(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0004::RAsyncTestStepOmxILPcmRenderer0004Step01")); + // NOTE, Here we reuse inherited code, to populate the component and make it go to OMX_StateIdle + RAsyncTestStepOmxILPcmRenderer0004* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0001Step01(); + return KErrNone; + } + +TInt +RAsyncTestStepOmxILPcmRenderer0004::RAsyncTestStepOmxILPcmRenderer0004Step02(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0004::RAsyncTestStepOmxILPcmRenderer0004Step02")); + RAsyncTestStepOmxILPcmRenderer0004* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0004Step02(); + return KErrNone; + } + +void +RAsyncTestStepOmxILPcmRenderer0004::DoRAsyncTestStepOmxILPcmRenderer0004Step02() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0004::DoRAsyncTestStepOmxILPcmRenderer0004Step02")); + + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateIdle != compState) + { + return StopTest(KErrGeneral, EFail); + } + + // + // Move component to OMX_StatePause + // + + if (OMX_ErrorNone != ipCompHandle->SendCommand( + ipCompHandle, + OMX_CommandStateSet, + OMX_StatePause, + 0)) + { + return StopTest(KErrGeneral, EFail); + } + + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StatePause != compState) + { + return StopTest(KErrGeneral, EFail); + } + + } + +TInt +RAsyncTestStepOmxILPcmRenderer0004::RAsyncTestStepOmxILPcmRenderer0004Step03(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0004::RAsyncTestStepOmxILPcmRenderer0004Step03")); + RAsyncTestStepOmxILPcmRenderer0004* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0004Step03(); + return KErrNone; + } + + +void +RAsyncTestStepOmxILPcmRenderer0004::DoRAsyncTestStepOmxILPcmRenderer0004Step03() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0004::DoRAsyncTestStepOmxILPcmRenderer0004Step03")); + + // + // Move component to OMX_StateIdle + // + + if (OMX_ErrorNone != ipCompHandle->SendCommand( + ipCompHandle, + OMX_CommandStateSet, + OMX_StateIdle, + 0)) + { + return StopTest(KErrGeneral, EFail); + } + + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateIdle != compState) + { + return StopTest(KErrGeneral, EFail); + } + + } + + +TInt +RAsyncTestStepOmxILPcmRenderer0004::RAsyncTestStepOmxILPcmRenderer0004Step04(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0004::RAsyncTestStepOmxILPcmRenderer0004Step04")); + // NOTE, Here we reuse inherited code, to depopulate the component and to + // make it go to OMX_StateLoaded + RAsyncTestStepOmxILPcmRenderer0004* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0001Step02(); + return KErrNone; + } + + +// +// RAsyncTestStepOmxILPcmRenderer0005 +// +RAsyncTestStepOmxILPcmRenderer0005::RAsyncTestStepOmxILPcmRenderer0005(const TDesC& aTestName, TInt aComponentUid) + : + RAsyncTestStepOmxILPcmRenderer0004(aTestName, aComponentUid) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0005::RAsyncTestStepOmxILPcmRenderer0005")); + } + + +void +RAsyncTestStepOmxILPcmRenderer0005::KickoffTestL() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0005::KickoffTestL")); + iTestState = EStateLoadKickoffTestLComplete; + + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test05 ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(AllocateBuffer-population) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Executing ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2a. - Call EmptyThisBuffer on PCM Renderer ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2b. - EmptyBufferDone callback received ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Executing->Idle(BufferFlushing) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Idle->Loaded(Depopulation) ")); + + // This will change the test file + iTestFileName.Set(KPcmRendererTestFile); + + // This will install one callback + RAsyncTestStepOmxILComponentBase::KickoffTestL(); + + TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0005Step01, this); + delete ipKickoff01; + ipKickoff01 = NULL; + ipKickoff01 = + new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); + ipKickoff01->Call(); + + } + +void +RAsyncTestStepOmxILPcmRenderer0005::CloseTest() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0005::CloseTest")); + + delete ipKickoff01; // no need to Cancel + ipKickoff01 = NULL; + delete ipKickoff02; // no need to Cancel + ipKickoff02 = NULL; + delete ipKickoff03; // no need to Cancel + ipKickoff03 = NULL; + delete ipKickoff04; // no need to Cancel + ipKickoff04 = NULL; + delete ipKickoff05; // no need to Cancel + ipKickoff05 = NULL; + delete ipKickoff06; // no need to Cancel + ipKickoff06 = NULL; + + delete ipKickoffStop; // no need to Cancel + ipKickoffStop = 0; + + TInt count = ipClientClockPortBufferArray.Count(); + + for (TInt n = 0; n < count; n++) + { + delete ipClientClockPortBufferArray[n]; + } + + ipClientClockPortBufferArray.Close(); + + RAsyncTestStepOmxILComponentBase::CloseTest(); + + } + +void +RAsyncTestStepOmxILPcmRenderer0005::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/, + OMX_EVENTTYPE aEvent, + TUint aData1, + TUint aData2, + TAny* /*aExtra*/) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0005::DoEventHandlerL")); + + switch (aEvent) + { + case OMX_EventError: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_EventError [%d]"), aData1); + return StopTest(KErrGeneral, EFail); + } + case OMX_EventCmdComplete: + { + switch(aData1) + { + case OMX_CommandStateSet: + { + switch(aData2) + { + case OMX_StateLoaded: + { + if (EStateTransitionToIdleComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateLoaded [EStateTransitionToIdleComplete]")); + iTestState = EStateTransitionToLoadedComplete; + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateLoaded != compState) + { + return StopTest(KErrGeneral, EFail); + } + + // The successful termination... + TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this); + delete ipKickoffStop; + ipKickoffStop = NULL; + ipKickoffStop = + new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow); + ipKickoffStop->Call(); + } + } + break; + case OMX_StateIdle: + { + if (EStateLoadKickoffTestLComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateLoadKickoffTestLComplete]")); + iTestState = EStateTransitionToIdleComplete; + TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0005Step02, this); + delete ipKickoff02; + ipKickoff02 = NULL; + ipKickoff02 = + new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow); + ipKickoff02->Call(); + + } + else if (EStateTransitionToExecutingComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateTransitionToPauseComplete]")); + iTestState = EStateTransitionToIdleComplete; + TCallBack callback04 (RAsyncTestStepOmxILPcmRenderer0005Step04, this); + delete ipKickoff04; + ipKickoff04 = NULL; + ipKickoff04 = + new (ELeave) CAsyncCallBack (callback04, CActive::EPriorityLow); + ipKickoff04->Call(); + + } + else + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [Other]")); + return StopTest(KErrGeneral, EFail); + } + } + break; + case OMX_StateExecuting: + { + if (EStateTransitionToIdleComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [EStateTransitionToIdleComplete]")); + iTestState = EStateTransitionToExecutingComplete; + CMMFDataBuffer& dataBuffer = *(static_cast(ipBufferHeaderInput->pInputPortPrivate)); + ipTestFile->ReadNextBuffer(dataBuffer); + ipBufferHeaderInput->nFilledLen = dataBuffer.BufferSize(); + + // Send a buffer to the input port + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [Send a buffer to the input port]")); + INFO_PRINTF2(_L("ipBufferHeaderInput->pBuffer [%X]"), ipBufferHeaderInput->pBuffer); + INFO_PRINTF2(_L("ipBufferHeaderInput->nAllocLen [%d]"), ipBufferHeaderInput->nAllocLen); + INFO_PRINTF2(_L("ipBufferHeaderInput->nFilledLen [%d]"), ipBufferHeaderInput->nFilledLen); + INFO_PRINTF2(_L("ipBufferHeaderInput->nOffset [%d]"), ipBufferHeaderInput->nOffset); + INFO_PRINTF2(_L("ipBufferHeaderInput->pAppPrivate [%X]"), ipBufferHeaderInput->pAppPrivate); + INFO_PRINTF2(_L("ipBufferHeaderInput->pPlatformPrivate [%X]"), ipBufferHeaderInput->pPlatformPrivate); + INFO_PRINTF2(_L("ipBufferHeaderInput->pInputPortPrivate [%X]"), ipBufferHeaderInput->pInputPortPrivate); + INFO_PRINTF2(_L("ipBufferHeaderInput->pOutputPortPrivate [%X]"), ipBufferHeaderInput->pOutputPortPrivate); + INFO_PRINTF2(_L("ipBufferHeaderInput->hMarkTargetComponent [%X]"), ipBufferHeaderInput->hMarkTargetComponent); + INFO_PRINTF2(_L("ipBufferHeaderInput->pMarkData [%X]"), ipBufferHeaderInput->pMarkData); + INFO_PRINTF2(_L("ipBufferHeaderInput->nTickCount [%d]"), ipBufferHeaderInput->nTickCount); + INFO_PRINTF2(_L("ipBufferHeaderInput->nFlags [%X]"), ipBufferHeaderInput->nFlags); + INFO_PRINTF2(_L("ipBufferHeaderInput->nOutputPortIndex [%X]"), ipBufferHeaderInput->nOutputPortIndex); + INFO_PRINTF2(_L("ipBufferHeaderInput->nInputPortIndex [%X]"), ipBufferHeaderInput->nInputPortIndex); + + if (OMX_ErrorNone != ipCompHandle->EmptyThisBuffer( + ipCompHandle, ipBufferHeaderInput)) + { + return StopTest(KErrGeneral, EFail); + } + } + else + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [Other]")); + return StopTest(KErrGeneral, EFail); + } + } + break; + default: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_State [%d]"), aData2); + return StopTest(KErrGeneral, EFail); + } + }; + } + break; + default: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_Command [%d]"), aData1); + return StopTest(KErrGeneral, EFail); + } + }; + } + break; + default: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX Event [%d]"), aEvent); + return StopTest(KErrGeneral, EFail); + } + }; + + } + +void +RAsyncTestStepOmxILPcmRenderer0005::DoEmptyBufferDoneL(OMX_HANDLETYPE /*aComponent*/, + OMX_BUFFERHEADERTYPE* /*aBuffer*/) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0005::DoEmptyBufferDoneL")); + + INFO_PRINTF1(_L("DoEmptyBufferDoneL : Callback received ")); + + TCallBack callback03 (RAsyncTestStepOmxILPcmRenderer0005Step03, this); + delete ipKickoff03; + ipKickoff03 = NULL; + ipKickoff03 = + new (ELeave) CAsyncCallBack (callback03, CActive::EPriorityLow); + ipKickoff03->Call(); + } + + +TInt +RAsyncTestStepOmxILPcmRenderer0005::RAsyncTestStepOmxILPcmRenderer0005Step01(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0005::RAsyncTestStepOmxILPcmRenderer0005Step01")); + // NOTE, Here we reuse inherited code, to populate the component and make it go to OMX_StateIdle + RAsyncTestStepOmxILPcmRenderer0005* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0001Step01(); + return KErrNone; + } + +TInt +RAsyncTestStepOmxILPcmRenderer0005::RAsyncTestStepOmxILPcmRenderer0005Step02(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0005::RAsyncTestStepOmxILPcmRenderer0005Step02")); + RAsyncTestStepOmxILPcmRenderer0005* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0005Step02(); + return KErrNone; + } + +void +RAsyncTestStepOmxILPcmRenderer0005::DoRAsyncTestStepOmxILPcmRenderer0005Step02() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0005::DoRAsyncTestStepOmxILPcmRenderer0005Step02")); + + // + // Move component to OMX_StateExecuting + // + + if (OMX_ErrorNone != ipCompHandle->SendCommand( + ipCompHandle, + OMX_CommandStateSet, + OMX_StateExecuting, + 0)) + { + return StopTest(KErrGeneral, EFail); + } + + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateExecuting != compState) + { + return StopTest(KErrGeneral, EFail); + } + + } + +TInt +RAsyncTestStepOmxILPcmRenderer0005::RAsyncTestStepOmxILPcmRenderer0005Step03(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0005::RAsyncTestStepOmxILPcmRenderer0005Step03")); + RAsyncTestStepOmxILPcmRenderer0005* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0004Step03(); + return KErrNone; + } + + +TInt +RAsyncTestStepOmxILPcmRenderer0005::RAsyncTestStepOmxILPcmRenderer0005Step04(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0005::RAsyncTestStepOmxILPcmRenderer0005Step04")); + // NOTE, Here we reuse inherited code, to depopulate the component and to + // make it go to OMX_StateLoaded + RAsyncTestStepOmxILPcmRenderer0005* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0001Step02(); + return KErrNone; + } + + + +// +// RAsyncTestStepOmxILPcmRenderer0006 +// +RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006(const TDesC& aTestName, TInt aComponentUid) + : + RAsyncTestStepOmxILPcmRenderer0005(aTestName, aComponentUid) + + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006")); + } + + +void +RAsyncTestStepOmxILPcmRenderer0006::KickoffTestL() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::KickoffTestL")); + iTestState = EStateLoadKickoffTestLComplete; + + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test06 ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(AllocateBuffer-population) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Executing ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Executing->Pause ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Pause->Executing ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 5.- Executing->Idle(BufferFlushing) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 6.- Idle->Loaded(depopulation) ")); + + // This will install one callback + RAsyncTestStepOmxILComponentBase::KickoffTestL(); + + TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0006Step01, this); + delete ipKickoff01; + ipKickoff01 = NULL; + ipKickoff01 = + new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); + ipKickoff01->Call(); + + } + +void +RAsyncTestStepOmxILPcmRenderer0006::CloseTest() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::CloseTest")); + + delete ipKickoff01; // no need to Cancel + ipKickoff01 = NULL; + delete ipKickoff02; // no need to Cancel + ipKickoff02 = NULL; + delete ipKickoff03; // no need to Cancel + ipKickoff03 = NULL; + delete ipKickoff04; // no need to Cancel + ipKickoff04 = NULL; + delete ipKickoff05; // no need to Cancel + ipKickoff05 = NULL; + delete ipKickoff06; // no need to Cancel + ipKickoff06 = NULL; + + delete ipKickoffStop; // no need to Cancel + ipKickoffStop = 0; + + TInt count = ipClientClockPortBufferArray.Count(); + + for (TInt n = 0; n < count; n++) + { + delete ipClientClockPortBufferArray[n]; + } + + ipClientClockPortBufferArray.Close(); + + RAsyncTestStepOmxILComponentBase::CloseTest(); + + } + + +void +RAsyncTestStepOmxILPcmRenderer0006::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/, + OMX_EVENTTYPE aEvent, + TUint aData1, + TUint aData2, + TAny* /*aExtra*/) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::DoEventHandlerL")); + + switch (aEvent) + { + case OMX_EventError: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_EventError [%d]"), aData1); + return StopTest(KErrGeneral, EFail); + } + case OMX_EventCmdComplete: + { + switch(aData1) + { + case OMX_CommandStateSet: + { + switch(aData2) + { + case OMX_StateLoaded: + { + if (EStateTransitionToIdleComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateLoaded [EStateTransitionToIdleComplete]")); + iTestState = EStateTransitionToLoadedComplete; + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateLoaded != compState) + { + return StopTest(KErrGeneral, EFail); + } + + // The successful termination... + TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this); + delete ipKickoffStop; + ipKickoffStop = NULL; + ipKickoffStop = + new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow); + ipKickoffStop->Call(); + } + } + break; + case OMX_StateIdle: + { + if (EStateLoadKickoffTestLComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateLoadKickoffTestLComplete]")); + iTestState = EStateTransitionToIdleComplete; + TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0006Step02, this); + delete ipKickoff02; + ipKickoff02 = NULL; + ipKickoff02 = + new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow); + ipKickoff02->Call(); + + } + else if (EStateTransitionToExecutingComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateTransitionToExecutingComplete]")); + iTestState = EStateTransitionToIdleComplete; + TCallBack callback06 (RAsyncTestStepOmxILPcmRenderer0006Step06, this); + delete ipKickoff06; + ipKickoff06 = NULL; + ipKickoff06 = + new (ELeave) CAsyncCallBack (callback06, CActive::EPriorityLow); + ipKickoff06->Call(); + + } + else + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [Other]")); + return StopTest(KErrGeneral, EFail); + } + } + break; + case OMX_StateExecuting: + { + if (EStateTransitionToIdleComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [EStateTransitionToIdleComplete]")); + iTestState = EStateTransitionToExecutingComplete; + TCallBack callback03 (RAsyncTestStepOmxILPcmRenderer0006Step03, this); + delete ipKickoff03; + ipKickoff03 = NULL; + ipKickoff03 = + new (ELeave) CAsyncCallBack (callback03, CActive::EPriorityLow); + ipKickoff03->Call(); + + } + else if (EStateTransitionToPauseComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [EStateTransitionToPauseComplete]")); + iTestState = EStateTransitionToExecutingComplete; + TCallBack callback05 (RAsyncTestStepOmxILPcmRenderer0006Step05, this); + delete ipKickoff05; + ipKickoff05 = NULL; + ipKickoff05 = + new (ELeave) CAsyncCallBack (callback05, CActive::EPriorityLow); + ipKickoff05->Call(); + + } + else + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_StateExecuting iTestState[%d]"), iTestState); + return StopTest(KErrGeneral, EFail); + } + } + break; + case OMX_StatePause: + { + if (EStateTransitionToExecutingComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StatePause [EStateTransitionToExecutingComplete]")); + iTestState = EStateTransitionToPauseComplete; + TCallBack callback04 (RAsyncTestStepOmxILPcmRenderer0006Step04, this); + delete ipKickoff04; + ipKickoff04 = NULL; + ipKickoff04 = + new (ELeave) CAsyncCallBack (callback04, CActive::EPriorityLow); + ipKickoff04->Call(); + } + else + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_StatePause iTestState[%d]"), iTestState); + return StopTest(KErrGeneral, EFail); + } + + } + break; + default: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_State [%d]"), aData2); + return StopTest(KErrGeneral, EFail); + } + }; + } + break; + default: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_Command [%d]"), aData1); + return StopTest(KErrGeneral, EFail); + } + }; + } + break; + default: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX Event [%d]"), aEvent); + return StopTest(KErrGeneral, EFail); + } + }; + + } + + +TInt +RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step01(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step01")); + // NOTE, Here we reuse inherited code, to populate the component and make it go to OMX_StateIdle + RAsyncTestStepOmxILPcmRenderer0006* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0001Step01(); + return KErrNone; + } + +TInt +RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step02(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step02")); + RAsyncTestStepOmxILPcmRenderer0006* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0005Step02(); + return KErrNone; + } + +TInt +RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step03(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step03")); + RAsyncTestStepOmxILPcmRenderer0006* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0006Step03(); + return KErrNone; + } + +void +RAsyncTestStepOmxILPcmRenderer0006::DoRAsyncTestStepOmxILPcmRenderer0006Step03() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::DoRAsyncTestStepOmxILPcmRenderer0006Step03")); + + // + // Move component to OMX_StatePause + // + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->SendCommand( + ipCompHandle, + OMX_CommandStateSet, + OMX_StatePause, + 0)) + { + return StopTest(KErrGeneral, EFail); + } + + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StatePause != compState) + { + return StopTest(KErrGeneral, EFail); + } + + } + + +TInt +RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step04(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step04")); + // NOTE, Here we reuse inherited code, to make it go to OMX_StateIdle + RAsyncTestStepOmxILPcmRenderer0006* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0005Step02(); + return KErrNone; + } + +TInt +RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step05(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step05")); + // NOTE, Here we reuse inherited code, to make it go to OMX_StateIdle + RAsyncTestStepOmxILPcmRenderer0006* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0004Step03(); + return KErrNone; + } + +TInt +RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step06(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step06")); + // NOTE, Here we reuse inherited code, to make it go to OMX_StateLoaded + RAsyncTestStepOmxILPcmRenderer0006* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0001Step02(); + return KErrNone; + } + + +// +// RAsyncTestStepOmxILPcmRenderer0007 +// +RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007(const TDesC& aTestName, TInt aComponentUid) + : + RAsyncTestStepOmxILPcmRenderer0006(aTestName, aComponentUid) + + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007")); + } + + +void +RAsyncTestStepOmxILPcmRenderer0007::KickoffTestL() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0007::KickoffTestL")); + iTestState = EStateLoadKickoffTestLComplete; + + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test07 ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(AllocateBuffer-population) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Executing ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Executing->Pause ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Pause->Idle(BufferFlushing)")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 5.- Idle->Loaded(depopulation) ")); + + // This will install one callback + RAsyncTestStepOmxILComponentBase::KickoffTestL(); + + TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0007Step01, this); + delete ipKickoff01; + ipKickoff01 = NULL; + ipKickoff01 = + new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); + ipKickoff01->Call(); + + } + +void +RAsyncTestStepOmxILPcmRenderer0007::CloseTest() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0007::CloseTest")); + + delete ipKickoff01; // no need to Cancel + ipKickoff01 = NULL; + delete ipKickoff02; // no need to Cancel + ipKickoff02 = NULL; + delete ipKickoff03; // no need to Cancel + ipKickoff03 = NULL; + delete ipKickoff04; // no need to Cancel + ipKickoff04 = NULL; + delete ipKickoff05; // no need to Cancel + ipKickoff05 = NULL; + delete ipKickoff06; // no need to Cancel + ipKickoff06 = NULL; + + delete ipKickoffStop; // no need to Cancel + ipKickoffStop = 0; + + TInt count = ipClientClockPortBufferArray.Count(); + + for (TInt n = 0; n < count; n++) + { + delete ipClientClockPortBufferArray[n]; + } + + ipClientClockPortBufferArray.Close(); + + RAsyncTestStepOmxILComponentBase::CloseTest(); + + } + + +void +RAsyncTestStepOmxILPcmRenderer0007::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/, + OMX_EVENTTYPE aEvent, + TUint aData1, + TUint aData2, + TAny* /*aExtra*/) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0007::DoEventHandlerL")); + + switch (aEvent) + { + case OMX_EventError: + { + // Ignore underflow errors... + if (OMX_ErrorUnderflow == aData1) + { + INFO_PRINTF1(_L("DoEventHandlerL: [OMX_ErrorUnderflow]")); + } + else + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_EventError [%x]"), aData1); + return StopTest(KErrGeneral, EFail); + } + } + break; + + case OMX_EventCmdComplete: + { + switch(aData1) + { + case OMX_CommandStateSet: + { + switch(aData2) + { + case OMX_StateLoaded: + { + if (EStateTransitionToIdleComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateLoaded [EStateTransitionToIdleComplete]")); + iTestState = EStateTransitionToLoadedComplete; + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateLoaded != compState) + { + return StopTest(KErrGeneral, EFail); + } + + // The successful termination... + TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this); + delete ipKickoffStop; + ipKickoffStop = NULL; + ipKickoffStop = + new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow); + ipKickoffStop->Call(); + } + } + break; + case OMX_StateIdle: + { + if (EStateLoadKickoffTestLComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateLoadKickoffTestLComplete]")); + iTestState = EStateTransitionToIdleComplete; + TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0007Step02, this); + delete ipKickoff02; + ipKickoff02 = NULL; + ipKickoff02 = + new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow); + ipKickoff02->Call(); + + } + else if (EStateTransitionToPauseComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateTransitionToPauseComplete]")); + iTestState = EStateTransitionToIdleComplete; + TCallBack callback05 (RAsyncTestStepOmxILPcmRenderer0007Step05, this); + delete ipKickoff05; + ipKickoff05 = NULL; + ipKickoff05 = + new (ELeave) CAsyncCallBack (callback05, CActive::EPriorityLow); + ipKickoff05->Call(); + + } + else + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [Other]")); + return StopTest(KErrGeneral, EFail); + } + } + break; + case OMX_StateExecuting: + { + if (EStateTransitionToIdleComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [EStateTransitionToIdleComplete]")); + iTestState = EStateTransitionToExecutingComplete; + TCallBack callback03 (RAsyncTestStepOmxILPcmRenderer0007Step03, this); + delete ipKickoff03; + ipKickoff03 = NULL; + ipKickoff03 = + new (ELeave) CAsyncCallBack (callback03, CActive::EPriorityLow); + ipKickoff03->Call(); + + } + else + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_StateExecuting iTestState[%d]"), iTestState); + return StopTest(KErrGeneral, EFail); + } + } + break; + case OMX_StatePause: + { + if (EStateTransitionToExecutingComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StatePause [EStateTransitionToExecutingComplete]")); + iTestState = EStateTransitionToPauseComplete; + TCallBack callback04 (RAsyncTestStepOmxILPcmRenderer0007Step04, this); + delete ipKickoff04; + ipKickoff04 = NULL; + ipKickoff04 = + new (ELeave) CAsyncCallBack (callback04, CActive::EPriorityLow); + ipKickoff04->Call(); + } + else + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_StatePause iTestState[%d]"), iTestState); + return StopTest(KErrGeneral, EFail); + } + + } + break; + default: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_State [%d]"), aData2); + return StopTest(KErrGeneral, EFail); + } + }; + } + break; + default: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_Command [%d]"), aData1); + return StopTest(KErrGeneral, EFail); + } + }; + } + break; + default: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX Event [%d]"), aEvent); + return StopTest(KErrGeneral, EFail); + } + }; + + } + + +TInt +RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007Step01(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007Step01")); + // NOTE, Here we reuse inherited code, to populate the component and make it go to OMX_StateIdle + RAsyncTestStepOmxILPcmRenderer0007* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0001Step01(); + return KErrNone; + } + +TInt +RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007Step02(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007Step02")); + RAsyncTestStepOmxILPcmRenderer0007* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0005Step02(); + return KErrNone; + } + +TInt +RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007Step03(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007Step03")); + RAsyncTestStepOmxILPcmRenderer0007* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0006Step03(); + return KErrNone; + } + +TInt +RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007Step04(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007Step04")); + // NOTE, Here we reuse inherited code, to make it go to OMX_StateIdle + RAsyncTestStepOmxILPcmRenderer0007* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0004Step03(); + return KErrNone; + } + +TInt +RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007Step05(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007Step05")); + // NOTE, Here we reuse inherited code, to make it go to OMX_StateIdle + RAsyncTestStepOmxILPcmRenderer0007* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0001Step02(); + return KErrNone; + } + +// +// RAsyncTestStepOmxILPcmRenderer0008 +// +RAsyncTestStepOmxILPcmRenderer0008::RAsyncTestStepOmxILPcmRenderer0008(const TDesC& aTestName, TInt aComponentUid) + : + RAsyncTestStepOmxILPcmRenderer0005(aTestName, aComponentUid) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0008::RAsyncTestStepOmxILPcmRenderer0008")); + } + + +void +RAsyncTestStepOmxILPcmRenderer0008::KickoffTestL() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0008::KickoffTestL")); + iTestState = EStateLoadKickoffTestLComplete; + + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test08 ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(AllocateBuffer-population) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Executing ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Repeat these two steps until the whole file has beeen empited ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2a. - Call EmptyThisBuffer on PCM Renderer ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2b. - EmptyBufferDone callback received ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Executing->Idle(BufferFlushing) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Idle->Loaded(Depopulation) ")); + + // This will change the test file + iTestFileName.Set(KPcmRendererTestFile); + + // This will install one callback + RAsyncTestStepOmxILComponentBase::KickoffTestL(); + + TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0005Step01, this); + delete ipKickoff01; + ipKickoff01 = NULL; + ipKickoff01 = + new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); + ipKickoff01->Call(); + } + +void +RAsyncTestStepOmxILPcmRenderer0008::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/, + OMX_EVENTTYPE aEvent, + TUint aData1, + TUint aData2, + TAny* /*aExtra*/) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0008::DoEventHandlerL")); + + switch (aEvent) + { + case OMX_EventError: + { + // Ignore underflow errors... + if (OMX_ErrorUnderflow == aData1) + { + INFO_PRINTF1(_L("DoEventHandlerL: [OMX_ErrorUnderflow]")); + } + else + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_EventError [%x]"), aData1); + return StopTest(KErrGeneral, EFail); + } + } + break; + + case OMX_EventCmdComplete: + { + switch(aData1) + { + case OMX_CommandStateSet: + { + switch(aData2) + { + case OMX_StateLoaded: + { + if (EStateTransitionToIdleComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateLoaded [EStateTransitionToIdleComplete]")); + iTestState = EStateTransitionToLoadedComplete; + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateLoaded != compState) + { + return StopTest(KErrGeneral, EFail); + } + + // The successful termination... + TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this); + delete ipKickoffStop; + ipKickoffStop = NULL; + ipKickoffStop = + new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow); + ipKickoffStop->Call(); + } + } + break; + case OMX_StateIdle: + { + if (EStateLoadKickoffTestLComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateLoadKickoffTestLComplete]")); + iTestState = EStateTransitionToIdleComplete; + TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0005Step02, this); + delete ipKickoff02; + ipKickoff02 = NULL; + ipKickoff02 = + new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow); + ipKickoff02->Call(); + + } + else if (EStateTransitionToExecutingComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateTransitionToPauseComplete]")); + iTestState = EStateTransitionToIdleComplete; + TCallBack callback04 (RAsyncTestStepOmxILPcmRenderer0005Step04, this); + delete ipKickoff04; + ipKickoff04 = NULL; + ipKickoff04 = + new (ELeave) CAsyncCallBack (callback04, CActive::EPriorityLow); + ipKickoff04->Call(); + + } + else + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [Other]")); + return StopTest(KErrGeneral, EFail); + } + } + break; + case OMX_StateExecuting: + { + if (EStateTransitionToIdleComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [EStateTransitionToIdleComplete]")); + iTestState = EStateTransitionToExecutingComplete; + + CMMFDataBuffer& dataBuffer = *(static_cast(ipBufferHeaderInput->pInputPortPrivate)); + ipTestFile->ReadNextBuffer(dataBuffer); + + // Send a buffer to the input port + ipBufferHeaderInput->nFilledLen = dataBuffer.BufferSize(); + + if (OMX_ErrorNone != ipCompHandle->EmptyThisBuffer( + ipCompHandle, ipBufferHeaderInput)) + { + StopTest(KErrGeneral, EFail); + } + } + else + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [Other]")); + return StopTest(KErrGeneral, EFail); + } + } + break; + default: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_State [%d]"), aData2); + return StopTest(KErrGeneral, EFail); + } + }; + } + break; + default: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_Command [%d]"), aData1); + return StopTest(KErrGeneral, EFail); + } + }; + } + break; + default: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX Event [%d]"), aEvent); + return StopTest(KErrGeneral, EFail); + } + }; + + } + +void +RAsyncTestStepOmxILPcmRenderer0008::DoEmptyBufferDoneL(OMX_HANDLETYPE /*aComponent*/, + OMX_BUFFERHEADERTYPE* /*aBuffer*/) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0008::DoEmptyBufferDoneL")); + INFO_PRINTF1(_L("DoEmptyBufferDoneL : Callback received ")); + + CMMFDataBuffer& dataBuffer = *(static_cast(ipBufferHeaderInput->pInputPortPrivate)); + ipTestFile->ReadNextBuffer(dataBuffer); + + if (dataBuffer.BufferSize() > 0) + { + // Send a buffer to the input port + ipBufferHeaderInput->nFilledLen = dataBuffer.BufferSize(); + + if (OMX_ErrorNone != ipCompHandle->EmptyThisBuffer( + ipCompHandle, ipBufferHeaderInput)) + { + StopTest(KErrGeneral, EFail); + } + } + else + { + TCallBack callback03 (RAsyncTestStepOmxILPcmRenderer0005Step03, this); + delete ipKickoff03; + ipKickoff03 = NULL; + ipKickoff03 = + new (ELeave) CAsyncCallBack (callback03, CActive::EPriorityLow); + ipKickoff03->Call(); + } + } + +// +// RAsyncTestStepOmxILPcmRenderer0009 +// +RAsyncTestStepOmxILPcmRenderer0009::RAsyncTestStepOmxILPcmRenderer0009(const TDesC& aTestName, TInt aComponentUid) + : + RAsyncTestStepOmxILPcmRenderer0008(aTestName, aComponentUid) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0009::RAsyncTestStepOmxILPcmRenderer0009")); + iSamplingRate = 44100; + } + + +void +RAsyncTestStepOmxILPcmRenderer0009::KickoffTestL() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0009::KickoffTestL")); + iTestState = EStateLoadKickoffTestLComplete; + + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test09 ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(AllocateBuffer-population) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Executing ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Repeat these two steps until the whole file has beeen empited ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2a. - Call EmptyThisBuffer on PCM Renderer ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2b. - EmptyBufferDone callback received ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Executing->Pause and Pause->Executing (after 5 and again after 10 buffers played) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Executing->Idle(BufferFlushing) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 5.- Idle->Loaded(Depopulation) ")); + + // This will change the test file + iTestFileName.Set(KPcmRendererTestFile2); + + // This will install one callback + RAsyncTestStepOmxILComponentBase::KickoffTestL(); + + TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0005Step01, this); + delete ipKickoff01; + ipKickoff01 = NULL; + ipKickoff01 = + new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); + ipKickoff01->Call(); + } + +void +RAsyncTestStepOmxILPcmRenderer0009::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/, + OMX_EVENTTYPE aEvent, + TUint aData1, + TUint aData2, + TAny* /*aExtra*/) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0009::DoEventHandlerL")); + + switch (aEvent) + { + case OMX_EventError: + { + // Ignore underflow errors... + if (OMX_ErrorUnderflow == aData1) + { + INFO_PRINTF1(_L("DoEventHandlerL: [OMX_ErrorUnderflow]")); + } + else + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_EventError [%x]"), aData1); + return StopTest(KErrGeneral, EFail); + } + } + break; + + case OMX_EventCmdComplete: + { + switch(aData1) + { + case OMX_CommandStateSet: + { + switch(aData2) + { + case OMX_StateLoaded: + { + if (EStateTransitionToIdleComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateLoaded [EStateTransitionToIdleComplete]")); + iTestState = EStateTransitionToLoadedComplete; + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateLoaded != compState) + { + return StopTest(KErrGeneral, EFail); + } + + // The successful termination... + TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this); + delete ipKickoffStop; + ipKickoffStop = NULL; + ipKickoffStop = + new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow); + ipKickoffStop->Call(); + } + } + break; + case OMX_StateIdle: + { + if (EStateLoadKickoffTestLComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateLoadKickoffTestLComplete]")); + iTestState = EStateTransitionToIdleComplete; + TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0005Step02, this); + delete ipKickoff02; + ipKickoff02 = NULL; + ipKickoff02 = + new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow); + ipKickoff02->Call(); + + } + else if (EStateTransitionToExecutingComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateTransitionToPauseComplete]")); + iTestState = EStateTransitionToIdleComplete; + TCallBack callback04 (RAsyncTestStepOmxILPcmRenderer0005Step04, this); + delete ipKickoff04; + ipKickoff04 = NULL; + ipKickoff04 = + new (ELeave) CAsyncCallBack (callback04, CActive::EPriorityLow); + ipKickoff04->Call(); + + } + else + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [Other]")); + return StopTest(KErrGeneral, EFail); + } + } + break; + case OMX_StateExecuting: + { + if (EStateTransitionToIdleComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [EStateTransitionToIdleComplete]")); + iTestState = EStateTransitionToExecutingComplete; + + CMMFDataBuffer& dataBuffer = *(static_cast(ipBufferHeaderInput->pInputPortPrivate)); + ipTestFile->ReadNextBuffer(dataBuffer); + + // Send a buffer to the input port + ipBufferHeaderInput->nFilledLen = dataBuffer.BufferSize(); + + if (OMX_ErrorNone != ipCompHandle->EmptyThisBuffer( + ipCompHandle, ipBufferHeaderInput)) + { + StopTest(KErrGeneral, EFail); + } + } + else if (EStateTransitionToPauseComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [EStateTransitionToIdleComplete]")); + iTestState = EStateTransitionToExecutingComplete; + } + else + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [Other]")); + return StopTest(KErrGeneral, EFail); + } + } + break; + case OMX_StatePause: + { + if (EStateTransitionToExecutingComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StatePause [EStateTransitionToExecutingComplete]")); + iTestState = EStateTransitionToPauseComplete; + + // Wait for a second... + User::After(1000000); + + // Resume playing... + TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0005Step02, this); + delete ipKickoff02; + ipKickoff02 = NULL; + ipKickoff02 = + new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow); + ipKickoff02->Call(); + } + else + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_StatePause iTestState[%d]"), iTestState); + return StopTest(KErrGeneral, EFail); + } + + } + break; + default: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_State [%d]"), aData2); + return StopTest(KErrGeneral, EFail); + } + }; + } + break; + default: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_Command [%d]"), aData1); + return StopTest(KErrGeneral, EFail); + } + }; + } + break; + default: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX Event [%d]"), aEvent); + return StopTest(KErrGeneral, EFail); + } + }; + + } + +void +RAsyncTestStepOmxILPcmRenderer0009::DoEmptyBufferDoneL(OMX_HANDLETYPE /*aComponent*/, + OMX_BUFFERHEADERTYPE* /*aBuffer*/) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0009::DoEmptyBufferDoneL")); + INFO_PRINTF1(_L("DoEmptyBufferDoneL : Callback received ")); + + iNumOfEmptiedBuffers++; + if (iNumOfEmptiedBuffers == 5 || iNumOfEmptiedBuffers == 10) + { + // + // Move component to OMX_StatePause + // + if (OMX_ErrorNone != ipCompHandle->SendCommand( + ipCompHandle, + OMX_CommandStateSet, + OMX_StatePause, + 0)) + { + return StopTest(KErrGeneral, EFail); + } + + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + if (OMX_StatePause != compState) + { + return StopTest(KErrGeneral, EFail); + } + } + + CMMFDataBuffer& dataBuffer = *(static_cast(ipBufferHeaderInput->pInputPortPrivate)); + ipTestFile->ReadNextBuffer(dataBuffer); + + if (dataBuffer.BufferSize() > 0) + { + // Send a buffer to the input port + ipBufferHeaderInput->nFilledLen = dataBuffer.BufferSize(); + + if (OMX_ErrorNone != ipCompHandle->EmptyThisBuffer( + ipCompHandle, ipBufferHeaderInput)) + { + StopTest(KErrGeneral, EFail); + } + } + else + { + TCallBack callback03 (RAsyncTestStepOmxILPcmRenderer0005Step03, this); + delete ipKickoff03; + ipKickoff03 = NULL; + ipKickoff03 = + new (ELeave) CAsyncCallBack (callback03, CActive::EPriorityLow); + ipKickoff03->Call(); + } + } + +// +// RAsyncTestStepOmxILPcmRenderer0010 +// +RAsyncTestStepOmxILPcmRenderer0010::RAsyncTestStepOmxILPcmRenderer0010(const TDesC& aTestName, TInt aComponentUid) + : + RAsyncTestStepOmxILPcmRenderer0008(aTestName, aComponentUid) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0010::RAsyncTestStepOmxILPcmRenderer0010")); + iSamplingRate = 44100; + } + + +void +RAsyncTestStepOmxILPcmRenderer0010::KickoffTestL() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0010::KickoffTestL")); + iTestState = EStateLoadKickoffTestLComplete; + + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test10 ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(AllocateBuffer-population) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Executing ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Repeat these two steps until the whole file has beeen empited ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2a. - Call EmptyThisBuffer on PCM Renderer ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2b. - EmptyBufferDone callback received ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Executing->Idle and Idle->Executing (after 5 and again after 10 buffers played) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Executing->Idle(BufferFlushing) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 5.- Idle->Loaded(Depopulation) ")); + + // This will change the test file + iTestFileName.Set(KPcmRendererTestFile2); + + // This will install one callback + RAsyncTestStepOmxILComponentBase::KickoffTestL(); + + TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0005Step01, this); + delete ipKickoff01; + ipKickoff01 = NULL; + ipKickoff01 = + new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); + ipKickoff01->Call(); + } + +void +RAsyncTestStepOmxILPcmRenderer0010::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/, + OMX_EVENTTYPE aEvent, + TUint aData1, + TUint aData2, + TAny* /*aExtra*/) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0010::DoEventHandlerL")); + + switch (aEvent) + { + case OMX_EventError: + { + // Ignore underflow errors... + if (OMX_ErrorUnderflow == aData1) + { + INFO_PRINTF1(_L("DoEventHandlerL: [OMX_ErrorUnderflow]")); + } + else + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_EventError [%x]"), aData1); + return StopTest(KErrGeneral, EFail); + } + } + break; + + case OMX_EventCmdComplete: + { + switch(aData1) + { + case OMX_CommandStateSet: + { + switch(aData2) + { + case OMX_StateLoaded: + { + if (EStateTransitionToIdleComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateLoaded [EStateTransitionToIdleComplete]")); + iTestState = EStateTransitionToLoadedComplete; + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateLoaded != compState) + { + return StopTest(KErrGeneral, EFail); + } + + // The successful termination... + TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this); + delete ipKickoffStop; + ipKickoffStop = NULL; + ipKickoffStop = + new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow); + ipKickoffStop->Call(); + } + } + break; + case OMX_StateIdle: + { + if (EStateLoadKickoffTestLComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateLoadKickoffTestLComplete]")); + iTestState = EStateTransitionToIdleComplete; + TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0005Step02, this); + delete ipKickoff02; + ipKickoff02 = NULL; + ipKickoff02 = + new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow); + ipKickoff02->Call(); + + } + else if (EStateTransitionToExecutingComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateTransitionToExecutingComplete]")); + iTestState = EStateTransitionToIdleComplete; + + if(iNumOfEmptiedBuffers <= 20) + { + // Wait for a second... + User::After(1000000); + + // Resume playing... + TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0005Step02, this); + delete ipKickoff02; + ipKickoff02 = NULL; + ipKickoff02 = + new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow); + ipKickoff02->Call(); + } + else + { + // Playback finished + TCallBack callback04 (RAsyncTestStepOmxILPcmRenderer0005Step04, this); + delete ipKickoff04; + ipKickoff04 = NULL; + ipKickoff04 = + new (ELeave) CAsyncCallBack (callback04, CActive::EPriorityLow); + ipKickoff04->Call(); + } + } + else + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [Other]")); + return StopTest(KErrGeneral, EFail); + } + } + break; + case OMX_StateExecuting: + { + if (EStateTransitionToIdleComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [EStateTransitionToIdleComplete]")); + iTestState = EStateTransitionToExecutingComplete; + + CMMFDataBuffer& dataBuffer = *(static_cast(ipBufferHeaderInput->pInputPortPrivate)); + ipTestFile->ReadNextBuffer(dataBuffer); + + // Send a buffer to the input port + ipBufferHeaderInput->nFilledLen = dataBuffer.BufferSize(); + + if (OMX_ErrorNone != ipCompHandle->EmptyThisBuffer( + ipCompHandle, ipBufferHeaderInput)) + { + StopTest(KErrGeneral, EFail); + } + } + else if (EStateTransitionToPauseComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [EStateTransitionToIdleComplete]")); + iTestState = EStateTransitionToExecutingComplete; + } + else + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [Other]")); + return StopTest(KErrGeneral, EFail); + } + } + break; + default: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_State [%d]"), aData2); + return StopTest(KErrGeneral, EFail); + } + }; + } + break; + default: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_Command [%d]"), aData1); + return StopTest(KErrGeneral, EFail); + } + }; + } + break; + default: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX Event [%d]"), aEvent); + return StopTest(KErrGeneral, EFail); + } + }; + + } + +void +RAsyncTestStepOmxILPcmRenderer0010::DoEmptyBufferDoneL(OMX_HANDLETYPE /*aComponent*/, + OMX_BUFFERHEADERTYPE* /*aBuffer*/) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0010::DoEmptyBufferDoneL")); + INFO_PRINTF1(_L("DoEmptyBufferDoneL : Callback received ")); + + iNumOfEmptiedBuffers++; + if (iNumOfEmptiedBuffers == 5 || iNumOfEmptiedBuffers == 10) + { + // + // Move component to OMX_StateIdle + // + + if (OMX_ErrorNone != ipCompHandle->SendCommand( + ipCompHandle, + OMX_CommandStateSet, + OMX_StateIdle, + 0)) + { + return StopTest(KErrGeneral, EFail); + } + + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateIdle != compState) + { + return StopTest(KErrGeneral, EFail); + } + + // Reset the file position + ipTestFile->ResetPos(); + } + else + { + CMMFDataBuffer& dataBuffer = *(static_cast(ipBufferHeaderInput->pInputPortPrivate)); + ipTestFile->ReadNextBuffer(dataBuffer); + + if (dataBuffer.BufferSize() > 0) + { + // Send a buffer to the input port + ipBufferHeaderInput->nFilledLen = dataBuffer.BufferSize(); + + if (OMX_ErrorNone != ipCompHandle->EmptyThisBuffer( + ipCompHandle, ipBufferHeaderInput)) + { + StopTest(KErrGeneral, EFail); + } + } + else + { + TCallBack callback03 (RAsyncTestStepOmxILPcmRenderer0005Step03, this); + delete ipKickoff03; + ipKickoff03 = NULL; + ipKickoff03 = + new (ELeave) CAsyncCallBack (callback03, CActive::EPriorityLow); + ipKickoff03->Call(); + } + } + } + +TInt +RAsyncTestStepOmxILPcmRenderer0010::RAsyncTestStepOmxILPcmRenderer0010Step01(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0010::RAsyncTestStepOmxILPcmRenderer0010Step01")); + RAsyncTestStepOmxILPcmRenderer0010* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0010Step01(); + return KErrNone; + } + +void +RAsyncTestStepOmxILPcmRenderer0010::DoRAsyncTestStepOmxILPcmRenderer0010Step01() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0010::DoRAsyncTestStepOmxILPcmRenderer0010Step01")); + + // + // Provide callbacks to component + // + OMX_CALLBACKTYPE* omxCallbacks = *ipCallbackHandler; + + if (OMX_ErrorNone != ipCompHandle->SetCallbacks( + ipCompHandle, + omxCallbacks, + ipCallbackHandler)) + { + return StopTest(KErrGeneral, EFail); + } + + INFO_PRINTF2(_L("Component Callbacks set successfully: %X"), ipCallbackHandler); + + // + // Obtain the port def params for Port #0 + // + OMX_PARAM_PORTDEFINITIONTYPE portParamsInputPort; + portParamsInputPort.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE); + portParamsInputPort.nVersion = TOmxILSpecVersion(); + portParamsInputPort.nPortIndex = 0; + if (OMX_ErrorNone != ipCompHandle->GetParameter( + ipCompHandle, + OMX_IndexParamPortDefinition, + &portParamsInputPort)) + { + return StopTest(KErrGeneral, EFail); + } + + // + // Change the sampling rate on PCM Renderer's port #0 + // + OMX_AUDIO_PARAM_PCMMODETYPE pcmMode; + pcmMode.nSize = sizeof(OMX_AUDIO_PARAM_PCMMODETYPE); + pcmMode.nVersion = TOmxILSpecVersion(); + pcmMode.nPortIndex = 0; + if (OMX_ErrorNone != ipCompHandle->GetParameter( + ipCompHandle, + OMX_IndexParamAudioPcm, + &pcmMode)) + { + return StopTest(KErrGeneral, EFail); + } + pcmMode.nSamplingRate = 44100; + if (OMX_ErrorNone != ipCompHandle->SetParameter( + ipCompHandle, + OMX_IndexParamAudioPcm, + &pcmMode)) + { + return StopTest(KErrGeneral, EFail); + } + + // + // Move component to OMX_StateIdle + // + + if (OMX_ErrorNone != ipCompHandle->SendCommand( + ipCompHandle, + OMX_CommandStateSet, + OMX_StateIdle, + 0)) + { + return StopTest(KErrGeneral, EFail); + } + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Moving component to OMX_StateIdle")); + + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateLoaded != compState) + { + return StopTest(KErrGeneral, EFail); + } + + + // + // Allocate buffer on input port + // + if (OMX_ErrorNone != ipCompHandle->AllocateBuffer( + ipCompHandle, + &ipBufferHeaderInput, + 0, // input port + 0, + portParamsInputPort.nBufferSize)) + { + return StopTest(KErrGeneral, EFail); + } + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Populated buffer (AllocateBuffer) in INPUT port")); + } + + +// +// RAsyncTestStepOmxILPcmRenderer0030 +// +RAsyncTestStepOmxILPcmRenderer0030::RAsyncTestStepOmxILPcmRenderer0030(const TDesC& aTestName, TInt aComponentUid) + : + RAsyncTestStepOmxILPcmRenderer0008(aTestName, aComponentUid) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0030::RAsyncTestStepOmxILPcmRenderer0030")); + } + + +void +RAsyncTestStepOmxILPcmRenderer0030::KickoffTestL() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0030::KickoffTestL")); + iTestState = EStateLoadKickoffTestLComplete; + + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test30 ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(AllocateBuffer-population) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Executing ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Repeat these two steps until the whole file has beeen empited ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2a. - Call EmptyThisBuffer on PCM Renderer ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2b. - EmptyBufferDone callback received ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2c. - Get Bytes Played parameter and compare with the bytes readed from file ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Executing->Idle(BufferFlushing) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Idle->Loaded(Depopulation) ")); + + // This will change the test file + iTestFileName.Set(KPcmRendererTestFile); + + // This will install one callback + RAsyncTestStepOmxILComponentBase::KickoffTestL(); + + TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0005Step01, this); + delete ipKickoff01; + ipKickoff01 = NULL; + ipKickoff01 = + new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); + ipKickoff01->Call(); + } + +void +RAsyncTestStepOmxILPcmRenderer0030::DoEmptyBufferDoneL(OMX_HANDLETYPE /*aComponent*/, + OMX_BUFFERHEADERTYPE* aBuffer) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0030::DoEmptyBufferDoneL")); + INFO_PRINTF1(_L("DoEmptyBufferDoneL : Callback received ")); + + // Check that GetConfig is returning the correct amount of bytes played + OMX_SYMBIAN_AUDIO_CONFIG_PCM_BYTESPLAYED bytesPlayedStruct; + bytesPlayedStruct.nSize = sizeof(OMX_SYMBIAN_AUDIO_CONFIG_PCM_BYTESPLAYED); + bytesPlayedStruct.nVersion = TOmxILSpecVersion(); + if (OMX_ErrorNone != ipCompHandle->GetConfig(ipCompHandle, + static_cast(OMX_SymbianIndexConfigAudioBytesPlayed), + &bytesPlayedStruct)) + { + StopTest(KErrGeneral, EFail); + } + //check the number of bytes played by the device corresponds + //to the number of bytes readed from file + //allow an extra margin of one buffer. + TUint minAllowedBytesPlayed = ipTestFile->GetPos() - aBuffer->nAllocLen; + TUint maxAllowedBytesPlayed =ipTestFile->GetPos(); + if ((bytesPlayedStruct.nBytesPlayed < minAllowedBytesPlayed)||(bytesPlayedStruct.nBytesPlayed > maxAllowedBytesPlayed)) + { + StopTest(KErrGeneral, EFail); + } + + CMMFDataBuffer& dataBuffer = *(static_cast(ipBufferHeaderInput->pInputPortPrivate)); + ipTestFile->ReadNextBuffer(dataBuffer); + + if (dataBuffer.BufferSize() > 0) + { + // Send a buffer to the input port + ipBufferHeaderInput->nFilledLen = dataBuffer.BufferSize(); + + if (OMX_ErrorNone != ipCompHandle->EmptyThisBuffer( + ipCompHandle, ipBufferHeaderInput)) + { + StopTest(KErrGeneral, EFail); + } + } + else + { + TCallBack callback03 (RAsyncTestStepOmxILPcmRenderer0005Step03, this); + delete ipKickoff03; + ipKickoff03 = NULL; + ipKickoff03 = + new (ELeave) CAsyncCallBack (callback03, CActive::EPriorityLow); + ipKickoff03->Call(); + } + } + +// +// RAsyncTestStepOmxILPcmRenderer0031 +// +RAsyncTestStepOmxILPcmRenderer0031::RAsyncTestStepOmxILPcmRenderer0031(const TDesC& aTestName, TInt aComponentUid) + : + RAsyncTestStepOmxILPcmRenderer0008(aTestName, aComponentUid) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0031::RAsyncTestStepOmxILPcmRenderer0031")); + iSamplingRate = 44100; + } + + +void +RAsyncTestStepOmxILPcmRenderer0031::KickoffTestL() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0031::KickoffTestL")); + iTestState = EStateLoadKickoffTestLComplete; + + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test31 ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(AllocateBuffer-population) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Executing ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Repeat these two steps until the whole file has beeen empited ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2a. - Call EmptyThisBuffer on PCM Renderer ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2b. - EmptyBufferDone callback received ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Set Volume Ramp to 2s (after 5 buffers played) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Executing->Idle(BufferFlushing) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 5.- Idle->Loaded(Depopulation) ")); + + // This will change the test file + iTestFileName.Set(KPcmRendererTestFile2); + + // This will install one callback + RAsyncTestStepOmxILComponentBase::KickoffTestL(); + + TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0005Step01, this); + delete ipKickoff01; + ipKickoff01 = NULL; + ipKickoff01 = + new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); + ipKickoff01->Call(); + } + +void +RAsyncTestStepOmxILPcmRenderer0031::DoEmptyBufferDoneL(OMX_HANDLETYPE /*aComponent*/, + OMX_BUFFERHEADERTYPE* /*aBuffer*/) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0031::DoEmptyBufferDoneL")); + INFO_PRINTF1(_L("DoEmptyBufferDoneL : Callback received ")); + + iNumOfEmptiedBuffers++; + if (iNumOfEmptiedBuffers == 5) + { + OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP volumeRampStruct; + volumeRampStruct.nSize = sizeof(OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP); + volumeRampStruct.nVersion = TOmxILSpecVersion(); + volumeRampStruct.nPortIndex = 0; + if (OMX_ErrorNone != ipCompHandle->GetConfig(ipCompHandle, + static_cast(OMX_SymbianIndexConfigAudioPcmVolumeRamp), + &volumeRampStruct)) + { + StopTest(KErrGeneral, EFail); + } + volumeRampStruct.nRampDuration = 2000000; // 2 second + if (OMX_ErrorNone != ipCompHandle->SetConfig(ipCompHandle, + static_cast(OMX_SymbianIndexConfigAudioPcmVolumeRamp), + &volumeRampStruct)) + { + StopTest(KErrGeneral, EFail); + } + INFO_PRINTF1(_L("Volume ramp set")); + } + + CMMFDataBuffer& dataBuffer = *(static_cast(ipBufferHeaderInput->pInputPortPrivate)); + ipTestFile->ReadNextBuffer(dataBuffer); + + if (dataBuffer.BufferSize() > 0) + { + // Send a buffer to the input port + ipBufferHeaderInput->nFilledLen = dataBuffer.BufferSize(); + + if (OMX_ErrorNone != ipCompHandle->EmptyThisBuffer( + ipCompHandle, ipBufferHeaderInput)) + { + StopTest(KErrGeneral, EFail); + } + } + else + { + TCallBack callback03 (RAsyncTestStepOmxILPcmRenderer0005Step03, this); + delete ipKickoff03; + ipKickoff03 = NULL; + ipKickoff03 = + new (ELeave) CAsyncCallBack (callback03, CActive::EPriorityLow); + ipKickoff03->Call(); + } + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilrefcomps/ref_components/audio/pcmrenderer/unittest/src/tsu_omxil_pcmrenderer_step.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/omxilrefcomps/ref_components/audio/pcmrenderer/unittest/src/tsu_omxil_pcmrenderer_step.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,706 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +/** + @file + @internalComponent +*/ + +#ifndef TSU_OMXIL_PCMRENDERER_STEP_H +#define TSU_OMXIL_PCMRENDERER_STEP_H + +#include "tsu_omxil_component_base.h" + + +// Forward declarations +class CMMFDescriptorBuffer; + +// +// RAsyncTestStepOmxILPcmRenderer0020 +// +// Test20 Description +// -# Init Component +// -# Obtain the component's state (GetState) +// -# Obtain the component's version (GetComponentVersion) +// -# Provide callbacks to component (SetCallbacks) +// -# Obtain component's role #1 (ComponentRoleEnum) +// -# Obtain component's role #2 (ComponentRoleEnum fails with OMX_ErrorNoMore) +// +class RAsyncTestStepOmxILPcmRenderer0020 : public RAsyncTestStepOmxILComponentBase + { + +public: + + RAsyncTestStepOmxILPcmRenderer0020(const TDesC& aTestName, TInt aComponentUid); + + // From RAsyncTestStep + void KickoffTestL(); + void CloseTest(); + + + // + void DoEventHandlerL(OMX_HANDLETYPE aComponent, + OMX_EVENTTYPE aEvent, + TUint aData1, + TUint aData2, + TAny* aExtra); + + +protected: + + // Call backs + static TInt RAsyncTestStepOmxILPcmRenderer0020Step01(TAny* aPtr); + void DoRAsyncTestStepOmxILPcmRenderer0020Step01(); + +protected: + + CAsyncCallBack* ipKickoff01; + CAsyncCallBack* ipKickoff02; + CAsyncCallBack* ipKickoff03; + CAsyncCallBack* ipKickoff04; + CAsyncCallBack* ipKickoff05; + CAsyncCallBack* ipKickoff06; + + }; + +// Test21 Description +// -# Init Component +// -# Provide callbacks to component (SetCallbacks) +// -# Obtain the component's state (GetState) +// -# Obtain component's role #1 with null string (ComponentRoleEnum fails with OMX_ErrorBadParameter) +// -# Obtain component's role #1 (ComponentRoleEnum successfully returns audio_decoder.aac) +// -# Obtain component's role #2 (ComponentRoleEnum fails with OMX_ErrorNoMore) +// +class RAsyncTestStepOmxILPcmRenderer0021 : public RAsyncTestStepOmxILComponentBase + { + +public: + + RAsyncTestStepOmxILPcmRenderer0021(const TDesC& aTestName, TInt aComponentUid); + + // From RAsyncTestStep + void KickoffTestL(); + void CloseTest(); + + + // + void DoEventHandlerL(OMX_HANDLETYPE aComponent, + OMX_EVENTTYPE aEvent, + TUint aData1, + TUint aData2, + TAny* aExtra); + + +protected: + + // Call backs + static TInt RAsyncTestStepOmxILPcmRenderer0021Step01(TAny* aPtr); + void DoRAsyncTestStepOmxILPcmRenderer0021Step01(); + +protected: + + CAsyncCallBack* ipKickoff01; + CAsyncCallBack* ipKickoff02; + CAsyncCallBack* ipKickoff03; + CAsyncCallBack* ipKickoff04; + CAsyncCallBack* ipKickoff05; + CAsyncCallBack* ipKickoff06; + + }; + +// Test22 Description +// -# Init Component +// -# Provide callbacks to component (SetCallbacks) +// -# Obtain the component's state (GetState) +// -# Get component's current role (GetParameter(OMX_IndexParamStandardComponentRole) ) +// -# Set unsupported audio_decoder.mp3 role (SetParameter(OMX_IndexParamStandardComponentRole) ) +// -# SetParameter returns OMX_ErrorBadParameter (audio_decoder.mp3 role not supported) +// +class RAsyncTestStepOmxILPcmRenderer0022 : public RAsyncTestStepOmxILComponentBase + { + +public: + + RAsyncTestStepOmxILPcmRenderer0022(const TDesC& aTestName, TInt aComponentUid); + + // From RAsyncTestStep + void KickoffTestL(); + void CloseTest(); + + + // + void DoEventHandlerL(OMX_HANDLETYPE aComponent, + OMX_EVENTTYPE aEvent, + TUint aData1, + TUint aData2, + TAny* aExtra); + + +protected: + + // Call backs + static TInt RAsyncTestStepOmxILPcmRenderer0022Step01(TAny* aPtr); + void DoRAsyncTestStepOmxILPcmRenderer0022Step01(); + +protected: + + CAsyncCallBack* ipKickoff01; + CAsyncCallBack* ipKickoff02; + CAsyncCallBack* ipKickoff03; + CAsyncCallBack* ipKickoff04; + CAsyncCallBack* ipKickoff05; + CAsyncCallBack* ipKickoff06; + + }; + + + +// +// RAsyncTestStepOmxILPcmRenderer0001 +// +// Test01 +// -# Init Component +// -# Loaded->Idle(AllocateBuffer-population) +// -# Idle->Loaded(depopulation) +// +class RAsyncTestStepOmxILPcmRenderer0001 : public RAsyncTestStepOmxILComponentBase + { + +public: + + RAsyncTestStepOmxILPcmRenderer0001(const TDesC& aTestName, TInt aComponentUid); + + // From RAsyncTestStep + void KickoffTestL(); + void CloseTest(); + + + // + void DoEventHandlerL(OMX_HANDLETYPE aComponent, + OMX_EVENTTYPE aEvent, + TUint aData1, + TUint aData2, + TAny* aExtra); + + +protected: + + // Call backs + static TInt RAsyncTestStepOmxILPcmRenderer0001Step01(TAny* aPtr); + void DoRAsyncTestStepOmxILPcmRenderer0001Step01(); + + static TInt RAsyncTestStepOmxILPcmRenderer0001Step02(TAny* aPtr); + void DoRAsyncTestStepOmxILPcmRenderer0001Step02(); + +protected: + + + // Set of states for simple state machine + enum TTestState + { + EStateDefault, + EStateLoadKickoffTestLComplete, + EStateTransitionToLoadedComplete, + EStateTransitionToIdleComplete, + EStateTransitionToWaiForResourcesComplete, + EStateTransitionToPauseComplete, + EStateTransitionToExecutingComplete, + }; + + OMX_BUFFERHEADERTYPE* ipBufferHeaderInput; + OMX_BUFFERHEADERTYPE* ipBufferHeaderOutput; + RArray ipClientClockPortBufferArray; + + TBool iTerminateNow; + TInt iSamplingRate; + + TTestState iTestState; + + CAsyncCallBack* ipKickoff01; + CAsyncCallBack* ipKickoff02; + CAsyncCallBack* ipKickoff03; + CAsyncCallBack* ipKickoff04; + CAsyncCallBack* ipKickoff05; + CAsyncCallBack* ipKickoff06; + + }; + +// +// RAsyncTestStepOmxILPcmRenderer0002 +// +// Test02 +// -# Init Component +// -# Loaded->Idle(UseBuffer-population) +// -# Idle->Loaded(depopulation) +// +class RAsyncTestStepOmxILPcmRenderer0002 : public RAsyncTestStepOmxILPcmRenderer0001 + { + +public: + + RAsyncTestStepOmxILPcmRenderer0002(const TDesC& aTestName, TInt aComponentUid); + + // From RAsyncTestStep + void KickoffTestL(); + void CloseTest(); + + + // + void DoEventHandlerL(OMX_HANDLETYPE aComponent, + OMX_EVENTTYPE aEvent, + TUint aData1, + TUint aData2, + TAny* aExtra); + + +protected: + + // Call backs + static TInt RAsyncTestStepOmxILPcmRenderer0002Step01(TAny* aPtr); + void DoRAsyncTestStepOmxILPcmRenderer0002Step01(); + + static TInt RAsyncTestStepOmxILPcmRenderer0002Step02(TAny* aPtr); + // void DoRAsyncTestStepOmxILPcmRenderer0002Step02(); + + +protected: + + CMMFDescriptorBuffer* ipInputBuffer; + CMMFDescriptorBuffer* ipOutputBuffer; + RArray iClockPortBufferPtrArray; + }; + +// +// RAsyncTestStepOmxILPcmRenderer0003 +// +// Test03 +// -# Init Component +// -# Loaded->WaitForResources +// -# WaitForResources->Loaded +// +class RAsyncTestStepOmxILPcmRenderer0003 : public RAsyncTestStepOmxILComponentBase + { + +public: + + RAsyncTestStepOmxILPcmRenderer0003(const TDesC& aTestName, TInt aComponentUid); + + // From RAsyncTestStep + void KickoffTestL(); + void CloseTest(); + + + // + void DoEventHandlerL(OMX_HANDLETYPE aComponent, + OMX_EVENTTYPE aEvent, + TUint aData1, + TUint aData2, + TAny* aExtra); + + +protected: + + // Call backs + static TInt RAsyncTestStepOmxILPcmRenderer0003Step01(TAny* aPtr); + void DoRAsyncTestStepOmxILPcmRenderer0003Step01(); + + static TInt RAsyncTestStepOmxILPcmRenderer0003Step02(TAny* aPtr); + void DoRAsyncTestStepOmxILPcmRenderer0003Step02(); + + +protected: + + TBool iTerminateNow; + + CAsyncCallBack* ipKickoff01; + CAsyncCallBack* ipKickoff02; + CAsyncCallBack* ipKickoff03; + CAsyncCallBack* ipKickoff04; + CAsyncCallBack* ipKickoff05; + CAsyncCallBack* ipKickoff06; + + + }; + +// +// RAsyncTestStepOmxILPcmRenderer0004 +// +// Test04 +// -# Init Component +// -# Loaded->Idle(AllocateBuffer-population) +// -# Idle->Pause +// -# Pause->Idle +// -# Idle->Loaded(depopulation) +// +class RAsyncTestStepOmxILPcmRenderer0004 : public RAsyncTestStepOmxILPcmRenderer0001 + { + +public: + + RAsyncTestStepOmxILPcmRenderer0004(const TDesC& aTestName, TInt aComponentUid); + + // From RAsyncTestStep + void KickoffTestL(); + void CloseTest(); + + + // + void DoEventHandlerL(OMX_HANDLETYPE aComponent, + OMX_EVENTTYPE aEvent, + TUint aData1, + TUint aData2, + TAny* aExtra); + + +protected: + + // Call backs + static TInt RAsyncTestStepOmxILPcmRenderer0004Step01(TAny* aPtr); + // void DoRAsyncTestStepOmxILPcmRenderer0004Step01(); + + static TInt RAsyncTestStepOmxILPcmRenderer0004Step02(TAny* aPtr); + void DoRAsyncTestStepOmxILPcmRenderer0004Step02(); + + static TInt RAsyncTestStepOmxILPcmRenderer0004Step03(TAny* aPtr); + void DoRAsyncTestStepOmxILPcmRenderer0004Step03(); + + static TInt RAsyncTestStepOmxILPcmRenderer0004Step04(TAny* aPtr); + // void DoRAsyncTestStepOmxILPcmRenderer0004Step04(); + + }; + +// +// RAsyncTestStepOmxILPcmRenderer0005 +// +// Test05 +// -# Init Component +// -# Loaded->Idle(AllocateBuffer-population) +// -# Idle->Executing +// -# Call EmptyThisBuffer on PCM Renderer +// -# EmptyBufferDone callbacks received +// -# Executing->Idle(BufferFlushing) +// -# Idle->Loaded(Depopulation) +// +class RAsyncTestStepOmxILPcmRenderer0005 : public RAsyncTestStepOmxILPcmRenderer0004 + { + +public: + + RAsyncTestStepOmxILPcmRenderer0005(const TDesC& aTestName, TInt aComponentUid); + + // From RAsyncTestStep + void KickoffTestL(); + void CloseTest(); + + + // + void DoEventHandlerL(OMX_HANDLETYPE aComponent, + OMX_EVENTTYPE aEvent, + TUint aData1, + TUint aData2, + TAny* aExtra); + + void DoEmptyBufferDoneL(OMX_HANDLETYPE aComponent, + OMX_BUFFERHEADERTYPE* aBuffer); + +protected: + + // Call backs + static TInt RAsyncTestStepOmxILPcmRenderer0005Step01(TAny* aPtr); + // void DoRAsyncTestStepOmxILPcmRenderer0005Step01(); + + static TInt RAsyncTestStepOmxILPcmRenderer0005Step02(TAny* aPtr); + void DoRAsyncTestStepOmxILPcmRenderer0005Step02(); + + static TInt RAsyncTestStepOmxILPcmRenderer0005Step03(TAny* aPtr); + // void DoRAsyncTestStepOmxILPcmRenderer0005Step03(); + + static TInt RAsyncTestStepOmxILPcmRenderer0005Step04(TAny* aPtr); + // void DoRAsyncTestStepOmxILPcmRenderer0005Step04(); + }; + +// +// RAsyncTestStepOmxILPcmRenderer0006 +// +// Test06 +// -# Init Component +// -# Loaded->Idle(AllocateBuffer-population) +// -# Idle->Executing +// -# Executing->Pause +// -# Pause->Executing +// -# Executing->Idle(BufferFlushing) +// -# Idle->Loaded(depopulation) +// +class RAsyncTestStepOmxILPcmRenderer0006 : public RAsyncTestStepOmxILPcmRenderer0005 + { + +public: + + RAsyncTestStepOmxILPcmRenderer0006(const TDesC& aTestName, TInt aComponentUid); + + // From RAsyncTestStep + void KickoffTestL(); + void CloseTest(); + + + // + void DoEventHandlerL(OMX_HANDLETYPE aComponent, + OMX_EVENTTYPE aEvent, + TUint aData1, + TUint aData2, + TAny* aExtra); + + +protected: + + // Call backs + static TInt RAsyncTestStepOmxILPcmRenderer0006Step01(TAny* aPtr); + // void DoRAsyncTestStepOmxILPcmRenderer0006Step01(); + + static TInt RAsyncTestStepOmxILPcmRenderer0006Step02(TAny* aPtr); + // void DoRAsyncTestStepOmxILPcmRenderer0006Step02(); + + static TInt RAsyncTestStepOmxILPcmRenderer0006Step03(TAny* aPtr); + void DoRAsyncTestStepOmxILPcmRenderer0006Step03(); + + static TInt RAsyncTestStepOmxILPcmRenderer0006Step04(TAny* aPtr); + // void DoRAsyncTestStepOmxILPcmRenderer0006Step04(); + + static TInt RAsyncTestStepOmxILPcmRenderer0006Step05(TAny* aPtr); + // void DoRAsyncTestStepOmxILPcmRenderer0006Step05(); + + static TInt RAsyncTestStepOmxILPcmRenderer0006Step06(TAny* aPtr); + // void DoRAsyncTestStepOmxILPcmRenderer0006Step06(); + + }; + +// +// RAsyncTestStepOmxILPcmRenderer0007 +// +// Test07 +// -# Init Component +// -# Loaded->Idle(AllocateBuffer-population) +// -# Idle->Executing +// -# Executing->Pause +// -# Pause->Idle(BufferFlushing) +// -# Idle->Loaded(depopulation) +// +class RAsyncTestStepOmxILPcmRenderer0007 : public RAsyncTestStepOmxILPcmRenderer0006 + { + +public: + + RAsyncTestStepOmxILPcmRenderer0007(const TDesC& aTestName, TInt aComponentUid); + + // From RAsyncTestStep + void KickoffTestL(); + void CloseTest(); + + + // + void DoEventHandlerL(OMX_HANDLETYPE aComponent, + OMX_EVENTTYPE aEvent, + TUint aData1, + TUint aData2, + TAny* aExtra); + + +protected: + + // Call backs + static TInt RAsyncTestStepOmxILPcmRenderer0007Step01(TAny* aPtr); + // void DoRAsyncTestStepOmxILPcmRenderer0007Step01(); + + static TInt RAsyncTestStepOmxILPcmRenderer0007Step02(TAny* aPtr); + // void DoRAsyncTestStepOmxILPcmRenderer0007Step02(); + + static TInt RAsyncTestStepOmxILPcmRenderer0007Step03(TAny* aPtr); + // void DoRAsyncTestStepOmxILPcmRenderer0007Step03(); + + static TInt RAsyncTestStepOmxILPcmRenderer0007Step04(TAny* aPtr); + // void DoRAsyncTestStepOmxILPcmRenderer0007Step04(); + + static TInt RAsyncTestStepOmxILPcmRenderer0007Step05(TAny* aPtr); + // void DoRAsyncTestStepOmxILPcmRenderer0007Step05(); + }; + +// +// RAsyncTestStepOmxILPcmRenderer0008 +// +// Test08 +// -# Init Component +// -# Loaded->Idle(AllocateBuffer-population) +// -# Idle->Executing +// -# Repeat these steps until the whole file has been emptied +// -# Call EmptyThisBuffer on PCM Renderer +// -# EmptyBufferDone callbacks received +// -# Executing->Idle(BufferFlushing) +// -# Idle->Loaded(Depopulation) +// +class RAsyncTestStepOmxILPcmRenderer0008 : public RAsyncTestStepOmxILPcmRenderer0005 + { +public: + RAsyncTestStepOmxILPcmRenderer0008(const TDesC& aTestName, TInt aComponentUid); + + // From RAsyncTestStep + void KickoffTestL(); + + void DoEventHandlerL(OMX_HANDLETYPE aComponent, + OMX_EVENTTYPE aEvent, + TUint aData1, + TUint aData2, + TAny* aExtra); + + void DoEmptyBufferDoneL(OMX_HANDLETYPE aComponent, + OMX_BUFFERHEADERTYPE* aBuffer); + }; + +// +// RAsyncTestStepOmxILPcmRenderer0009 +// +// Test09 +// -# Init Component +// -# Loaded->Idle(AllocateBuffer-population) +// -# Idle->Executing +// -# Repeat these steps until the whole file has been emptied +// -# Call EmptyThisBuffer on PCM Renderer +// -# EmptyBufferDone callbacks received +// -# Executing->Pause and Pause->Executing (after 5 and again after 10 buffers played) +// -# Executing->Idle(BufferFlushing) +// -# Idle->Loaded(Depopulation) +// +class RAsyncTestStepOmxILPcmRenderer0009 : public RAsyncTestStepOmxILPcmRenderer0008 + { +public: + RAsyncTestStepOmxILPcmRenderer0009(const TDesC& aTestName, TInt aComponentUid); + + // From RAsyncTestStep + void KickoffTestL(); + + void DoEventHandlerL(OMX_HANDLETYPE aComponent, + OMX_EVENTTYPE aEvent, + TUint aData1, + TUint aData2, + TAny* aExtra); + + void DoEmptyBufferDoneL(OMX_HANDLETYPE aComponent, + OMX_BUFFERHEADERTYPE* aBuffer); + +private: + TInt iNumOfEmptiedBuffers; + }; + +// +// RAsyncTestStepOmxILPcmRenderer0010 +// +// Test09 +// -# Init Component +// -# Loaded->Idle(AllocateBuffer-population) +// -# Idle->Executing +// -# Repeat these steps until the whole file has been emptied +// -# Call EmptyThisBuffer on PCM Renderer +// -# EmptyBufferDone callbacks received +// -# Executing->Idle and Idle->Executing (after 5 and again after 10 buffers played) +// -# Executing->Idle(BufferFlushing) +// -# Idle->Loaded(Depopulation) +// +class RAsyncTestStepOmxILPcmRenderer0010 : public RAsyncTestStepOmxILPcmRenderer0008 + { +public: + RAsyncTestStepOmxILPcmRenderer0010(const TDesC& aTestName, TInt aComponentUid); + + // From RAsyncTestStep + void KickoffTestL(); + + void DoEventHandlerL(OMX_HANDLETYPE aComponent, + OMX_EVENTTYPE aEvent, + TUint aData1, + TUint aData2, + TAny* aExtra); + + void DoEmptyBufferDoneL(OMX_HANDLETYPE aComponent, + OMX_BUFFERHEADERTYPE* aBuffer); + +protected: + + // Call backs + static TInt RAsyncTestStepOmxILPcmRenderer0010Step01(TAny* aPtr); + void DoRAsyncTestStepOmxILPcmRenderer0010Step01(); + +private: + + + TInt iNumOfEmptiedBuffers; + }; + +// +// RAsyncTestStepOmxILPcmRenderer0030 +// +// Test30 +// -# Init Component +// -# Loaded->Idle(AllocateBuffer-population) +// -# Idle->Executing +// -# Repeat these steps until the whole file has been emptied +// -# Call EmptyThisBuffer on PCM Renderer +// -# EmptyBufferDone callbacks received +// -# Get Bytes Played parameter and compare with the bytes readed from file +// -# Executing->Idle(BufferFlushing) +// -# Idle->Loaded(Depopulation) +// +class RAsyncTestStepOmxILPcmRenderer0030 : public RAsyncTestStepOmxILPcmRenderer0008 + { +public: + RAsyncTestStepOmxILPcmRenderer0030(const TDesC& aTestName, TInt aComponentUid); + + // From RAsyncTestStep + void KickoffTestL(); + + void DoEmptyBufferDoneL(OMX_HANDLETYPE aComponent, + OMX_BUFFERHEADERTYPE* aBuffer); + }; + +// +// RAsyncTestStepOmxILPcmRenderer0031 +// +// Test09 +// -# Init Component +// -# Loaded->Idle(AllocateBuffer-population) +// -# Idle->Executing +// -# Repeat these steps until the whole file has been emptied +// -# Call EmptyThisBuffer on PCM Renderer +// -# EmptyBufferDone callbacks received +// -# Set Volume Ramp to 2s (after 5 buffers played) +// -# Executing->Idle(BufferFlushing) +// -# Idle->Loaded(Depopulation) +// +class RAsyncTestStepOmxILPcmRenderer0031 : public RAsyncTestStepOmxILPcmRenderer0008 + { +public: + RAsyncTestStepOmxILPcmRenderer0031(const TDesC& aTestName, TInt aComponentUid); + + // From RAsyncTestStep + void KickoffTestL(); + + void DoEmptyBufferDoneL(OMX_HANDLETYPE aComponent, + OMX_BUFFERHEADERTYPE* aBuffer); + +private: + TInt iNumOfEmptiedBuffers; + }; + +#endif // TSU_OMXIL_PCMRENDERER_STEP_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilrefcomps/ref_components/audio/pcmrenderer/unittest/src/tsu_omxil_pcmrenderer_suite.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/omxilrefcomps/ref_components/audio/pcmrenderer/unittest/src/tsu_omxil_pcmrenderer_suite.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,173 @@ +/* +* 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 + +#include "log.h" +#include "tsu_omxil_pcmrenderer_suite.h" +#include "tsu_omxil_pcmrenderer_step.h" +#include "omxilpcmrenderer.hrh" + +/** + * + * NewTestSuiteL + * NewTestSuite is exported at ordinal 1 + * this provides the interface to allow schedule test + * to create instances of this test suite + * @result CTestSuiteOmxILPcmRenderer* + * + */ +EXPORT_C CTestSuiteOmxILPcmRenderer* NewTestSuiteL() + { + CTestSuiteOmxILPcmRenderer* result = new (ELeave) CTestSuiteOmxILPcmRenderer; + CleanupStack::PushL(result); + result->ConstructL(); + CleanupStack::Pop(); // result + return result; + } + +/** + * + * CTestSuiteOmxILPcmRenderer + * + */ +CTestSuiteOmxILPcmRenderer::CTestSuiteOmxILPcmRenderer() + { + DEBUG_PRINTF(_L8("CTestSuiteOmxILPcmRenderer::CTestSuiteOmxILPcmRenderer")); + + } + + +/** + * + * ~CTestSuiteOmxILPcmRenderer + * + */ +CTestSuiteOmxILPcmRenderer::~CTestSuiteOmxILPcmRenderer() + { + DEBUG_PRINTF(_L8("CTestSuiteOmxILPcmRenderer::~CTestSuiteOmxILPcmRenderer")); + } +/** + * + * GetVersion + * Get Test Suite version + * @result TPtrC + * + */ +TPtrC CTestSuiteOmxILPcmRenderer::GetVersion( void ) const + { + _LIT(KTxtVersion,"1.00"); + return KTxtVersion(); + } + + + +/** + * + * InitialiseL + * Constructor for test suite + * this creates all the test steps and + * stores them inside CTestSuiteOmxILPcmRenderer + * + */ +void CTestSuiteOmxILPcmRenderer::InitialiseL(void) + { + // store the name of this test suite + iSuiteName = _L("TSU_OMXIL_PcmRenderer"); + + AddTestStepL( + new(ELeave) RAsyncTestStepOmxILPcmRenderer0020( + _L("MM-OMXIL-OMXILPcmRenderer-U-0020-HP"), + KUidSymbianOmxILPcmRenderer)); + + AddTestStepL( + new(ELeave) RAsyncTestStepOmxILPcmRenderer0021( + _L("MM-OMXIL-OMXILPcmRenderer-U-0021-HP"), + KUidSymbianOmxILPcmRenderer)); + + AddTestStepL( + new(ELeave) RAsyncTestStepOmxILPcmRenderer0022( + _L("MM-OMXIL-OMXILPcmRenderer-U-0022-HP"), + KUidSymbianOmxILPcmRenderer)); + + AddTestStepL( + new(ELeave) RAsyncTestStepOmxILPcmRenderer0001( + _L("MM-OMXIL-OMXILPcmRenderer-U-0001-HP"), + KUidSymbianOmxILPcmRenderer)); + + AddTestStepL( + new(ELeave) RAsyncTestStepOmxILPcmRenderer0002( + _L("MM-OMXIL-OMXILPcmRenderer-U-0002-HP"), + KUidSymbianOmxILPcmRenderer)); + + AddTestStepL( + new(ELeave) RAsyncTestStepOmxILPcmRenderer0003( + _L("MM-OMXIL-OMXILPcmRenderer-U-0003-HP"), + KUidSymbianOmxILPcmRenderer)); + + AddTestStepL( + new(ELeave) RAsyncTestStepOmxILPcmRenderer0004( + _L("MM-OMXIL-OMXILPcmRenderer-U-0004-HP"), + KUidSymbianOmxILPcmRenderer)); + + AddTestStepL( + new(ELeave) RAsyncTestStepOmxILPcmRenderer0005( + _L("MM-OMXIL-OMXILPcmRenderer-U-0005-HP"), + KUidSymbianOmxILPcmRenderer)); + + AddTestStepL( + new(ELeave) RAsyncTestStepOmxILPcmRenderer0006( + _L("MM-OMXIL-OMXILPcmRenderer-U-0006-HP"), + KUidSymbianOmxILPcmRenderer)); + + AddTestStepL( + new(ELeave) RAsyncTestStepOmxILPcmRenderer0007( + _L("MM-OMXIL-OMXILPcmRenderer-U-0007-HP"), + KUidSymbianOmxILPcmRenderer)); + + AddTestStepL( + new(ELeave) RAsyncTestStepOmxILPcmRenderer0008( + _L("MM-OMXIL-OMXILPcmRenderer-U-0008-HP"), + KUidSymbianOmxILPcmRenderer)); + + AddTestStepL( + new(ELeave) RAsyncTestStepOmxILPcmRenderer0009( + _L("MM-OMXIL-OMXILPcmRenderer-U-0009-HP"), + KUidSymbianOmxILPcmRenderer)); + + AddTestStepL( + new(ELeave) RAsyncTestStepOmxILPcmRenderer0010( + _L("MM-OMXIL-OMXILPcmRenderer-U-0010-HP"), + KUidSymbianOmxILPcmRenderer)); + + AddTestStepL( + new(ELeave) RAsyncTestStepOmxILPcmRenderer0030( + _L("MM-OMXIL-OMXILPcmRenderer-U-0030-HP"), + KUidSymbianOmxILPcmRenderer)); + + AddTestStepL( + new(ELeave) RAsyncTestStepOmxILPcmRenderer0031( + _L("MM-OMXIL-OMXILPcmRenderer-U-0031-HP"), + KUidSymbianOmxILPcmRenderer)); + + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilrefcomps/ref_components/audio/pcmrenderer/unittest/src/tsu_omxil_pcmrenderer_suite.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/omxilrefcomps/ref_components/audio/pcmrenderer/unittest/src/tsu_omxil_pcmrenderer_suite.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,46 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +/** + @file + @internalComponent +*/ + +#ifndef TSU_OMXIL_PCMRENDERER_SUITE_H +#define TSU_OMXIL_PCMRENDERER_SUITE_H + +#include + +/** + * + * CTestSuiteOmxILPcmRenderer defines the test suite for OMX IL PCM Renderer tests + * + * + * + */ +class CTestSuiteOmxILPcmRenderer : public CTestSuite + { + +public: +CTestSuiteOmxILPcmRenderer(); + void InitialiseL(void); + virtual ~CTestSuiteOmxILPcmRenderer(); + virtual TPtrC GetVersion( void ) const; + }; + +#endif // TSU_OMXIL_PCMRENDERER_SUITE_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilrefcomps/ref_components/audio/pcmrenderer/unittest/src/uids.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/omxilrefcomps/ref_components/audio/pcmrenderer/unittest/src/uids.hrh Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef UIDS_HRH +#define UIDS_HRH + +#define KSharedLibraryUidDefine 0x1000008d + +// The following UID has changed to fix the defect DEF123946 v9.5 +#define KUidTsuOmxILAacDecoderDll 0x10285E7C +#define KUidTsuOmxILPcmRendererDll 0x10285C07 + +#endif // UIDS_HRH + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilrefcomps/ref_components/group/bld.inf --- a/omxil/omxilrefcomps/ref_components/group/bld.inf Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilrefcomps/ref_components/group/bld.inf Fri May 07 16:25:23 2010 +0100 @@ -1,24 +1,22 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// - -PRJ_MMPFILES -// Components -../mmpfiles/omxilpcmrenderer.mmp - -PRJ_EXPORTS -// Romkit include files -omxilcompref.iby /epoc32/rom/include/omxilcompref.iby - - +// 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 +// Romkit include files +omxilcompref.iby /epoc32/rom/include/omxilcompref.iby + + +#include "../audio/pcmrenderer/group/bld.inf" diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilrefcomps/ref_components/group/multimedia_omx_il_comp_ref.mrp --- a/omxil/omxilrefcomps/ref_components/group/multimedia_omx_il_comp_ref.mrp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilrefcomps/ref_components/group/multimedia_omx_il_comp_ref.mrp Fri May 07 16:25:23 2010 +0100 @@ -1,28 +1,28 @@ -# multimedia_omx_il_comp_ref.mrp -# -# 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: -# - -component multimedia_omx_il_comp_ref - -source \sf\os\mm\omxil\omxilrefcomps\ref_components\ - -binary \sf\os\mm\omxil\omxilrefcomps\ref_components\group all - -exports \sf\os\mm\omxil\omxilrefcomps\ref_components\group - -notes_source \component_defs\release.src - -ipr T +# multimedia_omx_il_comp_ref.mrp +# +# 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: +# + +component multimedia_omx_il_comp_ref + +source \sf\os\mm\omxil\omxilrefcomps\ref_components\ + +binary \sf\os\mm\omxil\omxilrefcomps\ref_components\group all + +exports \sf\os\mm\omxil\omxilrefcomps\ref_components\group + +notes_source \component_defs\release.src + +ipr T diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilrefcomps/ref_components/group/omxilcompref.iby --- a/omxil/omxilrefcomps/ref_components/group/omxilcompref.iby Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilrefcomps/ref_components/group/omxilcompref.iby Fri May 07 16:25:23 2010 +0100 @@ -1,23 +1,23 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// - -#ifndef OMXILCOMPREF_IBY -#define OMXILCOMPREF_IBY - - -// OMX IL Components -ECOM_PLUGIN(omxilpcmrenderer.dll, omxilpcmrenderer.rsc) - +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +#ifndef OMXILCOMPREF_IBY +#define OMXILCOMPREF_IBY + + +// OMX IL Components +ECOM_PLUGIN(omxilpcmrenderer.dll, omxilpcmrenderer.rsc) + #endif // OMXILCOMPREF_IBY \ No newline at end of file diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilrefcomps/ref_components/mmpfiles/omxilpcmrenderer.mmp --- a/omxil/omxilrefcomps/ref_components/mmpfiles/omxilpcmrenderer.mmp Mon May 03 13:56:28 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -// 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 omxilpcmrenderer.dll -// @SYMPurpose -// -// - -#include "../audio/pcmrenderer/src/omxilpcmrenderer.hrh" - -TARGET omxilpcmrenderer.dll -CAPABILITY ALL -TCB -TARGETTYPE plugin -UID 0x10009D8D KUidSymbianOmxILPcmRendererDll -VENDORID 0x70000001 - -OS_LAYER_SYSTEMINCLUDE_SYMBIAN - -USERINCLUDE ../audio/pcmrenderer/src -USERINCLUDE ../../../omxilcomponentcommon/src/common -USERINCLUDE ../audio/pcmrenderer/inc -USERINCLUDE ../../../../../mm/mmdevicefw/mdf/src/audio/mdasoundadapter - - -SOURCEPATH ../audio/pcmrenderer/src -SOURCE omxilpcmrenderer.cpp -SOURCE omxilpcmrendererapb0port.cpp -SOURCE omxilpcmrendererprocessingfunction.cpp -SOURCE omxilpcmrendererconfigmanager.cpp - -RESOURCE omxilpcmrenderer.rss - -LIBRARY euser.lib -LIBRARY ecom.lib -LIBRARY omxilcomponentcommon.lib -STATICLIBRARY omxilcomponentif.lib - -#ifdef SYMBIAN_MDF_SHAREDCHUNK_SOUNDDRIVER -LIBRARY mdasoundadapter.lib -#endif - -// Uncomment to activate debug tracing in this module -MACRO _OMXIL_PCMRENDERER_DEBUG_TRACING_ON - -SMPSAFE diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/components/bwins/tsu_omxil_pcmrenderer_01.def --- a/omxil/omxilunittest/components/bwins/tsu_omxil_pcmrenderer_01.def Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/components/bwins/tsu_omxil_pcmrenderer_01.def Fri May 07 16:25:23 2010 +0100 @@ -1,3 +1,3 @@ -EXPORTS - ?NewTestSuiteL@@YAPAVCTestSuiteOmxILPcmRenderer@@XZ @ 1 NONAME ; class CTestSuiteOmxILPcmRenderer * NewTestSuiteL(void) - +EXPORTS + ?NewTestSuiteL@@YAPAVCTestSuiteOmxILPcmRenderer@@XZ @ 1 NONAME ; class CTestSuiteOmxILPcmRenderer * NewTestSuiteL(void) + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/components/eabi/tsu_omxil_pcmrenderer_01.def --- a/omxil/omxilunittest/components/eabi/tsu_omxil_pcmrenderer_01.def Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/components/eabi/tsu_omxil_pcmrenderer_01.def Fri May 07 16:25:23 2010 +0100 @@ -1,3 +1,3 @@ -EXPORTS - _Z13NewTestSuiteLv @ 1 NONAME - +EXPORTS + _Z13NewTestSuiteLv @ 1 NONAME + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/components/group/bld.inf --- a/omxil/omxilunittest/components/group/bld.inf Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/components/group/bld.inf Fri May 07 16:25:23 2010 +0100 @@ -1,28 +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_EXPORTS -../scripts/tsu_omxil_pcmrenderer_01.script c:/omxil/tsu_omxil_pcmrenderer_01.script - -// Export test files -../data/pcm16stereo8khz.raw c:/omxil/testfiles/pcm16stereo8khz.raw -../data/pcm16stereo44khz.raw c:/omxil/testfiles/pcm16stereo44khz.raw - -// .iby -tsu_omxil_components.iby /epoc32/rom/include/tsu_omxil_components.iby - -PRJ_MMPFILES -../mmpfiles/tsu_omxil_pcmrenderer_01.mmp - +// 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 +../scripts/tsu_omxil_pcmrenderer_01.script c:/omxil/tsu_omxil_pcmrenderer_01.script + +// Export test files +../data/pcm16stereo8khz.raw c:/omxil/testfiles/pcm16stereo8khz.raw +../data/pcm16stereo44khz.raw c:/omxil/testfiles/pcm16stereo44khz.raw + +// .iby +tsu_omxil_components.iby /epoc32/rom/include/tsu_omxil_components.iby + +PRJ_MMPFILES +../mmpfiles/tsu_omxil_pcmrenderer_01.mmp + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/components/group/tsu_omxil_components.iby --- a/omxil/omxilunittest/components/group/tsu_omxil_components.iby Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/components/group/tsu_omxil_components.iby Fri May 07 16:25:23 2010 +0100 @@ -1,24 +1,24 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// - -#ifndef TSU_OMXIL_COMPONENTS_IBY -#define TSU_OMXIL_COMPONENTS_IBY - -// OMX IL Components Unit tests and scripts - -file=ABI_DIR\BUILD_DIR\tsu_omxil_pcmrenderer_01.dll System\Libs\tsu_omxil_pcmrenderer_01.dll -data=EPOCROOT##epoc32\data\c\omxil\tsu_omxil_pcmrenderer_01.script \omxil\tsu_omxil_pcmrenderer_01.script - +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +#ifndef TSU_OMXIL_COMPONENTS_IBY +#define TSU_OMXIL_COMPONENTS_IBY + +// OMX IL Components Unit tests and scripts + +file=ABI_DIR\BUILD_DIR\tsu_omxil_pcmrenderer_01.dll System\Libs\tsu_omxil_pcmrenderer_01.dll +data=EPOCROOT##epoc32\data\c\omxil\tsu_omxil_pcmrenderer_01.script \omxil\tsu_omxil_pcmrenderer_01.script + #endif // TSU_OMXIL_COMPONENTS_IBY \ No newline at end of file diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/components/mmpfiles/tsu_omxil_pcmrenderer_01.mmp --- a/omxil/omxilunittest/components/mmpfiles/tsu_omxil_pcmrenderer_01.mmp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/components/mmpfiles/tsu_omxil_pcmrenderer_01.mmp Fri May 07 16:25:23 2010 +0100 @@ -1,53 +1,53 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// - -#include "../src/uids.hrh" - -TARGET tsu_omxil_pcmrenderer_01.dll -CAPABILITY ALL -TCB -TARGETTYPE dll -UID KSharedLibraryUidDefine KUidTsuOmxILPcmRendererDll -VENDORID 0x70000001 - -OS_LAYER_SYSTEMINCLUDE_SYMBIAN -OS_LAYER_ESTLIB_SYSTEMINCLUDE - -USERINCLUDE ../src -USERINCLUDE ../../../omxilrefcomps/ref_components/audio/pcmrenderer/inc -USERINCLUDE ../../../omxilcomponentcommon/src/common -USERINCLUDE ../../../omxilrefcomps/ref_components/audio/pcmrenderer/src - -SOURCEPATH ../src -SOURCE tsu_omxil_component_base.cpp -SOURCE tsu_omxil_pcmrenderer_suite.cpp -SOURCE tsu_omxil_pcmrenderer_step.cpp - -LIBRARY euser.lib -LIBRARY efsrv.lib -LIBRARY ecom.lib -LIBRARY testframeworkclient.lib -LIBRARY omxilcomponentcommon.lib -LIBRARY mmfserverbaseclasses.lib -STATICLIBRARY omxilcomponentif.lib - -NOSTRICTDEF -#ifdef EABI -NOEXPORTLIBRARY -#endif - -// Uncomment to activate debug tracing in this module -// MACRO _OMXIL_AACUNIT_DEBUG_TRACING_ON - -SMPSAFE +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +#include "../src/uids.hrh" + +TARGET tsu_omxil_pcmrenderer_01.dll +CAPABILITY ALL -TCB +TARGETTYPE dll +UID KSharedLibraryUidDefine KUidTsuOmxILPcmRendererDll +VENDORID 0x70000001 + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN +OS_LAYER_ESTLIB_SYSTEMINCLUDE + +USERINCLUDE ../src +USERINCLUDE ../../../omxilrefcomps/ref_components/audio/pcmrenderer/inc +USERINCLUDE ../../../omxilcomponentcommon/src/common +USERINCLUDE ../../../omxilrefcomps/ref_components/audio/pcmrenderer/src + +SOURCEPATH ../src +SOURCE tsu_omxil_component_base.cpp +SOURCE tsu_omxil_pcmrenderer_suite.cpp +SOURCE tsu_omxil_pcmrenderer_step.cpp + +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY ecom.lib +LIBRARY testframeworkclient.lib +LIBRARY omxilcomponentcommon.lib +LIBRARY mmfserverbaseclasses.lib +STATICLIBRARY omxilcomponentif.lib + +NOSTRICTDEF +#ifdef EABI +NOEXPORTLIBRARY +#endif + +// Uncomment to activate debug tracing in this module +// MACRO _OMXIL_AACUNIT_DEBUG_TRACING_ON + +SMPSAFE diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/components/scripts/tsu_omxil_pcmrenderer_01.script --- a/omxil/omxilunittest/components/scripts/tsu_omxil_pcmrenderer_01.script Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/components/scripts/tsu_omxil_pcmrenderer_01.script Fri May 07 16:25:23 2010 +0100 @@ -1,91 +1,91 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// - -LOAD_SUITE tsu_omxil_pcmrenderer_01.dll - -//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0020-HP - -RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0020-HP -TEST_COMPLETE - -//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0021-HP - -RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0021-HP -TEST_COMPLETE - -//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0022-HP - -RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0022-HP -TEST_COMPLETE - -//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0001-HP - -RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0001-HP -TEST_COMPLETE - -//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0002-HP - -RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0002-HP -TEST_COMPLETE - -//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0003-HP - -RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0003-HP -TEST_COMPLETE - -//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0004-HP - -RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0004-HP -TEST_COMPLETE - -//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0005-HP - -RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0005-HP -TEST_COMPLETE - -//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0006-HP - -RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0006-HP -TEST_COMPLETE - -//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0007-HP - -RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0007-HP -TEST_COMPLETE - -//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0008-HP - -RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0008-HP -TEST_COMPLETE - -//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0009-HP - -RUN_TEST_STEP 30000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0009-HP -TEST_COMPLETE - -//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0010-HP - -RUN_TEST_STEP 30000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0010-HP -TEST_COMPLETE - -//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0030-HP - -RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0030-HP -TEST_COMPLETE - -//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0031-HP - -RUN_TEST_STEP 30000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0031-HP -TEST_COMPLETE +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +LOAD_SUITE tsu_omxil_pcmrenderer_01.dll + +//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0020-HP + +RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0020-HP +TEST_COMPLETE + +//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0021-HP + +RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0021-HP +TEST_COMPLETE + +//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0022-HP + +RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0022-HP +TEST_COMPLETE + +//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0001-HP + +RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0001-HP +TEST_COMPLETE + +//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0002-HP + +RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0002-HP +TEST_COMPLETE + +//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0003-HP + +RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0003-HP +TEST_COMPLETE + +//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0004-HP + +RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0004-HP +TEST_COMPLETE + +//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0005-HP + +RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0005-HP +TEST_COMPLETE + +//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0006-HP + +RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0006-HP +TEST_COMPLETE + +//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0007-HP + +RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0007-HP +TEST_COMPLETE + +//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0008-HP + +RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0008-HP +TEST_COMPLETE + +//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0009-HP + +RUN_TEST_STEP 30000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0009-HP +TEST_COMPLETE + +//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0010-HP + +RUN_TEST_STEP 30000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0010-HP +TEST_COMPLETE + +//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0030-HP + +RUN_TEST_STEP 20000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0030-HP +TEST_COMPLETE + +//! @SYMTestCaseID MM-OMXIL-OMXILPCMRENDERER-U-0031-HP + +RUN_TEST_STEP 30000 tsu_omxil_pcmrenderer_01 MM-OMXIL-OMXILPCMRENDERER-U-0031-HP +TEST_COMPLETE diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/components/src/log.h --- a/omxil/omxilunittest/components/src/log.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/components/src/log.h Fri May 07 16:25:23 2010 +0100 @@ -1,146 +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 - -class TTruncateOverflowHandler16 : public TDes16Overflow - { - public: - virtual void Overflow( TDes16& aDes ); - }; - -inline void TTruncateOverflowHandler16::Overflow( TDes16& aDes) - { - _LIT(KErrOverflowMsg,"Descriptor Overflow, hence value truncated"); - if( aDes.MaxLength() >= KErrOverflowMsg().Length() + aDes.Length() ) - aDes.Append(KErrOverflowMsg); - } - -class TTruncateOverflowHandler8 : public TDes8Overflow - { - public: - virtual void Overflow( TDes8& aDes ); - }; - -inline void TTruncateOverflowHandler8::Overflow( TDes8& aDes) - { - _LIT(KErrOverflowMsg,"Descriptor Overflow, hence value truncated"); - if( aDes.MaxLength() >= KErrOverflowMsg().Length() + aDes.Length() ) - aDes.Append(KErrOverflowMsg); - } - -namespace DSD -{ - -#ifdef _DEBUG - -#ifdef _OMXIL_AACUNIT_DEBUG_TRACING_ON - -#define DEBUG_PRINTF(a) {DSD::DebugPrintf(__LINE__, __FILE__, a);} -#define DEBUG_PRINTF2(a, b) {DSD::DebugPrintf(__LINE__, __FILE__, a, b);} -#define DEBUG_PRINTF3(a, b, c) {DSD::DebugPrintf(__LINE__, __FILE__, a, b, c);} -#define DEBUG_PRINTF4(a, b, c, d) {DSD::DebugPrintf(__LINE__, __FILE__, a, b, c, d);} -#define DEBUG_PRINTF5(a, b, c, d, e) {DSD::DebugPrintf(__LINE__, __FILE__, a, b, c, d, e);} - -#define DEBUG_CODE_SECTION(a) TRAP_IGNORE({ a; }) - -// UTF-8 overload of the DebufPrintf method. Should be used by default, -// since it's cheaper both in CPU cycles and stack space. - -inline void DebugPrintf(TInt aLine, char* aFile, TRefByValue aFormat, ...) - { - TTruncateOverflowHandler8 overflowHandler8; - VA_LIST list; - VA_START(list, aFormat); - - TTime now; - now.HomeTime(); - - TBuf8<1024> buffer; - _LIT8(KSwiLogPrefix, "[aacunit] "); - _LIT8(KSwiLineFileFormat, "TID[%d] : [%s:%d] -- "); - buffer.Append(KSwiLogPrefix); - RThread thread; - TUint threadId = thread.Id(); - thread.Close(); - RProcess proc; - TFileName fName = proc.FileName(); - proc.Close(); - buffer.AppendFormat(KSwiLineFileFormat, threadId, aFile, aLine); - buffer.AppendFormatList(aFormat, list ,&overflowHandler8 ); - buffer.Append(_L8("\r\n")); - - RDebug::RawPrint(buffer); - - VA_END(list); - } - -// Unicode DebufPrintf overload - -inline void DebugPrintf(TInt aLine, char* aFile, TRefByValue aFormat, ...) - { - TTruncateOverflowHandler16 overflowHandler16; - VA_LIST list; - VA_START(list, aFormat); - - TTime now; - now.HomeTime(); - - TBuf8<256> header; - _LIT8(KSwiLogPrefix, "[aacunit] "); - _LIT8(KSwiLineFileFormat, "%Ld Line: % 5d, File: %s -- "); - header.Append(KSwiLogPrefix); - header.AppendFormat(KSwiLineFileFormat, now.Int64(), aLine, aFile); - - TBuf<1024> buffer; - buffer.Copy(header); - buffer.AppendFormatList(aFormat, list ,&overflowHandler16); - buffer.Append(_L("\r\n")); - - RDebug::RawPrint(buffer); - - VA_END(list); - } -#else - -#define DEBUG_PRINTF(a) -#define DEBUG_PRINTF2(a, b) -#define DEBUG_PRINTF3(a, b, c) -#define DEBUG_PRINTF4(a, b, c, d) -#define DEBUG_PRINTF5(a, b, c, d, e) - -#define DEBUG_CODE_SECTION(a) - -#endif - -#else - -#define DEBUG_PRINTF(a) -#define DEBUG_PRINTF2(a, b) -#define DEBUG_PRINTF3(a, b, c) -#define DEBUG_PRINTF4(a, b, c, d) -#define DEBUG_PRINTF5(a, b, c, d, e) - -#define DEBUG_CODE_SECTION(a) - -#endif - - -} // namespace DSD - -#endif // __SWI_LOG_H__ +// 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 + +class TTruncateOverflowHandler16 : public TDes16Overflow + { + public: + virtual void Overflow( TDes16& aDes ); + }; + +inline void TTruncateOverflowHandler16::Overflow( TDes16& aDes) + { + _LIT(KErrOverflowMsg,"Descriptor Overflow, hence value truncated"); + if( aDes.MaxLength() >= KErrOverflowMsg().Length() + aDes.Length() ) + aDes.Append(KErrOverflowMsg); + } + +class TTruncateOverflowHandler8 : public TDes8Overflow + { + public: + virtual void Overflow( TDes8& aDes ); + }; + +inline void TTruncateOverflowHandler8::Overflow( TDes8& aDes) + { + _LIT(KErrOverflowMsg,"Descriptor Overflow, hence value truncated"); + if( aDes.MaxLength() >= KErrOverflowMsg().Length() + aDes.Length() ) + aDes.Append(KErrOverflowMsg); + } + +namespace DSD +{ + +#ifdef _DEBUG + +#ifdef _OMXIL_AACUNIT_DEBUG_TRACING_ON + +#define DEBUG_PRINTF(a) {DSD::DebugPrintf(__LINE__, __FILE__, a);} +#define DEBUG_PRINTF2(a, b) {DSD::DebugPrintf(__LINE__, __FILE__, a, b);} +#define DEBUG_PRINTF3(a, b, c) {DSD::DebugPrintf(__LINE__, __FILE__, a, b, c);} +#define DEBUG_PRINTF4(a, b, c, d) {DSD::DebugPrintf(__LINE__, __FILE__, a, b, c, d);} +#define DEBUG_PRINTF5(a, b, c, d, e) {DSD::DebugPrintf(__LINE__, __FILE__, a, b, c, d, e);} + +#define DEBUG_CODE_SECTION(a) TRAP_IGNORE({ a; }) + +// UTF-8 overload of the DebufPrintf method. Should be used by default, +// since it's cheaper both in CPU cycles and stack space. + +inline void DebugPrintf(TInt aLine, char* aFile, TRefByValue aFormat, ...) + { + TTruncateOverflowHandler8 overflowHandler8; + VA_LIST list; + VA_START(list, aFormat); + + TTime now; + now.HomeTime(); + + TBuf8<1024> buffer; + _LIT8(KSwiLogPrefix, "[aacunit] "); + _LIT8(KSwiLineFileFormat, "TID[%d] : [%s:%d] -- "); + buffer.Append(KSwiLogPrefix); + RThread thread; + TUint threadId = thread.Id(); + thread.Close(); + RProcess proc; + TFileName fName = proc.FileName(); + proc.Close(); + buffer.AppendFormat(KSwiLineFileFormat, threadId, aFile, aLine); + buffer.AppendFormatList(aFormat, list ,&overflowHandler8 ); + buffer.Append(_L8("\r\n")); + + RDebug::RawPrint(buffer); + + VA_END(list); + } + +// Unicode DebufPrintf overload + +inline void DebugPrintf(TInt aLine, char* aFile, TRefByValue aFormat, ...) + { + TTruncateOverflowHandler16 overflowHandler16; + VA_LIST list; + VA_START(list, aFormat); + + TTime now; + now.HomeTime(); + + TBuf8<256> header; + _LIT8(KSwiLogPrefix, "[aacunit] "); + _LIT8(KSwiLineFileFormat, "%Ld Line: % 5d, File: %s -- "); + header.Append(KSwiLogPrefix); + header.AppendFormat(KSwiLineFileFormat, now.Int64(), aLine, aFile); + + TBuf<1024> buffer; + buffer.Copy(header); + buffer.AppendFormatList(aFormat, list ,&overflowHandler16); + buffer.Append(_L("\r\n")); + + RDebug::RawPrint(buffer); + + VA_END(list); + } +#else + +#define DEBUG_PRINTF(a) +#define DEBUG_PRINTF2(a, b) +#define DEBUG_PRINTF3(a, b, c) +#define DEBUG_PRINTF4(a, b, c, d) +#define DEBUG_PRINTF5(a, b, c, d, e) + +#define DEBUG_CODE_SECTION(a) + +#endif + +#else + +#define DEBUG_PRINTF(a) +#define DEBUG_PRINTF2(a, b) +#define DEBUG_PRINTF3(a, b, c) +#define DEBUG_PRINTF4(a, b, c, d) +#define DEBUG_PRINTF5(a, b, c, d, e) + +#define DEBUG_CODE_SECTION(a) + +#endif + + +} // namespace DSD + +#endif // __SWI_LOG_H__ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/components/src/tsu_omxil_component_base.cpp --- a/omxil/omxilunittest/components/src/tsu_omxil_component_base.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/components/src/tsu_omxil_component_base.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,858 +1,858 @@ -// 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 -#include - -#include -#include -#include - -#include "log.h" -#include "tsu_omxil_component_base.h" - - -const TInt CCallbackHandler::KMaxMsgQueueEntries; - - -CAacTestFile* -CAacTestFile::NewL() - { - DEBUG_PRINTF(_L8("CAacTestFile::NewL")); - CAacTestFile* self = new (ELeave) CAacTestFile(); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } - -void -CAacTestFile::ConstructL() - { - DEBUG_PRINTF(_L8("CAacTestFile::ConstructL")); - } - -CAacTestFile::CAacTestFile() : - iSourceFile(0), - iSourceFileReadPos(0), - iFinished(EFalse) - { - DEBUG_PRINTF(_L8("CAacTestFile::CAacTestFile")); - } - -CAacTestFile::~CAacTestFile() - { - DEBUG_PRINTF(_L8("CAacTestFile::~CAacTestFile")); - - delete iSourceFile; - - } - -TInt -CAacTestFile::ReadTestFileInBuffer(const TDesC& aFileName) - { - DEBUG_PRINTF(_L8("CAacTestFile::ReadTestFileInBuffer")); - - RFs fs; - fs.Connect(); - - RFile file; - TInt err = file.Open(fs, aFileName, EFileRead); - if (err == KErrNone) - { - TInt size; - err = file.Size(size); - if (err == KErrNone) - { - iSourceFile = HBufC8::NewMax(size); - if(!iSourceFile) - { - return KErrNoMemory; - } - TPtr8 ptr = iSourceFile->Des(); - file.Read(ptr,size); - file.Close(); - } - fs.Close(); - } - - return err; - - } - - -void -CAacTestFile::ReadNextBuffer(CMMFBuffer& aDataBuffer) - { - DEBUG_PRINTF(_L8("CAacTestFile::ReadNextBuffer")); - - CMMFDataBuffer* pDataBuffer = static_cast(&aDataBuffer); - while (ETrue) - { - // check if finished - if (iFinished) - { - DEBUG_PRINTF(_L8("CAacTestFile::ReadNextBuffer : File finished")); - pDataBuffer->Data().Zero(); - return; - } - - TInt srcLength = iSourceFile->Size(); - if (iSourceFileReadPos < srcLength) - { - TInt size = srcLength; - if (size > pDataBuffer->Data().MaxLength()) - { - size = pDataBuffer->Data().MaxLength(); - } - Mem::Copy((TAny*)pDataBuffer->Data().Ptr(), (TAny*)iSourceFile->Mid(iSourceFileReadPos).Ptr(), size); - pDataBuffer->Data().SetLength(size); - iSourceFileReadPos += size; - DEBUG_PRINTF2(_L8("CAacTestFile::ReadNextBuffer : data read = [%d] bytes"), iSourceFileReadPos); - DEBUG_PRINTF2(_L8("CAacTestFile::ReadNextBuffer : pDataBuffer->BufferSize = [%u] bytes"), pDataBuffer->BufferSize()); - if (iSourceFileReadPos >= srcLength) - { - DEBUG_PRINTF(_L8("CAacTestFile::ReadNextBuffer : end of data")); - pDataBuffer->SetLastBuffer(ETrue); - iFinished = ETrue; - } - return; - - } - else - { - // no more data - DEBUG_PRINTF(_L8("CAacTestFile::ReadNextBuffer : end of data")); - iFinished = ETrue; - return; - } - } - } - -void -CAacTestFile::ResetPos() - { - iSourceFileReadPos = 0; - iFinished = EFalse; - } - -TInt -CAacTestFile::GetPos() - { - return iSourceFileReadPos; - } - - -CAacOutputTestFile* -CAacOutputTestFile::NewL() - { - DEBUG_PRINTF(_L8("CAacOutputTestFile::NewL")); - CAacOutputTestFile* self = new (ELeave) CAacOutputTestFile(); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } - -void -CAacOutputTestFile::ConstructL() - { - DEBUG_PRINTF(_L8("CAacOutputTestFile::ConstructL")); - } - -CAacOutputTestFile::CAacOutputTestFile() : - iFileServerSession(), - iOutputFile(), - iWrittenDataTotal(0), - iBuffersWrittenCount(0) - { - DEBUG_PRINTF(_L8("CAacOutputTestFile::CAacOutputTestFile")); - } - -CAacOutputTestFile::~CAacOutputTestFile() - { - DEBUG_PRINTF(_L8("CAacOutputTestFile::~CAacOutputTestFile")); - } - -TInt -CAacOutputTestFile::SetUpOutputFile(const TDesC& aFileName) - { - DEBUG_PRINTF(_L8("CAacOutputTestFile::SetUpOutputFile")); - - iFileServerSession.Connect(); - TInt err = iOutputFile.Create(iFileServerSession, - aFileName, - EFileWrite|EFileShareExclusive); - if(err != KErrNone) - { - err = iOutputFile.Replace(iFileServerSession, - aFileName, - EFileWrite|EFileShareExclusive); - } - return err; - - } - -TInt -CAacOutputTestFile::WriteDataToFile(const CMMFBuffer& aDataBuffer) - { - DEBUG_PRINTF(_L8("CAacOutputTestFile::WriteDataToFile")); - - const CMMFDataBuffer& dataBuffer = static_cast(aDataBuffer); - const TDesC8& data = dataBuffer.Data(); - - TInt err = KErrNone; - err = iOutputFile.Write(data); - if(err != KErrNone) - { - return err; - } - // keep record of amount of data and the number of buffers written out - iWrittenDataTotal += data.Size(); - iBuffersWrittenCount++; - - DEBUG_PRINTF2(_L8("CAacOutputTestFile::WriteDataToFile : data.Size()[%d]"), data.Size()); - DEBUG_PRINTF2(_L8("CAacOutputTestFile::WriteDataToFile : iWrittenDataTotal[%d]"), iWrittenDataTotal); - DEBUG_PRINTF2(_L8("CAacOutputTestFile::WriteDataToFile : iBuffersWrittenCount[%d]"), iBuffersWrittenCount); - - return err; - - } - - -TInt -CAacOutputTestFile::AddWavHeader() - { - DEBUG_PRINTF(_L8("CAacOutputTestFile::AddWavHeader")); - - RFs fs; - fs.Connect(); - - RFile file; - TInt err = file.Open(fs, KAacDecoderOutputTestFile, EFileRead); - if (err != KErrNone) - { - return err; - } - - TInt size; - err = file.Size(size); - if (err != KErrNone) - { - return err; - } - - HBufC8* rawDecFile = HBufC8::NewMax(size); - if(!rawDecFile) - { - return KErrNoMemory; - } - - TPtr8 ptr = rawDecFile->Des(); - file.Read(ptr,size); - file.Close(); - - // add headers - err = file.Replace(fs, KAacDecoderOutputTestFile, EFileWrite); - if (err != KErrNone) - { - return err; - } - - // this is canonical WAV file format header - TInt32 chunkSize = size + KTestWavFormatPCMChunkHeaderSize; - TInt32 subchunk1size = KTestWavFormatPCMSubchunk1Size; - TInt16 audioFormat = KTestAudioFormatPCM; - TInt16 numChannels = KTestNumChannels; - TInt32 sampleRate = KTestSampleRate; - TInt16 bitsPerSample = KTestBitsPerSample; - TInt32 byteRate = sampleRate * numChannels * (bitsPerSample / 8); - TInt16 blockAlign = numChannels * (bitsPerSample / 8); - TInt32 subchunk2size = size; - - file.Write(_L8("RIFF")); - { TPtrC8 buf((TText8*)&chunkSize,sizeof(TInt32)); file.Write(buf); } - file.Write(_L8("WAVEfmt ")); - { TPtrC8 buf((TText8*)&subchunk1size,sizeof(TInt32)); file.Write(buf); } - { TPtrC8 buf((TText8*)&audioFormat,sizeof(TInt16)); file.Write(buf); } - { TPtrC8 buf((TText8*)&numChannels,sizeof(TInt16)); file.Write(buf); } - { TPtrC8 buf((TText8*)&sampleRate,sizeof(TInt32)); file.Write(buf); } - { TPtrC8 buf((TText8*)&byteRate,sizeof(TInt32)); file.Write(buf); } - { TPtrC8 buf((TText8*)&blockAlign,sizeof(TInt16)); file.Write(buf); } - { TPtrC8 buf((TText8*)&bitsPerSample,sizeof(TInt16)); file.Write(buf); } - file.Write(_L8("data")); - { TPtrC8 buf((TText8*)&subchunk2size,sizeof(TInt32)); file.Write(buf); } - file.Write(ptr,size); - - // store file size - file.Size(iWrittenDataTotal); - - file.Close(); - fs.Close(); - - delete rawDecFile; - - return KErrNone; - - } - -void -CAacOutputTestFile::CloseOutputFile() - { - DEBUG_PRINTF(_L8("CAacOutputTestFile::CloseOutputFile")); - - iOutputFile.Close(); - iFileServerSession.Close(); - - } - -// -// CUtilityTimer -// -CUtilityTimer* -CUtilityTimer::NewL(TTimeIntervalMicroSeconds32& aDelay, - MTimerObserver& aObserver) - { - CUtilityTimer* self = new (ELeave) CUtilityTimer(aObserver); - CleanupStack::PushL(self); - self->ConstructL(aDelay); - CleanupStack::Pop(self); - return self; - } - -void -CUtilityTimer::ConstructL(TTimeIntervalMicroSeconds32& aDelay) - { - CTimer::ConstructL(); - - iDelay = aDelay; - CActiveScheduler::Add(this); - } - -CUtilityTimer::~CUtilityTimer() - { - Cancel(); - } - -void -CUtilityTimer::InitializeTimer() - { - // Request another wait - assume not active - CTimer::After(iDelay); - } - -void -CUtilityTimer::RunL() - { - if (iStatus.Int() == KErrNone) - iObserver.TimerExpired(); - } - -void -CUtilityTimer::DoCancel() - { - } - - -CUtilityTimer::CUtilityTimer(MTimerObserver& aObserver) : - CTimer(CActive::EPriorityUserInput), - iObserver(aObserver) - { - } - -// -// CCallbackHandler -// -CCallbackHandler* -CCallbackHandler::NewL(RAsyncTestStepOmxILComponentBase& aDecoderTest) - { - DEBUG_PRINTF(_L8("CCallbackHandler::NewL")); - - CCallbackHandler* self = new (ELeave) CCallbackHandler(aDecoderTest); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - - } - - -void -CCallbackHandler::ConstructL() - { - DEBUG_PRINTF(_L8("CCallbackHandler::ConstructL")); - - OMX_CALLBACKTYPE h = - { - CCallbackHandler::EventHandler, - CCallbackHandler::EmptyBufferDone, - CCallbackHandler::FillBufferDone - }; - - iHandle = h; - CActiveScheduler::Add(this); - - User::LeaveIfError(iMsgQueue.CreateLocal(KMaxMsgQueueEntries)); - iMsgQueue.NotifyDataAvailable(iStatus); - SetActive(); - - } - -CCallbackHandler::CCallbackHandler(RAsyncTestStepOmxILComponentBase& aDecoderTest) - : CActive(EPriorityNormal), - iDecoderTest(aDecoderTest) - { - DEBUG_PRINTF(_L8("CCallbackHandler::CCallbackHandler")); - } - - -CCallbackHandler::operator OMX_CALLBACKTYPE*() - { - DEBUG_PRINTF(_L8("CCallbackHandler::operator OMX_CALLBACKTYPE*")); - - return &iHandle; - - } - - -void -CCallbackHandler::RunL() - { - DEBUG_PRINTF(_L8("CCallbackHandler::RunL")); - - TOmxMessage msg; - while (iMsgQueue.Receive(msg)==KErrNone) - { - switch (msg.iType) - { - case EEmptyBufferCallback: - { - iDecoderTest.DoEmptyBufferDoneL(msg.iComponent, - msg.iBuffer); - } - break; - case EFillBufferCallback: - { - iDecoderTest.DoFillBufferDoneL(msg.iComponent, - msg.iBuffer); - } - break; - case EEventCallback: - { - iDecoderTest.DoEventHandlerL(msg.iComponent, - msg.iEventParams.iEvent, - msg.iEventParams.iData1, - msg.iEventParams.iData2, - msg.iEventParams.iExtra); - } - break; - default: - { - // This is an invalid state - ASSERT(EFalse); - } - }; - } - - // setup for next callbacks - iStatus = KRequestPending; - iMsgQueue.NotifyDataAvailable(iStatus); - SetActive(); - - } - -CCallbackHandler::~CCallbackHandler() - { - DEBUG_PRINTF(_L8("CCallbackHandler::~CCallbackHandler")); - - Cancel(); - iMsgQueue.Close(); - - } - - -void -CCallbackHandler::DoCancel() - { - DEBUG_PRINTF(_L8("CCallbackHandler::DoCancel")); - - if (iMsgQueue.Handle()) - { - iMsgQueue.CancelDataAvailable(); - } - - } - -OMX_ERRORTYPE -CCallbackHandler::FillBufferDone(OMX_HANDLETYPE aComponent, - TAny* aAppData, - OMX_BUFFERHEADERTYPE* aBuffer) - { - DEBUG_PRINTF(_L8("CCallbackHandler::FillBufferDone")); - - return static_cast(aAppData)->DoFillBufferDone(aComponent, aBuffer); - - } - -OMX_ERRORTYPE -CCallbackHandler::EmptyBufferDone(OMX_HANDLETYPE aComponent, - TAny* aAppData, - OMX_BUFFERHEADERTYPE* aBuffer) - { - DEBUG_PRINTF(_L8("CCallbackHandler::EmptyBufferDone")); - - return static_cast(aAppData)->DoEmptyBufferDone(aComponent, aBuffer); - - } - -OMX_ERRORTYPE -CCallbackHandler::EventHandler(OMX_HANDLETYPE aComponent, - TAny* aAppData, - OMX_EVENTTYPE aEvent, - TUint32 aData1, - TUint32 aData2, - TAny* aExtra) - { - DEBUG_PRINTF4(_L8("CCallbackHandler::EventHandler : EVENT[%d] Data1[%d] Data2[%d]"), aExtra, aData1, aData2); - - CCallbackHandler::TEventParams eventParams; - eventParams.iEvent = aEvent; - eventParams.iData1 = aData1; - eventParams.iData2 = aData2; - eventParams.iExtra = aExtra; - return static_cast(aAppData)->DoEventHandler(aComponent, eventParams); - - } - -OMX_ERRORTYPE -CCallbackHandler::DoFillBufferDone(OMX_HANDLETYPE aComponent, - OMX_BUFFERHEADERTYPE* aBuffer) - { - DEBUG_PRINTF(_L8("CCallbackHandler::DoFillBufferDone")); - - TOmxMessage message; - message.iType = EFillBufferCallback; - message.iComponent = aComponent; - message.iBuffer = aBuffer; - return RAsyncTestStepOmxILComponentBase::ConvertSymbianErrorType( - iMsgQueue.Send(message)); - - } - -OMX_ERRORTYPE -CCallbackHandler::DoEmptyBufferDone(OMX_HANDLETYPE aComponent, - OMX_BUFFERHEADERTYPE* aBuffer) - { - DEBUG_PRINTF(_L8("CCallbackHandler::DoEmptyBufferDone")); - - TOmxMessage message; - message.iType = EEmptyBufferCallback; - message.iComponent = aComponent; - message.iBuffer = aBuffer; - return RAsyncTestStepOmxILComponentBase::ConvertSymbianErrorType( - iMsgQueue.Send(message)); - - } - -OMX_ERRORTYPE -CCallbackHandler::DoEventHandler(OMX_HANDLETYPE aComponent, - TEventParams aEventParams) - { - DEBUG_PRINTF(_L8("CCallbackHandler::DoEventHandler")); - - TOmxMessage message; - message.iType = EEventCallback; - message.iComponent = aComponent; - message.iEventParams = aEventParams; - return RAsyncTestStepOmxILComponentBase::ConvertSymbianErrorType( - iMsgQueue.Send(message)); - - } - -// -// RAsyncTestStepOmxILComponentBase -// -RAsyncTestStepOmxILComponentBase::RAsyncTestStepOmxILComponentBase(const TDesC& aTestName, TInt aComponentUid) - : - iComponentUid(), - ipKickoffAOp(0), - ipKickoffStop(0), - ipCOmxILComponent(0), - ipCallbackHandler(0), - ipTestFile(0), - iTestFileName(KAacDecoderTestFile()), - ipCompHandle(0) - { - DEBUG_PRINTF2(_L8("RAsyncTestStepOmxILComponentBase::RAsyncTestStepOmxILComponentBase: UID[%X]"), aComponentUid); - iTestStepName = aTestName; - iComponentUid = aComponentUid; - // Default heap size is 32K. Increased to avoid the KErrNoMemory for this test step. - iHeapSize = KTestHeapSize; - - } - -RAsyncTestStepOmxILComponentBase::~RAsyncTestStepOmxILComponentBase() - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::~RAsyncTestStepOmxILComponentBase")); - // nothing here just yet - } - -void -RAsyncTestStepOmxILComponentBase::PrintOmxState(OMX_STATETYPE aOmxState) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::PrintOmxState")); - - switch(aOmxState) - { - case OMX_StateInvalid: - { - INFO_PRINTF1(_L("OMX STATE : OMX_StateInvalid")); - } - break; - case OMX_StateLoaded: - { - INFO_PRINTF1(_L("OMX STATE : OMX_StateLoaded")); - } - break; - case OMX_StateIdle: - { - INFO_PRINTF1(_L("OMX STATE : OMX_StateIdle")); - } - break; - case OMX_StateExecuting: - { - INFO_PRINTF1(_L("OMX STATE : OMX_StateExecuting")); - } - break; - case OMX_StatePause: - { - INFO_PRINTF1(_L("OMX STATE : OMX_StatePause")); - } - break; - case OMX_StateWaitForResources: - { - INFO_PRINTF1(_L("OMX STATE : OMX_StateWaitForResources")); - } - break; - default: - { - INFO_PRINTF1(_L("OMX STATE : Wrong state found")); - } - }; - - } - -OMX_ERRORTYPE -RAsyncTestStepOmxILComponentBase::ConvertSymbianErrorType(TInt aError) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::ConvertSymbianErrorType")); - - OMX_ERRORTYPE err = OMX_ErrorNone; - switch (aError) - { - case KErrNone: - err = OMX_ErrorNone; - break; - case KErrNoMemory: - err = OMX_ErrorInsufficientResources; - break; - case KErrGeneral: - break; - default: - err = OMX_ErrorUndefined; - } - return err; - - } - - -/** - This method is used at the beginning of the test, and initialises the - asynchronous calls that will be activated once the call returns. The - ActiveScheduler is active at this point. If this test leaves, then - StopTest() will be called with the leave value, so implicitly the test - stops. - -*/ -void -RAsyncTestStepOmxILComponentBase::KickoffTestL() - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::KickoffTestL")); - - __MM_HEAP_MARK; - - // Set up an asynchronous call - TCallBack callback (ComponentBaseCallBack, this); - delete ipKickoffAOp; - ipKickoffAOp = NULL; - ipKickoffAOp = - new (ELeave) CAsyncCallBack (callback, CActive::EPriorityLow); - // Queues this active object to be run once. - ipKickoffAOp->Call(); - - } - -TInt -RAsyncTestStepOmxILComponentBase::ComponentBaseCallBack(TAny* aPtr) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::ComponentBaseCallBack")); - - RAsyncTestStepOmxILComponentBase* self = static_cast (aPtr); - self->DoComponentBaseCallBack(); - return KErrNone; - - } - -void -RAsyncTestStepOmxILComponentBase::DoComponentBaseCallBack() - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::DoComponentBaseCallBack")); - - TRAPD(err, ipCOmxILComponent = - COmxILComponentIf::CreateImplementationL(TUid::Uid(iComponentUid))); - - //return StopTest(err, EFail); - if (err != KErrNone) - { - INFO_PRINTF2(_L("RAsyncTestStepOmxILComponentBase::DoComponentBaseCallBack : err [%d]"), err); - if (KErrNotFound == err) - { - INFO_PRINTF1(_L("DoComponentBaseCallBack : CreateImplementationL returned KErrNotFound")); -// PacketVideo's AAC decoder libraries only provided for UDEB -#ifndef _DEBUG - INFO_PRINTF1(_L("IMPORTANT NOTE : THIS SUITE CAN ONLY BE RUN IN UDEB MODE")); - INFO_PRINTF1(_L("IMPORTANT NOTE : PACKETVIDEO'S AAC DECODER LIBRARY ONLY AVAILABLE IN UDEB MODE")); -#endif - } - return StopTest(err, EFail); - } - - ipCompHandle = static_cast(ipCOmxILComponent->Handle()); - if (!ipCompHandle) - { - return StopTest(KErrGeneral, EFail); - } - - TRAP(err, ipCallbackHandler = CCallbackHandler::NewL(*this)); - if (err != KErrNone) - { - return StopTest(err, EFail); - } - - TRAP(err, ipTestFile = CAacTestFile::NewL()); - if (err != KErrNone) - { - return StopTest(err, EFail); - } - - err = ipTestFile->ReadTestFileInBuffer(iTestFileName); - if (err != KErrNone) - { - return StopTest(err, EFail); - } - - TRAP(err, ipOutputTestFile = CAacOutputTestFile::NewL()); - if (err != KErrNone) - { - return StopTest(err, EFail); - } - - err = ipOutputTestFile->SetUpOutputFile(KAacDecoderOutputTestFile); - if (err != KErrNone) - { - return StopTest(err, EFail); - } - - - } - -TInt -RAsyncTestStepOmxILComponentBase::StopTestCallBack(TAny* aPtr) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::StopTestCallBack")); - RAsyncTestStepOmxILComponentBase* self = - static_cast (aPtr); - self->DoStopTestCallBack(); - return KErrNone; - } - -void -RAsyncTestStepOmxILComponentBase::DoStopTestCallBack() - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::DoStopTestCallBack")); - - StopTest(); - - } - - -void -RAsyncTestStepOmxILComponentBase::CloseTest() - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::CloseTest")); - - if (ipCompHandle) - { - ipCompHandle->ComponentDeInit(ipCompHandle); - } - delete ipCOmxILComponent; - ipCOmxILComponent = 0; - ipCompHandle = 0; - - delete ipKickoffAOp; // no need to Cancel - ipKickoffAOp = 0; - - delete ipCallbackHandler; - ipCallbackHandler = 0; - - delete ipTestFile; - ipTestFile = 0; - - if (ipOutputTestFile) - { - ipOutputTestFile->CloseOutputFile(); - // We ignore here this error... - TInt err = ipOutputTestFile->AddWavHeader(); - delete ipOutputTestFile; - ipOutputTestFile = 0; - } - - REComSession::FinalClose(); - __MM_HEAP_MARKEND; - - } - -void -RAsyncTestStepOmxILComponentBase::DoFillBufferDoneL(OMX_HANDLETYPE /* aComponent */, - OMX_BUFFERHEADERTYPE* /* aBuffer */) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::DoFillBufferDoneL")); - // By default, no callback expected here... - return StopTest(KErrGeneral, EFail); - } - -void -RAsyncTestStepOmxILComponentBase::DoEmptyBufferDoneL(OMX_HANDLETYPE /* aComponent */, - OMX_BUFFERHEADERTYPE* /* aBuffer */) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::DoEmptyBufferDoneL")); - // By default, no callback expected here... - return StopTest(KErrGeneral, EFail); - } +// 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 +#include + +#include +#include +#include + +#include "log.h" +#include "tsu_omxil_component_base.h" + + +const TInt CCallbackHandler::KMaxMsgQueueEntries; + + +CAacTestFile* +CAacTestFile::NewL() + { + DEBUG_PRINTF(_L8("CAacTestFile::NewL")); + CAacTestFile* self = new (ELeave) CAacTestFile(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +void +CAacTestFile::ConstructL() + { + DEBUG_PRINTF(_L8("CAacTestFile::ConstructL")); + } + +CAacTestFile::CAacTestFile() : + iSourceFile(0), + iSourceFileReadPos(0), + iFinished(EFalse) + { + DEBUG_PRINTF(_L8("CAacTestFile::CAacTestFile")); + } + +CAacTestFile::~CAacTestFile() + { + DEBUG_PRINTF(_L8("CAacTestFile::~CAacTestFile")); + + delete iSourceFile; + + } + +TInt +CAacTestFile::ReadTestFileInBuffer(const TDesC& aFileName) + { + DEBUG_PRINTF(_L8("CAacTestFile::ReadTestFileInBuffer")); + + RFs fs; + fs.Connect(); + + RFile file; + TInt err = file.Open(fs, aFileName, EFileRead); + if (err == KErrNone) + { + TInt size; + err = file.Size(size); + if (err == KErrNone) + { + iSourceFile = HBufC8::NewMax(size); + if(!iSourceFile) + { + return KErrNoMemory; + } + TPtr8 ptr = iSourceFile->Des(); + file.Read(ptr,size); + file.Close(); + } + fs.Close(); + } + + return err; + + } + + +void +CAacTestFile::ReadNextBuffer(CMMFBuffer& aDataBuffer) + { + DEBUG_PRINTF(_L8("CAacTestFile::ReadNextBuffer")); + + CMMFDataBuffer* pDataBuffer = static_cast(&aDataBuffer); + while (ETrue) + { + // check if finished + if (iFinished) + { + DEBUG_PRINTF(_L8("CAacTestFile::ReadNextBuffer : File finished")); + pDataBuffer->Data().Zero(); + return; + } + + TInt srcLength = iSourceFile->Size(); + if (iSourceFileReadPos < srcLength) + { + TInt size = srcLength; + if (size > pDataBuffer->Data().MaxLength()) + { + size = pDataBuffer->Data().MaxLength(); + } + Mem::Copy((TAny*)pDataBuffer->Data().Ptr(), (TAny*)iSourceFile->Mid(iSourceFileReadPos).Ptr(), size); + pDataBuffer->Data().SetLength(size); + iSourceFileReadPos += size; + DEBUG_PRINTF2(_L8("CAacTestFile::ReadNextBuffer : data read = [%d] bytes"), iSourceFileReadPos); + DEBUG_PRINTF2(_L8("CAacTestFile::ReadNextBuffer : pDataBuffer->BufferSize = [%u] bytes"), pDataBuffer->BufferSize()); + if (iSourceFileReadPos >= srcLength) + { + DEBUG_PRINTF(_L8("CAacTestFile::ReadNextBuffer : end of data")); + pDataBuffer->SetLastBuffer(ETrue); + iFinished = ETrue; + } + return; + + } + else + { + // no more data + DEBUG_PRINTF(_L8("CAacTestFile::ReadNextBuffer : end of data")); + iFinished = ETrue; + return; + } + } + } + +void +CAacTestFile::ResetPos() + { + iSourceFileReadPos = 0; + iFinished = EFalse; + } + +TInt +CAacTestFile::GetPos() + { + return iSourceFileReadPos; + } + + +CAacOutputTestFile* +CAacOutputTestFile::NewL() + { + DEBUG_PRINTF(_L8("CAacOutputTestFile::NewL")); + CAacOutputTestFile* self = new (ELeave) CAacOutputTestFile(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +void +CAacOutputTestFile::ConstructL() + { + DEBUG_PRINTF(_L8("CAacOutputTestFile::ConstructL")); + } + +CAacOutputTestFile::CAacOutputTestFile() : + iFileServerSession(), + iOutputFile(), + iWrittenDataTotal(0), + iBuffersWrittenCount(0) + { + DEBUG_PRINTF(_L8("CAacOutputTestFile::CAacOutputTestFile")); + } + +CAacOutputTestFile::~CAacOutputTestFile() + { + DEBUG_PRINTF(_L8("CAacOutputTestFile::~CAacOutputTestFile")); + } + +TInt +CAacOutputTestFile::SetUpOutputFile(const TDesC& aFileName) + { + DEBUG_PRINTF(_L8("CAacOutputTestFile::SetUpOutputFile")); + + iFileServerSession.Connect(); + TInt err = iOutputFile.Create(iFileServerSession, + aFileName, + EFileWrite|EFileShareExclusive); + if(err != KErrNone) + { + err = iOutputFile.Replace(iFileServerSession, + aFileName, + EFileWrite|EFileShareExclusive); + } + return err; + + } + +TInt +CAacOutputTestFile::WriteDataToFile(const CMMFBuffer& aDataBuffer) + { + DEBUG_PRINTF(_L8("CAacOutputTestFile::WriteDataToFile")); + + const CMMFDataBuffer& dataBuffer = static_cast(aDataBuffer); + const TDesC8& data = dataBuffer.Data(); + + TInt err = KErrNone; + err = iOutputFile.Write(data); + if(err != KErrNone) + { + return err; + } + // keep record of amount of data and the number of buffers written out + iWrittenDataTotal += data.Size(); + iBuffersWrittenCount++; + + DEBUG_PRINTF2(_L8("CAacOutputTestFile::WriteDataToFile : data.Size()[%d]"), data.Size()); + DEBUG_PRINTF2(_L8("CAacOutputTestFile::WriteDataToFile : iWrittenDataTotal[%d]"), iWrittenDataTotal); + DEBUG_PRINTF2(_L8("CAacOutputTestFile::WriteDataToFile : iBuffersWrittenCount[%d]"), iBuffersWrittenCount); + + return err; + + } + + +TInt +CAacOutputTestFile::AddWavHeader() + { + DEBUG_PRINTF(_L8("CAacOutputTestFile::AddWavHeader")); + + RFs fs; + fs.Connect(); + + RFile file; + TInt err = file.Open(fs, KAacDecoderOutputTestFile, EFileRead); + if (err != KErrNone) + { + return err; + } + + TInt size; + err = file.Size(size); + if (err != KErrNone) + { + return err; + } + + HBufC8* rawDecFile = HBufC8::NewMax(size); + if(!rawDecFile) + { + return KErrNoMemory; + } + + TPtr8 ptr = rawDecFile->Des(); + file.Read(ptr,size); + file.Close(); + + // add headers + err = file.Replace(fs, KAacDecoderOutputTestFile, EFileWrite); + if (err != KErrNone) + { + return err; + } + + // this is canonical WAV file format header + TInt32 chunkSize = size + KTestWavFormatPCMChunkHeaderSize; + TInt32 subchunk1size = KTestWavFormatPCMSubchunk1Size; + TInt16 audioFormat = KTestAudioFormatPCM; + TInt16 numChannels = KTestNumChannels; + TInt32 sampleRate = KTestSampleRate; + TInt16 bitsPerSample = KTestBitsPerSample; + TInt32 byteRate = sampleRate * numChannels * (bitsPerSample / 8); + TInt16 blockAlign = numChannels * (bitsPerSample / 8); + TInt32 subchunk2size = size; + + file.Write(_L8("RIFF")); + { TPtrC8 buf((TText8*)&chunkSize,sizeof(TInt32)); file.Write(buf); } + file.Write(_L8("WAVEfmt ")); + { TPtrC8 buf((TText8*)&subchunk1size,sizeof(TInt32)); file.Write(buf); } + { TPtrC8 buf((TText8*)&audioFormat,sizeof(TInt16)); file.Write(buf); } + { TPtrC8 buf((TText8*)&numChannels,sizeof(TInt16)); file.Write(buf); } + { TPtrC8 buf((TText8*)&sampleRate,sizeof(TInt32)); file.Write(buf); } + { TPtrC8 buf((TText8*)&byteRate,sizeof(TInt32)); file.Write(buf); } + { TPtrC8 buf((TText8*)&blockAlign,sizeof(TInt16)); file.Write(buf); } + { TPtrC8 buf((TText8*)&bitsPerSample,sizeof(TInt16)); file.Write(buf); } + file.Write(_L8("data")); + { TPtrC8 buf((TText8*)&subchunk2size,sizeof(TInt32)); file.Write(buf); } + file.Write(ptr,size); + + // store file size + file.Size(iWrittenDataTotal); + + file.Close(); + fs.Close(); + + delete rawDecFile; + + return KErrNone; + + } + +void +CAacOutputTestFile::CloseOutputFile() + { + DEBUG_PRINTF(_L8("CAacOutputTestFile::CloseOutputFile")); + + iOutputFile.Close(); + iFileServerSession.Close(); + + } + +// +// CUtilityTimer +// +CUtilityTimer* +CUtilityTimer::NewL(TTimeIntervalMicroSeconds32& aDelay, + MTimerObserver& aObserver) + { + CUtilityTimer* self = new (ELeave) CUtilityTimer(aObserver); + CleanupStack::PushL(self); + self->ConstructL(aDelay); + CleanupStack::Pop(self); + return self; + } + +void +CUtilityTimer::ConstructL(TTimeIntervalMicroSeconds32& aDelay) + { + CTimer::ConstructL(); + + iDelay = aDelay; + CActiveScheduler::Add(this); + } + +CUtilityTimer::~CUtilityTimer() + { + Cancel(); + } + +void +CUtilityTimer::InitializeTimer() + { + // Request another wait - assume not active + CTimer::After(iDelay); + } + +void +CUtilityTimer::RunL() + { + if (iStatus.Int() == KErrNone) + iObserver.TimerExpired(); + } + +void +CUtilityTimer::DoCancel() + { + } + + +CUtilityTimer::CUtilityTimer(MTimerObserver& aObserver) : + CTimer(CActive::EPriorityUserInput), + iObserver(aObserver) + { + } + +// +// CCallbackHandler +// +CCallbackHandler* +CCallbackHandler::NewL(RAsyncTestStepOmxILComponentBase& aDecoderTest) + { + DEBUG_PRINTF(_L8("CCallbackHandler::NewL")); + + CCallbackHandler* self = new (ELeave) CCallbackHandler(aDecoderTest); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + + } + + +void +CCallbackHandler::ConstructL() + { + DEBUG_PRINTF(_L8("CCallbackHandler::ConstructL")); + + OMX_CALLBACKTYPE h = + { + CCallbackHandler::EventHandler, + CCallbackHandler::EmptyBufferDone, + CCallbackHandler::FillBufferDone + }; + + iHandle = h; + CActiveScheduler::Add(this); + + User::LeaveIfError(iMsgQueue.CreateLocal(KMaxMsgQueueEntries)); + iMsgQueue.NotifyDataAvailable(iStatus); + SetActive(); + + } + +CCallbackHandler::CCallbackHandler(RAsyncTestStepOmxILComponentBase& aDecoderTest) + : CActive(EPriorityNormal), + iDecoderTest(aDecoderTest) + { + DEBUG_PRINTF(_L8("CCallbackHandler::CCallbackHandler")); + } + + +CCallbackHandler::operator OMX_CALLBACKTYPE*() + { + DEBUG_PRINTF(_L8("CCallbackHandler::operator OMX_CALLBACKTYPE*")); + + return &iHandle; + + } + + +void +CCallbackHandler::RunL() + { + DEBUG_PRINTF(_L8("CCallbackHandler::RunL")); + + TOmxMessage msg; + while (iMsgQueue.Receive(msg)==KErrNone) + { + switch (msg.iType) + { + case EEmptyBufferCallback: + { + iDecoderTest.DoEmptyBufferDoneL(msg.iComponent, + msg.iBuffer); + } + break; + case EFillBufferCallback: + { + iDecoderTest.DoFillBufferDoneL(msg.iComponent, + msg.iBuffer); + } + break; + case EEventCallback: + { + iDecoderTest.DoEventHandlerL(msg.iComponent, + msg.iEventParams.iEvent, + msg.iEventParams.iData1, + msg.iEventParams.iData2, + msg.iEventParams.iExtra); + } + break; + default: + { + // This is an invalid state + ASSERT(EFalse); + } + }; + } + + // setup for next callbacks + iStatus = KRequestPending; + iMsgQueue.NotifyDataAvailable(iStatus); + SetActive(); + + } + +CCallbackHandler::~CCallbackHandler() + { + DEBUG_PRINTF(_L8("CCallbackHandler::~CCallbackHandler")); + + Cancel(); + iMsgQueue.Close(); + + } + + +void +CCallbackHandler::DoCancel() + { + DEBUG_PRINTF(_L8("CCallbackHandler::DoCancel")); + + if (iMsgQueue.Handle()) + { + iMsgQueue.CancelDataAvailable(); + } + + } + +OMX_ERRORTYPE +CCallbackHandler::FillBufferDone(OMX_HANDLETYPE aComponent, + TAny* aAppData, + OMX_BUFFERHEADERTYPE* aBuffer) + { + DEBUG_PRINTF(_L8("CCallbackHandler::FillBufferDone")); + + return static_cast(aAppData)->DoFillBufferDone(aComponent, aBuffer); + + } + +OMX_ERRORTYPE +CCallbackHandler::EmptyBufferDone(OMX_HANDLETYPE aComponent, + TAny* aAppData, + OMX_BUFFERHEADERTYPE* aBuffer) + { + DEBUG_PRINTF(_L8("CCallbackHandler::EmptyBufferDone")); + + return static_cast(aAppData)->DoEmptyBufferDone(aComponent, aBuffer); + + } + +OMX_ERRORTYPE +CCallbackHandler::EventHandler(OMX_HANDLETYPE aComponent, + TAny* aAppData, + OMX_EVENTTYPE aEvent, + TUint32 aData1, + TUint32 aData2, + TAny* aExtra) + { + DEBUG_PRINTF4(_L8("CCallbackHandler::EventHandler : EVENT[%d] Data1[%d] Data2[%d]"), aExtra, aData1, aData2); + + CCallbackHandler::TEventParams eventParams; + eventParams.iEvent = aEvent; + eventParams.iData1 = aData1; + eventParams.iData2 = aData2; + eventParams.iExtra = aExtra; + return static_cast(aAppData)->DoEventHandler(aComponent, eventParams); + + } + +OMX_ERRORTYPE +CCallbackHandler::DoFillBufferDone(OMX_HANDLETYPE aComponent, + OMX_BUFFERHEADERTYPE* aBuffer) + { + DEBUG_PRINTF(_L8("CCallbackHandler::DoFillBufferDone")); + + TOmxMessage message; + message.iType = EFillBufferCallback; + message.iComponent = aComponent; + message.iBuffer = aBuffer; + return RAsyncTestStepOmxILComponentBase::ConvertSymbianErrorType( + iMsgQueue.Send(message)); + + } + +OMX_ERRORTYPE +CCallbackHandler::DoEmptyBufferDone(OMX_HANDLETYPE aComponent, + OMX_BUFFERHEADERTYPE* aBuffer) + { + DEBUG_PRINTF(_L8("CCallbackHandler::DoEmptyBufferDone")); + + TOmxMessage message; + message.iType = EEmptyBufferCallback; + message.iComponent = aComponent; + message.iBuffer = aBuffer; + return RAsyncTestStepOmxILComponentBase::ConvertSymbianErrorType( + iMsgQueue.Send(message)); + + } + +OMX_ERRORTYPE +CCallbackHandler::DoEventHandler(OMX_HANDLETYPE aComponent, + TEventParams aEventParams) + { + DEBUG_PRINTF(_L8("CCallbackHandler::DoEventHandler")); + + TOmxMessage message; + message.iType = EEventCallback; + message.iComponent = aComponent; + message.iEventParams = aEventParams; + return RAsyncTestStepOmxILComponentBase::ConvertSymbianErrorType( + iMsgQueue.Send(message)); + + } + +// +// RAsyncTestStepOmxILComponentBase +// +RAsyncTestStepOmxILComponentBase::RAsyncTestStepOmxILComponentBase(const TDesC& aTestName, TInt aComponentUid) + : + iComponentUid(), + ipKickoffAOp(0), + ipKickoffStop(0), + ipCOmxILComponent(0), + ipCallbackHandler(0), + ipTestFile(0), + iTestFileName(KAacDecoderTestFile()), + ipCompHandle(0) + { + DEBUG_PRINTF2(_L8("RAsyncTestStepOmxILComponentBase::RAsyncTestStepOmxILComponentBase: UID[%X]"), aComponentUid); + iTestStepName = aTestName; + iComponentUid = aComponentUid; + // Default heap size is 32K. Increased to avoid the KErrNoMemory for this test step. + iHeapSize = KTestHeapSize; + + } + +RAsyncTestStepOmxILComponentBase::~RAsyncTestStepOmxILComponentBase() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::~RAsyncTestStepOmxILComponentBase")); + // nothing here just yet + } + +void +RAsyncTestStepOmxILComponentBase::PrintOmxState(OMX_STATETYPE aOmxState) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::PrintOmxState")); + + switch(aOmxState) + { + case OMX_StateInvalid: + { + INFO_PRINTF1(_L("OMX STATE : OMX_StateInvalid")); + } + break; + case OMX_StateLoaded: + { + INFO_PRINTF1(_L("OMX STATE : OMX_StateLoaded")); + } + break; + case OMX_StateIdle: + { + INFO_PRINTF1(_L("OMX STATE : OMX_StateIdle")); + } + break; + case OMX_StateExecuting: + { + INFO_PRINTF1(_L("OMX STATE : OMX_StateExecuting")); + } + break; + case OMX_StatePause: + { + INFO_PRINTF1(_L("OMX STATE : OMX_StatePause")); + } + break; + case OMX_StateWaitForResources: + { + INFO_PRINTF1(_L("OMX STATE : OMX_StateWaitForResources")); + } + break; + default: + { + INFO_PRINTF1(_L("OMX STATE : Wrong state found")); + } + }; + + } + +OMX_ERRORTYPE +RAsyncTestStepOmxILComponentBase::ConvertSymbianErrorType(TInt aError) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::ConvertSymbianErrorType")); + + OMX_ERRORTYPE err = OMX_ErrorNone; + switch (aError) + { + case KErrNone: + err = OMX_ErrorNone; + break; + case KErrNoMemory: + err = OMX_ErrorInsufficientResources; + break; + case KErrGeneral: + break; + default: + err = OMX_ErrorUndefined; + } + return err; + + } + + +/** + This method is used at the beginning of the test, and initialises the + asynchronous calls that will be activated once the call returns. The + ActiveScheduler is active at this point. If this test leaves, then + StopTest() will be called with the leave value, so implicitly the test + stops. + +*/ +void +RAsyncTestStepOmxILComponentBase::KickoffTestL() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::KickoffTestL")); + + __MM_HEAP_MARK; + + // Set up an asynchronous call + TCallBack callback (ComponentBaseCallBack, this); + delete ipKickoffAOp; + ipKickoffAOp = NULL; + ipKickoffAOp = + new (ELeave) CAsyncCallBack (callback, CActive::EPriorityLow); + // Queues this active object to be run once. + ipKickoffAOp->Call(); + + } + +TInt +RAsyncTestStepOmxILComponentBase::ComponentBaseCallBack(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::ComponentBaseCallBack")); + + RAsyncTestStepOmxILComponentBase* self = static_cast (aPtr); + self->DoComponentBaseCallBack(); + return KErrNone; + + } + +void +RAsyncTestStepOmxILComponentBase::DoComponentBaseCallBack() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::DoComponentBaseCallBack")); + + TRAPD(err, ipCOmxILComponent = + COmxILComponentIf::CreateImplementationL(TUid::Uid(iComponentUid))); + + //return StopTest(err, EFail); + if (err != KErrNone) + { + INFO_PRINTF2(_L("RAsyncTestStepOmxILComponentBase::DoComponentBaseCallBack : err [%d]"), err); + if (KErrNotFound == err) + { + INFO_PRINTF1(_L("DoComponentBaseCallBack : CreateImplementationL returned KErrNotFound")); +// PacketVideo's AAC decoder libraries only provided for UDEB +#ifndef _DEBUG + INFO_PRINTF1(_L("IMPORTANT NOTE : THIS SUITE CAN ONLY BE RUN IN UDEB MODE")); + INFO_PRINTF1(_L("IMPORTANT NOTE : PACKETVIDEO'S AAC DECODER LIBRARY ONLY AVAILABLE IN UDEB MODE")); +#endif + } + return StopTest(err, EFail); + } + + ipCompHandle = static_cast(ipCOmxILComponent->Handle()); + if (!ipCompHandle) + { + return StopTest(KErrGeneral, EFail); + } + + TRAP(err, ipCallbackHandler = CCallbackHandler::NewL(*this)); + if (err != KErrNone) + { + return StopTest(err, EFail); + } + + TRAP(err, ipTestFile = CAacTestFile::NewL()); + if (err != KErrNone) + { + return StopTest(err, EFail); + } + + err = ipTestFile->ReadTestFileInBuffer(iTestFileName); + if (err != KErrNone) + { + return StopTest(err, EFail); + } + + TRAP(err, ipOutputTestFile = CAacOutputTestFile::NewL()); + if (err != KErrNone) + { + return StopTest(err, EFail); + } + + err = ipOutputTestFile->SetUpOutputFile(KAacDecoderOutputTestFile); + if (err != KErrNone) + { + return StopTest(err, EFail); + } + + + } + +TInt +RAsyncTestStepOmxILComponentBase::StopTestCallBack(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::StopTestCallBack")); + RAsyncTestStepOmxILComponentBase* self = + static_cast (aPtr); + self->DoStopTestCallBack(); + return KErrNone; + } + +void +RAsyncTestStepOmxILComponentBase::DoStopTestCallBack() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::DoStopTestCallBack")); + + StopTest(); + + } + + +void +RAsyncTestStepOmxILComponentBase::CloseTest() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::CloseTest")); + + if (ipCompHandle) + { + ipCompHandle->ComponentDeInit(ipCompHandle); + } + delete ipCOmxILComponent; + ipCOmxILComponent = 0; + ipCompHandle = 0; + + delete ipKickoffAOp; // no need to Cancel + ipKickoffAOp = 0; + + delete ipCallbackHandler; + ipCallbackHandler = 0; + + delete ipTestFile; + ipTestFile = 0; + + if (ipOutputTestFile) + { + ipOutputTestFile->CloseOutputFile(); + // We ignore here this error... + TInt err = ipOutputTestFile->AddWavHeader(); + delete ipOutputTestFile; + ipOutputTestFile = 0; + } + + REComSession::FinalClose(); + __MM_HEAP_MARKEND; + + } + +void +RAsyncTestStepOmxILComponentBase::DoFillBufferDoneL(OMX_HANDLETYPE /* aComponent */, + OMX_BUFFERHEADERTYPE* /* aBuffer */) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::DoFillBufferDoneL")); + // By default, no callback expected here... + return StopTest(KErrGeneral, EFail); + } + +void +RAsyncTestStepOmxILComponentBase::DoEmptyBufferDoneL(OMX_HANDLETYPE /* aComponent */, + OMX_BUFFERHEADERTYPE* /* aBuffer */) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILComponentBase::DoEmptyBufferDoneL")); + // By default, no callback expected here... + return StopTest(KErrGeneral, EFail); + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/components/src/tsu_omxil_component_base.h --- a/omxil/omxilunittest/components/src/tsu_omxil_component_base.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/components/src/tsu_omxil_component_base.h Fri May 07 16:25:23 2010 +0100 @@ -1,273 +1,273 @@ -// 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 tsu_omxil_component_base.h -*/ - -#ifndef TSU_OMXIL_COMPONENT_BASE_H -#define TSU_OMXIL_COMPONENT_BASE_H - -#include -#include -#include - -#include "tsu_omxil_component_constants.h" - -// Forward declarations -class COmxILComponentIf; -struct OMX_COMPONENTTYPE; -class RAsyncTestStepOmxILComponentBase; -class CMMFBuffer; - - -class CAacTestFile : public CBase - { - -public: - - static CAacTestFile* NewL(); - - ~CAacTestFile(); - - TInt ReadTestFileInBuffer(const TDesC& aFileName); - void ReadNextBuffer(CMMFBuffer& aDataBuffer); - void ResetPos(); - TInt GetPos(); - -private: - - CAacTestFile(); - void ConstructL(); - - -private: - - HBufC8* iSourceFile; - TInt iSourceFileReadPos; - TBool iFinished; - - }; - - -class CAacOutputTestFile : public CBase - { - -public: - - static CAacOutputTestFile* NewL(); - - ~CAacOutputTestFile(); - - TInt SetUpOutputFile(const TDesC& aFileName); - TInt WriteDataToFile(const CMMFBuffer& aDataBuffer); - TInt AddWavHeader(); - void CloseOutputFile(); - -private: - - CAacOutputTestFile(); - void ConstructL(); - - -private: - - RFs iFileServerSession; - RFile iOutputFile; - TInt iWrittenDataTotal; - TInt iBuffersWrittenCount; - - }; - -class MTimerObserver - { - -public: - - virtual void TimerExpired() = 0; - - }; - -class CUtilityTimer : public CTimer - { - -public: - - static CUtilityTimer* NewL(TTimeIntervalMicroSeconds32& aDelay, - MTimerObserver& aObserver); - ~CUtilityTimer(); - - void InitializeTimer(); - -private: - - CUtilityTimer(MTimerObserver& aObserver); - void ConstructL(TTimeIntervalMicroSeconds32& aDelay); - - // from CActive - void RunL(); - void DoCancel(); - -private: - - TTimeIntervalMicroSeconds32 iDelay; - MTimerObserver& iObserver; - - }; - - -class CCallbackHandler : public CActive - { -public: - - enum TMessageType - { - EFillBufferCallback, - EEmptyBufferCallback, - EEventCallback - }; - - class TEventParams - { - public: - OMX_EVENTTYPE iEvent; - TUint iData1; - TUint iData2; - TAny* iExtra; - }; - - class TOmxMessage - { - public: - TMessageType iType; - OMX_HANDLETYPE iComponent; - union - { - OMX_BUFFERHEADERTYPE* iBuffer; - TEventParams iEventParams; - }; - }; - - - static const TInt KMaxMsgQueueEntries = 10; - -public: - - static CCallbackHandler* NewL(RAsyncTestStepOmxILComponentBase& aDecoderTest); - virtual ~CCallbackHandler(); - - operator OMX_CALLBACKTYPE*(); - - void RunL(); - void DoCancel(); - - static OMX_ERRORTYPE FillBufferDone(OMX_HANDLETYPE aComponent, - TAny* aAppData, - OMX_BUFFERHEADERTYPE* aBuffer); - - static OMX_ERRORTYPE EmptyBufferDone(OMX_HANDLETYPE aComponent, - TAny* aAppData, - OMX_BUFFERHEADERTYPE* aBuffer); - - static OMX_ERRORTYPE EventHandler(OMX_HANDLETYPE aComponent, - TAny* aAppData, - OMX_EVENTTYPE aEvent, - TUint32 aData1, - TUint32 aData2, - TAny* aExtra); - - -private: - - void ConstructL(); - CCallbackHandler(RAsyncTestStepOmxILComponentBase& aDecoderTest); - - OMX_ERRORTYPE DoFillBufferDone(OMX_HANDLETYPE aComponent, - OMX_BUFFERHEADERTYPE* aBuffer); - OMX_ERRORTYPE DoEmptyBufferDone(OMX_HANDLETYPE aComponent, - OMX_BUFFERHEADERTYPE* aBuffer); - OMX_ERRORTYPE DoEventHandler(OMX_HANDLETYPE aComponent, - TEventParams aParams); - - // - // - // - - -private: - - RAsyncTestStepOmxILComponentBase& iDecoderTest; - RMsgQueue iMsgQueue; - OMX_CALLBACKTYPE iHandle; - - }; - - -class RAsyncTestStepOmxILComponentBase : public RAsyncTestStep - { - -public: - - RAsyncTestStepOmxILComponentBase(const TDesC& aTestName, TInt aComponentUid); - - ~RAsyncTestStepOmxILComponentBase(); - - // From RAsyncTestStep - void KickoffTestL(); - void CloseTest(); - - // - virtual void DoFillBufferDoneL(OMX_HANDLETYPE aComponent, - OMX_BUFFERHEADERTYPE* aBuffer); - - virtual void DoEmptyBufferDoneL(OMX_HANDLETYPE aComponent, - OMX_BUFFERHEADERTYPE* aBuffer); - - virtual void DoEventHandlerL(OMX_HANDLETYPE aComponent, - OMX_EVENTTYPE aEvent, - TUint aData1, - TUint aData2, - TAny* aExtra) = 0; - - - static OMX_ERRORTYPE ConvertSymbianErrorType(TInt aError); - - - -protected: - - void PrintOmxState(OMX_STATETYPE aOmxState); - - // Async Call backs - static TInt ComponentBaseCallBack(TAny* aPtr); - void DoComponentBaseCallBack(); - - static TInt StopTestCallBack(TAny* aPtr); - void DoStopTestCallBack(); - -protected: - - TInt iComponentUid; - CAsyncCallBack* ipKickoffAOp; - CAsyncCallBack* ipKickoffStop; - COmxILComponentIf* ipCOmxILComponent; - CCallbackHandler* ipCallbackHandler; - CAacTestFile* ipTestFile; - TPtrC iTestFileName; - CAacOutputTestFile* ipOutputTestFile; - OMX_COMPONENTTYPE* ipCompHandle; - }; - -#endif // TSU_OMXIL_COMPONENT_BASE_H +// 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 tsu_omxil_component_base.h +*/ + +#ifndef TSU_OMXIL_COMPONENT_BASE_H +#define TSU_OMXIL_COMPONENT_BASE_H + +#include +#include +#include + +#include "tsu_omxil_component_constants.h" + +// Forward declarations +class COmxILComponentIf; +struct OMX_COMPONENTTYPE; +class RAsyncTestStepOmxILComponentBase; +class CMMFBuffer; + + +class CAacTestFile : public CBase + { + +public: + + static CAacTestFile* NewL(); + + ~CAacTestFile(); + + TInt ReadTestFileInBuffer(const TDesC& aFileName); + void ReadNextBuffer(CMMFBuffer& aDataBuffer); + void ResetPos(); + TInt GetPos(); + +private: + + CAacTestFile(); + void ConstructL(); + + +private: + + HBufC8* iSourceFile; + TInt iSourceFileReadPos; + TBool iFinished; + + }; + + +class CAacOutputTestFile : public CBase + { + +public: + + static CAacOutputTestFile* NewL(); + + ~CAacOutputTestFile(); + + TInt SetUpOutputFile(const TDesC& aFileName); + TInt WriteDataToFile(const CMMFBuffer& aDataBuffer); + TInt AddWavHeader(); + void CloseOutputFile(); + +private: + + CAacOutputTestFile(); + void ConstructL(); + + +private: + + RFs iFileServerSession; + RFile iOutputFile; + TInt iWrittenDataTotal; + TInt iBuffersWrittenCount; + + }; + +class MTimerObserver + { + +public: + + virtual void TimerExpired() = 0; + + }; + +class CUtilityTimer : public CTimer + { + +public: + + static CUtilityTimer* NewL(TTimeIntervalMicroSeconds32& aDelay, + MTimerObserver& aObserver); + ~CUtilityTimer(); + + void InitializeTimer(); + +private: + + CUtilityTimer(MTimerObserver& aObserver); + void ConstructL(TTimeIntervalMicroSeconds32& aDelay); + + // from CActive + void RunL(); + void DoCancel(); + +private: + + TTimeIntervalMicroSeconds32 iDelay; + MTimerObserver& iObserver; + + }; + + +class CCallbackHandler : public CActive + { +public: + + enum TMessageType + { + EFillBufferCallback, + EEmptyBufferCallback, + EEventCallback + }; + + class TEventParams + { + public: + OMX_EVENTTYPE iEvent; + TUint iData1; + TUint iData2; + TAny* iExtra; + }; + + class TOmxMessage + { + public: + TMessageType iType; + OMX_HANDLETYPE iComponent; + union + { + OMX_BUFFERHEADERTYPE* iBuffer; + TEventParams iEventParams; + }; + }; + + + static const TInt KMaxMsgQueueEntries = 10; + +public: + + static CCallbackHandler* NewL(RAsyncTestStepOmxILComponentBase& aDecoderTest); + virtual ~CCallbackHandler(); + + operator OMX_CALLBACKTYPE*(); + + void RunL(); + void DoCancel(); + + static OMX_ERRORTYPE FillBufferDone(OMX_HANDLETYPE aComponent, + TAny* aAppData, + OMX_BUFFERHEADERTYPE* aBuffer); + + static OMX_ERRORTYPE EmptyBufferDone(OMX_HANDLETYPE aComponent, + TAny* aAppData, + OMX_BUFFERHEADERTYPE* aBuffer); + + static OMX_ERRORTYPE EventHandler(OMX_HANDLETYPE aComponent, + TAny* aAppData, + OMX_EVENTTYPE aEvent, + TUint32 aData1, + TUint32 aData2, + TAny* aExtra); + + +private: + + void ConstructL(); + CCallbackHandler(RAsyncTestStepOmxILComponentBase& aDecoderTest); + + OMX_ERRORTYPE DoFillBufferDone(OMX_HANDLETYPE aComponent, + OMX_BUFFERHEADERTYPE* aBuffer); + OMX_ERRORTYPE DoEmptyBufferDone(OMX_HANDLETYPE aComponent, + OMX_BUFFERHEADERTYPE* aBuffer); + OMX_ERRORTYPE DoEventHandler(OMX_HANDLETYPE aComponent, + TEventParams aParams); + + // + // + // + + +private: + + RAsyncTestStepOmxILComponentBase& iDecoderTest; + RMsgQueue iMsgQueue; + OMX_CALLBACKTYPE iHandle; + + }; + + +class RAsyncTestStepOmxILComponentBase : public RAsyncTestStep + { + +public: + + RAsyncTestStepOmxILComponentBase(const TDesC& aTestName, TInt aComponentUid); + + ~RAsyncTestStepOmxILComponentBase(); + + // From RAsyncTestStep + void KickoffTestL(); + void CloseTest(); + + // + virtual void DoFillBufferDoneL(OMX_HANDLETYPE aComponent, + OMX_BUFFERHEADERTYPE* aBuffer); + + virtual void DoEmptyBufferDoneL(OMX_HANDLETYPE aComponent, + OMX_BUFFERHEADERTYPE* aBuffer); + + virtual void DoEventHandlerL(OMX_HANDLETYPE aComponent, + OMX_EVENTTYPE aEvent, + TUint aData1, + TUint aData2, + TAny* aExtra) = 0; + + + static OMX_ERRORTYPE ConvertSymbianErrorType(TInt aError); + + + +protected: + + void PrintOmxState(OMX_STATETYPE aOmxState); + + // Async Call backs + static TInt ComponentBaseCallBack(TAny* aPtr); + void DoComponentBaseCallBack(); + + static TInt StopTestCallBack(TAny* aPtr); + void DoStopTestCallBack(); + +protected: + + TInt iComponentUid; + CAsyncCallBack* ipKickoffAOp; + CAsyncCallBack* ipKickoffStop; + COmxILComponentIf* ipCOmxILComponent; + CCallbackHandler* ipCallbackHandler; + CAacTestFile* ipTestFile; + TPtrC iTestFileName; + CAacOutputTestFile* ipOutputTestFile; + OMX_COMPONENTTYPE* ipCompHandle; + }; + +#endif // TSU_OMXIL_COMPONENT_BASE_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/components/src/tsu_omxil_component_constants.h --- a/omxil/omxilunittest/components/src/tsu_omxil_component_constants.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/components/src/tsu_omxil_component_constants.h Fri May 07 16:25:23 2010 +0100 @@ -1,51 +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: -// - -/** - @file tsu_omxil_component_constants.h -*/ - -#ifndef TSU_OMXIL_COMPONENT_CONSTANTS_H -#define TSU_OMXIL_COMPONENT_CONSTANTS_H - -_LIT(KAacDecoderTestFile, "c:\\omxil\\testfiles\\probando123.hev2.aac"); -_LIT(KAacDecoderOutputTestFile, "c:\\omxil\\testfiles\\omxilaacdecoderoutput.wav"); - -const TInt KTestHeapSize = 0x400000; // 4 Mb; - -// AudioSpecificConfig length (bytes) for probando123.hev2.aac -const TInt KAudioSpecificConfigLength = 7; - -// Wav header params... based on probando123.hev2.aac... -const TInt KTestWavFormatPCMChunkHeaderSize = 36; -const TInt KTestWavFormatPCMSubchunk1Size = 16; -const TInt KTestAudioFormatPCM = 1; -const TInt KTestSampleRate = 44100; -const TInt KTestNumChannels = 2; -const TInt KTestBitsPerSample = 16; -const TInt KTestBitRate = 1411000; - -// These are two numbers that identify some input/output buffers in the middle -// of the processing of a test file -const TInt KSomeInputBufferCount = 15; -const TInt KSomeOutputBufferCount = 25; - -// Some time interval that can be used for timeouts... -const TInt KTwoPointFiveSeconds = 2500000; - -// Some other time interval that can be used for timeouts... -const TInt KPointFiveSeconds = 500000; - -#endif // TSU_OMXIL_COMPONENT_CONSTANTS_H +// 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 tsu_omxil_component_constants.h +*/ + +#ifndef TSU_OMXIL_COMPONENT_CONSTANTS_H +#define TSU_OMXIL_COMPONENT_CONSTANTS_H + +_LIT(KAacDecoderTestFile, "c:\\omxil\\testfiles\\probando123.hev2.aac"); +_LIT(KAacDecoderOutputTestFile, "c:\\omxil\\testfiles\\omxilaacdecoderoutput.wav"); + +const TInt KTestHeapSize = 0x400000; // 4 Mb; + +// AudioSpecificConfig length (bytes) for probando123.hev2.aac +const TInt KAudioSpecificConfigLength = 7; + +// Wav header params... based on probando123.hev2.aac... +const TInt KTestWavFormatPCMChunkHeaderSize = 36; +const TInt KTestWavFormatPCMSubchunk1Size = 16; +const TInt KTestAudioFormatPCM = 1; +const TInt KTestSampleRate = 44100; +const TInt KTestNumChannels = 2; +const TInt KTestBitsPerSample = 16; +const TInt KTestBitRate = 1411000; + +// These are two numbers that identify some input/output buffers in the middle +// of the processing of a test file +const TInt KSomeInputBufferCount = 15; +const TInt KSomeOutputBufferCount = 25; + +// Some time interval that can be used for timeouts... +const TInt KTwoPointFiveSeconds = 2500000; + +// Some other time interval that can be used for timeouts... +const TInt KPointFiveSeconds = 500000; + +#endif // TSU_OMXIL_COMPONENT_CONSTANTS_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/components/src/tsu_omxil_pcmrenderer_step.cpp --- a/omxil/omxilunittest/components/src/tsu_omxil_pcmrenderer_step.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/components/src/tsu_omxil_pcmrenderer_step.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,3978 +1,3977 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// - -/** - @file - @internalComponent -*/ - -#include -#include -#include -#include - -#include -#include - -#include -#include "omxilsymbianaudiopcmextensions.h" - -#include "log.h" -#include "omxilpcmrenderer.hrh" -#include "omxilspecversion.h" - -#include "tsu_omxil_pcmrenderer_step.h" - -_LIT8(KSymbianOmxILPcmRendererRole, "audio_renderer.pcm"); -_LIT8(KTestOmxILWrongRendererRole, "audio_renderer.wrong"); -_LIT(KPcmRendererTestFile, "c:\\omxil\\testfiles\\pcm16stereo8khz.raw"); -_LIT(KPcmRendererTestFile2, "c:\\omxil\\testfiles\\pcm16stereo44khz.raw"); - -OMX_ERRORTYPE ComponentInit(OMX_HANDLETYPE /*aComponent*/) - { - return OMX_ErrorNone; - } - - -// -// RAsyncTestStepOmxILPcmRenderer0020 -// -RAsyncTestStepOmxILPcmRenderer0020::RAsyncTestStepOmxILPcmRenderer0020(const TDesC& aTestName, TInt aComponentUid) - : - RAsyncTestStepOmxILComponentBase(aTestName, aComponentUid), - ipKickoff01(NULL), - ipKickoff02(NULL), - ipKickoff03(NULL), - ipKickoff04(NULL), - ipKickoff05(NULL), - ipKickoff06(NULL) - - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0020::RAsyncTestStepOmxILPcmRenderer0020")); - } - - -void -RAsyncTestStepOmxILPcmRenderer0020::KickoffTestL() - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0020::KickoffTestL")); - - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test20 ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Init Component ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Obtain the component's state (GetState) ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Obtain the component's version (GetComponentVersion) ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Provide callbacks to component (SetCallbacks) ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 5.- Obtain the port def params for Port #0 (GetParameter) ")); - - // This will install one callback - RAsyncTestStepOmxILComponentBase::KickoffTestL(); - - // This is the only step in this test... - TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0020Step01, this); - delete ipKickoff01; - ipKickoff01 = NULL; - ipKickoff01 = - new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); - ipKickoff01->Call(); - - // The successful termination... - TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this); - delete ipKickoffStop; - ipKickoffStop = NULL; - ipKickoffStop = - new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow); - ipKickoffStop->Call(); - - } - -void -RAsyncTestStepOmxILPcmRenderer0020::CloseTest() - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0020::CloseTest")); - - delete ipKickoff01; // no need to Cancel - ipKickoff01 = NULL; - delete ipKickoff02; // no need to Cancel - ipKickoff02 = NULL; - delete ipKickoff03; // no need to Cancel - ipKickoff03 = NULL; - delete ipKickoff04; // no need to Cancel - ipKickoff04 = NULL; - delete ipKickoff05; // no need to Cancel - ipKickoff05 = NULL; - delete ipKickoff06; // no need to Cancel - ipKickoff06 = NULL; - - delete ipKickoffStop; // no need to Cancel - ipKickoffStop = 0; - - RAsyncTestStepOmxILComponentBase::CloseTest(); - - } - - -void -RAsyncTestStepOmxILPcmRenderer0020::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/, - OMX_EVENTTYPE /*aEvent*/, - TUint /*aData1*/, - TUint /*aData2*/, - TAny* /*aExtra*/) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0020::DoEventHandlerL")); - - // We don't expect here any callback - return StopTest(KErrGeneral, EFail); - - } - - -TInt -RAsyncTestStepOmxILPcmRenderer0020::RAsyncTestStepOmxILPcmRenderer0020Step01(TAny* aPtr) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0020::RAsyncTestStepOmxILPcmRenderer0020Step01")); - RAsyncTestStepOmxILPcmRenderer0020* self = - static_cast (aPtr); - self->DoRAsyncTestStepOmxILPcmRenderer0020Step01(); - return KErrNone; - } - -void -RAsyncTestStepOmxILPcmRenderer0020::DoRAsyncTestStepOmxILPcmRenderer0020Step01() - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0020::DoRAsyncTestStepOmxILPcmRenderer0020Step01")); - - - // - // Obtain the component's state - // - OMX_STATETYPE compState; - if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, - &compState)) - { - return StopTest(KErrGeneral, EFail); - } - - PrintOmxState(compState); - - if (OMX_StateLoaded != compState) - { - return StopTest(KErrGeneral, EFail); - } - - char componentNameArray[OMX_MAX_STRINGNAME_SIZE]; - OMX_VERSIONTYPE componentVersion; - OMX_VERSIONTYPE specVersion; - OMX_UUIDTYPE componentUUID; - - // - // Obtain the component's version - // - - if (OMX_ErrorNone != ipCompHandle->GetComponentVersion( - ipCompHandle, - componentNameArray, - &componentVersion, - &specVersion, - &componentUUID)) - { - return StopTest(KErrGeneral, EFail); - } - - TBuf8<128> componentNameBuf8; - componentNameBuf8 = const_cast(reinterpret_cast(componentNameArray)); - TBuf<128> componentNameBuf16; - INFO_PRINTF2(_L("Component Name length: %d"), componentNameBuf8.Length()); - componentNameBuf16.Copy(componentNameBuf8); - componentNameBuf16.PtrZ(); - - // INFO_PRINTF2(_L("Component Name: %s"), dst.Ptr()); - INFO_PRINTF2(_L("Component Name: %S"), &componentNameBuf16); - INFO_PRINTF2(_L("Component Version Major: %d"), componentVersion.s.nVersionMajor); - INFO_PRINTF2(_L("Component Version Minor: %d"), componentVersion.s.nVersionMinor); - INFO_PRINTF2(_L("Component Version Revision: %d"), componentVersion.s.nRevision); - INFO_PRINTF2(_L("Component Version Step: %d"), componentVersion.s.nStep); - INFO_PRINTF2(_L("OMX Version Major: %d"), specVersion.s.nVersionMajor); - INFO_PRINTF2(_L("OMX Version Minor: %d"), specVersion.s.nVersionMinor); - INFO_PRINTF2(_L("OMX Version Revision: %d"), specVersion.s.nRevision); - INFO_PRINTF2(_L("OMX Version Step: %d"), specVersion.s.nStep); - INFO_PRINTF2(_L("Component UUID: %X"), componentUUID); - - - // - // Provide callbacks to component - // - OMX_CALLBACKTYPE* omxCallbacks = *ipCallbackHandler; - - if (OMX_ErrorNone != ipCompHandle->SetCallbacks( - ipCompHandle, - omxCallbacks, - ipCallbackHandler)) - { - return StopTest(KErrGeneral, EFail); - } - - INFO_PRINTF2(_L("Component Callbacks set successfully: %X"), ipCallbackHandler); - - // - // Obtain the port def params for Port #0 - // - OMX_PARAM_PORTDEFINITIONTYPE portParamsInputPort; - portParamsInputPort.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE); - portParamsInputPort.nVersion = TOmxILSpecVersion(); - portParamsInputPort.nPortIndex = 0; - if (OMX_ErrorNone != ipCompHandle->GetParameter( - ipCompHandle, - OMX_IndexParamPortDefinition, - &portParamsInputPort)) - { - return StopTest(KErrGeneral, EFail); - } - - INFO_PRINTF2(_L("PORTDEFINITIONTYPE nPortIndex: %d"), portParamsInputPort.nPortIndex); - INFO_PRINTF2(_L("PORTDEFINITIONTYPE eDir: %d"), portParamsInputPort.eDir); - INFO_PRINTF2(_L("PORTDEFINITIONTYPE nBufferCountActual: %d"), portParamsInputPort.nBufferCountActual); - INFO_PRINTF2(_L("PORTDEFINITIONTYPE nBufferCountMin: %d"), portParamsInputPort.nBufferCountMin); - INFO_PRINTF2(_L("PORTDEFINITIONTYPE nBufferSize: %d"), portParamsInputPort.nBufferSize); - INFO_PRINTF2(_L("PORTDEFINITIONTYPE bEnabled: %d"), portParamsInputPort.bEnabled == OMX_FALSE ? 0 : 1); - INFO_PRINTF2(_L("PORTDEFINITIONTYPE bPopulated: %d"), portParamsInputPort.bPopulated == OMX_FALSE ? 0 : 1); - INFO_PRINTF2(_L("PORTDEFINITIONTYPE eDomain: %d"), portParamsInputPort.eDomain); - - TBuf8<128> cMIMEType8Input; - cMIMEType8Input = const_cast(reinterpret_cast(portParamsInputPort.format.audio.cMIMEType)); - - TBuf<128> cMIMEType16Input; - cMIMEType16Input.Copy(cMIMEType8Input); - cMIMEType16Input.PtrZ(); - - INFO_PRINTF2(_L("PORTDEFINITIONTYPE format.cMIMEType: %S"), &cMIMEType16Input); - INFO_PRINTF2(_L("PORTDEFINITIONTYPE format.pNativeRender: %X"), portParamsInputPort.format.audio.pNativeRender); - INFO_PRINTF2(_L("PORTDEFINITIONTYPE format.bFlagErrorConcealment: %d"), - portParamsInputPort.format.audio.bFlagErrorConcealment == OMX_FALSE ? 0 : 1); - INFO_PRINTF2(_L("PORTDEFINITIONTYPE format.eEncoding: %d"), portParamsInputPort.format.audio.eEncoding); - INFO_PRINTF2(_L("PORTDEFINITIONTYPE bBuffersContiguous: %d"), - portParamsInputPort.bBuffersContiguous == OMX_FALSE ? 0 : 1); - INFO_PRINTF2(_L("PORTDEFINITIONTYPE nBufferAlignment: %d"), portParamsInputPort.nBufferAlignment); - } - -// -// RAsyncTestStepOmxILPcmRenderer0021 -// -RAsyncTestStepOmxILPcmRenderer0021::RAsyncTestStepOmxILPcmRenderer0021(const TDesC& aTestName, TInt aComponentUid) - : - RAsyncTestStepOmxILComponentBase(aTestName, aComponentUid), - ipKickoff01(NULL), - ipKickoff02(NULL), - ipKickoff03(NULL), - ipKickoff04(NULL), - ipKickoff05(NULL), - ipKickoff06(NULL) - - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0021::RAsyncTestStepOmxILPcmRenderer0021")); - } - - -void -RAsyncTestStepOmxILPcmRenderer0021::KickoffTestL() - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0021::KickoffTestL")); - - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test21 ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Init Component ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Provide callbacks to component (SetCallbacks) ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Obtain the component's state (GetState) ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Obtain component's role #1 with null string (ComponentRoleEnum fails with OMX_ErrorBadParameter) ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 5.- Obtain component's role #1 (ComponentRoleEnum returns audio_renderer.pcm) ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 6.- Obtain component's role #2 (ComponentRoleEnum fails with OMX_ErrorNoMore) ")); - - // This will install one callback - RAsyncTestStepOmxILComponentBase::KickoffTestL(); - - // This is the only step in this test... - TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0021Step01, this); - delete ipKickoff01; - ipKickoff01 = NULL; - ipKickoff01 = - new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); - ipKickoff01->Call(); - - // The successful termination... - TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this); - delete ipKickoffStop; - ipKickoffStop = NULL; - ipKickoffStop = - new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow); - ipKickoffStop->Call(); - - } - -void -RAsyncTestStepOmxILPcmRenderer0021::CloseTest() - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0021::CloseTest")); - - delete ipKickoff01; // no need to Cancel - ipKickoff01 = NULL; - delete ipKickoff02; // no need to Cancel - ipKickoff02 = NULL; - delete ipKickoff03; // no need to Cancel - ipKickoff03 = NULL; - delete ipKickoff04; // no need to Cancel - ipKickoff04 = NULL; - delete ipKickoff05; // no need to Cancel - ipKickoff05 = NULL; - delete ipKickoff06; // no need to Cancel - ipKickoff06 = NULL; - - delete ipKickoffStop; // no need to Cancel - ipKickoffStop = 0; - - RAsyncTestStepOmxILComponentBase::CloseTest(); - - } - - -void -RAsyncTestStepOmxILPcmRenderer0021::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/, - OMX_EVENTTYPE /*aEvent*/, - TUint /*aData1*/, - TUint /*aData2*/, - TAny* /*aExtra*/) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0021::DoEventHandlerL")); - - // We don't expect here any callback - return StopTest(KErrGeneral, EFail); - - } - - -TInt -RAsyncTestStepOmxILPcmRenderer0021::RAsyncTestStepOmxILPcmRenderer0021Step01(TAny* aPtr) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0021::RAsyncTestStepOmxILPcmRenderer0021Step01")); - RAsyncTestStepOmxILPcmRenderer0021* self = - static_cast (aPtr); - self->DoRAsyncTestStepOmxILPcmRenderer0021Step01(); - return KErrNone; - } - -void -RAsyncTestStepOmxILPcmRenderer0021::DoRAsyncTestStepOmxILPcmRenderer0021Step01() - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0021::DoRAsyncTestStepOmxILPcmRenderer0021Step01")); - - // - // Provide callbacks to component - // - OMX_CALLBACKTYPE* omxCallbacks = *ipCallbackHandler; - - if (OMX_ErrorNone != ipCompHandle->SetCallbacks( - ipCompHandle, - omxCallbacks, - ipCallbackHandler)) - { - return StopTest(KErrGeneral, EFail); - } - - // - // Obtain the component's state - // - OMX_STATETYPE compState; - if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, - &compState)) - { - return StopTest(KErrGeneral, EFail); - } - - PrintOmxState(compState); - - if (OMX_StateLoaded != compState) - { - return StopTest(KErrGeneral, EFail); - } - - INFO_PRINTF2(_L("Component Callbacks set successfully: %X"), ipCallbackHandler); - - - // - // Try to obtain the component's first role with null string (must fail with error OMX_ErrorBadParameter) - // - OMX_U8* pNullUint = 0; - if (OMX_ErrorBadParameter != ipCompHandle->ComponentRoleEnum( - ipCompHandle, - pNullUint, - 0 // This is index # 0, the first of the component's roles - )) - { - return StopTest(KErrGeneral, EFail); - } - - // - // Obtain the component's first role (success) - // - char componentRoleArray[OMX_MAX_STRINGNAME_SIZE]; - if (OMX_ErrorNone != ipCompHandle->ComponentRoleEnum( - ipCompHandle, - reinterpret_cast(componentRoleArray), - 0 // This is index # 0, the first of the component's roles - )) - { - return StopTest(KErrGeneral, EFail); - } - - TBuf8<128> componentRoleBuf8; - componentRoleBuf8 = const_cast(reinterpret_cast(componentRoleArray)); - TBuf<128> componentRoleBuf16; - INFO_PRINTF2(_L("Component's Role length: %d"), componentRoleBuf8.Length()); - componentRoleBuf16.Copy(componentRoleBuf8); - componentRoleBuf16.PtrZ(); - - INFO_PRINTF2(_L("Component's 1st Role [%S] "), &componentRoleBuf16); - - if (componentRoleBuf8.Compare(KSymbianOmxILPcmRendererRole()) != 0) - { - return StopTest(KErrGeneral, EFail); - } - - // - // Obtain the component's second role (must fail with error OMX_ErrorNoMore) - // - if (OMX_ErrorNoMore != ipCompHandle->ComponentRoleEnum( - ipCompHandle, - reinterpret_cast(componentRoleArray), - 1 // This is index # 1, the second of the component's roles - )) - { - return StopTest(KErrGeneral, EFail); - } - - } - -// -// RAsyncTestStepOmxILPcmRenderer0022 -// -RAsyncTestStepOmxILPcmRenderer0022::RAsyncTestStepOmxILPcmRenderer0022(const TDesC& aTestName, TInt aComponentUid) - : - RAsyncTestStepOmxILComponentBase(aTestName, aComponentUid), - ipKickoff01(NULL), - ipKickoff02(NULL), - ipKickoff03(NULL), - ipKickoff04(NULL), - ipKickoff05(NULL), - ipKickoff06(NULL) - - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0022::RAsyncTestStepOmxILPcmRenderer0022")); - } - - -void -RAsyncTestStepOmxILPcmRenderer0022::KickoffTestL() - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0022::KickoffTestL")); - - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test22 ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Init Component ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Provide callbacks to component (SetCallbacks) ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Obtain the component's state (GetState) ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Get component's current role (GetParameter(OMX_IndexParamStandardComponentRole) )")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 5.- Set unsupported audio_renderer.wrong role (SetParameter(OMX_IndexParamStandardComponentRole) )")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 5a.- SetParameter returns OMX_ErrorBadParameter (audio_renderer.wrong role not supported)")); - - // This will install one callback - RAsyncTestStepOmxILComponentBase::KickoffTestL(); - - // This is the only step in this test... - TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0022Step01, this); - delete ipKickoff01; - ipKickoff01 = NULL; - ipKickoff01 = - new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); - ipKickoff01->Call(); - - // The successful termination... - TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this); - delete ipKickoffStop; - ipKickoffStop = NULL; - ipKickoffStop = - new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow); - ipKickoffStop->Call(); - - } - -void -RAsyncTestStepOmxILPcmRenderer0022::CloseTest() - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0022::CloseTest")); - - delete ipKickoff01; // no need to Cancel - ipKickoff01 = NULL; - delete ipKickoff02; // no need to Cancel - ipKickoff02 = NULL; - delete ipKickoff03; // no need to Cancel - ipKickoff03 = NULL; - delete ipKickoff04; // no need to Cancel - ipKickoff04 = NULL; - delete ipKickoff05; // no need to Cancel - ipKickoff05 = NULL; - delete ipKickoff06; // no need to Cancel - ipKickoff06 = NULL; - - delete ipKickoffStop; // no need to Cancel - ipKickoffStop = 0; - - RAsyncTestStepOmxILComponentBase::CloseTest(); - - } - - -void -RAsyncTestStepOmxILPcmRenderer0022::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/, - OMX_EVENTTYPE /*aEvent*/, - TUint /*aData1*/, - TUint /*aData2*/, - TAny* /*aExtra*/) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0022::DoEventHandlerL")); - - // We don't expect here any callback - return StopTest(KErrGeneral, EFail); - - } - - -TInt -RAsyncTestStepOmxILPcmRenderer0022::RAsyncTestStepOmxILPcmRenderer0022Step01(TAny* aPtr) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0022::RAsyncTestStepOmxILPcmRenderer0022Step01")); - RAsyncTestStepOmxILPcmRenderer0022* self = - static_cast (aPtr); - self->DoRAsyncTestStepOmxILPcmRenderer0022Step01(); - return KErrNone; - } - -void -RAsyncTestStepOmxILPcmRenderer0022::DoRAsyncTestStepOmxILPcmRenderer0022Step01() - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0022::DoRAsyncTestStepOmxILPcmRenderer0022Step01")); - - // - // Provide callbacks to component - // - OMX_CALLBACKTYPE* omxCallbacks = *ipCallbackHandler; - - if (OMX_ErrorNone != ipCompHandle->SetCallbacks( - ipCompHandle, - omxCallbacks, - ipCallbackHandler)) - { - return StopTest(KErrGeneral, EFail); - } - - INFO_PRINTF2(_L("Component Callbacks set successfully: %X"), ipCallbackHandler); - - // - // Obtain the component's state - // - OMX_STATETYPE compState; - if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, - &compState)) - { - return StopTest(KErrGeneral, EFail); - } - - PrintOmxState(compState); - - if (OMX_StateLoaded != compState) - { - return StopTest(KErrGeneral, EFail); - } - - // - // Get component's current standard role - // - OMX_PARAM_COMPONENTROLETYPE componentRoleType; - componentRoleType.nSize = sizeof(OMX_PARAM_COMPONENTROLETYPE); - componentRoleType.nVersion = TOmxILSpecVersion(); - if (OMX_ErrorNone != ipCompHandle->GetParameter( - ipCompHandle, - OMX_IndexParamStandardComponentRole, - &componentRoleType)) - { - return StopTest(KErrGeneral, EFail); - } - - TBuf8<128> componentRoleBuf8; - componentRoleBuf8 = const_cast(reinterpret_cast(componentRoleType.cRole)); - TBuf<128> componentRoleBuf16; - INFO_PRINTF2(_L("Component Role length: %d"), componentRoleBuf8.Length()); - componentRoleBuf16.Copy(componentRoleBuf8); - componentRoleBuf16.PtrZ(); - - INFO_PRINTF2(_L("Component's current Role: %S"), &componentRoleBuf16); - - - // - // Set unsupported standard role - // - TPtr8 role(reinterpret_cast(componentRoleType.cRole), - OMX_MAX_STRINGNAME_SIZE); - role.Copy(KTestOmxILWrongRendererRole()); - role.PtrZ(); - - if (OMX_ErrorBadParameter != ipCompHandle->SetParameter( - ipCompHandle, - OMX_IndexParamStandardComponentRole, - &componentRoleType)) - { - return StopTest(KErrGeneral, EFail); - } - - TBuf8<128> cRole8; - cRole8 = const_cast(reinterpret_cast(componentRoleType.cRole)); - - TBuf<128> cRole16; - cRole16.Copy(cRole8); - cRole16.PtrZ(); - - INFO_PRINTF2(_L("SetParameter of an unsupported standard role failed (success): %S"), &cRole16); - - } - - - -// -// RAsyncTestStepOmxILPcmRenderer0001 -// -RAsyncTestStepOmxILPcmRenderer0001::RAsyncTestStepOmxILPcmRenderer0001(const TDesC& aTestName, TInt aComponentUid) - : - RAsyncTestStepOmxILComponentBase(aTestName, aComponentUid), - ipBufferHeaderInput(0), - ipBufferHeaderOutput(0), - iTerminateNow(EFalse), - iSamplingRate(8000), - iTestState(EStateDefault), - ipKickoff01(NULL), - ipKickoff02(NULL), - ipKickoff03(NULL), - ipKickoff04(NULL), - ipKickoff05(NULL), - ipKickoff06(NULL) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0001::RAsyncTestStepOmxILPcmRenderer0001")); - } - - -void -RAsyncTestStepOmxILPcmRenderer0001::KickoffTestL() - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0001::KickoffTestL")); - iTestState = EStateLoadKickoffTestLComplete; - - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test01 ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(AllocateBuffer-population) ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Loaded(depopulation) ")); - - // This will install one callback - RAsyncTestStepOmxILComponentBase::KickoffTestL(); - - TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0001Step01, this); - delete ipKickoff01; - ipKickoff01 = NULL; - ipKickoff01 = - new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); - ipKickoff01->Call(); - - } - -void -RAsyncTestStepOmxILPcmRenderer0001::CloseTest() - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0001::CloseTest")); - - delete ipKickoff01; // no need to Cancel - ipKickoff01 = NULL; - delete ipKickoff02; // no need to Cancel - ipKickoff02 = NULL; - delete ipKickoff03; // no need to Cancel - ipKickoff03 = NULL; - delete ipKickoff04; // no need to Cancel - ipKickoff04 = NULL; - delete ipKickoff05; // no need to Cancel - ipKickoff05 = NULL; - delete ipKickoff06; // no need to Cancel - ipKickoff06 = NULL; - - delete ipKickoffStop; // no need to Cancel - ipKickoffStop = 0; - - TInt count = ipClientClockPortBufferArray.Count(); - - for (TInt n = 0; n < count; n++) - { - delete ipClientClockPortBufferArray[n]; - } - - ipClientClockPortBufferArray.Close(); - - RAsyncTestStepOmxILComponentBase::CloseTest(); - - } - - -void -RAsyncTestStepOmxILPcmRenderer0001::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/, - OMX_EVENTTYPE /*aEvent*/, - TUint /*aData1*/, - TUint /*aData2*/, - TAny* /*aExtra*/) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0001::DoEventHandlerL")); - - if (!iTerminateNow) - { - TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0001Step02, this); - delete ipKickoff02; - ipKickoff02 = NULL; - ipKickoff02 = - new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow); - ipKickoff02->Call(); - } - else - { - OMX_STATETYPE compState; - if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, - &compState)) - { - return StopTest(KErrGeneral, EFail); - } - - PrintOmxState(compState); - - if (OMX_StateLoaded != compState) - { - return StopTest(KErrGeneral, EFail); - } - - // The successful termination... - TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this); - delete ipKickoffStop; - ipKickoffStop = NULL; - ipKickoffStop = - new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow); - ipKickoffStop->Call(); - } - - } - - -TInt -RAsyncTestStepOmxILPcmRenderer0001::RAsyncTestStepOmxILPcmRenderer0001Step01(TAny* aPtr) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0001::RAsyncTestStepOmxILPcmRenderer0001Step01")); - RAsyncTestStepOmxILPcmRenderer0001* self = - static_cast (aPtr); - self->DoRAsyncTestStepOmxILPcmRenderer0001Step01(); - return KErrNone; - } - -void -RAsyncTestStepOmxILPcmRenderer0001::DoRAsyncTestStepOmxILPcmRenderer0001Step01() - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0001::DoRAsyncTestStepOmxILPcmRenderer0001Step01")); - - // - // Provide callbacks to component - // - OMX_CALLBACKTYPE* omxCallbacks = *ipCallbackHandler; - - if (OMX_ErrorNone != ipCompHandle->SetCallbacks( - ipCompHandle, - omxCallbacks, - ipCallbackHandler)) - { - return StopTest(KErrGeneral, EFail); - } - - INFO_PRINTF2(_L("Component Callbacks set successfully: %X"), ipCallbackHandler); - - // - // Obtain the port def params for Port #0 - // - OMX_PARAM_PORTDEFINITIONTYPE portParamsInputPort; - portParamsInputPort.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE); - portParamsInputPort.nVersion = TOmxILSpecVersion(); - portParamsInputPort.nPortIndex = 0; - if (OMX_ErrorNone != ipCompHandle->GetParameter( - ipCompHandle, - OMX_IndexParamPortDefinition, - &portParamsInputPort)) - { - return StopTest(KErrGeneral, EFail); - } - - // - // Obtain the port def params for Client Clock Port #1 - // - OMX_PARAM_PORTDEFINITIONTYPE portParamsInputPort1; - portParamsInputPort1.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE); - portParamsInputPort1.nVersion = TOmxILSpecVersion(); - portParamsInputPort1.nPortIndex = 1; - - if (OMX_ErrorNone != ipCompHandle->GetParameter( - ipCompHandle, - OMX_IndexParamPortDefinition, - &portParamsInputPort1)) - { - return StopTest(KErrGeneral, EFail); - } - - // - // Change the sampling rate on PCM Renderer's port #0 - // - OMX_AUDIO_PARAM_PCMMODETYPE pcmMode; - pcmMode.nSize = sizeof(OMX_AUDIO_PARAM_PCMMODETYPE); - pcmMode.nVersion = TOmxILSpecVersion(); - pcmMode.nPortIndex = 0; - if (OMX_ErrorNone != ipCompHandle->GetParameter( - ipCompHandle, - OMX_IndexParamAudioPcm, - &pcmMode)) - { - return StopTest(KErrGeneral, EFail); - } - pcmMode.nSamplingRate = iSamplingRate; - if (OMX_ErrorNone != ipCompHandle->SetParameter( - ipCompHandle, - OMX_IndexParamAudioPcm, - &pcmMode)) - { - return StopTest(KErrGeneral, EFail); - } - - // - // Move component to OMX_StateIdle - // - - if (OMX_ErrorNone != ipCompHandle->SendCommand( - ipCompHandle, - OMX_CommandStateSet, - OMX_StateIdle, - 0)) - { - return StopTest(KErrGeneral, EFail); - } - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Moving component to OMX_StateIdle")); - - OMX_STATETYPE compState; - if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, - &compState)) - { - return StopTest(KErrGeneral, EFail); - } - - PrintOmxState(compState); - - if (OMX_StateLoaded != compState) - { - return StopTest(KErrGeneral, EFail); - } - - // - // Allocate buffer on input port - // - if (OMX_ErrorNone != ipCompHandle->AllocateBuffer( - ipCompHandle, - &ipBufferHeaderInput, - 0, // input port - 0, - portParamsInputPort.nBufferSize)) - { - return StopTest(KErrGeneral, EFail); - } - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Populated buffer (AllocateBuffer) in INPUT port")); - - // - // Allocate buffer on Client Clock Port - // - TInt bufferCount = portParamsInputPort1.nBufferCountActual; - - for (TInt n = 0; n < bufferCount; n++) - { - OMX_BUFFERHEADERTYPE* clockBufPtr; - - if (OMX_ErrorNone != ipCompHandle->AllocateBuffer( - ipCompHandle, - &clockBufPtr, - 1, // Clock input port - 0, - portParamsInputPort1.nBufferSize)) - { - return StopTest(KErrGeneral, EFail); - } - - if (ipClientClockPortBufferArray.Append(clockBufPtr) != KErrNone) - { - return StopTest(KErrNoMemory, EFail); - } - } - - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Populated buffer (AllocateBuffer) in Clock INPUT port")); - } - -TInt -RAsyncTestStepOmxILPcmRenderer0001::RAsyncTestStepOmxILPcmRenderer0001Step02(TAny* aPtr) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0001::RAsyncTestStepOmxILPcmRenderer0001Step02")); - RAsyncTestStepOmxILPcmRenderer0001* self = - static_cast (aPtr); - self->DoRAsyncTestStepOmxILPcmRenderer0001Step02(); - return KErrNone; - } - -void -RAsyncTestStepOmxILPcmRenderer0001::DoRAsyncTestStepOmxILPcmRenderer0001Step02() - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0001::DoRAsyncTestStepOmxILPcmRenderer0001Step02")); - - // - // Move component to OMX_StateLoaded - // - - if (OMX_ErrorNone != ipCompHandle->SendCommand( - ipCompHandle, - OMX_CommandStateSet, - OMX_StateLoaded, - 0)) - { - return StopTest(KErrGeneral, EFail); - } - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Moving component to OMX_StateLoaded")); - - OMX_STATETYPE compState; - if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, - &compState)) - { - return StopTest(KErrGeneral, EFail); - } - - PrintOmxState(compState); - - if (OMX_StateIdle != compState) - { - return StopTest(KErrGeneral, EFail); - } - - // - // Free buffer on input port - // - if (OMX_ErrorNone != ipCompHandle->FreeBuffer( - ipCompHandle, - 0, // input port - ipBufferHeaderInput)) - { - return StopTest(KErrGeneral, EFail); - } - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Depopulated buffer (FreeBuffer) in INPUT port")); - - // - // Free Client Clock Port buffer on input port - // - TInt count = ipClientClockPortBufferArray.Count(); - - for (TInt n = 0; n < count; n++) - { - if (OMX_ErrorNone != ipCompHandle->FreeBuffer( - ipCompHandle, - 1, // Client Clock Port - ipClientClockPortBufferArray[0])) - { - return StopTest(KErrGeneral, EFail); - } - - ipClientClockPortBufferArray.Remove(0); - } - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Depopulated Client Clock Port buffer (FreeBuffer) in INPUT port")); - - iTerminateNow = ETrue; - - } - - -// -// RAsyncTestStepOmxILPcmRenderer0002 -// -RAsyncTestStepOmxILPcmRenderer0002::RAsyncTestStepOmxILPcmRenderer0002(const TDesC& aTestName, TInt aComponentUid) - : - RAsyncTestStepOmxILPcmRenderer0001(aTestName, aComponentUid), - ipInputBuffer(0), - ipOutputBuffer(0) - - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0002::RAsyncTestStepOmxILPcmRenderer0002")); - } - - -void -RAsyncTestStepOmxILPcmRenderer0002::KickoffTestL() - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0002::KickoffTestL")); - - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test02 ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(UseBuffer-population) ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Loaded(depopulation) ")); - - // This will install one callback - RAsyncTestStepOmxILComponentBase::KickoffTestL(); - - TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0002Step01, this); - delete ipKickoff01; - ipKickoff01 = NULL; - ipKickoff01 = - new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); - ipKickoff01->Call(); - - } - -void -RAsyncTestStepOmxILPcmRenderer0002::CloseTest() - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0002::CloseTest")); - - delete ipInputBuffer; - ipInputBuffer = NULL; - delete ipOutputBuffer; - ipOutputBuffer = NULL; - - delete ipKickoff01; // no need to Cancel - ipKickoff01 = NULL; - delete ipKickoff02; // no need to Cancel - ipKickoff02 = NULL; - delete ipKickoff03; // no need to Cancel - ipKickoff03 = NULL; - delete ipKickoff04; // no need to Cancel - ipKickoff04 = NULL; - delete ipKickoff05; // no need to Cancel - ipKickoff05 = NULL; - delete ipKickoff06; // no need to Cancel - ipKickoff06 = NULL; - - delete ipKickoffStop; // no need to Cancel - ipKickoffStop = 0; - - ipClientClockPortBufferArray.Close(); - - TInt count = iClockPortBufferPtrArray.Count(); - - for (TInt n = 0; n < count; n++) - { - delete iClockPortBufferPtrArray[n]; - } - - iClockPortBufferPtrArray.Close(); - - RAsyncTestStepOmxILComponentBase::CloseTest(); - - } - -void -RAsyncTestStepOmxILPcmRenderer0002::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/, - OMX_EVENTTYPE /*aEvent*/, - TUint /*aData1*/, - TUint /*aData2*/, - TAny* /*aExtra*/) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0002::DoEventHandlerL")); - - if (!iTerminateNow) - { - TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0002Step02, this); - delete ipKickoff02; - ipKickoff02 = NULL; - ipKickoff02 = - new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow); - ipKickoff02->Call(); - } - - if (iTerminateNow) - { - OMX_STATETYPE compState; - if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, - &compState)) - { - return StopTest(KErrGeneral, EFail); - } - - PrintOmxState(compState); - - if (OMX_StateLoaded != compState) - { - return StopTest(KErrGeneral, EFail); - } - - // The successful termination... - TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this); - delete ipKickoffStop; - ipKickoffStop = NULL; - ipKickoffStop = - new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow); - ipKickoffStop->Call(); - } - - } - - -TInt -RAsyncTestStepOmxILPcmRenderer0002::RAsyncTestStepOmxILPcmRenderer0002Step01(TAny* aPtr) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0002::RAsyncTestStepOmxILPcmRenderer0002Step01")); - RAsyncTestStepOmxILPcmRenderer0002* self = - static_cast (aPtr); - self->DoRAsyncTestStepOmxILPcmRenderer0002Step01(); - return KErrNone; - } - -void -RAsyncTestStepOmxILPcmRenderer0002::DoRAsyncTestStepOmxILPcmRenderer0002Step01() - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0002::DoRAsyncTestStepOmxILPcmRenderer0002Step01")); - - // - // Provide callbacks to component - // - OMX_CALLBACKTYPE* omxCallbacks = *ipCallbackHandler; - - if (OMX_ErrorNone != ipCompHandle->SetCallbacks( - ipCompHandle, - omxCallbacks, - ipCallbackHandler)) - { - return StopTest(KErrGeneral, EFail); - } - - INFO_PRINTF2(_L("Component Callbacks set successfully: %X"), ipCallbackHandler); - - // - // Obtain the port def params for Port #0 - // - OMX_PARAM_PORTDEFINITIONTYPE portParamsInputPort; - portParamsInputPort.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE); - portParamsInputPort.nVersion = TOmxILSpecVersion(); - portParamsInputPort.nPortIndex = 0; - if (OMX_ErrorNone != ipCompHandle->GetParameter( - ipCompHandle, - OMX_IndexParamPortDefinition, - &portParamsInputPort)) - { - return StopTest(KErrGeneral, EFail); - } - - // - // Obtain the port def params for Client Clock Port #1 - // - OMX_PARAM_PORTDEFINITIONTYPE portParamsInputPort1; - portParamsInputPort1.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE); - portParamsInputPort1.nVersion = TOmxILSpecVersion(); - portParamsInputPort1.nPortIndex = 1; - - if (OMX_ErrorNone != ipCompHandle->GetParameter( - ipCompHandle, - OMX_IndexParamPortDefinition, - &portParamsInputPort1)) - { - return StopTest(KErrGeneral, EFail); - } - - // - // Move component to OMX_StateIdle - // - - if (OMX_ErrorNone != ipCompHandle->SendCommand( - ipCompHandle, - OMX_CommandStateSet, - OMX_StateIdle, - 0)) - { - return StopTest(KErrGeneral, EFail); - } - - OMX_STATETYPE compState; - if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, - &compState)) - { - return StopTest(KErrGeneral, EFail); - } - - PrintOmxState(compState); - - if (OMX_StateLoaded != compState) - { - return StopTest(KErrGeneral, EFail); - } - - - // - // Allocate buffer on input port - // - TRAPD(err, ipInputBuffer = CMMFDescriptorBuffer::NewL(portParamsInputPort.nBufferSize)); - if(err != KErrNone) - { - return StopTest(KErrGeneral, EFail); - } - - TDes8& inputBufferDes = ipInputBuffer->Data(); - - if (OMX_ErrorNone != ipCompHandle->UseBuffer( - ipCompHandle, - &ipBufferHeaderInput, - 0, // input port - ipInputBuffer, // pAppPrivate - portParamsInputPort.nBufferSize, - const_cast(inputBufferDes.Ptr()))) - { - return StopTest(KErrGeneral, EFail); - } - INFO_PRINTF1(_L("Populated buffer (UseBuffer) in INPUT port")); - - // - // Allocate Client Clock Port buffer - // - TInt bufferCount = portParamsInputPort1.nBufferCountActual; - - for (TInt n = 0; n < bufferCount; n++) - { - CMMFDescriptorBuffer* bufPtr; - - TRAPD(err, bufPtr = CMMFDescriptorBuffer::NewL(portParamsInputPort1.nBufferSize)); - - if(err != KErrNone) - { - return StopTest(KErrGeneral, EFail); - } - - if (iClockPortBufferPtrArray.Append(bufPtr) != KErrNone) - { - delete bufPtr; - return StopTest(KErrGeneral, EFail); - } - - TDes8& inputBufferDes = bufPtr->Data(); - OMX_BUFFERHEADERTYPE* clockBufPtr; - - if (OMX_ErrorNone != ipCompHandle->UseBuffer( - ipCompHandle, - &clockBufPtr, - 1, // Clock input port - ipInputBuffer, // pAppPrivate - portParamsInputPort.nBufferSize, - const_cast(inputBufferDes.Ptr()))) - { - return StopTest(KErrGeneral, EFail); - } - - TRAPD(error, ipClientClockPortBufferArray.AppendL(clockBufPtr)); - if(error != KErrNone) - { - return StopTest(KErrGeneral, EFail); - } - } - INFO_PRINTF1(_L("Populated buffer (UseBuffer) in Client Clock Port")); - - } - -TInt -RAsyncTestStepOmxILPcmRenderer0002::RAsyncTestStepOmxILPcmRenderer0002Step02(TAny* aPtr) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0002::RAsyncTestStepOmxILPcmRenderer0002Step02")); - // NOTE, Here we reuse inherited code, to depopulate the component and make it go to OMX_StateLoaded - RAsyncTestStepOmxILPcmRenderer0002* self = - static_cast (aPtr); - self->DoRAsyncTestStepOmxILPcmRenderer0001Step02(); - return KErrNone; - } - - -// -// RAsyncTestStepOmxILPcmRenderer0003 -// -RAsyncTestStepOmxILPcmRenderer0003::RAsyncTestStepOmxILPcmRenderer0003(const TDesC& aTestName, TInt aComponentUid) - : - RAsyncTestStepOmxILComponentBase(aTestName, aComponentUid), - iTerminateNow(EFalse), - ipKickoff01(NULL), - ipKickoff02(NULL), - ipKickoff03(NULL), - ipKickoff04(NULL), - ipKickoff05(NULL), - ipKickoff06(NULL) - - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0003::RAsyncTestStepOmxILPcmRenderer0003")); - } - - -void -RAsyncTestStepOmxILPcmRenderer0003::KickoffTestL() - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0003::KickoffTestL")); - - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test03 ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->WaitForResources ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- WaitForResources->Loaded ")); - - // This will install one callback - RAsyncTestStepOmxILComponentBase::KickoffTestL(); - - TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0003Step01, this); - delete ipKickoff01; - ipKickoff01 = NULL; - ipKickoff01 = - new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); - ipKickoff01->Call(); - - // This will be used later in DoRAsyncTestStepOmxILPcmRenderer0003Step02 - TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this); - delete ipKickoffStop; - ipKickoffStop = NULL; - ipKickoffStop = - new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow); - - } - -void -RAsyncTestStepOmxILPcmRenderer0003::CloseTest() - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0003::CloseTest")); - - delete ipKickoff01; // no need to Cancel - ipKickoff01 = NULL; - delete ipKickoff02; // no need to Cancel - ipKickoff02 = NULL; - delete ipKickoff03; // no need to Cancel - ipKickoff03 = NULL; - delete ipKickoff04; // no need to Cancel - ipKickoff04 = NULL; - delete ipKickoff05; // no need to Cancel - ipKickoff05 = NULL; - delete ipKickoff06; // no need to Cancel - ipKickoff06 = NULL; - - delete ipKickoffStop; // no need to Cancel - ipKickoffStop = 0; - - RAsyncTestStepOmxILComponentBase::CloseTest(); - - } - -void -RAsyncTestStepOmxILPcmRenderer0003::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/, - OMX_EVENTTYPE /*aEvent*/, - TUint /*aData1*/, - TUint /*aData2*/, - TAny* /*aExtra*/) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0003::DoEventHandlerL")); - - TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0003Step02, this); - delete ipKickoff02; - ipKickoff02 = NULL; - ipKickoff02 = - new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow); - ipKickoff02->Call(); - - } - - -TInt -RAsyncTestStepOmxILPcmRenderer0003::RAsyncTestStepOmxILPcmRenderer0003Step01(TAny* aPtr) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0003::RAsyncTestStepOmxILPcmRenderer0003Step01")); - RAsyncTestStepOmxILPcmRenderer0003* self = - static_cast (aPtr); - self->DoRAsyncTestStepOmxILPcmRenderer0003Step01(); - return KErrNone; - } - -void -RAsyncTestStepOmxILPcmRenderer0003::DoRAsyncTestStepOmxILPcmRenderer0003Step01() - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0003::DoRAsyncTestStepOmxILPcmRenderer0003Step01")); - - // - // Obtain the component's state - // - OMX_STATETYPE compState; - if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, - &compState)) - { - return StopTest(KErrGeneral, EFail); - } - - PrintOmxState(compState); - - if (OMX_StateLoaded != compState) - { - return StopTest(KErrGeneral, EFail); - } - - // - // Provide callbacks to component - // - OMX_CALLBACKTYPE* omxCallbacks = *ipCallbackHandler; - - if (OMX_ErrorNone != ipCompHandle->SetCallbacks( - ipCompHandle, - omxCallbacks, - ipCallbackHandler)) - { - return StopTest(KErrGeneral, EFail); - } - - INFO_PRINTF2(_L("Component Callbacks set successfully: %X"), ipCallbackHandler); - - // - // Move component to OMX_StateWaitForResources - // - - if (OMX_ErrorNone != ipCompHandle->SendCommand( - ipCompHandle, - OMX_CommandStateSet, - OMX_StateWaitForResources, - 0)) - { - return StopTest(KErrGeneral, EFail); - } - - if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, - &compState)) - { - return StopTest(KErrGeneral, EFail); - } - - PrintOmxState(compState); - - if (OMX_StateWaitForResources != compState) - { - return StopTest(KErrGeneral, EFail); - } - - // - // The following code is to improve code coerage only - // - OMX_AUDIO_PARAM_PCMMODETYPE pcmMode; - pcmMode.nSize = sizeof(OMX_AUDIO_PARAM_PCMMODETYPE); - pcmMode.nVersion = TOmxILSpecVersion(); - pcmMode.nPortIndex = 0; - if (OMX_ErrorNone != ipCompHandle->GetParameter( - ipCompHandle, - OMX_IndexParamAudioPcm, - &pcmMode)) - { - return StopTest(KErrGeneral, EFail); - } - pcmMode.nSamplingRate = 44100; - if (OMX_ErrorNone != ipCompHandle->SetParameter( - ipCompHandle, - OMX_IndexParamAudioPcm, - &pcmMode)) - { - return StopTest(KErrGeneral, EFail); - } - OMX_BUFFERHEADERTYPE temp; - OMX_BUFFERHEADERTYPE* bufferHeaderInput=&temp; - if (OMX_ErrorIncorrectStateOperation != ipCompHandle->AllocateBuffer( - ipCompHandle, - &bufferHeaderInput, - 0, // input port - 0, - 1024)) - { - return StopTest(KErrGeneral, EFail); - } - - if (OMX_ErrorBadPortIndex != ipCompHandle->EmptyThisBuffer( - ipCompHandle, - bufferHeaderInput)) - { - return StopTest(KErrGeneral, EFail); - } - - if (OMX_ErrorBadPortIndex != ipCompHandle->FillThisBuffer( - ipCompHandle, - bufferHeaderInput)) - { - return StopTest(KErrGeneral, EFail); - } - - if (OMX_ErrorBadPortIndex != ipCompHandle->FreeBuffer( - ipCompHandle, - 2, - bufferHeaderInput)) - { - return StopTest(KErrGeneral, EFail); - } - - if (OMX_ErrorNone != ipCompHandle->SendCommand( - ipCompHandle, - OMX_CommandPortEnable, - 0, - 0)) - { - return StopTest(KErrGeneral, EFail); - } - - OMX_TUNNELSETUPTYPE tunnelSetup; - OMX_U32 outputPort = 1; - OMX_U32 inputPort = 0; - - if (OMX_ErrorIncorrectStateOperation != - ipCompHandle->ComponentTunnelRequest( - ipCompHandle, - outputPort, - ipCompHandle, - inputPort, - &tunnelSetup)) - { - return StopTest(KErrGeneral, EFail); - } - } - -TInt -RAsyncTestStepOmxILPcmRenderer0003::RAsyncTestStepOmxILPcmRenderer0003Step02(TAny* aPtr) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0003::RAsyncTestStepOmxILPcmRenderer0003Step02")); - RAsyncTestStepOmxILPcmRenderer0003* self = - static_cast (aPtr); - self->DoRAsyncTestStepOmxILPcmRenderer0003Step02(); - return KErrNone; - } - -void -RAsyncTestStepOmxILPcmRenderer0003::DoRAsyncTestStepOmxILPcmRenderer0003Step02() - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0003::DoRAsyncTestStepOmxILPcmRenderer0003Step02")); - - OMX_STATETYPE compState; - if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, - &compState)) - { - return StopTest(KErrGeneral, EFail); - } - - PrintOmxState(compState); - - if (OMX_StateWaitForResources != compState) - { - return StopTest(KErrGeneral, EFail); - } - - // - // Move component to OMX_StateLoaded - // - - if (OMX_ErrorNone != ipCompHandle->SendCommand( - ipCompHandle, - OMX_CommandStateSet, - OMX_StateLoaded, - 0)) - { - return StopTest(KErrGeneral, EFail); - } - - if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, - &compState)) - { - return StopTest(KErrGeneral, EFail); - } - - PrintOmxState(compState); - - if (OMX_StateLoaded != compState) - { return StopTest(KErrGeneral, EFail); - } - - // The successful termination... - ipKickoffStop->Call(); - - } - - -// -// RAsyncTestStepOmxILPcmRenderer0004 -// -RAsyncTestStepOmxILPcmRenderer0004::RAsyncTestStepOmxILPcmRenderer0004(const TDesC& aTestName, TInt aComponentUid) - : - RAsyncTestStepOmxILPcmRenderer0001(aTestName, aComponentUid) - - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0004::RAsyncTestStepOmxILPcmRenderer0004")); - } - - -void -RAsyncTestStepOmxILPcmRenderer0004::KickoffTestL() - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0004::KickoffTestL")); - iTestState = EStateLoadKickoffTestLComplete; - - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test04 ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(AllocateBuffer-population) ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Pause ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Pause->Idle ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Idle->Loaded(depopulation) ")); - - // This will install one callback - RAsyncTestStepOmxILComponentBase::KickoffTestL(); - - TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0004Step01, this); - delete ipKickoff01; - ipKickoff01 = NULL; - ipKickoff01 = - new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); - ipKickoff01->Call(); - - } - -void -RAsyncTestStepOmxILPcmRenderer0004::CloseTest() - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0004::CloseTest")); - - delete ipKickoff01; // no need to Cancel - ipKickoff01 = NULL; - delete ipKickoff02; // no need to Cancel - ipKickoff02 = NULL; - delete ipKickoff03; // no need to Cancel - ipKickoff03 = NULL; - delete ipKickoff04; // no need to Cancel - ipKickoff04 = NULL; - delete ipKickoff05; // no need to Cancel - ipKickoff05 = NULL; - delete ipKickoff06; // no need to Cancel - ipKickoff06 = NULL; - - delete ipKickoffStop; // no need to Cancel - ipKickoffStop = 0; - - TInt count = ipClientClockPortBufferArray.Count(); - - for (TInt n = 0; n < count; n++) - { - delete ipClientClockPortBufferArray[n]; - } - - ipClientClockPortBufferArray.Close(); - - RAsyncTestStepOmxILComponentBase::CloseTest(); - - } - -void -RAsyncTestStepOmxILPcmRenderer0004::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/, - OMX_EVENTTYPE aEvent, - TUint aData1, - TUint aData2, - TAny* /*aExtra*/) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0004::DoEventHandlerL")); - - switch (aEvent) - { - case OMX_EventError: - { - INFO_PRINTF2(_L("DoEventHandlerL: OMX_EventError [%d]"), aData1); - return StopTest(KErrGeneral, EFail); - } - case OMX_EventCmdComplete: - { - switch(aData1) - { - case OMX_CommandStateSet: - { - switch(aData2) - { - case OMX_StateLoaded: - { - if (EStateTransitionToIdleComplete == iTestState) - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateLoaded [EStateTransitionToIdleComplete]")); - iTestState = EStateTransitionToLoadedComplete; - OMX_STATETYPE compState; - if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, - &compState)) - { - return StopTest(KErrGeneral, EFail); - } - - PrintOmxState(compState); - - if (OMX_StateLoaded != compState) - { - return StopTest(KErrGeneral, EFail); - } - - // The successful termination... - TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this); - delete ipKickoffStop; - ipKickoffStop = NULL; - ipKickoffStop = - new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow); - ipKickoffStop->Call(); - } - } - break; - case OMX_StateIdle: - { - if (EStateLoadKickoffTestLComplete == iTestState) - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateLoadKickoffTestLComplete]")); - iTestState = EStateTransitionToIdleComplete; - TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0004Step02, this); - delete ipKickoff02; - ipKickoff02 = NULL; - ipKickoff02 = - new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow); - ipKickoff02->Call(); - - } - else if (EStateTransitionToPauseComplete == iTestState) - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateTransitionToPauseComplete]")); - iTestState = EStateTransitionToIdleComplete; - TCallBack callback04 (RAsyncTestStepOmxILPcmRenderer0004Step04, this); - delete ipKickoff04; - ipKickoff04 = NULL; - ipKickoff04 = - new (ELeave) CAsyncCallBack (callback04, CActive::EPriorityLow); - ipKickoff04->Call(); - - } - else - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [Other]")); - return StopTest(KErrGeneral, EFail); - } - } - break; - case OMX_StatePause: - { - if (EStateTransitionToIdleComplete == iTestState) - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StatePause [EStateTransitionToIdleComplete]")); - iTestState = EStateTransitionToPauseComplete; - TCallBack callback03 (RAsyncTestStepOmxILPcmRenderer0004Step03, this); - delete ipKickoff03; - ipKickoff03 = NULL; - ipKickoff03 = - new (ELeave) CAsyncCallBack (callback03, CActive::EPriorityLow); - ipKickoff03->Call(); - } - else - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StatePause [Other]")); - return StopTest(KErrGeneral, EFail); - } - } - break; - default: - { - INFO_PRINTF2(_L("DoEventHandlerL: OMX_State [%d]"), aData2); - return StopTest(KErrGeneral, EFail); - } - }; - } - break; - default: - { - INFO_PRINTF2(_L("DoEventHandlerL: OMX_Command [%d]"), aData1); - return StopTest(KErrGeneral, EFail); - } - }; - } - break; - default: - { - INFO_PRINTF2(_L("DoEventHandlerL: OMX Event [%d]"), aEvent); - return StopTest(KErrGeneral, EFail); - } - }; - - } - - -TInt -RAsyncTestStepOmxILPcmRenderer0004::RAsyncTestStepOmxILPcmRenderer0004Step01(TAny* aPtr) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0004::RAsyncTestStepOmxILPcmRenderer0004Step01")); - // NOTE, Here we reuse inherited code, to populate the component and make it go to OMX_StateIdle - RAsyncTestStepOmxILPcmRenderer0004* self = - static_cast (aPtr); - self->DoRAsyncTestStepOmxILPcmRenderer0001Step01(); - return KErrNone; - } - -TInt -RAsyncTestStepOmxILPcmRenderer0004::RAsyncTestStepOmxILPcmRenderer0004Step02(TAny* aPtr) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0004::RAsyncTestStepOmxILPcmRenderer0004Step02")); - RAsyncTestStepOmxILPcmRenderer0004* self = - static_cast (aPtr); - self->DoRAsyncTestStepOmxILPcmRenderer0004Step02(); - return KErrNone; - } - -void -RAsyncTestStepOmxILPcmRenderer0004::DoRAsyncTestStepOmxILPcmRenderer0004Step02() - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0004::DoRAsyncTestStepOmxILPcmRenderer0004Step02")); - - OMX_STATETYPE compState; - if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, - &compState)) - { - return StopTest(KErrGeneral, EFail); - } - - PrintOmxState(compState); - - if (OMX_StateIdle != compState) - { - return StopTest(KErrGeneral, EFail); - } - - // - // Move component to OMX_StatePause - // - - if (OMX_ErrorNone != ipCompHandle->SendCommand( - ipCompHandle, - OMX_CommandStateSet, - OMX_StatePause, - 0)) - { - return StopTest(KErrGeneral, EFail); - } - - if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, - &compState)) - { - return StopTest(KErrGeneral, EFail); - } - - PrintOmxState(compState); - - if (OMX_StatePause != compState) - { - return StopTest(KErrGeneral, EFail); - } - - } - -TInt -RAsyncTestStepOmxILPcmRenderer0004::RAsyncTestStepOmxILPcmRenderer0004Step03(TAny* aPtr) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0004::RAsyncTestStepOmxILPcmRenderer0004Step03")); - RAsyncTestStepOmxILPcmRenderer0004* self = - static_cast (aPtr); - self->DoRAsyncTestStepOmxILPcmRenderer0004Step03(); - return KErrNone; - } - - -void -RAsyncTestStepOmxILPcmRenderer0004::DoRAsyncTestStepOmxILPcmRenderer0004Step03() - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0004::DoRAsyncTestStepOmxILPcmRenderer0004Step03")); - - // - // Move component to OMX_StateIdle - // - - if (OMX_ErrorNone != ipCompHandle->SendCommand( - ipCompHandle, - OMX_CommandStateSet, - OMX_StateIdle, - 0)) - { - return StopTest(KErrGeneral, EFail); - } - - OMX_STATETYPE compState; - if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, - &compState)) - { - return StopTest(KErrGeneral, EFail); - } - - PrintOmxState(compState); - - if (OMX_StateIdle != compState) - { - return StopTest(KErrGeneral, EFail); - } - - } - - -TInt -RAsyncTestStepOmxILPcmRenderer0004::RAsyncTestStepOmxILPcmRenderer0004Step04(TAny* aPtr) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0004::RAsyncTestStepOmxILPcmRenderer0004Step04")); - // NOTE, Here we reuse inherited code, to depopulate the component and to - // make it go to OMX_StateLoaded - RAsyncTestStepOmxILPcmRenderer0004* self = - static_cast (aPtr); - self->DoRAsyncTestStepOmxILPcmRenderer0001Step02(); - return KErrNone; - } - - -// -// RAsyncTestStepOmxILPcmRenderer0005 -// -RAsyncTestStepOmxILPcmRenderer0005::RAsyncTestStepOmxILPcmRenderer0005(const TDesC& aTestName, TInt aComponentUid) - : - RAsyncTestStepOmxILPcmRenderer0004(aTestName, aComponentUid) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0005::RAsyncTestStepOmxILPcmRenderer0005")); - } - - -void -RAsyncTestStepOmxILPcmRenderer0005::KickoffTestL() - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0005::KickoffTestL")); - iTestState = EStateLoadKickoffTestLComplete; - - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test05 ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(AllocateBuffer-population) ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Executing ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2a. - Call EmptyThisBuffer on PCM Renderer ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2b. - EmptyBufferDone callback received ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Executing->Idle(BufferFlushing) ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Idle->Loaded(Depopulation) ")); - - // This will change the test file - iTestFileName.Set(KPcmRendererTestFile); - - // This will install one callback - RAsyncTestStepOmxILComponentBase::KickoffTestL(); - - TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0005Step01, this); - delete ipKickoff01; - ipKickoff01 = NULL; - ipKickoff01 = - new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); - ipKickoff01->Call(); - - } - -void -RAsyncTestStepOmxILPcmRenderer0005::CloseTest() - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0005::CloseTest")); - - delete ipKickoff01; // no need to Cancel - ipKickoff01 = NULL; - delete ipKickoff02; // no need to Cancel - ipKickoff02 = NULL; - delete ipKickoff03; // no need to Cancel - ipKickoff03 = NULL; - delete ipKickoff04; // no need to Cancel - ipKickoff04 = NULL; - delete ipKickoff05; // no need to Cancel - ipKickoff05 = NULL; - delete ipKickoff06; // no need to Cancel - ipKickoff06 = NULL; - - delete ipKickoffStop; // no need to Cancel - ipKickoffStop = 0; - - TInt count = ipClientClockPortBufferArray.Count(); - - for (TInt n = 0; n < count; n++) - { - delete ipClientClockPortBufferArray[n]; - } - - ipClientClockPortBufferArray.Close(); - - RAsyncTestStepOmxILComponentBase::CloseTest(); - - } - -void -RAsyncTestStepOmxILPcmRenderer0005::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/, - OMX_EVENTTYPE aEvent, - TUint aData1, - TUint aData2, - TAny* /*aExtra*/) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0005::DoEventHandlerL")); - - switch (aEvent) - { - case OMX_EventError: - { - INFO_PRINTF2(_L("DoEventHandlerL: OMX_EventError [%d]"), aData1); - return StopTest(KErrGeneral, EFail); - } - case OMX_EventCmdComplete: - { - switch(aData1) - { - case OMX_CommandStateSet: - { - switch(aData2) - { - case OMX_StateLoaded: - { - if (EStateTransitionToIdleComplete == iTestState) - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateLoaded [EStateTransitionToIdleComplete]")); - iTestState = EStateTransitionToLoadedComplete; - OMX_STATETYPE compState; - if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, - &compState)) - { - return StopTest(KErrGeneral, EFail); - } - - PrintOmxState(compState); - - if (OMX_StateLoaded != compState) - { - return StopTest(KErrGeneral, EFail); - } - - // The successful termination... - TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this); - delete ipKickoffStop; - ipKickoffStop = NULL; - ipKickoffStop = - new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow); - ipKickoffStop->Call(); - } - } - break; - case OMX_StateIdle: - { - if (EStateLoadKickoffTestLComplete == iTestState) - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateLoadKickoffTestLComplete]")); - iTestState = EStateTransitionToIdleComplete; - TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0005Step02, this); - delete ipKickoff02; - ipKickoff02 = NULL; - ipKickoff02 = - new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow); - ipKickoff02->Call(); - - } - else if (EStateTransitionToExecutingComplete == iTestState) - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateTransitionToPauseComplete]")); - iTestState = EStateTransitionToIdleComplete; - TCallBack callback04 (RAsyncTestStepOmxILPcmRenderer0005Step04, this); - delete ipKickoff04; - ipKickoff04 = NULL; - ipKickoff04 = - new (ELeave) CAsyncCallBack (callback04, CActive::EPriorityLow); - ipKickoff04->Call(); - - } - else - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [Other]")); - return StopTest(KErrGeneral, EFail); - } - } - break; - case OMX_StateExecuting: - { - if (EStateTransitionToIdleComplete == iTestState) - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [EStateTransitionToIdleComplete]")); - iTestState = EStateTransitionToExecutingComplete; - CMMFDataBuffer& dataBuffer = *(static_cast(ipBufferHeaderInput->pInputPortPrivate)); - ipTestFile->ReadNextBuffer(dataBuffer); - ipBufferHeaderInput->nFilledLen = dataBuffer.BufferSize(); - - // Send a buffer to the input port - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [Send a buffer to the input port]")); - INFO_PRINTF2(_L("ipBufferHeaderInput->pBuffer [%X]"), ipBufferHeaderInput->pBuffer); - INFO_PRINTF2(_L("ipBufferHeaderInput->nAllocLen [%d]"), ipBufferHeaderInput->nAllocLen); - INFO_PRINTF2(_L("ipBufferHeaderInput->nFilledLen [%d]"), ipBufferHeaderInput->nFilledLen); - INFO_PRINTF2(_L("ipBufferHeaderInput->nOffset [%d]"), ipBufferHeaderInput->nOffset); - INFO_PRINTF2(_L("ipBufferHeaderInput->pAppPrivate [%X]"), ipBufferHeaderInput->pAppPrivate); - INFO_PRINTF2(_L("ipBufferHeaderInput->pPlatformPrivate [%X]"), ipBufferHeaderInput->pPlatformPrivate); - INFO_PRINTF2(_L("ipBufferHeaderInput->pInputPortPrivate [%X]"), ipBufferHeaderInput->pInputPortPrivate); - INFO_PRINTF2(_L("ipBufferHeaderInput->pOutputPortPrivate [%X]"), ipBufferHeaderInput->pOutputPortPrivate); - INFO_PRINTF2(_L("ipBufferHeaderInput->hMarkTargetComponent [%X]"), ipBufferHeaderInput->hMarkTargetComponent); - INFO_PRINTF2(_L("ipBufferHeaderInput->pMarkData [%X]"), ipBufferHeaderInput->pMarkData); - INFO_PRINTF2(_L("ipBufferHeaderInput->nTickCount [%d]"), ipBufferHeaderInput->nTickCount); - INFO_PRINTF2(_L("ipBufferHeaderInput->nFlags [%X]"), ipBufferHeaderInput->nFlags); - INFO_PRINTF2(_L("ipBufferHeaderInput->nOutputPortIndex [%X]"), ipBufferHeaderInput->nOutputPortIndex); - INFO_PRINTF2(_L("ipBufferHeaderInput->nInputPortIndex [%X]"), ipBufferHeaderInput->nInputPortIndex); - - if (OMX_ErrorNone != ipCompHandle->EmptyThisBuffer( - ipCompHandle, ipBufferHeaderInput)) - { - return StopTest(KErrGeneral, EFail); - } - } - else - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [Other]")); - return StopTest(KErrGeneral, EFail); - } - } - break; - default: - { - INFO_PRINTF2(_L("DoEventHandlerL: OMX_State [%d]"), aData2); - return StopTest(KErrGeneral, EFail); - } - }; - } - break; - default: - { - INFO_PRINTF2(_L("DoEventHandlerL: OMX_Command [%d]"), aData1); - return StopTest(KErrGeneral, EFail); - } - }; - } - break; - default: - { - INFO_PRINTF2(_L("DoEventHandlerL: OMX Event [%d]"), aEvent); - return StopTest(KErrGeneral, EFail); - } - }; - - } - -void -RAsyncTestStepOmxILPcmRenderer0005::DoEmptyBufferDoneL(OMX_HANDLETYPE /*aComponent*/, - OMX_BUFFERHEADERTYPE* /*aBuffer*/) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0005::DoEmptyBufferDoneL")); - - INFO_PRINTF1(_L("DoEmptyBufferDoneL : Callback received ")); - - TCallBack callback03 (RAsyncTestStepOmxILPcmRenderer0005Step03, this); - delete ipKickoff03; - ipKickoff03 = NULL; - ipKickoff03 = - new (ELeave) CAsyncCallBack (callback03, CActive::EPriorityLow); - ipKickoff03->Call(); - } - - -TInt -RAsyncTestStepOmxILPcmRenderer0005::RAsyncTestStepOmxILPcmRenderer0005Step01(TAny* aPtr) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0005::RAsyncTestStepOmxILPcmRenderer0005Step01")); - // NOTE, Here we reuse inherited code, to populate the component and make it go to OMX_StateIdle - RAsyncTestStepOmxILPcmRenderer0005* self = - static_cast (aPtr); - self->DoRAsyncTestStepOmxILPcmRenderer0001Step01(); - return KErrNone; - } - -TInt -RAsyncTestStepOmxILPcmRenderer0005::RAsyncTestStepOmxILPcmRenderer0005Step02(TAny* aPtr) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0005::RAsyncTestStepOmxILPcmRenderer0005Step02")); - RAsyncTestStepOmxILPcmRenderer0005* self = - static_cast (aPtr); - self->DoRAsyncTestStepOmxILPcmRenderer0005Step02(); - return KErrNone; - } - -void -RAsyncTestStepOmxILPcmRenderer0005::DoRAsyncTestStepOmxILPcmRenderer0005Step02() - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0005::DoRAsyncTestStepOmxILPcmRenderer0005Step02")); - - // - // Move component to OMX_StateExecuting - // - - if (OMX_ErrorNone != ipCompHandle->SendCommand( - ipCompHandle, - OMX_CommandStateSet, - OMX_StateExecuting, - 0)) - { - return StopTest(KErrGeneral, EFail); - } - - OMX_STATETYPE compState; - if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, - &compState)) - { - return StopTest(KErrGeneral, EFail); - } - - PrintOmxState(compState); - - if (OMX_StateExecuting != compState) - { - return StopTest(KErrGeneral, EFail); - } - - } - -TInt -RAsyncTestStepOmxILPcmRenderer0005::RAsyncTestStepOmxILPcmRenderer0005Step03(TAny* aPtr) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0005::RAsyncTestStepOmxILPcmRenderer0005Step03")); - RAsyncTestStepOmxILPcmRenderer0005* self = - static_cast (aPtr); - self->DoRAsyncTestStepOmxILPcmRenderer0004Step03(); - return KErrNone; - } - - -TInt -RAsyncTestStepOmxILPcmRenderer0005::RAsyncTestStepOmxILPcmRenderer0005Step04(TAny* aPtr) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0005::RAsyncTestStepOmxILPcmRenderer0005Step04")); - // NOTE, Here we reuse inherited code, to depopulate the component and to - // make it go to OMX_StateLoaded - RAsyncTestStepOmxILPcmRenderer0005* self = - static_cast (aPtr); - self->DoRAsyncTestStepOmxILPcmRenderer0001Step02(); - return KErrNone; - } - - - -// -// RAsyncTestStepOmxILPcmRenderer0006 -// -RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006(const TDesC& aTestName, TInt aComponentUid) - : - RAsyncTestStepOmxILPcmRenderer0005(aTestName, aComponentUid) - - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006")); - } - - -void -RAsyncTestStepOmxILPcmRenderer0006::KickoffTestL() - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::KickoffTestL")); - iTestState = EStateLoadKickoffTestLComplete; - - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test06 ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(AllocateBuffer-population) ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Executing ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Executing->Pause ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Pause->Executing ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 5.- Executing->Idle(BufferFlushing) ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 6.- Idle->Loaded(depopulation) ")); - - // This will install one callback - RAsyncTestStepOmxILComponentBase::KickoffTestL(); - - TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0006Step01, this); - delete ipKickoff01; - ipKickoff01 = NULL; - ipKickoff01 = - new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); - ipKickoff01->Call(); - - } - -void -RAsyncTestStepOmxILPcmRenderer0006::CloseTest() - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::CloseTest")); - - delete ipKickoff01; // no need to Cancel - ipKickoff01 = NULL; - delete ipKickoff02; // no need to Cancel - ipKickoff02 = NULL; - delete ipKickoff03; // no need to Cancel - ipKickoff03 = NULL; - delete ipKickoff04; // no need to Cancel - ipKickoff04 = NULL; - delete ipKickoff05; // no need to Cancel - ipKickoff05 = NULL; - delete ipKickoff06; // no need to Cancel - ipKickoff06 = NULL; - - delete ipKickoffStop; // no need to Cancel - ipKickoffStop = 0; - - TInt count = ipClientClockPortBufferArray.Count(); - - for (TInt n = 0; n < count; n++) - { - delete ipClientClockPortBufferArray[n]; - } - - ipClientClockPortBufferArray.Close(); - - RAsyncTestStepOmxILComponentBase::CloseTest(); - - } - - -void -RAsyncTestStepOmxILPcmRenderer0006::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/, - OMX_EVENTTYPE aEvent, - TUint aData1, - TUint aData2, - TAny* /*aExtra*/) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::DoEventHandlerL")); - - switch (aEvent) - { - case OMX_EventError: - { - INFO_PRINTF2(_L("DoEventHandlerL: OMX_EventError [%d]"), aData1); - return StopTest(KErrGeneral, EFail); - } - case OMX_EventCmdComplete: - { - switch(aData1) - { - case OMX_CommandStateSet: - { - switch(aData2) - { - case OMX_StateLoaded: - { - if (EStateTransitionToIdleComplete == iTestState) - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateLoaded [EStateTransitionToIdleComplete]")); - iTestState = EStateTransitionToLoadedComplete; - OMX_STATETYPE compState; - if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, - &compState)) - { - return StopTest(KErrGeneral, EFail); - } - - PrintOmxState(compState); - - if (OMX_StateLoaded != compState) - { - return StopTest(KErrGeneral, EFail); - } - - // The successful termination... - TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this); - delete ipKickoffStop; - ipKickoffStop = NULL; - ipKickoffStop = - new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow); - ipKickoffStop->Call(); - } - } - break; - case OMX_StateIdle: - { - if (EStateLoadKickoffTestLComplete == iTestState) - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateLoadKickoffTestLComplete]")); - iTestState = EStateTransitionToIdleComplete; - TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0006Step02, this); - delete ipKickoff02; - ipKickoff02 = NULL; - ipKickoff02 = - new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow); - ipKickoff02->Call(); - - } - else if (EStateTransitionToExecutingComplete == iTestState) - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateTransitionToExecutingComplete]")); - iTestState = EStateTransitionToIdleComplete; - TCallBack callback06 (RAsyncTestStepOmxILPcmRenderer0006Step06, this); - delete ipKickoff06; - ipKickoff06 = NULL; - ipKickoff06 = - new (ELeave) CAsyncCallBack (callback06, CActive::EPriorityLow); - ipKickoff06->Call(); - - } - else - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [Other]")); - return StopTest(KErrGeneral, EFail); - } - } - break; - case OMX_StateExecuting: - { - if (EStateTransitionToIdleComplete == iTestState) - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [EStateTransitionToIdleComplete]")); - iTestState = EStateTransitionToExecutingComplete; - TCallBack callback03 (RAsyncTestStepOmxILPcmRenderer0006Step03, this); - delete ipKickoff03; - ipKickoff03 = NULL; - ipKickoff03 = - new (ELeave) CAsyncCallBack (callback03, CActive::EPriorityLow); - ipKickoff03->Call(); - - } - else if (EStateTransitionToPauseComplete == iTestState) - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [EStateTransitionToPauseComplete]")); - iTestState = EStateTransitionToExecutingComplete; - TCallBack callback05 (RAsyncTestStepOmxILPcmRenderer0006Step05, this); - delete ipKickoff05; - ipKickoff05 = NULL; - ipKickoff05 = - new (ELeave) CAsyncCallBack (callback05, CActive::EPriorityLow); - ipKickoff05->Call(); - - } - else - { - INFO_PRINTF2(_L("DoEventHandlerL: OMX_StateExecuting iTestState[%d]"), iTestState); - return StopTest(KErrGeneral, EFail); - } - } - break; - case OMX_StatePause: - { - if (EStateTransitionToExecutingComplete == iTestState) - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StatePause [EStateTransitionToExecutingComplete]")); - iTestState = EStateTransitionToPauseComplete; - TCallBack callback04 (RAsyncTestStepOmxILPcmRenderer0006Step04, this); - delete ipKickoff04; - ipKickoff04 = NULL; - ipKickoff04 = - new (ELeave) CAsyncCallBack (callback04, CActive::EPriorityLow); - ipKickoff04->Call(); - } - else - { - INFO_PRINTF2(_L("DoEventHandlerL: OMX_StatePause iTestState[%d]"), iTestState); - return StopTest(KErrGeneral, EFail); - } - - } - break; - default: - { - INFO_PRINTF2(_L("DoEventHandlerL: OMX_State [%d]"), aData2); - return StopTest(KErrGeneral, EFail); - } - }; - } - break; - default: - { - INFO_PRINTF2(_L("DoEventHandlerL: OMX_Command [%d]"), aData1); - return StopTest(KErrGeneral, EFail); - } - }; - } - break; - default: - { - INFO_PRINTF2(_L("DoEventHandlerL: OMX Event [%d]"), aEvent); - return StopTest(KErrGeneral, EFail); - } - }; - - } - - -TInt -RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step01(TAny* aPtr) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step01")); - // NOTE, Here we reuse inherited code, to populate the component and make it go to OMX_StateIdle - RAsyncTestStepOmxILPcmRenderer0006* self = - static_cast (aPtr); - self->DoRAsyncTestStepOmxILPcmRenderer0001Step01(); - return KErrNone; - } - -TInt -RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step02(TAny* aPtr) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step02")); - RAsyncTestStepOmxILPcmRenderer0006* self = - static_cast (aPtr); - self->DoRAsyncTestStepOmxILPcmRenderer0005Step02(); - return KErrNone; - } - -TInt -RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step03(TAny* aPtr) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step03")); - RAsyncTestStepOmxILPcmRenderer0006* self = - static_cast (aPtr); - self->DoRAsyncTestStepOmxILPcmRenderer0006Step03(); - return KErrNone; - } - -void -RAsyncTestStepOmxILPcmRenderer0006::DoRAsyncTestStepOmxILPcmRenderer0006Step03() - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::DoRAsyncTestStepOmxILPcmRenderer0006Step03")); - - // - // Move component to OMX_StatePause - // - OMX_STATETYPE compState; - if (OMX_ErrorNone != ipCompHandle->SendCommand( - ipCompHandle, - OMX_CommandStateSet, - OMX_StatePause, - 0)) - { - return StopTest(KErrGeneral, EFail); - } - - if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, - &compState)) - { - return StopTest(KErrGeneral, EFail); - } - - PrintOmxState(compState); - - if (OMX_StatePause != compState) - { - return StopTest(KErrGeneral, EFail); - } - - } - - -TInt -RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step04(TAny* aPtr) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step04")); - // NOTE, Here we reuse inherited code, to make it go to OMX_StateIdle - RAsyncTestStepOmxILPcmRenderer0006* self = - static_cast (aPtr); - self->DoRAsyncTestStepOmxILPcmRenderer0005Step02(); - return KErrNone; - } - -TInt -RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step05(TAny* aPtr) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step05")); - // NOTE, Here we reuse inherited code, to make it go to OMX_StateIdle - RAsyncTestStepOmxILPcmRenderer0006* self = - static_cast (aPtr); - self->DoRAsyncTestStepOmxILPcmRenderer0004Step03(); - return KErrNone; - } - -TInt -RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step06(TAny* aPtr) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step06")); - // NOTE, Here we reuse inherited code, to make it go to OMX_StateLoaded - RAsyncTestStepOmxILPcmRenderer0006* self = - static_cast (aPtr); - self->DoRAsyncTestStepOmxILPcmRenderer0001Step02(); - return KErrNone; - } - - -// -// RAsyncTestStepOmxILPcmRenderer0007 -// -RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007(const TDesC& aTestName, TInt aComponentUid) - : - RAsyncTestStepOmxILPcmRenderer0006(aTestName, aComponentUid) - - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007")); - } - - -void -RAsyncTestStepOmxILPcmRenderer0007::KickoffTestL() - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0007::KickoffTestL")); - iTestState = EStateLoadKickoffTestLComplete; - - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test07 ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(AllocateBuffer-population) ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Executing ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Executing->Pause ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Pause->Idle(BufferFlushing)")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 5.- Idle->Loaded(depopulation) ")); - - // This will install one callback - RAsyncTestStepOmxILComponentBase::KickoffTestL(); - - TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0007Step01, this); - delete ipKickoff01; - ipKickoff01 = NULL; - ipKickoff01 = - new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); - ipKickoff01->Call(); - - } - -void -RAsyncTestStepOmxILPcmRenderer0007::CloseTest() - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0007::CloseTest")); - - delete ipKickoff01; // no need to Cancel - ipKickoff01 = NULL; - delete ipKickoff02; // no need to Cancel - ipKickoff02 = NULL; - delete ipKickoff03; // no need to Cancel - ipKickoff03 = NULL; - delete ipKickoff04; // no need to Cancel - ipKickoff04 = NULL; - delete ipKickoff05; // no need to Cancel - ipKickoff05 = NULL; - delete ipKickoff06; // no need to Cancel - ipKickoff06 = NULL; - - delete ipKickoffStop; // no need to Cancel - ipKickoffStop = 0; - - TInt count = ipClientClockPortBufferArray.Count(); - - for (TInt n = 0; n < count; n++) - { - delete ipClientClockPortBufferArray[n]; - } - - ipClientClockPortBufferArray.Close(); - - RAsyncTestStepOmxILComponentBase::CloseTest(); - - } - - -void -RAsyncTestStepOmxILPcmRenderer0007::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/, - OMX_EVENTTYPE aEvent, - TUint aData1, - TUint aData2, - TAny* /*aExtra*/) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0007::DoEventHandlerL")); - - switch (aEvent) - { - case OMX_EventError: - { - // Ignore underflow errors... - if (OMX_ErrorUnderflow == (OMX_S32)aData1) - { - INFO_PRINTF1(_L("DoEventHandlerL: [OMX_ErrorUnderflow]")); - } - else - { - INFO_PRINTF2(_L("DoEventHandlerL: OMX_EventError [%x]"), aData1); - return StopTest(KErrGeneral, EFail); - } - } - break; - - case OMX_EventCmdComplete: - { - switch(aData1) - { - case OMX_CommandStateSet: - { - switch(aData2) - { - case OMX_StateLoaded: - { - if (EStateTransitionToIdleComplete == iTestState) - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateLoaded [EStateTransitionToIdleComplete]")); - iTestState = EStateTransitionToLoadedComplete; - OMX_STATETYPE compState; - if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, - &compState)) - { - return StopTest(KErrGeneral, EFail); - } - - PrintOmxState(compState); - - if (OMX_StateLoaded != compState) - { - return StopTest(KErrGeneral, EFail); - } - - // The successful termination... - TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this); - delete ipKickoffStop; - ipKickoffStop = NULL; - ipKickoffStop = - new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow); - ipKickoffStop->Call(); - } - } - break; - case OMX_StateIdle: - { - if (EStateLoadKickoffTestLComplete == iTestState) - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateLoadKickoffTestLComplete]")); - iTestState = EStateTransitionToIdleComplete; - TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0007Step02, this); - delete ipKickoff02; - ipKickoff02 = NULL; - ipKickoff02 = - new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow); - ipKickoff02->Call(); - - } - else if (EStateTransitionToPauseComplete == iTestState) - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateTransitionToPauseComplete]")); - iTestState = EStateTransitionToIdleComplete; - TCallBack callback05 (RAsyncTestStepOmxILPcmRenderer0007Step05, this); - delete ipKickoff05; - ipKickoff05 = NULL; - ipKickoff05 = - new (ELeave) CAsyncCallBack (callback05, CActive::EPriorityLow); - ipKickoff05->Call(); - - } - else - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [Other]")); - return StopTest(KErrGeneral, EFail); - } - } - break; - case OMX_StateExecuting: - { - if (EStateTransitionToIdleComplete == iTestState) - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [EStateTransitionToIdleComplete]")); - iTestState = EStateTransitionToExecutingComplete; - TCallBack callback03 (RAsyncTestStepOmxILPcmRenderer0007Step03, this); - delete ipKickoff03; - ipKickoff03 = NULL; - ipKickoff03 = - new (ELeave) CAsyncCallBack (callback03, CActive::EPriorityLow); - ipKickoff03->Call(); - - } - else - { - INFO_PRINTF2(_L("DoEventHandlerL: OMX_StateExecuting iTestState[%d]"), iTestState); - return StopTest(KErrGeneral, EFail); - } - } - break; - case OMX_StatePause: - { - if (EStateTransitionToExecutingComplete == iTestState) - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StatePause [EStateTransitionToExecutingComplete]")); - iTestState = EStateTransitionToPauseComplete; - TCallBack callback04 (RAsyncTestStepOmxILPcmRenderer0007Step04, this); - delete ipKickoff04; - ipKickoff04 = NULL; - ipKickoff04 = - new (ELeave) CAsyncCallBack (callback04, CActive::EPriorityLow); - ipKickoff04->Call(); - } - else - { - INFO_PRINTF2(_L("DoEventHandlerL: OMX_StatePause iTestState[%d]"), iTestState); - return StopTest(KErrGeneral, EFail); - } - - } - break; - default: - { - INFO_PRINTF2(_L("DoEventHandlerL: OMX_State [%d]"), aData2); - return StopTest(KErrGeneral, EFail); - } - }; - } - break; - default: - { - INFO_PRINTF2(_L("DoEventHandlerL: OMX_Command [%d]"), aData1); - return StopTest(KErrGeneral, EFail); - } - }; - } - break; - default: - { - INFO_PRINTF2(_L("DoEventHandlerL: OMX Event [%d]"), aEvent); - return StopTest(KErrGeneral, EFail); - } - }; - - } - - -TInt -RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007Step01(TAny* aPtr) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007Step01")); - // NOTE, Here we reuse inherited code, to populate the component and make it go to OMX_StateIdle - RAsyncTestStepOmxILPcmRenderer0007* self = - static_cast (aPtr); - self->DoRAsyncTestStepOmxILPcmRenderer0001Step01(); - return KErrNone; - } - -TInt -RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007Step02(TAny* aPtr) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007Step02")); - RAsyncTestStepOmxILPcmRenderer0007* self = - static_cast (aPtr); - self->DoRAsyncTestStepOmxILPcmRenderer0005Step02(); - return KErrNone; - } - -TInt -RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007Step03(TAny* aPtr) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007Step03")); - RAsyncTestStepOmxILPcmRenderer0007* self = - static_cast (aPtr); - self->DoRAsyncTestStepOmxILPcmRenderer0006Step03(); - return KErrNone; - } - -TInt -RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007Step04(TAny* aPtr) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007Step04")); - // NOTE, Here we reuse inherited code, to make it go to OMX_StateIdle - RAsyncTestStepOmxILPcmRenderer0007* self = - static_cast (aPtr); - self->DoRAsyncTestStepOmxILPcmRenderer0004Step03(); - return KErrNone; - } - -TInt -RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007Step05(TAny* aPtr) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007Step05")); - // NOTE, Here we reuse inherited code, to make it go to OMX_StateIdle - RAsyncTestStepOmxILPcmRenderer0007* self = - static_cast (aPtr); - self->DoRAsyncTestStepOmxILPcmRenderer0001Step02(); - return KErrNone; - } - -// -// RAsyncTestStepOmxILPcmRenderer0008 -// -RAsyncTestStepOmxILPcmRenderer0008::RAsyncTestStepOmxILPcmRenderer0008(const TDesC& aTestName, TInt aComponentUid) - : - RAsyncTestStepOmxILPcmRenderer0005(aTestName, aComponentUid) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0008::RAsyncTestStepOmxILPcmRenderer0008")); - } - - -void -RAsyncTestStepOmxILPcmRenderer0008::KickoffTestL() - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0008::KickoffTestL")); - iTestState = EStateLoadKickoffTestLComplete; - - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test08 ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(AllocateBuffer-population) ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Executing ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Repeat these two steps until the whole file has beeen empited ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2a. - Call EmptyThisBuffer on PCM Renderer ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2b. - EmptyBufferDone callback received ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Executing->Idle(BufferFlushing) ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Idle->Loaded(Depopulation) ")); - - // This will change the test file - iTestFileName.Set(KPcmRendererTestFile); - - // This will install one callback - RAsyncTestStepOmxILComponentBase::KickoffTestL(); - - TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0005Step01, this); - delete ipKickoff01; - ipKickoff01 = NULL; - ipKickoff01 = - new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); - ipKickoff01->Call(); - } - -void -RAsyncTestStepOmxILPcmRenderer0008::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/, - OMX_EVENTTYPE aEvent, - TUint aData1, - TUint aData2, - TAny* /*aExtra*/) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0008::DoEventHandlerL")); - - switch (aEvent) - { - case OMX_EventError: - { - // Ignore underflow errors... - if (OMX_ErrorUnderflow == (OMX_S32)aData1) - { - INFO_PRINTF1(_L("DoEventHandlerL: [OMX_ErrorUnderflow]")); - } - else - { - INFO_PRINTF2(_L("DoEventHandlerL: OMX_EventError [%x]"), aData1); - return StopTest(KErrGeneral, EFail); - } - } - break; - - case OMX_EventCmdComplete: - { - switch(aData1) - { - case OMX_CommandStateSet: - { - switch(aData2) - { - case OMX_StateLoaded: - { - if (EStateTransitionToIdleComplete == iTestState) - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateLoaded [EStateTransitionToIdleComplete]")); - iTestState = EStateTransitionToLoadedComplete; - OMX_STATETYPE compState; - if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, - &compState)) - { - return StopTest(KErrGeneral, EFail); - } - - PrintOmxState(compState); - - if (OMX_StateLoaded != compState) - { - return StopTest(KErrGeneral, EFail); - } - - // The successful termination... - TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this); - delete ipKickoffStop; - ipKickoffStop = NULL; - ipKickoffStop = - new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow); - ipKickoffStop->Call(); - } - } - break; - case OMX_StateIdle: - { - if (EStateLoadKickoffTestLComplete == iTestState) - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateLoadKickoffTestLComplete]")); - iTestState = EStateTransitionToIdleComplete; - TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0005Step02, this); - delete ipKickoff02; - ipKickoff02 = NULL; - ipKickoff02 = - new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow); - ipKickoff02->Call(); - - } - else if (EStateTransitionToExecutingComplete == iTestState) - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateTransitionToPauseComplete]")); - iTestState = EStateTransitionToIdleComplete; - TCallBack callback04 (RAsyncTestStepOmxILPcmRenderer0005Step04, this); - delete ipKickoff04; - ipKickoff04 = NULL; - ipKickoff04 = - new (ELeave) CAsyncCallBack (callback04, CActive::EPriorityLow); - ipKickoff04->Call(); - - } - else - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [Other]")); - return StopTest(KErrGeneral, EFail); - } - } - break; - case OMX_StateExecuting: - { - if (EStateTransitionToIdleComplete == iTestState) - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [EStateTransitionToIdleComplete]")); - iTestState = EStateTransitionToExecutingComplete; - - CMMFDataBuffer& dataBuffer = *(static_cast(ipBufferHeaderInput->pInputPortPrivate)); - ipTestFile->ReadNextBuffer(dataBuffer); - - // Send a buffer to the input port - ipBufferHeaderInput->nFilledLen = dataBuffer.BufferSize(); - - if (OMX_ErrorNone != ipCompHandle->EmptyThisBuffer( - ipCompHandle, ipBufferHeaderInput)) - { - StopTest(KErrGeneral, EFail); - } - } - else - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [Other]")); - return StopTest(KErrGeneral, EFail); - } - } - break; - default: - { - INFO_PRINTF2(_L("DoEventHandlerL: OMX_State [%d]"), aData2); - return StopTest(KErrGeneral, EFail); - } - }; - } - break; - default: - { - INFO_PRINTF2(_L("DoEventHandlerL: OMX_Command [%d]"), aData1); - return StopTest(KErrGeneral, EFail); - } - }; - } - break; - default: - { - INFO_PRINTF2(_L("DoEventHandlerL: OMX Event [%d]"), aEvent); - return StopTest(KErrGeneral, EFail); - } - }; - - } - -void -RAsyncTestStepOmxILPcmRenderer0008::DoEmptyBufferDoneL(OMX_HANDLETYPE /*aComponent*/, - OMX_BUFFERHEADERTYPE* /*aBuffer*/) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0008::DoEmptyBufferDoneL")); - INFO_PRINTF1(_L("DoEmptyBufferDoneL : Callback received ")); - - CMMFDataBuffer& dataBuffer = *(static_cast(ipBufferHeaderInput->pInputPortPrivate)); - ipTestFile->ReadNextBuffer(dataBuffer); - - if (dataBuffer.BufferSize() > 0) - { - // Send a buffer to the input port - ipBufferHeaderInput->nFilledLen = dataBuffer.BufferSize(); - - if (OMX_ErrorNone != ipCompHandle->EmptyThisBuffer( - ipCompHandle, ipBufferHeaderInput)) - { - StopTest(KErrGeneral, EFail); - } - } - else - { - TCallBack callback03 (RAsyncTestStepOmxILPcmRenderer0005Step03, this); - delete ipKickoff03; - ipKickoff03 = NULL; - ipKickoff03 = - new (ELeave) CAsyncCallBack (callback03, CActive::EPriorityLow); - ipKickoff03->Call(); - } - } - -// -// RAsyncTestStepOmxILPcmRenderer0009 -// -RAsyncTestStepOmxILPcmRenderer0009::RAsyncTestStepOmxILPcmRenderer0009(const TDesC& aTestName, TInt aComponentUid) - : - RAsyncTestStepOmxILPcmRenderer0008(aTestName, aComponentUid) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0009::RAsyncTestStepOmxILPcmRenderer0009")); - iSamplingRate = 44100; - } - - -void -RAsyncTestStepOmxILPcmRenderer0009::KickoffTestL() - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0009::KickoffTestL")); - iTestState = EStateLoadKickoffTestLComplete; - - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test09 ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(AllocateBuffer-population) ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Executing ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Repeat these two steps until the whole file has beeen empited ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2a. - Call EmptyThisBuffer on PCM Renderer ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2b. - EmptyBufferDone callback received ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Executing->Pause and Pause->Executing (after 5 and again after 10 buffers played) ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Executing->Idle(BufferFlushing) ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 5.- Idle->Loaded(Depopulation) ")); - - // This will change the test file - iTestFileName.Set(KPcmRendererTestFile2); - - // This will install one callback - RAsyncTestStepOmxILComponentBase::KickoffTestL(); - - TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0005Step01, this); - delete ipKickoff01; - ipKickoff01 = NULL; - ipKickoff01 = - new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); - ipKickoff01->Call(); - } - -void -RAsyncTestStepOmxILPcmRenderer0009::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/, - OMX_EVENTTYPE aEvent, - TUint aData1, - TUint aData2, - TAny* /*aExtra*/) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0009::DoEventHandlerL")); - - switch (aEvent) - { - case OMX_EventError: - { - // Ignore underflow errors... - if (OMX_ErrorUnderflow == (OMX_S32)aData1) - { - INFO_PRINTF1(_L("DoEventHandlerL: [OMX_ErrorUnderflow]")); - } - else - { - INFO_PRINTF2(_L("DoEventHandlerL: OMX_EventError [%x]"), aData1); - return StopTest(KErrGeneral, EFail); - } - } - break; - - case OMX_EventCmdComplete: - { - switch(aData1) - { - case OMX_CommandStateSet: - { - switch(aData2) - { - case OMX_StateLoaded: - { - if (EStateTransitionToIdleComplete == iTestState) - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateLoaded [EStateTransitionToIdleComplete]")); - iTestState = EStateTransitionToLoadedComplete; - OMX_STATETYPE compState; - if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, - &compState)) - { - return StopTest(KErrGeneral, EFail); - } - - PrintOmxState(compState); - - if (OMX_StateLoaded != compState) - { - return StopTest(KErrGeneral, EFail); - } - - // The successful termination... - TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this); - delete ipKickoffStop; - ipKickoffStop = NULL; - ipKickoffStop = - new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow); - ipKickoffStop->Call(); - } - } - break; - case OMX_StateIdle: - { - if (EStateLoadKickoffTestLComplete == iTestState) - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateLoadKickoffTestLComplete]")); - iTestState = EStateTransitionToIdleComplete; - TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0005Step02, this); - delete ipKickoff02; - ipKickoff02 = NULL; - ipKickoff02 = - new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow); - ipKickoff02->Call(); - - } - else if (EStateTransitionToExecutingComplete == iTestState) - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateTransitionToPauseComplete]")); - iTestState = EStateTransitionToIdleComplete; - TCallBack callback04 (RAsyncTestStepOmxILPcmRenderer0005Step04, this); - delete ipKickoff04; - ipKickoff04 = NULL; - ipKickoff04 = - new (ELeave) CAsyncCallBack (callback04, CActive::EPriorityLow); - ipKickoff04->Call(); - - } - else - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [Other]")); - return StopTest(KErrGeneral, EFail); - } - } - break; - case OMX_StateExecuting: - { - if (EStateTransitionToIdleComplete == iTestState) - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [EStateTransitionToIdleComplete]")); - iTestState = EStateTransitionToExecutingComplete; - - CMMFDataBuffer& dataBuffer = *(static_cast(ipBufferHeaderInput->pInputPortPrivate)); - ipTestFile->ReadNextBuffer(dataBuffer); - - // Send a buffer to the input port - ipBufferHeaderInput->nFilledLen = dataBuffer.BufferSize(); - - if (OMX_ErrorNone != ipCompHandle->EmptyThisBuffer( - ipCompHandle, ipBufferHeaderInput)) - { - StopTest(KErrGeneral, EFail); - } - } - else if (EStateTransitionToPauseComplete == iTestState) - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [EStateTransitionToIdleComplete]")); - iTestState = EStateTransitionToExecutingComplete; - } - else - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [Other]")); - return StopTest(KErrGeneral, EFail); - } - } - break; - case OMX_StatePause: - { - if (EStateTransitionToExecutingComplete == iTestState) - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StatePause [EStateTransitionToExecutingComplete]")); - iTestState = EStateTransitionToPauseComplete; - - // Wait for a second... - User::After(1000000); - - // Resume playing... - TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0005Step02, this); - delete ipKickoff02; - ipKickoff02 = NULL; - ipKickoff02 = - new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow); - ipKickoff02->Call(); - } - else - { - INFO_PRINTF2(_L("DoEventHandlerL: OMX_StatePause iTestState[%d]"), iTestState); - return StopTest(KErrGeneral, EFail); - } - - } - break; - default: - { - INFO_PRINTF2(_L("DoEventHandlerL: OMX_State [%d]"), aData2); - return StopTest(KErrGeneral, EFail); - } - }; - } - break; - default: - { - INFO_PRINTF2(_L("DoEventHandlerL: OMX_Command [%d]"), aData1); - return StopTest(KErrGeneral, EFail); - } - }; - } - break; - default: - { - INFO_PRINTF2(_L("DoEventHandlerL: OMX Event [%d]"), aEvent); - return StopTest(KErrGeneral, EFail); - } - }; - - } - -void -RAsyncTestStepOmxILPcmRenderer0009::DoEmptyBufferDoneL(OMX_HANDLETYPE /*aComponent*/, - OMX_BUFFERHEADERTYPE* /*aBuffer*/) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0009::DoEmptyBufferDoneL")); - INFO_PRINTF1(_L("DoEmptyBufferDoneL : Callback received ")); - - iNumOfEmptiedBuffers++; - if (iNumOfEmptiedBuffers == 5 || iNumOfEmptiedBuffers == 10) - { - // - // Move component to OMX_StatePause - // - if (OMX_ErrorNone != ipCompHandle->SendCommand( - ipCompHandle, - OMX_CommandStateSet, - OMX_StatePause, - 0)) - { - return StopTest(KErrGeneral, EFail); - } - - OMX_STATETYPE compState; - if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, - &compState)) - { - return StopTest(KErrGeneral, EFail); - } - - PrintOmxState(compState); - if (OMX_StatePause != compState) - { - return StopTest(KErrGeneral, EFail); - } - } - - CMMFDataBuffer& dataBuffer = *(static_cast(ipBufferHeaderInput->pInputPortPrivate)); - ipTestFile->ReadNextBuffer(dataBuffer); - - if (dataBuffer.BufferSize() > 0) - { - // Send a buffer to the input port - ipBufferHeaderInput->nFilledLen = dataBuffer.BufferSize(); - - if (OMX_ErrorNone != ipCompHandle->EmptyThisBuffer( - ipCompHandle, ipBufferHeaderInput)) - { - StopTest(KErrGeneral, EFail); - } - } - else - { - TCallBack callback03 (RAsyncTestStepOmxILPcmRenderer0005Step03, this); - delete ipKickoff03; - ipKickoff03 = NULL; - ipKickoff03 = - new (ELeave) CAsyncCallBack (callback03, CActive::EPriorityLow); - ipKickoff03->Call(); - } - } - -// -// RAsyncTestStepOmxILPcmRenderer0010 -// -RAsyncTestStepOmxILPcmRenderer0010::RAsyncTestStepOmxILPcmRenderer0010(const TDesC& aTestName, TInt aComponentUid) - : - RAsyncTestStepOmxILPcmRenderer0008(aTestName, aComponentUid) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0010::RAsyncTestStepOmxILPcmRenderer0010")); - iSamplingRate = 44100; - } - - -void -RAsyncTestStepOmxILPcmRenderer0010::KickoffTestL() - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0010::KickoffTestL")); - iTestState = EStateLoadKickoffTestLComplete; - - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test10 ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(AllocateBuffer-population) ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Executing ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Repeat these two steps until the whole file has beeen empited ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2a. - Call EmptyThisBuffer on PCM Renderer ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2b. - EmptyBufferDone callback received ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Executing->Idle and Idle->Executing (after 5 and again after 10 buffers played) ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Executing->Idle(BufferFlushing) ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 5.- Idle->Loaded(Depopulation) ")); - - // This will change the test file - iTestFileName.Set(KPcmRendererTestFile2); - - // This will install one callback - RAsyncTestStepOmxILComponentBase::KickoffTestL(); - - TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0005Step01, this); - delete ipKickoff01; - ipKickoff01 = NULL; - ipKickoff01 = - new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); - ipKickoff01->Call(); - } - -void -RAsyncTestStepOmxILPcmRenderer0010::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/, - OMX_EVENTTYPE aEvent, - TUint aData1, - TUint aData2, - TAny* /*aExtra*/) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0010::DoEventHandlerL")); - - switch (aEvent) - { - case OMX_EventError: - { - // Ignore underflow errors... - if (OMX_ErrorUnderflow == (OMX_S32)aData1) - { - INFO_PRINTF1(_L("DoEventHandlerL: [OMX_ErrorUnderflow]")); - } - else - { - INFO_PRINTF2(_L("DoEventHandlerL: OMX_EventError [%x]"), aData1); - return StopTest(KErrGeneral, EFail); - } - } - break; - - case OMX_EventCmdComplete: - { - switch(aData1) - { - case OMX_CommandStateSet: - { - switch(aData2) - { - case OMX_StateLoaded: - { - if (EStateTransitionToIdleComplete == iTestState) - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateLoaded [EStateTransitionToIdleComplete]")); - iTestState = EStateTransitionToLoadedComplete; - OMX_STATETYPE compState; - if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, - &compState)) - { - return StopTest(KErrGeneral, EFail); - } - - PrintOmxState(compState); - - if (OMX_StateLoaded != compState) - { - return StopTest(KErrGeneral, EFail); - } - - // The successful termination... - TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this); - delete ipKickoffStop; - ipKickoffStop = NULL; - ipKickoffStop = - new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow); - ipKickoffStop->Call(); - } - } - break; - case OMX_StateIdle: - { - if (EStateLoadKickoffTestLComplete == iTestState) - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateLoadKickoffTestLComplete]")); - iTestState = EStateTransitionToIdleComplete; - TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0005Step02, this); - delete ipKickoff02; - ipKickoff02 = NULL; - ipKickoff02 = - new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow); - ipKickoff02->Call(); - - } - else if (EStateTransitionToExecutingComplete == iTestState) - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateTransitionToExecutingComplete]")); - iTestState = EStateTransitionToIdleComplete; - - if(iNumOfEmptiedBuffers <= 20) - { - // Wait for a second... - User::After(1000000); - - // Resume playing... - TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0005Step02, this); - delete ipKickoff02; - ipKickoff02 = NULL; - ipKickoff02 = - new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow); - ipKickoff02->Call(); - } - else - { - // Playback finished - TCallBack callback04 (RAsyncTestStepOmxILPcmRenderer0005Step04, this); - delete ipKickoff04; - ipKickoff04 = NULL; - ipKickoff04 = - new (ELeave) CAsyncCallBack (callback04, CActive::EPriorityLow); - ipKickoff04->Call(); - } - } - else - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [Other]")); - return StopTest(KErrGeneral, EFail); - } - } - break; - case OMX_StateExecuting: - { - if (EStateTransitionToIdleComplete == iTestState) - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [EStateTransitionToIdleComplete]")); - iTestState = EStateTransitionToExecutingComplete; - - CMMFDataBuffer& dataBuffer = *(static_cast(ipBufferHeaderInput->pInputPortPrivate)); - ipTestFile->ReadNextBuffer(dataBuffer); - - // Send a buffer to the input port - ipBufferHeaderInput->nFilledLen = dataBuffer.BufferSize(); - - if (OMX_ErrorNone != ipCompHandle->EmptyThisBuffer( - ipCompHandle, ipBufferHeaderInput)) - { - StopTest(KErrGeneral, EFail); - } - } - else if (EStateTransitionToPauseComplete == iTestState) - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [EStateTransitionToIdleComplete]")); - iTestState = EStateTransitionToExecutingComplete; - } - else - { - INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [Other]")); - return StopTest(KErrGeneral, EFail); - } - } - break; - default: - { - INFO_PRINTF2(_L("DoEventHandlerL: OMX_State [%d]"), aData2); - return StopTest(KErrGeneral, EFail); - } - }; - } - break; - default: - { - INFO_PRINTF2(_L("DoEventHandlerL: OMX_Command [%d]"), aData1); - return StopTest(KErrGeneral, EFail); - } - }; - } - break; - default: - { - INFO_PRINTF2(_L("DoEventHandlerL: OMX Event [%d]"), aEvent); - return StopTest(KErrGeneral, EFail); - } - }; - - } - -void -RAsyncTestStepOmxILPcmRenderer0010::DoEmptyBufferDoneL(OMX_HANDLETYPE /*aComponent*/, - OMX_BUFFERHEADERTYPE* /*aBuffer*/) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0010::DoEmptyBufferDoneL")); - INFO_PRINTF1(_L("DoEmptyBufferDoneL : Callback received ")); - - iNumOfEmptiedBuffers++; - if (iNumOfEmptiedBuffers == 5 || iNumOfEmptiedBuffers == 10) - { - // - // Move component to OMX_StateIdle - // - - if (OMX_ErrorNone != ipCompHandle->SendCommand( - ipCompHandle, - OMX_CommandStateSet, - OMX_StateIdle, - 0)) - { - return StopTest(KErrGeneral, EFail); - } - - OMX_STATETYPE compState; - if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, - &compState)) - { - return StopTest(KErrGeneral, EFail); - } - - PrintOmxState(compState); - - if (OMX_StateIdle != compState) - { - return StopTest(KErrGeneral, EFail); - } - - // Reset the file position - ipTestFile->ResetPos(); - } - else - { - CMMFDataBuffer& dataBuffer = *(static_cast(ipBufferHeaderInput->pInputPortPrivate)); - ipTestFile->ReadNextBuffer(dataBuffer); - - if (dataBuffer.BufferSize() > 0) - { - // Send a buffer to the input port - ipBufferHeaderInput->nFilledLen = dataBuffer.BufferSize(); - - if (OMX_ErrorNone != ipCompHandle->EmptyThisBuffer( - ipCompHandle, ipBufferHeaderInput)) - { - StopTest(KErrGeneral, EFail); - } - } - else - { - TCallBack callback03 (RAsyncTestStepOmxILPcmRenderer0005Step03, this); - delete ipKickoff03; - ipKickoff03 = NULL; - ipKickoff03 = - new (ELeave) CAsyncCallBack (callback03, CActive::EPriorityLow); - ipKickoff03->Call(); - } - } - } - -TInt -RAsyncTestStepOmxILPcmRenderer0010::RAsyncTestStepOmxILPcmRenderer0010Step01(TAny* aPtr) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0010::RAsyncTestStepOmxILPcmRenderer0010Step01")); - RAsyncTestStepOmxILPcmRenderer0010* self = - static_cast (aPtr); - self->DoRAsyncTestStepOmxILPcmRenderer0010Step01(); - return KErrNone; - } - -void -RAsyncTestStepOmxILPcmRenderer0010::DoRAsyncTestStepOmxILPcmRenderer0010Step01() - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0010::DoRAsyncTestStepOmxILPcmRenderer0010Step01")); - - // - // Provide callbacks to component - // - OMX_CALLBACKTYPE* omxCallbacks = *ipCallbackHandler; - - if (OMX_ErrorNone != ipCompHandle->SetCallbacks( - ipCompHandle, - omxCallbacks, - ipCallbackHandler)) - { - return StopTest(KErrGeneral, EFail); - } - - INFO_PRINTF2(_L("Component Callbacks set successfully: %X"), ipCallbackHandler); - - // - // Obtain the port def params for Port #0 - // - OMX_PARAM_PORTDEFINITIONTYPE portParamsInputPort; - portParamsInputPort.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE); - portParamsInputPort.nVersion = TOmxILSpecVersion(); - portParamsInputPort.nPortIndex = 0; - if (OMX_ErrorNone != ipCompHandle->GetParameter( - ipCompHandle, - OMX_IndexParamPortDefinition, - &portParamsInputPort)) - { - return StopTest(KErrGeneral, EFail); - } - - // - // Change the sampling rate on PCM Renderer's port #0 - // - OMX_AUDIO_PARAM_PCMMODETYPE pcmMode; - pcmMode.nSize = sizeof(OMX_AUDIO_PARAM_PCMMODETYPE); - pcmMode.nVersion = TOmxILSpecVersion(); - pcmMode.nPortIndex = 0; - if (OMX_ErrorNone != ipCompHandle->GetParameter( - ipCompHandle, - OMX_IndexParamAudioPcm, - &pcmMode)) - { - return StopTest(KErrGeneral, EFail); - } - pcmMode.nSamplingRate = 44100; - if (OMX_ErrorNone != ipCompHandle->SetParameter( - ipCompHandle, - OMX_IndexParamAudioPcm, - &pcmMode)) - { - return StopTest(KErrGeneral, EFail); - } - - // - // Move component to OMX_StateIdle - // - - if (OMX_ErrorNone != ipCompHandle->SendCommand( - ipCompHandle, - OMX_CommandStateSet, - OMX_StateIdle, - 0)) - { - return StopTest(KErrGeneral, EFail); - } - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Moving component to OMX_StateIdle")); - - OMX_STATETYPE compState; - if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, - &compState)) - { - return StopTest(KErrGeneral, EFail); - } - - PrintOmxState(compState); - - if (OMX_StateLoaded != compState) - { - return StopTest(KErrGeneral, EFail); - } - - - // - // Allocate buffer on input port - // - if (OMX_ErrorNone != ipCompHandle->AllocateBuffer( - ipCompHandle, - &ipBufferHeaderInput, - 0, // input port - 0, - portParamsInputPort.nBufferSize)) - { - return StopTest(KErrGeneral, EFail); - } - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Populated buffer (AllocateBuffer) in INPUT port")); - } - - -// -// RAsyncTestStepOmxILPcmRenderer0030 -// -RAsyncTestStepOmxILPcmRenderer0030::RAsyncTestStepOmxILPcmRenderer0030(const TDesC& aTestName, TInt aComponentUid) - : - RAsyncTestStepOmxILPcmRenderer0008(aTestName, aComponentUid) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0030::RAsyncTestStepOmxILPcmRenderer0030")); - } - - -void -RAsyncTestStepOmxILPcmRenderer0030::KickoffTestL() - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0030::KickoffTestL")); - iTestState = EStateLoadKickoffTestLComplete; - - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test30 ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(AllocateBuffer-population) ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Executing ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Repeat these two steps until the whole file has beeen empited ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2a. - Call EmptyThisBuffer on PCM Renderer ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2b. - EmptyBufferDone callback received ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2c. - Get Bytes Played parameter and compare with the bytes readed from file ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Executing->Idle(BufferFlushing) ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Idle->Loaded(Depopulation) ")); - - // This will change the test file - iTestFileName.Set(KPcmRendererTestFile); - - // This will install one callback - RAsyncTestStepOmxILComponentBase::KickoffTestL(); - - TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0005Step01, this); - delete ipKickoff01; - ipKickoff01 = NULL; - ipKickoff01 = - new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); - ipKickoff01->Call(); - } - -void -RAsyncTestStepOmxILPcmRenderer0030::DoEmptyBufferDoneL(OMX_HANDLETYPE /*aComponent*/, - OMX_BUFFERHEADERTYPE* aBuffer) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0030::DoEmptyBufferDoneL")); - INFO_PRINTF1(_L("DoEmptyBufferDoneL : Callback received ")); - - // Check that GetConfig is returning the correct amount of bytes played - OMX_SYMBIAN_AUDIO_CONFIG_PCM_BYTESPLAYED bytesPlayedStruct; - bytesPlayedStruct.nSize = sizeof(OMX_SYMBIAN_AUDIO_CONFIG_PCM_BYTESPLAYED); - bytesPlayedStruct.nVersion = TOmxILSpecVersion(); - if (OMX_ErrorNone != ipCompHandle->GetConfig(ipCompHandle, - static_cast(OMX_SymbianIndexConfigAudioBytesPlayed), - &bytesPlayedStruct)) - { - StopTest(KErrGeneral, EFail); - } - //check the number of bytes played by the device corresponds - //to the number of bytes readed from file - //allow an extra margin of one buffer. - TUint minAllowedBytesPlayed = ipTestFile->GetPos() - aBuffer->nAllocLen; - TUint maxAllowedBytesPlayed =ipTestFile->GetPos(); - if ((bytesPlayedStruct.nBytesPlayed < minAllowedBytesPlayed)||(bytesPlayedStruct.nBytesPlayed > maxAllowedBytesPlayed)) - { - StopTest(KErrGeneral, EFail); - } - - CMMFDataBuffer& dataBuffer = *(static_cast(ipBufferHeaderInput->pInputPortPrivate)); - ipTestFile->ReadNextBuffer(dataBuffer); - - if (dataBuffer.BufferSize() > 0) - { - // Send a buffer to the input port - ipBufferHeaderInput->nFilledLen = dataBuffer.BufferSize(); - - if (OMX_ErrorNone != ipCompHandle->EmptyThisBuffer( - ipCompHandle, ipBufferHeaderInput)) - { - StopTest(KErrGeneral, EFail); - } - } - else - { - TCallBack callback03 (RAsyncTestStepOmxILPcmRenderer0005Step03, this); - delete ipKickoff03; - ipKickoff03 = NULL; - ipKickoff03 = - new (ELeave) CAsyncCallBack (callback03, CActive::EPriorityLow); - ipKickoff03->Call(); - } - } - -// -// RAsyncTestStepOmxILPcmRenderer0031 -// -RAsyncTestStepOmxILPcmRenderer0031::RAsyncTestStepOmxILPcmRenderer0031(const TDesC& aTestName, TInt aComponentUid) - : - RAsyncTestStepOmxILPcmRenderer0008(aTestName, aComponentUid) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0031::RAsyncTestStepOmxILPcmRenderer0031")); - iSamplingRate = 44100; - } - - -void -RAsyncTestStepOmxILPcmRenderer0031::KickoffTestL() - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0031::KickoffTestL")); - iTestState = EStateLoadKickoffTestLComplete; - - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test31 ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(AllocateBuffer-population) ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Executing ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Repeat these two steps until the whole file has beeen empited ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2a. - Call EmptyThisBuffer on PCM Renderer ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2b. - EmptyBufferDone callback received ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Set Volume Ramp to 2s (after 5 buffers played) ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Executing->Idle(BufferFlushing) ")); - INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 5.- Idle->Loaded(Depopulation) ")); - - // This will change the test file - iTestFileName.Set(KPcmRendererTestFile2); - - // This will install one callback - RAsyncTestStepOmxILComponentBase::KickoffTestL(); - - TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0005Step01, this); - delete ipKickoff01; - ipKickoff01 = NULL; - ipKickoff01 = - new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); - ipKickoff01->Call(); - } - -void -RAsyncTestStepOmxILPcmRenderer0031::DoEmptyBufferDoneL(OMX_HANDLETYPE /*aComponent*/, - OMX_BUFFERHEADERTYPE* /*aBuffer*/) - { - DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0031::DoEmptyBufferDoneL")); - INFO_PRINTF1(_L("DoEmptyBufferDoneL : Callback received ")); - - iNumOfEmptiedBuffers++; - if (iNumOfEmptiedBuffers == 5) - { - OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP volumeRampStruct; - volumeRampStruct.nSize = sizeof(OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP); - volumeRampStruct.nVersion = TOmxILSpecVersion(); - volumeRampStruct.nPortIndex = 0; - if (OMX_ErrorNone != ipCompHandle->GetConfig(ipCompHandle, - static_cast(OMX_SymbianIndexConfigAudioPcmVolumeRamp), - &volumeRampStruct)) - { - StopTest(KErrGeneral, EFail); - } - volumeRampStruct.nRampDuration = 2000000; // 2 second - if (OMX_ErrorNone != ipCompHandle->SetConfig(ipCompHandle, - static_cast(OMX_SymbianIndexConfigAudioPcmVolumeRamp), - &volumeRampStruct)) - { - StopTest(KErrGeneral, EFail); - } - INFO_PRINTF1(_L("Volume ramp set")); - } - - CMMFDataBuffer& dataBuffer = *(static_cast(ipBufferHeaderInput->pInputPortPrivate)); - ipTestFile->ReadNextBuffer(dataBuffer); - - if (dataBuffer.BufferSize() > 0) - { - // Send a buffer to the input port - ipBufferHeaderInput->nFilledLen = dataBuffer.BufferSize(); - - if (OMX_ErrorNone != ipCompHandle->EmptyThisBuffer( - ipCompHandle, ipBufferHeaderInput)) - { - StopTest(KErrGeneral, EFail); - } - } - else - { - TCallBack callback03 (RAsyncTestStepOmxILPcmRenderer0005Step03, this); - delete ipKickoff03; - ipKickoff03 = NULL; - ipKickoff03 = - new (ELeave) CAsyncCallBack (callback03, CActive::EPriorityLow); - ipKickoff03->Call(); - } - } +// 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 +#include +#include +#include + +#include +#include + +#include +#include "omxilsymbianaudiopcmextensions.h" + +#include "log.h" +#include "omxilpcmrenderer.hrh" +#include "omxilspecversion.h" + +#include "tsu_omxil_pcmrenderer_step.h" + +_LIT8(KSymbianOmxILPcmRendererRole, "audio_renderer.pcm"); +_LIT8(KTestOmxILWrongRendererRole, "audio_renderer.wrong"); +_LIT(KPcmRendererTestFile, "c:\\omxil\\testfiles\\pcm16stereo8khz.raw"); +_LIT(KPcmRendererTestFile2, "c:\\omxil\\testfiles\\pcm16stereo44khz.raw"); + +OMX_ERRORTYPE ComponentInit(OMX_HANDLETYPE /*aComponent*/) + { + return OMX_ErrorNone; + } + + +// +// RAsyncTestStepOmxILPcmRenderer0020 +// +RAsyncTestStepOmxILPcmRenderer0020::RAsyncTestStepOmxILPcmRenderer0020(const TDesC& aTestName, TInt aComponentUid) + : + RAsyncTestStepOmxILComponentBase(aTestName, aComponentUid), + ipKickoff01(NULL), + ipKickoff02(NULL), + ipKickoff03(NULL), + ipKickoff04(NULL), + ipKickoff05(NULL), + ipKickoff06(NULL) + + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0020::RAsyncTestStepOmxILPcmRenderer0020")); + } + + +void +RAsyncTestStepOmxILPcmRenderer0020::KickoffTestL() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0020::KickoffTestL")); + + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test20 ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Init Component ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Obtain the component's state (GetState) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Obtain the component's version (GetComponentVersion) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Provide callbacks to component (SetCallbacks) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 5.- Obtain the port def params for Port #0 (GetParameter) ")); + + // This will install one callback + RAsyncTestStepOmxILComponentBase::KickoffTestL(); + + // This is the only step in this test... + TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0020Step01, this); + delete ipKickoff01; + ipKickoff01 = NULL; + ipKickoff01 = + new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); + ipKickoff01->Call(); + + // The successful termination... + TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this); + delete ipKickoffStop; + ipKickoffStop = NULL; + ipKickoffStop = + new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow); + ipKickoffStop->Call(); + + } + +void +RAsyncTestStepOmxILPcmRenderer0020::CloseTest() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0020::CloseTest")); + + delete ipKickoff01; // no need to Cancel + ipKickoff01 = NULL; + delete ipKickoff02; // no need to Cancel + ipKickoff02 = NULL; + delete ipKickoff03; // no need to Cancel + ipKickoff03 = NULL; + delete ipKickoff04; // no need to Cancel + ipKickoff04 = NULL; + delete ipKickoff05; // no need to Cancel + ipKickoff05 = NULL; + delete ipKickoff06; // no need to Cancel + ipKickoff06 = NULL; + + delete ipKickoffStop; // no need to Cancel + ipKickoffStop = 0; + + RAsyncTestStepOmxILComponentBase::CloseTest(); + + } + + +void +RAsyncTestStepOmxILPcmRenderer0020::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/, + OMX_EVENTTYPE /*aEvent*/, + TUint /*aData1*/, + TUint /*aData2*/, + TAny* /*aExtra*/) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0020::DoEventHandlerL")); + + // We don't expect here any callback + return StopTest(KErrGeneral, EFail); + + } + + +TInt +RAsyncTestStepOmxILPcmRenderer0020::RAsyncTestStepOmxILPcmRenderer0020Step01(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0020::RAsyncTestStepOmxILPcmRenderer0020Step01")); + RAsyncTestStepOmxILPcmRenderer0020* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0020Step01(); + return KErrNone; + } + +void +RAsyncTestStepOmxILPcmRenderer0020::DoRAsyncTestStepOmxILPcmRenderer0020Step01() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0020::DoRAsyncTestStepOmxILPcmRenderer0020Step01")); + + + // + // Obtain the component's state + // + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateLoaded != compState) + { + return StopTest(KErrGeneral, EFail); + } + + char componentNameArray[OMX_MAX_STRINGNAME_SIZE]; + OMX_VERSIONTYPE componentVersion; + OMX_VERSIONTYPE specVersion; + OMX_UUIDTYPE componentUUID; + + // + // Obtain the component's version + // + + if (OMX_ErrorNone != ipCompHandle->GetComponentVersion( + ipCompHandle, + componentNameArray, + &componentVersion, + &specVersion, + &componentUUID)) + { + return StopTest(KErrGeneral, EFail); + } + + TBuf8<128> componentNameBuf8; + componentNameBuf8 = const_cast(reinterpret_cast(componentNameArray)); + TBuf<128> componentNameBuf16; + INFO_PRINTF2(_L("Component Name length: %d"), componentNameBuf8.Length()); + componentNameBuf16.Copy(componentNameBuf8); + componentNameBuf16.PtrZ(); + + // INFO_PRINTF2(_L("Component Name: %s"), dst.Ptr()); + INFO_PRINTF2(_L("Component Name: %S"), &componentNameBuf16); + INFO_PRINTF2(_L("Component Version Major: %d"), componentVersion.s.nVersionMajor); + INFO_PRINTF2(_L("Component Version Minor: %d"), componentVersion.s.nVersionMinor); + INFO_PRINTF2(_L("Component Version Revision: %d"), componentVersion.s.nRevision); + INFO_PRINTF2(_L("Component Version Step: %d"), componentVersion.s.nStep); + INFO_PRINTF2(_L("OMX Version Major: %d"), specVersion.s.nVersionMajor); + INFO_PRINTF2(_L("OMX Version Minor: %d"), specVersion.s.nVersionMinor); + INFO_PRINTF2(_L("OMX Version Revision: %d"), specVersion.s.nRevision); + INFO_PRINTF2(_L("OMX Version Step: %d"), specVersion.s.nStep); + INFO_PRINTF2(_L("Component UUID: %X"), componentUUID); + + + // + // Provide callbacks to component + // + OMX_CALLBACKTYPE* omxCallbacks = *ipCallbackHandler; + + if (OMX_ErrorNone != ipCompHandle->SetCallbacks( + ipCompHandle, + omxCallbacks, + ipCallbackHandler)) + { + return StopTest(KErrGeneral, EFail); + } + + INFO_PRINTF2(_L("Component Callbacks set successfully: %X"), ipCallbackHandler); + + // + // Obtain the port def params for Port #0 + // + OMX_PARAM_PORTDEFINITIONTYPE portParamsInputPort; + portParamsInputPort.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE); + portParamsInputPort.nVersion = TOmxILSpecVersion(); + portParamsInputPort.nPortIndex = 0; + if (OMX_ErrorNone != ipCompHandle->GetParameter( + ipCompHandle, + OMX_IndexParamPortDefinition, + &portParamsInputPort)) + { + return StopTest(KErrGeneral, EFail); + } + + INFO_PRINTF2(_L("PORTDEFINITIONTYPE nPortIndex: %d"), portParamsInputPort.nPortIndex); + INFO_PRINTF2(_L("PORTDEFINITIONTYPE eDir: %d"), portParamsInputPort.eDir); + INFO_PRINTF2(_L("PORTDEFINITIONTYPE nBufferCountActual: %d"), portParamsInputPort.nBufferCountActual); + INFO_PRINTF2(_L("PORTDEFINITIONTYPE nBufferCountMin: %d"), portParamsInputPort.nBufferCountMin); + INFO_PRINTF2(_L("PORTDEFINITIONTYPE nBufferSize: %d"), portParamsInputPort.nBufferSize); + INFO_PRINTF2(_L("PORTDEFINITIONTYPE bEnabled: %d"), portParamsInputPort.bEnabled == OMX_FALSE ? 0 : 1); + INFO_PRINTF2(_L("PORTDEFINITIONTYPE bPopulated: %d"), portParamsInputPort.bPopulated == OMX_FALSE ? 0 : 1); + INFO_PRINTF2(_L("PORTDEFINITIONTYPE eDomain: %d"), portParamsInputPort.eDomain); + + TBuf8<128> cMIMEType8Input; + cMIMEType8Input = const_cast(reinterpret_cast(portParamsInputPort.format.audio.cMIMEType)); + + TBuf<128> cMIMEType16Input; + cMIMEType16Input.Copy(cMIMEType8Input); + cMIMEType16Input.PtrZ(); + + INFO_PRINTF2(_L("PORTDEFINITIONTYPE format.cMIMEType: %S"), &cMIMEType16Input); + INFO_PRINTF2(_L("PORTDEFINITIONTYPE format.pNativeRender: %X"), portParamsInputPort.format.audio.pNativeRender); + INFO_PRINTF2(_L("PORTDEFINITIONTYPE format.bFlagErrorConcealment: %d"), + portParamsInputPort.format.audio.bFlagErrorConcealment == OMX_FALSE ? 0 : 1); + INFO_PRINTF2(_L("PORTDEFINITIONTYPE format.eEncoding: %d"), portParamsInputPort.format.audio.eEncoding); + INFO_PRINTF2(_L("PORTDEFINITIONTYPE bBuffersContiguous: %d"), + portParamsInputPort.bBuffersContiguous == OMX_FALSE ? 0 : 1); + INFO_PRINTF2(_L("PORTDEFINITIONTYPE nBufferAlignment: %d"), portParamsInputPort.nBufferAlignment); + } + +// +// RAsyncTestStepOmxILPcmRenderer0021 +// +RAsyncTestStepOmxILPcmRenderer0021::RAsyncTestStepOmxILPcmRenderer0021(const TDesC& aTestName, TInt aComponentUid) + : + RAsyncTestStepOmxILComponentBase(aTestName, aComponentUid), + ipKickoff01(NULL), + ipKickoff02(NULL), + ipKickoff03(NULL), + ipKickoff04(NULL), + ipKickoff05(NULL), + ipKickoff06(NULL) + + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0021::RAsyncTestStepOmxILPcmRenderer0021")); + } + + +void +RAsyncTestStepOmxILPcmRenderer0021::KickoffTestL() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0021::KickoffTestL")); + + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test21 ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Init Component ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Provide callbacks to component (SetCallbacks) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Obtain the component's state (GetState) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Obtain component's role #1 with null string (ComponentRoleEnum fails with OMX_ErrorBadParameter) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 5.- Obtain component's role #1 (ComponentRoleEnum returns audio_renderer.pcm) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 6.- Obtain component's role #2 (ComponentRoleEnum fails with OMX_ErrorNoMore) ")); + + // This will install one callback + RAsyncTestStepOmxILComponentBase::KickoffTestL(); + + // This is the only step in this test... + TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0021Step01, this); + delete ipKickoff01; + ipKickoff01 = NULL; + ipKickoff01 = + new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); + ipKickoff01->Call(); + + // The successful termination... + TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this); + delete ipKickoffStop; + ipKickoffStop = NULL; + ipKickoffStop = + new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow); + ipKickoffStop->Call(); + + } + +void +RAsyncTestStepOmxILPcmRenderer0021::CloseTest() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0021::CloseTest")); + + delete ipKickoff01; // no need to Cancel + ipKickoff01 = NULL; + delete ipKickoff02; // no need to Cancel + ipKickoff02 = NULL; + delete ipKickoff03; // no need to Cancel + ipKickoff03 = NULL; + delete ipKickoff04; // no need to Cancel + ipKickoff04 = NULL; + delete ipKickoff05; // no need to Cancel + ipKickoff05 = NULL; + delete ipKickoff06; // no need to Cancel + ipKickoff06 = NULL; + + delete ipKickoffStop; // no need to Cancel + ipKickoffStop = 0; + + RAsyncTestStepOmxILComponentBase::CloseTest(); + + } + + +void +RAsyncTestStepOmxILPcmRenderer0021::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/, + OMX_EVENTTYPE /*aEvent*/, + TUint /*aData1*/, + TUint /*aData2*/, + TAny* /*aExtra*/) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0021::DoEventHandlerL")); + + // We don't expect here any callback + return StopTest(KErrGeneral, EFail); + + } + + +TInt +RAsyncTestStepOmxILPcmRenderer0021::RAsyncTestStepOmxILPcmRenderer0021Step01(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0021::RAsyncTestStepOmxILPcmRenderer0021Step01")); + RAsyncTestStepOmxILPcmRenderer0021* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0021Step01(); + return KErrNone; + } + +void +RAsyncTestStepOmxILPcmRenderer0021::DoRAsyncTestStepOmxILPcmRenderer0021Step01() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0021::DoRAsyncTestStepOmxILPcmRenderer0021Step01")); + + // + // Provide callbacks to component + // + OMX_CALLBACKTYPE* omxCallbacks = *ipCallbackHandler; + + if (OMX_ErrorNone != ipCompHandle->SetCallbacks( + ipCompHandle, + omxCallbacks, + ipCallbackHandler)) + { + return StopTest(KErrGeneral, EFail); + } + + // + // Obtain the component's state + // + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateLoaded != compState) + { + return StopTest(KErrGeneral, EFail); + } + + INFO_PRINTF2(_L("Component Callbacks set successfully: %X"), ipCallbackHandler); + + + // + // Try to obtain the component's first role with null string (must fail with error OMX_ErrorBadParameter) + // + OMX_U8* pNullUint = 0; + if (OMX_ErrorBadParameter != ipCompHandle->ComponentRoleEnum( + ipCompHandle, + pNullUint, + 0 // This is index # 0, the first of the component's roles + )) + { + return StopTest(KErrGeneral, EFail); + } + + // + // Obtain the component's first role (success) + // + char componentRoleArray[OMX_MAX_STRINGNAME_SIZE]; + if (OMX_ErrorNone != ipCompHandle->ComponentRoleEnum( + ipCompHandle, + reinterpret_cast(componentRoleArray), + 0 // This is index # 0, the first of the component's roles + )) + { + return StopTest(KErrGeneral, EFail); + } + + TBuf8<128> componentRoleBuf8; + componentRoleBuf8 = const_cast(reinterpret_cast(componentRoleArray)); + TBuf<128> componentRoleBuf16; + INFO_PRINTF2(_L("Component's Role length: %d"), componentRoleBuf8.Length()); + componentRoleBuf16.Copy(componentRoleBuf8); + componentRoleBuf16.PtrZ(); + + INFO_PRINTF2(_L("Component's 1st Role [%S] "), &componentRoleBuf16); + + if (componentRoleBuf8.Compare(KSymbianOmxILPcmRendererRole()) != 0) + { + return StopTest(KErrGeneral, EFail); + } + + // + // Obtain the component's second role (must fail with error OMX_ErrorNoMore) + // + if (OMX_ErrorNoMore != ipCompHandle->ComponentRoleEnum( + ipCompHandle, + reinterpret_cast(componentRoleArray), + 1 // This is index # 1, the second of the component's roles + )) + { + return StopTest(KErrGeneral, EFail); + } + + } + +// +// RAsyncTestStepOmxILPcmRenderer0022 +// +RAsyncTestStepOmxILPcmRenderer0022::RAsyncTestStepOmxILPcmRenderer0022(const TDesC& aTestName, TInt aComponentUid) + : + RAsyncTestStepOmxILComponentBase(aTestName, aComponentUid), + ipKickoff01(NULL), + ipKickoff02(NULL), + ipKickoff03(NULL), + ipKickoff04(NULL), + ipKickoff05(NULL), + ipKickoff06(NULL) + + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0022::RAsyncTestStepOmxILPcmRenderer0022")); + } + + +void +RAsyncTestStepOmxILPcmRenderer0022::KickoffTestL() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0022::KickoffTestL")); + + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test22 ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Init Component ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Provide callbacks to component (SetCallbacks) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Obtain the component's state (GetState) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Get component's current role (GetParameter(OMX_IndexParamStandardComponentRole) )")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 5.- Set unsupported audio_renderer.wrong role (SetParameter(OMX_IndexParamStandardComponentRole) )")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 5a.- SetParameter returns OMX_ErrorBadParameter (audio_renderer.wrong role not supported)")); + + // This will install one callback + RAsyncTestStepOmxILComponentBase::KickoffTestL(); + + // This is the only step in this test... + TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0022Step01, this); + delete ipKickoff01; + ipKickoff01 = NULL; + ipKickoff01 = + new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); + ipKickoff01->Call(); + + // The successful termination... + TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this); + delete ipKickoffStop; + ipKickoffStop = NULL; + ipKickoffStop = + new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow); + ipKickoffStop->Call(); + + } + +void +RAsyncTestStepOmxILPcmRenderer0022::CloseTest() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0022::CloseTest")); + + delete ipKickoff01; // no need to Cancel + ipKickoff01 = NULL; + delete ipKickoff02; // no need to Cancel + ipKickoff02 = NULL; + delete ipKickoff03; // no need to Cancel + ipKickoff03 = NULL; + delete ipKickoff04; // no need to Cancel + ipKickoff04 = NULL; + delete ipKickoff05; // no need to Cancel + ipKickoff05 = NULL; + delete ipKickoff06; // no need to Cancel + ipKickoff06 = NULL; + + delete ipKickoffStop; // no need to Cancel + ipKickoffStop = 0; + + RAsyncTestStepOmxILComponentBase::CloseTest(); + + } + + +void +RAsyncTestStepOmxILPcmRenderer0022::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/, + OMX_EVENTTYPE /*aEvent*/, + TUint /*aData1*/, + TUint /*aData2*/, + TAny* /*aExtra*/) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0022::DoEventHandlerL")); + + // We don't expect here any callback + return StopTest(KErrGeneral, EFail); + + } + + +TInt +RAsyncTestStepOmxILPcmRenderer0022::RAsyncTestStepOmxILPcmRenderer0022Step01(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0022::RAsyncTestStepOmxILPcmRenderer0022Step01")); + RAsyncTestStepOmxILPcmRenderer0022* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0022Step01(); + return KErrNone; + } + +void +RAsyncTestStepOmxILPcmRenderer0022::DoRAsyncTestStepOmxILPcmRenderer0022Step01() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0022::DoRAsyncTestStepOmxILPcmRenderer0022Step01")); + + // + // Provide callbacks to component + // + OMX_CALLBACKTYPE* omxCallbacks = *ipCallbackHandler; + + if (OMX_ErrorNone != ipCompHandle->SetCallbacks( + ipCompHandle, + omxCallbacks, + ipCallbackHandler)) + { + return StopTest(KErrGeneral, EFail); + } + + INFO_PRINTF2(_L("Component Callbacks set successfully: %X"), ipCallbackHandler); + + // + // Obtain the component's state + // + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateLoaded != compState) + { + return StopTest(KErrGeneral, EFail); + } + + // + // Get component's current standard role + // + OMX_PARAM_COMPONENTROLETYPE componentRoleType; + componentRoleType.nSize = sizeof(OMX_PARAM_COMPONENTROLETYPE); + componentRoleType.nVersion = TOmxILSpecVersion(); + if (OMX_ErrorNone != ipCompHandle->GetParameter( + ipCompHandle, + OMX_IndexParamStandardComponentRole, + &componentRoleType)) + { + return StopTest(KErrGeneral, EFail); + } + + TBuf8<128> componentRoleBuf8; + componentRoleBuf8 = const_cast(reinterpret_cast(componentRoleType.cRole)); + TBuf<128> componentRoleBuf16; + INFO_PRINTF2(_L("Component Role length: %d"), componentRoleBuf8.Length()); + componentRoleBuf16.Copy(componentRoleBuf8); + componentRoleBuf16.PtrZ(); + + INFO_PRINTF2(_L("Component's current Role: %S"), &componentRoleBuf16); + + + // + // Set unsupported standard role + // + TPtr8 role(reinterpret_cast(componentRoleType.cRole), + OMX_MAX_STRINGNAME_SIZE); + role.Copy(KTestOmxILWrongRendererRole()); + role.PtrZ(); + + if (OMX_ErrorBadParameter != ipCompHandle->SetParameter( + ipCompHandle, + OMX_IndexParamStandardComponentRole, + &componentRoleType)) + { + return StopTest(KErrGeneral, EFail); + } + + TBuf8<128> cRole8; + cRole8 = const_cast(reinterpret_cast(componentRoleType.cRole)); + + TBuf<128> cRole16; + cRole16.Copy(cRole8); + cRole16.PtrZ(); + + INFO_PRINTF2(_L("SetParameter of an unsupported standard role failed (success): %S"), &cRole16); + + } + + + +// +// RAsyncTestStepOmxILPcmRenderer0001 +// +RAsyncTestStepOmxILPcmRenderer0001::RAsyncTestStepOmxILPcmRenderer0001(const TDesC& aTestName, TInt aComponentUid) + : + RAsyncTestStepOmxILComponentBase(aTestName, aComponentUid), + ipBufferHeaderInput(0), + ipBufferHeaderOutput(0), + iTerminateNow(EFalse), + iSamplingRate(8000), + iTestState(EStateDefault), + ipKickoff01(NULL), + ipKickoff02(NULL), + ipKickoff03(NULL), + ipKickoff04(NULL), + ipKickoff05(NULL), + ipKickoff06(NULL) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0001::RAsyncTestStepOmxILPcmRenderer0001")); + } + + +void +RAsyncTestStepOmxILPcmRenderer0001::KickoffTestL() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0001::KickoffTestL")); + iTestState = EStateLoadKickoffTestLComplete; + + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test01 ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(AllocateBuffer-population) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Loaded(depopulation) ")); + + // This will install one callback + RAsyncTestStepOmxILComponentBase::KickoffTestL(); + + TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0001Step01, this); + delete ipKickoff01; + ipKickoff01 = NULL; + ipKickoff01 = + new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); + ipKickoff01->Call(); + + } + +void +RAsyncTestStepOmxILPcmRenderer0001::CloseTest() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0001::CloseTest")); + + delete ipKickoff01; // no need to Cancel + ipKickoff01 = NULL; + delete ipKickoff02; // no need to Cancel + ipKickoff02 = NULL; + delete ipKickoff03; // no need to Cancel + ipKickoff03 = NULL; + delete ipKickoff04; // no need to Cancel + ipKickoff04 = NULL; + delete ipKickoff05; // no need to Cancel + ipKickoff05 = NULL; + delete ipKickoff06; // no need to Cancel + ipKickoff06 = NULL; + + delete ipKickoffStop; // no need to Cancel + ipKickoffStop = 0; + + TInt count = ipClientClockPortBufferArray.Count(); + + for (TInt n = 0; n < count; n++) + { + delete ipClientClockPortBufferArray[n]; + } + + ipClientClockPortBufferArray.Close(); + + RAsyncTestStepOmxILComponentBase::CloseTest(); + + } + + +void +RAsyncTestStepOmxILPcmRenderer0001::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/, + OMX_EVENTTYPE /*aEvent*/, + TUint /*aData1*/, + TUint /*aData2*/, + TAny* /*aExtra*/) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0001::DoEventHandlerL")); + + if (!iTerminateNow) + { + TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0001Step02, this); + delete ipKickoff02; + ipKickoff02 = NULL; + ipKickoff02 = + new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow); + ipKickoff02->Call(); + } + else + { + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateLoaded != compState) + { + return StopTest(KErrGeneral, EFail); + } + + // The successful termination... + TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this); + delete ipKickoffStop; + ipKickoffStop = NULL; + ipKickoffStop = + new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow); + ipKickoffStop->Call(); + } + + } + + +TInt +RAsyncTestStepOmxILPcmRenderer0001::RAsyncTestStepOmxILPcmRenderer0001Step01(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0001::RAsyncTestStepOmxILPcmRenderer0001Step01")); + RAsyncTestStepOmxILPcmRenderer0001* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0001Step01(); + return KErrNone; + } + +void +RAsyncTestStepOmxILPcmRenderer0001::DoRAsyncTestStepOmxILPcmRenderer0001Step01() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0001::DoRAsyncTestStepOmxILPcmRenderer0001Step01")); + + // + // Provide callbacks to component + // + OMX_CALLBACKTYPE* omxCallbacks = *ipCallbackHandler; + + if (OMX_ErrorNone != ipCompHandle->SetCallbacks( + ipCompHandle, + omxCallbacks, + ipCallbackHandler)) + { + return StopTest(KErrGeneral, EFail); + } + + INFO_PRINTF2(_L("Component Callbacks set successfully: %X"), ipCallbackHandler); + + // + // Obtain the port def params for Port #0 + // + OMX_PARAM_PORTDEFINITIONTYPE portParamsInputPort; + portParamsInputPort.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE); + portParamsInputPort.nVersion = TOmxILSpecVersion(); + portParamsInputPort.nPortIndex = 0; + if (OMX_ErrorNone != ipCompHandle->GetParameter( + ipCompHandle, + OMX_IndexParamPortDefinition, + &portParamsInputPort)) + { + return StopTest(KErrGeneral, EFail); + } + + // + // Obtain the port def params for Client Clock Port #1 + // + OMX_PARAM_PORTDEFINITIONTYPE portParamsInputPort1; + portParamsInputPort1.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE); + portParamsInputPort1.nVersion = TOmxILSpecVersion(); + portParamsInputPort1.nPortIndex = 1; + + if (OMX_ErrorNone != ipCompHandle->GetParameter( + ipCompHandle, + OMX_IndexParamPortDefinition, + &portParamsInputPort1)) + { + return StopTest(KErrGeneral, EFail); + } + + // + // Change the sampling rate on PCM Renderer's port #0 + // + OMX_AUDIO_PARAM_PCMMODETYPE pcmMode; + pcmMode.nSize = sizeof(OMX_AUDIO_PARAM_PCMMODETYPE); + pcmMode.nVersion = TOmxILSpecVersion(); + pcmMode.nPortIndex = 0; + if (OMX_ErrorNone != ipCompHandle->GetParameter( + ipCompHandle, + OMX_IndexParamAudioPcm, + &pcmMode)) + { + return StopTest(KErrGeneral, EFail); + } + pcmMode.nSamplingRate = iSamplingRate; + if (OMX_ErrorNone != ipCompHandle->SetParameter( + ipCompHandle, + OMX_IndexParamAudioPcm, + &pcmMode)) + { + return StopTest(KErrGeneral, EFail); + } + + // + // Move component to OMX_StateIdle + // + + if (OMX_ErrorNone != ipCompHandle->SendCommand( + ipCompHandle, + OMX_CommandStateSet, + OMX_StateIdle, + 0)) + { + return StopTest(KErrGeneral, EFail); + } + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Moving component to OMX_StateIdle")); + + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateLoaded != compState) + { + return StopTest(KErrGeneral, EFail); + } + + // + // Allocate buffer on input port + // + if (OMX_ErrorNone != ipCompHandle->AllocateBuffer( + ipCompHandle, + &ipBufferHeaderInput, + 0, // input port + 0, + portParamsInputPort.nBufferSize)) + { + return StopTest(KErrGeneral, EFail); + } + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Populated buffer (AllocateBuffer) in INPUT port")); + + // + // Allocate buffer on Client Clock Port + // + TInt bufferCount = portParamsInputPort1.nBufferCountActual; + + for (TInt n = 0; n < bufferCount; n++) + { + OMX_BUFFERHEADERTYPE* clockBufPtr; + + if (OMX_ErrorNone != ipCompHandle->AllocateBuffer( + ipCompHandle, + &clockBufPtr, + 1, // Clock input port + 0, + portParamsInputPort1.nBufferSize)) + { + return StopTest(KErrGeneral, EFail); + } + + if (ipClientClockPortBufferArray.Append(clockBufPtr) != KErrNone) + { + return StopTest(KErrNoMemory, EFail); + } + } + + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Populated buffer (AllocateBuffer) in Clock INPUT port")); + } + +TInt +RAsyncTestStepOmxILPcmRenderer0001::RAsyncTestStepOmxILPcmRenderer0001Step02(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0001::RAsyncTestStepOmxILPcmRenderer0001Step02")); + RAsyncTestStepOmxILPcmRenderer0001* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0001Step02(); + return KErrNone; + } + +void +RAsyncTestStepOmxILPcmRenderer0001::DoRAsyncTestStepOmxILPcmRenderer0001Step02() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0001::DoRAsyncTestStepOmxILPcmRenderer0001Step02")); + + // + // Move component to OMX_StateLoaded + // + + if (OMX_ErrorNone != ipCompHandle->SendCommand( + ipCompHandle, + OMX_CommandStateSet, + OMX_StateLoaded, + 0)) + { + return StopTest(KErrGeneral, EFail); + } + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Moving component to OMX_StateLoaded")); + + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateIdle != compState) + { + return StopTest(KErrGeneral, EFail); + } + + // + // Free buffer on input port + // + if (OMX_ErrorNone != ipCompHandle->FreeBuffer( + ipCompHandle, + 0, // input port + ipBufferHeaderInput)) + { + return StopTest(KErrGeneral, EFail); + } + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Depopulated buffer (FreeBuffer) in INPUT port")); + + // + // Free Client Clock Port buffer on input port + // + TInt count = ipClientClockPortBufferArray.Count(); + + for (TInt n = 0; n < count; n++) + { + if (OMX_ErrorNone != ipCompHandle->FreeBuffer( + ipCompHandle, + 1, // Client Clock Port + ipClientClockPortBufferArray[0])) + { + return StopTest(KErrGeneral, EFail); + } + + ipClientClockPortBufferArray.Remove(0); + } + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Depopulated Client Clock Port buffer (FreeBuffer) in INPUT port")); + + iTerminateNow = ETrue; + + } + + +// +// RAsyncTestStepOmxILPcmRenderer0002 +// +RAsyncTestStepOmxILPcmRenderer0002::RAsyncTestStepOmxILPcmRenderer0002(const TDesC& aTestName, TInt aComponentUid) + : + RAsyncTestStepOmxILPcmRenderer0001(aTestName, aComponentUid), + ipInputBuffer(0), + ipOutputBuffer(0) + + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0002::RAsyncTestStepOmxILPcmRenderer0002")); + } + + +void +RAsyncTestStepOmxILPcmRenderer0002::KickoffTestL() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0002::KickoffTestL")); + + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test02 ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(UseBuffer-population) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Loaded(depopulation) ")); + + // This will install one callback + RAsyncTestStepOmxILComponentBase::KickoffTestL(); + + TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0002Step01, this); + delete ipKickoff01; + ipKickoff01 = NULL; + ipKickoff01 = + new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); + ipKickoff01->Call(); + + } + +void +RAsyncTestStepOmxILPcmRenderer0002::CloseTest() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0002::CloseTest")); + + delete ipInputBuffer; + ipInputBuffer = NULL; + delete ipOutputBuffer; + ipOutputBuffer = NULL; + + delete ipKickoff01; // no need to Cancel + ipKickoff01 = NULL; + delete ipKickoff02; // no need to Cancel + ipKickoff02 = NULL; + delete ipKickoff03; // no need to Cancel + ipKickoff03 = NULL; + delete ipKickoff04; // no need to Cancel + ipKickoff04 = NULL; + delete ipKickoff05; // no need to Cancel + ipKickoff05 = NULL; + delete ipKickoff06; // no need to Cancel + ipKickoff06 = NULL; + + delete ipKickoffStop; // no need to Cancel + ipKickoffStop = 0; + + ipClientClockPortBufferArray.Close(); + + TInt count = iClockPortBufferPtrArray.Count(); + + for (TInt n = 0; n < count; n++) + { + delete iClockPortBufferPtrArray[n]; + } + + iClockPortBufferPtrArray.Close(); + + RAsyncTestStepOmxILComponentBase::CloseTest(); + + } + +void +RAsyncTestStepOmxILPcmRenderer0002::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/, + OMX_EVENTTYPE /*aEvent*/, + TUint /*aData1*/, + TUint /*aData2*/, + TAny* /*aExtra*/) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0002::DoEventHandlerL")); + + if (!iTerminateNow) + { + TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0002Step02, this); + delete ipKickoff02; + ipKickoff02 = NULL; + ipKickoff02 = + new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow); + ipKickoff02->Call(); + } + + if (iTerminateNow) + { + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateLoaded != compState) + { + return StopTest(KErrGeneral, EFail); + } + + // The successful termination... + TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this); + delete ipKickoffStop; + ipKickoffStop = NULL; + ipKickoffStop = + new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow); + ipKickoffStop->Call(); + } + + } + + +TInt +RAsyncTestStepOmxILPcmRenderer0002::RAsyncTestStepOmxILPcmRenderer0002Step01(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0002::RAsyncTestStepOmxILPcmRenderer0002Step01")); + RAsyncTestStepOmxILPcmRenderer0002* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0002Step01(); + return KErrNone; + } + +void +RAsyncTestStepOmxILPcmRenderer0002::DoRAsyncTestStepOmxILPcmRenderer0002Step01() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0002::DoRAsyncTestStepOmxILPcmRenderer0002Step01")); + + // + // Provide callbacks to component + // + OMX_CALLBACKTYPE* omxCallbacks = *ipCallbackHandler; + + if (OMX_ErrorNone != ipCompHandle->SetCallbacks( + ipCompHandle, + omxCallbacks, + ipCallbackHandler)) + { + return StopTest(KErrGeneral, EFail); + } + + INFO_PRINTF2(_L("Component Callbacks set successfully: %X"), ipCallbackHandler); + + // + // Obtain the port def params for Port #0 + // + OMX_PARAM_PORTDEFINITIONTYPE portParamsInputPort; + portParamsInputPort.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE); + portParamsInputPort.nVersion = TOmxILSpecVersion(); + portParamsInputPort.nPortIndex = 0; + if (OMX_ErrorNone != ipCompHandle->GetParameter( + ipCompHandle, + OMX_IndexParamPortDefinition, + &portParamsInputPort)) + { + return StopTest(KErrGeneral, EFail); + } + + // + // Obtain the port def params for Client Clock Port #1 + // + OMX_PARAM_PORTDEFINITIONTYPE portParamsInputPort1; + portParamsInputPort1.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE); + portParamsInputPort1.nVersion = TOmxILSpecVersion(); + portParamsInputPort1.nPortIndex = 1; + + if (OMX_ErrorNone != ipCompHandle->GetParameter( + ipCompHandle, + OMX_IndexParamPortDefinition, + &portParamsInputPort1)) + { + return StopTest(KErrGeneral, EFail); + } + + // + // Move component to OMX_StateIdle + // + + if (OMX_ErrorNone != ipCompHandle->SendCommand( + ipCompHandle, + OMX_CommandStateSet, + OMX_StateIdle, + 0)) + { + return StopTest(KErrGeneral, EFail); + } + + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateLoaded != compState) + { + return StopTest(KErrGeneral, EFail); + } + + + // + // Allocate buffer on input port + // + TRAPD(err, ipInputBuffer = CMMFDescriptorBuffer::NewL(portParamsInputPort.nBufferSize)); + if(err != KErrNone) + { + return StopTest(KErrGeneral, EFail); + } + + TDes8& inputBufferDes = ipInputBuffer->Data(); + + if (OMX_ErrorNone != ipCompHandle->UseBuffer( + ipCompHandle, + &ipBufferHeaderInput, + 0, // input port + ipInputBuffer, // pAppPrivate + portParamsInputPort.nBufferSize, + const_cast(inputBufferDes.Ptr()))) + { + return StopTest(KErrGeneral, EFail); + } + INFO_PRINTF1(_L("Populated buffer (UseBuffer) in INPUT port")); + + // + // Allocate Client Clock Port buffer + // + TInt bufferCount = portParamsInputPort1.nBufferCountActual; + + for (TInt n = 0; n < bufferCount; n++) + { + CMMFDescriptorBuffer* bufPtr; + + TRAPD(err, bufPtr = CMMFDescriptorBuffer::NewL(portParamsInputPort1.nBufferSize)); + + if(err != KErrNone) + { + return StopTest(KErrGeneral, EFail); + } + + if (iClockPortBufferPtrArray.Append(bufPtr) != KErrNone) + { + delete bufPtr; + return StopTest(KErrGeneral, EFail); + } + + TDes8& inputBufferDes = bufPtr->Data(); + OMX_BUFFERHEADERTYPE* clockBufPtr; + + if (OMX_ErrorNone != ipCompHandle->UseBuffer( + ipCompHandle, + &clockBufPtr, + 1, // Clock input port + ipInputBuffer, // pAppPrivate + portParamsInputPort.nBufferSize, + const_cast(inputBufferDes.Ptr()))) + { + return StopTest(KErrGeneral, EFail); + } + + TRAPD(error, ipClientClockPortBufferArray.AppendL(clockBufPtr)); + if(error != KErrNone) + { + return StopTest(KErrGeneral, EFail); + } + } + INFO_PRINTF1(_L("Populated buffer (UseBuffer) in Client Clock Port")); + + } + +TInt +RAsyncTestStepOmxILPcmRenderer0002::RAsyncTestStepOmxILPcmRenderer0002Step02(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0002::RAsyncTestStepOmxILPcmRenderer0002Step02")); + // NOTE, Here we reuse inherited code, to depopulate the component and make it go to OMX_StateLoaded + RAsyncTestStepOmxILPcmRenderer0002* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0001Step02(); + return KErrNone; + } + + +// +// RAsyncTestStepOmxILPcmRenderer0003 +// +RAsyncTestStepOmxILPcmRenderer0003::RAsyncTestStepOmxILPcmRenderer0003(const TDesC& aTestName, TInt aComponentUid) + : + RAsyncTestStepOmxILComponentBase(aTestName, aComponentUid), + iTerminateNow(EFalse), + ipKickoff01(NULL), + ipKickoff02(NULL), + ipKickoff03(NULL), + ipKickoff04(NULL), + ipKickoff05(NULL), + ipKickoff06(NULL) + + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0003::RAsyncTestStepOmxILPcmRenderer0003")); + } + + +void +RAsyncTestStepOmxILPcmRenderer0003::KickoffTestL() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0003::KickoffTestL")); + + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test03 ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->WaitForResources ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- WaitForResources->Loaded ")); + + // This will install one callback + RAsyncTestStepOmxILComponentBase::KickoffTestL(); + + TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0003Step01, this); + delete ipKickoff01; + ipKickoff01 = NULL; + ipKickoff01 = + new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); + ipKickoff01->Call(); + + // This will be used later in DoRAsyncTestStepOmxILPcmRenderer0003Step02 + TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this); + delete ipKickoffStop; + ipKickoffStop = NULL; + ipKickoffStop = + new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow); + + } + +void +RAsyncTestStepOmxILPcmRenderer0003::CloseTest() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0003::CloseTest")); + + delete ipKickoff01; // no need to Cancel + ipKickoff01 = NULL; + delete ipKickoff02; // no need to Cancel + ipKickoff02 = NULL; + delete ipKickoff03; // no need to Cancel + ipKickoff03 = NULL; + delete ipKickoff04; // no need to Cancel + ipKickoff04 = NULL; + delete ipKickoff05; // no need to Cancel + ipKickoff05 = NULL; + delete ipKickoff06; // no need to Cancel + ipKickoff06 = NULL; + + delete ipKickoffStop; // no need to Cancel + ipKickoffStop = 0; + + RAsyncTestStepOmxILComponentBase::CloseTest(); + + } + +void +RAsyncTestStepOmxILPcmRenderer0003::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/, + OMX_EVENTTYPE /*aEvent*/, + TUint /*aData1*/, + TUint /*aData2*/, + TAny* /*aExtra*/) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0003::DoEventHandlerL")); + + TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0003Step02, this); + delete ipKickoff02; + ipKickoff02 = NULL; + ipKickoff02 = + new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow); + ipKickoff02->Call(); + + } + + +TInt +RAsyncTestStepOmxILPcmRenderer0003::RAsyncTestStepOmxILPcmRenderer0003Step01(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0003::RAsyncTestStepOmxILPcmRenderer0003Step01")); + RAsyncTestStepOmxILPcmRenderer0003* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0003Step01(); + return KErrNone; + } + +void +RAsyncTestStepOmxILPcmRenderer0003::DoRAsyncTestStepOmxILPcmRenderer0003Step01() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0003::DoRAsyncTestStepOmxILPcmRenderer0003Step01")); + + // + // Obtain the component's state + // + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateLoaded != compState) + { + return StopTest(KErrGeneral, EFail); + } + + // + // Provide callbacks to component + // + OMX_CALLBACKTYPE* omxCallbacks = *ipCallbackHandler; + + if (OMX_ErrorNone != ipCompHandle->SetCallbacks( + ipCompHandle, + omxCallbacks, + ipCallbackHandler)) + { + return StopTest(KErrGeneral, EFail); + } + + INFO_PRINTF2(_L("Component Callbacks set successfully: %X"), ipCallbackHandler); + + // + // Move component to OMX_StateWaitForResources + // + + if (OMX_ErrorNone != ipCompHandle->SendCommand( + ipCompHandle, + OMX_CommandStateSet, + OMX_StateWaitForResources, + 0)) + { + return StopTest(KErrGeneral, EFail); + } + + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateWaitForResources != compState) + { + return StopTest(KErrGeneral, EFail); + } + + // + // The following code is to improve code coerage only + // + OMX_AUDIO_PARAM_PCMMODETYPE pcmMode; + pcmMode.nSize = sizeof(OMX_AUDIO_PARAM_PCMMODETYPE); + pcmMode.nVersion = TOmxILSpecVersion(); + pcmMode.nPortIndex = 0; + if (OMX_ErrorNone != ipCompHandle->GetParameter( + ipCompHandle, + OMX_IndexParamAudioPcm, + &pcmMode)) + { + return StopTest(KErrGeneral, EFail); + } + pcmMode.nSamplingRate = 44100; + if (OMX_ErrorNone != ipCompHandle->SetParameter( + ipCompHandle, + OMX_IndexParamAudioPcm, + &pcmMode)) + { + return StopTest(KErrGeneral, EFail); + } + OMX_BUFFERHEADERTYPE temp; + OMX_BUFFERHEADERTYPE* bufferHeaderInput=&temp; + if (OMX_ErrorIncorrectStateOperation != ipCompHandle->AllocateBuffer( + ipCompHandle, + &bufferHeaderInput, + 0, // input port + 0, + 1024)) + { + return StopTest(KErrGeneral, EFail); + } + + if (OMX_ErrorBadPortIndex != ipCompHandle->EmptyThisBuffer( + ipCompHandle, + bufferHeaderInput)) + { + return StopTest(KErrGeneral, EFail); + } + + if (OMX_ErrorBadPortIndex != ipCompHandle->FillThisBuffer( + ipCompHandle, + bufferHeaderInput)) + { + return StopTest(KErrGeneral, EFail); + } + + if (OMX_ErrorBadPortIndex != ipCompHandle->FreeBuffer( + ipCompHandle, + 2, + bufferHeaderInput)) + { + return StopTest(KErrGeneral, EFail); + } + + if (OMX_ErrorNone != ipCompHandle->SendCommand( + ipCompHandle, + OMX_CommandPortEnable, + 0, + 0)) + { + return StopTest(KErrGeneral, EFail); + } + + OMX_TUNNELSETUPTYPE tunnelSetup; + OMX_U32 outputPort = 1; + OMX_U32 inputPort = 0; + + if (OMX_ErrorIncorrectStateOperation != + ipCompHandle->ComponentTunnelRequest( + ipCompHandle, + outputPort, + ipCompHandle, + inputPort, + &tunnelSetup)) + { + return StopTest(KErrGeneral, EFail); + } + } + +TInt +RAsyncTestStepOmxILPcmRenderer0003::RAsyncTestStepOmxILPcmRenderer0003Step02(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0003::RAsyncTestStepOmxILPcmRenderer0003Step02")); + RAsyncTestStepOmxILPcmRenderer0003* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0003Step02(); + return KErrNone; + } + +void +RAsyncTestStepOmxILPcmRenderer0003::DoRAsyncTestStepOmxILPcmRenderer0003Step02() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0003::DoRAsyncTestStepOmxILPcmRenderer0003Step02")); + + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateWaitForResources != compState) + { + return StopTest(KErrGeneral, EFail); + } + + // + // Move component to OMX_StateLoaded + // + + if (OMX_ErrorNone != ipCompHandle->SendCommand( + ipCompHandle, + OMX_CommandStateSet, + OMX_StateLoaded, + 0)) + { + return StopTest(KErrGeneral, EFail); + } + + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateLoaded != compState) + { return StopTest(KErrGeneral, EFail); + } + + // The successful termination... + ipKickoffStop->Call(); + + } + + +// +// RAsyncTestStepOmxILPcmRenderer0004 +// +RAsyncTestStepOmxILPcmRenderer0004::RAsyncTestStepOmxILPcmRenderer0004(const TDesC& aTestName, TInt aComponentUid) + : + RAsyncTestStepOmxILPcmRenderer0001(aTestName, aComponentUid) + + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0004::RAsyncTestStepOmxILPcmRenderer0004")); + } + + +void +RAsyncTestStepOmxILPcmRenderer0004::KickoffTestL() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0004::KickoffTestL")); + iTestState = EStateLoadKickoffTestLComplete; + + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test04 ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(AllocateBuffer-population) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Pause ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Pause->Idle ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Idle->Loaded(depopulation) ")); + + // This will install one callback + RAsyncTestStepOmxILComponentBase::KickoffTestL(); + + TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0004Step01, this); + delete ipKickoff01; + ipKickoff01 = NULL; + ipKickoff01 = + new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); + ipKickoff01->Call(); + + } + +void +RAsyncTestStepOmxILPcmRenderer0004::CloseTest() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0004::CloseTest")); + + delete ipKickoff01; // no need to Cancel + ipKickoff01 = NULL; + delete ipKickoff02; // no need to Cancel + ipKickoff02 = NULL; + delete ipKickoff03; // no need to Cancel + ipKickoff03 = NULL; + delete ipKickoff04; // no need to Cancel + ipKickoff04 = NULL; + delete ipKickoff05; // no need to Cancel + ipKickoff05 = NULL; + delete ipKickoff06; // no need to Cancel + ipKickoff06 = NULL; + + delete ipKickoffStop; // no need to Cancel + ipKickoffStop = 0; + + TInt count = ipClientClockPortBufferArray.Count(); + + for (TInt n = 0; n < count; n++) + { + delete ipClientClockPortBufferArray[n]; + } + + ipClientClockPortBufferArray.Close(); + + RAsyncTestStepOmxILComponentBase::CloseTest(); + + } + +void +RAsyncTestStepOmxILPcmRenderer0004::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/, + OMX_EVENTTYPE aEvent, + TUint aData1, + TUint aData2, + TAny* /*aExtra*/) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0004::DoEventHandlerL")); + + switch (aEvent) + { + case OMX_EventError: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_EventError [%d]"), aData1); + return StopTest(KErrGeneral, EFail); + } + case OMX_EventCmdComplete: + { + switch(aData1) + { + case OMX_CommandStateSet: + { + switch(aData2) + { + case OMX_StateLoaded: + { + if (EStateTransitionToIdleComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateLoaded [EStateTransitionToIdleComplete]")); + iTestState = EStateTransitionToLoadedComplete; + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateLoaded != compState) + { + return StopTest(KErrGeneral, EFail); + } + + // The successful termination... + TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this); + delete ipKickoffStop; + ipKickoffStop = NULL; + ipKickoffStop = + new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow); + ipKickoffStop->Call(); + } + } + break; + case OMX_StateIdle: + { + if (EStateLoadKickoffTestLComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateLoadKickoffTestLComplete]")); + iTestState = EStateTransitionToIdleComplete; + TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0004Step02, this); + delete ipKickoff02; + ipKickoff02 = NULL; + ipKickoff02 = + new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow); + ipKickoff02->Call(); + + } + else if (EStateTransitionToPauseComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateTransitionToPauseComplete]")); + iTestState = EStateTransitionToIdleComplete; + TCallBack callback04 (RAsyncTestStepOmxILPcmRenderer0004Step04, this); + delete ipKickoff04; + ipKickoff04 = NULL; + ipKickoff04 = + new (ELeave) CAsyncCallBack (callback04, CActive::EPriorityLow); + ipKickoff04->Call(); + + } + else + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [Other]")); + return StopTest(KErrGeneral, EFail); + } + } + break; + case OMX_StatePause: + { + if (EStateTransitionToIdleComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StatePause [EStateTransitionToIdleComplete]")); + iTestState = EStateTransitionToPauseComplete; + TCallBack callback03 (RAsyncTestStepOmxILPcmRenderer0004Step03, this); + delete ipKickoff03; + ipKickoff03 = NULL; + ipKickoff03 = + new (ELeave) CAsyncCallBack (callback03, CActive::EPriorityLow); + ipKickoff03->Call(); + } + else + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StatePause [Other]")); + return StopTest(KErrGeneral, EFail); + } + } + break; + default: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_State [%d]"), aData2); + return StopTest(KErrGeneral, EFail); + } + }; + } + break; + default: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_Command [%d]"), aData1); + return StopTest(KErrGeneral, EFail); + } + }; + } + break; + default: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX Event [%d]"), aEvent); + return StopTest(KErrGeneral, EFail); + } + }; + + } + + +TInt +RAsyncTestStepOmxILPcmRenderer0004::RAsyncTestStepOmxILPcmRenderer0004Step01(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0004::RAsyncTestStepOmxILPcmRenderer0004Step01")); + // NOTE, Here we reuse inherited code, to populate the component and make it go to OMX_StateIdle + RAsyncTestStepOmxILPcmRenderer0004* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0001Step01(); + return KErrNone; + } + +TInt +RAsyncTestStepOmxILPcmRenderer0004::RAsyncTestStepOmxILPcmRenderer0004Step02(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0004::RAsyncTestStepOmxILPcmRenderer0004Step02")); + RAsyncTestStepOmxILPcmRenderer0004* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0004Step02(); + return KErrNone; + } + +void +RAsyncTestStepOmxILPcmRenderer0004::DoRAsyncTestStepOmxILPcmRenderer0004Step02() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0004::DoRAsyncTestStepOmxILPcmRenderer0004Step02")); + + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateIdle != compState) + { + return StopTest(KErrGeneral, EFail); + } + + // + // Move component to OMX_StatePause + // + + if (OMX_ErrorNone != ipCompHandle->SendCommand( + ipCompHandle, + OMX_CommandStateSet, + OMX_StatePause, + 0)) + { + return StopTest(KErrGeneral, EFail); + } + + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StatePause != compState) + { + return StopTest(KErrGeneral, EFail); + } + + } + +TInt +RAsyncTestStepOmxILPcmRenderer0004::RAsyncTestStepOmxILPcmRenderer0004Step03(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0004::RAsyncTestStepOmxILPcmRenderer0004Step03")); + RAsyncTestStepOmxILPcmRenderer0004* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0004Step03(); + return KErrNone; + } + + +void +RAsyncTestStepOmxILPcmRenderer0004::DoRAsyncTestStepOmxILPcmRenderer0004Step03() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0004::DoRAsyncTestStepOmxILPcmRenderer0004Step03")); + + // + // Move component to OMX_StateIdle + // + + if (OMX_ErrorNone != ipCompHandle->SendCommand( + ipCompHandle, + OMX_CommandStateSet, + OMX_StateIdle, + 0)) + { + return StopTest(KErrGeneral, EFail); + } + + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateIdle != compState) + { + return StopTest(KErrGeneral, EFail); + } + + } + + +TInt +RAsyncTestStepOmxILPcmRenderer0004::RAsyncTestStepOmxILPcmRenderer0004Step04(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0004::RAsyncTestStepOmxILPcmRenderer0004Step04")); + // NOTE, Here we reuse inherited code, to depopulate the component and to + // make it go to OMX_StateLoaded + RAsyncTestStepOmxILPcmRenderer0004* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0001Step02(); + return KErrNone; + } + + +// +// RAsyncTestStepOmxILPcmRenderer0005 +// +RAsyncTestStepOmxILPcmRenderer0005::RAsyncTestStepOmxILPcmRenderer0005(const TDesC& aTestName, TInt aComponentUid) + : + RAsyncTestStepOmxILPcmRenderer0004(aTestName, aComponentUid) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0005::RAsyncTestStepOmxILPcmRenderer0005")); + } + + +void +RAsyncTestStepOmxILPcmRenderer0005::KickoffTestL() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0005::KickoffTestL")); + iTestState = EStateLoadKickoffTestLComplete; + + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test05 ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(AllocateBuffer-population) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Executing ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2a. - Call EmptyThisBuffer on PCM Renderer ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2b. - EmptyBufferDone callback received ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Executing->Idle(BufferFlushing) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Idle->Loaded(Depopulation) ")); + + // This will change the test file + iTestFileName.Set(KPcmRendererTestFile); + + // This will install one callback + RAsyncTestStepOmxILComponentBase::KickoffTestL(); + + TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0005Step01, this); + delete ipKickoff01; + ipKickoff01 = NULL; + ipKickoff01 = + new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); + ipKickoff01->Call(); + + } + +void +RAsyncTestStepOmxILPcmRenderer0005::CloseTest() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0005::CloseTest")); + + delete ipKickoff01; // no need to Cancel + ipKickoff01 = NULL; + delete ipKickoff02; // no need to Cancel + ipKickoff02 = NULL; + delete ipKickoff03; // no need to Cancel + ipKickoff03 = NULL; + delete ipKickoff04; // no need to Cancel + ipKickoff04 = NULL; + delete ipKickoff05; // no need to Cancel + ipKickoff05 = NULL; + delete ipKickoff06; // no need to Cancel + ipKickoff06 = NULL; + + delete ipKickoffStop; // no need to Cancel + ipKickoffStop = 0; + + TInt count = ipClientClockPortBufferArray.Count(); + + for (TInt n = 0; n < count; n++) + { + delete ipClientClockPortBufferArray[n]; + } + + ipClientClockPortBufferArray.Close(); + + RAsyncTestStepOmxILComponentBase::CloseTest(); + + } + +void +RAsyncTestStepOmxILPcmRenderer0005::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/, + OMX_EVENTTYPE aEvent, + TUint aData1, + TUint aData2, + TAny* /*aExtra*/) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0005::DoEventHandlerL")); + + switch (aEvent) + { + case OMX_EventError: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_EventError [%d]"), aData1); + return StopTest(KErrGeneral, EFail); + } + case OMX_EventCmdComplete: + { + switch(aData1) + { + case OMX_CommandStateSet: + { + switch(aData2) + { + case OMX_StateLoaded: + { + if (EStateTransitionToIdleComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateLoaded [EStateTransitionToIdleComplete]")); + iTestState = EStateTransitionToLoadedComplete; + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateLoaded != compState) + { + return StopTest(KErrGeneral, EFail); + } + + // The successful termination... + TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this); + delete ipKickoffStop; + ipKickoffStop = NULL; + ipKickoffStop = + new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow); + ipKickoffStop->Call(); + } + } + break; + case OMX_StateIdle: + { + if (EStateLoadKickoffTestLComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateLoadKickoffTestLComplete]")); + iTestState = EStateTransitionToIdleComplete; + TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0005Step02, this); + delete ipKickoff02; + ipKickoff02 = NULL; + ipKickoff02 = + new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow); + ipKickoff02->Call(); + + } + else if (EStateTransitionToExecutingComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateTransitionToPauseComplete]")); + iTestState = EStateTransitionToIdleComplete; + TCallBack callback04 (RAsyncTestStepOmxILPcmRenderer0005Step04, this); + delete ipKickoff04; + ipKickoff04 = NULL; + ipKickoff04 = + new (ELeave) CAsyncCallBack (callback04, CActive::EPriorityLow); + ipKickoff04->Call(); + + } + else + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [Other]")); + return StopTest(KErrGeneral, EFail); + } + } + break; + case OMX_StateExecuting: + { + if (EStateTransitionToIdleComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [EStateTransitionToIdleComplete]")); + iTestState = EStateTransitionToExecutingComplete; + CMMFDataBuffer& dataBuffer = *(static_cast(ipBufferHeaderInput->pInputPortPrivate)); + ipTestFile->ReadNextBuffer(dataBuffer); + ipBufferHeaderInput->nFilledLen = dataBuffer.BufferSize(); + + // Send a buffer to the input port + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [Send a buffer to the input port]")); + INFO_PRINTF2(_L("ipBufferHeaderInput->pBuffer [%X]"), ipBufferHeaderInput->pBuffer); + INFO_PRINTF2(_L("ipBufferHeaderInput->nAllocLen [%d]"), ipBufferHeaderInput->nAllocLen); + INFO_PRINTF2(_L("ipBufferHeaderInput->nFilledLen [%d]"), ipBufferHeaderInput->nFilledLen); + INFO_PRINTF2(_L("ipBufferHeaderInput->nOffset [%d]"), ipBufferHeaderInput->nOffset); + INFO_PRINTF2(_L("ipBufferHeaderInput->pAppPrivate [%X]"), ipBufferHeaderInput->pAppPrivate); + INFO_PRINTF2(_L("ipBufferHeaderInput->pPlatformPrivate [%X]"), ipBufferHeaderInput->pPlatformPrivate); + INFO_PRINTF2(_L("ipBufferHeaderInput->pInputPortPrivate [%X]"), ipBufferHeaderInput->pInputPortPrivate); + INFO_PRINTF2(_L("ipBufferHeaderInput->pOutputPortPrivate [%X]"), ipBufferHeaderInput->pOutputPortPrivate); + INFO_PRINTF2(_L("ipBufferHeaderInput->hMarkTargetComponent [%X]"), ipBufferHeaderInput->hMarkTargetComponent); + INFO_PRINTF2(_L("ipBufferHeaderInput->pMarkData [%X]"), ipBufferHeaderInput->pMarkData); + INFO_PRINTF2(_L("ipBufferHeaderInput->nTickCount [%d]"), ipBufferHeaderInput->nTickCount); + INFO_PRINTF2(_L("ipBufferHeaderInput->nFlags [%X]"), ipBufferHeaderInput->nFlags); + INFO_PRINTF2(_L("ipBufferHeaderInput->nOutputPortIndex [%X]"), ipBufferHeaderInput->nOutputPortIndex); + INFO_PRINTF2(_L("ipBufferHeaderInput->nInputPortIndex [%X]"), ipBufferHeaderInput->nInputPortIndex); + + if (OMX_ErrorNone != ipCompHandle->EmptyThisBuffer( + ipCompHandle, ipBufferHeaderInput)) + { + return StopTest(KErrGeneral, EFail); + } + } + else + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [Other]")); + return StopTest(KErrGeneral, EFail); + } + } + break; + default: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_State [%d]"), aData2); + return StopTest(KErrGeneral, EFail); + } + }; + } + break; + default: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_Command [%d]"), aData1); + return StopTest(KErrGeneral, EFail); + } + }; + } + break; + default: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX Event [%d]"), aEvent); + return StopTest(KErrGeneral, EFail); + } + }; + + } + +void +RAsyncTestStepOmxILPcmRenderer0005::DoEmptyBufferDoneL(OMX_HANDLETYPE /*aComponent*/, + OMX_BUFFERHEADERTYPE* /*aBuffer*/) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0005::DoEmptyBufferDoneL")); + + INFO_PRINTF1(_L("DoEmptyBufferDoneL : Callback received ")); + + TCallBack callback03 (RAsyncTestStepOmxILPcmRenderer0005Step03, this); + delete ipKickoff03; + ipKickoff03 = NULL; + ipKickoff03 = + new (ELeave) CAsyncCallBack (callback03, CActive::EPriorityLow); + ipKickoff03->Call(); + } + + +TInt +RAsyncTestStepOmxILPcmRenderer0005::RAsyncTestStepOmxILPcmRenderer0005Step01(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0005::RAsyncTestStepOmxILPcmRenderer0005Step01")); + // NOTE, Here we reuse inherited code, to populate the component and make it go to OMX_StateIdle + RAsyncTestStepOmxILPcmRenderer0005* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0001Step01(); + return KErrNone; + } + +TInt +RAsyncTestStepOmxILPcmRenderer0005::RAsyncTestStepOmxILPcmRenderer0005Step02(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0005::RAsyncTestStepOmxILPcmRenderer0005Step02")); + RAsyncTestStepOmxILPcmRenderer0005* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0005Step02(); + return KErrNone; + } + +void +RAsyncTestStepOmxILPcmRenderer0005::DoRAsyncTestStepOmxILPcmRenderer0005Step02() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0005::DoRAsyncTestStepOmxILPcmRenderer0005Step02")); + + // + // Move component to OMX_StateExecuting + // + + if (OMX_ErrorNone != ipCompHandle->SendCommand( + ipCompHandle, + OMX_CommandStateSet, + OMX_StateExecuting, + 0)) + { + return StopTest(KErrGeneral, EFail); + } + + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateExecuting != compState) + { + return StopTest(KErrGeneral, EFail); + } + + } + +TInt +RAsyncTestStepOmxILPcmRenderer0005::RAsyncTestStepOmxILPcmRenderer0005Step03(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0005::RAsyncTestStepOmxILPcmRenderer0005Step03")); + RAsyncTestStepOmxILPcmRenderer0005* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0004Step03(); + return KErrNone; + } + + +TInt +RAsyncTestStepOmxILPcmRenderer0005::RAsyncTestStepOmxILPcmRenderer0005Step04(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0005::RAsyncTestStepOmxILPcmRenderer0005Step04")); + // NOTE, Here we reuse inherited code, to depopulate the component and to + // make it go to OMX_StateLoaded + RAsyncTestStepOmxILPcmRenderer0005* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0001Step02(); + return KErrNone; + } + + + +// +// RAsyncTestStepOmxILPcmRenderer0006 +// +RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006(const TDesC& aTestName, TInt aComponentUid) + : + RAsyncTestStepOmxILPcmRenderer0005(aTestName, aComponentUid) + + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006")); + } + + +void +RAsyncTestStepOmxILPcmRenderer0006::KickoffTestL() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::KickoffTestL")); + iTestState = EStateLoadKickoffTestLComplete; + + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test06 ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(AllocateBuffer-population) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Executing ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Executing->Pause ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Pause->Executing ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 5.- Executing->Idle(BufferFlushing) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 6.- Idle->Loaded(depopulation) ")); + + // This will install one callback + RAsyncTestStepOmxILComponentBase::KickoffTestL(); + + TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0006Step01, this); + delete ipKickoff01; + ipKickoff01 = NULL; + ipKickoff01 = + new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); + ipKickoff01->Call(); + + } + +void +RAsyncTestStepOmxILPcmRenderer0006::CloseTest() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::CloseTest")); + + delete ipKickoff01; // no need to Cancel + ipKickoff01 = NULL; + delete ipKickoff02; // no need to Cancel + ipKickoff02 = NULL; + delete ipKickoff03; // no need to Cancel + ipKickoff03 = NULL; + delete ipKickoff04; // no need to Cancel + ipKickoff04 = NULL; + delete ipKickoff05; // no need to Cancel + ipKickoff05 = NULL; + delete ipKickoff06; // no need to Cancel + ipKickoff06 = NULL; + + delete ipKickoffStop; // no need to Cancel + ipKickoffStop = 0; + + TInt count = ipClientClockPortBufferArray.Count(); + + for (TInt n = 0; n < count; n++) + { + delete ipClientClockPortBufferArray[n]; + } + + ipClientClockPortBufferArray.Close(); + + RAsyncTestStepOmxILComponentBase::CloseTest(); + + } + + +void +RAsyncTestStepOmxILPcmRenderer0006::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/, + OMX_EVENTTYPE aEvent, + TUint aData1, + TUint aData2, + TAny* /*aExtra*/) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::DoEventHandlerL")); + + switch (aEvent) + { + case OMX_EventError: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_EventError [%d]"), aData1); + return StopTest(KErrGeneral, EFail); + } + case OMX_EventCmdComplete: + { + switch(aData1) + { + case OMX_CommandStateSet: + { + switch(aData2) + { + case OMX_StateLoaded: + { + if (EStateTransitionToIdleComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateLoaded [EStateTransitionToIdleComplete]")); + iTestState = EStateTransitionToLoadedComplete; + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateLoaded != compState) + { + return StopTest(KErrGeneral, EFail); + } + + // The successful termination... + TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this); + delete ipKickoffStop; + ipKickoffStop = NULL; + ipKickoffStop = + new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow); + ipKickoffStop->Call(); + } + } + break; + case OMX_StateIdle: + { + if (EStateLoadKickoffTestLComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateLoadKickoffTestLComplete]")); + iTestState = EStateTransitionToIdleComplete; + TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0006Step02, this); + delete ipKickoff02; + ipKickoff02 = NULL; + ipKickoff02 = + new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow); + ipKickoff02->Call(); + + } + else if (EStateTransitionToExecutingComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateTransitionToExecutingComplete]")); + iTestState = EStateTransitionToIdleComplete; + TCallBack callback06 (RAsyncTestStepOmxILPcmRenderer0006Step06, this); + delete ipKickoff06; + ipKickoff06 = NULL; + ipKickoff06 = + new (ELeave) CAsyncCallBack (callback06, CActive::EPriorityLow); + ipKickoff06->Call(); + + } + else + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [Other]")); + return StopTest(KErrGeneral, EFail); + } + } + break; + case OMX_StateExecuting: + { + if (EStateTransitionToIdleComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [EStateTransitionToIdleComplete]")); + iTestState = EStateTransitionToExecutingComplete; + TCallBack callback03 (RAsyncTestStepOmxILPcmRenderer0006Step03, this); + delete ipKickoff03; + ipKickoff03 = NULL; + ipKickoff03 = + new (ELeave) CAsyncCallBack (callback03, CActive::EPriorityLow); + ipKickoff03->Call(); + + } + else if (EStateTransitionToPauseComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [EStateTransitionToPauseComplete]")); + iTestState = EStateTransitionToExecutingComplete; + TCallBack callback05 (RAsyncTestStepOmxILPcmRenderer0006Step05, this); + delete ipKickoff05; + ipKickoff05 = NULL; + ipKickoff05 = + new (ELeave) CAsyncCallBack (callback05, CActive::EPriorityLow); + ipKickoff05->Call(); + + } + else + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_StateExecuting iTestState[%d]"), iTestState); + return StopTest(KErrGeneral, EFail); + } + } + break; + case OMX_StatePause: + { + if (EStateTransitionToExecutingComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StatePause [EStateTransitionToExecutingComplete]")); + iTestState = EStateTransitionToPauseComplete; + TCallBack callback04 (RAsyncTestStepOmxILPcmRenderer0006Step04, this); + delete ipKickoff04; + ipKickoff04 = NULL; + ipKickoff04 = + new (ELeave) CAsyncCallBack (callback04, CActive::EPriorityLow); + ipKickoff04->Call(); + } + else + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_StatePause iTestState[%d]"), iTestState); + return StopTest(KErrGeneral, EFail); + } + + } + break; + default: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_State [%d]"), aData2); + return StopTest(KErrGeneral, EFail); + } + }; + } + break; + default: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_Command [%d]"), aData1); + return StopTest(KErrGeneral, EFail); + } + }; + } + break; + default: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX Event [%d]"), aEvent); + return StopTest(KErrGeneral, EFail); + } + }; + + } + + +TInt +RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step01(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step01")); + // NOTE, Here we reuse inherited code, to populate the component and make it go to OMX_StateIdle + RAsyncTestStepOmxILPcmRenderer0006* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0001Step01(); + return KErrNone; + } + +TInt +RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step02(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step02")); + RAsyncTestStepOmxILPcmRenderer0006* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0005Step02(); + return KErrNone; + } + +TInt +RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step03(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step03")); + RAsyncTestStepOmxILPcmRenderer0006* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0006Step03(); + return KErrNone; + } + +void +RAsyncTestStepOmxILPcmRenderer0006::DoRAsyncTestStepOmxILPcmRenderer0006Step03() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::DoRAsyncTestStepOmxILPcmRenderer0006Step03")); + + // + // Move component to OMX_StatePause + // + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->SendCommand( + ipCompHandle, + OMX_CommandStateSet, + OMX_StatePause, + 0)) + { + return StopTest(KErrGeneral, EFail); + } + + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StatePause != compState) + { + return StopTest(KErrGeneral, EFail); + } + + } + + +TInt +RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step04(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step04")); + // NOTE, Here we reuse inherited code, to make it go to OMX_StateIdle + RAsyncTestStepOmxILPcmRenderer0006* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0005Step02(); + return KErrNone; + } + +TInt +RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step05(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step05")); + // NOTE, Here we reuse inherited code, to make it go to OMX_StateIdle + RAsyncTestStepOmxILPcmRenderer0006* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0004Step03(); + return KErrNone; + } + +TInt +RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step06(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0006::RAsyncTestStepOmxILPcmRenderer0006Step06")); + // NOTE, Here we reuse inherited code, to make it go to OMX_StateLoaded + RAsyncTestStepOmxILPcmRenderer0006* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0001Step02(); + return KErrNone; + } + + +// +// RAsyncTestStepOmxILPcmRenderer0007 +// +RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007(const TDesC& aTestName, TInt aComponentUid) + : + RAsyncTestStepOmxILPcmRenderer0006(aTestName, aComponentUid) + + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007")); + } + + +void +RAsyncTestStepOmxILPcmRenderer0007::KickoffTestL() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0007::KickoffTestL")); + iTestState = EStateLoadKickoffTestLComplete; + + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test07 ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(AllocateBuffer-population) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Executing ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Executing->Pause ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Pause->Idle(BufferFlushing)")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 5.- Idle->Loaded(depopulation) ")); + + // This will install one callback + RAsyncTestStepOmxILComponentBase::KickoffTestL(); + + TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0007Step01, this); + delete ipKickoff01; + ipKickoff01 = NULL; + ipKickoff01 = + new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); + ipKickoff01->Call(); + + } + +void +RAsyncTestStepOmxILPcmRenderer0007::CloseTest() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0007::CloseTest")); + + delete ipKickoff01; // no need to Cancel + ipKickoff01 = NULL; + delete ipKickoff02; // no need to Cancel + ipKickoff02 = NULL; + delete ipKickoff03; // no need to Cancel + ipKickoff03 = NULL; + delete ipKickoff04; // no need to Cancel + ipKickoff04 = NULL; + delete ipKickoff05; // no need to Cancel + ipKickoff05 = NULL; + delete ipKickoff06; // no need to Cancel + ipKickoff06 = NULL; + + delete ipKickoffStop; // no need to Cancel + ipKickoffStop = 0; + + TInt count = ipClientClockPortBufferArray.Count(); + + for (TInt n = 0; n < count; n++) + { + delete ipClientClockPortBufferArray[n]; + } + + ipClientClockPortBufferArray.Close(); + + RAsyncTestStepOmxILComponentBase::CloseTest(); + + } + + +void +RAsyncTestStepOmxILPcmRenderer0007::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/, + OMX_EVENTTYPE aEvent, + TUint aData1, + TUint aData2, + TAny* /*aExtra*/) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0007::DoEventHandlerL")); + + switch (aEvent) + { + case OMX_EventError: + { + // Ignore underflow errors... + if (OMX_ErrorUnderflow == (OMX_S32)aData1) + { + INFO_PRINTF1(_L("DoEventHandlerL: [OMX_ErrorUnderflow]")); + } + else + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_EventError [%x]"), aData1); + return StopTest(KErrGeneral, EFail); + } + } + break; + + case OMX_EventCmdComplete: + { + switch(aData1) + { + case OMX_CommandStateSet: + { + switch(aData2) + { + case OMX_StateLoaded: + { + if (EStateTransitionToIdleComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateLoaded [EStateTransitionToIdleComplete]")); + iTestState = EStateTransitionToLoadedComplete; + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateLoaded != compState) + { + return StopTest(KErrGeneral, EFail); + } + + // The successful termination... + TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this); + delete ipKickoffStop; + ipKickoffStop = NULL; + ipKickoffStop = + new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow); + ipKickoffStop->Call(); + } + } + break; + case OMX_StateIdle: + { + if (EStateLoadKickoffTestLComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateLoadKickoffTestLComplete]")); + iTestState = EStateTransitionToIdleComplete; + TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0007Step02, this); + delete ipKickoff02; + ipKickoff02 = NULL; + ipKickoff02 = + new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow); + ipKickoff02->Call(); + + } + else if (EStateTransitionToPauseComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateTransitionToPauseComplete]")); + iTestState = EStateTransitionToIdleComplete; + TCallBack callback05 (RAsyncTestStepOmxILPcmRenderer0007Step05, this); + delete ipKickoff05; + ipKickoff05 = NULL; + ipKickoff05 = + new (ELeave) CAsyncCallBack (callback05, CActive::EPriorityLow); + ipKickoff05->Call(); + + } + else + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [Other]")); + return StopTest(KErrGeneral, EFail); + } + } + break; + case OMX_StateExecuting: + { + if (EStateTransitionToIdleComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [EStateTransitionToIdleComplete]")); + iTestState = EStateTransitionToExecutingComplete; + TCallBack callback03 (RAsyncTestStepOmxILPcmRenderer0007Step03, this); + delete ipKickoff03; + ipKickoff03 = NULL; + ipKickoff03 = + new (ELeave) CAsyncCallBack (callback03, CActive::EPriorityLow); + ipKickoff03->Call(); + + } + else + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_StateExecuting iTestState[%d]"), iTestState); + return StopTest(KErrGeneral, EFail); + } + } + break; + case OMX_StatePause: + { + if (EStateTransitionToExecutingComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StatePause [EStateTransitionToExecutingComplete]")); + iTestState = EStateTransitionToPauseComplete; + TCallBack callback04 (RAsyncTestStepOmxILPcmRenderer0007Step04, this); + delete ipKickoff04; + ipKickoff04 = NULL; + ipKickoff04 = + new (ELeave) CAsyncCallBack (callback04, CActive::EPriorityLow); + ipKickoff04->Call(); + } + else + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_StatePause iTestState[%d]"), iTestState); + return StopTest(KErrGeneral, EFail); + } + + } + break; + default: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_State [%d]"), aData2); + return StopTest(KErrGeneral, EFail); + } + }; + } + break; + default: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_Command [%d]"), aData1); + return StopTest(KErrGeneral, EFail); + } + }; + } + break; + default: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX Event [%d]"), aEvent); + return StopTest(KErrGeneral, EFail); + } + }; + + } + + +TInt +RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007Step01(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007Step01")); + // NOTE, Here we reuse inherited code, to populate the component and make it go to OMX_StateIdle + RAsyncTestStepOmxILPcmRenderer0007* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0001Step01(); + return KErrNone; + } + +TInt +RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007Step02(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007Step02")); + RAsyncTestStepOmxILPcmRenderer0007* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0005Step02(); + return KErrNone; + } + +TInt +RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007Step03(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007Step03")); + RAsyncTestStepOmxILPcmRenderer0007* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0006Step03(); + return KErrNone; + } + +TInt +RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007Step04(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007Step04")); + // NOTE, Here we reuse inherited code, to make it go to OMX_StateIdle + RAsyncTestStepOmxILPcmRenderer0007* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0004Step03(); + return KErrNone; + } + +TInt +RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007Step05(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0007::RAsyncTestStepOmxILPcmRenderer0007Step05")); + // NOTE, Here we reuse inherited code, to make it go to OMX_StateIdle + RAsyncTestStepOmxILPcmRenderer0007* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0001Step02(); + return KErrNone; + } + +// +// RAsyncTestStepOmxILPcmRenderer0008 +// +RAsyncTestStepOmxILPcmRenderer0008::RAsyncTestStepOmxILPcmRenderer0008(const TDesC& aTestName, TInt aComponentUid) + : + RAsyncTestStepOmxILPcmRenderer0005(aTestName, aComponentUid) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0008::RAsyncTestStepOmxILPcmRenderer0008")); + } + + +void +RAsyncTestStepOmxILPcmRenderer0008::KickoffTestL() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0008::KickoffTestL")); + iTestState = EStateLoadKickoffTestLComplete; + + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test08 ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(AllocateBuffer-population) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Executing ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Repeat these two steps until the whole file has beeen empited ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2a. - Call EmptyThisBuffer on PCM Renderer ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2b. - EmptyBufferDone callback received ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Executing->Idle(BufferFlushing) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Idle->Loaded(Depopulation) ")); + + // This will change the test file + iTestFileName.Set(KPcmRendererTestFile); + + // This will install one callback + RAsyncTestStepOmxILComponentBase::KickoffTestL(); + + TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0005Step01, this); + delete ipKickoff01; + ipKickoff01 = NULL; + ipKickoff01 = + new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); + ipKickoff01->Call(); + } + +void +RAsyncTestStepOmxILPcmRenderer0008::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/, + OMX_EVENTTYPE aEvent, + TUint aData1, + TUint aData2, + TAny* /*aExtra*/) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0008::DoEventHandlerL")); + + switch (aEvent) + { + case OMX_EventError: + { + // Ignore underflow errors... + if (OMX_ErrorUnderflow == (OMX_S32)aData1) + { + INFO_PRINTF1(_L("DoEventHandlerL: [OMX_ErrorUnderflow]")); + } + else + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_EventError [%x]"), aData1); + return StopTest(KErrGeneral, EFail); + } + } + break; + + case OMX_EventCmdComplete: + { + switch(aData1) + { + case OMX_CommandStateSet: + { + switch(aData2) + { + case OMX_StateLoaded: + { + if (EStateTransitionToIdleComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateLoaded [EStateTransitionToIdleComplete]")); + iTestState = EStateTransitionToLoadedComplete; + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateLoaded != compState) + { + return StopTest(KErrGeneral, EFail); + } + + // The successful termination... + TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this); + delete ipKickoffStop; + ipKickoffStop = NULL; + ipKickoffStop = + new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow); + ipKickoffStop->Call(); + } + } + break; + case OMX_StateIdle: + { + if (EStateLoadKickoffTestLComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateLoadKickoffTestLComplete]")); + iTestState = EStateTransitionToIdleComplete; + TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0005Step02, this); + delete ipKickoff02; + ipKickoff02 = NULL; + ipKickoff02 = + new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow); + ipKickoff02->Call(); + + } + else if (EStateTransitionToExecutingComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateTransitionToPauseComplete]")); + iTestState = EStateTransitionToIdleComplete; + TCallBack callback04 (RAsyncTestStepOmxILPcmRenderer0005Step04, this); + delete ipKickoff04; + ipKickoff04 = NULL; + ipKickoff04 = + new (ELeave) CAsyncCallBack (callback04, CActive::EPriorityLow); + ipKickoff04->Call(); + + } + else + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [Other]")); + return StopTest(KErrGeneral, EFail); + } + } + break; + case OMX_StateExecuting: + { + if (EStateTransitionToIdleComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [EStateTransitionToIdleComplete]")); + iTestState = EStateTransitionToExecutingComplete; + + CMMFDataBuffer& dataBuffer = *(static_cast(ipBufferHeaderInput->pInputPortPrivate)); + ipTestFile->ReadNextBuffer(dataBuffer); + + // Send a buffer to the input port + ipBufferHeaderInput->nFilledLen = dataBuffer.BufferSize(); + + if (OMX_ErrorNone != ipCompHandle->EmptyThisBuffer( + ipCompHandle, ipBufferHeaderInput)) + { + StopTest(KErrGeneral, EFail); + } + } + else + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [Other]")); + return StopTest(KErrGeneral, EFail); + } + } + break; + default: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_State [%d]"), aData2); + return StopTest(KErrGeneral, EFail); + } + }; + } + break; + default: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_Command [%d]"), aData1); + return StopTest(KErrGeneral, EFail); + } + }; + } + break; + default: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX Event [%d]"), aEvent); + return StopTest(KErrGeneral, EFail); + } + }; + + } + +void +RAsyncTestStepOmxILPcmRenderer0008::DoEmptyBufferDoneL(OMX_HANDLETYPE /*aComponent*/, + OMX_BUFFERHEADERTYPE* /*aBuffer*/) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0008::DoEmptyBufferDoneL")); + INFO_PRINTF1(_L("DoEmptyBufferDoneL : Callback received ")); + + CMMFDataBuffer& dataBuffer = *(static_cast(ipBufferHeaderInput->pInputPortPrivate)); + ipTestFile->ReadNextBuffer(dataBuffer); + + if (dataBuffer.BufferSize() > 0) + { + // Send a buffer to the input port + ipBufferHeaderInput->nFilledLen = dataBuffer.BufferSize(); + + if (OMX_ErrorNone != ipCompHandle->EmptyThisBuffer( + ipCompHandle, ipBufferHeaderInput)) + { + StopTest(KErrGeneral, EFail); + } + } + else + { + TCallBack callback03 (RAsyncTestStepOmxILPcmRenderer0005Step03, this); + delete ipKickoff03; + ipKickoff03 = NULL; + ipKickoff03 = + new (ELeave) CAsyncCallBack (callback03, CActive::EPriorityLow); + ipKickoff03->Call(); + } + } + +// +// RAsyncTestStepOmxILPcmRenderer0009 +// +RAsyncTestStepOmxILPcmRenderer0009::RAsyncTestStepOmxILPcmRenderer0009(const TDesC& aTestName, TInt aComponentUid) + : + RAsyncTestStepOmxILPcmRenderer0008(aTestName, aComponentUid) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0009::RAsyncTestStepOmxILPcmRenderer0009")); + iSamplingRate = 44100; + } + + +void +RAsyncTestStepOmxILPcmRenderer0009::KickoffTestL() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0009::KickoffTestL")); + iTestState = EStateLoadKickoffTestLComplete; + + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test09 ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(AllocateBuffer-population) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Executing ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Repeat these two steps until the whole file has beeen empited ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2a. - Call EmptyThisBuffer on PCM Renderer ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2b. - EmptyBufferDone callback received ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Executing->Pause and Pause->Executing (after 5 and again after 10 buffers played) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Executing->Idle(BufferFlushing) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 5.- Idle->Loaded(Depopulation) ")); + + // This will change the test file + iTestFileName.Set(KPcmRendererTestFile2); + + // This will install one callback + RAsyncTestStepOmxILComponentBase::KickoffTestL(); + + TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0005Step01, this); + delete ipKickoff01; + ipKickoff01 = NULL; + ipKickoff01 = + new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); + ipKickoff01->Call(); + } + +void +RAsyncTestStepOmxILPcmRenderer0009::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/, + OMX_EVENTTYPE aEvent, + TUint aData1, + TUint aData2, + TAny* /*aExtra*/) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0009::DoEventHandlerL")); + + switch (aEvent) + { + case OMX_EventError: + { + // Ignore underflow errors... + if (OMX_ErrorUnderflow == (OMX_S32)aData1) + { + INFO_PRINTF1(_L("DoEventHandlerL: [OMX_ErrorUnderflow]")); + } + else + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_EventError [%x]"), aData1); + return StopTest(KErrGeneral, EFail); + } + } + break; + + case OMX_EventCmdComplete: + { + switch(aData1) + { + case OMX_CommandStateSet: + { + switch(aData2) + { + case OMX_StateLoaded: + { + if (EStateTransitionToIdleComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateLoaded [EStateTransitionToIdleComplete]")); + iTestState = EStateTransitionToLoadedComplete; + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateLoaded != compState) + { + return StopTest(KErrGeneral, EFail); + } + + // The successful termination... + TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this); + delete ipKickoffStop; + ipKickoffStop = NULL; + ipKickoffStop = + new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow); + ipKickoffStop->Call(); + } + } + break; + case OMX_StateIdle: + { + if (EStateLoadKickoffTestLComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateLoadKickoffTestLComplete]")); + iTestState = EStateTransitionToIdleComplete; + TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0005Step02, this); + delete ipKickoff02; + ipKickoff02 = NULL; + ipKickoff02 = + new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow); + ipKickoff02->Call(); + + } + else if (EStateTransitionToExecutingComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateTransitionToPauseComplete]")); + iTestState = EStateTransitionToIdleComplete; + TCallBack callback04 (RAsyncTestStepOmxILPcmRenderer0005Step04, this); + delete ipKickoff04; + ipKickoff04 = NULL; + ipKickoff04 = + new (ELeave) CAsyncCallBack (callback04, CActive::EPriorityLow); + ipKickoff04->Call(); + + } + else + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [Other]")); + return StopTest(KErrGeneral, EFail); + } + } + break; + case OMX_StateExecuting: + { + if (EStateTransitionToIdleComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [EStateTransitionToIdleComplete]")); + iTestState = EStateTransitionToExecutingComplete; + + CMMFDataBuffer& dataBuffer = *(static_cast(ipBufferHeaderInput->pInputPortPrivate)); + ipTestFile->ReadNextBuffer(dataBuffer); + + // Send a buffer to the input port + ipBufferHeaderInput->nFilledLen = dataBuffer.BufferSize(); + + if (OMX_ErrorNone != ipCompHandle->EmptyThisBuffer( + ipCompHandle, ipBufferHeaderInput)) + { + StopTest(KErrGeneral, EFail); + } + } + else if (EStateTransitionToPauseComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [EStateTransitionToIdleComplete]")); + iTestState = EStateTransitionToExecutingComplete; + } + else + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [Other]")); + return StopTest(KErrGeneral, EFail); + } + } + break; + case OMX_StatePause: + { + if (EStateTransitionToExecutingComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StatePause [EStateTransitionToExecutingComplete]")); + iTestState = EStateTransitionToPauseComplete; + + // Wait for a second... + User::After(1000000); + + // Resume playing... + TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0005Step02, this); + delete ipKickoff02; + ipKickoff02 = NULL; + ipKickoff02 = + new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow); + ipKickoff02->Call(); + } + else + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_StatePause iTestState[%d]"), iTestState); + return StopTest(KErrGeneral, EFail); + } + + } + break; + default: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_State [%d]"), aData2); + return StopTest(KErrGeneral, EFail); + } + }; + } + break; + default: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_Command [%d]"), aData1); + return StopTest(KErrGeneral, EFail); + } + }; + } + break; + default: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX Event [%d]"), aEvent); + return StopTest(KErrGeneral, EFail); + } + }; + + } + +void +RAsyncTestStepOmxILPcmRenderer0009::DoEmptyBufferDoneL(OMX_HANDLETYPE /*aComponent*/, + OMX_BUFFERHEADERTYPE* /*aBuffer*/) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0009::DoEmptyBufferDoneL")); + INFO_PRINTF1(_L("DoEmptyBufferDoneL : Callback received ")); + + iNumOfEmptiedBuffers++; + if (iNumOfEmptiedBuffers == 5 || iNumOfEmptiedBuffers == 10) + { + // + // Move component to OMX_StatePause + // + if (OMX_ErrorNone != ipCompHandle->SendCommand( + ipCompHandle, + OMX_CommandStateSet, + OMX_StatePause, + 0)) + { + return StopTest(KErrGeneral, EFail); + } + + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + if (OMX_StatePause != compState) + { + return StopTest(KErrGeneral, EFail); + } + } + + CMMFDataBuffer& dataBuffer = *(static_cast(ipBufferHeaderInput->pInputPortPrivate)); + ipTestFile->ReadNextBuffer(dataBuffer); + + if (dataBuffer.BufferSize() > 0) + { + // Send a buffer to the input port + ipBufferHeaderInput->nFilledLen = dataBuffer.BufferSize(); + + if (OMX_ErrorNone != ipCompHandle->EmptyThisBuffer( + ipCompHandle, ipBufferHeaderInput)) + { + StopTest(KErrGeneral, EFail); + } + } + else + { + TCallBack callback03 (RAsyncTestStepOmxILPcmRenderer0005Step03, this); + delete ipKickoff03; + ipKickoff03 = NULL; + ipKickoff03 = + new (ELeave) CAsyncCallBack (callback03, CActive::EPriorityLow); + ipKickoff03->Call(); + } + } + +// +// RAsyncTestStepOmxILPcmRenderer0010 +// +RAsyncTestStepOmxILPcmRenderer0010::RAsyncTestStepOmxILPcmRenderer0010(const TDesC& aTestName, TInt aComponentUid) + : + RAsyncTestStepOmxILPcmRenderer0008(aTestName, aComponentUid) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0010::RAsyncTestStepOmxILPcmRenderer0010")); + iSamplingRate = 44100; + } + + +void +RAsyncTestStepOmxILPcmRenderer0010::KickoffTestL() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0010::KickoffTestL")); + iTestState = EStateLoadKickoffTestLComplete; + + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test10 ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(AllocateBuffer-population) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Executing ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Repeat these two steps until the whole file has beeen empited ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2a. - Call EmptyThisBuffer on PCM Renderer ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2b. - EmptyBufferDone callback received ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Executing->Idle and Idle->Executing (after 5 and again after 10 buffers played) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Executing->Idle(BufferFlushing) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 5.- Idle->Loaded(Depopulation) ")); + + // This will change the test file + iTestFileName.Set(KPcmRendererTestFile2); + + // This will install one callback + RAsyncTestStepOmxILComponentBase::KickoffTestL(); + + TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0005Step01, this); + delete ipKickoff01; + ipKickoff01 = NULL; + ipKickoff01 = + new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); + ipKickoff01->Call(); + } + +void +RAsyncTestStepOmxILPcmRenderer0010::DoEventHandlerL(OMX_HANDLETYPE /*aComponent*/, + OMX_EVENTTYPE aEvent, + TUint aData1, + TUint aData2, + TAny* /*aExtra*/) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0010::DoEventHandlerL")); + + switch (aEvent) + { + case OMX_EventError: + { + // Ignore underflow errors... + if (OMX_ErrorUnderflow == (OMX_S32)aData1) + { + INFO_PRINTF1(_L("DoEventHandlerL: [OMX_ErrorUnderflow]")); + } + else + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_EventError [%x]"), aData1); + return StopTest(KErrGeneral, EFail); + } + } + break; + + case OMX_EventCmdComplete: + { + switch(aData1) + { + case OMX_CommandStateSet: + { + switch(aData2) + { + case OMX_StateLoaded: + { + if (EStateTransitionToIdleComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateLoaded [EStateTransitionToIdleComplete]")); + iTestState = EStateTransitionToLoadedComplete; + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateLoaded != compState) + { + return StopTest(KErrGeneral, EFail); + } + + // The successful termination... + TCallBack callbackStop (RAsyncTestStepOmxILComponentBase::StopTestCallBack, this); + delete ipKickoffStop; + ipKickoffStop = NULL; + ipKickoffStop = + new (ELeave) CAsyncCallBack (callbackStop, CActive::EPriorityLow); + ipKickoffStop->Call(); + } + } + break; + case OMX_StateIdle: + { + if (EStateLoadKickoffTestLComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateLoadKickoffTestLComplete]")); + iTestState = EStateTransitionToIdleComplete; + TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0005Step02, this); + delete ipKickoff02; + ipKickoff02 = NULL; + ipKickoff02 = + new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow); + ipKickoff02->Call(); + + } + else if (EStateTransitionToExecutingComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [EStateTransitionToExecutingComplete]")); + iTestState = EStateTransitionToIdleComplete; + + if(iNumOfEmptiedBuffers <= 20) + { + // Wait for a second... + User::After(1000000); + + // Resume playing... + TCallBack callback02 (RAsyncTestStepOmxILPcmRenderer0005Step02, this); + delete ipKickoff02; + ipKickoff02 = NULL; + ipKickoff02 = + new (ELeave) CAsyncCallBack (callback02, CActive::EPriorityLow); + ipKickoff02->Call(); + } + else + { + // Playback finished + TCallBack callback04 (RAsyncTestStepOmxILPcmRenderer0005Step04, this); + delete ipKickoff04; + ipKickoff04 = NULL; + ipKickoff04 = + new (ELeave) CAsyncCallBack (callback04, CActive::EPriorityLow); + ipKickoff04->Call(); + } + } + else + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateIdle [Other]")); + return StopTest(KErrGeneral, EFail); + } + } + break; + case OMX_StateExecuting: + { + if (EStateTransitionToIdleComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [EStateTransitionToIdleComplete]")); + iTestState = EStateTransitionToExecutingComplete; + + CMMFDataBuffer& dataBuffer = *(static_cast(ipBufferHeaderInput->pInputPortPrivate)); + ipTestFile->ReadNextBuffer(dataBuffer); + + // Send a buffer to the input port + ipBufferHeaderInput->nFilledLen = dataBuffer.BufferSize(); + + if (OMX_ErrorNone != ipCompHandle->EmptyThisBuffer( + ipCompHandle, ipBufferHeaderInput)) + { + StopTest(KErrGeneral, EFail); + } + } + else if (EStateTransitionToPauseComplete == iTestState) + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [EStateTransitionToIdleComplete]")); + iTestState = EStateTransitionToExecutingComplete; + } + else + { + INFO_PRINTF1(_L("DoEventHandlerL: OMX_StateExecuting [Other]")); + return StopTest(KErrGeneral, EFail); + } + } + break; + default: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_State [%d]"), aData2); + return StopTest(KErrGeneral, EFail); + } + }; + } + break; + default: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX_Command [%d]"), aData1); + return StopTest(KErrGeneral, EFail); + } + }; + } + break; + default: + { + INFO_PRINTF2(_L("DoEventHandlerL: OMX Event [%d]"), aEvent); + return StopTest(KErrGeneral, EFail); + } + }; + + } + +void +RAsyncTestStepOmxILPcmRenderer0010::DoEmptyBufferDoneL(OMX_HANDLETYPE /*aComponent*/, + OMX_BUFFERHEADERTYPE* /*aBuffer*/) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0010::DoEmptyBufferDoneL")); + INFO_PRINTF1(_L("DoEmptyBufferDoneL : Callback received ")); + + iNumOfEmptiedBuffers++; + if (iNumOfEmptiedBuffers == 5 || iNumOfEmptiedBuffers == 10) + { + // + // Move component to OMX_StateIdle + // + + if (OMX_ErrorNone != ipCompHandle->SendCommand( + ipCompHandle, + OMX_CommandStateSet, + OMX_StateIdle, + 0)) + { + return StopTest(KErrGeneral, EFail); + } + + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateIdle != compState) + { + return StopTest(KErrGeneral, EFail); + } + + // Reset the file position + ipTestFile->ResetPos(); + } + else + { + CMMFDataBuffer& dataBuffer = *(static_cast(ipBufferHeaderInput->pInputPortPrivate)); + ipTestFile->ReadNextBuffer(dataBuffer); + + if (dataBuffer.BufferSize() > 0) + { + // Send a buffer to the input port + ipBufferHeaderInput->nFilledLen = dataBuffer.BufferSize(); + + if (OMX_ErrorNone != ipCompHandle->EmptyThisBuffer( + ipCompHandle, ipBufferHeaderInput)) + { + StopTest(KErrGeneral, EFail); + } + } + else + { + TCallBack callback03 (RAsyncTestStepOmxILPcmRenderer0005Step03, this); + delete ipKickoff03; + ipKickoff03 = NULL; + ipKickoff03 = + new (ELeave) CAsyncCallBack (callback03, CActive::EPriorityLow); + ipKickoff03->Call(); + } + } + } + +TInt +RAsyncTestStepOmxILPcmRenderer0010::RAsyncTestStepOmxILPcmRenderer0010Step01(TAny* aPtr) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0010::RAsyncTestStepOmxILPcmRenderer0010Step01")); + RAsyncTestStepOmxILPcmRenderer0010* self = + static_cast (aPtr); + self->DoRAsyncTestStepOmxILPcmRenderer0010Step01(); + return KErrNone; + } + +void +RAsyncTestStepOmxILPcmRenderer0010::DoRAsyncTestStepOmxILPcmRenderer0010Step01() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0010::DoRAsyncTestStepOmxILPcmRenderer0010Step01")); + + // + // Provide callbacks to component + // + OMX_CALLBACKTYPE* omxCallbacks = *ipCallbackHandler; + + if (OMX_ErrorNone != ipCompHandle->SetCallbacks( + ipCompHandle, + omxCallbacks, + ipCallbackHandler)) + { + return StopTest(KErrGeneral, EFail); + } + + INFO_PRINTF2(_L("Component Callbacks set successfully: %X"), ipCallbackHandler); + + // + // Obtain the port def params for Port #0 + // + OMX_PARAM_PORTDEFINITIONTYPE portParamsInputPort; + portParamsInputPort.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE); + portParamsInputPort.nVersion = TOmxILSpecVersion(); + portParamsInputPort.nPortIndex = 0; + if (OMX_ErrorNone != ipCompHandle->GetParameter( + ipCompHandle, + OMX_IndexParamPortDefinition, + &portParamsInputPort)) + { + return StopTest(KErrGeneral, EFail); + } + + // + // Change the sampling rate on PCM Renderer's port #0 + // + OMX_AUDIO_PARAM_PCMMODETYPE pcmMode; + pcmMode.nSize = sizeof(OMX_AUDIO_PARAM_PCMMODETYPE); + pcmMode.nVersion = TOmxILSpecVersion(); + pcmMode.nPortIndex = 0; + if (OMX_ErrorNone != ipCompHandle->GetParameter( + ipCompHandle, + OMX_IndexParamAudioPcm, + &pcmMode)) + { + return StopTest(KErrGeneral, EFail); + } + pcmMode.nSamplingRate = 44100; + if (OMX_ErrorNone != ipCompHandle->SetParameter( + ipCompHandle, + OMX_IndexParamAudioPcm, + &pcmMode)) + { + return StopTest(KErrGeneral, EFail); + } + + // + // Move component to OMX_StateIdle + // + + if (OMX_ErrorNone != ipCompHandle->SendCommand( + ipCompHandle, + OMX_CommandStateSet, + OMX_StateIdle, + 0)) + { + return StopTest(KErrGeneral, EFail); + } + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Moving component to OMX_StateIdle")); + + OMX_STATETYPE compState; + if (OMX_ErrorNone != ipCompHandle->GetState(ipCompHandle, + &compState)) + { + return StopTest(KErrGeneral, EFail); + } + + PrintOmxState(compState); + + if (OMX_StateLoaded != compState) + { + return StopTest(KErrGeneral, EFail); + } + + + // + // Allocate buffer on input port + // + if (OMX_ErrorNone != ipCompHandle->AllocateBuffer( + ipCompHandle, + &ipBufferHeaderInput, + 0, // input port + 0, + portParamsInputPort.nBufferSize)) + { + return StopTest(KErrGeneral, EFail); + } + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Populated buffer (AllocateBuffer) in INPUT port")); + } + + +// +// RAsyncTestStepOmxILPcmRenderer0030 +// +RAsyncTestStepOmxILPcmRenderer0030::RAsyncTestStepOmxILPcmRenderer0030(const TDesC& aTestName, TInt aComponentUid) + : + RAsyncTestStepOmxILPcmRenderer0008(aTestName, aComponentUid) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0030::RAsyncTestStepOmxILPcmRenderer0030")); + } + + +void +RAsyncTestStepOmxILPcmRenderer0030::KickoffTestL() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0030::KickoffTestL")); + iTestState = EStateLoadKickoffTestLComplete; + + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test30 ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(AllocateBuffer-population) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Executing ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Repeat these two steps until the whole file has beeen empited ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2a. - Call EmptyThisBuffer on PCM Renderer ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2b. - EmptyBufferDone callback received ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2c. - Get Bytes Played parameter and compare with the bytes readed from file ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Executing->Idle(BufferFlushing) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Idle->Loaded(Depopulation) ")); + + // This will change the test file + iTestFileName.Set(KPcmRendererTestFile); + + // This will install one callback + RAsyncTestStepOmxILComponentBase::KickoffTestL(); + + TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0005Step01, this); + delete ipKickoff01; + ipKickoff01 = NULL; + ipKickoff01 = + new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); + ipKickoff01->Call(); + } + +void +RAsyncTestStepOmxILPcmRenderer0030::DoEmptyBufferDoneL(OMX_HANDLETYPE /*aComponent*/, + OMX_BUFFERHEADERTYPE* aBuffer) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0030::DoEmptyBufferDoneL")); + INFO_PRINTF1(_L("DoEmptyBufferDoneL : Callback received ")); + + // Check that GetConfig is returning the correct amount of bytes played + OMX_SYMBIAN_AUDIO_CONFIG_PCM_BYTESPLAYED bytesPlayedStruct; + bytesPlayedStruct.nSize = sizeof(OMX_SYMBIAN_AUDIO_CONFIG_PCM_BYTESPLAYED); + bytesPlayedStruct.nVersion = TOmxILSpecVersion(); + if (OMX_ErrorNone != ipCompHandle->GetConfig(ipCompHandle, + static_cast(OMX_SymbianIndexConfigAudioBytesPlayed), + &bytesPlayedStruct)) + { + StopTest(KErrGeneral, EFail); + } + //check the number of bytes played by the device corresponds + //to the number of bytes readed from file + //allow an extra margin of one buffer. + TUint maxAllowedBytesPlayed =ipTestFile->GetPos(); + if ((bytesPlayedStruct.nBytesPlayed < 0)||(bytesPlayedStruct.nBytesPlayed > maxAllowedBytesPlayed)) + { + StopTest(KErrGeneral, EFail); + } + + CMMFDataBuffer& dataBuffer = *(static_cast(ipBufferHeaderInput->pInputPortPrivate)); + ipTestFile->ReadNextBuffer(dataBuffer); + + if (dataBuffer.BufferSize() > 0) + { + // Send a buffer to the input port + ipBufferHeaderInput->nFilledLen = dataBuffer.BufferSize(); + + if (OMX_ErrorNone != ipCompHandle->EmptyThisBuffer( + ipCompHandle, ipBufferHeaderInput)) + { + StopTest(KErrGeneral, EFail); + } + } + else + { + TCallBack callback03 (RAsyncTestStepOmxILPcmRenderer0005Step03, this); + delete ipKickoff03; + ipKickoff03 = NULL; + ipKickoff03 = + new (ELeave) CAsyncCallBack (callback03, CActive::EPriorityLow); + ipKickoff03->Call(); + } + } + +// +// RAsyncTestStepOmxILPcmRenderer0031 +// +RAsyncTestStepOmxILPcmRenderer0031::RAsyncTestStepOmxILPcmRenderer0031(const TDesC& aTestName, TInt aComponentUid) + : + RAsyncTestStepOmxILPcmRenderer0008(aTestName, aComponentUid) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0031::RAsyncTestStepOmxILPcmRenderer0031")); + iSamplingRate = 44100; + } + + +void +RAsyncTestStepOmxILPcmRenderer0031::KickoffTestL() + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0031::KickoffTestL")); + iTestState = EStateLoadKickoffTestLComplete; + + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : Test31 ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 1.- Loaded->Idle(AllocateBuffer-population) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Idle->Executing ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2.- Repeat these two steps until the whole file has beeen empited ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2a. - Call EmptyThisBuffer on PCM Renderer ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 2b. - EmptyBufferDone callback received ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 3.- Set Volume Ramp to 2s (after 5 buffers played) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 4.- Executing->Idle(BufferFlushing) ")); + INFO_PRINTF1(_L("UNIT TEST OMX IL PCM RENDERER : 5.- Idle->Loaded(Depopulation) ")); + + // This will change the test file + iTestFileName.Set(KPcmRendererTestFile2); + + // This will install one callback + RAsyncTestStepOmxILComponentBase::KickoffTestL(); + + TCallBack callback01 (RAsyncTestStepOmxILPcmRenderer0005Step01, this); + delete ipKickoff01; + ipKickoff01 = NULL; + ipKickoff01 = + new (ELeave) CAsyncCallBack (callback01, CActive::EPriorityLow); + ipKickoff01->Call(); + } + +void +RAsyncTestStepOmxILPcmRenderer0031::DoEmptyBufferDoneL(OMX_HANDLETYPE /*aComponent*/, + OMX_BUFFERHEADERTYPE* /*aBuffer*/) + { + DEBUG_PRINTF(_L8("RAsyncTestStepOmxILPcmRenderer0031::DoEmptyBufferDoneL")); + INFO_PRINTF1(_L("DoEmptyBufferDoneL : Callback received ")); + + iNumOfEmptiedBuffers++; + if (iNumOfEmptiedBuffers == 5) + { + OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP volumeRampStruct; + volumeRampStruct.nSize = sizeof(OMX_SYMBIAN_AUDIO_CONFIG_PCM_VOLUMERAMP); + volumeRampStruct.nVersion = TOmxILSpecVersion(); + volumeRampStruct.nPortIndex = 0; + if (OMX_ErrorNone != ipCompHandle->GetConfig(ipCompHandle, + static_cast(OMX_SymbianIndexConfigAudioPcmVolumeRamp), + &volumeRampStruct)) + { + StopTest(KErrGeneral, EFail); + } + volumeRampStruct.nRampDuration = 2000000; // 2 second + if (OMX_ErrorNone != ipCompHandle->SetConfig(ipCompHandle, + static_cast(OMX_SymbianIndexConfigAudioPcmVolumeRamp), + &volumeRampStruct)) + { + StopTest(KErrGeneral, EFail); + } + INFO_PRINTF1(_L("Volume ramp set")); + } + + CMMFDataBuffer& dataBuffer = *(static_cast(ipBufferHeaderInput->pInputPortPrivate)); + ipTestFile->ReadNextBuffer(dataBuffer); + + if (dataBuffer.BufferSize() > 0) + { + // Send a buffer to the input port + ipBufferHeaderInput->nFilledLen = dataBuffer.BufferSize(); + + if (OMX_ErrorNone != ipCompHandle->EmptyThisBuffer( + ipCompHandle, ipBufferHeaderInput)) + { + StopTest(KErrGeneral, EFail); + } + } + else + { + TCallBack callback03 (RAsyncTestStepOmxILPcmRenderer0005Step03, this); + delete ipKickoff03; + ipKickoff03 = NULL; + ipKickoff03 = + new (ELeave) CAsyncCallBack (callback03, CActive::EPriorityLow); + ipKickoff03->Call(); + } + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/components/src/tsu_omxil_pcmrenderer_step.h --- a/omxil/omxilunittest/components/src/tsu_omxil_pcmrenderer_step.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/components/src/tsu_omxil_pcmrenderer_step.h Fri May 07 16:25:23 2010 +0100 @@ -1,703 +1,703 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// - -/** - @file - @internalComponent -*/ - -#ifndef TSU_OMXIL_PCMRENDERER_STEP_H -#define TSU_OMXIL_PCMRENDERER_STEP_H - -#include "tsu_omxil_component_base.h" - - -// Forward declarations -class CMMFDescriptorBuffer; - -// -// RAsyncTestStepOmxILPcmRenderer0020 -// -// Test20 Description -// -# Init Component -// -# Obtain the component's state (GetState) -// -# Obtain the component's version (GetComponentVersion) -// -# Provide callbacks to component (SetCallbacks) -// -# Obtain component's role #1 (ComponentRoleEnum) -// -# Obtain component's role #2 (ComponentRoleEnum fails with OMX_ErrorNoMore) -// -class RAsyncTestStepOmxILPcmRenderer0020 : public RAsyncTestStepOmxILComponentBase - { - -public: - - RAsyncTestStepOmxILPcmRenderer0020(const TDesC& aTestName, TInt aComponentUid); - - // From RAsyncTestStep - void KickoffTestL(); - void CloseTest(); - - - // - void DoEventHandlerL(OMX_HANDLETYPE aComponent, - OMX_EVENTTYPE aEvent, - TUint aData1, - TUint aData2, - TAny* aExtra); - - -protected: - - // Call backs - static TInt RAsyncTestStepOmxILPcmRenderer0020Step01(TAny* aPtr); - void DoRAsyncTestStepOmxILPcmRenderer0020Step01(); - -protected: - - CAsyncCallBack* ipKickoff01; - CAsyncCallBack* ipKickoff02; - CAsyncCallBack* ipKickoff03; - CAsyncCallBack* ipKickoff04; - CAsyncCallBack* ipKickoff05; - CAsyncCallBack* ipKickoff06; - - }; - -// Test21 Description -// -# Init Component -// -# Provide callbacks to component (SetCallbacks) -// -# Obtain the component's state (GetState) -// -# Obtain component's role #1 with null string (ComponentRoleEnum fails with OMX_ErrorBadParameter) -// -# Obtain component's role #1 (ComponentRoleEnum successfully returns audio_decoder.aac) -// -# Obtain component's role #2 (ComponentRoleEnum fails with OMX_ErrorNoMore) -// -class RAsyncTestStepOmxILPcmRenderer0021 : public RAsyncTestStepOmxILComponentBase - { - -public: - - RAsyncTestStepOmxILPcmRenderer0021(const TDesC& aTestName, TInt aComponentUid); - - // From RAsyncTestStep - void KickoffTestL(); - void CloseTest(); - - - // - void DoEventHandlerL(OMX_HANDLETYPE aComponent, - OMX_EVENTTYPE aEvent, - TUint aData1, - TUint aData2, - TAny* aExtra); - - -protected: - - // Call backs - static TInt RAsyncTestStepOmxILPcmRenderer0021Step01(TAny* aPtr); - void DoRAsyncTestStepOmxILPcmRenderer0021Step01(); - -protected: - - CAsyncCallBack* ipKickoff01; - CAsyncCallBack* ipKickoff02; - CAsyncCallBack* ipKickoff03; - CAsyncCallBack* ipKickoff04; - CAsyncCallBack* ipKickoff05; - CAsyncCallBack* ipKickoff06; - - }; - -// Test22 Description -// -# Init Component -// -# Provide callbacks to component (SetCallbacks) -// -# Obtain the component's state (GetState) -// -# Get component's current role (GetParameter(OMX_IndexParamStandardComponentRole) ) -// -# Set unsupported audio_decoder.mp3 role (SetParameter(OMX_IndexParamStandardComponentRole) ) -// -# SetParameter returns OMX_ErrorBadParameter (audio_decoder.mp3 role not supported) -// -class RAsyncTestStepOmxILPcmRenderer0022 : public RAsyncTestStepOmxILComponentBase - { - -public: - - RAsyncTestStepOmxILPcmRenderer0022(const TDesC& aTestName, TInt aComponentUid); - - // From RAsyncTestStep - void KickoffTestL(); - void CloseTest(); - - - // - void DoEventHandlerL(OMX_HANDLETYPE aComponent, - OMX_EVENTTYPE aEvent, - TUint aData1, - TUint aData2, - TAny* aExtra); - - -protected: - - // Call backs - static TInt RAsyncTestStepOmxILPcmRenderer0022Step01(TAny* aPtr); - void DoRAsyncTestStepOmxILPcmRenderer0022Step01(); - -protected: - - CAsyncCallBack* ipKickoff01; - CAsyncCallBack* ipKickoff02; - CAsyncCallBack* ipKickoff03; - CAsyncCallBack* ipKickoff04; - CAsyncCallBack* ipKickoff05; - CAsyncCallBack* ipKickoff06; - - }; - - - -// -// RAsyncTestStepOmxILPcmRenderer0001 -// -// Test01 -// -# Init Component -// -# Loaded->Idle(AllocateBuffer-population) -// -# Idle->Loaded(depopulation) -// -class RAsyncTestStepOmxILPcmRenderer0001 : public RAsyncTestStepOmxILComponentBase - { - -public: - - RAsyncTestStepOmxILPcmRenderer0001(const TDesC& aTestName, TInt aComponentUid); - - // From RAsyncTestStep - void KickoffTestL(); - void CloseTest(); - - - // - void DoEventHandlerL(OMX_HANDLETYPE aComponent, - OMX_EVENTTYPE aEvent, - TUint aData1, - TUint aData2, - TAny* aExtra); - - -protected: - - // Call backs - static TInt RAsyncTestStepOmxILPcmRenderer0001Step01(TAny* aPtr); - void DoRAsyncTestStepOmxILPcmRenderer0001Step01(); - - static TInt RAsyncTestStepOmxILPcmRenderer0001Step02(TAny* aPtr); - void DoRAsyncTestStepOmxILPcmRenderer0001Step02(); - -protected: - - - // Set of states for simple state machine - enum TTestState - { - EStateDefault, - EStateLoadKickoffTestLComplete, - EStateTransitionToLoadedComplete, - EStateTransitionToIdleComplete, - EStateTransitionToWaiForResourcesComplete, - EStateTransitionToPauseComplete, - EStateTransitionToExecutingComplete, - }; - - OMX_BUFFERHEADERTYPE* ipBufferHeaderInput; - OMX_BUFFERHEADERTYPE* ipBufferHeaderOutput; - RArray ipClientClockPortBufferArray; - - TBool iTerminateNow; - TInt iSamplingRate; - - TTestState iTestState; - - CAsyncCallBack* ipKickoff01; - CAsyncCallBack* ipKickoff02; - CAsyncCallBack* ipKickoff03; - CAsyncCallBack* ipKickoff04; - CAsyncCallBack* ipKickoff05; - CAsyncCallBack* ipKickoff06; - - }; - -// -// RAsyncTestStepOmxILPcmRenderer0002 -// -// Test02 -// -# Init Component -// -# Loaded->Idle(UseBuffer-population) -// -# Idle->Loaded(depopulation) -// -class RAsyncTestStepOmxILPcmRenderer0002 : public RAsyncTestStepOmxILPcmRenderer0001 - { - -public: - - RAsyncTestStepOmxILPcmRenderer0002(const TDesC& aTestName, TInt aComponentUid); - - // From RAsyncTestStep - void KickoffTestL(); - void CloseTest(); - - - // - void DoEventHandlerL(OMX_HANDLETYPE aComponent, - OMX_EVENTTYPE aEvent, - TUint aData1, - TUint aData2, - TAny* aExtra); - - -protected: - - // Call backs - static TInt RAsyncTestStepOmxILPcmRenderer0002Step01(TAny* aPtr); - void DoRAsyncTestStepOmxILPcmRenderer0002Step01(); - - static TInt RAsyncTestStepOmxILPcmRenderer0002Step02(TAny* aPtr); - // void DoRAsyncTestStepOmxILPcmRenderer0002Step02(); - - -protected: - - CMMFDescriptorBuffer* ipInputBuffer; - CMMFDescriptorBuffer* ipOutputBuffer; - RArray iClockPortBufferPtrArray; - }; - -// -// RAsyncTestStepOmxILPcmRenderer0003 -// -// Test03 -// -# Init Component -// -# Loaded->WaitForResources -// -# WaitForResources->Loaded -// -class RAsyncTestStepOmxILPcmRenderer0003 : public RAsyncTestStepOmxILComponentBase - { - -public: - - RAsyncTestStepOmxILPcmRenderer0003(const TDesC& aTestName, TInt aComponentUid); - - // From RAsyncTestStep - void KickoffTestL(); - void CloseTest(); - - - // - void DoEventHandlerL(OMX_HANDLETYPE aComponent, - OMX_EVENTTYPE aEvent, - TUint aData1, - TUint aData2, - TAny* aExtra); - - -protected: - - // Call backs - static TInt RAsyncTestStepOmxILPcmRenderer0003Step01(TAny* aPtr); - void DoRAsyncTestStepOmxILPcmRenderer0003Step01(); - - static TInt RAsyncTestStepOmxILPcmRenderer0003Step02(TAny* aPtr); - void DoRAsyncTestStepOmxILPcmRenderer0003Step02(); - - -protected: - - TBool iTerminateNow; - - CAsyncCallBack* ipKickoff01; - CAsyncCallBack* ipKickoff02; - CAsyncCallBack* ipKickoff03; - CAsyncCallBack* ipKickoff04; - CAsyncCallBack* ipKickoff05; - CAsyncCallBack* ipKickoff06; - - - }; - -// -// RAsyncTestStepOmxILPcmRenderer0004 -// -// Test04 -// -# Init Component -// -# Loaded->Idle(AllocateBuffer-population) -// -# Idle->Pause -// -# Pause->Idle -// -# Idle->Loaded(depopulation) -// -class RAsyncTestStepOmxILPcmRenderer0004 : public RAsyncTestStepOmxILPcmRenderer0001 - { - -public: - - RAsyncTestStepOmxILPcmRenderer0004(const TDesC& aTestName, TInt aComponentUid); - - // From RAsyncTestStep - void KickoffTestL(); - void CloseTest(); - - - // - void DoEventHandlerL(OMX_HANDLETYPE aComponent, - OMX_EVENTTYPE aEvent, - TUint aData1, - TUint aData2, - TAny* aExtra); - - -protected: - - // Call backs - static TInt RAsyncTestStepOmxILPcmRenderer0004Step01(TAny* aPtr); - // void DoRAsyncTestStepOmxILPcmRenderer0004Step01(); - - static TInt RAsyncTestStepOmxILPcmRenderer0004Step02(TAny* aPtr); - void DoRAsyncTestStepOmxILPcmRenderer0004Step02(); - - static TInt RAsyncTestStepOmxILPcmRenderer0004Step03(TAny* aPtr); - void DoRAsyncTestStepOmxILPcmRenderer0004Step03(); - - static TInt RAsyncTestStepOmxILPcmRenderer0004Step04(TAny* aPtr); - // void DoRAsyncTestStepOmxILPcmRenderer0004Step04(); - - }; - -// -// RAsyncTestStepOmxILPcmRenderer0005 -// -// Test05 -// -# Init Component -// -# Loaded->Idle(AllocateBuffer-population) -// -# Idle->Executing -// -# Call EmptyThisBuffer on PCM Renderer -// -# EmptyBufferDone callbacks received -// -# Executing->Idle(BufferFlushing) -// -# Idle->Loaded(Depopulation) -// -class RAsyncTestStepOmxILPcmRenderer0005 : public RAsyncTestStepOmxILPcmRenderer0004 - { - -public: - - RAsyncTestStepOmxILPcmRenderer0005(const TDesC& aTestName, TInt aComponentUid); - - // From RAsyncTestStep - void KickoffTestL(); - void CloseTest(); - - - // - void DoEventHandlerL(OMX_HANDLETYPE aComponent, - OMX_EVENTTYPE aEvent, - TUint aData1, - TUint aData2, - TAny* aExtra); - - void DoEmptyBufferDoneL(OMX_HANDLETYPE aComponent, - OMX_BUFFERHEADERTYPE* aBuffer); - -protected: - - // Call backs - static TInt RAsyncTestStepOmxILPcmRenderer0005Step01(TAny* aPtr); - // void DoRAsyncTestStepOmxILPcmRenderer0005Step01(); - - static TInt RAsyncTestStepOmxILPcmRenderer0005Step02(TAny* aPtr); - void DoRAsyncTestStepOmxILPcmRenderer0005Step02(); - - static TInt RAsyncTestStepOmxILPcmRenderer0005Step03(TAny* aPtr); - // void DoRAsyncTestStepOmxILPcmRenderer0005Step03(); - - static TInt RAsyncTestStepOmxILPcmRenderer0005Step04(TAny* aPtr); - // void DoRAsyncTestStepOmxILPcmRenderer0005Step04(); - }; - -// -// RAsyncTestStepOmxILPcmRenderer0006 -// -// Test06 -// -# Init Component -// -# Loaded->Idle(AllocateBuffer-population) -// -# Idle->Executing -// -# Executing->Pause -// -# Pause->Executing -// -# Executing->Idle(BufferFlushing) -// -# Idle->Loaded(depopulation) -// -class RAsyncTestStepOmxILPcmRenderer0006 : public RAsyncTestStepOmxILPcmRenderer0005 - { - -public: - - RAsyncTestStepOmxILPcmRenderer0006(const TDesC& aTestName, TInt aComponentUid); - - // From RAsyncTestStep - void KickoffTestL(); - void CloseTest(); - - - // - void DoEventHandlerL(OMX_HANDLETYPE aComponent, - OMX_EVENTTYPE aEvent, - TUint aData1, - TUint aData2, - TAny* aExtra); - - -protected: - - // Call backs - static TInt RAsyncTestStepOmxILPcmRenderer0006Step01(TAny* aPtr); - // void DoRAsyncTestStepOmxILPcmRenderer0006Step01(); - - static TInt RAsyncTestStepOmxILPcmRenderer0006Step02(TAny* aPtr); - // void DoRAsyncTestStepOmxILPcmRenderer0006Step02(); - - static TInt RAsyncTestStepOmxILPcmRenderer0006Step03(TAny* aPtr); - void DoRAsyncTestStepOmxILPcmRenderer0006Step03(); - - static TInt RAsyncTestStepOmxILPcmRenderer0006Step04(TAny* aPtr); - // void DoRAsyncTestStepOmxILPcmRenderer0006Step04(); - - static TInt RAsyncTestStepOmxILPcmRenderer0006Step05(TAny* aPtr); - // void DoRAsyncTestStepOmxILPcmRenderer0006Step05(); - - static TInt RAsyncTestStepOmxILPcmRenderer0006Step06(TAny* aPtr); - // void DoRAsyncTestStepOmxILPcmRenderer0006Step06(); - - }; - -// -// RAsyncTestStepOmxILPcmRenderer0007 -// -// Test07 -// -# Init Component -// -# Loaded->Idle(AllocateBuffer-population) -// -# Idle->Executing -// -# Executing->Pause -// -# Pause->Idle(BufferFlushing) -// -# Idle->Loaded(depopulation) -// -class RAsyncTestStepOmxILPcmRenderer0007 : public RAsyncTestStepOmxILPcmRenderer0006 - { - -public: - - RAsyncTestStepOmxILPcmRenderer0007(const TDesC& aTestName, TInt aComponentUid); - - // From RAsyncTestStep - void KickoffTestL(); - void CloseTest(); - - - // - void DoEventHandlerL(OMX_HANDLETYPE aComponent, - OMX_EVENTTYPE aEvent, - TUint aData1, - TUint aData2, - TAny* aExtra); - - -protected: - - // Call backs - static TInt RAsyncTestStepOmxILPcmRenderer0007Step01(TAny* aPtr); - // void DoRAsyncTestStepOmxILPcmRenderer0007Step01(); - - static TInt RAsyncTestStepOmxILPcmRenderer0007Step02(TAny* aPtr); - // void DoRAsyncTestStepOmxILPcmRenderer0007Step02(); - - static TInt RAsyncTestStepOmxILPcmRenderer0007Step03(TAny* aPtr); - // void DoRAsyncTestStepOmxILPcmRenderer0007Step03(); - - static TInt RAsyncTestStepOmxILPcmRenderer0007Step04(TAny* aPtr); - // void DoRAsyncTestStepOmxILPcmRenderer0007Step04(); - - static TInt RAsyncTestStepOmxILPcmRenderer0007Step05(TAny* aPtr); - // void DoRAsyncTestStepOmxILPcmRenderer0007Step05(); - }; - -// -// RAsyncTestStepOmxILPcmRenderer0008 -// -// Test08 -// -# Init Component -// -# Loaded->Idle(AllocateBuffer-population) -// -# Idle->Executing -// -# Repeat these steps until the whole file has been emptied -// -# Call EmptyThisBuffer on PCM Renderer -// -# EmptyBufferDone callbacks received -// -# Executing->Idle(BufferFlushing) -// -# Idle->Loaded(Depopulation) -// -class RAsyncTestStepOmxILPcmRenderer0008 : public RAsyncTestStepOmxILPcmRenderer0005 - { -public: - RAsyncTestStepOmxILPcmRenderer0008(const TDesC& aTestName, TInt aComponentUid); - - // From RAsyncTestStep - void KickoffTestL(); - - void DoEventHandlerL(OMX_HANDLETYPE aComponent, - OMX_EVENTTYPE aEvent, - TUint aData1, - TUint aData2, - TAny* aExtra); - - void DoEmptyBufferDoneL(OMX_HANDLETYPE aComponent, - OMX_BUFFERHEADERTYPE* aBuffer); - }; - -// -// RAsyncTestStepOmxILPcmRenderer0009 -// -// Test09 -// -# Init Component -// -# Loaded->Idle(AllocateBuffer-population) -// -# Idle->Executing -// -# Repeat these steps until the whole file has been emptied -// -# Call EmptyThisBuffer on PCM Renderer -// -# EmptyBufferDone callbacks received -// -# Executing->Pause and Pause->Executing (after 5 and again after 10 buffers played) -// -# Executing->Idle(BufferFlushing) -// -# Idle->Loaded(Depopulation) -// -class RAsyncTestStepOmxILPcmRenderer0009 : public RAsyncTestStepOmxILPcmRenderer0008 - { -public: - RAsyncTestStepOmxILPcmRenderer0009(const TDesC& aTestName, TInt aComponentUid); - - // From RAsyncTestStep - void KickoffTestL(); - - void DoEventHandlerL(OMX_HANDLETYPE aComponent, - OMX_EVENTTYPE aEvent, - TUint aData1, - TUint aData2, - TAny* aExtra); - - void DoEmptyBufferDoneL(OMX_HANDLETYPE aComponent, - OMX_BUFFERHEADERTYPE* aBuffer); - -private: - TInt iNumOfEmptiedBuffers; - }; - -// -// RAsyncTestStepOmxILPcmRenderer0010 -// -// Test09 -// -# Init Component -// -# Loaded->Idle(AllocateBuffer-population) -// -# Idle->Executing -// -# Repeat these steps until the whole file has been emptied -// -# Call EmptyThisBuffer on PCM Renderer -// -# EmptyBufferDone callbacks received -// -# Executing->Idle and Idle->Executing (after 5 and again after 10 buffers played) -// -# Executing->Idle(BufferFlushing) -// -# Idle->Loaded(Depopulation) -// -class RAsyncTestStepOmxILPcmRenderer0010 : public RAsyncTestStepOmxILPcmRenderer0008 - { -public: - RAsyncTestStepOmxILPcmRenderer0010(const TDesC& aTestName, TInt aComponentUid); - - // From RAsyncTestStep - void KickoffTestL(); - - void DoEventHandlerL(OMX_HANDLETYPE aComponent, - OMX_EVENTTYPE aEvent, - TUint aData1, - TUint aData2, - TAny* aExtra); - - void DoEmptyBufferDoneL(OMX_HANDLETYPE aComponent, - OMX_BUFFERHEADERTYPE* aBuffer); - -protected: - - // Call backs - static TInt RAsyncTestStepOmxILPcmRenderer0010Step01(TAny* aPtr); - void DoRAsyncTestStepOmxILPcmRenderer0010Step01(); - -private: - - - TInt iNumOfEmptiedBuffers; - }; - -// -// RAsyncTestStepOmxILPcmRenderer0030 -// -// Test30 -// -# Init Component -// -# Loaded->Idle(AllocateBuffer-population) -// -# Idle->Executing -// -# Repeat these steps until the whole file has been emptied -// -# Call EmptyThisBuffer on PCM Renderer -// -# EmptyBufferDone callbacks received -// -# Get Bytes Played parameter and compare with the bytes readed from file -// -# Executing->Idle(BufferFlushing) -// -# Idle->Loaded(Depopulation) -// -class RAsyncTestStepOmxILPcmRenderer0030 : public RAsyncTestStepOmxILPcmRenderer0008 - { -public: - RAsyncTestStepOmxILPcmRenderer0030(const TDesC& aTestName, TInt aComponentUid); - - // From RAsyncTestStep - void KickoffTestL(); - - void DoEmptyBufferDoneL(OMX_HANDLETYPE aComponent, - OMX_BUFFERHEADERTYPE* aBuffer); - }; - -// -// RAsyncTestStepOmxILPcmRenderer0031 -// -// Test09 -// -# Init Component -// -# Loaded->Idle(AllocateBuffer-population) -// -# Idle->Executing -// -# Repeat these steps until the whole file has been emptied -// -# Call EmptyThisBuffer on PCM Renderer -// -# EmptyBufferDone callbacks received -// -# Set Volume Ramp to 2s (after 5 buffers played) -// -# Executing->Idle(BufferFlushing) -// -# Idle->Loaded(Depopulation) -// -class RAsyncTestStepOmxILPcmRenderer0031 : public RAsyncTestStepOmxILPcmRenderer0008 - { -public: - RAsyncTestStepOmxILPcmRenderer0031(const TDesC& aTestName, TInt aComponentUid); - - // From RAsyncTestStep - void KickoffTestL(); - - void DoEmptyBufferDoneL(OMX_HANDLETYPE aComponent, - OMX_BUFFERHEADERTYPE* aBuffer); - -private: - TInt iNumOfEmptiedBuffers; - }; - -#endif // TSU_OMXIL_PCMRENDERER_STEP_H +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + @file + @internalComponent +*/ + +#ifndef TSU_OMXIL_PCMRENDERER_STEP_H +#define TSU_OMXIL_PCMRENDERER_STEP_H + +#include "tsu_omxil_component_base.h" + + +// Forward declarations +class CMMFDescriptorBuffer; + +// +// RAsyncTestStepOmxILPcmRenderer0020 +// +// Test20 Description +// -# Init Component +// -# Obtain the component's state (GetState) +// -# Obtain the component's version (GetComponentVersion) +// -# Provide callbacks to component (SetCallbacks) +// -# Obtain component's role #1 (ComponentRoleEnum) +// -# Obtain component's role #2 (ComponentRoleEnum fails with OMX_ErrorNoMore) +// +class RAsyncTestStepOmxILPcmRenderer0020 : public RAsyncTestStepOmxILComponentBase + { + +public: + + RAsyncTestStepOmxILPcmRenderer0020(const TDesC& aTestName, TInt aComponentUid); + + // From RAsyncTestStep + void KickoffTestL(); + void CloseTest(); + + + // + void DoEventHandlerL(OMX_HANDLETYPE aComponent, + OMX_EVENTTYPE aEvent, + TUint aData1, + TUint aData2, + TAny* aExtra); + + +protected: + + // Call backs + static TInt RAsyncTestStepOmxILPcmRenderer0020Step01(TAny* aPtr); + void DoRAsyncTestStepOmxILPcmRenderer0020Step01(); + +protected: + + CAsyncCallBack* ipKickoff01; + CAsyncCallBack* ipKickoff02; + CAsyncCallBack* ipKickoff03; + CAsyncCallBack* ipKickoff04; + CAsyncCallBack* ipKickoff05; + CAsyncCallBack* ipKickoff06; + + }; + +// Test21 Description +// -# Init Component +// -# Provide callbacks to component (SetCallbacks) +// -# Obtain the component's state (GetState) +// -# Obtain component's role #1 with null string (ComponentRoleEnum fails with OMX_ErrorBadParameter) +// -# Obtain component's role #1 (ComponentRoleEnum successfully returns audio_decoder.aac) +// -# Obtain component's role #2 (ComponentRoleEnum fails with OMX_ErrorNoMore) +// +class RAsyncTestStepOmxILPcmRenderer0021 : public RAsyncTestStepOmxILComponentBase + { + +public: + + RAsyncTestStepOmxILPcmRenderer0021(const TDesC& aTestName, TInt aComponentUid); + + // From RAsyncTestStep + void KickoffTestL(); + void CloseTest(); + + + // + void DoEventHandlerL(OMX_HANDLETYPE aComponent, + OMX_EVENTTYPE aEvent, + TUint aData1, + TUint aData2, + TAny* aExtra); + + +protected: + + // Call backs + static TInt RAsyncTestStepOmxILPcmRenderer0021Step01(TAny* aPtr); + void DoRAsyncTestStepOmxILPcmRenderer0021Step01(); + +protected: + + CAsyncCallBack* ipKickoff01; + CAsyncCallBack* ipKickoff02; + CAsyncCallBack* ipKickoff03; + CAsyncCallBack* ipKickoff04; + CAsyncCallBack* ipKickoff05; + CAsyncCallBack* ipKickoff06; + + }; + +// Test22 Description +// -# Init Component +// -# Provide callbacks to component (SetCallbacks) +// -# Obtain the component's state (GetState) +// -# Get component's current role (GetParameter(OMX_IndexParamStandardComponentRole) ) +// -# Set unsupported audio_decoder.mp3 role (SetParameter(OMX_IndexParamStandardComponentRole) ) +// -# SetParameter returns OMX_ErrorBadParameter (audio_decoder.mp3 role not supported) +// +class RAsyncTestStepOmxILPcmRenderer0022 : public RAsyncTestStepOmxILComponentBase + { + +public: + + RAsyncTestStepOmxILPcmRenderer0022(const TDesC& aTestName, TInt aComponentUid); + + // From RAsyncTestStep + void KickoffTestL(); + void CloseTest(); + + + // + void DoEventHandlerL(OMX_HANDLETYPE aComponent, + OMX_EVENTTYPE aEvent, + TUint aData1, + TUint aData2, + TAny* aExtra); + + +protected: + + // Call backs + static TInt RAsyncTestStepOmxILPcmRenderer0022Step01(TAny* aPtr); + void DoRAsyncTestStepOmxILPcmRenderer0022Step01(); + +protected: + + CAsyncCallBack* ipKickoff01; + CAsyncCallBack* ipKickoff02; + CAsyncCallBack* ipKickoff03; + CAsyncCallBack* ipKickoff04; + CAsyncCallBack* ipKickoff05; + CAsyncCallBack* ipKickoff06; + + }; + + + +// +// RAsyncTestStepOmxILPcmRenderer0001 +// +// Test01 +// -# Init Component +// -# Loaded->Idle(AllocateBuffer-population) +// -# Idle->Loaded(depopulation) +// +class RAsyncTestStepOmxILPcmRenderer0001 : public RAsyncTestStepOmxILComponentBase + { + +public: + + RAsyncTestStepOmxILPcmRenderer0001(const TDesC& aTestName, TInt aComponentUid); + + // From RAsyncTestStep + void KickoffTestL(); + void CloseTest(); + + + // + void DoEventHandlerL(OMX_HANDLETYPE aComponent, + OMX_EVENTTYPE aEvent, + TUint aData1, + TUint aData2, + TAny* aExtra); + + +protected: + + // Call backs + static TInt RAsyncTestStepOmxILPcmRenderer0001Step01(TAny* aPtr); + void DoRAsyncTestStepOmxILPcmRenderer0001Step01(); + + static TInt RAsyncTestStepOmxILPcmRenderer0001Step02(TAny* aPtr); + void DoRAsyncTestStepOmxILPcmRenderer0001Step02(); + +protected: + + + // Set of states for simple state machine + enum TTestState + { + EStateDefault, + EStateLoadKickoffTestLComplete, + EStateTransitionToLoadedComplete, + EStateTransitionToIdleComplete, + EStateTransitionToWaiForResourcesComplete, + EStateTransitionToPauseComplete, + EStateTransitionToExecutingComplete, + }; + + OMX_BUFFERHEADERTYPE* ipBufferHeaderInput; + OMX_BUFFERHEADERTYPE* ipBufferHeaderOutput; + RArray ipClientClockPortBufferArray; + + TBool iTerminateNow; + TInt iSamplingRate; + + TTestState iTestState; + + CAsyncCallBack* ipKickoff01; + CAsyncCallBack* ipKickoff02; + CAsyncCallBack* ipKickoff03; + CAsyncCallBack* ipKickoff04; + CAsyncCallBack* ipKickoff05; + CAsyncCallBack* ipKickoff06; + + }; + +// +// RAsyncTestStepOmxILPcmRenderer0002 +// +// Test02 +// -# Init Component +// -# Loaded->Idle(UseBuffer-population) +// -# Idle->Loaded(depopulation) +// +class RAsyncTestStepOmxILPcmRenderer0002 : public RAsyncTestStepOmxILPcmRenderer0001 + { + +public: + + RAsyncTestStepOmxILPcmRenderer0002(const TDesC& aTestName, TInt aComponentUid); + + // From RAsyncTestStep + void KickoffTestL(); + void CloseTest(); + + + // + void DoEventHandlerL(OMX_HANDLETYPE aComponent, + OMX_EVENTTYPE aEvent, + TUint aData1, + TUint aData2, + TAny* aExtra); + + +protected: + + // Call backs + static TInt RAsyncTestStepOmxILPcmRenderer0002Step01(TAny* aPtr); + void DoRAsyncTestStepOmxILPcmRenderer0002Step01(); + + static TInt RAsyncTestStepOmxILPcmRenderer0002Step02(TAny* aPtr); + // void DoRAsyncTestStepOmxILPcmRenderer0002Step02(); + + +protected: + + CMMFDescriptorBuffer* ipInputBuffer; + CMMFDescriptorBuffer* ipOutputBuffer; + RArray iClockPortBufferPtrArray; + }; + +// +// RAsyncTestStepOmxILPcmRenderer0003 +// +// Test03 +// -# Init Component +// -# Loaded->WaitForResources +// -# WaitForResources->Loaded +// +class RAsyncTestStepOmxILPcmRenderer0003 : public RAsyncTestStepOmxILComponentBase + { + +public: + + RAsyncTestStepOmxILPcmRenderer0003(const TDesC& aTestName, TInt aComponentUid); + + // From RAsyncTestStep + void KickoffTestL(); + void CloseTest(); + + + // + void DoEventHandlerL(OMX_HANDLETYPE aComponent, + OMX_EVENTTYPE aEvent, + TUint aData1, + TUint aData2, + TAny* aExtra); + + +protected: + + // Call backs + static TInt RAsyncTestStepOmxILPcmRenderer0003Step01(TAny* aPtr); + void DoRAsyncTestStepOmxILPcmRenderer0003Step01(); + + static TInt RAsyncTestStepOmxILPcmRenderer0003Step02(TAny* aPtr); + void DoRAsyncTestStepOmxILPcmRenderer0003Step02(); + + +protected: + + TBool iTerminateNow; + + CAsyncCallBack* ipKickoff01; + CAsyncCallBack* ipKickoff02; + CAsyncCallBack* ipKickoff03; + CAsyncCallBack* ipKickoff04; + CAsyncCallBack* ipKickoff05; + CAsyncCallBack* ipKickoff06; + + + }; + +// +// RAsyncTestStepOmxILPcmRenderer0004 +// +// Test04 +// -# Init Component +// -# Loaded->Idle(AllocateBuffer-population) +// -# Idle->Pause +// -# Pause->Idle +// -# Idle->Loaded(depopulation) +// +class RAsyncTestStepOmxILPcmRenderer0004 : public RAsyncTestStepOmxILPcmRenderer0001 + { + +public: + + RAsyncTestStepOmxILPcmRenderer0004(const TDesC& aTestName, TInt aComponentUid); + + // From RAsyncTestStep + void KickoffTestL(); + void CloseTest(); + + + // + void DoEventHandlerL(OMX_HANDLETYPE aComponent, + OMX_EVENTTYPE aEvent, + TUint aData1, + TUint aData2, + TAny* aExtra); + + +protected: + + // Call backs + static TInt RAsyncTestStepOmxILPcmRenderer0004Step01(TAny* aPtr); + // void DoRAsyncTestStepOmxILPcmRenderer0004Step01(); + + static TInt RAsyncTestStepOmxILPcmRenderer0004Step02(TAny* aPtr); + void DoRAsyncTestStepOmxILPcmRenderer0004Step02(); + + static TInt RAsyncTestStepOmxILPcmRenderer0004Step03(TAny* aPtr); + void DoRAsyncTestStepOmxILPcmRenderer0004Step03(); + + static TInt RAsyncTestStepOmxILPcmRenderer0004Step04(TAny* aPtr); + // void DoRAsyncTestStepOmxILPcmRenderer0004Step04(); + + }; + +// +// RAsyncTestStepOmxILPcmRenderer0005 +// +// Test05 +// -# Init Component +// -# Loaded->Idle(AllocateBuffer-population) +// -# Idle->Executing +// -# Call EmptyThisBuffer on PCM Renderer +// -# EmptyBufferDone callbacks received +// -# Executing->Idle(BufferFlushing) +// -# Idle->Loaded(Depopulation) +// +class RAsyncTestStepOmxILPcmRenderer0005 : public RAsyncTestStepOmxILPcmRenderer0004 + { + +public: + + RAsyncTestStepOmxILPcmRenderer0005(const TDesC& aTestName, TInt aComponentUid); + + // From RAsyncTestStep + void KickoffTestL(); + void CloseTest(); + + + // + void DoEventHandlerL(OMX_HANDLETYPE aComponent, + OMX_EVENTTYPE aEvent, + TUint aData1, + TUint aData2, + TAny* aExtra); + + void DoEmptyBufferDoneL(OMX_HANDLETYPE aComponent, + OMX_BUFFERHEADERTYPE* aBuffer); + +protected: + + // Call backs + static TInt RAsyncTestStepOmxILPcmRenderer0005Step01(TAny* aPtr); + // void DoRAsyncTestStepOmxILPcmRenderer0005Step01(); + + static TInt RAsyncTestStepOmxILPcmRenderer0005Step02(TAny* aPtr); + void DoRAsyncTestStepOmxILPcmRenderer0005Step02(); + + static TInt RAsyncTestStepOmxILPcmRenderer0005Step03(TAny* aPtr); + // void DoRAsyncTestStepOmxILPcmRenderer0005Step03(); + + static TInt RAsyncTestStepOmxILPcmRenderer0005Step04(TAny* aPtr); + // void DoRAsyncTestStepOmxILPcmRenderer0005Step04(); + }; + +// +// RAsyncTestStepOmxILPcmRenderer0006 +// +// Test06 +// -# Init Component +// -# Loaded->Idle(AllocateBuffer-population) +// -# Idle->Executing +// -# Executing->Pause +// -# Pause->Executing +// -# Executing->Idle(BufferFlushing) +// -# Idle->Loaded(depopulation) +// +class RAsyncTestStepOmxILPcmRenderer0006 : public RAsyncTestStepOmxILPcmRenderer0005 + { + +public: + + RAsyncTestStepOmxILPcmRenderer0006(const TDesC& aTestName, TInt aComponentUid); + + // From RAsyncTestStep + void KickoffTestL(); + void CloseTest(); + + + // + void DoEventHandlerL(OMX_HANDLETYPE aComponent, + OMX_EVENTTYPE aEvent, + TUint aData1, + TUint aData2, + TAny* aExtra); + + +protected: + + // Call backs + static TInt RAsyncTestStepOmxILPcmRenderer0006Step01(TAny* aPtr); + // void DoRAsyncTestStepOmxILPcmRenderer0006Step01(); + + static TInt RAsyncTestStepOmxILPcmRenderer0006Step02(TAny* aPtr); + // void DoRAsyncTestStepOmxILPcmRenderer0006Step02(); + + static TInt RAsyncTestStepOmxILPcmRenderer0006Step03(TAny* aPtr); + void DoRAsyncTestStepOmxILPcmRenderer0006Step03(); + + static TInt RAsyncTestStepOmxILPcmRenderer0006Step04(TAny* aPtr); + // void DoRAsyncTestStepOmxILPcmRenderer0006Step04(); + + static TInt RAsyncTestStepOmxILPcmRenderer0006Step05(TAny* aPtr); + // void DoRAsyncTestStepOmxILPcmRenderer0006Step05(); + + static TInt RAsyncTestStepOmxILPcmRenderer0006Step06(TAny* aPtr); + // void DoRAsyncTestStepOmxILPcmRenderer0006Step06(); + + }; + +// +// RAsyncTestStepOmxILPcmRenderer0007 +// +// Test07 +// -# Init Component +// -# Loaded->Idle(AllocateBuffer-population) +// -# Idle->Executing +// -# Executing->Pause +// -# Pause->Idle(BufferFlushing) +// -# Idle->Loaded(depopulation) +// +class RAsyncTestStepOmxILPcmRenderer0007 : public RAsyncTestStepOmxILPcmRenderer0006 + { + +public: + + RAsyncTestStepOmxILPcmRenderer0007(const TDesC& aTestName, TInt aComponentUid); + + // From RAsyncTestStep + void KickoffTestL(); + void CloseTest(); + + + // + void DoEventHandlerL(OMX_HANDLETYPE aComponent, + OMX_EVENTTYPE aEvent, + TUint aData1, + TUint aData2, + TAny* aExtra); + + +protected: + + // Call backs + static TInt RAsyncTestStepOmxILPcmRenderer0007Step01(TAny* aPtr); + // void DoRAsyncTestStepOmxILPcmRenderer0007Step01(); + + static TInt RAsyncTestStepOmxILPcmRenderer0007Step02(TAny* aPtr); + // void DoRAsyncTestStepOmxILPcmRenderer0007Step02(); + + static TInt RAsyncTestStepOmxILPcmRenderer0007Step03(TAny* aPtr); + // void DoRAsyncTestStepOmxILPcmRenderer0007Step03(); + + static TInt RAsyncTestStepOmxILPcmRenderer0007Step04(TAny* aPtr); + // void DoRAsyncTestStepOmxILPcmRenderer0007Step04(); + + static TInt RAsyncTestStepOmxILPcmRenderer0007Step05(TAny* aPtr); + // void DoRAsyncTestStepOmxILPcmRenderer0007Step05(); + }; + +// +// RAsyncTestStepOmxILPcmRenderer0008 +// +// Test08 +// -# Init Component +// -# Loaded->Idle(AllocateBuffer-population) +// -# Idle->Executing +// -# Repeat these steps until the whole file has been emptied +// -# Call EmptyThisBuffer on PCM Renderer +// -# EmptyBufferDone callbacks received +// -# Executing->Idle(BufferFlushing) +// -# Idle->Loaded(Depopulation) +// +class RAsyncTestStepOmxILPcmRenderer0008 : public RAsyncTestStepOmxILPcmRenderer0005 + { +public: + RAsyncTestStepOmxILPcmRenderer0008(const TDesC& aTestName, TInt aComponentUid); + + // From RAsyncTestStep + void KickoffTestL(); + + void DoEventHandlerL(OMX_HANDLETYPE aComponent, + OMX_EVENTTYPE aEvent, + TUint aData1, + TUint aData2, + TAny* aExtra); + + void DoEmptyBufferDoneL(OMX_HANDLETYPE aComponent, + OMX_BUFFERHEADERTYPE* aBuffer); + }; + +// +// RAsyncTestStepOmxILPcmRenderer0009 +// +// Test09 +// -# Init Component +// -# Loaded->Idle(AllocateBuffer-population) +// -# Idle->Executing +// -# Repeat these steps until the whole file has been emptied +// -# Call EmptyThisBuffer on PCM Renderer +// -# EmptyBufferDone callbacks received +// -# Executing->Pause and Pause->Executing (after 5 and again after 10 buffers played) +// -# Executing->Idle(BufferFlushing) +// -# Idle->Loaded(Depopulation) +// +class RAsyncTestStepOmxILPcmRenderer0009 : public RAsyncTestStepOmxILPcmRenderer0008 + { +public: + RAsyncTestStepOmxILPcmRenderer0009(const TDesC& aTestName, TInt aComponentUid); + + // From RAsyncTestStep + void KickoffTestL(); + + void DoEventHandlerL(OMX_HANDLETYPE aComponent, + OMX_EVENTTYPE aEvent, + TUint aData1, + TUint aData2, + TAny* aExtra); + + void DoEmptyBufferDoneL(OMX_HANDLETYPE aComponent, + OMX_BUFFERHEADERTYPE* aBuffer); + +private: + TInt iNumOfEmptiedBuffers; + }; + +// +// RAsyncTestStepOmxILPcmRenderer0010 +// +// Test09 +// -# Init Component +// -# Loaded->Idle(AllocateBuffer-population) +// -# Idle->Executing +// -# Repeat these steps until the whole file has been emptied +// -# Call EmptyThisBuffer on PCM Renderer +// -# EmptyBufferDone callbacks received +// -# Executing->Idle and Idle->Executing (after 5 and again after 10 buffers played) +// -# Executing->Idle(BufferFlushing) +// -# Idle->Loaded(Depopulation) +// +class RAsyncTestStepOmxILPcmRenderer0010 : public RAsyncTestStepOmxILPcmRenderer0008 + { +public: + RAsyncTestStepOmxILPcmRenderer0010(const TDesC& aTestName, TInt aComponentUid); + + // From RAsyncTestStep + void KickoffTestL(); + + void DoEventHandlerL(OMX_HANDLETYPE aComponent, + OMX_EVENTTYPE aEvent, + TUint aData1, + TUint aData2, + TAny* aExtra); + + void DoEmptyBufferDoneL(OMX_HANDLETYPE aComponent, + OMX_BUFFERHEADERTYPE* aBuffer); + +protected: + + // Call backs + static TInt RAsyncTestStepOmxILPcmRenderer0010Step01(TAny* aPtr); + void DoRAsyncTestStepOmxILPcmRenderer0010Step01(); + +private: + + + TInt iNumOfEmptiedBuffers; + }; + +// +// RAsyncTestStepOmxILPcmRenderer0030 +// +// Test30 +// -# Init Component +// -# Loaded->Idle(AllocateBuffer-population) +// -# Idle->Executing +// -# Repeat these steps until the whole file has been emptied +// -# Call EmptyThisBuffer on PCM Renderer +// -# EmptyBufferDone callbacks received +// -# Get Bytes Played parameter and compare with the bytes readed from file +// -# Executing->Idle(BufferFlushing) +// -# Idle->Loaded(Depopulation) +// +class RAsyncTestStepOmxILPcmRenderer0030 : public RAsyncTestStepOmxILPcmRenderer0008 + { +public: + RAsyncTestStepOmxILPcmRenderer0030(const TDesC& aTestName, TInt aComponentUid); + + // From RAsyncTestStep + void KickoffTestL(); + + void DoEmptyBufferDoneL(OMX_HANDLETYPE aComponent, + OMX_BUFFERHEADERTYPE* aBuffer); + }; + +// +// RAsyncTestStepOmxILPcmRenderer0031 +// +// Test09 +// -# Init Component +// -# Loaded->Idle(AllocateBuffer-population) +// -# Idle->Executing +// -# Repeat these steps until the whole file has been emptied +// -# Call EmptyThisBuffer on PCM Renderer +// -# EmptyBufferDone callbacks received +// -# Set Volume Ramp to 2s (after 5 buffers played) +// -# Executing->Idle(BufferFlushing) +// -# Idle->Loaded(Depopulation) +// +class RAsyncTestStepOmxILPcmRenderer0031 : public RAsyncTestStepOmxILPcmRenderer0008 + { +public: + RAsyncTestStepOmxILPcmRenderer0031(const TDesC& aTestName, TInt aComponentUid); + + // From RAsyncTestStep + void KickoffTestL(); + + void DoEmptyBufferDoneL(OMX_HANDLETYPE aComponent, + OMX_BUFFERHEADERTYPE* aBuffer); + +private: + TInt iNumOfEmptiedBuffers; + }; + +#endif // TSU_OMXIL_PCMRENDERER_STEP_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/components/src/tsu_omxil_pcmrenderer_suite.cpp --- a/omxil/omxilunittest/components/src/tsu_omxil_pcmrenderer_suite.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/components/src/tsu_omxil_pcmrenderer_suite.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,170 +1,170 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// - -/** - @file - @internalComponent -*/ - -#include - -#include "log.h" -#include "tsu_omxil_pcmrenderer_suite.h" -#include "tsu_omxil_pcmrenderer_step.h" -#include "omxilpcmrenderer.hrh" - -/** - * - * NewTestSuiteL - * NewTestSuite is exported at ordinal 1 - * this provides the interface to allow schedule test - * to create instances of this test suite - * @result CTestSuiteOmxILPcmRenderer* - * - */ -EXPORT_C CTestSuiteOmxILPcmRenderer* NewTestSuiteL() - { - CTestSuiteOmxILPcmRenderer* result = new (ELeave) CTestSuiteOmxILPcmRenderer; - CleanupStack::PushL(result); - result->ConstructL(); - CleanupStack::Pop(); // result - return result; - } - -/** - * - * CTestSuiteOmxILPcmRenderer - * - */ -CTestSuiteOmxILPcmRenderer::CTestSuiteOmxILPcmRenderer() - { - DEBUG_PRINTF(_L8("CTestSuiteOmxILPcmRenderer::CTestSuiteOmxILPcmRenderer")); - - } - - -/** - * - * ~CTestSuiteOmxILPcmRenderer - * - */ -CTestSuiteOmxILPcmRenderer::~CTestSuiteOmxILPcmRenderer() - { - DEBUG_PRINTF(_L8("CTestSuiteOmxILPcmRenderer::~CTestSuiteOmxILPcmRenderer")); - } -/** - * - * GetVersion - * Get Test Suite version - * @result TPtrC - * - */ -TPtrC CTestSuiteOmxILPcmRenderer::GetVersion( void ) const - { - _LIT(KTxtVersion,"1.00"); - return KTxtVersion(); - } - - - -/** - * - * InitialiseL - * Constructor for test suite - * this creates all the test steps and - * stores them inside CTestSuiteOmxILPcmRenderer - * - */ -void CTestSuiteOmxILPcmRenderer::InitialiseL(void) - { - // store the name of this test suite - iSuiteName = _L("TSU_OMXIL_PcmRenderer"); - - AddTestStepL( - new(ELeave) RAsyncTestStepOmxILPcmRenderer0020( - _L("MM-OMXIL-OMXILPcmRenderer-U-0020-HP"), - KUidSymbianOmxILPcmRenderer)); - - AddTestStepL( - new(ELeave) RAsyncTestStepOmxILPcmRenderer0021( - _L("MM-OMXIL-OMXILPcmRenderer-U-0021-HP"), - KUidSymbianOmxILPcmRenderer)); - - AddTestStepL( - new(ELeave) RAsyncTestStepOmxILPcmRenderer0022( - _L("MM-OMXIL-OMXILPcmRenderer-U-0022-HP"), - KUidSymbianOmxILPcmRenderer)); - - AddTestStepL( - new(ELeave) RAsyncTestStepOmxILPcmRenderer0001( - _L("MM-OMXIL-OMXILPcmRenderer-U-0001-HP"), - KUidSymbianOmxILPcmRenderer)); - - AddTestStepL( - new(ELeave) RAsyncTestStepOmxILPcmRenderer0002( - _L("MM-OMXIL-OMXILPcmRenderer-U-0002-HP"), - KUidSymbianOmxILPcmRenderer)); - - AddTestStepL( - new(ELeave) RAsyncTestStepOmxILPcmRenderer0003( - _L("MM-OMXIL-OMXILPcmRenderer-U-0003-HP"), - KUidSymbianOmxILPcmRenderer)); - - AddTestStepL( - new(ELeave) RAsyncTestStepOmxILPcmRenderer0004( - _L("MM-OMXIL-OMXILPcmRenderer-U-0004-HP"), - KUidSymbianOmxILPcmRenderer)); - - AddTestStepL( - new(ELeave) RAsyncTestStepOmxILPcmRenderer0005( - _L("MM-OMXIL-OMXILPcmRenderer-U-0005-HP"), - KUidSymbianOmxILPcmRenderer)); - - AddTestStepL( - new(ELeave) RAsyncTestStepOmxILPcmRenderer0006( - _L("MM-OMXIL-OMXILPcmRenderer-U-0006-HP"), - KUidSymbianOmxILPcmRenderer)); - - AddTestStepL( - new(ELeave) RAsyncTestStepOmxILPcmRenderer0007( - _L("MM-OMXIL-OMXILPcmRenderer-U-0007-HP"), - KUidSymbianOmxILPcmRenderer)); - - AddTestStepL( - new(ELeave) RAsyncTestStepOmxILPcmRenderer0008( - _L("MM-OMXIL-OMXILPcmRenderer-U-0008-HP"), - KUidSymbianOmxILPcmRenderer)); - - AddTestStepL( - new(ELeave) RAsyncTestStepOmxILPcmRenderer0009( - _L("MM-OMXIL-OMXILPcmRenderer-U-0009-HP"), - KUidSymbianOmxILPcmRenderer)); - - AddTestStepL( - new(ELeave) RAsyncTestStepOmxILPcmRenderer0010( - _L("MM-OMXIL-OMXILPcmRenderer-U-0010-HP"), - KUidSymbianOmxILPcmRenderer)); - - AddTestStepL( - new(ELeave) RAsyncTestStepOmxILPcmRenderer0030( - _L("MM-OMXIL-OMXILPcmRenderer-U-0030-HP"), - KUidSymbianOmxILPcmRenderer)); - - AddTestStepL( - new(ELeave) RAsyncTestStepOmxILPcmRenderer0031( - _L("MM-OMXIL-OMXILPcmRenderer-U-0031-HP"), - KUidSymbianOmxILPcmRenderer)); - - } +// 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 + +#include "log.h" +#include "tsu_omxil_pcmrenderer_suite.h" +#include "tsu_omxil_pcmrenderer_step.h" +#include "omxilpcmrenderer.hrh" + +/** + * + * NewTestSuiteL + * NewTestSuite is exported at ordinal 1 + * this provides the interface to allow schedule test + * to create instances of this test suite + * @result CTestSuiteOmxILPcmRenderer* + * + */ +EXPORT_C CTestSuiteOmxILPcmRenderer* NewTestSuiteL() + { + CTestSuiteOmxILPcmRenderer* result = new (ELeave) CTestSuiteOmxILPcmRenderer; + CleanupStack::PushL(result); + result->ConstructL(); + CleanupStack::Pop(); // result + return result; + } + +/** + * + * CTestSuiteOmxILPcmRenderer + * + */ +CTestSuiteOmxILPcmRenderer::CTestSuiteOmxILPcmRenderer() + { + DEBUG_PRINTF(_L8("CTestSuiteOmxILPcmRenderer::CTestSuiteOmxILPcmRenderer")); + + } + + +/** + * + * ~CTestSuiteOmxILPcmRenderer + * + */ +CTestSuiteOmxILPcmRenderer::~CTestSuiteOmxILPcmRenderer() + { + DEBUG_PRINTF(_L8("CTestSuiteOmxILPcmRenderer::~CTestSuiteOmxILPcmRenderer")); + } +/** + * + * GetVersion + * Get Test Suite version + * @result TPtrC + * + */ +TPtrC CTestSuiteOmxILPcmRenderer::GetVersion( void ) const + { + _LIT(KTxtVersion,"1.00"); + return KTxtVersion(); + } + + + +/** + * + * InitialiseL + * Constructor for test suite + * this creates all the test steps and + * stores them inside CTestSuiteOmxILPcmRenderer + * + */ +void CTestSuiteOmxILPcmRenderer::InitialiseL(void) + { + // store the name of this test suite + iSuiteName = _L("TSU_OMXIL_PcmRenderer"); + + AddTestStepL( + new(ELeave) RAsyncTestStepOmxILPcmRenderer0020( + _L("MM-OMXIL-OMXILPcmRenderer-U-0020-HP"), + KUidSymbianOmxILPcmRenderer)); + + AddTestStepL( + new(ELeave) RAsyncTestStepOmxILPcmRenderer0021( + _L("MM-OMXIL-OMXILPcmRenderer-U-0021-HP"), + KUidSymbianOmxILPcmRenderer)); + + AddTestStepL( + new(ELeave) RAsyncTestStepOmxILPcmRenderer0022( + _L("MM-OMXIL-OMXILPcmRenderer-U-0022-HP"), + KUidSymbianOmxILPcmRenderer)); + + AddTestStepL( + new(ELeave) RAsyncTestStepOmxILPcmRenderer0001( + _L("MM-OMXIL-OMXILPcmRenderer-U-0001-HP"), + KUidSymbianOmxILPcmRenderer)); + + AddTestStepL( + new(ELeave) RAsyncTestStepOmxILPcmRenderer0002( + _L("MM-OMXIL-OMXILPcmRenderer-U-0002-HP"), + KUidSymbianOmxILPcmRenderer)); + + AddTestStepL( + new(ELeave) RAsyncTestStepOmxILPcmRenderer0003( + _L("MM-OMXIL-OMXILPcmRenderer-U-0003-HP"), + KUidSymbianOmxILPcmRenderer)); + + AddTestStepL( + new(ELeave) RAsyncTestStepOmxILPcmRenderer0004( + _L("MM-OMXIL-OMXILPcmRenderer-U-0004-HP"), + KUidSymbianOmxILPcmRenderer)); + + AddTestStepL( + new(ELeave) RAsyncTestStepOmxILPcmRenderer0005( + _L("MM-OMXIL-OMXILPcmRenderer-U-0005-HP"), + KUidSymbianOmxILPcmRenderer)); + + AddTestStepL( + new(ELeave) RAsyncTestStepOmxILPcmRenderer0006( + _L("MM-OMXIL-OMXILPcmRenderer-U-0006-HP"), + KUidSymbianOmxILPcmRenderer)); + + AddTestStepL( + new(ELeave) RAsyncTestStepOmxILPcmRenderer0007( + _L("MM-OMXIL-OMXILPcmRenderer-U-0007-HP"), + KUidSymbianOmxILPcmRenderer)); + + AddTestStepL( + new(ELeave) RAsyncTestStepOmxILPcmRenderer0008( + _L("MM-OMXIL-OMXILPcmRenderer-U-0008-HP"), + KUidSymbianOmxILPcmRenderer)); + + AddTestStepL( + new(ELeave) RAsyncTestStepOmxILPcmRenderer0009( + _L("MM-OMXIL-OMXILPcmRenderer-U-0009-HP"), + KUidSymbianOmxILPcmRenderer)); + + AddTestStepL( + new(ELeave) RAsyncTestStepOmxILPcmRenderer0010( + _L("MM-OMXIL-OMXILPcmRenderer-U-0010-HP"), + KUidSymbianOmxILPcmRenderer)); + + AddTestStepL( + new(ELeave) RAsyncTestStepOmxILPcmRenderer0030( + _L("MM-OMXIL-OMXILPcmRenderer-U-0030-HP"), + KUidSymbianOmxILPcmRenderer)); + + AddTestStepL( + new(ELeave) RAsyncTestStepOmxILPcmRenderer0031( + _L("MM-OMXIL-OMXILPcmRenderer-U-0031-HP"), + KUidSymbianOmxILPcmRenderer)); + + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/components/src/tsu_omxil_pcmrenderer_suite.h --- a/omxil/omxilunittest/components/src/tsu_omxil_pcmrenderer_suite.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/components/src/tsu_omxil_pcmrenderer_suite.h Fri May 07 16:25:23 2010 +0100 @@ -1,43 +1,43 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// - -/** - @file - @internalComponent -*/ - -#ifndef TSU_OMXIL_PCMRENDERER_SUITE_H -#define TSU_OMXIL_PCMRENDERER_SUITE_H - -#include - -/** - * - * CTestSuiteOmxILPcmRenderer defines the test suite for OMX IL PCM Renderer tests - * - * - * - */ -class CTestSuiteOmxILPcmRenderer : public CTestSuite - { - -public: -CTestSuiteOmxILPcmRenderer(); - void InitialiseL(void); - virtual ~CTestSuiteOmxILPcmRenderer(); - virtual TPtrC GetVersion( void ) const; - }; - -#endif // TSU_OMXIL_PCMRENDERER_SUITE_H +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + @file + @internalComponent +*/ + +#ifndef TSU_OMXIL_PCMRENDERER_SUITE_H +#define TSU_OMXIL_PCMRENDERER_SUITE_H + +#include + +/** + * + * CTestSuiteOmxILPcmRenderer defines the test suite for OMX IL PCM Renderer tests + * + * + * + */ +class CTestSuiteOmxILPcmRenderer : public CTestSuite + { + +public: +CTestSuiteOmxILPcmRenderer(); + void InitialiseL(void); + virtual ~CTestSuiteOmxILPcmRenderer(); + virtual TPtrC GetVersion( void ) const; + }; + +#endif // TSU_OMXIL_PCMRENDERER_SUITE_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/components/src/uids.hrh --- a/omxil/omxilunittest/components/src/uids.hrh Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/components/src/uids.hrh Fri May 07 16:25:23 2010 +0100 @@ -1,26 +1,26 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// - -#ifndef UIDS_HRH -#define UIDS_HRH - -#define KSharedLibraryUidDefine 0x1000008d - -// The following UID has changed to fix the defect DEF123946 v9.5 -#define KUidTsuOmxILAacDecoderDll 0x10285E7C -#define KUidTsuOmxILPcmRendererDll 0x10285C07 - -#endif // UIDS_HRH - +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +#ifndef UIDS_HRH +#define UIDS_HRH + +#define KSharedLibraryUidDefine 0x1000008d + +// The following UID has changed to fix the defect DEF123946 v9.5 +#define KUidTsuOmxILAacDecoderDll 0x10285E7C +#define KUidTsuOmxILPcmRendererDll 0x10285C07 + +#endif // UIDS_HRH + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/contentpipe/bwins/tsu_omxil_dummycontentpipeu.def --- a/omxil/omxilunittest/contentpipe/bwins/tsu_omxil_dummycontentpipeu.def Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/contentpipe/bwins/tsu_omxil_dummycontentpipeu.def Fri May 07 16:25:23 2010 +0100 @@ -1,3 +1,3 @@ -EXPORTS - ?NewTestSuiteL@@YAPAVCTestSuite_OMXIL_DummyContentPipe@@XZ @ 1 NONAME ; class CTestSuite_OMXIL_DummyContentPipe * NewTestSuiteL(void) - +EXPORTS + ?NewTestSuiteL@@YAPAVCTestSuite_OMXIL_DummyContentPipe@@XZ @ 1 NONAME ; class CTestSuite_OMXIL_DummyContentPipe * NewTestSuiteL(void) + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/contentpipe/eabi/tsu_omxil_dummycontentpipeu.def --- a/omxil/omxilunittest/contentpipe/eabi/tsu_omxil_dummycontentpipeu.def Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/contentpipe/eabi/tsu_omxil_dummycontentpipeu.def Fri May 07 16:25:23 2010 +0100 @@ -1,3 +1,3 @@ -EXPORTS - _Z13NewTestSuiteLv @ 1 NONAME - +EXPORTS + _Z13NewTestSuiteLv @ 1 NONAME + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/contentpipe/group/bld.inf --- a/omxil/omxilunittest/contentpipe/group/bld.inf Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/contentpipe/group/bld.inf Fri May 07 16:25:23 2010 +0100 @@ -1,25 +1,25 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// - -PRJ_MMPFILES -//Dummy Content Pipe Unit Tests -../mmpfiles/tsu_omxil_dummycontentpipe.mmp - -PRJ_EXPORTS -// test scripts -../scripts/tsu_omxil_dummycontentpipe.script c:/omxil/tsu_omxil_dummycontentpipe.script - -// Romkit include files -tsu_omxil_dummycontentpipe.iby /epoc32/rom/include/tsu_omxil_dummycontentpipe.iby +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +PRJ_MMPFILES +//Dummy Content Pipe Unit Tests +../mmpfiles/tsu_omxil_dummycontentpipe.mmp + +PRJ_EXPORTS +// test scripts +../scripts/tsu_omxil_dummycontentpipe.script c:/omxil/tsu_omxil_dummycontentpipe.script + +// Romkit include files +tsu_omxil_dummycontentpipe.iby /epoc32/rom/include/tsu_omxil_dummycontentpipe.iby diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/contentpipe/group/tsu_omxil_dummycontentpipe.iby --- a/omxil/omxilunittest/contentpipe/group/tsu_omxil_dummycontentpipe.iby Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/contentpipe/group/tsu_omxil_dummycontentpipe.iby Fri May 07 16:25:23 2010 +0100 @@ -1,28 +1,28 @@ -// -// tsu_omxil_dummycontentpipe.iby - -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// - -#ifndef TSU_OMXIL_DUMMYCONTENTPIPE_IBY -#define TSU_OMXIL_DUMMYCONTENTPIPE_IBY - -// OMX IL Components Unit tests -file=ABI_DIR\BUILD_DIR\tsu_omxil_dummycontentpipe.dll System\Libs\tsu_omxil_dummycontentpipe.dll - -// Scripts -data=EPOCROOT##epoc32\data\c\omxil\tsu_omxil_dummycontentpipe.script \omxil\tsu_omxil_dummycontentpipe.script - +// +// tsu_omxil_dummycontentpipe.iby + +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +#ifndef TSU_OMXIL_DUMMYCONTENTPIPE_IBY +#define TSU_OMXIL_DUMMYCONTENTPIPE_IBY + +// OMX IL Components Unit tests +file=ABI_DIR\BUILD_DIR\tsu_omxil_dummycontentpipe.dll System\Libs\tsu_omxil_dummycontentpipe.dll + +// Scripts +data=EPOCROOT##epoc32\data\c\omxil\tsu_omxil_dummycontentpipe.script \omxil\tsu_omxil_dummycontentpipe.script + #endif // TSU_OMXIL_DUMMYCONTENTPIPE_IBY \ No newline at end of file diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/contentpipe/mmpfiles/tsu_omxil_dummycontentpipe.mmp --- a/omxil/omxilunittest/contentpipe/mmpfiles/tsu_omxil_dummycontentpipe.mmp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/contentpipe/mmpfiles/tsu_omxil_dummycontentpipe.mmp Fri May 07 16:25:23 2010 +0100 @@ -1,38 +1,38 @@ -// 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 tsu_omxil_dummycontentpipe.dll -CAPABILITY ALL -TCB -TARGETTYPE dll -UID 0x1000008d 0x102834BC -VENDORID 0x70000001 - -SOURCEPATH ../src -SOURCE tsu_omxil_dummycontentpipe.cpp -SOURCE tsu_omxil_dummycontentpipesuite.cpp - -USERINCLUDE ../src - -OS_LAYER_SYSTEMINCLUDE_SYMBIAN - -LIBRARY euser.lib -LIBRARY ecom.lib -LIBRARY testframeworkclient.lib - -#ifdef EABI -NOEXPORTLIBRARY -#endif - -SMPSAFE +// 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 tsu_omxil_dummycontentpipe.dll +CAPABILITY ALL -TCB +TARGETTYPE dll +UID 0x1000008d 0x102834BC +VENDORID 0x70000001 + +SOURCEPATH ../src +SOURCE tsu_omxil_dummycontentpipe.cpp +SOURCE tsu_omxil_dummycontentpipesuite.cpp + +USERINCLUDE ../src + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY testframeworkclient.lib + +#ifdef EABI +NOEXPORTLIBRARY +#endif + +SMPSAFE diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/contentpipe/scripts/tsu_omxil_dummycontentpipe.script --- a/omxil/omxilunittest/contentpipe/scripts/tsu_omxil_dummycontentpipe.script Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/contentpipe/scripts/tsu_omxil_dummycontentpipe.script Fri May 07 16:25:23 2010 +0100 @@ -1,48 +1,48 @@ -// -// 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: -// - -LOAD_SUITE TSU_OMXIL_DUMMYCONTENTPIPE.dll - -#Req. under test REQ8336 -# - -//-------------------------------------// -// Dummy Content Pipe // -//-------------------------------------// - -// Create and destroy dummy content pipe -//! @SYMTestCaseID MM-OMXIL-DUMMYCONTENTPIPE-U-0001 - -RUN_TEST_STEP -1 TSU_OMXIL_DUMMYCONTENTPIPE MM-OMXIL-DUMMYCONTENTPIPE-U-0001 -TEST_COMPLETE - -// Call Create() and Close() on a content pipe -//! @SYMTestCaseID MM-OMXIL-DUMMYCONTENTPIPE-U-0002 - -RUN_TEST_STEP -1 TSU_OMXIL_DUMMYCONTENTPIPE MM-OMXIL-DUMMYCONTENTPIPE-U-0002 -TEST_COMPLETE - -// Call SetPosition and GetPosition() on the dummy content pipe 1 -//! @SYMTestCaseID MM-OMXIL-DUMMYCONTENTPIPE-U-0003 - -RUN_TEST_STEP -1 TSU_OMXIL_DUMMYCONTENTPIPE MM-OMXIL-DUMMYCONTENTPIPE-U-0003 -TEST_COMPLETE - -// Call SetPosition and GetPosition() on the dummy content pipe 2 -//! @SYMTestCaseID MM-OMXIL-DUMMYCONTENTPIPE-U-0004 - -RUN_TEST_STEP -1 TSU_OMXIL_DUMMYCONTENTPIPE MM-OMXIL-DUMMYCONTENTPIPE-U-0004 -TEST_COMPLETE +// +// 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: +// + +LOAD_SUITE TSU_OMXIL_DUMMYCONTENTPIPE.dll + +#Req. under test REQ8336 +# + +//-------------------------------------// +// Dummy Content Pipe // +//-------------------------------------// + +// Create and destroy dummy content pipe +//! @SYMTestCaseID MM-OMXIL-DUMMYCONTENTPIPE-U-0001 + +RUN_TEST_STEP -1 TSU_OMXIL_DUMMYCONTENTPIPE MM-OMXIL-DUMMYCONTENTPIPE-U-0001 +TEST_COMPLETE + +// Call Create() and Close() on a content pipe +//! @SYMTestCaseID MM-OMXIL-DUMMYCONTENTPIPE-U-0002 + +RUN_TEST_STEP -1 TSU_OMXIL_DUMMYCONTENTPIPE MM-OMXIL-DUMMYCONTENTPIPE-U-0002 +TEST_COMPLETE + +// Call SetPosition and GetPosition() on the dummy content pipe 1 +//! @SYMTestCaseID MM-OMXIL-DUMMYCONTENTPIPE-U-0003 + +RUN_TEST_STEP -1 TSU_OMXIL_DUMMYCONTENTPIPE MM-OMXIL-DUMMYCONTENTPIPE-U-0003 +TEST_COMPLETE + +// Call SetPosition and GetPosition() on the dummy content pipe 2 +//! @SYMTestCaseID MM-OMXIL-DUMMYCONTENTPIPE-U-0004 + +RUN_TEST_STEP -1 TSU_OMXIL_DUMMYCONTENTPIPE MM-OMXIL-DUMMYCONTENTPIPE-U-0004 +TEST_COMPLETE diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/contentpipe/src/tsu_omxil_dummycontentpipe.cpp --- a/omxil/omxilunittest/contentpipe/src/tsu_omxil_dummycontentpipe.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/contentpipe/src/tsu_omxil_dummycontentpipe.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,385 +1,385 @@ -// 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 - -#include - -#include "../../test_plugins/dummy_cp/src/omxildummycontentpipe.hrh" -#include "../../test_plugins/dummy_cp_2/src/omxildummycontentpipe2.hrh" -#include "tsu_omxil_dummycontentpipe.h" - -char* const KTestUri = "http://www.symbian.com"; -const TInt KTestOffset = 5; - -/** - * - * CTestStep_OMXIL_DummyContentPipe constructor - * - * @xxxx - * - */ -CTestStep_OMXIL_DummyContentPipe::CTestStep_OMXIL_DummyContentPipe() - { - } - -/** - * - * CTestStep_OMXIL_DummyContentPipe destructor - * - * @xxxx - * - */ -CTestStep_OMXIL_DummyContentPipe::~CTestStep_OMXIL_DummyContentPipe() - { - } - -TVerdict CTestStep_OMXIL_DummyContentPipe::DoTestStepPreambleL() - { - TVerdict verdict = EPass; - - return verdict; - } - -TVerdict CTestStep_OMXIL_DummyContentPipe::DoTestStepPostambleL() - { - TVerdict verdict = EPass; - - return verdict; - } - - -CTestStep_OMXIL_DummyContentPipe_U_0001::CTestStep_OMXIL_DummyContentPipe_U_0001() - /** Constructor - */ - { - // store the name of this test case - // this is the name that is used by the script file - // Each test step initialises it's own name - iTestStepName = _L("MM-OMXIL-DummyContentPipe-U-0001"); - } - - -TVerdict CTestStep_OMXIL_DummyContentPipe_U_0001::DoTestStepL( void ) -/** - * Call the COmxILContentPipeIf::CreateImplementationL(..) with the Dummy Content Pipe UID. - * Call COmxILContentPipeIf::GetHandle(..), verify the return value is 0. - * Destroy the COmxILContentPipeIf object and verify there isn't any memory leak. - - * Use case: N/A - * @test Req. under test REQ8336 - */ - { - INFO_PRINTF1(_L("Setting UHEAP_MARK")); - __MM_HEAP_MARK; - - TVerdict verdict = EPass; - TInt err; - COmxILContentPipeIf* dummyContentPipeIf = NULL; - OMX_HANDLETYPE contentPipeHandle; - - INFO_PRINTF1(_L("Attempting to Create Content Pipe Interface")); - TRAP(err, dummyContentPipeIf = COmxILContentPipeIf::CreateImplementationL(TUid::Uid(KUidOmxILDummyContentPipe))); - INFO_PRINTF2(_L("Content Pipe Interface Created: %d"), err); - if(err != KErrNone) - { - verdict = EFail; - } - - INFO_PRINTF1(_L("Attempting to Init Content Pipe")); - err = dummyContentPipeIf->GetHandle(&contentPipeHandle); - INFO_PRINTF2(_L("Content Pipe initialised: %d"), err); - if(err != KErrNone) - { - verdict = EFail; - } - - delete dummyContentPipeIf; - REComSession::FinalClose(); - - INFO_PRINTF1(_L("Setting UHEAP_MARKEND")); - __MM_HEAP_MARKEND; - - return verdict; - } - - -//------------------------------------------------------------------ - -CTestStep_OMXIL_DummyContentPipe_U_0002::CTestStep_OMXIL_DummyContentPipe_U_0002() -/** Constructor -*/ - { - // store the name of this test case - // this is the name that is used by the script file - // Each test step initialises it's own name - iTestStepName = _L("MM-OMXIL-DummyContentPipe-U-0002"); - } - - -TVerdict CTestStep_OMXIL_DummyContentPipe_U_0002::DoTestStepL( void ) -/** -* Call the COmxILContentPipeIf::CreateImplementationL(..) with the Dummy Content Pipe UID. -* Call COmxILContentPipeIf::GetHandle(..), verify the return value is 0. -* Call CP_PIPETYPE::Create(..), verify the return value is 0. -* Call the CP_PIPETYPE::Close(), verify the return value is 0. -* Destroy the COmxILContentPipeIf object and verify there isn't any memory leak. - -* Use case: N/A -* @test Req. under test REQ8336 -*/ - { - INFO_PRINTF1(_L("Setting UHEAP_MARK")); - __MM_HEAP_MARK; - - TVerdict verdict = EPass; - TInt err; - COmxILContentPipeIf* dummyContentPipeIf = NULL; - OMX_HANDLETYPE contentPipeHandle; - CPhandle contentSourceHandle; - - INFO_PRINTF1(_L("Attempting to Create Content Pipe Interface")); - TRAP(err, dummyContentPipeIf = COmxILContentPipeIf::CreateImplementationL(TUid::Uid(KUidOmxILDummyContentPipe))); - INFO_PRINTF2(_L("Content Pipe Interface Created: %d"), err); - if(err != KErrNone) - { - verdict = EFail; - } - - INFO_PRINTF1(_L("Attempting to Init Content Pipe")); - err = dummyContentPipeIf->GetHandle(&contentPipeHandle); - INFO_PRINTF2(_L("Content Pipe initialised: %d"), err); - if(err != KErrNone) - { - verdict = EFail; - } - - INFO_PRINTF1(_L("Attempting to Create Content Source")); - err = (reinterpret_cast(contentPipeHandle))->Create(&contentSourceHandle, KTestUri); - INFO_PRINTF2(_L("Content Source created: %d"), err); - if(err != KErrNone) - { - verdict = EFail; - } - - INFO_PRINTF1(_L("Attempting to Close Content Source")); - err = (reinterpret_cast(contentPipeHandle))->Close(contentSourceHandle); - INFO_PRINTF2(_L("Content Source closed: %d"), err); - if(err != KErrNone) - { - verdict = EFail; - } - - delete dummyContentPipeIf; - REComSession::FinalClose(); - - INFO_PRINTF1(_L("Setting UHEAP_MARKEND")); - __MM_HEAP_MARKEND; - - return verdict; - } - - -//------------------------------------------------------------------ - -CTestStep_OMXIL_DummyContentPipe_U_0003::CTestStep_OMXIL_DummyContentPipe_U_0003() -/** Constructor -*/ - { - // store the name of this test case - // this is the name that is used by the script file - // Each test step initialises it's own name - iTestStepName = _L("MM-OMXIL-DummyContentPipe-U-0003"); - } - - -TVerdict CTestStep_OMXIL_DummyContentPipe_U_0003::DoTestStepL( void ) -/** -* Call the COmxILContentPipeIf::CreateImplementationL(..) with the Dummy Content Pipe UID. -* Call COmxILContentPipeIf::GetHandle(..), verify the return value is 0. -* Call CP_PIPETYPE::Create(..), verify the return value is 0. -* Call CP_PIPETYPE::SetPosition(), verify the return value is 0. -* Call CP_PIPETYPE::GetPosition(), verify the return value is 0. Verify the position has been set correctly -* Call the CP_PIPETYPE::Close(), verify the return value is 0. -* Destroy the COmxILContentPipeIf object and verify there isn't any memory leak. - -* Use case: N/A -* @test Req. under test REQ8336 -*/ - { - INFO_PRINTF1(_L("Setting UHEAP_MARK")); - __MM_HEAP_MARK; - - TVerdict verdict = EPass; - TInt err; - COmxILContentPipeIf* dummyContentPipeIf = NULL; - OMX_HANDLETYPE contentPipeHandle; - CPhandle contentSourceHandle; - - INFO_PRINTF1(_L("Attempting to Create Content Pipe Interface")); - TRAP(err, dummyContentPipeIf = COmxILContentPipeIf::CreateImplementationL(TUid::Uid(KUidOmxILDummyContentPipe))); - INFO_PRINTF2(_L("Content Pipe Interface Created: %d"), err); - if(err != KErrNone) - { - verdict = EFail; - } - - INFO_PRINTF1(_L("Attempting to Init Content Pipe")); - err = dummyContentPipeIf->GetHandle(&contentPipeHandle); - INFO_PRINTF2(_L("Content Pipe initialised: %d"), err); - if(err != KErrNone) - { - verdict = EFail; - } - - INFO_PRINTF1(_L("Attempting to Create Content Source")); - err = (reinterpret_cast(contentPipeHandle))->Create(&contentSourceHandle, KTestUri); - INFO_PRINTF2(_L("Content Source created: %d"), err); - if(err != KErrNone) - { - verdict = EFail; - } - - INFO_PRINTF1(_L("Calling SetPosition()")); - err = (reinterpret_cast(contentPipeHandle))->SetPosition(contentSourceHandle, KTestOffset, CP_OriginBegin); - INFO_PRINTF2(_L("SetPosition() called: %d"), err); - if(err != KErrNone) - { - verdict = EFail; - } - - INFO_PRINTF1(_L("Calling GetPosition()...")); - TUint32 pos; - err = (reinterpret_cast(contentPipeHandle))->GetPosition(contentSourceHandle, &pos); - INFO_PRINTF2(_L("GetPosition() called: %d"), err); - if(err != KErrNone || pos != KTestOffset) - { - verdict = EFail; - } - - INFO_PRINTF1(_L("Attempting to Close Content Source")); - err = (reinterpret_cast(contentPipeHandle))->Close(contentSourceHandle); - INFO_PRINTF2(_L("Content Source closed: %d"), err); - if(err != KErrNone) - { - verdict = EFail; - } - - delete dummyContentPipeIf; - REComSession::FinalClose(); - - INFO_PRINTF1(_L("Setting UHEAP_MARKEND")); - __MM_HEAP_MARKEND; - - return verdict; - } - - -//------------------------------------------------------------------ - -CTestStep_OMXIL_DummyContentPipe_U_0004::CTestStep_OMXIL_DummyContentPipe_U_0004() -/** Constructor -*/ - { - // store the name of this test case - // this is the name that is used by the script file - // Each test step initialises it's own name - iTestStepName = _L("MM-OMXIL-DummyContentPipe-U-0004"); - } - - -TVerdict CTestStep_OMXIL_DummyContentPipe_U_0004::DoTestStepL( void ) -/** -* Call the COmxILContentPipeIf::CreateImplementationL(..) with the Dummy Content Pipe 2 UID. -* Call COmxILContentPipeIf::GetHandle(..), verify the return value is 0. -* Call CP_PIPETYPE::Create(..), verify the return value is 0. -* Call CP_PIPETYPE::SetPosition(), verify the return value is 0. -* Call CP_PIPETYPE::GetPosition(), verify the return value is 0. Verify the position has been set correctly -* Call the CP_PIPETYPE::Close(), verify the return value is 0. -* Destroy the COmxILContentPipeIf object and verify there isn't any memory leak. - -* Use case: N/A -* @test Req. under test REQ8336 -*/ - { - INFO_PRINTF1(_L("Setting UHEAP_MARK")); - __MM_HEAP_MARK; - - TVerdict verdict = EPass; - TInt err; - COmxILContentPipeIf* dummyContentPipeIf = NULL; - OMX_HANDLETYPE contentPipeHandle; - CPhandle contentSourceHandle; - - INFO_PRINTF1(_L("Attempting to Create Content Pipe Interface")); - TRAP(err, dummyContentPipeIf = COmxILContentPipeIf::CreateImplementationL(TUid::Uid(KUidOmxILDummyContentPipe2))); - INFO_PRINTF2(_L("Content Pipe Interface Created: %d"), err); - if(err != KErrNone) - { - verdict = EFail; - } - - INFO_PRINTF1(_L("Attempting to Init Content Pipe")); - err = dummyContentPipeIf->GetHandle(&contentPipeHandle); - INFO_PRINTF2(_L("Content Pipe initialised: %d"), err); - if(err != KErrNone) - { - verdict = EFail; - } - - INFO_PRINTF1(_L("Attempting to Create Content Source")); - err = (reinterpret_cast(contentPipeHandle))->Create(&contentSourceHandle, KTestUri); - INFO_PRINTF2(_L("Content Source created: %d"), err); - if(err != KErrNone) - { - verdict = EFail; - } - - INFO_PRINTF1(_L("Calling SetPosition()")); - err = (reinterpret_cast(contentPipeHandle))->SetPosition(contentSourceHandle, KTestOffset, CP_OriginBegin); - INFO_PRINTF2(_L("SetPosition() called: %d"), err); - if(err != KErrNone) - { - verdict = EFail; - } - - INFO_PRINTF1(_L("Calling GetPosition()...")); - TUint32 pos; - err = (reinterpret_cast(contentPipeHandle))->GetPosition(contentSourceHandle, &pos); - INFO_PRINTF2(_L("GetPosition() called: %d"), err); - if(err != KErrNone || pos != KTestOffset) - { - verdict = EFail; - } - - INFO_PRINTF1(_L("Attempting to Close Content Source")); - err = (reinterpret_cast(contentPipeHandle))->Close(contentSourceHandle); - INFO_PRINTF2(_L("Content Source closed: %d"), err); - if(err != KErrNone) - { - verdict = EFail; - } - - delete dummyContentPipeIf; - REComSession::FinalClose(); - - INFO_PRINTF1(_L("Setting UHEAP_MARKEND")); - __MM_HEAP_MARKEND; - - return verdict; - } - - -//------------------------------------------------------------------ +// 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 + +#include + +#include "../../test_plugins/dummy_cp/src/omxildummycontentpipe.hrh" +#include "../../test_plugins/dummy_cp_2/src/omxildummycontentpipe2.hrh" +#include "tsu_omxil_dummycontentpipe.h" + +char* const KTestUri = "http://www.symbian.com"; +const TInt KTestOffset = 5; + +/** + * + * CTestStep_OMXIL_DummyContentPipe constructor + * + * @xxxx + * + */ +CTestStep_OMXIL_DummyContentPipe::CTestStep_OMXIL_DummyContentPipe() + { + } + +/** + * + * CTestStep_OMXIL_DummyContentPipe destructor + * + * @xxxx + * + */ +CTestStep_OMXIL_DummyContentPipe::~CTestStep_OMXIL_DummyContentPipe() + { + } + +TVerdict CTestStep_OMXIL_DummyContentPipe::DoTestStepPreambleL() + { + TVerdict verdict = EPass; + + return verdict; + } + +TVerdict CTestStep_OMXIL_DummyContentPipe::DoTestStepPostambleL() + { + TVerdict verdict = EPass; + + return verdict; + } + + +CTestStep_OMXIL_DummyContentPipe_U_0001::CTestStep_OMXIL_DummyContentPipe_U_0001() + /** Constructor + */ + { + // store the name of this test case + // this is the name that is used by the script file + // Each test step initialises it's own name + iTestStepName = _L("MM-OMXIL-DummyContentPipe-U-0001"); + } + + +TVerdict CTestStep_OMXIL_DummyContentPipe_U_0001::DoTestStepL( void ) +/** + * Call the COmxILContentPipeIf::CreateImplementationL(..) with the Dummy Content Pipe UID. + * Call COmxILContentPipeIf::GetHandle(..), verify the return value is 0. + * Destroy the COmxILContentPipeIf object and verify there isn't any memory leak. + + * Use case: N/A + * @test Req. under test REQ8336 + */ + { + INFO_PRINTF1(_L("Setting UHEAP_MARK")); + __MM_HEAP_MARK; + + TVerdict verdict = EPass; + TInt err; + COmxILContentPipeIf* dummyContentPipeIf = NULL; + OMX_HANDLETYPE contentPipeHandle; + + INFO_PRINTF1(_L("Attempting to Create Content Pipe Interface")); + TRAP(err, dummyContentPipeIf = COmxILContentPipeIf::CreateImplementationL(TUid::Uid(KUidOmxILDummyContentPipe))); + INFO_PRINTF2(_L("Content Pipe Interface Created: %d"), err); + if(err != KErrNone) + { + verdict = EFail; + } + + INFO_PRINTF1(_L("Attempting to Init Content Pipe")); + err = dummyContentPipeIf->GetHandle(&contentPipeHandle); + INFO_PRINTF2(_L("Content Pipe initialised: %d"), err); + if(err != KErrNone) + { + verdict = EFail; + } + + delete dummyContentPipeIf; + REComSession::FinalClose(); + + INFO_PRINTF1(_L("Setting UHEAP_MARKEND")); + __MM_HEAP_MARKEND; + + return verdict; + } + + +//------------------------------------------------------------------ + +CTestStep_OMXIL_DummyContentPipe_U_0002::CTestStep_OMXIL_DummyContentPipe_U_0002() +/** Constructor +*/ + { + // store the name of this test case + // this is the name that is used by the script file + // Each test step initialises it's own name + iTestStepName = _L("MM-OMXIL-DummyContentPipe-U-0002"); + } + + +TVerdict CTestStep_OMXIL_DummyContentPipe_U_0002::DoTestStepL( void ) +/** +* Call the COmxILContentPipeIf::CreateImplementationL(..) with the Dummy Content Pipe UID. +* Call COmxILContentPipeIf::GetHandle(..), verify the return value is 0. +* Call CP_PIPETYPE::Create(..), verify the return value is 0. +* Call the CP_PIPETYPE::Close(), verify the return value is 0. +* Destroy the COmxILContentPipeIf object and verify there isn't any memory leak. + +* Use case: N/A +* @test Req. under test REQ8336 +*/ + { + INFO_PRINTF1(_L("Setting UHEAP_MARK")); + __MM_HEAP_MARK; + + TVerdict verdict = EPass; + TInt err; + COmxILContentPipeIf* dummyContentPipeIf = NULL; + OMX_HANDLETYPE contentPipeHandle; + CPhandle contentSourceHandle; + + INFO_PRINTF1(_L("Attempting to Create Content Pipe Interface")); + TRAP(err, dummyContentPipeIf = COmxILContentPipeIf::CreateImplementationL(TUid::Uid(KUidOmxILDummyContentPipe))); + INFO_PRINTF2(_L("Content Pipe Interface Created: %d"), err); + if(err != KErrNone) + { + verdict = EFail; + } + + INFO_PRINTF1(_L("Attempting to Init Content Pipe")); + err = dummyContentPipeIf->GetHandle(&contentPipeHandle); + INFO_PRINTF2(_L("Content Pipe initialised: %d"), err); + if(err != KErrNone) + { + verdict = EFail; + } + + INFO_PRINTF1(_L("Attempting to Create Content Source")); + err = (reinterpret_cast(contentPipeHandle))->Create(&contentSourceHandle, KTestUri); + INFO_PRINTF2(_L("Content Source created: %d"), err); + if(err != KErrNone) + { + verdict = EFail; + } + + INFO_PRINTF1(_L("Attempting to Close Content Source")); + err = (reinterpret_cast(contentPipeHandle))->Close(contentSourceHandle); + INFO_PRINTF2(_L("Content Source closed: %d"), err); + if(err != KErrNone) + { + verdict = EFail; + } + + delete dummyContentPipeIf; + REComSession::FinalClose(); + + INFO_PRINTF1(_L("Setting UHEAP_MARKEND")); + __MM_HEAP_MARKEND; + + return verdict; + } + + +//------------------------------------------------------------------ + +CTestStep_OMXIL_DummyContentPipe_U_0003::CTestStep_OMXIL_DummyContentPipe_U_0003() +/** Constructor +*/ + { + // store the name of this test case + // this is the name that is used by the script file + // Each test step initialises it's own name + iTestStepName = _L("MM-OMXIL-DummyContentPipe-U-0003"); + } + + +TVerdict CTestStep_OMXIL_DummyContentPipe_U_0003::DoTestStepL( void ) +/** +* Call the COmxILContentPipeIf::CreateImplementationL(..) with the Dummy Content Pipe UID. +* Call COmxILContentPipeIf::GetHandle(..), verify the return value is 0. +* Call CP_PIPETYPE::Create(..), verify the return value is 0. +* Call CP_PIPETYPE::SetPosition(), verify the return value is 0. +* Call CP_PIPETYPE::GetPosition(), verify the return value is 0. Verify the position has been set correctly +* Call the CP_PIPETYPE::Close(), verify the return value is 0. +* Destroy the COmxILContentPipeIf object and verify there isn't any memory leak. + +* Use case: N/A +* @test Req. under test REQ8336 +*/ + { + INFO_PRINTF1(_L("Setting UHEAP_MARK")); + __MM_HEAP_MARK; + + TVerdict verdict = EPass; + TInt err; + COmxILContentPipeIf* dummyContentPipeIf = NULL; + OMX_HANDLETYPE contentPipeHandle; + CPhandle contentSourceHandle; + + INFO_PRINTF1(_L("Attempting to Create Content Pipe Interface")); + TRAP(err, dummyContentPipeIf = COmxILContentPipeIf::CreateImplementationL(TUid::Uid(KUidOmxILDummyContentPipe))); + INFO_PRINTF2(_L("Content Pipe Interface Created: %d"), err); + if(err != KErrNone) + { + verdict = EFail; + } + + INFO_PRINTF1(_L("Attempting to Init Content Pipe")); + err = dummyContentPipeIf->GetHandle(&contentPipeHandle); + INFO_PRINTF2(_L("Content Pipe initialised: %d"), err); + if(err != KErrNone) + { + verdict = EFail; + } + + INFO_PRINTF1(_L("Attempting to Create Content Source")); + err = (reinterpret_cast(contentPipeHandle))->Create(&contentSourceHandle, KTestUri); + INFO_PRINTF2(_L("Content Source created: %d"), err); + if(err != KErrNone) + { + verdict = EFail; + } + + INFO_PRINTF1(_L("Calling SetPosition()")); + err = (reinterpret_cast(contentPipeHandle))->SetPosition(contentSourceHandle, KTestOffset, CP_OriginBegin); + INFO_PRINTF2(_L("SetPosition() called: %d"), err); + if(err != KErrNone) + { + verdict = EFail; + } + + INFO_PRINTF1(_L("Calling GetPosition()...")); + TUint32 pos; + err = (reinterpret_cast(contentPipeHandle))->GetPosition(contentSourceHandle, &pos); + INFO_PRINTF2(_L("GetPosition() called: %d"), err); + if(err != KErrNone || pos != KTestOffset) + { + verdict = EFail; + } + + INFO_PRINTF1(_L("Attempting to Close Content Source")); + err = (reinterpret_cast(contentPipeHandle))->Close(contentSourceHandle); + INFO_PRINTF2(_L("Content Source closed: %d"), err); + if(err != KErrNone) + { + verdict = EFail; + } + + delete dummyContentPipeIf; + REComSession::FinalClose(); + + INFO_PRINTF1(_L("Setting UHEAP_MARKEND")); + __MM_HEAP_MARKEND; + + return verdict; + } + + +//------------------------------------------------------------------ + +CTestStep_OMXIL_DummyContentPipe_U_0004::CTestStep_OMXIL_DummyContentPipe_U_0004() +/** Constructor +*/ + { + // store the name of this test case + // this is the name that is used by the script file + // Each test step initialises it's own name + iTestStepName = _L("MM-OMXIL-DummyContentPipe-U-0004"); + } + + +TVerdict CTestStep_OMXIL_DummyContentPipe_U_0004::DoTestStepL( void ) +/** +* Call the COmxILContentPipeIf::CreateImplementationL(..) with the Dummy Content Pipe 2 UID. +* Call COmxILContentPipeIf::GetHandle(..), verify the return value is 0. +* Call CP_PIPETYPE::Create(..), verify the return value is 0. +* Call CP_PIPETYPE::SetPosition(), verify the return value is 0. +* Call CP_PIPETYPE::GetPosition(), verify the return value is 0. Verify the position has been set correctly +* Call the CP_PIPETYPE::Close(), verify the return value is 0. +* Destroy the COmxILContentPipeIf object and verify there isn't any memory leak. + +* Use case: N/A +* @test Req. under test REQ8336 +*/ + { + INFO_PRINTF1(_L("Setting UHEAP_MARK")); + __MM_HEAP_MARK; + + TVerdict verdict = EPass; + TInt err; + COmxILContentPipeIf* dummyContentPipeIf = NULL; + OMX_HANDLETYPE contentPipeHandle; + CPhandle contentSourceHandle; + + INFO_PRINTF1(_L("Attempting to Create Content Pipe Interface")); + TRAP(err, dummyContentPipeIf = COmxILContentPipeIf::CreateImplementationL(TUid::Uid(KUidOmxILDummyContentPipe2))); + INFO_PRINTF2(_L("Content Pipe Interface Created: %d"), err); + if(err != KErrNone) + { + verdict = EFail; + } + + INFO_PRINTF1(_L("Attempting to Init Content Pipe")); + err = dummyContentPipeIf->GetHandle(&contentPipeHandle); + INFO_PRINTF2(_L("Content Pipe initialised: %d"), err); + if(err != KErrNone) + { + verdict = EFail; + } + + INFO_PRINTF1(_L("Attempting to Create Content Source")); + err = (reinterpret_cast(contentPipeHandle))->Create(&contentSourceHandle, KTestUri); + INFO_PRINTF2(_L("Content Source created: %d"), err); + if(err != KErrNone) + { + verdict = EFail; + } + + INFO_PRINTF1(_L("Calling SetPosition()")); + err = (reinterpret_cast(contentPipeHandle))->SetPosition(contentSourceHandle, KTestOffset, CP_OriginBegin); + INFO_PRINTF2(_L("SetPosition() called: %d"), err); + if(err != KErrNone) + { + verdict = EFail; + } + + INFO_PRINTF1(_L("Calling GetPosition()...")); + TUint32 pos; + err = (reinterpret_cast(contentPipeHandle))->GetPosition(contentSourceHandle, &pos); + INFO_PRINTF2(_L("GetPosition() called: %d"), err); + if(err != KErrNone || pos != KTestOffset) + { + verdict = EFail; + } + + INFO_PRINTF1(_L("Attempting to Close Content Source")); + err = (reinterpret_cast(contentPipeHandle))->Close(contentSourceHandle); + INFO_PRINTF2(_L("Content Source closed: %d"), err); + if(err != KErrNone) + { + verdict = EFail; + } + + delete dummyContentPipeIf; + REComSession::FinalClose(); + + INFO_PRINTF1(_L("Setting UHEAP_MARKEND")); + __MM_HEAP_MARKEND; + + return verdict; + } + + +//------------------------------------------------------------------ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/contentpipe/src/tsu_omxil_dummycontentpipe.h --- a/omxil/omxilunittest/contentpipe/src/tsu_omxil_dummycontentpipe.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/contentpipe/src/tsu_omxil_dummycontentpipe.h Fri May 07 16:25:23 2010 +0100 @@ -1,88 +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: -// - -#ifndef TSU_OMXIL_DUMMYCONTENTPIPE_H -#define TSU_OMXIL_DUMMYCONTENTPIPE_H - -#include - -// forward declaring -class CTestSuite_OMXIL_DummyContentPipe; - -class CTestStep_OMXIL_DummyContentPipe: public CTestStep - { -public: - CTestStep_OMXIL_DummyContentPipe(); - ~CTestStep_OMXIL_DummyContentPipe(); - static void CleanUp(TAny *aPtr); - void SetTestSuite(const CTestSuite_OMXIL_DummyContentPipe* aTestSuite ) - {iOMXDummyContentPipeTestSuite = aTestSuite;} - - virtual TVerdict DoTestStepPreambleL(); - virtual TVerdict DoTestStepPostambleL(); -protected: - // pointer to suite which owns this test - const CTestSuite_OMXIL_DummyContentPipe* iOMXDummyContentPipeTestSuite; - }; - -/** - *@class CTestStep_OMXIL_DummyContentPipe_U_0001 - *@test Req. under test REQ8336 - */ -class CTestStep_OMXIL_DummyContentPipe_U_0001 : public CTestStep_OMXIL_DummyContentPipe - { -public: - CTestStep_OMXIL_DummyContentPipe_U_0001() ; - ~CTestStep_OMXIL_DummyContentPipe_U_0001(){} ; - virtual TVerdict DoTestStepL( void ); - }; - -/** - *@class CTestStep_OMXIL_DummyContentPipe_U_0002 - *@test Req. under test REQ8336 - */ -class CTestStep_OMXIL_DummyContentPipe_U_0002 : public CTestStep_OMXIL_DummyContentPipe - { -public: - CTestStep_OMXIL_DummyContentPipe_U_0002() ; - ~CTestStep_OMXIL_DummyContentPipe_U_0002(){} ; - virtual TVerdict DoTestStepL( void ); - }; - -/** - *@class CTestStep_OMXIL_DummyContentPipe_U_0003 - *@test Req. under test REQ8336 - */ -class CTestStep_OMXIL_DummyContentPipe_U_0003 : public CTestStep_OMXIL_DummyContentPipe - { - public: - CTestStep_OMXIL_DummyContentPipe_U_0003() ; - ~CTestStep_OMXIL_DummyContentPipe_U_0003(){} ; - virtual TVerdict DoTestStepL( void ); - }; - -/** - *@class CTestStep_OMXIL_DummyContentPipe_U_0004 - *@test Req. under test REQ8336 - */ -class CTestStep_OMXIL_DummyContentPipe_U_0004 : public CTestStep_OMXIL_DummyContentPipe - { - public: - CTestStep_OMXIL_DummyContentPipe_U_0004() ; - ~CTestStep_OMXIL_DummyContentPipe_U_0004(){} ; - virtual TVerdict DoTestStepL( void ); - }; - -#endif // TSU_OMXIL_DUMMYCONTENTPIPE_H +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +#ifndef TSU_OMXIL_DUMMYCONTENTPIPE_H +#define TSU_OMXIL_DUMMYCONTENTPIPE_H + +#include + +// forward declaring +class CTestSuite_OMXIL_DummyContentPipe; + +class CTestStep_OMXIL_DummyContentPipe: public CTestStep + { +public: + CTestStep_OMXIL_DummyContentPipe(); + ~CTestStep_OMXIL_DummyContentPipe(); + static void CleanUp(TAny *aPtr); + void SetTestSuite(const CTestSuite_OMXIL_DummyContentPipe* aTestSuite ) + {iOMXDummyContentPipeTestSuite = aTestSuite;} + + virtual TVerdict DoTestStepPreambleL(); + virtual TVerdict DoTestStepPostambleL(); +protected: + // pointer to suite which owns this test + const CTestSuite_OMXIL_DummyContentPipe* iOMXDummyContentPipeTestSuite; + }; + +/** + *@class CTestStep_OMXIL_DummyContentPipe_U_0001 + *@test Req. under test REQ8336 + */ +class CTestStep_OMXIL_DummyContentPipe_U_0001 : public CTestStep_OMXIL_DummyContentPipe + { +public: + CTestStep_OMXIL_DummyContentPipe_U_0001() ; + ~CTestStep_OMXIL_DummyContentPipe_U_0001(){} ; + virtual TVerdict DoTestStepL( void ); + }; + +/** + *@class CTestStep_OMXIL_DummyContentPipe_U_0002 + *@test Req. under test REQ8336 + */ +class CTestStep_OMXIL_DummyContentPipe_U_0002 : public CTestStep_OMXIL_DummyContentPipe + { +public: + CTestStep_OMXIL_DummyContentPipe_U_0002() ; + ~CTestStep_OMXIL_DummyContentPipe_U_0002(){} ; + virtual TVerdict DoTestStepL( void ); + }; + +/** + *@class CTestStep_OMXIL_DummyContentPipe_U_0003 + *@test Req. under test REQ8336 + */ +class CTestStep_OMXIL_DummyContentPipe_U_0003 : public CTestStep_OMXIL_DummyContentPipe + { + public: + CTestStep_OMXIL_DummyContentPipe_U_0003() ; + ~CTestStep_OMXIL_DummyContentPipe_U_0003(){} ; + virtual TVerdict DoTestStepL( void ); + }; + +/** + *@class CTestStep_OMXIL_DummyContentPipe_U_0004 + *@test Req. under test REQ8336 + */ +class CTestStep_OMXIL_DummyContentPipe_U_0004 : public CTestStep_OMXIL_DummyContentPipe + { + public: + CTestStep_OMXIL_DummyContentPipe_U_0004() ; + ~CTestStep_OMXIL_DummyContentPipe_U_0004(){} ; + virtual TVerdict DoTestStepL( void ); + }; + +#endif // TSU_OMXIL_DUMMYCONTENTPIPE_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/contentpipe/src/tsu_omxil_dummycontentpipesuite.cpp --- a/omxil/omxilunittest/contentpipe/src/tsu_omxil_dummycontentpipesuite.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/contentpipe/src/tsu_omxil_dummycontentpipesuite.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,92 +1,92 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// This is the main DLL entry point for the tsu_omxil_dummycontentpipe.dll -// -// - -// EPOC includes -#include - -// Test system includes -#include "tsu_omxil_dummycontentpipesuite.h" -#include "tsu_omxil_dummycontentpipe.h" - - - -/** - * - * Create an instance of this test suite. - * - * NewTestSuiteL is exported at ordinal 1. - * This provides the interface to allow the Test Framework - * to create instances of this test suite. - * - * @return "CTestSuite_OMXIL_DummyContentPipe*" - * The newly created test suite - */ -EXPORT_C CTestSuite_OMXIL_DummyContentPipe* NewTestSuiteL() - { - CTestSuite_OMXIL_DummyContentPipe* result = new (ELeave) CTestSuite_OMXIL_DummyContentPipe; - CleanupStack::PushL(result); - result->ConstructL(); - CleanupStack::Pop(); // result - return result; - } - -CTestSuite_OMXIL_DummyContentPipe::~CTestSuite_OMXIL_DummyContentPipe() - { - } - - -/** - * - * Get test suite version. - * - * @return "TPtrC" - * The version string. - * - * @xxxx - * - */ -_LIT(KTxtVersion,"0.1"); -TPtrC CTestSuite_OMXIL_DummyContentPipe::GetVersion( void ) const - { - - return KTxtVersion(); - } - -/** - * - * Initialiser for test suite. - * This creates all the test steps and stores them - * inside test suite - * - * @xxxx - * - */ -void CTestSuite_OMXIL_DummyContentPipe::InitialiseL( void ) - { - - // store the name of this test suite - iSuiteName = _L("TSU_OMXIL_DUMMYCONTENTPIPE"); - - // add test steps - AddTestStepL( new(ELeave) CTestStep_OMXIL_DummyContentPipe_U_0001 ); - AddTestStepL( new(ELeave) CTestStep_OMXIL_DummyContentPipe_U_0002 ); - AddTestStepL( new(ELeave) CTestStep_OMXIL_DummyContentPipe_U_0003 ); - AddTestStepL( new(ELeave) CTestStep_OMXIL_DummyContentPipe_U_0004 ); - } - - -// ------------------------- +// 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 is the main DLL entry point for the tsu_omxil_dummycontentpipe.dll +// +// + +// EPOC includes +#include + +// Test system includes +#include "tsu_omxil_dummycontentpipesuite.h" +#include "tsu_omxil_dummycontentpipe.h" + + + +/** + * + * Create an instance of this test suite. + * + * NewTestSuiteL is exported at ordinal 1. + * This provides the interface to allow the Test Framework + * to create instances of this test suite. + * + * @return "CTestSuite_OMXIL_DummyContentPipe*" + * The newly created test suite + */ +EXPORT_C CTestSuite_OMXIL_DummyContentPipe* NewTestSuiteL() + { + CTestSuite_OMXIL_DummyContentPipe* result = new (ELeave) CTestSuite_OMXIL_DummyContentPipe; + CleanupStack::PushL(result); + result->ConstructL(); + CleanupStack::Pop(); // result + return result; + } + +CTestSuite_OMXIL_DummyContentPipe::~CTestSuite_OMXIL_DummyContentPipe() + { + } + + +/** + * + * Get test suite version. + * + * @return "TPtrC" + * The version string. + * + * @xxxx + * + */ +_LIT(KTxtVersion,"0.1"); +TPtrC CTestSuite_OMXIL_DummyContentPipe::GetVersion( void ) const + { + + return KTxtVersion(); + } + +/** + * + * Initialiser for test suite. + * This creates all the test steps and stores them + * inside test suite + * + * @xxxx + * + */ +void CTestSuite_OMXIL_DummyContentPipe::InitialiseL( void ) + { + + // store the name of this test suite + iSuiteName = _L("TSU_OMXIL_DUMMYCONTENTPIPE"); + + // add test steps + AddTestStepL( new(ELeave) CTestStep_OMXIL_DummyContentPipe_U_0001 ); + AddTestStepL( new(ELeave) CTestStep_OMXIL_DummyContentPipe_U_0002 ); + AddTestStepL( new(ELeave) CTestStep_OMXIL_DummyContentPipe_U_0003 ); + AddTestStepL( new(ELeave) CTestStep_OMXIL_DummyContentPipe_U_0004 ); + } + + +// ------------------------- diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/contentpipe/src/tsu_omxil_dummycontentpipesuite.h --- a/omxil/omxilunittest/contentpipe/src/tsu_omxil_dummycontentpipesuite.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/contentpipe/src/tsu_omxil_dummycontentpipesuite.h Fri May 07 16:25:23 2010 +0100 @@ -1,37 +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: -// - -#ifndef TSU_OMXIL_DUMMYCONTENTPIPE_SUITE_H_ -#define TSU_OMXIL_DUMMYCONTENTPIPE_SUITE_H_ - -#include - -/** - * - * CTestSuite, which is the base class for - * the CTestSuite_OMXIL_DummyContentPipe. - * - */ -class CTestSuite_OMXIL_DummyContentPipe : public CTestSuite - { - public: - - void InitialiseL( void ); - virtual ~CTestSuite_OMXIL_DummyContentPipe(); - virtual TPtrC GetVersion( void ) const; - }; - - -#endif /* TSU_OMXIL_DUMMYCONTENTPIPE_SUITE_H_ */ +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +#ifndef TSU_OMXIL_DUMMYCONTENTPIPE_SUITE_H_ +#define TSU_OMXIL_DUMMYCONTENTPIPE_SUITE_H_ + +#include + +/** + * + * CTestSuite, which is the base class for + * the CTestSuite_OMXIL_DummyContentPipe. + * + */ +class CTestSuite_OMXIL_DummyContentPipe : public CTestSuite + { + public: + + void InitialiseL( void ); + virtual ~CTestSuite_OMXIL_DummyContentPipe(); + virtual TPtrC GetVersion( void ) const; + }; + + +#endif /* TSU_OMXIL_DUMMYCONTENTPIPE_SUITE_H_ */ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/group/bld.inf --- a/omxil/omxilunittest/group/bld.inf Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/group/bld.inf Fri May 07 16:25:23 2010 +0100 @@ -1,21 +1,22 @@ -// 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 "../components/group/bld.inf" -#include "../contentpipe/group/bld.inf" -#include "../test_plugins/dummy_components/group/bld.inf" -#include "../test_plugins/dummy_cp/group/bld.inf" -#include "../test_plugins/dummy_cp_2/group/bld.inf" -#include "../test_plugins/dummy_loader/group/bld.inf" \ No newline at end of file +// 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 "../components/group/bld.inf" +#include "../contentpipe/group/bld.inf" +#include "../test_plugins/dummy_components/group/bld.inf" +#include "../test_plugins/dummy_cp/group/bld.inf" +#include "../test_plugins/dummy_cp_2/group/bld.inf" +#include "../test_plugins/dummy_loader/group/bld.inf" + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/group/multimedia_unittest_omx_il.mrp --- a/omxil/omxilunittest/group/multimedia_unittest_omx_il.mrp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/group/multimedia_unittest_omx_il.mrp Fri May 07 16:25:23 2010 +0100 @@ -1,24 +1,24 @@ -# multimedia_unittest_omx_il.mrp -# -# 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: -# - -component multimedia_unittest_omx_il - -source \sf\os\mm\omxil\omxilunittest - -notes_source \component_defs\release.src - +# multimedia_unittest_omx_il.mrp +# +# 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: +# + +component multimedia_unittest_omx_il + +source \sf\os\mm\omxil\omxilunittest + +notes_source \component_defs\release.src + ipr T \ No newline at end of file diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/test_plugins/dummy_components/group/bld.inf --- a/omxil/omxilunittest/test_plugins/dummy_components/group/bld.inf Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/test_plugins/dummy_components/group/bld.inf Fri May 07 16:25:23 2010 +0100 @@ -1,23 +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: -// - -PRJ_MMPFILES -../mmpfiles/Core_Conf_Dummy_Component1.mmp -../mmpfiles/Core_Conf_Dummy_Component2.mmp - - -PRJ_EXPORTS -// Romkit include files -omxildummycomponents.iby /epoc32/rom/include/omxildummycomponents.iby +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +PRJ_MMPFILES +//../mmpfiles/Core_Conf_Dummy_Component1.mmp +//../mmpfiles/Core_Conf_Dummy_Component2.mmp + + +PRJ_EXPORTS +// Romkit include files +omxildummycomponents.iby /epoc32/rom/include/omxildummycomponents.iby diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/test_plugins/dummy_components/group/omxildummycomponents.iby --- a/omxil/omxilunittest/test_plugins/dummy_components/group/omxildummycomponents.iby Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/test_plugins/dummy_components/group/omxildummycomponents.iby Fri May 07 16:25:23 2010 +0100 @@ -1,23 +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 OMXILDUMMYCOMPONENTS_IBY -#define OMXILDUMMYCOMPONENTS_IBY - -// Dummy Components -ECOM_PLUGIN(core_conf_dummy_component1.dll, core_conf_dummy_component1.rsc) -ECOM_PLUGIN(core_conf_dummy_component2.dll, core_conf_dummy_component2.rsc) - +// 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 OMXILDUMMYCOMPONENTS_IBY +#define OMXILDUMMYCOMPONENTS_IBY + +// Dummy Components +ECOM_PLUGIN(core_conf_dummy_component1.dll, core_conf_dummy_component1.rsc) +ECOM_PLUGIN(core_conf_dummy_component2.dll, core_conf_dummy_component2.rsc) + #endif //OMXILDUMMYCOMPONENTS_IBY \ No newline at end of file diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/test_plugins/dummy_components/mmpfiles/Core_Conf_Dummy_Component1.mmp --- a/omxil/omxilunittest/test_plugins/dummy_components/mmpfiles/Core_Conf_Dummy_Component1.mmp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/test_plugins/dummy_components/mmpfiles/Core_Conf_Dummy_Component1.mmp Fri May 07 16:25:23 2010 +0100 @@ -1,61 +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: -// - -#include "../src/Core_Conf_Dummy_Component.hrh" - -TARGET core_conf_dummy_component1.dll -CAPABILITY ALL -TCB -TARGETTYPE PLUGIN -EPOCALLOWDLLDATA -UID 0x10009D8D KUidCoreDummyTestComponent1Dll -VENDORID 0x70000001 - - -OS_LAYER_SYSTEMINCLUDE_SYMBIAN -OS_LAYER_ESTLIB_SYSTEMINCLUDE - -// Specifics to dummy component for core conf suite -USERINCLUDE ../../../../omxilcoreconftest/generic/inc -SOURCEPATH ../../../../omxilcoreconftest/generic/src -SOURCE Core_Conf_DummyTestComponent.c -SOURCE Core_Conf_TestHarness.c -SOURCE Core_Conf_Tests.c -SOURCEPATH ../../../../omxilcoreconftest/generic/src/tests -SOURCE Core_Conf_CoreInitDeinitTest.c -SOURCE Core_Conf_CompLoadUnloadTest.c -SOURCE Core_Conf_CompNameEnumTest.c -SOURCE Core_Conf_CompRolesTest.c -SOURCE Core_Conf_GetContentPipeTest.c -SOURCE Core_Conf_TunnelSetupTest.c -SOURCE Core_Conf_OSAL_Test.c -SOURCEPATH ../../../../omxilcoreconftest/src -SOURCE Core_Conf_OSAL_Interface.cpp - - -// Porting of dummy component to Symbian OS -SOURCEPATH ../src -SOURCE Core_Conf_Dummy_Component1.cpp -RESOURCE Core_Conf_Dummy_Component1.rss - -LIBRARY euser.lib -LIBRARY ecom.lib -LIBRARY estlib.lib -LIBRARY hal.lib -LIBRARY omxilcoreclient.lib -STATICLIBRARY omxilcomponentif.lib - -NOSTRICTDEF - -SMPSAFE +// 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_Conf_Dummy_Component.hrh" + +TARGET core_conf_dummy_component1.dll +CAPABILITY ALL -TCB +TARGETTYPE PLUGIN +EPOCALLOWDLLDATA +UID 0x10009D8D KUidCoreDummyTestComponent1Dll +VENDORID 0x70000001 + + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN +OS_LAYER_ESTLIB_SYSTEMINCLUDE + +// Specifics to dummy component for core conf suite +USERINCLUDE ../../../../omxilcoreconftest/generic/inc +SOURCEPATH ../../../../omxilcoreconftest/generic/src +SOURCE Core_Conf_DummyTestComponent.c +SOURCE Core_Conf_TestHarness.c +SOURCE Core_Conf_Tests.c +SOURCEPATH ../../../../omxilcoreconftest/generic/src/tests +SOURCE Core_Conf_CoreInitDeinitTest.c +SOURCE Core_Conf_CompLoadUnloadTest.c +SOURCE Core_Conf_CompNameEnumTest.c +SOURCE Core_Conf_CompRolesTest.c +SOURCE Core_Conf_GetContentPipeTest.c +SOURCE Core_Conf_TunnelSetupTest.c +SOURCE Core_Conf_OSAL_Test.c +SOURCEPATH ../../../../omxilcoreconftest/src +SOURCE Core_Conf_OSAL_Interface.cpp + + +// Porting of dummy component to Symbian OS +SOURCEPATH ../src +SOURCE Core_Conf_Dummy_Component1.cpp +RESOURCE Core_Conf_Dummy_Component1.rss + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY estlib.lib +LIBRARY hal.lib +LIBRARY omxilcoreclient.lib +STATICLIBRARY omxilcomponentif.lib + +NOSTRICTDEF + +SMPSAFE diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/test_plugins/dummy_components/mmpfiles/Core_Conf_Dummy_Component2.mmp --- a/omxil/omxilunittest/test_plugins/dummy_components/mmpfiles/Core_Conf_Dummy_Component2.mmp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/test_plugins/dummy_components/mmpfiles/Core_Conf_Dummy_Component2.mmp Fri May 07 16:25:23 2010 +0100 @@ -1,61 +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: -// - -#include "../src/Core_Conf_Dummy_Component.hrh" - -TARGET core_conf_dummy_component2.dll -CAPABILITY ALL -TCB -TARGETTYPE PLUGIN -EPOCALLOWDLLDATA -UID 0x10009D8D KUidCoreDummyTestComponent2Dll -VENDORID 0x70000001 - - -OS_LAYER_SYSTEMINCLUDE_SYMBIAN -OS_LAYER_ESTLIB_SYSTEMINCLUDE - -// Specifics to dummy component for core conf suite -USERINCLUDE ../../../../omxilcoreconftest/generic/inc -SOURCEPATH ../../../../omxilcoreconftest/generic/src -SOURCE Core_Conf_DummyTestComponent.c -SOURCE Core_Conf_TestHarness.c -SOURCE Core_Conf_Tests.c -SOURCEPATH ../../../../omxilcoreconftest/generic/src/tests -SOURCE Core_Conf_CoreInitDeinitTest.c -SOURCE Core_Conf_CompLoadUnloadTest.c -SOURCE Core_Conf_CompNameEnumTest.c -SOURCE Core_Conf_CompRolesTest.c -SOURCE Core_Conf_GetContentPipeTest.c -SOURCE Core_Conf_TunnelSetupTest.c -SOURCE Core_Conf_OSAL_Test.c -SOURCEPATH ../../../../omxilcoreconftest/src -SOURCE Core_Conf_OSAL_Interface.cpp - - -// Porting of dummy component to Symbian OS -SOURCEPATH ../src -SOURCE Core_Conf_Dummy_Component2.cpp -RESOURCE Core_Conf_Dummy_Component2.rss - -LIBRARY euser.lib -LIBRARY ecom.lib -LIBRARY estlib.lib -LIBRARY hal.lib -LIBRARY omxilcoreclient.lib -STATICLIBRARY omxilcomponentif.lib - -NOSTRICTDEF - -SMPSAFE +// 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_Conf_Dummy_Component.hrh" + +TARGET core_conf_dummy_component2.dll +CAPABILITY ALL -TCB +TARGETTYPE PLUGIN +EPOCALLOWDLLDATA +UID 0x10009D8D KUidCoreDummyTestComponent2Dll +VENDORID 0x70000001 + + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN +OS_LAYER_ESTLIB_SYSTEMINCLUDE + +// Specifics to dummy component for core conf suite +USERINCLUDE ../../../../omxilcoreconftest/generic/inc +SOURCEPATH ../../../../omxilcoreconftest/generic/src +SOURCE Core_Conf_DummyTestComponent.c +SOURCE Core_Conf_TestHarness.c +SOURCE Core_Conf_Tests.c +SOURCEPATH ../../../../omxilcoreconftest/generic/src/tests +SOURCE Core_Conf_CoreInitDeinitTest.c +SOURCE Core_Conf_CompLoadUnloadTest.c +SOURCE Core_Conf_CompNameEnumTest.c +SOURCE Core_Conf_CompRolesTest.c +SOURCE Core_Conf_GetContentPipeTest.c +SOURCE Core_Conf_TunnelSetupTest.c +SOURCE Core_Conf_OSAL_Test.c +SOURCEPATH ../../../../omxilcoreconftest/src +SOURCE Core_Conf_OSAL_Interface.cpp + + +// Porting of dummy component to Symbian OS +SOURCEPATH ../src +SOURCE Core_Conf_Dummy_Component2.cpp +RESOURCE Core_Conf_Dummy_Component2.rss + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY estlib.lib +LIBRARY hal.lib +LIBRARY omxilcoreclient.lib +STATICLIBRARY omxilcomponentif.lib + +NOSTRICTDEF + +SMPSAFE diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/test_plugins/dummy_components/src/Core_Conf_Dummy_Component.hrh --- a/omxil/omxilunittest/test_plugins/dummy_components/src/Core_Conf_Dummy_Component.hrh Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/test_plugins/dummy_components/src/Core_Conf_Dummy_Component.hrh Fri May 07 16:25:23 2010 +0100 @@ -1,25 +1,25 @@ -// 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 CORE_CONF_DUMMY_COMPONENT_HRH -#define OMXILPCMRENDERER_HRH - -#define KUidCoreDummyTestComponent1Dll 0x102834CB -#define KUidCoreDummyTestComponent1 0x102834CC - -#define KUidCoreDummyTestComponent2Dll 0x102834CD -#define KUidCoreDummyTestComponent2 0x102834CE - -#endif // CORE_CONF_DUMMY_COMPONENT_HRH +// 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 CORE_CONF_DUMMY_COMPONENT_HRH +#define OMXILPCMRENDERER_HRH + +#define KUidCoreDummyTestComponent1Dll 0x102834CB +#define KUidCoreDummyTestComponent1 0x102834CC + +#define KUidCoreDummyTestComponent2Dll 0x102834CD +#define KUidCoreDummyTestComponent2 0x102834CE + +#endif // CORE_CONF_DUMMY_COMPONENT_HRH diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/test_plugins/dummy_components/src/Core_Conf_Dummy_Component1.cpp --- a/omxil/omxilunittest/test_plugins/dummy_components/src/Core_Conf_Dummy_Component1.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/test_plugins/dummy_components/src/Core_Conf_Dummy_Component1.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,28 +1,28 @@ -// Core_Conf_Dummy_Component1.cpp - -// 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 -#include "Core_Conf_Dummy_Component.hrh" - -extern "C" OMX_ERRORTYPE TestCompComponentInit(OMX_HANDLETYPE hComponent); - -OMXIL_COMPONENT_ECOM_ENTRYPOINT(KUidCoreDummyTestComponent1); - -OMX_ERRORTYPE OMX_ComponentInit(OMX_HANDLETYPE hComponent) - { - return TestCompComponentInit(hComponent); - } +// Core_Conf_Dummy_Component1.cpp + +// 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 +#include "Core_Conf_Dummy_Component.hrh" + +extern "C" OMX_ERRORTYPE TestCompComponentInit(OMX_HANDLETYPE hComponent); + +OMXIL_COMPONENT_ECOM_ENTRYPOINT(KUidCoreDummyTestComponent1); + +OMX_ERRORTYPE OMX_ComponentInit(OMX_HANDLETYPE hComponent) + { + return TestCompComponentInit(hComponent); + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/test_plugins/dummy_components/src/Core_Conf_Dummy_Component1.rss --- a/omxil/omxilunittest/test_plugins/dummy_components/src/Core_Conf_Dummy_Component1.rss Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/test_plugins/dummy_components/src/Core_Conf_Dummy_Component1.rss Fri May 07 16:25:23 2010 +0100 @@ -1,41 +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: -// - -#include -#include -#include "Core_Conf_Dummy_Component.hrh" - -RESOURCE REGISTRY_INFO theInfo - { - dll_uid = KUidCoreDummyTestComponent1Dll; - interfaces = - { - INTERFACE_INFO - { - interface_uid = KUidOmxILSymbianComponentIf; - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = KUidCoreDummyTestComponent1; - version_no = 1; - display_name = "OMX.Symbian.testcomp1"; - default_data = "Decoder,Encoder" ; - opaque_data = ""; - } - }; - } - }; - } +// 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 +#include +#include "Core_Conf_Dummy_Component.hrh" + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = KUidCoreDummyTestComponent1Dll; + interfaces = + { + INTERFACE_INFO + { + interface_uid = KUidOmxILSymbianComponentIf; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KUidCoreDummyTestComponent1; + version_no = 1; + display_name = "OMX.Symbian.testcomp1"; + default_data = "Decoder,Encoder" ; + opaque_data = ""; + } + }; + } + }; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/test_plugins/dummy_components/src/Core_Conf_Dummy_Component2.cpp --- a/omxil/omxilunittest/test_plugins/dummy_components/src/Core_Conf_Dummy_Component2.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/test_plugins/dummy_components/src/Core_Conf_Dummy_Component2.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,28 +1,28 @@ -// Core_Conf_Dummy_Component2.cpp - -// 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 -#include "Core_Conf_Dummy_Component.hrh" - -extern "C" OMX_ERRORTYPE TestCompComponentInit(OMX_HANDLETYPE hComponent); - -OMXIL_COMPONENT_ECOM_ENTRYPOINT(KUidCoreDummyTestComponent2); - -OMX_ERRORTYPE OMX_ComponentInit(OMX_HANDLETYPE hComponent) - { - return TestCompComponentInit(hComponent); - } +// Core_Conf_Dummy_Component2.cpp + +// 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 +#include "Core_Conf_Dummy_Component.hrh" + +extern "C" OMX_ERRORTYPE TestCompComponentInit(OMX_HANDLETYPE hComponent); + +OMXIL_COMPONENT_ECOM_ENTRYPOINT(KUidCoreDummyTestComponent2); + +OMX_ERRORTYPE OMX_ComponentInit(OMX_HANDLETYPE hComponent) + { + return TestCompComponentInit(hComponent); + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/test_plugins/dummy_components/src/Core_Conf_Dummy_Component2.rss --- a/omxil/omxilunittest/test_plugins/dummy_components/src/Core_Conf_Dummy_Component2.rss Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/test_plugins/dummy_components/src/Core_Conf_Dummy_Component2.rss Fri May 07 16:25:23 2010 +0100 @@ -1,41 +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: -// - -#include -#include "Core_Conf_Dummy_Component.hrh" -#include "../../dummy_loader/src/omxildummyloader.hrh" - -RESOURCE REGISTRY_INFO theInfo - { - dll_uid = KUidCoreDummyTestComponent2Dll; - interfaces = - { - INTERFACE_INFO - { - interface_uid = KUidOmxILDummyComponentIf; - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = KUidCoreDummyTestComponent2; - version_no = 1; - display_name = "OMX.Symbian.testcomp2"; - default_data = "Encoder,Decoder" ; - opaque_data = ""; - } - }; - } - }; - } +// 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 +#include "Core_Conf_Dummy_Component.hrh" +#include "../../dummy_loader/src/omxildummyloader.hrh" + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = KUidCoreDummyTestComponent2Dll; + interfaces = + { + INTERFACE_INFO + { + interface_uid = KUidOmxILDummyComponentIf; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KUidCoreDummyTestComponent2; + version_no = 1; + display_name = "OMX.Symbian.testcomp2"; + default_data = "Encoder,Decoder" ; + opaque_data = ""; + } + }; + } + }; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/test_plugins/dummy_cp/group/bld.inf --- a/omxil/omxilunittest/test_plugins/dummy_cp/group/bld.inf Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/test_plugins/dummy_cp/group/bld.inf Fri May 07 16:25:23 2010 +0100 @@ -1,22 +1,22 @@ -// 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: -// - -// Dummy Content Pipe Implementation using the class inheritance approach -PRJ_MMPFILES -../mmpfiles/omxildummycontentpipe.mmp - -// Romkit include files -PRJ_EXPORTS +// 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: +// + +// Dummy Content Pipe Implementation using the class inheritance approach +PRJ_MMPFILES +../mmpfiles/omxildummycontentpipe.mmp + +// Romkit include files +PRJ_EXPORTS omxildummycontentpipe.iby /epoc32/rom/include/omxildummycontentpipe.iby \ No newline at end of file diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/test_plugins/dummy_cp/group/omxildummycontentpipe.iby --- a/omxil/omxilunittest/test_plugins/dummy_cp/group/omxildummycontentpipe.iby Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/test_plugins/dummy_cp/group/omxildummycontentpipe.iby Fri May 07 16:25:23 2010 +0100 @@ -1,25 +1,25 @@ -// -// omxildummycontentpipe.iby - -// 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 OMXILDUMMYCONTENTPIPE_IBY -#define OMXILDUMMYCONTENTPIPE_IBY - -// OMX IL Dummy Content Pipe -ECOM_PLUGIN(omxildummycontentpipe.dll, omxildummycontentpipe.rsc) - +// +// omxildummycontentpipe.iby + +// 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 OMXILDUMMYCONTENTPIPE_IBY +#define OMXILDUMMYCONTENTPIPE_IBY + +// OMX IL Dummy Content Pipe +ECOM_PLUGIN(omxildummycontentpipe.dll, omxildummycontentpipe.rsc) + #endif // OMXILDUMMYCONTENTPIPE_IBY \ No newline at end of file diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/test_plugins/dummy_cp/mmpfiles/omxildummycontentpipe.mmp --- a/omxil/omxilunittest/test_plugins/dummy_cp/mmpfiles/omxildummycontentpipe.mmp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/test_plugins/dummy_cp/mmpfiles/omxildummycontentpipe.mmp Fri May 07 16:25:23 2010 +0100 @@ -1,39 +1,39 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// - -#include "../src/omxildummycontentpipe.hrh" - -TARGET omxildummycontentpipe.dll -TARGETTYPE PLUGIN -CAPABILITY ALL -TCB - -UID 0x10009D8D KUidOmxILDummyContentPipeDll -VENDORID 0x70000001 - -OS_LAYER_SYSTEMINCLUDE_SYMBIAN - -USERINCLUDE ../src - -SOURCEPATH ../src -SOURCE omxildummycontentpipe.cpp - -RESOURCE omxildummycontentpipe.rss - -LIBRARY euser.lib -LIBRARY ecom.lib - -nostrictdef - -SMPSAFE +// 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/omxildummycontentpipe.hrh" + +TARGET omxildummycontentpipe.dll +TARGETTYPE PLUGIN +CAPABILITY ALL -TCB + +UID 0x10009D8D KUidOmxILDummyContentPipeDll +VENDORID 0x70000001 + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN + +USERINCLUDE ../src + +SOURCEPATH ../src +SOURCE omxildummycontentpipe.cpp + +RESOURCE omxildummycontentpipe.rss + +LIBRARY euser.lib +LIBRARY ecom.lib + +nostrictdef + +SMPSAFE diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/test_plugins/dummy_cp/src/omxildummycontentpipe.cpp --- a/omxil/omxilunittest/test_plugins/dummy_cp/src/omxildummycontentpipe.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/test_plugins/dummy_cp/src/omxildummycontentpipe.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,251 +1,251 @@ -// 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 - -#include "omxildummycontentpipe.h" -#include "omxildummycontentpipe.hrh" - -// ECOM stuff... -const TImplementationProxy ImplementationTable[] = - { - IMPLEMENTATION_PROXY_ENTRY(KUidOmxILDummyContentPipe, COmxILDummyContentPipe::NewL), - }; - -EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) - { - aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); - return ImplementationTable; - } - -COmxILDummyContentPipe* COmxILDummyContentPipe::NewL() - { - return new (ELeave) COmxILDummyContentPipe(); - } - -COmxILDummyContentPipe::COmxILDummyContentPipe() - { - // fill in handle structure - - CP_PIPETYPE::Open = &COmxILDummyContentPipe::Open; - CP_PIPETYPE::Close = &COmxILDummyContentPipe::Close; - CP_PIPETYPE::Create = &COmxILDummyContentPipe::Create; - CP_PIPETYPE::CheckAvailableBytes = &COmxILDummyContentPipe::CheckAvailableBytes; - CP_PIPETYPE::SetPosition = &COmxILDummyContentPipe::SetPosition; - CP_PIPETYPE::GetPosition = &COmxILDummyContentPipe::GetPosition; - CP_PIPETYPE::Read = &COmxILDummyContentPipe::Read; - CP_PIPETYPE::ReadBuffer = &COmxILDummyContentPipe::ReadBuffer; - CP_PIPETYPE::ReleaseReadBuffer = &COmxILDummyContentPipe::ReleaseReadBuffer; - CP_PIPETYPE::Write = &COmxILDummyContentPipe::Write; - CP_PIPETYPE::GetWriteBuffer = &COmxILDummyContentPipe::GetWriteBuffer; - CP_PIPETYPE::WriteBuffer = &COmxILDummyContentPipe::WriteBuffer; - CP_PIPETYPE::RegisterCallback = &COmxILDummyContentPipe::RegisterCallback; - } - -COmxILDummyContentPipe::~COmxILDummyContentPipe() - { - } - -TInt COmxILDummyContentPipe::GetHandle(OMX_HANDLETYPE* aContentPipe) - { - *aContentPipe = static_cast(this); - return KErrNone; - } - -CPresult COmxILDummyContentPipe::Open(CPhandle* hContent, CPstring szURI, CP_ACCESSTYPE eAccess) - { - COmxILDummyContentHandle* dummyContentHandle = reinterpret_cast(*hContent); - TInt err = COmxILDummyContentHandle::Open(dummyContentHandle, _L8(szURI), eAccess); - *hContent = dummyContentHandle; - return err; - } - -CPresult COmxILDummyContentPipe::Close(CPhandle hContent) - { - COmxILDummyContentHandle* dummyContentHandle = reinterpret_cast(hContent); - TInt err = dummyContentHandle->Close(); - delete dummyContentHandle; - return err; - } - -CPresult COmxILDummyContentPipe::Create(CPhandle* hContent, CPstring szURI) - { - COmxILDummyContentHandle* dummyContentHandle = reinterpret_cast(*hContent); - TInt err = COmxILDummyContentHandle::Create(dummyContentHandle, _L8(szURI)); - *hContent = dummyContentHandle; - return err; - } - -CPresult COmxILDummyContentPipe::CheckAvailableBytes(CPhandle hContent, CPuint nBytesRequested, CP_CHECKBYTESRESULTTYPE* eResult) - { - return reinterpret_cast(hContent)->CheckAvailableBytes(nBytesRequested, eResult); - } - -CPresult COmxILDummyContentPipe::SetPosition(CPhandle hContent, CPint nOffset, CP_ORIGINTYPE eOrigin) - { - return reinterpret_cast(hContent)->SetPosition(nOffset, eOrigin); - } - -CPresult COmxILDummyContentPipe::GetPosition(CPhandle hContent, CPuint* pPosition) - { - return reinterpret_cast(hContent)->GetPosition((TUint*)pPosition); - } - -CPresult COmxILDummyContentPipe::Read(CPhandle hContent, CPbyte* pData, CPuint nSize) - { - return reinterpret_cast(hContent)->Read((TUint8*)pData, nSize); - } - -CPresult COmxILDummyContentPipe::ReadBuffer(CPhandle hContent, CPbyte** ppBuffer, CPuint* nSize, CPbool bForbidCopy) - { - return reinterpret_cast(hContent)->ReadBuffer((TUint8**)ppBuffer, (TUint*)nSize, bForbidCopy); - } - -CPresult COmxILDummyContentPipe::ReleaseReadBuffer(CPhandle hContent, CPbyte* pBuffer) - { - return reinterpret_cast(hContent)->ReleaseReadBuffer((TUint8*)pBuffer); - } - -CPresult COmxILDummyContentPipe::Write(CPhandle hContent, CPbyte* data, CPuint nSize) - { - return reinterpret_cast(hContent)->Write((TUint8*)data, nSize); - } - -CPresult COmxILDummyContentPipe::GetWriteBuffer(CPhandle hContent, CPbyte** ppBuffer, CPuint nSize) - { - return reinterpret_cast(hContent)->GetWriteBuffer((TUint8**)ppBuffer, nSize); - } - -CPresult COmxILDummyContentPipe::WriteBuffer(CPhandle hContent, CPbyte* pBuffer, CPuint nFilledSize) - { - return reinterpret_cast(hContent)->WriteBuffer((TUint8*)pBuffer, nFilledSize); - } - -CPresult COmxILDummyContentPipe::RegisterCallback(CPhandle hContent, CPresult (*ClientCallback)(CP_EVENTTYPE eEvent, CPuint iParam)) - { - return reinterpret_cast(hContent)->RegisterCallback((TUint (*)(CP_EVENTTYPE, TUint))ClientCallback); - } - -COmxILDummyContentPipe::COmxILDummyContentHandle::COmxILDummyContentHandle() - { - } - -COmxILDummyContentPipe::COmxILDummyContentHandle::~COmxILDummyContentHandle() - { - } - -TInt COmxILDummyContentPipe::COmxILDummyContentHandle::Open(COmxILDummyContentHandle*& aHandle, const TDesC8& /*aUri*/, CP_ACCESSTYPE /*aAccess*/) - { - aHandle = new COmxILDummyContentHandle; - if (aHandle != NULL) - { - return KErrNone; - } - else - { - return KD_ENOMEM; - } - } - -TInt COmxILDummyContentPipe::COmxILDummyContentHandle::Close() - { - return KErrNone; - } - -TInt COmxILDummyContentPipe::COmxILDummyContentHandle::Create(COmxILDummyContentHandle*& aHandle, const TDesC8& /*aUri*/) - { - aHandle = new COmxILDummyContentHandle; - if (aHandle != NULL) - { - return KErrNone; - } - else - { - return KD_ENOMEM; - } - } - -TInt COmxILDummyContentPipe::COmxILDummyContentHandle::CheckAvailableBytes(TUint /*aBytesRequested*/, CP_CHECKBYTESRESULTTYPE* /*aResult*/) - { - return KD_EINVAL; - } - -TInt COmxILDummyContentPipe::COmxILDummyContentHandle::SetPosition(TInt aOffset, CP_ORIGINTYPE aOrigin) - { - switch(aOrigin) - { - case CP_OriginBegin: - { - if (aOffset < 0) - return KD_EINVAL; - iPosition = aOffset; - break; - } - - case CP_OriginCur: - case CP_OriginEnd: - { - return KD_EINVAL; - } - - default: - { - return KD_EINVAL; - } - } - - return KErrNone; - } - -TInt COmxILDummyContentPipe::COmxILDummyContentHandle::GetPosition(TUint* aPosition) - { - *aPosition = iPosition; - return KErrNone; - } - -TInt COmxILDummyContentPipe::COmxILDummyContentHandle::Read(TUint8* /*aData*/, TUint /*aSize*/) - { - return KD_EINVAL; - } - -TInt COmxILDummyContentPipe::COmxILDummyContentHandle::ReadBuffer(TUint8** /*aBuffer*/, TUint* /*aSize*/, TBool /*aForbidCopy*/) - { - return KD_EINVAL; - } - -TInt COmxILDummyContentPipe::COmxILDummyContentHandle::ReleaseReadBuffer(TUint8* /*aBuffer*/) - { - return KD_EINVAL; - } - -TInt COmxILDummyContentPipe::COmxILDummyContentHandle::Write(TUint8* /*aData*/, TUint /*aSize*/) - { - return KD_EINVAL; - } - -TInt COmxILDummyContentPipe::COmxILDummyContentHandle::GetWriteBuffer(TUint8** /*aBuffer*/, TUint /*aSize*/) - { - return KD_EINVAL; - } - -TInt COmxILDummyContentPipe::COmxILDummyContentHandle::WriteBuffer(TUint8* /*aBuffer*/, TUint /*aFilledSize*/) - { - return KD_EINVAL; - } - -TInt COmxILDummyContentPipe::COmxILDummyContentHandle::RegisterCallback(TUint (* /*ClientCallback*/)(CP_EVENTTYPE aEvent, TUint aParam)) - { - return KD_EINVAL; - } +// 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 + +#include "omxildummycontentpipe.h" +#include "omxildummycontentpipe.hrh" + +// ECOM stuff... +const TImplementationProxy ImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY(KUidOmxILDummyContentPipe, COmxILDummyContentPipe::NewL), + }; + +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) + { + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + return ImplementationTable; + } + +COmxILDummyContentPipe* COmxILDummyContentPipe::NewL() + { + return new (ELeave) COmxILDummyContentPipe(); + } + +COmxILDummyContentPipe::COmxILDummyContentPipe() + { + // fill in handle structure + + CP_PIPETYPE::Open = &COmxILDummyContentPipe::Open; + CP_PIPETYPE::Close = &COmxILDummyContentPipe::Close; + CP_PIPETYPE::Create = &COmxILDummyContentPipe::Create; + CP_PIPETYPE::CheckAvailableBytes = &COmxILDummyContentPipe::CheckAvailableBytes; + CP_PIPETYPE::SetPosition = &COmxILDummyContentPipe::SetPosition; + CP_PIPETYPE::GetPosition = &COmxILDummyContentPipe::GetPosition; + CP_PIPETYPE::Read = &COmxILDummyContentPipe::Read; + CP_PIPETYPE::ReadBuffer = &COmxILDummyContentPipe::ReadBuffer; + CP_PIPETYPE::ReleaseReadBuffer = &COmxILDummyContentPipe::ReleaseReadBuffer; + CP_PIPETYPE::Write = &COmxILDummyContentPipe::Write; + CP_PIPETYPE::GetWriteBuffer = &COmxILDummyContentPipe::GetWriteBuffer; + CP_PIPETYPE::WriteBuffer = &COmxILDummyContentPipe::WriteBuffer; + CP_PIPETYPE::RegisterCallback = &COmxILDummyContentPipe::RegisterCallback; + } + +COmxILDummyContentPipe::~COmxILDummyContentPipe() + { + } + +TInt COmxILDummyContentPipe::GetHandle(OMX_HANDLETYPE* aContentPipe) + { + *aContentPipe = static_cast(this); + return KErrNone; + } + +CPresult COmxILDummyContentPipe::Open(CPhandle* hContent, CPstring szURI, CP_ACCESSTYPE eAccess) + { + COmxILDummyContentHandle* dummyContentHandle = reinterpret_cast(*hContent); + TInt err = COmxILDummyContentHandle::Open(dummyContentHandle, _L8(szURI), eAccess); + *hContent = dummyContentHandle; + return err; + } + +CPresult COmxILDummyContentPipe::Close(CPhandle hContent) + { + COmxILDummyContentHandle* dummyContentHandle = reinterpret_cast(hContent); + TInt err = dummyContentHandle->Close(); + delete dummyContentHandle; + return err; + } + +CPresult COmxILDummyContentPipe::Create(CPhandle* hContent, CPstring szURI) + { + COmxILDummyContentHandle* dummyContentHandle = reinterpret_cast(*hContent); + TInt err = COmxILDummyContentHandle::Create(dummyContentHandle, _L8(szURI)); + *hContent = dummyContentHandle; + return err; + } + +CPresult COmxILDummyContentPipe::CheckAvailableBytes(CPhandle hContent, CPuint nBytesRequested, CP_CHECKBYTESRESULTTYPE* eResult) + { + return reinterpret_cast(hContent)->CheckAvailableBytes(nBytesRequested, eResult); + } + +CPresult COmxILDummyContentPipe::SetPosition(CPhandle hContent, CPint nOffset, CP_ORIGINTYPE eOrigin) + { + return reinterpret_cast(hContent)->SetPosition(nOffset, eOrigin); + } + +CPresult COmxILDummyContentPipe::GetPosition(CPhandle hContent, CPuint* pPosition) + { + return reinterpret_cast(hContent)->GetPosition((TUint*)pPosition); + } + +CPresult COmxILDummyContentPipe::Read(CPhandle hContent, CPbyte* pData, CPuint nSize) + { + return reinterpret_cast(hContent)->Read((TUint8*)pData, nSize); + } + +CPresult COmxILDummyContentPipe::ReadBuffer(CPhandle hContent, CPbyte** ppBuffer, CPuint* nSize, CPbool bForbidCopy) + { + return reinterpret_cast(hContent)->ReadBuffer((TUint8**)ppBuffer, (TUint*)nSize, bForbidCopy); + } + +CPresult COmxILDummyContentPipe::ReleaseReadBuffer(CPhandle hContent, CPbyte* pBuffer) + { + return reinterpret_cast(hContent)->ReleaseReadBuffer((TUint8*)pBuffer); + } + +CPresult COmxILDummyContentPipe::Write(CPhandle hContent, CPbyte* data, CPuint nSize) + { + return reinterpret_cast(hContent)->Write((TUint8*)data, nSize); + } + +CPresult COmxILDummyContentPipe::GetWriteBuffer(CPhandle hContent, CPbyte** ppBuffer, CPuint nSize) + { + return reinterpret_cast(hContent)->GetWriteBuffer((TUint8**)ppBuffer, nSize); + } + +CPresult COmxILDummyContentPipe::WriteBuffer(CPhandle hContent, CPbyte* pBuffer, CPuint nFilledSize) + { + return reinterpret_cast(hContent)->WriteBuffer((TUint8*)pBuffer, nFilledSize); + } + +CPresult COmxILDummyContentPipe::RegisterCallback(CPhandle hContent, CPresult (*ClientCallback)(CP_EVENTTYPE eEvent, CPuint iParam)) + { + return reinterpret_cast(hContent)->RegisterCallback((TUint (*)(CP_EVENTTYPE, TUint))ClientCallback); + } + +COmxILDummyContentPipe::COmxILDummyContentHandle::COmxILDummyContentHandle() + { + } + +COmxILDummyContentPipe::COmxILDummyContentHandle::~COmxILDummyContentHandle() + { + } + +TInt COmxILDummyContentPipe::COmxILDummyContentHandle::Open(COmxILDummyContentHandle*& aHandle, const TDesC8& /*aUri*/, CP_ACCESSTYPE /*aAccess*/) + { + aHandle = new COmxILDummyContentHandle; + if (aHandle != NULL) + { + return KErrNone; + } + else + { + return KD_ENOMEM; + } + } + +TInt COmxILDummyContentPipe::COmxILDummyContentHandle::Close() + { + return KErrNone; + } + +TInt COmxILDummyContentPipe::COmxILDummyContentHandle::Create(COmxILDummyContentHandle*& aHandle, const TDesC8& /*aUri*/) + { + aHandle = new COmxILDummyContentHandle; + if (aHandle != NULL) + { + return KErrNone; + } + else + { + return KD_ENOMEM; + } + } + +TInt COmxILDummyContentPipe::COmxILDummyContentHandle::CheckAvailableBytes(TUint /*aBytesRequested*/, CP_CHECKBYTESRESULTTYPE* /*aResult*/) + { + return KD_EINVAL; + } + +TInt COmxILDummyContentPipe::COmxILDummyContentHandle::SetPosition(TInt aOffset, CP_ORIGINTYPE aOrigin) + { + switch(aOrigin) + { + case CP_OriginBegin: + { + if (aOffset < 0) + return KD_EINVAL; + iPosition = aOffset; + break; + } + + case CP_OriginCur: + case CP_OriginEnd: + { + return KD_EINVAL; + } + + default: + { + return KD_EINVAL; + } + } + + return KErrNone; + } + +TInt COmxILDummyContentPipe::COmxILDummyContentHandle::GetPosition(TUint* aPosition) + { + *aPosition = iPosition; + return KErrNone; + } + +TInt COmxILDummyContentPipe::COmxILDummyContentHandle::Read(TUint8* /*aData*/, TUint /*aSize*/) + { + return KD_EINVAL; + } + +TInt COmxILDummyContentPipe::COmxILDummyContentHandle::ReadBuffer(TUint8** /*aBuffer*/, TUint* /*aSize*/, TBool /*aForbidCopy*/) + { + return KD_EINVAL; + } + +TInt COmxILDummyContentPipe::COmxILDummyContentHandle::ReleaseReadBuffer(TUint8* /*aBuffer*/) + { + return KD_EINVAL; + } + +TInt COmxILDummyContentPipe::COmxILDummyContentHandle::Write(TUint8* /*aData*/, TUint /*aSize*/) + { + return KD_EINVAL; + } + +TInt COmxILDummyContentPipe::COmxILDummyContentHandle::GetWriteBuffer(TUint8** /*aBuffer*/, TUint /*aSize*/) + { + return KD_EINVAL; + } + +TInt COmxILDummyContentPipe::COmxILDummyContentHandle::WriteBuffer(TUint8* /*aBuffer*/, TUint /*aFilledSize*/) + { + return KD_EINVAL; + } + +TInt COmxILDummyContentPipe::COmxILDummyContentHandle::RegisterCallback(TUint (* /*ClientCallback*/)(CP_EVENTTYPE aEvent, TUint aParam)) + { + return KD_EINVAL; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/test_plugins/dummy_cp/src/omxildummycontentpipe.h --- a/omxil/omxilunittest/test_plugins/dummy_cp/src/omxildummycontentpipe.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/test_plugins/dummy_cp/src/omxildummycontentpipe.h Fri May 07 16:25:23 2010 +0100 @@ -1,104 +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 - @internalComponent - @prototype -*/ - -#ifndef OMXILDUMMYCONTENTPIPE_H -#define OMXILDUMMYCONTENTPIPE_H - -#include - -NONSHARABLE_CLASS(COmxILDummyContentPipe) : private COmxILContentPipeIf, private CP_PIPETYPE - { -public: - static COmxILDummyContentPipe* NewL(); - ~COmxILDummyContentPipe(); - - // from COmxILContentPipeIf - TInt GetHandle(OMX_HANDLETYPE* aContentPipe); - - static CPresult Open(CPhandle* hContent, CPstring szURI, CP_ACCESSTYPE eAccess); - - static CPresult Close(CPhandle hContent); - - static CPresult Create(CPhandle* hContent, CPstring szURI); - - static CPresult CheckAvailableBytes(CPhandle hContent, CPuint nBytesRequested, CP_CHECKBYTESRESULTTYPE* eResult); - - static CPresult SetPosition(CPhandle hContent, CPint nOffset, CP_ORIGINTYPE eOrigin); - - static CPresult GetPosition(CPhandle hContent, CPuint* pPosition); - - static CPresult Read(CPhandle hContent, CPbyte* pData, CPuint nSize); - - static CPresult ReadBuffer(CPhandle hContent, CPbyte** ppBuffer, CPuint* nSize, CPbool bForbidCopy); - - static CPresult ReleaseReadBuffer(CPhandle hContent, CPbyte* pBuffer); - - static CPresult Write(CPhandle hContent, CPbyte* data, CPuint nSize); - - static CPresult GetWriteBuffer(CPhandle hContent, CPbyte** ppBuffer, CPuint nSize); - - static CPresult WriteBuffer(CPhandle hContent, CPbyte* pBuffer, CPuint nFilledSize); - - static CPresult RegisterCallback(CPhandle hContent, CPresult (*ClientCallback)(CP_EVENTTYPE eEvent, CPuint iParam)); - -private: - COmxILDummyContentPipe(); - - class COmxILDummyContentHandle : public CBase - { - public: - static TInt Open(COmxILDummyContentHandle*& aHandle, const TDesC8& aUri, CP_ACCESSTYPE aAccess); - - TInt Close(); - - static TInt Create(COmxILDummyContentHandle*& aHandle, const TDesC8& aUri); - - TInt CheckAvailableBytes(TUint aBytesRequested, CP_CHECKBYTESRESULTTYPE* aResult); - - TInt SetPosition(TInt aOffset, CP_ORIGINTYPE aOrigin); - - TInt GetPosition(TUint* aPosition); - - TInt Read(TUint8* aData, TUint aSize); - - TInt ReadBuffer(TUint8** aBuffer, TUint* aSize, TBool aForbidCopy); - - TInt ReleaseReadBuffer(TUint8* aBuffer); - - TInt Write(TUint8* aData, TUint aSize); - - TInt GetWriteBuffer(TUint8** aBuffer, TUint aSize); - - TInt WriteBuffer(TUint8* aBuffer, TUint aFilledSize); - - TInt RegisterCallback(TUint (*ClientCallback)(CP_EVENTTYPE aEvent, TUint aParam)); - - ~COmxILDummyContentHandle(); - - private: - COmxILDummyContentHandle(); - - private: - TUint iPosition; - }; - }; - -#endif // OMXILDUMMYCONTENTPIPE_H +// 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 + @prototype +*/ + +#ifndef OMXILDUMMYCONTENTPIPE_H +#define OMXILDUMMYCONTENTPIPE_H + +#include + +NONSHARABLE_CLASS(COmxILDummyContentPipe) : private COmxILContentPipeIf, private CP_PIPETYPE + { +public: + static COmxILDummyContentPipe* NewL(); + ~COmxILDummyContentPipe(); + + // from COmxILContentPipeIf + TInt GetHandle(OMX_HANDLETYPE* aContentPipe); + + static CPresult Open(CPhandle* hContent, CPstring szURI, CP_ACCESSTYPE eAccess); + + static CPresult Close(CPhandle hContent); + + static CPresult Create(CPhandle* hContent, CPstring szURI); + + static CPresult CheckAvailableBytes(CPhandle hContent, CPuint nBytesRequested, CP_CHECKBYTESRESULTTYPE* eResult); + + static CPresult SetPosition(CPhandle hContent, CPint nOffset, CP_ORIGINTYPE eOrigin); + + static CPresult GetPosition(CPhandle hContent, CPuint* pPosition); + + static CPresult Read(CPhandle hContent, CPbyte* pData, CPuint nSize); + + static CPresult ReadBuffer(CPhandle hContent, CPbyte** ppBuffer, CPuint* nSize, CPbool bForbidCopy); + + static CPresult ReleaseReadBuffer(CPhandle hContent, CPbyte* pBuffer); + + static CPresult Write(CPhandle hContent, CPbyte* data, CPuint nSize); + + static CPresult GetWriteBuffer(CPhandle hContent, CPbyte** ppBuffer, CPuint nSize); + + static CPresult WriteBuffer(CPhandle hContent, CPbyte* pBuffer, CPuint nFilledSize); + + static CPresult RegisterCallback(CPhandle hContent, CPresult (*ClientCallback)(CP_EVENTTYPE eEvent, CPuint iParam)); + +private: + COmxILDummyContentPipe(); + + class COmxILDummyContentHandle : public CBase + { + public: + static TInt Open(COmxILDummyContentHandle*& aHandle, const TDesC8& aUri, CP_ACCESSTYPE aAccess); + + TInt Close(); + + static TInt Create(COmxILDummyContentHandle*& aHandle, const TDesC8& aUri); + + TInt CheckAvailableBytes(TUint aBytesRequested, CP_CHECKBYTESRESULTTYPE* aResult); + + TInt SetPosition(TInt aOffset, CP_ORIGINTYPE aOrigin); + + TInt GetPosition(TUint* aPosition); + + TInt Read(TUint8* aData, TUint aSize); + + TInt ReadBuffer(TUint8** aBuffer, TUint* aSize, TBool aForbidCopy); + + TInt ReleaseReadBuffer(TUint8* aBuffer); + + TInt Write(TUint8* aData, TUint aSize); + + TInt GetWriteBuffer(TUint8** aBuffer, TUint aSize); + + TInt WriteBuffer(TUint8* aBuffer, TUint aFilledSize); + + TInt RegisterCallback(TUint (*ClientCallback)(CP_EVENTTYPE aEvent, TUint aParam)); + + ~COmxILDummyContentHandle(); + + private: + COmxILDummyContentHandle(); + + private: + TUint iPosition; + }; + }; + +#endif // OMXILDUMMYCONTENTPIPE_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/test_plugins/dummy_cp/src/omxildummycontentpipe.hrh --- a/omxil/omxilunittest/test_plugins/dummy_cp/src/omxildummycontentpipe.hrh Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/test_plugins/dummy_cp/src/omxildummycontentpipe.hrh Fri May 07 16:25:23 2010 +0100 @@ -1,23 +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 OMXILDUMMYCONTENTPIPE_HRH -#define OMXILDUMMYCONTENTPIPE_HRH - -#define KUidOmxILDummyContentPipe 0x102834BB -#define KUidOmxILDummyContentPipeDll 0x102834B9 - -#endif // OMXILDUMMYCONTENTPIPE_HRH - +// 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 OMXILDUMMYCONTENTPIPE_HRH +#define OMXILDUMMYCONTENTPIPE_HRH + +#define KUidOmxILDummyContentPipe 0x102834BB +#define KUidOmxILDummyContentPipeDll 0x102834B9 + +#endif // OMXILDUMMYCONTENTPIPE_HRH + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/test_plugins/dummy_cp/src/omxildummycontentpipe.rss --- a/omxil/omxilunittest/test_plugins/dummy_cp/src/omxildummycontentpipe.rss Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/test_plugins/dummy_cp/src/omxildummycontentpipe.rss Fri May 07 16:25:23 2010 +0100 @@ -1,42 +1,42 @@ -// 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 -#include "omxildummycontentpipe.hrh" -#include - -RESOURCE REGISTRY_INFO theInfo - { - dll_uid = KUidOmxILDummyContentPipeDll; - interfaces = - { - INTERFACE_INFO - { - interface_uid = KUidOmxILContentPipeIf; - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = KUidOmxILDummyContentPipe; - version_no = 1; - display_name = "Symbian OpenMax IL Dummy Content Pipe"; // not used - default_data = "rtsp,http" ; // URI-schemes supported by content pipes, - // separated with commas - opaque_data = ""; // not used - } - }; - } - }; - } +// 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 +#include "omxildummycontentpipe.hrh" +#include + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = KUidOmxILDummyContentPipeDll; + interfaces = + { + INTERFACE_INFO + { + interface_uid = KUidOmxILContentPipeIf; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KUidOmxILDummyContentPipe; + version_no = 1; + display_name = "Symbian OpenMax IL Dummy Content Pipe"; // not used + default_data = "rtsp,http" ; // URI-schemes supported by content pipes, + // separated with commas + opaque_data = ""; // not used + } + }; + } + }; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/test_plugins/dummy_cp_2/group/bld.inf --- a/omxil/omxilunittest/test_plugins/dummy_cp_2/group/bld.inf Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/test_plugins/dummy_cp_2/group/bld.inf Fri May 07 16:25:23 2010 +0100 @@ -1,22 +1,22 @@ -// 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: -// - -// Dummy Content Pipe Implementation using the static linking approach -PRJ_MMPFILES -../mmpfiles/omxildummycontentpipe2.mmp - -// Romkit include files -PRJ_EXPORTS -omxildummycontentpipe2.iby /epoc32/rom/include/omxildummycontentpipe2.iby +// 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: +// + +// Dummy Content Pipe Implementation using the static linking approach +PRJ_MMPFILES +../mmpfiles/omxildummycontentpipe2.mmp + +// Romkit include files +PRJ_EXPORTS +omxildummycontentpipe2.iby /epoc32/rom/include/omxildummycontentpipe2.iby diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/test_plugins/dummy_cp_2/group/omxildummycontentpipe2.iby --- a/omxil/omxilunittest/test_plugins/dummy_cp_2/group/omxildummycontentpipe2.iby Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/test_plugins/dummy_cp_2/group/omxildummycontentpipe2.iby Fri May 07 16:25:23 2010 +0100 @@ -1,25 +1,25 @@ -// -// omxildummycontentpipe2.iby - -// 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 OMXILDUMMYCONTENTPIPE2_IBY -#define OMXILDUMMYCONTENTPIPE2_IBY - -// OMX IL Dummy Content Pipe 2 -ECOM_PLUGIN(omxildummycontentpipe2.dll, omxildummycontentpipe2.rsc) - +// +// omxildummycontentpipe2.iby + +// 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 OMXILDUMMYCONTENTPIPE2_IBY +#define OMXILDUMMYCONTENTPIPE2_IBY + +// OMX IL Dummy Content Pipe 2 +ECOM_PLUGIN(omxildummycontentpipe2.dll, omxildummycontentpipe2.rsc) + #endif // OMXILDUMMYCONTENTPIPE2_IBY \ No newline at end of file diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/test_plugins/dummy_cp_2/mmpfiles/omxildummycontentpipe2.mmp --- a/omxil/omxilunittest/test_plugins/dummy_cp_2/mmpfiles/omxildummycontentpipe2.mmp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/test_plugins/dummy_cp_2/mmpfiles/omxildummycontentpipe2.mmp Fri May 07 16:25:23 2010 +0100 @@ -1,40 +1,40 @@ -// 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/omxildummycontentpipe2.hrh" - -TARGET omxildummycontentpipe2.dll -TARGETTYPE PLUGIN -CAPABILITY ALL -TCB - -UID 0x10009D8D KUidOmxILDummyContentPipe2Dll -VENDORID 0x70000001 - -OS_LAYER_SYSTEMINCLUDE_SYMBIAN - -USERINCLUDE ../src - -SOURCEPATH ../src -SOURCE omxildummycontentpipe2.cpp - -RESOURCE omxildummycontentpipe2.rss - -LIBRARY euser.lib -LIBRARY ecom.lib -STATICLIBRARY omxilsymbiancontentpipeif.lib - -nostrictdef - -SMPSAFE +// 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/omxildummycontentpipe2.hrh" + +TARGET omxildummycontentpipe2.dll +TARGETTYPE PLUGIN +CAPABILITY ALL -TCB + +UID 0x10009D8D KUidOmxILDummyContentPipe2Dll +VENDORID 0x70000001 + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN + +USERINCLUDE ../src + +SOURCEPATH ../src +SOURCE omxildummycontentpipe2.cpp + +RESOURCE omxildummycontentpipe2.rss + +LIBRARY euser.lib +LIBRARY ecom.lib +STATICLIBRARY omxilsymbiancontentpipeif.lib + +nostrictdef + +SMPSAFE diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/test_plugins/dummy_cp_2/src/omxildummycontentpipe2.cpp --- a/omxil/omxilunittest/test_plugins/dummy_cp_2/src/omxildummycontentpipe2.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/test_plugins/dummy_cp_2/src/omxildummycontentpipe2.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,250 +1,250 @@ -// 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 - -#include "omxildummycontentpipe2.h" -#include "omxildummycontentpipe2.hrh" - -OMXIL_CONTENTPIPE_ECOM_ENTRYPOINT(KUidOmxILDummyContentPipe2) - -/* Content Pipe Entry Point */ -TInt ContentPipeInit(OMX_HANDLETYPE* aContentPipe) - { - TRAPD(err, *aContentPipe = COmxILDummyContentPipe2::NewL()); - return err; - } - -/* Content Pipe Exit Point */ -TInt ContentPipeDeInit(OMX_HANDLETYPE aContentPipe) - { - delete static_cast(reinterpret_cast(aContentPipe)); - return KErrNone; - } - - -COmxILDummyContentPipe2* COmxILDummyContentPipe2::NewL() - { - return new (ELeave) COmxILDummyContentPipe2(); - } - -COmxILDummyContentPipe2::COmxILDummyContentPipe2() - { - // fill in handle structure - - CP_PIPETYPE::Open = &COmxILDummyContentPipe2::Open; - CP_PIPETYPE::Close = &COmxILDummyContentPipe2::Close; - CP_PIPETYPE::Create = &COmxILDummyContentPipe2::Create; - CP_PIPETYPE::CheckAvailableBytes = &COmxILDummyContentPipe2::CheckAvailableBytes; - CP_PIPETYPE::SetPosition = &COmxILDummyContentPipe2::SetPosition; - CP_PIPETYPE::GetPosition = &COmxILDummyContentPipe2::GetPosition; - CP_PIPETYPE::Read = &COmxILDummyContentPipe2::Read; - CP_PIPETYPE::ReadBuffer = &COmxILDummyContentPipe2::ReadBuffer; - CP_PIPETYPE::ReleaseReadBuffer = &COmxILDummyContentPipe2::ReleaseReadBuffer; - CP_PIPETYPE::Write = &COmxILDummyContentPipe2::Write; - CP_PIPETYPE::GetWriteBuffer = &COmxILDummyContentPipe2::GetWriteBuffer; - CP_PIPETYPE::WriteBuffer = &COmxILDummyContentPipe2::WriteBuffer; - CP_PIPETYPE::RegisterCallback = &COmxILDummyContentPipe2::RegisterCallback; - } - -COmxILDummyContentPipe2::~COmxILDummyContentPipe2() - { - } - -CPresult COmxILDummyContentPipe2::Open(CPhandle* hContent, CPstring szURI, CP_ACCESSTYPE eAccess) - { - COmxILDummyContentHandle* dummyContentHandle = reinterpret_cast(*hContent); - TInt err = COmxILDummyContentHandle::Open(dummyContentHandle, _L8(szURI), eAccess); - *hContent = dummyContentHandle; - return err; - } - -CPresult COmxILDummyContentPipe2::Close(CPhandle hContent) - { - COmxILDummyContentHandle* dummyContentHandle = reinterpret_cast(hContent); - TInt err = dummyContentHandle->Close(); - delete dummyContentHandle; - return err; - } - -CPresult COmxILDummyContentPipe2::Create(CPhandle* hContent, CPstring szURI) - { - COmxILDummyContentHandle* dummyContentHandle = reinterpret_cast(*hContent); - TInt err = COmxILDummyContentHandle::Create(dummyContentHandle, _L8(szURI)); - *hContent = dummyContentHandle; - return err; - } - -CPresult COmxILDummyContentPipe2::CheckAvailableBytes(CPhandle hContent, CPuint nBytesRequested, CP_CHECKBYTESRESULTTYPE* eResult) - { - return reinterpret_cast(hContent)->CheckAvailableBytes(nBytesRequested, eResult); - } - -CPresult COmxILDummyContentPipe2::SetPosition(CPhandle hContent, CPint nOffset, CP_ORIGINTYPE eOrigin) - { - return reinterpret_cast(hContent)->SetPosition(nOffset, eOrigin); - } - -CPresult COmxILDummyContentPipe2::GetPosition(CPhandle hContent, CPuint* pPosition) - { - return reinterpret_cast(hContent)->GetPosition((TUint*)pPosition); - } - -CPresult COmxILDummyContentPipe2::Read(CPhandle hContent, CPbyte* pData, CPuint nSize) - { - return reinterpret_cast(hContent)->Read((TUint8*)pData, nSize); - } - -CPresult COmxILDummyContentPipe2::ReadBuffer(CPhandle hContent, CPbyte** ppBuffer, CPuint* nSize, CPbool bForbidCopy) - { - return reinterpret_cast(hContent)->ReadBuffer((TUint8**)ppBuffer, (TUint*)nSize, bForbidCopy); - } - -CPresult COmxILDummyContentPipe2::ReleaseReadBuffer(CPhandle hContent, CPbyte* pBuffer) - { - return reinterpret_cast(hContent)->ReleaseReadBuffer((TUint8*)pBuffer); - } - -CPresult COmxILDummyContentPipe2::Write(CPhandle hContent, CPbyte* data, CPuint nSize) - { - return reinterpret_cast(hContent)->Write((TUint8*)data, nSize); - } - -CPresult COmxILDummyContentPipe2::GetWriteBuffer(CPhandle hContent, CPbyte** ppBuffer, CPuint nSize) - { - return reinterpret_cast(hContent)->GetWriteBuffer((TUint8**)ppBuffer, nSize); - } - -CPresult COmxILDummyContentPipe2::WriteBuffer(CPhandle hContent, CPbyte* pBuffer, CPuint nFilledSize) - { - return reinterpret_cast(hContent)->WriteBuffer((TUint8*)pBuffer, nFilledSize); - } - -CPresult COmxILDummyContentPipe2::RegisterCallback(CPhandle hContent, CPresult (*ClientCallback)(CP_EVENTTYPE eEvent, CPuint iParam)) - { - return reinterpret_cast(hContent)->RegisterCallback((TUint (*)(CP_EVENTTYPE, TUint))ClientCallback); - } - -COmxILDummyContentPipe2::COmxILDummyContentHandle::COmxILDummyContentHandle() - { - } - -COmxILDummyContentPipe2::COmxILDummyContentHandle::~COmxILDummyContentHandle() - { - } - -TInt COmxILDummyContentPipe2::COmxILDummyContentHandle::Open(COmxILDummyContentHandle*& aHandle, const TDesC8& /*aUri*/, CP_ACCESSTYPE /*aAccess*/) - { - aHandle = new COmxILDummyContentHandle; - if (aHandle != NULL) - { - return KErrNone; - } - else - { - return KD_ENOMEM; - } - } - -TInt COmxILDummyContentPipe2::COmxILDummyContentHandle::Close() - { - return KErrNone; - } - -TInt COmxILDummyContentPipe2::COmxILDummyContentHandle::Create(COmxILDummyContentHandle*& aHandle, const TDesC8& /*aUri*/) - { - aHandle = new COmxILDummyContentHandle; - if (aHandle != NULL) - { - return KErrNone; - } - else - { - return KD_ENOMEM; - } - } - -TInt COmxILDummyContentPipe2::COmxILDummyContentHandle::CheckAvailableBytes(TUint /*aBytesRequested*/, CP_CHECKBYTESRESULTTYPE* /*aResult*/) - { - return KD_EINVAL; - } - -TInt COmxILDummyContentPipe2::COmxILDummyContentHandle::SetPosition(TInt aOffset, CP_ORIGINTYPE aOrigin) - { - switch(aOrigin) - { - case CP_OriginBegin: - { - if (aOffset < 0) - return KD_EINVAL; - iPosition = aOffset; - break; - } - - case CP_OriginCur: - case CP_OriginEnd: - { - return KD_EINVAL; - } - - default: - { - return KD_EINVAL; - } - } - - return KErrNone; - } - -TInt COmxILDummyContentPipe2::COmxILDummyContentHandle::GetPosition(TUint* aPosition) - { - *aPosition = iPosition; - return KErrNone; - } - -TInt COmxILDummyContentPipe2::COmxILDummyContentHandle::Read(TUint8* /*aData*/, TUint /*aSize*/) - { - return KD_EINVAL; - } - -TInt COmxILDummyContentPipe2::COmxILDummyContentHandle::ReadBuffer(TUint8** /*aBuffer*/, TUint* /*aSize*/, TBool /*aForbidCopy*/) - { - return KD_EINVAL; - } - -TInt COmxILDummyContentPipe2::COmxILDummyContentHandle::ReleaseReadBuffer(TUint8* /*aBuffer*/) - { - return KD_EINVAL; - } - -TInt COmxILDummyContentPipe2::COmxILDummyContentHandle::Write(TUint8* /*aData*/, TUint /*aSize*/) - { - return KD_EINVAL; - } - -TInt COmxILDummyContentPipe2::COmxILDummyContentHandle::GetWriteBuffer(TUint8** /*aBuffer*/, TUint /*aSize*/) - { - return KD_EINVAL; - } - -TInt COmxILDummyContentPipe2::COmxILDummyContentHandle::WriteBuffer(TUint8* /*aBuffer*/, TUint /*aFilledSize*/) - { - return KD_EINVAL; - } - -TInt COmxILDummyContentPipe2::COmxILDummyContentHandle::RegisterCallback(TUint (* /*ClientCallback*/)(CP_EVENTTYPE aEvent, TUint aParam)) - { - return KD_EINVAL; - } +// 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 + +#include "omxildummycontentpipe2.h" +#include "omxildummycontentpipe2.hrh" + +OMXIL_CONTENTPIPE_ECOM_ENTRYPOINT(KUidOmxILDummyContentPipe2) + +/* Content Pipe Entry Point */ +TInt ContentPipeInit(OMX_HANDLETYPE* aContentPipe) + { + TRAPD(err, *aContentPipe = COmxILDummyContentPipe2::NewL()); + return err; + } + +/* Content Pipe Exit Point */ +TInt ContentPipeDeInit(OMX_HANDLETYPE aContentPipe) + { + delete static_cast(reinterpret_cast(aContentPipe)); + return KErrNone; + } + + +COmxILDummyContentPipe2* COmxILDummyContentPipe2::NewL() + { + return new (ELeave) COmxILDummyContentPipe2(); + } + +COmxILDummyContentPipe2::COmxILDummyContentPipe2() + { + // fill in handle structure + + CP_PIPETYPE::Open = &COmxILDummyContentPipe2::Open; + CP_PIPETYPE::Close = &COmxILDummyContentPipe2::Close; + CP_PIPETYPE::Create = &COmxILDummyContentPipe2::Create; + CP_PIPETYPE::CheckAvailableBytes = &COmxILDummyContentPipe2::CheckAvailableBytes; + CP_PIPETYPE::SetPosition = &COmxILDummyContentPipe2::SetPosition; + CP_PIPETYPE::GetPosition = &COmxILDummyContentPipe2::GetPosition; + CP_PIPETYPE::Read = &COmxILDummyContentPipe2::Read; + CP_PIPETYPE::ReadBuffer = &COmxILDummyContentPipe2::ReadBuffer; + CP_PIPETYPE::ReleaseReadBuffer = &COmxILDummyContentPipe2::ReleaseReadBuffer; + CP_PIPETYPE::Write = &COmxILDummyContentPipe2::Write; + CP_PIPETYPE::GetWriteBuffer = &COmxILDummyContentPipe2::GetWriteBuffer; + CP_PIPETYPE::WriteBuffer = &COmxILDummyContentPipe2::WriteBuffer; + CP_PIPETYPE::RegisterCallback = &COmxILDummyContentPipe2::RegisterCallback; + } + +COmxILDummyContentPipe2::~COmxILDummyContentPipe2() + { + } + +CPresult COmxILDummyContentPipe2::Open(CPhandle* hContent, CPstring szURI, CP_ACCESSTYPE eAccess) + { + COmxILDummyContentHandle* dummyContentHandle = reinterpret_cast(*hContent); + TInt err = COmxILDummyContentHandle::Open(dummyContentHandle, _L8(szURI), eAccess); + *hContent = dummyContentHandle; + return err; + } + +CPresult COmxILDummyContentPipe2::Close(CPhandle hContent) + { + COmxILDummyContentHandle* dummyContentHandle = reinterpret_cast(hContent); + TInt err = dummyContentHandle->Close(); + delete dummyContentHandle; + return err; + } + +CPresult COmxILDummyContentPipe2::Create(CPhandle* hContent, CPstring szURI) + { + COmxILDummyContentHandle* dummyContentHandle = reinterpret_cast(*hContent); + TInt err = COmxILDummyContentHandle::Create(dummyContentHandle, _L8(szURI)); + *hContent = dummyContentHandle; + return err; + } + +CPresult COmxILDummyContentPipe2::CheckAvailableBytes(CPhandle hContent, CPuint nBytesRequested, CP_CHECKBYTESRESULTTYPE* eResult) + { + return reinterpret_cast(hContent)->CheckAvailableBytes(nBytesRequested, eResult); + } + +CPresult COmxILDummyContentPipe2::SetPosition(CPhandle hContent, CPint nOffset, CP_ORIGINTYPE eOrigin) + { + return reinterpret_cast(hContent)->SetPosition(nOffset, eOrigin); + } + +CPresult COmxILDummyContentPipe2::GetPosition(CPhandle hContent, CPuint* pPosition) + { + return reinterpret_cast(hContent)->GetPosition((TUint*)pPosition); + } + +CPresult COmxILDummyContentPipe2::Read(CPhandle hContent, CPbyte* pData, CPuint nSize) + { + return reinterpret_cast(hContent)->Read((TUint8*)pData, nSize); + } + +CPresult COmxILDummyContentPipe2::ReadBuffer(CPhandle hContent, CPbyte** ppBuffer, CPuint* nSize, CPbool bForbidCopy) + { + return reinterpret_cast(hContent)->ReadBuffer((TUint8**)ppBuffer, (TUint*)nSize, bForbidCopy); + } + +CPresult COmxILDummyContentPipe2::ReleaseReadBuffer(CPhandle hContent, CPbyte* pBuffer) + { + return reinterpret_cast(hContent)->ReleaseReadBuffer((TUint8*)pBuffer); + } + +CPresult COmxILDummyContentPipe2::Write(CPhandle hContent, CPbyte* data, CPuint nSize) + { + return reinterpret_cast(hContent)->Write((TUint8*)data, nSize); + } + +CPresult COmxILDummyContentPipe2::GetWriteBuffer(CPhandle hContent, CPbyte** ppBuffer, CPuint nSize) + { + return reinterpret_cast(hContent)->GetWriteBuffer((TUint8**)ppBuffer, nSize); + } + +CPresult COmxILDummyContentPipe2::WriteBuffer(CPhandle hContent, CPbyte* pBuffer, CPuint nFilledSize) + { + return reinterpret_cast(hContent)->WriteBuffer((TUint8*)pBuffer, nFilledSize); + } + +CPresult COmxILDummyContentPipe2::RegisterCallback(CPhandle hContent, CPresult (*ClientCallback)(CP_EVENTTYPE eEvent, CPuint iParam)) + { + return reinterpret_cast(hContent)->RegisterCallback((TUint (*)(CP_EVENTTYPE, TUint))ClientCallback); + } + +COmxILDummyContentPipe2::COmxILDummyContentHandle::COmxILDummyContentHandle() + { + } + +COmxILDummyContentPipe2::COmxILDummyContentHandle::~COmxILDummyContentHandle() + { + } + +TInt COmxILDummyContentPipe2::COmxILDummyContentHandle::Open(COmxILDummyContentHandle*& aHandle, const TDesC8& /*aUri*/, CP_ACCESSTYPE /*aAccess*/) + { + aHandle = new COmxILDummyContentHandle; + if (aHandle != NULL) + { + return KErrNone; + } + else + { + return KD_ENOMEM; + } + } + +TInt COmxILDummyContentPipe2::COmxILDummyContentHandle::Close() + { + return KErrNone; + } + +TInt COmxILDummyContentPipe2::COmxILDummyContentHandle::Create(COmxILDummyContentHandle*& aHandle, const TDesC8& /*aUri*/) + { + aHandle = new COmxILDummyContentHandle; + if (aHandle != NULL) + { + return KErrNone; + } + else + { + return KD_ENOMEM; + } + } + +TInt COmxILDummyContentPipe2::COmxILDummyContentHandle::CheckAvailableBytes(TUint /*aBytesRequested*/, CP_CHECKBYTESRESULTTYPE* /*aResult*/) + { + return KD_EINVAL; + } + +TInt COmxILDummyContentPipe2::COmxILDummyContentHandle::SetPosition(TInt aOffset, CP_ORIGINTYPE aOrigin) + { + switch(aOrigin) + { + case CP_OriginBegin: + { + if (aOffset < 0) + return KD_EINVAL; + iPosition = aOffset; + break; + } + + case CP_OriginCur: + case CP_OriginEnd: + { + return KD_EINVAL; + } + + default: + { + return KD_EINVAL; + } + } + + return KErrNone; + } + +TInt COmxILDummyContentPipe2::COmxILDummyContentHandle::GetPosition(TUint* aPosition) + { + *aPosition = iPosition; + return KErrNone; + } + +TInt COmxILDummyContentPipe2::COmxILDummyContentHandle::Read(TUint8* /*aData*/, TUint /*aSize*/) + { + return KD_EINVAL; + } + +TInt COmxILDummyContentPipe2::COmxILDummyContentHandle::ReadBuffer(TUint8** /*aBuffer*/, TUint* /*aSize*/, TBool /*aForbidCopy*/) + { + return KD_EINVAL; + } + +TInt COmxILDummyContentPipe2::COmxILDummyContentHandle::ReleaseReadBuffer(TUint8* /*aBuffer*/) + { + return KD_EINVAL; + } + +TInt COmxILDummyContentPipe2::COmxILDummyContentHandle::Write(TUint8* /*aData*/, TUint /*aSize*/) + { + return KD_EINVAL; + } + +TInt COmxILDummyContentPipe2::COmxILDummyContentHandle::GetWriteBuffer(TUint8** /*aBuffer*/, TUint /*aSize*/) + { + return KD_EINVAL; + } + +TInt COmxILDummyContentPipe2::COmxILDummyContentHandle::WriteBuffer(TUint8* /*aBuffer*/, TUint /*aFilledSize*/) + { + return KD_EINVAL; + } + +TInt COmxILDummyContentPipe2::COmxILDummyContentHandle::RegisterCallback(TUint (* /*ClientCallback*/)(CP_EVENTTYPE aEvent, TUint aParam)) + { + return KD_EINVAL; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/test_plugins/dummy_cp_2/src/omxildummycontentpipe2.h --- a/omxil/omxilunittest/test_plugins/dummy_cp_2/src/omxildummycontentpipe2.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/test_plugins/dummy_cp_2/src/omxildummycontentpipe2.h Fri May 07 16:25:23 2010 +0100 @@ -1,101 +1,101 @@ -// 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 - @prototype -*/ - -#ifndef OMXILDUMMYCONTENTPIPE2_H -#define OMXILDUMMYCONTENTPIPE2_H - -#include - -NONSHARABLE_CLASS(COmxILDummyContentPipe2) : public CP_PIPETYPE - { -public: - static COmxILDummyContentPipe2* NewL(); - ~COmxILDummyContentPipe2(); - - static CPresult Open(CPhandle* hContent, CPstring szURI, CP_ACCESSTYPE eAccess); - - static CPresult Close(CPhandle hContent); - - static CPresult Create(CPhandle* hContent, CPstring szURI); - - static CPresult CheckAvailableBytes(CPhandle hContent, CPuint nBytesRequested, CP_CHECKBYTESRESULTTYPE* eResult); - - static CPresult SetPosition(CPhandle hContent, CPint nOffset, CP_ORIGINTYPE eOrigin); - - static CPresult GetPosition(CPhandle hContent, CPuint* pPosition); - - static CPresult Read(CPhandle hContent, CPbyte* pData, CPuint nSize); - - static CPresult ReadBuffer(CPhandle hContent, CPbyte** ppBuffer, CPuint* nSize, CPbool bForbidCopy); - - static CPresult ReleaseReadBuffer(CPhandle hContent, CPbyte* pBuffer); - - static CPresult Write(CPhandle hContent, CPbyte* data, CPuint nSize); - - static CPresult GetWriteBuffer(CPhandle hContent, CPbyte** ppBuffer, CPuint nSize); - - static CPresult WriteBuffer(CPhandle hContent, CPbyte* pBuffer, CPuint nFilledSize); - - static CPresult RegisterCallback(CPhandle hContent, CPresult (*ClientCallback)(CP_EVENTTYPE eEvent, CPuint iParam)); - -private: - COmxILDummyContentPipe2(); - - class COmxILDummyContentHandle : public CBase - { - public: - static TInt Open(COmxILDummyContentHandle*& aHandle, const TDesC8& aUri, CP_ACCESSTYPE aAccess); - - TInt Close(); - - static TInt Create(COmxILDummyContentHandle*& aHandle, const TDesC8& aUri); - - TInt CheckAvailableBytes(TUint aBytesRequested, CP_CHECKBYTESRESULTTYPE* aResult); - - TInt SetPosition(TInt aOffset, CP_ORIGINTYPE aOrigin); - - TInt GetPosition(TUint* aPosition); - - TInt Read(TUint8* aData, TUint aSize); - - TInt ReadBuffer(TUint8** aBuffer, TUint* aSize, TBool aForbidCopy); - - TInt ReleaseReadBuffer(TUint8* aBuffer); - - TInt Write(TUint8* aData, TUint aSize); - - TInt GetWriteBuffer(TUint8** aBuffer, TUint aSize); - - TInt WriteBuffer(TUint8* aBuffer, TUint aFilledSize); - - TInt RegisterCallback(TUint (*ClientCallback)(CP_EVENTTYPE aEvent, TUint aParam)); - - ~COmxILDummyContentHandle(); - - private: - COmxILDummyContentHandle(); - - private: - TUint iPosition; - }; - }; - -#endif // OMXILDUMMYCONTENTPIPE2_H +// 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 + @prototype +*/ + +#ifndef OMXILDUMMYCONTENTPIPE2_H +#define OMXILDUMMYCONTENTPIPE2_H + +#include + +NONSHARABLE_CLASS(COmxILDummyContentPipe2) : public CP_PIPETYPE + { +public: + static COmxILDummyContentPipe2* NewL(); + ~COmxILDummyContentPipe2(); + + static CPresult Open(CPhandle* hContent, CPstring szURI, CP_ACCESSTYPE eAccess); + + static CPresult Close(CPhandle hContent); + + static CPresult Create(CPhandle* hContent, CPstring szURI); + + static CPresult CheckAvailableBytes(CPhandle hContent, CPuint nBytesRequested, CP_CHECKBYTESRESULTTYPE* eResult); + + static CPresult SetPosition(CPhandle hContent, CPint nOffset, CP_ORIGINTYPE eOrigin); + + static CPresult GetPosition(CPhandle hContent, CPuint* pPosition); + + static CPresult Read(CPhandle hContent, CPbyte* pData, CPuint nSize); + + static CPresult ReadBuffer(CPhandle hContent, CPbyte** ppBuffer, CPuint* nSize, CPbool bForbidCopy); + + static CPresult ReleaseReadBuffer(CPhandle hContent, CPbyte* pBuffer); + + static CPresult Write(CPhandle hContent, CPbyte* data, CPuint nSize); + + static CPresult GetWriteBuffer(CPhandle hContent, CPbyte** ppBuffer, CPuint nSize); + + static CPresult WriteBuffer(CPhandle hContent, CPbyte* pBuffer, CPuint nFilledSize); + + static CPresult RegisterCallback(CPhandle hContent, CPresult (*ClientCallback)(CP_EVENTTYPE eEvent, CPuint iParam)); + +private: + COmxILDummyContentPipe2(); + + class COmxILDummyContentHandle : public CBase + { + public: + static TInt Open(COmxILDummyContentHandle*& aHandle, const TDesC8& aUri, CP_ACCESSTYPE aAccess); + + TInt Close(); + + static TInt Create(COmxILDummyContentHandle*& aHandle, const TDesC8& aUri); + + TInt CheckAvailableBytes(TUint aBytesRequested, CP_CHECKBYTESRESULTTYPE* aResult); + + TInt SetPosition(TInt aOffset, CP_ORIGINTYPE aOrigin); + + TInt GetPosition(TUint* aPosition); + + TInt Read(TUint8* aData, TUint aSize); + + TInt ReadBuffer(TUint8** aBuffer, TUint* aSize, TBool aForbidCopy); + + TInt ReleaseReadBuffer(TUint8* aBuffer); + + TInt Write(TUint8* aData, TUint aSize); + + TInt GetWriteBuffer(TUint8** aBuffer, TUint aSize); + + TInt WriteBuffer(TUint8* aBuffer, TUint aFilledSize); + + TInt RegisterCallback(TUint (*ClientCallback)(CP_EVENTTYPE aEvent, TUint aParam)); + + ~COmxILDummyContentHandle(); + + private: + COmxILDummyContentHandle(); + + private: + TUint iPosition; + }; + }; + +#endif // OMXILDUMMYCONTENTPIPE2_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/test_plugins/dummy_cp_2/src/omxildummycontentpipe2.hrh --- a/omxil/omxilunittest/test_plugins/dummy_cp_2/src/omxildummycontentpipe2.hrh Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/test_plugins/dummy_cp_2/src/omxildummycontentpipe2.hrh Fri May 07 16:25:23 2010 +0100 @@ -1,23 +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 OMXILDUMMYCONTENTPIPE2_HRH -#define OMXILDUMMYCONTENTPIPE2_HRH - -#define KUidOmxILDummyContentPipe2 0x102834C9 -#define KUidOmxILDummyContentPipe2Dll 0x102834C8 - -#endif // OMXILDUMMYCONTENTPIPE2_HRH - +// 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 OMXILDUMMYCONTENTPIPE2_HRH +#define OMXILDUMMYCONTENTPIPE2_HRH + +#define KUidOmxILDummyContentPipe2 0x102834C9 +#define KUidOmxILDummyContentPipe2Dll 0x102834C8 + +#endif // OMXILDUMMYCONTENTPIPE2_HRH + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/test_plugins/dummy_cp_2/src/omxildummycontentpipe2.rss --- a/omxil/omxilunittest/test_plugins/dummy_cp_2/src/omxildummycontentpipe2.rss Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/test_plugins/dummy_cp_2/src/omxildummycontentpipe2.rss Fri May 07 16:25:23 2010 +0100 @@ -1,42 +1,42 @@ -// 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 -#include "omxildummycontentpipe2.hrh" -#include - -RESOURCE REGISTRY_INFO theInfo - { - dll_uid = KUidOmxILDummyContentPipe2Dll; - interfaces = - { - INTERFACE_INFO - { - interface_uid = KUidOmxILContentPipeIf; - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = KUidOmxILDummyContentPipe2; - version_no = 1; - display_name = "Symbian OpenMax IL Dummy Content Pipe"; // not used - default_data = "file" ; // URI-schemes supported by content pipes, - // separated with commas - opaque_data = ""; // not used - } - }; - } - }; - } +// 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 +#include "omxildummycontentpipe2.hrh" +#include + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = KUidOmxILDummyContentPipe2Dll; + interfaces = + { + INTERFACE_INFO + { + interface_uid = KUidOmxILContentPipeIf; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KUidOmxILDummyContentPipe2; + version_no = 1; + display_name = "Symbian OpenMax IL Dummy Content Pipe"; // not used + default_data = "file" ; // URI-schemes supported by content pipes, + // separated with commas + opaque_data = ""; // not used + } + }; + } + }; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/test_plugins/dummy_loader/group/bld.inf --- a/omxil/omxilunittest/test_plugins/dummy_loader/group/bld.inf Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/test_plugins/dummy_loader/group/bld.inf Fri May 07 16:25:23 2010 +0100 @@ -1,21 +1,21 @@ -// 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: -// - -// Dummy Loader Implementation using the static linking approach -PRJ_MMPFILES -../mmpfiles/omxildummyloader.mmp - -PRJ_EXPORTS -omxildummyloader.iby /epoc32/rom/include/omxildummyloader.iby +// 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: +// + +// Dummy Loader Implementation using the static linking approach +PRJ_MMPFILES +../mmpfiles/omxildummyloader.mmp + +PRJ_EXPORTS +omxildummyloader.iby /epoc32/rom/include/omxildummyloader.iby diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/test_plugins/dummy_loader/group/omxildummyloader.iby --- a/omxil/omxilunittest/test_plugins/dummy_loader/group/omxildummyloader.iby Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/test_plugins/dummy_loader/group/omxildummyloader.iby Fri May 07 16:25:23 2010 +0100 @@ -1,25 +1,25 @@ -// -// omxildummyloader.iby - -// 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 OMXILDUMMYLOADER_IBY -#define OMXILDUMMYLOADER_IBY - -// OMX IL Dummy Loader -ECOM_PLUGIN(omxildummyloader.dll, omxildummyloader.rsc) - +// +// omxildummyloader.iby + +// 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 OMXILDUMMYLOADER_IBY +#define OMXILDUMMYLOADER_IBY + +// OMX IL Dummy Loader +ECOM_PLUGIN(omxildummyloader.dll, omxildummyloader.rsc) + #endif // OMXILDUMMYLOADER_IBY \ No newline at end of file diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/test_plugins/dummy_loader/mmpfiles/omxildummyloader.mmp --- a/omxil/omxilunittest/test_plugins/dummy_loader/mmpfiles/omxildummyloader.mmp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/test_plugins/dummy_loader/mmpfiles/omxildummyloader.mmp Fri May 07 16:25:23 2010 +0100 @@ -1,37 +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/omxildummyloader.hrh" - -TARGET omxildummyloader.dll -TARGETTYPE PLUGIN -CAPABILITY ALL -TCB - -UID 0x10009D8D KUidOmxILDummyLoaderDll -VENDORID 0x70000001 - -OS_LAYER_SYSTEMINCLUDE_SYMBIAN -OS_LAYER_ESTLIB_SYSTEMINCLUDE - -SOURCEPATH ../src -SOURCE omxildummyloader.cpp -RESOURCE omxildummyloader.rss - -LIBRARY euser.lib -LIBRARY ecom.lib -LIBRARY libc.lib -STATICLIBRARY omxilsymbianloaderif.lib - -SMPSAFE +// 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/omxildummyloader.hrh" + +TARGET omxildummyloader.dll +TARGETTYPE PLUGIN +CAPABILITY ALL -TCB + +UID 0x10009D8D KUidOmxILDummyLoaderDll +VENDORID 0x70000001 + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN +OS_LAYER_ESTLIB_SYSTEMINCLUDE + +SOURCEPATH ../src +SOURCE omxildummyloader.cpp +RESOURCE omxildummyloader.rss + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY libc.lib +STATICLIBRARY omxilsymbianloaderif.lib + +SMPSAFE diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/test_plugins/dummy_loader/src/omxildummyloader.cpp --- a/omxil/omxilunittest/test_plugins/dummy_loader/src/omxildummyloader.cpp Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/test_plugins/dummy_loader/src/omxildummyloader.cpp Fri May 07 16:25:23 2010 +0100 @@ -1,446 +1,446 @@ -// 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 "omxildummyloader.h" -#include "omxildummyloader.hrh" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -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 ((COmxILDummyLoader*)((OMX_LOADERTYPE*)loader)->pLoaderPrivate)->InitializeComponentLoader(); - } - -OMX_ERRORTYPE OmxUnInitializeComponentLoader(OMX_LOADERTYPE *loader) - { - COmxILDummyLoader* dummyLoader = (COmxILDummyLoader*)((OMX_LOADERTYPE*)loader)->pLoaderPrivate; - OMX_ERRORTYPE error = dummyLoader->UnInitializeComponentLoader(loader); - delete dummyLoader; - dummyLoader = NULL; - return error; - } - -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 ((COmxILDummyLoader*)((OMX_LOADERTYPE*)loader)->pLoaderPrivate)->LoadComponent(pHandle,cComponentName,pAppData,pCallBacks); - } - -OMX_ERRORTYPE OmxUnloadComponent( OMX_LOADERTYPE *loader, - OMX_HANDLETYPE hComponent) - { - return ((COmxILDummyLoader*)((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 ((COmxILDummyLoader*)((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 ((COmxILDummyLoader*)((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 ((COmxILDummyLoader*)((OMX_LOADERTYPE*)loader)->pLoaderPrivate)->GetComponentsOfRole(role,pNumComps,compNames); - } - -COmxILDummyLoader::operator OMX_HANDLETYPE() - { - return (OMX_HANDLETYPE)&iHandle; - } - - -OMX_ERRORTYPE COmxILDummyLoader::InitializeComponentLoader() - { - RImplInfoPtrArray ecomArray; - TRAPD(error,REComSession::ListImplementationsL(TUid::Uid(KUidOmxILDummyComponentIf),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; indexImplementationUid(); - 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 COmxILDummyLoader::UnInitializeComponentLoader(OMX_LOADERTYPE * /*loader*/) - { - iComponentNameList.Reset(); - iComponents.ResetAndDestroy(); - return OMX_ErrorNone; - } - -OMX_ERRORTYPE COmxILDummyLoader::LoadComponent( OMX_HANDLETYPE* pHandle, - OMX_STRING cComponentName, - OMX_PTR pAppData, - OMX_CALLBACKTYPE* pCallBacks) - { - TInt index; - TPtrC8 lComponentName(reinterpret_cast(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]; - 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(*pHandle))->SetCallbacks(*pHandle, pCallBacks, pAppData); - if(error != OMX_ErrorNone) - { - (static_cast(*pHandle))->ComponentDeInit(*pHandle); - delete component; - return error; - } - if( iComponents.Append(component) != KErrNone ) - { - (static_cast(*pHandle))->ComponentDeInit(*pHandle); - delete component; - return OMX_ErrorInsufficientResources; - } - return error; - } - } - return error; - } - -OMX_ERRORTYPE COmxILDummyLoader::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(hComponent))->ComponentDeInit( hComponent ); - delete component; - iComponents.Remove(index); - return OMX_ErrorNone; - } - } - return OMX_ErrorComponentNotFound; - } - -OMX_ERRORTYPE COmxILDummyLoader::ComponentNameEnum( OMX_STRING aComponentName, - OMX_U32 aNameLength, - OMX_U32 aIndex) - { - if( !aComponentName ) - { - return OMX_ErrorBadParameter; - } - - const TInt KIndexForPopulateList = 0; - if ( aIndex == KIndexForPopulateList ) - { - RImplInfoPtrArray ecomArray; - TRAPD(error, REComSession::ListImplementationsL(TUid::Uid(KUidOmxILDummyComponentIf), 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= 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(compName), strlen(compName)); - - if( !pNumRoles || !compName ) - { - return OMX_ErrorBadParameter; - } - - 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(const_cast(iComponentNameList[index].iRoles.Ptr())), - size); - parser[size]=0; - - for( i=0, j=0, p=parser; i(role), strlen(role)); - - if( !pNumComps ) - { - return OMX_ErrorBadParameter; - } - - 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 COmxILDummyLoader::Handle() - { - return iHandle; - } - -COmxILDummyLoader::COmxILDummyLoader(OMX_HANDLETYPE hComponent) - { - iHandle = static_cast(hComponent); - - iHandle->InitializeComponentLoader = &::OmxInitializeComponentLoader; - iHandle->UnInitializeComponentLoader = &::OmxUnInitializeComponentLoader; - iHandle->LoadComponent = &::OmxLoadComponent; - iHandle->UnloadComponent = &::OmxUnloadComponent; - iHandle->ComponentNameEnum = &::OmxComponentNameEnum; - iHandle->GetRolesOfComponent = &::OmxGetRolesOfComponent; - iHandle->GetComponentsOfRole = &::OmxGetComponentsOfRole; - - iHandle->pLoaderPrivate = this; - } - -COmxILDummyLoader::~COmxILDummyLoader() - { - } - -void COmxILDummyLoader::ConstructL() - { - } - - -// ECOM -OMX_LOADER_ECOM_ENTRYPOINT(KUidOmxILDummyLoader) - -/* Content Pipe Entry Point */ -OMX_ERRORTYPE OMX_LoaderSetup(OMX_HANDLETYPE aLoader) - { - COmxILDummyLoader* self = new COmxILDummyLoader(aLoader); - if( self == NULL ) - { - return OMX_ErrorInsufficientResources; - } - return OMX_ErrorNone; - } +// 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 "omxildummyloader.h" +#include "omxildummyloader.hrh" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +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 ((COmxILDummyLoader*)((OMX_LOADERTYPE*)loader)->pLoaderPrivate)->InitializeComponentLoader(); + } + +OMX_ERRORTYPE OmxUnInitializeComponentLoader(OMX_LOADERTYPE *loader) + { + COmxILDummyLoader* dummyLoader = (COmxILDummyLoader*)((OMX_LOADERTYPE*)loader)->pLoaderPrivate; + OMX_ERRORTYPE error = dummyLoader->UnInitializeComponentLoader(loader); + delete dummyLoader; + dummyLoader = NULL; + return error; + } + +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 ((COmxILDummyLoader*)((OMX_LOADERTYPE*)loader)->pLoaderPrivate)->LoadComponent(pHandle,cComponentName,pAppData,pCallBacks); + } + +OMX_ERRORTYPE OmxUnloadComponent( OMX_LOADERTYPE *loader, + OMX_HANDLETYPE hComponent) + { + return ((COmxILDummyLoader*)((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 ((COmxILDummyLoader*)((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 ((COmxILDummyLoader*)((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 ((COmxILDummyLoader*)((OMX_LOADERTYPE*)loader)->pLoaderPrivate)->GetComponentsOfRole(role,pNumComps,compNames); + } + +COmxILDummyLoader::operator OMX_HANDLETYPE() + { + return (OMX_HANDLETYPE)&iHandle; + } + + +OMX_ERRORTYPE COmxILDummyLoader::InitializeComponentLoader() + { + RImplInfoPtrArray ecomArray; + TRAPD(error,REComSession::ListImplementationsL(TUid::Uid(KUidOmxILDummyComponentIf),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; indexImplementationUid(); + 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 COmxILDummyLoader::UnInitializeComponentLoader(OMX_LOADERTYPE * /*loader*/) + { + iComponentNameList.Reset(); + iComponents.ResetAndDestroy(); + return OMX_ErrorNone; + } + +OMX_ERRORTYPE COmxILDummyLoader::LoadComponent( OMX_HANDLETYPE* pHandle, + OMX_STRING cComponentName, + OMX_PTR pAppData, + OMX_CALLBACKTYPE* pCallBacks) + { + TInt index; + TPtrC8 lComponentName(reinterpret_cast(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]; + 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(*pHandle))->SetCallbacks(*pHandle, pCallBacks, pAppData); + if(error != OMX_ErrorNone) + { + (static_cast(*pHandle))->ComponentDeInit(*pHandle); + delete component; + return error; + } + if( iComponents.Append(component) != KErrNone ) + { + (static_cast(*pHandle))->ComponentDeInit(*pHandle); + delete component; + return OMX_ErrorInsufficientResources; + } + return error; + } + } + return error; + } + +OMX_ERRORTYPE COmxILDummyLoader::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(hComponent))->ComponentDeInit( hComponent ); + delete component; + iComponents.Remove(index); + return OMX_ErrorNone; + } + } + return OMX_ErrorComponentNotFound; + } + +OMX_ERRORTYPE COmxILDummyLoader::ComponentNameEnum( OMX_STRING aComponentName, + OMX_U32 aNameLength, + OMX_U32 aIndex) + { + if( !aComponentName ) + { + return OMX_ErrorBadParameter; + } + + const TInt KIndexForPopulateList = 0; + if ( aIndex == KIndexForPopulateList ) + { + RImplInfoPtrArray ecomArray; + TRAPD(error, REComSession::ListImplementationsL(TUid::Uid(KUidOmxILDummyComponentIf), 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= 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(compName), strlen(compName)); + + if( !pNumRoles || !compName ) + { + return OMX_ErrorBadParameter; + } + + 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(const_cast(iComponentNameList[index].iRoles.Ptr())), + size); + parser[size]=0; + + for( i=0, j=0, p=parser; i(role), strlen(role)); + + if( !pNumComps ) + { + return OMX_ErrorBadParameter; + } + + 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 COmxILDummyLoader::Handle() + { + return iHandle; + } + +COmxILDummyLoader::COmxILDummyLoader(OMX_HANDLETYPE hComponent) + { + iHandle = static_cast(hComponent); + + iHandle->InitializeComponentLoader = &::OmxInitializeComponentLoader; + iHandle->UnInitializeComponentLoader = &::OmxUnInitializeComponentLoader; + iHandle->LoadComponent = &::OmxLoadComponent; + iHandle->UnloadComponent = &::OmxUnloadComponent; + iHandle->ComponentNameEnum = &::OmxComponentNameEnum; + iHandle->GetRolesOfComponent = &::OmxGetRolesOfComponent; + iHandle->GetComponentsOfRole = &::OmxGetComponentsOfRole; + + iHandle->pLoaderPrivate = this; + } + +COmxILDummyLoader::~COmxILDummyLoader() + { + } + +void COmxILDummyLoader::ConstructL() + { + } + + +// ECOM +OMX_LOADER_ECOM_ENTRYPOINT(KUidOmxILDummyLoader) + +/* Content Pipe Entry Point */ +OMX_ERRORTYPE OMX_LoaderSetup(OMX_HANDLETYPE aLoader) + { + COmxILDummyLoader* self = new COmxILDummyLoader(aLoader); + if( self == NULL ) + { + return OMX_ErrorInsufficientResources; + } + return OMX_ErrorNone; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/test_plugins/dummy_loader/src/omxildummyloader.h --- a/omxil/omxilunittest/test_plugins/dummy_loader/src/omxildummyloader.h Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/test_plugins/dummy_loader/src/omxildummyloader.h Fri May 07 16:25:23 2010 +0100 @@ -1,84 +1,84 @@ -// 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 - @prototype -*/ - -#ifndef OMXILDUMMYLOADER_H -#define OMXILDUMMYLOADER_H - -#include -#include -#include -#include - -class COmxILDummyLoader : public CBase - { -public: - class TOmxComponentInfo - { - public: - TOmxComponentInfo(); - public: - TUid iUid; - TBuf8 iComponentName; - TBuf8 iRoles; - }; - -public: - OMX_HANDLETYPE Handle(); - - COmxILDummyLoader(OMX_HANDLETYPE aLoader); - ~COmxILDummyLoader(); - - 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 ); - - operator OMX_HANDLETYPE(); - -private: - void ConstructL(); - -private: - OMX_LOADERTYPE* iHandle; - - RArray iComponentNameList; - RPointerArray iComponents; - }; - -inline COmxILDummyLoader::TOmxComponentInfo::TOmxComponentInfo(): - iUid(TUid::Uid(0)),iComponentName(0),iRoles(0) - { - } - - -#endif // OMXILDUMMYLOADER_H +// 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 + @prototype +*/ + +#ifndef OMXILDUMMYLOADER_H +#define OMXILDUMMYLOADER_H + +#include +#include +#include +#include + +class COmxILDummyLoader : public CBase + { +public: + class TOmxComponentInfo + { + public: + TOmxComponentInfo(); + public: + TUid iUid; + TBuf8 iComponentName; + TBuf8 iRoles; + }; + +public: + OMX_HANDLETYPE Handle(); + + COmxILDummyLoader(OMX_HANDLETYPE aLoader); + ~COmxILDummyLoader(); + + 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 ); + + operator OMX_HANDLETYPE(); + +private: + void ConstructL(); + +private: + OMX_LOADERTYPE* iHandle; + + RArray iComponentNameList; + RPointerArray iComponents; + }; + +inline COmxILDummyLoader::TOmxComponentInfo::TOmxComponentInfo(): + iUid(TUid::Uid(0)),iComponentName(0),iRoles(0) + { + } + + +#endif // OMXILDUMMYLOADER_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/test_plugins/dummy_loader/src/omxildummyloader.hrh --- a/omxil/omxilunittest/test_plugins/dummy_loader/src/omxildummyloader.hrh Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/test_plugins/dummy_loader/src/omxildummyloader.hrh Fri May 07 16:25:23 2010 +0100 @@ -1,24 +1,24 @@ -// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -// All rights reserved. -// This component and the accompanying materials are made available -// under the terms of "Eclipse Public License v1.0" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// - -#ifndef OMXILDUMMYLOADER_HRH -#define OMXILDUMMYLOADER_HRH - -#define KUidOmxILDummyLoader 0x10285C05 -#define KUidOmxILDummyLoaderDll 0x10285C06 -#define KUidOmxILDummyComponentIf 0x10285CC0 - -#endif // OMXILDUMMYLOADER_HRH - +// 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 OMXILDUMMYLOADER_HRH +#define OMXILDUMMYLOADER_HRH + +#define KUidOmxILDummyLoader 0x10285C05 +#define KUidOmxILDummyLoaderDll 0x10285C06 +#define KUidOmxILDummyComponentIf 0x10285CC0 + +#endif // OMXILDUMMYLOADER_HRH + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/omxilunittest/test_plugins/dummy_loader/src/omxildummyloader.rss --- a/omxil/omxilunittest/test_plugins/dummy_loader/src/omxildummyloader.rss Mon May 03 13:56:28 2010 +0300 +++ b/omxil/omxilunittest/test_plugins/dummy_loader/src/omxildummyloader.rss Fri May 07 16:25:23 2010 +0100 @@ -1,41 +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: -// - -#include -#include "omxildummyloader.hrh" -#include - -RESOURCE REGISTRY_INFO theInfo - { - dll_uid = KUidOmxILDummyLoaderDll; - interfaces = - { - INTERFACE_INFO - { - interface_uid = KUidOmxILLoaderInterface; - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = KUidOmxILDummyLoader; - version_no = 1; - display_name = ""; // not used - default_data = "" ; // URI-schemes supported by content pipes, - opaque_data = ""; // not used - } - }; - } - }; - } +// 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 +#include "omxildummyloader.hrh" +#include + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = KUidOmxILDummyLoaderDll; + interfaces = + { + INTERFACE_INFO + { + interface_uid = KUidOmxILLoaderInterface; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KUidOmxILDummyLoader; + version_no = 1; + display_name = ""; // not used + default_data = "" ; // URI-schemes supported by content pipes, + opaque_data = ""; // not used + } + }; + } + }; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/openmax/il/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/openmax/il/group/bld.inf Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,26 @@ +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +#include "../../../omxilapi/group/bld.inf" +#include "../../../omxilcore/group/bld.inf" +#include "../../../omxilcomponentcommon/group/bld.inf" +#include "../../../omxilrefcomps/ref_components/group/bld.inf" + +#include "../../../xmltestharness/xmlclient/group/bld.inf" +#include "../../../xmltestharness/te_xmlomxclient/group/bld.inf" + +#include "../../../audio/group/bld.inf" +#include "../../../video/group/bld.inf" +#include "../../../generic/group/bld.inf" diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/group/bld.inf Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,24 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include "../omxilgraphicsink/group/bld.inf" +#include "../omxilvideoscheduler2/group/bld.inf" +#include "../omxilclock/group/bld.inf" + +PRJ_EXPORTS +./videoomxilcompref.iby /epoc32/rom/include/videoomxilcompref.iby diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/group/videoomxilcompref.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/group/videoomxilcompref.iby Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,27 @@ +/* +* 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 VIDEOMXILCOMPREF_IBY +#define VIDEOMXILCOMPREF_IBY + +#ifdef SYMBIAN_GRAPHICS_USE_GCE +ECOM_PLUGIN(omxilgraphicsink.dll, omxilgraphicsink.rsc) +#endif +#include + +#endif // VIDEOMXILCOMPREF_IBY diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilclock/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilclock/group/bld.inf Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,25 @@ +/* +* 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: +* +*/ + +PRJ_PLATFORMS +BASEDEFAULT + +PRJ_EXPORTS +../group/omxilclock.iby /epoc32/rom/include/omxilclock.iby + +PRJ_MMPFILES +omxilclock.mmp diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilclock/group/omxilclock.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilclock/group/omxilclock.iby Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,24 @@ +/* +* 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 OMXILCLOCK_IBY_ +#define OMXILCLOCK_IBY_ + +ECOM_PLUGIN(omxilclock.dll, omxilclock.rsc) + +#endif /*OMXILCLOCK_IBY_*/ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilclock/group/omxilclock.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilclock/group/omxilclock.mmp Fri May 07 16:25:23 2010 +0100 @@ -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: +* +*/ + +#include "../inc/omxilclock.hrh" + +TARGET omxilclock.dll +TARGETTYPE PLUGIN +UID 0x10009D8D KUidSymbianOmxILClockDll +CAPABILITY All -TCB + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN +USERINCLUDE ../../../omxilcomponentcommon/src/common +USERINCLUDE ../../../omxilcore/traces + +USERINCLUDE ../inc + +SOURCEPATH ../src + +SOURCE clocksupervisor.cpp +SOURCE comxilclockcomponent.cpp +SOURCE comxilclockconfigmanager.cpp +SOURCE comxilclockoutputport.cpp +SOURCE comxilclockprocessingfunction.cpp +SOURCE clockpanics.cpp +SOURCE clockthreadnotifier.cpp + +START RESOURCE omxilclock.rss +TARGET omxilclock.rsc +END + +LIBRARY euser.lib efsrv.lib ecom.lib +LIBRARY hal.lib +LIBRARY omxilcomponentcommon.lib +STATICLIBRARY omxilcomponentif.lib + +//MACRO _OMXIL_COMMON_DEBUG_TRACING_ON diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilclock/inc/clockpanics.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilclock/inc/clockpanics.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,48 @@ +/* +* 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 CLOCKPANICS_H_ +#define CLOCKPANICS_H_ + +enum TClockPanicCode + { + EBufferUnderflow = 0, // ran out of buffers with which to issue notifications + /*ERequestOverflow = 1, // NO LONGER USED. previously, too many media time requests to add to pending queue*/ + EBadAlignment = 2, // unexpected pointer alignment + EMutexUnheld = 3, // the mutex was expected to be held but it was not + ERequestQueueCorrupt = 4, // request queue structure in an inconsistent state + ERequestQueueUnordered = 5, // request queue trigger times not in ascending order + EBufferQueueOverflow = 6, // error adding buffer to queue. this shouldn't happen + // as queue is preallocated with total buffer count + ECompatibilityCheckOnOutput = 7, // IsTunnelledPortCompatible() was called on output port which shouldn't happen + EBufferFlushingInvalidPort = 8, // Invalid port index passed to BufferFlushingIndication() routine + ECallbackManagerBufferError = 9, // The callback manager returned an error during BufferDoneNotification, + // this is not expected since the callee component should handle an error internally + ECallbackManagerEventError = 10, // The callback manager returned an error during EventNotification, + // this is not expected since the client should handle an error internally + + EUndefinedErrorCode = 1000 // received an error code that isn't translated (debug builds only) + }; + +void Panic(TClockPanicCode aCode); + +#endif /*CLOCKPANICS_H_*/ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilclock/inc/clocksupervisor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilclock/inc/clocksupervisor.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,438 @@ +/* +* 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 CLOCKSUPERVISOR_H_ +#define CLOCKSUPERVISOR_H_ + +#include +#include + +/** + @file + @internalComponent + */ + +// forward declaration as supervisor calls back to processing function +class COmxILClockProcessingFunction; + +/////////////////////////////////////////////////////////////////////////////// +// List of structures declared in this file: +// +// TMediaRequest +// TEntryPoint +// TIndexToFunctionMapping +// CClockSupervisor +// +/////////////////////////////////////////////////////////////////////////////// +// Storage of Clock requests. +// +// The Media Update storage holds a number of request updates to send to +// clients. +// The updates are entered in a queue based on the delta of the +// 'expected MediaTime minus Offset' giving an absolute time (the delta). +// This difference is then calculated by the queue implementation on insertion +// of the element. +// +// When the clock changes state it notifies the clients by sending them a state +// change notification broadcast. +// The important thing to note here is that there is no seperate queue for +// outgoing notifications. +// As soon as a request timer expires that request is forwarded. +// Broadcast requests are raised and placed first on the queue so are sent +// as and when they occur. +// +// When the scale is a change of direction (i.e. playing in the backwards +// direction), the queue is cleared and the delta's absolute value is taken. +// +// The delta is a TInt which matches the Ticks datatype returned by the system. +// +// We do not expect the phone to be in operation beyond the maximum duration +// held by the 64-bit Wall clock. Behaviour beyond this is undefined. +// +// The reason for choosing a list over an array is mainly access efficiency. +// +// 1) The insertions must be in order so as to be pulled off quickly. +// Updates are pulled off from the front of the queue, so you would have +// to adjust the whole array each time. +// 2) Updates arrive at different times and can expect to be fulfilled prior +// to earlier updates, again the list would need to be adjusted after the +// point of insertion. +// +// Clients are attached via ports and the notifications are sent to them via +// these ports +// +/////////////////////////////////////////////////////////////////////////////// +// Clock functionality is invoked both externally & internally. +// +// Based on the OMX IL 1.1.1 standard, we route these incoming external +// requests to their relevant behaviour. +// +// This Clock component is intended to be created per use case. +// That is for every use case that requires synchronisation. +// This could result in several clocks being created, each with an audio and/or +// video as an input, and each with a high-priority clock thread. +// At most it is considered that there should only be a few of these components +// in existance at any one time, as mobile devices should not really require it. +// However, saying this, it should be factored into the design. +// At this stage it is envisioned that any clock component should reduce its +// timer events to once at just after the 32-bit wraparound when its +// application is not in focus. +// This is due to the time being reported to us in a 32-bit value, whilst our +// Wall clock is 64-bits. +// To avoid any wraparound and losing time by not regulary updating the upper +// word of our wall clock, we need to somehow check the system clock at this +// inteval. This is not a problem during normal operation but can be when the +// application is Paused or goes out of focus. +// +// NOTE: Assumes OMX_SKIP64BIT is not set when building OMX CORE +/////////////////////////////////////////////////////////////////////////////// + + +/** + * + * + */ +class TMediaRequest + { +public: + TInt64 iMediaTime; + TInt64 iOffset; + TInt64 iTriggerWallTime; // == iWallTimeAtMediaTime - iOffset + TInt iPortIndex; + TAny* iClientPrivate; + + inline void Deque(); + inline void AddBefore(TMediaRequest*); + +public: + TMediaRequest *iPrev; + TMediaRequest *iNext; + }; + +/** + * + * + */ +class TMediaTimeContext + { +public: + TMediaTimeContext(): iScaleQ16 (1 << 16), iInverseScaleQ16 (1 << 16) + {/*do nothing*/}; + + void SetScaleQ16(TInt32 aScaleQ16, TInt64 aWallTimeNow); +public: + TInt64 iWallTimeBase; + TInt64 iMediaTimeBase; + + /** + * Scale ranges map to modes of playback. + * A Q16 value relative to a 1X forward advancement of the media clock. + */ + TInt32 iScaleQ16; + + /** + * The reciprocal of iScaleQ16 (i.e. 1 / iScaleQ16), but adjusted for the + * Q16 format. + * + * It therefore has the value 2^32 / iScaleQ16. + * + * If iScaleQ16 == 0, this field takes the value KMaxTInt (2^31 - 1) + * + * If magnitude of iInverseScaleQ16 would be too large for a signed 32-bit + * value, the value is clipped to KMaxTInt or KMinTInt (-2^31 or + * (2^31 - 1)). This can only happen if iScaleQ16 == +/- 1. + */ + TInt32 iInverseScaleQ16; + }; + +/** + * + * + */ +class TRequestDeltaQue + { +public: + TRequestDeltaQue(); + + void Add(TMediaRequest* aElement, TInt64 aDelta); + TMediaRequest* RemoveFirst(); + TBool FirstDelta(TInt64& aDelta) const; + void RecalculateAndReorder(TMediaTimeContext& aMTC); + TBool IsEmpty() const; + TUint Count() const; + +private: + TBool InsertBeforeFoundPosition(TInt64 aDelta, TMediaRequest*& aItem) const; + +#ifdef _DEBUG + void DbgCheck() const; +#endif +#ifdef _OMXIL_COMMON_DEBUG_TRACING_ON + void DbgPrint() const; +#endif + +private: + TMediaRequest* iHead; + TInt iCount; + }; + + +/** + * + * + */ +class CClockSupervisor : public CBase + { +public: +#ifdef STABILITY_TEST_WRAPPER + friend class CStabilityTestWrapper; + friend class CStabilityTestNegativeWrapper; +#endif +friend class CClockThreadNotifier; +public: + static CClockSupervisor* NewL(COmxILClockProcessingFunction& aCallbacks); + ~CClockSupervisor(); + + /** + * Defines how a request arrived at the clock component + */ + enum TEntryPoint + { + EGetConfig, + ESetConfig + }; + + // Producer function + // Invoked via clients of this component, i.e. GetConfig() and SetConfig() + OMX_ERRORTYPE ProduceRequest(OMX_INDEXTYPE aIndex, TEntryPoint aEntryPoint, + TAny* aPassedStructPtr); + + const OMX_TIME_CONFIG_CLOCKSTATETYPE GetMediaClockState() const + { + return iMediaClockState; + } + +private: + CClockSupervisor(COmxILClockProcessingFunction& aProcessingFunction); + void ConstructL(); + +private: + ////////////// + // This section describes the Clock thread related functions + ////////////// + + // The timing thread's entry point + static TInt ThreadEntryPoint(TAny* aPtr); + void RunTimingThreadL(); + +private: + ////////////// + // This section describes the request handler functions + ////////////// + + // From the Audio/Video feeds + OMX_ERRORTYPE HandleUpdateAudioReference(TEntryPoint aEntry, OMX_PTR aPassedStructPtr); + OMX_ERRORTYPE HandleUpdateVideoReference(TEntryPoint aEntry, OMX_PTR aPassedStructPtr); + + // From the OMX component + OMX_ERRORTYPE HandleSetPortClientStartTime(TEntryPoint aEntry, OMX_PTR aPassedStructPtr); + OMX_ERRORTYPE HandleSubmitMediaTimeRequest(TEntryPoint aEntry, OMX_PTR aPassedStructPtr); + + // From the IL client + OMX_ERRORTYPE HandleGetSetTimeScale(TEntryPoint aEntry, OMX_PTR aPassedStructPtr); + OMX_ERRORTYPE HandleGetSetSeekMode(TEntryPoint aEntry, OMX_PTR aPassedStructPtr); + OMX_ERRORTYPE HandleGetSetClockState(TEntryPoint aEntry, OMX_PTR aPassedStructPtr); + OMX_ERRORTYPE HandleGetSetActiveRefClock(TEntryPoint aEntry, OMX_PTR aPassedStructPtr); + + // Called from either IL client or IL components + OMX_ERRORTYPE HandleQueryCurrentWallTime(TEntryPoint aEntry, OMX_PTR aPassedStructPtr); + OMX_ERRORTYPE HandleQueryCurrentMediaTime(TEntryPoint aEntry, OMX_PTR aPassedStructPtr); + +private: + ////////////// + // This section describes the Clock components internal house-keeping + // routines + ////////////// + + // Perform actions related to placing the clock into the Stopped state + void DoTransitionToStoppedState(); + + // Perform actions related to placing the clock into the Running state + void DoTransitionToRunningState(); + + // Perform actions related to placing the clock into the Waiting state + void DoTransitionToWaitingState(OMX_U32 nWaitMask); + + // Update the tick counter, generating higher 32 bits + void UpdateWallTicks(); + + // Consumer function + // Invoked at initialisation and runs in event loop. + TInt ConsumeRequests(); + + // The timer loop to enable us to wake up on heart beat or requests + void TimerLoop(); + + // obtains the most appropriate start time based on scale (direction) + void CalculateStartTime(); + + // reports whether all clients have reported their start times + TBool AllStartTimesReported(); + + TInt64 WallTime(); + + void UpdateMediaTime(TInt64 aMediaTime); + void BroadcastUpdate(const OMX_TIME_MEDIATIMETYPE& aUpdate); + + // reports error when clock thread panics + + void ReportClockThreadPanic(); + +private: + ////////////// + // This section describes the clock's miscellaneous structures + ////////////// + + /** + * State of the clock component's media clock: + */ + OMX_TIME_CONFIG_CLOCKSTATETYPE iMediaClockState; + + /** + * Choice of the clock component's reference clock: + */ + OMX_TIME_REFCLOCKTYPE iActiveRefClock; + + /** + * Array of clients' start times: + */ + RArray iStartTimes; + TUint iStartTimesSet; /* bit mask representing which elements of + the start time array are valid */ + +private: + ////////////// + // This section describes the Clock component's routing structures + ////////////// + + /* + * typedef for function to handle incoming requests + */ + typedef OMX_ERRORTYPE (CClockSupervisor::*FunctionPtr)(TEntryPoint, OMX_PTR); + + /* + * Function jump table. Note that this is declared in class scope so that the table + * definition has access to private methods. + */ + static const FunctionPtr iJumpTable[]; + +private: + ////////////// + // This section describes the Clock component's Timer Control + ////////////// + + /** + * Holds the current Wall Clock. The duration of a 'tick' is platform specific. + * This needs to be 4-byte aligned to allow for atomic access. + */ + OMX_TICKS iWallTicks; + + /** + * Encapsulates the relationship between wall time and media time. + */ + TMediaTimeContext iMtc; + + // conversion factors from wall 'ticks' to microseconds + TInt iMicroConvNum; + TInt iMicroConvDen; + TInt iMicroConvShift; + + // maximum time between calls to WallTime() - avoids 32-bit counter overflow + TInt iHeartbeatTimerInterval; + + // on some platforms User::FastCounter() counts backwards + TBool iSystemClockReversed; + +private: + ////////////// + // This section describes the Clock component's thread and other resources + ////////////// + + /** + * This Clock component object needs to run in a high priority thread as it + * represents the OMX component timings + */ + RThread iThread; + + /** + * Thread access control Mutex, + * used to control updating of the components requests by mutiple threads + */ + RMutex iQueMutex; + + /** + * Event timer to wake up this object to complete fulfillment of a request + * This handle belongs to the High-Pri thread + */ + RTimer iTimer; + + /** + * Flags to control timing thread exit/destroy. + */ + TBool iThreadStarted; + TBool iThreadRunning; + + /** + * Complete this status on the timing thread to interrupt the timer sleep. + * Timer itself can't be cancelled since timer handle is local to timing + * thread. + */ + TRequestStatus iCancelStatus; + +private: + ////////////// + // This section describes the Clock component's request management + // infrastructure + ////////////// + + /** + * Pending Media Time Requests + */ + TRequestDeltaQue iPendingRequestQue; + + /** + * The free queue header. + * Items ared remove from here and placed on the pending queue. + */ + TRequestDeltaQue iFreeRequestQue; + + /** + * memory block where request list nodes are allocated + */ + TMediaRequest* iRequestBlock; + + /** + * Max number of request list nodes allocated + */ + const TUint iMaxRequests; + + COmxILClockProcessingFunction& iProcessingFunction; + }; // class CClockSupervisor + + +#endif // CLOCKSUPERVISOR_H_ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilclock/inc/clockthreadnotifier.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilclock/inc/clockthreadnotifier.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,59 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +/** + @file + @internalComponent + */ + +#ifndef CLOCKTHREADNOTIFIER_H_ +#define CLOCKTHREADNOTIFIER_H_ + +#include "clocksupervisor.h" +#include "omxilprocessingfunction.h" + +//Clock thread observer class + +class CClockThreadNotifier : public CActive + { + public: + static CClockThreadNotifier* NewL(CClockSupervisor* aClockSupervisor); + + ~CClockThreadNotifier(); + + void ConstructL(); + void IssueRequest(); + + protected: + CClockThreadNotifier(CClockSupervisor* aClockSupervisor ); + + //from CActive + + protected: + void RunL(); + void DoCancel(); + TInt RunError(TInt aError); + + //data members + private: + CClockSupervisor* iClockSupervisor; + + }; + + + +#endif /* CLOCKTHREADNOTIFIER_H_ */ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilclock/inc/comxilclockcomponent.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilclock/inc/comxilclockcomponent.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +/** +@file +@internalComponent +*/ + +#ifndef COMXILCLOCKCOMPONENT_H +#define COMXILCLOCKCOMPONENT_H + +#include "omxilcomponent.h" + + + +class COmxILClockOutputPort; + +class COmxILClockComponent : public COmxILComponent + { +public: + static TInt CreateComponent(OMX_HANDLETYPE hComponent); + ~COmxILClockComponent(); + + TBool PortEnabled(TInt aPortIndex) const; + TInt PortBufferCount(TInt aPortIndex) const; + +private: + COmxILClockComponent(); + void ConstructL(OMX_HANDLETYPE hComponent); + +private: + void AddPortL(); + +private: + RPointerArray iPorts; + }; + +#endif //COMXILCLOCKOUTPUTPORT_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilclock/inc/comxilclockconfigmanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilclock/inc/comxilclockconfigmanager.h Fri May 07 16:25:23 2010 +0100 @@ -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: +* +*/ + + +/** +@file +@internalComponent +*/ + +#ifndef COMXILCLOCKCONFIGMANAGER_H +#define COMXILCLOCKCONFIGMANAGER_H + +#include "omxilconfigmanager.h" + + + +// Forward declarations +class COmxILClockProcessingFunction; + +class COmxILClockConfigManager : public COmxILConfigManager + { +public: + static COmxILClockConfigManager* NewL( + MOmxILPortManagerIf& aPortManager, + const TDesC8& aComponentName, + const OMX_VERSIONTYPE& aComponentVersion, + const RPointerArray& aComponentRoles, + COmxILClockProcessingFunction& aProcessingFunction); + + ~COmxILClockConfigManager(); + + // from COmxILConfigManager + OMX_ERRORTYPE GetConfig(OMX_INDEXTYPE aConfigIndex, + TAny* apComponentConfigStructure) const; + OMX_ERRORTYPE SetConfig(OMX_INDEXTYPE aConfigIndex, + const TAny* apComponentConfigStructure); + +private: + COmxILClockConfigManager(MOmxILPortManagerIf& aPortManager, + COmxILClockProcessingFunction& aProcessingFunction); + + void ConstructL(const TDesC8& aComponentName, + const OMX_VERSIONTYPE& aComponentVersion, + const RPointerArray& aComponentRoles); + +private: + COmxILClockProcessingFunction* iProcessingFunction; // not owned + }; + +#endif //COMXILCLOCKCONFIGMANAGER_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilclock/inc/comxilclockoutputport.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilclock/inc/comxilclockoutputport.h Fri May 07 16:25:23 2010 +0100 @@ -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: +* +*/ + + +/** +@file +@internalComponent +*/ + +#ifndef COMXILCLOCKOUTPUTPORT_H +#define COMXILCLOCKOUTPUTPORT_H + +#include "omxilotherport.h" + + + +class COmxILClockProcessingFunction; + +class COmxILClockOutputPort : public COmxILOtherPort + { +public: + static COmxILClockOutputPort* NewL(const TOmxILCommonPortData& aCommonPortData, const RArray& aSupportedFormats, COmxILClockProcessingFunction& aProcessingFunction); + ~COmxILClockOutputPort(); + + TInt BufferCount() const; + + // from COmxILOtherPort + OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray& aIndexArray) const; + OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray& aIndexArray) const; + OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex, + TAny* apComponentParameterStructure) const; + OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex, + const TAny* apComponentParameterStructure, + TBool& aUpdateProcessingFunction); + OMX_ERRORTYPE GetConfig(OMX_INDEXTYPE aConfigIndex, + TAny* apComponentConfigStructure) const; + OMX_ERRORTYPE SetConfig(OMX_INDEXTYPE aConfigIndex, + const TAny* apComponentConfigStructure, + TBool& aUpdateProcessingFunction); + +protected: + OMX_ERRORTYPE SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, + TBool& aUpdateProcessingFunction); + TBool IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const; + +private: + COmxILClockOutputPort(const TOmxILCommonPortData& aCommonPortData, COmxILClockProcessingFunction& aProcessingFunction); + void ConstructL(const RArray& aSupportedFormats); + +private: + COmxILClockProcessingFunction* iProcessingFunction; // not owned + }; + +#endif //COMXILCLOCKOUTPUTPORT_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilclock/inc/comxilclockprocessingfunction.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilclock/inc/comxilclockprocessingfunction.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,71 @@ +/* +* 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 COMXILCLOCKPROCESSINGFUNCTION_H +#define COMXILCLOCKPROCESSINGFUNCTION_H + +#include "omxilprocessingfunction.h" +#include "clocksupervisor.h" +#include "clockthreadnotifier.h" + +class COmxILClockComponent; + +class COmxILClockProcessingFunction : public COmxILProcessingFunction + { +public: + static COmxILClockProcessingFunction* NewL(MOmxILCallbackNotificationIf& aCallbacks, COmxILClockComponent& aComponent); + ~COmxILClockProcessingFunction(); + + OMX_ERRORTYPE ProduceRequest(OMX_INDEXTYPE aIdx, CClockSupervisor::TEntryPoint aEntryPoint, TAny* pComponentConfigStructure); + + // from COmxILProcessingFunction + OMX_ERRORTYPE StateTransitionIndication(COmxILFsm::TStateIndex aNewState); + OMX_ERRORTYPE BufferFlushingIndication(TUint32 aPortIndex, OMX_DIRTYPE aDirection); + OMX_ERRORTYPE ParamIndication(OMX_INDEXTYPE aParamIndex, const TAny* apComponentParameterStructure); + OMX_ERRORTYPE ConfigIndication(OMX_INDEXTYPE aConfigIndex, const TAny* apComponentConfigStructure); + OMX_ERRORTYPE BufferIndication(OMX_BUFFERHEADERTYPE* apBufferHeader, OMX_DIRTYPE aDirection); + OMX_BOOL BufferRemovalIndication(OMX_BUFFERHEADERTYPE* apBufferHeader, OMX_DIRTYPE aDirection); + + // used by CClockSupervisor + OMX_BUFFERHEADERTYPE* AcquireBuffer(TInt aPortIndex); + void SendBuffer(OMX_BUFFERHEADERTYPE* aBuffer); + TBool PortEnabled(TInt aPortIndex) const; + TBool IsExecuting() const; + void InvalidateComponent(); + + +private: + COmxILClockProcessingFunction(MOmxILCallbackNotificationIf& aCallbacks, COmxILClockComponent& aComponent); + void ConstructL(); + void DoBufferFlushingIndication(TUint32 aPortIndex); + +private: + CClockSupervisor* iClock; + CClockThreadNotifier* iThreadNotifier; + COmxILClockComponent& iComponent; + RPointerArray > iBufferQueues; + RMutex iBufferMutex; + TBool iExecuting; + }; + +#endif //COMXILCLOCKPROCESSINGFUNCTION_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilclock/inc/log.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilclock/inc/log.h Fri May 07 16:25:23 2010 +0100 @@ -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 + +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_COMMON_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 aFormat, ...) + { + TTruncateOverflowHandler8 overflowHandler8; + VA_LIST list; + VA_START(list, aFormat); + + TTime now; + now.HomeTime(); + + TBuf8<1024> buffer; + _LIT8(KSwiLogPrefix, "[ilclock] "); + _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 aFormat, ...) + { + TTruncateOverflowHandler16 overflowHandler16; + VA_LIST list; + VA_START(list, aFormat); + + TTime now; + now.HomeTime(); + + TBuf8<256> header; + _LIT8(KSwiLogPrefix, "[ilclock] "); + _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__ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilclock/inc/omxilclock.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilclock/inc/omxilclock.hrh Fri May 07 16:25:23 2010 +0100 @@ -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: +* +*/ + +#ifndef OMXILCLOCK_HRH_ +#define OMXILCLOCK_HRH_ + +#define KUidSymbianOmxILClockDll 0x10286597 +#define KUidSymbianOmxILClock 0x10286598 + +#define KCompNameSymbianOmxILClock "OMX.SYMBIAN.OTHER.CLOCK" +#define KRoleSymbianOmxILClock "clock.binary" + +// No theoretical limit on number of ports, but OpenMAX defines the wait mask OMX_CLOCKPORT0 through +// OMX_CLOCKPORT7 so we assume this number +#define KNumPorts 8 + +#endif /*OMXILCLOCK_HRH_*/ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilclock/src/clockpanics.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilclock/src/clockpanics.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "clockpanics.h" +#include + +_LIT(KClockPanicCategory, "omxilclock"); + +void Panic(TClockPanicCode aCode) + { + User::Panic(KClockPanicCategory, aCode); + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilclock/src/clocksupervisor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilclock/src/clocksupervisor.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,1668 @@ +/* +* 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: +* +*/ + + +// NOTE: Assumes OMX_SKIP64BIT is not set when building OMX CORE + +#include +#include // OMX port +#include "omxilspecversion.h" // OMX version number +#include "clocksupervisor.h" +#include "comxilclockprocessingfunction.h" +#include "clockpanics.h" +#include "omxilclock.hrh" + +#include "log.h" + +////////////// +// File scoped constants +// + +/** The maximum number of simultaneous outstanding requests (across all ports) */ +static const TUint KMaxRequests = 20; +static const TUint KThreadStackSize = 1024; + +/** + * Assumption that timer will always take at least this long to complete. + * How soon an outstanding delay must be before we complete immediately instead of setting a timer. + */ +static const TInt KMinTimerOverhead = 1000; // 1000usecs = 1ms + +// assumption that timers go off at some time rounded to this many microseconds +static const TInt KTimerQuantization = +#ifdef __WINSCW__ + 15000; +#else + 1; +#endif + +// aim to select a counter accurate to ~1ms +#ifdef __WINSCW__ +#define USE_FASTCOUNTER // typically faster than 1ms on emulator, 1ms on hardware +#else +#define USE_NTICKCOUNT // typically 5ms on emulator, 1ms on hardware +#endif + +#if !defined(USE_FASTCOUNTER) && !defined(USE_NTICKCOUNT) +#error Either USE_FASTCOUNTER or USE_NTICKCOUNT must be defined +#endif + +/** + * Structure to map OMX_INDEXTYPE to behaviour required by the Clock component. + */ + +// Indexes for time configs start after OMX_IndexTimeStartUnused = 0x09000000 +// Simply deduct this to index this table + +static const OMX_INDEXTYPE KMinJumpTableIndex = OMX_IndexConfigTimeScale; +static const OMX_INDEXTYPE KMaxJumpTableIndex = OMX_IndexConfigTimeClientStartTime; + +const CClockSupervisor::FunctionPtr CClockSupervisor::iJumpTable[] = + { + /*OMX_IndexConfigTimeScale*/ &CClockSupervisor::HandleGetSetTimeScale ,// requires buffers + /*OMX_IndexConfigTimeClockState*/ &CClockSupervisor::HandleGetSetClockState ,// requires buffers + /*OMX_IndexConfigTimeActiveRefClock*/ &CClockSupervisor::HandleGetSetActiveRefClock , + /*OMX_IndexConfigTimeCurrentMediaTime*/ &CClockSupervisor::HandleQueryCurrentMediaTime , + /*OMX_IndexConfigTimeCurrentWallTime*/ &CClockSupervisor::HandleQueryCurrentWallTime , + /*OMX_IndexConfigTimeCurrentAudioReference*/ &CClockSupervisor::HandleUpdateAudioReference , + /*OMX_IndexConfigTimeCurrentVideoReference*/ &CClockSupervisor::HandleUpdateVideoReference , + /*OMX_IndexConfigTimeMediaTimeRequest*/ &CClockSupervisor::HandleSubmitMediaTimeRequest,// requires buffers + /*OMX_IndexConfigTimeClientStartTime*/ &CClockSupervisor::HandleSetPortClientStartTime, + }; + +#ifdef _DEBUG +#define CHECK_DEBUG() DbgCheck() +#else +#define CHECK_DEBUG() +#endif + + +////////////// + + +/** + * Euclid's algorithm. + * Returns the largest common factor of aX and aY. + */ +static TInt LargestCommonFactor(TInt aX, TInt aY) + { + // based on knowledge that lcf(x,0)=x, lcf(x,y)=lcf(y,x) and lcf(x,y)=lcf(y,x%y) + while(aX != 0) + { + aY %= aX; + if(aY == 0) + { + return aX; + } + aX %= aY; + } + return aY; + } + + +/** + * + * + */ +CClockSupervisor* CClockSupervisor::NewL(COmxILClockProcessingFunction& aProcessingFunction) + { + CClockSupervisor* self = new (ELeave) CClockSupervisor(aProcessingFunction); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + + +/** + * + * + */ +void CClockSupervisor::ConstructL() + { + // calculate tick frequency + // +#ifdef USE_FASTCOUNTER + TInt frequency; // tick frequency in Hz + User::LeaveIfError(HAL::Get(HAL::EFastCounterFrequency, frequency)); + // conversion factor from ticks into microseconds + // using a fraction in integer arithmetic + iMicroConvNum = 1000000; + iMicroConvDen = frequency; + TInt countsUp; + User::LeaveIfError(HAL::Get(HAL::EFastCounterCountsUp, countsUp)); + iSystemClockReversed = !countsUp; +#elif defined(USE_NTICKCOUNT) + User::LeaveIfError(HAL::Get(HAL::ENanoTickPeriod, iMicroConvNum)); // tick period in microseconds + iMicroConvDen = 1; +#else +#error +#endif + + // divide out any common factor to reduce chance of overflow + TInt factor = LargestCommonFactor(iMicroConvNum, iMicroConvDen); + iMicroConvNum /= factor; + iMicroConvDen /= factor; + + // wraparound time in microseconds is 2^32 * iMicroConv + // take the heartbeat interval as half of this (i.e shift left by 31 places) to ensure we wake up often enough to implement the carry properly + TUint64 interval = (static_cast(iMicroConvNum) << 31) / iMicroConvDen; + if (interval > KMaxTInt32) + { + iHeartbeatTimerInterval = KMaxTInt32; + } + else + { + iHeartbeatTimerInterval = interval; + } + + // if denominator is a power of 2, use shift instead + // (shifting is faster than division) + if(iMicroConvDen & (iMicroConvDen - 1) == 0) + { + // PRECONDITION: iMicroConvDen = 2^n, iMicroConvShift = 0 + // POSTCONDITION: iMicroConvDen = 1, iMicroConvShift = n + while(iMicroConvDen >= 2) + { + iMicroConvDen >>= 1; + iMicroConvShift++; + } + } + + // Create the locks + User::LeaveIfError(iQueMutex.CreateLocal()); + + // Create the memory block of empty Time requests that make up the free list. + iRequestBlock = new(ELeave) TMediaRequest [iMaxRequests]; + + // zero the fields for peace of mind + Mem::FillZ(iRequestBlock, (sizeof(TMediaRequest)*iMaxRequests)); + + // Initialise the free list + for(TInt requestIndex = 0; requestIndex < iMaxRequests; requestIndex++) + { + // Add all free items with delta 0 + iFreeRequestQue.Add(iRequestBlock+requestIndex, static_cast(0)); + } + + iStartTimes.ReserveL(KNumPorts); + for(TInt portIndex = 0; portIndex < KNumPorts; portIndex++) + { + iStartTimes.Append(0); + } + + __ASSERT_DEBUG(iMaxRequests == iFreeRequestQue.Count(), Panic(ERequestQueueCorrupt)); + + // Create the timer consumer thread + TBuf<19> threadName; + threadName.Format(_L("OmxILClock@%08X"), this); + + // Timer created on creation of the thread as it is thread relative + User::LeaveIfError(iThread.Create(threadName, ThreadEntryPoint, KThreadStackSize, NULL, this)); + + // High priority thread + iThread.SetPriority(EPriorityRealTime); + // start the thread and wait for it to create the timer + TRequestStatus status; + iThread.Rendezvous(status); + iThread.Resume(); + iThreadStarted = ETrue; + User::WaitForRequest(status); + User::LeaveIfError(status.Int()); + } + + +/** + * + * + */ +CClockSupervisor::CClockSupervisor(COmxILClockProcessingFunction& aProcessingFunction) +: iActiveRefClock(OMX_TIME_RefClockAudio), + iMaxRequests(KMaxRequests), + iProcessingFunction(aProcessingFunction) + { + // compile time assertion that fields requiring atomic access are + // 4-byte aligned + __ASSERT_COMPILE((_FOFF(CClockSupervisor, iWallTicks) & 3) == 0); + + // run time assertion that class itself is allocated on a 4-byte boundary + __ASSERT_ALWAYS((reinterpret_cast(this) & 3) == 0, Panic(EBadAlignment)); + + iMediaClockState.nSize = sizeof(iMediaClockState); + iMediaClockState.nVersion = TOmxILSpecVersion(); + iMediaClockState.eState = OMX_TIME_ClockStateStopped; + + iCancelStatus = KRequestPending; + } + +/** + * + * + */ +CClockSupervisor::~CClockSupervisor() + { + // signal the timing thread and wait for it to terminate + if(iThreadStarted) + { + iThreadRunning = EFalse; + TRequestStatus logonStatus; + iThread.Logon(logonStatus); + // Want the thread to terminate ASAP instead of waiting for a media + // time request completion or a wall time heartbeat. Can't cancel the + // timer without duplicating the handle, and that gives + // KErrPermissionDenied. So we use a second TRequestStatus to wake the + // timing thread before the timer completes. + TRequestStatus* cancelStatus = &iCancelStatus; + iThread.RequestComplete(cancelStatus, KErrCancel); + User::WaitForRequest(logonStatus); + } + + if (iRequestBlock) + { + delete[] iRequestBlock; + iRequestBlock = NULL; + } + + iStartTimes.Close(); + iThread.Close(); + iQueMutex.Close(); + } + + +/** + * Timing thread entry point. + */ +TInt CClockSupervisor::ThreadEntryPoint(TAny* aPtr) + { + CClockSupervisor& supervisor = *static_cast(aPtr); + supervisor.iThreadRunning = ETrue; + CTrapCleanup* cleanup = CTrapCleanup::New(); + if(cleanup == NULL) + { + return KErrNoMemory; + } + + // Delegate to object's clock timing routine + TRAPD(err, supervisor.RunTimingThreadL()); + delete cleanup; + return err; + } + + +/** + * + * + */ +void CClockSupervisor::RunTimingThreadL() + { + // Create the timer (thread relative) + User::LeaveIfError(iTimer.CreateLocal()); + // rendezvous with the creating thread as it must be blocked until the timer is created + iThread.Rendezvous(KErrNone); + + // Start the timer loop to enable us to wake up on heart beat or requests + TimerLoop(); + + iTimer.Close(); + } + +/** + * Services media time requests. + */ +void CClockSupervisor::TimerLoop() + { + // Here we are only interested in setting the timer for a request timeout + // or the heart beat. States are taken care of in ConsumeRequests(). + // On shutdown the flag iThreadRunning is set to EFalse and the timer + // completed with KErrCancel or something other than KRequestPending + // Therefore we no longer try to get another request. + + TInt measuredTimerOverhead = KTimerQuantization; + TRequestStatus timerStatus; + + while(iThreadRunning) + { + // Call our consumer function + TInt timeout = ConsumeRequests(); + + // round down sleep based on overhead and quantization of timers + timeout -= timeout % KTimerQuantization; + timeout -= measuredTimerOverhead; + timeout -= KMinTimerOverhead; + + // limit sleep by the heartbeat interval + if(timeout > iHeartbeatTimerInterval) + { + timeout = iHeartbeatTimerInterval; + } + + // Perhaps timeout not positive from ConsumeRequests(), or due to + // rounding down it is no longer positive. In this case we may spin, so + // be careful when setting KTimerQuantization, KMinTimerOverhead and + // KRequestDeltaLimit + if(timeout <= 0) + { + continue; + } + + iQueMutex.Wait(); + TInt64 actualSleepTime = WallTime(); + iQueMutex.Signal(); + iTimer.HighRes(timerStatus, timeout); + // can't cancel iTimer from another thread, instead we use a second + // TRequestStatus to wake up early, then we can cancel the timer in + // this thread. + User::WaitForRequest(timerStatus, iCancelStatus); + + if(iCancelStatus.Int() != KRequestPending) + { + iTimer.Cancel(); + iCancelStatus = KRequestPending; + } + else + { + // update measuredTimerOverhead + iQueMutex.Wait(); + actualSleepTime = WallTime() - actualSleepTime; + iQueMutex.Signal(); + TInt sleepOverhead = (TInt) (actualSleepTime - timeout); + + /* Dampen adjustments to measuredTimerOverhead + * + * measuredTimerOverhead = max(sleepOverhead, + * avg(measuredTimerOverhead, sleepOverhead)) + * + * i.e. immediate increase, gradual decrease + */ + measuredTimerOverhead = (measuredTimerOverhead + sleepOverhead) >> 1; + if(measuredTimerOverhead < sleepOverhead) + { + measuredTimerOverhead = sleepOverhead; + } + } + } + DEBUG_PRINTF(_L("Clock thread shutting down...")); + } + + +/** + * Update the wall clock with the system ticks + * + */ +void CClockSupervisor::UpdateWallTicks() + { + __ASSERT_DEBUG(iQueMutex.IsHeld(), Panic(EMutexUnheld)); + + TUint32 oldLowPart(I64LOW(iWallTicks)); // save lower 32-bits +#ifdef USE_FASTCOUNTER + // Gets the fast iCounter. + // This is the current value of the machine's high resolution timer. + // If a high resolution timer is not available, it uses the millisecond timer instead. + // The freqency of this iCounter can be determined by reading the HAL attribute EFastCounterFrequency. + TUint32 newLowPart(User::FastCounter()); // set lower 32-bits + if(iSystemClockReversed) + { + newLowPart = -newLowPart; + } +#elif defined(USE_NTICKCOUNT) + TUint32 newLowPart(User::NTickCount()); // set lower 32-bits +#else +#error +#endif + TUint32 newHighPart(I64HIGH(iWallTicks)); // save upper 32-bits + + // note: did not use LockedInc() here because: + // We need a critical section to capture the system time and update the wall clock + // at the same time. + // The wall clock is unsigned. + // LockedInc doesn't stop a preemption directly after the test, only during the inc + if (newLowPart < oldLowPart) + { + newHighPart++; + } + + iWallTicks = MAKE_TUINT64(newHighPart,newLowPart); + } + + +/** + * Returns the current wall time in microseconds. + */ +TInt64 CClockSupervisor::WallTime() + { + __ASSERT_DEBUG(iQueMutex.IsHeld(), Panic(EMutexUnheld)); + + UpdateWallTicks(); + + // if power of two use shift (faster than division) + if (iMicroConvDen == 1) + { + return iWallTicks * iMicroConvNum >> iMicroConvShift; + } + return iWallTicks * iMicroConvNum / iMicroConvDen; + } + +/** + * + * + */ +TBool CClockSupervisor::AllStartTimesReported () + { + return !(static_cast(iMediaClockState.nWaitMask)); + } + +/** + * Called when timer expires or is cancelled. + * + */ +TInt CClockSupervisor::ConsumeRequests() + { + // Events are consumed here only in the Running state. + // Waiting events, State change events, etc. are handled elsewhere. + // These are called broadcast events and have a higher priority + // than the request events requested by the clients. + // This function is called by the TimerLoop only. + + // IMPORTANT: every code path through here must result in a call to UpdateWallTicks to ensure + // that 64-bit time is updated correctly (heartbeat interval makes sure ConsumeRequests is called + // often enough). + + // Our event loop - return if stopped but not for pause (keep heart beat going) + if(OMX_TIME_ClockStateStopped != iMediaClockState.eState) + { + // Acquire the mutex + iQueMutex.Wait(); + + // this can be entered from the timer on heartbeat or on a call to a state change. + // Don't want this to happen on a state change! + if (OMX_TIME_ClockStateWaitingForStartTime == iMediaClockState.eState) + { + // We need to check if all clients have reported their start times + if (!AllStartTimesReported()) + { + // Not all reported as yet... + UpdateWallTicks(); + + // Release the mutex + iQueMutex.Signal(); + + // wait until they have! keep heat beat going in case it takes looooong! + return iHeartbeatTimerInterval; + } + else + { + // depending on scale decide which start time to use + CalculateStartTime(); + + // no need to check error, we are in the waiting state + DoTransitionToRunningState(); + + // Now just go and send the iNext request! + } + } + + /////////////////////////////// + // There is a request pending !!! + // + + // check the timeout period against the wall clock to determine if this is a heart beat + + if(iMtc.iScaleQ16 == 0) + { + // do not pop front of the queue because we are effectively paused + UpdateWallTicks(); + + // Release the mutex + iQueMutex.Signal(); + + return iHeartbeatTimerInterval; + } + + // try to pop the next pending request + TInt64 delta; + TBool present = iPendingRequestQue.FirstDelta(delta); + + // Is there nothing there? + if (!present) + { + // Nothing on the queue + // Here because of heart beat + UpdateWallTicks(); + + // Release the mutex + iQueMutex.Signal(); + + return iHeartbeatTimerInterval; + } + + // update the delta against clock + delta -= WallTime(); + + // Some time to go before head of queue should be serviced? + if (delta > KMinTimerOverhead) + { + // Release the mutex + iQueMutex.Signal(); + + return delta; + } + + // Request timed out, delta expired! + // Fulfill the request + TMediaRequest* request = iPendingRequestQue.RemoveFirst(); + + // Acquire fulfillment buffer for a specific port + OMX_BUFFERHEADERTYPE* buffer = iProcessingFunction.AcquireBuffer(request->iPortIndex); + if(buffer == NULL) + { + // starved of buffers! + DEBUG_PRINTF(_L("ConsumeRequests starved of buffers, transitioning to OMX_StateInvalid")); + iThreadRunning = EFalse; + iQueMutex.Signal(); + iProcessingFunction.InvalidateComponent(); + return 0; + } + OMX_TIME_MEDIATIMETYPE* mT = reinterpret_cast(buffer->pBuffer); + buffer->nOffset = 0; + buffer->nFilledLen = sizeof(OMX_TIME_MEDIATIMETYPE); + + mT->nSize = sizeof(OMX_TIME_MEDIATIMETYPE); + mT->nVersion = TOmxILSpecVersion(); + mT->eUpdateType = OMX_TIME_UpdateRequestFulfillment; + mT->nClientPrivate = reinterpret_cast(request->iClientPrivate); + mT->xScale = iMtc.iScaleQ16; + mT->eState = OMX_TIME_ClockStateRunning; + mT->nMediaTimestamp = request->iMediaTime; + mT->nWallTimeAtMediaTime = request->iTriggerWallTime + request->iOffset; + mT->nOffset = mT->nWallTimeAtMediaTime - WallTime(); // could be waiting on buffer b4 this! + +#ifdef _OMXIL_COMMON_DEBUG_TRACING_ON + DEBUG_PRINTF(_L8("CLOCK::ConsumeRequest*******************************OMX_TIME_UpdateRequestFulfillment***VS2")); + TTime t; + t.HomeTime(); + DEBUG_PRINTF2(_L8("CLOCK::ConsumeRequest : t.HomeTime() = %ld"), t.Int64()); + DEBUG_PRINTF2(_L8("CLOCK::ConsumeRequest : Buffer = 0x%X"), mT->nClientPrivate); + DEBUG_PRINTF2(_L8("CLOCK::ConsumeRequest : mT->nMediaTimestamp = %ld"), mT->nMediaTimestamp); +#endif + + iProcessingFunction.SendBuffer(buffer); + + // clear the delta on this now free request + request->iTriggerWallTime = 0; + + // Add element back to the free pool + iFreeRequestQue.Add(request, 0); + + // Release the mutex + iQueMutex.Signal(); + + // Update delta for next request. + // NOTE: we do not know if scale change or not so when we re-enter here + // we should recalculate the delta above and perform the appropriate action. + return 0; + } + else + { + // clock is stopped - sleep for the heartbeat interval + return iHeartbeatTimerInterval; + } + } + +/** + * + * + */ +OMX_ERRORTYPE CClockSupervisor::ProduceRequest(OMX_INDEXTYPE aIndex, TEntryPoint aEntryPoint, TAny* aPassedStructPtr) + { + // Range checking on parameter/config index + if(aIndex < KMinJumpTableIndex || aIndex > KMaxJumpTableIndex) + { + return OMX_ErrorUnsupportedIndex; + } + // Note also that certain combinations on Get/Set within the supported range are unsupported. + // This is left to the function in the jump table. + + // Acquire the mutex + iQueMutex.Wait(); + + // Index the routing table for the correct handler + FunctionPtr jumpTableFptr = iJumpTable[aIndex-KMinJumpTableIndex]; + OMX_ERRORTYPE ret = (this->*jumpTableFptr)(aEntryPoint, aPassedStructPtr); + + // Release the mutex + iQueMutex.Signal(); + + return ret; + } + + +/** + * According to scale, choose the earliest start time among the set of client + * start times. For forward play this is the minimum, for reverse play this is + * the maximum. + */ +void CClockSupervisor::CalculateStartTime() + { + // The nWaitMask field of the Media clock state is a bit mask specifying the client + // components that the clock component will wait on in the + // OMX_TIME_ClockStateWaitingForStartTime state. Bit masks are defined + // as OMX_CLOCKPORT0 through OMX_CLOCKPORT7. + + // Based on scale locate the minimum or maximum start times of all clients + TInt64 startTime; + + if (iMtc.iScaleQ16 >= 0) + { + startTime = KMaxTInt64; + + // choose minimum + for (TInt portIndex = 0; portIndex < iStartTimes.Count(); portIndex++) + { + if(iStartTimesSet & (1 << portIndex)) + { + startTime = Min(startTime, iStartTimes[portIndex]); + } + } + } + else + { + startTime = KMinTInt64; + + // choose maximum + for (TInt portIndex = 0; portIndex < iStartTimes.Count(); portIndex++) + { + if(iStartTimesSet & (1 << portIndex)) + { + startTime = Max(startTime, iStartTimes[portIndex]); + } + } + } + + // adjust the media time to the new start time + UpdateMediaTime(startTime); + } + + +/** + * Perform actions related to placing the clock into the Stopped state + */ +void CClockSupervisor::DoTransitionToStoppedState() + { + // OMX_TIME_ClockStateStopped: Immediately stop the media clock, clear all + // pending media time requests, clear all client start times, and transition to the + // stopped state. This transition is valid from all other states. + + // We should already have the mutex! + __ASSERT_DEBUG(iQueMutex.IsHeld(), Panic(EMutexUnheld)); + + // clear any current start time + iMediaClockState.nStartTime = 0; + iMediaClockState.nWaitMask = 0; + + // clear client start times + for(TInt index = 0, count = iStartTimes.Count(); index < count; index++) + { + iStartTimes[index] = 0; + } + iStartTimesSet = 0; + + // clear all pending requests, placing them back on the free queue + while (!iPendingRequestQue.IsEmpty()) + { + TMediaRequest* request = iPendingRequestQue.RemoveFirst(); + + // clear the delta on this now free request + request->iTriggerWallTime = 0; + + iFreeRequestQue.Add(request,0); + } + + TInt64 wallTimeNow = WallTime(); + + // if clock was previously running, stop the media time at the present value + if(iMediaClockState.eState == OMX_TIME_ClockStateRunning) + { + TInt64 mediaTimeNow = ((wallTimeNow - iMtc.iWallTimeBase) * iMtc.iScaleQ16 >> 16) + iMtc.iMediaTimeBase; + iMtc.iWallTimeBase = wallTimeNow; + iMtc.iMediaTimeBase = mediaTimeNow; + } + + // Indicate stopped state + iMediaClockState.eState = OMX_TIME_ClockStateStopped; + + // Indicate to clients a state change + OMX_TIME_MEDIATIMETYPE update; + update.nSize = sizeof(OMX_TIME_MEDIATIMETYPE); + update.nVersion = TOmxILSpecVersion(); + update.nClientPrivate = NULL; + update.eUpdateType = OMX_TIME_UpdateClockStateChanged; + update.xScale = iMtc.iScaleQ16; + update.eState = OMX_TIME_ClockStateStopped; + update.nMediaTimestamp = iMtc.iMediaTimeBase; + update.nWallTimeAtMediaTime = wallTimeNow; + update.nOffset = 0; + + BroadcastUpdate(update); + } + + +/** + * Perform actions related to placing the clock into the Running state + */ +void CClockSupervisor::DoTransitionToRunningState() + { + // OMX_TIME_ClockStateRunning: Immediately start the media clock using the given + // start time and offset, and transition to the running state. This transition is valid from + // all other states. + + // We should already have the mutex! + __ASSERT_DEBUG(iQueMutex.IsHeld(), Panic(EMutexUnheld)); + + // if we transistioned from stopped to running then start time will be cleared. + // we only set it on transition from waiting to running + // this is enforced not by a check but by logic flow! + // If this is not the case then start time should have been cleared and we can start now! + + // Indicate running state + iMediaClockState.eState = OMX_TIME_ClockStateRunning; + + // Indicate to clients a state change + OMX_TIME_MEDIATIMETYPE update; + update.nSize = sizeof(OMX_TIME_MEDIATIMETYPE); + update.nVersion = TOmxILSpecVersion(); + update.nClientPrivate = NULL; + update.eUpdateType = OMX_TIME_UpdateClockStateChanged; + update.xScale = iMtc.iScaleQ16; + update.eState = iMediaClockState.eState; + update.nMediaTimestamp = iMtc.iMediaTimeBase; + update.nWallTimeAtMediaTime = iMtc.iWallTimeBase; + update.nOffset = 0; + + BroadcastUpdate(update); + } + +/** + * Perform actions related to placing the clock into the Waiting state + */ +void CClockSupervisor::DoTransitionToWaitingState(OMX_U32 nWaitMask) + { + // OMX_TIME_WaitingForStartTime: Transition immediately to the waiting state, wait + // for all clients specified in nWaitMask to report their start time, start the media clock + // using the minimum of all client start times and transition to + // OMX_TIME_ClockStateRunning. This transition is only valid from the + // OMX_TIME_ClockStateStopped state. + // (*Added*) If in the backwards direction start the media clock using the maximum + // of all client start times. + + // validity of state transition has been checked in HandleGetSetClockState() + + // We should already have the mutex! + __ASSERT_DEBUG(iQueMutex.IsHeld(), Panic(EMutexUnheld)); + + iMediaClockState.eState = OMX_TIME_ClockStateWaitingForStartTime; + + // Start times set in calling function HandleClientStartTime() + + // Remember all clients that need to report their start times + iMediaClockState.nWaitMask = nWaitMask; + + // Indicate to clients a state change + OMX_TIME_MEDIATIMETYPE update; + update.nSize = sizeof(OMX_TIME_MEDIATIMETYPE); + update.nVersion = TOmxILSpecVersion(); + update.nClientPrivate = NULL; + update.eUpdateType = OMX_TIME_UpdateClockStateChanged; + update.xScale = iMtc.iScaleQ16; + update.eState = OMX_TIME_ClockStateWaitingForStartTime; + update.nMediaTimestamp = iMtc.iMediaTimeBase; + update.nWallTimeAtMediaTime = WallTime(); + update.nOffset = 0; + + BroadcastUpdate(update); + } + + + /** + * Update the wall clock with the system ticks + * + */ + OMX_ERRORTYPE CClockSupervisor::HandleSubmitMediaTimeRequest(TEntryPoint aEntry, OMX_PTR aPassedStructPtr) + { + // We should already have the mutex! + __ASSERT_DEBUG(iQueMutex.IsHeld(), Panic(EMutexUnheld)); + + // A client requests the transmission of a particular timestamp via OMX_SetConfig on its + // clock port using the OMX_IndexConfigTimeMediaTimeRequest configuration + // and structure OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE + + // OMX_GetConfig doesn't make any sense for MediaTimeRequest + if(aEntry == EGetConfig) + { + return OMX_ErrorUnsupportedIndex; + } + + TMediaRequest *request = iFreeRequestQue.RemoveFirst(); + if(request == NULL) + { + // too many pending requests! + return OMX_ErrorInsufficientResources; + } + + OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE* rT = static_cast(aPassedStructPtr); + + request->iMediaTime = rT->nMediaTimestamp; + request->iOffset = rT->nOffset; + request->iTriggerWallTime = + ((rT->nMediaTimestamp - iMtc.iMediaTimeBase) * iMtc.iInverseScaleQ16 >> 16) + + iMtc.iWallTimeBase - rT->nOffset; + request->iPortIndex = rT->nPortIndex; + request->iClientPrivate = rT->pClientPrivate; + + TInt64 prevHeadTime(0); + TBool nonEmpty = iPendingRequestQue.FirstDelta(prevHeadTime); + iPendingRequestQue.Add(request, request->iTriggerWallTime); + // Wake the thread immediately if head of queue now will complete sooner + // than it would have previously, or if the queue was empty previously. + // This causes the timing thread to recalculate the sleep time. + if(!nonEmpty || prevHeadTime > request->iTriggerWallTime) + { + TRequestStatus* status = &iCancelStatus; + iThread.RequestComplete(status, KErrCancel); + } + return OMX_ErrorNone; + } + + + /** + * + * + */ + OMX_ERRORTYPE CClockSupervisor::HandleQueryCurrentWallTime(TEntryPoint aEntry, OMX_PTR aPassedStructPtr) + { + // An IL client may query the current wall time via OMX_GetConfig on OMX_IndexConfigTimeCurrentWallTime. + // A client may obtain the current wall time, which is obtained via OMX_GetConfig on + // OMX_IndexConfigTimeCurrentWallTime. + + // OMX_SetConfig doesn't make sense for wall time + if(aEntry == ESetConfig) + { + return OMX_ErrorUnsupportedIndex; + } + + // We should already have the mutex! + __ASSERT_DEBUG(iQueMutex.IsHeld(), Panic(EMutexUnheld)); + + OMX_TIME_CONFIG_TIMESTAMPTYPE& wallTs = *static_cast(aPassedStructPtr); + wallTs.nTimestamp = WallTime(); + return OMX_ErrorNone; + } + + +/** + * Calculates and returns the current media time. + */ +OMX_ERRORTYPE CClockSupervisor::HandleQueryCurrentMediaTime(TEntryPoint aEntry, OMX_PTR aPassedStructPtr) + { + // The clock component can be queried for the current media clock time using + // OMX_GetConfig with the read-only index OMX_IndexConfigTimeCurrentMediaTime and structure + // OMX_TIME_CONFIG_TIMESTAMPTYPE. + + // OMX_SetConfig cannot be used for Media Time (audio or video reference updates are used instead) + if(aEntry == ESetConfig) + { + return OMX_ErrorUnsupportedIndex; + } + + // We should already have the mutex! + __ASSERT_DEBUG(iQueMutex.IsHeld(), Panic(EMutexUnheld)); + + OMX_TIME_CONFIG_TIMESTAMPTYPE* ts = static_cast(aPassedStructPtr); + if(iMediaClockState.eState == OMX_TIME_ClockStateRunning) + { + ts->nTimestamp = ((WallTime() - iMtc.iWallTimeBase) * iMtc.iScaleQ16 >> 16) + iMtc.iMediaTimeBase; + } + else + { + ts->nTimestamp = iMtc.iMediaTimeBase; + } + return OMX_ErrorNone; + } + +/** + * An external component is providing an Audio reference time update. + */ +OMX_ERRORTYPE CClockSupervisor::HandleUpdateAudioReference(TEntryPoint aEntry, OMX_PTR aPassedStructPtr) + { + // The clock component can accept an audio reference clock. + // The reference clock tracks the media time at its associated component + // (i.e., the timestamp of the data currently being processed at that component) + // and provides periodic references to the clock component via OMX_SetConfig + // using OMX_IndexConfigTimeCurrentAudioReference, and structure OMX_TIME_CONFIG_TIMESTAMPTYPE + // + // When the clock component receives a reference, it updates its internally maintained + // media time with the reference. This action synchronizes the clock component with the + // component that is providing the reference clock. + + // OMX_GetConfig not supported on reference time as it will generally be + // some arbitary time in the past + if(aEntry == EGetConfig) + { + return OMX_ErrorUnsupportedIndex; + } + + // We should already have the mutex! + __ASSERT_DEBUG(iQueMutex.IsHeld(), Panic(EMutexUnheld)); + + if(iActiveRefClock == OMX_TIME_RefClockAudio) + { + OMX_TIME_CONFIG_TIMESTAMPTYPE* ts = static_cast(aPassedStructPtr); + UpdateMediaTime(ts->nTimestamp); + } + + return OMX_ErrorNone; + } + +/** + * An external component is providing a Video reference time update. + */ +OMX_ERRORTYPE CClockSupervisor::HandleUpdateVideoReference(TEntryPoint aEntry, OMX_PTR aPassedStructPtr) + { + // The clock component can accept a video reference clock. + // The reference clock tracks the media time at its associated component + // (i.e., the timestamp of the data currently being processed at that component) + // and provides periodic references to the clock component via OMX_SetConfig + // using OMX_IndexConfigTimeCurrentVideoReference, and structure OMX_TIME_CONFIG_TIMESTAMPTYPE + // + // When the clock component receives a reference, it updates its internally maintained + // media time with the reference. This action synchronizes the clock component with the + // component that is providing the reference clock. + + // OMX_GetConfig not supported on reference time as it will generally be + // some arbitary time in the past + if(aEntry == EGetConfig) + { + return OMX_ErrorUnsupportedIndex; + } + + // We should already have the mutex! + __ASSERT_DEBUG(iQueMutex.IsHeld(), Panic(EMutexUnheld)); + + if(iActiveRefClock == OMX_TIME_RefClockVideo) + { + OMX_TIME_CONFIG_TIMESTAMPTYPE* ts = static_cast(aPassedStructPtr); + UpdateMediaTime(ts->nTimestamp); + } + + return OMX_ErrorNone; + } + + /** + * + * + */ + OMX_ERRORTYPE CClockSupervisor::HandleSetPortClientStartTime(TEntryPoint aEntry, OMX_PTR aPassedStructPtr) + { + // We should already have the mutex! + __ASSERT_DEBUG(iQueMutex.IsHeld(), Panic(EMutexUnheld)); + + // When a clock component client receives a buffer with flag OMX_BUFFERFLAG_STARTTIME set, + // it performs an OMX_SetConfig call with OMX_IndexConfigTimeClientStartTime + // on the clock component that is sending the buffer’s timestamp. + // The transmission of the start time informs the clock component that the client’s stream + // is ready for presentation and the timestamp of the first data to be presented. + // + // If the IL client requests a transition to OMX_TIME_ClockStateWaitingForStartTime, it + // designates which clock component clients to wait for. The clock component then waits + // for these clients to send their start times via the + // OMX_IndexConfigTimeClientStartTime configuration. Once all required + // clients have responded, the clock component starts the media clock using the earliest + // client start time. + // + // When a client is sent a start time (i.e., the timestamp of a buffer marked with the + // OMX_BUFFERFLAG_STARTTIME flag ), it sends the start time to the clock component + // via OMX_SetConfig on OMX_IndexConfigTimeClientStartTime. This + // action communicates to the clock component the following information about the client’s + // data stream: + // - The stream is ready. + // - The starting timestamp of the stream + + // TODO Perhaps OMX_GetConfig can be done for client start time, after all + // the start times on each port have been stored. But for now this is not + // supported. + if(aEntry == EGetConfig) + { + return OMX_ErrorUnsupportedIndex; + } + + if(iMediaClockState.eState != OMX_TIME_ClockStateWaitingForStartTime) + { + return OMX_ErrorIncorrectStateOperation; + } + + OMX_TIME_CONFIG_TIMESTAMPTYPE* state = static_cast(aPassedStructPtr); + iMediaClockState.nWaitMask &= ~(1 << state->nPortIndex); // switch off bit + iStartTimesSet |= 1 << state->nPortIndex; // switch on bit + iStartTimes[state->nPortIndex] = state->nTimestamp; + + if(iMediaClockState.nWaitMask == 0) + { + // cancel timer so transition occurs immediately instead of waiting for a heartbeat + TRequestStatus* cancelStatus = &iCancelStatus; + iThread.RequestComplete(cancelStatus, KErrCancel); + } + + return OMX_ErrorNone; + } + +/** + * Sets the current media time to the specified value. + */ +void CClockSupervisor::UpdateMediaTime(TInt64 aMediaTime) + { +#ifdef _OMXIL_COMMON_DEBUG_TRACING_ON + OMX_TIME_CONFIG_TIMESTAMPTYPE ts; + HandleQueryCurrentMediaTime(EGetConfig, &ts); + DEBUG_PRINTF4(_L8("Clock::UpdateMediaTime=[%ld]currentmediaTime=<%d> MediaTime <%ld>"), ts.nTimestamp-aMediaTime,ts.nTimestamp, aMediaTime); +#endif // _OMXIL_COMMON_DEBUG_TRACING_ON + iMtc.iWallTimeBase = WallTime(); + iMtc.iMediaTimeBase = aMediaTime; + iPendingRequestQue.RecalculateAndReorder(iMtc); + + TRequestStatus* status = &iCancelStatus; + iThread.RequestComplete(status, KErrCancel); + } + + /** + * + * + */ + OMX_ERRORTYPE CClockSupervisor::HandleGetSetTimeScale(TEntryPoint aEntry, OMX_PTR aPassedStructPtr) + { + // The IL client queries and sets the media clock’s scale via the + // OMX_IndexConfigTimeScale configuration, passing structure + // OMX_TIME_CONFIG_SCALETYPE + + // We should already have the mutex! + __ASSERT_DEBUG(iQueMutex.IsHeld(), Panic(EMutexUnheld)); + + OMX_TIME_CONFIG_SCALETYPE* sT = static_cast(aPassedStructPtr); + + if (EGetConfig == aEntry) + { + sT->xScale = iMtc.iScaleQ16; + } + else + { // ESetConfig + + if(sT->xScale == iMtc.iScaleQ16) + { + // do not broadcast update if the scale changed to the same value + // IL client causes the scale change but only IL components receive the notification + return OMX_ErrorNone; + } + iMtc.SetScaleQ16(sT->xScale, WallTime()); + + // Reorder before sending notifications + iPendingRequestQue.RecalculateAndReorder(iMtc); + + // Indicate to clients a scale change + // The buffer payload is written here then copied to all clients' buffers + // It should be noted that as this is happening across all ports, time can pass + // making nMediaTimestamp and nWallTimeAtMediaTime inaccurate. Since at present we do + // not recover buffer exhaustion scenarios, it is assumed that the messaging time is short + // thus we do not recalculate the time. + + OMX_TIME_MEDIATIMETYPE update; + update.nSize = sizeof(OMX_TIME_MEDIATIMETYPE); + update.nVersion = TOmxILSpecVersion(); + update.nClientPrivate = NULL; + update.eUpdateType = OMX_TIME_UpdateScaleChanged; + update.xScale = iMtc.iScaleQ16; + update.eState = iMediaClockState.eState; + update.nMediaTimestamp = iMtc.iMediaTimeBase; + update.nWallTimeAtMediaTime = iMtc.iWallTimeBase; + update.nOffset = 0; + + BroadcastUpdate(update); + + // Signal the Timer thread as it may need to fulfill all requests on a direction change, + // of fulfill some requests as we have moved forward in time + TRequestStatus* cancelStatus = &iCancelStatus; + iThread.RequestComplete(cancelStatus, KErrCancel); + //****************************************** + } + return OMX_ErrorNone; + } + + + /** + * + * + */ + OMX_ERRORTYPE CClockSupervisor::HandleGetSetClockState(TEntryPoint aEntry, OMX_PTR aPassedStructPtr) + { + // An OMX_GetConfig execution using index OMX_IndexConfigTimeClockState + // and structure OMX_TIME_CONFIG_CLOCKSTATETYPE queries the current clock state. + // An OMX_SetConfig execution using index OMX_IndexConfigTimeClockState + // and structure OMX_TIME_CONFIG_CLOCKSTATETYPE commands the clock + // component to transition to the given state, effectively providing the IL client a + // mechanism for starting and stopping the media clock. + // + // Upon receiving OMX_SetConfig from the IL client that requests a transition to the + // given state, the clock component will do the following: + // + // - OMX_TIME_ClockStateStopped: Immediately stop the media clock, clear all + // pending media time requests, clear and all client start times, and transition to the + // stopped state. This transition is valid from all other states. + // + // - OMX_TIME_ClockStateRunning: Immediately start the media clock using the given + // start time and offset, and transition to the running state. This transition is valid from + // all other states. + // + // - OMX_TIME_WaitingForStartTime: Transition immediately to the waiting state, wait + // for all clients specified in nWaitMask to report their start time, start the media clock + // using the minimum of all client start times and transition to + // OMX_TIME_ClockStateRunning. This transition is only valid from the + // OMX_TIME_ClockStateStopped state. + + // We should already have the mutex! + __ASSERT_DEBUG(iQueMutex.IsHeld(), Panic(EMutexUnheld)); + + OMX_ERRORTYPE ret = OMX_ErrorNone; + + OMX_TIME_CONFIG_CLOCKSTATETYPE* const &clkState + = static_cast(aPassedStructPtr); + + if (ESetConfig == aEntry) + { + if (iMediaClockState.eState == clkState->eState) + { + // Already in this state! + return OMX_ErrorSameState; + } + if (clkState->eState != OMX_TIME_ClockStateStopped && + clkState->eState != OMX_TIME_ClockStateWaitingForStartTime && + clkState->eState != OMX_TIME_ClockStateRunning) + { + return OMX_ErrorUnsupportedSetting; + } + + // need buffers to notify clock state changes, so require to be in Executing + if(!iProcessingFunction.IsExecuting()) + { + return OMX_ErrorIncorrectStateOperation; + } + + switch (clkState->eState) + { + case OMX_TIME_ClockStateStopped: + { + DoTransitionToStoppedState(); + break; + } + case OMX_TIME_ClockStateWaitingForStartTime: + { + // Can't go into this state from Running state + if (OMX_TIME_ClockStateRunning == iMediaClockState.eState) + { + ret = OMX_ErrorIncorrectStateTransition; + break; + } + // Waiting for no ports makes no sense. Also don't allow wait on ports we don't have. + if (clkState->nWaitMask == 0 || clkState->nWaitMask >= 1 << KNumPorts) + { + ret = OMX_ErrorUnsupportedSetting; + break; + } + DoTransitionToWaitingState(clkState->nWaitMask); + break; + } + case OMX_TIME_ClockStateRunning: + { + // set media time to that passed by the IL client + iMtc.iWallTimeBase = WallTime(); + iMtc.iMediaTimeBase = clkState->nStartTime; + // changed time base so pending trigger wall times may be different + iPendingRequestQue.RecalculateAndReorder(iMtc); + DoTransitionToRunningState(); + // wake the timer thread to reset timer or service pending updates + TRequestStatus* statusPtr = &iCancelStatus; + iThread.RequestComplete(statusPtr, KErrCancel); + + break; + } + // default condition already checked before Executing test + } + } + else + { + clkState->eState = iMediaClockState.eState; + } + + return ret; + } + + /** + * + * + */ + OMX_ERRORTYPE CClockSupervisor::HandleGetSetActiveRefClock(TEntryPoint aEntry, OMX_PTR aPassedStructPtr) + { + // The IL client controls which reference clock the clock component uses (if any) via the + // OMX_IndexConfigTimeActiveRefClock configuration and structure OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE + + // don't need the mutex here as just getting/setting one machine word + + OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE& ref = *static_cast(aPassedStructPtr); + + if (ESetConfig == aEntry) + { + if (ref.eClock != OMX_TIME_RefClockAudio && + ref.eClock != OMX_TIME_RefClockVideo && + ref.eClock != OMX_TIME_RefClockNone) + { + return OMX_ErrorUnsupportedSetting; + } + iActiveRefClock = ref.eClock; + } + else // EGetConfig + { + ref.eClock = iActiveRefClock; + } + return OMX_ErrorNone; + } + +void CClockSupervisor::BroadcastUpdate(const OMX_TIME_MEDIATIMETYPE& aUpdate) + { + // notify state change on all enabled ports + for(TInt portIndex = 0; portIndex < KNumPorts; portIndex++) + { + if(iProcessingFunction.PortEnabled(portIndex)) + { + OMX_BUFFERHEADERTYPE* buffer = iProcessingFunction.AcquireBuffer(portIndex); + if(buffer == NULL) + { + // starved of buffers! + iThreadRunning = EFalse; + iProcessingFunction.InvalidateComponent(); + return; + } + OMX_TIME_MEDIATIMETYPE& mT = *reinterpret_cast(buffer->pBuffer); + mT = aUpdate; + buffer->nOffset = 0; + buffer->nFilledLen = sizeof(OMX_TIME_MEDIATIMETYPE); + iProcessingFunction.SendBuffer(buffer); + } + } + } + +void CClockSupervisor::ReportClockThreadPanic() + { + iThreadRunning = EFalse; + iProcessingFunction.InvalidateComponent(); + } +/** + * Adjusts the media time scale. + * The wall/media time bases are updated so there is no instantaneous change to media time. + * iInverseScaleQ16 is also recalculated. + */ +void TMediaTimeContext::SetScaleQ16(TInt32 aScaleQ16, TInt64 aWallTimeNow) + { + TInt64 mediaTimeNow = ((aWallTimeNow - iWallTimeBase) * iScaleQ16 >> 16) + iMediaTimeBase; + iWallTimeBase = aWallTimeNow; + iMediaTimeBase = mediaTimeNow; + iScaleQ16 = aScaleQ16; + + // calculate inverse scale + // 1.0/scale in Q16 format becomes 2^32/scaleQ16 + // values of -1 and +1 will cause overflow and are clipped + // division by zero also yields KMaxTInt (2^31 - 1) + if(iScaleQ16 == 0 || iScaleQ16 == 1) + { + iInverseScaleQ16 = 0x7FFFFFFF; + } + else if(iScaleQ16 == -1) + { + iInverseScaleQ16 = 0x80000000; + } + else + { + iInverseScaleQ16 = static_cast(0x100000000LL / iScaleQ16); + } + } + + +TRequestDeltaQue::TRequestDeltaQue() + : iHead(0), + iCount(0) + { + // do nothing + } + + void TRequestDeltaQue::Add(TMediaRequest* aElement, TInt64 aDelta) + { + CHECK_DEBUG(); + + __ASSERT_DEBUG(((iHead == NULL && iCount == 0) || (iHead != NULL && iCount > 0)), + Panic(ERequestQueueCorrupt)); + + if (!iHead) + { + iHead = aElement; + aElement->iPrev = aElement; + aElement->iNext = aElement; + } + else // set the new element links + { + TBool front(EFalse); + TMediaRequest* item(NULL); + front = InsertBeforeFoundPosition (aDelta, item); + + if (front) + { + // insert infront BEFORE as we have the lesser delta + // set up the element + aElement->iPrev = item->iPrev; + aElement->iNext = item; + + // set up the item before in the list + item->iPrev->iNext = aElement; + + // set up the item after in the list + item->iPrev = aElement; + + // setup the new head + iHead = aElement; + } + else + { + // insert this element AFTER the item in the list + // set up the element + aElement->iPrev = item; + aElement->iNext = item->iNext; + + // set up the item before in the list + item->iNext = aElement; + + // set up the item after in the list + aElement->iNext->iPrev = aElement; + } + } + iCount++; + +#ifdef _OMXIL_COMMON_DEBUG_TRACING_ON + // print the trigger times in debug mode + DbgPrint(); +#endif + + CHECK_DEBUG(); + } + + TBool TRequestDeltaQue::InsertBeforeFoundPosition(TInt64 aDelta, TMediaRequest*& aItem) const + { + CHECK_DEBUG(); + + __ASSERT_DEBUG(((iHead == NULL && iCount == 0) || (iHead != NULL && iCount > 0)), + Panic(ERequestQueueCorrupt)); + + // search for the position where to insert + // and insert after this + + aItem = iHead->iPrev; // tail + + // start from the end and linearly work backwards + while (aItem->iTriggerWallTime > aDelta && aItem != iHead) + { + aItem = aItem->iPrev; + } + + // indicates that we insert before the item and not after it + if (aItem == iHead && aItem->iTriggerWallTime > aDelta) + { + return ETrue; + } + + // no CHECK_DEBUG required as this method is const + + return EFalse; + } + +/** + * If scale changes, the iTriggerWallTimes must be recalculated. + * + * In addition, because offset is not affected by scale, it is possible for + * the order of the elements to change. This event is assumed to be rare, and + * when it does occur we expect the list to remain 'roughly sorted' requiring + * few exchanges. + * + * So we choose ** bubble sort **. + * + * Time recalculation is merged with the first pass of bubble sort. Times are + * recalculated in the first iteration only. Swaps can occur as necessary in + * all iterations. We expect that in most cases there will only be one pass + * with no swaps. + * + * Note that bubble sort would be worst-case complexity if reversing the list + * due to a time direction change. In such cases future requests complete + * immediately (because they are now in the past). So we do not sort at at all + * in this case. + */ + void TRequestDeltaQue::RecalculateAndReorder(TMediaTimeContext& aMtc) + { + CHECK_DEBUG(); + + __ASSERT_DEBUG(((iHead == NULL && iCount == 0) || (iHead != NULL && iCount > 0)), + Panic(ERequestQueueCorrupt)); + + if(iCount == 0) + { + // nothing to do + return; + } + // note if there is 1 item there is no reorder but we do need to recalculate + + TBool swapped(EFalse); + TBool deltaCalculated(EFalse); + + do + { + // start from end of queue + swapped = EFalse; + TMediaRequest* item(iHead->iPrev); // tail + + if (!deltaCalculated) + { + // calculate the tails new delta + item->iTriggerWallTime = + ((item->iMediaTime - aMtc.iMediaTimeBase) * aMtc.iInverseScaleQ16 >> 16) + + aMtc.iWallTimeBase - item->iOffset; + } + + while (item != iHead) + { + TMediaRequest* swap = item->iPrev; + if (!deltaCalculated) + { + // recalculate the Prev item delta + swap->iTriggerWallTime = + ((swap->iMediaTime - aMtc.iMediaTimeBase) * aMtc.iInverseScaleQ16 >> 16) + + aMtc.iWallTimeBase - swap->iOffset; + } + + if (swap->iTriggerWallTime > item->iTriggerWallTime) + { + // switch (swap, item) for (item, swap) + item->Deque(); + item->AddBefore(swap); + if(swap == iHead) + { + iHead = item; + } + + swapped = ETrue; + } + else + { + // move along list + item = item->iPrev; + } + + } // while + + // after the first pass of the queue, all deltas calculated + deltaCalculated = ETrue; + + } while (swapped); + +#ifdef _OMXIL_COMMON_DEBUG_TRACING_ON + DbgPrint(); +#endif + + CHECK_DEBUG(); + } + + + TMediaRequest* TRequestDeltaQue::RemoveFirst() + { + CHECK_DEBUG(); + + __ASSERT_DEBUG(((iHead == NULL && iCount == 0) || (iHead != NULL && iCount > 0)), + Panic(ERequestQueueCorrupt)); + + TMediaRequest* item = NULL; + + // empty? + if (!iHead) + { + return NULL; + } + else + // only one element? + if (1 == iCount) + { + item = iHead; + iHead = NULL; + } + else + { + item = iHead; + item->iPrev->iNext = item->iNext; + item->iNext->iPrev = item->iPrev; + + // setup the new head + iHead = item->iNext; + } + + iCount--; + + CHECK_DEBUG(); + + return item; + } + + TBool TRequestDeltaQue::FirstDelta(TInt64& aDelta) const + { + CHECK_DEBUG(); + + __ASSERT_DEBUG(((iHead == NULL && iCount == 0) || (iHead != NULL && iCount > 0)), + Panic(ERequestQueueCorrupt)); + + if (!iHead) + { + return EFalse; + } + + aDelta = iHead->iTriggerWallTime; + return ETrue; + } + + TBool TRequestDeltaQue::IsEmpty() const + { + __ASSERT_DEBUG(((iHead == NULL && iCount == 0) || (iHead != NULL && iCount > 0)), + Panic(ERequestQueueCorrupt)); + + return (!iHead); + } + + TUint TRequestDeltaQue::Count() const + { + return iCount; + } + +void TMediaRequest::Deque() + { + iPrev->iNext = iNext; + iNext->iPrev = iPrev; + } + +void TMediaRequest::AddBefore(TMediaRequest* x) + { + x->iPrev->iNext = this; + iPrev = x->iPrev; + iNext = x; + x->iPrev = this; + } + +#ifdef _DEBUG + + /** + * Checks the linked list for consistency. + */ + void TRequestDeltaQue::DbgCheck() const + { + if(iCount == 0) + { + __ASSERT_DEBUG(iHead == NULL, Panic(ERequestQueueCorrupt)); + } + else + { + TMediaRequest* last = iHead; + TInt index = iCount - 1; + while(index-- > 0) + { + TMediaRequest* current = last->iNext; + __ASSERT_DEBUG(current->iPrev == last, Panic(ERequestQueueCorrupt)); + __ASSERT_DEBUG(current->iTriggerWallTime >= last->iTriggerWallTime, Panic(ERequestQueueUnordered)); + last = current; + } + __ASSERT_DEBUG(last->iNext == iHead, Panic(ERequestQueueCorrupt)); + __ASSERT_DEBUG(iHead->iPrev == last, Panic(ERequestQueueCorrupt)); + } + } + +#endif + +#ifdef _OMXIL_COMMON_DEBUG_TRACING_ON + +void TRequestDeltaQue::DbgPrint() const + { + TMediaRequest* x = iHead; + TBuf8<256> msg; + msg.Append(_L8("pending times: ")); + for(TInt index = 0; index < iCount; index++) + { + if(index > 0) + { + msg.Append(_L8(", ")); + } + msg.AppendFormat(_L8("%ld"), x->iTriggerWallTime); + x = x->iNext; + } + DEBUG_PRINTF(msg); + } + +#endif diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilclock/src/clockthreadnotifier.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilclock/src/clockthreadnotifier.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,63 @@ +/* +* 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 "clockthreadnotifier.h" + +_LIT(KClockThreadPanicMsg, "CLOCK-THREAD-NOTIFIER"); + +CClockThreadNotifier* CClockThreadNotifier::NewL(CClockSupervisor* aClockSupervisor) + { + CClockThreadNotifier* self = new(ELeave)CClockThreadNotifier(aClockSupervisor); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +CClockThreadNotifier::CClockThreadNotifier(CClockSupervisor* aClockSupervisor):CActive(CActive::EPriorityStandard) + { + iClockSupervisor = aClockSupervisor; + } +void CClockThreadNotifier::ConstructL() + { + CActiveScheduler::Add(this); + } +void CClockThreadNotifier::RunL() + { + + iClockSupervisor->ReportClockThreadPanic(); + + } +void CClockThreadNotifier::DoCancel() + { + // Do Nothing + } +CClockThreadNotifier::~CClockThreadNotifier() + { + Cancel(); + } +TInt CClockThreadNotifier::RunError(TInt) + { + return KErrNone; + } +void CClockThreadNotifier::IssueRequest() + { + __ASSERT_ALWAYS(!IsActive(), User::Panic(KClockThreadPanicMsg, 0)); + iClockSupervisor->iThread.Logon(iStatus); + SetActive(); + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilclock/src/comxilclockcomponent.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilclock/src/comxilclockcomponent.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,198 @@ +/* +* 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 "omxilincontextcallbackmanager.h" +#include "omxilportmanager.h" +#include "omxilspecversion.h" +#include "omxilfsm.h" +#include +#include + +#include "comxilclockcomponent.h" +#include "comxilclockoutputport.h" +#include "comxilclockprocessingfunction.h" +#include "comxilclockconfigmanager.h" +#include "clockpanics.h" +#include "omxilclock.hrh" + +_LIT8(KSymbianOmxILClockNameDes, KCompNameSymbianOmxILClock); +_LIT8(KSymbianOmxILClockRoleDes, KRoleSymbianOmxILClock); + +OMXIL_COMPONENT_ECOM_ENTRYPOINT(KUidSymbianOmxILClock); + +OMX_ERRORTYPE SymbianErrorToOmx(TInt aError); + +// Component Entry Point +OMX_ERRORTYPE OMX_ComponentInit(OMX_HANDLETYPE aComponent) + { + TInt err = COmxILClockComponent::CreateComponent(aComponent); + return SymbianErrorToOmx(err); + } + +TInt COmxILClockComponent::CreateComponent(OMX_HANDLETYPE hComponent) + { + COmxILClockComponent* self = new COmxILClockComponent(); + + if (!self) + { + return KErrNoMemory; + } + + TRAPD(error, self->ConstructL(hComponent)); + if(error != KErrNone) + { + delete self; + } + return error; + } + +COmxILClockComponent::COmxILClockComponent() + { + // nothing to do + } + +void COmxILClockComponent::ConstructL(OMX_HANDLETYPE hComponent) + { + ipHandle = static_cast(hComponent); + + // use synchronous callback manager since BufferDoneNotifications must be serviced at precise times + ipCallbackManager = COmxILInContextCallbackManager::NewL(ipHandle, ipAppData, ipCallbacks); + + ipProcessingFunction = COmxILClockProcessingFunction::NewL(*ipCallbackManager, *this); + + ipPortManager = COmxILPortManager::NewL( + *ipProcessingFunction, // The component's processing function + *ipCallbackManager, // The call back manager object + TOmxILSpecVersion(), // OMX Version + 0, // The number of audio ports in this component + 0, // The starting audio port index + 0, // The number of image ports in this component + 0, // The starting image port index + 0, // The number of video ports in this component + 0, // The starting video port index + KNumPorts, // The number of other ports in this component + 0, // The starting other port index + OMX_FALSE // Process the time port buffer as usual in port manager + ); + + + RPointerArray roleList; + CleanupClosePushL(roleList); + roleList.AppendL(&KSymbianOmxILClockRoleDes); + COmxILClockConfigManager* configManager = COmxILClockConfigManager::NewL(*ipPortManager, KSymbianOmxILClockNameDes, + TOmxILSpecVersion(), roleList, *(static_cast(ipProcessingFunction))); + ipConfigManager = configManager; + CleanupStack::PopAndDestroy(&roleList); + + for(TInt portIndex = 0; portIndex < KNumPorts; portIndex++) + { + AddPortL(); + } + + ipFsm = COmxILFsm::NewL(*this, *ipProcessingFunction, *ipPortManager, *ipConfigManager, *ipCallbackManager); + + InitComponentL(); + } + +COmxILClockComponent::~COmxILClockComponent() + { + delete ipConfigManager; + delete ipProcessingFunction; + delete ipPortManager; + delete ipFsm; + delete ipCallbackManager; + iPorts.ResetAndDestroy(); + } + +void COmxILClockComponent::AddPortL() + { + TOmxILSpecVersion omxIlVersion; + TOmxILCommonPortData portData( + omxIlVersion, + iPorts.Count(), // port index + OMX_DirOutput, + 4, // minimum number of buffers + sizeof(OMX_TIME_MEDIATIMETYPE), // minimum buffer size, in bytes + OMX_PortDomainOther, + OMX_FALSE, // do not need contigious buffers + 1, // byte alignment + // Clock being buffer supplier allows it to send notifications to clients without + // waiting for clients to pass their buffers after a state transition + OMX_BufferSupplyOutput, + COmxILPort::KBufferMarkPropagationPortNotNeeded + ); + + RArray supportedOtherFormats; + + CleanupClosePushL(supportedOtherFormats); + supportedOtherFormats.AppendL(OMX_OTHER_FormatTime); + + COmxILClockOutputPort* port = COmxILClockOutputPort::NewL(portData, supportedOtherFormats, + *(static_cast(ipProcessingFunction))); + + CleanupStack::PushL(port); + iPorts.AppendL(port); + CleanupStack::Pop(port); + + CleanupStack::PopAndDestroy(&supportedOtherFormats); + User::LeaveIfError(ipPortManager->AddPort(port, OMX_DirOutput)); + } + +/** + * Returns true iff the specified port is currently enabled. + */ +TBool COmxILClockComponent::PortEnabled(TInt aPortIndex) const + { + return iPorts[aPortIndex]->IsEnabled(); + } + +/** + * Returns the number of buffers as configured in the port definition. + */ +TInt COmxILClockComponent::PortBufferCount(TInt aPortIndex) const + { + return iPorts[aPortIndex]->BufferCount(); + } + +OMX_ERRORTYPE SymbianErrorToOmx(TInt aError) + { + switch(aError) + { + case KErrNone: + return OMX_ErrorNone; + case KErrNoMemory: + return OMX_ErrorInsufficientResources; + case KErrArgument: + return OMX_ErrorUnsupportedSetting; + case KErrNotSupported: + return OMX_ErrorUnsupportedIndex; + case KErrNotReady: + return OMX_ErrorIncorrectStateOperation; + default: +#ifdef _DEBUG + // Panic in a debug build. It will make people think about how the error should be handled. + Panic(EUndefinedErrorCode); +#endif + return OMX_ErrorUndefined; + } + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilclock/src/comxilclockconfigmanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilclock/src/comxilclockconfigmanager.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,87 @@ +/* +* 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 "comxilclockconfigmanager.h" +#include "comxilclockprocessingfunction.h" +#include "clocksupervisor.h" + + + +COmxILClockConfigManager* COmxILClockConfigManager::NewL( + MOmxILPortManagerIf& aPortManager, + const TDesC8& aComponentName, + const OMX_VERSIONTYPE& aComponentVersion, + const RPointerArray& aComponentRoleList, + COmxILClockProcessingFunction& aProcessingFunction) + { + COmxILClockConfigManager* self = new(ELeave) COmxILClockConfigManager(aPortManager, aProcessingFunction); + CleanupStack::PushL(self); + self->ConstructL(aComponentName, aComponentVersion, aComponentRoleList); + CleanupStack::Pop(self); + return self; + } + +COmxILClockConfigManager::COmxILClockConfigManager(MOmxILPortManagerIf& aPortManager, COmxILClockProcessingFunction& aProcessingFunction): + COmxILConfigManager(aPortManager), + iProcessingFunction(&aProcessingFunction) + { + // nothing to do + } + +void COmxILClockConfigManager::ConstructL(const TDesC8& aComponentName, + const OMX_VERSIONTYPE& aComponentVersion, + const RPointerArray& aComponentRoleList) + { + COmxILConfigManager::ConstructL(aComponentName, aComponentVersion, aComponentRoleList); + } + +COmxILClockConfigManager::~COmxILClockConfigManager() + { + } + +OMX_ERRORTYPE COmxILClockConfigManager::GetConfig(OMX_INDEXTYPE aConfigIndex, + TAny* apComponentConfigStructure) const + { + OMX_ERRORTYPE error = iProcessingFunction->ProduceRequest(aConfigIndex, CClockSupervisor::EGetConfig, apComponentConfigStructure); + if(error != OMX_ErrorUnsupportedIndex) + { + return error; + } + + // try base class if PF did not support the index + return COmxILConfigManager::GetConfig(aConfigIndex, apComponentConfigStructure); + } + +OMX_ERRORTYPE COmxILClockConfigManager::SetConfig(OMX_INDEXTYPE aConfigIndex, + const TAny* apComponentConfigStructure) + { + OMX_ERRORTYPE error = iProcessingFunction->ProduceRequest(aConfigIndex, CClockSupervisor::ESetConfig, const_cast(apComponentConfigStructure)); + if(error != OMX_ErrorUnsupportedIndex) + { + return error; + } + + // try base class if PF did not support the index + return COmxILConfigManager::SetConfig(aConfigIndex, apComponentConfigStructure); + } + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilclock/src/comxilclockoutputport.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilclock/src/comxilclockoutputport.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,135 @@ +/* +* 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 "comxilclockoutputport.h" +#include "comxilclockprocessingfunction.h" +#include "clockpanics.h" + +COmxILClockOutputPort* COmxILClockOutputPort::NewL(const TOmxILCommonPortData& aCommonPortData, const RArray& aSupportedFormats, COmxILClockProcessingFunction& aProcessingFunction) + { + COmxILClockOutputPort* self = new(ELeave) COmxILClockOutputPort(aCommonPortData, aProcessingFunction); + CleanupStack::PushL(self); + self->ConstructL(aSupportedFormats); + CleanupStack::Pop(self); + return self; + } + +COmxILClockOutputPort::COmxILClockOutputPort(const TOmxILCommonPortData& aCommonPortData, COmxILClockProcessingFunction& aProcessingFunction) : + COmxILOtherPort(aCommonPortData), + iProcessingFunction(&aProcessingFunction) + { + } + +void COmxILClockOutputPort::ConstructL(const RArray& aSupportedFormats) + { + COmxILOtherPort::ConstructL(aSupportedFormats); + } + +COmxILClockOutputPort::~COmxILClockOutputPort() + { + } + +OMX_ERRORTYPE COmxILClockOutputPort::GetLocalOmxParamIndexes(RArray& aIndexArray) const + { + return COmxILOtherPort::GetLocalOmxParamIndexes(aIndexArray); + } + +OMX_ERRORTYPE COmxILClockOutputPort::GetLocalOmxConfigIndexes(RArray& aIndexArray) const + { + OMX_ERRORTYPE omxRetValue = COmxILOtherPort::GetLocalOmxConfigIndexes(aIndexArray); + if (omxRetValue != OMX_ErrorNone) + { + return omxRetValue; + } + + TInt err = aIndexArray.InsertInOrder(OMX_IndexConfigTimeClientStartTime); + // Note that index duplication is OK. + if (err == KErrNone || err == KErrAlreadyExists) + { + err = aIndexArray.InsertInOrder(OMX_IndexConfigTimeMediaTimeRequest); + } + + if (err != KErrNone && err != KErrAlreadyExists) + { + return OMX_ErrorInsufficientResources; + } + + return OMX_ErrorNone; + } + +OMX_ERRORTYPE COmxILClockOutputPort::GetParameter(OMX_INDEXTYPE aParamIndex, + TAny* apComponentParameterStructure) const + { + return COmxILOtherPort::GetParameter(aParamIndex, apComponentParameterStructure); + } + +OMX_ERRORTYPE COmxILClockOutputPort::SetParameter(OMX_INDEXTYPE aParamIndex, + const TAny* apComponentParameterStructure, + TBool& aUpdateProcessingFunction) + { + return COmxILOtherPort::SetParameter(aParamIndex, apComponentParameterStructure, aUpdateProcessingFunction); + } + +OMX_ERRORTYPE COmxILClockOutputPort::GetConfig(OMX_INDEXTYPE aConfigIndex, + TAny* apComponentConfigStructure) const + { + return COmxILOtherPort::GetConfig(aConfigIndex, apComponentConfigStructure); + } + +OMX_ERRORTYPE COmxILClockOutputPort::SetConfig(OMX_INDEXTYPE aConfigIndex, + const TAny* apComponentConfigStructure, + TBool& aUpdateProcessingFunction) + { + OMX_ERRORTYPE error = iProcessingFunction->ProduceRequest(aConfigIndex, CClockSupervisor::ESetConfig, const_cast(apComponentConfigStructure)); + if(error != OMX_ErrorUnsupportedIndex) + { + return error; + } + + // try base class if PF did not support the index + return COmxILOtherPort::SetConfig(aConfigIndex, apComponentConfigStructure, aUpdateProcessingFunction); + } + +OMX_ERRORTYPE COmxILClockOutputPort::SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& /*aPortDefinition*/, + TBool& /*aUpdateProcessingFunction*/) + { + return OMX_ErrorNone; + } + +TBool COmxILClockOutputPort::IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& /*aPortDefinition*/) const + { +#ifdef _DEBUG + // This function only gets called on input ports, but must be implemented because it is pure virtual. + // Panic if this is ever called. + Panic(ECompatibilityCheckOnOutput); +#endif + return ETrue; + } + +/** + * Returns the number of buffers configured in the port definition. + */ +TInt COmxILClockOutputPort::BufferCount() const + { + return iParamPortDefinition.nBufferCountActual; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilclock/src/comxilclockprocessingfunction.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilclock/src/comxilclockprocessingfunction.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,318 @@ +/* +* 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 "omxilutil.h" +#include "comxilclockprocessingfunction.h" +#include "comxilclockcomponent.h" +#include "clocksupervisor.h" +#include "omxilcallbacknotificationif.h" +#include "clockpanics.h" +#include "omxilclock.hrh" + +#include "omxilspecversion.h" + + +OMX_ERRORTYPE SymbianErrorToOmx(TInt aError); + +COmxILClockProcessingFunction* COmxILClockProcessingFunction::NewL(MOmxILCallbackNotificationIf& aCallbacks, + COmxILClockComponent& aComponent) + { + COmxILClockProcessingFunction* self = new (ELeave) COmxILClockProcessingFunction(aCallbacks, aComponent); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +COmxILClockProcessingFunction::COmxILClockProcessingFunction(MOmxILCallbackNotificationIf& aCallbacks, + COmxILClockComponent& aComponent) : + COmxILProcessingFunction(aCallbacks), iComponent(aComponent) + { + } + +void COmxILClockProcessingFunction::ConstructL() + { + iClock = CClockSupervisor::NewL(*this); + iThreadNotifier = CClockThreadNotifier::NewL(iClock); + iThreadNotifier->IssueRequest(); + User::LeaveIfError(iBufferMutex.CreateLocal()); + // create a buffer queue for each port and add it to the iBufferQueues array + for(TInt portIndex = 0; portIndex < KNumPorts; portIndex++) + { + CCirBuf* queue = new(ELeave) CCirBuf(); + CleanupStack::PushL(queue); + iBufferQueues.AppendL(queue); + CleanupStack::Pop(queue); + } + } + +COmxILClockProcessingFunction::~COmxILClockProcessingFunction() + { + delete iClock; + delete iThreadNotifier; + iBufferMutex.Close(); + // empty iBufferQueues and delete any CCirBuf objects + // the CCirBuf objects don't own any buffers they contain, so we don't delete those here + iBufferQueues.ResetAndDestroy(); + } + +OMX_ERRORTYPE COmxILClockProcessingFunction::StateTransitionIndication(COmxILFsm::TStateIndex aNewState) + { + OMX_ERRORTYPE omxError = OMX_ErrorNone; + + switch(aNewState) + { + case COmxILFsm::ESubStateLoadedToIdle: + { + // allocate space for the buffer queues now the buffer count on each port is known + for(TInt portIndex = 0; portIndex < KNumPorts; portIndex++) + { + TInt length = iComponent.PortBufferCount(portIndex); + TRAPD(error, iBufferQueues[portIndex]->SetLengthL(length)); + // error not actually a problem if queue was originally longer than we need + if(error != KErrNone && iBufferQueues[portIndex]->Length() < length) + { + omxError = OMX_ErrorInsufficientResources; + break; + } + } + break; + } + + case COmxILFsm::EStateExecuting: + { + iExecuting = ETrue; + break; + } + + case COmxILFsm::EStateIdle: + { + iExecuting = EFalse; + break; + } + + case COmxILFsm::EStatePause: + { + // NOTE we do not change iExecuting + // The value of iExecuting maintains the direction from which + // Paused was entered (i.e. from Idle or Executing). + // This is because we wan't to know whether buffers are available, + // regardless of whether we are paused or not. + // TODO TBD is there an implicit stopping of the clock (e.g. set scale to 0)? + break; + } + default: + { + break; + } + } + + return omxError; + } + +OMX_ERRORTYPE COmxILClockProcessingFunction::BufferFlushingIndication(TUint32 aPortIndex, + OMX_DIRTYPE /*aDirection*/) + { + __ASSERT_DEBUG(aPortIndex == OMX_ALL || aPortIndex < KNumPorts, Panic(EBufferFlushingInvalidPort)); + + if (aPortIndex == OMX_ALL || aPortIndex < KNumPorts) + { + iBufferMutex.Wait(); + + if (aPortIndex == OMX_ALL) + { + for (TInt portIndex = 0; portIndex < KNumPorts; portIndex++) + { + DoBufferFlushingIndication(portIndex); + } + } + else + { + DoBufferFlushingIndication(aPortIndex); + } + + iBufferMutex.Signal(); + } + + return OMX_ErrorNone; + } + +void COmxILClockProcessingFunction::DoBufferFlushingIndication(TUint32 aPortIndex) + { + CCirBuf& queue = *iBufferQueues[aPortIndex]; + + while(queue.Count() > 0) + { + OMX_BUFFERHEADERTYPE* buffer; + // ignore error, we just checked Count() > 0 and we have the mutex, so a buffer + // should definitely be there + queue.Remove(&buffer); + OMX_ERRORTYPE error = iCallbacks.BufferDoneNotification(buffer, aPortIndex, OMX_DirOutput); + // the callback manager should return OMX_ErrorNone + // the callback manager ignores any error code from the callee component since it is the component's responsibility + // to respond to errors generated internally + __ASSERT_DEBUG(error == OMX_ErrorNone, Panic(ECallbackManagerBufferError)); + } + } + +OMX_ERRORTYPE COmxILClockProcessingFunction::ParamIndication(OMX_INDEXTYPE /*aParamIndex*/, + const TAny* /*apComponentParameterStructure*/) + { + return OMX_ErrorNone; + } + +OMX_ERRORTYPE COmxILClockProcessingFunction::ConfigIndication(OMX_INDEXTYPE /*aConfigIndex*/, + const TAny* /*apComponentConfigStructure*/) + { + return OMX_ErrorNone; + } + +OMX_ERRORTYPE COmxILClockProcessingFunction::BufferIndication(OMX_BUFFERHEADERTYPE* apBufferHeader, + OMX_DIRTYPE /*aDirection*/) + { + // add buffer to the appropriate port queue + + CCirBuf& queue = *iBufferQueues[apBufferHeader->nOutputPortIndex]; + TOmxILUtil::ClearBufferContents(apBufferHeader); + apBufferHeader->nOffset = 0; + iBufferMutex.Wait(); + TInt added = queue.Add(&apBufferHeader); + // don't expect 0 (not added) as total number of buffers is known + __ASSERT_DEBUG(added, Panic(EBufferQueueOverflow)); + + iBufferMutex.Signal(); + return OMX_ErrorNone; + } + +/** + * Finds and removes an item from a CCirBuf. + * NOTE items are NOT guaranteed to be in their original position! + * The queue must be protected from concurrent access when calling this + * function. + * + * @param aQueue queue to modify + * @param aRemoveItem item to remove + * @return ETrue if item was found and removed from the queue, EFalse otherwise. + */ +template +static TBool RemoveFromPool(CCirBuf&aQueue, T aRemoveItem) + { + TInt numItems = aQueue.Count(); + for(TInt index = 0; index < numItems; index++) + { + T item; + TInt removed = aQueue.Remove(&item); // ignore error since queue cannot be empty (numItems > 0) + __ASSERT_DEBUG(removed == 1, Panic(EBufferUnderflow)); + if(item == aRemoveItem) + { + return ETrue; + } + else + { + TInt added = aQueue.Add(&item); // ignore error since always space for 1 item as one has just been removed + __ASSERT_DEBUG(added == 1, Panic(EBufferQueueOverflow)); + } + } + return EFalse; + } + +OMX_BOOL COmxILClockProcessingFunction::BufferRemovalIndication(OMX_BUFFERHEADERTYPE* apBufferHeader, + OMX_DIRTYPE /*aDirection*/) + { + CCirBuf& queue = *iBufferQueues[apBufferHeader->nOutputPortIndex]; + iBufferMutex.Wait(); + // note queue may be reordered, but that's OK since these are empty buffers + TBool removed = RemoveFromPool(queue, apBufferHeader); + iBufferMutex.Signal(); + + return removed ? OMX_TRUE : OMX_FALSE; + } + +/** + * Returns a free buffer from the queue for the specified port. + * If no buffer is ready, this method returns NULL + * This method does not block for a buffer to become available. + */ +OMX_BUFFERHEADERTYPE* COmxILClockProcessingFunction::AcquireBuffer(TInt aPortIndex) + { + CCirBuf& queue = *iBufferQueues[aPortIndex]; + iBufferMutex.Wait(); + OMX_BUFFERHEADERTYPE* buffer; + TInt count = queue.Remove(&buffer); + iBufferMutex.Signal(); + if(count > 0) + { + return buffer; + } + else + { + return NULL; + } + } + +/** + * Sends a buffer out on a port. + */ +void COmxILClockProcessingFunction::SendBuffer(OMX_BUFFERHEADERTYPE* aBuffer) + { + OMX_ERRORTYPE error = iCallbacks.BufferDoneNotification(aBuffer, aBuffer->nOutputPortIndex, OMX_DirOutput); + // the callback manager should return OMX_ErrorNone + // the callback manager ignores any error code from the callee component since it is the component's responsibility + // to respond to errors generated internally + __ASSERT_DEBUG(error == OMX_ErrorNone, Panic(ECallbackManagerBufferError)); + } + +OMX_ERRORTYPE COmxILClockProcessingFunction::ProduceRequest(OMX_INDEXTYPE aIdx, CClockSupervisor::TEntryPoint aEntryPoint, TAny* pComponentConfigStructure) + { + return iClock->ProduceRequest(aIdx, aEntryPoint, pComponentConfigStructure); + } + +/** + * Returns true iff the specified port is currently enabled. + */ +TBool COmxILClockProcessingFunction::PortEnabled(TInt aPortIndex) const + { + return iComponent.PortEnabled(aPortIndex); + } + +TBool COmxILClockProcessingFunction::IsExecuting() const + { + return iExecuting; + } + +/** + * Called when CClockSupervisor encounters a fatal error and needs to transition the + * component to OMX_StateInvalid. + */ +void COmxILClockProcessingFunction::InvalidateComponent() + { + OMX_ERRORTYPE error = iCallbacks.ErrorEventNotification(OMX_ErrorInvalidState); + // the callback manager should return OMX_ErrorNone + // the callback manager ignores any error code from the client since it is the client's responsibility to respond + // to errors generated internally + __ASSERT_DEBUG(error == OMX_ErrorNone, Panic(ECallbackManagerEventError)); + // TODO this sends the invalidated event up to the IL client, but does not alter + // the internal state of the component to reflect being invalid. It seems you need + // access to private, non-exported FsmTransition to do that? + } + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilclock/src/omxilclock.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilclock/src/omxilclock.rss Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,44 @@ +/* +* 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 +#include +#include "omxilclock.hrh" + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = KUidSymbianOmxILClockDll; + interfaces = + { + INTERFACE_INFO + { + interface_uid = KUidOmxILSymbianComponentIf; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KUidSymbianOmxILClock; + version_no = 1; + display_name = KCompNameSymbianOmxILClock; + default_data = KRoleSymbianOmxILClock; + } + }; + } + }; + } + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilgraphicsink/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilgraphicsink/group/bld.inf Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,25 @@ +/* +* 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 +../inc/extensions/omxilsymbianvideographicsinkextensions.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/extensions/omxilsymbianvideographicsinkextensions.h) + +PRJ_MMPFILES +../mmpfiles/omxilgraphicsink.mmp diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilgraphicsink/inc/extensions/omxilsymbianvideographicsinkextensions.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilgraphicsink/inc/extensions/omxilsymbianvideographicsinkextensions.h Fri May 07 16:25:23 2010 +0100 @@ -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 + + +/** + * 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 diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilgraphicsink/mmpfiles/omxilgraphicsink.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilgraphicsink/mmpfiles/omxilgraphicsink.mmp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,51 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "../src/omxilgraphicsink.hrh" + +TARGET omxilgraphicsink.dll +CAPABILITY ALL -TCB +TARGETTYPE PLUGIN +UID 0x10009D8D KUidSymbianOmxILGraphicSinkDll +VENDORID 0x70000001 + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN + +USERINCLUDE ../../../omxilcomponentcommon/src/common + +USERINCLUDE ../src +SOURCEPATH ../src + +SOURCE omxilgraphicsinkpanics.cpp +SOURCE omxilgraphicsink.cpp +SOURCE omxilgraphicsinkvpb0port.cpp +SOURCE omxilgraphicsinkprocessingfunction.cpp + +RESOURCE omxilgraphicsink.rss +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY omxilcomponentcommon.lib +LIBRARY surfaceupdateclient.lib +LIBRARY gdi.lib +LIBRARY ws32.lib +LIBRARY surfacemanager.lib +LIBRARY hal.lib +STATICLIBRARY omxilcomponentif.lib + +//MACRO ILCOMPONENTCONFORMANCE + +SMPSAFE diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilgraphicsink/src/log.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilgraphicsink/src/log.h Fri May 07 16:25:23 2010 +0100 @@ -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 + +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_COMMON_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 aFormat, ...) + { + TTruncateOverflowHandler8 overflowHandler8; + VA_LIST list; + VA_START(list, aFormat); + + TTime now; + now.HomeTime(); + + TBuf8<1024> buffer; + _LIT8(KSwiLogPrefix, "[vidsch] "); + _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 aFormat, ...) + { + TTruncateOverflowHandler16 overflowHandler16; + VA_LIST list; + VA_START(list, aFormat); + + TTime now; + now.HomeTime(); + + TBuf8<256> header; + _LIT8(KSwiLogPrefix, "[vidsch] "); + _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__ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilgraphicsink/src/mmfbuffershared.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilgraphicsink/src/mmfbuffershared.h Fri May 07 16:25:23 2010 +0100 @@ -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 + +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 diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilgraphicsink/src/omxilgraphicsink.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilgraphicsink/src/omxilgraphicsink.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,232 @@ +/* +* 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 "omxilfsm.h" +#include "omxilportmanager.h" +#include "omxilcallbackmanager.h" +#include "omxilconfigmanager.h" +#include "omxilspecversion.h" + +#include "omxilgraphicsink.h" +#include "omxilgraphicsinkvpb0port.h" +#include "omxilgraphicsinkprocessingfunction.h" +#include "omxilgraphicsink.hrh" +#include +#include "log.h" + +_LIT8(KSymbianOMXGraphicSinkComponentName, KCompNameSymbianOMXGraphicSink); +_LIT8(KSymbianOMXGraphicSinkRole, KRoleSymbianOMXGraphicSink); + +const TUint8 COmxILGraphicSink::iComponentVersionMajor; +const TUint8 COmxILGraphicSink::iComponentVersionMinor; +const TUint8 COmxILGraphicSink::iComponentVersionRevision; +const TUint8 COmxILGraphicSink::iComponentVersionStep; + +OMXIL_COMPONENT_ECOM_ENTRYPOINT(KUidSymbianOmxILGraphicSink); + +/** +Component Entry Point +@param aComponent The handle of the component to be initialised. +@return KErrNone if successful; + KErrNoMemory if the driver failed to allocate memory for the new component; + otherwise one of the other system-wide error codes. +*/ +OMX_ERRORTYPE OMX_ComponentInit(OMX_HANDLETYPE aComponent) + { + TInt err = COmxILGraphicSink::CreateComponent(aComponent); + if (err == KErrNone) + { + return OMX_ErrorNone; + } + else + { + // return some problem + return err == KErrNoMemory ? OMX_ErrorInsufficientResources : OMX_ErrorUndefined; + + } + } + +/** +This function creates a new Graphic sink component. +@param aComponent The handle of the component to be created. +@return KErrNone if successful; + KErrNoMemory if the driver failed to allocate memory for the new component; + otherwise one of the other system-wide error codes. +*/ +TInt COmxILGraphicSink::CreateComponent(OMX_HANDLETYPE aComponent) + { + DEBUG_PRINTF(_L8("COmxILGraphicSink::CreateComponent")); + + COmxILGraphicSink* self = new COmxILGraphicSink(); + + if (!self) + { + return KErrNoMemory; + } + + TRAPD(err, self->ConstructL(aComponent)); + + if(err != KErrNone) + { + delete self; + } + + return err; + + } + +/** +Constructor of the class. +*/ +COmxILGraphicSink::COmxILGraphicSink() + { + DEBUG_PRINTF(_L8("COmxILGraphicSink::COmxILGraphicSink +")); + } + +/** +Destructor of the class. +*/ +COmxILGraphicSink::~COmxILGraphicSink() + { + DEBUG_PRINTF(_L8("COmxILGraphicSink::~COmxILGraphicSink +")); + delete ipCallbackManager; + delete ipPortManager; + delete ipConfigManager; + delete ipb0Port; + delete ipFsm; + delete ipGraphicSinkProcessingFunction; + } + +/** +Second phase construction for the component. +@param aHandle The handle of the component to be created. +*/ +void COmxILGraphicSink::ConstructL(OMX_HANDLETYPE aHandle) + { + DEBUG_PRINTF(_L8("COmxILGraphicSink::ConstructL")); + // Initialize the data received from IL Core + ipHandle = static_cast(aHandle); + + // STEP 2: Create the call backs manager... + ipCallbackManager = COmxILCallbackManager::NewL(ipHandle, ipAppData, ipCallbacks); + + // STEP 3: Create the Graphic Sink Processing Function... + ipGraphicSinkProcessingFunction = COmxILGraphicSinkProcessingFunction::NewL(*ipCallbackManager); + + // STEP 4: Create Port manager... + ipPortManager = COmxILPortManager::NewL( + *ipGraphicSinkProcessingFunction, // The component's processing function + *ipCallbackManager, // The call back manager object + TOmxILSpecVersion(), // OMX Version + 0, // The number of audio ports in this component + 0, // The starting audio port index + 0, // The number of image ports in this component + 0, // The starting image port index + 1, // The number of video ports in this component + 0, // The starting video port index + 0, // The number of other ports in this component + 0 // The starting other port index + ); + + ipb0Port = ConstructVPB0PortL(); + + User::LeaveIfError(ipPortManager->AddPort(ipb0Port, OMX_DirInput)); + SetPortToPF(ipb0Port); + // STEP 5: Create the non-port related configuration manager... + RPointerArray componentRoles; + CleanupClosePushL(componentRoles); + componentRoles.AppendL(&KSymbianOMXGraphicSinkRole); + ipConfigManager = COmxILConfigManager::NewL( + *ipPortManager, + KSymbianOMXGraphicSinkComponentName, + TOmxILVersion(iComponentVersionMajor, + iComponentVersionMinor, + iComponentVersionRevision, + iComponentVersionStep), + componentRoles); + + CleanupStack::PopAndDestroy(&componentRoles); + + // STEP 6: Create the FSM object... + ipFsm = COmxILFsm::NewL(*this, *ipGraphicSinkProcessingFunction, *ipPortManager, *ipConfigManager, *ipCallbackManager); + + // And finally, let's get everything started + InitComponentL(); + } + +/** +Create the input port VPB0Port for Graphic sink. +@return A pointer to the VPB0Port to be created. +*/ +COmxILGraphicSinkVPB0Port* COmxILGraphicSink::ConstructVPB0PortL() + { + DEBUG_PRINTF(_L8("COmxILGraphicSink::ConstructVPB0PortL +")); + + OMX_U32 thisPortIndex = 0; + const TUint32 KBufferCountMin = 4; // OMX_U32 + const TUint32 KBufferSizeMin = 1024; // OMX_U32 +#ifndef ILCOMPONENTCONFORMANCE + const TUint32 KBufferAlignment = 2; // OMX_U32 + const OMX_BOOL KBuffersContiguous = OMX_TRUE; +#else + // conformance suite currently doesn't support allocating contiguous or + // beyond byte aligned buffers + const TUint32 KBufferAlignment = 0; // OMX_U32 + const OMX_BOOL KBuffersContiguous = OMX_FALSE; +#endif + // TODO these arrays must left empty, to be removed from the video port constructor + RArray supportedVideoFormats; + RArray supportedColorFormats; + CleanupClosePushL(supportedVideoFormats); + CleanupClosePushL(supportedColorFormats); + + COmxILGraphicSinkVPB0Port* vpb0Port = COmxILGraphicSinkVPB0Port::NewL( + TOmxILCommonPortData( + TOmxILSpecVersion(),// OMX specification version information + thisPortIndex, // Port number the structure applies to + OMX_DirInput, // Direction of this port + KBufferCountMin, // The minimum number of buffers this port requires + KBufferSizeMin, // Minimum size, in bytes, for buffers to be used for this port + OMX_PortDomainVideo,// Domain of the port + KBuffersContiguous, // Buffers contiguous requirement (true or false) + KBufferAlignment, // Buffer aligment requirements + OMX_BufferSupplyInput, // supplier preference when tunneling between two ports + COmxILPort::KBufferMarkPropagationPortNotNeeded + ), + supportedVideoFormats, // Supported video formats + supportedColorFormats, // Supported color formats + *ipGraphicSinkProcessingFunction + ); + + CleanupStack::PopAndDestroy(2, &supportedVideoFormats); + + return vpb0Port; + } + +/* +Set the graphic sink port to the graphic sink processing function, +so the processing function can access the port definition later. + */ +void COmxILGraphicSink::SetPortToPF(COmxILGraphicSinkVPB0Port* aPort) + { + ipGraphicSinkProcessingFunction->iGraphicSinkPort = aPort; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilgraphicsink/src/omxilgraphicsink.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilgraphicsink/src/omxilgraphicsink.h Fri May 07 16:25:23 2010 +0100 @@ -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: +* +*/ + +/** + @file + @internalComponent +*/ + +#ifndef OMXILGRAPHICSINK_H +#define OMXILGRAPHICSINK_H + +#include "omxilcomponent.h" + +class COmxILGraphicSinkVPB0Port; +class COmxILGraphicSinkProcessingFunction; + +/** +OpenMAX IL based graphics sink component class +*/ +class COmxILGraphicSink : public COmxILComponent + { +public: + /** The major version number of component. */ + static const TUint8 iComponentVersionMajor = OMX_VERSION_MAJOR; + /** The minor version number of component. */ + static const TUint8 iComponentVersionMinor = OMX_VERSION_MINOR; + /** The revision version number of component. */ + static const TUint8 iComponentVersionRevision = OMX_VERSION_REVISION; + /** The step version number of component. */ + static const TUint8 iComponentVersionStep = OMX_VERSION_STEP; + +public: + static TInt CreateComponent(OMX_HANDLETYPE aComponent); + ~COmxILGraphicSink(); + +private: + COmxILGraphicSink(); + void ConstructL(OMX_HANDLETYPE aHandle); + + COmxILGraphicSinkVPB0Port* ConstructVPB0PortL(); + void SetPortToPF(COmxILGraphicSinkVPB0Port* aPort); + +private: + /** A pointer to the VPB0Port. The ownership of the VPB0Port lies with this class. */ + COmxILGraphicSinkVPB0Port* ipb0Port; + /** A pointer to the processing function. The ownership of the processing function lies with this class. */ + COmxILGraphicSinkProcessingFunction* ipGraphicSinkProcessingFunction; + }; + +#endif // OMXILGRAPHICSINK_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilgraphicsink/src/omxilgraphicsink.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilgraphicsink/src/omxilgraphicsink.hrh Fri May 07 16:25:23 2010 +0100 @@ -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 + @internalComponent +*/ + +#ifndef OMXILGRAPHICSINK_HRH +#define OMXILGRAPHICSINK_HRH + +#define KUidSymbianOmxILGraphicSinkDll 0x10285E6D +#define KUidSymbianOmxILGraphicSink 0x10285E6E + +#define KCompNameSymbianOMXGraphicSink "OMX.SYMBIAN.VIDEO.GRAPHICSINK" +#define KRoleSymbianOMXGraphicSink "iv_renderer" + +#endif // OMXILGRAPHICSINK_HRH + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilgraphicsink/src/omxilgraphicsink.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilgraphicsink/src/omxilgraphicsink.rss Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,49 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +/** + @file + @internalComponent +*/ + +#include +#include +#include "omxilgraphicsink.hrh" + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = KUidSymbianOmxILGraphicSinkDll; + interfaces = + { + INTERFACE_INFO + { + interface_uid = KUidOmxILSymbianComponentIf; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KUidSymbianOmxILGraphicSink; + version_no = 1; + display_name = KCompNameSymbianOMXGraphicSink; + default_data = KRoleSymbianOMXGraphicSink; + // opaque_data = "0x1027379eVORB P16"; + } + }; + } + }; + } + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilgraphicsink/src/omxilgraphicsinkextensionsindexes.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilgraphicsink/src/omxilgraphicsinkextensionsindexes.h Fri May 07 16:25:23 2010 +0100 @@ -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 +@internalComponent +*/ + +#ifndef OMXILGRAPHICSINKEXTENSIONSINDEXES_H_ +#define OMXILGRAPHICSINKEXTENSIONSINDEXES_H_ + +/* + * Index for the surface configuration extension + */ +#define OMX_NokiaIndexParamGraphicSurfaceConfig 0x7F000011 +#define OMX_SymbianIndexConfigSharedChunkMetadata 0x7F000012 + +#endif //OMXILGRAPHICSINKEXTENSIONSINDEXES_H_ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilgraphicsink/src/omxilgraphicsinkpanics.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilgraphicsink/src/omxilgraphicsinkpanics.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "omxilgraphicsinkpanics.h" +#include + +_LIT(KGraphicSinkPanicCategory, "omxilgraphicsink"); + +/** +Raises a panic. +@param The panic to be raised. +*/ +void Panic(TGraphicSinkPanicCode aCode) + { + User::Panic(KGraphicSinkPanicCategory, aCode); + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilgraphicsink/src/omxilgraphicsinkpanics.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilgraphicsink/src/omxilgraphicsinkpanics.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,33 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +/** + @file + @internalComponent + */ + +#ifndef OMXILGRAPHICSINKPANICS_H_ +#define OMXILGRAPHICSINKPANICS_H_ + +enum TGraphicSinkPanicCode + { + EUndefinedPixelFormat = 0 // pixel format not handled + }; + +void Panic(TGraphicSinkPanicCode aCode); + +#endif /*OMXILGRAPHICSINKPANICS_H_*/ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilgraphicsink/src/omxilgraphicsinkprocessingfunction.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilgraphicsink/src/omxilgraphicsinkprocessingfunction.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,1352 @@ +/* +* 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 "omxilgraphicsinkprocessingfunction.h" +#include "omxilgraphicsinktrace.h" +#include "omxilgraphicsinkpanics.h" +#include "omxilgraphicsinkvpb0port.h" +#include "omxilcallbackmanager.h" +#include +#include +#include "omxilgraphicsinkextensionsindexes.h" +#include + +// Constant numbers +#ifndef __WINSCW__ +const TInt KRefGfxAlignment = RSurfaceManager::EPageAligned; +#else +const TInt KRefGfxAlignment = 2; +#endif +static const TBool KRefGfxContiguous = ETrue; +static const TInt KSurfaceUpdateNumOfMessageSlots = 4; +static const TUint32 KNullTickCount = 0xFFFFFFFF; + + +/** +Create a new processing function object. + +@param aCallbacks The callback manager interface for processing function. + +@return A pointer to the processing function object to be created. +*/ +COmxILGraphicSinkProcessingFunction* +COmxILGraphicSinkProcessingFunction::NewL(MOmxILCallbackNotificationIf& aCallbacks) + { + COmxILGraphicSinkProcessingFunction* self = + new (ELeave)COmxILGraphicSinkProcessingFunction(aCallbacks); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +/** +Second phase construction for the processing function. Loads the device driver for surface manager and initializes the surface attributes. +*/ +void +COmxILGraphicSinkProcessingFunction::ConstructL() + { + iTransitionToPauseWait = new(ELeave) CActiveSchedulerWait(); + User::LeaveIfError(iTransitionToPauseWaitSemaphore.CreateLocal(0)); + + //record the ID of the creator thread for later use + iOwnerThreadId = RThread().Id(); + + iGraphicSurfaceAccess = CGraphicSurfaceAccess::NewL(*this); + iPFHelper = CPFHelper::NewL(*this, *iGraphicSurfaceAccess); + + User::LeaveIfError(iBufferMutex.CreateLocal()); + InitSurfaceAttributes(); + iState = OMX_StateLoaded; + } + +/** +Constructor of the class. + +@param aCallbacks The callback manager interface for processing function. +*/ +COmxILGraphicSinkProcessingFunction::COmxILGraphicSinkProcessingFunction( + MOmxILCallbackNotificationIf& aCallbacks) + : + COmxILProcessingFunction(aCallbacks) + { + HAL::Get(HALData::EFastCounterFrequency,iFastCounterFrequency); + } + +/** +Destructor of the class. +*/ +COmxILGraphicSinkProcessingFunction::~COmxILGraphicSinkProcessingFunction() + { + delete iTransitionToPauseWait; + iTransitionToPauseWaitSemaphore.Close(); + + // Check in case the driver has not been closed. That would happen in + // an scenario where the component is deleted while being in + // OMX_StateExecuting state. + if(iPFHelper && + (iState == OMX_StateInvalid || + iState == OMX_StateExecuting || + iState == OMX_StatePause)) + { + // Ignore error if the following call fails + iPFHelper->StopSync(); + } + + delete iPFHelper; + delete iGraphicSurfaceAccess; + + iSurfaceManager.Close(); + + // Buffer headers are not owned by the processing function + iBuffersToEmpty.Close(); + + iBufferMutex.Close(); + } + +/** +This method provides the state change information within the processing function so that appropriate action can be taken. +This state change information is provided by the FSM on behalf of the IL Client. + +@param aNewState The new state of FSM. + +@return OMX_ErrorNone if successful + OMX_ErrorInsufficientResources if fail to start GraphicSink frame acceptor + OMX_ErrorIncorrectStateTransition if unsupported state + Any other OpenMAX IL wide error code +*/ +OMX_ERRORTYPE +COmxILGraphicSinkProcessingFunction::StateTransitionIndication(COmxILFsm::TStateIndex aNewState) + { + switch(aNewState) + { + case COmxILFsm::EStateExecuting: + { + return iPFHelper->ExecuteAsync(); + } + case COmxILFsm::EStateInvalid: + { + return iPFHelper->StopAsync(); + } + case COmxILFsm::EStatePause: + { + // must be done immediately + OMX_ERRORTYPE omxErr = iPFHelper->Pause(); + if(omxErr == OMX_ErrorNone) + { + WaitForTransitionToPauseToFinish(); + } + return omxErr; + } + case COmxILFsm::EStateIdle: + { + iBufferMutex.Wait(); + iBuffersToEmpty.Reset(); + iBufferMutex.Signal(); + iState = OMX_StateIdle; + return OMX_ErrorNone; + } + case COmxILFsm::EStateLoaded: + case COmxILFsm::EStateWaitForResources: + { + return iPFHelper->StopAsync(); + } + case COmxILFsm::ESubStateLoadedToIdle: + { + // Open a channel to the surface manager logical device driver. + TInt err = iSurfaceManager.Open(); + if ( err != KErrNone) + { + return OMX_ErrorHardware; + } + + if (iPFHelper->OpenDevice() != KErrNone) + { + return OMX_ErrorInsufficientResources; + } + /* + if (iGraphicSinkPort->ValidateStride() != OMX_ErrorNone) + { + return OMX_ErrorUnsupportedSetting; + } + return OMX_ErrorNone; + */ + return iGraphicSinkPort->ValidateStride(); + } + case COmxILFsm::ESubStateIdleToLoaded: + { + return iPFHelper->CloseDevice(); + } + case COmxILFsm::ESubStateExecutingToIdle: + { + // must be done immediately + return iPFHelper->StopAsync(); + } + case COmxILFsm::ESubStatePauseToIdle: + { + // Ignore these transitions... + return OMX_ErrorNone; + } + default: + { + return OMX_ErrorIncorrectStateTransition; + } + }; + } + +/** +Flushes all the buffers retained by the processing function and sends it to either IL Client or the Tunelled component, as the case may be. + +@param aPortIndex Port index used to flush buffers from a given port of the component. +@param aDirection This describes the direction of the port. + +@return OMX_ErrorNone if successful; + Any other OpenMAX IL wide error code; +*/ +OMX_ERRORTYPE +COmxILGraphicSinkProcessingFunction::BufferFlushingIndication( + TUint32 aPortIndex, + OMX_DIRTYPE aDirection) + { + iBufferMutex.Wait(); + if ((aPortIndex == OMX_ALL && aDirection == OMX_DirMax) || + (aPortIndex == 0 && aDirection == OMX_DirInput)) + { + // Send BufferDone notifications for each buffer... + if(iBufferOnScreen != NULL) + { + // TODO error handling + iCallbacks.BufferDoneNotification(iBufferOnScreen, 0, OMX_DirInput); + iBufferOnScreen = NULL; + } + const TUint bufferCount = iBuffersToEmpty.Count(); + OMX_BUFFERHEADERTYPE* pBufferHeader = 0; + for (TUint i=0; inTickCount = KNullTickCount; + iCallbacks. + BufferDoneNotification( + pBufferHeader, + pBufferHeader->nInputPortIndex, + OMX_DirInput + ); + } + // Empty buffer lists... + iBuffersToEmpty.Reset(); + + iBufferMutex.Signal(); + return OMX_ErrorNone; + } + else + { + iBufferMutex.Signal(); + return OMX_ErrorBadParameter; + } + } + +/** +Update the structure corresponding to the given index which belongs to the static parameters list. + +@param aParamIndex The index representing the desired structure to be updated. +@param aComponentParameterStructure A pointer to structure which has the desired settings that will be used to update the Processing function. + +@return OMX_ErrorNone if successful; + OMX_ErrorUnsupportedIndex if unsupported index; + OMX_ErrorUnsupportedSetting if pixel format is EUidPixelFormatUnknown; + Any other OpenMAX IL wide error code; +*/ +OMX_ERRORTYPE +COmxILGraphicSinkProcessingFunction::ParamIndication( + OMX_INDEXTYPE aParamIndex, + const TAny* apComponentParameterStructure) + { + DEBUG_PRINTF(_L8("COmxILGraphicSinkProcessingFunction::PortParamIndication")); + + switch(aParamIndex) + { + case OMX_IndexParamPortDefinition: + { + const OMX_PARAM_PORTDEFINITIONTYPE* portDefinition = static_cast(apComponentParameterStructure); + + // + // All the fields in SurfaceAttribute structure should be updated. + // + iGraphicSurfaceSettings.iSurfaceAttributes.iSize.iWidth = portDefinition->format.video.nFrameWidth; + iGraphicSurfaceSettings.iSurfaceAttributes.iSize.iHeight = portDefinition->format.video.nFrameHeight; + + // Need to convert OMX Color Format to TUidPixelFormat. + TUidPixelFormat pixelFormat = ConvertPixelFormat(portDefinition->format.video.eColorFormat); + if(pixelFormat == EUidPixelFormatUnknown) + { + return OMX_ErrorUnsupportedSetting; + } + else + { + iGraphicSurfaceSettings.iSurfaceAttributes.iPixelFormat = pixelFormat; + } + + iGraphicSurfaceSettings.iSurfaceAttributes.iBuffers = portDefinition->nBufferCountActual; + iGraphicSurfaceSettings.iSurfaceAttributes.iStride = portDefinition->format.video.nStride; + break; + } + case OMX_IndexParamVideoPortFormat: + { + const OMX_VIDEO_PARAM_PORTFORMATTYPE* videoPortFormat = static_cast(apComponentParameterStructure); + + // only OMX_COLOR_FORMATTYPE eColorFormat to be used for SurfaceAttributes.iPixelFormat + TUidPixelFormat pixelFormat = ConvertPixelFormat(videoPortFormat->eColorFormat); + if(pixelFormat == EUidPixelFormatUnknown) + { + return OMX_ErrorUnsupportedSetting; + } + else + { + iGraphicSurfaceSettings.iSurfaceAttributes.iPixelFormat = pixelFormat; + } + break; + } + default: + { + return OMX_ErrorUnsupportedIndex; + } + } + return OMX_ErrorNone; + } + +/** +Update the structure corresponding to the given index which belongs to the dynamic configuration list. + +@param aConfigIndex The index representing the desired structure to be updated. +@param aComponentConfigStructure A pointer to structure which has the desired settings that will be used to update the Processing function. + +@return OMX_ErrorNone if successful; + OMX_ErrorUnsupportedIndex if unsupported index; + OMX_ErrorUnsupportedSetting if SurfaceConfiguration returns error; + Any other OpenMAX IL wide error code; +*/ +OMX_ERRORTYPE +COmxILGraphicSinkProcessingFunction::ConfigIndication(OMX_INDEXTYPE aConfigIndex, + const TAny* apComponentConfigStructure) + { + DEBUG_PRINTF(_L8("COmxILGraphicSinkProcessingFunction::ConfigIndication")); + + TInt err = KErrNone; + + switch(aConfigIndex) + { + case OMX_SymbianIndexConfigSharedChunkMetadata: + { + const OMX_SYMBIAN_CONFIG_SHAREDCHUNKMETADATATYPE* + pSharedChunkMetadata + = static_cast< + const OMX_SYMBIAN_CONFIG_SHAREDCHUNKMETADATATYPE*>( + apComponentConfigStructure); + + iGraphicSurfaceAccess->iSharedChunkHandleId = pSharedChunkMetadata->nHandleId; + iGraphicSurfaceAccess->iSharedChunkThreadId = pSharedChunkMetadata->nOwnerThreadId; + + iGraphicSurfaceAccess->iIsLocalChunk = EFalse; + break; + } + case OMX_IndexConfigCommonScale: + { + const OMX_CONFIG_SCALEFACTORTYPE* scaleFactor = static_cast(apComponentConfigStructure); + + err = iGraphicSurfaceSettings.iSurfaceConfig.SetExtent(TRect(TSize(scaleFactor->xWidth, scaleFactor->xHeight))); + if(err != KErrNone) + { + return OMX_ErrorUnsupportedSetting; + } + + break; + } + case OMX_IndexConfigCommonOutputSize: + { + const OMX_FRAMESIZETYPE* frameSize = static_cast(apComponentConfigStructure); + + err = iGraphicSurfaceSettings.iSurfaceConfig.SetExtent(TRect(TSize(frameSize->nWidth, frameSize->nHeight))); + if(err != KErrNone) + { + return OMX_ErrorUnsupportedSetting; + } + + break; + } + case OMX_IndexConfigCommonInputCrop: + case OMX_IndexConfigCommonOutputCrop: + case OMX_IndexConfigCommonExclusionRect: + { + const OMX_CONFIG_RECTTYPE* rec = static_cast(apComponentConfigStructure); + + err = iGraphicSurfaceSettings.iSurfaceConfig.SetExtent(TRect(TPoint(rec->nTop, rec->nLeft), TSize(rec->nWidth, rec->nHeight))); + if(err != KErrNone) + { + return OMX_ErrorUnsupportedSetting; + } + + break; + } + default: + { + return OMX_ErrorUnsupportedIndex; + } + } + + return OMX_ErrorNone; + } + +void COmxILGraphicSinkProcessingFunction::SetSharedChunkBufConfig(TMMSharedChunkBufConfig aSharedChunkBufConfig) + { + iGraphicSurfaceAccess->iSharedChunkBufConfig = aSharedChunkBufConfig; + } + +void COmxILGraphicSinkProcessingFunction::GetSharedChunkMetadata( + OMX_U32& aHandleId, + OMX_U64& aThreadId) const + { + aHandleId = iGraphicSurfaceAccess->iSharedChunkHandleId; + aThreadId = iGraphicSurfaceAccess->iSharedChunkThreadId; + } + +/** +This method is invoked whenever the component is requested to emtpy/display the contents of the buffers passed as function arguments. + +@param apBufferHeader A pointer to buffer header. +@param aDirection provides the direction either input or output. This can be used as a further check whether buffers received are valid or not. + +@return OMX_ErrorNone if successful; + Any other OpenMAX IL wide error code; +*/ +OMX_ERRORTYPE +COmxILGraphicSinkProcessingFunction::BufferIndication( + OMX_BUFFERHEADERTYPE* apBufferHeader, + OMX_DIRTYPE aDirection) + { + if (aDirection != OMX_DirInput) + { + return OMX_ErrorBadParameter; + } + //The nTickCount is just internal here, stored temporarily. So it is count not time period. + apBufferHeader->nTickCount = User::FastCounter(); + iBufferMutex.Wait(); + OMX_ERRORTYPE ret = OMX_ErrorNone; + if (iBuffersToEmpty.Append(apBufferHeader) != KErrNone) + { + apBufferHeader->nTickCount = KNullTickCount; + ret = OMX_ErrorInsufficientResources; + } + else if (iState != OMX_StateExecuting) + { + // If Component not in an executing state delay processing buffer + ret = OMX_ErrorNone; + } + else if (iPFHelper->BufferIndication() != KErrNone) + { + apBufferHeader->nTickCount = KNullTickCount; + ret = OMX_ErrorInsufficientResources; + } + iBufferMutex.Signal(); + return ret; + } + +/** +This method is used to check whether the required buffer is held by the processing function or not. + +@param apBufferHeader A pointer to buffer header being searched. +@param aDirection provides the direction either input or output. This can be used as a further check whether buffers received are valid or not. + +@return OMX_TRUE if find the buffer; + OMX_FALSE if fail to find the buffer; +*/ +OMX_BOOL +COmxILGraphicSinkProcessingFunction::BufferRemovalIndication( + OMX_BUFFERHEADERTYPE* apBufferHeader, + OMX_DIRTYPE /* aDirection */) + { + TBool headerDeletionResult = ETrue; + + TInt headerIndexInArray = KErrNotFound; + iBufferMutex.Wait(); + if (KErrNotFound != + (headerIndexInArray = + iBuffersToEmpty.Find(apBufferHeader))) + { + iBuffersToEmpty.Remove(headerIndexInArray); + } + else if(iBufferOnScreen == apBufferHeader) + { + iBufferOnScreen = NULL; + } + else + { + headerDeletionResult = EFalse; + } + iBufferMutex.Signal(); + return (headerDeletionResult ? OMX_TRUE : OMX_FALSE); + } + +/** +This method creates COmxILMMBuffer class object. Also creates surface and allocates the chunks based on the number of buffers, +maps the surface in the given process. It also allocates the resources like creating the message queue and other necessary C +class objects. This method gets called when the component acts as buffer supplier. + +@param aPortSpecificBuffer gives the starting address of the specific buffer. +@param aPortPrivate gives the private data which is COmxILMMBuffer pointer in this case. + +@leave OMX_ErrorNone if successful; +@leave OMX_ErrorInsufficientResources if function returns KErrNoMemory; +@leave OMX_ErrorBadParameter if function returns errors except KErrNoMemory; +@leave Any other OpenMAX IL wide error code; +*/ +void COmxILGraphicSinkProcessingFunction::CreateBufferL(OMX_U8*& aPortSpecificBuffer, OMX_PTR& aPortPrivate, OMX_U32 aBufferCountActual) + { + iGraphicSurfaceAccess->CreateBufferL(aPortSpecificBuffer, aPortPrivate, aBufferCountActual); + } + +/** +Destroy MM buffer, close surface, and deallocate other resources like message queue and C class objects. This is called when component +acts as buffer supplier. +@param apPortPrivate gives the private data which is COmxILMMBuffer pointer in this case. +*/ +void COmxILGraphicSinkProcessingFunction::DestroyBuffer(OMX_PTR /*apPortPrivate*/) + { + iGraphicSurfaceAccess->iBufferIdGenerator--; + // to reset surface id in case client requests different settings. + if(iGraphicSurfaceAccess && iGraphicSurfaceAccess->iBufferIdGenerator == 0) + { + iGraphicSurfaceAccess->ResetSurfaceId(); + iGraphicSurfaceAccess->CloseChunk(); + } + } + +/** +Creates the surface by utilizing the buffers passed via application private data. It then maps the surface in the given process. +It also allocates the resources like creating the message queue and other necessary C class objects. This method gets called when +the component acts as non buffer supplier. + +@param apBuffer gives the starting address of the specific buffer. +@param aAppPrivate provides the private data which is COmxILMMBuffer pointer in this case and holds details of buffers already allocated. +@param aBufferCountActual The actual number of buffers. + +@leave OMX_ErrorNone if successful; +@leave OMX_ErrorInsufficientResources if aPortPrivate is null or functions return KErrNoMemory; +@leave OMX_ErrorBadParameter if functions return errors except KErrNoMemory; +@leave Any other OpenMAX IL wide error code; +*/ +void COmxILGraphicSinkProcessingFunction::InitBufferL(OMX_U8* apBuffer, OMX_U32 aBufferCountActual) + { + iGraphicSurfaceAccess->InitBufferL(apBuffer, aBufferCountActual); + } + +/** +Deallocate resources like message queue and C class objects. This is called when component acts as non buffer supplier. +*/ +void COmxILGraphicSinkProcessingFunction::DeInitBuffer() + { + // to reset surface id in case client requests different settings. + if(iGraphicSurfaceAccess) + { + iGraphicSurfaceAccess->ResetSurfaceId(); + iGraphicSurfaceAccess->CloseChunk(); + } + } + +/** +Initialise surface attribute structure. +*/ +void COmxILGraphicSinkProcessingFunction::InitSurfaceAttributes() + { + RSurfaceManager::TSurfaceCreationAttributes* attr = &iGraphicSurfaceSettings.iSurfaceAttributes; + + attr->iAlignment = KRefGfxAlignment; + attr->iContiguous = KRefGfxContiguous;; + attr->iCacheAttrib = RSurfaceManager::ENotCached; + attr->iMappable = ETrue; + } + +TUidPixelFormat COmxILGraphicSinkProcessingFunction::ConvertPixelFormat(OMX_COLOR_FORMATTYPE aColorFormat) + { + switch(aColorFormat) + { + // OMX "Planar" formats not currently supported by GraphicSink since data comes in more than one buffer. + // "PackedPlanar" formats can be added easily provided the GCE backend supports them. + + case OMX_COLOR_Format16bitRGB565: + return EUidPixelFormatRGB_565; + + case OMX_COLOR_Format32bitARGB8888: + return EUidPixelFormatARGB_8888; + + case OMX_COLOR_FormatYCrYCb: + return EUidPixelFormatYUV_422Reversed; + + case OMX_COLOR_FormatCbYCrY: + return EUidPixelFormatYUV_422Interleaved; + + // Need to map color format to Symbian pixel format. + default: + { + return EUidPixelFormatUnknown; + } + } + } + +void COmxILGraphicSinkProcessingFunction::WaitForTransitionToPauseToFinish() + { + if(RThread().Id() == iOwnerThreadId) + { + //if the owner thread is the same thread as the one created the active objects in this processing function + //then we can wait by using CActiveSchedulerWait + DEBUG_PRINTF(_L8("GraphicSinkProcessingFunction::WaitForTransitionToPauseToFinish - blocking transition to pause with active scheduler wait now")); + iTransitionToPauseWait->Start(); + } + else + { + //if this is a thread different from the creator thread then semaphore is needed to block this thread until the transition + //to paused state completes + DEBUG_PRINTF(_L8("GraphicSinkProcessingFunction::WaitForTransitionToPauseToFinish - blocking thread with semaphore now")); + iTransitionToPauseWaitSemaphore.Wait(); + } + } + +void COmxILGraphicSinkProcessingFunction::TransitionToPauseFinished() + { + if(iTransitionToPauseWait->IsStarted()) + { + DEBUG_PRINTF(_L8("GraphicSinkProcessingFunction::TransitionToPauseFinished - unblocking transition to pause (active scheduler wait) now")); + iTransitionToPauseWait->AsyncStop(); + } + else + { + DEBUG_PRINTF(_L8("GraphicSinkProcessingFunction::TransitionToPauseFinished - unblocking transition to pause (semaphore) now")); + iTransitionToPauseWaitSemaphore.Signal(); + } + } + +COmxILGraphicSinkProcessingFunction::CGraphicSurfaceAccess* COmxILGraphicSinkProcessingFunction::CGraphicSurfaceAccess::NewL(COmxILGraphicSinkProcessingFunction& aParent) + { + return new (ELeave) CGraphicSurfaceAccess(aParent); + } + +COmxILGraphicSinkProcessingFunction::CGraphicSurfaceAccess::CGraphicSurfaceAccess(COmxILGraphicSinkProcessingFunction& aParent) +: CActive(EPriorityStandard), + iIsLocalChunk(ETrue), + iParent(aParent) + { + CActiveScheduler::Add(this); + iSurfaceId = TSurfaceId::CreateNullId(); + iOffsetArray.Reset(); + } + +void COmxILGraphicSinkProcessingFunction::CGraphicSurfaceAccess::CloseChunk() + { + if(iChunk.Handle()) + { + iChunk.Close(); + } + } + +COmxILGraphicSinkProcessingFunction::CGraphicSurfaceAccess::~CGraphicSurfaceAccess() + { + Cancel(); + + CloseChunk(); + + if (!iSurfaceId.IsNull()) + { + iParent.SurfaceManager().CloseSurface(iSurfaceId); // ignore the error + } + #ifdef ILCOMPONENTCONFORMANCE + iArrayOffsets.Close(); + #endif + + iOffsetArray.Close(); + iSurfaceUpdateSession.Close(); + + } + +void COmxILGraphicSinkProcessingFunction::CGraphicSurfaceAccess::RunL() + { + // The buffer is not on the list implies that they have already been flushed/spotted + // via BufferFlushingIndication/BufferRemovalIndication + iParent.iBufferMutex.Wait(); + TInt index = iParent.BuffersToEmpty().Find(iCurrentBuffer); + if (KErrNotFound != index) + { + switch(iStatus.Int()) + { + case KErrNone: + { + // Consumed all data completely and setting nFilledLen to zero. + iCurrentBuffer->nFilledLen = 0; + break; + } + case KErrCancel: + default: + { + // Leave actual value of iCurrentBuffer->nFilledLen + DEBUG_PRINTF2(_L8("COmxILGraphicSinkProcessingFunction::CGraphicSurfaceAccess::RunL() err = %d"), iStatus.Int()); + } + }; + + if(iStatus.Int() != KErrNone) + { + iCurrentBuffer->nTickCount = KNullTickCount; + } + else + { + TUint32 currentTickCount = User::FastCounter(); + + // On some hardware boards, tick count decrements as time increases so + // need to check which way the counter is going + if (currentTickCount >= iCurrentBuffer->nTickCount) + { + iCurrentBuffer->nTickCount = (currentTickCount - iCurrentBuffer->nTickCount) / iParent.GetFastCounterFrequency(); + } + else + { + iCurrentBuffer->nTickCount = (iCurrentBuffer->nTickCount - currentTickCount) / iParent.GetFastCounterFrequency(); + } + } + + + if(iCurrentBuffer->nFlags & OMX_BUFFERFLAG_EOS) + { + iParent.GetCallbacks().EventNotification(OMX_EventBufferFlag, iCurrentBuffer->nInputPortIndex, iCurrentBuffer->nFlags, NULL); + } + + iCurrentBuffer->nFilledLen = 0; + iCurrentBuffer->nFlags = 0; + iCurrentBuffer->nOffset = 0; + iCurrentBuffer->nTimeStamp = 0; + + // now sending back to framework.. + if(iParent.iBufferOnScreen != NULL) + { + // TODO error handling + iParent.GetCallbacks().BufferDoneNotification(iParent.iBufferOnScreen, iParent.iBufferOnScreen->nInputPortIndex,OMX_DirInput); + } + iParent.iBufferOnScreen = iCurrentBuffer; + + iParent.BuffersToEmpty().Remove(index); + iCurrentBuffer = NULL; + + // check if any more buffers to be consumed.. + if (ProcessNextBuffer() != KErrNone) + { + iParent.GetCallbacks().ErrorEventNotification(OMX_ErrorInsufficientResources); + } + } + iParent.iBufferMutex.Signal(); + } + +void COmxILGraphicSinkProcessingFunction::CGraphicSurfaceAccess::CreateBufferL(OMX_U8*& aPortSpecificBuffer, OMX_PTR& aPortPrivate, OMX_U32 aBufferCountActual) + { + if(iSurfaceId.IsNull()) + { + // race condition on nBufferCountActual + if(aBufferCountActual != iParent.GraphicSurfaceSettings().iSurfaceAttributes.iBuffers) + { + iParent.GraphicSurfaceSettings().iSurfaceAttributes.iBuffers = aBufferCountActual; + } + + User::LeaveIfError(iParent.SurfaceManager().CreateSurface(iParent.GraphicSurfaceSettings().iSurfaceAttributesBuf, iSurfaceId)); + + RChunk chunk; + CleanupClosePushL(chunk); + User::LeaveIfError(iParent.SurfaceManager().MapSurface(iSurfaceId, chunk)); + + //We need to change the chunk handle to be shared by the whole process. + RThread thread; + CleanupClosePushL(thread); + iChunk.SetHandle(chunk.Handle()); + User::LeaveIfError(iChunk.Duplicate(thread)); + CleanupStack::PopAndDestroy(2, &chunk); + + // for SetConfig(OMX_SYMBIAN_CONFIG_SHARED_CHUNK_METADATA) + iSharedChunkHandleId = iChunk.Handle(); + iSharedChunkThreadId = RThread().Id().Id(); + + switch(iParent.iGraphicSurfaceSettings.iSurfaceAttributes.iPixelFormat) + { + case EUidPixelFormatYUV_422Reversed: + { + // fill buffer 0 with black + TUint32* data = reinterpret_cast(iChunk.Base()); + TInt numPixelPairs = iParent.GraphicSurfaceSettings().iSurfaceAttributes.iStride * iParent.GraphicSurfaceSettings().iSurfaceAttributes.iSize.iHeight / 4; + for(TInt offset = 0; offset < numPixelPairs; offset++) + { + data[offset] = 0x80108010; + } + } + break; + case EUidPixelFormatYUV_422Interleaved: + { + // fill buffer 0 with black + TUint32* data = reinterpret_cast(iChunk.Base()); + TInt numPixelPairs = iParent.GraphicSurfaceSettings().iSurfaceAttributes.iStride * iParent.GraphicSurfaceSettings().iSurfaceAttributes.iSize.iHeight / 4; + for(TInt offset = 0; offset < numPixelPairs; offset++) + { + data[offset] = 0x10801080; + } + } + break; + case EUidPixelFormatRGB_565: + case EUidPixelFormatARGB_8888: + Mem::FillZ(iChunk.Base(), iParent.GraphicSurfaceSettings().iSurfaceAttributes.iStride * iParent.GraphicSurfaceSettings().iSurfaceAttributes.iSize.iHeight); + break; + default: +#ifdef _DEBUG + // Panic in a debug build. It will make people think about how the error should be handled. + Panic(EUndefinedPixelFormat); +#endif + break; + } + + // Now, GFX needs to make sure that TSurfaceConfiguration has valid surface id + // so that IL Client can use RSurfaceManager::SetBackroundSurface() + User::LeaveIfError(iParent.GraphicSurfaceSettings().iSurfaceConfig.SetSurfaceId(iSurfaceId)); + iParent.iCallbacks.EventNotification(OMX_EventPortSettingsChanged, OMX_NokiaIndexParamGraphicSurfaceConfig, 0, NULL); + + chunk.Close(); + #ifdef ILCOMPONENTCONFORMANCE + iIsBufferSupplier = ETrue; + #endif + } + + ASSERT(iChunk.Handle()); + + + RSurfaceManager::TInfoBuf surfaceInfoBuf; + RSurfaceManager::TSurfaceInfoV01& surfaceInfo (surfaceInfoBuf()); + User::LeaveIfError(iParent.SurfaceManager().SurfaceInfo(iSurfaceId, surfaceInfoBuf)); + for (TInt i = 0 ; i < surfaceInfo.iBuffers ; i++) + { + TInt offset = 0; + User::LeaveIfError(iParent.SurfaceManager().GetBufferOffset(iSurfaceId, i, offset)); + + if(iBufferIdGenerator == 0) + { + iOffsetArray.AppendL(offset); + } + } + + aPortSpecificBuffer = iChunk.Base() + iOffsetArray[iBufferIdGenerator]; + aPortPrivate = NULL; + + iBufferIdGenerator++; + } + + +#ifndef ILCOMPONENTCONFORMANCE +void COmxILGraphicSinkProcessingFunction::CGraphicSurfaceAccess::InitBufferL(OMX_U8* apBuffer, OMX_U32 aBufferCountActual) +{ + // open chunk at the beginning + if(iChunk.Handle() == NULL) + { + // only support chunk extension otherwise error + if(iSharedChunkThreadId == NULL || iSharedChunkHandleId == NULL) + { + DEBUG_PRINTF(_L8("COmxILGraphicSinkProcessingFunction::CGraphicSurfaceAccess::InitBufferL handles not valie")); + User::Leave(KErrBadHandle); + } + + // race condition on nBufferCountActual + if(aBufferCountActual != iParent.GraphicSurfaceSettings().iSurfaceAttributes.iBuffers) + { + iParent.GraphicSurfaceSettings().iSurfaceAttributes.iBuffers = aBufferCountActual; + } + + DEBUG_PRINTF2(_L8("COmxILGraphicSinkProcessingFunction::CGraphicSurfaceAccess::InitBufferL iSharedChunkThreadId = %Lu"), iSharedChunkThreadId); + DEBUG_PRINTF2(_L8("COmxILGraphicSinkProcessingFunction::CGraphicSurfaceAccess::InitBufferL iSharedChunkHandleId = %Lu"), iSharedChunkHandleId); + + RThread chunkOwnerThread; + User::LeaveIfError(chunkOwnerThread.Open(TThreadId(iSharedChunkThreadId))); + CleanupClosePushL(chunkOwnerThread); + + iChunk.SetHandle(iSharedChunkHandleId); + User::LeaveIfError(iChunk.Duplicate(chunkOwnerThread)); + CleanupStack::PopAndDestroy(&chunkOwnerThread); + } + + // differ creating surface id with chunk at last call + if(iSurfaceId.IsNull() && (((aBufferCountActual - 1) == iOffsetArray.Count()))) + { + // offsetBetweenBuffer & iBufferSizeInBytes in chunkconfig must be same + TInt offsetBetweenBuffer; + if(aBufferCountActual == 1) // if only one buffer is used, use iBufferSizeInBytes instead.. + { + offsetBetweenBuffer = iSharedChunkBufConfig.iBufferSizeInBytes; + } + else + { + offsetBetweenBuffer = iOffsetArray[1] - iOffsetArray[0]; + } + + DEBUG_PRINTF2(_L8("COmxILGraphicSinkProcessingFunction::CGraphicSurfaceAccess::InitBufferL offsetBetweenBuffer = %d"), offsetBetweenBuffer); + DEBUG_PRINTF2(_L8("COmxILGraphicSinkProcessingFunction::CGraphicSurfaceAccess::InitBufferL iBufferSizeInBytes = %d"), iSharedChunkBufConfig.iBufferSizeInBytes); + + // update surface attributes + iParent.GraphicSurfaceSettings().iSurfaceAttributes.iOffsetBetweenBuffers = offsetBetweenBuffer; + + TInt err = KErrGeneral; + // create surface id with chunk + err = iParent.SurfaceManager().CreateSurface(iParent.GraphicSurfaceSettings().iSurfaceAttributesBuf, iSurfaceId, iChunk); + if(err != KErrNone) + { + DEBUG_PRINTF2(_L8("COmxILGraphicSinkProcessingFunction::CGraphicSurfaceAccess::InitBufferL createsurface err = %d"), err); + User::Leave(err); + } + + // Now, GFX needs to make sure that TSurfaceConfiguration has valid surface id + err = iParent.GraphicSurfaceSettings().iSurfaceConfig.SetSurfaceId(iSurfaceId); + if(err != KErrNone) + { + DEBUG_PRINTF2(_L8("COmxILGraphicSinkProcessingFunction::CGraphicSurfaceAccess::InitBufferL SetSurfaceId err = %d"), err); + User::Leave(err); + } + + RSurfaceManager::TInfoBuf surfaceInfoBuf; + RSurfaceManager::TSurfaceInfoV01& surfaceInfo (surfaceInfoBuf()); + surfaceInfo.iSize = iParent.GraphicSurfaceSettings().iSurfaceAttributes.iSize; + surfaceInfo.iBuffers = iParent.GraphicSurfaceSettings().iSurfaceAttributes.iBuffers; + surfaceInfo.iPixelFormat = iParent.GraphicSurfaceSettings().iSurfaceAttributes.iPixelFormat; + surfaceInfo.iStride = iParent.GraphicSurfaceSettings().iSurfaceAttributes.iStride; + surfaceInfo.iContiguous = iParent.GraphicSurfaceSettings().iSurfaceAttributes.iContiguous; + surfaceInfo.iCacheAttrib = iParent.GraphicSurfaceSettings().iSurfaceAttributes.iCacheAttrib; + surfaceInfo.iMappable = iParent.GraphicSurfaceSettings().iSurfaceAttributes.iMappable; + + err = iParent.SurfaceManager().SurfaceInfo(iSurfaceId, surfaceInfoBuf); + if(err != KErrNone) + { + DEBUG_PRINTF2(_L8("COmxILGraphicSinkProcessingFunction::CGraphicSurfaceAccess::InitBufferL SurfaceInfo err = %d"), err); + User::Leave(err); + } + + // everything is fine and now ready to rock and roll... + iParent.iCallbacks.EventNotification(OMX_EventPortSettingsChanged, OMX_NokiaIndexParamGraphicSurfaceConfig, 0, NULL); + } + + // save offsets + TInt offset = apBuffer - iChunk.Base(); + iOffsetArray.AppendL(offset); + } + +#else + +void COmxILGraphicSinkProcessingFunction::CGraphicSurfaceAccess::InitBufferL(OMX_U8* /*apBuffer*/, OMX_U32 aBufferCountActual) + { + if(iSurfaceId.IsNull()) + { + User::LeaveIfError(iParent.SurfaceManager().CreateSurface(iParent.GraphicSurfaceSettings().iSurfaceAttributesBuf, iSurfaceId)); + + RChunk chunk; + User::LeaveIfError(iParent.SurfaceManager().MapSurface(iSurfaceId, chunk)); + CleanupClosePushL(chunk); + + //We need to change the chunk handle to be shared by the whole process. + RThread thread; + CleanupClosePushL(thread); + iChunk.SetHandle(chunk.Handle()); + User::LeaveIfError(iChunk.Duplicate(thread)); + CleanupStack::PopAndDestroy(2, &chunk); + + // Now, GFX needs to make sure that TSurfaceConfiguration has valid surface id + // so that IL Client can use RSurfaceManager::SetBackroundSurface() + User::LeaveIfError(iParent.GraphicSurfaceSettings().iSurfaceConfig.SetSurfaceId(iSurfaceId)); + iParent.iCallbacks.EventNotification(OMX_EventPortSettingsChanged, OMX_NokiaIndexParamGraphicSurfaceConfig, 0, NULL); + + iIsBufferSupplier = EFalse; + + for(TInt i = 0 ; i < aBufferCountActual ; i++) + { + TInt offset = 0; + User::LeaveIfError(iParent.SurfaceManager().GetBufferOffset(iSurfaceId, i, offset)); + iArrayOffsets.AppendL(offset); + } + } + + } +#endif //ILCOMPONENTCONFORMANCE + +TInt COmxILGraphicSinkProcessingFunction::CGraphicSurfaceAccess::ProcessNextBuffer() + { + __ASSERT_DEBUG(iParent.iBufferMutex.IsHeld(), User::Invariant()); + + TInt err = KErrNone; + + if ((iParent.BuffersToEmpty().Count()>0) && !IsActive() && iParent.State() == OMX_StateExecuting) + { + iCurrentBuffer = iParent.BuffersToEmpty()[0]; + TInt bufferId = KErrNotFound; + + if (iCurrentBuffer->nFilledLen == 0) + { + // Nothing in the buffer so no need to display it. The buffer might have a flag + // that needs processing though. Self complete to keep the state machine running. + iStatus = KRequestPending; + SetActive(); + TRequestStatus* status = &iStatus; + User::RequestComplete(status, KErrNone); + return KErrNone; + } + +#ifdef ILCOMPONENTCONFORMANCE + if (iIsBufferSupplier) + { +#endif + TInt offset = iCurrentBuffer->pBuffer - iChunk.Base(); + bufferId = iOffsetArray.Find(offset); +#ifdef ILCOMPONENTCONFORMANCE + } + else + { + // Copy data from IL Conformance Suite in to Chunk address at specific address. + TPtr8 ptr(iChunk.Base(),iCurrentBuffer->nFilledLen ,iCurrentBuffer->nAllocLen); + ptr.Copy(iCurrentBuffer->pBuffer + iCurrentBuffer->nOffset, iCurrentBuffer->nFilledLen); + // isn't nOffset likely going to be 0? better to map buffer pointer to buffer id directly + bufferId = iArrayOffsets.Find(iCurrentBuffer->nOffset); + // nOffset is not ideal for identifying buffer area since it's likely each buffer header + // will have a unique pBuffer and nOffset == 0. We could calculate buffer ID by finding + // the buffer header on the buffer header array in the port, but this isn't how bufferID + // is calculated in the rest of the code. (we could just store the buffer ID on the + // pInputPortPrivate but we have a habit of trying to export GS specific info into COmxILMMBuffer) + __ASSERT_ALWAYS(bufferId == 0, User::Invariant()); + } +#endif + + if(KErrNotFound == bufferId) + { + // An error here means that the buffer will not be displayed and RunL() will not be + // invoked. However the buffer might have a flag that needs processing. Self complete + // to keep the state machine running. + iStatus = KRequestPending; + SetActive(); + TRequestStatus* status = &iStatus; + User::RequestComplete(status, KErrNotFound); + return KErrNotFound; + } + + // due to COmxMMILBuffer dependency. to be removed + if (iIsLocalChunk) + { + // copy data into local chunk + TPtr8 ptr(iCurrentBuffer->pBuffer,iCurrentBuffer->nFilledLen ,iCurrentBuffer->nAllocLen); + ptr.Copy(iChunk.Base() + offset, iCurrentBuffer->nFilledLen); + } + + iSurfaceUpdateSession.NotifyWhenDisplayed(iStatus, iTimeStamp); + SetActive(); + + err = iSurfaceUpdateSession.SubmitUpdate(KAllScreens, iSurfaceId, bufferId); + if(err) + { + // An error here means that the buffer will not be displayed and RunL() will not be + // invoked. However the buffer might have a flag that needs processing. Self complete + // to keep the state machine running. + iStatus = KRequestPending; + SetActive(); + TRequestStatus* status = &iStatus; + User::RequestComplete(status, err); + } + } + + return err; + } + +void COmxILGraphicSinkProcessingFunction::CGraphicSurfaceAccess::DoCancel() + { + if (iSurfaceUpdateSession.Handle() != KNullHandle) + { + iSurfaceUpdateSession.CancelAllUpdateNotifications(); + } + + iCurrentBuffer = NULL; + } + +TInt COmxILGraphicSinkProcessingFunction::CGraphicSurfaceAccess::OpenDevice() + { + TInt err = iSurfaceUpdateSession.Connect(KSurfaceUpdateNumOfMessageSlots); + + if (err == KErrNotFound || err != KErrNone) + { +#ifdef __WINSCW__ + DEBUG_PRINTF(_L8("Make sure SYMBIAN_GRAPHICS_USE_GCE ON is specified in epoc.ini")); +#else + DEBUG_PRINTF(_L8("Make sure SYMBIAN_GRAPHICS_USE_GCE is defined in ROM build")); +#endif + } + + return err; + } + +void COmxILGraphicSinkProcessingFunction::CGraphicSurfaceAccess::CloseDevice() + { + iSurfaceUpdateSession.CancelAllUpdateNotifications(); + + if (!iSurfaceId.IsNull()) + { + iParent.SurfaceManager().CloseSurface(iSurfaceId); // ignore the error + } + + iSurfaceUpdateSession.Close(); + // RSurface::Open() happened in context of caller. + iParent.SurfaceManager().Close(); + + iOffsetArray.Reset(); + } + +TInt COmxILGraphicSinkProcessingFunction::CGraphicSurfaceAccess::Execute() + { + iParent.SetState(OMX_StateExecuting); + iFirstFrameDisplayed = EFalse; + TInt r = ProcessNextBuffer(); + return r; + } + +TInt COmxILGraphicSinkProcessingFunction::CGraphicSurfaceAccess::Pause() + { + iParent.SetState(OMX_StatePause); + iFirstFrameDisplayed = EFalse; + Cancel(); + iParent.TransitionToPauseFinished(); + return KErrNone; + } + +TInt COmxILGraphicSinkProcessingFunction::CGraphicSurfaceAccess::Stop() + { + if(iParent.State() == OMX_StateExecuting || iParent.State() == OMX_StatePause) + { + // Cancel and flush the device driver + Cancel(); + iParent.SetState(OMX_StateIdle); + iFirstFrameDisplayed = EFalse; + } + return KErrNone; + } + +void COmxILGraphicSinkProcessingFunction::CGraphicSurfaceAccess::ResetSurfaceId() + { + iSurfaceId = TSurfaceId::CreateNullId(); + } + +COmxILGraphicSinkProcessingFunction::CPFHelper* COmxILGraphicSinkProcessingFunction::CPFHelper::NewL(COmxILGraphicSinkProcessingFunction& aParent, CGraphicSurfaceAccess& aGraphicSurfaceAccess) + { + CPFHelper* self = new (ELeave) CPFHelper(aParent, aGraphicSurfaceAccess); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +COmxILGraphicSinkProcessingFunction::CPFHelper::CPFHelper(COmxILGraphicSinkProcessingFunction& aParent, CGraphicSurfaceAccess& aSurfaceAccess) +: CActive(EPriorityUserInput), + iParent(aParent), + iGraphicSurfaceAccess(aSurfaceAccess) + { + CActiveScheduler::Add(this); + } + +void COmxILGraphicSinkProcessingFunction::CPFHelper::ConstructL() + { + User::LeaveIfError(iMsgQueue.CreateLocal(KMaxMsgQueueEntries)); + SetActive(); + iMsgQueue.NotifyDataAvailable(iStatus); + } + +COmxILGraphicSinkProcessingFunction::CPFHelper::~CPFHelper() + { + Cancel(); + iMsgQueue.Close(); + } + +void COmxILGraphicSinkProcessingFunction::CPFHelper::RunL() + { + iParent.iBufferMutex.Wait(); + if (ProcessQueue() != KErrNone) + { + iParent.GetCallbacks().ErrorEventNotification(OMX_ErrorInsufficientResources); + } + + // setup for next callbacks + SetActive(); + iMsgQueue.NotifyDataAvailable(iStatus); + iParent.iBufferMutex.Signal(); + } + +void COmxILGraphicSinkProcessingFunction::CPFHelper::DoCancel() + { + if (iMsgQueue.Handle()) + { + ProcessQueue(); // TODO: ignore the error? + iMsgQueue.CancelDataAvailable(); + } + } + +TInt COmxILGraphicSinkProcessingFunction::CPFHelper::ProcessQueue() + { + TMessageType msg; + TInt err = iMsgQueue.Receive(msg); + while (err == KErrNone) + { + switch (msg) + { + case EOpenDevice: + { + err = iGraphicSurfaceAccess.OpenDevice(); + break; + } + case ECloseDevice: + { + iGraphicSurfaceAccess.CloseDevice(); + break; + } + + case EExecuteCommand: + { + err = iGraphicSurfaceAccess.Execute(); + break; + } + + case EStopCommand: + { + err = iGraphicSurfaceAccess.Stop(); + break; + } + + case EPauseCommand: + { + err = iGraphicSurfaceAccess.Pause(); + break; + } + + case EBufferIndication: + { + // Add buffer to list waiting to process. + // While we could send zero length buffers straight back, this would cause a + // problem if that buffer has a flag on it that needs processing. So we still + // pass them on and the graphics surface access code will not display them. + if (iParent.State() == OMX_StateExecuting || iParent.State() == OMX_StatePause) + { + err = iGraphicSurfaceAccess.ProcessNextBuffer(); + } + break; + } + default: + { + DEBUG_PRINTF2(_L8("\nMsqQue >> %d"),msg); + break; + } + } + + if (err) + { + break; + } + + err = iMsgQueue.Receive(msg); + } + + if ( err == KErrUnderflow) + { + err = KErrNone; + } + + return err; + } + +OMX_ERRORTYPE COmxILGraphicSinkProcessingFunction::CPFHelper::OpenDevice() + { + TMessageType message; + message = EOpenDevice; + return ConvertError(iMsgQueue.Send(message)); + } + +OMX_ERRORTYPE COmxILGraphicSinkProcessingFunction::CPFHelper::CloseDevice() + { + TMessageType message; + message = ECloseDevice; + return ConvertError(iMsgQueue.Send(message)); + } + +OMX_ERRORTYPE COmxILGraphicSinkProcessingFunction::CPFHelper::ExecuteAsync() + { + TMessageType message; + message = EExecuteCommand; + return ConvertError(iMsgQueue.Send(message)); + } + +OMX_ERRORTYPE COmxILGraphicSinkProcessingFunction::CPFHelper::StopAsync() + { + TMessageType message; + message = EStopCommand; + return ConvertError(iMsgQueue.Send(message)); + } + +OMX_ERRORTYPE COmxILGraphicSinkProcessingFunction::CPFHelper::StopSync() + { + // Cancel to process the existing queue before handling this command + if (IsActive()) + { + Cancel(); + } + + TInt err = iGraphicSurfaceAccess.Stop(); + + // setup for next callbacks + SetActive(); + iMsgQueue.NotifyDataAvailable(iStatus); + + return ConvertError(err); + } + +OMX_ERRORTYPE COmxILGraphicSinkProcessingFunction::CPFHelper::Pause() + { + TMessageType message; + message = EPauseCommand; + return ConvertError(iMsgQueue.Send(message)); + } + +OMX_ERRORTYPE COmxILGraphicSinkProcessingFunction::CPFHelper::BufferIndication() + { + TMessageType message; + message = EBufferIndication; + return ConvertError(iMsgQueue.Send(message)); + } + +OMX_ERRORTYPE COmxILGraphicSinkProcessingFunction::CPFHelper::ConvertError(TInt aError) + { + if(aError == KErrNone) + { + return OMX_ErrorNone; + } + else if(aError == KErrOverflow) + { + return OMX_ErrorInsufficientResources; + } + + // default + return OMX_ErrorUndefined; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilgraphicsink/src/omxilgraphicsinkprocessingfunction.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilgraphicsink/src/omxilgraphicsinkprocessingfunction.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,246 @@ +/* +* 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 OMXILGRAPHICSINKPROCESSINGFUNCTION_H +#define OMXILGRAPHICSINKPROCESSINGFUNCTION_H + + +#include "omxilprocessingfunction.h" +#include +#include +#include +#include +#include +#include +#include "mmfbuffershared.h" + + +class COmxILGraphicSinkVPB0Port; +/** +The class for GraphicSink processing functions. This provides the main processing engine behind the graphic sink. +*/ +class COmxILGraphicSinkProcessingFunction : + public COmxILProcessingFunction + { +private: + class TGraphicSurfaceSettings + { + public: + TGraphicSurfaceSettings() : iSurfaceAttributes(iSurfaceAttributesBuf()) {}; + + public: + // Surface configuration + TSurfaceConfiguration iSurfaceConfig; + // A package for surface attribute. + RSurfaceManager::TSurfaceCreationAttributesBuf iSurfaceAttributesBuf; + // A surface attribute. + RSurfaceManager::TSurfaceCreationAttributes& iSurfaceAttributes; + } iGraphicSurfaceSettings; + +public: + static COmxILGraphicSinkProcessingFunction* NewL( + MOmxILCallbackNotificationIf& aCallbacks); + + ~COmxILGraphicSinkProcessingFunction(); + + OMX_ERRORTYPE StateTransitionIndication(COmxILFsm::TStateIndex aNewState); + + OMX_ERRORTYPE BufferFlushingIndication(TUint32 aPortIndex, + OMX_DIRTYPE aDirection); + + OMX_ERRORTYPE ParamIndication(OMX_INDEXTYPE aParamIndex, + const TAny* apComponentParameterStructure); + + OMX_ERRORTYPE ConfigIndication(OMX_INDEXTYPE aConfigIndex, + const TAny* apComponentConfigStructure); + + OMX_ERRORTYPE BufferIndication( + OMX_BUFFERHEADERTYPE* apBufferHeader, + OMX_DIRTYPE aDirection); + + OMX_BOOL BufferRemovalIndication( + OMX_BUFFERHEADERTYPE* apBufferHeader, + OMX_DIRTYPE aDirection); + + void CreateBufferL(OMX_U8*& aPortSpecificBuffer, OMX_PTR& aPortPrivate, OMX_U32 aBufferCountActual); + void DestroyBuffer(OMX_PTR apPortPrivate); + void InitBufferL(OMX_U8* apBuffer, OMX_U32 aBufferCountActual); + void DeInitBuffer(); + void WaitForTransitionToPauseToFinish(); + void TransitionToPauseFinished(); + + TUidPixelFormat ConvertPixelFormat(OMX_COLOR_FORMATTYPE aColorFormat); + + // Access private member (read and write) + inline MOmxILCallbackNotificationIf& GetCallbacks(); + inline TSurfaceConfiguration& GetSurfaceConfiguration(); + inline RPointerArray& BuffersToEmpty(); + inline TGraphicSurfaceSettings& GraphicSurfaceSettings(); + inline OMX_STATETYPE State(); + inline void SetState(OMX_STATETYPE aState); + inline RSurfaceManager& SurfaceManager(); + inline TInt GetFastCounterFrequency(); + + void SetSharedChunkBufConfig(TMMSharedChunkBufConfig aSharedChunkBufConfig); + void GetSharedChunkMetadata(OMX_U32& aHandleId, OMX_U64& aThreadId) const; + +public: + //Not own, just points to related graphic sink port, so set it to public data member. + COmxILGraphicSinkVPB0Port* iGraphicSinkPort; +private: + COmxILGraphicSinkProcessingFunction(MOmxILCallbackNotificationIf& aCallbacks); + void ConstructL(); + + void InitSurfaceAttributes(); + +private: + RPointerArray iBuffersToEmpty; + OMX_BUFFERHEADERTYPE* iBufferOnScreen; + RMutex iBufferMutex; + OMX_STATETYPE iState; + TInt iFastCounterFrequency; + // A surface manager. + RSurfaceManager iSurfaceManager; + TThreadId iOwnerThreadId; + CActiveSchedulerWait* iTransitionToPauseWait; + RSemaphore iTransitionToPauseWaitSemaphore; + + /** + * Mediates access to the RSurfaceUpdateSession. + */ + class CGraphicSurfaceAccess : public CActive + { + public: + static CGraphicSurfaceAccess* NewL(COmxILGraphicSinkProcessingFunction& aParent); + ~CGraphicSurfaceAccess(); + + // from CActive + void RunL(); + void DoCancel(); + + TInt OpenDevice(); + void CloseDevice(); + TInt Execute(); + TInt Pause(); + TInt Stop(); + + void CreateBufferL(OMX_U8*& aPortSpecificBuffer, OMX_PTR& aPortPrivate, OMX_U32 aBufferCountActual); + void InitBufferL(OMX_U8* apBuffer, OMX_U32 aBufferCountActual); + + TInt ProcessNextBuffer(); + + void ResetSurfaceId(); + void CloseChunk(); + + public: + TInt iSharedChunkHandleId; + TUint64 iSharedChunkThreadId; + TMMSharedChunkBufConfig iSharedChunkBufConfig; + TBool iIsLocalChunk; + + private: + CGraphicSurfaceAccess(COmxILGraphicSinkProcessingFunction& aParent); + + public: + TInt iBufferIdGenerator; + + private: + OMX_BUFFERHEADERTYPE* iCurrentBuffer; + COmxILGraphicSinkProcessingFunction& iParent; + + // Memory chunk + RChunk iChunk; + + #ifdef ILCOMPONENTCONFORMANCE + // These are added for the ILComponentConformance Suite + // Handles copy of data in case of Non-buffer supplier, while running IL Component conformance suite + TBool iIsBufferSupplier; + // Conformance suite does not handle chunks therefore offsets from base chunk address are held in this array + RArray iArrayOffsets; + #endif + + // Surface Id + TSurfaceId iSurfaceId; + // A surface update session. + RSurfaceUpdateSession iSurfaceUpdateSession; + // Time stamp of the display notification event + TTimeStamp iTimeStamp; + // An indicator for first frame displayed + TBool iFirstFrameDisplayed; + + RArray iOffsetArray; + + } *iGraphicSurfaceAccess; + + /** + * Serializes operations into the 'main' thread hosting the Active Scheduler. + */ + class CPFHelper : public CActive + { + public: + static CPFHelper* NewL(COmxILGraphicSinkProcessingFunction& aParent, CGraphicSurfaceAccess& aGraphicSurfaceAccess); + ~CPFHelper(); + + // from CActive + void RunL(); + void DoCancel(); + + OMX_ERRORTYPE OpenDevice(); + OMX_ERRORTYPE CloseDevice(); + OMX_ERRORTYPE ExecuteAsync(); + OMX_ERRORTYPE StopAsync(); + OMX_ERRORTYPE StopSync(); + OMX_ERRORTYPE Pause(); + OMX_ERRORTYPE BufferIndication(); + + enum TMessageType + { + EOpenDevice, + ECloseDevice, + EExecuteCommand, + EStopCommand, + EPauseCommand, + EBufferIndication + }; + + RMsgQueue iMsgQueue; + + private: + CPFHelper(COmxILGraphicSinkProcessingFunction& aParent, CGraphicSurfaceAccess& aGraphicSurfaceAccess); + void ConstructL(); + + TInt ProcessQueue(); + + OMX_ERRORTYPE ConvertError(TInt aError); + + private: + static const TInt KMaxMsgQueueEntries = 25; + + COmxILGraphicSinkProcessingFunction& iParent; + CGraphicSurfaceAccess& iGraphicSurfaceAccess; + } *iPFHelper; + }; + +#include "omxilgraphicsinkprocessingfunction.inl" + +#endif // OMXILGRAPHICSINKPROCESSINGFUNCTION_H + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilgraphicsink/src/omxilgraphicsinkprocessingfunction.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilgraphicsink/src/omxilgraphicsinkprocessingfunction.inl Fri May 07 16:25:23 2010 +0100 @@ -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 +*/ + +inline MOmxILCallbackNotificationIf& COmxILGraphicSinkProcessingFunction::GetCallbacks() + { + return iCallbacks; + } + +inline TSurfaceConfiguration& COmxILGraphicSinkProcessingFunction::GetSurfaceConfiguration() + { + return iGraphicSurfaceSettings.iSurfaceConfig; + } + +inline RPointerArray& COmxILGraphicSinkProcessingFunction::BuffersToEmpty() + { + return iBuffersToEmpty; + } + +inline COmxILGraphicSinkProcessingFunction::TGraphicSurfaceSettings& COmxILGraphicSinkProcessingFunction::GraphicSurfaceSettings() + { + return iGraphicSurfaceSettings; + } + +inline OMX_STATETYPE COmxILGraphicSinkProcessingFunction::State() + { + return iState; + } + +inline void COmxILGraphicSinkProcessingFunction::SetState(OMX_STATETYPE aState) + { + iState = aState; + } + + +inline TInt COmxILGraphicSinkProcessingFunction::GetFastCounterFrequency() + { + return iFastCounterFrequency; + } + +inline RSurfaceManager& COmxILGraphicSinkProcessingFunction::SurfaceManager() + { + return iSurfaceManager; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilgraphicsink/src/omxilgraphicsinktrace.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilgraphicsink/src/omxilgraphicsinktrace.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,44 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +/** + @file + @internalComponent +*/ + +#ifndef OMXILGRAPHICSINKTRACE_H__ +#define OMXILGRAPHICSINKTRACE_H__ + +#ifdef SYMBIAN_MULTIMEDIA_TURN_TIMING_TRACING_ON + +#include + +/* + * Simple logging macro + * + * identifier - select from enum TTestTraceIdentifier + * + * */ +#define GRAPHICSINK_PERFORMANCE_TIMESTAMP_TRACE(identifier) TUTrace::PrintfPrimary(KTestTraceFilterId, 0, 0, "VPT %x", identifier) + +#else + +#define GRAPHICSINK_PERFORMANCE_TIMESTAMP_TRACE(identifier) + +#endif + +#endif // OMXILGRAPHICSINKTRACE_H__ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilgraphicsink/src/omxilgraphicsinkvpb0port.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilgraphicsink/src/omxilgraphicsinkvpb0port.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,868 @@ +/* +* 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 +#include "omxilgraphicsinkvpb0port.h" +#include "omxilcallbackmanager.h" +#include +#include +#include +#include "log.h" + +#include "omxilgraphicsinkextensionsindexes.h" + +// Port definition mime type. Mime type is not relevant for uncompressed video frames +_LIT8(KMimeType, ""); + +// Constant numbers +static const TUint32 KRefGfxFramerate = 0; // mandatory +static const TUint32 KRefGfxMinBufferSize = 1024; + +/** +Create a new VPB0 port. + +@param aCommonPortData The common information of the new VPB0 port. + aSupportedVideoFormats The list of the supported video formats. + aSupportedColorFormats The list of the supported color formats. + aGraphicSinkPF The processing function for the VPB0 port. + +@return A pointer of the VPB0Port to be created. +*/ +COmxILGraphicSinkVPB0Port* COmxILGraphicSinkVPB0Port::NewL( + const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedVideoFormats, + const RArray& aSupportedColorFormats, + COmxILGraphicSinkProcessingFunction& aGraphicSinkPF) + { + DEBUG_PRINTF(_L8("COmxILGraphicSinkVPB0Port::NewL +")); + COmxILGraphicSinkVPB0Port* self = new (ELeave)COmxILGraphicSinkVPB0Port( + aCommonPortData, + aSupportedVideoFormats, + aSupportedColorFormats, + aGraphicSinkPF); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +/** +Second phase construction for the class COmxILGraphicSinkVPB0Port. Initializes the param structures and config structures for GraphicSink port. +Also appends the supported color and video formats to the respective arrays. +*/ +void COmxILGraphicSinkVPB0Port::ConstructL() + { + DEBUG_PRINTF(_L8("COmxILGraphicSinkVPB0Port::ConstructL +")); + + iParamPortDefinition.eDomain = OMX_PortDomainVideo; + + iMimeTypeBuf.CreateL(KMimeType(), KMimeType().Length() + 1); + TUint8* pTUint = const_cast(iMimeTypeBuf.PtrZ()); + iParamPortDefinition.format.video.cMIMEType = reinterpret_cast(pTUint); + iParamPortDefinition.format.video.pNativeRender = NULL; + iParamPortDefinition.format.video.pNativeWindow = NULL; + + iParamPortDefinition.nBufferSize = KRefGfxMinBufferSize; + + iSupportedVideoFormats.AppendL(OMX_VIDEO_CodingUnused); + iSupportedColorFormats.AppendL(OMX_COLOR_FormatCbYCrY); + iSupportedColorFormats.AppendL(OMX_COLOR_FormatYCrYCb); + iSupportedColorFormats.AppendL(OMX_COLOR_Format16bitRGB565); + iSupportedColorFormats.AppendL(OMX_COLOR_Format32bitARGB8888); + + InitParamsAndConfigs(); + + iSharedChunkMetadataExtensionIndex = OMX_IndexComponentStartUnused; + } + +/** +Constructor of the class. + +@param aCommonPortData The common information of the new VPB0 port. + aSupportedVideoFormats The list of the supported video formats. + aSupportedColorFormats The list of the supported color formats. + aGraphicSinkPF The processing function for the VPB0 port. +*/ +COmxILGraphicSinkVPB0Port::COmxILGraphicSinkVPB0Port( + const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedVideoFormats, + const RArray& aSupportedColorFormats, + COmxILGraphicSinkProcessingFunction& aGraphicSinkPF) + :COmxILVideoPort(aCommonPortData, aSupportedVideoFormats,aSupportedColorFormats), + iGraphicSinkPF(aGraphicSinkPF) + { + DEBUG_PRINTF(_L8("COmxILGraphicSinkVPB0Port::COmxILGraphicSinkVPB0Port +")); + } + +/** +Destructor of the class. +*/ +COmxILGraphicSinkVPB0Port::~COmxILGraphicSinkVPB0Port() + { + DEBUG_PRINTF(_L8("COmxILGraphicSinkVPB0Port::~COmxILGraphicSinkVPB0Port +")); + + CleanUpPort(); + iMimeTypeBuf.Close(); + } + +/** +Sets the format field available as part of OMX_PARAM_PORTDEFINITIONTYPE. + +@param aPortDefinition structure containing the format field to be updated. + aUpdateProcessingFunction indicates whether or not processing function needs to be updated. + +@return OMX_ErrorNone if successful; + OMX_ErrorBadParameter if both compression format and color format are unused at the same time, or nStride is invalid; + OMX_ErrorUnsupportedSetting if unsupported compression format and color format, or bitrate is non-zero; +*/ +OMX_ERRORTYPE COmxILGraphicSinkVPB0Port::SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition,TBool& aUpdateProcessingFunction) + { + DEBUG_PRINTF(_L8("COmxILGraphicSinkVPB0Port::SetFormatInPortDefinition +")); + + // Check settings in input OMX_PARAM_PORTDEFINITIONTYPE. + if (!UpdateColorFormat(iParamPortDefinition.format.video.eColorFormat, aPortDefinition.format.video.eColorFormat, aUpdateProcessingFunction)) + { + return OMX_ErrorUnsupportedSetting; + } + + if (!UpdateCodingType(iParamPortDefinition.format.video.eCompressionFormat, aPortDefinition.format.video.eCompressionFormat, aUpdateProcessingFunction)) + { + return OMX_ErrorUnsupportedSetting; + } + + if(iParamPortDefinition.format.video.nStride != aPortDefinition.format.video.nStride) + { + // nStride shall not be 0x0 + if(0x0 == aPortDefinition.format.video.nStride) + { + return OMX_ErrorBadParameter; + } + + iParamPortDefinition.format.video.nStride = aPortDefinition.format.video.nStride; + aUpdateProcessingFunction = ETrue; + } + + if (iParamPortDefinition.format.video.nFrameWidth != aPortDefinition.format.video.nFrameWidth || + iParamPortDefinition.format.video.nFrameHeight != aPortDefinition.format.video.nFrameHeight || + iParamPortDefinition.format.video.nBitrate != aPortDefinition.format.video.nBitrate) + { + iParamPortDefinition.format.video.nFrameWidth = aPortDefinition.format.video.nFrameWidth; + iParamPortDefinition.format.video.nFrameHeight = aPortDefinition.format.video.nFrameHeight; + // nSliceHeight is a RO attribute. Policy is to set it to the frame height + iParamPortDefinition.format.video.nSliceHeight = aPortDefinition.format.video.nFrameHeight; + iParamPortDefinition.format.video.nBitrate = aPortDefinition.format.video.nBitrate; + aUpdateProcessingFunction = ETrue; + } + return OMX_ErrorNone; + } + +/** +Insert new indices belonging to the static parameter category. + +@param aIndexArray The array of indices for insert. + +@return OMX_ErrorNone if successful; + OMX_ErrorInsufficientResources if fail to insert indexes; +*/ +OMX_ERRORTYPE COmxILGraphicSinkVPB0Port::GetLocalOmxParamIndexes(RArray& aIndexArray) const + { + DEBUG_PRINTF(_L8("COmxILGraphicSinkVPB0Port::GetLocalOmxParamIndexes +")); + + // Always collect param indexes from parents + OMX_ERRORTYPE omxRetValue = COmxILVideoPort::GetLocalOmxParamIndexes(aIndexArray); + + if(OMX_ErrorNone != omxRetValue) + { + return omxRetValue; + } + + TInt err = aIndexArray.InsertInOrder(OMX_NokiaIndexParamGraphicSurfaceConfig); + + // Note that index duplication is OK. + if (KErrNone != err && KErrAlreadyExists != err) + { + return OMX_ErrorInsufficientResources; + } + + return OMX_ErrorNone; + } + +/** +Insert new indices belonging to the dynamic configuration category. + +@param aIndexArray The array of indices for insert. + +@return OMX_ErrorNone if successful; + OMX_ErrorInsufficientResources if fail to insert indexes; +*/ +OMX_ERRORTYPE COmxILGraphicSinkVPB0Port::GetLocalOmxConfigIndexes(RArray& aIndexArray) const + { + DEBUG_PRINTF(_L8("COmxILGraphicSinkVPB0Port::GetLocalOmxConfigIndexes +")); + + // Always collect local indexes from parent + OMX_ERRORTYPE omxRetValue = COmxILVideoPort::GetLocalOmxConfigIndexes(aIndexArray); + if (omxRetValue != OMX_ErrorNone) + { + return omxRetValue; + } + + TInt err = aIndexArray.InsertInOrder(OMX_IndexConfigCommonScale); + // Note that index duplication is OK. + if (err == KErrNone || err == KErrAlreadyExists) + { + err = aIndexArray.InsertInOrder(OMX_IndexConfigCommonOutputSize); + } + + if (err == KErrNone || err == KErrAlreadyExists) + { + err = aIndexArray.InsertInOrder(OMX_IndexConfigCommonInputCrop); + } + + if (err == KErrNone || err == KErrAlreadyExists) + { + err = aIndexArray.InsertInOrder(OMX_IndexConfigCommonOutputCrop); + } + + if (err == KErrNone || err == KErrAlreadyExists) + { + err = aIndexArray.InsertInOrder(OMX_IndexConfigCommonExclusionRect); + } + + if (err == KErrNone || err == KErrAlreadyExists) + { + err = aIndexArray.InsertInOrder(iSharedChunkMetadataExtensionIndex); + } + + if (err != KErrNone && err != KErrAlreadyExists) + { + return OMX_ErrorInsufficientResources; + } + + return OMX_ErrorNone; + } + +/** +This method provides the current values for the parameters present in the structure represented by the given index. + +@param aParamIndex The specific param index for which the current parameter values are required. + apComponentParameterStructure The pointer to the structure which will be updated to provide the current parameter values. + +@return OMX_ErrorNone if successful; + OMX_ErrorNoMore if no more formats; + OMX_ErrorUnsupportedSetting if unsupported setting is passed; +*/ +OMX_ERRORTYPE COmxILGraphicSinkVPB0Port::GetParameter(OMX_INDEXTYPE aParamIndex,TAny* apComponentParameterStructure) const + { + DEBUG_PRINTF(_L8("COmxILGraphicSinkVPB0Port::GetParameter +")); + switch(aParamIndex) + { + case OMX_NokiaIndexParamGraphicSurfaceConfig: + { + OMX_SYMBIAN_VIDEO_PARAM_SURFACECONFIGURATION* videoSurface = static_cast(apComponentParameterStructure); + *videoSurface = iParamVideoSurfaceConfiguration; + break; + } + case OMX_IndexParamVideoPortFormat: + { + OMX_VIDEO_PARAM_PORTFORMATTYPE* compvideoPortFormat = static_cast(apComponentParameterStructure); + + // framerate should be always zero for GFX otherwise unsupported value + if(KRefGfxFramerate != compvideoPortFormat->xFramerate) + { + return OMX_ErrorUnsupportedSetting; + } + + return COmxILVideoPort::GetParameter(aParamIndex,apComponentParameterStructure); + } + default: + { + // Try the parent's indexes + return COmxILVideoPort::GetParameter(aParamIndex,apComponentParameterStructure); + } + }; + + return OMX_ErrorNone; + } + +/** +This method sets the values of the parameters present in the structure represented by the given index. + +@param aParamIndex The specific param index for which the parameter values have to be set. + apComponentParameterStructure The pointer to the structure which will provide the desired parameter values to be set. + aUpdateProcessingFunction informs whether the processing fucntion needs to be updated. + +@return OMX_ErrorNone if successful; + OMX_ErrorUnsupportedSetting if non-zero framerate value; + OMX_ErrorUnsupportedIndex if request OMX_NokiaIndexParamGraphicSurfaceConfig index; +*/ +OMX_ERRORTYPE COmxILGraphicSinkVPB0Port::SetParameter(OMX_INDEXTYPE aParamIndex,const TAny* apComponentParameterStructure, TBool& aUpdateProcessingFunction) + { + DEBUG_PRINTF(_L8("COmxILGraphicSinkVPB0Port::SetParameter +")); + + OMX_ERRORTYPE error = OMX_ErrorNone; + switch(aParamIndex) + { + case OMX_IndexParamVideoPortFormat: + { + const OMX_VIDEO_PARAM_PORTFORMATTYPE *componentParameterStructure = static_cast(apComponentParameterStructure); + + if (iParamPortDefinition.format.video.xFramerate != componentParameterStructure->xFramerate) + { + if (0 != componentParameterStructure->xFramerate) + { + // Known Frame rate is not supported. framerate should be always zero + return OMX_ErrorUnsupportedSetting; + } + } + + error = COmxILVideoPort::SetParameter(aParamIndex, apComponentParameterStructure, aUpdateProcessingFunction); + if(error != OMX_ErrorNone) + { + return error; + } + + if(aUpdateProcessingFunction) + { + // eColorFormat and/or eCompressionFormat and/or xFramerate is/are changed by OMX_IndexParamVideoPortFormat + // Hence change same varibles associated to index OMX_IndexParamPortDefinition. + // Update their value in OMX_PARAM_PORTDEFINITIONTYPE. + UpdateParamInPortDefinitionStruct(); + return OMX_ErrorNone; + } + + break; + } + case OMX_NokiaIndexParamGraphicSurfaceConfig: + { + // IL Client can only query OMX_GetParameter with this index but can not set any value on TSurfaceConfiguration + // GFX simply returns OMX_ErrorUnsupportedIndex for the attempt on OMX_GetParameter with this index. + return OMX_ErrorUnsupportedIndex; + } + default: + { + // Try the parent's indexes + return COmxILVideoPort::SetParameter(aParamIndex, apComponentParameterStructure, aUpdateProcessingFunction); + } + }; + return error; + } + +/** +This method provides the current values for the configurations present in the structure represented by the given index. + +@param aConfigIndex The specific configuration index for which the current configuration values are required. + apComponentConfigStructure The pointer to the structure which will be updated to provide the current configuration values. + +@return OMX_ErrorNone if successful; + OMX_ErrorUnsupportedIndex if request non-inserted config index; +*/ +OMX_ERRORTYPE COmxILGraphicSinkVPB0Port::GetConfig(OMX_INDEXTYPE aConfigIndex,TAny* apComponentParameterStructure) const + { + DEBUG_PRINTF(_L8("COmxILGraphicSinkVPB0Port::GetConfig +")); + switch(aConfigIndex) + { + case OMX_SymbianIndexConfigSharedChunkMetadata: + { + OMX_SYMBIAN_CONFIG_SHAREDCHUNKMETADATATYPE* + pSharedChunkMetadata + = static_cast< + OMX_SYMBIAN_CONFIG_SHAREDCHUNKMETADATATYPE*>(apComponentParameterStructure); + + iGraphicSinkPF.GetSharedChunkMetadata( + pSharedChunkMetadata->nHandleId, + pSharedChunkMetadata->nOwnerThreadId); + } + break; + case OMX_IndexConfigCommonScale: + { + OMX_CONFIG_SCALEFACTORTYPE* scaleFactor = static_cast(apComponentParameterStructure); + *scaleFactor = iConfigScaleFactor; + break; + } + case OMX_IndexConfigCommonOutputSize: + { + OMX_FRAMESIZETYPE* frameSize = static_cast(apComponentParameterStructure); + *frameSize = iConfigFrameSize; + break; + } + case OMX_IndexConfigCommonInputCrop: + case OMX_IndexConfigCommonOutputCrop: + case OMX_IndexConfigCommonExclusionRect: + { + OMX_CONFIG_RECTTYPE* rec = static_cast(apComponentParameterStructure); + *rec = iConfigRec; + break; + } + default: + { + // Try the parent's indexes + return COmxILVideoPort::GetConfig(aConfigIndex,apComponentParameterStructure); + } + }; + + return OMX_ErrorNone; + } + +/** +This method sets the values of the configurations present in the structure represented by the given index. + +@param aConfigIndex The specific configuration index for which the configuration values have to be set. + apComponentConfigStructure The pointer to the structure which will be provide the desired configuration values to be set. + aUpdateProcessingFunction informs whether the processing fucntion needs to be updated. + +@return OMX_ErrorNone if successful; + OMX_ErrorUnsupportedIndex if request OMX_NokiaIndexParamGraphicSurfaceConfig index; +*/ +OMX_ERRORTYPE COmxILGraphicSinkVPB0Port::SetConfig(OMX_INDEXTYPE aConfigIndex,const TAny* apComponentParameterStructure, TBool& aUpdateProcessingFunction) + { + DEBUG_PRINTF(_L8("COmxILGraphicSinkVPB0Port::SetConfig +")); + switch(aConfigIndex) + { + case OMX_SymbianIndexConfigSharedChunkMetadata: + { + aUpdateProcessingFunction = ETrue; + break; + } + case OMX_IndexConfigCommonScale: + { + const OMX_CONFIG_SCALEFACTORTYPE* scaleFactor = static_cast(apComponentParameterStructure); + + if(iConfigScaleFactor.xWidth != scaleFactor->xWidth) + { + iConfigScaleFactor.xWidth = scaleFactor->xWidth; + aUpdateProcessingFunction = ETrue; + } + if(iConfigScaleFactor.xHeight != scaleFactor->xHeight) + { + iConfigScaleFactor.xHeight = scaleFactor->xHeight; + aUpdateProcessingFunction = ETrue; + } + break; + } + case OMX_IndexConfigCommonOutputSize: + { + const OMX_FRAMESIZETYPE* frameSize = static_cast(apComponentParameterStructure); + + if(iConfigFrameSize.nWidth != frameSize->nWidth) + { + iConfigFrameSize.nWidth = frameSize->nWidth; + aUpdateProcessingFunction = ETrue; + } + if(iConfigFrameSize.nHeight != frameSize->nHeight) + { + iConfigFrameSize.nHeight = frameSize->nHeight; + aUpdateProcessingFunction = ETrue; + } + break; + } + case OMX_IndexConfigCommonInputCrop: + case OMX_IndexConfigCommonOutputCrop: + case OMX_IndexConfigCommonExclusionRect: + { + const OMX_CONFIG_RECTTYPE* rec = static_cast(apComponentParameterStructure); + + if(iConfigRec.nTop != rec->nTop) + { + iConfigRec.nTop = rec->nTop; + aUpdateProcessingFunction = ETrue; + } + if(iConfigRec.nLeft != rec->nLeft) + { + iConfigRec.nLeft = rec->nLeft; + aUpdateProcessingFunction = ETrue; + } + if(iConfigRec.nWidth != rec->nWidth) + { + iConfigRec.nWidth = rec->nWidth; + aUpdateProcessingFunction = ETrue; + } + if(iConfigRec.nHeight != rec->nHeight) + { + iConfigRec.nHeight = rec->nHeight; + aUpdateProcessingFunction = ETrue; + } + break; + } + default: + { + // Try the parent's indexes + return COmxILVideoPort::SetConfig(aConfigIndex, apComponentParameterStructure, aUpdateProcessingFunction); + } + }; + + return OMX_ErrorNone; + } + +/** +This method provides the index type represented by the given parameter name. + +@param aParameterName The name of extention parameter to be retrieved. + apIndexType The pointer which will retrieve the required index. + +@return OMX_ErrorNone if successful; + OMX_ErrorUnsupportedIndex if unsupported parameter name is passed; +*/ +OMX_ERRORTYPE COmxILGraphicSinkVPB0Port::GetExtensionIndex(OMX_STRING aParameterName, OMX_INDEXTYPE* apIndexType) const + { + DEBUG_PRINTF(_L8("COmxILGraphicSinkVPB0Port::GetExtensionIndex")); + + TPtrC8 requestedParameterNamePtr(const_cast(reinterpret_cast(aParameterName))); + + // OMX_NokiaIndexParamGraphicSurfaceConfig + TPtrC8 parameterNamePtr(reinterpret_cast(sOmxSymbianGfxSurfaceConfig)); + if (requestedParameterNamePtr == parameterNamePtr) + { + *apIndexType = static_cast(OMX_NokiaIndexParamGraphicSurfaceConfig); + return OMX_ErrorNone; + } + + // OMX_SymbianIndexConfigSharedChunkMetadata + TPtrC8 parameterNamePtr2(reinterpret_cast(OMX_SYMBIAN_INDEX_CONFIG_SHAREDCHUNKMETADATA_NAME)); + if(requestedParameterNamePtr == parameterNamePtr2) + { + *apIndexType = static_cast(iSharedChunkMetadataExtensionIndex); + return OMX_ErrorNone; + } + + *apIndexType = OMX_IndexMax; + + return OMX_ErrorUnsupportedIndex; + } + +/** +Check whether or not the tunnelled ports are compatible. + +@param aPortDefinition The port definition parameters to be checked for compatibility. + +@return EFalse if tunnelled ports' parameters are incompatible; + ETrue otherwise; +*/ +TBool COmxILGraphicSinkVPB0Port::IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const + { + DEBUG_PRINTF(_L8("COmxILGraphicSinkVPB0Port::IsTunnelledPortCompatible +")); + + if(aPortDefinition.eDomain != iParamPortDefinition.eDomain) + { + return EFalse; + } + + if(OMX_VIDEO_CodingUnused != aPortDefinition.format.video.eCompressionFormat) + { + return EFalse; + } + + if (iParamPortDefinition.format.video.eColorFormat != aPortDefinition.format.video.eColorFormat) + { + return EFalse; + } + + if (iParamPortDefinition.format.video.nFrameWidth != aPortDefinition.format.video.nFrameWidth) + { + return EFalse; + } + + if (iParamPortDefinition.format.video.nFrameHeight != aPortDefinition.format.video.nFrameHeight) + { + return EFalse; + } + + if (iParamPortDefinition.format.video.nStride != aPortDefinition.format.video.nStride) + { + return EFalse; + } + + return ETrue; + } + +/** +Allocates buffer, creates surface and updates the surface configuration. + +@param aSizeBytes The size of buffer. + apPortSpecificBuffer The address of buffer. + apPortPrivate The pointer of COmxILMMBuffer. + apAppPrivate Not used (default = 0). + +@return OMX_ErrorNone if successful; + OMX_ErrorInsufficientResources if failed to allocate buffer or update the surface configuration; + OMX_ErrorBadParameter if illegal parameters are passed; + +@see COmxILGraphicSinkProcessingFunction. +*/ +OMX_ERRORTYPE COmxILGraphicSinkVPB0Port::DoBufferAllocation(OMX_U32 /*aSizeBytes*/, OMX_U8*& apPortSpecificBuffer, OMX_PTR& apPortPrivate, OMX_PTR& /*apPlatformPrivate*/, OMX_PTR /* apAppPrivate */) + { + DEBUG_PRINTF(_L8("COmxILGraphicSinkVPB0Port::DoBufferAllocation +")); + + // Create buffers allocated to be used for other components. + TRAPD(error, iGraphicSinkPF.CreateBufferL(apPortSpecificBuffer, apPortPrivate, iParamPortDefinition.nBufferCountActual)); + switch(error) + { + case KErrNone: + break; + case KErrNoMemory: + return OMX_ErrorInsufficientResources; + default: + return OMX_ErrorBadParameter; + }; + + return OMX_ErrorNone; + } + +/** +Utilizes buffer given from allocator component to create surface, and updates the surface configuration. + +@param aSizeBytes The size of buffer. + apPortSpecificBuffer The address of buffer. + apPortPrivate The pointer of COmxILMMBuffer. + apAppPrivate Not used (default = 0). + +@return OMX_ErrorNone if successful; + OMX_ErrorInsufficientResources if failed to utilize buffer or update the surface configuration; + OMX_ErrorBadParameter if illegal parameters are passed; + +@see COmxILGraphicSinkProcessingFunction. +*/ +OMX_ERRORTYPE COmxILGraphicSinkVPB0Port::DoBufferWrapping(OMX_U32 /*aSizeBytes*/, OMX_U8* apBuffer, OMX_PTR& /*apPortPrivate*/, OMX_PTR& /*apPlatformPrivate*/, OMX_PTR /*apAppPrivate*/) + { + DEBUG_PRINTF(_L8("COmxILGraphicSinkVPB0Port::DoBufferWrapping +")); + + // Init buffers given from allocator component. + TRAPD(error, iGraphicSinkPF.InitBufferL(apBuffer, iParamPortDefinition.nBufferCountActual)); + switch(error) + { + case KErrNone: + break; + case KErrNoMemory: + return OMX_ErrorInsufficientResources; + default: + return OMX_ErrorBadParameter; + }; + + return OMX_ErrorNone; + } + +/** +Deallocate buffer and deallocates local resources in the processing function. + +@param apPortSpecificBuffer Not used. + apPortPrivate Not used. + apAppPrivate Not used (default = 0). +*/ +void COmxILGraphicSinkVPB0Port::DoBufferDeallocation(OMX_PTR /*apPortSpecificBuffer*/, OMX_PTR apPortPrivate, OMX_PTR /*apPlatformPrivate*/, OMX_PTR /* apAppPrivate */) + { + DEBUG_PRINTF(_L8("COmxILGraphicSinkVPB0Port::DoBufferDeallocation")); + iGraphicSinkPF.DestroyBuffer(apPortPrivate); + } + +/** +Deinitialise buffer and deallocates local resources in the processing function. + +@param apPortSpecificBuffer Not used. + apPortPrivate Not used. + apAppPrivate Not used (default = 0). +*/ +void COmxILGraphicSinkVPB0Port::DoBufferUnwrapping(OMX_PTR /* apPortSpecificBuffer */, OMX_PTR /* apPortPrivate */, OMX_PTR /*apPlatformPrivate*/, OMX_PTR /* apAppPrivate */) + { + DEBUG_PRINTF(_L8("COmxILGraphicSinkVPB0Port::DoBufferUnwrapping")); + iGraphicSinkPF.DeInitBuffer(); + } + + +/** +Update ParamInPortDefinition struct. +*/ +void COmxILGraphicSinkVPB0Port::UpdateParamInPortDefinitionStruct() + { + // OMX_PARAM_PORTDEFINITION structure needs to be updated with respect to the changes from other OMX_PARAM structures. + iParamPortDefinition.format.video.eColorFormat = iParamVideoPortFormat.eColorFormat; + iParamPortDefinition.format.video.xFramerate = iParamVideoPortFormat.xFramerate; + iParamPortDefinition.format.video.eCompressionFormat = iParamVideoPortFormat.eCompressionFormat; + } + +/** +Initialise all param and config structures for GraphicSink port. +*/ +void COmxILGraphicSinkVPB0Port::InitParamsAndConfigs() + { + // init OMX_SYMBIAN_VIDEO_CONFIG_SURFACECONFIGRATION here + iParamVideoSurfaceConfiguration.nSize = sizeof(OMX_SYMBIAN_VIDEO_PARAM_SURFACECONFIGURATION); + iParamVideoSurfaceConfiguration.nVersion = TOmxILSpecVersion(); + iParamVideoSurfaceConfiguration.nPortIndex = iParamPortDefinition.nPortIndex; + iParamVideoSurfaceConfiguration.pSurfaceConfig = &iGraphicSinkPF.GetSurfaceConfiguration(); + + // init OMX_CONFIG_SCALEFACTORTYPE + iConfigScaleFactor.nSize = sizeof(OMX_CONFIG_SCALEFACTORTYPE); + iConfigScaleFactor.nVersion = TOmxILSpecVersion(); + iConfigScaleFactor.nPortIndex = iParamPortDefinition.nPortIndex; + + // init OMX_FRAMESIZETYPE + iConfigFrameSize.nSize = sizeof(OMX_FRAMESIZETYPE); + iConfigFrameSize.nVersion = TOmxILSpecVersion(); + iConfigFrameSize.nPortIndex = iParamPortDefinition.nPortIndex; + + // init OMX_CONFIG_RECTTYPE + iConfigRec.nSize = sizeof(OMX_CONFIG_RECTTYPE); + iConfigRec.nVersion = TOmxILSpecVersion(); + iConfigRec.nPortIndex = iParamPortDefinition.nPortIndex; + iConfigRec.nTop = 0; + iConfigRec.nLeft = 0; + + iSharedChunkBufConfig.iNumBuffers = iParamPortDefinition.nBufferCountActual; + iSharedChunkBufConfig.iBufferSizeInBytes = iParamPortDefinition.nBufferSize; + iGraphicSinkPF.SetSharedChunkBufConfig(iSharedChunkBufConfig); + } + +TInt BytesPerPixel(OMX_COLOR_FORMATTYPE aPixelFormat) + { + switch (aPixelFormat) + { + //fall through + + //case EUidPixelFormatRGB_565: + case OMX_COLOR_Format16bitRGB565: + //case EUidPixelFormatBGR_565: + case OMX_COLOR_Format16bitBGR565: + //case EUidPixelFormatARGB_1555: + case OMX_COLOR_Format16bitARGB1555: + //case EUidPixelFormatXRGB_1555: + //case EUidPixelFormatARGB_4444: + case OMX_COLOR_Format16bitARGB4444: + //case EUidPixelFormatARGB_8332: + case OMX_COLOR_Format8bitRGB332: + //case EUidPixelFormatBGRX_5551: + //case EUidPixelFormatBGRA_5551: + //case EUidPixelFormatBGRA_4444: + //case EUidPixelFormatBGRX_4444: + //case EUidPixelFormatAP_88: + //case EUidPixelFormatXRGB_4444: + //case EUidPixelFormatXBGR_4444: + //case EUidPixelFormatYUV_422Interleaved: + //case EUidPixelFormatYUV_422Planar: + case OMX_COLOR_FormatYUV422Planar: + //case EUidPixelFormatYUV_422Reversed: + case OMX_COLOR_FormatYCrYCb: + //case EUidPixelFormatYUV_422SemiPlanar: + case OMX_COLOR_FormatYUV422SemiPlanar: + //case EUidPixelFormatYUV_422InterleavedReversed: + //case EUidPixelFormatYYUV_422Interleaved: + case OMX_COLOR_FormatCbYCrY: + case OMX_COLOR_FormatYCbYCr: + case OMX_COLOR_FormatRawBayer10bit: + { + return 2; + } + + //fall through + //case EUidPixelFormatXRGB_8888: + //case EUidPixelFormatBGRX_8888: + //case EUidPixelFormatXBGR_8888: + //case EUidPixelFormatBGRA_8888: + case OMX_COLOR_Format32bitBGRA8888: + //case EUidPixelFormatARGB_8888: + case OMX_COLOR_Format32bitARGB8888: + //case EUidPixelFormatABGR_8888: + //case EUidPixelFormatARGB_8888_PRE: + //case EUidPixelFormatABGR_8888_PRE: + //case EUidPixelFormatBGRA_8888_PRE: + //case EUidPixelFormatARGB_2101010: + //case EUidPixelFormatABGR_2101010: + { + return 4; + } + + //fall through + //case EUidPixelFormatBGR_888: + case OMX_COLOR_Format24bitBGR888: + //case EUidPixelFormatRGB_888: + case OMX_COLOR_Format24bitRGB888: + { + return 3; + } + + default: + return 0; + } + } + +/** +Check the nStride value is valid. +*/ +OMX_ERRORTYPE COmxILGraphicSinkVPB0Port::ValidateStride() + { + if (iParamPortDefinition.format.video.nStride < iParamPortDefinition.format.video.nFrameWidth * BytesPerPixel(iParamPortDefinition.format.video.eColorFormat)) + { + return OMX_ErrorBadParameter; + } + return OMX_ErrorNone; + } + +OMX_ERRORTYPE COmxILGraphicSinkVPB0Port::DoOmxUseBuffer( + OMX_HANDLETYPE aTunnelledComponent, + OMX_BUFFERHEADERTYPE** appBufferHdr, + OMX_U32 aTunnelledPortIndex, + OMX_PTR apPortPrivate, + OMX_PTR /* apPlatformPrivate */, + OMX_U32 aSizeBytes, + OMX_U8* apBuffer) + { + + DEBUG_PRINTF2(_L8("COmxILGraphicSinkVPB0Port::DoOmxUseBuffer eBufferSupplier %d"), + iParamCompBufferSupplier.eBufferSupplier); + + // Find out if the tunnelled port has support for the + // OMX.SYMBIAN.INDEX.CONFIG.SHAREDCHUNKMETADATA extension + if (OMX_IndexComponentStartUnused == iSharedChunkMetadataExtensionIndex) + { + if (OMX_ErrorNone == OMX_GetExtensionIndex( + aTunnelledComponent, + const_cast(OMX_SYMBIAN_INDEX_CONFIG_SHAREDCHUNKMETADATA_NAME), + &iSharedChunkMetadataExtensionIndex)) + { + // Communicate the shared chunk metadata to the tunnelled + // component + OMX_SYMBIAN_CONFIG_SHAREDCHUNKMETADATATYPE configSharedChunkMetadata; + configSharedChunkMetadata.nSize = sizeof(OMX_SYMBIAN_CONFIG_SHAREDCHUNKMETADATATYPE); + configSharedChunkMetadata.nVersion = TOmxILSpecVersion(); + configSharedChunkMetadata.nPortIndex = iParamPortDefinition.nPortIndex; + iGraphicSinkPF.GetSharedChunkMetadata( + configSharedChunkMetadata.nHandleId, + configSharedChunkMetadata.nOwnerThreadId); + + // Ignore any error returned by the tunnelled component + (void) OMX_SetConfig(aTunnelledComponent, + iSharedChunkMetadataExtensionIndex, + &configSharedChunkMetadata); + } + else + { + // No support in the tunnelled component. + iSharedChunkMetadataExtensionIndex = OMX_IndexMax; + } + } + + return OMX_UseBuffer( + aTunnelledComponent, + appBufferHdr, + aTunnelledPortIndex, + apPortPrivate, + aSizeBytes, + apBuffer); + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilgraphicsink/src/omxilgraphicsinkvpb0port.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilgraphicsink/src/omxilgraphicsinkvpb0port.h Fri May 07 16:25:23 2010 +0100 @@ -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 + @internalComponent +*/ + +#ifndef OMXILGRAPHICSINKVPB0PORT_H +#define OMXILGRAPHICSINKVPB0PORT_H + +#include "omxilvideoport.h" +#include "omxilgraphicsinkprocessingfunction.h" +#include +#include +#include "mmfbuffershared.h" + +/** +Class COmxILGraphicSinkVPB0Port represents the input port 0 for the OpenMAX IL based graphics sink component. +*/ +class COmxILGraphicSinkVPB0Port : public COmxILVideoPort + { +public: + + static COmxILGraphicSinkVPB0Port* NewL( + const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedVideoFormats, + const RArray& aSupportedColorFormats, + COmxILGraphicSinkProcessingFunction& aGraphicSinkPF); + + ~COmxILGraphicSinkVPB0Port(); + + OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray& aIndexArray) const; + OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray& aIndexArray) const; + + OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex, TAny* apComponentParameterStructure) const; + OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex, const TAny* apComponentParameterStructure, TBool& aUpdateProcessingFunction); + + OMX_ERRORTYPE GetConfig(OMX_INDEXTYPE aConfigIndex, TAny* apComponentConfigStructure) const; + OMX_ERRORTYPE SetConfig(OMX_INDEXTYPE aConfigIndex, const TAny* apComponentConfigStructure, TBool& aUpdateProcessingFunction); + + OMX_ERRORTYPE GetExtensionIndex(OMX_STRING aParameterName, OMX_INDEXTYPE* apIndexType) const; + OMX_ERRORTYPE ValidateStride(); + +private: + + COmxILGraphicSinkVPB0Port( + const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedVideoFormats, + const RArray& aSupportedColorFormats, + COmxILGraphicSinkProcessingFunction& aGraphicSinkPF); + + void ConstructL(); + + OMX_ERRORTYPE SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, TBool& aUpdateProcessingFunction); + + TBool IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const; + + OMX_ERRORTYPE DoBufferAllocation(OMX_U32 aSizeBytes, OMX_U8*& apPortSpecificBuffer, OMX_PTR& apPortPrivate, OMX_PTR& apPlatformPrivate, OMX_PTR apAppPrivate = 0); + void DoBufferDeallocation(OMX_PTR apPortSpecificBuffer, OMX_PTR apPortPrivate, OMX_PTR apPlatformPrivate, OMX_PTR apAppPrivate = 0); + OMX_ERRORTYPE DoBufferWrapping(OMX_U32 aSizeBytes, OMX_U8* apBuffer, OMX_PTR& apPortPrivate, OMX_PTR& apPlatformPrivate, OMX_PTR apAppPrivate = 0); + void DoBufferUnwrapping(OMX_PTR apPortSpecificBuffer, OMX_PTR apPortPrivate, OMX_PTR apPlatformPrivate, OMX_PTR apAppPrivate = 0); + OMX_ERRORTYPE DoOmxUseBuffer(OMX_HANDLETYPE aTunnelledComponent, OMX_BUFFERHEADERTYPE** appBufferHdr, OMX_U32 aTunnelledPortIndex, OMX_PTR apPortPrivate, OMX_PTR apPlatformPrivate, OMX_U32 aSizeBytes, OMX_U8* apBuffer); + + void InitParamsAndConfigs(); + void UpdateParamInPortDefinitionStruct(); + +private: + /** The reference of GraphicSink ProcessingFunction. */ + COmxILGraphicSinkProcessingFunction& iGraphicSinkPF; + /** The type of Mime. */ + RBuf8 iMimeTypeBuf; + + // The scaling size of video or image data. + OMX_CONFIG_SCALEFACTORTYPE iConfigScaleFactor; + // The size of frame. + OMX_FRAMESIZETYPE iConfigFrameSize; + // The size of rectangle. + OMX_CONFIG_RECTTYPE iConfigRec; + + // Extension to provide a structure for Surface Configuration. + OMX_SYMBIAN_VIDEO_PARAM_SURFACECONFIGURATION iParamVideoSurfaceConfiguration; + + TMMSharedChunkBufConfig iSharedChunkBufConfig; + OMX_INDEXTYPE iSharedChunkMetadataExtensionIndex; + }; + +#endif // OMXILGRAPHICSINKVPB0PORT_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilvideoscheduler2/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilvideoscheduler2/group/bld.inf Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,27 @@ +/* +* 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: +* +*/ + + +PRJ_PLATFORMS +BASEDEFAULT + +PRJ_EXPORTS +../inc/omxilvideoscheduler.iby /epoc32/rom/include/omxilvideoscheduler.iby +../inc/omxildroppedframeeventextension.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(openmax/il/extensions/omxildroppedframeeventextension.h) + +PRJ_MMPFILES +../mmpfiles/omxilvideoscheduler.mmp diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilvideoscheduler2/inc/buffercopier.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilvideoscheduler2/inc/buffercopier.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,68 @@ +/* +* 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 BUFFERCOPIER_H_ +#define BUFFERCOPIER_H_ + +#include +#include +#include + +class MBufferCopierIf + { +public: + /** Called when the buffer copier has transferred the data from an input buffer to an output buffer. */ + virtual void MbcBufferCopied(OMX_BUFFERHEADERTYPE* aInBuffer, OMX_BUFFERHEADERTYPE* aOutBuffer) = 0; + /** Called when a buffer is flushed from the buffer copier. */ + virtual void MbcBufferFlushed(OMX_BUFFERHEADERTYPE* aBuffer, OMX_DIRTYPE aDirection) = 0; + }; + +class CBufferCopier : public CActive + { +public: + static CBufferCopier* NewL(MBufferCopierIf& aCallback, TInt aMaxBuffers); + ~CBufferCopier(); + + void DeliverBuffer(OMX_BUFFERHEADERTYPE* aBuffer, OMX_DIRTYPE aDirection); + TBool RemoveBuffer(OMX_BUFFERHEADERTYPE* aBuffer, OMX_DIRTYPE aDirection); + void FlushBuffers(OMX_DIRTYPE aDirection); + +protected: + void RunL(); + void DoCancel(); + +private: + CBufferCopier(MBufferCopierIf& aCallback); + void ConstructL(TInt aMaxBuffers); + + void CopyBuffer(OMX_BUFFERHEADERTYPE* aInBuffer, OMX_BUFFERHEADERTYPE* aOutBuffer); + TBool RemoveFromQueue(RMsgQueue& aQueue, OMX_BUFFERHEADERTYPE* aBufferHeader); + + MBufferCopierIf& iCallback; + RMsgQueue iInQueue; + RMsgQueue iOutQueue; + RMsgQueue iRemoveQueue; + OMX_BUFFERHEADERTYPE* iInBuffer; + }; + +#endif /*BUFFERCOPIER_H_*/ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilvideoscheduler2/inc/buffercopierstatemonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilvideoscheduler2/inc/buffercopierstatemonitor.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,75 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +/** +@file +@internalComponent +*/ +#ifndef BUFFERCOPIERSTATEMONITOR_H_ +#define BUFFERCOPIERSTATEMONITOR_H_ + +#include +#include + +class MBufferCopierIf; +class CBufferCopier; +class COmxILVideoScheduler; + + +class CBufferCopierStateMonitor : public CActive + { +public: + enum TPFState + { + ENull =0, + EExecuting, + EPause, + ESubLoadedToIdle, + ESubIdleToLoaded + }; +public: + static CBufferCopierStateMonitor* NewL(MBufferCopierIf& aCallback, COmxILVideoScheduler& aComponent); + ~CBufferCopierStateMonitor(); + TInt SetState(TPFState aState); + CBufferCopier* BufferCopier(){return iBufferCopier;} + +protected: + void RunL(); + void DoCancel(); + TInt RunError(TInt aError); + +private: + CBufferCopierStateMonitor(MBufferCopierIf& aCallback, COmxILVideoScheduler& aComponent); + void ConstructL(); + TInt DoSetState(); + TInt DoRequest(); + +private: + MBufferCopierIf& iCallback; + COmxILVideoScheduler& iComponent; + TInt iMaxBuffers; + CBufferCopier* iBufferCopier; + TPFState iState; + //Members to make the component thread safe. + TThreadId iConstructionThreadId; + TRequestStatus* iCallingStatus; // not owned + TThreadId iCallingThreadId; + }; + + +#endif /* BUFFERCOPIERSTATEMONITOR_H_ */ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilvideoscheduler2/inc/comxilvideoscheduler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilvideoscheduler2/inc/comxilvideoscheduler.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,59 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +/** +@file +@internalComponent +*/ + +#ifndef COMXILVIDEOSCHEDULER_H_ +#define COMXILVIDEOSCHEDULER_H_ + +#include "omxilcomponent.h" + +class COmxILVideoSchedulerInputPort; +class COmxILVideoSchedulerOutputPort; +class COmxILClientClockPort; + + +NONSHARABLE_CLASS(COmxILVideoScheduler) : public COmxILComponent + { +public: + static TInt CreateComponent(OMX_HANDLETYPE hComponent); + ~COmxILVideoScheduler(); + + TUint32 BufferCount() const; + OMX_ERRORTYPE MediaTimeRequest(TAny* apPrivate, OMX_TICKS aMediaTime, OMX_TICKS aOffset); + OMX_ERRORTYPE GetWallTime(OMX_TICKS& aWallTime); + OMX_ERRORTYPE SetVideoStartTime(OMX_TICKS aStartTime); + +private: + COmxILVideoScheduler(); + void ConstructL(OMX_HANDLETYPE aComponent); + + void AddOutputVideoPortL(); + void AddInputVideoPortL(); + void AddClockPortL(); + +private: + COmxILVideoSchedulerOutputPort* iVideoOutputPort; + COmxILVideoSchedulerInputPort* iVideoInputPort; + COmxILClientClockPort* iClockPort; + }; + +#endif /*COMXILVIDEOSCHEDULER_H_*/ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilvideoscheduler2/inc/comxilvideoschedulerinputport.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilvideoscheduler2/inc/comxilvideoschedulerinputport.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,65 @@ +/* +* 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 COMXILVIDEOSCHEDULERINPUTPORT_H_ +#define COMXILVIDEOSCHEDULERINPUTPORT_H_ + +#include "omxilvideoport.h" +#include + +NONSHARABLE_CLASS(COmxILVideoSchedulerInputPort) : public COmxILVideoPort + { +public: + static COmxILVideoSchedulerInputPort* NewL(const TOmxILCommonPortData& aCommonPortData); + + ~COmxILVideoSchedulerInputPort(); + + TUint32 BufferCount() const; + + // from COmxILVideoPort + OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray& aIndexArray) const; + OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray& aIndexArray) const; + OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex, TAny* apComponentParameterStructure) const; + OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex, const TAny* apComponentParameterStructure, + TBool& aUpdateProcessingFunction); + OMX_ERRORTYPE GetExtensionIndex(OMX_STRING aParameterName, OMX_INDEXTYPE* apIndexType) const; +protected: + OMX_ERRORTYPE SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, + TBool& aUpdateProcessingFunction); + + TBool IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const; + +private: + COmxILVideoSchedulerInputPort(const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedCodings, + const RArray& aSupportedColourFormats); + + void ConstructL(); + +private: + RBuf8 iMimeTypeBuf; + // Extension to provide a structure for generating the video scheduler dropping frame error + OMX_NOKIA_PARAM_DROPPEDFRAMEEVENT iParamVideoScheDropFrame; + }; + +#endif /*COMXILVIDEOSCHEDULERINPUTPORT_H_*/ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilvideoscheduler2/inc/comxilvideoscheduleroutputport.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilvideoscheduler2/inc/comxilvideoscheduleroutputport.h Fri May 07 16:25:23 2010 +0100 @@ -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: +* +*/ + + +/** +@file +@internalComponent +*/ + +#ifndef COMXILVIDEOSCHEDULEROUTPUTPORT_H_ +#define COMXILVIDEOSCHEDULEROUTPUTPORT_H_ + +#include "omxilvideoport.h" + + + +NONSHARABLE_CLASS(COmxILVideoSchedulerOutputPort) : public COmxILVideoPort + { +public: + static COmxILVideoSchedulerOutputPort* NewL(const TOmxILCommonPortData& aCommonPortData); + + ~COmxILVideoSchedulerOutputPort(); + + TUint32 BufferCount() const; + + // from COmxILVideoPort + OMX_ERRORTYPE GetLocalOmxParamIndexes(RArray& aIndexArray) const; + OMX_ERRORTYPE GetLocalOmxConfigIndexes(RArray& aIndexArray) const; + OMX_ERRORTYPE GetParameter(OMX_INDEXTYPE aParamIndex, TAny* apComponentParameterStructure) const; + OMX_ERRORTYPE SetParameter(OMX_INDEXTYPE aParamIndex, const TAny* apComponentParameterStructure, + TBool& aUpdateProcessingFunction); + +protected: + OMX_ERRORTYPE SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, + TBool& aUpdateProcessingFunction); + + TBool IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition) const; + +private: + COmxILVideoSchedulerOutputPort(const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedCodings, + const RArray& aSupportedColourFormats); + void ConstructL(); + +private: + //Mime Type is not important for uncompressed video but is required for the port definition structure. + RBuf8 iMimeTypeBuf; + }; + +#endif /*COMXILVIDEOSCHEDULEROUTPUTPORT_H_*/ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilvideoscheduler2/inc/comxilvideoschedulerpf.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilvideoscheduler2/inc/comxilvideoschedulerpf.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,125 @@ +/* +* 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 COMXILVIDEOSCHEDULERPF_H_ +#define COMXILVIDEOSCHEDULERPF_H_ + +#include +#include "omxilprocessingfunction.h" +#include "buffercopier.h" + + +// forward class declarations +class COmxILVideoScheduler; +class CBufferCopierStateMonitor; + +static const TInt KRenderTimeListLength = 5; + +/** + * These panics can only be raised in debug builds, and indicate an assertion failure due to programmer error. + */ +enum TVideoSchedulerPanic + { + EPanicMutexUnheld, // the mutex was unheld where it was expected to be held + EPanicTimestampEmissionUnordered, // buffer emission was triggered for a timestamp less than the previous emission's timestamp + EPanicBadOutputRegulation, // more output buffers were sent than intended or iSinkPendingBuffer at inappropriate time + EPanicBadAssociation // inconsistency between media time info and corresponding buffer header + }; + +NONSHARABLE_CLASS(COmxILVideoSchedulerPF) : public COmxILProcessingFunction, public MBufferCopierIf + { +public: + static COmxILVideoSchedulerPF* NewL(MOmxILCallbackNotificationIf& aCallbacks, COmxILVideoScheduler& aComponent, OMX_COMPONENTTYPE* aHandle); + ~COmxILVideoSchedulerPF(); + + // from COmxILProcessingFunction + OMX_ERRORTYPE StateTransitionIndication(COmxILFsm::TStateIndex aNewState); + OMX_ERRORTYPE BufferFlushingIndication(TUint32 aPortIndex, OMX_DIRTYPE aDirection); + OMX_ERRORTYPE ParamIndication(OMX_INDEXTYPE aParamIndex, const TAny* apComponentParameterStructure); + OMX_ERRORTYPE ConfigIndication(OMX_INDEXTYPE aConfigIndex, const TAny* apComponentConfigStructure); + OMX_ERRORTYPE BufferIndication(OMX_BUFFERHEADERTYPE* apBufferHeader, OMX_DIRTYPE aDirection); + OMX_BOOL BufferRemovalIndication(OMX_BUFFERHEADERTYPE* apBufferHeader, OMX_DIRTYPE aDirection); + OMX_ERRORTYPE MediaTimeIndication(const OMX_TIME_MEDIATIMETYPE& aTimeInfo); + + // from MBufferCopierIf + void MbcBufferCopied(OMX_BUFFERHEADERTYPE* aInBuffer, OMX_BUFFERHEADERTYPE* aOutBuffer); + void MbcBufferFlushed(OMX_BUFFERHEADERTYPE* aBuffer, OMX_DIRTYPE aDirection); + + MOmxILCallbackNotificationIf& GetCallbacks(); + +private: + class TBufferMessage + { + public: + OMX_BUFFERHEADERTYPE* iBufferHeader; + OMX_TIME_MEDIATIMETYPE iMediaTimeInfo; + }; + +private: + COmxILVideoSchedulerPF(MOmxILCallbackNotificationIf& aCallbacks, COmxILVideoScheduler& aComponent, OMX_COMPONENTTYPE* aHandle); + void ConstructL(); + + TBool FindWaitingBuffer(const OMX_BUFFERHEADERTYPE* aBuffer, const OMX_TICKS& aMediaTime, TInt& aIndex) const; + void SubmitBufferHeldByPause(); + TBool SendTimedOutputBuffer(OMX_BUFFERHEADERTYPE* aBuffer, const OMX_TIME_MEDIATIMETYPE& aMediaTimeInfo, TInt aIndex); + void SendOutputBuffer(OMX_BUFFERHEADERTYPE* aBuffer); + void DoSendOutputBuffer(OMX_BUFFERHEADERTYPE* aBuffer); + void HandleIfError(OMX_ERRORTYPE aOmxError); + OMX_ERRORTYPE SymbianErrorToOmx(TInt aError); + + void Panic(TVideoSchedulerPanic aPanicCode) const; + +private: + COmxILVideoScheduler& iComponent; + OMX_TICKS iRenderTime; // time it takes for Graphic Sink to render a frame + TBool iPausedState; + CBufferCopierStateMonitor* iBufferCopierStateMonitor; + RPointerArray iWaitingBuffers; // all waiting buffers, including those that received time updates + TUint32 iOutputBufferSentCount; // Only allowed to send 2 buffers at a time + RArray iCompletedBuffersHeldByPause; // buffers that receive time indications while component is paused + TInt64 iMaxLateness; // how late a buffer is allowed to be before it is dropped + + // to keep track of ClockState + OMX_TIME_CONFIG_CLOCKSTATETYPE iClockState; + + // hold on to start time if received before clock enters WaitingForStartTime state + TInt64 iStartTime; + TBool iStartTimePending; + + // any buffer that is ready to be displayed but sink is not ready to receive + OMX_BUFFERHEADERTYPE* iSinkPendingBuffer; + + TBool iIsClockStopped; + TBool iInvalid; + TUint32 iFrameDroppedCount; // shouldn't drop more than 2 frames at a time when decoder is slow + OMX_TICKS iTimeStamp; + RMutex iMutex; + OMX_BOOL iEnableDropFrameEvent; //enable the extension to notify error when drop frame happen + + TUint32 iRenderTimeList[KRenderTimeListLength]; + TInt iRenderTimeListPos; + TUint32 iRenderTimeSum; // the sum of the values in iRenderTimeList + + OMX_COMPONENTTYPE* iHandle; + }; + +#endif /*CCOMXILVIDEOSCHEDULERPF_H_*/ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilvideoscheduler2/inc/log.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilvideoscheduler2/inc/log.h Fri May 07 16:25:23 2010 +0100 @@ -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 + +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_COMMON_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 aFormat, ...) + { + TTruncateOverflowHandler8 overflowHandler8; + VA_LIST list; + VA_START(list, aFormat); + + TTime now; + now.HomeTime(); + + TBuf8<1024> buffer; + _LIT8(KSwiLogPrefix, "[vidsch] "); + _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 aFormat, ...) + { + TTruncateOverflowHandler16 overflowHandler16; + VA_LIST list; + VA_START(list, aFormat); + + TTime now; + now.HomeTime(); + + TBuf8<256> header; + _LIT8(KSwiLogPrefix, "[vidsch] "); + _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__ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilvideoscheduler2/inc/omxildroppedframeeventextension.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilvideoscheduler2/inc/omxildroppedframeeventextension.h Fri May 07 16:25:23 2010 +0100 @@ -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 + +/** + * 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_ */ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilvideoscheduler2/inc/omxilvideoscheduler.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilvideoscheduler2/inc/omxilvideoscheduler.hrh Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,25 @@ +/* +* 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 OMXILVIDEOSCHEDULER_HRH_ +#define OMXILVIDEOSCHEDULER_HRH_ + +#define KUidSymbianOmxILVideoSchedulerDll 0x1028663B +#define KUidSymbianOmxILVideoScheduler 0x1028663C + +#endif /*OMXILVIDEOSCHEDULER_HRH_*/ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilvideoscheduler2/inc/omxilvideoscheduler.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilvideoscheduler2/inc/omxilvideoscheduler.iby Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,28 @@ +/* +* 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 OMXILVIDEOSCHEDULER_IBY +#define OMXILVIDEOSCHEDULER_IBY + +#include + +ECOM_PLUGIN(omxilvideoscheduler.dll, omxilvideoscheduler.rsc) + +data=ZRESOURCE\videoscheduler\videoscheduler.rsc resource\videoscheduler\videoscheduler.rsc + +#endif // OMXILVIDEOSCHEDULER_IBY diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilvideoscheduler2/inc/omxilvideoschedulerextensionsindexes.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilvideoscheduler2/inc/omxilvideoschedulerextensionsindexes.h Fri May 07 16:25:23 2010 +0100 @@ -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 +@internalComponent +*/ + +#ifndef OMXILVIDEOSCHEDULEREXTENSIONSINDEXES_H_ +#define OMXILVIDEOSCHEDULEREXTENSIONSINDEXES_H_ + +/* + * Index for the dropped frame error extension + */ +#define OMX_NokiaIndexParamDroppedFrameEvent 0x7F000001 + +#endif /* OMXILVIDEOSCHEDULEREXTENSIONSINDEXES_H_ */ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilvideoscheduler2/inc/resourcefilereader.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilvideoscheduler2/inc/resourcefilereader.h Fri May 07 16:25:23 2010 +0100 @@ -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 RESOURCEFILEREADER_H +#define RESOURCEFILEREADER_H + +#include +#include + + + + +/** This class is responsible for reading the supplied resource file */ +NONSHARABLE_CLASS(CResourceFileReader) : public CBase + { +public: + static CResourceFileReader* NewL(const TDesC& aResourceFile); + static CResourceFileReader* NewLC(const TDesC& aResourceFile); + ~CResourceFileReader(); + + void ReadTimerInfoL(TInt64& aInitialRenderTime, TInt64& aMaxLateness); + +private: + CResourceFileReader(); + void ConstructL(const TDesC& aResourceFile); + +private: + RFs iFs; + RResourceFile iResourceFile; + }; + +#endif // RESOURCEFILEREADER_H + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilvideoscheduler2/inc/videoscheduler.rh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilvideoscheduler2/inc/videoscheduler.rh Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,35 @@ +/* +* 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 VIDEOSCHEDULER_RH +#define VIDEOSCHEDULER_RH + + +/** +@publishedPartner +@prototype + +Timed rendering configuration parameters +*/ +STRUCT TIMER_INFO + { + LONG initial_render_time; // initial estimate of how long it takes the sink to render a frame + LONG max_lateness; // how late a buffer can be before it will be dropped + } + +#endif /* VIDEOSCHEDULER_RH */ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilvideoscheduler2/mmpfiles/omxilvideoscheduler.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilvideoscheduler2/mmpfiles/omxilvideoscheduler.mmp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,57 @@ +/* +* 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 "../inc/omxilvideoscheduler.hrh" + +TARGET omxilvideoscheduler.dll +CAPABILITY ALL -TCB +TARGETTYPE PLUGIN +UID 0x10009D8D KUidSymbianOmxILVideoSchedulerDll +VENDORID 0x70000001 + +USERINCLUDE ../inc + +OS_LAYER_SYSTEMINCLUDE_SYMBIAN +USERINCLUDE ../../../omxilcomponentcommon/src/common + + +SOURCEPATH ../src + +SOURCE buffercopier.cpp +SOURCE buffercopierstatemonitor.cpp +SOURCE comxilvideoscheduler.cpp +SOURCE comxilvideoschedulerinputport.cpp +SOURCE comxilvideoscheduleroutputport.cpp +SOURCE comxilvideoschedulerpf.cpp +SOURCE resourcefilereader.cpp + +RESOURCE omxilvideoscheduler.rss + +START RESOURCE videoscheduler.rss +TARGETPATH resource/videoscheduler +HEADER +END + +nostrictdef + +LIBRARY euser.lib bafl.lib efsrv.lib inetprotutil.lib ecom.lib +LIBRARY omxilcomponentcommon.lib +STATICLIBRARY omxilcomponentif.lib + +// Uncomment to activate debug tracing in this module +// MACRO _OMXIL_COMMON_DEBUG_TRACING_ON diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilvideoscheduler2/src/buffercopier.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilvideoscheduler2/src/buffercopier.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,200 @@ +/* +* 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 "buffercopier.h" + +_LIT(KBufferCopierPanic, "CBufferCopier"); + +CBufferCopier* CBufferCopier::NewL(MBufferCopierIf& aCallback, TInt aMaxBuffers) + { + CBufferCopier* self = new(ELeave) CBufferCopier(aCallback); + CleanupStack::PushL(self); + self->ConstructL(aMaxBuffers); + CleanupStack::Pop(self); + return self; + } + +CBufferCopier::CBufferCopier(MBufferCopierIf& aCallback): +CActive(EPriorityNormal), +iCallback(aCallback) + { + CActiveScheduler::Add(this); + } + +void CBufferCopier::ConstructL(TInt aMaxBuffers) + { + User::LeaveIfError(iInQueue.CreateLocal(aMaxBuffers)); + User::LeaveIfError(iOutQueue.CreateLocal(aMaxBuffers)); + User::LeaveIfError(iRemoveQueue.CreateLocal(aMaxBuffers)); + SetActive(); + iInQueue.NotifyDataAvailable(iStatus); + } + +CBufferCopier::~CBufferCopier() + { + Cancel(); + iInQueue.Close(); + iOutQueue.Close(); + iRemoveQueue.Close(); + } + +void CBufferCopier::DeliverBuffer(OMX_BUFFERHEADERTYPE* aBuffer, OMX_DIRTYPE aDirection) + { + RMsgQueue& queue = aDirection == OMX_DirInput ? iInQueue : iOutQueue; + TInt err = queue.Send(aBuffer); + // do not expect error as maximum buffer count already allocated + if(err != KErrNone) + { + User::Panic(KBufferCopierPanic, err); + } + } + +void CBufferCopier::RunL() + { + if(iInBuffer == NULL) + { + // ignore error, if KErrUnderflow then we go back to waiting on iInQueue + iInQueue.Receive(iInBuffer); + } + else + { + OMX_BUFFERHEADERTYPE* outBuffer = NULL; + TInt err = iOutQueue.Receive(outBuffer); + // if KErrUnderflow then we go back to waiting on iOutQueue + if(err == KErrNone) + { + CopyBuffer(iInBuffer, outBuffer); + iInBuffer = NULL; + } + } + + SetActive(); + if(iInBuffer == NULL) + { + iInQueue.NotifyDataAvailable(iStatus); + } + else + { + iOutQueue.NotifyDataAvailable(iStatus); + } + } + +void CBufferCopier::DoCancel() + { + iInQueue.CancelDataAvailable(); + iOutQueue.CancelDataAvailable(); + } + +void CBufferCopier::CopyBuffer(OMX_BUFFERHEADERTYPE* aInBuffer, OMX_BUFFERHEADERTYPE* aOutBuffer) + { + aOutBuffer->nOffset = 0; + TPtr8 desPtr(aOutBuffer->pBuffer, aOutBuffer->nAllocLen); + desPtr.Copy(aInBuffer->pBuffer + aInBuffer->nOffset, aInBuffer->nFilledLen); + + aOutBuffer->nFilledLen = aInBuffer->nFilledLen; + aOutBuffer->hMarkTargetComponent = aInBuffer->hMarkTargetComponent; + aOutBuffer->pMarkData = aInBuffer->pMarkData; + aOutBuffer->nTickCount = aInBuffer->nTickCount; + aOutBuffer->nTimeStamp = aInBuffer->nTimeStamp; + aOutBuffer->nFlags = aInBuffer->nFlags; + + iCallback.MbcBufferCopied(aInBuffer, aOutBuffer); + } + +TBool CBufferCopier::RemoveBuffer(OMX_BUFFERHEADERTYPE* aBuffer, OMX_DIRTYPE aDirection) + { + switch(aDirection) + { + case OMX_DirInput: + { + if(aBuffer == iInBuffer) + { + // also check the slot used for storing the input buffer when waiting for an output buffer + iInBuffer = NULL; + return ETrue; + } + else + { + return RemoveFromQueue(iInQueue, aBuffer); + } + } + case OMX_DirOutput: + return RemoveFromQueue(iOutQueue, aBuffer); + default: + User::Panic(KBufferCopierPanic, KErrArgument); + return EFalse; // prevent compiler warning + } + } + +void CBufferCopier::FlushBuffers(OMX_DIRTYPE aDirection) + { + OMX_BUFFERHEADERTYPE* buffer; + if(aDirection == OMX_DirInput) + { + if(iInBuffer) + { + iCallback.MbcBufferFlushed(iInBuffer, OMX_DirInput); + iInBuffer = NULL; + } + + while(iInQueue.Receive(buffer) != KErrUnderflow) + { + iCallback.MbcBufferFlushed(buffer, OMX_DirInput); + } + } + else if(aDirection == OMX_DirOutput) + { + while(iOutQueue.Receive(buffer) != KErrUnderflow) + { + iCallback.MbcBufferFlushed(buffer, OMX_DirOutput); + } + } + else + { + User::Panic(KBufferCopierPanic, KErrArgument); + } + } + +TBool CBufferCopier::RemoveFromQueue(RMsgQueue& aQueue, OMX_BUFFERHEADERTYPE* aBufferHeader) + { + TBool removed = EFalse; + OMX_BUFFERHEADERTYPE* bufferHeader = NULL; + while(aQueue.Receive(bufferHeader) != KErrUnderflow) + { + if(bufferHeader != aBufferHeader) + { + TInt err = iRemoveQueue.Send(bufferHeader); + __ASSERT_DEBUG(err == KErrNone, User::Panic(KBufferCopierPanic, err)); + } + else + { + removed = ETrue; + } + } + while(iRemoveQueue.Receive(bufferHeader) != KErrUnderflow) + { + TInt err = aQueue.Send(bufferHeader); + __ASSERT_DEBUG(err == KErrNone, User::Panic(KBufferCopierPanic, err)); + } + return removed; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilvideoscheduler2/src/buffercopierstatemonitor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilvideoscheduler2/src/buffercopierstatemonitor.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,161 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +/** +@file +@internalComponent +*/ +#include "buffercopier.h" +#include "comxilvideoscheduler.h" +#include "buffercopierstatemonitor.h" +#include "log.h" + +CBufferCopierStateMonitor* CBufferCopierStateMonitor::NewL(MBufferCopierIf& aCallback, COmxILVideoScheduler& aComponent) + { + CBufferCopierStateMonitor* self = new (ELeave) CBufferCopierStateMonitor(aCallback, aComponent); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +CBufferCopierStateMonitor::CBufferCopierStateMonitor(MBufferCopierIf& aCallback, COmxILVideoScheduler& aComponent) : +CActive(EPriorityNormal), +iCallback(aCallback), +iComponent(aComponent), +iState(ENull) + { + CActiveScheduler::Add(this); + } + +CBufferCopierStateMonitor::~CBufferCopierStateMonitor() + { + Cancel(); + delete iBufferCopier; + } + +void CBufferCopierStateMonitor::ConstructL() + { + RThread me; + iConstructionThreadId = me.Id(); + + iStatus = KRequestPending; + SetActive(); + } + +void CBufferCopierStateMonitor::RunL() + { + iStatus = KRequestPending; + SetActive(); + + TInt err = DoSetState(); + + TRequestStatus *status = iCallingStatus; + RThread callingThread; + callingThread.Open(iCallingThreadId); + callingThread.RequestComplete(status, err); + callingThread.Close(); + } + +void CBufferCopierStateMonitor::DoCancel() + { + TRequestStatus* pStat = &iStatus; + User::RequestComplete(pStat, KErrCancel); + } + +TInt CBufferCopierStateMonitor::RunError(TInt aError) + { + DEBUG_PRINTF2(_L8("CBufferCopierStateMonitor::RunError %d"), aError); + aError=KErrNone; //Do not want to panic the server! + return aError; + } + +TInt CBufferCopierStateMonitor::SetState(TPFState aState) + { + DEBUG_PRINTF(_L8("CBufferCopierStateMonitor::SetState")); + + TInt err = KErrNone; + iState = aState; + + RThread me; + if(me.Id() != iConstructionThreadId) + { + // in different thread to that which 'this' was constructed + err = DoRequest(); + } + else + { + // in same thread to that which 'this' was constructed therefore + // active scheduler must exist and following call is safe + err = DoSetState(); + } + + return err; + } + +TInt CBufferCopierStateMonitor::DoSetState() + { + DEBUG_PRINTF(_L8("CBufferCopierStateMonitor::DoSetState")); + + TInt err = KErrNone; + + switch(iState) + { + case ESubLoadedToIdle: + iMaxBuffers = iComponent.BufferCount(); + delete iBufferCopier; + iBufferCopier = NULL; + TRAP(err, iBufferCopier = CBufferCopier::NewL(iCallback, iMaxBuffers)); + break; + case ESubIdleToLoaded: + delete iBufferCopier; + iBufferCopier = NULL; + break; + default: + break; + }; + + return err; + } + +TInt CBufferCopierStateMonitor::DoRequest() + { + DEBUG_PRINTF(_L8("CBufferCopierStateMonitor::DoRequest")); + + RThread me; + iCallingThreadId = me.Id(); + TRequestStatus requestStatus = KRequestPending; + iCallingStatus = &requestStatus; + + // send request to active scheduler thread + RThread schedulerThread; + TInt error = schedulerThread.Open(iConstructionThreadId); + if(error != KErrNone) + { + return error; + } + + TRequestStatus* schedulerRequest = &iStatus; + schedulerThread.RequestComplete(schedulerRequest, KErrNone); + schedulerThread.Close(); + + // block until request completes + User::WaitForRequest(requestStatus); + + return requestStatus.Int(); + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilvideoscheduler2/src/comxilvideoscheduler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilvideoscheduler2/src/comxilvideoscheduler.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,250 @@ +/* +* 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 "omxilincontextcallbackmanager.h" +#include "omxilportmanager.h" +#include "omxilspecversion.h" +#include "omxilfsm.h" +#include "omxilconfigmanager.h" +#include +#include +#include "omxilclientclockport.h" + +#include "comxilvideoscheduler.h" +#include "comxilvideoschedulerinputport.h" +#include "comxilvideoscheduleroutputport.h" +#include "comxilvideoschedulerpf.h" +#include "omxilvideoscheduler.hrh" + +const OMX_U32 KInputPortIndex = 0; +const OMX_U32 KOutputPortIndex = 1; +const OMX_U32 KClockPortIndex = 2; + +_LIT8(KSymbianOmxILVideoSchedulerName, "OMX.SYMBIAN.VIDEO.VIDEOSCHEDULER"); +_LIT8(KSymbianOmxILVideoSchedulerRole, "video_scheduler.binary"); + +OMXIL_COMPONENT_ECOM_ENTRYPOINT(KUidSymbianOmxILVideoScheduler); + +OMX_ERRORTYPE SymbianErrorToOmx(TInt aError); + +// Component Entry Point +OMX_ERRORTYPE OMX_ComponentInit(OMX_HANDLETYPE aComponent) + { + TInt err = COmxILVideoScheduler::CreateComponent(aComponent); + return SymbianErrorToOmx(err); + } + +TInt COmxILVideoScheduler::CreateComponent(OMX_HANDLETYPE aComponent) + { + COmxILVideoScheduler* self = new COmxILVideoScheduler(); + + if (!self) + { + return KErrNoMemory; + } + + TRAPD(err, self->ConstructL(aComponent)); + if(err) + { + delete self; + } + return err; + } + +COmxILVideoScheduler::COmxILVideoScheduler() + { + // nothing to do + } + +void COmxILVideoScheduler::ConstructL(OMX_HANDLETYPE hComponent) + { + // STEP 1: Initialize the data received from the IL Core + ipHandle = static_cast(hComponent); + ipAppData = 0; + ipCallbacks = 0; + + // STEP 2: Create the callback manager + // In context callback manager is used since we need output buffers to be received at the sink + // component immediately after we decide to send them. + // Also, returning clock buffers imediately avoids clock buffer starvation + ipCallbackManager = COmxILInContextCallbackManager::NewL(ipHandle, ipAppData, ipCallbacks); + + // STEP 3: Create the Processing Function... + ipProcessingFunction = COmxILVideoSchedulerPF::NewL(*ipCallbackManager, *this, ipHandle); + + // STEP 4: Create Port manager... + ipPortManager = COmxILPortManager::NewL( + *ipProcessingFunction, // The component's processing function + *ipCallbackManager, // The call back manager object + TOmxILSpecVersion(), // OMX Version + 0, // The number of audio ports in this component + 0, // The starting audio port index + 0, // The number of image ports in this component + 0, // The starting image port index + 2, // The number of video ports in this component + 0, // The starting video port index + 1, // The number of other ports in this component + 2 // The starting other port index + ); + + // create the input port + AddInputVideoPortL(); + AddOutputVideoPortL(); + AddClockPortL(); + + // STEP 5: Create the non-port related configuration manager... + RPointerArray roleList; + CleanupClosePushL(roleList); + roleList.AppendL(&KSymbianOmxILVideoSchedulerRole); + ipConfigManager = COmxILConfigManager::NewL( + *ipPortManager, + KSymbianOmxILVideoSchedulerName, + TOmxILSpecVersion(), + roleList); + CleanupStack::PopAndDestroy(); + + // STEP 6: Create the FSM object... + ipFsm = COmxILFsm::NewL(*this, *ipProcessingFunction, *ipPortManager, *ipConfigManager, *ipCallbackManager); + + // And finally, let's get everything started + InitComponentL(); + } + +COmxILVideoScheduler::~COmxILVideoScheduler() + { + delete ipProcessingFunction; + delete ipCallbackManager; + delete ipPortManager; + delete iVideoOutputPort; + delete iVideoInputPort; + delete iClockPort; + delete ipConfigManager; + delete ipFsm; + } + +void COmxILVideoScheduler::AddInputVideoPortL() + { + TOmxILSpecVersion specVersion; + + TOmxILCommonPortData portData( + specVersion, + KInputPortIndex, + OMX_DirInput, + 1, // minimum number of buffers + 1, // minimum buffer size, in bytes + OMX_PortDomainVideo, + OMX_FALSE, // do not need contigious buffers + 1, // 1-byte alignment + OMX_BufferSupplyInput, + KOutputPortIndex); + + iVideoInputPort = COmxILVideoSchedulerInputPort::NewL(portData); + + User::LeaveIfError(ipPortManager->AddPort(iVideoInputPort, OMX_DirInput)); + } + +void COmxILVideoScheduler::AddOutputVideoPortL() + { + TOmxILSpecVersion specVersion; + + TOmxILCommonPortData portData( + specVersion, + KOutputPortIndex, + OMX_DirOutput, + 1, // minimum number of buffers + 1, // minimum buffer size, in bytes + OMX_PortDomainVideo, + OMX_FALSE, // do not need contigious buffers + 1, // 1-byte alignment + OMX_BufferSupplyInput, + COmxILPort::KBufferMarkPropagationPortNotNeeded); + + iVideoOutputPort = COmxILVideoSchedulerOutputPort::NewL(portData); + + User::LeaveIfError(ipPortManager->AddPort(iVideoOutputPort, OMX_DirOutput)); + } + +void COmxILVideoScheduler::AddClockPortL() + { + TOmxILSpecVersion specVersion; + + TOmxILCommonPortData portData( + specVersion, + KClockPortIndex, + OMX_DirInput, + 4, // minimum number of buffers + sizeof(OMX_TIME_MEDIATIMETYPE), // minimum buffer size, in bytes + OMX_PortDomainOther, + OMX_TRUE, // contigious buffers + 4, // 4-byte alignment + OMX_BufferSupplyOutput, + COmxILPort::KBufferMarkPropagationPortNotNeeded); + + RArray array; + CleanupClosePushL(array); + array.AppendL(OMX_OTHER_FormatTime); + iClockPort = COmxILClientClockPort::NewL(portData, array); + CleanupStack::PopAndDestroy(&array); + + User::LeaveIfError(ipPortManager->AddPort(iClockPort, OMX_DirInput)); + } + +/** Returns the maximum number of buffers configured on a port. */ +TUint32 COmxILVideoScheduler::BufferCount() const + { + // due to buffer copying we do not need the same number of buffers on each port, + // so to be safe the maximum count is used when allocating queues. + // when buffer sharing is added, the buffer counts must be checked to be the same on + // the Loaded->Idle phase. + TUint32 in = iVideoInputPort->BufferCount(); + TUint32 out = iVideoOutputPort->BufferCount(); + return in > out ? in : out; + } + +OMX_ERRORTYPE COmxILVideoScheduler::MediaTimeRequest(TAny* apPrivate, OMX_TICKS aMediaTime, OMX_TICKS aOffset) + { + return iClockPort->MediaTimeRequest(apPrivate, aMediaTime, aOffset); + } + +OMX_ERRORTYPE COmxILVideoScheduler::GetWallTime(OMX_TICKS& aWallTime) + { + return iClockPort->GetWallTime(aWallTime); + } + +OMX_ERRORTYPE COmxILVideoScheduler::SetVideoStartTime(OMX_TICKS aStartTime) + { + return iClockPort->SetStartTime(aStartTime); + } + +OMX_ERRORTYPE SymbianErrorToOmx(TInt aError) + { + switch(aError) + { + case KErrNone: + return OMX_ErrorNone; + case KErrNoMemory: + return OMX_ErrorInsufficientResources; + default: + return OMX_ErrorUndefined; + } + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilvideoscheduler2/src/comxilvideoschedulerinputport.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilvideoscheduler2/src/comxilvideoschedulerinputport.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,200 @@ +/* +* 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 "comxilvideoschedulerinputport.h" +#include "omxilvideoschedulerextensionsindexes.h" + + +COmxILVideoSchedulerInputPort* COmxILVideoSchedulerInputPort::NewL(const TOmxILCommonPortData& aCommonPortData) + { + // TODO these arrays must left empty, to be removed from the video port constructor + RArray supportedCodings; + RArray supportedColorFormats; + + CleanupClosePushL(supportedCodings); + CleanupClosePushL(supportedColorFormats); + + COmxILVideoSchedulerInputPort* self = new(ELeave) COmxILVideoSchedulerInputPort(aCommonPortData, supportedCodings, supportedColorFormats); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + + CleanupStack::PopAndDestroy(2, &supportedCodings); + + return self; + } + + +COmxILVideoSchedulerInputPort::COmxILVideoSchedulerInputPort(const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedCodings, + const RArray& aSupportedColourFormats) + : COmxILVideoPort(aCommonPortData, aSupportedCodings, aSupportedColourFormats) + { + } + +void COmxILVideoSchedulerInputPort::ConstructL() + { + // Port definition mime type. Mime type is not relevant for uncompressed video frames + iMimeTypeBuf.CreateL(KNullDesC8(), KNullDesC8().Length() + 1); + TUint8* pTUint = const_cast(iMimeTypeBuf.PtrZ()); + iParamPortDefinition.format.video.cMIMEType = reinterpret_cast(pTUint); + + iParamVideoScheDropFrame.nSize = sizeof(OMX_NOKIA_PARAM_DROPPEDFRAMEEVENT); + iParamVideoScheDropFrame.nVersion = TOmxILSpecVersion(); + iParamVideoScheDropFrame.nPortIndex = iParamPortDefinition.nPortIndex; + iParamVideoScheDropFrame.bEnabled = OMX_FALSE; + + iSupportedVideoFormats.AppendL(OMX_VIDEO_CodingUnused); + iSupportedColorFormats.AppendL(OMX_COLOR_FormatUnused); + } + +COmxILVideoSchedulerInputPort::~COmxILVideoSchedulerInputPort() + { + iMimeTypeBuf.Close(); + } + +OMX_ERRORTYPE COmxILVideoSchedulerInputPort::GetLocalOmxParamIndexes(RArray& aIndexArray) const + { + OMX_ERRORTYPE omxRetValue = COmxILVideoPort::GetLocalOmxParamIndexes(aIndexArray); + if(omxRetValue != OMX_ErrorNone) + { + return omxRetValue; + } + + TInt err = aIndexArray.InsertInOrder(OMX_NokiaIndexParamDroppedFrameEvent); + + if (err != KErrNone && err != KErrAlreadyExists) + { + return OMX_ErrorInsufficientResources; + } + + return OMX_ErrorNone; + } + +OMX_ERRORTYPE COmxILVideoSchedulerInputPort::GetLocalOmxConfigIndexes(RArray& aIndexArray) const + { + return COmxILVideoPort::GetLocalOmxConfigIndexes(aIndexArray); + } + +/** +This method provides the current values for the parameters present in the structure represented by the given index. + +@param aParamIndex The specific param index for which the current parameter values are required. + apComponentParameterStructure The pointer to the structure which will be updated to provide the current parameter values. + +@return OMX_ErrorNone if successful; + OMX_ErrorNoMore if no more formats; + OMX_ErrorUnsupportedSetting if unsupported setting is passed; +*/ +OMX_ERRORTYPE COmxILVideoSchedulerInputPort::GetParameter(OMX_INDEXTYPE aParamIndex,TAny* apComponentParameterStructure) const + { + if(aParamIndex == OMX_NokiaIndexParamDroppedFrameEvent) + { + OMX_NOKIA_PARAM_DROPPEDFRAMEEVENT* dropFrame = static_cast(apComponentParameterStructure); + *dropFrame = iParamVideoScheDropFrame; + return OMX_ErrorNone; + } + else + { + // Try the parent's indexes + return COmxILVideoPort::GetParameter(aParamIndex,apComponentParameterStructure); + } + } + +/** +This method sets the values of the parameters present in the structure represented by the given index. + +@param aParamIndex The specific param index for which the parameter values have to be set. + apComponentParameterStructure The pointer to the structure which will provide the desired parameter values to be set. + aUpdateProcessingFunction informs whether the processing function needs to be updated. + +@return OMX_ErrorNone if successful; + OMX_ErrorUnsupportedSetting if non-zero framerate value; + OMX_ErrorUnsupportedIndex if request OMX_NokiaIndexParamDroppedFrameEvent index; +*/ +OMX_ERRORTYPE COmxILVideoSchedulerInputPort::SetParameter(OMX_INDEXTYPE aParamIndex,const TAny* apComponentParameterStructure, TBool& aUpdateProcessingFunction) + { + if(aParamIndex == OMX_NokiaIndexParamDroppedFrameEvent) + { + const OMX_NOKIA_PARAM_DROPPEDFRAMEEVENT *portParameterStructure = static_cast(apComponentParameterStructure); + if (iParamVideoScheDropFrame.bEnabled != portParameterStructure->bEnabled) + { + iParamVideoScheDropFrame.bEnabled = portParameterStructure->bEnabled; + aUpdateProcessingFunction = ETrue; + } + return OMX_ErrorNone; + } + + // Try the parent's indexes + return COmxILVideoPort::SetParameter(aParamIndex, apComponentParameterStructure, aUpdateProcessingFunction); + } + + +OMX_ERRORTYPE COmxILVideoSchedulerInputPort::SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, + TBool& /*aUpdateProcessingFunction*/) + { + iParamPortDefinition.format.video = aPortDefinition.format.video; + TUint8* pTUint = const_cast(iMimeTypeBuf.PtrZ()); + iParamPortDefinition.format.video.cMIMEType = reinterpret_cast(pTUint); + iParamPortDefinition.format.video.nSliceHeight = iParamPortDefinition.format.video.nFrameHeight; + iParamPortDefinition.nBufferSize = iParamPortDefinition.format.video.nStride * iParamPortDefinition.format.video.nSliceHeight; + return OMX_ErrorNone; + } + +TBool COmxILVideoSchedulerInputPort::IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& /*aPortDefinition*/) const + { + // TODO (The base class should do this checking) + return ETrue; + } + +/** Returns the number of buffers configured on this port. */ +TUint32 COmxILVideoSchedulerInputPort::BufferCount() const + { + return iParamPortDefinition.nBufferCountActual; + } + +/** +This method provides the index type represented by the given parameter name. + +@param aParameterName The name of extention parameter to be retrieved. + apIndexType The pointer which will retrieve the required index. + +@return OMX_ErrorNone if successful; + OMX_ErrorUnsupportedIndex if unsupported parameter name is passed; +*/ +OMX_ERRORTYPE COmxILVideoSchedulerInputPort::GetExtensionIndex(OMX_STRING aParameterName, OMX_INDEXTYPE* apIndexType) const + { + TPtrC8 receivedParameterName(const_cast(reinterpret_cast(aParameterName))); + + TPtrC8 parameterName(reinterpret_cast(sOmxNokiaIndexParamDroppedFrameEvent)); + + if (receivedParameterName == parameterName) + { + *apIndexType = static_cast(OMX_NokiaIndexParamDroppedFrameEvent); + return OMX_ErrorNone; + } + + *apIndexType = OMX_IndexMax; + return OMX_ErrorUnsupportedIndex; + } + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilvideoscheduler2/src/comxilvideoscheduleroutputport.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilvideoscheduler2/src/comxilvideoscheduleroutputport.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,111 @@ +/* +* 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 "comxilvideoscheduleroutputport.h" + + +COmxILVideoSchedulerOutputPort* COmxILVideoSchedulerOutputPort::NewL(const TOmxILCommonPortData& aCommonPortData) + { + // TODO these arrays must left empty, to be removed from the video port constructor + RArray supportedCodings; + RArray supportedColorFormats; + CleanupClosePushL(supportedCodings); + CleanupClosePushL(supportedColorFormats); + + COmxILVideoSchedulerOutputPort* self = new(ELeave) COmxILVideoSchedulerOutputPort(aCommonPortData, supportedCodings, supportedColorFormats); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + + CleanupStack::PopAndDestroy(2, &supportedCodings); + + return self; + } + +COmxILVideoSchedulerOutputPort::COmxILVideoSchedulerOutputPort(const TOmxILCommonPortData& aCommonPortData, + const RArray& aSupportedCodings, + const RArray& aSupportedColourFormats) + : COmxILVideoPort(aCommonPortData, aSupportedCodings, aSupportedColourFormats) + { + } + +COmxILVideoSchedulerOutputPort::~COmxILVideoSchedulerOutputPort() + { + iMimeTypeBuf.Close(); + } + +void COmxILVideoSchedulerOutputPort::ConstructL() + { + // Port definition mime type. Mime type is not relevant for uncompressed video frames + iMimeTypeBuf.CreateL(KNullDesC8(), KNullDesC8().Length() + 1); + TUint8* pTUint = const_cast(iMimeTypeBuf.PtrZ()); + iParamPortDefinition.format.video.cMIMEType = reinterpret_cast(pTUint); + + iSupportedVideoFormats.AppendL(OMX_VIDEO_CodingUnused); + iSupportedColorFormats.AppendL(OMX_COLOR_FormatUnused); + } + +OMX_ERRORTYPE COmxILVideoSchedulerOutputPort::GetLocalOmxParamIndexes(RArray& aIndexArray) const + { + return COmxILVideoPort::GetLocalOmxParamIndexes(aIndexArray); + } + +OMX_ERRORTYPE COmxILVideoSchedulerOutputPort::GetLocalOmxConfigIndexes(RArray& aIndexArray) const + { + return COmxILVideoPort::GetLocalOmxConfigIndexes(aIndexArray); + } + +OMX_ERRORTYPE COmxILVideoSchedulerOutputPort::GetParameter(OMX_INDEXTYPE aParamIndex, + TAny* apComponentParameterStructure) const + { + return COmxILVideoPort::GetParameter(aParamIndex, apComponentParameterStructure); + } + +OMX_ERRORTYPE COmxILVideoSchedulerOutputPort::SetParameter(OMX_INDEXTYPE aParamIndex, + const TAny* apComponentParameterStructure, + TBool& aUpdateProcessingFunction) + { + return COmxILVideoPort::SetParameter(aParamIndex, apComponentParameterStructure, aUpdateProcessingFunction); + } + +OMX_ERRORTYPE COmxILVideoSchedulerOutputPort::SetFormatInPortDefinition(const OMX_PARAM_PORTDEFINITIONTYPE& aPortDefinition, + TBool& /*aUpdateProcessingFunction*/) + { + iParamPortDefinition.format.video = aPortDefinition.format.video; + TUint8* pTUint = const_cast(iMimeTypeBuf.PtrZ()); + iParamPortDefinition.format.video.cMIMEType = reinterpret_cast(pTUint); + iParamPortDefinition.format.video.nSliceHeight = iParamPortDefinition.format.video.nFrameHeight; + iParamPortDefinition.nBufferSize = iParamPortDefinition.format.video.nStride * iParamPortDefinition.format.video.nSliceHeight; + return OMX_ErrorNone; + } + +TBool COmxILVideoSchedulerOutputPort::IsTunnelledPortCompatible(const OMX_PARAM_PORTDEFINITIONTYPE& /*aPortDefinition*/) const + { + return ETrue; + } + +/** Returns the number of buffers configured on this port. */ +TUint32 COmxILVideoSchedulerOutputPort::BufferCount() const + { + return iParamPortDefinition.nBufferCountActual; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilvideoscheduler2/src/comxilvideoschedulerpf.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilvideoscheduler2/src/comxilvideoschedulerpf.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,809 @@ +/* +* 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 "omxilcallbackmanager.h" +#include "omxilutil.h" +#include "comxilvideoschedulerpf.h" +#include "comxilvideoscheduler.h" +#include "resourcefilereader.h" +#include "buffercopierstatemonitor.h" +#include "omxilvideoschedulerextensionsindexes.h" +#include +#include "log.h" + +_LIT(KVideoSchedulerPanicCategory, "omxilvscheduler"); //should restrict to 16 characters as it is used in User::Panic +_LIT(KResourceFileName, "Z:\\resource\\videoscheduler\\videoscheduler.rsc"); +const TInt KMaxRenderTime = 1000000; +const TInt KMaxGraphicSinkBufferCount(2); //This is set as the maximum number of buffers that can be sent to the graphic sink without the risk of overloading it. + + + +COmxILVideoSchedulerPF* COmxILVideoSchedulerPF::NewL(MOmxILCallbackNotificationIf& aCallbacks, COmxILVideoScheduler& aComponent, OMX_COMPONENTTYPE* aHandle) + { + COmxILVideoSchedulerPF* self = new (ELeave) COmxILVideoSchedulerPF(aCallbacks, aComponent, aHandle); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +COmxILVideoSchedulerPF::COmxILVideoSchedulerPF(MOmxILCallbackNotificationIf& aCallbacks, COmxILVideoScheduler& aComponent, OMX_COMPONENTTYPE* aHandle) +: COmxILProcessingFunction(aCallbacks), + iComponent(aComponent), + iIsClockStopped(ETrue), + iInvalid(EFalse), + iTimeStamp(KMinTInt64), + iHandle(aHandle) + { + } + +void COmxILVideoSchedulerPF::ConstructL() + { + User::LeaveIfError(iMutex.CreateLocal()); + iBufferCopierStateMonitor = CBufferCopierStateMonitor::NewL(*this, iComponent); + // get timer info + CResourceFileReader* reader = CResourceFileReader::NewLC(KResourceFileName); + reader->ReadTimerInfoL(iRenderTime, iMaxLateness); + CleanupStack::PopAndDestroy(reader); + + // Prefill the render time array with the default render time read from resource file + for (TInt count = 0; count < KRenderTimeListLength; ++count) + { + iRenderTimeList[count] = iRenderTime; + } + iRenderTimeSum = iRenderTime * KRenderTimeListLength; + } + +COmxILVideoSchedulerPF::~COmxILVideoSchedulerPF() + { + delete iBufferCopierStateMonitor; + iMutex.Wait(); + iWaitingBuffers.Reset(); + iCompletedBuffersHeldByPause.Reset(); + iMutex.Signal(); + iMutex.Close(); + } + +OMX_ERRORTYPE COmxILVideoSchedulerPF::StateTransitionIndication(COmxILFsm::TStateIndex aNewState) + { + switch(aNewState) + { + case COmxILFsm::EStateExecuting: + { + if (iPausedState) + { + iMutex.Wait(); + iPausedState = EFalse; + + // send any buffers that received time updates during paused state + if (iOutputBufferSentCount < KMaxGraphicSinkBufferCount) // only allowed to send 2 buffers at a time + { + SubmitBufferHeldByPause(); + } + iMutex.Signal(); + } + break; + } + case COmxILFsm::EStatePause: + { + iPausedState = ETrue; + break; + } + case COmxILFsm::ESubStateLoadedToIdle: + { + TUint32 bufferCount = iComponent.BufferCount(); + + TInt error = iBufferCopierStateMonitor->SetState(CBufferCopierStateMonitor::ESubLoadedToIdle); + + if (error != KErrNone) + { + return SymbianErrorToOmx(error); + } + + error = iWaitingBuffers.Reserve(bufferCount); + if (error != KErrNone) + { + return SymbianErrorToOmx(error); + } + + error = iCompletedBuffersHeldByPause.Reserve(bufferCount); + if (error != KErrNone) + { + return SymbianErrorToOmx(error); + } + + break; + } + case COmxILFsm::EStateIdle: + { + iOutputBufferSentCount = iComponent.BufferCount(); + break; + } + case COmxILFsm::ESubStateIdleToLoaded: + { + TInt error = iBufferCopierStateMonitor->SetState(CBufferCopierStateMonitor::ESubIdleToLoaded); + if (error != KErrNone) + { + return SymbianErrorToOmx(error); + } + break; + } + default: + { + break; + } + } + + return OMX_ErrorNone; + } + +OMX_ERRORTYPE COmxILVideoSchedulerPF::BufferFlushingIndication(TUint32 aPortIndex, OMX_DIRTYPE aDirection) + { + // called from command thread + + iMutex.Wait(); + if (iBufferCopierStateMonitor->BufferCopier()) + { + if (aPortIndex == OMX_ALL) + { + iBufferCopierStateMonitor->BufferCopier()->FlushBuffers(OMX_DirInput); + iBufferCopierStateMonitor->BufferCopier()->FlushBuffers(OMX_DirOutput); + } + else + { + iBufferCopierStateMonitor->BufferCopier()->FlushBuffers(aDirection); + } + } + + if (aDirection == OMX_DirOutput || aPortIndex == OMX_ALL) + { + while (iWaitingBuffers.Count() > 0) + { + iWaitingBuffers[0]->nFilledLen = 0; + iWaitingBuffers[0]->nOffset = 0; + iWaitingBuffers[0]->nTimeStamp = 0; + iCallbacks.BufferDoneNotification(iWaitingBuffers[0], 1, OMX_DirOutput); + iWaitingBuffers.Remove(0); + iOutputBufferSentCount++; + } + if(iSinkPendingBuffer) + { + iSinkPendingBuffer->nFilledLen = 0; + iSinkPendingBuffer->nOffset = 0; + iSinkPendingBuffer->nTimeStamp = 0; + iCallbacks.BufferDoneNotification(iSinkPendingBuffer, 1, OMX_DirOutput); + iSinkPendingBuffer = NULL; + iOutputBufferSentCount++; + } + } + iMutex.Signal(); + + return OMX_ErrorNone; + } + +OMX_ERRORTYPE COmxILVideoSchedulerPF::ParamIndication(OMX_INDEXTYPE aParamIndex, + const TAny* apComponentParameterStructure) + { + DEBUG_PRINTF(_L8("COmxILVideoSchedulerProcessingFunction::ParamIndication")); + + if(aParamIndex == OMX_NokiaIndexParamDroppedFrameEvent) + { + const OMX_NOKIA_PARAM_DROPPEDFRAMEEVENT* dropFrame = static_cast(apComponentParameterStructure); + iEnableDropFrameEvent = dropFrame->bEnabled; + } + + return OMX_ErrorNone; + } + +OMX_ERRORTYPE COmxILVideoSchedulerPF::ConfigIndication(OMX_INDEXTYPE /*aConfigIndex*/, const TAny* /*apComponentConfigStructure*/) + { + return OMX_ErrorNone; + } + +OMX_ERRORTYPE COmxILVideoSchedulerPF::BufferIndication(OMX_BUFFERHEADERTYPE* apBufferHeader, + OMX_DIRTYPE aDirection) + { + if (iInvalid) + { + return OMX_ErrorInvalidState; + } + + // called from decoder data thread or sink data thread + iMutex.Wait(); + if(aDirection == OMX_DirOutput) + { + apBufferHeader->nFlags = 0; + iOutputBufferSentCount--; + ASSERT(iOutputBufferSentCount <= iComponent.BufferCount()); + + DEBUG_PRINTF2(_L8("VS2::BufferIndication : apBufferHeader->nTickCount = %d"), apBufferHeader->nTickCount); + + // update the render time if it is set + if (apBufferHeader->nTickCount > 0 && apBufferHeader->nTickCount <= KMaxRenderTime) + { + // Add new render time to render time list, and recalculate average + iRenderTimeSum -= iRenderTimeList[iRenderTimeListPos]; + iRenderTimeSum += apBufferHeader->nTickCount; + iRenderTimeList[iRenderTimeListPos] = apBufferHeader->nTickCount; + ++iRenderTimeListPos; + iRenderTimeListPos %= KRenderTimeListLength; + + iRenderTime = iRenderTimeSum / KRenderTimeListLength; + + DEBUG_PRINTF2(_L8("VS2::BufferIndication : New iRenderTime = %ld"), iRenderTime); + } + + // previously sent buffer has come back + // send any buffers that received time updates + // at startup, iOutputBufferSentCount may be >2 if output port is non-supplier + if (!iPausedState && iOutputBufferSentCount < KMaxGraphicSinkBufferCount) + { + SubmitBufferHeldByPause(); + } + } + else if(apBufferHeader->nFlags & OMX_BUFFERFLAG_DECODEONLY) + { + // this frame is not to be rendered (probably as part of an accurate seek) + // drop the data and send it back to the decoder + apBufferHeader->nFilledLen = 0; + apBufferHeader->nFlags = 0; + apBufferHeader->nOffset = 0; + iCallbacks.BufferDoneNotification(apBufferHeader, 0, OMX_DirInput); + iMutex.Signal(); + return OMX_ErrorNone; + } + if (iBufferCopierStateMonitor->BufferCopier()) + { + iBufferCopierStateMonitor->BufferCopier()->DeliverBuffer(apBufferHeader, aDirection); + } + iMutex.Signal(); + + return OMX_ErrorNone; + } + +OMX_ERRORTYPE COmxILVideoSchedulerPF::MediaTimeIndication(const OMX_TIME_MEDIATIMETYPE& aTimeInfo) + { + // called from clock thread + + switch(aTimeInfo.eUpdateType) + { + case OMX_TIME_UpdateRequestFulfillment: + { + + iMutex.Wait(); + + TInt index = -1; + OMX_BUFFERHEADERTYPE* buffer = reinterpret_cast(aTimeInfo.nClientPrivate); + __ASSERT_DEBUG(buffer->nTimeStamp == aTimeInfo.nMediaTimestamp, Panic(EPanicBadAssociation)); + if(FindWaitingBuffer(buffer, aTimeInfo.nMediaTimestamp, index)) + { + if (iPausedState || iCompletedBuffersHeldByPause.Count() > 0) + { + TBufferMessage bufferMessage; + bufferMessage.iBufferHeader = buffer; + bufferMessage.iMediaTimeInfo = aTimeInfo; + + OMX_ERRORTYPE error = SymbianErrorToOmx(iCompletedBuffersHeldByPause.Append(bufferMessage)); // note append cannot fail, allocated enough slots + iMutex.Signal(); + return error; + } + else + { + SendTimedOutputBuffer(buffer, aTimeInfo, index); + } + } + else + { + // TODO [SL] now what? + User::Invariant(); + } + + iMutex.Signal(); + return OMX_ErrorNone; + } + + case OMX_TIME_UpdateScaleChanged: + if(aTimeInfo.xScale >= 0) + { + // the clock takes care completing requests at the correct media time + return OMX_ErrorNone; + } + else + { + // TODO think harder about implications of negative scale + // certainly the iTimeStamp checking must be reversed + ASSERT(0); + return OMX_ErrorNotImplemented; + } + + case OMX_TIME_UpdateClockStateChanged: + iClockState.eState = aTimeInfo.eState; + switch(aTimeInfo.eState) + { + case OMX_TIME_ClockStateStopped: + { + // clock stopped so remove any pending buffers from the list as time requests + // will be resent when the clock is running again + + iIsClockStopped = ETrue; + + iMutex.Wait(); + while (iCompletedBuffersHeldByPause.Count() > 0) + { + iCompletedBuffersHeldByPause.Remove(0); + } + + if(iSinkPendingBuffer && iBufferCopierStateMonitor) + { + // if sink pending buffer exist (as sink is bottleneck) then drop the frame + iBufferCopierStateMonitor->BufferCopier()->DeliverBuffer(iSinkPendingBuffer, OMX_DirOutput); + + + iSinkPendingBuffer = NULL; + } + iMutex.Signal(); + } + break; + + case OMX_TIME_ClockStateWaitingForStartTime: + { + iIsClockStopped = EFalse; + // if now in WaitingForStartTime state and start time already received, send it now + if (iStartTimePending) + { + OMX_ERRORTYPE error = iComponent.SetVideoStartTime(iStartTime); + if (error != OMX_ErrorNone) + { + // iStartTimePending = EFalse; // FIXME - Is this required? + return error; + } + } + } + break; + + case OMX_TIME_ClockStateRunning: + { + iTimeStamp = KMinTInt64; + if(iIsClockStopped) + { + // the clock is running after being stopped previously + // resend time requests for waiting buffers + iIsClockStopped = EFalse; + + for (TInt i = 0; i < iWaitingBuffers.Count(); ++i) + { + iComponent.MediaTimeRequest(iWaitingBuffers[i], iWaitingBuffers[i]->nTimeStamp, iRenderTime); + } + } + } + break; + } + + iStartTimePending = EFalse; + DEBUG_PRINTF2(_L8("VS2::MediaTimeIndication : ClockStateChanged = %d"), aTimeInfo.eState); + + return OMX_ErrorNone; + + default: + return OMX_ErrorBadParameter; + } + + } + +/* Check if aBuffer still exist in the waiting queue */ +TBool COmxILVideoSchedulerPF::FindWaitingBuffer(const OMX_BUFFERHEADERTYPE* aBuffer, const OMX_TICKS& aMediaTime, TInt& aIndex) const + { + __ASSERT_DEBUG(const_cast(iMutex).IsHeld(), Panic(EPanicMutexUnheld)); + + TBool found = EFalse; + + for (TInt i=0; inTimeStamp == aMediaTime)) + { + found = ETrue; + aIndex = i; + break; + } + } + + return found; + } + +/** +Check if a specified buffer is currently held by the processing function, +and remove it if found. + +@param apBufferHeader Buffer to remove +@param aDirection Port direction +@return Flag to indicate if buffer was removed. +*/ +OMX_BOOL COmxILVideoSchedulerPF::BufferRemovalIndication(OMX_BUFFERHEADERTYPE* apBufferHeader, OMX_DIRTYPE aDirection) + { + iMutex.Wait(); + if(iBufferCopierStateMonitor->BufferCopier() && iBufferCopierStateMonitor->BufferCopier()->RemoveBuffer(apBufferHeader, aDirection)) + { + if(aDirection == OMX_DirOutput) + { + iOutputBufferSentCount++; + } + iMutex.Signal(); + return OMX_TRUE; + } + else if(aDirection == OMX_DirOutput) + { + for (TInt i = 0; i < iWaitingBuffers.Count(); ++i) + { + if (iWaitingBuffers[i] == apBufferHeader) + { + iWaitingBuffers[i]->nFilledLen = 0; + iWaitingBuffers.Remove(i); + iOutputBufferSentCount++; + iMutex.Signal(); + return OMX_TRUE; + } + } + if(apBufferHeader == iSinkPendingBuffer) + { + iSinkPendingBuffer = NULL; + iOutputBufferSentCount++; + iMutex.Signal(); + return OMX_TRUE; + } + } + + iMutex.Signal(); + return OMX_FALSE; + } + +/* Submit the first time update buffer that still exists in the waiting queue. */ +void COmxILVideoSchedulerPF::SubmitBufferHeldByPause() + { + __ASSERT_DEBUG(iMutex.IsHeld(), Panic(EPanicMutexUnheld)); + __ASSERT_DEBUG(iOutputBufferSentCount < KMaxGraphicSinkBufferCount, Panic(EPanicBadOutputRegulation)); + + if(iSinkPendingBuffer) + { + DEBUG_PRINTF(_L8("VS2::SubmitBufferHeldByPause ***************************SEND SINK PENDING BUFFER")); + OMX_BUFFERHEADERTYPE* buffer = iSinkPendingBuffer; + iSinkPendingBuffer = NULL; + SendOutputBuffer(buffer); + return; + } + + TInt index = -1; + TBool bufferSent = EFalse; + while (iCompletedBuffersHeldByPause.Count() > 0 && !bufferSent) + { + TBufferMessage& msg = iCompletedBuffersHeldByPause[0]; + if (FindWaitingBuffer(msg.iBufferHeader, + msg.iMediaTimeInfo.nMediaTimestamp, index)) + { + DEBUG_PRINTF(_L8("VS2::SubmitBufferHeldByPause ***************************SEND HELD BUFFER")); + bufferSent = SendTimedOutputBuffer(msg.iBufferHeader, msg.iMediaTimeInfo, index); + } + iCompletedBuffersHeldByPause.Remove(0); + } + } + +/** Returns ETrue if aBuffer was sent, EFalse otherwise */ +TBool COmxILVideoSchedulerPF::SendTimedOutputBuffer(OMX_BUFFERHEADERTYPE* aBuffer, const OMX_TIME_MEDIATIMETYPE& aMediaTimeInfo, TInt aIndex) + { + __ASSERT_DEBUG(iMutex.IsHeld(), Panic(EPanicMutexUnheld)); + __ASSERT_DEBUG(aBuffer->nTimeStamp == aMediaTimeInfo.nMediaTimestamp, Panic(EPanicBadAssociation)); + __ASSERT_DEBUG(aBuffer == reinterpret_cast(aMediaTimeInfo.nClientPrivate), Panic(EPanicBadAssociation)); + +#ifdef _OMXIL_COMMON_DEBUG_TRACING_ON + DEBUG_PRINTF(_L8("VS2::SendTimedOutputBuffer **********************************")); + TTime t; + t.HomeTime(); + DEBUG_PRINTF2(_L8("VS2::SendTimedOutputBuffer : t.HomeTime() = %ld"), t.Int64()); + DEBUG_PRINTF2(_L8("VS2::SendTimedOutputBuffer : aMediaTimeInfo.nClientPrivate = 0x%X"), aMediaTimeInfo.nClientPrivate); + DEBUG_PRINTF2(_L8("VS2::SendTimedOutputBuffer : aMediaTimeInfo.nMediaTimestamp = %ld"), aMediaTimeInfo.nMediaTimestamp); + DEBUG_PRINTF2(_L8("VS2::SendTimedOutputBuffer : aMediaTimeInfo.nOffset = %ld"), aMediaTimeInfo.nOffset); + DEBUG_PRINTF2(_L8("VS2::SendTimedOutputBuffer : aMediaTimeInfo.nWallTimeAtMediaTime = %ld"), aMediaTimeInfo.nWallTimeAtMediaTime); +#endif + + TBool bufferSent = EFalse; + + OMX_U32 flags = aBuffer->nFlags; + + // Work out how long it is from now until the frame will be rendered. + // This will be the time it takes the sink to render, minus the offset + // value from the clock completion (i.e how far before the requested + // time that the clock has completed us). A lateness of 0 means we are at + // the correct time to send the buffer, a positive lateness means we are + // late sending the buffer, and a lateness waitTime means we are early. + // For the first frame we were not able to request an early completion to + // offset the render time, so assume that the render time is 0. + OMX_TICKS lateness = 0 - aMediaTimeInfo.nOffset; + if (!(flags & OMX_BUFFERFLAG_STARTTIME)) + { + lateness += iRenderTime; + } + + DEBUG_PRINTF2(_L8("VS2::SendTimedOutputBuffer : iRenderTime = %ld"), iRenderTime); + DEBUG_PRINTF2(_L8("VS2::SendTimedOutputBuffer : lateness = %ld"), lateness); + DEBUG_PRINTF2(_L8("VS2::SendTimedOutputBuffer : iMaxLateness = %ld"), iMaxLateness); + DEBUG_PRINTF2(_L8("VS2::SendTimedOutputBuffer : iTimeStamp = %ld"), iTimeStamp); + DEBUG_PRINTF2(_L8("VS2::SendTimedOutputBuffer : iFrameDroppedCount = %d"), iFrameDroppedCount); + DEBUG_PRINTF2(_L8("VS2::SendTimedOutputBuffer : flags = %d"), flags); + + iWaitingBuffers.Remove(aIndex); + + // Send the buffer if the wait time is within the maximum allowed delay and timestamp is later than the previous timestamp, otherwise skip the buffer + if ((lateness <= iMaxLateness || iFrameDroppedCount >= KMaxGraphicSinkBufferCount) && aMediaTimeInfo.nMediaTimestamp > iTimeStamp) // shouldn't drop more than 2 frames at a time when decoder is slow + { + DEBUG_PRINTF(_L8("VS2::SendTimedOutputBuffer ***************************SHOW")); + + bufferSent = ETrue; + iFrameDroppedCount = 0; + + SendOutputBuffer(aBuffer); + } + else + { + DEBUG_PRINTF(_L8("VS2::SendTimedOutputBuffer ***************************DROP")); + + iFrameDroppedCount++; + + + // if EOS was on the buffer, send an empty buffer with EOS and send the EOS event + // if not, discard the buffer contents and post the buffer for another copy + if(flags & OMX_BUFFERFLAG_EOS) + { + DEBUG_PRINTF(_L8("VS2::SendTimedOutputBuffer ***************************SEND EMPTY EOS BUFFER")); + aBuffer->nFilledLen = 0; + aBuffer->nOffset = 0; + aBuffer->nTimeStamp = 0; + SendOutputBuffer(aBuffer); + } + else + { + TOmxILUtil::ClearBufferContents(aBuffer); + aBuffer->nOffset = 0; + if (iBufferCopierStateMonitor->BufferCopier()) + { + iBufferCopierStateMonitor->BufferCopier()->DeliverBuffer(aBuffer, OMX_DirOutput); + } + } + } + + return bufferSent; + } + +void COmxILVideoSchedulerPF::SendOutputBuffer(OMX_BUFFERHEADERTYPE* aBuffer) + { + __ASSERT_DEBUG(iMutex.IsHeld(), Panic(EPanicMutexUnheld)); + __ASSERT_DEBUG(iTimeStamp < aBuffer->nTimeStamp || aBuffer->nFlags & OMX_BUFFERFLAG_EOS, Panic(EPanicTimestampEmissionUnordered)); + + if(iOutputBufferSentCount >= KMaxGraphicSinkBufferCount) + { + DEBUG_PRINTF(_L8("VS2::SendOutputBuffer : *****************STORING SINK PENDING BUFFER")); + + // sink is bottleneck, keep the most recent pending frame but return the rest so decoder keeps running + // when sink returns a buffer send the most recent frame + if(iSinkPendingBuffer && iBufferCopierStateMonitor->BufferCopier()) + { + if (iSinkPendingBuffer->nFlags & OMX_BUFFERFLAG_EOS) + { + //if (bizarrely) pending buffer has EOS flag and another buffer replaces it. + DoSendOutputBuffer(iSinkPendingBuffer); + } + else + { + iBufferCopierStateMonitor->BufferCopier()->DeliverBuffer(iSinkPendingBuffer, OMX_DirOutput); + } + + DEBUG_PRINTF(_L8("VS2::SendOutputBuffer : *****************DROPPED EXISTING SINK PENDING BUFFER")); + + } + + iSinkPendingBuffer = aBuffer; + } + else + { + DoSendOutputBuffer(aBuffer); + } + } + +/** Called when the buffer copier has transferred the data from an input buffer to an output buffer. */ +void COmxILVideoSchedulerPF::MbcBufferCopied(OMX_BUFFERHEADERTYPE* aInBuffer, OMX_BUFFERHEADERTYPE* aOutBuffer) + { + iMutex.Wait(); + + // send input buffer back + aInBuffer->nFilledLen = 0; + aInBuffer->nOffset = 0; + aInBuffer->nFlags = 0; + aInBuffer->nTimeStamp = 0; + + // Deal with any buffer marks. Currently the component framework makes an attempt to deal with + // them, but it cannot associate the input buffer mark with the corresponding output buffer so + // we may need to do some tweaking here. + if (aInBuffer->hMarkTargetComponent) + { + if (aInBuffer->hMarkTargetComponent == iHandle) + { + // There was a buffer mark on the input buffer intended for us. That means there is no + // need to send it out on the output buffer. Also, it is OK to let the component framework + // deal with it in this situation. + aOutBuffer->hMarkTargetComponent = NULL; + aOutBuffer->pMarkData = NULL; + } + else + { + // There was a buffer mark on the input buffer but it is not intended for us. If + // we let the component framework deal with it then we will get multiple marks sent + // out because we have copied it to the output buffer, and the framework will also + // store it to send out later. Clear it here so the framework does not see it. + aInBuffer->hMarkTargetComponent = NULL; + aInBuffer->pMarkData = NULL; + } + } + + OMX_ERRORTYPE error; + + iCallbacks.BufferDoneNotification(aInBuffer, 0, OMX_DirInput); + + if(aOutBuffer->nFilledLen > 0 || (aOutBuffer->nFlags & OMX_BUFFERFLAG_EOS)) + { + iWaitingBuffers.Append(aOutBuffer); // note append cannot fail, allocated enough slots + } + + if(aOutBuffer->nFlags & OMX_BUFFERFLAG_STARTTIME) + { + if(OMX_TIME_ClockStateWaitingForStartTime == iClockState.eState) + { + error = iComponent.SetVideoStartTime(aOutBuffer->nTimeStamp); + if (error != OMX_ErrorNone) + { + HandleIfError(error); + } + iStartTimePending = EFalse; + } + else + { + // delay sending until clock transitions to WaitingForStartTime + iStartTime = aOutBuffer->nTimeStamp; + iStartTimePending = ETrue; + } + } + +#ifdef _OMXIL_COMMON_DEBUG_TRACING_ON + DEBUG_PRINTF(_L8("VS2::MbcBufferCopied **********************************")); + TTime t; + t.HomeTime(); + DEBUG_PRINTF2(_L8("VS2::MbcBufferCopied : t.HomeTime() = %ld"), t.Int64()); + DEBUG_PRINTF2(_L8("VS2::MbcBufferCopied : aOutBuffer = 0x%X"), aOutBuffer); + DEBUG_PRINTF2(_L8("VS2::MbcBufferCopied : aOutBuffer->nTimeStamp = %ld"), aOutBuffer->nTimeStamp); +#endif + iMutex.Signal(); + + if (aOutBuffer->nFilledLen == 0 && !(aOutBuffer->nFlags & OMX_BUFFERFLAG_EOS)) + { + // A likely cause of receiving an empty buffer is if the decoder implements a flush as + // returning buffers to supplier or always sending buffers to peer, rather than emptied + // and queued on the output port. In this case we return the buffer immediately without + // making a media time request. Probably the timestamp is invalid or the clock is not in + // the running state, in either case we could deadlock by queueing the empty buffers after + // a flush and preventing new data from being delivered. However these buffers were not + // returned in BufferIndication() in case there were any flags that need processing. + iBufferCopierStateMonitor->BufferCopier()->DeliverBuffer(aOutBuffer, OMX_DirOutput); + } + else + { + if (!iIsClockStopped) + { + error = iComponent.MediaTimeRequest(aOutBuffer, aOutBuffer->nTimeStamp, iRenderTime); + if (error != OMX_ErrorNone) + { + HandleIfError(error); + } + } + } + } + +/** Called when a buffer is flushed from the buffer copier. */ +void COmxILVideoSchedulerPF::MbcBufferFlushed(OMX_BUFFERHEADERTYPE* aBuffer, OMX_DIRTYPE aDirection) + { + TInt portIndex = 0; + aBuffer->nFilledLen = 0; + aBuffer->nOffset = 0; + aBuffer->nFlags = 0; + aBuffer->nTimeStamp = 0; + + if (aDirection == OMX_DirOutput) + { + ++iOutputBufferSentCount; + portIndex = 1; + } + + iCallbacks.BufferDoneNotification(aBuffer, portIndex, aDirection); + } + +void COmxILVideoSchedulerPF::DoSendOutputBuffer(OMX_BUFFERHEADERTYPE* aBuffer) + { + OMX_ERRORTYPE error; + // A zero length buffer means this buffer is just being sent because it + // has the EOS flag. + if (aBuffer->nFilledLen > 0) + { + aBuffer->nTickCount = 0xC0C0C0C0; + iTimeStamp = aBuffer->nTimeStamp; + } + + error = iCallbacks.BufferDoneNotification(aBuffer, 1, OMX_DirOutput); + if (error != OMX_ErrorNone) + { + HandleIfError(error); + } + + iOutputBufferSentCount++; + + OMX_U32 flags = aBuffer->nFlags; + if(flags & OMX_BUFFERFLAG_EOS) + { + error = iCallbacks.EventNotification(OMX_EventBufferFlag, 1, flags, NULL); + if (error != OMX_ErrorNone) + { + HandleIfError(error); + } + } + } + +void COmxILVideoSchedulerPF::HandleIfError(OMX_ERRORTYPE aOmxError) + { + if (aOmxError != OMX_ErrorNone) + { + iInvalid = ETrue; + iCallbacks.ErrorEventNotification(aOmxError); + } + } + +OMX_ERRORTYPE COmxILVideoSchedulerPF::SymbianErrorToOmx(TInt aError) + { + switch(aError) + { + case KErrNone: + return OMX_ErrorNone; + case KErrNoMemory: + return OMX_ErrorInsufficientResources; + default: + return OMX_ErrorUndefined; + } + } + + + +void COmxILVideoSchedulerPF::Panic(TVideoSchedulerPanic aPanicCode) const + { + // const allows const methods to panic using this method + // however we wish to release the mutex to avoid blocking other threads + RMutex& mutex = const_cast(iMutex); + if(mutex.IsHeld()) + { + mutex.Signal(); + } + User::Panic(KVideoSchedulerPanicCategory, aPanicCode); + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilvideoscheduler2/src/omxilvideoscheduler.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilvideoscheduler2/src/omxilvideoscheduler.rss Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,44 @@ +/* +* 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 +#include +#include "omxilvideoscheduler.hrh" + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = KUidSymbianOmxILVideoSchedulerDll; + interfaces = + { + INTERFACE_INFO + { + interface_uid = KUidOmxILSymbianComponentIf; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KUidSymbianOmxILVideoScheduler; + version_no = 1; + display_name = "OMX.SYMBIAN.VIDEO.VIDEOSCHEDULER"; + default_data = "video_scheduler.binary"; + } + }; + } + }; + } + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilvideoscheduler2/src/resourcefilereader.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilvideoscheduler2/src/resourcefilereader.cpp Fri May 07 16:25:23 2010 +0100 @@ -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 +*/ + +#include +#include +#include "resourcefilereader.h" + + +CResourceFileReader* CResourceFileReader::NewL(const TDesC& aResourceFile) + { + CResourceFileReader* self = CResourceFileReader::NewLC(aResourceFile); + CleanupStack::Pop(self); + return self; + } + +CResourceFileReader* CResourceFileReader::NewLC(const TDesC& aResourceFile) + { + CResourceFileReader* self = new (ELeave) CResourceFileReader(); + CleanupStack::PushL(self); + self->ConstructL(aResourceFile); + return self; + } + +CResourceFileReader::CResourceFileReader() + { + } + +void CResourceFileReader::ConstructL(const TDesC& aResourceFile) + { + User::LeaveIfError(iFs.Connect()); + iResourceFile.OpenL(iFs, aResourceFile); + } + +CResourceFileReader::~CResourceFileReader() + { + iResourceFile.Close(); + iFs.Close(); + } + +void CResourceFileReader::ReadTimerInfoL(TInt64& aInitialRenderTime, TInt64& aMaxLateness) + { + HBufC8* res = iResourceFile.AllocReadLC(TIMER); + TResourceReader reader; + reader.SetBuffer(res); + + aInitialRenderTime = static_cast(reader.ReadInt32()); + aMaxLateness = static_cast(reader.ReadInt32()); + + CleanupStack::PopAndDestroy(res); + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/video/omxilvideoscheduler2/src/videoscheduler.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/video/omxilvideoscheduler2/src/videoscheduler.rss Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,28 @@ +/* +* 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 "videoscheduler.rh" + + +/** Timer values for timed mode*/ +RESOURCE TIMER_INFO timer + { + initial_render_time = 20000; + max_lateness = 20000; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/layers.sysdef.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/layers.sysdef.xml Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,35 @@ + + + + +]> + + + + + + + + + + + + + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/te_xmlomxclient/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/te_xmlomxclient/group/bld.inf Fri May 07 16:25:23 2010 +0100 @@ -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 diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/te_xmlomxclient/group/te_xmlomxclient.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/te_xmlomxclient/group/te_xmlomxclient.iby Fri May 07 16:25:23 2010 +0100 @@ -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 +#include + +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 + + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/te_xmlomxclient/group/te_xmlomxclient.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/te_xmlomxclient/group/te_xmlomxclient.mmp Fri May 07 16:25:23 2010 +0100 @@ -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 diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/te_xmlomxclient/scripts/audio/te_omx_audio_dm_play.script --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/te_xmlomxclient/scripts/audio/te_omx_audio_dm_play.script Fri May 07 16:25:23 2010 +0100 @@ -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 diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/te_xmlomxclient/scripts/audio/te_omx_audio_dm_play.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/te_xmlomxclient/scripts/audio/te_omx_audio_dm_play.xml Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,273 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/te_xmlomxclient/scripts/audio/te_omx_audio_dm_play_symbian.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/te_xmlomxclient/scripts/audio/te_omx_audio_dm_play_symbian.xml Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,265 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/te_xmlomxclient/scripts/te_xmlomxclient.ini --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/te_xmlomxclient/scripts/te_xmlomxclient.ini Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,2 @@ +[InstanceName] +name=OmxXmlTestObject diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/te_xmlomxclient/src/omxxmltestblockcontroller.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/te_xmlomxclient/src/omxxmltestblockcontroller.cpp Fri May 07 16:25:23 2010 +0100 @@ -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; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/te_xmlomxclient/src/omxxmltestblockcontroller.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/te_xmlomxclient/src/omxxmltestblockcontroller.h Fri May 07 16:25:23 2010 +0100 @@ -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 + +class COmxXmlTestBlockController : public CTestBlockController + { +public: + static COmxXmlTestBlockController* NewL(); + + CDataWrapper* CreateDataL(const TDesC& aData); + +private: + COmxXmlTestBlockController(); + }; + +#endif ///OMXXMLTESTBLOCKCONTROLLER_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/te_xmlomxclient/src/omxxmltestrunner.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/te_xmlomxclient/src/omxxmltestrunner.cpp Fri May 07 16:25:23 2010 +0100 @@ -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 + +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); + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/te_xmlomxclient/src/omxxmltestrunner.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/te_xmlomxclient/src/omxxmltestrunner.h Fri May 07 16:25:23 2010 +0100 @@ -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 +#include + +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 diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/te_xmlomxclient/src/omxxmltestwrapper.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/te_xmlomxclient/src/omxxmltestwrapper.cpp Fri May 07 16:25:23 2010 +0100 @@ -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(); + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/te_xmlomxclient/src/omxxmltestwrapper.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/te_xmlomxclient/src/omxxmltestwrapper.h Fri May 07 16:25:23 2010 +0100 @@ -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 + +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 diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/te_xmlomxclient/src/te_xmlomxclient.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/te_xmlomxclient/src/te_xmlomxclient.cpp Fri May 07 16:25:23 2010 +0100 @@ -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; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/te_xmlomxclient/src/te_xmlomxclient.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/te_xmlomxclient/src/te_xmlomxclient.h Fri May 07 16:25:23 2010 +0100 @@ -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 + +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 diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/xmlclient/bwins/xmlomxclient.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/xmlclient/bwins/xmlomxclient.def Fri May 07 16:25:23 2010 +0100 @@ -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 &) + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/xmlclient/eabi/xmlomxclient.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/xmlclient/eabi/xmlomxclient.def Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,8 @@ +EXPORTS + _ZN13COmxXmlScript10RunScriptLERK7TDesC16S2_ @ 1 NONAME + _ZN13COmxXmlScript4NewLER20MOmxScriptTestLogger @ 2 NONAME + _ZTI14CWindowManager @ 3 NONAME + _ZTI15CThreadedLogger @ 4 NONAME + _ZTV14CWindowManager @ 5 NONAME + _ZTV15CThreadedLogger @ 6 NONAME + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/xmlclient/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/xmlclient/group/bld.inf Fri May 07 16:25:23 2010 +0100 @@ -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 + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/xmlclient/group/omxscript.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/xmlclient/group/omxscript.mmp Fri May 07 16:25:23 2010 +0100 @@ -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 diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/xmlclient/group/xmlclient.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/xmlclient/group/xmlclient.mmp Fri May 07 16:25:23 2010 +0100 @@ -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: +* +*/ + + +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 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 + +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 diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/xmlclient/group/xmlomxclient.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/xmlclient/group/xmlomxclient.iby Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef XML_OMX_CLIENT_IBY +#define XML_OMX_CLIENT_IBY + +#include + +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 diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/xmlclient/inc/omx_xml_script.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/xmlclient/inc/omx_xml_script.h Fri May 07 16:25:23 2010 +0100 @@ -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 + +/** + * 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_*/ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/xmlclient/src/asbreakeventhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/xmlclient/src/asbreakeventhandler.cpp Fri May 07 16:25:23 2010 +0100 @@ -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 +#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(pAppData)->DoBufferDone(reinterpret_cast(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(pAppData)->DoBufferDone(reinterpret_cast(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(pAppData)->DoEventHandler(reinterpret_cast(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; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/xmlclient/src/asbreakeventhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/xmlclient/src/asbreakeventhandler.h Fri May 07 16:25:23 2010 +0100 @@ -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 + +#include + +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 iComponents; + TInt iCounter; + TMode iMode; + RMutex iMutex; + + OMX_COMPONENTTYPE* iEOSComponent; // from which component we expect EOS. all components if NULL + }; + +#endif /*ASBREAKEVENTHANDLER_H_*/ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/xmlclient/src/baseprofilehandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/xmlclient/src/baseprofilehandler.cpp Fri May 07 16:25:23 2010 +0100 @@ -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(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(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(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; + } + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/xmlclient/src/baseprofilehandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/xmlclient/src/baseprofilehandler.h Fri May 07 16:25:23 2010 +0100 @@ -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 + +#include +#include + +#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 iBufferHeaders; + + RArray 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_ */ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/xmlclient/src/baseprofiletimestamping.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/xmlclient/src/baseprofiletimestamping.cpp Fri May 07 16:25:23 2010 +0100 @@ -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; + } + } + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/xmlclient/src/baseprofiletimestamping.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/xmlclient/src/baseprofiletimestamping.h Fri May 07 16:25:23 2010 +0100 @@ -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 iPendingTimestampChecks; + + }; + +#endif /* BASEPROFILETIMESTAMPING_H_ */ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/xmlclient/src/log.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/xmlclient/src/log.h Fri May 07 16:25:23 2010 +0100 @@ -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_ */ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/xmlclient/src/nontunneledhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/xmlclient/src/nontunneledhandler.cpp Fri May 07 16:25:23 2010 +0100 @@ -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(aBufHdr->nOutputPortIndex), CPortInfo::ComparePortNum); + } + else + { + pos = iPorts.Find(static_cast(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); + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/xmlclient/src/nontunneledhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/xmlclient/src/nontunneledhandler.h Fri May 07 16:25:23 2010 +0100 @@ -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 +#include + +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 iBuffers; + RPointerArray 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 iPorts; + }; + + RPointerArray iComponents; + }; + +#endif // NONTUNNELEDHANDLER_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/xmlclient/src/omx_xml_script.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/xmlclient/src/omx_xml_script.cpp Fri May 07 16:25:23 2010 +0100 @@ -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); + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/xmlclient/src/omxscript.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/xmlclient/src/omxscript.cpp Fri May 07 16:25:23 2010 +0100 @@ -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 +#include +#include // Console +#include +#include + +// 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
\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; + } + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/xmlclient/src/omxscriptparser.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/xmlclient/src/omxscriptparser.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,1951 @@ +/* +* 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 +#include +#include "parsemap.h" +//#include + +#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 + { + 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("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("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); + CheckForAbortL(iCallback.MosGetFilename(comp, *filename)); + 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("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("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(ParseOmxErrorL(nData1Des)); + break; + case OMX_EventCmdComplete: + nData1 = static_cast(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(ParseOmxErrorL(nData1Des)); + break; + case OMX_EventCmdComplete: + nData1 = static_cast(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; + } + CheckForAbortL(iCallback.MosSetAudioPortDefL(comp, port, codingTypePtr)); + } + 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(-1); + } + OMX_ENDIANTYPE endian = OMX_EndianMax; + des = FindAttribute(aAttributes, _L8("endian")); + if(des != NULL) + { + endian = ParseEndianL(*des); + } + else + { + endian = static_cast(-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 (-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("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("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("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)); + } + + 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) + { + OMX_ERRORTYPE error = OMX_ErrorMax; + + if (aErrorCode == _L8("OMX_ErrorNone")) + { + error = OMX_ErrorNone; + } + else if (aErrorCode == _L8("OMX_ErrorBadPortIndex")) + { + error = OMX_ErrorBadPortIndex; + } + else if (aErrorCode == _L8("OMX_ErrorBadParameter")) + { + error = OMX_ErrorBadParameter; + } + else if (aErrorCode == _L8("OMX_ErrorPortsNotCompatible")) + { + error = OMX_ErrorPortsNotCompatible; + } + else if (aErrorCode == _L8("OMX_ErrorUnsupportedSetting")) + { + error = OMX_ErrorUnsupportedSetting; + } + else if (aErrorCode == _L8("OMX_ErrorIncorrectStateOperation")) + { + error = OMX_ErrorIncorrectStateOperation; + } + else if (aErrorCode == _L8("OMX_ErrorUnsupportedIndex")) + { + error = OMX_ErrorUnsupportedIndex; + } + else if (aErrorCode == _L8("OMX_ErrorNotReady")) + { + error = OMX_ErrorNotReady; + } + else if (aErrorCode == _L8("OMX_ErrorContentPipeOpenFailed")) + { + error = OMX_ErrorContentPipeOpenFailed; + } + else if (aErrorCode == _L8("OMX_ErrorNotImplemented")) + { + error = OMX_ErrorNotImplemented; + } + + // TODO: the other error code will be added in demand + + return error; + } + +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& 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& 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(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 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& 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& 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& 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; + } + } + diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/xmlclient/src/omxscriptparser.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/xmlclient/src/omxscriptparser.h Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,239 @@ +/* +* 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 +#include +#include + +#include + + +// 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 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; + virtual TBool MosGetFilename(const TDesC8& aComp, TDesC& aFilename) = 0; + virtual TBool MosSetBadFilename(const TDesC8& aComp) = 0; + + virtual TBool MosSetBufferCount(const TDesC8& aComp, TInt aPortIndex, TInt aCount, OMX_ERRORTYPE aExpectedError) = 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 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) = 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 MosSetActiveStream(const TDesC8& aComp, TUint32 aPortIndex)= 0; + virtual TBool MosGetActiveStream(const TDesC8& aComp, TUint32 aPortIndex) = 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 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; + + + 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; + + }; + +/** + * 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& aArray, const TDesC8& aAttribName); + const TDesC8& FindAttributeL(const RArray& 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& aArray, const TDesC8& aAttribName, TInt aDefaultValue); + static TReal ParseOptionalRealL(const RArray& 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& 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_*/ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/xmlclient/src/omxscripttest.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/xmlclient/src/omxscripttest.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,3033 @@ +/* +* 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 "omxutil.h" +#include "nontunneledhandler.h" + +#include "log.h" +#include "omx_xml_script.h" +#include "transition.h" +#include "parsemap.h" +#include + +#include "baseprofilehandler.h" +#include "baseprofiletimestamping.h" +#include "windowmanager.h" + + +//Logical IL headers +//#include +//#include + +/////////////////////////////////////////////////////////////////////////////// +// 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; + } + + 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(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::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 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::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(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) + { + 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 != OMX_ErrorNone) && (error != OMX_ErrorOverflow) && (error != OMX_ErrorUnsupportedSetting)) + { + FailWithOmxError(_L("GetParameter(OMX_IndexParamContentURI)"), error); + 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::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::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(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(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(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(aProfile); + } + if(aStreamFormat != -1) + { + aacProfile.eAACStreamFormat = static_cast(aStreamFormat); + } + if(aChannelMode != -1) + { + aacProfile.eChannelMode = static_cast(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_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) + { + FailWithOmxError(_L("SetParameter()"), error); + 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::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_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_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_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_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(""); + } + +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) + { + // do nothing + } + + // ignore buffer flag events except EOS + + 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(); + } + +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::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(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(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(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 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& aComponents, + const RTunnelRelations& aTunnelRelations, + RArray& aOrder) + { + RPointerArray 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 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::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(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; + } + + +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 +#include "omxthreadrequest.h" +#include "omx_xml_script.h" +//#include +#include +#include +#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 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 MosSetBadFilename(const TDesC8& aComp); + TBool MosGetFilename(const TDesC8& aComp, TDesC& aFilename); + + TBool MosSetBufferCount(const TDesC8& aComp, TInt aPortIndex, TInt aCount, OMX_ERRORTYPE aExpectedError); + + 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); + + 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); + 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 MosForceFlushBuffer(const TDesC8& aComp, TInt aPortIndex, OMX_ERRORTYPE aExpectedError); + TBool MosSetActiveStream(const TDesC8& aComp, TUint32 aPortIndex); + TBool MosGetActiveStream(const TDesC8& aComp, TUint32 aPortIndex); + 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); + + +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); + + + 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); + + 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 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_xml + { +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 iTunnels; + typedef RArray RTunnelRelations; + void FindTransitionOrderL(const RPointerArray& aComponents, + const RTunnelRelations& aTunnelRelations, + RArray& aOrder); + +private: + TBool iCoreLoaded; + RPointerArray iComponents; + RASBreakEventHandler iEventHandler; + OMX_STATETYPE iState; + + // Symbian graphic sink specialisation + CWindowManager* iWindowManager; + TVideoFitMode iVideoFitMode; + OMX_INDEXTYPE iExtSurfaceConfigIndex; + OMX_COMPONENTTYPE* iGraphicSink; + + CVideoTestTimer *iTimer; + + RArray iExpectedEvents; + TBool iWaitingForEvents; + + CNonTunneledHandler* iNonTunneledHandler; + RArray iIgnoredEvents; + + // Buffer component handler + CVideoBufferHandler* iBufferHandler; + CVideoBufferSinkHandler* iBufferSinkHandler; + + TInt iReason; + TOmxScriptTestVerdict iVerdict; + MOmxScriptTestLogger& iLogger; + + CAsyncCallBack* iStopSchedulerCallback; + + RMsgQueue iMsgQueue; + CPortBufferHandler* iPortBufferHandler; + }; + +#endif /*OMXSCRIPTTEST_H_*/ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/xmlclient/src/omxthreadrequest.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/xmlclient/src/omxthreadrequest.cpp Fri May 07 16:25:23 2010 +0100 @@ -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(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(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); + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/xmlclient/src/omxthreadrequest.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/xmlclient/src/omxthreadrequest.h Fri May 07 16:25:23 2010 +0100 @@ -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 +#include + +#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 diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/xmlclient/src/omxutil.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/xmlclient/src/omxutil.cpp Fri May 07 16:25:23 2010 +0100 @@ -0,0 +1,46 @@ +/* +* 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_ErrorUndefined); + DEFERR(OMX_ErrorComponentNotFound); + DEFERR(OMX_ErrorInsufficientResources); + DEFERR(OMX_ErrorInvalidComponentName); + DEFERR(OMX_ErrorPortsNotCompatible); + DEFERR(OMX_ErrorUnsupportedIndex); + DEFERR(OMX_ErrorBadParameter); + DEFERR(OMX_ErrorIncorrectStateTransition); + DEFERR(OMX_ErrorIncorrectStateOperation); + DEFERR(OMX_ErrorInvalidState); + DEFERR(OMX_ErrorInvalidComponent); + DEFERR(OMX_ErrorBadPortIndex); + DEFERR(OMX_ErrorContentPipeOpenFailed); + DEFERR(OMX_ErrorUnsupportedSetting); +#undef DEFERR + default: + aErrorDes.Format(_L("%u"), aError); + break; + } + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/xmlclient/src/omxutil.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/xmlclient/src/omxutil.h Fri May 07 16:25:23 2010 +0100 @@ -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 +#include + +class OMXUtil + { +public: + static void ErrorDes(OMX_ERRORTYPE aError, TBuf<64>& aErrorDes); + }; + +#endif /*OMXUTIL_H_*/ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/xmlclient/src/paramconversion.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/xmlclient/src/paramconversion.cpp Fri May 07 16:25:23 2010 +0100 @@ -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 +#include + +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(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(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; + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/xmlclient/src/paramconversion.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/xmlclient/src/paramconversion.h Fri May 07 16:25:23 2010 +0100 @@ -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 + +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_*/ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/xmlclient/src/parsemap.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/xmlclient/src/parsemap.c Fri May 07 16:25:23 2010 +0100 @@ -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 +#include +#include +#include + +/* 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; +} diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/xmlclient/src/parsemap.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/xmlclient/src/parsemap.h Fri May 07 16:25:23 2010 +0100 @@ -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_ */ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/xmlclient/src/portbufferhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/xmlclient/src/portbufferhandler.cpp Fri May 07 16:25:23 2010 +0100 @@ -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(aBufHdr->nOutputPortIndex), CPortInfo::ComparePortNum); + } + else + { + pos = iPorts.Find(static_cast(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 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); + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/xmlclient/src/portbufferhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/xmlclient/src/portbufferhandler.h Fri May 07 16:25:23 2010 +0100 @@ -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 +#include +#include +#include +#include + +#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 aFmt,...); + + enum + { + EBufferFree, + EBufferUnderUse + }; + + private: + TBuf iFileName; + RFs iFs; + RFile iFileObject; + OMX_COMPONENTTYPE* iComp; + TInt iPortNum; + TInt iNumBufs; + OMX_BUFFERSUPPLIERTYPE iSupplier; + RPointerArray iBuffers; + RPointerArray 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 iPorts; + OMX_STATETYPE iState; + }; + + + RPointerArray iComponents; + }; + +#endif // PORTBUFFERHANDLER_H diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/xmlclient/src/statedes.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/xmlclient/src/statedes.cpp Fri May 07 16:25:23 2010 +0100 @@ -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; + } + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/xmlclient/src/statedes.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/xmlclient/src/statedes.h Fri May 07 16:25:23 2010 +0100 @@ -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 +#include +#include + +const TDesC* StateDes(OMX_STATETYPE aState); +const TDesC* ClockStateDes(OMX_TIME_CLOCKSTATE aClockState); + +#endif /*STATEDES_H_*/ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/xmlclient/src/threadedlogger.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/xmlclient/src/threadedlogger.cpp Fri May 07 16:25:23 2010 +0100 @@ -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(aFile); + iLine = aLine; + iSeverity = aSeverity; + iMessage = &const_cast(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); + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/xmlclient/src/threadedlogger.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/xmlclient/src/threadedlogger.h Fri May 07 16:25:23 2010 +0100 @@ -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_ */ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/xmlclient/src/transition.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/xmlclient/src/transition.cpp Fri May 07 16:25:23 2010 +0100 @@ -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 + +void CloseSupplierRelations(TAny* aPtr) + { + RSupplierRelations& links = *reinterpret_cast(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& aOrder) + { + if(aOrder.Count() > 0) + { + User::Leave(KErrArgument); + } + + TInt numComponents = aSupplierRelations.Count(); + TInt numPendingComponents = numComponents; + RArray 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); + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/xmlclient/src/transition.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/xmlclient/src/transition.h Fri May 07 16:25:23 2010 +0100 @@ -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 + +/** RSupplierRelations represents the buffer supplier links in a graph */ +typedef RArray > 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& aOrder); + +#endif /*TRANSITION_H_*/ diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/xmlclient/src/videotesttimer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/xmlclient/src/videotesttimer.cpp Fri May 07 16:25:23 2010 +0100 @@ -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(); + } + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/xmlclient/src/videotesttimer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/xmlclient/src/videotesttimer.h Fri May 07 16:25:23 2010 +0100 @@ -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 + + + + +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 diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/xmlclient/src/windowmanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/xmlclient/src/windowmanager.cpp Fri May 07 16:25:23 2010 +0100 @@ -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(aParam1); + return iWsSession.RegisterSurface(iWsSd->GetScreenNumber(), surfaceId); + } + case ESetBackgroundSurface: + { + TSurfaceConfiguration& surfaceConfig = *reinterpret_cast(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(); + } diff -r c1e808730d6c -r eedf2dcd43c6 omxil/xmltestharness/xmlclient/src/windowmanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omxil/xmltestharness/xmlclient/src/windowmanager.h Fri May 07 16:25:23 2010 +0100 @@ -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 +#include + +/** + * 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 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_ */