1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/mmplugins/cameraplugins/source/stub/ECamStubPlugin.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,395 @@
1.4 +// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +#include "ECamStubPlugin.h"
1.20 +
1.21 +#include <ecom/ecom.h>
1.22 +#include <ecom/implementationproxy.h>
1.23 +#include <ecamuids.hrh>
1.24 +
1.25 +//
1.26 +// Main stuff
1.27 +//
1.28 +
1.29 +static void Panic(TInt aReason)
1.30 + {
1.31 + _LIT(KDllName, "ECam Stub Plugin");
1.32 + User::Panic(KDllName, aReason);
1.33 + }
1.34 +
1.35 +//
1.36 +// CCameraStub
1.37 +//
1.38 +
1.39 +CCameraStub::CCameraStub()
1.40 + {
1.41 + }
1.42 +
1.43 +CCameraStub::~CCameraStub()
1.44 + {
1.45 + }
1.46 +
1.47 +CCameraStub* CCameraStub::NewL()
1.48 + {
1.49 + return new (ELeave) CCameraStub;
1.50 + }
1.51 +
1.52 +//
1.53 +// 2nd stage ConstructL calls called by framework
1.54 +//
1.55 +
1.56 +void CCameraStub::Construct2L(MCameraObserver& aObserver,TInt aCameraIndex)
1.57 + {
1.58 + iObserver = &aObserver;
1.59 + iCameraIndex = aCameraIndex;
1.60 + User::Leave(KErrNotSupported);
1.61 + }
1.62 +
1.63 +void CCameraStub::Construct2DupL(MCameraObserver& aObserver,TInt aCameraHandle)
1.64 + {
1.65 + iObserver = &aObserver;
1.66 + iCameraHandle = aCameraHandle;
1.67 + User::Leave(KErrNotSupported);
1.68 + }
1.69 +
1.70 +
1.71 +void CCameraStub::Construct2L(MCameraObserver2& aObserver,TInt aCameraIndex,TInt aPriority)
1.72 + {
1.73 + iObserver2 = &aObserver;
1.74 + iCameraIndex = aCameraIndex;
1.75 + iPriority = aPriority;
1.76 + User::Leave(KErrNotSupported);
1.77 + }
1.78 +
1.79 +void CCameraStub::Construct2DupL(MCameraObserver2& aObserver,TInt aCameraHandle)
1.80 + {
1.81 + iObserver2 = &aObserver;
1.82 + iCameraHandle = aCameraHandle;
1.83 + User::Leave(KErrNotSupported);
1.84 + }
1.85 +
1.86 +
1.87 +
1.88 +//
1.89 +// Dummy versions of virtual functions
1.90 +//
1.91 +
1.92 +void CCameraStub::CameraInfo(TCameraInfo& /*aInfo*/) const
1.93 + {
1.94 + Panic(EPanicUnimplemented);
1.95 + }
1.96 +
1.97 +void CCameraStub::Reserve()
1.98 + {
1.99 + Panic(EPanicUnimplemented);
1.100 + }
1.101 +
1.102 +
1.103 +void CCameraStub::Release()
1.104 + {
1.105 + Panic(EPanicUnimplemented);
1.106 + }
1.107 +
1.108 +void CCameraStub::PowerOn()
1.109 + {
1.110 + Panic(EPanicUnimplemented);
1.111 + }
1.112 +
1.113 +void CCameraStub::PowerOff()
1.114 + {
1.115 + Panic(EPanicUnimplemented);
1.116 + }
1.117 +
1.118 +TInt CCameraStub::Handle()
1.119 + {
1.120 + Panic(EPanicUnimplemented);
1.121 + return 0;
1.122 + }
1.123 +
1.124 +void CCameraStub::SetZoomFactorL(TInt /*aZoomFactor = 0*/)
1.125 + {
1.126 + Panic(EPanicUnimplemented);
1.127 + }
1.128 +
1.129 +TInt CCameraStub::ZoomFactor() const
1.130 + {
1.131 + Panic(EPanicUnimplemented);
1.132 + return 0;
1.133 + }
1.134 +
1.135 +void CCameraStub::SetDigitalZoomFactorL(TInt /*aDigitalZoomFactor = 0*/)
1.136 + {
1.137 + Panic(EPanicUnimplemented);
1.138 + }
1.139 +
1.140 +TInt CCameraStub::DigitalZoomFactor() const
1.141 + {
1.142 + Panic(EPanicUnimplemented);
1.143 + return 0;
1.144 + }
1.145 +
1.146 +void CCameraStub::SetContrastL(TInt /*aContrast*/)
1.147 + {
1.148 + Panic(EPanicUnimplemented);
1.149 + }
1.150 +
1.151 +TInt CCameraStub::Contrast() const
1.152 + {
1.153 + Panic(EPanicUnimplemented);
1.154 + return 0;
1.155 + }
1.156 +
1.157 +void CCameraStub::SetBrightnessL(TInt /*aBrightness*/)
1.158 + {
1.159 + Panic(EPanicUnimplemented);
1.160 + }
1.161 +
1.162 +TInt CCameraStub::Brightness() const
1.163 + {
1.164 + Panic(EPanicUnimplemented);
1.165 + return 0;
1.166 + }
1.167 +
1.168 +
1.169 +void CCameraStub::SetFlashL(TFlash /*aFlash = EFlashNone*/)
1.170 + {
1.171 + Panic(EPanicUnimplemented);
1.172 + }
1.173 +
1.174 +CCamera::TFlash CCameraStub::Flash() const
1.175 + {
1.176 + Panic(EPanicUnimplemented);
1.177 + return EFlashNone;
1.178 + }
1.179 +
1.180 +void CCameraStub::SetExposureL(TExposure /*aExposure = EExposureAuto*/)
1.181 + {
1.182 + Panic(EPanicUnimplemented);
1.183 + }
1.184 +
1.185 +CCamera::TExposure CCameraStub::Exposure() const
1.186 + {
1.187 + Panic(EPanicUnimplemented);
1.188 + return EExposureAuto;
1.189 + }
1.190 +
1.191 +void CCameraStub::SetWhiteBalanceL(TWhiteBalance /*aWhiteBalance = EWBAuto*/)
1.192 + {
1.193 + Panic(EPanicUnimplemented);
1.194 + }
1.195 +
1.196 +
1.197 +CCamera::TWhiteBalance CCameraStub::WhiteBalance() const
1.198 + {
1.199 + Panic(EPanicUnimplemented);
1.200 + return EWBAuto;
1.201 + }
1.202 +
1.203 +void CCameraStub::StartViewFinderDirectL(RWsSession& /*aWs*/,CWsScreenDevice& /*aScreenDevice*/,RWindowBase& /*aWindow*/,TRect& /*aScreenRect*/)
1.204 + {
1.205 + Panic(EPanicUnimplemented);
1.206 + }
1.207 +
1.208 +void CCameraStub::StartViewFinderDirectL(RWsSession& /*aWs*/,CWsScreenDevice& /*aScreenDevice*/,RWindowBase& /*aWindow*/,TRect& /*aScreenRect*/,TRect& /*aClipRect*/)
1.209 + {
1.210 + Panic(EPanicUnimplemented);
1.211 + }
1.212 +
1.213 +void CCameraStub::StartViewFinderBitmapsL(TSize& /*aSize*/)
1.214 + {
1.215 + Panic(EPanicUnimplemented);
1.216 + }
1.217 +
1.218 +void CCameraStub::StartViewFinderBitmapsL(TSize& /*aSize*/,TRect& /*aClipRect*/)
1.219 + {
1.220 + Panic(EPanicUnimplemented);
1.221 + }
1.222 +
1.223 +
1.224 +void CCameraStub::StartViewFinderL(TFormat /*aImageFormat*/,TSize& /*aSize*/)
1.225 + {
1.226 + Panic(EPanicUnimplemented);
1.227 + }
1.228 +
1.229 +void CCameraStub::StartViewFinderL(TFormat /*aImageFormat*/,TSize& /*aSize*/,TRect& /*aClipRect*/)
1.230 + {
1.231 + Panic(EPanicUnimplemented);
1.232 + }
1.233 +
1.234 +
1.235 +void CCameraStub::StopViewFinder()
1.236 + {
1.237 + Panic(EPanicUnimplemented);
1.238 + }
1.239 +
1.240 +TBool CCameraStub::ViewFinderActive() const
1.241 + {
1.242 + Panic(EPanicUnimplemented);
1.243 + return EFalse;
1.244 + }
1.245 +
1.246 +void CCameraStub::SetViewFinderMirrorL(TBool /*aMirror*/)
1.247 + {
1.248 + Panic(EPanicUnimplemented);
1.249 + }
1.250 +
1.251 +TBool CCameraStub::ViewFinderMirror() const
1.252 + {
1.253 + Panic(EPanicUnimplemented);
1.254 + return EFalse;
1.255 + }
1.256 +
1.257 +void CCameraStub::PrepareImageCaptureL(TFormat /*aImageFormat*/,TInt /*aSizeIndex*/)
1.258 + {
1.259 + Panic(EPanicUnimplemented);
1.260 + }
1.261 +
1.262 +void CCameraStub::PrepareImageCaptureL(TFormat /*aImageFormat*/,TInt /*aSizeIndex*/,const TRect& /*aClipRect*/)
1.263 + {
1.264 + Panic(EPanicUnimplemented);
1.265 + }
1.266 +
1.267 +
1.268 +void CCameraStub::CaptureImage()
1.269 + {
1.270 + Panic(EPanicUnimplemented);
1.271 + }
1.272 +
1.273 +void CCameraStub::CancelCaptureImage()
1.274 + {
1.275 + Panic(EPanicUnimplemented);
1.276 + }
1.277 +
1.278 +void CCameraStub::EnumerateCaptureSizes(TSize& /*aSize*/,TInt /*aSizeIndex*/,TFormat /*aFormat*/) const
1.279 + {
1.280 + Panic(EPanicUnimplemented);
1.281 + }
1.282 +
1.283 +void CCameraStub::PrepareVideoCaptureL(TFormat /*aFormat*/,TInt /*aSizeIndex*/,TInt /*aRateIndex*/,TInt /*aBuffersToUse*/,TInt /*aFramesPerBuffer*/)
1.284 + {
1.285 + Panic(EPanicUnimplemented);
1.286 + }
1.287 +
1.288 +void CCameraStub::PrepareVideoCaptureL(TFormat /*aFormat*/,TInt /*aSizeIndex*/,TInt /*aRateIndex*/,TInt /*aBuffersToUse*/,TInt /*aFramesPerBuffer*/,const TRect& /*aClipRect*/)
1.289 + {
1.290 + Panic(EPanicUnimplemented);
1.291 + }
1.292 +
1.293 +void CCameraStub::StartVideoCapture()
1.294 + {
1.295 + Panic(EPanicUnimplemented);
1.296 + }
1.297 +
1.298 +void CCameraStub::StopVideoCapture()
1.299 + {
1.300 + Panic(EPanicUnimplemented);
1.301 + }
1.302 +
1.303 +TBool CCameraStub::VideoCaptureActive() const
1.304 + {
1.305 + Panic(EPanicUnimplemented);
1.306 + return EFalse;
1.307 + }
1.308 +
1.309 +void CCameraStub::EnumerateVideoFrameSizes(TSize& /*aSize*/,TInt /*aSizeIndex*/,TFormat /*aFormat*/) const
1.310 + {
1.311 + Panic(EPanicUnimplemented);
1.312 + }
1.313 +
1.314 +void CCameraStub::EnumerateVideoFrameRates(TReal32& /*aRate*/,TInt /*aRateIndex*/,TFormat /*aFormat*/,TInt /*aSizeIndex*/,TExposure /*aExposure = EExposureAuto*/) const
1.315 + {
1.316 + Panic(EPanicUnimplemented);
1.317 + }
1.318 +
1.319 +void CCameraStub::GetFrameSize(TSize& /*aSize*/) const
1.320 + {
1.321 + Panic(EPanicUnimplemented);
1.322 + }
1.323 +
1.324 +TReal32 CCameraStub::FrameRate() const
1.325 + {
1.326 + Panic(EPanicUnimplemented);
1.327 + return 0.0;
1.328 + }
1.329 +
1.330 +TInt CCameraStub::BuffersInUse() const
1.331 + {
1.332 + Panic(EPanicUnimplemented);
1.333 + return 0;
1.334 + }
1.335 +
1.336 +TInt CCameraStub::FramesPerBuffer() const
1.337 + {
1.338 + Panic(EPanicUnimplemented);
1.339 + return 0;
1.340 + }
1.341 +
1.342 +void CCameraStub::SetJpegQuality(TInt /*aQuality*/)
1.343 + {
1.344 + Panic(EPanicUnimplemented);
1.345 + }
1.346 +
1.347 +TInt CCameraStub::JpegQuality() const
1.348 + {
1.349 + Panic(EPanicUnimplemented);
1.350 + return 0;
1.351 + }
1.352 +
1.353 +TAny* CCameraStub::CustomInterface(TUid /*aInterface*/)
1.354 + {
1.355 + Panic(EPanicUnimplemented);
1.356 + return NULL;
1.357 + }
1.358 +
1.359 +
1.360 +//
1.361 +// CCameraStubInfo
1.362 +//
1.363 +
1.364 +CCameraStubInfo::CCameraStubInfo()
1.365 + {
1.366 + }
1.367 +
1.368 +CCameraStubInfo::~CCameraStubInfo()
1.369 + {
1.370 + }
1.371 +
1.372 +CCameraStubInfo* CCameraStubInfo::NewL()
1.373 + {
1.374 + return new (ELeave) CCameraStubInfo;
1.375 + }
1.376 +
1.377 +TInt CCameraStubInfo::CamerasAvailable()
1.378 + {
1.379 + return 0;
1.380 + }
1.381 +
1.382 +
1.383 +// __________________________________________________________________________
1.384 +// Exported proxy for instantiation method resolution
1.385 +// Define the interface UIDs
1.386 +const TImplementationProxy ImplementationTable[] =
1.387 + {
1.388 + IMPLEMENTATION_PROXY_ENTRY(KUidOnboardCameraStubPlugin, CCameraStub::NewL),
1.389 + IMPLEMENTATION_PROXY_ENTRY(KUidOnboardCameraStubInfo, CCameraStubInfo::NewL)
1.390 + };
1.391 +
1.392 +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
1.393 + {
1.394 + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
1.395 +
1.396 + return ImplementationTable;
1.397 + }
1.398 +