|
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 "cxesettingsmodel.h" |
|
22 #include "cxutils.h" |
|
23 #include "cxenamespace.h" |
|
24 #include "cxeerrormappingsymbian.h" |
|
25 #include "cxedummycamera.h" |
|
26 |
|
27 CxeCameraDeviceControlUnit::CxeCameraDeviceControlUnit() |
|
28 : CxeCameraDeviceControlSymbian() |
|
29 { |
|
30 CX_DEBUG_IN_FUNCTION(); |
|
31 } |
|
32 |
|
33 CxeCameraDeviceControlUnit::~CxeCameraDeviceControlUnit() |
|
34 { |
|
35 CX_DEBUG_IN_FUNCTION(); |
|
36 } |
|
37 |
|
38 CxeError::Id CxeCameraDeviceControlUnit::newCamera(Cxe::CameraIndex cameraIndex) |
|
39 { |
|
40 CX_DEBUG_ENTER_FUNCTION(); |
|
41 CX_DEBUG(("CxeCameraDeviceControlUnit: using camera index %d", cameraIndex)); |
|
42 |
|
43 CX_DEBUG_ASSERT(cameraIndex == Cxe::PrimaryCameraIndex || cameraIndex == Cxe::SecondaryCameraIndex); |
|
44 |
|
45 CCamera* camera = NULL; |
|
46 TRAPD(err, camera = CxeDummyCamera::NewL(*this, cameraIndex, 100, 2)); |
|
47 |
|
48 if (!err) { |
|
49 // CCamera object created, so make sure that appropriate index is used |
|
50 mCameraIndex = cameraIndex; |
|
51 |
|
52 if (mCameraDevice == NULL) { // creating for first time. |
|
53 mCameraDevice = new CxeFakeCameraDevice(); |
|
54 } else { |
|
55 mCameraDevice->setCamera(camera); |
|
56 } |
|
57 } |
|
58 |
|
59 CX_DEBUG_EXIT_FUNCTION(); |
|
60 return CxeErrorHandlingSymbian::map(err); |
|
61 } |
|
62 |
|
63 // end of file |