sl@0: // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: sl@0: #ifndef MDFINPUTPORT_H sl@0: #define MDFINPUTPORT_H sl@0: sl@0: #include sl@0: #include sl@0: sl@0: class CMdfProcessingUnit; sl@0: class CMMFBuffer; sl@0: class MMdfInputPort; sl@0: class MMdfOutputPort; sl@0: class TPuConfig; sl@0: sl@0: /** sl@0: Codec API Input Port observer class. sl@0: */ sl@0: class MMdfInputPortObserver sl@0: { sl@0: public: sl@0: /** sl@0: Called by the Codec API Input Port when MipWriteData() has completed. sl@0: @param aInputPort sl@0: The Input Port which sent the callback. sl@0: @param aBuffer sl@0: The data buffer which was written. sl@0: @param aErrorCode sl@0: An error code indicating if the function call was successful. KErrNone on success, otherwise sl@0: another of the system-wide error codes. sl@0: */ sl@0: virtual void MipoWriteDataComplete(const MMdfInputPort* aInputPort, sl@0: CMMFBuffer* aBuffer, TInt aErrorCode) = 0; sl@0: sl@0: /** sl@0: Called by the Codec API Input Port when MipDisconnectTunnel() has completed. sl@0: @param aInputPort sl@0: The Input Port which sent the callback. sl@0: @param aErrorCode sl@0: An error code indicating if the function call was successful. KErrNone on success, otherwise sl@0: another of the system-wide error codes. sl@0: */ sl@0: virtual void MipoDisconnectTunnelComplete(const MMdfInputPort* aInputPort, sl@0: TInt aErrorCode) = 0; sl@0: sl@0: /** sl@0: Called by the Codec API Input Port when MipRestartTunnel() has completed. sl@0: @param aInputPort sl@0: The Input Port which sent the callback. sl@0: @param aErrorCode sl@0: An error code indicating if the function call was successful. KErrNone on success, otherwise sl@0: another of the system-wide error codes. sl@0: */ sl@0: virtual void MipoRestartTunnelComplete(const MMdfInputPort* aInputPort, sl@0: TInt aErrorCode) = 0; sl@0: }; sl@0: sl@0: /** sl@0: Codec API Input Port interface. sl@0: */ sl@0: class MMdfInputPort sl@0: { sl@0: public: sl@0: /** sl@0: Synchronous function used to configure the Input Port. sl@0: @param aConfiguration sl@0: Holds the configuration parameters for the Input Port. sl@0: @return An error code indicating if the function call was successful. KErrNone on success, otherwise sl@0: another of the system-wide error codes. sl@0: */ sl@0: virtual TInt MipConfigure(const TPuConfig& aConfiguration) = 0; sl@0: sl@0: /** sl@0: Synchronous method which gets a configuration structure for the Input Port sl@0: @param aConfigurationSetup sl@0: The reference to the structure that is to contain the configuration information sl@0: @return An error code indicating if the function call was successful. KErrNone on success, otherwise sl@0: another of the system-wide error codes. sl@0: */ sl@0: virtual TInt MipGetConfig(TPuConfig& aConfigurationSetup) = 0; sl@0: sl@0: /** sl@0: Synchronous function used to initialise the Input Port. sl@0: */ sl@0: virtual void MipInitialize() = 0; sl@0: sl@0: /** sl@0: Synchronous function used to set the observer for the Input Port. sl@0: @param aInputPortObserver sl@0: The observer of the Input Port. sl@0: */ sl@0: virtual void MipSetObserver(const MMdfInputPortObserver& aInputPortObserver) = 0; sl@0: sl@0: /** sl@0: Synchronous function used to instruct the Input Port to create a buffer. sl@0: @param aBufferSize sl@0: The size of the buffer to be created. sl@0: @return A pointer to the new created buffer. sl@0: */ sl@0: virtual CMMFBuffer* MipCreateBuffer(TInt aBufferSize) = 0; sl@0: sl@0: /** sl@0: Synchronous function used to instruct the Input Port to use the buffer sl@0: passed in the function's argument. sl@0: @param aBuffer sl@0: The buffer to be used by the Input Port. sl@0: @return An error code indicating if the function call was successful. KErrNone on success, otherwise sl@0: another of the system-wide error codes. sl@0: */ sl@0: virtual TInt MipUseBuffer(CMMFBuffer& aBuffer) = 0; sl@0: sl@0: /** sl@0: Synchronous function used to instruct the Input Port to free the buffer given sl@0: passed in the function's argument. sl@0: @param aBuffer sl@0: The buffer to be freed sl@0: @return An error code indicating if the function call was successful. KErrNone on success, otherwise sl@0: another of the system-wide error codes. sl@0: */ sl@0: virtual TInt MipFreeBuffer(CMMFBuffer* aBuffer) = 0; sl@0: sl@0: /** sl@0: Synchronous function used to request the set up of a tunnel between this Input Port sl@0: and an Output Port. sl@0: @param aOutputPortToBeConnectedTo sl@0: Reference to the Output Port to be connected to. sl@0: @param aTunnelFlags sl@0: Control flags for tunneling sl@0: @param aSupplierType sl@0: Specifies the supplier of the buffers for the tunnel. sl@0: @return An error code indicating if the function call was successful. KErrNone on success, otherwise sl@0: another of the system-wide error codes. sl@0: */ sl@0: virtual TInt MipTunnelRequest(const MMdfOutputPort& aOutputPortToBeConnectedTo, sl@0: TTunnelFlags& aTunnelFlags, TSupplierType& aSupplierType) = 0; sl@0: sl@0: /** sl@0: Asynchronous function used to write data to the Input Port. sl@0: @param aBuffer sl@0: Reference to the buffer containing data. sl@0: */ sl@0: virtual void MipWriteData(CMMFBuffer& aBuffer) = 0; sl@0: sl@0: /** sl@0: Asynchronous function used to disconnect a tunnelled port, and thus stop the data processing. sl@0: */ sl@0: virtual void MipDisconnectTunnel() = 0; sl@0: sl@0: /** sl@0: Asynchronous function used to restart the data processing of a tunnelled port. sl@0: */ sl@0: virtual void MipRestartTunnel() = 0; sl@0: sl@0: /** sl@0: Synchronous function used to find out if an Input Port is tunnelled or not. sl@0: @return ETrue if the Input Port is tunnelled, EFalse otherwise. sl@0: */ sl@0: virtual TBool MipIsTunnelled() const = 0; sl@0: sl@0: /** sl@0: Synchronous function used to get the Input Port index sl@0: @return The Input Port index. sl@0: */ sl@0: virtual TInt MipIndex() const = 0; sl@0: sl@0: /** sl@0: Synchronous function used to get the size of the buffer(s) used by the Input Port. sl@0: @return The Input Port's buffer size. sl@0: */ sl@0: virtual TUint32 MipBufferSize() const = 0 ; sl@0: sl@0: /** sl@0: Request extension feature. This is intended to provide additional features. sl@0: @param aUid sl@0: Used to indicate which interface is required. sl@0: @return Standard error code. KErrNotSupported is used to indicate that the particular sl@0: plugin is used. sl@0: */ sl@0: virtual TInt MipCreateCustomInterface(TUid aUid) = 0; sl@0: sl@0: /** sl@0: Return previously created extension. sl@0: This returns a custom interface whose ownership is not transferred to the caller. This sl@0: should only be used if CreateCustomInterface() has already been called for the same UID sl@0: value. This means that any construction for that interface has already been called, sl@0: and thus this call cannot fail. sl@0: @param aUid sl@0: Used to indicate which interface is required. sl@0: @return The requested interface, or NULL if not known. sl@0: @see MipCreateCustomInterface() sl@0: */ sl@0: virtual TAny* MipCustomInterface(TUid aUid) = 0; sl@0: }; sl@0: sl@0: #endif // MDFINPUTPORT_H