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.
sl@0
     1
// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
/**
sl@0
    17
 @file
sl@0
    18
 @publishedPartner
sl@0
    19
 @released
sl@0
    20
*/
sl@0
    21
sl@0
    22
#ifndef MDFOUTPUTPORT_H
sl@0
    23
#define MDFOUTPUTPORT_H
sl@0
    24
sl@0
    25
#include <e32base.h>
sl@0
    26
#include <mdf/mdfcommon.h>
sl@0
    27
sl@0
    28
class CMdfProcessingUnit;
sl@0
    29
class CMMFBuffer;
sl@0
    30
class MMdfOutputPort;
sl@0
    31
class MMdfInputPort;
sl@0
    32
class MMdfInputPortObserver;
sl@0
    33
class TPuConfig;
sl@0
    34
sl@0
    35
/**
sl@0
    36
Codec API Output Port observer class.
sl@0
    37
*/
sl@0
    38
class MMdfOutputPortObserver
sl@0
    39
	{
sl@0
    40
public:
sl@0
    41
	/**
sl@0
    42
	Called by the Codec API Output Port when MopReadData() has completed.
sl@0
    43
	@param  aOutputPort
sl@0
    44
	        The Output Port which sent the callback.
sl@0
    45
	@param  aBuffer
sl@0
    46
		  The buffer read by the Output Port.
sl@0
    47
	@param  aErrorCode
sl@0
    48
		  An error code indicating if the function call was successful. KErrNone on success, otherwise
sl@0
    49
	 	  another of the system-wide error codes. 
sl@0
    50
	*/
sl@0
    51
	virtual void MopoReadDataComplete(const MMdfOutputPort* aOutputPort,
sl@0
    52
		CMMFBuffer* aBuffer, TInt aErrorCode) = 0;
sl@0
    53
sl@0
    54
	/**
sl@0
    55
	Called by the Codec API Output Port when MopDisconnectTunnel() has completed.
sl@0
    56
	@param  aOutputPort
sl@0
    57
		  The Output Port which sent the callback.
sl@0
    58
	@param  aErrorCode
sl@0
    59
		  An error code indicating if the function call was successful. KErrNone on success, otherwise
sl@0
    60
	 	  another of the system-wide error codes. 
sl@0
    61
	*/
sl@0
    62
	virtual void MopoDisconnectTunnelComplete(const MMdfOutputPort* aOutputPort,
sl@0
    63
		TInt aErrorCode) = 0;
sl@0
    64
sl@0
    65
	/**
sl@0
    66
	Called by the Codec API Output Port when MopRestartTunnel() has completed.
sl@0
    67
	@param  aOutputPort
sl@0
    68
		  The Ouput Port which sent the callback.
sl@0
    69
	@param  aErrorCode
sl@0
    70
		  An error code indicating if the function call was successful. KErrNone on success, otherwise
sl@0
    71
	 	  another of the system-wide error codes. 
sl@0
    72
	*/
sl@0
    73
	virtual void MopoRestartTunnelComplete(const MMdfOutputPort* aOutputPort,
sl@0
    74
		TInt aErrorCode) = 0;	
sl@0
    75
	};
sl@0
    76
sl@0
    77
/**
sl@0
    78
Codec API Output Port interface.
sl@0
    79
*/
sl@0
    80
class MMdfOutputPort
sl@0
    81
	{
sl@0
    82
public:
sl@0
    83
	/**
sl@0
    84
	Synchronous function used to configure the Output Port.
sl@0
    85
	@param  aConfiguration
sl@0
    86
		  Holds the configuration parameters for the Output Port.
sl@0
    87
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
sl@0
    88
	        another of the system-wide error codes.
sl@0
    89
	*/
sl@0
    90
	virtual TInt MopConfigure(const TPuConfig&  aConfiguration) = 0;
sl@0
    91
sl@0
    92
sl@0
    93
	/**
sl@0
    94
	Synchronous method which gets a configuration structure for the Output Port
sl@0
    95
	@param  aConfigurationSetup
sl@0
    96
		  The reference to the structure that is to contain the configuration information
sl@0
    97
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
sl@0
    98
	        another of the system-wide error codes.	
sl@0
    99
	*/
sl@0
   100
	virtual TInt MopGetConfig(TPuConfig& aConfigurationSetup) = 0;
sl@0
   101
	
sl@0
   102
sl@0
   103
	/**
sl@0
   104
	Synchronous function used to initialise the Output Port.
sl@0
   105
	*/
sl@0
   106
	virtual void MopInitialize() = 0;
sl@0
   107
sl@0
   108
	/**
sl@0
   109
	Synchronous function used to set the observer for the Output Port. 
sl@0
   110
	@param  aOutputPortObserver
sl@0
   111
		  The observer of the Output Port.
sl@0
   112
	*/
sl@0
   113
	virtual void MopSetObserver(const MMdfOutputPortObserver& aOutputPortObserver) = 0;
sl@0
   114
sl@0
   115
	/**
sl@0
   116
	Synchronous function used to instruct the Output Port to create a buffer. 
sl@0
   117
	@param  aBufferSize
sl@0
   118
		  The size of the buffer to be created.
sl@0
   119
	@return A pointer to the newly created buffer.
sl@0
   120
	*/
sl@0
   121
	virtual CMMFBuffer* MopCreateBuffer(TInt aBufferSize) = 0;
sl@0
   122
sl@0
   123
	/**
sl@0
   124
	Synchronous function used to instruct the Output Port to use the buffer 
sl@0
   125
	passed in the function's argument. 
sl@0
   126
	@param  aBuffer
sl@0
   127
		  The buffer to be used by the Output Port.
sl@0
   128
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
sl@0
   129
	        another of the system-wide error codes.
sl@0
   130
	*/
sl@0
   131
	virtual TInt MopUseBuffer(CMMFBuffer& aBuffer) = 0;
sl@0
   132
sl@0
   133
	/**
sl@0
   134
	Synchronous function used to instruct the Output Port to free the buffer
sl@0
   135
	passed in the function's argument. 
sl@0
   136
	@param  aBuffer
sl@0
   137
		  The buffer to be freed
sl@0
   138
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
sl@0
   139
	        another of the system-wide error codes.
sl@0
   140
	*/
sl@0
   141
	virtual TInt MopFreeBuffer(CMMFBuffer* aBuffer) = 0;
sl@0
   142
sl@0
   143
	/**
sl@0
   144
	Synchronous function used to request the set up of a tunnel between this Output Port
sl@0
   145
	and an Input Port.
sl@0
   146
	@param  aInputPortToBeConnectedTo
sl@0
   147
		  Reference to the Input Port to be connected to.
sl@0
   148
	@param  aTunnelFlags
sl@0
   149
		  Control flags for tunneling
sl@0
   150
	@param  aSupplierType
sl@0
   151
		  Specifies the supplier of the buffers for the tunnel.
sl@0
   152
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
sl@0
   153
	        another of the system-wide error codes.
sl@0
   154
	*/
sl@0
   155
	virtual TInt MopTunnelRequest(const MMdfInputPort& aInputPortToBeConnectedTo,
sl@0
   156
		TTunnelFlags& aTunnelFlags, TSupplierType& aSupplierType) = 0;
sl@0
   157
sl@0
   158
	/**
sl@0
   159
	Asynchronous function used to read data from the Output Port.
sl@0
   160
	@param  aBuffer
sl@0
   161
		  Reference to the buffer containing data.
sl@0
   162
	*/
sl@0
   163
	virtual void MopReadData(CMMFBuffer& aBuffer) = 0;
sl@0
   164
sl@0
   165
	/**
sl@0
   166
	Asynchronous function used to disconnect a tunnelled port, and thus stop the data processing.
sl@0
   167
	*/
sl@0
   168
	virtual void MopDisconnectTunnel() = 0;
sl@0
   169
sl@0
   170
	/**
sl@0
   171
	Asynchronous function used to restart the data processing of a tunnelled port.
sl@0
   172
	*/
sl@0
   173
	virtual void MopRestartTunnel() = 0;
sl@0
   174
sl@0
   175
	/**
sl@0
   176
	Synchronous function used to find out if an Output Port is tunnelled or not.
sl@0
   177
	@return ETrue if the Input Port is tunnelled, EFalse otherwise.
sl@0
   178
	*/
sl@0
   179
	virtual TBool MopIsTunnelled() const = 0;
sl@0
   180
sl@0
   181
	/**
sl@0
   182
	Synchronous function used to get the Output Port index
sl@0
   183
	@return The Input Port index.
sl@0
   184
	*/
sl@0
   185
	virtual TInt MopIndex() const = 0;
sl@0
   186
sl@0
   187
	/**
sl@0
   188
	Synchronous function used to get the size of the buffer(s) used by the Output Port.
sl@0
   189
	@return The Output Port's buffer size.
sl@0
   190
	*/
sl@0
   191
	virtual TUint32 MopBufferSize() const = 0 ;
sl@0
   192
sl@0
   193
	/**
sl@0
   194
	Request extension feature. This is intended to provide additional features. 
sl@0
   195
	@param  aUid
sl@0
   196
	        Used to indicate which interface is required. 
sl@0
   197
	@return Standard error code. KErrNotSupported is used to indicate that the particular
sl@0
   198
	        plugin is used.
sl@0
   199
	*/
sl@0
   200
	virtual TInt MopCreateCustomInterface(TUid aUid) = 0;
sl@0
   201
sl@0
   202
	/**
sl@0
   203
	Return previously created extension.
sl@0
   204
	This returns a custom interface whose ownership is not transferred to the caller. This
sl@0
   205
	should only be used if CreateCustomInterface() has already been called for the same UID
sl@0
   206
	value. This means that any construction for that interface has already been called, 
sl@0
   207
	and thus this call cannot fail.
sl@0
   208
	@param aUid
sl@0
   209
	       Used to indicate which interface is required. 
sl@0
   210
	@return The requested interface, or NULL if not known.
sl@0
   211
	@see MopCreateCustomInterface()
sl@0
   212
	*/
sl@0
   213
	virtual TAny* MopCustomInterface(TUid aUid) = 0;
sl@0
   214
	};
sl@0
   215
sl@0
   216
#endif // MDFOUTPUTPORT_H