Flora license update
[apps/core/preloaded/ug-camera-efl.git] / include / cam_mm.h
1 /*
2  * Copyright 2012  Samsung Electronics Co., Ltd
3  *
4  * Licensed under the Flora License, Version 1.1 (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://floralicense.org/license/
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
18 #ifndef CAM_MM_H_
19 #define CAM_MM_H_
20
21 #include <glib.h>
22 #include <sound_manager.h>
23 #include <devman_managed.h>
24 #include "cam.h"
25 #include "cam_capacity_type.h"
26
27
28 /*
29 #include "cam_property.h"
30 */
31
32 #define CAMERA_ERROR_MM_QUARK   g_quark_from_static_string("camera-error-mm")
33 #define cam_set_mm_error(error, code, fmt, arg...) \
34         g_set_error(error, CAMERA_ERROR_MM_QUARK, code, fmt, ##arg)
35
36 #define ERROR_CHECK
37
38 #ifdef ERROR_CHECK
39 #define CHECK_MM_ERROR(expr) \
40 {\
41         int ret = 0; \
42         ret = expr; \
43         if (ret != CAMERA_ERROR_NONE) {\
44                 cam_debug(LOG_MM,"[%s:%d] error code : %x \n", __func__, __LINE__, ret); \
45                 return FALSE; \
46         } \
47 }
48 #else
49 #define CHECK_MM_ERROR(expr) (expr)
50 #endif
51
52 gboolean cam_mm_set_camera_interrupted_cb(camera_interrupted_cb callback, void *data);
53 gboolean cam_mm_set_recorder_interrupted_cb(recorder_interrupted_cb callback, void *data);
54 gboolean cam_mm_get_brightless_valid_intrange(int *min, int *max);
55 gboolean cam_mm_get_exposure_valid_intrange(int *min, int *max);
56 gboolean cam_mm_recorder_set_state_changed_cb(recorder_state_changed_cb callback, void* user_data);
57 gboolean cam_mm_recorder_unset_state_changed_cb(void);
58
59 gboolean cam_mm_recorder_set_recording_status_cb(recorder_recording_status_cb callback, void* user_data);
60
61 gboolean cam_mm_recorder_unset_recording_status_cb(void);
62
63 gboolean cam_mm_recorder_set_recording_limit_reached_cb(recorder_recording_limit_reached_cb callback, void* user_data);
64
65 gboolean cam_mm_recorder_unset_recording_limit_reached_cb(void);
66
67 gboolean cam_mm_set_error_cb(camera_error_cb error_cb, void *data);
68 gboolean cam_mm_unset_error_cb(void);
69 gboolean cam_mm_set_state_changed_cb(camera_state_changed_cb state_cb, void *data);
70 gboolean cam_mm_unset_state_changed_cb(void);
71 gboolean cam_mm_set_focus_changed_cb(camera_focus_changed_cb focus_cb, void *data);
72 gboolean cam_mm_unset_focus_changed_cb(void);
73 gboolean cam_mm_set_preview_cb(camera_preview_cb preview_cb, void *data);
74 gboolean cam_mm_unset_preview_cb(void);
75
76 int cam_mm_get_state(void);
77 int cam_mm_get_cam_state(void);
78 int cam_mm_get_rec_state(void);
79
80
81 gboolean cam_mm_set_delay_setting(gboolean value);
82 gboolean cam_mm_get_video_device(int *device);
83 gboolean cam_mm_get_video_size(int *width, int *height);
84 gboolean cam_mm_set_video_size(int width, int height);
85 gboolean cam_mm_get_zoom(int *value);
86 gboolean cam_mm_set_zoom(int value);
87 gboolean cam_mm_get_wdr(int *value);
88 gboolean cam_mm_set_wdr(int value);
89 gboolean cam_mm_get_auto_exposure(int *value);
90 gboolean cam_mm_is_support_anti_hand_shake();
91 gboolean cam_mm_get_anti_hand_shake(gboolean *value);
92 gboolean cam_mm_set_anti_hand_shake(gboolean value);
93
94 gboolean cam_mm_set_auto_exposure(int value);
95 gboolean cam_mm_set_fps(camera_attr_fps_e value);
96 gboolean cam_mm_get_iso(int *value);
97 gboolean cam_mm_set_iso(int value);
98 gboolean cam_mm_get_focus_mode(int *value);
99 gboolean cam_mm_set_focus_mode(int value);
100 gboolean cam_mm_get_zoom_valid_intrange(int *min, int *max);
101
102 gboolean cam_mm_set_af_area(int x, int y, int w, int h);
103 gboolean cam_mm_get_detect_mode(int *value);
104 gboolean cam_mm_set_detect_mode(int value);
105 gboolean cam_mm_get_image_enc_quality(int *value);
106 gboolean cam_mm_set_image_enc_quality(int value);
107 gboolean cam_mm_get_flash(int *value);
108 gboolean cam_mm_set_flash(int value);
109 gboolean cam_mm_get_brightness(int *value);
110 gboolean cam_mm_set_brightness(int value);
111 gboolean cam_mm_get_white_balance(int *value);
112 gboolean cam_mm_set_white_balance(int value);
113 gboolean cam_mm_get_effect(int *value);
114 gboolean cam_mm_set_effect(int value);
115 gboolean cam_mm_get_program_mode(int *value);
116 gboolean cam_mm_set_program_mode(int value);
117 gboolean cam_mm_set_audio_recording(gboolean b_on);
118 gboolean cam_mm_set_outdoor_visibility(gboolean on);
119 gboolean cam_mm_get_outdoor_visibility(gboolean *on);
120 gboolean cam_mm_is_supported_outdoor_visibility(void);
121 gboolean cam_mm_set_mdnie_mode(gboolean on);
122 gboolean cam_mm_get_mdnie_mode(int *val);
123 gboolean cam_mm_get_image_count(int *value);
124 gboolean cam_mm_set_image_count(int value);
125 gboolean cam_mm_get_recommanded_preview_size(int *width, int *height);
126 gboolean cam_mm_get_image_size(int *width, int *height);
127 gboolean cam_mm_set_image_size(int width, int height);
128 gboolean cam_mm_set_video_encoder_bitrate(int bitrate);
129 gboolean cam_mm_set_audio_encoder_bitrate(int bitrate);
130 gboolean cam_mm_set_display_device(int display_device, void *xid);
131 gboolean cam_mm_set_display_id(void *xid, int size);
132 gboolean cam_mm_set_display_rotate(int rotate);
133 gboolean cam_mm_set_camera_rotate(int camera_rotate);
134 gboolean cam_mm_set_display_scale(int scale);
135 gboolean cam_mm_get_front_cam_display_rotate_value(int *display_rotation, int *rotate);
136 gboolean cam_mm_get_display_geometry_method(int *value);
137 gboolean cam_mm_set_display_geometry_method(int value);
138 gboolean cam_mm_set_display_visible(gboolean visible);
139 gboolean cam_mm_set_filename(const gchar *filename);
140 gboolean cam_mm_get_filename(char **filename, gint *size);
141 gboolean cam_mm_get_max_time(int *value);
142 gboolean cam_mm_set_max_time(int max_val);
143 gboolean cam_mm_get_tag_enable(int *value);
144 gboolean cam_mm_set_tag_enable(gboolean bvalue);
145 gboolean cam_mm_set_tag_img_orient(int orient);
146 gboolean cam_mm_set_file_format(int format);
147 gboolean cam_mm_set_video_profile(void);
148 gboolean cam_mm_set_codec(int audio_codec, int video_codec);
149 gboolean cam_mm_set_audio_source(int sample_rate, int channel);
150 gboolean cam_mm_set_video_source_format(int format);
151 gboolean cam_mm_set_shutter_sound(int value);
152 gboolean cam_mm_get_shutter_sound(int *value);
153 gboolean cam_mm_enable_geo_tag(gboolean value);
154 gboolean cam_mm_remove_geo_tag(void);
155
156 gboolean cam_mm_get_video_source_format(const char *attribute_name,
157                                         int *format);
158 gboolean cam_mm_set_conti_shot_break(gboolean bvalue);
159 gboolean cam_mm_get_scene_mode(camera_attr_scene_mode_e *mode);
160 gboolean cam_mm_set_scene_mode(camera_attr_scene_mode_e mode);
161
162 gboolean cam_mm_set_capture_format(int value);
163 gboolean cam_mm_set_capture_interval(int value);
164 gboolean cam_mm_reset_recording_motion_fps(void);
165 gboolean cam_mm_get_recording_motion_fps(int *value);
166 gboolean cam_mm_set_gps_data(double lat, double lon, double alt);
167
168 gint cam_mm_realize(void);
169 gboolean cam_mm_is_preview_started(int mode);
170 gboolean cam_mm_preview_start(int mode);
171 gboolean cam_mm_unrealize(void);
172 gboolean cam_mm_preview_stop(int mode);
173 gboolean cam_mm_is_created(void);
174 gboolean cam_mm_create(int camera_type, int mode);
175 gboolean cam_mm_destory(void);
176 gboolean cam_mm_continuous_capture_start(int count, int interval, camera_capturing_cb capturing_cb, camera_capture_completed_cb completed_cb , void *user_data);
177 gboolean cam_mm_capture_start(camera_capturing_cb capturing_cb , camera_capture_completed_cb completed_cb , void *user_data);
178 gboolean cam_mm_capture_stop(gboolean skip_preview, CamMode mode);
179 gboolean cam_mm_rec_start();
180 gboolean cam_mm_rec_stop(gboolean to_stop);
181 gboolean cam_mm_rec_pause();
182 gboolean cam_mm_rec_cancel();
183 gboolean cam_mm_start_focusing(gint af_mode);
184 gboolean cam_mm_stop_focusing();
185 gboolean cam_mm_set_recording_motion(double rate);
186 gboolean cam_mm_session_init(sound_session_type_e session_type);
187
188 /**
189  * @brief               set auto contrast on/off
190  * @param[in]   enable  true: turn on auto contrast;false: turn off auto contrast
191  * @return                      Operation result
192  * @retval              true            Success
193  * @retval         false        Error
194  */
195 gboolean cam_mm_enable_auto_contrast(gboolean enable);
196 /**
197  * @brief               get auto contrast on/off
198  * @param[out]  enable  true: auto contrast is on;false: auto contrast is off
199  * @return                      Operation result
200  * @retval              true            Success
201  * @retval         false        Error
202  */
203 gboolean cam_mm_is_enabled_auto_contrast(gboolean *enable);
204
205 /**
206  * @brief               start camera focus mode: face detection mode
207  * @param[in]   callback        called while face detected
208  * @param[in]   data    user data for callback
209  * @return                      Operation result
210  * @retval              true            Success
211  * @retval         false        Error
212  */
213 gboolean cam_mm_start_camera_face_detection(camera_face_detected_cb callback, void *data);
214 /**
215  * @brief               stop camera focus mode: face detection mode
216  * @return                      Operation result
217  * @retval              true            Success
218  * @retval         false        Error
219  */
220 gboolean cam_mm_stop_camera_face_detection(void);
221 /**
222  * @brief               get camera H/W whether suppor face detection auto focus
223  * @return                      Operation result
224  * @retval              true            Success
225  * @retval         false        Error
226  */
227 gboolean cam_mm_is_supported_face_detection(void);
228 /**
229  * @brief               in face detection focus mode, set @face_id face zoom
230  * @param[in]   face_id face id
231  * @return                      Operation result
232  * @retval              true            Success
233  * @retval         false        Error
234  */
235 gboolean cam_mm_set_camera_face_zoom(int face_id);
236 /**
237  * @brief               in face detection focus mode, cancel face zoom
238  * @return                      Operation result
239  * @retval              true            Success
240  * @retval         false        Error
241  */
242 gboolean cam_mm_camera_cancel_face_zoom(void);
243
244 gboolean cam_mm_get_caps_range(unsigned int type, unsigned int *caps, void *user_data);
245 gboolean cam_mm_get_caps_minmax(unsigned int type, int *min, int *max);
246 const int cam_mm_get_caps_cb_cnt();
247
248 gboolean cam_mm_set_image_flip(gboolean value);
249
250 gboolean cam_mm_is_support_front_camera(void);
251
252 #endif                          /*  CAM_MM_H_ */