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 MDFINPUTPORT_H
23 #define MDFINPUTPORT_H
26 #include <mdf/mdfcommon.h>
28 class CMdfProcessingUnit;
35 Codec API Input Port observer class.
37 class MMdfInputPortObserver
41 Called by the Codec API Input Port when MipWriteData() has completed.
43 The Input Port which sent the callback.
45 The data buffer which was written.
47 An error code indicating if the function call was successful. KErrNone on success, otherwise
48 another of the system-wide error codes.
50 virtual void MipoWriteDataComplete(const MMdfInputPort* aInputPort,
51 CMMFBuffer* aBuffer, TInt aErrorCode) = 0;
54 Called by the Codec API Input Port when MipDisconnectTunnel() has completed.
56 The Input Port which sent the callback.
58 An error code indicating if the function call was successful. KErrNone on success, otherwise
59 another of the system-wide error codes.
61 virtual void MipoDisconnectTunnelComplete(const MMdfInputPort* aInputPort,
65 Called by the Codec API Input Port when MipRestartTunnel() has completed.
67 The Input Port which sent the callback.
69 An error code indicating if the function call was successful. KErrNone on success, otherwise
70 another of the system-wide error codes.
72 virtual void MipoRestartTunnelComplete(const MMdfInputPort* aInputPort,
77 Codec API Input Port interface.
83 Synchronous function used to configure the Input Port.
85 Holds the configuration parameters for the Input Port.
86 @return An error code indicating if the function call was successful. KErrNone on success, otherwise
87 another of the system-wide error codes.
89 virtual TInt MipConfigure(const TPuConfig& aConfiguration) = 0;
92 Synchronous method which gets a configuration structure for the Input Port
93 @param aConfigurationSetup
94 The reference to the structure that is to contain the configuration information
95 @return An error code indicating if the function call was successful. KErrNone on success, otherwise
96 another of the system-wide error codes.
98 virtual TInt MipGetConfig(TPuConfig& aConfigurationSetup) = 0;
101 Synchronous function used to initialise the Input Port.
103 virtual void MipInitialize() = 0;
106 Synchronous function used to set the observer for the Input Port.
107 @param aInputPortObserver
108 The observer of the Input Port.
110 virtual void MipSetObserver(const MMdfInputPortObserver& aInputPortObserver) = 0;
113 Synchronous function used to instruct the Input Port to create a buffer.
115 The size of the buffer to be created.
116 @return A pointer to the new created buffer.
118 virtual CMMFBuffer* MipCreateBuffer(TInt aBufferSize) = 0;
121 Synchronous function used to instruct the Input Port to use the buffer
122 passed in the function's argument.
124 The buffer to be used by the Input Port.
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 virtual TInt MipUseBuffer(CMMFBuffer& aBuffer) = 0;
131 Synchronous function used to instruct the Input Port to free the buffer given
132 passed in the function's argument.
134 The buffer to be freed
135 @return An error code indicating if the function call was successful. KErrNone on success, otherwise
136 another of the system-wide error codes.
138 virtual TInt MipFreeBuffer(CMMFBuffer* aBuffer) = 0;
141 Synchronous function used to request the set up of a tunnel between this Input Port
143 @param aOutputPortToBeConnectedTo
144 Reference to the Output Port to be connected to.
146 Control flags for tunneling
148 Specifies the supplier of the buffers for the tunnel.
149 @return An error code indicating if the function call was successful. KErrNone on success, otherwise
150 another of the system-wide error codes.
152 virtual TInt MipTunnelRequest(const MMdfOutputPort& aOutputPortToBeConnectedTo,
153 TTunnelFlags& aTunnelFlags, TSupplierType& aSupplierType) = 0;
156 Asynchronous function used to write data to the Input Port.
158 Reference to the buffer containing data.
160 virtual void MipWriteData(CMMFBuffer& aBuffer) = 0;
163 Asynchronous function used to disconnect a tunnelled port, and thus stop the data processing.
165 virtual void MipDisconnectTunnel() = 0;
168 Asynchronous function used to restart the data processing of a tunnelled port.
170 virtual void MipRestartTunnel() = 0;
173 Synchronous function used to find out if an Input Port is tunnelled or not.
174 @return ETrue if the Input Port is tunnelled, EFalse otherwise.
176 virtual TBool MipIsTunnelled() const = 0;
179 Synchronous function used to get the Input Port index
180 @return The Input Port index.
182 virtual TInt MipIndex() const = 0;
185 Synchronous function used to get the size of the buffer(s) used by the Input Port.
186 @return The Input Port's buffer size.
188 virtual TUint32 MipBufferSize() const = 0 ;
191 Request extension feature. This is intended to provide additional features.
193 Used to indicate which interface is required.
194 @return Standard error code. KErrNotSupported is used to indicate that the particular
197 virtual TInt MipCreateCustomInterface(TUid aUid) = 0;
200 Return previously created extension.
201 This returns a custom interface whose ownership is not transferred to the caller. This
202 should only be used if CreateCustomInterface() has already been called for the same UID
203 value. This means that any construction for that interface has already been called,
204 and thus this call cannot fail.
206 Used to indicate which interface is required.
207 @return The requested interface, or NULL if not known.
208 @see MipCreateCustomInterface()
210 virtual TAny* MipCustomInterface(TUid aUid) = 0;
213 #endif // MDFINPUTPORT_H