summaryrefslogtreecommitdiff
path: root/include/camera_internal.h
blob: ca47b9647f8660ae108f7e3d223527dd66155f4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
/*
* Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#ifndef __TIZEN_MULTIMEDIA_CAMERA_INTERNAL_H__
#define	__TIZEN_MULTIMEDIA_CAMERA_INTERNAL_H__
#include <camera.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
  * @file camera_internal.h
  * @brief This file contains the Camera Product-internal API for framework, related structures and enumerations.
  */

/**
 * @internal
 * @addtogroup CAPI_MEDIA_CAMERA_X11_DISPLAY_MODULE
 * @{
 */

/**
 * @ingroup CAPI_MEDIA_CAMERA_X11_DISPLAY_MODULE
 * @brief Called when the media camera needs updated xid.
 * @remarks If current display type is not #CAMERA_DISPLAY_TYPE_OVERLAY, no operation is performed.
 * @param[in] user_data The user data passed from the callback registration function
 * @return The updated xid
 * @pre It will be invoked when camera needs updated xid and if this callback is registered using camera_set_x11_display_pixmap().
 * @see	camera_set_x11_display_pixmap()
 */
typedef unsigned int (*camera_x11_pixmap_updated_cb)(void *user_data);

/**
 * @ingroup CAPI_MEDIA_CAMERA_X11_DISPLAY_MODULE
 * @brief Sets the display rotation.
 *
 * @since_tizen 2.3
 * @privlevel platform
 * @privilege %http://tizen.org/privilege/camera
 * @remarks This function should be called before previewing (see camera_start_preview())\n
 *          This function is valid only for #CAMERA_DISPLAY_TYPE_OVERLAY.
 * @param[in] camera The handle to the camera
 * @param[in] rotation The display rotation
 * @return @c 0 on success, otherwise a negative error value
 * @retval #CAMERA_ERROR_NONE Successful
 * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
 * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
 * @retval #CAMERA_ERROR_INVALID_OPERATION Display type is not X11
 * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
 * @see camera_start_preview()
 * @see	camera_get_x11_display_rotation()
 */
int camera_set_x11_display_rotation(camera_h camera, camera_rotation_e rotation);

/**
 * @ingroup CAPI_MEDIA_CAMERA_X11_DISPLAY_MODULE
 * @brief Gets the display rotation.
 *
 * @since_tizen 2.3
 * @privlevel platform
 * @privilege %http://tizen.org/privilege/camera
 * @remarks This function is valid only for #CAMERA_DISPLAY_TYPE_OVERLAY.
 * @param[in] camera The handle to the camera
 * @param[out] rotation The display rotation
 * @return @c 0 on success, otherwise a negative error value
 * @retval #CAMERA_ERROR_NONE Successful
 * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
 * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
 * @see camera_set_x11_display_rotation()
 */
int camera_get_x11_display_rotation(camera_h camera, camera_rotation_e *rotation);

/**
 * @ingroup CAPI_MEDIA_CAMERA_X11_DISPLAY_MODULE
 * @brief Sets the display flip.
 *
 * @since_tizen 2.3
 * @privlevel platform
 * @privilege %http://tizen.org/privilege/camera
 * @remarks This function is valid only for #CAMERA_DISPLAY_TYPE_OVERLAY.
 * @param[in] camera The handle to the camera
 * @param[in] flip The display flip
 * @return @c 0 on success, otherwise a negative error value
 * @retval #CAMERA_ERROR_NONE Successful
 * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
 * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
 * @retval #CAMERA_ERROR_INVALID_OPERATION Display type is not X11
 * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
 * @see	camera_get_x11_display_flip()
 */
int camera_set_x11_display_flip(camera_h camera, camera_flip_e flip);

/**
 * @ingroup CAPI_MEDIA_CAMERA_X11_DISPLAY_MODULE
 * @brief Gets the display flip.
 *
 * @since_tizen 2.3
 * @privlevel platform
 * @privilege %http://tizen.org/privilege/camera
 * @remarks This function is valid only for #CAMERA_DISPLAY_TYPE_OVERLAY.
 * @param[in] camera The handle to the camera
 * @param[out] flip The display flip
 * @return @c 0 on success, otherwise a negative error value
 * @retval #CAMERA_ERROR_NONE Successful
 * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
 * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
 * @see camera_set_x11_display_flip()
 */
int camera_get_x11_display_flip(camera_h camera, camera_flip_e *flip);

/**
 * @ingroup CAPI_MEDIA_CAMERA_X11_DISPLAY_MODULE
 * @brief Sets the visible property for X11 display.
 *
 * @since_tizen 2.3
 * @privlevel platform
 * @privilege %http://tizen.org/privilege/camera
 * @remarks This function is valid only for #CAMERA_DISPLAY_TYPE_OVERLAY.
 * @param[in] camera The handle to the camera
 * @param[in] visible The display visibility property
 *
 * @return @c 0 on success, otherwise a negative error value
 * @retval #CAMERA_ERROR_NONE Successful
 * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
 * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
 * @see camera_is_x11_display_visible()
 */
int camera_set_x11_display_visible(camera_h camera, bool visible);

/**
 * @ingroup CAPI_MEDIA_CAMERA_X11_DISPLAY_MODULE
 * @brief Gets the visible property of X11 display.
 *
 * @since_tizen 2.3
 * @privlevel platform
 * @privilege %http://tizen.org/privilege/camera
 * @remarks This function is valid only for #CAMERA_DISPLAY_TYPE_OVERLAY.
 * @param[in] camera The handle to the camera
 * @param[out] visible If @c true the camera display is visible, otherwise @c false
 *
 * @return @c 0 on success, otherwise a negative error value
 * @retval #CAMERA_ERROR_NONE Successful
 * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
 * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
 * @see camera_set_x11_display_visible()
 */
int camera_is_x11_display_visible(camera_h camera, bool *visible);

/**
 * @ingroup CAPI_MEDIA_CAMERA_X11_DISPLAY_MODULE
 * @brief Sets the X11 display mode.
 *
 * @since_tizen 2.3
 * @privlevel platform
 * @privilege %http://tizen.org/privilege/camera
 * @remarks This function is valid only for #CAMERA_DISPLAY_TYPE_OVERLAY.
 * @param[in] camera The handle to the camera
 * @param[in] mode The display mode
 *
 * @return @c 0 on success, otherwise a negative error value
 * @retval #CAMERA_ERROR_NONE Successful
 * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
 * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
 * @see camera_get_x11_display_mode()
 */
int camera_set_x11_display_mode(camera_h camera , camera_display_mode_e mode);

/**
 * @ingroup CAPI_MEDIA_CAMERA_X11_DISPLAY_MODULE
 * @brief Gets the X11 display mode.
 *
 * @since_tizen 2.3
 * @privlevel platform
 * @privilege %http://tizen.org/privilege/camera
 * @remarks This function is valid only for #CAMERA_DISPLAY_TYPE_OVERLAY.
 * @param[in] camera The handle to the camera
 * @param[out] mode The display mode
 *
 * @return @c 0 on success, otherwise a negative error value
 * @retval #CAMERA_ERROR_NONE Successful
 * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
 * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
 * @see camera_set_x11_display_mode()
 */
int camera_get_x11_display_mode(camera_h camera, camera_display_mode_e *mode);

/**
 * @brief Registers a callback function to be invoked when camera needs updated xid.
 * @ingroup CAPI_MEDIA_CAMERA_X11_DISPLAY_MODULE
 * @remarks This function is valid only for #CAMERA_DISPLAY_TYPE_OVERLAY.
 * @param[in] camera The handle to the camera
 * @param[in] callback The callback function to register
 * @param[in] user_data	The user data to be passed to the callback function
 *
 * @return @c 0 on success, otherwise a negative error value
 * @retval #CAMERA_ERROR_NONE Successful
 * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
 * @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation
 * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
 * @pre	The camera state must be #CAMERA_STATE_CREATED by camera_create().
 * @post camera_set_x11_display_pixmap() will be invoked.
 *
 * @see camera_set_x11_display_pixmap()
 */
int camera_set_x11_display_pixmap(camera_h camera, camera_x11_pixmap_updated_cb callback, void *user_data);

/**
 * @brief Registers a callback function to be invoked when camera needs updated xid.
 * @ingroup CAPI_MEDIA_CAMERA_MUSED_MODULE
 * @remarks This function is valid only for #CAMERA_DISPLAY_TYPE_OVERLAY.
 * @param[in] camera The handle to the camera
 * @param[in] type The type of the display
 * @param[in] display_handle The handle of the created display
 *
 * @return @c 0 on success, otherwise a negative error value
 * @retval #CAMERA_ERROR_NONE Successful
 * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
 * @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation
 * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
 * @pre	The camera state must be #CAMERA_STATE_CREATED by camera_create().
 * @post camera_set_mused_display() will be invoked.
 *
 * @see camera_set_mused_display()
 */
int camera_set_mused_display(camera_h camera, camera_display_type_e type, void *display_handle);

/**
 * @brief Registers a callback function to be invoked when camera needs updated xid.
 * @ingroup CAPI_MEDIA_CAMERA_MUSED_MODULE
 * @remarks This function is valid only for #CAMERA_DISPLAY_TYPE_OVERLAY.
 * @param[in] camera The handle to the camera
 * @param[in] caps The caps information of the server's video element
 *
 * @return @c 0 on success, otherwise a negative error value
 * @retval #CAMERA_ERROR_NONE Successful
 * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
 * @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation
 * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
 * @pre	The camera state must be #CAMERA_STATE_CREATED by camera_create().
 * @post camera_get_video_caps() will be invoked.
 *
 * @see camera_get_video_caps()
 */
int camera_get_video_caps(camera_h camera, char **caps);

/**
 * @brief Registers a callback function to be invoked when camera needs updated xid.
 * @ingroup CAPI_MEDIA_CAMERA_MUSED_MODULE
 * @remarks This function is valid only for #CAMERA_DISPLAY_TYPE_OVERLAY.
 * @param[in] camera The handle to the camera
 * @param[in] socket_path The socket file path for the display data ipc
 *
 * @return @c 0 on success, otherwise a negative error value
 * @retval #CAMERA_ERROR_NONE Successful
 * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
 * @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation
 * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
 * @pre	The camera state must be #CAMERA_STATE_CREATED by camera_create().
 * @post camera_set_shm_socket_path_for_mused() will be invoked.
 *
 * @see camera_set_shm_socket_path_for_mused()
 */
int camera_set_shm_socket_path_for_mused(camera_h camera, char *socket_path);

/**
 * @}
 */

#ifdef __cplusplus
}
#endif

#endif //__TIZEN_MULTIMEDIA_CAMERA_INTERNAL_H__