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);
1239 #endif /* HAVE_WAYLAND */
1244 LOGE("camera destroy error : 0x%x", ret);
1250 int camera_start_preview(camera_h camera)
1252 int ret = CAMERA_ERROR_NONE;
1253 muse_camera_api_e api = MUSE_CAMERA_API_START_PREVIEW;
1254 camera_cli_s *pc = (camera_cli_s *)camera;
1256 int prev_state = CAMERA_STATE_NONE;
1257 char caps[MUSE_CAMERA_MSG_MAX_LENGTH] = {0};
1259 if (camera == NULL) {
1260 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1261 return CAMERA_ERROR_INVALID_PARAMETER;
1264 if (pc->cb_info == NULL) {
1265 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1266 return CAMERA_ERROR_INVALID_PARAMETER;
1271 sock_fd = pc->cb_info->fd;
1273 if (pc->client_handle == NULL) {
1274 LOGW("set display is not called by application. set NONE type internally");
1275 ret = camera_set_display(camera, CAMERA_DISPLAY_TYPE_NONE, NULL);
1276 if (ret != CAMERA_ERROR_NONE) {
1277 LOGE("Internal camera_set_display failed 0x%x", ret);
1282 muse_camera_msg_send_longtime(api, sock_fd, pc->cb_info, ret);
1284 if (ret != CAMERA_ERROR_NONE) {
1285 LOGE("start preview failed 0x%x", ret);
1289 muse_camera_msg_get(prev_state, pc->cb_info->recvMsg);
1291 if (prev_state == CAMERA_STATE_CREATED) {
1292 muse_camera_msg_get_string(caps, pc->cb_info->recvMsg);
1294 LOGE("failed to get caps string");
1295 goto _START_PREVIEW_ERROR;
1298 LOGD("caps : %s", caps);
1300 ret = mm_camcorder_client_realize(pc->client_handle, caps);
1301 if (ret != MM_ERROR_NONE) {
1302 LOGE("client realize failed 0x%x", ret);
1303 goto _START_PREVIEW_ERROR;
1307 LOGD("ret : 0x%x", ret);
1309 return CAMERA_ERROR_NONE;
1311 _START_PREVIEW_ERROR:
1312 muse_camera_msg_send_longtime(MUSE_CAMERA_API_STOP_PREVIEW, sock_fd, pc->cb_info, ret);
1314 return CAMERA_ERROR_INVALID_OPERATION;
1317 int camera_stop_preview(camera_h camera)
1319 if (camera == NULL) {
1320 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1321 return CAMERA_ERROR_INVALID_PARAMETER;
1323 int ret = CAMERA_ERROR_NONE;
1324 camera_cli_s *pc = (camera_cli_s *)camera;
1326 muse_camera_api_e api = MUSE_CAMERA_API_STOP_PREVIEW;
1328 if (pc->cb_info == NULL) {
1329 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1330 return CAMERA_ERROR_INVALID_PARAMETER;
1333 sock_fd = pc->cb_info->fd;
1335 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1337 if (ret != CAMERA_ERROR_NONE) {
1338 LOGE("stop preview failed 0x%x", ret);
1342 if (pc->client_handle != NULL) {
1343 if (mm_camcorder_client_unrealize(pc->client_handle) == MM_ERROR_NONE) {
1344 LOGD("client unrealize done");
1346 LOGE("client unrealize failed. restart preview...");
1347 muse_camera_msg_send_longtime(MUSE_CAMERA_API_START_PREVIEW, sock_fd, pc->cb_info, ret);
1348 return CAMERA_ERROR_INVALID_OPERATION;
1351 LOGW("client handle is NULL");
1354 LOGD("ret : 0x%x", ret);
1359 int camera_start_capture(camera_h camera, camera_capturing_cb capturing_cb, camera_capture_completed_cb completed_cb, void *user_data)
1361 if (camera == NULL) {
1362 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1363 return CAMERA_ERROR_INVALID_PARAMETER;
1365 int ret = CAMERA_ERROR_NONE;
1367 camera_cli_s *pc = (camera_cli_s *)camera;
1368 muse_camera_api_e api = MUSE_CAMERA_API_START_CAPTURE;
1370 int is_capturing_cb = 0;
1371 int is_completed_cb = 0;
1372 LOGD("Enter, handle :%x", pc->remote_handle);
1374 if (pc->cb_info == NULL) {
1375 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1376 return CAMERA_ERROR_INVALID_PARAMETER;
1379 sock_fd = pc->cb_info->fd;
1381 if (capturing_cb != NULL) {
1382 is_capturing_cb = 1;
1383 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_CAPTURE] = capturing_cb;
1384 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_CAPTURE] = user_data;
1387 if(completed_cb != NULL) {
1388 is_completed_cb = 1;
1389 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_CAPTURE_COMPLETE] = completed_cb;
1390 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_CAPTURE_COMPLETE] = user_data;
1393 muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret, INT, is_capturing_cb, INT, is_completed_cb);
1394 LOGD("is_capturing_cb :%d, is_completed_cb : %d", is_capturing_cb, is_completed_cb);
1395 LOGD("ret : 0x%x", ret);
1399 bool camera_is_supported_continuous_capture(camera_h camera)
1401 if (camera == NULL) {
1402 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1406 int ret = CAMERA_ERROR_NONE;
1407 camera_cli_s *pc = (camera_cli_s *)camera;
1408 muse_camera_api_e api = MUSE_CAMERA_API_SUPPORT_CONTINUOUS_CAPTURE;
1411 if (pc->cb_info == NULL) {
1412 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1413 return CAMERA_ERROR_INVALID_PARAMETER;
1416 sock_fd = pc->cb_info->fd;
1418 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1419 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1420 LOGD("ret : 0x%x", ret);
1424 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)
1426 if (camera == NULL) {
1427 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
1428 return CAMERA_ERROR_INVALID_PARAMETER;
1431 int ret = CAMERA_ERROR_NONE;
1433 camera_cli_s *pc = (camera_cli_s *)camera;
1434 muse_camera_api_e api = MUSE_CAMERA_API_START_CONTINUOUS_CAPTURE;
1436 LOGD("Enter, handle :%x", pc->remote_handle);
1439 if (pc->cb_info == NULL) {
1440 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1441 return CAMERA_ERROR_INVALID_PARAMETER;
1443 sock_fd = pc->cb_info->fd;
1445 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_CAPTURE] = capturing_cb;
1446 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_CAPTURE] = user_data;
1447 pc->cb_info->user_cb_completed[MUSE_CAMERA_EVENT_TYPE_CAPTURE] = completed_cb;
1449 muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret, INT, count, INT, interval);
1450 LOGD("ret : 0x%x", ret);
1454 int camera_stop_continuous_capture(camera_h camera)
1456 if (camera == NULL) {
1457 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1458 return CAMERA_ERROR_INVALID_PARAMETER;
1462 int ret = CAMERA_ERROR_NONE;
1464 camera_cli_s *pc = (camera_cli_s *)camera;
1465 muse_camera_api_e api = MUSE_CAMERA_API_STOP_CONTINUOUS_CAPTURE;
1466 LOGD("Enter, handle :%x", pc->remote_handle);
1468 if (pc->cb_info == NULL) {
1469 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1470 return CAMERA_ERROR_INVALID_PARAMETER;
1472 sock_fd = pc->cb_info->fd;
1473 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1474 LOGD("ret : 0x%x", ret);
1478 bool camera_is_supported_face_detection(camera_h camera)
1480 if (camera == NULL) {
1481 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1484 int ret = CAMERA_ERROR_NONE;
1486 camera_cli_s *pc = (camera_cli_s *)camera;
1487 muse_camera_api_e api = MUSE_CAMERA_API_SUPPORT_FACE_DETECTION;
1489 if (pc->cb_info == NULL) {
1490 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1491 return CAMERA_ERROR_INVALID_PARAMETER;
1493 sock_fd = pc->cb_info->fd;
1495 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1496 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1497 LOGD("ret : 0x%x", ret);
1501 bool camera_is_supported_zero_shutter_lag(camera_h camera)
1503 if (camera == NULL) {
1504 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1507 int ret = CAMERA_ERROR_NONE;
1509 camera_cli_s *pc = (camera_cli_s *)camera;
1510 muse_camera_api_e api = MUSE_CAMERA_API_SUPPORT_ZERO_SHUTTER_LAG;
1512 if (pc->cb_info == NULL) {
1513 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1514 return CAMERA_ERROR_INVALID_PARAMETER;
1516 sock_fd = pc->cb_info->fd;
1518 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1519 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1520 LOGD("ret : 0x%x", ret);
1524 bool camera_is_supported_media_packet_preview_cb(camera_h camera)
1526 if (camera == NULL) {
1527 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1531 int ret = CAMERA_ERROR_NONE;
1533 camera_cli_s *pc = (camera_cli_s *)camera;
1534 muse_camera_api_e api = MUSE_CAMERA_API_SUPPORT_MEDIA_PACKET_PREVIEW_CB;
1536 if (pc->cb_info == NULL) {
1537 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1538 return CAMERA_ERROR_INVALID_PARAMETER;
1540 sock_fd = pc->cb_info->fd;
1542 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1543 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1544 LOGD("ret : 0x%x", ret);
1548 int camera_get_device_count(camera_h camera, int *device_count)
1550 if (camera == NULL || device_count == NULL) {
1551 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
1552 return CAMERA_ERROR_INVALID_PARAMETER;
1554 int ret = CAMERA_ERROR_NONE;
1556 camera_cli_s *pc = (camera_cli_s *)camera;
1557 muse_camera_api_e api = MUSE_CAMERA_API_GET_DEVICE_COUNT;
1559 if (pc->cb_info == NULL) {
1560 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1561 return CAMERA_ERROR_INVALID_PARAMETER;
1563 sock_fd = pc->cb_info->fd;
1564 int get_device_count;
1566 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1567 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1569 if (ret == CAMERA_ERROR_NONE) {
1570 muse_camera_msg_get(get_device_count, pc->cb_info->recvMsg);
1571 *device_count = get_device_count;
1573 LOGD("ret : 0x%x", ret);
1577 int camera_start_face_detection(camera_h camera, camera_face_detected_cb callback, void * user_data)
1579 if (camera == NULL) {
1580 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
1581 return CAMERA_ERROR_INVALID_PARAMETER;
1584 int ret = CAMERA_ERROR_NONE;
1586 camera_cli_s *pc = (camera_cli_s *)camera;
1587 muse_camera_api_e api = MUSE_CAMERA_API_START_FACE_DETECTION;
1589 LOGD("Enter, handle :%x", pc->remote_handle);
1591 if (pc->cb_info == NULL) {
1592 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1593 return CAMERA_ERROR_INVALID_PARAMETER;
1595 sock_fd = pc->cb_info->fd;
1596 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FACE_DETECTION] = callback;
1597 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FACE_DETECTION] = user_data;
1599 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1600 LOGD("ret : 0x%x", ret);
1604 int camera_stop_face_detection(camera_h camera)
1606 if (camera == NULL) {
1607 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1608 return CAMERA_ERROR_INVALID_PARAMETER;
1611 int ret = CAMERA_ERROR_NONE;
1613 camera_cli_s *pc = (camera_cli_s *)camera;
1614 muse_camera_api_e api = MUSE_CAMERA_API_STOP_FACE_DETECTION;
1615 LOGD("Enter, handle :%x", pc->remote_handle);
1617 if (pc->cb_info == NULL) {
1618 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1619 return CAMERA_ERROR_INVALID_PARAMETER;
1621 sock_fd = pc->cb_info->fd;
1622 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1623 LOGD("ret : 0x%x", ret);
1627 int camera_get_state(camera_h camera, camera_state_e * state)
1629 if (camera == NULL || state == NULL) {
1630 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1631 return CAMERA_ERROR_INVALID_PARAMETER;
1633 int ret = CAMERA_ERROR_NONE;
1635 camera_cli_s *pc = (camera_cli_s *)camera;
1636 muse_camera_api_e api = MUSE_CAMERA_API_GET_STATE;
1638 if (pc->cb_info == NULL) {
1639 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1640 return CAMERA_ERROR_INVALID_PARAMETER;
1642 sock_fd = pc->cb_info->fd;
1645 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1646 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1648 if (ret == CAMERA_ERROR_NONE) {
1649 muse_camera_msg_get(get_state, pc->cb_info->recvMsg);
1650 *state = (camera_state_e)get_state;
1652 LOGD("ret : 0x%x", ret);
1656 int camera_start_focusing(camera_h camera, bool continuous)
1658 if( camera == NULL){
1659 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1660 return CAMERA_ERROR_INVALID_PARAMETER;
1663 int ret = CAMERA_ERROR_NONE;
1665 camera_cli_s *pc = (camera_cli_s *)camera;
1666 muse_camera_api_e api = MUSE_CAMERA_API_START_FOCUSING;
1668 if (pc->cb_info == NULL) {
1669 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1670 return CAMERA_ERROR_INVALID_PARAMETER;
1672 sock_fd = pc->cb_info->fd;
1673 int is_continuous = (int)continuous;
1675 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1676 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, is_continuous);
1677 LOGD("ret : 0x%x", ret);
1681 int camera_cancel_focusing(camera_h camera)
1683 if (camera == NULL) {
1684 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1685 return CAMERA_ERROR_INVALID_PARAMETER;
1688 int ret = CAMERA_ERROR_NONE;
1690 camera_cli_s *pc = (camera_cli_s *)camera;
1691 muse_camera_api_e api = MUSE_CAMERA_API_CANCEL_FOCUSING;
1693 if (pc->cb_info == NULL) {
1694 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1695 return CAMERA_ERROR_INVALID_PARAMETER;
1697 sock_fd = pc->cb_info->fd;
1699 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1700 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1701 LOGD("ret : 0x%x", ret);
1705 int camera_set_display(camera_h camera, camera_display_type_e type, camera_display_h display)
1707 int ret = CAMERA_ERROR_NONE;
1708 void *set_display_handle = NULL;
1709 int set_surface = MM_DISPLAY_SURFACE_X;
1710 Evas_Object *obj = NULL;
1711 const char *object_type = NULL;
1712 char socket_path[MUSE_CAMERA_MSG_MAX_LENGTH] = {0,};
1714 MMCamWaylandInfo *wl_info = NULL;
1715 #endif /* HAVE_WAYLAND */
1717 if (camera == NULL) {
1718 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
1719 return CAMERA_ERROR_INVALID_PARAMETER;
1722 if (type != CAMERA_DISPLAY_TYPE_NONE && display == NULL) {
1723 LOGE("display type[%d] is not NONE, but display handle is NULL", type);
1724 return CAMERA_ERROR_INVALID_PARAMETER;
1727 camera_cli_s *pc = (camera_cli_s *)camera;
1728 muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY;
1730 if (pc->cb_info == NULL) {
1731 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1732 return CAMERA_ERROR_INVALID_PARAMETER;
1734 sock_fd = pc->cb_info->fd;
1736 LOGD("Enter, remote_handle : %x display : 0x%x", pc->remote_handle, display);
1738 if (type == CAMERA_DISPLAY_TYPE_NONE) {
1739 set_display_handle = 0;
1740 set_surface = MM_DISPLAY_SURFACE_NULL;
1741 LOGD("display type NONE");
1743 obj = (Evas_Object *)display;
1744 object_type = evas_object_type_get(obj);
1746 if (type == CAMERA_DISPLAY_TYPE_OVERLAY && !strcmp(object_type, "elm_win")) {
1748 /* set wayland info */
1749 wl_info = _get_wl_info(obj);
1750 if (wl_info == NULL) {
1751 LOGE("failed to get wl_info");
1752 return CAMERA_ERROR_INVALID_OPERATION;
1755 set_display_handle = (void *)wl_info;
1756 #else /* HAVE_WAYLAND */
1757 /* x window overlay surface */
1758 set_display_handle = (void *)elm_win_xwindow_get(obj);
1760 set_surface = MM_DISPLAY_SURFACE_X;
1761 LOGD("display type OVERLAY : handle %p", set_display_handle);
1762 } else if (type == CAMERA_DISPLAY_TYPE_EVAS && !strcmp(object_type, "image")) {
1763 /* evas object surface */
1764 set_display_handle = (void *)display;
1765 set_surface = MM_DISPLAY_SURFACE_EVAS;
1766 LOGD("display type EVAS : handle %p", set_display_handle);
1768 LOGE("unknown evas object [%p,%s] or type [%d] mismatch", obj, object_type, type);
1769 return CAMERA_ERROR_INVALID_PARAMETER;
1772 LOGE("failed to get evas object type from %p", obj);
1773 return CAMERA_ERROR_INVALID_PARAMETER;
1777 pc->cli_display_handle = (intptr_t)set_display_handle;
1779 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1781 if (ret == CAMERA_ERROR_NONE) {
1782 if (pc->client_handle == NULL) {
1783 ret = mm_camcorder_client_create(&pc->client_handle);
1784 if (ret != MM_ERROR_NONE) {
1785 LOGE("camera client create Failed 0x%x", ret);
1786 goto _SET_DISPLAY_ERROR;
1790 muse_camera_msg_get_string(socket_path, pc->cb_info->recvMsg);
1791 if (socket_path == NULL) {
1792 LOGE("failed to get socket path");
1793 goto _SET_DISPLAY_ERROR;
1796 LOGD("shmsrc socket path : %s", socket_path);
1798 ret = mm_camcorder_client_set_shm_socket_path(pc->client_handle, socket_path);
1799 if (ret != MM_ERROR_NONE) {
1800 LOGE("failed to set socket path 0x%x", ret);
1801 goto _SET_DISPLAY_ERROR;
1804 ret = mm_camcorder_set_attributes(pc->client_handle, NULL,
1805 MMCAM_DISPLAY_SURFACE, set_surface,
1807 if (ret != MM_ERROR_NONE) {
1808 LOGE("set display surface failed 0x%x", ret);
1809 goto _SET_DISPLAY_ERROR;
1812 if (type != CAMERA_DISPLAY_TYPE_NONE) {
1813 ret = mm_camcorder_set_attributes(pc->client_handle, NULL,
1814 MMCAM_DISPLAY_HANDLE, set_display_handle, sizeof(void *),
1816 if (ret != MM_ERROR_NONE) {
1817 LOGE("set display handle failed 0x%x", ret);
1818 goto _SET_DISPLAY_ERROR;
1824 g_free(pc->wl_info);
1828 pc->wl_info = wl_info;
1829 #endif /* HAVE_WAYLAND */
1831 return CAMERA_ERROR_NONE;;
1833 LOGE("set display error - 0x%x");
1843 #endif /* HAVE_WAYLAND */
1845 return __convert_camera_error_code(__func__, ret);
1848 int camera_set_preview_resolution(camera_h camera, int width, int height)
1850 if( camera == NULL){
1851 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1852 return CAMERA_ERROR_INVALID_PARAMETER;
1854 int ret = CAMERA_ERROR_NONE;
1856 camera_cli_s *pc = (camera_cli_s *)camera;
1857 muse_camera_api_e api = MUSE_CAMERA_API_SET_PREVIEW_RESOLUTION;
1859 if (pc->cb_info == NULL) {
1860 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1861 return CAMERA_ERROR_INVALID_PARAMETER;
1863 sock_fd = pc->cb_info->fd;
1865 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1866 muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret, INT, width, INT, height);
1867 LOGD("ret : 0x%x", ret);
1872 int camera_set_capture_resolution(camera_h camera, int width, int height)
1874 if (camera == NULL) {
1875 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1876 return CAMERA_ERROR_INVALID_PARAMETER;
1879 int ret = CAMERA_ERROR_NONE;
1881 camera_cli_s *pc = (camera_cli_s *)camera;
1882 muse_camera_api_e api = MUSE_CAMERA_API_SET_CAPTURE_RESOLUTION;
1884 if (pc->cb_info == NULL) {
1885 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1886 return CAMERA_ERROR_INVALID_PARAMETER;
1888 sock_fd = pc->cb_info->fd;
1890 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1891 muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret, INT, width, INT, height);
1892 LOGD("ret : 0x%x", ret);
1896 int camera_set_capture_format(camera_h camera, camera_pixel_format_e format)
1898 if (camera == NULL) {
1899 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1900 return CAMERA_ERROR_INVALID_PARAMETER;
1903 int ret = CAMERA_ERROR_NONE;
1904 int set_format = (int)format;
1906 camera_cli_s *pc = (camera_cli_s *)camera;
1907 muse_camera_api_e api = MUSE_CAMERA_API_SET_CAPTURE_FORMAT;
1909 if (pc->cb_info == NULL) {
1910 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1911 return CAMERA_ERROR_INVALID_PARAMETER;
1913 sock_fd = pc->cb_info->fd;
1915 LOGD("Enter, remote_handle : %x, capture_format: %d", pc->remote_handle, set_format);
1916 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_format);
1917 LOGD("ret : 0x%x", ret);
1921 int camera_set_preview_format(camera_h camera, camera_pixel_format_e format)
1923 if (camera == NULL) {
1924 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1925 return CAMERA_ERROR_INVALID_PARAMETER;
1928 int ret = CAMERA_ERROR_NONE;
1929 int set_format = (int)format;
1931 camera_cli_s *pc = (camera_cli_s *)camera;
1932 muse_camera_api_e api = MUSE_CAMERA_API_SET_PREVIEW_FORMAT;
1934 if (pc->cb_info == NULL) {
1935 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1936 return CAMERA_ERROR_INVALID_PARAMETER;
1938 sock_fd = pc->cb_info->fd;
1940 LOGD("Enter, remote_handle : %x, capture_format: %d", pc->remote_handle, set_format);
1941 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_format);
1942 LOGD("ret : 0x%x", ret);
1946 int camera_get_preview_resolution(camera_h camera, int *width, int *height)
1948 if (camera == NULL || width == NULL || height == NULL) {
1949 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1950 return CAMERA_ERROR_INVALID_PARAMETER;
1954 int ret = CAMERA_ERROR_NONE;
1956 camera_cli_s *pc = (camera_cli_s *)camera;
1957 muse_camera_api_e api = MUSE_CAMERA_API_GET_PREVIEW_RESOLUTION;
1959 if (pc->cb_info == NULL) {
1960 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1961 return CAMERA_ERROR_INVALID_PARAMETER;
1963 sock_fd = pc->cb_info->fd;
1967 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1968 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1970 if (ret == CAMERA_ERROR_NONE) {
1971 muse_camera_msg_get(get_width, pc->cb_info->recvMsg);
1972 muse_camera_msg_get(get_height, pc->cb_info->recvMsg);
1974 *height = get_height;
1976 LOGD("ret : 0x%x", ret);
1980 int camera_set_display_rotation(camera_h camera, camera_rotation_e rotation)
1982 if( camera == NULL){
1983 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1984 return CAMERA_ERROR_INVALID_PARAMETER;
1987 int ret = CAMERA_ERROR_NONE;
1988 camera_cli_s *pc = (camera_cli_s *)camera;
1989 muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY_ROTATION;
1991 if (pc->cb_info == NULL) {
1992 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1993 return CAMERA_ERROR_INVALID_PARAMETER;
1995 sock_fd = pc->cb_info->fd;
1996 int set_rotation = (int)rotation;
1998 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1999 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_rotation);
2000 LOGD("ret : 0x%x", ret);
2004 int camera_get_display_rotation(camera_h camera, camera_rotation_e *rotation)
2006 if( camera == NULL || rotation == NULL ){
2007 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2008 return CAMERA_ERROR_INVALID_PARAMETER;
2011 int ret = CAMERA_ERROR_NONE;
2013 camera_cli_s *pc = (camera_cli_s *)camera;
2014 muse_camera_api_e api = MUSE_CAMERA_API_GET_DISPLAY_ROTATION;
2016 if (pc->cb_info == NULL) {
2017 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2018 return CAMERA_ERROR_INVALID_PARAMETER;
2020 sock_fd = pc->cb_info->fd;
2023 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2024 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2026 if (ret == CAMERA_ERROR_NONE) {
2027 muse_camera_msg_get(get_rotation, pc->cb_info->recvMsg);
2028 *rotation = (camera_rotation_e)get_rotation;
2030 LOGD("ret : 0x%x", ret);
2034 int camera_set_display_flip(camera_h camera, camera_flip_e flip)
2036 if( camera == NULL){
2037 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2038 return CAMERA_ERROR_INVALID_PARAMETER;
2041 int ret = CAMERA_ERROR_NONE;
2043 camera_cli_s *pc = (camera_cli_s *)camera;
2044 muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY_FLIP;
2046 if (pc->cb_info == NULL) {
2047 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2048 return CAMERA_ERROR_INVALID_PARAMETER;
2050 sock_fd = pc->cb_info->fd;
2051 int set_flip = (int)flip;
2053 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2054 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_flip);
2055 LOGD("ret : 0x%x", ret);
2059 int camera_get_display_flip(camera_h camera, camera_flip_e *flip)
2061 if( camera == NULL || flip == NULL ){
2062 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2063 return CAMERA_ERROR_INVALID_PARAMETER;
2066 int ret = CAMERA_ERROR_NONE;
2068 camera_cli_s *pc = (camera_cli_s *)camera;
2069 muse_camera_api_e api = MUSE_CAMERA_API_GET_DISPLAY_FLIP;
2071 if (pc->cb_info == NULL) {
2072 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2073 return CAMERA_ERROR_INVALID_PARAMETER;
2075 sock_fd = pc->cb_info->fd;
2078 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2079 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2081 if (ret == CAMERA_ERROR_NONE) {
2082 muse_camera_msg_get(get_flip, pc->cb_info->recvMsg);
2083 *flip = (camera_flip_e)get_flip;
2085 LOGD("ret : 0x%x", ret);
2089 int camera_set_display_visible(camera_h camera, bool visible)
2091 if( camera == NULL){
2092 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2093 return CAMERA_ERROR_INVALID_PARAMETER;
2096 int ret = CAMERA_ERROR_NONE;
2098 camera_cli_s *pc = (camera_cli_s *)camera;
2099 muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY_VISIBLE;
2100 int set_visible = (int)visible;
2102 if (pc->cb_info == NULL) {
2103 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2104 return CAMERA_ERROR_INVALID_PARAMETER;
2106 sock_fd = pc->cb_info->fd;
2108 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2109 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_visible);
2110 LOGD("ret : 0x%x", ret);
2114 int camera_is_display_visible(camera_h camera, bool* visible)
2116 if( camera == NULL || visible == NULL){
2117 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2118 return CAMERA_ERROR_INVALID_PARAMETER;
2121 int ret = CAMERA_ERROR_NONE;
2123 camera_cli_s *pc = (camera_cli_s *)camera;
2124 muse_camera_api_e api = MUSE_CAMERA_API_IS_DISPLAY_VISIBLE;
2126 if (pc->cb_info == NULL) {
2127 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2128 return CAMERA_ERROR_INVALID_PARAMETER;
2130 sock_fd = pc->cb_info->fd;
2133 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2134 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2136 if (ret == CAMERA_ERROR_NONE) {
2137 muse_camera_msg_get(get_visible, pc->cb_info->recvMsg);
2138 *visible = (bool)get_visible;
2140 LOGD("ret : 0x%x", ret);
2144 int camera_set_display_mode(camera_h camera, camera_display_mode_e mode)
2146 if (camera == NULL) {
2147 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2148 return CAMERA_ERROR_INVALID_PARAMETER;
2151 int ret = CAMERA_ERROR_NONE;
2152 int set_mode = (int)mode;
2154 camera_cli_s *pc = (camera_cli_s *)camera;
2155 muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY_MODE;
2157 if (pc->cb_info == NULL) {
2158 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2159 return CAMERA_ERROR_INVALID_PARAMETER;
2161 sock_fd = pc->cb_info->fd;
2163 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2164 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
2165 LOGD("ret : 0x%x", ret);
2169 int camera_get_display_mode(camera_h camera, camera_display_mode_e* mode)
2171 if( camera == NULL || mode == NULL){
2172 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2173 return CAMERA_ERROR_INVALID_PARAMETER;
2176 int ret = CAMERA_ERROR_NONE;
2178 camera_cli_s *pc = (camera_cli_s *)camera;
2179 muse_camera_api_e api = MUSE_CAMERA_API_GET_DISPLAY_MODE;
2181 if (pc->cb_info == NULL) {
2182 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2183 return CAMERA_ERROR_INVALID_PARAMETER;
2185 sock_fd = pc->cb_info->fd;
2188 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2189 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2191 if (ret == CAMERA_ERROR_NONE) {
2192 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
2193 *mode = (camera_display_mode_e)get_mode;
2195 LOGD("ret : 0x%x", ret);
2199 int camera_get_capture_resolution(camera_h camera, int *width, int *height)
2201 if( camera == NULL || width== NULL || height == NULL){
2202 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2203 return CAMERA_ERROR_INVALID_PARAMETER;
2205 int ret = CAMERA_ERROR_NONE;
2207 camera_cli_s *pc = (camera_cli_s *)camera;
2208 muse_camera_api_e api = MUSE_CAMERA_API_GET_CAPTURE_RESOLUTION;
2210 if (pc->cb_info == NULL) {
2211 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2212 return CAMERA_ERROR_INVALID_PARAMETER;
2214 sock_fd = pc->cb_info->fd;
2218 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2219 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2221 if (ret == CAMERA_ERROR_NONE) {
2222 muse_camera_msg_get(get_width, pc->cb_info->recvMsg);
2223 muse_camera_msg_get(get_height, pc->cb_info->recvMsg);
2225 *height = get_height;
2227 LOGD("ret : 0x%x", ret);
2231 int camera_get_capture_format(camera_h camera, camera_pixel_format_e *format)
2233 if( camera == NULL || format == NULL){
2234 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2235 return CAMERA_ERROR_INVALID_PARAMETER;
2237 int ret = CAMERA_ERROR_NONE;
2239 camera_cli_s *pc = (camera_cli_s *)camera;
2240 muse_camera_api_e api = MUSE_CAMERA_API_GET_CAPTURE_FORMAT;
2243 if (pc->cb_info == NULL) {
2244 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2245 return CAMERA_ERROR_INVALID_PARAMETER;
2247 sock_fd = pc->cb_info->fd;
2249 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2250 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2252 if (ret == CAMERA_ERROR_NONE) {
2253 muse_camera_msg_get(get_format, pc->cb_info->recvMsg);
2254 *format = (camera_pixel_format_e)get_format;
2256 LOGD("ret : 0x%x", ret);
2260 int camera_get_preview_format(camera_h camera, camera_pixel_format_e *format)
2262 if( camera == NULL || format == NULL){
2263 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2264 return CAMERA_ERROR_INVALID_PARAMETER;
2267 int ret = CAMERA_ERROR_NONE;
2269 camera_cli_s *pc = (camera_cli_s *)camera;
2270 muse_camera_api_e api = MUSE_CAMERA_API_GET_PREVIEW_FORMAT;
2273 if (pc->cb_info == NULL) {
2274 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2275 return CAMERA_ERROR_INVALID_PARAMETER;
2277 sock_fd = pc->cb_info->fd;
2279 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2280 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2282 if (ret == CAMERA_ERROR_NONE) {
2283 muse_camera_msg_get(get_format, pc->cb_info->recvMsg);
2284 *format = (camera_pixel_format_e)get_format;
2286 LOGD("ret : 0x%x", ret);
2290 int camera_set_preview_cb(camera_h camera, camera_preview_cb callback, void* user_data)
2292 if (camera == NULL || callback == NULL) {
2293 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2294 return CAMERA_ERROR_INVALID_PARAMETER;
2296 int ret = CAMERA_ERROR_NONE;
2298 camera_cli_s *pc = (camera_cli_s *)camera;
2300 if (pc->cb_info == NULL) {
2301 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2302 return CAMERA_ERROR_INVALID_PARAMETER;
2304 sock_fd = pc->cb_info->fd;
2305 muse_camera_api_e api = MUSE_CAMERA_API_SET_PREVIEW_CB;
2307 LOGD("Enter, handle :%x", pc->remote_handle);
2309 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_PREVIEW] = callback;
2310 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_PREVIEW] = user_data;
2312 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2313 LOGD("ret : 0x%x", ret);
2317 int camera_unset_preview_cb(camera_h camera)
2319 if (camera == NULL) {
2320 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2321 return CAMERA_ERROR_INVALID_PARAMETER;
2324 int ret = CAMERA_ERROR_NONE;
2326 camera_cli_s *pc = (camera_cli_s *)camera;
2327 muse_camera_api_e api = MUSE_CAMERA_API_UNSET_PREVIEW_CB;
2329 LOGD("Enter, handle :%x", pc->remote_handle);
2332 if (pc->cb_info == NULL) {
2333 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2334 return CAMERA_ERROR_INVALID_PARAMETER;
2336 sock_fd = pc->cb_info->fd;
2337 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_PREVIEW] = (void *)NULL;
2338 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_PREVIEW] = (void *)NULL;
2340 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2341 LOGD("ret : 0x%x", ret);
2345 int camera_set_media_packet_preview_cb(camera_h camera, camera_media_packet_preview_cb callback, void* user_data)
2347 if (camera == NULL) {
2348 LOGE("INVALID_PARAMETER(0x%08x) - handle", CAMERA_ERROR_INVALID_PARAMETER);
2349 return CAMERA_ERROR_INVALID_PARAMETER;
2352 if (callback == NULL) {
2353 LOGE("INVALID_PARAMETER(0x%08x) - callback", CAMERA_ERROR_INVALID_PARAMETER);
2354 return CAMERA_ERROR_NOT_SUPPORTED;
2357 int ret = CAMERA_ERROR_NONE;
2359 camera_cli_s *pc = (camera_cli_s *)camera;
2360 muse_camera_api_e api = MUSE_CAMERA_API_SET_MEDIA_PACKET_PREVIEW_CB;
2362 LOGD("Enter, handle :%x", pc->remote_handle);
2365 if (pc->cb_info == NULL) {
2366 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2367 return CAMERA_ERROR_INVALID_PARAMETER;
2369 sock_fd = pc->cb_info->fd;
2370 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW] = callback;
2371 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW] = user_data;
2373 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2374 LOGD("ret : 0x%x", ret);
2378 int camera_unset_media_packet_preview_cb(camera_h camera)
2380 if (camera == NULL) {
2381 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
2382 return CAMERA_ERROR_INVALID_PARAMETER;
2385 int ret = CAMERA_ERROR_NONE;
2387 camera_cli_s *pc = (camera_cli_s *)camera;
2388 muse_camera_api_e api = MUSE_CAMERA_API_UNSET_MEDIA_PACKET_PREVIEW_CB;
2390 LOGD("Enter, handle :%x", pc->remote_handle);
2393 if (pc->cb_info == NULL) {
2394 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2395 return CAMERA_ERROR_INVALID_PARAMETER;
2397 sock_fd = pc->cb_info->fd;
2398 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW] = (void *)NULL;
2399 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW] = (void *)NULL;
2401 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2402 LOGD("ret : 0x%x", ret);
2406 int camera_set_state_changed_cb(camera_h camera, camera_state_changed_cb callback, void* user_data)
2408 if( camera == NULL || callback == NULL){
2409 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2410 return CAMERA_ERROR_INVALID_PARAMETER;
2412 int ret = CAMERA_ERROR_NONE;
2414 camera_cli_s *pc = (camera_cli_s *)camera;
2415 muse_camera_api_e api = MUSE_CAMERA_API_SET_STATE_CHANGED_CB;
2417 LOGD("Enter, handle :%x", pc->remote_handle);
2420 if (pc->cb_info == NULL) {
2421 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2422 return CAMERA_ERROR_INVALID_PARAMETER;
2424 sock_fd = pc->cb_info->fd;
2425 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_STATE_CHANGE] = callback;
2426 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_STATE_CHANGE] = user_data;
2428 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2429 LOGD("ret : 0x%x", ret);
2432 int camera_unset_state_changed_cb(camera_h camera)
2434 if( camera == NULL){
2435 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2436 return CAMERA_ERROR_INVALID_PARAMETER;
2438 int ret = CAMERA_ERROR_NONE;
2440 camera_cli_s *pc = (camera_cli_s *)camera;
2441 muse_camera_api_e api = MUSE_CAMERA_API_UNSET_STATE_CHANGED_CB;
2443 LOGD("Enter, handle :%x", pc->remote_handle);
2446 if (pc->cb_info == NULL) {
2447 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2448 return CAMERA_ERROR_INVALID_PARAMETER;
2450 sock_fd = pc->cb_info->fd;
2451 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_STATE_CHANGE] = (void *)NULL;
2452 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_STATE_CHANGE] = (void *)NULL;
2454 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2455 LOGD("ret : 0x%x", ret);
2459 int camera_set_interrupted_cb(camera_h camera, camera_interrupted_cb callback, void *user_data)
2461 if( camera == NULL || callback == NULL){
2462 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2463 return CAMERA_ERROR_INVALID_PARAMETER;
2465 int ret = CAMERA_ERROR_NONE;
2467 camera_cli_s *pc = (camera_cli_s *)camera;
2468 muse_camera_api_e api = MUSE_CAMERA_API_SET_INTERRUPTED_CB;
2470 LOGD("Enter, handle :%x", pc->remote_handle);
2473 if (pc->cb_info == NULL) {
2474 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2475 return CAMERA_ERROR_INVALID_PARAMETER;
2477 sock_fd = pc->cb_info->fd;
2478 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_INTERRUPTED] = callback;
2479 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_INTERRUPTED] = user_data;
2481 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2482 LOGD("ret : 0x%x", ret);
2486 int camera_unset_interrupted_cb(camera_h camera)
2488 if( camera == NULL){
2489 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2490 return CAMERA_ERROR_INVALID_PARAMETER;
2492 int ret = CAMERA_ERROR_NONE;
2494 camera_cli_s *pc = (camera_cli_s *)camera;
2495 muse_camera_api_e api = MUSE_CAMERA_API_UNSET_INTERRUPTED_CB;
2497 LOGD("Enter, handle :%x", pc->remote_handle);
2500 if (pc->cb_info == NULL) {
2501 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2502 return CAMERA_ERROR_INVALID_PARAMETER;
2504 sock_fd = pc->cb_info->fd;
2505 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_INTERRUPTED] = (void *)NULL;
2506 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_INTERRUPTED] = (void *)NULL;
2508 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2509 LOGD("ret : 0x%x", ret);
2513 int camera_set_focus_changed_cb(camera_h camera, camera_focus_changed_cb callback, void* user_data)
2515 if( camera == NULL || callback == NULL){
2516 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2517 return CAMERA_ERROR_INVALID_PARAMETER;
2519 int ret = CAMERA_ERROR_NONE;
2521 camera_cli_s *pc = (camera_cli_s *)camera;
2522 muse_camera_api_e api = MUSE_CAMERA_API_SET_FOCUS_CHANGED_CB;
2524 LOGD("Enter, handle :%x", pc->remote_handle);
2527 if (pc->cb_info == NULL) {
2528 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2529 return CAMERA_ERROR_INVALID_PARAMETER;
2531 sock_fd = pc->cb_info->fd;
2532 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOCUS_CHANGE] = callback;
2533 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOCUS_CHANGE] = user_data;
2535 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2536 LOGD("ret : 0x%x", ret);
2540 int camera_unset_focus_changed_cb(camera_h camera)
2542 if( camera == NULL){
2543 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2544 return CAMERA_ERROR_INVALID_PARAMETER;
2546 int ret = CAMERA_ERROR_NONE;
2548 camera_cli_s *pc = (camera_cli_s *)camera;
2549 muse_camera_api_e api = MUSE_CAMERA_API_UNSET_FOCUS_CHANGED_CB;
2551 LOGD("Enter, handle :%x", pc->remote_handle);
2554 if (pc->cb_info == NULL) {
2555 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2556 return CAMERA_ERROR_INVALID_PARAMETER;
2558 sock_fd = pc->cb_info->fd;
2559 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOCUS_CHANGE] = (void *)NULL;
2560 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOCUS_CHANGE] = (void *)NULL;
2562 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2563 LOGD("ret : 0x%x", ret);
2567 int camera_set_error_cb(camera_h camera, camera_error_cb callback, void *user_data)
2569 if( camera == NULL || callback == NULL){
2570 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2571 return CAMERA_ERROR_INVALID_PARAMETER;
2573 int ret = CAMERA_ERROR_NONE;
2575 camera_cli_s *pc = (camera_cli_s *)camera;
2576 muse_camera_api_e api = MUSE_CAMERA_API_SET_ERROR_CB;
2578 LOGD("Enter, handle :%x", pc->remote_handle);
2581 if (pc->cb_info == NULL) {
2582 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2583 return CAMERA_ERROR_INVALID_PARAMETER;
2585 sock_fd = pc->cb_info->fd;
2586 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_ERROR] = callback;
2587 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_ERROR] = user_data;
2589 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2590 LOGD("ret : 0x%x", ret);
2594 int camera_unset_error_cb(camera_h camera)
2596 if( camera == NULL){
2597 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2598 return CAMERA_ERROR_INVALID_PARAMETER;
2600 int ret = CAMERA_ERROR_NONE;
2602 camera_cli_s *pc = (camera_cli_s *)camera;
2603 muse_camera_api_e api = MUSE_CAMERA_API_UNSET_ERROR_CB;
2605 LOGD("Enter, handle :%x", pc->remote_handle);
2608 if (pc->cb_info == NULL) {
2609 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2610 return CAMERA_ERROR_INVALID_PARAMETER;
2612 sock_fd = pc->cb_info->fd;
2613 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_ERROR] = (void *)NULL;
2614 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_ERROR] = (void *)NULL;
2616 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2617 LOGD("ret : 0x%x", ret);
2621 int camera_foreach_supported_preview_resolution(camera_h camera, camera_supported_preview_resolution_cb foreach_cb , void *user_data)
2623 if( camera == NULL || foreach_cb == NULL){
2624 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2625 return CAMERA_ERROR_INVALID_PARAMETER;
2627 int ret = CAMERA_ERROR_NONE;
2629 camera_cli_s *pc = (camera_cli_s *)camera;
2630 muse_camera_api_e api = MUSE_CAMERA_API_SET_FOREACH_SUPPORTED_PREVIEW_RESOLUTION;
2632 LOGD("Enter, handle :%x", pc->remote_handle);
2635 if (pc->cb_info == NULL) {
2636 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2637 return CAMERA_ERROR_INVALID_PARAMETER;
2639 sock_fd = pc->cb_info->fd;
2640 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_RESOLUTION] = foreach_cb;
2641 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_RESOLUTION] = user_data;
2643 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2644 LOGD("ret : 0x%x", ret);
2648 int camera_foreach_supported_capture_resolution(camera_h camera, camera_supported_capture_resolution_cb foreach_cb , void *user_data)
2650 if( camera == NULL || foreach_cb == NULL){
2651 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2652 return CAMERA_ERROR_INVALID_PARAMETER;
2654 int ret = CAMERA_ERROR_NONE;
2656 camera_cli_s *pc = (camera_cli_s *)camera;
2657 muse_camera_api_e api = MUSE_CAMERA_API_SET_FOREACH_SUPPORTED_CAPTURE_RESOLUTION;
2659 LOGD("Enter, handle :%x", pc->remote_handle);
2662 if (pc->cb_info == NULL) {
2663 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2664 return CAMERA_ERROR_INVALID_PARAMETER;
2666 sock_fd = pc->cb_info->fd;
2667 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_RESOLUTION] = foreach_cb;
2668 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_RESOLUTION] = user_data;
2670 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2671 LOGD("ret : 0x%x", ret);
2675 int camera_foreach_supported_capture_format(camera_h camera, camera_supported_capture_format_cb foreach_cb , void *user_data)
2677 if( camera == NULL || foreach_cb == NULL){
2678 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2679 return CAMERA_ERROR_INVALID_PARAMETER;
2681 int ret = CAMERA_ERROR_NONE;
2683 camera_cli_s *pc = (camera_cli_s *)camera;
2684 muse_camera_api_e api = MUSE_CAMERA_API_SET_FOREACH_SUPPORTED_CAPTURE_FORMAT;
2686 LOGD("Enter, handle :%x", pc->remote_handle);
2689 if (pc->cb_info == NULL) {
2690 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2691 return CAMERA_ERROR_INVALID_PARAMETER;
2693 sock_fd = pc->cb_info->fd;
2694 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_FORMAT] = foreach_cb;
2695 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_FORMAT] = user_data;
2697 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2698 LOGD("ret : 0x%x", ret);
2703 int camera_foreach_supported_preview_format(camera_h camera, camera_supported_preview_format_cb foreach_cb , void *user_data)
2705 if( camera == NULL || foreach_cb == NULL){
2706 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2707 return CAMERA_ERROR_INVALID_PARAMETER;
2709 int ret = CAMERA_ERROR_NONE;
2711 camera_cli_s *pc = (camera_cli_s *)camera;
2712 muse_camera_api_e api = MUSE_CAMERA_API_SET_FOREACH_SUPPORTED_PREVIEW_FORMAT;
2714 LOGD("Enter, handle :%x", pc->remote_handle);
2717 if (pc->cb_info == NULL) {
2718 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2719 return CAMERA_ERROR_INVALID_PARAMETER;
2721 sock_fd = pc->cb_info->fd;
2722 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_FORMAT] = foreach_cb;
2723 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_FORMAT] = user_data;
2725 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2726 LOGD("ret : 0x%x", ret);
2731 int camera_get_recommended_preview_resolution(camera_h camera, int *width, int *height)
2733 if (camera == NULL || width == NULL || height == NULL) {
2734 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2735 return CAMERA_ERROR_INVALID_PARAMETER;
2737 int ret = CAMERA_ERROR_NONE;
2739 camera_cli_s *pc = (camera_cli_s *)camera;
2740 muse_camera_api_e api = MUSE_CAMERA_API_GET_RECOMMENDED_PREVIEW_RESOLUTION;
2742 if (pc->cb_info == NULL) {
2743 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2744 return CAMERA_ERROR_INVALID_PARAMETER;
2746 sock_fd = pc->cb_info->fd;
2750 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2751 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2753 if (ret == CAMERA_ERROR_NONE) {
2754 muse_camera_msg_get(get_width, pc->cb_info->recvMsg);
2755 muse_camera_msg_get(get_height, pc->cb_info->recvMsg);
2757 *height = get_height;
2759 LOGD("ret : 0x%x", ret);
2764 int camera_attr_get_lens_orientation(camera_h camera, int *angle)
2766 if( camera == NULL || angle == NULL){
2767 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2768 return CAMERA_ERROR_INVALID_PARAMETER;
2770 int ret = CAMERA_ERROR_NONE;
2772 camera_cli_s *pc = (camera_cli_s *)camera;
2773 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_LENS_ORIENTATION;
2775 if (pc->cb_info == NULL) {
2776 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2777 return CAMERA_ERROR_INVALID_PARAMETER;
2779 sock_fd = pc->cb_info->fd;
2782 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2783 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2785 if (ret == CAMERA_ERROR_NONE) {
2786 muse_camera_msg_get(get_angle, pc->cb_info->recvMsg);
2789 LOGD("ret : 0x%x", ret);
2793 int camera_attr_set_theater_mode(camera_h camera, camera_attr_theater_mode_e mode)
2795 if (camera == NULL) {
2796 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
2797 return CAMERA_ERROR_INVALID_PARAMETER;
2799 int ret = CAMERA_ERROR_NONE;
2800 camera_cli_s *pc = (camera_cli_s *)camera;
2801 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_THEATER_MODE;
2803 if (pc->cb_info == NULL) {
2804 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2805 return CAMERA_ERROR_INVALID_PARAMETER;
2807 sock_fd = pc->cb_info->fd;
2808 int set_mode = (int)mode;
2809 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2810 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
2811 LOGD("ret : 0x%x", ret);
2815 int camera_attr_get_theater_mode(camera_h camera, camera_attr_theater_mode_e *mode)
2817 if (camera == NULL || mode == NULL) {
2818 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
2819 return CAMERA_ERROR_INVALID_PARAMETER;
2822 int ret = CAMERA_ERROR_NONE;
2823 camera_cli_s *pc = (camera_cli_s *)camera;
2824 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_THEATER_MODE;
2826 if (pc->cb_info == NULL) {
2827 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2828 return CAMERA_ERROR_INVALID_PARAMETER;
2830 sock_fd = pc->cb_info->fd;
2832 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2833 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2835 if (ret == CAMERA_ERROR_NONE) {
2836 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
2837 *mode = (camera_attr_theater_mode_e)get_mode;
2839 LOGD("ret : 0x%x", ret);
2843 int camera_attr_foreach_supported_theater_mode(camera_h camera, camera_attr_supported_theater_mode_cb foreach_cb, void *user_data)
2845 if (camera == NULL || foreach_cb == NULL) {
2846 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
2847 return CAMERA_ERROR_INVALID_PARAMETER;
2849 int ret = CAMERA_ERROR_NONE;
2851 camera_cli_s *pc = (camera_cli_s *)camera;
2852 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_THEATER_MODE;
2854 LOGD("Enter, handle :%x", pc->remote_handle);
2857 if (pc->cb_info == NULL) {
2858 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2859 return CAMERA_ERROR_INVALID_PARAMETER;
2861 sock_fd = pc->cb_info->fd;
2862 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_THEATER_MODE] = foreach_cb;
2863 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_THEATER_MODE] = user_data;
2865 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2867 LOGD("Finish, return :%x", ret);
2872 int camera_attr_set_preview_fps(camera_h camera, camera_attr_fps_e fps)
2874 if( camera == NULL){
2875 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2876 return CAMERA_ERROR_INVALID_PARAMETER;
2878 int ret = CAMERA_ERROR_NONE;
2879 camera_cli_s *pc = (camera_cli_s *)camera;
2880 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_PREVIEW_FPS;
2882 if (pc->cb_info == NULL) {
2883 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2884 return CAMERA_ERROR_INVALID_PARAMETER;
2886 sock_fd = pc->cb_info->fd;
2887 int set_fps = (int)fps;
2888 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2889 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_fps);
2890 LOGD("ret : 0x%x", ret);
2895 int camera_attr_set_image_quality(camera_h camera, int quality)
2897 if( camera == NULL){
2898 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2899 return CAMERA_ERROR_INVALID_PARAMETER;
2901 int ret = CAMERA_ERROR_NONE;
2903 camera_cli_s *pc = (camera_cli_s *)camera;
2904 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_IMAGE_QUALITY;
2906 if (pc->cb_info == NULL) {
2907 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2908 return CAMERA_ERROR_INVALID_PARAMETER;
2910 sock_fd = pc->cb_info->fd;
2911 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2912 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, quality);
2913 LOGD("ret : 0x%x", ret);
2917 int camera_attr_get_preview_fps(camera_h camera, camera_attr_fps_e *fps)
2919 if( camera == NULL || fps == NULL){
2920 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2921 return CAMERA_ERROR_INVALID_PARAMETER;
2923 int ret = CAMERA_ERROR_NONE;
2925 camera_cli_s *pc = (camera_cli_s *)camera;
2926 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_PREVIEW_FPS;
2929 if (pc->cb_info == NULL) {
2930 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2931 return CAMERA_ERROR_INVALID_PARAMETER;
2933 sock_fd = pc->cb_info->fd;
2935 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2936 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2938 if (ret == CAMERA_ERROR_NONE) {
2939 muse_camera_msg_get(get_fps, pc->cb_info->recvMsg);
2940 *fps = (camera_attr_fps_e)get_fps;
2942 LOGD("ret : 0x%x", ret);
2947 int camera_attr_get_image_quality(camera_h camera, int *quality)
2949 if( camera == NULL || quality == NULL){
2950 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2951 return CAMERA_ERROR_INVALID_PARAMETER;
2953 int ret = CAMERA_ERROR_NONE;
2955 camera_cli_s *pc = (camera_cli_s *)camera;
2956 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_IMAGE_QUALITY;
2958 if (pc->cb_info == NULL) {
2959 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2960 return CAMERA_ERROR_INVALID_PARAMETER;
2962 sock_fd = pc->cb_info->fd;
2964 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2965 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2967 if (ret == CAMERA_ERROR_NONE) {
2968 muse_camera_msg_get(get_quality, pc->cb_info->recvMsg);
2969 *quality = get_quality;
2971 LOGD("ret : 0x%x", ret);
2976 int camera_attr_set_zoom(camera_h camera, int zoom)
2978 if( camera == NULL){
2979 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2980 return CAMERA_ERROR_INVALID_PARAMETER;
2982 int ret = CAMERA_ERROR_NONE;
2984 camera_cli_s *pc = (camera_cli_s *)camera;
2985 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_ZOOM;
2987 if (pc->cb_info == NULL) {
2988 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2989 return CAMERA_ERROR_INVALID_PARAMETER;
2991 sock_fd = pc->cb_info->fd;
2993 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2994 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, zoom);
2995 LOGD("ret : 0x%x", ret);
2999 int camera_attr_set_af_mode(camera_h camera, camera_attr_af_mode_e mode)
3001 if( camera == NULL){
3002 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3003 return CAMERA_ERROR_INVALID_PARAMETER;
3005 int ret = CAMERA_ERROR_NONE;
3007 camera_cli_s *pc = (camera_cli_s *)camera;
3008 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_AF_MODE;
3010 if (pc->cb_info == NULL) {
3011 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3012 return CAMERA_ERROR_INVALID_PARAMETER;
3014 sock_fd = pc->cb_info->fd;
3015 int set_mode = (int)mode;
3016 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3017 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
3018 LOGD("ret : 0x%x", ret);
3022 int camera_attr_set_af_area(camera_h camera, int x, int y)
3024 if( camera == NULL){
3025 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3026 return CAMERA_ERROR_INVALID_PARAMETER;
3028 int ret = CAMERA_ERROR_NONE;
3029 camera_cli_s *pc = (camera_cli_s *)camera;
3030 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_AF_AREA;
3031 int sock_fd = pc->cb_info->fd;
3032 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3033 muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret, INT, x, INT, y);
3034 LOGD("ret : 0x%x", ret);
3039 int camera_attr_clear_af_area(camera_h camera)
3041 if( camera == NULL){
3042 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
3043 return CAMERA_ERROR_INVALID_PARAMETER;
3045 int ret = CAMERA_ERROR_NONE;
3047 camera_cli_s *pc = (camera_cli_s *)camera;
3048 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_CLEAR_AF_AREA;
3050 if (pc->cb_info == NULL) {
3051 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3052 return CAMERA_ERROR_INVALID_PARAMETER;
3054 sock_fd = pc->cb_info->fd;
3055 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3056 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3057 LOGD("ret : 0x%x", ret);
3062 int camera_attr_set_exposure_mode(camera_h camera, camera_attr_exposure_mode_e mode)
3064 if( camera == NULL){
3065 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3066 return CAMERA_ERROR_INVALID_PARAMETER;
3069 if (mode < CAMERA_ATTR_EXPOSURE_MODE_OFF || mode > CAMERA_ATTR_EXPOSURE_MODE_CUSTOM) {
3070 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_NOT_SUPPORTED);
3071 return CAMERA_ERROR_NOT_SUPPORTED;
3074 int ret = CAMERA_ERROR_NONE;
3075 camera_cli_s *pc = (camera_cli_s *)camera;
3076 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_EXPOSURE_MODE;
3077 int set_mode = (int)mode;
3079 if (pc->cb_info == NULL) {
3080 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3081 return CAMERA_ERROR_INVALID_PARAMETER;
3083 sock_fd = pc->cb_info->fd;
3084 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3085 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
3086 LOGD("ret : 0x%x", ret);
3091 int camera_attr_set_exposure(camera_h camera, int value)
3093 if( camera == NULL){
3094 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3095 return CAMERA_ERROR_INVALID_PARAMETER;
3097 int ret = CAMERA_ERROR_NONE;
3099 camera_cli_s *pc = (camera_cli_s *)camera;
3100 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_EXPOSURE;
3102 if (pc->cb_info == NULL) {
3103 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3104 return CAMERA_ERROR_INVALID_PARAMETER;
3106 sock_fd = pc->cb_info->fd;
3108 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3109 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, value);
3110 LOGD("ret : 0x%x", ret);
3115 int camera_attr_set_iso(camera_h camera, camera_attr_iso_e iso)
3117 if( camera == NULL){
3118 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3119 return CAMERA_ERROR_INVALID_PARAMETER;
3121 int ret = CAMERA_ERROR_NONE;
3123 camera_cli_s *pc = (camera_cli_s *)camera;
3124 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_ISO;
3126 if (pc->cb_info == NULL) {
3127 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3128 return CAMERA_ERROR_INVALID_PARAMETER;
3130 sock_fd = pc->cb_info->fd;
3131 int set_iso = (int)iso;
3132 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3133 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_iso);
3134 LOGD("ret : 0x%x", ret);
3139 int camera_attr_set_brightness(camera_h camera, int level)
3141 if( camera == NULL){
3142 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3143 return CAMERA_ERROR_INVALID_PARAMETER;
3145 int ret = CAMERA_ERROR_NONE;
3147 camera_cli_s *pc = (camera_cli_s *)camera;
3148 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_BRIGHTNESS;
3150 if (pc->cb_info == NULL) {
3151 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3152 return CAMERA_ERROR_INVALID_PARAMETER;
3154 sock_fd = pc->cb_info->fd;
3156 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3157 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, level);
3158 LOGD("ret : 0x%x", ret);
3163 int camera_attr_set_contrast(camera_h camera, int level)
3165 if( camera == NULL){
3166 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3167 return CAMERA_ERROR_INVALID_PARAMETER;
3169 int ret = CAMERA_ERROR_NONE;
3171 camera_cli_s *pc = (camera_cli_s *)camera;
3172 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_CONTRAST;
3174 if (pc->cb_info == NULL) {
3175 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3176 return CAMERA_ERROR_INVALID_PARAMETER;
3178 sock_fd = pc->cb_info->fd;
3180 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3181 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, level);
3182 LOGD("ret : 0x%x", ret);
3187 int camera_attr_set_whitebalance(camera_h camera, camera_attr_whitebalance_e wb)
3189 if (camera == NULL) {
3190 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3191 return CAMERA_ERROR_INVALID_PARAMETER;
3194 if (wb < CAMERA_ATTR_WHITE_BALANCE_NONE || wb > CAMERA_ATTR_WHITE_BALANCE_CUSTOM) {
3195 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_NOT_SUPPORTED);
3196 return CAMERA_ERROR_NOT_SUPPORTED;
3199 int ret = CAMERA_ERROR_NONE;
3201 camera_cli_s *pc = (camera_cli_s *)camera;
3202 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_WHITEBALANCE;
3204 if (pc->cb_info == NULL) {
3205 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3206 return CAMERA_ERROR_INVALID_PARAMETER;
3208 sock_fd = pc->cb_info->fd;
3209 int set_whitebalance = (int)wb;
3210 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3211 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_whitebalance);
3212 LOGD("ret : 0x%x", ret);
3217 int camera_attr_set_effect(camera_h camera, camera_attr_effect_mode_e effect)
3219 if( camera == NULL){
3220 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3221 return CAMERA_ERROR_INVALID_PARAMETER;
3223 int ret = CAMERA_ERROR_NONE;
3225 camera_cli_s *pc = (camera_cli_s *)camera;
3226 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_EFFECT;
3228 if (pc->cb_info == NULL) {
3229 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3230 return CAMERA_ERROR_INVALID_PARAMETER;
3232 sock_fd = pc->cb_info->fd;
3233 int set_effect = (int)effect;
3234 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3235 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_effect);
3236 LOGD("ret : 0x%x", ret);
3241 int camera_attr_set_scene_mode(camera_h camera, camera_attr_scene_mode_e mode)
3243 if( camera == NULL){
3244 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3245 return CAMERA_ERROR_INVALID_PARAMETER;
3247 int ret = CAMERA_ERROR_NONE;
3249 camera_cli_s *pc = (camera_cli_s *)camera;
3250 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_SCENE_MODE;
3252 if (pc->cb_info == NULL) {
3253 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3254 return CAMERA_ERROR_INVALID_PARAMETER;
3256 sock_fd = pc->cb_info->fd;
3257 int set_mode = (int)mode;
3258 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3259 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
3260 LOGD("ret : 0x%x", ret);
3265 int camera_attr_enable_tag(camera_h camera, bool enable)
3267 if( camera == NULL){
3268 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3269 return CAMERA_ERROR_INVALID_PARAMETER;
3271 int ret = CAMERA_ERROR_NONE;
3272 camera_cli_s *pc = (camera_cli_s *)camera;
3273 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_ENABLE_TAG;
3275 if (pc->cb_info == NULL) {
3276 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3277 return CAMERA_ERROR_INVALID_PARAMETER;
3279 sock_fd = pc->cb_info->fd;
3280 int set_enable = (int)enable;
3282 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3283 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_enable);
3284 LOGD("ret : 0x%x", ret);
3289 int camera_attr_set_tag_image_description(camera_h camera, const char *description)
3291 if( camera == NULL){
3292 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3293 return CAMERA_ERROR_INVALID_PARAMETER;
3295 if( description == NULL){
3296 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3297 return CAMERA_ERROR_INVALID_PARAMETER;
3299 int ret = CAMERA_ERROR_NONE;
3300 camera_cli_s *pc = (camera_cli_s *)camera;
3301 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_TAG_IMAGE_DESCRIPTION;
3303 if (pc->cb_info == NULL) {
3304 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3305 return CAMERA_ERROR_INVALID_PARAMETER;
3307 sock_fd = pc->cb_info->fd;
3308 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3309 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, STRING, description);
3310 LOGD("ret : 0x%x", ret);
3315 int camera_attr_set_tag_orientation(camera_h camera, camera_attr_tag_orientation_e orientation)
3317 if( camera == NULL){
3318 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3319 return CAMERA_ERROR_INVALID_PARAMETER;
3321 int ret = CAMERA_ERROR_NONE;
3322 camera_cli_s *pc = (camera_cli_s *)camera;
3323 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_TAG_ORIENTATION;
3325 if (pc->cb_info == NULL) {
3326 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3327 return CAMERA_ERROR_INVALID_PARAMETER;
3329 sock_fd = pc->cb_info->fd;
3330 int set_orientation = (int)orientation;
3332 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3333 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_orientation);
3334 LOGD("ret : 0x%x", ret);
3339 int camera_attr_set_tag_software(camera_h camera, const char *software)
3341 if( camera == NULL){
3342 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3343 return CAMERA_ERROR_INVALID_PARAMETER;
3345 if( software == NULL){
3346 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3347 return CAMERA_ERROR_INVALID_PARAMETER;
3349 int ret = CAMERA_ERROR_NONE;
3350 camera_cli_s *pc = (camera_cli_s *)camera;
3351 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_TAG_SOFTWARE;
3353 if (pc->cb_info == NULL) {
3354 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3355 return CAMERA_ERROR_INVALID_PARAMETER;
3357 sock_fd = pc->cb_info->fd;
3358 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3359 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, STRING, software);
3360 LOGD("ret : 0x%x", ret);
3365 int camera_attr_set_geotag(camera_h camera, double latitude , double longitude, double altitude)
3367 if( camera == NULL){
3368 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3369 return CAMERA_ERROR_INVALID_PARAMETER;
3371 int ret = CAMERA_ERROR_NONE;
3372 camera_cli_s *pc = (camera_cli_s *)camera;
3373 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_GEOTAG;
3375 if (pc->cb_info == NULL) {
3376 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3377 return CAMERA_ERROR_INVALID_PARAMETER;
3379 sock_fd = pc->cb_info->fd;
3380 double set_geotag[3] = { latitude, longitude, altitude };
3382 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3383 muse_camera_msg_send_array(api, sock_fd, pc->cb_info, ret,
3384 set_geotag, sizeof(set_geotag), sizeof(double));
3385 LOGD("ret : 0x%x", ret);
3390 int camera_attr_remove_geotag(camera_h camera)
3392 if( camera == NULL){
3393 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3394 return CAMERA_ERROR_INVALID_PARAMETER;
3396 int ret = CAMERA_ERROR_NONE;
3397 camera_cli_s *pc = (camera_cli_s *)camera;
3398 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_REMOVE_GEOTAG;
3400 if (pc->cb_info == NULL) {
3401 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3402 return CAMERA_ERROR_INVALID_PARAMETER;
3404 sock_fd = pc->cb_info->fd;
3405 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3406 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3407 LOGD("ret : 0x%x", ret);
3412 int camera_attr_set_flash_mode(camera_h camera, camera_attr_flash_mode_e mode)
3414 if( camera == NULL){
3415 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3416 return CAMERA_ERROR_INVALID_PARAMETER;
3418 int ret = CAMERA_ERROR_NONE;
3419 camera_cli_s *pc = (camera_cli_s *)camera;
3420 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_FLASH_MODE;
3422 if (pc->cb_info == NULL) {
3423 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3424 return CAMERA_ERROR_INVALID_PARAMETER;
3426 sock_fd = pc->cb_info->fd;
3427 int set_mode = (int)mode;
3429 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3430 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
3431 LOGD("ret : 0x%x", ret);
3436 int camera_attr_get_zoom(camera_h camera, int *zoom)
3438 if( camera == NULL || zoom == NULL){
3439 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3440 return CAMERA_ERROR_INVALID_PARAMETER;
3442 int ret = CAMERA_ERROR_NONE;
3444 camera_cli_s *pc = (camera_cli_s *)camera;
3445 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_ZOOM;
3448 if (pc->cb_info == NULL) {
3449 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3450 return CAMERA_ERROR_INVALID_PARAMETER;
3452 sock_fd = pc->cb_info->fd;
3454 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3455 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3457 if (ret == CAMERA_ERROR_NONE) {
3458 muse_camera_msg_get(get_zoom, pc->cb_info->recvMsg);
3461 LOGD("ret : 0x%x", ret);
3466 int camera_attr_get_zoom_range(camera_h camera, int *min, int *max)
3468 if( camera == NULL || min == NULL || max == NULL ){
3469 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3470 return CAMERA_ERROR_INVALID_PARAMETER;
3472 int ret = CAMERA_ERROR_NONE;
3473 camera_cli_s *pc = (camera_cli_s *)camera;
3475 if (pc->cb_info == NULL) {
3476 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3477 return CAMERA_ERROR_INVALID_PARAMETER;
3479 sock_fd = pc->cb_info->fd;
3480 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_ZOOM_RANGE;
3484 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3485 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3487 if (ret == CAMERA_ERROR_NONE) {
3488 muse_camera_msg_get(get_min, pc->cb_info->recvMsg);
3489 muse_camera_msg_get(get_max, pc->cb_info->recvMsg);
3493 LOGD("ret : 0x%x", ret);
3498 int camera_attr_get_af_mode( camera_h camera, camera_attr_af_mode_e *mode)
3500 if( camera == NULL || mode == NULL){
3501 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3502 return CAMERA_ERROR_INVALID_PARAMETER;
3504 int ret = CAMERA_ERROR_NONE;
3505 camera_cli_s *pc = (camera_cli_s *)camera;
3507 if (pc->cb_info == NULL) {
3508 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3509 return CAMERA_ERROR_INVALID_PARAMETER;
3511 sock_fd = pc->cb_info->fd;
3512 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_AF_MODE;
3515 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3516 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3518 if (ret == CAMERA_ERROR_NONE) {
3519 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
3520 *mode = (camera_attr_af_mode_e)get_mode;
3522 LOGD("ret : 0x%x", ret);
3527 int camera_attr_get_exposure_mode( camera_h camera, camera_attr_exposure_mode_e *mode)
3529 if( camera == NULL|| mode == NULL){
3530 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3531 return CAMERA_ERROR_INVALID_PARAMETER;
3533 int ret = CAMERA_ERROR_NONE;
3534 camera_cli_s *pc = (camera_cli_s *)camera;
3536 if (pc->cb_info == NULL) {
3537 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3538 return CAMERA_ERROR_INVALID_PARAMETER;
3540 sock_fd = pc->cb_info->fd;
3541 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_EXPOSURE_MODE;
3544 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3545 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3547 if (ret == CAMERA_ERROR_NONE) {
3548 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
3549 *mode = (camera_attr_exposure_mode_e)get_mode;
3551 LOGD("ret : 0x%x", ret);
3555 int camera_attr_get_exposure(camera_h camera, int *value)
3557 if( camera == NULL || value == NULL){
3558 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3559 return CAMERA_ERROR_INVALID_PARAMETER;
3561 int ret = CAMERA_ERROR_NONE;
3562 camera_cli_s *pc = (camera_cli_s *)camera;
3564 if (pc->cb_info == NULL) {
3565 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3566 return CAMERA_ERROR_INVALID_PARAMETER;
3568 sock_fd = pc->cb_info->fd;
3569 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_EXPOSURE;
3572 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3573 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3575 if (ret == CAMERA_ERROR_NONE) {
3576 muse_camera_msg_get(get_value, pc->cb_info->recvMsg);
3579 LOGD("ret : 0x%x", ret);
3584 int camera_attr_get_exposure_range(camera_h camera, int *min, int *max)
3586 if( camera == NULL || min == NULL || max == NULL ){
3587 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3588 return CAMERA_ERROR_INVALID_PARAMETER;
3590 int ret = CAMERA_ERROR_NONE;
3591 camera_cli_s *pc = (camera_cli_s *)camera;
3593 if (pc->cb_info == NULL) {
3594 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3595 return CAMERA_ERROR_INVALID_PARAMETER;
3597 sock_fd = pc->cb_info->fd;
3598 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_EXPOSURE_RANGE;
3602 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3603 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3605 if (ret == CAMERA_ERROR_NONE) {
3606 muse_camera_msg_get(get_min, pc->cb_info->recvMsg);
3607 muse_camera_msg_get(get_max, pc->cb_info->recvMsg);
3611 LOGD("ret : 0x%x", ret);
3616 int camera_attr_get_iso( camera_h camera, camera_attr_iso_e *iso)
3618 if( camera == NULL || iso == NULL){
3619 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3620 return CAMERA_ERROR_INVALID_PARAMETER;
3622 int ret = CAMERA_ERROR_NONE;
3623 camera_cli_s *pc = (camera_cli_s *)camera;
3625 if (pc->cb_info == NULL) {
3626 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3627 return CAMERA_ERROR_INVALID_PARAMETER;
3629 sock_fd = pc->cb_info->fd;
3630 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_ISO;
3633 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3634 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3636 if (ret == CAMERA_ERROR_NONE) {
3637 muse_camera_msg_get(get_iso, pc->cb_info->recvMsg);
3638 *iso = (camera_attr_iso_e)get_iso;
3640 LOGD("ret : 0x%x", ret);
3645 int camera_attr_get_brightness(camera_h camera, int *level)
3647 if( camera == NULL || level == NULL){
3648 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3649 return CAMERA_ERROR_INVALID_PARAMETER;
3651 int ret = CAMERA_ERROR_NONE;
3652 camera_cli_s *pc = (camera_cli_s *)camera;
3654 if (pc->cb_info == NULL) {
3655 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3656 return CAMERA_ERROR_INVALID_PARAMETER;
3658 sock_fd = pc->cb_info->fd;
3659 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_BRIGHTNESS;
3662 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3663 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3665 if (ret == CAMERA_ERROR_NONE) {
3666 muse_camera_msg_get(get_level, pc->cb_info->recvMsg);
3669 LOGD("ret : 0x%x", ret);
3674 int camera_attr_get_brightness_range(camera_h camera, int *min, int *max)
3676 if( camera == NULL || min == NULL || max == NULL ){
3677 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3678 return CAMERA_ERROR_INVALID_PARAMETER;
3680 int ret = CAMERA_ERROR_NONE;
3681 camera_cli_s *pc = (camera_cli_s *)camera;
3683 if (pc->cb_info == NULL) {
3684 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3685 return CAMERA_ERROR_INVALID_PARAMETER;
3687 sock_fd = pc->cb_info->fd;
3688 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_BRIGHTNESS_RANGE;
3692 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3693 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3695 if (ret == CAMERA_ERROR_NONE) {
3696 muse_camera_msg_get(get_min, pc->cb_info->recvMsg);
3697 muse_camera_msg_get(get_max, pc->cb_info->recvMsg);
3701 LOGD("ret : 0x%x", ret);
3706 int camera_attr_get_contrast(camera_h camera, int *level)
3708 if( camera == NULL || level == NULL){
3709 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3710 return CAMERA_ERROR_INVALID_PARAMETER;
3712 int ret = CAMERA_ERROR_NONE;
3713 camera_cli_s *pc = (camera_cli_s *)camera;
3714 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_CONTRAST;
3716 if (pc->cb_info == NULL) {
3717 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3718 return CAMERA_ERROR_INVALID_PARAMETER;
3720 sock_fd = pc->cb_info->fd;
3723 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3724 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3726 if (ret == CAMERA_ERROR_NONE) {
3727 muse_camera_msg_get(get_level, pc->cb_info->recvMsg);
3730 LOGD("ret : 0x%x", ret);
3735 int camera_attr_get_contrast_range(camera_h camera, int *min , int *max)
3737 if( camera == NULL || min == NULL || max == NULL ){
3738 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3739 return CAMERA_ERROR_INVALID_PARAMETER;
3741 int ret = CAMERA_ERROR_NONE;
3742 camera_cli_s *pc = (camera_cli_s *)camera;
3743 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_CONTRAST_RANGE;
3745 if (pc->cb_info == NULL) {
3746 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3747 return CAMERA_ERROR_INVALID_PARAMETER;
3749 sock_fd = pc->cb_info->fd;
3753 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3754 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3756 if (ret == CAMERA_ERROR_NONE) {
3757 muse_camera_msg_get(get_min, pc->cb_info->recvMsg);
3758 muse_camera_msg_get(get_max, pc->cb_info->recvMsg);
3762 LOGD("ret : 0x%x", ret);
3767 int camera_attr_get_whitebalance(camera_h camera, camera_attr_whitebalance_e *wb)
3769 if( camera == NULL || wb == NULL){
3770 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3771 return CAMERA_ERROR_INVALID_PARAMETER;
3773 int ret = CAMERA_ERROR_NONE;
3774 camera_cli_s *pc = (camera_cli_s *)camera;
3775 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_WHITEBALANCE;
3777 if (pc->cb_info == NULL) {
3778 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3779 return CAMERA_ERROR_INVALID_PARAMETER;
3781 sock_fd = pc->cb_info->fd;
3784 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3785 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3787 if (ret == CAMERA_ERROR_NONE) {
3788 muse_camera_msg_get(get_wb, pc->cb_info->recvMsg);
3789 *wb = (camera_attr_whitebalance_e)get_wb;
3791 LOGD("ret : 0x%x", ret);
3796 int camera_attr_get_effect(camera_h camera, camera_attr_effect_mode_e *effect)
3798 if( camera == NULL || effect == NULL ){
3799 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3800 return CAMERA_ERROR_INVALID_PARAMETER;
3803 int ret = CAMERA_ERROR_NONE;
3804 camera_cli_s *pc = (camera_cli_s *)camera;
3805 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_EFFECT;
3807 if (pc->cb_info == NULL) {
3808 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3809 return CAMERA_ERROR_INVALID_PARAMETER;
3811 sock_fd = pc->cb_info->fd;
3814 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3815 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3817 if (ret == CAMERA_ERROR_NONE) {
3818 muse_camera_msg_get(get_effect, pc->cb_info->recvMsg);
3819 *effect = (camera_attr_effect_mode_e)get_effect;
3821 LOGD("ret : 0x%x", ret);
3826 int camera_attr_get_scene_mode(camera_h camera, camera_attr_scene_mode_e *mode)
3828 if( camera == NULL || mode == NULL){
3829 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3830 return CAMERA_ERROR_INVALID_PARAMETER;
3833 int ret = CAMERA_ERROR_NONE;
3834 camera_cli_s *pc = (camera_cli_s *)camera;
3835 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_SCENE_MODE;
3837 if (pc->cb_info == NULL) {
3838 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3839 return CAMERA_ERROR_INVALID_PARAMETER;
3841 sock_fd = pc->cb_info->fd;
3844 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3845 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3847 if (ret == CAMERA_ERROR_NONE) {
3848 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
3849 *mode = (camera_attr_scene_mode_e)get_mode;
3851 LOGD("ret : 0x%x", ret);
3856 int camera_attr_is_enabled_tag(camera_h camera, bool *enable)
3858 if( camera == NULL || enable == NULL){
3859 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3860 return CAMERA_ERROR_INVALID_PARAMETER;
3863 int ret = CAMERA_ERROR_NONE;
3864 camera_cli_s *pc = (camera_cli_s *)camera;
3865 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_ENABLED_TAG;
3867 if (pc->cb_info == NULL) {
3868 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3869 return CAMERA_ERROR_INVALID_PARAMETER;
3871 sock_fd = pc->cb_info->fd;
3874 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3875 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3877 if (ret == CAMERA_ERROR_NONE) {
3878 muse_camera_msg_get(get_enabled, pc->cb_info->recvMsg);
3879 *enable = (bool)get_enabled;
3881 LOGD("ret : 0x%x", ret);
3886 int camera_attr_get_tag_image_description(camera_h camera, char **description)
3888 if( camera == NULL || description == NULL){
3889 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3890 return CAMERA_ERROR_INVALID_PARAMETER;
3893 int ret = CAMERA_ERROR_NONE;
3894 camera_cli_s *pc = (camera_cli_s *)camera;
3895 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_TAG_IMAGE_DESCRIPTION;
3897 if (pc->cb_info == NULL) {
3898 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3899 return CAMERA_ERROR_INVALID_PARAMETER;
3901 sock_fd = pc->cb_info->fd;
3902 char get_description[MUSE_CAMERA_MSG_MAX_LENGTH] = {0,};
3904 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3905 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3907 if (ret == CAMERA_ERROR_NONE) {
3908 muse_camera_msg_get_string(get_description, pc->cb_info->recvMsg);
3909 *description = strdup(get_description);
3911 LOGD("ret : 0x%x", ret);
3916 int camera_attr_get_tag_orientation(camera_h camera, camera_attr_tag_orientation_e *orientation)
3918 if( camera == NULL || orientation == NULL){
3919 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3920 return CAMERA_ERROR_INVALID_PARAMETER;
3923 int ret = CAMERA_ERROR_NONE;
3924 camera_cli_s *pc = (camera_cli_s *)camera;
3925 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_TAG_ORIENTATION;
3927 if (pc->cb_info == NULL) {
3928 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3929 return CAMERA_ERROR_INVALID_PARAMETER;
3931 sock_fd = pc->cb_info->fd;
3932 int get_orientation;
3934 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3935 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3937 if (ret == CAMERA_ERROR_NONE) {
3938 muse_camera_msg_get(get_orientation, pc->cb_info->recvMsg);
3939 *orientation = (camera_attr_tag_orientation_e)get_orientation;
3940 LOGD("success, orientation : %d", *orientation);
3942 LOGD("ret : 0x%x", ret);
3947 int camera_attr_get_tag_software(camera_h camera, char **software)
3949 if( camera == NULL || software == NULL ){
3950 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3951 return CAMERA_ERROR_INVALID_PARAMETER;
3954 int ret = CAMERA_ERROR_NONE;
3955 camera_cli_s *pc = (camera_cli_s *)camera;
3956 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_TAG_SOFTWARE;
3958 if (pc->cb_info == NULL) {
3959 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3960 return CAMERA_ERROR_INVALID_PARAMETER;
3962 sock_fd = pc->cb_info->fd;
3963 char get_software[MUSE_CAMERA_MSG_MAX_LENGTH] = {0,};
3965 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3966 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3968 if (ret == CAMERA_ERROR_NONE) {
3969 muse_camera_msg_get_string(get_software, pc->cb_info->recvMsg);
3970 *software = strdup(get_software);
3972 LOGD("ret : 0x%x", ret);
3977 int camera_attr_get_geotag(camera_h camera, double *latitude , double *longitude, double *altitude)
3979 if( camera == NULL || latitude == NULL || longitude == NULL || altitude == NULL){
3980 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3981 return CAMERA_ERROR_INVALID_PARAMETER;
3984 int ret = CAMERA_ERROR_NONE;
3985 camera_cli_s *pc = (camera_cli_s *)camera;
3986 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_GEOTAG;
3987 double get_geotag[3] = {0,};
3989 if (pc->cb_info == NULL) {
3990 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3991 return CAMERA_ERROR_INVALID_PARAMETER;
3993 sock_fd = pc->cb_info->fd;
3995 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3996 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3998 if (ret == CAMERA_ERROR_NONE) {
3999 muse_camera_msg_get_array(get_geotag, pc->cb_info->recvMsg);
4000 *latitude = get_geotag[0];
4001 *longitude = get_geotag[1];
4002 *altitude = get_geotag[2];
4004 LOGE("Returned value is not valid : 0x%x", valid);
4007 LOGD("ret : 0x%x", ret);
4013 int camera_attr_get_flash_mode(camera_h camera, camera_attr_flash_mode_e *mode)
4015 if( camera == NULL || mode == NULL){
4016 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4017 return CAMERA_ERROR_INVALID_PARAMETER;
4020 int ret = CAMERA_ERROR_NONE;
4021 camera_cli_s *pc = (camera_cli_s *)camera;
4022 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_FLASH_MODE;
4024 if (pc->cb_info == NULL) {
4025 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4026 return CAMERA_ERROR_INVALID_PARAMETER;
4028 sock_fd = pc->cb_info->fd;
4031 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4032 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4034 if (ret == CAMERA_ERROR_NONE) {
4035 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
4036 *mode = (camera_attr_flash_mode_e)get_mode;
4038 LOGD("ret : 0x%x", ret);
4043 int camera_attr_foreach_supported_af_mode( camera_h camera, camera_attr_supported_af_mode_cb foreach_cb , void *user_data)
4045 if( camera == NULL || foreach_cb == NULL){
4046 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4047 return CAMERA_ERROR_INVALID_PARAMETER;
4049 int ret = CAMERA_ERROR_NONE;
4051 camera_cli_s *pc = (camera_cli_s *)camera;
4052 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_AF_MODE;
4054 LOGD("Enter, handle :%x", pc->remote_handle);
4057 if (pc->cb_info == NULL) {
4058 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4059 return CAMERA_ERROR_INVALID_PARAMETER;
4061 sock_fd = pc->cb_info->fd;
4062 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_AF_MODE] = foreach_cb;
4063 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_AF_MODE] = user_data;
4065 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4066 LOGD("ret : 0x%x", ret);
4071 int camera_attr_foreach_supported_exposure_mode(camera_h camera, camera_attr_supported_exposure_mode_cb foreach_cb , void *user_data)
4073 if( camera == NULL || foreach_cb == NULL){
4074 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4075 return CAMERA_ERROR_INVALID_PARAMETER;
4077 int ret = CAMERA_ERROR_NONE;
4079 camera_cli_s *pc = (camera_cli_s *)camera;
4080 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_EXPOSURE_MODE;
4082 LOGD("Enter, handle :%x", pc->remote_handle);
4085 if (pc->cb_info == NULL) {
4086 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4087 return CAMERA_ERROR_INVALID_PARAMETER;
4089 sock_fd = pc->cb_info->fd;
4090 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EXPOSURE_MODE] = foreach_cb;
4091 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EXPOSURE_MODE] = user_data;
4093 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4094 LOGD("ret : 0x%x", ret);
4099 int camera_attr_foreach_supported_iso( camera_h camera, camera_attr_supported_iso_cb foreach_cb , void *user_data)
4101 if( camera == NULL || foreach_cb == NULL){
4102 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4103 return CAMERA_ERROR_INVALID_PARAMETER;
4105 int ret = CAMERA_ERROR_NONE;
4107 camera_cli_s *pc = (camera_cli_s *)camera;
4108 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_ISO;
4110 LOGD("Enter, handle :%x", pc->remote_handle);
4113 if (pc->cb_info == NULL) {
4114 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4115 return CAMERA_ERROR_INVALID_PARAMETER;
4117 sock_fd = pc->cb_info->fd;
4118 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_ISO] = foreach_cb;
4119 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_ISO] = user_data;
4121 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4122 LOGD("ret : 0x%x", ret);
4127 int camera_attr_foreach_supported_whitebalance(camera_h camera, camera_attr_supported_whitebalance_cb foreach_cb , void *user_data)
4129 if( camera == NULL || foreach_cb == NULL){
4130 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4131 return CAMERA_ERROR_INVALID_PARAMETER;
4133 int ret = CAMERA_ERROR_NONE;
4135 camera_cli_s *pc = (camera_cli_s *)camera;
4136 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_WHITEBALANCE;
4138 LOGD("Enter, handle :%x", pc->remote_handle);
4141 if (pc->cb_info == NULL) {
4142 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4143 return CAMERA_ERROR_INVALID_PARAMETER;
4145 sock_fd = pc->cb_info->fd;
4146 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_WHITEBALANCE] = foreach_cb;
4147 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_WHITEBALANCE] = user_data;
4149 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4150 LOGD("ret : 0x%x", ret);
4155 int camera_attr_foreach_supported_effect(camera_h camera, camera_attr_supported_effect_cb foreach_cb , void *user_data)
4157 if( camera == NULL || foreach_cb == NULL){
4158 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4159 return CAMERA_ERROR_INVALID_PARAMETER;
4161 int ret = CAMERA_ERROR_NONE;
4163 camera_cli_s *pc = (camera_cli_s *)camera;
4164 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_EFFECT;
4166 LOGD("Enter, handle :%x", pc->remote_handle);
4169 if (pc->cb_info == NULL) {
4170 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4171 return CAMERA_ERROR_INVALID_PARAMETER;
4173 sock_fd = pc->cb_info->fd;
4174 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EFFECT] = foreach_cb;
4175 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EFFECT] = user_data;
4177 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4178 LOGD("ret : 0x%x", ret);
4183 int camera_attr_foreach_supported_scene_mode(camera_h camera, camera_attr_supported_scene_mode_cb foreach_cb , void *user_data)
4185 if( camera == NULL || foreach_cb == NULL){
4186 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4187 return CAMERA_ERROR_INVALID_PARAMETER;
4189 int ret = CAMERA_ERROR_NONE;
4191 camera_cli_s *pc = (camera_cli_s *)camera;
4192 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_SCENE_MODE;
4194 LOGD("Enter, handle :%x", pc->remote_handle);
4197 if (pc->cb_info == NULL) {
4198 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4199 return CAMERA_ERROR_INVALID_PARAMETER;
4201 sock_fd = pc->cb_info->fd;
4202 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_SCENE_MODE] = foreach_cb;
4203 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_SCENE_MODE] = user_data;
4205 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4206 LOGD("ret : 0x%x", ret);
4211 int camera_attr_foreach_supported_flash_mode(camera_h camera, camera_attr_supported_flash_mode_cb foreach_cb , void *user_data)
4213 if( camera == NULL || foreach_cb == NULL){
4214 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4215 return CAMERA_ERROR_INVALID_PARAMETER;
4217 int ret = CAMERA_ERROR_NONE;
4219 camera_cli_s *pc = (camera_cli_s *)camera;
4220 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_FLASH_MODE;
4222 LOGD("Enter, handle :%x", pc->remote_handle);
4225 if (pc->cb_info == NULL) {
4226 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4227 return CAMERA_ERROR_INVALID_PARAMETER;
4229 sock_fd = pc->cb_info->fd;
4230 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FLASH_MODE] = foreach_cb;
4231 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FLASH_MODE] = user_data;
4233 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4234 LOGD("ret : 0x%x", ret);
4239 int camera_attr_foreach_supported_fps(camera_h camera, camera_attr_supported_fps_cb foreach_cb , void *user_data)
4241 if( camera == NULL || foreach_cb == NULL){
4242 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4243 return CAMERA_ERROR_INVALID_PARAMETER;
4245 int ret = CAMERA_ERROR_NONE;
4247 camera_cli_s *pc = (camera_cli_s *)camera;
4248 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_FPS;
4250 if (pc->cb_info == NULL) {
4251 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4252 return CAMERA_ERROR_INVALID_PARAMETER;
4254 sock_fd = pc->cb_info->fd;
4255 LOGD("Enter, handle :%x", pc->remote_handle);
4256 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS] = foreach_cb;
4257 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS] = user_data;
4259 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4260 LOGD("Enter, handle :%x", pc->remote_handle);
4264 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)
4266 if( camera == NULL || foreach_cb == NULL){
4267 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4268 return CAMERA_ERROR_INVALID_PARAMETER;
4270 int ret = CAMERA_ERROR_NONE;
4272 camera_cli_s *pc = (camera_cli_s *)camera;
4273 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_FPS_BY_RESOLUTION;
4275 if (pc->cb_info == NULL) {
4276 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4277 return CAMERA_ERROR_INVALID_PARAMETER;
4279 sock_fd = pc->cb_info->fd;
4280 LOGD("Enter, handle :%x", pc->remote_handle);
4281 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS_BY_RESOLUTION] = foreach_cb;
4282 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS_BY_RESOLUTION] = user_data;
4284 muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret, INT, width, INT, height);
4285 LOGD("ret : 0x%x", ret);
4289 int camera_attr_foreach_supported_stream_flip(camera_h camera, camera_attr_supported_stream_flip_cb foreach_cb, void *user_data)
4291 if( camera == NULL || foreach_cb == NULL){
4292 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4293 return CAMERA_ERROR_INVALID_PARAMETER;
4295 int ret = CAMERA_ERROR_NONE;
4297 camera_cli_s *pc = (camera_cli_s *)camera;
4298 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_STREAM_FLIP;
4300 if (pc->cb_info == NULL) {
4301 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4302 return CAMERA_ERROR_INVALID_PARAMETER;
4304 sock_fd = pc->cb_info->fd;
4305 LOGD("Enter, handle :%x", pc->remote_handle);
4306 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_FLIP] = foreach_cb;
4307 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_FLIP] = user_data;
4309 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4310 LOGD("ret : 0x%x", ret);
4315 int camera_attr_foreach_supported_stream_rotation(camera_h camera, camera_attr_supported_stream_rotation_cb foreach_cb, void *user_data)
4317 if( camera == NULL || foreach_cb == NULL){
4318 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4319 return CAMERA_ERROR_INVALID_PARAMETER;
4321 int ret = CAMERA_ERROR_NONE;
4323 camera_cli_s *pc = (camera_cli_s *)camera;
4324 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_STREAM_ROTATION;
4326 if (pc->cb_info == NULL) {
4327 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4328 return CAMERA_ERROR_INVALID_PARAMETER;
4330 sock_fd = pc->cb_info->fd;
4331 LOGD("Enter, handle :%x", pc->remote_handle);
4332 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_ROTATION] = foreach_cb;
4333 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_ROTATION] = user_data;
4335 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4336 LOGD("ret : 0x%x", ret);
4341 int camera_attr_set_stream_rotation(camera_h camera , camera_rotation_e rotation)
4343 if( camera == NULL){
4344 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4345 return CAMERA_ERROR_INVALID_PARAMETER;
4348 int ret = CAMERA_ERROR_NONE;
4349 camera_cli_s *pc = (camera_cli_s *)camera;
4350 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_STREAM_ROTATION;
4352 if (pc->cb_info == NULL) {
4353 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4354 return CAMERA_ERROR_INVALID_PARAMETER;
4356 sock_fd = pc->cb_info->fd;
4357 int set_rotation = (int)rotation;
4359 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4360 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_rotation);
4361 LOGD("ret : 0x%x", ret);
4366 int camera_attr_get_stream_rotation(camera_h camera , camera_rotation_e *rotation)
4368 if( camera == NULL || rotation == NULL ){
4369 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4370 return CAMERA_ERROR_INVALID_PARAMETER;
4373 int ret = CAMERA_ERROR_NONE;
4374 camera_cli_s *pc = (camera_cli_s *)camera;
4375 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_STREAM_ROTATION;
4377 if (pc->cb_info == NULL) {
4378 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4379 return CAMERA_ERROR_INVALID_PARAMETER;
4381 sock_fd = pc->cb_info->fd;
4384 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4385 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4387 if (ret == CAMERA_ERROR_NONE) {
4388 muse_camera_msg_get(get_rotation, pc->cb_info->recvMsg);
4389 *rotation = (camera_rotation_e)get_rotation;
4391 LOGD("ret : 0x%x", ret);
4396 int camera_attr_set_stream_flip(camera_h camera , camera_flip_e flip)
4398 if( camera == NULL){
4399 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4400 return CAMERA_ERROR_INVALID_PARAMETER;
4403 int ret = CAMERA_ERROR_NONE;
4404 camera_cli_s *pc = (camera_cli_s *)camera;
4405 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_STREAM_FLIP;
4407 if (pc->cb_info == NULL) {
4408 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4409 return CAMERA_ERROR_INVALID_PARAMETER;
4411 sock_fd = pc->cb_info->fd;
4412 int set_flip = (int)flip;
4414 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4415 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_flip);
4416 LOGD("ret : 0x%x", ret);
4421 int camera_attr_get_stream_flip(camera_h camera , camera_flip_e *flip)
4423 if( camera == NULL || flip == NULL ){
4424 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4425 return CAMERA_ERROR_INVALID_PARAMETER;
4428 int ret = CAMERA_ERROR_NONE;
4429 camera_cli_s *pc = (camera_cli_s *)camera;
4430 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_STREAM_FLIP;
4432 if (pc->cb_info == NULL) {
4433 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4434 return CAMERA_ERROR_INVALID_PARAMETER;
4436 sock_fd = pc->cb_info->fd;
4439 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4440 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4442 if (ret == CAMERA_ERROR_NONE) {
4443 muse_camera_msg_get(get_flip, pc->cb_info->recvMsg);
4444 *flip = (camera_flip_e)get_flip;
4446 LOGD("ret : 0x%x", ret);
4450 int camera_attr_set_hdr_mode(camera_h camera, camera_attr_hdr_mode_e mode)
4452 if( camera == NULL){
4453 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
4454 return CAMERA_ERROR_INVALID_PARAMETER;
4457 int ret = CAMERA_ERROR_NONE;
4458 camera_cli_s *pc = (camera_cli_s *)camera;
4459 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_HDR_MODE;
4461 if (pc->cb_info == NULL) {
4462 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4463 return CAMERA_ERROR_INVALID_PARAMETER;
4465 sock_fd = pc->cb_info->fd;
4466 int set_mode = (int)mode;
4468 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4469 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
4470 LOGD("ret : 0x%x", ret);
4475 int camera_attr_get_hdr_mode(camera_h camera, camera_attr_hdr_mode_e *mode)
4477 if (camera == NULL) {
4478 LOGE("INVALID_PARAMETER(0x%08x) - handle",CAMERA_ERROR_INVALID_PARAMETER);
4479 return CAMERA_ERROR_INVALID_PARAMETER;
4482 LOGE("CAMERA_ERROR_NOT_SUPPORTED(0x%08x) - mode",CAMERA_ERROR_NOT_SUPPORTED);
4483 return CAMERA_ERROR_NOT_SUPPORTED;
4485 int ret = CAMERA_ERROR_NONE;
4486 camera_cli_s *pc = (camera_cli_s *)camera;
4487 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_HDR_MODE;
4489 if (pc->cb_info == NULL) {
4490 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4491 return CAMERA_ERROR_INVALID_PARAMETER;
4493 sock_fd = pc->cb_info->fd;
4496 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4497 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4499 if (ret == CAMERA_ERROR_NONE) {
4500 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
4501 *mode = (camera_attr_hdr_mode_e)get_mode;
4503 LOGD("ret : 0x%x", ret);
4508 bool camera_attr_is_supported_hdr_capture(camera_h camera)
4510 if( camera == NULL){
4511 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4515 int ret = CAMERA_ERROR_NONE;
4516 camera_cli_s *pc = (camera_cli_s *)camera;
4517 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_SUPPORTED_HDR_CAPTURE;
4519 if (pc->cb_info == NULL) {
4520 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4521 return CAMERA_ERROR_INVALID_PARAMETER;
4523 sock_fd = pc->cb_info->fd;
4524 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4525 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4526 LOGD("ret : 0x%x", ret);
4531 int camera_attr_set_hdr_capture_progress_cb(camera_h camera, camera_attr_hdr_progress_cb callback, void* user_data)
4533 if (camera == NULL) {
4534 LOGE("INVALID_PARAMETER(0x%08x) - handle", CAMERA_ERROR_INVALID_PARAMETER);
4535 return CAMERA_ERROR_INVALID_PARAMETER;
4537 if (callback == NULL) {
4538 LOGE("CAMERA_ERROR_NOT_SUPPORTED(0x%08x) - callback", CAMERA_ERROR_NOT_SUPPORTED);
4539 return CAMERA_ERROR_NOT_SUPPORTED;
4541 int ret = CAMERA_ERROR_NONE;
4543 camera_cli_s *pc = (camera_cli_s *)camera;
4544 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_HDR_CAPTURE_PROGRESS_CB;
4546 if (pc->cb_info == NULL) {
4547 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4548 return CAMERA_ERROR_INVALID_PARAMETER;
4550 sock_fd = pc->cb_info->fd;
4551 LOGD("Enter, handle :%x", pc->remote_handle);
4553 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_HDR_PROGRESS] = callback;
4554 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_HDR_PROGRESS] = user_data;
4556 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4557 LOGD("ret : 0x%x", ret);
4562 int camera_attr_unset_hdr_capture_progress_cb(camera_h camera)
4564 if( camera == NULL){
4565 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4566 return CAMERA_ERROR_INVALID_PARAMETER;
4569 int ret = CAMERA_ERROR_NONE;
4571 camera_cli_s *pc = (camera_cli_s *)camera;
4572 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_UNSET_HDR_CAPTURE_PROGRESS_CB;
4574 if (pc->cb_info == NULL) {
4575 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4576 return CAMERA_ERROR_INVALID_PARAMETER;
4578 sock_fd = pc->cb_info->fd;
4579 LOGD("Enter, handle :%x", pc->remote_handle);
4581 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_HDR_PROGRESS] = (void *)NULL;
4582 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_HDR_PROGRESS] = (void *)NULL;
4584 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4585 LOGD("ret : 0x%x", ret);
4590 int camera_attr_enable_anti_shake(camera_h camera, bool enable)
4592 if (camera == NULL) {
4593 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4594 return CAMERA_ERROR_INVALID_PARAMETER;
4597 int ret = CAMERA_ERROR_NONE;
4598 camera_cli_s *pc = (camera_cli_s *)camera;
4599 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_ENABLE_ANTI_SHAKE;
4601 if (pc->cb_info == NULL) {
4602 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4603 return CAMERA_ERROR_INVALID_PARAMETER;
4605 sock_fd = pc->cb_info->fd;
4606 int set_enable = (int)enable;
4608 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4609 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_enable);
4610 LOGD("ret : 0x%x", ret);
4615 int camera_attr_is_enabled_anti_shake(camera_h camera , bool *enabled)
4617 if (camera == NULL) {
4618 LOGE("INVALID_PARAMETER(0x%08x) - handle", CAMERA_ERROR_INVALID_PARAMETER);
4619 return CAMERA_ERROR_INVALID_PARAMETER;
4621 if (enabled == NULL) {
4622 LOGE("INVALID_PARAMETER(0x%08x) - enabled", CAMERA_ERROR_INVALID_PARAMETER);
4623 return CAMERA_ERROR_NOT_SUPPORTED;
4625 int ret = CAMERA_ERROR_NONE;
4626 camera_cli_s *pc = (camera_cli_s *)camera;
4627 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_ENABLED_ANTI_SHAKE;
4629 if (pc->cb_info == NULL) {
4630 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4631 return CAMERA_ERROR_INVALID_PARAMETER;
4633 sock_fd = pc->cb_info->fd;
4636 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4637 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4639 if (ret == CAMERA_ERROR_NONE) {
4640 muse_camera_msg_get(get_enabled, pc->cb_info->recvMsg);
4641 *enabled = (bool)get_enabled;
4643 LOGD("ret : 0x%x", ret);
4648 bool camera_attr_is_supported_anti_shake(camera_h camera)
4651 if( camera == NULL){
4652 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4656 int ret = CAMERA_ERROR_NONE;
4657 camera_cli_s *pc = (camera_cli_s *)camera;
4658 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_SUPPORTED_ANTI_SHAKE;
4660 if (pc->cb_info == NULL) {
4661 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4662 return CAMERA_ERROR_INVALID_PARAMETER;
4664 sock_fd = pc->cb_info->fd;
4665 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4666 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4667 LOGD("ret : 0x%x", ret);
4672 int camera_attr_enable_video_stabilization(camera_h camera, bool enable)
4674 if (camera == NULL) {
4675 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4676 return CAMERA_ERROR_INVALID_PARAMETER;
4679 int ret = CAMERA_ERROR_NONE;
4680 camera_cli_s *pc = (camera_cli_s *)camera;
4681 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_ENABLE_VIDEO_STABILIZATION;
4683 if (pc->cb_info == NULL) {
4684 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4685 return CAMERA_ERROR_INVALID_PARAMETER;
4687 sock_fd = pc->cb_info->fd;
4688 int set_enable = (int)enable;
4690 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4691 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_enable);
4692 LOGD("ret : 0x%x", ret);
4697 int camera_attr_is_enabled_video_stabilization(camera_h camera, bool *enabled)
4699 if (camera == NULL) {
4700 LOGE("INVALID_PARAMETER(0x%08x) - handle",CAMERA_ERROR_INVALID_PARAMETER);
4701 return CAMERA_ERROR_INVALID_PARAMETER;
4703 if (enabled == NULL) {
4704 LOGE("INVALID_PARAMETER(0x%08x) - enabled",CAMERA_ERROR_INVALID_PARAMETER);
4705 return CAMERA_ERROR_NOT_SUPPORTED;
4707 int ret = CAMERA_ERROR_NONE;
4708 camera_cli_s *pc = (camera_cli_s *)camera;
4709 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_ENABLED_VIDEO_STABILIZATION;
4711 if (pc->cb_info == NULL) {
4712 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4713 return CAMERA_ERROR_INVALID_PARAMETER;
4715 sock_fd = pc->cb_info->fd;
4718 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4719 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4721 if (ret == CAMERA_ERROR_NONE) {
4722 muse_camera_msg_get(get_enabled, pc->cb_info->recvMsg);
4723 *enabled = (bool)get_enabled;
4725 LOGD("ret : 0x%x", ret);
4730 bool camera_attr_is_supported_video_stabilization(camera_h camera)
4732 if( camera == NULL){
4733 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4737 int ret = CAMERA_ERROR_NONE;
4738 camera_cli_s *pc = (camera_cli_s *)camera;
4739 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_SUPPORTED_VIDEO_STABILIZATION;
4741 if (pc->cb_info == NULL) {
4742 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4743 return CAMERA_ERROR_INVALID_PARAMETER;
4745 sock_fd = pc->cb_info->fd;
4746 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4747 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4748 LOGD("ret : 0x%x", ret);
4753 int camera_attr_enable_auto_contrast(camera_h camera, bool enable)
4755 if( camera == NULL){
4756 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
4757 return CAMERA_ERROR_INVALID_PARAMETER;
4760 int ret = CAMERA_ERROR_NONE;
4761 camera_cli_s *pc = (camera_cli_s *)camera;
4762 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_ENABLE_AUTO_CONTRAST;
4764 if (pc->cb_info == NULL) {
4765 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4766 return CAMERA_ERROR_INVALID_PARAMETER;
4768 sock_fd = pc->cb_info->fd;
4769 int set_enable = (int)enable;
4771 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4772 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_enable);
4773 LOGD("ret : 0x%x", ret);
4778 int camera_attr_is_enabled_auto_contrast(camera_h camera, bool *enabled)
4780 if (camera == NULL) {
4781 LOGE("INVALID_PARAMETER(0x%08x) - handle", CAMERA_ERROR_INVALID_PARAMETER);
4782 return CAMERA_ERROR_INVALID_PARAMETER;
4784 if (enabled == NULL) {
4785 LOGE("INVALID_PARAMETER(0x%08x) - enabled", CAMERA_ERROR_INVALID_PARAMETER);
4786 return CAMERA_ERROR_INVALID_PARAMETER;
4788 int ret = CAMERA_ERROR_NONE;
4789 camera_cli_s *pc = (camera_cli_s *)camera;
4790 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_ENABLED_AUTO_CONTRAST;
4792 if (pc->cb_info == NULL) {
4793 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4794 return CAMERA_ERROR_INVALID_PARAMETER;
4796 sock_fd = pc->cb_info->fd;
4799 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4800 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4802 if (ret == CAMERA_ERROR_NONE) {
4803 muse_camera_msg_get(get_enabled, pc->cb_info->recvMsg);
4804 *enabled = (bool)get_enabled;
4806 LOGD("ret : 0x%x", ret);
4811 bool camera_attr_is_supported_auto_contrast(camera_h camera)
4813 if( camera == NULL){
4814 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4818 int ret = CAMERA_ERROR_NONE;
4819 camera_cli_s *pc = (camera_cli_s *)camera;
4820 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_SUPPORTED_AUTO_CONTRAST;
4822 if (pc->cb_info == NULL) {
4823 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4824 return CAMERA_ERROR_INVALID_PARAMETER;
4826 sock_fd = pc->cb_info->fd;
4827 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4828 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4829 LOGD("ret : 0x%x", ret);
4834 int camera_attr_disable_shutter_sound(camera_h camera, bool disable)
4836 if (camera == NULL) {
4837 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4838 return CAMERA_ERROR_INVALID_PARAMETER;
4841 int ret = CAMERA_ERROR_NONE;
4842 camera_cli_s *pc = (camera_cli_s *)camera;
4843 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_DISABLE_SHUTTER_SOUND;
4845 if (pc->cb_info == NULL) {
4846 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4847 return CAMERA_ERROR_INVALID_PARAMETER;
4849 sock_fd = pc->cb_info->fd;
4850 int set_disable = (int)disable;
4852 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4853 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_disable);
4854 LOGD("ret : 0x%x", ret);