|
1 // Copyright (c) 2002-2010 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". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 |
|
17 #ifndef VIRTUALVIDEOHWCHANNEL_H |
|
18 #define VIRTUALVIDEOHWCHANNEL_H |
|
19 |
|
20 #include <kernel/kernel.h> |
|
21 #include <kernel/kern_priv.h> |
|
22 #include "sgextension.h"//For SgExtension |
|
23 |
|
24 #include "virtualvideohwinterface.h" |
|
25 |
|
26 class MVirtualVideoHwDeviceInterface; |
|
27 class DDeviceReqHandler; |
|
28 |
|
29 _LIT( KVirtualVideoHwChannelPanic, "DVVideoHwChannel" ); |
|
30 |
|
31 /** |
|
32 * Logical channel for the ARM virtual video peripheral used in the |
|
33 * platform simulator. |
|
34 */ |
|
35 class DVirtualVideoHwChannel : public DLogicalChannel |
|
36 { |
|
37 public: |
|
38 |
|
39 /** |
|
40 * Constructor. |
|
41 * |
|
42 * @param aDeviceInterface |
|
43 * Interface to the device driver. |
|
44 * @param aHwInterface |
|
45 * Interface to the hardware. |
|
46 * @param aDeviceReqHandler |
|
47 * Shared request handler for channels |
|
48 * @param aQueue |
|
49 * Deferred function call queue. |
|
50 */ |
|
51 DVirtualVideoHwChannel( |
|
52 MVirtualVideoHwDeviceInterface& aDeviceInterface, |
|
53 DVirtualVideoHwInterface& aHwInterface, |
|
54 DDeviceReqHandler& aDeviceReqHandler, |
|
55 TDfcQue* aQueue |
|
56 ); |
|
57 |
|
58 /** |
|
59 * Destructor. |
|
60 */ |
|
61 virtual ~DVirtualVideoHwChannel(); |
|
62 |
|
63 protected: // From DLogicalChannelBase |
|
64 |
|
65 /** |
|
66 * Second phase constructor for DLogicalChannelBase objects. |
|
67 * @see DLogicalChannelBase::DoCreate |
|
68 */ |
|
69 virtual TInt DoCreate( TInt aUnit, const TDesC8* aInfo, const TVersion& aVer ); |
|
70 |
|
71 protected: // From DLogicalChannel |
|
72 |
|
73 /** |
|
74 * Handles a client request in the client context. |
|
75 * @see DLogicalChannelBase::Request |
|
76 */ |
|
77 virtual TInt Request( TInt aReqNo, TAny *a1, TAny *a2 ); |
|
78 |
|
79 /** |
|
80 * Processes a message for this logical channel. |
|
81 * @see DLogicalChannel::HandleMsg |
|
82 */ |
|
83 void HandleMsg( TMessageBase* aMsgRequest ); |
|
84 |
|
85 protected: // New functions |
|
86 |
|
87 /** |
|
88 * This function is called from HandleMsg(). It is used to handle |
|
89 * asynchronous requests. |
|
90 * |
|
91 * @param aUserThread |
|
92 * User thread |
|
93 * @param aReqNo |
|
94 * Request number |
|
95 * @param aStatus |
|
96 * Request status |
|
97 * @param a1 |
|
98 * Optional parameter |
|
99 * @param a2 |
|
100 * Optional parameter |
|
101 * @return |
|
102 * KErrNone - Successful |
|
103 * KErrArgument - a1 is NULL |
|
104 * KErrNotSupported - Invalid aReqNo |
|
105 * System wide errorcodes in other error situations. |
|
106 */ |
|
107 virtual TInt DoRequest( |
|
108 DThread*& aUserThread, |
|
109 TInt aReqNo, |
|
110 TRequestStatus* aStatus, |
|
111 TAny* a1 = NULL, |
|
112 TAny* a2 = NULL ); |
|
113 |
|
114 /** |
|
115 * This function is called from HandleMsg(). It is used to handle |
|
116 * synchronous requests. |
|
117 * |
|
118 * @param aUserThread |
|
119 * User thread |
|
120 * @param aFunction |
|
121 * Function number |
|
122 * @param a1 |
|
123 * Required parameter |
|
124 * @param a2 |
|
125 * Optional parameter |
|
126 * @return |
|
127 * KErrNone - Successful |
|
128 * KErrArgument - a1 is NULL |
|
129 * KErrNotReady - Buffer not allocated yet for playback or recording. |
|
130 * KErrInUse - Playback or recording already ongoing. |
|
131 * KErrNotSupported - Invalid aFunction |
|
132 * System wide errorcodes in other error situations. |
|
133 */ |
|
134 virtual TInt DoControl( DThread*& aUserThread, TInt aFunction, TAny* a1, TAny* a2 = NULL ); |
|
135 |
|
136 private: |
|
137 |
|
138 /// Interface to the logical device |
|
139 MVirtualVideoHwDeviceInterface& iDeviceInterface; |
|
140 |
|
141 /// Interface to the hardware |
|
142 DVirtualVideoHwInterface& iHwInterface; |
|
143 |
|
144 TInt GetSgImageMetaData(TSgImageMetaData& aSgInfo, const TUint64 aId); |
|
145 |
|
146 TInt iValue; |
|
147 |
|
148 /// Request handler (Owned) |
|
149 DDeviceReqHandler& iReqHandler; |
|
150 }; |
|
151 |
|
152 #endif // VIRTUALVIDEOHWCHANNEL_H |