os/mm/mmdevicefw/mdf/src/openmax/omxinputport.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/mmdevicefw/mdf/src/openmax/omxinputport.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,270 @@
     1.4 +// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +#include <omxprocessingunit.h>
    1.20 +#include <omxinputport.h>
    1.21 +#include <mdf/mdfpuconfig.h>
    1.22 +#include "omxcomponentbody.h"
    1.23 +#include "omxinputportbody.h"
    1.24 +
    1.25 +_LIT(KOmxInputPort, "OmxInputPort");
    1.26 +
    1.27 +/**
    1.28 +Constructor.
    1.29 +*/
    1.30 +EXPORT_C COmxInputPort::COmxInputPort()
    1.31 +	{
    1.32 +	}
    1.33 +
    1.34 +/**
    1.35 +Destructor.
    1.36 +*/
    1.37 +EXPORT_C COmxInputPort::~COmxInputPort()
    1.38 +	{
    1.39 +	delete iBody;
    1.40 +	}
    1.41 +	
    1.42 +/**
    1.43 +Class constructor.
    1.44 +*/
    1.45 +EXPORT_C void COmxInputPort::ConstructL(TInt aIndex, COmxProcessingUnit* aComponent)
    1.46 +	{
    1.47 +	__ASSERT_ALWAYS(!iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
    1.48 +	iBody = CBody::NewL(aIndex, aComponent, this);
    1.49 +	}
    1.50 +
    1.51 +	
    1.52 +/**
    1.53 +Synchronous function used to configure the OpenMAX Input Port.
    1.54 +@param  aConfiguration
    1.55 +		Holds the configuration parameters for the OpenMAX Input Port.
    1.56 +@return An error code indicating if the function call was successful. KErrNone on success, otherwise
    1.57 +	    nother of the system-wide error codes.
    1.58 +*/
    1.59 +EXPORT_C TInt COmxInputPort::MipConfigure(const TPuConfig& aConfig)
    1.60 +	{
    1.61 +	__ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
    1.62 +	return iBody->MipConfigure(aConfig);	
    1.63 +	}	
    1.64 +	
    1.65 +
    1.66 +/**
    1.67 +Synchronous method which gets a configuration structure for the OpenMAX Input Port
    1.68 +@param  aConfig
    1.69 +		The reference to the structure that is to contain the configuration information.
    1.70 +@return An error code indicating if the function call was successful. KErrNone on success, otherwise
    1.71 +	    another of the system-wide error codes.	
    1.72 +*/
    1.73 +EXPORT_C TInt COmxInputPort::MipGetConfig(TPuConfig& aConfig)
    1.74 +	{
    1.75 +	__ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
    1.76 +	return iBody->MipGetConfig(aConfig);	
    1.77 +	}	
    1.78 +
    1.79 +
    1.80 +/**
    1.81 +Synchronous function used to initialise the OpenMAX Input Port.
    1.82 +*/
    1.83 +EXPORT_C void COmxInputPort::MipInitialize()
    1.84 +	{	
    1.85 +	__ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
    1.86 +	iBody->MipInitialize();
    1.87 +	}
    1.88 +
    1.89 +
    1.90 +/**
    1.91 +Synchronous function used to instruct the OpenMAX Input Port to create a buffer. 
    1.92 +@param  aBufferSize
    1.93 +		The size of the buffer to be created.
    1.94 +@return A pointer to the new created buffer.
    1.95 +*/
    1.96 +EXPORT_C CMMFBuffer* COmxInputPort::MipCreateBuffer(TInt aBufferSize)
    1.97 +	{
    1.98 +	__ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
    1.99 +	return iBody->MipCreateBuffer(aBufferSize);
   1.100 +	}
   1.101 +
   1.102 +
   1.103 +/**
   1.104 +Synchronous function used to instruct the OpenMAX Input Port to use the buffer 
   1.105 +passed in the function's argument. 
   1.106 +@param  aBuffer
   1.107 +		The buffer to be used by the Input Port.
   1.108 +@return An error code indicating if the function call was successful. KErrNone on success, otherwise
   1.109 +	    another of the system-wide error codes.
   1.110 +*/
   1.111 +EXPORT_C TInt COmxInputPort::MipUseBuffer(CMMFBuffer& aBuffer)
   1.112 +	{
   1.113 +	__ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
   1.114 +	return iBody->MipUseBuffer(aBuffer);		
   1.115 +	}
   1.116 +
   1.117 +
   1.118 +/**
   1.119 +Synchronous function used to instruct the OpenMAX Input Port to free the buffer given
   1.120 +passed in the function's argument. 
   1.121 +@param  aBuffer
   1.122 +		The buffer to be freed
   1.123 +@return An error code indicating if the function call was successful. KErrNone on success, otherwise
   1.124 +	    another of the system-wide error codes.
   1.125 +*/	
   1.126 +EXPORT_C TInt COmxInputPort::MipFreeBuffer(CMMFBuffer* aBuffer)
   1.127 +	{
   1.128 +	__ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
   1.129 +	return iBody->MipFreeBuffer(aBuffer);		
   1.130 +	}
   1.131 +
   1.132 +
   1.133 +/**
   1.134 +Synchronous function used to request the set up of a tunnel between this OpenMAX Input Port
   1.135 +and an OpenMAX Output Port.
   1.136 +@param  aOutputPortToBeConnectedTo
   1.137 +		Reference to the Output Port to be connected to.
   1.138 +@param  aTunnelFlags
   1.139 +		Control flags for tunneling
   1.140 +@param  aSupplierType
   1.141 +		Specifies the supplier of the buffers for the tunnel.
   1.142 +@return An error code indicating if the function call was successful. KErrNone on success, otherwise
   1.143 +	    another of the system-wide error codes.
   1.144 +*/
   1.145 +EXPORT_C TInt COmxInputPort::MipTunnelRequest(const MMdfOutputPort& aOutputPortToBeConnectedTo,
   1.146 +		TTunnelFlags& aTunnelFlags, TSupplierType& aSupplierType) 
   1.147 +	{
   1.148 +	__ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
   1.149 +	return iBody->MipTunnelRequest(aOutputPortToBeConnectedTo, aTunnelFlags, aSupplierType);
   1.150 +	}
   1.151 +	
   1.152 +
   1.153 +/**
   1.154 +Asynchronous function used to write data to the OpenMAX Input Port.
   1.155 +@param  aBuffer
   1.156 +		Reference to the buffer containing data.
   1.157 +*/		 
   1.158 +EXPORT_C void COmxInputPort::MipWriteData(CMMFBuffer& aInputBuffer)
   1.159 +	{
   1.160 +	__ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
   1.161 +	iBody->MipWriteData(aInputBuffer);	
   1.162 +	}
   1.163 +
   1.164 +
   1.165 +/**
   1.166 +Asynchronous function used to disconnect a tunnelled port, and thus stop the data processing.
   1.167 +*/
   1.168 +EXPORT_C void COmxInputPort::MipDisconnectTunnel()
   1.169 +	{
   1.170 +	__ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
   1.171 +	iBody->MipDisconnectTunnel();
   1.172 +	}
   1.173 +
   1.174 +/**
   1.175 +Asynchronous function used to restart the data processing of a tunnelled port.
   1.176 +*/		 
   1.177 +EXPORT_C void COmxInputPort::MipRestartTunnel()
   1.178 +	{
   1.179 +	__ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
   1.180 +	iBody->MipRestartTunnel();
   1.181 +	}		
   1.182 +
   1.183 +	
   1.184 +/**
   1.185 +Synchronous function used to find out if an OpenMAX Input Port is tunnelled or not.
   1.186 +@return ETrue if the Input Port is tunnelled, EFalse otherwise.
   1.187 +*/		
   1.188 +EXPORT_C TBool COmxInputPort::MipIsTunnelled() const
   1.189 +	{
   1.190 +	__ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
   1.191 +	return iBody->MipIsTunnelled();
   1.192 +	}
   1.193 +
   1.194 +
   1.195 +/**
   1.196 +Synchronous function used to get the OpenMAX Input Port index
   1.197 +@return The OpenMAX Input Port index.
   1.198 +*/
   1.199 +EXPORT_C TInt COmxInputPort::MipIndex() const
   1.200 +	{
   1.201 +	__ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
   1.202 +	return iBody->MipIndex();
   1.203 +	}
   1.204 +	
   1.205 +	 
   1.206 +/**
   1.207 +Synchronous function used to get the size of the buffer(s) used by the OpenMAX Input Port.
   1.208 +@param The OpenMAX Input Port's buffer size.
   1.209 +*/		 
   1.210 +EXPORT_C TUint32 COmxInputPort::MipBufferSize() const
   1.211 +	{
   1.212 +	return iBody->MipBufferSize();
   1.213 +	}
   1.214 +
   1.215 +
   1.216 +/**
   1.217 +Synchronous function used to set the observer for the OpenMAX Input Port. 
   1.218 +@param  aOutputPortObserver
   1.219 +		The observer of the OpenMAX Input Port.
   1.220 +*/
   1.221 +EXPORT_C void COmxInputPort::MipSetObserver(const MMdfInputPortObserver& aOutputPortObserver)
   1.222 +	{
   1.223 +	iBody->MipSetObserver(aOutputPortObserver);
   1.224 +	}
   1.225 +
   1.226 +/**
   1.227 +Request extension feature. This is intended to provide additional features. 
   1.228 +@param  aUid
   1.229 +	    Used to indicate which interface is required. 
   1.230 +@return Standard error code. KErrNotSupported is used to indicate that the particular
   1.231 +	    plugin is not used.
   1.232 +*/
   1.233 +EXPORT_C TInt COmxInputPort::MipCreateCustomInterface(TUid aUid)
   1.234 +	{
   1.235 +	return iBody->MipCreateCustomInterface(aUid);	
   1.236 +	}
   1.237 +		 	 
   1.238 +/**
   1.239 +Return previously created extension.
   1.240 +This returns a custom interface. This should only be used if CreateCustomInterface() has already
   1.241 +been called for the same UID value. This means that any construction for that interface
   1.242 +has already been called, and thus this call cannot fail.
   1.243 +@param aUid
   1.244 +	   Used to indicate which interface is required. 
   1.245 +@return The requested interface, or NULL if not known.
   1.246 +@see MipCreateCustomInterface()
   1.247 +*/
   1.248 +EXPORT_C TAny* COmxInputPort::MipCustomInterface(TUid aUid)
   1.249 +	{
   1.250 +	__ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
   1.251 +	return MipCustomInterface(aUid);
   1.252 +	}
   1.253 +	
   1.254 +/**
   1.255 +Synchronous function used to return the observer for the OpenMAx Input Port.
   1.256 +@return Pointer to this class obsever
   1.257 +*/	
   1.258 +EXPORT_C MMdfInputPortObserver* COmxInputPort::Observer() const
   1.259 +	{
   1.260 +	__ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
   1.261 +	return iBody->Observer();
   1.262 +	}
   1.263 +
   1.264 +/**
   1.265 +Synchronous function used to return the OpenMAX Processing Unit this Input Port
   1.266 +belongs to. 
   1.267 +@return Pointer to the OpenMAX Processing Unit this Input Port belongs to. 
   1.268 +*/	
   1.269 +EXPORT_C COmxProcessingUnit* COmxInputPort::Component() const
   1.270 +	{
   1.271 +	__ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
   1.272 +	return iBody->Component();
   1.273 +	}