0
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
/**
|
|
20 |
@file
|
|
21 |
@internalComponent
|
|
22 |
*/
|
|
23 |
#ifndef BUFFERCOPIERSTATEMONITOR_H_
|
|
24 |
#define BUFFERCOPIERSTATEMONITOR_H_
|
|
25 |
|
|
26 |
#include <e32base.h>
|
|
27 |
#include <e32std.h>
|
|
28 |
|
|
29 |
class MBufferCopierIf;
|
|
30 |
class CBufferCopier;
|
|
31 |
class COmxILVideoScheduler;
|
|
32 |
|
|
33 |
|
|
34 |
class CBufferCopierStateMonitor : public CActive
|
|
35 |
{
|
|
36 |
public:
|
|
37 |
enum TPFState
|
|
38 |
{
|
|
39 |
ENull =0,
|
|
40 |
EExecuting,
|
|
41 |
EPause,
|
|
42 |
ESubLoadedToIdle,
|
|
43 |
ESubIdleToLoaded
|
|
44 |
};
|
|
45 |
public:
|
|
46 |
static CBufferCopierStateMonitor* NewL(MBufferCopierIf& aCallback, COmxILVideoScheduler& aComponent);
|
|
47 |
~CBufferCopierStateMonitor();
|
|
48 |
TInt SetState(TPFState aState);
|
|
49 |
CBufferCopier* BufferCopier(){return iBufferCopier;}
|
|
50 |
|
|
51 |
protected:
|
|
52 |
void RunL();
|
|
53 |
void DoCancel();
|
|
54 |
TInt RunError(TInt aError);
|
|
55 |
|
|
56 |
private:
|
|
57 |
CBufferCopierStateMonitor(MBufferCopierIf& aCallback, COmxILVideoScheduler& aComponent);
|
|
58 |
void ConstructL();
|
|
59 |
TInt DoSetState();
|
|
60 |
TInt DoRequest();
|
|
61 |
|
|
62 |
private:
|
|
63 |
MBufferCopierIf& iCallback;
|
|
64 |
COmxILVideoScheduler& iComponent;
|
|
65 |
TInt iMaxBuffers;
|
|
66 |
CBufferCopier* iBufferCopier;
|
|
67 |
TPFState iState;
|
|
68 |
//Members to make the component thread safe.
|
|
69 |
TThreadId iConstructionThreadId;
|
|
70 |
TRequestStatus* iCallingStatus; // not owned
|
|
71 |
TThreadId iCallingThreadId;
|
|
72 |
};
|
|
73 |
|
|
74 |
|
|
75 |
#endif /* BUFFERCOPIERSTATEMONITOR_H_ */
|