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 MDFOUTPUTPORT_H sl@0: #define MDFOUTPUTPORT_H sl@0: sl@0: #include sl@0: #include sl@0: sl@0: class CMdfProcessingUnit; sl@0: class CMMFBuffer; sl@0: class MMdfOutputPort; sl@0: class MMdfInputPort; sl@0: class MMdfInputPortObserver; sl@0: class TPuConfig; sl@0: sl@0: /** sl@0: Codec API Output Port observer class. sl@0: */ sl@0: class MMdfOutputPortObserver sl@0: { sl@0: public: sl@0: /** sl@0: Called by the Codec API Output Port when MopReadData() has completed. sl@0: @param aOutputPort sl@0: The Output Port which sent the callback. sl@0: @param aBuffer sl@0: The buffer read by the Output Port. 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 MopoReadDataComplete(const MMdfOutputPort* aOutputPort, sl@0: CMMFBuffer* aBuffer, TInt aErrorCode) = 0; sl@0: sl@0: /** sl@0: Called by the Codec API Output Port when MopDisconnectTunnel() has completed. sl@0: @param aOutputPort sl@0: The Output 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 MopoDisconnectTunnelComplete(const MMdfOutputPort* aOutputPort, sl@0: TInt aErrorCode) = 0; sl@0: sl@0: /** sl@0: Called by the Codec API Output Port when MopRestartTunnel() has completed. sl@0: @param aOutputPort sl@0: The Ouput 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 MopoRestartTunnelComplete(const MMdfOutputPort* aOutputPort, sl@0: TInt aErrorCode) = 0; sl@0: }; sl@0: sl@0: /** sl@0: Codec API Output Port interface. sl@0: */ sl@0: class MMdfOutputPort sl@0: { sl@0: public: sl@0: /** sl@0: Synchronous function used to configure the Output Port. sl@0: @param aConfiguration sl@0: Holds the configuration parameters for the Output 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 MopConfigure(const TPuConfig& aConfiguration) = 0; sl@0: sl@0: sl@0: /** sl@0: Synchronous method which gets a configuration structure for the Output 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 MopGetConfig(TPuConfig& aConfigurationSetup) = 0; sl@0: sl@0: sl@0: /** sl@0: Synchronous function used to initialise the Output Port. sl@0: */ sl@0: virtual void MopInitialize() = 0; sl@0: sl@0: /** sl@0: Synchronous function used to set the observer for the Output Port. sl@0: @param aOutputPortObserver sl@0: The observer of the Output Port. sl@0: */ sl@0: virtual void MopSetObserver(const MMdfOutputPortObserver& aOutputPortObserver) = 0; sl@0: sl@0: /** sl@0: Synchronous function used to instruct the Output 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 newly created buffer. sl@0: */ sl@0: virtual CMMFBuffer* MopCreateBuffer(TInt aBufferSize) = 0; sl@0: sl@0: /** sl@0: Synchronous function used to instruct the Output 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 Output 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 MopUseBuffer(CMMFBuffer& aBuffer) = 0; sl@0: sl@0: /** sl@0: Synchronous function used to instruct the Output Port to free the buffer 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 MopFreeBuffer(CMMFBuffer* aBuffer) = 0; sl@0: sl@0: /** sl@0: Synchronous function used to request the set up of a tunnel between this Output Port sl@0: and an Input Port. sl@0: @param aInputPortToBeConnectedTo sl@0: Reference to the Input 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 MopTunnelRequest(const MMdfInputPort& aInputPortToBeConnectedTo, sl@0: TTunnelFlags& aTunnelFlags, TSupplierType& aSupplierType) = 0; sl@0: sl@0: /** sl@0: Asynchronous function used to read data from the Output Port. sl@0: @param aBuffer sl@0: Reference to the buffer containing data. sl@0: */ sl@0: virtual void MopReadData(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 MopDisconnectTunnel() = 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 MopRestartTunnel() = 0; sl@0: sl@0: /** sl@0: Synchronous function used to find out if an Output Port is tunnelled or not. sl@0: @return ETrue if the Input Port is tunnelled, EFalse otherwise. sl@0: */ sl@0: virtual TBool MopIsTunnelled() const = 0; sl@0: sl@0: /** sl@0: Synchronous function used to get the Output Port index sl@0: @return The Input Port index. sl@0: */ sl@0: virtual TInt MopIndex() const = 0; sl@0: sl@0: /** sl@0: Synchronous function used to get the size of the buffer(s) used by the Output Port. sl@0: @return The Output Port's buffer size. sl@0: */ sl@0: virtual TUint32 MopBufferSize() 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 MopCreateCustomInterface(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 MopCreateCustomInterface() sl@0: */ sl@0: virtual TAny* MopCustomInterface(TUid aUid) = 0; sl@0: }; sl@0: sl@0: #endif // MDFOUTPUTPORT_H