Updating INI configuration file to work with most cameras.
[profile/ivi/camera.git] / include / cam_mm.h
1 /*
2  * Copyright 2012  Samsung Electronics Co., Ltd
3  *
4  * Licensed under the Flora License, Version 1.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.tizenopensource.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                 printf("[%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_recorder_set_state_changed_cb(recorder_state_changed_cb callback, void* user_data);
55 gboolean cam_mm_recorder_unset_state_changed_cb(void);
56
57 gboolean cam_mm_recorder_set_recording_status_cb(recorder_recording_status_cb callback, void* user_data);
58
59 gboolean cam_mm_recorder_unset_recording_status_cb(void);
60
61 gboolean cam_mm_recorder_set_recording_limit_reached_cb(recorder_recording_limit_reached_cb callback, void* user_data);
62
63 gboolean cam_mm_recorder_unset_recording_limit_reached_cb(void);
64
65 gboolean cam_mm_set_error_cb(camera_error_cb error_cb, void *data);
66 gboolean cam_mm_unset_error_cb(void);
67 gboolean cam_mm_set_state_changed_cb(camera_state_changed_cb state_cb, void *data);
68 gboolean cam_mm_unset_state_changed_cb(void);
69 gboolean cam_mm_set_focus_changed_cb(camera_focus_changed_cb focus_cb, void *data);
70 gboolean cam_mm_unset_focus_changed_cb(void);
71 gboolean cam_mm_set_preview_cb(camera_preview_cb preview_cb, void *data);
72 gboolean cam_mm_unset_preview_cb(void);
73
74 int cam_mm_get_state(void);
75
76 gboolean cam_mm_set_delay_setting(gboolean value);
77 gboolean cam_mm_get_video_device(int *device);
78 gboolean cam_mm_get_video_size(int *width, int *height);
79 gboolean cam_mm_set_video_size(int width, int height);
80 gboolean cam_mm_get_zoom(int *value);
81 gboolean cam_mm_set_zoom(int value);
82 gboolean cam_mm_set_fps(camera_attr_fps_e value);
83 gboolean cam_mm_get_focus_mode(int *value);
84 gboolean cam_mm_set_focus_mode(int value);
85 gboolean cam_mm_get_zoom_valid_intrange(int *min, int *max);
86
87 gboolean cam_mm_set_af_area(int x, int y, int w, int h);
88 gboolean cam_mm_get_detect_mode(int *value);
89 gboolean cam_mm_set_detect_mode(int value);
90 gboolean cam_mm_get_image_enc_quality(int *value);
91 gboolean cam_mm_set_image_enc_quality(int value);
92 gboolean cam_mm_get_flash(int *value);
93 gboolean cam_mm_set_flash(int value);
94 gboolean cam_mm_get_effect(int *value);
95 gboolean cam_mm_set_effect(int value);
96 gboolean cam_mm_set_audio_recording(gboolean b_on);
97 gboolean cam_mm_get_image_count(int *value);
98 gboolean cam_mm_set_image_count(int value);
99 gboolean cam_mm_get_image_size(int *width, int *height);
100 gboolean cam_mm_set_image_size(int width, int height);
101 gboolean cam_mm_set_video_encoder_bitrate(int bitrate);
102 gboolean cam_mm_set_audio_encoder_bitrate(int bitrate);
103 gboolean cam_mm_set_display_device(int display_device, void *xid);
104 gboolean cam_mm_set_display_id(void *xid, int size);
105 gboolean cam_mm_set_display_rotate(int rotate);
106 gboolean cam_mm_set_camera_rotate(int camera_rotate);
107 gboolean cam_mm_set_display_scale(int scale);
108 gboolean cam_mm_get_front_cam_display_rotate_value(int *display_rotation, int *rotate);
109 gboolean cam_mm_get_display_geometry_method(int *value);
110 gboolean cam_mm_set_display_geometry_method(int value);
111 gboolean cam_mm_set_display_visible(gboolean visible);
112 gboolean cam_mm_set_filename(const gchar *filename);
113 gboolean cam_mm_get_filename(char **filename, gint *size);
114 gboolean cam_mm_get_max_size(int *value);
115 gboolean cam_mm_get_max_time(int *value);
116 gboolean cam_mm_set_max_size(int max_val);
117 gboolean cam_mm_get_tag_enable(int *value);
118 gboolean cam_mm_set_tag_enable(gboolean bvalue);
119 gboolean cam_mm_set_tag_img_orient(int orient);
120 gboolean cam_mm_set_file_format(int format);
121 gboolean cam_mm_set_video_profile(void);
122 gboolean cam_mm_set_codec(int audio_codec, int video_codec);
123 gboolean cam_mm_set_audio_source(int sample_rate, int format, int channel);
124 gboolean cam_mm_set_video_source_format(int format);
125 gboolean cam_mm_set_shutter_sound(int value);
126 gboolean cam_mm_get_shutter_sound(int *value);
127
128 gboolean cam_mm_get_video_source_format(const char *attribute_name,
129                                         int *format);
130
131 gboolean cam_mm_set_capture_format(int value);
132 gboolean cam_mm_set_capture_interval(int value);
133 gboolean cam_mm_reset_recording_motion_fps(void);
134 gboolean cam_mm_get_recording_motion_fps(int *value);
135
136 gint cam_mm_realize(void);
137 gboolean cam_mm_preview_start(int mode);
138 gboolean cam_mm_unrealize(void);
139 gboolean cam_mm_preview_stop(int mode);
140 gboolean cam_mm_is_created(void);
141 gboolean cam_mm_create(int camera_type, int mode);
142 gboolean cam_mm_destory(void);
143 gboolean cam_mm_continuous_capture_start(int count, int interval, camera_capturing_cb capturing_cb, camera_capture_completed_cb completed_cb , void *user_data);
144 gboolean cam_mm_capture_start(camera_capturing_cb capturing_cb , camera_capture_completed_cb completed_cb , void *user_data);
145 gboolean cam_mm_set_capturing_cb(camera_capturing_cb capture_cb, void *data);
146 gboolean cam_mm_unset_capturing_cb(void);
147
148 gboolean cam_mm_set_capture_completed_cb(camera_capture_completed_cb capture_completed_cb, void *data);
149 gboolean cam_mm_unset_capture_completed_cb(void);
150
151
152 gboolean cam_mm_capture_stop(gboolean skip_preview, CamMode mode);
153 gboolean cam_mm_rec_start();
154 gboolean cam_mm_rec_stop(gboolean to_stop);
155 gboolean cam_mm_rec_pause();
156 gboolean cam_mm_rec_cancel();
157 gboolean cam_mm_start_focusing(gint af_mode);
158 gboolean cam_mm_stop_focusing();
159 gboolean cam_mm_set_recording_motion(double rate);
160 gboolean cam_mm_session_init(sound_session_type_e session_type);
161
162 #ifdef ENABLE_CAPTURE_ANIMATION
163 gboolean cam_mm_get_screennail(MMCamcorderCaptureDataType **scrnl);
164 #endif
165
166 gboolean cam_mm_get_caps_range(unsigned int type, unsigned int *caps, void *user_data);
167 gboolean cam_mm_get_caps_minmax(unsigned int type, int *min, int *max);
168 const int cam_mm_get_caps_cb_cnt();
169
170 #endif                          /*  CAM_MM_H_ */