os/mm/mmlibs/mmfw/inc/mmf/server/mmfdatapathproxy.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) 2001-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
#ifndef __MMFDATAPATHPROXY_H__
sl@0
    17
#define __MMFDATAPATHPROXY_H__
sl@0
    18
sl@0
    19
#include <e32base.h>
sl@0
    20
#include <e32std.h>
sl@0
    21
#include <ecom/ecom.h>
sl@0
    22
#include <mmf/server/mmfdatapath.h>
sl@0
    23
#include <mmf/server/mmfsubthreadbase.h>
sl@0
    24
sl@0
    25
#define KMMFDataPathProxyVersion TVersion(8,0,0)
sl@0
    26
sl@0
    27
/**
sl@0
    28
The amount of time that is allowed for the datapath to close down before the its thread is killed.
sl@0
    29
*/
sl@0
    30
#define  KMMFDataPathProxyShutdownTimeout TTimeIntervalMicroSeconds32(10000000)
sl@0
    31
sl@0
    32
sl@0
    33
/**
sl@0
    34
@publishedAll
sl@0
    35
@released
sl@0
    36
sl@0
    37
Mixin class that the user of the class CMMFDataPathEventMonitor must derive from.
sl@0
    38
sl@0
    39
@since 7.0s
sl@0
    40
*/
sl@0
    41
class MMMFDataPathEventMonitorObserver
sl@0
    42
	{
sl@0
    43
public:
sl@0
    44
sl@0
    45
	/**
sl@0
    46
	Handles an event that has been generated by the datapath.
sl@0
    47
sl@0
    48
	Called by CMMFDataPathEventMonitor::RunL().
sl@0
    49
sl@0
    50
	@param  aEvent
sl@0
    51
	        The event to be handled.
sl@0
    52
sl@0
    53
	@since  7.0s
sl@0
    54
	*/
sl@0
    55
	virtual void HandleEvent(const TMMFEvent& aEvent) = 0;
sl@0
    56
	};
sl@0
    57
sl@0
    58
class RMMFDataPathProxy; //forward reference
sl@0
    59
sl@0
    60
/**
sl@0
    61
@publishedAll
sl@0
    62
@released
sl@0
    63
sl@0
    64
Active object utility class that can be used to monitor a datapath that is running in its own
sl@0
    65
thread for events. If an event occurs, the client will be notified via the
sl@0
    66
MMMFDataPathEventMonitorObserver interface.
sl@0
    67
sl@0
    68
@since  7.0s
sl@0
    69
*/
sl@0
    70
class CMMFDataPathEventMonitor : public CActive
sl@0
    71
	{
sl@0
    72
public:
sl@0
    73
sl@0
    74
	IMPORT_C static CMMFDataPathEventMonitor* NewL(MMMFDataPathEventMonitorObserver& aObserver,
sl@0
    75
		RMMFDataPathProxy& aMMFDataPathProxy);
sl@0
    76
sl@0
    77
	IMPORT_C ~CMMFDataPathEventMonitor();
sl@0
    78
sl@0
    79
	IMPORT_C void Start();
sl@0
    80
sl@0
    81
	IMPORT_C void RunL();
sl@0
    82
protected:
sl@0
    83
sl@0
    84
	void DoCancel();
sl@0
    85
private:
sl@0
    86
sl@0
    87
	/**
sl@0
    88
	Constructs a datapath event monitor object.
sl@0
    89
sl@0
    90
	@param  aObserver
sl@0
    91
	        A reference to the observer of the active object. The observer will be
sl@0
    92
	        notified when an event occurs.
sl@0
    93
	@param  aMMFDataPathProxy
sl@0
    94
	        A reference to the datapath proxy class.
sl@0
    95
sl@0
    96
	@since  7.0s
sl@0
    97
	*/
sl@0
    98
	CMMFDataPathEventMonitor(MMMFDataPathEventMonitorObserver& aObserver, 
sl@0
    99
		RMMFDataPathProxy& aMMFDataPathProxy);
sl@0
   100
private:
sl@0
   101
	MMMFDataPathEventMonitorObserver& iObserver;
sl@0
   102
	RMMFDataPathProxy& iMMFDataPathProxy;
sl@0
   103
	TMMFEventPckg iEventPckg;
sl@0
   104
	};
sl@0
   105
sl@0
   106
/**
sl@0
   107
@publishedAll
sl@0
   108
@released
sl@0
   109
sl@0
   110
Proxy class used to create a datapath in a new subthread.
sl@0
   111
*/
sl@0
   112
class RMMFDataPathProxy : public RMMFSubThreadBase
sl@0
   113
sl@0
   114
	{
sl@0
   115
public:
sl@0
   116
sl@0
   117
	/**
sl@0
   118
	Constuctor.
sl@0
   119
	*/
sl@0
   120
	RMMFDataPathProxy() : RMMFSubThreadBase(KMMFDataPathProxyShutdownTimeout) {};
sl@0
   121
sl@0
   122
	IMPORT_C TInt CreateSubThread();
sl@0
   123
sl@0
   124
	IMPORT_C TInt LoadDataPath();
sl@0
   125
sl@0
   126
	IMPORT_C TInt LoadDataPath(TMediaId aMediaId);
sl@0
   127
sl@0
   128
	IMPORT_C TInt LoadDataPath(TUid aCodecUid); 
sl@0
   129
sl@0
   130
	IMPORT_C TInt LoadDataPath(TUid aCodecUid, TMediaId aMediaId);
sl@0
   131
sl@0
   132
	IMPORT_C TInt AddDataSource(MDataSource* aSource);
sl@0
   133
sl@0
   134
	IMPORT_C TInt AddDataSink(MDataSink* aSink);
sl@0
   135
sl@0
   136
	IMPORT_C TInt Prime();
sl@0
   137
sl@0
   138
	IMPORT_C TInt Play();
sl@0
   139
sl@0
   140
	IMPORT_C TInt Pause();
sl@0
   141
sl@0
   142
	IMPORT_C TInt Stop();
sl@0
   143
sl@0
   144
	IMPORT_C TInt GetPosition(TTimeIntervalMicroSeconds& aPosition) const;
sl@0
   145
sl@0
   146
	IMPORT_C TInt SetPosition(const TTimeIntervalMicroSeconds& aPosition);
sl@0
   147
sl@0
   148
	IMPORT_C TInt SetPlayWindow( const TTimeIntervalMicroSeconds& aStart, const TTimeIntervalMicroSeconds& aEnd ) ;
sl@0
   149
sl@0
   150
	IMPORT_C TInt ClearPlayWindow() ;
sl@0
   151
sl@0
   152
	IMPORT_C TInt State( TInt& aState ) ;
sl@0
   153
sl@0
   154
	IMPORT_C void Close();
sl@0
   155
	};
sl@0
   156
sl@0
   157
#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
sl@0
   158
#include <mmf/server/mmfdatapathproxyserver.h>
sl@0
   159
#endif
sl@0
   160
sl@0
   161
#endif
sl@0
   162