1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/mmdevicefw/mdf/inc/codecapi/mdfprocessingunit.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,229 @@
1.4 +// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +/**
1.20 + @file
1.21 + @publishedPartner
1.22 + @released
1.23 +*/
1.24 +
1.25 +#ifndef MDFPROCESSINGUNIT_H
1.26 +#define MDFPROCESSINGUNIT_H
1.27 +
1.28 +#include <e32base.h>
1.29 +#include <ecom/implementationinformation.h>
1.30 +#include <mdf/mdfinputport.h>
1.31 +#include <mdf/mdfoutputport.h>
1.32 +
1.33 +class MMdfInputPort;
1.34 +class MMdfOutputPort;
1.35 +class CMdfProcessingUnit;
1.36 +class MMdfInputPortObserver;
1.37 +class MMdfOutputPortObserver;
1.38 +class TPuConfig;
1.39 +
1.40 +/**
1.41 + Processing Unit internal state.
1.42 + */
1.43 +enum TProcessingUnitState
1.44 + {
1.45 + /**
1.46 + Processing Unit invalid state
1.47 + */
1.48 + EProcessingUnitInvalid = 0,
1.49 + /**
1.50 + Processing Unit loaded state
1.51 + */
1.52 + EProcessingUnitLoaded,
1.53 + /**
1.54 + Processing Unit idle state
1.55 + */
1.56 + EProcessingUnitIdle,
1.57 + /**
1.58 + Processing Unit executing state
1.59 + */
1.60 + EProcessingUnitExecuting,
1.61 + /**
1.62 + Processing Unit paused state
1.63 + */
1.64 + EProcessingUnitPaused,
1.65 + /**
1.66 + Processing Unit waiting for resources state
1.67 + */
1.68 + EProcessingUnitWaitingForResources,
1.69 + /**
1.70 + Processing Unit loading state
1.71 + */
1.72 + EProcessingUnitLoading,
1.73 + /**
1.74 + Processing Unit initializing state
1.75 + */
1.76 + EProcessingUnitInitializing
1.77 + };
1.78 +
1.79 +/**
1.80 +Processing Unit observer class
1.81 +*/
1.82 +class MMdfProcessingUnitObserver
1.83 + {
1.84 +public:
1.85 + /**
1.86 + Called by a Processing Unit when Initialize() has completed.
1.87 + @param aPu
1.88 + The Processing Unit which sent the callback.
1.89 + @param aErrorCode
1.90 + An error code indicating if the function call was successful. KErrNone on success, otherwise
1.91 + another of the system-wide error codes.
1.92 + */
1.93 + virtual void InitializeComplete(const CMdfProcessingUnit* aPu, TInt aErrorCode) = 0;
1.94 +
1.95 + /**
1.96 + Called by a Processing Unit when Execute() has completed.
1.97 + @param aPu
1.98 + The Processing Unit which sent the callback.
1.99 + @param aErrorCode
1.100 + An error code indicating if the function call was successful. KErrNone on success, otherwise
1.101 + another of the system-wide error codes.
1.102 + */
1.103 + virtual void ExecuteComplete(const CMdfProcessingUnit* aPu, TInt aErrorCode) = 0;
1.104 + };
1.105 +
1.106 +/**
1.107 +Processing Unit interface
1.108 +*/
1.109 +class CMdfProcessingUnit : public CBase
1.110 + {
1.111 +public:
1.112 + /**
1.113 + Standard safe constructor that leaves nothing on the cleanup stack
1.114 + @param aImplementationUid
1.115 + The uid of the new created processing unit.
1.116 + @return A pointer to the newly constructed object.
1.117 + */
1.118 + inline static CMdfProcessingUnit* NewL(TUid aImplementationUid);
1.119 +
1.120 + /**
1.121 + Synchronous method which creates the Processing Unit.
1.122 + @param aProcessingUnitObserver
1.123 + The class to receive asynchronous Processing Unit events.
1.124 + @return An error code indicating if the function call was successful. KErrNone on success, otherwise
1.125 + another of the system-wide error codes.
1.126 + */
1.127 + virtual TInt Create(const MMdfProcessingUnitObserver& aProcessingUnitObserver) = 0;
1.128 +
1.129 + /**
1.130 + Synchronous method which returns the Input Ports that a Processing Unit holds.
1.131 + @param aComponentInputPorts
1.132 + The array to which the Input Ports will be appended.
1.133 + @return An error code indicating if the function call was successful. KErrNone on success, otherwise
1.134 + another of the system-wide error codes.
1.135 + */
1.136 + virtual TInt GetInputPorts(RPointerArray<MMdfInputPort>& aComponentInputPorts) = 0;
1.137 +
1.138 + /**
1.139 + Synchronous method which returns the Output Ports that a Processing Unit holds.
1.140 + @param aComponentOutputPorts
1.141 + The array to which the Output Ports will be appended.
1.142 + @return An error code indicating if the function call was successful. KErrNone on success, otherwise
1.143 + another of the system-wide error codes.
1.144 + */
1.145 + virtual TInt GetOutputPorts(RPointerArray<MMdfOutputPort>& aComponentOutputPorts) = 0;
1.146 +
1.147 + /**
1.148 + Synchronous method which sets the configuration for a Processing Unit.
1.149 + @param aConfigurationSetup
1.150 + The reference to the structure that contains the configuration data.
1.151 + @return An error code indicating if the function call was successful. KErrNone on success, otherwise
1.152 + another of the system-wide error codes.
1.153 + */
1.154 + virtual TInt Configure(const TPuConfig& aConfigurationSetup) = 0;
1.155 +
1.156 + /**
1.157 + Synchronous method which gets a configuration structure.
1.158 + @param aConfigurationSetup
1.159 + The reference to the structure that is to contain the configuration information.
1.160 + @return An error code indicating if the function call was successful. KErrNone on success, otherwise
1.161 + another of the system-wide error codes.
1.162 + */
1.163 + virtual TInt GetConfig(TPuConfig& aConfigurationSetup) = 0;
1.164 +
1.165 +
1.166 + /**
1.167 + Asynchronous method which instructs the Processing Unit to start the initialization.
1.168 + @see MMdfProcessingUnitObserver::InitializeComplete()
1.169 + */
1.170 + virtual void Initialize() = 0;
1.171 +
1.172 + /**
1.173 + Asynchronous method which starts the execution for a Processing Unit.
1.174 + @see MMdfProcessingUnitObserver::ExecuteComplete()
1.175 + */
1.176 + virtual void Execute () = 0;
1.177 +
1.178 + /**
1.179 + Synchronous method which pauses the current on-going task.
1.180 + @return An error code indicating if the function call was successful. KErrNone on success, otherwise
1.181 + another of the system-wide error codes.
1.182 + */
1.183 + virtual TInt Pause () = 0;
1.184 +
1.185 + /**
1.186 + Synchronous method which stops the current on-going task.
1.187 + */
1.188 + virtual void Stop () = 0;
1.189 +
1.190 + /**
1.191 + Synchronous method which returns the current state of the Processing Unit.
1.192 + @return The current state of the Processing Unit.
1.193 + */
1.194 + virtual TProcessingUnitState State() = 0;
1.195 +
1.196 + /**
1.197 + Synchronous method which requests an extension feature.
1.198 + This is intended to provide additional features.
1.199 + @param aUid
1.200 + Used to indicate which interface is required.
1.201 + @return Standard error code. KErrNotSupported is used to indicate that the particular
1.202 + plugin is used.
1.203 + */
1.204 + virtual TInt CreateCustomInterface(TUid aUid) = 0;
1.205 +
1.206 + /**
1.207 + Synchronous method which returns a previously created extension.
1.208 + This returns a custom interface. This should only be used if CreateCustomInterface() has already
1.209 + been called for the same UID value. This means that any construction for that interface
1.210 + has already been called, and thus this call cannot fail.
1.211 + @param aUid
1.212 + Used to indicate which interface is required.
1.213 + @return The requested interface, or NULL if not known.
1.214 + @see CMdfProcessingUnit::CreateCustomInterface()
1.215 + */
1.216 + virtual TAny* CustomInterface(TUid aUid) = 0;
1.217 +
1.218 + /**
1.219 + Destructor.
1.220 +
1.221 + The destructor is called by ECom framework allowing derived classes
1.222 + to clean up the implementation specific resources.
1.223 + */
1.224 + inline virtual ~CMdfProcessingUnit();
1.225 +
1.226 +private:
1.227 + TUid iDtor_ID_Key;
1.228 + };
1.229 +
1.230 +#include <mdf/mdfprocessingunit.inl>
1.231 +
1.232 +#endif // MDFPROCESSINGUNIT_H