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.
24 #include <muse_camera.h>
25 #include <muse_camera_msg.h>
26 #include <muse_core_ipc.h>
27 #include <camera_private.h>
28 #include <muse_core.h>
31 #include <Elementary.h>
32 #include <mm_camcorder_client.h>
35 #include <Ecore_Wayland.h>
43 #define LOG_TAG "TIZEN_N_CAMERA_CLIENT"
46 int __convert_camera_error_code(const char *func, int code)
48 int ret = CAMERA_ERROR_NONE;
49 const char *errorstr = NULL;
53 ret = CAMERA_ERROR_NONE;
54 errorstr = "ERROR_NONE";
56 case MM_ERROR_CAMCORDER_INVALID_ARGUMENT:
57 case MM_ERROR_COMMON_INVALID_ATTRTYPE:
58 ret = CAMERA_ERROR_INVALID_PARAMETER;
59 errorstr = "INVALID_PARAMETER";
61 case MM_ERROR_CAMCORDER_NOT_INITIALIZED:
62 case MM_ERROR_CAMCORDER_INVALID_STATE:
63 ret = CAMERA_ERROR_INVALID_STATE;
64 errorstr = "INVALID_STATE";
66 case MM_ERROR_CAMCORDER_DEVICE_NOT_FOUND:
67 ret = CAMERA_ERROR_DEVICE_NOT_FOUND;
68 errorstr = "DEVICE_NOT_FOUND";
70 case MM_ERROR_CAMCORDER_DEVICE_BUSY:
71 case MM_ERROR_CAMCORDER_DEVICE_OPEN:
72 case MM_ERROR_CAMCORDER_CMD_IS_RUNNING:
73 ret = CAMERA_ERROR_DEVICE_BUSY;
74 errorstr = "DEVICE_BUSY";
76 case MM_ERROR_CAMCORDER_DEVICE:
77 case MM_ERROR_CAMCORDER_DEVICE_IO:
78 case MM_ERROR_CAMCORDER_DEVICE_TIMEOUT:
79 case MM_ERROR_CAMCORDER_DEVICE_WRONG_JPEG:
80 case MM_ERROR_CAMCORDER_DEVICE_LACK_BUFFER:
81 ret = CAMERA_ERROR_DEVICE;
82 errorstr = "ERROR_DEVICE";
84 case MM_ERROR_CAMCORDER_GST_CORE:
85 case MM_ERROR_CAMCORDER_GST_LIBRARY:
86 case MM_ERROR_CAMCORDER_GST_RESOURCE:
87 case MM_ERROR_CAMCORDER_GST_STREAM:
88 case MM_ERROR_CAMCORDER_GST_STATECHANGE:
89 case MM_ERROR_CAMCORDER_GST_NEGOTIATION:
90 case MM_ERROR_CAMCORDER_GST_LINK:
91 case MM_ERROR_CAMCORDER_GST_FLOW_ERROR:
92 case MM_ERROR_CAMCORDER_ENCODER:
93 case MM_ERROR_CAMCORDER_ENCODER_BUFFER:
94 case MM_ERROR_CAMCORDER_ENCODER_WRONG_TYPE:
95 case MM_ERROR_CAMCORDER_ENCODER_WORKING:
96 case MM_ERROR_CAMCORDER_INTERNAL:
97 case MM_ERROR_CAMCORDER_RESPONSE_TIMEOUT:
98 case MM_ERROR_CAMCORDER_DSP_FAIL:
99 case MM_ERROR_CAMCORDER_AUDIO_EMPTY:
100 case MM_ERROR_CAMCORDER_CREATE_CONFIGURE:
101 case MM_ERROR_CAMCORDER_FILE_SIZE_OVER:
102 case MM_ERROR_CAMCORDER_DISPLAY_DEVICE_OFF:
103 case MM_ERROR_CAMCORDER_INVALID_CONDITION:
104 ret = CAMERA_ERROR_INVALID_OPERATION;
105 errorstr = "INVALID_OPERATION";
107 case MM_ERROR_CAMCORDER_RESOURCE_CREATION:
108 case MM_ERROR_COMMON_OUT_OF_MEMORY:
109 ret = CAMERA_ERROR_OUT_OF_MEMORY;
110 errorstr = "OUT_OF_MEMORY";
112 case MM_ERROR_POLICY_BLOCKED:
113 ret = CAMERA_ERROR_SOUND_POLICY;
114 errorstr = "ERROR_SOUND_POLICY";
116 case MM_ERROR_POLICY_BLOCKED_BY_CALL:
117 ret = CAMERA_ERROR_SOUND_POLICY_BY_CALL;
118 errorstr = "ERROR_SOUND_POLICY_BY_CALL";
120 case MM_ERROR_POLICY_BLOCKED_BY_ALARM:
121 ret = CAMERA_ERROR_SOUND_POLICY_BY_ALARM;
122 errorstr = "ERROR_SOUND_POLICY_BY_ALARM";
124 case MM_ERROR_POLICY_RESTRICTED:
125 ret = CAMERA_ERROR_SECURITY_RESTRICTED;
126 errorstr = "ERROR_RESTRICTED";
128 case MM_ERROR_CAMCORDER_DEVICE_REG_TROUBLE:
129 ret = CAMERA_ERROR_ESD;
130 errorstr = "ERROR_ESD";
132 case MM_ERROR_COMMON_INVALID_PERMISSION:
133 ret = CAMERA_ERROR_PERMISSION_DENIED;
134 errorstr = "ERROR_PERMISSION_DENIED";
136 case MM_ERROR_COMMON_OUT_OF_ARRAY:
137 case MM_ERROR_COMMON_OUT_OF_RANGE:
138 case MM_ERROR_COMMON_ATTR_NOT_EXIST:
139 case MM_ERROR_CAMCORDER_NOT_SUPPORTED:
140 ret = CAMERA_ERROR_NOT_SUPPORTED;
141 errorstr = "ERROR_NOT_SUPPORTED";
144 ret = CAMERA_ERROR_INVALID_OPERATION;
145 errorstr = "INVALID_OPERATION";
148 if (code != MM_ERROR_NONE) {
149 LOGE("[%s] %s(0x%08x) : core frameworks error code(0x%08x)", func ? func : "NULL_FUNC", errorstr, ret, code);
156 static MMCamWaylandInfo *_get_wl_info(Evas_Object *obj)
158 MMCamWaylandInfo *wl_info = NULL;
161 LOGE("evas object is NULL");
165 wl_info = g_new0(MMCamWaylandInfo, 1);
166 if (wl_info == NULL) {
167 LOGE("wl_info alloc failed : %d", sizeof(MMCamWaylandInfo));
171 wl_info->evas_obj = (void *)obj;
172 wl_info->window = (void *)elm_win_wl_window_get(obj);
173 wl_info->surface = (void *)ecore_wl_window_surface_get(wl_info->window);
174 wl_info->display = (void *)ecore_wl_display_get();
176 if (wl_info->window == NULL || wl_info->surface == NULL || wl_info->display == NULL) {
177 LOGE("something is NULL %p, %p, %p", wl_info->window, wl_info->surface, wl_info->display);
182 evas_object_geometry_get(obj, &wl_info->window_x, &wl_info->window_y,
183 &wl_info->window_width, &wl_info->window_height);
185 LOGD("wayland obj %p, window %p, surface %p, display %p, size %d,%d,%dx%d",
186 wl_info->evas_obj, wl_info->window, wl_info->surface, wl_info->display,
187 wl_info->window_x, wl_info->window_y, wl_info->window_width, wl_info->window_height);
191 #endif /* HAVE_WAYLAND */
193 static int _import_tbm_key(tbm_bufmgr bufmgr, unsigned int tbm_key, tbm_bo *bo, tbm_bo_handle *bo_handle)
195 tbm_bo tmp_bo = NULL;
196 tbm_bo_handle tmp_bo_handle = {NULL, };
198 if (bufmgr == NULL || bo == NULL || bo_handle == NULL || tbm_key == 0) {
199 LOGE("invalid parameter - bufmgr %p, bo %p, bo_handle %p, key %d",
200 bufmgr, bo, bo_handle, tbm_key);
204 tmp_bo = tbm_bo_import(bufmgr, tbm_key);
205 if (tmp_bo == NULL) {
206 LOGE("bo import failed - bufmgr %p, key %d", bufmgr, tbm_key);
210 tmp_bo_handle = tbm_bo_map(tmp_bo, TBM_DEVICE_CPU, TBM_OPTION_READ);
211 if (tmp_bo_handle.ptr == NULL) {
212 LOGE("bo map failed %p", tmp_bo);
213 tbm_bo_unref(tmp_bo);
218 /* set bo and bo_handle */
220 *bo_handle = tmp_bo_handle;
225 static void _release_imported_bo(tbm_bo *bo)
227 if (bo == NULL || *bo == NULL) {
239 static int _client_wait_for_cb_return(muse_camera_api_e api, callback_cb_info_s *cb_info, int time_out)
241 int ret = CAMERA_ERROR_NONE;
244 LOGD("Enter api : %d", api);
245 g_mutex_lock(&(cb_info->pMutex[api]));
247 if (cb_info->activating[api] == 0) {
248 end_time = g_get_monotonic_time() + time_out * G_TIME_SPAN_SECOND;
249 if (g_cond_wait_until(&(cb_info->pCond[api]), &(cb_info->pMutex[api]), end_time)) {
250 LOGD("cb_info->recvApiMsg : %s", cb_info->recvApiMsg);
251 if (!muse_camera_msg_get(ret, cb_info->recvApiMsg)) {
252 LOGE("Get cb msg failed.");
253 ret = CAMERA_ERROR_INVALID_OPERATION;
255 LOGD("Wait passed, ret : 0x%x", ret);
257 if (cb_info->activating[api])
258 cb_info->activating[api] = 0;
260 LOGD("api %d was TIMED OUT!", api);
261 ret = CAMERA_ERROR_INVALID_OPERATION;
264 LOGE("condition is already checked for the api : %d.", api);
265 if (!muse_camera_msg_get(ret, cb_info->recvApiMsg)) {
266 LOGE("Get cb msg failed.");
267 ret = CAMERA_ERROR_INVALID_OPERATION;
269 LOGD("Already checked condition, Wait passed, ret : 0x%x", ret);
272 g_mutex_unlock(&(cb_info->pMutex[api]));
273 LOGD("ret : 0x%x", ret);
277 static void _client_user_callback(callback_cb_info_s *cb_info, char *recvMsg, muse_camera_event_e event)
283 tbm_bo_handle bo_handle = {NULL, };
285 if (recvMsg == NULL || event >= MUSE_CAMERA_EVENT_TYPE_NUM) {
286 LOGE("invalid parameter - msg %p, event %d", recvMsg, event);
290 LOGD("get msg %s, event %d", recvMsg, event);
292 if (cb_info->user_cb[event] == NULL) {
293 LOGW("user callback for event %d is not set", event);
298 case MUSE_CAMERA_EVENT_TYPE_STATE_CHANGE:
304 muse_camera_msg_get(previous, recvMsg);
305 muse_camera_msg_get(current, recvMsg);
306 muse_camera_msg_get(by_policy, recvMsg);
308 LOGD("STATE CHANGE - previous %d, current %d, by_policy %d",
309 previous, current, by_policy);
311 ((camera_state_changed_cb)cb_info->user_cb[event])((camera_state_e)previous,
312 (camera_state_e)current,
314 cb_info->user_data[event]);
317 case MUSE_CAMERA_EVENT_TYPE_FOCUS_CHANGE:
321 muse_camera_msg_get(state, recvMsg);
323 LOGD("FOCUS state - %d", state);
325 ((camera_focus_changed_cb)cb_info->user_cb[event])((camera_focus_state_e)state,
326 cb_info->user_data[event]);
329 case MUSE_CAMERA_EVENT_TYPE_CAPTURE_COMPLETE:
330 LOGD("CAPTURE_COMPLETED");
331 ((camera_capture_completed_cb)cb_info->user_cb[event])(cb_info->user_data[event]);
333 case MUSE_CAMERA_EVENT_TYPE_PREVIEW:
335 unsigned char *buf_pos = NULL;
336 camera_preview_data_s *frame = NULL;
339 muse_camera_msg_get(tbm_key, recvMsg);
342 LOGE("invalid key %d", tbm_key);
346 /* import tbm bo and get virtual address */
347 if (!_import_tbm_key(cb_info->bufmgr, tbm_key, &bo, &bo_handle)) {
351 buf_pos = (unsigned char *)bo_handle.ptr;
353 frame = (camera_preview_data_s *)buf_pos;
354 buf_pos += sizeof(camera_preview_data_s);
356 switch (frame->num_of_planes) {
358 frame->data.single_plane.yuv = buf_pos;
359 total_size = frame->data.single_plane.size;
361 frame->data.double_plane.y = buf_pos;
362 buf_pos += frame->data.double_plane.y_size;
363 frame->data.double_plane.uv = buf_pos;
364 total_size = frame->data.double_plane.y_size + \
365 frame->data.double_plane.uv_size;
367 frame->data.triple_plane.y = buf_pos;
368 buf_pos += frame->data.triple_plane.y_size;
369 frame->data.triple_plane.u = buf_pos;
370 buf_pos += frame->data.triple_plane.u_size;
371 frame->data.triple_plane.v = buf_pos;
372 total_size = frame->data.triple_plane.y_size + \
373 frame->data.triple_plane.u_size + \
374 frame->data.triple_plane.v_size;
379 LOGD("PREVIEW_CB - format %d, %dx%d, size %d plane num %d",
380 frame->format, frame->width, frame->height, total_size, frame->num_of_planes);
382 ((camera_preview_cb)cb_info->user_cb[event])(frame, cb_info->user_data[event]);
384 LOGD("PREVIEW_CB retuned");
386 /* unmap and unref tbm bo */
387 _release_imported_bo(&bo);
390 muse_camera_msg_send1_no_return(MUSE_CAMERA_API_RETURN_BUFFER,
391 cb_info->fd, cb_info,
394 LOGD("return buffer Done");
397 case MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW:
398 ((camera_media_packet_preview_cb)cb_info->user_cb[event])(NULL, cb_info->user_data[event]);
400 case MUSE_CAMERA_EVENT_TYPE_HDR_PROGRESS:
404 muse_camera_msg_get(percent, recvMsg);
406 LOGD("HDR progress - %d \%", percent);
408 ((camera_attr_hdr_progress_cb)cb_info->user_cb[event])(percent, cb_info->user_data[event]);
411 case MUSE_CAMERA_EVENT_TYPE_INTERRUPTED:
417 muse_camera_msg_get(policy, recvMsg);
418 muse_camera_msg_get(previous, recvMsg);
419 muse_camera_msg_get(current, recvMsg);
421 LOGD("INTERRUPTED - policy %d, state previous %d, current %d",
422 policy, previous, current);
424 ((camera_interrupted_cb)cb_info->user_cb[event])((camera_policy_e)policy,
425 (camera_state_e)previous,
426 (camera_state_e)current,
427 cb_info->user_data[event]);
430 case MUSE_CAMERA_EVENT_TYPE_FACE_DETECTION:
433 camera_detected_face_s *faces = NULL;
435 muse_camera_msg_get(count, recvMsg);
436 muse_camera_msg_get(tbm_key, recvMsg);
438 if (count > 0 && tbm_key > 0) {
439 LOGD("FACE_DETECTION - count %d, tbm_key %d", count, tbm_key);
441 if (!_import_tbm_key(cb_info->bufmgr, tbm_key, &bo, &bo_handle)) {
446 faces = bo_handle.ptr;
448 ((camera_face_detected_cb)cb_info->user_cb[event])(faces, count, cb_info->user_data[event]);
454 for (i = 0 ; i < count ; i++) {
455 LOGD("id[%2d] - score %d, position (%d,%d,%dx%d)",
456 i, faces[i].score, faces[i].x, faces[i].y, faces[i].width, faces[i].height);
462 _release_imported_bo(&bo);
465 muse_camera_msg_send1_no_return(MUSE_CAMERA_API_RETURN_BUFFER,
466 cb_info->fd, cb_info,
469 LOGD("return buffer done");
471 LOGE("invalid message - count %d, key %d", count, tbm_key);
475 case MUSE_CAMERA_EVENT_TYPE_ERROR:
478 int current_state = 0;
480 muse_camera_msg_get(error, recvMsg);
481 muse_camera_msg_get(current_state, recvMsg);
483 LOGE("ERROR - error 0x%x, current_state %d", error, current_state);
485 ((camera_error_cb)cb_info->user_cb[event])((camera_error_e)error,
486 (camera_state_e)current_state,
487 cb_info->user_data[event]);
490 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_RESOLUTION:
491 muse_camera_msg_get(param1, recvMsg);
492 muse_camera_msg_get(param2, recvMsg);
494 LOGD("SUPPORTED_PREVIEW_RESOLUTION - %d x %d", param1, param2);
496 ((camera_supported_preview_resolution_cb)cb_info->user_cb[event])(param1, param2, cb_info->user_data[event]);
498 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_RESOLUTION:
499 muse_camera_msg_get(param1, recvMsg);
500 muse_camera_msg_get(param2, recvMsg);
502 LOGD("SUPPORTED_CAPTURE_RESOLUTION - %d x %d", param1, param2);
504 ((camera_supported_capture_resolution_cb)cb_info->user_cb[event])(param1, param2, cb_info->user_data[event]);
506 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_FORMAT:
507 muse_camera_msg_get(param1, recvMsg);
509 LOGD("SUPPORTED_CAPTURE_FORMAT - %d ", param1);
511 ((camera_supported_capture_format_cb)cb_info->user_cb[event])((camera_pixel_format_e)param1, cb_info->user_data[event]);
513 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_FORMAT:
514 muse_camera_msg_get(param1, recvMsg);
516 LOGD("SUPPORTED_PREVIEW_FORMAT - %d ", param1);
518 ((camera_supported_preview_format_cb)cb_info->user_cb[event])((camera_pixel_format_e)param1, cb_info->user_data[event]);
520 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_AF_MODE:
521 muse_camera_msg_get(param1, recvMsg);
523 LOGD("SUPPORTED_AF_MODE - %d ", param1);
525 ((camera_attr_supported_af_mode_cb)cb_info->user_cb[event])((camera_attr_af_mode_e)param1, cb_info->user_data[event]);
527 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EXPOSURE_MODE:
528 muse_camera_msg_get(param1, recvMsg);
530 LOGD("SUPPORTED_EXPOSURE_MODE - %d ", param1);
532 ((camera_attr_supported_exposure_mode_cb)cb_info->user_cb[event])((camera_attr_exposure_mode_e)param1, cb_info->user_data[event]);
534 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_ISO:
535 muse_camera_msg_get(param1, recvMsg);
537 LOGD("SUPPORTED_ISO - %d ", param1);
539 ((camera_attr_supported_iso_cb)cb_info->user_cb[event])((camera_attr_iso_e)param1, cb_info->user_data[event]);
541 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_WHITEBALANCE:
542 muse_camera_msg_get(param1, recvMsg);
544 LOGD("SUPPORTED_WHITEBALANCE - %d ", param1);
546 ((camera_attr_supported_whitebalance_cb)cb_info->user_cb[event])((camera_attr_whitebalance_e)param1, cb_info->user_data[event]);
548 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EFFECT:
549 muse_camera_msg_get(param1, recvMsg);
551 LOGD("SUPPORTED_EFFECT - %d ", param1);
553 ((camera_attr_supported_effect_cb)cb_info->user_cb[event])((camera_attr_effect_mode_e)param1, cb_info->user_data[event]);
555 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_SCENE_MODE:
556 muse_camera_msg_get(param1, recvMsg);
558 LOGD("SUPPORTED_SCENE_MODE - %d ", param1);
560 ((camera_attr_supported_scene_mode_cb)cb_info->user_cb[event])((camera_attr_scene_mode_e)param1, cb_info->user_data[event]);
562 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FLASH_MODE:
563 muse_camera_msg_get(param1, recvMsg);
565 LOGD("SUPPORTED_FLASH_MODE - %d ", param1);
567 ((camera_attr_supported_flash_mode_cb)cb_info->user_cb[event])((camera_attr_flash_mode_e)param1, cb_info->user_data[event]);
569 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS:
570 muse_camera_msg_get(param1, recvMsg);
572 LOGD("SUPPORTED_FPS - %d ", param1);
574 ((camera_attr_supported_fps_cb)cb_info->user_cb[event])((camera_attr_fps_e)param1, cb_info->user_data[event]);
576 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS_BY_RESOLUTION:
577 muse_camera_msg_get(param1, recvMsg);
579 LOGD("SUPPORTED_FPS_BY_RESOLUTION - %d ", param1);
581 ((camera_attr_supported_fps_cb)cb_info->user_cb[event])((camera_attr_fps_e)param1, cb_info->user_data[event]);
583 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_FLIP:
584 muse_camera_msg_get(param1, recvMsg);
586 LOGD("SUPPORTED_STREAM_FLIP - %d ", param1);
588 ((camera_attr_supported_stream_flip_cb)cb_info->user_cb[event])((camera_flip_e)param1, cb_info->user_data[event]);
590 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_ROTATION:
591 muse_camera_msg_get(param1, recvMsg);
593 LOGD("SUPPORTED_STREAM_ROTATION - %d ", param1);
595 ((camera_attr_supported_stream_rotation_cb)cb_info->user_cb[event])((camera_rotation_e)param1, cb_info->user_data[event]);
597 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_THEATER_MODE:
598 muse_camera_msg_get(param1, recvMsg);
600 LOGD("SUPPORTED_THEATER_MODE - %d ", param1);
602 ((camera_attr_supported_theater_mode_cb)cb_info->user_cb[event])((camera_attr_theater_mode_e)param1, cb_info->user_data[event]);
604 case MUSE_CAMERA_EVENT_TYPE_CAPTURE:
606 camera_image_data_s *rImage = NULL;
607 camera_image_data_s *rPostview = NULL;
608 camera_image_data_s *rThumbnail = NULL;
609 unsigned char *buf_pos = NULL;
611 int is_thumbnail = 0;
613 muse_camera_msg_get(tbm_key, recvMsg);
614 muse_camera_msg_get(is_postview, recvMsg);
615 muse_camera_msg_get(is_thumbnail, recvMsg);
617 LOGD("camera capture callback came in. key %d, postview %d, thumbnail %d",
618 tbm_key, is_postview, is_thumbnail);
621 LOGE("invalid key %d", tbm_key);
625 /* import tbm bo and get virtual address */
626 if (!_import_tbm_key(cb_info->bufmgr, tbm_key, &bo, &bo_handle)) {
630 buf_pos = (unsigned char *)bo_handle.ptr;
631 rImage = (camera_image_data_s *)buf_pos;
632 rImage->data = buf_pos + sizeof(camera_image_data_s);
633 buf_pos += sizeof(camera_image_data_s) + rImage->size;
636 rPostview = (camera_image_data_s *)buf_pos;
637 LOGD("rPostview->size : %d", rPostview->size);
638 rPostview->data = buf_pos + sizeof(camera_image_data_s);
639 buf_pos += sizeof(camera_image_data_s) + rPostview->size;
643 rThumbnail = (camera_image_data_s *)buf_pos;
644 LOGD("rThumbnail->size : %d", rThumbnail->size);
645 rThumbnail->data = buf_pos + sizeof(camera_image_data_s);
646 buf_pos += sizeof(camera_image_data_s) + rThumbnail->size;
649 LOGD("image info %dx%d, size : %d", rImage->height, rImage->width, rImage->size);
651 ((camera_capturing_cb)cb_info->user_cb[event])(rImage, rPostview, rThumbnail, cb_info->user_data[event]);
653 /* unmap and unref tbm bo */
654 _release_imported_bo(&bo);
657 muse_camera_msg_send1_no_return(MUSE_CAMERA_API_RETURN_BUFFER,
662 LOGD("return buffer done");
665 case MUSE_CAMERA_EVENT_TYPE_VIDEO_FRAME_RENDER_ERROR:
668 LOGW("Unknown event : %d", event);
675 static void *_event_handler(gpointer data)
677 camera_event_s *cam_event = NULL;
678 callback_cb_info_s *cb_info = (callback_cb_info_s *)data;
680 if (cb_info == NULL) {
681 LOGE("cb_info NULL");
687 g_mutex_lock(&cb_info->event_mutex);
689 while (g_atomic_int_get(&cb_info->event_thread_running)) {
690 if (g_queue_is_empty(cb_info->event_queue)) {
691 LOGD("signal wait...");
692 g_cond_wait(&cb_info->event_cond, &cb_info->event_mutex);
693 LOGD("signal received");
695 if (g_atomic_int_get(&cb_info->event_thread_running) == 0) {
696 LOGD("stop event thread");
701 cam_event = (camera_event_s *)g_queue_pop_head(cb_info->event_queue);
703 g_mutex_unlock(&cb_info->event_mutex);
706 _client_user_callback(cam_event->cb_info, cam_event->recvMsg, cam_event->event);
710 LOGW("NULL event info");
713 g_mutex_lock(&cb_info->event_mutex);
716 /* remove remained event */
717 while (!g_queue_is_empty(cb_info->event_queue)) {
718 cam_event = (camera_event_s *)g_queue_pop_head(cb_info->event_queue);
720 LOGD("remove event info %p", cam_event);
724 LOGW("NULL event info");
728 g_mutex_unlock(&cb_info->event_mutex);
735 static bool _camera_idle_event_callback(void *data)
737 callback_cb_info_s *cb_info = NULL;
738 camera_idle_event_s *cam_idle_event = (camera_idle_event_s *)data;
740 if (cam_idle_event == NULL) {
741 LOGE("cam_idle_event is NULL");
746 g_mutex_lock(&cam_idle_event->event_mutex);
748 cb_info = cam_idle_event->cb_info;
749 if (cb_info == NULL) {
750 LOGW("cb_info is NULL. event %d", cam_idle_event->event);
751 goto IDLE_EVENT_CALLBACK_DONE;
754 /* remove event from list */
755 g_mutex_lock(&cb_info->idle_event_mutex);
756 if (cb_info->idle_event_list) {
757 cb_info->idle_event_list = g_list_remove(cb_info->idle_event_list, (gpointer)cam_idle_event);
759 /*LOGD("remove idle event %p, %p", cam_idle_event, cb_info->idle_event_list);*/
760 g_mutex_unlock(&cb_info->idle_event_mutex);
763 _client_user_callback(cam_idle_event->cb_info, cam_idle_event->recvMsg, cam_idle_event->event);
765 /* send signal for waiting thread */
766 g_cond_signal(&cb_info->idle_event_cond);
768 IDLE_EVENT_CALLBACK_DONE:
769 /* unlock and release event */
770 g_mutex_unlock(&cam_idle_event->event_mutex);
771 g_mutex_clear(&cam_idle_event->event_mutex);
773 free(cam_idle_event);
774 cam_idle_event = NULL;
779 static void _camera_remove_idle_event_all(callback_cb_info_s *cb_info)
781 camera_idle_event_s *cam_idle_event = NULL;
786 if (cb_info == NULL) {
787 LOGE("cb_info is NULL");
791 g_mutex_lock(&cb_info->idle_event_mutex);
793 if (cb_info->idle_event_list == NULL) {
794 LOGD("No idle event is remained.");
796 list = cb_info->idle_event_list;
799 cam_idle_event = list->data;
800 list = g_list_next(list);
802 if (!cam_idle_event) {
803 LOGW("Fail to remove idle event. The event is NULL");
805 if (g_mutex_trylock(&cam_idle_event->event_mutex)) {
806 ret = g_idle_remove_by_data(cam_idle_event);
808 LOGD("remove idle event [%p], ret[%d]", cam_idle_event, ret);
811 cam_idle_event->cb_info = NULL;
812 LOGW("idle callback for event %p will be called later", cam_idle_event);
815 cb_info->idle_event_list = g_list_remove(cb_info->idle_event_list, (gpointer)cam_idle_event);
817 g_mutex_unlock(&cam_idle_event->event_mutex);
820 g_mutex_clear(&cam_idle_event->event_mutex);
822 free(cam_idle_event);
823 cam_idle_event = NULL;
825 LOGD("remove idle event done");
828 LOGW("event lock failed. it's being called...");
830 end_time = g_get_monotonic_time () + G_TIME_SPAN_MILLISECOND * 100;
832 if (g_cond_wait_until(&cb_info->idle_event_cond, &cb_info->idle_event_mutex, end_time)) {
833 LOGW("signal received");
841 g_list_free(cb_info->idle_event_list);
842 cb_info->idle_event_list = NULL;
845 g_mutex_unlock(&cb_info->idle_event_mutex);
850 static void *_client_cb_handler(gpointer data)
858 callback_cb_info_s *cb_info = (callback_cb_info_s *)data;
859 char *recvMsg = NULL;
860 char **parseStr = NULL;
862 if (cb_info == NULL) {
863 LOGE("cb_info NULL");
869 parseStr = (char **)malloc(sizeof(char *) * CAMERA_PARSE_STRING_SIZE);
870 if (parseStr == NULL) {
871 LOGE("parseStr malloc failed");
875 for (i = 0 ; i < CAMERA_PARSE_STRING_SIZE ; i++) {
876 parseStr[i] = (char *)malloc(sizeof(char) * MUSE_CAMERA_MSG_MAX_LENGTH);
877 if (parseStr[i] == NULL) {
878 LOGE("parseStr[%d] malloc failed", i);
879 goto CB_HANDLER_EXIT;
883 recvMsg = cb_info->recvMsg;
885 while (g_atomic_int_get(&cb_info->rcv_thread_running)) {
886 ret = muse_core_ipc_recv_msg(cb_info->fd, recvMsg);
895 LOGD("recvMSg : %s, length : %d", recvMsg, ret);
897 /* Need to split the combined entering msgs.
898 This module supports up to 200 combined msgs. */
899 for (str_pos = 0; str_pos < ret; str_pos++) {
900 if(recvMsg[str_pos] == '}') {
901 memset(parseStr[num_token], 0x0, sizeof(char) * MUSE_CAMERA_MSG_MAX_LENGTH);
902 strncpy(parseStr[num_token], recvMsg + prev_pos, str_pos - prev_pos + 1);
903 LOGD("splitted msg : [%s], Index : %d", parseStr[num_token], num_token);
904 prev_pos = str_pos+1;
909 LOGD("num_token : %d", num_token);
911 /* Re-construct to the useful single msg. */
912 for (i = 0; i < num_token; i++) {
914 if (i >= CAMERA_PARSE_STRING_SIZE)
917 if (muse_camera_msg_get(api, parseStr[i])) {
918 if(api < MUSE_CAMERA_API_MAX){
919 LOGD("Set Condition - api %d", api);
920 g_mutex_lock(&(cb_info->pMutex[api]));
922 /* The api msgs should be distinguished from the event msg. */
923 memset(cb_info->recvApiMsg, 0, strlen(cb_info->recvApiMsg));
924 strcpy(cb_info->recvApiMsg, parseStr[i]);
925 LOGD("cb_info->recvApiMsg : [%s]", cb_info->recvApiMsg);
926 cb_info->activating[api] = 1;
927 g_cond_signal(&(cb_info->pCond[api]));
928 g_mutex_unlock(&(cb_info->pMutex[api]));
930 if (api == MUSE_CAMERA_API_CREATE) {
931 if (muse_camera_msg_get(ret, cb_info->recvApiMsg)) {
932 if (ret != CAMERA_ERROR_NONE) {
933 g_atomic_int_set(&cb_info->rcv_thread_running, 0);
934 LOGE("camera create error 0x%x. close client cb handler", ret);
937 LOGE("failed to get api return");
939 } else if (api == MUSE_CAMERA_API_DESTROY) {
940 if (muse_camera_msg_get(ret, cb_info->recvApiMsg)) {
941 if (ret == CAMERA_ERROR_NONE) {
942 g_atomic_int_set(&cb_info->rcv_thread_running, 0);
943 LOGD("camera destroy done. close client cb handler");
946 LOGE("failed to get api return");
949 } else if(api == MUSE_CAMERA_CB_EVENT) {
952 camera_event_s *cam_event = NULL;
953 camera_idle_event_s *cam_idle_event = NULL;
955 if (!muse_camera_msg_get(event, parseStr[i]) ||
956 !muse_camera_msg_get(class, parseStr[i])) {
957 LOGE("failed to get event %d, class %d", event, class);
962 case MUSE_CAMERA_EVENT_CLASS_NORMAL:
963 cam_event = (camera_event_s *)malloc(sizeof(camera_event_s));
965 cam_event->event = event;
966 cam_event->cb_info = cb_info;
967 memcpy(cam_event->recvMsg, recvMsg, sizeof(cam_event->recvMsg));
969 LOGD("add event to EVENT QUEUE : %d", event);
970 g_mutex_lock(&cb_info->event_mutex);
971 g_queue_push_tail(cb_info->event_queue, (gpointer)cam_event);
972 g_cond_signal(&cb_info->event_cond);
973 g_mutex_unlock(&cb_info->event_mutex);
975 LOGE("cam_event alloc failed");
978 case MUSE_CAMERA_EVENT_CLASS_IMMEDIATE:
979 _client_user_callback(cb_info, recvMsg, event);
981 case MUSE_CAMERA_EVENT_CLASS_MAIN_THREAD:
982 cam_idle_event = (camera_idle_event_s *)malloc(sizeof(camera_idle_event_s));
983 if (cam_idle_event) {
984 cam_idle_event->event = event;
985 cam_idle_event->cb_info = cb_info;
986 g_mutex_init(&cam_idle_event->event_mutex);
987 memcpy(cam_idle_event->recvMsg, recvMsg, sizeof(cam_idle_event->recvMsg));
989 LOGD("add event[%d] to IDLE %p", event, cam_idle_event);
991 g_mutex_lock(&cb_info->idle_event_mutex);
992 cb_info->idle_event_list = g_list_append(cb_info->idle_event_list, (gpointer)cam_idle_event);
993 /*LOGD("add idle event %p, %p", cam_idle_event, cb_info->idle_event_list);*/
994 g_mutex_unlock(&cb_info->idle_event_mutex);
996 g_idle_add_full(G_PRIORITY_DEFAULT,
997 (GSourceFunc)_camera_idle_event_callback,
998 (gpointer)cam_idle_event,
1001 LOGE("cam_idle_event alloc failed");
1005 LOGE("unknown class %d", class);
1009 LOGW("unknown api : %d", api);
1012 LOGE("Get Msg Failed");
1018 LOGD("client cb exit");
1022 for (i = 0 ; i < CAMERA_PARSE_STRING_SIZE ; i++) {
1036 static callback_cb_info_s *_client_callback_new(gint sockfd)
1038 callback_cb_info_s *cb_info;
1040 GMutex *camera_mutex;
1042 g_return_val_if_fail(sockfd > 0, NULL);
1044 cb_info = g_new0(callback_cb_info_s, 1);
1045 camera_cond = g_new0(GCond, MUSE_CAMERA_API_MAX);
1046 camera_mutex = g_new0(GMutex, MUSE_CAMERA_API_MAX);
1047 camera_activ = g_new0(gint, MUSE_CAMERA_API_MAX);
1049 g_atomic_int_set(&cb_info->rcv_thread_running, 1);
1050 cb_info->fd = sockfd;
1051 cb_info->pCond = camera_cond;
1052 cb_info->pMutex = camera_mutex;
1053 cb_info->activating = camera_activ;
1054 cb_info->msg_rcv_thread = g_thread_new("msg_rcv_thread", _client_cb_handler, (gpointer)cb_info);
1056 g_atomic_int_set(&cb_info->event_thread_running, 1);
1057 g_mutex_init(&cb_info->event_mutex);
1058 g_cond_init(&cb_info->event_cond);
1059 g_mutex_init(&cb_info->idle_event_mutex);
1060 g_cond_init(&cb_info->idle_event_cond);
1061 cb_info->event_queue = g_queue_new();
1062 cb_info->event_thread = g_thread_new("event_thread", _event_handler, (gpointer)cb_info);
1067 static void _client_callback_destroy(callback_cb_info_s * cb_info)
1069 g_return_if_fail(cb_info != NULL);
1071 LOGI("MSG receive thread[%p] destroy", cb_info->msg_rcv_thread);
1073 g_thread_join(cb_info->msg_rcv_thread);
1074 g_thread_unref(cb_info->msg_rcv_thread);
1075 cb_info->msg_rcv_thread = NULL;
1077 LOGD("msg thread removed");
1079 g_mutex_lock(&cb_info->event_mutex);
1080 g_atomic_int_set(&cb_info->event_thread_running, 0);
1081 g_cond_signal(&cb_info->event_cond);
1082 g_mutex_unlock(&cb_info->event_mutex);
1084 g_thread_join(cb_info->event_thread);
1085 g_thread_unref(cb_info->event_thread);
1086 cb_info->event_thread = NULL;
1088 g_queue_free(cb_info->event_queue);
1089 cb_info->event_queue = NULL;
1090 g_mutex_clear(&cb_info->event_mutex);
1091 g_cond_clear(&cb_info->event_cond);
1092 g_mutex_clear(&cb_info->idle_event_mutex);
1093 g_cond_clear(&cb_info->idle_event_cond);
1095 LOGD("event thread removed");
1097 if (cb_info->bufmgr) {
1098 tbm_bufmgr_deinit(cb_info->bufmgr);
1099 cb_info->bufmgr = NULL;
1102 if (cb_info->pCond) {
1103 g_free(cb_info->pCond);
1105 if (cb_info->pMutex) {
1106 g_free(cb_info->pMutex);
1108 if (cb_info->activating) {
1109 g_free(cb_info->activating);
1117 int camera_create(camera_device_e device, camera_h* camera)
1121 int ret = CAMERA_ERROR_NONE;
1123 camera_cli_s *pc = NULL;
1124 tbm_bufmgr bufmgr = NULL;
1126 muse_camera_api_e api = MUSE_CAMERA_API_CREATE;
1127 muse_core_api_module_e muse_module = MUSE_CAMERA;
1128 int device_type = (int)device;
1130 if (camera == NULL){
1131 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1132 return CAMERA_ERROR_INVALID_PARAMETER;
1135 bufmgr = tbm_bufmgr_init(-1);
1136 if (bufmgr == NULL) {
1137 LOGE("get tbm bufmgr failed");
1138 return CAMERA_ERROR_INVALID_OPERATION;
1141 sock_fd = muse_core_client_new();
1143 LOGE("muse_core_client_new failed - returned fd %d", sock_fd);
1144 ret = CAMERA_ERROR_INVALID_OPERATION;
1150 sndMsg = muse_core_msg_json_factory_new(api,
1151 MUSE_TYPE_INT, "module", muse_module,
1152 MUSE_TYPE_INT, PARAM_DEVICE_TYPE, device_type,
1153 MUSE_TYPE_INT, "pid", pid,
1156 muse_core_ipc_send_msg(sock_fd, sndMsg);
1157 muse_core_msg_json_factory_free(sndMsg);
1159 pc = g_new0(camera_cli_s, 1);
1161 ret = CAMERA_ERROR_OUT_OF_MEMORY;
1165 pc->cb_info = _client_callback_new(sock_fd);
1167 LOGD("cb info : %d", pc->cb_info->fd);
1169 ret = _client_wait_for_cb_return(api, pc->cb_info, CALLBACK_TIME_OUT);
1170 if (ret == CAMERA_ERROR_NONE) {
1171 intptr_t handle = 0;
1172 muse_camera_msg_get_pointer(handle, pc->cb_info->recvMsg);
1174 LOGE("Receiving Handle Failed!!");
1175 ret = CAMERA_ERROR_INVALID_OPERATION;
1179 pc->remote_handle = handle;
1180 pc->cb_info->bufmgr = bufmgr;
1182 LOGD("camera create 0x%x", pc->remote_handle);
1183 *camera = (camera_h) pc;
1191 tbm_bufmgr_deinit(bufmgr);
1195 _client_callback_destroy(pc->cb_info);
1201 LOGE("camera create error : 0x%x", ret);
1206 int camera_destroy(camera_h camera)
1208 if (camera == NULL) {
1209 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1210 return CAMERA_ERROR_INVALID_PARAMETER;
1213 int ret = CAMERA_ERROR_NONE;
1214 muse_camera_api_e api = MUSE_CAMERA_API_DESTROY;
1215 camera_cli_s *pc = (camera_cli_s *)camera;
1216 int sock_fd = pc->cb_info->fd;
1220 LOGE("pc is already nul!!");
1221 return CAMERA_ERROR_INVALID_PARAMETER;
1222 } else if (pc->cb_info == NULL) {
1223 return CAMERA_ERROR_INVALID_PARAMETER;
1226 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1227 if (ret == CAMERA_ERROR_NONE) {
1228 if (pc->client_handle) {
1229 mm_camcorder_client_destroy(pc->client_handle);
1230 pc->client_handle = NULL;
1232 _camera_remove_idle_event_all(pc->cb_info);
1233 _client_callback_destroy(pc->cb_info);
1236 g_free(pc->wl_info);
1243 LOGE("camera destroy error : 0x%x", ret);
1249 int camera_start_preview(camera_h camera)
1251 int ret = CAMERA_ERROR_NONE;
1252 muse_camera_api_e api = MUSE_CAMERA_API_START_PREVIEW;
1253 camera_cli_s *pc = (camera_cli_s *)camera;
1255 int prev_state = CAMERA_STATE_NONE;
1256 char caps[MUSE_CAMERA_MSG_MAX_LENGTH] = {0};
1258 if (camera == NULL) {
1259 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1260 return CAMERA_ERROR_INVALID_PARAMETER;
1263 if (pc->cb_info == NULL) {
1264 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1265 return CAMERA_ERROR_INVALID_PARAMETER;
1270 sock_fd = pc->cb_info->fd;
1272 if (pc->client_handle == NULL) {
1273 LOGW("set display is not called by application. set NONE type internally");
1274 ret = camera_set_display(camera, CAMERA_DISPLAY_TYPE_NONE, NULL);
1275 if (ret != CAMERA_ERROR_NONE) {
1276 LOGE("Internal camera_set_display failed 0x%x", ret);
1281 muse_camera_msg_send_longtime(api, sock_fd, pc->cb_info, ret);
1283 if (ret != CAMERA_ERROR_NONE) {
1284 LOGE("start preview failed 0x%x", ret);
1288 muse_camera_msg_get(prev_state, pc->cb_info->recvMsg);
1290 if (prev_state == CAMERA_STATE_CREATED) {
1291 muse_camera_msg_get_string(caps, pc->cb_info->recvMsg);
1293 LOGE("failed to get caps string");
1294 goto _START_PREVIEW_ERROR;
1297 LOGD("caps : %s", caps);
1299 ret = mm_camcorder_client_realize(pc->client_handle, caps);
1300 if (ret != MM_ERROR_NONE) {
1301 LOGE("client realize failed 0x%x", ret);
1302 goto _START_PREVIEW_ERROR;
1306 LOGD("ret : 0x%x", ret);
1308 return CAMERA_ERROR_NONE;
1310 _START_PREVIEW_ERROR:
1311 muse_camera_msg_send_longtime(MUSE_CAMERA_API_STOP_PREVIEW, sock_fd, pc->cb_info, ret);
1313 return CAMERA_ERROR_INVALID_OPERATION;
1316 int camera_stop_preview(camera_h camera)
1318 if (camera == NULL) {
1319 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1320 return CAMERA_ERROR_INVALID_PARAMETER;
1322 int ret = CAMERA_ERROR_NONE;
1323 camera_cli_s *pc = (camera_cli_s *)camera;
1325 muse_camera_api_e api = MUSE_CAMERA_API_STOP_PREVIEW;
1327 if (pc->cb_info == NULL) {
1328 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1329 return CAMERA_ERROR_INVALID_PARAMETER;
1332 sock_fd = pc->cb_info->fd;
1334 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1336 if (ret != CAMERA_ERROR_NONE) {
1337 LOGE("stop preview failed 0x%x", ret);
1341 if (pc->client_handle != NULL) {
1342 if (mm_camcorder_client_unrealize(pc->client_handle) == MM_ERROR_NONE) {
1343 LOGD("client unrealize done");
1345 LOGE("client unrealize failed. restart preview...");
1346 muse_camera_msg_send_longtime(MUSE_CAMERA_API_START_PREVIEW, sock_fd, pc->cb_info, ret);
1347 return CAMERA_ERROR_INVALID_OPERATION;
1350 LOGW("client handle is NULL");
1353 LOGD("ret : 0x%x", ret);
1358 int camera_start_capture(camera_h camera, camera_capturing_cb capturing_cb, camera_capture_completed_cb completed_cb, void *user_data)
1360 if (camera == NULL) {
1361 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1362 return CAMERA_ERROR_INVALID_PARAMETER;
1364 int ret = CAMERA_ERROR_NONE;
1366 camera_cli_s *pc = (camera_cli_s *)camera;
1367 muse_camera_api_e api = MUSE_CAMERA_API_START_CAPTURE;
1369 int is_capturing_cb = 0;
1370 int is_completed_cb = 0;
1371 LOGD("Enter, handle :%x", pc->remote_handle);
1373 if (pc->cb_info == NULL) {
1374 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1375 return CAMERA_ERROR_INVALID_PARAMETER;
1378 sock_fd = pc->cb_info->fd;
1380 if (capturing_cb != NULL) {
1381 is_capturing_cb = 1;
1382 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_CAPTURE] = capturing_cb;
1383 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_CAPTURE] = user_data;
1386 if(completed_cb != NULL) {
1387 is_completed_cb = 1;
1388 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_CAPTURE_COMPLETE] = completed_cb;
1389 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_CAPTURE_COMPLETE] = user_data;
1392 muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret, INT, is_capturing_cb, INT, is_completed_cb);
1393 LOGD("is_capturing_cb :%d, is_completed_cb : %d", is_capturing_cb, is_completed_cb);
1394 LOGD("ret : 0x%x", ret);
1398 bool camera_is_supported_continuous_capture(camera_h camera)
1400 if (camera == NULL) {
1401 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1405 int ret = CAMERA_ERROR_NONE;
1406 camera_cli_s *pc = (camera_cli_s *)camera;
1407 muse_camera_api_e api = MUSE_CAMERA_API_SUPPORT_CONTINUOUS_CAPTURE;
1410 if (pc->cb_info == NULL) {
1411 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1412 return CAMERA_ERROR_INVALID_PARAMETER;
1415 sock_fd = pc->cb_info->fd;
1417 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1418 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1419 LOGD("ret : 0x%x", ret);
1423 int camera_start_continuous_capture(camera_h camera, int count, int interval, camera_capturing_cb capturing_cb, camera_capture_completed_cb completed_cb , void *user_data)
1425 if (camera == NULL) {
1426 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
1427 return CAMERA_ERROR_INVALID_PARAMETER;
1430 int ret = CAMERA_ERROR_NONE;
1432 camera_cli_s *pc = (camera_cli_s *)camera;
1433 muse_camera_api_e api = MUSE_CAMERA_API_START_CONTINUOUS_CAPTURE;
1435 LOGD("Enter, handle :%x", pc->remote_handle);
1438 if (pc->cb_info == NULL) {
1439 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1440 return CAMERA_ERROR_INVALID_PARAMETER;
1442 sock_fd = pc->cb_info->fd;
1444 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_CAPTURE] = capturing_cb;
1445 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_CAPTURE] = user_data;
1446 pc->cb_info->user_cb_completed[MUSE_CAMERA_EVENT_TYPE_CAPTURE] = completed_cb;
1448 muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret, INT, count, INT, interval);
1449 LOGD("ret : 0x%x", ret);
1453 int camera_stop_continuous_capture(camera_h camera)
1455 if (camera == NULL) {
1456 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1457 return CAMERA_ERROR_INVALID_PARAMETER;
1461 int ret = CAMERA_ERROR_NONE;
1463 camera_cli_s *pc = (camera_cli_s *)camera;
1464 muse_camera_api_e api = MUSE_CAMERA_API_STOP_CONTINUOUS_CAPTURE;
1465 LOGD("Enter, handle :%x", pc->remote_handle);
1467 if (pc->cb_info == NULL) {
1468 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1469 return CAMERA_ERROR_INVALID_PARAMETER;
1471 sock_fd = pc->cb_info->fd;
1472 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1473 LOGD("ret : 0x%x", ret);
1477 bool camera_is_supported_face_detection(camera_h camera)
1479 if (camera == NULL) {
1480 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1483 int ret = CAMERA_ERROR_NONE;
1485 camera_cli_s *pc = (camera_cli_s *)camera;
1486 muse_camera_api_e api = MUSE_CAMERA_API_SUPPORT_FACE_DETECTION;
1488 if (pc->cb_info == NULL) {
1489 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1490 return CAMERA_ERROR_INVALID_PARAMETER;
1492 sock_fd = pc->cb_info->fd;
1494 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1495 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1496 LOGD("ret : 0x%x", ret);
1500 bool camera_is_supported_zero_shutter_lag(camera_h camera)
1502 if (camera == NULL) {
1503 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1506 int ret = CAMERA_ERROR_NONE;
1508 camera_cli_s *pc = (camera_cli_s *)camera;
1509 muse_camera_api_e api = MUSE_CAMERA_API_SUPPORT_ZERO_SHUTTER_LAG;
1511 if (pc->cb_info == NULL) {
1512 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1513 return CAMERA_ERROR_INVALID_PARAMETER;
1515 sock_fd = pc->cb_info->fd;
1517 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1518 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1519 LOGD("ret : 0x%x", ret);
1523 bool camera_is_supported_media_packet_preview_cb(camera_h camera)
1525 if (camera == NULL) {
1526 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1530 int ret = CAMERA_ERROR_NONE;
1532 camera_cli_s *pc = (camera_cli_s *)camera;
1533 muse_camera_api_e api = MUSE_CAMERA_API_SUPPORT_MEDIA_PACKET_PREVIEW_CB;
1535 if (pc->cb_info == NULL) {
1536 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1537 return CAMERA_ERROR_INVALID_PARAMETER;
1539 sock_fd = pc->cb_info->fd;
1541 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1542 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1543 LOGD("ret : 0x%x", ret);
1547 int camera_get_device_count(camera_h camera, int *device_count)
1549 if (camera == NULL || device_count == NULL) {
1550 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
1551 return CAMERA_ERROR_INVALID_PARAMETER;
1553 int ret = CAMERA_ERROR_NONE;
1555 camera_cli_s *pc = (camera_cli_s *)camera;
1556 muse_camera_api_e api = MUSE_CAMERA_API_GET_DEVICE_COUNT;
1558 if (pc->cb_info == NULL) {
1559 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1560 return CAMERA_ERROR_INVALID_PARAMETER;
1562 sock_fd = pc->cb_info->fd;
1563 int get_device_count;
1565 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1566 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1568 if (ret == CAMERA_ERROR_NONE) {
1569 muse_camera_msg_get(get_device_count, pc->cb_info->recvMsg);
1570 *device_count = get_device_count;
1572 LOGD("ret : 0x%x", ret);
1576 int camera_start_face_detection(camera_h camera, camera_face_detected_cb callback, void * user_data)
1578 if (camera == NULL) {
1579 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
1580 return CAMERA_ERROR_INVALID_PARAMETER;
1583 int ret = CAMERA_ERROR_NONE;
1585 camera_cli_s *pc = (camera_cli_s *)camera;
1586 muse_camera_api_e api = MUSE_CAMERA_API_START_FACE_DETECTION;
1588 LOGD("Enter, handle :%x", pc->remote_handle);
1590 if (pc->cb_info == NULL) {
1591 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1592 return CAMERA_ERROR_INVALID_PARAMETER;
1594 sock_fd = pc->cb_info->fd;
1595 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FACE_DETECTION] = callback;
1596 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FACE_DETECTION] = user_data;
1598 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1599 LOGD("ret : 0x%x", ret);
1603 int camera_stop_face_detection(camera_h camera)
1605 if (camera == NULL) {
1606 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1607 return CAMERA_ERROR_INVALID_PARAMETER;
1610 int ret = CAMERA_ERROR_NONE;
1612 camera_cli_s *pc = (camera_cli_s *)camera;
1613 muse_camera_api_e api = MUSE_CAMERA_API_STOP_FACE_DETECTION;
1614 LOGD("Enter, handle :%x", pc->remote_handle);
1616 if (pc->cb_info == NULL) {
1617 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1618 return CAMERA_ERROR_INVALID_PARAMETER;
1620 sock_fd = pc->cb_info->fd;
1621 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1622 LOGD("ret : 0x%x", ret);
1626 int camera_get_state(camera_h camera, camera_state_e * state)
1628 if (camera == NULL || state == NULL) {
1629 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1630 return CAMERA_ERROR_INVALID_PARAMETER;
1632 int ret = CAMERA_ERROR_NONE;
1634 camera_cli_s *pc = (camera_cli_s *)camera;
1635 muse_camera_api_e api = MUSE_CAMERA_API_GET_STATE;
1637 if (pc->cb_info == NULL) {
1638 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1639 return CAMERA_ERROR_INVALID_PARAMETER;
1641 sock_fd = pc->cb_info->fd;
1644 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1645 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1647 if (ret == CAMERA_ERROR_NONE) {
1648 muse_camera_msg_get(get_state, pc->cb_info->recvMsg);
1649 *state = (camera_state_e)get_state;
1651 LOGD("ret : 0x%x", ret);
1655 int camera_start_focusing(camera_h camera, bool continuous)
1657 if( camera == NULL){
1658 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1659 return CAMERA_ERROR_INVALID_PARAMETER;
1662 int ret = CAMERA_ERROR_NONE;
1664 camera_cli_s *pc = (camera_cli_s *)camera;
1665 muse_camera_api_e api = MUSE_CAMERA_API_START_FOCUSING;
1667 if (pc->cb_info == NULL) {
1668 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1669 return CAMERA_ERROR_INVALID_PARAMETER;
1671 sock_fd = pc->cb_info->fd;
1672 int is_continuous = (int)continuous;
1674 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1675 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, is_continuous);
1676 LOGD("ret : 0x%x", ret);
1680 int camera_cancel_focusing(camera_h camera)
1682 if (camera == NULL) {
1683 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1684 return CAMERA_ERROR_INVALID_PARAMETER;
1687 int ret = CAMERA_ERROR_NONE;
1689 camera_cli_s *pc = (camera_cli_s *)camera;
1690 muse_camera_api_e api = MUSE_CAMERA_API_CANCEL_FOCUSING;
1692 if (pc->cb_info == NULL) {
1693 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1694 return CAMERA_ERROR_INVALID_PARAMETER;
1696 sock_fd = pc->cb_info->fd;
1698 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1699 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1700 LOGD("ret : 0x%x", ret);
1704 int camera_set_display(camera_h camera, camera_display_type_e type, camera_display_h display)
1706 int ret = CAMERA_ERROR_NONE;
1707 void *set_display_handle = NULL;
1708 int set_surface = MM_DISPLAY_SURFACE_X;
1709 Evas_Object *obj = NULL;
1710 const char *object_type = NULL;
1711 char socket_path[MUSE_CAMERA_MSG_MAX_LENGTH] = {0,};
1713 MMCamWaylandInfo *wl_info = NULL;
1714 #endif /* HAVE_WAYLAND */
1716 if (camera == NULL) {
1717 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
1718 return CAMERA_ERROR_INVALID_PARAMETER;
1721 if (type != CAMERA_DISPLAY_TYPE_NONE && display == NULL) {
1722 LOGE("display type[%d] is not NONE, but display handle is NULL", type);
1723 return CAMERA_ERROR_INVALID_PARAMETER;
1726 camera_cli_s *pc = (camera_cli_s *)camera;
1727 muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY;
1729 if (pc->cb_info == NULL) {
1730 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1731 return CAMERA_ERROR_INVALID_PARAMETER;
1733 sock_fd = pc->cb_info->fd;
1735 LOGD("Enter, remote_handle : %x display : 0x%x", pc->remote_handle, display);
1737 if (type == CAMERA_DISPLAY_TYPE_NONE) {
1738 set_display_handle = 0;
1739 set_surface = MM_DISPLAY_SURFACE_NULL;
1740 LOGD("display type NONE");
1742 obj = (Evas_Object *)display;
1743 object_type = evas_object_type_get(obj);
1745 if (type == CAMERA_DISPLAY_TYPE_OVERLAY && !strcmp(object_type, "elm_win")) {
1747 /* set wayland info */
1748 wl_info = _get_wl_info(obj);
1749 if (wl_info == NULL) {
1750 LOGE("failed to get wl_info");
1751 return CAMERA_ERROR_INVALID_OPERATION;
1754 set_display_handle = (void *)wl_info;
1755 #else /* HAVE_WAYLAND */
1756 /* x window overlay surface */
1757 set_display_handle = (void *)elm_win_xwindow_get(obj);
1759 set_surface = MM_DISPLAY_SURFACE_X;
1760 LOGD("display type OVERLAY : handle %p", set_display_handle);
1761 } else if (type == CAMERA_DISPLAY_TYPE_EVAS && !strcmp(object_type, "image")) {
1762 /* evas object surface */
1763 set_display_handle = (void *)display;
1764 set_surface = MM_DISPLAY_SURFACE_EVAS;
1765 LOGD("display type EVAS : handle %p", set_display_handle);
1767 LOGE("unknown evas object [%p,%s] or type [%d] mismatch", obj, object_type, type);
1768 return CAMERA_ERROR_INVALID_PARAMETER;
1771 LOGE("failed to get evas object type from %p", obj);
1772 return CAMERA_ERROR_INVALID_PARAMETER;
1776 pc->cli_display_handle = (intptr_t)set_display_handle;
1778 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1780 if (ret == CAMERA_ERROR_NONE) {
1781 if (pc->client_handle == NULL) {
1782 ret = mm_camcorder_client_create(&pc->client_handle);
1783 if (ret != MM_ERROR_NONE) {
1784 LOGE("camera client create Failed 0x%x", ret);
1785 goto _SET_DISPLAY_ERROR;
1789 muse_camera_msg_get_string(socket_path, pc->cb_info->recvMsg);
1790 if (socket_path == NULL) {
1791 LOGE("failed to get socket path");
1792 goto _SET_DISPLAY_ERROR;
1795 LOGD("shmsrc socket path : %s", socket_path);
1797 ret = mm_camcorder_client_set_shm_socket_path(pc->client_handle, socket_path);
1798 if (ret != MM_ERROR_NONE) {
1799 LOGE("failed to set socket path 0x%x", ret);
1800 goto _SET_DISPLAY_ERROR;
1803 ret = mm_camcorder_set_attributes(pc->client_handle, NULL,
1804 MMCAM_DISPLAY_SURFACE, set_surface,
1806 if (ret != MM_ERROR_NONE) {
1807 LOGE("set display surface failed 0x%x", ret);
1808 goto _SET_DISPLAY_ERROR;
1811 if (type != CAMERA_DISPLAY_TYPE_NONE) {
1812 ret = mm_camcorder_set_attributes(pc->client_handle, NULL,
1813 MMCAM_DISPLAY_HANDLE, set_display_handle, sizeof(void *),
1815 if (ret != MM_ERROR_NONE) {
1816 LOGE("set display handle failed 0x%x", ret);
1817 goto _SET_DISPLAY_ERROR;
1822 g_free(pc->wl_info);
1826 pc->wl_info = wl_info;
1828 return CAMERA_ERROR_NONE;;
1830 LOGE("set display error - 0x%x");
1840 return __convert_camera_error_code(__func__, ret);
1843 int camera_set_preview_resolution(camera_h camera, int width, int height)
1845 if( camera == NULL){
1846 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1847 return CAMERA_ERROR_INVALID_PARAMETER;
1849 int ret = CAMERA_ERROR_NONE;
1851 camera_cli_s *pc = (camera_cli_s *)camera;
1852 muse_camera_api_e api = MUSE_CAMERA_API_SET_PREVIEW_RESOLUTION;
1854 if (pc->cb_info == NULL) {
1855 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1856 return CAMERA_ERROR_INVALID_PARAMETER;
1858 sock_fd = pc->cb_info->fd;
1860 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1861 muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret, INT, width, INT, height);
1862 LOGD("ret : 0x%x", ret);
1867 int camera_set_capture_resolution(camera_h camera, int width, int height)
1869 if (camera == NULL) {
1870 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1871 return CAMERA_ERROR_INVALID_PARAMETER;
1874 int ret = CAMERA_ERROR_NONE;
1876 camera_cli_s *pc = (camera_cli_s *)camera;
1877 muse_camera_api_e api = MUSE_CAMERA_API_SET_CAPTURE_RESOLUTION;
1879 if (pc->cb_info == NULL) {
1880 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1881 return CAMERA_ERROR_INVALID_PARAMETER;
1883 sock_fd = pc->cb_info->fd;
1885 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1886 muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret, INT, width, INT, height);
1887 LOGD("ret : 0x%x", ret);
1891 int camera_set_capture_format(camera_h camera, camera_pixel_format_e format)
1893 if (camera == NULL) {
1894 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1895 return CAMERA_ERROR_INVALID_PARAMETER;
1898 int ret = CAMERA_ERROR_NONE;
1899 int set_format = (int)format;
1901 camera_cli_s *pc = (camera_cli_s *)camera;
1902 muse_camera_api_e api = MUSE_CAMERA_API_SET_CAPTURE_FORMAT;
1904 if (pc->cb_info == NULL) {
1905 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1906 return CAMERA_ERROR_INVALID_PARAMETER;
1908 sock_fd = pc->cb_info->fd;
1910 LOGD("Enter, remote_handle : %x, capture_format: %d", pc->remote_handle, set_format);
1911 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_format);
1912 LOGD("ret : 0x%x", ret);
1916 int camera_set_preview_format(camera_h camera, camera_pixel_format_e format)
1918 if (camera == NULL) {
1919 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1920 return CAMERA_ERROR_INVALID_PARAMETER;
1923 int ret = CAMERA_ERROR_NONE;
1924 int set_format = (int)format;
1926 camera_cli_s *pc = (camera_cli_s *)camera;
1927 muse_camera_api_e api = MUSE_CAMERA_API_SET_PREVIEW_FORMAT;
1929 if (pc->cb_info == NULL) {
1930 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1931 return CAMERA_ERROR_INVALID_PARAMETER;
1933 sock_fd = pc->cb_info->fd;
1935 LOGD("Enter, remote_handle : %x, capture_format: %d", pc->remote_handle, set_format);
1936 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_format);
1937 LOGD("ret : 0x%x", ret);
1941 int camera_get_preview_resolution(camera_h camera, int *width, int *height)
1943 if (camera == NULL || width == NULL || height == NULL) {
1944 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1945 return CAMERA_ERROR_INVALID_PARAMETER;
1949 int ret = CAMERA_ERROR_NONE;
1951 camera_cli_s *pc = (camera_cli_s *)camera;
1952 muse_camera_api_e api = MUSE_CAMERA_API_GET_PREVIEW_RESOLUTION;
1954 if (pc->cb_info == NULL) {
1955 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1956 return CAMERA_ERROR_INVALID_PARAMETER;
1958 sock_fd = pc->cb_info->fd;
1962 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1963 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1965 if (ret == CAMERA_ERROR_NONE) {
1966 muse_camera_msg_get(get_width, pc->cb_info->recvMsg);
1967 muse_camera_msg_get(get_height, pc->cb_info->recvMsg);
1969 *height = get_height;
1971 LOGD("ret : 0x%x", ret);
1975 int camera_set_display_rotation(camera_h camera, camera_rotation_e rotation)
1977 if( camera == NULL){
1978 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1979 return CAMERA_ERROR_INVALID_PARAMETER;
1982 int ret = CAMERA_ERROR_NONE;
1983 camera_cli_s *pc = (camera_cli_s *)camera;
1984 muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY_ROTATION;
1986 if (pc->cb_info == NULL) {
1987 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1988 return CAMERA_ERROR_INVALID_PARAMETER;
1990 sock_fd = pc->cb_info->fd;
1991 int set_rotation = (int)rotation;
1993 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1994 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_rotation);
1995 LOGD("ret : 0x%x", ret);
1999 int camera_get_display_rotation(camera_h camera, camera_rotation_e *rotation)
2001 if( camera == NULL || rotation == NULL ){
2002 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2003 return CAMERA_ERROR_INVALID_PARAMETER;
2006 int ret = CAMERA_ERROR_NONE;
2008 camera_cli_s *pc = (camera_cli_s *)camera;
2009 muse_camera_api_e api = MUSE_CAMERA_API_GET_DISPLAY_ROTATION;
2011 if (pc->cb_info == NULL) {
2012 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2013 return CAMERA_ERROR_INVALID_PARAMETER;
2015 sock_fd = pc->cb_info->fd;
2018 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2019 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2021 if (ret == CAMERA_ERROR_NONE) {
2022 muse_camera_msg_get(get_rotation, pc->cb_info->recvMsg);
2023 *rotation = (camera_rotation_e)get_rotation;
2025 LOGD("ret : 0x%x", ret);
2029 int camera_set_display_flip(camera_h camera, camera_flip_e flip)
2031 if( camera == NULL){
2032 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2033 return CAMERA_ERROR_INVALID_PARAMETER;
2036 int ret = CAMERA_ERROR_NONE;
2038 camera_cli_s *pc = (camera_cli_s *)camera;
2039 muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY_FLIP;
2041 if (pc->cb_info == NULL) {
2042 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2043 return CAMERA_ERROR_INVALID_PARAMETER;
2045 sock_fd = pc->cb_info->fd;
2046 int set_flip = (int)flip;
2048 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2049 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_flip);
2050 LOGD("ret : 0x%x", ret);
2054 int camera_get_display_flip(camera_h camera, camera_flip_e *flip)
2056 if( camera == NULL || flip == NULL ){
2057 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2058 return CAMERA_ERROR_INVALID_PARAMETER;
2061 int ret = CAMERA_ERROR_NONE;
2063 camera_cli_s *pc = (camera_cli_s *)camera;
2064 muse_camera_api_e api = MUSE_CAMERA_API_GET_DISPLAY_FLIP;
2066 if (pc->cb_info == NULL) {
2067 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2068 return CAMERA_ERROR_INVALID_PARAMETER;
2070 sock_fd = pc->cb_info->fd;
2073 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2074 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2076 if (ret == CAMERA_ERROR_NONE) {
2077 muse_camera_msg_get(get_flip, pc->cb_info->recvMsg);
2078 *flip = (camera_flip_e)get_flip;
2080 LOGD("ret : 0x%x", ret);
2084 int camera_set_display_visible(camera_h camera, bool visible)
2086 if( camera == NULL){
2087 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2088 return CAMERA_ERROR_INVALID_PARAMETER;
2091 int ret = CAMERA_ERROR_NONE;
2093 camera_cli_s *pc = (camera_cli_s *)camera;
2094 muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY_VISIBLE;
2095 int set_visible = (int)visible;
2097 if (pc->cb_info == NULL) {
2098 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2099 return CAMERA_ERROR_INVALID_PARAMETER;
2101 sock_fd = pc->cb_info->fd;
2103 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2104 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_visible);
2105 LOGD("ret : 0x%x", ret);
2109 int camera_is_display_visible(camera_h camera, bool* visible)
2111 if( camera == NULL || visible == NULL){
2112 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2113 return CAMERA_ERROR_INVALID_PARAMETER;
2116 int ret = CAMERA_ERROR_NONE;
2118 camera_cli_s *pc = (camera_cli_s *)camera;
2119 muse_camera_api_e api = MUSE_CAMERA_API_IS_DISPLAY_VISIBLE;
2121 if (pc->cb_info == NULL) {
2122 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2123 return CAMERA_ERROR_INVALID_PARAMETER;
2125 sock_fd = pc->cb_info->fd;
2128 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2129 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2131 if (ret == CAMERA_ERROR_NONE) {
2132 muse_camera_msg_get(get_visible, pc->cb_info->recvMsg);
2133 *visible = (bool)get_visible;
2135 LOGD("ret : 0x%x", ret);
2139 int camera_set_display_mode(camera_h camera, camera_display_mode_e mode)
2141 if (camera == NULL) {
2142 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2143 return CAMERA_ERROR_INVALID_PARAMETER;
2146 int ret = CAMERA_ERROR_NONE;
2147 int set_mode = (int)mode;
2149 camera_cli_s *pc = (camera_cli_s *)camera;
2150 muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY_MODE;
2152 if (pc->cb_info == NULL) {
2153 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2154 return CAMERA_ERROR_INVALID_PARAMETER;
2156 sock_fd = pc->cb_info->fd;
2158 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2159 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
2160 LOGD("ret : 0x%x", ret);
2164 int camera_get_display_mode(camera_h camera, camera_display_mode_e* mode)
2166 if( camera == NULL || mode == NULL){
2167 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2168 return CAMERA_ERROR_INVALID_PARAMETER;
2171 int ret = CAMERA_ERROR_NONE;
2173 camera_cli_s *pc = (camera_cli_s *)camera;
2174 muse_camera_api_e api = MUSE_CAMERA_API_GET_DISPLAY_MODE;
2176 if (pc->cb_info == NULL) {
2177 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2178 return CAMERA_ERROR_INVALID_PARAMETER;
2180 sock_fd = pc->cb_info->fd;
2183 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2184 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2186 if (ret == CAMERA_ERROR_NONE) {
2187 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
2188 *mode = (camera_display_mode_e)get_mode;
2190 LOGD("ret : 0x%x", ret);
2194 int camera_get_capture_resolution(camera_h camera, int *width, int *height)
2196 if( camera == NULL || width== NULL || height == NULL){
2197 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2198 return CAMERA_ERROR_INVALID_PARAMETER;
2200 int ret = CAMERA_ERROR_NONE;
2202 camera_cli_s *pc = (camera_cli_s *)camera;
2203 muse_camera_api_e api = MUSE_CAMERA_API_GET_CAPTURE_RESOLUTION;
2205 if (pc->cb_info == NULL) {
2206 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2207 return CAMERA_ERROR_INVALID_PARAMETER;
2209 sock_fd = pc->cb_info->fd;
2213 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2214 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2216 if (ret == CAMERA_ERROR_NONE) {
2217 muse_camera_msg_get(get_width, pc->cb_info->recvMsg);
2218 muse_camera_msg_get(get_height, pc->cb_info->recvMsg);
2220 *height = get_height;
2222 LOGD("ret : 0x%x", ret);
2226 int camera_get_capture_format(camera_h camera, camera_pixel_format_e *format)
2228 if( camera == NULL || format == NULL){
2229 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2230 return CAMERA_ERROR_INVALID_PARAMETER;
2232 int ret = CAMERA_ERROR_NONE;
2234 camera_cli_s *pc = (camera_cli_s *)camera;
2235 muse_camera_api_e api = MUSE_CAMERA_API_GET_CAPTURE_FORMAT;
2238 if (pc->cb_info == NULL) {
2239 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2240 return CAMERA_ERROR_INVALID_PARAMETER;
2242 sock_fd = pc->cb_info->fd;
2244 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2245 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2247 if (ret == CAMERA_ERROR_NONE) {
2248 muse_camera_msg_get(get_format, pc->cb_info->recvMsg);
2249 *format = (camera_pixel_format_e)get_format;
2251 LOGD("ret : 0x%x", ret);
2255 int camera_get_preview_format(camera_h camera, camera_pixel_format_e *format)
2257 if( camera == NULL || format == NULL){
2258 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2259 return CAMERA_ERROR_INVALID_PARAMETER;
2262 int ret = CAMERA_ERROR_NONE;
2264 camera_cli_s *pc = (camera_cli_s *)camera;
2265 muse_camera_api_e api = MUSE_CAMERA_API_GET_PREVIEW_FORMAT;
2268 if (pc->cb_info == NULL) {
2269 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2270 return CAMERA_ERROR_INVALID_PARAMETER;
2272 sock_fd = pc->cb_info->fd;
2274 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2275 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2277 if (ret == CAMERA_ERROR_NONE) {
2278 muse_camera_msg_get(get_format, pc->cb_info->recvMsg);
2279 *format = (camera_pixel_format_e)get_format;
2281 LOGD("ret : 0x%x", ret);
2285 int camera_set_preview_cb(camera_h camera, camera_preview_cb callback, void* user_data)
2287 if (camera == NULL || callback == NULL) {
2288 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2289 return CAMERA_ERROR_INVALID_PARAMETER;
2291 int ret = CAMERA_ERROR_NONE;
2293 camera_cli_s *pc = (camera_cli_s *)camera;
2295 if (pc->cb_info == NULL) {
2296 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2297 return CAMERA_ERROR_INVALID_PARAMETER;
2299 sock_fd = pc->cb_info->fd;
2300 muse_camera_api_e api = MUSE_CAMERA_API_SET_PREVIEW_CB;
2302 LOGD("Enter, handle :%x", pc->remote_handle);
2304 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_PREVIEW] = callback;
2305 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_PREVIEW] = user_data;
2307 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2308 LOGD("ret : 0x%x", ret);
2312 int camera_unset_preview_cb(camera_h camera)
2314 if (camera == NULL) {
2315 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2316 return CAMERA_ERROR_INVALID_PARAMETER;
2319 int ret = CAMERA_ERROR_NONE;
2321 camera_cli_s *pc = (camera_cli_s *)camera;
2322 muse_camera_api_e api = MUSE_CAMERA_API_UNSET_PREVIEW_CB;
2324 LOGD("Enter, handle :%x", pc->remote_handle);
2327 if (pc->cb_info == NULL) {
2328 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2329 return CAMERA_ERROR_INVALID_PARAMETER;
2331 sock_fd = pc->cb_info->fd;
2332 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_PREVIEW] = (void *)NULL;
2333 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_PREVIEW] = (void *)NULL;
2335 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2336 LOGD("ret : 0x%x", ret);
2340 int camera_set_media_packet_preview_cb(camera_h camera, camera_media_packet_preview_cb callback, void* user_data)
2342 if (camera == NULL) {
2343 LOGE("INVALID_PARAMETER(0x%08x) - handle", CAMERA_ERROR_INVALID_PARAMETER);
2344 return CAMERA_ERROR_INVALID_PARAMETER;
2347 if (callback == NULL) {
2348 LOGE("INVALID_PARAMETER(0x%08x) - callback", CAMERA_ERROR_INVALID_PARAMETER);
2349 return CAMERA_ERROR_NOT_SUPPORTED;
2352 int ret = CAMERA_ERROR_NONE;
2354 camera_cli_s *pc = (camera_cli_s *)camera;
2355 muse_camera_api_e api = MUSE_CAMERA_API_SET_MEDIA_PACKET_PREVIEW_CB;
2357 LOGD("Enter, handle :%x", pc->remote_handle);
2360 if (pc->cb_info == NULL) {
2361 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2362 return CAMERA_ERROR_INVALID_PARAMETER;
2364 sock_fd = pc->cb_info->fd;
2365 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW] = callback;
2366 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW] = user_data;
2368 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2369 LOGD("ret : 0x%x", ret);
2373 int camera_unset_media_packet_preview_cb(camera_h camera)
2375 if (camera == NULL) {
2376 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
2377 return CAMERA_ERROR_INVALID_PARAMETER;
2380 int ret = CAMERA_ERROR_NONE;
2382 camera_cli_s *pc = (camera_cli_s *)camera;
2383 muse_camera_api_e api = MUSE_CAMERA_API_UNSET_MEDIA_PACKET_PREVIEW_CB;
2385 LOGD("Enter, handle :%x", pc->remote_handle);
2388 if (pc->cb_info == NULL) {
2389 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2390 return CAMERA_ERROR_INVALID_PARAMETER;
2392 sock_fd = pc->cb_info->fd;
2393 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW] = (void *)NULL;
2394 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW] = (void *)NULL;
2396 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2397 LOGD("ret : 0x%x", ret);
2401 int camera_set_state_changed_cb(camera_h camera, camera_state_changed_cb callback, void* user_data)
2403 if( camera == NULL || callback == NULL){
2404 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2405 return CAMERA_ERROR_INVALID_PARAMETER;
2407 int ret = CAMERA_ERROR_NONE;
2409 camera_cli_s *pc = (camera_cli_s *)camera;
2410 muse_camera_api_e api = MUSE_CAMERA_API_SET_STATE_CHANGED_CB;
2412 LOGD("Enter, handle :%x", pc->remote_handle);
2415 if (pc->cb_info == NULL) {
2416 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2417 return CAMERA_ERROR_INVALID_PARAMETER;
2419 sock_fd = pc->cb_info->fd;
2420 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_STATE_CHANGE] = callback;
2421 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_STATE_CHANGE] = user_data;
2423 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2424 LOGD("ret : 0x%x", ret);
2427 int camera_unset_state_changed_cb(camera_h camera)
2429 if( camera == NULL){
2430 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2431 return CAMERA_ERROR_INVALID_PARAMETER;
2433 int ret = CAMERA_ERROR_NONE;
2435 camera_cli_s *pc = (camera_cli_s *)camera;
2436 muse_camera_api_e api = MUSE_CAMERA_API_UNSET_STATE_CHANGED_CB;
2438 LOGD("Enter, handle :%x", pc->remote_handle);
2441 if (pc->cb_info == NULL) {
2442 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2443 return CAMERA_ERROR_INVALID_PARAMETER;
2445 sock_fd = pc->cb_info->fd;
2446 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_STATE_CHANGE] = (void *)NULL;
2447 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_STATE_CHANGE] = (void *)NULL;
2449 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2450 LOGD("ret : 0x%x", ret);
2454 int camera_set_interrupted_cb(camera_h camera, camera_interrupted_cb callback, void *user_data)
2456 if( camera == NULL || callback == NULL){
2457 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2458 return CAMERA_ERROR_INVALID_PARAMETER;
2460 int ret = CAMERA_ERROR_NONE;
2462 camera_cli_s *pc = (camera_cli_s *)camera;
2463 muse_camera_api_e api = MUSE_CAMERA_API_SET_INTERRUPTED_CB;
2465 LOGD("Enter, handle :%x", pc->remote_handle);
2468 if (pc->cb_info == NULL) {
2469 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2470 return CAMERA_ERROR_INVALID_PARAMETER;
2472 sock_fd = pc->cb_info->fd;
2473 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_INTERRUPTED] = callback;
2474 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_INTERRUPTED] = user_data;
2476 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2477 LOGD("ret : 0x%x", ret);
2481 int camera_unset_interrupted_cb(camera_h camera)
2483 if( camera == NULL){
2484 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2485 return CAMERA_ERROR_INVALID_PARAMETER;
2487 int ret = CAMERA_ERROR_NONE;
2489 camera_cli_s *pc = (camera_cli_s *)camera;
2490 muse_camera_api_e api = MUSE_CAMERA_API_UNSET_INTERRUPTED_CB;
2492 LOGD("Enter, handle :%x", pc->remote_handle);
2495 if (pc->cb_info == NULL) {
2496 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2497 return CAMERA_ERROR_INVALID_PARAMETER;
2499 sock_fd = pc->cb_info->fd;
2500 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_INTERRUPTED] = (void *)NULL;
2501 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_INTERRUPTED] = (void *)NULL;
2503 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2504 LOGD("ret : 0x%x", ret);
2508 int camera_set_focus_changed_cb(camera_h camera, camera_focus_changed_cb callback, void* user_data)
2510 if( camera == NULL || callback == NULL){
2511 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2512 return CAMERA_ERROR_INVALID_PARAMETER;
2514 int ret = CAMERA_ERROR_NONE;
2516 camera_cli_s *pc = (camera_cli_s *)camera;
2517 muse_camera_api_e api = MUSE_CAMERA_API_SET_FOCUS_CHANGED_CB;
2519 LOGD("Enter, handle :%x", pc->remote_handle);
2522 if (pc->cb_info == NULL) {
2523 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2524 return CAMERA_ERROR_INVALID_PARAMETER;
2526 sock_fd = pc->cb_info->fd;
2527 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOCUS_CHANGE] = callback;
2528 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOCUS_CHANGE] = user_data;
2530 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2531 LOGD("ret : 0x%x", ret);
2535 int camera_unset_focus_changed_cb(camera_h camera)
2537 if( camera == NULL){
2538 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2539 return CAMERA_ERROR_INVALID_PARAMETER;
2541 int ret = CAMERA_ERROR_NONE;
2543 camera_cli_s *pc = (camera_cli_s *)camera;
2544 muse_camera_api_e api = MUSE_CAMERA_API_UNSET_FOCUS_CHANGED_CB;
2546 LOGD("Enter, handle :%x", pc->remote_handle);
2549 if (pc->cb_info == NULL) {
2550 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2551 return CAMERA_ERROR_INVALID_PARAMETER;
2553 sock_fd = pc->cb_info->fd;
2554 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOCUS_CHANGE] = (void *)NULL;
2555 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOCUS_CHANGE] = (void *)NULL;
2557 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2558 LOGD("ret : 0x%x", ret);
2562 int camera_set_error_cb(camera_h camera, camera_error_cb callback, void *user_data)
2564 if( camera == NULL || callback == NULL){
2565 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2566 return CAMERA_ERROR_INVALID_PARAMETER;
2568 int ret = CAMERA_ERROR_NONE;
2570 camera_cli_s *pc = (camera_cli_s *)camera;
2571 muse_camera_api_e api = MUSE_CAMERA_API_SET_ERROR_CB;
2573 LOGD("Enter, handle :%x", pc->remote_handle);
2576 if (pc->cb_info == NULL) {
2577 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2578 return CAMERA_ERROR_INVALID_PARAMETER;
2580 sock_fd = pc->cb_info->fd;
2581 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_ERROR] = callback;
2582 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_ERROR] = user_data;
2584 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2585 LOGD("ret : 0x%x", ret);
2589 int camera_unset_error_cb(camera_h camera)
2591 if( camera == NULL){
2592 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2593 return CAMERA_ERROR_INVALID_PARAMETER;
2595 int ret = CAMERA_ERROR_NONE;
2597 camera_cli_s *pc = (camera_cli_s *)camera;
2598 muse_camera_api_e api = MUSE_CAMERA_API_UNSET_ERROR_CB;
2600 LOGD("Enter, handle :%x", pc->remote_handle);
2603 if (pc->cb_info == NULL) {
2604 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2605 return CAMERA_ERROR_INVALID_PARAMETER;
2607 sock_fd = pc->cb_info->fd;
2608 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_ERROR] = (void *)NULL;
2609 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_ERROR] = (void *)NULL;
2611 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2612 LOGD("ret : 0x%x", ret);
2616 int camera_foreach_supported_preview_resolution(camera_h camera, camera_supported_preview_resolution_cb foreach_cb , void *user_data)
2618 if( camera == NULL || foreach_cb == NULL){
2619 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2620 return CAMERA_ERROR_INVALID_PARAMETER;
2622 int ret = CAMERA_ERROR_NONE;
2624 camera_cli_s *pc = (camera_cli_s *)camera;
2625 muse_camera_api_e api = MUSE_CAMERA_API_SET_FOREACH_SUPPORTED_PREVIEW_RESOLUTION;
2627 LOGD("Enter, handle :%x", pc->remote_handle);
2630 if (pc->cb_info == NULL) {
2631 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2632 return CAMERA_ERROR_INVALID_PARAMETER;
2634 sock_fd = pc->cb_info->fd;
2635 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_RESOLUTION] = foreach_cb;
2636 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_RESOLUTION] = user_data;
2638 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2639 LOGD("ret : 0x%x", ret);
2643 int camera_foreach_supported_capture_resolution(camera_h camera, camera_supported_capture_resolution_cb foreach_cb , void *user_data)
2645 if( camera == NULL || foreach_cb == NULL){
2646 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2647 return CAMERA_ERROR_INVALID_PARAMETER;
2649 int ret = CAMERA_ERROR_NONE;
2651 camera_cli_s *pc = (camera_cli_s *)camera;
2652 muse_camera_api_e api = MUSE_CAMERA_API_SET_FOREACH_SUPPORTED_CAPTURE_RESOLUTION;
2654 LOGD("Enter, handle :%x", pc->remote_handle);
2657 if (pc->cb_info == NULL) {
2658 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2659 return CAMERA_ERROR_INVALID_PARAMETER;
2661 sock_fd = pc->cb_info->fd;
2662 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_RESOLUTION] = foreach_cb;
2663 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_RESOLUTION] = user_data;
2665 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2666 LOGD("ret : 0x%x", ret);
2670 int camera_foreach_supported_capture_format(camera_h camera, camera_supported_capture_format_cb foreach_cb , void *user_data)
2672 if( camera == NULL || foreach_cb == NULL){
2673 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2674 return CAMERA_ERROR_INVALID_PARAMETER;
2676 int ret = CAMERA_ERROR_NONE;
2678 camera_cli_s *pc = (camera_cli_s *)camera;
2679 muse_camera_api_e api = MUSE_CAMERA_API_SET_FOREACH_SUPPORTED_CAPTURE_FORMAT;
2681 LOGD("Enter, handle :%x", pc->remote_handle);
2684 if (pc->cb_info == NULL) {
2685 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2686 return CAMERA_ERROR_INVALID_PARAMETER;
2688 sock_fd = pc->cb_info->fd;
2689 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_FORMAT] = foreach_cb;
2690 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_FORMAT] = user_data;
2692 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2693 LOGD("ret : 0x%x", ret);
2698 int camera_foreach_supported_preview_format(camera_h camera, camera_supported_preview_format_cb foreach_cb , void *user_data)
2700 if( camera == NULL || foreach_cb == NULL){
2701 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2702 return CAMERA_ERROR_INVALID_PARAMETER;
2704 int ret = CAMERA_ERROR_NONE;
2706 camera_cli_s *pc = (camera_cli_s *)camera;
2707 muse_camera_api_e api = MUSE_CAMERA_API_SET_FOREACH_SUPPORTED_PREVIEW_FORMAT;
2709 LOGD("Enter, handle :%x", pc->remote_handle);
2712 if (pc->cb_info == NULL) {
2713 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2714 return CAMERA_ERROR_INVALID_PARAMETER;
2716 sock_fd = pc->cb_info->fd;
2717 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_FORMAT] = foreach_cb;
2718 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_FORMAT] = user_data;
2720 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2721 LOGD("ret : 0x%x", ret);
2726 int camera_get_recommended_preview_resolution(camera_h camera, int *width, int *height)
2728 if (camera == NULL || width == NULL || height == NULL) {
2729 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2730 return CAMERA_ERROR_INVALID_PARAMETER;
2732 int ret = CAMERA_ERROR_NONE;
2734 camera_cli_s *pc = (camera_cli_s *)camera;
2735 muse_camera_api_e api = MUSE_CAMERA_API_GET_RECOMMENDED_PREVIEW_RESOLUTION;
2737 if (pc->cb_info == NULL) {
2738 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2739 return CAMERA_ERROR_INVALID_PARAMETER;
2741 sock_fd = pc->cb_info->fd;
2745 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2746 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2748 if (ret == CAMERA_ERROR_NONE) {
2749 muse_camera_msg_get(get_width, pc->cb_info->recvMsg);
2750 muse_camera_msg_get(get_height, pc->cb_info->recvMsg);
2752 *height = get_height;
2754 LOGD("ret : 0x%x", ret);
2759 int camera_attr_get_lens_orientation(camera_h camera, int *angle)
2761 if( camera == NULL || angle == NULL){
2762 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2763 return CAMERA_ERROR_INVALID_PARAMETER;
2765 int ret = CAMERA_ERROR_NONE;
2767 camera_cli_s *pc = (camera_cli_s *)camera;
2768 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_LENS_ORIENTATION;
2770 if (pc->cb_info == NULL) {
2771 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2772 return CAMERA_ERROR_INVALID_PARAMETER;
2774 sock_fd = pc->cb_info->fd;
2777 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2778 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2780 if (ret == CAMERA_ERROR_NONE) {
2781 muse_camera_msg_get(get_angle, pc->cb_info->recvMsg);
2784 LOGD("ret : 0x%x", ret);
2788 int camera_attr_set_theater_mode(camera_h camera, camera_attr_theater_mode_e mode)
2790 if (camera == NULL) {
2791 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
2792 return CAMERA_ERROR_INVALID_PARAMETER;
2794 int ret = CAMERA_ERROR_NONE;
2795 camera_cli_s *pc = (camera_cli_s *)camera;
2796 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_THEATER_MODE;
2798 if (pc->cb_info == NULL) {
2799 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2800 return CAMERA_ERROR_INVALID_PARAMETER;
2802 sock_fd = pc->cb_info->fd;
2803 int set_mode = (int)mode;
2804 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2805 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
2806 LOGD("ret : 0x%x", ret);
2810 int camera_attr_get_theater_mode(camera_h camera, camera_attr_theater_mode_e *mode)
2812 if (camera == NULL || mode == NULL) {
2813 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
2814 return CAMERA_ERROR_INVALID_PARAMETER;
2817 int ret = CAMERA_ERROR_NONE;
2818 camera_cli_s *pc = (camera_cli_s *)camera;
2819 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_THEATER_MODE;
2821 if (pc->cb_info == NULL) {
2822 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2823 return CAMERA_ERROR_INVALID_PARAMETER;
2825 sock_fd = pc->cb_info->fd;
2827 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2828 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2830 if (ret == CAMERA_ERROR_NONE) {
2831 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
2832 *mode = (camera_attr_theater_mode_e)get_mode;
2834 LOGD("ret : 0x%x", ret);
2838 int camera_attr_foreach_supported_theater_mode(camera_h camera, camera_attr_supported_theater_mode_cb foreach_cb, void *user_data)
2840 if (camera == NULL || foreach_cb == NULL) {
2841 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
2842 return CAMERA_ERROR_INVALID_PARAMETER;
2844 int ret = CAMERA_ERROR_NONE;
2846 camera_cli_s *pc = (camera_cli_s *)camera;
2847 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_THEATER_MODE;
2849 LOGD("Enter, handle :%x", pc->remote_handle);
2852 if (pc->cb_info == NULL) {
2853 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2854 return CAMERA_ERROR_INVALID_PARAMETER;
2856 sock_fd = pc->cb_info->fd;
2857 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_THEATER_MODE] = foreach_cb;
2858 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_THEATER_MODE] = user_data;
2860 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2862 LOGD("Finish, return :%x", ret);
2867 int camera_attr_set_preview_fps(camera_h camera, camera_attr_fps_e fps)
2869 if( camera == NULL){
2870 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2871 return CAMERA_ERROR_INVALID_PARAMETER;
2873 int ret = CAMERA_ERROR_NONE;
2874 camera_cli_s *pc = (camera_cli_s *)camera;
2875 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_PREVIEW_FPS;
2877 if (pc->cb_info == NULL) {
2878 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2879 return CAMERA_ERROR_INVALID_PARAMETER;
2881 sock_fd = pc->cb_info->fd;
2882 int set_fps = (int)fps;
2883 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2884 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_fps);
2885 LOGD("ret : 0x%x", ret);
2890 int camera_attr_set_image_quality(camera_h camera, int quality)
2892 if( camera == NULL){
2893 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2894 return CAMERA_ERROR_INVALID_PARAMETER;
2896 int ret = CAMERA_ERROR_NONE;
2898 camera_cli_s *pc = (camera_cli_s *)camera;
2899 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_IMAGE_QUALITY;
2901 if (pc->cb_info == NULL) {
2902 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2903 return CAMERA_ERROR_INVALID_PARAMETER;
2905 sock_fd = pc->cb_info->fd;
2906 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2907 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, quality);
2908 LOGD("ret : 0x%x", ret);
2912 int camera_attr_get_preview_fps(camera_h camera, camera_attr_fps_e *fps)
2914 if( camera == NULL || fps == NULL){
2915 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2916 return CAMERA_ERROR_INVALID_PARAMETER;
2918 int ret = CAMERA_ERROR_NONE;
2920 camera_cli_s *pc = (camera_cli_s *)camera;
2921 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_PREVIEW_FPS;
2924 if (pc->cb_info == NULL) {
2925 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2926 return CAMERA_ERROR_INVALID_PARAMETER;
2928 sock_fd = pc->cb_info->fd;
2930 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2931 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2933 if (ret == CAMERA_ERROR_NONE) {
2934 muse_camera_msg_get(get_fps, pc->cb_info->recvMsg);
2935 *fps = (camera_attr_fps_e)get_fps;
2937 LOGD("ret : 0x%x", ret);
2942 int camera_attr_get_image_quality(camera_h camera, int *quality)
2944 if( camera == NULL || quality == NULL){
2945 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2946 return CAMERA_ERROR_INVALID_PARAMETER;
2948 int ret = CAMERA_ERROR_NONE;
2950 camera_cli_s *pc = (camera_cli_s *)camera;
2951 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_IMAGE_QUALITY;
2953 if (pc->cb_info == NULL) {
2954 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2955 return CAMERA_ERROR_INVALID_PARAMETER;
2957 sock_fd = pc->cb_info->fd;
2959 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2960 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2962 if (ret == CAMERA_ERROR_NONE) {
2963 muse_camera_msg_get(get_quality, pc->cb_info->recvMsg);
2964 *quality = get_quality;
2966 LOGD("ret : 0x%x", ret);
2971 int camera_attr_set_zoom(camera_h camera, int zoom)
2973 if( camera == NULL){
2974 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2975 return CAMERA_ERROR_INVALID_PARAMETER;
2977 int ret = CAMERA_ERROR_NONE;
2979 camera_cli_s *pc = (camera_cli_s *)camera;
2980 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_ZOOM;
2982 if (pc->cb_info == NULL) {
2983 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2984 return CAMERA_ERROR_INVALID_PARAMETER;
2986 sock_fd = pc->cb_info->fd;
2988 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2989 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, zoom);
2990 LOGD("ret : 0x%x", ret);
2994 int camera_attr_set_af_mode(camera_h camera, camera_attr_af_mode_e mode)
2996 if( camera == NULL){
2997 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2998 return CAMERA_ERROR_INVALID_PARAMETER;
3000 int ret = CAMERA_ERROR_NONE;
3002 camera_cli_s *pc = (camera_cli_s *)camera;
3003 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_AF_MODE;
3005 if (pc->cb_info == NULL) {
3006 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3007 return CAMERA_ERROR_INVALID_PARAMETER;
3009 sock_fd = pc->cb_info->fd;
3010 int set_mode = (int)mode;
3011 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3012 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
3013 LOGD("ret : 0x%x", ret);
3017 int camera_attr_set_af_area(camera_h camera, int x, int y)
3019 if( camera == NULL){
3020 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3021 return CAMERA_ERROR_INVALID_PARAMETER;
3023 int ret = CAMERA_ERROR_NONE;
3024 camera_cli_s *pc = (camera_cli_s *)camera;
3025 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_AF_AREA;
3026 int sock_fd = pc->cb_info->fd;
3027 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3028 muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret, INT, x, INT, y);
3029 LOGD("ret : 0x%x", ret);
3034 int camera_attr_clear_af_area(camera_h camera)
3036 if( camera == NULL){
3037 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
3038 return CAMERA_ERROR_INVALID_PARAMETER;
3040 int ret = CAMERA_ERROR_NONE;
3042 camera_cli_s *pc = (camera_cli_s *)camera;
3043 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_CLEAR_AF_AREA;
3045 if (pc->cb_info == NULL) {
3046 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3047 return CAMERA_ERROR_INVALID_PARAMETER;
3049 sock_fd = pc->cb_info->fd;
3050 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3051 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3052 LOGD("ret : 0x%x", ret);
3057 int camera_attr_set_exposure_mode(camera_h camera, camera_attr_exposure_mode_e mode)
3059 if( camera == NULL){
3060 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3061 return CAMERA_ERROR_INVALID_PARAMETER;
3064 if (mode < CAMERA_ATTR_EXPOSURE_MODE_OFF || mode > CAMERA_ATTR_EXPOSURE_MODE_CUSTOM) {
3065 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_NOT_SUPPORTED);
3066 return CAMERA_ERROR_NOT_SUPPORTED;
3069 int ret = CAMERA_ERROR_NONE;
3070 camera_cli_s *pc = (camera_cli_s *)camera;
3071 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_EXPOSURE_MODE;
3072 int set_mode = (int)mode;
3074 if (pc->cb_info == NULL) {
3075 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3076 return CAMERA_ERROR_INVALID_PARAMETER;
3078 sock_fd = pc->cb_info->fd;
3079 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3080 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
3081 LOGD("ret : 0x%x", ret);
3086 int camera_attr_set_exposure(camera_h camera, int value)
3088 if( camera == NULL){
3089 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3090 return CAMERA_ERROR_INVALID_PARAMETER;
3092 int ret = CAMERA_ERROR_NONE;
3094 camera_cli_s *pc = (camera_cli_s *)camera;
3095 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_EXPOSURE;
3097 if (pc->cb_info == NULL) {
3098 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3099 return CAMERA_ERROR_INVALID_PARAMETER;
3101 sock_fd = pc->cb_info->fd;
3103 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3104 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, value);
3105 LOGD("ret : 0x%x", ret);
3110 int camera_attr_set_iso(camera_h camera, camera_attr_iso_e iso)
3112 if( camera == NULL){
3113 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3114 return CAMERA_ERROR_INVALID_PARAMETER;
3116 int ret = CAMERA_ERROR_NONE;
3118 camera_cli_s *pc = (camera_cli_s *)camera;
3119 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_ISO;
3121 if (pc->cb_info == NULL) {
3122 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3123 return CAMERA_ERROR_INVALID_PARAMETER;
3125 sock_fd = pc->cb_info->fd;
3126 int set_iso = (int)iso;
3127 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3128 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_iso);
3129 LOGD("ret : 0x%x", ret);
3134 int camera_attr_set_brightness(camera_h camera, int level)
3136 if( camera == NULL){
3137 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3138 return CAMERA_ERROR_INVALID_PARAMETER;
3140 int ret = CAMERA_ERROR_NONE;
3142 camera_cli_s *pc = (camera_cli_s *)camera;
3143 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_BRIGHTNESS;
3145 if (pc->cb_info == NULL) {
3146 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3147 return CAMERA_ERROR_INVALID_PARAMETER;
3149 sock_fd = pc->cb_info->fd;
3151 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3152 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, level);
3153 LOGD("ret : 0x%x", ret);
3158 int camera_attr_set_contrast(camera_h camera, int level)
3160 if( camera == NULL){
3161 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3162 return CAMERA_ERROR_INVALID_PARAMETER;
3164 int ret = CAMERA_ERROR_NONE;
3166 camera_cli_s *pc = (camera_cli_s *)camera;
3167 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_CONTRAST;
3169 if (pc->cb_info == NULL) {
3170 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3171 return CAMERA_ERROR_INVALID_PARAMETER;
3173 sock_fd = pc->cb_info->fd;
3175 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3176 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, level);
3177 LOGD("ret : 0x%x", ret);
3182 int camera_attr_set_whitebalance(camera_h camera, camera_attr_whitebalance_e wb)
3184 if (camera == NULL) {
3185 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3186 return CAMERA_ERROR_INVALID_PARAMETER;
3189 if (wb < CAMERA_ATTR_WHITE_BALANCE_NONE || wb > CAMERA_ATTR_WHITE_BALANCE_CUSTOM) {
3190 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_NOT_SUPPORTED);
3191 return CAMERA_ERROR_NOT_SUPPORTED;
3194 int ret = CAMERA_ERROR_NONE;
3196 camera_cli_s *pc = (camera_cli_s *)camera;
3197 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_WHITEBALANCE;
3199 if (pc->cb_info == NULL) {
3200 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3201 return CAMERA_ERROR_INVALID_PARAMETER;
3203 sock_fd = pc->cb_info->fd;
3204 int set_whitebalance = (int)wb;
3205 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3206 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_whitebalance);
3207 LOGD("ret : 0x%x", ret);
3212 int camera_attr_set_effect(camera_h camera, camera_attr_effect_mode_e effect)
3214 if( camera == NULL){
3215 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3216 return CAMERA_ERROR_INVALID_PARAMETER;
3218 int ret = CAMERA_ERROR_NONE;
3220 camera_cli_s *pc = (camera_cli_s *)camera;
3221 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_EFFECT;
3223 if (pc->cb_info == NULL) {
3224 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3225 return CAMERA_ERROR_INVALID_PARAMETER;
3227 sock_fd = pc->cb_info->fd;
3228 int set_effect = (int)effect;
3229 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3230 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_effect);
3231 LOGD("ret : 0x%x", ret);
3236 int camera_attr_set_scene_mode(camera_h camera, camera_attr_scene_mode_e mode)
3238 if( camera == NULL){
3239 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3240 return CAMERA_ERROR_INVALID_PARAMETER;
3242 int ret = CAMERA_ERROR_NONE;
3244 camera_cli_s *pc = (camera_cli_s *)camera;
3245 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_SCENE_MODE;
3247 if (pc->cb_info == NULL) {
3248 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3249 return CAMERA_ERROR_INVALID_PARAMETER;
3251 sock_fd = pc->cb_info->fd;
3252 int set_mode = (int)mode;
3253 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3254 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
3255 LOGD("ret : 0x%x", ret);
3260 int camera_attr_enable_tag(camera_h camera, bool enable)
3262 if( camera == NULL){
3263 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3264 return CAMERA_ERROR_INVALID_PARAMETER;
3266 int ret = CAMERA_ERROR_NONE;
3267 camera_cli_s *pc = (camera_cli_s *)camera;
3268 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_ENABLE_TAG;
3270 if (pc->cb_info == NULL) {
3271 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3272 return CAMERA_ERROR_INVALID_PARAMETER;
3274 sock_fd = pc->cb_info->fd;
3275 int set_enable = (int)enable;
3277 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3278 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_enable);
3279 LOGD("ret : 0x%x", ret);
3284 int camera_attr_set_tag_image_description(camera_h camera, const char *description)
3286 if( camera == NULL){
3287 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3288 return CAMERA_ERROR_INVALID_PARAMETER;
3290 if( description == NULL){
3291 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3292 return CAMERA_ERROR_INVALID_PARAMETER;
3294 int ret = CAMERA_ERROR_NONE;
3295 camera_cli_s *pc = (camera_cli_s *)camera;
3296 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_TAG_IMAGE_DESCRIPTION;
3298 if (pc->cb_info == NULL) {
3299 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3300 return CAMERA_ERROR_INVALID_PARAMETER;
3302 sock_fd = pc->cb_info->fd;
3303 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3304 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, STRING, description);
3305 LOGD("ret : 0x%x", ret);
3310 int camera_attr_set_tag_orientation(camera_h camera, camera_attr_tag_orientation_e orientation)
3312 if( camera == NULL){
3313 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3314 return CAMERA_ERROR_INVALID_PARAMETER;
3316 int ret = CAMERA_ERROR_NONE;
3317 camera_cli_s *pc = (camera_cli_s *)camera;
3318 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_TAG_ORIENTATION;
3320 if (pc->cb_info == NULL) {
3321 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3322 return CAMERA_ERROR_INVALID_PARAMETER;
3324 sock_fd = pc->cb_info->fd;
3325 int set_orientation = (int)orientation;
3327 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3328 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_orientation);
3329 LOGD("ret : 0x%x", ret);
3334 int camera_attr_set_tag_software(camera_h camera, const char *software)
3336 if( camera == NULL){
3337 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3338 return CAMERA_ERROR_INVALID_PARAMETER;
3340 if( software == NULL){
3341 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3342 return CAMERA_ERROR_INVALID_PARAMETER;
3344 int ret = CAMERA_ERROR_NONE;
3345 camera_cli_s *pc = (camera_cli_s *)camera;
3346 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_TAG_SOFTWARE;
3348 if (pc->cb_info == NULL) {
3349 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3350 return CAMERA_ERROR_INVALID_PARAMETER;
3352 sock_fd = pc->cb_info->fd;
3353 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3354 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, STRING, software);
3355 LOGD("ret : 0x%x", ret);
3360 int camera_attr_set_geotag(camera_h camera, double latitude , double longitude, double altitude)
3362 if( camera == NULL){
3363 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3364 return CAMERA_ERROR_INVALID_PARAMETER;
3366 int ret = CAMERA_ERROR_NONE;
3367 camera_cli_s *pc = (camera_cli_s *)camera;
3368 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_GEOTAG;
3370 if (pc->cb_info == NULL) {
3371 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3372 return CAMERA_ERROR_INVALID_PARAMETER;
3374 sock_fd = pc->cb_info->fd;
3375 double set_geotag[3] = { latitude, longitude, altitude };
3377 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3378 muse_camera_msg_send_array(api, sock_fd, pc->cb_info, ret,
3379 set_geotag, sizeof(set_geotag), sizeof(double));
3380 LOGD("ret : 0x%x", ret);
3385 int camera_attr_remove_geotag(camera_h camera)
3387 if( camera == NULL){
3388 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3389 return CAMERA_ERROR_INVALID_PARAMETER;
3391 int ret = CAMERA_ERROR_NONE;
3392 camera_cli_s *pc = (camera_cli_s *)camera;
3393 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_REMOVE_GEOTAG;
3395 if (pc->cb_info == NULL) {
3396 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3397 return CAMERA_ERROR_INVALID_PARAMETER;
3399 sock_fd = pc->cb_info->fd;
3400 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3401 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3402 LOGD("ret : 0x%x", ret);
3407 int camera_attr_set_flash_mode(camera_h camera, camera_attr_flash_mode_e mode)
3409 if( camera == NULL){
3410 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3411 return CAMERA_ERROR_INVALID_PARAMETER;
3413 int ret = CAMERA_ERROR_NONE;
3414 camera_cli_s *pc = (camera_cli_s *)camera;
3415 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_FLASH_MODE;
3417 if (pc->cb_info == NULL) {
3418 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3419 return CAMERA_ERROR_INVALID_PARAMETER;
3421 sock_fd = pc->cb_info->fd;
3422 int set_mode = (int)mode;
3424 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3425 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
3426 LOGD("ret : 0x%x", ret);
3431 int camera_attr_get_zoom(camera_h camera, int *zoom)
3433 if( camera == NULL || zoom == NULL){
3434 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3435 return CAMERA_ERROR_INVALID_PARAMETER;
3437 int ret = CAMERA_ERROR_NONE;
3439 camera_cli_s *pc = (camera_cli_s *)camera;
3440 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_ZOOM;
3443 if (pc->cb_info == NULL) {
3444 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3445 return CAMERA_ERROR_INVALID_PARAMETER;
3447 sock_fd = pc->cb_info->fd;
3449 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3450 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3452 if (ret == CAMERA_ERROR_NONE) {
3453 muse_camera_msg_get(get_zoom, pc->cb_info->recvMsg);
3456 LOGD("ret : 0x%x", ret);
3461 int camera_attr_get_zoom_range(camera_h camera, int *min, int *max)
3463 if( camera == NULL || min == NULL || max == NULL ){
3464 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3465 return CAMERA_ERROR_INVALID_PARAMETER;
3467 int ret = CAMERA_ERROR_NONE;
3468 camera_cli_s *pc = (camera_cli_s *)camera;
3470 if (pc->cb_info == NULL) {
3471 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3472 return CAMERA_ERROR_INVALID_PARAMETER;
3474 sock_fd = pc->cb_info->fd;
3475 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_ZOOM_RANGE;
3479 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3480 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3482 if (ret == CAMERA_ERROR_NONE) {
3483 muse_camera_msg_get(get_min, pc->cb_info->recvMsg);
3484 muse_camera_msg_get(get_max, pc->cb_info->recvMsg);
3488 LOGD("ret : 0x%x", ret);
3493 int camera_attr_get_af_mode( camera_h camera, camera_attr_af_mode_e *mode)
3495 if( camera == NULL || mode == NULL){
3496 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3497 return CAMERA_ERROR_INVALID_PARAMETER;
3499 int ret = CAMERA_ERROR_NONE;
3500 camera_cli_s *pc = (camera_cli_s *)camera;
3502 if (pc->cb_info == NULL) {
3503 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3504 return CAMERA_ERROR_INVALID_PARAMETER;
3506 sock_fd = pc->cb_info->fd;
3507 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_AF_MODE;
3510 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3511 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3513 if (ret == CAMERA_ERROR_NONE) {
3514 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
3515 *mode = (camera_attr_af_mode_e)get_mode;
3517 LOGD("ret : 0x%x", ret);
3522 int camera_attr_get_exposure_mode( camera_h camera, camera_attr_exposure_mode_e *mode)
3524 if( camera == NULL|| mode == NULL){
3525 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3526 return CAMERA_ERROR_INVALID_PARAMETER;
3528 int ret = CAMERA_ERROR_NONE;
3529 camera_cli_s *pc = (camera_cli_s *)camera;
3531 if (pc->cb_info == NULL) {
3532 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3533 return CAMERA_ERROR_INVALID_PARAMETER;
3535 sock_fd = pc->cb_info->fd;
3536 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_EXPOSURE_MODE;
3539 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3540 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3542 if (ret == CAMERA_ERROR_NONE) {
3543 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
3544 *mode = (camera_attr_exposure_mode_e)get_mode;
3546 LOGD("ret : 0x%x", ret);
3550 int camera_attr_get_exposure(camera_h camera, int *value)
3552 if( camera == NULL || value == NULL){
3553 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3554 return CAMERA_ERROR_INVALID_PARAMETER;
3556 int ret = CAMERA_ERROR_NONE;
3557 camera_cli_s *pc = (camera_cli_s *)camera;
3559 if (pc->cb_info == NULL) {
3560 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3561 return CAMERA_ERROR_INVALID_PARAMETER;
3563 sock_fd = pc->cb_info->fd;
3564 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_EXPOSURE;
3567 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3568 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3570 if (ret == CAMERA_ERROR_NONE) {
3571 muse_camera_msg_get(get_value, pc->cb_info->recvMsg);
3574 LOGD("ret : 0x%x", ret);
3579 int camera_attr_get_exposure_range(camera_h camera, int *min, int *max)
3581 if( camera == NULL || min == NULL || max == NULL ){
3582 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3583 return CAMERA_ERROR_INVALID_PARAMETER;
3585 int ret = CAMERA_ERROR_NONE;
3586 camera_cli_s *pc = (camera_cli_s *)camera;
3588 if (pc->cb_info == NULL) {
3589 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3590 return CAMERA_ERROR_INVALID_PARAMETER;
3592 sock_fd = pc->cb_info->fd;
3593 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_EXPOSURE_RANGE;
3597 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3598 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3600 if (ret == CAMERA_ERROR_NONE) {
3601 muse_camera_msg_get(get_min, pc->cb_info->recvMsg);
3602 muse_camera_msg_get(get_max, pc->cb_info->recvMsg);
3606 LOGD("ret : 0x%x", ret);
3611 int camera_attr_get_iso( camera_h camera, camera_attr_iso_e *iso)
3613 if( camera == NULL || iso == NULL){
3614 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3615 return CAMERA_ERROR_INVALID_PARAMETER;
3617 int ret = CAMERA_ERROR_NONE;
3618 camera_cli_s *pc = (camera_cli_s *)camera;
3620 if (pc->cb_info == NULL) {
3621 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3622 return CAMERA_ERROR_INVALID_PARAMETER;
3624 sock_fd = pc->cb_info->fd;
3625 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_ISO;
3628 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3629 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3631 if (ret == CAMERA_ERROR_NONE) {
3632 muse_camera_msg_get(get_iso, pc->cb_info->recvMsg);
3633 *iso = (camera_attr_iso_e)get_iso;
3635 LOGD("ret : 0x%x", ret);
3640 int camera_attr_get_brightness(camera_h camera, int *level)
3642 if( camera == NULL || level == NULL){
3643 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3644 return CAMERA_ERROR_INVALID_PARAMETER;
3646 int ret = CAMERA_ERROR_NONE;
3647 camera_cli_s *pc = (camera_cli_s *)camera;
3649 if (pc->cb_info == NULL) {
3650 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3651 return CAMERA_ERROR_INVALID_PARAMETER;
3653 sock_fd = pc->cb_info->fd;
3654 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_BRIGHTNESS;
3657 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3658 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3660 if (ret == CAMERA_ERROR_NONE) {
3661 muse_camera_msg_get(get_level, pc->cb_info->recvMsg);
3664 LOGD("ret : 0x%x", ret);
3669 int camera_attr_get_brightness_range(camera_h camera, int *min, int *max)
3671 if( camera == NULL || min == NULL || max == NULL ){
3672 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3673 return CAMERA_ERROR_INVALID_PARAMETER;
3675 int ret = CAMERA_ERROR_NONE;
3676 camera_cli_s *pc = (camera_cli_s *)camera;
3678 if (pc->cb_info == NULL) {
3679 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3680 return CAMERA_ERROR_INVALID_PARAMETER;
3682 sock_fd = pc->cb_info->fd;
3683 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_BRIGHTNESS_RANGE;
3687 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3688 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3690 if (ret == CAMERA_ERROR_NONE) {
3691 muse_camera_msg_get(get_min, pc->cb_info->recvMsg);
3692 muse_camera_msg_get(get_max, pc->cb_info->recvMsg);
3696 LOGD("ret : 0x%x", ret);
3701 int camera_attr_get_contrast(camera_h camera, int *level)
3703 if( camera == NULL || level == NULL){
3704 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3705 return CAMERA_ERROR_INVALID_PARAMETER;
3707 int ret = CAMERA_ERROR_NONE;
3708 camera_cli_s *pc = (camera_cli_s *)camera;
3709 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_CONTRAST;
3711 if (pc->cb_info == NULL) {
3712 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3713 return CAMERA_ERROR_INVALID_PARAMETER;
3715 sock_fd = pc->cb_info->fd;
3718 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3719 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3721 if (ret == CAMERA_ERROR_NONE) {
3722 muse_camera_msg_get(get_level, pc->cb_info->recvMsg);
3725 LOGD("ret : 0x%x", ret);
3730 int camera_attr_get_contrast_range(camera_h camera, int *min , int *max)
3732 if( camera == NULL || min == NULL || max == NULL ){
3733 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3734 return CAMERA_ERROR_INVALID_PARAMETER;
3736 int ret = CAMERA_ERROR_NONE;
3737 camera_cli_s *pc = (camera_cli_s *)camera;
3738 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_CONTRAST_RANGE;
3740 if (pc->cb_info == NULL) {
3741 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3742 return CAMERA_ERROR_INVALID_PARAMETER;
3744 sock_fd = pc->cb_info->fd;
3748 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3749 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3751 if (ret == CAMERA_ERROR_NONE) {
3752 muse_camera_msg_get(get_min, pc->cb_info->recvMsg);
3753 muse_camera_msg_get(get_max, pc->cb_info->recvMsg);
3757 LOGD("ret : 0x%x", ret);
3762 int camera_attr_get_whitebalance(camera_h camera, camera_attr_whitebalance_e *wb)
3764 if( camera == NULL || wb == NULL){
3765 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3766 return CAMERA_ERROR_INVALID_PARAMETER;
3768 int ret = CAMERA_ERROR_NONE;
3769 camera_cli_s *pc = (camera_cli_s *)camera;
3770 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_WHITEBALANCE;
3772 if (pc->cb_info == NULL) {
3773 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3774 return CAMERA_ERROR_INVALID_PARAMETER;
3776 sock_fd = pc->cb_info->fd;
3779 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3780 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3782 if (ret == CAMERA_ERROR_NONE) {
3783 muse_camera_msg_get(get_wb, pc->cb_info->recvMsg);
3784 *wb = (camera_attr_whitebalance_e)get_wb;
3786 LOGD("ret : 0x%x", ret);
3791 int camera_attr_get_effect(camera_h camera, camera_attr_effect_mode_e *effect)
3793 if( camera == NULL || effect == NULL ){
3794 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3795 return CAMERA_ERROR_INVALID_PARAMETER;
3798 int ret = CAMERA_ERROR_NONE;
3799 camera_cli_s *pc = (camera_cli_s *)camera;
3800 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_EFFECT;
3802 if (pc->cb_info == NULL) {
3803 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3804 return CAMERA_ERROR_INVALID_PARAMETER;
3806 sock_fd = pc->cb_info->fd;
3809 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3810 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3812 if (ret == CAMERA_ERROR_NONE) {
3813 muse_camera_msg_get(get_effect, pc->cb_info->recvMsg);
3814 *effect = (camera_attr_effect_mode_e)get_effect;
3816 LOGD("ret : 0x%x", ret);
3821 int camera_attr_get_scene_mode(camera_h camera, camera_attr_scene_mode_e *mode)
3823 if( camera == NULL || mode == NULL){
3824 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3825 return CAMERA_ERROR_INVALID_PARAMETER;
3828 int ret = CAMERA_ERROR_NONE;
3829 camera_cli_s *pc = (camera_cli_s *)camera;
3830 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_SCENE_MODE;
3832 if (pc->cb_info == NULL) {
3833 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3834 return CAMERA_ERROR_INVALID_PARAMETER;
3836 sock_fd = pc->cb_info->fd;
3839 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3840 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3842 if (ret == CAMERA_ERROR_NONE) {
3843 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
3844 *mode = (camera_attr_scene_mode_e)get_mode;
3846 LOGD("ret : 0x%x", ret);
3851 int camera_attr_is_enabled_tag(camera_h camera, bool *enable)
3853 if( camera == NULL || enable == NULL){
3854 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3855 return CAMERA_ERROR_INVALID_PARAMETER;
3858 int ret = CAMERA_ERROR_NONE;
3859 camera_cli_s *pc = (camera_cli_s *)camera;
3860 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_ENABLED_TAG;
3862 if (pc->cb_info == NULL) {
3863 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3864 return CAMERA_ERROR_INVALID_PARAMETER;
3866 sock_fd = pc->cb_info->fd;
3869 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3870 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3872 if (ret == CAMERA_ERROR_NONE) {
3873 muse_camera_msg_get(get_enabled, pc->cb_info->recvMsg);
3874 *enable = (bool)get_enabled;
3876 LOGD("ret : 0x%x", ret);
3881 int camera_attr_get_tag_image_description(camera_h camera, char **description)
3883 if( camera == NULL || description == NULL){
3884 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3885 return CAMERA_ERROR_INVALID_PARAMETER;
3888 int ret = CAMERA_ERROR_NONE;
3889 camera_cli_s *pc = (camera_cli_s *)camera;
3890 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_TAG_IMAGE_DESCRIPTION;
3892 if (pc->cb_info == NULL) {
3893 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3894 return CAMERA_ERROR_INVALID_PARAMETER;
3896 sock_fd = pc->cb_info->fd;
3897 char get_description[MUSE_CAMERA_MSG_MAX_LENGTH] = {0,};
3899 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3900 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3902 if (ret == CAMERA_ERROR_NONE) {
3903 muse_camera_msg_get_string(get_description, pc->cb_info->recvMsg);
3904 *description = strdup(get_description);
3906 LOGD("ret : 0x%x", ret);
3911 int camera_attr_get_tag_orientation(camera_h camera, camera_attr_tag_orientation_e *orientation)
3913 if( camera == NULL || orientation == NULL){
3914 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3915 return CAMERA_ERROR_INVALID_PARAMETER;
3918 int ret = CAMERA_ERROR_NONE;
3919 camera_cli_s *pc = (camera_cli_s *)camera;
3920 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_TAG_ORIENTATION;
3922 if (pc->cb_info == NULL) {
3923 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3924 return CAMERA_ERROR_INVALID_PARAMETER;
3926 sock_fd = pc->cb_info->fd;
3927 int get_orientation;
3929 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3930 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3932 if (ret == CAMERA_ERROR_NONE) {
3933 muse_camera_msg_get(get_orientation, pc->cb_info->recvMsg);
3934 *orientation = (camera_attr_tag_orientation_e)get_orientation;
3935 LOGD("success, orientation : %d", *orientation);
3937 LOGD("ret : 0x%x", ret);
3942 int camera_attr_get_tag_software(camera_h camera, char **software)
3944 if( camera == NULL || software == NULL ){
3945 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3946 return CAMERA_ERROR_INVALID_PARAMETER;
3949 int ret = CAMERA_ERROR_NONE;
3950 camera_cli_s *pc = (camera_cli_s *)camera;
3951 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_TAG_SOFTWARE;
3953 if (pc->cb_info == NULL) {
3954 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3955 return CAMERA_ERROR_INVALID_PARAMETER;
3957 sock_fd = pc->cb_info->fd;
3958 char get_software[MUSE_CAMERA_MSG_MAX_LENGTH] = {0,};
3960 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3961 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3963 if (ret == CAMERA_ERROR_NONE) {
3964 muse_camera_msg_get_string(get_software, pc->cb_info->recvMsg);
3965 *software = strdup(get_software);
3967 LOGD("ret : 0x%x", ret);
3972 int camera_attr_get_geotag(camera_h camera, double *latitude , double *longitude, double *altitude)
3974 if( camera == NULL || latitude == NULL || longitude == NULL || altitude == NULL){
3975 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3976 return CAMERA_ERROR_INVALID_PARAMETER;
3979 int ret = CAMERA_ERROR_NONE;
3980 camera_cli_s *pc = (camera_cli_s *)camera;
3981 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_GEOTAG;
3982 double get_geotag[3] = {0,};
3984 if (pc->cb_info == NULL) {
3985 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3986 return CAMERA_ERROR_INVALID_PARAMETER;
3988 sock_fd = pc->cb_info->fd;
3990 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3991 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3993 if (ret == CAMERA_ERROR_NONE) {
3994 muse_camera_msg_get_array(get_geotag, pc->cb_info->recvMsg);
3995 *latitude = get_geotag[0];
3996 *longitude = get_geotag[1];
3997 *altitude = get_geotag[2];
3999 LOGE("Returned value is not valid : 0x%x", valid);
4002 LOGD("ret : 0x%x", ret);
4008 int camera_attr_get_flash_mode(camera_h camera, camera_attr_flash_mode_e *mode)
4010 if( camera == NULL || mode == NULL){
4011 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4012 return CAMERA_ERROR_INVALID_PARAMETER;
4015 int ret = CAMERA_ERROR_NONE;
4016 camera_cli_s *pc = (camera_cli_s *)camera;
4017 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_FLASH_MODE;
4019 if (pc->cb_info == NULL) {
4020 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4021 return CAMERA_ERROR_INVALID_PARAMETER;
4023 sock_fd = pc->cb_info->fd;
4026 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4027 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4029 if (ret == CAMERA_ERROR_NONE) {
4030 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
4031 *mode = (camera_attr_flash_mode_e)get_mode;
4033 LOGD("ret : 0x%x", ret);
4038 int camera_attr_foreach_supported_af_mode( camera_h camera, camera_attr_supported_af_mode_cb foreach_cb , void *user_data)
4040 if( camera == NULL || foreach_cb == NULL){
4041 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4042 return CAMERA_ERROR_INVALID_PARAMETER;
4044 int ret = CAMERA_ERROR_NONE;
4046 camera_cli_s *pc = (camera_cli_s *)camera;
4047 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_AF_MODE;
4049 LOGD("Enter, handle :%x", pc->remote_handle);
4052 if (pc->cb_info == NULL) {
4053 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4054 return CAMERA_ERROR_INVALID_PARAMETER;
4056 sock_fd = pc->cb_info->fd;
4057 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_AF_MODE] = foreach_cb;
4058 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_AF_MODE] = user_data;
4060 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4061 LOGD("ret : 0x%x", ret);
4066 int camera_attr_foreach_supported_exposure_mode(camera_h camera, camera_attr_supported_exposure_mode_cb foreach_cb , void *user_data)
4068 if( camera == NULL || foreach_cb == NULL){
4069 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4070 return CAMERA_ERROR_INVALID_PARAMETER;
4072 int ret = CAMERA_ERROR_NONE;
4074 camera_cli_s *pc = (camera_cli_s *)camera;
4075 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_EXPOSURE_MODE;
4077 LOGD("Enter, handle :%x", pc->remote_handle);
4080 if (pc->cb_info == NULL) {
4081 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4082 return CAMERA_ERROR_INVALID_PARAMETER;
4084 sock_fd = pc->cb_info->fd;
4085 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EXPOSURE_MODE] = foreach_cb;
4086 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EXPOSURE_MODE] = user_data;
4088 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4089 LOGD("ret : 0x%x", ret);
4094 int camera_attr_foreach_supported_iso( camera_h camera, camera_attr_supported_iso_cb foreach_cb , void *user_data)
4096 if( camera == NULL || foreach_cb == NULL){
4097 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4098 return CAMERA_ERROR_INVALID_PARAMETER;
4100 int ret = CAMERA_ERROR_NONE;
4102 camera_cli_s *pc = (camera_cli_s *)camera;
4103 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_ISO;
4105 LOGD("Enter, handle :%x", pc->remote_handle);
4108 if (pc->cb_info == NULL) {
4109 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4110 return CAMERA_ERROR_INVALID_PARAMETER;
4112 sock_fd = pc->cb_info->fd;
4113 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_ISO] = foreach_cb;
4114 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_ISO] = user_data;
4116 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4117 LOGD("ret : 0x%x", ret);
4122 int camera_attr_foreach_supported_whitebalance(camera_h camera, camera_attr_supported_whitebalance_cb foreach_cb , void *user_data)
4124 if( camera == NULL || foreach_cb == NULL){
4125 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4126 return CAMERA_ERROR_INVALID_PARAMETER;
4128 int ret = CAMERA_ERROR_NONE;
4130 camera_cli_s *pc = (camera_cli_s *)camera;
4131 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_WHITEBALANCE;
4133 LOGD("Enter, handle :%x", pc->remote_handle);
4136 if (pc->cb_info == NULL) {
4137 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4138 return CAMERA_ERROR_INVALID_PARAMETER;
4140 sock_fd = pc->cb_info->fd;
4141 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_WHITEBALANCE] = foreach_cb;
4142 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_WHITEBALANCE] = user_data;
4144 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4145 LOGD("ret : 0x%x", ret);
4150 int camera_attr_foreach_supported_effect(camera_h camera, camera_attr_supported_effect_cb foreach_cb , void *user_data)
4152 if( camera == NULL || foreach_cb == NULL){
4153 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4154 return CAMERA_ERROR_INVALID_PARAMETER;
4156 int ret = CAMERA_ERROR_NONE;
4158 camera_cli_s *pc = (camera_cli_s *)camera;
4159 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_EFFECT;
4161 LOGD("Enter, handle :%x", pc->remote_handle);
4164 if (pc->cb_info == NULL) {
4165 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4166 return CAMERA_ERROR_INVALID_PARAMETER;
4168 sock_fd = pc->cb_info->fd;
4169 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EFFECT] = foreach_cb;
4170 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EFFECT] = user_data;
4172 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4173 LOGD("ret : 0x%x", ret);
4178 int camera_attr_foreach_supported_scene_mode(camera_h camera, camera_attr_supported_scene_mode_cb foreach_cb , void *user_data)
4180 if( camera == NULL || foreach_cb == NULL){
4181 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4182 return CAMERA_ERROR_INVALID_PARAMETER;
4184 int ret = CAMERA_ERROR_NONE;
4186 camera_cli_s *pc = (camera_cli_s *)camera;
4187 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_SCENE_MODE;
4189 LOGD("Enter, handle :%x", pc->remote_handle);
4192 if (pc->cb_info == NULL) {
4193 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4194 return CAMERA_ERROR_INVALID_PARAMETER;
4196 sock_fd = pc->cb_info->fd;
4197 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_SCENE_MODE] = foreach_cb;
4198 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_SCENE_MODE] = user_data;
4200 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4201 LOGD("ret : 0x%x", ret);
4206 int camera_attr_foreach_supported_flash_mode(camera_h camera, camera_attr_supported_flash_mode_cb foreach_cb , void *user_data)
4208 if( camera == NULL || foreach_cb == NULL){
4209 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4210 return CAMERA_ERROR_INVALID_PARAMETER;
4212 int ret = CAMERA_ERROR_NONE;
4214 camera_cli_s *pc = (camera_cli_s *)camera;
4215 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_FLASH_MODE;
4217 LOGD("Enter, handle :%x", pc->remote_handle);
4220 if (pc->cb_info == NULL) {
4221 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4222 return CAMERA_ERROR_INVALID_PARAMETER;
4224 sock_fd = pc->cb_info->fd;
4225 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FLASH_MODE] = foreach_cb;
4226 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FLASH_MODE] = user_data;
4228 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4229 LOGD("ret : 0x%x", ret);
4234 int camera_attr_foreach_supported_fps(camera_h camera, camera_attr_supported_fps_cb foreach_cb , void *user_data)
4236 if( camera == NULL || foreach_cb == NULL){
4237 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4238 return CAMERA_ERROR_INVALID_PARAMETER;
4240 int ret = CAMERA_ERROR_NONE;
4242 camera_cli_s *pc = (camera_cli_s *)camera;
4243 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_FPS;
4245 if (pc->cb_info == NULL) {
4246 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4247 return CAMERA_ERROR_INVALID_PARAMETER;
4249 sock_fd = pc->cb_info->fd;
4250 LOGD("Enter, handle :%x", pc->remote_handle);
4251 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS] = foreach_cb;
4252 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS] = user_data;
4254 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4255 LOGD("Enter, handle :%x", pc->remote_handle);
4259 int camera_attr_foreach_supported_fps_by_resolution(camera_h camera, int width, int height, camera_attr_supported_fps_cb foreach_cb, void *user_data)
4261 if( camera == NULL || foreach_cb == NULL){
4262 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4263 return CAMERA_ERROR_INVALID_PARAMETER;
4265 int ret = CAMERA_ERROR_NONE;
4267 camera_cli_s *pc = (camera_cli_s *)camera;
4268 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_FPS_BY_RESOLUTION;
4270 if (pc->cb_info == NULL) {
4271 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4272 return CAMERA_ERROR_INVALID_PARAMETER;
4274 sock_fd = pc->cb_info->fd;
4275 LOGD("Enter, handle :%x", pc->remote_handle);
4276 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS_BY_RESOLUTION] = foreach_cb;
4277 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS_BY_RESOLUTION] = user_data;
4279 muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret, INT, width, INT, height);
4280 LOGD("ret : 0x%x", ret);
4284 int camera_attr_foreach_supported_stream_flip(camera_h camera, camera_attr_supported_stream_flip_cb foreach_cb, void *user_data)
4286 if( camera == NULL || foreach_cb == NULL){
4287 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4288 return CAMERA_ERROR_INVALID_PARAMETER;
4290 int ret = CAMERA_ERROR_NONE;
4292 camera_cli_s *pc = (camera_cli_s *)camera;
4293 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_STREAM_FLIP;
4295 if (pc->cb_info == NULL) {
4296 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4297 return CAMERA_ERROR_INVALID_PARAMETER;
4299 sock_fd = pc->cb_info->fd;
4300 LOGD("Enter, handle :%x", pc->remote_handle);
4301 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_FLIP] = foreach_cb;
4302 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_FLIP] = user_data;
4304 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4305 LOGD("ret : 0x%x", ret);
4310 int camera_attr_foreach_supported_stream_rotation(camera_h camera, camera_attr_supported_stream_rotation_cb foreach_cb, void *user_data)
4312 if( camera == NULL || foreach_cb == NULL){
4313 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4314 return CAMERA_ERROR_INVALID_PARAMETER;
4316 int ret = CAMERA_ERROR_NONE;
4318 camera_cli_s *pc = (camera_cli_s *)camera;
4319 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_STREAM_ROTATION;
4321 if (pc->cb_info == NULL) {
4322 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4323 return CAMERA_ERROR_INVALID_PARAMETER;
4325 sock_fd = pc->cb_info->fd;
4326 LOGD("Enter, handle :%x", pc->remote_handle);
4327 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_ROTATION] = foreach_cb;
4328 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_ROTATION] = user_data;
4330 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4331 LOGD("ret : 0x%x", ret);
4336 int camera_attr_set_stream_rotation(camera_h camera , camera_rotation_e rotation)
4338 if( camera == NULL){
4339 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4340 return CAMERA_ERROR_INVALID_PARAMETER;
4343 int ret = CAMERA_ERROR_NONE;
4344 camera_cli_s *pc = (camera_cli_s *)camera;
4345 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_STREAM_ROTATION;
4347 if (pc->cb_info == NULL) {
4348 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4349 return CAMERA_ERROR_INVALID_PARAMETER;
4351 sock_fd = pc->cb_info->fd;
4352 int set_rotation = (int)rotation;
4354 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4355 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_rotation);
4356 LOGD("ret : 0x%x", ret);
4361 int camera_attr_get_stream_rotation(camera_h camera , camera_rotation_e *rotation)
4363 if( camera == NULL || rotation == NULL ){
4364 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4365 return CAMERA_ERROR_INVALID_PARAMETER;
4368 int ret = CAMERA_ERROR_NONE;
4369 camera_cli_s *pc = (camera_cli_s *)camera;
4370 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_STREAM_ROTATION;
4372 if (pc->cb_info == NULL) {
4373 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4374 return CAMERA_ERROR_INVALID_PARAMETER;
4376 sock_fd = pc->cb_info->fd;
4379 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4380 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4382 if (ret == CAMERA_ERROR_NONE) {
4383 muse_camera_msg_get(get_rotation, pc->cb_info->recvMsg);
4384 *rotation = (camera_rotation_e)get_rotation;
4386 LOGD("ret : 0x%x", ret);
4391 int camera_attr_set_stream_flip(camera_h camera , camera_flip_e flip)
4393 if( camera == NULL){
4394 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4395 return CAMERA_ERROR_INVALID_PARAMETER;
4398 int ret = CAMERA_ERROR_NONE;
4399 camera_cli_s *pc = (camera_cli_s *)camera;
4400 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_STREAM_FLIP;
4402 if (pc->cb_info == NULL) {
4403 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4404 return CAMERA_ERROR_INVALID_PARAMETER;
4406 sock_fd = pc->cb_info->fd;
4407 int set_flip = (int)flip;
4409 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4410 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_flip);
4411 LOGD("ret : 0x%x", ret);
4416 int camera_attr_get_stream_flip(camera_h camera , camera_flip_e *flip)
4418 if( camera == NULL || flip == NULL ){
4419 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4420 return CAMERA_ERROR_INVALID_PARAMETER;
4423 int ret = CAMERA_ERROR_NONE;
4424 camera_cli_s *pc = (camera_cli_s *)camera;
4425 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_STREAM_FLIP;
4427 if (pc->cb_info == NULL) {
4428 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4429 return CAMERA_ERROR_INVALID_PARAMETER;
4431 sock_fd = pc->cb_info->fd;
4434 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4435 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4437 if (ret == CAMERA_ERROR_NONE) {
4438 muse_camera_msg_get(get_flip, pc->cb_info->recvMsg);
4439 *flip = (camera_flip_e)get_flip;
4441 LOGD("ret : 0x%x", ret);
4445 int camera_attr_set_hdr_mode(camera_h camera, camera_attr_hdr_mode_e mode)
4447 if( camera == NULL){
4448 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
4449 return CAMERA_ERROR_INVALID_PARAMETER;
4452 int ret = CAMERA_ERROR_NONE;
4453 camera_cli_s *pc = (camera_cli_s *)camera;
4454 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_HDR_MODE;
4456 if (pc->cb_info == NULL) {
4457 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4458 return CAMERA_ERROR_INVALID_PARAMETER;
4460 sock_fd = pc->cb_info->fd;
4461 int set_mode = (int)mode;
4463 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4464 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
4465 LOGD("ret : 0x%x", ret);
4470 int camera_attr_get_hdr_mode(camera_h camera, camera_attr_hdr_mode_e *mode)
4472 if (camera == NULL) {
4473 LOGE("INVALID_PARAMETER(0x%08x) - handle",CAMERA_ERROR_INVALID_PARAMETER);
4474 return CAMERA_ERROR_INVALID_PARAMETER;
4477 LOGE("CAMERA_ERROR_NOT_SUPPORTED(0x%08x) - mode",CAMERA_ERROR_NOT_SUPPORTED);
4478 return CAMERA_ERROR_NOT_SUPPORTED;
4480 int ret = CAMERA_ERROR_NONE;
4481 camera_cli_s *pc = (camera_cli_s *)camera;
4482 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_HDR_MODE;
4484 if (pc->cb_info == NULL) {
4485 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4486 return CAMERA_ERROR_INVALID_PARAMETER;
4488 sock_fd = pc->cb_info->fd;
4491 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4492 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4494 if (ret == CAMERA_ERROR_NONE) {
4495 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
4496 *mode = (camera_attr_hdr_mode_e)get_mode;
4498 LOGD("ret : 0x%x", ret);
4503 bool camera_attr_is_supported_hdr_capture(camera_h camera)
4505 if( camera == NULL){
4506 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4510 int ret = CAMERA_ERROR_NONE;
4511 camera_cli_s *pc = (camera_cli_s *)camera;
4512 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_SUPPORTED_HDR_CAPTURE;
4514 if (pc->cb_info == NULL) {
4515 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4516 return CAMERA_ERROR_INVALID_PARAMETER;
4518 sock_fd = pc->cb_info->fd;
4519 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4520 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4521 LOGD("ret : 0x%x", ret);
4526 int camera_attr_set_hdr_capture_progress_cb(camera_h camera, camera_attr_hdr_progress_cb callback, void* user_data)
4528 if (camera == NULL) {
4529 LOGE("INVALID_PARAMETER(0x%08x) - handle", CAMERA_ERROR_INVALID_PARAMETER);
4530 return CAMERA_ERROR_INVALID_PARAMETER;
4532 if (callback == NULL) {
4533 LOGE("CAMERA_ERROR_NOT_SUPPORTED(0x%08x) - callback", CAMERA_ERROR_NOT_SUPPORTED);
4534 return CAMERA_ERROR_NOT_SUPPORTED;
4536 int ret = CAMERA_ERROR_NONE;
4538 camera_cli_s *pc = (camera_cli_s *)camera;
4539 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_HDR_CAPTURE_PROGRESS_CB;
4541 if (pc->cb_info == NULL) {
4542 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4543 return CAMERA_ERROR_INVALID_PARAMETER;
4545 sock_fd = pc->cb_info->fd;
4546 LOGD("Enter, handle :%x", pc->remote_handle);
4548 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_HDR_PROGRESS] = callback;
4549 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_HDR_PROGRESS] = user_data;
4551 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4552 LOGD("ret : 0x%x", ret);
4557 int camera_attr_unset_hdr_capture_progress_cb(camera_h camera)
4559 if( camera == NULL){
4560 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4561 return CAMERA_ERROR_INVALID_PARAMETER;
4564 int ret = CAMERA_ERROR_NONE;
4566 camera_cli_s *pc = (camera_cli_s *)camera;
4567 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_UNSET_HDR_CAPTURE_PROGRESS_CB;
4569 if (pc->cb_info == NULL) {
4570 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4571 return CAMERA_ERROR_INVALID_PARAMETER;
4573 sock_fd = pc->cb_info->fd;
4574 LOGD("Enter, handle :%x", pc->remote_handle);
4576 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_HDR_PROGRESS] = (void *)NULL;
4577 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_HDR_PROGRESS] = (void *)NULL;
4579 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4580 LOGD("ret : 0x%x", ret);
4585 int camera_attr_enable_anti_shake(camera_h camera, bool enable)
4587 if (camera == NULL) {
4588 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4589 return CAMERA_ERROR_INVALID_PARAMETER;
4592 int ret = CAMERA_ERROR_NONE;
4593 camera_cli_s *pc = (camera_cli_s *)camera;
4594 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_ENABLE_ANTI_SHAKE;
4596 if (pc->cb_info == NULL) {
4597 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4598 return CAMERA_ERROR_INVALID_PARAMETER;
4600 sock_fd = pc->cb_info->fd;
4601 int set_enable = (int)enable;
4603 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4604 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_enable);
4605 LOGD("ret : 0x%x", ret);
4610 int camera_attr_is_enabled_anti_shake(camera_h camera , bool *enabled)
4612 if (camera == NULL) {
4613 LOGE("INVALID_PARAMETER(0x%08x) - handle", CAMERA_ERROR_INVALID_PARAMETER);
4614 return CAMERA_ERROR_INVALID_PARAMETER;
4616 if (enabled == NULL) {
4617 LOGE("INVALID_PARAMETER(0x%08x) - enabled", CAMERA_ERROR_INVALID_PARAMETER);
4618 return CAMERA_ERROR_NOT_SUPPORTED;
4620 int ret = CAMERA_ERROR_NONE;
4621 camera_cli_s *pc = (camera_cli_s *)camera;
4622 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_ENABLED_ANTI_SHAKE;
4624 if (pc->cb_info == NULL) {
4625 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4626 return CAMERA_ERROR_INVALID_PARAMETER;
4628 sock_fd = pc->cb_info->fd;
4631 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4632 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4634 if (ret == CAMERA_ERROR_NONE) {
4635 muse_camera_msg_get(get_enabled, pc->cb_info->recvMsg);
4636 *enabled = (bool)get_enabled;
4638 LOGD("ret : 0x%x", ret);
4643 bool camera_attr_is_supported_anti_shake(camera_h camera)
4646 if( camera == NULL){
4647 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4651 int ret = CAMERA_ERROR_NONE;
4652 camera_cli_s *pc = (camera_cli_s *)camera;
4653 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_SUPPORTED_ANTI_SHAKE;
4655 if (pc->cb_info == NULL) {
4656 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4657 return CAMERA_ERROR_INVALID_PARAMETER;
4659 sock_fd = pc->cb_info->fd;
4660 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4661 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4662 LOGD("ret : 0x%x", ret);
4667 int camera_attr_enable_video_stabilization(camera_h camera, bool enable)
4669 if (camera == NULL) {
4670 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4671 return CAMERA_ERROR_INVALID_PARAMETER;
4674 int ret = CAMERA_ERROR_NONE;
4675 camera_cli_s *pc = (camera_cli_s *)camera;
4676 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_ENABLE_VIDEO_STABILIZATION;
4678 if (pc->cb_info == NULL) {
4679 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4680 return CAMERA_ERROR_INVALID_PARAMETER;
4682 sock_fd = pc->cb_info->fd;
4683 int set_enable = (int)enable;
4685 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4686 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_enable);
4687 LOGD("ret : 0x%x", ret);
4692 int camera_attr_is_enabled_video_stabilization(camera_h camera, bool *enabled)
4694 if (camera == NULL) {
4695 LOGE("INVALID_PARAMETER(0x%08x) - handle",CAMERA_ERROR_INVALID_PARAMETER);
4696 return CAMERA_ERROR_INVALID_PARAMETER;
4698 if (enabled == NULL) {
4699 LOGE("INVALID_PARAMETER(0x%08x) - enabled",CAMERA_ERROR_INVALID_PARAMETER);
4700 return CAMERA_ERROR_NOT_SUPPORTED;
4702 int ret = CAMERA_ERROR_NONE;
4703 camera_cli_s *pc = (camera_cli_s *)camera;
4704 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_ENABLED_VIDEO_STABILIZATION;
4706 if (pc->cb_info == NULL) {
4707 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4708 return CAMERA_ERROR_INVALID_PARAMETER;
4710 sock_fd = pc->cb_info->fd;
4713 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4714 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4716 if (ret == CAMERA_ERROR_NONE) {
4717 muse_camera_msg_get(get_enabled, pc->cb_info->recvMsg);
4718 *enabled = (bool)get_enabled;
4720 LOGD("ret : 0x%x", ret);
4725 bool camera_attr_is_supported_video_stabilization(camera_h camera)
4727 if( camera == NULL){
4728 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4732 int ret = CAMERA_ERROR_NONE;
4733 camera_cli_s *pc = (camera_cli_s *)camera;
4734 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_SUPPORTED_VIDEO_STABILIZATION;
4736 if (pc->cb_info == NULL) {
4737 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4738 return CAMERA_ERROR_INVALID_PARAMETER;
4740 sock_fd = pc->cb_info->fd;
4741 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4742 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4743 LOGD("ret : 0x%x", ret);
4748 int camera_attr_enable_auto_contrast(camera_h camera, bool enable)
4750 if( camera == NULL){
4751 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
4752 return CAMERA_ERROR_INVALID_PARAMETER;
4755 int ret = CAMERA_ERROR_NONE;
4756 camera_cli_s *pc = (camera_cli_s *)camera;
4757 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_ENABLE_AUTO_CONTRAST;
4759 if (pc->cb_info == NULL) {
4760 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4761 return CAMERA_ERROR_INVALID_PARAMETER;
4763 sock_fd = pc->cb_info->fd;
4764 int set_enable = (int)enable;
4766 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4767 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_enable);
4768 LOGD("ret : 0x%x", ret);
4773 int camera_attr_is_enabled_auto_contrast(camera_h camera, bool *enabled)
4775 if (camera == NULL) {
4776 LOGE("INVALID_PARAMETER(0x%08x) - handle", CAMERA_ERROR_INVALID_PARAMETER);
4777 return CAMERA_ERROR_INVALID_PARAMETER;
4779 if (enabled == NULL) {
4780 LOGE("INVALID_PARAMETER(0x%08x) - enabled", CAMERA_ERROR_INVALID_PARAMETER);
4781 return CAMERA_ERROR_INVALID_PARAMETER;
4783 int ret = CAMERA_ERROR_NONE;
4784 camera_cli_s *pc = (camera_cli_s *)camera;
4785 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_ENABLED_AUTO_CONTRAST;
4787 if (pc->cb_info == NULL) {
4788 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4789 return CAMERA_ERROR_INVALID_PARAMETER;
4791 sock_fd = pc->cb_info->fd;
4794 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4795 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4797 if (ret == CAMERA_ERROR_NONE) {
4798 muse_camera_msg_get(get_enabled, pc->cb_info->recvMsg);
4799 *enabled = (bool)get_enabled;
4801 LOGD("ret : 0x%x", ret);
4806 bool camera_attr_is_supported_auto_contrast(camera_h camera)
4808 if( camera == NULL){
4809 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4813 int ret = CAMERA_ERROR_NONE;
4814 camera_cli_s *pc = (camera_cli_s *)camera;
4815 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_SUPPORTED_AUTO_CONTRAST;
4817 if (pc->cb_info == NULL) {
4818 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4819 return CAMERA_ERROR_INVALID_PARAMETER;
4821 sock_fd = pc->cb_info->fd;
4822 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4823 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4824 LOGD("ret : 0x%x", ret);
4829 int camera_attr_disable_shutter_sound(camera_h camera, bool disable)
4831 if (camera == NULL) {
4832 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4833 return CAMERA_ERROR_INVALID_PARAMETER;
4836 int ret = CAMERA_ERROR_NONE;
4837 camera_cli_s *pc = (camera_cli_s *)camera;
4838 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_DISABLE_SHUTTER_SOUND;
4840 if (pc->cb_info == NULL) {
4841 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4842 return CAMERA_ERROR_INVALID_PARAMETER;
4844 sock_fd = pc->cb_info->fd;
4845 int set_disable = (int)disable;
4847 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4848 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_disable);
4849 LOGD("ret : 0x%x", ret);