os/mm/mmdevicefw/mdf/inc/codecapi/mdfoutputport.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 /**
    17  @file
    18  @publishedPartner
    19  @released
    20 */
    21 
    22 #ifndef MDFOUTPUTPORT_H
    23 #define MDFOUTPUTPORT_H
    24 
    25 #include <e32base.h>
    26 #include <mdf/mdfcommon.h>
    27 
    28 class CMdfProcessingUnit;
    29 class CMMFBuffer;
    30 class MMdfOutputPort;
    31 class MMdfInputPort;
    32 class MMdfInputPortObserver;
    33 class TPuConfig;
    34 
    35 /**
    36 Codec API Output Port observer class.
    37 */
    38 class MMdfOutputPortObserver
    39 	{
    40 public:
    41 	/**
    42 	Called by the Codec API Output Port when MopReadData() has completed.
    43 	@param  aOutputPort
    44 	        The Output Port which sent the callback.
    45 	@param  aBuffer
    46 		  The buffer read by the Output Port.
    47 	@param  aErrorCode
    48 		  An error code indicating if the function call was successful. KErrNone on success, otherwise
    49 	 	  another of the system-wide error codes. 
    50 	*/
    51 	virtual void MopoReadDataComplete(const MMdfOutputPort* aOutputPort,
    52 		CMMFBuffer* aBuffer, TInt aErrorCode) = 0;
    53 
    54 	/**
    55 	Called by the Codec API Output Port when MopDisconnectTunnel() has completed.
    56 	@param  aOutputPort
    57 		  The Output Port which sent the callback.
    58 	@param  aErrorCode
    59 		  An error code indicating if the function call was successful. KErrNone on success, otherwise
    60 	 	  another of the system-wide error codes. 
    61 	*/
    62 	virtual void MopoDisconnectTunnelComplete(const MMdfOutputPort* aOutputPort,
    63 		TInt aErrorCode) = 0;
    64 
    65 	/**
    66 	Called by the Codec API Output Port when MopRestartTunnel() has completed.
    67 	@param  aOutputPort
    68 		  The Ouput Port which sent the callback.
    69 	@param  aErrorCode
    70 		  An error code indicating if the function call was successful. KErrNone on success, otherwise
    71 	 	  another of the system-wide error codes. 
    72 	*/
    73 	virtual void MopoRestartTunnelComplete(const MMdfOutputPort* aOutputPort,
    74 		TInt aErrorCode) = 0;	
    75 	};
    76 
    77 /**
    78 Codec API Output Port interface.
    79 */
    80 class MMdfOutputPort
    81 	{
    82 public:
    83 	/**
    84 	Synchronous function used to configure the Output Port.
    85 	@param  aConfiguration
    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.
    89 	*/
    90 	virtual TInt MopConfigure(const TPuConfig&  aConfiguration) = 0;
    91 
    92 
    93 	/**
    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.	
    99 	*/
   100 	virtual TInt MopGetConfig(TPuConfig& aConfigurationSetup) = 0;
   101 	
   102 
   103 	/**
   104 	Synchronous function used to initialise the Output Port.
   105 	*/
   106 	virtual void MopInitialize() = 0;
   107 
   108 	/**
   109 	Synchronous function used to set the observer for the Output Port. 
   110 	@param  aOutputPortObserver
   111 		  The observer of the Output Port.
   112 	*/
   113 	virtual void MopSetObserver(const MMdfOutputPortObserver& aOutputPortObserver) = 0;
   114 
   115 	/**
   116 	Synchronous function used to instruct the Output Port to create a buffer. 
   117 	@param  aBufferSize
   118 		  The size of the buffer to be created.
   119 	@return A pointer to the newly created buffer.
   120 	*/
   121 	virtual CMMFBuffer* MopCreateBuffer(TInt aBufferSize) = 0;
   122 
   123 	/**
   124 	Synchronous function used to instruct the Output Port to use the buffer 
   125 	passed in the function's argument. 
   126 	@param  aBuffer
   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.
   130 	*/
   131 	virtual TInt MopUseBuffer(CMMFBuffer& aBuffer) = 0;
   132 
   133 	/**
   134 	Synchronous function used to instruct the Output Port to free the buffer
   135 	passed in the function's argument. 
   136 	@param  aBuffer
   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.
   140 	*/
   141 	virtual TInt MopFreeBuffer(CMMFBuffer* aBuffer) = 0;
   142 
   143 	/**
   144 	Synchronous function used to request the set up of a tunnel between this Output Port
   145 	and an Input Port.
   146 	@param  aInputPortToBeConnectedTo
   147 		  Reference to the Input Port to be connected to.
   148 	@param  aTunnelFlags
   149 		  Control flags for tunneling
   150 	@param  aSupplierType
   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.
   154 	*/
   155 	virtual TInt MopTunnelRequest(const MMdfInputPort& aInputPortToBeConnectedTo,
   156 		TTunnelFlags& aTunnelFlags, TSupplierType& aSupplierType) = 0;
   157 
   158 	/**
   159 	Asynchronous function used to read data from the Output Port.
   160 	@param  aBuffer
   161 		  Reference to the buffer containing data.
   162 	*/
   163 	virtual void MopReadData(CMMFBuffer& aBuffer) = 0;
   164 
   165 	/**
   166 	Asynchronous function used to disconnect a tunnelled port, and thus stop the data processing.
   167 	*/
   168 	virtual void MopDisconnectTunnel() = 0;
   169 
   170 	/**
   171 	Asynchronous function used to restart the data processing of a tunnelled port.
   172 	*/
   173 	virtual void MopRestartTunnel() = 0;
   174 
   175 	/**
   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.
   178 	*/
   179 	virtual TBool MopIsTunnelled() const = 0;
   180 
   181 	/**
   182 	Synchronous function used to get the Output Port index
   183 	@return The Input Port index.
   184 	*/
   185 	virtual TInt MopIndex() const = 0;
   186 
   187 	/**
   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.
   190 	*/
   191 	virtual TUint32 MopBufferSize() const = 0 ;
   192 
   193 	/**
   194 	Request extension feature. This is intended to provide additional features. 
   195 	@param  aUid
   196 	        Used to indicate which interface is required. 
   197 	@return Standard error code. KErrNotSupported is used to indicate that the particular
   198 	        plugin is used.
   199 	*/
   200 	virtual TInt MopCreateCustomInterface(TUid aUid) = 0;
   201 
   202 	/**
   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.
   208 	@param aUid
   209 	       Used to indicate which interface is required. 
   210 	@return The requested interface, or NULL if not known.
   211 	@see MopCreateCustomInterface()
   212 	*/
   213 	virtual TAny* MopCustomInterface(TUid aUid) = 0;
   214 	};
   215 
   216 #endif // MDFOUTPUTPORT_H