2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef __TIZEN_MULTIMEDIA_CAMERA_INTERNAL_H__
18 #define __TIZEN_MULTIMEDIA_CAMERA_INTERNAL_H__
22 #include <mm_camcorder.h>
23 #include <tbm_surface_internal.h>
30 * @file camera_internal.h
31 * @brief This file contains the internal Camera API, related structures and enumerations.
36 * @addtogroup CAPI_MEDIA_CAMERA_INTERNAL_MODULE
40 #define CAMERA_DEVICE_MAX ((CAMERA_DEVICE_CAMERA9 + 1) * 2)
42 typedef struct _camera_device_list_s {
44 camera_device_s device[CAMERA_DEVICE_MAX];
45 } camera_device_list_s;
50 * @brief Start the evas rendering.
52 * @param[in] camera The handle to the camera
53 * @return @c 0 on success, otherwise a negative error value
54 * @retval #CAMERA_ERROR_NONE Successful
55 * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
56 * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
57 * @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation
58 * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
60 int camera_start_evas_rendering(camera_h camera);
64 * @brief Stop the evas rendering.
66 * @param[in] camera The handle to the camera
67 * @param[in] keep_screen If @c true keep last frame on display, otherwise @c false
68 * @return @c 0 on success, otherwise a negative error value
69 * @retval #CAMERA_ERROR_NONE Successful
70 * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
71 * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
72 * @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation
73 * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
75 int camera_stop_evas_rendering(camera_h camera, bool keep_screen);
79 * @brief Sets the ecore wayland video display.
81 * @remarks This function must be called in main thread of the application.
82 * Otherwise, it will return #CAMERA_ERROR_INVALID_OPERATION by internal restriction.
83 * To avoid #CAMERA_ERROR_INVALID_OPERATION in sub thread, ecore_thread_main_loop_begin() and
84 * ecore_thread_main_loop_end() can be used, but deadlock can occur if the main thread is busy.
85 * So, it's not recommended to use them.
86 * @param[in] camera The handle to the camera
87 * @param[in] ecore_wl_window The ecore wayland window handle
88 * @return @c 0 on success,
89 * otherwise a negative error value
90 * @retval #CAMERA_ERROR_NONE Successful
91 * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
92 * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
93 * @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation
94 * @retval #CAMERA_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
95 * @pre The camera state must be set to #CAMERA_STATE_CREATED.
96 * @see camera_start_preview()
97 * @see ecore_thread_main_loop_begin()
98 * @see ecore_thread_main_loop_end()
100 int camera_set_ecore_wl_display(camera_h camera, void *ecore_wl_window);
104 * @brief Creates preview frame from stream data.
106 * @param[in] stream The stream from internal pipeline
107 * @param[in] num_buffer_fd The number of buffer fd
108 * @param[in] buffer_bo_handle The bo handle of buffer
109 * @param[in] data_bo_handle The bo handle of data
110 * @param[out] frame The frame which will be filled
112 void camera_create_preview_frame(MMCamcorderVideoStreamDataType *stream, int num_buffer_fd,
113 tbm_bo_handle *buffer_bo_handle, tbm_bo_handle *data_bo_handle, camera_preview_data_s *frame);
117 * @brief Sets the brightness level of flash.
119 * @remarks If the min value is greater than the max value from camera_attr_get_flash_brightness_range(), \n
120 * it means that this feature is not supported.
121 * @param[in] camera The handle to the camera
122 * @param[in] level The brightness level of flash
123 * @return @c 0 on success, otherwise a negative error value
124 * @retval #CAMERA_ERROR_NONE Successful
125 * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
126 * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
127 * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
128 * @retval #CAMERA_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
129 * @pre The camera state must be set to #CAMERA_STATE_CREATED or #CAMERA_STATE_PREVIEW.
130 * @see camera_attr_get_flash_brightness()
131 * @see camera_attr_get_flash_brightness_range()
133 int camera_attr_set_flash_brightness(camera_h camera, int level);
137 * @brief Gets the brightness level of flash.
139 * @param[in] camera The handle to the camera
140 * @param[out] level The brightness level of flash
141 * @return @c 0 on success, otherwise a negative error value
142 * @retval #CAMERA_ERROR_NONE Successful
143 * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
144 * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
145 * @retval #CAMERA_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
146 * @see camera_attr_set_flash_brightness()
147 * @see camera_attr_get_flash_brightness_range()
149 int camera_attr_get_flash_brightness(camera_h camera, int *level);
153 * @brief Gets the available brightness level of flash.
155 * @remarks If the min value is greater than the max value, it means that this feature is not supported.
156 * @param[in] camera The handle to the camera
157 * @param[out] min The minimum brightness level of flash
158 * @param[out] max The maximum brightness level of flash
159 * @return @c 0 on success, otherwise a negative error value
160 * @retval #CAMERA_ERROR_NONE Successful
161 * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
162 * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
163 * @retval #CAMERA_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
164 * @see camera_attr_set_flash_brightness()
165 * @see camera_attr_get_flash_brightness()
167 int camera_attr_get_flash_brightness_range(camera_h camera, int *min, int *max);
171 * @brief Sets the manual focus level.
173 * @remarks The auto focusing will be stopped when camera_attr_set_focus_level() is called.
174 * @param[in] camera The handle to the camera
175 * @param[in] level The manual focus level
176 * @return @c 0 on success, otherwise a negative error value
177 * @retval #CAMERA_ERROR_NONE Successful
178 * @retval #CAMERA_ERROR_INVALID_OPERATION Internal error
179 * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
180 * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
181 * @see camera_attr_get_focus_level()
182 * @see camera_attr_get_focus_level_range()
184 int camera_attr_set_focus_level(camera_h camera, int level);
188 * @brief Gets the manual focus level.
190 * @param[in] camera The handle to the camera
191 * @param[out] level The manual focus level
192 * @return @c 0 on success, otherwise a negative error value
193 * @retval #CAMERA_ERROR_NONE Successful
194 * @retval #CAMERA_ERROR_INVALID_OPERATION Internal error
195 * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
196 * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
197 * @see camera_attr_set_focus_level()
198 * @see camera_attr_get_focus_level_range()
200 int camera_attr_get_focus_level(camera_h camera, int *level);
204 * @brief Gets lower limit and upper limit for manual focus level.
206 * @remarks If the min value is greater than the max value, it means that this feature is not supported.
207 * @param[in] camera The handle to the camera
208 * @param[out] min The lower limit for manual focus level
209 * @param[out] max The upper limit for manual focus level
210 * @return @c 0 on success, otherwise a negative error value
211 * @retval #CAMERA_ERROR_NONE Successful
212 * @retval #CAMERA_ERROR_INVALID_OPERATION Internal error
213 * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
214 * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
215 * @see camera_attr_set_focus_level()
216 * @see camera_attr_get_focus_level()
218 int camera_attr_get_focus_level_range(camera_h camera, int *min, int *max);
222 * @brief Sets device for the extra preview stream.
224 * @param[in] camera The handle to the camera
225 * @param[in] stream_id The id of extra preview stream
226 * @param[in] device The camera type
227 * @return @c 0 on success, otherwise a negative error value
228 * @retval #CAMERA_ERROR_NONE Successful
229 * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
230 * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
231 * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
232 * @retval #CAMERA_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
233 * @pre The camera state must be set to #CAMERA_STATE_CREATED.
234 * @see camera_set_extra_preview_cb()
235 * @see camera_unset_extra_preview_cb()
237 int camera_set_extra_preview_device(camera_h camera, int stream_id, camera_device_e device);
246 #endif /* __TIZEN_MULTIMEDIA_CAMERA_INTERNAL_H__ */