sl@0
|
1 |
// Copyright (c) 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 |
#include <f32file.h>
|
sl@0
|
17 |
#include <ecom/ecom.h>
|
sl@0
|
18 |
#include <ecom/implementationproxy.h>
|
sl@0
|
19 |
#include <ecam.h>
|
sl@0
|
20 |
#include "ecamramplugin.h"
|
sl@0
|
21 |
#include "ecamrampluginuids.hrh"
|
sl@0
|
22 |
|
sl@0
|
23 |
|
sl@0
|
24 |
//
|
sl@0
|
25 |
// CCameraRamPlugin
|
sl@0
|
26 |
//
|
sl@0
|
27 |
CCameraRamPlugin::CCameraRamPlugin()
|
sl@0
|
28 |
{
|
sl@0
|
29 |
}
|
sl@0
|
30 |
|
sl@0
|
31 |
CCameraRamPlugin::~CCameraRamPlugin()
|
sl@0
|
32 |
{
|
sl@0
|
33 |
}
|
sl@0
|
34 |
|
sl@0
|
35 |
CCameraRamPlugin* CCameraRamPlugin::NewL()
|
sl@0
|
36 |
{
|
sl@0
|
37 |
FileDependencyUtil::CheckFileDependencyL();
|
sl@0
|
38 |
return new (ELeave) CCameraRamPlugin;
|
sl@0
|
39 |
}
|
sl@0
|
40 |
|
sl@0
|
41 |
//
|
sl@0
|
42 |
// 2nd stage ConstructL calls called by framework
|
sl@0
|
43 |
//
|
sl@0
|
44 |
|
sl@0
|
45 |
void CCameraRamPlugin::Construct2L(MCameraObserver& aObserver,TInt aCameraIndex)
|
sl@0
|
46 |
{
|
sl@0
|
47 |
iObserver = &aObserver;
|
sl@0
|
48 |
iCameraIndex = aCameraIndex;
|
sl@0
|
49 |
}
|
sl@0
|
50 |
|
sl@0
|
51 |
void CCameraRamPlugin::Construct2DupL(MCameraObserver& aObserver,TInt aCameraHandle)
|
sl@0
|
52 |
{
|
sl@0
|
53 |
iObserver = &aObserver;
|
sl@0
|
54 |
iCameraHandle = aCameraHandle;
|
sl@0
|
55 |
}
|
sl@0
|
56 |
|
sl@0
|
57 |
|
sl@0
|
58 |
void CCameraRamPlugin::Construct2L(MCameraObserver2& aObserver,TInt aCameraIndex,TInt aPriority)
|
sl@0
|
59 |
{
|
sl@0
|
60 |
iObserver2 = &aObserver;
|
sl@0
|
61 |
iCameraIndex = aCameraIndex;
|
sl@0
|
62 |
iPriority = aPriority;
|
sl@0
|
63 |
}
|
sl@0
|
64 |
|
sl@0
|
65 |
void CCameraRamPlugin::Construct2DupL(MCameraObserver2& aObserver,TInt aCameraHandle)
|
sl@0
|
66 |
{
|
sl@0
|
67 |
iObserver2 = &aObserver;
|
sl@0
|
68 |
iCameraHandle = aCameraHandle;
|
sl@0
|
69 |
}
|
sl@0
|
70 |
|
sl@0
|
71 |
|
sl@0
|
72 |
|
sl@0
|
73 |
//
|
sl@0
|
74 |
// Dummy versions of virtual functions
|
sl@0
|
75 |
//
|
sl@0
|
76 |
|
sl@0
|
77 |
void CCameraRamPlugin::CameraInfo(TCameraInfo& /*aInfo*/) const
|
sl@0
|
78 |
{
|
sl@0
|
79 |
}
|
sl@0
|
80 |
|
sl@0
|
81 |
void CCameraRamPlugin::Reserve()
|
sl@0
|
82 |
{
|
sl@0
|
83 |
}
|
sl@0
|
84 |
|
sl@0
|
85 |
|
sl@0
|
86 |
void CCameraRamPlugin::Release()
|
sl@0
|
87 |
{
|
sl@0
|
88 |
}
|
sl@0
|
89 |
|
sl@0
|
90 |
void CCameraRamPlugin::PowerOn()
|
sl@0
|
91 |
{
|
sl@0
|
92 |
}
|
sl@0
|
93 |
|
sl@0
|
94 |
void CCameraRamPlugin::PowerOff()
|
sl@0
|
95 |
{
|
sl@0
|
96 |
}
|
sl@0
|
97 |
|
sl@0
|
98 |
TInt CCameraRamPlugin::Handle()
|
sl@0
|
99 |
{
|
sl@0
|
100 |
return 0;
|
sl@0
|
101 |
}
|
sl@0
|
102 |
|
sl@0
|
103 |
void CCameraRamPlugin::SetZoomFactorL(TInt /*aZoomFactor = 0*/)
|
sl@0
|
104 |
{
|
sl@0
|
105 |
User::Leave(KErrNotSupported);
|
sl@0
|
106 |
}
|
sl@0
|
107 |
|
sl@0
|
108 |
TInt CCameraRamPlugin::ZoomFactor() const
|
sl@0
|
109 |
{
|
sl@0
|
110 |
return 0;
|
sl@0
|
111 |
}
|
sl@0
|
112 |
|
sl@0
|
113 |
void CCameraRamPlugin::SetDigitalZoomFactorL(TInt /*aDigitalZoomFactor = 0*/)
|
sl@0
|
114 |
{
|
sl@0
|
115 |
User::Leave(KErrNotSupported);
|
sl@0
|
116 |
}
|
sl@0
|
117 |
|
sl@0
|
118 |
TInt CCameraRamPlugin::DigitalZoomFactor() const
|
sl@0
|
119 |
{
|
sl@0
|
120 |
return 0;
|
sl@0
|
121 |
}
|
sl@0
|
122 |
|
sl@0
|
123 |
void CCameraRamPlugin::SetContrastL(TInt /*aContrast*/)
|
sl@0
|
124 |
{
|
sl@0
|
125 |
User::Leave(KErrNotSupported);
|
sl@0
|
126 |
}
|
sl@0
|
127 |
|
sl@0
|
128 |
TInt CCameraRamPlugin::Contrast() const
|
sl@0
|
129 |
{
|
sl@0
|
130 |
return 0;
|
sl@0
|
131 |
}
|
sl@0
|
132 |
|
sl@0
|
133 |
void CCameraRamPlugin::SetBrightnessL(TInt /*aBrightness*/)
|
sl@0
|
134 |
{
|
sl@0
|
135 |
User::Leave(KErrNotSupported);
|
sl@0
|
136 |
}
|
sl@0
|
137 |
|
sl@0
|
138 |
TInt CCameraRamPlugin::Brightness() const
|
sl@0
|
139 |
{
|
sl@0
|
140 |
return 0;
|
sl@0
|
141 |
}
|
sl@0
|
142 |
|
sl@0
|
143 |
|
sl@0
|
144 |
void CCameraRamPlugin::SetFlashL(TFlash /*aFlash = EFlashNone*/)
|
sl@0
|
145 |
{
|
sl@0
|
146 |
User::Leave(KErrNotSupported);
|
sl@0
|
147 |
}
|
sl@0
|
148 |
|
sl@0
|
149 |
CCamera::TFlash CCameraRamPlugin::Flash() const
|
sl@0
|
150 |
{
|
sl@0
|
151 |
return EFlashNone;
|
sl@0
|
152 |
}
|
sl@0
|
153 |
|
sl@0
|
154 |
void CCameraRamPlugin::SetExposureL(TExposure /*aExposure = EExposureAuto*/)
|
sl@0
|
155 |
{
|
sl@0
|
156 |
User::Leave(KErrNotSupported);
|
sl@0
|
157 |
}
|
sl@0
|
158 |
|
sl@0
|
159 |
CCamera::TExposure CCameraRamPlugin::Exposure() const
|
sl@0
|
160 |
{
|
sl@0
|
161 |
return EExposureAuto;
|
sl@0
|
162 |
}
|
sl@0
|
163 |
|
sl@0
|
164 |
void CCameraRamPlugin::SetWhiteBalanceL(TWhiteBalance /*aWhiteBalance = EWBAuto*/)
|
sl@0
|
165 |
{
|
sl@0
|
166 |
}
|
sl@0
|
167 |
|
sl@0
|
168 |
CCamera::TWhiteBalance CCameraRamPlugin::WhiteBalance() const
|
sl@0
|
169 |
{
|
sl@0
|
170 |
return EWBAuto;
|
sl@0
|
171 |
}
|
sl@0
|
172 |
|
sl@0
|
173 |
void CCameraRamPlugin::StartViewFinderDirectL(RWsSession& /*aWs*/,CWsScreenDevice& /*aScreenDevice*/,RWindowBase& /*aWindow*/,TRect& /*aScreenRect*/)
|
sl@0
|
174 |
{
|
sl@0
|
175 |
User::Leave(KErrNotSupported);
|
sl@0
|
176 |
}
|
sl@0
|
177 |
|
sl@0
|
178 |
void CCameraRamPlugin::StartViewFinderDirectL(RWsSession& /*aWs*/,CWsScreenDevice& /*aScreenDevice*/,RWindowBase& /*aWindow*/,TRect& /*aScreenRect*/,TRect& /*aClipRect*/)
|
sl@0
|
179 |
{
|
sl@0
|
180 |
User::Leave(KErrNotSupported);
|
sl@0
|
181 |
}
|
sl@0
|
182 |
|
sl@0
|
183 |
void CCameraRamPlugin::StartViewFinderBitmapsL(TSize& /*aSize*/)
|
sl@0
|
184 |
{
|
sl@0
|
185 |
User::Leave(KErrNotSupported);
|
sl@0
|
186 |
}
|
sl@0
|
187 |
|
sl@0
|
188 |
void CCameraRamPlugin::StartViewFinderBitmapsL(TSize& /*aSize*/,TRect& /*aClipRect*/)
|
sl@0
|
189 |
{
|
sl@0
|
190 |
User::Leave(KErrNotSupported);
|
sl@0
|
191 |
}
|
sl@0
|
192 |
|
sl@0
|
193 |
|
sl@0
|
194 |
void CCameraRamPlugin::StartViewFinderL(TFormat /*aImageFormat*/,TSize& /*aSize*/)
|
sl@0
|
195 |
{
|
sl@0
|
196 |
User::Leave(KErrNotSupported);
|
sl@0
|
197 |
}
|
sl@0
|
198 |
|
sl@0
|
199 |
void CCameraRamPlugin::StartViewFinderL(TFormat /*aImageFormat*/,TSize& /*aSize*/,TRect& /*aClipRect*/)
|
sl@0
|
200 |
{
|
sl@0
|
201 |
User::Leave(KErrNotSupported);
|
sl@0
|
202 |
}
|
sl@0
|
203 |
|
sl@0
|
204 |
|
sl@0
|
205 |
void CCameraRamPlugin::StopViewFinder()
|
sl@0
|
206 |
{
|
sl@0
|
207 |
}
|
sl@0
|
208 |
|
sl@0
|
209 |
TBool CCameraRamPlugin::ViewFinderActive() const
|
sl@0
|
210 |
{
|
sl@0
|
211 |
return EFalse;
|
sl@0
|
212 |
}
|
sl@0
|
213 |
|
sl@0
|
214 |
void CCameraRamPlugin::SetViewFinderMirrorL(TBool /*aMirror*/)
|
sl@0
|
215 |
{
|
sl@0
|
216 |
}
|
sl@0
|
217 |
|
sl@0
|
218 |
TBool CCameraRamPlugin::ViewFinderMirror() const
|
sl@0
|
219 |
{
|
sl@0
|
220 |
return EFalse;
|
sl@0
|
221 |
}
|
sl@0
|
222 |
|
sl@0
|
223 |
void CCameraRamPlugin::PrepareImageCaptureL(TFormat /*aImageFormat*/,TInt /*aSizeIndex*/)
|
sl@0
|
224 |
{
|
sl@0
|
225 |
User::Leave(KErrNotSupported);
|
sl@0
|
226 |
}
|
sl@0
|
227 |
|
sl@0
|
228 |
void CCameraRamPlugin::PrepareImageCaptureL(TFormat /*aImageFormat*/,TInt /*aSizeIndex*/,const TRect& /*aClipRect*/)
|
sl@0
|
229 |
{
|
sl@0
|
230 |
User::Leave(KErrNotSupported);
|
sl@0
|
231 |
}
|
sl@0
|
232 |
|
sl@0
|
233 |
void CCameraRamPlugin::CaptureImage()
|
sl@0
|
234 |
{
|
sl@0
|
235 |
}
|
sl@0
|
236 |
|
sl@0
|
237 |
void CCameraRamPlugin::CancelCaptureImage()
|
sl@0
|
238 |
{
|
sl@0
|
239 |
}
|
sl@0
|
240 |
|
sl@0
|
241 |
void CCameraRamPlugin::EnumerateCaptureSizes(TSize& /*aSize*/,TInt /*aSizeIndex*/,TFormat /*aFormat*/) const
|
sl@0
|
242 |
{
|
sl@0
|
243 |
}
|
sl@0
|
244 |
|
sl@0
|
245 |
void CCameraRamPlugin::PrepareVideoCaptureL(TFormat /*aFormat*/,TInt /*aSizeIndex*/,TInt /*aRateIndex*/,TInt /*aBuffersToUse*/,TInt /*aFramesPerBuffer*/)
|
sl@0
|
246 |
{
|
sl@0
|
247 |
User::Leave(KErrNotSupported);
|
sl@0
|
248 |
}
|
sl@0
|
249 |
|
sl@0
|
250 |
void CCameraRamPlugin::PrepareVideoCaptureL(TFormat /*aFormat*/,TInt /*aSizeIndex*/,TInt /*aRateIndex*/,TInt /*aBuffersToUse*/,TInt /*aFramesPerBuffer*/,const TRect& /*aClipRect*/)
|
sl@0
|
251 |
{
|
sl@0
|
252 |
User::Leave(KErrNotSupported);
|
sl@0
|
253 |
}
|
sl@0
|
254 |
|
sl@0
|
255 |
void CCameraRamPlugin::StartVideoCapture()
|
sl@0
|
256 |
{
|
sl@0
|
257 |
}
|
sl@0
|
258 |
|
sl@0
|
259 |
void CCameraRamPlugin::StopVideoCapture()
|
sl@0
|
260 |
{
|
sl@0
|
261 |
}
|
sl@0
|
262 |
|
sl@0
|
263 |
TBool CCameraRamPlugin::VideoCaptureActive() const
|
sl@0
|
264 |
{
|
sl@0
|
265 |
return EFalse;
|
sl@0
|
266 |
}
|
sl@0
|
267 |
|
sl@0
|
268 |
void CCameraRamPlugin::EnumerateVideoFrameSizes(TSize& /*aSize*/,TInt /*aSizeIndex*/,TFormat /*aFormat*/) const
|
sl@0
|
269 |
{
|
sl@0
|
270 |
}
|
sl@0
|
271 |
|
sl@0
|
272 |
void CCameraRamPlugin::EnumerateVideoFrameRates(TReal32& /*aRate*/,TInt /*aRateIndex*/,TFormat /*aFormat*/,TInt /*aSizeIndex*/,TExposure /*aExposure = EExposureAuto*/) const
|
sl@0
|
273 |
{
|
sl@0
|
274 |
}
|
sl@0
|
275 |
|
sl@0
|
276 |
void CCameraRamPlugin::GetFrameSize(TSize& /*aSize*/) const
|
sl@0
|
277 |
{
|
sl@0
|
278 |
}
|
sl@0
|
279 |
|
sl@0
|
280 |
TReal32 CCameraRamPlugin::FrameRate() const
|
sl@0
|
281 |
{
|
sl@0
|
282 |
return 0.0;
|
sl@0
|
283 |
}
|
sl@0
|
284 |
|
sl@0
|
285 |
TInt CCameraRamPlugin::BuffersInUse() const
|
sl@0
|
286 |
{
|
sl@0
|
287 |
return 0;
|
sl@0
|
288 |
}
|
sl@0
|
289 |
|
sl@0
|
290 |
TInt CCameraRamPlugin::FramesPerBuffer() const
|
sl@0
|
291 |
{
|
sl@0
|
292 |
return 0;
|
sl@0
|
293 |
}
|
sl@0
|
294 |
|
sl@0
|
295 |
void CCameraRamPlugin::SetJpegQuality(TInt /*aQuality*/)
|
sl@0
|
296 |
{
|
sl@0
|
297 |
}
|
sl@0
|
298 |
|
sl@0
|
299 |
TInt CCameraRamPlugin::JpegQuality() const
|
sl@0
|
300 |
{
|
sl@0
|
301 |
return 0;
|
sl@0
|
302 |
}
|
sl@0
|
303 |
|
sl@0
|
304 |
TAny* CCameraRamPlugin::CustomInterface(TUid /*aInterfaceUid*/)
|
sl@0
|
305 |
{
|
sl@0
|
306 |
return NULL;
|
sl@0
|
307 |
}
|
sl@0
|
308 |
|
sl@0
|
309 |
//
|
sl@0
|
310 |
// CCameraRamPluginInfo
|
sl@0
|
311 |
//
|
sl@0
|
312 |
|
sl@0
|
313 |
CCameraRamPluginInfo::CCameraRamPluginInfo()
|
sl@0
|
314 |
{
|
sl@0
|
315 |
}
|
sl@0
|
316 |
|
sl@0
|
317 |
CCameraRamPluginInfo::~CCameraRamPluginInfo()
|
sl@0
|
318 |
{
|
sl@0
|
319 |
}
|
sl@0
|
320 |
|
sl@0
|
321 |
CCameraRamPluginInfo* CCameraRamPluginInfo::NewL()
|
sl@0
|
322 |
{
|
sl@0
|
323 |
FileDependencyUtil::CheckFileDependencyL();
|
sl@0
|
324 |
return new (ELeave) CCameraRamPluginInfo;
|
sl@0
|
325 |
}
|
sl@0
|
326 |
|
sl@0
|
327 |
TInt CCameraRamPluginInfo::CamerasAvailable()
|
sl@0
|
328 |
{
|
sl@0
|
329 |
return 1;
|
sl@0
|
330 |
}
|
sl@0
|
331 |
|
sl@0
|
332 |
void FileDependencyUtil::CheckFileDependencyL()
|
sl@0
|
333 |
{
|
sl@0
|
334 |
RFs fsSession;
|
sl@0
|
335 |
RFile file;
|
sl@0
|
336 |
|
sl@0
|
337 |
User::LeaveIfError(fsSession.Connect());
|
sl@0
|
338 |
CleanupClosePushL(fsSession);
|
sl@0
|
339 |
TInt err = file.Open(fsSession, KECamRamPluginName, EFileRead);
|
sl@0
|
340 |
file.Close();
|
sl@0
|
341 |
|
sl@0
|
342 |
if(err != KErrNone)
|
sl@0
|
343 |
{
|
sl@0
|
344 |
User::LeaveIfError(KErrNotSupported);
|
sl@0
|
345 |
}
|
sl@0
|
346 |
CleanupStack::PopAndDestroy(); //fsSession
|
sl@0
|
347 |
}
|
sl@0
|
348 |
|
sl@0
|
349 |
// __________________________________________________________________________
|
sl@0
|
350 |
// Exported proxy for instantiation method resolution
|
sl@0
|
351 |
// Define the interface UIDs
|
sl@0
|
352 |
const TImplementationProxy ImplementationTable[] =
|
sl@0
|
353 |
{
|
sl@0
|
354 |
IMPLEMENTATION_PROXY_ENTRY(KUidCameraRamTestPlugin, CCameraRamPlugin::NewL),
|
sl@0
|
355 |
IMPLEMENTATION_PROXY_ENTRY(KUidCameraRamTestInfo, CCameraRamPluginInfo::NewL)
|
sl@0
|
356 |
};
|
sl@0
|
357 |
|
sl@0
|
358 |
EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
|
sl@0
|
359 |
{
|
sl@0
|
360 |
aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
|
sl@0
|
361 |
|
sl@0
|
362 |
return ImplementationTable;
|
sl@0
|
363 |
}
|
sl@0
|
364 |
|