Update contrib.
1 // Copyright (c) 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.
17 #include <ecom/ecom.h>
18 #include <ecom/implementationproxy.h>
20 #include "ecamramplugin.h"
21 #include "ecamrampluginuids.hrh"
27 CCameraRamPlugin::CCameraRamPlugin()
31 CCameraRamPlugin::~CCameraRamPlugin()
35 CCameraRamPlugin* CCameraRamPlugin::NewL()
37 FileDependencyUtil::CheckFileDependencyL();
38 return new (ELeave) CCameraRamPlugin;
42 // 2nd stage ConstructL calls called by framework
45 void CCameraRamPlugin::Construct2L(MCameraObserver& aObserver,TInt aCameraIndex)
47 iObserver = &aObserver;
48 iCameraIndex = aCameraIndex;
51 void CCameraRamPlugin::Construct2DupL(MCameraObserver& aObserver,TInt aCameraHandle)
53 iObserver = &aObserver;
54 iCameraHandle = aCameraHandle;
58 void CCameraRamPlugin::Construct2L(MCameraObserver2& aObserver,TInt aCameraIndex,TInt aPriority)
60 iObserver2 = &aObserver;
61 iCameraIndex = aCameraIndex;
62 iPriority = aPriority;
65 void CCameraRamPlugin::Construct2DupL(MCameraObserver2& aObserver,TInt aCameraHandle)
67 iObserver2 = &aObserver;
68 iCameraHandle = aCameraHandle;
74 // Dummy versions of virtual functions
77 void CCameraRamPlugin::CameraInfo(TCameraInfo& /*aInfo*/) const
81 void CCameraRamPlugin::Reserve()
86 void CCameraRamPlugin::Release()
90 void CCameraRamPlugin::PowerOn()
94 void CCameraRamPlugin::PowerOff()
98 TInt CCameraRamPlugin::Handle()
103 void CCameraRamPlugin::SetZoomFactorL(TInt /*aZoomFactor = 0*/)
105 User::Leave(KErrNotSupported);
108 TInt CCameraRamPlugin::ZoomFactor() const
113 void CCameraRamPlugin::SetDigitalZoomFactorL(TInt /*aDigitalZoomFactor = 0*/)
115 User::Leave(KErrNotSupported);
118 TInt CCameraRamPlugin::DigitalZoomFactor() const
123 void CCameraRamPlugin::SetContrastL(TInt /*aContrast*/)
125 User::Leave(KErrNotSupported);
128 TInt CCameraRamPlugin::Contrast() const
133 void CCameraRamPlugin::SetBrightnessL(TInt /*aBrightness*/)
135 User::Leave(KErrNotSupported);
138 TInt CCameraRamPlugin::Brightness() const
144 void CCameraRamPlugin::SetFlashL(TFlash /*aFlash = EFlashNone*/)
146 User::Leave(KErrNotSupported);
149 CCamera::TFlash CCameraRamPlugin::Flash() const
154 void CCameraRamPlugin::SetExposureL(TExposure /*aExposure = EExposureAuto*/)
156 User::Leave(KErrNotSupported);
159 CCamera::TExposure CCameraRamPlugin::Exposure() const
161 return EExposureAuto;
164 void CCameraRamPlugin::SetWhiteBalanceL(TWhiteBalance /*aWhiteBalance = EWBAuto*/)
168 CCamera::TWhiteBalance CCameraRamPlugin::WhiteBalance() const
173 void CCameraRamPlugin::StartViewFinderDirectL(RWsSession& /*aWs*/,CWsScreenDevice& /*aScreenDevice*/,RWindowBase& /*aWindow*/,TRect& /*aScreenRect*/)
175 User::Leave(KErrNotSupported);
178 void CCameraRamPlugin::StartViewFinderDirectL(RWsSession& /*aWs*/,CWsScreenDevice& /*aScreenDevice*/,RWindowBase& /*aWindow*/,TRect& /*aScreenRect*/,TRect& /*aClipRect*/)
180 User::Leave(KErrNotSupported);
183 void CCameraRamPlugin::StartViewFinderBitmapsL(TSize& /*aSize*/)
185 User::Leave(KErrNotSupported);
188 void CCameraRamPlugin::StartViewFinderBitmapsL(TSize& /*aSize*/,TRect& /*aClipRect*/)
190 User::Leave(KErrNotSupported);
194 void CCameraRamPlugin::StartViewFinderL(TFormat /*aImageFormat*/,TSize& /*aSize*/)
196 User::Leave(KErrNotSupported);
199 void CCameraRamPlugin::StartViewFinderL(TFormat /*aImageFormat*/,TSize& /*aSize*/,TRect& /*aClipRect*/)
201 User::Leave(KErrNotSupported);
205 void CCameraRamPlugin::StopViewFinder()
209 TBool CCameraRamPlugin::ViewFinderActive() const
214 void CCameraRamPlugin::SetViewFinderMirrorL(TBool /*aMirror*/)
218 TBool CCameraRamPlugin::ViewFinderMirror() const
223 void CCameraRamPlugin::PrepareImageCaptureL(TFormat /*aImageFormat*/,TInt /*aSizeIndex*/)
225 User::Leave(KErrNotSupported);
228 void CCameraRamPlugin::PrepareImageCaptureL(TFormat /*aImageFormat*/,TInt /*aSizeIndex*/,const TRect& /*aClipRect*/)
230 User::Leave(KErrNotSupported);
233 void CCameraRamPlugin::CaptureImage()
237 void CCameraRamPlugin::CancelCaptureImage()
241 void CCameraRamPlugin::EnumerateCaptureSizes(TSize& /*aSize*/,TInt /*aSizeIndex*/,TFormat /*aFormat*/) const
245 void CCameraRamPlugin::PrepareVideoCaptureL(TFormat /*aFormat*/,TInt /*aSizeIndex*/,TInt /*aRateIndex*/,TInt /*aBuffersToUse*/,TInt /*aFramesPerBuffer*/)
247 User::Leave(KErrNotSupported);
250 void CCameraRamPlugin::PrepareVideoCaptureL(TFormat /*aFormat*/,TInt /*aSizeIndex*/,TInt /*aRateIndex*/,TInt /*aBuffersToUse*/,TInt /*aFramesPerBuffer*/,const TRect& /*aClipRect*/)
252 User::Leave(KErrNotSupported);
255 void CCameraRamPlugin::StartVideoCapture()
259 void CCameraRamPlugin::StopVideoCapture()
263 TBool CCameraRamPlugin::VideoCaptureActive() const
268 void CCameraRamPlugin::EnumerateVideoFrameSizes(TSize& /*aSize*/,TInt /*aSizeIndex*/,TFormat /*aFormat*/) const
272 void CCameraRamPlugin::EnumerateVideoFrameRates(TReal32& /*aRate*/,TInt /*aRateIndex*/,TFormat /*aFormat*/,TInt /*aSizeIndex*/,TExposure /*aExposure = EExposureAuto*/) const
276 void CCameraRamPlugin::GetFrameSize(TSize& /*aSize*/) const
280 TReal32 CCameraRamPlugin::FrameRate() const
285 TInt CCameraRamPlugin::BuffersInUse() const
290 TInt CCameraRamPlugin::FramesPerBuffer() const
295 void CCameraRamPlugin::SetJpegQuality(TInt /*aQuality*/)
299 TInt CCameraRamPlugin::JpegQuality() const
304 TAny* CCameraRamPlugin::CustomInterface(TUid /*aInterfaceUid*/)
310 // CCameraRamPluginInfo
313 CCameraRamPluginInfo::CCameraRamPluginInfo()
317 CCameraRamPluginInfo::~CCameraRamPluginInfo()
321 CCameraRamPluginInfo* CCameraRamPluginInfo::NewL()
323 FileDependencyUtil::CheckFileDependencyL();
324 return new (ELeave) CCameraRamPluginInfo;
327 TInt CCameraRamPluginInfo::CamerasAvailable()
332 void FileDependencyUtil::CheckFileDependencyL()
337 User::LeaveIfError(fsSession.Connect());
338 CleanupClosePushL(fsSession);
339 TInt err = file.Open(fsSession, KECamRamPluginName, EFileRead);
344 User::LeaveIfError(KErrNotSupported);
346 CleanupStack::PopAndDestroy(); //fsSession
349 // __________________________________________________________________________
350 // Exported proxy for instantiation method resolution
351 // Define the interface UIDs
352 const TImplementationProxy ImplementationTable[] =
354 IMPLEMENTATION_PROXY_ENTRY(KUidCameraRamTestPlugin, CCameraRamPlugin::NewL),
355 IMPLEMENTATION_PROXY_ENTRY(KUidCameraRamTestInfo, CCameraRamPluginInfo::NewL)
358 EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
360 aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
362 return ImplementationTable;