1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 #include "cxecameradevicecontrolunit.h" |
|
18 #include "cxefakecameradevice.h" |
|
19 #include "cxesettingsimp.h" |
|
20 #include "cxefeaturemanagerimp.h" |
|
21 #include "cxutils.h" |
|
22 #include "cxenamespace.h" |
|
23 #include "cxeerrormappingsymbian.h" |
|
24 #include "cxedummycamera.h" |
|
25 |
|
26 CxeCameraDeviceControlUnit::CxeCameraDeviceControlUnit() |
|
27 : CxeCameraDeviceControlSymbian() |
|
28 { |
|
29 CX_DEBUG_IN_FUNCTION(); |
|
30 } |
|
31 |
|
32 CxeCameraDeviceControlUnit::~CxeCameraDeviceControlUnit() |
|
33 { |
|
34 CX_DEBUG_IN_FUNCTION(); |
|
35 } |
|
36 |
|
37 CxeError::Id CxeCameraDeviceControlUnit::newCamera(Cxe::CameraIndex cameraIndex) |
|
38 { |
|
39 CX_DEBUG_ENTER_FUNCTION(); |
|
40 CX_DEBUG(("CxeCameraDeviceControlUnit: using camera index %d", cameraIndex)); |
|
41 |
|
42 CX_DEBUG_ASSERT(cameraIndex == Cxe::PrimaryCameraIndex || cameraIndex == Cxe::SecondaryCameraIndex); |
|
43 |
|
44 CCamera* camera = NULL; |
|
45 TRAPD(err, camera = CxeDummyCamera::NewL(*this, cameraIndex, 100, 2)); |
|
46 |
|
47 if (!err) { |
|
48 // CCamera object created, so make sure that appropriate index is used |
|
49 mCameraIndex = cameraIndex; |
|
50 |
|
51 if (mCameraDevice == NULL) { // creating for first time. |
|
52 mCameraDevice = new CxeFakeCameraDevice(); |
|
53 } else { |
|
54 mCameraDevice->setCamera(camera); |
|
55 } |
|
56 } |
|
57 |
|
58 CX_DEBUG_EXIT_FUNCTION(); |
|
59 return CxeErrorHandlingSymbian::map(err); |
|
60 } |
|
61 |
|
62 // end of file |
|