1 // Copyright (c) 2001-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef __MMFDATAPATHPROXY_H__
17 #define __MMFDATAPATHPROXY_H__
21 #include <ecom/ecom.h>
22 #include <mmf/server/mmfdatapath.h>
23 #include <mmf/server/mmfsubthreadbase.h>
25 #define KMMFDataPathProxyVersion TVersion(8,0,0)
28 The amount of time that is allowed for the datapath to close down before the its thread is killed.
30 #define KMMFDataPathProxyShutdownTimeout TTimeIntervalMicroSeconds32(10000000)
37 Mixin class that the user of the class CMMFDataPathEventMonitor must derive from.
41 class MMMFDataPathEventMonitorObserver
46 Handles an event that has been generated by the datapath.
48 Called by CMMFDataPathEventMonitor::RunL().
51 The event to be handled.
55 virtual void HandleEvent(const TMMFEvent& aEvent) = 0;
58 class RMMFDataPathProxy; //forward reference
64 Active object utility class that can be used to monitor a datapath that is running in its own
65 thread for events. If an event occurs, the client will be notified via the
66 MMMFDataPathEventMonitorObserver interface.
70 class CMMFDataPathEventMonitor : public CActive
74 IMPORT_C static CMMFDataPathEventMonitor* NewL(MMMFDataPathEventMonitorObserver& aObserver,
75 RMMFDataPathProxy& aMMFDataPathProxy);
77 IMPORT_C ~CMMFDataPathEventMonitor();
79 IMPORT_C void Start();
88 Constructs a datapath event monitor object.
91 A reference to the observer of the active object. The observer will be
92 notified when an event occurs.
93 @param aMMFDataPathProxy
94 A reference to the datapath proxy class.
98 CMMFDataPathEventMonitor(MMMFDataPathEventMonitorObserver& aObserver,
99 RMMFDataPathProxy& aMMFDataPathProxy);
101 MMMFDataPathEventMonitorObserver& iObserver;
102 RMMFDataPathProxy& iMMFDataPathProxy;
103 TMMFEventPckg iEventPckg;
110 Proxy class used to create a datapath in a new subthread.
112 class RMMFDataPathProxy : public RMMFSubThreadBase
120 RMMFDataPathProxy() : RMMFSubThreadBase(KMMFDataPathProxyShutdownTimeout) {};
122 IMPORT_C TInt CreateSubThread();
124 IMPORT_C TInt LoadDataPath();
126 IMPORT_C TInt LoadDataPath(TMediaId aMediaId);
128 IMPORT_C TInt LoadDataPath(TUid aCodecUid);
130 IMPORT_C TInt LoadDataPath(TUid aCodecUid, TMediaId aMediaId);
132 IMPORT_C TInt AddDataSource(MDataSource* aSource);
134 IMPORT_C TInt AddDataSink(MDataSink* aSink);
136 IMPORT_C TInt Prime();
138 IMPORT_C TInt Play();
140 IMPORT_C TInt Pause();
142 IMPORT_C TInt Stop();
144 IMPORT_C TInt GetPosition(TTimeIntervalMicroSeconds& aPosition) const;
146 IMPORT_C TInt SetPosition(const TTimeIntervalMicroSeconds& aPosition);
148 IMPORT_C TInt SetPlayWindow( const TTimeIntervalMicroSeconds& aStart, const TTimeIntervalMicroSeconds& aEnd ) ;
150 IMPORT_C TInt ClearPlayWindow() ;
152 IMPORT_C TInt State( TInt& aState ) ;
154 IMPORT_C void Close();
157 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
158 #include <mmf/server/mmfdatapathproxyserver.h>