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 static void _client_user_callback(callback_cb_info_s * cb_info, muse_camera_event_e event )
48 char *recvMsg = cb_info->recvMsg;
49 int param, param1, param2;
50 LOGD("get event %d", event);
53 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_RESOLUTION:
54 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_RESOLUTION:
55 muse_camera_msg_get(param1, recvMsg);
56 muse_camera_msg_get(param2, recvMsg);
58 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_THEATER_MODE:
59 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_FORMAT:
60 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_FORMAT:
61 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_AF_MODE:
62 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EXPOSURE_MODE:
63 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_ISO:
64 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_WHITEBALANCE:
65 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EFFECT:
66 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_SCENE_MODE:
67 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FLASH_MODE:
68 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS:
69 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS_BY_RESOLUTION:
70 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_FLIP:
71 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_ROTATION:
72 muse_camera_msg_get(param, recvMsg);
79 case MUSE_CAMERA_EVENT_TYPE_STATE_CHANGE:
81 int cb_previous, cb_current, cb_by_policy;
82 muse_camera_msg_get(cb_previous, recvMsg);
83 muse_camera_msg_get(cb_current, recvMsg);
84 muse_camera_msg_get(cb_by_policy, recvMsg);
85 ((camera_state_changed_cb)cb_info->user_cb[event])((camera_state_e)cb_previous,
86 (camera_state_e)cb_current,
88 cb_info->user_data[event]);
91 case MUSE_CAMERA_EVENT_TYPE_FOCUS_CHANGE:
94 muse_camera_msg_get(cb_state, recvMsg);
95 ((camera_focus_changed_cb)cb_info->user_cb[event])((camera_focus_state_e)cb_state,
96 cb_info->user_data[event]);
99 case MUSE_CAMERA_EVENT_TYPE_CAPTURE_COMPLETE:
100 ((camera_capture_completed_cb)cb_info->user_cb[event])(cb_info->user_data[event]);
102 case MUSE_CAMERA_EVENT_TYPE_PREVIEW:
103 ((camera_preview_cb)cb_info->user_cb[event])(NULL,
104 cb_info->user_data[event]);
106 case MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW:
107 ((camera_media_packet_preview_cb)cb_info->user_cb[event])(NULL,
108 cb_info->user_data[event]);
110 case MUSE_CAMERA_EVENT_TYPE_HDR_PROGRESS:
113 muse_camera_msg_get(progress, recvMsg);
114 ((camera_attr_hdr_progress_cb)cb_info->user_cb[event])(progress,
115 cb_info->user_data[event]);
118 case MUSE_CAMERA_EVENT_TYPE_INTERRUPTED:
120 int cb_policy, cb_previous, cb_current;
121 muse_camera_msg_get(cb_policy, recvMsg);
122 muse_camera_msg_get(cb_previous, recvMsg);
123 muse_camera_msg_get(cb_current, recvMsg);
124 ((camera_interrupted_cb)cb_info->user_cb[event])((camera_policy_e)cb_policy,
125 (camera_state_e)cb_previous,
126 (camera_state_e)cb_current,
127 cb_info->user_data[event]);
130 case MUSE_CAMERA_EVENT_TYPE_FACE_DETECTION:
133 muse_camera_msg_get(count, recvMsg);
134 ((camera_face_detected_cb)cb_info->user_cb[event])(NULL,
136 cb_info->user_data[event]);
139 case MUSE_CAMERA_EVENT_TYPE_ERROR:
141 int cb_error, cb_current_state;
142 muse_camera_msg_get(cb_error, recvMsg);
143 muse_camera_msg_get(cb_current_state, recvMsg);
144 ((camera_error_cb)cb_info->user_cb[event])((camera_error_e)cb_error,
145 (camera_state_e)cb_current_state,
146 cb_info->user_data[event]);
149 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_RESOLUTION:
150 ((camera_supported_preview_resolution_cb)cb_info->user_cb[event])(param1, param2,
151 cb_info->user_data[event]);
153 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_RESOLUTION:
154 ((camera_supported_capture_resolution_cb)cb_info->user_cb[event])(param1, param2,
155 cb_info->user_data[event]);
157 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_FORMAT:
158 ((camera_supported_capture_format_cb)cb_info->user_cb[event])((camera_pixel_format_e)param,
159 cb_info->user_data[event]);
161 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_FORMAT:
162 ((camera_supported_preview_format_cb)cb_info->user_cb[event])((camera_pixel_format_e)param,
163 cb_info->user_data[event]);
165 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_AF_MODE:
166 ((camera_attr_supported_af_mode_cb)cb_info->user_cb[event])((camera_attr_af_mode_e)param,
167 cb_info->user_data[event]);
169 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EXPOSURE_MODE:
170 ((camera_attr_supported_exposure_mode_cb)cb_info->user_cb[event])((camera_attr_exposure_mode_e)param,
171 cb_info->user_data[event]);
173 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_ISO:
174 ((camera_attr_supported_iso_cb)cb_info->user_cb[event])((camera_attr_iso_e)param,
175 cb_info->user_data[event]);
177 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_WHITEBALANCE:
178 ((camera_attr_supported_whitebalance_cb)cb_info->user_cb[event])((camera_attr_whitebalance_e)param,
179 cb_info->user_data[event]);
181 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EFFECT:
182 ((camera_attr_supported_effect_cb)cb_info->user_cb[event])((camera_attr_effect_mode_e)param,
183 cb_info->user_data[event]);
185 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_SCENE_MODE:
186 ((camera_attr_supported_scene_mode_cb)cb_info->user_cb[event])((camera_attr_scene_mode_e)param,
187 cb_info->user_data[event]);
189 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FLASH_MODE:
190 ((camera_attr_supported_flash_mode_cb)cb_info->user_cb[event])((camera_attr_flash_mode_e)param,
191 cb_info->user_data[event]);
193 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS:
194 ((camera_attr_supported_fps_cb)cb_info->user_cb[event])((camera_attr_fps_e)param,
195 cb_info->user_data[event]);
197 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS_BY_RESOLUTION:
198 ((camera_attr_supported_fps_cb)cb_info->user_cb[event])((camera_attr_fps_e)param,
199 cb_info->user_data[event]);
201 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_FLIP:
202 ((camera_attr_supported_stream_flip_cb)cb_info->user_cb[event])((camera_flip_e)param,
203 cb_info->user_data[event]);
205 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_ROTATION:
206 ((camera_attr_supported_stream_rotation_cb)cb_info->user_cb[event])((camera_rotation_e)param,
207 cb_info->user_data[event]);
209 case MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_THEATER_MODE:
210 ((camera_attr_supported_theater_mode_cb)cb_info->user_cb[event])((camera_attr_theater_mode_e)param,
211 cb_info->user_data[event]);
213 case MUSE_CAMERA_EVENT_TYPE_CAPTURE:
215 camera_image_data_s *rImage = NULL;
216 camera_image_data_s *rPostview = NULL;
217 camera_image_data_s *rThumbnail = NULL;
218 unsigned char *buf_pos = NULL;
220 tbm_bo_handle bo_handle;
223 int is_thumbnail = 0;
225 muse_camera_msg_get(tbm_key, recvMsg);
226 muse_camera_msg_get(is_postview, recvMsg);
227 muse_camera_msg_get(is_thumbnail, recvMsg);
229 LOGD("camera capture callback came in. key %d, postview %d, thumbnail %d",
230 tbm_key, is_postview, is_thumbnail);
233 LOGE("invalid key %d", tbm_key);
237 /* import tbm bo and get virtual address */
238 bo = tbm_bo_import(cb_info->bufmgr, tbm_key);
240 LOGE("bo import failed - bufmgr %p, key %d", cb_info->bufmgr, tbm_key);
244 bo_handle = tbm_bo_map(bo, TBM_DEVICE_CPU, TBM_OPTION_READ);
245 if (bo_handle.ptr == NULL) {
246 LOGE("bo map failed %p", bo);
252 buf_pos = (unsigned char *)bo_handle.ptr;
253 rImage = (camera_image_data_s *)buf_pos;
254 rImage->data = buf_pos + sizeof(camera_image_data_s);
255 buf_pos += sizeof(camera_image_data_s) + rImage->size;
258 rPostview = (camera_image_data_s *)buf_pos;
259 LOGD("rPostview->size : %d", rPostview->size);
260 rPostview->data = buf_pos + sizeof(camera_image_data_s);
261 buf_pos += sizeof(camera_image_data_s) + rPostview->size;
265 rThumbnail = (camera_image_data_s *)buf_pos;
266 LOGD("rThumbnail->size : %d", rThumbnail->size);
267 rThumbnail->data = buf_pos + sizeof(camera_image_data_s);
268 buf_pos += sizeof(camera_image_data_s) + rThumbnail->size;
271 LOGD("read image info height: %d, width : %d, size : %d", rImage->height, rImage->width, rImage->size);
273 ((camera_capturing_cb)cb_info->user_cb[event])(rImage, rPostview, rThumbnail, cb_info->user_data[event]);
275 /* unmap and unref tbm bo */
282 case MUSE_CAMERA_EVENT_TYPE_VIDEO_FRAME_RENDER_ERROR:
286 LOGE("Unknonw event : %d", event);
291 static void *client_cb_handler(gpointer data)
299 callback_cb_info_s *cb_info = data;
300 char *recvMsg = cb_info->recvMsg;
301 char parseStr[CAMERA_PARSE_STRING_SIZE][MUSE_CAMERA_MSG_MAX_LENGTH] = {{0,0},};
303 while (g_atomic_int_get(&cb_info->running)) {
304 ret = muse_core_ipc_recv_msg(cb_info->fd, recvMsg);
312 memset(parseStr, 0, CAMERA_PARSE_STRING_SIZE * MUSE_CAMERA_MSG_MAX_LENGTH);
314 LOGD("recvMSg : %s, length : %d", recvMsg, ret);
316 /* Need to split the combined entering msgs.
317 This module supports up to 200 combined msgs. */
318 for (str_pos = 0; str_pos < ret; str_pos++) {
319 if(recvMsg[str_pos] == '}') {
320 strncpy(&(parseStr[num_token][0]), recvMsg + prev_pos, str_pos - prev_pos + 1);
321 LOGD("splitted msg : %s, Index : %d", &(parseStr[num_token][0]), num_token);
322 prev_pos = str_pos+1;
326 LOGD("num_token : %d", num_token);
328 /* Re-construct to the useful single msg. */
329 for (i = 0; i < num_token; i++) {
331 if (i >= CAMERA_PARSE_STRING_SIZE)
334 if (muse_camera_msg_get(api, &(parseStr[i][0]))) {
335 if(api < MUSE_CAMERA_API_MAX){
336 LOGD("Set Condition");
337 g_mutex_lock(&(cb_info->pMutex[api]));
339 /* The api msgs should be distinguished from the event msg. */
340 memset(cb_info->recvApiMsg, 0, strlen(cb_info->recvApiMsg));
341 strcpy(cb_info->recvApiMsg, &(parseStr[i][0]));
342 LOGD("cb_info->recvApiMsg : %s", cb_info->recvApiMsg);
343 cb_info->activating[api] = 1;
344 g_cond_signal(&(cb_info->pCond[api]));
345 g_mutex_unlock(&(cb_info->pMutex[api]));
347 if (api == MUSE_CAMERA_API_CREATE) {
348 if (muse_camera_msg_get(ret, cb_info->recvApiMsg)) {
349 if (ret != CAMERA_ERROR_NONE) {
350 g_atomic_int_set(&cb_info->running, 0);
351 LOGE("camera create error. close client cb handler");
354 LOGE("failed to get api return");
356 } else if (api == MUSE_CAMERA_API_DESTROY) {
357 if (muse_camera_msg_get(ret, cb_info->recvApiMsg)) {
358 if (ret == CAMERA_ERROR_NONE) {
359 g_atomic_int_set(&cb_info->running, 0);
360 LOGD("camera destroy done. close client cb handler");
363 LOGE("failed to get api return");
366 } else if(api == MUSE_CAMERA_CB_EVENT) {
368 if (muse_camera_msg_get(event, &(parseStr[i][0]))) {
369 LOGD("go callback : %d", event);
370 _client_user_callback(cb_info, event);
373 LOGW("unknown api : %d", api);
376 LOGE("Get Msg Failed");
381 LOGD("client cb exit");
386 static callback_cb_info_s *client_callback_new(gint sockfd)
388 callback_cb_info_s *cb_info;
390 GMutex *camera_mutex;
392 g_return_val_if_fail(sockfd > 0, NULL);
394 cb_info = g_new0(callback_cb_info_s, 1);
395 camera_cond = g_new0(GCond, MUSE_CAMERA_API_MAX);
396 camera_mutex = g_new0(GMutex, MUSE_CAMERA_API_MAX);
397 camera_activ = g_new0(gint, MUSE_CAMERA_API_MAX);
399 g_atomic_int_set(&cb_info->running, 1);
400 cb_info->fd = sockfd;
401 cb_info->pCond = camera_cond;
402 cb_info->pMutex = camera_mutex;
403 cb_info->activating = camera_activ;
405 g_thread_new("callback_thread", client_cb_handler,
411 static int client_wait_for_cb_return(muse_camera_api_e api, callback_cb_info_s *cb_info, int time_out)
413 int ret = CAMERA_ERROR_NONE;
416 LOGD("Enter api : %d", api);
417 g_mutex_lock(&(cb_info->pMutex[api]));
419 if (cb_info->activating[api] == 0) {
420 end_time = g_get_monotonic_time() + time_out * G_TIME_SPAN_SECOND;
421 if (g_cond_wait_until(&(cb_info->pCond[api]), &(cb_info->pMutex[api]), end_time)) {
422 LOGD("cb_info->recvApiMsg : %s", cb_info->recvApiMsg);
423 if (!muse_camera_msg_get(ret, cb_info->recvApiMsg)) {
424 LOGE("Get cb msg failed.");
425 ret = CAMERA_ERROR_INVALID_OPERATION;
427 LOGD("Wait passed, ret : 0x%x", ret);
429 if (cb_info->activating[api])
430 cb_info->activating[api] = 0;
432 LOGD("api %d was TIMED OUT!", api);
433 ret = CAMERA_ERROR_INVALID_OPERATION;
436 LOGE("condition is already checked for the api : %d.", api);
437 if (!muse_camera_msg_get(ret, cb_info->recvApiMsg)) {
438 LOGE("Get cb msg failed.");
439 ret = CAMERA_ERROR_INVALID_OPERATION;
441 LOGD("Already checked condition, Wait passed, ret : 0x%x", ret);
444 g_mutex_unlock(&(cb_info->pMutex[api]));
445 LOGD("ret : 0x%x", ret);
449 static void client_callback_destroy(callback_cb_info_s * cb_info)
451 g_return_if_fail(cb_info != NULL);
453 LOGI("%p Callback destroyed", cb_info->thread);
455 g_thread_join(cb_info->thread);
456 g_thread_unref(cb_info->thread);
458 if (cb_info->bufmgr) {
459 tbm_bufmgr_deinit(cb_info->bufmgr);
460 cb_info->bufmgr = NULL;
463 if (cb_info->pCond) {
464 g_free(cb_info->pCond);
466 if (cb_info->pMutex) {
467 g_free(cb_info->pMutex);
469 if (cb_info->activating) {
470 g_free(cb_info->activating);
475 int camera_create(camera_device_e device, camera_h* camera)
479 int ret = CAMERA_ERROR_NONE;
480 camera_cli_s *pc = NULL;
481 tbm_bufmgr bufmgr = NULL;
483 muse_camera_api_e api = MUSE_CAMERA_API_CREATE;
484 muse_core_api_module_e muse_module = MUSE_CAMERA;
485 int device_type = (int)device;
488 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
489 return CAMERA_ERROR_INVALID_PARAMETER;
492 bufmgr = tbm_bufmgr_init(-1);
493 if (bufmgr == NULL) {
494 LOGE("get tbm bufmgr failed");
495 return CAMERA_ERROR_INVALID_OPERATION;
498 sock_fd = muse_core_client_new();
500 sndMsg = muse_core_msg_json_factory_new(api,
501 MUSE_TYPE_INT, "module", muse_module,
502 MUSE_TYPE_INT, PARAM_DEVICE_TYPE, (int)device_type,
505 muse_core_ipc_send_msg(sock_fd, sndMsg);
506 muse_core_msg_json_factory_free(sndMsg);
508 pc = g_new0(camera_cli_s, 1);
510 ret = CAMERA_ERROR_OUT_OF_MEMORY;
514 pc->cb_info = client_callback_new(sock_fd);
516 LOGD("cb info : %d", pc->cb_info->fd);
518 ret = client_wait_for_cb_return(api, pc->cb_info, CALLBACK_TIME_OUT);
519 if (ret == CAMERA_ERROR_NONE) {
521 muse_camera_msg_get_pointer(handle, pc->cb_info->recvMsg);
523 LOGE("Receiving Handle Failed!!");
524 ret = CAMERA_ERROR_INVALID_OPERATION;
527 pc->remote_handle = handle;
528 pc->cb_info->bufmgr = bufmgr;
531 LOGD("camera create 0x%x", pc->remote_handle);
533 *camera = (camera_h) pc;
541 tbm_bufmgr_deinit(bufmgr);
545 client_callback_destroy(pc->cb_info);
551 LOGE("camera create error : 0x%x", ret);
556 int camera_destroy(camera_h camera)
558 if (camera == NULL) {
559 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
560 return CAMERA_ERROR_INVALID_PARAMETER;
563 int ret = CAMERA_ERROR_NONE;
564 muse_camera_api_e api = MUSE_CAMERA_API_DESTROY;
565 camera_cli_s *pc = (camera_cli_s *)camera;
566 int sock_fd = pc->cb_info->fd;
570 LOGE("pc is already nul!!");
571 return CAMERA_ERROR_INVALID_PARAMETER;
572 } else if (pc->cb_info == NULL) {
573 return CAMERA_ERROR_INVALID_PARAMETER;
576 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
577 if (ret == CAMERA_ERROR_NONE) {
578 client_callback_destroy(pc->cb_info);
582 LOGE("camera destroy error : 0x%x", ret);
588 int camera_start_preview(camera_h camera)
591 if (camera == NULL) {
592 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
593 return CAMERA_ERROR_INVALID_PARAMETER;
596 int ret = CAMERA_ERROR_NONE;
597 muse_camera_api_e api = MUSE_CAMERA_API_START_PREVIEW;
598 camera_cli_s *pc = (camera_cli_s *)camera;
600 char caps[MUSE_CAMERA_MSG_MAX_LENGTH] = {0};
602 if (pc->cb_info == NULL) {
603 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
604 return CAMERA_ERROR_INVALID_PARAMETER;
607 sock_fd = pc->cb_info->fd;
609 muse_camera_msg_send_longtime(api, sock_fd, pc->cb_info, ret);
610 LOGD("Enter, ret :0x%x", ret);
611 if(ret == CAMERA_ERROR_NONE) {
612 muse_camera_msg_get_string(caps, pc->cb_info->recvMsg);
613 LOGD("caps : %s", caps);
614 if (pc->cli_display_handle != 0) {
615 LOGD("client's display handle is : 0x%x", pc->cli_display_handle);
616 if(strlen(caps) > 0 &&
617 mm_camcorder_client_realize(pc->client_handle, caps) != MM_ERROR_NONE)
618 ret = CAMERA_ERROR_INVALID_OPERATION;
620 LOGD("display handle is NULL");
623 LOGD("ret : 0x%x", ret);
627 int camera_stop_preview(camera_h camera)
629 if (camera == NULL) {
630 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
631 return CAMERA_ERROR_INVALID_PARAMETER;
633 int ret = CAMERA_ERROR_NONE;
634 camera_cli_s *pc = (camera_cli_s *)camera;
636 muse_camera_api_e api = MUSE_CAMERA_API_STOP_PREVIEW;
638 if (pc->cb_info == NULL) {
639 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
640 return CAMERA_ERROR_INVALID_PARAMETER;
643 sock_fd = pc->cb_info->fd;
645 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
647 if(ret == CAMERA_ERROR_NONE) {
648 if (pc->cli_display_handle != 0) {
649 LOGD("Unrealize client");
650 if (pc->client_handle != NULL) {
651 ret = mm_camcorder_client_unrealize(pc->client_handle);
652 mm_camcorder_client_destroy(pc->client_handle);
655 LOGD("Client did not realized : Display handle is NULL");
658 LOGD("ret : 0x%x", ret);
662 int camera_start_capture(camera_h camera, camera_capturing_cb capturing_cb , camera_capture_completed_cb completed_cb , void *user_data)
664 if (camera == NULL) {
665 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
666 return CAMERA_ERROR_INVALID_PARAMETER;
668 int ret = CAMERA_ERROR_NONE;
670 camera_cli_s *pc = (camera_cli_s *)camera;
671 muse_camera_api_e api = MUSE_CAMERA_API_START_CAPTURE;
673 int is_capturing_cb = 0;
674 int is_completed_cb = 0;
675 LOGD("Enter, handle :%x", pc->remote_handle);
677 if (pc->cb_info == NULL) {
678 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
679 return CAMERA_ERROR_INVALID_PARAMETER;
682 sock_fd = pc->cb_info->fd;
684 if (capturing_cb != NULL) {
686 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_CAPTURE] = capturing_cb;
687 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_CAPTURE] = user_data;
690 if(completed_cb != NULL) {
692 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_CAPTURE_COMPLETE] = completed_cb;
693 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_CAPTURE_COMPLETE] = user_data;
696 muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret, INT, is_capturing_cb, INT, is_completed_cb);
697 LOGD("is_capturing_cb :%d, is_completed_cb : %d", is_capturing_cb, is_completed_cb);
698 LOGD("ret : 0x%x", ret);
702 bool camera_is_supported_continuous_capture(camera_h camera)
704 if (camera == NULL) {
705 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
709 int ret = CAMERA_ERROR_NONE;
710 camera_cli_s *pc = (camera_cli_s *)camera;
711 muse_camera_api_e api = MUSE_CAMERA_API_SUPPORT_CONTINUOUS_CAPTURE;
714 if (pc->cb_info == NULL) {
715 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
716 return CAMERA_ERROR_INVALID_PARAMETER;
719 sock_fd = pc->cb_info->fd;
721 LOGD("Enter, remote_handle : %x", pc->remote_handle);
722 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
723 LOGD("ret : 0x%x", ret);
727 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)
729 if (camera == NULL) {
730 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
731 return CAMERA_ERROR_INVALID_PARAMETER;
734 int ret = CAMERA_ERROR_NONE;
736 camera_cli_s *pc = (camera_cli_s *)camera;
737 muse_camera_api_e api = MUSE_CAMERA_API_START_CONTINUOUS_CAPTURE;
739 LOGD("Enter, handle :%x", pc->remote_handle);
742 if (pc->cb_info == NULL) {
743 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
744 return CAMERA_ERROR_INVALID_PARAMETER;
746 sock_fd = pc->cb_info->fd;
748 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_CAPTURE] = capturing_cb;
749 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_CAPTURE] = user_data;
750 pc->cb_info->user_cb_completed[MUSE_CAMERA_EVENT_TYPE_CAPTURE] = completed_cb;
752 muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret, INT, count, INT, interval);
753 LOGD("ret : 0x%x", ret);
757 int camera_stop_continuous_capture(camera_h camera)
759 if (camera == NULL) {
760 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
761 return CAMERA_ERROR_INVALID_PARAMETER;
765 int ret = CAMERA_ERROR_NONE;
767 camera_cli_s *pc = (camera_cli_s *)camera;
768 muse_camera_api_e api = MUSE_CAMERA_API_STOP_CONTINUOUS_CAPTURE;
769 LOGD("Enter, handle :%x", pc->remote_handle);
771 if (pc->cb_info == NULL) {
772 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
773 return CAMERA_ERROR_INVALID_PARAMETER;
775 sock_fd = pc->cb_info->fd;
776 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
777 LOGD("ret : 0x%x", ret);
781 bool camera_is_supported_face_detection(camera_h camera)
783 if (camera == NULL) {
784 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
787 int ret = CAMERA_ERROR_NONE;
789 camera_cli_s *pc = (camera_cli_s *)camera;
790 muse_camera_api_e api = MUSE_CAMERA_API_SUPPORT_FACE_DETECTION;
792 if (pc->cb_info == NULL) {
793 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
794 return CAMERA_ERROR_INVALID_PARAMETER;
796 sock_fd = pc->cb_info->fd;
798 LOGD("Enter, remote_handle : %x", pc->remote_handle);
799 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
800 LOGD("ret : 0x%x", ret);
804 bool camera_is_supported_zero_shutter_lag(camera_h camera)
806 if (camera == NULL) {
807 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
810 int ret = CAMERA_ERROR_NONE;
812 camera_cli_s *pc = (camera_cli_s *)camera;
813 muse_camera_api_e api = MUSE_CAMERA_API_SUPPORT_ZERO_SHUTTER_LAG;
815 if (pc->cb_info == NULL) {
816 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
817 return CAMERA_ERROR_INVALID_PARAMETER;
819 sock_fd = pc->cb_info->fd;
821 LOGD("Enter, remote_handle : %x", pc->remote_handle);
822 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
823 LOGD("ret : 0x%x", ret);
827 bool camera_is_supported_media_packet_preview_cb(camera_h camera)
829 if (camera == NULL) {
830 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
834 int ret = CAMERA_ERROR_NONE;
836 camera_cli_s *pc = (camera_cli_s *)camera;
837 muse_camera_api_e api = MUSE_CAMERA_API_SUPPORT_MEDIA_PACKET_PREVIEW_CB;
839 if (pc->cb_info == NULL) {
840 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
841 return CAMERA_ERROR_INVALID_PARAMETER;
843 sock_fd = pc->cb_info->fd;
845 LOGD("Enter, remote_handle : %x", pc->remote_handle);
846 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
847 LOGD("ret : 0x%x", ret);
851 int camera_get_device_count(camera_h camera, int *device_count)
853 if (camera == NULL || device_count == NULL) {
854 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
855 return CAMERA_ERROR_INVALID_PARAMETER;
857 int ret = CAMERA_ERROR_NONE;
859 camera_cli_s *pc = (camera_cli_s *)camera;
860 muse_camera_api_e api = MUSE_CAMERA_API_GET_DEVICE_COUNT;
862 if (pc->cb_info == NULL) {
863 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
864 return CAMERA_ERROR_INVALID_PARAMETER;
866 sock_fd = pc->cb_info->fd;
867 int get_device_count;
869 LOGD("Enter, remote_handle : %x", pc->remote_handle);
870 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
872 if (ret == CAMERA_ERROR_NONE) {
873 muse_camera_msg_get(get_device_count, pc->cb_info->recvMsg);
874 *device_count = get_device_count;
876 LOGD("ret : 0x%x", ret);
880 int camera_start_face_detection(camera_h camera, camera_face_detected_cb callback, void * user_data)
882 if (camera == NULL) {
883 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
884 return CAMERA_ERROR_INVALID_PARAMETER;
887 int ret = CAMERA_ERROR_NONE;
889 camera_cli_s *pc = (camera_cli_s *)camera;
890 muse_camera_api_e api = MUSE_CAMERA_API_START_FACE_DETECTION;
892 LOGD("Enter, handle :%x", pc->remote_handle);
894 if (pc->cb_info == NULL) {
895 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
896 return CAMERA_ERROR_INVALID_PARAMETER;
898 sock_fd = pc->cb_info->fd;
899 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FACE_DETECTION] = callback;
900 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FACE_DETECTION] = user_data;
902 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
903 LOGD("ret : 0x%x", ret);
907 int camera_stop_face_detection(camera_h camera)
909 if (camera == NULL) {
910 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
911 return CAMERA_ERROR_INVALID_PARAMETER;
914 int ret = CAMERA_ERROR_NONE;
916 camera_cli_s *pc = (camera_cli_s *)camera;
917 muse_camera_api_e api = MUSE_CAMERA_API_STOP_FACE_DETECTION;
918 LOGD("Enter, handle :%x", pc->remote_handle);
920 if (pc->cb_info == NULL) {
921 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
922 return CAMERA_ERROR_INVALID_PARAMETER;
924 sock_fd = pc->cb_info->fd;
925 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
926 LOGD("ret : 0x%x", ret);
930 int camera_get_state(camera_h camera, camera_state_e * state)
932 if (camera == NULL || state == NULL) {
933 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
934 return CAMERA_ERROR_INVALID_PARAMETER;
936 int ret = CAMERA_ERROR_NONE;
938 camera_cli_s *pc = (camera_cli_s *)camera;
939 muse_camera_api_e api = MUSE_CAMERA_API_GET_STATE;
941 if (pc->cb_info == NULL) {
942 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
943 return CAMERA_ERROR_INVALID_PARAMETER;
945 sock_fd = pc->cb_info->fd;
948 LOGD("Enter, remote_handle : %x", pc->remote_handle);
949 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
951 if (ret == CAMERA_ERROR_NONE) {
952 muse_camera_msg_get(get_state, pc->cb_info->recvMsg);
953 *state = (camera_state_e)get_state;
955 LOGD("ret : 0x%x", ret);
959 int camera_start_focusing(camera_h camera, bool continuous)
962 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
963 return CAMERA_ERROR_INVALID_PARAMETER;
966 int ret = CAMERA_ERROR_NONE;
968 camera_cli_s *pc = (camera_cli_s *)camera;
969 muse_camera_api_e api = MUSE_CAMERA_API_START_FOCUSING;
971 if (pc->cb_info == NULL) {
972 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
973 return CAMERA_ERROR_INVALID_PARAMETER;
975 sock_fd = pc->cb_info->fd;
976 int is_continuous = (int)continuous;
978 LOGD("Enter, remote_handle : %x", pc->remote_handle);
979 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, is_continuous);
980 LOGD("ret : 0x%x", ret);
984 int camera_cancel_focusing(camera_h camera)
986 if (camera == NULL) {
987 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
988 return CAMERA_ERROR_INVALID_PARAMETER;
991 int ret = CAMERA_ERROR_NONE;
993 camera_cli_s *pc = (camera_cli_s *)camera;
994 muse_camera_api_e api = MUSE_CAMERA_API_CANCEL_FOCUSING;
996 if (pc->cb_info == NULL) {
997 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
998 return CAMERA_ERROR_INVALID_PARAMETER;
1000 sock_fd = pc->cb_info->fd;
1002 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1003 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1004 LOGD("ret : 0x%x", ret);
1008 int camera_set_display(camera_h camera, camera_display_type_e type, camera_display_h display)
1010 int ret = CAMERA_ERROR_NONE;
1011 int display_surface;
1012 void *set_display_handle = NULL;
1013 int set_surface = MM_DISPLAY_SURFACE_X;
1014 Evas_Object *obj = NULL;
1015 const char *object_type = NULL;
1016 char socket_path[MUSE_CAMERA_MSG_MAX_LENGTH] = {0,};
1018 if (camera == NULL) {
1019 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
1020 return CAMERA_ERROR_INVALID_PARAMETER;
1023 if (type != CAMERA_DISPLAY_TYPE_NONE && display == NULL) {
1024 LOGE("display type[%d] is not NONE, but display handle is NULL", type);
1025 return CAMERA_ERROR_INVALID_PARAMETER;
1028 int display_type = (int)type;
1029 camera_cli_s *pc = (camera_cli_s *)camera;
1030 muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY;
1032 if (pc->cb_info == NULL) {
1033 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1034 return CAMERA_ERROR_INVALID_PARAMETER;
1036 sock_fd = pc->cb_info->fd;
1038 LOGD("Enter, remote_handle : %x display : 0x%x", pc->remote_handle, display);
1040 if (type == CAMERA_DISPLAY_TYPE_NONE) {
1041 set_display_handle = 0;
1042 set_surface = MM_DISPLAY_SURFACE_NULL;
1043 LOGD("display type NONE");
1045 obj = (Evas_Object *)display;
1046 object_type = evas_object_type_get(obj);
1048 if (type == CAMERA_DISPLAY_TYPE_OVERLAY && !strcmp(object_type, "elm_win")) {
1050 MMCamWaylandInfo *wl_info = g_new0(MMCamWaylandInfo, 1);
1052 if (wl_info == NULL) {
1053 LOGE("wl_info alloc failed : %d", sizeof(MMCamWaylandInfo));
1054 return CAMERA_ERROR_OUT_OF_MEMORY;
1057 wl_info->evas_obj = (void *)obj;
1058 wl_info->window = (void *)elm_win_wl_window_get(obj);
1059 wl_info->surface = (void *)ecore_wl_window_surface_get(wl_info->window);
1060 wl_info->display = (void *)ecore_wl_display_get();
1062 if (wl_info->window == NULL || wl_info->surface == NULL || wl_info->display == NULL) {
1063 LOGE("something is NULL %p, %p, %p", wl_info->window, wl_info->surface, wl_info->display);
1064 return CAMERA_ERROR_INVALID_OPERATION;
1067 evas_object_geometry_get(obj, &wl_info->window_x, &wl_info->window_y,
1068 &wl_info->window_width, &wl_info->window_height);
1070 /* set wayland info */
1071 pc->wl_info = wl_info;
1072 set_surface = MM_DISPLAY_SURFACE_X;
1073 set_display_handle = (void *)wl_info;
1075 LOGD("wayland obj %p, window %p, surface %p, display %p, size %d,%d,%dx%d",
1076 wl_info->evas_obj, wl_info->window, wl_info->surface, wl_info->display,
1077 wl_info->window_x, wl_info->window_y, wl_info->window_width, wl_info->window_height);
1078 #else /* HAVE_WAYLAND */
1079 /* x window overlay surface */
1080 set_display_handle = (void *)elm_win_xwindow_get(obj);
1081 set_surface = MM_DISPLAY_SURFACE_X;
1082 LOGD("display type OVERLAY : handle %p", set_display_handle);
1084 } else if (type == CAMERA_DISPLAY_TYPE_EVAS && !strcmp(object_type, "image")) {
1085 /* evas object surface */
1086 set_display_handle = (void *)display;
1087 set_surface = MM_DISPLAY_SURFACE_EVAS;
1088 LOGD("display type EVAS : handle %p", set_display_handle);
1090 LOGE("unknown evas object [%p,%s] or type [%d] mismatch", obj, object_type, type);
1091 return CAMERA_ERROR_INVALID_PARAMETER;
1094 LOGE("failed to get evas object type from %p", obj);
1095 return CAMERA_ERROR_INVALID_PARAMETER;
1099 pc->cli_display_handle = (intptr_t)set_display_handle;
1100 display_surface = (int)set_surface;
1101 muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret,
1103 INT, display_surface);
1105 if (ret == CAMERA_ERROR_NONE && type == CAMERA_DISPLAY_TYPE_OVERLAY && !strcmp(object_type, "elm_win")) {
1106 if (mm_camcorder_client_create(&(pc->client_handle))) {
1107 LOGE("camera client create Failed");
1108 return CAMERA_ERROR_INVALID_OPERATION;
1110 muse_camera_msg_get_string(socket_path, pc->cb_info->recvMsg);
1111 LOGD("shmsrc stream path : %s", socket_path);
1112 if(mm_camcorder_client_set_shm_socket_path(pc->client_handle, socket_path)
1114 return CAMERA_ERROR_INVALID_OPERATION;
1115 ret = mm_camcorder_set_attributes(pc->client_handle, NULL,
1116 MMCAM_DISPLAY_SURFACE, set_surface,
1118 if (ret == MM_ERROR_NONE && type != CAMERA_DISPLAY_TYPE_NONE) {
1119 ret = mm_camcorder_set_attributes(pc->client_handle, NULL,
1120 MMCAM_DISPLAY_HANDLE, pc->cli_display_handle, sizeof(void *),
1122 LOGD("ret : 0x%x", ret);
1125 LOGD("ret : 0x%x", ret);
1129 int camera_set_preview_resolution(camera_h camera, int width, int height)
1131 if( camera == NULL){
1132 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1133 return CAMERA_ERROR_INVALID_PARAMETER;
1135 int ret = CAMERA_ERROR_NONE;
1137 camera_cli_s *pc = (camera_cli_s *)camera;
1138 muse_camera_api_e api = MUSE_CAMERA_API_SET_PREVIEW_RESOLUTION;
1140 if (pc->cb_info == NULL) {
1141 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1142 return CAMERA_ERROR_INVALID_PARAMETER;
1144 sock_fd = pc->cb_info->fd;
1146 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1147 muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret, INT, width, INT, height);
1148 LOGD("ret : 0x%x", ret);
1153 int camera_set_capture_resolution(camera_h camera, int width, int height)
1155 if (camera == NULL) {
1156 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1157 return CAMERA_ERROR_INVALID_PARAMETER;
1160 int ret = CAMERA_ERROR_NONE;
1162 camera_cli_s *pc = (camera_cli_s *)camera;
1163 muse_camera_api_e api = MUSE_CAMERA_API_SET_CAPTURE_RESOLUTION;
1165 if (pc->cb_info == NULL) {
1166 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1167 return CAMERA_ERROR_INVALID_PARAMETER;
1169 sock_fd = pc->cb_info->fd;
1171 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1172 muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret, INT, width, INT, height);
1173 LOGD("ret : 0x%x", ret);
1177 int camera_set_capture_format(camera_h camera, camera_pixel_format_e format)
1179 if (camera == NULL) {
1180 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1181 return CAMERA_ERROR_INVALID_PARAMETER;
1184 int ret = CAMERA_ERROR_NONE;
1185 int set_format = (int)format;
1187 camera_cli_s *pc = (camera_cli_s *)camera;
1188 muse_camera_api_e api = MUSE_CAMERA_API_SET_CAPTURE_FORMAT;
1190 if (pc->cb_info == NULL) {
1191 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1192 return CAMERA_ERROR_INVALID_PARAMETER;
1194 sock_fd = pc->cb_info->fd;
1196 LOGD("Enter, remote_handle : %x, capture_format: %d", pc->remote_handle, set_format);
1197 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_format);
1198 LOGD("ret : 0x%x", ret);
1202 int camera_set_preview_format(camera_h camera, camera_pixel_format_e format)
1204 if (camera == NULL) {
1205 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1206 return CAMERA_ERROR_INVALID_PARAMETER;
1209 int ret = CAMERA_ERROR_NONE;
1210 int set_format = (int)format;
1212 camera_cli_s *pc = (camera_cli_s *)camera;
1213 muse_camera_api_e api = MUSE_CAMERA_API_SET_PREVIEW_FORMAT;
1215 if (pc->cb_info == NULL) {
1216 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1217 return CAMERA_ERROR_INVALID_PARAMETER;
1219 sock_fd = pc->cb_info->fd;
1221 LOGD("Enter, remote_handle : %x, capture_format: %d", pc->remote_handle, set_format);
1222 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_format);
1223 LOGD("ret : 0x%x", ret);
1227 int camera_get_preview_resolution(camera_h camera, int *width, int *height)
1229 if (camera == NULL || width == NULL || height == NULL) {
1230 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1231 return CAMERA_ERROR_INVALID_PARAMETER;
1235 int ret = CAMERA_ERROR_NONE;
1237 camera_cli_s *pc = (camera_cli_s *)camera;
1238 muse_camera_api_e api = MUSE_CAMERA_API_GET_PREVIEW_RESOLUTION;
1240 if (pc->cb_info == NULL) {
1241 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1242 return CAMERA_ERROR_INVALID_PARAMETER;
1244 sock_fd = pc->cb_info->fd;
1248 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1249 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1251 if (ret == CAMERA_ERROR_NONE) {
1252 muse_camera_msg_get(get_width, pc->cb_info->recvMsg);
1253 muse_camera_msg_get(get_height, pc->cb_info->recvMsg);
1255 *height = get_height;
1257 LOGD("ret : 0x%x", ret);
1261 int camera_set_display_rotation(camera_h camera, camera_rotation_e rotation)
1263 if( camera == NULL){
1264 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1265 return CAMERA_ERROR_INVALID_PARAMETER;
1268 int ret = CAMERA_ERROR_NONE;
1269 camera_cli_s *pc = (camera_cli_s *)camera;
1270 muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY_ROTATION;
1272 if (pc->cb_info == NULL) {
1273 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1274 return CAMERA_ERROR_INVALID_PARAMETER;
1276 sock_fd = pc->cb_info->fd;
1277 int set_rotation = (int)rotation;
1279 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1280 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_rotation);
1281 LOGD("ret : 0x%x", ret);
1285 int camera_get_display_rotation(camera_h camera, camera_rotation_e *rotation)
1287 if( camera == NULL || rotation == NULL ){
1288 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1289 return CAMERA_ERROR_INVALID_PARAMETER;
1292 int ret = CAMERA_ERROR_NONE;
1294 camera_cli_s *pc = (camera_cli_s *)camera;
1295 muse_camera_api_e api = MUSE_CAMERA_API_GET_DISPLAY_ROTATION;
1297 if (pc->cb_info == NULL) {
1298 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1299 return CAMERA_ERROR_INVALID_PARAMETER;
1301 sock_fd = pc->cb_info->fd;
1304 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1305 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1307 if (ret == CAMERA_ERROR_NONE) {
1308 muse_camera_msg_get(get_rotation, pc->cb_info->recvMsg);
1309 *rotation = (camera_rotation_e)get_rotation;
1311 LOGD("ret : 0x%x", ret);
1315 int camera_set_display_flip(camera_h camera, camera_flip_e flip)
1317 if( camera == NULL){
1318 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1319 return CAMERA_ERROR_INVALID_PARAMETER;
1322 int ret = CAMERA_ERROR_NONE;
1324 camera_cli_s *pc = (camera_cli_s *)camera;
1325 muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY_FLIP;
1327 if (pc->cb_info == NULL) {
1328 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1329 return CAMERA_ERROR_INVALID_PARAMETER;
1331 sock_fd = pc->cb_info->fd;
1332 int set_flip = (int)flip;
1334 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1335 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_flip);
1336 LOGD("ret : 0x%x", ret);
1340 int camera_get_display_flip(camera_h camera, camera_flip_e *flip)
1342 if( camera == NULL || flip == NULL ){
1343 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1344 return CAMERA_ERROR_INVALID_PARAMETER;
1347 int ret = CAMERA_ERROR_NONE;
1349 camera_cli_s *pc = (camera_cli_s *)camera;
1350 muse_camera_api_e api = MUSE_CAMERA_API_GET_DISPLAY_FLIP;
1352 if (pc->cb_info == NULL) {
1353 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1354 return CAMERA_ERROR_INVALID_PARAMETER;
1356 sock_fd = pc->cb_info->fd;
1359 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1360 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1362 if (ret == CAMERA_ERROR_NONE) {
1363 muse_camera_msg_get(get_flip, pc->cb_info->recvMsg);
1364 *flip = (camera_flip_e)get_flip;
1366 LOGD("ret : 0x%x", ret);
1370 int camera_set_display_visible(camera_h camera, bool visible)
1372 if( camera == NULL){
1373 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1374 return CAMERA_ERROR_INVALID_PARAMETER;
1377 int ret = CAMERA_ERROR_NONE;
1379 camera_cli_s *pc = (camera_cli_s *)camera;
1380 muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY_VISIBLE;
1381 int set_visible = (int)visible;
1383 if (pc->cb_info == NULL) {
1384 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1385 return CAMERA_ERROR_INVALID_PARAMETER;
1387 sock_fd = pc->cb_info->fd;
1389 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1390 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_visible);
1391 LOGD("ret : 0x%x", ret);
1395 int camera_is_display_visible(camera_h camera, bool* visible)
1397 if( camera == NULL || visible == NULL){
1398 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1399 return CAMERA_ERROR_INVALID_PARAMETER;
1402 int ret = CAMERA_ERROR_NONE;
1404 camera_cli_s *pc = (camera_cli_s *)camera;
1405 muse_camera_api_e api = MUSE_CAMERA_API_IS_DISPLAY_VISIBLE;
1407 if (pc->cb_info == NULL) {
1408 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1409 return CAMERA_ERROR_INVALID_PARAMETER;
1411 sock_fd = pc->cb_info->fd;
1414 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1415 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1417 if (ret == CAMERA_ERROR_NONE) {
1418 muse_camera_msg_get(get_visible, pc->cb_info->recvMsg);
1419 *visible = (bool)get_visible;
1421 LOGD("ret : 0x%x", ret);
1425 int camera_set_display_mode(camera_h camera, camera_display_mode_e mode)
1427 if (camera == NULL) {
1428 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1429 return CAMERA_ERROR_INVALID_PARAMETER;
1432 int ret = CAMERA_ERROR_NONE;
1433 int set_mode = (int)mode;
1435 camera_cli_s *pc = (camera_cli_s *)camera;
1436 muse_camera_api_e api = MUSE_CAMERA_API_SET_DISPLAY_MODE;
1438 if (pc->cb_info == NULL) {
1439 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1440 return CAMERA_ERROR_INVALID_PARAMETER;
1442 sock_fd = pc->cb_info->fd;
1444 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1445 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
1446 LOGD("ret : 0x%x", ret);
1450 int camera_get_display_mode(camera_h camera, camera_display_mode_e* mode)
1452 if( camera == NULL || mode == NULL){
1453 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1454 return CAMERA_ERROR_INVALID_PARAMETER;
1457 int ret = CAMERA_ERROR_NONE;
1459 camera_cli_s *pc = (camera_cli_s *)camera;
1460 muse_camera_api_e api = MUSE_CAMERA_API_GET_DISPLAY_MODE;
1462 if (pc->cb_info == NULL) {
1463 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1464 return CAMERA_ERROR_INVALID_PARAMETER;
1466 sock_fd = pc->cb_info->fd;
1469 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1470 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1472 if (ret == CAMERA_ERROR_NONE) {
1473 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
1474 *mode = (camera_display_mode_e)get_mode;
1476 LOGD("ret : 0x%x", ret);
1480 int camera_get_capture_resolution(camera_h camera, int *width, int *height)
1482 if( camera == NULL || width== NULL || height == NULL){
1483 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1484 return CAMERA_ERROR_INVALID_PARAMETER;
1486 int ret = CAMERA_ERROR_NONE;
1488 camera_cli_s *pc = (camera_cli_s *)camera;
1489 muse_camera_api_e api = MUSE_CAMERA_API_GET_CAPTURE_RESOLUTION;
1491 if (pc->cb_info == NULL) {
1492 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1493 return CAMERA_ERROR_INVALID_PARAMETER;
1495 sock_fd = pc->cb_info->fd;
1499 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1500 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1502 if (ret == CAMERA_ERROR_NONE) {
1503 muse_camera_msg_get(get_width, pc->cb_info->recvMsg);
1504 muse_camera_msg_get(get_height, pc->cb_info->recvMsg);
1506 *height = get_height;
1508 LOGD("ret : 0x%x", ret);
1512 int camera_get_capture_format(camera_h camera, camera_pixel_format_e *format)
1514 if( camera == NULL || format == NULL){
1515 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1516 return CAMERA_ERROR_INVALID_PARAMETER;
1518 int ret = CAMERA_ERROR_NONE;
1520 camera_cli_s *pc = (camera_cli_s *)camera;
1521 muse_camera_api_e api = MUSE_CAMERA_API_GET_CAPTURE_FORMAT;
1524 if (pc->cb_info == NULL) {
1525 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1526 return CAMERA_ERROR_INVALID_PARAMETER;
1528 sock_fd = pc->cb_info->fd;
1530 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1531 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1533 if (ret == CAMERA_ERROR_NONE) {
1534 muse_camera_msg_get(get_format, pc->cb_info->recvMsg);
1535 *format = (camera_pixel_format_e)get_format;
1537 LOGD("ret : 0x%x", ret);
1541 int camera_get_preview_format(camera_h camera, camera_pixel_format_e *format)
1543 if( camera == NULL || format == NULL){
1544 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1545 return CAMERA_ERROR_INVALID_PARAMETER;
1548 int ret = CAMERA_ERROR_NONE;
1550 camera_cli_s *pc = (camera_cli_s *)camera;
1551 muse_camera_api_e api = MUSE_CAMERA_API_GET_PREVIEW_FORMAT;
1554 if (pc->cb_info == NULL) {
1555 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1556 return CAMERA_ERROR_INVALID_PARAMETER;
1558 sock_fd = pc->cb_info->fd;
1560 LOGD("Enter, remote_handle : %x", pc->remote_handle);
1561 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1563 if (ret == CAMERA_ERROR_NONE) {
1564 muse_camera_msg_get(get_format, pc->cb_info->recvMsg);
1565 *format = (camera_pixel_format_e)get_format;
1567 LOGD("ret : 0x%x", ret);
1571 int camera_set_preview_cb(camera_h camera, camera_preview_cb callback, void* user_data)
1573 if (camera == NULL || callback == NULL) {
1574 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1575 return CAMERA_ERROR_INVALID_PARAMETER;
1577 int ret = CAMERA_ERROR_NONE;
1579 camera_cli_s *pc = (camera_cli_s *)camera;
1581 if (pc->cb_info == NULL) {
1582 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1583 return CAMERA_ERROR_INVALID_PARAMETER;
1585 sock_fd = pc->cb_info->fd;
1586 muse_camera_api_e api = MUSE_CAMERA_API_SET_PREVIEW_CB;
1588 LOGD("Enter, handle :%x", pc->remote_handle);
1590 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_PREVIEW] = callback;
1591 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_PREVIEW] = user_data;
1593 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1594 LOGD("ret : 0x%x", ret);
1598 int camera_unset_preview_cb(camera_h camera)
1600 if (camera == NULL) {
1601 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1602 return CAMERA_ERROR_INVALID_PARAMETER;
1605 int ret = CAMERA_ERROR_NONE;
1607 camera_cli_s *pc = (camera_cli_s *)camera;
1608 muse_camera_api_e api = MUSE_CAMERA_API_UNSET_PREVIEW_CB;
1610 LOGD("Enter, handle :%x", pc->remote_handle);
1613 if (pc->cb_info == NULL) {
1614 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1615 return CAMERA_ERROR_INVALID_PARAMETER;
1617 sock_fd = pc->cb_info->fd;
1618 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_PREVIEW] = (void *)NULL;
1619 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_PREVIEW] = (void *)NULL;
1621 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1622 LOGD("ret : 0x%x", ret);
1626 int camera_set_media_packet_preview_cb(camera_h camera, camera_media_packet_preview_cb callback, void* user_data)
1628 if (camera == NULL) {
1629 LOGE("INVALID_PARAMETER(0x%08x) - handle", CAMERA_ERROR_INVALID_PARAMETER);
1630 return CAMERA_ERROR_INVALID_PARAMETER;
1633 if (callback == NULL) {
1634 LOGE("INVALID_PARAMETER(0x%08x) - callback", CAMERA_ERROR_INVALID_PARAMETER);
1635 return CAMERA_ERROR_NOT_SUPPORTED;
1638 int ret = CAMERA_ERROR_NONE;
1640 camera_cli_s *pc = (camera_cli_s *)camera;
1641 muse_camera_api_e api = MUSE_CAMERA_API_SET_MEDIA_PACKET_PREVIEW_CB;
1643 LOGD("Enter, handle :%x", pc->remote_handle);
1646 if (pc->cb_info == NULL) {
1647 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1648 return CAMERA_ERROR_INVALID_PARAMETER;
1650 sock_fd = pc->cb_info->fd;
1651 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW] = callback;
1652 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW] = user_data;
1654 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1655 LOGD("ret : 0x%x", ret);
1659 int camera_unset_media_packet_preview_cb(camera_h camera)
1661 if (camera == NULL) {
1662 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
1663 return CAMERA_ERROR_INVALID_PARAMETER;
1666 int ret = CAMERA_ERROR_NONE;
1668 camera_cli_s *pc = (camera_cli_s *)camera;
1669 muse_camera_api_e api = MUSE_CAMERA_API_UNSET_MEDIA_PACKET_PREVIEW_CB;
1671 LOGD("Enter, handle :%x", pc->remote_handle);
1674 if (pc->cb_info == NULL) {
1675 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1676 return CAMERA_ERROR_INVALID_PARAMETER;
1678 sock_fd = pc->cb_info->fd;
1679 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW] = (void *)NULL;
1680 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW] = (void *)NULL;
1682 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1683 LOGD("ret : 0x%x", ret);
1687 int camera_set_state_changed_cb(camera_h camera, camera_state_changed_cb callback, void* user_data)
1689 if( camera == NULL || callback == NULL){
1690 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1691 return CAMERA_ERROR_INVALID_PARAMETER;
1693 int ret = CAMERA_ERROR_NONE;
1695 camera_cli_s *pc = (camera_cli_s *)camera;
1696 muse_camera_api_e api = MUSE_CAMERA_API_SET_STATE_CHANGED_CB;
1698 LOGD("Enter, handle :%x", pc->remote_handle);
1701 if (pc->cb_info == NULL) {
1702 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1703 return CAMERA_ERROR_INVALID_PARAMETER;
1705 sock_fd = pc->cb_info->fd;
1706 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_STATE_CHANGE] = callback;
1707 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_STATE_CHANGE] = user_data;
1709 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1710 LOGD("ret : 0x%x", ret);
1713 int camera_unset_state_changed_cb(camera_h camera)
1715 if( camera == NULL){
1716 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1717 return CAMERA_ERROR_INVALID_PARAMETER;
1719 int ret = CAMERA_ERROR_NONE;
1721 camera_cli_s *pc = (camera_cli_s *)camera;
1722 muse_camera_api_e api = MUSE_CAMERA_API_UNSET_STATE_CHANGED_CB;
1724 LOGD("Enter, handle :%x", pc->remote_handle);
1727 if (pc->cb_info == NULL) {
1728 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1729 return CAMERA_ERROR_INVALID_PARAMETER;
1731 sock_fd = pc->cb_info->fd;
1732 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_STATE_CHANGE] = (void *)NULL;
1733 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_STATE_CHANGE] = (void *)NULL;
1735 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1736 LOGD("ret : 0x%x", ret);
1740 int camera_set_interrupted_cb(camera_h camera, camera_interrupted_cb callback, void *user_data)
1742 if( camera == NULL || callback == NULL){
1743 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1744 return CAMERA_ERROR_INVALID_PARAMETER;
1746 int ret = CAMERA_ERROR_NONE;
1748 camera_cli_s *pc = (camera_cli_s *)camera;
1749 muse_camera_api_e api = MUSE_CAMERA_API_SET_INTERRUPTED_CB;
1751 LOGD("Enter, handle :%x", pc->remote_handle);
1754 if (pc->cb_info == NULL) {
1755 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1756 return CAMERA_ERROR_INVALID_PARAMETER;
1758 sock_fd = pc->cb_info->fd;
1759 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_INTERRUPTED] = callback;
1760 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_INTERRUPTED] = user_data;
1762 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1763 LOGD("ret : 0x%x", ret);
1767 int camera_unset_interrupted_cb(camera_h camera)
1769 if( camera == NULL){
1770 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1771 return CAMERA_ERROR_INVALID_PARAMETER;
1773 int ret = CAMERA_ERROR_NONE;
1775 camera_cli_s *pc = (camera_cli_s *)camera;
1776 muse_camera_api_e api = MUSE_CAMERA_API_UNSET_INTERRUPTED_CB;
1778 LOGD("Enter, handle :%x", pc->remote_handle);
1781 if (pc->cb_info == NULL) {
1782 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1783 return CAMERA_ERROR_INVALID_PARAMETER;
1785 sock_fd = pc->cb_info->fd;
1786 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_INTERRUPTED] = (void *)NULL;
1787 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_INTERRUPTED] = (void *)NULL;
1789 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1790 LOGD("ret : 0x%x", ret);
1794 int camera_set_focus_changed_cb(camera_h camera, camera_focus_changed_cb callback, void* user_data)
1796 if( camera == NULL || callback == NULL){
1797 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1798 return CAMERA_ERROR_INVALID_PARAMETER;
1800 int ret = CAMERA_ERROR_NONE;
1802 camera_cli_s *pc = (camera_cli_s *)camera;
1803 muse_camera_api_e api = MUSE_CAMERA_API_SET_FOCUS_CHANGED_CB;
1805 LOGD("Enter, handle :%x", pc->remote_handle);
1808 if (pc->cb_info == NULL) {
1809 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1810 return CAMERA_ERROR_INVALID_PARAMETER;
1812 sock_fd = pc->cb_info->fd;
1813 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOCUS_CHANGE] = callback;
1814 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOCUS_CHANGE] = user_data;
1816 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1817 LOGD("ret : 0x%x", ret);
1821 int camera_unset_focus_changed_cb(camera_h camera)
1823 if( camera == NULL){
1824 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1825 return CAMERA_ERROR_INVALID_PARAMETER;
1827 int ret = CAMERA_ERROR_NONE;
1829 camera_cli_s *pc = (camera_cli_s *)camera;
1830 muse_camera_api_e api = MUSE_CAMERA_API_UNSET_FOCUS_CHANGED_CB;
1832 LOGD("Enter, handle :%x", pc->remote_handle);
1835 if (pc->cb_info == NULL) {
1836 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1837 return CAMERA_ERROR_INVALID_PARAMETER;
1839 sock_fd = pc->cb_info->fd;
1840 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOCUS_CHANGE] = (void *)NULL;
1841 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOCUS_CHANGE] = (void *)NULL;
1843 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1844 LOGD("ret : 0x%x", ret);
1848 int camera_set_error_cb(camera_h camera, camera_error_cb callback, void *user_data)
1850 if( camera == NULL || callback == 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_ERROR_CB;
1859 LOGD("Enter, handle :%x", pc->remote_handle);
1862 if (pc->cb_info == NULL) {
1863 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1864 return CAMERA_ERROR_INVALID_PARAMETER;
1866 sock_fd = pc->cb_info->fd;
1867 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_ERROR] = callback;
1868 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_ERROR] = user_data;
1870 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1871 LOGD("ret : 0x%x", ret);
1875 int camera_unset_error_cb(camera_h camera)
1877 if( camera == NULL){
1878 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1879 return CAMERA_ERROR_INVALID_PARAMETER;
1881 int ret = CAMERA_ERROR_NONE;
1883 camera_cli_s *pc = (camera_cli_s *)camera;
1884 muse_camera_api_e api = MUSE_CAMERA_API_UNSET_ERROR_CB;
1886 LOGD("Enter, handle :%x", pc->remote_handle);
1889 if (pc->cb_info == NULL) {
1890 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1891 return CAMERA_ERROR_INVALID_PARAMETER;
1893 sock_fd = pc->cb_info->fd;
1894 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_ERROR] = (void *)NULL;
1895 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_ERROR] = (void *)NULL;
1897 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1898 LOGD("ret : 0x%x", ret);
1902 int camera_foreach_supported_preview_resolution(camera_h camera, camera_supported_preview_resolution_cb foreach_cb , void *user_data)
1904 if( camera == NULL || foreach_cb == NULL){
1905 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1906 return CAMERA_ERROR_INVALID_PARAMETER;
1908 int ret = CAMERA_ERROR_NONE;
1910 camera_cli_s *pc = (camera_cli_s *)camera;
1911 muse_camera_api_e api = MUSE_CAMERA_API_SET_FOREACH_SUPPORTED_PREVIEW_RESOLUTION;
1913 LOGD("Enter, handle :%x", pc->remote_handle);
1916 if (pc->cb_info == NULL) {
1917 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1918 return CAMERA_ERROR_INVALID_PARAMETER;
1920 sock_fd = pc->cb_info->fd;
1921 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_RESOLUTION] = foreach_cb;
1922 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_RESOLUTION] = user_data;
1924 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1925 LOGD("ret : 0x%x", ret);
1929 int camera_foreach_supported_capture_resolution(camera_h camera, camera_supported_capture_resolution_cb foreach_cb , void *user_data)
1931 if( camera == NULL || foreach_cb == NULL){
1932 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1933 return CAMERA_ERROR_INVALID_PARAMETER;
1935 int ret = CAMERA_ERROR_NONE;
1937 camera_cli_s *pc = (camera_cli_s *)camera;
1938 muse_camera_api_e api = MUSE_CAMERA_API_SET_FOREACH_SUPPORTED_CAPTURE_RESOLUTION;
1940 LOGD("Enter, handle :%x", pc->remote_handle);
1943 if (pc->cb_info == NULL) {
1944 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1945 return CAMERA_ERROR_INVALID_PARAMETER;
1947 sock_fd = pc->cb_info->fd;
1948 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_RESOLUTION] = foreach_cb;
1949 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_RESOLUTION] = user_data;
1951 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1952 LOGD("ret : 0x%x", ret);
1956 int camera_foreach_supported_capture_format(camera_h camera, camera_supported_capture_format_cb foreach_cb , void *user_data)
1958 if( camera == NULL || foreach_cb == NULL){
1959 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1960 return CAMERA_ERROR_INVALID_PARAMETER;
1962 int ret = CAMERA_ERROR_NONE;
1964 camera_cli_s *pc = (camera_cli_s *)camera;
1965 muse_camera_api_e api = MUSE_CAMERA_API_SET_FOREACH_SUPPORTED_CAPTURE_FORMAT;
1967 LOGD("Enter, handle :%x", pc->remote_handle);
1970 if (pc->cb_info == NULL) {
1971 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1972 return CAMERA_ERROR_INVALID_PARAMETER;
1974 sock_fd = pc->cb_info->fd;
1975 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_FORMAT] = foreach_cb;
1976 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_FORMAT] = user_data;
1978 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
1979 LOGD("ret : 0x%x", ret);
1984 int camera_foreach_supported_preview_format(camera_h camera, camera_supported_preview_format_cb foreach_cb , void *user_data)
1986 if( camera == NULL || foreach_cb == NULL){
1987 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
1988 return CAMERA_ERROR_INVALID_PARAMETER;
1990 int ret = CAMERA_ERROR_NONE;
1992 camera_cli_s *pc = (camera_cli_s *)camera;
1993 muse_camera_api_e api = MUSE_CAMERA_API_SET_FOREACH_SUPPORTED_PREVIEW_FORMAT;
1995 LOGD("Enter, handle :%x", pc->remote_handle);
1998 if (pc->cb_info == NULL) {
1999 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2000 return CAMERA_ERROR_INVALID_PARAMETER;
2002 sock_fd = pc->cb_info->fd;
2003 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_FORMAT] = foreach_cb;
2004 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_FORMAT] = user_data;
2006 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2007 LOGD("ret : 0x%x", ret);
2012 int camera_get_recommended_preview_resolution(camera_h camera, int *width, int *height)
2014 if (camera == NULL || width == NULL || height == NULL) {
2015 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2016 return CAMERA_ERROR_INVALID_PARAMETER;
2018 int ret = CAMERA_ERROR_NONE;
2020 camera_cli_s *pc = (camera_cli_s *)camera;
2021 muse_camera_api_e api = MUSE_CAMERA_API_GET_RECOMMENDED_PREVIEW_RESOLUTION;
2023 if (pc->cb_info == NULL) {
2024 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2025 return CAMERA_ERROR_INVALID_PARAMETER;
2027 sock_fd = pc->cb_info->fd;
2031 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2032 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2034 if (ret == CAMERA_ERROR_NONE) {
2035 muse_camera_msg_get(get_width, pc->cb_info->recvMsg);
2036 muse_camera_msg_get(get_height, pc->cb_info->recvMsg);
2038 *height = get_height;
2040 LOGD("ret : 0x%x", ret);
2045 int camera_attr_get_lens_orientation(camera_h camera, int *angle)
2047 if( camera == NULL || angle == NULL){
2048 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2049 return CAMERA_ERROR_INVALID_PARAMETER;
2051 int ret = CAMERA_ERROR_NONE;
2053 camera_cli_s *pc = (camera_cli_s *)camera;
2054 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_LENS_ORIENTATION;
2056 if (pc->cb_info == NULL) {
2057 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2058 return CAMERA_ERROR_INVALID_PARAMETER;
2060 sock_fd = pc->cb_info->fd;
2063 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2064 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2066 if (ret == CAMERA_ERROR_NONE) {
2067 muse_camera_msg_get(get_angle, pc->cb_info->recvMsg);
2070 LOGD("ret : 0x%x", ret);
2074 int camera_attr_set_theater_mode(camera_h camera, camera_attr_theater_mode_e mode)
2076 if (camera == NULL) {
2077 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
2078 return CAMERA_ERROR_INVALID_PARAMETER;
2080 int ret = CAMERA_ERROR_NONE;
2081 camera_cli_s *pc = (camera_cli_s *)camera;
2082 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_THEATER_MODE;
2084 if (pc->cb_info == NULL) {
2085 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2086 return CAMERA_ERROR_INVALID_PARAMETER;
2088 sock_fd = pc->cb_info->fd;
2089 int set_mode = (int)mode;
2090 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2091 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
2092 LOGD("ret : 0x%x", ret);
2096 int camera_attr_get_theater_mode(camera_h camera, camera_attr_theater_mode_e *mode)
2098 if (camera == NULL || mode == NULL) {
2099 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
2100 return CAMERA_ERROR_INVALID_PARAMETER;
2103 int ret = CAMERA_ERROR_NONE;
2104 camera_cli_s *pc = (camera_cli_s *)camera;
2105 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_THEATER_MODE;
2107 if (pc->cb_info == NULL) {
2108 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2109 return CAMERA_ERROR_INVALID_PARAMETER;
2111 sock_fd = pc->cb_info->fd;
2113 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2114 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2116 if (ret == CAMERA_ERROR_NONE) {
2117 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
2118 *mode = (camera_attr_theater_mode_e)get_mode;
2120 LOGD("ret : 0x%x", ret);
2124 int camera_attr_foreach_supported_theater_mode(camera_h camera, camera_attr_supported_theater_mode_cb foreach_cb, void *user_data)
2126 if (camera == NULL || foreach_cb == NULL) {
2127 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
2128 return CAMERA_ERROR_INVALID_PARAMETER;
2130 int ret = CAMERA_ERROR_NONE;
2132 camera_cli_s *pc = (camera_cli_s *)camera;
2133 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_THEATER_MODE;
2135 LOGD("Enter, handle :%x", pc->remote_handle);
2138 if (pc->cb_info == NULL) {
2139 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2140 return CAMERA_ERROR_INVALID_PARAMETER;
2142 sock_fd = pc->cb_info->fd;
2143 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_THEATER_MODE] = foreach_cb;
2144 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_THEATER_MODE] = user_data;
2146 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2148 LOGD("Finish, return :%x", ret);
2153 int camera_attr_set_preview_fps(camera_h camera, camera_attr_fps_e fps)
2155 if( camera == NULL){
2156 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2157 return CAMERA_ERROR_INVALID_PARAMETER;
2159 int ret = CAMERA_ERROR_NONE;
2160 camera_cli_s *pc = (camera_cli_s *)camera;
2161 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_PREVIEW_FPS;
2163 if (pc->cb_info == NULL) {
2164 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2165 return CAMERA_ERROR_INVALID_PARAMETER;
2167 sock_fd = pc->cb_info->fd;
2168 int set_fps = (int)fps;
2169 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2170 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_fps);
2171 LOGD("ret : 0x%x", ret);
2176 int camera_attr_set_image_quality(camera_h camera, int quality)
2178 if( camera == NULL){
2179 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2180 return CAMERA_ERROR_INVALID_PARAMETER;
2182 int ret = CAMERA_ERROR_NONE;
2184 camera_cli_s *pc = (camera_cli_s *)camera;
2185 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_IMAGE_QUALITY;
2187 if (pc->cb_info == NULL) {
2188 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2189 return CAMERA_ERROR_INVALID_PARAMETER;
2191 sock_fd = pc->cb_info->fd;
2192 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2193 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, quality);
2194 LOGD("ret : 0x%x", ret);
2198 int camera_attr_get_preview_fps(camera_h camera, camera_attr_fps_e *fps)
2200 if( camera == NULL || fps == NULL){
2201 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2202 return CAMERA_ERROR_INVALID_PARAMETER;
2204 int ret = CAMERA_ERROR_NONE;
2206 camera_cli_s *pc = (camera_cli_s *)camera;
2207 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_PREVIEW_FPS;
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;
2216 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2217 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2219 if (ret == CAMERA_ERROR_NONE) {
2220 muse_camera_msg_get(get_fps, pc->cb_info->recvMsg);
2221 *fps = (camera_attr_fps_e)get_fps;
2223 LOGD("ret : 0x%x", ret);
2228 int camera_attr_get_image_quality(camera_h camera, int *quality)
2230 if( camera == NULL || quality == NULL){
2231 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2232 return CAMERA_ERROR_INVALID_PARAMETER;
2234 int ret = CAMERA_ERROR_NONE;
2236 camera_cli_s *pc = (camera_cli_s *)camera;
2237 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_IMAGE_QUALITY;
2239 if (pc->cb_info == NULL) {
2240 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2241 return CAMERA_ERROR_INVALID_PARAMETER;
2243 sock_fd = pc->cb_info->fd;
2245 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2246 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2248 if (ret == CAMERA_ERROR_NONE) {
2249 muse_camera_msg_get(get_quality, pc->cb_info->recvMsg);
2250 *quality = get_quality;
2252 LOGD("ret : 0x%x", ret);
2257 int camera_attr_set_zoom(camera_h camera, int zoom)
2259 if( camera == NULL){
2260 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2261 return CAMERA_ERROR_INVALID_PARAMETER;
2263 int ret = CAMERA_ERROR_NONE;
2265 camera_cli_s *pc = (camera_cli_s *)camera;
2266 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_ZOOM;
2268 if (pc->cb_info == NULL) {
2269 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2270 return CAMERA_ERROR_INVALID_PARAMETER;
2272 sock_fd = pc->cb_info->fd;
2274 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2275 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, zoom);
2276 LOGD("ret : 0x%x", ret);
2280 int camera_attr_set_af_mode(camera_h camera, camera_attr_af_mode_e mode)
2282 if( camera == NULL){
2283 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2284 return CAMERA_ERROR_INVALID_PARAMETER;
2286 int ret = CAMERA_ERROR_NONE;
2288 camera_cli_s *pc = (camera_cli_s *)camera;
2289 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_AF_MODE;
2291 if (pc->cb_info == NULL) {
2292 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2293 return CAMERA_ERROR_INVALID_PARAMETER;
2295 sock_fd = pc->cb_info->fd;
2296 int set_mode = (int)mode;
2297 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2298 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
2299 LOGD("ret : 0x%x", ret);
2303 int camera_attr_set_af_area(camera_h camera, int x, int y)
2305 if( camera == NULL){
2306 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2307 return CAMERA_ERROR_INVALID_PARAMETER;
2309 int ret = CAMERA_ERROR_NONE;
2310 camera_cli_s *pc = (camera_cli_s *)camera;
2311 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_AF_AREA;
2312 int sock_fd = pc->cb_info->fd;
2313 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2314 muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret, INT, x, INT, y);
2315 LOGD("ret : 0x%x", ret);
2320 int camera_attr_clear_af_area(camera_h camera)
2322 if( camera == NULL){
2323 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
2324 return CAMERA_ERROR_INVALID_PARAMETER;
2326 int ret = CAMERA_ERROR_NONE;
2328 camera_cli_s *pc = (camera_cli_s *)camera;
2329 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_CLEAR_AF_AREA;
2331 if (pc->cb_info == NULL) {
2332 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2333 return CAMERA_ERROR_INVALID_PARAMETER;
2335 sock_fd = pc->cb_info->fd;
2336 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2337 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2338 LOGD("ret : 0x%x", ret);
2343 int camera_attr_set_exposure_mode(camera_h camera, camera_attr_exposure_mode_e mode)
2345 if( camera == NULL){
2346 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2347 return CAMERA_ERROR_INVALID_PARAMETER;
2350 if (mode < CAMERA_ATTR_EXPOSURE_MODE_OFF || mode > CAMERA_ATTR_EXPOSURE_MODE_CUSTOM) {
2351 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_NOT_SUPPORTED);
2352 return CAMERA_ERROR_NOT_SUPPORTED;
2355 int ret = CAMERA_ERROR_NONE;
2356 camera_cli_s *pc = (camera_cli_s *)camera;
2357 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_EXPOSURE_MODE;
2358 int set_mode = (int)mode;
2360 if (pc->cb_info == NULL) {
2361 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2362 return CAMERA_ERROR_INVALID_PARAMETER;
2364 sock_fd = pc->cb_info->fd;
2365 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2366 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
2367 LOGD("ret : 0x%x", ret);
2372 int camera_attr_set_exposure(camera_h camera, int value)
2374 if( camera == NULL){
2375 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2376 return CAMERA_ERROR_INVALID_PARAMETER;
2378 int ret = CAMERA_ERROR_NONE;
2380 camera_cli_s *pc = (camera_cli_s *)camera;
2381 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_EXPOSURE;
2383 if (pc->cb_info == NULL) {
2384 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2385 return CAMERA_ERROR_INVALID_PARAMETER;
2387 sock_fd = pc->cb_info->fd;
2389 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2390 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, value);
2391 LOGD("ret : 0x%x", ret);
2396 int camera_attr_set_iso(camera_h camera, camera_attr_iso_e iso)
2398 if( camera == NULL){
2399 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2400 return CAMERA_ERROR_INVALID_PARAMETER;
2402 int ret = CAMERA_ERROR_NONE;
2404 camera_cli_s *pc = (camera_cli_s *)camera;
2405 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_ISO;
2407 if (pc->cb_info == NULL) {
2408 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2409 return CAMERA_ERROR_INVALID_PARAMETER;
2411 sock_fd = pc->cb_info->fd;
2412 int set_iso = (int)iso;
2413 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2414 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_iso);
2415 LOGD("ret : 0x%x", ret);
2420 int camera_attr_set_brightness(camera_h camera, int level)
2422 if( camera == NULL){
2423 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2424 return CAMERA_ERROR_INVALID_PARAMETER;
2426 int ret = CAMERA_ERROR_NONE;
2428 camera_cli_s *pc = (camera_cli_s *)camera;
2429 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_BRIGHTNESS;
2431 if (pc->cb_info == NULL) {
2432 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2433 return CAMERA_ERROR_INVALID_PARAMETER;
2435 sock_fd = pc->cb_info->fd;
2437 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2438 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, level);
2439 LOGD("ret : 0x%x", ret);
2444 int camera_attr_set_contrast(camera_h camera, int level)
2446 if( camera == NULL){
2447 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2448 return CAMERA_ERROR_INVALID_PARAMETER;
2450 int ret = CAMERA_ERROR_NONE;
2452 camera_cli_s *pc = (camera_cli_s *)camera;
2453 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_CONTRAST;
2455 if (pc->cb_info == NULL) {
2456 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2457 return CAMERA_ERROR_INVALID_PARAMETER;
2459 sock_fd = pc->cb_info->fd;
2461 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2462 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, level);
2463 LOGD("ret : 0x%x", ret);
2468 int camera_attr_set_whitebalance(camera_h camera, camera_attr_whitebalance_e wb)
2470 if (camera == NULL) {
2471 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2472 return CAMERA_ERROR_INVALID_PARAMETER;
2475 if (wb < CAMERA_ATTR_WHITE_BALANCE_NONE || wb > CAMERA_ATTR_WHITE_BALANCE_CUSTOM) {
2476 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_NOT_SUPPORTED);
2477 return CAMERA_ERROR_NOT_SUPPORTED;
2480 int ret = CAMERA_ERROR_NONE;
2482 camera_cli_s *pc = (camera_cli_s *)camera;
2483 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_WHITEBALANCE;
2485 if (pc->cb_info == NULL) {
2486 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2487 return CAMERA_ERROR_INVALID_PARAMETER;
2489 sock_fd = pc->cb_info->fd;
2490 int set_whitebalance = (int)wb;
2491 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2492 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_whitebalance);
2493 LOGD("ret : 0x%x", ret);
2498 int camera_attr_set_effect(camera_h camera, camera_attr_effect_mode_e effect)
2500 if( camera == NULL){
2501 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2502 return CAMERA_ERROR_INVALID_PARAMETER;
2504 int ret = CAMERA_ERROR_NONE;
2506 camera_cli_s *pc = (camera_cli_s *)camera;
2507 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_EFFECT;
2509 if (pc->cb_info == NULL) {
2510 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2511 return CAMERA_ERROR_INVALID_PARAMETER;
2513 sock_fd = pc->cb_info->fd;
2514 int set_effect = (int)effect;
2515 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2516 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_effect);
2517 LOGD("ret : 0x%x", ret);
2522 int camera_attr_set_scene_mode(camera_h camera, camera_attr_scene_mode_e mode)
2524 if( camera == NULL){
2525 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2526 return CAMERA_ERROR_INVALID_PARAMETER;
2528 int ret = CAMERA_ERROR_NONE;
2530 camera_cli_s *pc = (camera_cli_s *)camera;
2531 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_SCENE_MODE;
2533 if (pc->cb_info == NULL) {
2534 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2535 return CAMERA_ERROR_INVALID_PARAMETER;
2537 sock_fd = pc->cb_info->fd;
2538 int set_mode = (int)mode;
2539 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2540 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
2541 LOGD("ret : 0x%x", ret);
2546 int camera_attr_enable_tag(camera_h camera, bool enable)
2548 if( camera == NULL){
2549 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2550 return CAMERA_ERROR_INVALID_PARAMETER;
2552 int ret = CAMERA_ERROR_NONE;
2553 camera_cli_s *pc = (camera_cli_s *)camera;
2554 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_ENABLE_TAG;
2556 if (pc->cb_info == NULL) {
2557 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2558 return CAMERA_ERROR_INVALID_PARAMETER;
2560 sock_fd = pc->cb_info->fd;
2561 int set_enable = (int)enable;
2563 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2564 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_enable);
2565 LOGD("ret : 0x%x", ret);
2570 int camera_attr_set_tag_image_description(camera_h camera, const char *description)
2572 if( camera == NULL){
2573 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2574 return CAMERA_ERROR_INVALID_PARAMETER;
2576 if( description == NULL){
2577 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2578 return CAMERA_ERROR_INVALID_PARAMETER;
2580 int ret = CAMERA_ERROR_NONE;
2581 camera_cli_s *pc = (camera_cli_s *)camera;
2582 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_TAG_IMAGE_DESCRIPTION;
2584 if (pc->cb_info == NULL) {
2585 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2586 return CAMERA_ERROR_INVALID_PARAMETER;
2588 sock_fd = pc->cb_info->fd;
2589 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2590 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, STRING, description);
2591 LOGD("ret : 0x%x", ret);
2596 int camera_attr_set_tag_orientation(camera_h camera, camera_attr_tag_orientation_e orientation)
2598 if( camera == NULL){
2599 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2600 return CAMERA_ERROR_INVALID_PARAMETER;
2602 int ret = CAMERA_ERROR_NONE;
2603 camera_cli_s *pc = (camera_cli_s *)camera;
2604 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_TAG_ORIENTATION;
2606 if (pc->cb_info == NULL) {
2607 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2608 return CAMERA_ERROR_INVALID_PARAMETER;
2610 sock_fd = pc->cb_info->fd;
2611 int set_orientation = (int)orientation;
2613 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2614 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_orientation);
2615 LOGD("ret : 0x%x", ret);
2620 int camera_attr_set_tag_software(camera_h camera, const char *software)
2622 if( camera == NULL){
2623 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2624 return CAMERA_ERROR_INVALID_PARAMETER;
2626 if( software == NULL){
2627 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2628 return CAMERA_ERROR_INVALID_PARAMETER;
2630 int ret = CAMERA_ERROR_NONE;
2631 camera_cli_s *pc = (camera_cli_s *)camera;
2632 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_TAG_SOFTWARE;
2634 if (pc->cb_info == NULL) {
2635 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2636 return CAMERA_ERROR_INVALID_PARAMETER;
2638 sock_fd = pc->cb_info->fd;
2639 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2640 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, STRING, software);
2641 LOGD("ret : 0x%x", ret);
2646 int camera_attr_set_geotag(camera_h camera, double latitude , double longitude, double altitude)
2648 if( camera == NULL){
2649 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2650 return CAMERA_ERROR_INVALID_PARAMETER;
2652 int ret = CAMERA_ERROR_NONE;
2653 camera_cli_s *pc = (camera_cli_s *)camera;
2654 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_GEOTAG;
2656 if (pc->cb_info == NULL) {
2657 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2658 return CAMERA_ERROR_INVALID_PARAMETER;
2660 sock_fd = pc->cb_info->fd;
2661 double set_geotag[3] = { latitude, longitude, altitude };
2663 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2664 muse_camera_msg_send_array(api, sock_fd, pc->cb_info, ret,
2665 set_geotag, sizeof(set_geotag), sizeof(double));
2666 LOGD("ret : 0x%x", ret);
2671 int camera_attr_remove_geotag(camera_h camera)
2673 if( camera == NULL){
2674 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2675 return CAMERA_ERROR_INVALID_PARAMETER;
2677 int ret = CAMERA_ERROR_NONE;
2678 camera_cli_s *pc = (camera_cli_s *)camera;
2679 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_REMOVE_GEOTAG;
2681 if (pc->cb_info == NULL) {
2682 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2683 return CAMERA_ERROR_INVALID_PARAMETER;
2685 sock_fd = pc->cb_info->fd;
2686 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2687 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2688 LOGD("ret : 0x%x", ret);
2693 int camera_attr_set_flash_mode(camera_h camera, camera_attr_flash_mode_e mode)
2695 if( camera == NULL){
2696 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2697 return CAMERA_ERROR_INVALID_PARAMETER;
2699 int ret = CAMERA_ERROR_NONE;
2700 camera_cli_s *pc = (camera_cli_s *)camera;
2701 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_FLASH_MODE;
2703 if (pc->cb_info == NULL) {
2704 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2705 return CAMERA_ERROR_INVALID_PARAMETER;
2707 sock_fd = pc->cb_info->fd;
2708 int set_mode = (int)mode;
2710 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2711 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
2712 LOGD("ret : 0x%x", ret);
2717 int camera_attr_get_zoom(camera_h camera, int *zoom)
2719 if( camera == NULL || zoom == NULL){
2720 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2721 return CAMERA_ERROR_INVALID_PARAMETER;
2723 int ret = CAMERA_ERROR_NONE;
2725 camera_cli_s *pc = (camera_cli_s *)camera;
2726 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_ZOOM;
2729 if (pc->cb_info == NULL) {
2730 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2731 return CAMERA_ERROR_INVALID_PARAMETER;
2733 sock_fd = pc->cb_info->fd;
2735 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2736 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2738 if (ret == CAMERA_ERROR_NONE) {
2739 muse_camera_msg_get(get_zoom, pc->cb_info->recvMsg);
2742 LOGD("ret : 0x%x", ret);
2747 int camera_attr_get_zoom_range(camera_h camera, int *min, int *max)
2749 if( camera == NULL || min == NULL || max == NULL ){
2750 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2751 return CAMERA_ERROR_INVALID_PARAMETER;
2753 int ret = CAMERA_ERROR_NONE;
2754 camera_cli_s *pc = (camera_cli_s *)camera;
2756 if (pc->cb_info == NULL) {
2757 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2758 return CAMERA_ERROR_INVALID_PARAMETER;
2760 sock_fd = pc->cb_info->fd;
2761 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_ZOOM_RANGE;
2765 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2766 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2768 if (ret == CAMERA_ERROR_NONE) {
2769 muse_camera_msg_get(get_min, pc->cb_info->recvMsg);
2770 muse_camera_msg_get(get_max, pc->cb_info->recvMsg);
2774 LOGD("ret : 0x%x", ret);
2779 int camera_attr_get_af_mode( camera_h camera, camera_attr_af_mode_e *mode)
2781 if( camera == NULL || mode == NULL){
2782 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2783 return CAMERA_ERROR_INVALID_PARAMETER;
2785 int ret = CAMERA_ERROR_NONE;
2786 camera_cli_s *pc = (camera_cli_s *)camera;
2788 if (pc->cb_info == NULL) {
2789 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2790 return CAMERA_ERROR_INVALID_PARAMETER;
2792 sock_fd = pc->cb_info->fd;
2793 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_AF_MODE;
2796 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2797 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2799 if (ret == CAMERA_ERROR_NONE) {
2800 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
2801 *mode = (camera_attr_af_mode_e)get_mode;
2803 LOGD("ret : 0x%x", ret);
2808 int camera_attr_get_exposure_mode( camera_h camera, camera_attr_exposure_mode_e *mode)
2810 if( camera == NULL|| mode == NULL){
2811 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2812 return CAMERA_ERROR_INVALID_PARAMETER;
2814 int ret = CAMERA_ERROR_NONE;
2815 camera_cli_s *pc = (camera_cli_s *)camera;
2817 if (pc->cb_info == NULL) {
2818 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2819 return CAMERA_ERROR_INVALID_PARAMETER;
2821 sock_fd = pc->cb_info->fd;
2822 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_EXPOSURE_MODE;
2825 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2826 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2828 if (ret == CAMERA_ERROR_NONE) {
2829 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
2830 *mode = (camera_attr_exposure_mode_e)get_mode;
2832 LOGD("ret : 0x%x", ret);
2836 int camera_attr_get_exposure(camera_h camera, int *value)
2838 if( camera == NULL || value == NULL){
2839 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2840 return CAMERA_ERROR_INVALID_PARAMETER;
2842 int ret = CAMERA_ERROR_NONE;
2843 camera_cli_s *pc = (camera_cli_s *)camera;
2845 if (pc->cb_info == NULL) {
2846 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2847 return CAMERA_ERROR_INVALID_PARAMETER;
2849 sock_fd = pc->cb_info->fd;
2850 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_EXPOSURE;
2853 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2854 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2856 if (ret == CAMERA_ERROR_NONE) {
2857 muse_camera_msg_get(get_value, pc->cb_info->recvMsg);
2860 LOGD("ret : 0x%x", ret);
2865 int camera_attr_get_exposure_range(camera_h camera, int *min, int *max)
2867 if( camera == NULL || min == NULL || max == NULL ){
2868 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2869 return CAMERA_ERROR_INVALID_PARAMETER;
2871 int ret = CAMERA_ERROR_NONE;
2872 camera_cli_s *pc = (camera_cli_s *)camera;
2874 if (pc->cb_info == NULL) {
2875 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2876 return CAMERA_ERROR_INVALID_PARAMETER;
2878 sock_fd = pc->cb_info->fd;
2879 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_EXPOSURE_RANGE;
2883 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2884 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2886 if (ret == CAMERA_ERROR_NONE) {
2887 muse_camera_msg_get(get_min, pc->cb_info->recvMsg);
2888 muse_camera_msg_get(get_max, pc->cb_info->recvMsg);
2892 LOGD("ret : 0x%x", ret);
2897 int camera_attr_get_iso( camera_h camera, camera_attr_iso_e *iso)
2899 if( camera == NULL || iso == NULL){
2900 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2901 return CAMERA_ERROR_INVALID_PARAMETER;
2903 int ret = CAMERA_ERROR_NONE;
2904 camera_cli_s *pc = (camera_cli_s *)camera;
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 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_ISO;
2914 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2915 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2917 if (ret == CAMERA_ERROR_NONE) {
2918 muse_camera_msg_get(get_iso, pc->cb_info->recvMsg);
2919 *iso = (camera_attr_iso_e)get_iso;
2921 LOGD("ret : 0x%x", ret);
2926 int camera_attr_get_brightness(camera_h camera, int *level)
2928 if( camera == NULL || level == NULL){
2929 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2930 return CAMERA_ERROR_INVALID_PARAMETER;
2932 int ret = CAMERA_ERROR_NONE;
2933 camera_cli_s *pc = (camera_cli_s *)camera;
2935 if (pc->cb_info == NULL) {
2936 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2937 return CAMERA_ERROR_INVALID_PARAMETER;
2939 sock_fd = pc->cb_info->fd;
2940 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_BRIGHTNESS;
2943 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2944 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2946 if (ret == CAMERA_ERROR_NONE) {
2947 muse_camera_msg_get(get_level, pc->cb_info->recvMsg);
2950 LOGD("ret : 0x%x", ret);
2955 int camera_attr_get_brightness_range(camera_h camera, int *min, int *max)
2957 if( camera == NULL || min == NULL || max == NULL ){
2958 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2959 return CAMERA_ERROR_INVALID_PARAMETER;
2961 int ret = CAMERA_ERROR_NONE;
2962 camera_cli_s *pc = (camera_cli_s *)camera;
2964 if (pc->cb_info == NULL) {
2965 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2966 return CAMERA_ERROR_INVALID_PARAMETER;
2968 sock_fd = pc->cb_info->fd;
2969 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_BRIGHTNESS_RANGE;
2973 LOGD("Enter, remote_handle : %x", pc->remote_handle);
2974 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
2976 if (ret == CAMERA_ERROR_NONE) {
2977 muse_camera_msg_get(get_min, pc->cb_info->recvMsg);
2978 muse_camera_msg_get(get_max, pc->cb_info->recvMsg);
2982 LOGD("ret : 0x%x", ret);
2987 int camera_attr_get_contrast(camera_h camera, int *level)
2989 if( camera == NULL || level == NULL){
2990 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2991 return CAMERA_ERROR_INVALID_PARAMETER;
2993 int ret = CAMERA_ERROR_NONE;
2994 camera_cli_s *pc = (camera_cli_s *)camera;
2995 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_CONTRAST;
2997 if (pc->cb_info == NULL) {
2998 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
2999 return CAMERA_ERROR_INVALID_PARAMETER;
3001 sock_fd = pc->cb_info->fd;
3004 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3005 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3007 if (ret == CAMERA_ERROR_NONE) {
3008 muse_camera_msg_get(get_level, pc->cb_info->recvMsg);
3011 LOGD("ret : 0x%x", ret);
3016 int camera_attr_get_contrast_range(camera_h camera, int *min , int *max)
3018 if( camera == NULL || min == NULL || max == NULL ){
3019 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3020 return CAMERA_ERROR_INVALID_PARAMETER;
3022 int ret = CAMERA_ERROR_NONE;
3023 camera_cli_s *pc = (camera_cli_s *)camera;
3024 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_CONTRAST_RANGE;
3026 if (pc->cb_info == NULL) {
3027 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3028 return CAMERA_ERROR_INVALID_PARAMETER;
3030 sock_fd = pc->cb_info->fd;
3034 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3035 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3037 if (ret == CAMERA_ERROR_NONE) {
3038 muse_camera_msg_get(get_min, pc->cb_info->recvMsg);
3039 muse_camera_msg_get(get_max, pc->cb_info->recvMsg);
3043 LOGD("ret : 0x%x", ret);
3048 int camera_attr_get_whitebalance(camera_h camera, camera_attr_whitebalance_e *wb)
3050 if( camera == NULL || wb == NULL){
3051 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3052 return CAMERA_ERROR_INVALID_PARAMETER;
3054 int ret = CAMERA_ERROR_NONE;
3055 camera_cli_s *pc = (camera_cli_s *)camera;
3056 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_WHITEBALANCE;
3058 if (pc->cb_info == NULL) {
3059 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3060 return CAMERA_ERROR_INVALID_PARAMETER;
3062 sock_fd = pc->cb_info->fd;
3065 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3066 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3068 if (ret == CAMERA_ERROR_NONE) {
3069 muse_camera_msg_get(get_wb, pc->cb_info->recvMsg);
3070 *wb = (camera_attr_whitebalance_e)get_wb;
3072 LOGD("ret : 0x%x", ret);
3077 int camera_attr_get_effect(camera_h camera, camera_attr_effect_mode_e *effect)
3079 if( camera == NULL || effect == NULL ){
3080 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3081 return CAMERA_ERROR_INVALID_PARAMETER;
3084 int ret = CAMERA_ERROR_NONE;
3085 camera_cli_s *pc = (camera_cli_s *)camera;
3086 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_EFFECT;
3088 if (pc->cb_info == NULL) {
3089 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3090 return CAMERA_ERROR_INVALID_PARAMETER;
3092 sock_fd = pc->cb_info->fd;
3095 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3096 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3098 if (ret == CAMERA_ERROR_NONE) {
3099 muse_camera_msg_get(get_effect, pc->cb_info->recvMsg);
3100 *effect = (camera_attr_effect_mode_e)get_effect;
3102 LOGD("ret : 0x%x", ret);
3107 int camera_attr_get_scene_mode(camera_h camera, camera_attr_scene_mode_e *mode)
3109 if( camera == NULL || mode == NULL){
3110 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3111 return CAMERA_ERROR_INVALID_PARAMETER;
3114 int ret = CAMERA_ERROR_NONE;
3115 camera_cli_s *pc = (camera_cli_s *)camera;
3116 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_SCENE_MODE;
3118 if (pc->cb_info == NULL) {
3119 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3120 return CAMERA_ERROR_INVALID_PARAMETER;
3122 sock_fd = pc->cb_info->fd;
3125 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3126 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3128 if (ret == CAMERA_ERROR_NONE) {
3129 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
3130 *mode = (camera_attr_scene_mode_e)get_mode;
3132 LOGD("ret : 0x%x", ret);
3137 int camera_attr_is_enabled_tag(camera_h camera, bool *enable)
3139 if( camera == NULL || enable == NULL){
3140 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3141 return CAMERA_ERROR_INVALID_PARAMETER;
3144 int ret = CAMERA_ERROR_NONE;
3145 camera_cli_s *pc = (camera_cli_s *)camera;
3146 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_ENABLED_TAG;
3148 if (pc->cb_info == NULL) {
3149 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3150 return CAMERA_ERROR_INVALID_PARAMETER;
3152 sock_fd = pc->cb_info->fd;
3155 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3156 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3158 if (ret == CAMERA_ERROR_NONE) {
3159 muse_camera_msg_get(get_enable, pc->cb_info->recvMsg);
3160 *enable = (bool)get_enable;
3162 LOGD("ret : 0x%x", ret);
3167 int camera_attr_get_tag_image_description(camera_h camera, char **description)
3169 if( camera == NULL || description == NULL){
3170 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3171 return CAMERA_ERROR_INVALID_PARAMETER;
3174 int ret = CAMERA_ERROR_NONE;
3175 camera_cli_s *pc = (camera_cli_s *)camera;
3176 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_TAG_IMAGE_DESCRIPTION;
3178 if (pc->cb_info == NULL) {
3179 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3180 return CAMERA_ERROR_INVALID_PARAMETER;
3182 sock_fd = pc->cb_info->fd;
3183 char get_description[MUSE_CAMERA_MSG_MAX_LENGTH] = {0,};
3185 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3186 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3188 if (ret == CAMERA_ERROR_NONE) {
3189 muse_camera_msg_get_string(get_description, pc->cb_info->recvMsg);
3190 *description = strdup(get_description);
3192 LOGD("ret : 0x%x", ret);
3197 int camera_attr_get_tag_orientation(camera_h camera, camera_attr_tag_orientation_e *orientation)
3199 if( camera == NULL || orientation == NULL){
3200 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3201 return CAMERA_ERROR_INVALID_PARAMETER;
3204 int ret = CAMERA_ERROR_NONE;
3205 camera_cli_s *pc = (camera_cli_s *)camera;
3206 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_TAG_ORIENTATION;
3208 if (pc->cb_info == NULL) {
3209 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3210 return CAMERA_ERROR_INVALID_PARAMETER;
3212 sock_fd = pc->cb_info->fd;
3213 int get_orientation;
3215 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3216 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3218 if (ret == CAMERA_ERROR_NONE) {
3219 muse_camera_msg_get(get_orientation, pc->cb_info->recvMsg);
3220 *orientation = (camera_attr_tag_orientation_e)get_orientation;
3221 LOGD("success, orientation : %d", *orientation);
3223 LOGD("ret : 0x%x", ret);
3228 int camera_attr_get_tag_software(camera_h camera, char **software)
3230 if( camera == NULL || software == NULL ){
3231 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3232 return CAMERA_ERROR_INVALID_PARAMETER;
3235 int ret = CAMERA_ERROR_NONE;
3236 camera_cli_s *pc = (camera_cli_s *)camera;
3237 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_TAG_SOFTWARE;
3239 if (pc->cb_info == NULL) {
3240 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3241 return CAMERA_ERROR_INVALID_PARAMETER;
3243 sock_fd = pc->cb_info->fd;
3244 char get_software[MUSE_CAMERA_MSG_MAX_LENGTH] = {0,};
3246 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3247 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3249 if (ret == CAMERA_ERROR_NONE) {
3250 muse_camera_msg_get_string(get_software, pc->cb_info->recvMsg);
3251 *software = strdup(get_software);
3253 LOGD("ret : 0x%x", ret);
3258 int camera_attr_get_geotag(camera_h camera, double *latitude , double *longitude, double *altitude)
3260 if( camera == NULL || latitude == NULL || longitude == NULL || altitude == NULL){
3261 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3262 return CAMERA_ERROR_INVALID_PARAMETER;
3265 int ret = CAMERA_ERROR_NONE;
3266 camera_cli_s *pc = (camera_cli_s *)camera;
3267 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_GEOTAG;
3268 double get_geotag[3] = {0,};
3270 if (pc->cb_info == NULL) {
3271 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3272 return CAMERA_ERROR_INVALID_PARAMETER;
3274 sock_fd = pc->cb_info->fd;
3276 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3277 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3279 if (ret == CAMERA_ERROR_NONE) {
3280 muse_camera_msg_get_array(get_geotag, pc->cb_info->recvMsg);
3281 *latitude = get_geotag[0];
3282 *longitude = get_geotag[1];
3283 *altitude = get_geotag[2];
3285 LOGE("Returned value is not valid : 0x%x", valid);
3290 LOGD("ret : 0x%x", ret);
3295 int camera_attr_get_flash_mode(camera_h camera, camera_attr_flash_mode_e *mode)
3297 if( camera == NULL || mode == NULL){
3298 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3299 return CAMERA_ERROR_INVALID_PARAMETER;
3302 int ret = CAMERA_ERROR_NONE;
3303 camera_cli_s *pc = (camera_cli_s *)camera;
3304 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_FLASH_MODE;
3306 if (pc->cb_info == NULL) {
3307 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3308 return CAMERA_ERROR_INVALID_PARAMETER;
3310 sock_fd = pc->cb_info->fd;
3313 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3314 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3316 if (ret == CAMERA_ERROR_NONE) {
3317 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
3318 *mode = (camera_attr_flash_mode_e)get_mode;
3320 LOGD("ret : 0x%x", ret);
3325 int camera_attr_foreach_supported_af_mode( camera_h camera, camera_attr_supported_af_mode_cb foreach_cb , void *user_data)
3327 if( camera == NULL || foreach_cb == NULL){
3328 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3329 return CAMERA_ERROR_INVALID_PARAMETER;
3331 int ret = CAMERA_ERROR_NONE;
3333 camera_cli_s *pc = (camera_cli_s *)camera;
3334 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_AF_MODE;
3336 LOGD("Enter, handle :%x", pc->remote_handle);
3339 if (pc->cb_info == NULL) {
3340 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3341 return CAMERA_ERROR_INVALID_PARAMETER;
3343 sock_fd = pc->cb_info->fd;
3344 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_AF_MODE] = foreach_cb;
3345 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_AF_MODE] = user_data;
3347 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3348 LOGD("ret : 0x%x", ret);
3353 int camera_attr_foreach_supported_exposure_mode(camera_h camera, camera_attr_supported_exposure_mode_cb foreach_cb , void *user_data)
3355 if( camera == NULL || foreach_cb == NULL){
3356 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3357 return CAMERA_ERROR_INVALID_PARAMETER;
3359 int ret = CAMERA_ERROR_NONE;
3361 camera_cli_s *pc = (camera_cli_s *)camera;
3362 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_EXPOSURE_MODE;
3364 LOGD("Enter, handle :%x", pc->remote_handle);
3367 if (pc->cb_info == NULL) {
3368 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3369 return CAMERA_ERROR_INVALID_PARAMETER;
3371 sock_fd = pc->cb_info->fd;
3372 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EXPOSURE_MODE] = foreach_cb;
3373 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EXPOSURE_MODE] = user_data;
3375 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3376 LOGD("ret : 0x%x", ret);
3381 int camera_attr_foreach_supported_iso( camera_h camera, camera_attr_supported_iso_cb foreach_cb , void *user_data)
3383 if( camera == NULL || foreach_cb == NULL){
3384 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3385 return CAMERA_ERROR_INVALID_PARAMETER;
3387 int ret = CAMERA_ERROR_NONE;
3389 camera_cli_s *pc = (camera_cli_s *)camera;
3390 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_ISO;
3392 LOGD("Enter, handle :%x", pc->remote_handle);
3395 if (pc->cb_info == NULL) {
3396 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3397 return CAMERA_ERROR_INVALID_PARAMETER;
3399 sock_fd = pc->cb_info->fd;
3400 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_ISO] = foreach_cb;
3401 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_ISO] = user_data;
3403 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3404 LOGD("ret : 0x%x", ret);
3409 int camera_attr_foreach_supported_whitebalance(camera_h camera, camera_attr_supported_whitebalance_cb foreach_cb , void *user_data)
3411 if( camera == NULL || foreach_cb == NULL){
3412 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3413 return CAMERA_ERROR_INVALID_PARAMETER;
3415 int ret = CAMERA_ERROR_NONE;
3417 camera_cli_s *pc = (camera_cli_s *)camera;
3418 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_WHITEBALANCE;
3420 LOGD("Enter, handle :%x", pc->remote_handle);
3423 if (pc->cb_info == NULL) {
3424 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3425 return CAMERA_ERROR_INVALID_PARAMETER;
3427 sock_fd = pc->cb_info->fd;
3428 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_WHITEBALANCE] = foreach_cb;
3429 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_WHITEBALANCE] = user_data;
3431 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3432 LOGD("ret : 0x%x", ret);
3437 int camera_attr_foreach_supported_effect(camera_h camera, camera_attr_supported_effect_cb foreach_cb , void *user_data)
3439 if( camera == NULL || foreach_cb == NULL){
3440 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3441 return CAMERA_ERROR_INVALID_PARAMETER;
3443 int ret = CAMERA_ERROR_NONE;
3445 camera_cli_s *pc = (camera_cli_s *)camera;
3446 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_EFFECT;
3448 LOGD("Enter, handle :%x", pc->remote_handle);
3451 if (pc->cb_info == NULL) {
3452 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3453 return CAMERA_ERROR_INVALID_PARAMETER;
3455 sock_fd = pc->cb_info->fd;
3456 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EFFECT] = foreach_cb;
3457 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EFFECT] = user_data;
3459 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3460 LOGD("ret : 0x%x", ret);
3465 int camera_attr_foreach_supported_scene_mode(camera_h camera, camera_attr_supported_scene_mode_cb foreach_cb , void *user_data)
3467 if( camera == NULL || foreach_cb == NULL){
3468 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3469 return CAMERA_ERROR_INVALID_PARAMETER;
3471 int ret = CAMERA_ERROR_NONE;
3473 camera_cli_s *pc = (camera_cli_s *)camera;
3474 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_SCENE_MODE;
3476 LOGD("Enter, handle :%x", pc->remote_handle);
3479 if (pc->cb_info == NULL) {
3480 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3481 return CAMERA_ERROR_INVALID_PARAMETER;
3483 sock_fd = pc->cb_info->fd;
3484 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_SCENE_MODE] = foreach_cb;
3485 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_SCENE_MODE] = user_data;
3487 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3488 LOGD("ret : 0x%x", ret);
3493 int camera_attr_foreach_supported_flash_mode(camera_h camera, camera_attr_supported_flash_mode_cb foreach_cb , void *user_data)
3495 if( camera == NULL || foreach_cb == NULL){
3496 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3497 return CAMERA_ERROR_INVALID_PARAMETER;
3499 int ret = CAMERA_ERROR_NONE;
3501 camera_cli_s *pc = (camera_cli_s *)camera;
3502 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_FLASH_MODE;
3504 LOGD("Enter, handle :%x", pc->remote_handle);
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 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FLASH_MODE] = foreach_cb;
3513 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FLASH_MODE] = user_data;
3515 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3516 LOGD("ret : 0x%x", ret);
3521 int camera_attr_foreach_supported_fps(camera_h camera, camera_attr_supported_fps_cb foreach_cb , void *user_data)
3523 if( camera == NULL || foreach_cb == NULL){
3524 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3525 return CAMERA_ERROR_INVALID_PARAMETER;
3527 int ret = CAMERA_ERROR_NONE;
3529 camera_cli_s *pc = (camera_cli_s *)camera;
3530 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_FPS;
3532 if (pc->cb_info == NULL) {
3533 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3534 return CAMERA_ERROR_INVALID_PARAMETER;
3536 sock_fd = pc->cb_info->fd;
3537 LOGD("Enter, handle :%x", pc->remote_handle);
3538 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS] = foreach_cb;
3539 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS] = user_data;
3541 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3542 LOGD("Enter, handle :%x", pc->remote_handle);
3546 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)
3548 if( camera == NULL || foreach_cb == NULL){
3549 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3550 return CAMERA_ERROR_INVALID_PARAMETER;
3552 int ret = CAMERA_ERROR_NONE;
3554 camera_cli_s *pc = (camera_cli_s *)camera;
3555 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_FPS_BY_RESOLUTION;
3557 if (pc->cb_info == NULL) {
3558 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3559 return CAMERA_ERROR_INVALID_PARAMETER;
3561 sock_fd = pc->cb_info->fd;
3562 LOGD("Enter, handle :%x", pc->remote_handle);
3563 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS_BY_RESOLUTION] = foreach_cb;
3564 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS_BY_RESOLUTION] = user_data;
3566 muse_camera_msg_send2(api, sock_fd, pc->cb_info, ret, INT, width, INT, height);
3567 LOGD("ret : 0x%x", ret);
3571 int camera_attr_foreach_supported_stream_flip(camera_h camera, camera_attr_supported_stream_flip_cb foreach_cb, void *user_data)
3573 if( camera == NULL || foreach_cb == NULL){
3574 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3575 return CAMERA_ERROR_INVALID_PARAMETER;
3577 int ret = CAMERA_ERROR_NONE;
3579 camera_cli_s *pc = (camera_cli_s *)camera;
3580 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_STREAM_FLIP;
3582 if (pc->cb_info == NULL) {
3583 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3584 return CAMERA_ERROR_INVALID_PARAMETER;
3586 sock_fd = pc->cb_info->fd;
3587 LOGD("Enter, handle :%x", pc->remote_handle);
3588 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_FLIP] = foreach_cb;
3589 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_FLIP] = user_data;
3591 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3592 LOGD("ret : 0x%x", ret);
3597 int camera_attr_foreach_supported_stream_rotation(camera_h camera, camera_attr_supported_stream_rotation_cb foreach_cb, void *user_data)
3599 if( camera == NULL || foreach_cb == NULL){
3600 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3601 return CAMERA_ERROR_INVALID_PARAMETER;
3603 int ret = CAMERA_ERROR_NONE;
3605 camera_cli_s *pc = (camera_cli_s *)camera;
3606 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_STREAM_ROTATION;
3608 if (pc->cb_info == NULL) {
3609 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3610 return CAMERA_ERROR_INVALID_PARAMETER;
3612 sock_fd = pc->cb_info->fd;
3613 LOGD("Enter, handle :%x", pc->remote_handle);
3614 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_ROTATION] = foreach_cb;
3615 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_ROTATION] = user_data;
3617 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3618 LOGD("ret : 0x%x", ret);
3623 int camera_attr_set_stream_rotation(camera_h camera , camera_rotation_e rotation)
3625 if( camera == NULL){
3626 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3627 return CAMERA_ERROR_INVALID_PARAMETER;
3630 int ret = CAMERA_ERROR_NONE;
3631 camera_cli_s *pc = (camera_cli_s *)camera;
3632 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_STREAM_ROTATION;
3634 if (pc->cb_info == NULL) {
3635 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3636 return CAMERA_ERROR_INVALID_PARAMETER;
3638 sock_fd = pc->cb_info->fd;
3639 int set_rotation = (int)rotation;
3641 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3642 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_rotation);
3643 LOGD("ret : 0x%x", ret);
3648 int camera_attr_get_stream_rotation(camera_h camera , camera_rotation_e *rotation)
3650 if( camera == NULL || rotation == NULL ){
3651 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3652 return CAMERA_ERROR_INVALID_PARAMETER;
3655 int ret = CAMERA_ERROR_NONE;
3656 camera_cli_s *pc = (camera_cli_s *)camera;
3657 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_STREAM_ROTATION;
3659 if (pc->cb_info == NULL) {
3660 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3661 return CAMERA_ERROR_INVALID_PARAMETER;
3663 sock_fd = pc->cb_info->fd;
3666 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3667 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3669 if (ret == CAMERA_ERROR_NONE) {
3670 muse_camera_msg_get(get_rotation, pc->cb_info->recvMsg);
3671 *rotation = (camera_rotation_e)get_rotation;
3673 LOGD("ret : 0x%x", ret);
3678 int camera_attr_set_stream_flip(camera_h camera , camera_flip_e flip)
3680 if( camera == NULL){
3681 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3682 return CAMERA_ERROR_INVALID_PARAMETER;
3685 int ret = CAMERA_ERROR_NONE;
3686 camera_cli_s *pc = (camera_cli_s *)camera;
3687 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_STREAM_FLIP;
3689 if (pc->cb_info == NULL) {
3690 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3691 return CAMERA_ERROR_INVALID_PARAMETER;
3693 sock_fd = pc->cb_info->fd;
3694 int set_flip = (int)flip;
3696 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3697 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_flip);
3698 LOGD("ret : 0x%x", ret);
3703 int camera_attr_get_stream_flip(camera_h camera , camera_flip_e *flip)
3705 if( camera == NULL || flip == NULL ){
3706 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3707 return CAMERA_ERROR_INVALID_PARAMETER;
3710 int ret = CAMERA_ERROR_NONE;
3711 camera_cli_s *pc = (camera_cli_s *)camera;
3712 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_STREAM_FLIP;
3714 if (pc->cb_info == NULL) {
3715 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3716 return CAMERA_ERROR_INVALID_PARAMETER;
3718 sock_fd = pc->cb_info->fd;
3721 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3722 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3724 if (ret == CAMERA_ERROR_NONE) {
3725 muse_camera_msg_get(get_flip, pc->cb_info->recvMsg);
3726 *flip = (camera_flip_e)get_flip;
3728 LOGD("ret : 0x%x", ret);
3732 int camera_attr_set_hdr_mode(camera_h camera, camera_attr_hdr_mode_e mode)
3734 if( camera == NULL){
3735 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
3736 return CAMERA_ERROR_INVALID_PARAMETER;
3739 int ret = CAMERA_ERROR_NONE;
3740 camera_cli_s *pc = (camera_cli_s *)camera;
3741 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_HDR_MODE;
3743 if (pc->cb_info == NULL) {
3744 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3745 return CAMERA_ERROR_INVALID_PARAMETER;
3747 sock_fd = pc->cb_info->fd;
3748 int set_mode = (int)mode;
3750 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3751 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_mode);
3752 LOGD("ret : 0x%x", ret);
3757 int camera_attr_get_hdr_mode(camera_h camera, camera_attr_hdr_mode_e *mode)
3759 if (camera == NULL) {
3760 LOGE("INVALID_PARAMETER(0x%08x) - handle",CAMERA_ERROR_INVALID_PARAMETER);
3761 return CAMERA_ERROR_INVALID_PARAMETER;
3764 LOGE("CAMERA_ERROR_NOT_SUPPORTED(0x%08x) - mode",CAMERA_ERROR_NOT_SUPPORTED);
3765 return CAMERA_ERROR_NOT_SUPPORTED;
3767 int ret = CAMERA_ERROR_NONE;
3768 camera_cli_s *pc = (camera_cli_s *)camera;
3769 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_HDR_MODE;
3771 if (pc->cb_info == NULL) {
3772 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3773 return CAMERA_ERROR_INVALID_PARAMETER;
3775 sock_fd = pc->cb_info->fd;
3778 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3779 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3781 if (ret == CAMERA_ERROR_NONE) {
3782 muse_camera_msg_get(get_mode, pc->cb_info->recvMsg);
3783 *mode = (camera_attr_hdr_mode_e)get_mode;
3785 LOGD("ret : 0x%x", ret);
3790 bool camera_attr_is_supported_hdr_capture(camera_h camera)
3792 if( camera == NULL){
3793 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3797 int ret = CAMERA_ERROR_NONE;
3798 camera_cli_s *pc = (camera_cli_s *)camera;
3799 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_SUPPORTED_HDR_CAPTURE;
3801 if (pc->cb_info == NULL) {
3802 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3803 return CAMERA_ERROR_INVALID_PARAMETER;
3805 sock_fd = pc->cb_info->fd;
3806 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3807 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3808 LOGD("ret : 0x%x", ret);
3813 int camera_attr_set_hdr_capture_progress_cb(camera_h camera, camera_attr_hdr_progress_cb callback, void* user_data)
3815 if (camera == NULL) {
3816 LOGE("INVALID_PARAMETER(0x%08x) - handle", CAMERA_ERROR_INVALID_PARAMETER);
3817 return CAMERA_ERROR_INVALID_PARAMETER;
3819 if (callback == NULL) {
3820 LOGE("CAMERA_ERROR_NOT_SUPPORTED(0x%08x) - callback", CAMERA_ERROR_NOT_SUPPORTED);
3821 return CAMERA_ERROR_NOT_SUPPORTED;
3823 int ret = CAMERA_ERROR_NONE;
3825 camera_cli_s *pc = (camera_cli_s *)camera;
3826 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_HDR_CAPTURE_PROGRESS_CB;
3828 if (pc->cb_info == NULL) {
3829 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3830 return CAMERA_ERROR_INVALID_PARAMETER;
3832 sock_fd = pc->cb_info->fd;
3833 LOGD("Enter, handle :%x", pc->remote_handle);
3835 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_HDR_PROGRESS] = callback;
3836 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_HDR_PROGRESS] = user_data;
3838 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3839 LOGD("ret : 0x%x", ret);
3844 int camera_attr_unset_hdr_capture_progress_cb(camera_h camera)
3846 if( camera == NULL){
3847 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3848 return CAMERA_ERROR_INVALID_PARAMETER;
3851 int ret = CAMERA_ERROR_NONE;
3853 camera_cli_s *pc = (camera_cli_s *)camera;
3854 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_UNSET_HDR_CAPTURE_PROGRESS_CB;
3856 if (pc->cb_info == NULL) {
3857 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3858 return CAMERA_ERROR_INVALID_PARAMETER;
3860 sock_fd = pc->cb_info->fd;
3861 LOGD("Enter, handle :%x", pc->remote_handle);
3863 pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_HDR_PROGRESS] = (void *)NULL;
3864 pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_HDR_PROGRESS] = (void *)NULL;
3866 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3867 LOGD("ret : 0x%x", ret);
3872 int camera_attr_enable_anti_shake(camera_h camera, bool enable)
3874 if (camera == NULL) {
3875 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3876 return CAMERA_ERROR_INVALID_PARAMETER;
3879 int ret = CAMERA_ERROR_NONE;
3880 camera_cli_s *pc = (camera_cli_s *)camera;
3881 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_ENABLE_ANTI_SHAKE;
3883 if (pc->cb_info == NULL) {
3884 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3885 return CAMERA_ERROR_INVALID_PARAMETER;
3887 sock_fd = pc->cb_info->fd;
3888 int set_enable = (int)enable;
3890 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3891 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_enable);
3892 LOGD("ret : 0x%x", ret);
3897 int camera_attr_is_enabled_anti_shake(camera_h camera , bool *enabled)
3899 if (camera == NULL) {
3900 LOGE("INVALID_PARAMETER(0x%08x) - handle", CAMERA_ERROR_INVALID_PARAMETER);
3901 return CAMERA_ERROR_INVALID_PARAMETER;
3903 if (enabled == NULL) {
3904 LOGE("INVALID_PARAMETER(0x%08x) - enabled", CAMERA_ERROR_INVALID_PARAMETER);
3905 return CAMERA_ERROR_NOT_SUPPORTED;
3907 int ret = CAMERA_ERROR_NONE;
3908 camera_cli_s *pc = (camera_cli_s *)camera;
3909 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_ENABLED_ANTI_SHAKE;
3911 if (pc->cb_info == NULL) {
3912 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3913 return CAMERA_ERROR_INVALID_PARAMETER;
3915 sock_fd = pc->cb_info->fd;
3918 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3919 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3921 if (ret == CAMERA_ERROR_NONE) {
3922 muse_camera_msg_get(get_enabled, pc->cb_info->recvMsg);
3923 *enabled = (bool)get_enabled;
3925 LOGD("ret : 0x%x", ret);
3930 bool camera_attr_is_supported_anti_shake(camera_h camera)
3933 if( camera == NULL){
3934 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3938 int ret = CAMERA_ERROR_NONE;
3939 camera_cli_s *pc = (camera_cli_s *)camera;
3940 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_SUPPORTED_ANTI_SHAKE;
3942 if (pc->cb_info == NULL) {
3943 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3944 return CAMERA_ERROR_INVALID_PARAMETER;
3946 sock_fd = pc->cb_info->fd;
3947 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3948 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
3949 LOGD("ret : 0x%x", ret);
3954 int camera_attr_enable_video_stabilization(camera_h camera, bool enable)
3956 if (camera == NULL) {
3957 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3958 return CAMERA_ERROR_INVALID_PARAMETER;
3961 int ret = CAMERA_ERROR_NONE;
3962 camera_cli_s *pc = (camera_cli_s *)camera;
3963 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_ENABLE_VIDEO_STABILIZATION;
3965 if (pc->cb_info == NULL) {
3966 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3967 return CAMERA_ERROR_INVALID_PARAMETER;
3969 sock_fd = pc->cb_info->fd;
3970 int set_enable = (int)enable;
3972 LOGD("Enter, remote_handle : %x", pc->remote_handle);
3973 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_enable);
3974 LOGD("ret : 0x%x", ret);
3979 int camera_attr_is_enabled_video_stabilization(camera_h camera, bool *enabled)
3981 if (camera == NULL) {
3982 LOGE("INVALID_PARAMETER(0x%08x) - handle",CAMERA_ERROR_INVALID_PARAMETER);
3983 return CAMERA_ERROR_INVALID_PARAMETER;
3985 if (enabled == NULL) {
3986 LOGE("INVALID_PARAMETER(0x%08x) - enabled",CAMERA_ERROR_INVALID_PARAMETER);
3987 return CAMERA_ERROR_NOT_SUPPORTED;
3989 int ret = CAMERA_ERROR_NONE;
3990 camera_cli_s *pc = (camera_cli_s *)camera;
3991 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_ENABLED_VIDEO_STABILIZATION;
3993 if (pc->cb_info == NULL) {
3994 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
3995 return CAMERA_ERROR_INVALID_PARAMETER;
3997 sock_fd = pc->cb_info->fd;
4000 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4001 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4003 if (ret == CAMERA_ERROR_NONE) {
4004 muse_camera_msg_get(get_enabled, pc->cb_info->recvMsg);
4005 *enabled = (bool)get_enabled;
4007 LOGD("ret : 0x%x", ret);
4012 bool camera_attr_is_supported_video_stabilization(camera_h camera)
4014 if( camera == NULL){
4015 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4019 int ret = CAMERA_ERROR_NONE;
4020 camera_cli_s *pc = (camera_cli_s *)camera;
4021 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_SUPPORTED_VIDEO_STABILIZATION;
4023 if (pc->cb_info == NULL) {
4024 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4025 return CAMERA_ERROR_INVALID_PARAMETER;
4027 sock_fd = pc->cb_info->fd;
4028 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4029 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4030 LOGD("ret : 0x%x", ret);
4035 int camera_attr_enable_auto_contrast(camera_h camera, bool enable)
4037 if( camera == NULL){
4038 LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
4039 return CAMERA_ERROR_INVALID_PARAMETER;
4042 int ret = CAMERA_ERROR_NONE;
4043 camera_cli_s *pc = (camera_cli_s *)camera;
4044 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_ENABLE_AUTO_CONTRAST;
4046 if (pc->cb_info == NULL) {
4047 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4048 return CAMERA_ERROR_INVALID_PARAMETER;
4050 sock_fd = pc->cb_info->fd;
4051 int set_enable = (int)enable;
4053 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4054 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_enable);
4055 LOGD("ret : 0x%x", ret);
4060 int camera_attr_is_enabled_auto_contrast(camera_h camera, bool *enabled)
4062 if (camera == NULL) {
4063 LOGE("INVALID_PARAMETER(0x%08x) - handle", CAMERA_ERROR_INVALID_PARAMETER);
4064 return CAMERA_ERROR_INVALID_PARAMETER;
4066 if (enabled == NULL) {
4067 LOGE("INVALID_PARAMETER(0x%08x) - enabled", CAMERA_ERROR_INVALID_PARAMETER);
4068 return CAMERA_ERROR_INVALID_PARAMETER;
4070 int ret = CAMERA_ERROR_NONE;
4071 camera_cli_s *pc = (camera_cli_s *)camera;
4072 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_ENABLED_AUTO_CONTRAST;
4074 if (pc->cb_info == NULL) {
4075 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4076 return CAMERA_ERROR_INVALID_PARAMETER;
4078 sock_fd = pc->cb_info->fd;
4081 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4082 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4084 if (ret == CAMERA_ERROR_NONE) {
4085 muse_camera_msg_get(get_enabled, pc->cb_info->recvMsg);
4086 *enabled = (bool)get_enabled;
4088 LOGD("ret : 0x%x", ret);
4093 bool camera_attr_is_supported_auto_contrast(camera_h camera)
4095 if( camera == NULL){
4096 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4100 int ret = CAMERA_ERROR_NONE;
4101 camera_cli_s *pc = (camera_cli_s *)camera;
4102 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_SUPPORTED_AUTO_CONTRAST;
4104 if (pc->cb_info == NULL) {
4105 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4106 return CAMERA_ERROR_INVALID_PARAMETER;
4108 sock_fd = pc->cb_info->fd;
4109 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4110 muse_camera_msg_send(api, sock_fd, pc->cb_info, ret);
4111 LOGD("ret : 0x%x", ret);
4116 int camera_attr_disable_shutter_sound(camera_h camera, bool disable)
4118 if (camera == NULL) {
4119 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4120 return CAMERA_ERROR_INVALID_PARAMETER;
4123 int ret = CAMERA_ERROR_NONE;
4124 camera_cli_s *pc = (camera_cli_s *)camera;
4125 muse_camera_api_e api = MUSE_CAMERA_API_ATTR_DISABLE_SHUTTER_SOUND;
4127 if (pc->cb_info == NULL) {
4128 LOGE("INVALID_PARAMETER(0x%08x)",CAMERA_ERROR_INVALID_PARAMETER);
4129 return CAMERA_ERROR_INVALID_PARAMETER;
4131 sock_fd = pc->cb_info->fd;
4132 int set_disable = (int)disable;
4134 LOGD("Enter, remote_handle : %x", pc->remote_handle);
4135 muse_camera_msg_send1(api, sock_fd, pc->cb_info, ret, INT, set_disable);
4136 LOGD("ret : 0x%x", ret);