4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Jeongmo Yang <jm80.yang@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
22 #ifndef __MM_CAMCORDER_ATTRIBUTE_H__
23 #define __MM_CAMCORDER_ATTRIBUTE_H__
25 /*=======================================================================================
27 ========================================================================================*/
36 /*=======================================================================================
37 | GLOBAL DEFINITIONS AND DECLARATIONS FOR CAMCORDER |
38 ========================================================================================*/
40 #define GET_AND_STORE_ATTRS_AFTER_SCENE_MODE
43 /*=======================================================================================
45 ========================================================================================*/
47 * Caster of attributes handle
49 #define MMF_CAMCORDER_ATTRS(h) (((mmf_camcorder_t *)(h))->attributes)
51 /*=======================================================================================
53 ========================================================================================*/
55 * Enumerations for camcorder attribute ID.
60 MM_CAM_CAMERA_DEVICE_COUNT,
65 MM_CAM_CAMERA_DEVICE_NAME,
66 MM_CAM_AUDIO_SAMPLERATE,
68 MM_CAM_AUDIO_CHANNEL, /* 10 */
70 MM_CAM_AUDIO_INPUT_ROUTE,
71 MM_CAM_FILTER_SCENE_MODE,
72 MM_CAM_FILTER_BRIGHTNESS,
73 MM_CAM_FILTER_CONTRAST,
75 MM_CAM_FILTER_COLOR_TONE,
76 MM_CAM_FILTER_SATURATION,
78 MM_CAM_FILTER_SHARPNESS, /* 20 */
80 MM_CAM_CAMERA_RECORDING_MOTION_RATE,
84 MM_CAM_CAMERA_DIGITAL_ZOOM,
85 MM_CAM_CAMERA_OPTICAL_ZOOM,
86 MM_CAM_CAMERA_FOCUS_MODE,
87 MM_CAM_CAMERA_AF_SCAN_RANGE,
88 MM_CAM_CAMERA_EXPOSURE_MODE, /* 30 */
89 MM_CAM_CAMERA_EXPOSURE_VALUE,
90 MM_CAM_CAMERA_F_NUMBER,
91 MM_CAM_CAMERA_SHUTTER_SPEED,
94 MM_CAM_CAMERA_ANTI_HANDSHAKE,
95 MM_CAM_CAMERA_FPS_AUTO,
96 MM_CAM_CAMERA_DELAY_ATTR_SETTING,
97 MM_CAM_AUDIO_ENCODER_BITRATE,
98 MM_CAM_VIDEO_ENCODER_BITRATE, /* 40 */
99 MM_CAM_IMAGE_ENCODER_QUALITY,
100 MM_CAM_CAPTURE_FORMAT,
101 MM_CAM_CAPTURE_WIDTH,
102 MM_CAM_CAPTURE_HEIGHT,
103 MM_CAM_CAPTURE_COUNT,
104 MM_CAM_CAPTURE_INTERVAL,
105 MM_CAM_CAPTURE_BREAK_CONTINUOUS_SHOT,
106 MM_CAM_DISPLAY_HANDLE,
107 MM_CAM_DISPLAY_DEVICE,
108 MM_CAM_DISPLAY_SURFACE, /* 50 */
109 MM_CAM_DISPLAY_RECT_X,
110 MM_CAM_DISPLAY_RECT_Y,
111 MM_CAM_DISPLAY_RECT_WIDTH,
112 MM_CAM_DISPLAY_RECT_HEIGHT,
113 MM_CAM_DISPLAY_SOURCE_X,
114 MM_CAM_DISPLAY_SOURCE_Y,
115 MM_CAM_DISPLAY_SOURCE_WIDTH,
116 MM_CAM_DISPLAY_SOURCE_HEIGHT,
117 MM_CAM_DISPLAY_ROTATION,
118 MM_CAM_DISPLAY_VISIBLE, /* 60 */
119 MM_CAM_DISPLAY_SCALE,
120 MM_CAM_DISPLAY_GEOMETRY_METHOD,
121 MM_CAM_TARGET_FILENAME,
122 MM_CAM_TARGET_MAX_SIZE,
123 MM_CAM_TARGET_TIME_LIMIT,
125 MM_CAM_TAG_IMAGE_DESCRIPTION,
126 MM_CAM_TAG_ORIENTATION,
128 MM_CAM_TAG_LATITUDE, /* 70 */
129 MM_CAM_TAG_LONGITUDE,
131 MM_CAM_STROBE_CONTROL,
132 MM_CAM_STROBE_CAPABILITIES,
135 MM_CAM_DETECT_NUMBER,
136 MM_CAM_DETECT_FOCUS_SELECT,
137 MM_CAM_DETECT_SELECT_NUMBER,
138 MM_CAM_DETECT_STATUS, /* 80 */
139 MM_CAM_CAPTURE_ZERO_SYSTEMLAG,
140 MM_CAM_CAMERA_AF_TOUCH_X,
141 MM_CAM_CAMERA_AF_TOUCH_Y,
142 MM_CAM_CAMERA_AF_TOUCH_WIDTH,
143 MM_CAM_CAMERA_AF_TOUCH_HEIGHT,
144 MM_CAM_CAMERA_FOCAL_LENGTH,
145 MM_CAM_RECOMMEND_PREVIEW_FORMAT_FOR_CAPTURE,
146 MM_CAM_RECOMMEND_PREVIEW_FORMAT_FOR_RECORDING,
147 MM_CAM_TAG_GPS_ENABLE,
148 MM_CAM_TAG_GPS_TIME_STAMP, /* 90 */
149 MM_CAM_TAG_GPS_DATE_STAMP,
150 MM_CAM_TAG_GPS_PROCESSING_METHOD,
151 MM_CAM_CAMERA_ROTATION,
152 MM_CAM_CAPTURED_SCREENNAIL,
153 MM_CAM_CAPTURE_SOUND_ENABLE,
154 MM_CAM_RECOMMEND_DISPLAY_ROTATION,
156 MM_CAM_CAMERA_HDR_CAPTURE,
158 MM_CAM_AUDIO_DISABLE, /* 100 */
159 MM_CAM_RECOMMEND_CAMERA_WIDTH,
160 MM_CAM_RECOMMEND_CAMERA_HEIGHT,
161 MM_CAM_CAPTURED_EXIF_RAW_DATA,
162 MM_CAM_DISPLAY_EVAS_SURFACE_SINK,
163 MM_CAM_DISPLAY_EVAS_DO_SCALING,
164 MM_CAM_CAMERA_FACING_DIRECTION,
166 MM_CAM_CAMERA_VIDEO_STABILIZATION,
167 MM_CAM_TAG_VIDEO_ORIENTATION,
168 MM_CAM_CAMERA_PAN_MECHA, /* 110 */
169 MM_CAM_CAMERA_PAN_ELEC,
170 MM_CAM_CAMERA_TILT_MECHA,
171 MM_CAM_CAMERA_TILT_ELEC,
172 MM_CAM_CAMERA_PTZ_TYPE,
175 MM_CAM_SUPPORT_ZSL_CAPTURE,
176 MM_CAM_SUPPORT_ZERO_COPY_FORMAT,
177 MM_CAM_SUPPORT_MEDIA_PACKET_PREVIEW_CB,
178 MM_CAM_ENCODED_PREVIEW_BITRATE, /* 120 */
179 MM_CAM_ENCODED_PREVIEW_GOP_INTERVAL,
180 MM_CAM_RECORDER_TAG_ENABLE,
181 MM_CAM_DISPLAY_SOCKET_PATH,
183 MM_CAM_ROOT_DIRECTORY,
184 MM_CAM_SOUND_STREAM_INDEX,
185 MM_CAM_SOUND_STREAM_TYPE,
186 MM_CAM_DISPLAY_REUSE_HINT,
187 MM_CAM_DISPLAY_REUSE_ELEMENT,
188 MM_CAM_GDBUS_CONNECTION, /* 130 */
189 MM_CAM_AUDIO_REPLAY_GAIN_ENABLE,
190 MM_CAM_AUDIO_REPLAY_GAIN_REFERENCE_LEVEL,
191 MM_CAM_SUPPORT_USER_BUFFER,
192 MM_CAM_USER_BUFFER_FD,
193 MM_CAM_PLATFORM_PRIVILEGE_CAMERA,
194 MM_CAM_STROBE_BRIGHTNESS,
195 MM_CAM_VIDEOSRC_ELEMENT_NAME,
196 MM_CAM_AUDIOSRC_ELEMENT_NAME,
197 MM_CAM_EXTRA_PREVIEW_ENABLE,
198 MM_CAM_CAMERA_FOCUS_LEVEL, /* 140 */
199 MM_CAM_SUPPORT_EXTRA_PREVIEW,
200 MM_CAM_REQUEST_CODEC_CONFIG,
201 MM_CAM_FILTER_WB_TEMPERATURE,
202 MM_CAM_FILTER_WB_TEMPERATURE_STEP,
204 MM_CAM_CAMERA_GAIN_STEP,
206 } MMCamcorderAttrsID;
208 /*=======================================================================================
210 ========================================================================================*/
211 typedef bool (*mmf_cam_commit_func_t)(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
213 /*=======================================================================================
214 | STRUCTURE DEFINITIONS |
215 ========================================================================================*/
217 MMCamcorderAttrsID attrid;
226 } default_value; /* default value */
227 MMCamAttrsValidType validity_type;
231 double *double_array;
239 mmf_cam_commit_func_t attr_commit;
240 } mm_cam_attr_construct_info;
242 /*=======================================================================================
243 | CONSTANT DEFINITIONS |
244 ========================================================================================*/
246 /*=======================================================================================
248 ========================================================================================*/
250 /*=======================================================================================
251 | EXTERN GLOBAL VARIABLE |
252 ========================================================================================*/
254 /*=======================================================================================
255 | GLOBAL FUNCTION PROTOTYPES |
256 ========================================================================================*/
258 * This function allocates structure of attributes and sets initial values.
260 * @param[in] handle Handle of camcorder.
261 * @param[in] info Preset information of camcorder.
262 * @return This function returns allocated structure of attributes.
264 * @see _mmcamcorder_dealloc_attribute()
267 MMHandleType _mmcamcorder_alloc_attribute(MMHandleType handle);
270 * This function release structure of attributes.
272 * @param[in] handle Handle of camcorder.
273 * @param[in] attrs Handle of camcorder attribute.
276 * @see _mmcamcorder_alloc_attribute()
279 void _mmcamcorder_dealloc_attribute(MMHandleType handle, MMHandleType attrs);
282 * This is a meta function to get attributes of camcorder with given attribute names.
284 * @param[in] handle Handle of camcorder.
285 * @param[out] err_attr_name Specifies the name of attributes that made an error. If the function doesn't make an error, this will be null.
286 * @param[in] attribute_name attribute name that user want to get.
287 * @param[in] var_args Specifies variable arguments.
288 * @return This function returns MM_ERROR_NONE on Success, minus on Failure.
289 * @remarks You can retrieve multiple attributes at the same time. @n
290 * @see _mmcamcorder_set_attributes
292 int _mmcamcorder_get_attributes(MMHandleType handle, char **err_attr_name, const char *attribute_name, va_list var_args);
296 * This is a meta function to set attributes of camcorder with given attribute names.
298 * @param[in] handle Handle of camcorder.
299 * @param[out] err_attr_name Specifies the name of attributes that made an error. If the function doesn't make an error, this will be null.
300 * @param[in] attribute_name attribute name that user want to set.
301 * @param[in] var_args Specifies variable arguments.
302 * @return This function returns MM_ERROR_NONE on Success, minus on Failure.
303 * @remarks You can put multiple attributes to camcorder at the same time. @n
304 * @see _mmcamcorder_get_attributes
306 int _mmcamcorder_set_attributes(MMHandleType handle, char **err_attr_name, const char *attribute_name, va_list var_args);
310 * This is a meta function to get detail information of the attribute.
312 * @param[in] handle Handle of camcorder.
313 * @param[in] attr_name attribute name that user want to get information.
314 * @param[out] info a structure that holds information related with the attribute.
315 * @return This function returns MM_ERROR_NONE on Success, minus on Failure.
316 * @remarks If the function succeeds, 'info' holds detail information about the attribute, such as type, flag, validity_type, validity_values @n
317 * @see _mmcamcorder_get_attributes, _mmcamcorder_set_attributes
319 int _mmcamcorder_get_attribute_info(MMHandleType handle, const char *attr_name, MMCamAttrsInfo *info);
321 /*=======================================================================================
322 | CAMCORDER INTERNAL LOCAL |
323 ========================================================================================*/
325 * A commit function to set camcorder attributes
326 * If the attribute needs actual setting, this function handles that activity.
327 * When application sets an attribute, setting function in MSL common calls this function.
328 * If this function fails, original value will not change.
330 * @param[in] attr_idx Attribute index of subcategory.
331 * @param[in] attr_name Attribute name.
332 * @param[in] value Handle of camcorder.
333 * @param[in] commit_param Allocation type of camcorder context.
334 * @return This function returns TRUE on success, or FALSE on failure
339 bool _mmcamcorder_commit_camcorder_attrs(int attr_idx, const char *attr_name, const MMAttrsValue *value, void *commit_param);
342 * A commit function to set videosource attribute
343 * If the attribute needs actual setting, this function handles that activity.
344 * When application sets an attribute, setting function in MSL common calls this function.
345 * If this function fails, original value will not change.
347 * @param[in] attr_idx Attribute index of subcategory.
348 * @param[in] attr_name Attribute name.
349 * @param[in] value Handle of camcorder.
350 * @param[in] commit_param Allocation type of camcorder context.
351 * @return This function returns TRUE on success, or FALSE on failure
356 bool _mmcamcorder_commit_capture_width(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
357 bool _mmcamcorder_commit_capture_height(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
358 bool _mmcamcorder_commit_capture_break_cont_shot(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
359 bool _mmcamcorder_commit_capture_count(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
360 bool _mmcamcorder_commit_capture_sound_enable(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
361 bool _mmcamcorder_commit_audio_volume(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
362 bool _mmcamcorder_commit_audio_input_route(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
363 bool _mmcamcorder_commit_audio_disable(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
364 bool _mmcamcorder_commit_camera_format(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
365 bool _mmcamcorder_commit_camera_fps(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
366 bool _mmcamcorder_commit_camera_recording_motion_rate(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
367 bool _mmcamcorder_commit_camera_width(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
368 bool _mmcamcorder_commit_camera_height(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
369 bool _mmcamcorder_commit_video_size(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
370 bool _mmcamcorder_commit_camera_zoom(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
371 bool _mmcamcorder_commit_camera_ptz_type(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
372 bool _mmcamcorder_commit_camera_pan(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
373 bool _mmcamcorder_commit_camera_tilt(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
374 bool _mmcamcorder_commit_camera_focus_mode(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
375 bool _mmcamcorder_commit_camera_focus_level(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
376 bool _mmcamcorder_commit_camera_af_scan_range(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
377 bool _mmcamcorder_commit_camera_af_touch_area(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
378 bool _mmcamcorder_commit_camera_capture_mode(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
379 bool _mmcamcorder_commit_camera_wdr(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
380 bool _mmcamcorder_commit_camera_anti_handshake(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
381 bool _mmcamcorder_commit_camera_video_stabilization(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
382 bool _mmcamcorder_commit_camera_rotate(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
383 bool _mmcamcorder_commit_image_encoder_quality(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
384 bool _mmcamcorder_commit_target_filename(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
385 bool _mmcamcorder_commit_encoder_bitrate(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
386 bool _mmcamcorder_commit_recording_max_limit(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
387 bool _mmcamcorder_commit_filter(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
388 bool _mmcamcorder_commit_filter_scene_mode(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
389 bool _mmcamcorder_commit_filter_flip(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
390 bool _mmcamcorder_commit_display_handle(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
391 bool _mmcamcorder_commit_display_mode(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
392 bool _mmcamcorder_commit_display_rotation(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
393 bool _mmcamcorder_commit_display_flip(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
394 bool _mmcamcorder_commit_display_visible(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
395 bool _mmcamcorder_commit_display_geometry_method(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
396 bool _mmcamcorder_commit_display_rect(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
397 bool _mmcamcorder_commit_display_scale(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
398 bool _mmcamcorder_commit_display_evas_do_scaling(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
399 bool _mmcamcorder_commit_strobe(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
400 bool _mmcamcorder_commit_detect(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
401 bool _mmcamcorder_commit_camera_flip(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
402 bool _mmcamcorder_commit_camera_hdr_capture(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
403 bool _mmcamcorder_commit_encoded_preview_bitrate(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
404 bool _mmcamcorder_commit_encoded_preview_gop_interval(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
405 bool _mmcamcorder_commit_sound_stream_info(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
406 bool _mmcamcorder_commit_tag(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
407 bool _mmcamcorder_commit_audio_replay_gain(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
408 bool _mmcamcorder_commit_extra_preview(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
409 bool _mmcamcorder_commit_request_codec_config(MMHandleType handle, int attr_idx, const MMAttrsValue *value);
413 * This function initialize effect setting.
415 * @param[in] handle Handle of camcorder.
416 * @return bool Success on TRUE or return FALSE
418 bool _mmcamcorder_set_attribute_to_camsensor(MMHandleType handle);
419 bool _mmcamcorder_set_attribute_to_camsensor2(MMHandleType handle);
422 * This function removes writable flag from pre-defined attributes.
424 * @param[in] handle Handle of camcorder.
425 * @return int Success on MM_ERROR_NONE or return ERROR with error code
427 int _mmcamcorder_lock_readonly_attributes(MMHandleType handle);
430 * check whether supported or not
432 * @param[in] handle Handle of camcorder.
433 * @param[in] attr_index index of attribute to check.
434 * @return bool TRUE if supported or FALSE
436 bool _mmcamcorder_check_supported_attribute(MMHandleType handle, int attr_index);
442 #endif /* __MM_CAMCORDER_ATTRIBUTE_H__ */