sl@0: // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include "ecamramplugin.h" sl@0: #include "ecamrampluginuids.hrh" sl@0: sl@0: sl@0: // sl@0: // CCameraRamPlugin sl@0: // sl@0: CCameraRamPlugin::CCameraRamPlugin() sl@0: { sl@0: } sl@0: sl@0: CCameraRamPlugin::~CCameraRamPlugin() sl@0: { sl@0: } sl@0: sl@0: CCameraRamPlugin* CCameraRamPlugin::NewL() sl@0: { sl@0: FileDependencyUtil::CheckFileDependencyL(); sl@0: return new (ELeave) CCameraRamPlugin; sl@0: } sl@0: sl@0: // sl@0: // 2nd stage ConstructL calls called by framework sl@0: // sl@0: sl@0: void CCameraRamPlugin::Construct2L(MCameraObserver& aObserver,TInt aCameraIndex) sl@0: { sl@0: iObserver = &aObserver; sl@0: iCameraIndex = aCameraIndex; sl@0: } sl@0: sl@0: void CCameraRamPlugin::Construct2DupL(MCameraObserver& aObserver,TInt aCameraHandle) sl@0: { sl@0: iObserver = &aObserver; sl@0: iCameraHandle = aCameraHandle; sl@0: } sl@0: sl@0: sl@0: void CCameraRamPlugin::Construct2L(MCameraObserver2& aObserver,TInt aCameraIndex,TInt aPriority) sl@0: { sl@0: iObserver2 = &aObserver; sl@0: iCameraIndex = aCameraIndex; sl@0: iPriority = aPriority; sl@0: } sl@0: sl@0: void CCameraRamPlugin::Construct2DupL(MCameraObserver2& aObserver,TInt aCameraHandle) sl@0: { sl@0: iObserver2 = &aObserver; sl@0: iCameraHandle = aCameraHandle; sl@0: } sl@0: sl@0: sl@0: sl@0: // sl@0: // Dummy versions of virtual functions sl@0: // sl@0: sl@0: void CCameraRamPlugin::CameraInfo(TCameraInfo& /*aInfo*/) const sl@0: { sl@0: } sl@0: sl@0: void CCameraRamPlugin::Reserve() sl@0: { sl@0: } sl@0: sl@0: sl@0: void CCameraRamPlugin::Release() sl@0: { sl@0: } sl@0: sl@0: void CCameraRamPlugin::PowerOn() sl@0: { sl@0: } sl@0: sl@0: void CCameraRamPlugin::PowerOff() sl@0: { sl@0: } sl@0: sl@0: TInt CCameraRamPlugin::Handle() sl@0: { sl@0: return 0; sl@0: } sl@0: sl@0: void CCameraRamPlugin::SetZoomFactorL(TInt /*aZoomFactor = 0*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: TInt CCameraRamPlugin::ZoomFactor() const sl@0: { sl@0: return 0; sl@0: } sl@0: sl@0: void CCameraRamPlugin::SetDigitalZoomFactorL(TInt /*aDigitalZoomFactor = 0*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: TInt CCameraRamPlugin::DigitalZoomFactor() const sl@0: { sl@0: return 0; sl@0: } sl@0: sl@0: void CCameraRamPlugin::SetContrastL(TInt /*aContrast*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: TInt CCameraRamPlugin::Contrast() const sl@0: { sl@0: return 0; sl@0: } sl@0: sl@0: void CCameraRamPlugin::SetBrightnessL(TInt /*aBrightness*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: TInt CCameraRamPlugin::Brightness() const sl@0: { sl@0: return 0; sl@0: } sl@0: sl@0: sl@0: void CCameraRamPlugin::SetFlashL(TFlash /*aFlash = EFlashNone*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: CCamera::TFlash CCameraRamPlugin::Flash() const sl@0: { sl@0: return EFlashNone; sl@0: } sl@0: sl@0: void CCameraRamPlugin::SetExposureL(TExposure /*aExposure = EExposureAuto*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: CCamera::TExposure CCameraRamPlugin::Exposure() const sl@0: { sl@0: return EExposureAuto; sl@0: } sl@0: sl@0: void CCameraRamPlugin::SetWhiteBalanceL(TWhiteBalance /*aWhiteBalance = EWBAuto*/) sl@0: { sl@0: } sl@0: sl@0: CCamera::TWhiteBalance CCameraRamPlugin::WhiteBalance() const sl@0: { sl@0: return EWBAuto; sl@0: } sl@0: sl@0: void CCameraRamPlugin::StartViewFinderDirectL(RWsSession& /*aWs*/,CWsScreenDevice& /*aScreenDevice*/,RWindowBase& /*aWindow*/,TRect& /*aScreenRect*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCameraRamPlugin::StartViewFinderDirectL(RWsSession& /*aWs*/,CWsScreenDevice& /*aScreenDevice*/,RWindowBase& /*aWindow*/,TRect& /*aScreenRect*/,TRect& /*aClipRect*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCameraRamPlugin::StartViewFinderBitmapsL(TSize& /*aSize*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCameraRamPlugin::StartViewFinderBitmapsL(TSize& /*aSize*/,TRect& /*aClipRect*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: sl@0: void CCameraRamPlugin::StartViewFinderL(TFormat /*aImageFormat*/,TSize& /*aSize*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCameraRamPlugin::StartViewFinderL(TFormat /*aImageFormat*/,TSize& /*aSize*/,TRect& /*aClipRect*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: sl@0: void CCameraRamPlugin::StopViewFinder() sl@0: { sl@0: } sl@0: sl@0: TBool CCameraRamPlugin::ViewFinderActive() const sl@0: { sl@0: return EFalse; sl@0: } sl@0: sl@0: void CCameraRamPlugin::SetViewFinderMirrorL(TBool /*aMirror*/) sl@0: { sl@0: } sl@0: sl@0: TBool CCameraRamPlugin::ViewFinderMirror() const sl@0: { sl@0: return EFalse; sl@0: } sl@0: sl@0: void CCameraRamPlugin::PrepareImageCaptureL(TFormat /*aImageFormat*/,TInt /*aSizeIndex*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCameraRamPlugin::PrepareImageCaptureL(TFormat /*aImageFormat*/,TInt /*aSizeIndex*/,const TRect& /*aClipRect*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCameraRamPlugin::CaptureImage() sl@0: { sl@0: } sl@0: sl@0: void CCameraRamPlugin::CancelCaptureImage() sl@0: { sl@0: } sl@0: sl@0: void CCameraRamPlugin::EnumerateCaptureSizes(TSize& /*aSize*/,TInt /*aSizeIndex*/,TFormat /*aFormat*/) const sl@0: { sl@0: } sl@0: sl@0: void CCameraRamPlugin::PrepareVideoCaptureL(TFormat /*aFormat*/,TInt /*aSizeIndex*/,TInt /*aRateIndex*/,TInt /*aBuffersToUse*/,TInt /*aFramesPerBuffer*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCameraRamPlugin::PrepareVideoCaptureL(TFormat /*aFormat*/,TInt /*aSizeIndex*/,TInt /*aRateIndex*/,TInt /*aBuffersToUse*/,TInt /*aFramesPerBuffer*/,const TRect& /*aClipRect*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCameraRamPlugin::StartVideoCapture() sl@0: { sl@0: } sl@0: sl@0: void CCameraRamPlugin::StopVideoCapture() sl@0: { sl@0: } sl@0: sl@0: TBool CCameraRamPlugin::VideoCaptureActive() const sl@0: { sl@0: return EFalse; sl@0: } sl@0: sl@0: void CCameraRamPlugin::EnumerateVideoFrameSizes(TSize& /*aSize*/,TInt /*aSizeIndex*/,TFormat /*aFormat*/) const sl@0: { sl@0: } sl@0: sl@0: void CCameraRamPlugin::EnumerateVideoFrameRates(TReal32& /*aRate*/,TInt /*aRateIndex*/,TFormat /*aFormat*/,TInt /*aSizeIndex*/,TExposure /*aExposure = EExposureAuto*/) const sl@0: { sl@0: } sl@0: sl@0: void CCameraRamPlugin::GetFrameSize(TSize& /*aSize*/) const sl@0: { sl@0: } sl@0: sl@0: TReal32 CCameraRamPlugin::FrameRate() const sl@0: { sl@0: return 0.0; sl@0: } sl@0: sl@0: TInt CCameraRamPlugin::BuffersInUse() const sl@0: { sl@0: return 0; sl@0: } sl@0: sl@0: TInt CCameraRamPlugin::FramesPerBuffer() const sl@0: { sl@0: return 0; sl@0: } sl@0: sl@0: void CCameraRamPlugin::SetJpegQuality(TInt /*aQuality*/) sl@0: { sl@0: } sl@0: sl@0: TInt CCameraRamPlugin::JpegQuality() const sl@0: { sl@0: return 0; sl@0: } sl@0: sl@0: TAny* CCameraRamPlugin::CustomInterface(TUid /*aInterfaceUid*/) sl@0: { sl@0: return NULL; sl@0: } sl@0: sl@0: // sl@0: // CCameraRamPluginInfo sl@0: // sl@0: sl@0: CCameraRamPluginInfo::CCameraRamPluginInfo() sl@0: { sl@0: } sl@0: sl@0: CCameraRamPluginInfo::~CCameraRamPluginInfo() sl@0: { sl@0: } sl@0: sl@0: CCameraRamPluginInfo* CCameraRamPluginInfo::NewL() sl@0: { sl@0: FileDependencyUtil::CheckFileDependencyL(); sl@0: return new (ELeave) CCameraRamPluginInfo; sl@0: } sl@0: sl@0: TInt CCameraRamPluginInfo::CamerasAvailable() sl@0: { sl@0: return 1; sl@0: } sl@0: sl@0: void FileDependencyUtil::CheckFileDependencyL() sl@0: { sl@0: RFs fsSession; sl@0: RFile file; sl@0: sl@0: User::LeaveIfError(fsSession.Connect()); sl@0: CleanupClosePushL(fsSession); sl@0: TInt err = file.Open(fsSession, KECamRamPluginName, EFileRead); sl@0: file.Close(); sl@0: sl@0: if(err != KErrNone) sl@0: { sl@0: User::LeaveIfError(KErrNotSupported); sl@0: } sl@0: CleanupStack::PopAndDestroy(); //fsSession sl@0: } sl@0: sl@0: // __________________________________________________________________________ sl@0: // Exported proxy for instantiation method resolution sl@0: // Define the interface UIDs sl@0: const TImplementationProxy ImplementationTable[] = sl@0: { sl@0: IMPLEMENTATION_PROXY_ENTRY(KUidCameraRamTestPlugin, CCameraRamPlugin::NewL), sl@0: IMPLEMENTATION_PROXY_ENTRY(KUidCameraRamTestInfo, CCameraRamPluginInfo::NewL) sl@0: }; sl@0: sl@0: EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) sl@0: { sl@0: aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); sl@0: sl@0: return ImplementationTable; sl@0: } sl@0: