os/mm/mmdevicefw/mdf/inc/codecapi/mdfinputport.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 MDFINPUTPORT_H
    23 #define MDFINPUTPORT_H
    24 
    25 #include <e32base.h>
    26 #include <mdf/mdfcommon.h>
    27 
    28 class CMdfProcessingUnit;
    29 class CMMFBuffer;
    30 class MMdfInputPort;
    31 class MMdfOutputPort;
    32 class TPuConfig;
    33 
    34 /**
    35 Codec API Input Port observer class.
    36 */
    37 class MMdfInputPortObserver
    38 	{
    39 public:
    40 	/**
    41 	Called by the Codec API Input Port when MipWriteData() has completed.
    42 	@param  aInputPort
    43 		  The Input Port which sent the callback.
    44 	@param  aBuffer
    45 		  The data buffer which was written.
    46 	@param  aErrorCode
    47 		  An error code indicating if the function call was successful. KErrNone on success, otherwise
    48 	 	  another of the system-wide error codes. 
    49 	*/
    50 	virtual void MipoWriteDataComplete(const MMdfInputPort* aInputPort,
    51 		CMMFBuffer* aBuffer, TInt aErrorCode) = 0;
    52 
    53 	/**
    54 	Called by the Codec API Input Port when MipDisconnectTunnel() has completed.
    55 	@param  aInputPort
    56 		  The Input Port which sent the callback.
    57 	@param  aErrorCode
    58 		  An error code indicating if the function call was successful. KErrNone on success, otherwise
    59 	 	  another of the system-wide error codes. 
    60 	*/
    61 	virtual void MipoDisconnectTunnelComplete(const MMdfInputPort* aInputPort,
    62 		TInt aErrorCode) = 0;
    63 
    64 	/**
    65 	Called by the Codec API Input Port when MipRestartTunnel() has completed.
    66 	@param  aInputPort
    67 		  The Input Port which sent the callback.
    68 	@param  aErrorCode
    69 		  An error code indicating if the function call was successful. KErrNone on success, otherwise
    70 	 	  another of the system-wide error codes. 
    71 	*/
    72 	virtual void MipoRestartTunnelComplete(const MMdfInputPort* aInputPort,
    73 		TInt aErrorCode) = 0;
    74 	};
    75 
    76 /**
    77 Codec API Input Port interface.
    78 */
    79 class MMdfInputPort  
    80 	{
    81 public:
    82 	/**
    83 	Synchronous function used to configure the Input Port.
    84 	@param  aConfiguration
    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.
    88 	*/
    89 	virtual TInt MipConfigure(const TPuConfig&  aConfiguration) = 0;
    90 
    91 	/**
    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.	
    97 	*/
    98 	virtual TInt MipGetConfig(TPuConfig& aConfigurationSetup) = 0;
    99 
   100 	/**
   101 	Synchronous function used to initialise the Input Port.
   102 	*/
   103 	virtual void MipInitialize() = 0;
   104 
   105 	/**
   106 	Synchronous function used to set the observer for the Input Port. 
   107 	@param  aInputPortObserver
   108 		  The observer of the Input Port.
   109 	*/
   110 	virtual void MipSetObserver(const MMdfInputPortObserver& aInputPortObserver) = 0;
   111 
   112 	/**
   113 	Synchronous function used to instruct the Input Port to create a buffer. 
   114 	@param  aBufferSize
   115 		  The size of the buffer to be created.
   116 	@return A pointer to the new created buffer.
   117 	*/
   118 	virtual CMMFBuffer* MipCreateBuffer(TInt aBufferSize) = 0;
   119 
   120 	/**
   121 	Synchronous function used to instruct the Input Port to use the buffer 
   122 	passed in the function's argument. 
   123 	@param  aBuffer
   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.
   127 	*/
   128 	virtual TInt MipUseBuffer(CMMFBuffer& aBuffer) = 0;
   129 
   130 	/**
   131 	Synchronous function used to instruct the Input Port to free the buffer given
   132 	passed in the function's argument. 
   133 	@param  aBuffer
   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.
   137 	*/
   138 	virtual TInt MipFreeBuffer(CMMFBuffer* aBuffer) = 0;
   139 
   140 	/**
   141 	Synchronous function used to request the set up of a tunnel between this Input Port
   142 	and an Output Port.
   143 	@param  aOutputPortToBeConnectedTo
   144 		  Reference to the Output Port to be connected to.
   145 	@param  aTunnelFlags
   146 		  Control flags for tunneling
   147 	@param  aSupplierType
   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.
   151 	*/
   152 	virtual TInt MipTunnelRequest(const MMdfOutputPort& aOutputPortToBeConnectedTo,
   153 		TTunnelFlags& aTunnelFlags, TSupplierType& aSupplierType) = 0;
   154 
   155 	/**
   156 	Asynchronous function used to write data to the Input Port.
   157 	@param  aBuffer
   158 		  Reference to the buffer containing data.
   159 	*/
   160 	virtual void MipWriteData(CMMFBuffer& aBuffer) = 0;
   161 
   162 	/**
   163 	Asynchronous function used to disconnect a tunnelled port, and thus stop the data processing.
   164 	*/
   165 	virtual void MipDisconnectTunnel() = 0;
   166 	
   167 	/**
   168 	Asynchronous function used to restart the data processing of a tunnelled port.
   169 	*/
   170 	virtual void MipRestartTunnel() = 0;
   171 
   172 	/**
   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.
   175 	*/
   176 	virtual TBool MipIsTunnelled() const = 0;
   177 
   178 	/**
   179 	Synchronous function used to get the Input Port index
   180 	@return The Input Port index.
   181 	*/
   182 	virtual TInt MipIndex() const = 0;
   183 
   184 	/**
   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.
   187 	*/
   188 	virtual TUint32 MipBufferSize() const = 0 ;
   189 
   190 	/**
   191 	Request extension feature. This is intended to provide additional features. 
   192 	@param  aUid
   193 	        Used to indicate which interface is required. 
   194 	@return Standard error code. KErrNotSupported is used to indicate that the particular
   195 	        plugin is used.
   196 	*/
   197 	virtual TInt MipCreateCustomInterface(TUid aUid) = 0;
   198 
   199 	/**
   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.
   205 	@param aUid
   206 	       Used to indicate which interface is required. 
   207 	@return The requested interface, or NULL if not known.
   208 	@see MipCreateCustomInterface()
   209 	*/
   210 	virtual TAny* MipCustomInterface(TUid aUid) = 0;
   211 	};
   212 
   213 #endif // MDFINPUTPORT_H