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 <omxoutputport.h>
17 #include <omxprocessingunit.h>
18 #include <mdf/mdfpuconfig.h>
19 #include "omxcomponentbody.h"
20 #include "omxoutputportbody.h"
22 _LIT(KOmxOutputPort, "OmxOutputPort");
27 EXPORT_C COmxOutputPort::COmxOutputPort()
34 EXPORT_C COmxOutputPort::~COmxOutputPort()
40 Called by an Input Port when MipWriteData() has completed.
42 The Input Port which sent the callback.
44 The data buffer which was written.
46 An error code indicating if the function call was successful. KErrNone on success, otherwise
47 another of the system-wide error codes.
49 EXPORT_C void COmxOutputPort::MipoWriteDataComplete(const MMdfInputPort* aInputPort,
50 CMMFBuffer* aBuffer, TInt aErrorCode)
52 __ASSERT_ALWAYS(iBody, User::Panic(KOmxOutputPort, EBodyNotCreated));
53 iBody->MipoWriteDataComplete(aInputPort, aBuffer, aErrorCode);
57 Called by an Input Port when MipDisconnectTunnel() has completed.
59 The Input Port which sent the callback.
61 An error code indicating if the function call was successful. KErrNone on success, otherwise
62 another of the system-wide error codes.
64 EXPORT_C void COmxOutputPort::MipoDisconnectTunnelComplete(const MMdfInputPort* aInputPort,
67 __ASSERT_ALWAYS(iBody, User::Panic(KOmxOutputPort, EBodyNotCreated));
68 iBody->MipoDisconnectTunnelComplete(aInputPort, aErrorCode);
72 Called by an Input Port when MipRestartTunnel() has completed.
74 The Input Port which sent the callback.
76 An error code indicating if the function call was successful. KErrNone on success, otherwise
77 another of the system-wide error codes.
79 EXPORT_C void COmxOutputPort::MipoRestartTunnelComplete(const MMdfInputPort* aInputPort,
82 __ASSERT_ALWAYS(iBody, User::Panic(KOmxOutputPort, EBodyNotCreated));
83 iBody->MipoRestartTunnelComplete(aInputPort, aErrorCode);
87 ConstructL. Must be used by derived class to create the component
89 EXPORT_C void COmxOutputPort::ConstructL(TInt aIndex, COmxProcessingUnit* aComponent)
91 __ASSERT_ALWAYS(!iBody, User::Panic(KOmxOutputPort, EBodyNotCreated));
92 iBody = CBody::NewL(aIndex, aComponent, this);
97 Synchronous function used to set the observer for the OpenMAX Output Port.
98 @param aOutputPortObserver
99 The observer of the Output Port.
101 EXPORT_C void COmxOutputPort::MopSetObserver(const MMdfOutputPortObserver& aOutputPortObserver)
103 __ASSERT_ALWAYS(iBody, User::Panic(KOmxOutputPort, EBodyNotCreated));
104 iBody->MopSetObserver(aOutputPortObserver);
108 Synchronous function used to configure the OpenMAX Output Port.
110 Holds the configuration parameters for the Output Port.
111 @return An error code indicating if the function call was successful. KErrNone on success, otherwise
112 another of the system-wide error codes.
114 EXPORT_C TInt COmxOutputPort::MopConfigure(const TPuConfig& aConfig)
116 __ASSERT_ALWAYS(iBody, User::Panic(KOmxOutputPort, EBodyNotCreated));
117 return iBody->MopConfigure(aConfig);
122 Synchronous method which gets a configuration structure for the Output Port
124 The reference to the structure that is to contain the configuration information
125 @return An error code indicating if the function call was successful. KErrNone on success, otherwise
126 another of the system-wide error codes.
128 EXPORT_C TInt COmxOutputPort::MopGetConfig(TPuConfig& aConfig)
130 __ASSERT_ALWAYS(iBody, User::Panic(KOmxOutputPort, EBodyNotCreated));
131 return iBody->MopGetConfig(aConfig);
136 Synchronous function used to initialise the OpenMAX Output Port.
138 EXPORT_C void COmxOutputPort::MopInitialize()
140 __ASSERT_ALWAYS(iBody, User::Panic(KOmxOutputPort, EBodyNotCreated));
141 iBody->MopInitialize();
146 Synchronous function used to instruct the Output Port to create a buffer.
148 The size of the buffer to be created.
149 @return A pointer to the newly created buffer.
151 EXPORT_C CMMFBuffer* COmxOutputPort::MopCreateBuffer(TInt aBufferSize)
153 __ASSERT_ALWAYS(iBody, User::Panic(KOmxOutputPort, EBodyNotCreated));
154 return iBody->MopCreateBuffer(aBufferSize);
159 Synchronous function used to instruct the OpenMAX Output Port to use the buffer
160 passed in the function's argument.
162 The buffer to be used by the OpenMAX Output Port.
163 @return An error code indicating if the function call was successful. KErrNone on success, otherwise
164 another of the system-wide error codes.
166 EXPORT_C TInt COmxOutputPort::MopUseBuffer(CMMFBuffer& aBuffer)
168 __ASSERT_ALWAYS(iBody, User::Panic(KOmxOutputPort, EBodyNotCreated));
169 return iBody->MopUseBuffer(aBuffer);
174 Synchronous function used to instruct the OpenMAX Output Port to free the buffer
175 passed in the function's argument.
177 The buffer to be freed
178 @return An error code indicating if the function call was successful. KErrNone on success, otherwise
179 another of the system-wide error codes.
181 EXPORT_C TInt COmxOutputPort::MopFreeBuffer(CMMFBuffer* aBuffer)
183 __ASSERT_ALWAYS(iBody, User::Panic(KOmxOutputPort, EBodyNotCreated));
184 return iBody->MopFreeBuffer(aBuffer);
189 Synchronous function used to request the set up of a tunnel between this Output Port
191 @param aInputPortToBeConnectedTo
192 Reference to the Input Port to be connected to.
194 Control flags for tunneling
196 Specifies the supplier of the buffers for the tunnel.
197 @return An error code indicating if the function call was successful. KErrNone on success, otherwise
198 another of the system-wide error codes.
200 EXPORT_C TInt COmxOutputPort::MopTunnelRequest(const MMdfInputPort& aInputPortToBeConnectedTo,
201 TTunnelFlags& aTunnelFlags, TSupplierType& aSupplierType)
203 __ASSERT_ALWAYS(iBody, User::Panic(KOmxOutputPort, EBodyNotCreated));
204 return iBody->MopTunnelRequest(aInputPortToBeConnectedTo, aTunnelFlags, aSupplierType);
209 Asynchronous function used to read data from the Output Port.
211 Reference to the buffer containing data.
213 EXPORT_C void COmxOutputPort::MopReadData(CMMFBuffer& aBuffer)
215 __ASSERT_ALWAYS(iBody, User::Panic(KOmxOutputPort, EBodyNotCreated));
216 iBody->MopReadData(aBuffer);
220 // used only for tunnelling
222 Asynchronous function used to disconnect a tunnelled port, and thus stop the data processing.
224 EXPORT_C void COmxOutputPort::MopDisconnectTunnel()
226 __ASSERT_ALWAYS(iBody, User::Panic(KOmxOutputPort, EBodyNotCreated));
227 iBody->MopDisconnectTunnel();
231 Asynchronous function used to restart the data processing of a tunnelled port.
233 EXPORT_C void COmxOutputPort::MopRestartTunnel()
235 __ASSERT_ALWAYS(iBody, User::Panic(KOmxOutputPort, EBodyNotCreated));
236 iBody->MopRestartTunnel();
241 Synchronous function used to find out if an Output Port is tunnelled or not.
242 @return ETrue if the Input Port is tunnelled, EFalse otherwise.
244 EXPORT_C TBool COmxOutputPort::MopIsTunnelled() const
246 __ASSERT_ALWAYS(iBody, User::Panic(KOmxOutputPort, EBodyNotCreated));
247 return iBody->MopIsTunnelled();
252 Synchronous function used to get the Output Port index
253 @return The Input Port index.
255 EXPORT_C TInt COmxOutputPort::MopIndex() const
257 __ASSERT_ALWAYS(iBody, User::Panic(KOmxOutputPort, EBodyNotCreated));
258 return iBody->MopIndex();
262 Synchronous function used to get the size of the buffer(s) used by the Output Port.
263 @param The Output Port's buffer size.
265 EXPORT_C TUint32 COmxOutputPort::MopBufferSize() const
267 __ASSERT_ALWAYS(iBody, User::Panic(KOmxOutputPort, EBodyNotCreated));
268 return iBody->MopBufferSize();
273 Request extension feature. This is intended to provide additional features.
275 Used to indicate which interface is required.
276 @return Standard error code. KErrNotSupported is used to indicate that the particular
279 EXPORT_C TInt COmxOutputPort::MopCreateCustomInterface(TUid aUid)
281 __ASSERT_ALWAYS(iBody, User::Panic(KOmxOutputPort, EBodyNotCreated));
282 return iBody->MopCreateCustomInterface(aUid);
286 Return previously created extension.
287 This returns a custom interface. This should only be used if CreateCustomInterface() has already
288 been called for the same UID value. This means that any construction for that interface
289 has already been called, and thus this call cannot fail.
291 Used to indicate which interface is required.
292 @return The requested interface, or NULL if not known.
293 @see MipCreateCustomInterface()
295 EXPORT_C TAny* COmxOutputPort::MopCustomInterface(TUid aUid)
297 __ASSERT_ALWAYS(iBody, User::Panic(KOmxOutputPort, EBodyNotCreated));
298 return iBody->MopCustomInterface(aUid);
302 Synchronous function used to return the observer for the OpenMAx Output Port.
303 @return Pointer to this class obsever
305 EXPORT_C MMdfOutputPortObserver* COmxOutputPort::Observer() const
307 __ASSERT_ALWAYS(iBody, User::Panic(KOmxOutputPort, EBodyNotCreated));
308 return iBody->Observer();
312 Synchronous function used to return the OpenMAX Processing Unit this Output Port
314 @return Pointer to the OpenMAX Processing Unit this Output Port belongs to.
316 EXPORT_C COmxProcessingUnit* COmxOutputPort::Component() const
318 __ASSERT_ALWAYS(iBody, User::Panic(KOmxOutputPort, EBodyNotCreated));
319 return iBody->Component();