ca47b9647f8660ae108f7e3d223527dd66155f4e
[platform/core/api/camera.git] / include / camera_internal.h
1 /*
2 * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 #ifndef __TIZEN_MULTIMEDIA_CAMERA_INTERNAL_H__
18 #define __TIZEN_MULTIMEDIA_CAMERA_INTERNAL_H__
19 #include <camera.h>
20
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24
25 /**
26   * @file camera_internal.h
27   * @brief This file contains the Camera Product-internal API for framework, related structures and enumerations.
28   */
29
30 /**
31  * @internal
32  * @addtogroup CAPI_MEDIA_CAMERA_X11_DISPLAY_MODULE
33  * @{
34  */
35
36 /**
37  * @ingroup CAPI_MEDIA_CAMERA_X11_DISPLAY_MODULE
38  * @brief Called when the media camera needs updated xid.
39  * @remarks If current display type is not #CAMERA_DISPLAY_TYPE_OVERLAY, no operation is performed.
40  * @param[in] user_data The user data passed from the callback registration function
41  * @return The updated xid
42  * @pre It will be invoked when camera needs updated xid and if this callback is registered using camera_set_x11_display_pixmap().
43  * @see camera_set_x11_display_pixmap()
44  */
45 typedef unsigned int (*camera_x11_pixmap_updated_cb)(void *user_data);
46
47 /**
48  * @ingroup CAPI_MEDIA_CAMERA_X11_DISPLAY_MODULE
49  * @brief Sets the display rotation.
50  *
51  * @since_tizen 2.3
52  * @privlevel platform
53  * @privilege %http://tizen.org/privilege/camera
54  * @remarks This function should be called before previewing (see camera_start_preview())\n
55  *          This function is valid only for #CAMERA_DISPLAY_TYPE_OVERLAY.
56  * @param[in] camera The handle to the camera
57  * @param[in] rotation The display rotation
58  * @return @c 0 on success, otherwise a negative error value
59  * @retval #CAMERA_ERROR_NONE Successful
60  * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
61  * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
62  * @retval #CAMERA_ERROR_INVALID_OPERATION Display type is not X11
63  * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
64  * @see camera_start_preview()
65  * @see camera_get_x11_display_rotation()
66  */
67 int camera_set_x11_display_rotation(camera_h camera, camera_rotation_e rotation);
68
69 /**
70  * @ingroup CAPI_MEDIA_CAMERA_X11_DISPLAY_MODULE
71  * @brief Gets the display rotation.
72  *
73  * @since_tizen 2.3
74  * @privlevel platform
75  * @privilege %http://tizen.org/privilege/camera
76  * @remarks This function is valid only for #CAMERA_DISPLAY_TYPE_OVERLAY.
77  * @param[in] camera The handle to the camera
78  * @param[out] rotation The display rotation
79  * @return @c 0 on success, otherwise a negative error value
80  * @retval #CAMERA_ERROR_NONE Successful
81  * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
82  * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
83  * @see camera_set_x11_display_rotation()
84  */
85 int camera_get_x11_display_rotation(camera_h camera, camera_rotation_e *rotation);
86
87 /**
88  * @ingroup CAPI_MEDIA_CAMERA_X11_DISPLAY_MODULE
89  * @brief Sets the display flip.
90  *
91  * @since_tizen 2.3
92  * @privlevel platform
93  * @privilege %http://tizen.org/privilege/camera
94  * @remarks This function is valid only for #CAMERA_DISPLAY_TYPE_OVERLAY.
95  * @param[in] camera The handle to the camera
96  * @param[in] flip The display flip
97  * @return @c 0 on success, otherwise a negative error value
98  * @retval #CAMERA_ERROR_NONE Successful
99  * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
100  * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
101  * @retval #CAMERA_ERROR_INVALID_OPERATION Display type is not X11
102  * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
103  * @see camera_get_x11_display_flip()
104  */
105 int camera_set_x11_display_flip(camera_h camera, camera_flip_e flip);
106
107 /**
108  * @ingroup CAPI_MEDIA_CAMERA_X11_DISPLAY_MODULE
109  * @brief Gets the display flip.
110  *
111  * @since_tizen 2.3
112  * @privlevel platform
113  * @privilege %http://tizen.org/privilege/camera
114  * @remarks This function is valid only for #CAMERA_DISPLAY_TYPE_OVERLAY.
115  * @param[in] camera The handle to the camera
116  * @param[out] flip The display flip
117  * @return @c 0 on success, otherwise a negative error value
118  * @retval #CAMERA_ERROR_NONE Successful
119  * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
120  * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
121  * @see camera_set_x11_display_flip()
122  */
123 int camera_get_x11_display_flip(camera_h camera, camera_flip_e *flip);
124
125 /**
126  * @ingroup CAPI_MEDIA_CAMERA_X11_DISPLAY_MODULE
127  * @brief Sets the visible property for X11 display.
128  *
129  * @since_tizen 2.3
130  * @privlevel platform
131  * @privilege %http://tizen.org/privilege/camera
132  * @remarks This function is valid only for #CAMERA_DISPLAY_TYPE_OVERLAY.
133  * @param[in] camera The handle to the camera
134  * @param[in] visible The display visibility property
135  *
136  * @return @c 0 on success, otherwise a negative error value
137  * @retval #CAMERA_ERROR_NONE Successful
138  * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
139  * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
140  * @see camera_is_x11_display_visible()
141  */
142 int camera_set_x11_display_visible(camera_h camera, bool visible);
143
144 /**
145  * @ingroup CAPI_MEDIA_CAMERA_X11_DISPLAY_MODULE
146  * @brief Gets the visible property of X11 display.
147  *
148  * @since_tizen 2.3
149  * @privlevel platform
150  * @privilege %http://tizen.org/privilege/camera
151  * @remarks This function is valid only for #CAMERA_DISPLAY_TYPE_OVERLAY.
152  * @param[in] camera The handle to the camera
153  * @param[out] visible If @c true the camera display is visible, otherwise @c false
154  *
155  * @return @c 0 on success, otherwise a negative error value
156  * @retval #CAMERA_ERROR_NONE Successful
157  * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
158  * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
159  * @see camera_set_x11_display_visible()
160  */
161 int camera_is_x11_display_visible(camera_h camera, bool *visible);
162
163 /**
164  * @ingroup CAPI_MEDIA_CAMERA_X11_DISPLAY_MODULE
165  * @brief Sets the X11 display mode.
166  *
167  * @since_tizen 2.3
168  * @privlevel platform
169  * @privilege %http://tizen.org/privilege/camera
170  * @remarks This function is valid only for #CAMERA_DISPLAY_TYPE_OVERLAY.
171  * @param[in] camera The handle to the camera
172  * @param[in] mode The display mode
173  *
174  * @return @c 0 on success, otherwise a negative error value
175  * @retval #CAMERA_ERROR_NONE Successful
176  * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
177  * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
178  * @see camera_get_x11_display_mode()
179  */
180 int camera_set_x11_display_mode(camera_h camera , camera_display_mode_e mode);
181
182 /**
183  * @ingroup CAPI_MEDIA_CAMERA_X11_DISPLAY_MODULE
184  * @brief Gets the X11 display mode.
185  *
186  * @since_tizen 2.3
187  * @privlevel platform
188  * @privilege %http://tizen.org/privilege/camera
189  * @remarks This function is valid only for #CAMERA_DISPLAY_TYPE_OVERLAY.
190  * @param[in] camera The handle to the camera
191  * @param[out] mode The display mode
192  *
193  * @return @c 0 on success, otherwise a negative error value
194  * @retval #CAMERA_ERROR_NONE Successful
195  * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
196  * @retval #CAMERA_ERROR_PERMISSION_DENIED The access to the resources can not be granted
197  * @see camera_set_x11_display_mode()
198  */
199 int camera_get_x11_display_mode(camera_h camera, camera_display_mode_e *mode);
200
201 /**
202  * @brief Registers a callback function to be invoked when camera needs updated xid.
203  * @ingroup CAPI_MEDIA_CAMERA_X11_DISPLAY_MODULE
204  * @remarks This function is valid only for #CAMERA_DISPLAY_TYPE_OVERLAY.
205  * @param[in] camera The handle to the camera
206  * @param[in] callback The callback function to register
207  * @param[in] user_data The user data to be passed to the callback function
208  *
209  * @return @c 0 on success, otherwise a negative error value
210  * @retval #CAMERA_ERROR_NONE Successful
211  * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
212  * @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation
213  * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
214  * @pre The camera state must be #CAMERA_STATE_CREATED by camera_create().
215  * @post camera_set_x11_display_pixmap() will be invoked.
216  *
217  * @see camera_set_x11_display_pixmap()
218  */
219 int camera_set_x11_display_pixmap(camera_h camera, camera_x11_pixmap_updated_cb callback, void *user_data);
220
221 /**
222  * @brief Registers a callback function to be invoked when camera needs updated xid.
223  * @ingroup CAPI_MEDIA_CAMERA_MUSED_MODULE
224  * @remarks This function is valid only for #CAMERA_DISPLAY_TYPE_OVERLAY.
225  * @param[in] camera The handle to the camera
226  * @param[in] type The type of the display
227  * @param[in] display_handle The handle of the created display
228  *
229  * @return @c 0 on success, otherwise a negative error value
230  * @retval #CAMERA_ERROR_NONE Successful
231  * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
232  * @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation
233  * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
234  * @pre The camera state must be #CAMERA_STATE_CREATED by camera_create().
235  * @post camera_set_mused_display() will be invoked.
236  *
237  * @see camera_set_mused_display()
238  */
239 int camera_set_mused_display(camera_h camera, camera_display_type_e type, void *display_handle);
240
241 /**
242  * @brief Registers a callback function to be invoked when camera needs updated xid.
243  * @ingroup CAPI_MEDIA_CAMERA_MUSED_MODULE
244  * @remarks This function is valid only for #CAMERA_DISPLAY_TYPE_OVERLAY.
245  * @param[in] camera The handle to the camera
246  * @param[in] caps The caps information of the server's video element
247  *
248  * @return @c 0 on success, otherwise a negative error value
249  * @retval #CAMERA_ERROR_NONE Successful
250  * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
251  * @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation
252  * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
253  * @pre The camera state must be #CAMERA_STATE_CREATED by camera_create().
254  * @post camera_get_video_caps() will be invoked.
255  *
256  * @see camera_get_video_caps()
257  */
258 int camera_get_video_caps(camera_h camera, char **caps);
259
260 /**
261  * @brief Registers a callback function to be invoked when camera needs updated xid.
262  * @ingroup CAPI_MEDIA_CAMERA_MUSED_MODULE
263  * @remarks This function is valid only for #CAMERA_DISPLAY_TYPE_OVERLAY.
264  * @param[in] camera The handle to the camera
265  * @param[in] socket_path The socket file path for the display data ipc
266  *
267  * @return @c 0 on success, otherwise a negative error value
268  * @retval #CAMERA_ERROR_NONE Successful
269  * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
270  * @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation
271  * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
272  * @pre The camera state must be #CAMERA_STATE_CREATED by camera_create().
273  * @post camera_set_shm_socket_path_for_mused() will be invoked.
274  *
275  * @see camera_set_shm_socket_path_for_mused()
276  */
277 int camera_set_shm_socket_path_for_mused(camera_h camera, char *socket_path);
278
279 /**
280  * @}
281  */
282
283 #ifdef __cplusplus
284 }
285 #endif
286
287 #endif //__TIZEN_MULTIMEDIA_CAMERA_INTERNAL_H__