Update contrib.
1 // Copyright (c) 2005-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #include <omxprocessingunit.h>
17 #include <omxinputport.h>
18 #include <mdf/mdfpuconfig.h>
19 #include "omxcomponentbody.h"
20 #include "omxinputportbody.h"
22 _LIT(KOmxInputPort, "OmxInputPort");
27 EXPORT_C COmxInputPort::COmxInputPort()
34 EXPORT_C COmxInputPort::~COmxInputPort()
42 EXPORT_C void COmxInputPort::ConstructL(TInt aIndex, COmxProcessingUnit* aComponent)
44 __ASSERT_ALWAYS(!iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
45 iBody = CBody::NewL(aIndex, aComponent, this);
50 Synchronous function used to configure the OpenMAX Input Port.
52 Holds the configuration parameters for the OpenMAX Input Port.
53 @return An error code indicating if the function call was successful. KErrNone on success, otherwise
54 nother of the system-wide error codes.
56 EXPORT_C TInt COmxInputPort::MipConfigure(const TPuConfig& aConfig)
58 __ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
59 return iBody->MipConfigure(aConfig);
64 Synchronous method which gets a configuration structure for the OpenMAX Input Port
66 The reference to the structure that is to contain the configuration information.
67 @return An error code indicating if the function call was successful. KErrNone on success, otherwise
68 another of the system-wide error codes.
70 EXPORT_C TInt COmxInputPort::MipGetConfig(TPuConfig& aConfig)
72 __ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
73 return iBody->MipGetConfig(aConfig);
78 Synchronous function used to initialise the OpenMAX Input Port.
80 EXPORT_C void COmxInputPort::MipInitialize()
82 __ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
83 iBody->MipInitialize();
88 Synchronous function used to instruct the OpenMAX Input Port to create a buffer.
90 The size of the buffer to be created.
91 @return A pointer to the new created buffer.
93 EXPORT_C CMMFBuffer* COmxInputPort::MipCreateBuffer(TInt aBufferSize)
95 __ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
96 return iBody->MipCreateBuffer(aBufferSize);
101 Synchronous function used to instruct the OpenMAX Input Port to use the buffer
102 passed in the function's argument.
104 The buffer to be used by the Input Port.
105 @return An error code indicating if the function call was successful. KErrNone on success, otherwise
106 another of the system-wide error codes.
108 EXPORT_C TInt COmxInputPort::MipUseBuffer(CMMFBuffer& aBuffer)
110 __ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
111 return iBody->MipUseBuffer(aBuffer);
116 Synchronous function used to instruct the OpenMAX Input Port to free the buffer given
117 passed in the function's argument.
119 The buffer to be freed
120 @return An error code indicating if the function call was successful. KErrNone on success, otherwise
121 another of the system-wide error codes.
123 EXPORT_C TInt COmxInputPort::MipFreeBuffer(CMMFBuffer* aBuffer)
125 __ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
126 return iBody->MipFreeBuffer(aBuffer);
131 Synchronous function used to request the set up of a tunnel between this OpenMAX Input Port
132 and an OpenMAX Output Port.
133 @param aOutputPortToBeConnectedTo
134 Reference to the Output Port to be connected to.
136 Control flags for tunneling
138 Specifies the supplier of the buffers for the tunnel.
139 @return An error code indicating if the function call was successful. KErrNone on success, otherwise
140 another of the system-wide error codes.
142 EXPORT_C TInt COmxInputPort::MipTunnelRequest(const MMdfOutputPort& aOutputPortToBeConnectedTo,
143 TTunnelFlags& aTunnelFlags, TSupplierType& aSupplierType)
145 __ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
146 return iBody->MipTunnelRequest(aOutputPortToBeConnectedTo, aTunnelFlags, aSupplierType);
151 Asynchronous function used to write data to the OpenMAX Input Port.
153 Reference to the buffer containing data.
155 EXPORT_C void COmxInputPort::MipWriteData(CMMFBuffer& aInputBuffer)
157 __ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
158 iBody->MipWriteData(aInputBuffer);
163 Asynchronous function used to disconnect a tunnelled port, and thus stop the data processing.
165 EXPORT_C void COmxInputPort::MipDisconnectTunnel()
167 __ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
168 iBody->MipDisconnectTunnel();
172 Asynchronous function used to restart the data processing of a tunnelled port.
174 EXPORT_C void COmxInputPort::MipRestartTunnel()
176 __ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
177 iBody->MipRestartTunnel();
182 Synchronous function used to find out if an OpenMAX Input Port is tunnelled or not.
183 @return ETrue if the Input Port is tunnelled, EFalse otherwise.
185 EXPORT_C TBool COmxInputPort::MipIsTunnelled() const
187 __ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
188 return iBody->MipIsTunnelled();
193 Synchronous function used to get the OpenMAX Input Port index
194 @return The OpenMAX Input Port index.
196 EXPORT_C TInt COmxInputPort::MipIndex() const
198 __ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
199 return iBody->MipIndex();
204 Synchronous function used to get the size of the buffer(s) used by the OpenMAX Input Port.
205 @param The OpenMAX Input Port's buffer size.
207 EXPORT_C TUint32 COmxInputPort::MipBufferSize() const
209 return iBody->MipBufferSize();
214 Synchronous function used to set the observer for the OpenMAX Input Port.
215 @param aOutputPortObserver
216 The observer of the OpenMAX Input Port.
218 EXPORT_C void COmxInputPort::MipSetObserver(const MMdfInputPortObserver& aOutputPortObserver)
220 iBody->MipSetObserver(aOutputPortObserver);
224 Request extension feature. This is intended to provide additional features.
226 Used to indicate which interface is required.
227 @return Standard error code. KErrNotSupported is used to indicate that the particular
230 EXPORT_C TInt COmxInputPort::MipCreateCustomInterface(TUid aUid)
232 return iBody->MipCreateCustomInterface(aUid);
236 Return previously created extension.
237 This returns a custom interface. This should only be used if CreateCustomInterface() has already
238 been called for the same UID value. This means that any construction for that interface
239 has already been called, and thus this call cannot fail.
241 Used to indicate which interface is required.
242 @return The requested interface, or NULL if not known.
243 @see MipCreateCustomInterface()
245 EXPORT_C TAny* COmxInputPort::MipCustomInterface(TUid aUid)
247 __ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
248 return MipCustomInterface(aUid);
252 Synchronous function used to return the observer for the OpenMAx Input Port.
253 @return Pointer to this class obsever
255 EXPORT_C MMdfInputPortObserver* COmxInputPort::Observer() const
257 __ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
258 return iBody->Observer();
262 Synchronous function used to return the OpenMAX Processing Unit this Input Port
264 @return Pointer to the OpenMAX Processing Unit this Input Port belongs to.
266 EXPORT_C COmxProcessingUnit* COmxInputPort::Component() const
268 __ASSERT_ALWAYS(iBody, User::Panic(KOmxInputPort, EBodyNotCreated));
269 return iBody->Component();