First public contribution.
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.
22 #ifndef MDFOUTPUTPORT_H
23 #define MDFOUTPUTPORT_H
26 #include <mdf/mdfcommon.h>
28 class CMdfProcessingUnit;
32 class MMdfInputPortObserver;
36 Codec API Output Port observer class.
38 class MMdfOutputPortObserver
42 Called by the Codec API Output Port when MopReadData() has completed.
44 The Output Port which sent the callback.
46 The buffer read by the Output Port.
48 An error code indicating if the function call was successful. KErrNone on success, otherwise
49 another of the system-wide error codes.
51 virtual void MopoReadDataComplete(const MMdfOutputPort* aOutputPort,
52 CMMFBuffer* aBuffer, TInt aErrorCode) = 0;
55 Called by the Codec API Output Port when MopDisconnectTunnel() has completed.
57 The Output Port which sent the callback.
59 An error code indicating if the function call was successful. KErrNone on success, otherwise
60 another of the system-wide error codes.
62 virtual void MopoDisconnectTunnelComplete(const MMdfOutputPort* aOutputPort,
66 Called by the Codec API Output Port when MopRestartTunnel() has completed.
68 The Ouput Port which sent the callback.
70 An error code indicating if the function call was successful. KErrNone on success, otherwise
71 another of the system-wide error codes.
73 virtual void MopoRestartTunnelComplete(const MMdfOutputPort* aOutputPort,
78 Codec API Output Port interface.
84 Synchronous function used to configure the Output Port.
86 Holds the configuration parameters for the Output Port.
87 @return An error code indicating if the function call was successful. KErrNone on success, otherwise
88 another of the system-wide error codes.
90 virtual TInt MopConfigure(const TPuConfig& aConfiguration) = 0;
94 Synchronous method which gets a configuration structure for the Output Port
95 @param aConfigurationSetup
96 The reference to the structure that is to contain the configuration information
97 @return An error code indicating if the function call was successful. KErrNone on success, otherwise
98 another of the system-wide error codes.
100 virtual TInt MopGetConfig(TPuConfig& aConfigurationSetup) = 0;
104 Synchronous function used to initialise the Output Port.
106 virtual void MopInitialize() = 0;
109 Synchronous function used to set the observer for the Output Port.
110 @param aOutputPortObserver
111 The observer of the Output Port.
113 virtual void MopSetObserver(const MMdfOutputPortObserver& aOutputPortObserver) = 0;
116 Synchronous function used to instruct the Output Port to create a buffer.
118 The size of the buffer to be created.
119 @return A pointer to the newly created buffer.
121 virtual CMMFBuffer* MopCreateBuffer(TInt aBufferSize) = 0;
124 Synchronous function used to instruct the Output Port to use the buffer
125 passed in the function's argument.
127 The buffer to be used by the Output Port.
128 @return An error code indicating if the function call was successful. KErrNone on success, otherwise
129 another of the system-wide error codes.
131 virtual TInt MopUseBuffer(CMMFBuffer& aBuffer) = 0;
134 Synchronous function used to instruct the Output Port to free the buffer
135 passed in the function's argument.
137 The buffer to be freed
138 @return An error code indicating if the function call was successful. KErrNone on success, otherwise
139 another of the system-wide error codes.
141 virtual TInt MopFreeBuffer(CMMFBuffer* aBuffer) = 0;
144 Synchronous function used to request the set up of a tunnel between this Output Port
146 @param aInputPortToBeConnectedTo
147 Reference to the Input Port to be connected to.
149 Control flags for tunneling
151 Specifies the supplier of the buffers for the tunnel.
152 @return An error code indicating if the function call was successful. KErrNone on success, otherwise
153 another of the system-wide error codes.
155 virtual TInt MopTunnelRequest(const MMdfInputPort& aInputPortToBeConnectedTo,
156 TTunnelFlags& aTunnelFlags, TSupplierType& aSupplierType) = 0;
159 Asynchronous function used to read data from the Output Port.
161 Reference to the buffer containing data.
163 virtual void MopReadData(CMMFBuffer& aBuffer) = 0;
166 Asynchronous function used to disconnect a tunnelled port, and thus stop the data processing.
168 virtual void MopDisconnectTunnel() = 0;
171 Asynchronous function used to restart the data processing of a tunnelled port.
173 virtual void MopRestartTunnel() = 0;
176 Synchronous function used to find out if an Output Port is tunnelled or not.
177 @return ETrue if the Input Port is tunnelled, EFalse otherwise.
179 virtual TBool MopIsTunnelled() const = 0;
182 Synchronous function used to get the Output Port index
183 @return The Input Port index.
185 virtual TInt MopIndex() const = 0;
188 Synchronous function used to get the size of the buffer(s) used by the Output Port.
189 @return The Output Port's buffer size.
191 virtual TUint32 MopBufferSize() const = 0 ;
194 Request extension feature. This is intended to provide additional features.
196 Used to indicate which interface is required.
197 @return Standard error code. KErrNotSupported is used to indicate that the particular
200 virtual TInt MopCreateCustomInterface(TUid aUid) = 0;
203 Return previously created extension.
204 This returns a custom interface whose ownership is not transferred to the caller. This
205 should only be used if CreateCustomInterface() has already been called for the same UID
206 value. This means that any construction for that interface has already been called,
207 and thus this call cannot fail.
209 Used to indicate which interface is required.
210 @return The requested interface, or NULL if not known.
211 @see MopCreateCustomInterface()
213 virtual TAny* MopCustomInterface(TUid aUid) = 0;
216 #endif // MDFOUTPUTPORT_H