sl@0
|
1 |
// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
/**
|
sl@0
|
17 |
@file
|
sl@0
|
18 |
@internalTechnology
|
sl@0
|
19 |
*/
|
sl@0
|
20 |
|
sl@0
|
21 |
#ifndef MMCAMERACLIENTINTERFACE_H
|
sl@0
|
22 |
#define MMCAMERACLIENTINTERFACE_H
|
sl@0
|
23 |
|
sl@0
|
24 |
#include <e32base.h>
|
sl@0
|
25 |
#include <e32std.h>
|
sl@0
|
26 |
#include <ecamuids.hrh>
|
sl@0
|
27 |
#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
|
sl@0
|
28 |
#include <ecamuidsdef.hrh>
|
sl@0
|
29 |
#endif
|
sl@0
|
30 |
#include <ecamviewfinder.h>
|
sl@0
|
31 |
#include <graphics/surface.h>
|
sl@0
|
32 |
|
sl@0
|
33 |
static const TInt KECamMaxMessage = 100;
|
sl@0
|
34 |
static const TUid KECamServerUid3 = {KUidMMCameraServer};
|
sl@0
|
35 |
static const TInt KECamNoPriority = -101;
|
sl@0
|
36 |
static const TInt KECamHandleNotKnown = -1;
|
sl@0
|
37 |
static const TInt KECamNumAsynchMsg = 8;
|
sl@0
|
38 |
|
sl@0
|
39 |
|
sl@0
|
40 |
_LIT(KMMCameraServerName, "!MMCameraServer");
|
sl@0
|
41 |
_LIT(KMMCameraServerExe, "MMCameraServer"); // Exe name
|
sl@0
|
42 |
|
sl@0
|
43 |
enum TECamMsgId // Enums for use in ServiceL()
|
sl@0
|
44 |
{
|
sl@0
|
45 |
ECamQueryCamerasAvailable = 0, // Query MM server to retrieve number of physical cameras available
|
sl@0
|
46 |
ECamCameraAccessControl, // Enums to reserve/release the camera for exclusive use. TBool ETrue/EFalse decides Reserve/Release .
|
sl@0
|
47 |
ECamPowerCamera, // To Power On the camera if TBool passed =ETrue, else power down
|
sl@0
|
48 |
ECamOpenCamera, // Called from ConnectSession to open a particular camera specified by the index
|
sl@0
|
49 |
ECamHandleCamera, // Get the handle of the camera
|
sl@0
|
50 |
ECamGetCameraInfo, // Retrieve the info about camera device
|
sl@0
|
51 |
ECamPrepareDirectViewFinder, // Sets up the direct view finder
|
sl@0
|
52 |
ECamStartDirectViewFinder, // Starts view finder operation
|
sl@0
|
53 |
ECamStopDirectViewFinder, // Stops view finder playback
|
sl@0
|
54 |
ECamPauseDirectViewFinder, // Pauses view finder playback
|
sl@0
|
55 |
ECamResumeDirectViewFinder, // If paused, resumes view finder playback
|
sl@0
|
56 |
ECamDirectViewFinderState, // Retrieves state of direct view finder
|
sl@0
|
57 |
ECamSetDirectViewFinderMirror, // Enables/Disables mirror mode on direct viewfinder
|
sl@0
|
58 |
ECamGetDirectViewFinderMirror, // Retrieves mirror mode status of direct viewfinder
|
sl@0
|
59 |
ECamDirectViewFinderProperties, // Retrieves properties related to the direct viewfinder
|
sl@0
|
60 |
ECamSetParameter, // Maps Set camera parameters
|
sl@0
|
61 |
ECamGetParameter, // Retrives camera parameters
|
sl@0
|
62 |
ECamCameraHandle // Retrieves unique camera handle
|
sl@0
|
63 |
};
|
sl@0
|
64 |
|
sl@0
|
65 |
enum TCameraParameterId // Camera parameters to set/get
|
sl@0
|
66 |
{
|
sl@0
|
67 |
EZoomFactor,
|
sl@0
|
68 |
EDigitalZoomFactor,
|
sl@0
|
69 |
EContrast,
|
sl@0
|
70 |
EBrightness,
|
sl@0
|
71 |
EFlash,
|
sl@0
|
72 |
EExposure,
|
sl@0
|
73 |
EWhiteBalance,
|
sl@0
|
74 |
EJpegQuality
|
sl@0
|
75 |
};
|
sl@0
|
76 |
/*
|
sl@0
|
77 |
enum TCameraMode // Camera modes in which the parameter setting is valid
|
sl@0
|
78 |
{
|
sl@0
|
79 |
ECameraVF = 0x0001,
|
sl@0
|
80 |
ECameraIC = 0x0002,
|
sl@0
|
81 |
ECameraVC = 0x0004
|
sl@0
|
82 |
};
|
sl@0
|
83 |
|
sl@0
|
84 |
*/
|
sl@0
|
85 |
|
sl@0
|
86 |
enum TCameraAccessControl
|
sl@0
|
87 |
{
|
sl@0
|
88 |
ECameraRelease,
|
sl@0
|
89 |
ECameraReservedNotification,
|
sl@0
|
90 |
ECameraCancelReservedNotification,
|
sl@0
|
91 |
ECameraOverthrowNotification,
|
sl@0
|
92 |
ECameraCancelOverthrowNotification
|
sl@0
|
93 |
};
|
sl@0
|
94 |
|
sl@0
|
95 |
enum TCameraPower
|
sl@0
|
96 |
{
|
sl@0
|
97 |
ECameraPowerOnNotification,
|
sl@0
|
98 |
ECameraPowerOff,
|
sl@0
|
99 |
ECameraCancelPowerOnNotification
|
sl@0
|
100 |
};
|
sl@0
|
101 |
|
sl@0
|
102 |
enum TServerPanic
|
sl@0
|
103 |
{
|
sl@0
|
104 |
EPanicBadDescriptor,
|
sl@0
|
105 |
EPanicNotSupported
|
sl@0
|
106 |
};
|
sl@0
|
107 |
|
sl@0
|
108 |
typedef TPckg <TCameraInfo> TCameraInfoBuf;
|
sl@0
|
109 |
|
sl@0
|
110 |
struct TCamerasAvailable
|
sl@0
|
111 |
{
|
sl@0
|
112 |
TInt iCameraCount;
|
sl@0
|
113 |
};
|
sl@0
|
114 |
typedef TPckg <TCamerasAvailable> TCamerasAvailablePckg;
|
sl@0
|
115 |
|
sl@0
|
116 |
struct TOpenCamera // Used for passing the infos to the server side session while creating camera channel
|
sl@0
|
117 |
{
|
sl@0
|
118 |
TInt iCameraIndex; // between 0-2 assuming 3 cameras
|
sl@0
|
119 |
TInt iPriority; // If NewDuplicateL called, set KRefCamNoPriority
|
sl@0
|
120 |
TInt iHandle; // If NewL called, set -1
|
sl@0
|
121 |
TBool iMMCapability; // set ETrue
|
sl@0
|
122 |
TBool iCollaborativeClient; // If NewDuplicateL used
|
sl@0
|
123 |
};
|
sl@0
|
124 |
typedef TPckg <TOpenCamera> TOpenCameraPckg;
|
sl@0
|
125 |
|
sl@0
|
126 |
struct TCameraHandle
|
sl@0
|
127 |
{
|
sl@0
|
128 |
TInt iHandle;
|
sl@0
|
129 |
};
|
sl@0
|
130 |
typedef TPckg <TCameraHandle> TCameraHandlePckg;
|
sl@0
|
131 |
|
sl@0
|
132 |
struct TDirectViewFinderInfo
|
sl@0
|
133 |
{
|
sl@0
|
134 |
TInt iScreenNum;
|
sl@0
|
135 |
TRect iScreenRect;
|
sl@0
|
136 |
TRect iClipRect;
|
sl@0
|
137 |
TSurfaceId iSurfaceId;
|
sl@0
|
138 |
};
|
sl@0
|
139 |
typedef TPckg <TDirectViewFinderInfo> TDirectViewFinderInfoPckg;
|
sl@0
|
140 |
|
sl@0
|
141 |
struct TDirectViewFinderState
|
sl@0
|
142 |
{
|
sl@0
|
143 |
CCamera::CCameraV2DirectViewFinder::TViewFinderState iState;
|
sl@0
|
144 |
};
|
sl@0
|
145 |
typedef TPckg <TDirectViewFinderState> TDirectViewFinderStatePckg;
|
sl@0
|
146 |
|
sl@0
|
147 |
struct TCameraZoom
|
sl@0
|
148 |
{
|
sl@0
|
149 |
TInt iZoom;
|
sl@0
|
150 |
};
|
sl@0
|
151 |
typedef TPckg <TCameraZoom> TCameraZoomPckg;
|
sl@0
|
152 |
|
sl@0
|
153 |
struct TCameraDigitalZoom
|
sl@0
|
154 |
{
|
sl@0
|
155 |
TInt iDigitalZoom;
|
sl@0
|
156 |
};
|
sl@0
|
157 |
typedef TPckg <TCameraDigitalZoom> TCameraDigitalZoomPckg;
|
sl@0
|
158 |
|
sl@0
|
159 |
struct TCameraContrast
|
sl@0
|
160 |
{
|
sl@0
|
161 |
TInt iContrast;
|
sl@0
|
162 |
};
|
sl@0
|
163 |
typedef TPckg <TCameraContrast> TCameraContrastPckg;
|
sl@0
|
164 |
|
sl@0
|
165 |
struct TCameraBrightness
|
sl@0
|
166 |
{
|
sl@0
|
167 |
TInt iBrightness;
|
sl@0
|
168 |
};
|
sl@0
|
169 |
typedef TPckg <TCameraBrightness> TCameraBrightnessPckg;
|
sl@0
|
170 |
|
sl@0
|
171 |
struct TViewFinderMirror
|
sl@0
|
172 |
{
|
sl@0
|
173 |
TBool iMirror;
|
sl@0
|
174 |
};
|
sl@0
|
175 |
typedef TPckg <TViewFinderMirror> TViewFinderMirrorPckg;
|
sl@0
|
176 |
|
sl@0
|
177 |
struct TCameraFlash
|
sl@0
|
178 |
{
|
sl@0
|
179 |
CCamera::TFlash iFlash;
|
sl@0
|
180 |
};
|
sl@0
|
181 |
typedef TPckg <TCameraFlash> TCameraFlashPckg;
|
sl@0
|
182 |
|
sl@0
|
183 |
struct TCameraExposure
|
sl@0
|
184 |
{
|
sl@0
|
185 |
CCamera::TExposure iExposure;
|
sl@0
|
186 |
};
|
sl@0
|
187 |
typedef TPckg <TCameraExposure> TCameraExposurePckg;
|
sl@0
|
188 |
|
sl@0
|
189 |
struct TCameraWhiteBalance
|
sl@0
|
190 |
{
|
sl@0
|
191 |
CCamera::TWhiteBalance iWhiteBalance;
|
sl@0
|
192 |
};
|
sl@0
|
193 |
typedef TPckg <TCameraWhiteBalance> TCameraWhiteBalancePckg;
|
sl@0
|
194 |
|
sl@0
|
195 |
|
sl@0
|
196 |
/**
|
sl@0
|
197 |
* Interface class to allow communication between clients and server.
|
sl@0
|
198 |
*
|
sl@0
|
199 |
* Provides API's for both synchronous and asynchronous methods of communication.
|
sl@0
|
200 |
*/
|
sl@0
|
201 |
class RMMCameraSession : public RSessionBase
|
sl@0
|
202 |
{
|
sl@0
|
203 |
public:
|
sl@0
|
204 |
TInt Connect();
|
sl@0
|
205 |
|
sl@0
|
206 |
TInt SendMessage(TECamMsgId aMsgId, TCameraParameterId aParameterId, TDes8& aMessage);
|
sl@0
|
207 |
TInt SendMessage(TECamMsgId aMsgId, TCameraParameterId aParameterId, TInt aMessage);
|
sl@0
|
208 |
TInt SendMessage(TECamMsgId aMsgId, TDes8& aMessage);
|
sl@0
|
209 |
TInt SendMessage(TECamMsgId aMsgId, TInt aMessage);
|
sl@0
|
210 |
TInt SendMessage(TECamMsgId aMsgId);
|
sl@0
|
211 |
|
sl@0
|
212 |
TInt SendRxMessage(TECamMsgId aMsgId, TCameraParameterId aParameterId, TDes8& aMessage) const;
|
sl@0
|
213 |
TInt SendRxMessage(TECamMsgId aMsgId, TCameraParameterId aParameterId, TInt aMessage) const;
|
sl@0
|
214 |
TInt SendRxMessage(TECamMsgId aMsgId, TDes8& aMessage) const;
|
sl@0
|
215 |
|
sl@0
|
216 |
TInt ReceiveMessage(TECamMsgId aMsgId, TDes8& aMessage, TRequestStatus& aStatus);
|
sl@0
|
217 |
void ReceiveMessage(TECamMsgId aMsgId, TInt aMessage, TRequestStatus& aStatus);
|
sl@0
|
218 |
};
|
sl@0
|
219 |
|
sl@0
|
220 |
#endif // MMCAMERACLIENTINTERFACE_H
|