omxil_generic/omxilcomplib/src/omxilcomponentimpl.h
changeset 0 0e4a32b9112d
equal deleted inserted replaced
-1:000000000000 0:0e4a32b9112d
       
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 
       
    17 /**
       
    18  @file
       
    19  @internalComponent
       
    20 */
       
    21 
       
    22 #ifndef OMXILCOMPONENTIMPL_H
       
    23 #define OMXILCOMPONENTIMPL_H
       
    24 
       
    25 #include <e32base.h>
       
    26 #include <openmax/il/khronos/v1_x/OMX_Component.h>
       
    27 
       
    28 // forward declarations
       
    29 class COmxILFsm;
       
    30 class COmxILConfigManager;
       
    31 class MOmxILCallbackManagerIf;
       
    32 class MOmxILPortManagerIf;
       
    33 class MOmxILCallbackNotificationIf;
       
    34 class COmxILProcessingFunction;
       
    35 class COmxILPort;
       
    36 
       
    37 class COmxILComponentImpl : public CBase
       
    38 	{
       
    39 public:
       
    40 	static COmxILComponentImpl* NewL(COmxILComponent* aComponent, OMX_HANDLETYPE aHandle);
       
    41 	virtual ~COmxILComponentImpl();
       
    42 
       
    43 	void InitComponentL();
       
    44 	void ConstructL(OMX_HANDLETYPE aComponent);
       
    45 	MOmxILCallbackNotificationIf* CreateCallbackManagerL(COmxILComponent::TCallbackManagerType aCallbackManagerType);
       
    46 	void CreatePortManagerL(COmxILComponent::TPortManagerType aType,
       
    47 							const OMX_VERSIONTYPE& aOmxVersion,
       
    48 							OMX_U32 aNumberOfAudioPorts,
       
    49 							OMX_U32 aStartAudioPortNumber,
       
    50 							OMX_U32 aNumberOfImagePorts,
       
    51 							OMX_U32 aStartImagePortNumber,
       
    52 							OMX_U32 aNumberOfVideoPorts,
       
    53 							OMX_U32 aStartVideoPortNumber,
       
    54 							OMX_U32 aNumberOfOtherPorts,
       
    55 							OMX_U32 aStartOtherPortNumber,
       
    56 							OMX_BOOL aImmediateReturnTimeBuffer);
       
    57 	TInt AddPort(const COmxILPort* aPort, OMX_DIRTYPE aDirection);
       
    58 	void RegisterProcessingFunction(const COmxILProcessingFunction* aProcessingFunction);
       
    59 	void RegisterConfigurationManager(const COmxILConfigManager* aConfigManager);
       
    60 	//Getters
       
    61 	OMX_COMPONENTTYPE* GetHandle() const;
       
    62 	OMX_PTR GetAppData() const;
       
    63 	OMX_CALLBACKTYPE* GetCallbacks() const;
       
    64 	COmxILConfigManager* GetConfigManager() const;
       
    65 	COmxILProcessingFunction* GetProcessingFunction() const;
       
    66 	MOmxILCallbackNotificationIf* GetCallbackNotificationIf() const;
       
    67 	//Setters
       
    68 	void SetPortManagerForConfigManager();
       
    69 	
       
    70 private:
       
    71 	COmxILComponentImpl(COmxILComponent* aComponent, OMX_HANDLETYPE aHandle);
       
    72 	void ConstructL();
       
    73 	static OMX_ERRORTYPE GetComponentVersion(
       
    74 		OMX_HANDLETYPE aComponent,
       
    75 		OMX_STRING aComponentName,
       
    76 		OMX_VERSIONTYPE* apComponentVersion,
       
    77 		OMX_VERSIONTYPE* apSpecVersion,
       
    78 		OMX_UUIDTYPE* apComponentUUID);
       
    79 
       
    80     static OMX_ERRORTYPE SendCommand(
       
    81 		OMX_HANDLETYPE aComponent,
       
    82 		OMX_COMMANDTYPE aCmd,
       
    83 		OMX_U32 aParam1,
       
    84 		OMX_PTR aCmdData);
       
    85 
       
    86 	static OMX_ERRORTYPE GetParameter(
       
    87 		OMX_HANDLETYPE aComponent,
       
    88 		OMX_INDEXTYPE aParamIndex,
       
    89 		OMX_PTR aComponentParameterStructure);
       
    90 
       
    91 	static OMX_ERRORTYPE SetParameter(
       
    92 		OMX_HANDLETYPE aComponent,
       
    93 		OMX_INDEXTYPE aIndex,
       
    94 		OMX_PTR aComponentParameterStructure);
       
    95 
       
    96 	static OMX_ERRORTYPE GetConfig(
       
    97 		OMX_HANDLETYPE aComponent,
       
    98 		OMX_INDEXTYPE aIndex,
       
    99 		OMX_PTR aComponentConfigStructure);
       
   100 
       
   101 	static OMX_ERRORTYPE SetConfig(
       
   102 		OMX_HANDLETYPE aComponent,
       
   103 		OMX_INDEXTYPE aIndex,
       
   104 		OMX_PTR aComponentConfigStructure);
       
   105 
       
   106 	static OMX_ERRORTYPE GetExtensionIndex(
       
   107 		OMX_HANDLETYPE aComponent,
       
   108 		OMX_STRING aParameterName,
       
   109 		OMX_INDEXTYPE* aIndexType);
       
   110 
       
   111 	static OMX_ERRORTYPE GetState(
       
   112 		OMX_HANDLETYPE aComponent,
       
   113 		OMX_STATETYPE* aState);
       
   114 
       
   115 	static OMX_ERRORTYPE ComponentTunnelRequest(
       
   116 		OMX_HANDLETYPE aComp,
       
   117 		OMX_U32 aPort,
       
   118 		OMX_HANDLETYPE aTunneledComp,
       
   119 		OMX_U32 aTunneledPort,
       
   120 		OMX_TUNNELSETUPTYPE* aTunnelSetup);
       
   121 
       
   122 	static OMX_ERRORTYPE UseBuffer(
       
   123 		OMX_HANDLETYPE aComponent,
       
   124 		OMX_BUFFERHEADERTYPE** appBufferHdr,
       
   125 		OMX_U32 aPortIndex,
       
   126 		OMX_PTR apAppPrivate,
       
   127 		OMX_U32 aSizeBytes,
       
   128 		OMX_U8* aBuffer);
       
   129 
       
   130 	static OMX_ERRORTYPE AllocateBuffer(
       
   131 		OMX_HANDLETYPE aComponent,
       
   132 		OMX_BUFFERHEADERTYPE** apBuffer,
       
   133 		OMX_U32 aPortIndex,
       
   134 		OMX_PTR aAppData,
       
   135 		OMX_U32 aSizeBytes);
       
   136 
       
   137 	static OMX_ERRORTYPE FreeBuffer(
       
   138 		OMX_HANDLETYPE aComponent,
       
   139 		OMX_U32 aPortIndex,
       
   140 		OMX_BUFFERHEADERTYPE* aBuffer);
       
   141 
       
   142 	static OMX_ERRORTYPE EmptyThisBuffer(
       
   143 		OMX_HANDLETYPE aComponent,
       
   144 		OMX_BUFFERHEADERTYPE* aBuffer);
       
   145 
       
   146 	static OMX_ERRORTYPE FillThisBuffer(
       
   147 		OMX_HANDLETYPE aComponent,
       
   148 		OMX_BUFFERHEADERTYPE* aBuffer);
       
   149 
       
   150 	static OMX_ERRORTYPE SetCallbacks(
       
   151 		OMX_HANDLETYPE aComponent,
       
   152 		OMX_CALLBACKTYPE* aCallbacks,
       
   153 		OMX_PTR aAppData);
       
   154 
       
   155 	static OMX_ERRORTYPE ComponentDeInit(
       
   156 		OMX_HANDLETYPE aComponent);
       
   157 
       
   158     static OMX_ERRORTYPE UseEGLImage(
       
   159 		OMX_HANDLETYPE aComponent,
       
   160 		OMX_BUFFERHEADERTYPE** appBufferHdr,
       
   161 		OMX_U32 aPortIndex,
       
   162 		OMX_PTR aAppPrivate,
       
   163 		void* eglImage);
       
   164 
       
   165     static OMX_ERRORTYPE ComponentRoleEnum(
       
   166         OMX_HANDLETYPE aComponent,
       
   167 		OMX_U8* aRole,
       
   168 		OMX_U32 aIndex);
       
   169 	
       
   170 private:
       
   171 	COmxILComponent* ipComponent;
       
   172 	RBuf8 iComponentName;
       
   173 	OMX_COMPONENTTYPE* ipHandle;
       
   174 	OMX_PTR ipAppData;
       
   175 	OMX_CALLBACKTYPE* ipCallbacks;
       
   176 	COmxILFsm* ipFsm;
       
   177 	COmxILConfigManager* ipConfigManager;
       
   178 	MOmxILCallbackManagerIf* ipCallbackManager;
       
   179 	MOmxILPortManagerIf* ipPortManager;
       
   180 	COmxILProcessingFunction* ipProcessingFunction;
       
   181 	};
       
   182 
       
   183 #endif // OMXILCOMPONENTIMPL_H